Initial revision
authorMark Huang <mlhuang@cs.princeton.edu>
Wed, 2 Jun 2004 19:38:25 +0000 (19:38 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Wed, 2 Jun 2004 19:38:25 +0000 (19:38 +0000)
128 files changed:
.config [new file with mode: 0644]
.config.cmd [new file with mode: 0644]
.config.old [new file with mode: 0644]
Documentation/COPYING.modules [new file with mode: 0644]
Documentation/fb/pxafb.txt [new file with mode: 0644]
Documentation/numastat.txt [new file with mode: 0644]
Documentation/sched-domains.txt [new file with mode: 0644]
Documentation/scsi/sym53c500_cs.txt [new file with mode: 0644]
arch/arm/mach-ixp4xx/Kconfig [new file with mode: 0644]
arch/arm/mach-ixp4xx/coyote-setup.c [new file with mode: 0644]
arch/arm/mach-ixp4xx/ixdp425-setup.c [new file with mode: 0644]
arch/arm/mach-pxa/leds-mainstone.c [new file with mode: 0644]
arch/arm/mach-pxa/mainstone.c [new file with mode: 0644]
arch/arm/mach-pxa/pxa25x.c [new file with mode: 0644]
arch/arm/mach-pxa/pxa27x.c [new file with mode: 0644]
arch/h8300/Kconfig.cpu [new file with mode: 0644]
arch/h8300/kernel/module.c [new file with mode: 0644]
arch/i386/kernel/entry_trampoline.c [new file with mode: 0644]
arch/i386/mach-es7000/es7000plat.c [new file with mode: 0644]
arch/ia64/scripts/check-serialize.S [new file with mode: 0644]
arch/ppc/configs/bubinga_defconfig [new file with mode: 0644]
arch/ppc/syslib/ibm_ocp.c [new file with mode: 0644]
arch/x86_64/kernel/Makefile-HEAD [new file with mode: 0644]
configs/kernel-2.6.6-i586-smp.config [new file with mode: 0644]
configs/kernel-2.6.6-i586.config [new file with mode: 0644]
configs/kernel-2.6.6-i686-smp.config [new file with mode: 0644]
configs/kernel-2.6.6-i686.config [new file with mode: 0644]
drivers/char/crash.c [new file with mode: 0644]
drivers/ide/arm/ide_arm.c [new file with mode: 0644]
drivers/net/ibm_emac/Makefile [new file with mode: 0644]
drivers/net/ibm_emac/ibm_emac_core.c [new file with mode: 0644]
drivers/net/ibm_emac/ibm_emac_phy.h [new file with mode: 0644]
drivers/pcmcia/pxa2xx_base.c [new file with mode: 0644]
drivers/pcmcia/pxa2xx_lubbock.c [new file with mode: 0644]
drivers/pcmcia/pxa2xx_mainstone.c [new file with mode: 0644]
drivers/pcmcia/sa11xx_base.c [new file with mode: 0644]
drivers/pcmcia/sa11xx_base.h [new file with mode: 0644]
drivers/pcmcia/soc_common.c [new file with mode: 0644]
drivers/pcmcia/soc_common.h [new file with mode: 0644]
drivers/scsi/qlogicfas408.c [new file with mode: 0644]
drivers/scsi/sata_sx4.c [new file with mode: 0644]
drivers/video/pxafb.c [new file with mode: 0644]
fs/ext3/resize.c [new file with mode: 0644]
fs/reiserfs/xattr_security.c [new file with mode: 0644]
fs/reiserfs/xattr_trusted.c [new file with mode: 0644]
fs/reiserfs/xattr_user.c [new file with mode: 0644]
fs/xfs/linux-2.6/mutex.h [new file with mode: 0644]
fs/xfs/linux-2.6/spin.h [new file with mode: 0644]
fs/xfs/linux-2.6/time.h [new file with mode: 0644]
fs/xfs/linux-2.6/xfs_cred.h [new file with mode: 0644]
fs/xfs/linux-2.6/xfs_fs_subr.h [new file with mode: 0644]
fs/xfs/linux-2.6/xfs_globals.h [new file with mode: 0644]
fs/xfs/linux-2.6/xfs_iops.c [new file with mode: 0644]
fs/xfs/linux-2.6/xfs_stats.h [new file with mode: 0644]
fs/xfs/linux-2.6/xfs_version.h [new file with mode: 0644]
include/asm-alpha/8253pit.h [new file with mode: 0644]
include/asm-arm/arch-ixp4xx/coyote.h [new file with mode: 0644]
include/asm-arm/arch-ixp4xx/hardware.h [new file with mode: 0644]
include/asm-arm/arch-ixp4xx/irqs.h [new file with mode: 0644]
include/asm-arm/arch-ixp4xx/ixdp425.h [new file with mode: 0644]
include/asm-arm/arch-ixp4xx/ixp4xx-regs.h [new file with mode: 0644]
include/asm-arm/arch-ixp4xx/prpmc1100.h [new file with mode: 0644]
include/asm-arm/arch-ixp4xx/timex.h [new file with mode: 0644]
include/asm-arm/arch-ixp4xx/vmalloc.h [new file with mode: 0644]
include/asm-arm/arch-pxa/mainstone.h [new file with mode: 0644]
include/asm-i386/8253pit.h [new file with mode: 0644]
include/asm-i386/atomic_kmap.h [new file with mode: 0644]
include/asm-i386/crash.h [new file with mode: 0644]
include/asm-ia64/cpu.h [new file with mode: 0644]
include/asm-ia64/crash.h [new file with mode: 0644]
include/asm-mips/8253pit.h [new file with mode: 0644]
include/asm-mips/pmon.h [new file with mode: 0644]
include/asm-parisc/unwind.h [new file with mode: 0644]
include/asm-ppc/ibm_ocp.h [new file with mode: 0644]
include/asm-sparc64/const.h [new file with mode: 0644]
include/asm-x86_64/8253pit.h [new file with mode: 0644]
include/linux/autoconf.h [new file with mode: 0644]
include/linux/prio_tree.h [new file with mode: 0644]
include/net/tux.h [new file with mode: 0644]
include/net/tux_u.h [new file with mode: 0644]
include/video/gbe.h [new file with mode: 0644]
mm/mempolicy.c [new file with mode: 0644]
mm/prio_tree.c [new file with mode: 0644]
mm/usercopy.c [new file with mode: 0644]
net/bridge/br_sysfs_if.c [new file with mode: 0644]
net/tux/Kconfig [new file with mode: 0644]
net/tux/Makefile [new file with mode: 0644]
net/tux/abuf.c [new file with mode: 0644]
net/tux/accept.c [new file with mode: 0644]
net/tux/cachemiss.c [new file with mode: 0644]
net/tux/cgi.c [new file with mode: 0644]
net/tux/directory.c [new file with mode: 0644]
net/tux/extcgi.c [new file with mode: 0644]
net/tux/gzip.c [new file with mode: 0644]
net/tux/input.c [new file with mode: 0644]
net/tux/logger.c [new file with mode: 0644]
net/tux/main.c [new file with mode: 0644]
net/tux/mod.c [new file with mode: 0644]
net/tux/output.c [new file with mode: 0644]
net/tux/parser.h [new file with mode: 0644]
net/tux/postpone.c [new file with mode: 0644]
net/tux/proc.c [new file with mode: 0644]
net/tux/proto_ftp.c [new file with mode: 0644]
net/tux/proto_http.c [new file with mode: 0644]
net/tux/redirect.c [new file with mode: 0644]
net/tux/times.c [new file with mode: 0644]
net/tux/times.h [new file with mode: 0644]
net/tux/userspace.c [new file with mode: 0644]
scripts/basic/.docproc.cmd [new file with mode: 0644]
scripts/basic/.fixdep.cmd [new file with mode: 0644]
scripts/basic/.split-include.cmd [new file with mode: 0644]
scripts/basic/docproc [new file with mode: 0755]
scripts/basic/fixdep [new file with mode: 0755]
scripts/basic/split-include [new file with mode: 0755]
scripts/kconfig/.conf.cmd [new file with mode: 0644]
scripts/kconfig/.conf.o.cmd [new file with mode: 0644]
scripts/kconfig/.libkconfig.so.cmd [new file with mode: 0644]
scripts/kconfig/.mconf.o.cmd [new file with mode: 0644]
scripts/kconfig/.zconf.tab.o.cmd [new file with mode: 0644]
scripts/kconfig/conf [new file with mode: 0755]
scripts/kconfig/conf.o [new file with mode: 0644]
scripts/kconfig/lex.zconf.c [new file with mode: 0644]
scripts/kconfig/libkconfig.so [new file with mode: 0755]
scripts/kconfig/mconf.o [new file with mode: 0644]
scripts/kconfig/zconf.tab.c [new file with mode: 0644]
scripts/kconfig/zconf.tab.h [new file with mode: 0644]
scripts/kconfig/zconf.tab.o [new file with mode: 0644]
scripts/reference_discarded.pl [new file with mode: 0644]

diff --git a/.config b/.config
new file mode 100644 (file)
index 0000000..de7e3e7
--- /dev/null
+++ b/.config
@@ -0,0 +1,2348 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_X86=y
+CONFIG_MMU=y
+CONFIG_UID16=y
+CONFIG_GENERIC_ISA_DMA=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_HOTPLUG=y
+# CONFIG_IKCONFIG is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+
+#
+# Processor type and features
+#
+# CONFIG_X86_PC is not set
+# 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=y
+# CONFIG_X86_ES7000 is not set
+CONFIG_X86_CYCLONE_TIMER=y
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+CONFIG_M686=y
+# 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_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP2 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_XADD=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+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_INTEL_USERCOPY=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_4G=y
+CONFIG_X86_SWITCH_PAGETABLES=y
+CONFIG_X86_4G_VM_LAYOUT=y
+CONFIG_X86_UACCESS_INDIRECT=y
+CONFIG_X86_HIGH_ENTRY=y
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=32
+CONFIG_SCHED_SMT=y
+# CONFIG_PREEMPT is not set
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_X86_IO_APIC=y
+CONFIG_X86_TSC=y
+CONFIG_X86_MCE=y
+# CONFIG_X86_MCE_NONFATAL is not set
+CONFIG_X86_MCE_P4THERMAL=y
+CONFIG_TOSHIBA=m
+CONFIG_I8K=m
+CONFIG_MICROCODE=m
+CONFIG_X86_MSR=m
+CONFIG_X86_CPUID=m
+
+#
+# Firmware Drivers
+#
+CONFIG_EDD=m
+# CONFIG_NOHIGHMEM is not set
+# CONFIG_HIGHMEM4G is not set
+CONFIG_HIGHMEM64G=y
+CONFIG_HIGHMEM=y
+CONFIG_X86_PAE=y
+# CONFIG_NUMA is not set
+CONFIG_HIGHPTE=y
+# CONFIG_MATH_EMULATION is not set
+CONFIG_MTRR=y
+# CONFIG_EFI is not set
+# CONFIG_IRQBALANCE is not set
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_REGPARM=y
+
+#
+# Power management options (ACPI, APM)
+#
+CONFIG_PM=y
+# CONFIG_SOFTWARE_SUSPEND is not set
+# CONFIG_PM_DISK is not set
+
+#
+# ACPI (Advanced Configuration and Power Interface) Support
+#
+CONFIG_ACPI=y
+CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_SLEEP_PROC_FS=y
+CONFIG_ACPI_AC=m
+CONFIG_ACPI_BATTERY=m
+CONFIG_ACPI_BUTTON=m
+CONFIG_ACPI_FAN=y
+CONFIG_ACPI_PROCESSOR=y
+CONFIG_ACPI_THERMAL=y
+CONFIG_ACPI_ASUS=m
+CONFIG_ACPI_TOSHIBA=m
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_BUS=y
+CONFIG_ACPI_EC=y
+CONFIG_ACPI_POWER=y
+CONFIG_ACPI_PCI=y
+CONFIG_ACPI_SYSTEM=y
+CONFIG_X86_PM_TIMER=y
+
+#
+# APM (Advanced Power Management) BIOS Support
+#
+CONFIG_APM=y
+# CONFIG_APM_IGNORE_USER_SUSPEND is not set
+# CONFIG_APM_DO_ENABLE is not set
+CONFIG_APM_CPU_IDLE=y
+# CONFIG_APM_DISPLAY_BLANK is not set
+CONFIG_APM_RTC_IS_GMT=y
+# CONFIG_APM_ALLOW_INTS is not set
+# CONFIG_APM_REAL_MODE_POWER_OFF is not set
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_PROC_INTF is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_24_API is not set
+CONFIG_CPU_FREQ_TABLE=y
+
+#
+# CPUFreq processor drivers
+#
+CONFIG_X86_ACPI_CPUFREQ=m
+# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
+CONFIG_X86_POWERNOW_K6=m
+CONFIG_X86_POWERNOW_K7=y
+CONFIG_X86_POWERNOW_K8=m
+# CONFIG_X86_GX_SUSPMOD is not set
+CONFIG_X86_SPEEDSTEP_CENTRINO=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y
+CONFIG_X86_SPEEDSTEP_ICH=y
+CONFIG_X86_SPEEDSTEP_SMI=m
+CONFIG_X86_P4_CLOCKMOD=m
+CONFIG_X86_SPEEDSTEP_LIB=y
+# CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set
+CONFIG_X86_LONGRUN=y
+# CONFIG_X86_LONGHAUL is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+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_PCI_USE_VECTOR=y
+CONFIG_PCI_LEGACY_PROC=y
+# CONFIG_PCI_NAMES is not set
+CONFIG_ISA=y
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_YENTA=m
+CONFIG_CARDBUS=y
+CONFIG_I82092=m
+CONFIG_I82365=m
+CONFIG_TCIC=m
+CONFIG_PCMCIA_PROBE=y
+
+#
+# PCI Hotplug Support
+#
+CONFIG_HOTPLUG_PCI=y
+# CONFIG_HOTPLUG_PCI_FAKE is not set
+CONFIG_HOTPLUG_PCI_COMPAQ=m
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+CONFIG_HOTPLUG_PCI_IBM=m
+# CONFIG_HOTPLUG_PCI_ACPI is not set
+# CONFIG_HOTPLUG_PCI_CPCI is not set
+CONFIG_HOTPLUG_PCI_PCIE=m
+CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE=y
+CONFIG_HOTPLUG_PCI_SHPC=m
+CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE=y
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=m
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=m
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_CMDLINE_PARTS=m
+
+#
+# User Modules And Translation Layers
+#
+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
+
+#
+# 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_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_PNC2000 is not set
+CONFIG_MTD_SC520CDP=m
+CONFIG_MTD_NETSC520=m
+CONFIG_MTD_SBC_GXX=m
+CONFIG_MTD_ELAN_104NC=m
+CONFIG_MTD_SCx200_DOCFLASH=m
+CONFIG_MTD_AMD76XROM=m
+CONFIG_MTD_ICH2ROM=m
+CONFIG_MTD_SCB2_FLASH=m
+# CONFIG_MTD_NETtel is not set
+# CONFIG_MTD_DILNETPC is not set
+CONFIG_MTD_L440GX=m
+CONFIG_MTD_PCI=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_SLRAM is not set
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+# CONFIG_MTD_BLKMTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_DOC2000=m
+# CONFIG_MTD_DOC2001 is not set
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=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_IDS=m
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_PC_CML1=m
+CONFIG_PARPORT_SERIAL=m
+# CONFIG_PARPORT_PC_FIFO is not set
+# CONFIG_PARPORT_PC_SUPERIO is not set
+CONFIG_PARPORT_PC_PCMCIA=m
+# CONFIG_PARPORT_OTHER is not set
+CONFIG_PARPORT_1284=y
+
+#
+# Plug and Play support
+#
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_ISAPNP=y
+# CONFIG_PNPBIOS is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+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_CARMEL=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
+
+#
+# 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_HD_IDE is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+# CONFIG_IDEDISK_STROKE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=y
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_CMD640 is not set
+CONFIG_BLK_DEV_IDEPNP=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_RZ1000=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_ADMA=y
+CONFIG_BLK_DEV_AEC62XX=y
+CONFIG_BLK_DEV_ALI15X3=y
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=y
+CONFIG_BLK_DEV_ATIIXP=y
+CONFIG_BLK_DEV_CMD64X=y
+CONFIG_BLK_DEV_TRIFLEX=y
+CONFIG_BLK_DEV_CY82C693=y
+CONFIG_BLK_DEV_CS5520=y
+CONFIG_BLK_DEV_CS5530=y
+CONFIG_BLK_DEV_HPT34X=y
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# 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_PDC202XX_FORCE=y
+CONFIG_BLK_DEV_SVWKS=y
+CONFIG_BLK_DEV_SIIMAGE=y
+CONFIG_BLK_DEV_SIS5513=y
+CONFIG_BLK_DEV_SLC90E66=y
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+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
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+
+#
+# SCSI low-level drivers
+#
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+# CONFIG_SCSI_7000FASST is not set
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AHA152X=m
+CONFIG_SCSI_AHA1542=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=4
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
+# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
+CONFIG_AIC7XXX_DEBUG_MASK=0
+# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=4
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
+# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
+# CONFIG_AIC79XX_DEBUG_ENABLE is not set
+CONFIG_AIC79XX_DEBUG_MASK=0
+# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
+# CONFIG_SCSI_DPT_I2O is not set
+CONFIG_SCSI_ADVANSYS=m
+CONFIG_SCSI_IN2000=m
+CONFIG_SCSI_MEGARAID=m
+CONFIG_SCSI_SATA=y
+CONFIG_SCSI_SATA_SVW=m
+CONFIG_SCSI_ATA_PIIX=m
+CONFIG_SCSI_SATA_PROMISE=m
+CONFIG_SCSI_SATA_SX4=m
+CONFIG_SCSI_SATA_SIL=m
+CONFIG_SCSI_SATA_SIS=m
+CONFIG_SCSI_SATA_VIA=m
+CONFIG_SCSI_SATA_VITESSE=m
+CONFIG_SCSI_BUSLOGIC=m
+# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+CONFIG_SCSI_IPS=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_NCR53C406A 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_SYM53C8XX_IOMAPPED 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=m
+CONFIG_SCSI_QLOGIC_ISP=m
+# CONFIG_SCSI_QLOGIC_FC is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA2XXX=m
+CONFIG_SCSI_QLA21XX=m
+CONFIG_SCSI_QLA22XX=m
+CONFIG_SCSI_QLA2300=m
+CONFIG_SCSI_QLA2322=m
+CONFIG_SCSI_QLA6312=m
+CONFIG_SCSI_QLA6322=m
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC395x is not set
+CONFIG_SCSI_DC390T=m
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_ULTRASTOR is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+CONFIG_PCMCIA_AHA152X=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_NINJA_SCSI=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=m
+CONFIG_FUSION_MAX_SGE=40
+# CONFIG_FUSION_ISENSE is not set
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LAN=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_IEEE1394=m
+
+#
+# Subsystem Options
+#
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+CONFIG_IEEE1394_OUI_DB=y
+# CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set
+
+#
+# Device Drivers
+#
+# CONFIG_IEEE1394_PCILYNX is not set
+CONFIG_IEEE1394_OHCI1394=m
+
+#
+# Protocol Drivers
+#
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
+# CONFIG_IEEE1394_ETH1394 is not set
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+CONFIG_IEEE1394_CMP=m
+CONFIG_IEEE1394_AMDTP=m
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_NETLINK_DEV=y
+CONFIG_UNIX=y
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_FWMARK=y
+CONFIG_IP_ROUTE_NAT=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_TOS=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
+
+#
+# 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_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_LIMIT=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MAC=m
+CONFIG_IP_NF_MATCH_PKTTYPE=m
+CONFIG_IP_NF_MATCH_MARK=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_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_TCPMSS=m
+CONFIG_IP_NF_MATCH_HELPER=m
+CONFIG_IP_NF_MATCH_STATE=m
+CONFIG_IP_NF_MATCH_CONNTRACK=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_PHYSDEV=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_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_IP_NF_NAT_LOCAL=y
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
+CONFIG_IP_NF_NAT_FTP=m
+CONFIG_IP_NF_NAT_TFTP=m
+CONFIG_IP_NF_NAT_AMANDA=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_MARK=m
+CONFIG_IP_NF_TARGET_CLASSIFY=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
+
+#
+# IPv6: Netfilter Configuration
+#
+# CONFIG_IP6_NF_QUEUE is not set
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_LIMIT=m
+CONFIG_IP6_NF_MATCH_MAC=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_MARK=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_LENGTH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_MARK=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_XFRM=y
+CONFIG_XFRM_USER=y
+
+#
+# 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
+# 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=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=y
+CONFIG_LTPC=m
+CONFIG_COPS=m
+CONFIG_COPS_DAYNA=y
+CONFIG_COPS_TANGENT=y
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+CONFIG_NET_DIVERT=y
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=m
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_CSZ=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_DELAY=m
+CONFIG_NET_SCH_INGRESS=m
+CONFIG_NET_QOS=y
+CONFIG_NET_ESTIMATOR=y
+CONFIG_NET_CLS=y
+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_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_POLICE=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_RX is not set
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+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 is not set
+
+#
+# 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_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
+#
+
+#
+# Old Serial dongle support
+#
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_NSC_FIR=m
+# CONFIG_WINBOND_FIR is not set
+# 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=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
+
+#
+# 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_HCIUART_BCSP_TXCRC=y
+CONFIG_BT_HCIBCM203X=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_TUX=m
+
+#
+# TUX options
+#
+CONFIG_TUX_EXTCGI=y
+# CONFIG_TUX_EXTENDED_LOG is not set
+# CONFIG_TUX_DEBUG is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_ETHERTAP=m
+CONFIG_NET_SB1000=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=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
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+CONFIG_TULIP_MMIO=y
+# CONFIG_TULIP_NAPI is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+# CONFIG_AT1700 is not set
+CONFIG_DEPCA=m
+CONFIG_HP100=m
+# CONFIG_NET_ISA is not set
+CONFIG_NE2000=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+CONFIG_AC3200=m
+CONFIG_APRICOT=m
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_CS89x0=m
+CONFIG_DGRS=m
+CONFIG_EEPRO100=m
+# CONFIG_EEPRO100_PIO is not set
+CONFIG_E100=m
+CONFIG_E100_NAPI=y
+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_TLAN=m
+CONFIG_VIA_RHINE=m
+CONFIG_VIA_RHINE_MMIO=y
+CONFIG_NET_POCKET=y
+CONFIG_ATP=m
+CONFIG_DE600=m
+CONFIG_DE620=m
+
+#
+# Gigabit Ethernet (1000/10000 Mbit)
+#
+CONFIG_NET_GIGE=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000_NAPI=y
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_SK98LIN=m
+CONFIG_TIGON3=m
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_ARLAN is not set
+CONFIG_WAVELAN=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+# CONFIG_PCMCIA_RAYCS is not set
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_AIRO=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+CONFIG_PRISM54=m
+CONFIG_NET_WIRELESS=y
+
+#
+# PCMCIA network device support
+#
+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
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_FDDI=y
+# CONFIG_DEFXX is not set
+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 is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+CONFIG_NET_FC=y
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+
+#
+# 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 is not set
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+
+#
+# ISDN feature submodules
+#
+
+#
+# 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=y
+CONFIG_HISAX_NO_LLC=y
+CONFIG_HISAX_NO_KEYPAD=y
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+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
+
+#
+# HiSax PCMCIA card service modules
+#
+CONFIG_HISAX_SEDLBAUER_CS=m
+CONFIG_HISAX_ELSA_CS=m
+CONFIG_HISAX_AVM_A1_CS=m
+CONFIG_HISAX_TELES_CS=m
+
+#
+# HiSax sub driver modules
+#
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+
+#
+# Active cards
+#
+CONFIG_ISDN_DRV_ICN=m
+CONFIG_ISDN_DRV_PCBIT=m
+CONFIG_ISDN_DRV_SC=m
+CONFIG_ISDN_DRV_ACT2000=m
+CONFIG_ISDN_DRV_TPAM=m
+
+#
+# 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
+
+#
+# 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=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input I/O drivers
+#
+CONFIG_GAMEPORT=m
+CONFIG_SOUND_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_VORTEX=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_GAMEPORT_CS461x=m
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 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=y
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_INPORT=m
+CONFIG_MOUSE_ATIXL=y
+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_TWIDDLER=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+# CONFIG_INPUT_JOYDUMP is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_UINPUT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_ROCKETPORT=m
+# CONFIG_CYCLADES is not set
+CONFIG_SYNCLINK=m
+CONFIG_SYNCLINKMP=m
+CONFIG_N_HDLC=m
+CONFIG_STALDRV=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+# CONFIG_SERIAL_8250_ACPI is not set
+CONFIG_SERIAL_8250_NR_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=y
+CONFIG_SERIAL_8250_MULTIPORT=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_CRASH=m
+CONFIG_PRINTER=m
+CONFIG_LP_CONSOLE=y
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+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_I8XX_TCO=m
+CONFIG_SC1200_WDT=m
+# CONFIG_SCx200_WDT is not set
+# CONFIG_60XX_WDT is not set
+CONFIG_CPU5_WDT=m
+CONFIG_W83627HF_WDT=m
+CONFIG_W83877F_WDT=m
+CONFIG_MACHZ_WDT=m
+
+#
+# ISA-based Watchdog Cards
+#
+CONFIG_PCWATCHDOG=m
+# CONFIG_MIXCOMWD is not set
+CONFIG_WDT=m
+# CONFIG_WDT_501 is not set
+
+#
+# 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_NVRAM=m
+CONFIG_RTC=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+# CONFIG_APPLICOM is not set
+CONFIG_SONYPI=m
+
+#
+# Ftape, the floppy tape device driver
+#
+CONFIG_AGP=y
+CONFIG_AGP_ALI=y
+CONFIG_AGP_ATI=y
+CONFIG_AGP_AMD=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+CONFIG_AGP_INTEL_MCH=y
+CONFIG_AGP_NVIDIA=y
+CONFIG_AGP_SIS=y
+CONFIG_AGP_SWORKS=y
+CONFIG_AGP_VIA=y
+CONFIG_AGP_EFFICEON=y
+CONFIG_DRM=y
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_GAMMA=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_I810=m
+CONFIG_DRM_I830=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+
+#
+# PCMCIA character devices
+#
+CONFIG_SYNCLINK_CS=m
+CONFIG_MWAVE=m
+# CONFIG_RAW_DRIVER is not set
+CONFIG_HANGCHECK_TIMER=m
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_ISA=m
+CONFIG_I2C_NFORCE2=m
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+# CONFIG_SCx200_ACB is not set
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+
+#
+# Hardware Sensors Chip support
+#
+CONFIG_I2C_SENSOR=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+
+#
+# Other I2C Chip support
+#
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_RTC8564=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
+
+#
+# Misc devices
+#
+CONFIG_IBM_ASM=m
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+CONFIG_VIDEO_BT848=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_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_SAA7134=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+
+#
+# Radio Adapters
+#
+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
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_VIDEOBUF=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+# 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_VGA16=m
+CONFIG_FB_VESA=y
+CONFIG_VIDEO_SELECT=y
+CONFIG_FB_HGA=m
+CONFIG_FB_HGA_ACCEL=y
+CONFIG_FB_RIVA=m
+CONFIG_FB_I810=m
+CONFIG_FB_I810_GTF=y
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G450=y
+CONFIG_FB_MATROX_G100=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+# CONFIG_FB_RADEON_OLD 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=y
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_XL_INIT is not set
+# CONFIG_FB_SIS is not set
+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_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_MDA_CONSOLE=m
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# 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=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=y
+CONFIG_SND_RTCTIMER=m
+# 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_OPL4_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+# CONFIG_SND_SERIAL_U16550 is not set
+CONFIG_SND_MPU401=m
+
+#
+# ISA devices
+#
+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_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 is not set
+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
+
+#
+# PCI devices
+#
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=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=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_VX222=m
+
+#
+# ALSA USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# PCMCIA devices
+#
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_VXP440 is not set
+CONFIG_SND_PDAUDIOCF=m
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS 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_OHCI_HCD=m
+CONFIG_USB_UHCI_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_AUDIO=m
+
+#
+# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+#
+CONFIG_USB_MIDI=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_HP8200e=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+CONFIG_HID_FF=y
+CONFIG_HID_PID=y
+CONFIG_LOGITECH_FF=y
+CONFIG_THRUSTMASTER_FF=y
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_AIPTEK=m
+CONFIG_USB_WACOM=m
+CONFIG_USB_KBTAB=m
+CONFIG_USB_POWERMATE=m
+CONFIG_USB_MTOUCH=m
+CONFIG_USB_EGALAX=m
+CONFIG_USB_XPAD=m
+CONFIG_USB_ATI_REMOTE=m
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_HPUSBSCSI=m
+
+#
+# USB Multimedia devices
+#
+CONFIG_USB_DABUSB=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_STV680=m
+CONFIG_USB_W9968CF=m
+
+#
+# USB Network adaptors
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+
+#
+# USB Host-to-Host Cables
+#
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_GENESYS=y
+CONFIG_USB_NET1080=y
+CONFIG_USB_PL2301=y
+
+#
+# Intelligent USB Devices/Gadgets
+#
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZAURUS=y
+CONFIG_USB_CDCETHER=y
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_AX8817X=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_SAFE_PADDED=y
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EZUSB=y
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+# CONFIG_USB_EMI26 is not set
+CONFIG_USB_TIGL=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+# CONFIG_USB_CYTHERM is not set
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_TEST=m
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET 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_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+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_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_RT is not set
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_QUOTA=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_ZISOFS_FS=y
+CONFIG_UDF_FS=m
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+CONFIG_DEVPTS_FS_XATTR=y
+CONFIG_DEVPTS_FS_SECURITY=y
+CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS 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_JFFS_FS is not set
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_NAND=y
+CONFIG_CRAMFS=m
+CONFIG_VXFS_FS=m
+# CONFIG_HPFS_FS is not set
+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
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS 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 is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+CONFIG_OSF_PARTITION=y
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+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 is not set
+# CONFIG_NEC98_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+CONFIG_SUN_PARTITION=y
+CONFIG_EFI_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+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_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_DEBUG_KERNEL=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_FRAME_POINTER is not set
+CONFIG_X86_FIND_SMP_CONFIG=y
+CONFIG_X86_MPPARSE=y
+
+#
+# Security options
+#
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+# CONFIG_SECURITY_SELINUX_MLS 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_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_ARC4=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_X86_SMP=y
+CONFIG_X86_HT=y
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_X86_TRAMPOLINE=y
+CONFIG_X86_STD_RESOURCES=y
+CONFIG_PC=y
diff --git a/.config.cmd b/.config.cmd
new file mode 100644 (file)
index 0000000..358c465
--- /dev/null
@@ -0,0 +1,169 @@
+deps_config := \
+       lib/Kconfig \
+       crypto/Kconfig \
+       security/selinux/Kconfig \
+       security/Kconfig \
+       arch/i386/oprofile/Kconfig \
+       fs/nls/Kconfig \
+       fs/partitions/Kconfig \
+       fs/ncpfs/Kconfig \
+       fs/Kconfig \
+       drivers/usb/gadget/Kconfig \
+       drivers/usb/misc/Kconfig \
+       drivers/usb/serial/Kconfig \
+       drivers/usb/net/Kconfig \
+       drivers/usb/media/Kconfig \
+       drivers/usb/image/Kconfig \
+       drivers/usb/input/Kconfig \
+       drivers/usb/storage/Kconfig \
+       drivers/usb/class/Kconfig \
+       drivers/usb/host/Kconfig \
+       drivers/usb/core/Kconfig \
+       drivers/usb/Kconfig \
+       sound/oss/Kconfig \
+       sound/parisc/Kconfig \
+       sound/sparc/Kconfig \
+       sound/pcmcia/Kconfig \
+       sound/usb/Kconfig \
+       sound/arm/Kconfig \
+       sound/ppc/Kconfig \
+       sound/pci/Kconfig \
+       sound/isa/Kconfig \
+       sound/drivers/Kconfig \
+       sound/core/Kconfig \
+       sound/oss/dmasound/Kconfig \
+       sound/Kconfig \
+       drivers/video/logo/Kconfig \
+       drivers/video/console/Kconfig \
+       drivers/video/Kconfig \
+       drivers/media/common/Kconfig \
+       drivers/media/dvb/bt8xx/Kconfig \
+       drivers/media/dvb/b2c2/Kconfig \
+       drivers/media/dvb/ttusb-dec/Kconfig \
+       drivers/media/dvb/ttusb-budget/Kconfig \
+       drivers/media/dvb/ttpci/Kconfig \
+       drivers/media/dvb/frontends/Kconfig \
+       drivers/media/dvb/dvb-core/Kconfig \
+       drivers/media/dvb/Kconfig \
+       drivers/media/radio/Kconfig \
+       drivers/media/video/Kconfig \
+       drivers/media/Kconfig \
+       drivers/misc/Kconfig \
+       drivers/i2c/chips/Kconfig \
+       drivers/i2c/busses/Kconfig \
+       drivers/i2c/algos/Kconfig \
+       drivers/i2c/Kconfig \
+       drivers/char/pcmcia/Kconfig \
+       drivers/char/drm/Kconfig \
+       drivers/char/agp/Kconfig \
+       drivers/char/ftape/Kconfig \
+       drivers/char/watchdog/Kconfig \
+       drivers/char/ipmi/Kconfig \
+       drivers/serial/Kconfig \
+       drivers/char/Kconfig \
+       drivers/input/misc/Kconfig \
+       drivers/input/touchscreen/Kconfig \
+       drivers/input/joystick/iforce/Kconfig \
+       drivers/input/joystick/Kconfig \
+       drivers/input/mouse/Kconfig \
+       drivers/input/keyboard/Kconfig \
+       drivers/input/serio/Kconfig \
+       drivers/input/gameport/Kconfig \
+       drivers/input/Kconfig \
+       drivers/telephony/Kconfig \
+       drivers/isdn/hardware/eicon/Kconfig \
+       drivers/isdn/hardware/avm/Kconfig \
+       drivers/isdn/hardware/Kconfig \
+       drivers/isdn/capi/Kconfig \
+       drivers/isdn/hysdn/Kconfig \
+       drivers/isdn/tpam/Kconfig \
+       drivers/isdn/act2000/Kconfig \
+       drivers/isdn/sc/Kconfig \
+       drivers/isdn/pcbit/Kconfig \
+       drivers/isdn/icn/Kconfig \
+       drivers/isdn/hisax/Kconfig \
+       drivers/isdn/i4l/Kconfig \
+       drivers/isdn/Kconfig \
+       drivers/s390/net/Kconfig \
+       drivers/atm/Kconfig \
+       drivers/net/wan/Kconfig \
+       drivers/net/pcmcia/Kconfig \
+       drivers/net/wireless/Kconfig \
+       drivers/net/tokenring/Kconfig \
+       drivers/net/tulip/Kconfig \
+       drivers/net/arm/Kconfig \
+       drivers/net/arcnet/Kconfig \
+       drivers/net/Kconfig \
+       net/tux/Kconfig \
+       drivers/bluetooth/Kconfig \
+       net/bluetooth/cmtp/Kconfig \
+       net/bluetooth/bnep/Kconfig \
+       net/bluetooth/rfcomm/Kconfig \
+       net/bluetooth/Kconfig \
+       drivers/net/irda/Kconfig \
+       net/irda/ircomm/Kconfig \
+       net/irda/irnet/Kconfig \
+       net/irda/irlan/Kconfig \
+       net/irda/Kconfig \
+       drivers/net/hamradio/Kconfig \
+       net/ax25/Kconfig \
+       net/sched/Kconfig \
+       drivers/net/appletalk/Kconfig \
+       net/ipx/Kconfig \
+       net/llc/Kconfig \
+       net/decnet/Kconfig \
+       net/sctp/Kconfig \
+       net/xfrm/Kconfig \
+       net/bridge/netfilter/Kconfig \
+       net/decnet/netfilter/Kconfig \
+       net/ipv6/netfilter/Kconfig \
+       net/ipv4/netfilter/Kconfig \
+       net/ipv6/Kconfig \
+       net/ipv4/ipvs/Kconfig \
+       net/ipv4/Kconfig \
+       net/Kconfig \
+       drivers/macintosh/Kconfig \
+       drivers/message/i2o/Kconfig \
+       drivers/ieee1394/Kconfig \
+       drivers/message/fusion/Kconfig \
+       drivers/md/Kconfig \
+       drivers/cdrom/Kconfig \
+       drivers/scsi/pcmcia/Kconfig \
+       drivers/scsi/arm/Kconfig \
+       drivers/scsi/qla2xxx/Kconfig \
+       drivers/scsi/aic7xxx/Kconfig.aic79xx \
+       drivers/scsi/aic7xxx/Kconfig.aic7xxx \
+       drivers/scsi/Kconfig \
+       drivers/ide/Kconfig \
+       drivers/s390/block/Kconfig \
+       drivers/block/paride/Kconfig \
+       drivers/block/Kconfig \
+       drivers/pnp/pnpbios/Kconfig \
+       drivers/pnp/isapnp/Kconfig \
+       drivers/pnp/Kconfig \
+       drivers/parport/Kconfig \
+       drivers/mtd/nand/Kconfig \
+       drivers/mtd/devices/Kconfig \
+       drivers/mtd/maps/Kconfig \
+       drivers/mtd/chips/Kconfig \
+       drivers/mtd/Kconfig \
+       drivers/base/Kconfig \
+       drivers/Kconfig \
+       fs/Kconfig.binfmt \
+       drivers/pci/hotplug/Kconfig \
+       drivers/pcmcia/Kconfig \
+       drivers/mca/Kconfig \
+       drivers/eisa/Kconfig \
+       drivers/pci/Kconfig \
+       drivers/cpufreq/Kconfig \
+       arch/i386/kernel/cpu/cpufreq/Kconfig \
+       drivers/acpi/Kconfig \
+       kernel/power/Kconfig \
+       drivers/firmware/Kconfig \
+       drivers/block/Kconfig.iosched \
+       init/Kconfig \
+       arch/i386/Kconfig
+
+.config include/linux/autoconf.h: $(deps_config)
+
+$(deps_config):
diff --git a/.config.old b/.config.old
new file mode 100644 (file)
index 0000000..a1d48d7
--- /dev/null
@@ -0,0 +1,2415 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MMU=y
+CONFIG_UID16=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_SMP=y
+# CONFIG_HOTPLUG_CPU is not set
+CONFIG_SCHED_SMT=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+CONFIG_LOG_BUF_SHIFT=17
+# CONFIG_IKCONFIG is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_NUMA is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_IRQBALANCE is not set
+CONFIG_POSIX_MQUEUE=y
+CONFIG_EDD=m
+# CONFIG_SMBIOS is not set
+CONFIG_IRQSTACKS=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
+# Power management options (ACPI, APM)
+#
+CONFIG_PM=y
+# CONFIG_SOFTWARE_SUSPEND is not set
+# CONFIG_PM_DISK is not set
+
+#
+# ACPI (Advanced Configuration and Power Interface) Support
+#
+CONFIG_ACPI=y
+CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_AC=m
+CONFIG_ACPI_BATTERY=m
+CONFIG_ACPI_BUTTON=m
+CONFIG_ACPI_FAN=y
+CONFIG_ACPI_PROCESSOR=y
+CONFIG_ACPI_THERMAL=y
+CONFIG_ACPI_ASUS=m
+CONFIG_ACPI_TOSHIBA=m
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_BUS=y
+CONFIG_ACPI_EC=y
+CONFIG_ACPI_POWER=y
+CONFIG_ACPI_PCI=y
+CONFIG_ACPI_SYSTEM=y
+CONFIG_ACPI_NUMA=y
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_PROC_INTF is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
+# CONFIG_CPU_FREQ_24_API is not set
+CONFIG_CPU_FREQ_TABLE=y
+
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+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_PCI_LEGACY_PROC=y
+# CONFIG_PCI_NAMES is not set
+CONFIG_PCI_USE_VECTOR=y
+CONFIG_ISA=y
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+CONFIG_HOTPLUG=y
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_YENTA=y
+CONFIG_CARDBUS=y
+CONFIG_I82092=m
+CONFIG_I82365=m
+CONFIG_TCIC=m
+CONFIG_PCMCIA_PROBE=y
+
+#
+# PCI Hotplug Support
+#
+CONFIG_HOTPLUG_PCI=y
+# CONFIG_HOTPLUG_PCI_FAKE is not set
+CONFIG_HOTPLUG_PCI_COMPAQ=m
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+CONFIG_HOTPLUG_PCI_IBM=m
+# CONFIG_HOTPLUG_PCI_ACPI is not set
+# CONFIG_HOTPLUG_PCI_CPCI is not set
+CONFIG_HOTPLUG_PCI_PCIE=m
+CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE=y
+CONFIG_HOTPLUG_PCI_SHPC=m
+CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE=y
+# CONFIG_HOTPLUG_PCI_SHPC_PHPRM_LEGACY is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=m
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_FW_LOADER=y
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=m
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_CMDLINE_PARTS=m
+
+#
+# User Modules And Translation Layers
+#
+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
+
+#
+# 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_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_PNC2000 is not set
+CONFIG_MTD_SC520CDP=m
+CONFIG_MTD_NETSC520=m
+CONFIG_MTD_SBC_GXX=m
+CONFIG_MTD_ELAN_104NC=m
+CONFIG_MTD_SCx200_DOCFLASH=m
+CONFIG_MTD_AMD76XROM=m
+CONFIG_MTD_ICH2ROM=m
+CONFIG_MTD_SCB2_FLASH=m
+# CONFIG_MTD_NETtel is not set
+# CONFIG_MTD_DILNETPC is not set
+CONFIG_MTD_L440GX=m
+CONFIG_MTD_PCI=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_SLRAM is not set
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+# CONFIG_MTD_BLKMTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_DOC2000=m
+# CONFIG_MTD_DOC2001 is not set
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=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_IDS=m
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_PC_CML1=m
+CONFIG_PARPORT_SERIAL=m
+# CONFIG_PARPORT_PC_FIFO is not set
+# CONFIG_PARPORT_PC_SUPERIO is not set
+CONFIG_PARPORT_PC_PCMCIA=m
+# CONFIG_PARPORT_OTHER is not set
+CONFIG_PARPORT_1284=y
+
+#
+# Plug and Play support
+#
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_ISAPNP=y
+# CONFIG_PNPBIOS is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+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_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_BLK_DEV_ATIIXP=y
+CONFIG_LBD=y
+# CONFIG_DCSSBLK is not set
+
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_IDE_GENERIC=y
+# CONFIG_HPT34X_AUTODMA is not set
+
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_HD_IDE is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+# CONFIG_IDEDISK_STROKE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=y
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
+
+#
+# IDE chipset support/bugfixes
+#
+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+CONFIG_BLK_DEV_IDEPNP=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_RZ1000=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDE_TCQ is not set
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_ADMA=y
+CONFIG_BLK_DEV_AEC62XX=y
+CONFIG_BLK_DEV_ALI15X3=y
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=y
+CONFIG_BLK_DEV_CMD64X=y
+CONFIG_BLK_DEV_TRIFLEX=y
+CONFIG_BLK_DEV_CY82C693=y
+CONFIG_BLK_DEV_CS5520=y
+CONFIG_BLK_DEV_CS5530=y
+CONFIG_BLK_DEV_HPT34X=y
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# 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_PDC202XX_FORCE=y
+CONFIG_BLK_DEV_SVWKS=y
+CONFIG_BLK_DEV_SIIMAGE=y
+CONFIG_BLK_DEV_SIS5513=y
+CONFIG_BLK_DEV_SLC90E66=y
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_DMA_NONPCI is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+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
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_REPORT_LUNS=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SPI_ATTRS=y
+CONFIG_SCSI_FC_ATTRS=y
+
+#
+# SCSI low-level drivers
+#
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+# CONFIG_SCSI_7000FASST is not set
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AHA152X=m
+CONFIG_SCSI_AHA1542=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=4
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+# CONFIG_AIC7XXX_PROBE_EISA_VL is not set
+# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
+# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
+CONFIG_AIC7XXX_DEBUG_MASK=0
+# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=4
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
+# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
+# CONFIG_AIC79XX_DEBUG_ENABLE is not set
+CONFIG_AIC79XX_DEBUG_MASK=0
+# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
+CONFIG_SCSI_ADVANSYS=m
+CONFIG_SCSI_IN2000=m
+CONFIG_SCSI_MEGARAID=m
+CONFIG_SCSI_SATA=y
+CONFIG_SCSI_SATA_SVW=m
+CONFIG_SCSI_ATA_PIIX=m
+CONFIG_SCSI_SATA_PROMISE=m
+CONFIG_SCSI_SATA_VIA=m
+CONFIG_BLK_DEV_CARMEL=m
+CONFIG_SCSI_SATA_VITESSE=m
+CONFIG_SCSI_SATA_SIL=m
+CONFIG_SCSI_SATA_SIS=m
+CONFIG_SCSI_SATA_SX4=m
+
+CONFIG_SCSI_BUSLOGIC=m
+# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+CONFIG_SCSI_IPS=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_NCR53C406A 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_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PSI240I is not set
+CONFIG_SCSI_QLOGIC_FAS=m
+CONFIG_SCSI_QLOGIC_ISP=m
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
+CONFIG_SCSI_QLOGIC_1280=m
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_ULTRASTOR is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_QLA2XXX=m
+CONFIG_SCSI_QLA21XX=m
+CONFIG_SCSI_QLA22XX=m
+CONFIG_SCSI_QLA2300=m
+CONFIG_SCSI_QLA2322=m
+CONFIG_SCSI_QLA6312=m
+CONFIG_SCSI_QLA6322=m
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_DPT_I2O is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+CONFIG_PCMCIA_AHA152X=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_NINJA_SCSI=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=m
+CONFIG_FUSION_MAX_SGE=40
+# CONFIG_FUSION_ISENSE is not set
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LAN=m
+
+#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+CONFIG_IEEE1394=m
+
+#
+# Subsystem Options
+#
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+CONFIG_IEEE1394_OUI_DB=y
+
+#
+# Device Drivers
+#
+# CONFIG_IEEE1394_PCILYNX is not set
+CONFIG_IEEE1394_OHCI1394=m
+
+#
+# Protocol Drivers
+#
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
+# CONFIG_IEEE1394_ETH1394 is not set
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+CONFIG_IEEE1394_CMP=m
+CONFIG_IEEE1394_AMDTP=m
+# CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+CONFIG_I2O_PCI=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+CONFIG_I2O_CONFIG=y
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_NETLINK_DEV=y
+CONFIG_UNIX=y
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_FWMARK=y
+CONFIG_IP_ROUTE_NAT=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_TOS=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_NETCONSOLE=m
+# CONFIG_NETPOLL_RX is not set
+# CONFIG_NETPOLL_TRAP is not set
+
+#
+# IP: Virtual Server Configuration
+#
+CONFIG_IP_VS=m
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+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
+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_IPV6_TUNNEL=m
+# CONFIG_DECNET is not set
+CONFIG_BRIDGE=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_LIMIT=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MAC=m
+CONFIG_IP_NF_MATCH_PKTTYPE=m
+CONFIG_IP_NF_MATCH_MARK=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_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_TCPMSS=m
+CONFIG_IP_NF_MATCH_HELPER=m
+CONFIG_IP_NF_MATCH_STATE=m
+CONFIG_IP_NF_MATCH_CONNTRACK=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_PHYSDEV=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_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_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_NAT_LOCAL=y
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
+CONFIG_IP_NF_NAT_FTP=m
+CONFIG_IP_NF_NAT_TFTP=m
+CONFIG_IP_NF_NAT_AMANDA=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_MARK=m
+CONFIG_IP_NF_TARGET_CLASSIFY=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+
+#
+# IPv6: Netfilter Configuration
+#
+# CONFIG_IP6_NF_QUEUE is not set
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_LIMIT=m
+CONFIG_IP6_NF_MATCH_MAC=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_MARK=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_LENGTH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_MARK=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_XFRM=y
+CONFIG_XFRM_USER=y
+
+#
+# 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
+# CONFIG_ATM is not set
+CONFIG_VLAN_8021Q=m
+CONFIG_LLC=m
+# CONFIG_LLC2 is not set
+CONFIG_IPX=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=y
+CONFIG_LTPC=m
+CONFIG_COPS=m
+CONFIG_COPS_DAYNA=y
+CONFIG_COPS_TANGENT=y
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+CONFIG_NET_DIVERT=y
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=m
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_CSZ=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_INGRESS=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_DELAY=m
+
+CONFIG_NET_QOS=y
+CONFIG_NET_ESTIMATOR=y
+CONFIG_NET_CLS=y
+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_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_POLICE=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_ETHERTAP=m
+CONFIG_NET_SB1000=m
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=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
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_NAPI is not set
+
+# CONFIG_TULIP_MWI is not set
+CONFIG_TULIP_MMIO=y
+# CONFIG_NI5010 is not set
+# CONFIG_PCMCIA_XIRTULIP is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+# CONFIG_AT1700 is not set
+CONFIG_DEPCA=m
+CONFIG_HP100=m
+# CONFIG_NET_ISA is not set
+# CONFIG_EWRK3 is not set
+CONFIG_E2100=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_LNE390=m
+CONFIG_NE3210=m
+CONFIG_ES3210=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+CONFIG_AC3200=m
+CONFIG_APRICOT=m
+CONFIG_B44=m
+CONFIG_CS89x0=m
+CONFIG_DGRS=m
+CONFIG_EEPRO100=m
+# CONFIG_EEPRO100_PIO is not set
+CONFIG_E100=m
+CONFIG_E100_NAPI=y
+CONFIG_FEALNX=m
+CONFIG_FORCEDETH=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_8139_RXBUF_IDX=2
+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=y
+CONFIG_NET_POCKET=y
+CONFIG_ATP=m
+CONFIG_DE600=m
+CONFIG_DE620=m
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_NET_GIGE=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000_NAPI=y
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_SK98LIN=m
+CONFIG_TIGON3=m
+
+#
+# Ethernet (10000 Mbit)
+#
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+CONFIG_FDDI=y
+# CONFIG_DEFXX is not set
+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_IPPP_FILTER=y
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_ARLAN is not set
+CONFIG_WAVELAN=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+# CONFIG_PCMCIA_RAYCS is not set
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_AIRO=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+CONFIG_PRISM54=m
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+CONFIG_NET_WIRELESS=y
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+CONFIG_NET_FC=y
+CONFIG_RCPCI=m
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# PCMCIA network device support
+#
+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
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+CONFIG_IRDA=m
+# CONFIG_IRDA_DEBUG is not set
+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_IRTTY_SIR=m
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_IRPORT_SIR=m
+# CONFIG_DONGLE_OLD is not set
+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_NSC_FIR=m
+CONFIG_SIGMATEL_FIR=m
+# CONFIG_WINBOND_FIR is not set
+# 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
+
+
+
+#
+# Bluetooth support
+#
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_CMTP=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
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_BCSP_TXCRC=y
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_CMTP=m
+CONFIG_BT_HCIUSB_SCO=m
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_USB_BLUETOOTH_TTY=m
+
+#
+# ISDN subsystem
+#
+
+CONFIG_ISDN=m
+CONFIG_ISDN_I4L=m
+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_ISDN_PPP=y
+CONFIG_ISDN_PPP_VJ=y
+CONFIG_ISDN_MPP=y
+# CONFIG_ISDN_PPP_BSDCOMP is not set
+CONFIG_ISDN_TTY_FAX=y
+CONFIG_DE_AOC=y
+
+CONFIG_ISDN_AUDIO=y
+
+CONFIG_ISDN_DRV_HISAX=m
+CONFIG_ISDN_DRV_ICN=m
+CONFIG_ISDN_DRV_PCBIT=m
+CONFIG_ISDN_DRV_SC=m
+CONFIG_ISDN_DRV_ACT2000=m
+CONFIG_ISDN_DRV_TPAM=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_AVM_CS=m
+
+CONFIG_ISDN_CAPI_CAPIDRV=m
+
+CONFIG_HISAX_EURO=y
+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_AVM_A1_CS=m
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_NO_SENDCOMPLETE=y
+CONFIG_HISAX_NO_LLC=y
+CONFIG_HISAX_NO_KEYPAD=y
+CONFIG_HISAX_SEDLBAUER_CS=m
+CONFIG_HISAX_ELSA_CS=m
+CONFIG_HISAX_TELES_CS=m
+
+CONFIG_ISDN_DRV_LOOP=m
+CONFIG_HYSDN=m
+CONFIG_HYSDN_CAPI=y
+
+
+#
+# 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
+
+#
+# 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=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input I/O drivers
+#
+CONFIG_GAMEPORT=m
+CONFIG_SOUND_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_VORTEX=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_GAMEPORT_CS461x=m
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_INPORT=m
+CONFIG_MOUSE_ATIXL=y
+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_TWIDDLER=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+# CONFIG_INPUT_JOYDUMP is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_UINPUT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_ROCKETPORT=m
+CONFIG_SYNCLINK=m
+CONFIG_SYNCLINKMP=m
+CONFIG_N_HDLC=m
+CONFIG_STALDRV=y
+# CONFIG_FTAPE is not set
+CONFIG_IBM_ASM=m
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+# CONFIG_SERIAL_8250_ACPI is not set
+CONFIG_SERIAL_8250_NR_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=y
+CONFIG_SERIAL_8250_MULTIPORT=y
+CONFIG_SERIAL_8250_RSA=y
+# CONFIG_COMPUTONE is not set
+# CONFIG_CYCLADES is not set
+# CONFIG_DIGIEPCA is not set
+# CONFIG_DIGI 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_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_SX is not set
+# CONFIG_RIO is not set
+# CONFIG_STALLION is not set
+# CONFIG_ISTALLION is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=2048
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_PRINTER=m
+CONFIG_LP_CONSOLE=y
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_DEBUG_ALGO is not set
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_ISA=m
+CONFIG_I2C_NFORCE2=m
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+# CONFIG_SCx200_ACB is not set
+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_ELEKTOR is not set
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+# CONFIG_I2C_PARPORT is not set
+CONFIG_I2C_ALI1563=m
+# CONFIG_I2C_PARPORT_LIGHT is not set
+
+
+#
+# I2C Hardware Sensors Chip support
+#
+CONFIG_I2C_SENSOR=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_W83627HF=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_RTC8564=m
+CONFIG_SENSORS_MAX1619=m
+
+
+#
+# Mice
+#
+CONFIG_BUSMOUSE=m
+# CONFIG_QIC02_TAPE is not set
+CONFIG_CRASH=m
+
+#
+# IPMI
+#
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_KCS=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_SI=m
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+CONFIG_SOFT_WATCHDOG=m
+CONFIG_WDT=m
+# CONFIG_WDT_501 is not set
+CONFIG_WDTPCI=m
+CONFIG_WDT_501_PCI=y
+CONFIG_PCWATCHDOG=m
+CONFIG_ACQUIRE_WDT=m
+CONFIG_ADVANTECH_WDT=m
+CONFIG_EUROTECH_WDT=m
+CONFIG_IB700_WDT=m
+CONFIG_I8XX_TCO=m
+# CONFIG_MIXCOMWD is not set
+# CONFIG_SCx200_WDT is not set
+# CONFIG_60XX_WDT is not set
+CONFIG_W83877F_WDT=m
+CONFIG_W83627HF_WDT=m
+CONFIG_MACHZ_WDT=m
+CONFIG_SC520_WDT=m
+CONFIG_AMD7XX_TCO=m
+CONFIG_ALIM7101_WDT=m
+CONFIG_ALIM1535_WDT=m
+CONFIG_SC1200_WDT=m
+CONFIG_WAFER_WDT=m
+CONFIG_CPU5_WDT=m
+CONFIG_PCIPCWATCHDOG=m
+CONFIG_USBPCWATCHDOG=m
+
+
+CONFIG_HW_RANDOM=m
+CONFIG_NVRAM=m
+CONFIG_RTC=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+# CONFIG_APPLICOM is not set
+CONFIG_SONYPI=m
+
+#
+# Ftape, the floppy tape device driver
+#
+CONFIG_AGP=y
+CONFIG_AGP_ALI=y
+CONFIG_AGP_ATI=y
+CONFIG_AGP_AMD=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+CONFIG_AGP_INTEL_MCH=y
+CONFIG_AGP_NVIDIA=y
+CONFIG_AGP_SIS=y
+CONFIG_AGP_SWORKS=y
+CONFIG_AGP_VIA=y
+CONFIG_AGP_EFFICEON=y
+CONFIG_DRM=y
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_GAMMA=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_I810=m
+CONFIG_DRM_I830=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+
+
+#
+# PCMCIA character devices
+#
+CONFIG_SYNCLINK_CS=m
+
+
+
+CONFIG_MWAVE=m
+# CONFIG_RAW_DRIVER is not set
+CONFIG_MAX_RAW_DEVS=8192
+CONFIG_HANGCHECK_TIMER=m
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+CONFIG_VIDEO_BT848=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_SAA5249=m
+CONFIG_TUNER_3036=m
+CONFIG_VIDEO_STRADIS=m
+CONFIG_VIDEO_ZORAN=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_MEYE=m
+CONFIG_VIDEO_SAA7134=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_SAA5246A=m
+
+#
+# Radio Adapters
+#
+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_MIROPCM20=m
+CONFIG_RADIO_MIROPCM20_RDS=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
+
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+CONFIG_DVB_CORE=m
+
+#
+# Supported Frontend Modules
+#
+CONFIG_DVB_STV0299=m
+# CONFIG_DVB_SP887X is not set
+# CONFIG_DVB_ALPS_TDLB7 is not set
+CONFIG_DVB_ALPS_TDMB7=m
+CONFIG_DVB_ATMEL_AT76C651=m
+CONFIG_DVB_CX24110=m
+CONFIG_DVB_GRUNDIG_29504_491=m
+CONFIG_DVB_GRUNDIG_29504_401=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_VES1820=m
+CONFIG_DVB_VES1X93=m
+CONFIG_DVB_TWINHAN_DST=m
+CONFIG_DVB_TTUSB_DEC=m
+CONFIG_DVB_BT8XX=m
+# CONFIG_DVB_TDA1004X is not set
+CONFIG_DVB_NXT6000=m
+
+#
+# Supported SAA7146 based PCI Adapters
+#
+CONFIG_DVB_AV7110=m
+CONFIG_DVB_AV7110_OSD=y
+# CONFIG_DVB_AV7110_FIRMWARE is not set
+CONFIG_DVB_BUDGET=m
+CONFIG_DVB_BUDGET_CI=m
+CONFIG_DVB_BUDGET_AV=m
+CONFIG_DVB_BUDGET_PATCH=m
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_TTUSB_BUDGET=m
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+CONFIG_DVB_B2C2_SKYSTAR=m
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_VIDEOBUF=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BTCX=m
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_VGA16=m
+CONFIG_FB_VESA=y
+CONFIG_VIDEO_SELECT=y
+CONFIG_FB_HGA=m
+CONFIG_FB_RIVA=m
+CONFIG_FB_I810=m
+CONFIG_FB_I810_GTF=y
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G450=y
+CONFIG_FB_MATROX_G100=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+CONFIG_FB_RADEON=m
+# CONFIG_FB_RADEON_DEBUG is not set
+# CONFIG_FB_RADEON_OLD is not set
+CONFIG_FB_RADEON_I2C=y
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY=m
+CONFIG_FB_ATY_CT=y
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_XL_INIT is not set
+# CONFIG_FB_SIS is not set
+CONFIG_FB_SIS_300=y
+CONFIG_FB_SIS_315=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_3DFX=m
+CONFIG_FB_VOODOO1=m
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_FB_KYRO=m
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
+# CONFIG_FB_ASILIANT is not set
+CONFIG_FB_HGA_ACCEL=y
+CONFIG_FB_3DFX_ACCEL=y
+CONFIG_FB_TRIDENT_ACCEL=y
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_MDA_CONSOLE=m
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS 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
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=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_BIT32_EMUL=y
+
+#
+# Generic devices
+#
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+# CONFIG_SND_SERIAL_U16550 is not set
+CONFIG_SND_MPU401=m
+
+#
+# ISA devices
+#
+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_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 is not set
+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
+
+#
+# PCI devices
+#
+CONFIG_SND_ALI5451=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_KORG1212=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_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VX222=m
+CONFIG_SND_BT87X=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_FM801_TEA575X=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_PDAUDIOCF=m
+
+
+#
+# ALSA USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# PCMCIA devices
+#
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_VXP440 is not set
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+# CONFIG_SOUND_BT878 is not set
+# CONFIG_SOUND_CMPCI is not set
+
+#
+# USB support
+#
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS 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_OHCI_HCD=m
+CONFIG_USB_UHCI_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_AUDIO=m
+
+#
+# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+#
+CONFIG_USB_MIDI=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_HP8200e=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+CONFIG_HID_FF=y
+CONFIG_HID_PID=y
+CONFIG_LOGITECH_FF=y
+CONFIG_THRUSTMASTER_FF=y
+CONFIG_USB_HIDDEV=y
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+CONFIG_USB_AIPTEK=m
+CONFIG_USB_WACOM=m
+CONFIG_USB_KBTAB=m
+CONFIG_USB_POWERMATE=m
+CONFIG_USB_XPAD=m
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_HPUSBSCSI=m
+
+#
+# USB Multimedia devices
+#
+CONFIG_USB_DABUSB=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_DSBR=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+CONFIG_USB_OV511=m
+CONFIG_USB_PWC=m
+CONFIG_USB_SE401=m
+CONFIG_USB_STV680=m
+
+#
+# USB Network adaptors
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+
+#
+# USB Host-to-Host Cables
+#
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_GENESYS=y
+CONFIG_USB_NET1080=y
+CONFIG_USB_PL2301=y
+
+#
+# Intelligent USB Devices/Gadgets
+#
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZAURUS=y
+CONFIG_USB_CDCETHER=y
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_AX8817X=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_SAFE_PADDED=y
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_EMI62=m
+CONFIG_USB_LED=m
+CONFIG_USB_G_SERIAL=m
+
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI26 is not set
+CONFIG_USB_TIGL=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_BRLVGER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_TEST=m
+# CONFIG_USB_GADGET is not set
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_SA1100 is not set
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_W9968CF=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_MTOUCH=m
+CONFIG_USB_ATI_REMOTE=m
+CONFIG_USB_ALI_M5632=y
+# CONFIG_USB_CYTHERM is not set
+CONFIG_USB_EGALAX=m
+CONFIG_USB_PHIDGETSERVO=m
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+CONFIG_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFS_FS=m
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_JFS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_RT is not set
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_SECURITY=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_QUOTA=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_ZISOFS_FS=y
+CONFIG_UDF_FS=m
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+# CONFIG_DEVFS_FS is not set
+CONFIG_DEVPTS_FS_XATTR=y
+CONFIG_DEVPTS_FS_SECURITY=y
+CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not seta
+CONFIG_AFFS_FS=m
+# uses sleepon and needs a major update
+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_JFFS_FS is not set
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_NAND=y
+CONFIG_CRAMFS=m
+CONFIG_VXFS_FS=m
+# CONFIG_HPFS_FS is not set
+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
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS 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 is not set
+# CONFIG_INTERMEZZO_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_RXRPC is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+CONFIG_OSF_PARTITION=y
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+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 is not set
+# CONFIG_NEC98_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+CONFIG_SUN_PARTITION=y
+CONFIG_EFI_PARTITION=y
+CONFIG_NLS=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS_DEFAULT="utf8"
+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_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
+
+#
+# Tux
+#
+CONFIG_TUX=m
+CONFIG_TUX_EXTCGI=y
+# CONFIG_TUX_EXTENDED_LOG is not set
+# CONFIG_TUX_DEBUG is not set
+
+
+#
+# Kernel hacking
+#
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_FRAME_POINTER is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_DRIVER is not set
+
+
+#
+# Security options
+#
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+# CONFIG_SECURITY_SELINUX_MLS is not set
+# CONFIG_AUDIT is not set
+CONFIG_AUDITSYSCALL=y
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=m
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=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_DEFLATE=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+# CONFIG_CRYPTO_TEST is not set
+CONFIG_LIBCRC32C=m
+CONFIG_CRYPTO_CRC32C=m
+
+#
+# Library routines
+#
+CONFIG_CRC32=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_PC=y
+# CONFIG_X86_PC is not set
+# 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=y
+# CONFIG_X86_ES7000 is not set
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+CONFIG_M686=y
+# 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_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP2 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_XADD=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+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_INTEL_USERCOPY=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_NR_CPUS=32
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_X86_IO_APIC=y
+CONFIG_X86_TSC=y
+CONFIG_X86_MCE=y
+# CONFIG_X86_MCE_NONFATAL is not set
+CONFIG_X86_MCE_P4THERMAL=y
+CONFIG_TOSHIBA=m
+CONFIG_I8K=m
+CONFIG_SONYPI=m
+CONFIG_MICROCODE=m
+CONFIG_X86_MSR=m
+CONFIG_X86_CPUID=m
+CONFIG_EDD=m
+# CONFIG_NOHIGHMEM is not set
+CONFIG_HIGHMEM4G=y
+CONFIG_HIGHMEM64G=y
+# CONFIG_HIGHMEM64G is not set
+CONFIG_HIGHMEM=y
+CONFIG_HIGHPTE=y
+# CONFIG_MATH_EMULATION is not set
+CONFIG_MTRR=y
+CONFIG_HAVE_DEC_LOCK=y
+# CONFIG_X86_UP_APIC is not set
+CONFIG_X86_PM_TIMER=y
+CONFIG_X86_4G=y
+# CONFIG_EFI is not set
+CONFIG_REGPARM=y
+# CONFIG_PCI_GOBIOS is not set
+# CONFIG_PCI_GODIRECT is not set
+CONFIG_PCI_GOANY=y
+CONFIG_MDA_CONSOLE=m
+CONFIG_SYNCLINK_CS=m
+CONFIG_SYNCLINK=m
+CONFIG_SYNCLINKMP=m
+CONFIG_HP100=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_CRASH=m
+CONFIG_I2O=m
+CONFIG_APM=y
+# CONFIG_APM_IGNORE_USER_SUSPEND is not set
+# CONFIG_APM_DO_ENABLE is not set
+CONFIG_APM_CPU_IDLE=y
+# CONFIG_APM_DISPLAY_BLANK is not set
+CONFIG_APM_RTC_IS_GMT=y
+# CONFIG_APM_ALLOW_INTS is not set
+# CONFIG_APM_REAL_MODE_POWER_OFF is not set
+CONFIG_X86_FIND_SMP_CONFIG=y
+CONFIG_X86_MPPARSE=y
+CONFIG_4KSTACKS=y
+CONFIG_X86_ACPI_CPUFREQ=m
+# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
+CONFIG_X86_POWERNOW_K6=m
+CONFIG_X86_POWERNOW_K7=y
+CONFIG_X86_POWERNOW_K8=m
+# CONFIG_X86_GX_SUSPMOD is not set
+CONFIG_X86_SPEEDSTEP_CENTRINO=y
+CONFIG_X86_SPEEDSTEP_ICH=y
+CONFIG_X86_SPEEDSTEP_SMI=m
+CONFIG_X86_SPEEDSTEP_LIB=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y
+# CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set
+CONFIG_X86_P4_CLOCKMOD=m
+CONFIG_X86_LONGRUN=y
+# CONFIG_X86_LONGHAUL is not set
+CONFIG_X86_SMP=y
+CONFIG_X86_HT=y
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_X86_TRAMPOLINE=y
+CONFIG_TUX=m
+CONFIG_NVRAM=m
+CONFIG_IBM_ASM=m
+CONFIG_M686=y
+# CONFIG_NOHIGHMEM is not set
+CONFIG_HIGHMEM64G=y
+CONFIG_HOTPLUG_PCI=y
+CONFIG_HOTPLUG_PCI_COMPAQ=m
+CONFIG_HOTPLUG_PCI_IBM=m
+# CONFIG_HIGHMEM64G is not set
+# CONFIG_EWRK3 is not set
+CONFIG_NR_CPUS=32
+# CONFIG_X86_PC is not set
+CONFIG_X86_GENERICARCH=y
diff --git a/Documentation/COPYING.modules b/Documentation/COPYING.modules
new file mode 100644 (file)
index 0000000..da0266e
--- /dev/null
@@ -0,0 +1,708 @@
+Date:  Thu, 29 Apr 2004 14:10:41 -0700 (PDT)
+From:  Linus Torvalds <torvalds@osdl.org>
+To:    Giuliano Colla
+cc:    Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
+Subject: Re: [hsflinux] [PATCH] Blacklist binary-only modules lying about
+       their license
+Message-ID: <Pine.LNX.4.58.0404291404100.1629@ppc970.osdl.org>
+
+On Thu, 29 Apr 2004, Giuliano Colla wrote:
+> 
+> Let's try not to be ridiculous, please.
+
+It's not abotu being ridiculous. It's about honoring peoples copyrights.
+
+> As an end user, if I buy a full fledged modem, I get some amount of 
+> proprietary, non GPL, code  which executes within the board or the 
+> PCMCIA card of the modem. The GPL driver may even support the 
+> functionality of downloading a new version of *proprietary* code into 
+> the flash Eprom of the device. The GPL linux driver interfaces with it, 
+> and all is kosher.
+
+Indeed. Everything is kosher, because the other piece of hardware and 
+software has _nothing_ to do with the kernel. It's not linked into it, it 
+cannot reasonably corrupt internal kernel data structures with random 
+pointer bugs, and in general you can think of firmware as part of the 
+_hardware_, not the software of the machine.
+
+> On the other hand, I have the misfortune of being stuck with a 
+> soft-modem, roughly the *same* proprietary code is provided as a binary 
+> file, and a linux driver (source provided) interfaces with it. In that 
+> case the kernel is flagged as "tainted".
+
+It is flagged as tainted, because your argument that it is "the same code" 
+is totally BOGUS AND UNTRUE!
+
+In the binary kernel module case, a bug in the code corrupts random data 
+structures, or accesses kernel internals without holding the proper locks, 
+or does a million other things wrong, BECAUSE A KERNEL MODULE IS VERY 
+INTIMATELY LINKED WITH THE KERNEL.
+
+A kernel module is _not_ a separate work, and can in _no_ way be seen as 
+"part of the hardware". It's very much a part of the _kernel_. And the 
+kernel developers require that such code be GPL'd so that it can be fixed, 
+or if there's a valid argument that it's not a derived work and not GPL'd, 
+then the kernel developers who have to support the end result mess most 
+definitely do need to know about the taint.
+
+You are not the first (and sadly, you likely won't be the last) person to 
+equate binary kernel modules with binary firmware. And I tell you that 
+such a comparison is ABSOLUTE CRAPOLA. There's a damn big difference 
+between running firmware on another chip behind a PCI bus, and linking 
+into the kernel directly.
+
+And if you don't see that difference, then you are either terminally 
+stupid, or you have some ulterior reason to claim that they are the same 
+case even though they clearly are NOT.
+
+> Can you honestly tell apart the two cases, if you don't make a it a case 
+> of "religion war"?
+
+It has absolutely nothing to do with religion.
+
+               Linus
+
+Date:  Fri, 5 Dec 2003 09:19:52 -0800 (PST)
+From:  Linus Torvalds <torvalds@osdl.org>
+To:    Peter Chubb 
+cc:    linux-kernel@vger.kernel.org
+Subject: Re: Linux GPL and binary module exception clause?
+Message-ID: <Pine.LNX.4.58.0312050853200.9125@home.osdl.org>
+
+On Fri, 5 Dec 2003, Peter Chubb wrote:
+>
+> As I understand it, SCO is/was claiming that JFS and XFS are derived
+> works of the UNIX source base, because they were developed to match
+> the internal interfaces of UNIX, and with knowledge of the internals
+> of UNIX -- and they hold the copyrights of and are the licensor of UNIX.
+
+Yes, and I'm not claiming anything like that.
+
+I claim that a "binary linux kernel module" is a derived work of the
+kernel, and thus has to come with sources.
+
+But if you use those same sources (and _you_ wrote them) they do not
+contain any Linux code, they are _clearly_ not derived from Linux, and you
+can license and use your own code any way you want.
+
+You just can't make a binary module for Linux, and claim that that module
+isn't derived from the kernel. Because it generally is - the binary
+module not only included header files, but more importantly it clearly is
+_not_ a standalone work any more. So even if you made your own prototypes
+and tried hard to avoid kernel headers, it would _still_ be connected and
+dependent on the kernel.
+
+And note that I'm very much talking about just the _binary_. Your source
+code is still very much yours, and you have the right to distribute it
+separately any which way you want. You wrote it, you own the copyrights to
+it, and it is an independent work.
+
+But when you distribute it in a way that is CLEARLY tied to the GPL'd
+kernel (and a binary module is just one such clear tie - a "patch" to
+build it or otherwise tie it to the kernel is also such a tie, even if you
+distribute it as source under some other license), you're BY DEFINITION
+not an independent work any more.
+
+(But exactly because I'm not a black-and-white person, I reserve the right
+to make a balanced decision on any particular case. I have several times
+felt that the module author had a perfectly valid argument for why the
+"default assumption" of being derived wasn't the case. That's why things
+like the AFS module were accepted - but not liked - in the first place).
+
+This is why SCO's arguments are specious. IBM wrote their code, retained
+their copyrights to their code AND THEY SEVERED THE CONNECTION TO SCO'S
+CODE (and, arguably the connections didn't even exist in the first place,
+since apparently things like JFS were written for OS/2 as well, and the
+Linux port was based on that one - but that's a separate argument and
+independent of my point).
+
+See the definition of "derivative" in USC 17.1.101:
+
+       A "derivative work" is a work based upon one or more preexisting
+       works, such as a translation, musical arrangement, dramatization,
+       fictionalization, motion picture version, sound recording, art
+       reproduction, abridgment, condensation, or any other form in which
+       a work may be recast, transformed, or adapted. A work consisting
+       of editorial revisions, annotations, elaborations, or other
+       modifications which, as a whole, represent an original work of
+       authorship, is a "derivative work".
+
+And a binary module is an "elaboration" on the kernel. Sorry, but that is
+how it IS.
+
+In short: your code is yours. The code you write is automatically
+copyrighted by YOU, and as such you have the right to license and use it
+any way you want (well, modulo _other_ laws, of course - in the US your
+license can't be racist, for example, but that has nothing to do with
+copyright laws, and would fall under a totally different legal framework).
+
+But when you use that code to create an "elaboration" to the kernel, that
+makes it a derived work, and you cannot distribute it except as laid out
+by the GPL. A binary module is one such case, but even just a source patch
+is _also_ one such case. The lines you added are yours, but when you
+distribute it as an elaboration, you are bound by the restriction on
+derivative works.
+
+Or you had better have some other strong argument why it isn't. Which has
+been my point all along.
+
+                       Linus
+
+
+Date:  Wed, 10 Dec 2003 09:10:18 -0800 (PST)
+From:  Linus Torvalds <torvalds@osdl.org>
+To:    Larry McVoy 
+Subject: Re: Linux GPL and binary module exception clause?
+
+On Wed, 10 Dec 2003, Larry McVoy wrote:
+>
+> Which is?  How is it that you can spend a page of text saying a judge doesn't
+> care about technicalities and then base the rest of your argument on the
+> distinction between a "plugin" and a "kernel module"?
+
+I'll stop arguing, since you obviously do not get it.
+
+I explained the technicalities to _you_, and you are a technical person.
+
+But if you want to explain something to a judge, you get a real lawyer,
+and you make sure that the lawyer tries to explain the issue in _non_
+technical terms. Because, quite frankly, the judge is not going to buy a
+technical discussion he or she doesn't understand.
+
+Just as an example, how do you explain to a judge how much code the Linux
+kernel contains? Do you say "it's 6 million lines of C code and header
+files and documentation, for a total of about 175MB of data"?
+
+Yeah, maybe you'd _mention_ that, but to actually _illustrate_ the point
+you'd say that if you printed it out, it would be a solid stack of papers
+100 feet high.  And you'd compare it to the height of the court building
+you're in, or something. Maybe you'd print out _one_ file, bind it as a
+book, and wave it around as one out of 15,000 files.
+
+But when _you_ ask me about how big the kernel is, I'd say "5 million
+lines". See the difference? It would be silly for me to tell you how many
+feet of paper the kernel would print out to, because we don't have those
+kinds of associations.
+
+Similarly, if you want to explain the notion of a kernel module, you'd
+compare it to maybe an extra chapter in a book. You'd make an analogy to
+something that never _ever_ mentions "linking".
+
+Just imagine: distributing a compiled binary-only kernel module that can
+be loaded into the kernel is not like distributing a new book: it's more
+like distributing a extra chapter to a book that somebody else wrote, that
+uses all the same characters and the plot, but more importantly it
+literally can only be read _together_ with the original work. It doesn't
+stand alone.
+
+In short, your honour, this extra chapter without any meaning on its own
+is a derived work of the book.
+
+In contrast, maybe you can re-write your code and distribute it as a
+short-story, which can be run on its own, and maybe the author has been
+influenced by another book, but the short-story could be bound AS IS, and
+a recipient would find it useful even without that other book. In that
+case, the short story is not a derived work - it's only inspired.
+
+Notice? This is actually _exactly_ what I've been arguing all along,
+except I've been arguing with a technical audience, so I've been using
+technical examples and terminology. But my argument is that just the fact
+that somebody compiled the code for Linux into a binary module that is
+useless without a particular version of the kernel DOES MAKE IT A DERIVED
+WORK.
+
+But also note how it's only the BINARY MODULE that is a derived work. Your
+source code is _not_ necessarily a derived work, and if you compile it for
+another operating system, I'd clearly not complain.
+
+This is the "stand-alone short story" vs "extra chapter without meaning
+outside the book" argument. See? One is a work in its own right, the other
+isn't.
+
+                       Linus
+
+
+Please read the FAQ at  http://www.tux.org/lkml/
+Date:  Thu, 4 Dec 2003 22:43:42 -0800 (PST)
+From:  Linus Torvalds <torvalds@osdl.org>
+To:    David Schwartz 
+cc:    linux-kernel@vger.kernel.org
+Subject: RE: Linux GPL and binary module exception clause?
+
+On Thu, 4 Dec 2003, David Schwartz wrote:
+>
+> Yes, but they will cite the prohibition against *creating* derived
+> works.
+
+So?
+
+The same prohibition exists with the GPL. You are not allowed to create
+and distribute a derived work unless it is GPL'd.
+
+I don't see what you are arguing against. It is very clear: a kernel
+module is a derived work of the kernel by default. End of story.
+
+You can then try to prove (through development history etc) that there
+would be major reasons why it's not really derived. But your argument
+seems to be that _nothing_ is derived, which is clearly totally false, as
+you yourself admit when you replace "kernel" with "Harry Potter".
+
+               Linus
+
+Date:  Wed, 3 Dec 2003 16:00:21 -0800 (PST)
+From:  Linus Torvalds <torvalds@osdl.org>
+To:    Kendall Bennet
+cc:    linux-kernel@vger.kernel.org
+Subject: Re: Linux GPL and binary module exception clause?
+
+On Wed, 3 Dec 2003, Kendall Bennett wrote:
+>
+> I have heard many people reference the fact that the although the Linux
+> Kernel is under the GNU GPL license, that the code is licensed with an
+> exception clause that says binary loadable modules do not have to be
+> under the GPL.
+
+Nope. No such exception exists.
+
+There's a clarification that user-space programs that use the standard
+system call interfaces aren't considered derived works, but even that
+isn't an "exception" - it's just a statement of a border of what is
+clearly considered a "derived work". User programs are _clearly_ not
+derived works of the kernel, and as such whatever the kernel license is
+just doesn't matter.
+
+And in fact, when it comes to modules, the GPL issue is exactly the same.
+The kernel _is_ GPL. No ifs, buts and maybe's about it. As a result,
+anything that is a derived work has to be GPL'd. It's that simple.
+
+Now, the "derived work" issue in copyright law is the only thing that
+leads to any gray areas. There are areas that are not gray at all: user
+space is clearly not a derived work, while kernel patches clearly _are_
+derived works.
+
+But one gray area in particular is something like a driver that was
+originally written for another operating system (ie clearly not a derived
+work of Linux in origin). At exactly what point does it become a derived
+work of the kernel (and thus fall under the GPL)?
+
+THAT is a gray area, and _that_ is the area where I personally believe
+that some modules may be considered to not be derived works simply because
+they weren't designed for Linux and don't depend on any special Linux
+behaviour.
+
+Basically:
+ - anything that was written with Linux in mind (whether it then _also_
+   works on other operating systems or not) is clearly partially a derived
+   work.
+ - anything that has knowledge of and plays with fundamental internal
+   Linux behaviour is clearly a derived work. If you need to muck around
+   with core code, you're derived, no question about it.
+
+Historically, there's been things like the original Andrew filesystem
+module: a standard filesystem that really wasn't written for Linux in the
+first place, and just implements a UNIX filesystem. Is that derived just
+because it got ported to Linux that had a reasonably similar VFS interface
+to what other UNIXes did? Personally, I didn't feel that I could make that
+judgment call. Maybe it was, maybe it wasn't, but it clearly is a gray
+area.
+
+Personally, I think that case wasn't a derived work, and I was willing to
+tell the AFS guys so.
+
+Does that mean that any kernel module is automatically not a derived work?
+HELL NO! It has nothing to do with modules per se, except that non-modules
+clearly are derived works (if they are so central to the kenrel that you
+can't load them as a module, they are clearly derived works just by virtue
+of being very intimate - and because the GPL expressly mentions linking).
+
+So being a module is not a sign of not being a derived work. It's just
+one sign that _maybe_ it might have other arguments for why it isn't
+derived.
+
+               Linus
+
+
+Date:  Wed, 3 Dec 2003 16:23:33 -0800 (PST)
+From:  Linus Torvalds <torvalds@osdl.org>
+To:    Kendall Bennett
+cc:    linux-kernel@vger.kernel.org
+Subject: Re: Linux GPL and binary module exception clause?
+
+
+On Wed, 3 Dec 2003, Linus Torvalds wrote:
+>
+> So being a module is not a sign of not being a derived work. It's just
+> one sign that _maybe_ it might have other arguments for why it isn't
+> derived.
+
+Side note: historically, the Linux kernel module interfaces were really
+quite weak, and only exported a few tens of entry-points, and really
+mostly effectively only allowed character and block device drivers with
+standard interfaces, and loadable filesystems.
+
+So historically, the fact that you could load a module using nothing but
+these standard interfaces tended to be a much stronger argument for not
+being very tightly coupled with the kernel.
+
+That has changed, and the kernel module interfaces we have today are MUCH
+more extensive than they were back in '95 or so. These days modules are
+used for pretty much everything, including stuff that is very much
+"internal kernel" stuff and as a result the kind of historic "implied
+barrier" part of modules really has weakened, and as a result there is not
+avery strong argument for being an independent work from just the fact
+that you're a module.
+
+Similarly, historically there was a much stronger argument for things like
+AFS and some of the binary drivers (long forgotten now) for having been
+developed totally independently of Linux: they literally were developed
+before Linux even existed, by people who had zero knowledge of Linux. That
+tends to strengthen the argument that they clearly aren't derived.
+
+In contrast, these days it would be hard to argue that a new driver or
+filesystem was developed without any thought of Linux. I think the NVidia
+people can probably reasonably honestly say that the code they ported had
+_no_ Linux origin. But quite frankly, I'd be less inclined to believe that
+for some other projects out there..
+
+                       Linus
+
+
+
+
+Date: Thu, 17 Oct 2002 10:08:19 -0700 (PDT)
+From: Linus Torvalds <torvalds@transmeta.com>
+To: Christoph Hellwig 
+Cc: <linux-kernel@vger.kernel.org>
+Subject: Re: [PATCH] make LSM register functions GPLonly exports
+In-Reply-To: <20021017175403.A32516@infradead.org>
+Message-ID: <Pine.LNX.4.44.0210170958340.6739-100000@home.transmeta.com>
+
+Note that if this fight ends up being a major issue, I'm just going to 
+remove LSM and let the security vendors do their own thing. So far
+
+ - I have not seen a lot of actual usage of the hooks
+ - seen a number of people who still worry that the hooks degrade 
+   performance in critical areas
+ - the worry that people use it for non-GPL'd modules is apparently real, 
+   considering Crispin's reply.
+
+I will re-iterate my stance on the GPL and kernel modules:
+
+  There is NOTHING in the kernel license that allows modules to be 
+  non-GPL'd. 
+
+  The _only_ thing that allows for non-GPL modules is copyright law, and 
+  in particular the "derived work" issue. A vendor who distributes non-GPL 
+  modules is _not_ protected by the module interface per se, and should 
+  feel very confident that they can show in a court of law that the code 
+  is not derived.
+
+  The module interface has NEVER been documented or meant to be a GPL 
+  barrier. The COPYING clearly states that the system call layer is such a 
+  barrier, so if you do your work in user land you're not in any way 
+  beholden to the GPL. The module interfaces are not system calls: there 
+  are system calls used to _install_ them, but the actual interfaces are
+  not.
+
+  The original binary-only modules were for things that were pre-existing 
+  works of code, ie drivers and filesystems ported from other operating 
+  systems, which thus could clearly be argued to not be derived works, and 
+  the original limited export table also acted somewhat as a barrier to 
+  show a level of distance.
+
+In short, Crispin: I'm going to apply the patch, and if you as a copyright 
+holder of that file disagree, I will simply remove all of he LSM code from 
+the kernel. I think it's very clear that a LSM module is a derived work, 
+and thus copyright law and the GPL are not in any way unclear about it. 
+
+If people think they can avoid the GPL by using function pointers, they 
+are WRONG. And they have always been wrong.
+
+                       Linus
+
+------------------------------------------------------------------------
+Date: Fri, 19 Oct 2001 13:16:45 -0700 (PDT)
+From: Linus Torvalds <torvalds@transmeta.com>
+To: Barnes
+Subject: Re: GPL, Richard Stallman, and the Linux kernel
+
+[ This is not, of course, a legal document, but if you want to forward it
+  to anybody else, feel free to do so. And if you want to argue legal
+  points with me or point somehting out, I'm always interested. To a
+  point ;-]
+
+On Fri, 19 Oct 2001, Barnes wrote:
+>
+> I've been exchanging e-mail with Richard Stallman for a couple of
+> weeks about the finer points of the GPL.
+
+I feel your pain.
+
+> I've have spent time pouring through mailing list archives, usenet,
+> and web search engines to find out what's already been covered about
+> your statement of allowing dynamically loaded kernel modules with
+> proprietary code to co-exist with the Linux kernel.  So far I've
+> been unable to find anything beyond vague statements attributed to
+> you.  If these issues are addressed somewhere already, please refer
+> me.
+
+Well, it really boils down to the equivalent of "_all_ derived modules
+have to be GPL'd". An external module doesn't really change the GPL in
+that respect.
+
+There are (mainly historical) examples of UNIX device drivers and some
+UNIX filesystems that were pre-existing pieces of work, and which had
+fairly well-defined and clear interfaces and that I personally could not
+really consider any kind of "derived work" at all, and that were thus
+acceptable. The clearest example of this is probably the AFS (the Andrew
+Filesystem), but there have been various device drivers ported from SCO
+too.
+
+> Issue #1
+> ========
+> Currently the GPL version 2 license is the only license covering the
+> Linux kernel.  I cannot find any alternative license explaining the
+> loadable kernel module exception which makes your position difficult
+> to legally analyze.
+>
+> There is a note at the top of www.kernel.org/pub/linux/kernel/COPYING,
+> but that states "user programs" which would clearly not apply to
+> kernel modules.
+>
+> Could you clarify in writing what the exception precisely states?
+
+Well, there really is no exception. However, copyright law obviously
+hinges on the definition of "derived work", and as such anything can
+always be argued on that point.
+
+I personally consider anything a "derived work" that needs special hooks
+in the kernel to function with Linux (ie it is _not_ acceptable to make a
+small piece of GPL-code as a hook for the larger piece), as that obviously
+implies that the bigger module needs "help" from the main kernel.
+
+Similarly, I consider anything that has intimate knowledge about kernel
+internals to be a derived work.
+
+What is left in the gray area tends to be clearly separate modules: code
+that had a life outside Linux from the beginning, and that do something
+self-containted that doesn't really have any impact on the rest of the
+kernel. A device driver that was originally written for something else,
+and that doesn't need any but the standard UNIX read/write kind of
+interfaces, for example.
+
+> Issue #2
+> ========
+> I've found statements attributed to you that you think only 10% of
+> the code in the current kernel was written by you.  By not being the
+> sole copyright holder of the Linux kernel, a stated exception to
+> the GPL seems invalid unless all kernel copyright holders agreed on
+> this exception.  How does the exception cover GPL'd kernel code not
+> written by you?  Has everyone contributing to the kernel forfeited
+> their copyright to you or agreed with the exception?
+
+Well, see above about the lack of exception, and about the fundamental
+gray area in _any_ copyright issue. The "derived work" issue is obviously
+a gray area, and I know lawyers don't like them. Crazy people (even
+judges) have, as we know, claimed that even obvious spoofs of a work that
+contain nothing of the original work itself, can be ruled to be "derived".
+
+I don't hold views that extreme, but at the same time I do consider a
+module written for Linux and using kernel infrastructures to get its work
+done, even if not actually copying any existing Linux code, to be a
+derived work by default. You'd have to have a strong case to _not_
+consider your code a derived work..
+
+> Issue #3
+> ========
+> This issue is related to issue #1.  Exactly what is covered by the
+> exception?  For example, all code shipped with the Linux kernel
+> archive and typically installed under /usr/src/linux, all code under
+> /usr/src/linux except /usr/src/linux/drivers, or just the code in
+> the /usr/src/linux/kernel directory?
+
+See above, and I think you'll see my point.
+
+The "user program" exception is not an exception at all, for example, it's
+just a more clearly stated limitation on the "derived work" issue. If you
+use standard UNIX system calls (with accepted Linux extensions), your
+program obviously doesn't "derive" from the kernel itself.
+
+Whenever you link into the kernel, either directly or through a module,
+the case is just a _lot_ more muddy. But as stated, by default it's
+obviously derived - the very fact that you _need_ to do something as
+fundamental as linking against the kernel very much argues that your
+module is not a stand-alone thing, regardless of where the module source
+code itself has come from.
+
+> Issue #4
+> ========
+> This last issue is not so much a issue for the Linux kernel
+> exception, but a request for comment.
+>
+> Richard and I both agree that a "plug-in" and a "dynamically
+> loaded kernel module" are effectively the same under the GPL.
+
+Agreed.
+
+The Linux kernel modules had (a long time ago), a more limited interface,
+and not very many functions were actually exported. So five or six years
+ago, we could believably claim that "if you only use these N interfaces
+that are exported from the standard kernel, you've kind of implicitly
+proven that you do not need the kernel infrastructure".
+
+That was never really documented either (more of a guideline for me and
+others when we looked at the "derived work" issue), and as modules were
+more-and-more used not for external stuff, but just for dynamic loading of
+standard linux modules that were distributed as part of the kernel anyway,
+the "limited interfaces" argument is no longer a very good guideline for
+"derived work".
+
+So these days, we export many internal interfaces, not because we don't
+think that they would "taint" the linker, but simply because it's useful
+to do dynamic run-time loading of modules even with standard kernel
+modules that _are_ supposed to know a lot about kernel internals, and are
+obviously "derived works"..
+
+> However we disagree that a plug-in for a GPL'd program falls
+> under the GPL as asserted in the GPL FAQ found in the answer:
+> http://www.gnu.org/licenses/gpl-faq.html#GPLAndPlugins.
+
+I think you really just disagree on what is derived, and what is not.
+Richard is very extreme: _anything_ that links is derived, regardless of
+what the arguments against it are. I'm less extreme, and I bet you're even
+less so (at least you would like to argue so for your company).
+
+> My assertion is that plug-ins are written to an interface, not a
+> program.  Since interfaces are not GPL'd, a plug-in cannot be GPL'd
+> until the plug-in and program are placed together and run.  That is
+> done by the end user, not the plug-in creator.
+
+I agree, but also disrespectfully disagree ;)
+
+It's an issue of what a "plug-in" is - is it a way for the program to
+internally load more modules as it needs them, or is it _meant_ to be a
+public, published interface.
+
+For example, the "system call" interface could be considered a "plug-in
+interface", and running a user mode program under Linux could easily be
+construed as running a "plug-in" for the Linux kernel. No?
+
+And there, I obviously absolutely agree with you 100%: the interface is
+published, and it's _meant_ for external and independent users. It's an
+interface that we go to great lengths to preserve as well as we can, and
+it's an interface that is designed to be independent of kernel versions.
+
+But maybe somebody wrote his program with the intention to dynamically
+load "actors" as they were needed, as a way to maintain a good modularity,
+and to try to keep the problem spaces well-defined. In that case, the
+"plug-in" may technically follow all the same rules as the system call
+interface, even though the author doesn't intend it that way.
+
+So I think it's to a large degree a matter of intent, but it could
+arguably also be considered a matter of stability and documentation (ie
+"require recompilation of the plug-in between version changes"  would tend
+to imply that it's an internal interface, while "documented binary
+compatibility across many releases" implies a more stable external
+interface, and less of a derived work)
+
+Does that make sense to you?
+
+> I asked Richard to comment on several scenarios involving plug-ins
+> explain whether or not they were in violation of the GPL.  So far he
+> as only addressed one and has effectively admitted a hole.  This is
+> the one I asked that he's responded to:
+>     [A] non-GPL'd plug-in writer writes a plug-in for a non-GPL'd
+>     program.  Another author writes a GPL'd program making the
+>     first author's plug-ins compatible with his program.  Are now
+>     the plug-in author's plug-ins now retroactively required to be
+>     GPL'd?
+>
+> His response:
+>     No, because the plug-in was not written to extend this program.
+>
+> I find it suspicious that whether or not the GPL would apply to the
+> plug-in depends on the mindset of the author.
+
+The above makes no sense if you think of it as a "plug in" issue, but it
+makes sense if you think of it as a "derived work" issue, along with
+taking "intent" into account.
+
+I know lawyers tend to not like the notion of "intent", because it brings
+in another whole range of gray areas, but it's obviously a legal reality.
+
+Ok, enough blathering from me. I'd just like to finish off with a few
+comments, just to clarify my personal stand:
+
+ - I'm obviously not the only copyright holder of Linux, and I did so on
+   purpose for several reasons. One reason is just because I hate the
+   paperwork and other cr*p that goes along with copyright assignments.
+
+   Another is that I don't much like copyright assignments at all: the
+   author is the author, and he may be bound by my requirement for GPL,
+   but that doesn't mean that he should give his copyright to me.
+
+   A third reason, and the most relevant reason here, is that I want
+   people to _know_ that I cannot control the sources. I can write you a
+   note to say that "for use XXX, I do not consider module YYY to be a
+   derived work of my kernel", but that would not really matter that much.
+   Any other Linux copyright holder might still sue you.
+
+   This third reason is what makes people who otherwise might not trust me
+   realize that I cannot screw people over. I am bound by the same
+   agreement that I require of everybody else, and the only special status
+   I really have is a totally non-legal issue: people trust me.
+
+   (Yes, I realize that I probably would end up having more legal status
+   than most, even apart from the fact that I still am the largest single
+   copyright holder, if only because of appearances)
+
+ - I don't really care about copyright law itself. What I care about is my
+   own morals. Whether I'd ever sue somebody or not (and quite frankly,
+   it's the last thing I ever want to do - if I never end up talking to
+   lawyers in a professional context, I'll be perfectly happy. No
+   disrespect intended) will be entirely up to whether I consider what
+   people do to me "moral" or not. Which is why intent matters to me a
+   lot - both the intent of the person/corporation doign the infringement,
+   _and_ the intent of me and others in issues like the module export
+   interface.
+
+   Another way of putting this: I don't care about "legal loopholes" and
+   word-wrangling.
+
+ - Finally: I don't trust the FSF. I like the GPL a lot - although not
+   necessarily as a legal piece of paper, but more as an intent. Which
+   explains why, if you've looked at the Linux COPYING file, you may have
+   noticed the explicit comment about "only _this_ particular version of
+   the GPL covers the kernel by default".
+
+   That's because I agree with the GPL as-is, but I do not agree with the
+   FSF on many other matters. I don't like software patents much, for
+   example, but I do not want the code I write to be used as a weapon
+   against companies that have them. The FSF has long been discussing and
+   is drafting the "next generation" GPL, and they generally suggest that
+   people using the GPL should say "v2 or at your choice any later
+   version".
+
+   Linux doesn't do that. The Linux kernel is v2 ONLY, apart from a few
+   files where the author put in the FSF extension (and see above about
+   copyright assignments why I would never remove such an extension).
+
+The "v2 only" issue might change some day, but only after all documented
+copyright holders agree on it, and only after we've seen what the FSF
+suggests. From what I've seen so far from the FSF drafts, we're not likely
+to change our v2-only stance, but there might of course be legal reasons
+why we'd have to do something like it (ie somebody challenging the GPLv2
+in court, and part of it to be found unenforceable or similar would
+obviously mean that we'd have to reconsider the license).
+
+               Linus
+
+PS. Historically, binary-only modules have not worked well under Linux,
+quite regardless of any copyright issues. The kernel just develops too
+quickly for binary modules to work well, and nobody really supports them.
+Companies like Red Hat etc tend to refuse to have anything to do with
+binary modules, because if something goes wrong there is nothing they can
+do about it. So I just wanted to let you know that the _legal_ issue is
+just the beginning. Even though you probably don't personally care ;)
+
+
diff --git a/Documentation/fb/pxafb.txt b/Documentation/fb/pxafb.txt
new file mode 100644 (file)
index 0000000..db9b850
--- /dev/null
@@ -0,0 +1,54 @@
+Driver for PXA25x LCD controller
+================================
+
+The driver supports the following options, either via
+options=<OPTIONS> when modular or video=pxafb:<OPTIONS> when built in.
+
+For example:
+       modprobe pxafb options=mode:640x480-8,passive
+or on the kernel command line
+       video=pxafb:mode:640x480-8,passive
+
+mode:XRESxYRES[-BPP]
+       XRES == LCCR1_PPL + 1
+       YRES == LLCR2_LPP + 1
+               The resolution of the display in pixels
+       BPP == The bit depth. Valid values are 1, 2, 4, 8 and 16.
+
+pixclock:PIXCLOCK
+       Pixel clock in picoseconds
+
+left:LEFT == LCCR1_BLW + 1
+right:RIGHT == LCCR1_ELW + 1
+hsynclen:HSYNC == LCCR1_HSW + 1
+upper:UPPER == LCCR2_BFW
+lower:LOWER == LCCR2_EFR
+vsynclen:VSYNC == LCCR2_VSW + 1
+       Display margins and sync times
+
+color | mono => LCCR0_CMS
+       umm...
+
+active | passive => LCCR0_PAS
+       Active (TFT) or Passive (STN) display
+
+single | dual => LCCR0_SDS
+       Single or dual panel passive display
+
+4pix | 8pix => LCCR0_DPD
+       4 or 8 pixel monochrome single panel data
+
+hsync:HSYNC
+vsync:VSYNC
+       Horizontal and vertical sync. 0 => active low, 1 => active
+       high.
+
+dpc:DPC
+       Double pixel clock. 1=>true, 0=>false
+
+outputen:POLARITY
+       Output Enable Polarity. 0 => active low, 1 => active high
+
+pixclockpol:POLARITY
+       pixel clock polarity
+       0 => falling edge, 1 => rising edge
diff --git a/Documentation/numastat.txt b/Documentation/numastat.txt
new file mode 100644 (file)
index 0000000..80133ac
--- /dev/null
@@ -0,0 +1,22 @@
+
+Numa policy hit/miss statistics
+
+/sys/devices/system/node/node*/numastat
+
+All units are pages. Hugepages have separate counters.
+
+numa_hit                       A process wanted to allocate memory from this node,
+                                       and succeeded.
+numa_miss                      A process wanted to allocate memory from this node,
+                                       but ended up with memory from another.
+numa_foreign           A process wanted to allocate on another node,
+                                   but ended up with memory from this one.
+local_node                     A process ran on this node and got memory from it.
+other_node                     A process ran on this node and got memory from another node.
+interleave_hit                 Interleaving wanted to allocate from this node
+                                       and succeeded.
+
+For easier reading you can use the numastat utility from the numactl package
+(ftp://ftp.suse.com/pub/people/ak/numa/numactl*). Note that it only works
+well right now on machines with a small number of CPUs.
+
diff --git a/Documentation/sched-domains.txt b/Documentation/sched-domains.txt
new file mode 100644 (file)
index 0000000..b5da811
--- /dev/null
@@ -0,0 +1,55 @@
+Each CPU has a "base" scheduling domain (struct sched_domain). These are
+accessed via cpu_sched_domain(i) and this_sched_domain() macros. The domain
+hierarchy is built from these base domains via the ->parent pointer. ->parent
+MUST be NULL terminated, and domain structures should be per-CPU as they
+are locklessly updated.
+
+Each scheduling domain spans a number of CPUs (stored in the ->span field).
+A domain's span MUST be a superset of it child's span, and a base domain
+for CPU i MUST span at least i. The top domain for each CPU will generally
+span all CPUs in the system although strictly it doesn't have to, but this
+could lead to a case where some CPUs will never be given tasks to run unless
+the CPUs allowed mask is explicitly set. A sched domain's span means "balance
+process load among these CPUs".
+
+Each scheduling domain must have one or more CPU groups (struct sched_group)
+which are organised as a circular one way linked list from the ->groups
+pointer. The union of cpumasks of these groups MUST be the same as the
+domain's span. The intersection of cpumasks from any two of these groups
+MUST be the empty set. The group pointed to by the ->groups pointer MUST
+contain the CPU to which the domain belongs. Groups may be shared among
+CPUs as they contain read only data after they have been set up.
+
+Balancing within a sched domain occurs between groups. That is, each group
+is treated as one entity. The load of a group is defined as the sum of the
+load of each of its member CPUs, and only when the load of a group becomes
+out of balance are tasks moved between groups.
+
+In kernel/sched.c, rebalance_tick is run periodically on each CPU. This
+function takes its CPU's base sched domain and checks to see if has reached
+its rebalance interval. If so, then it will run load_balance on that domain.
+rebalance_tick then checks the parent sched_domain (if it exists), and the
+parent of the parent and so forth.
+
+*** Implementing sched domains ***
+The "base" domain will "span" the first level of the hierarchy. In the case
+of SMT, you'll span all siblings of the physical CPU, with each group being
+a single virtual CPU.
+
+In SMP, the parent of the base domain will span all physical CPUs in the
+node. Each group being a single physical CPU. Then with NUMA, the parent
+of the SMP domain will span the entire machine, with each group having the
+cpumask of a node. Or, you could do multi-level NUMA or Opteron, for example,
+might have just one domain covering its one NUMA level.
+
+The implementor should read comments in include/linux/sched.h:
+struct sched_domain fields, SD_FLAG_*, SD_*_INIT to get an idea of
+the specifics and what to tune.
+
+Implementors should change the line
+#undef SCHED_DOMAIN_DEBUG
+to
+#define SCHED_DOMAIN_DEBUG
+in kernel/sched.c as this enables an error checking parse of the sched domains
+which should catch most possible errors (described above). It also prints out
+the domain structure in a visual format.
diff --git a/Documentation/scsi/sym53c500_cs.txt b/Documentation/scsi/sym53c500_cs.txt
new file mode 100644 (file)
index 0000000..75febcf
--- /dev/null
@@ -0,0 +1,23 @@
+The sym53c500_cs driver originated as an add-on to David Hinds' pcmcia-cs
+package, and was written by Tom Corner (tcorner@via.at).  A rewrite was
+long overdue, and the current version addresses the following concerns:
+
+       (1) extensive kernel changes between 2.4 and 2.6.
+       (2) deprecated PCMCIA support outside the kernel.
+
+All the USE_BIOS code has been ripped out.  It was never used, and could
+not have worked anyway.  The USE_DMA code is likewise gone.  Many thanks
+to YOKOTA Hiroshi (nsp_cs driver) and David Hinds (qlogic_cs driver) for
+the code fragments I shamelessly adapted for this work.  Thanks also to
+Christoph Hellwig for his patient tutelage while I stumbled about.
+
+The Symbios Logic 53c500 chip was used in the "newer" (circa 1997) version
+of the New Media Bus Toaster PCMCIA SCSI controller.  Presumably there are
+other products using this chip, but I've never laid eyes (much less hands)
+on one.
+
+Through the years, there have been a number of downloads of the pcmcia-cs
+version of this driver, and I guess it worked for those users.  It worked
+for Tom Corner, and it works for me.  Your mileage will probably vary.
+
+--Bob Tracy (rct@frus.com)
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
new file mode 100644 (file)
index 0000000..3377f88
--- /dev/null
@@ -0,0 +1,89 @@
+
+config ARCH_SUPPORTS_BIG_ENDIAN
+       bool
+       depends on ARCH_IXP4XX
+       default y
+
+menu "Intel IXP4xx Implementation Options"
+
+comment "IXP4xx Platforms"
+
+config ARCH_AVILA
+       bool "Avila"
+       depends on ARCH_IXP4XX
+       help
+         Say 'Y' here if you want your kernel to support the Gateworks
+         Avila Network Platform. For more information on this platform,
+         see Documentation/arm/IXP4xx.
+
+config ARCH_ADI_COYOTE
+       bool "Coyote"
+       depends on ARCH_IXP4XX
+       help
+         Say 'Y' here if you want your kernel to support the ADI 
+         Engineering Coyote Gateway Reference Platform. For more
+         information on this platform, see Documentation/arm/IXP4xx.
+
+config ARCH_IXDP425
+       bool "IXDP425"
+       depends on ARCH_IXP4XX
+       help
+         Say 'Y' here if you want your kernel to support Intel's 
+         IXDP425 Development Platform (Also known as Richfield).  
+         For more information on this platform, see Documentation/arm/IXP4xx.
+
+#
+# IXCDP1100 is the exact same HW as IXDP425, but with a different machine 
+# number from the bootloader due to marketing monkeys, so we just enable it 
+# by default if IXDP425 is enabled.
+#
+config ARCH_IXCDP1100
+       bool 
+       depends on ARCH_IXDP425
+       default y
+
+config ARCH_PRPMC1100
+       bool "PrPMC1100"
+       depends on ARCH_IXP4XX
+       help
+         Say 'Y' here if you want your kernel to support the Motorola
+         PrPCM1100 Processor Mezanine Module. For more information on
+         this platform, see Documentation/arm/IXP4xx.
+
+#
+# Avila and IXDP share the same source for now. Will change in future
+#
+config ARCH_IXDP4XX
+       bool
+       depends on ARCH_IXDP425 || ARCH_AVILA
+       default y
+
+comment "IXP4xx Options"
+
+config IXP4XX_INDIRECT_PCI
+       bool "Use indirect PCI memory access"
+       depends on ARCH_IXP4XX
+       help
+          IXP4xx provides two methods of accessing PCI memory space:
+
+          1) A direct mapped window from 0x48000000 to 0x4bffffff (64MB).
+             To access PCI via this space, we simply ioremap() the BAR
+             into the kernel and we can use the standard read[bwl]/write[bwl]
+             macros. This is the preffered method due to speed but it
+             limits the system to just 64MB of PCI memory. This can be 
+             problamatic if using video cards and other memory-heavy devices.
+          
+          2) If > 64MB of memory space is required, the IXP4xx can be 
+            configured to use indirect registers to access PCI This allows 
+            for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus. 
+            The disadvantadge of this is that every PCI access requires 
+            three local register accesses plus a spinlock, but in some 
+            cases the performance hit is acceptable. In addition, you cannot 
+            mmap() PCI devices in this case due to the indirect nature
+            of the PCI window.
+
+         By default, the direct method is used. Choose this option if you
+         need to use the indirect method instead. If you don't know
+         what you need, leave this option unselected.
+
+endmenu
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
new file mode 100644 (file)
index 0000000..bc6e0d0
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * arch/arm/mach-ixp4xx/coyote-setup.c
+ *
+ * ADI Engineering Coyote board-setup 
+ *
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Author: Deepak Saxena <dsaxena@plexity.net>
+ */
+
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_core.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+#ifdef __ARMEB__
+#define        REG_OFFSET      3
+#else
+#define        REG_OFFSET      0
+#endif
+
+/*
+ * Only one serial port is connected on the Coyote.
+ */
+static struct uart_port coyote_serial_port = {
+       .membase        = (char*)(IXP4XX_UART2_BASE_VIRT + REG_OFFSET),
+       .mapbase        = (IXP4XX_UART2_BASE_PHYS),
+       .irq            = IRQ_IXP4XX_UART2,
+       .flags          = UPF_SKIP_TEST,
+       .iotype         = UPIO_MEM,     
+       .regshift       = 2,
+       .uartclk        = IXP4XX_UART_XTAL,
+       .line           = 0,
+       .type           = PORT_XSCALE,
+       .fifosize       = 32
+};
+
+void __init coyote_map_io(void)
+{
+       early_serial_setup(&coyote_serial_port);
+
+       ixp4xx_map_io();
+}
+
+static struct flash_platform_data coyote_flash_data = {
+       .map_name       = "cfi_probe",
+       .width          = 2,
+};
+
+static struct resource coyote_flash_resource = {
+       .start          = COYOTE_FLASH_BASE,
+       .end            = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device coyote_flash_device = {
+       .name           = "IXP4XX-Flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data = &coyote_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &coyote_flash_resource,
+};
+
+static void __init coyote_init(void)
+{
+       platform_add_device(&coyote_flash_device);
+}
+
+MACHINE_START(ADI_COYOTE, "ADI Engineering IXP4XX Coyote Development Platform")
+        MAINTAINER("MontaVista Software, Inc.")
+        BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
+                IXP4XX_PERIPHERAL_BASE_VIRT)
+        MAPIO(coyote_map_io)
+        INITIRQ(ixp4xx_init_irq)
+        BOOT_PARAMS(0x0100)
+       INIT_MACHINE(coyote_init)
+MACHINE_END
+
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
new file mode 100644 (file)
index 0000000..160117c
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * arch/arm/mach-ixp4xx/ixdp425-setup.c
+ *
+ * IXDP425/IXCDP1100 board-setup 
+ *
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Author: Deepak Saxena <dsaxena@plexity.net>
+ */
+
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_core.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+#ifdef __ARMEB__
+#define        REG_OFFSET      3
+#else
+#define        REG_OFFSET      0
+#endif
+
+/*
+ * IXDP425 uses both chipset serial ports
+ */
+static struct uart_port ixdp425_serial_ports[] = {
+       {
+               .membase        = (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET),
+               .mapbase        = (IXP4XX_UART1_BASE_PHYS),
+               .irq            = IRQ_IXP4XX_UART1,
+               .flags          = UPF_SKIP_TEST,
+               .iotype         = UPIO_MEM,     
+               .regshift       = 2,
+               .uartclk        = IXP4XX_UART_XTAL,
+               .line           = 0,
+               .type           = PORT_XSCALE,
+               .fifosize       = 32
+       } , {
+               .membase        = (char*)(IXP4XX_UART2_BASE_VIRT + REG_OFFSET),
+               .mapbase        = (IXP4XX_UART2_BASE_PHYS),
+               .irq            = IRQ_IXP4XX_UART2,
+               .flags          = UPF_SKIP_TEST,
+               .iotype         = UPIO_MEM,     
+               .regshift       = 2,
+               .uartclk        = IXP4XX_UART_XTAL,
+               .line           = 1,
+               .type           = PORT_XSCALE,
+               .fifosize       = 32
+       }
+};
+
+void __init ixdp425_map_io(void) 
+{
+       early_serial_setup(&ixdp425_serial_ports[0]);
+       early_serial_setup(&ixdp425_serial_ports[1]);
+
+       ixp4xx_map_io();
+}
+
+static struct flash_platform_data ixdp425_flash_data = {
+       .map_name       = "cfi_probe",
+       .width          = 2,
+};
+
+static struct resource ixdp425_flash_resource = {
+       .start          = IXDP425_FLASH_BASE,
+       .end            = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device ixdp425_flash_device = {
+       .name           = "IXP4XX-Flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data = &ixdp425_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &ixdp425_flash_resource,
+};
+
+static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
+       .sda_pin        = IXDP425_SDA_PIN,
+       .scl_pin        = IXDP425_SCL_PIN,
+};
+
+static struct platform_device ixdp425_i2c_controller = {
+       .name           = "IXP4XX-I2C",
+       .id             = 0,
+       .dev            = {
+               .platform_data = &ixdp425_i2c_gpio_pins,
+       },
+       .num_resources  = 0
+};
+
+static void __init ixdp425_init(void)
+{
+       platform_add_device(&ixdp425_flash_device);
+       platform_add_device(&ixdp425_i2c_controller);
+}
+
+MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
+       MAINTAINER("MontaVista Software, Inc.")
+       BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
+               IXP4XX_PERIPHERAL_BASE_VIRT)
+       MAPIO(ixdp425_map_io)
+       INITIRQ(ixp4xx_init_irq)
+       BOOT_PARAMS(0x0100)
+       INIT_MACHINE(ixdp425_init)
+MACHINE_END
+
+MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
+       MAINTAINER("MontaVista Software, Inc.")
+       BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
+               IXP4XX_PERIPHERAL_BASE_VIRT)
+       MAPIO(ixdp425_map_io)
+       INITIRQ(ixp4xx_init_irq)
+       BOOT_PARAMS(0x0100)
+       INIT_MACHINE(ixdp425_init)
+MACHINE_END
+
+/*
+ * Avila is functionally equivalent to IXDP425 except that it adds
+ * a CF IDE slot hanging off the expansion bus. When we have a 
+ * driver for IXP4xx CF IDE with driver model support we'll move
+ * Avila to it's own setup file.
+ */
+#ifdef CONFIG_ARCH_AVILA
+MACHINE_START(AVILA, "Gateworks Avila Network Platform")
+       MAINTAINER("Deepak Saxena <dsaxena@plexity.net>")
+       BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
+               IXP4XX_PERIPHERAL_BASE_VIRT)
+       MAPIO(ixdp425_map_io)
+       INITIRQ(ixp4xx_init_irq)
+       BOOT_PARAMS(0x0100)
+       INIT_MACHINE(ixdp425_init)
+MACHINE_END
+#endif
+
diff --git a/arch/arm/mach-pxa/leds-mainstone.c b/arch/arm/mach-pxa/leds-mainstone.c
new file mode 100644 (file)
index 0000000..cb6f6dd
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * linux/arch/arm/mach-pxa/leds-mainstone.c
+ *
+ * Author:     Nicolas Pitre
+ * Created:    Nov 05, 2002
+ * Copyright:  MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+#include <asm/leds.h>
+#include <asm/system.h>
+
+#include "leds.h"
+
+
+/* 8 discrete leds available for general use: */
+#define D28                    (1 << 0)
+#define D27                    (1 << 1)
+#define D26                    (1 << 2)
+#define D25                    (1 << 3)
+#define D24                    (1 << 4)
+#define D23                    (1 << 5)
+#define D22                    (1 << 6)
+#define D21                    (1 << 7)
+
+#define LED_STATE_ENABLED      1
+#define LED_STATE_CLAIMED      2
+
+static unsigned int led_state;
+static unsigned int hw_led_state;
+
+void mainstone_leds_event(led_event_t evt)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+
+       switch (evt) {
+       case led_start:
+               hw_led_state = 0;
+               led_state = LED_STATE_ENABLED;
+               break;
+
+       case led_stop:
+               led_state &= ~LED_STATE_ENABLED;
+               break;
+
+       case led_claim:
+               led_state |= LED_STATE_CLAIMED;
+               hw_led_state = 0;
+               break;
+
+       case led_release:
+               led_state &= ~LED_STATE_CLAIMED;
+               hw_led_state = 0;
+               break;
+
+#ifdef CONFIG_LEDS_TIMER
+       case led_timer:
+               hw_led_state ^= D26;
+               break;
+#endif
+
+#ifdef CONFIG_LEDS_CPU
+       case led_idle_start:
+               hw_led_state &= ~D27;
+               break;
+
+       case led_idle_end:
+               hw_led_state |= D27;
+               break;
+#endif
+
+       case led_halted:
+               break;
+
+       case led_green_on:
+               hw_led_state |= D21;;
+               break;
+
+       case led_green_off:
+               hw_led_state &= ~D21;
+               break;
+
+       case led_amber_on:
+               hw_led_state |= D22;;
+               break;
+
+       case led_amber_off:
+               hw_led_state &= ~D22;
+               break;
+
+       case led_red_on:
+               hw_led_state |= D23;;
+               break;
+
+       case led_red_off:
+               hw_led_state &= ~D23;
+               break;
+
+       default:
+               break;
+       }
+
+       if  (led_state & LED_STATE_ENABLED)
+               MST_LEDCTRL = (MST_LEDCTRL | 0xff) & ~hw_led_state;
+       else
+               MST_LEDCTRL |= 0xff;
+
+       local_irq_restore(flags);
+}
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
new file mode 100644 (file)
index 0000000..cd7da1d
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ *  linux/arch/arm/mach-pxa/mainstone.c
+ *
+ *  Support for the Intel HCDDBBVA0 Development Platform.
+ *  (go figure how they came up with such name...)
+ *
+ *  Author:    Nicolas Pitre
+ *  Created:   Nov 05, 2002
+ *  Copyright: MontaVista Software Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/sched.h>
+#include <linux/bitops.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include "generic.h"
+
+
+static unsigned long mainstone_irq_enabled;
+
+static void mainstone_mask_irq(unsigned int irq)
+{
+       int mainstone_irq = (irq - MAINSTONE_IRQ(0));
+       MST_INTMSKENA = (mainstone_irq_enabled &= ~(1 << mainstone_irq));
+}
+
+static void mainstone_unmask_irq(unsigned int irq)
+{
+       int mainstone_irq = (irq - MAINSTONE_IRQ(0));
+       /* the irq can be acknowledged only if deasserted, so it's done here */
+       MST_INTSETCLR &= ~(1 << mainstone_irq);
+       MST_INTMSKENA = (mainstone_irq_enabled |= (1 << mainstone_irq));
+}
+
+static struct irqchip mainstone_irq_chip = {
+       .ack            = mainstone_mask_irq,
+       .mask           = mainstone_mask_irq,
+       .unmask         = mainstone_unmask_irq,
+};
+
+
+static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc,
+                                 struct pt_regs *regs)
+{
+       unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled;
+       do {
+               GEDR(0) = GPIO_bit(0);  /* clear useless edge notification */
+               if (likely(pending)) {
+                       irq = MAINSTONE_IRQ(0) + __ffs(pending);
+                       desc = irq_desc + irq;
+                       desc->handle(irq, desc, regs);
+               }
+               pending = MST_INTSETCLR & mainstone_irq_enabled;
+       } while (pending);
+}
+
+static void __init mainstone_init_irq(void)
+{
+       int irq;
+
+       pxa_init_irq();
+
+       /* setup extra Mainstone irqs */
+       for(irq = MAINSTONE_IRQ(0); irq <= MAINSTONE_IRQ(15); irq++) {
+               set_irq_chip(irq, &mainstone_irq_chip);
+               set_irq_handler(irq, do_level_IRQ);
+               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+       }
+       set_irq_flags(MAINSTONE_IRQ(8), 0);
+       set_irq_flags(MAINSTONE_IRQ(12), 0);
+
+       MST_INTMSKENA = 0;
+       MST_INTSETCLR = 0;
+
+       set_irq_chained_handler(IRQ_GPIO(0), mainstone_irq_handler);
+       set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
+}
+
+
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .start  = (MST_ETH_PHYS + 0x300),
+               .end    = (MST_ETH_PHYS + 0xfffff),
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = MAINSTONE_IRQ(3),
+               .end    = MAINSTONE_IRQ(3),
+               .flags  = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device smc91x_device = {
+       .name           = "smc91x",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(smc91x_resources),
+       .resource       = smc91x_resources,
+};
+
+static void __init mainstone_init(void)
+{
+       platform_add_device(&smc91x_device);
+}
+
+
+static struct map_desc mainstone_io_desc[] __initdata = {
+  { MST_FPGA_VIRT, MST_FPGA_PHYS, 0x00100000, MT_DEVICE }, /* CPLD */
+};
+
+static void __init mainstone_map_io(void)
+{
+       pxa_map_io();
+       iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc));
+}
+
+MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
+       MAINTAINER("MontaVista Software Inc.")
+       BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
+       MAPIO(mainstone_map_io)
+       INITIRQ(mainstone_init_irq)
+       INIT_MACHINE(mainstone_init)
+MACHINE_END
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
new file mode 100644 (file)
index 0000000..f57c962
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ *  linux/arch/arm/mach-pxa/pxa25x.c
+ *
+ *  Author:    Nicolas Pitre
+ *  Created:   Jun 15, 2001
+ *  Copyright: MontaVista Software Inc.
+ *
+ * Code specific to PXA21x/25x/26x variants.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Since this file should be linked before any other machine specific file,
+ * the __initcall() here will be executed first.  This serves as default
+ * initialization stuff for PXA machines which can be overridden later if
+ * need be.
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/pm.h>
+
+#include <asm/hardware.h>
+
+#include "generic.h"
+
+/*
+ * Various clock factors driven by the CCCR register.
+ */
+
+/* Crystal Frequency to Memory Frequency Multiplier (L) */
+static unsigned char L_clk_mult[32] = { 0, 27, 32, 36, 40, 45, 0, };
+
+/* Memory Frequency to Run Mode Frequency Multiplier (M) */
+static unsigned char M_clk_mult[4] = { 0, 1, 2, 4 };
+
+/* Run Mode Frequency to Turbo Mode Frequency Multiplier (N) */
+/* Note: we store the value N * 2 here. */
+static unsigned char N2_clk_mult[8] = { 0, 0, 2, 3, 4, 0, 6, 0 };
+
+/* Crystal clock */
+#define BASE_CLK       3686400
+
+/*
+ * Get the clock frequency as reflected by CCCR and the turbo flag.
+ * We assume these values have been applied via a fcs.
+ * If info is not 0 we also display the current settings.
+ */
+unsigned int get_clk_frequency_khz(int info)
+{
+       unsigned long cccr, turbo;
+       unsigned int l, L, m, M, n2, N;
+
+       cccr = CCCR;
+       asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (turbo) );
+
+       l  =  L_clk_mult[(cccr >> 0) & 0x1f];
+       m  =  M_clk_mult[(cccr >> 5) & 0x03];
+       n2 = N2_clk_mult[(cccr >> 7) & 0x07];
+
+       L = l * BASE_CLK;
+       M = m * L;
+       N = n2 * M / 2;
+
+       if(info)
+       {
+               L += 5000;
+               printk( KERN_INFO "Memory clock: %d.%02dMHz (*%d)\n",
+                       L / 1000000, (L % 1000000) / 10000, l );
+               M += 5000;
+               printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n",
+                       M / 1000000, (M % 1000000) / 10000, m );
+               N += 5000;
+               printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n",
+                       N / 1000000, (N % 1000000) / 10000, n2 / 2, (n2 % 2) * 5,
+                       (turbo & 1) ? "" : "in" );
+       }
+
+       return (turbo & 1) ? (N/1000) : (M/1000);
+}
+
+EXPORT_SYMBOL(get_clk_frequency_khz);
+
+/*
+ * Return the current lclk requency in units of 10kHz
+ */
+unsigned int get_lclk_frequency_10khz(void)
+{
+       return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000;
+}
+
+EXPORT_SYMBOL(get_lclk_frequency_10khz);
+
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
new file mode 100644 (file)
index 0000000..1addceb
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ *  linux/arch/arm/mach-pxa/pxa27x.c
+ *
+ *  Author:    Nicolas Pitre
+ *  Created:   Nov 05, 2002
+ *  Copyright: MontaVista Software Inc.
+ *
+ * Code specific to PXA27x aka Bulverde.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/pm.h>
+
+#include <asm/hardware.h>
+
+#include "generic.h"
+
+/* Crystal clock : 13-MHZ*/
+#define BASE_CLK       13000000
+
+/*
+ * Get the clock frequency as reflected by CCSR and the turbo flag.
+ * We assume these values have been applied via a fcs.
+ * If info is not 0 we also display the current settings.
+ *
+ * For more details, refer to Bulverde Manual, section 3.8.2.1
+ */
+unsigned int get_clk_frequency_khz( int info)
+{
+       unsigned long ccsr, turbo, b, ht;
+       unsigned int l, L, m, M, n2, N, S, cccra;
+
+       ccsr = CCSR;
+       cccra = CCCR & (0x1 << 25);
+
+       /* Read clkcfg register: it has turbo, b, half-turbo (and f) */
+       asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (turbo) );
+       b = (turbo & (0x1 << 3));
+       ht = (turbo & (0x1 << 2));
+
+       l  = ccsr & 0x1f;
+       n2 = (ccsr>>7) & 0xf;
+       if (l == 31) {
+               /* The calculation from the Yellow Book is incorrect:
+                  it says M=4 for L=21-30 (which is easy to calculate
+                  by subtracting 1 and then dividing by 10, but not
+                  with 31, so we'll do it manually */
+               m = 1 << 2;
+       } else {
+               m = 1 << ((l-1)/10);
+       }
+
+       L = l * BASE_CLK;
+       N = (n2 * L) / 2;
+       S = (b) ? L : (L/2);
+       if (cccra == 0)
+               M = L/m;
+       else
+               M = (b) ? L : (L/2);
+
+       if (info) {
+               printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n",
+                       L / 1000000, (L % 1000000) / 10000, l );
+               printk( KERN_INFO "Memory clock: %d.%02dMHz (/%d)\n",
+                       M / 1000000, (M % 1000000) / 10000, m );
+               printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n",
+                       N / 1000000, (N % 1000000)/10000, n2 / 2, (n2 % 2)*5,
+                       (turbo & 1) ? "" : "in" );
+               printk( KERN_INFO "System bus clock: %d.%02dMHz \n",
+                       S / 1000000, (S % 1000000) / 10000 );
+       }
+
+       return (turbo & 1) ? (N/1000) : (L/1000);
+}
+
+/*
+ * Return the current mem clock frequency in units of 10kHz as
+ * reflected by CCCR[A], B, and L
+ */
+unsigned int get_lclk_frequency_10khz(void)
+{
+       unsigned long ccsr, clkcfg, b;
+       unsigned int l, L, m, M, cccra;
+
+       cccra = CCCR & (0x1 << 25);
+
+       /* Read clkcfg register to obtain b */
+       asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg) );
+       b = (clkcfg & (0x1 << 3));
+
+       ccsr = CCSR;
+       l  =  ccsr & 0x1f;
+       if (l == 31) {
+               /* The calculation from the Yellow Book is incorrect:
+                  it says M=4 for L=21-30 (which is easy to calculate
+                  by subtracting 1 and then dividing by 10, but not
+                  with 31, so we'll do it manually */
+               m = 1 << 2;
+       } else {
+               m = 1 << ((l-1)/10);
+       }
+
+       L = l * BASE_CLK;
+       if (cccra == 0)
+               M = L/m;
+       else
+               M = (b) ? L : L/2;
+
+       return (M / 10000);
+}
+
+EXPORT_SYMBOL(get_clk_frequency_khz);
+EXPORT_SYMBOL(get_lclk_frequency_10khz);
+
diff --git a/arch/h8300/Kconfig.cpu b/arch/h8300/Kconfig.cpu
new file mode 100644 (file)
index 0000000..d9dd62a
--- /dev/null
@@ -0,0 +1,183 @@
+menu "Processor type and features"
+
+choice
+       prompt "H8/300 platform"
+       default H8300H_GENERIC
+
+config H8300H_GENERIC
+       bool "H8/300H Generic"
+       help
+         H8/300H CPU Generic Hardware Support
+
+config H8300H_AKI3068NET
+       bool "AE-3068/69"
+       help
+         AKI-H8/3068F / AKI-H8/3069F Flashmicom LAN Board Support
+         More Information. (Japanese Only)
+         <http://akizukidensi.com/catalog/h8.html>
+         AE-3068/69 Evaluation Board Support
+         More Information.
+         <http://www.microtronique.com/ae3069lan.htm>
+
+config H8300H_H8MAX
+       bool "H8MAX"
+       help
+         H8MAX Evaluation Board Support
+         More Information. (Japanese Only)
+         <http://strawberry-linux.com/h8/index.html>
+
+config H8300H_SIM
+       bool "H8/300H Simulator"
+       help
+         GDB Simulator Support
+         More Information.
+         arch/h8300/Doc/simulator.txt
+
+config H8S_GENERIC
+       bool "H8S Generic"
+       help
+         H8S CPU Generic Hardware Support
+
+config H8S_EDOSK2674
+       bool "EDOSK-2674"
+       help
+         Renesas EDOSK-2674 Evaluation Board Support
+         More Information.
+         <http://www.azpower.com/H8-uClinux/index.html>
+         <http://www.eu.renesas.com/tools/edk/support/edosk2674.html>
+
+config H8S_SIM
+       bool "H8S Simulator"
+       help
+         GDB Simulator Support
+         More Information.
+         arch/h8300/Doc/simulator.txt
+
+endchoice
+
+if (H8300H_GENERIC || H8S_GENERIC)
+menu "Detail Selection"
+if (H8300H_GENERIC)
+choice
+       prompt "CPU Selection"
+
+config H83002
+       bool "H8/3001,3002,3003"
+
+config H83007
+       bool "H8/3006,3007"
+
+config H83048
+       bool "H8/3044,3045,3046,3047,3048,3052"
+
+config H83068
+       bool "H8/3065,3066,3067,3068,3069"
+endchoice
+endif
+
+if (H8S_GENERIC)
+choice
+       prompt "CPU Selection"
+
+config H8S2678
+       bool "H8S/2670,2673,2674R,2675,2676"
+endchoice
+endif
+
+config CPU_CLOCK
+       int "CPU Clock Frequency (/1KHz)"
+       default "20000"
+       help
+         CPU Clock Frequency divide to 1000
+endmenu
+endif
+
+if (H8300H_GENERIC || H8S_GENERIC || H8300H_SIM || H8S_SIM || H8S_EDOSK2674)
+choice
+       prompt "Kernel executes from"
+       ---help---
+         Choose the memory type that the kernel will be running in.
+
+config RAMKERNEL
+       bool "RAM"
+       help
+         The kernel will be resident in RAM when running.
+
+config ROMKERNEL
+       bool "ROM"
+       help
+         The kernel will be resident in FLASH/ROM when running.
+
+endchoice
+endif
+
+if (H8300H_AKI3068NET)
+config H83068
+       bool
+       default y
+
+config CPU_CLOCK
+       int
+       default "20000"
+
+config RAMKERNEL
+       bool
+       default y
+endif
+
+if (H8300H_H8MAX)
+config H83068
+       bool
+       default y
+
+config CPU_CLOCK
+       int
+       default 25000
+
+config RAMKERNEL
+       bool
+       default y
+endif
+
+if (H8300H_SIM)
+config H83007
+       bool
+       default y
+
+config CPU_CLOCK
+       int
+       default "16000"
+endif
+
+if (H8S_EDOSK2674)
+config H8S2678
+       bool
+       default y
+config CPU_CLOCK
+       int
+       default 33000
+endif
+
+if (H8S_SIM)
+config H8S2678
+       bool
+       default y
+config CPU_CLOCK
+       int
+       default 33000
+endif
+
+config CPU_H8300H
+       bool
+       depends on (H8002 || H83007 || H83048 || H83068)
+       default y
+
+config CPU_H8S
+       bool
+       depends on H8S2678
+       default y
+
+config PREEMPT
+       bool "Preemptible Kernel"
+       default n
+endmenu
diff --git a/arch/h8300/kernel/module.c b/arch/h8300/kernel/module.c
new file mode 100644 (file)
index 0000000..4fd7138
--- /dev/null
@@ -0,0 +1,122 @@
+#include <linux/moduleloader.h>
+#include <linux/elf.h>
+#include <linux/vmalloc.h>
+#include <linux/fs.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+
+#if 0
+#define DEBUGP printk
+#else
+#define DEBUGP(fmt...)
+#endif
+
+void *module_alloc(unsigned long size)
+{
+       if (size == 0)
+               return NULL;
+       return vmalloc(size);
+}
+
+
+/* Free memory returned from module_alloc */
+void module_free(struct module *mod, void *module_region)
+{
+       vfree(module_region);
+       /* FIXME: If module_region == mod->init_region, trim exception
+           table entries. */
+}
+
+/* We don't need anything special. */
+int module_frob_arch_sections(Elf_Ehdr *hdr,
+                             Elf_Shdr *sechdrs,
+                             char *secstrings,
+                             struct module *mod)
+{
+       return 0;
+}
+
+int apply_relocate(Elf32_Shdr *sechdrs,
+                  const char *strtab,
+                  unsigned int symindex,
+                  unsigned int relsec,
+                  struct module *me)
+{
+       printk(KERN_ERR "module %s: RELOCATION unsupported\n",
+              me->name);
+       return -ENOEXEC;
+}
+
+int apply_relocate_add(Elf32_Shdr *sechdrs,
+                      const char *strtab,
+                      unsigned int symindex,
+                      unsigned int relsec,
+                      struct module *me)
+{
+       unsigned int i;
+       Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr;
+
+       DEBUGP("Applying relocate section %u to %u\n", relsec,
+              sechdrs[relsec].sh_info);
+       for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) {
+               /* This is where to make the change */
+               uint32_t *loc = (uint32_t *)(sechdrs[sechdrs[relsec].sh_info].sh_addr
+                                            + rela[i].r_offset);
+               /* This is the symbol it is referring to.  Note that all
+                  undefined symbols have been resolved.  */
+               Elf32_Sym *sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
+                       + ELF32_R_SYM(rela[i].r_info);
+               uint32_t v = sym->st_value + rela[i].r_addend;
+
+               switch (ELF32_R_TYPE(rela[i].r_info)) {
+               case R_H8_DIR24R8:
+                       loc = (uint32_t *)((uint32_t)loc - 1);
+                       *loc = (*loc & 0xff000000) | ((*loc & 0xffffff) + v);
+                       break;
+               case R_H8_DIR24A8:
+                       if (ELF32_R_SYM(rela[i].r_info))
+                               *loc += v;
+                       break;
+               case R_H8_DIR32:
+               case R_H8_DIR32A16:
+                       *loc += v;
+                       break;
+               case R_H8_PCREL16:
+                       v -= (unsigned long)loc + 2;
+                       if ((Elf32_Sword)v > 0x7fff || 
+                           (Elf32_Sword)v < -(Elf32_Sword)0x8000)
+                               goto overflow;
+                       else 
+                               *(unsigned short *)loc = v;
+                       break;
+               case R_H8_PCREL8:
+                       v -= (unsigned long)loc + 1;
+                       if ((Elf32_Sword)v > 0x7f || 
+                           (Elf32_Sword)v < -(Elf32_Sword)0x80)
+                               goto overflow;
+                       else 
+                               *(unsigned char *)loc = v;
+                       break;
+               default:
+                       printk(KERN_ERR "module %s: Unknown relocation: %u\n",
+                              me->name, ELF32_R_TYPE(rela[i].r_info));
+                       return -ENOEXEC;
+               }
+       }
+       return 0;
+ overflow:
+       printk(KERN_ERR "module %s: relocation offset overflow: %08x\n",
+              me->name, rela[i].r_offset);
+       return -ENOEXEC;
+}
+
+int module_finalize(const Elf_Ehdr *hdr,
+                   const Elf_Shdr *sechdrs,
+                   struct module *me)
+{
+       return 0;
+}
+
+void module_arch_cleanup(struct module *mod)
+{
+}
diff --git a/arch/i386/kernel/entry_trampoline.c b/arch/i386/kernel/entry_trampoline.c
new file mode 100644 (file)
index 0000000..4cce52f
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * linux/arch/i386/kernel/entry_trampoline.c
+ *
+ * (C) Copyright 2003 Ingo Molnar
+ *
+ * This file contains the needed support code for 4GB userspace
+ */
+
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/highmem.h>
+#include <asm/desc.h>
+#include <asm/atomic_kmap.h>
+
+extern char __entry_tramp_start, __entry_tramp_end, __start___entry_text;
+
+void __init init_entry_mappings(void)
+{
+#ifdef CONFIG_X86_HIGH_ENTRY
+
+       void *tramp;
+       int p;
+
+       /*
+        * We need a high IDT and GDT for the 4G/4G split:
+        */
+       trap_init_virtual_IDT();
+
+       __set_fixmap(FIX_ENTRY_TRAMPOLINE_0, __pa((unsigned long)&__entry_tramp_start), PAGE_KERNEL);
+       __set_fixmap(FIX_ENTRY_TRAMPOLINE_1, __pa((unsigned long)&__entry_tramp_start) + PAGE_SIZE, PAGE_KERNEL);
+       tramp = (void *)fix_to_virt(FIX_ENTRY_TRAMPOLINE_0);
+
+       printk("mapped 4G/4G trampoline to %p.\n", tramp);
+       BUG_ON((void *)&__start___entry_text != tramp);
+       /*
+        * Virtual kernel stack:
+        */
+       BUG_ON(__kmap_atomic_vaddr(KM_VSTACK_TOP) & (THREAD_SIZE-1));
+       BUG_ON(sizeof(struct desc_struct)*NR_CPUS*GDT_ENTRIES > 2*PAGE_SIZE);
+       BUG_ON((unsigned int)&__entry_tramp_end - (unsigned int)&__entry_tramp_start > 2*PAGE_SIZE);
+
+       /*
+        * set up the initial thread's virtual stack related
+        * fields:
+        */
+       for (p = 0; p < ARRAY_SIZE(current->thread.stack_page); p++)
+               current->thread.stack_page[p] = virt_to_page((char *)current->thread_info + (p*PAGE_SIZE));
+
+       current->thread_info->virtual_stack = (void *)__kmap_atomic_vaddr(KM_VSTACK_TOP);
+
+       for (p = 0; p < ARRAY_SIZE(current->thread.stack_page); p++) {
+               __kunmap_atomic_type(KM_VSTACK_TOP-p);
+               __kmap_atomic(current->thread.stack_page[p], KM_VSTACK_TOP-p);
+       }
+#endif
+       current->thread_info->real_stack = (void *)current->thread_info;
+       current->thread_info->user_pgd = NULL;
+       current->thread.esp0 = (unsigned long)current->thread_info->real_stack + THREAD_SIZE;
+}
+
+
+
+void __init entry_trampoline_setup(void)
+{
+       /*
+        * old IRQ entries set up by the boot code will still hang
+        * around - they are a sign of hw trouble anyway, now they'll
+        * produce a double fault message.
+        */
+       trap_init_virtual_GDT();
+}
diff --git a/arch/i386/mach-es7000/es7000plat.c b/arch/i386/mach-es7000/es7000plat.c
new file mode 100644 (file)
index 0000000..70db264
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * Written by: Garry Forsgren, Unisys Corporation
+ *             Natalie Protasevich, Unisys Corporation
+ * This file contains the code to configure and interface
+ * with Unisys ES7000 series hardware system manager.
+ *
+ * Copyright (c) 2003 Unisys 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 would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Unisys Corporation, Township Line & Union Meeting
+ * Roads-A, Unisys Way, Blue Bell, Pennsylvania, 19424, or:
+ *
+ * http://www.unisys.com
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/smp.h>
+#include <linux/string.h>
+#include <linux/spinlock.h>
+#include <linux/errno.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/acpi.h>
+#include <asm/io.h>
+#include <asm/nmi.h>
+#include <asm/smp.h>
+#include <asm/apicdef.h>
+#include "es7000.h"
+
+/*
+ * ES7000 Globals
+ */
+
+volatile unsigned long *psai = NULL;
+struct mip_reg         *mip_reg;
+struct mip_reg         *host_reg;
+int                    mip_port;
+unsigned long          mip_addr, host_addr;
+extern int (*platform_rename_gsi)();
+
+static int __init
+es7000_rename_gsi(int ioapic, int gsi)
+{
+       if (ioapic)
+               return gsi;
+       else {
+               if (gsi == 0)
+                       return 13;
+               if (gsi == 1)
+                       return 16;
+               if (gsi == 4)
+                       return 17;
+               if (gsi == 6)
+                       return 18;
+               if (gsi == 7)
+                       return 19;
+               if (gsi == 8)
+                       return 20;
+               return gsi;
+        }
+}
+
+/*
+ * Parse the OEM Table
+ */
+
+int __init
+parse_unisys_oem (char *oemptr, int oem_entries)
+{
+       int                     i;
+       int                     success = 0;
+       unsigned char           type, size;
+       unsigned long           val;
+       char                    *tp = NULL;
+       struct psai             *psaip = NULL;
+       struct mip_reg_info     *mi;
+       struct mip_reg          *host, *mip;
+
+       tp = oemptr;
+
+       tp += 8;
+
+       for (i=0; i <= oem_entries; i++) {
+               type = *tp++;
+               size = *tp++;
+               tp -= 2;
+               switch (type) {
+               case MIP_REG:
+                       mi = (struct mip_reg_info *)tp;
+                       val = MIP_RD_LO(mi->host_reg);
+                       host_addr = val;
+                       host = (struct mip_reg *)val;
+                       host_reg = __va(host);
+                       val = MIP_RD_LO(mi->mip_reg);
+                       mip_port = MIP_PORT(mi->mip_info);
+                       mip_addr = val;
+                       mip = (struct mip_reg *)val;
+                       mip_reg = __va(mip);
+                       Dprintk("es7000_mipcfg: host_reg = 0x%lx \n",
+                               (unsigned long)host_reg);
+                       Dprintk("es7000_mipcfg: mip_reg = 0x%lx \n",
+                               (unsigned long)mip_reg);
+                       success++;
+                       break;
+               case MIP_PSAI_REG:
+                       psaip = (struct psai *)tp;
+                       if (tp != NULL) {
+                               if (psaip->addr)
+                                       psai = __va(psaip->addr);
+                               else
+                                       psai = NULL;
+                               success++;
+                       }
+                       break;
+               default:
+                       break;
+               }
+               if (i == 6) break;
+               tp += size;
+       }
+
+       if (success < 2) {
+               printk("\nNo ES7000 found.\n");
+               es7000_plat = 0;
+       } else {
+               printk("\nEnabling ES7000 specific features...\n");
+               es7000_plat = 1;
+               platform_rename_gsi = es7000_rename_gsi;
+       }
+       return es7000_plat;
+}
+
+int __init
+find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length)
+{
+       struct acpi_table_rsdp          *rsdp = NULL;
+       unsigned long                   rsdp_phys = 0;
+       struct acpi_table_header        *header = NULL;
+       int                             i;
+       struct acpi_table_sdt           sdt;
+
+       rsdp_phys = acpi_find_rsdp();
+       rsdp = __va(rsdp_phys);
+       if (rsdp->rsdt_address) {
+               struct acpi_table_rsdt  *mapped_rsdt = NULL;
+               sdt.pa = rsdp->rsdt_address;
+
+               header = (struct acpi_table_header *)
+                       __acpi_map_table(sdt.pa, sizeof(struct acpi_table_header));
+               if (!header)
+                       return -ENODEV;
+
+               sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 3;
+               mapped_rsdt = (struct acpi_table_rsdt *)
+                       __acpi_map_table(sdt.pa, header->length);
+               if (!mapped_rsdt)
+                       return -ENODEV;
+
+               header = &mapped_rsdt->header;
+
+               for (i = 0; i < sdt.count; i++)
+                       sdt.entry[i].pa = (unsigned long) mapped_rsdt->entry[i];
+       };
+       for (i = 0; i < sdt.count; i++) {
+
+               header = (struct acpi_table_header *)
+                       __acpi_map_table(sdt.entry[i].pa,
+                               sizeof(struct acpi_table_header));
+               if (!header)
+                       continue;
+               if (!strncmp((char *) &header->signature, "OEM1", 4)) {
+                       if (!strncmp((char *) &header->oem_id, "UNISYS", 6)) {
+                               void *addr;
+                               struct oem_table *t;
+                               acpi_table_print(header, sdt.entry[i].pa);
+                               t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length);
+                               addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize);
+                               *length = header->length;
+                               *oem_addr = (unsigned long) addr;
+                               return 0;
+                       }
+               }
+       }
+       printk("ES7000: did not find Unisys ACPI OEM table!\n");
+       return -1;
+}
+
+static void
+es7000_spin(int n)
+{
+       int i = 0;
+
+       while (i++ < n)
+               rep_nop();
+}
+
+static int __init
+es7000_mip_write(struct mip_reg *mip_reg)
+{
+       int                     status = 0;
+       int                     spin;
+
+       spin = MIP_SPIN;
+       while (((unsigned long long)host_reg->off_38 &
+               (unsigned long long)MIP_VALID) != 0) {
+                       if (--spin <= 0) {
+                               printk("es7000_mip_write: Timeout waiting for Host Valid Flag");
+                               return -1;
+                       }
+               es7000_spin(MIP_SPIN);
+       }
+
+       memcpy(host_reg, mip_reg, sizeof(struct mip_reg));
+       outb(1, mip_port);
+
+       spin = MIP_SPIN;
+
+       while (((unsigned long long)mip_reg->off_38 &
+               (unsigned long long)MIP_VALID) == 0) {
+               if (--spin <= 0) {
+                       printk("es7000_mip_write: Timeout waiting for MIP Valid Flag");
+                       return -1;
+               }
+               es7000_spin(MIP_SPIN);
+       }
+
+       status = ((unsigned long long)mip_reg->off_0 &
+               (unsigned long long)0xffff0000000000) >> 48;
+       mip_reg->off_38 = ((unsigned long long)mip_reg->off_38 &
+               (unsigned long long)~MIP_VALID);
+       return status;
+}
+
+int
+es7000_start_cpu(int cpu, unsigned long eip)
+{
+       unsigned long vect = 0, psaival = 0;
+
+       if (psai == NULL)
+               return -1;
+
+       vect = ((unsigned long)__pa(eip)/0x1000) << 16;
+       psaival = (0x1000000 | vect | cpu);
+
+       while (*psai & 0x1000000)
+                ;
+
+       *psai = psaival;
+
+       return 0;
+
+}
+
+int
+es7000_stop_cpu(int cpu)
+{
+       int startup;
+
+       if (psai == NULL)
+               return -1;
+
+       startup= (0x1000000 | cpu);
+
+       while ((*psai & 0xff00ffff) != startup)
+               ;
+
+       startup = (*psai & 0xff0000) >> 16;
+       *psai &= 0xffffff;
+
+       return 0;
+
+}
+
+void __init
+es7000_sw_apic()
+{
+       if (es7000_plat) {
+               int mip_status;
+               struct mip_reg es7000_mip_reg;
+
+               printk("ES7000: Enabling APIC mode.\n");
+               memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
+               es7000_mip_reg.off_0 = MIP_SW_APIC;
+               es7000_mip_reg.off_38 = (MIP_VALID);
+               while ((mip_status = es7000_mip_write(&es7000_mip_reg)) != 0)
+                       printk("es7000_sw_apic: command failed, status = %x\n",
+                               mip_status);
+               return;
+       }
+}
diff --git a/arch/ia64/scripts/check-serialize.S b/arch/ia64/scripts/check-serialize.S
new file mode 100644 (file)
index 0000000..0400c10
--- /dev/null
@@ -0,0 +1,2 @@
+       .serialize.data
+       .serialize.instruction
diff --git a/arch/ppc/configs/bubinga_defconfig b/arch/ppc/configs/bubinga_defconfig
new file mode 100644 (file)
index 0000000..ea60105
--- /dev/null
@@ -0,0 +1,593 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MMU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+# CONFIG_STANDALONE is not set
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+# CONFIG_KALLSYMS is not set
+CONFIG_FUTEX=y
+# CONFIG_EPOLL is not set
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
+# Processor
+#
+# CONFIG_6xx is not set
+CONFIG_40x=y
+# CONFIG_44x is not set
+# CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
+# CONFIG_8xx is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_4xx=y
+
+#
+# IBM 4xx options
+#
+# CONFIG_ASH is not set
+CONFIG_BUBINGA=y
+# CONFIG_CPCI405 is not set
+# CONFIG_EP405 is not set
+# CONFIG_OAK is not set
+# CONFIG_REDWOOD_5 is not set
+# CONFIG_REDWOOD_6 is not set
+# CONFIG_SYCAMORE is not set
+# CONFIG_WALNUT is not set
+CONFIG_IBM405_ERR77=y
+CONFIG_IBM405_ERR51=y
+CONFIG_IBM_OCP=y
+CONFIG_BIOS_FIXUP=y
+CONFIG_405EP=y
+CONFIG_IBM_OPENBIOS=y
+# CONFIG_PM is not set
+CONFIG_UART0_TTYS0=y
+# CONFIG_UART0_TTYS1 is not set
+CONFIG_NOT_COHERENT_CACHE=y
+
+#
+# Platform options
+#
+# CONFIG_PC_KEYBOARD is not set
+# CONFIG_SMP is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_HIGHMEM is not set
+CONFIG_KERNEL_ELF=y
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_CMDLINE_BOOL is not set
+
+#
+# Bus options
+#
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_LEGACY_PROC=y
+# CONFIG_PCI_NAMES is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00400000
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+
+#
+# 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_DEV_FD 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_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_LBD is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_SCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_PACKET is not set
+# CONFIG_NETLINK_DEV is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# 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
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_IPV6 is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NETFILTER is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q 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_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_OAKNET is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM 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 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_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
+CONFIG_IBM_EMAC=y
+# CONFIG_IBM_EMAC_ERRMSG is not set
+CONFIG_IBM_EMAC_RXB=64
+CONFIG_IBM_EMAC_TXB=8
+CONFIG_IBM_EMAC_FGAP=8
+CONFIG_IBM_EMAC_SKBRES=0
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BT 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 is not set
+# 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 I/O drivers
+#
+# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC 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_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC 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_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C 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_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_FAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# 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 is not set
+# 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 is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+# CONFIG_EXPORTFS is not set
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+# CONFIG_AFS_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 is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_NEC98_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 is not set
+
+#
+# IBM 40x options
+#
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+
+#
+# Kernel hacking
+#
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_SERIAL_TEXT_DEBUG is not set
+CONFIG_PPC_OCP=y
+
+#
+# Security options
+#
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/syslib/ibm_ocp.c b/arch/ppc/syslib/ibm_ocp.c
new file mode 100644 (file)
index 0000000..3f6e55c
--- /dev/null
@@ -0,0 +1,9 @@
+#include <linux/module.h>
+#include <asm/ocp.h>
+
+struct ocp_sys_info_data ocp_sys_info = {
+       .opb_bus_freq   =       50000000,       /* OPB Bus Frequency (Hz) */
+       .ebc_bus_freq   =       33333333,       /* EBC Bus Frequency (Hz) */
+};
+
+EXPORT_SYMBOL(ocp_sys_info);
diff --git a/arch/x86_64/kernel/Makefile-HEAD b/arch/x86_64/kernel/Makefile-HEAD
new file mode 100644 (file)
index 0000000..dc6f269
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Makefile for the linux kernel.
+#
+
+extra-y        := head.o head64.o init_task.o vmlinux.lds.s
+EXTRA_AFLAGS   := -traditional
+obj-y  := process.o semaphore.o signal.o entry.o traps.o irq.o \
+               ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
+               x8664_ksyms.o i387.o syscall.o vsyscall.o \
+               setup64.o bootflag.o e820.o reboot.o warmreboot.o
+obj-y += mce.o
+
+obj-$(CONFIG_MTRR)             += ../../i386/kernel/cpu/mtrr/
+obj-$(CONFIG_ACPI_BOOT)                += acpi/
+obj-$(CONFIG_X86_MSR)          += msr.o
+obj-$(CONFIG_MICROCODE)                += microcode.o
+obj-$(CONFIG_X86_CPUID)                += cpuid.o
+obj-$(CONFIG_SMP)              += smp.o smpboot.o trampoline.o
+obj-$(CONFIG_X86_LOCAL_APIC)   += apic.o  nmi.o
+obj-$(CONFIG_X86_IO_APIC)      += io_apic.o mpparse.o
+obj-$(CONFIG_PM)               += suspend.o
+obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend_asm.o
+obj-$(CONFIG_CPU_FREQ)         += cpufreq/
+obj-$(CONFIG_EARLY_PRINTK)     += early_printk.o
+obj-$(CONFIG_GART_IOMMU)       += pci-gart.o aperture.o
+obj-$(CONFIG_DUMMY_IOMMU)      += pci-nommu.o pci-dma.o
+obj-$(CONFIG_SWIOTLB)          += swiotlb.o
+obj-$(CONFIG_SCHED_SMT)                += domain.o
+
+obj-$(CONFIG_MODULES)          += module.o
+
+obj-y                          += topology.o
+
+bootflag-y                     += ../../i386/kernel/bootflag.o
+cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../i386/kernel/cpuid.o
+topology-y                     += ../../i386/mach-default/topology.o
+swiotlb-$(CONFIG_SWIOTLB)      += ../../ia64/lib/swiotlb.o
+microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../i386/kernel/microcode.o
diff --git a/configs/kernel-2.6.6-i586-smp.config b/configs/kernel-2.6.6-i586-smp.config
new file mode 100644 (file)
index 0000000..2ac8f42
--- /dev/null
@@ -0,0 +1,2345 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_X86=y
+CONFIG_MMU=y
+CONFIG_UID16=y
+CONFIG_GENERIC_ISA_DMA=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_HOTPLUG=y
+# CONFIG_IKCONFIG is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+
+#
+# Processor type and features
+#
+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_M386 is not set
+# CONFIG_M486 is not set
+CONFIG_M586=y
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 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_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP2 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_XADD=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_X86_PPRO_FENCE=y
+CONFIG_X86_F00F_BUG=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_POPAD_OK=y
+CONFIG_X86_ALIGNMENT_16=y
+CONFIG_X86_INTEL_USERCOPY=y
+# CONFIG_X86_4G is not set
+# CONFIG_X86_SWITCH_PAGETABLES is not set
+# CONFIG_X86_4G_VM_LAYOUT is not set
+# CONFIG_X86_UACCESS_INDIRECT is not set
+# CONFIG_X86_HIGH_ENTRY is not set
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=8
+CONFIG_SCHED_SMT=y
+# CONFIG_PREEMPT is not set
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_X86_IO_APIC=y
+CONFIG_X86_MCE=y
+# CONFIG_X86_MCE_NONFATAL is not set
+CONFIG_X86_MCE_P4THERMAL=y
+CONFIG_TOSHIBA=m
+CONFIG_I8K=m
+# CONFIG_MICROCODE is not set
+CONFIG_X86_MSR=m
+CONFIG_X86_CPUID=m
+
+#
+# Firmware Drivers
+#
+CONFIG_EDD=m
+# CONFIG_NOHIGHMEM is not set
+CONFIG_HIGHMEM4G=y
+# CONFIG_HIGHMEM64G is not set
+CONFIG_HIGHMEM=y
+CONFIG_HIGHPTE=y
+# CONFIG_MATH_EMULATION is not set
+CONFIG_MTRR=y
+# CONFIG_EFI is not set
+# CONFIG_IRQBALANCE is not set
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_REGPARM=y
+
+#
+# Power management options (ACPI, APM)
+#
+CONFIG_PM=y
+# CONFIG_SOFTWARE_SUSPEND is not set
+# CONFIG_PM_DISK is not set
+
+#
+# ACPI (Advanced Configuration and Power Interface) Support
+#
+CONFIG_ACPI=y
+CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_SLEEP_PROC_FS=y
+CONFIG_ACPI_AC=m
+CONFIG_ACPI_BATTERY=m
+CONFIG_ACPI_BUTTON=m
+CONFIG_ACPI_FAN=y
+CONFIG_ACPI_PROCESSOR=y
+CONFIG_ACPI_THERMAL=y
+CONFIG_ACPI_ASUS=m
+CONFIG_ACPI_TOSHIBA=m
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_BUS=y
+CONFIG_ACPI_EC=y
+CONFIG_ACPI_POWER=y
+CONFIG_ACPI_PCI=y
+CONFIG_ACPI_SYSTEM=y
+CONFIG_X86_PM_TIMER=y
+
+#
+# APM (Advanced Power Management) BIOS Support
+#
+CONFIG_APM=y
+# CONFIG_APM_IGNORE_USER_SUSPEND is not set
+# CONFIG_APM_DO_ENABLE is not set
+CONFIG_APM_CPU_IDLE=y
+# CONFIG_APM_DISPLAY_BLANK is not set
+CONFIG_APM_RTC_IS_GMT=y
+# CONFIG_APM_ALLOW_INTS is not set
+# CONFIG_APM_REAL_MODE_POWER_OFF is not set
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_PROC_INTF is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_24_API is not set
+CONFIG_CPU_FREQ_TABLE=y
+
+#
+# CPUFreq processor drivers
+#
+CONFIG_X86_ACPI_CPUFREQ=m
+# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
+CONFIG_X86_POWERNOW_K6=m
+CONFIG_X86_POWERNOW_K7=y
+CONFIG_X86_POWERNOW_K8=m
+# CONFIG_X86_GX_SUSPMOD is not set
+CONFIG_X86_SPEEDSTEP_CENTRINO=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y
+CONFIG_X86_SPEEDSTEP_ICH=y
+CONFIG_X86_SPEEDSTEP_SMI=m
+CONFIG_X86_P4_CLOCKMOD=m
+CONFIG_X86_SPEEDSTEP_LIB=y
+# CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set
+CONFIG_X86_LONGRUN=y
+# CONFIG_X86_LONGHAUL is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+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_PCI_USE_VECTOR=y
+CONFIG_PCI_LEGACY_PROC=y
+# CONFIG_PCI_NAMES is not set
+CONFIG_ISA=y
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_YENTA=m
+CONFIG_CARDBUS=y
+CONFIG_I82092=m
+CONFIG_I82365=m
+CONFIG_TCIC=m
+CONFIG_PCMCIA_PROBE=y
+
+#
+# PCI Hotplug Support
+#
+CONFIG_HOTPLUG_PCI=y
+# CONFIG_HOTPLUG_PCI_FAKE is not set
+CONFIG_HOTPLUG_PCI_COMPAQ=m
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+CONFIG_HOTPLUG_PCI_IBM=m
+# CONFIG_HOTPLUG_PCI_ACPI is not set
+# CONFIG_HOTPLUG_PCI_CPCI is not set
+CONFIG_HOTPLUG_PCI_PCIE=m
+CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE=y
+CONFIG_HOTPLUG_PCI_SHPC=m
+CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE=y
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=m
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=m
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_CMDLINE_PARTS=m
+
+#
+# User Modules And Translation Layers
+#
+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
+
+#
+# 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_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_PNC2000 is not set
+CONFIG_MTD_SC520CDP=m
+CONFIG_MTD_NETSC520=m
+CONFIG_MTD_SBC_GXX=m
+CONFIG_MTD_ELAN_104NC=m
+CONFIG_MTD_SCx200_DOCFLASH=m
+CONFIG_MTD_AMD76XROM=m
+CONFIG_MTD_ICH2ROM=m
+CONFIG_MTD_SCB2_FLASH=m
+# CONFIG_MTD_NETtel is not set
+# CONFIG_MTD_DILNETPC is not set
+CONFIG_MTD_L440GX=m
+CONFIG_MTD_PCI=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_SLRAM is not set
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+# CONFIG_MTD_BLKMTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_DOC2000=m
+# CONFIG_MTD_DOC2001 is not set
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=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_IDS=m
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_PC_CML1=m
+CONFIG_PARPORT_SERIAL=m
+# CONFIG_PARPORT_PC_FIFO is not set
+# CONFIG_PARPORT_PC_SUPERIO is not set
+CONFIG_PARPORT_PC_PCMCIA=m
+# CONFIG_PARPORT_OTHER is not set
+CONFIG_PARPORT_1284=y
+
+#
+# Plug and Play support
+#
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_ISAPNP=y
+# CONFIG_PNPBIOS is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+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_CARMEL=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
+
+#
+# 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_HD_IDE is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+# CONFIG_IDEDISK_STROKE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=y
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_CMD640 is not set
+CONFIG_BLK_DEV_IDEPNP=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_RZ1000=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_ADMA=y
+CONFIG_BLK_DEV_AEC62XX=y
+CONFIG_BLK_DEV_ALI15X3=y
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=y
+CONFIG_BLK_DEV_ATIIXP=y
+CONFIG_BLK_DEV_CMD64X=y
+CONFIG_BLK_DEV_TRIFLEX=y
+CONFIG_BLK_DEV_CY82C693=y
+CONFIG_BLK_DEV_CS5520=y
+CONFIG_BLK_DEV_CS5530=y
+CONFIG_BLK_DEV_HPT34X=y
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# 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_PDC202XX_FORCE=y
+CONFIG_BLK_DEV_SVWKS=y
+CONFIG_BLK_DEV_SIIMAGE=y
+CONFIG_BLK_DEV_SIS5513=y
+CONFIG_BLK_DEV_SLC90E66=y
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+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
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+
+#
+# SCSI low-level drivers
+#
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+# CONFIG_SCSI_7000FASST is not set
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AHA152X=m
+CONFIG_SCSI_AHA1542=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=4
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
+# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
+CONFIG_AIC7XXX_DEBUG_MASK=0
+# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=4
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
+# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
+# CONFIG_AIC79XX_DEBUG_ENABLE is not set
+CONFIG_AIC79XX_DEBUG_MASK=0
+# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
+# CONFIG_SCSI_DPT_I2O is not set
+CONFIG_SCSI_ADVANSYS=m
+CONFIG_SCSI_IN2000=m
+CONFIG_SCSI_MEGARAID=m
+CONFIG_SCSI_SATA=y
+CONFIG_SCSI_SATA_SVW=m
+CONFIG_SCSI_ATA_PIIX=m
+CONFIG_SCSI_SATA_PROMISE=m
+CONFIG_SCSI_SATA_SX4=m
+CONFIG_SCSI_SATA_SIL=m
+CONFIG_SCSI_SATA_SIS=m
+CONFIG_SCSI_SATA_VIA=m
+CONFIG_SCSI_SATA_VITESSE=m
+CONFIG_SCSI_BUSLOGIC=m
+# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+CONFIG_SCSI_IPS=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_NCR53C406A 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_SYM53C8XX_IOMAPPED 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=m
+CONFIG_SCSI_QLOGIC_ISP=m
+# CONFIG_SCSI_QLOGIC_FC is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA2XXX=m
+CONFIG_SCSI_QLA21XX=m
+CONFIG_SCSI_QLA22XX=m
+CONFIG_SCSI_QLA2300=m
+CONFIG_SCSI_QLA2322=m
+CONFIG_SCSI_QLA6312=m
+CONFIG_SCSI_QLA6322=m
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC395x is not set
+CONFIG_SCSI_DC390T=m
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_ULTRASTOR is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+CONFIG_PCMCIA_AHA152X=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_NINJA_SCSI=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=m
+CONFIG_FUSION_MAX_SGE=40
+# CONFIG_FUSION_ISENSE is not set
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LAN=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_IEEE1394=m
+
+#
+# Subsystem Options
+#
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+CONFIG_IEEE1394_OUI_DB=y
+# CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set
+
+#
+# Device Drivers
+#
+# CONFIG_IEEE1394_PCILYNX is not set
+CONFIG_IEEE1394_OHCI1394=m
+
+#
+# Protocol Drivers
+#
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
+# CONFIG_IEEE1394_ETH1394 is not set
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+CONFIG_IEEE1394_CMP=m
+CONFIG_IEEE1394_AMDTP=m
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_NETLINK_DEV=y
+CONFIG_UNIX=y
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_FWMARK=y
+CONFIG_IP_ROUTE_NAT=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_TOS=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
+
+#
+# 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_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_LIMIT=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MAC=m
+CONFIG_IP_NF_MATCH_PKTTYPE=m
+CONFIG_IP_NF_MATCH_MARK=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_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_TCPMSS=m
+CONFIG_IP_NF_MATCH_HELPER=m
+CONFIG_IP_NF_MATCH_STATE=m
+CONFIG_IP_NF_MATCH_CONNTRACK=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_PHYSDEV=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_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_IP_NF_NAT_LOCAL=y
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
+CONFIG_IP_NF_NAT_FTP=m
+CONFIG_IP_NF_NAT_TFTP=m
+CONFIG_IP_NF_NAT_AMANDA=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_MARK=m
+CONFIG_IP_NF_TARGET_CLASSIFY=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
+
+#
+# IPv6: Netfilter Configuration
+#
+# CONFIG_IP6_NF_QUEUE is not set
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_LIMIT=m
+CONFIG_IP6_NF_MATCH_MAC=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_MARK=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_LENGTH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_MARK=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_XFRM=y
+CONFIG_XFRM_USER=y
+
+#
+# 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
+# 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=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=y
+CONFIG_LTPC=m
+CONFIG_COPS=m
+CONFIG_COPS_DAYNA=y
+CONFIG_COPS_TANGENT=y
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+CONFIG_NET_DIVERT=y
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=m
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_CSZ=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_DELAY=m
+CONFIG_NET_SCH_INGRESS=m
+CONFIG_NET_QOS=y
+CONFIG_NET_ESTIMATOR=y
+CONFIG_NET_CLS=y
+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_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_POLICE=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_RX is not set
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+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 is not set
+
+#
+# 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_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
+#
+
+#
+# Old Serial dongle support
+#
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_NSC_FIR=m
+# CONFIG_WINBOND_FIR is not set
+# 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=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
+
+#
+# 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_HCIUART_BCSP_TXCRC=y
+CONFIG_BT_HCIBCM203X=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_TUX=m
+
+#
+# TUX options
+#
+CONFIG_TUX_EXTCGI=y
+# CONFIG_TUX_EXTENDED_LOG is not set
+# CONFIG_TUX_DEBUG is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_ETHERTAP=m
+CONFIG_NET_SB1000=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=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 is not set
+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
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+CONFIG_TULIP_MMIO=y
+# CONFIG_TULIP_NAPI is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+# CONFIG_AT1700 is not set
+CONFIG_DEPCA=m
+CONFIG_HP100=m
+# CONFIG_NET_ISA is not set
+CONFIG_NE2000=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+CONFIG_AC3200=m
+CONFIG_APRICOT=m
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_CS89x0=m
+CONFIG_DGRS=m
+CONFIG_EEPRO100=m
+# CONFIG_EEPRO100_PIO is not set
+CONFIG_E100=m
+CONFIG_E100_NAPI=y
+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_TLAN=m
+CONFIG_VIA_RHINE=m
+CONFIG_VIA_RHINE_MMIO=y
+CONFIG_NET_POCKET=y
+CONFIG_ATP=m
+CONFIG_DE600=m
+CONFIG_DE620=m
+
+#
+# Gigabit Ethernet (1000/10000 Mbit)
+#
+CONFIG_NET_GIGE=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000_NAPI=y
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_SK98LIN=m
+CONFIG_TIGON3=m
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_ARLAN is not set
+CONFIG_WAVELAN=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+# CONFIG_PCMCIA_RAYCS is not set
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_AIRO=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+CONFIG_PRISM54=m
+CONFIG_NET_WIRELESS=y
+
+#
+# PCMCIA network device support
+#
+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
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_FDDI=y
+# CONFIG_DEFXX is not set
+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 is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+CONFIG_NET_FC=y
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+
+#
+# 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 is not set
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+
+#
+# ISDN feature submodules
+#
+
+#
+# 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=y
+CONFIG_HISAX_NO_LLC=y
+CONFIG_HISAX_NO_KEYPAD=y
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+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
+
+#
+# HiSax PCMCIA card service modules
+#
+CONFIG_HISAX_SEDLBAUER_CS=m
+CONFIG_HISAX_ELSA_CS=m
+CONFIG_HISAX_AVM_A1_CS=m
+CONFIG_HISAX_TELES_CS=m
+
+#
+# HiSax sub driver modules
+#
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+
+#
+# Active cards
+#
+CONFIG_ISDN_DRV_ICN=m
+CONFIG_ISDN_DRV_PCBIT=m
+CONFIG_ISDN_DRV_SC=m
+CONFIG_ISDN_DRV_ACT2000=m
+CONFIG_ISDN_DRV_TPAM=m
+
+#
+# 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
+
+#
+# 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=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input I/O drivers
+#
+CONFIG_GAMEPORT=m
+CONFIG_SOUND_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_VORTEX=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_GAMEPORT_CS461x=m
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 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=y
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_INPORT=m
+CONFIG_MOUSE_ATIXL=y
+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_TWIDDLER=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+# CONFIG_INPUT_JOYDUMP is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_UINPUT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_ROCKETPORT=m
+# CONFIG_CYCLADES is not set
+CONFIG_SYNCLINK=m
+CONFIG_SYNCLINKMP=m
+CONFIG_N_HDLC=m
+CONFIG_STALDRV=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+# CONFIG_SERIAL_8250_ACPI is not set
+CONFIG_SERIAL_8250_NR_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=y
+CONFIG_SERIAL_8250_MULTIPORT=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_CRASH=m
+CONFIG_PRINTER=m
+CONFIG_LP_CONSOLE=y
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+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_I8XX_TCO=m
+CONFIG_SC1200_WDT=m
+# CONFIG_SCx200_WDT is not set
+# CONFIG_60XX_WDT is not set
+CONFIG_CPU5_WDT=m
+CONFIG_W83627HF_WDT=m
+CONFIG_W83877F_WDT=m
+CONFIG_MACHZ_WDT=m
+
+#
+# ISA-based Watchdog Cards
+#
+CONFIG_PCWATCHDOG=m
+# CONFIG_MIXCOMWD is not set
+CONFIG_WDT=m
+# CONFIG_WDT_501 is not set
+
+#
+# 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_NVRAM=m
+CONFIG_RTC=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+# CONFIG_APPLICOM is not set
+CONFIG_SONYPI=m
+
+#
+# Ftape, the floppy tape device driver
+#
+CONFIG_AGP=y
+CONFIG_AGP_ALI=y
+CONFIG_AGP_ATI=y
+CONFIG_AGP_AMD=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+CONFIG_AGP_INTEL_MCH=y
+CONFIG_AGP_NVIDIA=y
+CONFIG_AGP_SIS=y
+CONFIG_AGP_SWORKS=y
+CONFIG_AGP_VIA=y
+CONFIG_AGP_EFFICEON=y
+CONFIG_DRM=y
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_GAMMA=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_I810=m
+CONFIG_DRM_I830=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+
+#
+# PCMCIA character devices
+#
+CONFIG_SYNCLINK_CS=m
+CONFIG_MWAVE=m
+# CONFIG_RAW_DRIVER is not set
+CONFIG_HANGCHECK_TIMER=m
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_ISA=m
+CONFIG_I2C_NFORCE2=m
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+# CONFIG_SCx200_ACB is not set
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+
+#
+# Hardware Sensors Chip support
+#
+CONFIG_I2C_SENSOR=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+
+#
+# Other I2C Chip support
+#
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_RTC8564=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
+
+#
+# Misc devices
+#
+CONFIG_IBM_ASM=m
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+CONFIG_VIDEO_BT848=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_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_MEYE=m
+CONFIG_VIDEO_SAA7134=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+
+#
+# Radio Adapters
+#
+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
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_VIDEOBUF=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+# 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_VGA16=m
+CONFIG_FB_VESA=y
+CONFIG_VIDEO_SELECT=y
+CONFIG_FB_HGA=m
+CONFIG_FB_HGA_ACCEL=y
+CONFIG_FB_RIVA=m
+CONFIG_FB_I810=m
+CONFIG_FB_I810_GTF=y
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G450=y
+CONFIG_FB_MATROX_G100=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+# CONFIG_FB_RADEON_OLD 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=y
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_XL_INIT is not set
+# CONFIG_FB_SIS is not set
+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_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_MDA_CONSOLE=m
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# 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=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=y
+CONFIG_SND_RTCTIMER=m
+# 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_OPL4_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+# CONFIG_SND_SERIAL_U16550 is not set
+CONFIG_SND_MPU401=m
+
+#
+# ISA devices
+#
+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_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 is not set
+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
+
+#
+# PCI devices
+#
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=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=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_VX222=m
+
+#
+# ALSA USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# PCMCIA devices
+#
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_VXP440 is not set
+CONFIG_SND_PDAUDIOCF=m
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS 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_OHCI_HCD=m
+CONFIG_USB_UHCI_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_AUDIO=m
+
+#
+# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+#
+CONFIG_USB_MIDI=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_HP8200e=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+CONFIG_HID_FF=y
+CONFIG_HID_PID=y
+CONFIG_LOGITECH_FF=y
+CONFIG_THRUSTMASTER_FF=y
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_AIPTEK=m
+CONFIG_USB_WACOM=m
+CONFIG_USB_KBTAB=m
+CONFIG_USB_POWERMATE=m
+CONFIG_USB_MTOUCH=m
+CONFIG_USB_EGALAX=m
+CONFIG_USB_XPAD=m
+CONFIG_USB_ATI_REMOTE=m
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_HPUSBSCSI=m
+
+#
+# USB Multimedia devices
+#
+CONFIG_USB_DABUSB=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_STV680=m
+CONFIG_USB_W9968CF=m
+
+#
+# USB Network adaptors
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+
+#
+# USB Host-to-Host Cables
+#
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_GENESYS=y
+CONFIG_USB_NET1080=y
+CONFIG_USB_PL2301=y
+
+#
+# Intelligent USB Devices/Gadgets
+#
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZAURUS=y
+CONFIG_USB_CDCETHER=y
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_AX8817X=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_SAFE_PADDED=y
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EZUSB=y
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+# CONFIG_USB_EMI26 is not set
+CONFIG_USB_TIGL=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+# CONFIG_USB_CYTHERM is not set
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_TEST=m
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET 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_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+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_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_RT is not set
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_QUOTA=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_ZISOFS_FS=y
+CONFIG_UDF_FS=m
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+CONFIG_DEVPTS_FS_XATTR=y
+CONFIG_DEVPTS_FS_SECURITY=y
+CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS 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_JFFS_FS is not set
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_NAND=y
+CONFIG_CRAMFS=m
+CONFIG_VXFS_FS=m
+# CONFIG_HPFS_FS is not set
+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
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS 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 is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+CONFIG_OSF_PARTITION=y
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+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 is not set
+# CONFIG_NEC98_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+CONFIG_SUN_PARTITION=y
+CONFIG_EFI_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+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_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_DEBUG_KERNEL=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_FRAME_POINTER is not set
+CONFIG_X86_FIND_SMP_CONFIG=y
+CONFIG_X86_MPPARSE=y
+
+#
+# Security options
+#
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+# CONFIG_SECURITY_SELINUX_MLS 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_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_ARC4=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_X86_SMP=y
+CONFIG_X86_HT=y
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_X86_TRAMPOLINE=y
+CONFIG_X86_STD_RESOURCES=y
+CONFIG_PC=y
diff --git a/configs/kernel-2.6.6-i586.config b/configs/kernel-2.6.6-i586.config
new file mode 100644 (file)
index 0000000..acf01ad
--- /dev/null
@@ -0,0 +1,2362 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_X86=y
+CONFIG_MMU=y
+CONFIG_UID16=y
+CONFIG_GENERIC_ISA_DMA=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_HOTPLUG=y
+# CONFIG_IKCONFIG is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
+# Processor type and features
+#
+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_M386 is not set
+# CONFIG_M486 is not set
+CONFIG_M586=y
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 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_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP2 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_XADD=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_X86_PPRO_FENCE=y
+CONFIG_X86_F00F_BUG=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_POPAD_OK=y
+CONFIG_X86_ALIGNMENT_16=y
+CONFIG_X86_INTEL_USERCOPY=y
+# CONFIG_X86_4G is not set
+# CONFIG_X86_SWITCH_PAGETABLES is not set
+# CONFIG_X86_4G_VM_LAYOUT is not set
+# CONFIG_X86_UACCESS_INDIRECT is not set
+# CONFIG_X86_HIGH_ENTRY is not set
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+# CONFIG_SMP is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_X86_UP_APIC is not set
+CONFIG_X86_MCE=y
+# CONFIG_X86_MCE_NONFATAL is not set
+CONFIG_TOSHIBA=m
+CONFIG_I8K=m
+# CONFIG_MICROCODE is not set
+CONFIG_X86_MSR=m
+CONFIG_X86_CPUID=m
+
+#
+# Firmware Drivers
+#
+CONFIG_EDD=m
+# CONFIG_NOHIGHMEM is not set
+CONFIG_HIGHMEM4G=y
+# CONFIG_HIGHMEM64G is not set
+CONFIG_HIGHMEM=y
+CONFIG_HIGHPTE=y
+# CONFIG_MATH_EMULATION is not set
+CONFIG_MTRR=y
+# CONFIG_EFI is not set
+CONFIG_REGPARM=y
+
+#
+# Power management options (ACPI, APM)
+#
+CONFIG_PM=y
+# CONFIG_SOFTWARE_SUSPEND is not set
+# CONFIG_PM_DISK is not set
+
+#
+# ACPI (Advanced Configuration and Power Interface) Support
+#
+CONFIG_ACPI=y
+CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_SLEEP_PROC_FS=y
+CONFIG_ACPI_AC=m
+CONFIG_ACPI_BATTERY=m
+CONFIG_ACPI_BUTTON=m
+CONFIG_ACPI_FAN=y
+CONFIG_ACPI_PROCESSOR=y
+CONFIG_ACPI_THERMAL=y
+CONFIG_ACPI_ASUS=m
+CONFIG_ACPI_TOSHIBA=m
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_BUS=y
+CONFIG_ACPI_EC=y
+CONFIG_ACPI_POWER=y
+CONFIG_ACPI_PCI=y
+CONFIG_ACPI_SYSTEM=y
+CONFIG_X86_PM_TIMER=y
+
+#
+# APM (Advanced Power Management) BIOS Support
+#
+CONFIG_APM=y
+# CONFIG_APM_IGNORE_USER_SUSPEND is not set
+# CONFIG_APM_DO_ENABLE is not set
+CONFIG_APM_CPU_IDLE=y
+# CONFIG_APM_DISPLAY_BLANK is not set
+CONFIG_APM_RTC_IS_GMT=y
+# CONFIG_APM_ALLOW_INTS is not set
+# CONFIG_APM_REAL_MODE_POWER_OFF is not set
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_PROC_INTF is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_24_API is not set
+CONFIG_CPU_FREQ_TABLE=y
+
+#
+# CPUFreq processor drivers
+#
+CONFIG_X86_ACPI_CPUFREQ=m
+# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
+CONFIG_X86_POWERNOW_K6=m
+CONFIG_X86_POWERNOW_K7=y
+CONFIG_X86_POWERNOW_K8=m
+# CONFIG_X86_GX_SUSPMOD is not set
+CONFIG_X86_SPEEDSTEP_CENTRINO=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y
+CONFIG_X86_SPEEDSTEP_ICH=y
+CONFIG_X86_SPEEDSTEP_SMI=m
+CONFIG_X86_P4_CLOCKMOD=m
+CONFIG_X86_SPEEDSTEP_LIB=y
+# CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set
+CONFIG_X86_LONGRUN=y
+# CONFIG_X86_LONGHAUL is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+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_PCI_LEGACY_PROC=y
+# CONFIG_PCI_NAMES is not set
+CONFIG_ISA=y
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_YENTA=m
+CONFIG_CARDBUS=y
+CONFIG_I82092=m
+CONFIG_I82365=m
+CONFIG_TCIC=m
+CONFIG_PCMCIA_PROBE=y
+
+#
+# PCI Hotplug Support
+#
+CONFIG_HOTPLUG_PCI=y
+# CONFIG_HOTPLUG_PCI_FAKE is not set
+CONFIG_HOTPLUG_PCI_COMPAQ=m
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+# CONFIG_HOTPLUG_PCI_ACPI is not set
+# CONFIG_HOTPLUG_PCI_CPCI is not set
+CONFIG_HOTPLUG_PCI_PCIE=m
+CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE=y
+CONFIG_HOTPLUG_PCI_SHPC=m
+CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE=y
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=m
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=m
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_CMDLINE_PARTS=m
+
+#
+# User Modules And Translation Layers
+#
+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
+
+#
+# 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_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_PNC2000 is not set
+CONFIG_MTD_SC520CDP=m
+CONFIG_MTD_NETSC520=m
+CONFIG_MTD_SBC_GXX=m
+CONFIG_MTD_ELAN_104NC=m
+CONFIG_MTD_SCx200_DOCFLASH=m
+CONFIG_MTD_AMD76XROM=m
+CONFIG_MTD_ICH2ROM=m
+CONFIG_MTD_SCB2_FLASH=m
+# CONFIG_MTD_NETtel is not set
+# CONFIG_MTD_DILNETPC is not set
+CONFIG_MTD_L440GX=m
+CONFIG_MTD_PCI=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_SLRAM is not set
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+# CONFIG_MTD_BLKMTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_DOC2000=m
+# CONFIG_MTD_DOC2001 is not set
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=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_IDS=m
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_PC_CML1=m
+CONFIG_PARPORT_SERIAL=m
+# CONFIG_PARPORT_PC_FIFO is not set
+# CONFIG_PARPORT_PC_SUPERIO is not set
+CONFIG_PARPORT_PC_PCMCIA=m
+# CONFIG_PARPORT_OTHER is not set
+CONFIG_PARPORT_1284=y
+
+#
+# Plug and Play support
+#
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_ISAPNP=y
+# CONFIG_PNPBIOS is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+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_CARMEL=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
+
+#
+# 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_HD_IDE is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+# CONFIG_IDEDISK_STROKE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=y
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_CMD640 is not set
+CONFIG_BLK_DEV_IDEPNP=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_RZ1000=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_ADMA=y
+CONFIG_BLK_DEV_AEC62XX=y
+CONFIG_BLK_DEV_ALI15X3=y
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=y
+CONFIG_BLK_DEV_ATIIXP=y
+CONFIG_BLK_DEV_CMD64X=y
+CONFIG_BLK_DEV_TRIFLEX=y
+CONFIG_BLK_DEV_CY82C693=y
+CONFIG_BLK_DEV_CS5520=y
+CONFIG_BLK_DEV_CS5530=y
+CONFIG_BLK_DEV_HPT34X=y
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# 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_PDC202XX_FORCE=y
+CONFIG_BLK_DEV_SVWKS=y
+CONFIG_BLK_DEV_SIIMAGE=y
+CONFIG_BLK_DEV_SIS5513=y
+CONFIG_BLK_DEV_SLC90E66=y
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+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
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+
+#
+# SCSI low-level drivers
+#
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+# CONFIG_SCSI_7000FASST is not set
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AHA152X=m
+CONFIG_SCSI_AHA1542=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=4
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
+# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
+CONFIG_AIC7XXX_DEBUG_MASK=0
+# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=4
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
+# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
+# CONFIG_AIC79XX_DEBUG_ENABLE is not set
+CONFIG_AIC79XX_DEBUG_MASK=0
+# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
+# CONFIG_SCSI_DPT_I2O is not set
+CONFIG_SCSI_ADVANSYS=m
+CONFIG_SCSI_IN2000=m
+CONFIG_SCSI_MEGARAID=m
+CONFIG_SCSI_SATA=y
+CONFIG_SCSI_SATA_SVW=m
+CONFIG_SCSI_ATA_PIIX=m
+CONFIG_SCSI_SATA_PROMISE=m
+CONFIG_SCSI_SATA_SX4=m
+CONFIG_SCSI_SATA_SIL=m
+CONFIG_SCSI_SATA_SIS=m
+CONFIG_SCSI_SATA_VIA=m
+CONFIG_SCSI_SATA_VITESSE=m
+CONFIG_SCSI_BUSLOGIC=m
+# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+CONFIG_SCSI_IPS=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_NCR53C406A 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_SYM53C8XX_IOMAPPED 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=m
+CONFIG_SCSI_QLOGIC_ISP=m
+# CONFIG_SCSI_QLOGIC_FC is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA2XXX=m
+CONFIG_SCSI_QLA21XX=m
+CONFIG_SCSI_QLA22XX=m
+CONFIG_SCSI_QLA2300=m
+CONFIG_SCSI_QLA2322=m
+CONFIG_SCSI_QLA6312=m
+CONFIG_SCSI_QLA6322=m
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC395x is not set
+CONFIG_SCSI_DC390T=m
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_ULTRASTOR is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+CONFIG_PCMCIA_AHA152X=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_NINJA_SCSI=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=m
+CONFIG_FUSION_MAX_SGE=40
+# CONFIG_FUSION_ISENSE is not set
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LAN=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_IEEE1394=m
+
+#
+# Subsystem Options
+#
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+CONFIG_IEEE1394_OUI_DB=y
+# CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set
+
+#
+# Device Drivers
+#
+# CONFIG_IEEE1394_PCILYNX is not set
+CONFIG_IEEE1394_OHCI1394=m
+
+#
+# Protocol Drivers
+#
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
+# CONFIG_IEEE1394_ETH1394 is not set
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+CONFIG_IEEE1394_CMP=m
+CONFIG_IEEE1394_AMDTP=m
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_NETLINK_DEV=y
+CONFIG_UNIX=y
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_FWMARK=y
+CONFIG_IP_ROUTE_NAT=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_TOS=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
+
+#
+# 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_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_LIMIT=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MAC=m
+CONFIG_IP_NF_MATCH_PKTTYPE=m
+CONFIG_IP_NF_MATCH_MARK=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_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_TCPMSS=m
+CONFIG_IP_NF_MATCH_HELPER=m
+CONFIG_IP_NF_MATCH_STATE=m
+CONFIG_IP_NF_MATCH_CONNTRACK=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_PHYSDEV=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_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_IP_NF_NAT_LOCAL=y
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
+CONFIG_IP_NF_NAT_FTP=m
+CONFIG_IP_NF_NAT_TFTP=m
+CONFIG_IP_NF_NAT_AMANDA=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_MARK=m
+CONFIG_IP_NF_TARGET_CLASSIFY=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
+
+#
+# IPv6: Netfilter Configuration
+#
+# CONFIG_IP6_NF_QUEUE is not set
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_LIMIT=m
+CONFIG_IP6_NF_MATCH_MAC=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_MARK=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_LENGTH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_MARK=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_XFRM=y
+CONFIG_XFRM_USER=y
+
+#
+# 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
+# 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=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=y
+CONFIG_LTPC=m
+CONFIG_COPS=m
+CONFIG_COPS_DAYNA=y
+CONFIG_COPS_TANGENT=y
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+CONFIG_NET_DIVERT=y
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=m
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_CSZ=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_DELAY=m
+CONFIG_NET_SCH_INGRESS=m
+CONFIG_NET_QOS=y
+CONFIG_NET_ESTIMATOR=y
+CONFIG_NET_CLS=y
+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_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_POLICE=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_RX is not set
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+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 is not set
+
+#
+# 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_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_NSC_FIR=m
+# CONFIG_WINBOND_FIR is not set
+# 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=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
+
+#
+# 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_HCIUART_BCSP_TXCRC=y
+CONFIG_BT_HCIBCM203X=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_TUX=m
+
+#
+# TUX options
+#
+CONFIG_TUX_EXTCGI=y
+# CONFIG_TUX_EXTENDED_LOG is not set
+# CONFIG_TUX_DEBUG is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_ETHERTAP=m
+CONFIG_NET_SB1000=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=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 is not set
+CONFIG_LANCE=m
+CONFIG_NET_VENDOR_SMC=y
+CONFIG_WD80x3=m
+CONFIG_ULTRA=m
+CONFIG_SMC9194=m
+CONFIG_NET_VENDOR_RACAL=y
+# CONFIG_NI5010 is not set
+CONFIG_NI52=m
+CONFIG_NI65=m
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+CONFIG_TULIP_MMIO=y
+# CONFIG_TULIP_NAPI is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+# CONFIG_PCMCIA_XIRTULIP is not set
+# CONFIG_AT1700 is not set
+CONFIG_DEPCA=m
+CONFIG_HP100=m
+# CONFIG_NET_ISA is not set
+CONFIG_NE2000=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+CONFIG_AC3200=m
+CONFIG_APRICOT=m
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_CS89x0=m
+CONFIG_DGRS=m
+CONFIG_EEPRO100=m
+# CONFIG_EEPRO100_PIO is not set
+CONFIG_E100=m
+CONFIG_E100_NAPI=y
+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_TLAN=m
+CONFIG_VIA_RHINE=m
+CONFIG_VIA_RHINE_MMIO=y
+CONFIG_NET_POCKET=y
+CONFIG_ATP=m
+CONFIG_DE600=m
+CONFIG_DE620=m
+
+#
+# Gigabit Ethernet (1000/10000 Mbit)
+#
+CONFIG_NET_GIGE=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000_NAPI=y
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_SK98LIN=m
+CONFIG_TIGON3=m
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_ARLAN is not set
+CONFIG_WAVELAN=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+# CONFIG_PCMCIA_RAYCS is not set
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_AIRO=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+CONFIG_PRISM54=m
+CONFIG_NET_WIRELESS=y
+
+#
+# PCMCIA network device support
+#
+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
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_FDDI=y
+# CONFIG_DEFXX is not set
+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 is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+CONFIG_NET_FC=y
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+
+#
+# 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 is not set
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+
+#
+# ISDN feature submodules
+#
+CONFIG_ISDN_DRV_LOOP=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=y
+CONFIG_HISAX_NO_LLC=y
+CONFIG_HISAX_NO_KEYPAD=y
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+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
+
+#
+# HiSax PCMCIA card service modules
+#
+CONFIG_HISAX_SEDLBAUER_CS=m
+CONFIG_HISAX_ELSA_CS=m
+CONFIG_HISAX_AVM_A1_CS=m
+CONFIG_HISAX_TELES_CS=m
+
+#
+# HiSax sub driver modules
+#
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+
+#
+# Active cards
+#
+CONFIG_ISDN_DRV_ICN=m
+CONFIG_ISDN_DRV_PCBIT=m
+CONFIG_ISDN_DRV_SC=m
+CONFIG_ISDN_DRV_ACT2000=m
+CONFIG_ISDN_DRV_TPAM=m
+CONFIG_HYSDN=m
+CONFIG_HYSDN_CAPI=y
+
+#
+# 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_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
+
+#
+# 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=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input I/O drivers
+#
+CONFIG_GAMEPORT=m
+CONFIG_SOUND_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_VORTEX=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_GAMEPORT_CS461x=m
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 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=y
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_INPORT=m
+CONFIG_MOUSE_ATIXL=y
+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_TWIDDLER=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+# CONFIG_INPUT_JOYDUMP is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_UINPUT 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=m
+# CONFIG_CYCLADES is not set
+# CONFIG_DIGIEPCA is not set
+# CONFIG_DIGI 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=m
+CONFIG_SYNCLINKMP=m
+CONFIG_N_HDLC=m
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_SX is not set
+# CONFIG_RIO is not set
+CONFIG_STALDRV=y
+# CONFIG_STALLION is not set
+# CONFIG_ISTALLION is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+# CONFIG_SERIAL_8250_ACPI is not set
+CONFIG_SERIAL_8250_NR_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=y
+CONFIG_SERIAL_8250_MULTIPORT=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_CRASH=m
+CONFIG_PRINTER=m
+CONFIG_LP_CONSOLE=y
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+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_I8XX_TCO=m
+CONFIG_SC1200_WDT=m
+# CONFIG_SCx200_WDT is not set
+# CONFIG_60XX_WDT is not set
+CONFIG_CPU5_WDT=m
+CONFIG_W83627HF_WDT=m
+CONFIG_W83877F_WDT=m
+CONFIG_MACHZ_WDT=m
+
+#
+# ISA-based Watchdog Cards
+#
+CONFIG_PCWATCHDOG=m
+# CONFIG_MIXCOMWD is not set
+CONFIG_WDT=m
+# CONFIG_WDT_501 is not set
+
+#
+# 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_NVRAM=m
+CONFIG_RTC=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+# CONFIG_APPLICOM is not set
+CONFIG_SONYPI=m
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+CONFIG_AGP=y
+CONFIG_AGP_ALI=y
+CONFIG_AGP_ATI=y
+CONFIG_AGP_AMD=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+CONFIG_AGP_INTEL_MCH=y
+CONFIG_AGP_NVIDIA=y
+CONFIG_AGP_SIS=y
+CONFIG_AGP_SWORKS=y
+CONFIG_AGP_VIA=y
+CONFIG_AGP_EFFICEON=y
+CONFIG_DRM=y
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_GAMMA=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_I810=m
+CONFIG_DRM_I830=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+
+#
+# PCMCIA character devices
+#
+CONFIG_SYNCLINK_CS=m
+CONFIG_MWAVE=m
+# CONFIG_RAW_DRIVER is not set
+CONFIG_HANGCHECK_TIMER=m
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD8111=m
+# CONFIG_I2C_ELEKTOR is not set
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_ISA=m
+CONFIG_I2C_NFORCE2=m
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+# CONFIG_SCx200_ACB is not set
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+
+#
+# Hardware Sensors Chip support
+#
+CONFIG_I2C_SENSOR=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+
+#
+# Other I2C Chip support
+#
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_RTC8564=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
+
+#
+# Misc devices
+#
+CONFIG_IBM_ASM=m
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+CONFIG_VIDEO_BT848=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_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_MEYE=m
+CONFIG_VIDEO_SAA7134=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+
+#
+# Radio Adapters
+#
+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
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_VIDEOBUF=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+# 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_VGA16=m
+CONFIG_FB_VESA=y
+CONFIG_VIDEO_SELECT=y
+CONFIG_FB_HGA=m
+CONFIG_FB_HGA_ACCEL=y
+CONFIG_FB_RIVA=m
+CONFIG_FB_I810=m
+CONFIG_FB_I810_GTF=y
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G450=y
+CONFIG_FB_MATROX_G100=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+# CONFIG_FB_RADEON_OLD 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=y
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_XL_INIT is not set
+# CONFIG_FB_SIS is not set
+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_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_MDA_CONSOLE=m
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# 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=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=y
+CONFIG_SND_RTCTIMER=m
+# 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_OPL4_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+# CONFIG_SND_SERIAL_U16550 is not set
+CONFIG_SND_MPU401=m
+
+#
+# ISA devices
+#
+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_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 is not set
+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
+
+#
+# PCI devices
+#
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=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=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_VX222=m
+
+#
+# ALSA USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# PCMCIA devices
+#
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_VXP440 is not set
+CONFIG_SND_PDAUDIOCF=m
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS 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_OHCI_HCD=m
+CONFIG_USB_UHCI_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_AUDIO=m
+
+#
+# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+#
+CONFIG_USB_MIDI=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_HP8200e=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+CONFIG_HID_FF=y
+CONFIG_HID_PID=y
+CONFIG_LOGITECH_FF=y
+CONFIG_THRUSTMASTER_FF=y
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_AIPTEK=m
+CONFIG_USB_WACOM=m
+CONFIG_USB_KBTAB=m
+CONFIG_USB_POWERMATE=m
+CONFIG_USB_MTOUCH=m
+CONFIG_USB_EGALAX=m
+CONFIG_USB_XPAD=m
+CONFIG_USB_ATI_REMOTE=m
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_HPUSBSCSI=m
+
+#
+# USB Multimedia devices
+#
+CONFIG_USB_DABUSB=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_STV680=m
+CONFIG_USB_W9968CF=m
+
+#
+# USB Network adaptors
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+
+#
+# USB Host-to-Host Cables
+#
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_GENESYS=y
+CONFIG_USB_NET1080=y
+CONFIG_USB_PL2301=y
+
+#
+# Intelligent USB Devices/Gadgets
+#
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZAURUS=y
+CONFIG_USB_CDCETHER=y
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_AX8817X=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_SAFE_PADDED=y
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EZUSB=y
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+# CONFIG_USB_EMI26 is not set
+CONFIG_USB_TIGL=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+# CONFIG_USB_CYTHERM is not set
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_TEST=m
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET 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_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+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_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_RT is not set
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_QUOTA=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_ZISOFS_FS=y
+CONFIG_UDF_FS=m
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+CONFIG_DEVPTS_FS_XATTR=y
+CONFIG_DEVPTS_FS_SECURITY=y
+CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS 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_JFFS_FS is not set
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_NAND=y
+CONFIG_CRAMFS=m
+CONFIG_VXFS_FS=m
+# CONFIG_HPFS_FS is not set
+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
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS 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 is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+CONFIG_OSF_PARTITION=y
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+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 is not set
+# CONFIG_NEC98_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+CONFIG_SUN_PARTITION=y
+CONFIG_EFI_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+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_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_DEBUG_KERNEL=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_FRAME_POINTER is not set
+
+#
+# Security options
+#
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+# CONFIG_SECURITY_SELINUX_MLS 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_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_ARC4=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_X86_STD_RESOURCES=y
+CONFIG_PC=y
diff --git a/configs/kernel-2.6.6-i686-smp.config b/configs/kernel-2.6.6-i686-smp.config
new file mode 100644 (file)
index 0000000..de7e3e7
--- /dev/null
@@ -0,0 +1,2348 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_X86=y
+CONFIG_MMU=y
+CONFIG_UID16=y
+CONFIG_GENERIC_ISA_DMA=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_HOTPLUG=y
+# CONFIG_IKCONFIG is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+
+#
+# Processor type and features
+#
+# CONFIG_X86_PC is not set
+# 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=y
+# CONFIG_X86_ES7000 is not set
+CONFIG_X86_CYCLONE_TIMER=y
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+CONFIG_M686=y
+# 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_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP2 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_XADD=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+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_INTEL_USERCOPY=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_4G=y
+CONFIG_X86_SWITCH_PAGETABLES=y
+CONFIG_X86_4G_VM_LAYOUT=y
+CONFIG_X86_UACCESS_INDIRECT=y
+CONFIG_X86_HIGH_ENTRY=y
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=32
+CONFIG_SCHED_SMT=y
+# CONFIG_PREEMPT is not set
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_X86_IO_APIC=y
+CONFIG_X86_TSC=y
+CONFIG_X86_MCE=y
+# CONFIG_X86_MCE_NONFATAL is not set
+CONFIG_X86_MCE_P4THERMAL=y
+CONFIG_TOSHIBA=m
+CONFIG_I8K=m
+CONFIG_MICROCODE=m
+CONFIG_X86_MSR=m
+CONFIG_X86_CPUID=m
+
+#
+# Firmware Drivers
+#
+CONFIG_EDD=m
+# CONFIG_NOHIGHMEM is not set
+# CONFIG_HIGHMEM4G is not set
+CONFIG_HIGHMEM64G=y
+CONFIG_HIGHMEM=y
+CONFIG_X86_PAE=y
+# CONFIG_NUMA is not set
+CONFIG_HIGHPTE=y
+# CONFIG_MATH_EMULATION is not set
+CONFIG_MTRR=y
+# CONFIG_EFI is not set
+# CONFIG_IRQBALANCE is not set
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_REGPARM=y
+
+#
+# Power management options (ACPI, APM)
+#
+CONFIG_PM=y
+# CONFIG_SOFTWARE_SUSPEND is not set
+# CONFIG_PM_DISK is not set
+
+#
+# ACPI (Advanced Configuration and Power Interface) Support
+#
+CONFIG_ACPI=y
+CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_SLEEP_PROC_FS=y
+CONFIG_ACPI_AC=m
+CONFIG_ACPI_BATTERY=m
+CONFIG_ACPI_BUTTON=m
+CONFIG_ACPI_FAN=y
+CONFIG_ACPI_PROCESSOR=y
+CONFIG_ACPI_THERMAL=y
+CONFIG_ACPI_ASUS=m
+CONFIG_ACPI_TOSHIBA=m
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_BUS=y
+CONFIG_ACPI_EC=y
+CONFIG_ACPI_POWER=y
+CONFIG_ACPI_PCI=y
+CONFIG_ACPI_SYSTEM=y
+CONFIG_X86_PM_TIMER=y
+
+#
+# APM (Advanced Power Management) BIOS Support
+#
+CONFIG_APM=y
+# CONFIG_APM_IGNORE_USER_SUSPEND is not set
+# CONFIG_APM_DO_ENABLE is not set
+CONFIG_APM_CPU_IDLE=y
+# CONFIG_APM_DISPLAY_BLANK is not set
+CONFIG_APM_RTC_IS_GMT=y
+# CONFIG_APM_ALLOW_INTS is not set
+# CONFIG_APM_REAL_MODE_POWER_OFF is not set
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_PROC_INTF is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_24_API is not set
+CONFIG_CPU_FREQ_TABLE=y
+
+#
+# CPUFreq processor drivers
+#
+CONFIG_X86_ACPI_CPUFREQ=m
+# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
+CONFIG_X86_POWERNOW_K6=m
+CONFIG_X86_POWERNOW_K7=y
+CONFIG_X86_POWERNOW_K8=m
+# CONFIG_X86_GX_SUSPMOD is not set
+CONFIG_X86_SPEEDSTEP_CENTRINO=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y
+CONFIG_X86_SPEEDSTEP_ICH=y
+CONFIG_X86_SPEEDSTEP_SMI=m
+CONFIG_X86_P4_CLOCKMOD=m
+CONFIG_X86_SPEEDSTEP_LIB=y
+# CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set
+CONFIG_X86_LONGRUN=y
+# CONFIG_X86_LONGHAUL is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+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_PCI_USE_VECTOR=y
+CONFIG_PCI_LEGACY_PROC=y
+# CONFIG_PCI_NAMES is not set
+CONFIG_ISA=y
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_YENTA=m
+CONFIG_CARDBUS=y
+CONFIG_I82092=m
+CONFIG_I82365=m
+CONFIG_TCIC=m
+CONFIG_PCMCIA_PROBE=y
+
+#
+# PCI Hotplug Support
+#
+CONFIG_HOTPLUG_PCI=y
+# CONFIG_HOTPLUG_PCI_FAKE is not set
+CONFIG_HOTPLUG_PCI_COMPAQ=m
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+CONFIG_HOTPLUG_PCI_IBM=m
+# CONFIG_HOTPLUG_PCI_ACPI is not set
+# CONFIG_HOTPLUG_PCI_CPCI is not set
+CONFIG_HOTPLUG_PCI_PCIE=m
+CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE=y
+CONFIG_HOTPLUG_PCI_SHPC=m
+CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE=y
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=m
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=m
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_CMDLINE_PARTS=m
+
+#
+# User Modules And Translation Layers
+#
+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
+
+#
+# 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_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_PNC2000 is not set
+CONFIG_MTD_SC520CDP=m
+CONFIG_MTD_NETSC520=m
+CONFIG_MTD_SBC_GXX=m
+CONFIG_MTD_ELAN_104NC=m
+CONFIG_MTD_SCx200_DOCFLASH=m
+CONFIG_MTD_AMD76XROM=m
+CONFIG_MTD_ICH2ROM=m
+CONFIG_MTD_SCB2_FLASH=m
+# CONFIG_MTD_NETtel is not set
+# CONFIG_MTD_DILNETPC is not set
+CONFIG_MTD_L440GX=m
+CONFIG_MTD_PCI=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_SLRAM is not set
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+# CONFIG_MTD_BLKMTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_DOC2000=m
+# CONFIG_MTD_DOC2001 is not set
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=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_IDS=m
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_PC_CML1=m
+CONFIG_PARPORT_SERIAL=m
+# CONFIG_PARPORT_PC_FIFO is not set
+# CONFIG_PARPORT_PC_SUPERIO is not set
+CONFIG_PARPORT_PC_PCMCIA=m
+# CONFIG_PARPORT_OTHER is not set
+CONFIG_PARPORT_1284=y
+
+#
+# Plug and Play support
+#
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_ISAPNP=y
+# CONFIG_PNPBIOS is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+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_CARMEL=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
+
+#
+# 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_HD_IDE is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+# CONFIG_IDEDISK_STROKE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=y
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_CMD640 is not set
+CONFIG_BLK_DEV_IDEPNP=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_RZ1000=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_ADMA=y
+CONFIG_BLK_DEV_AEC62XX=y
+CONFIG_BLK_DEV_ALI15X3=y
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=y
+CONFIG_BLK_DEV_ATIIXP=y
+CONFIG_BLK_DEV_CMD64X=y
+CONFIG_BLK_DEV_TRIFLEX=y
+CONFIG_BLK_DEV_CY82C693=y
+CONFIG_BLK_DEV_CS5520=y
+CONFIG_BLK_DEV_CS5530=y
+CONFIG_BLK_DEV_HPT34X=y
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# 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_PDC202XX_FORCE=y
+CONFIG_BLK_DEV_SVWKS=y
+CONFIG_BLK_DEV_SIIMAGE=y
+CONFIG_BLK_DEV_SIS5513=y
+CONFIG_BLK_DEV_SLC90E66=y
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+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
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+
+#
+# SCSI low-level drivers
+#
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+# CONFIG_SCSI_7000FASST is not set
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AHA152X=m
+CONFIG_SCSI_AHA1542=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=4
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
+# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
+CONFIG_AIC7XXX_DEBUG_MASK=0
+# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=4
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
+# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
+# CONFIG_AIC79XX_DEBUG_ENABLE is not set
+CONFIG_AIC79XX_DEBUG_MASK=0
+# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
+# CONFIG_SCSI_DPT_I2O is not set
+CONFIG_SCSI_ADVANSYS=m
+CONFIG_SCSI_IN2000=m
+CONFIG_SCSI_MEGARAID=m
+CONFIG_SCSI_SATA=y
+CONFIG_SCSI_SATA_SVW=m
+CONFIG_SCSI_ATA_PIIX=m
+CONFIG_SCSI_SATA_PROMISE=m
+CONFIG_SCSI_SATA_SX4=m
+CONFIG_SCSI_SATA_SIL=m
+CONFIG_SCSI_SATA_SIS=m
+CONFIG_SCSI_SATA_VIA=m
+CONFIG_SCSI_SATA_VITESSE=m
+CONFIG_SCSI_BUSLOGIC=m
+# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+CONFIG_SCSI_IPS=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_NCR53C406A 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_SYM53C8XX_IOMAPPED 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=m
+CONFIG_SCSI_QLOGIC_ISP=m
+# CONFIG_SCSI_QLOGIC_FC is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA2XXX=m
+CONFIG_SCSI_QLA21XX=m
+CONFIG_SCSI_QLA22XX=m
+CONFIG_SCSI_QLA2300=m
+CONFIG_SCSI_QLA2322=m
+CONFIG_SCSI_QLA6312=m
+CONFIG_SCSI_QLA6322=m
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC395x is not set
+CONFIG_SCSI_DC390T=m
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_ULTRASTOR is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+CONFIG_PCMCIA_AHA152X=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_NINJA_SCSI=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=m
+CONFIG_FUSION_MAX_SGE=40
+# CONFIG_FUSION_ISENSE is not set
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LAN=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_IEEE1394=m
+
+#
+# Subsystem Options
+#
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+CONFIG_IEEE1394_OUI_DB=y
+# CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set
+
+#
+# Device Drivers
+#
+# CONFIG_IEEE1394_PCILYNX is not set
+CONFIG_IEEE1394_OHCI1394=m
+
+#
+# Protocol Drivers
+#
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
+# CONFIG_IEEE1394_ETH1394 is not set
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+CONFIG_IEEE1394_CMP=m
+CONFIG_IEEE1394_AMDTP=m
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_NETLINK_DEV=y
+CONFIG_UNIX=y
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_FWMARK=y
+CONFIG_IP_ROUTE_NAT=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_TOS=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
+
+#
+# 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_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_LIMIT=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MAC=m
+CONFIG_IP_NF_MATCH_PKTTYPE=m
+CONFIG_IP_NF_MATCH_MARK=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_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_TCPMSS=m
+CONFIG_IP_NF_MATCH_HELPER=m
+CONFIG_IP_NF_MATCH_STATE=m
+CONFIG_IP_NF_MATCH_CONNTRACK=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_PHYSDEV=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_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_IP_NF_NAT_LOCAL=y
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
+CONFIG_IP_NF_NAT_FTP=m
+CONFIG_IP_NF_NAT_TFTP=m
+CONFIG_IP_NF_NAT_AMANDA=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_MARK=m
+CONFIG_IP_NF_TARGET_CLASSIFY=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
+
+#
+# IPv6: Netfilter Configuration
+#
+# CONFIG_IP6_NF_QUEUE is not set
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_LIMIT=m
+CONFIG_IP6_NF_MATCH_MAC=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_MARK=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_LENGTH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_MARK=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_XFRM=y
+CONFIG_XFRM_USER=y
+
+#
+# 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
+# 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=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=y
+CONFIG_LTPC=m
+CONFIG_COPS=m
+CONFIG_COPS_DAYNA=y
+CONFIG_COPS_TANGENT=y
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+CONFIG_NET_DIVERT=y
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=m
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_CSZ=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_DELAY=m
+CONFIG_NET_SCH_INGRESS=m
+CONFIG_NET_QOS=y
+CONFIG_NET_ESTIMATOR=y
+CONFIG_NET_CLS=y
+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_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_POLICE=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_RX is not set
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+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 is not set
+
+#
+# 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_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
+#
+
+#
+# Old Serial dongle support
+#
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_NSC_FIR=m
+# CONFIG_WINBOND_FIR is not set
+# 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=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
+
+#
+# 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_HCIUART_BCSP_TXCRC=y
+CONFIG_BT_HCIBCM203X=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_TUX=m
+
+#
+# TUX options
+#
+CONFIG_TUX_EXTCGI=y
+# CONFIG_TUX_EXTENDED_LOG is not set
+# CONFIG_TUX_DEBUG is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_ETHERTAP=m
+CONFIG_NET_SB1000=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=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
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+CONFIG_TULIP_MMIO=y
+# CONFIG_TULIP_NAPI is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+# CONFIG_AT1700 is not set
+CONFIG_DEPCA=m
+CONFIG_HP100=m
+# CONFIG_NET_ISA is not set
+CONFIG_NE2000=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+CONFIG_AC3200=m
+CONFIG_APRICOT=m
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_CS89x0=m
+CONFIG_DGRS=m
+CONFIG_EEPRO100=m
+# CONFIG_EEPRO100_PIO is not set
+CONFIG_E100=m
+CONFIG_E100_NAPI=y
+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_TLAN=m
+CONFIG_VIA_RHINE=m
+CONFIG_VIA_RHINE_MMIO=y
+CONFIG_NET_POCKET=y
+CONFIG_ATP=m
+CONFIG_DE600=m
+CONFIG_DE620=m
+
+#
+# Gigabit Ethernet (1000/10000 Mbit)
+#
+CONFIG_NET_GIGE=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000_NAPI=y
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_SK98LIN=m
+CONFIG_TIGON3=m
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_ARLAN is not set
+CONFIG_WAVELAN=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+# CONFIG_PCMCIA_RAYCS is not set
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_AIRO=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+CONFIG_PRISM54=m
+CONFIG_NET_WIRELESS=y
+
+#
+# PCMCIA network device support
+#
+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
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_FDDI=y
+# CONFIG_DEFXX is not set
+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 is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+CONFIG_NET_FC=y
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+
+#
+# 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 is not set
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+
+#
+# ISDN feature submodules
+#
+
+#
+# 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=y
+CONFIG_HISAX_NO_LLC=y
+CONFIG_HISAX_NO_KEYPAD=y
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+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
+
+#
+# HiSax PCMCIA card service modules
+#
+CONFIG_HISAX_SEDLBAUER_CS=m
+CONFIG_HISAX_ELSA_CS=m
+CONFIG_HISAX_AVM_A1_CS=m
+CONFIG_HISAX_TELES_CS=m
+
+#
+# HiSax sub driver modules
+#
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+
+#
+# Active cards
+#
+CONFIG_ISDN_DRV_ICN=m
+CONFIG_ISDN_DRV_PCBIT=m
+CONFIG_ISDN_DRV_SC=m
+CONFIG_ISDN_DRV_ACT2000=m
+CONFIG_ISDN_DRV_TPAM=m
+
+#
+# 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
+
+#
+# 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=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input I/O drivers
+#
+CONFIG_GAMEPORT=m
+CONFIG_SOUND_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_VORTEX=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_GAMEPORT_CS461x=m
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 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=y
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_INPORT=m
+CONFIG_MOUSE_ATIXL=y
+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_TWIDDLER=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+# CONFIG_INPUT_JOYDUMP is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_UINPUT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_ROCKETPORT=m
+# CONFIG_CYCLADES is not set
+CONFIG_SYNCLINK=m
+CONFIG_SYNCLINKMP=m
+CONFIG_N_HDLC=m
+CONFIG_STALDRV=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+# CONFIG_SERIAL_8250_ACPI is not set
+CONFIG_SERIAL_8250_NR_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=y
+CONFIG_SERIAL_8250_MULTIPORT=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_CRASH=m
+CONFIG_PRINTER=m
+CONFIG_LP_CONSOLE=y
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+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_I8XX_TCO=m
+CONFIG_SC1200_WDT=m
+# CONFIG_SCx200_WDT is not set
+# CONFIG_60XX_WDT is not set
+CONFIG_CPU5_WDT=m
+CONFIG_W83627HF_WDT=m
+CONFIG_W83877F_WDT=m
+CONFIG_MACHZ_WDT=m
+
+#
+# ISA-based Watchdog Cards
+#
+CONFIG_PCWATCHDOG=m
+# CONFIG_MIXCOMWD is not set
+CONFIG_WDT=m
+# CONFIG_WDT_501 is not set
+
+#
+# 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_NVRAM=m
+CONFIG_RTC=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+# CONFIG_APPLICOM is not set
+CONFIG_SONYPI=m
+
+#
+# Ftape, the floppy tape device driver
+#
+CONFIG_AGP=y
+CONFIG_AGP_ALI=y
+CONFIG_AGP_ATI=y
+CONFIG_AGP_AMD=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+CONFIG_AGP_INTEL_MCH=y
+CONFIG_AGP_NVIDIA=y
+CONFIG_AGP_SIS=y
+CONFIG_AGP_SWORKS=y
+CONFIG_AGP_VIA=y
+CONFIG_AGP_EFFICEON=y
+CONFIG_DRM=y
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_GAMMA=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_I810=m
+CONFIG_DRM_I830=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+
+#
+# PCMCIA character devices
+#
+CONFIG_SYNCLINK_CS=m
+CONFIG_MWAVE=m
+# CONFIG_RAW_DRIVER is not set
+CONFIG_HANGCHECK_TIMER=m
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_ISA=m
+CONFIG_I2C_NFORCE2=m
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+# CONFIG_SCx200_ACB is not set
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+
+#
+# Hardware Sensors Chip support
+#
+CONFIG_I2C_SENSOR=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+
+#
+# Other I2C Chip support
+#
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_RTC8564=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
+
+#
+# Misc devices
+#
+CONFIG_IBM_ASM=m
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+CONFIG_VIDEO_BT848=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_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_SAA7134=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+
+#
+# Radio Adapters
+#
+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
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_VIDEOBUF=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+# 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_VGA16=m
+CONFIG_FB_VESA=y
+CONFIG_VIDEO_SELECT=y
+CONFIG_FB_HGA=m
+CONFIG_FB_HGA_ACCEL=y
+CONFIG_FB_RIVA=m
+CONFIG_FB_I810=m
+CONFIG_FB_I810_GTF=y
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G450=y
+CONFIG_FB_MATROX_G100=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+# CONFIG_FB_RADEON_OLD 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=y
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_XL_INIT is not set
+# CONFIG_FB_SIS is not set
+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_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_MDA_CONSOLE=m
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# 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=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=y
+CONFIG_SND_RTCTIMER=m
+# 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_OPL4_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+# CONFIG_SND_SERIAL_U16550 is not set
+CONFIG_SND_MPU401=m
+
+#
+# ISA devices
+#
+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_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 is not set
+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
+
+#
+# PCI devices
+#
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=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=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_VX222=m
+
+#
+# ALSA USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# PCMCIA devices
+#
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_VXP440 is not set
+CONFIG_SND_PDAUDIOCF=m
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS 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_OHCI_HCD=m
+CONFIG_USB_UHCI_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_AUDIO=m
+
+#
+# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+#
+CONFIG_USB_MIDI=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_HP8200e=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+CONFIG_HID_FF=y
+CONFIG_HID_PID=y
+CONFIG_LOGITECH_FF=y
+CONFIG_THRUSTMASTER_FF=y
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_AIPTEK=m
+CONFIG_USB_WACOM=m
+CONFIG_USB_KBTAB=m
+CONFIG_USB_POWERMATE=m
+CONFIG_USB_MTOUCH=m
+CONFIG_USB_EGALAX=m
+CONFIG_USB_XPAD=m
+CONFIG_USB_ATI_REMOTE=m
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_HPUSBSCSI=m
+
+#
+# USB Multimedia devices
+#
+CONFIG_USB_DABUSB=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_STV680=m
+CONFIG_USB_W9968CF=m
+
+#
+# USB Network adaptors
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+
+#
+# USB Host-to-Host Cables
+#
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_GENESYS=y
+CONFIG_USB_NET1080=y
+CONFIG_USB_PL2301=y
+
+#
+# Intelligent USB Devices/Gadgets
+#
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZAURUS=y
+CONFIG_USB_CDCETHER=y
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_AX8817X=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_SAFE_PADDED=y
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EZUSB=y
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+# CONFIG_USB_EMI26 is not set
+CONFIG_USB_TIGL=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+# CONFIG_USB_CYTHERM is not set
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_TEST=m
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET 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_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+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_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_RT is not set
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_QUOTA=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_ZISOFS_FS=y
+CONFIG_UDF_FS=m
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+CONFIG_DEVPTS_FS_XATTR=y
+CONFIG_DEVPTS_FS_SECURITY=y
+CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS 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_JFFS_FS is not set
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_NAND=y
+CONFIG_CRAMFS=m
+CONFIG_VXFS_FS=m
+# CONFIG_HPFS_FS is not set
+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
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS 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 is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+CONFIG_OSF_PARTITION=y
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+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 is not set
+# CONFIG_NEC98_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+CONFIG_SUN_PARTITION=y
+CONFIG_EFI_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+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_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_DEBUG_KERNEL=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_FRAME_POINTER is not set
+CONFIG_X86_FIND_SMP_CONFIG=y
+CONFIG_X86_MPPARSE=y
+
+#
+# Security options
+#
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+# CONFIG_SECURITY_SELINUX_MLS 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_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_ARC4=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_X86_SMP=y
+CONFIG_X86_HT=y
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_X86_TRAMPOLINE=y
+CONFIG_X86_STD_RESOURCES=y
+CONFIG_PC=y
diff --git a/configs/kernel-2.6.6-i686.config b/configs/kernel-2.6.6-i686.config
new file mode 100644 (file)
index 0000000..c245c3d
--- /dev/null
@@ -0,0 +1,2363 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_X86=y
+CONFIG_MMU=y
+CONFIG_UID16=y
+CONFIG_GENERIC_ISA_DMA=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_HOTPLUG=y
+# CONFIG_IKCONFIG is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
+# Processor type and features
+#
+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_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+CONFIG_M686=y
+# 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_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP2 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_XADD=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+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_INTEL_USERCOPY=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_4G=y
+CONFIG_X86_SWITCH_PAGETABLES=y
+CONFIG_X86_4G_VM_LAYOUT=y
+CONFIG_X86_UACCESS_INDIRECT=y
+CONFIG_X86_HIGH_ENTRY=y
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+# CONFIG_SMP is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_X86_UP_APIC is not set
+CONFIG_X86_TSC=y
+CONFIG_X86_MCE=y
+# CONFIG_X86_MCE_NONFATAL is not set
+CONFIG_TOSHIBA=m
+CONFIG_I8K=m
+CONFIG_MICROCODE=m
+CONFIG_X86_MSR=m
+CONFIG_X86_CPUID=m
+
+#
+# Firmware Drivers
+#
+CONFIG_EDD=m
+# CONFIG_NOHIGHMEM is not set
+CONFIG_HIGHMEM4G=y
+# CONFIG_HIGHMEM64G is not set
+CONFIG_HIGHMEM=y
+CONFIG_HIGHPTE=y
+# CONFIG_MATH_EMULATION is not set
+CONFIG_MTRR=y
+# CONFIG_EFI is not set
+CONFIG_REGPARM=y
+
+#
+# Power management options (ACPI, APM)
+#
+CONFIG_PM=y
+# CONFIG_SOFTWARE_SUSPEND is not set
+# CONFIG_PM_DISK is not set
+
+#
+# ACPI (Advanced Configuration and Power Interface) Support
+#
+CONFIG_ACPI=y
+CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_SLEEP_PROC_FS=y
+CONFIG_ACPI_AC=m
+CONFIG_ACPI_BATTERY=m
+CONFIG_ACPI_BUTTON=m
+CONFIG_ACPI_FAN=y
+CONFIG_ACPI_PROCESSOR=y
+CONFIG_ACPI_THERMAL=y
+CONFIG_ACPI_ASUS=m
+CONFIG_ACPI_TOSHIBA=m
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_BUS=y
+CONFIG_ACPI_EC=y
+CONFIG_ACPI_POWER=y
+CONFIG_ACPI_PCI=y
+CONFIG_ACPI_SYSTEM=y
+CONFIG_X86_PM_TIMER=y
+
+#
+# APM (Advanced Power Management) BIOS Support
+#
+CONFIG_APM=y
+# CONFIG_APM_IGNORE_USER_SUSPEND is not set
+# CONFIG_APM_DO_ENABLE is not set
+CONFIG_APM_CPU_IDLE=y
+# CONFIG_APM_DISPLAY_BLANK is not set
+CONFIG_APM_RTC_IS_GMT=y
+# CONFIG_APM_ALLOW_INTS is not set
+# CONFIG_APM_REAL_MODE_POWER_OFF is not set
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_PROC_INTF is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_24_API is not set
+CONFIG_CPU_FREQ_TABLE=y
+
+#
+# CPUFreq processor drivers
+#
+CONFIG_X86_ACPI_CPUFREQ=m
+# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
+CONFIG_X86_POWERNOW_K6=m
+CONFIG_X86_POWERNOW_K7=y
+CONFIG_X86_POWERNOW_K8=m
+# CONFIG_X86_GX_SUSPMOD is not set
+CONFIG_X86_SPEEDSTEP_CENTRINO=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y
+CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y
+CONFIG_X86_SPEEDSTEP_ICH=y
+CONFIG_X86_SPEEDSTEP_SMI=m
+CONFIG_X86_P4_CLOCKMOD=m
+CONFIG_X86_SPEEDSTEP_LIB=y
+# CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set
+CONFIG_X86_LONGRUN=y
+# CONFIG_X86_LONGHAUL is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+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_PCI_LEGACY_PROC=y
+# CONFIG_PCI_NAMES is not set
+CONFIG_ISA=y
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_YENTA=m
+CONFIG_CARDBUS=y
+CONFIG_I82092=m
+CONFIG_I82365=m
+CONFIG_TCIC=m
+CONFIG_PCMCIA_PROBE=y
+
+#
+# PCI Hotplug Support
+#
+CONFIG_HOTPLUG_PCI=y
+# CONFIG_HOTPLUG_PCI_FAKE is not set
+CONFIG_HOTPLUG_PCI_COMPAQ=m
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+# CONFIG_HOTPLUG_PCI_ACPI is not set
+# CONFIG_HOTPLUG_PCI_CPCI is not set
+CONFIG_HOTPLUG_PCI_PCIE=m
+CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE=y
+CONFIG_HOTPLUG_PCI_SHPC=m
+CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE=y
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=m
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=m
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=m
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_REDBOOT_PARTS=m
+CONFIG_MTD_CMDLINE_PARTS=m
+
+#
+# User Modules And Translation Layers
+#
+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
+
+#
+# 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_CFI_INTELEXT=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_CFI_STAA=m
+CONFIG_MTD_RAM=m
+CONFIG_MTD_ROM=m
+CONFIG_MTD_ABSENT=m
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_PNC2000 is not set
+CONFIG_MTD_SC520CDP=m
+CONFIG_MTD_NETSC520=m
+CONFIG_MTD_SBC_GXX=m
+CONFIG_MTD_ELAN_104NC=m
+CONFIG_MTD_SCx200_DOCFLASH=m
+CONFIG_MTD_AMD76XROM=m
+CONFIG_MTD_ICH2ROM=m
+CONFIG_MTD_SCB2_FLASH=m
+# CONFIG_MTD_NETtel is not set
+# CONFIG_MTD_DILNETPC is not set
+CONFIG_MTD_L440GX=m
+CONFIG_MTD_PCI=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_SLRAM is not set
+CONFIG_MTD_MTDRAM=m
+CONFIG_MTDRAM_TOTAL_SIZE=4096
+CONFIG_MTDRAM_ERASE_SIZE=128
+# CONFIG_MTD_BLKMTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_DOC2000=m
+# CONFIG_MTD_DOC2001 is not set
+CONFIG_MTD_DOC2001PLUS=m
+CONFIG_MTD_DOCPROBE=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_IDS=m
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_PC_CML1=m
+CONFIG_PARPORT_SERIAL=m
+# CONFIG_PARPORT_PC_FIFO is not set
+# CONFIG_PARPORT_PC_SUPERIO is not set
+CONFIG_PARPORT_PC_PCMCIA=m
+# CONFIG_PARPORT_OTHER is not set
+CONFIG_PARPORT_1284=y
+
+#
+# Plug and Play support
+#
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_ISAPNP=y
+# CONFIG_PNPBIOS is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+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_CARMEL=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
+
+#
+# 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_HD_IDE is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+# CONFIG_IDEDISK_STROKE is not set
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=y
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_CMD640 is not set
+CONFIG_BLK_DEV_IDEPNP=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_RZ1000=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_ADMA=y
+CONFIG_BLK_DEV_AEC62XX=y
+CONFIG_BLK_DEV_ALI15X3=y
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=y
+CONFIG_BLK_DEV_ATIIXP=y
+CONFIG_BLK_DEV_CMD64X=y
+CONFIG_BLK_DEV_TRIFLEX=y
+CONFIG_BLK_DEV_CY82C693=y
+CONFIG_BLK_DEV_CS5520=y
+CONFIG_BLK_DEV_CS5530=y
+CONFIG_BLK_DEV_HPT34X=y
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# 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_PDC202XX_FORCE=y
+CONFIG_BLK_DEV_SVWKS=y
+CONFIG_BLK_DEV_SIIMAGE=y
+CONFIG_BLK_DEV_SIS5513=y
+CONFIG_BLK_DEV_SLC90E66=y
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+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
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+
+#
+# SCSI low-level drivers
+#
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+# CONFIG_SCSI_7000FASST is not set
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AHA152X=m
+CONFIG_SCSI_AHA1542=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=4
+CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
+# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
+CONFIG_AIC7XXX_DEBUG_MASK=0
+# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
+CONFIG_SCSI_AIC7XXX_OLD=m
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=4
+CONFIG_AIC79XX_RESET_DELAY_MS=15000
+# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
+# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
+# CONFIG_AIC79XX_DEBUG_ENABLE is not set
+CONFIG_AIC79XX_DEBUG_MASK=0
+# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
+# CONFIG_SCSI_DPT_I2O is not set
+CONFIG_SCSI_ADVANSYS=m
+CONFIG_SCSI_IN2000=m
+CONFIG_SCSI_MEGARAID=m
+CONFIG_SCSI_SATA=y
+CONFIG_SCSI_SATA_SVW=m
+CONFIG_SCSI_ATA_PIIX=m
+CONFIG_SCSI_SATA_PROMISE=m
+CONFIG_SCSI_SATA_SX4=m
+CONFIG_SCSI_SATA_SIL=m
+CONFIG_SCSI_SATA_SIS=m
+CONFIG_SCSI_SATA_VIA=m
+CONFIG_SCSI_SATA_VITESSE=m
+CONFIG_SCSI_BUSLOGIC=m
+# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
+CONFIG_SCSI_IPS=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_NCR53C406A 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_SYM53C8XX_IOMAPPED 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=m
+CONFIG_SCSI_QLOGIC_ISP=m
+# CONFIG_SCSI_QLOGIC_FC is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA2XXX=m
+CONFIG_SCSI_QLA21XX=m
+CONFIG_SCSI_QLA22XX=m
+CONFIG_SCSI_QLA2300=m
+CONFIG_SCSI_QLA2322=m
+CONFIG_SCSI_QLA6312=m
+CONFIG_SCSI_QLA6322=m
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC395x is not set
+CONFIG_SCSI_DC390T=m
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_ULTRASTOR is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+CONFIG_PCMCIA_AHA152X=m
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_NINJA_SCSI=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=m
+CONFIG_FUSION_MAX_SGE=40
+# CONFIG_FUSION_ISENSE is not set
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LAN=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_IEEE1394=m
+
+#
+# Subsystem Options
+#
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+CONFIG_IEEE1394_OUI_DB=y
+# CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set
+
+#
+# Device Drivers
+#
+# CONFIG_IEEE1394_PCILYNX is not set
+CONFIG_IEEE1394_OHCI1394=m
+
+#
+# Protocol Drivers
+#
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
+# CONFIG_IEEE1394_ETH1394 is not set
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+CONFIG_IEEE1394_CMP=m
+CONFIG_IEEE1394_AMDTP=m
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_NETLINK_DEV=y
+CONFIG_UNIX=y
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_FWMARK=y
+CONFIG_IP_ROUTE_NAT=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_TOS=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
+
+#
+# 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_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_LIMIT=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_MAC=m
+CONFIG_IP_NF_MATCH_PKTTYPE=m
+CONFIG_IP_NF_MATCH_MARK=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_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_TCPMSS=m
+CONFIG_IP_NF_MATCH_HELPER=m
+CONFIG_IP_NF_MATCH_STATE=m
+CONFIG_IP_NF_MATCH_CONNTRACK=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_PHYSDEV=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_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_IP_NF_NAT_LOCAL=y
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
+CONFIG_IP_NF_NAT_FTP=m
+CONFIG_IP_NF_NAT_TFTP=m
+CONFIG_IP_NF_NAT_AMANDA=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_MARK=m
+CONFIG_IP_NF_TARGET_CLASSIFY=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
+
+#
+# IPv6: Netfilter Configuration
+#
+# CONFIG_IP6_NF_QUEUE is not set
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_LIMIT=m
+CONFIG_IP6_NF_MATCH_MAC=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_MARK=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_LENGTH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_MARK=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_XFRM=y
+CONFIG_XFRM_USER=y
+
+#
+# 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
+# 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=m
+# CONFIG_IPX_INTERN is not set
+CONFIG_ATALK=m
+CONFIG_DEV_APPLETALK=y
+CONFIG_LTPC=m
+CONFIG_COPS=m
+CONFIG_COPS_DAYNA=y
+CONFIG_COPS_TANGENT=y
+CONFIG_IPDDP=m
+CONFIG_IPDDP_ENCAP=y
+CONFIG_IPDDP_DECAP=y
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+CONFIG_NET_DIVERT=y
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=m
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_CSZ=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_DELAY=m
+CONFIG_NET_SCH_INGRESS=m
+CONFIG_NET_QOS=y
+CONFIG_NET_ESTIMATOR=y
+CONFIG_NET_CLS=y
+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_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_POLICE=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_RX is not set
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+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 is not set
+
+#
+# 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_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_NSC_FIR=m
+# CONFIG_WINBOND_FIR is not set
+# 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=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
+
+#
+# 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_HCIUART_BCSP_TXCRC=y
+CONFIG_BT_HCIBCM203X=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_TUX=m
+
+#
+# TUX options
+#
+CONFIG_TUX_EXTCGI=y
+# CONFIG_TUX_EXTENDED_LOG is not set
+# CONFIG_TUX_DEBUG is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_ETHERTAP=m
+CONFIG_NET_SB1000=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=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_NI5010 is not set
+CONFIG_NI52=m
+CONFIG_NI65=m
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+CONFIG_TULIP_MMIO=y
+# CONFIG_TULIP_NAPI is not set
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_PCMCIA_XIRCOM=m
+# CONFIG_PCMCIA_XIRTULIP is not set
+# CONFIG_AT1700 is not set
+CONFIG_DEPCA=m
+CONFIG_HP100=m
+# CONFIG_NET_ISA is not set
+CONFIG_NE2000=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_AMD8111E_NAPI=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_ADAPTEC_STARFIRE_NAPI=y
+CONFIG_AC3200=m
+CONFIG_APRICOT=m
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+CONFIG_CS89x0=m
+CONFIG_DGRS=m
+CONFIG_EEPRO100=m
+# CONFIG_EEPRO100_PIO is not set
+CONFIG_E100=m
+CONFIG_E100_NAPI=y
+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_TLAN=m
+CONFIG_VIA_RHINE=m
+CONFIG_VIA_RHINE_MMIO=y
+CONFIG_NET_POCKET=y
+CONFIG_ATP=m
+CONFIG_DE600=m
+CONFIG_DE620=m
+
+#
+# Gigabit Ethernet (1000/10000 Mbit)
+#
+CONFIG_NET_GIGE=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000_NAPI=y
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_SK98LIN=m
+CONFIG_TIGON3=m
+CONFIG_IXGB=m
+CONFIG_IXGB_NAPI=y
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_ARLAN is not set
+CONFIG_WAVELAN=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+# CONFIG_PCMCIA_RAYCS is not set
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_AIRO=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+CONFIG_PRISM54=m
+CONFIG_NET_WIRELESS=y
+
+#
+# PCMCIA network device support
+#
+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
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_FDDI=y
+# CONFIG_DEFXX is not set
+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 is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+CONFIG_NET_FC=y
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=m
+
+#
+# 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 is not set
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+
+#
+# ISDN feature submodules
+#
+CONFIG_ISDN_DRV_LOOP=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=y
+CONFIG_HISAX_NO_LLC=y
+CONFIG_HISAX_NO_KEYPAD=y
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+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
+
+#
+# HiSax PCMCIA card service modules
+#
+CONFIG_HISAX_SEDLBAUER_CS=m
+CONFIG_HISAX_ELSA_CS=m
+CONFIG_HISAX_AVM_A1_CS=m
+CONFIG_HISAX_TELES_CS=m
+
+#
+# HiSax sub driver modules
+#
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+CONFIG_HISAX_HDLC=y
+
+#
+# Active cards
+#
+CONFIG_ISDN_DRV_ICN=m
+CONFIG_ISDN_DRV_PCBIT=m
+CONFIG_ISDN_DRV_SC=m
+CONFIG_ISDN_DRV_ACT2000=m
+CONFIG_ISDN_DRV_TPAM=m
+CONFIG_HYSDN=m
+CONFIG_HYSDN_CAPI=y
+
+#
+# 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_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
+
+#
+# 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=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=m
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input I/O drivers
+#
+CONFIG_GAMEPORT=m
+CONFIG_SOUND_GAMEPORT=m
+CONFIG_GAMEPORT_NS558=m
+CONFIG_GAMEPORT_L4=m
+CONFIG_GAMEPORT_EMU10K1=m
+CONFIG_GAMEPORT_VORTEX=m
+CONFIG_GAMEPORT_FM801=m
+CONFIG_GAMEPORT_CS461x=m
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 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=y
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_INPORT=m
+CONFIG_MOUSE_ATIXL=y
+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_TWIDDLER=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+# CONFIG_INPUT_JOYDUMP is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GUNZE=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_UINPUT 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=m
+# CONFIG_CYCLADES is not set
+# CONFIG_DIGIEPCA is not set
+# CONFIG_DIGI 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=m
+CONFIG_SYNCLINKMP=m
+CONFIG_N_HDLC=m
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_SX is not set
+# CONFIG_RIO is not set
+CONFIG_STALDRV=y
+# CONFIG_STALLION is not set
+# CONFIG_ISTALLION is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+# CONFIG_SERIAL_8250_ACPI is not set
+CONFIG_SERIAL_8250_NR_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=y
+CONFIG_SERIAL_8250_MULTIPORT=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_CRASH=m
+CONFIG_PRINTER=m
+CONFIG_LP_CONSOLE=y
+CONFIG_PPDEV=m
+CONFIG_TIPAR=m
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+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_I8XX_TCO=m
+CONFIG_SC1200_WDT=m
+# CONFIG_SCx200_WDT is not set
+# CONFIG_60XX_WDT is not set
+CONFIG_CPU5_WDT=m
+CONFIG_W83627HF_WDT=m
+CONFIG_W83877F_WDT=m
+CONFIG_MACHZ_WDT=m
+
+#
+# ISA-based Watchdog Cards
+#
+CONFIG_PCWATCHDOG=m
+# CONFIG_MIXCOMWD is not set
+CONFIG_WDT=m
+# CONFIG_WDT_501 is not set
+
+#
+# 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_NVRAM=m
+CONFIG_RTC=y
+CONFIG_DTLK=m
+CONFIG_R3964=m
+# CONFIG_APPLICOM is not set
+CONFIG_SONYPI=m
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+CONFIG_AGP=y
+CONFIG_AGP_ALI=y
+CONFIG_AGP_ATI=y
+CONFIG_AGP_AMD=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+CONFIG_AGP_INTEL_MCH=y
+CONFIG_AGP_NVIDIA=y
+CONFIG_AGP_SIS=y
+CONFIG_AGP_SWORKS=y
+CONFIG_AGP_VIA=y
+CONFIG_AGP_EFFICEON=y
+CONFIG_DRM=y
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_GAMMA=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_I810=m
+CONFIG_DRM_I830=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+
+#
+# PCMCIA character devices
+#
+CONFIG_SYNCLINK_CS=m
+CONFIG_MWAVE=m
+# CONFIG_RAW_DRIVER is not set
+CONFIG_HANGCHECK_TIMER=m
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD8111=m
+# CONFIG_I2C_ELEKTOR is not set
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_ISA=m
+CONFIG_I2C_NFORCE2=m
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+# CONFIG_SCx200_ACB is not set
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+
+#
+# Hardware Sensors Chip support
+#
+CONFIG_I2C_SENSOR=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+
+#
+# Other I2C Chip support
+#
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_RTC8564=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
+
+#
+# Misc devices
+#
+CONFIG_IBM_ASM=m
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+
+#
+# Video Adapters
+#
+CONFIG_VIDEO_BT848=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_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_MEYE=m
+CONFIG_VIDEO_SAA7134=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_DPC=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_CX88=m
+
+#
+# Radio Adapters
+#
+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
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_VIDEO_VIDEOBUF=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEO_BUF=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_IR=m
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+# 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_VGA16=m
+CONFIG_FB_VESA=y
+CONFIG_VIDEO_SELECT=y
+CONFIG_FB_HGA=m
+CONFIG_FB_HGA_ACCEL=y
+CONFIG_FB_RIVA=m
+CONFIG_FB_I810=m
+CONFIG_FB_I810_GTF=y
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G450=y
+CONFIG_FB_MATROX_G100=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_MATROX_MULTIHEAD=y
+# CONFIG_FB_RADEON_OLD 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=y
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_XL_INIT is not set
+# CONFIG_FB_SIS is not set
+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_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_MDA_CONSOLE=m
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# 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=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=y
+CONFIG_SND_RTCTIMER=m
+# 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_OPL4_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+# CONFIG_SND_SERIAL_U16550 is not set
+CONFIG_SND_MPU401=m
+
+#
+# ISA devices
+#
+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_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 is not set
+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
+
+#
+# PCI devices
+#
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS4281=m
+CONFIG_SND_EMU10K1=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=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_VX222=m
+
+#
+# ALSA USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+
+#
+# PCMCIA devices
+#
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_VXP440 is not set
+CONFIG_SND_PDAUDIOCF=m
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS 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_OHCI_HCD=m
+CONFIG_USB_UHCI_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_AUDIO=m
+
+#
+# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+#
+CONFIG_USB_MIDI=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_HP8200e=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+CONFIG_HID_FF=y
+CONFIG_HID_PID=y
+CONFIG_LOGITECH_FF=y
+CONFIG_THRUSTMASTER_FF=y
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_AIPTEK=m
+CONFIG_USB_WACOM=m
+CONFIG_USB_KBTAB=m
+CONFIG_USB_POWERMATE=m
+CONFIG_USB_MTOUCH=m
+CONFIG_USB_EGALAX=m
+CONFIG_USB_XPAD=m
+CONFIG_USB_ATI_REMOTE=m
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_HPUSBSCSI=m
+
+#
+# USB Multimedia devices
+#
+CONFIG_USB_DABUSB=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_STV680=m
+CONFIG_USB_W9968CF=m
+
+#
+# USB Network adaptors
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+
+#
+# USB Host-to-Host Cables
+#
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_GENESYS=y
+CONFIG_USB_NET1080=y
+CONFIG_USB_PL2301=y
+
+#
+# Intelligent USB Devices/Gadgets
+#
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_ZAURUS=y
+CONFIG_USB_CDCETHER=y
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_AX8817X=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_SAFE_PADDED=y
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EZUSB=y
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+# CONFIG_USB_EMI26 is not set
+CONFIG_USB_TIGL=m
+CONFIG_USB_AUERSWALD=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+# CONFIG_USB_CYTHERM is not set
+CONFIG_USB_PHIDGETSERVO=m
+CONFIG_USB_TEST=m
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET 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_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+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_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_RT is not set
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_MINIX_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_QUOTA=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_ZISOFS_FS=y
+CONFIG_UDF_FS=m
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+CONFIG_DEVPTS_FS_XATTR=y
+CONFIG_DEVPTS_FS_SECURITY=y
+CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS 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_JFFS_FS is not set
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_NAND=y
+CONFIG_CRAMFS=m
+CONFIG_VXFS_FS=m
+# CONFIG_HPFS_FS is not set
+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
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS 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 is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+CONFIG_OSF_PARTITION=y
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+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 is not set
+# CONFIG_NEC98_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+CONFIG_SUN_PARTITION=y
+CONFIG_EFI_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+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_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_DEBUG_KERNEL=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_FRAME_POINTER is not set
+
+#
+# Security options
+#
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+# CONFIG_SECURITY_SELINUX_MLS 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_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_ARC4=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_X86_STD_RESOURCES=y
+CONFIG_PC=y
diff --git a/drivers/char/crash.c b/drivers/char/crash.c
new file mode 100644 (file)
index 0000000..43cc96f
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ *  linux/drivers/char/crash.c
+ *
+ *  Copyright (C) 2004  Dave Anderson <anderson@redhat.com>
+ *  Copyright (C) 2004  Red Hat, Inc.
+ */
+
+/******************************************************************************
+ *
+ *   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, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *****************************************************************************/
+
+#include <linux/module.h>
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/init.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/types.h>
+#include <asm/crash.h>
+
+#define CRASH_VERSION   "1.0"
+
+/*
+ *  These are the file operation functions that allow crash utility
+ *  access to physical memory.
+ */
+
+static loff_t 
+crash_llseek(struct file * file, loff_t offset, int orig)
+{
+        switch (orig) {
+                case 0:
+                        file->f_pos = offset;
+                        return file->f_pos;
+                case 1:
+                        file->f_pos += offset;
+                        return file->f_pos;
+                default:
+                        return -EINVAL;
+        }
+}
+
+/*
+ *  Determine the page address for an address offset value, 
+ *  get a virtual address for it, and copy it out.
+ *  Accesses must fit within a page.
+ */
+static ssize_t
+crash_read(struct file *file, char *buf, size_t count, loff_t *poff)
+{
+       void *vaddr;
+       struct page *page;
+       u64 offset;
+       ssize_t read;
+
+       offset = *poff;
+       if (offset >> PAGE_SHIFT != (offset+count-1) >> PAGE_SHIFT) 
+               return -EINVAL;
+
+       vaddr = map_virtual(offset, &page);
+       if (!vaddr)
+                return -EFAULT;
+
+        if (copy_to_user(buf, vaddr, count)) {
+               unmap_virtual(page);
+               return -EFAULT;
+       }
+       unmap_virtual(page);
+
+       read = count;
+        *poff += read;
+        return read;
+}
+
+static struct file_operations crash_fops = {
+       owner:          THIS_MODULE,
+       llseek:         crash_llseek,
+       read:           crash_read,
+};
+
+static struct miscdevice crash_dev = {
+       MISC_DYNAMIC_MINOR,
+       "crash",
+       &crash_fops
+};
+
+static int __init
+crash_init(void)
+{
+       int ret;
+
+       ret = misc_register(&crash_dev);
+       if (ret) {
+               printk(KERN_ERR 
+                   "crash memory driver: cannot misc_register (MISC_DYNAMIC_MINOR)\n");
+               goto out;
+       }
+       
+       ret = 0;
+       printk(KERN_INFO "crash memory driver: version %s\n", CRASH_VERSION);
+out:
+       return ret;
+}
+
+static void __exit
+crash_cleanup_module(void)
+{
+       misc_deregister(&crash_dev);
+}
+
+module_init(crash_init);
+module_exit(crash_cleanup_module);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c
new file mode 100644 (file)
index 0000000..23488c4
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * ARM/ARM26 default IDE host driver
+ *
+ * Copyright (C) 2004 Bartlomiej Zolnierkiewicz
+ * Based on code by: Russell King, Ian Molton and Alexander Schulz.
+ *
+ * May be copied or modified under the terms of the GNU General Public License.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/ide.h>
+
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#ifdef CONFIG_ARM26
+# define IDE_ARM_HOST  (machine_is_a5k())
+#else
+# define IDE_ARM_HOST  (1)
+#endif
+
+#ifdef CONFIG_ARCH_CLPS7500
+# include <asm/arch/hardware.h>
+#
+# define IDE_ARM_IO    (ISASLOT_IO + 0x1f0)
+# define IDE_ARM_IRQ   IRQ_ISA_14
+#else
+# define IDE_ARM_IO    0x1f0
+# define IDE_ARM_IRQ   IRQ_HARDDISK
+#endif
+
+void __init ide_arm_init(void)
+{
+       if (IDE_ARM_HOST) {
+               hw_regs_t hw;
+
+               memset(&hw, 0, sizeof(hw));
+               ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
+               hw.irq = IDE_ARM_IRQ;
+               ide_register_hw(&hw, NULL);
+       }
+}
diff --git a/drivers/net/ibm_emac/Makefile b/drivers/net/ibm_emac/Makefile
new file mode 100644 (file)
index 0000000..7f583a3
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Makefile for the IBM PPC4xx EMAC controllers
+#
+
+obj-$(CONFIG_IBM_EMAC) += ibm_emac.o
+
+ibm_emac-objs := ibm_emac_mal.o ibm_emac_core.o ibm_emac_phy.o
+
+# Only need this if you want to see additional debug messages
+ifeq ($(CONFIG_IBM_EMAC_ERRMSG), y)
+ibm_emac-objs += ibm_emac_debug.o
+endif
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
new file mode 100644 (file)
index 0000000..0bc7f82
--- /dev/null
@@ -0,0 +1,1968 @@
+/*
+ * ibm_emac_core.c
+ *
+ * Ethernet driver for the built in ethernet on the IBM 4xx PowerPC
+ * processors.
+ * 
+ * (c) 2003 Benjamin Herrenschmidt <benh@kernel.crashing.org>
+ *
+ * Based on original work by
+ *
+ *      Armin Kuster <akuster@mvista.com>
+ *     Johnnie Peters <jpeters@mvista.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ * TODO
+ *       - Check for races in the "remove" code path
+ *       - Add some Power Management to the MAC and the PHY
+ *       - Audit remaining of non-rewritten code (--BenH)
+ *       - Cleanup message display using msglevel mecanism
+ *       - Address all errata
+ *       - Audit all register update paths to ensure they
+ *         are being written post soft reset if required.
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/string.h>
+#include <linux/timer.h>
+#include <linux/ptrace.h>
+#include <linux/errno.h>
+#include <linux/ioport.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/dma-mapping.h>
+#include <linux/ethtool.h>
+#include <linux/mii.h>
+
+#include <asm/processor.h>
+#include <asm/bitops.h>
+#include <asm/io.h>
+#include <asm/dma.h>
+#include <asm/irq.h>
+#include <asm/uaccess.h>
+#include <asm/ocp.h>
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+#include <linux/crc32.h>
+
+#include "ibm_emac_core.h"
+
+//#define MDIO_DEBUG(fmt) printk fmt
+#define MDIO_DEBUG(fmt)
+
+//#define LINK_DEBUG(fmt) printk fmt
+#define LINK_DEBUG(fmt)
+
+//#define PKT_DEBUG(fmt) printk fmt
+#define PKT_DEBUG(fmt)
+
+#define DRV_NAME        "emac"
+#define DRV_VERSION     "2.0"
+#define DRV_AUTHOR      "Benjamin Herrenschmidt <benh@kernel.crashing.org>"
+#define DRV_DESC        "IBM EMAC Ethernet driver"
+
+/*
+ * When mdio_idx >= 0, contains a list of emac ocp_devs
+ * that have had their initialization deferred until the
+ * common MDIO controller has been initialized.
+ */
+LIST_HEAD(emac_init_list);
+
+MODULE_AUTHOR(DRV_AUTHOR);
+MODULE_DESCRIPTION(DRV_DESC);
+MODULE_LICENSE("GPL");
+
+static int skb_res = SKB_RES;
+module_param(skb_res, int, 0444);
+MODULE_PARM_DESC(skb_res, "Amount of data to reserve on skb buffs\n"
+                "The 405 handles a misaligned IP header fine but\n"
+                "this can help if you are routing to a tunnel or a\n"
+                "device that needs aligned data. 0..2");
+
+#define RGMII_PRIV(ocpdev) ((struct ibm_ocp_rgmii*)ocp_get_drvdata(ocpdev))
+
+static unsigned int rgmii_enable[] =
+    { RGMII_RTBI, RGMII_RGMII, RGMII_TBI, RGMII_GMII };
+
+static unsigned int rgmii_speed_mask[] = { 0,
+       0,
+       RGMII_MII2_SPDMASK,
+       RGMII_MII3_SPDMASK
+};
+
+static unsigned int rgmii_speed100[] = { 0,
+       0,
+       RGMII_MII2_100MB,
+       RGMII_MII3_100MB
+};
+
+static unsigned int rgmii_speed1000[] = { 0,
+       0,
+       RGMII_MII2_1000MB,
+       RGMII_MII3_1000MB
+};
+
+#define ZMII_PRIV(ocpdev) ((struct ibm_ocp_zmii*)ocp_get_drvdata(ocpdev))
+
+static unsigned int zmii_enable[][4] = {
+       {ZMII_SMII0, ZMII_RMII0, ZMII_MII0,
+        ~(ZMII_MDI1 | ZMII_MDI2 | ZMII_MDI3)},
+       {ZMII_SMII1, ZMII_RMII1, ZMII_MII1,
+        ~(ZMII_MDI0 | ZMII_MDI2 | ZMII_MDI3)},
+       {ZMII_SMII2, ZMII_RMII2, ZMII_MII2,
+        ~(ZMII_MDI0 | ZMII_MDI1 | ZMII_MDI3)},
+       {ZMII_SMII3, ZMII_RMII3, ZMII_MII3, ~(ZMII_MDI0 | ZMII_MDI1 | ZMII_MDI2)}
+};
+static unsigned int mdi_enable[] =
+    { ZMII_MDI0, ZMII_MDI1, ZMII_MDI2, ZMII_MDI3 };
+
+static unsigned int zmii_speed = 0x0;
+static unsigned int zmii_speed100[] = { ZMII_MII0_100MB, ZMII_MII1_100MB };
+
+/* Since multiple EMACs share MDIO lines in various ways, we need
+ * to avoid re-using the same PHY ID in cases where the arch didn't
+ * setup precise phy_map entries
+ */
+static u32 busy_phy_map = 0;
+
+/* If EMACs share a common MDIO device, this points to it */
+static struct net_device *mdio_ndev = NULL;
+
+struct emac_def_dev {
+       struct list_head link;
+       struct ocp_device *ocpdev;
+       struct ibm_ocp_mal *mal;
+};
+
+static struct net_device_stats *emac_stats(struct net_device *dev)
+{
+       struct ocp_enet_private *fep = dev->priv;
+       return &fep->stats;
+};
+
+static int
+emac_init_rgmii(struct ocp_device *rgmii_dev, int input, int phy_mode)
+{
+       struct ibm_ocp_rgmii *rgmii = RGMII_PRIV(rgmii_dev);
+       const char *mode_name[] = { "RTBI", "RGMII", "TBI", "GMII" };
+       int mode = -1;
+
+       if (!rgmii) {
+               rgmii = kmalloc(sizeof(struct ibm_ocp_rgmii), GFP_KERNEL);
+
+               if (rgmii == NULL) {
+                       printk(KERN_ERR
+                              "rgmii%d: Out of memory allocating RGMII structure!\n",
+                              rgmii_dev->def->index);
+                       return -ENOMEM;
+               }
+
+               memset(rgmii, 0, sizeof(*rgmii));
+
+               rgmii->base =
+                   (struct rgmii_regs *)ioremap(rgmii_dev->def->paddr,
+                                                sizeof(*rgmii->base));
+               if (rgmii->base == NULL) {
+                       printk(KERN_ERR
+                              "rgmii%d: Cannot ioremap bridge registers!\n",
+                              rgmii_dev->def->index);
+
+                       kfree(rgmii);
+                       return -ENOMEM;
+               }
+               ocp_set_drvdata(rgmii_dev, rgmii);
+       }
+
+       if (phy_mode) {
+               switch (phy_mode) {
+               case PHY_MODE_GMII:
+                       mode = GMII;
+                       break;
+               case PHY_MODE_TBI:
+                       mode = TBI;
+                       break;
+               case PHY_MODE_RTBI:
+                       mode = RTBI;
+                       break;
+               case PHY_MODE_RGMII:
+               default:
+                       mode = RGMII;
+               }
+               rgmii->base->fer &= ~RGMII_FER_MASK(input);
+               rgmii->base->fer |= rgmii_enable[mode] << (4 * input);
+       } else {
+               switch ((rgmii->base->fer & RGMII_FER_MASK(input)) >> (4 *
+                                                                      input)) {
+               case RGMII_RTBI:
+                       mode = RTBI;
+                       break;
+               case RGMII_RGMII:
+                       mode = RGMII;
+                       break;
+               case RGMII_TBI:
+                       mode = TBI;
+                       break;
+               case RGMII_GMII:
+                       mode = GMII;
+               }
+       }
+
+       /* Set mode to RGMII if nothing valid is detected */
+       if (mode < 0)
+               mode = RGMII;
+
+       printk(KERN_NOTICE "rgmii%d: input %d in %s mode\n",
+              rgmii_dev->def->index, input, mode_name[mode]);
+
+       rgmii->mode[input] = mode;
+       rgmii->users++;
+
+       return 0;
+}
+
+static void
+emac_rgmii_port_speed(struct ocp_device *ocpdev, int input, int speed)
+{
+       struct ibm_ocp_rgmii *rgmii = RGMII_PRIV(ocpdev);
+       unsigned int rgmii_speed;
+
+       rgmii_speed = in_be32(&rgmii->base->ssr);
+
+       rgmii_speed &= ~rgmii_speed_mask[input];
+
+       if (speed == 1000)
+               rgmii_speed |= rgmii_speed1000[input];
+       else if (speed == 100)
+               rgmii_speed |= rgmii_speed100[input];
+
+       out_be32(&rgmii->base->ssr, rgmii_speed);
+}
+
+static void emac_close_rgmii(struct ocp_device *ocpdev)
+{
+       struct ibm_ocp_rgmii *rgmii = RGMII_PRIV(ocpdev);
+       BUG_ON(!rgmii || rgmii->users == 0);
+
+       if (!--rgmii->users) {
+               ocp_set_drvdata(ocpdev, NULL);
+               iounmap((void *)rgmii->base);
+               kfree(rgmii);
+       }
+}
+
+static int emac_init_zmii(struct ocp_device *zmii_dev, int input, int phy_mode)
+{
+       struct ibm_ocp_zmii *zmii = ZMII_PRIV(zmii_dev);
+       const char *mode_name[] = { "SMII", "RMII", "MII" };
+       int mode = -1;
+
+       if (!zmii) {
+               zmii = kmalloc(sizeof(struct ibm_ocp_zmii), GFP_KERNEL);
+               if (zmii == NULL) {
+                       printk(KERN_ERR
+                              "zmii%d: Out of memory allocating ZMII structure!\n",
+                              zmii_dev->def->index);
+                       return -ENOMEM;
+               }
+               memset(zmii, 0, sizeof(*zmii));
+
+               zmii->base =
+                   (struct zmii_regs *)ioremap(zmii_dev->def->paddr,
+                                               sizeof(*zmii->base));
+               if (zmii->base == NULL) {
+                       printk(KERN_ERR
+                              "zmii%d: Cannot ioremap bridge registers!\n",
+                              zmii_dev->def->index);
+
+                       kfree(zmii);
+                       return -ENOMEM;
+               }
+               ocp_set_drvdata(zmii_dev, zmii);
+       }
+
+       if (phy_mode) {
+               switch (phy_mode) {
+               case PHY_MODE_MII:
+                       mode = MII;
+                       break;
+               case PHY_MODE_RMII:
+                       mode = RMII;
+                       break;
+               case PHY_MODE_SMII:
+               default:
+                       mode = SMII;
+               }
+               zmii->base->fer &= ~ZMII_FER_MASK(input);
+               zmii->base->fer |= zmii_enable[input][mode];
+       } else {
+               switch ((zmii->base->fer & ZMII_FER_MASK(input)) << (4 * input)) {
+               case ZMII_MII0:
+                       mode = MII;
+                       break;
+               case ZMII_RMII0:
+                       mode = RMII;
+                       break;
+               case ZMII_SMII0:
+                       mode = SMII;
+               }
+       }
+
+       /* Set mode to SMII if nothing valid is detected */
+       if (mode < 0)
+               mode = SMII;
+
+       printk(KERN_NOTICE "zmii%d: input %d in %s mode\n",
+              zmii_dev->def->index, input, mode_name[mode]);
+
+       zmii->mode[input] = mode;
+       zmii->users++;
+
+       return 0;
+}
+
+static void emac_enable_zmii_port(struct ocp_device *ocpdev, int input)
+{
+       u32 mask;
+       struct ibm_ocp_zmii *zmii = ZMII_PRIV(ocpdev);
+
+       mask = in_be32(&zmii->base->fer);
+       mask &= zmii_enable[input][MDI];        /* turn all non enabled MDI's off */
+       mask |= zmii_enable[input][zmii->mode[input]] | mdi_enable[input];
+       out_be32(&zmii->base->fer, mask);
+}
+
+static void
+emac_zmii_port_speed(struct ocp_device *ocpdev, int input, int speed)
+{
+       struct ibm_ocp_zmii *zmii = ZMII_PRIV(ocpdev);
+
+       if (speed == 100)
+               zmii_speed |= zmii_speed100[input];
+       else
+               zmii_speed &= ~zmii_speed100[input];
+
+       out_be32(&zmii->base->ssr, zmii_speed);
+}
+
+static void emac_close_zmii(struct ocp_device *ocpdev)
+{
+       struct ibm_ocp_zmii *zmii = ZMII_PRIV(ocpdev);
+       BUG_ON(!zmii || zmii->users == 0);
+
+       if (!--zmii->users) {
+               ocp_set_drvdata(ocpdev, NULL);
+               iounmap((void *)zmii->base);
+               kfree(zmii);
+       }
+}
+
+int emac_phy_read(struct net_device *dev, int mii_id, int reg)
+{
+       uint32_t stacr;
+       struct ocp_enet_private *fep = dev->priv;
+       emac_t *emacp = fep->emacp;
+
+       MDIO_DEBUG(("%s: phy_read, id: 0x%x, reg: 0x%x\n", dev->name, mii_id,
+                   reg));
+
+       /* Enable proper ZMII port */
+       if (fep->zmii_dev)
+               emac_enable_zmii_port(fep->zmii_dev, fep->zmii_input);
+
+       /* Use the EMAC that has the MDIO port */
+       if (fep->mdio_dev) {
+               dev = fep->mdio_dev;
+               fep = dev->priv;
+               emacp = fep->emacp;
+       }
+
+       udelay(MDIO_DELAY);
+
+       if ((in_be32(&emacp->em0stacr) & EMAC_STACR_OC) == 0) {
+               printk(KERN_WARNING "%s: PHY read timeout #1!\n", dev->name);
+               return -1;
+       }
+
+       /* Clear the speed bits and make a read request to the PHY */
+       stacr = ((EMAC_STACR_READ | (reg & 0x1f)) & ~EMAC_STACR_CLK_100MHZ);
+       stacr |= ((mii_id & 0x1F) << 5);
+
+       out_be32(&emacp->em0stacr, stacr);
+
+       udelay(MDIO_DELAY);
+       stacr = in_be32(&emacp->em0stacr);
+
+       if ((stacr & EMAC_STACR_OC) == 0) {
+               printk(KERN_WARNING "%s: PHY read timeout #2!\n", dev->name);
+               return -1;
+       }
+
+       /* Check for a read error */
+       if (stacr & EMAC_STACR_PHYE) {
+               MDIO_DEBUG(("EMAC MDIO PHY error !\n"));
+               return -1;
+       }
+
+       MDIO_DEBUG((" -> 0x%x\n", stacr >> 16));
+
+       return (stacr >> 16);
+}
+
+void emac_phy_write(struct net_device *dev, int mii_id, int reg, int data)
+{
+       uint32_t stacr;
+       struct ocp_enet_private *fep = dev->priv;
+       emac_t *emacp = fep->emacp;
+
+       MDIO_DEBUG(("%s phy_write, id: 0x%x, reg: 0x%x, data: 0x%x\n",
+                   dev->name, mii_id, reg, data));
+
+       /* Enable proper ZMII port */
+       if (fep->zmii_dev)
+               emac_enable_zmii_port(fep->zmii_dev, fep->zmii_input);
+
+       /* Use the EMAC that has the MDIO port */
+       if (fep->mdio_dev) {
+               dev = fep->mdio_dev;
+               fep = dev->priv;
+               emacp = fep->emacp;
+       }
+
+       udelay(MDIO_DELAY);
+
+       if ((in_be32(&emacp->em0stacr) & EMAC_STACR_OC) == 0) {
+               printk(KERN_WARNING "%s: PHY write timeout #2!\n", dev->name);
+               return;
+       }
+
+       /* Clear the speed bits and make a read request to the PHY */
+
+       stacr = ((EMAC_STACR_WRITE | (reg & 0x1f)) & ~EMAC_STACR_CLK_100MHZ);
+       stacr |= ((mii_id & 0x1f) << 5) | ((data & 0xffff) << 16);
+
+       out_be32(&emacp->em0stacr, stacr);
+
+       udelay(MDIO_DELAY);
+
+       if ((in_be32(&emacp->em0stacr) & EMAC_STACR_OC) == 0)
+               printk(KERN_WARNING "%s: PHY write timeout #2!\n", dev->name);
+
+       /* Check for a write error */
+       if ((stacr & EMAC_STACR_PHYE) != 0) {
+               MDIO_DEBUG(("EMAC MDIO PHY error !\n"));
+       }
+}
+
+static void emac_txeob_dev(void *param, u32 chanmask)
+{
+       struct net_device *dev = param;
+       struct ocp_enet_private *fep = dev->priv;
+       unsigned long flags;
+
+       spin_lock_irqsave(&fep->lock, flags);
+
+       PKT_DEBUG(("emac_txeob_dev() entry, tx_cnt: %d\n", fep->tx_cnt));
+
+       while (fep->tx_cnt &&
+              !(fep->tx_desc[fep->ack_slot].ctrl & MAL_TX_CTRL_READY)) {
+
+               if (fep->tx_desc[fep->ack_slot].ctrl & MAL_TX_CTRL_LAST) {
+                       /* Tell the system the transmit completed. */
+                       dma_unmap_single(&fep->ocpdev->dev,
+                                        fep->tx_desc[fep->ack_slot].data_ptr,
+                                        fep->tx_desc[fep->ack_slot].data_len,
+                                        DMA_TO_DEVICE);
+                       dev_kfree_skb_irq(fep->tx_skb[fep->ack_slot]);
+
+                       if (fep->tx_desc[fep->ack_slot].ctrl &
+                           (EMAC_TX_ST_EC | EMAC_TX_ST_MC | EMAC_TX_ST_SC))
+                               fep->stats.collisions++;
+               }
+
+               fep->tx_skb[fep->ack_slot] = (struct sk_buff *)NULL;
+               if (++fep->ack_slot == NUM_TX_BUFF)
+                       fep->ack_slot = 0;
+
+               fep->tx_cnt--;
+       }
+       if (fep->tx_cnt < NUM_TX_BUFF)
+               netif_wake_queue(dev);
+
+       PKT_DEBUG(("emac_txeob_dev() exit, tx_cnt: %d\n", fep->tx_cnt));
+
+       spin_unlock_irqrestore(&fep->lock, flags);
+}
+
+/*
+  Fill/Re-fill the rx chain with valid ctrl/ptrs.
+  This function will fill from rx_slot up to the parm end.
+  So to completely fill the chain pre-set rx_slot to 0 and
+  pass in an end of 0.
+ */
+static void emac_rx_fill(struct net_device *dev, int end)
+{
+       int i;
+       struct ocp_enet_private *fep = dev->priv;
+
+       i = fep->rx_slot;
+       do {
+               /* We don't want the 16 bytes skb_reserve done by dev_alloc_skb,
+                * it breaks our cache line alignement. However, we still allocate
+                * +16 so that we end up allocating the exact same size as
+                * dev_alloc_skb() would do.
+                * Also, because of the skb_res, the max DMA size we give to EMAC
+                * is slighly wrong, causing it to potentially DMA 2 more bytes
+                * from a broken/oversized packet. These 16 bytes will take care
+                * that we don't walk on somebody else toes with that.
+                */
+               fep->rx_skb[i] =
+                   alloc_skb(fep->rx_buffer_size + 16, GFP_ATOMIC);
+
+               if (fep->rx_skb[i] == NULL) {
+                       /* Keep rx_slot here, the next time clean/fill is called
+                        * we will try again before the MAL wraps back here
+                        * If the MAL tries to use this descriptor with
+                        * the EMPTY bit off it will cause the
+                        * rxde interrupt.  That is where we will
+                        * try again to allocate an sk_buff.
+                        */
+                       break;
+
+               }
+
+               if (skb_res)
+                       skb_reserve(fep->rx_skb[i], skb_res);
+
+               /* We must NOT dma_map_single the cache line right after the
+                * buffer, so we must crop our sync size to account for the
+                * reserved space
+                */
+               fep->rx_desc[i].data_ptr =
+                   (unsigned char *)dma_map_single(&fep->ocpdev->dev,
+                                                   (void *)fep->rx_skb[i]->
+                                                   data,
+                                                   fep->rx_buffer_size -
+                                                   skb_res, DMA_FROM_DEVICE);
+
+               /*
+                * Some 4xx implementations use the previously
+                * reserved bits in data_len to encode the MS
+                * 4-bits of a 36-bit physical address (ERPN)
+                * This must be initialized.
+                */
+               fep->rx_desc[i].data_len = 0;
+               fep->rx_desc[i].ctrl = MAL_RX_CTRL_EMPTY | MAL_RX_CTRL_INTR |
+                   (i == (NUM_RX_BUFF - 1) ? MAL_RX_CTRL_WRAP : 0);
+
+       } while ((i = (i + 1) % NUM_RX_BUFF) != end);
+
+       fep->rx_slot = i;
+}
+
+static void
+emac_rx_csum(struct net_device *dev, unsigned short ctrl, struct sk_buff *skb)
+{
+       struct ocp_enet_private *fep = dev->priv;
+
+       /* Exit if interface has no TAH engine */
+       if (!fep->tah_dev) {
+               skb->ip_summed = CHECKSUM_NONE;
+               return;
+       }
+
+       /* Check for TCP/UDP/IP csum error */
+       if (ctrl & EMAC_CSUM_VER_ERROR) {
+               /* Let the stack verify checksum errors */
+               skb->ip_summed = CHECKSUM_NONE;
+/*             adapter->hw_csum_err++; */
+       } else {
+               /* Csum is good */
+               skb->ip_summed = CHECKSUM_UNNECESSARY;
+/*             adapter->hw_csum_good++; */
+       }
+}
+
+static int emac_rx_clean(struct net_device *dev)
+{
+       int i, b, bnum, buf[6];
+       int error, frame_length;
+       struct ocp_enet_private *fep = dev->priv;
+       unsigned short ctrl;
+
+       i = fep->rx_slot;
+
+       PKT_DEBUG(("emac_rx_clean() entry, rx_slot: %d\n", fep->rx_slot));
+
+       do {
+               if (fep->rx_skb[i] == NULL)
+                       continue;       /*we have already handled the packet but haved failed to alloc */
+               /* 
+                  since rx_desc is in uncached mem we don't keep reading it directly 
+                  we pull out a local copy of ctrl and do the checks on the copy.
+                */
+               ctrl = fep->rx_desc[i].ctrl;
+               if (ctrl & MAL_RX_CTRL_EMPTY)
+                       break;  /*we don't have any more ready packets */
+
+               if (EMAC_IS_BAD_RX_PACKET(ctrl)) {
+                       fep->stats.rx_errors++;
+                       fep->stats.rx_dropped++;
+
+                       if (ctrl & EMAC_RX_ST_OE)
+                               fep->stats.rx_fifo_errors++;
+                       if (ctrl & EMAC_RX_ST_AE)
+                               fep->stats.rx_frame_errors++;
+                       if (ctrl & EMAC_RX_ST_BFCS)
+                               fep->stats.rx_crc_errors++;
+                       if (ctrl & (EMAC_RX_ST_RP | EMAC_RX_ST_PTL |
+                                   EMAC_RX_ST_ORE | EMAC_RX_ST_IRE))
+                               fep->stats.rx_length_errors++;
+               } else {
+                       if ((ctrl & (MAL_RX_CTRL_FIRST | MAL_RX_CTRL_LAST)) ==
+                           (MAL_RX_CTRL_FIRST | MAL_RX_CTRL_LAST)) {
+                               /* Single descriptor packet */
+                               emac_rx_csum(dev, ctrl, fep->rx_skb[i]);
+                               /* Send the skb up the chain. */
+                               frame_length = fep->rx_desc[i].data_len - 4;
+                               skb_put(fep->rx_skb[i], frame_length);
+                               fep->rx_skb[i]->dev = dev;
+                               fep->rx_skb[i]->protocol =
+                                   eth_type_trans(fep->rx_skb[i], dev);
+                               error = netif_rx(fep->rx_skb[i]);
+
+                               if ((error == NET_RX_DROP) ||
+                                   (error == NET_RX_BAD)) {
+                                       fep->stats.rx_dropped++;
+                               } else {
+                                       fep->stats.rx_packets++;
+                                       fep->stats.rx_bytes += frame_length;
+                               }
+                               fep->rx_skb[i] = NULL;
+                       } else {
+                               /* Multiple descriptor packet */
+                               if (ctrl & MAL_RX_CTRL_FIRST) {
+                                       if (fep->rx_desc[(i + 1) % NUM_RX_BUFF].
+                                           ctrl & MAL_RX_CTRL_EMPTY)
+                                               break;
+                                       bnum = 0;
+                                       buf[bnum] = i;
+                                       ++bnum;
+                                       continue;
+                               }
+                               if (((ctrl & MAL_RX_CTRL_FIRST) !=
+                                    MAL_RX_CTRL_FIRST) &&
+                                   ((ctrl & MAL_RX_CTRL_LAST) !=
+                                    MAL_RX_CTRL_LAST)) {
+                                       if (fep->rx_desc[(i + 1) %
+                                                        NUM_RX_BUFF].ctrl &
+                                           MAL_RX_CTRL_EMPTY) {
+                                               i = buf[0];
+                                               break;
+                                       }
+                                       buf[bnum] = i;
+                                       ++bnum;
+                                       continue;
+                               }
+                               if (ctrl & MAL_RX_CTRL_LAST) {
+                                       buf[bnum] = i;
+                                       ++bnum;
+                                       skb_put(fep->rx_skb[buf[0]],
+                                               fep->rx_desc[buf[0]].data_len);
+                                       for (b = 1; b < bnum; b++) {
+                                               /*
+                                                * MAL is braindead, we need
+                                                * to copy the remainder
+                                                * of the packet from the
+                                                * latter descriptor buffers
+                                                * to the first skb. Then
+                                                * dispose of the source
+                                                * skbs.
+                                                *
+                                                * Once the stack is fixed
+                                                * to handle frags on most
+                                                * protocols we can generate
+                                                * a fragmented skb with
+                                                * no copies.
+                                                */
+                                               memcpy(fep->rx_skb[buf[0]]->
+                                                      data +
+                                                      fep->rx_skb[buf[0]]->len,
+                                                      fep->rx_skb[buf[b]]->
+                                                      data,
+                                                      fep->rx_desc[buf[b]].
+                                                      data_len);
+                                               skb_put(fep->rx_skb[buf[0]],
+                                                       fep->rx_desc[buf[b]].
+                                                       data_len);
+                                               dma_unmap_single(&fep->ocpdev->
+                                                                dev,
+                                                                fep->
+                                                                rx_desc[buf
+                                                                        [b]].
+                                                                data_ptr,
+                                                                fep->
+                                                                rx_desc[buf
+                                                                        [b]].
+                                                                data_len,
+                                                                DMA_FROM_DEVICE);
+                                               dev_kfree_skb(fep->
+                                                             rx_skb[buf[b]]);
+                                       }
+                                       emac_rx_csum(dev, ctrl,
+                                                    fep->rx_skb[buf[0]]);
+
+                                       fep->rx_skb[buf[0]]->dev = dev;
+                                       fep->rx_skb[buf[0]]->protocol =
+                                           eth_type_trans(fep->rx_skb[buf[0]],
+                                                          dev);
+                                       error = netif_rx(fep->rx_skb[buf[0]]);
+
+                                       if ((error == NET_RX_DROP)
+                                           || (error == NET_RX_BAD)) {
+                                               fep->stats.rx_dropped++;
+                                       } else {
+                                               fep->stats.rx_packets++;
+                                               fep->stats.rx_bytes +=
+                                                   fep->rx_skb[buf[0]]->len;
+                                       }
+                                       for (b = 0; b < bnum; b++)
+                                               fep->rx_skb[buf[b]] = NULL;
+                               }
+                       }
+               }
+       } while ((i = (i + 1) % NUM_RX_BUFF) != fep->rx_slot);
+
+       PKT_DEBUG(("emac_rx_clean() exit, rx_slot: %d\n", fep->rx_slot));
+
+       return i;
+}
+
+static void emac_rxeob_dev(void *param, u32 chanmask)
+{
+       struct net_device *dev = param;
+       struct ocp_enet_private *fep = dev->priv;
+       unsigned long flags;
+       int n;
+
+       spin_lock_irqsave(&fep->lock, flags);
+       if ((n = emac_rx_clean(dev)) != fep->rx_slot)
+               emac_rx_fill(dev, n);
+       spin_unlock_irqrestore(&fep->lock, flags);
+}
+
+/*
+ * This interrupt should never occurr, we don't program
+ * the MAL for contiunous mode.
+ */
+static void emac_txde_dev(void *param, u32 chanmask)
+{
+       struct net_device *dev = param;
+       struct ocp_enet_private *fep = dev->priv;
+
+       printk(KERN_WARNING "%s: transmit descriptor error\n", dev->name);
+
+       emac_mac_dump(dev);
+       emac_mal_dump(dev);
+
+       /* Reenable the transmit channel */
+       mal_enable_tx_channels(fep->mal, fep->commac.tx_chan_mask);
+}
+
+/*
+ * This interrupt should be very rare at best.  This occurs when
+ * the hardware has a problem with the receive descriptors.  The manual
+ * states that it occurs when the hardware cannot the receive descriptor
+ * empty bit is not set.  The recovery mechanism will be to
+ * traverse through the descriptors, handle any that are marked to be
+ * handled and reinitialize each along the way.  At that point the driver
+ * will be restarted.
+ */
+static void emac_rxde_dev(void *param, u32 chanmask)
+{
+       struct net_device *dev = param;
+       struct ocp_enet_private *fep = dev->priv;
+       unsigned long flags;
+
+       if (net_ratelimit()) {
+               printk(KERN_WARNING "%s: receive descriptor error\n",
+                      fep->ndev->name);
+
+               emac_mac_dump(dev);
+               emac_mal_dump(dev);
+               emac_desc_dump(dev);
+       }
+
+       /* Disable RX channel */
+       spin_lock_irqsave(&fep->lock, flags);
+       mal_disable_rx_channels(fep->mal, fep->commac.rx_chan_mask);
+
+       /* For now, charge the error against all emacs */
+       fep->stats.rx_errors++;
+
+       /* so do we have any good packets still? */
+       emac_rx_clean(dev);
+
+       /* When the interface is restarted it resets processing to the
+        *  first descriptor in the table.
+        */
+
+       fep->rx_slot = 0;
+       emac_rx_fill(dev, 0);
+
+       set_mal_dcrn(fep->mal, DCRN_MALRXEOBISR, fep->commac.rx_chan_mask);
+       set_mal_dcrn(fep->mal, DCRN_MALRXDEIR, fep->commac.rx_chan_mask);
+
+       /* Reenable the receive channels */
+       mal_enable_rx_channels(fep->mal, fep->commac.rx_chan_mask);
+       spin_unlock_irqrestore(&fep->lock, flags);
+}
+
+static irqreturn_t
+emac_mac_irq(int irq, void *dev_instance, struct pt_regs *regs)
+{
+       struct net_device *dev = dev_instance;
+       struct ocp_enet_private *fep = dev->priv;
+       emac_t *emacp = fep->emacp;
+       unsigned long tmp_em0isr;
+
+       /* EMAC interrupt */
+       tmp_em0isr = in_be32(&emacp->em0isr);
+       if (tmp_em0isr & (EMAC_ISR_TE0 | EMAC_ISR_TE1)) {
+               /* This error is a hard transmit error - could retransmit */
+               fep->stats.tx_errors++;
+
+               /* Reenable the transmit channel */
+               mal_enable_tx_channels(fep->mal, fep->commac.tx_chan_mask);
+
+       } else {
+               fep->stats.rx_errors++;
+       }
+
+       if (tmp_em0isr & EMAC_ISR_RP)
+               fep->stats.rx_length_errors++;
+       if (tmp_em0isr & EMAC_ISR_ALE)
+               fep->stats.rx_frame_errors++;
+       if (tmp_em0isr & EMAC_ISR_BFCS)
+               fep->stats.rx_crc_errors++;
+       if (tmp_em0isr & EMAC_ISR_PTLE)
+               fep->stats.rx_length_errors++;
+       if (tmp_em0isr & EMAC_ISR_ORE)
+               fep->stats.rx_length_errors++;
+       if (tmp_em0isr & EMAC_ISR_TE0)
+               fep->stats.tx_aborted_errors++;
+
+       emac_err_dump(dev, tmp_em0isr);
+
+       out_be32(&emacp->em0isr, tmp_em0isr);
+
+       return IRQ_HANDLED;
+}
+
+static int emac_start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+       unsigned short ctrl;
+       unsigned long flags;
+       struct ocp_enet_private *fep = dev->priv;
+       emac_t *emacp = fep->emacp;
+       int len = skb->len;
+       unsigned int offset = 0, size, f, tx_slot_first;
+       unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
+
+       spin_lock_irqsave(&fep->lock, flags);
+
+       len -= skb->data_len;
+
+       if ((fep->tx_cnt + nr_frags + len / DESC_BUF_SIZE + 1) > NUM_TX_BUFF) {
+               PKT_DEBUG(("emac_start_xmit() stopping queue\n"));
+               netif_stop_queue(dev);
+               spin_unlock_irqrestore(&fep->lock, flags);
+               restore_flags(flags);
+               return -EBUSY;
+       }
+
+       tx_slot_first = fep->tx_slot;
+
+       while (len) {
+               size = min(len, DESC_BUF_SIZE);
+
+               fep->tx_desc[fep->tx_slot].data_len = (short)size;
+               fep->tx_desc[fep->tx_slot].data_ptr =
+                   (unsigned char *)dma_map_single(&fep->ocpdev->dev,
+                                                   (void *)((unsigned int)skb->
+                                                            data + offset),
+                                                   size, DMA_TO_DEVICE);
+
+               ctrl = EMAC_TX_CTRL_DFLT;
+               if (fep->tx_slot != tx_slot_first)
+                       ctrl |= MAL_TX_CTRL_READY;
+               if ((NUM_TX_BUFF - 1) == fep->tx_slot)
+                       ctrl |= MAL_TX_CTRL_WRAP;
+               if (!nr_frags && (len == size)) {
+                       ctrl |= MAL_TX_CTRL_LAST;
+                       fep->tx_skb[fep->tx_slot] = skb;
+               }
+               if (skb->ip_summed == CHECKSUM_HW)
+                       ctrl |= EMAC_TX_CTRL_TAH_CSUM;
+
+               fep->tx_desc[fep->tx_slot].ctrl = ctrl;
+
+               len -= size;
+               offset += size;
+
+               /* Bump tx count */
+               if (++fep->tx_cnt == NUM_TX_BUFF)
+                       netif_stop_queue(dev);
+
+               /* Next descriptor */
+               if (++fep->tx_slot == NUM_TX_BUFF)
+                       fep->tx_slot = 0;
+       }
+
+       for (f = 0; f < nr_frags; f++) {
+               struct skb_frag_struct *frag;
+
+               frag = &skb_shinfo(skb)->frags[f];
+               len = frag->size;
+               offset = 0;
+
+               while (len) {
+                       size = min(len, DESC_BUF_SIZE);
+
+                       dma_map_page(&fep->ocpdev->dev,
+                                    frag->page,
+                                    frag->page_offset + offset,
+                                    size, DMA_TO_DEVICE);
+
+                       ctrl = EMAC_TX_CTRL_DFLT | MAL_TX_CTRL_READY;
+                       if ((NUM_TX_BUFF - 1) == fep->tx_slot)
+                               ctrl |= MAL_TX_CTRL_WRAP;
+                       if ((f == (nr_frags - 1)) && (len == size)) {
+                               ctrl |= MAL_TX_CTRL_LAST;
+                               fep->tx_skb[fep->tx_slot] = skb;
+                       }
+
+                       if (skb->ip_summed == CHECKSUM_HW)
+                               ctrl |= EMAC_TX_CTRL_TAH_CSUM;
+
+                       fep->tx_desc[fep->tx_slot].data_len = (short)size;
+                       fep->tx_desc[fep->tx_slot].data_ptr =
+                           (char *)((page_to_pfn(frag->page) << PAGE_SHIFT) +
+                                    frag->page_offset + offset);
+                       fep->tx_desc[fep->tx_slot].ctrl = ctrl;
+
+                       len -= size;
+                       offset += size;
+
+                       /* Bump tx count */
+                       if (++fep->tx_cnt == NUM_TX_BUFF)
+                               netif_stop_queue(dev);
+
+                       /* Next descriptor */
+                       if (++fep->tx_slot == NUM_TX_BUFF)
+                               fep->tx_slot = 0;
+               }
+       }
+
+       /*
+        * Deferred set READY on first descriptor of packet to
+        * avoid TX MAL race.
+        */
+       fep->tx_desc[tx_slot_first].ctrl |= MAL_TX_CTRL_READY;
+
+       /* Send the packet out. */
+       out_be32(&emacp->em0tmr0, EMAC_TMR0_XMIT);
+
+       fep->stats.tx_packets++;
+       fep->stats.tx_bytes += skb->len;
+
+       PKT_DEBUG(("emac_start_xmit() exitn"));
+
+       spin_unlock_irqrestore(&fep->lock, flags);
+
+       return 0;
+}
+
+static int emac_adjust_to_link(struct ocp_enet_private *fep)
+{
+       emac_t *emacp = fep->emacp;
+       struct ibm_ocp_rgmii *rgmii;
+       unsigned long mode_reg;
+       int full_duplex, speed;
+
+       full_duplex = 0;
+       speed = SPEED_10;
+
+       /* set mode register 1 defaults */
+       mode_reg = EMAC_M1_DEFAULT;
+
+       /* Read link mode on PHY */
+       if (fep->phy_mii.def->ops->read_link(&fep->phy_mii) == 0) {
+               /* If an error occurred, we don't deal with it yet */
+               full_duplex = (fep->phy_mii.duplex == DUPLEX_FULL);
+               speed = fep->phy_mii.speed;
+       }
+
+       if (fep->rgmii_dev)
+               rgmii = RGMII_PRIV(fep->rgmii_dev);
+
+       /* set speed (default is 10Mb) */
+       switch (speed) {
+       case SPEED_1000:
+               mode_reg |= EMAC_M1_JUMBO_ENABLE | EMAC_M1_RFS_16K;
+               if ((rgmii->mode[fep->rgmii_input] == RTBI)
+                   || (rgmii->mode[fep->rgmii_input] == TBI))
+                       mode_reg |= EMAC_M1_MF_1000GPCS;
+               else
+                       mode_reg |= EMAC_M1_MF_1000MBPS;
+               if (fep->rgmii_dev)
+                       emac_rgmii_port_speed(fep->rgmii_dev, fep->rgmii_input,
+                                             1000);
+               break;
+       case SPEED_100:
+               mode_reg |= EMAC_M1_MF_100MBPS | EMAC_M1_RFS_4K;
+               if (fep->rgmii_dev)
+                       emac_rgmii_port_speed(fep->rgmii_dev, fep->rgmii_input,
+                                             100);
+               if (fep->zmii_dev)
+                       emac_zmii_port_speed(fep->zmii_dev, fep->zmii_input,
+                                            100);
+               break;
+       case SPEED_10:
+       default:
+               mode_reg = (mode_reg & ~EMAC_M1_MF_100MBPS) | EMAC_M1_RFS_4K;
+               if (fep->rgmii_dev)
+                       emac_rgmii_port_speed(fep->rgmii_dev, fep->rgmii_input,
+                                             10);
+               if (fep->zmii_dev)
+                       emac_zmii_port_speed(fep->zmii_dev, fep->zmii_input,
+                                            10);
+       }
+
+       if (full_duplex)
+               mode_reg |= EMAC_M1_FDE | EMAC_M1_EIFC | EMAC_M1_IST;
+       else
+               mode_reg &= ~(EMAC_M1_FDE | EMAC_M1_EIFC | EMAC_M1_ILE);
+
+       LINK_DEBUG(("%s: adjust to link, speed: %d, duplex: %d, opened: %d\n",
+                   fep->ndev->name, speed, full_duplex, fep->opened));
+
+       printk(KERN_INFO "%s: Speed: %d, %s duplex.\n",
+              fep->ndev->name, speed, full_duplex ? "Full" : "Half");
+       if (fep->opened)
+               out_be32(&emacp->em0mr1, mode_reg);
+
+       return 0;
+}
+
+static int emac_set_mac_address(struct net_device *ndev, void *p)
+{
+       struct ocp_enet_private *fep = ndev->priv;
+       emac_t *emacp = fep->emacp;
+       struct sockaddr *addr = p;
+
+       if (!is_valid_ether_addr(addr->sa_data))
+               return -EADDRNOTAVAIL;
+
+       memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
+
+       /* set the high address */
+       out_be32(&emacp->em0iahr,
+                (fep->ndev->dev_addr[0] << 8) | fep->ndev->dev_addr[1]);
+
+       /* set the low address */
+       out_be32(&emacp->em0ialr,
+                (fep->ndev->dev_addr[2] << 24) | (fep->ndev->dev_addr[3] << 16)
+                | (fep->ndev->dev_addr[4] << 8) | fep->ndev->dev_addr[5]);
+
+       return 0;
+}
+
+static int emac_change_mtu(struct net_device *dev, int new_mtu)
+{
+       struct ocp_enet_private *fep = dev->priv;
+       int old_mtu = dev->mtu;
+       emac_t *emacp = fep->emacp;
+       u32 em0mr0;
+       int i, full;
+       unsigned long flags;
+
+       if ((new_mtu < EMAC_MIN_MTU) || (new_mtu > EMAC_MAX_MTU)) {
+               printk(KERN_ERR
+                      "emac: Invalid MTU setting, MTU must be between %d and %d\n",
+                      EMAC_MIN_MTU, EMAC_MAX_MTU);
+               return -EINVAL;
+       }
+
+       if (old_mtu != new_mtu && netif_running(dev)) {
+               /* Stop rx engine */
+               em0mr0 = in_be32(&emacp->em0mr0);
+               out_be32(&emacp->em0mr0, em0mr0 & ~EMAC_M0_RXE);
+
+               /* Wait for descriptors to be empty */
+               do {
+                       full = 0;
+                       for (i = 0; i < NUM_RX_BUFF; i++)
+                               if (!(fep->rx_desc[i].ctrl & MAL_RX_CTRL_EMPTY)) {
+                                       printk(KERN_NOTICE
+                                              "emac: RX ring is still full\n");
+                                       full = 1;
+                               }
+               } while (full);
+
+               spin_lock_irqsave(&fep->lock, flags);
+
+               mal_disable_rx_channels(fep->mal, fep->commac.rx_chan_mask);
+
+               /* Destroy all old rx skbs */
+               for (i = 0; i < NUM_RX_BUFF; i++) {
+                       dma_unmap_single(&fep->ocpdev->dev,
+                                        fep->rx_desc[i].data_ptr,
+                                        fep->rx_desc[i].data_len,
+                                        DMA_FROM_DEVICE);
+                       dev_kfree_skb(fep->rx_skb[i]);
+                       fep->rx_skb[i] = NULL;
+               }
+
+               /* Set new rx_buffer_size and advertise new mtu */
+               fep->rx_buffer_size =
+                   new_mtu + ENET_HEADER_SIZE + ENET_FCS_SIZE;
+               dev->mtu = new_mtu;
+
+               /* Re-init rx skbs */
+               fep->rx_slot = 0;
+               emac_rx_fill(dev, 0);
+
+               /* Restart the rx engine */
+               mal_enable_rx_channels(fep->mal, fep->commac.rx_chan_mask);
+               out_be32(&emacp->em0mr0, em0mr0 | EMAC_M0_RXE);
+
+               spin_unlock_irqrestore(&fep->lock, flags);
+       }
+
+       return 0;
+}
+
+static void __emac_set_multicast_list(struct net_device *dev)
+{
+       struct ocp_enet_private *fep = dev->priv;
+       emac_t *emacp = fep->emacp;
+       u32 rmr = in_be32(&emacp->em0rmr);
+
+       /* First clear all special bits, they can be set later */
+       rmr &= ~(EMAC_RMR_PME | EMAC_RMR_PMME | EMAC_RMR_MAE);
+
+       if (dev->flags & IFF_PROMISC) {
+               rmr |= EMAC_RMR_PME;
+       } else if (dev->flags & IFF_ALLMULTI || 32 < dev->mc_count) {
+               /*
+                * Must be setting up to use multicast
+                * Now check for promiscuous multicast
+                */
+               rmr |= EMAC_RMR_PMME;
+       } else if (dev->flags & IFF_MULTICAST && 0 < dev->mc_count) {
+               unsigned short em0gaht[4] = { 0, 0, 0, 0 };
+               struct dev_mc_list *dmi;
+
+               /* Need to hash on the multicast address. */
+               for (dmi = dev->mc_list; dmi; dmi = dmi->next) {
+                       unsigned long mc_crc;
+                       unsigned int bit_number;
+
+                       mc_crc = ether_crc(6, (char *)dmi->dmi_addr);
+                       bit_number = 63 - (mc_crc >> 26);       /* MSB: 0 LSB: 63 */
+                       em0gaht[bit_number >> 4] |=
+                           0x8000 >> (bit_number & 0x0f);
+               }
+               emacp->em0gaht1 = em0gaht[0];
+               emacp->em0gaht2 = em0gaht[1];
+               emacp->em0gaht3 = em0gaht[2];
+               emacp->em0gaht4 = em0gaht[3];
+
+               /* Turn on multicast addressing */
+               rmr |= EMAC_RMR_MAE;
+       }
+       out_be32(&emacp->em0rmr, rmr);
+}
+
+static int emac_init_tah(struct ocp_enet_private *fep)
+{
+       tah_t *tahp;
+
+       /* Initialize TAH and enable checksum verification */
+       tahp = (tah_t *) ioremap(fep->tah_dev->def->paddr, sizeof(*tahp));
+
+       if (tahp == NULL) {
+               printk(KERN_ERR "tah%d: Cannot ioremap TAH registers!\n",
+                      fep->tah_dev->def->index);
+
+               return -ENOMEM;
+       }
+
+       out_be32(&tahp->tah_mr, TAH_MR_SR);
+
+       /* wait for reset to complete */
+       while (in_be32(&tahp->tah_mr) & TAH_MR_SR) ;
+
+       /* 10KB TAH TX FIFO accomodates the max MTU of 9000 */
+       out_be32(&tahp->tah_mr,
+                TAH_MR_CVR | TAH_MR_ST_768 | TAH_MR_TFS_10KB | TAH_MR_DTFP |
+                TAH_MR_DIG);
+
+       iounmap(&tahp);
+
+       return 0;
+}
+
+static void emac_init_rings(struct net_device *dev)
+{
+       struct ocp_enet_private *ep = dev->priv;
+       int loop;
+
+       ep->tx_desc = (struct mal_descriptor *)((char *)ep->mal->tx_virt_addr +
+                                               (ep->mal_tx_chan *
+                                                MAL_DT_ALIGN));
+       ep->rx_desc =
+           (struct mal_descriptor *)((char *)ep->mal->rx_virt_addr +
+                                     (ep->mal_rx_chan * MAL_DT_ALIGN));
+
+       /* Fill in the transmit descriptor ring. */
+       for (loop = 0; loop < NUM_TX_BUFF; loop++) {
+               if (ep->tx_skb[loop]) {
+                       dma_unmap_single(&ep->ocpdev->dev,
+                                        ep->tx_desc[loop].data_ptr,
+                                        ep->tx_desc[loop].data_len,
+                                        DMA_TO_DEVICE);
+                       dev_kfree_skb_irq(ep->tx_skb[loop]);
+               }
+               ep->tx_skb[loop] = NULL;
+               ep->tx_desc[loop].ctrl = 0;
+               ep->tx_desc[loop].data_len = 0;
+               ep->tx_desc[loop].data_ptr = NULL;
+       }
+       ep->tx_desc[loop - 1].ctrl |= MAL_TX_CTRL_WRAP;
+
+       /* Format the receive descriptor ring. */
+       ep->rx_slot = 0;
+       /* Default is MTU=1500 + Ethernet overhead */
+       ep->rx_buffer_size = ENET_DEF_BUF_SIZE;
+       emac_rx_fill(dev, 0);
+       if (ep->rx_slot != 0) {
+               printk(KERN_ERR
+                      "%s: Not enough mem for RxChain durning Open?\n",
+                      dev->name);
+               /*We couldn't fill the ring at startup?
+                *We could clean up and fail to open but right now we will try to
+                *carry on. It may be a sign of a bad NUM_RX_BUFF value
+                */
+       }
+
+       ep->tx_cnt = 0;
+       ep->tx_slot = 0;
+       ep->ack_slot = 0;
+}
+
+static void emac_reset_configure(struct ocp_enet_private *fep)
+{
+       emac_t *emacp = fep->emacp;
+       int i;
+
+       mal_disable_tx_channels(fep->mal, fep->commac.tx_chan_mask);
+       mal_disable_rx_channels(fep->mal, fep->commac.rx_chan_mask);
+
+       /*
+        * Check for a link, some PHYs don't provide a clock if
+        * no link is present.  Some EMACs will not come out of
+        * soft reset without a PHY clock present.
+        */
+       if (fep->phy_mii.def->ops->poll_link(&fep->phy_mii)) {
+               /* Reset the EMAC */
+               out_be32(&emacp->em0mr0, EMAC_M0_SRST);
+               udelay(20);
+               for (i = 0; i < 100; i++) {
+                       if ((in_be32(&emacp->em0mr0) & EMAC_M0_SRST) == 0)
+                               break;
+                       udelay(10);
+               }
+
+               if (i >= 100) {
+                       printk(KERN_ERR "%s: Cannot reset EMAC\n",
+                              fep->ndev->name);
+                       return;
+               }
+       }
+
+       /* Switch IRQs off for now */
+       out_be32(&emacp->em0iser, 0);
+
+       /* Configure MAL rx channel */
+       mal_set_rcbs(fep->mal, fep->mal_rx_chan, DESC_BUF_SIZE_REG);
+
+       /* set the high address */
+       out_be32(&emacp->em0iahr,
+                (fep->ndev->dev_addr[0] << 8) | fep->ndev->dev_addr[1]);
+
+       /* set the low address */
+       out_be32(&emacp->em0ialr,
+                (fep->ndev->dev_addr[2] << 24) | (fep->ndev->dev_addr[3] << 16)
+                | (fep->ndev->dev_addr[4] << 8) | fep->ndev->dev_addr[5]);
+
+       /* Adjust to link */
+       if (netif_carrier_ok(fep->ndev))
+               emac_adjust_to_link(fep);
+
+       /* enable broadcast/individual address and RX FIFO defaults */
+       out_be32(&emacp->em0rmr, EMAC_RMR_DEFAULT);
+
+       /* set transmit request threshold register */
+       out_be32(&emacp->em0trtr, EMAC_TRTR_DEFAULT);
+
+       /* Reconfigure multicast */
+       __emac_set_multicast_list(fep->ndev);
+
+       /* Set receiver/transmitter defaults */
+       out_be32(&emacp->em0rwmr, EMAC_RWMR_DEFAULT);
+       out_be32(&emacp->em0tmr0, EMAC_TMR0_DEFAULT);
+       out_be32(&emacp->em0tmr1, EMAC_TMR1_DEFAULT);
+
+       /* set frame gap */
+       out_be32(&emacp->em0ipgvr, CONFIG_IBM_EMAC_FGAP);
+
+       /* Init ring buffers */
+       emac_init_rings(fep->ndev);
+}
+
+static void emac_kick(struct ocp_enet_private *fep)
+{
+       emac_t *emacp = fep->emacp;
+       unsigned long emac_ier;
+
+       emac_ier = EMAC_ISR_PP | EMAC_ISR_BP | EMAC_ISR_RP |
+           EMAC_ISR_SE | EMAC_ISR_PTLE | EMAC_ISR_ALE |
+           EMAC_ISR_BFCS | EMAC_ISR_ORE | EMAC_ISR_IRE;
+
+       out_be32(&emacp->em0iser, emac_ier);
+
+       /* enable all MAL transmit and receive channels */
+       mal_enable_tx_channels(fep->mal, fep->commac.tx_chan_mask);
+       mal_enable_rx_channels(fep->mal, fep->commac.rx_chan_mask);
+
+       /* set transmit and receive enable */
+       out_be32(&emacp->em0mr0, EMAC_M0_TXE | EMAC_M0_RXE);
+}
+
+static void
+emac_start_link(struct ocp_enet_private *fep, struct ethtool_cmd *ep)
+{
+       u32 advertise;
+       int autoneg;
+       int forced_speed;
+       int forced_duplex;
+
+       /* Default advertise */
+       advertise = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
+           ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full |
+           ADVERTISED_1000baseT_Half | ADVERTISED_1000baseT_Full;
+       autoneg = fep->want_autoneg;
+       forced_speed = fep->phy_mii.speed;
+       forced_duplex = fep->phy_mii.duplex;
+
+       /* Setup link parameters */
+       if (ep) {
+               if (ep->autoneg == AUTONEG_ENABLE) {
+                       advertise = ep->advertising;
+                       autoneg = 1;
+               } else {
+                       autoneg = 0;
+                       forced_speed = ep->speed;
+                       forced_duplex = ep->duplex;
+               }
+       }
+
+       /* Configure PHY & start aneg */
+       fep->want_autoneg = autoneg;
+       if (autoneg) {
+               LINK_DEBUG(("%s: start link aneg, advertise: 0x%x\n",
+                           fep->ndev->name, advertise));
+               fep->phy_mii.def->ops->setup_aneg(&fep->phy_mii, advertise);
+       } else {
+               LINK_DEBUG(("%s: start link forced, speed: %d, duplex: %d\n",
+                           fep->ndev->name, forced_speed, forced_duplex));
+               fep->phy_mii.def->ops->setup_forced(&fep->phy_mii, forced_speed,
+                                                   forced_duplex);
+       }
+       fep->timer_ticks = 0;
+       mod_timer(&fep->link_timer, jiffies + HZ);
+}
+
+static void emac_link_timer(unsigned long data)
+{
+       struct ocp_enet_private *fep = (struct ocp_enet_private *)data;
+       int link;
+
+       if (fep->going_away)
+               return;
+
+       spin_lock_irq(&fep->lock);
+
+       link = fep->phy_mii.def->ops->poll_link(&fep->phy_mii);
+       LINK_DEBUG(("%s: poll_link: %d\n", fep->ndev->name, link));
+
+       if (link == netif_carrier_ok(fep->ndev)) {
+               if (!link && fep->want_autoneg && (++fep->timer_ticks) > 10)
+                       emac_start_link(fep, NULL);
+               goto out;
+       }
+       printk(KERN_INFO "%s: Link is %s\n", fep->ndev->name,
+              link ? "Up" : "Down");
+       if (link) {
+               netif_carrier_on(fep->ndev);
+               /* Chip needs a full reset on config change. That sucks, so I
+                * should ultimately move that to some tasklet to limit
+                * latency peaks caused by this code
+                */
+               emac_reset_configure(fep);
+               if (fep->opened)
+                       emac_kick(fep);
+       } else {
+               fep->timer_ticks = 0;
+               netif_carrier_off(fep->ndev);
+       }
+      out:
+       mod_timer(&fep->link_timer, jiffies + HZ);
+       spin_unlock_irq(&fep->lock);
+}
+
+static void emac_set_multicast_list(struct net_device *dev)
+{
+       struct ocp_enet_private *fep = dev->priv;
+
+       spin_lock_irq(&fep->lock);
+       __emac_set_multicast_list(dev);
+       spin_unlock_irq(&fep->lock);
+}
+
+static int emac_get_settings(struct net_device *ndev, struct ethtool_cmd *cmd)
+{
+       struct ocp_enet_private *fep = ndev->priv;
+
+       cmd->supported = fep->phy_mii.def->features;
+       cmd->port = PORT_MII;
+       cmd->transceiver = XCVR_EXTERNAL;
+       cmd->phy_address = fep->mii_phy_addr;
+       spin_lock_irq(&fep->lock);
+       cmd->autoneg = fep->want_autoneg;
+       cmd->speed = fep->phy_mii.speed;
+       cmd->duplex = fep->phy_mii.duplex;
+       spin_unlock_irq(&fep->lock);
+       return 0;
+}
+
+static int emac_set_settings(struct net_device *ndev, struct ethtool_cmd *cmd)
+{
+       struct ocp_enet_private *fep = ndev->priv;
+       unsigned long features = fep->phy_mii.def->features;
+
+       if (!capable(CAP_NET_ADMIN))
+               return -EPERM;
+
+       if (cmd->autoneg != AUTONEG_ENABLE && cmd->autoneg != AUTONEG_DISABLE)
+               return -EINVAL;
+       if (cmd->autoneg == AUTONEG_ENABLE && cmd->advertising == 0)
+               return -EINVAL;
+       if (cmd->duplex != DUPLEX_HALF && cmd->duplex != DUPLEX_FULL)
+               return -EINVAL;
+       if (cmd->autoneg == AUTONEG_DISABLE)
+               switch (cmd->speed) {
+               case SPEED_10:
+                       if (cmd->duplex == DUPLEX_HALF &&
+                           (features & SUPPORTED_10baseT_Half) == 0)
+                               return -EINVAL;
+                       if (cmd->duplex == DUPLEX_FULL &&
+                           (features & SUPPORTED_10baseT_Full) == 0)
+                               return -EINVAL;
+                       break;
+               case SPEED_100:
+                       if (cmd->duplex == DUPLEX_HALF &&
+                           (features & SUPPORTED_100baseT_Half) == 0)
+                               return -EINVAL;
+                       if (cmd->duplex == DUPLEX_FULL &&
+                           (features & SUPPORTED_100baseT_Full) == 0)
+                               return -EINVAL;
+                       break;
+               case SPEED_1000:
+                       if (cmd->duplex == DUPLEX_HALF &&
+                           (features & SUPPORTED_1000baseT_Half) == 0)
+                               return -EINVAL;
+                       if (cmd->duplex == DUPLEX_FULL &&
+                           (features & SUPPORTED_1000baseT_Full) == 0)
+                               return -EINVAL;
+                       break;
+               default:
+                       return -EINVAL;
+       } else if ((features & SUPPORTED_Autoneg) == 0)
+               return -EINVAL;
+       spin_lock_irq(&fep->lock);
+       emac_start_link(fep, cmd);
+       spin_unlock_irq(&fep->lock);
+       return 0;
+}
+
+static void
+emac_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo *info)
+{
+       struct ocp_enet_private *fep = ndev->priv;
+
+       strcpy(info->driver, DRV_NAME);
+       strcpy(info->version, DRV_VERSION);
+       info->fw_version[0] = '\0';
+       sprintf(info->bus_info, "IBM EMAC %d", fep->ocpdev->def->index);
+       info->regdump_len = 0;
+}
+
+static int emac_nway_reset(struct net_device *ndev)
+{
+       struct ocp_enet_private *fep = ndev->priv;
+
+       if (!fep->want_autoneg)
+               return -EINVAL;
+       spin_lock_irq(&fep->lock);
+       emac_start_link(fep, NULL);
+       spin_unlock_irq(&fep->lock);
+       return 0;
+}
+
+static u32 emac_get_link(struct net_device *ndev)
+{
+       return netif_carrier_ok(ndev);
+}
+
+static struct ethtool_ops emac_ethtool_ops = {
+       .get_settings = emac_get_settings,
+       .set_settings = emac_set_settings,
+       .get_drvinfo = emac_get_drvinfo,
+       .nway_reset = emac_nway_reset,
+       .get_link = emac_get_link
+};
+
+static int emac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+{
+       struct ocp_enet_private *fep = dev->priv;
+       uint *data = (uint *) & rq->ifr_data;
+
+       switch (cmd) {
+       case SIOCGMIIPHY:
+               data[0] = fep->mii_phy_addr;
+               /* Fall through */
+       case SIOCGMIIREG:
+               data[3] = emac_phy_read(dev, fep->mii_phy_addr, data[1]);
+               return 0;
+       case SIOCSMIIREG:
+               if (!capable(CAP_NET_ADMIN))
+                       return -EPERM;
+
+               emac_phy_write(dev, fep->mii_phy_addr, data[1], data[2]);
+               return 0;
+       default:
+               return -EOPNOTSUPP;
+       }
+}
+
+static int emac_open(struct net_device *dev)
+{
+       struct ocp_enet_private *fep = dev->priv;
+       int rc;
+
+       spin_lock_irq(&fep->lock);
+
+       fep->opened = 1;
+       netif_carrier_off(dev);
+
+       /* Reset & configure the chip */
+       emac_reset_configure(fep);
+
+       spin_unlock_irq(&fep->lock);
+
+       /* Request our interrupt lines */
+       rc = request_irq(dev->irq, emac_mac_irq, 0, "IBM EMAC MAC", dev);
+       if (rc != 0) {
+               printk("dev->irq %d failed\n", dev->irq);
+               goto bail;
+       }
+       /* Kick the chip rx & tx channels into life */
+       spin_lock_irq(&fep->lock);
+       emac_kick(fep);
+       spin_unlock_irq(&fep->lock);
+
+       netif_start_queue(dev);
+      bail:
+       return rc;
+}
+
+static int emac_close(struct net_device *dev)
+{
+       struct ocp_enet_private *fep = dev->priv;
+       emac_t *emacp = fep->emacp;
+
+       /* XXX Stop IRQ emitting here */
+       spin_lock_irq(&fep->lock);
+       fep->opened = 0;
+       mal_disable_tx_channels(fep->mal, fep->commac.tx_chan_mask);
+       mal_disable_rx_channels(fep->mal, fep->commac.rx_chan_mask);
+       netif_carrier_off(dev);
+       netif_stop_queue(dev);
+
+       /*
+        * Check for a link, some PHYs don't provide a clock if
+        * no link is present.  Some EMACs will not come out of
+        * soft reset without a PHY clock present.
+        */
+       if (fep->phy_mii.def->ops->poll_link(&fep->phy_mii)) {
+               out_be32(&emacp->em0mr0, EMAC_M0_SRST);
+               udelay(10);
+
+               if (emacp->em0mr0 & EMAC_M0_SRST) {
+                       /*not sure what to do here hopefully it clears before another open */
+                       printk(KERN_ERR
+                              "%s: Phy SoftReset didn't clear, no link?\n",
+                              dev->name);
+               }
+       }
+
+       /* Free the irq's */
+       free_irq(dev->irq, dev);
+
+       spin_unlock_irq(&fep->lock);
+
+       return 0;
+}
+
+static void emac_remove(struct ocp_device *ocpdev)
+{
+       struct net_device *dev = ocp_get_drvdata(ocpdev);
+       struct ocp_enet_private *ep = dev->priv;
+
+       /* FIXME: locking, races, ... */
+       ep->going_away = 1;
+       ocp_set_drvdata(ocpdev, NULL);
+       if (ep->rgmii_dev)
+               emac_close_rgmii(ep->rgmii_dev);
+       if (ep->zmii_dev)
+               emac_close_zmii(ep->zmii_dev);
+
+       unregister_netdev(dev);
+       del_timer_sync(&ep->link_timer);
+       mal_unregister_commac(ep->mal, &ep->commac);
+       iounmap((void *)ep->emacp);
+       kfree(dev);
+}
+
+struct mal_commac_ops emac_commac_ops = {
+       .txeob = &emac_txeob_dev,
+       .txde = &emac_txde_dev,
+       .rxeob = &emac_rxeob_dev,
+       .rxde = &emac_rxde_dev,
+};
+
+static int emac_init_device(struct ocp_device *ocpdev, struct ibm_ocp_mal *mal)
+{
+       int deferred_init = 0;
+       int rc = 0, i;
+       struct net_device *ndev;
+       struct ocp_enet_private *ep;
+       struct ocp_func_emac_data *emacdata;
+       int commac_reg = 0;
+       u32 phy_map;
+
+       emacdata = (struct ocp_func_emac_data *)ocpdev->def->additions;
+       if (!emacdata) {
+               printk(KERN_ERR "emac%d: Missing additional data!\n",
+                      ocpdev->def->index);
+               return -ENODEV;
+       }
+
+       /* Allocate our net_device structure */
+       ndev = alloc_etherdev(sizeof(struct ocp_enet_private));
+       if (ndev == NULL) {
+               printk(KERN_ERR
+                      "emac%d: Could not allocate ethernet device.\n",
+                      ocpdev->def->index);
+               return -ENOMEM;
+       }
+       ep = ndev->priv;
+       ep->ndev = ndev;
+       ep->ocpdev = ocpdev;
+       ndev->irq = ocpdev->def->irq;
+       ep->wol_irq = emacdata->wol_irq;
+       if (emacdata->mdio_idx >= 0) {
+               if (emacdata->mdio_idx == ocpdev->def->index) {
+                       /* Set the common MDIO net_device */
+                       mdio_ndev = ndev;
+                       deferred_init = 1;
+               }
+               ep->mdio_dev = mdio_ndev;
+       } else {
+               ep->mdio_dev = ndev;
+       }
+
+       ocp_set_drvdata(ocpdev, ndev);
+
+       spin_lock_init(&ep->lock);
+
+       /* Fill out MAL informations and register commac */
+       ep->mal = mal;
+       ep->mal_tx_chan = emacdata->mal_tx_chan;
+       ep->mal_rx_chan = emacdata->mal_rx_chan;
+       ep->commac.ops = &emac_commac_ops;
+       ep->commac.dev = ndev;
+       ep->commac.tx_chan_mask = MAL_CHAN_MASK(ep->mal_tx_chan);
+       ep->commac.rx_chan_mask = MAL_CHAN_MASK(ep->mal_rx_chan);
+       rc = mal_register_commac(ep->mal, &ep->commac);
+       if (rc != 0)
+               goto bail;
+       commac_reg = 1;
+
+       /* Map our MMIOs */
+       ep->emacp = (emac_t *) ioremap(ocpdev->def->paddr, sizeof(emac_t));
+
+       /* Check if we need to attach to a ZMII */
+       if (emacdata->zmii_idx >= 0) {
+               ep->zmii_input = emacdata->zmii_mux;
+               ep->zmii_dev =
+                   ocp_find_device(OCP_ANY_ID, OCP_FUNC_ZMII,
+                                   emacdata->zmii_idx);
+               if (ep->zmii_dev == NULL)
+                       printk(KERN_WARNING
+                              "emac%d: ZMII %d requested but not found !\n",
+                              ocpdev->def->index, emacdata->zmii_idx);
+               else if ((rc =
+                         emac_init_zmii(ep->zmii_dev, ep->zmii_input,
+                                        emacdata->phy_mode)) != 0)
+                       goto bail;
+       }
+
+       /* Check if we need to attach to a RGMII */
+       if (emacdata->rgmii_idx >= 0) {
+               ep->rgmii_input = emacdata->rgmii_mux;
+               ep->rgmii_dev =
+                   ocp_find_device(OCP_ANY_ID, OCP_FUNC_RGMII,
+                                   emacdata->rgmii_idx);
+               if (ep->rgmii_dev == NULL)
+                       printk(KERN_WARNING
+                              "emac%d: RGMII %d requested but not found !\n",
+                              ocpdev->def->index, emacdata->rgmii_idx);
+               else if ((rc =
+                         emac_init_rgmii(ep->rgmii_dev, ep->rgmii_input,
+                                         emacdata->phy_mode)) != 0)
+                       goto bail;
+       }
+
+       /* Check if we need to attach to a TAH */
+       if (emacdata->tah_idx >= 0) {
+               ep->tah_dev =
+                   ocp_find_device(OCP_ANY_ID, OCP_FUNC_TAH,
+                                   emacdata->tah_idx);
+               if (ep->tah_dev == NULL)
+                       printk(KERN_WARNING
+                              "emac%d: TAH %d requested but not found !\n",
+                              ocpdev->def->index, emacdata->tah_idx);
+               else if ((rc = emac_init_tah(ep)) != 0)
+                       goto bail;
+       }
+
+       if (deferred_init) {
+               if (!list_empty(&emac_init_list)) {
+                       struct list_head *entry;
+                       struct emac_def_dev *ddev;
+
+                       list_for_each(entry, &emac_init_list) {
+                               ddev =
+                                   list_entry(entry, struct emac_def_dev,
+                                              link);
+                               emac_init_device(ddev->ocpdev, ddev->mal);
+                       }
+               }
+       }
+
+       /* Init link monitoring timer */
+       init_timer(&ep->link_timer);
+       ep->link_timer.function = emac_link_timer;
+       ep->link_timer.data = (unsigned long)ep;
+       ep->timer_ticks = 0;
+
+       /* Fill up the mii_phy structure */
+       ep->phy_mii.dev = ndev;
+       ep->phy_mii.mdio_read = emac_phy_read;
+       ep->phy_mii.mdio_write = emac_phy_write;
+       ep->phy_mii.mode = emacdata->phy_mode;
+
+       /* Find PHY */
+       phy_map = emacdata->phy_map | busy_phy_map;
+       for (i = 0; i <= 0x1f; i++, phy_map >>= 1) {
+               if ((phy_map & 0x1) == 0) {
+                       int val = emac_phy_read(ndev, i, MII_BMCR);
+                       if (val != 0xffff && val != -1)
+                               break;
+               }
+       }
+       if (i == 0x20) {
+               printk(KERN_WARNING "emac%d: Can't find PHY.\n",
+                      ocpdev->def->index);
+               rc = -ENODEV;
+               goto bail;
+       }
+       busy_phy_map |= 1 << i;
+       ep->mii_phy_addr = i;
+       rc = mii_phy_probe(&ep->phy_mii, i);
+       if (rc) {
+               printk(KERN_WARNING "emac%d: Failed to probe PHY type.\n",
+                      ocpdev->def->index);
+               rc = -ENODEV;
+               goto bail;
+       }
+
+       /* Setup initial PHY config & startup aneg */
+       if (ep->phy_mii.def->ops->init)
+               ep->phy_mii.def->ops->init(&ep->phy_mii);
+       netif_carrier_off(ndev);
+       if (ep->phy_mii.def->features & SUPPORTED_Autoneg)
+               ep->want_autoneg = 1;
+       emac_start_link(ep, NULL);
+
+       /* read the MAC Address */
+       for (i = 0; i < 6; i++)
+               ndev->dev_addr[i] = emacdata->mac_addr[i];
+
+       /* Fill in the driver function table */
+       ndev->open = &emac_open;
+       ndev->hard_start_xmit = &emac_start_xmit;
+       ndev->stop = &emac_close;
+       ndev->get_stats = &emac_stats;
+       if (emacdata->jumbo)
+               ndev->change_mtu = &emac_change_mtu;
+       ndev->set_mac_address = &emac_set_mac_address;
+       ndev->set_multicast_list = &emac_set_multicast_list;
+       ndev->do_ioctl = &emac_ioctl;
+       SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops);
+       if (emacdata->tah_idx >= 0)
+               ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG;
+
+       SET_MODULE_OWNER(ndev);
+
+       rc = register_netdev(ndev);
+       if (rc != 0)
+               goto bail;
+
+       printk("%s: IBM emac, MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
+              ndev->name,
+              ndev->dev_addr[0], ndev->dev_addr[1], ndev->dev_addr[2],
+              ndev->dev_addr[3], ndev->dev_addr[4], ndev->dev_addr[5]);
+       printk(KERN_INFO "%s: Found %s PHY (0x%02x)\n",
+              ndev->name, ep->phy_mii.def->name, ep->mii_phy_addr);
+
+      bail:
+       if (rc && commac_reg)
+               mal_unregister_commac(ep->mal, &ep->commac);
+       if (rc && ndev)
+               kfree(ndev);
+
+       return rc;
+}
+
+static int emac_probe(struct ocp_device *ocpdev)
+{
+       struct ocp_device *maldev;
+       struct ibm_ocp_mal *mal;
+       struct ocp_func_emac_data *emacdata;
+
+       emacdata = (struct ocp_func_emac_data *)ocpdev->def->additions;
+       if (emacdata == NULL) {
+               printk(KERN_ERR "emac%d: Missing additional datas !\n",
+                      ocpdev->def->index);
+               return -ENODEV;
+       }
+
+       /* Get the MAL device  */
+       maldev = ocp_find_device(OCP_ANY_ID, OCP_FUNC_MAL, emacdata->mal_idx);
+       if (maldev == NULL) {
+               printk("No maldev\n");
+               return -ENODEV;
+       }
+       /*
+        * Get MAL driver data, it must be here due to link order.
+        * When the driver is modularized, symbol dependencies will
+        * ensure the MAL driver is already present if built as a
+        * module.
+        */
+       mal = (struct ibm_ocp_mal *)ocp_get_drvdata(maldev);
+       if (mal == NULL) {
+               printk("No maldrv\n");
+               return -ENODEV;
+       }
+
+       /* If we depend on another EMAC for MDIO, wait for it to show up */
+       if (emacdata->mdio_idx >= 0 &&
+           (emacdata->mdio_idx != ocpdev->def->index) && !mdio_ndev) {
+               struct emac_def_dev *ddev;
+               /* Add this index to the deferred init table */
+               ddev = kmalloc(sizeof(struct emac_def_dev), GFP_KERNEL);
+               ddev->ocpdev = ocpdev;
+               ddev->mal = mal;
+               list_add_tail(&ddev->link, &emac_init_list);
+       } else {
+               emac_init_device(ocpdev, mal);
+       }
+
+       return 0;
+}
+
+/* Structure for a device driver */
+static struct ocp_device_id emac_ids[] = {
+       {.vendor = OCP_ANY_ID,.function = OCP_FUNC_EMAC},
+       {.vendor = OCP_VENDOR_INVALID}
+};
+
+static struct ocp_driver emac_driver = {
+       .name = "emac",
+       .id_table = emac_ids,
+
+       .probe = emac_probe,
+       .remove = emac_remove,
+};
+
+static int __init emac_init(void)
+{
+       int rc;
+
+       printk(KERN_INFO DRV_NAME ": " DRV_DESC ", version " DRV_VERSION "\n");
+       printk(KERN_INFO "Maintained by " DRV_AUTHOR "\n");
+
+       if (skb_res > 2) {
+               printk(KERN_WARNING "Invalid skb_res: %d, cropping to 2\n",
+                      skb_res);
+               skb_res = 2;
+       }
+       rc = ocp_register_driver(&emac_driver);
+       if (rc < 0) {
+               ocp_unregister_driver(&emac_driver);
+               return -ENODEV;
+       }
+
+       return 0;
+}
+
+static void __exit emac_exit(void)
+{
+       ocp_unregister_driver(&emac_driver);
+}
+
+module_init(emac_init);
+module_exit(emac_exit);
diff --git a/drivers/net/ibm_emac/ibm_emac_phy.h b/drivers/net/ibm_emac/ibm_emac_phy.h
new file mode 100644 (file)
index 0000000..61afbea
--- /dev/null
@@ -0,0 +1,137 @@
+
+/*
+ * ibm_emac_phy.h
+ *
+ *
+ *      Benjamin Herrenschmidt <benh@kernel.crashing.org>
+ *      February 2003
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``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 AUTHOR  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.
+ *
+ *  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.
+ *
+ *
+ * This file basically duplicates sungem_phy.{c,h} with different PHYs
+ * supported. I'm looking into merging that in a single mii layer more
+ * flexible than mii.c 
+ */
+
+#ifndef _IBM_EMAC_PHY_H_
+#define _IBM_EMAC_PHY_H_
+
+/*
+ * PHY mode settings
+ * Used for multi-mode capable PHYs
+ */
+#define PHY_MODE_NA    0
+#define PHY_MODE_MII   1
+#define PHY_MODE_RMII  2
+#define PHY_MODE_SMII  3
+#define PHY_MODE_RGMII 4
+#define PHY_MODE_TBI   5
+#define PHY_MODE_GMII  6
+#define PHY_MODE_RTBI  7
+#define PHY_MODE_SGMII 8
+
+/*
+ * PHY specific registers/values
+ */
+
+/* CIS8201 */
+#define MII_CIS8201_EPCR       0x17
+#define EPCR_MODE_MASK         0x3000
+#define EPCR_GMII_MODE         0x0000
+#define EPCR_RGMII_MODE                0x1000
+#define EPCR_TBI_MODE          0x2000
+#define EPCR_RTBI_MODE         0x3000
+
+struct mii_phy;
+
+/* Operations supported by any kind of PHY */
+struct mii_phy_ops {
+       int (*init) (struct mii_phy * phy);
+       int (*suspend) (struct mii_phy * phy, int wol_options);
+       int (*setup_aneg) (struct mii_phy * phy, u32 advertise);
+       int (*setup_forced) (struct mii_phy * phy, int speed, int fd);
+       int (*poll_link) (struct mii_phy * phy);
+       int (*read_link) (struct mii_phy * phy);
+};
+
+/* Structure used to statically define an mii/gii based PHY */
+struct mii_phy_def {
+       u32 phy_id;             /* Concatenated ID1 << 16 | ID2 */
+       u32 phy_id_mask;        /* Significant bits */
+       u32 features;           /* Ethtool SUPPORTED_* defines */
+       int magic_aneg;         /* Autoneg does all speed test for us */
+       const char *name;
+       const struct mii_phy_ops *ops;
+};
+
+/* An instance of a PHY, partially borrowed from mii_if_info */
+struct mii_phy {
+       struct mii_phy_def *def;
+       int advertising;
+       int mii_id;
+
+       /* 1: autoneg enabled, 0: disabled */
+       int autoneg;
+
+       /* forced speed & duplex (no autoneg)
+        * partner speed & duplex & pause (autoneg)
+        */
+       int speed;
+       int duplex;
+       int pause;
+
+       /* PHY mode - if needed */
+       int mode;
+
+       /* Provided by host chip */
+       struct net_device *dev;
+       int (*mdio_read) (struct net_device * dev, int mii_id, int reg);
+       void (*mdio_write) (struct net_device * dev, int mii_id, int reg,
+                           int val);
+};
+
+/* Pass in a struct mii_phy with dev, mdio_read and mdio_write
+ * filled, the remaining fields will be filled on return
+ */
+extern int mii_phy_probe(struct mii_phy *phy, int mii_id);
+
+static inline int __phy_read(struct mii_phy *phy, int id, int reg)
+{
+       return phy->mdio_read(phy->dev, id, reg);
+}
+
+static inline void __phy_write(struct mii_phy *phy, int id, int reg, int val)
+{
+       phy->mdio_write(phy->dev, id, reg, val);
+}
+
+static inline int phy_read(struct mii_phy *phy, int reg)
+{
+       return phy->mdio_read(phy->dev, phy->mii_id, reg);
+}
+
+static inline void phy_write(struct mii_phy *phy, int reg, int val)
+{
+       phy->mdio_write(phy->dev, phy->mii_id, reg, val);
+}
+
+#endif                         /* _IBM_EMAC_PHY_H_ */
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
new file mode 100644 (file)
index 0000000..d595ba7
--- /dev/null
@@ -0,0 +1,333 @@
+/*======================================================================
+
+  Device driver for the PCMCIA control functionality of PXA2xx
+  microprocessors.
+
+    The contents of this file may be used under the
+    terms of the GNU Public License version 2 (the "GPL")
+
+    (c) Ian Molton (spyro@f2s.com) 2003
+    (c) Stefan Eletzhofer (stefan.eletzhofer@inquant.de) 2003,4
+
+    derived from sa11xx_base.c
+
+     Portions created by John G. Dorsey are
+     Copyright (C) 1999 John G. Dorsey.
+
+  ======================================================================*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/config.h>
+#include <linux/cpufreq.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/notifier.h>
+#include <linux/spinlock.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+
+#include <pcmcia/cs_types.h>
+#include <pcmcia/ss.h>
+#include <pcmcia/bulkmem.h>
+#include <pcmcia/cistpl.h>
+
+#include "cs_internal.h"
+#include "soc_common.h"
+#include "pxa2xx_base.h"
+
+
+#define MCXX_SETUP_MASK     (0x7f)
+#define MCXX_ASST_MASK      (0x1f)
+#define MCXX_HOLD_MASK      (0x3f)
+#define MCXX_SETUP_SHIFT    (0)
+#define MCXX_ASST_SHIFT     (7)
+#define MCXX_HOLD_SHIFT     (14)
+
+static inline u_int pxa2xx_mcxx_hold(u_int pcmcia_cycle_ns,
+                                    u_int mem_clk_10khz)
+{
+       u_int code = pcmcia_cycle_ns * mem_clk_10khz;
+       return (code / 300000) + ((code % 300000) ? 1 : 0) - 1;
+}
+
+static inline u_int pxa2xx_mcxx_asst(u_int pcmcia_cycle_ns,
+                                    u_int mem_clk_10khz)
+{
+       u_int code = pcmcia_cycle_ns * mem_clk_10khz;
+       return (code / 300000) + ((code % 300000) ? 1 : 0) - 1;
+}
+
+static inline u_int pxa2xx_mcxx_setup(u_int pcmcia_cycle_ns,
+                                     u_int mem_clk_10khz)
+{
+       u_int code = pcmcia_cycle_ns * mem_clk_10khz;
+       return (code / 100000) + ((code % 100000) ? 1 : 0) - 1;
+}
+
+/* This function returns the (approximate) command assertion period, in
+ * nanoseconds, for a given CPU clock frequency and MCXX_ASST value:
+ */
+static inline u_int pxa2xx_pcmcia_cmd_time(u_int mem_clk_10khz,
+                                          u_int pcmcia_mcxx_asst)
+{
+       return (300000 * (pcmcia_mcxx_asst + 1) / mem_clk_10khz);
+}
+
+static int pxa2xx_pcmcia_set_mcmem( int sock, int speed, int clock )
+{
+       MCMEM(sock) = ((pxa2xx_mcxx_setup(speed, clock)
+               & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
+               | ((pxa2xx_mcxx_asst(speed, clock)
+               & MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
+               | ((pxa2xx_mcxx_hold(speed, clock)
+               & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
+
+       return 0;
+}
+
+static int pxa2xx_pcmcia_set_mcio( int sock, int speed, int clock )
+{
+       MCIO(sock) = ((pxa2xx_mcxx_setup(speed, clock)
+               & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
+               | ((pxa2xx_mcxx_asst(speed, clock)
+               & MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
+               | ((pxa2xx_mcxx_hold(speed, clock)
+               & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
+
+       return 0;
+}
+
+static int pxa2xx_pcmcia_set_mcatt( int sock, int speed, int clock )
+{
+       MCATT(sock) = ((pxa2xx_mcxx_setup(speed, clock)
+               & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
+               | ((pxa2xx_mcxx_asst(speed, clock)
+               & MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
+               | ((pxa2xx_mcxx_hold(speed, clock)
+               & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
+
+       return 0;
+}
+
+static int pxa2xx_pcmcia_set_mcxx(struct soc_pcmcia_socket *skt, unsigned int lclk)
+{
+       struct soc_pcmcia_timing timing;
+       int sock = skt->nr;
+
+       soc_common_pcmcia_get_timing(skt, &timing);
+
+       pxa2xx_pcmcia_set_mcmem(sock, timing.mem, lclk);
+       pxa2xx_pcmcia_set_mcatt(sock, timing.attr, lclk);
+       pxa2xx_pcmcia_set_mcio(sock, timing.io, lclk);
+
+       return 0;
+}
+
+static int pxa2xx_pcmcia_set_timing(struct soc_pcmcia_socket *skt)
+{
+       unsigned int lclk = get_lclk_frequency_10khz();
+       return pxa2xx_pcmcia_set_mcxx(skt, lclk);
+}
+
+int pxa2xx_drv_pcmcia_probe(struct device *dev)
+{
+       int ret;
+       struct pcmcia_low_level *ops;
+       int first, nr;
+
+       if (!dev || !dev->platform_data)
+               return -ENODEV;
+
+       ops = (struct pcmcia_low_level *)dev->platform_data;
+       first = ops->first;
+       nr = ops->nr;
+
+       /* Setup GPIOs for PCMCIA/CF alternate function mode.
+        *
+        * It would be nice if set_GPIO_mode included support
+        * for driving GPIO outputs to default high/low state
+        * before programming GPIOs as outputs. Setting GPIO
+        * outputs to default high/low state via GPSR/GPCR
+        * before defining them as outputs should reduce
+        * the possibility of glitching outputs during GPIO
+        * setup. This of course assumes external terminators
+        * are present to hold GPIOs in a defined state.
+        *
+        * In the meantime, setup default state of GPIO
+        * outputs before we enable them as outputs.
+        */
+
+       GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
+               GPIO_bit(GPIO49_nPWE) |
+               GPIO_bit(GPIO50_nPIOR) |
+               GPIO_bit(GPIO51_nPIOW) |
+               GPIO_bit(GPIO52_nPCE_1) |
+               GPIO_bit(GPIO53_nPCE_2);
+
+       pxa_gpio_mode(GPIO48_nPOE_MD);
+       pxa_gpio_mode(GPIO49_nPWE_MD);
+       pxa_gpio_mode(GPIO50_nPIOR_MD);
+       pxa_gpio_mode(GPIO51_nPIOW_MD);
+       pxa_gpio_mode(GPIO52_nPCE_1_MD);
+       pxa_gpio_mode(GPIO53_nPCE_2_MD);
+       pxa_gpio_mode(GPIO54_pSKTSEL_MD); /* REVISIT: s/b dependent on num sockets */
+       pxa_gpio_mode(GPIO55_nPREG_MD);
+       pxa_gpio_mode(GPIO56_nPWAIT_MD);
+       pxa_gpio_mode(GPIO57_nIOIS16_MD);
+
+       /* Provide our PXA2xx specific timing routines. */
+       ops->set_timing  = pxa2xx_pcmcia_set_timing;
+
+       ret = soc_common_drv_pcmcia_probe(dev, ops, first, nr);
+
+       if (ret == 0) {
+               /*
+                * We have at least one socket, so set MECR:CIT
+                * (Card Is There)
+                */
+               MECR |= MECR_CIT;
+
+               /* Set MECR:NOS (Number Of Sockets) */
+               if (nr > 1)
+                       MECR |= MECR_NOS;
+               else
+                       MECR &= ~MECR_NOS;
+       }
+
+       return ret;
+}
+EXPORT_SYMBOL(pxa2xx_drv_pcmcia_probe);
+
+static int pxa2xx_drv_pcmcia_suspend(struct device *dev, u32 state, u32 level)
+{
+       int ret = 0;
+       if (level == SUSPEND_SAVE_STATE)
+               ret = pcmcia_socket_dev_suspend(dev, state);
+       return ret;
+}
+
+static int pxa2xx_drv_pcmcia_resume(struct device *dev, u32 level)
+{
+       int ret = 0;
+       if (level == RESUME_RESTORE_STATE)
+               ret = pcmcia_socket_dev_resume(dev);
+       return ret;
+}
+
+static struct device_driver pxa2xx_pcmcia_driver = {
+       .probe          = pxa2xx_drv_pcmcia_probe,
+       .remove         = soc_common_drv_pcmcia_remove,
+       .suspend        = pxa2xx_drv_pcmcia_suspend,
+       .resume         = pxa2xx_drv_pcmcia_resume,
+       .name           = "pxa2xx-pcmcia",
+       .bus            = &platform_bus_type,
+};
+
+#ifdef CONFIG_CPU_FREQ
+
+/*
+ * When pxa2xx_pcmcia_notifier() decides that a MC{IO,MEM,ATT} adjustment (due
+ * to a core clock frequency change) is needed, this routine establishes
+ * new values consistent with the clock speed `clock'.
+ */
+static void pxa2xx_pcmcia_update_mcxx(unsigned int clock)
+{
+       struct soc_pcmcia_socket *skt;
+
+       down(&soc_sockets_lock);
+       list_for_each_entry(skt, &soc_sockets, node) {
+               pxa2xx_pcmcia_set_mcxx(skt, clock);
+       }
+       up(&soc_sockets_lock);
+}
+
+/*
+ * When changing the processor L clock frequency, it is necessary
+ * to adjust the MCXX timings accordingly. We've recorded the timings
+ * requested by Card Services, so this is just a matter of finding
+ * out what our current speed is, and then recomputing the new MCXX
+ * values.
+ *
+ * Returns: 0 on success, -1 on error
+ */
+static int
+pxa2xx_pcmcia_notifier(struct notifier_block *nb, unsigned long val, void *data)
+{
+       struct cpufreq_freqs *freqs = data;
+
+#warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock"
+       switch (val) {
+               case CPUFREQ_PRECHANGE:
+                       if (freqs->new > freqs->old) {
+                               debug( 2, "new frequency %u.%uMHz > %u.%uMHz, "
+                                               "pre-updating\n",
+                                               freqs->new / 1000, (freqs->new / 100) % 10,
+                                               freqs->old / 1000, (freqs->old / 100) % 10);
+                               pxa2xx_pcmcia_update_mcxx(freqs->new);
+                       }
+                       break;
+
+               case CPUFREQ_POSTCHANGE:
+                       if (freqs->new < freqs->old) {
+                               debug( 2, "new frequency %u.%uMHz < %u.%uMHz, "
+                                               "post-updating\n",
+                                               freqs->new / 1000, (freqs->new / 100) % 10,
+                                               freqs->old / 1000, (freqs->old / 100) % 10);
+                               pxa2xx_pcmcia_update_mcxx(freqs->new);
+                       }
+                       break;
+       }
+
+       return 0;
+}
+
+static struct notifier_block pxa2xx_pcmcia_notifier_block = {
+       .notifier_call  = pxa2xx_pcmcia_notifier
+};
+
+static int __init pxa2xx_pcmcia_cpufreq_init(void)
+{
+       int ret;
+
+       ret = cpufreq_register_notifier(&pxa2xx_pcmcia_notifier_block,
+                                       CPUFREQ_TRANSITION_NOTIFIER);
+       if (ret < 0)
+               printk(KERN_ERR "Unable to register CPU frequency change "
+                               "notifier for PCMCIA (%d)\n", ret);
+       return ret;
+}
+
+static void __exit pxa2xx_pcmcia_cpufreq_exit(void)
+{
+       cpufreq_unregister_notifier(&pxa2xx_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
+}
+
+#else
+#define pxa2xx_pcmcia_cpufreq_init()
+#define pxa2xx_pcmcia_cpufreq_exit()
+#endif
+
+static int __init pxa2xx_pcmcia_init(void)
+{
+       int ret = driver_register(&pxa2xx_pcmcia_driver);
+       if (ret == 0)
+               pxa2xx_pcmcia_cpufreq_init();
+       return ret;
+}
+
+static void __exit pxa2xx_pcmcia_exit(void)
+{
+       pxa2xx_pcmcia_cpufreq_exit();
+       driver_unregister(&pxa2xx_pcmcia_driver);
+}
+
+module_init(pxa2xx_pcmcia_init);
+module_exit(pxa2xx_pcmcia_exit);
+
+MODULE_AUTHOR("Stefan Eletzhofer <stefan.eletzhofer@inquant.de> and Ian Molton <spyro@f2s.com>");
+MODULE_DESCRIPTION("Linux PCMCIA Card Services: PXA2xx core socket driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/pcmcia/pxa2xx_lubbock.c b/drivers/pcmcia/pxa2xx_lubbock.c
new file mode 100644 (file)
index 0000000..c18f286
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+ * linux/drivers/pcmcia/pxa2xx_lubbock.c
+ *
+ * Author:     George Davis
+ * Created:    Jan 10, 2002
+ * Copyright:  MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Originally based upon linux/drivers/pcmcia/sa1100_neponset.c
+ *
+ * Lubbock PCMCIA specific routines.
+ *
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/device.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+
+#include <asm/hardware.h>
+#include <asm/hardware/sa1111.h>
+#include <asm/mach-types.h>
+
+#include "sa1111_generic.h"
+
+static int
+lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
+                               const socket_state_t *state)
+{
+       unsigned int pa_dwr_mask, pa_dwr_set, misc_mask, misc_set;
+       int ret = 0;
+
+       pa_dwr_mask = pa_dwr_set = misc_mask = misc_set = 0;
+
+       /* Lubbock uses the Maxim MAX1602, with the following connections:
+        *
+        * Socket 0 (PCMCIA):
+        *      MAX1602 Lubbock         Register
+        *      Pin     Signal
+        *      -----   -------         ----------------------
+        *      A0VPP   S0_PWR0         SA-1111 GPIO A<0>
+        *      A1VPP   S0_PWR1         SA-1111 GPIO A<1>
+        *      A0VCC   S0_PWR2         SA-1111 GPIO A<2>
+        *      A1VCC   S0_PWR3         SA-1111 GPIO A<3>
+        *      VX      VCC
+        *      VY      +3.3V
+        *      12IN    +12V
+        *      CODE    +3.3V           Cirrus  Code, CODE = High (VY)
+        *
+        * Socket 1 (CF):
+        *      MAX1602 Lubbock         Register
+        *      Pin     Signal
+        *      -----   -------         ----------------------
+        *      A0VPP   GND             VPP is not connected
+        *      A1VPP   GND             VPP is not connected
+        *      A0VCC   S1_PWR0         MISC_WR<14>
+        *      A1VCC   S1_PWR1         MISC_WR<15>
+        *      VX      VCC
+        *      VY      +3.3V
+        *      12IN    GND             VPP is not connected
+        *      CODE    +3.3V           Cirrus  Code, CODE = High (VY)
+        *
+        */
+
+ again:
+       switch (skt->nr) {
+       case 0:
+               pa_dwr_mask = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3;
+
+               switch (state->Vcc) {
+               case 0: /* Hi-Z */
+                       break;
+
+               case 33: /* VY */
+                       pa_dwr_set |= GPIO_A3;
+                       break;
+
+               case 50: /* VX */
+                       pa_dwr_set |= GPIO_A2;
+                       break;
+
+               default:
+                       printk(KERN_ERR "%s(): unrecognized Vcc %u\n",
+                              __FUNCTION__, state->Vcc);
+                       ret = -1;
+               }
+
+               switch (state->Vpp) {
+               case 0: /* Hi-Z */
+                       break;
+
+               case 120: /* 12IN */
+                       pa_dwr_set |= GPIO_A1;
+                       break;
+
+               default: /* VCC */
+                       if (state->Vpp == state->Vcc)
+                               pa_dwr_set |= GPIO_A0;
+                       else {
+                               printk(KERN_ERR "%s(): unrecognized Vpp %u\n",
+                                      __FUNCTION__, state->Vpp);
+                               ret = -1;
+                               break;
+                       }
+               }
+               break;
+
+       case 1:
+               misc_mask = (1 << 15) | (1 << 14);
+
+               switch (state->Vcc) {
+               case 0: /* Hi-Z */
+                       break;
+
+               case 33: /* VY */
+                       misc_set |= 1 << 15;
+                       break;
+
+               case 50: /* VX */
+                       misc_set |= 1 << 14;
+                       break;
+
+               default:
+                       printk(KERN_ERR "%s(): unrecognized Vcc %u\n",
+                              __FUNCTION__, state->Vcc);
+                       ret = -1;
+                       break;
+               }
+
+               if (state->Vpp != state->Vcc && state->Vpp != 0) {
+                       printk(KERN_ERR "%s(): CF slot cannot support Vpp %u\n",
+                              __FUNCTION__, state->Vpp);
+                       ret = -1;
+                       break;
+               }
+               break;
+
+       default:
+               ret = -1;
+       }
+
+       if (ret == 0)
+               ret = sa1111_pcmcia_configure_socket(skt, state);
+
+       if (ret == 0) {
+               lubbock_set_misc_wr(misc_mask, misc_set);
+               sa1111_set_io(SA1111_DEV(skt->dev), pa_dwr_mask, pa_dwr_set);
+       }
+
+#if 1
+       if (ret == 0 && state->Vcc == 33) {
+               struct pcmcia_state new_state;
+
+               /*
+                * HACK ALERT:
+                * We can't sense the voltage properly on Lubbock before
+                * actually applying some power to the socket (catch 22).
+                * Resense the socket Voltage Sense pins after applying
+                * socket power.
+                *
+                * Note: It takes about 2.5ms for the MAX1602 VCC output
+                * to rise.
+                */
+               mdelay(3);
+
+               sa1111_pcmcia_socket_state(skt, &new_state);
+
+               if (!new_state.vs_3v && !new_state.vs_Xv) {
+                       /*
+                        * Switch to 5V,  Configure socket with 5V voltage
+                        */
+                       lubbock_set_misc_wr(misc_mask, 0);
+                       sa1111_set_io(SA1111_DEV(skt->dev), pa_dwr_mask, 0);
+
+                       /*
+                        * It takes about 100ms to turn off Vcc.
+                        */
+                       mdelay(100);
+
+                       /*
+                        * We need to hack around the const qualifier as
+                        * well to keep this ugly workaround localized and
+                        * not force it to the rest of the code. Barf bags
+                        * avaliable in the seat pocket in front of you!
+                        */
+                       ((socket_state_t *)state)->Vcc = 50;
+                       ((socket_state_t *)state)->Vpp = 50;
+                       goto again;
+               }
+       }
+#endif
+
+       return ret;
+}
+
+static struct pcmcia_low_level lubbock_pcmcia_ops = {
+       .owner                  = THIS_MODULE,
+       .hw_init                = sa1111_pcmcia_hw_init,
+       .hw_shutdown            = sa1111_pcmcia_hw_shutdown,
+       .socket_state           = sa1111_pcmcia_socket_state,
+       .configure_socket       = lubbock_pcmcia_configure_socket,
+       .socket_init            = sa1111_pcmcia_socket_init,
+       .socket_suspend         = sa1111_pcmcia_socket_suspend,
+       .first                  = 0,
+       .nr                     = 2,
+};
+
+#include "pxa2xx_base.h"
+
+int __init pcmcia_lubbock_init(struct sa1111_dev *sadev)
+{
+       int ret = -ENODEV;
+
+       if (machine_is_lubbock()) {
+               /*
+                * Set GPIO_A<3:0> to be outputs for the MAX1600,
+                * and switch to standby mode.
+                */
+               sa1111_set_io_dir(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0);
+               sa1111_set_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0);
+               sa1111_set_sleep_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0);
+
+               /* Set CF Socket 1 power to standby mode. */
+               lubbock_set_misc_wr((1 << 15) | (1 << 14), 0);
+
+               sadev->dev.platform_data = &lubbock_pcmcia_ops;
+               ret = pxa2xx_drv_pcmcia_probe(&sadev->dev);
+       }
+
+       return ret;
+}
diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c
new file mode 100644 (file)
index 0000000..af85842
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * linux/drivers/pcmcia/pxa2xx_mainstone.c
+ *
+ * Mainstone PCMCIA specific routines.
+ *
+ * Created:    May 12, 2004
+ * Author:     Nicolas Pitre
+ * Copyright:  MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+
+#include <pcmcia/ss.h>
+
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include "soc_common.h"
+
+
+static struct pcmcia_irqs irqs[] = {
+       { 0, MAINSTONE_S0_CD_IRQ, "PCMCIA0 CD" },
+       { 1, MAINSTONE_S1_CD_IRQ, "PCMCIA1 CD" },
+       { 0, MAINSTONE_S0_STSCHG_IRQ, "PCMCIA0 STSCHG" },
+       { 1, MAINSTONE_S1_STSCHG_IRQ, "PCMCIA1 STSCHG" },
+};
+
+static int mst_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
+{
+       skt->irq = (skt->nr == 0) ? MAINSTONE_S0_IRQ : MAINSTONE_S1_IRQ;
+       return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+}
+
+static void mst_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
+{
+       soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+}
+
+static unsigned long mst_pcmcia_status[2];
+
+static void mst_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
+                                   struct pcmcia_state *state)
+{
+       unsigned long status, flip;
+
+       status = (skt->nr == 0) ? MST_PCMCIA0 : MST_PCMCIA1;
+       flip = (status ^ mst_pcmcia_status[skt->nr]) & MST_PCMCIA_nSTSCHG_BVD1;
+
+       /*
+        * Workaround for STSCHG which can't be deasserted:
+        * We therefore disable/enable corresponding IRQs
+        * as needed to avoid IRQ locks.
+        */
+       if (flip) {
+               mst_pcmcia_status[skt->nr] = status;
+               if (status & MST_PCMCIA_nSTSCHG_BVD1)
+                       enable_irq( (skt->nr == 0) ? MAINSTONE_S0_STSCHG_IRQ
+                                                  : MAINSTONE_S1_STSCHG_IRQ );
+               else
+                       disable_irq( (skt->nr == 0) ? MAINSTONE_S0_STSCHG_IRQ
+                                                   : MAINSTONE_S1_STSCHG_IRQ );
+       }
+
+       state->detect = (status & MST_PCMCIA_nCD) ? 0 : 1;
+       state->ready  = (status & MST_PCMCIA_nIRQ) ? 1 : 0;
+       state->bvd1   = (status & MST_PCMCIA_nSTSCHG_BVD1) ? 1 : 0;
+       state->bvd2   = (status & MST_PCMCIA_nSPKR_BVD2) ? 1 : 0;
+       state->vs_3v  = (status & MST_PCMCIA_nVS1) ? 0 : 1;
+       state->vs_Xv  = (status & MST_PCMCIA_nVS2) ? 0 : 1;
+       state->wrprot = 0;  /* not available */
+}
+
+static int mst_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
+                                      const socket_state_t *state)
+{
+       unsigned long power = 0;
+       int ret = 0;
+
+       switch (state->Vcc) {
+       case 0:  power |= MST_PCMCIA_PWR_VCC_0;  break;
+       case 33: power |= MST_PCMCIA_PWR_VCC_33; break;
+       case 50: power |= MST_PCMCIA_PWR_VCC_50; break;
+       default:
+                printk(KERN_ERR "%s(): bad Vcc %u\n",
+                                __FUNCTION__, state->Vcc);
+                ret = -1;
+       }
+
+       switch (state->Vpp) {
+       case 0:   power |= MST_PCMCIA_PWR_VPP_0;   break;
+       case 120: power |= MST_PCMCIA_PWR_VPP_120; break;
+       default:
+                 if(state->Vpp == state->Vcc) {
+                         power |= MST_PCMCIA_PWR_VPP_VCC;
+                 } else {
+                         printk(KERN_ERR "%s(): bad Vpp %u\n",
+                                         __FUNCTION__, state->Vpp);
+                         ret = -1;
+                 }
+       }
+
+       if (state->flags & SS_RESET)
+              power |= MST_PCMCIA_RESET;
+
+       switch (skt->nr) {
+       case 0:  MST_PCMCIA0 = power; break;
+       case 1:  MST_PCMCIA1 = power; break;
+       default: ret = -1;
+       }
+
+       return ret;
+}
+
+static void mst_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
+{
+}
+
+static void mst_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
+{
+}
+
+static struct pcmcia_low_level mst_pcmcia_ops = {
+       .owner                  = THIS_MODULE,
+       .hw_init                = mst_pcmcia_hw_init,
+       .hw_shutdown            = mst_pcmcia_hw_shutdown,
+       .socket_state           = mst_pcmcia_socket_state,
+       .configure_socket       = mst_pcmcia_configure_socket,
+       .socket_init            = mst_pcmcia_socket_init,
+       .socket_suspend         = mst_pcmcia_socket_suspend,
+       .nr                     = 2,
+};
+
+static struct platform_device *mst_pcmcia_device;
+
+static int __init mst_pcmcia_init(void)
+{
+       int ret;
+
+       mst_pcmcia_device = kmalloc(sizeof(*mst_pcmcia_device), GFP_KERNEL);
+       if (!mst_pcmcia_device)
+               return -ENOMEM;
+       memset(mst_pcmcia_device, 0, sizeof(*mst_pcmcia_device));
+       mst_pcmcia_device->name = "pxa2xx-pcmcia";
+       mst_pcmcia_device->dev.platform_data = &mst_pcmcia_ops;
+
+       ret = platform_device_register(mst_pcmcia_device);
+       if (ret)
+               kfree(mst_pcmcia_device);
+
+       return ret;
+}
+
+static void __exit mst_pcmcia_exit(void)
+{
+       /*
+        * This call is supposed to free our mst_pcmcia_device.
+        * Unfortunately platform_device don't have a free method, and
+        * we can't assume it's free of any reference at this point so we
+        * can't free it either.
+        */
+       platform_device_unregister(mst_pcmcia_device);
+}
+
+module_init(mst_pcmcia_init);
+module_exit(mst_pcmcia_exit);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c
new file mode 100644 (file)
index 0000000..fb634ab
--- /dev/null
@@ -0,0 +1,242 @@
+/*======================================================================
+
+    Device driver for the PCMCIA control functionality of StrongARM
+    SA-1100 microprocessors.
+
+    The contents of this file are subject to the Mozilla Public
+    License Version 1.1 (the "License"); you may not use this file
+    except in compliance with the License. You may obtain a copy of
+    the License at http://www.mozilla.org/MPL/
+
+    Software distributed under the License is distributed on an "AS
+    IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+    implied. See the License for the specific language governing
+    rights and limitations under the License.
+
+    The initial developer of the original code is John G. Dorsey
+    <john+@cs.cmu.edu>.  Portions created by John G. Dorsey are
+    Copyright (C) 1999 John G. Dorsey.  All Rights Reserved.
+
+    Alternatively, the contents of this file may be used under the
+    terms of the GNU Public License version 2 (the "GPL"), in which
+    case the provisions of the GPL are applicable instead of the
+    above.  If you wish to allow the use of your version of this file
+    only under the terms of the GPL and not to allow others to use
+    your version of this file under the MPL, indicate your decision
+    by deleting the provisions above and replace them with the notice
+    and other provisions required by the GPL.  If you do not delete
+    the provisions above, a recipient may use your version of this
+    file under either the MPL or the GPL.
+
+======================================================================*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/config.h>
+#include <linux/cpufreq.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/notifier.h>
+#include <linux/spinlock.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+
+#include "soc_common.h"
+#include "sa11xx_base.h"
+
+
+/*
+ * sa1100_pcmcia_default_mecr_timing
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ *
+ * Calculate MECR clock wait states for given CPU clock
+ * speed and command wait state. This function can be over-
+ * written by a board specific version.
+ *
+ * The default is to simply calculate the BS values as specified in
+ * the INTEL SA1100 development manual
+ * "Expansion Memory (PCMCIA) Configuration Register (MECR)"
+ * that's section 10.2.5 in _my_ version of the manual ;)
+ */
+static unsigned int
+sa1100_pcmcia_default_mecr_timing(struct soc_pcmcia_socket *skt,
+                                 unsigned int cpu_speed,
+                                 unsigned int cmd_time)
+{
+       return sa1100_pcmcia_mecr_bs(cmd_time, cpu_speed);
+}
+
+/* sa1100_pcmcia_set_mecr()
+ * ^^^^^^^^^^^^^^^^^^^^^^^^
+ *
+ * set MECR value for socket <sock> based on this sockets
+ * io, mem and attribute space access speed.
+ * Call board specific BS value calculation to allow boards
+ * to tweak the BS values.
+ */
+static int
+sa1100_pcmcia_set_mecr(struct soc_pcmcia_socket *skt, unsigned int cpu_clock)
+{
+       struct soc_pcmcia_timing timing;
+       u32 mecr, old_mecr;
+       unsigned long flags;
+       unsigned int bs_io, bs_mem, bs_attr;
+
+       soc_common_pcmcia_get_timing(skt, &timing);
+
+       bs_io = skt->ops->get_timing(skt, cpu_clock, timing.io);
+       bs_mem = skt->ops->get_timing(skt, cpu_clock, timing.mem);
+       bs_attr = skt->ops->get_timing(skt, cpu_clock, timing.attr);
+
+       local_irq_save(flags);
+
+       old_mecr = mecr = MECR;
+       MECR_FAST_SET(mecr, skt->nr, 0);
+       MECR_BSIO_SET(mecr, skt->nr, bs_io);
+       MECR_BSA_SET(mecr, skt->nr, bs_attr);
+       MECR_BSM_SET(mecr, skt->nr, bs_mem);
+       if (old_mecr != mecr)
+               MECR = mecr;
+
+       local_irq_restore(flags);
+
+       debug(skt, 2, "FAST %X  BSM %X  BSA %X  BSIO %X\n",
+             MECR_FAST_GET(mecr, skt->nr),
+             MECR_BSM_GET(mecr, skt->nr), MECR_BSA_GET(mecr, skt->nr),
+             MECR_BSIO_GET(mecr, skt->nr));
+
+       return 0;
+}
+
+static int
+sa1100_pcmcia_set_timing(struct soc_pcmcia_socket *skt)
+{
+       return sa1100_pcmcia_set_mecr(skt, cpufreq_get(0));
+}
+
+static int
+sa1100_pcmcia_show_timing(struct soc_pcmcia_socket *skt, char *buf)
+{
+       struct soc_pcmcia_timing timing;
+       unsigned int clock = cpufreq_get(0);
+       unsigned long mecr = MECR;
+       char *p = buf;
+
+       soc_common_pcmcia_get_timing(skt, &timing);
+
+       p+=sprintf(p, "I/O      : %u (%u)\n", timing.io,
+                  sa1100_pcmcia_cmd_time(clock, MECR_BSIO_GET(mecr, skt->nr)));
+
+       p+=sprintf(p, "attribute: %u (%u)\n", timing.attr,
+                  sa1100_pcmcia_cmd_time(clock, MECR_BSA_GET(mecr, skt->nr)));
+
+       p+=sprintf(p, "common   : %u (%u)\n", timing.mem,
+                  sa1100_pcmcia_cmd_time(clock, MECR_BSM_GET(mecr, skt->nr)));
+
+       return p - buf;
+}
+
+int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops,
+                           int first, int nr)
+{
+       /*
+        * set default MECR calculation if the board specific
+        * code did not specify one...
+        */
+       if (!ops->get_timing)
+               ops->get_timing = sa1100_pcmcia_default_mecr_timing;
+
+       /* Provide our SA11x0 specific timing routines. */
+       ops->set_timing  = sa1100_pcmcia_set_timing;
+       ops->show_timing = sa1100_pcmcia_show_timing;
+
+       return soc_common_drv_pcmcia_probe(dev, ops, first, nr);
+}
+EXPORT_SYMBOL(sa11xx_drv_pcmcia_probe);
+
+#ifdef CONFIG_CPU_FREQ
+
+/* sa1100_pcmcia_update_mecr()
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ * When sa1100_pcmcia_notifier() decides that a MECR adjustment (due
+ * to a core clock frequency change) is needed, this routine establishes
+ * new BS_xx values consistent with the clock speed `clock'.
+ */
+static void sa1100_pcmcia_update_mecr(unsigned int clock)
+{
+       struct soc_pcmcia_socket *skt;
+
+       down(&soc_pcmcia_sockets_lock);
+       list_for_each_entry(skt, &soc_pcmcia_sockets, node)
+               sa1100_pcmcia_set_mecr(skt, clock);
+       up(&soc_pcmcia_sockets_lock);
+}
+
+/* sa1100_pcmcia_notifier()
+ * ^^^^^^^^^^^^^^^^^^^^^^^^
+ * When changing the processor core clock frequency, it is necessary
+ * to adjust the MECR timings accordingly. We've recorded the timings
+ * requested by Card Services, so this is just a matter of finding
+ * out what our current speed is, and then recomputing the new MECR
+ * values.
+ *
+ * Returns: 0 on success, -1 on error
+ */
+static int
+sa1100_pcmcia_notifier(struct notifier_block *nb, unsigned long val,
+                      void *data)
+{
+       struct cpufreq_freqs *freqs = data;
+
+       switch (val) {
+       case CPUFREQ_PRECHANGE:
+               if (freqs->new > freqs->old)
+                       sa1100_pcmcia_update_mecr(freqs->new);
+               break;
+
+       case CPUFREQ_POSTCHANGE:
+               if (freqs->new < freqs->old)
+                       sa1100_pcmcia_update_mecr(freqs->new);
+               break;
+       case CPUFREQ_RESUMECHANGE:
+               sa1100_pcmcia_update_mecr(freqs->new);
+               break;
+       }
+
+       return 0;
+}
+
+static struct notifier_block sa1100_pcmcia_notifier_block = {
+       .notifier_call  = sa1100_pcmcia_notifier
+};
+
+static int __init sa11xx_pcmcia_init(void)
+{
+       int ret;
+
+       printk(KERN_INFO "SA11xx PCMCIA\n");
+
+       ret = cpufreq_register_notifier(&sa1100_pcmcia_notifier_block,
+                                       CPUFREQ_TRANSITION_NOTIFIER);
+       if (ret < 0)
+               printk(KERN_ERR "Unable to register CPU frequency change "
+                       "notifier (%d)\n", ret);
+
+       return ret;
+}
+module_init(sa11xx_pcmcia_init);
+
+static void __exit sa11xx_pcmcia_exit(void)
+{
+       cpufreq_unregister_notifier(&sa1100_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
+}
+
+module_exit(sa11xx_pcmcia_exit);
+#endif
+
+MODULE_AUTHOR("John Dorsey <john+@cs.cmu.edu>");
+MODULE_DESCRIPTION("Linux PCMCIA Card Services: SA-11xx core socket driver");
+MODULE_LICENSE("Dual MPL/GPL");
diff --git a/drivers/pcmcia/sa11xx_base.h b/drivers/pcmcia/sa11xx_base.h
new file mode 100644 (file)
index 0000000..7bc2082
--- /dev/null
@@ -0,0 +1,123 @@
+/*======================================================================
+
+    Device driver for the PCMCIA control functionality of StrongARM
+    SA-1100 microprocessors.
+
+    The contents of this file are subject to the Mozilla Public
+    License Version 1.1 (the "License"); you may not use this file
+    except in compliance with the License. You may obtain a copy of
+    the License at http://www.mozilla.org/MPL/
+
+    Software distributed under the License is distributed on an "AS
+    IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+    implied. See the License for the specific language governing
+    rights and limitations under the License.
+
+    The initial developer of the original code is John G. Dorsey
+    <john+@cs.cmu.edu>.  Portions created by John G. Dorsey are
+    Copyright (C) 1999 John G. Dorsey.  All Rights Reserved.
+
+    Alternatively, the contents of this file may be used under the
+    terms of the GNU Public License version 2 (the "GPL"), in which
+    case the provisions of the GPL are applicable instead of the
+    above.  If you wish to allow the use of your version of this file
+    only under the terms of the GPL and not to allow others to use
+    your version of this file under the MPL, indicate your decision
+    by deleting the provisions above and replace them with the notice
+    and other provisions required by the GPL.  If you do not delete
+    the provisions above, a recipient may use your version of this
+    file under either the MPL or the GPL.
+
+======================================================================*/
+
+#if !defined(_PCMCIA_SA1100_H)
+# define _PCMCIA_SA1100_H
+
+/* SA-1100 PCMCIA Memory and I/O timing
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ * The SA-1110 Developer's Manual, section 10.2.5, says the following:
+ *
+ *  "To calculate the recommended BS_xx value for each address space:
+ *   divide the command width time (the greater of twIOWR and twIORD,
+ *   or the greater of twWE and twOE) by processor cycle time; divide
+ *   by 2; divide again by 3 (number of BCLK's per command assertion);
+ *   round up to the next whole number; and subtract 1."
+ */
+
+/* MECR: Expansion Memory Configuration Register
+ * (SA-1100 Developers Manual, p.10-13; SA-1110 Developers Manual, p.10-24)
+ *
+ * MECR layout is:
+ *
+ *   FAST1 BSM1<4:0> BSA1<4:0> BSIO1<4:0> FAST0 BSM0<4:0> BSA0<4:0> BSIO0<4:0>
+ *
+ * (This layout is actually true only for the SA-1110; the FASTn bits are
+ * reserved on the SA-1100.)
+ */
+
+#define MECR_SOCKET_0_SHIFT (0)
+#define MECR_SOCKET_1_SHIFT (16)
+
+#define MECR_BS_MASK        (0x1f)
+#define MECR_FAST_MODE_MASK (0x01)
+
+#define MECR_BSIO_SHIFT (0)
+#define MECR_BSA_SHIFT  (5)
+#define MECR_BSM_SHIFT  (10)
+#define MECR_FAST_SHIFT (15)
+
+#define MECR_SET(mecr, sock, shift, mask, bs) \
+((mecr)=((mecr)&~(((mask)<<(shift))<<\
+                  ((sock)==0?MECR_SOCKET_0_SHIFT:MECR_SOCKET_1_SHIFT)))|\
+        (((bs)<<(shift))<<((sock)==0?MECR_SOCKET_0_SHIFT:MECR_SOCKET_1_SHIFT)))
+
+#define MECR_GET(mecr, sock, shift, mask) \
+((((mecr)>>(((sock)==0)?MECR_SOCKET_0_SHIFT:MECR_SOCKET_1_SHIFT))>>\
+ (shift))&(mask))
+
+#define MECR_BSIO_SET(mecr, sock, bs) \
+MECR_SET((mecr), (sock), MECR_BSIO_SHIFT, MECR_BS_MASK, (bs))
+
+#define MECR_BSIO_GET(mecr, sock) \
+MECR_GET((mecr), (sock), MECR_BSIO_SHIFT, MECR_BS_MASK)
+
+#define MECR_BSA_SET(mecr, sock, bs) \
+MECR_SET((mecr), (sock), MECR_BSA_SHIFT, MECR_BS_MASK, (bs))
+
+#define MECR_BSA_GET(mecr, sock) \
+MECR_GET((mecr), (sock), MECR_BSA_SHIFT, MECR_BS_MASK)
+
+#define MECR_BSM_SET(mecr, sock, bs) \
+MECR_SET((mecr), (sock), MECR_BSM_SHIFT, MECR_BS_MASK, (bs))
+
+#define MECR_BSM_GET(mecr, sock) \
+MECR_GET((mecr), (sock), MECR_BSM_SHIFT, MECR_BS_MASK)
+
+#define MECR_FAST_SET(mecr, sock, fast) \
+MECR_SET((mecr), (sock), MECR_FAST_SHIFT, MECR_FAST_MODE_MASK, (fast))
+
+#define MECR_FAST_GET(mecr, sock) \
+MECR_GET((mecr), (sock), MECR_FAST_SHIFT, MECR_FAST_MODE_MASK)
+
+
+/* This function implements the BS value calculation for setting the MECR
+ * using integer arithmetic:
+ */
+static inline unsigned int sa1100_pcmcia_mecr_bs(unsigned int pcmcia_cycle_ns,
+                                                unsigned int cpu_clock_khz){
+  unsigned int t = ((pcmcia_cycle_ns * cpu_clock_khz) / 6) - 1000000;
+  return (t / 1000000) + (((t % 1000000) == 0) ? 0 : 1);
+}
+
+/* This function returns the (approximate) command assertion period, in
+ * nanoseconds, for a given CPU clock frequency and MECR BS value:
+ */
+static inline unsigned int sa1100_pcmcia_cmd_time(unsigned int cpu_clock_khz,
+                                                 unsigned int pcmcia_mecr_bs){
+  return (((10000000 * 2) / cpu_clock_khz) * (3 * (pcmcia_mecr_bs + 1))) / 10;
+}
+
+
+extern int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr);
+
+#endif  /* !defined(_PCMCIA_SA1100_H) */
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
new file mode 100644 (file)
index 0000000..ff8b521
--- /dev/null
@@ -0,0 +1,797 @@
+/*======================================================================
+
+    Common support code for the PCMCIA control functionality of
+    integrated SOCs like the SA-11x0 and PXA2xx microprocessors.
+
+    The contents of this file are subject to the Mozilla Public
+    License Version 1.1 (the "License"); you may not use this file
+    except in compliance with the License. You may obtain a copy of
+    the License at http://www.mozilla.org/MPL/
+
+    Software distributed under the License is distributed on an "AS
+    IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+    implied. See the License for the specific language governing
+    rights and limitations under the License.
+
+    The initial developer of the original code is John G. Dorsey
+    <john+@cs.cmu.edu>.  Portions created by John G. Dorsey are
+    Copyright (C) 1999 John G. Dorsey.  All Rights Reserved.
+
+    Alternatively, the contents of this file may be used under the
+    terms of the GNU Public License version 2 (the "GPL"), in which
+    case the provisions of the GPL are applicable instead of the
+    above.  If you wish to allow the use of your version of this file
+    only under the terms of the GPL and not to allow others to use
+    your version of this file under the MPL, indicate your decision
+    by deleting the provisions above and replace them with the notice
+    and other provisions required by the GPL.  If you do not delete
+    the provisions above, a recipient may use your version of this
+    file under either the MPL or the GPL.
+
+======================================================================*/
+
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/timer.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+#include <linux/spinlock.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+
+#include "soc_common.h"
+
+#ifdef DEBUG
+
+static int pc_debug;
+module_param(pc_debug, int, 0644);
+
+void soc_pcmcia_debug(struct soc_pcmcia_socket *skt, const char *func,
+                     int lvl, const char *fmt, ...)
+{
+       va_list args;
+       if (pc_debug > lvl) {
+               printk(KERN_DEBUG "skt%u: %s: ", skt->nr, func);
+               va_start(args, fmt);
+               printk(fmt, args);
+               va_end(args);
+       }
+}
+
+#endif
+
+#define to_soc_pcmcia_socket(x)        container_of(x, struct soc_pcmcia_socket, socket)
+
+static unsigned short
+calc_speed(unsigned short *spds, int num, unsigned short dflt)
+{
+       unsigned short speed = 0;
+       int i;
+
+       for (i = 0; i < num; i++)
+               if (speed < spds[i])
+                       speed = spds[i];
+       if (speed == 0)
+               speed = dflt;
+
+       return speed;
+}
+
+void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *skt, struct soc_pcmcia_timing *timing)
+{
+       timing->io = calc_speed(skt->spd_io, MAX_IO_WIN, SOC_PCMCIA_IO_ACCESS);
+       timing->mem = calc_speed(skt->spd_mem, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
+       timing->attr = calc_speed(skt->spd_attr, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
+}
+EXPORT_SYMBOL(soc_common_pcmcia_get_timing);
+
+static unsigned int soc_common_pcmcia_skt_state(struct soc_pcmcia_socket *skt)
+{
+       struct pcmcia_state state;
+       unsigned int stat;
+
+       memset(&state, 0, sizeof(struct pcmcia_state));
+
+       skt->ops->socket_state(skt, &state);
+
+       stat = state.detect  ? SS_DETECT : 0;
+       stat |= state.ready  ? SS_READY  : 0;
+       stat |= state.wrprot ? SS_WRPROT : 0;
+       stat |= state.vs_3v  ? SS_3VCARD : 0;
+       stat |= state.vs_Xv  ? SS_XVCARD : 0;
+
+       /* The power status of individual sockets is not available
+        * explicitly from the hardware, so we just remember the state
+        * and regurgitate it upon request:
+        */
+       stat |= skt->cs_state.Vcc ? SS_POWERON : 0;
+
+       if (skt->cs_state.flags & SS_IOCARD)
+               stat |= state.bvd1 ? SS_STSCHG : 0;
+       else {
+               if (state.bvd1 == 0)
+                       stat |= SS_BATDEAD;
+               else if (state.bvd2 == 0)
+                       stat |= SS_BATWARN;
+       }
+       return stat;
+}
+
+/*
+ * soc_common_pcmcia_config_skt
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ *
+ * Convert PCMCIA socket state to our socket configure structure.
+ */
+static int
+soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *state)
+{
+       int ret;
+
+       ret = skt->ops->configure_socket(skt, state);
+       if (ret == 0) {
+               /*
+                * This really needs a better solution.  The IRQ
+                * may or may not be claimed by the driver.
+                */
+               if (skt->irq_state != 1 && state->io_irq) {
+                       skt->irq_state = 1;
+                       set_irq_type(skt->irq, IRQT_FALLING);
+               } else if (skt->irq_state == 1 && state->io_irq == 0) {
+                       skt->irq_state = 0;
+                       set_irq_type(skt->irq, IRQT_NOEDGE);
+               }
+
+               skt->cs_state = *state;
+       }
+
+       if (ret < 0)
+               printk(KERN_ERR "soc_common_pcmcia: unable to configure "
+                      "socket %d\n", skt->nr);
+
+       return ret;
+}
+
+/* soc_common_pcmcia_sock_init()
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ *
+ * (Re-)Initialise the socket, turning on status interrupts
+ * and PCMCIA bus.  This must wait for power to stabilise
+ * so that the card status signals report correctly.
+ *
+ * Returns: 0
+ */
+static int soc_common_pcmcia_sock_init(struct pcmcia_socket *sock)
+{
+       struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
+
+       debug(skt, 2, "initializing socket\n");
+
+       skt->ops->socket_init(skt);
+       return 0;
+}
+
+
+/*
+ * soc_common_pcmcia_suspend()
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ *
+ * Remove power on the socket, disable IRQs from the card.
+ * Turn off status interrupts, and disable the PCMCIA bus.
+ *
+ * Returns: 0
+ */
+static int soc_common_pcmcia_suspend(struct pcmcia_socket *sock)
+{
+       struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
+       int ret;
+
+       debug(skt, 2, "suspending socket\n");
+
+       ret = soc_common_pcmcia_config_skt(skt, &dead_socket);
+       if (ret == 0)
+               skt->ops->socket_suspend(skt);
+
+       return ret;
+}
+
+static spinlock_t status_lock = SPIN_LOCK_UNLOCKED;
+
+static void soc_common_check_status(struct soc_pcmcia_socket *skt)
+{
+       unsigned int events;
+
+       debug(skt, 4, "entering PCMCIA monitoring thread\n");
+
+       do {
+               unsigned int status;
+               unsigned long flags;
+
+               status = soc_common_pcmcia_skt_state(skt);
+
+               spin_lock_irqsave(&status_lock, flags);
+               events = (status ^ skt->status) & skt->cs_state.csc_mask;
+               skt->status = status;
+               spin_unlock_irqrestore(&status_lock, flags);
+
+               debug(skt, 4, "events: %s%s%s%s%s%s\n",
+                       events == 0         ? "<NONE>"   : "",
+                       events & SS_DETECT  ? "DETECT "  : "",
+                       events & SS_READY   ? "READY "   : "",
+                       events & SS_BATDEAD ? "BATDEAD " : "",
+                       events & SS_BATWARN ? "BATWARN " : "",
+                       events & SS_STSCHG  ? "STSCHG "  : "");
+
+               if (events)
+                       pcmcia_parse_events(&skt->socket, events);
+       } while (events);
+}
+
+/* Let's poll for events in addition to IRQs since IRQ only is unreliable... */
+static void soc_common_pcmcia_poll_event(unsigned long dummy)
+{
+       struct soc_pcmcia_socket *skt = (struct soc_pcmcia_socket *)dummy;
+       debug(skt, 4, "polling for events\n");
+
+       mod_timer(&skt->poll_timer, jiffies + SOC_PCMCIA_POLL_PERIOD);
+
+       soc_common_check_status(skt);
+}
+
+
+/*
+ * Service routine for socket driver interrupts (requested by the
+ * low-level PCMCIA init() operation via soc_common_pcmcia_thread()).
+ * The actual interrupt-servicing work is performed by
+ * soc_common_pcmcia_thread(), largely because the Card Services event-
+ * handling code performs scheduling operations which cannot be
+ * executed from within an interrupt context.
+ */
+static irqreturn_t soc_common_pcmcia_interrupt(int irq, void *dev, struct pt_regs *regs)
+{
+       struct soc_pcmcia_socket *skt = dev;
+
+       debug(skt, 3, "servicing IRQ %d\n", irq);
+
+       soc_common_check_status(skt);
+
+       return IRQ_HANDLED;
+}
+
+
+/*
+ *  Implements the get_status() operation for the in-kernel PCMCIA
+ * service (formerly SS_GetStatus in Card Services). Essentially just
+ * fills in bits in `status' according to internal driver state or
+ * the value of the voltage detect chipselect register.
+ *
+ * As a debugging note, during card startup, the PCMCIA core issues
+ * three set_socket() commands in a row the first with RESET deasserted,
+ * the second with RESET asserted, and the last with RESET deasserted
+ * again. Following the third set_socket(), a get_status() command will
+ * be issued. The kernel is looking for the SS_READY flag (see
+ * setup_socket(), reset_socket(), and unreset_socket() in cs.c).
+ *
+ * Returns: 0
+ */
+static int
+soc_common_pcmcia_get_status(struct pcmcia_socket *sock, unsigned int *status)
+{
+       struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
+
+       skt->status = soc_common_pcmcia_skt_state(skt);
+       *status = skt->status;
+
+       return 0;
+}
+
+
+/*
+ * Implements the get_socket() operation for the in-kernel PCMCIA
+ * service (formerly SS_GetSocket in Card Services). Not a very
+ * exciting routine.
+ *
+ * Returns: 0
+ */
+static int
+soc_common_pcmcia_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
+{
+       struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
+
+       debug(skt, 2, "\n");
+
+       *state = skt->cs_state;
+
+       return 0;
+}
+
+/*
+ * Implements the set_socket() operation for the in-kernel PCMCIA
+ * service (formerly SS_SetSocket in Card Services). We more or
+ * less punt all of this work and let the kernel handle the details
+ * of power configuration, reset, &c. We also record the value of
+ * `state' in order to regurgitate it to the PCMCIA core later.
+ *
+ * Returns: 0
+ */
+static int
+soc_common_pcmcia_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
+{
+       struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
+
+       debug(skt, 2, "mask: %s%s%s%s%s%sflags: %s%s%s%s%s%sVcc %d Vpp %d irq %d\n",
+                       (state->csc_mask==0)?"<NONE> ":"",
+                       (state->csc_mask&SS_DETECT)?"DETECT ":"",
+                       (state->csc_mask&SS_READY)?"READY ":"",
+                       (state->csc_mask&SS_BATDEAD)?"BATDEAD ":"",
+                       (state->csc_mask&SS_BATWARN)?"BATWARN ":"",
+                       (state->csc_mask&SS_STSCHG)?"STSCHG ":"",
+                       (state->flags==0)?"<NONE> ":"",
+                       (state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"",
+                       (state->flags&SS_IOCARD)?"IOCARD ":"",
+                       (state->flags&SS_RESET)?"RESET ":"",
+                       (state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"",
+                       (state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"",
+                       state->Vcc, state->Vpp, state->io_irq);
+
+       return soc_common_pcmcia_config_skt(skt, state);
+}
+
+
+/*
+ * Implements the set_io_map() operation for the in-kernel PCMCIA
+ * service (formerly SS_SetIOMap in Card Services). We configure
+ * the map speed as requested, but override the address ranges
+ * supplied by Card Services.
+ *
+ * Returns: 0 on success, -1 on error
+ */
+static int
+soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *map)
+{
+       struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
+       unsigned short speed = map->speed;
+
+       debug(skt, 2, "map %u  speed %u start 0x%08x stop 0x%08x\n",
+               map->map, map->speed, map->start, map->stop);
+       debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n",
+               (map->flags==0)?"<NONE>":"",
+               (map->flags&MAP_ACTIVE)?"ACTIVE ":"",
+               (map->flags&MAP_16BIT)?"16BIT ":"",
+               (map->flags&MAP_AUTOSZ)?"AUTOSZ ":"",
+               (map->flags&MAP_0WS)?"0WS ":"",
+               (map->flags&MAP_WRPROT)?"WRPROT ":"",
+               (map->flags&MAP_USE_WAIT)?"USE_WAIT ":"",
+               (map->flags&MAP_PREFETCH)?"PREFETCH ":"");
+
+       if (map->map >= MAX_IO_WIN) {
+               printk(KERN_ERR "%s(): map (%d) out of range\n", __FUNCTION__,
+                      map->map);
+               return -1;
+       }
+
+       if (map->flags & MAP_ACTIVE) {
+               if (speed == 0)
+                       speed = SOC_PCMCIA_IO_ACCESS;
+       } else {
+               speed = 0;
+       }
+
+       skt->spd_io[map->map] = speed;
+       skt->ops->set_timing(skt);
+
+       if (map->stop == 1)
+               map->stop = PAGE_SIZE-1;
+
+       map->stop -= map->start;
+       map->stop += (unsigned long)skt->virt_io;
+       map->start = (unsigned long)skt->virt_io;
+
+       return 0;
+}
+
+
+/*
+ * Implements the set_mem_map() operation for the in-kernel PCMCIA
+ * service (formerly SS_SetMemMap in Card Services). We configure
+ * the map speed as requested, but override the address ranges
+ * supplied by Card Services.
+ *
+ * Returns: 0 on success, -1 on error
+ */
+static int
+soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *map)
+{
+       struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
+       struct resource *res;
+       unsigned short speed = map->speed;
+
+       debug(skt, 2, "map %u speed %u card_start %08x\n",
+               map->map, map->speed, map->card_start);
+       debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n",
+               (map->flags==0)?"<NONE>":"",
+               (map->flags&MAP_ACTIVE)?"ACTIVE ":"",
+               (map->flags&MAP_16BIT)?"16BIT ":"",
+               (map->flags&MAP_AUTOSZ)?"AUTOSZ ":"",
+               (map->flags&MAP_0WS)?"0WS ":"",
+               (map->flags&MAP_WRPROT)?"WRPROT ":"",
+               (map->flags&MAP_ATTRIB)?"ATTRIB ":"",
+               (map->flags&MAP_USE_WAIT)?"USE_WAIT ":"");
+
+       if (map->map >= MAX_WIN)
+               return -EINVAL;
+
+       if (map->flags & MAP_ACTIVE) {
+               if (speed == 0)
+                       speed = 300;
+       } else {
+               speed = 0;
+       }
+
+       if (map->flags & MAP_ATTRIB) {
+               res = &skt->res_attr;
+               skt->spd_attr[map->map] = speed;
+               skt->spd_mem[map->map] = 0;
+       } else {
+               res = &skt->res_mem;
+               skt->spd_attr[map->map] = 0;
+               skt->spd_mem[map->map] = speed;
+       }
+
+       skt->ops->set_timing(skt);
+
+       map->sys_stop -= map->sys_start;
+       map->sys_stop += res->start + map->card_start;
+       map->sys_start = res->start + map->card_start;
+
+       return 0;
+}
+
+struct bittbl {
+       unsigned int mask;
+       const char *name;
+};
+
+static struct bittbl status_bits[] = {
+       { SS_WRPROT,            "SS_WRPROT"     },
+       { SS_BATDEAD,           "SS_BATDEAD"    },
+       { SS_BATWARN,           "SS_BATWARN"    },
+       { SS_READY,             "SS_READY"      },
+       { SS_DETECT,            "SS_DETECT"     },
+       { SS_POWERON,           "SS_POWERON"    },
+       { SS_STSCHG,            "SS_STSCHG"     },
+       { SS_3VCARD,            "SS_3VCARD"     },
+       { SS_XVCARD,            "SS_XVCARD"     },
+};
+
+static struct bittbl conf_bits[] = {
+       { SS_PWR_AUTO,          "SS_PWR_AUTO"   },
+       { SS_IOCARD,            "SS_IOCARD"     },
+       { SS_RESET,             "SS_RESET"      },
+       { SS_DMA_MODE,          "SS_DMA_MODE"   },
+       { SS_SPKR_ENA,          "SS_SPKR_ENA"   },
+       { SS_OUTPUT_ENA,        "SS_OUTPUT_ENA" },
+};
+
+static void
+dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, int sz)
+{
+       char *b = *p;
+       int i;
+
+       b += sprintf(b, "%-9s:", prefix);
+       for (i = 0; i < sz; i++)
+               if (val & bits[i].mask)
+                       b += sprintf(b, " %s", bits[i].name);
+       *b++ = '\n';
+       *p = b;
+}
+
+/*
+ * Implements the /sys/class/pcmcia_socket/??/status file.
+ *
+ * Returns: the number of characters added to the buffer
+ */
+static ssize_t show_status(struct class_device *class_dev, char *buf)
+{
+       struct soc_pcmcia_socket *skt =
+               container_of(class_dev, struct soc_pcmcia_socket, socket.dev);
+       char *p = buf;
+
+       p+=sprintf(p, "slot     : %d\n", skt->nr);
+
+       dump_bits(&p, "status", skt->status,
+                 status_bits, ARRAY_SIZE(status_bits));
+       dump_bits(&p, "csc_mask", skt->cs_state.csc_mask,
+                 status_bits, ARRAY_SIZE(status_bits));
+       dump_bits(&p, "cs_flags", skt->cs_state.flags,
+                 conf_bits, ARRAY_SIZE(conf_bits));
+
+       p+=sprintf(p, "Vcc      : %d\n", skt->cs_state.Vcc);
+       p+=sprintf(p, "Vpp      : %d\n", skt->cs_state.Vpp);
+       p+=sprintf(p, "IRQ      : %d (%d)\n", skt->cs_state.io_irq, skt->irq);
+       if (skt->ops->show_timing)
+               p+=skt->ops->show_timing(skt, p);
+
+       return p-buf;
+}
+static CLASS_DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
+
+
+static struct pccard_operations soc_common_pcmcia_operations = {
+       .init                   = soc_common_pcmcia_sock_init,
+       .suspend                = soc_common_pcmcia_suspend,
+       .get_status             = soc_common_pcmcia_get_status,
+       .get_socket             = soc_common_pcmcia_get_socket,
+       .set_socket             = soc_common_pcmcia_set_socket,
+       .set_io_map             = soc_common_pcmcia_set_io_map,
+       .set_mem_map            = soc_common_pcmcia_set_mem_map,
+};
+
+
+int soc_pcmcia_request_irqs(struct soc_pcmcia_socket *skt,
+                           struct pcmcia_irqs *irqs, int nr)
+{
+       int i, res = 0;
+
+       for (i = 0; i < nr; i++) {
+               if (irqs[i].sock != skt->nr)
+                       continue;
+               res = request_irq(irqs[i].irq, soc_common_pcmcia_interrupt,
+                                 SA_INTERRUPT, irqs[i].str, skt);
+               if (res)
+                       break;
+               set_irq_type(irqs[i].irq, IRQT_NOEDGE);
+       }
+
+       if (res) {
+               printk(KERN_ERR "PCMCIA: request for IRQ%d failed (%d)\n",
+                       irqs[i].irq, res);
+
+               while (i--)
+                       if (irqs[i].sock == skt->nr)
+                               free_irq(irqs[i].irq, skt);
+       }
+       return res;
+}
+EXPORT_SYMBOL(soc_pcmcia_request_irqs);
+
+void soc_pcmcia_free_irqs(struct soc_pcmcia_socket *skt,
+                         struct pcmcia_irqs *irqs, int nr)
+{
+       int i;
+
+       for (i = 0; i < nr; i++)
+               if (irqs[i].sock == skt->nr)
+                       free_irq(irqs[i].irq, skt);
+}
+EXPORT_SYMBOL(soc_pcmcia_free_irqs);
+
+void soc_pcmcia_disable_irqs(struct soc_pcmcia_socket *skt,
+                            struct pcmcia_irqs *irqs, int nr)
+{
+       int i;
+
+       for (i = 0; i < nr; i++)
+               if (irqs[i].sock == skt->nr)
+                       set_irq_type(irqs[i].irq, IRQT_NOEDGE);
+}
+EXPORT_SYMBOL(soc_pcmcia_disable_irqs);
+
+void soc_pcmcia_enable_irqs(struct soc_pcmcia_socket *skt,
+                           struct pcmcia_irqs *irqs, int nr)
+{
+       int i;
+
+       for (i = 0; i < nr; i++)
+               if (irqs[i].sock == skt->nr) {
+                       set_irq_type(irqs[i].irq, IRQT_RISING);
+                       set_irq_type(irqs[i].irq, IRQT_BOTHEDGE);
+               }
+}
+EXPORT_SYMBOL(soc_pcmcia_enable_irqs);
+
+
+LIST_HEAD(soc_pcmcia_sockets);
+DECLARE_MUTEX(soc_pcmcia_sockets_lock);
+
+static const char *skt_names[] = {
+       "PCMCIA socket 0",
+       "PCMCIA socket 1",
+};
+
+struct skt_dev_info {
+       int nskt;
+       struct soc_pcmcia_socket skt[0];
+};
+
+#define SKT_DEV_INFO_SIZE(n) \
+       (sizeof(struct skt_dev_info) + (n)*sizeof(struct soc_pcmcia_socket))
+
+int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr)
+{
+       struct skt_dev_info *sinfo;
+       int ret, i;
+
+       down(&soc_pcmcia_sockets_lock);
+
+       sinfo = kmalloc(SKT_DEV_INFO_SIZE(nr), GFP_KERNEL);
+       if (!sinfo) {
+               ret = -ENOMEM;
+               goto out;
+       }
+
+       memset(sinfo, 0, SKT_DEV_INFO_SIZE(nr));
+       sinfo->nskt = nr;
+
+       /*
+        * Initialise the per-socket structure.
+        */
+       for (i = 0; i < nr; i++) {
+               struct soc_pcmcia_socket *skt = &sinfo->skt[i];
+
+               skt->socket.ops = &soc_common_pcmcia_operations;
+               skt->socket.owner = ops->owner;
+               skt->socket.dev.dev = dev;
+
+               init_timer(&skt->poll_timer);
+               skt->poll_timer.function = soc_common_pcmcia_poll_event;
+               skt->poll_timer.data = (unsigned long)skt;
+               skt->poll_timer.expires = jiffies + SOC_PCMCIA_POLL_PERIOD;
+
+               skt->nr         = first + i;
+               skt->irq        = NO_IRQ;
+               skt->dev        = dev;
+               skt->ops        = ops;
+
+               skt->res_skt.start      = _PCMCIA(skt->nr);
+               skt->res_skt.end        = _PCMCIA(skt->nr) + PCMCIASp - 1;
+               skt->res_skt.name       = skt_names[skt->nr];
+               skt->res_skt.flags      = IORESOURCE_MEM;
+
+               ret = request_resource(&iomem_resource, &skt->res_skt);
+               if (ret)
+                       goto out_err_1;
+
+               skt->res_io.start       = _PCMCIAIO(skt->nr);
+               skt->res_io.end         = _PCMCIAIO(skt->nr) + PCMCIAIOSp - 1;
+               skt->res_io.name        = "io";
+               skt->res_io.flags       = IORESOURCE_MEM | IORESOURCE_BUSY;
+
+               ret = request_resource(&skt->res_skt, &skt->res_io);
+               if (ret)
+                       goto out_err_2;
+
+               skt->res_mem.start      = _PCMCIAMem(skt->nr);
+               skt->res_mem.end        = _PCMCIAMem(skt->nr) + PCMCIAMemSp - 1;
+               skt->res_mem.name       = "memory";
+               skt->res_mem.flags      = IORESOURCE_MEM;
+
+               ret = request_resource(&skt->res_skt, &skt->res_mem);
+               if (ret)
+                       goto out_err_3;
+
+               skt->res_attr.start     = _PCMCIAAttr(skt->nr);
+               skt->res_attr.end       = _PCMCIAAttr(skt->nr) + PCMCIAAttrSp - 1;
+               skt->res_attr.name      = "attribute";
+               skt->res_attr.flags     = IORESOURCE_MEM;
+
+               ret = request_resource(&skt->res_skt, &skt->res_attr);
+               if (ret)
+                       goto out_err_4;
+
+               skt->virt_io = ioremap(skt->res_io.start, 0x10000);
+               if (skt->virt_io == NULL) {
+                       ret = -ENOMEM;
+                       goto out_err_5;
+               }
+
+               list_add(&skt->node, &soc_pcmcia_sockets);
+
+               /*
+                * We initialize default socket timing here, because
+                * we are not guaranteed to see a SetIOMap operation at
+                * runtime.
+                */
+               ops->set_timing(skt);
+
+               ret = ops->hw_init(skt);
+               if (ret)
+                       goto out_err_6;
+
+               skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
+               skt->socket.irq_mask = 0;
+               skt->socket.map_size = PAGE_SIZE;
+               skt->socket.pci_irq = skt->irq;
+               skt->socket.io_offset = (unsigned long)skt->virt_io;
+
+               skt->status = soc_common_pcmcia_skt_state(skt);
+
+               ret = pcmcia_register_socket(&skt->socket);
+               if (ret)
+                       goto out_err_7;
+
+               WARN_ON(skt->socket.sock != i);
+
+               add_timer(&skt->poll_timer);
+
+               class_device_create_file(&skt->socket.dev, &class_device_attr_status);
+       }
+
+       dev_set_drvdata(dev, sinfo);
+       ret = 0;
+       goto out;
+
+       do {
+               struct soc_pcmcia_socket *skt = &sinfo->skt[i];
+
+               del_timer_sync(&skt->poll_timer);
+               pcmcia_unregister_socket(&skt->socket);
+
+ out_err_7:
+               flush_scheduled_work();
+
+               ops->hw_shutdown(skt);
+ out_err_6:
+               list_del(&skt->node);
+               iounmap(skt->virt_io);
+ out_err_5:
+               release_resource(&skt->res_attr);
+ out_err_4:
+               release_resource(&skt->res_mem);
+ out_err_3:
+               release_resource(&skt->res_io);
+ out_err_2:
+               release_resource(&skt->res_skt);
+ out_err_1:
+               i--;
+       } while (i > 0);
+
+       kfree(sinfo);
+
+ out:
+       up(&soc_pcmcia_sockets_lock);
+       return ret;
+}
+
+int soc_common_drv_pcmcia_remove(struct device *dev)
+{
+       struct skt_dev_info *sinfo = dev_get_drvdata(dev);
+       int i;
+
+       dev_set_drvdata(dev, NULL);
+
+       down(&soc_pcmcia_sockets_lock);
+       for (i = 0; i < sinfo->nskt; i++) {
+               struct soc_pcmcia_socket *skt = &sinfo->skt[i];
+
+               del_timer_sync(&skt->poll_timer);
+
+               pcmcia_unregister_socket(&skt->socket);
+
+               flush_scheduled_work();
+
+               skt->ops->hw_shutdown(skt);
+
+               soc_common_pcmcia_config_skt(skt, &dead_socket);
+
+               list_del(&skt->node);
+               iounmap(skt->virt_io);
+               skt->virt_io = NULL;
+               release_resource(&skt->res_attr);
+               release_resource(&skt->res_mem);
+               release_resource(&skt->res_io);
+               release_resource(&skt->res_skt);
+       }
+       up(&soc_pcmcia_sockets_lock);
+
+       kfree(sinfo);
+
+       return 0;
+}
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h
new file mode 100644 (file)
index 0000000..60e3019
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+ * linux/drivers/pcmcia/soc_common.h
+ *
+ * Copyright (C) 2000 John G Dorsey <john+@cs.cmu.edu>
+ *
+ * This file contains definitions for the PCMCIA support code common to
+ * integrated SOCs like the SA-11x0 and PXA2xx microprocessors.
+ */
+#ifndef _ASM_ARCH_PCMCIA
+#define _ASM_ARCH_PCMCIA
+
+/* include the world */
+#include <pcmcia/version.h>
+#include <pcmcia/cs_types.h>
+#include <pcmcia/cs.h>
+#include <pcmcia/ss.h>
+#include <pcmcia/bulkmem.h>
+#include <pcmcia/cistpl.h>
+#include "cs_internal.h"
+
+
+struct device;
+struct pcmcia_low_level;
+
+/*
+ * This structure encapsulates per-socket state which we might need to
+ * use when responding to a Card Services query of some kind.
+ */
+struct soc_pcmcia_socket {
+       struct pcmcia_socket    socket;
+
+       /*
+        * Info from low level handler
+        */
+       struct device           *dev;
+       unsigned int            nr;
+       unsigned int            irq;
+
+       /*
+        * Core PCMCIA state
+        */
+       struct pcmcia_low_level *ops;
+
+       unsigned int            status;
+       socket_state_t          cs_state;
+
+       unsigned short          spd_io[MAX_IO_WIN];
+       unsigned short          spd_mem[MAX_WIN];
+       unsigned short          spd_attr[MAX_WIN];
+
+       struct resource         res_skt;
+       struct resource         res_io;
+       struct resource         res_mem;
+       struct resource         res_attr;
+       void                    *virt_io;
+
+       unsigned int            irq_state;
+
+       struct timer_list       poll_timer;
+       struct list_head        node;
+};
+
+struct pcmcia_state {
+  unsigned detect: 1,
+            ready: 1,
+             bvd1: 1,
+             bvd2: 1,
+           wrprot: 1,
+            vs_3v: 1,
+            vs_Xv: 1;
+};
+
+struct pcmcia_low_level {
+       struct module *owner;
+
+       /* first socket in system */
+       int first;
+       /* nr of sockets */
+       int nr;
+
+       int (*hw_init)(struct soc_pcmcia_socket *);
+       void (*hw_shutdown)(struct soc_pcmcia_socket *);
+
+       void (*socket_state)(struct soc_pcmcia_socket *, struct pcmcia_state *);
+       int (*configure_socket)(struct soc_pcmcia_socket *, const socket_state_t *);
+
+       /*
+        * Enable card status IRQs on (re-)initialisation.  This can
+        * be called at initialisation, power management event, or
+        * pcmcia event.
+        */
+       void (*socket_init)(struct soc_pcmcia_socket *);
+
+       /*
+        * Disable card status IRQs and PCMCIA bus on suspend.
+        */
+       void (*socket_suspend)(struct soc_pcmcia_socket *);
+
+       /*
+        * Hardware specific timing routines.
+        * If provided, the get_timing routine overrides the SOC default.
+        */
+       unsigned int (*get_timing)(struct soc_pcmcia_socket *, unsigned int, unsigned int);
+       int (*set_timing)(struct soc_pcmcia_socket *);
+       int (*show_timing)(struct soc_pcmcia_socket *, char *);
+};
+
+
+struct pcmcia_irqs {
+       int sock;
+       int irq;
+       const char *str;
+};
+
+struct soc_pcmcia_timing {
+       unsigned short io;
+       unsigned short mem;
+       unsigned short attr;
+};
+
+extern int soc_pcmcia_request_irqs(struct soc_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr);
+extern void soc_pcmcia_free_irqs(struct soc_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr);
+extern void soc_pcmcia_disable_irqs(struct soc_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr);
+extern void soc_pcmcia_enable_irqs(struct soc_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr);
+extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_pcmcia_timing *);
+
+
+extern struct list_head soc_pcmcia_sockets;
+extern struct semaphore soc_pcmcia_sockets_lock;
+
+extern int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr);
+extern int soc_common_drv_pcmcia_remove(struct device *dev);
+
+
+#ifdef DEBUG
+
+extern void soc_pcmcia_debug(struct soc_pcmcia_socket *skt, const char *func,
+                            int lvl, const char *fmt, ...);
+
+#define debug(skt, lvl, fmt, arg...) \
+       soc_pcmcia_debug(skt, __func__, lvl, fmt , ## arg)
+
+#else
+#define debug(skt, lvl, fmt, arg...) do { } while (0)
+#endif
+
+
+/*
+ * The PC Card Standard, Release 7, section 4.13.4, says that twIORD
+ * has a minimum value of 165ns. Section 4.13.5 says that twIOWR has
+ * a minimum value of 165ns, as well. Section 4.7.2 (describing
+ * common and attribute memory write timing) says that twWE has a
+ * minimum value of 150ns for a 250ns cycle time (for 5V operation;
+ * see section 4.7.4), or 300ns for a 600ns cycle time (for 3.3V
+ * operation, also section 4.7.4). Section 4.7.3 says that taOE
+ * has a maximum value of 150ns for a 300ns cycle time (for 5V
+ * operation), or 300ns for a 600ns cycle time (for 3.3V operation).
+ *
+ * When configuring memory maps, Card Services appears to adopt the policy
+ * that a memory access time of "0" means "use the default." The default
+ * PCMCIA I/O command width time is 165ns. The default PCMCIA 5V attribute
+ * and memory command width time is 150ns; the PCMCIA 3.3V attribute and
+ * memory command width time is 300ns.
+ */
+#define SOC_PCMCIA_IO_ACCESS           (165)
+#define SOC_PCMCIA_5V_MEM_ACCESS       (150)
+#define SOC_PCMCIA_3V_MEM_ACCESS       (300)
+#define SOC_PCMCIA_ATTR_MEM_ACCESS     (300)
+
+/*
+ * The socket driver actually works nicely in interrupt-driven form,
+ * so the (relatively infrequent) polling is "just to be sure."
+ */
+#define SOC_PCMCIA_POLL_PERIOD    (2*HZ)
+
+
+/* I/O pins replacing memory pins
+ * (PCMCIA System Architecture, 2nd ed., by Don Anderson, p.75)
+ *
+ * These signals change meaning when going from memory-only to
+ * memory-or-I/O interface:
+ */
+#define iostschg bvd1
+#define iospkr   bvd2
+
+#endif
diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c
new file mode 100644 (file)
index 0000000..5b6ce0a
--- /dev/null
@@ -0,0 +1,637 @@
+/*----------------------------------------------------------------*/
+/*
+   Qlogic linux driver - work in progress. No Warranty express or implied.
+   Use at your own risk.  Support Tort Reform so you won't have to read all
+   these silly disclaimers.
+
+   Copyright 1994, Tom Zerucha.   
+   tz@execpc.com
+   
+   Additional Code, and much appreciated help by
+   Michael A. Griffith
+   grif@cs.ucr.edu
+
+   Thanks to Eric Youngdale and Dave Hinds for loadable module and PCMCIA
+   help respectively, and for suffering through my foolishness during the
+   debugging process.
+
+   Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994
+   (you can reference it, but it is incomplete and inaccurate in places)
+
+   Version 0.46 1/30/97 - kernel 1.2.0+
+
+   Functions as standalone, loadable, and PCMCIA driver, the latter from
+   Dave Hinds' PCMCIA package.
+   
+   Cleaned up 26/10/2002 by Alan Cox <alan@redhat.com> as part of the 2.5
+   SCSI driver cleanup and audit. This driver still needs work on the
+   following
+       -       Non terminating hardware waits
+       -       Some layering violations with its pcmcia stub
+
+   Redistributable under terms of the GNU General Public License
+
+   For the avoidance of doubt the "preferred form" of this code is one which
+   is in an open non patent encumbered format. Where cryptographic key signing
+   forms part of the process of creating an executable the information
+   including keys needed to generate an equivalently functional executable
+   are deemed to be part of the source code.
+
+*/
+
+#include <linux/module.h>
+#include <linux/blkdev.h>              /* to get disk capacity */
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/proc_fs.h>
+#include <linux/unistd.h>
+#include <linux/spinlock.h>
+#include <linux/stat.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/dma.h>
+
+#include "scsi.h"
+#include <scsi/scsi_host.h>
+#include "qlogicfas408.h"
+
+/*----------------------------------------------------------------*/
+static int qlcfg5 = (XTALFREQ << 5);   /* 15625/512 */
+static int qlcfg6 = SYNCXFRPD;
+static int qlcfg7 = SYNCOFFST;
+static int qlcfg8 = (SLOWCABLE << 7) | (QL_ENABLE_PARITY << 4);
+static int qlcfg9 = ((XTALFREQ + 4) / 5);
+static int qlcfgc = (FASTCLK << 3) | (FASTSCSI << 4);
+
+/*----------------------------------------------------------------*/
+
+/*----------------------------------------------------------------*/
+/* local functions */
+/*----------------------------------------------------------------*/
+
+/* error recovery - reset everything */
+
+static void ql_zap(struct qlogicfas408_priv *priv)
+{
+       int x;
+       int qbase = priv->qbase;
+       int int_type = priv->int_type;
+
+       x = inb(qbase + 0xd);
+       REG0;
+       outb(3, qbase + 3);     /* reset SCSI */
+       outb(2, qbase + 3);     /* reset chip */
+       if (x & 0x80)
+               REG1;
+}
+
+/*
+ *     Do a pseudo-dma tranfer
+ */
+static int ql_pdma(struct qlogicfas408_priv *priv, int phase, char *request, int reqlen)
+{
+       int j;
+       int qbase = priv->qbase;
+       j = 0;
+       if (phase & 1) {        /* in */
+#if QL_TURBO_PDMA
+               rtrc(4)
+               /* empty fifo in large chunks */
+               if (reqlen >= 128 && (inb(qbase + 8) & 2)) {    /* full */
+                       insl(qbase + 4, request, 32);
+                       reqlen -= 128;
+                       request += 128;
+               }
+               while (reqlen >= 84 && !(j & 0xc0))     /* 2/3 */
+                       if ((j = inb(qbase + 8)) & 4) 
+                       {
+                               insl(qbase + 4, request, 21);
+                               reqlen -= 84;
+                               request += 84;
+                       }
+               if (reqlen >= 44 && (inb(qbase + 8) & 8)) {     /* 1/3 */
+                       insl(qbase + 4, request, 11);
+                       reqlen -= 44;
+                       request += 44;
+               }
+#endif
+               /* until both empty and int (or until reclen is 0) */
+               rtrc(7)
+               j = 0;
+               while (reqlen && !((j & 0x10) && (j & 0xc0))) 
+               {
+                       /* while bytes to receive and not empty */
+                       j &= 0xc0;
+                       while (reqlen && !((j = inb(qbase + 8)) & 0x10)) 
+                       {
+                               *request++ = inb(qbase + 4);
+                               reqlen--;
+                       }
+                       if (j & 0x10)
+                               j = inb(qbase + 8);
+
+               }
+       } else {                /* out */
+#if QL_TURBO_PDMA
+               rtrc(4)
+                   if (reqlen >= 128 && inb(qbase + 8) & 0x10) {       /* empty */
+                       outsl(qbase + 4, request, 32);
+                       reqlen -= 128;
+                       request += 128;
+               }
+               while (reqlen >= 84 && !(j & 0xc0))     /* 1/3 */
+                       if (!((j = inb(qbase + 8)) & 8)) {
+                               outsl(qbase + 4, request, 21);
+                               reqlen -= 84;
+                               request += 84;
+                       }
+               if (reqlen >= 40 && !(inb(qbase + 8) & 4)) {    /* 2/3 */
+                       outsl(qbase + 4, request, 10);
+                       reqlen -= 40;
+                       request += 40;
+               }
+#endif
+               /* until full and int (or until reclen is 0) */
+               rtrc(7)
+                   j = 0;
+               while (reqlen && !((j & 2) && (j & 0xc0))) {
+                       /* while bytes to send and not full */
+                       while (reqlen && !((j = inb(qbase + 8)) & 2)) 
+                       {
+                               outb(*request++, qbase + 4);
+                               reqlen--;
+                       }
+                       if (j & 2)
+                               j = inb(qbase + 8);
+               }
+       }
+       /* maybe return reqlen */
+       return inb(qbase + 8) & 0xc0;
+}
+
+/*
+ *     Wait for interrupt flag (polled - not real hardware interrupt) 
+ */
+
+static int ql_wai(struct qlogicfas408_priv *priv)
+{
+       int k;
+       int qbase = priv->qbase;
+       unsigned long i;
+
+       k = 0;
+       i = jiffies + WATCHDOG;
+       while (time_before(jiffies, i) && !priv->qabort &&
+                                       !((k = inb(qbase + 4)) & 0xe0)) {
+               barrier();
+               cpu_relax();
+       }
+       if (time_after_eq(jiffies, i))
+               return (DID_TIME_OUT);
+       if (priv->qabort)
+               return (priv->qabort == 1 ? DID_ABORT : DID_RESET);
+       if (k & 0x60)
+               ql_zap(priv);
+       if (k & 0x20)
+               return (DID_PARITY);
+       if (k & 0x40)
+               return (DID_ERROR);
+       return 0;
+}
+
+/*
+ *     Initiate scsi command - queueing handler 
+ *     caller must hold host lock
+ */
+
+static void ql_icmd(Scsi_Cmnd * cmd)
+{
+       struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
+       int     qbase = priv->qbase;
+       int     int_type = priv->int_type;
+       unsigned int i;
+
+       priv->qabort = 0;
+
+       REG0;
+       /* clearing of interrupts and the fifo is needed */
+
+       inb(qbase + 5);         /* clear interrupts */
+       if (inb(qbase + 5))     /* if still interrupting */
+               outb(2, qbase + 3);     /* reset chip */
+       else if (inb(qbase + 7) & 0x1f)
+               outb(1, qbase + 3);     /* clear fifo */
+       while (inb(qbase + 5)); /* clear ints */
+       REG1;
+       outb(1, qbase + 8);     /* set for PIO pseudo DMA */
+       outb(0, qbase + 0xb);   /* disable ints */
+       inb(qbase + 8);         /* clear int bits */
+       REG0;
+       outb(0x40, qbase + 0xb);        /* enable features */
+
+       /* configurables */
+       outb(qlcfgc, qbase + 0xc);
+       /* config: no reset interrupt, (initiator) bus id */
+       outb(0x40 | qlcfg8 | priv->qinitid, qbase + 8);
+       outb(qlcfg7, qbase + 7);
+       outb(qlcfg6, qbase + 6);
+        /**/ outb(qlcfg5, qbase + 5);  /* select timer */
+       outb(qlcfg9 & 7, qbase + 9);    /* prescaler */
+/*     outb(0x99, qbase + 5);  */
+       outb(cmd->device->id, qbase + 4);
+
+       for (i = 0; i < cmd->cmd_len; i++)
+               outb(cmd->cmnd[i], qbase + 2);
+
+       priv->qlcmd = cmd;
+       outb(0x41, qbase + 3);  /* select and send command */
+}
+
+/*
+ *     Process scsi command - usually after interrupt 
+ */
+
+static unsigned int ql_pcmd(Scsi_Cmnd * cmd)
+{
+       unsigned int i, j;
+       unsigned long k;
+       unsigned int result;    /* ultimate return result */
+       unsigned int status;    /* scsi returned status */
+       unsigned int message;   /* scsi returned message */
+       unsigned int phase;     /* recorded scsi phase */
+       unsigned int reqlen;    /* total length of transfer */
+       struct scatterlist *sglist;     /* scatter-gather list pointer */
+       unsigned int sgcount;   /* sg counter */
+       char *buf;
+       struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
+       int qbase = priv->qbase;
+       int int_type = priv->int_type;
+
+       rtrc(1)
+       j = inb(qbase + 6);
+       i = inb(qbase + 5);
+       if (i == 0x20) {
+               return (DID_NO_CONNECT << 16);
+       }
+       i |= inb(qbase + 5);    /* the 0x10 bit can be set after the 0x08 */
+       if (i != 0x18) {
+               printk(KERN_ERR "Ql:Bad Interrupt status:%02x\n", i);
+               ql_zap(priv);
+               return (DID_BAD_INTR << 16);
+       }
+       j &= 7;                 /* j = inb( qbase + 7 ) >> 5; */
+
+       /* correct status is supposed to be step 4 */
+       /* it sometimes returns step 3 but with 0 bytes left to send */
+       /* We can try stuffing the FIFO with the max each time, but we will get a
+          sequence of 3 if any bytes are left (but we do flush the FIFO anyway */
+
+       if (j != 3 && j != 4) {
+               printk(KERN_ERR "Ql:Bad sequence for command %d, int %02X, cmdleft = %d\n",
+                    j, i, inb(qbase + 7) & 0x1f);
+               ql_zap(priv);
+               return (DID_ERROR << 16);
+       }
+       result = DID_OK;
+       if (inb(qbase + 7) & 0x1f)      /* if some bytes in fifo */
+               outb(1, qbase + 3);     /* clear fifo */
+       /* note that request_bufflen is the total xfer size when sg is used */
+       reqlen = cmd->request_bufflen;
+       /* note that it won't work if transfers > 16M are requested */
+       if (reqlen && !((phase = inb(qbase + 4)) & 6)) {        /* data phase */
+               rtrc(2)
+               outb(reqlen, qbase);    /* low-mid xfer cnt */
+               outb(reqlen >> 8, qbase + 1);   /* low-mid xfer cnt */
+               outb(reqlen >> 16, qbase + 0xe);        /* high xfer cnt */
+               outb(0x90, qbase + 3);  /* command do xfer */
+               /* PIO pseudo DMA to buffer or sglist */
+               REG1;
+               if (!cmd->use_sg)
+                       ql_pdma(priv, phase, cmd->request_buffer,
+                               cmd->request_bufflen);
+               else {
+                       sgcount = cmd->use_sg;
+                       sglist = cmd->request_buffer;
+                       while (sgcount--) {
+                               if (priv->qabort) {
+                                       REG0;
+                                       return ((priv->qabort == 1 ?
+                                               DID_ABORT : DID_RESET) << 16);
+                               }
+                               buf = page_address(sglist->page) + sglist->offset;
+                               if (ql_pdma(priv, phase, buf, sglist->length))
+                                       break;
+                               sglist++;
+                       }
+               }
+               REG0;
+               rtrc(2)
+               /*
+                *      Wait for irq (split into second state of irq handler
+                *      if this can take time) 
+                */
+               if ((k = ql_wai(priv)))
+                       return (k << 16);
+               k = inb(qbase + 5);     /* should be 0x10, bus service */
+       }
+
+       /*
+        *      Enter Status (and Message In) Phase 
+        */
+        
+       k = jiffies + WATCHDOG;
+
+       while (time_before(jiffies, k) && !priv->qabort &&
+                                               !(inb(qbase + 4) & 6))
+               cpu_relax();    /* wait for status phase */
+
+       if (time_after_eq(jiffies, k)) {
+               ql_zap(priv);
+               return (DID_TIME_OUT << 16);
+       }
+
+       /* FIXME: timeout ?? */
+       while (inb(qbase + 5))
+               cpu_relax();    /* clear pending ints */
+
+       if (priv->qabort)
+               return ((priv->qabort == 1 ? DID_ABORT : DID_RESET) << 16);
+
+       outb(0x11, qbase + 3);  /* get status and message */
+       if ((k = ql_wai(priv)))
+               return (k << 16);
+       i = inb(qbase + 5);     /* get chip irq stat */
+       j = inb(qbase + 7) & 0x1f;      /* and bytes rec'd */
+       status = inb(qbase + 2);
+       message = inb(qbase + 2);
+
+       /*
+        *      Should get function complete int if Status and message, else 
+        *      bus serv if only status 
+        */
+       if (!((i == 8 && j == 2) || (i == 0x10 && j == 1))) {
+               printk(KERN_ERR "Ql:Error during status phase, int=%02X, %d bytes recd\n", i, j);
+               result = DID_ERROR;
+       }
+       outb(0x12, qbase + 3);  /* done, disconnect */
+       rtrc(1)
+       if ((k = ql_wai(priv)))
+               return (k << 16);
+
+       /*
+        *      Should get bus service interrupt and disconnect interrupt 
+        */
+        
+       i = inb(qbase + 5);     /* should be bus service */
+       while (!priv->qabort && ((i & 0x20) != 0x20)) {
+               barrier();
+               cpu_relax();
+               i |= inb(qbase + 5);
+       }
+       rtrc(0)
+
+       if (priv->qabort)
+               return ((priv->qabort == 1 ? DID_ABORT : DID_RESET) << 16);
+               
+       return (result << 16) | (message << 8) | (status & STATUS_MASK);
+}
+
+/*
+ *     Interrupt handler 
+ */
+
+static void ql_ihandl(int irq, void *dev_id, struct pt_regs *regs)
+{
+       Scsi_Cmnd *icmd;
+       struct Scsi_Host *host = (struct Scsi_Host *)dev_id;
+       struct qlogicfas408_priv *priv = get_priv_by_host(host);
+       int qbase = priv->qbase;
+       REG0;
+
+       if (!(inb(qbase + 4) & 0x80))   /* false alarm? */
+               return;
+
+       if (priv->qlcmd == NULL) {      /* no command to process? */
+               int i;
+               i = 16;
+               while (i-- && inb(qbase + 5));  /* maybe also ql_zap() */
+               return;
+       }
+       icmd = priv->qlcmd;
+       icmd->result = ql_pcmd(icmd);
+       priv->qlcmd = NULL;
+       /*
+        *      If result is CHECK CONDITION done calls qcommand to request 
+        *      sense 
+        */
+       (icmd->scsi_done) (icmd);
+}
+
+irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id, struct pt_regs *regs)
+{
+       unsigned long flags;
+       struct Scsi_Host *host = dev_id;
+
+       spin_lock_irqsave(host->host_lock, flags);
+       ql_ihandl(irq, dev_id, regs);
+       spin_unlock_irqrestore(host->host_lock, flags);
+       return IRQ_HANDLED;
+}
+
+/*
+ *     Queued command
+ */
+
+int qlogicfas408_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
+{
+       struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
+       if (cmd->device->id == priv->qinitid) {
+               cmd->result = DID_BAD_TARGET << 16;
+               done(cmd);
+               return 0;
+       }
+
+       cmd->scsi_done = done;
+       /* wait for the last command's interrupt to finish */
+       while (priv->qlcmd != NULL) {
+               barrier();
+               cpu_relax();
+       }
+       ql_icmd(cmd);
+       return 0;
+}
+
+/* 
+ *     Return bios parameters 
+ */
+
+int qlogicfas408_biosparam(struct scsi_device * disk,
+                       struct block_device *dev,
+                       sector_t capacity, int ip[])
+{
+/* This should mimic the DOS Qlogic driver's behavior exactly */
+       ip[0] = 0x40;
+       ip[1] = 0x20;
+       ip[2] = (unsigned long) capacity / (ip[0] * ip[1]);
+       if (ip[2] > 1024) {
+               ip[0] = 0xff;
+               ip[1] = 0x3f;
+               ip[2] = (unsigned long) capacity / (ip[0] * ip[1]);
+#if 0
+               if (ip[2] > 1023)
+                       ip[2] = 1023;
+#endif
+       }
+       return 0;
+}
+
+/*
+ *     Abort a command in progress
+ */
+int qlogicfas408_abort(Scsi_Cmnd * cmd)
+{
+       struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
+       priv->qabort = 1;
+       ql_zap(priv);
+       return SUCCESS;
+}
+
+/* 
+ *     Reset SCSI bus
+ *     FIXME: This function is invoked with cmd = NULL directly by
+ *     the PCMCIA qlogic_stub code. This wants fixing
+ */
+
+int qlogicfas408_bus_reset(Scsi_Cmnd * cmd)
+{
+       struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
+       priv->qabort = 2;
+       ql_zap(priv);
+       return SUCCESS;
+}
+
+/* 
+ *     Reset SCSI host controller
+ */
+
+int qlogicfas408_host_reset(Scsi_Cmnd * cmd)
+{
+       return FAILED;
+}
+
+/* 
+ *     Reset SCSI device
+ */
+
+int qlogicfas408_device_reset(Scsi_Cmnd * cmd)
+{
+       return FAILED;
+}
+
+/*
+ *     Return info string
+ */
+
+const char *qlogicfas408_info(struct Scsi_Host *host)
+{
+       struct qlogicfas408_priv *priv = get_priv_by_host(host);
+       return priv->qinfo;
+}
+
+/*
+ *     Get type of chip
+ */
+
+int qlogicfas408_get_chip_type(int qbase, int int_type)
+{
+       REG1;
+       return inb(qbase + 0xe) & 0xf8;
+}
+
+/*
+ *     Perform initialization tasks
+ */
+
+void qlogicfas408_setup(int qbase, int id, int int_type)
+{
+       outb(1, qbase + 8);     /* set for PIO pseudo DMA */
+       REG0;
+       outb(0x40 | qlcfg8 | id, qbase + 8);    /* (ini) bus id, disable scsi rst */
+       outb(qlcfg5, qbase + 5);        /* select timer */
+       outb(qlcfg9, qbase + 9);        /* prescaler */
+
+#if QL_RESET_AT_START
+       outb(3, qbase + 3);
+
+       REG1;
+       /* FIXME: timeout */
+       while (inb(qbase + 0xf) & 4)
+               cpu_relax();
+
+       REG0;
+#endif
+}
+
+/*
+ *     Checks if this is a QLogic FAS 408
+ */
+
+int qlogicfas408_detect(int qbase, int int_type)
+{
+        REG1;
+       return (((inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7) &&
+              ((inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7));           
+}
+
+/*
+ *     Disable interrupts
+ */
+
+void qlogicfas408_disable_ints(struct qlogicfas408_priv *priv)
+{
+       int qbase = priv->qbase;
+       int int_type = priv->int_type;
+
+       REG1;
+       outb(0, qbase + 0xb);   /* disable ints */
+}
+
+/*
+ *     Init and exit functions
+ */
+
+static int __init qlogicfas408_init(void)
+{
+       return 0;
+}
+
+static void __exit qlogicfas408_exit(void)
+{
+
+}
+
+MODULE_AUTHOR("Tom Zerucha, Michael Griffith");
+MODULE_DESCRIPTION("Driver for the Qlogic FAS SCSI controllers");
+MODULE_LICENSE("GPL");
+module_init(qlogicfas408_init);
+module_exit(qlogicfas408_exit);
+
+EXPORT_SYMBOL(qlogicfas408_info);
+EXPORT_SYMBOL(qlogicfas408_queuecommand);
+EXPORT_SYMBOL(qlogicfas408_abort);
+EXPORT_SYMBOL(qlogicfas408_bus_reset);
+EXPORT_SYMBOL(qlogicfas408_device_reset);
+EXPORT_SYMBOL(qlogicfas408_host_reset);
+EXPORT_SYMBOL(qlogicfas408_biosparam);
+EXPORT_SYMBOL(qlogicfas408_ihandl);
+EXPORT_SYMBOL(qlogicfas408_get_chip_type);
+EXPORT_SYMBOL(qlogicfas408_setup);
+EXPORT_SYMBOL(qlogicfas408_detect);
+EXPORT_SYMBOL(qlogicfas408_disable_ints);
+
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c
new file mode 100644 (file)
index 0000000..7501372
--- /dev/null
@@ -0,0 +1,1446 @@
+/*
+ *  sata_sx4.c - Promise SATA
+ *
+ *  Maintained by:  Jeff Garzik <jgarzik@pobox.com>
+ *                 Please ALWAYS copy linux-ide@vger.kernel.org
+ *                 on emails.
+ *
+ *  Copyright 2003-2004 Red Hat, Inc.
+ *
+ *  The contents of this file are subject to the Open
+ *  Software License version 1.1 that can be found at
+ *  http://www.opensource.org/licenses/osl-1.1.txt and is included herein
+ *  by reference.
+ *
+ *  Alternatively, the contents of this file may be used under the terms
+ *  of the GNU General Public License version 2 (the "GPL") as distributed
+ *  in the kernel source COPYING file, in which case the provisions of
+ *  the GPL are applicable instead of the above.  If you wish to allow
+ *  the use of your version of this file only under the terms of the
+ *  GPL and not to allow others to use your version of this file under
+ *  the OSL, indicate your decision by deleting the provisions above and
+ *  replace them with the notice and other provisions required by the GPL.
+ *  If you do not delete the provisions above, a recipient may use your
+ *  version of this file under either the OSL or the GPL.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/blkdev.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/sched.h>
+#include "scsi.h"
+#include <scsi/scsi_host.h>
+#include <linux/libata.h>
+#include <asm/io.h>
+#include "sata_promise.h"
+
+#define DRV_NAME       "sata_sx4"
+#define DRV_VERSION    "0.50"
+
+
+enum {
+       PDC_PRD_TBL             = 0x44, /* Direct command DMA table addr */
+
+       PDC_PKT_SUBMIT          = 0x40, /* Command packet pointer addr */
+       PDC_HDMA_PKT_SUBMIT     = 0x100, /* Host DMA packet pointer addr */
+       PDC_INT_SEQMASK         = 0x40, /* Mask of asserted SEQ INTs */
+       PDC_HDMA_CTLSTAT        = 0x12C, /* Host DMA control / status */
+
+       PDC_20621_SEQCTL        = 0x400,
+       PDC_20621_SEQMASK       = 0x480,
+       PDC_20621_GENERAL_CTL   = 0x484,
+       PDC_20621_PAGE_SIZE     = (32 * 1024),
+
+       /* chosen, not constant, values; we design our own DIMM mem map */
+       PDC_20621_DIMM_WINDOW   = 0x0C, /* page# for 32K DIMM window */
+       PDC_20621_DIMM_BASE     = 0x00200000,
+       PDC_20621_DIMM_DATA     = (64 * 1024),
+       PDC_DIMM_DATA_STEP      = (256 * 1024),
+       PDC_DIMM_WINDOW_STEP    = (8 * 1024),
+       PDC_DIMM_HOST_PRD       = (6 * 1024),
+       PDC_DIMM_HOST_PKT       = (128 * 0),
+       PDC_DIMM_HPKT_PRD       = (128 * 1),
+       PDC_DIMM_ATA_PKT        = (128 * 2),
+       PDC_DIMM_APKT_PRD       = (128 * 3),
+       PDC_DIMM_HEADER_SZ      = PDC_DIMM_APKT_PRD + 128,
+       PDC_PAGE_WINDOW         = 0x40,
+       PDC_PAGE_DATA           = PDC_PAGE_WINDOW +
+                                 (PDC_20621_DIMM_DATA / PDC_20621_PAGE_SIZE),
+       PDC_PAGE_SET            = PDC_DIMM_DATA_STEP / PDC_20621_PAGE_SIZE,
+
+       PDC_CHIP0_OFS           = 0xC0000, /* offset of chip #0 */
+
+       PDC_20621_ERR_MASK      = (1<<19) | (1<<20) | (1<<21) | (1<<22) |
+                                 (1<<23),
+
+       board_20621             = 0,    /* FastTrak S150 SX4 */
+
+       PDC_RESET               = (1 << 11), /* HDMA reset */
+
+       PDC_MAX_HDMA            = 32,
+       PDC_HDMA_Q_MASK         = (PDC_MAX_HDMA - 1),
+
+       PDC_DIMM0_SPD_DEV_ADDRESS     = 0x50,
+       PDC_DIMM1_SPD_DEV_ADDRESS     = 0x51,
+       PDC_MAX_DIMM_MODULE           = 0x02,
+       PDC_I2C_CONTROL_OFFSET        = 0x48,
+       PDC_I2C_ADDR_DATA_OFFSET      = 0x4C,
+       PDC_DIMM0_CONTROL_OFFSET      = 0x80,
+       PDC_DIMM1_CONTROL_OFFSET      = 0x84,
+       PDC_SDRAM_CONTROL_OFFSET      = 0x88,
+       PDC_I2C_WRITE                 = 0x00000000,
+       PDC_I2C_READ                  = 0x00000040,     
+       PDC_I2C_START                 = 0x00000080,
+       PDC_I2C_MASK_INT              = 0x00000020,
+       PDC_I2C_COMPLETE              = 0x00010000,
+       PDC_I2C_NO_ACK                = 0x00100000,
+       PDC_DIMM_SPD_SUBADDRESS_START = 0x00,
+       PDC_DIMM_SPD_SUBADDRESS_END   = 0x7F,
+       PDC_DIMM_SPD_ROW_NUM          = 3,
+       PDC_DIMM_SPD_COLUMN_NUM       = 4,
+       PDC_DIMM_SPD_MODULE_ROW       = 5,
+       PDC_DIMM_SPD_TYPE             = 11,
+       PDC_DIMM_SPD_FRESH_RATE       = 12,         
+       PDC_DIMM_SPD_BANK_NUM         = 17,     
+       PDC_DIMM_SPD_CAS_LATENCY      = 18,
+       PDC_DIMM_SPD_ATTRIBUTE        = 21,    
+       PDC_DIMM_SPD_ROW_PRE_CHARGE   = 27,
+       PDC_DIMM_SPD_ROW_ACTIVE_DELAY = 28,      
+       PDC_DIMM_SPD_RAS_CAS_DELAY    = 29,
+       PDC_DIMM_SPD_ACTIVE_PRECHARGE = 30,
+       PDC_DIMM_SPD_SYSTEM_FREQ      = 126,
+       PDC_CTL_STATUS                = 0x08,   
+       PDC_DIMM_WINDOW_CTLR          = 0x0C,
+       PDC_TIME_CONTROL              = 0x3C,
+       PDC_TIME_PERIOD               = 0x40,
+       PDC_TIME_COUNTER              = 0x44,
+       PDC_GENERAL_CTLR              = 0x484,
+       PCI_PLL_INIT                  = 0x8A531824,
+       PCI_X_TCOUNT                  = 0xEE1E5CFF
+};
+
+
+struct pdc_port_priv {
+       u8                      dimm_buf[(ATA_PRD_SZ * ATA_MAX_PRD) + 512];
+       u8                      *pkt;
+       dma_addr_t              pkt_dma;
+};
+
+struct pdc_host_priv {
+       void                    *dimm_mmio;
+
+       unsigned int            doing_hdma;
+       unsigned int            hdma_prod;
+       unsigned int            hdma_cons;
+       struct {
+               struct ata_queued_cmd *qc;
+               unsigned int    seq;
+               unsigned long   pkt_ofs;
+       } hdma[32];
+};
+
+
+static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
+static void pdc20621_dma_setup(struct ata_queued_cmd *qc);
+static void pdc20621_dma_start(struct ata_queued_cmd *qc);
+static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
+static void pdc_eng_timeout(struct ata_port *ap);
+static void pdc_20621_phy_reset (struct ata_port *ap);
+static int pdc_port_start(struct ata_port *ap);
+static void pdc_port_stop(struct ata_port *ap);
+static void pdc20621_fill_sg(struct ata_queued_cmd *qc);
+static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf);
+static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf);
+static void pdc20621_host_stop(struct ata_host_set *host_set);
+static inline void pdc_dma_complete (struct ata_port *ap,
+                                     struct ata_queued_cmd *qc, int have_err);
+static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe);
+static int pdc20621_detect_dimm(struct ata_probe_ent *pe);
+static unsigned int pdc20621_i2c_read(struct ata_probe_ent *pe, 
+                                     u32 device, u32 subaddr, u32 *pdata);
+static int pdc20621_prog_dimm0(struct ata_probe_ent *pe);
+static unsigned int pdc20621_prog_dimm_global(struct ata_probe_ent *pe);
+#ifdef ATA_VERBOSE_DEBUG
+static void pdc20621_get_from_dimm(struct ata_probe_ent *pe, 
+                                  void *psource, u32 offset, u32 size);
+#endif
+static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, 
+                                void *psource, u32 offset, u32 size);
+
+
+static Scsi_Host_Template pdc_sata_sht = {
+       .module                 = THIS_MODULE,
+       .name                   = DRV_NAME,
+       .queuecommand           = ata_scsi_queuecmd,
+       .eh_strategy_handler    = ata_scsi_error,
+       .can_queue              = ATA_DEF_QUEUE,
+       .this_id                = ATA_SHT_THIS_ID,
+       .sg_tablesize           = LIBATA_MAX_PRD,
+       .max_sectors            = ATA_MAX_SECTORS,
+       .cmd_per_lun            = ATA_SHT_CMD_PER_LUN,
+       .emulated               = ATA_SHT_EMULATED,
+       .use_clustering         = ATA_SHT_USE_CLUSTERING,
+       .proc_name              = DRV_NAME,
+       .dma_boundary           = ATA_DMA_BOUNDARY,
+       .slave_configure        = ata_scsi_slave_config,
+       .bios_param             = ata_std_bios_param,
+};
+
+static struct ata_port_operations pdc_20621_ops = {
+       .port_disable           = ata_port_disable,
+       .tf_load                = pdc_tf_load_mmio,
+       .tf_read                = ata_tf_read_mmio,
+       .check_status           = ata_check_status_mmio,
+       .exec_command           = pdc_exec_command_mmio,
+       .phy_reset              = pdc_20621_phy_reset,
+       .bmdma_setup            = pdc20621_dma_setup,
+       .bmdma_start            = pdc20621_dma_start,
+       .fill_sg                = pdc20621_fill_sg,
+       .eng_timeout            = pdc_eng_timeout,
+       .irq_handler            = pdc20621_interrupt,
+       .port_start             = pdc_port_start,
+       .port_stop              = pdc_port_stop,
+       .host_stop              = pdc20621_host_stop,
+};
+
+static struct ata_port_info pdc_port_info[] = {
+       /* board_20621 */
+       {
+               .sht            = &pdc_sata_sht,
+               .host_flags     = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+                                 ATA_FLAG_SRST | ATA_FLAG_MMIO,
+               .pio_mask       = 0x03, /* pio3-4 */
+               .udma_mask      = 0x7f, /* udma0-6 ; FIXME */
+               .port_ops       = &pdc_20621_ops,
+       },
+
+};
+
+static struct pci_device_id pdc_sata_pci_tbl[] = {
+       { PCI_VENDOR_ID_PROMISE, 0x6622, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+         board_20621 },
+       { }     /* terminate list */
+};
+
+
+static struct pci_driver pdc_sata_pci_driver = {
+       .name                   = DRV_NAME,
+       .id_table               = pdc_sata_pci_tbl,
+       .probe                  = pdc_sata_init_one,
+       .remove                 = ata_pci_remove_one,
+};
+
+
+static void pdc20621_host_stop(struct ata_host_set *host_set)
+{
+       struct pdc_host_priv *hpriv = host_set->private_data;
+       void *dimm_mmio = hpriv->dimm_mmio;
+
+       iounmap(dimm_mmio);
+       kfree(hpriv);
+}
+
+static int pdc_port_start(struct ata_port *ap)
+{
+       struct pci_dev *pdev = ap->host_set->pdev;
+       struct pdc_port_priv *pp;
+       int rc;
+
+       rc = ata_port_start(ap);
+       if (rc)
+               return rc;
+
+       pp = kmalloc(sizeof(*pp), GFP_KERNEL);
+       if (!pp) {
+               rc = -ENOMEM;
+               goto err_out;
+       }
+       memset(pp, 0, sizeof(*pp));
+
+       pp->pkt = pci_alloc_consistent(pdev, 128, &pp->pkt_dma);
+       if (!pp->pkt) {
+               rc = -ENOMEM;
+               goto err_out_kfree;
+       }
+
+       ap->private_data = pp;
+
+       return 0;
+
+err_out_kfree:
+       kfree(pp);
+err_out:
+       ata_port_stop(ap);
+       return rc;
+}
+
+
+static void pdc_port_stop(struct ata_port *ap)
+{
+       struct pci_dev *pdev = ap->host_set->pdev;
+       struct pdc_port_priv *pp = ap->private_data;
+
+       ap->private_data = NULL;
+       pci_free_consistent(pdev, 128, pp->pkt, pp->pkt_dma);
+       kfree(pp);
+       ata_port_stop(ap);
+}
+
+
+static void pdc_20621_phy_reset (struct ata_port *ap)
+{
+       VPRINTK("ENTER\n");
+        ap->cbl = ATA_CBL_SATA;
+        ata_port_probe(ap);
+        ata_bus_reset(ap);
+}
+
+static inline void pdc20621_ata_sg(struct ata_taskfile *tf, u8 *buf,
+                                          unsigned int portno,
+                                          unsigned int total_len)
+{
+       u32 addr;
+       unsigned int dw = PDC_DIMM_APKT_PRD >> 2;
+       u32 *buf32 = (u32 *) buf;
+
+       /* output ATA packet S/G table */
+       addr = PDC_20621_DIMM_BASE + PDC_20621_DIMM_DATA +
+              (PDC_DIMM_DATA_STEP * portno);
+       VPRINTK("ATA sg addr 0x%x, %d\n", addr, addr);
+       buf32[dw] = cpu_to_le32(addr);
+       buf32[dw + 1] = cpu_to_le32(total_len | ATA_PRD_EOT);
+
+       VPRINTK("ATA PSG @ %x == (0x%x, 0x%x)\n",
+               PDC_20621_DIMM_BASE +
+                      (PDC_DIMM_WINDOW_STEP * portno) +
+                      PDC_DIMM_APKT_PRD,
+               buf32[dw], buf32[dw + 1]);
+}
+
+static inline void pdc20621_host_sg(struct ata_taskfile *tf, u8 *buf,
+                                           unsigned int portno,
+                                           unsigned int total_len)
+{
+       u32 addr;
+       unsigned int dw = PDC_DIMM_HPKT_PRD >> 2;
+       u32 *buf32 = (u32 *) buf;
+
+       /* output Host DMA packet S/G table */
+       addr = PDC_20621_DIMM_BASE + PDC_20621_DIMM_DATA +
+              (PDC_DIMM_DATA_STEP * portno);
+
+       buf32[dw] = cpu_to_le32(addr);
+       buf32[dw + 1] = cpu_to_le32(total_len | ATA_PRD_EOT);
+
+       VPRINTK("HOST PSG @ %x == (0x%x, 0x%x)\n",
+               PDC_20621_DIMM_BASE +
+                      (PDC_DIMM_WINDOW_STEP * portno) +
+                      PDC_DIMM_HPKT_PRD,
+               buf32[dw], buf32[dw + 1]);
+}
+
+static inline unsigned int pdc20621_ata_pkt(struct ata_taskfile *tf,
+                                           unsigned int devno, u8 *buf,
+                                           unsigned int portno)
+{
+       unsigned int i, dw;
+       u32 *buf32 = (u32 *) buf;
+       u8 dev_reg;
+
+       unsigned int dimm_sg = PDC_20621_DIMM_BASE +
+                              (PDC_DIMM_WINDOW_STEP * portno) +
+                              PDC_DIMM_APKT_PRD;
+       VPRINTK("ENTER, dimm_sg == 0x%x, %d\n", dimm_sg, dimm_sg);
+
+       i = PDC_DIMM_ATA_PKT;
+
+       /*
+        * Set up ATA packet
+        */
+       if ((tf->protocol == ATA_PROT_DMA) && (!(tf->flags & ATA_TFLAG_WRITE)))
+               buf[i++] = PDC_PKT_READ;
+       else if (tf->protocol == ATA_PROT_NODATA)
+               buf[i++] = PDC_PKT_NODATA;
+       else
+               buf[i++] = 0;
+       buf[i++] = 0;                   /* reserved */
+       buf[i++] = portno + 1;          /* seq. id */
+       buf[i++] = 0xff;                /* delay seq. id */
+
+       /* dimm dma S/G, and next-pkt */
+       dw = i >> 2;
+       buf32[dw] = cpu_to_le32(dimm_sg);
+       buf32[dw + 1] = 0;
+       i += 8;
+
+       if (devno == 0)
+               dev_reg = ATA_DEVICE_OBS;
+       else
+               dev_reg = ATA_DEVICE_OBS | ATA_DEV1;
+
+       /* select device */
+       buf[i++] = (1 << 5) | PDC_PKT_CLEAR_BSY | ATA_REG_DEVICE;
+       buf[i++] = dev_reg;
+
+       /* device control register */
+       buf[i++] = (1 << 5) | PDC_REG_DEVCTL;
+       buf[i++] = tf->ctl;
+
+       return i;
+}
+
+static inline void pdc20621_host_pkt(struct ata_taskfile *tf, u8 *buf,
+                                    unsigned int portno)
+{
+       unsigned int dw;
+       u32 tmp, *buf32 = (u32 *) buf;
+
+       unsigned int host_sg = PDC_20621_DIMM_BASE +
+                              (PDC_DIMM_WINDOW_STEP * portno) +
+                              PDC_DIMM_HOST_PRD;
+       unsigned int dimm_sg = PDC_20621_DIMM_BASE +
+                              (PDC_DIMM_WINDOW_STEP * portno) +
+                              PDC_DIMM_HPKT_PRD;
+       VPRINTK("ENTER, dimm_sg == 0x%x, %d\n", dimm_sg, dimm_sg);
+       VPRINTK("host_sg == 0x%x, %d\n", host_sg, host_sg);
+
+       dw = PDC_DIMM_HOST_PKT >> 2;
+
+       /*
+        * Set up Host DMA packet
+        */
+       if ((tf->protocol == ATA_PROT_DMA) && (!(tf->flags & ATA_TFLAG_WRITE)))
+               tmp = PDC_PKT_READ;
+       else
+               tmp = 0;
+       tmp |= ((portno + 1 + 4) << 16);        /* seq. id */
+       tmp |= (0xff << 24);                    /* delay seq. id */
+       buf32[dw + 0] = cpu_to_le32(tmp);
+       buf32[dw + 1] = cpu_to_le32(host_sg);
+       buf32[dw + 2] = cpu_to_le32(dimm_sg);
+       buf32[dw + 3] = 0;
+
+       VPRINTK("HOST PKT @ %x == (0x%x 0x%x 0x%x 0x%x)\n",
+               PDC_20621_DIMM_BASE + (PDC_DIMM_WINDOW_STEP * portno) +
+                       PDC_DIMM_HOST_PKT,
+               buf32[dw + 0],
+               buf32[dw + 1],
+               buf32[dw + 2],
+               buf32[dw + 3]);
+}
+
+static void pdc20621_fill_sg(struct ata_queued_cmd *qc)
+{
+       struct scatterlist *sg = qc->sg;
+       struct ata_port *ap = qc->ap;
+       struct pdc_port_priv *pp = ap->private_data;
+       void *mmio = ap->host_set->mmio_base;
+       struct pdc_host_priv *hpriv = ap->host_set->private_data;
+       void *dimm_mmio = hpriv->dimm_mmio;
+       unsigned int portno = ap->port_no;
+       unsigned int i, last, idx, total_len = 0, sgt_len;
+       u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ];
+
+       VPRINTK("ata%u: ENTER\n", ap->id);
+
+       /* hard-code chip #0 */
+       mmio += PDC_CHIP0_OFS;
+
+       /*
+        * Build S/G table
+        */
+       last = qc->n_elem;
+       idx = 0;
+       for (i = 0; i < last; i++) {
+               buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i]));
+               buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i]));
+               total_len += sg[i].length;
+       }
+       buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT);
+       sgt_len = idx * 4;
+
+       /*
+        * Build ATA, host DMA packets
+        */
+       pdc20621_host_sg(&qc->tf, &pp->dimm_buf[0], portno, total_len);
+       pdc20621_host_pkt(&qc->tf, &pp->dimm_buf[0], portno);
+
+       pdc20621_ata_sg(&qc->tf, &pp->dimm_buf[0], portno, total_len);
+       i = pdc20621_ata_pkt(&qc->tf, qc->dev->devno, &pp->dimm_buf[0], portno);
+
+       if (qc->tf.flags & ATA_TFLAG_LBA48)
+               i = pdc_prep_lba48(&qc->tf, &pp->dimm_buf[0], i);
+       else
+               i = pdc_prep_lba28(&qc->tf, &pp->dimm_buf[0], i);
+
+       pdc_pkt_footer(&qc->tf, &pp->dimm_buf[0], i);
+
+       /* copy three S/G tables and two packets to DIMM MMIO window */
+       memcpy_toio(dimm_mmio + (portno * PDC_DIMM_WINDOW_STEP),
+                   &pp->dimm_buf, PDC_DIMM_HEADER_SZ);
+       memcpy_toio(dimm_mmio + (portno * PDC_DIMM_WINDOW_STEP) +
+                   PDC_DIMM_HOST_PRD,
+                   &pp->dimm_buf[PDC_DIMM_HEADER_SZ], sgt_len);
+
+       /* force host FIFO dump */
+       writel(0x00000001, mmio + PDC_20621_GENERAL_CTL);
+
+       readl(dimm_mmio);       /* MMIO PCI posting flush */
+
+       VPRINTK("ata pkt buf ofs %u, prd size %u, mmio copied\n", i, sgt_len);
+}
+
+static void __pdc20621_push_hdma(struct ata_queued_cmd *qc,
+                                unsigned int seq,
+                                u32 pkt_ofs)
+{
+       struct ata_port *ap = qc->ap;
+       struct ata_host_set *host_set = ap->host_set;
+       void *mmio = host_set->mmio_base;
+
+       /* hard-code chip #0 */
+       mmio += PDC_CHIP0_OFS;
+
+       writel(0x00000001, mmio + PDC_20621_SEQCTL + (seq * 4));
+       readl(mmio + PDC_20621_SEQCTL + (seq * 4));     /* flush */
+
+       writel(pkt_ofs, mmio + PDC_HDMA_PKT_SUBMIT);
+       readl(mmio + PDC_HDMA_PKT_SUBMIT);      /* flush */
+}
+
+static void pdc20621_push_hdma(struct ata_queued_cmd *qc,
+                               unsigned int seq,
+                               u32 pkt_ofs)
+{
+       struct ata_port *ap = qc->ap;
+       struct pdc_host_priv *pp = ap->host_set->private_data;
+       unsigned int idx = pp->hdma_prod & PDC_HDMA_Q_MASK;
+
+       if (!pp->doing_hdma) {
+               __pdc20621_push_hdma(qc, seq, pkt_ofs);
+               pp->doing_hdma = 1;
+               return;
+       }
+
+       pp->hdma[idx].qc = qc;
+       pp->hdma[idx].seq = seq;
+       pp->hdma[idx].pkt_ofs = pkt_ofs;
+       pp->hdma_prod++;
+}
+
+static void pdc20621_pop_hdma(struct ata_queued_cmd *qc)
+{
+       struct ata_port *ap = qc->ap;
+       struct pdc_host_priv *pp = ap->host_set->private_data;
+       unsigned int idx = pp->hdma_cons & PDC_HDMA_Q_MASK;
+
+       /* if nothing on queue, we're done */
+       if (pp->hdma_prod == pp->hdma_cons) {
+               pp->doing_hdma = 0;
+               return;
+       }
+
+       __pdc20621_push_hdma(pp->hdma[idx].qc, pp->hdma[idx].seq,
+                            pp->hdma[idx].pkt_ofs);
+       pp->hdma_cons++;
+}
+
+#ifdef ATA_VERBOSE_DEBUG
+static void pdc20621_dump_hdma(struct ata_queued_cmd *qc)
+{
+       struct ata_port *ap = qc->ap;
+       unsigned int port_no = ap->port_no;
+       struct pdc_host_priv *hpriv = ap->host_set->private_data;
+       void *dimm_mmio = hpriv->dimm_mmio;
+
+       dimm_mmio += (port_no * PDC_DIMM_WINDOW_STEP);
+       dimm_mmio += PDC_DIMM_HOST_PKT;
+
+       printk(KERN_ERR "HDMA[0] == 0x%08X\n", readl(dimm_mmio));
+       printk(KERN_ERR "HDMA[1] == 0x%08X\n", readl(dimm_mmio + 4));
+       printk(KERN_ERR "HDMA[2] == 0x%08X\n", readl(dimm_mmio + 8));
+       printk(KERN_ERR "HDMA[3] == 0x%08X\n", readl(dimm_mmio + 12));
+}
+#else
+static inline void pdc20621_dump_hdma(struct ata_queued_cmd *qc) { }
+#endif /* ATA_VERBOSE_DEBUG */
+
+static void pdc20621_dma_setup(struct ata_queued_cmd *qc)
+{
+       /* nothing for now.  later, we will call standard
+        * code in libata-core for ATAPI here */
+}
+
+static void pdc20621_dma_start(struct ata_queued_cmd *qc)
+{
+       struct ata_port *ap = qc->ap;
+       struct ata_host_set *host_set = ap->host_set;
+       unsigned int port_no = ap->port_no;
+       void *mmio = host_set->mmio_base;
+       unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
+       u8 seq = (u8) (port_no + 1);
+       unsigned int doing_hdma = 0, port_ofs;
+
+       /* hard-code chip #0 */
+       mmio += PDC_CHIP0_OFS;
+
+       VPRINTK("ata%u: ENTER\n", ap->id);
+
+       port_ofs = PDC_20621_DIMM_BASE + (PDC_DIMM_WINDOW_STEP * port_no);
+
+       /* if writing, we (1) DMA to DIMM, then (2) do ATA command */
+       if (rw) {
+               doing_hdma = 1;
+               seq += 4;
+       }
+
+       wmb();                  /* flush PRD, pkt writes */
+
+       if (doing_hdma) {
+               pdc20621_dump_hdma(qc);
+               pdc20621_push_hdma(qc, seq, port_ofs + PDC_DIMM_HOST_PKT);
+               VPRINTK("queued ofs 0x%x (%u), seq %u\n",
+                       port_ofs + PDC_DIMM_HOST_PKT,
+                       port_ofs + PDC_DIMM_HOST_PKT,
+                       seq);
+       } else {
+               writel(0x00000001, mmio + PDC_20621_SEQCTL + (seq * 4));
+               readl(mmio + PDC_20621_SEQCTL + (seq * 4));     /* flush */
+
+               writel(port_ofs + PDC_DIMM_ATA_PKT,
+                      (void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
+               readl((void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
+               VPRINTK("submitted ofs 0x%x (%u), seq %u\n",
+                       port_ofs + PDC_DIMM_ATA_PKT,
+                       port_ofs + PDC_DIMM_ATA_PKT,
+                       seq);
+       }
+}
+
+static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
+                                          struct ata_queued_cmd *qc,
+                                         unsigned int doing_hdma,
+                                         void *mmio)
+{
+       unsigned int port_no = ap->port_no;
+       unsigned int port_ofs =
+               PDC_20621_DIMM_BASE + (PDC_DIMM_WINDOW_STEP * port_no);
+       u8 status;
+       unsigned int handled = 0;
+
+       VPRINTK("ENTER\n");
+
+       if ((qc->tf.protocol == ATA_PROT_DMA) &&        /* read */
+           (!(qc->tf.flags & ATA_TFLAG_WRITE))) {
+
+               /* step two - DMA from DIMM to host */
+               if (doing_hdma) {
+                       VPRINTK("ata%u: read hdma, 0x%x 0x%x\n", ap->id,
+                               readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT));
+                       pdc_dma_complete(ap, qc, 0);
+                       pdc20621_pop_hdma(qc);
+               }
+
+               /* step one - exec ATA command */
+               else {
+                       u8 seq = (u8) (port_no + 1 + 4);
+                       VPRINTK("ata%u: read ata, 0x%x 0x%x\n", ap->id,
+                               readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT));
+
+                       /* submit hdma pkt */
+                       pdc20621_dump_hdma(qc);
+                       pdc20621_push_hdma(qc, seq,
+                                          port_ofs + PDC_DIMM_HOST_PKT);
+               }
+               handled = 1;
+
+       } else if (qc->tf.protocol == ATA_PROT_DMA) {   /* write */
+
+               /* step one - DMA from host to DIMM */
+               if (doing_hdma) {
+                       u8 seq = (u8) (port_no + 1);
+                       VPRINTK("ata%u: write hdma, 0x%x 0x%x\n", ap->id,
+                               readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT));
+
+                       /* submit ata pkt */
+                       writel(0x00000001, mmio + PDC_20621_SEQCTL + (seq * 4));
+                       readl(mmio + PDC_20621_SEQCTL + (seq * 4));
+                       writel(port_ofs + PDC_DIMM_ATA_PKT,
+                              (void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
+                       readl((void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
+               }
+
+               /* step two - execute ATA command */
+               else {
+                       VPRINTK("ata%u: write ata, 0x%x 0x%x\n", ap->id,
+                               readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT));
+                       pdc_dma_complete(ap, qc, 0);
+                       pdc20621_pop_hdma(qc);
+               }
+               handled = 1;
+
+       /* command completion, but no data xfer */
+       } else if (qc->tf.protocol == ATA_PROT_NODATA) {
+
+               status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
+               DPRINTK("BUS_NODATA (drv_stat 0x%X)\n", status);
+               ata_qc_complete(qc, status);
+               handled = 1;
+
+       } else {
+               ap->stats.idle_irq++;
+       }
+
+       return handled;
+}
+
+static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
+{
+       struct ata_host_set *host_set = dev_instance;
+       struct ata_port *ap;
+       u32 mask = 0;
+       unsigned int i, tmp, port_no;
+       unsigned int handled = 0;
+       void *mmio_base;
+
+       VPRINTK("ENTER\n");
+
+       if (!host_set || !host_set->mmio_base) {
+               VPRINTK("QUICK EXIT\n");
+               return IRQ_NONE;
+       }
+
+       mmio_base = host_set->mmio_base;
+
+       /* reading should also clear interrupts */
+       mmio_base += PDC_CHIP0_OFS;
+       mask = readl(mmio_base + PDC_20621_SEQMASK);
+       VPRINTK("mask == 0x%x\n", mask);
+
+       if (mask == 0xffffffff) {
+               VPRINTK("QUICK EXIT 2\n");
+               return IRQ_NONE;
+       }
+       mask &= 0xffff;         /* only 16 tags possible */
+       if (!mask) {
+               VPRINTK("QUICK EXIT 3\n");
+               return IRQ_NONE;
+       }
+
+        spin_lock(&host_set->lock);
+
+        for (i = 1; i < 9; i++) {
+               port_no = i - 1;
+               if (port_no > 3)
+                       port_no -= 4;
+               if (port_no >= host_set->n_ports)
+                       ap = NULL;
+               else
+                       ap = host_set->ports[port_no];
+               tmp = mask & (1 << i);
+               VPRINTK("seq %u, port_no %u, ap %p, tmp %x\n", i, port_no, ap, tmp);
+               if (tmp && ap && (!(ap->flags & ATA_FLAG_PORT_DISABLED))) {
+                       struct ata_queued_cmd *qc;
+
+                       qc = ata_qc_from_tag(ap, ap->active_tag);
+                       if (qc && (!(qc->tf.ctl & ATA_NIEN)))
+                               handled += pdc20621_host_intr(ap, qc, (i > 4),
+                                                             mmio_base);
+               }
+       }
+
+        spin_unlock(&host_set->lock);
+
+       VPRINTK("mask == 0x%x\n", mask);
+
+       VPRINTK("EXIT\n");
+
+       return IRQ_RETVAL(handled);
+}
+
+static inline void pdc_dma_complete (struct ata_port *ap,
+                                     struct ata_queued_cmd *qc,
+                                    int have_err)
+{
+       u8 err_bit = have_err ? ATA_ERR : 0;
+
+       /* get drive status; clear intr; complete txn */
+       ata_qc_complete(qc, ata_wait_idle(ap) | err_bit);
+}
+
+static void pdc_eng_timeout(struct ata_port *ap)
+{
+       u8 drv_stat;
+       struct ata_queued_cmd *qc;
+
+       DPRINTK("ENTER\n");
+
+       qc = ata_qc_from_tag(ap, ap->active_tag);
+       if (!qc) {
+               printk(KERN_ERR "ata%u: BUG: timeout without command\n",
+                      ap->id);
+               goto out;
+       }
+
+       /* hack alert!  We cannot use the supplied completion
+        * function from inside the ->eh_strategy_handler() thread.
+        * libata is the only user of ->eh_strategy_handler() in
+        * any kernel, so the default scsi_done() assumes it is
+        * not being called from the SCSI EH.
+        */
+       qc->scsidone = scsi_finish_command;
+
+       switch (qc->tf.protocol) {
+       case ATA_PROT_DMA:
+               printk(KERN_ERR "ata%u: DMA timeout\n", ap->id);
+               ata_qc_complete(qc, ata_wait_idle(ap) | ATA_ERR);
+               break;
+
+       case ATA_PROT_NODATA:
+               drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
+
+               printk(KERN_ERR "ata%u: command 0x%x timeout, stat 0x%x\n",
+                      ap->id, qc->tf.command, drv_stat);
+
+               ata_qc_complete(qc, drv_stat);
+               break;
+
+       default:
+               drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
+
+               printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n",
+                      ap->id, qc->tf.command, drv_stat);
+
+               ata_qc_complete(qc, drv_stat);
+               break;
+       }
+
+out:
+       DPRINTK("EXIT\n");
+}
+
+static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf)
+{
+       if (tf->protocol == ATA_PROT_PIO)
+               ata_tf_load_mmio(ap, tf);
+}
+
+
+static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf)
+{
+       if (tf->protocol == ATA_PROT_PIO)
+               ata_exec_command_mmio(ap, tf);
+}
+
+
+static void pdc_sata_setup_port(struct ata_ioports *port, unsigned long base)
+{
+       port->cmd_addr          = base;
+       port->data_addr         = base;
+       port->feature_addr      =
+       port->error_addr        = base + 0x4;
+       port->nsect_addr        = base + 0x8;
+       port->lbal_addr         = base + 0xc;
+       port->lbam_addr         = base + 0x10;
+       port->lbah_addr         = base + 0x14;
+       port->device_addr       = base + 0x18;
+       port->command_addr      =
+       port->status_addr       = base + 0x1c;
+       port->altstatus_addr    =
+       port->ctl_addr          = base + 0x38;
+}
+
+
+#ifdef ATA_VERBOSE_DEBUG
+static void pdc20621_get_from_dimm(struct ata_probe_ent *pe, void *psource, 
+                                  u32 offset, u32 size)
+{
+       u32 window_size;
+       u16 idx;
+       u8 page_mask;
+       long dist;
+       void *mmio = pe->mmio_base;
+       struct pdc_host_priv *hpriv = pe->private_data;
+       void *dimm_mmio = hpriv->dimm_mmio;
+
+       /* hard-code chip #0 */
+       mmio += PDC_CHIP0_OFS;
+
+       page_mask = 0x00;       
+       window_size = 0x2000 * 4; /* 32K byte uchar size */  
+       idx = (u16) (offset / window_size); 
+
+       writel(0x01, mmio + PDC_GENERAL_CTLR);
+       readl(mmio + PDC_GENERAL_CTLR);
+       writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
+       readl(mmio + PDC_DIMM_WINDOW_CTLR);
+
+       offset -= (idx * window_size);
+       idx++;
+       dist = ((long) (window_size - (offset + size))) >= 0 ? size : 
+               (long) (window_size - offset);
+       memcpy_fromio((char *) psource, (char *) (dimm_mmio + offset / 4), 
+                     dist);
+
+       psource += dist;    
+       size -= dist;
+       for (; (long) size >= (long) window_size ;) {
+               writel(0x01, mmio + PDC_GENERAL_CTLR);
+               readl(mmio + PDC_GENERAL_CTLR);
+               writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
+               readl(mmio + PDC_DIMM_WINDOW_CTLR);
+               memcpy_fromio((char *) psource, (char *) (dimm_mmio), 
+                             window_size / 4);
+               psource += window_size;
+               size -= window_size;
+               idx ++;
+       }
+
+       if (size) {
+               writel(0x01, mmio + PDC_GENERAL_CTLR);
+               readl(mmio + PDC_GENERAL_CTLR);
+               writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
+               readl(mmio + PDC_DIMM_WINDOW_CTLR);
+               memcpy_fromio((char *) psource, (char *) (dimm_mmio), 
+                             size / 4);
+       }
+}
+#endif
+
+
+static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource, 
+                                u32 offset, u32 size)
+{
+       u32 window_size;
+       u16 idx;
+       u8 page_mask;
+       long dist;
+       void *mmio = pe->mmio_base;
+       struct pdc_host_priv *hpriv = pe->private_data;
+       void *dimm_mmio = hpriv->dimm_mmio;
+
+       /* hard-code chip #0 */   
+       mmio += PDC_CHIP0_OFS;
+
+       page_mask = 0x00;       
+       window_size = 0x2000 * 4;       /* 32K byte uchar size */  
+       idx = (u16) (offset / window_size);
+
+       writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
+       readl(mmio + PDC_DIMM_WINDOW_CTLR);
+       offset -= (idx * window_size); 
+       idx++;
+       dist = ((long)(s32)(window_size - (offset + size))) >= 0 ? size :
+               (long) (window_size - offset);
+       memcpy_toio((char *) (dimm_mmio + offset / 4), (char *) psource, dist);
+       writel(0x01, mmio + PDC_GENERAL_CTLR);
+       readl(mmio + PDC_GENERAL_CTLR);
+
+       psource += dist;    
+       size -= dist;
+       for (; (long) size >= (long) window_size ;) {
+               writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
+               readl(mmio + PDC_DIMM_WINDOW_CTLR);
+               memcpy_toio((char *) (dimm_mmio), (char *) psource, 
+                           window_size / 4);
+               writel(0x01, mmio + PDC_GENERAL_CTLR);
+               readl(mmio + PDC_GENERAL_CTLR);
+               psource += window_size;
+               size -= window_size;
+               idx ++;
+       }
+    
+       if (size) {
+               writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
+               readl(mmio + PDC_DIMM_WINDOW_CTLR);
+               memcpy_toio((char *) (dimm_mmio), (char *) psource, size / 4);
+               writel(0x01, mmio + PDC_GENERAL_CTLR);
+               readl(mmio + PDC_GENERAL_CTLR);
+       }
+}
+
+
+static unsigned int pdc20621_i2c_read(struct ata_probe_ent *pe, u32 device, 
+                                     u32 subaddr, u32 *pdata)
+{
+       void *mmio = pe->mmio_base;
+       u32 i2creg  = 0;
+       u32 status;     
+       u32 count =0;
+
+       /* hard-code chip #0 */
+       mmio += PDC_CHIP0_OFS;
+
+       i2creg |= device << 24;
+       i2creg |= subaddr << 16;
+
+       /* Set the device and subaddress */
+       writel(i2creg, mmio + PDC_I2C_ADDR_DATA_OFFSET);
+       readl(mmio + PDC_I2C_ADDR_DATA_OFFSET);
+
+       /* Write Control to perform read operation, mask int */
+       writel(PDC_I2C_READ | PDC_I2C_START | PDC_I2C_MASK_INT, 
+              mmio + PDC_I2C_CONTROL_OFFSET);
+
+       for (count = 0; count <= 1000; count ++) {
+               status = readl(mmio + PDC_I2C_CONTROL_OFFSET);
+               if (status & PDC_I2C_COMPLETE) {
+                       status = readl(mmio + PDC_I2C_ADDR_DATA_OFFSET);
+                       break;
+               } else if (count == 1000)
+                       return 0;
+       }
+
+       *pdata = (status >> 8) & 0x000000ff;
+       return 1;           
+}
+
+
+static int pdc20621_detect_dimm(struct ata_probe_ent *pe)
+{
+       u32 data=0 ;
+       if (pdc20621_i2c_read(pe, PDC_DIMM0_SPD_DEV_ADDRESS, 
+                            PDC_DIMM_SPD_SYSTEM_FREQ, &data)) {
+               if (data == 100)
+                       return 100;
+       } else
+               return 0;
+       
+       if (pdc20621_i2c_read(pe, PDC_DIMM0_SPD_DEV_ADDRESS, 9, &data)) {
+               if(data <= 0x75) 
+                       return 133;
+       } else
+               return 0;
+       
+       return 0;
+}
+
+
+static int pdc20621_prog_dimm0(struct ata_probe_ent *pe)
+{
+       u32 spd0[50];
+       u32 data = 0;
+       int size, i;
+       u8 bdimmsize; 
+       void *mmio = pe->mmio_base;
+       static const struct {
+               unsigned int reg;
+               unsigned int ofs;
+       } pdc_i2c_read_data [] = {
+               { PDC_DIMM_SPD_TYPE, 11 },              
+               { PDC_DIMM_SPD_FRESH_RATE, 12 },
+               { PDC_DIMM_SPD_COLUMN_NUM, 4 }, 
+               { PDC_DIMM_SPD_ATTRIBUTE, 21 },
+               { PDC_DIMM_SPD_ROW_NUM, 3 },
+               { PDC_DIMM_SPD_BANK_NUM, 17 },
+               { PDC_DIMM_SPD_MODULE_ROW, 5 },
+               { PDC_DIMM_SPD_ROW_PRE_CHARGE, 27 },
+               { PDC_DIMM_SPD_ROW_ACTIVE_DELAY, 28 },
+               { PDC_DIMM_SPD_RAS_CAS_DELAY, 29 },
+               { PDC_DIMM_SPD_ACTIVE_PRECHARGE, 30 },
+               { PDC_DIMM_SPD_CAS_LATENCY, 18 },       
+       };
+
+       /* hard-code chip #0 */
+       mmio += PDC_CHIP0_OFS;
+
+       for(i=0; i<ARRAY_SIZE(pdc_i2c_read_data); i++)
+               pdc20621_i2c_read(pe, PDC_DIMM0_SPD_DEV_ADDRESS,
+                                 pdc_i2c_read_data[i].reg, 
+                                 &spd0[pdc_i2c_read_data[i].ofs]);
+  
+       data |= (spd0[4] - 8) | ((spd0[21] != 0) << 3) | ((spd0[3]-11) << 4);
+       data |= ((spd0[17] / 4) << 6) | ((spd0[5] / 2) << 7) | 
+               ((((spd0[27] + 9) / 10) - 1) << 8) ;
+       data |= (((((spd0[29] > spd0[28]) 
+                   ? spd0[29] : spd0[28]) + 9) / 10) - 1) << 10; 
+       data |= ((spd0[30] - spd0[29] + 9) / 10 - 2) << 12;
+   
+       if (spd0[18] & 0x08) 
+               data |= ((0x03) << 14);
+       else if (spd0[18] & 0x04)
+               data |= ((0x02) << 14);
+       else if (spd0[18] & 0x01)
+               data |= ((0x01) << 14);
+       else
+               data |= (0 << 14);
+
+       /* 
+          Calculate the size of bDIMMSize (power of 2) and
+          merge the DIMM size by program start/end address.
+       */
+
+       bdimmsize = spd0[4] + (spd0[5] / 2) + spd0[3] + (spd0[17] / 2) + 3;
+       size = (1 << bdimmsize) >> 20;  /* size = xxx(MB) */
+       data |= (((size / 16) - 1) << 16);
+       data |= (0 << 23);
+       data |= 8;
+       writel(data, mmio + PDC_DIMM0_CONTROL_OFFSET); 
+       readl(mmio + PDC_DIMM0_CONTROL_OFFSET);
+       return size;                          
+}
+
+
+static unsigned int pdc20621_prog_dimm_global(struct ata_probe_ent *pe)
+{
+       u32 data, spd0;
+       int error, i;
+       void *mmio = pe->mmio_base;
+
+       /* hard-code chip #0 */
+       mmio += PDC_CHIP0_OFS;
+
+       /*
+         Set To Default : DIMM Module Global Control Register (0x022259F1)
+         DIMM Arbitration Disable (bit 20)
+         DIMM Data/Control Output Driving Selection (bit12 - bit15)
+         Refresh Enable (bit 17)
+       */
+
+       data = 0x022259F1;   
+       writel(data, mmio + PDC_SDRAM_CONTROL_OFFSET);
+       readl(mmio + PDC_SDRAM_CONTROL_OFFSET);
+
+       /* Turn on for ECC */
+       pdc20621_i2c_read(pe, PDC_DIMM0_SPD_DEV_ADDRESS, 
+                         PDC_DIMM_SPD_TYPE, &spd0);
+       if (spd0 == 0x02) {
+               data |= (0x01 << 16);
+               writel(data, mmio + PDC_SDRAM_CONTROL_OFFSET);
+               readl(mmio + PDC_SDRAM_CONTROL_OFFSET);
+               printk(KERN_ERR "Local DIMM ECC Enabled\n");
+       }
+
+       /* DIMM Initialization Select/Enable (bit 18/19) */
+       data &= (~(1<<18));
+       data |= (1<<19);
+       writel(data, mmio + PDC_SDRAM_CONTROL_OFFSET);
+
+       error = 1;                     
+       for (i = 1; i <= 10; i++) {   /* polling ~5 secs */
+               data = readl(mmio + PDC_SDRAM_CONTROL_OFFSET);
+               if (!(data & (1<<19))) {
+                       error = 0;
+                       break;     
+               }
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               schedule_timeout((i * 100) * HZ / 1000 + 1);
+       }
+       return error;
+}
+       
+
+static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe)
+{
+       int speed, size, length; 
+       u32 addr,spd0,pci_status;
+       u32 tmp=0;
+       u32 time_period=0;
+       u32 tcount=0;
+       u32 ticks=0;
+       u32 clock=0;
+       u32 fparam=0;
+       void *mmio = pe->mmio_base;
+
+       /* hard-code chip #0 */
+       mmio += PDC_CHIP0_OFS;
+
+       /* Initialize PLL based upon PCI Bus Frequency */
+
+       /* Initialize Time Period Register */
+       writel(0xffffffff, mmio + PDC_TIME_PERIOD);
+       time_period = readl(mmio + PDC_TIME_PERIOD);
+       VPRINTK("Time Period Register (0x40): 0x%x\n", time_period);
+
+       /* Enable timer */
+       writel(0x00001a0, mmio + PDC_TIME_CONTROL);
+       readl(mmio + PDC_TIME_CONTROL);
+
+       /* Wait 3 seconds */
+       set_current_state(TASK_UNINTERRUPTIBLE);
+       schedule_timeout(3 * HZ);
+
+       /* 
+          When timer is enabled, counter is decreased every internal
+          clock cycle.
+       */
+
+       tcount = readl(mmio + PDC_TIME_COUNTER);
+       VPRINTK("Time Counter Register (0x44): 0x%x\n", tcount);
+
+       /* 
+          If SX4 is on PCI-X bus, after 3 seconds, the timer counter
+          register should be >= (0xffffffff - 3x10^8).
+       */
+       if(tcount >= PCI_X_TCOUNT) {
+               ticks = (time_period - tcount);
+               VPRINTK("Num counters 0x%x (%d)\n", ticks, ticks);
+       
+               clock = (ticks / 300000);
+               VPRINTK("10 * Internal clk = 0x%x (%d)\n", clock, clock);
+               
+               clock = (clock * 33);
+               VPRINTK("10 * Internal clk * 33 = 0x%x (%d)\n", clock, clock);
+
+               /* PLL F Param (bit 22:16) */
+               fparam = (1400000 / clock) - 2;
+               VPRINTK("PLL F Param: 0x%x (%d)\n", fparam, fparam);
+               
+               /* OD param = 0x2 (bit 31:30), R param = 0x5 (bit 29:25) */
+               pci_status = (0x8a001824 | (fparam << 16));
+       } else
+               pci_status = PCI_PLL_INIT;
+
+       /* Initialize PLL. */
+       VPRINTK("pci_status: 0x%x\n", pci_status);
+       writel(pci_status, mmio + PDC_CTL_STATUS);
+       readl(mmio + PDC_CTL_STATUS);
+
+       /* 
+          Read SPD of DIMM by I2C interface,
+          and program the DIMM Module Controller.
+       */
+       if (!(speed = pdc20621_detect_dimm(pe))) {
+               printk(KERN_ERR "Detect Local DIMM Fail\n");  
+               return 1;       /* DIMM error */
+       }
+       VPRINTK("Local DIMM Speed = %d\n", speed);
+
+       /* Programming DIMM0 Module Control Register (index_CID0:80h) */ 
+       size = pdc20621_prog_dimm0(pe);
+       VPRINTK("Local DIMM Size = %dMB\n",size);
+
+       /* Programming DIMM Module Global Control Register (index_CID0:88h) */ 
+       if (pdc20621_prog_dimm_global(pe)) {
+               printk(KERN_ERR "Programming DIMM Module Global Control Register Fail\n");
+               return 1;
+       }
+
+#ifdef ATA_VERBOSE_DEBUG
+       {
+               u8 test_parttern1[40] = {0x55,0xAA,'P','r','o','m','i','s','e',' ',
+                               'N','o','t',' ','Y','e','t',' ','D','e','f','i','n','e','d',' ',
+                                '1','.','1','0',
+                               '9','8','0','3','1','6','1','2',0,0};
+               u8 test_parttern2[40] = {0};
+
+               pdc20621_put_to_dimm(pe, (void *) test_parttern2, 0x10040, 40);
+               pdc20621_put_to_dimm(pe, (void *) test_parttern2, 0x40, 40);
+
+               pdc20621_put_to_dimm(pe, (void *) test_parttern1, 0x10040, 40);
+               pdc20621_get_from_dimm(pe, (void *) test_parttern2, 0x40, 40);
+               printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0], 
+                      test_parttern2[1], &(test_parttern2[2]));
+               pdc20621_get_from_dimm(pe, (void *) test_parttern2, 0x10040, 
+                                      40);
+               printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0], 
+                      test_parttern2[1], &(test_parttern2[2]));
+
+               pdc20621_put_to_dimm(pe, (void *) test_parttern1, 0x40, 40);
+               pdc20621_get_from_dimm(pe, (void *) test_parttern2, 0x40, 40);
+               printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0], 
+                      test_parttern2[1], &(test_parttern2[2]));
+       }
+#endif
+
+       /* ECC initiliazation. */
+
+       pdc20621_i2c_read(pe, PDC_DIMM0_SPD_DEV_ADDRESS, 
+                         PDC_DIMM_SPD_TYPE, &spd0);
+       if (spd0 == 0x02) {
+               VPRINTK("Start ECC initialization\n");
+               addr = 0;
+               length = size * 1024 * 1024;
+               while (addr < length) {
+                       pdc20621_put_to_dimm(pe, (void *) &tmp, addr, 
+                                            sizeof(u32));
+                       addr += sizeof(u32);
+               }
+               VPRINTK("Finish ECC initialization\n");
+       }
+       return 0;
+}
+
+
+static void pdc_20621_init(struct ata_probe_ent *pe)
+{
+       u32 tmp;
+       void *mmio = pe->mmio_base;
+
+       /* hard-code chip #0 */
+       mmio += PDC_CHIP0_OFS;
+
+       /*
+        * Select page 0x40 for our 32k DIMM window
+        */
+       tmp = readl(mmio + PDC_20621_DIMM_WINDOW) & 0xffff0000;
+       tmp |= PDC_PAGE_WINDOW; /* page 40h; arbitrarily selected */
+       writel(tmp, mmio + PDC_20621_DIMM_WINDOW);
+
+       /*
+        * Reset Host DMA
+        */
+       tmp = readl(mmio + PDC_HDMA_CTLSTAT);
+       tmp |= PDC_RESET;
+       writel(tmp, mmio + PDC_HDMA_CTLSTAT);
+       readl(mmio + PDC_HDMA_CTLSTAT);         /* flush */
+
+       udelay(10);
+
+       tmp = readl(mmio + PDC_HDMA_CTLSTAT);
+       tmp &= ~PDC_RESET;
+       writel(tmp, mmio + PDC_HDMA_CTLSTAT);
+       readl(mmio + PDC_HDMA_CTLSTAT);         /* flush */
+}
+
+static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
+{
+       static int printed_version;
+       struct ata_probe_ent *probe_ent = NULL;
+       unsigned long base;
+       void *mmio_base, *dimm_mmio = NULL;
+       struct pdc_host_priv *hpriv = NULL;
+       unsigned int board_idx = (unsigned int) ent->driver_data;
+       int rc;
+
+       if (!printed_version++)
+               printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
+
+       /*
+        * If this driver happens to only be useful on Apple's K2, then
+        * we should check that here as it has a normal Serverworks ID
+        */
+       rc = pci_enable_device(pdev);
+       if (rc)
+               return rc;
+
+       rc = pci_request_regions(pdev, DRV_NAME);
+       if (rc)
+               goto err_out;
+
+       rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
+       if (rc)
+               goto err_out_regions;
+       rc = pci_set_consistent_dma_mask(pdev, ATA_DMA_MASK);
+       if (rc)
+               goto err_out_regions;
+
+       probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL);
+       if (probe_ent == NULL) {
+               rc = -ENOMEM;
+               goto err_out_regions;
+       }
+
+       memset(probe_ent, 0, sizeof(*probe_ent));
+       probe_ent->pdev = pdev;
+       INIT_LIST_HEAD(&probe_ent->node);
+
+       mmio_base = ioremap(pci_resource_start(pdev, 3),
+                           pci_resource_len(pdev, 3));
+       if (mmio_base == NULL) {
+               rc = -ENOMEM;
+               goto err_out_free_ent;
+       }
+       base = (unsigned long) mmio_base;
+
+       hpriv = kmalloc(sizeof(*hpriv), GFP_KERNEL);
+       if (!hpriv) {
+               rc = -ENOMEM;
+               goto err_out_iounmap;
+       }
+       memset(hpriv, 0, sizeof(*hpriv));
+
+       dimm_mmio = ioremap(pci_resource_start(pdev, 4),
+                           pci_resource_len(pdev, 4));
+       if (!dimm_mmio) {
+               kfree(hpriv);
+               rc = -ENOMEM;
+               goto err_out_iounmap;
+       }
+
+       hpriv->dimm_mmio = dimm_mmio;
+
+       probe_ent->sht          = pdc_port_info[board_idx].sht;
+       probe_ent->host_flags   = pdc_port_info[board_idx].host_flags;
+       probe_ent->pio_mask     = pdc_port_info[board_idx].pio_mask;
+       probe_ent->udma_mask    = pdc_port_info[board_idx].udma_mask;
+       probe_ent->port_ops     = pdc_port_info[board_idx].port_ops;
+
+               probe_ent->irq = pdev->irq;
+               probe_ent->irq_flags = SA_SHIRQ;
+       probe_ent->mmio_base = mmio_base;
+
+       probe_ent->private_data = hpriv;
+       base += PDC_CHIP0_OFS;
+
+       pdc_sata_setup_port(&probe_ent->port[0], base + 0x200);
+       pdc_sata_setup_port(&probe_ent->port[1], base + 0x280);
+
+       /* notice 4-port boards */
+       switch (board_idx) {
+       case board_20621:
+                       probe_ent->n_ports = 4;
+
+               pdc_sata_setup_port(&probe_ent->port[2], base + 0x300);
+               pdc_sata_setup_port(&probe_ent->port[3], base + 0x380);
+               break;
+       default:
+               BUG();
+               break;
+       }
+
+       pci_set_master(pdev);
+
+       /* initialize adapter */
+       /* initialize local dimm */
+       if (pdc20621_dimm_init(probe_ent)) {
+               rc = -ENOMEM;
+               goto err_out_iounmap_dimm;
+       }
+       pdc_20621_init(probe_ent);
+
+       /* FIXME: check ata_device_add return value */
+       ata_device_add(probe_ent);
+       kfree(probe_ent);
+
+       return 0;
+
+err_out_iounmap_dimm:          /* only get to this label if 20621 */
+       kfree(hpriv);
+       iounmap(dimm_mmio);
+err_out_iounmap:
+       iounmap(mmio_base);
+err_out_free_ent:
+       kfree(probe_ent);
+err_out_regions:
+       pci_release_regions(pdev);
+err_out:
+       pci_disable_device(pdev);
+       return rc;
+}
+
+
+static int __init pdc_sata_init(void)
+{
+       return pci_module_init(&pdc_sata_pci_driver);
+}
+
+
+static void __exit pdc_sata_exit(void)
+{
+       pci_unregister_driver(&pdc_sata_pci_driver);
+}
+
+
+MODULE_AUTHOR("Jeff Garzik");
+MODULE_DESCRIPTION("Promise SATA low-level driver");
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(pci, pdc_sata_pci_tbl);
+
+module_init(pdc_sata_init);
+module_exit(pdc_sata_exit);
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
new file mode 100644 (file)
index 0000000..0c86ff9
--- /dev/null
@@ -0,0 +1,1381 @@
+/*
+ *  linux/drivers/video/pxafb.c
+ *
+ *  Copyright (C) 1999 Eric A. Thomas.
+ *  Copyright (C) 2004 Jean-Frederic Clere.
+ *  Copyright (C) 2004 Ian Campbell.
+ *  Copyright (C) 2004 Jeff Lackey.
+ *   Based on sa1100fb.c Copyright (C) 1999 Eric A. Thomas
+ *  which in turn is
+ *   Based on acornfb.c Copyright (C) Russell King.
+ *
+ * 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.
+ *
+ *             Intel PXA250/210 LCD Controller Frame Buffer Driver
+ *
+ * Please direct your questions and comments on this driver to the following
+ * email address:
+ *
+ *     linux-arm-kernel@lists.arm.linux.org.uk
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/interrupt.h>
+#include <linux/slab.h>
+#include <linux/fb.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/cpufreq.h>
+#include <linux/device.h>
+#include <linux/dma-mapping.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/uaccess.h>
+#include <asm/arch/bitfield.h>
+#include <asm/arch/pxafb.h>
+
+/*
+ * Complain if VAR is out of range.
+ */
+#define DEBUG_VAR 1
+
+#include "pxafb.h"
+
+/* Bits which should not be set in machine configuration structures */
+#define LCCR0_INVALID_CONFIG_MASK (LCCR0_OUM|LCCR0_BM|LCCR0_QDM|LCCR0_DIS|LCCR0_EFM|LCCR0_IUM|LCCR0_SFM|LCCR0_LDM|LCCR0_ENB)
+#define LCCR3_INVALID_CONFIG_MASK (LCCR3_HSP|LCCR3_VSP|LCCR3_PCD|LCCR3_BPP)
+
+static void (*pxafb_backlight_power)(int);
+static void (*pxafb_lcd_power)(int);
+
+static int pxafb_activate_var(struct fb_var_screeninfo *var, struct pxafb_info *);
+static void set_ctrlr_state(struct pxafb_info *fbi, u_int state);
+
+#ifdef CONFIG_FB_PXA_PARAMETERS
+#define PXAFB_OPTIONS_SIZE 256
+static char g_options[PXAFB_OPTIONS_SIZE] __initdata = "";
+#endif
+
+static inline void pxafb_schedule_work(struct pxafb_info *fbi, u_int state)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       /*
+        * We need to handle two requests being made at the same time.
+        * There are two important cases:
+        *  1. When we are changing VT (C_REENABLE) while unblanking (C_ENABLE)
+        *     We must perform the unblanking, which will do our REENABLE for us.
+        *  2. When we are blanking, but immediately unblank before we have
+        *     blanked.  We do the "REENABLE" thing here as well, just to be sure.
+        */
+       if (fbi->task_state == C_ENABLE && state == C_REENABLE)
+               state = (u_int) -1;
+       if (fbi->task_state == C_DISABLE && state == C_ENABLE)
+               state = C_REENABLE;
+
+       if (state != (u_int)-1) {
+               fbi->task_state = state;
+               schedule_work(&fbi->task);
+       }
+       local_irq_restore(flags);
+}
+
+static inline u_int chan_to_field(u_int chan, struct fb_bitfield *bf)
+{
+       chan &= 0xffff;
+       chan >>= 16 - bf->length;
+       return chan << bf->offset;
+}
+
+static int
+pxafb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue,
+                      u_int trans, struct fb_info *info)
+{
+       struct pxafb_info *fbi = (struct pxafb_info *)info;
+       u_int val, ret = 1;
+
+       if (regno < fbi->palette_size) {
+               val  = ((red   >>  0) & 0xf800);
+               val |= ((green >>  5) & 0x07e0);
+               val |= ((blue  >> 11) & 0x001f);
+
+               fbi->palette_cpu[regno] = val;
+               ret = 0;
+       }
+       return ret;
+}
+
+static int
+pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+                  u_int trans, struct fb_info *info)
+{
+       struct pxafb_info *fbi = (struct pxafb_info *)info;
+       unsigned int val;
+       int ret = 1;
+
+       /*
+        * If inverse mode was selected, invert all the colours
+        * rather than the register number.  The register number
+        * is what you poke into the framebuffer to produce the
+        * colour you requested.
+        */
+       if (fbi->cmap_inverse) {
+               red   = 0xffff - red;
+               green = 0xffff - green;
+               blue  = 0xffff - blue;
+       }
+
+       /*
+        * If greyscale is true, then we convert the RGB value
+        * to greyscale no matter what visual we are using.
+        */
+       if (fbi->fb.var.grayscale)
+               red = green = blue = (19595 * red + 38470 * green +
+                                       7471 * blue) >> 16;
+
+       switch (fbi->fb.fix.visual) {
+       case FB_VISUAL_TRUECOLOR:
+               /*
+                * 12 or 16-bit True Colour.  We encode the RGB value
+                * according to the RGB bitfield information.
+                */
+               if (regno < 16) {
+                       u32 *pal = fbi->fb.pseudo_palette;
+
+                       val  = chan_to_field(red, &fbi->fb.var.red);
+                       val |= chan_to_field(green, &fbi->fb.var.green);
+                       val |= chan_to_field(blue, &fbi->fb.var.blue);
+
+                       pal[regno] = val;
+                       ret = 0;
+               }
+               break;
+
+       case FB_VISUAL_STATIC_PSEUDOCOLOR:
+       case FB_VISUAL_PSEUDOCOLOR:
+               ret = pxafb_setpalettereg(regno, red, green, blue, trans, info);
+               break;
+       }
+
+       return ret;
+}
+
+/*
+ *  pxafb_bpp_to_lccr3():
+ *    Convert a bits per pixel value to the correct bit pattern for LCCR3
+ */
+static int pxafb_bpp_to_lccr3(struct fb_var_screeninfo *var)
+{
+        int ret = 0;
+        switch (var->bits_per_pixel) {
+        case 1:  ret = LCCR3_1BPP; break;
+        case 2:  ret = LCCR3_2BPP; break;
+        case 4:  ret = LCCR3_4BPP; break;
+        case 8:  ret = LCCR3_8BPP; break;
+        case 16: ret = LCCR3_16BPP; break;
+        }
+        return ret;
+}
+
+#ifdef CONFIG_CPU_FREQ
+/*
+ *  pxafb_display_dma_period()
+ *    Calculate the minimum period (in picoseconds) between two DMA
+ *    requests for the LCD controller.  If we hit this, it means we're
+ *    doing nothing but LCD DMA.
+ */
+static unsigned int pxafb_display_dma_period(struct fb_var_screeninfo *var)
+{
+       /*
+        * Period = pixclock * bits_per_byte * bytes_per_transfer
+        *              / memory_bits_per_pixel;
+        */
+       return var->pixclock * 8 * 16 / var->bits_per_pixel;
+}
+
+extern unsigned int get_clk_frequency_khz(int info);
+#endif
+
+/*
+ *  pxafb_check_var():
+ *    Get the video params out of 'var'. If a value doesn't fit, round it up,
+ *    if it's too big, return -EINVAL.
+ *
+ *    Round up in the following order: bits_per_pixel, xres,
+ *    yres, xres_virtual, yres_virtual, xoffset, yoffset, grayscale,
+ *    bitfields, horizontal timing, vertical timing.
+ */
+static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
+{
+       struct pxafb_info *fbi = (struct pxafb_info *)info;
+
+       if (var->xres < MIN_XRES)
+               var->xres = MIN_XRES;
+       if (var->yres < MIN_YRES)
+               var->yres = MIN_YRES;
+       if (var->xres > fbi->max_xres)
+               var->xres = fbi->max_xres;
+       if (var->yres > fbi->max_yres)
+               var->yres = fbi->max_yres;
+       var->xres_virtual =
+               max(var->xres_virtual, var->xres);
+       var->yres_virtual =
+               max(var->yres_virtual, var->yres);
+
+        /*
+        * Setup the RGB parameters for this display.
+        *
+        * The pixel packing format is described on page 7-11 of the
+        * PXA2XX Developer's Manual.
+         */
+       if ( var->bits_per_pixel == 16 ) {
+               var->red.offset   = 11; var->red.length   = 5;
+               var->green.offset = 5;  var->green.length = 6;
+               var->blue.offset  = 0;  var->blue.length  = 5;
+               var->transp.offset = var->transp.length = 0;
+       } else {
+               var->red.offset = var->green.offset = var->blue.offset = var->transp.offset = 0;
+               var->red.length   = 8;
+               var->green.length = 8;
+               var->blue.length  = 8;
+               var->transp.length = 0;
+       }
+
+#ifdef CONFIG_CPU_FREQ
+       DPRINTK("dma period = %d ps, clock = %d kHz\n",
+               pxafb_display_dma_period(var),
+               get_clk_frequency_khz(0));
+#endif
+
+       return 0;
+}
+
+static inline void pxafb_set_truecolor(u_int is_true_color)
+{
+       DPRINTK("true_color = %d\n", is_true_color);
+       // do your machine-specific setup if needed
+}
+
+/*
+ * pxafb_set_par():
+ *     Set the user defined part of the display for the specified console
+ */
+static int pxafb_set_par(struct fb_info *info)
+{
+       struct pxafb_info *fbi = (struct pxafb_info *)info;
+       struct fb_var_screeninfo *var = &info->var;
+       unsigned long palette_mem_size;
+
+       DPRINTK("set_par\n");
+
+       if (var->bits_per_pixel == 16)
+               fbi->fb.fix.visual = FB_VISUAL_TRUECOLOR;
+       else if (!fbi->cmap_static)
+               fbi->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR;
+       else {
+               /*
+                * Some people have weird ideas about wanting static
+                * pseudocolor maps.  I suspect their user space
+                * applications are broken.
+                */
+               fbi->fb.fix.visual = FB_VISUAL_STATIC_PSEUDOCOLOR;
+       }
+
+       fbi->fb.fix.line_length = var->xres_virtual *
+                                 var->bits_per_pixel / 8;
+       fbi->palette_size = var->bits_per_pixel == 8 ? 256 : 16;
+
+       palette_mem_size = fbi->palette_size * sizeof(u16);
+
+       DPRINTK("palette_mem_size = 0x%08lx\n", (u_long) palette_mem_size);
+
+       fbi->palette_cpu = (u16 *)(fbi->map_cpu + PAGE_SIZE - palette_mem_size);
+       fbi->palette_dma = fbi->map_dma + PAGE_SIZE - palette_mem_size;
+
+       /*
+        * Set (any) board control register to handle new color depth
+        */
+       pxafb_set_truecolor(fbi->fb.fix.visual == FB_VISUAL_TRUECOLOR);
+
+       pxafb_activate_var(var, fbi);
+
+       return 0;
+}
+
+/*
+ * Formal definition of the VESA spec:
+ *  On
+ *     This refers to the state of the display when it is in full operation
+ *  Stand-By
+ *     This defines an optional operating state of minimal power reduction with
+ *     the shortest recovery time
+ *  Suspend
+ *     This refers to a level of power management in which substantial power
+ *     reduction is achieved by the display.  The display can have a longer
+ *     recovery time from this state than from the Stand-by state
+ *  Off
+ *     This indicates that the display is consuming the lowest level of power
+ *     and is non-operational. Recovery from this state may optionally require
+ *     the user to manually power on the monitor
+ *
+ *  Now, the fbdev driver adds an additional state, (blank), where they
+ *  turn off the video (maybe by colormap tricks), but don't mess with the
+ *  video itself: think of it semantically between on and Stand-By.
+ *
+ *  So here's what we should do in our fbdev blank routine:
+ *
+ *     VESA_NO_BLANKING (mode 0)       Video on,  front/back light on
+ *     VESA_VSYNC_SUSPEND (mode 1)     Video on,  front/back light off
+ *     VESA_HSYNC_SUSPEND (mode 2)     Video on,  front/back light off
+ *     VESA_POWERDOWN (mode 3)         Video off, front/back light off
+ *
+ *  This will match the matrox implementation.
+ */
+
+/*
+ * pxafb_blank():
+ *     Blank the display by setting all palette values to zero.  Note, the
+ *     12 and 16 bpp modes don't really use the palette, so this will not
+ *      blank the display in all modes.
+ */
+static int pxafb_blank(int blank, struct fb_info *info)
+{
+       struct pxafb_info *fbi = (struct pxafb_info *)info;
+       int i;
+
+       DPRINTK("pxafb_blank: blank=%d\n", blank);
+
+       switch (blank) {
+       case VESA_POWERDOWN:
+       case VESA_VSYNC_SUSPEND:
+       case VESA_HSYNC_SUSPEND:
+               if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR ||
+                   fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR)
+                       for (i = 0; i < fbi->palette_size; i++)
+                               pxafb_setpalettereg(i, 0, 0, 0, 0, info);
+
+               pxafb_schedule_work(fbi, C_DISABLE);
+               //TODO if (pxafb_blank_helper) pxafb_blank_helper(blank);
+               break;
+
+       case VESA_NO_BLANKING:
+               //TODO if (pxafb_blank_helper) pxafb_blank_helper(blank);
+               if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR ||
+                   fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR)
+                       fb_set_cmap(&fbi->fb.cmap, 1, info);
+               pxafb_schedule_work(fbi, C_ENABLE);
+       }
+       return 0;
+}
+
+static struct fb_ops pxafb_ops = {
+       .owner          = THIS_MODULE,
+       .fb_check_var   = pxafb_check_var,
+       .fb_set_par     = pxafb_set_par,
+       .fb_setcolreg   = pxafb_setcolreg,
+       .fb_fillrect    = cfb_fillrect,
+       .fb_copyarea    = cfb_copyarea,
+       .fb_imageblit   = cfb_imageblit,
+       .fb_blank       = pxafb_blank,
+       .fb_cursor      = soft_cursor,
+};
+
+/*
+ * Calculate the PCD value from the clock rate (in picoseconds).
+ * We take account of the PPCR clock setting.
+ * From PXA Developer's Manual:
+ *
+ *   PixelClock =      LCLK
+ *                -------------
+ *                2 ( PCD + 1 )
+ *
+ *   PCD =      LCLK
+ *         ------------- - 1
+ *         2(PixelClock)
+ *
+ * Where:
+ *   LCLK = LCD/Memory Clock
+ *   PCD = LCCR3[7:0]
+ *
+ * PixelClock here is in Hz while the pixclock argument given is the
+ * period in picoseconds. Hence PixelClock = 1 / ( pixclock * 10^-12 )
+ *
+ * The function get_lclk_frequency_10khz returns LCLK in units of
+ * 10khz. Calling the result of this function lclk gives us the
+ * following
+ *
+ *    PCD = (lclk * 10^4 ) * ( pixclock * 10^-12 )
+ *          -------------------------------------- - 1
+ *                          2
+ *
+ * Factoring the 10^4 and 10^-12 out gives 10^-8 == 1 / 100000000 as used below.
+ */
+static inline unsigned int get_pcd(unsigned int pixclock)
+{
+       unsigned long long pcd;
+
+       /* FIXME: Need to take into account Double Pixel Clock mode
+         * (DPC) bit? or perhaps set it based on the various clock
+         * speeds */
+
+       pcd = (unsigned long long)get_lclk_frequency_10khz() * (unsigned long long)pixclock;
+       pcd /= 100000000 * 2;
+       /* no need for this, since we should subtract 1 anyway. they cancel */
+       /* pcd += 1; */ /* make up for integer math truncations */
+       return (unsigned int)pcd;
+}
+
+/*
+ * pxafb_activate_var():
+ *     Configures LCD Controller based on entries in var parameter.  Settings are
+ *     only written to the controller if changes were made.
+ */
+static int pxafb_activate_var(struct fb_var_screeninfo *var, struct pxafb_info *fbi)
+{
+       struct pxafb_lcd_reg new_regs;
+       u_long flags;
+       u_int lines_per_panel, pcd = get_pcd(var->pixclock);
+
+       DPRINTK("Configuring PXA LCD\n");
+
+       DPRINTK("var: xres=%d hslen=%d lm=%d rm=%d\n",
+               var->xres, var->hsync_len,
+               var->left_margin, var->right_margin);
+       DPRINTK("var: yres=%d vslen=%d um=%d bm=%d\n",
+               var->yres, var->vsync_len,
+               var->upper_margin, var->lower_margin);
+       DPRINTK("var: pixclock=%d pcd=%d\n", var->pixclock, pcd);
+
+#if DEBUG_VAR
+       if (var->xres < 16        || var->xres > 1024)
+               printk(KERN_ERR "%s: invalid xres %d\n",
+                       fbi->fb.fix.id, var->xres);
+       switch(var->bits_per_pixel) {
+       case 1:
+       case 2:
+       case 4:
+       case 8:
+       case 16:
+               break;
+       default:
+               printk(KERN_ERR "%s: invalid bit depth %d\n",
+                      fbi->fb.fix.id, var->bits_per_pixel);
+               break;
+       }
+       if (var->hsync_len < 1    || var->hsync_len > 64)
+               printk(KERN_ERR "%s: invalid hsync_len %d\n",
+                       fbi->fb.fix.id, var->hsync_len);
+       if (var->left_margin < 1  || var->left_margin > 255)
+               printk(KERN_ERR "%s: invalid left_margin %d\n",
+                       fbi->fb.fix.id, var->left_margin);
+       if (var->right_margin < 1 || var->right_margin > 255)
+               printk(KERN_ERR "%s: invalid right_margin %d\n",
+                       fbi->fb.fix.id, var->right_margin);
+       if (var->yres < 1         || var->yres > 1024)
+               printk(KERN_ERR "%s: invalid yres %d\n",
+                       fbi->fb.fix.id, var->yres);
+       if (var->vsync_len < 1    || var->vsync_len > 64)
+               printk(KERN_ERR "%s: invalid vsync_len %d\n",
+                       fbi->fb.fix.id, var->vsync_len);
+       if (var->upper_margin < 0 || var->upper_margin > 255)
+               printk(KERN_ERR "%s: invalid upper_margin %d\n",
+                       fbi->fb.fix.id, var->upper_margin);
+       if (var->lower_margin < 0 || var->lower_margin > 255)
+               printk(KERN_ERR "%s: invalid lower_margin %d\n",
+                       fbi->fb.fix.id, var->lower_margin);
+#endif
+
+       new_regs.lccr0 = fbi->lccr0 |
+               (LCCR0_LDM | LCCR0_SFM | LCCR0_IUM | LCCR0_EFM |
+                 LCCR0_QDM | LCCR0_BM  | LCCR0_OUM);
+
+       new_regs.lccr1 =
+               LCCR1_DisWdth(var->xres) +
+               LCCR1_HorSnchWdth(var->hsync_len) +
+               LCCR1_BegLnDel(var->left_margin) +
+               LCCR1_EndLnDel(var->right_margin);
+
+       /*
+        * If we have a dual scan LCD, we need to halve
+        * the YRES parameter.
+        */
+       lines_per_panel = var->yres;
+       if (fbi->lccr0 & LCCR0_SDS)
+               lines_per_panel /= 2;
+
+       new_regs.lccr2 =
+               LCCR2_DisHght(lines_per_panel) +
+               LCCR2_VrtSnchWdth(var->vsync_len) +
+               LCCR2_BegFrmDel(var->upper_margin) +
+               LCCR2_EndFrmDel(var->lower_margin);
+
+       new_regs.lccr3 = fbi->lccr3 |
+               pxafb_bpp_to_lccr3(var) |
+               (var->sync & FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) |
+               (var->sync & FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL);
+
+       if (pcd)
+               new_regs.lccr3 |= LCCR3_PixClkDiv(pcd);
+
+       DPRINTK("nlccr0 = 0x%08x\n", new_regs.lccr0);
+       DPRINTK("nlccr1 = 0x%08x\n", new_regs.lccr1);
+       DPRINTK("nlccr2 = 0x%08x\n", new_regs.lccr2);
+       DPRINTK("nlccr3 = 0x%08x\n", new_regs.lccr3);
+
+       /* Update shadow copy atomically */
+       local_irq_save(flags);
+
+       /* setup dma descriptors */
+       fbi->dmadesc_fblow_cpu = (struct pxafb_dma_descriptor *)((unsigned int)fbi->palette_cpu - 3*16);
+       fbi->dmadesc_fbhigh_cpu = (struct pxafb_dma_descriptor *)((unsigned int)fbi->palette_cpu - 2*16);
+       fbi->dmadesc_palette_cpu = (struct pxafb_dma_descriptor *)((unsigned int)fbi->palette_cpu - 1*16);
+
+       fbi->dmadesc_fblow_dma = fbi->palette_dma - 3*16;
+       fbi->dmadesc_fbhigh_dma = fbi->palette_dma - 2*16;
+       fbi->dmadesc_palette_dma = fbi->palette_dma - 1*16;
+
+#define BYTES_PER_PANEL (lines_per_panel * fbi->fb.fix.line_length)
+
+       /* populate descriptors */
+       fbi->dmadesc_fblow_cpu->fdadr = fbi->dmadesc_fblow_dma;
+       fbi->dmadesc_fblow_cpu->fsadr = fbi->screen_dma + BYTES_PER_PANEL;
+       fbi->dmadesc_fblow_cpu->fidr  = 0;
+       fbi->dmadesc_fblow_cpu->ldcmd = BYTES_PER_PANEL;
+
+       fbi->fdadr1 = fbi->dmadesc_fblow_dma; /* only used in dual-panel mode */
+
+       fbi->dmadesc_fbhigh_cpu->fsadr = fbi->screen_dma;
+       fbi->dmadesc_fbhigh_cpu->fidr = 0;
+       fbi->dmadesc_fbhigh_cpu->ldcmd = BYTES_PER_PANEL;
+
+       fbi->dmadesc_palette_cpu->fsadr = fbi->palette_dma;
+       fbi->dmadesc_palette_cpu->fidr  = 0;
+       fbi->dmadesc_palette_cpu->ldcmd = (fbi->palette_size * 2) | LDCMD_PAL;
+
+       if( var->bits_per_pixel < 12)
+       {
+               /* assume any mode with <12 bpp is palette driven */
+               fbi->dmadesc_palette_cpu->fdadr = fbi->dmadesc_fbhigh_dma;
+               fbi->dmadesc_fbhigh_cpu->fdadr = fbi->dmadesc_palette_dma;
+               fbi->fdadr0 = fbi->dmadesc_palette_dma; /* flips back and forth between pal and fbhigh */
+       }
+       else
+       {
+               /* palette shouldn't be loaded in true-color mode */
+               fbi->dmadesc_fbhigh_cpu->fdadr = fbi->dmadesc_fbhigh_dma;
+               fbi->fdadr0 = fbi->dmadesc_fbhigh_dma; /* no pal just fbhigh */
+               /* init it to something, even though we won't be using it */
+               fbi->dmadesc_palette_cpu->fdadr = fbi->dmadesc_palette_dma;
+       }
+
+#if 0
+       DPRINTK("fbi->dmadesc_fblow_cpu = 0x%p\n", fbi->dmadesc_fblow_cpu);
+       DPRINTK("fbi->dmadesc_fbhigh_cpu = 0x%p\n", fbi->dmadesc_fbhigh_cpu);
+       DPRINTK("fbi->dmadesc_palette_cpu = 0x%p\n", fbi->dmadesc_palette_cpu);
+       DPRINTK("fbi->dmadesc_fblow_dma = 0x%x\n", fbi->dmadesc_fblow_dma);
+       DPRINTK("fbi->dmadesc_fbhigh_dma = 0x%x\n", fbi->dmadesc_fbhigh_dma);
+       DPRINTK("fbi->dmadesc_palette_dma = 0x%x\n", fbi->dmadesc_palette_dma);
+
+       DPRINTK("fbi->dmadesc_fblow_cpu->fdadr = 0x%x\n", fbi->dmadesc_fblow_cpu->fdadr);
+       DPRINTK("fbi->dmadesc_fbhigh_cpu->fdadr = 0x%x\n", fbi->dmadesc_fbhigh_cpu->fdadr);
+       DPRINTK("fbi->dmadesc_palette_cpu->fdadr = 0x%x\n", fbi->dmadesc_palette_cpu->fdadr);
+
+       DPRINTK("fbi->dmadesc_fblow_cpu->fsadr = 0x%x\n", fbi->dmadesc_fblow_cpu->fsadr);
+       DPRINTK("fbi->dmadesc_fbhigh_cpu->fsadr = 0x%x\n", fbi->dmadesc_fbhigh_cpu->fsadr);
+       DPRINTK("fbi->dmadesc_palette_cpu->fsadr = 0x%x\n", fbi->dmadesc_palette_cpu->fsadr);
+
+       DPRINTK("fbi->dmadesc_fblow_cpu->ldcmd = 0x%x\n", fbi->dmadesc_fblow_cpu->ldcmd);
+       DPRINTK("fbi->dmadesc_fbhigh_cpu->ldcmd = 0x%x\n", fbi->dmadesc_fbhigh_cpu->ldcmd);
+       DPRINTK("fbi->dmadesc_palette_cpu->ldcmd = 0x%x\n", fbi->dmadesc_palette_cpu->ldcmd);
+#endif
+
+       fbi->reg_lccr0 = new_regs.lccr0;
+       fbi->reg_lccr1 = new_regs.lccr1;
+       fbi->reg_lccr2 = new_regs.lccr2;
+       fbi->reg_lccr3 = new_regs.lccr3;
+       local_irq_restore(flags);
+
+       /*
+        * Only update the registers if the controller is enabled
+        * and something has changed.
+        */
+       if ((LCCR0  != fbi->reg_lccr0) || (LCCR1  != fbi->reg_lccr1) ||
+           (LCCR2  != fbi->reg_lccr2) || (LCCR3  != fbi->reg_lccr3) ||
+           (FDADR0 != fbi->fdadr0)    || (FDADR1 != fbi->fdadr1))
+               pxafb_schedule_work(fbi, C_REENABLE);
+
+       return 0;
+}
+
+/*
+ * NOTE!  The following functions are purely helpers for set_ctrlr_state.
+ * Do not call them directly; set_ctrlr_state does the correct serialisation
+ * to ensure that things happen in the right way 100% of time time.
+ *     -- rmk
+ */
+static inline void __pxafb_backlight_power(struct pxafb_info *fbi, int on)
+{
+       DPRINTK("backlight o%s\n", on ? "n" : "ff");
+
+       if (pxafb_backlight_power)
+               pxafb_backlight_power(on);
+}
+
+static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on)
+{
+       DPRINTK("LCD power o%s\n", on ? "n" : "ff");
+
+       if (pxafb_lcd_power)
+               pxafb_lcd_power(on);
+}
+
+static void pxafb_setup_gpio(struct pxafb_info *fbi)
+{
+        unsigned int lccr0 = fbi->lccr0;
+
+       /*
+        * setup is based on type of panel supported
+        */
+
+       /* 4 bit interface */
+       if ((lccr0 & LCCR0_CMS) == LCCR0_Mono &&
+           (lccr0 & LCCR0_SDS) == LCCR0_Sngl &&
+           (lccr0 & LCCR0_DPD) == LCCR0_4PixMono)
+       {
+               // bits 58-61
+               GPDR1 |= (0xf << 26);
+               GAFR1_U = (GAFR1_U & ~(0xff << 20)) | (0xaa << 20);
+
+               // bits 74-77
+               GPDR2 |= (0xf << 10);
+               GAFR2_L = (GAFR2_L & ~(0xff << 20)) | (0xaa << 20);
+       }
+
+       /* 8 bit interface */
+        else if (((lccr0 & LCCR0_CMS) == LCCR0_Mono &&
+                 ((lccr0 & LCCR0_SDS) == LCCR0_Dual || (lccr0 & LCCR0_DPD) == LCCR0_8PixMono)) ||
+                 ((lccr0 & LCCR0_CMS) == LCCR0_Color &&
+                 (lccr0 & LCCR0_PAS) == LCCR0_Pas && (lccr0 & LCCR0_SDS) == LCCR0_Sngl))
+       {
+               // bits 58-65
+               GPDR1 |= (0x3f << 26);
+               GPDR2 |= (0x3);
+
+               GAFR1_U = (GAFR1_U & ~(0xfff << 20)) | (0xaaa << 20);
+               GAFR2_L = (GAFR2_L & ~0xf) | (0xa);
+
+               // bits 74-77
+               GPDR2 |= (0xf << 10);
+               GAFR2_L = (GAFR2_L & ~(0xff << 20)) | (0xaa << 20);
+       }
+
+       /* 16 bit interface */
+       else if ((lccr0 & LCCR0_CMS) == LCCR0_Color &&
+                ((lccr0 & LCCR0_SDS) == LCCR0_Dual || (lccr0 & LCCR0_PAS) == LCCR0_Act))
+       {
+               // bits 58-77
+               GPDR1 |= (0x3f << 26);
+               GPDR2 |= 0x00003fff;
+
+               GAFR1_U = (GAFR1_U & ~(0xfff << 20)) | (0xaaa << 20);
+               GAFR2_L = (GAFR2_L & 0xf0000000) | 0x0aaaaaaa;
+       }
+
+       else {
+               printk( KERN_ERR "pxafb_setup_gpio: unable to determine bits per pixel\n");
+        }
+}
+
+static void pxafb_enable_controller(struct pxafb_info *fbi)
+{
+       DPRINTK("Enabling LCD controller\n");
+       DPRINTK("fdadr0 0x%08x\n", (unsigned int) fbi->fdadr0);
+       DPRINTK("fdadr1 0x%08x\n", (unsigned int) fbi->fdadr1);
+       DPRINTK("reg_lccr0 0x%08x\n", (unsigned int) fbi->reg_lccr0);
+       DPRINTK("reg_lccr1 0x%08x\n", (unsigned int) fbi->reg_lccr1);
+       DPRINTK("reg_lccr2 0x%08x\n", (unsigned int) fbi->reg_lccr2);
+       DPRINTK("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3);
+
+       /* Sequence from 11.7.10 */
+       LCCR3 = fbi->reg_lccr3;
+       LCCR2 = fbi->reg_lccr2;
+       LCCR1 = fbi->reg_lccr1;
+       LCCR0 = fbi->reg_lccr0 & ~LCCR0_ENB;
+
+       FDADR0 = fbi->fdadr0;
+       FDADR1 = fbi->fdadr1;
+       LCCR0 |= LCCR0_ENB;
+
+       DPRINTK("FDADR0 0x%08x\n", (unsigned int) FDADR0);
+       DPRINTK("FDADR1 0x%08x\n", (unsigned int) FDADR1);
+       DPRINTK("LCCR0 0x%08x\n", (unsigned int) LCCR0);
+       DPRINTK("LCCR1 0x%08x\n", (unsigned int) LCCR1);
+       DPRINTK("LCCR2 0x%08x\n", (unsigned int) LCCR2);
+       DPRINTK("LCCR3 0x%08x\n", (unsigned int) LCCR3);
+}
+
+static void pxafb_disable_controller(struct pxafb_info *fbi)
+{
+       DECLARE_WAITQUEUE(wait, current);
+
+       DPRINTK("Disabling LCD controller\n");
+
+       add_wait_queue(&fbi->ctrlr_wait, &wait);
+       set_current_state(TASK_UNINTERRUPTIBLE);
+
+       LCSR = 0xffffffff;      /* Clear LCD Status Register */
+       LCCR0 &= ~LCCR0_LDM;    /* Enable LCD Disable Done Interrupt */
+       LCCR0 |= LCCR0_DIS;     /* Disable LCD Controller */
+
+       schedule_timeout(20 * HZ / 1000);
+       remove_wait_queue(&fbi->ctrlr_wait, &wait);
+}
+
+/*
+ *  pxafb_handle_irq: Handle 'LCD DONE' interrupts.
+ */
+static irqreturn_t pxafb_handle_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
+       struct pxafb_info *fbi = dev_id;
+       unsigned int lcsr = LCSR;
+
+       if (lcsr & LCSR_LDD) {
+               LCCR0 |= LCCR0_LDM;
+               wake_up(&fbi->ctrlr_wait);
+       }
+
+       LCSR = lcsr;
+       return IRQ_HANDLED;
+}
+
+/*
+ * This function must be called from task context only, since it will
+ * sleep when disabling the LCD controller, or if we get two contending
+ * processes trying to alter state.
+ */
+static void set_ctrlr_state(struct pxafb_info *fbi, u_int state)
+{
+       u_int old_state;
+
+       down(&fbi->ctrlr_sem);
+
+       old_state = fbi->state;
+
+       /*
+        * Hack around fbcon initialisation.
+        */
+       if (old_state == C_STARTUP && state == C_REENABLE)
+               state = C_ENABLE;
+
+       switch (state) {
+       case C_DISABLE_CLKCHANGE:
+               /*
+                * Disable controller for clock change.  If the
+                * controller is already disabled, then do nothing.
+                */
+               if (old_state != C_DISABLE && old_state != C_DISABLE_PM) {
+                       fbi->state = state;
+                       //TODO __pxafb_lcd_power(fbi, 0);
+                       pxafb_disable_controller(fbi);
+               }
+               break;
+
+       case C_DISABLE_PM:
+       case C_DISABLE:
+               /*
+                * Disable controller
+                */
+               if (old_state != C_DISABLE) {
+                       fbi->state = state;
+                       __pxafb_backlight_power(fbi, 0);
+                       __pxafb_lcd_power(fbi, 0);
+                       if (old_state != C_DISABLE_CLKCHANGE)
+                               pxafb_disable_controller(fbi);
+               }
+               break;
+
+       case C_ENABLE_CLKCHANGE:
+               /*
+                * Enable the controller after clock change.  Only
+                * do this if we were disabled for the clock change.
+                */
+               if (old_state == C_DISABLE_CLKCHANGE) {
+                       fbi->state = C_ENABLE;
+                       pxafb_enable_controller(fbi);
+                       //TODO __pxafb_lcd_power(fbi, 1);
+               }
+               break;
+
+       case C_REENABLE:
+               /*
+                * Re-enable the controller only if it was already
+                * enabled.  This is so we reprogram the control
+                * registers.
+                */
+               if (old_state == C_ENABLE) {
+                       pxafb_disable_controller(fbi);
+                       pxafb_setup_gpio(fbi);
+                       pxafb_enable_controller(fbi);
+               }
+               break;
+
+       case C_ENABLE_PM:
+               /*
+                * Re-enable the controller after PM.  This is not
+                * perfect - think about the case where we were doing
+                * a clock change, and we suspended half-way through.
+                */
+               if (old_state != C_DISABLE_PM)
+                       break;
+               /* fall through */
+
+       case C_ENABLE:
+               /*
+                * Power up the LCD screen, enable controller, and
+                * turn on the backlight.
+                */
+               if (old_state != C_ENABLE) {
+                       fbi->state = C_ENABLE;
+                       pxafb_setup_gpio(fbi);
+                       pxafb_enable_controller(fbi);
+                       __pxafb_lcd_power(fbi, 1);
+                       __pxafb_backlight_power(fbi, 1);
+               }
+               break;
+       }
+       up(&fbi->ctrlr_sem);
+}
+
+/*
+ * Our LCD controller task (which is called when we blank or unblank)
+ * via keventd.
+ */
+static void pxafb_task(void *dummy)
+{
+       struct pxafb_info *fbi = dummy;
+       u_int state = xchg(&fbi->task_state, -1);
+
+       set_ctrlr_state(fbi, state);
+}
+
+#ifdef CONFIG_CPU_FREQ
+/*
+ * CPU clock speed change handler.  We need to adjust the LCD timing
+ * parameters when the CPU clock is adjusted by the power management
+ * subsystem.
+ *
+ * TODO: Determine why f->new != 10*get_lclk_frequency_10khz()
+ */
+static int
+pxafb_freq_transition(struct notifier_block *nb, unsigned long val, void *data)
+{
+       struct pxafb_info *fbi = TO_INF(nb, freq_transition);
+       //TODO struct cpufreq_freqs *f = data;
+       u_int pcd;
+
+       switch (val) {
+       case CPUFREQ_PRECHANGE:
+               set_ctrlr_state(fbi, C_DISABLE_CLKCHANGE);
+               break;
+
+       case CPUFREQ_POSTCHANGE:
+               pcd = get_pcd(fbi->fb.var.pixclock);
+               fbi->reg_lccr3 = (fbi->reg_lccr3 & ~0xff) | LCCR3_PixClkDiv(pcd);
+               set_ctrlr_state(fbi, C_ENABLE_CLKCHANGE);
+               break;
+       }
+       return 0;
+}
+
+static int
+pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data)
+{
+       struct pxafb_info *fbi = TO_INF(nb, freq_policy);
+       struct fb_var_screeninfo *var = &fbi->fb.var;
+       struct cpufreq_policy *policy = data;
+
+       switch (val) {
+       case CPUFREQ_ADJUST:
+       case CPUFREQ_INCOMPATIBLE:
+               printk(KERN_DEBUG "min dma period: %d ps, "
+                       "new clock %d kHz\n", pxafb_display_dma_period(var),
+                       policy->max);
+               // TODO: fill in min/max values
+               break;
+#if 0
+       case CPUFREQ_NOTIFY:
+               printk(KERN_ERR "%s: got CPUFREQ_NOTIFY\n", __FUNCTION__);
+               do {} while(0);
+               /* todo: panic if min/max values aren't fulfilled
+                * [can't really happen unless there's a bug in the
+                * CPU policy verification process *
+                */
+               break;
+#endif
+       }
+       return 0;
+}
+#endif
+
+#ifdef CONFIG_PM
+/*
+ * Power management hooks.  Note that we won't be called from IRQ context,
+ * unlike the blank functions above, so we may sleep.
+ */
+static int pxafb_suspend(struct device *dev, u32 state, u32 level)
+{
+       struct pxafb_info *fbi = dev_get_drvdata(dev);
+
+       if (level == SUSPEND_DISABLE || level == SUSPEND_POWER_DOWN)
+               set_ctrlr_state(fbi, C_DISABLE_PM);
+       return 0;
+}
+
+static int pxafb_resume(struct device *dev, u32 level)
+{
+       struct pxafb_info *fbi = dev_get_drvdata(dev);
+
+       if (level == RESUME_ENABLE)
+               set_ctrlr_state(fbi, C_ENABLE_PM);
+       return 0;
+}
+#else
+#define pxafb_suspend  NULL
+#define pxafb_resume   NULL
+#endif
+
+/*
+ * pxafb_map_video_memory():
+ *      Allocates the DRAM memory for the frame buffer.  This buffer is
+ *     remapped into a non-cached, non-buffered, memory region to
+ *      allow palette and pixel writes to occur without flushing the
+ *      cache.  Once this area is remapped, all virtual memory
+ *      access to the video memory should occur at the new region.
+ */
+static int __init pxafb_map_video_memory(struct pxafb_info *fbi)
+{
+       u_long palette_mem_size;
+
+       /*
+        * We reserve one page for the palette, plus the size
+        * of the framebuffer.
+        */
+       fbi->map_size = PAGE_ALIGN(fbi->fb.fix.smem_len + PAGE_SIZE);
+       fbi->map_cpu = dma_alloc_writecombine(fbi->dev, fbi->map_size,
+                                             &fbi->map_dma, GFP_KERNEL);
+
+       if (fbi->map_cpu) {
+               /* prevent initial garbage on screen */
+               memset(fbi->map_cpu, 0, fbi->map_size);
+               fbi->fb.screen_base = fbi->map_cpu + PAGE_SIZE;
+               fbi->screen_dma = fbi->map_dma + PAGE_SIZE;
+               /*
+                * FIXME: this is actually the wrong thing to place in
+                * smem_start.  But fbdev suffers from the problem that
+                * it needs an API which doesn't exist (in this case,
+                * dma_writecombine_mmap)
+                */
+               fbi->fb.fix.smem_start = fbi->screen_dma;
+
+               fbi->palette_size = fbi->fb.var.bits_per_pixel == 8 ? 256 : 16;
+
+               palette_mem_size = fbi->palette_size * sizeof(u16);
+               DPRINTK("palette_mem_size = 0x%08lx\n", (u_long) palette_mem_size);
+
+               fbi->palette_cpu = (u16 *)(fbi->map_cpu + PAGE_SIZE - palette_mem_size);
+               fbi->palette_dma = fbi->map_dma + PAGE_SIZE - palette_mem_size;
+       }
+
+       return fbi->map_cpu ? 0 : -ENOMEM;
+}
+
+static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev)
+{
+       struct pxafb_info *fbi;
+       void *addr;
+       struct pxafb_mach_info *inf = dev->platform_data;
+
+       /* Alloc the pxafb_info and pseudo_palette in one step */
+       fbi = kmalloc(sizeof(struct pxafb_info) + sizeof(u32) * 17, GFP_KERNEL);
+       if (!fbi)
+               return NULL;
+
+       memset(fbi, 0, sizeof(struct pxafb_info));
+       fbi->dev = dev;
+
+       strcpy(fbi->fb.fix.id, PXA_NAME);
+
+       fbi->fb.fix.type        = FB_TYPE_PACKED_PIXELS;
+       fbi->fb.fix.type_aux    = 0;
+       fbi->fb.fix.xpanstep    = 0;
+       fbi->fb.fix.ypanstep    = 0;
+       fbi->fb.fix.ywrapstep   = 0;
+       fbi->fb.fix.accel       = FB_ACCEL_NONE;
+
+       fbi->fb.var.nonstd      = 0;
+       fbi->fb.var.activate    = FB_ACTIVATE_NOW;
+       fbi->fb.var.height      = -1;
+       fbi->fb.var.width       = -1;
+       fbi->fb.var.accel_flags = 0;
+       fbi->fb.var.vmode       = FB_VMODE_NONINTERLACED;
+
+       fbi->fb.fbops           = &pxafb_ops;
+       fbi->fb.flags           = FBINFO_FLAG_DEFAULT;
+       fbi->fb.node            = -1;
+       fbi->fb.currcon         = -1;
+
+       addr = fbi;
+       addr = addr + sizeof(struct pxafb_info);
+       fbi->fb.pseudo_palette  = addr;
+
+       fbi->max_xres                   = inf->xres;
+       fbi->fb.var.xres                = inf->xres;
+       fbi->fb.var.xres_virtual        = inf->xres;
+       fbi->max_yres                   = inf->yres;
+       fbi->fb.var.yres                = inf->yres;
+       fbi->fb.var.yres_virtual        = inf->yres;
+       fbi->max_bpp                    = inf->bpp;
+       fbi->fb.var.bits_per_pixel      = inf->bpp;
+       fbi->fb.var.pixclock            = inf->pixclock;
+       fbi->fb.var.hsync_len           = inf->hsync_len;
+       fbi->fb.var.left_margin         = inf->left_margin;
+       fbi->fb.var.right_margin        = inf->right_margin;
+       fbi->fb.var.vsync_len           = inf->vsync_len;
+       fbi->fb.var.upper_margin        = inf->upper_margin;
+       fbi->fb.var.lower_margin        = inf->lower_margin;
+       fbi->fb.var.sync                = inf->sync;
+       fbi->fb.var.grayscale           = inf->cmap_greyscale;
+       fbi->cmap_inverse               = inf->cmap_inverse;
+       fbi->cmap_static                = inf->cmap_static;
+       fbi->lccr0                      = inf->lccr0;
+       fbi->lccr3                      = inf->lccr3;
+       fbi->state                      = C_STARTUP;
+       fbi->task_state                 = (u_char)-1;
+       fbi->fb.fix.smem_len            = fbi->max_xres * fbi->max_yres *
+                                         fbi->max_bpp / 8;
+
+       init_waitqueue_head(&fbi->ctrlr_wait);
+       INIT_WORK(&fbi->task, pxafb_task, fbi);
+       init_MUTEX(&fbi->ctrlr_sem);
+
+       return fbi;
+}
+
+#ifdef CONFIG_FB_PXA_PARAMETERS
+static int __init pxafb_parse_options(struct device *dev, char *options)
+{
+       struct pxafb_mach_info *inf = dev->platform_data;
+       char *this_opt;
+
+        if (!options || !*options)
+                return 0;
+
+       dev_dbg(dev, "options are \"%s\"\n", options ? options : "null");
+
+       /* could be made table driven or similar?... */
+        while ((this_opt = strsep(&options, ",")) != NULL) {
+                if (!strncmp(this_opt, "mode:", 5)) {
+                       const char *name = this_opt+5;
+                       unsigned int namelen = strlen(name);
+                       int res_specified = 0, bpp_specified = 0;
+                       unsigned int xres = 0, yres = 0, bpp = 0;
+                       int yres_specified = 0;
+                       int i;
+                       for (i = namelen-1; i >= 0; i--) {
+                               switch (name[i]) {
+                               case '-':
+                                       namelen = i;
+                                       if (!bpp_specified && !yres_specified) {
+                                               bpp = simple_strtoul(&name[i+1], NULL, 0);
+                                               bpp_specified = 1;
+                                       } else
+                                               goto done;
+                                       break;
+                               case 'x':
+                                       if (!yres_specified) {
+                                               yres = simple_strtoul(&name[i+1], NULL, 0);
+                                               yres_specified = 1;
+                                       } else
+                                               goto done;
+                                       break;
+                               case '0'...'9':
+                                       break;
+                               default:
+                                       goto done;
+                               }
+                       }
+                       if (i < 0 && yres_specified) {
+                               xres = simple_strtoul(name, NULL, 0);
+                               res_specified = 1;
+                       }
+               done:
+                       if ( res_specified ) {
+                               dev_info(dev, "overriding resolution: %dx%x\n", xres, yres);
+                               inf->xres = xres; inf->yres = yres;
+                       }
+                       if ( bpp_specified )
+                               switch (bpp) {
+                               case 1:
+                               case 2:
+                               case 4:
+                               case 8:
+                               case 16:
+                                       inf->bpp = bpp;
+                                       dev_info(dev, "overriding bit depth: %d\n", bpp);
+                                       break;
+                               default:
+                                       dev_err(dev, "Depth %d is not valid\n", bpp);
+                               }
+                } else if (!strncmp(this_opt, "pixclock:", 9)) {
+                        inf->pixclock = simple_strtoul(this_opt+9, NULL, 0);
+                       dev_info(dev, "override pixclock: %u\n", inf->pixclock);
+                } else if (!strncmp(this_opt, "left:", 5)) {
+                        inf->left_margin = simple_strtoul(this_opt+5, NULL, 0);
+                       dev_info(dev, "override left: %u\n", inf->left_margin);
+                } else if (!strncmp(this_opt, "right:", 6)) {
+                        inf->right_margin = simple_strtoul(this_opt+6, NULL, 0);
+                       dev_info(dev, "override right: %u\n", inf->right_margin);
+                } else if (!strncmp(this_opt, "upper:", 6)) {
+                        inf->upper_margin = simple_strtoul(this_opt+6, NULL, 0);
+                       dev_info(dev, "override upper: %u\n", inf->upper_margin);
+                } else if (!strncmp(this_opt, "lower:", 6)) {
+                        inf->lower_margin = simple_strtoul(this_opt+6, NULL, 0);
+                       dev_info(dev, "override lower: %u\n", inf->lower_margin);
+                } else if (!strncmp(this_opt, "hsynclen:", 9)) {
+                        inf->hsync_len = simple_strtoul(this_opt+9, NULL, 0);
+                       dev_info(dev, "override hsynclen: %u\n", inf->hsync_len);
+                } else if (!strncmp(this_opt, "vsynclen:", 9)) {
+                        inf->vsync_len = simple_strtoul(this_opt+9, NULL, 0);
+                       dev_info(dev, "override vsynclen: %u\n", inf->vsync_len);
+                } else if (!strncmp(this_opt, "hsync:", 6)) {
+                        if ( simple_strtoul(this_opt+6, NULL, 0) == 0 ) {
+                               dev_info(dev, "override hsync: Active Low\n");
+                               inf->sync &= ~FB_SYNC_HOR_HIGH_ACT;
+                       } else {
+                               dev_info(dev, "override hsync: Active High\n");
+                               inf->sync |= FB_SYNC_HOR_HIGH_ACT;
+                       }
+                } else if (!strncmp(this_opt, "vsync:", 6)) {
+                        if ( simple_strtoul(this_opt+6, NULL, 0) == 0 ) {
+                               dev_info(dev, "override vsync: Active Low\n");
+                               inf->sync &= ~FB_SYNC_VERT_HIGH_ACT;
+                       } else {
+                               dev_info(dev, "override vsync: Active High\n");
+                               inf->sync |= FB_SYNC_VERT_HIGH_ACT;
+                       }
+                } else if (!strncmp(this_opt, "dpc:", 4)) {
+                        if ( simple_strtoul(this_opt+4, NULL, 0) == 0 ) {
+                               dev_info(dev, "override double pixel clock: false\n");
+                               inf->lccr3 &= ~LCCR3_DPC;
+                       } else {
+                               dev_info(dev, "override double pixel clock: true\n");
+                               inf->lccr3 |= LCCR3_DPC;
+                       }
+                } else if (!strncmp(this_opt, "outputen:", 9)) {
+                        if ( simple_strtoul(this_opt+9, NULL, 0) == 0 ) {
+                               dev_info(dev, "override output enable: active low\n");
+                               inf->lccr3 = ( inf->lccr3 & ~LCCR3_OEP ) | LCCR3_OutEnL;
+                       } else {
+                               dev_info(dev, "override output enable: active high\n");
+                               inf->lccr3 = ( inf->lccr3 & ~LCCR3_OEP ) | LCCR3_OutEnH;
+                       }
+                } else if (!strncmp(this_opt, "pixclockpol:", 12)) {
+                        if ( simple_strtoul(this_opt+12, NULL, 0) == 0 ) {
+                               dev_info(dev, "override pixel clock polarity: falling edge\n");
+                               inf->lccr3 = ( inf->lccr3 & ~LCCR3_PCP ) | LCCR3_PixFlEdg;
+                       } else {
+                               dev_info(dev, "override pixel clock polarity: rising edge\n");
+                               inf->lccr3 = ( inf->lccr3 & ~LCCR3_PCP ) | LCCR3_PixRsEdg;
+                       }
+                } else if (!strncmp(this_opt, "color", 5)) {
+                       inf->lccr0 = (inf->lccr0 & ~LCCR0_CMS) | LCCR0_Color;
+                } else if (!strncmp(this_opt, "mono", 4)) {
+                       inf->lccr0 = (inf->lccr0 & ~LCCR0_CMS) | LCCR0_Mono;
+                } else if (!strncmp(this_opt, "active", 6)) {
+                       inf->lccr0 = (inf->lccr0 & ~LCCR0_PAS) | LCCR0_Act;
+                } else if (!strncmp(this_opt, "passive", 7)) {
+                       inf->lccr0 = (inf->lccr0 & ~LCCR0_PAS) | LCCR0_Pas;
+                } else if (!strncmp(this_opt, "single", 6)) {
+                       inf->lccr0 = (inf->lccr0 & ~LCCR0_SDS) | LCCR0_Sngl;
+                } else if (!strncmp(this_opt, "dual", 4)) {
+                       inf->lccr0 = (inf->lccr0 & ~LCCR0_SDS) | LCCR0_Dual;
+                } else if (!strncmp(this_opt, "4pix", 4)) {
+                       inf->lccr0 = (inf->lccr0 & ~LCCR0_DPD) | LCCR0_4PixMono;
+                } else if (!strncmp(this_opt, "8pix", 4)) {
+                       inf->lccr0 = (inf->lccr0 & ~LCCR0_DPD) | LCCR0_8PixMono;
+               } else {
+                       dev_err(dev, "unknown option: %s\n", this_opt);
+                       return -EINVAL;
+               }
+        }
+        return 0;
+
+}
+#endif
+
+int __init pxafb_probe(struct device *dev)
+{
+       struct pxafb_info *fbi;
+       struct pxafb_mach_info *inf;
+       unsigned long flags;
+       int ret;
+
+       dev_dbg(dev, "pxafb_probe\n");
+
+       inf = dev->platform_data;
+       ret = -ENOMEM;
+       fbi = NULL;
+       if (!inf)
+               goto failed;
+
+#ifdef CONFIG_FB_PXA_PARAMETERS
+       ret = pxafb_parse_options(dev, g_options);
+       if ( ret < 0 )
+               goto failed;
+#endif
+
+#ifdef DEBUG_VAR
+        /* Check for various illegal bit-combinations. Currently only
+        * a warning is given. */
+
+        if ( inf->lccr0 & LCCR0_INVALID_CONFIG_MASK )
+                dev_warn(dev, "machine LCCR0 setting contains illegal bits: %08x\n",
+                        inf->lccr0 & LCCR0_INVALID_CONFIG_MASK);
+        if ( inf->lccr3 & LCCR3_INVALID_CONFIG_MASK )
+                dev_warn(dev, "machine LCCR3 setting contains illegal bits: %08x\n",
+                        inf->lccr3 & LCCR3_INVALID_CONFIG_MASK);
+        if ( inf->lccr0 & LCCR0_DPD &&
+             ( ( inf->lccr0 & LCCR0_PAS ) != LCCR0_Pas ||
+               ( inf->lccr0 & LCCR0_SDS ) != LCCR0_Sngl ||
+               ( inf->lccr0 & LCCR0_CMS ) != LCCR0_Mono ) )
+                dev_warn(dev, "Double Pixel Data (DPD) mode is only valid in passive mono"
+                        " single panel mode\n");
+        if ( (inf->lccr0 & LCCR0_PAS) == LCCR0_Act &&
+             ( inf->lccr0 & LCCR0_SDS ) == LCCR0_Dual )
+                dev_warn(dev, "Dual panel only valid in passive mode\n");
+        if ( (inf->lccr0 & LCCR0_PAS ) == LCCR0_Pas &&
+             (inf->upper_margin || inf->lower_margin) )
+                dev_warn(dev, "Upper and lower margins must be 0 in passive mode\n");
+#endif
+
+       dev_dbg(dev, "got a %dx%dx%d LCD\n",inf->xres, inf->yres, inf->bpp);
+       if (inf->xres == 0 || inf->yres == 0 || inf->bpp == 0) {
+               dev_err(dev, "Invalid resolution or bit depth\n");
+               ret = -EINVAL;
+               goto failed;
+       }
+       pxafb_backlight_power = inf->pxafb_backlight_power;
+       pxafb_lcd_power = inf->pxafb_lcd_power;
+       fbi = pxafb_init_fbinfo(dev);
+       if (!fbi) {
+               dev_err(dev, "Failed to initialize framebuffer device\n");
+               ret = -ENOMEM; // only reason for pxafb_init_fbinfo to fail is kmalloc
+               goto failed;
+       }
+
+       /* Initialize video memory */
+       ret = pxafb_map_video_memory(fbi);
+       if (ret) {
+               dev_err(dev, "Failed to allocate video RAM: %d\n", ret);
+               ret = -ENOMEM;
+               goto failed;
+       }
+       /* enable LCD controller clock */
+       local_irq_save(flags);
+       CKEN |= CKEN16_LCD;
+       local_irq_restore(flags);
+
+       ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi);
+       if (ret) {
+               dev_err(dev, "request_irq failed: %d\n", ret);
+               ret = -EBUSY;
+               goto failed;
+       }
+
+       /*
+        * This makes sure that our colour bitfield
+        * descriptors are correctly initialised.
+        */
+       pxafb_check_var(&fbi->fb.var, &fbi->fb);
+       pxafb_set_par(&fbi->fb);
+
+       dev_set_drvdata(dev, fbi);
+
+       ret = register_framebuffer(&fbi->fb);
+       if (ret < 0) {
+               dev_err(dev, "Failed to register framebuffer device: %d\n", ret);
+               goto failed;
+       }
+
+#ifdef CONFIG_PM
+       // TODO
+#endif
+
+#ifdef CONFIG_CPU_FREQ
+       fbi->freq_transition.notifier_call = pxafb_freq_transition;
+       fbi->freq_policy.notifier_call = pxafb_freq_policy;
+       cpufreq_register_notifier(&fbi->freq_transition, CPUFREQ_TRANSITION_NOTIFIER);
+       cpufreq_register_notifier(&fbi->freq_policy, CPUFREQ_POLICY_NOTIFIER);
+#endif
+
+       /*
+        * Ok, now enable the LCD controller
+        */
+       set_ctrlr_state(fbi, C_ENABLE);
+
+       return 0;
+
+failed:
+       dev_set_drvdata(dev, NULL);
+       if (fbi)
+               kfree(fbi);
+       return ret;
+}
+
+static struct device_driver pxafb_driver = {
+       .name           = "pxafb",
+       .bus            = &platform_bus_type,
+       .probe          = pxafb_probe,
+#ifdef CONFIG_PM
+       .suspend        = pxafb_suspend,
+       .resume         = pxafb_resume,
+#endif
+};
+
+int __devinit pxafb_init(void)
+{
+       return driver_register(&pxafb_driver);
+}
+
+#ifndef MODULE
+int __devinit pxafb_setup(char *options)
+{
+# ifdef CONFIG_FB_PXA_PARAMETERS
+       strlcpy(g_options, options, sizeof(g_options));
+# endif
+       return 0;
+}
+#else
+module_init(pxafb_init);
+# ifdef CONFIG_FB_PXA_PARAMETERS
+module_param_string(options, g_options, sizeof(g_options), 0);
+MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)");
+# endif
+#endif
+
+MODULE_DESCRIPTION("loadable framebuffer driver for PXA");
+MODULE_LICENSE("GPL");
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c
new file mode 100644 (file)
index 0000000..d1fe21d
--- /dev/null
@@ -0,0 +1,956 @@
+/*
+ *  linux/fs/ext3/resize.c
+ *
+ * Support for resizing an ext3 filesystem while it is mounted.
+ *
+ * Copyright (C) 2001, 2002 Andreas Dilger <adilger@clusterfs.com>
+ *
+ * This could probably be made into a module, because it is not often in use.
+ */
+
+#include <linux/config.h>
+
+#define EXT3FS_DEBUG
+
+#include <linux/sched.h>
+#include <linux/smp_lock.h>
+#include <linux/ext3_jbd.h>
+
+#include <linux/errno.h>
+#include <linux/slab.h>
+
+
+#define outside(b, first, last)        ((b) < (first) || (b) >= (last))
+#define inside(b, first, last) ((b) >= (first) && (b) < (last))
+
+static int verify_group_input(struct super_block *sb,
+                             struct ext3_new_group_data *input)
+{
+       struct ext3_sb_info *sbi = EXT3_SB(sb);
+       struct ext3_super_block *es = sbi->s_es;
+       unsigned start = le32_to_cpu(es->s_blocks_count);
+       unsigned end = start + input->blocks_count;
+       unsigned group = input->group;
+       unsigned itend = input->inode_table + EXT3_SB(sb)->s_itb_per_group;
+       unsigned overhead = ext3_bg_has_super(sb, group) ?
+               (1 + ext3_bg_num_gdb(sb, group) +
+                le16_to_cpu(es->s_reserved_gdt_blocks)) : 0;
+       unsigned metaend = start + overhead;
+       struct buffer_head *bh;
+       int free_blocks_count;
+       int err = -EINVAL;
+
+       input->free_blocks_count = free_blocks_count =
+               input->blocks_count - 2 - overhead - sbi->s_itb_per_group;
+
+       if (test_opt(sb, DEBUG))
+               printk("EXT3-fs: adding %s group %u: %u blocks "
+                      "(%d free, %u reserved)\n",
+                      ext3_bg_has_super(sb, input->group) ? "normal" :
+                      "no-super", input->group, input->blocks_count,
+                      free_blocks_count, input->reserved_blocks);
+
+       if (group != sbi->s_groups_count)
+               ext3_warning(sb, __FUNCTION__,
+                            "Cannot add at group %u (only %lu groups)",
+                            input->group, sbi->s_groups_count);
+       else if ((start - le32_to_cpu(es->s_first_data_block)) %
+                EXT3_BLOCKS_PER_GROUP(sb))
+               ext3_warning(sb, __FUNCTION__, "Last group not full");
+       else if (input->reserved_blocks > input->blocks_count / 5)
+               ext3_warning(sb, __FUNCTION__, "Reserved blocks too high (%u)",
+                            input->reserved_blocks);
+       else if (free_blocks_count < 0)
+               ext3_warning(sb, __FUNCTION__, "Bad blocks count %u",
+                            input->blocks_count);
+       else if (!(bh = sb_bread(sb, end - 1)))
+               ext3_warning(sb, __FUNCTION__, "Cannot read last block (%u)",
+                            end - 1);
+       else if (outside(input->block_bitmap, start, end))
+               ext3_warning(sb, __FUNCTION__,
+                            "Block bitmap not in group (block %u)",
+                            input->block_bitmap);
+       else if (outside(input->inode_bitmap, start, end))
+               ext3_warning(sb, __FUNCTION__,
+                            "Inode bitmap not in group (block %u)",
+                            input->inode_bitmap);
+       else if (outside(input->inode_table, start, end) ||
+                outside(itend - 1, start, end))
+               ext3_warning(sb, __FUNCTION__,
+                            "Inode table not in group (blocks %u-%u)",
+                            input->inode_table, itend - 1);
+       else if (input->inode_bitmap == input->block_bitmap)
+               ext3_warning(sb, __FUNCTION__,
+                            "Block bitmap same as inode bitmap (%u)",
+                            input->block_bitmap);
+       else if (inside(input->block_bitmap, input->inode_table, itend))
+               ext3_warning(sb, __FUNCTION__,
+                            "Block bitmap (%u) in inode table (%u-%u)",
+                            input->block_bitmap, input->inode_table, itend-1);
+       else if (inside(input->inode_bitmap, input->inode_table, itend))
+               ext3_warning(sb, __FUNCTION__,
+                            "Inode bitmap (%u) in inode table (%u-%u)",
+                            input->inode_bitmap, input->inode_table, itend-1);
+       else if (inside(input->block_bitmap, start, metaend))
+               ext3_warning(sb, __FUNCTION__,
+                            "Block bitmap (%u) in GDT table (%u-%u)",
+                            input->block_bitmap, start, metaend - 1);
+       else if (inside(input->inode_bitmap, start, metaend))
+               ext3_warning(sb, __FUNCTION__,
+                            "Inode bitmap (%u) in GDT table (%u-%u)",
+                            input->inode_bitmap, start, metaend - 1);
+       else if (inside(input->inode_table, start, metaend) ||
+                inside(itend - 1, start, metaend))
+               ext3_warning(sb, __FUNCTION__,
+                            "Inode table (%u-%u) overlaps GDT table (%u-%u)",
+                            input->inode_table, itend - 1, start, metaend - 1);
+       else {
+               brelse(bh);
+               err = 0;
+       }
+
+       return err;
+}
+
+static struct buffer_head *bclean(handle_t *handle, struct super_block *sb,
+                                 unsigned long blk)
+{
+       struct buffer_head *bh;
+       int err;
+
+       bh = sb_getblk(sb, blk);
+       set_buffer_uptodate(bh);
+       if ((err = ext3_journal_get_write_access(handle, bh))) {
+               brelse(bh);
+               bh = ERR_PTR(err);
+       } else
+               memset(bh->b_data, 0, sb->s_blocksize);
+
+       return bh;
+}
+
+/*
+ * To avoid calling the atomic setbit hundreds or thousands of times, we only
+ * need to use it within a single byte (to ensure we get endianness right).
+ * We can use memset for the rest of the bitmap as there are no other users.
+ */
+static void mark_bitmap_end(int start_bit, int end_bit, char *bitmap)
+{
+       int i;
+
+       if (start_bit >= end_bit)
+               return;
+
+       ext3_debug("mark end bits +%d through +%d used\n", start_bit, end_bit);
+       for (i = start_bit; i < ((start_bit + 7) & ~7UL); i++)
+               ext3_set_bit(i, bitmap);
+       if (i < end_bit)
+               memset(bitmap + (i >> 3), 0xff, (end_bit - i) >> 3);
+}
+
+/*
+ * Set up the block and inode bitmaps, and the inode table for the new group.
+ * This doesn't need to be part of the main transaction, since we are only
+ * changing blocks outside the actual filesystem.  We still do journaling to
+ * ensure the recovery is correct in case of a failure just after resize.
+ * If any part of this fails, we simply abort the resize.
+ *
+ * We only pass inode because of the ext3 journal wrappers.
+ */
+static int setup_new_group_blocks(struct super_block *sb, struct inode *inode,
+                                 struct ext3_new_group_data *input)
+{
+       struct ext3_sb_info *sbi = EXT3_SB(sb);
+       unsigned long start = input->group * sbi->s_blocks_per_group +
+               le32_to_cpu(sbi->s_es->s_first_data_block);
+       int reserved_gdb = ext3_bg_has_super(sb, input->group) ?
+               le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) : 0;
+       unsigned long gdblocks = ext3_bg_num_gdb(sb, input->group);
+       struct buffer_head *bh;
+       handle_t *handle;
+       unsigned long block;
+       int bit;
+       int i;
+       int err = 0, err2;
+
+       handle = ext3_journal_start(inode, reserved_gdb + gdblocks +
+                                   2 + sbi->s_itb_per_group);
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+
+       lock_super(sb);
+       if (input->group != sbi->s_groups_count) {
+               err = -EBUSY;
+               goto exit_journal;
+       }
+
+       if (IS_ERR(bh = bclean(handle, sb, input->block_bitmap))) {
+               err = PTR_ERR(bh);
+               goto exit_journal;
+       }
+
+       if (ext3_bg_has_super(sb, input->group)) {
+               ext3_debug("mark backup superblock %#04lx (+0)\n", start);
+               ext3_set_bit(0, bh->b_data);
+       }
+
+       /* Copy all of the GDT blocks into the backup in this group */
+       for (i = 0, bit = 1, block = start + 1;
+            i < gdblocks; i++, block++, bit++) {
+               struct buffer_head *gdb;
+
+               ext3_debug("update backup group %#04lx (+%d)\n", block, bit);
+
+               gdb = sb_getblk(sb, block);
+               set_buffer_uptodate(gdb);
+               if ((err = ext3_journal_get_write_access(handle, gdb))) {
+                       brelse(gdb);
+                       goto exit_bh;
+               }
+               memcpy(gdb->b_data, sbi->s_group_desc[i], bh->b_size);
+               ext3_journal_dirty_metadata(handle, gdb);
+               ext3_set_bit(bit, bh->b_data);
+               brelse(gdb);
+       }
+
+       /* Zero out all of the reserved backup group descriptor table blocks */
+       for (i = 0, bit = gdblocks + 1, block = start + bit;
+            i < reserved_gdb; i++, block++, bit++) {
+               struct buffer_head *gdb;
+
+               ext3_debug("clear reserved block %#04lx (+%d)\n", block, bit);
+
+               if (IS_ERR(gdb = bclean(handle, sb, block))) {
+                       err = PTR_ERR(bh);
+                       goto exit_bh;
+               }
+               ext3_journal_dirty_metadata(handle, gdb);
+               ext3_set_bit(bit, bh->b_data);
+               brelse(gdb);
+       }
+       ext3_debug("mark block bitmap %#04x (+%ld)\n", input->block_bitmap,
+                  input->block_bitmap - start);
+       ext3_set_bit(input->block_bitmap - start, bh->b_data);
+       ext3_debug("mark inode bitmap %#04x (+%ld)\n", input->inode_bitmap,
+                  input->inode_bitmap - start);
+       ext3_set_bit(input->inode_bitmap - start, bh->b_data);
+
+       /* Zero out all of the inode table blocks */
+       for (i = 0, block = input->inode_table, bit = block - start;
+            i < sbi->s_itb_per_group; i++, bit++, block++) {
+               struct buffer_head *it;
+
+               ext3_debug("clear inode block %#04x (+%ld)\n", block, bit);
+               if (IS_ERR(it = bclean(handle, sb, block))) {
+                       err = PTR_ERR(it);
+                       goto exit_bh;
+               }
+               ext3_journal_dirty_metadata(handle, it);
+               brelse(it);
+               ext3_set_bit(bit, bh->b_data);
+       }
+       mark_bitmap_end(input->blocks_count, EXT3_BLOCKS_PER_GROUP(sb),
+                       bh->b_data);
+       ext3_journal_dirty_metadata(handle, bh);
+       brelse(bh);
+
+       /* Mark unused entries in inode bitmap used */
+       ext3_debug("clear inode bitmap %#04x (+%ld)\n",
+                  input->inode_bitmap, input->inode_bitmap - start);
+       if (IS_ERR(bh = bclean(handle, sb, input->inode_bitmap))) {
+               err = PTR_ERR(bh);
+               goto exit_journal;
+       }
+
+       mark_bitmap_end(EXT3_INODES_PER_GROUP(sb), EXT3_BLOCKS_PER_GROUP(sb),
+                       bh->b_data);
+       ext3_journal_dirty_metadata(handle, bh);
+exit_bh:
+       brelse(bh);
+
+exit_journal:
+       unlock_super(sb);
+       if ((err2 = ext3_journal_stop(handle)) && !err)
+               err = err2;
+
+       return err;
+}
+
+/*
+ * Iterate through the groups which hold BACKUP superblock/GDT copies in an
+ * ext3 filesystem.  The counters should be initialized to 1, 5, and 7 before
+ * calling this for the first time.  In a sparse filesystem it will be the
+ * sequence of powers of 3, 5, and 7: 1, 3, 5, 7, 9, 25, 27, 49, 81, ...
+ * For a non-sparse filesystem it will be every group: 1, 2, 3, 4, ...
+ */
+unsigned ext3_list_backups(struct super_block *sb, unsigned *three,
+                          unsigned *five, unsigned *seven)
+{
+       unsigned *min = three;
+       int mult = 3;
+       unsigned ret;
+
+       if (!EXT3_HAS_RO_COMPAT_FEATURE(sb,
+                                       EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER)) {
+               ret = *min;
+               *min += 1;
+               return ret;
+       }
+
+       if (*five < *min) {
+               min = five;
+               mult = 5;
+       }
+       if (*seven < *min) {
+               min = seven;
+               mult = 7;
+       }
+
+       ret = *min;
+       *min *= mult;
+
+       return ret;
+}
+
+/*
+ * Check that all of the backup GDT blocks are held in the primary GDT block.
+ * It is assumed that they are stored in group order.  Returns the number of
+ * groups in current filesystem that have BACKUPS, or -ve error code.
+ */
+static int verify_reserved_gdb(struct super_block *sb,
+                              struct buffer_head *primary)
+{
+       const unsigned long blk = primary->b_blocknr;
+       const unsigned long end = EXT3_SB(sb)->s_groups_count;
+       unsigned three = 1;
+       unsigned five = 5;
+       unsigned seven = 7;
+       unsigned grp;
+       __u32 *p = (__u32 *)primary->b_data;
+       int gdbackups = 0;
+
+       while ((grp = ext3_list_backups(sb, &three, &five, &seven)) < end) {
+               if (le32_to_cpu(*p++) != grp * EXT3_BLOCKS_PER_GROUP(sb) + blk){
+                       ext3_warning(sb, __FUNCTION__,
+                                    "reserved GDT %ld missing grp %d (%ld)\n",
+                                    blk, grp,
+                                    grp * EXT3_BLOCKS_PER_GROUP(sb) + blk);
+                       return -EINVAL;
+               }
+               if (++gdbackups > EXT3_ADDR_PER_BLOCK(sb))
+                       return -EFBIG;
+       }
+
+       return gdbackups;
+}
+
+/*
+ * Called when we need to bring a reserved group descriptor table block into
+ * use from the resize inode.  The primary copy of the new GDT block currently
+ * is an indirect block (under the double indirect block in the resize inode).
+ * The new backup GDT blocks will be stored as leaf blocks in this indirect
+ * block, in group order.  Even though we know all the block numbers we need,
+ * we check to ensure that the resize inode has actually reserved these blocks.
+ *
+ * Don't need to update the block bitmaps because the blocks are still in use.
+ *
+ * We get all of the error cases out of the way, so that we are sure to not
+ * fail once we start modifying the data on disk, because JBD has no rollback.
+ */
+static int add_new_gdb(handle_t *handle, struct inode *inode,
+                      struct ext3_new_group_data *input,
+                      struct buffer_head **primary)
+{
+       struct super_block *sb = inode->i_sb;
+       struct ext3_super_block *es = EXT3_SB(sb)->s_es;
+       unsigned long gdb_num = input->group / EXT3_DESC_PER_BLOCK(sb);
+       unsigned long gdb_off = input->group % EXT3_DESC_PER_BLOCK(sb);
+       unsigned long gdblock = EXT3_SB(sb)->s_sbh->b_blocknr + 1 + gdb_num;
+       struct buffer_head **o_group_desc, **n_group_desc;
+       struct buffer_head *dind;
+       int gdbackups;
+       struct ext3_iloc iloc;
+       __u32 *data;
+       int err;
+
+       if (test_opt(sb, DEBUG))
+               printk("EXT3-fs: ext3_add_new_gdb: adding group block %lu\n",
+                      gdb_num);
+
+       /*
+        * If we are not using the primary superblock/GDT copy don't resize,
+        * because the user tools have no way of handling this.  Probably a
+        * bad time to do it anyways.
+        */
+       if (EXT3_SB(sb)->s_sbh->b_blocknr !=
+           le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block)) {
+               ext3_warning(sb, __FUNCTION__,
+                            "won't resize using backup superblock at %lu\n",
+                            EXT3_SB(sb)->s_sbh->b_blocknr);
+               return -EPERM;
+       }
+
+       *primary = sb_bread(sb, gdblock);
+       if (!*primary)
+               return -EIO;
+
+       if ((gdbackups = verify_reserved_gdb(sb, *primary)) < 0) {
+               err = gdbackups;
+               goto exit_bh;
+       }
+
+       data = EXT3_I(inode)->i_data + EXT3_DIND_BLOCK;
+       dind = sb_bread(sb, le32_to_cpu(*data));
+       if (!dind) {
+               err = -EIO;
+               goto exit_bh;
+       }
+
+       data = (__u32 *)dind->b_data;
+       if (le32_to_cpu(data[gdb_num % EXT3_ADDR_PER_BLOCK(sb)]) != gdblock) {
+               ext3_warning(sb, __FUNCTION__,
+                            "new group %u GDT block %lu not reserved\n",
+                            input->group, gdblock);
+               err = -EINVAL;
+               goto exit_dind;
+       }
+
+       if ((err = ext3_journal_get_write_access(handle, EXT3_SB(sb)->s_sbh)))
+               goto exit_dind;
+
+       if ((err = ext3_journal_get_write_access(handle, *primary)))
+               goto exit_sbh;
+
+       if ((err = ext3_journal_get_write_access(handle, dind)))
+               goto exit_primary;
+
+       /* ext3_reserve_inode_write() gets a reference on the iloc */
+       if ((err = ext3_reserve_inode_write(handle, inode, &iloc)))
+               goto exit_dindj;
+
+       n_group_desc = (struct buffer_head **)kmalloc((gdb_num + 1) *
+                               sizeof(struct buffer_head *), GFP_KERNEL);
+       if (!n_group_desc) {
+               err = -ENOMEM;
+               ext3_warning (sb, __FUNCTION__,
+                             "not enough memory for %lu groups", gdb_num + 1);
+               goto exit_inode;
+       }
+
+       /*
+        * Finally, we have all of the possible failures behind us...
+        *
+        * Remove new GDT block from inode double-indirect block and clear out
+        * the new GDT block for use (which also "frees" the backup GDT blocks
+        * from the reserved inode).  We don't need to change the bitmaps for
+        * these blocks, because they are marked as in-use from being in the
+        * reserved inode, and will become GDT blocks (primary and backup).
+        */
+       /*
+       printk("removing block %d = %ld from dindir %ld[%ld]\n",
+              ((__u32 *)(dind->b_data))[gdb_off], gdblock, dind->b_blocknr,
+              gdb_num); */
+       data[gdb_num % EXT3_ADDR_PER_BLOCK(sb)] = 0;
+       ext3_journal_dirty_metadata(handle, dind);
+       brelse(dind);
+       inode->i_blocks -= (gdbackups + 1) * sb->s_blocksize >> 9;
+       ext3_mark_iloc_dirty(handle, inode, &iloc);
+       memset((*primary)->b_data, 0, sb->s_blocksize);
+       ext3_journal_dirty_metadata(handle, *primary);
+
+       o_group_desc = EXT3_SB(sb)->s_group_desc;
+       memcpy(n_group_desc, o_group_desc,
+              EXT3_SB(sb)->s_gdb_count * sizeof(struct buffer_head *));
+       n_group_desc[gdb_num] = *primary;
+       EXT3_SB(sb)->s_group_desc = n_group_desc;
+       EXT3_SB(sb)->s_gdb_count++;
+       kfree(o_group_desc);
+
+       es->s_reserved_gdt_blocks =
+               cpu_to_le16(le16_to_cpu(es->s_reserved_gdt_blocks) - 1);
+       ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh);
+
+       return 0;
+
+exit_inode:
+       //ext3_journal_release_buffer(handle, iloc.bh);
+       brelse(iloc.bh);
+exit_dindj:
+       //ext3_journal_release_buffer(handle, dind);
+exit_primary:
+       //ext3_journal_release_buffer(handle, *primary);
+exit_sbh:
+       //ext3_journal_release_buffer(handle, *primary);
+exit_dind:
+       brelse(dind);
+exit_bh:
+       brelse(*primary);
+
+       ext3_debug("leaving with error %d\n", err);
+       return err;
+}
+
+/*
+ * Called when we are adding a new group which has a backup copy of each of
+ * the GDT blocks (i.e. sparse group) and there are reserved GDT blocks.
+ * We need to add these reserved backup GDT blocks to the resize inode, so
+ * that they are kept for future resizing and not allocated to files.
+ *
+ * Each reserved backup GDT block will go into a different indirect block.
+ * The indirect blocks are actually the primary reserved GDT blocks,
+ * so we know in advance what their block numbers are.  We only get the
+ * double-indirect block to verify it is pointing to the primary reserved
+ * GDT blocks so we don't overwrite a data block by accident.  The reserved
+ * backup GDT blocks are stored in their reserved primary GDT block.
+ */
+static int reserve_backup_gdb(handle_t *handle, struct inode *inode,
+                             struct ext3_new_group_data *input)
+{
+       struct super_block *sb = inode->i_sb;
+       int reserved_gdb =le16_to_cpu(EXT3_SB(sb)->s_es->s_reserved_gdt_blocks);
+       struct buffer_head **primary;
+       struct buffer_head *dind;
+       struct ext3_iloc iloc;
+       unsigned long blk;
+       __u32 *data, *end;
+       int gdbackups = 0;
+       int res, i;
+       int err;
+
+       primary = kmalloc(reserved_gdb * sizeof(*primary), GFP_KERNEL);
+       if (!primary)
+               return -ENOMEM;
+
+       data = EXT3_I(inode)->i_data + EXT3_DIND_BLOCK;
+       dind = sb_bread(sb, le32_to_cpu(*data));
+       if (!dind) {
+               err = -EIO;
+               goto exit_free;
+       }
+
+       blk = EXT3_SB(sb)->s_sbh->b_blocknr + 1 + EXT3_SB(sb)->s_gdb_count;
+       data = (__u32 *)dind->b_data + EXT3_SB(sb)->s_gdb_count;
+       end = (__u32 *)dind->b_data + EXT3_ADDR_PER_BLOCK(sb);
+
+       /* Get each reserved primary GDT block and verify it holds backups */
+       for (res = 0; res < reserved_gdb; res++, blk++) {
+               if (le32_to_cpu(*data) != blk) {
+                       ext3_warning(sb, __FUNCTION__,
+                                    "reserved block %lu not at offset %ld\n",
+                                    blk, (long)(data - (__u32 *)dind->b_data));
+                       err = -EINVAL;
+                       goto exit_bh;
+               }
+               primary[res] = sb_bread(sb, blk);
+               if (!primary[res]) {
+                       err = -EIO;
+                       goto exit_bh;
+               }
+               if ((gdbackups = verify_reserved_gdb(sb, primary[res])) < 0) {
+                       brelse(primary[res]);
+                       err = gdbackups;
+                       goto exit_bh;
+               }
+               if (++data >= end)
+                       data = (__u32 *)dind->b_data;
+       }
+
+       for (i = 0; i < reserved_gdb; i++) {
+               if ((err = ext3_journal_get_write_access(handle, primary[i]))) {
+                       /*
+                       int j;
+                       for (j = 0; j < i; j++)
+                               ext3_journal_release_buffer(handle, primary[j]);
+                        */
+                       goto exit_bh;
+               }
+       }
+
+       if ((err = ext3_reserve_inode_write(handle, inode, &iloc)))
+               goto exit_bh;
+
+       /*
+        * Finally we can add each of the reserved backup GDT blocks from
+        * the new group to its reserved primary GDT block.
+        */
+       blk = input->group * EXT3_BLOCKS_PER_GROUP(sb);
+       for (i = 0; i < reserved_gdb; i++) {
+               int err2;
+               data = (__u32 *)primary[i]->b_data;
+               /* printk("reserving backup %lu[%u] = %lu\n",
+                      primary[i]->b_blocknr, gdbackups,
+                      blk + primary[i]->b_blocknr); */
+               data[gdbackups] = cpu_to_le32(blk + primary[i]->b_blocknr);
+               err2 = ext3_journal_dirty_metadata(handle, primary[i]);
+               if (!err)
+                       err = err2;
+       }
+       inode->i_blocks += reserved_gdb * sb->s_blocksize >> 9;
+       ext3_mark_iloc_dirty(handle, inode, &iloc);
+
+exit_bh:
+       while (--res >= 0)
+               brelse(primary[res]);
+       brelse(dind);
+
+exit_free:
+       kfree(primary);
+
+       return err;
+}
+
+/*
+ * Update the backup copies of the ext3 metadata.  These don't need to be part
+ * of the main resize transaction, because e2fsck will re-write them if there
+ * is a problem (basically only OOM will cause a problem).  However, we
+ * _should_ update the backups if possible, in case the primary gets trashed
+ * for some reason and we need to run e2fsck from a backup superblock.  The
+ * important part is that the new block and inode counts are in the backup
+ * superblocks, and the location of the new group metadata in the GDT backups.
+ *
+ * We do not need lock_super() for this, because these blocks are not
+ * otherwise touched by the filesystem code when it is mounted.  We don't
+ * need to worry about last changing from sbi->s_groups_count, because the
+ * worst that can happen is that we do not copy the full number of backups
+ * at this time.  The resize which changed s_groups_count will backup again.
+ *
+ * We only pass inode because of the ext3 journal wrappers.
+ */
+static void update_backups(struct super_block *sb, struct inode *inode,
+                          int blk_off, char *data, int size)
+{
+       struct ext3_sb_info *sbi = EXT3_SB(sb);
+       const unsigned long last = sbi->s_groups_count;
+       const int bpg = EXT3_BLOCKS_PER_GROUP(sb);
+       unsigned three = 1;
+       unsigned five = 5;
+       unsigned seven = 7;
+       unsigned group;
+       int rest = sb->s_blocksize - size;
+       handle_t *handle;
+       int err = 0, err2;
+
+       handle = ext3_journal_start(inode, EXT3_MAX_TRANS_DATA);
+       if (IS_ERR(handle)) {
+               group = 1;
+               err = PTR_ERR(handle);
+               goto exit_err;
+       }
+
+       while ((group = ext3_list_backups(sb, &three, &five, &seven)) < last) {
+               struct buffer_head *bh;
+
+               /* Out of journal space, and can't get more - abort - so sad */
+               if (handle->h_buffer_credits == 0 &&
+                   ext3_journal_extend(handle, EXT3_MAX_TRANS_DATA) &&
+                   (err = ext3_journal_restart(handle, EXT3_MAX_TRANS_DATA)))
+                       break;
+
+               bh = sb_getblk(sb, group * bpg + blk_off);
+               set_buffer_uptodate(bh);
+               ext3_debug(sb, __FUNCTION__, "update metadata backup %#04lx\n",
+                          bh->b_blocknr);
+               if ((err = ext3_journal_get_write_access(handle, bh)))
+                       break;
+               memcpy(bh->b_data, data, size);
+               if (rest)
+                       memset(bh->b_data + size, 0, rest);
+               ext3_journal_dirty_metadata(handle, bh);
+               brelse(bh);
+       }
+       if ((err2 = ext3_journal_stop(handle)) && !err)
+               err = err2;
+
+       /*
+        * Ugh! Need to have e2fsck write the backup copies.  It is too
+        * late to revert the resize, we shouldn't fail just because of
+        * the backup copies (they are only needed in case of corruption).
+        *
+        * However, if we got here we have a journal problem too, so we
+        * can't really start a transaction to mark the superblock.
+        * Chicken out and just set the flag on the hope it will be written
+        * to disk, and if not - we will simply wait until next fsck.
+        */
+exit_err:
+       if (err) {
+               ext3_warning(sb, __FUNCTION__,
+                            "can't update backup for group %d (err %d), "
+                            "forcing fsck on next reboot\n", group, err);
+               sbi->s_mount_state &= ~EXT3_VALID_FS;
+               sbi->s_es->s_state &= ~cpu_to_le16(EXT3_VALID_FS);
+               mark_buffer_dirty(sbi->s_sbh);
+       }
+}
+
+/* Add group descriptor data to an existing or new group descriptor block.
+ * Ensure we handle all possible error conditions _before_ we start modifying
+ * the filesystem, because we cannot abort the transaction and not have it
+ * write the data to disk.
+ *
+ * If we are on a GDT block boundary, we need to get the reserved GDT block.
+ * Otherwise, we may need to add backup GDT blocks for a sparse group.
+ *
+ * We only need to hold the superblock lock while we are actually adding
+ * in the new group's counts to the superblock.  Prior to that we have
+ * not really "added" the group at all.  We re-check that we are still
+ * adding in the last group in case things have changed since verifying.
+ */
+int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
+{
+       struct ext3_sb_info *sbi = EXT3_SB(sb);
+       struct ext3_super_block *es = sbi->s_es;
+       int reserved_gdb = ext3_bg_has_super(sb, input->group) ?
+               le16_to_cpu(es->s_reserved_gdt_blocks) : 0;
+       struct buffer_head *primary = NULL;
+       struct ext3_group_desc *gdp;
+       struct inode *inode = NULL;
+       struct inode bogus;
+       handle_t *handle;
+       int gdb_off, gdb_num;
+       int err, err2;
+
+       gdb_num = input->group / EXT3_DESC_PER_BLOCK(sb);
+       gdb_off = input->group % EXT3_DESC_PER_BLOCK(sb);
+
+       if (gdb_off == 0 && !EXT3_HAS_RO_COMPAT_FEATURE(sb,
+                                       EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER)) {
+               ext3_warning(sb, __FUNCTION__,
+                            "Can't resize non-sparse filesystem further\n");
+               return -EPERM;
+       }
+
+       if (reserved_gdb || gdb_off == 0) {
+               if (!EXT3_HAS_COMPAT_FEATURE(sb,
+                                            EXT3_FEATURE_COMPAT_RESIZE_INODE)){
+                       ext3_warning(sb, __FUNCTION__,
+                                    "No reserved GDT blocks, can't resize\n");
+                       return -EPERM;
+               }
+               inode = iget(sb, EXT3_RESIZE_INO);
+               if (!inode || is_bad_inode(inode)) {
+                       ext3_warning(sb, __FUNCTION__,
+                                    "Error opening resize inode\n");
+                       iput(inode);
+                       return -ENOENT;
+               }
+       } else {
+               /* Used only for ext3 journal wrapper functions to get sb */
+               inode = &bogus;
+               bogus.i_sb = sb;
+       }
+
+       if ((err = verify_group_input(sb, input)))
+               goto exit_put;
+
+       if ((err = setup_new_group_blocks(sb, inode, input)))
+               goto exit_put;
+
+       /*
+        * We will always be modifying at least the superblock and a GDT
+        * block.  If we are adding a group past the last current GDT block,
+        * we will also modify the inode and the dindirect block.  If we
+        * are adding a group with superblock/GDT backups  we will also
+        * modify each of the reserved GDT dindirect blocks.
+        */
+       handle = ext3_journal_start(inode, ext3_bg_has_super(sb, input->group) ?
+                                   3 + reserved_gdb : 4);
+       if (IS_ERR(handle)) {
+               err = PTR_ERR(handle);
+               goto exit_put;
+       }
+
+       lock_super(sb);
+       if (input->group != EXT3_SB(sb)->s_groups_count) {
+               ext3_warning(sb, __FUNCTION__,
+                            "multiple resizers run on filesystem!\n");
+               goto exit_journal;
+       }
+
+       if ((err = ext3_journal_get_write_access(handle, sbi->s_sbh)))
+               goto exit_journal;
+
+       /*
+        * We will only either add reserved group blocks to a backup group
+        * or remove reserved blocks for the first group in a new group block.
+        * Doing both would be mean more complex code, and sane people don't
+        * use non-sparse filesystems anymore.  This is already checked above.
+        */
+       if (gdb_off) {
+               primary = sbi->s_group_desc[gdb_num];
+               if ((err = ext3_journal_get_write_access(handle, primary)))
+                       goto exit_journal;
+
+               if (reserved_gdb && ext3_bg_num_gdb(sb, input->group) &&
+                   (err = reserve_backup_gdb(handle, inode, input)))
+                       goto exit_journal;
+       } else if ((err = add_new_gdb(handle, inode, input, &primary)))
+               goto exit_journal;
+
+       /* Finally update group descriptor block for new group */
+       gdp = (struct ext3_group_desc *)primary->b_data + gdb_off;
+
+       gdp->bg_block_bitmap = cpu_to_le32(input->block_bitmap);
+       gdp->bg_inode_bitmap = cpu_to_le32(input->inode_bitmap);
+       gdp->bg_inode_table = cpu_to_le32(input->inode_table);
+       gdp->bg_free_blocks_count = cpu_to_le16(input->free_blocks_count);
+       gdp->bg_free_inodes_count = cpu_to_le16(EXT3_INODES_PER_GROUP(sb));
+
+       EXT3_SB(sb)->s_groups_count++;
+       ext3_journal_dirty_metadata(handle, primary);
+
+       /* Update superblock with new block counts */
+       es->s_blocks_count = cpu_to_le32(le32_to_cpu(es->s_blocks_count) +
+               input->blocks_count);
+       es->s_free_blocks_count =
+               cpu_to_le32(le32_to_cpu(es->s_free_blocks_count) +
+                           input->free_blocks_count);
+       es->s_r_blocks_count = cpu_to_le32(le32_to_cpu(es->s_r_blocks_count) +
+               input->reserved_blocks);
+       es->s_inodes_count = cpu_to_le32(le32_to_cpu(es->s_inodes_count) +
+               EXT3_INODES_PER_GROUP(sb));
+       es->s_free_inodes_count =
+               cpu_to_le32(le32_to_cpu(es->s_free_inodes_count) +
+                           EXT3_INODES_PER_GROUP(sb));
+       ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh);
+       sb->s_dirt = 1;
+
+exit_journal:
+       unlock_super(sb);
+       handle->h_sync = 1;
+       if ((err2 = ext3_journal_stop(handle)) && !err)
+               err = err2;
+       if (!err) {
+               update_backups(sb, inode, sbi->s_sbh->b_blocknr, (char *)es,
+                              sizeof(struct ext3_super_block));
+               update_backups(sb, inode, primary->b_blocknr, primary->b_data,
+                              primary->b_size);
+       }
+exit_put:
+       if (inode != &bogus)
+               iput(inode);
+       return err;
+} /* ext3_group_add */
+
+/* Extend the filesystem to the new number of blocks specified.  This entry
+ * point is only used to extend the current filesystem to the end of the last
+ * existing group.  It can be accessed via ioctl, or by "remount,resize=<size>"
+ * for emergencies (because it has no dependencies on reserved blocks).
+ *
+ * If we _really_ wanted, we could use default values to call ext3_group_add()
+ * allow the "remount" trick to work for arbitrary resizing, assuming enough
+ * GDT blocks are reserved to grow to the desired size.
+ */
+int ext3_group_extend(struct super_block *sb, struct ext3_super_block *es,
+                     unsigned long n_blocks_count)
+{
+       unsigned long o_blocks_count;
+       unsigned long o_groups_count;
+       unsigned long last;
+       int add;
+       struct inode *inode;
+       struct buffer_head * bh;
+       handle_t *handle;
+       int err;
+
+       o_blocks_count = le32_to_cpu(es->s_blocks_count);
+       o_groups_count = EXT3_SB(sb)->s_groups_count;
+
+       if (test_opt(sb, DEBUG))
+               printk("EXT3-fs: extending last group from %lu to %lu blocks\n",
+                      o_blocks_count, n_blocks_count);
+
+       if (n_blocks_count == 0 || n_blocks_count == o_blocks_count)
+               return 0;
+
+       if (n_blocks_count < o_blocks_count) {
+               ext3_warning(sb, __FUNCTION__,
+                            "can't shrink FS - resize aborted");
+               return -EBUSY;
+       }
+
+       /* Handle the remaining blocks in the last group only. */
+       last = (o_blocks_count - le32_to_cpu(es->s_first_data_block)) %
+               EXT3_BLOCKS_PER_GROUP(sb);
+
+       if (last == 0) {
+               ext3_warning(sb, __FUNCTION__,
+                            "need to use ext2online to resize further\n");
+               return -EPERM;
+       }
+
+       add = EXT3_BLOCKS_PER_GROUP(sb) - last;
+
+       if (o_blocks_count + add > n_blocks_count)
+               add = n_blocks_count - o_blocks_count;
+
+       if (o_blocks_count + add < n_blocks_count)
+               ext3_warning(sb, __FUNCTION__,
+                            "will only finish group (%lu blocks, %u new)",
+                            o_blocks_count + add, add);
+
+       /* See if the device is actually as big as what was requested */
+       bh = sb_bread(sb, o_blocks_count + add -1);
+       if (!bh) {
+               ext3_warning(sb, __FUNCTION__,
+                            "can't read last block, resize aborted");
+               return -ENOSPC;
+       }
+       brelse(bh);
+
+       /* Get a bogus inode to "free" the new blocks in this group. */
+       if (!(inode = new_inode(sb))) {
+               ext3_warning(sb, __FUNCTION__,
+                            "error getting dummy resize inode");
+               return -ENOMEM;
+       }
+       inode->i_ino = 0;
+
+       EXT3_I(inode)->i_state = EXT3_STATE_RESIZE;
+
+       /* We will update the superblock, one block bitmap, and
+        * one group descriptor via ext3_free_blocks().
+        */
+       handle = ext3_journal_start(inode, 3);
+       if (IS_ERR(handle)) {
+               err = PTR_ERR(handle);
+               ext3_warning(sb, __FUNCTION__, "error %d on journal start",err);
+               goto exit_put;
+       }
+
+       lock_super(sb);
+       if (o_blocks_count != le32_to_cpu(es->s_blocks_count)) {
+               ext3_warning(sb, __FUNCTION__,
+                            "multiple resizers run on filesystem!\n");
+               err = -EBUSY;
+               goto exit_put;
+       }
+
+       if ((err = ext3_journal_get_write_access(handle,
+                                                EXT3_SB(sb)->s_sbh))) {
+               ext3_warning(sb, __FUNCTION__,
+                            "error %d on journal write access", err);
+               unlock_super(sb);
+               ext3_journal_stop(handle);
+               goto exit_put;
+       }
+       es->s_blocks_count = cpu_to_le32(o_blocks_count + add);
+       ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh);
+       sb->s_dirt = 1;
+       unlock_super(sb);
+       ext3_debug("freeing blocks %ld through %ld\n", o_blocks_count,
+                  o_blocks_count + add);
+       ext3_free_blocks(handle, inode, o_blocks_count, add);
+       ext3_debug("freed blocks %ld through %ld\n", o_blocks_count,
+                  o_blocks_count + add);
+       if ((err = ext3_journal_stop(handle)))
+               goto exit_put;
+       if (test_opt(sb, DEBUG))
+               printk("EXT3-fs: extended group to %u blocks\n",
+                      le32_to_cpu(es->s_blocks_count));
+       update_backups(sb, inode, EXT3_SB(sb)->s_sbh->b_blocknr, (char *)es,
+                      sizeof(struct ext3_super_block));
+exit_put:
+       iput(inode);
+
+       return err;
+} /* ext3_group_extend */
diff --git a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c
new file mode 100644 (file)
index 0000000..eacbdca
--- /dev/null
@@ -0,0 +1,69 @@
+#include <linux/reiserfs_fs.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/pagemap.h>
+#include <linux/xattr.h>
+#include <linux/reiserfs_xattr.h>
+#include <asm/uaccess.h>
+
+#define XATTR_SECURITY_PREFIX "security."
+
+static int
+security_get (struct inode *inode, const char *name, void *buffer, size_t size)
+{
+    if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
+        return -EINVAL;
+
+    if (is_reiserfs_priv_object(inode))
+        return -EPERM;
+
+    return reiserfs_xattr_get (inode, name, buffer, size);
+}
+
+static int
+security_set (struct inode *inode, const char *name, const void *buffer,
+          size_t size, int flags)
+{
+    if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
+        return -EINVAL;
+
+    if (is_reiserfs_priv_object(inode))
+        return -EPERM;
+
+    return reiserfs_xattr_set (inode, name, buffer, size, flags);
+}
+
+static int
+security_del (struct inode *inode, const char *name)
+{
+    if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
+        return -EINVAL;
+
+    if (is_reiserfs_priv_object(inode))
+        return -EPERM;
+
+    return 0;
+}
+
+static int
+security_list (struct inode *inode, const char *name, int namelen, char *out)
+{
+    int len = namelen;
+
+    if (is_reiserfs_priv_object(inode))
+        return 0;
+
+    if (out)
+        memcpy (out, name, len);
+
+    return len;
+}
+
+
+struct reiserfs_xattr_handler security_handler = {
+    prefix: XATTR_SECURITY_PREFIX,
+    get: security_get,
+    set: security_set,
+    del: security_del,
+    list: security_list,
+};
diff --git a/fs/reiserfs/xattr_trusted.c b/fs/reiserfs/xattr_trusted.c
new file mode 100644 (file)
index 0000000..39a10ec
--- /dev/null
@@ -0,0 +1,81 @@
+#include <linux/reiserfs_fs.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/pagemap.h>
+#include <linux/xattr.h>
+#include <linux/reiserfs_xattr.h>
+#include <asm/uaccess.h>
+
+#define XATTR_TRUSTED_PREFIX "trusted."
+
+static int
+trusted_get (struct inode *inode, const char *name, void *buffer, size_t size)
+{
+    if (strlen(name) < sizeof(XATTR_TRUSTED_PREFIX))
+        return -EINVAL;
+
+    if (!reiserfs_xattrs (inode->i_sb))
+        return -EOPNOTSUPP;
+
+    if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode)))
+        return -EPERM;
+
+    return reiserfs_xattr_get (inode, name, buffer, size);
+}
+
+static int
+trusted_set (struct inode *inode, const char *name, const void *buffer,
+          size_t size, int flags)
+{
+    if (strlen(name) < sizeof(XATTR_TRUSTED_PREFIX))
+        return -EINVAL;
+
+    if (!reiserfs_xattrs (inode->i_sb))
+        return -EOPNOTSUPP;
+
+    if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode)))
+        return -EPERM;
+
+    return reiserfs_xattr_set (inode, name, buffer, size, flags);
+}
+
+static int
+trusted_del (struct inode *inode, const char *name)
+{
+    if (strlen(name) < sizeof(XATTR_TRUSTED_PREFIX))
+        return -EINVAL;
+
+    if (!reiserfs_xattrs (inode->i_sb))
+        return -EOPNOTSUPP;
+
+    if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode)))
+        return -EPERM;
+
+    return 0;
+}
+
+static int
+trusted_list (struct inode *inode, const char *name, int namelen, char *out)
+{
+    int len = namelen;
+
+    if (!reiserfs_xattrs (inode->i_sb))
+        return 0;
+
+    if (!(capable(CAP_SYS_ADMIN) || is_reiserfs_priv_object(inode)))
+        return 0;
+
+    if (out)
+        memcpy (out, name, len);
+
+    return len;
+}
+
+
+struct reiserfs_xattr_handler trusted_handler = {
+    prefix: XATTR_TRUSTED_PREFIX,
+    get: trusted_get,
+    set: trusted_set,
+    del: trusted_del,
+    list: trusted_list,
+};
diff --git a/fs/reiserfs/xattr_user.c b/fs/reiserfs/xattr_user.c
new file mode 100644 (file)
index 0000000..38779f3
--- /dev/null
@@ -0,0 +1,99 @@
+#include <linux/reiserfs_fs.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/pagemap.h>
+#include <linux/xattr.h>
+#include <linux/reiserfs_xattr.h>
+#include <asm/uaccess.h>
+
+#ifdef CONFIG_REISERFS_FS_POSIX_ACL
+# include <linux/reiserfs_acl.h>
+#endif
+
+#define XATTR_USER_PREFIX "user."
+
+static int
+user_get (struct inode *inode, const char *name, void *buffer, size_t size)
+{
+
+    int error;
+
+    if (strlen(name) < sizeof(XATTR_USER_PREFIX))
+        return -EINVAL;
+
+    if (!reiserfs_xattrs_user (inode->i_sb))
+        return -EOPNOTSUPP;
+
+    error = reiserfs_permission_locked (inode, MAY_READ, NULL);
+    if (error)
+        return error;
+
+    return reiserfs_xattr_get (inode, name, buffer, size);
+}
+
+static int
+user_set (struct inode *inode, const char *name, const void *buffer,
+          size_t size, int flags)
+{
+
+    int error;
+
+    if (strlen(name) < sizeof(XATTR_USER_PREFIX))
+        return -EINVAL;
+
+    if (!reiserfs_xattrs_user (inode->i_sb))
+        return -EOPNOTSUPP;
+
+    if (!S_ISREG (inode->i_mode) &&
+        (!S_ISDIR (inode->i_mode) || inode->i_mode & S_ISVTX))
+        return -EPERM;
+
+    error = reiserfs_permission_locked (inode, MAY_WRITE, NULL);
+    if (error)
+        return error;
+
+    return reiserfs_xattr_set (inode, name, buffer, size, flags);
+}
+
+static int
+user_del (struct inode *inode, const char *name)
+{
+    int error;
+
+    if (strlen(name) < sizeof(XATTR_USER_PREFIX))
+        return -EINVAL;
+
+    if (!reiserfs_xattrs_user (inode->i_sb))
+        return -EOPNOTSUPP;
+
+    if (!S_ISREG (inode->i_mode) &&
+        (!S_ISDIR (inode->i_mode) || inode->i_mode & S_ISVTX))
+        return -EPERM;
+
+    error = reiserfs_permission_locked (inode, MAY_WRITE, NULL);
+    if (error)
+        return error;
+
+    return 0;
+}
+
+static int
+user_list (struct inode *inode, const char *name, int namelen, char *out)
+{
+    int len = namelen;
+    if (!reiserfs_xattrs_user (inode->i_sb))
+        return 0;
+
+    if (out)
+        memcpy (out, name, len);
+
+    return len;
+}
+
+struct reiserfs_xattr_handler user_handler = {
+    prefix: XATTR_USER_PREFIX,
+    get: user_get,
+    set: user_set,
+    del: user_del,
+    list: user_list,
+};
diff --git a/fs/xfs/linux-2.6/mutex.h b/fs/xfs/linux-2.6/mutex.h
new file mode 100644 (file)
index 0000000..0b296bb
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  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 would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SUPPORT_MUTEX_H__
+#define __XFS_SUPPORT_MUTEX_H__
+
+#include <linux/spinlock.h>
+#include <asm/semaphore.h>
+
+/*
+ * Map the mutex'es from IRIX to Linux semaphores.
+ *
+ * Destroy just simply initializes to -99 which should block all other
+ * callers.
+ */
+#define MUTEX_DEFAULT          0x0
+typedef struct semaphore       mutex_t;
+
+#define mutex_init(lock, type, name)           sema_init(lock, 1)
+#define mutex_destroy(lock)                    sema_init(lock, -99)
+#define mutex_lock(lock, num)                  down(lock)
+#define mutex_trylock(lock)                    (down_trylock(lock) ? 0 : 1)
+#define mutex_unlock(lock)                     up(lock)
+
+#endif /* __XFS_SUPPORT_MUTEX_H__ */
diff --git a/fs/xfs/linux-2.6/spin.h b/fs/xfs/linux-2.6/spin.h
new file mode 100644 (file)
index 0000000..bcf60a0
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2000-2002 Silicon Graphics, Inc.  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 would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SUPPORT_SPIN_H__
+#define __XFS_SUPPORT_SPIN_H__
+
+#include <linux/sched.h>       /* preempt needs this */
+#include <linux/spinlock.h>
+
+/*
+ * Map lock_t from IRIX to Linux spinlocks.
+ *
+ * We do not make use of lock_t from interrupt context, so we do not
+ * have to worry about disabling interrupts at all (unlike IRIX).
+ */
+
+typedef spinlock_t lock_t;
+
+#define SPLDECL(s)                     unsigned long s
+
+#define spinlock_init(lock, name)      spin_lock_init(lock)
+#define        spinlock_destroy(lock)
+#define mutex_spinlock(lock)           ({ spin_lock(lock); 0; })
+#define mutex_spinunlock(lock, s)      do { spin_unlock(lock); (void)s; } while (0)
+#define nested_spinlock(lock)          spin_lock(lock)
+#define nested_spinunlock(lock)                spin_unlock(lock)
+
+#endif /* __XFS_SUPPORT_SPIN_H__ */
diff --git a/fs/xfs/linux-2.6/time.h b/fs/xfs/linux-2.6/time.h
new file mode 100644 (file)
index 0000000..6c6fd0f
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  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 would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_SUPPORT_TIME_H__
+#define __XFS_SUPPORT_TIME_H__
+
+#include <linux/sched.h>
+#include <linux/time.h>
+
+typedef struct timespec timespec_t;
+
+static inline void delay(long ticks)
+{
+       set_current_state(TASK_UNINTERRUPTIBLE);
+       schedule_timeout(ticks);
+}
+
+static inline void nanotime(struct timespec *tvp)
+{
+       *tvp = CURRENT_TIME;
+}
+
+#endif /* __XFS_SUPPORT_TIME_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_cred.h b/fs/xfs/linux-2.6/xfs_cred.h
new file mode 100644 (file)
index 0000000..00c4584
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2000-2002 Silicon Graphics, Inc.  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 would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_CRED_H__
+#define __XFS_CRED_H__
+
+/*
+ * Credentials
+ */
+typedef struct cred {
+       /* EMPTY */
+} cred_t;
+
+extern struct cred *sys_cred;
+
+/* this is a hack.. (assums sys_cred is the only cred_t in the system) */
+static __inline int capable_cred(cred_t *cr, int cid)
+{
+       return (cr == sys_cred) ? 1 : capable(cid);
+}
+
+#endif  /* __XFS_CRED_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_fs_subr.h b/fs/xfs/linux-2.6/xfs_fs_subr.h
new file mode 100644 (file)
index 0000000..198b8dd
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2000, 2002 Silicon Graphics, Inc.  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 would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef        __XFS_SUBR_H__
+#define __XFS_SUBR_H__
+
+/*
+ * Utilities shared among file system implementations.
+ */
+
+struct cred;
+
+extern int     fs_noerr(void);
+extern int     fs_nosys(void);
+extern int     fs_nodev(void);
+extern void    fs_noval(void);
+extern void    fs_tosspages(bhv_desc_t *, xfs_off_t, xfs_off_t, int);
+extern void    fs_flushinval_pages(bhv_desc_t *, xfs_off_t, xfs_off_t, int);
+extern int     fs_flush_pages(bhv_desc_t *, xfs_off_t, xfs_off_t, uint64_t, int);
+
+#endif /* __XFS_FS_SUBR_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_globals.h b/fs/xfs/linux-2.6/xfs_globals.h
new file mode 100644 (file)
index 0000000..e81e2f3
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.  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 would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_GLOBALS_H__
+#define __XFS_GLOBALS_H__
+
+/*
+ * This file declares globals needed by XFS that were normally defined
+ * somewhere else in IRIX.
+ */
+
+extern uint64_t        xfs_panic_mask;         /* set to cause more panics */
+extern unsigned long xfs_physmem;
+extern struct cred *sys_cred;
+
+#endif /* __XFS_GLOBALS_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
new file mode 100644 (file)
index 0000000..e7d4eba
--- /dev/null
@@ -0,0 +1,710 @@
+/*
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  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 would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+#include "xfs.h"
+#include "xfs_fs.h"
+#include "xfs_inum.h"
+#include "xfs_log.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
+#include "xfs_ag.h"
+#include "xfs_dir.h"
+#include "xfs_dir2.h"
+#include "xfs_alloc.h"
+#include "xfs_dmapi.h"
+#include "xfs_quota.h"
+#include "xfs_mount.h"
+#include "xfs_alloc_btree.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_ialloc_btree.h"
+#include "xfs_btree.h"
+#include "xfs_ialloc.h"
+#include "xfs_attr_sf.h"
+#include "xfs_dir_sf.h"
+#include "xfs_dir2_sf.h"
+#include "xfs_dinode.h"
+#include "xfs_inode.h"
+#include "xfs_bmap.h"
+#include "xfs_bit.h"
+#include "xfs_rtalloc.h"
+#include "xfs_error.h"
+#include "xfs_itable.h"
+#include "xfs_rw.h"
+#include "xfs_acl.h"
+#include "xfs_cap.h"
+#include "xfs_mac.h"
+#include "xfs_attr.h"
+#include "xfs_buf_item.h"
+#include "xfs_utils.h"
+
+#include <linux/xattr.h>
+
+
+/*
+ * Pull the link count and size up from the xfs inode to the linux inode
+ */
+STATIC void
+validate_fields(
+       struct inode    *ip)
+{
+       vnode_t         *vp = LINVFS_GET_VP(ip);
+       vattr_t         va;
+       int             error;
+
+       va.va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS;
+       VOP_GETATTR(vp, &va, ATTR_LAZY, NULL, error);
+       if (likely(!error)) {
+               ip->i_nlink = va.va_nlink;
+               ip->i_blocks = va.va_nblocks;
+
+               /* we're under i_sem so i_size can't change under us */
+               if (i_size_read(ip) != va.va_size)
+                       i_size_write(ip, va.va_size);
+       }
+}
+
+/*
+ * Determine whether a process has a valid fs_struct (kernel daemons
+ * like knfsd don't have an fs_struct).
+ *
+ * XXX(hch):  nfsd is broken, better fix it instead.
+ */
+STATIC inline int
+has_fs_struct(struct task_struct *task)
+{
+       return (task->fs != init_task.fs);
+}
+
+STATIC int
+linvfs_mknod(
+       struct inode    *dir,
+       struct dentry   *dentry,
+       int             mode,
+       dev_t           rdev)
+{
+       struct inode    *ip;
+       vattr_t         va;
+       vnode_t         *vp = NULL, *dvp = LINVFS_GET_VP(dir);
+       xfs_acl_t       *default_acl = NULL;
+       attrexists_t    test_default_acl = _ACL_DEFAULT_EXISTS;
+       int             error;
+
+       /*
+        * Irix uses Missed'em'V split, but doesn't want to see
+        * the upper 5 bits of (14bit) major.
+        */
+       if (!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff)
+               return -EINVAL;
+
+       if (test_default_acl && test_default_acl(dvp)) {
+               if (!_ACL_ALLOC(default_acl))
+                       return -ENOMEM;
+               if (!_ACL_GET_DEFAULT(dvp, default_acl)) {
+                       _ACL_FREE(default_acl);
+                       default_acl = NULL;
+               }
+       }
+
+       if (IS_POSIXACL(dir) && !default_acl && has_fs_struct(current))
+               mode &= ~current->fs->umask;
+
+       memset(&va, 0, sizeof(va));
+       va.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
+       va.va_type = IFTOVT(mode);
+       va.va_mode = mode;
+
+       switch (mode & S_IFMT) {
+       case S_IFCHR: case S_IFBLK: case S_IFIFO: case S_IFSOCK:
+               va.va_rdev = sysv_encode_dev(rdev);
+               va.va_mask |= XFS_AT_RDEV;
+               /*FALLTHROUGH*/
+       case S_IFREG:
+               VOP_CREATE(dvp, dentry, &va, &vp, NULL, error);
+               break;
+       case S_IFDIR:
+               VOP_MKDIR(dvp, dentry, &va, &vp, NULL, error);
+               break;
+       default:
+               error = EINVAL;
+               break;
+       }
+
+       if (default_acl) {
+               if (!error) {
+                       error = _ACL_INHERIT(vp, &va, default_acl);
+                       if (!error) {
+                               VMODIFY(vp);
+                       } else {
+                               struct dentry   teardown = {};
+                               int             err2;
+
+                               /* Oh, the horror.
+                                * If we can't add the ACL we must back out.
+                                * ENOSPC can hit here, among other things.
+                                */
+                               teardown.d_inode = ip = LINVFS_GET_IP(vp);
+                               teardown.d_name = dentry->d_name;
+                               remove_inode_hash(ip);
+                               make_bad_inode(ip);
+                               if (S_ISDIR(mode))
+                                       VOP_RMDIR(dvp, &teardown, NULL, err2);
+                               else
+                                       VOP_REMOVE(dvp, &teardown, NULL, err2);
+                               VN_RELE(vp);
+                       }
+               }
+               _ACL_FREE(default_acl);
+       }
+
+       if (!error) {
+               ASSERT(vp);
+               ip = LINVFS_GET_IP(vp);
+
+               if (S_ISCHR(mode) || S_ISBLK(mode))
+                       ip->i_rdev = rdev;
+               else if (S_ISDIR(mode))
+                       validate_fields(ip);
+               d_instantiate(dentry, ip);
+               validate_fields(dir);
+       }
+       return -error;
+}
+
+STATIC int
+linvfs_create(
+       struct inode    *dir,
+       struct dentry   *dentry,
+       int             mode,
+       struct nameidata *nd)
+{
+       return linvfs_mknod(dir, dentry, mode, 0);
+}
+
+STATIC int
+linvfs_mkdir(
+       struct inode    *dir,
+       struct dentry   *dentry,
+       int             mode)
+{
+       return linvfs_mknod(dir, dentry, mode|S_IFDIR, 0);
+}
+
+STATIC struct dentry *
+linvfs_lookup(
+       struct inode    *dir,
+       struct dentry   *dentry,
+       struct nameidata *nd)
+{
+       struct inode    *ip = NULL;
+       vnode_t         *vp, *cvp = NULL;
+       int             error;
+
+       if (dentry->d_name.len >= MAXNAMELEN)
+               return ERR_PTR(-ENAMETOOLONG);
+
+       vp = LINVFS_GET_VP(dir);
+       VOP_LOOKUP(vp, dentry, &cvp, 0, NULL, NULL, error);
+       if (!error) {
+               ASSERT(cvp);
+               ip = LINVFS_GET_IP(cvp);
+               if (!ip) {
+                       VN_RELE(cvp);
+                       return ERR_PTR(-EACCES);
+               }
+       }
+       if (error && (error != ENOENT))
+               return ERR_PTR(-error);
+       return d_splice_alias(ip, dentry);
+}
+
+STATIC int
+linvfs_link(
+       struct dentry   *old_dentry,
+       struct inode    *dir,
+       struct dentry   *dentry)
+{
+       struct inode    *ip;    /* inode of guy being linked to */
+       vnode_t         *tdvp;  /* target directory for new name/link */
+       vnode_t         *vp;    /* vp of name being linked */
+       int             error;
+
+       ip = old_dentry->d_inode;       /* inode being linked to */
+       if (S_ISDIR(ip->i_mode))
+               return -EPERM;
+
+       tdvp = LINVFS_GET_VP(dir);
+       vp = LINVFS_GET_VP(ip);
+
+       VOP_LINK(tdvp, vp, dentry, NULL, error);
+       if (!error) {
+               VMODIFY(tdvp);
+               VN_HOLD(vp);
+               validate_fields(ip);
+               d_instantiate(dentry, ip);
+       }
+       return -error;
+}
+
+STATIC int
+linvfs_unlink(
+       struct inode    *dir,
+       struct dentry   *dentry)
+{
+       struct inode    *inode;
+       vnode_t         *dvp;   /* directory containing name to remove */
+       int             error;
+
+       inode = dentry->d_inode;
+       dvp = LINVFS_GET_VP(dir);
+
+       VOP_REMOVE(dvp, dentry, NULL, error);
+       if (!error) {
+               validate_fields(dir);   /* For size only */
+               validate_fields(inode);
+       }
+
+       return -error;
+}
+
+STATIC int
+linvfs_symlink(
+       struct inode    *dir,
+       struct dentry   *dentry,
+       const char      *symname)
+{
+       struct inode    *ip;
+       vattr_t         va;
+       vnode_t         *dvp;   /* directory containing name to remove */
+       vnode_t         *cvp;   /* used to lookup symlink to put in dentry */
+       int             error;
+
+       dvp = LINVFS_GET_VP(dir);
+       cvp = NULL;
+
+       memset(&va, 0, sizeof(va));
+       va.va_type = VLNK;
+       va.va_mode = irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO;
+       va.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
+
+       error = 0;
+       VOP_SYMLINK(dvp, dentry, &va, (char *)symname, &cvp, NULL, error);
+       if (!error && cvp) {
+               ASSERT(cvp->v_type == VLNK);
+               ip = LINVFS_GET_IP(cvp);
+               d_instantiate(dentry, ip);
+               validate_fields(dir);
+               validate_fields(ip); /* size needs update */
+       }
+       return -error;
+}
+
+STATIC int
+linvfs_rmdir(
+       struct inode    *dir,
+       struct dentry   *dentry)
+{
+       struct inode    *inode = dentry->d_inode;
+       vnode_t         *dvp = LINVFS_GET_VP(dir);
+       int             error;
+
+       VOP_RMDIR(dvp, dentry, NULL, error);
+       if (!error) {
+               validate_fields(inode);
+               validate_fields(dir);
+       }
+       return -error;
+}
+
+STATIC int
+linvfs_rename(
+       struct inode    *odir,
+       struct dentry   *odentry,
+       struct inode    *ndir,
+       struct dentry   *ndentry)
+{
+       struct inode    *new_inode = ndentry->d_inode;
+       vnode_t         *fvp;   /* from directory */
+       vnode_t         *tvp;   /* target directory */
+       int             error;
+
+       fvp = LINVFS_GET_VP(odir);
+       tvp = LINVFS_GET_VP(ndir);
+
+       VOP_RENAME(fvp, odentry, tvp, ndentry, NULL, error);
+       if (error)
+               return -error;
+
+       if (new_inode)
+               validate_fields(new_inode);
+
+       validate_fields(odir);
+       if (ndir != odir)
+               validate_fields(ndir);
+       return 0;
+}
+
+STATIC int
+linvfs_readlink(
+       struct dentry   *dentry,
+       char            *buf,
+       int             size)
+{
+       vnode_t         *vp = LINVFS_GET_VP(dentry->d_inode);
+       uio_t           uio;
+       iovec_t         iov;
+       int             error;
+
+       iov.iov_base = buf;
+       iov.iov_len = size;
+
+       uio.uio_iov = &iov;
+       uio.uio_offset = 0;
+       uio.uio_segflg = UIO_USERSPACE;
+       uio.uio_resid = size;
+       uio.uio_iovcnt = 1;
+
+       VOP_READLINK(vp, &uio, 0, NULL, error);
+       if (error)
+               return -error;
+
+       return (size - uio.uio_resid);
+}
+
+/*
+ * careful here - this function can get called recursively, so
+ * we need to be very careful about how much stack we use.
+ * uio is kmalloced for this reason...
+ */
+STATIC int
+linvfs_follow_link(
+       struct dentry           *dentry,
+       struct nameidata        *nd)
+{
+       vnode_t                 *vp;
+       uio_t                   *uio;
+       iovec_t                 iov;
+       int                     error;
+       char                    *link;
+
+       ASSERT(dentry);
+       ASSERT(nd);
+
+       link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL);
+       if (!link) {
+               nd_set_link(nd, ERR_PTR(-ENOMEM));
+               return 0;
+       }
+
+       uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL);
+       if (!uio) {
+               kfree(link);
+               nd_set_link(nd, ERR_PTR(-ENOMEM));
+               return 0;
+       }
+
+       vp = LINVFS_GET_VP(dentry->d_inode);
+
+       iov.iov_base = link;
+       iov.iov_len = MAXNAMELEN;
+
+       uio->uio_iov = &iov;
+       uio->uio_offset = 0;
+       uio->uio_segflg = UIO_SYSSPACE;
+       uio->uio_resid = MAXNAMELEN;
+       uio->uio_iovcnt = 1;
+
+       VOP_READLINK(vp, uio, 0, NULL, error);
+       if (error) {
+               kfree(link);
+               link = ERR_PTR(-error);
+       } else {
+               link[MAXNAMELEN - uio->uio_resid] = '\0';
+       }
+       kfree(uio);
+
+       nd_set_link(nd, link);
+       return 0;
+}
+
+static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd)
+{
+       char *s = nd_get_link(nd);
+       if (!IS_ERR(s))
+               kfree(s);
+}
+
+#ifdef CONFIG_XFS_POSIX_ACL
+STATIC int
+linvfs_permission(
+       struct inode    *inode,
+       int             mode,
+       struct nameidata *nd)
+{
+       vnode_t         *vp = LINVFS_GET_VP(inode);
+       int             error;
+
+       mode <<= 6;             /* convert from linux to vnode access bits */
+       VOP_ACCESS(vp, mode, NULL, error);
+       return -error;
+}
+#else
+#define linvfs_permission NULL
+#endif
+
+STATIC int
+linvfs_getattr(
+       struct vfsmount *mnt,
+       struct dentry   *dentry,
+       struct kstat    *stat)
+{
+       struct inode    *inode = dentry->d_inode;
+       vnode_t         *vp = LINVFS_GET_VP(inode);
+       int             error = 0;
+
+       if (unlikely(vp->v_flag & VMODIFIED))
+               error = vn_revalidate(vp);
+       if (!error)
+               generic_fillattr(inode, stat);
+       return 0;
+}
+
+STATIC int
+linvfs_setattr(
+       struct dentry   *dentry,
+       struct iattr    *attr)
+{
+       struct inode    *inode = dentry->d_inode;
+       unsigned int    ia_valid = attr->ia_valid;
+       vnode_t         *vp = LINVFS_GET_VP(inode);
+       vattr_t         vattr;
+       int             flags = 0;
+       int             error;
+
+       memset(&vattr, 0, sizeof(vattr_t));
+       if (ia_valid & ATTR_UID) {
+               vattr.va_mask |= XFS_AT_UID;
+               vattr.va_uid = attr->ia_uid;
+       }
+       if (ia_valid & ATTR_GID) {
+               vattr.va_mask |= XFS_AT_GID;
+               vattr.va_gid = attr->ia_gid;
+       }
+       if (ia_valid & ATTR_SIZE) {
+               vattr.va_mask |= XFS_AT_SIZE;
+               vattr.va_size = attr->ia_size;
+       }
+       if (ia_valid & ATTR_ATIME) {
+               vattr.va_mask |= XFS_AT_ATIME;
+               vattr.va_atime = attr->ia_atime;
+       }
+       if (ia_valid & ATTR_MTIME) {
+               vattr.va_mask |= XFS_AT_MTIME;
+               vattr.va_mtime = attr->ia_mtime;
+       }
+       if (ia_valid & ATTR_CTIME) {
+               vattr.va_mask |= XFS_AT_CTIME;
+               vattr.va_ctime = attr->ia_ctime;
+       }
+       if (ia_valid & ATTR_MODE) {
+               vattr.va_mask |= XFS_AT_MODE;
+               vattr.va_mode = attr->ia_mode;
+               if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
+                       inode->i_mode &= ~S_ISGID;
+       }
+
+       if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET))
+               flags |= ATTR_UTIME;
+#ifdef ATTR_NO_BLOCK
+       if ((ia_valid & ATTR_NO_BLOCK))
+               flags |= ATTR_NONBLOCK;
+#endif
+
+       VOP_SETATTR(vp, &vattr, flags, NULL, error);
+       if (error)
+               return -error;
+       vn_revalidate(vp);
+       return error;
+}
+
+STATIC void
+linvfs_truncate(
+       struct inode    *inode)
+{
+       block_truncate_page(inode->i_mapping, inode->i_size, linvfs_get_block);
+}
+
+STATIC int
+linvfs_setxattr(
+       struct dentry   *dentry,
+       const char      *name,
+       const void      *data,
+       size_t          size,
+       int             flags)
+{
+       vnode_t         *vp = LINVFS_GET_VP(dentry->d_inode);
+       char            *attr = (char *)name;
+       attrnames_t     *namesp;
+       int             xflags = 0;
+       int             error;
+
+       namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
+       if (!namesp)
+               return -EOPNOTSUPP;
+       attr += namesp->attr_namelen;
+       error = namesp->attr_capable(vp, NULL);
+       if (error)
+               return error;
+
+       /* Convert Linux syscall to XFS internal ATTR flags */
+       if (flags & XATTR_CREATE)
+               xflags |= ATTR_CREATE;
+       if (flags & XATTR_REPLACE)
+               xflags |= ATTR_REPLACE;
+       xflags |= namesp->attr_flag;
+       return namesp->attr_set(vp, attr, (void *)data, size, xflags);
+}
+
+STATIC ssize_t
+linvfs_getxattr(
+       struct dentry   *dentry,
+       const char      *name,
+       void            *data,
+       size_t          size)
+{
+       vnode_t         *vp = LINVFS_GET_VP(dentry->d_inode);
+       char            *attr = (char *)name;
+       attrnames_t     *namesp;
+       int             xflags = 0;
+       ssize_t         error;
+
+       namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
+       if (!namesp)
+               return -EOPNOTSUPP;
+       attr += namesp->attr_namelen;
+       error = namesp->attr_capable(vp, NULL);
+       if (error)
+               return error;
+
+       /* Convert Linux syscall to XFS internal ATTR flags */
+       if (!size) {
+               xflags |= ATTR_KERNOVAL;
+               data = NULL;
+       }
+       xflags |= namesp->attr_flag;
+       return namesp->attr_get(vp, attr, (void *)data, size, xflags);
+}
+
+STATIC ssize_t
+linvfs_listxattr(
+       struct dentry           *dentry,
+       char                    *data,
+       size_t                  size)
+{
+       vnode_t                 *vp = LINVFS_GET_VP(dentry->d_inode);
+       int                     error, xflags = ATTR_KERNAMELS;
+       ssize_t                 result;
+
+       if (!size)
+               xflags |= ATTR_KERNOVAL;
+       xflags |= capable(CAP_SYS_ADMIN) ? ATTR_KERNFULLS : ATTR_KERNORMALS;
+
+       error = attr_generic_list(vp, data, size, xflags, &result);
+       if (error < 0)
+               return error;
+       return result;
+}
+
+STATIC int
+linvfs_removexattr(
+       struct dentry   *dentry,
+       const char      *name)
+{
+       vnode_t         *vp = LINVFS_GET_VP(dentry->d_inode);
+       char            *attr = (char *)name;
+       attrnames_t     *namesp;
+       int             xflags = 0;
+       int             error;
+
+       namesp = attr_lookup_namespace(attr, attr_namespaces, ATTR_NAMECOUNT);
+       if (!namesp)
+               return -EOPNOTSUPP;
+       attr += namesp->attr_namelen;
+       error = namesp->attr_capable(vp, NULL);
+       if (error)
+               return error;
+       xflags |= namesp->attr_flag;
+       return namesp->attr_remove(vp, attr, xflags);
+}
+
+
+struct inode_operations linvfs_file_inode_operations = {
+       .permission             = linvfs_permission,
+       .truncate               = linvfs_truncate,
+       .getattr                = linvfs_getattr,
+       .setattr                = linvfs_setattr,
+       .setxattr               = linvfs_setxattr,
+       .getxattr               = linvfs_getxattr,
+       .listxattr              = linvfs_listxattr,
+       .removexattr            = linvfs_removexattr,
+};
+
+struct inode_operations linvfs_dir_inode_operations = {
+       .create                 = linvfs_create,
+       .lookup                 = linvfs_lookup,
+       .link                   = linvfs_link,
+       .unlink                 = linvfs_unlink,
+       .symlink                = linvfs_symlink,
+       .mkdir                  = linvfs_mkdir,
+       .rmdir                  = linvfs_rmdir,
+       .mknod                  = linvfs_mknod,
+       .rename                 = linvfs_rename,
+       .permission             = linvfs_permission,
+       .getattr                = linvfs_getattr,
+       .setattr                = linvfs_setattr,
+       .setxattr               = linvfs_setxattr,
+       .getxattr               = linvfs_getxattr,
+       .listxattr              = linvfs_listxattr,
+       .removexattr            = linvfs_removexattr,
+};
+
+struct inode_operations linvfs_symlink_inode_operations = {
+       .readlink               = linvfs_readlink,
+       .follow_link            = linvfs_follow_link,
+       .put_link               = linvfs_put_link,
+       .permission             = linvfs_permission,
+       .getattr                = linvfs_getattr,
+       .setattr                = linvfs_setattr,
+       .setxattr               = linvfs_setxattr,
+       .getxattr               = linvfs_getxattr,
+       .listxattr              = linvfs_listxattr,
+       .removexattr            = linvfs_removexattr,
+};
diff --git a/fs/xfs/linux-2.6/xfs_stats.h b/fs/xfs/linux-2.6/xfs_stats.h
new file mode 100644 (file)
index 0000000..0456600
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2000 Silicon Graphics, Inc.  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 would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+#ifndef __XFS_STATS_H__
+#define __XFS_STATS_H__
+
+
+#if defined(CONFIG_PROC_FS) && !defined(XFS_STATS_OFF)
+
+#include <linux/percpu.h>
+
+/*
+ * XFS global statistics
+ */
+struct xfsstats {
+# define XFSSTAT_END_EXTENT_ALLOC      4
+       __uint32_t              xs_allocx;
+       __uint32_t              xs_allocb;
+       __uint32_t              xs_freex;
+       __uint32_t              xs_freeb;
+# define XFSSTAT_END_ALLOC_BTREE       (XFSSTAT_END_EXTENT_ALLOC+4)
+       __uint32_t              xs_abt_lookup;
+       __uint32_t              xs_abt_compare;
+       __uint32_t              xs_abt_insrec;
+       __uint32_t              xs_abt_delrec;
+# define XFSSTAT_END_BLOCK_MAPPING     (XFSSTAT_END_ALLOC_BTREE+7)
+       __uint32_t              xs_blk_mapr;
+       __uint32_t              xs_blk_mapw;
+       __uint32_t              xs_blk_unmap;
+       __uint32_t              xs_add_exlist;
+       __uint32_t              xs_del_exlist;
+       __uint32_t              xs_look_exlist;
+       __uint32_t              xs_cmp_exlist;
+# define XFSSTAT_END_BLOCK_MAP_BTREE   (XFSSTAT_END_BLOCK_MAPPING+4)
+       __uint32_t              xs_bmbt_lookup;
+       __uint32_t              xs_bmbt_compare;
+       __uint32_t              xs_bmbt_insrec;
+       __uint32_t              xs_bmbt_delrec;
+# define XFSSTAT_END_DIRECTORY_OPS     (XFSSTAT_END_BLOCK_MAP_BTREE+4)
+       __uint32_t              xs_dir_lookup;
+       __uint32_t              xs_dir_create;
+       __uint32_t              xs_dir_remove;
+       __uint32_t              xs_dir_getdents;
+# define XFSSTAT_END_TRANSACTIONS      (XFSSTAT_END_DIRECTORY_OPS+3)
+       __uint32_t              xs_trans_sync;
+       __uint32_t              xs_trans_async;
+       __uint32_t              xs_trans_empty;
+# define XFSSTAT_END_INODE_OPS         (XFSSTAT_END_TRANSACTIONS+7)
+       __uint32_t              xs_ig_attempts;
+       __uint32_t              xs_ig_found;
+       __uint32_t              xs_ig_frecycle;
+       __uint32_t              xs_ig_missed;
+       __uint32_t              xs_ig_dup;
+       __uint32_t              xs_ig_reclaims;
+       __uint32_t              xs_ig_attrchg;
+# define XFSSTAT_END_LOG_OPS           (XFSSTAT_END_INODE_OPS+5)
+       __uint32_t              xs_log_writes;
+       __uint32_t              xs_log_blocks;
+       __uint32_t              xs_log_noiclogs;
+       __uint32_t              xs_log_force;
+       __uint32_t              xs_log_force_sleep;
+# define XFSSTAT_END_TAIL_PUSHING      (XFSSTAT_END_LOG_OPS+10)
+       __uint32_t              xs_try_logspace;
+       __uint32_t              xs_sleep_logspace;
+       __uint32_t              xs_push_ail;
+       __uint32_t              xs_push_ail_success;
+       __uint32_t              xs_push_ail_pushbuf;
+       __uint32_t              xs_push_ail_pinned;
+       __uint32_t              xs_push_ail_locked;
+       __uint32_t              xs_push_ail_flushing;
+       __uint32_t              xs_push_ail_restarts;
+       __uint32_t              xs_push_ail_flush;
+# define XFSSTAT_END_WRITE_CONVERT     (XFSSTAT_END_TAIL_PUSHING+2)
+       __uint32_t              xs_xstrat_quick;
+       __uint32_t              xs_xstrat_split;
+# define XFSSTAT_END_READ_WRITE_OPS    (XFSSTAT_END_WRITE_CONVERT+2)
+       __uint32_t              xs_write_calls;
+       __uint32_t              xs_read_calls;
+# define XFSSTAT_END_ATTRIBUTE_OPS     (XFSSTAT_END_READ_WRITE_OPS+4)
+       __uint32_t              xs_attr_get;
+       __uint32_t              xs_attr_set;
+       __uint32_t              xs_attr_remove;
+       __uint32_t              xs_attr_list;
+# define XFSSTAT_END_INODE_CLUSTER     (XFSSTAT_END_ATTRIBUTE_OPS+3)
+       __uint32_t              xs_iflush_count;
+       __uint32_t              xs_icluster_flushcnt;
+       __uint32_t              xs_icluster_flushinode;
+# define XFSSTAT_END_VNODE_OPS         (XFSSTAT_END_INODE_CLUSTER+8)
+       __uint32_t              vn_active;      /* # vnodes not on free lists */
+       __uint32_t              vn_alloc;       /* # times vn_alloc called */
+       __uint32_t              vn_get;         /* # times vn_get called */
+       __uint32_t              vn_hold;        /* # times vn_hold called */
+       __uint32_t              vn_rele;        /* # times vn_rele called */
+       __uint32_t              vn_reclaim;     /* # times vn_reclaim called */
+       __uint32_t              vn_remove;      /* # times vn_remove called */
+       __uint32_t              vn_free;        /* # times vn_free called */
+#define XFSSTAT_END_BUF                        (XFSSTAT_END_VNODE_OPS+9)
+       __uint32_t              pb_get;
+       __uint32_t              pb_create;
+       __uint32_t              pb_get_locked;
+       __uint32_t              pb_get_locked_waited;
+       __uint32_t              pb_busy_locked;
+       __uint32_t              pb_miss_locked;
+       __uint32_t              pb_page_retries;
+       __uint32_t              pb_page_found;
+       __uint32_t              pb_get_read;
+/* Extra precision counters */
+       __uint64_t              xs_xstrat_bytes;
+       __uint64_t              xs_write_bytes;
+       __uint64_t              xs_read_bytes;
+};
+
+DECLARE_PER_CPU(struct xfsstats, xfsstats);
+
+/* We don't disable preempt, not too worried about poking the
+ * wrong cpu's stat for now */
+#define XFS_STATS_INC(count)           (__get_cpu_var(xfsstats).count++)
+#define XFS_STATS_DEC(count)           (__get_cpu_var(xfsstats).count--)
+#define XFS_STATS_ADD(count, inc)      (__get_cpu_var(xfsstats).count += (inc))
+
+extern void xfs_init_procfs(void);
+extern void xfs_cleanup_procfs(void);
+
+
+#else  /* !CONFIG_PROC_FS */
+
+# define XFS_STATS_INC(count)
+# define XFS_STATS_DEC(count)
+# define XFS_STATS_ADD(count, inc)
+
+static __inline void xfs_init_procfs(void) { };
+static __inline void xfs_cleanup_procfs(void) { };
+
+#endif /* !CONFIG_PROC_FS */
+
+#endif /* __XFS_STATS_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_version.h b/fs/xfs/linux-2.6/xfs_version.h
new file mode 100644 (file)
index 0000000..96f9639
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2001-2002 Silicon Graphics, Inc.  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 would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.         Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+/*
+ * Dummy file that can contain a timestamp to put into the
+ * XFS init string, to help users keep track of what they're
+ * running
+ */
+
+#ifndef __XFS_VERSION_H__
+#define __XFS_VERSION_H__
+
+#define XFS_VERSION_STRING "SGI XFS"
+
+#endif /* __XFS_VERSION_H__ */
diff --git a/include/asm-alpha/8253pit.h b/include/asm-alpha/8253pit.h
new file mode 100644 (file)
index 0000000..fef5c14
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * 8253/8254 Programmable Interval Timer
+ */
+
+#ifndef _8253PIT_H
+#define _8253PIT_H
+
+#define PIT_TICK_RATE  1193180UL
+
+#endif
diff --git a/include/asm-arm/arch-ixp4xx/coyote.h b/include/asm-arm/arch-ixp4xx/coyote.h
new file mode 100644 (file)
index 0000000..dd0c2d2
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * include/asm-arm/arch-ixp4xx/coyote.h
+ *
+ * ADI Engineering platform specific definitions
+ *
+ * Author: Deepak Saxena <dsaxena@plexity.net>
+ *
+ * Copyright 2004 (c) MontaVista, Software, Inc. 
+ * 
+ * This file is licensed under  the terms of the GNU General Public 
+ * License version 2. This program is licensed "as is" without any 
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H__
+#error "Do not include this directly, instead #include <asm/hardware.h>"
+#endif
+
+#define        COYOTE_FLASH_BASE       IXP4XX_EXP_BUS_CS0_BASE_PHYS
+#define        COYOTE_FLASH_SIZE       IXP4XX_EXP_BUS_CSX_REGION_SIZE * 2
+
+/* PCI controller GPIO to IRQ pin mappings */
+#define        COYOTE_PCI_SLOT0_PIN    6
+#define        COYOTE_PCI_SLOT1_PIN    11
+
+#define        COYOTE_PCI_SLOT0_DEVID  14
+#define        COYOTE_PCI_SLOT1_DEVID  15
+
+#define        COYOTE_IDE_BASE_PHYS    IXP4XX_EXP_BUS_CS3_BASE_PHYS
+#define        COYOTE_IDE_BASE_VIRT    0xFFFE1000
+#define        COYOTE_IDE_REGION_SIZE  0x1000
+
+#define        COYOTE_IDE_DATA_PORT    0xFFFE10E0
+#define        COYOTE_IDE_CTRL_PORT    0xFFFE10FC
+#define        COYOTE_IDE_ERROR_PORT   0xFFFE10E2
+
diff --git a/include/asm-arm/arch-ixp4xx/hardware.h b/include/asm-arm/arch-ixp4xx/hardware.h
new file mode 100644 (file)
index 0000000..a048cbc
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * include/asm-arm/arch-ixp4xx/hardware.h 
+ *
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+/*
+ * Hardware definitions for IXP4xx based systems
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H__
+#define __ASM_ARCH_HARDWARE_H__
+
+#define PCIBIOS_MIN_IO                 0x00001000
+#define PCIBIOS_MIN_MEM                        0x48000000
+
+/*
+ * We override the standard dma-mask routines for bouncing.
+ */
+#define        HAVE_ARCH_PCI_SET_DMA_MASK
+
+#define pcibios_assign_all_busses()    1
+
+/* Register locations and bits */
+#include "ixp4xx-regs.h"
+
+/* Platform helper functions and definitions */
+#include "platform.h"
+
+/* Platform specific details */
+#include "ixdp425.h"
+#include "coyote.h"
+#include "prpmc1100.h"
+
+#endif  /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-ixp4xx/irqs.h b/include/asm-arm/arch-ixp4xx/irqs.h
new file mode 100644 (file)
index 0000000..c782b56
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * include/asm-arm/arch-ixp4xx/irqs.h 
+ *
+ * IRQ definitions for IXP4XX based systems
+ *
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#ifndef _ARCH_IXP4XX_IRQS_H_
+#define _ARCH_IXP4XX_IRQS_H_
+
+#define NR_IRQS                        32
+
+#define IRQ_IXP4XX_NPEA                0
+#define IRQ_IXP4XX_NPEB                1
+#define IRQ_IXP4XX_NPEC                2
+#define IRQ_IXP4XX_QM1         3
+#define IRQ_IXP4XX_QM2         4
+#define IRQ_IXP4XX_TIMER1      5
+#define IRQ_IXP4XX_GPIO0       6
+#define IRQ_IXP4XX_GPIO1       7
+#define IRQ_IXP4XX_PCI_INT     8
+#define IRQ_IXP4XX_PCI_DMA1    9
+#define IRQ_IXP4XX_PCI_DMA2    10
+#define IRQ_IXP4XX_TIMER2      11
+#define IRQ_IXP4XX_USB         12
+#define IRQ_IXP4XX_UART2       13
+#define IRQ_IXP4XX_TIMESTAMP   14
+#define IRQ_IXP4XX_UART1       15
+#define IRQ_IXP4XX_WDOG                16
+#define IRQ_IXP4XX_AHB_PMU     17
+#define IRQ_IXP4XX_XSCALE_PMU  18
+#define IRQ_IXP4XX_GPIO2       19
+#define IRQ_IXP4XX_GPIO3       20
+#define IRQ_IXP4XX_GPIO4       21
+#define IRQ_IXP4XX_GPIO5       22
+#define IRQ_IXP4XX_GPIO6       23
+#define IRQ_IXP4XX_GPIO7       24
+#define IRQ_IXP4XX_GPIO8       25
+#define IRQ_IXP4XX_GPIO9       26
+#define IRQ_IXP4XX_GPIO10      27
+#define IRQ_IXP4XX_GPIO11      28
+#define IRQ_IXP4XX_GPIO12      29
+#define IRQ_IXP4XX_SW_INT1     30
+#define IRQ_IXP4XX_SW_INT2     31
+
+#define        XSCALE_PMU_IRQ          (IRQ_IXP4XX_XSCALE_PMU)
+
+/*
+ * IXDP425 board IRQs
+ */
+#define        IRQ_IXDP425_PCI_INTA    IRQ_IXP4XX_GPIO11
+#define        IRQ_IXDP425_PCI_INTB    IRQ_IXP4XX_GPIO10
+#define        IRQ_IXDP425_PCI_INTC    IRQ_IXP4XX_GPIO9
+#define        IRQ_IXDP425_PCI_INTD    IRQ_IXP4XX_GPIO8
+
+/*
+ * PrPMC1100 Board IRQs
+ */
+#define        IRQ_PRPMC1100_PCI_INTA  IRQ_IXP4XX_GPIO11
+#define        IRQ_PRPMC1100_PCI_INTB  IRQ_IXP4XX_GPIO10
+#define        IRQ_PRPMC1100_PCI_INTC  IRQ_IXP4XX_GPIO9
+#define        IRQ_PRPMC1100_PCI_INTD  IRQ_IXP4XX_GPIO8
+
+/*
+ * ADI Coyote Board IRQs
+ */
+#define        IRQ_COYOTE_PCI_SLOT0    IRQ_IXP4XX_GPIO6
+#define        IRQ_COYOTE_PCI_SLOT1    IRQ_IXP4XX_GPIO11
+#define        IRQ_COYOTE_IDE          IRQ_IXP4XX_GPIO5
+
+#endif
diff --git a/include/asm-arm/arch-ixp4xx/ixdp425.h b/include/asm-arm/arch-ixp4xx/ixdp425.h
new file mode 100644 (file)
index 0000000..7d21bf9
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * include/asm-arm/arch-ixp4xx/ixdp425.h
+ *
+ * IXDP425 platform specific definitions
+ *
+ * Author: Deepak Saxena <dsaxena@plexity.net>
+ *
+ * Copyright 2004 (c) MontaVista, Software, Inc. 
+ * 
+ * This file is licensed under  the terms of the GNU General Public 
+ * License version 2. This program is licensed "as is" without any 
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H__
+#error "Do not include this directly, instead #include <asm/hardware.h>"
+#endif
+
+#define        IXDP425_FLASH_BASE      IXP4XX_EXP_BUS_CS0_BASE_PHYS
+#define        IXDP425_FLASH_SIZE      IXP4XX_EXP_BUS_CSX_REGION_SIZE
+
+#define        IXDP425_SDA_PIN         7
+#define        IXDP425_SCL_PIN         6
+
+/*
+ * IXDP425 PCI IRQs
+ */
+#define IXDP425_PCI_MAX_DEV    4
+#define IXDP425_PCI_IRQ_LINES  4
+
+
+/* PCI controller GPIO to IRQ pin mappings */
+#define IXDP425_PCI_INTA_PIN   11
+#define IXDP425_PCI_INTB_PIN   10
+#define        IXDP425_PCI_INTC_PIN    9
+#define        IXDP425_PCI_INTD_PIN    8
+
+
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
new file mode 100644 (file)
index 0000000..b5810b2
--- /dev/null
@@ -0,0 +1,551 @@
+/*
+ * include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
+ *
+ * Register definitions for IXP4xx chipset. This file contains 
+ * register location and bit definitions only. Platform specific 
+ * definitions and helper function declarations are in platform.h 
+ * and machine-name.h.
+ *
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H__
+#error "Do not include this directly, instead #include <asm/hardware.h>"
+#endif
+
+#ifndef _ASM_ARM_IXP4XX_H_
+#define _ASM_ARM_IXP4XX_H_
+
+/*
+ * IXP4xx Linux Memory Map:
+ *
+ * Phy         Size            Virt            Description
+ * =========================================================================
+ *
+ * 0x00000000  0x10000000(max) PAGE_OFFSET     System RAM
+ *
+ * 0x48000000  0x04000000      ioremap'd       PCI Memory Space
+ *
+ * 0x50000000  0x10000000      ioremap'd       EXP BUS
+ *
+ * 0x6000000   0x00004000      ioremap'd       QMgr
+ *
+ * 0xC0000000  0x00001000      0xffbfe000      PCI CFG 
+ *
+ * 0xC4000000  0x00001000      0xffbfd000      EXP CFG 
+ *
+ * 0xC8000000  0x0000C000      0xffbf2000      On-Chip Peripherals
+ */
+
+
+/*
+ * Expansion BUS Configuration registers
+ */
+#define IXP4XX_EXP_CFG_BASE_PHYS       (0xC4000000)
+#define IXP4XX_EXP_CFG_BASE_VIRT       (0xFFBFD000)
+#define IXP4XX_EXP_CFG_REGION_SIZE     (0x00001000)
+
+/*
+ * PCI Config registers
+ */
+#define IXP4XX_PCI_CFG_BASE_PHYS       (0xC0000000)
+#define        IXP4XX_PCI_CFG_BASE_VIRT        (0xFFBFD000)
+#define IXP4XX_PCI_CFG_REGION_SIZE     (0x00001000)
+
+/*
+ * Peripheral space
+ */
+#define IXP4XX_PERIPHERAL_BASE_PHYS    (0xC8000000)
+#define IXP4XX_PERIPHERAL_BASE_VIRT    (0xFFBF2000)
+#define IXP4XX_PERIPHERAL_REGION_SIZE  (0x0000C000)
+
+#define IXP4XX_EXP_CS0_OFFSET  0x00
+#define IXP4XX_EXP_CS1_OFFSET   0x04
+#define IXP4XX_EXP_CS2_OFFSET   0x08
+#define IXP4XX_EXP_CS3_OFFSET   0x0C
+#define IXP4XX_EXP_CS4_OFFSET   0x10
+#define IXP4XX_EXP_CS5_OFFSET   0x14
+#define IXP4XX_EXP_CS6_OFFSET   0x18
+#define IXP4XX_EXP_CS7_OFFSET   0x1C
+#define IXP4XX_EXP_CFG0_OFFSET 0x20
+#define IXP4XX_EXP_CFG1_OFFSET 0x24
+#define IXP4XX_EXP_CFG2_OFFSET 0x28
+#define IXP4XX_EXP_CFG3_OFFSET 0x2C
+
+/*
+ * Expansion Bus Controller registers.
+ */
+#define IXP4XX_EXP_REG(x) ((volatile u32 *)(IXP4XX_EXP_CFG_BASE_VIRT+(x)))
+
+#define IXP4XX_EXP_CS0      IXP4XX_EXP_REG(IXP4XX_EXP_CS0_OFFSET)
+#define IXP4XX_EXP_CS1      IXP4XX_EXP_REG(IXP4XX_EXP_CS1_OFFSET)
+#define IXP4XX_EXP_CS2      IXP4XX_EXP_REG(IXP4XX_EXP_CS2_OFFSET) 
+#define IXP4XX_EXP_CS3      IXP4XX_EXP_REG(IXP4XX_EXP_CS3_OFFSET)
+#define IXP4XX_EXP_CS4      IXP4XX_EXP_REG(IXP4XX_EXP_CS4_OFFSET)
+#define IXP4XX_EXP_CS5      IXP4XX_EXP_REG(IXP4XX_EXP_CS5_OFFSET)
+#define IXP4XX_EXP_CS6      IXP4XX_EXP_REG(IXP4XX_EXP_CS6_OFFSET)     
+#define IXP4XX_EXP_CS7      IXP4XX_EXP_REG(IXP4XX_EXP_CS7_OFFSET)
+
+#define IXP4XX_EXP_CFG0     IXP4XX_EXP_REG(IXP4XX_EXP_CFG0_OFFSET) 
+#define IXP4XX_EXP_CFG1     IXP4XX_EXP_REG(IXP4XX_EXP_CFG1_OFFSET) 
+#define IXP4XX_EXP_CFG2     IXP4XX_EXP_REG(IXP4XX_EXP_CFG2_OFFSET) 
+#define IXP4XX_EXP_CFG3     IXP4XX_EXP_REG(IXP4XX_EXP_CFG3_OFFSET)
+
+
+/*
+ * Peripheral Space Register Region Base Addresses
+ */
+#define IXP4XX_UART1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x0000)
+#define IXP4XX_UART2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x1000)
+#define IXP4XX_PMU_BASE_PHYS   (IXP4XX_PERIPHERAL_BASE_PHYS + 0x2000)
+#define IXP4XX_INTC_BASE_PHYS  (IXP4XX_PERIPHERAL_BASE_PHYS + 0x3000)
+#define IXP4XX_GPIO_BASE_PHYS  (IXP4XX_PERIPHERAL_BASE_PHYS + 0x4000)
+#define IXP4XX_TIMER_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x5000)
+#define IXP4XX_USB_BASE_PHYS   (IXP4XX_PERIPHERAL_BASE_PHYS + 0x5000)
+
+#define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000)
+#define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000)
+#define IXP4XX_PMU_BASE_VIRT   (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000)
+#define IXP4XX_INTC_BASE_VIRT  (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000)
+#define IXP4XX_GPIO_BASE_VIRT  (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000)
+#define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000)
+#define IXP4XX_USB_BASE_VIRT   (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000)
+
+/*
+ * Constants to make it easy to access  Interrupt Controller registers
+ */
+#define IXP4XX_ICPR_OFFSET     0x00 /* Interrupt Status */
+#define IXP4XX_ICMR_OFFSET     0x04 /* Interrupt Enable */
+#define IXP4XX_ICLR_OFFSET     0x08 /* Interrupt IRQ/FIQ Select */
+#define IXP4XX_ICIP_OFFSET      0x0C /* IRQ Status */
+#define IXP4XX_ICFP_OFFSET     0x10 /* FIQ Status */
+#define IXP4XX_ICHR_OFFSET     0x14 /* Interrupt Priority */
+#define IXP4XX_ICIH_OFFSET     0x18 /* IRQ Highest Pri Int */
+#define IXP4XX_ICFH_OFFSET     0x1C /* FIQ Highest Pri Int */
+
+/*
+ * Interrupt Controller Register Definitions.
+ */
+
+#define IXP4XX_INTC_REG(x) ((volatile u32 *)(IXP4XX_INTC_BASE_VIRT+(x)))
+
+#define IXP4XX_ICPR    IXP4XX_INTC_REG(IXP4XX_ICPR_OFFSET)
+#define IXP4XX_ICMR     IXP4XX_INTC_REG(IXP4XX_ICMR_OFFSET)
+#define IXP4XX_ICLR     IXP4XX_INTC_REG(IXP4XX_ICLR_OFFSET)
+#define IXP4XX_ICIP     IXP4XX_INTC_REG(IXP4XX_ICIP_OFFSET)
+#define IXP4XX_ICFP     IXP4XX_INTC_REG(IXP4XX_ICFP_OFFSET)
+#define IXP4XX_ICHR     IXP4XX_INTC_REG(IXP4XX_ICHR_OFFSET)
+#define IXP4XX_ICIH     IXP4XX_INTC_REG(IXP4XX_ICIH_OFFSET) 
+#define IXP4XX_ICFH     IXP4XX_INTC_REG(IXP4XX_ICFH_OFFSET)
+                                                                                
+/*
+ * Constants to make it easy to access GPIO registers
+ */
+#define IXP4XX_GPIO_GPOUTR_OFFSET       0x00
+#define IXP4XX_GPIO_GPOER_OFFSET        0x04
+#define IXP4XX_GPIO_GPINR_OFFSET        0x08
+#define IXP4XX_GPIO_GPISR_OFFSET        0x0C
+#define IXP4XX_GPIO_GPIT1R_OFFSET      0x10
+#define IXP4XX_GPIO_GPIT2R_OFFSET      0x14
+#define IXP4XX_GPIO_GPCLKR_OFFSET      0x18
+#define IXP4XX_GPIO_GPDBSELR_OFFSET    0x1C
+
+/* 
+ * GPIO Register Definitions.
+ * [Only perform 32bit reads/writes]
+ */
+#define IXP4XX_GPIO_REG(x) ((volatile u32 *)(IXP4XX_GPIO_BASE_VIRT+(x)))
+
+#define IXP4XX_GPIO_GPOUTR     IXP4XX_GPIO_REG(IXP4XX_GPIO_GPOUTR_OFFSET)
+#define IXP4XX_GPIO_GPOER       IXP4XX_GPIO_REG(IXP4XX_GPIO_GPOER_OFFSET)
+#define IXP4XX_GPIO_GPINR       IXP4XX_GPIO_REG(IXP4XX_GPIO_GPINR_OFFSET)
+#define IXP4XX_GPIO_GPISR       IXP4XX_GPIO_REG(IXP4XX_GPIO_GPISR_OFFSET)
+#define IXP4XX_GPIO_GPIT1R      IXP4XX_GPIO_REG(IXP4XX_GPIO_GPIT1R_OFFSET)
+#define IXP4XX_GPIO_GPIT2R      IXP4XX_GPIO_REG(IXP4XX_GPIO_GPIT2R_OFFSET)
+#define IXP4XX_GPIO_GPCLKR      IXP4XX_GPIO_REG(IXP4XX_GPIO_GPCLKR_OFFSET)
+#define IXP4XX_GPIO_GPDBSELR    IXP4XX_GPIO_REG(IXP4XX_GPIO_GPDBSELR_OFFSET)
+
+/*
+ * GPIO register bit definitions
+ */
+
+/* Interrupt styles
+ */
+#define IXP4XX_GPIO_STYLE_ACTIVE_HIGH  0x0
+#define IXP4XX_GPIO_STYLE_ACTIVE_LOW   0x1
+#define IXP4XX_GPIO_STYLE_RISING_EDGE  0x2
+#define IXP4XX_GPIO_STYLE_FALLING_EDGE 0x3
+#define IXP4XX_GPIO_STYLE_TRANSITIONAL 0x4
+
+/* 
+ * Mask used to clear interrupt styles 
+ */
+#define IXP4XX_GPIO_STYLE_CLEAR                0x7
+#define IXP4XX_GPIO_STYLE_SIZE         3
+
+/*
+ * Constants to make it easy to access Timer Control/Status registers
+ */
+#define IXP4XX_OSTS_OFFSET     0x00  /* Continious TimeStamp */
+#define IXP4XX_OST1_OFFSET     0x04  /* Timer 1 Timestamp */
+#define IXP4XX_OSRT1_OFFSET    0x08  /* Timer 1 Reload */
+#define IXP4XX_OST2_OFFSET     0x0C  /* Timer 2 Timestamp */
+#define IXP4XX_OSRT2_OFFSET    0x10  /* Timer 2 Reload */
+#define IXP4XX_OSWT_OFFSET     0x14  /* Watchdog Timer */
+#define IXP4XX_OSWE_OFFSET     0x18  /* Watchdog Enable */
+#define IXP4XX_OSWK_OFFSET     0x1C  /* Watchdog Key */
+#define IXP4XX_OSST_OFFSET     0x20  /* Timer Status */
+
+/*
+ * Operating System Timer Register Definitions.
+ */
+
+#define IXP4XX_TIMER_REG(x) ((volatile u32 *)(IXP4XX_TIMER_BASE_VIRT+(x)))
+
+#define IXP4XX_OSTS    IXP4XX_TIMER_REG(IXP4XX_OSTS_OFFSET)
+#define IXP4XX_OST1    IXP4XX_TIMER_REG(IXP4XX_OST1_OFFSET)
+#define IXP4XX_OSRT1   IXP4XX_TIMER_REG(IXP4XX_OSRT1_OFFSET)
+#define IXP4XX_OST2    IXP4XX_TIMER_REG(IXP4XX_OST2_OFFSET)
+#define IXP4XX_OSRT2   IXP4XX_TIMER_REG(IXP4XX_OSRT2_OFFSET)
+#define IXP4XX_OSWT    IXP4XX_TIMER_REG(IXP4XX_OSWT_OFFSET)
+#define IXP4XX_OSWE    IXP4XX_TIMER_REG(IXP4XX_OSWE_OFFSET)
+#define IXP4XX_OSWK    IXP4XX_TIMER_REG(IXP4XX_OSWK_OFFSET)
+#define IXP4XX_OSST    IXP4XX_TIMER_REG(IXP4XX_OSST_OFFSET)
+
+/*
+ * Timer register values and bit definitions 
+ */
+#define IXP4XX_OST_ENABLE              0x00000001
+#define IXP4XX_OST_ONE_SHOT            0x00000002
+/* Low order bits of reload value ignored */
+#define IXP4XX_OST_RELOAD_MASK         0x00000003
+#define IXP4XX_OST_DISABLED            0x00000000
+#define IXP4XX_OSST_TIMER_1_PEND       0x00000001
+#define IXP4XX_OSST_TIMER_2_PEND       0x00000002
+#define IXP4XX_OSST_TIMER_TS_PEND      0x00000004
+#define IXP4XX_OSST_TIMER_WDOG_PEND    0x00000008
+#define IXP4XX_OSST_TIMER_WARM_RESET   0x00000010
+
+#define        IXP4XX_WDT_KEY                  0x0000482E
+
+#define        IXP4XX_WDT_RESET_ENABLE         0x00000001
+#define        IXP4XX_WDT_IRQ_ENABLE           0x00000002
+#define        IXP4XX_WDT_COUNT_ENABLE         0x00000004
+
+
+/*
+ * Constants to make it easy to access PCI Control/Status registers
+ */
+#define PCI_NP_AD_OFFSET            0x00
+#define PCI_NP_CBE_OFFSET           0x04
+#define PCI_NP_WDATA_OFFSET         0x08
+#define PCI_NP_RDATA_OFFSET         0x0c
+#define PCI_CRP_AD_CBE_OFFSET       0x10
+#define PCI_CRP_WDATA_OFFSET        0x14
+#define PCI_CRP_RDATA_OFFSET        0x18
+#define PCI_CSR_OFFSET              0x1c
+#define PCI_ISR_OFFSET              0x20
+#define PCI_INTEN_OFFSET            0x24
+#define PCI_DMACTRL_OFFSET          0x28
+#define PCI_AHBMEMBASE_OFFSET       0x2c
+#define PCI_AHBIOBASE_OFFSET        0x30
+#define PCI_PCIMEMBASE_OFFSET       0x34
+#define PCI_AHBDOORBELL_OFFSET      0x38
+#define PCI_PCIDOORBELL_OFFSET      0x3C
+#define PCI_ATPDMA0_AHBADDR_OFFSET  0x40
+#define PCI_ATPDMA0_PCIADDR_OFFSET  0x44
+#define PCI_ATPDMA0_LENADDR_OFFSET  0x48
+#define PCI_ATPDMA1_AHBADDR_OFFSET  0x4C
+#define PCI_ATPDMA1_PCIADDR_OFFSET  0x50
+#define PCI_ATPDMA1_LENADDR_OFFSET     0x54
+
+/*
+ * PCI Control/Status Registers
+ */
+#define IXP4XX_PCI_CSR(x) ((volatile u32 *)(IXP4XX_PCI_CFG_BASE_VIRT+(x)))
+
+#define PCI_NP_AD               IXP4XX_PCI_CSR(PCI_NP_AD_OFFSET)
+#define PCI_NP_CBE              IXP4XX_PCI_CSR(PCI_NP_CBE_OFFSET)
+#define PCI_NP_WDATA            IXP4XX_PCI_CSR(PCI_NP_WDATA_OFFSET)
+#define PCI_NP_RDATA            IXP4XX_PCI_CSR(PCI_NP_RDATA_OFFSET)
+#define PCI_CRP_AD_CBE          IXP4XX_PCI_CSR(PCI_CRP_AD_CBE_OFFSET)
+#define PCI_CRP_WDATA           IXP4XX_PCI_CSR(PCI_CRP_WDATA_OFFSET)
+#define PCI_CRP_RDATA           IXP4XX_PCI_CSR(PCI_CRP_RDATA_OFFSET)
+#define PCI_CSR                 IXP4XX_PCI_CSR(PCI_CSR_OFFSET) 
+#define PCI_ISR                 IXP4XX_PCI_CSR(PCI_ISR_OFFSET)
+#define PCI_INTEN               IXP4XX_PCI_CSR(PCI_INTEN_OFFSET)
+#define PCI_DMACTRL             IXP4XX_PCI_CSR(PCI_DMACTRL_OFFSET)
+#define PCI_AHBMEMBASE          IXP4XX_PCI_CSR(PCI_AHBMEMBASE_OFFSET)
+#define PCI_AHBIOBASE           IXP4XX_PCI_CSR(PCI_AHBIOBASE_OFFSET)
+#define PCI_PCIMEMBASE          IXP4XX_PCI_CSR(PCI_PCIMEMBASE_OFFSET)
+#define PCI_AHBDOORBELL         IXP4XX_PCI_CSR(PCI_AHBDOORBELL_OFFSET)
+#define PCI_PCIDOORBELL         IXP4XX_PCI_CSR(PCI_PCIDOORBELL_OFFSET)
+#define PCI_ATPDMA0_AHBADDR     IXP4XX_PCI_CSR(PCI_ATPDMA0_AHBADDR_OFFSET)
+#define PCI_ATPDMA0_PCIADDR     IXP4XX_PCI_CSR(PCI_ATPDMA0_PCIADDR_OFFSET)
+#define PCI_ATPDMA0_LENADDR     IXP4XX_PCI_CSR(PCI_ATPDMA0_LENADDR_OFFSET)
+#define PCI_ATPDMA1_AHBADDR     IXP4XX_PCI_CSR(PCI_ATPDMA1_AHBADDR_OFFSET)
+#define PCI_ATPDMA1_PCIADDR     IXP4XX_PCI_CSR(PCI_ATPDMA1_PCIADDR_OFFSET)
+#define PCI_ATPDMA1_LENADDR     IXP4XX_PCI_CSR(PCI_ATPDMA1_LENADDR_OFFSET)
+
+/*
+ * PCI register values and bit definitions 
+ */
+
+/* CSR bit definitions */
+#define PCI_CSR_HOST           0x00000001
+#define PCI_CSR_ARBEN          0x00000002
+#define PCI_CSR_ADS            0x00000004
+#define PCI_CSR_PDS            0x00000008
+#define PCI_CSR_ABE            0x00000010
+#define PCI_CSR_DBT            0x00000020
+#define PCI_CSR_ASE            0x00000100
+#define PCI_CSR_IC             0x00008000
+
+/* ISR (Interrupt status) Register bit definitions */
+#define PCI_ISR_PSE            0x00000001
+#define PCI_ISR_PFE            0x00000002
+#define PCI_ISR_PPE            0x00000004
+#define PCI_ISR_AHBE           0x00000008
+#define PCI_ISR_APDC           0x00000010
+#define PCI_ISR_PADC           0x00000020
+#define PCI_ISR_ADB            0x00000040
+#define PCI_ISR_PDB            0x00000080
+
+/* INTEN (Interrupt Enable) Register bit definitions */
+#define PCI_INTEN_PSE          0x00000001
+#define PCI_INTEN_PFE          0x00000002
+#define PCI_INTEN_PPE          0x00000004
+#define PCI_INTEN_AHBE         0x00000008
+#define PCI_INTEN_APDC         0x00000010
+#define PCI_INTEN_PADC         0x00000020
+#define PCI_INTEN_ADB          0x00000040
+#define PCI_INTEN_PDB          0x00000080
+
+/*
+ * Shift value for byte enable on NP cmd/byte enable register
+ */
+#define IXP4XX_PCI_NP_CBE_BESL         4
+
+/*
+ * PCI commands supported by NP access unit
+ */
+#define NP_CMD_IOREAD                  0x2
+#define NP_CMD_IOWRITE                 0x3
+#define NP_CMD_CONFIGREAD              0xa
+#define NP_CMD_CONFIGWRITE             0xb
+#define NP_CMD_MEMREAD                 0x6
+#define        NP_CMD_MEMWRITE                 0x7
+
+/*
+ * Constants for CRP access into local config space
+ */
+#define CRP_AD_CBE_BESL         20
+#define CRP_AD_CBE_WRITE       0x00010000
+
+
+/*
+ * USB Device Controller
+ *
+ * These are used by the USB gadget driver, so they don't follow the
+ * IXP4XX_ naming convetions.
+ *
+ */
+# define IXP4XX_USB_REG(x)       (*((volatile u32 *)(x)))
+
+/* UDC Undocumented - Reserved1 */
+#define UDC_RES1       IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0004)  
+/* UDC Undocumented - Reserved2 */
+#define UDC_RES2       IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0008)  
+/* UDC Undocumented - Reserved3 */
+#define UDC_RES3       IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x000C)  
+/* UDC Control Register */
+#define UDCCR          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0000)  
+/* UDC Endpoint 0 Control/Status Register */
+#define UDCCS0         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0010)  
+/* UDC Endpoint 1 (IN) Control/Status Register */
+#define UDCCS1         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0014)  
+/* UDC Endpoint 2 (OUT) Control/Status Register */
+#define UDCCS2         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0018)  
+/* UDC Endpoint 3 (IN) Control/Status Register */
+#define UDCCS3         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x001C)  
+/* UDC Endpoint 4 (OUT) Control/Status Register */
+#define UDCCS4         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0020)  
+/* UDC Endpoint 5 (Interrupt) Control/Status Register */
+#define UDCCS5         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0024)  
+/* UDC Endpoint 6 (IN) Control/Status Register */
+#define UDCCS6         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0028)  
+/* UDC Endpoint 7 (OUT) Control/Status Register */
+#define UDCCS7         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x002C)  
+/* UDC Endpoint 8 (IN) Control/Status Register */
+#define UDCCS8         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0030)  
+/* UDC Endpoint 9 (OUT) Control/Status Register */
+#define UDCCS9         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0034)  
+/* UDC Endpoint 10 (Interrupt) Control/Status Register */
+#define UDCCS10                IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0038)  
+/* UDC Endpoint 11 (IN) Control/Status Register */
+#define UDCCS11                IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x003C)  
+/* UDC Endpoint 12 (OUT) Control/Status Register */
+#define UDCCS12                IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0040)  
+/* UDC Endpoint 13 (IN) Control/Status Register */
+#define UDCCS13                IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0044)  
+/* UDC Endpoint 14 (OUT) Control/Status Register */
+#define UDCCS14                IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0048)  
+/* UDC Endpoint 15 (Interrupt) Control/Status Register */
+#define UDCCS15                IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x004C)  
+/* UDC Frame Number Register High */
+#define UFNRH          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0060)  
+/* UDC Frame Number Register Low */
+#define UFNRL          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0064)  
+/* UDC Byte Count Reg 2 */
+#define UBCR2          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0068)  
+/* UDC Byte Count Reg 4 */
+#define UBCR4          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x006c)  
+/* UDC Byte Count Reg 7 */
+#define UBCR7          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0070)  
+/* UDC Byte Count Reg 9 */
+#define UBCR9          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0074)  
+/* UDC Byte Count Reg 12 */
+#define UBCR12         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0078)  
+/* UDC Byte Count Reg 14 */
+#define UBCR14         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x007c)  
+/* UDC Endpoint 0 Data Register */
+#define UDDR0          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0080)  
+/* UDC Endpoint 1 Data Register */
+#define UDDR1          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0100)  
+/* UDC Endpoint 2 Data Register */
+#define UDDR2          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0180)  
+/* UDC Endpoint 3 Data Register */
+#define UDDR3          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0200)  
+/* UDC Endpoint 4 Data Register */
+#define UDDR4          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0400)  
+/* UDC Endpoint 5 Data Register */
+#define UDDR5          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x00A0)  
+/* UDC Endpoint 6 Data Register */
+#define UDDR6          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0600)  
+/* UDC Endpoint 7 Data Register */
+#define UDDR7          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0680)  
+/* UDC Endpoint 8 Data Register */
+#define UDDR8          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0700)  
+/* UDC Endpoint 9 Data Register */
+#define UDDR9          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0900)  
+/* UDC Endpoint 10 Data Register */
+#define UDDR10         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x00C0)  
+/* UDC Endpoint 11 Data Register */
+#define UDDR11         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0B00)  
+/* UDC Endpoint 12 Data Register */
+#define UDDR12         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0B80)  
+/* UDC Endpoint 13 Data Register */
+#define UDDR13         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0C00)  
+/* UDC Endpoint 14 Data Register */
+#define UDDR14         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0E00)  
+/* UDC Endpoint 15 Data Register */
+#define UDDR15         IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x00E0)  
+/* UDC Interrupt Control Register 0 */
+#define UICR0          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0050)  
+/* UDC Interrupt Control Register 1 */
+#define UICR1          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0054)  
+/* UDC Status Interrupt Register 0 */
+#define USIR0          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x0058)  
+/* UDC Status Interrupt Register 1 */
+#define USIR1          IXP4XX_USB_REG(IXP4XX_USB_BASE_VIRT+0x005C)  
+
+#define UDCCR_UDE      (1 << 0)        /* UDC enable */
+#define UDCCR_UDA      (1 << 1)        /* UDC active */
+#define UDCCR_RSM      (1 << 2)        /* Device resume */
+#define UDCCR_RESIR    (1 << 3)        /* Resume interrupt request */
+#define UDCCR_SUSIR    (1 << 4)        /* Suspend interrupt request */
+#define UDCCR_SRM      (1 << 5)        /* Suspend/resume interrupt mask */
+#define UDCCR_RSTIR    (1 << 6)        /* Reset interrupt request */
+#define UDCCR_REM      (1 << 7)        /* Reset interrupt mask */
+
+#define UDCCS0_OPR     (1 << 0)        /* OUT packet ready */
+#define UDCCS0_IPR     (1 << 1)        /* IN packet ready */
+#define UDCCS0_FTF     (1 << 2)        /* Flush Tx FIFO */
+#define UDCCS0_DRWF    (1 << 3)        /* Device remote wakeup feature */
+#define UDCCS0_SST     (1 << 4)        /* Sent stall */
+#define UDCCS0_FST     (1 << 5)        /* Force stall */
+#define UDCCS0_RNE     (1 << 6)        /* Receive FIFO no empty */
+#define UDCCS0_SA      (1 << 7)        /* Setup active */
+
+#define UDCCS_BI_TFS   (1 << 0)        /* Transmit FIFO service */
+#define UDCCS_BI_TPC   (1 << 1)        /* Transmit packet complete */
+#define UDCCS_BI_FTF   (1 << 2)        /* Flush Tx FIFO */
+#define UDCCS_BI_TUR   (1 << 3)        /* Transmit FIFO underrun */
+#define UDCCS_BI_SST   (1 << 4)        /* Sent stall */
+#define UDCCS_BI_FST   (1 << 5)        /* Force stall */
+#define UDCCS_BI_TSP   (1 << 7)        /* Transmit short packet */
+
+#define UDCCS_BO_RFS   (1 << 0)        /* Receive FIFO service */
+#define UDCCS_BO_RPC   (1 << 1)        /* Receive packet complete */
+#define UDCCS_BO_DME   (1 << 3)        /* DMA enable */
+#define UDCCS_BO_SST   (1 << 4)        /* Sent stall */
+#define UDCCS_BO_FST   (1 << 5)        /* Force stall */
+#define UDCCS_BO_RNE   (1 << 6)        /* Receive FIFO not empty */
+#define UDCCS_BO_RSP   (1 << 7)        /* Receive short packet */
+
+#define UDCCS_II_TFS   (1 << 0)        /* Transmit FIFO service */
+#define UDCCS_II_TPC   (1 << 1)        /* Transmit packet complete */
+#define UDCCS_II_FTF   (1 << 2)        /* Flush Tx FIFO */
+#define UDCCS_II_TUR   (1 << 3)        /* Transmit FIFO underrun */
+#define UDCCS_II_TSP   (1 << 7)        /* Transmit short packet */
+
+#define UDCCS_IO_RFS   (1 << 0)        /* Receive FIFO service */
+#define UDCCS_IO_RPC   (1 << 1)        /* Receive packet complete */
+#define UDCCS_IO_ROF   (1 << 3)        /* Receive overflow */
+#define UDCCS_IO_DME   (1 << 3)        /* DMA enable */
+#define UDCCS_IO_RNE   (1 << 6)        /* Receive FIFO not empty */
+#define UDCCS_IO_RSP   (1 << 7)        /* Receive short packet */
+
+#define UDCCS_INT_TFS  (1 << 0)        /* Transmit FIFO service */
+#define UDCCS_INT_TPC  (1 << 1)        /* Transmit packet complete */
+#define UDCCS_INT_FTF  (1 << 2)        /* Flush Tx FIFO */
+#define UDCCS_INT_TUR  (1 << 3)        /* Transmit FIFO underrun */
+#define UDCCS_INT_SST  (1 << 4)        /* Sent stall */
+#define UDCCS_INT_FST  (1 << 5)        /* Force stall */
+#define UDCCS_INT_TSP  (1 << 7)        /* Transmit short packet */
+
+#define UICR0_IM0      (1 << 0)        /* Interrupt mask ep 0 */
+#define UICR0_IM1      (1 << 1)        /* Interrupt mask ep 1 */
+#define UICR0_IM2      (1 << 2)        /* Interrupt mask ep 2 */
+#define UICR0_IM3      (1 << 3)        /* Interrupt mask ep 3 */
+#define UICR0_IM4      (1 << 4)        /* Interrupt mask ep 4 */
+#define UICR0_IM5      (1 << 5)        /* Interrupt mask ep 5 */
+#define UICR0_IM6      (1 << 6)        /* Interrupt mask ep 6 */
+#define UICR0_IM7      (1 << 7)        /* Interrupt mask ep 7 */
+
+#define UICR1_IM8      (1 << 0)        /* Interrupt mask ep 8 */
+#define UICR1_IM9      (1 << 1)        /* Interrupt mask ep 9 */
+#define UICR1_IM10     (1 << 2)        /* Interrupt mask ep 10 */
+#define UICR1_IM11     (1 << 3)        /* Interrupt mask ep 11 */
+#define UICR1_IM12     (1 << 4)        /* Interrupt mask ep 12 */
+#define UICR1_IM13     (1 << 5)        /* Interrupt mask ep 13 */
+#define UICR1_IM14     (1 << 6)        /* Interrupt mask ep 14 */
+#define UICR1_IM15     (1 << 7)        /* Interrupt mask ep 15 */
+
+#define USIR0_IR0      (1 << 0)        /* Interrup request ep 0 */
+#define USIR0_IR1      (1 << 1)        /* Interrup request ep 1 */
+#define USIR0_IR2      (1 << 2)        /* Interrup request ep 2 */
+#define USIR0_IR3      (1 << 3)        /* Interrup request ep 3 */
+#define USIR0_IR4      (1 << 4)        /* Interrup request ep 4 */
+#define USIR0_IR5      (1 << 5)        /* Interrup request ep 5 */
+#define USIR0_IR6      (1 << 6)        /* Interrup request ep 6 */
+#define USIR0_IR7      (1 << 7)        /* Interrup request ep 7 */
+
+#define USIR1_IR8      (1 << 0)        /* Interrup request ep 8 */
+#define USIR1_IR9      (1 << 1)        /* Interrup request ep 9 */
+#define USIR1_IR10     (1 << 2)        /* Interrup request ep 10 */
+#define USIR1_IR11     (1 << 3)        /* Interrup request ep 11 */
+#define USIR1_IR12     (1 << 4)        /* Interrup request ep 12 */
+#define USIR1_IR13     (1 << 5)        /* Interrup request ep 13 */
+#define USIR1_IR14     (1 << 6)        /* Interrup request ep 14 */
+#define USIR1_IR15     (1 << 7)        /* Interrup request ep 15 */
+
+#define DCMD_LENGTH    0x01fff         /* length mask (max = 8K - 1) */
+
+#endif
diff --git a/include/asm-arm/arch-ixp4xx/prpmc1100.h b/include/asm-arm/arch-ixp4xx/prpmc1100.h
new file mode 100644 (file)
index 0000000..e2532ab
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * include/asm-arm/arch-ixp4xx/prpmc1100.h
+ *
+ * Motorolla PrPMC1100 platform specific definitions
+ *
+ * Author: Deepak Saxena <dsaxena@plexity.net>
+ *
+ * Copyright 2004 (c) MontaVista, Software, Inc. 
+ * 
+ * This file is licensed under  the terms of the GNU General Public 
+ * License version 2. This program is licensed "as is" without any 
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H__
+#error "Do not include this directly, instead #include <asm/hardware.h>"
+#endif
+
+#define        PRPMC1100_FLASH_BASE    IXP4XX_EXP_BUS_CS0_BASE_PHYS
+#define        PRPMC1100_FLASH_SIZE    IXP4XX_EXP_BUS_CSX_REGION_SIZE
+
+#define        PRPMC1100_PCI_MIN_DEVID 10
+#define        PRPMC1100_PCI_MAX_DEVID 16
+#define        PRPMC1100_PCI_IRQ_LINES 4
+
+
+/* PCI controller GPIO to IRQ pin mappings */
+#define PRPMC1100_PCI_INTA_PIN 11
+#define PRPMC1100_PCI_INTB_PIN 10
+#define        PRPMC1100_PCI_INTC_PIN  9
+#define        PRPMC1100_PCI_INTD_PIN  8
+
+
diff --git a/include/asm-arm/arch-ixp4xx/timex.h b/include/asm-arm/arch-ixp4xx/timex.h
new file mode 100644 (file)
index 0000000..38c9d77
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * linux/include/asm-arm/arch-ixp4xx/timex.h
+ * 
+ */
+
+#include <asm/hardware.h>
+
+/*
+ * We use IXP425 General purpose timer for our timer needs, it runs at 
+ * 66.66... MHz
+ */
+#define CLOCK_TICK_RATE (66666666)
+
diff --git a/include/asm-arm/arch-ixp4xx/vmalloc.h b/include/asm-arm/arch-ixp4xx/vmalloc.h
new file mode 100644 (file)
index 0000000..da46e56
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * linux/include/asm-arm/arch-ixp4xx/vmalloc.h
+ */
+
+/*
+ * Just any arbitrary offset to the start of the vmalloc VM area: the
+ * current 8MB value just means that there will be a 8MB "hole" after the
+ * physical memory until the kernel virtual memory starts.  That means that
+ * any out-of-bounds memory accesses will hopefully be caught.
+ * The vmalloc() routines leaves a hole of 4kB between each vmalloced
+ * area for the same reason. ;)
+ */
+#define VMALLOC_OFFSET   (8*1024*1024)
+#define VMALLOC_START    (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
+#define VMALLOC_VMADDR(x) ((unsigned long)(x))
+#define VMALLOC_END       (0xFF000000)
+
diff --git a/include/asm-arm/arch-pxa/mainstone.h b/include/asm-arm/arch-pxa/mainstone.h
new file mode 100644 (file)
index 0000000..14c862a
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ *  linux/include/asm-arm/arch-pxa/mainstone.h
+ *
+ *  Author:    Nicolas Pitre
+ *  Created:   Nov 14, 2002
+ *  Copyright: MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef ASM_ARCH_MAINSTONE_H
+#define ASM_ARCH_MAINSTONE_H
+
+#define MST_ETH_PHYS           PXA_CS4_PHYS
+
+#define MST_FPGA_PHYS          PXA_CS2_PHYS
+#define MST_FPGA_VIRT          (0xf0000000)
+#define MST_P2V(x)             ((x) - MST_FPGA_PHYS + MST_FPGA_VIRT)
+#define MST_V2P(x)             ((x) - MST_FPGA_VIRT + MST_FPGA_PHYS)
+
+#ifndef __ASSEMBLY__
+# define __MST_REG(x)          (*((volatile unsigned long *)MST_P2V(x)))
+#else
+# define __MST_REG(x)          MST_P2V(x)
+#endif
+
+/* board level registers in the FPGA */
+
+#define MST_LEDDAT1            __MST_REG(0x08000010)
+#define MST_LEDDAT2            __MST_REG(0x08000014)
+#define MST_LEDCTRL            __MST_REG(0x08000040)
+#define MST_GPSWR              __MST_REG(0x08000060)
+#define MST_MSCWR1             __MST_REG(0x08000080)
+#define MST_MSCWR2             __MST_REG(0x08000084)
+#define MST_MSCWR3             __MST_REG(0x08000088)
+#define MST_MSCRD              __MST_REG(0x08000090)
+#define MST_INTMSKENA          __MST_REG(0x080000c0)
+#define MST_INTSETCLR          __MST_REG(0x080000d0)
+#define MST_PCMCIA0            __MST_REG(0x080000e0)
+#define MST_PCMCIA1            __MST_REG(0x080000e4)
+
+#define MST_MSCWR1_CAMERA_ON   (1 << 15)  /* Camera interface power control */
+#define MST_MSCWR1_CAMERA_SEL  (1 << 14)  /* Camera interface mux control */
+#define MST_MSCWR1_LCD_CTL     (1 << 13)  /* General-purpose LCD control */
+#define MST_MSCWR1_MS_ON       (1 << 12)  /* Memory Stick power control */
+#define MST_MSCWR1_MMC_ON      (1 << 11)  /* MultiMediaCard* power control */
+#define MST_MSCWR1_MS_SEL      (1 << 10)  /* SD/MS multiplexer control */
+#define MST_MSCWR1_BB_SEL      (1 << 9)   /* PCMCIA/Baseband multiplexer */
+#define MST_MSCWR1_BT_ON       (1 << 8)   /* Bluetooth UART transceiver */
+#define MST_MSCWR1_BTDTR       (1 << 7)   /* Bluetooth UART DTR */
+
+#define MST_MSCWR1_IRDA_MASK   (3 << 5)   /* IrDA transceiver mode */
+#define MST_MSCWR1_IRDA_FULL   (0 << 5)   /* full distance power */
+#define MST_MSCWR1_IRDA_OFF    (1 << 5)   /* shutdown */
+#define MST_MSCWR1_IRDA_MED    (2 << 5)   /* 2/3 distance power */
+#define MST_MSCWR1_IRDA_LOW    (3 << 5)   /* 1/3 distance power */
+
+#define MST_MSCWR1_IRDA_FIR    (1 << 4)   /* IrDA transceiver SIR/FIR */
+#define MST_MSCWR1_GREENLED    (1 << 3)   /* LED D1 control */
+#define MST_MSCWR1_PDC_CTL     (1 << 2)   /* reserved */
+#define MST_MSCWR1_MTR_ON      (1 << 1)   /* Silent alert motor */
+#define MST_MSCWR1_SYSRESET    (1 << 0)   /* System reset */
+
+#define MST_MSCWR2_USB_OTG_RST (1 << 6)   /* USB On The Go reset */
+#define MST_MSCWR2_USB_OTG_SEL (1 << 5)   /* USB On The Go control */
+#define MST_MSCWR2_nUSBC_SC    (1 << 4)   /* USB client soft connect control */
+#define MST_MSCWR2_I2S_SPKROFF (1 << 3)   /* I2S CODEC amplifier control */
+#define MST_MSCWR2_AC97_SPKROFF        (1 << 2)   /* AC97 CODEC amplifier control */
+#define MST_MSCWR2_RADIO_PWR   (1 << 1)   /* Radio module power control */
+#define MST_MSCWR2_RADIO_WAKE  (1 << 0)   /* Radio module wake-up signal */
+
+#define MST_MSCWR3_GPIO_RESET_EN       (1 << 2) /* Enable GPIO Reset */
+#define MST_MSCWR3_GPIO_RESET          (1 << 1) /* Initiate a GPIO Reset */
+#define MST_MSCWR3_COMMS_SW_RESET      (1 << 0) /* Communications Processor Reset Control */
+
+#define MST_MSCRD_nPENIRQ      (1 << 9)   /* ADI7873* nPENIRQ signal */
+#define MST_MSCRD_nMEMSTK_CD   (1 << 8)   /* Memory Stick detection signal */
+#define MST_MSCRD_nMMC_CD      (1 << 7)   /* SD/MMC card detection signal */
+#define MST_MSCRD_nUSIM_CD     (1 << 6)   /* USIM card detection signal */
+#define MST_MSCRD_USB_CBL      (1 << 5)   /* USB client cable status */
+#define MST_MSCRD_TS_BUSY      (1 << 4)   /* ADI7873 busy */
+#define MST_MSCRD_BTDSR                (1 << 3)   /* Bluetooth UART DSR */
+#define MST_MSCRD_BTRI         (1 << 2)   /* Bluetooth UART Ring Indicator */
+#define MST_MSCRD_BTDCD                (1 << 1)   /* Bluetooth UART DCD */
+#define MST_MSCRD_nMMC_WP      (1 << 0)   /* SD/MMC write-protect status */
+
+#define MST_INT_S1_IRQ         (1 << 15)  /* PCMCIA socket 1 IRQ */
+#define MST_INT_S1_STSCHG      (1 << 14)  /* PCMCIA socket 1 status changed */
+#define MST_INT_S1_CD          (1 << 13)  /* PCMCIA socket 1 card detection */
+#define MST_INT_S0_IRQ         (1 << 11)  /* PCMCIA socket 0 IRQ */
+#define MST_INT_S0_STSCHG      (1 << 10)  /* PCMCIA socket 0 status changed */
+#define MST_INT_S0_CD          (1 << 9)   /* PCMCIA socket 0 card detection */
+#define MST_INT_nEXBRD_INT     (1 << 7)   /* Expansion board IRQ */
+#define MST_INT_MSINS          (1 << 6)   /* Memory Stick* detection */
+#define MST_INT_PENIRQ         (1 << 5)   /* ADI7873* touch-screen IRQ */
+#define MST_INT_AC97           (1 << 4)   /* AC'97 CODEC IRQ */
+#define MST_INT_ETHERNET       (1 << 3)   /* Ethernet controller IRQ */
+#define MST_INT_USBC           (1 << 2)   /* USB client cable detection IRQ */
+#define MST_INT_USIM           (1 << 1)   /* USIM card detection IRQ */
+#define MST_INT_MMC            (1 << 0)   /* MMC/SD card detection IRQ */
+
+#define MST_PCMCIA_nIRQ                (1 << 10)  /* IRQ / ready signal */
+#define MST_PCMCIA_nSPKR_BVD2  (1 << 9)   /* VDD sense / digital speaker */
+#define MST_PCMCIA_nSTSCHG_BVD1        (1 << 8)   /* VDD sense / card status changed */
+#define MST_PCMCIA_nVS2                (1 << 7)   /* VSS voltage sense */
+#define MST_PCMCIA_nVS1                (1 << 6)   /* VSS voltage sense */
+#define MST_PCMCIA_nCD         (1 << 5)   /* Card detection signal */
+#define MST_PCMCIA_RESET       (1 << 4)   /* Card reset signal */
+#define MST_PCMCIA_PWR_MASK    (0x000f)   /* MAX1602 power-supply controls */
+
+#define MST_PCMCIA_PWR_VPP_0    0x0       /* voltage VPP = 0V */
+#define MST_PCMCIA_PWR_VPP_120  0x2       /* voltage VPP = 12V*/
+#define MST_PCMCIA_PWR_VPP_VCC  0x1       /* voltage VPP = VCC */
+#define MST_PCMCIA_PWR_VCC_0    0x0       /* voltage VCC = 0V */
+#define MST_PCMCIA_PWR_VCC_33   0x8       /* voltage VCC = 3.3V */
+#define MST_PCMCIA_PWR_VCC_50   0x4       /* voltage VCC = 5.0V */
+
+#endif
diff --git a/include/asm-i386/8253pit.h b/include/asm-i386/8253pit.h
new file mode 100644 (file)
index 0000000..96c7c35
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * 8253/8254 Programmable Interval Timer
+ */
+
+#ifndef _8253PIT_H
+#define _8253PIT_H
+
+#include <asm/timex.h>
+
+#define PIT_TICK_RATE  CLOCK_TICK_RATE
+
+#endif
diff --git a/include/asm-i386/atomic_kmap.h b/include/asm-i386/atomic_kmap.h
new file mode 100644 (file)
index 0000000..150ffb9
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * atomic_kmap.h: temporary virtual kernel memory mappings
+ *
+ * Copyright (C) 2003 Ingo Molnar <mingo@redhat.com>
+ */
+
+#ifndef _ASM_ATOMIC_KMAP_H
+#define _ASM_ATOMIC_KMAP_H
+
+#ifdef __KERNEL__
+
+#include <linux/config.h>
+#include <asm/tlbflush.h>
+
+#ifdef CONFIG_DEBUG_HIGHMEM
+#define HIGHMEM_DEBUG 1
+#else
+#define HIGHMEM_DEBUG 0
+#endif
+
+extern pte_t *kmap_pte;
+#define kmap_prot PAGE_KERNEL
+
+#define PKMAP_BASE (0xff000000UL)
+#define NR_SHARED_PMDS ((0xffffffff-PKMAP_BASE+1)/PMD_SIZE)
+
+static inline unsigned long __kmap_atomic_vaddr(enum km_type type)
+{
+       enum fixed_addresses idx;
+
+       idx = type + KM_TYPE_NR*smp_processor_id();
+       return __fix_to_virt(FIX_KMAP_BEGIN + idx);
+}
+
+static inline void *__kmap_atomic_noflush(struct page *page, enum km_type type)
+{
+       enum fixed_addresses idx;
+       unsigned long vaddr;
+
+       idx = type + KM_TYPE_NR*smp_processor_id();
+       vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
+       /*
+        * NOTE: entries that rely on some secondary TLB-flush
+        * effect must not be global:
+        */
+       set_pte(kmap_pte-idx, mk_pte(page, PAGE_KERNEL));
+
+       return (void*) vaddr;
+}
+
+static inline void *__kmap_atomic(struct page *page, enum km_type type)
+{
+       enum fixed_addresses idx;
+       unsigned long vaddr;
+
+       idx = type + KM_TYPE_NR*smp_processor_id();
+       vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
+#if HIGHMEM_DEBUG
+       BUG_ON(!pte_none(*(kmap_pte-idx)));
+#else
+       /*
+        * Performance optimization - do not flush if the new
+        * pte is the same as the old one:
+        */
+       if (pte_val(*(kmap_pte-idx)) == pte_val(mk_pte(page, kmap_prot)))
+               return (void *) vaddr;
+#endif
+       set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
+       __flush_tlb_one(vaddr);
+
+       return (void*) vaddr;
+}
+
+static inline void __kunmap_atomic(void *kvaddr, enum km_type type)
+{
+#if HIGHMEM_DEBUG
+       unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
+       enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
+
+       BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx));
+       /*
+        * force other mappings to Oops if they'll try to access
+        * this pte without first remap it
+        */
+       pte_clear(kmap_pte-idx);
+       __flush_tlb_one(vaddr);
+#endif
+}
+
+#define __kunmap_atomic_type(type) \
+               __kunmap_atomic((void *)__kmap_atomic_vaddr(type), (type))
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_ATOMIC_KMAP_H */
diff --git a/include/asm-i386/crash.h b/include/asm-i386/crash.h
new file mode 100644 (file)
index 0000000..b6ae4f3
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef _ASM_I386_CRASH_H
+#define _ASM_I386_CRASH_H
+
+/*
+ * linux/include/asm-i386/crash.h
+ *
+ * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifdef __KERNEL__
+
+#include <linux/mm.h>
+#include <linux/highmem.h>
+#include <asm/mmzone.h>
+
+extern int page_is_ram(unsigned long);
+
+static inline void *
+map_virtual(u64 offset, struct page **pp)
+{
+       struct page *page;
+       unsigned long pfn;
+       void *vaddr;
+
+        pfn = (unsigned long)(offset >> PAGE_SHIFT);
+
+        if (!page_is_ram(pfn)) {
+               printk(KERN_INFO
+                   "crash memory driver: !page_is_ram(pfn: %lx)\n", pfn);
+                return NULL;
+       }
+
+       if (!pfn_valid(pfn)) {
+               printk(KERN_INFO
+                   "crash memory driver: invalid pfn: %lx )\n", pfn);
+               return NULL;
+       }
+
+       page = pfn_to_page(pfn);
+
+       vaddr = kmap(page);
+       if (!vaddr) {
+               printk(KERN_INFO
+                   "crash memory driver: pfn: %lx kmap(page: %lx) failed\n", 
+                       pfn, (unsigned long)page);
+               return NULL;
+       }
+
+       *pp = page;
+       return (vaddr + (offset & (PAGE_SIZE-1)));
+}
+
+static inline void unmap_virtual(struct page *page) 
+{ 
+       kunmap(page);
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_I386_CRASH_H */
diff --git a/include/asm-ia64/cpu.h b/include/asm-ia64/cpu.h
new file mode 100644 (file)
index 0000000..33c5d0f
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef _ASM_IA64_CPU_H_
+#define _ASM_IA64_CPU_H_
+
+#include <linux/device.h>
+#include <linux/cpu.h>
+#include <linux/topology.h>
+#include <linux/percpu.h>
+
+struct ia64_cpu {
+       struct cpu cpu;
+};
+
+DECLARE_PER_CPU(struct ia64_cpu, cpu_devices);
+
+DECLARE_PER_CPU(int, cpu_state);
+
+#endif /* _ASM_IA64_CPU_H_ */
diff --git a/include/asm-ia64/crash.h b/include/asm-ia64/crash.h
new file mode 100644 (file)
index 0000000..f51e828
--- /dev/null
@@ -0,0 +1,90 @@
+#ifndef _ASM_IA64_CRASH_H
+#define _ASM_IA64_CRASH_H
+
+/*
+ * linux/include/asm-ia64/crash.h
+ *
+ * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifdef __KERNEL__
+
+#include <linux/efi.h>
+#include <linux/mm.h>
+#include <asm/mmzone.h>
+
+static inline void *
+map_virtual(u64 offset, struct page **pp)
+{
+       struct page *page;
+       unsigned long pfn;
+       u32 type;
+
+       if (REGION_NUMBER(offset) == 5) {
+               char byte;
+
+               if (__get_user(byte, (char *)offset) == 0)
+                       return (void *)offset;
+               else
+                       return NULL;
+       }
+
+       switch (type = efi_mem_type(offset)) 
+       {
+       case EFI_LOADER_CODE:
+       case EFI_LOADER_DATA:
+       case EFI_BOOT_SERVICES_CODE:
+       case EFI_BOOT_SERVICES_DATA:
+       case EFI_CONVENTIONAL_MEMORY:
+               break;
+
+       default:
+               printk(KERN_INFO
+                   "crash memory driver: invalid memory type for %lx: %d\n", 
+                       offset, type);
+               return NULL;
+       }
+
+       pfn = offset >> PAGE_SHIFT;
+
+        if (!pfn_valid(pfn)) {
+                printk(KERN_INFO
+                    "crash memory driver: invalid pfn: %lx )\n", pfn);
+                return NULL;
+        }
+
+       page = pfn_to_page(pfn);
+
+       if (!page->virtual) {
+               printk(KERN_INFO
+                   "crash memory driver: offset: %lx page: %lx page->virtual: NULL\n", 
+                       offset, (unsigned long)page);
+               return NULL;
+       }
+
+       return (page->virtual + (offset & (PAGE_SIZE-1)));
+}
+
+static inline void unmap_virtual(struct page *page) 
+{ 
+       return;
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_IA64_CRASH_H */
diff --git a/include/asm-mips/8253pit.h b/include/asm-mips/8253pit.h
new file mode 100644 (file)
index 0000000..285f784
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * 8253/8254 Programmable Interval Timer
+ */
+
+#ifndef _8253PIT_H
+#define _8253PIT_H
+
+#define PIT_TICK_RATE  1193182UL
+
+#endif
diff --git a/include/asm-mips/pmon.h b/include/asm-mips/pmon.h
new file mode 100644 (file)
index 0000000..0162517
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * 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) 2004 by Ralf Baechle
+ */
+#ifndef _ASM_PMON_H
+#define _ASM_PMON_H
+
+struct callvectors {
+       int     (*open) (char*, int, int);              /*       0 */
+       int     (*close) (int);                         /*       4 */
+       int     (*read) (int, void*, int);              /*       8 */
+       int     (*write) (int, void*, int);             /*      12 */
+       off_t   (*lseek) (int, off_t, int);             /*      16 */
+       int     (*printf) (const char*, ...);           /*      20 */
+       void    (*cacheflush) (void);                   /*      24 */
+       char*   (*gets) (char*);                        /*      28 */
+};
+
+#endif /* _ASM_PMON_H */
diff --git a/include/asm-parisc/unwind.h b/include/asm-parisc/unwind.h
new file mode 100644 (file)
index 0000000..5a52cb1
--- /dev/null
@@ -0,0 +1,72 @@
+#ifndef _UNWIND_H_
+#define _UNWIND_H_
+
+/* From ABI specifications */
+struct unwind_table_entry {
+       unsigned int region_start;
+       unsigned int region_end;
+       unsigned int Cannot_unwind:1; /* 0 */
+       unsigned int Millicode:1;       /* 1 */
+       unsigned int Millicode_save_sr0:1;      /* 2 */
+       unsigned int Region_description:2;      /* 3..4 */
+       unsigned int reserved1:1;       /* 5 */
+       unsigned int Entry_SR:1;        /* 6 */
+       unsigned int Entry_FR:4;        /* number saved *//* 7..10 */
+       unsigned int Entry_GR:5;        /* number saved *//* 11..15 */
+       unsigned int Args_stored:1;     /* 16 */
+       unsigned int Variable_Frame:1;  /* 17 */
+       unsigned int Separate_Package_Body:1;   /* 18 */
+       unsigned int Frame_Extension_Millicode:1;       /* 19 */
+       unsigned int Stack_Overflow_Check:1;    /* 20 */
+       unsigned int Two_Instruction_SP_Increment:1;    /* 21 */
+       unsigned int Ada_Region:1;      /* 22 */
+       unsigned int cxx_info:1;        /* 23 */
+       unsigned int cxx_try_catch:1;   /* 24 */
+       unsigned int sched_entry_seq:1; /* 25 */
+       unsigned int reserved2:1;       /* 26 */
+       unsigned int Save_SP:1; /* 27 */
+       unsigned int Save_RP:1; /* 28 */
+       unsigned int Save_MRP_in_frame:1;       /* 29 */
+       unsigned int extn_ptr_defined:1;        /* 30 */
+       unsigned int Cleanup_defined:1; /* 31 */
+       
+       unsigned int MPE_XL_interrupt_marker:1; /* 0 */
+       unsigned int HP_UX_interrupt_marker:1;  /* 1 */
+       unsigned int Large_frame:1;     /* 2 */
+       unsigned int Pseudo_SP_Set:1;   /* 3 */
+       unsigned int reserved4:1;       /* 4 */
+       unsigned int Total_frame_size:27;       /* 5..31 */
+};
+
+struct unwind_table {
+       struct unwind_table *next;
+       const char *name;
+       unsigned long gp;
+       unsigned long base_addr;
+       unsigned long start;
+       unsigned long end;
+       const struct unwind_table_entry *table;
+       unsigned long length;
+};
+
+struct unwind_frame_info {
+       unsigned long sp;
+       unsigned long ip;
+       struct task_struct *t;
+       /* Eventually we would like to be able to get at any of the registers
+          available; but for now we only try to get the sp and ip for each
+          frame */
+       /* struct pt_regs regs; */
+       unsigned long prev_sp, prev_ip;
+};
+
+void * unwind_table_add(const char *name, unsigned long base_addr, 
+                unsigned long gp,
+                 const void *start, const void *end);
+void unwind_frame_init(struct unwind_frame_info *info, struct task_struct *t, 
+                      struct pt_regs *regs);
+void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct task_struct *t);
+int unwind_once(struct unwind_frame_info *info);
+int unwind_to_user(struct unwind_frame_info *info);
+
+#endif
diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h
new file mode 100644 (file)
index 0000000..8c61d93
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * ibm_ocp.h
+ *
+ *      (c) Benjamin Herrenschmidt (benh@kernel.crashing.org)
+ *          Mipsys - France
+ *
+ *          Derived from work (c) Armin Kuster akuster@pacbell.net
+ *
+ *          Additional support and port to 2.6 LDM/sysfs by
+ *          Matt Porter <mporter@kernel.crashing.org>
+ *          Copyright 2003-2004 MontaVista Software, Inc.
+ *
+ * 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.
+ *
+ */
+#ifdef __KERNEL__
+#ifndef __IBM_OCP_H__
+#define __IBM_OCP_H__
+
+#include <asm/types.h>
+
+/*
+ * IBM 4xx OCP system information
+ */
+struct ocp_sys_info_data {
+       int     opb_bus_freq;   /* OPB Bus Frequency (Hz) */
+       int     ebc_bus_freq;   /* EBC Bus Frequency (Hz) */
+};
+
+extern struct ocp_sys_info_data ocp_sys_info;
+
+/*
+ * EMAC additional data and sysfs support
+ *
+ * Note about mdio_idx: When you have a zmii, it's usually
+ * not necessary, it covers the case of the 405EP which has
+ * the MDIO lines on EMAC0 only
+ *
+ * Note about phy_map: Per EMAC map of PHY ids which should
+ * be probed by emac_probe. Different EMACs can have
+ * overlapping maps.
+ *
+ * Note, this map uses inverse logic for bits:
+ *  0 - id should be probed
+ *  1 - id should be ignored
+ *
+ * Default value of 0x00000000 - will result in usual
+ * auto-detection logic.
+ *
+ */
+
+struct ocp_func_emac_data {
+       int     rgmii_idx;      /* RGMII device index or -1 */
+       int     rgmii_mux;      /* RGMII input of this EMAC */
+       int     zmii_idx;       /* ZMII device index or -1 */
+       int     zmii_mux;       /* ZMII input of this EMAC */
+       int     mal_idx;        /* MAL device index */
+       int     mal_rx_chan;    /* MAL rx channel number */
+       int     mal_tx_chan;    /* MAL tx channel number */
+       int     wol_irq;        /* WOL interrupt */
+       int     mdio_idx;       /* EMAC idx of MDIO master or -1 */
+       int     tah_idx;        /* TAH device index or -1 */
+       int     jumbo;          /* Jumbo frames capable flag */
+       int     phy_mode;       /* PHY type or configurable mode */
+       u8      mac_addr[6];    /* EMAC mac address */
+       u32     phy_map;        /* EMAC phy map */
+};
+
+/* Sysfs support */
+#define OCP_SYSFS_EMAC_DATA()                                          \
+OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, zmii_idx)     \
+OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, zmii_mux)     \
+OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_idx)      \
+OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_rx_chan)  \
+OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_tx_chan)  \
+OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, wol_irq)      \
+OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mdio_idx)     \
+                                                                       \
+void ocp_show_emac_data(struct device *dev)                            \
+{                                                                      \
+       device_create_file(dev, &dev_attr_emac_zmii_idx);               \
+       device_create_file(dev, &dev_attr_emac_zmii_mux);               \
+       device_create_file(dev, &dev_attr_emac_mal_idx);                \
+       device_create_file(dev, &dev_attr_emac_mal_rx_chan);            \
+       device_create_file(dev, &dev_attr_emac_mal_tx_chan);            \
+       device_create_file(dev, &dev_attr_emac_wol_irq);                \
+       device_create_file(dev, &dev_attr_emac_mdio_idx);               \
+}
+
+#ifdef CONFIG_40x
+/*
+ * Helper function to copy MAC addresses from the bd_t to OCP EMAC
+ * additions.
+ *
+ * The range of EMAC indices (inclusive) to be copied are the arguments.
+ */
+static inline void ibm_ocp_set_emac(int start, int end)
+{
+       int i;
+       struct ocp_def *def;
+
+       /* Copy MAC addresses to EMAC additions */
+       for (i=start; i<=end; i++) {
+               def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i);
+               memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr,
+                               &__res.bi_enetaddr[i],
+                               6);
+       }
+}
+#endif
+
+/*
+ * MAL additional data and sysfs support
+ */
+struct ocp_func_mal_data {
+       int     num_tx_chans;   /* Number of TX channels */
+       int     num_rx_chans;   /* Number of RX channels */
+       int     txeob_irq;      /* TX End Of Buffer IRQ  */
+       int     rxeob_irq;      /* RX End Of Buffer IRQ  */
+       int     txde_irq;       /* TX Descriptor Error IRQ */
+       int     rxde_irq;       /* RX Descriptor Error IRQ */
+       int     serr_irq;       /* MAL System Error IRQ    */
+};
+
+#define OCP_SYSFS_MAL_DATA()                                           \
+OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, num_tx_chans)   \
+OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, num_rx_chans)   \
+OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, txeob_irq)      \
+OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, rxeob_irq)      \
+OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, txde_irq)       \
+OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, rxde_irq)       \
+OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, serr_irq)       \
+                                                                       \
+void ocp_show_mal_data(struct device *dev)                             \
+{                                                                      \
+       device_create_file(dev, &dev_attr_mal_num_tx_chans);            \
+       device_create_file(dev, &dev_attr_mal_num_rx_chans);            \
+       device_create_file(dev, &dev_attr_mal_txeob_irq);               \
+       device_create_file(dev, &dev_attr_mal_rxeob_irq);               \
+       device_create_file(dev, &dev_attr_mal_txde_irq);                \
+       device_create_file(dev, &dev_attr_mal_rxde_irq);                \
+       device_create_file(dev, &dev_attr_mal_serr_irq);                \
+}
+
+/*
+ * IIC additional data and sysfs support
+ */
+struct ocp_func_iic_data {
+       int     fast_mode;      /* IIC fast mode enabled */
+};
+
+#define OCP_SYSFS_IIC_DATA()                                           \
+OCP_SYSFS_ADDTL(struct ocp_func_iic_data, "%d\n", iic, fast_mode)      \
+                                                                       \
+void ocp_show_iic_data(struct device *dev)                             \
+{                                                                      \
+       device_create_file(dev, &dev_attr_iic_fast_mode);                       \
+}
+#endif /* __IBM_OCP_H__ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-sparc64/const.h b/include/asm-sparc64/const.h
new file mode 100644 (file)
index 0000000..8ad902b
--- /dev/null
@@ -0,0 +1,19 @@
+/* const.h: Macros for dealing with constants.  */
+
+#ifndef _SPARC64_CONST_H
+#define _SPARC64_CONST_H
+
+/* Some constant macros are used in both assembler and
+ * C code.  Therefore we cannot annotate them always with
+ * 'UL' and other type specificers unilaterally.  We
+ * use the following macros to deal with this.
+ */
+
+#ifdef __ASSEMBLY__
+#define _AC(X,Y)       X
+#else
+#define _AC(X,Y)       (X##Y)
+#endif
+
+
+#endif /* !(_SPARC64_CONST_H) */
diff --git a/include/asm-x86_64/8253pit.h b/include/asm-x86_64/8253pit.h
new file mode 100644 (file)
index 0000000..285f784
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * 8253/8254 Programmable Interval Timer
+ */
+
+#ifndef _8253PIT_H
+#define _8253PIT_H
+
+#define PIT_TICK_RATE  1193182UL
+
+#endif
diff --git a/include/linux/autoconf.h b/include/linux/autoconf.h
new file mode 100644 (file)
index 0000000..546d521
--- /dev/null
@@ -0,0 +1,2349 @@
+/*
+ * Automatically generated C config: don't edit
+ */
+#define AUTOCONF_INCLUDED
+#define CONFIG_X86 1
+#define CONFIG_MMU 1
+#define CONFIG_UID16 1
+#define CONFIG_GENERIC_ISA_DMA 1
+
+/*
+ * Code maturity level options
+ */
+#define CONFIG_EXPERIMENTAL 1
+#define CONFIG_CLEAN_COMPILE 1
+#define CONFIG_STANDALONE 1
+
+/*
+ * General setup
+ */
+#define CONFIG_SWAP 1
+#define CONFIG_SYSVIPC 1
+#define CONFIG_POSIX_MQUEUE 1
+#define CONFIG_BSD_PROCESS_ACCT 1
+#define CONFIG_SYSCTL 1
+#undef CONFIG_AUDIT
+#define CONFIG_LOG_BUF_SHIFT 17
+#define CONFIG_HOTPLUG 1
+#undef CONFIG_IKCONFIG
+#undef CONFIG_EMBEDDED
+#define CONFIG_KALLSYMS 1
+#undef CONFIG_KALLSYMS_ALL
+#define CONFIG_FUTEX 1
+#define CONFIG_EPOLL 1
+#define CONFIG_IOSCHED_NOOP 1
+#define CONFIG_IOSCHED_AS 1
+#define CONFIG_IOSCHED_DEADLINE 1
+#define CONFIG_IOSCHED_CFQ 1
+#define CONFIG_CC_OPTIMIZE_FOR_SIZE 1
+
+/*
+ * Loadable module support
+ */
+#define CONFIG_MODULES 1
+#define CONFIG_MODULE_UNLOAD 1
+#undef CONFIG_MODULE_FORCE_UNLOAD
+#define CONFIG_OBSOLETE_MODPARM 1
+#undef CONFIG_MODVERSIONS
+#define CONFIG_KMOD 1
+#define CONFIG_STOP_MACHINE 1
+
+/*
+ * Processor type and features
+ */
+#undef CONFIG_X86_PC
+#undef CONFIG_X86_ELAN
+#undef CONFIG_X86_VOYAGER
+#undef CONFIG_X86_NUMAQ
+#undef CONFIG_X86_SUMMIT
+#undef CONFIG_X86_BIGSMP
+#undef CONFIG_X86_VISWS
+#define CONFIG_X86_GENERICARCH 1
+#undef CONFIG_X86_ES7000
+#define CONFIG_X86_CYCLONE_TIMER 1
+#undef CONFIG_M386
+#undef CONFIG_M486
+#undef CONFIG_M586
+#undef CONFIG_M586TSC
+#undef CONFIG_M586MMX
+#define CONFIG_M686 1
+#undef CONFIG_MPENTIUMII
+#undef CONFIG_MPENTIUMIII
+#undef CONFIG_MPENTIUMM
+#undef CONFIG_MPENTIUM4
+#undef CONFIG_MK6
+#undef CONFIG_MK7
+#undef CONFIG_MK8
+#undef CONFIG_MCRUSOE
+#undef CONFIG_MWINCHIPC6
+#undef CONFIG_MWINCHIP2
+#undef CONFIG_MWINCHIP3D
+#undef CONFIG_MCYRIXIII
+#undef CONFIG_MVIAC3_2
+#define CONFIG_X86_GENERIC 1
+#define CONFIG_X86_CMPXCHG 1
+#define CONFIG_X86_XADD 1
+#define CONFIG_X86_L1_CACHE_SHIFT 7
+#define CONFIG_RWSEM_XCHGADD_ALGORITHM 1
+#define CONFIG_X86_PPRO_FENCE 1
+#define CONFIG_X86_WP_WORKS_OK 1
+#define CONFIG_X86_INVLPG 1
+#define CONFIG_X86_BSWAP 1
+#define CONFIG_X86_POPAD_OK 1
+#define CONFIG_X86_GOOD_APIC 1
+#define CONFIG_X86_INTEL_USERCOPY 1
+#define CONFIG_X86_USE_PPRO_CHECKSUM 1
+#define CONFIG_X86_4G 1
+#define CONFIG_X86_SWITCH_PAGETABLES 1
+#define CONFIG_X86_4G_VM_LAYOUT 1
+#define CONFIG_X86_UACCESS_INDIRECT 1
+#define CONFIG_X86_HIGH_ENTRY 1
+#define CONFIG_HPET_TIMER 1
+#define CONFIG_HPET_EMULATE_RTC 1
+#define CONFIG_SMP 1
+#define CONFIG_NR_CPUS 32
+#define CONFIG_SCHED_SMT 1
+#undef CONFIG_PREEMPT
+#define CONFIG_X86_LOCAL_APIC 1
+#define CONFIG_X86_IO_APIC 1
+#define CONFIG_X86_TSC 1
+#define CONFIG_X86_MCE 1
+#undef CONFIG_X86_MCE_NONFATAL
+#define CONFIG_X86_MCE_P4THERMAL 1
+#define CONFIG_TOSHIBA_MODULE 1
+#define CONFIG_I8K_MODULE 1
+#define CONFIG_MICROCODE_MODULE 1
+#define CONFIG_X86_MSR_MODULE 1
+#define CONFIG_X86_CPUID_MODULE 1
+
+/*
+ * Firmware Drivers
+ */
+#define CONFIG_EDD_MODULE 1
+#undef CONFIG_NOHIGHMEM
+#undef CONFIG_HIGHMEM4G
+#define CONFIG_HIGHMEM64G 1
+#define CONFIG_HIGHMEM 1
+#define CONFIG_X86_PAE 1
+#undef CONFIG_NUMA
+#define CONFIG_HIGHPTE 1
+#undef CONFIG_MATH_EMULATION
+#define CONFIG_MTRR 1
+#undef CONFIG_EFI
+#undef CONFIG_IRQBALANCE
+#define CONFIG_HAVE_DEC_LOCK 1
+#define CONFIG_REGPARM 1
+
+/*
+ * Power management options (ACPI, APM)
+ */
+#define CONFIG_PM 1
+#undef CONFIG_SOFTWARE_SUSPEND
+#undef CONFIG_PM_DISK
+
+/*
+ * ACPI (Advanced Configuration and Power Interface) Support
+ */
+#define CONFIG_ACPI 1
+#define CONFIG_ACPI_BOOT 1
+#define CONFIG_ACPI_INTERPRETER 1
+#define CONFIG_ACPI_SLEEP 1
+#define CONFIG_ACPI_SLEEP_PROC_FS 1
+#define CONFIG_ACPI_AC_MODULE 1
+#define CONFIG_ACPI_BATTERY_MODULE 1
+#define CONFIG_ACPI_BUTTON_MODULE 1
+#define CONFIG_ACPI_FAN 1
+#define CONFIG_ACPI_PROCESSOR 1
+#define CONFIG_ACPI_THERMAL 1
+#define CONFIG_ACPI_ASUS_MODULE 1
+#define CONFIG_ACPI_TOSHIBA_MODULE 1
+#undef CONFIG_ACPI_DEBUG
+#define CONFIG_ACPI_BUS 1
+#define CONFIG_ACPI_EC 1
+#define CONFIG_ACPI_POWER 1
+#define CONFIG_ACPI_PCI 1
+#define CONFIG_ACPI_SYSTEM 1
+#define CONFIG_X86_PM_TIMER 1
+
+/*
+ * APM (Advanced Power Management) BIOS Support
+ */
+#define CONFIG_APM 1
+#undef CONFIG_APM_IGNORE_USER_SUSPEND
+#undef CONFIG_APM_DO_ENABLE
+#define CONFIG_APM_CPU_IDLE 1
+#undef CONFIG_APM_DISPLAY_BLANK
+#define CONFIG_APM_RTC_IS_GMT 1
+#undef CONFIG_APM_ALLOW_INTS
+#undef CONFIG_APM_REAL_MODE_POWER_OFF
+
+/*
+ * CPU Frequency scaling
+ */
+#define CONFIG_CPU_FREQ 1
+#undef CONFIG_CPU_FREQ_PROC_INTF
+#undef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
+#define CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE 1
+#define CONFIG_CPU_FREQ_GOV_PERFORMANCE 1
+#define CONFIG_CPU_FREQ_GOV_POWERSAVE_MODULE 1
+#define CONFIG_CPU_FREQ_GOV_USERSPACE 1
+#undef CONFIG_CPU_FREQ_24_API
+#define CONFIG_CPU_FREQ_TABLE 1
+
+/*
+ * CPUFreq processor drivers
+ */
+#define CONFIG_X86_ACPI_CPUFREQ_MODULE 1
+#undef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF
+#define CONFIG_X86_POWERNOW_K6_MODULE 1
+#define CONFIG_X86_POWERNOW_K7 1
+#define CONFIG_X86_POWERNOW_K8_MODULE 1
+#undef CONFIG_X86_GX_SUSPMOD
+#define CONFIG_X86_SPEEDSTEP_CENTRINO 1
+#define CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE 1
+#define CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI 1
+#define CONFIG_X86_SPEEDSTEP_ICH 1
+#define CONFIG_X86_SPEEDSTEP_SMI_MODULE 1
+#define CONFIG_X86_P4_CLOCKMOD_MODULE 1
+#define CONFIG_X86_SPEEDSTEP_LIB 1
+#undef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK
+#define CONFIG_X86_LONGRUN 1
+#undef CONFIG_X86_LONGHAUL
+
+/*
+ * Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+ */
+#define CONFIG_PCI 1
+#undef CONFIG_PCI_GOBIOS
+#undef CONFIG_PCI_GOMMCONFIG
+#undef CONFIG_PCI_GODIRECT
+#define CONFIG_PCI_GOANY 1
+#define CONFIG_PCI_BIOS 1
+#define CONFIG_PCI_DIRECT 1
+#define CONFIG_PCI_MMCONFIG 1
+#define CONFIG_PCI_USE_VECTOR 1
+#define CONFIG_PCI_LEGACY_PROC 1
+#undef CONFIG_PCI_NAMES
+#define CONFIG_ISA 1
+#undef CONFIG_EISA
+#undef CONFIG_MCA
+#undef CONFIG_SCx200
+
+/*
+ * PCMCIA/CardBus support
+ */
+#define CONFIG_PCMCIA_MODULE 1
+#undef CONFIG_PCMCIA_DEBUG
+#define CONFIG_YENTA_MODULE 1
+#define CONFIG_CARDBUS 1
+#define CONFIG_I82092_MODULE 1
+#define CONFIG_I82365_MODULE 1
+#define CONFIG_TCIC_MODULE 1
+#define CONFIG_PCMCIA_PROBE 1
+
+/*
+ * PCI Hotplug Support
+ */
+#define CONFIG_HOTPLUG_PCI 1
+#undef CONFIG_HOTPLUG_PCI_FAKE
+#define CONFIG_HOTPLUG_PCI_COMPAQ_MODULE 1
+#undef CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM
+#define CONFIG_HOTPLUG_PCI_IBM_MODULE 1
+#undef CONFIG_HOTPLUG_PCI_ACPI
+#undef CONFIG_HOTPLUG_PCI_CPCI
+#define CONFIG_HOTPLUG_PCI_PCIE_MODULE 1
+#define CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE 1
+#define CONFIG_HOTPLUG_PCI_SHPC_MODULE 1
+#define CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE 1
+
+/*
+ * Executable file formats
+ */
+#define CONFIG_BINFMT_ELF 1
+#undef CONFIG_BINFMT_AOUT
+#define CONFIG_BINFMT_MISC_MODULE 1
+
+/*
+ * Device Drivers
+ */
+
+/*
+ * Generic Driver Options
+ */
+#define CONFIG_FW_LOADER 1
+#undef CONFIG_DEBUG_DRIVER
+
+/*
+ * Memory Technology Devices (MTD)
+ */
+#define CONFIG_MTD_MODULE 1
+#undef CONFIG_MTD_DEBUG
+#define CONFIG_MTD_PARTITIONS_MODULE 1
+#define CONFIG_MTD_CONCAT_MODULE 1
+#define CONFIG_MTD_REDBOOT_PARTS_MODULE 1
+#define CONFIG_MTD_CMDLINE_PARTS_MODULE 1
+
+/*
+ * User Modules And Translation Layers
+ */
+#define CONFIG_MTD_CHAR_MODULE 1
+#define CONFIG_MTD_BLOCK_MODULE 1
+#define CONFIG_MTD_BLOCK_RO_MODULE 1
+#define CONFIG_FTL_MODULE 1
+#define CONFIG_NFTL_MODULE 1
+#define CONFIG_NFTL_RW 1
+#define CONFIG_INFTL_MODULE 1
+
+/*
+ * RAM/ROM/Flash chip drivers
+ */
+#define CONFIG_MTD_CFI_MODULE 1
+#define CONFIG_MTD_JEDECPROBE_MODULE 1
+#define CONFIG_MTD_GEN_PROBE_MODULE 1
+#undef CONFIG_MTD_CFI_ADV_OPTIONS
+#define CONFIG_MTD_CFI_INTELEXT_MODULE 1
+#define CONFIG_MTD_CFI_AMDSTD_MODULE 1
+#define CONFIG_MTD_CFI_STAA_MODULE 1
+#define CONFIG_MTD_RAM_MODULE 1
+#define CONFIG_MTD_ROM_MODULE 1
+#define CONFIG_MTD_ABSENT_MODULE 1
+#undef CONFIG_MTD_OBSOLETE_CHIPS
+
+/*
+ * Mapping drivers for chip access
+ */
+#define CONFIG_MTD_COMPLEX_MAPPINGS 1
+#undef CONFIG_MTD_PHYSMAP
+#undef CONFIG_MTD_PNC2000
+#define CONFIG_MTD_SC520CDP_MODULE 1
+#define CONFIG_MTD_NETSC520_MODULE 1
+#define CONFIG_MTD_SBC_GXX_MODULE 1
+#define CONFIG_MTD_ELAN_104NC_MODULE 1
+#define CONFIG_MTD_SCx200_DOCFLASH_MODULE 1
+#define CONFIG_MTD_AMD76XROM_MODULE 1
+#define CONFIG_MTD_ICH2ROM_MODULE 1
+#define CONFIG_MTD_SCB2_FLASH_MODULE 1
+#undef CONFIG_MTD_NETtel
+#undef CONFIG_MTD_DILNETPC
+#define CONFIG_MTD_L440GX_MODULE 1
+#define CONFIG_MTD_PCI_MODULE 1
+
+/*
+ * Self-contained MTD device drivers
+ */
+#define CONFIG_MTD_PMC551_MODULE 1
+#undef CONFIG_MTD_PMC551_BUGFIX
+#undef CONFIG_MTD_PMC551_DEBUG
+#undef CONFIG_MTD_SLRAM
+#define CONFIG_MTD_MTDRAM_MODULE 1
+#define CONFIG_MTDRAM_TOTAL_SIZE 4096
+#define CONFIG_MTDRAM_ERASE_SIZE 128
+#undef CONFIG_MTD_BLKMTD
+
+/*
+ * Disk-On-Chip Device Drivers
+ */
+#define CONFIG_MTD_DOC2000_MODULE 1
+#undef CONFIG_MTD_DOC2001
+#define CONFIG_MTD_DOC2001PLUS_MODULE 1
+#define CONFIG_MTD_DOCPROBE_MODULE 1
+#undef CONFIG_MTD_DOCPROBE_ADVANCED
+#define CONFIG_MTD_DOCPROBE_ADDRESS 0x0
+
+/*
+ * NAND Flash Device Drivers
+ */
+#define CONFIG_MTD_NAND_MODULE 1
+#undef CONFIG_MTD_NAND_VERIFY_WRITE
+#define CONFIG_MTD_NAND_IDS_MODULE 1
+
+/*
+ * Parallel port support
+ */
+#define CONFIG_PARPORT_MODULE 1
+#define CONFIG_PARPORT_PC_MODULE 1
+#define CONFIG_PARPORT_PC_CML1_MODULE 1
+#define CONFIG_PARPORT_SERIAL_MODULE 1
+#undef CONFIG_PARPORT_PC_FIFO
+#undef CONFIG_PARPORT_PC_SUPERIO
+#define CONFIG_PARPORT_PC_PCMCIA_MODULE 1
+#undef CONFIG_PARPORT_OTHER
+#define CONFIG_PARPORT_1284 1
+
+/*
+ * Plug and Play support
+ */
+#define CONFIG_PNP 1
+#undef CONFIG_PNP_DEBUG
+
+/*
+ * Protocols
+ */
+#define CONFIG_ISAPNP 1
+#undef CONFIG_PNPBIOS
+
+/*
+ * Block devices
+ */
+#define CONFIG_BLK_DEV_FD_MODULE 1
+#undef CONFIG_BLK_DEV_XD
+#undef CONFIG_PARIDE
+#define CONFIG_BLK_CPQ_DA_MODULE 1
+#define CONFIG_BLK_CPQ_CISS_DA_MODULE 1
+#define CONFIG_CISS_SCSI_TAPE 1
+#define CONFIG_BLK_DEV_DAC960_MODULE 1
+#define CONFIG_BLK_DEV_UMEM_MODULE 1
+#define CONFIG_BLK_DEV_LOOP_MODULE 1
+#define CONFIG_BLK_DEV_CRYPTOLOOP_MODULE 1
+#define CONFIG_BLK_DEV_NBD_MODULE 1
+#define CONFIG_BLK_DEV_CARMEL_MODULE 1
+#define CONFIG_BLK_DEV_RAM 1
+#define CONFIG_BLK_DEV_RAM_SIZE 16384
+#define CONFIG_BLK_DEV_INITRD 1
+#define CONFIG_LBD 1
+
+/*
+ * ATA/ATAPI/MFM/RLL support
+ */
+#define CONFIG_IDE 1
+#define CONFIG_BLK_DEV_IDE 1
+
+/*
+ * Please see Documentation/ide.txt for help/info on IDE drives
+ */
+#undef CONFIG_BLK_DEV_HD_IDE
+#define CONFIG_BLK_DEV_IDEDISK 1
+#define CONFIG_IDEDISK_MULTI_MODE 1
+#undef CONFIG_IDEDISK_STROKE
+#define CONFIG_BLK_DEV_IDECS_MODULE 1
+#define CONFIG_BLK_DEV_IDECD 1
+#define CONFIG_BLK_DEV_IDETAPE_MODULE 1
+#define CONFIG_BLK_DEV_IDEFLOPPY 1
+#undef CONFIG_BLK_DEV_IDESCSI
+#undef CONFIG_IDE_TASK_IOCTL
+#undef CONFIG_IDE_TASKFILE_IO
+
+/*
+ * IDE chipset support/bugfixes
+ */
+#define CONFIG_IDE_GENERIC 1
+#undef CONFIG_BLK_DEV_CMD640
+#define CONFIG_BLK_DEV_IDEPNP 1
+#define CONFIG_BLK_DEV_IDEPCI 1
+#define CONFIG_IDEPCI_SHARE_IRQ 1
+#undef CONFIG_BLK_DEV_OFFBOARD
+#define CONFIG_BLK_DEV_GENERIC 1
+#undef CONFIG_BLK_DEV_OPTI621
+#define CONFIG_BLK_DEV_RZ1000 1
+#define CONFIG_BLK_DEV_IDEDMA_PCI 1
+#undef CONFIG_BLK_DEV_IDEDMA_FORCED
+#define CONFIG_IDEDMA_PCI_AUTO 1
+#undef CONFIG_IDEDMA_ONLYDISK
+#define CONFIG_BLK_DEV_ADMA 1
+#define CONFIG_BLK_DEV_AEC62XX 1
+#define CONFIG_BLK_DEV_ALI15X3 1
+#undef CONFIG_WDC_ALI15X3
+#define CONFIG_BLK_DEV_AMD74XX 1
+#define CONFIG_BLK_DEV_ATIIXP 1
+#define CONFIG_BLK_DEV_CMD64X 1
+#define CONFIG_BLK_DEV_TRIFLEX 1
+#define CONFIG_BLK_DEV_CY82C693 1
+#define CONFIG_BLK_DEV_CS5520 1
+#define CONFIG_BLK_DEV_CS5530 1
+#define CONFIG_BLK_DEV_HPT34X 1
+#undef CONFIG_HPT34X_AUTODMA
+#define CONFIG_BLK_DEV_HPT366 1
+#undef CONFIG_BLK_DEV_SC1200
+#define CONFIG_BLK_DEV_PIIX 1
+#undef CONFIG_BLK_DEV_NS87415
+#define CONFIG_BLK_DEV_PDC202XX_OLD 1
+#undef CONFIG_PDC202XX_BURST
+#define CONFIG_BLK_DEV_PDC202XX_NEW 1
+#define CONFIG_PDC202XX_FORCE 1
+#define CONFIG_BLK_DEV_SVWKS 1
+#define CONFIG_BLK_DEV_SIIMAGE 1
+#define CONFIG_BLK_DEV_SIS5513 1
+#define CONFIG_BLK_DEV_SLC90E66 1
+#undef CONFIG_BLK_DEV_TRM290
+#define CONFIG_BLK_DEV_VIA82CXXX 1
+#undef CONFIG_IDE_ARM
+#undef CONFIG_IDE_CHIPSETS
+#define CONFIG_BLK_DEV_IDEDMA 1
+#undef CONFIG_IDEDMA_IVB
+#define CONFIG_IDEDMA_AUTO 1
+#undef CONFIG_BLK_DEV_HD
+
+/*
+ * SCSI device support
+ */
+#define CONFIG_SCSI_MODULE 1
+#define CONFIG_SCSI_PROC_FS 1
+
+/*
+ * SCSI support type (disk, tape, CD-ROM)
+ */
+#define CONFIG_BLK_DEV_SD_MODULE 1
+#define CONFIG_CHR_DEV_ST_MODULE 1
+#define CONFIG_CHR_DEV_OSST_MODULE 1
+#define CONFIG_BLK_DEV_SR_MODULE 1
+#define CONFIG_BLK_DEV_SR_VENDOR 1
+#define CONFIG_CHR_DEV_SG_MODULE 1
+
+/*
+ * Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+ */
+#undef CONFIG_SCSI_MULTI_LUN
+#define CONFIG_SCSI_CONSTANTS 1
+#define CONFIG_SCSI_LOGGING 1
+
+/*
+ * SCSI Transport Attributes
+ */
+#define CONFIG_SCSI_SPI_ATTRS_MODULE 1
+#define CONFIG_SCSI_FC_ATTRS_MODULE 1
+
+/*
+ * SCSI low-level drivers
+ */
+#define CONFIG_BLK_DEV_3W_XXXX_RAID_MODULE 1
+#undef CONFIG_SCSI_7000FASST
+#define CONFIG_SCSI_ACARD_MODULE 1
+#define CONFIG_SCSI_AHA152X_MODULE 1
+#define CONFIG_SCSI_AHA1542_MODULE 1
+#define CONFIG_SCSI_AACRAID_MODULE 1
+#define CONFIG_SCSI_AIC7XXX_MODULE 1
+#define CONFIG_AIC7XXX_CMDS_PER_DEVICE 4
+#define CONFIG_AIC7XXX_RESET_DELAY_MS 15000
+#undef CONFIG_AIC7XXX_BUILD_FIRMWARE
+#undef CONFIG_AIC7XXX_DEBUG_ENABLE
+#define CONFIG_AIC7XXX_DEBUG_MASK 0
+#undef CONFIG_AIC7XXX_REG_PRETTY_PRINT
+#define CONFIG_SCSI_AIC7XXX_OLD_MODULE 1
+#define CONFIG_SCSI_AIC79XX_MODULE 1
+#define CONFIG_AIC79XX_CMDS_PER_DEVICE 4
+#define CONFIG_AIC79XX_RESET_DELAY_MS 15000
+#undef CONFIG_AIC79XX_BUILD_FIRMWARE
+#undef CONFIG_AIC79XX_ENABLE_RD_STRM
+#undef CONFIG_AIC79XX_DEBUG_ENABLE
+#define CONFIG_AIC79XX_DEBUG_MASK 0
+#undef CONFIG_AIC79XX_REG_PRETTY_PRINT
+#undef CONFIG_SCSI_DPT_I2O
+#define CONFIG_SCSI_ADVANSYS_MODULE 1
+#define CONFIG_SCSI_IN2000_MODULE 1
+#define CONFIG_SCSI_MEGARAID_MODULE 1
+#define CONFIG_SCSI_SATA 1
+#define CONFIG_SCSI_SATA_SVW_MODULE 1
+#define CONFIG_SCSI_ATA_PIIX_MODULE 1
+#define CONFIG_SCSI_SATA_PROMISE_MODULE 1
+#define CONFIG_SCSI_SATA_SX4_MODULE 1
+#define CONFIG_SCSI_SATA_SIL_MODULE 1
+#define CONFIG_SCSI_SATA_SIS_MODULE 1
+#define CONFIG_SCSI_SATA_VIA_MODULE 1
+#define CONFIG_SCSI_SATA_VITESSE_MODULE 1
+#define CONFIG_SCSI_BUSLOGIC_MODULE 1
+#undef CONFIG_SCSI_OMIT_FLASHPOINT
+#undef CONFIG_SCSI_CPQFCTS
+#undef CONFIG_SCSI_DMX3191D
+#undef CONFIG_SCSI_DTC3280
+#undef CONFIG_SCSI_EATA
+#undef CONFIG_SCSI_EATA_PIO
+#define CONFIG_SCSI_FUTURE_DOMAIN_MODULE 1
+#define CONFIG_SCSI_GDTH_MODULE 1
+#undef CONFIG_SCSI_GENERIC_NCR5380
+#undef CONFIG_SCSI_GENERIC_NCR5380_MMIO
+#define CONFIG_SCSI_IPS_MODULE 1
+#define CONFIG_SCSI_INIA100_MODULE 1
+#define CONFIG_SCSI_PPA_MODULE 1
+#define CONFIG_SCSI_IMM_MODULE 1
+#undef CONFIG_SCSI_IZIP_EPP16
+#undef CONFIG_SCSI_IZIP_SLOW_CTR
+#undef CONFIG_SCSI_NCR53C406A
+#define CONFIG_SCSI_SYM53C8XX_2_MODULE 1
+#define CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE 1
+#define CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS 16
+#define CONFIG_SCSI_SYM53C8XX_MAX_TAGS 64
+#undef CONFIG_SCSI_SYM53C8XX_IOMAPPED
+#undef CONFIG_SCSI_IPR
+#undef CONFIG_SCSI_PAS16
+#undef CONFIG_SCSI_PSI240I
+#define CONFIG_SCSI_QLOGIC_FAS_MODULE 1
+#define CONFIG_SCSI_QLOGIC_ISP_MODULE 1
+#undef CONFIG_SCSI_QLOGIC_FC
+#define CONFIG_SCSI_QLOGIC_1280_MODULE 1
+#define CONFIG_SCSI_QLA2XXX_MODULE 1
+#define CONFIG_SCSI_QLA21XX_MODULE 1
+#define CONFIG_SCSI_QLA22XX_MODULE 1
+#define CONFIG_SCSI_QLA2300_MODULE 1
+#define CONFIG_SCSI_QLA2322_MODULE 1
+#define CONFIG_SCSI_QLA6312_MODULE 1
+#define CONFIG_SCSI_QLA6322_MODULE 1
+#undef CONFIG_SCSI_SYM53C416
+#undef CONFIG_SCSI_DC395x
+#define CONFIG_SCSI_DC390T_MODULE 1
+#undef CONFIG_SCSI_T128
+#undef CONFIG_SCSI_U14_34F
+#undef CONFIG_SCSI_ULTRASTOR
+#undef CONFIG_SCSI_NSP32
+#undef CONFIG_SCSI_DEBUG
+
+/*
+ * PCMCIA SCSI adapter support
+ */
+#define CONFIG_PCMCIA_AHA152X_MODULE 1
+#define CONFIG_PCMCIA_FDOMAIN_MODULE 1
+#define CONFIG_PCMCIA_NINJA_SCSI_MODULE 1
+#define CONFIG_PCMCIA_QLOGIC_MODULE 1
+#define CONFIG_PCMCIA_SYM53C500_MODULE 1
+
+/*
+ * Old CD-ROM drivers (not SCSI, not IDE)
+ */
+#undef CONFIG_CD_NO_IDESCSI
+
+/*
+ * Multi-device support (RAID and LVM)
+ */
+#define CONFIG_MD 1
+#define CONFIG_BLK_DEV_MD 1
+#define CONFIG_MD_LINEAR_MODULE 1
+#define CONFIG_MD_RAID0_MODULE 1
+#define CONFIG_MD_RAID1_MODULE 1
+#define CONFIG_MD_RAID5_MODULE 1
+#define CONFIG_MD_RAID6_MODULE 1
+#define CONFIG_MD_MULTIPATH_MODULE 1
+#define CONFIG_BLK_DEV_DM_MODULE 1
+#define CONFIG_DM_CRYPT_MODULE 1
+
+/*
+ * Fusion MPT device support
+ */
+#define CONFIG_FUSION_MODULE 1
+#define CONFIG_FUSION_MAX_SGE 40
+#undef CONFIG_FUSION_ISENSE
+#define CONFIG_FUSION_CTL_MODULE 1
+#define CONFIG_FUSION_LAN_MODULE 1
+
+/*
+ * IEEE 1394 (FireWire) support
+ */
+#define CONFIG_IEEE1394_MODULE 1
+
+/*
+ * Subsystem Options
+ */
+#undef CONFIG_IEEE1394_VERBOSEDEBUG
+#define CONFIG_IEEE1394_OUI_DB 1
+#undef CONFIG_IEEE1394_EXTRA_CONFIG_ROMS
+
+/*
+ * Device Drivers
+ */
+#undef CONFIG_IEEE1394_PCILYNX
+#define CONFIG_IEEE1394_OHCI1394_MODULE 1
+
+/*
+ * Protocol Drivers
+ */
+#define CONFIG_IEEE1394_VIDEO1394_MODULE 1
+#define CONFIG_IEEE1394_SBP2_MODULE 1
+#undef CONFIG_IEEE1394_SBP2_PHYS_DMA
+#undef CONFIG_IEEE1394_ETH1394
+#define CONFIG_IEEE1394_DV1394_MODULE 1
+#define CONFIG_IEEE1394_RAWIO_MODULE 1
+#define CONFIG_IEEE1394_CMP_MODULE 1
+#define CONFIG_IEEE1394_AMDTP_MODULE 1
+
+/*
+ * I2O device support
+ */
+#define CONFIG_I2O_MODULE 1
+#define CONFIG_I2O_CONFIG_MODULE 1
+#define CONFIG_I2O_BLOCK_MODULE 1
+#define CONFIG_I2O_SCSI_MODULE 1
+#define CONFIG_I2O_PROC_MODULE 1
+
+/*
+ * Networking support
+ */
+#define CONFIG_NET 1
+
+/*
+ * Networking options
+ */
+#define CONFIG_PACKET 1
+#define CONFIG_PACKET_MMAP 1
+#define CONFIG_NETLINK_DEV 1
+#define CONFIG_UNIX 1
+#define CONFIG_NET_KEY_MODULE 1
+#define CONFIG_INET 1
+#define CONFIG_IP_MULTICAST 1
+#define CONFIG_IP_ADVANCED_ROUTER 1
+#define CONFIG_IP_MULTIPLE_TABLES 1
+#define CONFIG_IP_ROUTE_FWMARK 1
+#define CONFIG_IP_ROUTE_NAT 1
+#define CONFIG_IP_ROUTE_MULTIPATH 1
+#define CONFIG_IP_ROUTE_TOS 1
+#define CONFIG_IP_ROUTE_VERBOSE 1
+#undef CONFIG_IP_PNP
+#define CONFIG_NET_IPIP_MODULE 1
+#define CONFIG_NET_IPGRE_MODULE 1
+#define CONFIG_NET_IPGRE_BROADCAST 1
+#define CONFIG_IP_MROUTE 1
+#define CONFIG_IP_PIMSM_V1 1
+#define CONFIG_IP_PIMSM_V2 1
+#undef CONFIG_ARPD
+#define CONFIG_SYN_COOKIES 1
+#define CONFIG_INET_AH_MODULE 1
+#define CONFIG_INET_ESP_MODULE 1
+#define CONFIG_INET_IPCOMP_MODULE 1
+
+/*
+ * IP: Virtual Server Configuration
+ */
+#define CONFIG_IP_VS_MODULE 1
+#undef CONFIG_IP_VS_DEBUG
+#define CONFIG_IP_VS_TAB_BITS 12
+
+/*
+ * IPVS transport protocol load balancing support
+ */
+#define CONFIG_IP_VS_PROTO_TCP 1
+#define CONFIG_IP_VS_PROTO_UDP 1
+#define CONFIG_IP_VS_PROTO_ESP 1
+#define CONFIG_IP_VS_PROTO_AH 1
+
+/*
+ * IPVS scheduler
+ */
+#define CONFIG_IP_VS_RR_MODULE 1
+#define CONFIG_IP_VS_WRR_MODULE 1
+#define CONFIG_IP_VS_LC_MODULE 1
+#define CONFIG_IP_VS_WLC_MODULE 1
+#define CONFIG_IP_VS_LBLC_MODULE 1
+#define CONFIG_IP_VS_LBLCR_MODULE 1
+#define CONFIG_IP_VS_DH_MODULE 1
+#define CONFIG_IP_VS_SH_MODULE 1
+#define CONFIG_IP_VS_SED_MODULE 1
+#define CONFIG_IP_VS_NQ_MODULE 1
+
+/*
+ * IPVS application helper
+ */
+#define CONFIG_IP_VS_FTP_MODULE 1
+#define CONFIG_IPV6_MODULE 1
+#define CONFIG_IPV6_PRIVACY 1
+#define CONFIG_INET6_AH_MODULE 1
+#define CONFIG_INET6_ESP_MODULE 1
+#define CONFIG_INET6_IPCOMP_MODULE 1
+#define CONFIG_IPV6_TUNNEL_MODULE 1
+#define CONFIG_NETFILTER 1
+#undef CONFIG_NETFILTER_DEBUG
+#define CONFIG_BRIDGE_NETFILTER 1
+
+/*
+ * IP: Netfilter Configuration
+ */
+#define CONFIG_IP_NF_CONNTRACK_MODULE 1
+#define CONFIG_IP_NF_FTP_MODULE 1
+#define CONFIG_IP_NF_IRC_MODULE 1
+#define CONFIG_IP_NF_TFTP_MODULE 1
+#define CONFIG_IP_NF_AMANDA_MODULE 1
+#define CONFIG_IP_NF_QUEUE_MODULE 1
+#define CONFIG_IP_NF_IPTABLES_MODULE 1
+#define CONFIG_IP_NF_MATCH_LIMIT_MODULE 1
+#define CONFIG_IP_NF_MATCH_IPRANGE_MODULE 1
+#define CONFIG_IP_NF_MATCH_MAC_MODULE 1
+#define CONFIG_IP_NF_MATCH_PKTTYPE_MODULE 1
+#define CONFIG_IP_NF_MATCH_MARK_MODULE 1
+#define CONFIG_IP_NF_MATCH_MULTIPORT_MODULE 1
+#define CONFIG_IP_NF_MATCH_TOS_MODULE 1
+#define CONFIG_IP_NF_MATCH_RECENT_MODULE 1
+#define CONFIG_IP_NF_MATCH_ECN_MODULE 1
+#define CONFIG_IP_NF_MATCH_DSCP_MODULE 1
+#define CONFIG_IP_NF_MATCH_AH_ESP_MODULE 1
+#define CONFIG_IP_NF_MATCH_LENGTH_MODULE 1
+#define CONFIG_IP_NF_MATCH_TTL_MODULE 1
+#define CONFIG_IP_NF_MATCH_TCPMSS_MODULE 1
+#define CONFIG_IP_NF_MATCH_HELPER_MODULE 1
+#define CONFIG_IP_NF_MATCH_STATE_MODULE 1
+#define CONFIG_IP_NF_MATCH_CONNTRACK_MODULE 1
+#define CONFIG_IP_NF_MATCH_OWNER_MODULE 1
+#define CONFIG_IP_NF_MATCH_PHYSDEV_MODULE 1
+#define CONFIG_IP_NF_FILTER_MODULE 1
+#define CONFIG_IP_NF_TARGET_REJECT_MODULE 1
+#define CONFIG_IP_NF_NAT_MODULE 1
+#define CONFIG_IP_NF_NAT_NEEDED 1
+#define CONFIG_IP_NF_TARGET_MASQUERADE_MODULE 1
+#define CONFIG_IP_NF_TARGET_REDIRECT_MODULE 1
+#define CONFIG_IP_NF_TARGET_NETMAP_MODULE 1
+#define CONFIG_IP_NF_TARGET_SAME_MODULE 1
+#define CONFIG_IP_NF_NAT_LOCAL 1
+#define CONFIG_IP_NF_NAT_SNMP_BASIC_MODULE 1
+#define CONFIG_IP_NF_NAT_IRC_MODULE 1
+#define CONFIG_IP_NF_NAT_FTP_MODULE 1
+#define CONFIG_IP_NF_NAT_TFTP_MODULE 1
+#define CONFIG_IP_NF_NAT_AMANDA_MODULE 1
+#define CONFIG_IP_NF_MANGLE_MODULE 1
+#define CONFIG_IP_NF_TARGET_TOS_MODULE 1
+#define CONFIG_IP_NF_TARGET_ECN_MODULE 1
+#define CONFIG_IP_NF_TARGET_DSCP_MODULE 1
+#define CONFIG_IP_NF_TARGET_MARK_MODULE 1
+#define CONFIG_IP_NF_TARGET_CLASSIFY_MODULE 1
+#define CONFIG_IP_NF_TARGET_LOG_MODULE 1
+#define CONFIG_IP_NF_TARGET_ULOG_MODULE 1
+#define CONFIG_IP_NF_TARGET_TCPMSS_MODULE 1
+#define CONFIG_IP_NF_ARPTABLES_MODULE 1
+#define CONFIG_IP_NF_ARPFILTER_MODULE 1
+#define CONFIG_IP_NF_ARP_MANGLE_MODULE 1
+#undef CONFIG_IP_NF_COMPAT_IPCHAINS
+#undef CONFIG_IP_NF_COMPAT_IPFWADM
+#define CONFIG_IP_NF_TARGET_NOTRACK_MODULE 1
+#define CONFIG_IP_NF_RAW_MODULE 1
+
+/*
+ * IPv6: Netfilter Configuration
+ */
+#undef CONFIG_IP6_NF_QUEUE
+#define CONFIG_IP6_NF_IPTABLES_MODULE 1
+#define CONFIG_IP6_NF_MATCH_LIMIT_MODULE 1
+#define CONFIG_IP6_NF_MATCH_MAC_MODULE 1
+#define CONFIG_IP6_NF_MATCH_RT_MODULE 1
+#define CONFIG_IP6_NF_MATCH_OPTS_MODULE 1
+#define CONFIG_IP6_NF_MATCH_FRAG_MODULE 1
+#define CONFIG_IP6_NF_MATCH_HL_MODULE 1
+#define CONFIG_IP6_NF_MATCH_MULTIPORT_MODULE 1
+#define CONFIG_IP6_NF_MATCH_OWNER_MODULE 1
+#define CONFIG_IP6_NF_MATCH_MARK_MODULE 1
+#define CONFIG_IP6_NF_MATCH_IPV6HEADER_MODULE 1
+#define CONFIG_IP6_NF_MATCH_AHESP_MODULE 1
+#define CONFIG_IP6_NF_MATCH_LENGTH_MODULE 1
+#define CONFIG_IP6_NF_MATCH_EUI64_MODULE 1
+#define CONFIG_IP6_NF_FILTER_MODULE 1
+#define CONFIG_IP6_NF_TARGET_LOG_MODULE 1
+#define CONFIG_IP6_NF_MANGLE_MODULE 1
+#define CONFIG_IP6_NF_TARGET_MARK_MODULE 1
+#define CONFIG_IP6_NF_RAW_MODULE 1
+
+/*
+ * Bridge: Netfilter Configuration
+ */
+#define CONFIG_BRIDGE_NF_EBTABLES_MODULE 1
+#define CONFIG_BRIDGE_EBT_BROUTE_MODULE 1
+#define CONFIG_BRIDGE_EBT_T_FILTER_MODULE 1
+#define CONFIG_BRIDGE_EBT_T_NAT_MODULE 1
+#define CONFIG_BRIDGE_EBT_802_3_MODULE 1
+#define CONFIG_BRIDGE_EBT_AMONG_MODULE 1
+#define CONFIG_BRIDGE_EBT_ARP_MODULE 1
+#define CONFIG_BRIDGE_EBT_IP_MODULE 1
+#define CONFIG_BRIDGE_EBT_LIMIT_MODULE 1
+#define CONFIG_BRIDGE_EBT_MARK_MODULE 1
+#define CONFIG_BRIDGE_EBT_PKTTYPE_MODULE 1
+#define CONFIG_BRIDGE_EBT_STP_MODULE 1
+#define CONFIG_BRIDGE_EBT_VLAN_MODULE 1
+#define CONFIG_BRIDGE_EBT_ARPREPLY_MODULE 1
+#define CONFIG_BRIDGE_EBT_DNAT_MODULE 1
+#define CONFIG_BRIDGE_EBT_MARK_T_MODULE 1
+#define CONFIG_BRIDGE_EBT_REDIRECT_MODULE 1
+#define CONFIG_BRIDGE_EBT_SNAT_MODULE 1
+#define CONFIG_BRIDGE_EBT_LOG_MODULE 1
+#define CONFIG_XFRM 1
+#define CONFIG_XFRM_USER 1
+
+/*
+ * SCTP Configuration (EXPERIMENTAL)
+ */
+#define CONFIG_IP_SCTP_MODULE 1
+#undef CONFIG_SCTP_DBG_MSG
+#undef CONFIG_SCTP_DBG_OBJCNT
+#undef CONFIG_SCTP_HMAC_NONE
+#undef CONFIG_SCTP_HMAC_SHA1
+#define CONFIG_SCTP_HMAC_MD5 1
+#undef CONFIG_ATM
+#define CONFIG_BRIDGE_MODULE 1
+#define CONFIG_VLAN_8021Q_MODULE 1
+#undef CONFIG_DECNET
+#define CONFIG_LLC_MODULE 1
+#undef CONFIG_LLC2
+#define CONFIG_IPX_MODULE 1
+#undef CONFIG_IPX_INTERN
+#define CONFIG_ATALK_MODULE 1
+#define CONFIG_DEV_APPLETALK 1
+#define CONFIG_LTPC_MODULE 1
+#define CONFIG_COPS_MODULE 1
+#define CONFIG_COPS_DAYNA 1
+#define CONFIG_COPS_TANGENT 1
+#define CONFIG_IPDDP_MODULE 1
+#define CONFIG_IPDDP_ENCAP 1
+#define CONFIG_IPDDP_DECAP 1
+#undef CONFIG_X25
+#undef CONFIG_LAPB
+#define CONFIG_NET_DIVERT 1
+#undef CONFIG_ECONET
+#define CONFIG_WAN_ROUTER_MODULE 1
+#undef CONFIG_NET_FASTROUTE
+#undef CONFIG_NET_HW_FLOWCONTROL
+
+/*
+ * QoS and/or fair queueing
+ */
+#define CONFIG_NET_SCHED 1
+#define CONFIG_NET_SCH_CBQ_MODULE 1
+#define CONFIG_NET_SCH_HTB_MODULE 1
+#define CONFIG_NET_SCH_HFSC_MODULE 1
+#define CONFIG_NET_SCH_CSZ_MODULE 1
+#define CONFIG_NET_SCH_PRIO_MODULE 1
+#define CONFIG_NET_SCH_RED_MODULE 1
+#define CONFIG_NET_SCH_SFQ_MODULE 1
+#define CONFIG_NET_SCH_TEQL_MODULE 1
+#define CONFIG_NET_SCH_TBF_MODULE 1
+#define CONFIG_NET_SCH_GRED_MODULE 1
+#define CONFIG_NET_SCH_DSMARK_MODULE 1
+#define CONFIG_NET_SCH_DELAY_MODULE 1
+#define CONFIG_NET_SCH_INGRESS_MODULE 1
+#define CONFIG_NET_QOS 1
+#define CONFIG_NET_ESTIMATOR 1
+#define CONFIG_NET_CLS 1
+#define CONFIG_NET_CLS_TCINDEX_MODULE 1
+#define CONFIG_NET_CLS_ROUTE4_MODULE 1
+#define CONFIG_NET_CLS_ROUTE 1
+#define CONFIG_NET_CLS_FW_MODULE 1
+#define CONFIG_NET_CLS_U32_MODULE 1
+#define CONFIG_NET_CLS_RSVP_MODULE 1
+#define CONFIG_NET_CLS_RSVP6_MODULE 1
+#define CONFIG_NET_CLS_POLICE 1
+
+/*
+ * Network testing
+ */
+#undef CONFIG_NET_PKTGEN
+#define CONFIG_NETPOLL 1
+#undef CONFIG_NETPOLL_RX
+#undef CONFIG_NETPOLL_TRAP
+#define CONFIG_NET_POLL_CONTROLLER 1
+#undef CONFIG_HAMRADIO
+#define CONFIG_IRDA_MODULE 1
+
+/*
+ * IrDA protocols
+ */
+#define CONFIG_IRLAN_MODULE 1
+#define CONFIG_IRNET_MODULE 1
+#define CONFIG_IRCOMM_MODULE 1
+#undef CONFIG_IRDA_ULTRA
+
+/*
+ * IrDA options
+ */
+#define CONFIG_IRDA_CACHE_LAST_LSAP 1
+#define CONFIG_IRDA_FAST_RR 1
+#undef CONFIG_IRDA_DEBUG
+
+/*
+ * Infrared-port device drivers
+ */
+
+/*
+ * SIR device drivers
+ */
+#define CONFIG_IRTTY_SIR_MODULE 1
+
+/*
+ * Dongle support
+ */
+#define CONFIG_DONGLE 1
+#define CONFIG_ESI_DONGLE_MODULE 1
+#define CONFIG_ACTISYS_DONGLE_MODULE 1
+#define CONFIG_TEKRAM_DONGLE_MODULE 1
+#define CONFIG_LITELINK_DONGLE_MODULE 1
+#define CONFIG_MA600_DONGLE_MODULE 1
+#define CONFIG_GIRBIL_DONGLE_MODULE 1
+#define CONFIG_MCP2120_DONGLE_MODULE 1
+#define CONFIG_OLD_BELKIN_DONGLE_MODULE 1
+#define CONFIG_ACT200L_DONGLE_MODULE 1
+
+/*
+ * Old SIR device drivers
+ */
+
+/*
+ * Old Serial dongle support
+ */
+
+/*
+ * FIR device drivers
+ */
+#define CONFIG_USB_IRDA_MODULE 1
+#define CONFIG_SIGMATEL_FIR_MODULE 1
+#define CONFIG_NSC_FIR_MODULE 1
+#undef CONFIG_WINBOND_FIR
+#undef CONFIG_TOSHIBA_FIR
+#undef CONFIG_SMC_IRCC_FIR
+#undef CONFIG_ALI_FIR
+#undef CONFIG_VLSI_FIR
+#undef CONFIG_VIA_FIR
+#define CONFIG_BT_MODULE 1
+#define CONFIG_BT_L2CAP_MODULE 1
+#define CONFIG_BT_SCO_MODULE 1
+#define CONFIG_BT_RFCOMM_MODULE 1
+#define CONFIG_BT_RFCOMM_TTY 1
+#define CONFIG_BT_BNEP_MODULE 1
+#define CONFIG_BT_BNEP_MC_FILTER 1
+#define CONFIG_BT_BNEP_PROTO_FILTER 1
+#define CONFIG_BT_CMTP_MODULE 1
+
+/*
+ * Bluetooth device drivers
+ */
+#define CONFIG_BT_HCIUSB_MODULE 1
+#define CONFIG_BT_HCIUSB_SCO 1
+#define CONFIG_BT_HCIUART_MODULE 1
+#define CONFIG_BT_HCIUART_H4 1
+#define CONFIG_BT_HCIUART_BCSP 1
+#define CONFIG_BT_HCIUART_BCSP_TXCRC 1
+#define CONFIG_BT_HCIBCM203X_MODULE 1
+#define CONFIG_BT_HCIBFUSB_MODULE 1
+#define CONFIG_BT_HCIDTL1_MODULE 1
+#define CONFIG_BT_HCIBT3C_MODULE 1
+#define CONFIG_BT_HCIBLUECARD_MODULE 1
+#define CONFIG_BT_HCIBTUART_MODULE 1
+#define CONFIG_BT_HCIVHCI_MODULE 1
+#define CONFIG_TUX_MODULE 1
+
+/*
+ * TUX options
+ */
+#define CONFIG_TUX_EXTCGI 1
+#undef CONFIG_TUX_EXTENDED_LOG
+#undef CONFIG_TUX_DEBUG
+#define CONFIG_NETDEVICES 1
+#define CONFIG_DUMMY_MODULE 1
+#define CONFIG_BONDING_MODULE 1
+#define CONFIG_EQUALIZER_MODULE 1
+#define CONFIG_TUN_MODULE 1
+#define CONFIG_ETHERTAP_MODULE 1
+#define CONFIG_NET_SB1000_MODULE 1
+
+/*
+ * ARCnet devices
+ */
+#undef CONFIG_ARCNET
+
+/*
+ * Ethernet (10 or 100Mbit)
+ */
+#define CONFIG_NET_ETHERNET 1
+#define CONFIG_MII_MODULE 1
+#define CONFIG_HAPPYMEAL_MODULE 1
+#define CONFIG_SUNGEM_MODULE 1
+#define CONFIG_NET_VENDOR_3COM 1
+#define CONFIG_EL1_MODULE 1
+#define CONFIG_EL2_MODULE 1
+#define CONFIG_ELPLUS_MODULE 1
+#define CONFIG_EL16_MODULE 1
+#define CONFIG_EL3_MODULE 1
+#define CONFIG_3C515_MODULE 1
+#define CONFIG_VORTEX_MODULE 1
+#define CONFIG_TYPHOON_MODULE 1
+#define CONFIG_LANCE_MODULE 1
+#define CONFIG_NET_VENDOR_SMC 1
+#define CONFIG_WD80x3_MODULE 1
+#define CONFIG_ULTRA_MODULE 1
+#define CONFIG_SMC9194_MODULE 1
+#define CONFIG_NET_VENDOR_RACAL 1
+#define CONFIG_NI52_MODULE 1
+#define CONFIG_NI65_MODULE 1
+
+/*
+ * Tulip family network device support
+ */
+#define CONFIG_NET_TULIP 1
+#define CONFIG_DE2104X_MODULE 1
+#define CONFIG_TULIP_MODULE 1
+#undef CONFIG_TULIP_MWI
+#define CONFIG_TULIP_MMIO 1
+#undef CONFIG_TULIP_NAPI
+#define CONFIG_DE4X5_MODULE 1
+#define CONFIG_WINBOND_840_MODULE 1
+#define CONFIG_DM9102_MODULE 1
+#define CONFIG_PCMCIA_XIRCOM_MODULE 1
+#undef CONFIG_AT1700
+#define CONFIG_DEPCA_MODULE 1
+#define CONFIG_HP100_MODULE 1
+#undef CONFIG_NET_ISA
+#define CONFIG_NE2000_MODULE 1
+#define CONFIG_NET_PCI 1
+#define CONFIG_PCNET32_MODULE 1
+#define CONFIG_AMD8111_ETH_MODULE 1
+#define CONFIG_AMD8111E_NAPI 1
+#define CONFIG_ADAPTEC_STARFIRE_MODULE 1
+#define CONFIG_ADAPTEC_STARFIRE_NAPI 1
+#define CONFIG_AC3200_MODULE 1
+#define CONFIG_APRICOT_MODULE 1
+#define CONFIG_B44_MODULE 1
+#define CONFIG_FORCEDETH_MODULE 1
+#define CONFIG_CS89x0_MODULE 1
+#define CONFIG_DGRS_MODULE 1
+#define CONFIG_EEPRO100_MODULE 1
+#undef CONFIG_EEPRO100_PIO
+#define CONFIG_E100_MODULE 1
+#define CONFIG_E100_NAPI 1
+#define CONFIG_FEALNX_MODULE 1
+#define CONFIG_NATSEMI_MODULE 1
+#define CONFIG_NE2K_PCI_MODULE 1
+#define CONFIG_8139CP_MODULE 1
+#define CONFIG_8139TOO_MODULE 1
+#define CONFIG_8139TOO_PIO 1
+#undef CONFIG_8139TOO_TUNE_TWISTER
+#define CONFIG_8139TOO_8129 1
+#undef CONFIG_8139_OLD_RX_RESET
+#define CONFIG_SIS900_MODULE 1
+#define CONFIG_EPIC100_MODULE 1
+#define CONFIG_SUNDANCE_MODULE 1
+#undef CONFIG_SUNDANCE_MMIO
+#define CONFIG_TLAN_MODULE 1
+#define CONFIG_VIA_RHINE_MODULE 1
+#define CONFIG_VIA_RHINE_MMIO 1
+#define CONFIG_NET_POCKET 1
+#define CONFIG_ATP_MODULE 1
+#define CONFIG_DE600_MODULE 1
+#define CONFIG_DE620_MODULE 1
+
+/*
+ * Gigabit Ethernet (1000/10000 Mbit)
+ */
+#define CONFIG_NET_GIGE 1
+#define CONFIG_ACENIC_MODULE 1
+#undef CONFIG_ACENIC_OMIT_TIGON_I
+#define CONFIG_DL2K_MODULE 1
+#define CONFIG_E1000_MODULE 1
+#define CONFIG_E1000_NAPI 1
+#define CONFIG_NS83820_MODULE 1
+#define CONFIG_HAMACHI_MODULE 1
+#define CONFIG_YELLOWFIN_MODULE 1
+#define CONFIG_R8169_MODULE 1
+#define CONFIG_SK98LIN_MODULE 1
+#define CONFIG_TIGON3_MODULE 1
+#define CONFIG_IXGB_MODULE 1
+#define CONFIG_IXGB_NAPI 1
+#define CONFIG_S2IO_MODULE 1
+#define CONFIG_S2IO_NAPI 1
+
+/*
+ * Token Ring devices
+ */
+#undef CONFIG_TR
+
+/*
+ * Wireless LAN (non-hamradio)
+ */
+#define CONFIG_NET_RADIO 1
+
+/*
+ * Obsolete Wireless cards support (pre-802.11)
+ */
+#undef CONFIG_STRIP
+#undef CONFIG_ARLAN
+#define CONFIG_WAVELAN_MODULE 1
+#define CONFIG_PCMCIA_WAVELAN_MODULE 1
+#define CONFIG_PCMCIA_NETWAVE_MODULE 1
+
+/*
+ * Wireless 802.11 Frequency Hopping cards support
+ */
+#undef CONFIG_PCMCIA_RAYCS
+
+/*
+ * Wireless 802.11b ISA/PCI cards support
+ */
+#define CONFIG_AIRO_MODULE 1
+#define CONFIG_HERMES_MODULE 1
+#define CONFIG_PLX_HERMES_MODULE 1
+#define CONFIG_TMD_HERMES_MODULE 1
+#define CONFIG_PCI_HERMES_MODULE 1
+#define CONFIG_ATMEL_MODULE 1
+#define CONFIG_PCI_ATMEL_MODULE 1
+
+/*
+ * Wireless 802.11b Pcmcia/Cardbus cards support
+ */
+#define CONFIG_PCMCIA_HERMES_MODULE 1
+#define CONFIG_AIRO_CS_MODULE 1
+#define CONFIG_PCMCIA_ATMEL_MODULE 1
+#define CONFIG_PCMCIA_WL3501_MODULE 1
+
+/*
+ * Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+ */
+#define CONFIG_PRISM54_MODULE 1
+#define CONFIG_NET_WIRELESS 1
+
+/*
+ * PCMCIA network device support
+ */
+#define CONFIG_NET_PCMCIA 1
+#define CONFIG_PCMCIA_3C589_MODULE 1
+#define CONFIG_PCMCIA_3C574_MODULE 1
+#define CONFIG_PCMCIA_FMVJ18X_MODULE 1
+#define CONFIG_PCMCIA_PCNET_MODULE 1
+#define CONFIG_PCMCIA_NMCLAN_MODULE 1
+#define CONFIG_PCMCIA_SMC91C92_MODULE 1
+#define CONFIG_PCMCIA_XIRC2PS_MODULE 1
+#define CONFIG_PCMCIA_AXNET_MODULE 1
+
+/*
+ * Wan interfaces
+ */
+#undef CONFIG_WAN
+#define CONFIG_FDDI 1
+#undef CONFIG_DEFXX
+#define CONFIG_SKFP_MODULE 1
+#undef CONFIG_HIPPI
+#define CONFIG_PLIP_MODULE 1
+#define CONFIG_PPP_MODULE 1
+#define CONFIG_PPP_MULTILINK 1
+#define CONFIG_PPP_FILTER 1
+#define CONFIG_PPP_ASYNC_MODULE 1
+#define CONFIG_PPP_SYNC_TTY_MODULE 1
+#define CONFIG_PPP_DEFLATE_MODULE 1
+#undef CONFIG_PPP_BSDCOMP
+#define CONFIG_PPPOE_MODULE 1
+#undef CONFIG_SLIP
+#define CONFIG_NET_FC 1
+#undef CONFIG_SHAPER
+#define CONFIG_NETCONSOLE_MODULE 1
+
+/*
+ * ISDN subsystem
+ */
+#define CONFIG_ISDN_MODULE 1
+
+/*
+ * Old ISDN4Linux
+ */
+#define CONFIG_ISDN_I4L_MODULE 1
+#define CONFIG_ISDN_PPP 1
+#define CONFIG_ISDN_PPP_VJ 1
+#define CONFIG_ISDN_MPP 1
+#define CONFIG_IPPP_FILTER 1
+#undef CONFIG_ISDN_PPP_BSDCOMP
+#define CONFIG_ISDN_AUDIO 1
+#define CONFIG_ISDN_TTY_FAX 1
+
+/*
+ * ISDN feature submodules
+ */
+
+/*
+ * ISDN4Linux hardware drivers
+ */
+
+/*
+ * Passive cards
+ */
+#define CONFIG_ISDN_DRV_HISAX_MODULE 1
+
+/*
+ * D-channel protocol features
+ */
+#define CONFIG_HISAX_EURO 1
+#define CONFIG_DE_AOC 1
+#define CONFIG_HISAX_NO_SENDCOMPLETE 1
+#define CONFIG_HISAX_NO_LLC 1
+#define CONFIG_HISAX_NO_KEYPAD 1
+#define CONFIG_HISAX_1TR6 1
+#define CONFIG_HISAX_NI1 1
+#define CONFIG_HISAX_MAX_CARDS 8
+
+/*
+ * HiSax supported cards
+ */
+#define CONFIG_HISAX_16_0 1
+#define CONFIG_HISAX_16_3 1
+#define CONFIG_HISAX_TELESPCI 1
+#define CONFIG_HISAX_S0BOX 1
+#define CONFIG_HISAX_AVM_A1 1
+#define CONFIG_HISAX_FRITZPCI 1
+#define CONFIG_HISAX_AVM_A1_PCMCIA 1
+#define CONFIG_HISAX_ELSA 1
+#define CONFIG_HISAX_IX1MICROR2 1
+#define CONFIG_HISAX_DIEHLDIVA 1
+#define CONFIG_HISAX_ASUSCOM 1
+#define CONFIG_HISAX_TELEINT 1
+#define CONFIG_HISAX_HFCS 1
+#define CONFIG_HISAX_SEDLBAUER 1
+#define CONFIG_HISAX_SPORTSTER 1
+#define CONFIG_HISAX_MIC 1
+#define CONFIG_HISAX_NETJET 1
+#define CONFIG_HISAX_NETJET_U 1
+#define CONFIG_HISAX_NICCY 1
+#define CONFIG_HISAX_ISURF 1
+#define CONFIG_HISAX_HSTSAPHIR 1
+#define CONFIG_HISAX_BKM_A4T 1
+#define CONFIG_HISAX_SCT_QUADRO 1
+#define CONFIG_HISAX_GAZEL 1
+#define CONFIG_HISAX_HFC_PCI 1
+#define CONFIG_HISAX_W6692 1
+#define CONFIG_HISAX_HFC_SX 1
+#define CONFIG_HISAX_ENTERNOW_PCI 1
+#undef CONFIG_HISAX_DEBUG
+
+/*
+ * HiSax PCMCIA card service modules
+ */
+#define CONFIG_HISAX_SEDLBAUER_CS_MODULE 1
+#define CONFIG_HISAX_ELSA_CS_MODULE 1
+#define CONFIG_HISAX_AVM_A1_CS_MODULE 1
+#define CONFIG_HISAX_TELES_CS_MODULE 1
+
+/*
+ * HiSax sub driver modules
+ */
+#define CONFIG_HISAX_ST5481_MODULE 1
+#define CONFIG_HISAX_HFCUSB_MODULE 1
+#define CONFIG_HISAX_FRITZ_PCIPNP_MODULE 1
+#define CONFIG_HISAX_HDLC 1
+
+/*
+ * Active cards
+ */
+#define CONFIG_ISDN_DRV_ICN_MODULE 1
+#define CONFIG_ISDN_DRV_PCBIT_MODULE 1
+#define CONFIG_ISDN_DRV_SC_MODULE 1
+#define CONFIG_ISDN_DRV_ACT2000_MODULE 1
+#define CONFIG_ISDN_DRV_TPAM_MODULE 1
+
+/*
+ * CAPI subsystem
+ */
+#define CONFIG_ISDN_CAPI_MODULE 1
+#define CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON 1
+#define CONFIG_ISDN_CAPI_MIDDLEWARE 1
+#define CONFIG_ISDN_CAPI_CAPI20_MODULE 1
+#define CONFIG_ISDN_CAPI_CAPIFS_BOOL 1
+#define CONFIG_ISDN_CAPI_CAPIFS_MODULE 1
+#define CONFIG_ISDN_CAPI_CAPIDRV_MODULE 1
+
+/*
+ * CAPI hardware drivers
+ */
+
+/*
+ * Active AVM cards
+ */
+#define CONFIG_CAPI_AVM 1
+
+/*
+ * Active Eicon DIVA Server cards
+ */
+#define CONFIG_CAPI_EICON 1
+#define CONFIG_ISDN_DIVAS_MODULE 1
+#define CONFIG_ISDN_DIVAS_BRIPCI 1
+#define CONFIG_ISDN_DIVAS_PRIPCI 1
+#define CONFIG_ISDN_DIVAS_DIVACAPI_MODULE 1
+#define CONFIG_ISDN_DIVAS_USERIDI_MODULE 1
+#define CONFIG_ISDN_DIVAS_MAINT_MODULE 1
+
+/*
+ * Telephony Support
+ */
+#undef CONFIG_PHONE
+
+/*
+ * Input device support
+ */
+#define CONFIG_INPUT 1
+
+/*
+ * Userland interfaces
+ */
+#define CONFIG_INPUT_MOUSEDEV 1
+#undef CONFIG_INPUT_MOUSEDEV_PSAUX
+#define CONFIG_INPUT_MOUSEDEV_SCREEN_X 1024
+#define CONFIG_INPUT_MOUSEDEV_SCREEN_Y 768
+#define CONFIG_INPUT_JOYDEV_MODULE 1
+#undef CONFIG_INPUT_TSDEV
+#define CONFIG_INPUT_EVDEV 1
+#undef CONFIG_INPUT_EVBUG
+
+/*
+ * Input I/O drivers
+ */
+#define CONFIG_GAMEPORT_MODULE 1
+#define CONFIG_SOUND_GAMEPORT_MODULE 1
+#define CONFIG_GAMEPORT_NS558_MODULE 1
+#define CONFIG_GAMEPORT_L4_MODULE 1
+#define CONFIG_GAMEPORT_EMU10K1_MODULE 1
+#define CONFIG_GAMEPORT_VORTEX_MODULE 1
+#define CONFIG_GAMEPORT_FM801_MODULE 1
+#define CONFIG_GAMEPORT_CS461x_MODULE 1
+#define CONFIG_SERIO 1
+#define CONFIG_SERIO_I8042 1
+#define CONFIG_SERIO_SERPORT 1
+#undef CONFIG_SERIO_CT82C710
+#undef CONFIG_SERIO_PARKBD
+#undef CONFIG_SERIO_PCIPS2
+
+/*
+ * Input Device Drivers
+ */
+#define CONFIG_INPUT_KEYBOARD 1
+#define CONFIG_KEYBOARD_ATKBD 1
+#undef CONFIG_KEYBOARD_SUNKBD
+#undef CONFIG_KEYBOARD_LKKBD
+#undef CONFIG_KEYBOARD_XTKBD
+#undef CONFIG_KEYBOARD_NEWTON
+#define CONFIG_INPUT_MOUSE 1
+#define CONFIG_MOUSE_PS2 1
+#define CONFIG_MOUSE_SERIAL_MODULE 1
+#define CONFIG_MOUSE_INPORT_MODULE 1
+#define CONFIG_MOUSE_ATIXL 1
+#define CONFIG_MOUSE_LOGIBM_MODULE 1
+#define CONFIG_MOUSE_PC110PAD_MODULE 1
+#define CONFIG_MOUSE_VSXXXAA_MODULE 1
+#define CONFIG_INPUT_JOYSTICK 1
+#define CONFIG_JOYSTICK_ANALOG_MODULE 1
+#define CONFIG_JOYSTICK_A3D_MODULE 1
+#define CONFIG_JOYSTICK_ADI_MODULE 1
+#define CONFIG_JOYSTICK_COBRA_MODULE 1
+#define CONFIG_JOYSTICK_GF2K_MODULE 1
+#define CONFIG_JOYSTICK_GRIP_MODULE 1
+#define CONFIG_JOYSTICK_GRIP_MP_MODULE 1
+#define CONFIG_JOYSTICK_GUILLEMOT_MODULE 1
+#define CONFIG_JOYSTICK_INTERACT_MODULE 1
+#define CONFIG_JOYSTICK_SIDEWINDER_MODULE 1
+#define CONFIG_JOYSTICK_TMDC_MODULE 1
+#define CONFIG_JOYSTICK_IFORCE_MODULE 1
+#define CONFIG_JOYSTICK_IFORCE_USB 1
+#define CONFIG_JOYSTICK_IFORCE_232 1
+#define CONFIG_JOYSTICK_WARRIOR_MODULE 1
+#define CONFIG_JOYSTICK_MAGELLAN_MODULE 1
+#define CONFIG_JOYSTICK_SPACEORB_MODULE 1
+#define CONFIG_JOYSTICK_SPACEBALL_MODULE 1
+#define CONFIG_JOYSTICK_STINGER_MODULE 1
+#define CONFIG_JOYSTICK_TWIDDLER_MODULE 1
+#define CONFIG_JOYSTICK_DB9_MODULE 1
+#define CONFIG_JOYSTICK_GAMECON_MODULE 1
+#define CONFIG_JOYSTICK_TURBOGRAFX_MODULE 1
+#undef CONFIG_INPUT_JOYDUMP
+#define CONFIG_INPUT_TOUCHSCREEN 1
+#define CONFIG_TOUCHSCREEN_GUNZE_MODULE 1
+#define CONFIG_INPUT_MISC 1
+#define CONFIG_INPUT_PCSPKR_MODULE 1
+#undef CONFIG_INPUT_UINPUT
+
+/*
+ * Character devices
+ */
+#define CONFIG_VT 1
+#define CONFIG_VT_CONSOLE 1
+#define CONFIG_HW_CONSOLE 1
+#define CONFIG_SERIAL_NONSTANDARD 1
+#define CONFIG_ROCKETPORT_MODULE 1
+#undef CONFIG_CYCLADES
+#define CONFIG_SYNCLINK_MODULE 1
+#define CONFIG_SYNCLINKMP_MODULE 1
+#define CONFIG_N_HDLC_MODULE 1
+#define CONFIG_STALDRV 1
+
+/*
+ * Serial drivers
+ */
+#define CONFIG_SERIAL_8250 1
+#define CONFIG_SERIAL_8250_CONSOLE 1
+#define CONFIG_SERIAL_8250_CS_MODULE 1
+#undef CONFIG_SERIAL_8250_ACPI
+#define CONFIG_SERIAL_8250_NR_UARTS 4
+#define CONFIG_SERIAL_8250_EXTENDED 1
+#undef CONFIG_SERIAL_8250_MANY_PORTS
+#define CONFIG_SERIAL_8250_SHARE_IRQ 1
+#define CONFIG_SERIAL_8250_DETECT_IRQ 1
+#define CONFIG_SERIAL_8250_MULTIPORT 1
+#define CONFIG_SERIAL_8250_RSA 1
+
+/*
+ * Non-8250 serial port support
+ */
+#define CONFIG_SERIAL_CORE 1
+#define CONFIG_SERIAL_CORE_CONSOLE 1
+#define CONFIG_UNIX98_PTYS 1
+#undef CONFIG_LEGACY_PTYS
+#define CONFIG_CRASH_MODULE 1
+#define CONFIG_PRINTER_MODULE 1
+#define CONFIG_LP_CONSOLE 1
+#define CONFIG_PPDEV_MODULE 1
+#define CONFIG_TIPAR_MODULE 1
+#undef CONFIG_QIC02_TAPE
+
+/*
+ * IPMI
+ */
+#define CONFIG_IPMI_HANDLER_MODULE 1
+#undef CONFIG_IPMI_PANIC_EVENT
+#define CONFIG_IPMI_DEVICE_INTERFACE_MODULE 1
+#define CONFIG_IPMI_SI_MODULE 1
+#define CONFIG_IPMI_WATCHDOG_MODULE 1
+
+/*
+ * Watchdog Cards
+ */
+#define CONFIG_WATCHDOG 1
+#undef CONFIG_WATCHDOG_NOWAYOUT
+
+/*
+ * Watchdog Device Drivers
+ */
+#define CONFIG_SOFT_WATCHDOG_MODULE 1
+#define CONFIG_ACQUIRE_WDT_MODULE 1
+#define CONFIG_ADVANTECH_WDT_MODULE 1
+#define CONFIG_ALIM1535_WDT_MODULE 1
+#define CONFIG_ALIM7101_WDT_MODULE 1
+#define CONFIG_SC520_WDT_MODULE 1
+#define CONFIG_EUROTECH_WDT_MODULE 1
+#define CONFIG_IB700_WDT_MODULE 1
+#define CONFIG_WAFER_WDT_MODULE 1
+#define CONFIG_I8XX_TCO_MODULE 1
+#define CONFIG_SC1200_WDT_MODULE 1
+#undef CONFIG_SCx200_WDT
+#undef CONFIG_60XX_WDT
+#define CONFIG_CPU5_WDT_MODULE 1
+#define CONFIG_W83627HF_WDT_MODULE 1
+#define CONFIG_W83877F_WDT_MODULE 1
+#define CONFIG_MACHZ_WDT_MODULE 1
+
+/*
+ * ISA-based Watchdog Cards
+ */
+#define CONFIG_PCWATCHDOG_MODULE 1
+#undef CONFIG_MIXCOMWD
+#define CONFIG_WDT_MODULE 1
+#undef CONFIG_WDT_501
+
+/*
+ * PCI-based Watchdog Cards
+ */
+#define CONFIG_PCIPCWATCHDOG_MODULE 1
+#define CONFIG_WDTPCI_MODULE 1
+#define CONFIG_WDT_501_PCI 1
+
+/*
+ * USB-based Watchdog Cards
+ */
+#define CONFIG_USBPCWATCHDOG_MODULE 1
+#define CONFIG_HW_RANDOM_MODULE 1
+#define CONFIG_NVRAM_MODULE 1
+#define CONFIG_RTC 1
+#define CONFIG_DTLK_MODULE 1
+#define CONFIG_R3964_MODULE 1
+#undef CONFIG_APPLICOM
+#define CONFIG_SONYPI_MODULE 1
+
+/*
+ * Ftape, the floppy tape device driver
+ */
+#define CONFIG_AGP 1
+#define CONFIG_AGP_ALI 1
+#define CONFIG_AGP_ATI 1
+#define CONFIG_AGP_AMD 1
+#define CONFIG_AGP_AMD64 1
+#define CONFIG_AGP_INTEL 1
+#define CONFIG_AGP_INTEL_MCH 1
+#define CONFIG_AGP_NVIDIA 1
+#define CONFIG_AGP_SIS 1
+#define CONFIG_AGP_SWORKS 1
+#define CONFIG_AGP_VIA 1
+#define CONFIG_AGP_EFFICEON 1
+#define CONFIG_DRM 1
+#define CONFIG_DRM_TDFX_MODULE 1
+#define CONFIG_DRM_GAMMA_MODULE 1
+#define CONFIG_DRM_R128_MODULE 1
+#define CONFIG_DRM_RADEON_MODULE 1
+#define CONFIG_DRM_I810_MODULE 1
+#define CONFIG_DRM_I830_MODULE 1
+#define CONFIG_DRM_MGA_MODULE 1
+#define CONFIG_DRM_SIS_MODULE 1
+
+/*
+ * PCMCIA character devices
+ */
+#define CONFIG_SYNCLINK_CS_MODULE 1
+#define CONFIG_MWAVE_MODULE 1
+#undef CONFIG_RAW_DRIVER
+#define CONFIG_HANGCHECK_TIMER_MODULE 1
+
+/*
+ * I2C support
+ */
+#define CONFIG_I2C_MODULE 1
+#define CONFIG_I2C_CHARDEV_MODULE 1
+
+/*
+ * I2C Algorithms
+ */
+#define CONFIG_I2C_ALGOBIT_MODULE 1
+#define CONFIG_I2C_ALGOPCF_MODULE 1
+
+/*
+ * I2C Hardware Bus support
+ */
+#define CONFIG_I2C_ALI1535_MODULE 1
+#define CONFIG_I2C_ALI1563_MODULE 1
+#define CONFIG_I2C_ALI15X3_MODULE 1
+#define CONFIG_I2C_AMD756_MODULE 1
+#define CONFIG_I2C_AMD8111_MODULE 1
+#define CONFIG_I2C_I801_MODULE 1
+#define CONFIG_I2C_I810_MODULE 1
+#define CONFIG_I2C_ISA_MODULE 1
+#define CONFIG_I2C_NFORCE2_MODULE 1
+#undef CONFIG_I2C_PARPORT
+#undef CONFIG_I2C_PARPORT_LIGHT
+#define CONFIG_I2C_PIIX4_MODULE 1
+#define CONFIG_I2C_PROSAVAGE_MODULE 1
+#define CONFIG_I2C_SAVAGE4_MODULE 1
+#undef CONFIG_SCx200_ACB
+#define CONFIG_I2C_SIS5595_MODULE 1
+#define CONFIG_I2C_SIS630_MODULE 1
+#define CONFIG_I2C_SIS96X_MODULE 1
+#define CONFIG_I2C_VIA_MODULE 1
+#define CONFIG_I2C_VIAPRO_MODULE 1
+#define CONFIG_I2C_VOODOO3_MODULE 1
+
+/*
+ * Hardware Sensors Chip support
+ */
+#define CONFIG_I2C_SENSOR_MODULE 1
+#define CONFIG_SENSORS_ADM1021_MODULE 1
+#define CONFIG_SENSORS_ASB100_MODULE 1
+#define CONFIG_SENSORS_DS1621_MODULE 1
+#define CONFIG_SENSORS_FSCHER_MODULE 1
+#define CONFIG_SENSORS_GL518SM_MODULE 1
+#define CONFIG_SENSORS_IT87_MODULE 1
+#define CONFIG_SENSORS_LM75_MODULE 1
+#define CONFIG_SENSORS_LM78_MODULE 1
+#define CONFIG_SENSORS_LM80_MODULE 1
+#define CONFIG_SENSORS_LM83_MODULE 1
+#define CONFIG_SENSORS_LM85_MODULE 1
+#define CONFIG_SENSORS_LM90_MODULE 1
+#define CONFIG_SENSORS_MAX1619_MODULE 1
+#define CONFIG_SENSORS_VIA686A_MODULE 1
+#define CONFIG_SENSORS_W83781D_MODULE 1
+#define CONFIG_SENSORS_W83L785TS_MODULE 1
+#define CONFIG_SENSORS_W83627HF_MODULE 1
+
+/*
+ * Other I2C Chip support
+ */
+#define CONFIG_SENSORS_EEPROM_MODULE 1
+#define CONFIG_SENSORS_PCF8574_MODULE 1
+#define CONFIG_SENSORS_PCF8591_MODULE 1
+#define CONFIG_SENSORS_RTC8564_MODULE 1
+#undef CONFIG_I2C_DEBUG_CORE
+#undef CONFIG_I2C_DEBUG_ALGO
+#undef CONFIG_I2C_DEBUG_BUS
+#undef CONFIG_I2C_DEBUG_CHIP
+
+/*
+ * Misc devices
+ */
+#define CONFIG_IBM_ASM_MODULE 1
+
+/*
+ * Multimedia devices
+ */
+#define CONFIG_VIDEO_DEV_MODULE 1
+
+/*
+ * Video For Linux
+ */
+
+/*
+ * Video Adapters
+ */
+#define CONFIG_VIDEO_BT848_MODULE 1
+#define CONFIG_VIDEO_PMS_MODULE 1
+#define CONFIG_VIDEO_BWQCAM_MODULE 1
+#define CONFIG_VIDEO_CQCAM_MODULE 1
+#define CONFIG_VIDEO_W9966_MODULE 1
+#define CONFIG_VIDEO_CPIA_MODULE 1
+#define CONFIG_VIDEO_CPIA_PP_MODULE 1
+#define CONFIG_VIDEO_CPIA_USB_MODULE 1
+#define CONFIG_VIDEO_SAA5246A_MODULE 1
+#define CONFIG_VIDEO_SAA5249_MODULE 1
+#define CONFIG_TUNER_3036_MODULE 1
+#define CONFIG_VIDEO_STRADIS_MODULE 1
+#define CONFIG_VIDEO_ZORAN_MODULE 1
+#define CONFIG_VIDEO_ZORAN_BUZ_MODULE 1
+#define CONFIG_VIDEO_ZORAN_DC10_MODULE 1
+#define CONFIG_VIDEO_ZORAN_DC30_MODULE 1
+#define CONFIG_VIDEO_ZORAN_LML33_MODULE 1
+#define CONFIG_VIDEO_ZORAN_LML33R10_MODULE 1
+#define CONFIG_VIDEO_SAA7134_MODULE 1
+#define CONFIG_VIDEO_MXB_MODULE 1
+#define CONFIG_VIDEO_DPC_MODULE 1
+#define CONFIG_VIDEO_HEXIUM_ORION_MODULE 1
+#define CONFIG_VIDEO_HEXIUM_GEMINI_MODULE 1
+#define CONFIG_VIDEO_CX88_MODULE 1
+
+/*
+ * Radio Adapters
+ */
+#define CONFIG_RADIO_CADET_MODULE 1
+#define CONFIG_RADIO_RTRACK_MODULE 1
+#define CONFIG_RADIO_RTRACK2_MODULE 1
+#define CONFIG_RADIO_AZTECH_MODULE 1
+#define CONFIG_RADIO_GEMTEK_MODULE 1
+#define CONFIG_RADIO_GEMTEK_PCI_MODULE 1
+#define CONFIG_RADIO_MAXIRADIO_MODULE 1
+#define CONFIG_RADIO_MAESTRO_MODULE 1
+#define CONFIG_RADIO_SF16FMI_MODULE 1
+#define CONFIG_RADIO_SF16FMR2_MODULE 1
+#define CONFIG_RADIO_TERRATEC_MODULE 1
+#define CONFIG_RADIO_TRUST_MODULE 1
+#define CONFIG_RADIO_TYPHOON_MODULE 1
+#define CONFIG_RADIO_TYPHOON_PROC_FS 1
+#define CONFIG_RADIO_ZOLTRIX_MODULE 1
+
+/*
+ * Digital Video Broadcasting Devices
+ */
+#undef CONFIG_DVB
+#define CONFIG_VIDEO_SAA7146_MODULE 1
+#define CONFIG_VIDEO_SAA7146_VV_MODULE 1
+#define CONFIG_VIDEO_VIDEOBUF_MODULE 1
+#define CONFIG_VIDEO_TUNER_MODULE 1
+#define CONFIG_VIDEO_BUF_MODULE 1
+#define CONFIG_VIDEO_BTCX_MODULE 1
+#define CONFIG_VIDEO_IR_MODULE 1
+
+/*
+ * Graphics support
+ */
+#define CONFIG_FB 1
+#undef CONFIG_FB_PM2
+#undef CONFIG_FB_CYBER2000
+#undef CONFIG_FB_ASILIANT
+#undef CONFIG_FB_IMSTT
+#define CONFIG_FB_VGA16_MODULE 1
+#define CONFIG_FB_VESA 1
+#define CONFIG_VIDEO_SELECT 1
+#define CONFIG_FB_HGA_MODULE 1
+#define CONFIG_FB_HGA_ACCEL 1
+#define CONFIG_FB_RIVA_MODULE 1
+#define CONFIG_FB_I810_MODULE 1
+#define CONFIG_FB_I810_GTF 1
+#define CONFIG_FB_MATROX_MODULE 1
+#define CONFIG_FB_MATROX_MILLENIUM 1
+#define CONFIG_FB_MATROX_MYSTIQUE 1
+#define CONFIG_FB_MATROX_G450 1
+#define CONFIG_FB_MATROX_G100 1
+#define CONFIG_FB_MATROX_I2C_MODULE 1
+#define CONFIG_FB_MATROX_MAVEN_MODULE 1
+#define CONFIG_FB_MATROX_MULTIHEAD 1
+#undef CONFIG_FB_RADEON_OLD
+#define CONFIG_FB_RADEON_MODULE 1
+#define CONFIG_FB_RADEON_I2C 1
+#undef CONFIG_FB_RADEON_DEBUG
+#define CONFIG_FB_ATY128_MODULE 1
+#define CONFIG_FB_ATY_MODULE 1
+#define CONFIG_FB_ATY_CT 1
+#define CONFIG_FB_ATY_GX 1
+#undef CONFIG_FB_ATY_XL_INIT
+#undef CONFIG_FB_SIS
+#define CONFIG_FB_NEOMAGIC_MODULE 1
+#define CONFIG_FB_KYRO_MODULE 1
+#define CONFIG_FB_3DFX_MODULE 1
+#define CONFIG_FB_3DFX_ACCEL 1
+#define CONFIG_FB_VOODOO1_MODULE 1
+#define CONFIG_FB_TRIDENT_MODULE 1
+#define CONFIG_FB_TRIDENT_ACCEL 1
+#undef CONFIG_FB_VIRTUAL
+
+/*
+ * Console display driver support
+ */
+#define CONFIG_VGA_CONSOLE 1
+#define CONFIG_MDA_CONSOLE_MODULE 1
+#define CONFIG_DUMMY_CONSOLE 1
+#define CONFIG_FRAMEBUFFER_CONSOLE 1
+#define CONFIG_PCI_CONSOLE 1
+#undef CONFIG_FONTS
+#define CONFIG_FONT_8x8 1
+#define CONFIG_FONT_8x16 1
+
+/*
+ * Logo configuration
+ */
+#define CONFIG_LOGO 1
+#undef CONFIG_LOGO_LINUX_MONO
+#undef CONFIG_LOGO_LINUX_VGA16
+#define CONFIG_LOGO_LINUX_CLUT224 1
+
+/*
+ * Sound
+ */
+#define CONFIG_SOUND_MODULE 1
+
+/*
+ * Advanced Linux Sound Architecture
+ */
+#define CONFIG_SND_MODULE 1
+#define CONFIG_SND_TIMER_MODULE 1
+#define CONFIG_SND_PCM_MODULE 1
+#define CONFIG_SND_HWDEP_MODULE 1
+#define CONFIG_SND_RAWMIDI_MODULE 1
+#define CONFIG_SND_SEQUENCER_MODULE 1
+#define CONFIG_SND_SEQ_DUMMY_MODULE 1
+#define CONFIG_SND_OSSEMUL 1
+#define CONFIG_SND_MIXER_OSS_MODULE 1
+#define CONFIG_SND_PCM_OSS_MODULE 1
+#define CONFIG_SND_SEQUENCER_OSS 1
+#define CONFIG_SND_RTCTIMER_MODULE 1
+#undef CONFIG_SND_VERBOSE_PRINTK
+#undef CONFIG_SND_DEBUG
+
+/*
+ * Generic devices
+ */
+#define CONFIG_SND_MPU401_UART_MODULE 1
+#define CONFIG_SND_OPL3_LIB_MODULE 1
+#define CONFIG_SND_OPL4_LIB_MODULE 1
+#define CONFIG_SND_VX_LIB_MODULE 1
+#define CONFIG_SND_DUMMY_MODULE 1
+#define CONFIG_SND_VIRMIDI_MODULE 1
+#define CONFIG_SND_MTPAV_MODULE 1
+#undef CONFIG_SND_SERIAL_U16550
+#define CONFIG_SND_MPU401_MODULE 1
+
+/*
+ * ISA devices
+ */
+#define CONFIG_SND_AD1816A_MODULE 1
+#define CONFIG_SND_AD1848_MODULE 1
+#define CONFIG_SND_CS4231_MODULE 1
+#define CONFIG_SND_CS4232_MODULE 1
+#define CONFIG_SND_CS4236_MODULE 1
+#define CONFIG_SND_ES968_MODULE 1
+#define CONFIG_SND_ES1688_MODULE 1
+#define CONFIG_SND_ES18XX_MODULE 1
+#define CONFIG_SND_GUSCLASSIC_MODULE 1
+#define CONFIG_SND_GUSEXTREME_MODULE 1
+#define CONFIG_SND_GUSMAX_MODULE 1
+#define CONFIG_SND_INTERWAVE_MODULE 1
+#define CONFIG_SND_INTERWAVE_STB_MODULE 1
+#define CONFIG_SND_OPTI92X_AD1848_MODULE 1
+#define CONFIG_SND_OPTI92X_CS4231_MODULE 1
+#define CONFIG_SND_OPTI93X_MODULE 1
+#define CONFIG_SND_SB8_MODULE 1
+#define CONFIG_SND_SB16_MODULE 1
+#define CONFIG_SND_SBAWE_MODULE 1
+#define CONFIG_SND_SB16_CSP 1
+#undef CONFIG_SND_WAVEFRONT
+#define CONFIG_SND_ALS100_MODULE 1
+#define CONFIG_SND_AZT2320_MODULE 1
+#define CONFIG_SND_CMI8330_MODULE 1
+#define CONFIG_SND_DT019X_MODULE 1
+#define CONFIG_SND_OPL3SA2_MODULE 1
+#define CONFIG_SND_SGALAXY_MODULE 1
+#define CONFIG_SND_SSCAPE_MODULE 1
+
+/*
+ * PCI devices
+ */
+#define CONFIG_SND_AC97_CODEC_MODULE 1
+#define CONFIG_SND_ALI5451_MODULE 1
+#define CONFIG_SND_ATIIXP_MODULE 1
+#define CONFIG_SND_AU8810_MODULE 1
+#define CONFIG_SND_AU8820_MODULE 1
+#define CONFIG_SND_AU8830_MODULE 1
+#define CONFIG_SND_AZT3328_MODULE 1
+#define CONFIG_SND_BT87X_MODULE 1
+#define CONFIG_SND_CS46XX_MODULE 1
+#define CONFIG_SND_CS46XX_NEW_DSP 1
+#define CONFIG_SND_CS4281_MODULE 1
+#define CONFIG_SND_EMU10K1_MODULE 1
+#define CONFIG_SND_KORG1212_MODULE 1
+#define CONFIG_SND_MIXART_MODULE 1
+#define CONFIG_SND_NM256_MODULE 1
+#define CONFIG_SND_RME32_MODULE 1
+#define CONFIG_SND_RME96_MODULE 1
+#define CONFIG_SND_RME9652_MODULE 1
+#define CONFIG_SND_HDSP_MODULE 1
+#define CONFIG_SND_TRIDENT_MODULE 1
+#define CONFIG_SND_YMFPCI_MODULE 1
+#define CONFIG_SND_ALS4000_MODULE 1
+#define CONFIG_SND_CMIPCI_MODULE 1
+#define CONFIG_SND_ENS1370_MODULE 1
+#define CONFIG_SND_ENS1371_MODULE 1
+#define CONFIG_SND_ES1938_MODULE 1
+#define CONFIG_SND_ES1968_MODULE 1
+#define CONFIG_SND_MAESTRO3_MODULE 1
+#define CONFIG_SND_FM801_MODULE 1
+#define CONFIG_SND_FM801_TEA575X_MODULE 1
+#define CONFIG_SND_ICE1712_MODULE 1
+#define CONFIG_SND_ICE1724_MODULE 1
+#define CONFIG_SND_INTEL8X0_MODULE 1
+#define CONFIG_SND_INTEL8X0M_MODULE 1
+#define CONFIG_SND_SONICVIBES_MODULE 1
+#define CONFIG_SND_VIA82XX_MODULE 1
+#define CONFIG_SND_VX222_MODULE 1
+
+/*
+ * ALSA USB devices
+ */
+#define CONFIG_SND_USB_AUDIO_MODULE 1
+
+/*
+ * PCMCIA devices
+ */
+#undef CONFIG_SND_VXPOCKET
+#undef CONFIG_SND_VXP440
+#define CONFIG_SND_PDAUDIOCF_MODULE 1
+
+/*
+ * Open Sound System
+ */
+#undef CONFIG_SOUND_PRIME
+
+/*
+ * USB support
+ */
+#define CONFIG_USB 1
+#undef CONFIG_USB_DEBUG
+
+/*
+ * Miscellaneous USB options
+ */
+#define CONFIG_USB_DEVICEFS 1
+#undef CONFIG_USB_BANDWIDTH
+#undef CONFIG_USB_DYNAMIC_MINORS
+
+/*
+ * USB Host Controller Drivers
+ */
+#define CONFIG_USB_EHCI_HCD_MODULE 1
+#define CONFIG_USB_EHCI_SPLIT_ISO 1
+#define CONFIG_USB_EHCI_ROOT_HUB_TT 1
+#define CONFIG_USB_OHCI_HCD_MODULE 1
+#define CONFIG_USB_UHCI_HCD_MODULE 1
+
+/*
+ * USB Device Class drivers
+ */
+#define CONFIG_USB_AUDIO_MODULE 1
+
+/*
+ * USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+ */
+#define CONFIG_USB_MIDI_MODULE 1
+#define CONFIG_USB_ACM_MODULE 1
+#define CONFIG_USB_PRINTER_MODULE 1
+#define CONFIG_USB_STORAGE_MODULE 1
+#undef CONFIG_USB_STORAGE_DEBUG
+#define CONFIG_USB_STORAGE_DATAFAB 1
+#define CONFIG_USB_STORAGE_FREECOM 1
+#define CONFIG_USB_STORAGE_ISD200 1
+#define CONFIG_USB_STORAGE_DPCM 1
+#define CONFIG_USB_STORAGE_HP8200e 1
+#define CONFIG_USB_STORAGE_SDDR09 1
+#define CONFIG_USB_STORAGE_SDDR55 1
+#define CONFIG_USB_STORAGE_JUMPSHOT 1
+
+/*
+ * USB Human Interface Devices (HID)
+ */
+#define CONFIG_USB_HID 1
+#define CONFIG_USB_HIDINPUT 1
+#define CONFIG_HID_FF 1
+#define CONFIG_HID_PID 1
+#define CONFIG_LOGITECH_FF 1
+#define CONFIG_THRUSTMASTER_FF 1
+#define CONFIG_USB_HIDDEV 1
+#define CONFIG_USB_AIPTEK_MODULE 1
+#define CONFIG_USB_WACOM_MODULE 1
+#define CONFIG_USB_KBTAB_MODULE 1
+#define CONFIG_USB_POWERMATE_MODULE 1
+#define CONFIG_USB_MTOUCH_MODULE 1
+#define CONFIG_USB_EGALAX_MODULE 1
+#define CONFIG_USB_XPAD_MODULE 1
+#define CONFIG_USB_ATI_REMOTE_MODULE 1
+
+/*
+ * USB Imaging devices
+ */
+#define CONFIG_USB_MDC800_MODULE 1
+#define CONFIG_USB_MICROTEK_MODULE 1
+#define CONFIG_USB_HPUSBSCSI_MODULE 1
+
+/*
+ * USB Multimedia devices
+ */
+#define CONFIG_USB_DABUSB_MODULE 1
+#define CONFIG_USB_VICAM_MODULE 1
+#define CONFIG_USB_DSBR_MODULE 1
+#define CONFIG_USB_IBMCAM_MODULE 1
+#define CONFIG_USB_KONICAWC_MODULE 1
+#define CONFIG_USB_OV511_MODULE 1
+#define CONFIG_USB_SE401_MODULE 1
+#define CONFIG_USB_STV680_MODULE 1
+#define CONFIG_USB_W9968CF_MODULE 1
+
+/*
+ * USB Network adaptors
+ */
+#define CONFIG_USB_CATC_MODULE 1
+#define CONFIG_USB_KAWETH_MODULE 1
+#define CONFIG_USB_PEGASUS_MODULE 1
+#define CONFIG_USB_RTL8150_MODULE 1
+#define CONFIG_USB_USBNET_MODULE 1
+
+/*
+ * USB Host-to-Host Cables
+ */
+#define CONFIG_USB_ALI_M5632 1
+#define CONFIG_USB_AN2720 1
+#define CONFIG_USB_BELKIN 1
+#define CONFIG_USB_GENESYS 1
+#define CONFIG_USB_NET1080 1
+#define CONFIG_USB_PL2301 1
+
+/*
+ * Intelligent USB Devices/Gadgets
+ */
+#define CONFIG_USB_ARMLINUX 1
+#define CONFIG_USB_EPSON2888 1
+#define CONFIG_USB_ZAURUS 1
+#define CONFIG_USB_CDCETHER 1
+
+/*
+ * USB Network Adapters
+ */
+#define CONFIG_USB_AX8817X 1
+
+/*
+ * USB port drivers
+ */
+#define CONFIG_USB_USS720_MODULE 1
+
+/*
+ * USB Serial Converter support
+ */
+#define CONFIG_USB_SERIAL_MODULE 1
+#define CONFIG_USB_SERIAL_GENERIC 1
+#define CONFIG_USB_SERIAL_BELKIN_MODULE 1
+#define CONFIG_USB_SERIAL_DIGI_ACCELEPORT_MODULE 1
+#define CONFIG_USB_SERIAL_EMPEG_MODULE 1
+#define CONFIG_USB_SERIAL_FTDI_SIO_MODULE 1
+#define CONFIG_USB_SERIAL_VISOR_MODULE 1
+#define CONFIG_USB_SERIAL_IPAQ_MODULE 1
+#define CONFIG_USB_SERIAL_IR_MODULE 1
+#define CONFIG_USB_SERIAL_EDGEPORT_MODULE 1
+#define CONFIG_USB_SERIAL_EDGEPORT_TI_MODULE 1
+#define CONFIG_USB_SERIAL_KEYSPAN_PDA_MODULE 1
+#define CONFIG_USB_SERIAL_KEYSPAN_MODULE 1
+#define CONFIG_USB_SERIAL_KEYSPAN_MPR 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA28 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA28X 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA28XA 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA28XB 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA19 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA18X 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA19W 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA19QW 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA19QI 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA49W 1
+#define CONFIG_USB_SERIAL_KEYSPAN_USA49WLC 1
+#define CONFIG_USB_SERIAL_KLSI_MODULE 1
+#define CONFIG_USB_SERIAL_KOBIL_SCT_MODULE 1
+#define CONFIG_USB_SERIAL_MCT_U232_MODULE 1
+#define CONFIG_USB_SERIAL_PL2303_MODULE 1
+#define CONFIG_USB_SERIAL_SAFE_MODULE 1
+#define CONFIG_USB_SERIAL_SAFE_PADDED 1
+#define CONFIG_USB_SERIAL_CYBERJACK_MODULE 1
+#define CONFIG_USB_SERIAL_XIRCOM_MODULE 1
+#define CONFIG_USB_SERIAL_OMNINET_MODULE 1
+#define CONFIG_USB_EZUSB 1
+
+/*
+ * USB Miscellaneous drivers
+ */
+#define CONFIG_USB_EMI62_MODULE 1
+#undef CONFIG_USB_EMI26
+#define CONFIG_USB_TIGL_MODULE 1
+#define CONFIG_USB_AUERSWALD_MODULE 1
+#define CONFIG_USB_RIO500_MODULE 1
+#define CONFIG_USB_LEGOTOWER_MODULE 1
+#define CONFIG_USB_LCD_MODULE 1
+#define CONFIG_USB_LED_MODULE 1
+#undef CONFIG_USB_CYTHERM
+#define CONFIG_USB_PHIDGETSERVO_MODULE 1
+#define CONFIG_USB_TEST_MODULE 1
+
+/*
+ * USB Gadget Support
+ */
+#undef CONFIG_USB_GADGET
+
+/*
+ * File systems
+ */
+#define CONFIG_EXT2_FS 1
+#define CONFIG_EXT2_FS_XATTR 1
+#define CONFIG_EXT2_FS_POSIX_ACL 1
+#define CONFIG_EXT2_FS_SECURITY 1
+#define CONFIG_EXT3_FS_MODULE 1
+#define CONFIG_EXT3_FS_XATTR 1
+#define CONFIG_EXT3_FS_POSIX_ACL 1
+#define CONFIG_EXT3_FS_SECURITY 1
+#define CONFIG_JBD_MODULE 1
+#undef CONFIG_JBD_DEBUG
+#define CONFIG_FS_MBCACHE 1
+#define CONFIG_REISERFS_FS_MODULE 1
+#undef CONFIG_REISERFS_CHECK
+#define CONFIG_REISERFS_PROC_INFO 1
+#define CONFIG_REISERFS_FS_XATTR 1
+#define CONFIG_REISERFS_FS_POSIX_ACL 1
+#define CONFIG_REISERFS_FS_SECURITY 1
+#define CONFIG_JFS_FS_MODULE 1
+#define CONFIG_JFS_POSIX_ACL 1
+#undef CONFIG_JFS_DEBUG
+#undef CONFIG_JFS_STATISTICS
+#define CONFIG_FS_POSIX_ACL 1
+#define CONFIG_XFS_FS_MODULE 1
+#undef CONFIG_XFS_RT
+#define CONFIG_XFS_QUOTA 1
+#define CONFIG_XFS_SECURITY 1
+#define CONFIG_XFS_POSIX_ACL 1
+#define CONFIG_MINIX_FS_MODULE 1
+#define CONFIG_ROMFS_FS_MODULE 1
+#define CONFIG_QUOTA 1
+#undef CONFIG_QFMT_V1
+#define CONFIG_QFMT_V2 1
+#define CONFIG_QUOTACTL 1
+#define CONFIG_AUTOFS_FS_MODULE 1
+#define CONFIG_AUTOFS4_FS_MODULE 1
+
+/*
+ * CD-ROM/DVD Filesystems
+ */
+#define CONFIG_ISO9660_FS 1
+#define CONFIG_JOLIET 1
+#define CONFIG_ZISOFS 1
+#define CONFIG_ZISOFS_FS 1
+#define CONFIG_UDF_FS_MODULE 1
+
+/*
+ * DOS/FAT/NT Filesystems
+ */
+#define CONFIG_FAT_FS_MODULE 1
+#define CONFIG_MSDOS_FS_MODULE 1
+#define CONFIG_VFAT_FS_MODULE 1
+#undef CONFIG_NTFS_FS
+
+/*
+ * Pseudo filesystems
+ */
+#define CONFIG_PROC_FS 1
+#define CONFIG_PROC_KCORE 1
+#define CONFIG_SYSFS 1
+#undef CONFIG_DEVFS_FS
+#define CONFIG_DEVPTS_FS_XATTR 1
+#define CONFIG_DEVPTS_FS_SECURITY 1
+#define CONFIG_TMPFS 1
+#define CONFIG_HUGETLBFS 1
+#define CONFIG_HUGETLB_PAGE 1
+#define CONFIG_RAMFS 1
+
+/*
+ * Miscellaneous filesystems
+ */
+#undef CONFIG_ADFS_FS
+#define CONFIG_AFFS_FS_MODULE 1
+#define CONFIG_HFS_FS_MODULE 1
+#define CONFIG_HFSPLUS_FS_MODULE 1
+#define CONFIG_BEFS_FS_MODULE 1
+#undef CONFIG_BEFS_DEBUG
+#define CONFIG_BFS_FS_MODULE 1
+#define CONFIG_EFS_FS_MODULE 1
+#undef CONFIG_JFFS_FS
+#define CONFIG_JFFS2_FS_MODULE 1
+#define CONFIG_JFFS2_FS_DEBUG 0
+#define CONFIG_JFFS2_FS_NAND 1
+#define CONFIG_CRAMFS_MODULE 1
+#define CONFIG_VXFS_FS_MODULE 1
+#undef CONFIG_HPFS_FS
+#define CONFIG_QNX4FS_FS_MODULE 1
+#undef CONFIG_QNX4FS_RW
+#define CONFIG_SYSV_FS_MODULE 1
+#define CONFIG_UFS_FS_MODULE 1
+#undef CONFIG_UFS_FS_WRITE
+
+/*
+ * Network File Systems
+ */
+#define CONFIG_NFS_FS_MODULE 1
+#define CONFIG_NFS_V3 1
+#define CONFIG_NFS_V4 1
+#define CONFIG_NFS_DIRECTIO 1
+#define CONFIG_NFSD_MODULE 1
+#define CONFIG_NFSD_V3 1
+#define CONFIG_NFSD_V4 1
+#define CONFIG_NFSD_TCP 1
+#define CONFIG_LOCKD_MODULE 1
+#define CONFIG_LOCKD_V4 1
+#define CONFIG_EXPORTFS_MODULE 1
+#define CONFIG_SUNRPC_MODULE 1
+#define CONFIG_SUNRPC_GSS_MODULE 1
+#define CONFIG_RPCSEC_GSS_KRB5_MODULE 1
+#define CONFIG_SMB_FS_MODULE 1
+#undef CONFIG_SMB_NLS_DEFAULT
+#define CONFIG_CIFS_MODULE 1
+#undef CONFIG_CIFS_STATS
+#define CONFIG_NCP_FS_MODULE 1
+#define CONFIG_NCPFS_PACKET_SIGNING 1
+#define CONFIG_NCPFS_IOCTL_LOCKING 1
+#define CONFIG_NCPFS_STRONG 1
+#define CONFIG_NCPFS_NFS_NS 1
+#define CONFIG_NCPFS_OS2_NS 1
+#define CONFIG_NCPFS_SMALLDOS 1
+#define CONFIG_NCPFS_NLS 1
+#define CONFIG_NCPFS_EXTRAS 1
+#undef CONFIG_CODA_FS
+#undef CONFIG_AFS_FS
+
+/*
+ * Partition Types
+ */
+#define CONFIG_PARTITION_ADVANCED 1
+#undef CONFIG_ACORN_PARTITION
+#define CONFIG_OSF_PARTITION 1
+#undef CONFIG_AMIGA_PARTITION
+#undef CONFIG_ATARI_PARTITION
+#define CONFIG_MAC_PARTITION 1
+#define CONFIG_MSDOS_PARTITION 1
+#define CONFIG_BSD_DISKLABEL 1
+#define CONFIG_MINIX_SUBPARTITION 1
+#define CONFIG_SOLARIS_X86_PARTITION 1
+#define CONFIG_UNIXWARE_DISKLABEL 1
+#undef CONFIG_LDM_PARTITION
+#undef CONFIG_NEC98_PARTITION
+#define CONFIG_SGI_PARTITION 1
+#undef CONFIG_ULTRIX_PARTITION
+#define CONFIG_SUN_PARTITION 1
+#define CONFIG_EFI_PARTITION 1
+
+/*
+ * Native Language Support
+ */
+#define CONFIG_NLS 1
+#define CONFIG_NLS_DEFAULT "utf8"
+#define CONFIG_NLS_CODEPAGE_437_MODULE 1
+#define CONFIG_NLS_CODEPAGE_737_MODULE 1
+#define CONFIG_NLS_CODEPAGE_775_MODULE 1
+#define CONFIG_NLS_CODEPAGE_850_MODULE 1
+#define CONFIG_NLS_CODEPAGE_852_MODULE 1
+#define CONFIG_NLS_CODEPAGE_855_MODULE 1
+#define CONFIG_NLS_CODEPAGE_857_MODULE 1
+#define CONFIG_NLS_CODEPAGE_860_MODULE 1
+#define CONFIG_NLS_CODEPAGE_861_MODULE 1
+#define CONFIG_NLS_CODEPAGE_862_MODULE 1
+#define CONFIG_NLS_CODEPAGE_863_MODULE 1
+#define CONFIG_NLS_CODEPAGE_864_MODULE 1
+#define CONFIG_NLS_CODEPAGE_865_MODULE 1
+#define CONFIG_NLS_CODEPAGE_866_MODULE 1
+#define CONFIG_NLS_CODEPAGE_869_MODULE 1
+#define CONFIG_NLS_CODEPAGE_936_MODULE 1
+#define CONFIG_NLS_CODEPAGE_950_MODULE 1
+#define CONFIG_NLS_CODEPAGE_932_MODULE 1
+#define CONFIG_NLS_CODEPAGE_949_MODULE 1
+#define CONFIG_NLS_CODEPAGE_874_MODULE 1
+#define CONFIG_NLS_ISO8859_8_MODULE 1
+#define CONFIG_NLS_CODEPAGE_1250_MODULE 1
+#define CONFIG_NLS_CODEPAGE_1251_MODULE 1
+#define CONFIG_NLS_ISO8859_1_MODULE 1
+#define CONFIG_NLS_ISO8859_2_MODULE 1
+#define CONFIG_NLS_ISO8859_3_MODULE 1
+#define CONFIG_NLS_ISO8859_4_MODULE 1
+#define CONFIG_NLS_ISO8859_5_MODULE 1
+#define CONFIG_NLS_ISO8859_6_MODULE 1
+#define CONFIG_NLS_ISO8859_7_MODULE 1
+#define CONFIG_NLS_ISO8859_9_MODULE 1
+#define CONFIG_NLS_ISO8859_13_MODULE 1
+#define CONFIG_NLS_ISO8859_14_MODULE 1
+#define CONFIG_NLS_ISO8859_15_MODULE 1
+#define CONFIG_NLS_KOI8_R_MODULE 1
+#define CONFIG_NLS_KOI8_U_MODULE 1
+#define CONFIG_NLS_UTF8_MODULE 1
+
+/*
+ * Profiling support
+ */
+#define CONFIG_PROFILING 1
+#define CONFIG_OPROFILE_MODULE 1
+
+/*
+ * Kernel hacking
+ */
+#define CONFIG_DEBUG_KERNEL 1
+#define CONFIG_EARLY_PRINTK 1
+#define CONFIG_DEBUG_STACKOVERFLOW 1
+#undef CONFIG_DEBUG_STACK_USAGE
+#undef CONFIG_DEBUG_SLAB
+#define CONFIG_MAGIC_SYSRQ 1
+#undef CONFIG_DEBUG_SPINLOCK
+#undef CONFIG_DEBUG_PAGEALLOC
+#undef CONFIG_DEBUG_HIGHMEM
+#define CONFIG_DEBUG_INFO 1
+#define CONFIG_DEBUG_SPINLOCK_SLEEP 1
+#undef CONFIG_FRAME_POINTER
+#define CONFIG_X86_FIND_SMP_CONFIG 1
+#define CONFIG_X86_MPPARSE 1
+
+/*
+ * Security options
+ */
+#define CONFIG_SECURITY 1
+#define CONFIG_SECURITY_NETWORK 1
+#define CONFIG_SECURITY_CAPABILITIES 1
+#undef CONFIG_SECURITY_ROOTPLUG
+#define CONFIG_SECURITY_SELINUX 1
+#define CONFIG_SECURITY_SELINUX_BOOTPARAM 1
+#define CONFIG_SECURITY_SELINUX_DISABLE 1
+#define CONFIG_SECURITY_SELINUX_DEVELOP 1
+#undef CONFIG_SECURITY_SELINUX_MLS
+
+/*
+ * Cryptographic options
+ */
+#define CONFIG_CRYPTO 1
+#define CONFIG_CRYPTO_HMAC 1
+#define CONFIG_CRYPTO_NULL_MODULE 1
+#define CONFIG_CRYPTO_MD4_MODULE 1
+#define CONFIG_CRYPTO_MD5 1
+#define CONFIG_CRYPTO_SHA1_MODULE 1
+#define CONFIG_CRYPTO_SHA256_MODULE 1
+#define CONFIG_CRYPTO_SHA512_MODULE 1
+#define CONFIG_CRYPTO_DES_MODULE 1
+#define CONFIG_CRYPTO_BLOWFISH_MODULE 1
+#define CONFIG_CRYPTO_TWOFISH_MODULE 1
+#define CONFIG_CRYPTO_SERPENT_MODULE 1
+#define CONFIG_CRYPTO_AES_MODULE 1
+#define CONFIG_CRYPTO_CAST5_MODULE 1
+#define CONFIG_CRYPTO_CAST6_MODULE 1
+#define CONFIG_CRYPTO_ARC4_MODULE 1
+#define CONFIG_CRYPTO_DEFLATE_MODULE 1
+#define CONFIG_CRYPTO_MICHAEL_MIC_MODULE 1
+#define CONFIG_CRYPTO_CRC32C_MODULE 1
+#undef CONFIG_CRYPTO_TEST
+
+/*
+ * Library routines
+ */
+#define CONFIG_CRC32 1
+#define CONFIG_LIBCRC32C_MODULE 1
+#define CONFIG_ZLIB_INFLATE 1
+#define CONFIG_ZLIB_DEFLATE_MODULE 1
+#define CONFIG_X86_SMP 1
+#define CONFIG_X86_HT 1
+#define CONFIG_X86_BIOS_REBOOT 1
+#define CONFIG_X86_TRAMPOLINE 1
+#define CONFIG_X86_STD_RESOURCES 1
+#define CONFIG_PC 1
diff --git a/include/linux/prio_tree.h b/include/linux/prio_tree.h
new file mode 100644 (file)
index 0000000..4ac5c62
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef _LINUX_PRIO_TREE_H
+#define _LINUX_PRIO_TREE_H
+
+struct prio_tree_node {
+       struct prio_tree_node   *left;
+       struct prio_tree_node   *right;
+       struct prio_tree_node   *parent;
+};
+
+struct prio_tree_root {
+       struct prio_tree_node   *prio_tree_node;
+       unsigned int            index_bits;
+};
+
+struct prio_tree_iter {
+       struct prio_tree_node   *cur;
+       unsigned long           mask;
+       unsigned long           value;
+       int                     size_level;
+};
+
+#define INIT_PRIO_TREE_ROOT(ptr)       \
+do {                                   \
+       (ptr)->prio_tree_node = NULL;   \
+       (ptr)->index_bits = 1;          \
+} while (0)
+
+#define INIT_PRIO_TREE_NODE(ptr)                               \
+do {                                                           \
+       (ptr)->left = (ptr)->right = (ptr)->parent = (ptr);     \
+} while (0)
+
+#define INIT_PRIO_TREE_ITER(ptr)       \
+do {                                   \
+       (ptr)->cur = NULL;              \
+       (ptr)->mask = 0UL;              \
+       (ptr)->value = 0UL;             \
+       (ptr)->size_level = 0;          \
+} while (0)
+
+#define prio_tree_entry(ptr, type, member) \
+       ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
+
+static inline int prio_tree_empty(const struct prio_tree_root *root)
+{
+       return root->prio_tree_node == NULL;
+}
+
+static inline int prio_tree_root(const struct prio_tree_node *node)
+{
+       return node->parent == node;
+}
+
+static inline int prio_tree_left_empty(const struct prio_tree_node *node)
+{
+       return node->left == node;
+}
+
+static inline int prio_tree_right_empty(const struct prio_tree_node *node)
+{
+       return node->right == node;
+}
+
+#endif /* _LINUX_PRIO_TREE_H */
diff --git a/include/net/tux.h b/include/net/tux.h
new file mode 100644 (file)
index 0000000..188c58e
--- /dev/null
@@ -0,0 +1,800 @@
+#ifndef _NET_TUX_H
+#define _NET_TUX_H
+
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * tux.h: main structure definitions and function prototypes
+ */
+
+#define __KERNEL_SYSCALLS__
+
+#include <linux/mm.h>
+#include <linux/net.h>
+#include <linux/wait.h>
+#include <linux/namei.h>
+#include <linux/file.h>
+#include <linux/mman.h>
+#include <linux/swap.h>
+#include <linux/ctype.h>
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/unistd.h>
+#include <linux/sysctl.h>
+#include <linux/proc_fs.h>
+#include <linux/pagemap.h>
+#include <linux/vmalloc.h>
+#include <linux/utsname.h>
+#include <linux/smp_lock.h>
+#include <linux/kernel_stat.h>
+#include <linux/kernel_stat.h>
+#include <linux/time.h>
+#include <asm/div64.h>
+#include <asm/unaligned.h>
+#include <linux/compiler.h>
+#include <linux/mount.h>
+#include <linux/zlib.h>
+
+#include <net/tcp.h>
+#include <net/tux_u.h>
+
+/* Maximum number of threads: */
+#define CONFIG_TUX_NUMTHREADS 8
+
+/* Number of cachemiss/IO threads: */
+#define NR_IO_THREADS 32
+
+/* Maximum number of listen sockets per thread: */
+#define CONFIG_TUX_NUMSOCKETS 16
+
+extern spinlock_t tux_module_lock;
+extern struct module *tux_module;
+extern long (*sys_tux_ptr) (unsigned int action, user_req_t *u_info);
+
+#undef Dprintk
+
+extern int tux_TDprintk;
+extern int tux_Dprintk;
+
+#define TUX_DEBUG CONFIG_TUX_DEBUG
+#if CONFIG_TUX_DEBUG
+# define TUX_BUG() BUG()
+
+# define TUX_DPRINTK 1
+# define TDprintk(x...) do { if (tux_TDprintk) { printk("<%ld:%s:%d>: ", jiffies, __FILE__, __LINE__); printk(x); } } while (0)
+# define Dprintk(x...) do { if (tux_Dprintk == 1) TDprintk(x); } while (0)
+#else
+# define TUX_DPRINTK 0
+# define Dprintk(x...) do { } while (0)
+# define TDprintk(x...) do { } while (0)
+//# define TUX_BUG() BUG()
+# define TUX_BUG() do { } while (0)
+#endif
+
+#if 1
+# define INC_STAT(x) do { } while (0)
+# define DEC_STAT(x) do { } while (0)
+# define ADD_STAT(x,y) do { } while (0)
+# define SUB_STAT(x,y) do { } while (0)
+#else
+# define INC_STAT(x) atomic_inc((atomic_t *)&kstat.x)
+# define DEC_STAT(x) atomic_dec((atomic_t *)&kstat.x)
+# define ADD_STAT(y,x) atomic_add(y,(atomic_t *)&kstat.x)
+# define SUB_STAT(y,x) atomic_sub(y,(atomic_t *)&kstat.x)
+#endif
+
+// lru needs this:
+
+# define DEBUG_DEL_LIST(x...) do { INIT_LIST_HEAD((x)); } while (0)
+
+
+#define LOG_LEN (8*1024*1024UL)
+
+struct tux_req_struct;
+typedef struct tux_req_struct tux_req_t;
+typedef struct tux_threadinfo threadinfo_t;
+
+extern struct address_space_operations url_aops;
+
+typedef struct tcapi_template_s {
+       char *vfs_name;
+       struct list_head modules;
+       int (*query) (tux_req_t *req);
+       struct module *mod;
+       unsigned int userspace_id;
+} tcapi_template_t;
+
+typedef struct mimetype_s {
+       struct list_head list;
+
+       char *ext;
+       unsigned int ext_len;
+       char *type;
+       unsigned int type_len;
+       char *expire_str;
+       unsigned int expire_str_len;
+
+       unsigned int special;
+} mimetype_t;
+
+typedef struct tux_attribute_s {
+       mimetype_t *mime;
+       tcapi_template_t *tcapi;
+} tux_attribute_t;
+
+#define MAX_TUX_ATOMS 8
+
+typedef void (atom_func_t)(tux_req_t *req, int cachemiss);
+
+typedef struct tux_proto_s
+{
+       unsigned int defer_accept;
+       unsigned int can_redirect;
+       void (*got_request) (tux_req_t *req);
+       int (*parse_message) (tux_req_t *req, const int total_len);
+       atom_func_t *illegal_request;
+       atom_func_t *request_timeout;
+       void (*pre_log) (tux_req_t *req);
+       int (*check_req_err) (tux_req_t *req, int cachemiss);
+       char * (*print_dir_line) (tux_req_t *req, char *tmp, char *d_name, int d_len, int d_type, struct dentry *dentry, struct inode *inode);
+       const char *name;
+       struct nameidata main_docroot;
+} tux_proto_t;
+
+typedef struct tux_socket_s {
+       tux_proto_t *proto;
+       unsigned int ip;
+       unsigned short port;
+       struct proc_dir_entry *entry;
+} tux_socket_t;
+
+extern tux_socket_t tux_listen [CONFIG_TUX_NUMTHREADS][CONFIG_TUX_NUMSOCKETS];
+
+
+typedef struct abuf_s {
+       struct page *page;
+       char *buf;
+       unsigned int size;
+       unsigned int max_len;
+       unsigned int offset;
+       unsigned int left;
+       unsigned long flags;
+} abuf_t;
+
+struct linux_dirent64 {
+       u64             d_ino;
+       s64             d_off;
+       unsigned short  d_reclen;
+       unsigned char   d_type;
+       char            d_name[0];
+};
+
+struct getdents_callback64 {
+       struct linux_dirent64 * current_dir;
+       struct linux_dirent64 * previous;
+       int count;
+       int error;
+};
+
+#define TUX_MAGIC 0x12457801
+
+#define MAX_TUX_ATOMS 8
+
+struct tux_req_struct
+{
+       tux_proto_t *proto;
+
+       int atom_idx;
+       atom_func_t *atoms [MAX_TUX_ATOMS];
+       struct list_head work;
+
+       struct list_head all;
+       struct list_head free;
+       struct list_head lru;
+
+       unsigned long idle_input;
+       unsigned long wait_output_space;
+
+       struct socket *sock;
+       struct dentry *dentry;
+       struct vfsmount *mnt;
+       struct dentry *docroot_dentry;
+       struct vfsmount *docroot_mnt;
+       struct dentry *cwd_dentry;
+       struct vfsmount *cwd_mnt;
+
+       struct file in_file;
+       int fd;
+       read_descriptor_t desc;
+       u32 client_addr;
+       u32 client_port;
+       unsigned int virtual;
+
+       loff_t total_file_len;
+       unsigned int lendigits;
+       loff_t offset_start;
+       loff_t offset_end;
+       loff_t output_len;
+
+       loff_t ftp_offset_start;
+
+       time_t mtime;
+       unsigned int etaglen;
+       char etag [40];
+
+       char usermode;
+       unsigned int usermodule_idx;
+       struct dentry *module_dentry;
+       struct vfsmount *module_mnt;
+       char *userbuf;
+       unsigned int userlen;
+
+       tux_attribute_t *attr;
+
+       threadinfo_t *ti;
+       wait_queue_t sleep;
+       wait_queue_t ftp_sleep;
+
+       abuf_t abuf;
+       /*
+        * Parsed request fields. In-line strings are zero-delimited.
+        */
+       const char *headers;
+       unsigned int headers_len;
+
+       unsigned int parsed_len;
+
+       // FTP part
+       ftp_command_t ftp_command;
+       u32 ftp_user_addr;
+       u16 ftp_user_port;
+
+       struct socket *data_sock;
+       unsigned int prev_pos;
+
+       // ls handing:
+       struct linux_dirent64 *dirp0;
+       unsigned int curroff, total;
+
+#define MAX_USERNAME_LEN 16
+       char username[MAX_USERNAME_LEN];
+       unsigned int username_len;
+
+       // HTTP part
+       http_method_t method;
+       const char *method_str;
+       unsigned int method_len;
+
+       http_version_t version;
+       const char *version_str;
+       unsigned int version_len;
+
+       /* requested URI: */
+
+       const char *uri_str;
+       unsigned int uri_len;
+
+       /* Objectname (filename/scriptname) this URI refers to: */
+
+#define MAX_OBJECTNAME_LEN 256
+       char objectname[MAX_OBJECTNAME_LEN + 4]; // space for .gz as well
+       unsigned int objectname_len;
+
+       /* Query string within the URI: */
+
+       const char *query_str;
+       unsigned int query_len;
+
+       /* Cookies: */
+
+       const char *cookies_str;
+       unsigned int cookies_len;
+       unsigned int parse_cookies;
+
+       /* Content-TYpe */
+       const char *content_type_str;
+       unsigned int content_type_len;
+
+       /* Content-Length: */
+
+       const char *contentlen_str;
+       unsigned int contentlen_len;
+       unsigned int content_len;
+
+       /* User-Agent: */
+
+       const char *user_agent_str;
+       unsigned int user_agent_len;
+
+       /* Accept: */
+
+       const char *accept_str;
+       unsigned int accept_len;
+
+       /* Accept-Charset: */
+
+       const char *accept_charset_str;
+       unsigned int accept_charset_len;
+
+       /* Accept-Language: */
+
+       const char *accept_language_str;
+       unsigned int accept_language_len;
+
+       /* Cache-Control: */
+
+       const char *cache_control_str;
+       unsigned int cache_control_len;
+
+       /* If-Modified-Since: */
+
+       const char *if_modified_since_str;
+       unsigned int if_modified_since_len;
+
+       /* If-None-Match: */
+       const char *if_none_match_str;
+       unsigned int if_none_match_len;
+
+       /* If-Range: */
+
+       const char *if_range_str;
+       unsigned int if_range_len;
+
+       /* Negotiate: */
+
+       const char *negotiate_str;
+       unsigned int negotiate_len;
+
+       /* Pragma: */
+
+       const char *pragma_str;
+       unsigned int pragma_len;
+
+       /* Referer: */
+
+       const char *referer_str;
+       unsigned int referer_len;
+
+       /* Accept-Encoding: */
+
+       const char *accept_encoding_str;
+       unsigned int accept_encoding_len;
+       unsigned int may_send_gzip;
+       unsigned int content_gzipped;
+
+       /* Host */
+
+#define MAX_HOST_LEN 128
+       char host[MAX_HOST_LEN];
+       unsigned int host_len;
+
+       /* POSTed data: */
+
+       const char *post_data_str;
+       unsigned int post_data_len;
+
+       unsigned int status;
+
+       /* the file being sent */
+
+       unsigned int bytes_sent;
+#if CONFIG_TUX_DEBUG
+       unsigned int bytes_expected;
+#endif
+       unsigned long first_timestamp;
+       unsigned int body_len;
+
+       unsigned int user_error;
+
+       char error;
+       char postponed;
+
+       char had_cachemiss;
+       char lookup_dir;
+       char lookup_404;
+
+       char keep_alive;
+       struct timer_list keepalive_timer;
+       unsigned int total_bytes;
+       struct timer_list output_timer;
+
+       unsigned int nr_keepalives;
+
+       unsigned int event;
+       u64 private;
+
+       unsigned int magic;
+       void (*real_data_ready)(struct sock *sk, int space);
+       void (*real_state_change)(struct sock *sk);
+       void (*real_write_space)(struct sock *sk);
+       void (*real_error_report)(struct sock *sk);
+       void (*real_destruct)(struct sock *sk);
+
+       void (*ftp_real_data_ready)(struct sock *sk, int space);
+       void (*ftp_real_state_change)(struct sock *sk);
+       void (*ftp_real_write_space)(struct sock *sk);
+       void (*ftp_real_error_report)(struct sock *sk);
+       void (*ftp_real_create_child)(struct sock *sk, struct sock *newsk);
+       void (*ftp_real_destruct)(struct sock *sk);
+
+#if CONFIG_TUX_EXTENDED_LOG
+       unsigned long accept_timestamp;
+       unsigned long parse_timestamp;
+       unsigned long output_timestamp;
+       unsigned long flush_timestamp;
+# define SET_TIMESTAMP(x) do { (x) = jiffies; } while (0)
+#else
+# define SET_TIMESTAMP(x) do { } while (0)
+#endif
+
+};
+
+extern void add_tux_atom (tux_req_t *req, atom_func_t *event_done);
+extern void del_tux_atom (tux_req_t *req);
+extern void tux_schedule_atom (tux_req_t *req, int cachemiss);
+extern void add_req_to_workqueue (tux_req_t *req);
+
+
+typedef struct iothread_s
+{
+       spinlock_t async_lock;
+       threadinfo_t *ti;
+       struct list_head async_queue;
+       wait_queue_head_t async_sleep;
+       unsigned int nr_async_pending;
+       unsigned int threads;
+       unsigned int shutdown;
+       wait_queue_head_t wait_shutdown;
+} iothread_t;
+
+typedef struct tux_listen_s
+{
+       tux_proto_t *proto;
+       struct socket *sock;
+       unsigned int cloned;
+} tux_listen_t;
+
+struct tux_threadinfo
+{
+       tux_req_t *userspace_req;
+       unsigned int started;
+       struct task_struct *thread;
+       iothread_t *iot;
+       wait_queue_t wait_event [CONFIG_TUX_NUMSOCKETS];
+       wait_queue_t stop;
+       unsigned int pid;
+
+       struct page *header_cache;
+       unsigned int header_offset;
+
+       unsigned int nr_requests;
+       struct list_head all_requests;
+
+       unsigned int nr_free_requests;
+       spinlock_t free_requests_lock;
+       struct list_head free_requests;
+
+       spinlock_t work_lock;
+       struct list_head work_pending;
+       struct list_head lru;
+       unsigned int nr_lru;
+
+       unsigned int listen_error;
+       tux_listen_t listen[CONFIG_TUX_NUMSOCKETS];
+
+       struct semaphore gzip_sem;
+       z_stream gzip_state;
+
+       unsigned int cpu;
+       unsigned int __padding[16];
+};
+
+typedef enum special_mimetypes {
+       NORMAL_MIME_TYPE,
+       MIME_TYPE_REDIRECT,
+       MIME_TYPE_CGI,
+       MIME_TYPE_MODULE,
+} special_mimetypes_t;
+
+#if CONFIG_TUX_DEBUG
+#if 0
+extern inline void url_hist_hit (int size)
+{
+       unsigned int idx = size/1024;
+
+       if (idx >= URL_HIST_SIZE)
+               idx = URL_HIST_SIZE-1;
+       kstat.url_hist_hits[idx]++;
+}
+extern inline void url_hist_miss (int size)
+{
+       unsigned int idx = size/1024;
+       if (idx >= URL_HIST_SIZE)
+               idx = URL_HIST_SIZE-1;
+       kstat.url_hist_misses[idx]++;
+}
+#endif
+extern void __check_req_list (tux_req_t *req, struct list_head *list);
+# define check_req_list __check_req_list
+#else
+# define check_req_list(req, list) do { } while (0)
+#endif
+
+#define url_hist_hit(size) do { } while (0)
+#define url_hist_miss(size) do { } while (0)
+
+extern char tux_common_docroot[200];
+extern char tux_http_subdocroot[200];
+extern char tux_ftp_subdocroot[200];
+extern char tux_logfile[200];
+extern char tux_cgiroot[200];
+extern char tux_404_page[200];
+extern char tux_default_vhost[200];
+extern char tux_extra_html_header[600];
+extern unsigned int tux_extra_html_header_size;
+extern int tux_cgi_uid;
+extern int tux_cgi_gid;
+extern unsigned int tux_clientport;
+extern unsigned int tux_logging;
+extern unsigned int tux_threads;
+extern unsigned int tux_keepalive_timeout;
+extern unsigned int tux_max_output_bandwidth;
+extern unsigned int tux_max_backlog;
+extern unsigned int tux_max_connect;
+extern unsigned int tux_mode_forbidden;
+extern unsigned int tux_mode_allowed;
+extern unsigned int tux_logentry_align_order;
+extern unsigned int tux_nonagle;
+extern unsigned int tux_ack_pingpong;
+extern unsigned int tux_push_all;
+extern unsigned int tux_zerocopy_parse;
+extern unsigned int tux_generate_etags;
+extern unsigned int tux_generate_last_mod;
+extern unsigned int tux_generate_cache_control;
+extern unsigned int tux_ip_logging;
+extern unsigned int tux_ftp_wait_close;
+extern unsigned int tux_ftp_log_retr_only;
+extern unsigned int tux_hide_unreadable;
+
+typedef enum virtual_server {
+       TUX_VHOST_NONE,
+       TUX_VHOST_HOST,
+       TUX_VHOST_IP,
+       TUX_VHOST_IP_HOST,
+} virtual_server_t;
+
+extern unsigned int tux_virtual_server;
+extern unsigned int mass_hosting_hash;
+extern unsigned int strip_host_tail;
+extern unsigned int tux_ftp_virtual_server;
+
+extern unsigned int tux_max_object_size;
+extern unsigned int tux_max_free_requests;
+extern unsigned int tux_defer_accept;
+
+extern struct socket * start_listening(tux_socket_t *listen, int nr);
+extern void stop_listening(struct socket **sock);
+extern void start_sysctl(void);
+extern void end_sysctl(void);
+extern void flush_request (tux_req_t *req, int cachemiss);
+extern void unlink_tux_socket (tux_req_t *req);
+extern void unlink_tux_data_socket (tux_req_t *req);
+extern void unlink_tux_listen_socket (tux_req_t *req);
+extern void link_tux_ftp_accept_socket (tux_req_t *req, struct socket *sock);
+extern void link_tux_data_socket (tux_req_t *req, struct socket *sock);
+extern void tux_push_req (tux_req_t *req);
+extern int send_sync_buf (tux_req_t *req, struct socket *sock, const char *buf, const size_t length, unsigned long flags);
+extern void __send_async_message (tux_req_t *req, const char *message, int status, unsigned int size, int push);
+#define send_async_message(req,str,status,push) \
+               __send_async_message(req,str,status,strlen(str),push)
+
+extern void send_success (tux_req_t *req, struct socket *sock);
+extern void send_async_err_not_found (tux_req_t *req);
+extern void send_async_timed_out (tux_req_t *req);
+
+extern void kfree_req (tux_req_t *req);
+extern int accept_requests (threadinfo_t *ti);
+extern int process_requests (threadinfo_t *ti, tux_req_t **user_req);
+extern int flush_freequeue (threadinfo_t * ti);
+extern int tux_flush_workqueue (threadinfo_t *ti);
+extern tux_req_t * pick_userspace_req (threadinfo_t *ti);
+extern atom_func_t redirect_request;
+extern atom_func_t parse_request;
+extern void queue_cachemiss (tux_req_t *req);
+extern int start_cachemiss_threads (threadinfo_t *ti);
+extern void stop_cachemiss_threads (threadinfo_t *ti);
+struct file * tux_open_file(char *filename, int mode);
+extern void start_log_thread (void);
+extern void stop_log_thread (void);
+extern void add_mimetype (char *new_ext, char *new_type, char *new_expire);
+extern void free_mimetypes (void);
+extern int lookup_object (tux_req_t *req, const unsigned int flag);
+extern int handle_gzip_req (tux_req_t *req, unsigned int flags);
+extern struct dentry * tux_lookup (tux_req_t *req, const char *filename, const unsigned int flag, struct vfsmount **mnt);
+extern tcapi_template_t * lookup_tuxmodule (const char *filename);
+extern int register_tuxmodule (tcapi_template_t *tcapi);
+extern tcapi_template_t * unregister_tuxmodule (char *vfs_name);
+extern tcapi_template_t * get_first_usermodule (void);
+extern int user_register_module (user_req_t *u_info);
+extern int user_unregister_module (user_req_t *u_info);
+extern void unregister_all_tuxmodules (void);
+
+typedef struct exec_param_s {
+       char *command;
+       char **argv;
+       char **envp;
+       unsigned int pipe_fds;
+} exec_param_t;
+
+extern pid_t tux_exec_process (char *command, char **argv, char **envp, int pipe_fds, exec_param_t *param, int wait);
+
+extern void start_external_cgi (tux_req_t *req);
+extern tcapi_template_t extcgi_tcapi;
+
+extern void queue_output_req (tux_req_t *req, threadinfo_t *ti);
+extern void queue_userspace_req (tux_req_t *req, threadinfo_t *ti);
+
+
+extern void __log_request (tux_req_t *req);
+extern inline void log_request (tux_req_t *req)
+{
+       if (tux_logging)
+               __log_request(req);
+}
+
+extern int __connection_too_fast (tux_req_t *req);
+
+#define connection_too_fast(req)                               \
+       ({                                                      \
+               int __ret = 1;                                  \
+               if (unlikely(tux_max_output_bandwidth))         \
+                       __ret = __connection_too_fast(req);     \
+               __ret;                                          \
+       })
+
+extern void trunc_headers (tux_req_t *req);
+extern int generic_send_file (tux_req_t *req, struct socket *sock, int cachemiss);
+extern int tux_fetch_file (tux_req_t *req, int nonblock);
+
+extern void postpone_request (tux_req_t *req);
+extern int continue_request (int fd);
+extern void tux_push_pending (struct sock *sk);
+extern void zap_request (tux_req_t *req, int cachemiss);
+extern int add_output_space_event (tux_req_t *req, struct socket *sock);
+
+extern void reap_kids (void);
+extern void unuse_frag (struct sk_buff *skb, skb_frag_t *frag);
+extern skb_frag_t * build_dynbuf_frag (tux_req_t *req, unsigned int size);
+extern int tux_permission (struct inode *inode);
+extern void flush_all_signals (void);
+
+#define D() Dprintk("{%s:%d}\n", __FILE__, __LINE__)
+
+extern int nr_async_io_pending (void);
+
+extern void __add_keepalive_timer (tux_req_t *req);
+#define add_keepalive_timer(req)                                       \
+do {                                                                   \
+       if (tux_keepalive_timeout) {                                    \
+               Dprintk("add_keepalive_timer(%p).\n", (req));           \
+               __add_keepalive_timer(req);                             \
+       }                                                               \
+} while (0)
+extern void __del_keepalive_timer (tux_req_t *req);
+#define del_keepalive_timer(req)                                       \
+do {                                                                   \
+       if (tux_keepalive_timeout) {                                    \
+               Dprintk("del_keepalive_timer(%p).\n", (req));           \
+               __del_keepalive_timer(req);                             \
+       }                                                               \
+} while (0)
+
+extern void del_output_timer (tux_req_t *req);
+extern void output_timeout (tux_req_t *req);
+
+extern void print_req (tux_req_t *req);
+
+extern char tux_date [DATE_LEN];
+
+
+extern int nr_async_io_pending (void);
+extern void tux_exit (void);
+extern char * get_abuf (tux_req_t *req, unsigned int max_size);
+extern void send_abuf (tux_req_t *req, unsigned int size, unsigned long flags);
+
+
+extern int idle_event (tux_req_t *req);
+extern int output_space_event (tux_req_t *req);
+extern unsigned int log_cpu_mask;
+extern unsigned int tux_compression;
+extern unsigned int tux_noid;
+extern unsigned int tux_cgi_inherit_cpu;
+extern unsigned int tux_zerocopy_header;
+extern unsigned int tux_zerocopy_sendfile;
+extern unsigned int tux_cgi_cpu_mask;
+extern tux_proto_t tux_proto_http;
+extern tux_proto_t tux_proto_ftp;
+extern unsigned int tux_all_userspace;
+extern unsigned int tux_ignore_query;
+extern unsigned int tux_redirect_logging;
+extern unsigned int tux_referer_logging;
+extern unsigned int tux_log_incomplete;
+extern unsigned int tux_max_header_len;
+extern unsigned int tux_cpu_offset;
+extern unsigned int tux_ftp_login_message;
+
+extern void drop_permissions (void);
+extern int query_extcgi (tux_req_t *req);
+extern int tux_chroot (char *dir);
+
+extern void install_req_dentry (tux_req_t *req, struct dentry *dentry, struct vfsmount *mnt);
+extern void release_req_dentry (tux_req_t *req);
+extern void unidle_req (tux_req_t *req);
+extern int nr_requests_used (void);
+
+#define req_err(req) do { (req)->error = 1; Dprintk("request %p error at %s:%d.\n", req, __FILE__, __LINE__); } while (0)
+
+#define enough_wspace(sk) (tcp_wspace(sk) >= tcp_min_write_space(sk))
+#define clear_keepalive(req) do { (req)->keep_alive = 0; Dprintk("keepalive cleared for req %p.\n", req); } while (0)
+
+extern int print_all_requests (threadinfo_t *ti);
+extern unsigned int tux_max_keepalives;
+extern int time_unix2ls (time_t zulu, char *buf);
+extern void last_mod_time(char * curr, const time_t t);
+extern int mdtm_time(char * curr, const time_t t);
+extern time_t parse_time(const char *str, const int str_len);
+
+extern unsigned int nr_tux_threads;
+extern threadinfo_t threadinfo[CONFIG_TUX_NUMTHREADS];
+
+#define switch_docroot(req) do { if (((req)->docroot_dentry != current->fs->root) || ((req)->docroot_mnt != current->fs->rootmnt)) __switch_docroot(req); } while (0)
+extern void __switch_docroot(tux_req_t *req);
+extern void list_directory (tux_req_t *req, int cachemiss);
+extern char * tux_print_path (tux_req_t *req, struct dentry *dentry, struct vfsmount *mnt, char *buf, unsigned int max_len);
+
+extern unsigned int tux_http_dir_indexing;
+
+int tux_gzip_compress (tux_req_t *req, unsigned char *data_in, unsigned char *data_out, __u32 *in_len, __u32 *out_len);
+
+struct dentry * __tux_lookup (tux_req_t *req, const char *filename,
+                         struct nameidata *base, struct vfsmount **mnt);
+
+/* error codes for req->error */
+#define TUX_ERROR_REDIRECT     1
+#define TUX_ERROR_UNUSED       2
+#define TUX_ERROR_CONN_CLOSE   3
+#define TUX_ERROR_CONN_TIMEOUT 4
+
+extern void __put_data_sock (tux_req_t *req);
+
+static inline void put_data_sock (tux_req_t *req)
+{
+       if (req->data_sock)
+               __put_data_sock(req);
+}
+
+#define socket_input(sock) \
+       (!skb_queue_empty(&(sock)->sk->sk_receive_queue) || \
+               !skb_queue_empty(&(sock)->sk->sk_error_queue))
+
+#define tux_kmalloc(size)                                              \
+({                                                                     \
+       void *__ptr;                                                    \
+                                                                       \
+       while (!(__ptr = kmalloc(size, GFP_KERNEL))) {                  \
+               if (net_ratelimit())                                    \
+                       printk(KERN_WARNING "tux: OOM at %s:%d (%d bytes).\n", \
+                               __FILE__, __LINE__, size);              \
+               current->state = TASK_UNINTERRUPTIBLE;                  \
+               schedule_timeout(1);                                    \
+       }                                                               \
+       __ptr;                                                          \
+})
+
+extern long tux_close(unsigned int fd);
+
+#endif
diff --git a/include/net/tux_u.h b/include/net/tux_u.h
new file mode 100644 (file)
index 0000000..24ba401
--- /dev/null
@@ -0,0 +1,163 @@
+#ifndef _NET_TUX_U_H
+#define _NET_TUX_U_H
+
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * tux_u.h: HTTP module API - HTTP interface to user-space
+ */
+
+/*
+ * Different major versions are not compatible.
+ * Different minor versions are only downward compatible.
+ * Different patchlevel versions are downward and upward compatible.
+ */
+#define TUX_MAJOR_VERSION              3
+#define TUX_MINOR_VERSION              0
+#define TUX_PATCHLEVEL_VERSION         0
+
+#define __KERNEL_SYSCALLS__
+
+typedef enum http_versions {
+        HTTP_1_0,
+        HTTP_1_1
+} http_version_t;
+
+/*
+ * Request methods known to HTTP:
+ */
+typedef enum http_methods {
+        METHOD_NONE,
+        METHOD_GET,
+        METHOD_HEAD,
+        METHOD_POST,
+        METHOD_PUT,
+       NR_METHODS
+} http_method_t;
+
+enum user_req {
+       TUX_ACTION_STARTUP = 1,
+       TUX_ACTION_SHUTDOWN = 2,
+       TUX_ACTION_STARTTHREAD = 3,
+       TUX_ACTION_STOPTHREAD = 4,
+       TUX_ACTION_EVENTLOOP = 5,
+       TUX_ACTION_GET_OBJECT = 6,
+       TUX_ACTION_SEND_OBJECT = 7,
+       TUX_ACTION_READ_OBJECT = 8,
+       TUX_ACTION_FINISH_REQ = 9,
+       TUX_ACTION_FINISH_CLOSE_REQ = 10,
+       TUX_ACTION_REGISTER_MODULE = 11,
+       TUX_ACTION_UNREGISTER_MODULE = 12,
+       TUX_ACTION_CURRENT_DATE = 13,
+       TUX_ACTION_REGISTER_MIMETYPE = 14,
+       TUX_ACTION_READ_HEADERS = 15,
+       TUX_ACTION_POSTPONE_REQ = 16,
+       TUX_ACTION_CONTINUE_REQ = 17,
+       TUX_ACTION_REDIRECT_REQ = 18,
+       TUX_ACTION_READ_POST_DATA = 19,
+       TUX_ACTION_SEND_BUFFER = 20,
+       TUX_ACTION_WATCH_PROXY_SOCKET = 21,
+       TUX_ACTION_WAIT_PROXY_SOCKET = 22,
+       TUX_ACTION_QUERY_VERSION = 23,
+       MAX_TUX_ACTION
+};
+
+enum tux_ret {
+       TUX_ERROR = -1,
+       TUX_RETURN_USERSPACE_REQUEST = 0,
+       TUX_RETURN_EXIT = 1,
+       TUX_RETURN_SIGNAL = 2,
+       TUX_CONTINUE_EVENTLOOP = 3,
+};
+
+#define MAX_URI_LEN 256
+#define MAX_COOKIE_LEN 128
+#define MAX_FIELD_LEN 64
+#define DATE_LEN 30
+
+typedef struct user_req_s {
+       u32 version_major;
+       u32 version_minor;
+       u32 version_patch;
+       u32 http_version;
+       u32 http_method;
+       u32 http_status;
+
+       u32 sock;
+       u32 event;
+       u32 error;
+       u32 thread_nr;
+       u32 bytes_sent;
+       u32 client_host;
+       u32 objectlen;
+       u32 module_index;
+       u32 keep_alive;
+       u32 cookies_len;
+
+       u64 id;
+       u64 priv;
+       u64 object_addr;
+
+       u8 query[MAX_URI_LEN];
+       u8 objectname[MAX_URI_LEN];
+       u8 cookies[MAX_COOKIE_LEN];
+       u8 content_type[MAX_FIELD_LEN];
+       u8 user_agent[MAX_FIELD_LEN];
+       u8 accept[MAX_FIELD_LEN];
+       u8 accept_charset[MAX_FIELD_LEN];
+       u8 accept_encoding[MAX_FIELD_LEN];
+       u8 accept_language[MAX_FIELD_LEN];
+       u8 cache_control[MAX_FIELD_LEN];
+       u8 if_modified_since[MAX_FIELD_LEN];
+       u8 negotiate[MAX_FIELD_LEN];
+       u8 pragma[MAX_FIELD_LEN];
+       u8 referer[MAX_FIELD_LEN];
+       u8 new_date[DATE_LEN];
+       u8 pad[2];
+
+} user_req_t;
+
+typedef enum ftp_commands {
+        FTP_COMM_NONE,
+        FTP_COMM_USER,
+        FTP_COMM_PASS,
+        FTP_COMM_ACCT,
+        FTP_COMM_CWD,
+        FTP_COMM_CDUP,
+        FTP_COMM_SMNT,
+        FTP_COMM_QUIT,
+        FTP_COMM_REIN,
+        FTP_COMM_PORT,
+        FTP_COMM_PASV,
+        FTP_COMM_TYPE,
+        FTP_COMM_STRU,
+        FTP_COMM_MODE,
+        FTP_COMM_RETR,
+        FTP_COMM_SIZE,
+        FTP_COMM_MDTM,
+        FTP_COMM_STOR,
+        FTP_COMM_STOU,
+        FTP_COMM_APPE,
+        FTP_COMM_ALLO,
+        FTP_COMM_REST,
+        FTP_COMM_RNFR,
+        FTP_COMM_RNTO,
+        FTP_COMM_ABOR,
+        FTP_COMM_DELE,
+        FTP_COMM_RMD,
+        FTP_COMM_MKD,
+        FTP_COMM_PWD,
+        FTP_COMM_LIST,
+        FTP_COMM_NLST,
+        FTP_COMM_SITE,
+        FTP_COMM_SYST,
+        FTP_COMM_STAT,
+        FTP_COMM_HELP,
+        FTP_COMM_NOOP,
+        FTP_COMM_FEAT,
+        FTP_COMM_CLNT,
+} ftp_command_t;
+
+#endif
diff --git a/include/video/gbe.h b/include/video/gbe.h
new file mode 100644 (file)
index 0000000..ad51028
--- /dev/null
@@ -0,0 +1,317 @@
+/*
+ * include/video/gbe.h -- SGI GBE (Graphics Back End)
+ *
+ * Copyright (C) 1999 Silicon Graphics, Inc. (Jeffrey Newquist)
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
+ */
+
+#ifndef __GBE_H__
+#define __GBE_H__
+
+struct sgi_gbe {
+       volatile uint32_t ctrlstat;     /* general control */
+       volatile uint32_t dotclock;     /* dot clock PLL control */
+       volatile uint32_t i2c;          /* crt I2C control */
+       volatile uint32_t sysclk;       /* system clock PLL control */
+       volatile uint32_t i2cfp;        /* flat panel I2C control */
+       volatile uint32_t id;           /* device id/chip revision */
+       volatile uint32_t config;       /* power on configuration [1] */
+       volatile uint32_t bist;         /* internal bist status [1] */
+       uint32_t _pad0[0x010000/4 - 8];
+       volatile uint32_t vt_xy;        /* current dot coords */
+       volatile uint32_t vt_xymax;     /* maximum dot coords */
+       volatile uint32_t vt_vsync;     /* vsync on/off */
+       volatile uint32_t vt_hsync;     /* hsync on/off */
+       volatile uint32_t vt_vblank;    /* vblank on/off */
+       volatile uint32_t vt_hblank;    /* hblank on/off */
+       volatile uint32_t vt_flags;     /* polarity of vt signals */
+       volatile uint32_t vt_f2rf_lock; /* f2rf & framelck y coord */
+       volatile uint32_t vt_intr01;    /* intr 0,1 y coords */
+       volatile uint32_t vt_intr23;    /* intr 2,3 y coords */
+       volatile uint32_t fp_hdrv;      /* flat panel hdrv on/off */
+       volatile uint32_t fp_vdrv;      /* flat panel vdrv on/off */
+       volatile uint32_t fp_de;        /* flat panel de on/off */
+       volatile uint32_t vt_hpixen;    /* intrnl horiz pixel on/off */
+       volatile uint32_t vt_vpixen;    /* intrnl vert pixel on/off */
+       volatile uint32_t vt_hcmap;     /* cmap write (horiz) */
+       volatile uint32_t vt_vcmap;     /* cmap write (vert) */
+       volatile uint32_t did_start_xy; /* eol/f did/xy reset val */
+       volatile uint32_t crs_start_xy; /* eol/f crs/xy reset val */
+       volatile uint32_t vc_start_xy;  /* eol/f vc/xy reset val */
+       uint32_t _pad1[0xffb0/4];
+       volatile uint32_t ovr_width_tile;/*overlay plane ctrl 0 */
+       volatile uint32_t ovr_inhwctrl; /* overlay plane ctrl 1 */
+       volatile uint32_t ovr_control;  /* overlay plane ctrl 1 */
+       uint32_t _pad2[0xfff4/4];
+       volatile uint32_t frm_size_tile;/* normal plane ctrl 0 */
+       volatile uint32_t frm_size_pixel;/*normal plane ctrl 1 */
+       volatile uint32_t frm_inhwctrl; /* normal plane ctrl 2 */
+       volatile uint32_t frm_control;  /* normal plane ctrl 3 */
+       uint32_t _pad3[0xfff0/4];
+       volatile uint32_t did_inhwctrl; /* DID control */
+       volatile uint32_t did_control;  /* DID shadow */
+       uint32_t _pad4[0x7ff8/4];
+       volatile uint32_t mode_regs[32];/* WID table */
+       uint32_t _pad5[0x7f80/4];
+       volatile uint32_t cmap[6144];   /* color map */
+       uint32_t _pad6[0x2000/4];
+       volatile uint32_t cm_fifo;      /* color map fifo status */
+       uint32_t _pad7[0x7ffc/4];
+       volatile uint32_t gmap[256];    /* gamma map */
+       uint32_t _pad8[0x7c00/4];
+       volatile uint32_t gmap10[1024]; /* gamma map */
+       uint32_t _pad9[0x7000/4];
+       volatile uint32_t crs_pos;      /* cusror control 0 */
+       volatile uint32_t crs_ctl;      /* cusror control 1 */
+       volatile uint32_t crs_cmap[3];  /* crs cmap */
+       uint32_t _pad10[0x7fec/4];
+       volatile uint32_t crs_glyph[64];/* crs glyph */
+       uint32_t _pad11[0x7f00/4];
+       volatile uint32_t vc_0; /* video capture crtl 0 */
+       volatile uint32_t vc_1; /* video capture crtl 1 */
+       volatile uint32_t vc_2; /* video capture crtl 2 */
+       volatile uint32_t vc_3; /* video capture crtl 3 */
+       volatile uint32_t vc_4; /* video capture crtl 4 */
+       volatile uint32_t vc_5; /* video capture crtl 5 */
+       volatile uint32_t vc_6; /* video capture crtl 6 */
+       volatile uint32_t vc_7; /* video capture crtl 7 */
+       volatile uint32_t vc_8; /* video capture crtl 8 */
+};
+
+#define MASK(msb, lsb)         \
+       ( (((u32)1<<((msb)-(lsb)+1))-1) << (lsb) )
+#define GET(v, msb, lsb)       \
+       ( ((u32)(v) & MASK(msb,lsb)) >> (lsb) )
+#define SET(v, f, msb, lsb)    \
+       ( (v) = ((v)&~MASK(msb,lsb)) | (( (u32)(f)<<(lsb) ) & MASK(msb,lsb)) )
+
+#define GET_GBE_FIELD(reg, field, v)           \
+       GET((v), GBE_##reg##_##field##_MSB, GBE_##reg##_##field##_LSB)
+#define SET_GBE_FIELD(reg, field, v, f)                \
+       SET((v), (f), GBE_##reg##_##field##_MSB, GBE_##reg##_##field##_LSB)
+
+/*
+ * Bit mask information
+ */
+#define GBE_CTRLSTAT_CHIPID_MSB                 3
+#define GBE_CTRLSTAT_CHIPID_LSB                 0
+#define GBE_CTRLSTAT_SENSE_N_MSB        4
+#define GBE_CTRLSTAT_SENSE_N_LSB        4
+#define GBE_CTRLSTAT_PCLKSEL_MSB       29
+#define GBE_CTRLSTAT_PCLKSEL_LSB       28
+
+#define GBE_DOTCLK_M_MSB                7
+#define GBE_DOTCLK_M_LSB                0
+#define GBE_DOTCLK_N_MSB               13
+#define GBE_DOTCLK_N_LSB                8
+#define GBE_DOTCLK_P_MSB               15
+#define GBE_DOTCLK_P_LSB               14
+#define GBE_DOTCLK_RUN_MSB             20
+#define GBE_DOTCLK_RUN_LSB             20
+
+#define GBE_VT_XY_Y_MSB                23
+#define GBE_VT_XY_Y_LSB                12
+#define GBE_VT_XY_X_MSB                11
+#define GBE_VT_XY_X_LSB                 0
+#define GBE_VT_XY_FREEZE_MSB           31
+#define GBE_VT_XY_FREEZE_LSB           31
+
+#define GBE_FP_VDRV_ON_MSB     23
+#define GBE_FP_VDRV_ON_LSB     12
+#define GBE_FP_VDRV_OFF_MSB    11
+#define GBE_FP_VDRV_OFF_LSB    0
+
+#define GBE_FP_HDRV_ON_MSB     23
+#define GBE_FP_HDRV_ON_LSB     12
+#define GBE_FP_HDRV_OFF_MSB    11
+#define GBE_FP_HDRV_OFF_LSB    0
+
+#define GBE_FP_DE_ON_MSB               23
+#define GBE_FP_DE_ON_LSB               12
+#define GBE_FP_DE_OFF_MSB              11
+#define GBE_FP_DE_OFF_LSB              0
+
+#define GBE_VT_VSYNC_VSYNC_ON_MSB      23
+#define GBE_VT_VSYNC_VSYNC_ON_LSB      12
+#define GBE_VT_VSYNC_VSYNC_OFF_MSB     11
+#define GBE_VT_VSYNC_VSYNC_OFF_LSB      0
+
+#define GBE_VT_HSYNC_HSYNC_ON_MSB      23
+#define GBE_VT_HSYNC_HSYNC_ON_LSB      12
+#define GBE_VT_HSYNC_HSYNC_OFF_MSB     11
+#define GBE_VT_HSYNC_HSYNC_OFF_LSB      0
+
+#define GBE_VT_VBLANK_VBLANK_ON_MSB    23
+#define GBE_VT_VBLANK_VBLANK_ON_LSB    12
+#define GBE_VT_VBLANK_VBLANK_OFF_MSB   11
+#define GBE_VT_VBLANK_VBLANK_OFF_LSB    0
+
+#define GBE_VT_HBLANK_HBLANK_ON_MSB    23
+#define GBE_VT_HBLANK_HBLANK_ON_LSB    12
+#define GBE_VT_HBLANK_HBLANK_OFF_MSB   11
+#define GBE_VT_HBLANK_HBLANK_OFF_LSB    0
+
+#define GBE_VT_FLAGS_F2RF_HIGH_MSB      6
+#define GBE_VT_FLAGS_F2RF_HIGH_LSB      6
+#define GBE_VT_FLAGS_SYNC_LOW_MSB       5
+#define GBE_VT_FLAGS_SYNC_LOW_LSB       5
+#define GBE_VT_FLAGS_SYNC_HIGH_MSB      4
+#define GBE_VT_FLAGS_SYNC_HIGH_LSB      4
+#define GBE_VT_FLAGS_HDRV_LOW_MSB       3
+#define GBE_VT_FLAGS_HDRV_LOW_LSB       3
+#define GBE_VT_FLAGS_HDRV_INVERT_MSB    2
+#define GBE_VT_FLAGS_HDRV_INVERT_LSB    2
+#define GBE_VT_FLAGS_VDRV_LOW_MSB       1
+#define GBE_VT_FLAGS_VDRV_LOW_LSB       1
+#define GBE_VT_FLAGS_VDRV_INVERT_MSB    0
+#define GBE_VT_FLAGS_VDRV_INVERT_LSB    0
+
+#define GBE_VT_VCMAP_VCMAP_ON_MSB      23
+#define GBE_VT_VCMAP_VCMAP_ON_LSB      12
+#define GBE_VT_VCMAP_VCMAP_OFF_MSB     11
+#define GBE_VT_VCMAP_VCMAP_OFF_LSB      0
+
+#define GBE_VT_HCMAP_HCMAP_ON_MSB      23
+#define GBE_VT_HCMAP_HCMAP_ON_LSB      12
+#define GBE_VT_HCMAP_HCMAP_OFF_MSB     11
+#define GBE_VT_HCMAP_HCMAP_OFF_LSB      0
+
+#define GBE_VT_XYMAX_MAXX_MSB  11
+#define GBE_VT_XYMAX_MAXX_LSB   0
+#define GBE_VT_XYMAX_MAXY_MSB  23
+#define GBE_VT_XYMAX_MAXY_LSB  12
+
+#define GBE_VT_HPIXEN_HPIXEN_ON_MSB    23
+#define GBE_VT_HPIXEN_HPIXEN_ON_LSB    12
+#define GBE_VT_HPIXEN_HPIXEN_OFF_MSB   11
+#define GBE_VT_HPIXEN_HPIXEN_OFF_LSB    0
+
+#define GBE_VT_VPIXEN_VPIXEN_ON_MSB    23
+#define GBE_VT_VPIXEN_VPIXEN_ON_LSB    12
+#define GBE_VT_VPIXEN_VPIXEN_OFF_MSB   11
+#define GBE_VT_VPIXEN_VPIXEN_OFF_LSB    0
+
+#define GBE_OVR_CONTROL_OVR_DMA_ENABLE_MSB      0
+#define GBE_OVR_CONTROL_OVR_DMA_ENABLE_LSB      0
+
+#define GBE_OVR_INHWCTRL_OVR_DMA_ENABLE_MSB     0
+#define GBE_OVR_INHWCTRL_OVR_DMA_ENABLE_LSB     0
+
+#define GBE_OVR_WIDTH_TILE_OVR_FIFO_RESET_MSB  13
+#define GBE_OVR_WIDTH_TILE_OVR_FIFO_RESET_LSB  13
+
+#define GBE_FRM_CONTROL_FRM_DMA_ENABLE_MSB      0
+#define GBE_FRM_CONTROL_FRM_DMA_ENABLE_LSB      0
+#define GBE_FRM_CONTROL_FRM_TILE_PTR_MSB       31
+#define GBE_FRM_CONTROL_FRM_TILE_PTR_LSB        9
+#define GBE_FRM_CONTROL_FRM_LINEAR_MSB          1
+#define GBE_FRM_CONTROL_FRM_LINEAR_LSB          1
+
+#define GBE_FRM_INHWCTRL_FRM_DMA_ENABLE_MSB     0
+#define GBE_FRM_INHWCTRL_FRM_DMA_ENABLE_LSB     0
+
+#define GBE_FRM_SIZE_TILE_FRM_WIDTH_TILE_MSB   12
+#define GBE_FRM_SIZE_TILE_FRM_WIDTH_TILE_LSB    5
+#define GBE_FRM_SIZE_TILE_FRM_RHS_MSB           4
+#define GBE_FRM_SIZE_TILE_FRM_RHS_LSB           0
+#define GBE_FRM_SIZE_TILE_FRM_DEPTH_MSB                14
+#define GBE_FRM_SIZE_TILE_FRM_DEPTH_LSB                13
+#define GBE_FRM_SIZE_TILE_FRM_FIFO_RESET_MSB   15
+#define GBE_FRM_SIZE_TILE_FRM_FIFO_RESET_LSB   15
+
+#define GBE_FRM_SIZE_PIXEL_FB_HEIGHT_PIX_MSB   31
+#define GBE_FRM_SIZE_PIXEL_FB_HEIGHT_PIX_LSB   16
+
+#define GBE_DID_CONTROL_DID_DMA_ENABLE_MSB      0
+#define GBE_DID_CONTROL_DID_DMA_ENABLE_LSB      0
+#define GBE_DID_INHWCTRL_DID_DMA_ENABLE_MSB     0
+#define GBE_DID_INHWCTRL_DID_DMA_ENABLE_LSB     0
+
+#define GBE_DID_START_XY_DID_STARTY_MSB                23
+#define GBE_DID_START_XY_DID_STARTY_LSB                12
+#define GBE_DID_START_XY_DID_STARTX_MSB                11
+#define GBE_DID_START_XY_DID_STARTX_LSB                 0
+
+#define GBE_CRS_START_XY_CRS_STARTY_MSB                23
+#define GBE_CRS_START_XY_CRS_STARTY_LSB                12
+#define GBE_CRS_START_XY_CRS_STARTX_MSB                11
+#define GBE_CRS_START_XY_CRS_STARTX_LSB                 0
+
+#define GBE_WID_AUX_MSB                12
+#define GBE_WID_AUX_LSB                11
+#define GBE_WID_GAMMA_MSB      10
+#define GBE_WID_GAMMA_LSB      10
+#define GBE_WID_CM_MSB          9
+#define GBE_WID_CM_LSB          5
+#define GBE_WID_TYP_MSB                 4
+#define GBE_WID_TYP_LSB                 2
+#define GBE_WID_BUF_MSB                 1
+#define GBE_WID_BUF_LSB                 0
+
+#define GBE_VC_START_XY_VC_STARTY_MSB  23
+#define GBE_VC_START_XY_VC_STARTY_LSB  12
+#define GBE_VC_START_XY_VC_STARTX_MSB  11
+#define GBE_VC_START_XY_VC_STARTX_LSB   0
+
+/* Constants */
+
+#define GBE_FRM_DEPTH_8                0
+#define GBE_FRM_DEPTH_16       1
+#define GBE_FRM_DEPTH_32       2
+
+#define GBE_CMODE_I8           0
+#define GBE_CMODE_I12          1
+#define GBE_CMODE_RG3B2                2
+#define GBE_CMODE_RGB4         3
+#define GBE_CMODE_ARGB5                4
+#define GBE_CMODE_RGB8         5
+#define GBE_CMODE_RGBA5                6
+#define GBE_CMODE_RGB10                7
+
+#define GBE_BMODE_BOTH         3
+
+#define GBE_CRS_MAGIC          54
+#define GBE_PIXEN_MAGIC_ON     19
+#define GBE_PIXEN_MAGIC_OFF     2
+
+#define GBE_TLB_SIZE           128
+
+/* [1] - only GBE revision 2 and later */
+
+/*
+ * Video Timing Data Structure
+ */
+
+struct gbe_timing_info {
+       int flags;
+       short width;            /* Monitor resolution */
+       short height;
+       int fields_sec;         /* fields/sec  (Hz -3 dec. places */
+       int cfreq;              /* pixel clock frequency (MHz -3 dec. places) */
+       short htotal;           /* Horizontal total pixels */
+       short hblank_start;     /* Horizontal blank start */
+       short hblank_end;       /* Horizontal blank end */
+       short hsync_start;      /* Horizontal sync start */
+       short hsync_end;        /* Horizontal sync end */
+       short vtotal;           /* Vertical total lines */
+       short vblank_start;     /* Vertical blank start */
+       short vblank_end;       /* Vertical blank end */
+       short vsync_start;      /* Vertical sync start */
+       short vsync_end;        /* Vertical sync end */
+       short pll_m;            /* PLL M parameter */
+       short pll_n;            /* PLL P parameter */
+       short pll_p;            /* PLL N parameter */
+};
+
+/* Defines for gbe_vof_info_t flags */
+
+#define GBE_VOF_UNKNOWNMON     1
+#define GBE_VOF_STEREO         2
+#define GBE_VOF_DO_GENSYNC     4       /* enable incoming sync */
+#define GBE_VOF_SYNC_ON_GREEN  8       /* sync on green */
+#define GBE_VOF_FLATPANEL      0x1000  /* FLATPANEL Timing */
+#define GBE_VOF_MAGICKEY       0x2000  /* Backdoor key */
+
+#endif         /* ! __GBE_H__ */
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
new file mode 100644 (file)
index 0000000..a62a65c
--- /dev/null
@@ -0,0 +1,1015 @@
+/*
+ * Simple NUMA memory policy for the Linux kernel.
+ *
+ * Copyright 2003,2004 Andi Kleen, SuSE Labs.
+ * Subject to the GNU Public License, version 2.
+ *
+ * NUMA policy allows the user to give hints in which node(s) memory should
+ * be allocated.
+ *
+ * Support four policies per VMA and per process:
+ *
+ * The VMA policy has priority over the process policy for a page fault.
+ *
+ * interleave     Allocate memory interleaved over a set of nodes,
+ *                with normal fallback if it fails.
+ *                For VMA based allocations this interleaves based on the
+ *                offset into the backing object or offset into the mapping
+ *                for anonymous memory. For process policy an process counter
+ *                is used.
+ * bind           Only allocate memory on a specific set of nodes,
+ *                no fallback.
+ * preferred       Try a specific node first before normal fallback.
+ *                As a special case node -1 here means do the allocation
+ *                on the local CPU. This is normally identical to default,
+ *                but useful to set in a VMA when you have a non default
+ *                process policy.
+ * default        Allocate on the local node first, or when on a VMA
+ *                use the process policy. This is what Linux always did
+ *                                in a NUMA aware kernel and still does by, ahem, default.
+ *
+ * The process policy is applied for most non interrupt memory allocations
+ * in that process' context. Interrupts ignore the policies and always
+ * try to allocate on the local CPU. The VMA policy is only applied for memory
+ * allocations for a VMA in the VM.
+ *
+ * Currently there are a few corner cases in swapping where the policy
+ * is not applied, but the majority should be handled. When process policy
+ * is used it is not remembered over swap outs/swap ins.
+ *
+ * Only the highest zone in the zone hierarchy gets policied. Allocations
+ * requesting a lower zone just use default policy. This implies that
+ * on systems with highmem kernel lowmem allocation don't get policied.
+ * Same with GFP_DMA allocations.
+ *
+ * For shmfs/tmpfs/hugetlbfs shared memory the policy is shared between
+ * all users and remembered even when nobody has memory mapped.
+ */
+
+/* Notebook:
+   fix mmap readahead to honour policy and enable policy for any page cache
+   object
+   statistics for bigpages
+   global policy for page cache? currently it uses process policy. Requires
+   first item above.
+   handle mremap for shared memory (currently ignored for the policy)
+   grows down?
+   make bind policy root only? It can trigger oom much faster and the
+   kernel is not always grateful with that.
+   could replace all the switch()es with a mempolicy_ops structure.
+*/
+
+#include <linux/mempolicy.h>
+#include <linux/mm.h>
+#include <linux/hugetlb.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/gfp.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/compat.h>
+#include <linux/mempolicy.h>
+#include <asm/uaccess.h>
+
+static kmem_cache_t *policy_cache;
+static kmem_cache_t *sn_cache;
+
+#define PDprintk(fmt...)
+
+/* Highest zone. An specific allocation for a zone below that is not
+   policied. */
+static int policy_zone;
+
+static struct mempolicy default_policy = {
+       .refcnt = ATOMIC_INIT(1), /* never free it */
+       .policy = MPOL_DEFAULT,
+};
+
+/* Check if all specified nodes are online */
+static int nodes_online(unsigned long *nodes)
+{
+       DECLARE_BITMAP(offline, MAX_NUMNODES);
+
+       bitmap_copy(offline, node_online_map, MAX_NUMNODES);
+       if (bitmap_empty(offline, MAX_NUMNODES))
+               set_bit(0, offline);
+       bitmap_complement(offline, MAX_NUMNODES);
+       bitmap_and(offline, offline, nodes, MAX_NUMNODES);
+       if (!bitmap_empty(offline, MAX_NUMNODES))
+               return -EINVAL;
+       return 0;
+}
+
+/* Do sanity checking on a policy */
+static int mpol_check_policy(int mode, unsigned long *nodes)
+{
+       int empty = bitmap_empty(nodes, MAX_NUMNODES);
+
+       switch (mode) {
+       case MPOL_DEFAULT:
+               if (!empty)
+                       return -EINVAL;
+               break;
+       case MPOL_BIND:
+       case MPOL_INTERLEAVE:
+               /* Preferred will only use the first bit, but allow
+                  more for now. */
+               if (empty)
+                       return -EINVAL;
+               break;
+       }
+       return nodes_online(nodes);
+}
+
+/* Copy a node mask from user space. */
+static int get_nodes(unsigned long *nodes, unsigned long __user *nmask,
+                    unsigned long maxnode, int mode)
+{
+       unsigned long k;
+       unsigned long nlongs;
+       unsigned long endmask;
+
+       --maxnode;
+       nlongs = BITS_TO_LONGS(maxnode);
+       if ((maxnode % BITS_PER_LONG) == 0)
+               endmask = ~0UL;
+       else
+               endmask = (1UL << (maxnode % BITS_PER_LONG)) - 1;
+
+       /* When the user specified more nodes than supported just check
+          if the non supported part is all zero. */
+       if (nmask && nlongs > BITS_TO_LONGS(MAX_NUMNODES)) {
+               for (k = BITS_TO_LONGS(MAX_NUMNODES); k < nlongs; k++) {
+                       unsigned long t;
+                       if (get_user(t,  nmask + k))
+                               return -EFAULT;
+                       if (k == nlongs - 1) {
+                               if (t & endmask)
+                                       return -EINVAL;
+                       } else if (t)
+                               return -EINVAL;
+               }
+               nlongs = BITS_TO_LONGS(MAX_NUMNODES);
+               endmask = ~0UL;
+       }
+
+       bitmap_zero(nodes, MAX_NUMNODES);
+       if (nmask && copy_from_user(nodes, nmask, nlongs*sizeof(unsigned long)))
+               return -EFAULT;
+       nodes[nlongs-1] &= endmask;
+       return mpol_check_policy(mode, nodes);
+}
+
+/* Generate a custom zonelist for the BIND policy. */
+static struct zonelist *bind_zonelist(unsigned long *nodes)
+{
+       struct zonelist *zl;
+       int num, max, nd;
+
+       max = 1 + MAX_NR_ZONES * bitmap_weight(nodes, MAX_NUMNODES);
+       zl = kmalloc(sizeof(void *) * max, GFP_KERNEL);
+       if (!zl)
+               return NULL;
+       num = 0;
+       for (nd = find_first_bit(nodes, MAX_NUMNODES);
+            nd < MAX_NUMNODES;
+            nd = find_next_bit(nodes, MAX_NUMNODES, 1+nd)) {
+               int k;
+               for (k = MAX_NR_ZONES-1; k >= 0; k--) {
+                       struct zone *z = &NODE_DATA(nd)->node_zones[k];
+                       if (!z->present_pages)
+                               continue;
+                       zl->zones[num++] = z;
+                       if (k > policy_zone)
+                               policy_zone = k;
+               }
+       }
+       BUG_ON(num >= max);
+       zl->zones[num] = NULL;
+       return zl;
+}
+
+/* Create a new policy */
+static struct mempolicy *mpol_new(int mode, unsigned long *nodes)
+{
+       struct mempolicy *policy;
+
+       PDprintk("setting mode %d nodes[0] %lx\n", mode, nodes[0]);
+       if (mode == MPOL_DEFAULT)
+               return NULL;
+       policy = kmem_cache_alloc(policy_cache, GFP_KERNEL);
+       if (!policy)
+               return ERR_PTR(-ENOMEM);
+       atomic_set(&policy->refcnt, 1);
+       switch (mode) {
+       case MPOL_INTERLEAVE:
+               bitmap_copy(policy->v.nodes, nodes, MAX_NUMNODES);
+               break;
+       case MPOL_PREFERRED:
+               policy->v.preferred_node = find_first_bit(nodes, MAX_NUMNODES);
+               if (policy->v.preferred_node >= MAX_NUMNODES)
+                       policy->v.preferred_node = -1;
+               break;
+       case MPOL_BIND:
+               policy->v.zonelist = bind_zonelist(nodes);
+               if (policy->v.zonelist == NULL) {
+                       kmem_cache_free(policy_cache, policy);
+                       return ERR_PTR(-ENOMEM);
+               }
+               break;
+       }
+       policy->policy = mode;
+       return policy;
+}
+
+/* Ensure all existing pages follow the policy. */
+static int
+verify_pages(unsigned long addr, unsigned long end, unsigned long *nodes)
+{
+       while (addr < end) {
+               struct page *p;
+               pte_t *pte;
+               pmd_t *pmd;
+               pgd_t *pgd = pgd_offset_k(addr);
+               if (pgd_none(*pgd)) {
+                       addr = (addr + PGDIR_SIZE) & PGDIR_MASK;
+                       continue;
+               }
+               pmd = pmd_offset(pgd, addr);
+               if (pmd_none(*pmd)) {
+                       addr = (addr + PMD_SIZE) & PMD_MASK;
+                       continue;
+               }
+               p = NULL;
+               pte = pte_offset_map(pmd, addr);
+               if (pte_present(*pte))
+                       p = pte_page(*pte);
+               pte_unmap(pte);
+               if (p) {
+                       unsigned nid = page_to_nid(p);
+                       if (!test_bit(nid, nodes))
+                               return -EIO;
+               }
+               addr += PAGE_SIZE;
+       }
+       return 0;
+}
+
+/* Step 1: check the range */
+static struct vm_area_struct *
+check_range(struct mm_struct *mm, unsigned long start, unsigned long end,
+           unsigned long *nodes, unsigned long flags)
+{
+       int err;
+       struct vm_area_struct *first, *vma, *prev;
+
+       first = find_vma(mm, start);
+       if (!first)
+               return ERR_PTR(-EFAULT);
+       prev = NULL;
+       for (vma = first; vma && vma->vm_start < end; vma = vma->vm_next) {
+               if (!vma->vm_next && vma->vm_end < end)
+                       return ERR_PTR(-EFAULT);
+               if (prev && prev->vm_end < vma->vm_start)
+                       return ERR_PTR(-EFAULT);
+               if ((flags & MPOL_MF_STRICT) && !is_vm_hugetlb_page(vma)) {
+                       err = verify_pages(vma->vm_start, vma->vm_end, nodes);
+                       if (err) {
+                               first = ERR_PTR(err);
+                               break;
+                       }
+               }
+               prev = vma;
+       }
+       return first;
+}
+
+/* Apply policy to a single VMA */
+static int policy_vma(struct vm_area_struct *vma, struct mempolicy *new)
+{
+       int err = 0;
+       struct mempolicy *old = vma->vm_policy;
+
+       PDprintk("vma %lx-%lx/%lx vm_ops %p vm_file %p set_policy %p\n",
+                vma->vm_start, vma->vm_end, vma->vm_pgoff,
+                vma->vm_ops, vma->vm_file,
+                vma->vm_ops ? vma->vm_ops->set_policy : NULL);
+
+       if (vma->vm_ops && vma->vm_ops->set_policy)
+               err = vma->vm_ops->set_policy(vma, new);
+       if (!err) {
+               mpol_get(new);
+               vma->vm_policy = new;
+               mpol_free(old);
+       }
+       return err;
+}
+
+/* Step 2: apply policy to a range and do splits. */
+static int mbind_range(struct vm_area_struct *vma, unsigned long start,
+                      unsigned long end, struct mempolicy *new)
+{
+       struct vm_area_struct *next;
+       int err;
+
+       err = 0;
+       for (; vma && vma->vm_start < end; vma = next) {
+               next = vma->vm_next;
+               if (vma->vm_start < start)
+                       err = split_vma(vma->vm_mm, vma, start, 1);
+               if (!err && vma->vm_end > end)
+                       err = split_vma(vma->vm_mm, vma, end, 0);
+               if (!err)
+                       err = policy_vma(vma, new);
+               if (err)
+                       break;
+       }
+       return err;
+}
+
+/* Change policy for a memory range */
+asmlinkage long sys_mbind(unsigned long start, unsigned long len,
+                         unsigned long mode,
+                         unsigned long __user *nmask, unsigned long maxnode,
+                         unsigned flags)
+{
+       struct vm_area_struct *vma;
+       struct mm_struct *mm = current->mm;
+       struct mempolicy *new;
+       unsigned long end;
+       DECLARE_BITMAP(nodes, MAX_NUMNODES);
+       int err;
+
+       if ((flags & ~(unsigned long)(MPOL_MF_STRICT)) || mode > MPOL_MAX)
+               return -EINVAL;
+       if (start & ~PAGE_MASK)
+               return -EINVAL;
+       if (mode == MPOL_DEFAULT)
+               flags &= ~MPOL_MF_STRICT;
+       len = (len + PAGE_SIZE - 1) & PAGE_MASK;
+       end = start + len;
+       if (end < start)
+               return -EINVAL;
+       if (end == start)
+               return 0;
+
+       err = get_nodes(nodes, nmask, maxnode, mode);
+       if (err)
+               return err;
+
+       new = mpol_new(mode, nodes);
+       if (IS_ERR(new))
+               return PTR_ERR(new);
+
+       PDprintk("mbind %lx-%lx mode:%ld nodes:%lx\n",start,start+len,
+                       mode,nodes[0]);
+
+       down_write(&mm->mmap_sem);
+       vma = check_range(mm, start, end, nodes, flags);
+       err = PTR_ERR(vma);
+       if (!IS_ERR(vma))
+               err = mbind_range(vma, start, end, new);
+       up_write(&mm->mmap_sem);
+       mpol_free(new);
+       return err;
+}
+
+/* Set the process memory policy */
+asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask,
+                                  unsigned long maxnode)
+{
+       int err;
+       struct mempolicy *new;
+       DECLARE_BITMAP(nodes, MAX_NUMNODES);
+
+       if (mode > MPOL_MAX)
+               return -EINVAL;
+       err = get_nodes(nodes, nmask, maxnode, mode);
+       if (err)
+               return err;
+       new = mpol_new(mode, nodes);
+       if (IS_ERR(new))
+               return PTR_ERR(new);
+       mpol_free(current->mempolicy);
+       current->mempolicy = new;
+       if (new && new->policy == MPOL_INTERLEAVE)
+               current->il_next = find_first_bit(new->v.nodes, MAX_NUMNODES);
+       return 0;
+}
+
+/* Fill a zone bitmap for a policy */
+static void get_zonemask(struct mempolicy *p, unsigned long *nodes)
+{
+       int i;
+
+       bitmap_zero(nodes, MAX_NUMNODES);
+       switch (p->policy) {
+       case MPOL_BIND:
+               for (i = 0; p->v.zonelist->zones[i]; i++)
+                       __set_bit(p->v.zonelist->zones[i]->zone_pgdat->node_id, nodes);
+               break;
+       case MPOL_DEFAULT:
+               break;
+       case MPOL_INTERLEAVE:
+               bitmap_copy(nodes, p->v.nodes, MAX_NUMNODES);
+               break;
+       case MPOL_PREFERRED:
+               /* or use current node instead of online map? */
+               if (p->v.preferred_node < 0)
+                       bitmap_copy(nodes, node_online_map, MAX_NUMNODES);
+               else
+                       __set_bit(p->v.preferred_node, nodes);
+               break;
+       default:
+               BUG();
+       }
+}
+
+static int lookup_node(struct mm_struct *mm, unsigned long addr)
+{
+       struct page *p;
+       int err;
+
+       err = get_user_pages(current, mm, addr & PAGE_MASK, 1, 0, 0, &p, NULL);
+       if (err >= 0) {
+               err = page_zone(p)->zone_pgdat->node_id;
+               put_page(p);
+       }
+       return err;
+}
+
+/* Copy a kernel node mask to user space */
+static int copy_nodes_to_user(unsigned long __user *mask, unsigned long maxnode,
+                             void *nodes, unsigned nbytes)
+{
+       unsigned long copy = ALIGN(maxnode-1, 64) / 8;
+
+       if (copy > nbytes) {
+               if (copy > PAGE_SIZE)
+                       return -EINVAL;
+               if (clear_user((char __user *)mask + nbytes, copy - nbytes))
+                       return -EFAULT;
+               copy = nbytes;
+       }
+       return copy_to_user(mask, nodes, copy) ? -EFAULT : 0;
+}
+
+/* Retrieve NUMA policy */
+asmlinkage long sys_get_mempolicy(int __user *policy,
+                                 unsigned long __user *nmask,
+                                 unsigned long maxnode,
+                                 unsigned long addr, unsigned long flags)
+{
+       int err, pval;
+       struct mm_struct *mm = current->mm;
+       struct vm_area_struct *vma = NULL;
+       struct mempolicy *pol = current->mempolicy;
+
+       if (flags & ~(unsigned long)(MPOL_F_NODE|MPOL_F_ADDR))
+               return -EINVAL;
+       if (nmask != NULL && maxnode < numnodes)
+               return -EINVAL;
+       if (flags & MPOL_F_ADDR) {
+               down_read(&mm->mmap_sem);
+               vma = find_vma_intersection(mm, addr, addr+1);
+               if (!vma) {
+                       up_read(&mm->mmap_sem);
+                       return -EFAULT;
+               }
+               if (vma->vm_ops && vma->vm_ops->get_policy)
+                       pol = vma->vm_ops->get_policy(vma, addr);
+               else
+                       pol = vma->vm_policy;
+       } else if (addr)
+               return -EINVAL;
+
+       if (!pol)
+               pol = &default_policy;
+
+       if (flags & MPOL_F_NODE) {
+               if (flags & MPOL_F_ADDR) {
+                       err = lookup_node(mm, addr);
+                       if (err < 0)
+                               goto out;
+                       pval = err;
+               } else if (pol == current->mempolicy &&
+                               pol->policy == MPOL_INTERLEAVE) {
+                       pval = current->il_next;
+               } else {
+                       err = -EINVAL;
+                       goto out;
+               }
+       } else
+               pval = pol->policy;
+
+       err = -EFAULT;
+       if (policy && put_user(pval, policy))
+               goto out;
+
+       err = 0;
+       if (nmask) {
+               DECLARE_BITMAP(nodes, MAX_NUMNODES);
+               get_zonemask(pol, nodes);
+               err = copy_nodes_to_user(nmask, maxnode, nodes, sizeof(nodes));
+       }
+
+ out:
+       if (vma)
+               up_read(&current->mm->mmap_sem);
+       return err;
+}
+
+#ifdef CONFIG_COMPAT
+/* The other functions are compatible */
+asmlinkage long compat_get_mempolicy(int __user *policy,
+                                 unsigned __user *nmask, unsigned  maxnode,
+                                 unsigned addr, unsigned  flags)
+{
+       long err;
+       unsigned long __user *nm = NULL;
+       if (nmask)
+               nm = compat_alloc_user_space(ALIGN(maxnode-1, 64) / 8);
+       err = sys_get_mempolicy(policy, nm, maxnode, addr, flags);
+       if (!err && copy_in_user(nmask, nm, ALIGN(maxnode-1, 32)/8))
+               err = -EFAULT;
+       return err;
+}
+#endif
+
+/* Return effective policy for a VMA */
+static struct mempolicy *
+get_vma_policy(struct vm_area_struct *vma, unsigned long addr)
+{
+       struct mempolicy *pol = current->mempolicy;
+
+       if (vma) {
+               if (vma->vm_ops && vma->vm_ops->get_policy)
+                       pol = vma->vm_ops->get_policy(vma, addr);
+               else if (vma->vm_policy &&
+                               vma->vm_policy->policy != MPOL_DEFAULT)
+                       pol = vma->vm_policy;
+       }
+       if (!pol)
+               pol = &default_policy;
+       return pol;
+}
+
+/* Return a zonelist representing a mempolicy */
+static struct zonelist *zonelist_policy(unsigned gfp, struct mempolicy *policy)
+{
+       int nd;
+
+       switch (policy->policy) {
+       case MPOL_PREFERRED:
+               nd = policy->v.preferred_node;
+               if (nd < 0)
+                       nd = numa_node_id();
+               break;
+       case MPOL_BIND:
+               /* Lower zones don't get a policy applied */
+               if (gfp >= policy_zone)
+                       return policy->v.zonelist;
+               /*FALL THROUGH*/
+       case MPOL_INTERLEAVE: /* should not happen */
+       case MPOL_DEFAULT:
+               nd = numa_node_id();
+               break;
+       default:
+               nd = 0;
+               BUG();
+       }
+       return NODE_DATA(nd)->node_zonelists + (gfp & GFP_ZONEMASK);
+}
+
+/* Do dynamic interleaving for a process */
+static unsigned interleave_nodes(struct mempolicy *policy)
+{
+       unsigned nid, next;
+       struct task_struct *me = current;
+
+       nid = me->il_next;
+       BUG_ON(nid >= MAX_NUMNODES);
+       next = find_next_bit(policy->v.nodes, MAX_NUMNODES, 1+nid);
+       if (next >= MAX_NUMNODES)
+               next = find_first_bit(policy->v.nodes, MAX_NUMNODES);
+       me->il_next = next;
+       return nid;
+}
+
+/* Do static interleaving for a VMA with known offset. */
+static unsigned offset_il_node(struct mempolicy *pol,
+               struct vm_area_struct *vma, unsigned long off)
+{
+       unsigned nnodes = bitmap_weight(pol->v.nodes, MAX_NUMNODES);
+       unsigned target = (unsigned)off % nnodes;
+       int c;
+       int nid = -1;
+
+       c = 0;
+       do {
+               nid = find_next_bit(pol->v.nodes, MAX_NUMNODES, nid+1);
+               c++;
+       } while (c <= target);
+       BUG_ON(nid >= MAX_NUMNODES);
+       BUG_ON(!test_bit(nid, pol->v.nodes));
+       return nid;
+}
+
+/* Allocate a page in interleaved policy.
+   Own path because it needs to do special accounting. */
+static struct page *alloc_page_interleave(unsigned gfp, unsigned nid)
+{
+       struct zonelist *zl;
+       struct page *page;
+
+       BUG_ON(!test_bit(nid, node_online_map));
+       zl = NODE_DATA(nid)->node_zonelists + (gfp & GFP_ZONEMASK);
+       page = __alloc_pages(gfp, 0, zl);
+       if (page && page_zone(page) == zl->zones[0]) {
+               zl->zones[0]->pageset[get_cpu()].interleave_hit++;
+               put_cpu();
+       }
+       return page;
+}
+
+/**
+ *     alloc_page_vma  - Allocate a page for a VMA.
+ *
+ *     @gfp:
+ *      %GFP_USER    user allocation.
+ *      %GFP_KERNEL  kernel allocations,
+ *      %GFP_HIGHMEM highmem/user allocations,
+ *      %GFP_FS      allocation should not call back into a file system.
+ *      %GFP_ATOMIC  don't sleep.
+ *
+ *     @vma:  Pointer to VMA or NULL if not available.
+ *     @addr: Virtual Address of the allocation. Must be inside the VMA.
+ *
+ *     This function allocates a page from the kernel page pool and applies
+ *     a NUMA policy associated with the VMA or the current process.
+ *     When VMA is not NULL caller must hold down_read on the mmap_sem of the
+ *     mm_struct of the VMA to prevent it from going away. Should be used for
+ *     all allocations for pages that will be mapped into
+ *     user space. Returns NULL when no page can be allocated.
+ *
+ *     Should be called with the mm_sem of the vma hold.
+ */
+struct page *
+alloc_page_vma(unsigned gfp, struct vm_area_struct *vma, unsigned long addr)
+{
+       struct mempolicy *pol = get_vma_policy(vma, addr);
+
+       if (unlikely(pol->policy == MPOL_INTERLEAVE)) {
+               unsigned nid;
+               if (vma) {
+                       unsigned long off;
+                       BUG_ON(addr >= vma->vm_end);
+                       BUG_ON(addr < vma->vm_start);
+                       off = vma->vm_pgoff;
+                       off += (addr - vma->vm_start) >> PAGE_SHIFT;
+                       nid = offset_il_node(pol, vma, off);
+               } else {
+                       /* fall back to process interleaving */
+                       nid = interleave_nodes(pol);
+               }
+               return alloc_page_interleave(gfp, nid);
+       }
+       return __alloc_pages(gfp, 0, zonelist_policy(gfp, pol));
+}
+
+/**
+ *     alloc_pages_current - Allocate pages.
+ *
+ *     @gfp:
+ *                     %GFP_USER   user allocation,
+ *             %GFP_KERNEL kernel allocation,
+ *             %GFP_HIGHMEM highmem allocation,
+ *             %GFP_FS     don't call back into a file system.
+ *             %GFP_ATOMIC don't sleep.
+ *     @order: Power of two of allocation size in pages. 0 is a single page.
+ *
+ *     Allocate a page from the kernel page pool.  When not in
+ *     interrupt context and apply the current process NUMA policy.
+ *     Returns NULL when no page can be allocated.
+ */
+struct page *alloc_pages_current(unsigned gfp, unsigned order)
+{
+       struct mempolicy *pol = current->mempolicy;
+
+       if (!pol || in_interrupt())
+               pol = &default_policy;
+       if (pol->policy == MPOL_INTERLEAVE && order == 0)
+               return alloc_page_interleave(gfp, interleave_nodes(pol));
+       return __alloc_pages(gfp, order, zonelist_policy(gfp, pol));
+}
+EXPORT_SYMBOL(alloc_pages_current);
+
+/* Slow path of a mempolicy copy */
+struct mempolicy *__mpol_copy(struct mempolicy *old)
+{
+       struct mempolicy *new = kmem_cache_alloc(policy_cache, GFP_KERNEL);
+
+       if (!new)
+               return ERR_PTR(-ENOMEM);
+       *new = *old;
+       atomic_set(&new->refcnt, 1);
+       if (new->policy == MPOL_BIND) {
+               int sz = ksize(old->v.zonelist);
+               new->v.zonelist = kmalloc(sz, SLAB_KERNEL);
+               if (!new->v.zonelist) {
+                       kmem_cache_free(policy_cache, new);
+                       return ERR_PTR(-ENOMEM);
+               }
+               memcpy(new->v.zonelist, old->v.zonelist, sz);
+       }
+       return new;
+}
+
+/* Slow path of a mempolicy comparison */
+int __mpol_equal(struct mempolicy *a, struct mempolicy *b)
+{
+       if (!a || !b)
+               return 0;
+       if (a->policy != b->policy)
+               return 0;
+       switch (a->policy) {
+       case MPOL_DEFAULT:
+               return 1;
+       case MPOL_INTERLEAVE:
+               return bitmap_equal(a->v.nodes, b->v.nodes, MAX_NUMNODES);
+       case MPOL_PREFERRED:
+               return a->v.preferred_node == b->v.preferred_node;
+       case MPOL_BIND: {
+               int i;
+               for (i = 0; a->v.zonelist->zones[i]; i++)
+                       if (a->v.zonelist->zones[i] != b->v.zonelist->zones[i])
+                               return 0;
+               return b->v.zonelist->zones[i] == NULL;
+       }
+       default:
+               BUG();
+               return 0;
+       }
+}
+
+/* Slow path of a mpol destructor. */
+void __mpol_free(struct mempolicy *p)
+{
+       if (!atomic_dec_and_test(&p->refcnt))
+               return;
+       if (p->policy == MPOL_BIND)
+               kfree(p->v.zonelist);
+       p->policy = MPOL_DEFAULT;
+       kmem_cache_free(policy_cache, p);
+}
+
+/*
+ * Hugetlb policy. Same as above, just works with node numbers instead of
+ * zonelists.
+ */
+
+/* Find first node suitable for an allocation */
+int mpol_first_node(struct vm_area_struct *vma, unsigned long addr)
+{
+       struct mempolicy *pol = get_vma_policy(vma, addr);
+
+       switch (pol->policy) {
+       case MPOL_DEFAULT:
+               return numa_node_id();
+       case MPOL_BIND:
+               return pol->v.zonelist->zones[0]->zone_pgdat->node_id;
+       case MPOL_INTERLEAVE:
+               return interleave_nodes(pol);
+       case MPOL_PREFERRED:
+               return pol->v.preferred_node >= 0 ?
+                               pol->v.preferred_node : numa_node_id();
+       }
+       BUG();
+       return 0;
+}
+
+/* Find secondary valid nodes for an allocation */
+int mpol_node_valid(int nid, struct vm_area_struct *vma, unsigned long addr)
+{
+       struct mempolicy *pol = get_vma_policy(vma, addr);
+
+       switch (pol->policy) {
+       case MPOL_PREFERRED:
+       case MPOL_DEFAULT:
+       case MPOL_INTERLEAVE:
+               return 1;
+       case MPOL_BIND: {
+               struct zone **z;
+               for (z = pol->v.zonelist->zones; *z; z++)
+                       if ((*z)->zone_pgdat->node_id == nid)
+                               return 1;
+               return 0;
+       }
+       default:
+               BUG();
+               return 0;
+       }
+}
+
+/*
+ * Shared memory backing store policy support.
+ *
+ * Remember policies even when nobody has shared memory mapped.
+ * The policies are kept in Red-Black tree linked from the inode.
+ * They are protected by the sp->sem semaphore, which should be held
+ * for any accesses to the tree.
+ */
+
+/* lookup first element intersecting start-end */
+/* Caller holds sp->sem */
+static struct sp_node *
+sp_lookup(struct shared_policy *sp, unsigned long start, unsigned long end)
+{
+       struct rb_node *n = sp->root.rb_node;
+
+       while (n) {
+               struct sp_node *p = rb_entry(n, struct sp_node, nd);
+               if (start >= p->end) {
+                       n = n->rb_right;
+               } else if (end < p->start) {
+                       n = n->rb_left;
+               } else {
+                       break;
+               }
+       }
+       if (!n)
+               return NULL;
+       for (;;) {
+               struct sp_node *w = NULL;
+               struct rb_node *prev = rb_prev(n);
+               if (!prev)
+                       break;
+               w = rb_entry(prev, struct sp_node, nd);
+               if (w->end <= start)
+                       break;
+               n = prev;
+       }
+       return rb_entry(n, struct sp_node, nd);
+}
+
+/* Insert a new shared policy into the list. */
+/* Caller holds sp->sem */
+static void sp_insert(struct shared_policy *sp, struct sp_node *new)
+{
+       struct rb_node **p = &sp->root.rb_node;
+       struct rb_node *parent = NULL;
+       struct sp_node *nd;
+
+       while (*p) {
+               parent = *p;
+               nd = rb_entry(parent, struct sp_node, nd);
+               if (new->start < nd->start)
+                       p = &(*p)->rb_left;
+               else if (new->end > nd->end)
+                       p = &(*p)->rb_right;
+               else
+                       BUG();
+       }
+       rb_link_node(&new->nd, parent, p);
+       rb_insert_color(&new->nd, &sp->root);
+       PDprintk("inserting %lx-%lx: %d\n", new->start, new->end,
+                new->policy ? new->policy->policy : 0);
+}
+
+/* Find shared policy intersecting idx */
+struct mempolicy *
+mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx)
+{
+       struct mempolicy *pol = NULL;
+       struct sp_node *sn;
+
+       down(&sp->sem);
+       sn = sp_lookup(sp, idx, idx+1);
+       if (sn) {
+               mpol_get(sn->policy);
+               pol = sn->policy;
+       }
+       up(&sp->sem);
+       return pol;
+}
+
+static void sp_delete(struct shared_policy *sp, struct sp_node *n)
+{
+       PDprintk("deleting %lx-l%x\n", n->start, n->end);
+       rb_erase(&n->nd, &sp->root);
+       mpol_free(n->policy);
+       kmem_cache_free(sn_cache, n);
+}
+
+struct sp_node *
+sp_alloc(unsigned long start, unsigned long end, struct mempolicy *pol)
+{
+       struct sp_node *n = kmem_cache_alloc(sn_cache, GFP_KERNEL);
+
+       if (!n)
+               return NULL;
+       n->start = start;
+       n->end = end;
+       mpol_get(pol);
+       n->policy = pol;
+       return n;
+}
+
+/* Replace a policy range. */
+static int shared_policy_replace(struct shared_policy *sp, unsigned long start,
+                                unsigned long end, struct sp_node *new)
+{
+       struct sp_node *n, *new2;
+
+       down(&sp->sem);
+       n = sp_lookup(sp, start, end);
+       /* Take care of old policies in the same range. */
+       while (n && n->start < end) {
+               struct rb_node *next = rb_next(&n->nd);
+               if (n->start >= start) {
+                       if (n->end <= end)
+                               sp_delete(sp, n);
+                       else
+                               n->start = end;
+               } else {
+                       /* Old policy spanning whole new range. */
+                       if (n->end > end) {
+                               new2 = sp_alloc(end, n->end, n->policy);
+                               if (!new2) {
+                                       up(&sp->sem);
+                                       return -ENOMEM;
+                               }
+                               n->end = end;
+                               sp_insert(sp, new2);
+                       }
+                       /* Old crossing beginning, but not end (easy) */
+                       if (n->start < start && n->end > start)
+                               n->end = start;
+               }
+               if (!next)
+                       break;
+               n = rb_entry(next, struct sp_node, nd);
+       }
+       if (new)
+               sp_insert(sp, new);
+       up(&sp->sem);
+       return 0;
+}
+
+int mpol_set_shared_policy(struct shared_policy *info,
+                       struct vm_area_struct *vma, struct mempolicy *npol)
+{
+       int err;
+       struct sp_node *new = NULL;
+       unsigned long sz = vma_pages(vma);
+
+       PDprintk("set_shared_policy %lx sz %lu %d %lx\n",
+                vma->vm_pgoff,
+                sz, npol? npol->policy : -1,
+               npol ? npol->v.nodes[0] : -1);
+
+       if (npol) {
+               new = sp_alloc(vma->vm_pgoff, vma->vm_pgoff + sz, npol);
+               if (!new)
+                       return -ENOMEM;
+       }
+       err = shared_policy_replace(info, vma->vm_pgoff, vma->vm_pgoff+sz, new);
+       if (err && new)
+               kmem_cache_free(sn_cache, new);
+       return err;
+}
+
+/* Free a backing policy store on inode delete. */
+void mpol_free_shared_policy(struct shared_policy *p)
+{
+       struct sp_node *n;
+       struct rb_node *next;
+
+       down(&p->sem);
+       next = rb_first(&p->root);
+       while (next) {
+               n = rb_entry(next, struct sp_node, nd);
+               next = rb_next(&n->nd);
+               rb_erase(&n->nd, &p->root);
+               mpol_free(n->policy);
+               kmem_cache_free(sn_cache, n);
+       }
+       up(&p->sem);
+}
+
+static __init int numa_policy_init(void)
+{
+       policy_cache = kmem_cache_create("numa_policy",
+                                        sizeof(struct mempolicy),
+                                        0, SLAB_PANIC, NULL, NULL);
+
+       sn_cache = kmem_cache_create("shared_policy_node",
+                                    sizeof(struct sp_node),
+                                    0, SLAB_PANIC, NULL, NULL);
+       return 0;
+}
+module_init(numa_policy_init);
diff --git a/mm/prio_tree.c b/mm/prio_tree.c
new file mode 100644 (file)
index 0000000..6cd41a8
--- /dev/null
@@ -0,0 +1,663 @@
+/*
+ * mm/prio_tree.c - priority search tree for mapping->i_mmap
+ *
+ * Copyright (C) 2004, Rajesh Venkatasubramanian <vrajesh@umich.edu>
+ *
+ * This file is released under the GPL v2.
+ *
+ * Based on the radix priority search tree proposed by Edward M. McCreight
+ * SIAM Journal of Computing, vol. 14, no.2, pages 257-276, May 1985
+ *
+ * 02Feb2004   Initial version
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/mm.h>
+#include <linux/prio_tree.h>
+
+/*
+ * A clever mix of heap and radix trees forms a radix priority search tree (PST)
+ * which is useful for storing intervals, e.g, we can consider a vma as a closed
+ * interval of file pages [offset_begin, offset_end], and store all vmas that
+ * map a file in a PST. Then, using the PST, we can answer a stabbing query,
+ * i.e., selecting a set of stored intervals (vmas) that overlap with (map) a
+ * given input interval X (a set of consecutive file pages), in "O(log n + m)"
+ * time where 'log n' is the height of the PST, and 'm' is the number of stored
+ * intervals (vmas) that overlap (map) with the input interval X (the set of
+ * consecutive file pages).
+ *
+ * In our implementation, we store closed intervals of the form [radix_index,
+ * heap_index]. We assume that always radix_index <= heap_index. McCreight's PST
+ * is designed for storing intervals with unique radix indices, i.e., each
+ * interval have different radix_index. However, this limitation can be easily
+ * overcome by using the size, i.e., heap_index - radix_index, as part of the
+ * index, so we index the tree using [(radix_index,size), heap_index].
+ *
+ * When the above-mentioned indexing scheme is used, theoretically, in a 32 bit
+ * machine, the maximum height of a PST can be 64. We can use a balanced version
+ * of the priority search tree to optimize the tree height, but the balanced
+ * tree proposed by McCreight is too complex and memory-hungry for our purpose.
+ */
+
+/*
+ * The following macros are used for implementing prio_tree for i_mmap
+ */
+
+#define RADIX_INDEX(vma)  ((vma)->vm_pgoff)
+#define VMA_SIZE(vma)    (((vma)->vm_end - (vma)->vm_start) >> PAGE_SHIFT)
+/* avoid overflow */
+#define HEAP_INDEX(vma)          ((vma)->vm_pgoff + (VMA_SIZE(vma) - 1))
+
+#define GET_INDEX_VMA(vma, radix, heap)                \
+do {                                           \
+       radix = RADIX_INDEX(vma);               \
+       heap = HEAP_INDEX(vma);                 \
+} while (0)
+
+#define GET_INDEX(node, radix, heap)           \
+do {                                           \
+       struct vm_area_struct *__tmp =          \
+         prio_tree_entry(node, struct vm_area_struct, shared.prio_tree_node);\
+       GET_INDEX_VMA(__tmp, radix, heap);      \
+} while (0)
+
+static unsigned long index_bits_to_maxindex[BITS_PER_LONG];
+
+void __init prio_tree_init(void)
+{
+       unsigned int i;
+
+       for (i = 0; i < ARRAY_SIZE(index_bits_to_maxindex) - 1; i++)
+               index_bits_to_maxindex[i] = (1UL << (i + 1)) - 1;
+       index_bits_to_maxindex[ARRAY_SIZE(index_bits_to_maxindex) - 1] = ~0UL;
+}
+
+/*
+ * Maximum heap_index that can be stored in a PST with index_bits bits
+ */
+static inline unsigned long prio_tree_maxindex(unsigned int bits)
+{
+       return index_bits_to_maxindex[bits - 1];
+}
+
+/*
+ * Extend a priority search tree so that it can store a node with heap_index
+ * max_heap_index. In the worst case, this algorithm takes O((log n)^2).
+ * However, this function is used rarely and the common case performance is
+ * not bad.
+ */
+static struct prio_tree_node *prio_tree_expand(struct prio_tree_root *root,
+               struct prio_tree_node *node, unsigned long max_heap_index)
+{
+       static void prio_tree_remove(struct prio_tree_root *,
+                                       struct prio_tree_node *);
+       struct prio_tree_node *first = NULL, *prev, *last = NULL;
+
+       if (max_heap_index > prio_tree_maxindex(root->index_bits))
+               root->index_bits++;
+
+       while (max_heap_index > prio_tree_maxindex(root->index_bits)) {
+               root->index_bits++;
+
+               if (prio_tree_empty(root))
+                       continue;
+
+               if (first == NULL) {
+                       first = root->prio_tree_node;
+                       prio_tree_remove(root, root->prio_tree_node);
+                       INIT_PRIO_TREE_NODE(first);
+                       last = first;
+               } else {
+                       prev = last;
+                       last = root->prio_tree_node;
+                       prio_tree_remove(root, root->prio_tree_node);
+                       INIT_PRIO_TREE_NODE(last);
+                       prev->left = last;
+                       last->parent = prev;
+               }
+       }
+
+       INIT_PRIO_TREE_NODE(node);
+
+       if (first) {
+               node->left = first;
+               first->parent = node;
+       } else
+               last = node;
+
+       if (!prio_tree_empty(root)) {
+               last->left = root->prio_tree_node;
+               last->left->parent = last;
+       }
+
+       root->prio_tree_node = node;
+       return node;
+}
+
+/*
+ * Replace a prio_tree_node with a new node and return the old node
+ */
+static struct prio_tree_node *prio_tree_replace(struct prio_tree_root *root,
+               struct prio_tree_node *old, struct prio_tree_node *node)
+{
+       INIT_PRIO_TREE_NODE(node);
+
+       if (prio_tree_root(old)) {
+               BUG_ON(root->prio_tree_node != old);
+               /*
+                * We can reduce root->index_bits here. However, it is complex
+                * and does not help much to improve performance (IMO).
+                */
+               node->parent = node;
+               root->prio_tree_node = node;
+       } else {
+               node->parent = old->parent;
+               if (old->parent->left == old)
+                       old->parent->left = node;
+               else
+                       old->parent->right = node;
+       }
+
+       if (!prio_tree_left_empty(old)) {
+               node->left = old->left;
+               old->left->parent = node;
+       }
+
+       if (!prio_tree_right_empty(old)) {
+               node->right = old->right;
+               old->right->parent = node;
+       }
+
+       return old;
+}
+
+/*
+ * Insert a prio_tree_node @node into a radix priority search tree @root. The
+ * algorithm typically takes O(log n) time where 'log n' is the number of bits
+ * required to represent the maximum heap_index. In the worst case, the algo
+ * can take O((log n)^2) - check prio_tree_expand.
+ *
+ * If a prior node with same radix_index and heap_index is already found in
+ * the tree, then returns the address of the prior node. Otherwise, inserts
+ * @node into the tree and returns @node.
+ */
+static struct prio_tree_node *prio_tree_insert(struct prio_tree_root *root,
+               struct prio_tree_node *node)
+{
+       struct prio_tree_node *cur, *res = node;
+       unsigned long radix_index, heap_index;
+       unsigned long r_index, h_index, index, mask;
+       int size_flag = 0;
+
+       GET_INDEX(node, radix_index, heap_index);
+
+       if (prio_tree_empty(root) ||
+                       heap_index > prio_tree_maxindex(root->index_bits))
+               return prio_tree_expand(root, node, heap_index);
+
+       cur = root->prio_tree_node;
+       mask = 1UL << (root->index_bits - 1);
+
+       while (mask) {
+               GET_INDEX(cur, r_index, h_index);
+
+               if (r_index == radix_index && h_index == heap_index)
+                       return cur;
+
+                if (h_index < heap_index ||
+                   (h_index == heap_index && r_index > radix_index)) {
+                       struct prio_tree_node *tmp = node;
+                       node = prio_tree_replace(root, cur, node);
+                       cur = tmp;
+                       /* swap indices */
+                       index = r_index;
+                       r_index = radix_index;
+                       radix_index = index;
+                       index = h_index;
+                       h_index = heap_index;
+                       heap_index = index;
+               }
+
+               if (size_flag)
+                       index = heap_index - radix_index;
+               else
+                       index = radix_index;
+
+               if (index & mask) {
+                       if (prio_tree_right_empty(cur)) {
+                               INIT_PRIO_TREE_NODE(node);
+                               cur->right = node;
+                               node->parent = cur;
+                               return res;
+                       } else
+                               cur = cur->right;
+               } else {
+                       if (prio_tree_left_empty(cur)) {
+                               INIT_PRIO_TREE_NODE(node);
+                               cur->left = node;
+                               node->parent = cur;
+                               return res;
+                       } else
+                               cur = cur->left;
+               }
+
+               mask >>= 1;
+
+               if (!mask) {
+                       mask = 1UL << (root->index_bits - 1);
+                       size_flag = 1;
+               }
+       }
+       /* Should not reach here */
+       BUG();
+       return NULL;
+}
+
+/*
+ * Remove a prio_tree_node @node from a radix priority search tree @root. The
+ * algorithm takes O(log n) time where 'log n' is the number of bits required
+ * to represent the maximum heap_index.
+ */
+static void prio_tree_remove(struct prio_tree_root *root,
+               struct prio_tree_node *node)
+{
+       struct prio_tree_node *cur;
+       unsigned long r_index, h_index_right, h_index_left;
+
+       cur = node;
+
+       while (!prio_tree_left_empty(cur) || !prio_tree_right_empty(cur)) {
+               if (!prio_tree_left_empty(cur))
+                       GET_INDEX(cur->left, r_index, h_index_left);
+               else {
+                       cur = cur->right;
+                       continue;
+               }
+
+               if (!prio_tree_right_empty(cur))
+                       GET_INDEX(cur->right, r_index, h_index_right);
+               else {
+                       cur = cur->left;
+                       continue;
+               }
+
+               /* both h_index_left and h_index_right cannot be 0 */
+               if (h_index_left >= h_index_right)
+                       cur = cur->left;
+               else
+                       cur = cur->right;
+       }
+
+       if (prio_tree_root(cur)) {
+               BUG_ON(root->prio_tree_node != cur);
+               INIT_PRIO_TREE_ROOT(root);
+               return;
+       }
+
+       if (cur->parent->right == cur)
+               cur->parent->right = cur->parent;
+       else
+               cur->parent->left = cur->parent;
+
+       while (cur != node)
+               cur = prio_tree_replace(root, cur->parent, cur);
+}
+
+/*
+ * Following functions help to enumerate all prio_tree_nodes in the tree that
+ * overlap with the input interval X [radix_index, heap_index]. The enumeration
+ * takes O(log n + m) time where 'log n' is the height of the tree (which is
+ * proportional to # of bits required to represent the maximum heap_index) and
+ * 'm' is the number of prio_tree_nodes that overlap the interval X.
+ */
+
+static struct prio_tree_node *prio_tree_left(
+               struct prio_tree_root *root, struct prio_tree_iter *iter,
+               unsigned long radix_index, unsigned long heap_index,
+               unsigned long *r_index, unsigned long *h_index)
+{
+       if (prio_tree_left_empty(iter->cur))
+               return NULL;
+
+       GET_INDEX(iter->cur->left, *r_index, *h_index);
+
+       if (radix_index <= *h_index) {
+               iter->cur = iter->cur->left;
+               iter->mask >>= 1;
+               if (iter->mask) {
+                       if (iter->size_level)
+                               iter->size_level++;
+               } else {
+                       if (iter->size_level) {
+                               BUG_ON(!prio_tree_left_empty(iter->cur));
+                               BUG_ON(!prio_tree_right_empty(iter->cur));
+                               iter->size_level++;
+                               iter->mask = ULONG_MAX;
+                       } else {
+                               iter->size_level = 1;
+                               iter->mask = 1UL << (root->index_bits - 1);
+                       }
+               }
+               return iter->cur;
+       }
+
+       return NULL;
+}
+
+static struct prio_tree_node *prio_tree_right(
+               struct prio_tree_root *root, struct prio_tree_iter *iter,
+               unsigned long radix_index, unsigned long heap_index,
+               unsigned long *r_index, unsigned long *h_index)
+{
+       unsigned long value;
+
+       if (prio_tree_right_empty(iter->cur))
+               return NULL;
+
+       if (iter->size_level)
+               value = iter->value;
+       else
+               value = iter->value | iter->mask;
+
+       if (heap_index < value)
+               return NULL;
+
+       GET_INDEX(iter->cur->right, *r_index, *h_index);
+
+       if (radix_index <= *h_index) {
+               iter->cur = iter->cur->right;
+               iter->mask >>= 1;
+               iter->value = value;
+               if (iter->mask) {
+                       if (iter->size_level)
+                               iter->size_level++;
+               } else {
+                       if (iter->size_level) {
+                               BUG_ON(!prio_tree_left_empty(iter->cur));
+                               BUG_ON(!prio_tree_right_empty(iter->cur));
+                               iter->size_level++;
+                               iter->mask = ULONG_MAX;
+                       } else {
+                               iter->size_level = 1;
+                               iter->mask = 1UL << (root->index_bits - 1);
+                       }
+               }
+               return iter->cur;
+       }
+
+       return NULL;
+}
+
+static struct prio_tree_node *prio_tree_parent(struct prio_tree_iter *iter)
+{
+       iter->cur = iter->cur->parent;
+       if (iter->mask == ULONG_MAX)
+               iter->mask = 1UL;
+       else if (iter->size_level == 1)
+               iter->mask = 1UL;
+       else
+               iter->mask <<= 1;
+       if (iter->size_level)
+               iter->size_level--;
+       if (!iter->size_level && (iter->value & iter->mask))
+               iter->value ^= iter->mask;
+       return iter->cur;
+}
+
+static inline int overlap(unsigned long radix_index, unsigned long heap_index,
+               unsigned long r_index, unsigned long h_index)
+{
+       return heap_index >= r_index && radix_index <= h_index;
+}
+
+/*
+ * prio_tree_first:
+ *
+ * Get the first prio_tree_node that overlaps with the interval [radix_index,
+ * heap_index]. Note that always radix_index <= heap_index. We do a pre-order
+ * traversal of the tree.
+ */
+static struct prio_tree_node *prio_tree_first(struct prio_tree_root *root,
+               struct prio_tree_iter *iter, unsigned long radix_index,
+               unsigned long heap_index)
+{
+       unsigned long r_index, h_index;
+
+       INIT_PRIO_TREE_ITER(iter);
+
+       if (prio_tree_empty(root))
+               return NULL;
+
+       GET_INDEX(root->prio_tree_node, r_index, h_index);
+
+       if (radix_index > h_index)
+               return NULL;
+
+       iter->mask = 1UL << (root->index_bits - 1);
+       iter->cur = root->prio_tree_node;
+
+       while (1) {
+               if (overlap(radix_index, heap_index, r_index, h_index))
+                       return iter->cur;
+
+               if (prio_tree_left(root, iter, radix_index, heap_index,
+                                       &r_index, &h_index))
+                       continue;
+
+               if (prio_tree_right(root, iter, radix_index, heap_index,
+                                       &r_index, &h_index))
+                       continue;
+
+               break;
+       }
+       return NULL;
+}
+
+/*
+ * prio_tree_next:
+ *
+ * Get the next prio_tree_node that overlaps with the input interval in iter
+ */
+static struct prio_tree_node *prio_tree_next(struct prio_tree_root *root,
+               struct prio_tree_iter *iter, unsigned long radix_index,
+               unsigned long heap_index)
+{
+       unsigned long r_index, h_index;
+
+repeat:
+       while (prio_tree_left(root, iter, radix_index,
+                               heap_index, &r_index, &h_index)) {
+               if (overlap(radix_index, heap_index, r_index, h_index))
+                       return iter->cur;
+       }
+
+       while (!prio_tree_right(root, iter, radix_index,
+                               heap_index, &r_index, &h_index)) {
+               while (!prio_tree_root(iter->cur) &&
+                               iter->cur->parent->right == iter->cur)
+                       prio_tree_parent(iter);
+
+               if (prio_tree_root(iter->cur))
+                       return NULL;
+
+               prio_tree_parent(iter);
+       }
+
+       if (overlap(radix_index, heap_index, r_index, h_index))
+               return iter->cur;
+
+       goto repeat;
+}
+
+/*
+ * Radix priority search tree for address_space->i_mmap
+ *
+ * For each vma that map a unique set of file pages i.e., unique [radix_index,
+ * heap_index] value, we have a corresponing priority search tree node. If
+ * multiple vmas have identical [radix_index, heap_index] value, then one of
+ * them is used as a tree node and others are stored in a vm_set list. The tree
+ * node points to the first vma (head) of the list using vm_set.head.
+ *
+ * prio_tree_root
+ *      |
+ *      A       vm_set.head
+ *     / \      /
+ *    L   R -> H-I-J-K-M-N-O-P-Q-S
+ *    ^   ^    <-- vm_set.list -->
+ *  tree nodes
+ *
+ * We need some way to identify whether a vma is a tree node, head of a vm_set
+ * list, or just a member of a vm_set list. We cannot use vm_flags to store
+ * such information. The reason is, in the above figure, it is possible that
+ * vm_flags' of R and H are covered by the different mmap_sems. When R is
+ * removed under R->mmap_sem, H replaces R as a tree node. Since we do not hold
+ * H->mmap_sem, we cannot use H->vm_flags for marking that H is a tree node now.
+ * That's why some trick involving shared.vm_set.parent is used for identifying
+ * tree nodes and list head nodes.
+ *
+ * vma radix priority search tree node rules:
+ *
+ * vma->shared.vm_set.parent != NULL    ==> a tree node
+ *      vma->shared.vm_set.head != NULL ==> list of others mapping same range
+ *      vma->shared.vm_set.head == NULL ==> no others map the same range
+ *
+ * vma->shared.vm_set.parent == NULL
+ *     vma->shared.vm_set.head != NULL ==> list head of vmas mapping same range
+ *     vma->shared.vm_set.head == NULL ==> a list node
+ */
+
+/*
+ * Add a new vma known to map the same set of pages as the old vma:
+ * useful for fork's dup_mmap as well as vma_prio_tree_insert below.
+ * Note that it just happens to work correctly on i_mmap_nonlinear too.
+ */
+void vma_prio_tree_add(struct vm_area_struct *vma, struct vm_area_struct *old)
+{
+       /* Leave these BUG_ONs till prio_tree patch stabilizes */
+       BUG_ON(RADIX_INDEX(vma) != RADIX_INDEX(old));
+       BUG_ON(HEAP_INDEX(vma) != HEAP_INDEX(old));
+
+       if (!old->shared.vm_set.parent)
+               list_add(&vma->shared.vm_set.list,
+                               &old->shared.vm_set.list);
+       else if (old->shared.vm_set.head)
+               list_add_tail(&vma->shared.vm_set.list,
+                               &old->shared.vm_set.head->shared.vm_set.list);
+       else {
+               INIT_LIST_HEAD(&vma->shared.vm_set.list);
+               vma->shared.vm_set.head = old;
+               old->shared.vm_set.head = vma;
+       }
+}
+
+void vma_prio_tree_insert(struct vm_area_struct *vma,
+                         struct prio_tree_root *root)
+{
+       struct prio_tree_node *ptr;
+       struct vm_area_struct *old;
+
+       ptr = prio_tree_insert(root, &vma->shared.prio_tree_node);
+       if (ptr != &vma->shared.prio_tree_node) {
+               old = prio_tree_entry(ptr, struct vm_area_struct,
+                                       shared.prio_tree_node);
+               vma_prio_tree_add(vma, old);
+       }
+}
+
+void vma_prio_tree_remove(struct vm_area_struct *vma,
+                         struct prio_tree_root *root)
+{
+       struct vm_area_struct *node, *head, *new_head;
+
+       if (!vma->shared.vm_set.head) {
+               if (!vma->shared.vm_set.parent)
+                       list_del_init(&vma->shared.vm_set.list);
+               else
+                       prio_tree_remove(root, &vma->shared.prio_tree_node);
+       } else {
+               /* Leave this BUG_ON till prio_tree patch stabilizes */
+               BUG_ON(vma->shared.vm_set.head->shared.vm_set.head != vma);
+               if (vma->shared.vm_set.parent) {
+                       head = vma->shared.vm_set.head;
+                       if (!list_empty(&head->shared.vm_set.list)) {
+                               new_head = list_entry(
+                                       head->shared.vm_set.list.next,
+                                       struct vm_area_struct,
+                                       shared.vm_set.list);
+                               list_del_init(&head->shared.vm_set.list);
+                       } else
+                               new_head = NULL;
+
+                       prio_tree_replace(root, &vma->shared.prio_tree_node,
+                                       &head->shared.prio_tree_node);
+                       head->shared.vm_set.head = new_head;
+                       if (new_head)
+                               new_head->shared.vm_set.head = head;
+
+               } else {
+                       node = vma->shared.vm_set.head;
+                       if (!list_empty(&vma->shared.vm_set.list)) {
+                               new_head = list_entry(
+                                       vma->shared.vm_set.list.next,
+                                       struct vm_area_struct,
+                                       shared.vm_set.list);
+                               list_del_init(&vma->shared.vm_set.list);
+                               node->shared.vm_set.head = new_head;
+                               new_head->shared.vm_set.head = node;
+                       } else
+                               node->shared.vm_set.head = NULL;
+               }
+       }
+}
+
+/*
+ * Helper function to enumerate vmas that map a given file page or a set of
+ * contiguous file pages. The function returns vmas that at least map a single
+ * page in the given range of contiguous file pages.
+ */
+struct vm_area_struct *vma_prio_tree_next(struct vm_area_struct *vma,
+               struct prio_tree_root *root, struct prio_tree_iter *iter,
+               pgoff_t begin, pgoff_t end)
+{
+       struct prio_tree_node *ptr;
+       struct vm_area_struct *next;
+
+       if (!vma) {
+               /*
+                * First call is with NULL vma
+                */
+               ptr = prio_tree_first(root, iter, begin, end);
+               if (ptr) {
+                       next = prio_tree_entry(ptr, struct vm_area_struct,
+                                               shared.prio_tree_node);
+                       prefetch(next->shared.vm_set.head);
+                       return next;
+               } else
+                       return NULL;
+       }
+
+       if (vma->shared.vm_set.parent) {
+               if (vma->shared.vm_set.head) {
+                       next = vma->shared.vm_set.head;
+                       prefetch(next->shared.vm_set.list.next);
+                       return next;
+               }
+       } else {
+               next = list_entry(vma->shared.vm_set.list.next,
+                               struct vm_area_struct, shared.vm_set.list);
+               if (!next->shared.vm_set.head) {
+                       prefetch(next->shared.vm_set.list.next);
+                       return next;
+               }
+       }
+
+       ptr = prio_tree_next(root, iter, begin, end);
+       if (ptr) {
+               next = prio_tree_entry(ptr, struct vm_area_struct,
+                                       shared.prio_tree_node);
+               prefetch(next->shared.vm_set.head);
+               return next;
+       } else
+               return NULL;
+}
diff --git a/mm/usercopy.c b/mm/usercopy.c
new file mode 100644 (file)
index 0000000..0ca0c9c
--- /dev/null
@@ -0,0 +1,290 @@
+/*
+ * linux/mm/usercopy.c
+ *
+ * (C) Copyright 2003 Ingo Molnar
+ *
+ * Generic implementation of all the user-VM access functions, without
+ * relying on being able to access the VM directly.
+ */
+
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/mm.h>
+#include <linux/highmem.h>
+#include <linux/pagemap.h>
+#include <linux/smp_lock.h>
+#include <linux/ptrace.h>
+#include <linux/interrupt.h>
+
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
+#include <asm/atomic_kmap.h>
+
+/*
+ * Get kernel address of the user page and pin it.
+ */
+static inline struct page *pin_page(unsigned long addr, int write)
+{
+       struct mm_struct *mm = current->mm ? : &init_mm;
+       struct page *page = NULL;
+       int ret;
+
+       /*
+        * Do a quick atomic lookup first - this is the fastpath.
+        */
+retry:
+       page = follow_page(mm, addr, write);
+       if (likely(page != NULL)) {
+               if (!PageReserved(page))
+                       get_page(page);
+               return page;
+       }
+
+       /*
+        * No luck - bad address or need to fault in the page:
+        */
+
+       /* Release the lock so get_user_pages can sleep */
+       spin_unlock(&mm->page_table_lock);
+
+       /*
+        * In the context of filemap_copy_from_user(), we are not allowed
+        * to sleep.  We must fail this usercopy attempt and allow
+        * filemap_copy_from_user() to recover: drop its atomic kmap and use
+        * a sleeping kmap instead.
+        */
+       if (in_atomic()) {
+               spin_lock(&mm->page_table_lock);
+               return NULL;
+       }
+
+       down_read(&mm->mmap_sem);
+       ret = get_user_pages(current, mm, addr, 1, write, 0, NULL, NULL);
+       up_read(&mm->mmap_sem);
+       spin_lock(&mm->page_table_lock);
+
+       if (ret <= 0)
+               return NULL;
+
+       /*
+        * Go try the follow_page again.
+        */
+       goto retry;
+}
+
+static inline void unpin_page(struct page *page)
+{
+       put_page(page);
+}
+
+/*
+ * Access another process' address space.
+ * Source/target buffer must be kernel space,
+ * Do not walk the page table directly, use get_user_pages
+ */
+static int rw_vm(unsigned long addr, void *buf, int len, int write)
+{
+       struct mm_struct *mm = current->mm ? : &init_mm;
+
+       if (!len)
+               return 0;
+
+       spin_lock(&mm->page_table_lock);
+
+       /* ignore errors, just check how much was sucessfully transfered */
+       while (len) {
+               struct page *page = NULL;
+               int bytes, offset;
+               void *maddr;
+
+               page = pin_page(addr, write);
+               if (!page)
+                       break;
+
+               bytes = len;
+               offset = addr & (PAGE_SIZE-1);
+               if (bytes > PAGE_SIZE-offset)
+                       bytes = PAGE_SIZE-offset;
+
+               maddr = kmap_atomic(page, KM_USER_COPY);
+
+#define HANDLE_TYPE(type) \
+       case sizeof(type): *(type *)(maddr+offset) = *(type *)(buf); break;
+
+               if (write) {
+                       switch (bytes) {
+                       HANDLE_TYPE(char);
+                       HANDLE_TYPE(int);
+                       HANDLE_TYPE(long long);
+                       default:
+                               memcpy(maddr + offset, buf, bytes);
+                       }
+               } else {
+#undef HANDLE_TYPE
+#define HANDLE_TYPE(type) \
+       case sizeof(type): *(type *)(buf) = *(type *)(maddr+offset); break;
+                       switch (bytes) {
+                       HANDLE_TYPE(char);
+                       HANDLE_TYPE(int);
+                       HANDLE_TYPE(long long);
+                       default:
+                               memcpy(buf, maddr + offset, bytes);
+                       }
+#undef HANDLE_TYPE
+               }
+               kunmap_atomic(maddr, KM_USER_COPY);
+               unpin_page(page);
+               len -= bytes;
+               buf += bytes;
+               addr += bytes;
+       }
+       spin_unlock(&mm->page_table_lock);
+
+       return len;
+}
+
+static int str_vm(unsigned long addr, void *buf0, int len, int copy)
+{
+       struct mm_struct *mm = current->mm ? : &init_mm;
+       struct page *page;
+       void *buf = buf0;
+
+       if (!len)
+               return len;
+
+       spin_lock(&mm->page_table_lock);
+
+       /* ignore errors, just check how much was sucessfully transfered */
+       while (len) {
+               int bytes, offset, left, copied;
+               char *maddr;
+
+               page = pin_page(addr, copy == 2);
+               if (!page) {
+                       spin_unlock(&mm->page_table_lock);
+                       return -EFAULT;
+               }
+               bytes = len;
+               offset = addr & (PAGE_SIZE-1);
+               if (bytes > PAGE_SIZE-offset)
+                       bytes = PAGE_SIZE-offset;
+
+               maddr = kmap_atomic(page, KM_USER_COPY);
+               if (copy == 2) {
+                       memset(maddr + offset, 0, bytes);
+                       copied = bytes;
+                       left = 0;
+               } else if (copy == 1) {
+                       left = strncpy_count(buf, maddr + offset, bytes);
+                       copied = bytes - left;
+               } else {
+                       copied = strnlen(maddr + offset, bytes);
+                       left = bytes - copied;
+               }
+               BUG_ON(bytes < 0 || copied < 0);
+               kunmap_atomic(maddr, KM_USER_COPY);
+               unpin_page(page);
+               len -= copied;
+               buf += copied;
+               addr += copied;
+               if (left)
+                       break;
+       }
+       spin_unlock(&mm->page_table_lock);
+
+       return len;
+}
+
+/*
+ * Copies memory from userspace (ptr) into kernelspace (val).
+ *
+ * returns # of bytes not copied.
+ */
+int get_user_size(unsigned int size, void *val, const void *ptr)
+{
+       int ret;
+
+       if (unlikely(segment_eq(get_fs(), KERNEL_DS)))
+               ret = __direct_copy_from_user(val, ptr, size);
+       else
+               ret = rw_vm((unsigned long)ptr, val, size, 0);
+       if (ret)
+               /*
+                * Zero the rest:
+                */
+               memset(val + size - ret, 0, ret);
+       return ret;
+}
+
+/*
+ * Copies memory from kernelspace (val) into userspace (ptr).
+ *
+ * returns # of bytes not copied.
+ */
+int put_user_size(unsigned int size, const void *val, void *ptr)
+{
+       if (unlikely(segment_eq(get_fs(), KERNEL_DS)))
+               return __direct_copy_to_user(ptr, val, size);
+       else
+               return rw_vm((unsigned long)ptr, (void *)val, size, 1);
+}
+
+int copy_str_fromuser_size(unsigned int size, void *val, const void *ptr)
+{
+       int copied, left;
+
+       if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
+               left = strncpy_count(val, ptr, size);
+               copied = size - left;
+               BUG_ON(copied < 0);
+
+               return copied;
+       }
+       left = str_vm((unsigned long)ptr, val, size, 1);
+       if (left < 0)
+               return left;
+       copied = size - left;
+       BUG_ON(copied < 0);
+
+       return copied;
+}
+
+int strlen_fromuser_size(unsigned int size, const void *ptr)
+{
+       int copied, left;
+
+       if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
+               copied = strnlen(ptr, size) + 1;
+               BUG_ON(copied < 0);
+
+               return copied;
+       }
+       left = str_vm((unsigned long)ptr, NULL, size, 0);
+       if (left < 0)
+               return 0;
+       copied = size - left + 1;
+       BUG_ON(copied < 0);
+
+       return copied;
+}
+
+int zero_user_size(unsigned int size, void *ptr)
+{
+       int left;
+
+       if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
+               memset(ptr, 0, size);
+               return 0;
+       }
+       left = str_vm((unsigned long)ptr, NULL, size, 2);
+       if (left < 0)
+               return size;
+       return left;
+}
+
+EXPORT_SYMBOL(get_user_size);
+EXPORT_SYMBOL(put_user_size);
+EXPORT_SYMBOL(zero_user_size);
+EXPORT_SYMBOL(copy_str_fromuser_size);
+EXPORT_SYMBOL(strlen_fromuser_size);
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
new file mode 100644 (file)
index 0000000..1788221
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ *     Sysfs attributes of bridge ports
+ *     Linux ethernet bridge
+ *
+ *     Authors:
+ *     Stephen Hemminger               <shemminger@osdl.org>
+ *
+ *     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/kernel.h>
+#include <linux/netdevice.h>
+#include <linux/if_bridge.h>
+#include <linux/rtnetlink.h>
+#include <linux/spinlock.h>
+
+#include "br_private.h"
+
+struct brport_attribute {
+       struct attribute        attr;
+       ssize_t (*show)(struct net_bridge_port *, char *);
+       ssize_t (*store)(struct net_bridge_port *, unsigned long);
+};
+
+#define BRPORT_ATTR(_name,_mode,_show,_store)                  \
+struct brport_attribute brport_attr_##_name = {                \
+       .attr = {.name = __stringify(_name),                    \
+                .mode = _mode,                                 \
+                .owner = THIS_MODULE, },                       \
+       .show   = _show,                                        \
+       .store  = _store,                                       \
+};
+
+static ssize_t show_path_cost(struct net_bridge_port *p, char *buf)
+{
+       return sprintf(buf, "%d\n", p->path_cost);
+}
+static ssize_t store_path_cost(struct net_bridge_port *p, unsigned long v)
+{
+       br_stp_set_path_cost(p, v);
+       return 0;
+}
+static BRPORT_ATTR(path_cost, S_IRUGO | S_IWUSR,
+                  show_path_cost, store_path_cost);
+
+static ssize_t show_priority(struct net_bridge_port *p, char *buf)
+{
+       return sprintf(buf, "%d\n", p->priority);
+}
+static ssize_t store_priority(struct net_bridge_port *p, unsigned long v)
+{
+       if (v >= (1<<(16-BR_PORT_BITS)))
+               return -ERANGE;
+       br_stp_set_port_priority(p, v);
+       return 0;
+}
+static BRPORT_ATTR(priority, S_IRUGO | S_IWUSR,
+                        show_priority, store_priority);
+
+static ssize_t show_designated_root(struct net_bridge_port *p, char *buf)
+{
+       return br_show_bridge_id(buf, &p->designated_root);
+}
+static BRPORT_ATTR(designated_root, S_IRUGO, show_designated_root, NULL);
+
+static ssize_t show_designated_bridge(struct net_bridge_port *p, char *buf)
+{
+       return br_show_bridge_id(buf, &p->designated_bridge);
+}
+static BRPORT_ATTR(designated_bridge, S_IRUGO, show_designated_bridge, NULL);
+
+static ssize_t show_designated_port(struct net_bridge_port *p, char *buf)
+{
+       return sprintf(buf, "%d\n", p->designated_port);
+}
+static BRPORT_ATTR(designated_port, S_IRUGO, show_designated_port, NULL);
+
+static ssize_t show_designated_cost(struct net_bridge_port *p, char *buf)
+{
+       return sprintf(buf, "%d\n", p->designated_cost);
+}
+static BRPORT_ATTR(designated_cost, S_IRUGO, show_designated_cost, NULL);
+
+static ssize_t show_port_id(struct net_bridge_port *p, char *buf)
+{
+       return sprintf(buf, "0x%x\n", p->port_id);
+}
+static BRPORT_ATTR(port_id, S_IRUGO, show_port_id, NULL);
+
+static ssize_t show_port_no(struct net_bridge_port *p, char *buf)
+{
+       return sprintf(buf, "0x%x\n", p->port_no);
+}
+
+static BRPORT_ATTR(port_no, S_IRUGO, show_port_no, NULL);
+
+static ssize_t show_change_ack(struct net_bridge_port *p, char *buf)
+{
+       return sprintf(buf, "%d\n", p->topology_change_ack);
+}
+static BRPORT_ATTR(change_ack, S_IRUGO, show_change_ack, NULL);
+
+static ssize_t show_config_pending(struct net_bridge_port *p, char *buf)
+{
+       return sprintf(buf, "%d\n", p->config_pending);
+}
+static BRPORT_ATTR(config_pending, S_IRUGO, show_config_pending, NULL);
+
+static ssize_t show_port_state(struct net_bridge_port *p, char *buf)
+{
+       return sprintf(buf, "%d\n", p->state);
+}
+static BRPORT_ATTR(state, S_IRUGO, show_port_state, NULL);
+
+static ssize_t show_message_age_timer(struct net_bridge_port *p,
+                                           char *buf)
+{
+       return sprintf(buf, "%ld\n", br_timer_value(&p->message_age_timer));
+}
+static BRPORT_ATTR(message_age_timer, S_IRUGO, show_message_age_timer, NULL);
+
+static ssize_t show_forward_delay_timer(struct net_bridge_port *p,
+                                           char *buf)
+{
+       return sprintf(buf, "%ld\n", br_timer_value(&p->forward_delay_timer));
+}
+static BRPORT_ATTR(forward_delay_timer, S_IRUGO, show_forward_delay_timer, NULL);
+
+static ssize_t show_hold_timer(struct net_bridge_port *p,
+                                           char *buf)
+{
+       return sprintf(buf, "%ld\n", br_timer_value(&p->hold_timer));
+}
+static BRPORT_ATTR(hold_timer, S_IRUGO, show_hold_timer, NULL);
+
+static struct brport_attribute *brport_attrs[] = {
+       &brport_attr_path_cost,
+       &brport_attr_priority,
+       &brport_attr_port_id,
+       &brport_attr_port_no,
+       &brport_attr_designated_root,
+       &brport_attr_designated_bridge,
+       &brport_attr_designated_port,
+       &brport_attr_designated_cost,
+       &brport_attr_state,
+       &brport_attr_change_ack,
+       &brport_attr_config_pending,
+       &brport_attr_message_age_timer,
+       &brport_attr_forward_delay_timer,
+       &brport_attr_hold_timer,
+       NULL
+};
+
+#define to_brport_attr(_at) container_of(_at, struct brport_attribute, attr)
+#define to_brport(obj) container_of(obj, struct net_bridge_port, kobj)
+
+static ssize_t brport_show(struct kobject * kobj,
+                          struct attribute * attr, char * buf)
+{
+       struct brport_attribute * brport_attr = to_brport_attr(attr);
+       struct net_bridge_port * p = to_brport(kobj);
+
+       return brport_attr->show(p, buf);
+}
+
+static ssize_t brport_store(struct kobject * kobj,
+                           struct attribute * attr,
+                           const char * buf, size_t count)
+{
+       struct brport_attribute * brport_attr = to_brport_attr(attr);
+       struct net_bridge_port * p = to_brport(kobj);
+       ssize_t ret = -EINVAL;
+       char *endp;
+       unsigned long val;
+
+       if (!capable(CAP_NET_ADMIN))
+               return -EPERM;
+
+       val = simple_strtoul(buf, &endp, 0);
+       if (endp != buf) {
+               rtnl_lock();
+               if (p->dev && p->br && brport_attr->store) {
+                       spin_lock_bh(&p->br->lock);
+                       ret = brport_attr->store(p, val);
+                       spin_unlock_bh(&p->br->lock);
+                       if (ret == 0)
+                               ret = count;
+               }
+               rtnl_unlock();
+       }
+       return ret;
+}
+
+/* called from kobject_put when port ref count goes to zero. */
+static void brport_release(struct kobject *kobj)
+{
+       kfree(container_of(kobj, struct net_bridge_port, kobj));
+}
+
+static struct sysfs_ops brport_sysfs_ops = {
+       .show = brport_show,
+       .store = brport_store,
+};
+
+static struct kobj_type brport_ktype = {
+       .sysfs_ops = &brport_sysfs_ops,
+       .release = brport_release,
+};
+
+
+/*
+ * Add sysfs entries to ethernet device added to a bridge.
+ * Creates a brport subdirectory with bridge attributes.
+ * Puts symlink in bridge's brport subdirectory
+ */
+int br_sysfs_addif(struct net_bridge_port *p)
+{
+       struct net_bridge *br = p->br;
+       struct brport_attribute **a;
+       int err;
+
+       ASSERT_RTNL();
+
+       kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR);
+       p->kobj.ktype = &brport_ktype;
+       p->kobj.parent = &(p->dev->class_dev.kobj);
+       p->kobj.kset = &bridge_subsys.kset;
+
+       err = kobject_add(&p->kobj);
+       if(err)
+               goto out1;
+
+       err = sysfs_create_link(&p->kobj, &br->dev->class_dev.kobj, 
+                               SYSFS_BRIDGE_PORT_LINK);
+       if (err)
+               goto out2;
+
+       for (a = brport_attrs; *a; ++a) {
+               err = sysfs_create_file(&p->kobj, &((*a)->attr));
+               if (err)
+                       goto out2;
+       }
+
+       err = sysfs_create_link(&br->ifobj, &p->kobj, p->dev->name);
+       if (err)
+               goto out2;
+
+       return 0;
+ out2:
+       kobject_del(&p->kobj);
+ out1:
+       return err;
+}
+
+void br_sysfs_removeif(struct net_bridge_port *p)
+{
+       pr_debug("br_sysfs_removeif\n");
+       sysfs_remove_link(&p->br->ifobj, p->dev->name);
+       kobject_del(&p->kobj);
+}
+
+void br_sysfs_freeif(struct net_bridge_port *p)
+{
+       pr_debug("br_sysfs_freeif\n");
+       kobject_put(&p->kobj);
+}
diff --git a/net/tux/Kconfig b/net/tux/Kconfig
new file mode 100644 (file)
index 0000000..8b6d624
--- /dev/null
@@ -0,0 +1,25 @@
+
+config TUX
+       tristate "TUX: Threaded linUX application protocol accelerator layer"
+       default y if INET=y
+       select ZLIB_DEFLATE
+       help
+         This is the TUX content-accelerator/server
+
+menu "TUX options"
+       depends on TUX
+
+config TUX_EXTCGI
+       bool "External CGI module"
+       default y
+
+config TUX_EXTENDED_LOG
+       bool "extended TUX logging format"
+       default n
+
+config TUX_DEBUG
+       bool "debug TUX"
+       default n
+
+endmenu
+
diff --git a/net/tux/Makefile b/net/tux/Makefile
new file mode 100644 (file)
index 0000000..fc0bbd0
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Makefile for TUX
+#
+
+obj-$(CONFIG_TUX) += tux.o
+
+tux-y := accept.o input.o userspace.o cachemiss.o output.o \
+       redirect.o postpone.o logger.o proto_http.o proto_ftp.o \
+       proc.o main.o mod.o abuf.o times.o directory.o gzip.o
+
+tux-$(subst m,y,$(CONFIG_TUX_EXTCGI)) += cgi.o extcgi.o
+
diff --git a/net/tux/abuf.c b/net/tux/abuf.c
new file mode 100644 (file)
index 0000000..7447e69
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * abuf.c: async buffer-sending
+ */
+
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+char * get_abuf (tux_req_t *req, unsigned int max_size)
+{
+       threadinfo_t *ti = req->ti;
+       struct page *page;
+       char *buf;
+       unsigned int offset;
+       unsigned int left;
+
+       if (req->abuf.page || req->abuf.buf || req->abuf.size)
+               TUX_BUG();
+
+       if (max_size > PAGE_SIZE)
+               BUG();
+       offset = ti->header_offset;
+       if (offset > PAGE_SIZE)
+               TUX_BUG();
+       left = PAGE_SIZE - offset;
+       if (!max_size)
+               BUG();
+       page = ti->header_cache;
+       if ((left < max_size) || !page) {
+               while (!(page = alloc_pages(GFP_KERNEL, 0))) {
+                       if (net_ratelimit())
+                               printk(KERN_WARNING "tux: OOM in get_abuf()!\n");
+                       current->state = TASK_UNINTERRUPTIBLE;
+                       schedule_timeout(1);
+               }
+
+               if (ti->header_cache)
+                       __free_page(ti->header_cache);
+               ti->header_cache = page;
+               ti->header_offset = 0;
+               offset = 0;
+       }
+       buf = page_address(page) + offset;
+
+       if (!page)
+               BUG();
+       req->abuf.page = page;
+       req->abuf.buf = buf;
+       req->abuf.size = 0;
+       req->abuf.offset = offset;
+       req->abuf.flags = 0;
+       get_page(req->abuf.page);
+
+       return buf;
+}
+
+static void do_send_abuf (tux_req_t *req, int cachemiss);
+
+void send_abuf (tux_req_t *req, unsigned int size, unsigned long flags)
+{
+       threadinfo_t *ti = req->ti;
+
+       Dprintk("send_abuf(req: %p, sock: %p): %p(%p), size:%d, off:%d, flags:%08lx\n", req, req->sock, req->abuf.page, req->abuf.buf, size, req->abuf.offset, flags);
+
+       ti->header_offset += size;
+       if (ti->header_offset > PAGE_SIZE)
+               TUX_BUG();
+       if (req->abuf.offset + req->abuf.size > PAGE_SIZE)
+               TUX_BUG();
+
+       req->abuf.flags = flags | MSG_NOSIGNAL;
+       req->abuf.size = size;
+
+       add_tux_atom(req, do_send_abuf);
+}
+
+static void do_send_abuf (tux_req_t *req, int cachemiss)
+{
+       int ret;
+
+       if (req->magic != TUX_MAGIC)
+               TUX_BUG();
+       if (!req->sock)
+               TUX_BUG();
+       tcp_sk(req->sock->sk)->nonagle = 2;
+
+repeat:
+       Dprintk("do_send_abuf(%p,%d): %p(%p), size:%d, off:%d, flags:%08lx\n",
+                       req, cachemiss,
+                       req->abuf.page, req->abuf.buf, req->abuf.size,
+                       req->abuf.offset, req->abuf.flags);
+
+       if (tux_zerocopy_header)
+               ret = tcp_sendpage(req->sock, req->abuf.page,
+                       req->abuf.offset, req->abuf.size, req->abuf.flags);
+       else {
+               mm_segment_t oldmm;
+               oldmm = get_fs(); set_fs(KERNEL_DS);
+               ret = send_sync_buf(req, req->sock, req->abuf.buf,
+                       req->abuf.size, req->abuf.flags);
+               set_fs(oldmm);
+       }
+
+
+       Dprintk("do_send_abuf: ret: %d\n", ret);
+       if (!ret)
+               TUX_BUG();
+
+       if (ret < 0) {
+               if (ret != -EAGAIN) {
+                       TDprintk("ret: %d, req->error = TUX_ERROR_CONN_CLOSE.\n", ret);
+                       req->error = TUX_ERROR_CONN_CLOSE;
+                       req->atom_idx = 0;
+                       req->in_file.f_pos = 0;
+                       __free_page(req->abuf.page);
+                       memset(&req->abuf, 0, sizeof(req->abuf));
+                       zap_request(req, cachemiss);
+                       return;
+               }
+               add_tux_atom(req, do_send_abuf);
+               if (add_output_space_event(req, req->sock)) {
+                       del_tux_atom(req);
+                       goto repeat;
+               }
+               return;
+       }
+
+       req->abuf.buf += ret;
+       req->abuf.offset += ret;
+       req->abuf.size -= ret;
+
+       if ((int)req->abuf.size < 0)
+               TUX_BUG();
+       if (req->abuf.size > 0)
+               goto repeat;
+
+       Dprintk("DONE do_send_abuf: %p(%p), size:%d, off:%d, flags:%08lx\n",
+                       req->abuf.page, req->abuf.buf, req->abuf.size,
+                       req->abuf.offset, req->abuf.flags);
+
+       __free_page(req->abuf.page);
+
+       memset(&req->abuf, 0, sizeof(req->abuf));
+
+       add_req_to_workqueue(req);
+}
+
+void __send_async_message (tux_req_t *req, const char *message,
+                               int status, unsigned int size, int push)
+{
+       unsigned int flags;
+       char *buf;
+
+       Dprintk("TUX: sending %d reply (%d bytes)!\n", status, size);
+       Dprintk("request %p, reply: %s\n", req, message);
+       if (!size)
+               TUX_BUG();
+       buf = get_abuf(req, size);
+       memcpy(buf, message, size);
+
+       req->status = status;
+       flags = MSG_DONTWAIT;
+       if (!push)
+               flags |= MSG_MORE;
+       send_abuf(req, size, flags);
+       add_req_to_workqueue(req);
+}
diff --git a/net/tux/accept.c b/net/tux/accept.c
new file mode 100644 (file)
index 0000000..16f611c
--- /dev/null
@@ -0,0 +1,859 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * accept.c: accept new connections, allocate requests
+ */
+
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+unsigned int tux_ack_pingpong = 1;
+unsigned int tux_push_all = 0;
+unsigned int tux_zerocopy_parse = 1;
+
+static int __idle_event (tux_req_t *req);
+static int __output_space_event (tux_req_t *req);
+
+struct socket * start_listening(tux_socket_t *listen, int nr)
+{
+       struct sockaddr_in sin;
+       struct socket *sock = NULL;
+       struct sock *sk;
+       struct tcp_opt *tp;
+       int err;
+       u16 port = listen->port;
+       u32 addr = listen->ip;
+       tux_proto_t *proto = listen->proto;
+
+       /* Create a listening socket: */
+
+       err = sock_create(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
+       if (err) {
+               printk(KERN_ERR "TUX: error %d creating socket.\n", err);
+               goto error;
+       }
+
+       /* Bind the socket: */
+
+       sin.sin_family = AF_INET;
+       sin.sin_addr.s_addr = htonl(addr);
+       sin.sin_port = htons(port);
+
+       sk = sock->sk;
+       sk->sk_reuse = 1;
+       sock_set_flag(sk, SOCK_URGINLINE);
+
+       err = sock->ops->bind(sock, (struct sockaddr*)&sin, sizeof(sin));
+       if (err) {
+               printk(KERN_ERR "TUX: error %d binding socket. This means that probably some other process is (or was a short time ago) using addr %s://%d.%d.%d.%d:%d.\n", 
+                       err, proto->name, HIPQUAD(addr), port);
+               goto error;
+       }
+
+       tp = tcp_sk(sk);
+       Dprintk("listen sk accept_queue: %p/%p.\n",
+               tp->accept_queue, tp->accept_queue_tail);
+       tp->ack.pingpong = tux_ack_pingpong;
+
+       sock_reset_flag(sk, SOCK_LINGER);
+       sk->sk_lingertime = 0;
+       tp->linger2 = tux_keepalive_timeout * HZ;
+
+       if (proto->defer_accept && !tux_keepalive_timeout && tux_defer_accept)
+               tp->defer_accept = 1;
+
+       /* Now, start listening on the socket */
+
+       err = sock->ops->listen(sock, tux_max_backlog);
+       if (err) {
+               printk(KERN_ERR "TUX: error %d listening on socket.\n", err);
+               goto error;
+       }
+
+       printk(KERN_NOTICE "TUX: thread %d listens on %s://%d.%d.%d.%d:%d.\n",
+               nr, proto->name, HIPQUAD(addr), port);
+       return sock;
+
+error:
+       if (sock)
+               sock_release(sock);
+       return NULL;
+}
+
+static inline void __kfree_req (tux_req_t *req, threadinfo_t * ti)
+{
+       list_del(&req->all);
+       DEBUG_DEL_LIST(&req->all);
+       ti->nr_requests--;
+       kfree(req);
+}
+
+int flush_freequeue (threadinfo_t * ti)
+{
+       struct list_head *tmp;
+       unsigned long flags;
+       tux_req_t *req;
+       int count = 0;
+
+       spin_lock_irqsave(&ti->free_requests_lock,flags);
+       while (ti->nr_free_requests) {
+               ti->nr_free_requests--;
+               tmp = ti->free_requests.next;
+               req = list_entry(tmp, tux_req_t, free);
+               list_del(tmp);
+               DEBUG_DEL_LIST(tmp);
+               DEC_STAT(nr_free_pending);
+               __kfree_req(req, ti);
+               count++;
+       }
+       spin_unlock_irqrestore(&ti->free_requests_lock,flags);
+
+       return count;
+}
+
+static tux_req_t * kmalloc_req (threadinfo_t * ti)
+{
+       struct list_head *tmp;
+       unsigned long flags;
+       tux_req_t *req;
+
+       spin_lock_irqsave(&ti->free_requests_lock, flags);
+       if (ti->nr_free_requests) {
+               ti->nr_free_requests--;
+               tmp = ti->free_requests.next;
+               req = list_entry(tmp, tux_req_t, free);
+               list_del(tmp);
+               DEBUG_DEL_LIST(tmp);
+               DEC_STAT(nr_free_pending);
+               req->magic = TUX_MAGIC;
+               spin_unlock_irqrestore(&ti->free_requests_lock, flags);
+       } else {
+               spin_unlock_irqrestore(&ti->free_requests_lock, flags);
+               req = tux_kmalloc(sizeof(*req));
+               ti->nr_requests++;
+               memset (req, 0, sizeof(*req));
+               list_add(&req->all, &ti->all_requests);
+       }
+       req->magic = TUX_MAGIC;
+       INC_STAT(nr_allocated);
+       init_waitqueue_entry(&req->sleep, current);
+       init_waitqueue_entry(&req->ftp_sleep, current);
+       INIT_LIST_HEAD(&req->work);
+       INIT_LIST_HEAD(&req->free);
+       INIT_LIST_HEAD(&req->lru);
+       req->ti = ti;
+       req->total_bytes = 0;
+       SET_TIMESTAMP(req->accept_timestamp);
+       req->first_timestamp = jiffies;
+       req->fd = -1;
+       init_timer(&req->keepalive_timer);
+       init_timer(&req->output_timer);
+
+       Dprintk("allocated NEW req %p.\n", req);
+       return req;
+}
+
+void kfree_req (tux_req_t *req)
+{
+       threadinfo_t * ti = req->ti;
+       unsigned long flags;
+
+       Dprintk("freeing req %p.\n", req);
+
+       if (req->magic != TUX_MAGIC)
+               TUX_BUG();
+       spin_lock_irqsave(&ti->free_requests_lock,flags);
+       req->magic = 0;
+       DEC_STAT(nr_allocated);
+       if (req->sock || req->dentry || req->private)
+               TUX_BUG();
+       if (ti->nr_free_requests > tux_max_free_requests)
+               __kfree_req(req, ti);
+       else {
+               req->error = 0;
+               ti->nr_free_requests++;
+
+               // the free requests queue is LIFO
+               list_add(&req->free, &ti->free_requests);
+               INC_STAT(nr_free_pending);
+       }
+       spin_unlock_irqrestore(&ti->free_requests_lock,flags);
+}
+
+static void __add_req_to_workqueue (tux_req_t *req)
+{
+       threadinfo_t *ti = req->ti;
+
+       if (!list_empty(&req->work))
+               TUX_BUG();
+       Dprintk("work-queueing request %p at %p/%p.\n", req, __builtin_return_address(0), __builtin_return_address(1));
+       if (connection_too_fast(req))
+               list_add_tail(&req->work, &ti->work_pending);
+       else
+               list_add(&req->work, &ti->work_pending);
+       INC_STAT(nr_work_pending);
+       wake_up_process(ti->thread);
+       return;
+}
+
+void add_req_to_workqueue (tux_req_t *req)
+{
+       unsigned long flags;
+       threadinfo_t *ti = req->ti;
+
+       spin_lock_irqsave(&ti->work_lock, flags);
+       __add_req_to_workqueue(req);
+       spin_unlock_irqrestore(&ti->work_lock, flags);
+}
+
+void del_output_timer (tux_req_t *req)
+{
+#if CONFIG_SMP
+       if (!spin_is_locked(&req->ti->work_lock))
+               TUX_BUG();
+#endif
+       if (!list_empty(&req->lru)) {
+               list_del(&req->lru);
+               DEBUG_DEL_LIST(&req->lru);
+               req->ti->nr_lru--;
+       }
+       Dprintk("del output timeout for req %p.\n", req);
+       del_timer(&req->output_timer);
+}
+
+static void output_timeout_fn (unsigned long data);
+
+#define OUTPUT_TIMEOUT HZ
+
+static void add_output_timer (tux_req_t *req)
+{
+       struct timer_list *timer = &req->output_timer;
+
+       timer->data = (unsigned long) req;
+       timer->function = &output_timeout_fn;
+       mod_timer(timer, jiffies + OUTPUT_TIMEOUT);
+}
+
+static void output_timeout_fn (unsigned long data)
+{
+       tux_req_t *req = (tux_req_t *)data;
+
+       if (connection_too_fast(req)) {
+               add_output_timer(req);
+//             mod_timer(&req->output_timer, jiffies + OUTPUT_TIMEOUT);
+               return;
+       }
+       output_space_event(req);
+}
+
+void output_timeout (tux_req_t *req)
+{
+       Dprintk("output timeout for req %p.\n", req);
+       if (test_and_set_bit(0, &req->wait_output_space))
+               TUX_BUG();
+       INC_STAT(nr_output_space_pending);
+       add_output_timer(req);
+}
+
+void __del_keepalive_timer (tux_req_t *req)
+{
+#if CONFIG_SMP
+       if (!spin_is_locked(&req->ti->work_lock))
+               TUX_BUG();
+#endif
+       if (!list_empty(&req->lru)) {
+               list_del(&req->lru);
+               DEBUG_DEL_LIST(&req->lru);
+               req->ti->nr_lru--;
+       }
+       Dprintk("del keepalive timeout for req %p.\n", req);
+       del_timer(&req->keepalive_timer);
+}
+
+static void keepalive_timeout_fn (unsigned long data)
+{
+       tux_req_t *req = (tux_req_t *)data;
+
+#if CONFIG_TUX_DEBUG
+       Dprintk("req %p timed out after %d sec!\n", req, tux_keepalive_timeout);
+       if (tux_Dprintk)
+               print_req(req);
+#endif
+       Dprintk("req->error = TUX_ERROR_CONN_TIMEOUT!\n");
+       req->error = TUX_ERROR_CONN_TIMEOUT;
+       if (!idle_event(req))
+               output_space_event(req);
+}
+
+void __add_keepalive_timer (tux_req_t *req)
+{
+       struct timer_list *timer = &req->keepalive_timer;
+
+       if (!tux_keepalive_timeout)
+               TUX_BUG();
+#if CONFIG_SMP
+       if (!spin_is_locked(&req->ti->work_lock))
+               TUX_BUG();
+#endif
+
+       if (!list_empty(&req->lru))
+               TUX_BUG();
+       if (req->ti->nr_lru > tux_max_keepalives) {
+               struct list_head *head, *last;
+               tux_req_t *last_req;
+
+               head = &req->ti->lru;
+               last = head->prev;
+               if (last == head)
+                       TUX_BUG();
+               last_req = list_entry(last, tux_req_t, lru);
+               list_del(last);
+               DEBUG_DEL_LIST(last);
+               req->ti->nr_lru--;
+
+               Dprintk("LRU-aging req %p!\n", last_req);
+               last_req->error = TUX_ERROR_CONN_TIMEOUT;
+               if (!__idle_event(last_req))
+                       __output_space_event(last_req);
+       }
+       list_add(&req->lru, &req->ti->lru);
+       req->ti->nr_lru++;
+
+       timer->expires = jiffies + tux_keepalive_timeout * HZ;
+       timer->data = (unsigned long) req;
+       timer->function = &keepalive_timeout_fn;
+       add_timer(timer);
+}
+
+static int __output_space_event (tux_req_t *req)
+{
+       if (!req || (req->magic != TUX_MAGIC))
+               TUX_BUG();
+
+       if (!test_and_clear_bit(0, &req->wait_output_space)) {
+               Dprintk("output space ready event at <%p>, on non-idle %p.\n", __builtin_return_address(0), req);
+               return 0;
+       }
+
+       Dprintk("output space ready event at <%p>, %p was waiting!\n", __builtin_return_address(0), req);
+       DEC_STAT(nr_output_space_pending);
+
+       del_keepalive_timer(req);
+       del_output_timer(req);
+
+       __add_req_to_workqueue(req);
+       return 1;
+}
+
+int output_space_event (tux_req_t *req)
+{
+       int ret;
+       unsigned long flags;
+
+       spin_lock_irqsave(&req->ti->work_lock, flags);
+       ret = __output_space_event(req);
+       spin_unlock_irqrestore(&req->ti->work_lock, flags);
+
+       return ret;
+}
+
+static int __idle_event (tux_req_t *req)
+{
+       struct tcp_opt *tp;
+       threadinfo_t *ti;
+
+       if (!req || (req->magic != TUX_MAGIC))
+               TUX_BUG();
+       ti = req->ti;
+
+       if (!test_and_clear_bit(0, &req->idle_input)) {
+               Dprintk("data ready event at <%p>, on non-idle %p.\n", __builtin_return_address(0), req);
+               return 0;
+       }
+
+       Dprintk("data ready event at <%p>, %p was idle!\n", __builtin_return_address(0), req);
+       del_keepalive_timer(req);
+       del_output_timer(req);
+       DEC_STAT(nr_idle_input_pending);
+
+       tp = tcp_sk(req->sock->sk);
+
+       tp->ack.pingpong = tux_ack_pingpong;
+       SET_TIMESTAMP(req->accept_timestamp);
+
+       __add_req_to_workqueue(req);
+
+       return 1;
+}
+
+int idle_event (tux_req_t *req)
+{
+       int ret;
+       unsigned long flags;
+
+       spin_lock_irqsave(&req->ti->work_lock, flags);
+       ret = __idle_event(req);
+       spin_unlock_irqrestore(&req->ti->work_lock, flags);
+
+       return ret;
+}
+
+#define HANDLE_CALLBACK_1(callback, tux_name, real_name, param...)     \
+       tux_req_t *req;                                 \
+                                                       \
+       read_lock(&sk->sk_callback_lock);               \
+       req = sk->sk_user_data;                         \
+                                                       \
+       Dprintk("callback "#callback"(%p) req %p.\n",   \
+               sk->sk_##callback, req);                \
+                                                       \
+       if (!req) {                                     \
+               if (sk->sk_##callback == tux_name) {    \
+                       printk("BUG: "#callback" "#tux_name" "#real_name" no req!"); \
+                       TUX_BUG();                      \
+               }                                       \
+               read_unlock(&sk->sk_callback_lock);     \
+               if (sk->sk_##callback)                  \
+                       sk->sk_##callback(param);       \
+               return;                                 \
+       }                                               \
+
+#define HANDLE_CALLBACK_2(callback, tux_name, real_name, param...)     \
+       Dprintk(#tux_name"() on %p.\n", req);           \
+       if (req->magic != TUX_MAGIC)                    \
+               TUX_BUG();                              \
+       if (req->real_name)                             \
+               req->real_name(param);
+
+#define HANDLE_CALLBACK(callback, tux_name, real_name, param...)       \
+       HANDLE_CALLBACK_1(callback,tux_name,real_name,param)    \
+       HANDLE_CALLBACK_2(callback,tux_name,real_name,param)
+
+static void tux_data_ready (struct sock *sk, int len)
+{
+       HANDLE_CALLBACK_1(data_ready, tux_data_ready, real_data_ready, sk, len);
+
+       if (!idle_event(req))
+               output_space_event(req);
+       read_unlock(&sk->sk_callback_lock);
+}
+
+static void tux_write_space (struct sock *sk)
+{
+       HANDLE_CALLBACK(write_space, tux_write_space, real_write_space, sk);
+
+       Dprintk("sk->sk_wmem_queued: %d, sk->sk_sndbuf: %d.\n",
+               sk->sk_wmem_queued, sk->sk_sndbuf);
+
+       if (tcp_wspace(sk) >= tcp_min_write_space(sk)) {
+               clear_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
+               if (!idle_event(req))
+                       output_space_event(req);
+       }
+       read_unlock(&sk->sk_callback_lock);
+}
+
+static void tux_error_report (struct sock *sk)
+{
+       HANDLE_CALLBACK(error_report, tux_error_report, real_error_report, sk);
+
+       req->error = TUX_ERROR_CONN_CLOSE;
+       if (!idle_event(req))
+               output_space_event(req);
+       read_unlock(&sk->sk_callback_lock);
+}
+
+static void tux_state_change (struct sock *sk)
+{
+       HANDLE_CALLBACK(state_change, tux_state_change, real_state_change, sk);
+
+       if (req->sock && req->sock->sk &&
+                               (req->sock->sk->sk_state > TCP_ESTABLISHED)) {
+               Dprintk("req %p changed to TCP non-established!\n", req);
+               Dprintk("req->sock: %p\n", req->sock);
+               if (req->sock)
+                       Dprintk("req->sock->sk: %p\n", req->sock->sk);
+               if (req->sock && req->sock->sk)
+                       Dprintk("TCP state: %d\n", req->sock->sk->sk_state);
+               Dprintk("req->error = TUX_ERROR_CONN_CLOSE!\n");
+               req->error = TUX_ERROR_CONN_CLOSE;
+       }
+       if (!idle_event(req))
+               output_space_event(req);
+       read_unlock(&sk->sk_callback_lock);
+}
+
+static void tux_destruct (struct sock *sk)
+{
+       BUG();
+}
+
+static void tux_ftp_data_ready (struct sock *sk, int len)
+{
+       HANDLE_CALLBACK_1(data_ready, tux_ftp_data_ready,
+                               ftp_real_data_ready, sk, len);
+       if (!idle_event(req))
+               output_space_event(req);
+       read_unlock(&sk->sk_callback_lock);
+}
+
+static void tux_ftp_write_space (struct sock *sk)
+{
+       HANDLE_CALLBACK_1(write_space, tux_ftp_write_space,
+                               ftp_real_write_space, sk);
+
+       Dprintk("sk->sk_wmem_queued: %d, sk->sk_sndbuf: %d.\n",
+               sk->sk_wmem_queued, sk->sk_sndbuf);
+
+       if (tcp_wspace(sk) >= sk->sk_sndbuf/10*8) {
+               clear_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
+               if (!idle_event(req))
+                       output_space_event(req);
+       }
+       read_unlock(&sk->sk_callback_lock);
+}
+
+static void tux_ftp_error_report (struct sock *sk)
+{
+       HANDLE_CALLBACK(error_report, tux_ftp_error_report,
+               ftp_real_error_report, sk);
+
+       TDprintk("req %p sock %p got TCP errors on FTP data connection!\n", req, sk);
+       TDprintk("req->error = TUX_ERROR_CONN_CLOSE!\n");
+       req->error = TUX_ERROR_CONN_CLOSE;
+       if (!idle_event(req))
+               output_space_event(req);
+       read_unlock(&sk->sk_callback_lock);
+}
+
+static void tux_ftp_state_change (struct sock *sk)
+{
+       HANDLE_CALLBACK(state_change, tux_ftp_state_change,
+                       ftp_real_state_change, sk);
+
+       if (req->sock && req->sock->sk &&
+                       (req->sock->sk->sk_state > TCP_ESTABLISHED)) {
+               Dprintk("req %p FTP control sock changed to TCP non-established!\n", req);
+               Dprintk("req->sock: %p\n", req->sock);
+               TDprintk("req->error = TUX_ERROR_CONN_CLOSE!\n");
+
+               req->error = TUX_ERROR_CONN_CLOSE;
+       }
+       if (!idle_event(req))
+               output_space_event(req);
+       read_unlock(&sk->sk_callback_lock);
+}
+
+static void tux_ftp_create_child (struct sock *sk, struct sock *newsk)
+{
+       HANDLE_CALLBACK(create_child, tux_ftp_create_child,
+                       ftp_real_create_child, sk, newsk);
+
+       newsk->sk_user_data = NULL;
+       newsk->sk_data_ready = req->ftp_real_data_ready;
+       newsk->sk_state_change = req->ftp_real_state_change;
+       newsk->sk_write_space = req->ftp_real_write_space;
+       newsk->sk_error_report = req->ftp_real_error_report;
+       newsk->sk_create_child = req->ftp_real_create_child;
+       newsk->sk_destruct = req->ftp_real_destruct;
+
+       if (!idle_event(req))
+               output_space_event(req);
+       read_unlock(&sk->sk_callback_lock);
+}
+
+static void tux_ftp_destruct (struct sock *sk)
+{
+       BUG();
+}
+
+static void link_tux_socket (tux_req_t *req, struct socket *sock)
+{
+       struct sock *sk = sock->sk;
+
+       if (req->sock)
+               TUX_BUG();
+       if (sk->sk_destruct == tux_destruct)
+               TUX_BUG();
+       /*
+        * (No need to lock the socket, we just want to
+        * make sure that events from now on go through
+        * tux_data_ready())
+        */
+       write_lock_irq(&sk->sk_callback_lock);
+
+       req->sock = sock;
+       sk->sk_user_data = req;
+
+       req->real_data_ready = sk->sk_data_ready;
+       req->real_state_change = sk->sk_state_change;
+       req->real_write_space = sk->sk_write_space;
+       req->real_error_report = sk->sk_error_report;
+       req->real_destruct = sk->sk_destruct;
+
+       sk->sk_data_ready = tux_data_ready;
+       sk->sk_state_change = tux_state_change;
+       sk->sk_write_space = tux_write_space;
+       sk->sk_error_report = tux_error_report;
+       sk->sk_destruct = tux_destruct;
+
+       write_unlock_irq(&sk->sk_callback_lock);
+
+       if (req->real_destruct == tux_destruct)
+               TUX_BUG();
+       req->client_addr = inet_sk(sk)->daddr;
+       req->client_port = inet_sk(sk)->dport;
+
+       add_wait_queue(sk->sk_sleep, &req->sleep);
+}
+
+void __link_data_socket (tux_req_t *req, struct socket *sock,
+                                               struct sock *sk)
+{
+       /*
+        * (No need to lock the socket, we just want to
+        * make sure that events from now on go through
+        * tux_data_ready())
+        */
+       write_lock_irq(&sk->sk_callback_lock);
+
+       req->data_sock = sock;
+       sk->sk_user_data = req;
+
+       req->ftp_real_data_ready = sk->sk_data_ready;
+       req->ftp_real_state_change = sk->sk_state_change;
+       req->ftp_real_write_space = sk->sk_write_space;
+       req->ftp_real_error_report = sk->sk_error_report;
+       req->ftp_real_create_child = sk->sk_create_child;
+       req->ftp_real_destruct = sk->sk_destruct;
+
+       sk->sk_data_ready = tux_ftp_data_ready;
+       sk->sk_state_change = tux_ftp_state_change;
+       sk->sk_write_space = tux_ftp_write_space;
+       sk->sk_error_report = tux_ftp_error_report;
+       sk->sk_create_child = tux_ftp_create_child;
+       sk->sk_destruct = tux_ftp_destruct;
+
+       if (req->ftp_real_destruct == tux_ftp_destruct)
+               TUX_BUG();
+
+       write_unlock_irq(&sk->sk_callback_lock);
+
+       add_wait_queue(sk->sk_sleep, &req->ftp_sleep);
+}
+
+void link_tux_data_socket (tux_req_t *req, struct socket *sock)
+{
+       struct sock *sk = sock->sk;
+
+       if (req->data_sock)
+               TUX_BUG();
+       if (sk->sk_destruct == tux_ftp_destruct)
+               TUX_BUG();
+       __link_data_socket(req, sock, sk);
+}
+
+void unlink_tux_socket (tux_req_t *req)
+{
+       struct sock *sk;
+       
+       if (!req->sock || !req->sock->sk)
+               return;
+       sk = req->sock->sk;
+
+       write_lock_irq(&sk->sk_callback_lock);
+       if (!sk->sk_user_data)
+               TUX_BUG();
+       if (req->real_destruct == tux_destruct)
+               TUX_BUG();
+
+       sk->sk_user_data = NULL;
+
+       sk->sk_data_ready = req->real_data_ready;
+       sk->sk_state_change = req->real_state_change;
+       sk->sk_write_space = req->real_write_space;
+       sk->sk_error_report = req->real_error_report;
+       sk->sk_destruct = req->real_destruct;
+
+       if (sk->sk_destruct == tux_destruct)
+               TUX_BUG();
+
+       req->real_data_ready = NULL;
+       req->real_state_change = NULL;
+       req->real_write_space = NULL;
+       req->real_error_report = NULL;
+       req->real_destruct = NULL;
+
+       write_unlock_irq(&sk->sk_callback_lock);
+
+       remove_wait_queue(sk->sk_sleep, &req->sleep);
+}
+
+void unlink_tux_data_socket (tux_req_t *req)
+{
+       struct sock *sk;
+       
+       if (!req->data_sock || !req->data_sock->sk)
+               return;
+       sk = req->data_sock->sk;
+
+       write_lock_irq(&sk->sk_callback_lock);
+
+       if (req->real_destruct == tux_ftp_destruct)
+               TUX_BUG();
+
+       sk->sk_user_data = NULL;
+       sk->sk_data_ready = req->ftp_real_data_ready;
+       sk->sk_state_change = req->ftp_real_state_change;
+       sk->sk_write_space = req->ftp_real_write_space;
+       sk->sk_error_report = req->ftp_real_error_report;
+       sk->sk_create_child = req->ftp_real_create_child;
+       sk->sk_destruct = req->ftp_real_destruct;
+
+       req->ftp_real_data_ready = NULL;
+       req->ftp_real_state_change = NULL;
+       req->ftp_real_write_space = NULL;
+       req->ftp_real_error_report = NULL;
+       req->ftp_real_create_child = NULL;
+       req->ftp_real_destruct = NULL;
+
+       write_unlock_irq(&sk->sk_callback_lock);
+
+       if (sk->sk_destruct == tux_ftp_destruct)
+               TUX_BUG();
+
+       remove_wait_queue(sk->sk_sleep, &req->ftp_sleep);
+}
+
+void add_tux_atom (tux_req_t *req, atom_func_t *atom)
+{
+       Dprintk("adding TUX atom %p to req %p, atom_idx: %d, at %p/%p.\n",
+               atom, req, req->atom_idx, __builtin_return_address(0), __builtin_return_address(1));
+       if (req->atom_idx == MAX_TUX_ATOMS)
+               TUX_BUG();
+       req->atoms[req->atom_idx] = atom;
+       req->atom_idx++;
+}
+
+void del_tux_atom (tux_req_t *req)
+{
+       if (!req->atom_idx)
+               TUX_BUG();
+       req->atom_idx--;
+       Dprintk("removing TUX atom %p to req %p, atom_idx: %d, at %p.\n",
+               req->atoms[req->atom_idx], req, req->atom_idx, __builtin_return_address(0));
+}
+
+void tux_schedule_atom (tux_req_t *req, int cachemiss)
+{
+       if (!list_empty(&req->work))
+               TUX_BUG();
+       if (!req->atom_idx)
+               TUX_BUG();
+       req->atom_idx--;
+       Dprintk("DOING TUX atom %p, req %p, atom_idx: %d, at %p.\n",
+               req->atoms[req->atom_idx], req, req->atom_idx, __builtin_return_address(0));
+       might_sleep();
+       req->atoms[req->atom_idx](req, cachemiss);
+       might_sleep();
+       Dprintk("DONE TUX atom %p, req %p, atom_idx: %d, at %p.\n",
+               req->atoms[req->atom_idx], req, req->atom_idx, __builtin_return_address(0));
+}
+
+/*
+ * Puts newly accepted connections into the inputqueue. This is the
+ * first step in the life of a TUX request.
+ */
+int accept_requests (threadinfo_t *ti)
+{
+       int count = 0, last_count = 0, error, socknr = 0;
+       struct socket *sock, *new_sock;
+       struct tcp_opt *tp1, *tp2;
+       tux_req_t *req;
+
+       if (ti->nr_requests > tux_max_connect)
+               goto out;
+
+repeat:
+       for (socknr = 0; socknr < CONFIG_TUX_NUMSOCKETS; socknr++) {
+               tux_listen_t *tux_listen;
+
+               tux_listen = ti->listen + socknr;
+               sock = tux_listen->sock;
+               if (!sock)
+                       break;
+               if (unlikely(test_thread_flag(TIF_NEED_RESCHED)))
+                       break;
+
+       tp1 = tcp_sk(sock->sk);
+       /*
+        * Quick test to see if there are connections on the queue.
+        * This is cheaper than accept() itself because this saves us
+        * the allocation of a new socket. (Which doesn't seem to be
+        * used anyway)
+        */
+       if (tp1->accept_queue) {
+               tux_proto_t *proto;
+
+               if (!count++)
+                       __set_task_state(current, TASK_RUNNING);
+
+               new_sock = sock_alloc();
+               if (!new_sock)
+                       goto out;
+
+               new_sock->type = sock->type;
+               new_sock->ops = sock->ops;
+
+               error = sock->ops->accept(sock, new_sock, O_NONBLOCK);
+               if (error < 0)
+                       goto err;
+               if (new_sock->sk->sk_state != TCP_ESTABLISHED)
+                       goto err;
+
+               tp2 = tcp_sk(new_sock->sk);
+               tp2->nonagle = 2;
+               tp2->ack.pingpong = tux_ack_pingpong;
+               new_sock->sk->sk_reuse = 1;
+               sock_set_flag(new_sock->sk, SOCK_URGINLINE);
+
+               /* Allocate a request-entry for the connection */
+               req = kmalloc_req(ti);
+               if (!req)
+                       BUG();
+               link_tux_socket(req, new_sock);
+
+               proto = req->proto = tux_listen->proto;
+
+               proto->got_request(req);
+       }
+       }
+       if (count != last_count) {
+               last_count = count;
+               goto repeat;
+       }
+out:
+       return count;
+err:
+       sock_release(new_sock);
+       goto out;
+}
+
diff --git a/net/tux/cachemiss.c b/net/tux/cachemiss.c
new file mode 100644 (file)
index 0000000..f840583
--- /dev/null
@@ -0,0 +1,264 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * cachemiss.c: handle the 'slow IO path' by queueing not-yet-cached
+ * requests to the IO-thread pool. Dynamic load balancing is done
+ * between IO threads, based on the number of requests they have pending.
+ */
+
+#include <net/tux.h>
+#include <linux/delay.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+void queue_cachemiss (tux_req_t *req)
+{
+       iothread_t *iot = req->ti->iot;
+
+       Dprintk("queueing_cachemiss(req:%p) (req->cwd_dentry: %p) at %p:%p.\n",
+               req, req->cwd_dentry, __builtin_return_address(0), __builtin_return_address(1));
+       if (req->idle_input || req->wait_output_space)
+               TUX_BUG();
+       req->had_cachemiss = 1;
+       if (!list_empty(&req->work))
+               TUX_BUG();
+       spin_lock(&iot->async_lock);
+       if (connection_too_fast(req))
+               list_add_tail(&req->work, &iot->async_queue);
+       else
+               list_add(&req->work, &iot->async_queue);
+       iot->nr_async_pending++;
+       INC_STAT(nr_cachemiss_pending);
+       spin_unlock(&iot->async_lock);
+
+       wake_up(&iot->async_sleep);
+}
+
+static tux_req_t * get_cachemiss (iothread_t *iot)
+{
+       struct list_head *tmp;
+       tux_req_t *req = NULL;
+
+       spin_lock(&iot->async_lock);
+       if (!list_empty(&iot->async_queue)) {
+
+               tmp = iot->async_queue.next;
+               req = list_entry(tmp, tux_req_t, work);
+
+               Dprintk("get_cachemiss(%p): got req %p.\n", iot, req);
+               list_del(tmp);
+               DEBUG_DEL_LIST(tmp);
+               iot->nr_async_pending--;
+               DEC_STAT(nr_cachemiss_pending);
+
+               if (req->ti->iot != iot)
+                       TUX_BUG();
+       }
+       spin_unlock(&iot->async_lock);
+       return req;
+}
+
+struct file * tux_open_file (char *filename, int mode)
+{
+       struct file *filp;
+
+       if (!filename)
+               TUX_BUG();
+
+       /* Rule no. 3 -- Does the file exist ? */
+
+       filp = filp_open(filename, mode, 0600);
+
+       if (IS_ERR(filp) || !filp || !filp->f_dentry)
+               goto err;
+
+out:
+       return filp;
+err:
+       Dprintk("filp_open() error: %d.\n", (int)filp);
+       filp = NULL;
+       goto out;
+}
+
+static int cachemiss_thread (void *data)
+{
+       tux_req_t *req;
+       struct k_sigaction *ka;
+       DECLARE_WAITQUEUE(wait, current);
+       iothread_t *iot = data;
+       int nr = iot->ti->cpu, wake_up;
+
+       Dprintk("iot %p/%p got started.\n", iot, current);
+       drop_permissions();
+
+       spin_lock(&iot->async_lock);
+       iot->threads++;
+       sprintf(current->comm, "async IO %d/%d", nr, iot->threads);
+
+
+       spin_lock_irq(&current->sighand->siglock);
+       ka = current->sighand->action + SIGCHLD-1;
+       ka->sa.sa_handler = SIG_IGN;
+       siginitsetinv(&current->blocked, sigmask(SIGCHLD));
+       recalc_sigpending();
+       spin_unlock_irq(&current->sighand->siglock);
+
+       spin_unlock(&iot->async_lock);
+#if CONFIG_SMP
+       {
+               cpumask_t mask;
+
+               if (cpu_isset(nr, cpu_online_map)) {
+                       cpus_clear(mask);
+                       cpu_set(nr, mask);
+                       set_cpus_allowed(current, mask);
+               }
+
+       }
+#endif
+
+       add_wait_queue_exclusive(&iot->async_sleep, &wait);
+
+       for (;;) {
+               while (!list_empty(&iot->async_queue) &&
+                               (req = get_cachemiss(iot))) {
+
+                       if (!req->atom_idx) {
+                               add_tux_atom(req, flush_request);
+                               add_req_to_workqueue(req);
+                               continue;
+                       }
+                       tux_schedule_atom(req, 1);
+                       if (signal_pending(current))
+                               flush_all_signals();
+               }
+               if (signal_pending(current))
+                       flush_all_signals();
+               if (!list_empty(&iot->async_queue))
+                       continue;
+               if (iot->shutdown) {
+                       Dprintk("iot %p/%p got shutdown!\n", iot, current);
+                       break;
+               }
+               __set_current_state(TASK_INTERRUPTIBLE);
+               if (list_empty(&iot->async_queue)) {
+                       Dprintk("iot %p/%p going to sleep.\n", iot, current);
+                       schedule();
+                       Dprintk("iot %p/%p got woken up.\n", iot, current);
+               }
+               __set_current_state(TASK_RUNNING);
+       }
+
+       remove_wait_queue(&iot->async_sleep, &wait);
+
+       wake_up = 0;
+       spin_lock(&iot->async_lock);
+       if (!--iot->threads)
+               wake_up = 1;
+       spin_unlock(&iot->async_lock);
+       Dprintk("iot %p/%p has finished shutdown!\n", iot, current);
+       if (wake_up) {
+               Dprintk("iot %p/%p waking up master.\n", iot, current);
+               wake_up(&iot->wait_shutdown);
+       }
+
+       return 0;
+}
+
+static void __stop_cachemiss_threads (iothread_t *iot)
+{
+       DECLARE_WAITQUEUE(wait, current);
+
+       Dprintk("stopping async IO threads %p.\n", iot);
+       add_wait_queue(&iot->wait_shutdown, &wait);
+
+       spin_lock(&iot->async_lock);
+       if (iot->shutdown)
+               TUX_BUG();
+       if (!iot->threads)
+               TUX_BUG();
+       iot->shutdown = 1;
+       wake_up_all(&iot->async_sleep);
+       spin_unlock(&iot->async_lock);
+               
+       __set_current_state(TASK_UNINTERRUPTIBLE);
+       Dprintk("waiting for async IO threads %p to exit.\n", iot);
+       schedule();
+       remove_wait_queue(&iot->wait_shutdown, &wait);
+
+       if (iot->threads)
+               TUX_BUG();
+       if (iot->nr_async_pending)
+               TUX_BUG();
+       Dprintk("stopped async IO threads %p.\n", iot);
+}
+
+void stop_cachemiss_threads (threadinfo_t *ti)
+{
+       iothread_t *iot = ti->iot;
+
+       if (!iot)
+               TUX_BUG();
+       if (iot->nr_async_pending)
+               TUX_BUG();
+       __stop_cachemiss_threads(iot);
+       ti->iot = NULL;
+       kfree(iot);
+}
+
+int start_cachemiss_threads (threadinfo_t *ti)
+{
+       int i, pid;
+
+       iothread_t *iot;
+
+       iot = kmalloc(sizeof(*iot), GFP_KERNEL);
+       if (!iot)
+               return -ENOMEM;
+       memset(iot, 0, sizeof(*iot));
+
+       iot->ti = ti;
+       iot->async_lock = SPIN_LOCK_UNLOCKED;
+       iot->nr_async_pending = 0;
+       INIT_LIST_HEAD(&iot->async_queue);
+       init_waitqueue_head(&iot->async_sleep);
+       init_waitqueue_head(&iot->wait_shutdown);
+               
+       for (i = 0; i < NR_IO_THREADS; i++) {
+               pid = kernel_thread(cachemiss_thread, (void *)iot, 0);
+               if (pid < 0) {
+                       printk(KERN_ERR "TUX: error %d creating IO thread!\n",
+                                       pid);
+                       __stop_cachemiss_threads(iot);
+                       kfree(iot);
+                       return pid;
+               }
+       }
+       ti->iot = iot;
+       /*
+        * Wait for all cachemiss threads to start up:
+        */
+       while (iot->threads != NR_IO_THREADS) {
+               __set_current_state(TASK_INTERRUPTIBLE);
+               schedule_timeout(HZ/10);
+       }
+       return 0;
+}
+
diff --git a/net/tux/cgi.c b/net/tux/cgi.c
new file mode 100644 (file)
index 0000000..fda4d38
--- /dev/null
@@ -0,0 +1,173 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * cgi.c: user-space CGI (and other) code execution.
+ */
+
+#define __KERNEL_SYSCALLS__
+#define __KERNEL_SYSCALLS_NO_ERRNO__
+
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+static int exec_usermode(char *program_path, char *argv[], char *envp[])
+{
+       int i, err;
+
+       err = tux_chroot(tux_cgiroot);
+       if (err) {
+               printk(KERN_ERR "TUX: CGI chroot returned %d, /proc/sys/net/tux/cgiroot is probably set up incorrectly! Aborting CGI execution.\n", err);
+               return err;
+       }
+
+       /* Allow execve args to be in kernel space. */
+       set_fs(KERNEL_DS);
+
+       flush_signals(current);
+       spin_lock_irq(&current->sighand->siglock);
+       flush_signal_handlers(current, 1);
+       spin_unlock_irq(&current->sighand->siglock);
+
+       for (i = 3; i < current->files->max_fds; i++ )
+               if (current->files->fd[i])
+                       tux_close(i);
+
+       err = execve(program_path, argv, envp);
+       if (err < 0)
+               return err;
+       return 0;
+}
+
+static inline long tux_dup(unsigned int fildes)
+{
+       int ret = -EBADF;
+       struct file * file = fget(fildes);
+
+       if (file)
+               ret = dupfd(file, 0);
+       return ret;
+}
+
+static int exec_helper (void * data)
+{
+       exec_param_t *param = data;
+       char **tmp;
+       int ret;
+
+       sprintf(current->comm,"doexec - %d", current->pid);
+#if CONFIG_SMP
+       if (!tux_cgi_inherit_cpu) {
+               
+               cpumask_t cgi_mask, map;
+               
+               mask_to_cpumask(tux_cgi_cpu_mask, &cgi_mask);
+               cpus_and(map, cpu_online_map, cgi_mask);
+       
+               if (!(cpus_empty(map)))
+                       set_cpus_allowed(current, cgi_mask);
+               else
+                       set_cpus_allowed(current, cpu_online_map);
+       }
+#endif
+
+       if (!param)
+               TUX_BUG();
+       Dprintk("doing exec(%s).\n", param->command);
+
+       Dprintk("argv: ");
+       tmp = param->argv;
+       while (*tmp) {
+               Dprintk("{%s} ", *tmp);
+               tmp++;
+       }
+       Dprintk("\n");
+       Dprintk("envp: ");
+       tmp = param->envp;
+       while (*tmp) {
+               Dprintk("{%s} ", *tmp);
+               tmp++;
+       }
+       Dprintk("\n");
+       /*
+        * Set up stdin, stdout and stderr of the external
+        * CGI application.
+        */
+       if (param->pipe_fds) {
+               tux_close(1);
+               tux_close(2);
+               tux_close(4);
+               if (tux_dup(3) != 1)
+                       TUX_BUG();
+               if (tux_dup(5) != 2)
+                       TUX_BUG();
+               tux_close(3);
+               tux_close(5);
+               // do not close on exec.
+#if 0
+               sys_fcntl(0, F_SETFD, 0);
+               sys_fcntl(1, F_SETFD, 0);
+               sys_fcntl(2, F_SETFD, 0);
+#else
+               spin_lock(&current->files->file_lock);
+               FD_CLR(0, current->files->close_on_exec);
+               FD_CLR(1, current->files->close_on_exec);
+               FD_CLR(2, current->files->close_on_exec);
+               spin_unlock(&current->files->file_lock);
+#endif
+       }
+       ret = exec_usermode(param->command, param->argv, param->envp);
+       if (ret < 0)
+               Dprintk("bug: exec() returned %d.\n", ret);
+       else
+               Dprintk("exec()-ed successfully!\n");
+       return 0;
+}
+
+pid_t tux_exec_process (char *command, char **argv,
+                       char **envp, int pipe_fds,
+                               exec_param_t *param, int wait)
+{
+       exec_param_t param_local;
+       pid_t pid;
+       struct k_sigaction *ka;
+
+       ka = current->sighand->action + SIGCHLD-1;
+       ka->sa.sa_handler = SIG_IGN;
+
+       if (!param && wait)
+               param = &param_local;
+
+       param->command = command;
+       param->argv = argv;
+       param->envp = envp;
+       param->pipe_fds = pipe_fds;
+
+repeat_fork:
+       pid = kernel_thread(exec_helper, (void*) param, CLONE_SIGHAND|SIGCHLD);
+       Dprintk("kernel thread created PID %d.\n", pid);
+       if (pid < 0) {
+               printk(KERN_ERR "TUX: could not create new CGI kernel thread due to %d... retrying.\n", pid);
+               current->state = TASK_UNINTERRUPTIBLE;
+               schedule_timeout(HZ);
+               goto repeat_fork;
+       }
+       return pid;
+}
diff --git a/net/tux/directory.c b/net/tux/directory.c
new file mode 100644 (file)
index 0000000..714800e
--- /dev/null
@@ -0,0 +1,297 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * directory.c: directory listing support
+ */
+
+#define __KERNEL_SYSCALLS__
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+char * tux_print_path (tux_req_t *req, struct dentry *dentry, struct vfsmount *mnt, char *buf, unsigned int max_len)
+{
+       char *res;
+       struct dentry *cwd, *root;
+       struct vfsmount *cwd_mnt, *rootmnt;
+
+       cwd = dget(dentry);
+       cwd_mnt = mntget(mnt);
+       root = dget(req->docroot_dentry);
+       rootmnt = mntget(req->docroot_mnt);
+
+       spin_lock(&dcache_lock);
+       res = __d_path(cwd, cwd_mnt, root, rootmnt, buf, max_len);
+       spin_unlock(&dcache_lock);
+
+       dput(cwd);
+       mntput(cwd_mnt);
+       dput(root);
+       mntput(rootmnt);
+
+       return res;
+}
+
+/*
+ * There are filesystems that do not fill in ->d_type correctly.
+ * Determine file-type.
+ */
+static int get_d_type (struct dentry *dentry)
+{
+       unsigned int mode = dentry->d_inode->i_mode;
+
+       if (S_ISREG(mode))
+               return DT_REG;
+       if (S_ISDIR(mode))
+               return DT_DIR;
+       if (S_ISLNK(mode))
+               return DT_LNK;
+       if (S_ISFIFO(mode))
+               return DT_FIFO;
+       if (S_ISSOCK(mode))
+               return DT_SOCK;
+       if (S_ISCHR(mode))
+               return DT_CHR;
+       if (S_ISBLK(mode))
+               return DT_BLK;
+       return 0;
+}
+
+static void do_dir_line (tux_req_t *req, int cachemiss)
+{
+       struct linux_dirent64 *dirp, *dirp0;
+       char string0[MAX_OBJECTNAME_LEN+200], *tmp;
+       int len, curroff, total, str_len = 0;
+       int err, flag = cachemiss ? 0 : LOOKUP_ATOMIC;
+       struct nameidata base;
+       struct dentry *dentry = NULL;
+       struct inode *inode = NULL;
+       struct vfsmount *mnt = NULL;
+
+       if (req->proto->check_req_err(req, cachemiss))
+               return;
+
+       tmp = NULL;
+       dirp0 = req->dirp0;
+       curroff = req->curroff;
+       total = req->total;
+
+       dirp = (struct linux_dirent64 *)((char *)dirp0 + curroff);
+       if (!dirp->d_name || !dirp->d_name[0])
+               goto next_dir;
+       /*
+        * Hide .xxxxx files:
+        */
+       if (dirp->d_name[0] == '.')
+               goto next_dir;
+       Dprintk("<%s T:%d (off:%Ld) (len:%d)>\n", dirp->d_name, dirp->d_type, dirp->d_off, dirp->d_reclen);
+       if (tux_hide_unreadable) {
+               switch (dirp->d_type) {
+                       default:
+                               goto next_dir;
+                       case DT_UNKNOWN:
+                       case DT_REG:
+                       case DT_DIR:
+                       case DT_LNK:
+                       /* valid entries - fall through. */
+                               ;
+               }
+       }
+       len = strlen(dirp->d_name);
+       if (len >= MAX_OBJECTNAME_LEN) {
+               dirp->d_name[MAX_OBJECTNAME_LEN] = 0;
+               len = MAX_OBJECTNAME_LEN-1;
+       }
+
+       if (!req->dentry)
+               TUX_BUG();
+
+       base.flags = flag;
+       base.last_type = LAST_ROOT;
+       base.dentry = dget(req->dentry);
+       base.mnt = mntget(req->cwd_mnt);
+
+       switch_docroot(req);
+       err = path_walk(dirp->d_name, &base);
+
+       Dprintk("path_walk() returned %d.\n", err);
+
+       if (err) {
+               if (err == -EWOULDBLOCKIO) {
+                       add_tux_atom(req, do_dir_line);
+                       queue_cachemiss(req);
+                       return;
+               }
+               goto next_dir;
+       }
+
+       dentry = base.dentry;
+       mnt = base.mnt;
+       if (!dentry)
+               TUX_BUG();
+       if (IS_ERR(dentry))
+               TUX_BUG();
+       inode = dentry->d_inode;
+       if (!inode)
+               TUX_BUG();
+       if (!dirp->d_type)
+               dirp->d_type = get_d_type(dentry);
+       if (tux_hide_unreadable) {
+               umode_t mode;
+
+               mode = inode->i_mode;
+               if (mode & tux_mode_forbidden)
+                       goto out_dput;
+               if (!(mode & tux_mode_allowed))
+                       goto out_dput;
+
+               err = permission(inode, MAY_READ, NULL);
+               if (err)
+                       goto out_dput;
+               if (dirp->d_type == DT_DIR) {
+                       err = permission(inode, MAY_EXEC, NULL);
+                       if (err)
+                               goto out_dput;
+               }
+       }
+
+       tmp = req->proto->print_dir_line(req, string0, dirp->d_name, len, dirp->d_type, dentry, inode);
+       if (tmp)
+               str_len = tmp-string0;
+out_dput:
+       dput(dentry);
+       mntput(mnt);
+next_dir:
+       curroff += dirp->d_reclen;
+
+       if (tmp && (tmp != string0))
+               Dprintk("writing line (len: %d): <%s>\n", strlen(string0), string0);
+
+       if (curroff < total) {
+               req->dirp0 = dirp0;
+               req->curroff = curroff;
+               add_tux_atom(req, do_dir_line);
+       } else {
+               kfree(dirp0);
+               req->dirp0 = NULL;
+               req->curroff = 0;
+               // falls back to the list_directory atom
+       }
+       if (tmp && (tmp != string0))
+               __send_async_message(req, string0, 200, str_len, 0);
+       else
+               add_req_to_workqueue(req);
+}
+
+#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
+#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
+#define ROUND_UP64(x) (((x)+sizeof(u64)-1) & ~(sizeof(u64)-1))
+
+static int filldir64(void * __buf, const char * name, int namlen, loff_t offset,
+                    ino_t ino, unsigned int d_type)
+{
+       struct linux_dirent64 * dirent, d;
+       struct getdents_callback64 * buf = (struct getdents_callback64 *) __buf;
+       int reclen = ROUND_UP64(NAME_OFFSET(dirent) + namlen + 1);
+
+       buf->error = -EINVAL;   /* only used if we fail.. */
+       if (reclen > buf->count)
+               return -EINVAL;
+       dirent = buf->previous;
+       if (dirent) {
+               d.d_off = offset;
+               copy_to_user(&dirent->d_off, &d.d_off, sizeof(d.d_off));
+       }
+       dirent = buf->current_dir;
+       buf->previous = dirent;
+       memset(&d, 0, NAME_OFFSET(&d));
+       d.d_ino = ino;
+       d.d_reclen = reclen;
+       d.d_type = d_type;
+       copy_to_user(dirent, &d, NAME_OFFSET(&d));
+       copy_to_user(dirent->d_name, name, namlen);
+       put_user(0, dirent->d_name + namlen);
+       dirent = (void *)dirent + reclen;
+       buf->current_dir = dirent;
+       buf->count -= reclen;
+       return 0;
+}
+#define DIRENT_SIZE 3000
+
+void list_directory (tux_req_t *req, int cachemiss)
+{
+       struct getdents_callback64 buf;
+       struct linux_dirent64 *dirp0;
+       mm_segment_t oldmm;
+       int total;
+
+       Dprintk("list_directory(%p, %d), dentry: %p.\n", req, cachemiss, req->dentry);
+       if (!req->cwd_dentry)
+               TUX_BUG();
+
+       if (!cachemiss) {
+               add_tux_atom(req, list_directory);
+               queue_cachemiss(req);
+               return;
+       }
+
+       dirp0 = tux_kmalloc(DIRENT_SIZE);
+
+       buf.current_dir = dirp0;
+       buf.previous = NULL;
+       buf.count = DIRENT_SIZE;
+       buf.error = 0;
+
+       oldmm = get_fs(); set_fs(KERNEL_DS);
+       set_fs(KERNEL_DS);
+       total = vfs_readdir(&req->in_file, filldir64, &buf);
+       set_fs(oldmm);
+
+       if (buf.previous)
+               total = DIRENT_SIZE - buf.count;
+
+       Dprintk("total: %d (buf.error: %d, buf.previous %p)\n",
+               total, buf.error, buf.previous);
+
+       if (total < 0) {
+               kfree(dirp0);
+               req_err(req);
+               add_req_to_workqueue(req);
+               return;
+       }
+       if (!total) {
+               kfree(dirp0);
+               req->in_file.f_pos = 0;
+               add_req_to_workqueue(req);
+               return;
+       }
+
+       if (!req->cwd_dentry)
+               TUX_BUG();
+       add_tux_atom(req, list_directory);
+
+       req->dirp0 = dirp0;
+       req->curroff = 0;
+       req->total = total;
+       add_tux_atom(req, do_dir_line);
+
+       add_req_to_workqueue(req);
+}
+
diff --git a/net/tux/extcgi.c b/net/tux/extcgi.c
new file mode 100644 (file)
index 0000000..1d1d1d5
--- /dev/null
@@ -0,0 +1,329 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * extcgi.c: dynamic TUX module which forks and starts an external CGI
+ */
+
+#define __KERNEL_SYSCALLS__
+#define __KERNEL_SYSCALLS_NO_ERRNO__
+
+#include <net/tux.h>
+#include "parser.h"
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+#define MAX_ENVLEN 1000
+#define MAX_CGI_METAVARIABLES 32
+#define CGI_CHUNK_SIZE 1024 
+#define MAX_CGI_COMMAND_LEN 256
+
+#if CONFIG_TUX_DEBUG
+#define PRINT_MESSAGE_LEFT \
+       Dprintk("CGI message left at %s:%d:\n--->{%s}<---\n", \
+               __FILE__, __LINE__, curr)
+#else
+#define PRINT_MESSAGE_LEFT do {} while(0)
+#endif
+
+#define GOTO_INCOMPLETE do { Dprintk("invalid CGI reply at %s:%d.\n", __FILE__, __LINE__); goto invalid; } while (0)
+
+/*
+ * Please acknowledge our hard work by not changing this define, or
+ * at least please acknowledge us by leaving "TUX/2.0 (Linux)" in
+ * the ID string. Thanks! :-)
+ */
+#define CGI_SUCCESS2 "HTTP/1.1 200 OK\r\nConnection: close\r\nServer: TUX/2.0 (Linux)\r\n"
+
+static int handle_cgi_reply (tux_req_t *req)
+{
+       int first = 1;
+       int len, left, total;
+       char *buf, *tmp;
+       mm_segment_t oldmm;
+
+       buf = tux_kmalloc(CGI_CHUNK_SIZE+1);
+       tux_close(3);
+       tux_close(4);
+       tux_close(5);
+       oldmm = get_fs(); set_fs(KERNEL_DS);
+       send_sync_buf(NULL, req->sock, CGI_SUCCESS2, sizeof(CGI_SUCCESS2)-1, MSG_MORE);
+       set_fs(oldmm);
+
+       req->bytes_sent = 0;
+       /*
+        * The new process is the new owner of the socket, it will
+        * close it.
+        */
+repeat:
+       left = CGI_CHUNK_SIZE;
+       len = 0;
+       total = 0;
+       tmp = buf;
+       do {
+               mm_segment_t oldmm;
+
+               tmp += len;
+               total += len;
+               left -= len;
+               if (!left)
+                       break;
+repeat_read:
+               Dprintk("reading %d bytes via read().\n", left);
+               oldmm = get_fs(); set_fs(KERNEL_DS);
+               len = read(2, tmp, left);
+               set_fs(oldmm);
+               Dprintk("got %d bytes from read() (total: %d).\n", len, total);
+               if (len > 0)
+                       tmp[len] = 0;
+               Dprintk("CGI reply: (%d bytes, total %d).\n", len, total);
+               if (len == -ERESTARTSYS) {
+                       flush_all_signals();
+                       goto repeat_read;
+               }
+       } while (len > 0);
+       if (total > CGI_CHUNK_SIZE) {
+               printk(KERN_ERR "TUX: CGI weirdness. total: %d, len: %d, left: %d.\n", total, len, left);
+               TUX_BUG();
+       }
+       Dprintk("CGI done reply chunk: (%d bytes last, total %d).\n", len, total);
+       if (total) {
+               mm_segment_t oldmm;
+
+               oldmm = get_fs(); set_fs(KERNEL_DS);
+               if (!len)
+                       send_sync_buf(NULL, req->sock, buf, total, 0);
+               else
+                       send_sync_buf(NULL, req->sock, buf, total, MSG_MORE);
+               set_fs(oldmm);
+               req->bytes_sent += total;
+       }
+
+       Dprintk("bytes_sent: %d\n", req->bytes_sent);
+       if ((total > 0) && first) {
+               first = 0;
+
+               if (buf[total])
+                       TUX_BUG();
+               tmp = strstr(buf, "\n\n");
+               if (tmp) {
+                       req->bytes_sent -= (tmp-buf) + 2;
+                       Dprintk("new bytes_sent: %d\n", req->bytes_sent);
+               } else {
+                       req->bytes_sent = 0;
+                       req_err(req);
+               }
+       }
+       if (len < 0)
+               Dprintk("sys_read returned with %d.\n", len);
+       else {
+               if (total > 0)
+                       goto repeat;
+       }
+       tux_close(2);
+
+       req->status = 200;
+       add_req_to_workqueue(req);
+       kfree(buf);
+
+       return -1;
+}
+
+static int exec_external_cgi (void *data)
+{
+       exec_param_t param;
+       tux_req_t *req = data;
+       char *envp[MAX_CGI_METAVARIABLES+1], **envp_p;
+       char *argv[] = { "extcgi", NULL};
+       char *envstr, *tmp;
+       unsigned int host;
+       struct k_sigaction *ka;
+       int in_pipe_fds[2], out_pipe_fds[2], err_pipe_fds[2], len, err;
+       char *command;
+       pid_t pid;
+
+       len = strlen(tux_common_docroot);
+       if (req->objectname_len + len + 12 > MAX_CGI_COMMAND_LEN)
+               return -ENOMEM;
+       sprintf(current->comm,"cgimain - %d", current->pid);
+       host = inet_sk(req->sock->sk)->daddr;
+
+       envstr = tux_kmalloc(MAX_ENVLEN);
+       command = tux_kmalloc(MAX_CGI_COMMAND_LEN);
+
+       tmp = envstr;
+       envp_p = envp;
+
+#define WRITE_ENV(str...) \
+       if (envp_p >= envp + MAX_CGI_METAVARIABLES) \
+               TUX_BUG(); \
+       len = sprintf(tmp, str); \
+       *envp_p++ = tmp; \
+       tmp += len + 1; \
+       if (tmp >= envstr + MAX_ENVLEN) \
+               TUX_BUG();
+
+       #define WRITE_ENV_STR(str,field,len)                    \
+       do {                                                    \
+               int offset;                                     \
+                                                               \
+               offset = sizeof(str)-1;                         \
+               err = -EFAULT;                                  \
+               if (tmp - envstr + offset + len >= MAX_ENVLEN)  \
+                       goto out;                               \
+               if (envp_p >= envp + MAX_CGI_METAVARIABLES)     \
+                       TUX_BUG();                              \
+               memcpy(tmp, str, offset);                       \
+               memcpy(tmp + offset, field, len);               \
+               offset += len;                                  \
+               tmp[offset] = 0;                                \
+               *envp_p++ = tmp;                                \
+               tmp += offset + 1;                              \
+       } while (0)
+
+       WRITE_ENV("GATEWAY_INTERFACE=CGI/1.1");
+       WRITE_ENV("CONTENT_LENGTH=%d", req->post_data_len);
+       WRITE_ENV("REMOTE_ADDR=%d.%d.%d.%d", NIPQUAD(host));
+       WRITE_ENV("SERVER_PORT=%d", 80);
+       WRITE_ENV("SERVER_SOFTWARE=TUX/2.0 (Linux)");
+
+#if 1
+       WRITE_ENV("DOCUMENT_ROOT=/");
+       WRITE_ENV("PATH_INFO=/");
+#else
+       WRITE_ENV_STR("DOCUMENT_ROOT=", tux_common_docroot, len);
+       WRITE_ENV_STR("PATH_INFO=", tux_common_docroot, len);
+#endif
+       WRITE_ENV_STR("QUERY_STRING=", req->query_str, req->query_len);
+       WRITE_ENV_STR("REQUEST_METHOD=", req->method_str, req->method_len);
+       WRITE_ENV_STR("SCRIPT_NAME=", req->objectname, req->objectname_len);
+       WRITE_ENV_STR("SERVER_PROTOCOL=", req->version_str, req->version_len);
+
+       if (req->content_type_len)
+               WRITE_ENV_STR("CONTENT_TYPE=",
+                       req->content_type_str, req->content_type_len);
+       if (req->cookies_len)
+               WRITE_ENV_STR("HTTP_COOKIE=",
+                       req->cookies_str, req->cookies_len);
+
+       if (req->host_len)
+               WRITE_ENV_STR("SERVER_NAME=", req->host, req->host_len);
+       else {
+               const char *host = "localhost";
+               WRITE_ENV_STR("SERVER_NAME=", host, strlen(host));
+       }
+
+       *envp_p = NULL;
+
+       spin_lock_irq(&current->sighand->siglock);
+       ka = current->sighand->action + SIGPIPE-1;
+       ka->sa.sa_handler = SIG_IGN;
+       siginitsetinv(&current->blocked, sigmask(SIGCHLD));
+       recalc_sigpending();
+       spin_unlock_irq(&current->sighand->siglock);
+
+       tux_close(0); tux_close(1);
+       tux_close(2); tux_close(3);
+       tux_close(4); tux_close(5);
+
+       in_pipe_fds[0] = in_pipe_fds[1] = -1;
+       out_pipe_fds[0] = out_pipe_fds[1] = -1;
+       err_pipe_fds[0] = err_pipe_fds[1] = -1;
+
+       err = -ENFILE;
+       if (do_pipe(in_pipe_fds))
+               goto out;
+       if (do_pipe(out_pipe_fds))
+               goto out;
+       if (do_pipe(err_pipe_fds))
+               goto out;
+
+       if (in_pipe_fds[0] != 0) TUX_BUG();
+       if (in_pipe_fds[1] != 1) TUX_BUG();
+       if (out_pipe_fds[0] != 2) TUX_BUG();
+       if (out_pipe_fds[1] != 3) TUX_BUG();
+       if (err_pipe_fds[0] != 4) TUX_BUG();
+       if (err_pipe_fds[1] != 5) TUX_BUG();
+
+       if (req->virtual && req->host_len)
+               sprintf(command, "/%s/cgi-bin/%s", req->host, req->objectname);
+       else
+               sprintf(command, "/cgi-bin/%s", req->objectname);
+       Dprintk("before CGI exec.\n");
+       pid = tux_exec_process(command, argv, envp, 1, &param, 0);
+       Dprintk("after CGI exec.\n");
+
+       if (req->post_data_len) {
+               mm_segment_t oldmm;
+               int ret;
+
+               Dprintk("POST data to CGI:\n");
+               oldmm = get_fs(); set_fs(KERNEL_DS);
+               ret = write(1, req->post_data_str, req->post_data_len);
+               set_fs(oldmm);
+               Dprintk("write() returned: %d.\n", ret);
+               if (ret != req->post_data_len)
+                       Dprintk("write() returned: %d.\n", ret);
+       }
+
+       tux_close(0);
+       tux_close(1);
+
+       handle_cgi_reply(req);
+       err = 0;
+
+out:
+       kfree(envstr);
+       kfree(command);
+
+       return err;
+}
+
+void start_external_cgi (tux_req_t *req)
+{
+       int pid;
+
+repeat:
+       pid = kernel_thread(exec_external_cgi, (void*) req, SIGCHLD);
+       if (pid == -1)
+               return;
+       if (pid < 0) {
+               printk(KERN_INFO "TUX: Could not fork external CGI process due to %d, retrying!\n", pid);
+               current->state = TASK_UNINTERRUPTIBLE;
+               schedule_timeout(HZ);
+               goto repeat;
+       }
+}
+
+int query_extcgi (tux_req_t *req)
+{
+       clear_keepalive(req);
+       start_external_cgi(req);
+       return -1;
+}
+
+#define EXTCGI_INVALID_HEADER \
+       "HTTP/1.1 503 Service Unavailable\r\n" \
+       "Content-Length: 23\r\n\r\n"
+
+#define EXTCGI_INVALID_BODY \
+       "TUX: invalid CGI reply."
+
+#define EXTCGI_INVALID EXTCGI_INVALID_HEADER EXTCGI_INVALID_BODY
+
diff --git a/net/tux/gzip.c b/net/tux/gzip.c
new file mode 100644 (file)
index 0000000..5476dff
--- /dev/null
@@ -0,0 +1,40 @@
+/*     $Id: zlib.h,v 1.2 1997/12/23 10:47:44 paulus Exp $      */
+
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/zlib.h>
+#include <net/tux.h>
+
+#define STREAM_END_SPACE 12
+
+int tux_gzip_compress (tux_req_t *req, unsigned char *data_in, unsigned char *data_out, __u32 *in_len, __u32 *out_len)
+{
+       z_stream *s = &req->ti->gzip_state;
+       int ret, left;
+
+       down(&req->ti->gzip_sem);
+       if (zlib_deflateReset(s) != Z_OK)
+               BUG();
+
+       s->next_in = data_in;
+       s->next_out = data_out;
+       s->avail_in = *in_len;
+       s->avail_out = *out_len;
+
+       Dprintk("calling zlib_deflate with avail_in %d, avail_out %d\n", s->avail_in, s->avail_out);
+       ret = zlib_deflate(s, Z_FINISH);
+       Dprintk("deflate returned with avail_in %d, avail_out %d, total_in %ld, total_out %ld\n", s->avail_in, s->avail_out, s->total_in, s->total_out);
+
+       if (ret != Z_STREAM_END) {
+               printk("bad: deflate returned with %d! avail_in %d, avail_out %d, total_in %ld, total_out %ld\n", ret, s->avail_in, s->avail_out, s->total_in, s->total_out);
+               BUG();
+       }
+       *in_len = s->avail_in;
+       *out_len = s->avail_out;
+       left = s->avail_in;
+
+       up(&req->ti->gzip_sem);
+
+       return left;
+}
+
diff --git a/net/tux/input.c b/net/tux/input.c
new file mode 100644 (file)
index 0000000..054c3ed
--- /dev/null
@@ -0,0 +1,641 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * input.c: handle requests arriving on accepted connections
+ */
+
+#include <net/tux.h>
+#include <linux/kmod.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+void zap_request (tux_req_t *req, int cachemiss)
+{
+       if (!req->error)
+               TUX_BUG();
+       if (req->error == TUX_ERROR_CONN_TIMEOUT) {
+               if (req->proto->request_timeout) {
+                       clear_keepalive(req);
+                       req->proto->request_timeout(req, cachemiss);
+               } else {
+                       clear_keepalive(req);
+                       if (!cachemiss)
+                               flush_request(req, 0);
+                       else {
+                               add_tux_atom(req, flush_request);
+                               add_req_to_workqueue(req);
+                       }
+               }
+               return;
+       }
+
+       if (!cachemiss && (req->error == TUX_ERROR_CONN_CLOSE)) {
+               /*
+                * Zap connection as fast as possible, there is
+                * no valid client connection anymore:
+                */
+               clear_keepalive(req);
+               flush_request(req, 0);
+       } else {
+               if (req->error == TUX_ERROR_CONN_CLOSE) {
+                       clear_keepalive(req);
+                       add_tux_atom(req, flush_request);
+               } else
+                       /*
+                        * Potentially redirect to the secondary server:
+                        */
+                       add_tux_atom(req, redirect_request);
+               add_req_to_workqueue(req);
+       }
+}
+
+void __switch_docroot(tux_req_t *req)
+{
+       if (!req->docroot_dentry || !req->docroot_mnt)
+               TUX_BUG();
+       set_fs_root(current->fs, req->docroot_mnt, req->docroot_dentry);
+}
+
+struct dentry * __tux_lookup (tux_req_t *req, const char *filename,
+                        struct nameidata *base, struct vfsmount **mnt)
+{
+       int err;
+
+       err = path_walk(filename, base);
+       if (err) {
+               Dprintk("path_walk() returned with %d!\n", err);
+               return ERR_PTR(err);
+       }
+       if (*mnt)
+               TUX_BUG();
+       *mnt = base->mnt;
+
+       return base->dentry;
+}
+
+int tux_permission (struct inode *inode)
+{
+       umode_t mode;
+       int err;
+
+       mode = inode->i_mode;
+       Dprintk("URL inode mode: %08x.\n", mode);
+
+       if (mode & tux_mode_forbidden)
+               return -2;
+       /*
+        * at least one bit in the 'allowed' set has to
+        * be present to allow access.
+        */
+       if (!(mode & tux_mode_allowed))
+               return -3;
+       err = permission(inode,MAY_READ,NULL);
+       return err;
+}
+
+struct dentry * tux_lookup (tux_req_t *req, const char *filename,
+                       const unsigned int flag, struct vfsmount **mnt)
+{
+       struct dentry *dentry;
+       struct nameidata base;
+
+       Dprintk("tux_lookup(%p, %s, %d, virtual: %d, host: %s (%d).)\n", req, filename, flag, req->virtual, req->host, req->host_len);
+
+       base.flags = LOOKUP_FOLLOW|flag;
+       base.last_type = LAST_ROOT;
+       if (req->objectname[0] == '/') {
+               base.dentry = dget(req->docroot_dentry);
+               base.mnt = mntget(req->docroot_mnt);
+       } else {
+               if (!req->cwd_dentry) {
+                       req->cwd_dentry = dget(req->docroot_dentry);
+                       req->cwd_mnt = mntget(req->docroot_mnt);
+               }
+               base.dentry = req->cwd_dentry;
+               dget(base.dentry);
+               base.mnt = mntget(req->cwd_mnt);
+       }
+
+       switch_docroot(req);
+       dentry = __tux_lookup (req, filename, &base, mnt);
+
+       Dprintk("looked up {%s} == dentry %p.\n", filename, dentry);
+
+       if (dentry && !IS_ERR(dentry) && !dentry->d_inode)
+               TUX_BUG();
+       return dentry;
+}
+
+int lookup_object (tux_req_t *req, const unsigned int flag)
+{
+       struct vfsmount *mnt = NULL;
+       struct dentry *dentry = NULL;
+       int perm;
+
+       dentry = tux_lookup(req, req->objectname, flag, &mnt);
+       if (!dentry || IS_ERR(dentry)) {
+               if (PTR_ERR(dentry) == -EWOULDBLOCKIO)
+                       goto cachemiss;
+               goto abort;
+       }
+       perm = tux_permission(dentry->d_inode);
+       /*
+        * Only regular files allowed.
+        */
+       if ((perm < 0) || !S_ISREG(dentry->d_inode->i_mode)) {
+               req->status = 403;
+               goto abort;
+       }
+       req->total_file_len = dentry->d_inode->i_size;
+out:
+       install_req_dentry(req, dentry, mnt);
+       return 0;
+cachemiss:
+       return 1;
+abort:
+       if (dentry) {
+               if (!IS_ERR(dentry))
+                       dput(dentry);
+               dentry = NULL;
+       }
+       if (mnt) {
+               if (!IS_ERR(mnt))
+                       mntput(mnt);
+               mnt = NULL;
+       }
+       req_err(req);
+       goto out;
+}
+
+void install_req_dentry (tux_req_t *req, struct dentry *dentry, struct vfsmount *mnt)
+{
+       if (req->dentry)
+               TUX_BUG();
+       req->dentry = dentry;
+       if (req->mnt)
+               TUX_BUG();
+       req->mnt = mnt;
+       if (req->in_file.f_dentry)
+               TUX_BUG();
+       if (dentry)
+               open_private_file(&req->in_file, dentry, FMODE_READ);
+}
+
+void release_req_dentry (tux_req_t *req)
+{
+       if (!req->dentry) {
+               if (req->in_file.f_dentry)
+                       TUX_BUG();
+               return;
+       }
+       if (req->in_file.f_op && req->in_file.f_op->release)
+               req->in_file.f_op->release(req->dentry->d_inode, &req->in_file);
+       memset(&req->in_file, 0, sizeof(req->in_file));
+
+       dput(req->dentry);
+       req->dentry = NULL;
+       mntput(req->mnt);
+       req->mnt = NULL;
+}
+
+int __connection_too_fast (tux_req_t *req)
+{
+       unsigned long curr_bw, delta, bytes;
+
+       bytes = req->total_bytes + req->bytes_sent;
+       if (!bytes)
+               return 1;
+
+       delta = jiffies - req->first_timestamp;
+       if (!delta)
+               delta++;
+       curr_bw = bytes * HZ / delta;
+
+       if (curr_bw > tux_max_output_bandwidth)
+               return 2;
+       return 0;
+}
+
+void unidle_req (tux_req_t *req)
+{
+       threadinfo_t *ti = req->ti;
+
+       Dprintk("UNIDLE req %p <%p> (sock %p, sk %p) (keepalive: %d, status: %d)\n", req, __builtin_return_address(0), req->sock, req->sock->sk, req->keep_alive, req->status);
+       spin_lock_irq(&ti->work_lock);
+       if (req->magic != TUX_MAGIC)
+               TUX_BUG();
+       if (!test_and_clear_bit(0, &req->idle_input)) {
+               Dprintk("unidling %p, wasnt idle!\n", req);
+               if (list_empty(&req->work))
+                       TUX_BUG();
+               list_del(&req->work);
+               DEBUG_DEL_LIST(&req->work);
+               DEC_STAT(nr_work_pending);
+       } else {
+               del_keepalive_timer(req);
+               DEC_STAT(nr_idle_input_pending);
+               Dprintk("unidled %p.\n", req);
+       }
+       if (req->idle_input)
+               TUX_BUG();
+       spin_unlock_irq(&ti->work_lock);
+}
+
+#define GOTO_INCOMPLETE do { Dprintk("incomplete at %s:%d.\n", __FILE__, __LINE__); goto incomplete; } while (0)
+#define GOTO_REDIRECT do { TDprintk("redirect at %s:%d.\n", __FILE__, __LINE__); goto redirect; } while (0)
+#define GOTO_REDIRECT_NONIDLE do { TDprintk("redirect at %s:%d.\n", __FILE__, __LINE__); goto redirect_nonidle; } while (0)
+
+static int read_request (struct socket *sock, char *buf, int max_size)
+{
+       mm_segment_t oldmm;
+       struct kiocb iocb;
+       struct msghdr msg;
+       struct iovec iov;
+
+       int len;
+
+       msg.msg_name     = 0;
+       msg.msg_namelen  = 0;
+       msg.msg_iov      = &iov;
+       msg.msg_iovlen   = 1;
+       msg.msg_control  = NULL;
+       msg.msg_controllen = 0;
+       msg.msg_flags    = 0;
+       
+       msg.msg_iov->iov_base = buf;
+       msg.msg_iov->iov_len  = max_size;
+       
+       oldmm = get_fs(); set_fs(KERNEL_DS);
+
+read_again:
+       init_sync_kiocb(&iocb, NULL);
+       len = sock->sk->sk_prot->recvmsg(&iocb, sock->sk, &msg, max_size,
+                                               MSG_DONTWAIT, MSG_PEEK, NULL);
+       if (-EIOCBQUEUED == len)
+               len = wait_on_sync_kiocb(&iocb);
+
+       /*
+        * We must not get a signal inbetween
+        */
+       if ((len == -EAGAIN) || (len == -ERESTARTSYS)) {
+               if (!signal_pending(current)) {
+                       len = 0;
+                       goto out;
+               }
+               flush_all_signals();
+               goto read_again;
+       }
+out:
+       set_fs(oldmm);
+       return len;
+}
+
+/*
+ * We inline URG data so it's at the head of the normal receive queue.
+ */
+static int zap_urg_data (struct socket *sock)
+{
+       mm_segment_t oldmm;
+       struct msghdr msg;
+       struct iovec iov;
+       struct kiocb iocb;
+       int len;
+       char buf[10];
+
+       oldmm = get_fs(); set_fs(KERNEL_DS);
+
+       msg.msg_name            = 0;
+       msg.msg_namelen         = 0;
+       msg.msg_iov             = &iov;
+       msg.msg_iovlen          = 1;
+       msg.msg_control         = NULL;
+       msg.msg_controllen      = 0;
+       msg.msg_flags           = 0;
+       
+       msg.msg_iov->iov_base = buf;
+       msg.msg_iov->iov_len  = 2;
+
+read_again:
+       init_sync_kiocb(&iocb, NULL);
+       len = sock->sk->sk_prot->recvmsg(&iocb, sock->sk, &msg, 2,
+                                               MSG_DONTWAIT, 0, NULL);
+       if (-EIOCBQUEUED == len)
+               len = wait_on_sync_kiocb(&iocb);
+       Dprintk("recvmsg(MSG_OOB) returned %d.\n", len);
+
+       /*
+        * We must not get a signal inbetween
+        */
+       if ((len == -EAGAIN) || (len == -ERESTARTSYS)) {
+               if (!signal_pending(current)) {
+                       len = 0;
+                       goto out;
+               }
+               flush_all_signals();
+               goto read_again;
+       }
+out:
+       set_fs(oldmm);
+
+       Dprintk("in out:.. and will return %d.!\n", len);
+
+       return len;
+}
+
+void trunc_headers (tux_req_t *req)
+{
+       struct sock *sk = req->sock->sk;
+       int len, addr_len = 0;
+       struct kiocb iocb;
+
+       if (!req->parsed_len)
+               TUX_BUG();
+repeat_trunc:
+       init_sync_kiocb(&iocb, NULL);
+       len = sk->sk_prot->recvmsg(&iocb, sk, NULL, req->parsed_len, 1, MSG_TRUNC, &addr_len);
+       if (-EIOCBQUEUED == len)
+               len = wait_on_sync_kiocb(&iocb);
+       if ((len == -ERESTARTSYS) || (len == -EAGAIN)) {
+               flush_all_signals();
+               goto repeat_trunc;
+       }
+       Dprintk("truncated (TRUNC) %d bytes at %p. (wanted: %d.)\n", len, __builtin_return_address(0), req->parsed_len);
+
+
+
+       req->parsed_len = 0;
+}
+
+void print_req (tux_req_t *req)
+{
+       struct sock *sk;
+
+       printk("PRINT req %p <%p>, sock %p\n",
+                       req, __builtin_return_address(0), req->sock);
+       printk("... idx: %d\n", req->atom_idx);
+       if (req->sock) {
+               sk = req->sock->sk;
+               printk("... sock %p, sk %p, sk->state: %d, sk->err: %d\n", req->sock, sk, sk->sk_state, sk->sk_err);
+               printk("... write_queue: %d, receive_queue: %d, error_queue: %d, keepalive: %d, status: %d\n", !skb_queue_empty(&sk->sk_write_queue), !skb_queue_empty(&sk->sk_receive_queue), !skb_queue_empty(&sk->sk_error_queue), req->keep_alive, req->status);
+               printk("...tp->send_head: %p\n", tcp_sk(sk)->send_head);
+               printk("...tp->snd_una: %08x\n", tcp_sk(sk)->snd_una);
+               printk("...tp->snd_nxt: %08x\n", tcp_sk(sk)->snd_nxt);
+               printk("...tp->packets_out: %08x\n", tcp_sk(sk)->packets_out);
+       }
+       printk("... meth:{%s}, uri:{%s}, query:{%s}, ver:{%s}\n", req->method_str ? req->method_str : "<null>", req->uri_str ? req->uri_str : "<null>", req->query_str ? req->query_str : "<null>", req->version_str ? req->version_str : "<null>");
+       printk("... post_data:{%s}(%d).\n", req->post_data_str, req->post_data_len);
+       printk("... headers: {%s}\n", req->headers);
+}
+/* 
+ * parse_request() reads all available TCP/IP data and prepares
+ * the request if the TUX request is complete. (we can get TUX
+ * requests in several packets.) Invalid requests are redirected
+ * to the secondary server.
+ */
+
+void parse_request (tux_req_t *req, int cachemiss)
+{
+       int len, parsed_len;
+       struct sock *sk = req->sock->sk;
+       struct tcp_opt *tp = tcp_sk(sk);
+       int was_keepalive = req->keep_alive;
+
+       if (req->magic != TUX_MAGIC)
+               TUX_BUG();
+
+       SET_TIMESTAMP(req->parse_timestamp);
+
+       spin_lock_irq(&req->ti->work_lock);
+       add_keepalive_timer(req);
+       if (test_and_set_bit(0, &req->idle_input))
+               TUX_BUG();
+       INC_STAT(nr_idle_input_pending);
+       spin_unlock_irq(&req->ti->work_lock);
+
+       Dprintk("idled request %p.\n", req);
+
+restart:
+
+       if (tp->urg_data && !(tp->urg_data & TCP_URG_READ)) {
+               len = zap_urg_data(req->sock);
+               if (tp->urg_data && !(tp->urg_data & TCP_URG_READ)) {
+                       req->error = TUX_ERROR_CONN_CLOSE;
+                       goto redirect_error;
+               }
+       }
+
+       INC_STAT(input_slowpath);
+
+       if (!req->headers)
+               req->headers = tux_kmalloc(tux_max_header_len);
+
+       /* First, read the data */
+       len = read_request(req->sock, (char *)req->headers, tux_max_header_len-1);
+       if (len < 0) {
+               req->error = TUX_ERROR_CONN_CLOSE;
+               goto redirect_error;
+       }
+       if (!len)
+               GOTO_INCOMPLETE;
+
+       /*
+        * Make it a zero-delimited string to automatically get
+        * protection against various buffer overflow situations.
+        * Then pass it to the TUX application protocol stack.
+        */
+       ((char *)req->headers)[len] = 0;
+       req->headers_len = len;
+
+       parsed_len = req->proto->parse_message(req, len);
+
+       /*
+        * Is the request fully read? (or is there any error)
+        */
+       if (parsed_len < 0)
+               GOTO_REDIRECT;
+       if (!parsed_len) {
+               /*
+                * Push pending ACK which was delayed due to the
+                * pingpong optimization:
+                */
+               if (was_keepalive) {
+                       lock_sock(sk);
+                       tp->ack.pingpong = 0;
+                       tp->ack.pending |= TCP_ACK_PUSHED;
+                       cleanup_rbuf(sk, 1);
+                       release_sock(sk);
+               }
+               if (len >= tux_max_header_len-1)
+                       GOTO_REDIRECT;
+               GOTO_INCOMPLETE;
+       }
+       unidle_req(req);
+
+       tp->nonagle = 2;
+
+       add_req_to_workqueue(req);
+       return;
+
+redirect:
+       TDprintk("req %p will be redirected!\n", req);
+       req_err(req);
+
+redirect_error:
+       unidle_req(req);
+
+       if (len < 0)
+               req->parsed_len = 0;
+       else
+               req->parsed_len = len;
+
+       INC_STAT(parse_static_redirect);
+       if (req->headers)
+               kfree(req->headers);
+       req->headers = NULL;
+       if (req->error)
+               zap_request(req, cachemiss);
+       return;
+
+incomplete:
+       if (req->error)
+               goto redirect_error;
+       if (tp->urg_data && !(tp->urg_data & TCP_URG_READ))
+               goto restart;
+
+       add_tux_atom(req, parse_request);
+       INC_STAT(parse_static_incomplete);
+       tux_push_req(req);
+}
+
+int process_requests (threadinfo_t *ti, tux_req_t **user_req)
+{
+       struct list_head *head, *curr;
+       int count = 0;
+       tux_req_t *req;
+
+       *user_req = NULL;
+
+restart_loop:
+       spin_lock_irq(&ti->work_lock);
+       head = &ti->work_pending;
+       curr = head->next;
+       
+       if (curr != head) {
+               int i;
+
+               req = list_entry(curr, tux_req_t, work);
+               Dprintk("PROCESS req %p <%p>.\n",
+                       req, __builtin_return_address(0));
+               for (i = 0; i < req->atom_idx; i++)
+                       Dprintk("... atom %d: %p\n", i, req->atoms[i]);
+
+               if (req->ti != ti)
+                       TUX_BUG();
+               if (req->magic != TUX_MAGIC)
+                       TUX_BUG();
+
+               if (list_empty(&req->work))
+                       TUX_BUG();
+               list_del(curr);
+               DEBUG_DEL_LIST(&req->work);
+               spin_unlock_irq(&ti->work_lock);
+
+               if (!req->atom_idx) {
+                       if (req->usermode) {
+                               *user_req = req;
+                               return count;
+                       }
+                       /*
+                        * idx == 0 requests are flushed automatically.
+                        */
+                       flush_request(req, 0);
+               } else
+                       tux_schedule_atom(req, 0);
+               count++;
+               goto restart_loop;
+       }
+       spin_unlock_irq(&ti->work_lock);
+
+       return count;
+}
+
+int tux_flush_workqueue (threadinfo_t *ti)
+{
+       struct list_head *head, *curr, *next;
+       tux_req_t *req;
+       int count = 0;
+
+restart:
+       spin_lock_irq(&ti->work_lock);
+       head = &ti->work_pending;
+       curr = head->next;
+
+       if (curr != head) {
+               req = list_entry(curr, tux_req_t, work);
+               next = curr->next;
+               clear_bit(0, &req->idle_input);
+               clear_bit(0, &req->wait_output_space);
+               if (list_empty(&req->work))
+                       TUX_BUG();
+               list_del(curr);
+               DEBUG_DEL_LIST(curr);
+               DEC_STAT(nr_input_pending);
+               spin_unlock_irq(&ti->work_lock);
+#if CONFIG_TUX_DEBUG
+               req->bytes_expected = 0;
+#endif
+               req->in_file.f_pos = 0;
+               req->atom_idx = 0;
+               clear_keepalive(req);
+               req->status = -1;
+               if (req->usermode) {
+                       req->usermode = 0;
+                       req->private = 0;
+               }
+               flush_request(req, 0);
+               count++;
+               goto restart;
+       }
+       spin_unlock_irq(&ti->work_lock);
+
+       return count;
+}
+
+int print_all_requests (threadinfo_t *ti)
+{
+       struct list_head *head, *curr;
+       tux_req_t *req;
+       int count = 0;
+
+       spin_lock_irq(&ti->work_lock);
+       head = &ti->all_requests;
+       curr = head->next;
+
+       while (curr != head) {
+               req = list_entry(curr, tux_req_t, all);
+               curr = curr->next;
+               print_req(req);
+               count++;
+       }
+       spin_unlock_irq(&ti->work_lock);
+
+       return count;
+}
+
diff --git a/net/tux/logger.c b/net/tux/logger.c
new file mode 100644 (file)
index 0000000..5ce80c1
--- /dev/null
@@ -0,0 +1,855 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * Cleaned up logger output for Alpha.
+ * -- Phil Ezolt (Phillip.Ezolt@compaq.com) & Bill Carr (wcarr92@yahoo.com)
+ *
+ * logger.c: log requests finished by TUX.
+ */
+
+#define __KERNEL_SYSCALLS__
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+static spinlock_t log_lock = SPIN_LOCK_UNLOCKED;
+static unsigned int log_head, log_tail;
+static char * log_buffer = NULL;
+static DECLARE_WAIT_QUEUE_HEAD(log_wait);
+static DECLARE_WAIT_QUEUE_HEAD(log_full);
+static int logger_pid = 0;
+
+/*
+ * High-speed TUX logging architecture:
+ *
+ * All fast threads share a common log-ringbuffer. (default size 1MB)
+ * Log entries are binary and are padded to be cacheline aligned, this
+ * ensures that there is no cache-pingpong between fast threads.
+ *
+ * The logger thread writes out pending log entries within 1 second
+ * (buffer-cache writes data out within 5 seconds). The logger thread
+ * gets activated once we have more than 25% of the log ringbuffer
+ * filled - or the 1 second log timeout expires. Fast threads block
+ * if if more than 95% of the ringbuffer is filled and unblock only
+ * if used logbuffer space drops below 90%.
+ *
+ * This architecture guarantees that 1) logging is reliable (no
+ * log entry is ever lost), 2) timely (touches disk within 6 seconds),
+ * 3) in the log-contention case the saturation behavior is still
+ * write-clustered, but 4) if the logger thread can keep up then
+ * the coupling is completely asynchron and parallel.
+ *
+ * The binary log format gives us about 50% saved IO/memory bandwith
+ * and 50% less on-disk used log space than the traditional W3C ASCII
+ * format.
+ *
+ * (We might switch to raw IO though to write the logfile.)
+ */
+
+#define SOFT_LIMIT             (LOG_LEN*25/100)
+#define HARD_LIMIT             (LOG_LEN*95/100)
+#define HARD_RELAX_LIMIT       (LOG_LEN*90/100)
+
+unsigned int tux_logentry_align_order = 5;
+
+#if SMP_CACHE_BYTES == 8
+# define TUX_LOGENTRY_ALIGN 3
+#else
+#if SMP_CACHE_BYTES == 16
+# define TUX_LOGENTRY_ALIGN 4
+#else
+#if SMP_CACHE_BYTES == 32
+# define TUX_LOGENTRY_ALIGN 5
+#else
+#if SMP_CACHE_BYTES == 64
+# define TUX_LOGENTRY_ALIGN 6
+#else
+#if SMP_CACHE_BYTES == 128
+# define TUX_LOGENTRY_ALIGN 7
+#else
+#if SMP_CACHE_BYTES == 256
+# define TUX_LOGENTRY_ALIGN 8
+#else
+#error Add entry!
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+
+#define ROUND_UP(x) (((((x)-1) >> TUX_LOGENTRY_ALIGN) + 1) \
+                                       << TUX_LOGENTRY_ALIGN)
+
+static void __throttle_logging (void)
+{
+       DECLARE_WAITQUEUE(wait, current);
+       int pending;
+
+       add_wait_queue(&log_full, &wait);
+       for (;;) {
+               static unsigned long last_warning = 0;
+
+               if (jiffies - last_warning > 10*HZ) {
+                       last_warning = jiffies;
+                       printk(KERN_NOTICE "TUX: log buffer overflow, have to throttle TUX thread!\n");
+               }
+
+               current->state = TASK_INTERRUPTIBLE;
+
+               spin_lock(&log_lock);
+               pending = log_head-log_tail;
+               spin_unlock(&log_lock);
+
+               if ((pending % LOG_LEN) < HARD_LIMIT)
+                       break;
+
+               schedule();
+       }
+       current->state = TASK_RUNNING;
+       remove_wait_queue(&log_full, &wait);
+}
+
+#if CONFIG_TUX_DEBUG
+#define CHECK_LOGPTR(ptr) \
+do { \
+       if ((ptr < log_buffer) || (ptr > log_buffer + LOG_LEN)) { \
+               printk(KERN_ERR "TUX: ouch: log ptr %p > %p + %ld!\n", \
+                       ptr, log_buffer, LOG_LEN); \
+               TUX_BUG(); \
+       } \
+} while (0)
+#else
+#define CHECK_LOGPTR(ptr) do { } while (0)
+#endif
+
+void __log_request (tux_req_t *req)
+{
+       char *str, *next;
+       const char *uri_str;
+       unsigned int inc, len, uri_len, pending, next_head, def_vhost_len = 0;
+       unsigned long flags;
+
+       if (req->proto->pre_log)
+               req->proto->pre_log(req);
+       /*
+        * Log the reply status (success, or type of failure)
+        */
+       if (!tux_log_incomplete && (!req->status || (req->bytes_sent == -1))) {
+               
+               Dprintk("not logging req %p: {%s} [%d/%d]\n", req, req->uri_str, req->status, req->bytes_sent);
+               return;
+       }
+       Dprintk("uri: {%s} [%d]\n", req->uri_str, req->uri_len);
+
+#define NO_URI "<none>"
+       if (req->uri_len) {
+               uri_len = req->uri_len;
+               uri_str = req->uri_str;
+       } else {
+               uri_str = NO_URI;
+               uri_len = sizeof(NO_URI)-1;
+       }
+       len = uri_len + 1;
+
+       if (req->virtual) {
+               if (req->host_len)
+                       len += req->host_len;
+               else {
+                       def_vhost_len = strlen(tux_default_vhost);
+                       len += def_vhost_len;
+               }
+       }
+
+       Dprintk("method_str: {%s} [%d]\n", req->method_str, req->method_len);
+       len += req->method_len + 1;
+
+       Dprintk("version_str: {%s} [%d]\n", req->version_str, req->version_len);
+       len += req->version_len + 1;
+
+#if CONFIG_TUX_EXTENDED_LOG
+       Dprintk("user_agent_str: {%s} [%d]\n", req->user_agent_str, req->user_agent_len);
+       len += req->user_agent_len + 1;
+#endif
+       if (tux_referer_logging) {
+               Dprintk("referer_str: {%s} [%d]\n", req->referer_str, req->referer_len);
+               len += req->referer_len;
+       }
+       len++;
+
+       inc = 5*sizeof(u32) + len;
+#if CONFIG_TUX_EXTENDED_LOG
+       inc += 7*sizeof(u32);
+#endif
+
+       spin_lock_irqsave(&log_lock, flags);
+
+       next_head = ROUND_UP(log_head + inc);
+
+       if (next_head < LOG_LEN) {
+               str = log_buffer + log_head;
+               if (str > log_buffer + LOG_LEN)
+                       TUX_BUG();
+               log_head = next_head;
+       } else {
+               if (log_head < LOG_LEN)
+                       memset(log_buffer+log_head, 0, LOG_LEN-log_head);
+               str = log_buffer;
+               log_head = ROUND_UP(inc);
+       }
+
+       if (str < log_buffer || str+inc >= log_buffer+LOG_LEN)
+               TUX_BUG();
+
+       /*
+        * Log record signature - this makes finding the next entry
+        * easier (since record length is variable), and makes the
+        * binary logfile more robust against potential data corruption
+        * and other damage. The signature also servers as a log format
+        * version identifier.
+        */
+#if CONFIG_TUX_EXTENDED_LOG
+       *(u32 *)str = 0x2223beef;
+#else
+       *(u32 *)str = 0x1112beef;
+#endif
+       str += sizeof(u32);
+       CHECK_LOGPTR(str);
+
+       *(u32 *)str = 0;
+       /*
+        * Log the client IP address:
+        */
+       if (tux_ip_logging)
+               *(u32 *)str = req->client_addr;
+       str += sizeof(u32);
+       CHECK_LOGPTR(str);
+
+#if CONFIG_TUX_EXTENDED_LOG
+       /*
+        * Log the client port number:
+        */
+       *(u32 *)str = 0;
+       if (tux_ip_logging)
+               *(u32 *)str = req->client_port;
+       str += sizeof(u32);
+       CHECK_LOGPTR(str);
+#endif
+
+       /*
+        * Log the request timestamp, in units of 'seconds since 1970'.
+        */
+       *(u32 *)str = CURRENT_TIME.tv_sec;
+       str += sizeof(u32);
+       CHECK_LOGPTR(str);
+
+#if CONFIG_TUX_EXTENDED_LOG
+       *(u32 *)str = req->accept_timestamp; str += sizeof(u32);
+       *(u32 *)str = req->parse_timestamp; str += sizeof(u32);
+       *(u32 *)str = req->output_timestamp; str += sizeof(u32);
+       *(u32 *)str = req->flush_timestamp; str += sizeof(u32);
+       *(u32 *)str = req->had_cachemiss; str += sizeof(u32);
+       *(u32 *)str = req->keep_alive; str += sizeof(u32);
+#endif
+       /*
+        * Log the requested file size (in fact, log actual bytes sent.)
+        */
+       *(u32 *)str = req->bytes_sent;
+       str += sizeof(u32);
+       CHECK_LOGPTR(str);
+
+       *(u32 *)str = req->status;
+       str += sizeof(u32);
+       CHECK_LOGPTR(str);
+
+       /*
+        * Zero-terminated method, (base) URI, query and version string.
+        */
+       if (req->method_len) {
+               memcpy(str, req->method_str, req->method_len);
+               str += req->method_len;
+               CHECK_LOGPTR(str);
+       }
+       *str++ = 0;
+
+       if (req->virtual) {
+               if (req->host_len) {
+                       memcpy(str, req->host, req->host_len);
+                       str += req->host_len;
+               } else {
+                       memcpy(str, tux_default_vhost, def_vhost_len);
+                       str += def_vhost_len;
+               }
+               CHECK_LOGPTR(str);
+       }
+
+       memcpy(str, uri_str, uri_len);
+       str += uri_len;
+       *str++ = 0;
+
+       CHECK_LOGPTR(str);
+
+       if (req->version_len) {
+               memcpy(str, req->version_str, req->version_len);
+               str += req->version_len;
+               CHECK_LOGPTR(str);
+       }
+       *str++ = 0;
+#if CONFIG_TUX_EXTENDED_LOG
+       if (req->user_agent_len) {
+               memcpy(str, req->user_agent_str, req->user_agent_len);
+               str += req->user_agent_len;
+               CHECK_LOGPTR(str);
+       }
+       *str++ = 0;
+#endif
+       CHECK_LOGPTR(str);
+
+       if (tux_referer_logging && req->referer_len) {
+               memcpy(str, req->referer_str, req->referer_len);
+               str += req->referer_len;
+               CHECK_LOGPTR(str);
+       }
+       *str++ = 0;
+       CHECK_LOGPTR(str);
+       /*
+        * pad with spaces to next cacheline, with an ending newline.
+        * (not needed for the user-space log utility, but results in
+        * a more readable binary log file, and reduces the amount
+        * of cache pingpong.)
+        */
+       next = (char *)ROUND_UP((unsigned long)str);
+
+       CHECK_LOGPTR(next);
+       len = next-str;
+       memset(str, ' ', len);
+
+       pending = (log_head-log_tail) % LOG_LEN;
+       spin_unlock_irqrestore(&log_lock, flags);
+
+       if (pending >= SOFT_LIMIT)
+               wake_up(&log_wait);
+
+       if (pending >= HARD_LIMIT)
+               __throttle_logging();
+}
+
+void tux_push_pending (struct sock *sk)
+{
+       struct tcp_opt *tp = tcp_sk(sk);
+
+       Dprintk("pushing pending frames on sock %p.\n", sk);
+       lock_sock(sk);
+       if ((sk->sk_state == TCP_ESTABLISHED) && !sk->sk_err) {
+               tp->ack.pingpong = tux_ack_pingpong;
+               tp->nonagle = 1;
+               __tcp_push_pending_frames(sk, tp, tcp_current_mss(sk, 0), TCP_NAGLE_OFF);
+       }
+       release_sock(sk);
+}
+
+inline void tux_push_req (tux_req_t *req)
+{
+       if (req->sock)
+               tux_push_pending(req->sock->sk);
+       if (req->data_sock)
+               tux_push_pending(req->data_sock->sk);
+}
+
+void __put_data_sock (tux_req_t *req)
+{
+       unlink_tux_data_socket(req);
+       if (req->data_sock->file)
+               fput(req->data_sock->file);
+       else
+               sock_release(req->data_sock);
+       req->data_sock = NULL;
+}
+
+/* open-coded sys_close */
+
+long tux_close(unsigned int fd)
+{
+       struct file * filp;
+       struct files_struct *files = current->files;
+
+       spin_lock(&files->file_lock);
+       if (fd >= files->max_fds)
+               goto out_unlock;
+       filp = files->fd[fd];
+       if (!filp)
+               goto out_unlock;
+       files->fd[fd] = NULL;
+       FD_CLR(fd, files->close_on_exec);
+       /* __put_unused_fd(files, fd); */
+       __FD_CLR(fd, files->open_fds);
+       if (fd < files->next_fd)
+               files->next_fd = fd;
+       spin_unlock(&files->file_lock);
+       return filp_close(filp, files);
+
+out_unlock:
+       spin_unlock(&files->file_lock);
+       return -EBADF;
+}
+
+void flush_request (tux_req_t *req, int cachemiss)
+{
+       struct socket *sock;
+       struct sock *sk;
+       int keep_alive;
+
+       if (cachemiss)
+               TUX_BUG();
+       __set_task_state(current, TASK_RUNNING);
+
+       if (req->magic != TUX_MAGIC)
+               TUX_BUG();
+       if (req->ti->thread != current)
+               TUX_BUG();
+#if CONFIG_TUX_DEBUG
+       if (req->bytes_expected && (req->bytes_sent != req->bytes_expected)) {
+               printk("hm, bytes_expected: %d != bytes_sent: %d!\n",
+                       req->bytes_expected, req->bytes_sent);
+               TUX_BUG();
+       }
+#endif
+       SET_TIMESTAMP(req->flush_timestamp);
+
+       log_request(req);
+       sock = req->sock;
+       sk = NULL;
+       if (sock)
+               sk = sock->sk;
+       Dprintk("FLUSHING req %p <%p> (sock %p, sk %p) (keepalive: %d, status: %d)\n", req, __builtin_return_address(0), sock, sk, req->keep_alive, req->status);
+       if (req->in_file.f_pos)
+               /*TUX_BUG()*/;
+       release_req_dentry(req);
+       req->private = 0;
+
+       if (req->docroot_dentry) {
+               dput(req->docroot_dentry);
+               req->docroot_dentry = NULL;
+               if (!req->docroot_mnt)
+                       TUX_BUG();
+       }
+       if (req->docroot_mnt) {
+               mntput(req->docroot_mnt);
+               req->docroot_mnt = NULL;
+       }
+
+       req->offset_start = 0;
+       req->offset_end = 0;
+       req->output_len = 0;
+       req->total_file_len = 0;
+       req->lendigits = 0;
+       req->mtime = 0;
+       req->etaglen = 0;
+       req->etag[0] = 0;
+       req->ftp_command = 0;
+
+       if (req->postponed)
+               TUX_BUG();
+       if (test_bit(0, &req->idle_input))
+               TUX_BUG();
+       if (test_bit(0, &req->wait_output_space))
+               TUX_BUG();
+       if (req->parsed_len)
+               trunc_headers(req);
+       if (req->parsed_len)
+               TUX_BUG();
+       req->attr = NULL;
+       req->usermode = 0;
+       req->usermodule_idx = 0;
+       req->atom_idx = 0;
+       if (req->module_dentry) {
+               dput(req->module_dentry);
+               req->module_dentry = NULL;
+       }
+       if (req->headers)
+               kfree(req->headers);
+       req->headers = NULL;
+       req->headers_len = 0;
+
+       req->method = METHOD_NONE;
+       req->method_len = 0;
+       req->method_str = NULL;
+       req->version = 0;
+       req->version_str = NULL;
+       req->version_len = 0;
+
+       req->uri_str = NULL;
+       req->uri_len = 0;
+
+       req->objectname[0] = 0;
+       req->objectname_len = 0;
+
+       req->query_str = NULL;
+       req->query_len = 0;
+
+       req->cookies_str = NULL;
+       req->cookies_len = 0;
+       req->parse_cookies = 0;
+
+       req->contentlen_str = NULL;
+       req->contentlen_len = 0;
+       req->content_len = 0;
+
+       req->user_agent_str = NULL;
+       req->user_agent_len = 0;
+
+       req->may_send_gzip = 0;
+       req->content_gzipped = 0;
+
+       req->content_type_str = NULL;
+       req->content_type_len = 0;
+
+       req->accept_str = NULL;
+       req->accept_len = 0;
+
+       req->accept_charset_str = NULL;
+       req->accept_charset_len = 0;
+
+       req->accept_encoding_str = NULL;
+       req->accept_encoding_len = 0;
+
+       req->accept_language_str = NULL;
+       req->accept_language_len = 0;
+
+       req->cache_control_str = NULL;
+       req->cache_control_len = 0;
+
+       req->if_modified_since_str = NULL;
+       req->if_modified_since_len = 0;
+
+       req->if_none_match_str = NULL;
+       req->if_none_match_len = 0;
+
+       req->if_range_str = NULL;
+       req->if_range_len = 0;
+
+       req->negotiate_str = NULL;
+       req->negotiate_len = 0;
+
+       req->pragma_str = NULL;
+       req->pragma_len = 0;
+
+       req->referer_str = NULL;
+       req->referer_len = 0;
+
+       req->post_data_str = NULL;
+       req->post_data_len = 0;
+
+       SET_TIMESTAMP(req->accept_timestamp);
+#if CONFIG_TUX_EXTENDED_LOG
+       req->parse_timestamp = 0;
+       req->output_timestamp = 0;
+       req->flush_timestamp = 0;
+#endif
+       req->status = 0;
+
+       req->total_bytes += req->bytes_sent;
+       req->bytes_sent = 0;
+#if CONFIG_TUX_DEBUG
+       req->bytes_expected = 0;
+#endif
+       req->body_len = 0;
+       keep_alive = req->keep_alive;
+       clear_keepalive(req);
+       req->had_cachemiss = 0;
+       // first_timestamp and total_bytes is kept!
+       req->event = 0;
+       req->lookup_dir = 0;
+       req->lookup_404 = 0;
+
+       req->error = 0;
+       req->user_error = 0;
+
+       if (req->abuf.page)
+               __free_page(req->abuf.page);
+       memset(&req->abuf, 0, sizeof(req->abuf));
+
+       if (sk && keep_alive) {
+               add_tux_atom(req, parse_request);
+               if (skb_queue_empty(&sk->sk_receive_queue)) {
+                       spin_lock_irq(&req->ti->work_lock);
+                       add_keepalive_timer(req);
+                       if (test_and_set_bit(0, &req->idle_input))
+                               TUX_BUG();
+                       /*
+                        * Avoid the race with the event callback:
+                        */
+                       if (skb_queue_empty(&sk->sk_receive_queue) ||
+                                  !test_and_clear_bit(0, &req->idle_input)) {
+                               INC_STAT(nr_idle_input_pending);
+                               spin_unlock_irq(&req->ti->work_lock);
+                               tux_push_req(req);
+                               goto out;
+                       }
+                       del_keepalive_timer(req);
+                       spin_unlock_irq(&req->ti->work_lock);
+               }
+               Dprintk("KEEPALIVE PENDING req %p <%p> (sock %p, sk %p) (keepalive: %d, status: %d)\n", req, __builtin_return_address(0), req->sock, req->sock->sk, req->keep_alive, req->status);
+               add_req_to_workqueue(req);
+               INC_STAT(nr_keepalive_optimized);
+               goto out;
+       }
+
+       del_timer_sync(&req->keepalive_timer);
+       del_timer_sync(&req->output_timer);
+
+       if (timer_pending(&req->keepalive_timer))
+               TUX_BUG();
+       if (timer_pending(&req->output_timer))
+               TUX_BUG();
+       if (!list_empty(&req->lru))
+               TUX_BUG();
+       req->nr_keepalives = 0;
+       req->client_addr = 0;
+       req->client_port = 0;
+       req->virtual = 0;
+       req->ftp_offset_start = 0;
+
+       req->host[0] = 0;
+       req->host_len = 0;
+
+       if (req->cwd_dentry) {
+               dput(req->cwd_dentry);
+               req->cwd_dentry = NULL;
+               if (!req->cwd_mnt)
+                       TUX_BUG();
+       }
+       if (req->cwd_mnt) {
+               mntput(req->cwd_mnt);
+               req->cwd_mnt = NULL;
+       }
+       put_data_sock(req);
+       req->prev_pos = 0;
+       req->curroff = 0;
+       req->total = 0;
+       if (req->dirp0) {
+               kfree(req->dirp0);
+               req->dirp0 = NULL;
+       }
+
+       if (sk)
+               unlink_tux_socket(req);
+       req->sock = NULL;
+       /*
+        * Close potential user-space file descriptors.
+        */
+       {
+               int fd = req->fd, ret;
+
+               if (fd != -1) {
+                       req->fd = -1;
+                       ret = tux_close(fd);
+                       if (ret)
+                               TUX_BUG();
+               } else
+                       if (sock)
+                               sock_release(sock);
+       }
+       kfree_req(req);
+out:
+       ;
+}
+
+static int warn_once = 1;
+
+static unsigned int writeout_log (void)
+{
+       unsigned int len, pending, next_log_tail;
+       mm_segment_t oldmm = get_fs();
+       struct file *log_filp;
+       char * str;
+       unsigned int ret;
+
+       if (tux_logging)
+               Dprintk("TUX logger: opening log file {%s}.\n", tux_logfile);
+       log_filp = tux_open_file(tux_logfile, O_CREAT|O_APPEND|O_WRONLY|O_LARGEFILE);
+       if (!log_filp) {
+               if (warn_once) {
+                       printk(KERN_ERR "TUX: could not open log file {%s}!\n",
+                               tux_logfile);
+                       warn_once = 0;
+               }
+               __set_current_state(TASK_INTERRUPTIBLE);
+               schedule_timeout(HZ);
+               return 0;
+       }
+       spin_lock(&log_lock);
+       str = log_buffer + log_tail;
+       if (log_head < log_tail) {
+               len = LOG_LEN-log_tail;
+               next_log_tail = 0;
+       } else {
+               len = log_head-log_tail;
+               next_log_tail = log_head;
+       }
+       if (!len)
+               goto out;
+       spin_unlock(&log_lock);
+
+       set_fs(KERNEL_DS);
+       ret = log_filp->f_op->write(log_filp, str, len, &log_filp->f_pos);
+       set_fs(oldmm);
+
+       if (len != ret) {
+               if (ret == -ENOSPC) {
+                       printk(KERN_ERR "TUX: trying to write TUX logfile %s, but filesystem is full! Lost %d bytes of log data.\n", tux_logfile, len);
+               } else {
+                       printk(KERN_ERR "TUX: log write %d != %d.\n", ret, len);
+                       printk(KERN_ERR "TUX: log_filp: %p, str: %p, len: %d str[len-1]: %d.\n", log_filp, str, len, str[len-1]);
+               }
+               goto out_lock;
+       }
+
+       /*
+        * Sync log data to disk:
+        */
+       if (log_filp->f_op && log_filp->f_op->fsync) {
+               down(&log_filp->f_dentry->d_inode->i_sem);
+               log_filp->f_op->fsync(log_filp, log_filp->f_dentry, 1);
+               up(&log_filp->f_dentry->d_inode->i_sem);
+       }
+
+       /*
+        * Reduce the cache footprint of the logger file - it's
+        * typically write-once.
+        */
+       invalidate_inode_pages(log_filp->f_dentry->d_inode->i_mapping);
+
+out_lock:
+       spin_lock(&log_lock);
+out:
+       log_tail = next_log_tail;
+       pending = (log_head-log_tail) % LOG_LEN;
+       spin_unlock(&log_lock);
+
+       if (pending < HARD_LIMIT)
+               wake_up(&log_full);
+
+       fput(log_filp);
+       return pending;
+}
+
+static DECLARE_WAIT_QUEUE_HEAD(stop_logger_wait);
+static int stop_logger = 0;
+
+static int logger_thread (void *data)
+{
+       DECLARE_WAITQUEUE(wait, current);
+       mm_segment_t oldmm;
+
+       daemonize("TUX logger");
+
+       oldmm = get_fs();
+       set_fs(KERNEL_DS);
+       printk(KERN_NOTICE "TUX: logger thread started.\n");
+#if CONFIG_SMP
+       {
+               cpumask_t log_mask, map;
+
+               mask_to_cpumask(log_cpu_mask, &log_mask);
+               cpus_and(map, cpu_online_map, log_mask);
+               if(!(cpus_empty(map)))
+                       set_cpus_allowed(current, map);
+
+       }
+#endif
+
+
+       spin_lock_irq(&current->sighand->siglock);
+       siginitsetinv(&current->blocked, 0);
+       recalc_sigpending();
+       spin_unlock_irq(&current->sighand->siglock);
+
+       if (log_buffer)
+               TUX_BUG();
+       log_buffer = vmalloc(LOG_LEN);
+       memset(log_buffer, 0, LOG_LEN);
+       log_head = log_tail = 0;
+
+       current->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
+
+       add_wait_queue(&log_wait, &wait);
+       for (;;) {
+               if (tux_logging)
+                       Dprintk("logger does writeout - stop:%d.\n", stop_logger);
+
+               while (writeout_log() >= SOFT_LIMIT) {
+                       if (stop_logger)
+                               break;
+               }
+               if (stop_logger)
+                       break;
+                       /* nothing */;
+
+               if (tux_logging)
+                       Dprintk("logger does sleep - stop:%d.\n", stop_logger);
+               __set_current_state(TASK_INTERRUPTIBLE);
+               if (log_head != log_tail) {
+                       __set_current_state(TASK_RUNNING);
+                       continue;
+               }
+               schedule_timeout(HZ);
+               if (tux_logging)
+                       Dprintk("logger back from sleep - stop:%d.\n", stop_logger);
+               if (signal_pending(current))
+                       flush_all_signals();
+       }
+       remove_wait_queue(&log_wait, &wait);
+
+       vfree(log_buffer);
+       log_buffer = NULL;
+       stop_logger = 0;
+       wake_up(&stop_logger_wait);
+
+       set_fs(oldmm);
+
+       return 0;
+}
+
+void start_log_thread (void)
+{
+       warn_once = 1;
+
+       logger_pid = kernel_thread(logger_thread, NULL, 0);
+       if (logger_pid < 0)
+               TUX_BUG();
+}
+
+void stop_log_thread (void)
+{
+       DECLARE_WAITQUEUE(wait, current);
+
+       Dprintk("stopping logger thread %d ...\n", logger_pid);
+
+       __set_current_state(TASK_UNINTERRUPTIBLE);
+       add_wait_queue(&stop_logger_wait, &wait);
+       stop_logger = 1;
+       wake_up(&log_wait);
+       schedule();
+       __set_current_state(TASK_RUNNING);
+       remove_wait_queue(&stop_logger_wait, &wait);
+
+       Dprintk("logger thread stopped!\n");
+}
diff --git a/net/tux/main.c b/net/tux/main.c
new file mode 100644 (file)
index 0000000..e33241f
--- /dev/null
@@ -0,0 +1,1413 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * main.c: main management and initialization routines
+ */
+
+#define __KERNEL_SYSCALLS__
+#define __KERNEL_SYSCALLS_NO_ERRNO__
+
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+/*
+ * Threads information.
+ */
+unsigned int nr_tux_threads;
+static atomic_t nr_tux_threads_running = ATOMIC_INIT(0);
+static int stop_threads = 0;
+
+threadinfo_t threadinfo[CONFIG_TUX_NUMTHREADS];
+
+static void flush_all_requests (threadinfo_t *ti);
+
+void flush_all_signals (void)
+{
+       spin_lock_irq(&current->sighand->siglock);
+       flush_signals(current);
+       recalc_sigpending();
+       spin_unlock_irq(&current->sighand->siglock);
+}
+
+int nr_requests_used (void)
+{
+       unsigned int i, nr = 0;
+
+       for (i = 0; i < nr_tux_threads; i++) {
+               threadinfo_t *ti = threadinfo + i;
+               nr += ti->nr_requests - ti->nr_free_requests;
+       }
+
+       return nr;
+}
+
+static inline int accept_pending (threadinfo_t *ti)
+{
+       int j;
+
+       for (j = 0; j < CONFIG_TUX_NUMSOCKETS; j++) {
+               if (!ti->listen[j].proto)
+                       break;
+               if (!ti->listen[j].sock)
+                       break;
+               if (tcp_sk(ti->listen[j].sock->sk)->accept_queue)
+                       return 1;
+       }
+       return 0;
+}
+
+static inline int requests_pending (threadinfo_t *ti)
+{
+       if (!list_empty(&ti->work_pending))
+               return 1;
+       return 0;
+}
+
+static int event_loop (threadinfo_t *ti)
+{
+       tux_req_t *req;
+       int work_done;
+
+repeat_accept:
+       if (ti->thread != current)
+               TUX_BUG();
+
+       /*
+        * Any (relevant) event on the socket will change this
+        * thread to TASK_RUNNING because we add it to both
+        * the main listening and the connection request socket
+        * waitqueues. Thus we can do 'lazy checking' of work
+        * to be done and schedule away only if the thread is
+        * still TASK_INTERRUPTIBLE. This makes TUX fully
+        * event driven.
+        */
+       set_task_state(current, TASK_INTERRUPTIBLE);
+       current->flags |= PF_MEMALLOC;
+       work_done = 0;
+       if (accept_pending(ti))
+               work_done = accept_requests(ti);
+
+       if (requests_pending(ti)) {
+               work_done = process_requests(ti, &req);
+               if (req)
+                       goto handle_userspace_req;
+       }
+
+       /*
+        * Be nice to other processes:
+        */
+       if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) {
+               __set_task_state(current, TASK_RUNNING);
+               schedule();
+               goto repeat_accept;
+       }
+
+       if (ti->userspace_req)
+               TUX_BUG();
+       if (unlikely(stop_threads))
+               goto handle_stop;
+
+       /* Any signals? */
+       if (unlikely(signal_pending(current)))
+               goto handle_signal;
+
+       if (work_done)
+               goto repeat_accept;
+       /*
+        * Any socket event either on the listen socket
+        * or on the request sockets will wake us up:
+        */
+       if ((current->state != TASK_RUNNING) &&
+                       !requests_pending(ti) && !accept_pending(ti)) {
+               Dprintk("fast thread: no work to be done, sleeping.\n");
+               schedule();
+               Dprintk("fast thread: back from sleep!\n");
+               goto repeat_accept;
+       }
+       goto repeat_accept;
+
+handle_userspace_req:
+       if (req->attr)
+               TUX_BUG();
+       switch_docroot(req);
+       ti->userspace_req = req;
+       __set_task_state(current, TASK_RUNNING);
+       return TUX_RETURN_USERSPACE_REQUEST;
+
+handle_signal:
+       __set_task_state(current, TASK_RUNNING);
+       return TUX_RETURN_SIGNAL;
+
+handle_stop:
+       __set_task_state(current, TASK_RUNNING);
+       return TUX_RETURN_EXIT;
+}
+
+static int init_queues (int nr_tux_threads)
+{
+       int i;
+
+       for (i = 0; i < nr_tux_threads; i++) {
+               threadinfo_t *ti = threadinfo + i;
+
+               INIT_LIST_HEAD(&ti->all_requests);
+
+               ti->free_requests_lock = SPIN_LOCK_UNLOCKED;
+               INIT_LIST_HEAD(&ti->free_requests);
+
+               ti->work_lock = SPIN_LOCK_UNLOCKED;
+               INIT_LIST_HEAD(&ti->work_pending);
+               INIT_LIST_HEAD(&ti->lru);
+
+       }
+       return 0;
+}
+
+int tux_chroot (char *dir)
+{
+       kernel_cap_t saved_cap = current->cap_effective;
+       mm_segment_t oldmm;
+       int err;
+
+       /* Allow chroot dir to be in kernel space. */
+       oldmm = get_fs(); set_fs(KERNEL_DS);
+       set_fs(KERNEL_DS);
+       cap_raise (current->cap_effective, CAP_SYS_CHROOT);
+
+       err = chroot(dir);
+       if (!err)
+               chdir("/");
+
+       current->cap_effective = saved_cap;
+       set_fs(oldmm);
+
+       return err;
+}
+
+/*
+ * Right now this is not fully SMP-safe against multiple TUX
+ * managers. It's just a rudimentary protection against typical
+ * mistakes.
+ */
+static int initialized = 0;
+
+#define MAX_DOCROOTLEN 500
+
+static int lookup_docroot(struct nameidata *docroot, const char *name)
+{
+       int err;
+
+       docroot->mnt = mntget(current->fs->rootmnt);
+       docroot->dentry = dget(current->fs->root);
+       docroot->last.len = 0;
+       docroot->flags = LOOKUP_FOLLOW;
+
+       err = path_walk(name, docroot);
+       if (err) {
+               mntput(docroot->mnt);
+               docroot->mnt = NULL;
+               return err;
+       }
+       return 0;
+}
+
+static int user_req_startup (void)
+{
+       char name[MAX_DOCROOTLEN];
+       struct nameidata *docroot;
+       unsigned int i;
+       int err;
+
+       if (initialized)
+               return -EINVAL;
+       initialized = 1;
+
+       /*
+        * Look up the HTTP and FTP document root.
+        * (typically they are shared, but can be 
+        * different directories.)
+        */
+       docroot = &tux_proto_http.main_docroot;
+       if (docroot->mnt)
+               TUX_BUG();
+       strcpy(name, tux_common_docroot);
+       strcat(name, tux_http_subdocroot);
+
+       err = lookup_docroot(docroot, name);
+       if (err) {
+               initialized = 0;
+               printk(KERN_ERR "TUX: could not look up HTTP documentroot: \"%s\"\n", name);
+               return err;
+       }
+
+       docroot = &tux_proto_ftp.main_docroot;
+       if (docroot->mnt)
+               TUX_BUG();
+       strcpy(name, tux_common_docroot);
+       strcat(name, tux_ftp_subdocroot);
+
+       err = lookup_docroot(docroot, name);
+       if (err) {
+abort:
+               docroot = &tux_proto_http.main_docroot;
+               path_release(docroot);
+               memset(docroot, 0, sizeof(*docroot));
+               initialized = 0;
+               printk(KERN_ERR "TUX: could not look up FTP documentroot: \"%s\"\n", name);
+               return err;
+       }
+
+       /*
+        * Start up the logger thread. (which opens the logfile)
+        */
+       start_log_thread();
+
+       nr_tux_threads = tux_threads;
+       if (nr_tux_threads < 1) 
+               nr_tux_threads = 1;
+       if (nr_tux_threads > CONFIG_TUX_NUMTHREADS) 
+               nr_tux_threads = CONFIG_TUX_NUMTHREADS;
+       tux_threads = nr_tux_threads;
+
+       /*
+        * Set up per-thread work-queues:
+        */
+       memset(threadinfo, 0, CONFIG_TUX_NUMTHREADS*sizeof(threadinfo_t));
+       init_queues(nr_tux_threads);
+
+       /*
+        * Prepare the worker thread structures.
+        */
+       for (i = 0; i < nr_tux_threads; i++) {
+               threadinfo_t *ti = threadinfo + i;
+               ti->cpu = i;
+               ti->gzip_state.workspace =
+                       vmalloc(zlib_deflate_workspacesize());
+               if (!ti->gzip_state.workspace ||
+                           (zlib_deflateInit(&ti->gzip_state, 6) != Z_OK)) {
+                       stop_log_thread();
+                       goto abort;
+               }
+               init_MUTEX(&ti->gzip_sem);
+       }
+
+       __module_get(tux_module);
+
+       return 0;
+}
+
+static DECLARE_WAIT_QUEUE_HEAD(wait_stop);
+static DECLARE_WAIT_QUEUE_HEAD(thread_stopped);
+
+static int user_req_shutdown (void)
+{
+       DECLARE_WAITQUEUE(wait, current);
+       struct nameidata *docroot;
+       int i, err = -EINVAL;
+
+       lock_kernel();
+       if (!initialized) {
+               Dprintk("TUX is not up - cannot shut down.\n");
+               goto err;
+       }
+       initialized = 0;
+       stop_threads = 1;
+       add_wait_queue(&thread_stopped, &wait);
+
+wait_more:
+       /*
+        * Wake up all the worker threads so they notice
+        * that we are being stopped.
+        */
+       set_task_state(current, TASK_UNINTERRUPTIBLE);
+       if (atomic_read(&nr_tux_threads_running)) {
+               Dprintk("TUX: shutdown, %d threads still running.\n",
+                       atomic_read(&nr_tux_threads_running));
+               wake_up(&wait_stop);
+               schedule();
+               goto wait_more;
+       }
+       set_task_state(current, TASK_RUNNING);
+       stop_threads = 0;
+       remove_wait_queue(&thread_stopped, &wait);
+
+       if (nr_async_io_pending())
+               TUX_BUG();
+
+       stop_log_thread();
+
+       docroot = &tux_proto_http.main_docroot;
+       path_release(docroot);
+       memset(docroot, 0, sizeof(*docroot));
+       docroot = &tux_proto_ftp.main_docroot;
+       path_release(docroot);
+       memset(docroot, 0, sizeof(*docroot));
+       err = 0;
+
+       flush_dentry_attributes();
+       free_mimetypes();
+       unregister_all_tuxmodules();
+
+       for (i = 0; i < nr_tux_threads; i++) {
+               threadinfo_t *ti = threadinfo + i;
+               vfree(ti->gzip_state.workspace);
+       }
+
+       module_put(tux_module);
+
+err:
+       unlock_kernel();
+       return err;
+}
+
+void drop_permissions (void)
+{
+       /*
+        * Userspace drops privileges already, and group
+        * membership is important to keep.
+        */
+       /* Give the new process no privileges.. */
+       current->uid = current->euid =
+               current->suid = current->fsuid = tux_cgi_uid;
+       current->gid = current->egid =
+               current->sgid = current->fsgid = tux_cgi_gid;
+       cap_clear(current->cap_permitted);
+       cap_clear(current->cap_inheritable);
+       cap_clear(current->cap_effective);
+}
+
+static int wait_for_others (void)
+{
+       threadinfo_t *ti;
+       unsigned int cpu;
+
+repeat:
+       if (signal_pending(current))
+               return -1;
+       set_current_state(TASK_INTERRUPTIBLE);
+       schedule_timeout(HZ/10);
+
+       for (cpu = 0; cpu < nr_tux_threads; cpu++) {
+               ti = threadinfo + cpu;
+               if (ti->listen_error)
+                       return -1;
+               if (!ti->started)
+                       goto repeat;
+       }
+       /* ok, all threads have started up. */
+       return 0;
+}
+
+static void zap_listen_sockets (threadinfo_t *ti)
+{
+       struct socket *sock;
+       int i;
+
+       for (i = 0; i < CONFIG_TUX_NUMSOCKETS; i++) {
+               if (!ti->listen[i].proto)
+                       break;
+               sock = ti->listen[i].sock;
+               if (!ti->listen[i].cloned && sock) {
+                       while (waitqueue_active(sock->sk->sk_sleep))
+                               yield();
+                       sock_release(sock);
+               }
+               ti->listen[i].sock = NULL;
+               ti->listen[i].proto = NULL;
+               ti->listen[i].cloned = 0;
+       }
+}
+
+static DECLARE_MUTEX(serialize_startup);
+
+static int user_req_start_thread (threadinfo_t *ti)
+{
+       unsigned int err, cpu, i, j, k;
+       struct k_sigaction *ka;
+
+       cpu = ti->cpu;
+#if CONFIG_SMP
+       {
+               unsigned int mask;
+               cpumask_t cpu_mask, map;
+
+               mask = 1 << ((cpu + tux_cpu_offset) % num_online_cpus());
+
+               mask_to_cpumask(mask, &cpu_mask);
+               cpus_and(map, cpu_mask, cpu_online_map);
+               if(!(cpus_empty(map)))
+                       set_cpus_allowed(current, map);         
+       }
+#endif
+       ti->thread = current;
+       atomic_inc(&nr_tux_threads_running);
+
+       err = start_cachemiss_threads(ti);
+       if (err)
+               goto out;
+
+       init_waitqueue_entry(&ti->stop, current);
+       for (j = 0; j < CONFIG_TUX_NUMSOCKETS; j++)
+               init_waitqueue_entry(ti->wait_event + j, current);
+
+       ka = current->sighand->action + SIGCHLD-1;
+       ka->sa.sa_handler = SIG_IGN;
+
+       /* Block all signals except SIGKILL, SIGSTOP, SIGHUP and SIGCHLD */
+       spin_lock_irq(&current->sighand->siglock);
+       siginitsetinv(&current->blocked, sigmask(SIGKILL) |
+                       sigmask(SIGSTOP)| sigmask(SIGHUP) | sigmask(SIGCHLD));
+       recalc_sigpending();
+       spin_unlock_irq(&current->sighand->siglock);
+
+       if (!tux_listen[cpu][0].proto) {
+               printk(KERN_ERR "no listen socket specified for TUX thread %d, in /proc/net/tux/%d/listen/, aborting.\n", cpu, cpu);
+               goto error;
+       }
+
+       /*
+        * Serialize startup so that listen sockets can be
+        * created race-free.
+        */
+       down(&serialize_startup);
+
+       Dprintk("thread %d initializing sockets.\n", cpu);
+
+       for (k = 0; k < CONFIG_TUX_NUMSOCKETS; k++) {
+               tux_socket_t *e1, *e2;
+
+               e1 = tux_listen[cpu] + k;
+               if (!e1->proto)
+                       break;
+               for (i = 0; i < CONFIG_TUX_NUMTHREADS; i++) {
+                       if (i == cpu)
+                               continue;
+                       for (j = 0; j < CONFIG_TUX_NUMSOCKETS; j++) {
+                               e2 = tux_listen[i] + j;
+                               if (!e2->proto)
+                                       continue;
+                               if ((e1->ip == e2->ip) && (e1->port == e2->port) && (e1->proto == e2->proto) && threadinfo[i].listen[j].proto) {
+                                       ti->listen[k] = threadinfo[i].listen[j];
+                                       ti->listen[k].cloned = 1;
+                                       Dprintk("cloned socket %d from thread %d's socket %d.\n", k, i, j);
+                                       goto next_socket;
+                               }
+                       }
+               }
+
+               ti->listen[k].sock = start_listening(tux_listen[cpu] + k, cpu);
+               if (!ti->listen[k].sock)
+                       goto error_unlock;
+               ti->listen[k].cloned = 0;
+               ti->listen[k].proto = tux_listen[cpu][k].proto;
+               Dprintk("thread %d got sock %p (%d), proto %s.\n", cpu, ti->listen[k].sock, k, ti->listen[k].proto->name);
+next_socket:
+               ;
+       }
+       Dprintk("thread %d done initializing sockets.\n", cpu);
+       up(&serialize_startup);
+
+       if (wait_for_others())
+               goto error_nomsg;
+
+       if (!ti->listen[0].proto) {
+               printk("hm, socket 0 has no protocol.\n");
+               goto error;
+       }
+
+       add_wait_queue(&wait_stop, &ti->stop);
+       for (j = 0; j < CONFIG_TUX_NUMSOCKETS; j++)
+               if (ti->listen[j].proto)
+                       add_wait_queue_exclusive(ti->listen[j].sock->sk->sk_sleep,
+                               ti->wait_event + j);
+       drop_permissions();
+
+       __module_get(tux_module);
+       return 0;
+
+error_unlock:
+       up(&serialize_startup);
+error:
+       printk(KERN_NOTICE "TUX: could not start worker thread %d.\n", ti->cpu);
+
+error_nomsg:
+       ti->listen_error = 1;
+       ti->started = 0;
+
+       zap_listen_sockets(ti);
+       flush_all_requests(ti);
+       stop_cachemiss_threads(ti);
+
+       err = -EINVAL;
+
+out:
+       /*
+        * Last thread close the door:
+        */
+       if (atomic_dec_and_test(&nr_tux_threads_running))
+               user_req_shutdown();
+
+       return -err;
+}
+
+static int flush_idleinput (threadinfo_t * ti)
+{
+       struct list_head *head, *tmp;
+       tux_req_t *req;
+       int count = 0;
+
+       head = &ti->all_requests;
+       tmp = head->next;
+
+       while (tmp != head) {
+               req = list_entry(tmp, tux_req_t, all);
+               tmp = tmp->next;
+               if (test_bit(0, &req->idle_input)) {
+                       idle_event(req);
+                       count++;
+               }
+       }
+       return count;
+}
+
+static int flush_waitoutput (threadinfo_t * ti)
+{
+       struct list_head *head, *tmp;
+       tux_req_t *req;
+       int count = 0;
+
+       head = &ti->all_requests;
+       tmp = head->next;
+
+       while (tmp != head) {
+               req = list_entry(tmp, tux_req_t, all);
+               tmp = tmp->next;
+               if (test_bit(0, &req->wait_output_space)) {
+                       output_space_event(req);
+                       count++;
+               }
+       }
+       return count;
+}
+
+static void flush_all_requests (threadinfo_t *ti)
+{
+       for (;;) {
+               int count;
+
+               count = flush_idleinput(ti);
+               count += flush_waitoutput(ti);
+               count += tux_flush_workqueue(ti);
+               count += flush_freequeue(ti);
+               if (!ti->nr_requests)
+                       break;
+               /*
+                * Go through again if we advanced:
+                */
+               if (count)
+                       continue;
+               Dprintk("flush_all_requests: %d requests still waiting.\n", ti->nr_requests);
+#if TUX_DEBUG
+               count = print_all_requests(ti);
+               Dprintk("flush_all_requests: printed %d requests.\n", count);
+#endif
+               current->state = TASK_UNINTERRUPTIBLE;
+               schedule_timeout(HZ/10);
+       }
+}
+
+int nr_async_io_pending (void)
+{
+       unsigned int i, sum = 0;
+
+       for (i = 0; i < nr_tux_threads; i++) {
+               threadinfo_t *ti = threadinfo + i;
+               if (ti->iot)
+                       sum += ti->iot->nr_async_pending;
+       }
+       return sum;
+}
+
+static int user_req_stop_thread (threadinfo_t *ti)
+{
+       int j;
+
+       printk(KERN_NOTICE "TUX: thread %d stopping ...\n",
+               (int)(ti-threadinfo));
+
+       if (!ti->started)
+               TUX_BUG();
+       for (j = 0; j < CONFIG_TUX_NUMSOCKETS; j++)
+               if (ti->listen[j].proto)
+                       remove_wait_queue(ti->listen[j].sock->sk->sk_sleep,
+                               ti->wait_event + j);
+       remove_wait_queue(&wait_stop, &ti->stop);
+
+       Dprintk(KERN_NOTICE "TUX: thread %d waiting for sockets to go inactive ...\n", (int)(ti-threadinfo));
+       zap_listen_sockets(ti);
+
+       Dprintk(KERN_NOTICE "TUX: thread %d has all sockets inactive.\n", (int)(ti-threadinfo));
+
+       flush_all_requests(ti);
+       stop_cachemiss_threads(ti);
+
+       if (ti->nr_requests)
+               TUX_BUG();
+       ti->started = 0;
+
+       printk(KERN_INFO "TUX: thread %d stopped.\n", ti->cpu);
+
+       ti->thread = NULL;
+       current->tux_info = NULL;
+       current->tux_exit = NULL;
+       atomic_dec(&nr_tux_threads_running);
+       wake_up(&thread_stopped);
+
+       module_put(tux_module);
+
+       return 0;
+}
+
+#define COPY_INT(u_field, k_field)                                     \
+do {                                                                   \
+       if (__copy_to_user(&u_info->u_field, &req->k_field,             \
+                                       sizeof(req->k_field)))          \
+               return_EFAULT;                                          \
+} while (0)
+
+#define GETLEN(k_field, maxlen)                                                \
+               ((req->k_field##_len < maxlen) ?                        \
+               req->k_field##_len : maxlen-1)
+
+#define COPY_STR(u_field, k_field, maxlen)                             \
+do {                                                                   \
+       if (__copy_to_user(u_info->u_field, req->k_field##_str,         \
+               GETLEN(k_field, maxlen)))                               \
+                       return_EFAULT;                                  \
+} while (0)
+
+#define COPY_COND_STR(u_field,k_field,maxlen)                          \
+do {                                                                   \
+       if (req->k_field##_len)                                         \
+               COPY_STR(u_field, k_field, maxlen);                     \
+       if (__put_user((char)0, u_info->u_field +                       \
+                       GETLEN(k_field, maxlen)))                       \
+               return_EFAULT;                                          \
+} while (0)
+
+static void finish_userspace_req (tux_req_t *req)
+{
+       threadinfo_t *ti = req->ti;
+
+       ti->userspace_req = NULL;
+       req->usermode = 0;
+       req->private = 0;
+       req->error = 0;
+       DEC_STAT(nr_userspace_pending);
+       flush_request(req, 0);
+}
+
+static void zap_userspace_req (tux_req_t *req)
+{
+       clear_keepalive(req);
+       finish_userspace_req(req);
+}
+
+/*
+ * Fills in the user-space request structure:
+ */
+static int prepare_userspace_req (threadinfo_t *ti, user_req_t *u_info)
+{
+       u64 u_req;
+       tux_req_t *req = ti->userspace_req;
+       unsigned int tmp;
+       int filelen;
+       int fd;
+
+       Dprintk("prepare_userspace_req(%p).\n", req);
+       if (!req)
+               TUX_BUG();
+       if (req->error) {
+               TDprintk("userspace request has error %d.\n", req->error);
+               return -1;
+       }
+       fd = req->fd;
+       if (fd == -1) {
+               fd = sock_map_fd(req->sock);
+               Dprintk("sock_map_fd(%p) :%d.\n", req, fd);
+               if (fd < 0) {
+                       Dprintk("sock_map_fd() returned %d.\n", fd);
+                       return -EMFILE;
+               }
+               req->fd = fd;
+       }
+
+#define return_EFAULT do { Dprintk("-EFAULT at %d:%s.\n", __LINE__, __FILE__); return -EFAULT; } while (0)
+
+       if (!access_ok(VERIFY_WRITE, u_info, sizeof(*u_info)))
+               return_EFAULT;
+       if (__copy_to_user(&u_info->sock, &fd, sizeof(fd)))
+               return_EFAULT;
+       if (req->attr)
+               TUX_BUG();
+
+       COPY_INT(module_index, usermodule_idx);
+
+       COPY_COND_STR(query, query, MAX_URI_LEN);
+
+       COPY_INT(event, event);
+       Dprintk("prepare userspace, user error: %d, event %d.\n", req->user_error, req->event);
+       COPY_INT(error, user_error);
+       req->user_error = 0;
+
+       filelen = req->total_file_len;
+       if (filelen < 0)
+               filelen = 0;
+       if (__copy_to_user(&u_info->objectlen, &filelen, sizeof(filelen)))
+               return_EFAULT;
+       if ((req->method == METHOD_POST) && !filelen)
+               if (__copy_to_user(&u_info->objectlen,
+                       &req->content_len, sizeof(filelen)))
+               return_EFAULT;
+       if (req->objectname_len) {
+               if (req->objectname[req->objectname_len])
+                       TUX_BUG();
+               if (__copy_to_user(u_info->objectname, req->objectname,
+                               req->objectname_len + 1))
+                       return_EFAULT;
+       } else
+               if (__put_user((char)0, u_info->objectname))
+                       return_EFAULT;
+
+       COPY_INT(http_version, version);
+       COPY_INT(http_method, method);
+       COPY_INT(keep_alive, keep_alive);
+
+       COPY_INT(cookies_len, cookies_len);
+       if (req->cookies_len)
+               COPY_STR(cookies, cookies, MAX_COOKIE_LEN);
+       if (__put_user((char)0, u_info->cookies + req->cookies_len))
+               return_EFAULT;
+
+       u_req = (u64)(unsigned long)req;
+       if (__copy_to_user(&u_info->id, &u_req, sizeof(u_req)))
+               return_EFAULT;
+       COPY_INT(priv, private);
+       COPY_INT(bytes_sent, bytes_sent);
+
+       tmp = inet_sk(req->sock->sk)->daddr;
+       if (__copy_to_user(&u_info->client_host, &tmp, sizeof(tmp)))
+               return_EFAULT;
+
+       COPY_COND_STR(content_type, content_type, MAX_FIELD_LEN);
+       COPY_COND_STR(user_agent, user_agent, MAX_FIELD_LEN);
+       COPY_COND_STR(accept, accept, MAX_FIELD_LEN);
+       COPY_COND_STR(accept_charset, accept_charset, MAX_FIELD_LEN);
+       COPY_COND_STR(accept_encoding, accept_encoding, MAX_FIELD_LEN);
+       COPY_COND_STR(accept_language, accept_language, MAX_FIELD_LEN);
+       COPY_COND_STR(cache_control, cache_control, MAX_FIELD_LEN);
+       COPY_COND_STR(if_modified_since, if_modified_since, MAX_FIELD_LEN);
+       COPY_COND_STR(negotiate, negotiate, MAX_FIELD_LEN);
+       COPY_COND_STR(pragma, pragma, MAX_FIELD_LEN);
+       COPY_COND_STR(referer, referer, MAX_FIELD_LEN);
+
+       return TUX_RETURN_USERSPACE_REQUEST;
+}
+
+#define GOTO_ERR_no_unlock do { Dprintk("sys_tux() ERR at %s:%d.\n", __FILE__, __LINE__); goto err_no_unlock; } while (0)
+#define GOTO_ERR_unlock do { Dprintk("sys_tux() ERR at %s:%d.\n", __FILE__, __LINE__); goto err_unlock; } while (0)
+
+static int register_mimetype(user_req_t *u_info)
+{
+       char extension[MAX_URI_LEN], mimetype[MAX_URI_LEN], expires[MAX_URI_LEN];
+       u64 u_addr;
+       char *addr;
+       int ret;
+
+       ret = strncpy_from_user(extension, u_info->objectname, MAX_URI_LEN);
+       if (ret <= 0)
+               GOTO_ERR_no_unlock;
+       extension[ret] = 0;
+       Dprintk("got MIME extension: %s.\n", extension);
+       ret = copy_from_user(&u_addr, &u_info->object_addr, sizeof(u_addr));
+       if (ret)
+               GOTO_ERR_no_unlock;
+       addr = (char *)(unsigned long)u_addr;
+       ret = strncpy_from_user(mimetype, addr, MAX_URI_LEN);
+       if (ret <= 0)
+               GOTO_ERR_no_unlock;
+       mimetype[ret] = 0;
+       Dprintk("got MIME type: %s.\n", mimetype);
+        ret = strncpy_from_user(expires, u_info->cache_control, MAX_URI_LEN);
+        if (ret >= 0)
+               expires[ret] = 0;
+       else
+               expires[0] = 0;
+        Dprintk("got expires header: %s.\n", expires);
+
+       add_mimetype(extension, mimetype, expires);
+       ret = 0;
+err_no_unlock:
+       return ret;
+}
+
+void user_send_buffer (tux_req_t *req, int cachemiss)
+{
+       int ret;
+
+
+       SET_TIMESTAMP(req->output_timestamp);
+
+repeat:
+       ret = send_sync_buf(req, req->sock, req->userbuf, req->userlen, MSG_DONTWAIT | MSG_MORE);
+       switch (ret) {
+               case -EAGAIN:
+                       add_tux_atom(req, user_send_buffer);
+                       if (add_output_space_event(req, req->sock)) {
+                               del_tux_atom(req);
+                               goto repeat;
+                       }
+                       INC_STAT(user_sendbuf_write_misses);
+                       break;
+               default:
+                       if (ret <= 0) {
+                               req_err(req);
+                               req->usermode = 0;
+                               req->private = 0;
+                               add_req_to_workqueue(req);
+                               break;
+                       }
+                       req->userbuf += ret;
+                       req->userlen -= ret;
+                       if ((int)req->userlen < 0)
+                               TUX_BUG();
+                       if (req->userlen)
+                               goto repeat;
+                       add_req_to_workqueue(req);
+                       break;
+       }
+}
+
+void user_send_object (tux_req_t *req, int cachemiss)
+{
+       int ret;
+
+
+       SET_TIMESTAMP(req->output_timestamp);
+
+repeat:
+       ret = generic_send_file(req, req->sock, cachemiss);
+       switch (ret) {
+               case -5:
+                       add_tux_atom(req, user_send_object);
+                       output_timeout(req);
+                       break;
+               case -4:
+                       add_tux_atom(req, user_send_object);
+                       if (add_output_space_event(req, req->sock)) {
+                               del_tux_atom(req);
+                               goto repeat;
+                       }
+                       INC_STAT(user_sendobject_write_misses);
+                       break;
+               case -3:
+                       INC_STAT(user_sendobject_cachemisses);
+                       add_tux_atom(req, user_send_object);
+                       queue_cachemiss(req);
+                       break;
+               case -1:
+                       break;
+               default:
+                       req->in_file.f_pos = 0;
+                       add_req_to_workqueue(req);
+                       break;
+       }
+}
+
+void user_get_object (tux_req_t *req, int cachemiss)
+{
+       int missed;
+
+       if (!req->dentry) {
+               req->usermode = 0;
+               missed = lookup_object(req, cachemiss ? 0 : LOOKUP_ATOMIC);
+               if (req->usermode)
+                       TUX_BUG();
+               req->usermode = 1;
+               if (!missed && !req->dentry) {
+                       req->error = 0;
+                       req->user_error = -ENOENT;
+                       add_req_to_workqueue(req);
+                       return;
+               }
+               if (missed) {
+                       if (cachemiss)
+                               TUX_BUG();
+                       INC_STAT(user_lookup_cachemisses);
+fetch_missed:
+                       req->ti->userspace_req = NULL;
+                       DEC_STAT(nr_userspace_pending);
+                       add_tux_atom(req, user_get_object);
+                       queue_cachemiss(req);
+                       return;
+               }
+       }
+       req->total_file_len = req->dentry->d_inode->i_size;
+       if (!req->output_len)
+               req->output_len = req->total_file_len;
+       if (tux_fetch_file(req, !cachemiss)) {
+               INC_STAT(user_fetch_cachemisses);
+               goto fetch_missed;
+       }
+       req->in_file.f_pos = 0;
+       add_req_to_workqueue(req);
+}
+
+asmlinkage long __sys_tux (unsigned int action, user_req_t *u_info)
+{
+       int ret = -1;
+       threadinfo_t *ti;
+       tux_req_t *req;
+
+       if (action != TUX_ACTION_CURRENT_DATE)
+               Dprintk("got sys_tux(%d, %p).\n", action, u_info);
+
+       if (action >= MAX_TUX_ACTION)
+               GOTO_ERR_no_unlock;
+
+       ti = (threadinfo_t *) current->tux_info;
+       if (ti)
+               if (ti->thread != current)
+                       TUX_BUG();
+
+       if (!capable(CAP_SYS_ADMIN)
+                       && (action != TUX_ACTION_CONTINUE_REQ) &&
+                               (action != TUX_ACTION_STOPTHREAD))
+               goto userspace_actions;
+
+       switch (action) {
+               case TUX_ACTION_CONTINUE_REQ:
+                       ret = continue_request((int)(long)u_info);
+                       goto out;
+
+               case TUX_ACTION_STARTUP:
+                       lock_kernel();
+                       ret = user_req_startup();
+                       unlock_kernel();
+                       goto out;
+
+               case TUX_ACTION_SHUTDOWN:
+                       lock_kernel();
+                       ret = user_req_shutdown();
+                       unlock_kernel();
+                       goto out;
+
+               case TUX_ACTION_REGISTER_MODULE:
+                       ret = user_register_module(u_info);
+                       goto out;
+
+               case TUX_ACTION_UNREGISTER_MODULE:
+                       ret = user_unregister_module(u_info);
+                       goto out;
+
+               case TUX_ACTION_STARTTHREAD:
+               {
+                       unsigned int nr;
+
+                       ret = copy_from_user(&nr, &u_info->thread_nr,
+                                               sizeof(int));
+                       if (ret)
+                               GOTO_ERR_no_unlock;
+                       if (nr >= nr_tux_threads)
+                               GOTO_ERR_no_unlock;
+                       ti = threadinfo + nr;
+                       if (ti->started)
+                               GOTO_ERR_unlock;
+                       ti->started = 1;
+                       current->tux_info = ti;
+                       current->tux_exit = tux_exit;
+                       if (ti->thread)
+                               TUX_BUG();
+                       Dprintk("TUX: current open files limit for TUX%d: %ld.\n", nr, current->rlim[RLIMIT_NOFILE].rlim_cur);
+                       lock_kernel();
+                       ret = user_req_start_thread(ti);
+                       unlock_kernel();
+                       if (ret) {
+                               current->tux_info = NULL;
+                               current->tux_exit = NULL;
+                       } else {
+                               if (ti->thread != current)
+                                       TUX_BUG();
+                       }
+                       goto out_userreq;
+               }
+
+               case TUX_ACTION_STOPTHREAD:
+                       if (!ti)
+                               GOTO_ERR_no_unlock;
+                       if (!ti->started)
+                               GOTO_ERR_unlock;
+                       req = ti->userspace_req;
+                       if (req)
+                               zap_userspace_req(req);
+                       
+                       lock_kernel();
+                       ret = user_req_stop_thread(ti);
+                       unlock_kernel();
+                       goto out_userreq;
+
+               case TUX_ACTION_CURRENT_DATE:
+                       ret = strncpy_from_user(tux_date, u_info->new_date,
+                               DATE_LEN);
+                       if (ret <= 0)
+                               GOTO_ERR_no_unlock;
+                       goto out;
+
+               case TUX_ACTION_REGISTER_MIMETYPE:
+                       ret = register_mimetype(u_info);
+                       if (ret)
+                               GOTO_ERR_no_unlock;
+                       goto out;
+
+               case TUX_ACTION_QUERY_VERSION:
+                       ret = (TUX_MAJOR_VERSION << 24) | (TUX_MINOR_VERSION << 16) | TUX_PATCHLEVEL_VERSION;
+                       goto out;
+               default:
+                       ;
+       }
+
+userspace_actions:
+
+       if (!ti)
+               GOTO_ERR_no_unlock;
+
+       if (!ti->started)
+               GOTO_ERR_unlock;
+
+       req = ti->userspace_req;
+       if (!req) {
+               if (action == TUX_ACTION_EVENTLOOP)
+                       goto eventloop;
+               GOTO_ERR_unlock;
+       }
+       if (!req->usermode)
+               TUX_BUG();
+
+       ret = copy_from_user(&req->event, &u_info->event, sizeof(int));
+       if (ret)
+               GOTO_ERR_unlock;
+       ret = copy_from_user(&req->status, &u_info->http_status, sizeof(int));
+       if (ret)
+               GOTO_ERR_unlock;
+       ret = copy_from_user(&req->bytes_sent, &u_info->bytes_sent, sizeof(int));
+       if (ret)
+               GOTO_ERR_unlock;
+       ret = copy_from_user(&req->private, &u_info->priv, sizeof(req->private));
+       if (ret)
+               GOTO_ERR_unlock;
+
+       switch (action) {
+
+               case TUX_ACTION_EVENTLOOP:
+eventloop:
+                       req = ti->userspace_req;
+                       if (req)
+                               zap_userspace_req(req);
+                       ret = event_loop(ti);
+                       goto out_userreq;
+
+               /*
+                * Module forces keepalive off, server will close
+                * the connection.
+                */
+               case TUX_ACTION_FINISH_CLOSE_REQ:
+                       clear_keepalive(req);
+
+               case TUX_ACTION_FINISH_REQ:
+                       finish_userspace_req(req);
+                       goto eventloop;
+
+               case TUX_ACTION_REDIRECT_REQ:
+
+                       ti->userspace_req = NULL;
+                       req->usermode = 0;
+                       req->private = 0;
+                       req->error = TUX_ERROR_REDIRECT;
+                       DEC_STAT(nr_userspace_pending);
+                       add_tux_atom(req, redirect_request);
+                       add_req_to_workqueue(req);
+
+                       goto eventloop;
+
+               case TUX_ACTION_POSTPONE_REQ:
+
+                       postpone_request(req);
+                       ti->userspace_req = NULL;
+                       ret = TUX_RETURN_USERSPACE_REQUEST;
+                       break;
+
+               case TUX_ACTION_GET_OBJECT:
+                       release_req_dentry(req);
+                       ret = strncpy_from_user(req->objectname,
+                               u_info->objectname, MAX_URI_LEN-1);
+                       if (ret <= 0) {
+                               req->objectname[0] = 0;
+                               req->objectname_len = 0;
+                               GOTO_ERR_unlock;
+                       }
+                       req->objectname[ret] = 0; // string delimit
+                       req->objectname_len = ret;
+
+                       Dprintk("got objectname {%s} (%d) from user-space req %p (req: %p).\n", req->objectname, req->objectname_len, u_info, req);
+                       req->ti->userspace_req = NULL;
+                       DEC_STAT(nr_userspace_pending);
+                       user_get_object(req, 0);
+                       goto eventloop;
+
+               case TUX_ACTION_READ_OBJECT:
+               {
+                       u64 u_addr;
+                       char *addr;
+                       loff_t ppos = 0;
+                       struct file *filp;
+
+                       if (!req->dentry)
+                               GOTO_ERR_unlock;
+                       
+                       ret = copy_from_user(&u_addr, &u_info->object_addr,
+                                       sizeof(u_addr));
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       addr = (char *)(unsigned long)u_addr;
+                       filp = dentry_open(req->dentry, O_RDONLY, 0);
+                       dget(req->dentry);
+                       generic_file_read(filp, addr, req->total_file_len, &ppos);
+                       fput(filp);
+                       ret = TUX_RETURN_USERSPACE_REQUEST;
+                       break;
+               }
+
+               case TUX_ACTION_SEND_OBJECT:
+                       if (!req->dentry)
+                               GOTO_ERR_unlock;
+                       req->ti->userspace_req = NULL;
+                       DEC_STAT(nr_userspace_pending);
+                       user_send_object(req, 0);
+                       goto eventloop;
+
+               case TUX_ACTION_SEND_BUFFER:
+               {
+                       u64 u_addr;
+                       char *addr;
+                       unsigned int len;
+
+                       ret = copy_from_user(&u_addr,
+                                       &u_info->object_addr, sizeof(u_addr));
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       addr = (char *)(unsigned long)u_addr;
+                       ret = copy_from_user(&len,
+                                       &u_info->objectlen, sizeof(addr));
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       if ((int)len <= 0)
+                               GOTO_ERR_unlock;
+
+                       ret = -EFAULT;
+                       if (!access_ok(VERIFY_READ, addr, len))
+                               GOTO_ERR_unlock;
+                       req->userbuf = addr;
+                       req->userlen = len;
+
+                       req->ti->userspace_req = NULL;
+                       DEC_STAT(nr_userspace_pending);
+                       user_send_buffer(req, 0);
+                       ret = 0;
+                       goto eventloop;
+               }
+
+               case TUX_ACTION_READ_HEADERS:
+               {
+                       char *addr;
+                       u64 u_addr;
+
+                       ret = copy_from_user(&u_addr, &u_info->object_addr,
+                                       sizeof(u_addr));
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       addr = (char *)(unsigned long)u_addr;
+                       ret = copy_to_user(&u_info->objectlen,
+                                &req->headers_len, sizeof(req->headers_len));
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       ret = copy_to_user(addr,req->headers, req->headers_len);
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       break;
+               }
+
+               case TUX_ACTION_READ_POST_DATA:
+               {
+                       char *addr;
+                       unsigned int size;
+                       u64 u_addr;
+
+                       ret = copy_from_user(&u_addr, &u_info->object_addr,
+                                       sizeof(u_addr));
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       addr = (char *)(unsigned long)u_addr;
+
+                       ret = copy_from_user(&size, &u_info->objectlen,
+                                       sizeof(size));
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       Dprintk("READ_POST_DATA: got %p(%d).\n", addr, size);
+                       if (req->post_data_len < size)
+                               size = req->post_data_len;
+                       Dprintk("READ_POST_DATA: writing %d.\n", size);
+                       ret = copy_to_user(&u_info->objectlen,
+                                               &size, sizeof(size));
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       ret = copy_to_user(addr, req->post_data_str, size);
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       goto out;
+               }
+
+               case TUX_ACTION_WATCH_PROXY_SOCKET:
+               {
+                       struct socket *sock;
+                       int err;
+                       long fd;
+                       u64 u_addr;
+
+                       ret = copy_from_user(&u_addr, &u_info->object_addr,
+                                       sizeof(u_addr));
+                       if (ret)
+                               GOTO_ERR_unlock;
+                       fd = (int)(unsigned long)u_addr;
+
+                       sock = sockfd_lookup(fd, &err);
+                       if (!sock)
+                               GOTO_ERR_unlock;
+                       put_data_sock(req);
+                       link_tux_data_socket(req, sock);
+
+                       ret = 0;
+                       goto out;
+               }
+
+               case TUX_ACTION_WAIT_PROXY_SOCKET:
+               {
+                       if (!req->data_sock)
+                               GOTO_ERR_unlock;
+                       if (socket_input(req->data_sock)) {
+                               ret = TUX_RETURN_USERSPACE_REQUEST;
+                               goto out_userreq;
+                       }
+                       spin_lock_irq(&req->ti->work_lock);
+                       add_keepalive_timer(req);
+                       if (test_and_set_bit(0, &req->idle_input))
+                               TUX_BUG();
+                       spin_unlock_irq(&req->ti->work_lock);
+                       if (socket_input(req->data_sock)) {
+                               unidle_req(req);
+                               ret = TUX_RETURN_USERSPACE_REQUEST;
+                               goto out_userreq;
+                       }
+                       req->ti->userspace_req = NULL;
+                       goto eventloop;
+               }
+
+               default:
+                       GOTO_ERR_unlock;
+       }
+
+out_userreq:
+       req = ti->userspace_req;
+       if (req) {
+               ret = prepare_userspace_req(ti, u_info);
+               if (ret < 0) {
+                       TDprintk("hm, user req %p returned %d, zapping.\n",
+                               req, ret);
+                       zap_userspace_req(req);
+                       goto eventloop;
+               }
+       }
+out:
+       if (action != TUX_ACTION_CURRENT_DATE)
+               Dprintk("sys_tux(%d, %p) returning %d.\n", action, u_info, ret);
+       while (unlikely(test_thread_flag(TIF_NEED_RESCHED))) {
+               __set_task_state(current, TASK_RUNNING);
+               schedule();
+       }
+       return ret;
+err_unlock:
+err_no_unlock:
+       Dprintk("sys_tux(%d, %p) returning -EINVAL (ret:%d)!\n", action, u_info, ret);
+       while (unlikely(test_thread_flag(TIF_NEED_RESCHED))) {
+               __set_task_state(current, TASK_RUNNING);
+               schedule();
+       }
+       return -EINVAL;
+}
+
+/*
+ * This gets called if a TUX thread does an exit().
+ */
+void tux_exit (void)
+{
+       __sys_tux(TUX_ACTION_STOPTHREAD, NULL);
+}
+
+int tux_init(void)
+{
+       start_sysctl();
+
+#if CONFIG_TUX_MODULE
+       spin_lock(&tux_module_lock);
+       sys_tux_ptr = __sys_tux;
+       tux_module = THIS_MODULE;
+       spin_unlock(&tux_module_lock);
+#endif
+
+       return 0;
+}
+
+void tux_cleanup (void)
+{
+#if CONFIG_TUX_MODULE
+       spin_lock(&tux_module_lock);
+       tux_module = NULL;
+       sys_tux_ptr = NULL;
+       spin_unlock(&tux_module_lock);
+#endif
+
+       end_sysctl();
+}
+
+module_init(tux_init)
+module_exit(tux_cleanup)
+
+MODULE_LICENSE("GPL");
+
diff --git a/net/tux/mod.c b/net/tux/mod.c
new file mode 100644 (file)
index 0000000..1489114
--- /dev/null
@@ -0,0 +1,262 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * mod.c: loading/registering of dynamic TUX modules
+ */
+
+#include <net/tux.h>
+#include <linux/kmod.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+spinlock_t tuxmodules_lock = SPIN_LOCK_UNLOCKED;
+static LIST_HEAD(tuxmodules_list);
+
+tcapi_template_t * get_first_usermodule (void)
+{
+       tcapi_template_t *tcapi;
+       struct list_head *head, *curr, *next;
+
+       spin_lock(&tuxmodules_lock);
+       head = &tuxmodules_list;
+       next = head->next;
+
+       while ((curr = next) != head) {
+               tcapi = list_entry(curr, tcapi_template_t, modules);
+               next = curr->next;
+               if (tcapi->userspace_id) {
+                       spin_unlock(&tuxmodules_lock);
+                       return tcapi;
+               }
+       }
+       spin_unlock(&tuxmodules_lock);
+       return NULL;
+}
+
+static tcapi_template_t * lookup_module (const char *vfs_name)
+{
+       tcapi_template_t *tcapi;
+       struct list_head *head, *curr, *next;
+
+       while (*vfs_name == '/')
+               vfs_name++;
+       Dprintk("looking up TUX module {%s}.\n", vfs_name);
+       head = &tuxmodules_list;
+       next = head->next;
+
+       while ((curr = next) != head) {
+               tcapi = list_entry(curr, tcapi_template_t, modules);
+               next = curr->next;
+               Dprintk("checking module {%s} == {%s}?\n", vfs_name, tcapi->vfs_name);
+               if (!strcmp(tcapi->vfs_name, vfs_name))
+                       return tcapi;
+       }
+       return NULL;
+}
+
+/*
+ * Attempt to load a TUX application module.
+ * This is the slow path, we cache ('link') the module's
+ * API vector to the inode.
+ * The module loading path is serialized, and we handshake
+ * with the loaded module and fetch its API vector.
+ */
+tcapi_template_t * lookup_tuxmodule (const char *filename)
+{
+       tcapi_template_t *tcapi;
+
+       spin_lock(&tuxmodules_lock);
+       tcapi = lookup_module(filename);
+       if (!tcapi)
+               Dprintk("did not find module vfs:{%s}\n", filename);
+       spin_unlock(&tuxmodules_lock);
+       return tcapi;
+}
+
+
+int register_tuxmodule (tcapi_template_t *tcapi)
+{
+       int ret = -EEXIST;
+
+       spin_lock(&tuxmodules_lock);
+
+       if (lookup_module(tcapi->vfs_name)) {
+               Dprintk("module with VFS binding '%s' already registered!\n",
+                                                tcapi->vfs_name);
+               goto out;
+       } 
+
+       list_add(&tcapi->modules, &tuxmodules_list);
+       ret = 0;
+       Dprintk("TUX module %s registered.\n", tcapi->vfs_name);
+out:
+       spin_unlock(&tuxmodules_lock);
+
+       return ret;
+}
+
+void unregister_all_tuxmodules (void)
+{
+       tcapi_template_t *tcapi;
+       struct list_head *curr;
+
+       spin_lock(&tuxmodules_lock);
+       while (((curr = tuxmodules_list.next)) != &tuxmodules_list) {
+               tcapi = list_entry(curr, tcapi_template_t, modules);
+               list_del(curr);
+               kfree(tcapi->vfs_name);
+               kfree(tcapi);
+       }
+       spin_unlock(&tuxmodules_lock);
+}
+
+tcapi_template_t * unregister_tuxmodule (char *vfs_name)
+{
+       tcapi_template_t *tcapi;
+       int err = 0;
+
+       spin_lock(&tuxmodules_lock);
+       tcapi = lookup_module(vfs_name);
+       if (!tcapi) {
+               Dprintk("huh, module %s not registered??\n", vfs_name);
+               err = -1;
+       } else {
+               list_del(&tcapi->modules);
+               Dprintk("TUX module %s unregistered.\n", vfs_name);
+       }
+       spin_unlock(&tuxmodules_lock);
+
+       return tcapi;
+}
+
+static int check_module_version (user_req_t *u_info)
+{
+       int major, minor, patch, ret;
+
+       ret = copy_from_user(&major, &u_info->version_major, sizeof(int));
+       ret += copy_from_user(&minor, &u_info->version_minor, sizeof(int));
+       ret += copy_from_user(&patch, &u_info->version_patch, sizeof(int));
+       if (ret)
+               return -EFAULT;
+
+       if ((major != TUX_MAJOR_VERSION) || (minor > TUX_MINOR_VERSION)) {
+
+               printk(KERN_ERR "TUX: module version %d:%d incompatible with kernel version %d:%d!\n", major, minor, TUX_MAJOR_VERSION, TUX_MINOR_VERSION);
+               return -EINVAL;
+       }
+       return 0;
+}
+
+int user_register_module (user_req_t *u_info)
+{
+       int idx, len, ret;
+       tcapi_template_t *tcapi;
+       char modulename [MAX_URI_LEN+1];
+
+       ret = check_module_version(u_info);
+       if (ret)
+               return ret;
+
+       /*
+        * Check module name length.
+        */
+       ret = strnlen_user(u_info->objectname, MAX_URI_LEN+2);
+       if (ret < 0)
+               goto out;
+       ret = -EINVAL;
+       if (ret >= MAX_URI_LEN)
+               goto out;
+
+       Dprintk("register user-module, %p.\n", u_info);
+       ret = strncpy_from_user(modulename, u_info->objectname, MAX_URI_LEN);
+       if (ret < 0)
+               goto out;
+       modulename[ret] = 0;
+       Dprintk("... user-module is: {%s}.\n", modulename);
+       len = strlen(modulename);
+       if (!len)
+               printk(KERN_ERR "no module name provided: please upgrade your TUX user-space utilities!\n");
+       if (!len || (len > MAX_URI_LEN))
+               return -EINVAL;
+       Dprintk("... user-module len is: %d.\n", len);
+
+       ret = copy_from_user(&idx, &u_info->module_index, sizeof(int));
+       if (ret || !idx)
+               goto out;
+       Dprintk("... user-module index is: %d.\n", idx);
+
+       ret = -ENOMEM;
+       tcapi = (tcapi_template_t *) kmalloc(sizeof(*tcapi), GFP_KERNEL);
+       if (!tcapi)
+               goto out;
+       memset(tcapi, 0, sizeof(*tcapi));
+
+       tcapi->vfs_name = (char *) kmalloc(len+1, GFP_KERNEL);
+       if (!tcapi->vfs_name) {
+               kfree(tcapi);
+               goto out;
+       }
+       strcpy(tcapi->vfs_name, modulename);
+       tcapi->userspace_id = idx;
+
+       Dprintk("... registering module {%s}.\n", tcapi->vfs_name);
+       ret = register_tuxmodule(tcapi);
+out:
+       return ret;
+}
+
+int user_unregister_module (user_req_t *u_info)
+{
+       int len, ret;
+       tcapi_template_t *tcapi;
+       char modulename [MAX_URI_LEN+1];
+
+       /*
+        * Check module name length.
+        */
+       ret = strnlen_user(u_info->objectname, MAX_URI_LEN+2);
+       if (ret < 0)
+               goto out;
+       ret = -EINVAL;
+       if (ret >= MAX_URI_LEN)
+               goto out;
+       Dprintk("unregister user-module, %p.\n", u_info);
+       ret = strncpy_from_user(modulename, u_info->objectname, MAX_URI_LEN);
+       if (ret <= 0)
+               goto out;
+       modulename[ret] = 0;
+       Dprintk("... user-module is: {%s}.\n", modulename);
+       len = strlen(modulename);
+       if (!len || (len > MAX_URI_LEN))
+               return -EINVAL;
+       Dprintk("... user-module len is: %d.\n", len);
+
+       Dprintk("... unregistering module {%s}.\n", modulename);
+       tcapi = unregister_tuxmodule(modulename);
+       ret = -EINVAL;
+       if (tcapi) {
+               ret = 0;
+               kfree(tcapi->vfs_name);
+               kfree(tcapi);
+       }
+out:
+       return ret;
+}
+
diff --git a/net/tux/output.c b/net/tux/output.c
new file mode 100644 (file)
index 0000000..2d0f073
--- /dev/null
@@ -0,0 +1,352 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * output.c: Send data to clients
+ */
+
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+int send_sync_buf (tux_req_t *req, struct socket *sock, const char *buf, const size_t length, unsigned long flags)
+{
+       struct msghdr msg;
+       struct iovec iov;
+       int len, written = 0, left = length;
+       struct tcp_opt *tp = tcp_sk(sock->sk);
+
+       tp->nonagle = 2;
+
+       msg.msg_name     = 0;
+       msg.msg_namelen  = 0;
+       msg.msg_iov      = &iov;
+       msg.msg_iovlen   = 1;
+       msg.msg_control  = NULL;
+       msg.msg_controllen = 0;
+       msg.msg_flags    = flags | MSG_NOSIGNAL;
+repeat_send:
+       msg.msg_iov->iov_len = left;
+       msg.msg_iov->iov_base = (char *) buf + written;
+
+       len = sock_sendmsg(sock, &msg, left);
+
+       Dprintk("sendmsg ret: %d, written: %d, left: %d.\n", len,written,left);
+       if ((len == -ERESTARTSYS) || (!(flags & MSG_DONTWAIT) &&
+                        (len == -EAGAIN))) {
+               flush_all_signals();
+               goto repeat_send;
+       }
+       if (len > 0) {
+               written += len;
+               left -= len;
+               if (left)
+                       goto repeat_send;
+       }
+       if (len >= 0) {
+               if (written != length)
+                       TUX_BUG();
+               if (left)
+                       TUX_BUG();
+       }
+       if (req && (written > 0))
+               req->bytes_sent += written;
+       Dprintk("sendmsg FINAL ret: %d, written: %d, left: %d.\n", len,written,left);
+       return written ? written : len;
+}
+
+unsigned int tux_zerocopy_sendfile = 1;
+
+typedef struct sock_send_desc
+{
+       struct socket *sock;
+       tux_req_t *req;
+} sock_send_desc_t;
+
+static int sock_send_actor (read_descriptor_t * desc, struct page *page,
+                               unsigned long offset, unsigned long orig_size)
+{
+       sock_send_desc_t *sock_desc = (sock_send_desc_t *)desc->buf;
+       struct socket *sock = sock_desc->sock;
+       tux_req_t *req = sock_desc->req;
+       unsigned int flags;
+       ssize_t written;
+       char *buf = NULL;
+       unsigned int size;
+
+       flags = MSG_DONTWAIT | MSG_NOSIGNAL;
+       if (desc->count < orig_size)
+               orig_size = desc->count;
+       if (desc->count > orig_size)
+               flags |= MSG_MORE;
+       Dprintk("sock_send_actor(), page: %p, offset: %ld, orig_size: %ld, sock: %p, desc->count: %d, desc->written: %d, MSG_MORE: %d.\n", page, offset, orig_size, sock, desc->count, desc->written, flags & MSG_MORE);
+
+       if (req->content_gzipped >= 2) {
+               unsigned int gzip_left;
+               struct msghdr msg;
+               struct iovec iov;
+               mm_segment_t oldmm;
+               char *kaddr = kmap(page);
+               __u32 in_len, out_len;
+               out_len = orig_size*101/100 + 12;
+               buf = tux_kmalloc(out_len);
+               in_len = orig_size;
+               size = out_len;
+               gzip_left = 0;
+// 8b1f 0808 fdc4 3bd8 0300 79
+buf[1] = 0x8b; buf[0] = 0x1f; buf[3] = 0x08; buf[2] = 0x08;
+buf[5] = 0xfd; buf[4] = 0xc4; buf[7] = 0x3b; buf[6] = 0xd8;
+buf[9] = 0x03; buf[8] = 0x00; buf[10] = 0x79;
+               size += 11;
+               Dprintk("pre-compress: in_len: %d, out_len: %d, gzip_left: %d, uncompressed size: %d.\n", in_len, out_len, gzip_left, size);
+               gzip_left = tux_gzip_compress(req, kaddr, buf+11, &in_len, &out_len);
+               size -= out_len;
+ buf[11] = 0x79; buf[12] = 0x00;
+
+               Dprintk("post-compress: in_len: %d, out_len: %d, gzip_left: %d, compressed size: %d.\n", in_len, out_len, gzip_left, size);
+               kunmap(page);
+               msg.msg_name = NULL;
+               msg.msg_namelen = 0;
+               msg.msg_iov = &iov;
+               msg.msg_iovlen = 1;
+               msg.msg_control = NULL;
+               msg.msg_controllen = 0;
+               flags &= ~MSG_DONTWAIT;
+               msg.msg_flags = flags;
+               iov.iov_base = buf;
+               iov.iov_len = size;
+
+               oldmm = get_fs(); set_fs(KERNEL_DS);
+               written = sock_sendmsg(sock, &msg, size);
+               set_fs(oldmm);
+
+               Dprintk("buf: %p, offset: %ld, size: %d, written: %d.\n", buf, offset, size, written);
+               if (written == size)
+                       written = orig_size;
+               else
+                       written = size;
+                       
+       } else {
+               size = orig_size;
+               if (tux_zerocopy_sendfile && sock->ops->sendpage &&
+                   (sock->sk->sk_route_caps&NETIF_F_SG)) {
+                       written = sock->ops->sendpage(sock, page, offset, size, flags);
+               } else {
+                       struct msghdr msg;
+                       struct iovec iov;
+                       char *kaddr;
+                       mm_segment_t oldmm;
+       
+                       if (offset+size > PAGE_SIZE)
+                               return -EFAULT;
+
+                       kaddr = kmap(page);
+       
+                       msg.msg_name = NULL;
+                       msg.msg_namelen = 0;
+                       msg.msg_iov = &iov;
+                       msg.msg_iovlen = 1;
+                       msg.msg_control = NULL;
+                       msg.msg_controllen = 0;
+                       msg.msg_flags = flags;
+                       iov.iov_base = kaddr + offset;
+                       iov.iov_len = size;
+
+                       oldmm = get_fs(); set_fs(KERNEL_DS);
+                       written = sock_sendmsg(sock, &msg, size);
+                       set_fs(oldmm);
+
+                       Dprintk("kaddr: %p, offset: %ld, size: %d, written: %d.\n", kaddr, offset, size, written);
+                       kunmap(page);
+               }
+       }
+       if (written < 0) {
+               desc->error = written;
+               written = 0;
+       }
+       Dprintk("desc->count: %d, desc->written: %d, written: %d.\n", desc->count, desc->written, written);
+       desc->count -= written;
+       if ((int)desc->count < 0)
+               TUX_BUG();
+       desc->written += written;
+
+       if (buf)
+               kfree(buf);
+
+       return written;
+}
+
+/*
+ * Return 1 if the output space condition went away
+ * before adding the handler.
+ */
+int add_output_space_event (tux_req_t *req, struct socket *sock)
+{
+       struct sock *sk = sock->sk;
+       /*
+        * blocked due to socket IO?
+        */
+       spin_lock_irq(&req->ti->work_lock);
+       add_keepalive_timer(req);
+       if (test_and_set_bit(0,&req->wait_output_space))
+               TUX_BUG();
+       INC_STAT(nr_output_space_pending);
+
+       if ((sk->sk_state == TCP_ESTABLISHED) && enough_wspace(sk)) {
+               if (test_and_clear_bit(0, &req->wait_output_space)) {
+                       DEC_STAT(nr_output_space_pending);
+                       del_keepalive_timer(req);
+                       spin_unlock_irq(&req->ti->work_lock);
+                       return 1;
+               }
+       }
+       spin_unlock_irq(&req->ti->work_lock);
+
+       return 0;
+}
+
+#define SEND_BLOCKSIZE (164*1024)
+
+int generic_send_file (tux_req_t *req, struct socket *sock, int cachemiss)
+{
+       sock_send_desc_t sock_desc;
+       int len, want, nonblock = !cachemiss;
+       struct tcp_opt *tp = tcp_sk(sock->sk);
+
+       tp->nonagle = 2;
+
+       sock_desc.sock = sock;
+       sock_desc.req = req;
+
+repeat:
+       Dprintk("generic_send_file(%p,%d,%p) called, f_pos: %Ld, output_len: %Ld.\n", req, nonblock, sock, req->in_file.f_pos, req->output_len);
+
+       if (req->proto->check_req_err(req, cachemiss))
+               return -1;
+       if (connection_too_fast(req) == 2) {
+               len = -5;
+               goto out;
+       }
+       if (req->total_file_len < req->in_file.f_pos)
+               TUX_BUG();
+
+       req->desc.written = 0;
+       /*
+        * Careful, output_len can be 64-bit, while 'want' can be 32-bit.
+        */
+       if (req->output_len > SEND_BLOCKSIZE)
+               want = SEND_BLOCKSIZE;
+       else
+               want = req->output_len;
+       req->desc.count = want;
+       req->desc.buf = (char *) &sock_desc;
+       req->desc.error = 0;
+       Dprintk("sendfile(), desc.count: %d.\n", req->desc.count);
+       do_generic_file_read(&req->in_file, &req->in_file.f_pos, &req->desc, sock_send_actor, nonblock);
+       if (req->desc.written > 0) {
+               req->bytes_sent += req->desc.written;
+               req->output_len -= req->desc.written;
+       }
+       if (!nonblock && (req->desc.error == -EWOULDBLOCKIO))
+               TUX_BUG();
+       Dprintk("sendfile() wrote: %d bytes.\n", req->desc.written);
+       if (req->output_len && !req->desc.written && !req->desc.error) {
+#if CONFIG_TUX_DEBUG
+               req->bytes_expected = 0;
+#endif
+               req->in_file.f_pos = 0;
+               req->error = TUX_ERROR_CONN_CLOSE;
+               zap_request(req, cachemiss);
+               return -1;
+       }
+
+       switch (req->desc.error) {
+
+       case -EWOULDBLOCKIO:
+               len = -3;
+               break;
+       case -EAGAIN:
+no_write_space:
+               Dprintk("sk->wmem_queued: %d, sk->sndbuf: %d.\n",
+                       sock->sk->sk_wmem_queued, sock->sk->sk_sndbuf);
+               len = -4;
+               break;
+       default:
+               len = req->desc.written;
+#if CONFIG_TUX_DEBUG
+               if (req->desc.error)
+                       TDprintk("TUX: sendfile() returned error %d (signals pending: %08lx)!\n", req->desc.error, current->pending.signal.sig[0]);
+#endif
+               if (!req->desc.error) {
+                       if (req->output_len < 0)
+                               BUG();
+                       if (req->output_len) {
+                               if (test_bit(SOCK_NOSPACE, &sock->flags))
+                                       goto no_write_space;
+                               goto repeat;
+                       }
+               }
+#if CONFIG_TUX_DEBUG
+               if (req->desc.written != want)
+                       TDprintk("TUX: sendfile() wrote %d bytes, wanted %d! (pos %Ld) (signals pending: %08lx).\n", req->desc.written, want, req->in_file.f_pos, current->pending.signal.sig[0]);
+               else
+                       Dprintk("TUX: sendfile() FINISHED for req %p, wrote %d bytes.\n", req, req->desc.written);
+               req->bytes_expected = 0;
+#endif
+               break;
+       }
+
+out:
+       Dprintk("sendfile() wrote %d bytes.\n", len);
+
+       return len;
+}
+
+static int file_fetch_actor (read_descriptor_t * desc, struct page *page,
+                               unsigned long offset, unsigned long size)
+{
+       if (desc->count < size)
+               size = desc->count;
+
+       desc->count -= size;
+       desc->written += size;
+
+       return size;
+}
+
+int tux_fetch_file (tux_req_t *req, int nonblock)
+{
+       int len;
+
+       req->desc.written = 0;
+       req->desc.count = req->output_len;
+       req->desc.buf = NULL;
+       req->desc.error = 0;
+
+       do_generic_file_read(&req->in_file, &req->in_file.f_pos, &req->desc,
+                                       file_fetch_actor, nonblock);
+       if (nonblock && (req->desc.error == -EWOULDBLOCKIO))
+               return 1;
+       len = req->desc.written;
+       if (req->desc.error)
+               Dprintk("fetchfile() returned %d error!\n", req->desc.error);
+       Dprintk("fetchfile() fetched %d bytes.\n", len);
+       return 0;
+}
+
diff --git a/net/tux/parser.h b/net/tux/parser.h
new file mode 100644 (file)
index 0000000..f355c1e
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, Ingo Molnar <mingo@redhat.com>
+ *
+ * parser.h: generic parsing routines
+ */
+
+#define get_c(ptr,left)                                                \
+({                                                             \
+       char __ret;                                     \
+                                                               \
+       if (!left)                                              \
+               GOTO_INCOMPLETE;                                \
+       left--;                                                 \
+       __ret = *((ptr)++);                                     \
+       if (!__ret)                                             \
+               GOTO_REDIR;                                     \
+       __ret;                                                  \
+})
+
+#define PARSE_TOKEN(ptr,str,left)                              \
+       ({                                                      \
+               int __ret;                                      \
+                                                               \
+               if (!left)                                      \
+                       GOTO_INCOMPLETE;                        \
+               if (sizeof(str)-1 > left) {                     \
+                       if (memcmp(ptr, str, left))             \
+                               GOTO_REDIR;                     \
+                       GOTO_INCOMPLETE;                        \
+               }                                               \
+                                                               \
+               if (memcmp(ptr, str, sizeof(str)-1))            \
+                       __ret = 0;                              \
+               else {                                          \
+                       ptr += sizeof(str)-1;                   \
+                       left -= sizeof(str)-1;                  \
+                       __ret = 1;                              \
+               }                                               \
+               __ret;                                          \
+       })
+
+#define PARSE_METHOD(req,ptr,name,left)                                \
+       ({                                                      \
+               int __ret;                                      \
+                                                               \
+               if (PARSE_TOKEN(ptr,#name" ",left)) {           \
+                       req->method = METHOD_##name;            \
+                       __ret = 1;                              \
+               } else                                          \
+                       __ret = 0;                              \
+               __ret;                                          \
+       })
+
+#define COPY_LINE(ptr,target,left)                             \
+       do {                                                    \
+               char prev_c = 0, c;                             \
+               while (((c = get_c(ptr,left))) != '\n') \
+                       *target++ = prev_c = c;                 \
+               if (prev_c != '\r')                             \
+                       GOTO_REDIR;                             \
+       } while (0)
+
+#define COPY_LINE_TOLOWER(ptr,target,left,limit)               \
+       do {                                                    \
+               char prev_c = 0, c;                             \
+               while (((c = get_c(ptr,left))) != '\n') {       \
+                       if ((c >= 'A') && (c <= 'Z'))           \
+                               c -= 'A'-'a';                   \
+                       *target++ = prev_c = c;                 \
+                       if (target == (limit))                  \
+                               GOTO_REDIR;                     \
+               }                                               \
+               if (prev_c != '\r')                             \
+                       GOTO_REDIR;                             \
+       } while (0)
+
+#define COPY_FIELD(ptr,target,left)                            \
+       do {                                                    \
+               char c;                                         \
+               while ((c = get_c(ptr,left)) != ' ')            \
+                       *target++ = c;                          \
+       } while (0)
+
+#define SKIP_LINE(ptr,left)                                    \
+       do {                                                    \
+               char prev_c = 0, c;                             \
+               while (((c = get_c(ptr,left))) != '\n')         \
+                       prev_c = c;                             \
+               if (prev_c != '\r')                             \
+                       GOTO_REDIR;                             \
+       } while (0)
+
+#define SKIP_WHITESPACE(curr,left)             \
+do {                                           \
+       while ((left) && (*(curr) == ' '))      \
+               (curr)++, (left)--;             \
+       if (!(left))                            \
+               GOTO_REDIR;                     \
+} while (0)
+
diff --git a/net/tux/postpone.c b/net/tux/postpone.c
new file mode 100644 (file)
index 0000000..d4a693b
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * postpone.c: postpone/continue userspace requests
+ */
+
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+void postpone_request (tux_req_t *req)
+{
+       if (!req->usermode)
+               TUX_BUG();
+       INC_STAT(nr_postpone_pending);
+       req->postponed = 1;
+}
+
+/*
+ * Continue a postponed request. The request will show up in the
+ * userspace queue and will be handled by the fast thread.
+ * A request can only be postponed in a TUX process, but can be
+ * continued from any process that has access to the socket file
+ * descriptor.
+ */
+int continue_request (int fd)
+{
+       threadinfo_t *ti;
+       struct socket *sock;
+       tux_req_t *req;
+       int err;
+
+       sock = sockfd_lookup(fd, &err);
+       if (!sock || !sock->sk)
+               goto out;
+       req = sock->sk->sk_user_data;
+
+       err = -EINVAL;
+       if (!req)
+               goto out_put;
+       ti = req->ti;
+       if (!req->postponed)
+               goto out_unlock_put;
+       if (!req->usermode)
+               TUX_BUG();
+
+       req->postponed = 0;
+       DEC_STAT(nr_postpone_pending);
+
+       Dprintk("continuing postponed req %p.\n", req);
+       add_req_to_workqueue(req);
+
+out_unlock_put:
+       err = 0;
+out_put:
+       fput(sock->file);
+out:
+       return err;
+}
+
diff --git a/net/tux/proc.c b/net/tux/proc.c
new file mode 100644 (file)
index 0000000..2973a48
--- /dev/null
@@ -0,0 +1,1190 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * proc.c: /proc/sys/tux handling
+ */
+
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+char tux_common_docroot[200] = "/var/www/tux/";
+char tux_http_subdocroot[200] = "";
+char tux_ftp_subdocroot[200] = "";
+char tux_logfile[200] = "/var/log/tux";
+char tux_cgiroot[200] = "/var/www/tux/cgiroot/";
+char tux_404_page[200] = "404.html";
+char tux_default_vhost[200] = "default";
+char tux_extra_html_header[600];
+unsigned int tux_extra_html_header_size = 0;
+
+int tux_cgi_uid = -1;
+int tux_cgi_gid = -1;
+unsigned int tux_clientport = 8080;
+unsigned int tux_logging = 0;
+unsigned int tux_threads = 2;
+unsigned int tux_max_connect = 10000;
+unsigned int tux_max_keepalives = 10000;
+unsigned int tux_max_backlog = 2048;
+unsigned int tux_keepalive_timeout = 0;
+unsigned int tux_max_output_bandwidth = 0;
+unsigned int tux_defer_accept = 1;
+unsigned int tux_mode_forbidden = 0 /*S_IXUGO*/; /* do not allow executable (CGI) files */
+unsigned int tux_mode_allowed = S_IROTH; /* allow access if read-other is set */
+unsigned int tux_virtual_server = 0;
+unsigned int tux_ftp_virtual_server = 0;
+unsigned int mass_hosting_hash = 0;
+unsigned int strip_host_tail = 0;
+unsigned int tux_max_object_size = 0;
+unsigned int log_cpu_mask = ~0;
+unsigned int tux_compression = 0;
+unsigned int tux_noid = 0;
+unsigned int tux_cgi_inherit_cpu = 0;
+unsigned int tux_cgi_cpu_mask = ~0;
+unsigned int tux_zerocopy_header = 1;
+unsigned int tux_max_free_requests = 1000;
+unsigned int tux_ignore_query = 0;
+unsigned int tux_all_userspace = 0;
+unsigned int tux_redirect_logging = 1;
+unsigned int tux_max_header_len = 3000;
+unsigned int tux_referer_logging = 0;
+unsigned int tux_generate_etags = 1;
+unsigned int tux_generate_last_mod = 1;
+unsigned int tux_generate_cache_control = 1;
+unsigned int tux_ip_logging = 1;
+unsigned int tux_ftp_wait_close = 1;
+unsigned int tux_ftp_log_retr_only = 0;
+unsigned int tux_hide_unreadable = 1;
+unsigned int tux_http_dir_indexing = 0;
+unsigned int tux_log_incomplete = 0;
+unsigned int tux_cpu_offset = 0;
+unsigned int tux_ftp_login_message = 0;
+
+static struct ctl_table_header *tux_table_header;
+
+static ctl_table tux_table[] = {
+       {       NET_TUX_DOCROOT,
+               "documentroot",
+               &tux_common_docroot,
+               sizeof(tux_common_docroot),
+               0644,
+               NULL,
+               proc_dostring,
+               &sysctl_string,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_DOCROOT,
+               "http_subdocroot",
+               &tux_http_subdocroot,
+               sizeof(tux_http_subdocroot),
+               0644,
+               NULL,
+               proc_dostring,
+               &sysctl_string,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_DOCROOT,
+               "ftp_subdocroot",
+               &tux_ftp_subdocroot,
+               sizeof(tux_ftp_subdocroot),
+               0644,
+               NULL,
+               proc_dostring,
+               &sysctl_string,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_LOGFILE,
+               "logfile",
+               &tux_logfile,
+               sizeof(tux_logfile),
+               0644,
+               NULL,
+               proc_dostring,
+               &sysctl_string,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_THREADS,
+               "threads",
+               &tux_threads,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_KEEPALIVE_TIMEOUT,
+               "keepalive_timeout",
+               &tux_keepalive_timeout,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_MAX_KEEPALIVE_BW,
+               "max_output_bandwidth",
+               &tux_max_output_bandwidth,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_DEFER_ACCEPT,
+               "defer_accept",
+               &tux_defer_accept,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_MAX_BACKLOG,
+               "max_backlog",
+               &tux_max_backlog,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_MAX_CONNECT,
+               "max_connect",
+               &tux_max_connect,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_MAX_KEEPALIVES,
+               "max_keepalives",
+               &tux_max_keepalives,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_MODE_FORBIDDEN,
+               "mode_forbidden",
+               &tux_mode_forbidden,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_MODE_ALLOWED,
+               "mode_allowed",
+               &tux_mode_allowed,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CGI_UID,
+               "cgi_uid",
+               &tux_cgi_uid,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CGI_GID,
+               "cgi_gid",
+               &tux_cgi_gid,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CGIROOT,
+               "cgiroot",
+               &tux_cgiroot,
+               sizeof(tux_cgiroot),
+               0644,
+               NULL,
+               proc_dostring,
+               &sysctl_string,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_404_PAGE,
+               "404_page",
+               &tux_404_page,
+               sizeof(tux_404_page),
+               0644,
+               NULL,
+               proc_dostring,
+               &sysctl_string,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_404_PAGE,
+               "default_vhost",
+               &tux_default_vhost,
+               sizeof(tux_default_vhost),
+               0644,
+               NULL,
+               proc_dostring,
+               &sysctl_string,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_404_PAGE,
+               "extra_html_header",
+               &tux_extra_html_header,
+               sizeof(tux_extra_html_header),
+               0644,
+               NULL,
+               proc_dostring,
+               &sysctl_string,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CLIENTPORT,
+               "extra_html_header_size",
+               &tux_extra_html_header_size,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CLIENTPORT,
+               "clientport",
+               &tux_clientport,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CLIENTPORT,
+               "generate_etags",
+               &tux_generate_etags,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+        {       NET_TUX_CLIENTPORT,
+                "generate_last_mod",
+                &tux_generate_last_mod,
+                sizeof(int),
+                0644,
+                NULL,
+                proc_dointvec,
+                &sysctl_intvec,
+                NULL,
+                NULL,
+                NULL
+        },
+        {       NET_TUX_CLIENTPORT,
+                "generate_cache_control",
+                &tux_generate_cache_control,
+                sizeof(int),
+                0644,
+                NULL,
+                proc_dointvec,
+                &sysctl_intvec,
+                NULL,
+                NULL,
+                NULL
+        },
+       {       NET_TUX_CLIENTPORT,
+               "ip_logging",
+               &tux_ip_logging,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CLIENTPORT,
+               "ftp_wait_close",
+               &tux_ftp_wait_close,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CLIENTPORT,
+               "ftp_log_retr_only",
+               &tux_ftp_log_retr_only,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CLIENTPORT,
+               "http_dir_indexing",
+               &tux_http_dir_indexing,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CLIENTPORT,
+               "hide_unreadable",
+               &tux_hide_unreadable,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CLIENTPORT,
+               "log_incomplete",
+               &tux_log_incomplete,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_LOGGING,
+               "TDprintk",
+               &tux_TDprintk,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_LOGGING,
+               "Dprintk",
+               &tux_Dprintk,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+#if TUX_DPRINTK
+#endif
+       {       NET_TUX_LOGGING,
+               "logging",
+               &tux_logging,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_LOGENTRY_ALIGN_ORDER,
+               "logentry_align_order",
+               &tux_logentry_align_order,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_ACK_PINGPONG,
+               "ack_pingpong",
+               &tux_ack_pingpong,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_PUSH_ALL,
+               "push_all",
+               &tux_push_all,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_ZEROCOPY_PARSE,
+               "zerocopy_parse",
+               &tux_zerocopy_parse,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_VIRTUAL_SERVER,
+               "virtual_server",
+               &tux_virtual_server,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_VIRTUAL_SERVER,
+               "mass_hosting_hash",
+               &mass_hosting_hash,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_VIRTUAL_SERVER,
+               "strip_host_tail",
+               &strip_host_tail,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_VIRTUAL_SERVER,
+               "ftp_virtual_server",
+               &tux_ftp_virtual_server,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_MAX_OBJECT_SIZE,
+               "max_object_size",
+               &tux_max_object_size,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_COMPRESSION,
+               "compression",
+               &tux_compression,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_NOID,
+               "noid",
+               &tux_noid,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CGI_INHERIT_CPU,
+               "cgi_inherit_cpu",
+               &tux_cgi_inherit_cpu,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_CGI_CPU_MASK,
+               "cgi_cpu_mask",
+               &tux_cgi_cpu_mask,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_ZEROCOPY_HEADER,
+               "zerocopy_header",
+               &tux_zerocopy_header,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_ZEROCOPY_SENDFILE,
+               "zerocopy_sendfile",
+               &tux_zerocopy_sendfile,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_MAX_FREE_REQUESTS,
+               "max_free_requests",
+               &tux_max_free_requests,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_ALL_USERSPACE,
+               "all_userspace",
+               &tux_all_userspace,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_REDIRECT_LOGGING,
+               "redirect_logging",
+               &tux_redirect_logging,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_IGNORE_QUERY,
+               "ignore_query",
+               &tux_ignore_query,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_REFERER_LOGGING,
+               "referer_logging",
+               &tux_referer_logging,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_REFERER_LOGGING,
+               "cpu_offset",
+               &tux_cpu_offset,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_REFERER_LOGGING,
+               "ftp_login_message",
+               &tux_ftp_login_message,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {       NET_TUX_MAX_HEADER_LEN,
+               "max_header_len",
+               &tux_max_header_len,
+               sizeof(int),
+               0644,
+               NULL,
+               proc_dointvec,
+               &sysctl_intvec,
+               NULL,
+               NULL,
+               NULL
+       },
+       {0,0,0,0,0,0,0,0,0,0,0} };
+       
+       
+static ctl_table tux_dir_table[] = {
+       {NET_TUX, "tux", NULL, 0, 0555, tux_table,0,0,0,0,0},
+       {0,0,0,0,0,0,0,0,0,0,0}
+};
+
+static ctl_table tux_root_table[] = {
+       {CTL_NET, "net", NULL, 0, 0555, tux_dir_table,0,0,0,0,0},
+       {0,0,0,0,0,0,0,0,0,0,0}
+};
+
+
+static struct proc_dir_entry * root_tux_dir;
+static struct proc_dir_entry * log_cpu_mask_entry;
+static struct proc_dir_entry * stat_entry;
+static struct proc_dir_entry * tux_dir [CONFIG_TUX_NUMTHREADS];
+static struct proc_dir_entry * listen_dir [CONFIG_TUX_NUMTHREADS];
+
+tux_socket_t tux_listen [CONFIG_TUX_NUMTHREADS][CONFIG_TUX_NUMSOCKETS] =
+ { [0 ... CONFIG_TUX_NUMTHREADS-1] = { {&tux_proto_http, 0, 80, NULL}, } };
+
+#define HEX_DIGITS 8
+
+static int hex_read_proc (char *page, char **start, off_t off,
+                       int count, int *eof, void *data)
+{
+       if (count < HEX_DIGITS+1)
+               return -EINVAL;
+       return sprintf (page, "%08x\n", *(unsigned int *)data);
+}
+
+static int hex_write_proc (struct file *file, const char *buffer,
+                                       unsigned long count, void *data)
+{
+       char hexnum [HEX_DIGITS];
+       unsigned int new_value;
+       unsigned int i, full_count = count;
+
+       if (!count)
+               return -EINVAL;
+       if (count > HEX_DIGITS)
+               count = HEX_DIGITS;
+       if (copy_from_user(hexnum, buffer, count))
+               return -EFAULT;
+
+       /*
+        * Parse the first 8 characters as a hex string, any non-hex char
+        * is end-of-string. '00e1', 'e1', '00E1', 'E1' are the same.
+        */
+       new_value = 0;
+
+       for (i = 0; i < count; i++) {
+               unsigned int c = hexnum[i];
+
+               switch (c) {
+                       case '0' ... '9': c -= '0'; break;
+                       case 'a' ... 'f': c -= 'a'-10; break;
+                       case 'A' ... 'F': c -= 'A'-10; break;
+               default:
+                       goto out;
+               }
+               new_value = (new_value << 4) | c;
+       }
+out:
+       *(int *)data = new_value;
+
+       return full_count;
+}
+
+#define LINE_SIZE 1024
+#define LINE_MASK (LINE_SIZE-1)
+
+static int print_request_stats (threadinfo_t *ti, char *page, unsigned int skip_count, unsigned int max_count)
+{
+       struct list_head *head, *curr;
+       tux_req_t *req;
+       unsigned int count = 0, size, line_off, len;
+       char stat_line [LINE_SIZE];
+
+       if (!max_count)
+               BUG();
+
+       head = &ti->all_requests;
+       curr = head->next;
+
+       while (curr != head) {
+               req = list_entry(curr, tux_req_t, all);
+               curr = curr->next;
+               count++;
+               if (count <= skip_count)
+                       continue;
+               line_off = 0;
+#define SP(x...) \
+       line_off += sprintf(stat_line + line_off, x)
+
+               if (req->proto == &tux_proto_http)
+                       SP("0 ");
+               else
+                       SP("1 ");
+       
+               SP("%p ", req);
+               SP("%d ", req->atom_idx);
+               if (req->atom_idx >= 1)
+                       SP("%p ", req->atoms[0]);
+               else
+                       SP("........ ");
+               if (req->atom_idx >= 2)
+                       SP("%p ", req->atoms[1]);
+               else
+                       SP("........ ");
+               if (!list_empty(&req->work))    SP("W");        else SP(".");
+               if (!list_empty(&req->free))    SP("F");        else SP(".");
+               if (!list_empty(&req->lru))     SP("L");        else SP(".");
+               if (req->keep_alive)            SP("K");        else SP(".");
+               if (req->idle_input)            SP("I");        else SP(".");
+               if (timer_pending(&req->keepalive_timer))
+                                               SP("T(%lu/%lu)",jiffies,req->keepalive_timer.expires);  else SP(".");
+               if (req->wait_output_space)     SP("O");        else SP(".");
+               if (timer_pending(&req->output_timer))
+                                               SP("T");        else SP(".");
+               SP(" %d ", req->error);
+               SP(" %d ", req->status);
+
+#define SP_HOST(ip,port) \
+               SP("%d.%d.%d.%d:%d ",NIPQUAD(ip),port)
+
+               if (req->sock) {
+                       if (req->sock->sk)
+                               SP("%d:", req->sock->sk->sk_state);
+                       else
+                               SP("-2:");
+               } else
+                       SP("-1:");
+               SP_HOST(req->client_addr, req->client_port);
+
+               SP("%Ld ", req->total_file_len);
+               SP("%Ld ", req->in_file.f_pos);
+               if (req->proto == &tux_proto_http) {
+                       SP("%d ", req->method);
+                       SP("%d ", req->version);
+               }
+               if (req->proto == &tux_proto_ftp) {
+                       SP("%d ", req->ftp_command);
+                       if (req->data_sock) {
+                               if (req->data_sock->sk)
+                                       SP("%d:",req->data_sock->sk->sk_state);
+                               else
+                                       SP("-2:");
+                               if (req->data_sock->sk)
+                                       SP_HOST(inet_sk(req->data_sock->sk)->daddr,
+                                               inet_sk(req->data_sock->sk)->dport);
+                               else
+                                       SP("-1:-1 ");
+                       } else
+                               SP("-1 ");
+               }
+               SP("%p/%p %p/%p ", req->sock, req->sock ? req->sock->sk : (void *)-1, req->data_sock, req->data_sock ? req->data_sock->sk : (void *)-1);
+
+               SP("%d\n", req->parsed_len);
+               len = req->headers_len;
+               if (len > 500)
+                       len = 500;
+               SP("\n%d\n", len);
+               memcpy(stat_line + line_off, req->headers, len);
+               line_off += len;
+               len = req->objectname_len;
+               if (len > 100)
+                       len = 100;
+               SP("\n%d\n", len);
+               memcpy(stat_line + line_off, req->objectname, len);
+               line_off += len;
+               SP("\n\n<END>");
+               if (line_off >= LINE_SIZE)
+                       BUG();
+               Dprintk("printing req %p, count %d, page %p: {%s}.\n", req, count, page, stat_line);
+               size = sprintf(page, "%-*s\n", LINE_SIZE-1, stat_line);
+               if (size != LINE_SIZE)
+                       BUG();
+               page += LINE_SIZE;
+               if (count-skip_count >= max_count)
+                       break;
+       }
+
+       Dprintk("count: %d.\n", count-skip_count);
+       return count - skip_count;
+}
+
+static int stat_read_proc (char *page, char **start, off_t off,
+                       int max_size, int *eof, void *data)
+{
+       unsigned int i, nr_total = 0, nr, nr_off, nr_skip, size = 0, nr_wanted;
+
+       Dprintk("START, page: %p, max_size: %d, off: %ld.\n", page, max_size, off);
+       *eof = 1;
+       if (max_size & LINE_MASK)
+               return 0;
+       if (off & LINE_MASK)
+               return 0;
+       if (!max_size)
+               return 0;
+
+       nr_off = off/LINE_SIZE;
+
+       for (i = 0; i < nr_tux_threads; i++) {
+               threadinfo_t *ti = threadinfo + i;
+               spin_lock_irq(&ti->work_lock);
+               nr = ti->nr_requests;
+               Dprintk("ti: %p, nr: %d, nr_total: %d, nr_off: %d.\n", ti, nr, nr_total, nr_off);
+               nr_total += nr;
+               if (nr_off >= nr_total) {
+                       spin_unlock_irq(&ti->work_lock);
+                       continue;
+               }
+               nr_skip = nr_off - (nr_total - nr);
+               nr_wanted = (max_size-size) / LINE_SIZE;
+               Dprintk("nr_skip: %d, nr_wanted: %d.\n", nr_skip, nr_wanted);
+               nr = print_request_stats(ti, page + size, nr_skip, nr_wanted);
+               spin_unlock_irq(&ti->work_lock);
+               nr_off += nr;
+               size += nr * LINE_SIZE;
+               Dprintk("ret: %d requests, size: %d.\n", nr, size);
+               if (size > max_size)
+                       BUG();
+               if (size == max_size)
+                       break;
+       }
+       Dprintk("DONE: size: %d.\n", size);
+
+       *start = page;
+
+       if (size)
+               *eof = 0;
+       return size;
+}
+
+static int stat_write_proc (struct file *file, const char *buffer,
+                                       unsigned long count, void *data)
+{
+       return -EINVAL;
+}
+
+#define MAX_STRING "http://255.255.255.255:65535"
+#define MAX_STRINGLEN (sizeof(MAX_STRING))
+
+#define INACTIVE_1 "[inactive]\n"
+#define INACTIVE_2 "0\n"
+
+static int listen_read_proc (char *page, char **start, off_t off,
+                       int count, int *eof, void *data)
+{
+       tux_socket_t *listen = data;
+
+       if (count < MAX_STRINGLEN)
+               return -EINVAL;
+
+       if (!listen->proto)
+               return sprintf(page, INACTIVE_1);
+
+       return sprintf (page, "%s://%u.%u.%u.%u:%hu\n", listen->proto->name,
+                       HIPQUAD(listen->ip), listen->port);
+}
+
+static int listen_write_proc (struct file *file, const char *buffer,
+                                       unsigned long count, void *data)
+{
+       char string [MAX_STRINGLEN];
+       unsigned int d1, d2, d3, d4;
+       unsigned short port;
+       tux_socket_t *listen = data;
+
+       if (!count)
+               return -EINVAL;
+       if (count > MAX_STRINGLEN)
+               count = MAX_STRINGLEN;
+       if (copy_from_user(string, buffer, count))
+               return -EFAULT;
+       string[count] = 0;
+
+       if (!strcmp(string, INACTIVE_1) || !strcmp(string, INACTIVE_2)) {
+               listen->proto = NULL;
+               listen->ip = 0;
+               listen->port = 0;
+               return count;
+       }
+
+#define MK_IP(a,b,c,d) ((a << 24) | (b << 16) | (c << 8) | d)
+
+        if (sscanf(string, "http://%u.%u.%u.%u:%hu\n",
+                                       &d1, &d2, &d3, &d4, &port) == 5) {
+               listen->ip = MK_IP(d1,d2,d3,d4);
+               listen->port = port;
+               listen->proto = &tux_proto_http;
+               return count;
+       }
+               
+        if (sscanf(string, "ftp://%u.%u.%u.%u:%hu\n",
+                                       &d1, &d2, &d3, &d4, &port) == 5) {
+               listen->ip = MK_IP(d1,d2,d3,d4);
+               listen->port = port;
+               listen->proto = &tux_proto_ftp;
+               return count;
+       }
+       printk(KERN_ERR "tux: invalid listen-socket parameters: %s\n", string);
+       return -EINVAL;
+}
+
+#define MAX_NAMELEN 10
+
+static void register_tux_proc (unsigned int nr)
+{
+       struct proc_dir_entry *entry;
+       char name [MAX_NAMELEN];
+       int i;
+
+       if (!root_tux_dir)
+               TUX_BUG();
+
+       sprintf(name, "%d", nr);
+
+       /* create /proc/net/tux/1234/ */
+       tux_dir[nr] = proc_mkdir(name, root_tux_dir);
+
+       /* create /proc/net/tux/1234/listen/ */
+       listen_dir[nr] = proc_mkdir("listen", tux_dir[nr]);
+
+       /* create /proc/net/tux/1234/listen/ */
+       for (i = 0; i < CONFIG_TUX_NUMSOCKETS; i++) {
+               sprintf(name, "%d", i);
+               entry = create_proc_entry(name, 0700, listen_dir[nr]);
+
+               entry->nlink = 1;
+               entry->data = (void *)(tux_listen[nr] + i);
+               entry->read_proc = listen_read_proc;
+               entry->write_proc = listen_write_proc;
+               tux_listen[nr][i].entry = entry;
+       }
+}
+
+static void unregister_tux_proc (unsigned int nr)
+{
+       int i;
+
+       for (i = 0; i < CONFIG_TUX_NUMSOCKETS; i++) {
+               remove_proc_entry(tux_listen[nr][i].entry->name,listen_dir[nr]);
+               tux_listen[nr][i].entry = NULL;
+       }
+
+       remove_proc_entry(listen_dir[nr]->name, tux_dir[nr]);
+
+       remove_proc_entry(tux_dir[nr]->name, root_tux_dir);
+}
+
+static void cleanup_tux_proc (void)
+{
+       int i;
+
+       Dprintk("cleaning up /proc/net/tux/\n");
+
+       for (i = 0; i < CONFIG_TUX_NUMTHREADS; i++)
+               unregister_tux_proc(i);
+       remove_proc_entry(stat_entry->name, root_tux_dir);
+       remove_proc_entry(log_cpu_mask_entry->name, root_tux_dir);
+       remove_proc_entry(root_tux_dir->name, proc_net);
+}
+
+static void init_tux_proc (void)
+{
+       struct proc_dir_entry *entry;
+       int i;
+
+       if (root_tux_dir)
+               return;
+
+       /* create /proc/net/tux */
+       root_tux_dir = proc_mkdir("tux", proc_net);
+
+       entry = create_proc_entry("log_cpu_mask", 0700, root_tux_dir);
+
+       entry->nlink = 1;
+       entry->data = (void *)&log_cpu_mask;
+       entry->read_proc = hex_read_proc;
+       entry->write_proc = hex_write_proc;
+
+       log_cpu_mask_entry = entry;
+
+       entry = create_proc_entry("stat", 0700, root_tux_dir);
+
+       entry->nlink = 1;
+       entry->data = NULL;
+       entry->read_proc = stat_read_proc;
+       entry->write_proc = stat_write_proc;
+
+       stat_entry = entry;
+
+       /*
+        * Create entries for all existing threads.
+        */
+       for (i = 0; i < CONFIG_TUX_NUMTHREADS; i++)
+               register_tux_proc(i);
+}
+
+void start_sysctl(void)
+{
+       init_tux_proc();
+       tux_table_header = register_sysctl_table(tux_root_table,1);
+}
+
+void end_sysctl(void)
+{
+       cleanup_tux_proc();
+       unregister_sysctl_table(tux_table_header);
+}
+
+#if CONFIG_SMP
+void mask_to_cpumask(unsigned int mask, cpumask_t *cpu_mask)
+{
+
+       unsigned int bit_mask, i;
+
+       bit_mask = 1 << 31;
+
+       for (i=NR_CPUS-1; i--; i >= 0) {
+               if(mask & bit_mask)
+                       cpu_set(i, *cpu_mask);
+               else
+                       cpu_clear(i, *cpu_mask);
+               mask <<= 1;
+       }
+
+}
+#endif
+
diff --git a/net/tux/proto_ftp.c b/net/tux/proto_ftp.c
new file mode 100644 (file)
index 0000000..fbb9d8e
--- /dev/null
@@ -0,0 +1,1549 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * ftp_proto.c: FTP application protocol support
+ */
+
+#define __KERNEL_SYSCALLS__
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+#define HELLO          "220 Linux/TUX 3.0 FTP server welcomes you!\r\n"
+#define WRITE_DONE     "226 Transfer complete.\r\n"
+#define BAD_FILENAME   "550 No such file or directory.\r\n"
+#define GOOD_DIR       "250 CWD command successful.\r\n"
+#define LIST_ERR       "503 LIST without PORT! Closing connection.\r\n"
+#define LIST_ERR_MEM   "503 LIST could not allocate memory! Closing connection.\r\n"
+#define WRITE_FILE     "150 Opening BINARY mode data connection.\r\n"
+#define WRITE_LIST     "150 Opening ASCII mode data connection.\r\n"
+#define RETR_ERR       "503 RETR without PORT! Closing connection.\r\n"
+#define PORT_OK                "200 PORT command successful.\r\n"
+#define LOGIN_OK       "230-There are currently %d users logged in, out of %d maximum.\r\n230-Bandwidth served by TUX currently: %d KB/sec\r\n230 TUX Guest login ok.\r\n"
+#define LOGIN_OK_ONE   "230-There is currently 1 user logged in, out of %d maximum.\r\n230-Bandwidth served by TUX currently: %d KB/sec\r\n230 TUX Guest login ok.\r\n"
+#define LOGIN_OK_PASS  "230 TUX Guest login ok.\r\n"
+#define LOGIN_FORBIDDEN        "530 Sorry, Login Denied!\r\n"
+#define TYPE_OK                "200 Type set to I.\r\n"
+#define BYE            "221 Thank You for using TUX!\r\n"
+#define NOT_IMPLEMENTED        "502 Command not implemented.\r\n"
+#define CLOSE_2                "221 Cannot handle request, closing connection!\r\n"
+#define CLOSE          "500 Unknown command.\r\n"
+#define CLOSE_TIMEOUT  "421 Timeout, closing connection!\r\n"
+#define LINUX_SYST     "215 UNIX Type: L8, Linux/TUX/3.0\r\n"
+#define COMMAND_OK     "200 Command OK.\r\n"
+#define REST_OK                "350 Restart offset OK.\r\n"
+#define WRITE_ABORTED  "426 Transfer aborted, data connection closed.\r\n"
+#define SITE           "214 No SITE commands are recognized.\r\n"
+
+#define INTERVAL 10
+
+unsigned long last_measurement;
+unsigned int ftp_bytes_sent;
+unsigned int ftp_bandwidth;
+
+static void __update_bandwidth (tux_req_t *req, unsigned int bytes)
+{
+       /*
+        * Bandwidth measurement. Not completely accurate,
+        * but it's good enough and lightweight enough.
+        */
+       if (jiffies >= last_measurement + INTERVAL*HZ) {
+               ftp_bandwidth = (ftp_bytes_sent + 1023)/INTERVAL/1024;
+               ftp_bytes_sent = 0;
+               last_measurement = jiffies;
+       }
+       if (bytes)
+               atomic_add(bytes, (atomic_t *)&ftp_bytes_sent);
+       Dprintk("update_bandwidth(%p,%d), bytes_sent: %d, bandwidth: %d.\n",
+               req, bytes, ftp_bytes_sent, ftp_bandwidth);
+}
+
+#define update_bandwidth(req,bytes)                            \
+       do {                                                    \
+               if (unlikely(tux_ftp_login_message))            \
+                       __update_bandwidth(req, bytes);         \
+       } while (0)
+
+static inline void __ftp_send_async_message (tux_req_t *req,
+                const char *message, int status, unsigned int size)
+{
+       update_bandwidth(req, size);
+       __send_async_message(req, message, status, size, 1);
+}
+
+#define ftp_send_async_message(req,str,status) \
+               __ftp_send_async_message(req,str,status,sizeof(str)-1)
+
+
+static void ftp_flush_req (tux_req_t *req, int cachemiss)
+{
+       tux_push_pending(req->sock->sk);
+       add_req_to_workqueue(req);
+}
+
+static void ftp_execute_command (tux_req_t *req, int cachemiss);
+
+static void ftp_lookup_vhost (tux_req_t *req, int cachemiss)
+{
+       struct dentry *dentry;
+       struct nameidata base;
+       struct vfsmount *mnt = NULL;
+       unsigned int flag = cachemiss ? 0 : LOOKUP_ATOMIC;
+       char ip[3+1+3+1+3+1+3 + 2];
+
+       sprintf(ip, "%d.%d.%d.%d", NIPQUAD(inet_sk(req->sock->sk)->rcv_saddr));
+       Dprintk("ftp_lookup_vhost(%p, %d, virtual: %d, host: %s.)\n", 
+               req, flag, req->virtual, ip);
+
+       base.flags = LOOKUP_FOLLOW|flag;
+       base.last_type = LAST_ROOT;
+       base.dentry = dget(req->proto->main_docroot.dentry);
+       base.mnt = mntget(req->proto->main_docroot.mnt);
+
+       dentry = __tux_lookup(req, ip, &base, &mnt);
+
+       Dprintk("looked up dentry %p.\n", dentry);
+       if (dentry && !IS_ERR(dentry) && !dentry->d_inode)
+               TUX_BUG();
+
+       if (!dentry || IS_ERR(dentry)) {
+               if (PTR_ERR(dentry) == -EWOULDBLOCKIO) {
+                       add_tux_atom(req, ftp_lookup_vhost);
+                       queue_cachemiss(req);
+                       return;
+               }
+               goto abort;
+       }
+
+       req->docroot_dentry = dentry;
+       req->docroot_mnt = mnt;
+
+       add_tux_atom(req, ftp_execute_command);
+       add_req_to_workqueue(req);
+       return;
+abort:
+       if (dentry) {
+               if (!IS_ERR(dentry))
+                       dput(dentry);
+               dentry = NULL;
+       }
+       if (mnt) {
+               if (!IS_ERR(mnt))
+                       mntput(mnt);
+               mnt = NULL;
+       }
+       req_err(req);
+       add_req_to_workqueue(req);
+}
+
+static void ftp_got_request (tux_req_t *req)
+{
+       add_tux_atom(req, parse_request);
+       add_tux_atom(req, ftp_flush_req);
+       ftp_send_async_message(req, HELLO, 220);
+}
+
+#define GOTO_ERR { TDprintk("FTP protocol error at: %s:%d\n", \
+                       __FILE__, __LINE__); goto error; }
+
+static void zap_data_socket (tux_req_t *req)
+{
+       if (!req->data_sock)
+               return;
+       Dprintk("zapping req %p's data socket %p.\n", req, req->data_sock);
+
+       unlink_tux_data_socket(req);
+       sock_release(req->data_sock);
+       req->data_sock = NULL;
+}
+
+static int parse_ftp_message (tux_req_t *req, const int total_len)
+{
+       int comm, comm1 = 0, comm2 = 0, comm3 = 0, comm4 = 0;
+       int newline_pos, i;
+       const char *mess, *curr;
+
+       curr = mess = req->headers;
+
+       Dprintk("FTP parser got %d bytes: --->{%s}<---\n", total_len, curr);
+
+       newline_pos = -1;
+       for (i = 0; i < total_len; i++, curr++) {
+               if (!*curr)
+                       GOTO_ERR;
+               if (!(*curr == '\r') || !(*(curr+1) == '\n'))
+                       continue;
+               newline_pos = i;
+               break;
+       }
+       Dprintk("Newline pos: %d\n", newline_pos);
+       if (newline_pos == -1) {
+               Dprintk("incomplete mess on req %p!\n", req);
+               return 0;
+       }
+       if (newline_pos < 3)
+               GOTO_ERR;
+
+#define toup(c) ((((c) >= 'a') && ((c) <= 'z')) ? ((c) + 'A' - 'a') : (c))
+
+#define STRING_VAL(c1,c2,c3,c4) \
+       (toup(c1) + (toup(c2) << 8) + (toup(c3) << 16) + (toup(c4) << 24))
+
+#define STRING_VAL_STR(str) \
+               STRING_VAL(str[0], str[1], str[2], str[3])
+
+       Dprintk("string val (%c%c%c%c): %08x\n",
+               mess[0], mess[1], mess[2], mess[3],
+               STRING_VAL_STR(mess));
+
+#define PARSE_FTP_COMM(c1,c2,c3,c4,name,num)                   \
+       if (STRING_VAL_STR(mess) == STRING_VAL(c1,c2,c3,c4))    \
+       {                                                       \
+               Dprintk("parsed "#name".\n");                   \
+               comm##num = FTP_COMM_##name;                    \
+       }
+
+       PARSE_FTP_COMM('A','C','C','T', ACCT,2);
+       PARSE_FTP_COMM('C','D','U','P', CDUP,3);
+       PARSE_FTP_COMM('S','M','N','T', SMNT,4);
+       PARSE_FTP_COMM('Q','U','I','T', QUIT,1);
+       PARSE_FTP_COMM('R','E','I','N', REIN,2);
+       PARSE_FTP_COMM('P','A','S','V', PASV,3);
+       PARSE_FTP_COMM('S','T','R','U', STRU,4); 
+       PARSE_FTP_COMM('S','T','O','R', STOR,2); 
+       PARSE_FTP_COMM('S','T','O','U', STOU,3); 
+       PARSE_FTP_COMM('A','P','P','E', APPE,4); 
+       PARSE_FTP_COMM('A','L','L','O', ALLO,1); 
+       PARSE_FTP_COMM('R','N','F','R', RNFR,2); 
+       PARSE_FTP_COMM('R','N','T','O', RNTO,3); 
+       PARSE_FTP_COMM('A','B','O','R', ABOR,4); 
+       PARSE_FTP_COMM('D','E','L','E', DELE,1); 
+       PARSE_FTP_COMM('R','M','D',' ', RMD, 2); 
+       PARSE_FTP_COMM('M','K','D',' ', MKD, 3); 
+       PARSE_FTP_COMM('P','W','D',' ', PWD, 4); 
+       PARSE_FTP_COMM('S','Y','S','T', SYST,2); 
+       PARSE_FTP_COMM('N','O','O','P', NOOP,3); 
+       PARSE_FTP_COMM('F','E','A','T', FEAT,4); 
+
+       comm = comm1 | comm2 | comm3 | comm4;
+
+       if (comm) {
+               if (newline_pos != 4)
+                       GOTO_ERR;
+               req->ftp_command = comm;
+               goto out;
+       }
+       
+       switch (STRING_VAL(mess[0], mess[1], mess[2], mess[3])) {
+
+#define PARSE_FTP_COMM_3CHAR(c1,c2,c3,name)                            \
+               case STRING_VAL(c1,c2,c3,'\r'):                         \
+               {                                                       \
+                       Dprintk("parsed "#name".\n");                   \
+                       req->ftp_command = FTP_COMM_##name;             \
+                       if (newline_pos != 3)                           \
+                               GOTO_ERR;                               \
+               }
+
+#define PARSE_FTP_3CHAR_COMM_IGNORE(c1,c2,c3,name)                     \
+               case STRING_VAL(c1,c2,c3,' '):                          \
+               {                                                       \
+                       Dprintk("parsed "#name".\n");                   \
+                       req->ftp_command = FTP_COMM_##name;             \
+               }
+
+#define PARSE_FTP_COMM_IGNORE(c1,c2,c3,c4,name)                                \
+               case STRING_VAL(c1,c2,c3,c4):                           \
+               {                                                       \
+                       Dprintk("parsed "#name".\n");                   \
+                       req->ftp_command = FTP_COMM_##name;             \
+               }
+
+#define PARSE_FTP_3CHAR_COMM_1_FIELD(c1,c2,c3,name,field,field_len,max)        \
+               case STRING_VAL(c1,c2,c3,' '):                          \
+               {                                                       \
+                       Dprintk("parsed "#name".\n");                   \
+                       req->ftp_command = FTP_COMM_##name;             \
+                       if (newline_pos == 4)                           \
+                               GOTO_ERR;                               \
+                       if (newline_pos >= 5) {                         \
+                               curr = mess + 3;                        \
+                               if (*curr++ != ' ')                     \
+                                       GOTO_ERR;                       \
+                               *(field_len) = newline_pos-4;           \
+                               if (*(field_len) >= max)                \
+                                       GOTO_ERR;                       \
+                               memcpy(field, curr, *(field_len));      \
+                               (field)[*(field_len)] = 0;              \
+                       }                                               \
+               }
+
+#define PARSE_FTP_COMM_1_FIELD(c1,c2,c3,c4,name,field,field_len,max)   \
+               case STRING_VAL(c1,c2,c3,c4):                           \
+               {                                                       \
+                       Dprintk("parsed "#name".\n");                   \
+                       req->ftp_command = FTP_COMM_##name;             \
+                       if (newline_pos < 4)                            \
+                               GOTO_ERR;                               \
+                       if (newline_pos == 4)                           \
+                               *(field_len) = 0;                       \
+                       else {                                          \
+                               curr = mess + 4;                        \
+                               if (*curr++ != ' ')                     \
+                                       GOTO_ERR;                       \
+                               *(field_len) = newline_pos-5;           \
+                               if (*(field_len) >= max)                \
+                                       GOTO_ERR;                       \
+                               memcpy(field, curr, *(field_len));      \
+                               (field)[*(field_len)] = 0;              \
+                       }                                               \
+               }
+
+               PARSE_FTP_COMM_1_FIELD('U','S','E','R', USER,
+                       req->username, &req->username_len,
+                       MAX_USERNAME_LEN-1);
+               if (!req->username_len)
+                       GOTO_ERR;
+               break;
+
+               {
+                       #define MAX_PASS_LEN 100
+                       char pass[MAX_PASS_LEN];
+                       unsigned int pass_len;
+                       PARSE_FTP_COMM_1_FIELD('P','A','S','S', PASS,
+                               pass, &pass_len,
+                               MAX_PASS_LEN-1);
+                       if (!pass_len)
+                               GOTO_ERR;
+                       break;
+               }
+
+               PARSE_FTP_3CHAR_COMM_1_FIELD('C','W','D', CWD,
+                       req->objectname, &req->objectname_len,
+                       MAX_OBJECTNAME_LEN-1);
+               if (!req->objectname_len)
+                       GOTO_ERR;
+               req->uri_str = req->objectname;
+               req->uri_len = req->objectname_len;
+               break;
+
+               PARSE_FTP_COMM_3CHAR('P','W','D', PWD); break;
+
+               {
+                       char type[3];
+                       unsigned int type_len;
+
+                       PARSE_FTP_COMM_1_FIELD('T','Y','P','E', TYPE,
+                               type, &type_len, 2);
+                       if (!type_len)
+                               GOTO_ERR;
+                       if ((type[0] != 'I') && (type[0] != 'A'))
+                               GOTO_ERR;
+               }
+               break;
+
+               PARSE_FTP_COMM_1_FIELD('R','E','T','R', RETR,
+                       req->objectname, &req->objectname_len,
+                       MAX_OBJECTNAME_LEN-1);
+               if (!req->objectname_len) {
+                       zap_data_socket(req);
+                       req->ftp_command = FTP_COMM_NONE;
+               }
+               req->uri_str = req->objectname;
+               req->uri_len = req->objectname_len;
+               break;
+
+               PARSE_FTP_COMM_1_FIELD('S','I','Z','E', SIZE,
+                       req->objectname, &req->objectname_len,
+                       MAX_OBJECTNAME_LEN-1);
+               if (!req->objectname_len)
+                       req->ftp_command = FTP_COMM_NONE;
+               req->uri_str = req->objectname;
+               req->uri_len = req->objectname_len;
+               break;
+
+               PARSE_FTP_COMM_1_FIELD('M','D','T','M', MDTM,
+                       req->objectname, &req->objectname_len,
+                       MAX_OBJECTNAME_LEN-1);
+               if (!req->objectname_len)
+                       req->ftp_command = FTP_COMM_NONE;
+               req->uri_str = req->objectname;
+               req->uri_len = req->objectname_len;
+               break;
+
+               PARSE_FTP_COMM_IGNORE('M','O','D','E', MODE);
+               break;
+
+               PARSE_FTP_COMM_IGNORE('S','T','A','T', STAT);
+               break;
+
+               PARSE_FTP_COMM_IGNORE('S','I','T','E', SITE);
+               break;
+
+               PARSE_FTP_COMM_1_FIELD('L','I','S','T', LIST,
+                       req->objectname, &req->objectname_len,
+                       MAX_OBJECTNAME_LEN-1);
+               if (req->objectname[0] == '-') {
+                       req->objectname_len = 0;
+                       req->objectname[0] = 0;
+               }
+               if (req->objectname_len) {
+                       req->uri_str = req->objectname;
+                       req->uri_len = req->objectname_len;
+               }
+               break;
+
+               PARSE_FTP_COMM_1_FIELD('N','L','S','T', NLST,
+                       req->objectname, &req->objectname_len,
+                       MAX_OBJECTNAME_LEN-1);
+               if (req->objectname[0] == '-') {
+                       req->objectname_len = 0;
+                       req->objectname[0] = 0;
+               }
+               if (req->objectname_len) {
+                       req->uri_str = req->objectname;
+                       req->uri_len = req->objectname_len;
+               }
+               break;
+
+               PARSE_FTP_COMM_IGNORE('H','E','L','P', HELP);
+               break;
+
+               PARSE_FTP_COMM_IGNORE('C','L','N','T', CLNT);
+               break;
+
+#define IS_NUM(n) (((n) >= '0') && ((n) <= '9'))
+
+#define GET_DIGIT(curr,n)                              \
+       n += (*curr) - '0';                             \
+       curr++;                                         \
+       if (IS_NUM(*curr)) {                            \
+               n *= 10;
+
+#define PARSE_PORTNUM(curr,n)                          \
+do {                                                   \
+       Dprintk("PORT NUM parser:--->{%s}<---\n", curr);\
+       if (!IS_NUM(*curr))                             \
+               GOTO_ERR;                               \
+       n = 0;                                          \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       }}}                                             \
+       if (n > 255)                                    \
+               GOTO_ERR;                               \
+       Dprintk("PORT NUM parser:--->{%s}<---\n", curr);\
+       Dprintk("PORT NUM parser parsed %d.\n", n);     \
+} while (0)
+
+#define PARSE_NUM(curr,n)                              \
+do {                                                   \
+       Dprintk("NUM parser:--->{%s}<---\n", curr);     \
+       if (!IS_NUM(*curr))                             \
+               GOTO_ERR;                               \
+       n = 0;                                          \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       GET_DIGIT(curr,n);                              \
+       }}}}}}}}}}                                      \
+       Dprintk("NUM parser:--->{%s}<---\n", curr);     \
+       Dprintk("NUM parser parsed %d.\n", n);          \
+} while (0)
+
+               case STRING_VAL('P','O','R','T'):
+               {
+                       unsigned int h1, h2, h3, h4, p1, p2;
+                       if (req->data_sock)
+                               zap_data_socket(req);
+                       /*
+                        * Minimum size: "PORT 0,0,0,0,0,0", 16 bytes.
+                        */
+                       if (newline_pos < 16)
+                               GOTO_ERR;
+                       Dprintk("parsed PORT.\n");
+                       if (req->data_sock)
+                               GOTO_ERR;
+                       curr = mess + 4;
+                       if (*curr++ != ' ')
+                               GOTO_ERR;
+                       PARSE_PORTNUM(curr,h1);
+                       if (*curr++ != ',')
+                               GOTO_ERR;
+                       PARSE_PORTNUM(curr,h2);
+                       if (*curr++ != ',')
+                               GOTO_ERR;
+                       PARSE_PORTNUM(curr,h3);
+                       if (*curr++ != ',')
+                               GOTO_ERR;
+                       PARSE_PORTNUM(curr,h4);
+                       if (*curr++ != ',')
+                               GOTO_ERR;
+                       PARSE_PORTNUM(curr,p1);
+                       if (*curr++ != ',')
+                               GOTO_ERR;
+                       PARSE_PORTNUM(curr,p2);
+                       if (curr-mess != newline_pos)
+                               GOTO_ERR;
+                       req->ftp_command = FTP_COMM_PORT;
+                       req->ftp_user_addr = (h1<<24) + (h2<<16) + (h3<<8) + h4;
+                       req->ftp_user_port = (p1<<8) + p2;
+                       Dprintk("FTP PORT got: %d.%d.%d.%d:%d.\n",
+                               h1, h2, h3, h4, req->ftp_user_port);
+                       Dprintk("FTP user-addr: %08x (htonl: %08x), socket: %08x.\n",
+                               req->ftp_user_addr, htonl(req->ftp_user_addr),
+                               inet_sk(req->sock->sk)->daddr);
+                       /*
+                        * Do not allow redirection of connections, and do
+                        * not allow reserved ports to be accessed.
+                        */
+                       if (inet_sk(req->sock->sk)->daddr != htonl(req->ftp_user_addr))
+                               GOTO_ERR;
+                       if (req->ftp_user_port < 1024)
+                               GOTO_ERR;
+                       break;
+               }
+               case STRING_VAL('R','E','S','T'):
+               {
+                       unsigned int offset;
+
+                       /*
+                        * Minimum size: "REST 0", 6 bytes.
+                        */
+                       if (newline_pos < 6)
+                               GOTO_ERR;
+                       Dprintk("parsed REST.\n");
+                       curr = mess + 4;
+                       if (*curr++ != ' ')
+                               GOTO_ERR;
+                       PARSE_NUM(curr,offset);
+                       if (curr-mess != newline_pos)
+                               GOTO_ERR;
+                       req->ftp_command = FTP_COMM_REST;
+                       req->ftp_offset_start = offset;
+                       Dprintk("FTP REST got: %d bytes offset.\n", offset);
+
+                       break;
+               }
+               default:
+                       req->ftp_command = FTP_COMM_NONE;
+                       break;
+       }
+
+out:
+       req->parsed_len = newline_pos + 2;
+
+       req->virtual = tux_ftp_virtual_server;
+       if (req->virtual)
+               add_tux_atom(req, ftp_lookup_vhost);
+       else {
+               req->docroot_dentry = dget(req->proto->main_docroot.dentry);
+               req->docroot_mnt = mntget(req->proto->main_docroot.mnt);
+               add_tux_atom(req, ftp_execute_command);
+       }
+
+       return req->parsed_len;
+error:
+       clear_keepalive(req);
+       TDprintk("rejecting FTP session!\n");
+       TDprintk("mess     :--->{%s}<---\n", mess);
+       TDprintk("mess left:--->{%s}<---\n", curr);
+       req_err(req);
+       return -1;
+}
+
+static void ftp_wait_close (tux_req_t *req, int cachemiss);
+static void ftp_wait_syn (tux_req_t *req, int cachemiss);
+
+static int ftp_check_req_err (tux_req_t *req, int cachemiss)
+{
+       int state = req->sock->sk->sk_state;
+       int err = req->sock->sk->sk_err | req->error;
+       int urg = tcp_sk(req->sock->sk)->urg_data;
+
+       if (req->data_sock) {
+               urg |= tcp_sk(req->data_sock->sk)->urg_data;
+               state |= req->data_sock->sk->sk_state;
+               err |= req->data_sock->sk->sk_err;
+       }
+
+       if ((state <= TCP_SYN_RECV) && !err) {
+               if (!urg)
+                       return 0;
+               req->in_file.f_pos = 0;
+               add_tux_atom(req, flush_request);
+               zap_data_socket(req);
+               ftp_send_async_message(req, WRITE_ABORTED, 426);
+               return 1;
+       }
+#if CONFIG_TUX_DEBUG
+       req->bytes_expected = 0;
+       if (tux_TDprintk)
+               dump_stack();
+#endif
+       req->in_file.f_pos = 0;
+       TDprintk("zapping, data sock state: %d (err: %d, urg: %d)\n",
+               state, err, urg);
+       /*
+        * We are in the middle of a file transfer,
+        * zap it immediately:
+        */
+       req->error = TUX_ERROR_CONN_CLOSE;
+       zap_request(req, cachemiss);
+       return 1;
+}
+
+void ftp_send_file (tux_req_t *req, int cachemiss)
+{
+       int ret;
+
+       SET_TIMESTAMP(req->output_timestamp);
+repeat:
+       ret = generic_send_file(req, req->data_sock, cachemiss);
+       update_bandwidth(req, req->in_file.f_pos - req->prev_pos);
+       req->prev_pos = req->in_file.f_pos;
+
+       switch (ret) {
+               case -5:
+                       add_tux_atom(req, ftp_send_file);
+                       output_timeout(req);
+                       break;
+               case -4:
+                       add_tux_atom(req, ftp_send_file);
+                       if (add_output_space_event(req, req->data_sock)) {
+                               del_tux_atom(req);
+                               goto repeat;
+                       }
+                       break;
+               case -3:
+                       add_tux_atom(req, ftp_send_file);
+                       queue_cachemiss(req);
+                       break;
+               case -1:
+                       break;
+               default:
+                       req->in_file.f_pos = 0;
+
+                       if (tux_ftp_wait_close) {
+                               req->data_sock->ops->shutdown(req->data_sock, SEND_SHUTDOWN);
+                               add_tux_atom(req, ftp_wait_close);
+                               add_req_to_workqueue(req);
+                               return;
+                       }
+                       Dprintk("FTP send file req %p finished!\n", req);
+                       zap_data_socket(req);
+                       add_tux_atom(req, ftp_flush_req);
+                       if (req->error)
+                               ftp_send_async_message(req, BAD_FILENAME, 200);
+                       else
+                               ftp_send_async_message(req, WRITE_DONE, 200);
+                       break;
+       }
+}
+
+#define sk_syn(sk) \
+       (!(sk)->sk_err && ((1 << (sk)->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)))
+#define req_syn(req) \
+       (!(req)->error && sk_syn((req)->data_sock->sk))
+
+static void ftp_wait_syn (tux_req_t *req, int cachemiss)
+{
+       Dprintk("ftp_wait_syn in: data socket state %d.\n", req->data_sock->state);
+       if (req_syn(req)) {
+               spin_lock_irq(&req->ti->work_lock);
+               add_keepalive_timer(req);
+               if (test_and_set_bit(0, &req->idle_input))
+                       TUX_BUG();
+               spin_unlock_irq(&req->ti->work_lock);
+               if (req_syn(req)) {
+                       add_tux_atom(req, ftp_wait_syn);
+                       return;
+               }
+               unidle_req(req);
+       }
+       Dprintk("ftp_wait_syn out: data socket state %d.\n", req->data_sock->state);
+       add_req_to_workqueue(req);
+}
+
+static void ftp_wait_close (tux_req_t *req, int cachemiss)
+{
+       struct sock *sk = req->data_sock->sk;
+
+       Dprintk("ftp_wait_close: data socket state %d.\n", sk->sk_state);
+
+       if (!req->error && (sk->sk_state <= TCP_FIN_WAIT1) && !sk->sk_err) {
+               spin_lock_irq(&req->ti->work_lock);
+               add_keepalive_timer(req);
+               if (test_and_set_bit(0, &req->idle_input))
+                       TUX_BUG();
+               spin_unlock_irq(&req->ti->work_lock);
+               if (!req->error && (sk->sk_state <= TCP_FIN_WAIT1) && !sk->sk_err) {
+                       add_tux_atom(req, ftp_wait_close);
+                       return;
+               }
+               unidle_req(req);
+       }
+       zap_data_socket(req);
+       add_tux_atom(req, ftp_flush_req);
+       if (req->error)
+               ftp_send_async_message(req, BAD_FILENAME, 200);
+       else
+               ftp_send_async_message(req, WRITE_DONE, 200);
+}
+
+void ftp_get_size (tux_req_t *req, int cachemiss)
+{
+       char file_size[200];
+       int missed, len;
+
+       if (!req->dentry) {
+               missed = lookup_object(req, cachemiss ? 0 : LOOKUP_ATOMIC);
+               if (!missed && !req->dentry) {
+                       ftp_send_async_message(req, BAD_FILENAME, 200);
+                       return;
+               }
+               if (missed) {
+                       if (cachemiss)
+                               TUX_BUG();
+                       add_tux_atom(req, ftp_get_size);
+                       queue_cachemiss(req);
+                       return;
+               }
+       }
+       req->in_file.f_pos = 0;
+       len = sprintf(file_size, "213 %Li\r\n", req->dentry->d_inode->i_size);
+       __ftp_send_async_message(req, file_size, 200, len);
+}
+
+void ftp_get_mdtm (tux_req_t *req, int cachemiss)
+{
+       unsigned int flag = cachemiss ? 0 : LOOKUP_ATOMIC;
+       struct dentry *dentry;
+       struct vfsmount *mnt = NULL;
+       char file_mdtm[200];
+       unsigned int len;
+       int err;
+
+       dentry = tux_lookup(req, req->objectname, flag, &mnt);
+       if (!dentry || IS_ERR(dentry)) {
+               if (PTR_ERR(dentry) == -EWOULDBLOCKIO) {
+                       if (cachemiss)
+                               TUX_BUG();
+                       add_tux_atom(req, ftp_get_mdtm);
+                       queue_cachemiss(req);
+                       return;
+               }
+               goto out_err;
+       }
+       err = permission(dentry->d_inode, MAY_READ, NULL);
+       if (err)
+               goto out_err_put;
+
+       req->in_file.f_pos = 0;
+       len = mdtm_time (file_mdtm, dentry->d_inode->i_mtime.tv_sec);
+       dput(dentry);
+       mntput(mnt);
+       __ftp_send_async_message(req, file_mdtm, 200, len);
+       return;
+
+out_err_put:
+       dput(dentry);
+       mntput(mnt);
+out_err:
+       ftp_send_async_message(req, BAD_FILENAME, 550);
+}
+
+static void ftp_get_file (tux_req_t *req, int cachemiss)
+{
+       int missed;
+
+       if (!req->dentry) {
+               missed = lookup_object(req, cachemiss ? 0 : LOOKUP_ATOMIC);
+               if (!missed && !req->dentry) {
+                       ftp_send_async_message(req, BAD_FILENAME, 200);
+                       return;
+               }
+               if (missed) {
+                       if (cachemiss)
+                               TUX_BUG();
+                       add_tux_atom(req, ftp_get_file);
+                       queue_cachemiss(req);
+                       return;
+               }
+       }
+       Dprintk("ftp_send_file %p, ftp_offset: %Ld, total_len: %Ld.\n", req, req->ftp_offset_start, req->total_file_len);
+       req->in_file.f_pos = 0;
+       if (req->ftp_offset_start) {
+               if (req->ftp_offset_start <= req->total_file_len) {
+                       req->offset_start = req->ftp_offset_start;
+                       req->in_file.f_pos = req->offset_start;
+               }
+               req->ftp_offset_start = 0;
+       }
+       req->output_len = req->total_file_len - req->offset_start;
+       req->prev_pos = req->in_file.f_pos;
+       Dprintk("ftp_send_file %p, f_pos: %Ld (out_len: %Ld).\n", req, req->in_file.f_pos, req->output_len);
+       add_tux_atom(req, ftp_send_file);
+       add_tux_atom(req, ftp_wait_syn);
+       add_tux_atom(req, ftp_flush_req);
+       ftp_send_async_message(req, WRITE_FILE, 200);
+}
+
+static void __exchange_sockets (tux_req_t *req)
+{
+       struct socket *tmp;
+
+       tmp = req->data_sock;
+       req->data_sock = req->sock;
+       req->sock = tmp;
+
+       req->in_file.f_pos = 0;
+}
+
+static void ftp_do_ls_start (tux_req_t *req, int cachemiss)
+{
+       Dprintk("ftp_do_ls_start(%p, %d).\n", req, cachemiss);
+       if (!req->cwd_dentry)
+               TUX_BUG();
+       __exchange_sockets(req);
+       queue_cachemiss(req);
+}
+
+static void ftp_do_ls_end (tux_req_t *req, int cachemiss)
+{
+       Dprintk("ftp_do_ls_end(%p, %d).\n", req, cachemiss);
+       __exchange_sockets(req);
+       if (tux_ftp_wait_close) {
+               req->data_sock->ops->shutdown(req->data_sock, SEND_SHUTDOWN);
+               add_tux_atom(req, ftp_wait_close);
+               add_req_to_workqueue(req);
+               return;
+       }
+       zap_data_socket(req);
+       add_tux_atom(req, ftp_flush_req);
+       if (req->error)
+               ftp_send_async_message(req, BAD_FILENAME, 200);
+       else
+               ftp_send_async_message(req, WRITE_DONE, 200);
+}
+
+static void ftp_chdir (tux_req_t *req, int cachemiss)
+{
+       unsigned int flag = cachemiss ? 0 : LOOKUP_ATOMIC;
+       struct dentry *dentry;
+       struct vfsmount *mnt = NULL;
+       int err;
+
+       Dprintk("ftp_chdir(%p, %d, {%s})\n", req, cachemiss, req->objectname);
+       dentry = tux_lookup(req, req->objectname, flag, &mnt);
+       if (!dentry || IS_ERR(dentry)) {
+               if (PTR_ERR(dentry) == -EWOULDBLOCKIO) {
+                       if (cachemiss)
+                               TUX_BUG();
+                       add_tux_atom(req, ftp_chdir);
+                       queue_cachemiss(req);
+                       return;
+               }
+               goto out_err;
+       }
+       err = permission(dentry->d_inode, MAY_EXEC, NULL);
+       if (err)
+               goto out_err_put;
+       req->cwd_dentry = dentry;
+       req->cwd_mnt = mnt;
+       ftp_send_async_message(req, GOOD_DIR, 200);
+       return;
+
+out_err_put:
+       dput(dentry);
+       mntput(mnt);
+out_err:
+       ftp_send_async_message(req, BAD_FILENAME, 550);
+}
+
+void ftp_accept_pasv (tux_req_t *req, int cachemiss)
+{
+       struct socket *sock, *new_sock = NULL;
+       struct tcp_opt *tp1, *tp2;
+       int err;
+
+       tp1 = tcp_sk(req->data_sock->sk);
+
+       Dprintk("PASV accept on req %p, accept_queue: %p.\n",
+                       req, tp1->accept_queue);
+       if (req->error || (req->data_sock->sk->sk_state != TCP_LISTEN))
+               goto error;
+new_socket:
+       if (!tp1->accept_queue) {
+               spin_lock_irq(&req->ti->work_lock);
+               add_keepalive_timer(req);
+               if (test_and_set_bit(0, &req->idle_input))
+                       TUX_BUG();
+               spin_unlock_irq(&req->ti->work_lock);
+               if (!tp1->accept_queue) {
+                       add_tux_atom(req, ftp_accept_pasv);
+                       return;
+               }
+               unidle_req(req);
+       }
+       new_sock = sock_alloc();
+       if (!new_sock)
+               goto error;
+       sock = req->data_sock;
+       new_sock->type = sock->type;
+       new_sock->ops = sock->ops;
+
+       err = sock->ops->accept(sock, new_sock, O_NONBLOCK);
+       Dprintk("PASV accept() returned %d (state %d).\n", err, new_sock->sk->sk_state);
+       if (err < 0)
+               goto error;
+       if (new_sock->sk->sk_state != TCP_ESTABLISHED)
+               goto error;
+       /*
+        * Do not allow other clients to steal the FTP connection!
+        */
+       if (inet_sk(new_sock->sk)->daddr != inet_sk(req->sock->sk)->daddr) {
+               Dprintk("PASV: ugh, unauthorized connect?\n");
+               sock_release(new_sock);
+               new_sock = NULL;
+               goto new_socket;
+       }
+       /*
+        * Zap the listen socket:
+        */
+       zap_data_socket(req);
+
+       tp2 = tcp_sk(new_sock->sk);
+       tp2->nonagle = 2;
+       tp2->ack.pingpong = tux_ack_pingpong;
+       new_sock->sk->sk_reuse = 1;
+       sock_set_flag(new_sock->sk, SOCK_URGINLINE);
+       sock_reset_flag(new_sock->sk, SOCK_LINGER);
+
+       link_tux_data_socket(req, new_sock);
+       add_req_to_workqueue(req);
+       return;
+
+error:
+       if (new_sock)
+               sock_release(new_sock);
+       req_err(req);
+       zap_data_socket(req);
+       ftp_send_async_message(req, CLOSE, 500);
+}
+
+static char * ftp_print_dir_line (tux_req_t *req, char *tmp, char *d_name, int d_len, int d_type, struct dentry *dentry, struct inode *inode)
+{
+       char *string0 = tmp;
+       unsigned int size;
+
+       if (req->ftp_command == FTP_COMM_NLST) {
+               memcpy(tmp, d_name, d_len);
+               tmp += d_len;
+               *tmp++ = '\r';
+               *tmp++ = '\n';
+               *tmp = 0;
+               return tmp;
+       }
+       switch (d_type) {
+               default:
+               case DT_UNKNOWN:
+               case DT_WHT:
+                       if (tux_hide_unreadable)
+                               goto out_dput;
+                       *tmp++ = '?';
+                       break;
+
+               case DT_FIFO:
+                       if (tux_hide_unreadable)
+                               goto out_dput;
+                       *tmp++ = 'p';
+                       break;
+
+               case DT_CHR:
+                       if (tux_hide_unreadable)
+                               goto out_dput;
+                       *tmp++ = 'c';
+                       break;
+
+               case DT_DIR:
+                       *tmp++ = 'd';
+                       break;
+
+               case DT_BLK:
+                       if (tux_hide_unreadable)
+                               goto out_dput;
+                       *tmp++ = 'b';
+                       break;
+
+               case DT_REG:
+                       *tmp++ = '-';
+                       break;
+
+               case DT_LNK:
+                       *tmp++ = 'l';
+                       break;
+
+               case DT_SOCK:
+                       if (tux_hide_unreadable)
+                               goto out_dput;
+                       *tmp++ = 's';
+                       break;
+       }
+
+       if (inode->i_mode & S_IRUSR) *tmp++ = 'r'; else *tmp++ = '-';
+       if (inode->i_mode & S_IWUSR) *tmp++ = 'w'; else *tmp++ = '-';
+       if (inode->i_mode & S_IXUSR) *tmp++ = 'x'; else *tmp++ = '-';
+       if (inode->i_mode & S_IRGRP) *tmp++ = 'r'; else *tmp++ = '-';
+       if (inode->i_mode & S_IWGRP) *tmp++ = 'w'; else *tmp++ = '-';
+       if (inode->i_mode & S_IXGRP) *tmp++ = 'x'; else *tmp++ = '-';
+       if (inode->i_mode & S_IROTH) *tmp++ = 'r'; else *tmp++ = '-';
+       if (inode->i_mode & S_IWOTH) *tmp++ = 'w'; else *tmp++ = '-';
+       if (inode->i_mode & S_IXOTH) *tmp++ = 'x'; else *tmp++ = '-';
+
+       *tmp++ = ' ';
+
+       size = sprintf(tmp, "%4i %d", inode->i_nlink, inode->i_uid);
+       tmp += size;
+
+       size = 14 - size;
+       if (size <= 0)
+               size = 1;
+       memset(tmp, ' ', size);
+       tmp += size;
+
+       size = sprintf(tmp, "%d", inode->i_gid);
+       tmp += size;
+
+       size = 9 - size;
+       if (size <= 0)
+               size = 1;
+       memset(tmp, ' ', size);
+       tmp += size;
+
+       tmp += sprintf(tmp, "%8Li", inode->i_size);
+       *tmp++ = ' ';
+
+       tmp += time_unix2ls(inode->i_mtime.tv_sec, tmp);
+       *tmp++ = ' ';
+
+       memcpy(tmp, d_name, d_len);
+       tmp += d_len;
+
+       if (d_type == DT_LNK) {
+               int len = 0, max_len;
+               #define ARROW " -> "
+
+               memcpy(tmp, ARROW, sizeof(ARROW)-1);
+               tmp += sizeof(ARROW)-1;
+               max_len = MAX_OBJECTNAME_LEN-(tmp-string0);
+               if (inode->i_op && inode->i_op->readlink) {
+                       mm_segment_t oldmm;
+
+                       oldmm = get_fs(); set_fs(KERNEL_DS);
+                       set_fs(KERNEL_DS);
+                       len = inode->i_op->readlink(dentry, tmp, max_len);
+                       set_fs(oldmm);
+               }
+               if (len > 0)
+                       tmp += len;
+               else
+                       Dprintk("hm, readlink() returned %d.\n", len);
+       }
+       *tmp++ = '\r';
+       *tmp++ = '\n';
+       *tmp = 0;
+
+       return tmp;
+out_dput:
+       return NULL;
+}
+
+static void ftp_do_ls_onefile (tux_req_t *req, int cachemiss)
+{
+       char string0[MAX_OBJECTNAME_LEN+200], *tmp;
+
+       tmp = ftp_print_dir_line(req, string0, req->objectname, req->objectname_len,
+DT_REG, req->dentry, req->dentry->d_inode);
+       if (!tmp) {
+               req_err(req);
+               add_req_to_workqueue(req);
+               return;
+       }
+       if (tmp - string0 >= MAX_OBJECTNAME_LEN+200)
+               BUG();
+       __ftp_send_async_message(req, string0, 200, tmp - string0);
+}
+
+static void ftp_lookup_listfile (tux_req_t *req, int cachemiss)
+{
+       unsigned int flag = cachemiss ? 0 : LOOKUP_ATOMIC;
+       struct dentry *dentry;
+       struct vfsmount *mnt = NULL;
+       int err;
+
+       Dprintk("ftp_lookup_listfile(%p, %d, {%s})\n", req, cachemiss, req->objectname);
+       dentry = tux_lookup(req, req->objectname, flag, &mnt);
+       if (!dentry || IS_ERR(dentry)) {
+               if (PTR_ERR(dentry) == -EWOULDBLOCKIO) {
+                       if (cachemiss)
+                               TUX_BUG();
+                       add_tux_atom(req, ftp_lookup_listfile);
+                       queue_cachemiss(req);
+                       return;
+               }
+               goto out_err;
+       }
+
+       if (S_ISDIR(dentry->d_inode->i_mode)) {
+               err = permission(dentry->d_inode, MAY_EXEC, NULL);
+               if (err) {
+                       Dprintk("Directory permission error: %d.\n", err);
+                       goto out_err_put;
+               }
+               install_req_dentry(req, dentry, mnt);
+
+               add_tux_atom(req, ftp_do_ls_end);
+               if (!req->cwd_dentry)
+                       TUX_BUG();
+               add_tux_atom(req, list_directory);
+       } else {
+               install_req_dentry(req, dentry, mnt);
+
+               add_tux_atom(req, ftp_do_ls_end);
+               add_tux_atom(req, ftp_do_ls_onefile);
+       }
+
+       add_tux_atom(req, ftp_do_ls_start);
+       add_tux_atom(req, ftp_wait_syn);
+       add_tux_atom(req, ftp_flush_req);
+       ftp_send_async_message(req, WRITE_LIST, 200);
+       return;
+
+out_err_put:
+       dput(dentry);
+       mntput(mnt);
+out_err:
+       ftp_send_async_message(req, BAD_FILENAME, 550);
+}
+
+static void ftp_execute_command (tux_req_t *req, int cachemiss)
+{
+       if (!req->parsed_len)
+               TUX_BUG();
+       trunc_headers(req);
+       req->keep_alive = 1;
+
+       switch (req->ftp_command) {
+
+#define ABORTED \
+       "226 Abort successful.\r\n"
+
+       case FTP_COMM_ABOR:
+       {
+               zap_data_socket(req);
+               ftp_send_async_message(req, ABORTED, 226);
+               break;
+       }
+
+       case FTP_COMM_PWD:
+       {
+               unsigned int str_len;
+               char *buf, *path;
+
+               buf = (char *)__get_free_page(GFP_KERNEL);
+               if (!buf) {
+                       req_err(req);
+                       ftp_send_async_message(req, LIST_ERR_MEM, 200);
+                       GOTO_ERR;
+               }
+
+               if (!req->cwd_dentry) {
+                       req->cwd_dentry = dget(req->docroot_dentry);
+                       req->cwd_mnt = mntget(req->docroot_mnt);
+               }
+
+// "257 "/" is current directory.\r\n"
+
+#define PART_1 "257 \""
+#define PART_1_LEN (sizeof(PART_1)-1)
+
+#define PART_3 "\" is current directory.\r\n"
+#define PART_3_LEN sizeof(PART_3)
+
+               path = tux_print_path(req, req->cwd_dentry, req->cwd_mnt,
+                       buf+PART_1_LEN, PAGE_SIZE - PART_3_LEN - PART_1_LEN);
+
+               if (path < buf + PART_1_LEN)
+                       BUG();
+
+               memcpy(path - PART_1_LEN, PART_1, PART_1_LEN);
+               memcpy(buf + PAGE_SIZE-PART_3_LEN-1, PART_3, PART_3_LEN);
+               str_len = buf + PAGE_SIZE-1 - (path - PART_1_LEN) - 1;
+
+               __ftp_send_async_message(req, path - PART_1_LEN, 226, str_len);
+               free_page((unsigned long)buf);
+               break;
+       }
+
+       case FTP_COMM_CDUP:
+       {
+               memcpy(req->objectname, "..", 3);
+               req->objectname_len = 2;
+               req->uri_str = req->objectname;
+               req->uri_len = req->objectname_len;
+
+               // fall through to CWD:
+       }
+       case FTP_COMM_CWD:
+       {
+               ftp_chdir(req, cachemiss);
+               break;
+       }
+
+       case FTP_COMM_NLST:
+       case FTP_COMM_LIST:
+       {
+               if (!req->data_sock) {
+                       req_err(req);
+                       ftp_send_async_message(req, LIST_ERR, 200);
+                       GOTO_ERR;
+               }
+               if (req->dentry)
+                       TUX_BUG();
+               if (!req->cwd_dentry) {
+                       req->cwd_dentry = dget(req->docroot_dentry);
+                       req->cwd_mnt = mntget(req->docroot_mnt);
+               }
+               if (req->objectname_len)
+                       ftp_lookup_listfile(req, cachemiss);
+               else {
+                       dget(req->cwd_dentry);
+                       mntget(req->cwd_mnt);
+                       install_req_dentry(req, req->cwd_dentry, req->cwd_mnt);
+                       if (!req->dentry)
+                               TUX_BUG();
+                       add_tux_atom(req, ftp_do_ls_end);
+                       if (!req->cwd_dentry)
+                               TUX_BUG();
+                       add_tux_atom(req, list_directory);
+                       add_tux_atom(req, ftp_do_ls_start);
+                       add_tux_atom(req, ftp_wait_syn);
+                       add_tux_atom(req, ftp_flush_req);
+                       ftp_send_async_message(req, WRITE_LIST, 200);
+               }
+               break;
+       }
+
+       case FTP_COMM_RETR:
+       {
+               if (!req->data_sock) {
+                       req_err(req);
+                       ftp_send_async_message(req, RETR_ERR, 200);
+                       GOTO_ERR;
+               }
+               ftp_get_file(req, cachemiss);
+               break;
+       }
+
+       case FTP_COMM_SIZE:
+       {
+               ftp_get_size(req, cachemiss);
+               break;
+       }
+
+       case FTP_COMM_MDTM:
+       {
+               ftp_get_mdtm(req, cachemiss);
+               break;
+       }
+
+       case FTP_COMM_PASV:
+       {
+               char buf [36 + 4*3 + 5 + 10];
+               struct socket *data_sock;
+               struct sockaddr_in addr;
+               unsigned int str_len;
+               struct tcp_opt *tp;
+               u32 local_addr;
+               int err;
+
+               if (req->data_sock)
+                       zap_data_socket(req);
+               /*
+                * Create FTP data connection to client:
+                */
+               err = sock_create(AF_INET, SOCK_STREAM, IPPROTO_IP, &data_sock);
+               if (err < 0) {
+                       Dprintk("sock create err: %d\n", err);
+                       req_err(req);
+                       ftp_send_async_message(req, CLOSE, 500);
+                       GOTO_ERR;
+               }
+                       
+               local_addr = inet_sk(req->sock->sk)->rcv_saddr;
+               addr.sin_family = AF_INET;
+               addr.sin_port = 0;
+               addr.sin_addr.s_addr = local_addr;
+               Dprintk("client address: (%d,%d,%d,%d).\n", 
+                       NIPQUAD(inet_sk(req->sock->sk)->daddr));
+
+               data_sock->sk->sk_reuse = 1;
+               sock_set_flag(data_sock->sk, SOCK_URGINLINE);
+               sock_reset_flag(data_sock->sk, SOCK_LINGER);
+
+               err = data_sock->ops->bind(data_sock,
+                               (struct sockaddr*)&addr, sizeof(addr));
+               tp = tcp_sk(data_sock->sk);
+               tp->nonagle = 2;
+               Dprintk("PASV bind() ret: %d.\n", err);
+               if (err < 0) {
+                       req_err(req);
+                       sock_release(data_sock);
+                       ftp_send_async_message(req, CLOSE, 500);
+                       GOTO_ERR;
+               }
+
+               tp->ack.pingpong = tux_ack_pingpong;
+
+               if (!tux_keepalive_timeout)
+                       tp->linger2 = 0;
+               else
+                       tp->linger2 = tux_keepalive_timeout * HZ;
+
+               err = data_sock->ops->listen(data_sock, 1);
+               Dprintk("PASV listen() ret: %d\n", err);
+               if (err) {
+                       req_err(req);
+                       sock_release(data_sock);
+                       ftp_send_async_message(req, CLOSE, 500);
+                       GOTO_ERR;
+               }
+               link_tux_data_socket(req, data_sock);
+
+               Dprintk("FTP PASV listen sock state: %d, sk state: %d\n",
+                       data_sock->state, data_sock->sk->sk_state);
+
+               str_len = sprintf(buf,
+                       "227 Entering Passive Mode (%d,%d,%d,%d,%d,%d)\r\n",
+                               NIPQUAD(local_addr),
+                               ntohs(inet_sk(data_sock->sk)->sport) / 256,
+                               ntohs(inet_sk(data_sock->sk)->sport) & 255 );
+               Dprintk("PASV mess: {%s}\n", buf);
+
+               add_tux_atom(req, ftp_accept_pasv);
+               add_tux_atom(req, ftp_flush_req);
+               __ftp_send_async_message(req, buf, 227, str_len);
+               break;
+       }
+
+       case FTP_COMM_PORT:
+       {
+               struct socket *data_sock;
+               struct sockaddr_in addr;
+               kernel_cap_t saved_cap;
+               u32 local_addr;
+               int err;
+
+               /*
+                * Create FTP data connection to client:
+                */
+               err = sock_create(AF_INET, SOCK_STREAM, IPPROTO_IP, &data_sock);
+               if (err < 0) {
+                       Dprintk("sock create err: %d\n", err);
+                       req_err(req);
+                       ftp_send_async_message(req, CLOSE, 500);
+                       GOTO_ERR;
+               }
+
+               local_addr = inet_sk(req->sock->sk)->rcv_saddr;
+               addr.sin_family = AF_INET;
+               addr.sin_port = htons(20);
+               addr.sin_addr.s_addr = local_addr;
+
+               Dprintk("data socket address: (%d,%d,%d,%d).\n",
+                       NIPQUAD(local_addr));
+
+               data_sock->sk->sk_reuse = 1;
+               sock_set_flag(data_sock->sk, SOCK_URGINLINE);
+               sock_reset_flag(data_sock->sk, SOCK_LINGER);
+
+               saved_cap = current->cap_effective;
+               cap_raise (current->cap_effective, CAP_NET_BIND_SERVICE);
+               err = data_sock->ops->bind(data_sock,
+                               (struct sockaddr*)&addr, sizeof(addr));
+               current->cap_effective = saved_cap;
+
+               Dprintk("ACTIVE bind() ret: %d.\n", err);
+               if (err) {
+                       sock_release(data_sock);
+                       req_err(req);
+                       ftp_send_async_message(req, CLOSE, 500);
+                       GOTO_ERR;
+               }
+               tcp_sk(data_sock->sk)->nonagle = 2;
+
+               link_tux_data_socket(req, data_sock);
+
+               addr.sin_family = AF_INET;
+               addr.sin_port = htons(req->ftp_user_port);
+               addr.sin_addr.s_addr = htonl(req->ftp_user_addr);
+
+               err = data_sock->ops->connect(data_sock, (struct sockaddr *) &addr, sizeof(addr), O_RDWR|O_NONBLOCK);
+               if (err && (err != -EINPROGRESS)) {
+                       Dprintk("connect error: %d\n", err);
+                       zap_data_socket(req);
+                       req_err(req);
+                       ftp_send_async_message(req, CLOSE, 500);
+                       GOTO_ERR;
+               }
+               Dprintk("FTP data sock state: %d, sk state: %d\n", data_sock->state, data_sock->sk->sk_state);
+               ftp_send_async_message(req, PORT_OK, 200);
+               break;
+       }
+
+       case FTP_COMM_USER:
+       {
+               if (!strcmp(req->username, "ftp")
+                        || !strcmp(req->username, "FTP")
+                        || !strcmp(req->username, "anonymous")
+                        || !strcmp(req->username, "ANONYMOUS")) {
+                       unsigned int str_len;
+                       char login_ok [200];
+
+                       if (!tux_ftp_login_message) {
+                               ftp_send_async_message(req, LOGIN_OK_PASS, 230);
+                               break;
+                       }
+                       update_bandwidth(req, 0); /* get current bandwidth */
+                       if (nr_requests_used() == 1)
+                               str_len = sprintf(login_ok, LOGIN_OK_ONE,
+                                       tux_max_connect, ftp_bandwidth);
+                       else
+                               str_len = sprintf(login_ok, LOGIN_OK,
+                                       nr_requests_used(), tux_max_connect, ftp_bandwidth);
+                       __ftp_send_async_message(req, login_ok, 200, str_len);
+               } else {
+                       clear_keepalive(req);
+                       ftp_send_async_message(req, LOGIN_FORBIDDEN, 530);
+               }
+               break;
+       }
+       case FTP_COMM_PASS:
+       {
+               ftp_send_async_message(req, LOGIN_OK_PASS, 230);
+               break;
+       }
+       case FTP_COMM_SITE:
+       {
+               ftp_send_async_message(req, SITE, 214);
+               break;
+       }
+       case FTP_COMM_SYST:
+       {
+               ftp_send_async_message(req, LINUX_SYST, 200);
+               break;
+       }
+       case FTP_COMM_TYPE:
+       {
+               ftp_send_async_message(req, TYPE_OK, 200);
+               break;
+       }
+#define EXTRA_FEATURES "211-Extensions supported:\r\n SIZE\r\n MDTM\r\n211 End\r\n"
+
+       case FTP_COMM_FEAT:
+       {
+               ftp_send_async_message(req, EXTRA_FEATURES, 211);
+               break;
+       }
+       case FTP_COMM_HELP:
+       case FTP_COMM_CLNT:
+       case FTP_COMM_NOOP:
+       {
+               ftp_send_async_message(req, COMMAND_OK, 200);
+               break;
+       }
+       case FTP_COMM_REST:
+       {
+               ftp_send_async_message(req, REST_OK, 200);
+               break;
+       }
+       case FTP_COMM_QUIT:
+       {
+               clear_keepalive(req);
+               ftp_send_async_message(req, BYE, 200);
+               break;
+       }
+
+       default:
+       {
+               req->keep_alive = 1;
+               ftp_send_async_message(req, CLOSE, 500);
+               break;
+       }
+       }
+       return;
+error:
+       Dprintk("rejecting FTP session!\n");
+       return;
+}
+
+
+static void ftp_timeout (tux_req_t *req, int cachemiss)
+{
+       Dprintk("called ftp_timeout(%p)\n", req);
+       if (req->error != TUX_ERROR_CONN_TIMEOUT)
+               TUX_BUG();
+       ftp_send_async_message(req, CLOSE_TIMEOUT, 421);
+}
+
+static void ftp_close (tux_req_t *req, int cachemiss)
+{
+       Dprintk("called ftp_close(%p)\n", req);
+       ftp_send_async_message(req, CLOSE, 500);
+}
+
+static void ftp_pre_log (tux_req_t *req)
+{
+       if (tux_ftp_log_retr_only && (req->ftp_command != FTP_COMM_RETR))
+               req->status = 0;
+       else
+               req->status = req->ftp_command;
+}
+
+tux_proto_t tux_proto_ftp = {
+       defer_accept: 0,
+       can_redirect: 0,
+       got_request: ftp_got_request,
+       parse_message: parse_ftp_message,
+       illegal_request: ftp_close,
+       request_timeout: ftp_timeout,
+       pre_log: ftp_pre_log,
+       check_req_err: ftp_check_req_err,
+       print_dir_line: ftp_print_dir_line,
+       name: "ftp",
+};
+
diff --git a/net/tux/proto_http.c b/net/tux/proto_http.c
new file mode 100644 (file)
index 0000000..192dd4f
--- /dev/null
@@ -0,0 +1,2199 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * proto_http.c: HTTP application protocol support
+ *
+ * Right now we detect simple GET headers, anything more
+ * subtle gets redirected to secondary server port.
+ */
+
+#include <net/tux.h>
+#include "parser.h"
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+/* 
+ * Parse the HTTP message and put results into the request structure.
+ * CISAPI extensions do not see the actual message buffer.
+ *
+ * Any perceived irregularity is honored with a redirect to the
+ * secondary server - which in most cases should be Apache. So
+ * if TUX gets confused by some strange request we fall back
+ * to Apache to be RFC-correct.
+ *
+ * The parser is 'optimistic', ie. it's optimized for the case where
+ * the whole message is available and correct. The parser is also
+ * supposed to be 'robust', ie. it can be called multiple times with
+ * an incomplete message, as new packets arrive.
+ */
+
+static inline int TOHEX (char c)
+{
+       switch (c) {
+               case '0' ... '9': c -= '0'; break;
+               case 'a' ... 'f': c -= 'a'-10; break;
+               case 'A' ... 'F': c -= 'A'-10; break;
+       default:
+               c = -1;
+       }
+       return c;
+}
+
+/*
+ * This function determines whether the client supports
+ * gzip-type content-encoding.
+ */
+static int may_gzip (const char *str, int len)
+{
+       const char *tmp, *curr;
+       int i;
+
+       if (len <= 4)
+               return 0;
+       tmp = str;
+       for (i = 0; i <= len-6; i++) {
+               Dprintk("gzip-checking: {%s}\n", tmp);
+               if (memcmp(tmp, " gzip", 5)) {
+                       tmp++;
+                       continue;
+               }
+               curr = tmp + 5;
+
+               if (*curr == ',' || *curr == '\r')
+                       return 1;
+               if (memcmp(curr, ";q=", 3))
+                       return 0;
+               curr += 3;
+               /*
+                * Every qvalue except explicitly zero is accepted.
+                * Zero values are "q=0.0", "q=0.00", "q=0.000".
+                * Parsing is optimized.
+                */
+               if (*curr == '0') {
+                       curr += 2;
+                       if (*curr == '0') {
+                               curr++;
+                               if (*curr == ' ' || *curr == '\r')
+                                       return 0;
+                               if (*curr == '0') {
+                                       curr++;
+                                       if (*curr == ' ' || *curr == '\r')
+                                               return 0;
+                                       if (*curr == '0') {
+                                               curr++;
+                                               if (*curr == ' ' ||
+                                                               *curr == '\r')
+                                                       return 0;
+                                       }
+                               }
+                       }
+               }
+               return 1;
+       }
+       return 0;
+}
+
+/*
+ * This function strips off 'strip_host_tail' number of hostname
+ * components from the tail of the hostname.
+ *
+ * Eg. with a value of '1', the "somesite.hosting.com" hostname gets
+ * transformed into the "somesite" string.
+ */
+static void strip_hostname(tux_req_t *req)
+{
+       int strip = strip_host_tail;
+       int left = req->host_len;
+       int component = 0;
+
+       if (!strip || !left)
+               return;
+
+       while (--left) {
+               if (req->host[left] != '.')
+                       continue;
+               if (++component == strip)
+                       break;
+       }
+       if (!left)
+               return;
+       req->host[left] = 0;
+       req->host_len = left;
+}
+
+static void http_lookup_vhost (tux_req_t *req, int cachemiss);
+static void http_process_message (tux_req_t *req, int cachemiss);
+
+int parse_http_message (tux_req_t *req, const int total_len)
+{
+       int hexhex = 0, hex_val_0 = 0, hex_val_1 = 0;
+       const char *curr, *uri, *message;
+       unsigned int objectname_len, left;
+       unsigned int have_r = 0;
+       char c;
+
+       left = total_len;
+       message = req->headers;
+       Dprintk("parsing request:\n---\n%s\n---\n", message);
+/*
+ * RFC 2616, 5.1:
+ *
+ *      Request-Line   = Method SP Request-URI SP HTTP-Version CRLF
+ */
+
+       if (!total_len)
+               TUX_BUG();
+
+       curr = message;
+
+#define GOTO_INCOMPLETE do { Dprintk("incomplete at %s:%d.\n", __FILE__, __LINE__); goto incomplete_message; } while (0)
+#define GOTO_REDIR do { TDprintk("redirect secondary at %s:%d.\n", __FILE__, __LINE__); goto error; } while (0)
+
+#define PRINT_MESSAGE_LEFT \
+    Dprintk("message left (%d) at %s:%d:\n--->{%s}<---\n", left, __FILE__, __LINE__, curr)
+
+       switch (*curr) {
+               case 'G':
+                       if (PARSE_METHOD(req,curr,GET,left))
+                               break;
+                       GOTO_REDIR;
+
+               case 'H':
+                       if (PARSE_METHOD(req,curr,HEAD,left))
+                               break;
+                       GOTO_REDIR;
+
+               case 'P':
+                       if (PARSE_METHOD(req,curr,POST,left))
+                               break;
+                       if (PARSE_METHOD(req,curr,PUT,left))
+                               break;
+                       GOTO_REDIR;
+
+               default:
+                       GOTO_REDIR;
+       }
+
+       req->method_str = message;
+       req->method_len = curr-message-1;
+
+       Dprintk("got method %d\n", req->method);
+
+       PRINT_MESSAGE_LEFT;
+
+       /*
+        * Ok, we got one of the methods we can handle, parse
+        * the URI:
+        */
+
+       {
+               // Do not allow leading "../" and intermediate "/../"
+               int dotdot = 1;
+               char *tmp = req->objectname;
+               int slashcheck = 1;
+
+               req->uri_str = uri = curr;
+
+               for (;;) {
+                       c = get_c(curr,left);
+                       if (slashcheck) {
+                               if (c == '/')
+                                       continue;
+                               slashcheck = 0;
+                       }
+
+                       PRINT_MESSAGE_LEFT;
+                       if (c == ' ' || ((c == '?') && (tux_ignore_query != 1)) || c == '\r' || c == '\n')
+                               break;
+                       if (c == '#')
+                               GOTO_REDIR;
+
+                       Dprintk("hexhex: %d.\n", hexhex);
+                       /*
+                        * First handle HEX HEX encoding
+                        */
+                       switch (hexhex) {
+                               case 0:
+                                       if (c == '%') {
+                                               hexhex = 1;
+                                               goto continue_parsing;
+                                       }
+                                       break;
+                               case 1:
+                                       hex_val_0 = TOHEX(c);
+                                       if (hex_val_0 < 0)
+                                               GOTO_REDIR;
+                                       hexhex = 2;
+                                       goto continue_parsing;
+                               case 2:
+                                       hex_val_1 = TOHEX(c);
+                                       if (hex_val_1 < 0)
+                                               GOTO_REDIR;
+                                       c = (hex_val_0 << 4) | hex_val_1;
+                                       if (!c)
+                                               GOTO_REDIR;
+                                       hexhex = 0;
+                                       break;
+                               default:
+                                       TUX_BUG();
+                       }
+                       if (hexhex)
+                               TUX_BUG();
+
+                       switch (dotdot) {
+                               case 0:
+                                       break;
+                               case 1:
+                                       if (c == '.')
+                                               dotdot = 2;
+                                       else
+                                               dotdot = 0;
+                                       break;
+                               case 2:
+                                       if (c == '.')
+                                               dotdot = 3;
+                                       else
+                                               dotdot = 0;
+                                       break;
+                               case 3:
+                                       if (c == '/')
+                                               GOTO_REDIR;
+                                       else
+                                               dotdot = 0;
+                                       break;
+                               default:
+                                       TUX_BUG();
+                       }
+                       if (!dotdot && (c == '/'))
+                               dotdot = 1;
+
+                       *(tmp++) = c;
+continue_parsing:
+                       if (curr - uri >= MAX_OBJECTNAME_LEN)
+                               GOTO_REDIR;
+               }
+               PRINT_MESSAGE_LEFT;
+               *tmp = 0;
+
+               // handle trailing "/.."
+               if (dotdot == 3)
+                       GOTO_REDIR;
+
+               objectname_len = tmp - req->objectname;
+               req->objectname_len = objectname_len;
+       }
+       Dprintk("got filename %s (%d)\n", req->objectname, req->objectname_len);
+
+       PRINT_MESSAGE_LEFT;
+
+       /*
+        * Parse optional query string. Copy until end-of-string or space.
+        */
+       if (c == '?') {
+               int query_len;
+               const char *query;
+
+               req->query_str = query = curr;
+
+               for (;;) {
+                       c = get_c(curr,left);
+                       if (c == ' ')
+                               break;
+                       if (c == '#')
+                               GOTO_REDIR;
+               }
+               if (unlikely(tux_ignore_query == 2))
+                       req->query_str = NULL;
+               else {
+                       query_len = curr-query-1;
+                       req->query_len = query_len;
+               }
+       }
+       if (req->query_len)
+               Dprintk("got query string %s (%d)\n", req->query_str, req->query_len);
+       req->uri_len = curr-uri-1;
+       if (!req->uri_len)
+               GOTO_REDIR;
+       Dprintk("got URI %s (%d)\n", req->uri_str, req->uri_len);
+
+       PRINT_MESSAGE_LEFT;
+       /*
+        * Parse the HTTP version field:
+        */
+       req->version_str = curr;
+       if (!PARSE_TOKEN(curr,"HTTP/1.",left))
+               GOTO_REDIR;
+
+       switch (get_c(curr,left)) {
+               case '0':
+                       req->version = HTTP_1_0;
+                       break;
+               case '1':
+                       req->version = HTTP_1_1;
+                       break;
+               default:
+                       GOTO_REDIR;
+       }
+       /*
+        * We default to keepalive in the HTTP/1.1 case and default
+        * to non-keepalive in the HTTP/1.0 case. If max_keepalives
+        * is 0 then we do no keepalives.
+        */
+       clear_keepalive(req);
+       if (tux_max_keepalives && (req->version == HTTP_1_1))
+               req->keep_alive = 1;
+       req->version_len = curr - req->version_str;
+
+       if (get_c(curr,left) != '\r')
+               GOTO_REDIR;
+       if (get_c(curr,left) != '\n')
+               GOTO_REDIR;
+
+       Dprintk("got version %d [%d]\n", req->version, req->version_len);
+       PRINT_MESSAGE_LEFT;
+
+       /*
+        * Now parse (optional) request header fields:
+        */
+       for (;;) {
+               char c;
+
+               c = get_c(curr,left);
+               switch (c) {
+               case '\r':
+                       if (have_r)
+                               GOTO_REDIR;
+                       have_r = 1;
+                       continue;
+               case '\n':
+                       if (!have_r)
+                               GOTO_REDIR;
+                       goto out;
+               default:
+                       if (have_r)
+                               GOTO_REDIR;
+               }
+
+#define PARSE_STR_FIELD(char,field,str,len)                            \
+       if (PARSE_TOKEN(curr,field,left)) {                             \
+               req->str = curr;                                        \
+               SKIP_LINE(curr,left);                                   \
+               req->len = curr - req->str - 2;                         \
+               Dprintk(char field "field: %s.\n", req->str);           \
+               break;                                                  \
+       }
+
+#define ALLOW_UNKNOWN_FIELDS 1
+#ifdef ALLOW_UNKNOWN_FIELDS
+# define UNKNOWN_FIELD { SKIP_LINE(curr,left); break; }
+#else
+# define UNKNOWN_FIELD GOTO_REDIR
+#endif
+
+               switch (c) {
+               case 'A':
+                       PARSE_STR_FIELD("A","ccept: ",
+                               accept_str,accept_len);
+                       if (PARSE_TOKEN(curr,"ccept-Encoding: ",left)) {
+                               const char *str = curr-1;
+
+                               req->accept_encoding_str = curr;
+                               SKIP_LINE(curr,left);
+                               req->accept_encoding_len = curr - req->accept_encoding_str - 2;
+                               Dprintk("Accept-Encoding field: {%s}.\n", str);
+
+                               if (tux_compression && may_gzip(str,curr-str)) {
+                                       Dprintk("client accepts gzip!.\n");
+                                       req->may_send_gzip = 1;
+                               }
+                               break;
+                       }
+                       PARSE_STR_FIELD("A","ccept-Charset: ",
+                               accept_charset_str,accept_charset_len);
+                       PARSE_STR_FIELD("A","ccept-Language: ",
+                               accept_language_str,accept_language_len);
+                       UNKNOWN_FIELD;
+
+               case 'C':
+                       if (PARSE_TOKEN(curr,"onnection: ",left)) {
+next_token:
+                       switch (get_c(curr,left)) {
+                       case 'K':
+                               if (!PARSE_TOKEN(curr,"eep-Alive",left))
+                                       GOTO_REDIR;
+                               if (tux_max_keepalives)
+                                       req->keep_alive = 1;
+                               break;
+
+                       case 'C':
+                       case 'c':
+                               if (!PARSE_TOKEN(curr,"lose",left))
+                                       GOTO_REDIR;
+                               clear_keepalive(req);
+                               break;
+
+                       case 'k':
+                               if (!PARSE_TOKEN(curr,"eep-alive",left))
+                                       GOTO_REDIR;
+                               if (tux_max_keepalives)
+                                       req->keep_alive = 1;
+                               break;
+                       case 'T':
+                               if (PARSE_TOKEN(curr,"E",left))
+                                       break;
+                               if (PARSE_TOKEN(curr,"railers",left))
+                                       break;
+                               if (PARSE_TOKEN(curr,"ransfer-Encoding",left))
+                                       break;
+                               GOTO_REDIR;
+                       case 'P':
+                               if (PARSE_TOKEN(curr,"roxy-Authenticate",left))
+                                       break;
+                               if (PARSE_TOKEN(curr,"roxy-Authorization",left))
+                                       break;
+                               GOTO_REDIR;
+                       case 'U':
+                               if (!PARSE_TOKEN(curr,"pgrade",left))
+                                       GOTO_REDIR;
+                               break;
+                       case ' ':
+                               PRINT_MESSAGE_LEFT;
+                               goto next_token;
+                       case ',':
+                               PRINT_MESSAGE_LEFT;
+                               goto next_token;
+                       default:
+                               GOTO_REDIR;
+                       }
+                       PRINT_MESSAGE_LEFT;
+                       if (*curr != '\r')
+                               goto next_token;
+                       // allow other tokens.
+                       SKIP_LINE(curr,left);
+                       break;
+                       }
+
+                       PARSE_STR_FIELD("C","ookie: ",
+                               cookies_str,cookies_len);
+                       PARSE_STR_FIELD("C","ontent-Type: ",
+                               content_type_str,content_type_len);
+
+                       if (PARSE_TOKEN(curr,"ontent-Length: ",left) ||
+                           PARSE_TOKEN(curr,"ontent-length: ",left)) {
+                               const char *tmp;
+                               req->contentlen_str = curr;
+                               SKIP_LINE(curr,left);
+                               req->contentlen_len = curr - req->contentlen_str - 2;
+                               if (req->contentlen_len) {
+                                       tmp = req->contentlen_str;
+                                       req->content_len = simple_strtoul(tmp, NULL, 10);
+                               }
+                               Dprintk("Content-Length field: %s [%d].\n", req->contentlen_str, req->contentlen_len);
+                               Dprintk("Content-Length value: %d.\n", req->content_len);
+                               break;
+                       }
+                       PARSE_STR_FIELD("C","ache-Control: ",
+                               cache_control_str,cache_control_len);
+                       UNKNOWN_FIELD;
+
+               case 'H':
+                       if (PARSE_TOKEN(curr,"ost: ",left)) {
+                               const char *tmp = curr;
+                               char *tmp2 = req->host;
+
+                               /*
+                                * canonize the hostname:
+                                *
+                                * 1) strip off preceding 'www.' variants,
+                                * 2) transform it to lowercase.
+                                * 3) strip trailing dots
+                                * 4) potentially strip off tail
+                                */
+                               
+#define is_w(n) ((curr[n] == 'w') || (curr[n] == 'W'))
+
+                               if ((left > 4) && is_w(0) && is_w(1) &&
+                                               is_w(2) && curr[3] == '.') {
+                                       curr += 4;
+                                       left -= 4;
+                                       tmp = curr;
+                               }
+                        
+                               COPY_LINE_TOLOWER(curr, tmp2, left, req->host+MAX_HOST_LEN-2);
+                               req->host_len = curr - tmp - 2;
+                               while (req->host[req->host_len] == '.') {
+                                       if (!req->host_len)
+                                               break;
+                                       req->host_len--;
+                               }
+                               req->host[req->host_len] = 0;
+                               if (strip_host_tail)
+                                       strip_hostname(req);
+                               Dprintk("Host field: %s [%d].\n", req->host, req->host_len);
+                               break;
+                       }
+                       UNKNOWN_FIELD;
+
+               case 'I':
+                       PARSE_STR_FIELD("I","f-None-Match: ",
+                               if_none_match_str,if_none_match_len);
+                       PARSE_STR_FIELD("I","f-Modified-Since: ",
+                               if_modified_since_str,if_modified_since_len);
+                       PARSE_STR_FIELD("I","f-Range: ",
+                               if_range_str,if_range_len);
+                       UNKNOWN_FIELD;
+
+               case 'N':
+                       PARSE_STR_FIELD("N","egotiate: ",
+                               negotiate_str,negotiate_len);
+                       UNKNOWN_FIELD;
+
+               case 'P':
+                       PARSE_STR_FIELD("P","ragma: ",
+                               pragma_str,pragma_len);
+                       UNKNOWN_FIELD;
+
+               case 'R':
+
+                       PARSE_STR_FIELD("R","eferer: ",
+                               referer_str,referer_len);
+                       if (!PARSE_TOKEN(curr,"ange: bytes=",left))
+                               UNKNOWN_FIELD;
+               {
+                       const char *tmp = curr;
+                       char *tmp2 = (char *)curr;
+                       unsigned int offset_start = 0, offset_end = 0;
+
+                       if (*tmp2 != '-')
+                               offset_start = simple_strtoul(tmp2, &tmp2, 10);
+                       if (*tmp2 == '-') {
+                               tmp2++;
+                               if (*tmp2 != '\r')
+                                       offset_end = simple_strtoul(tmp2, &tmp2, 10) +1;
+                       }
+                       curr = tmp2;
+                       left -= tmp2-tmp;
+
+                       req->offset_start = offset_start;
+                       req->offset_end = offset_end;
+
+                       SKIP_LINE(curr,left);
+                       Dprintk("Range field: %s [%d] (%d-%d).\n", tmp, curr-tmp, offset_start, offset_end);
+                       break;
+               }
+
+               case 'U':
+                       PARSE_STR_FIELD("U","ser-Agent: ",
+                               user_agent_str,user_agent_len);
+                       UNKNOWN_FIELD;
+
+               default:
+                       UNKNOWN_FIELD;
+               }
+               PRINT_MESSAGE_LEFT;
+       }
+out:
+       /*
+        * POST data.
+        */
+       if ((req->method == METHOD_POST) && req->content_len) {
+               PRINT_MESSAGE_LEFT;
+               if (curr + req->content_len > message + total_len)
+                       GOTO_INCOMPLETE;
+               req->post_data_str = curr;
+               req->post_data_len = req->content_len;
+               curr += req->content_len;
+               left -= req->content_len;
+               Dprintk("POST-ed data: {%s}\n", req->post_data_str);
+       }
+
+       switch (req->method) {
+               default:
+                       GOTO_REDIR;
+               case METHOD_GET:
+               case METHOD_HEAD:
+               case METHOD_POST:
+               case METHOD_PUT:
+                       ;
+       }
+
+#define TUX_SCHEME "http://"
+#define TUX_SCHEME_LEN (sizeof(TUX_SCHEME)-1)
+
+       if (!memcmp(req->objectname, TUX_SCHEME, TUX_SCHEME_LEN)) {
+
+               /* http://user:password@host:port/object */
+
+               const char *head, *tail, *end, *host, *port;
+               int host_len, objectname_len;
+
+               head = req->objectname + TUX_SCHEME_LEN;
+               end = req->objectname + req->objectname_len;
+
+               tail = memchr(head, '/', end - head);
+               if (!tail)
+                       GOTO_REDIR;
+               host = memchr(head, '@', tail - head);
+               if (!host)
+                       host = head;
+               else
+                       host++;
+               if (!*host)
+                       GOTO_REDIR;
+               port = memchr(host, ':', tail - host);
+               if (port)
+                       host_len = port - host;
+               else
+                       host_len = tail - host;
+               if (host_len >= MAX_HOST_LEN)
+                       GOTO_REDIR;
+               memcpy(req->host, host, host_len);
+               req->host_len = host_len;
+               req->host[host_len] = 0;
+
+               if (*tail != '/')
+                       TUX_BUG();
+
+               req->uri_str = tail;
+               req->uri_len = end - tail;
+
+               tail++;
+               while (*tail == '/')
+                       tail++;
+
+               objectname_len = end - tail;
+               memcpy(req->objectname, tail, objectname_len);
+               req->objectname_len = objectname_len;
+               req->objectname[objectname_len] = 0;
+       } else
+               if (req->uri_str[0] != '/')
+                       GOTO_REDIR;
+
+       if ((req->version == HTTP_1_1) && !req->host_len)
+               GOTO_REDIR;
+       if (req->objectname[0] == '/')
+               GOTO_REDIR;
+       /*
+        * Lets make sure nobody plays games with the host
+        * header in a virtual hosting environment:
+        */
+       if (req->virtual && req->host_len) {
+               if (memchr(req->host, '/', req->host_len))
+                       GOTO_REDIR;
+               if (req->host[0] == '.') {
+                       if (req->host_len == 1)
+                               GOTO_REDIR;
+                       if ((req->host_len == 2) && (req->host[0] == '.'))
+                               GOTO_REDIR;
+               }
+       }
+       /*
+        * From this point on the request is for the main TUX engine:
+        */
+       Dprintk("ok, request accepted.\n");
+
+       if (req->keep_alive) {
+               req->nr_keepalives++;
+               if (req->nr_keepalives == -1)
+                       req->nr_keepalives--;
+               INC_STAT(nr_keepalive_reqs);
+       } else
+               INC_STAT(nr_nonkeepalive_reqs);
+       INC_STAT(keepalive_hist[req->nr_keepalives]);
+
+       PRINT_MESSAGE_LEFT;
+       req->parsed_len = curr-message;
+       if (req->dentry)
+               TUX_BUG();
+       req->virtual = tux_virtual_server;
+       if (req->virtual)
+               add_tux_atom(req, http_lookup_vhost);
+       else {
+               req->docroot_dentry = dget(req->proto->main_docroot.dentry);
+               req->docroot_mnt = mntget(req->proto->main_docroot.mnt);
+               add_tux_atom(req, http_process_message);
+       }
+
+       return req->parsed_len;
+
+incomplete_message:
+       Dprintk("incomplete message!\n");
+       PRINT_MESSAGE_LEFT;
+
+       return 0;
+
+error:
+       if (total_len > 0)
+               req->parsed_len = total_len;
+       else
+               req->parsed_len = 0;
+       PRINT_MESSAGE_LEFT;
+       if (tux_TDprintk) {
+               TDprintk("redirecting message to secondary server.\n");
+               print_req(req);
+       }
+       return -1;
+}
+
+static int lookup_url (tux_req_t *req, const unsigned int flag)
+{
+       /*
+        * -1 : no previous checks made
+        *  0 : previous check failed, do not check farther, 
+        *  1 : previous check successed, check farther
+        */
+       int not_modified = -1;
+       int perm = 0, i;
+       struct dentry *dentry = NULL;
+       struct vfsmount *mnt = NULL;
+       struct inode *inode;
+       const char *filename;
+
+       /*
+        * Do not do any etag or last_modified header checking
+        * if both unset.
+        */
+       if (!tux_generate_etags && !tux_generate_last_mod)
+               not_modified = 0;
+
+repeat_lookup:
+       if (req->dentry)
+               TUX_BUG();
+
+       filename = req->objectname;
+       Dprintk("will look up {%s} (%d)\n", filename, req->objectname_len);
+       Dprintk("current->fsuid: %d, current->fsgid: %d, ngroups: %d\n",
+               current->fsuid, current->fsgid, current->group_info->ngroups);
+       for (i = 0; i < current->group_info->ngroups; i++)
+               Dprintk(".. group #%d: %d.\n", i, current->groups[i]);
+
+       dentry = tux_lookup(req, filename, flag, &mnt);
+
+#define INDEX "/index.html"
+
+       if (!dentry || IS_ERR(dentry)) {
+               if (PTR_ERR(dentry) == -EWOULDBLOCKIO)
+                       goto cachemiss;
+
+               if (tux_http_dir_indexing && (req->lookup_dir == 1)) {
+                       // undo the index.html appending:
+                       req->objectname_len -= sizeof(INDEX)-1;
+                       req->objectname[req->objectname_len] = 0;
+                       req->lookup_dir = 2;
+                       goto repeat_lookup;
+               }
+               if (!req->lookup_404) {
+                       int len = strlen(tux_404_page);
+                       memcpy(req->objectname, tux_404_page, len);
+                       req->objectname[len] = 0;
+                       req->objectname_len = len;
+                       req->lookup_404 = 1;
+                       req->status = 404;
+                       goto repeat_lookup;
+               }
+               TDprintk("abort - lookup error.\n");
+               goto abort;
+       }
+
+       Dprintk("SUCCESS, looked up {%s} == dentry %p (inode %p, count %d.)\n", filename, dentry, dentry->d_inode, atomic_read(&dentry->d_count));
+       inode = dentry->d_inode;
+
+       /*
+        * At this point we have a real, non-negative dentry.
+        */
+       perm = tux_permission(inode);
+
+       if ((perm < 0) || (!S_ISDIR(dentry->d_inode->i_mode)
+                               && !S_ISREG(dentry->d_inode->i_mode))) {
+               Dprintk("FAILED trusted dentry %p permission %d.\n", dentry, perm);
+               req->status = 403;
+               goto abort;
+       }
+       if ((req->lookup_dir != 2) && S_ISDIR(dentry->d_inode->i_mode)) {
+               if (req->lookup_dir || (req->objectname_len +
+                                sizeof(INDEX) >= MAX_OBJECTNAME_LEN)) {
+                       req->status = 403;
+                       goto abort;
+               }
+               if (req->objectname_len && (req->objectname[req->objectname_len-1] != '/')) {
+                       dput(dentry);
+                       mntput(mnt);
+                       req->lookup_dir = 0;
+                       return 2;
+               }
+               memcpy(req->objectname + req->objectname_len,
+                                               INDEX, sizeof(INDEX));
+               req->objectname_len += sizeof(INDEX)-1;
+               req->lookup_dir = 1;
+               dput(dentry);
+               mntput(mnt);
+               mnt = NULL;
+               dentry = NULL;
+               goto repeat_lookup;
+       }
+       if (tux_max_object_size && (inode->i_size > tux_max_object_size)) {
+               TDprintk("too big object, %Ld bytes.\n", inode->i_size);
+               req->status = 403;
+               goto abort;
+       }
+       req->total_file_len = inode->i_size;
+       req->mtime = inode->i_mtime.tv_sec;
+
+       {
+               loff_t num = req->total_file_len;
+               int nr_digits = 0;
+               unsigned long modulo;
+               char * etag_p = req->etag;
+               char digits [30];
+
+               do {
+                       modulo = do_div(num, 10);
+                       digits[nr_digits++] = '0' + modulo;
+               } while (num);
+
+               req->lendigits = nr_digits;
+               req->etaglen = nr_digits;
+
+               while (nr_digits)
+                       *etag_p++ = digits[--nr_digits];
+
+               *etag_p++ = '-';
+               num = req->mtime;
+               nr_digits = 0;
+
+               do {
+                       digits[nr_digits++] = 'a' + num % 16;
+                               num /= 16;
+               } while (num);
+               req->etaglen += nr_digits+1;
+               while (nr_digits)
+                       *etag_p++ = digits[--nr_digits];
+               *etag_p = 0;
+       }
+
+       if ((req->if_none_match_len >= req->etaglen) && (abs(not_modified) == 1)) {
+
+               char * etag_p = req->etag;
+               const char * match_p = req->if_none_match_str;
+               int pos = req->etaglen - 1;
+               int matchpos = req->etaglen - 1;
+
+               do {
+                       while (etag_p[matchpos--] == match_p[pos--])
+                               if (matchpos < 0)
+                                       break;
+                       if (matchpos < 0)
+                               pos = req->if_none_match_len;
+                       else {
+                               if (match_p[pos+1] == ',')
+                                       pos += req->etaglen + 2;
+                               else
+                                       pos += req->etaglen-matchpos;
+                               matchpos = req->etaglen - 1;
+                       }
+               } while (pos < req->if_none_match_len);
+
+               if (matchpos < 0) {
+                       not_modified = 1;
+                       TDprintk("Etag matched.\n");
+               } else
+                       not_modified = 0; 
+       }
+
+        if ((req->if_modified_since_len >= 24) && (abs(not_modified) == 1)) {
+                if (parse_time(req->if_modified_since_str, req->if_modified_since_len) >= req->mtime ) {
+                       not_modified = 1;
+                        Dprintk("Last-Modified matched.\n");
+                } else
+                       not_modified = 0;
+        }
+
+       if (not_modified == 1) {
+               req->status = 304;
+               goto abort;
+       }
+
+       Dprintk("looked up cached dentry %p, (count %d.)\n", dentry, dentry ? atomic_read(&dentry->d_count) : -1 );
+
+       url_hist_hit(req->total_file_len);
+out:
+       install_req_dentry(req, dentry, mnt);
+       req->lookup_dir = 0;
+       return 0;
+
+cachemiss:
+       return 1;
+
+abort:
+       if (dentry) {
+               if (!IS_ERR(dentry))
+                       dput(dentry);
+               dentry = NULL;
+       }
+       if (mnt) {
+               if (!IS_ERR(mnt))
+                       mntput(mnt);
+               mnt = NULL;
+       }
+#if CONFIG_TUX_DEBUG
+       if (!not_modified) {
+               TDprintk("req %p has lookup errors!\n", req);
+               if (tux_TDprintk)
+                       print_req(req);
+       }
+#endif
+       req_err(req);
+       goto out;
+}
+
+int handle_gzip_req (tux_req_t *req, unsigned int flags)
+{
+       char *curr = req->objectname + req->objectname_len;
+       struct dentry *dentry;
+       struct vfsmount *mnt = NULL;
+       struct inode *inode, *orig_inode;
+       loff_t size, orig_size;
+
+       *curr++ = '.';
+       *curr++ = 'g';
+       *curr++ = 'z';
+       *curr++ = 0;
+       req->objectname_len += 3;
+
+       dentry = tux_lookup(req, req->objectname, flags, &mnt);
+
+       req->objectname_len -= 3;
+       req->objectname[req->objectname_len] = 0;
+
+       if (!dentry)
+               return 0;
+       if (IS_ERR(dentry)) {
+               if (PTR_ERR(dentry) == -EWOULDBLOCKIO) {
+                       release_req_dentry(req);
+                       return 1;
+               }
+               return 0;
+       }
+
+       inode = dentry->d_inode;
+       size = inode->i_size;
+       orig_inode = req->dentry->d_inode;
+       orig_size = orig_inode->i_size;
+
+       if (!tux_permission(inode)
+                       && (size < orig_size)
+                       && (inode->i_mtime.tv_sec >= orig_inode->i_mtime.tv_sec)) {
+
+               release_req_dentry(req);
+               install_req_dentry(req, dentry, mnt);
+               req->total_file_len = req->output_len = size;
+               Dprintk("content WILL be gzipped!\n");
+               req->content_gzipped = 1;
+       } else {
+               dput(dentry);
+               mntput(mnt);
+       }
+
+       return 0;
+}
+
+static spinlock_t mimetypes_lock = SPIN_LOCK_UNLOCKED;
+
+static LIST_HEAD(mimetypes_head);
+
+static mimetype_t default_mimetype = { type: "text/plain", type_len: 10, expire_str: "", expire_str_len: 0 };
+
+#define MAX_MIMETYPE_LEN 128
+#define MAX_CACHE_CONTROL_AGE_LEN 30
+
+void add_mimetype (char *new_ext, char *new_type, char *new_expire)
+{
+       int type_len = strlen(new_type);
+       int ext_len = strlen(new_ext);
+       int expire_len = strlen(new_expire);
+       mimetype_t *mime;
+       char *ext, *type, *expire;
+
+        if (type_len > MAX_MIMETYPE_LEN)
+                type_len = MAX_MIMETYPE_LEN;
+        if (ext_len > MAX_URI_LEN)
+                ext_len = MAX_URI_LEN;
+        if (expire_len > MAX_CACHE_CONTROL_AGE_LEN)
+                expire_len = MAX_CACHE_CONTROL_AGE_LEN;
+
+       mime = tux_kmalloc(sizeof(*mime));
+       memset(mime, 0, sizeof(*mime));
+       ext = tux_kmalloc(ext_len + 1);
+       type = tux_kmalloc(type_len + 1);
+       expire = tux_kmalloc(expire_len + 1);
+
+       strncpy(ext, new_ext, ext_len);
+       strncpy(type, new_type, type_len);
+       strncpy(expire, new_expire, expire_len);
+       
+       // in case one of the above parameters was too long :
+
+       ext[ext_len] = '\0';
+       type[type_len] = '\0';
+       expire[expire_len] = '\0';
+
+       mime->ext = ext;
+       mime->ext_len = ext_len;
+
+       mime->type = type;
+       mime->type_len = type_len;
+
+       mime->expire_str = expire;
+       mime->expire_str_len = expire_len;
+
+       mime->special = NORMAL_MIME_TYPE;
+       if (!strcmp(type, "TUX/redirect"))
+               mime->special = MIME_TYPE_REDIRECT;
+       if (!strcmp(type, "TUX/CGI"))
+               mime->special = MIME_TYPE_CGI;
+       if (!strcmp(type, "TUX/module"))
+               mime->special = MIME_TYPE_MODULE;
+
+       spin_lock(&mimetypes_lock);
+       list_add(&mime->list, &mimetypes_head);
+       spin_unlock(&mimetypes_lock);
+}
+
+static inline int ext_matches (char *file, int len, char *ext, int extlen)
+{
+       int i;
+       char *tmp = file + len-1;
+       char *tmp2 = ext + extlen-1;
+
+       if (len < extlen)
+               return 0;
+
+       for (i = 0; i < extlen; i++) {
+               if (*tmp != *tmp2)
+                       return 0;
+               tmp--;
+               tmp2--;
+       }
+       return 1;
+}
+
+/*
+ * Overhead is not a problem, we cache the MIME type
+ * in the dentry.
+ */
+static mimetype_t * lookup_mimetype (tux_req_t *req)
+{
+       char *objectname = req->objectname;
+       int len = req->objectname_len;
+       mimetype_t *mime = NULL;
+       struct list_head *head, *tmp, *tmp1, *tmp2, *tmp3;
+
+       if (!memchr(objectname, '.', len))
+               goto out;
+
+       spin_lock(&mimetypes_lock);
+       head = &mimetypes_head;
+       tmp = head->next;
+
+       while (tmp != head) {
+               mime = list_entry(tmp, mimetype_t, list);
+               if (ext_matches(objectname, len, mime->ext, mime->ext_len)) {
+                       /*
+                        * Percolate often-used mimetypes up:
+                        */
+                       if (tmp->prev != &mimetypes_head) {
+                               tmp1 = tmp;
+                               tmp2 = tmp->prev;
+                               tmp3 = tmp->prev->prev;
+                               list_del(tmp1);
+                               list_del(tmp2);
+                               list_add(tmp, tmp3);
+                               list_add(tmp2, tmp);
+                       }
+                       break;
+               } else
+                       mime = NULL;
+               tmp = tmp->next;
+       }
+       spin_unlock(&mimetypes_lock);
+
+out:
+       if (!mime)
+               mime = &default_mimetype;
+       return mime;
+}
+
+void free_mimetypes (void)
+{
+       struct list_head *head, *tmp, *next;
+       mimetype_t *mime;
+
+       spin_lock(&mimetypes_lock);
+       head = &mimetypes_head;
+       tmp = head->next;
+
+       while (tmp != head) {
+               next = tmp->next;
+               mime = list_entry(tmp, mimetype_t, list);
+               list_del(tmp);
+
+               kfree(mime->ext);
+               mime->ext = NULL;
+               kfree(mime->type);
+               mime->type = NULL;
+               kfree(mime);
+
+               tmp = next;
+       }
+       spin_unlock(&mimetypes_lock);
+}
+
+/*
+ * Various constant HTTP responses:
+ */
+
+static const char forbidden[] =
+       "HTTP/1.1 403 Forbidden\r\n"
+       "Connection: Keep-Alive\r\n" \
+       "Content-Length: 24\r\n\r\n"
+       "<HTML> Forbidden </HTML>";
+
+static const char not_found[] =
+       "HTTP/1.1 404 Not Found\r\n"
+       "Connection: Keep-Alive\r\n" \
+       "Content-Length: 29\r\n\r\n"
+       "<HTML> Page Not Found </HTML>";
+
+#define NOTMODIFIED_1 \
+       "HTTP/1.1 304 Not Modified\r\n" \
+       "Connection: Keep-Alive\r\n" \
+       "Date: "
+
+#define NOTMODIFIED_1_LEN (sizeof(NOTMODIFIED_1) - 1)
+
+#define NOTMODIFIED_2 \
+       "\r\nETag: \""
+
+#define NOTMODIFIED_2_LEN (sizeof(NOTMODIFIED_2) - 1)
+
+#define NOTMODIFIED_3 \
+       "\"\r\n\r\n"
+
+#define NOTMODIFIED_3_LEN (sizeof(NOTMODIFIED_3) - 1)
+
+#define REDIRECT_1 \
+       "HTTP/1.1 301 Moved Permanently\r\n" \
+       "Location: http://"
+
+#define REDIRECT_1_LEN (sizeof(REDIRECT_1) - 1)
+
+#define REDIRECT_2 \
+       "/\r\nContent-Length: 36\r\n" \
+       "Connection: Keep-Alive\r\n" \
+       "Content-Type: text/html\r\n\r\n" \
+       "<HTML> 301 Moved Permanently </HTML>"
+
+#define REDIRECT_2_LEN (sizeof(REDIRECT_2) - 1)
+
+void send_async_err_forbidden (tux_req_t *req)
+{
+       send_async_message(req, forbidden, 403, 1);
+}
+
+void send_async_err_not_found (tux_req_t *req)
+{
+       send_async_message(req, not_found, 404, 1);
+}
+
+static void send_ret_notmodified (tux_req_t *req)
+{
+       char *buf;
+       int size;
+
+       size = NOTMODIFIED_1_LEN + DATE_LEN - 1 + NOTMODIFIED_2_LEN + req->etaglen + NOTMODIFIED_3_LEN;
+       buf = get_abuf(req, size); 
+       memcpy(buf, NOTMODIFIED_1, NOTMODIFIED_1_LEN);
+       buf += NOTMODIFIED_1_LEN;
+       memcpy(buf, tux_date, DATE_LEN-1);
+       buf += DATE_LEN-1; 
+       memcpy(buf, NOTMODIFIED_2, NOTMODIFIED_2_LEN);
+       buf += NOTMODIFIED_2_LEN;
+       memcpy(buf, &req->etag, req->etaglen);
+       buf += req->etaglen;
+       memcpy(buf, NOTMODIFIED_3, NOTMODIFIED_3_LEN);
+       buf += NOTMODIFIED_3_LEN;
+
+       req->status = 304;
+       send_abuf(req, size, MSG_DONTWAIT);
+       add_req_to_workqueue(req);
+}
+
+static void send_ret_redirect (tux_req_t *req, int cachemiss)
+{
+       char *buf;
+       unsigned int size;
+       unsigned int uts_len = 0;
+
+       size = REDIRECT_1_LEN;
+       if (req->host_len)
+               size += req->host_len;
+       else {
+               down_read(&uts_sem);
+               uts_len = strlen(system_utsname.nodename);
+               size += uts_len;
+       }
+       if (req->objectname[0] != '/')
+               size++;
+       size += req->objectname_len;
+       size += REDIRECT_2_LEN;
+
+       if (size > PAGE_SIZE) {
+               req->error = TUX_ERROR_CONN_CLOSE;
+               zap_request(req, cachemiss);
+               return;
+       }
+
+       buf = get_abuf(req, size);
+
+       memcpy(buf, REDIRECT_1, REDIRECT_1_LEN);
+       buf += REDIRECT_1_LEN;
+
+       Dprintk("req %p, host: %s, host_len: %d.\n", req, req->host, req->host_len);
+       if (req->host_len) {
+               memcpy(buf, req->host, req->host_len);
+               buf += req->host_len;
+       } else {
+               memcpy(buf, system_utsname.nodename, uts_len);
+               up_read(&uts_sem);
+               buf += uts_len;
+       }
+       if (req->objectname[0] != '/') {
+               buf[0] = '/';
+               buf++;
+       }
+
+       memcpy(buf, req->objectname, req->objectname_len);
+       buf += req->objectname_len;
+
+       memcpy(buf, REDIRECT_2, REDIRECT_2_LEN);
+       buf += REDIRECT_2_LEN;
+
+       req->status = 301;
+       send_abuf(req, size, MSG_DONTWAIT);
+       add_req_to_workqueue(req);
+}
+
+static void http_got_request (tux_req_t *req)
+{
+       req->host[0] = 0;
+       req->host_len = 0;
+       add_tux_atom(req, parse_request);
+       add_req_to_workqueue(req);
+}
+
+
+tux_attribute_t * lookup_tux_attribute (tux_req_t *req)
+{
+       tux_attribute_t *attr;
+       struct inode *inode;
+       mimetype_t *mime;
+
+       attr = tux_kmalloc(sizeof(*attr));
+       memset(attr, 0, sizeof(*attr));
+
+       mime = lookup_mimetype(req);
+
+       inode = req->dentry->d_inode;
+       if (!inode->i_uid && !inode->i_gid) {
+               if (mime->special == MIME_TYPE_MODULE) {
+                       attr->tcapi = lookup_tuxmodule(req->objectname);
+                       if (!attr->tcapi) {
+                               req_err(req);
+                               mime = &default_mimetype;
+                       }
+               }
+       } else {
+               if (mime->special && (mime->special != MIME_TYPE_REDIRECT))
+                       mime = &default_mimetype;
+       }
+       attr->mime = mime;
+
+       return attr;
+}
+
+static void handle_range(tux_req_t *req)
+{
+       if (req->if_range_len) {
+               time_t range_time;
+
+               range_time = parse_time(req->if_range_str, req->if_range_len);
+
+               /*
+                * If the file is newer then we send the whole file.
+                */
+               if (range_time < req->mtime )
+                       goto out_no_range;
+       }
+       /* if no offset_end was specified then default to 'end of file': */
+       if (!req->offset_end)
+               req->offset_end = req->total_file_len;
+       /*
+        * Sanity checks:
+        *
+        *  - is the range between 0...file_len-1 ?
+        *  - is offset_end after offset_start?
+        *
+        * (note that offset_end is higher by 1)
+        */
+       if ((req->offset_end > req->total_file_len) ||
+                       (req->offset_start >= req->total_file_len) ||
+                       (req->offset_end <= req->offset_start))
+               goto out_no_range;
+       /*
+        * If the range is 0...file_len-1 then send the whole file:
+        */
+       if (!req->offset_start && (req->offset_end == req->total_file_len))
+               goto out_no_range;
+
+       /* ok, the range is valid, use it: */
+
+       req->output_len = req->offset_end - req->offset_start;
+       req->in_file.f_pos = req->offset_start;
+       return;
+
+out_no_range:
+       req->offset_start = 0;
+       req->offset_end = 0;
+}
+
+static void http_pre_header (tux_req_t *req, int push);
+static void http_post_header (tux_req_t *req, int cachemiss);
+static void http_send_body (tux_req_t *req, int cachemiss);
+
+#define DIRLIST_HEAD_1 "\
+<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\
+<HTML><HEAD><TITLE>Index of %s</TITLE></HEAD><BODY>\
+<H1>Index of %s </H1><PRE><HR>\n%s"
+
+#define DIRLIST_HEAD_2 "\
+<IMG SRC=\"/icons/back.gif\"ALT=\"[DIR]\"> <A HREF=\"../\">Parent Directory</A>\n"
+
+#define DIRLIST_HEAD_SIZE (sizeof(DIRLIST_HEAD_1) + sizeof(DIRLIST_HEAD_2))
+
+static void http_dirlist_head (tux_req_t *req, int cachemiss)
+{
+       char *buf1, *buf2, *path;
+       int len;
+
+       buf1 = (char *)__get_free_page(GFP_KERNEL);
+       buf2 = (char *)__get_free_page(GFP_KERNEL);
+       if (!buf1 || !buf2)
+               goto out;
+       path = tux_print_path(req, req->dentry, req->mnt, buf1, PAGE_SIZE);
+       if (path[0] == '/' && path[1] == '/' && !path[3])
+               path = "/";
+       if (2*strlen(path) + DIRLIST_HEAD_SIZE >= PAGE_SIZE)
+               goto out;
+       len = sprintf(buf2, DIRLIST_HEAD_1, path, path, req->dentry == req->docroot_dentry ? "" : DIRLIST_HEAD_2);
+       __send_async_message(req, buf2, 200, len, 0);
+
+out:
+       if (buf1)
+               free_page((unsigned long)buf1);
+       if (buf2)
+               free_page((unsigned long)buf2);
+}
+
+#define DIRLIST_TAIL "\
+</PRE><HR><ADDRESS><IMG SRC=\"/icons/tuxlogo.gif\"ALIGN=\"MIDDLE\"ALT=\"[TUX]\">Powered by Linux/TUX 3.0</ADDRESS>\n</BODY></HTML>"
+
+static void http_dirlist_tail (tux_req_t *req, int cachemiss)
+{
+       __send_async_message(req, DIRLIST_TAIL, 200, sizeof(DIRLIST_TAIL)-1, 1);
+}
+
+static void http_dirlist (tux_req_t *req, int cachemiss)
+{
+       int head = (req->method == METHOD_HEAD);
+
+       req->lookup_dir = 3;
+       clear_keepalive(req);
+       if (!head) {
+               add_tux_atom(req, http_dirlist_tail);
+               add_tux_atom(req, list_directory);
+               add_tux_atom(req, http_dirlist_head);
+       }
+       http_pre_header(req, head);
+       add_req_to_workqueue(req);
+}
+
+static char *host_path_hash(tux_req_t *req, char *tmp)
+{
+       if (req->host_len < 2)
+               return NULL;
+
+       switch (mass_hosting_hash) {
+               default:
+               case 0:
+                       return req->host;
+               case 1:
+
+                       // www.ABCDEFG.com => A/ABCDEFG.com
+
+                       tmp[0] = req->host[0];
+                       tmp[1] = '/';
+                       memcpy(tmp + 2, req->host, req->host_len);
+                       tmp[req->host_len + 2] = 0;
+
+                       return tmp;
+               case 2:
+                       // www.ABCDEFG.com => A/AB/ABCDEFG.com
+
+                       tmp[0] = req->host[0];
+                       tmp[1] = '/';
+                       tmp[2] = req->host[0];
+                       tmp[3] = req->host[1];
+                       tmp[4] = '/';
+                       memcpy(tmp + 5, req->host, req->host_len);
+                       tmp[req->host_len + 5] = 0;
+
+                       return tmp;
+               case 3:
+                       // www.ABCDEFG.com => A/AB/ABC/ABCDEFG.com
+
+                       tmp[0] = req->host[0];
+                       tmp[1] = '/';
+                       tmp[2] = req->host[0];
+                       tmp[3] = req->host[1];
+                       tmp[4] = '/';
+                       tmp[5] = req->host[0];
+                       tmp[6] = req->host[1];
+                       tmp[7] = req->host[2];
+                       tmp[8] = '/';
+                       memcpy(tmp + 9, req->host, req->host_len);
+                       tmp[req->host_len + 9] = 0;
+
+                       return tmp;
+       }
+}
+
+static struct dentry * vhost_lookup (tux_req_t *req, struct nameidata* base, struct vfsmount **mnt)
+{
+       struct dentry *dentry = NULL;
+       // 255.255.255.255
+       char ip [3+1+3+1+3+1+3 + 2];
+
+       if (req->virtual >= TUX_VHOST_IP) {
+               sprintf(ip, "%d.%d.%d.%d",
+                               NIPQUAD(inet_sk(req->sock->sk)->rcv_saddr));
+               dentry = __tux_lookup (req, ip, base, mnt);
+               if (!dentry || IS_ERR(dentry)) {
+                       if (PTR_ERR(dentry) == -EWOULDBLOCKIO)
+                               return dentry;
+                       base->dentry = dget(req->proto->main_docroot.dentry);
+                       base->mnt = mntget(req->proto->main_docroot.mnt);
+                       goto lookup_default;
+               }
+               if (req->virtual == TUX_VHOST_IP)
+                       goto done;
+
+               // fall through in mixed mode:
+       }
+
+       if (!req->host_len) {
+lookup_default:
+               *mnt = NULL;
+               dentry = __tux_lookup (req, tux_default_vhost, base, mnt);
+       } else {
+               char tmp [MAX_HOST_LEN*2];
+               char *host_path;
+
+               host_path = host_path_hash(req, tmp);
+               Dprintk("host path hash returned: {%s}\n", host_path);
+
+               dentry = NULL;
+               if (host_path) {
+                       *mnt = NULL;
+                       dentry = __tux_lookup (req, host_path, base, mnt);
+               }
+               if (!dentry || IS_ERR(dentry)) {
+                       if (PTR_ERR(dentry) == -EWOULDBLOCKIO)
+                               return dentry;
+                       base->dentry = dget(req->proto->main_docroot.dentry);
+                       base->mnt = mntget(req->proto->main_docroot.mnt);
+                       if (req->virtual >= TUX_VHOST_IP) {
+                               *mnt = NULL;
+                               dentry = __tux_lookup (req, ip, base, mnt);
+                               if (!dentry || IS_ERR(dentry)) {
+                                       if (PTR_ERR(dentry) == -EWOULDBLOCKIO)
+                                               return dentry;
+                                       base->dentry = dget(req->proto->main_docroot.dentry);
+                                       base->mnt = mntget(req->proto->main_docroot.mnt);
+                               }
+                       }
+                       goto lookup_default;
+               }
+       }
+done:
+       return dentry;
+}
+
+static void http_lookup_vhost (tux_req_t *req, int cachemiss)
+{
+       struct dentry *dentry;
+       struct nameidata base;
+       struct vfsmount *mnt = NULL;
+       unsigned int flag = cachemiss ? 0 : LOOKUP_ATOMIC;
+       
+       Dprintk("http_lookup_vhost(%p, %d, virtual: %d, host: %s (%d).)\n", req, flag, req->virtual, req->host, req->host_len);
+
+       base.flags = LOOKUP_FOLLOW|flag;
+       base.last_type = LAST_ROOT;
+       base.dentry = dget(req->proto->main_docroot.dentry);
+       base.mnt = mntget(req->proto->main_docroot.mnt);
+
+       dentry = vhost_lookup(req, &base, &mnt);
+
+       Dprintk("looked up dentry %p.\n", dentry);
+
+       if (dentry && !IS_ERR(dentry) && !dentry->d_inode)
+               TUX_BUG();
+
+       if (!dentry || IS_ERR(dentry)) {
+               if (PTR_ERR(dentry) == -EWOULDBLOCKIO) {
+                       add_tux_atom(req, http_lookup_vhost);
+                       queue_cachemiss(req);
+                       return;
+               }
+               goto abort;
+       }
+
+       req->docroot_dentry = dentry;
+       req->docroot_mnt = mnt;
+
+       add_tux_atom(req, http_process_message);
+       add_req_to_workqueue(req);
+       return;
+abort:
+       if (dentry) {
+               if (!IS_ERR(dentry))
+                       dput(dentry);
+               dentry = NULL;
+       }
+       if (mnt) {
+               if (!IS_ERR(mnt))
+                       mntput(mnt);
+               mnt = NULL;
+       }
+       req_err(req);
+       add_req_to_workqueue(req);
+}
+
+static void http_process_message (tux_req_t *req, int cachemiss)
+{
+       tux_attribute_t *attr;
+       int missed;
+       unsigned int lookup_flag = cachemiss ? 0 : LOOKUP_ATOMIC;
+
+       Dprintk("handling req %p, cachemiss: %d.\n", req, cachemiss);
+
+       /*
+        * URL redirection support - redirect all valid requests
+        * to the first userspace module.
+        */
+       if (tux_all_userspace) {
+               tcapi_template_t *tcapi = get_first_usermodule();
+               if (tcapi) {
+                       req->usermode = 1;
+                       req->usermodule_idx = tcapi->userspace_id;
+                       goto usermode;
+               }
+       }
+       missed = lookup_url(req, lookup_flag);
+       if (missed == 2) {
+               if (req->query_str) {
+                       req->error = TUX_ERROR_REDIRECT;
+                       goto error;
+               }
+               send_ret_redirect(req, cachemiss);
+               return;
+       }
+       if (req->error)
+               goto error;
+       if (missed) {
+cachemiss:
+               if (cachemiss)
+                       TUX_BUG();
+               Dprintk("uncached request.\n");
+               INC_STAT(static_lookup_cachemisses);
+               if (req->dentry)
+                       TUX_BUG();
+               add_tux_atom(req, http_process_message);
+               queue_cachemiss(req);
+               return;
+       }
+       /*
+        * HTML directory indexing.
+        */
+       if (S_ISDIR(req->dentry->d_inode->i_mode))
+               return http_dirlist(req, cachemiss);
+       if (!S_ISREG(req->dentry->d_inode->i_mode))
+               TUX_BUG();
+
+
+       attr = req->dentry->d_extra_attributes;
+       if (!attr) {
+               attr = lookup_tux_attribute(req);
+               if (!attr)
+                       TUX_BUG();
+               req->dentry->d_extra_attributes = attr;
+       }
+       if (attr->mime)
+               Dprintk("using MIME type %s:%s, %d.\n", attr->mime->type, attr->mime->ext, attr->mime->special);
+       if (attr->tcapi) {
+               req->usermode = 1;
+               req->usermodule_idx = attr->tcapi->userspace_id;
+               if (req->module_dentry)
+                       TUX_BUG();
+               req->module_dentry = dget(req->dentry);
+               release_req_dentry(req);
+               goto usermode;
+       }
+
+       switch (attr->mime->special) {
+               case MIME_TYPE_MODULE:
+                       req->usermode = 1;
+                       goto usermode;
+
+               case MIME_TYPE_REDIRECT:
+                       req->error = TUX_ERROR_REDIRECT;
+                       goto error;
+
+               case MIME_TYPE_CGI:
+#if CONFIG_TUX_EXTCGI
+                       Dprintk("CGI request %p.\n", req);
+                       query_extcgi(req);
+                       return;
+#endif
+
+               default:
+                       if (req->query_str) {
+                               req->error = TUX_ERROR_REDIRECT;
+                               goto error;
+                       }
+       }
+       req->attr = attr;
+       switch (req->method) {
+               case METHOD_GET:
+               case METHOD_HEAD:
+                       break;
+               default:
+                       req->error = TUX_ERROR_REDIRECT;
+                       goto error;
+       }
+       if (req->usermode)
+               TUX_BUG();
+
+       req->output_len = req->total_file_len;
+       /*
+        * Do range calculations.
+        */
+       if (req->offset_end || req->offset_start)
+               handle_range(req);
+
+       if (req->may_send_gzip && !req->offset_start && !req->offset_end) {
+               if (handle_gzip_req(req, lookup_flag))
+                       goto cachemiss;
+               if ((tux_compression >= 2) && !req->content_gzipped)
+                       req->content_gzipped = 2;
+       }
+       if (req->parsed_len)
+               trunc_headers(req);
+
+       if (req->error)
+               goto error;
+
+       add_tux_atom(req, http_send_body);
+       add_tux_atom(req, http_post_header);
+
+       http_pre_header(req, req->method == METHOD_HEAD);
+
+       add_req_to_workqueue(req);
+       return;
+
+error:
+       if (req->error)
+               zap_request(req, cachemiss);
+       return;
+
+usermode:
+       add_req_to_workqueue(req);
+}
+
+static void http_post_header (tux_req_t *req, int cachemiss)
+{
+#if CONFIG_TUX_DEBUG
+       req->bytes_expected = req->output_len;
+#endif
+       req->bytes_sent = 0; // data comes now.
+
+       add_req_to_workqueue(req);
+}
+
+static void http_send_body (tux_req_t *req, int cachemiss)
+{
+       int ret;
+
+       Dprintk("SEND req %p <%p> (sock %p, sk %p) (keepalive: %d, status: %d)\n", req, __builtin_return_address(0), req->sock, req->sock->sk, req->keep_alive, req->status);
+
+       SET_TIMESTAMP(req->output_timestamp);
+
+       if (req->error) {
+#if CONFIG_TUX_DEBUG
+               req->bytes_expected = 0;
+#endif
+               req->in_file.f_pos = 0;
+               /*
+                * We are in the middle of a file transfer,
+                * zap it immediately:
+                */
+               TDprintk("req->error = TUX_ERROR_CONN_CLOSE.\n");
+               req->error = TUX_ERROR_CONN_CLOSE;
+               zap_request(req, cachemiss);
+               return;
+       }
+
+repeat:
+       ret = 0;
+       if (!req->status)
+               req->status = 200;
+       if (req->method != METHOD_HEAD) {
+               ret = generic_send_file(req, req->sock, cachemiss);
+               Dprintk("body send-file returned: %d.\n", ret);
+       } else {
+#if CONFIG_TUX_DEBUG
+               req->bytes_expected = 0;
+#endif
+       }
+
+       switch (ret) {
+               case -5:
+                       add_tux_atom(req, http_send_body);
+                       output_timeout(req);
+                       break;
+               case -4:
+                       add_tux_atom(req, http_send_body);
+                       if (add_output_space_event(req, req->sock)) {
+                               del_tux_atom(req);
+                               goto repeat;
+                       }
+                       break;
+               case -3:
+                       INC_STAT(static_sendfile_cachemisses);
+                       add_tux_atom(req, http_send_body);
+                       queue_cachemiss(req);
+                       break;
+               case -1:
+                       break;
+               default:
+                       req->in_file.f_pos = 0;
+                       add_req_to_workqueue(req);
+                       break;
+       }
+}
+
+#define DEFAULT_DATE "Wed, 01 Jan 1970 00:00:01 GMT"
+
+char tux_date [DATE_LEN] = DEFAULT_DATE;
+
+/*
+ * HTTP header
+ */
+
+#define HEADER_PART1A \
+               "HTTP/1.1 200 OK\r\n" \
+               "Content-Type: "
+
+#define HEADER_PART1B \
+               "HTTP/1.1 200 OK" 
+
+#define HEADER_PART1AP \
+               "HTTP/1.1 206 Partial Content\r\n" \
+               "Content-Type: "
+
+#define HEADER_PART1BP \
+               "HTTP/1.1 206 Partial Content" 
+
+#define HEADER_PART1C \
+               "HTTP/1.1 404 Page Not Found\r\n" \
+               "Content-Type: "
+
+#define HEADER_PART1D \
+               "HTTP/1.1 200 OK\r\n" \
+               "Content-Type: text/html\r\n" \
+               "Connection: close\r\n"
+
+#define HEADER_PART2_keepalive "\r\nConnection: Keep-Alive\r\nDate: "
+
+#define HEADER_PART2_close "\r\nConnection: close\r\nDate: "
+
+#define HEADER_PART2_none "\r\nDate: "
+
+// date "%s"
+
+#define HEADER_PART3A "\r\nContent-Encoding: gzip"
+#define HEADER_PART3BX "\r\nContent-Length: "
+
+/*
+ * Please acknowledge our hard work by not changing this define, or
+ * at least please acknowledge us by leaving "TUX/2.0 (Linux)" in
+ * the ID string. Thanks! :-)
+ */
+#define HEADER_PART3BY "\r\nServer: TUX/2.0 (Linux)\r\nContent-Length: "
+#define HEADER_PART3C "\r\nETag: \""
+#define HEADER_PART3ACC "\r\nAccept-Ranges: bytes"
+#define HEADER_PART3L "\r\nLast-Modified: "
+#define HEADER_PART3P "\r\nContent-Range: bytes "
+#define HEADER_PART3CA "\r\nCache-Control: max-age="
+#define HEADER_PART4 "\r\n\r\n"
+
+#define MAX_OUT_HEADER_LEN (sizeof(HEADER_PART1AP) + MAX_MIMETYPE_LEN + \
+               sizeof(HEADER_PART2_keepalive) + DATE_LEN + \
+               sizeof(HEADER_PART3A) + sizeof(HEADER_PART3BY) + \
+               12 + sizeof(HEADER_PART3C) + 21 + sizeof(HEADER_PART3L) + \
+               sizeof(HEADER_PART3P) + 32 + \
+               DATE_LEN + sizeof(HEADER_PART4) + sizeof(tux_extra_html_header) \
+               + sizeof(HEADER_PART3CA) + MAX_CACHE_CONTROL_AGE_LEN)
+
+static void http_pre_header (tux_req_t *req, int head)
+{
+       int partial = req->offset_start | req->offset_end;
+       unsigned long flags;
+       char *buf, *curr;
+       mimetype_t *mime = NULL;
+       int size;
+
+
+       if (MAX_OUT_HEADER_LEN > PAGE_SIZE)
+               TUX_BUG();
+       if ((req->attr && req->attr->tcapi) || req->usermode)
+               TUX_BUG();
+
+#define COPY_STATIC_PART(nr,curr)                                      \
+       do {    \
+               memcpy(curr, HEADER_PART##nr, sizeof(HEADER_PART##nr)-1); \
+               curr += sizeof(HEADER_PART##nr)-1;                      \
+       } while (0)
+
+       buf = curr = get_abuf(req, MAX_OUT_HEADER_LEN);
+
+       if (req->lookup_dir) {
+               COPY_STATIC_PART(1D, curr);
+               goto dir_next;
+       }
+       mime = req->attr->mime;
+       if (!mime)
+               TUX_BUG();
+
+       if (req->status == 404) {
+               COPY_STATIC_PART(1C, curr);
+               memcpy(curr, mime->type, mime->type_len);
+               curr += mime->type_len;
+       } else {
+               if (tux_noid && (mime == &default_mimetype)) {
+                       if (partial)
+                               COPY_STATIC_PART(1BP, curr);
+                       else
+                               COPY_STATIC_PART(1B, curr);
+               } else {
+                       if (partial)
+                               COPY_STATIC_PART(1AP, curr);
+                       else
+                               COPY_STATIC_PART(1A, curr);
+                       memcpy(curr, mime->type, mime->type_len);
+                       curr += mime->type_len;
+               }
+       }
+
+       if (tux_generate_cache_control && mime->expire_str_len) {
+               COPY_STATIC_PART(3CA, curr);
+               memcpy(curr, mime->expire_str, mime->expire_str_len);
+               curr += mime->expire_str_len;
+       }
+
+       if (req->keep_alive /* && (req->version == HTTP_1_0) */)
+               COPY_STATIC_PART(2_keepalive, curr);
+       else if (!req->keep_alive && (req->version == HTTP_1_1))
+               COPY_STATIC_PART(2_close, curr);
+       else
+               // HTTP/1.0 default means close
+               COPY_STATIC_PART(2_none, curr);
+
+dir_next:
+       memcpy(curr, tux_date, DATE_LEN-1);
+       curr += DATE_LEN-1;
+
+       if (req->content_gzipped)
+               COPY_STATIC_PART(3A, curr);
+
+       /*
+        * Content-Length:
+        */
+       if (!req->lookup_dir) {
+               if (tux_noid)
+                       COPY_STATIC_PART(3BX, curr);
+               else
+                       COPY_STATIC_PART(3BY, curr);
+
+               if (partial)
+                       curr += sprintf(curr, "%Ld", req->output_len);
+               else {
+                       if (req->content_gzipped)
+                               curr += sprintf(curr, "%Ld",
+                                                       req->total_file_len);
+                       else {
+                               memcpy(curr, &req->etag, req->lendigits);
+                               curr += req->lendigits;
+                       }
+               }
+               if (tux_generate_etags && (req->status != 404)) {
+                       COPY_STATIC_PART(3C, curr);
+                       memcpy(curr, &req->etag, req->etaglen);
+                       curr += req->etaglen;
+                       curr[0] = '"';
+                       curr++;
+               }
+               if (tux_generate_last_mod || tux_generate_etags)
+                       COPY_STATIC_PART(3ACC, curr);
+       }
+        if (tux_generate_last_mod && (req->status != 404)) {
+                COPY_STATIC_PART(3L, curr);
+               last_mod_time(curr, req->mtime);
+               curr += DATE_LEN-1;
+        }
+       if (partial) {
+               COPY_STATIC_PART(3P, curr);
+               curr += sprintf(curr, "%Ld-%Ld/%Ld", req->offset_start,
+                               req->offset_end-1, req->total_file_len);
+       }
+       COPY_STATIC_PART(4, curr);
+       /*
+        * Possibly add an extra HTML header:
+        */
+       if (tux_extra_html_header_size && mime && !strcmp(mime->type, "text/html")) {
+               unsigned int len = tux_extra_html_header_size;
+
+               memcpy(curr, tux_extra_html_header, len);
+               curr += len;
+       }
+
+       size = curr-buf;
+
+#if CONFIG_TUX_DEBUG
+       *curr = 0;
+       Dprintk("{%s} [%d/%d]\n", buf, size, strlen(buf));
+#endif
+
+       flags = MSG_DONTWAIT;
+       if (!head)
+               flags |= MSG_MORE;
+       send_abuf(req, size, flags);
+}
+
+void http_illegal_request (tux_req_t *req, int cachemiss)
+{
+       if (req->status == 304)
+               send_ret_notmodified(req);
+       else {
+               if (req->status == 403)
+                       send_async_err_forbidden(req);
+               else
+                       send_async_err_not_found(req);
+       }
+}
+
+static int http_check_req_err (tux_req_t *req, int cachemiss)
+{
+       if ((req->sock->sk->sk_state <= TCP_SYN_RECV) &&
+               !tcp_sk(req->sock->sk)->urg_data)
+                       return 0;
+       Dprintk("http_check_req_err(%p,%d): 1 (state: %d, urg: %d)\n",
+               req, cachemiss, req->sock->sk->sk_state,
+               tcp_sk(req->sock->sk)->urg_data);
+#if CONFIG_TUX_DEBUG
+       req->bytes_expected = 0;
+#endif
+       req->in_file.f_pos = 0;
+       req->error = TUX_ERROR_CONN_CLOSE;
+       zap_request(req, cachemiss);
+
+       return 1;
+}
+
+#define COPY_STR(str) \
+       do { memcpy(tmp, str, sizeof(str)-1); \
+       tmp += sizeof(str)-1; } while (0)
+
+static char * http_print_dir_line (tux_req_t *req, char *tmp, char *d_name, int d_len, int d_type, struct dentry *dentry, struct inode *inode)
+{
+       int len, spaces;
+       loff_t size;
+
+       switch (d_type) {
+       case DT_DIR:
+               COPY_STR("<IMG SRC=\"/icons/dir.gif\" ALT=\"[DIR]\">");
+               break;
+       case DT_REG:
+               if ((d_len >= 3) &&
+                       (d_name[d_len-3] == '.') &&
+                       (d_name[d_len-2] == 'g') &&
+                       (d_name[d_len-1] == 'z'))
+                       COPY_STR("<IMG SRC=\"/icons/compressed.gif\" ALT=\"[   ]\">");
+               else
+               if ((d_len >= 4) &&
+                       (d_name[d_len-4] == '.') &&
+                       (d_name[d_len-3] == 't') &&
+                       (d_name[d_len-2] == 'g') &&
+                       (d_name[d_len-1] == 'z'))
+                       COPY_STR("<IMG SRC=\"/icons/compressed.gif\" ALT=\"[   ]\">");
+               else
+               if ((d_len >= 4) &&
+                       (d_name[d_len-4] == '.') &&
+                       (d_name[d_len-3] == 't') &&
+                       (d_name[d_len-2] == 'x') &&
+                       (d_name[d_len-1] == 't'))
+                       COPY_STR("<IMG SRC=\"/icons/text.gif\" ALT=\"[   ]\">");
+               else
+               if ((d_len >= 4) &&
+                       (d_name[d_len-4] == '.') &&
+                       (d_name[d_len-3] == 'b') &&
+                       (d_name[d_len-2] == 'z') &&
+                       (d_name[d_len-1] == '2'))
+                       COPY_STR("<IMG SRC=\"/icons/compressed.gif\" ALT=\"[   ]\">");
+               else
+               if ((d_len >= 4) &&
+                       (d_name[d_len-4] == '.') &&
+                       (d_name[d_len-3] == 'z') &&
+                       (d_name[d_len-2] == 'i') &&
+                       (d_name[d_len-1] == 'p'))
+                       COPY_STR("<IMG SRC=\"/icons/compressed.gif\" ALT=\"[   ]\">");
+               else
+                       COPY_STR("<IMG SRC=\"/icons/file.gif\" ALT=\"[   ]\">");
+               break;
+       case DT_LNK:
+               COPY_STR("<IMG SRC=\"/icons/link.gif\" ALT=\"[LNK]\">");
+               break;
+       default:
+               if (tux_hide_unreadable)
+                       goto out_dput;
+               COPY_STR("<IMG SRC=\"/icons/unknown.gif\" ALT=\"[   ]\">");
+               break;
+       }
+
+#define LIST_1 " <A HREF=\""
+#define LIST_2 "\">"
+#define LIST_2_DIR "/\">"
+#define LIST_3 "</A> "
+
+       COPY_STR(LIST_1);
+       memcpy(tmp, d_name, d_len);
+       tmp += d_len;
+       if (d_type == DT_DIR)
+               COPY_STR(LIST_2_DIR);
+       else
+               COPY_STR(LIST_2);
+       spaces = 0;
+       len = d_len;
+
+       if (len > 25)
+               len = 25;
+       memcpy(tmp, d_name, len);
+       tmp += len;
+       if (len != d_len) {
+               *tmp++ = '.';
+               *tmp++ = '.';
+       } else {
+               if (d_type == DT_DIR)
+                       *tmp++ = '/';
+               else
+                       spaces++;
+               spaces++;
+       }
+       COPY_STR(LIST_3);
+       while (spaces) {
+               *tmp++ = ' ';
+               spaces--;
+       }
+#define FILL 25
+       if (d_len < FILL) {
+               memset(tmp, ' ', FILL-d_len);
+               tmp += FILL-d_len;
+       }
+
+       tmp += time_unix2ls(inode->i_mtime.tv_sec, tmp);
+       *tmp++ = ' ';
+
+       if (d_type != DT_REG) {
+               COPY_STR("        - ");
+               goto out_size;
+       }
+       size = inode->i_size >> 10;
+       if (size < 1024) {
+               tmp += sprintf(tmp, "%8Lik ", size);
+               goto out_size;
+       }
+       size >>= 10;
+       if (size < 1024) {
+               tmp += sprintf(tmp, "%8LiM ", size);
+               goto out_size;
+       }
+       size >>= 10;
+       if (size < 1024) {
+               tmp += sprintf(tmp, "%8LiG ", size);
+               goto out_size;
+       }
+       size >>= 10;
+       if (size < 1024) {
+               tmp += sprintf(tmp, "%8LiT ", size);
+               goto out_size;
+       }
+       size >>= 10;
+       tmp += sprintf(tmp, "%8LiT ", size);
+
+out_size:
+       *tmp++ = '\n';
+       *tmp = 0;
+
+       return tmp;
+out_dput:
+       return NULL;
+}
+
+tux_proto_t tux_proto_http = {
+       defer_accept: 1,
+       can_redirect: 1,
+       got_request: http_got_request,
+       parse_message: parse_http_message,
+       illegal_request: http_illegal_request,
+       check_req_err: http_check_req_err,
+       print_dir_line: http_print_dir_line,
+       name: "http",
+};
+
diff --git a/net/tux/redirect.c b/net/tux/redirect.c
new file mode 100644 (file)
index 0000000..86b5300
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * redirect.c: redirect requests to other server sockets (such as Apache).
+ */
+
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+static void dummy_destructor(struct open_request *req)
+{
+}
+
+static struct or_calltable dummy = 
+{
+       0,
+       NULL,
+       NULL,
+       &dummy_destructor,
+       NULL
+};
+
+static int redirect_sock (tux_req_t *req, const int port)
+{
+       struct socket *sock = req->sock;
+       struct open_request *tcpreq;
+       struct sock *sk, *oldsk;
+       int err = -1;
+
+       /*
+        * Look up (optional) listening user-space socket.
+        */
+       local_bh_disable();
+       sk = tcp_v4_lookup_listener(INADDR_ANY, port, 0);
+       /*
+        * Look up localhost listeners as well.
+        */
+       if (!sk) {
+               u32 daddr;
+               ((unsigned char *)&daddr)[0] = 127;
+               ((unsigned char *)&daddr)[1] = 0;
+               ((unsigned char *)&daddr)[2] = 0;
+               ((unsigned char *)&daddr)[3] = 1;
+               sk = tcp_v4_lookup_listener(daddr, port, 0);
+       }
+       local_bh_enable();
+
+       /* No secondary server found */
+       if (!sk)
+               goto out;
+
+       /*
+        * Requeue the 'old' socket as an accept-socket of
+        * the listening socket. This way we can shuffle
+        * a socket around. Since we've read the input data
+        * via the non-destructive MSG_PEEK, the secondary
+        * server can be used transparently.
+        */
+       oldsk = sock->sk;
+       lock_sock(sk);
+
+       if (sk->sk_state != TCP_LISTEN)
+               goto out_unlock;
+
+       tcpreq = tcp_openreq_alloc();
+       if (!tcpreq)
+               goto out_unlock;
+
+       unlink_tux_socket(req);
+
+       sock->sk = NULL;
+       sock->state = SS_UNCONNECTED;
+
+       tcpreq->class = &dummy;
+       write_lock_irq(&oldsk->sk_callback_lock);
+       oldsk->sk_socket = NULL;
+        oldsk->sk_sleep = NULL;
+       write_unlock_irq(&oldsk->sk_callback_lock);
+
+       tcp_sk(oldsk)->nonagle = 0;
+
+       tcp_acceptq_queue(sk, tcpreq, oldsk);
+
+       sk->sk_data_ready(sk, 0);
+
+       /*
+        * It's now completely up to the secondary
+        * server to handle this request.
+        */
+       sock_release(req->sock);
+       req->sock = NULL;
+       req->parsed_len = 0;
+       err = 0;
+       Dprintk("req %p redirected to secondary server!\n", req);
+
+out_unlock:
+       release_sock(sk);
+       sock_put(sk);
+out:
+       if (err)
+               Dprintk("NO secondary server for req %p!\n", req);
+       return err;
+}
+
+void redirect_request (tux_req_t *req, int cachemiss)
+{
+       if (tux_TDprintk && (req->status != 304)) {
+               TDprintk("trying to redirect req %p, req->error: %d, req->status: %d.\n", req, req->error, req->status);
+               print_req(req);
+       }
+
+       if (cachemiss)
+               TUX_BUG();
+       if (req->error == TUX_ERROR_CONN_CLOSE)
+               goto out_flush;
+       if (!req->sock)
+               TUX_BUG();
+
+       if (!req->status)
+               req->status = -1;
+       if (!req->proto->can_redirect || (req->status == 304) || redirect_sock(req, tux_clientport)) {
+               if (req->parsed_len)
+                       trunc_headers(req);
+               req->proto->illegal_request(req, cachemiss);
+               return;
+       } else {
+               if (req->data_sock)
+                       BUG();
+       }
+out_flush:
+       clear_keepalive(req);
+       if (!tux_redirect_logging)
+               req->status = 0;
+       flush_request(req, cachemiss);
+}
+
diff --git a/net/tux/times.c b/net/tux/times.c
new file mode 100644 (file)
index 0000000..3388f63
--- /dev/null
@@ -0,0 +1,392 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * times.c: time conversion routines.
+ *
+ * Original time convserion code Copyright (C) 1999 by Arjan van de Ven
+ */
+
+/****************************************************************
+ *     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, or (at your option)
+ *     any later version.
+ *
+ *     This program is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program; if not, write to the Free Software
+ *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
+#include <linux/time.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/ctype.h>
+
+
+#include "times.h"
+
+char *dayName[7] = {
+       "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+};
+
+static char *monthName[12] = {
+       "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
+
+char itoa_h[60]={'0','0','0','0','0','0','0','0','0','0',
+                '1','1','1','1','1','1','1','1','1','1',
+                '2','2','2','2','2','2','2','2','2','2',
+                '3','3','3','3','3','3','3','3','3','3',
+                '4','4','4','4','4','4','4','4','4','4',
+                '5','5','5','5','5','5','5','5','5','5'};
+               
+char itoa_l[60]={'0','1','2','3','4','5','6','7','8','9',
+                '0','1','2','3','4','5','6','7','8','9',
+                '0','1','2','3','4','5','6','7','8','9',
+                '0','1','2','3','4','5','6','7','8','9',
+                '0','1','2','3','4','5','6','7','8','9',
+                '0','1','2','3','4','5','6','7','8','9'};
+
+int time_unix2ls(time_t zulu, char *buf)
+{
+       int Y=0,M=0,D=0;
+       int H=0,Min=0,S=0,WD=0;
+       int I,I2;
+       time_t rest, delta;
+
+       if (zulu > xtime.tv_sec)
+               zulu = xtime.tv_sec;
+
+       I=0;
+       while (I<TUX_NUMYEARS) {
+               if (TimeDays[I][0]>zulu) 
+                  break;
+               I++;
+       }
+       
+       Y=--I;
+       if (I<0) {
+               Y=0;
+               goto BuildYear;
+       }
+       I2=0;
+       while (I2<=12) {
+               if (TimeDays[I][I2]>zulu) 
+                  break;
+               I2++;
+       }                          
+       
+       M=I2-1;
+       
+       rest=zulu - TimeDays[Y][M];
+       WD=WeekDays[Y][M];
+       D=rest/86400;
+       rest=rest%86400;
+       WD+=D;
+       WD=WD%7;
+       H=rest/3600;
+       rest=rest%3600;
+       Min=rest/60;
+       rest=rest%60;
+       S=rest;
+       
+BuildYear:
+       Y+=TUX_YEAROFFSET;
+       
+       
+       /* Format:  Day, 01 Mon 1999 01:01:01 GMT */
+
+       delta = xtime.tv_sec - zulu;
+       if (delta > 6*30*24*60)
+               //               "May 23   2000"
+               return sprintf( buf, "%s %02i  %04i", monthName[M], D+1, Y);
+       else
+               //                "May 23 10:14"
+               return sprintf( buf, "%s %02i %02i:%02i",
+                       monthName[M], D+1, H, Min);
+}
+
+static int MonthHash[32] =
+       {0,0,7,0,0,0,0,0,0,0,0,3,0,0,0,2,6,0,5,0,9,8,4,0,0,11,1,10,0,0,0,0};
+
+#define is_digit(c)    ((c) >= '0' && (c) <= '9')
+
+static inline int skip_atoi(char **s)
+{
+       int i=0;
+
+       while (is_digit(**s))
+               i = i*10 + *((*s)++) - '0';
+       return i;
+}
+
+time_t mimetime_to_unixtime(char *Q)
+{
+       int Y,M,D,H,Min,S;
+       unsigned int Hash;
+       time_t Temp;
+       char *s,**s2;
+       
+       s=Q;
+       s2=&s;
+       
+       if (strlen(s)<30) return 0;
+       if (s[3]!=',') return 0;
+       if (s[19]!=':') return 0;
+       
+       s+=5; /* Skip day of week */
+       D = skip_atoi(s2);  /*  Day of month */
+       s++;
+       Hash = (char)s[0]+(char)s[2];
+       Hash = (Hash<<1) + (char)s[1];
+       Hash = (Hash&63)>>1;
+       M = MonthHash[Hash];
+       s+=4;
+       Y = skip_atoi(s2); /* Year */
+       s++;
+       H = skip_atoi(s2); /* Hour */
+       s++;
+       Min = skip_atoi(s2); /* Minutes */
+       s++;
+       S = skip_atoi(s2); /* Seconds */
+       s++;
+       if ((s[0]!='G')||(s[1]!='M')||(s[2]!='T')) 
+       {       
+               return 0; /* No GMT */
+       }
+
+       if (Y<TUX_YEAROFFSET) Y = TUX_YEAROFFSET;
+       if (Y>TUX_YEAROFFSET+9) Y = TUX_YEAROFFSET+9;
+       
+       Temp =  TimeDays[Y-TUX_YEAROFFSET][M];
+       Temp += D*86400+H*3600+Min*60+S;
+       
+       return Temp;  
+}
+
+// writes the full http date, corresponding to time_t received
+
+void last_mod_time(char * curr, const time_t t)
+{
+       int day, tod, year, wday, mon, hour, min, sec;
+       tod = t % 86400;
+       day = t / 86400;
+       if (tod < 0) {
+               tod += 86400;
+               --day;
+       }
+       hour = tod / 3600;
+       tod %= 3600;
+       min = tod / 60;
+       sec = tod % 60;
+       wday = (day + 4) % 7;
+       if (wday < 0)
+               wday += 7;
+       day -= 11017;
+       /* day 0 is march 1, 2000 */
+       year = 5 + day / 146097;
+       day = day % 146097;
+       if (day < 0) {
+               day += 146097;
+               --year;
+       }
+       /* from now on, day is nonnegative */
+       year *= 4;
+       if (day == 146096) {
+               year += 3;
+               day = 36524;
+       } else {
+               year += day / 36524;
+               day %= 36524;
+       }
+       year *= 25;
+       year += day / 1461;
+       day %= 1461;
+       year *= 4;
+       if (day == 1460) {
+               year += 3;
+               day = 365;
+       } else {
+               year += day / 365;
+               day %= 365;
+       }
+       day *= 10;
+       mon = (day + 5) / 306;
+       day = day + 5 - 306 * mon;
+       day /= 10;
+       if (mon >= 10) {
+               ++year;
+               mon -= 10;
+       } else
+               mon += 2;
+       sprintf(curr, "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", dayName[wday],
+               day+1, monthName[mon], year, hour, min, sec);
+}
+
+// writes the full date in ISO8601 format,
+// corresponding to time_t received
+// example: 20011126224910
+
+int mdtm_time(char * curr, const time_t t)
+{
+       int day, tod, year, wday, mon, hour, min, sec;
+       tod = t % 86400;
+       day = t / 86400;
+       if (tod < 0) {
+               tod += 86400;
+               --day;
+       }
+       hour = tod / 3600;
+       tod %= 3600;
+       min = tod / 60;
+       sec = tod % 60;
+       wday = (day + 4) % 7;
+       if (wday < 0)
+               wday += 7;
+       day -= 11017;
+       /* day 0 is march 1, 2000 */
+       year = 5 + day / 146097;
+       day = day % 146097;
+       if (day < 0) {
+               day += 146097;
+               --year;
+       }
+       /* from now on, day is nonnegative */
+       year *= 4;
+       if (day == 146096) {
+               year += 3;
+               day = 36524;
+       } else {
+               year += day / 36524;
+               day %= 36524;
+       }
+       year *= 25;
+       year += day / 1461;
+       day %= 1461;
+       year *= 4;
+       if (day == 1460) {
+               year += 3;
+               day = 365;
+       } else {
+               year += day / 365;
+               day %= 365;
+       }
+       day *= 10;
+       mon = (day + 5) / 306;
+       day = day + 5 - 306 * mon;
+       day /= 10;
+       if (mon >= 10) {
+               ++year;
+               mon -= 10;
+       } else
+               mon += 2;
+       return sprintf(curr, "213 %.4d%.2d%.2d%.2d%.2d%.2d\r\n",
+               year, mon+1, day+1, hour, min, sec);
+}
+
+static inline int make_num(const char *s)
+{
+       if (*s >= '0' && *s <= '9')
+               return 10 * (*s - '0') + *(s + 1) - '0';
+       else
+               return *(s + 1) - '0';
+}
+
+static inline int make_month(const char *s)
+{
+       int i;
+
+       for (i = 0; i < 12; i++)
+               if (!strncmp(monthName[i], s, 3))
+                       return i+1;
+       return 0;
+}
+
+time_t parse_time(const char *str, const int str_len)
+{
+       int hour;
+       int min;
+       int sec;
+       int mday;
+       int mon;
+       int year;
+
+       if (str[3] == ',') {
+               /* Thu, 09 Jan 1993 01:29:59 GMT */
+
+               if (str_len < 29) 
+                       return -1;
+
+               mday = make_num(str+5);
+               mon = make_month(str + 8);
+               year = 100 * make_num(str + 12) + make_num(str + 14);
+               hour = make_num(str + 17);
+               min = make_num(str + 20);
+               sec = make_num(str + 23);
+       }
+       else {
+               const char *s;
+               s = strchr(str, ',');
+               if (!s || (str_len - (s - str) < 24)) {
+                       /* Wed Jun  9 01:29:59 1993 */
+
+                       if (str_len < 24)
+                               return -1;
+
+                       mon = make_month(str+4);
+                       mday = make_num(str+8);
+                       hour = make_num(str+11);
+                       min = make_num(str+14);
+                       sec = make_num(str+17);
+                       year = make_num(str+20)*100 + make_num(str+22);
+               }
+               else {
+                       /* Thursday, 10-Jun-93 01:29:59 GMT */
+
+                       mday = make_num(s + 2);
+                       mon = make_month(s + 5);
+                       year = make_num(s + 9) + 1900;
+                       if (year < 1970)
+                               year += 100;
+                       hour = make_num(s + 12);
+                       min = make_num(s + 15);
+                       sec = make_num(s + 18);
+               }
+       }
+
+       if (sec < 0 || sec > 59)
+               return -1;
+       if (min < 0 || min > 59)
+               return -1;
+       if (hour < 0 || hour > 23)
+               return -1;
+       if (mday < 1 || mday > 31)
+               return -1;
+       if (mon < 1 || mon > 12)
+               return -1;
+       if (year < 1970 || year > 2020)
+               return -1;
+
+       return mktime(year, mon, mday, hour, min, sec);
+}
diff --git a/net/tux/times.h b/net/tux/times.h
new file mode 100644 (file)
index 0000000..09c389f
--- /dev/null
@@ -0,0 +1,26 @@
+static time_t TimeDays[10][13] = { 
+ { 852073200,  854751600,      857170800,      859849200,      862441200,      865119600,      867711600,      870390000,      873068400,      875660400,      878338800,      880930800,      883609200 } ,
+ { 883609200,  886287600,      888706800,      891385200,      893977200,      896655600,      899247600,      901926000,      904604400,      907196400,      909874800,      912466800,      915145200 } ,
+ { 915145200,  917823600,      920242800,      922921200,      925513200,      928191600,      930783600,      933462000,      936140400,      938732400,      941410800,      944002800,      946681200 } ,
+ { 946681200,  949359600,      951865200,      954543600,      957135600,      959814000,      962406000,      965084400,      967762800,      970354800,      973033200,      975625200,      978303600 } ,
+ { 978303600,  980982000,      983401200,      986079600,      988671600,      991350000,      993942000,      996620400,      999298800,      1001890800,     1004569200,     1007161200,     1009839600 } ,
+ { 1009839600, 1012518000,     1014937200,     1017615600,     1020207600,     1022886000,     1025478000,     1028156400,     1030834800,     1033426800,     1036105200,     1038697200,     1041375600 } ,
+ { 1041375600, 1044054000,     1046473200,     1049151600,     1051743600,     1054422000,     1057014000,     1059692400,     1062370800,     1064962800,     1067641200,     1070233200,     1072911600 } ,
+ { 1072911600, 1075590000,     1078095600,     1080774000,     1083366000,     1086044400,     1088636400,     1091314800,     1093993200,     1096585200,     1099263600,     1101855600,     1104534000 } ,
+ { 1104534000, 1107212400,     1109631600,     1112310000,     1114902000,     1117580400,     1120172400,     1122850800,     1125529200,     1128121200,     1130799600,     1133391600,     1136070000 } ,
+ { 1136070000, 1138748400,     1141167600,     1143846000,     1146438000,     1149116400,     1151708400,     1154386800,     1157065200,     1159657200,     1162335600,     1164927600,     1167606000 } 
+};
+static int WeekDays[10][13] = { 
+ { 3,  6,      6,      2,      4,      0,      2,      5,      1,      3,      6,      1,      4 } ,
+ { 4,  0,      0,      3,      5,      1,      3,      6,      2,      4,      0,      2,      5 } ,
+ { 5,  1,      1,      4,      6,      2,      4,      0,      3,      5,      1,      3,      6 } ,
+ { 6,  2,      3,      6,      1,      4,      6,      2,      5,      0,      3,      5,      1 } ,
+ { 1,  4,      4,      0,      2,      5,      0,      3,      6,      1,      4,      6,      2 } ,
+ { 2,  5,      5,      1,      3,      6,      1,      4,      0,      2,      5,      0,      3 } ,
+ { 3,  6,      6,      2,      4,      0,      2,      5,      1,      3,      6,      1,      4 } ,
+ { 4,  0,      1,      4,      6,      2,      4,      0,      3,      5,      1,      3,      6 } ,
+ { 6,  2,      2,      5,      0,      3,      5,      1,      4,      6,      2,      4,      0 } ,
+ { 0,  3,      3,      6,      1,      4,      6,      2,      5,      0,      3,      5,      1 } 
+};
+#define TUX_YEAROFFSET   1997
+#define TUX_NUMYEARS     10
diff --git a/net/tux/userspace.c b/net/tux/userspace.c
new file mode 100644 (file)
index 0000000..effd45d
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
+ * Copyright (C) 2000, 2001, Ingo Molnar <mingo@redhat.com>
+ *
+ * userspace.c: handle userspace-module requests
+ */
+
+#include <net/tux.h>
+
+/****************************************************************
+ *      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, or (at your option)
+ *      any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ ****************************************************************/
+
diff --git a/scripts/basic/.docproc.cmd b/scripts/basic/.docproc.cmd
new file mode 100644 (file)
index 0000000..e725e6b
--- /dev/null
@@ -0,0 +1,69 @@
+cmd_scripts/basic/docproc := gcc -Wp,-MD,scripts/basic/.docproc.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer        -o scripts/basic/docproc scripts/basic/docproc.c
+
+deps_scripts/basic/docproc := \
+  scripts/basic/docproc.c \
+  /usr/include/stdio.h \
+  /usr/include/features.h \
+  /usr/include/sys/cdefs.h \
+  /usr/include/gnu/stubs.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stddef.h \
+  /usr/include/bits/types.h \
+  /usr/include/bits/wordsize.h \
+  /usr/include/bits/typesizes.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/include/bits/wchar.h \
+  /usr/include/gconv.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h \
+  /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h \
+  /usr/include/stdlib.h \
+  /usr/include/sys/types.h \
+  /usr/include/time.h \
+  /usr/include/endian.h \
+  /usr/include/bits/endian.h \
+  /usr/include/sys/select.h \
+  /usr/include/bits/select.h \
+  /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h \
+  /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h \
+  /usr/include/bits/sched.h \
+  /usr/include/alloca.h \
+  /usr/include/string.h \
+  /usr/include/bits/string.h \
+  /usr/include/bits/string2.h \
+  /usr/include/ctype.h \
+  /usr/include/unistd.h \
+  /usr/include/bits/posix_opt.h \
+  /usr/include/bits/confname.h \
+  /usr/include/getopt.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/limits.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/syslimits.h \
+  /usr/include/limits.h \
+  /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h \
+  /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/include/sys/wait.h \
+  /usr/include/signal.h \
+  /usr/include/bits/signum.h \
+  /usr/include/bits/siginfo.h \
+  /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h \
+  /usr/include/asm/sigcontext.h \
+  /usr/include/linux/compiler.h \
+  /usr/include/linux/compiler-gcc3.h \
+  /usr/include/linux/compiler-gcc.h \
+  /usr/include/bits/sigstack.h \
+  /usr/include/bits/sigthread.h \
+  /usr/include/sys/resource.h \
+  /usr/include/bits/resource.h \
+  /usr/include/bits/waitflags.h \
+  /usr/include/bits/waitstatus.h \
+
+scripts/basic/docproc: $(deps_scripts/basic/docproc)
+
+$(deps_scripts/basic/docproc):
diff --git a/scripts/basic/.fixdep.cmd b/scripts/basic/.fixdep.cmd
new file mode 100644 (file)
index 0000000..1c463aa
--- /dev/null
@@ -0,0 +1,74 @@
+cmd_scripts/basic/fixdep := gcc -Wp,-MD,scripts/basic/.fixdep.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer        -o scripts/basic/fixdep scripts/basic/fixdep.c
+
+deps_scripts/basic/fixdep := \
+  scripts/basic/fixdep.c \
+    $(wildcard include/config/his/driver.h) \
+    $(wildcard include/config/my/option.h) \
+    $(wildcard include/config/.h) \
+    $(wildcard include/config/foo.h) \
+  /usr/include/sys/types.h \
+  /usr/include/features.h \
+  /usr/include/sys/cdefs.h \
+  /usr/include/gnu/stubs.h \
+  /usr/include/bits/types.h \
+  /usr/include/bits/wordsize.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stddef.h \
+  /usr/include/bits/typesizes.h \
+  /usr/include/time.h \
+  /usr/include/endian.h \
+  /usr/include/bits/endian.h \
+  /usr/include/sys/select.h \
+  /usr/include/bits/select.h \
+  /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h \
+  /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h \
+  /usr/include/bits/sched.h \
+  /usr/include/sys/stat.h \
+  /usr/include/bits/stat.h \
+  /usr/include/sys/mman.h \
+  /usr/include/bits/mman.h \
+  /usr/include/unistd.h \
+  /usr/include/bits/posix_opt.h \
+  /usr/include/bits/confname.h \
+  /usr/include/getopt.h \
+  /usr/include/fcntl.h \
+  /usr/include/bits/fcntl.h \
+  /usr/include/string.h \
+  /usr/include/bits/string.h \
+  /usr/include/bits/string2.h \
+  /usr/include/stdlib.h \
+  /usr/include/alloca.h \
+  /usr/include/stdio.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/include/bits/wchar.h \
+  /usr/include/gconv.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h \
+  /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/limits.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/syslimits.h \
+  /usr/include/limits.h \
+  /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h \
+  /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/include/ctype.h \
+  /usr/include/netinet/in.h \
+  /usr/include/stdint.h \
+  /usr/include/sys/socket.h \
+  /usr/include/sys/uio.h \
+  /usr/include/bits/uio.h \
+  /usr/include/bits/socket.h \
+  /usr/include/bits/sockaddr.h \
+  /usr/include/asm/socket.h \
+  /usr/include/asm/sockios.h \
+  /usr/include/bits/in.h \
+  /usr/include/bits/byteswap.h \
+
+scripts/basic/fixdep: $(deps_scripts/basic/fixdep)
+
+$(deps_scripts/basic/fixdep):
diff --git a/scripts/basic/.split-include.cmd b/scripts/basic/.split-include.cmd
new file mode 100644 (file)
index 0000000..e596a87
--- /dev/null
@@ -0,0 +1,57 @@
+cmd_scripts/basic/split-include := gcc -Wp,-MD,scripts/basic/.split-include.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer        -o scripts/basic/split-include scripts/basic/split-include.c
+
+deps_scripts/basic/split-include := \
+  scripts/basic/split-include.c \
+    $(wildcard include/config/.h) \
+  /usr/include/sys/stat.h \
+  /usr/include/features.h \
+  /usr/include/sys/cdefs.h \
+  /usr/include/gnu/stubs.h \
+  /usr/include/bits/types.h \
+  /usr/include/bits/wordsize.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stddef.h \
+  /usr/include/bits/typesizes.h \
+  /usr/include/time.h \
+  /usr/include/bits/stat.h \
+  /usr/include/sys/types.h \
+  /usr/include/endian.h \
+  /usr/include/bits/endian.h \
+  /usr/include/sys/select.h \
+  /usr/include/bits/select.h \
+  /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h \
+  /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h \
+  /usr/include/bits/sched.h \
+  /usr/include/ctype.h \
+  /usr/include/errno.h \
+  /usr/include/bits/errno.h \
+  /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h \
+  /usr/include/asm-generic/errno.h \
+  /usr/include/asm-generic/errno-base.h \
+  /usr/include/fcntl.h \
+  /usr/include/bits/fcntl.h \
+  /usr/include/stdio.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/include/bits/wchar.h \
+  /usr/include/gconv.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h \
+  /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h \
+  /usr/include/stdlib.h \
+  /usr/include/alloca.h \
+  /usr/include/string.h \
+  /usr/include/bits/string.h \
+  /usr/include/bits/string2.h \
+  /usr/include/unistd.h \
+  /usr/include/bits/posix_opt.h \
+  /usr/include/bits/confname.h \
+  /usr/include/getopt.h \
+
+scripts/basic/split-include: $(deps_scripts/basic/split-include)
+
+$(deps_scripts/basic/split-include):
diff --git a/scripts/basic/docproc b/scripts/basic/docproc
new file mode 100755 (executable)
index 0000000..51640ad
Binary files /dev/null and b/scripts/basic/docproc differ
diff --git a/scripts/basic/fixdep b/scripts/basic/fixdep
new file mode 100755 (executable)
index 0000000..800beed
Binary files /dev/null and b/scripts/basic/fixdep differ
diff --git a/scripts/basic/split-include b/scripts/basic/split-include
new file mode 100755 (executable)
index 0000000..ecd686e
Binary files /dev/null and b/scripts/basic/split-include differ
diff --git a/scripts/kconfig/.conf.cmd b/scripts/kconfig/.conf.cmd
new file mode 100644 (file)
index 0000000..4f007fa
--- /dev/null
@@ -0,0 +1 @@
+cmd_scripts/kconfig/conf := gcc  -o scripts/kconfig/conf scripts/kconfig/conf.o  -Wl,-rpath,\$$ORIGIN -Lscripts/kconfig -lkconfig
diff --git a/scripts/kconfig/.conf.o.cmd b/scripts/kconfig/.conf.o.cmd
new file mode 100644 (file)
index 0000000..2c06e27
--- /dev/null
@@ -0,0 +1,53 @@
+cmd_scripts/kconfig/conf.o := gcc -Wp,-MD,scripts/kconfig/.conf.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer       -c -o scripts/kconfig/conf.o scripts/kconfig/conf.c
+
+deps_scripts/kconfig/conf.o := \
+  scripts/kconfig/conf.c \
+    $(wildcard include/config/.h) \
+  /usr/include/ctype.h \
+  /usr/include/features.h \
+  /usr/include/sys/cdefs.h \
+  /usr/include/gnu/stubs.h \
+  /usr/include/bits/types.h \
+  /usr/include/bits/wordsize.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stddef.h \
+  /usr/include/bits/typesizes.h \
+  /usr/include/endian.h \
+  /usr/include/bits/endian.h \
+  /usr/include/stdlib.h \
+  /usr/include/sys/types.h \
+  /usr/include/time.h \
+  /usr/include/sys/select.h \
+  /usr/include/bits/select.h \
+  /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h \
+  /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h \
+  /usr/include/bits/sched.h \
+  /usr/include/alloca.h \
+  /usr/include/string.h \
+  /usr/include/bits/string.h \
+  /usr/include/bits/string2.h \
+  /usr/include/unistd.h \
+  /usr/include/bits/posix_opt.h \
+  /usr/include/bits/confname.h \
+  /usr/include/getopt.h \
+  /usr/include/sys/stat.h \
+  /usr/include/bits/stat.h \
+  scripts/kconfig/lkc.h \
+  scripts/kconfig/expr.h \
+  /usr/include/stdio.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/include/bits/wchar.h \
+  /usr/include/gconv.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h \
+  /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stdbool.h \
+  scripts/kconfig/lkc_proto.h \
+
+scripts/kconfig/conf.o: $(deps_scripts/kconfig/conf.o)
+
+$(deps_scripts/kconfig/conf.o):
diff --git a/scripts/kconfig/.libkconfig.so.cmd b/scripts/kconfig/.libkconfig.so.cmd
new file mode 100644 (file)
index 0000000..c2f93cb
--- /dev/null
@@ -0,0 +1 @@
+cmd_scripts/kconfig/libkconfig.so := gcc  -shared -o scripts/kconfig/libkconfig.so scripts/kconfig/zconf.tab.o  
diff --git a/scripts/kconfig/.mconf.o.cmd b/scripts/kconfig/.mconf.o.cmd
new file mode 100644 (file)
index 0000000..6f874bf
--- /dev/null
@@ -0,0 +1,91 @@
+cmd_scripts/kconfig/mconf.o := gcc -Wp,-MD,scripts/kconfig/.mconf.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer       -c -o scripts/kconfig/mconf.o scripts/kconfig/mconf.c
+
+deps_scripts/kconfig/mconf.o := \
+  scripts/kconfig/mconf.c \
+    $(wildcard include/config/.h) \
+    $(wildcard include/config/mode.h) \
+  /usr/include/sys/ioctl.h \
+  /usr/include/features.h \
+  /usr/include/sys/cdefs.h \
+  /usr/include/gnu/stubs.h \
+  /usr/include/bits/ioctls.h \
+  /usr/include/asm/ioctls.h \
+  /usr/include/asm/ioctl.h \
+  /usr/include/bits/ioctl-types.h \
+  /usr/include/sys/ttydefaults.h \
+  /usr/include/sys/wait.h \
+  /usr/include/signal.h \
+  /usr/include/bits/sigset.h \
+  /usr/include/bits/types.h \
+  /usr/include/bits/wordsize.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stddef.h \
+  /usr/include/bits/typesizes.h \
+  /usr/include/bits/signum.h \
+  /usr/include/time.h \
+  /usr/include/bits/siginfo.h \
+  /usr/include/bits/sigaction.h \
+  /usr/include/bits/sigcontext.h \
+  /usr/include/asm/sigcontext.h \
+  /usr/include/linux/compiler.h \
+  /usr/include/linux/compiler-gcc3.h \
+  /usr/include/linux/compiler-gcc.h \
+  /usr/include/bits/sigstack.h \
+  /usr/include/bits/pthreadtypes.h \
+  /usr/include/bits/sched.h \
+  /usr/include/bits/sigthread.h \
+  /usr/include/sys/resource.h \
+  /usr/include/bits/resource.h \
+  /usr/include/bits/time.h \
+  /usr/include/bits/waitflags.h \
+  /usr/include/bits/waitstatus.h \
+  /usr/include/endian.h \
+  /usr/include/bits/endian.h \
+  /usr/include/ctype.h \
+  /usr/include/errno.h \
+  /usr/include/bits/errno.h \
+  /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h \
+  /usr/include/asm-generic/errno.h \
+  /usr/include/asm-generic/errno-base.h \
+  /usr/include/fcntl.h \
+  /usr/include/bits/fcntl.h \
+  /usr/include/sys/types.h \
+  /usr/include/sys/select.h \
+  /usr/include/bits/select.h \
+  /usr/include/sys/sysmacros.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/limits.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/syslimits.h \
+  /usr/include/limits.h \
+  /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h \
+  /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stdarg.h \
+  /usr/include/stdlib.h \
+  /usr/include/alloca.h \
+  /usr/include/string.h \
+  /usr/include/bits/string.h \
+  /usr/include/bits/string2.h \
+  /usr/include/termios.h \
+  /usr/include/bits/termios.h \
+  /usr/include/unistd.h \
+  /usr/include/bits/posix_opt.h \
+  /usr/include/bits/confname.h \
+  /usr/include/getopt.h \
+  scripts/kconfig/lkc.h \
+  scripts/kconfig/expr.h \
+  /usr/include/stdio.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/include/bits/wchar.h \
+  /usr/include/gconv.h \
+  /usr/include/bits/stdio_lim.h \
+  /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stdbool.h \
+  scripts/kconfig/lkc_proto.h \
+
+scripts/kconfig/mconf.o: $(deps_scripts/kconfig/mconf.o)
+
+$(deps_scripts/kconfig/mconf.o):
diff --git a/scripts/kconfig/.zconf.tab.o.cmd b/scripts/kconfig/.zconf.tab.o.cmd
new file mode 100644 (file)
index 0000000..2a3661c
--- /dev/null
@@ -0,0 +1,73 @@
+cmd_scripts/kconfig/zconf.tab.o := gcc -Wp,-MD,scripts/kconfig/.zconf.tab.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer      -Iscripts/kconfig -fPIC -c -o scripts/kconfig/zconf.tab.o scripts/kconfig/zconf.tab.c
+
+deps_scripts/kconfig/zconf.tab.o := \
+  scripts/kconfig/zconf.tab.c \
+  /usr/include/ctype.h \
+  /usr/include/features.h \
+  /usr/include/sys/cdefs.h \
+  /usr/include/gnu/stubs.h \
+  /usr/include/bits/types.h \
+  /usr/include/bits/wordsize.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stddef.h \
+  /usr/include/bits/typesizes.h \
+  /usr/include/endian.h \
+  /usr/include/bits/endian.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stdarg.h \
+  /usr/include/stdio.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/include/bits/wchar.h \
+  /usr/include/gconv.h \
+  /usr/include/bits/stdio_lim.h \
+  /usr/include/bits/sys_errlist.h \
+  /usr/include/bits/stdio.h \
+  /usr/include/stdlib.h \
+  /usr/include/sys/types.h \
+  /usr/include/time.h \
+  /usr/include/sys/select.h \
+  /usr/include/bits/select.h \
+  /usr/include/bits/sigset.h \
+  /usr/include/bits/time.h \
+  /usr/include/sys/sysmacros.h \
+  /usr/include/bits/pthreadtypes.h \
+  /usr/include/bits/sched.h \
+  /usr/include/alloca.h \
+  /usr/include/string.h \
+  /usr/include/bits/string.h \
+  /usr/include/bits/string2.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stdbool.h \
+  scripts/kconfig/lkc.h \
+  scripts/kconfig/expr.h \
+  scripts/kconfig/lkc_proto.h \
+  scripts/kconfig/lex.zconf.c \
+  /usr/include/errno.h \
+  /usr/include/bits/errno.h \
+  /usr/include/linux/errno.h \
+  /usr/include/asm/errno.h \
+  /usr/include/asm-generic/errno.h \
+  /usr/include/asm-generic/errno-base.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/limits.h \
+  /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/syslimits.h \
+  /usr/include/limits.h \
+  /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h \
+  /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h \
+  /usr/include/unistd.h \
+  /usr/include/bits/posix_opt.h \
+  /usr/include/bits/confname.h \
+  /usr/include/getopt.h \
+  scripts/kconfig/confdata.c \
+    $(wildcard include/config/.h) \
+  /usr/include/sys/stat.h \
+  /usr/include/bits/stat.h \
+  scripts/kconfig/expr.c \
+  scripts/kconfig/symbol.c \
+  /usr/include/sys/utsname.h \
+  /usr/include/bits/utsname.h \
+  scripts/kconfig/menu.c \
+
+scripts/kconfig/zconf.tab.o: $(deps_scripts/kconfig/zconf.tab.o)
+
+$(deps_scripts/kconfig/zconf.tab.o):
diff --git a/scripts/kconfig/conf b/scripts/kconfig/conf
new file mode 100755 (executable)
index 0000000..89b852e
Binary files /dev/null and b/scripts/kconfig/conf differ
diff --git a/scripts/kconfig/conf.o b/scripts/kconfig/conf.o
new file mode 100644 (file)
index 0000000..c191a8a
Binary files /dev/null and b/scripts/kconfig/conf.o differ
diff --git a/scripts/kconfig/lex.zconf.c b/scripts/kconfig/lex.zconf.c
new file mode 100644 (file)
index 0000000..22dda11
--- /dev/null
@@ -0,0 +1,3688 @@
+
+#line 3 "lex.zconf.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 31
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else  /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN (yy_start) = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START (((yy_start) - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE zconfrestart(zconfin  )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+extern int zconfleng;
+
+extern FILE *zconfin, *zconfout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up zconftext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               *yy_cp = (yy_hold_char); \
+               YY_RESTORE_YY_MORE_OFFSET \
+               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+               YY_DO_BEFORE_ACTION; /* set up zconftext again */ \
+               } \
+       while ( 0 )
+
+#define unput(c) yyunput( c, (yytext_ptr)  )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+       {
+       FILE *yy_input_file;
+
+       char *yy_ch_buf;                /* input buffer */
+       char *yy_buf_pos;               /* current position in input buffer */
+
+       /* Size of input buffer in bytes, not including room for EOB
+        * characters.
+        */
+       yy_size_t yy_buf_size;
+
+       /* Number of characters read into yy_ch_buf, not including EOB
+        * characters.
+        */
+       int yy_n_chars;
+
+       /* Whether we "own" the buffer - i.e., we know we created it,
+        * and can realloc() it to grow it, and should free() it to
+        * delete it.
+        */
+       int yy_is_our_buffer;
+
+       /* Whether this is an "interactive" input source; if so, and
+        * if we're using stdio for input, then we want to use getc()
+        * instead of fread(), to make sure we stop fetching input after
+        * each newline.
+        */
+       int yy_is_interactive;
+
+       /* Whether we're considered to be at the beginning of a line.
+        * If so, '^' rules will be active on the next match, otherwise
+        * not.
+        */
+       int yy_at_bol;
+
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
+       /* Whether to try to fill the input buffer when we reach the
+        * end of it.
+        */
+       int yy_fill_buffer;
+
+       int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+       /* When an EOF's been seen but there's still some text to process
+        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+        * shouldn't try reading from the input source any more.  We might
+        * still have a bunch of tokens to match, though, because of
+        * possible backing-up.
+        *
+        * When we actually see the EOF, we change the status to "new"
+        * (via zconfrestart()), so that the user can continue scanning by
+        * just pointing zconfin at a new input file.
+        */
+#define YY_BUFFER_EOF_PENDING 2
+
+       };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* yy_hold_char holds the character lost when zconftext is formed. */
+static char yy_hold_char;
+static int yy_n_chars;         /* number of characters read into yy_ch_buf */
+int zconfleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1;                /* whether we need to initialize */
+static int yy_start = 0;       /* start state number */
+
+/* Flag which is used to allow zconfwrap()'s to do buffer switches
+ * instead of setting up a fresh zconfin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void zconfrestart (FILE *input_file  );
+void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size  );
+void zconf_delete_buffer (YY_BUFFER_STATE b  );
+void zconf_flush_buffer (YY_BUFFER_STATE b  );
+void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void zconfpop_buffer_state (void );
+
+static void zconfensure_buffer_stack (void );
+static void zconf_load_buffer_state (void );
+static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file  );
+
+#define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len  );
+
+void *zconfalloc (yy_size_t  );
+void *zconfrealloc (void *,yy_size_t  );
+void zconffree (void *  );
+
+#define yy_new_buffer zconf_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+       { \
+       if ( ! YY_CURRENT_BUFFER ){ \
+        zconfensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+       }
+
+#define yy_set_bol(at_bol) \
+       { \
+       if ( ! YY_CURRENT_BUFFER ){\
+        zconfensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+       }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+#define zconfwrap(n) 1
+#define YY_SKIP_YYWRAP
+
+typedef unsigned char YY_CHAR;
+
+FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0;
+
+typedef int yy_state_type;
+
+extern int zconflineno;
+
+int zconflineno = 1;
+
+extern char *zconftext;
+#define yytext_ptr zconftext
+static yyconst flex_int16_t yy_nxt[][38] =
+    {
+    {
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0
+    },
+
+    {
+       11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   12
+    },
+
+    {
+       11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
+
+       12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   12
+    },
+
+    {
+       11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
+       16,   16,   16,   18,   16,   16,   18,   18,   19,   20,
+       21,   22,   18,   18,   23,   24,   18,   25,   18,   26,
+       27,   18,   28,   29,   30,   18,   18,   16
+    },
+
+    {
+       11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
+       16,   16,   16,   18,   16,   16,   18,   18,   19,   20,
+       21,   22,   18,   18,   23,   24,   18,   25,   18,   26,
+       27,   18,   28,   29,   30,   18,   18,   16
+
+    },
+
+    {
+       11,   31,   32,   33,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31
+    },
+
+    {
+       11,   31,   32,   33,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31
+    },
+
+    {
+       11,   34,   34,   35,   34,   36,   34,   34,   36,   34,
+       34,   34,   34,   34,   34,   37,   34,   34,   34,   34,
+
+       34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
+       34,   34,   34,   34,   34,   34,   34,   34
+    },
+
+    {
+       11,   34,   34,   35,   34,   36,   34,   34,   36,   34,
+       34,   34,   34,   34,   34,   37,   34,   34,   34,   34,
+       34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
+       34,   34,   34,   34,   34,   34,   34,   34
+    },
+
+    {
+       11,   38,   38,   39,   40,   41,   42,   43,   41,   44,
+       45,   46,   47,   47,   48,   49,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   50,   47,   47,   47,   51,
+       47,   47,   47,   47,   47,   47,   47,   52
+
+    },
+
+    {
+       11,   38,   38,   39,   40,   41,   42,   43,   41,   44,
+       45,   46,   47,   47,   48,   49,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   50,   47,   47,   47,   51,
+       47,   47,   47,   47,   47,   47,   47,   52
+    },
+
+    {
+      -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,
+      -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,
+      -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,
+      -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11
+    },
+
+    {
+       11,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
+      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
+
+      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
+      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12
+    },
+
+    {
+       11,  -13,   53,   54,  -13,  -13,   55,  -13,  -13,  -13,
+      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
+      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
+      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13
+    },
+
+    {
+       11,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
+      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
+      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
+      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14
+
+    },
+
+    {
+       11,   56,   56,   57,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56
+    },
+
+    {
+       11,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
+      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
+      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
+      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16
+    },
+
+    {
+       11,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,
+      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,
+
+      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,
+      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17
+    },
+
+    {
+       11,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,
+      -18,  -18,  -18,   58,  -18,  -18,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -18
+    },
+
+    {
+       11,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,
+      -19,  -19,  -19,   58,  -19,  -19,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   59,
+       58,   58,   58,   58,   58,   58,   58,  -19
+
+    },
+
+    {
+       11,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,
+      -20,  -20,  -20,   58,  -20,  -20,   58,   58,   58,   58,
+       58,   58,   58,   58,   60,   58,   58,   58,   58,   61,
+       58,   58,   58,   58,   58,   58,   58,  -20
+    },
+
+    {
+       11,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,
+      -21,  -21,  -21,   58,  -21,  -21,   58,   58,   58,   58,
+       58,   62,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -21
+    },
+
+    {
+       11,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,
+      -22,  -22,  -22,   58,  -22,  -22,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   63,   58,
+       58,   58,   58,   58,   58,   58,   58,  -22
+    },
+
+    {
+       11,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
+      -23,  -23,  -23,   58,  -23,  -23,   58,   58,   58,   58,
+       58,   64,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -23
+    },
+
+    {
+       11,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
+      -24,  -24,  -24,   58,  -24,  -24,   58,   58,   58,   58,
+       58,   58,   65,   58,   58,   58,   58,   58,   66,   58,
+       58,   58,   58,   58,   58,   58,   58,  -24
+
+    },
+
+    {
+       11,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
+      -25,  -25,  -25,   58,  -25,  -25,   58,   67,   58,   58,
+       58,   68,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -25
+    },
+
+    {
+       11,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
+      -26,  -26,  -26,   58,  -26,  -26,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       69,   58,   58,   58,   58,   58,   58,  -26
+    },
+
+    {
+       11,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,
+      -27,  -27,  -27,   58,  -27,  -27,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   70,   58,   58,   58,   58,  -27
+    },
+
+    {
+       11,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,
+      -28,  -28,  -28,   58,  -28,  -28,   58,   71,   58,   58,
+       58,   72,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -28
+    },
+
+    {
+       11,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
+      -29,  -29,  -29,   58,  -29,  -29,   58,   58,   58,   58,
+       58,   73,   58,   58,   58,   58,   58,   58,   58,   74,
+       58,   58,   58,   58,   75,   58,   58,  -29
+
+    },
+
+    {
+       11,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,
+      -30,  -30,  -30,   58,  -30,  -30,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   76,   58,   58,   58,   58,  -30
+    },
+
+    {
+       11,   77,   77,  -31,   77,   77,   77,   77,   77,   77,
+       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
+       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
+       77,   77,   77,   77,   77,   77,   77,   77
+    },
+
+    {
+       11,  -32,   78,   79,  -32,  -32,  -32,  -32,  -32,  -32,
+      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
+
+      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
+      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32
+    },
+
+    {
+       11,   80,  -33,  -33,   80,   80,   80,   80,   80,   80,
+       80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
+       80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
+       80,   80,   80,   80,   80,   80,   80,   80
+    },
+
+    {
+       11,   81,   81,   82,   81,  -34,   81,   81,  -34,   81,
+       81,   81,   81,   81,   81,  -34,   81,   81,   81,   81,
+       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
+       81,   81,   81,   81,   81,   81,   81,   81
+
+    },
+
+    {
+       11,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
+      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
+      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
+      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35
+    },
+
+    {
+       11,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
+      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
+      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
+      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36
+    },
+
+    {
+       11,   83,   83,   84,   83,   83,   83,   83,   83,   83,
+       83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
+
+       83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
+       83,   83,   83,   83,   83,   83,   83,   83
+    },
+
+    {
+       11,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,
+      -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,
+      -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,
+      -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38
+    },
+
+    {
+       11,  -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39,
+      -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39,
+      -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39,
+      -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39
+
+    },
+
+    {
+       11,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,
+      -40,  -40,  -40,  -40,   85,  -40,  -40,  -40,  -40,  -40,
+      -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,
+      -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40
+    },
+
+    {
+       11,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,
+      -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,
+      -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,
+      -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41
+    },
+
+    {
+       11,   86,   86,  -42,   86,   86,   86,   86,   86,   86,
+       86,   86,   86,   86,   86,   86,   86,   86,   86,   86,
+
+       86,   86,   86,   86,   86,   86,   86,   86,   86,   86,
+       86,   86,   86,   86,   86,   86,   86,   86
+    },
+
+    {
+       11,  -43,  -43,  -43,  -43,  -43,  -43,   87,  -43,  -43,
+      -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
+      -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
+      -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43
+    },
+
+    {
+       11,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,
+      -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,
+      -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,
+      -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44
+
+    },
+
+    {
+       11,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
+      -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
+      -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
+      -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45
+    },
+
+    {
+       11,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,
+      -46,   88,   89,   89,  -46,  -46,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,  -46
+    },
+
+    {
+       11,  -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,
+      -47,   89,   89,   89,  -47,  -47,   89,   89,   89,   89,
+
+       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,  -47
+    },
+
+    {
+       11,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
+      -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
+      -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
+      -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48
+    },
+
+    {
+       11,  -49,  -49,   90,  -49,  -49,  -49,  -49,  -49,  -49,
+      -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,
+      -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,
+      -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49
+
+    },
+
+    {
+       11,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,
+      -50,   89,   89,   89,  -50,  -50,   89,   89,   89,   89,
+       89,   89,   91,   89,   89,   89,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,  -50
+    },
+
+    {
+       11,  -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,
+      -51,   89,   89,   89,  -51,  -51,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,   89,   92,   89,
+       89,   89,   89,   89,   89,   89,   89,  -51
+    },
+
+    {
+       11,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,
+      -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,
+
+      -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,
+      -52,  -52,  -52,  -52,  -52,  -52,  -52,   93
+    },
+
+    {
+       11,  -53,   53,   54,  -53,  -53,   55,  -53,  -53,  -53,
+      -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,
+      -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,
+      -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53
+    },
+
+    {
+       11,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,
+      -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,
+      -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,
+      -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54
+
+    },
+
+    {
+       11,   56,   56,   57,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56
+    },
+
+    {
+       11,   56,   56,   57,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56
+    },
+
+    {
+       11,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,
+      -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,
+
+      -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,
+      -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57
+    },
+
+    {
+       11,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,
+      -58,  -58,  -58,   58,  -58,  -58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -58
+    },
+
+    {
+       11,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,
+      -59,  -59,  -59,   58,  -59,  -59,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   94,
+       58,   58,   58,   58,   58,   58,   58,  -59
+
+    },
+
+    {
+       11,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,
+      -60,  -60,  -60,   58,  -60,  -60,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   95,
+       58,   58,   58,   58,   58,   58,   58,  -60
+    },
+
+    {
+       11,  -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,
+      -61,  -61,  -61,   58,  -61,  -61,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   96,   97,   58,
+       58,   58,   58,   58,   58,   58,   58,  -61
+    },
+
+    {
+       11,  -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,
+      -62,  -62,  -62,   58,  -62,  -62,   58,   58,   58,   58,
+
+       58,   58,   98,   58,   58,   58,   58,   58,   58,   58,
+       99,   58,   58,   58,   58,   58,   58,  -62
+    },
+
+    {
+       11,  -63,  -63,  -63,  -63,  -63,  -63,  -63,  -63,  -63,
+      -63,  -63,  -63,   58,  -63,  -63,   58,  100,   58,   58,
+      101,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -63
+    },
+
+    {
+       11,  -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64,
+      -64,  -64,  -64,   58,  -64,  -64,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  102,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  103,  -64
+
+    },
+
+    {
+       11,  -65,  -65,  -65,  -65,  -65,  -65,  -65,  -65,  -65,
+      -65,  -65,  -65,   58,  -65,  -65,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -65
+    },
+
+    {
+       11,  -66,  -66,  -66,  -66,  -66,  -66,  -66,  -66,  -66,
+      -66,  -66,  -66,   58,  -66,  -66,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  104,   58,   58,  -66
+    },
+
+    {
+       11,  -67,  -67,  -67,  -67,  -67,  -67,  -67,  -67,  -67,
+      -67,  -67,  -67,   58,  -67,  -67,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,  105,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -67
+    },
+
+    {
+       11,  -68,  -68,  -68,  -68,  -68,  -68,  -68,  -68,  -68,
+      -68,  -68,  -68,   58,  -68,  -68,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  106,   58,
+       58,   58,   58,   58,   58,   58,   58,  -68
+    },
+
+    {
+       11,  -69,  -69,  -69,  -69,  -69,  -69,  -69,  -69,  -69,
+      -69,  -69,  -69,   58,  -69,  -69,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  107,   58,   58,  -69
+
+    },
+
+    {
+       11,  -70,  -70,  -70,  -70,  -70,  -70,  -70,  -70,  -70,
+      -70,  -70,  -70,   58,  -70,  -70,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,  108,
+       58,   58,   58,   58,   58,   58,   58,  -70
+    },
+
+    {
+       11,  -71,  -71,  -71,  -71,  -71,  -71,  -71,  -71,  -71,
+      -71,  -71,  -71,   58,  -71,  -71,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  109,   58,
+       58,   58,   58,   58,   58,   58,   58,  -71
+    },
+
+    {
+       11,  -72,  -72,  -72,  -72,  -72,  -72,  -72,  -72,  -72,
+      -72,  -72,  -72,   58,  -72,  -72,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,  110,   58,   58,   58,   58,   58,  -72
+    },
+
+    {
+       11,  -73,  -73,  -73,  -73,  -73,  -73,  -73,  -73,  -73,
+      -73,  -73,  -73,   58,  -73,  -73,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  111,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -73
+    },
+
+    {
+       11,  -74,  -74,  -74,  -74,  -74,  -74,  -74,  -74,  -74,
+      -74,  -74,  -74,   58,  -74,  -74,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  112,   58,  -74
+
+    },
+
+    {
+       11,  -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,
+      -75,  -75,  -75,   58,  -75,  -75,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,  113,   58,   58,   58,   58,  -75
+    },
+
+    {
+       11,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,
+      -76,  -76,  -76,   58,  -76,  -76,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  114,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -76
+    },
+
+    {
+       11,   77,   77,  -77,   77,   77,   77,   77,   77,   77,
+       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
+
+       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
+       77,   77,   77,   77,   77,   77,   77,   77
+    },
+
+    {
+       11,  -78,   78,   79,  -78,  -78,  -78,  -78,  -78,  -78,
+      -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,
+      -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,
+      -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78
+    },
+
+    {
+       11,   80,  -79,  -79,   80,   80,   80,   80,   80,   80,
+       80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
+       80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
+       80,   80,   80,   80,   80,   80,   80,   80
+
+    },
+
+    {
+       11,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,
+      -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,
+      -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,
+      -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80
+    },
+
+    {
+       11,   81,   81,   82,   81,  -81,   81,   81,  -81,   81,
+       81,   81,   81,   81,   81,  -81,   81,   81,   81,   81,
+       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
+       81,   81,   81,   81,   81,   81,   81,   81
+    },
+
+    {
+       11,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,
+      -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,
+
+      -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,
+      -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82
+    },
+
+    {
+       11,  -83,  -83,   84,  -83,  -83,  -83,  -83,  -83,  -83,
+      -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,
+      -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,
+      -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83
+    },
+
+    {
+       11,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,
+      -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,
+      -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,
+      -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84
+
+    },
+
+    {
+       11,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,
+      -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,
+      -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,
+      -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85
+    },
+
+    {
+       11,   86,   86,  -86,   86,   86,   86,   86,   86,   86,
+       86,   86,   86,   86,   86,   86,   86,   86,   86,   86,
+       86,   86,   86,   86,   86,   86,   86,   86,   86,   86,
+       86,   86,   86,   86,   86,   86,   86,   86
+    },
+
+    {
+       11,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,
+      -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,
+
+      -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,
+      -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87
+    },
+
+    {
+       11,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,
+      -88,  115,   89,   89,  -88,  -88,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,  -88
+    },
+
+    {
+       11,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,
+      -89,   89,   89,   89,  -89,  -89,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,  -89
+
+    },
+
+    {
+       11,  -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90,
+      -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90,
+      -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90,
+      -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90
+    },
+
+    {
+       11,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,
+      -91,   89,   89,   89,  -91,  -91,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,  -91
+    },
+
+    {
+       11,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,
+      -92,   89,   89,   89,  -92,  -92,   89,   89,   89,   89,
+
+       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,  -92
+    },
+
+    {
+       11,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,
+      -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,
+      -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,
+      -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93
+    },
+
+    {
+       11,  -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,
+      -94,  -94,  -94,   58,  -94,  -94,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  116,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -94
+
+    },
+
+    {
+       11,  -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,
+      -95,  -95,  -95,   58,  -95,  -95,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  117,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -95
+    },
+
+    {
+       11,  -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,
+      -96,  -96,  -96,   58,  -96,  -96,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  118,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -96
+    },
+
+    {
+       11,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,
+      -97,  -97,  -97,   58,  -97,  -97,   58,   58,   58,   58,
+
+       58,   58,  119,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -97
+    },
+
+    {
+       11,  -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,
+      -98,  -98,  -98,   58,  -98,  -98,  120,  121,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -98
+    },
+
+    {
+       11,  -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,
+      -99,  -99,  -99,   58,  -99,  -99,   58,   58,   58,   58,
+       58,  122,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  -99
+
+    },
+
+    {
+       11, -100, -100, -100, -100, -100, -100, -100, -100, -100,
+     -100, -100, -100,   58, -100, -100,   58,   58,  123,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -100
+    },
+
+    {
+       11, -101, -101, -101, -101, -101, -101, -101, -101, -101,
+     -101, -101, -101,   58, -101, -101,   58,   58,   58,  124,
+       58,   58,   58,   58,   58,  125,   58,  126,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -101
+    },
+
+    {
+       11, -102, -102, -102, -102, -102, -102, -102, -102, -102,
+     -102, -102, -102,   58, -102, -102,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+      127,   58,   58,   58,   58,   58,   58, -102
+    },
+
+    {
+       11, -103, -103, -103, -103, -103, -103, -103, -103, -103,
+     -103, -103, -103,   58, -103, -103,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -103
+    },
+
+    {
+       11, -104, -104, -104, -104, -104, -104, -104, -104, -104,
+     -104, -104, -104,   58, -104, -104,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -104
+
+    },
+
+    {
+       11, -105, -105, -105, -105, -105, -105, -105, -105, -105,
+     -105, -105, -105,   58, -105, -105,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  128,   58,
+       58,   58,   58,   58,   58,   58,   58, -105
+    },
+
+    {
+       11, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+     -106, -106, -106,   58, -106, -106,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  129,   58, -106
+    },
+
+    {
+       11, -107, -107, -107, -107, -107, -107, -107, -107, -107,
+     -107, -107, -107,   58, -107, -107,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,  130,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -107
+    },
+
+    {
+       11, -108, -108, -108, -108, -108, -108, -108, -108, -108,
+     -108, -108, -108,   58, -108, -108,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  131,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -108
+    },
+
+    {
+       11, -109, -109, -109, -109, -109, -109, -109, -109, -109,
+     -109, -109, -109,   58, -109, -109,   58,   58,   58,   58,
+       58,   58,   58,  132,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -109
+
+    },
+
+    {
+       11, -110, -110, -110, -110, -110, -110, -110, -110, -110,
+     -110, -110, -110,   58, -110, -110,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  133,   58, -110
+    },
+
+    {
+       11, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+     -111, -111, -111,   58, -111, -111,   58,   58,   58,   58,
+       58,  134,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -111
+    },
+
+    {
+       11, -112, -112, -112, -112, -112, -112, -112, -112, -112,
+     -112, -112, -112,   58, -112, -112,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,  135,   58,   58,   58,   58, -112
+    },
+
+    {
+       11, -113, -113, -113, -113, -113, -113, -113, -113, -113,
+     -113, -113, -113,   58, -113, -113,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  136,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -113
+    },
+
+    {
+       11, -114, -114, -114, -114, -114, -114, -114, -114, -114,
+     -114, -114, -114,   58, -114, -114,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  137,   58,   58,   58, -114
+
+    },
+
+    {
+       11, -115, -115, -115, -115, -115, -115, -115, -115, -115,
+     -115,   89,   89,   89, -115, -115,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
+       89,   89,   89,   89,   89,   89,   89, -115
+    },
+
+    {
+       11, -116, -116, -116, -116, -116, -116, -116, -116, -116,
+     -116, -116, -116,   58, -116, -116,   58,   58,   58,   58,
+       58,  138,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -116
+    },
+
+    {
+       11, -117, -117, -117, -117, -117, -117, -117, -117, -117,
+     -117, -117, -117,   58, -117, -117,   58,   58,   58,  139,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -117
+    },
+
+    {
+       11, -118, -118, -118, -118, -118, -118, -118, -118, -118,
+     -118, -118, -118,   58, -118, -118,   58,   58,   58,   58,
+       58,  140,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -118
+    },
+
+    {
+       11, -119, -119, -119, -119, -119, -119, -119, -119, -119,
+     -119, -119, -119,   58, -119, -119,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  141,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -119
+
+    },
+
+    {
+       11, -120, -120, -120, -120, -120, -120, -120, -120, -120,
+     -120, -120, -120,   58, -120, -120,   58,   58,  142,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  143,   58,   58, -120
+    },
+
+    {
+       11, -121, -121, -121, -121, -121, -121, -121, -121, -121,
+     -121, -121, -121,   58, -121, -121,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  144,   58, -121
+    },
+
+    {
+       11, -122, -122, -122, -122, -122, -122, -122, -122, -122,
+     -122, -122, -122,   58, -122, -122,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,  145,   58,
+       58,   58,   58,   58,   58,   58,   58, -122
+    },
+
+    {
+       11, -123, -123, -123, -123, -123, -123, -123, -123, -123,
+     -123, -123, -123,   58, -123, -123,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  146,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -123
+    },
+
+    {
+       11, -124, -124, -124, -124, -124, -124, -124, -124, -124,
+     -124, -124, -124,   58, -124, -124,   58,   58,   58,   58,
+       58,   58,   58,   58,  147,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -124
+
+    },
+
+    {
+       11, -125, -125, -125, -125, -125, -125, -125, -125, -125,
+     -125, -125, -125,   58, -125, -125,   58,   58,   58,   58,
+       58,   58,  148,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -125
+    },
+
+    {
+       11, -126, -126, -126, -126, -126, -126, -126, -126, -126,
+     -126, -126, -126,   58, -126, -126,   58,   58,   58,   58,
+       58,  149,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -126
+    },
+
+    {
+       11, -127, -127, -127, -127, -127, -127, -127, -127, -127,
+     -127, -127, -127,   58, -127, -127,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -127
+    },
+
+    {
+       11, -128, -128, -128, -128, -128, -128, -128, -128, -128,
+     -128, -128, -128,   58, -128, -128,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  150,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -128
+    },
+
+    {
+       11, -129, -129, -129, -129, -129, -129, -129, -129, -129,
+     -129, -129, -129,   58, -129, -129,   58,   58,   58,  151,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -129
+
+    },
+
+    {
+       11, -130, -130, -130, -130, -130, -130, -130, -130, -130,
+     -130, -130, -130,   58, -130, -130,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,  152,
+       58,   58,   58,   58,   58,   58,   58, -130
+    },
+
+    {
+       11, -131, -131, -131, -131, -131, -131, -131, -131, -131,
+     -131, -131, -131,   58, -131, -131,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+      153,   58,   58,   58,   58,   58,   58, -131
+    },
+
+    {
+       11, -132, -132, -132, -132, -132, -132, -132, -132, -132,
+     -132, -132, -132,   58, -132, -132,   58,   58,   58,   58,
+
+       58,  154,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -132
+    },
+
+    {
+       11, -133, -133, -133, -133, -133, -133, -133, -133, -133,
+     -133, -133, -133,   58, -133, -133,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  155,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -133
+    },
+
+    {
+       11, -134, -134, -134, -134, -134, -134, -134, -134, -134,
+     -134, -134, -134,   58, -134, -134,   58,   58,   58,  156,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -134
+
+    },
+
+    {
+       11, -135, -135, -135, -135, -135, -135, -135, -135, -135,
+     -135, -135, -135,   58, -135, -135,   58,   58,   58,  157,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -135
+    },
+
+    {
+       11, -136, -136, -136, -136, -136, -136, -136, -136, -136,
+     -136, -136, -136,   58, -136, -136,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  158,   58,
+       58,   58,   58,   58,   58,   58,   58, -136
+    },
+
+    {
+       11, -137, -137, -137, -137, -137, -137, -137, -137, -137,
+     -137, -137, -137,   58, -137, -137,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  159,   58,   58, -137
+    },
+
+    {
+       11, -138, -138, -138, -138, -138, -138, -138, -138, -138,
+     -138, -138, -138,   58, -138, -138,   58,  160,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -138
+    },
+
+    {
+       11, -139, -139, -139, -139, -139, -139, -139, -139, -139,
+     -139, -139, -139,   58, -139, -139,   58,   58,   58,   58,
+       58,  161,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -139
+
+    },
+
+    {
+       11, -140, -140, -140, -140, -140, -140, -140, -140, -140,
+     -140, -140, -140,   58, -140, -140,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  162,   58,
+       58,   58,   58,   58,   58,   58,   58, -140
+    },
+
+    {
+       11, -141, -141, -141, -141, -141, -141, -141, -141, -141,
+     -141, -141, -141,   58, -141, -141,   58,   58,   58,   58,
+       58,   58,   58,  163,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -141
+    },
+
+    {
+       11, -142, -142, -142, -142, -142, -142, -142, -142, -142,
+     -142, -142, -142,   58, -142, -142,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,  164,
+       58,   58,   58,   58,   58,   58,   58, -142
+    },
+
+    {
+       11, -143, -143, -143, -143, -143, -143, -143, -143, -143,
+     -143, -143, -143,   58, -143, -143,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,  165,   58,   58,   58,   58, -143
+    },
+
+    {
+       11, -144, -144, -144, -144, -144, -144, -144, -144, -144,
+     -144, -144, -144,   58, -144, -144,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  166,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -144
+
+    },
+
+    {
+       11, -145, -145, -145, -145, -145, -145, -145, -145, -145,
+     -145, -145, -145,   58, -145, -145,   58,   58,   58,   58,
+      167,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -145
+    },
+
+    {
+       11, -146, -146, -146, -146, -146, -146, -146, -146, -146,
+     -146, -146, -146,   58, -146, -146,   58,   58,   58,   58,
+       58,  168,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -146
+    },
+
+    {
+       11, -147, -147, -147, -147, -147, -147, -147, -147, -147,
+     -147, -147, -147,   58, -147, -147,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,  169,
+       58,   58,   58,   58,   58,   58,   58, -147
+    },
+
+    {
+       11, -148, -148, -148, -148, -148, -148, -148, -148, -148,
+     -148, -148, -148,   58, -148, -148,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -148
+    },
+
+    {
+       11, -149, -149, -149, -149, -149, -149, -149, -149, -149,
+     -149, -149, -149,   58, -149, -149,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  170,   58,
+       58,   58,   58,   58,   58,   58,   58, -149
+
+    },
+
+    {
+       11, -150, -150, -150, -150, -150, -150, -150, -150, -150,
+     -150, -150, -150,   58, -150, -150,   58,   58,   58,   58,
+       58,  171,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -150
+    },
+
+    {
+       11, -151, -151, -151, -151, -151, -151, -151, -151, -151,
+     -151, -151, -151,   58, -151, -151,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,  172,
+       58,   58,   58,   58,   58,   58,   58, -151
+    },
+
+    {
+       11, -152, -152, -152, -152, -152, -152, -152, -152, -152,
+     -152, -152, -152,   58, -152, -152,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,  173,   58,
+       58,   58,   58,   58,   58,   58,   58, -152
+    },
+
+    {
+       11, -153, -153, -153, -153, -153, -153, -153, -153, -153,
+     -153, -153, -153,   58, -153, -153,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  174,   58,   58, -153
+    },
+
+    {
+       11, -154, -154, -154, -154, -154, -154, -154, -154, -154,
+     -154, -154, -154,   58, -154, -154,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -154
+
+    },
+
+    {
+       11, -155, -155, -155, -155, -155, -155, -155, -155, -155,
+     -155, -155, -155,   58, -155, -155,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,  175,   58,   58,   58,   58, -155
+    },
+
+    {
+       11, -156, -156, -156, -156, -156, -156, -156, -156, -156,
+     -156, -156, -156,   58, -156, -156,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  176,   58,   58, -156
+    },
+
+    {
+       11, -157, -157, -157, -157, -157, -157, -157, -157, -157,
+     -157, -157, -157,   58, -157, -157,   58,   58,   58,   58,
+
+       58,  177,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -157
+    },
+
+    {
+       11, -158, -158, -158, -158, -158, -158, -158, -158, -158,
+     -158, -158, -158,   58, -158, -158,   58,   58,   58,   58,
+       58,   58,   58,  178,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -158
+    },
+
+    {
+       11, -159, -159, -159, -159, -159, -159, -159, -159, -159,
+     -159, -159, -159,   58, -159, -159,   58,  179,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -159
+
+    },
+
+    {
+       11, -160, -160, -160, -160, -160, -160, -160, -160, -160,
+     -160, -160, -160,   58, -160, -160,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  180,   58,
+       58,   58,   58,   58,   58,   58,   58, -160
+    },
+
+    {
+       11, -161, -161, -161, -161, -161, -161, -161, -161, -161,
+     -161, -161, -161,   58, -161, -161,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -161
+    },
+
+    {
+       11, -162, -162, -162, -162, -162, -162, -162, -162, -162,
+     -162, -162, -162,   58, -162, -162,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  181,   58,   58, -162
+    },
+
+    {
+       11, -163, -163, -163, -163, -163, -163, -163, -163, -163,
+     -163, -163, -163,   58, -163, -163,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -163
+    },
+
+    {
+       11, -164, -164, -164, -164, -164, -164, -164, -164, -164,
+     -164, -164, -164,   58, -164, -164,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,  182,
+       58,   58,   58,   58,   58,   58,   58, -164
+
+    },
+
+    {
+       11, -165, -165, -165, -165, -165, -165, -165, -165, -165,
+     -165, -165, -165,   58, -165, -165,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  183,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -165
+    },
+
+    {
+       11, -166, -166, -166, -166, -166, -166, -166, -166, -166,
+     -166, -166, -166,   58, -166, -166,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  184,   58,   58, -166
+    },
+
+    {
+       11, -167, -167, -167, -167, -167, -167, -167, -167, -167,
+     -167, -167, -167,   58, -167, -167,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  185,   58,   58,   58, -167
+    },
+
+    {
+       11, -168, -168, -168, -168, -168, -168, -168, -168, -168,
+     -168, -168, -168,   58, -168, -168,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -168
+    },
+
+    {
+       11, -169, -169, -169, -169, -169, -169, -169, -169, -169,
+     -169, -169, -169,   58, -169, -169,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  186,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -169
+
+    },
+
+    {
+       11, -170, -170, -170, -170, -170, -170, -170, -170, -170,
+     -170, -170, -170,   58, -170, -170,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  187,   58, -170
+    },
+
+    {
+       11, -171, -171, -171, -171, -171, -171, -171, -171, -171,
+     -171, -171, -171,   58, -171, -171,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  188,   58,
+       58,   58,   58,   58,   58,   58,   58, -171
+    },
+
+    {
+       11, -172, -172, -172, -172, -172, -172, -172, -172, -172,
+     -172, -172, -172,   58, -172, -172,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,  189,   58,
+       58,   58,   58,   58,   58,   58,   58, -172
+    },
+
+    {
+       11, -173, -173, -173, -173, -173, -173, -173, -173, -173,
+     -173, -173, -173,   58, -173, -173,   58,  190,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -173
+    },
+
+    {
+       11, -174, -174, -174, -174, -174, -174, -174, -174, -174,
+     -174, -174, -174,   58, -174, -174,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -174
+
+    },
+
+    {
+       11, -175, -175, -175, -175, -175, -175, -175, -175, -175,
+     -175, -175, -175,   58, -175, -175,   58,   58,   58,   58,
+       58,  191,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -175
+    },
+
+    {
+       11, -176, -176, -176, -176, -176, -176, -176, -176, -176,
+     -176, -176, -176,   58, -176, -176,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -176
+    },
+
+    {
+       11, -177, -177, -177, -177, -177, -177, -177, -177, -177,
+     -177, -177, -177,   58, -177, -177,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -177
+    },
+
+    {
+       11, -178, -178, -178, -178, -178, -178, -178, -178, -178,
+     -178, -178, -178,   58, -178, -178,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -178
+    },
+
+    {
+       11, -179, -179, -179, -179, -179, -179, -179, -179, -179,
+     -179, -179, -179,   58, -179, -179,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  192,   58,   58, -179
+
+    },
+
+    {
+       11, -180, -180, -180, -180, -180, -180, -180, -180, -180,
+     -180, -180, -180,   58, -180, -180,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -180
+    },
+
+    {
+       11, -181, -181, -181, -181, -181, -181, -181, -181, -181,
+     -181, -181, -181,   58, -181, -181,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -181
+    },
+
+    {
+       11, -182, -182, -182, -182, -182, -182, -182, -182, -182,
+     -182, -182, -182,   58, -182, -182,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,  193,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -182
+    },
+
+    {
+       11, -183, -183, -183, -183, -183, -183, -183, -183, -183,
+     -183, -183, -183,   58, -183, -183,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  194,   58,   58,   58, -183
+    },
+
+    {
+       11, -184, -184, -184, -184, -184, -184, -184, -184, -184,
+     -184, -184, -184,   58, -184, -184,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -184
+
+    },
+
+    {
+       11, -185, -185, -185, -185, -185, -185, -185, -185, -185,
+     -185, -185, -185,   58, -185, -185,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -185
+    },
+
+    {
+       11, -186, -186, -186, -186, -186, -186, -186, -186, -186,
+     -186, -186, -186,   58, -186, -186,   58,   58,   58,  195,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -186
+    },
+
+    {
+       11, -187, -187, -187, -187, -187, -187, -187, -187, -187,
+     -187, -187, -187,   58, -187, -187,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -187
+    },
+
+    {
+       11, -188, -188, -188, -188, -188, -188, -188, -188, -188,
+     -188, -188, -188,   58, -188, -188,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  196,   58, -188
+    },
+
+    {
+       11, -189, -189, -189, -189, -189, -189, -189, -189, -189,
+     -189, -189, -189,   58, -189, -189,   58,   58,   58,   58,
+       58,   58,  197,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -189
+
+    },
+
+    {
+       11, -190, -190, -190, -190, -190, -190, -190, -190, -190,
+     -190, -190, -190,   58, -190, -190,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  198,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -190
+    },
+
+    {
+       11, -191, -191, -191, -191, -191, -191, -191, -191, -191,
+     -191, -191, -191,   58, -191, -191,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  199,   58,   58,   58, -191
+    },
+
+    {
+       11, -192, -192, -192, -192, -192, -192, -192, -192, -192,
+     -192, -192, -192,   58, -192, -192,   58,   58,   58,   58,
+
+       58,  200,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -192
+    },
+
+    {
+       11, -193, -193, -193, -193, -193, -193, -193, -193, -193,
+     -193, -193, -193,   58, -193, -193,   58,   58,   58,   58,
+       58,  201,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -193
+    },
+
+    {
+       11, -194, -194, -194, -194, -194, -194, -194, -194, -194,
+     -194, -194, -194,   58, -194, -194,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  202,   58,   58, -194
+
+    },
+
+    {
+       11, -195, -195, -195, -195, -195, -195, -195, -195, -195,
+     -195, -195, -195,   58, -195, -195,   58,   58,   58,   58,
+       58,  203,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -195
+    },
+
+    {
+       11, -196, -196, -196, -196, -196, -196, -196, -196, -196,
+     -196, -196, -196,   58, -196, -196,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -196
+    },
+
+    {
+       11, -197, -197, -197, -197, -197, -197, -197, -197, -197,
+     -197, -197, -197,   58, -197, -197,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,  204,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -197
+    },
+
+    {
+       11, -198, -198, -198, -198, -198, -198, -198, -198, -198,
+     -198, -198, -198,   58, -198, -198,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -198
+    },
+
+    {
+       11, -199, -199, -199, -199, -199, -199, -199, -199, -199,
+     -199, -199, -199,   58, -199, -199,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -199
+
+    },
+
+    {
+       11, -200, -200, -200, -200, -200, -200, -200, -200, -200,
+     -200, -200, -200,   58, -200, -200,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -200
+    },
+
+    {
+       11, -201, -201, -201, -201, -201, -201, -201, -201, -201,
+     -201, -201, -201,   58, -201, -201,   58,  205,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -201
+    },
+
+    {
+       11, -202, -202, -202, -202, -202, -202, -202, -202, -202,
+     -202, -202, -202,   58, -202, -202,   58,  206,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -202
+    },
+
+    {
+       11, -203, -203, -203, -203, -203, -203, -203, -203, -203,
+     -203, -203, -203,   58, -203, -203,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -203
+    },
+
+    {
+       11, -204, -204, -204, -204, -204, -204, -204, -204, -204,
+     -204, -204, -204,   58, -204, -204,   58,   58,   58,   58,
+       58,   58,   58,  207,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -204
+
+    },
+
+    {
+       11, -205, -205, -205, -205, -205, -205, -205, -205, -205,
+     -205, -205, -205,   58, -205, -205,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  208,   58,
+       58,   58,   58,   58,   58,   58,   58, -205
+    },
+
+    {
+       11, -206, -206, -206, -206, -206, -206, -206, -206, -206,
+     -206, -206, -206,   58, -206, -206,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  209,   58,   58, -206
+    },
+
+    {
+       11, -207, -207, -207, -207, -207, -207, -207, -207, -207,
+     -207, -207, -207,   58, -207, -207,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -207
+    },
+
+    {
+       11, -208, -208, -208, -208, -208, -208, -208, -208, -208,
+     -208, -208, -208,   58, -208, -208,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -208
+    },
+
+    {
+       11, -209, -209, -209, -209, -209, -209, -209, -209, -209,
+     -209, -209, -209,   58, -209, -209,   58,   58,   58,   58,
+       58,  210,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -209
+
+    },
+
+    {
+       11, -210, -210, -210, -210, -210, -210, -210, -210, -210,
+     -210, -210, -210,   58, -210, -210,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58, -210
+    },
+
+    } ;
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[]  );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up zconftext.
+ */
+#define YY_DO_BEFORE_ACTION \
+       (yytext_ptr) = yy_bp; \
+       zconfleng = (size_t) (yy_cp - yy_bp); \
+       (yy_hold_char) = *yy_cp; \
+       *yy_cp = '\0'; \
+       (yy_c_buf_p) = yy_cp;
+
+#define YY_NUM_RULES 64
+#define YY_END_OF_BUFFER 65
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+       {
+       flex_int32_t yy_verify;
+       flex_int32_t yy_nxt;
+       };
+static yyconst flex_int16_t yy_accept[211] =
+    {   0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       65,    5,    4,    3,    2,   36,   37,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+       63,   60,   62,   55,   59,   58,   57,   53,   48,   42,
+       47,   51,   53,   40,   41,   50,   50,   43,   53,   50,
+       50,   53,    4,    3,    2,    2,    1,   35,   35,   35,
+       35,   35,   35,   35,   16,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   63,   60,   62,   61,
+       55,   54,   57,   56,   44,   51,   38,   50,   50,   52,
+       45,   46,   39,   35,   35,   35,   35,   35,   35,   35,
+
+       35,   35,   30,   29,   35,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   49,   25,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   15,   35,    7,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   17,   35,   35,
+       35,   35,   35,   34,   35,   35,   35,   35,   35,   35,
+       10,   35,   13,   35,   35,   35,   35,   33,   35,   35,
+       35,   35,   35,   22,   35,   32,    9,   31,   35,   26,
+       12,   35,   35,   21,   18,   35,    8,   35,   35,   35,
+       35,   35,   27,   35,   35,    6,   35,   20,   19,   23,
+
+       35,   35,   11,   35,   35,   35,   14,   28,   35,   24
+    } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    4,    5,    6,    1,    1,    7,    8,    9,
+       10,    1,    1,    1,   11,   12,   12,   13,   13,   13,
+       13,   13,   13,   13,   13,   13,   13,    1,    1,    1,
+       14,    1,    1,    1,   13,   13,   13,   13,   13,   13,
+       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
+       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
+        1,   15,    1,    1,   16,    1,   17,   18,   19,   20,
+
+       21,   22,   23,   24,   25,   13,   13,   26,   27,   28,
+       29,   30,   31,   32,   33,   34,   35,   13,   13,   36,
+       13,   13,    1,   37,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+extern int zconf_flex_debug;
+int zconf_flex_debug = 0;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *zconftext;
+
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+#define START_STRSIZE  16
+
+char *text;
+static char *text_ptr;
+static int text_size, text_asize;
+
+struct buffer {
+        struct buffer *parent;
+        YY_BUFFER_STATE state;
+};
+
+struct buffer *current_buf;
+
+static int last_ts, first_ts;
+
+static void zconf_endhelp(void);
+static struct buffer *zconf_endfile(void);
+
+void new_string(void)
+{
+       text = malloc(START_STRSIZE);
+       text_asize = START_STRSIZE;
+       text_ptr = text;
+       text_size = 0;
+       *text_ptr = 0;
+}
+
+void append_string(const char *str, int size)
+{
+       int new_size = text_size + size + 1;
+       if (new_size > text_asize) {
+               text = realloc(text, new_size);
+               text_asize = new_size;
+               text_ptr = text + text_size;
+       }
+       memcpy(text_ptr, str, size);
+       text_ptr += size;
+       text_size += size;
+       *text_ptr = 0;
+}
+
+void alloc_string(const char *str, int size)
+{
+       text = malloc(size + 1);
+       memcpy(text, str, size);
+       text[size] = 0;
+}
+
+#define INITIAL 0
+#define COMMAND 1
+#define HELP 2
+#define STRING 3
+#define PARAM 4
+
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int zconfwrap (void );
+#else
+extern int zconfwrap (void );
+#endif
+#endif
+
+    static void yyunput (int c,char *buf_ptr  );
+    
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (void );
+#else
+static int input (void );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( zconftext, zconfleng, 1, zconfout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+       errno=0; \
+       while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \
+       { \
+               if( errno != EINTR) \
+               { \
+                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
+                       break; \
+               } \
+               errno=0; \
+               clearerr(zconfin); \
+       }\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int zconflex (void);
+
+#define YY_DECL int zconflex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after zconftext and zconfleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+       YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+       register yy_state_type yy_current_state;
+       register char *yy_cp, *yy_bp;
+       register int yy_act;
+    
+       int str = 0;
+       int ts, i;
+
+       if ( (yy_init) )
+               {
+               (yy_init) = 0;
+
+#ifdef YY_USER_INIT
+               YY_USER_INIT;
+#endif
+
+               if ( ! (yy_start) )
+                       (yy_start) = 1; /* first start state */
+
+               if ( ! zconfin )
+                       zconfin = stdin;
+
+               if ( ! zconfout )
+                       zconfout = stdout;
+
+               if ( ! YY_CURRENT_BUFFER ) {
+                       zconfensure_buffer_stack ();
+                       YY_CURRENT_BUFFER_LVALUE =
+                               zconf_create_buffer(zconfin,YY_BUF_SIZE );
+               }
+
+               zconf_load_buffer_state( );
+               }
+
+       while ( 1 )             /* loops until end-of-file is reached */
+               {
+               yy_cp = (yy_c_buf_p);
+
+               /* Support of zconftext. */
+               *yy_cp = (yy_hold_char);
+
+               /* yy_bp points to the position in yy_ch_buf of the start of
+                * the current run.
+                */
+               yy_bp = yy_cp;
+
+               yy_current_state = (yy_start);
+yy_match:
+               while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)]  ]) > 0 )
+                       ++yy_cp;
+
+               yy_current_state = -yy_current_state;
+
+yy_find_action:
+               yy_act = yy_accept[yy_current_state];
+
+               YY_DO_BEFORE_ACTION;
+
+do_action:     /* This label is used only to access EOF actions. */
+
+               switch ( yy_act )
+       { /* beginning of action switch */
+case 1:
+/* rule 1 can match eol */
+YY_RULE_SETUP
+current_file->lineno++;
+       YY_BREAK
+case 2:
+YY_RULE_SETUP
+
+       YY_BREAK
+case 3:
+/* rule 3 can match eol */
+YY_RULE_SETUP
+current_file->lineno++; return T_EOL;
+       YY_BREAK
+case 4:
+YY_RULE_SETUP
+{
+       BEGIN(COMMAND);
+}
+       YY_BREAK
+case 5:
+YY_RULE_SETUP
+{
+       unput(zconftext[0]);
+       BEGIN(COMMAND);
+}
+       YY_BREAK
+
+case 6:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_MAINMENU;
+       YY_BREAK
+case 7:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_MENU;
+       YY_BREAK
+case 8:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_ENDMENU;
+       YY_BREAK
+case 9:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_SOURCE;
+       YY_BREAK
+case 10:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_CHOICE;
+       YY_BREAK
+case 11:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_ENDCHOICE;
+       YY_BREAK
+case 12:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_COMMENT;
+       YY_BREAK
+case 13:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_CONFIG;
+       YY_BREAK
+case 14:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_MENUCONFIG;
+       YY_BREAK
+case 15:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_HELP;
+       YY_BREAK
+case 16:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_IF;
+       YY_BREAK
+case 17:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_ENDIF;
+       YY_BREAK
+case 18:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_DEPENDS;
+       YY_BREAK
+case 19:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_REQUIRES;
+       YY_BREAK
+case 20:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_OPTIONAL;
+       YY_BREAK
+case 21:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_DEFAULT;
+       YY_BREAK
+case 22:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_PROMPT;
+       YY_BREAK
+case 23:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_TRISTATE;
+       YY_BREAK
+case 24:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_DEF_TRISTATE;
+       YY_BREAK
+case 25:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_BOOLEAN;
+       YY_BREAK
+case 26:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_BOOLEAN;
+       YY_BREAK
+case 27:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_DEF_BOOLEAN;
+       YY_BREAK
+case 28:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_DEF_BOOLEAN;
+       YY_BREAK
+case 29:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_INT;
+       YY_BREAK
+case 30:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_HEX;
+       YY_BREAK
+case 31:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_STRING;
+       YY_BREAK
+case 32:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_SELECT;
+       YY_BREAK
+case 33:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_SELECT;
+       YY_BREAK
+case 34:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_RANGE;
+       YY_BREAK
+case 35:
+YY_RULE_SETUP
+{
+               alloc_string(zconftext, zconfleng);
+               zconflval.string = text;
+               return T_WORD;
+       }
+       YY_BREAK
+case 36:
+YY_RULE_SETUP
+
+       YY_BREAK
+case 37:
+/* rule 37 can match eol */
+YY_RULE_SETUP
+current_file->lineno++; BEGIN(INITIAL);
+       YY_BREAK
+
+case 38:
+YY_RULE_SETUP
+return T_AND;
+       YY_BREAK
+case 39:
+YY_RULE_SETUP
+return T_OR;
+       YY_BREAK
+case 40:
+YY_RULE_SETUP
+return T_OPEN_PAREN;
+       YY_BREAK
+case 41:
+YY_RULE_SETUP
+return T_CLOSE_PAREN;
+       YY_BREAK
+case 42:
+YY_RULE_SETUP
+return T_NOT;
+       YY_BREAK
+case 43:
+YY_RULE_SETUP
+return T_EQUAL;
+       YY_BREAK
+case 44:
+YY_RULE_SETUP
+return T_UNEQUAL;
+       YY_BREAK
+case 45:
+YY_RULE_SETUP
+return T_IF;
+       YY_BREAK
+case 46:
+YY_RULE_SETUP
+return T_ON;
+       YY_BREAK
+case 47:
+YY_RULE_SETUP
+{
+               str = zconftext[0];
+               new_string();
+               BEGIN(STRING);
+       }
+       YY_BREAK
+case 48:
+/* rule 48 can match eol */
+YY_RULE_SETUP
+BEGIN(INITIAL); current_file->lineno++; return T_EOL;
+       YY_BREAK
+case 49:
+YY_RULE_SETUP
+/* ignore */
+       YY_BREAK
+case 50:
+YY_RULE_SETUP
+{
+               alloc_string(zconftext, zconfleng);
+               zconflval.string = text;
+               return T_WORD;
+       }
+       YY_BREAK
+case 51:
+YY_RULE_SETUP
+/* comment */
+       YY_BREAK
+case 52:
+/* rule 52 can match eol */
+YY_RULE_SETUP
+current_file->lineno++;
+       YY_BREAK
+case 53:
+YY_RULE_SETUP
+
+       YY_BREAK
+case YY_STATE_EOF(PARAM):
+{
+               BEGIN(INITIAL);
+       }
+       YY_BREAK
+
+case 54:
+/* rule 54 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up zconftext again */
+YY_RULE_SETUP
+{
+               append_string(zconftext, zconfleng);
+               zconflval.string = text;
+               return T_WORD_QUOTE;
+       }
+       YY_BREAK
+case 55:
+YY_RULE_SETUP
+{
+               append_string(zconftext, zconfleng);
+       }
+       YY_BREAK
+case 56:
+/* rule 56 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up zconftext again */
+YY_RULE_SETUP
+{
+               append_string(zconftext + 1, zconfleng - 1);
+               zconflval.string = text;
+               return T_WORD_QUOTE;
+       }
+       YY_BREAK
+case 57:
+YY_RULE_SETUP
+{
+               append_string(zconftext + 1, zconfleng - 1);
+       }
+       YY_BREAK
+case 58:
+YY_RULE_SETUP
+{
+               if (str == zconftext[0]) {
+                       BEGIN(PARAM);
+                       zconflval.string = text;
+                       return T_WORD_QUOTE;
+               } else
+                       append_string(zconftext, 1);
+       }
+       YY_BREAK
+case 59:
+/* rule 59 can match eol */
+YY_RULE_SETUP
+{
+               printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
+               current_file->lineno++;
+               BEGIN(INITIAL);
+               return T_EOL;
+       }
+       YY_BREAK
+case YY_STATE_EOF(STRING):
+{
+               BEGIN(INITIAL);
+       }
+       YY_BREAK
+
+case 60:
+YY_RULE_SETUP
+{
+               ts = 0;
+               for (i = 0; i < zconfleng; i++) {
+                       if (zconftext[i] == '\t')
+                               ts = (ts & ~7) + 8;
+                       else
+                               ts++;
+               }
+               last_ts = ts;
+               if (first_ts) {
+                       if (ts < first_ts) {
+                               zconf_endhelp();
+                               return T_HELPTEXT;
+                       }
+                       ts -= first_ts;
+                       while (ts > 8) {
+                               append_string("        ", 8);
+                               ts -= 8;
+                       }
+                       append_string("        ", ts);
+               }
+       }
+       YY_BREAK
+case 61:
+/* rule 61 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up zconftext again */
+YY_RULE_SETUP
+{
+               current_file->lineno++;
+               zconf_endhelp();
+               return T_HELPTEXT;
+       }
+       YY_BREAK
+case 62:
+/* rule 62 can match eol */
+YY_RULE_SETUP
+{
+               current_file->lineno++;
+               append_string("\n", 1);
+       }
+       YY_BREAK
+case 63:
+YY_RULE_SETUP
+{
+               append_string(zconftext, zconfleng);
+               if (!first_ts)
+                       first_ts = last_ts;
+       }
+       YY_BREAK
+case YY_STATE_EOF(HELP):
+{
+               zconf_endhelp();
+               return T_HELPTEXT;
+       }
+       YY_BREAK
+
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(COMMAND):
+{
+       if (current_buf) {
+               zconf_endfile();
+               return T_EOF;
+       }
+       fclose(zconfin);
+       yyterminate();
+}
+       YY_BREAK
+case 64:
+YY_RULE_SETUP
+YY_FATAL_ERROR( "flex scanner jammed" );
+       YY_BREAK
+
+       case YY_END_OF_BUFFER:
+               {
+               /* Amount of text matched not including the EOB char. */
+               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+               /* Undo the effects of YY_DO_BEFORE_ACTION. */
+               *yy_cp = (yy_hold_char);
+               YY_RESTORE_YY_MORE_OFFSET
+
+               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+                       {
+                       /* We're scanning a new file or input source.  It's
+                        * possible that this happened because the user
+                        * just pointed zconfin at a new source and called
+                        * zconflex().  If so, then we have to assure
+                        * consistency between YY_CURRENT_BUFFER and our
+                        * globals.  Here is the right place to do so, because
+                        * this is the first action (other than possibly a
+                        * back-up) that will match for the new input source.
+                        */
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+                       }
+
+               /* Note that here we test for yy_c_buf_p "<=" to the position
+                * of the first EOB in the buffer, since yy_c_buf_p will
+                * already have been incremented past the NUL character
+                * (since all states make transitions on EOB to the
+                * end-of-buffer state).  Contrast this with the test
+                * in input().
+                */
+               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+                       { /* This was really a NUL. */
+                       yy_state_type yy_next_state;
+
+                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+                       yy_current_state = yy_get_previous_state(  );
+
+                       /* Okay, we're now positioned to make the NUL
+                        * transition.  We couldn't have
+                        * yy_get_previous_state() go ahead and do it
+                        * for us because it doesn't know how to deal
+                        * with the possibility of jamming (and we don't
+                        * want to build jamming into it because then it
+                        * will run more slowly).
+                        */
+
+                       yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+                       if ( yy_next_state )
+                               {
+                               /* Consume the NUL. */
+                               yy_cp = ++(yy_c_buf_p);
+                               yy_current_state = yy_next_state;
+                               goto yy_match;
+                               }
+
+                       else
+                               {
+                               yy_cp = (yy_c_buf_p);
+                               goto yy_find_action;
+                               }
+                       }
+
+               else switch ( yy_get_next_buffer(  ) )
+                       {
+                       case EOB_ACT_END_OF_FILE:
+                               {
+                               (yy_did_buffer_switch_on_eof) = 0;
+
+                               if ( zconfwrap( ) )
+                                       {
+                                       /* Note: because we've taken care in
+                                        * yy_get_next_buffer() to have set up
+                                        * zconftext, we can now set up
+                                        * yy_c_buf_p so that if some total
+                                        * hoser (like flex itself) wants to
+                                        * call the scanner after we return the
+                                        * YY_NULL, it'll still work - another
+                                        * YY_NULL will get returned.
+                                        */
+                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+                                       yy_act = YY_STATE_EOF(YY_START);
+                                       goto do_action;
+                                       }
+
+                               else
+                                       {
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
+                                               YY_NEW_FILE;
+                                       }
+                               break;
+                               }
+
+                       case EOB_ACT_CONTINUE_SCAN:
+                               (yy_c_buf_p) =
+                                       (yytext_ptr) + yy_amount_of_matched_text;
+
+                               yy_current_state = yy_get_previous_state(  );
+
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                               goto yy_match;
+
+                       case EOB_ACT_LAST_MATCH:
+                               (yy_c_buf_p) =
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+                               yy_current_state = yy_get_previous_state(  );
+
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                               goto yy_find_action;
+                       }
+               break;
+               }
+
+       default:
+               YY_FATAL_ERROR(
+                       "fatal flex scanner internal error--no action found" );
+       } /* end of action switch */
+               } /* end of scanning one token */
+} /* end of zconflex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *     EOB_ACT_LAST_MATCH -
+ *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *     EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (void)
+{
+       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+       register char *source = (yytext_ptr);
+       register int number_to_move, i;
+       int ret_val;
+
+       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+               YY_FATAL_ERROR(
+               "fatal flex scanner internal error--end of buffer missed" );
+
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+               { /* Don't try to fill the buffer, so this is an EOF. */
+               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+                       {
+                       /* We matched a single character, the EOB, so
+                        * treat this as a final EOF.
+                        */
+                       return EOB_ACT_END_OF_FILE;
+                       }
+
+               else
+                       {
+                       /* We matched some text prior to the EOB, first
+                        * process it.
+                        */
+                       return EOB_ACT_LAST_MATCH;
+                       }
+               }
+
+       /* Try to read more data. */
+
+       /* First move last chars to start of buffer. */
+       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+       for ( i = 0; i < number_to_move; ++i )
+               *(dest++) = *(source++);
+
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+               /* don't do the read, it's not guaranteed to return an EOF,
+                * just force an EOF
+                */
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+       else
+               {
+                       size_t num_to_read =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+               while ( num_to_read <= 0 )
+                       { /* Not enough room in the buffer - grow it. */
+
+                       /* just a shorter name for the current buffer */
+                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+                       int yy_c_buf_p_offset =
+                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+                       if ( b->yy_is_our_buffer )
+                               {
+                               int new_size = b->yy_buf_size * 2;
+
+                               if ( new_size <= 0 )
+                                       b->yy_buf_size += b->yy_buf_size / 8;
+                               else
+                                       b->yy_buf_size *= 2;
+
+                               b->yy_ch_buf = (char *)
+                                       /* Include room in for 2 EOB chars. */
+                                       zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
+                               }
+                       else
+                               /* Can't grow it, we don't own it. */
+                               b->yy_ch_buf = 0;
+
+                       if ( ! b->yy_ch_buf )
+                               YY_FATAL_ERROR(
+                               "fatal error - scanner input buffer overflow" );
+
+                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+                                               number_to_move - 1;
+
+                       }
+
+               if ( num_to_read > YY_READ_BUF_SIZE )
+                       num_to_read = YY_READ_BUF_SIZE;
+
+               /* Read in more data. */
+               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+                       (yy_n_chars), num_to_read );
+
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       if ( (yy_n_chars) == 0 )
+               {
+               if ( number_to_move == YY_MORE_ADJ )
+                       {
+                       ret_val = EOB_ACT_END_OF_FILE;
+                       zconfrestart(zconfin  );
+                       }
+
+               else
+                       {
+                       ret_val = EOB_ACT_LAST_MATCH;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+                               YY_BUFFER_EOF_PENDING;
+                       }
+               }
+
+       else
+               ret_val = EOB_ACT_CONTINUE_SCAN;
+
+       (yy_n_chars) += number_to_move;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+       return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+    static yy_state_type yy_get_previous_state (void)
+{
+       register yy_state_type yy_current_state;
+       register char *yy_cp;
+    
+       yy_current_state = (yy_start);
+
+       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+               {
+               yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)];
+               }
+
+       return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *     next_state = yy_try_NUL_trans( current_state );
+ */
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+{
+       register int yy_is_jam;
+    
+       yy_current_state = yy_nxt[yy_current_state][1];
+       yy_is_jam = (yy_current_state <= 0);
+
+       return yy_is_jam ? 0 : yy_current_state;
+}
+
+    static void yyunput (int c, register char * yy_bp )
+{
+       register char *yy_cp;
+    
+    yy_cp = (yy_c_buf_p);
+
+       /* undo effects of setting up zconftext */
+       *yy_cp = (yy_hold_char);
+
+       if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+               { /* need to shift things up to make room */
+               /* +2 for EOB chars. */
+               register int number_to_move = (yy_n_chars) + 2;
+               register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+                                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+               register char *source =
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+               while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+                       *--dest = *--source;
+
+               yy_cp += (int) (dest - source);
+               yy_bp += (int) (dest - source);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+               if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+                       YY_FATAL_ERROR( "flex scanner push-back overflow" );
+               }
+
+       *--yy_cp = (char) c;
+
+       (yytext_ptr) = yy_bp;
+       (yy_hold_char) = *yy_cp;
+       (yy_c_buf_p) = yy_cp;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+    static int yyinput (void)
+#else
+    static int input  (void)
+#endif
+
+{
+       int c;
+    
+       *(yy_c_buf_p) = (yy_hold_char);
+
+       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+               {
+               /* yy_c_buf_p now points to the character we want to return.
+                * If this occurs *before* the EOB characters, then it's a
+                * valid NUL; if not, then we've hit the end of the buffer.
+                */
+               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+                       /* This was really a NUL. */
+                       *(yy_c_buf_p) = '\0';
+
+               else
+                       { /* need more input */
+                       int offset = (yy_c_buf_p) - (yytext_ptr);
+                       ++(yy_c_buf_p);
+
+                       switch ( yy_get_next_buffer(  ) )
+                               {
+                               case EOB_ACT_LAST_MATCH:
+                                       /* This happens because yy_g_n_b()
+                                        * sees that we've accumulated a
+                                        * token and flags that we need to
+                                        * try matching the token before
+                                        * proceeding.  But for input(),
+                                        * there's no matching to consider.
+                                        * So convert the EOB_ACT_LAST_MATCH
+                                        * to EOB_ACT_END_OF_FILE.
+                                        */
+
+                                       /* Reset buffer status. */
+                                       zconfrestart(zconfin );
+
+                                       /*FALLTHROUGH*/
+
+                               case EOB_ACT_END_OF_FILE:
+                                       {
+                                       if ( zconfwrap( ) )
+                                               return EOF;
+
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
+                                               YY_NEW_FILE;
+#ifdef __cplusplus
+                                       return yyinput();
+#else
+                                       return input();
+#endif
+                                       }
+
+                               case EOB_ACT_CONTINUE_SCAN:
+                                       (yy_c_buf_p) = (yytext_ptr) + offset;
+                                       break;
+                               }
+                       }
+               }
+
+       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
+       *(yy_c_buf_p) = '\0';   /* preserve zconftext */
+       (yy_hold_char) = *++(yy_c_buf_p);
+
+       return c;
+}
+#endif /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * 
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void zconfrestart  (FILE * input_file )
+{
+    
+       if ( ! YY_CURRENT_BUFFER ){
+        zconfensure_buffer_stack ();
+               YY_CURRENT_BUFFER_LVALUE =
+            zconf_create_buffer(zconfin,YY_BUF_SIZE );
+       }
+
+       zconf_init_buffer(YY_CURRENT_BUFFER,input_file );
+       zconf_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * 
+ */
+    void zconf_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+{
+    
+       /* TODO. We should be able to replace this entire function body
+        * with
+        *              zconfpop_buffer_state();
+        *              zconfpush_buffer_state(new_buffer);
+     */
+       zconfensure_buffer_stack ();
+       if ( YY_CURRENT_BUFFER == new_buffer )
+               return;
+
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+       zconf_load_buffer_state( );
+
+       /* We don't actually know whether we did this switch during
+        * EOF (zconfwrap()) processing, but the only time this flag
+        * is looked at is after zconfwrap() is called, so it's safe
+        * to go ahead and always set it.
+        */
+       (yy_did_buffer_switch_on_eof) = 1;
+}
+
+static void zconf_load_buffer_state  (void)
+{
+       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+       zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+       (yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * 
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE zconf_create_buffer  (FILE * file, int  size )
+{
+       YY_BUFFER_STATE b;
+    
+       b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
+       if ( ! b )
+               YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
+
+       b->yy_buf_size = size;
+
+       /* yy_ch_buf has to be 2 characters longer than the size given because
+        * we need to put in 2 end-of-buffer characters.
+        */
+       b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2  );
+       if ( ! b->yy_ch_buf )
+               YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
+
+       b->yy_is_our_buffer = 1;
+
+       zconf_init_buffer(b,file );
+
+       return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with zconf_create_buffer()
+ * 
+ */
+    void zconf_delete_buffer (YY_BUFFER_STATE  b )
+{
+    
+       if ( ! b )
+               return;
+
+       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+       if ( b->yy_is_our_buffer )
+               zconffree((void *) b->yy_ch_buf  );
+
+       zconffree((void *) b  );
+}
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a zconfrestart() or at EOF.
+ */
+    static void zconf_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
+
+{
+       int oerrno = errno;
+    
+       zconf_flush_buffer(b );
+
+       b->yy_input_file = file;
+       b->yy_fill_buffer = 1;
+
+    /* If b is the current buffer, then zconf_init_buffer was _probably_
+     * called from zconfrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
+    }
+
+        b->yy_is_interactive = 0;
+    
+       errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * 
+ */
+    void zconf_flush_buffer (YY_BUFFER_STATE  b )
+{
+       if ( ! b )
+               return;
+
+       b->yy_n_chars = 0;
+
+       /* We always need two end-of-buffer characters.  The first causes
+        * a transition to the end-of-buffer state.  The second causes
+        * a jam in that state.
+        */
+       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+       b->yy_buf_pos = &b->yy_ch_buf[0];
+
+       b->yy_at_bol = 1;
+       b->yy_buffer_status = YY_BUFFER_NEW;
+
+       if ( b == YY_CURRENT_BUFFER )
+               zconf_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  
+ */
+void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+       if (new_buffer == NULL)
+               return;
+
+       zconfensure_buffer_stack();
+
+       /* This block is copied from zconf_switch_to_buffer. */
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       /* Only push if top exists. Otherwise, replace top. */
+       if (YY_CURRENT_BUFFER)
+               (yy_buffer_stack_top)++;
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+       /* copied from zconf_switch_to_buffer. */
+       zconf_load_buffer_state( );
+       (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  
+ */
+void zconfpop_buffer_state (void)
+{
+       if (!YY_CURRENT_BUFFER)
+               return;
+
+       zconf_delete_buffer(YY_CURRENT_BUFFER );
+       YY_CURRENT_BUFFER_LVALUE = NULL;
+       if ((yy_buffer_stack_top) > 0)
+               --(yy_buffer_stack_top);
+
+       if (YY_CURRENT_BUFFER) {
+               zconf_load_buffer_state( );
+               (yy_did_buffer_switch_on_eof) = 1;
+       }
+}
+
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void zconfensure_buffer_stack (void)
+{
+       int num_to_alloc;
+    
+       if (!(yy_buffer_stack)) {
+
+               /* First allocation is just for 2 elements, since we don't know if this
+                * scanner will even need a stack. We use 2 instead of 1 to avoid an
+                * immediate realloc on the next call.
+         */
+               num_to_alloc = 1;
+               (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
+                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               
+               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+                               
+               (yy_buffer_stack_max) = num_to_alloc;
+               (yy_buffer_stack_top) = 0;
+               return;
+       }
+
+       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+               /* Increase the buffer to prepare for a possible push. */
+               int grow_size = 8 /* arbitrary grow size */;
+
+               num_to_alloc = (yy_buffer_stack_max) + grow_size;
+               (yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc
+                                                               ((yy_buffer_stack),
+                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+
+               /* zero only the new slots.*/
+               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+               (yy_buffer_stack_max) = num_to_alloc;
+       }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * 
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE zconf_scan_buffer  (char * base, yy_size_t  size )
+{
+       YY_BUFFER_STATE b;
+    
+       if ( size < 2 ||
+            base[size-2] != YY_END_OF_BUFFER_CHAR ||
+            base[size-1] != YY_END_OF_BUFFER_CHAR )
+               /* They forgot to leave room for the EOB's. */
+               return 0;
+
+       b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
+       if ( ! b )
+               YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" );
+
+       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
+       b->yy_buf_pos = b->yy_ch_buf = base;
+       b->yy_is_our_buffer = 0;
+       b->yy_input_file = 0;
+       b->yy_n_chars = b->yy_buf_size;
+       b->yy_is_interactive = 0;
+       b->yy_at_bol = 1;
+       b->yy_fill_buffer = 0;
+       b->yy_buffer_status = YY_BUFFER_NEW;
+
+       zconf_switch_to_buffer(b  );
+
+       return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to zconflex() will
+ * scan from a @e copy of @a str.
+ * @param str a NUL-terminated string to scan
+ * 
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       zconf_scan_bytes() instead.
+ */
+YY_BUFFER_STATE zconf_scan_string (yyconst char * str )
+{
+    
+       return zconf_scan_bytes(str,strlen(str) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * 
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE zconf_scan_bytes  (yyconst char * bytes, int  len )
+{
+       YY_BUFFER_STATE b;
+       char *buf;
+       yy_size_t n;
+       int i;
+    
+       /* Get memory for full buffer, including space for trailing EOB's. */
+       n = len + 2;
+       buf = (char *) zconfalloc(n  );
+       if ( ! buf )
+               YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" );
+
+       for ( i = 0; i < len; ++i )
+               buf[i] = bytes[i];
+
+       buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+       b = zconf_scan_buffer(buf,n );
+       if ( ! b )
+               YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" );
+
+       /* It's okay to grow etc. this buffer, and we should throw it
+        * away when we're done.
+        */
+       b->yy_is_our_buffer = 1;
+
+       return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg )
+{
+       (void) fprintf( stderr, "%s\n", msg );
+       exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up zconftext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               zconftext[zconfleng] = (yy_hold_char); \
+               (yy_c_buf_p) = zconftext + yyless_macro_arg; \
+               (yy_hold_char) = *(yy_c_buf_p); \
+               *(yy_c_buf_p) = '\0'; \
+               zconfleng = yyless_macro_arg; \
+               } \
+       while ( 0 )
+
+/* Accessor  methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ * 
+ */
+int zconfget_lineno  (void)
+{
+        
+    return zconflineno;
+}
+
+/** Get the input stream.
+ * 
+ */
+FILE *zconfget_in  (void)
+{
+        return zconfin;
+}
+
+/** Get the output stream.
+ * 
+ */
+FILE *zconfget_out  (void)
+{
+        return zconfout;
+}
+
+/** Get the length of the current token.
+ * 
+ */
+int zconfget_leng  (void)
+{
+        return zconfleng;
+}
+
+/** Get the current token.
+ * 
+ */
+
+char *zconfget_text  (void)
+{
+        return zconftext;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * 
+ */
+void zconfset_lineno (int  line_number )
+{
+    
+    zconflineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * 
+ * @see zconf_switch_to_buffer
+ */
+void zconfset_in (FILE *  in_str )
+{
+        zconfin = in_str ;
+}
+
+void zconfset_out (FILE *  out_str )
+{
+        zconfout = out_str ;
+}
+
+int zconfget_debug  (void)
+{
+        return zconf_flex_debug;
+}
+
+void zconfset_debug (int  bdebug )
+{
+        zconf_flex_debug = bdebug ;
+}
+
+/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
+int zconflex_destroy  (void)
+{
+    
+    /* Pop the buffer stack, destroying each element. */
+       while(YY_CURRENT_BUFFER){
+               zconf_delete_buffer(YY_CURRENT_BUFFER  );
+               YY_CURRENT_BUFFER_LVALUE = NULL;
+               zconfpop_buffer_state();
+       }
+
+       /* Destroy the stack itself. */
+       zconffree((yy_buffer_stack) );
+       (yy_buffer_stack) = NULL;
+
+    return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
+       register int i;
+       for ( i = 0; i < n; ++i )
+               s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s )
+{
+       register int n;
+       for ( n = 0; s[n]; ++n )
+               ;
+
+       return n;
+}
+#endif
+
+void *zconfalloc (yy_size_t  size )
+{
+       return (void *) malloc( size );
+}
+
+void *zconfrealloc  (void * ptr, yy_size_t  size )
+{
+       /* The cast to (char *) in the following accommodates both
+        * implementations that use char* generic pointers, and those
+        * that use void* generic pointers.  It works with the latter
+        * because both ANSI C and C++ allow castless assignment from
+        * any pointer type to void*, and deal with argument conversions
+        * as though doing an assignment.
+        */
+       return (void *) realloc( (char *) ptr, size );
+}
+
+void zconffree (void * ptr )
+{
+       free( (char *) ptr );   /* see zconfrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#undef YY_NEW_FILE
+#undef YY_FLUSH_BUFFER
+#undef yy_set_bol
+#undef yy_new_buffer
+#undef yy_set_interactive
+#undef yytext_ptr
+#undef YY_DO_BEFORE_ACTION
+
+#ifdef YY_DECL_IS_OURS
+#undef YY_DECL_IS_OURS
+#undef YY_DECL
+#endif
+
+void zconf_starthelp(void)
+{
+       new_string();
+       last_ts = first_ts = 0;
+       BEGIN(HELP);
+}
+
+static void zconf_endhelp(void)
+{
+       zconflval.string = text;
+       BEGIN(INITIAL);
+}
+
+/*
+ * Try to open specified file with following names:
+ * ./name
+ * $(srctree)/name
+ * The latter is used when srctree is separate from objtree
+ * when compiling the kernel.
+ * Return NULL if file is not found.
+ */
+FILE *zconf_fopen(const char *name)
+{
+       char *env, fullname[PATH_MAX+1];
+       FILE *f;
+
+       f = fopen(name, "r");
+       if (!f && name[0] != '/') {
+               env = getenv(SRCTREE);
+               if (env) {
+                       sprintf(fullname, "%s/%s", env, name);
+                       f = fopen(fullname, "r");
+               }
+       }
+       return f;
+}
+
+void zconf_initscan(const char *name)
+{
+       zconfin = zconf_fopen(name);
+       if (!zconfin) {
+               printf("can't find file %s\n", name);
+               exit(1);
+       }
+
+       current_buf = malloc(sizeof(*current_buf));
+       memset(current_buf, 0, sizeof(*current_buf));
+
+       current_file = file_lookup(name);
+       current_file->lineno = 1;
+       current_file->flags = FILE_BUSY;
+}
+
+void zconf_nextfile(const char *name)
+{
+       struct file *file = file_lookup(name);
+       struct buffer *buf = malloc(sizeof(*buf));
+       memset(buf, 0, sizeof(*buf));
+
+       current_buf->state = YY_CURRENT_BUFFER;
+       zconfin = zconf_fopen(name);
+       if (!zconfin) {
+               printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name);
+               exit(1);
+       }
+       zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
+       buf->parent = current_buf;
+       current_buf = buf;
+
+       if (file->flags & FILE_BUSY) {
+               printf("recursive scan (%s)?\n", name);
+               exit(1);
+       }
+       if (file->flags & FILE_SCANNED) {
+               printf("file %s already scanned?\n", name);
+               exit(1);
+       }
+       file->flags |= FILE_BUSY;
+       file->lineno = 1;
+       file->parent = current_file;
+       current_file = file;
+}
+
+static struct buffer *zconf_endfile(void)
+{
+       struct buffer *parent;
+
+       current_file->flags |= FILE_SCANNED;
+       current_file->flags &= ~FILE_BUSY;
+       current_file = current_file->parent;
+
+       parent = current_buf->parent;
+       if (parent) {
+               fclose(zconfin);
+               zconf_delete_buffer(YY_CURRENT_BUFFER);
+               zconf_switch_to_buffer(parent->state);
+       }
+       free(current_buf);
+       current_buf = parent;
+
+       return parent;
+}
+
+int zconf_lineno(void)
+{
+       if (current_buf)
+               return current_file->lineno - 1;
+       else
+               return 0;
+}
+
+char *zconf_curname(void)
+{
+       if (current_buf)
+               return current_file->name;
+       else
+               return "<none>";
+}
+
diff --git a/scripts/kconfig/libkconfig.so b/scripts/kconfig/libkconfig.so
new file mode 100755 (executable)
index 0000000..0916d8a
Binary files /dev/null and b/scripts/kconfig/libkconfig.so differ
diff --git a/scripts/kconfig/mconf.o b/scripts/kconfig/mconf.o
new file mode 100644 (file)
index 0000000..61fe000
Binary files /dev/null and b/scripts/kconfig/mconf.o differ
diff --git a/scripts/kconfig/zconf.tab.c b/scripts/kconfig/zconf.tab.c
new file mode 100644 (file)
index 0000000..c9bfdb4
--- /dev/null
@@ -0,0 +1,2127 @@
+/* A Bison parser, made by GNU Bison 1.875a.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+   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, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Written by Richard Stallman by simplifying the original so called
+   ``semantic'' parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+/* If NAME_PREFIX is specified substitute the variables and functions
+   names.  */
+#define yyparse zconfparse
+#define yylex   zconflex
+#define yyerror zconferror
+#define yylval  zconflval
+#define yychar  zconfchar
+#define yydebug zconfdebug
+#define yynerrs zconfnerrs
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     T_MAINMENU = 258,
+     T_MENU = 259,
+     T_ENDMENU = 260,
+     T_SOURCE = 261,
+     T_CHOICE = 262,
+     T_ENDCHOICE = 263,
+     T_COMMENT = 264,
+     T_CONFIG = 265,
+     T_MENUCONFIG = 266,
+     T_HELP = 267,
+     T_HELPTEXT = 268,
+     T_IF = 269,
+     T_ENDIF = 270,
+     T_DEPENDS = 271,
+     T_REQUIRES = 272,
+     T_OPTIONAL = 273,
+     T_PROMPT = 274,
+     T_DEFAULT = 275,
+     T_TRISTATE = 276,
+     T_DEF_TRISTATE = 277,
+     T_BOOLEAN = 278,
+     T_DEF_BOOLEAN = 279,
+     T_STRING = 280,
+     T_INT = 281,
+     T_HEX = 282,
+     T_WORD = 283,
+     T_WORD_QUOTE = 284,
+     T_UNEQUAL = 285,
+     T_EOF = 286,
+     T_EOL = 287,
+     T_CLOSE_PAREN = 288,
+     T_OPEN_PAREN = 289,
+     T_ON = 290,
+     T_SELECT = 291,
+     T_RANGE = 292,
+     T_OR = 293,
+     T_AND = 294,
+     T_EQUAL = 295,
+     T_NOT = 296
+   };
+#endif
+#define T_MAINMENU 258
+#define T_MENU 259
+#define T_ENDMENU 260
+#define T_SOURCE 261
+#define T_CHOICE 262
+#define T_ENDCHOICE 263
+#define T_COMMENT 264
+#define T_CONFIG 265
+#define T_MENUCONFIG 266
+#define T_HELP 267
+#define T_HELPTEXT 268
+#define T_IF 269
+#define T_ENDIF 270
+#define T_DEPENDS 271
+#define T_REQUIRES 272
+#define T_OPTIONAL 273
+#define T_PROMPT 274
+#define T_DEFAULT 275
+#define T_TRISTATE 276
+#define T_DEF_TRISTATE 277
+#define T_BOOLEAN 278
+#define T_DEF_BOOLEAN 279
+#define T_STRING 280
+#define T_INT 281
+#define T_HEX 282
+#define T_WORD 283
+#define T_WORD_QUOTE 284
+#define T_UNEQUAL 285
+#define T_EOF 286
+#define T_EOL 287
+#define T_CLOSE_PAREN 288
+#define T_OPEN_PAREN 289
+#define T_ON 290
+#define T_SELECT 291
+#define T_RANGE 292
+#define T_OR 293
+#define T_AND 294
+#define T_EQUAL 295
+#define T_NOT 296
+
+
+
+
+/* Copy the first part of user declarations.  */
+
+
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+
+#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
+
+#define PRINTD         0x0001
+#define DEBUG_PARSE    0x0002
+
+int cdebug = PRINTD;
+
+extern int zconflex(void);
+static void zconfprint(const char *err, ...);
+static void zconferror(const char *err);
+static bool zconf_endtoken(int token, int starttoken, int endtoken);
+
+struct symbol *symbol_hash[257];
+
+#define YYERROR_VERBOSE
+
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+
+typedef union YYSTYPE {
+       int token;
+       char *string;
+       struct symbol *symbol;
+       struct expr *expr;
+       struct menu *menu;
+} YYSTYPE;
+/* Line 191 of yacc.c.  */
+
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+
+/* Line 214 of yacc.c.  */
+
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# if YYSTACK_USE_ALLOCA
+#  define YYSTACK_ALLOC alloca
+# else
+#  ifndef YYSTACK_USE_ALLOCA
+#   if defined (alloca) || defined (_ALLOCA_H)
+#    define YYSTACK_ALLOC alloca
+#   else
+#    ifdef __GNUC__
+#     define YYSTACK_ALLOC __builtin_alloca
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning. */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+#  if defined (__STDC__) || defined (__cplusplus)
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   define YYSIZE_T size_t
+#  endif
+#  define YYSTACK_ALLOC malloc
+#  define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+     && (! defined (__cplusplus) \
+        || (YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  short yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (short) + sizeof (YYSTYPE))                                \
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)             \
+      do                                       \
+       {                                       \
+         register YYSIZE_T yyi;                \
+         for (yyi = 0; yyi < (Count); yyi++)   \
+           (To)[yyi] = (From)[yyi];            \
+       }                                       \
+      while (0)
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)                                       \
+    do                                                                 \
+      {                                                                        \
+       YYSIZE_T yynewbytes;                                            \
+       YYCOPY (&yyptr->Stack, Stack, yysize);                          \
+       Stack = &yyptr->Stack;                                          \
+       yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+       yyptr += yynewbytes / sizeof (*yyptr);                          \
+      }                                                                        \
+    while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+   typedef signed char yysigned_char;
+#else
+   typedef short yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL  2
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   201
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS  42
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS  41
+/* YYNRULES -- Number of rules. */
+#define YYNRULES  104
+/* YYNRULES -- Number of states. */
+#define YYNSTATES  182
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   296
+
+#define YYTRANSLATE(YYX)                                               \
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const unsigned char yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
+      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
+      35,    36,    37,    38,    39,    40,    41
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const unsigned short yyprhs[] =
+{
+       0,     0,     3,     4,     7,     9,    11,    13,    17,    19,
+      21,    23,    26,    28,    30,    32,    34,    36,    38,    42,
+      45,    49,    52,    53,    56,    59,    62,    65,    69,    74,
+      78,    83,    87,    91,    95,   100,   105,   110,   116,   119,
+     122,   124,   128,   131,   132,   135,   138,   141,   144,   149,
+     153,   157,   160,   165,   166,   169,   173,   175,   179,   182,
+     183,   186,   189,   192,   196,   199,   201,   205,   208,   209,
+     212,   215,   218,   222,   226,   228,   232,   235,   238,   241,
+     242,   245,   248,   253,   257,   261,   262,   265,   267,   269,
+     272,   275,   278,   280,   282,   283,   286,   288,   292,   296,
+     300,   303,   307,   311,   313
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+      43,     0,    -1,    -1,    43,    44,    -1,    45,    -1,    55,
+      -1,    66,    -1,     3,    77,    79,    -1,     5,    -1,    15,
+      -1,     8,    -1,     1,    79,    -1,    61,    -1,    71,    -1,
+      47,    -1,    49,    -1,    69,    -1,    79,    -1,    10,    28,
+      32,    -1,    46,    50,    -1,    11,    28,    32,    -1,    48,
+      50,    -1,    -1,    50,    51,    -1,    50,    75,    -1,    50,
+      73,    -1,    50,    32,    -1,    21,    76,    32,    -1,    22,
+      81,    80,    32,    -1,    23,    76,    32,    -1,    24,    81,
+      80,    32,    -1,    26,    76,    32,    -1,    27,    76,    32,
+      -1,    25,    76,    32,    -1,    19,    77,    80,    32,    -1,
+      20,    81,    80,    32,    -1,    36,    28,    80,    32,    -1,
+      37,    82,    82,    80,    32,    -1,     7,    32,    -1,    52,
+      56,    -1,    78,    -1,    53,    58,    54,    -1,    53,    58,
+      -1,    -1,    56,    57,    -1,    56,    75,    -1,    56,    73,
+      -1,    56,    32,    -1,    19,    77,    80,    32,    -1,    21,
+      76,    32,    -1,    23,    76,    32,    -1,    18,    32,    -1,
+      20,    28,    80,    32,    -1,    -1,    58,    45,    -1,    14,
+      81,    32,    -1,    78,    -1,    59,    62,    60,    -1,    59,
+      62,    -1,    -1,    62,    45,    -1,    62,    66,    -1,    62,
+      55,    -1,     4,    77,    32,    -1,    63,    74,    -1,    78,
+      -1,    64,    67,    65,    -1,    64,    67,    -1,    -1,    67,
+      45,    -1,    67,    66,    -1,    67,    55,    -1,    67,     1,
+      32,    -1,     6,    77,    32,    -1,    68,    -1,     9,    77,
+      32,    -1,    70,    74,    -1,    12,    32,    -1,    72,    13,
+      -1,    -1,    74,    75,    -1,    74,    32,    -1,    16,    35,
+      81,    32,    -1,    16,    81,    32,    -1,    17,    81,    32,
+      -1,    -1,    77,    80,    -1,    28,    -1,    29,    -1,     5,
+      79,    -1,     8,    79,    -1,    15,    79,    -1,    32,    -1,
+      31,    -1,    -1,    14,    81,    -1,    82,    -1,    82,    40,
+      82,    -1,    82,    30,    82,    -1,    34,    81,    33,    -1,
+      41,    81,    -1,    81,    38,    81,    -1,    81,    39,    81,
+      -1,    28,    -1,    29,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const unsigned short yyrline[] =
+{
+       0,    94,    94,    95,    98,    99,   100,   101,   102,   103,
+     104,   105,   109,   110,   111,   112,   113,   114,   120,   128,
+     134,   142,   152,   154,   155,   156,   157,   160,   166,   173,
+     179,   186,   192,   198,   204,   210,   216,   222,   230,   239,
+     245,   254,   255,   261,   263,   264,   265,   266,   269,   275,
+     281,   287,   293,   299,   301,   306,   315,   324,   325,   331,
+     333,   334,   335,   340,   347,   353,   362,   363,   369,   371,
+     372,   373,   374,   377,   383,   390,   397,   404,   410,   417,
+     418,   419,   422,   427,   432,   440,   442,   447,   448,   451,
+     452,   453,   457,   457,   459,   460,   463,   464,   465,   466,
+     467,   468,   469,   472,   473
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", 
+  "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", 
+  "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", 
+  "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", 
+  "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT", 
+  "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL", 
+  "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR", 
+  "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", 
+  "common_block", "config_entry_start", "config_stmt", 
+  "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", 
+  "config_option", "choice", "choice_entry", "choice_end", "choice_stmt", 
+  "choice_option_list", "choice_option", "choice_block", "if", "if_end", 
+  "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt", 
+  "menu_block", "source", "source_stmt", "comment", "comment_stmt", 
+  "help_start", "help", "depends_list", "depends", "prompt_stmt_opt", 
+  "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const unsigned short yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
+     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
+     295,   296
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const unsigned char yyr1[] =
+{
+       0,    42,    43,    43,    44,    44,    44,    44,    44,    44,
+      44,    44,    45,    45,    45,    45,    45,    45,    46,    47,
+      48,    49,    50,    50,    50,    50,    50,    51,    51,    51,
+      51,    51,    51,    51,    51,    51,    51,    51,    52,    53,
+      54,    55,    55,    56,    56,    56,    56,    56,    57,    57,
+      57,    57,    57,    58,    58,    59,    60,    61,    61,    62,
+      62,    62,    62,    63,    64,    65,    66,    66,    67,    67,
+      67,    67,    67,    68,    69,    70,    71,    72,    73,    74,
+      74,    74,    75,    75,    75,    76,    76,    77,    77,    78,
+      78,    78,    79,    79,    80,    80,    81,    81,    81,    81,
+      81,    81,    81,    82,    82
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const unsigned char yyr2[] =
+{
+       0,     2,     0,     2,     1,     1,     1,     3,     1,     1,
+       1,     2,     1,     1,     1,     1,     1,     1,     3,     2,
+       3,     2,     0,     2,     2,     2,     2,     3,     4,     3,
+       4,     3,     3,     3,     4,     4,     4,     5,     2,     2,
+       1,     3,     2,     0,     2,     2,     2,     2,     4,     3,
+       3,     2,     4,     0,     2,     3,     1,     3,     2,     0,
+       2,     2,     2,     3,     2,     1,     3,     2,     0,     2,
+       2,     2,     3,     3,     1,     3,     2,     2,     2,     0,
+       2,     2,     4,     3,     3,     0,     2,     1,     1,     2,
+       2,     2,     1,     1,     0,     2,     1,     3,     3,     3,
+       2,     3,     3,     1,     1
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const unsigned char yydefact[] =
+{
+       2,     0,     1,     0,     0,     0,     8,     0,     0,    10,
+       0,     0,     0,     0,     9,    93,    92,     3,     4,    22,
+      14,    22,    15,    43,    53,     5,    59,    12,    79,    68,
+       6,    74,    16,    79,    13,    17,    11,    87,    88,     0,
+       0,     0,    38,     0,     0,     0,   103,   104,     0,     0,
+       0,    96,    19,    21,    39,    42,    58,    64,     0,    76,
+       7,    63,    73,    75,    18,    20,     0,   100,    55,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,    85,     0,
+      85,     0,    85,    85,    85,    26,     0,     0,    23,     0,
+      25,    24,     0,     0,     0,    85,    85,    47,    44,    46,
+      45,     0,     0,     0,    54,    41,    40,    60,    62,    57,
+      61,    56,    81,    80,     0,    69,    71,    66,    70,    65,
+      99,   101,   102,    98,    97,    77,     0,     0,     0,    94,
+      94,     0,    94,    94,     0,    94,     0,     0,     0,    94,
+       0,    78,    51,    94,    94,     0,     0,    89,    90,    91,
+      72,     0,    83,    84,     0,     0,     0,    27,    86,     0,
+      29,     0,    33,    31,    32,     0,    94,     0,     0,    49,
+      50,    82,    95,    34,    35,    28,    30,    36,     0,    48,
+      52,    37
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const short yydefgoto[] =
+{
+      -1,     1,    17,    18,    19,    20,    21,    22,    52,    88,
+      23,    24,   105,    25,    54,    98,    55,    26,   109,    27,
+      56,    28,    29,   117,    30,    58,    31,    32,    33,    34,
+      89,    90,    57,    91,   131,   132,   106,    35,   155,    50,
+      51
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -99
+static const short yypact[] =
+{
+     -99,    48,   -99,    38,    46,    46,   -99,    46,   -29,   -99,
+      46,   -17,    -3,   -11,   -99,   -99,   -99,   -99,   -99,   -99,
+     -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,
+     -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,    38,
+      12,    15,   -99,    18,    51,    62,   -99,   -99,   -11,   -11,
+       4,   -24,   138,   138,   160,   121,   110,    -4,    81,    -4,
+     -99,   -99,   -99,   -99,   -99,   -99,   -19,   -99,   -99,   -11,
+     -11,    70,    70,    73,    32,   -11,    46,   -11,    46,   -11,
+      46,   -11,    46,    46,    46,   -99,    36,    70,   -99,    95,
+     -99,   -99,    96,    46,   106,    46,    46,   -99,   -99,   -99,
+     -99,    38,    38,    38,   -99,   -99,   -99,   -99,   -99,   -99,
+     -99,   -99,   -99,   -99,   112,   -99,   -99,   -99,   -99,   -99,
+     -99,   117,   -99,   -99,   -99,   -99,   -11,    33,    65,   131,
+       1,   119,   131,     1,   136,     1,   153,   154,   155,   131,
+      70,   -99,   -99,   131,   131,   156,   157,   -99,   -99,   -99,
+     -99,   101,   -99,   -99,   -11,   158,   159,   -99,   -99,   161,
+     -99,   162,   -99,   -99,   -99,   163,   131,   164,   165,   -99,
+     -99,   -99,    99,   -99,   -99,   -99,   -99,   -99,   166,   -99,
+     -99,   -99
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const short yypgoto[] =
+{
+     -99,   -99,   -99,   111,   -99,   -99,   -99,   -99,   178,   -99,
+     -99,   -99,   -99,    91,   -99,   -99,   -99,   -99,   -99,   -99,
+     -99,   -99,   -99,   -99,   115,   -99,   -99,   -99,   -99,   -99,
+     -99,   146,   168,    89,    27,     0,   126,    -1,   -98,   -48,
+     -63
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule which
+   number is the opposite.  If zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -68
+static const short yytable[] =
+{
+      66,    67,    36,    42,    39,    40,    71,    41,   123,   124,
+      43,    44,    74,    75,   120,   154,    72,    46,    47,    69,
+      70,   121,   122,    48,   140,    45,   127,   128,   112,   130,
+      49,   133,   156,   135,   158,   159,    68,   161,    60,    69,
+      70,   165,    69,    70,    61,   167,   168,    62,     2,     3,
+      63,     4,     5,     6,     7,     8,     9,    10,    11,    12,
+      46,    47,    13,    14,   139,   152,    48,   126,   178,    15,
+      16,    69,    70,    49,    37,    38,   129,   166,   151,    15,
+      16,   -67,   114,    64,   -67,     5,   101,     7,     8,   102,
+      10,    11,    12,   143,    65,    13,   103,   153,    46,    47,
+     147,   148,   149,    69,    70,   125,   172,   134,   141,   136,
+     137,   138,    15,    16,     5,   101,     7,     8,   102,    10,
+      11,    12,   145,   146,    13,   103,   101,     7,   142,   102,
+      10,    11,    12,   171,   144,    13,   103,    69,    70,    69,
+      70,    15,    16,   100,   150,   154,   113,   108,   113,   116,
+      73,   157,    15,    16,    74,    75,    70,    76,    77,    78,
+      79,    80,    81,    82,    83,    84,   104,   107,   160,   115,
+      85,   110,    73,   118,    86,    87,    74,    75,    92,    93,
+      94,    95,   111,    96,   119,   162,   163,   164,   169,   170,
+     173,   174,    97,   175,   176,   177,   179,   180,   181,    53,
+      99,    59
+};
+
+static const unsigned char yycheck[] =
+{
+      48,    49,     3,    32,     4,     5,    30,     7,    71,    72,
+      10,    28,    16,    17,    33,    14,    40,    28,    29,    38,
+      39,    69,    70,    34,    87,    28,    74,    75,    32,    77,
+      41,    79,   130,    81,   132,   133,    32,   135,    39,    38,
+      39,   139,    38,    39,    32,   143,   144,    32,     0,     1,
+      32,     3,     4,     5,     6,     7,     8,     9,    10,    11,
+      28,    29,    14,    15,    28,    32,    34,    35,   166,    31,
+      32,    38,    39,    41,    28,    29,    76,   140,   126,    31,
+      32,     0,     1,    32,     3,     4,     5,     6,     7,     8,
+       9,    10,    11,    93,    32,    14,    15,    32,    28,    29,
+     101,   102,   103,    38,    39,    32,   154,    80,    13,    82,
+      83,    84,    31,    32,     4,     5,     6,     7,     8,     9,
+      10,    11,    95,    96,    14,    15,     5,     6,    32,     8,
+       9,    10,    11,    32,    28,    14,    15,    38,    39,    38,
+      39,    31,    32,    54,    32,    14,    57,    56,    59,    58,
+      12,    32,    31,    32,    16,    17,    39,    19,    20,    21,
+      22,    23,    24,    25,    26,    27,    55,    56,    32,    58,
+      32,    56,    12,    58,    36,    37,    16,    17,    18,    19,
+      20,    21,    56,    23,    58,    32,    32,    32,    32,    32,
+      32,    32,    32,    32,    32,    32,    32,    32,    32,    21,
+      54,    33
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const unsigned char yystos[] =
+{
+       0,    43,     0,     1,     3,     4,     5,     6,     7,     8,
+       9,    10,    11,    14,    15,    31,    32,    44,    45,    46,
+      47,    48,    49,    52,    53,    55,    59,    61,    63,    64,
+      66,    68,    69,    70,    71,    79,    79,    28,    29,    77,
+      77,    77,    32,    77,    28,    28,    28,    29,    34,    41,
+      81,    82,    50,    50,    56,    58,    62,    74,    67,    74,
+      79,    32,    32,    32,    32,    32,    81,    81,    32,    38,
+      39,    30,    40,    12,    16,    17,    19,    20,    21,    22,
+      23,    24,    25,    26,    27,    32,    36,    37,    51,    72,
+      73,    75,    18,    19,    20,    21,    23,    32,    57,    73,
+      75,     5,     8,    15,    45,    54,    78,    45,    55,    60,
+      66,    78,    32,    75,     1,    45,    55,    65,    66,    78,
+      33,    81,    81,    82,    82,    32,    35,    81,    81,    77,
+      81,    76,    77,    81,    76,    81,    76,    76,    76,    28,
+      82,    13,    32,    77,    28,    76,    76,    79,    79,    79,
+      32,    81,    32,    32,    14,    80,    80,    32,    80,    80,
+      32,    80,    32,    32,    32,    80,    82,    80,    80,    32,
+      32,    32,    81,    32,    32,    32,    32,    32,    80,    32,
+      32,    32
+};
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok                (yyerrstatus = 0)
+#define yyclearin      (yychar = YYEMPTY)
+#define YYEMPTY                (-2)
+#define YYEOF          0
+
+#define YYACCEPT       goto yyacceptlab
+#define YYABORT                goto yyabortlab
+#define YYERROR                goto yyerrlab1
+
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL         goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)                                 \
+do                                                             \
+  if (yychar == YYEMPTY && yylen == 1)                         \
+    {                                                          \
+      yychar = (Token);                                                \
+      yylval = (Value);                                                \
+      yytoken = YYTRANSLATE (yychar);                          \
+      YYPOPSTACK;                                              \
+      goto yybackup;                                           \
+    }                                                          \
+  else                                                         \
+    {                                                          \
+      yyerror ("syntax error: cannot back up");\
+      YYERROR;                                                 \
+    }                                                          \
+while (0)
+
+#define YYTERROR       1
+#define YYERRCODE      256
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+   are run).  */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)         \
+  Current.first_line   = Rhs[1].first_line;      \
+  Current.first_column = Rhs[1].first_column;    \
+  Current.last_line    = Rhs[N].last_line;       \
+  Current.last_column  = Rhs[N].last_column;
+#endif
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)                       \
+do {                                           \
+  if (yydebug)                                 \
+    YYFPRINTF Args;                            \
+} while (0)
+
+# define YYDSYMPRINT(Args)                     \
+do {                                           \
+  if (yydebug)                                 \
+    yysymprint Args;                           \
+} while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location)           \
+do {                                                           \
+  if (yydebug)                                                 \
+    {                                                          \
+      YYFPRINTF (stderr, "%s ", Title);                                \
+      yysymprint (stderr,                                      \
+                  Token, Value);       \
+      YYFPRINTF (stderr, "\n");                                        \
+    }                                                          \
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (cinluded).                                                   |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short *bottom, short *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    short *bottom;
+    short *top;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (/* Nothing. */; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)                           \
+do {                                                           \
+  if (yydebug)                                                 \
+    yy_stack_print ((Bottom), (Top));                          \
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_reduce_print (int yyrule)
+#else
+static void
+yy_reduce_print (yyrule)
+    int yyrule;
+#endif
+{
+  int yyi;
+  unsigned int yylineno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+             yyrule - 1, yylineno);
+  /* Print the symbols being reduced, and their result.  */
+  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+}
+
+# define YY_REDUCE_PRINT(Rule)         \
+do {                                   \
+  if (yydebug)                         \
+    yy_reduce_print (Rule);            \
+} while (0)
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef        YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#if YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+\f
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined (__GLIBC__) && defined (_STRING_H)
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+static YYSIZE_T
+#   if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+#   else
+yystrlen (yystr)
+     const char *yystr;
+#   endif
+{
+  register const char *yys = yystr;
+
+  while (*yys++ != '\0')
+    continue;
+
+  return yys - yystr - 1;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+static char *
+#   if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+#   else
+yystpcpy (yydest, yysrc)
+     char *yydest;
+     const char *yysrc;
+#   endif
+{
+  register char *yyd = yydest;
+  register const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+\f
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  if (yytype < YYNTOKENS)
+    {
+      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+    }
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  switch (yytype)
+    {
+      default:
+        break;
+    }
+  YYFPRINTF (yyoutput, ")");
+}
+
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yytype, yyvaluep)
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  switch (yytype)
+    {
+
+      default:
+        break;
+    }
+}
+\f
+
+/* Prevent warnings from -Wmissing-prototypes.  */
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM);
+# else
+int yyparse ();
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM)
+# else
+int yyparse (YYPARSE_PARAM)
+  void *YYPARSE_PARAM;
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+  
+  register int yystate;
+  register int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  short        yyssa[YYINITDEPTH];
+  short *yyss = yyssa;
+  register short *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK   (yyvsp--, yyssp--)
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* When reducing, the number of symbols on the RHS of the reduced
+     rule.  */
+  int yylen;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY;            /* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
+
+  yyssp = yyss;
+  yyvsp = yyvs;
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed. so pushing a state here evens the stacks.
+     */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+      {
+       /* Give user a chance to reallocate the stack. Use copies of
+          these so that the &'s don't force the real ones into
+          memory.  */
+       YYSTYPE *yyvs1 = yyvs;
+       short *yyss1 = yyss;
+
+
+       /* Each stack pointer address is followed by the size of the
+          data in use in that stack, in bytes.  This used to be a
+          conditional around just the two extra args, but that might
+          be undefined if yyoverflow is a macro.  */
+       yyoverflow ("parser stack overflow",
+                   &yyss1, yysize * sizeof (*yyssp),
+                   &yyvs1, yysize * sizeof (*yyvsp),
+
+                   &yystacksize);
+
+       yyss = yyss1;
+       yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyoverflowlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+       goto yyoverflowlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+       yystacksize = YYMAXDEPTH;
+
+      {
+       short *yyss1 = yyss;
+       union yyalloc *yyptr =
+         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+       if (! yyptr)
+         goto yyoverflowlab;
+       YYSTACK_RELOCATE (yyss);
+       YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+       if (yyss1 != yyssa)
+         YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+                 (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+       YYABORT;
+    }
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state.  */
+/* Read a lookahead token if we need one and don't already have one.  */
+/* yyresume: */
+
+  /* First try to decide what to do without reference to lookahead token.  */
+
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a lookahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = YYLEX;
+    }
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
+    }
+  else
+    {
+      yytoken = YYTRANSLATE (yychar);
+      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+    }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yyn == 0 || yyn == YYTABLE_NINF)
+       goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Shift the lookahead token.  */
+  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+  /* Discard the token being shifted unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  *++yyvsp = yylval;
+
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 8:
+
+    { zconfprint("unexpected 'endmenu' statement"); ;}
+    break;
+
+  case 9:
+
+    { zconfprint("unexpected 'endif' statement"); ;}
+    break;
+
+  case 10:
+
+    { zconfprint("unexpected 'endchoice' statement"); ;}
+    break;
+
+  case 11:
+
+    { zconfprint("syntax error"); yyerrok; ;}
+    break;
+
+  case 18:
+
+    {
+       struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
+       sym->flags |= SYMBOL_OPTIONAL;
+       menu_add_entry(sym);
+       printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
+;}
+    break;
+
+  case 19:
+
+    {
+       menu_end_entry();
+       printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 20:
+
+    {
+       struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
+       sym->flags |= SYMBOL_OPTIONAL;
+       menu_add_entry(sym);
+       printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
+;}
+    break;
+
+  case 21:
+
+    {
+       if (current_entry->prompt)
+               current_entry->prompt->type = P_MENU;
+       else
+               zconfprint("warning: menuconfig statement without prompt");
+       menu_end_entry();
+       printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 27:
+
+    {
+       menu_set_type(S_TRISTATE);
+       printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 28:
+
+    {
+       menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
+       menu_set_type(S_TRISTATE);
+       printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 29:
+
+    {
+       menu_set_type(S_BOOLEAN);
+       printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 30:
+
+    {
+       menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
+       menu_set_type(S_BOOLEAN);
+       printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 31:
+
+    {
+       menu_set_type(S_INT);
+       printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 32:
+
+    {
+       menu_set_type(S_HEX);
+       printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 33:
+
+    {
+       menu_set_type(S_STRING);
+       printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 34:
+
+    {
+       menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
+       printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 35:
+
+    {
+       menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
+       printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 36:
+
+    {
+       menu_add_symbol(P_SELECT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
+       printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 37:
+
+    {
+       menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,yyvsp[-3].symbol, yyvsp[-2].symbol), yyvsp[-1].expr);
+       printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 38:
+
+    {
+       struct symbol *sym = sym_lookup(NULL, 0);
+       sym->flags |= SYMBOL_CHOICE;
+       menu_add_entry(sym);
+       menu_add_expr(P_CHOICE, NULL, NULL);
+       printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 39:
+
+    {
+       menu_end_entry();
+       menu_add_menu();
+;}
+    break;
+
+  case 40:
+
+    {
+       if (zconf_endtoken(yyvsp[0].token, T_CHOICE, T_ENDCHOICE)) {
+               menu_end_menu();
+               printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
+       }
+;}
+    break;
+
+  case 42:
+
+    {
+       printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno);
+       zconfnerrs++;
+;}
+    break;
+
+  case 48:
+
+    {
+       menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
+       printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 49:
+
+    {
+       menu_set_type(S_TRISTATE);
+       printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 50:
+
+    {
+       menu_set_type(S_BOOLEAN);
+       printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 51:
+
+    {
+       current_entry->sym->flags |= SYMBOL_OPTIONAL;
+       printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 52:
+
+    {
+       menu_add_symbol(P_DEFAULT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
+       printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 55:
+
+    {
+       printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
+       menu_add_entry(NULL);
+       menu_add_dep(yyvsp[-1].expr);
+       menu_end_entry();
+       menu_add_menu();
+;}
+    break;
+
+  case 56:
+
+    {
+       if (zconf_endtoken(yyvsp[0].token, T_IF, T_ENDIF)) {
+               menu_end_menu();
+               printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
+       }
+;}
+    break;
+
+  case 58:
+
+    {
+       printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno);
+       zconfnerrs++;
+;}
+    break;
+
+  case 63:
+
+    {
+       menu_add_entry(NULL);
+       menu_add_prop(P_MENU, yyvsp[-1].string, NULL, NULL);
+       printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 64:
+
+    {
+       menu_end_entry();
+       menu_add_menu();
+;}
+    break;
+
+  case 65:
+
+    {
+       if (zconf_endtoken(yyvsp[0].token, T_MENU, T_ENDMENU)) {
+               menu_end_menu();
+               printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
+       }
+;}
+    break;
+
+  case 67:
+
+    {
+       printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno);
+       zconfnerrs++;
+;}
+    break;
+
+  case 72:
+
+    { zconfprint("invalid menu option"); yyerrok; ;}
+    break;
+
+  case 73:
+
+    {
+       yyval.string = yyvsp[-1].string;
+       printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
+;}
+    break;
+
+  case 74:
+
+    {
+       zconf_nextfile(yyvsp[0].string);
+;}
+    break;
+
+  case 75:
+
+    {
+       menu_add_entry(NULL);
+       menu_add_prop(P_COMMENT, yyvsp[-1].string, NULL, NULL);
+       printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 76:
+
+    {
+       menu_end_entry();
+;}
+    break;
+
+  case 77:
+
+    {
+       printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
+       zconf_starthelp();
+;}
+    break;
+
+  case 78:
+
+    {
+       current_entry->sym->help = yyvsp[0].string;
+;}
+    break;
+
+  case 82:
+
+    {
+       menu_add_dep(yyvsp[-1].expr);
+       printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 83:
+
+    {
+       menu_add_dep(yyvsp[-1].expr);
+       printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 84:
+
+    {
+       menu_add_dep(yyvsp[-1].expr);
+       printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
+;}
+    break;
+
+  case 86:
+
+    {
+       menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr);
+;}
+    break;
+
+  case 89:
+
+    { yyval.token = T_ENDMENU; ;}
+    break;
+
+  case 90:
+
+    { yyval.token = T_ENDCHOICE; ;}
+    break;
+
+  case 91:
+
+    { yyval.token = T_ENDIF; ;}
+    break;
+
+  case 94:
+
+    { yyval.expr = NULL; ;}
+    break;
+
+  case 95:
+
+    { yyval.expr = yyvsp[0].expr; ;}
+    break;
+
+  case 96:
+
+    { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); ;}
+    break;
+
+  case 97:
+
+    { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
+    break;
+
+  case 98:
+
+    { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
+    break;
+
+  case 99:
+
+    { yyval.expr = yyvsp[-1].expr; ;}
+    break;
+
+  case 100:
+
+    { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); ;}
+    break;
+
+  case 101:
+
+    { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); ;}
+    break;
+
+  case 102:
+
+    { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); ;}
+    break;
+
+  case 103:
+
+    { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); ;}
+    break;
+
+  case 104:
+
+    { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); ;}
+    break;
+
+
+    }
+
+/* Line 999 of yacc.c.  */
+
+\f
+  yyvsp -= yylen;
+  yyssp -= yylen;
+
+
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if YYERROR_VERBOSE
+      yyn = yypact[yystate];
+
+      if (YYPACT_NINF < yyn && yyn < YYLAST)
+       {
+         YYSIZE_T yysize = 0;
+         int yytype = YYTRANSLATE (yychar);
+         char *yymsg;
+         int yyx, yycount;
+
+         yycount = 0;
+         /* Start YYX at -YYN if negative to avoid negative indexes in
+            YYCHECK.  */
+         for (yyx = yyn < 0 ? -yyn : 0;
+              yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+           if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+             yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+         yysize += yystrlen ("syntax error, unexpected ") + 1;
+         yysize += yystrlen (yytname[yytype]);
+         yymsg = (char *) YYSTACK_ALLOC (yysize);
+         if (yymsg != 0)
+           {
+             char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+             yyp = yystpcpy (yyp, yytname[yytype]);
+
+             if (yycount < 5)
+               {
+                 yycount = 0;
+                 for (yyx = yyn < 0 ? -yyn : 0;
+                      yyx < (int) (sizeof (yytname) / sizeof (char *));
+                      yyx++)
+                   if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+                     {
+                       const char *yyq = ! yycount ? ", expecting " : " or ";
+                       yyp = yystpcpy (yyp, yyq);
+                       yyp = yystpcpy (yyp, yytname[yyx]);
+                       yycount++;
+                     }
+               }
+             yyerror (yymsg);
+             YYSTACK_FREE (yymsg);
+           }
+         else
+           yyerror ("syntax error; also virtual memory exhausted");
+       }
+      else
+#endif /* YYERROR_VERBOSE */
+       yyerror ("syntax error");
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse lookahead token after an
+        error, discard it.  */
+
+      /* Return failure if at end of input.  */
+      if (yychar == YYEOF)
+        {
+         /* Pop the error token.  */
+          YYPOPSTACK;
+         /* Pop the rest of the stack.  */
+         while (yyss < yyssp)
+           {
+             YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+             yydestruct (yystos[*yyssp], yyvsp);
+             YYPOPSTACK;
+           }
+         YYABORT;
+        }
+
+      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+      yydestruct (yytoken, &yylval);
+      yychar = YYEMPTY;
+
+    }
+
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*----------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action.  |
+`----------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;     /* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYPACT_NINF)
+       {
+         yyn += YYTERROR;
+         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+           {
+             yyn = yytable[yyn];
+             if (0 < yyn)
+               break;
+           }
+       }
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+       YYABORT;
+
+      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+      yydestruct (yystos[yystate], yyvsp);
+      yyvsp--;
+      yystate = *--yyssp;
+
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  YYDPRINTF ((stderr, "Shifting error token, "));
+
+  *++yyvsp = yylval;
+
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here.  |
+`----------------------------------------------*/
+yyoverflowlab:
+  yyerror ("parser stack overflow");
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+  return yyresult;
+}
+
+
+
+
+
+void conf_parse(const char *name)
+{
+       struct symbol *sym;
+       int i;
+
+       zconf_initscan(name);
+
+       sym_init();
+       menu_init();
+       modules_sym = sym_lookup("MODULES", 0);
+       rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL);
+
+       //zconfdebug = 1;
+       zconfparse();
+       if (zconfnerrs)
+               exit(1);
+       menu_finalize(&rootmenu);
+       for_all_symbols(i, sym) {
+                if (!(sym->flags & SYMBOL_CHECKED) && sym_check_deps(sym))
+                        printf("\n");
+               else
+                       sym->flags |= SYMBOL_CHECK_DONE;
+        }
+
+       sym_change_count = 1;
+}
+
+const char *zconf_tokenname(int token)
+{
+       switch (token) {
+       case T_MENU:            return "menu";
+       case T_ENDMENU:         return "endmenu";
+       case T_CHOICE:          return "choice";
+       case T_ENDCHOICE:       return "endchoice";
+       case T_IF:              return "if";
+       case T_ENDIF:           return "endif";
+       }
+       return "<token>";
+}
+
+static bool zconf_endtoken(int token, int starttoken, int endtoken)
+{
+       if (token != endtoken) {
+               zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken));
+               zconfnerrs++;
+               return false;
+       }
+       if (current_menu->file != current_file) {
+               zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken));
+               zconfprint("location of the '%s'", zconf_tokenname(starttoken));
+               zconfnerrs++;
+               return false;
+       }
+       return true;
+}
+
+static void zconfprint(const char *err, ...)
+{
+       va_list ap;
+
+       fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno() + 1);
+       va_start(ap, err);
+       vfprintf(stderr, err, ap);
+       va_end(ap);
+       fprintf(stderr, "\n");
+}
+
+static void zconferror(const char *err)
+{
+       fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
+}
+
+void print_quoted_string(FILE *out, const char *str)
+{
+       const char *p;
+       int len;
+
+       putc('"', out);
+       while ((p = strchr(str, '"'))) {
+               len = p - str;
+               if (len)
+                       fprintf(out, "%.*s", len, str);
+               fputs("\\\"", out);
+               str = p + 1;
+       }
+       fputs(str, out);
+       putc('"', out);
+}
+
+void print_symbol(FILE *out, struct menu *menu)
+{
+       struct symbol *sym = menu->sym;
+       struct property *prop;
+
+       if (sym_is_choice(sym))
+               fprintf(out, "choice\n");
+       else
+               fprintf(out, "config %s\n", sym->name);
+       switch (sym->type) {
+       case S_BOOLEAN:
+               fputs("  boolean\n", out);
+               break;
+       case S_TRISTATE:
+               fputs("  tristate\n", out);
+               break;
+       case S_STRING:
+               fputs("  string\n", out);
+               break;
+       case S_INT:
+               fputs("  integer\n", out);
+               break;
+       case S_HEX:
+               fputs("  hex\n", out);
+               break;
+       default:
+               fputs("  ???\n", out);
+               break;
+       }
+       for (prop = sym->prop; prop; prop = prop->next) {
+               if (prop->menu != menu)
+                       continue;
+               switch (prop->type) {
+               case P_PROMPT:
+                       fputs("  prompt ", out);
+                       print_quoted_string(out, prop->text);
+                       if (!expr_is_yes(prop->visible.expr)) {
+                               fputs(" if ", out);
+                               expr_fprint(prop->visible.expr, out);
+                       }
+                       fputc('\n', out);
+                       break;
+               case P_DEFAULT:
+                       fputs( "  default ", out);
+                       expr_fprint(prop->expr, out);
+                       if (!expr_is_yes(prop->visible.expr)) {
+                               fputs(" if ", out);
+                               expr_fprint(prop->visible.expr, out);
+                       }
+                       fputc('\n', out);
+                       break;
+               case P_CHOICE:
+                       fputs("  #choice value\n", out);
+                       break;
+               default:
+                       fprintf(out, "  unknown prop %d!\n", prop->type);
+                       break;
+               }
+       }
+       if (sym->help) {
+               int len = strlen(sym->help);
+               while (sym->help[--len] == '\n')
+                       sym->help[len] = 0;
+               fprintf(out, "  help\n%s\n", sym->help);
+       }
+       fputc('\n', out);
+}
+
+void zconfdump(FILE *out)
+{
+       struct property *prop;
+       struct symbol *sym;
+       struct menu *menu;
+
+       menu = rootmenu.list;
+       while (menu) {
+               if ((sym = menu->sym))
+                       print_symbol(out, menu);
+               else if ((prop = menu->prompt)) {
+                       switch (prop->type) {
+                       case P_COMMENT:
+                               fputs("\ncomment ", out);
+                               print_quoted_string(out, prop->text);
+                               fputs("\n", out);
+                               break;
+                       case P_MENU:
+                               fputs("\nmenu ", out);
+                               print_quoted_string(out, prop->text);
+                               fputs("\n", out);
+                               break;
+                       default:
+                               ;
+                       }
+                       if (!expr_is_yes(prop->visible.expr)) {
+                               fputs("  depends ", out);
+                               expr_fprint(prop->visible.expr, out);
+                               fputc('\n', out);
+                       }
+                       fputs("\n", out);
+               }
+
+               if (menu->list)
+                       menu = menu->list;
+               else if (menu->next)
+                       menu = menu->next;
+               else while ((menu = menu->parent)) {
+                       if (menu->prompt && menu->prompt->type == P_MENU)
+                               fputs("\nendmenu\n", out);
+                       if (menu->next) {
+                               menu = menu->next;
+                               break;
+                       }
+               }
+       }
+}
+
+#include "lex.zconf.c"
+#include "confdata.c"
+#include "expr.c"
+#include "symbol.c"
+#include "menu.c"
+
+
diff --git a/scripts/kconfig/zconf.tab.h b/scripts/kconfig/zconf.tab.h
new file mode 100644 (file)
index 0000000..3b191ef
--- /dev/null
@@ -0,0 +1,125 @@
+/* A Bison parser, made from zconf.y, by GNU bison 1.75.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   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, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+#ifndef BISON_ZCONF_TAB_H
+# define BISON_ZCONF_TAB_H
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     T_MAINMENU = 258,
+     T_MENU = 259,
+     T_ENDMENU = 260,
+     T_SOURCE = 261,
+     T_CHOICE = 262,
+     T_ENDCHOICE = 263,
+     T_COMMENT = 264,
+     T_CONFIG = 265,
+     T_HELP = 266,
+     T_HELPTEXT = 267,
+     T_IF = 268,
+     T_ENDIF = 269,
+     T_DEPENDS = 270,
+     T_REQUIRES = 271,
+     T_OPTIONAL = 272,
+     T_PROMPT = 273,
+     T_DEFAULT = 274,
+     T_TRISTATE = 275,
+     T_BOOLEAN = 276,
+     T_INT = 277,
+     T_HEX = 278,
+     T_WORD = 279,
+     T_STRING = 280,
+     T_UNEQUAL = 281,
+     T_EOF = 282,
+     T_EOL = 283,
+     T_CLOSE_PAREN = 284,
+     T_OPEN_PAREN = 285,
+     T_ON = 286,
+     T_OR = 287,
+     T_AND = 288,
+     T_EQUAL = 289,
+     T_NOT = 290
+   };
+#endif
+#define T_MAINMENU 258
+#define T_MENU 259
+#define T_ENDMENU 260
+#define T_SOURCE 261
+#define T_CHOICE 262
+#define T_ENDCHOICE 263
+#define T_COMMENT 264
+#define T_CONFIG 265
+#define T_HELP 266
+#define T_HELPTEXT 267
+#define T_IF 268
+#define T_ENDIF 269
+#define T_DEPENDS 270
+#define T_REQUIRES 271
+#define T_OPTIONAL 272
+#define T_PROMPT 273
+#define T_DEFAULT 274
+#define T_TRISTATE 275
+#define T_BOOLEAN 276
+#define T_INT 277
+#define T_HEX 278
+#define T_WORD 279
+#define T_STRING 280
+#define T_UNEQUAL 281
+#define T_EOF 282
+#define T_EOL 283
+#define T_CLOSE_PAREN 284
+#define T_OPEN_PAREN 285
+#define T_ON 286
+#define T_OR 287
+#define T_AND 288
+#define T_EQUAL 289
+#define T_NOT 290
+
+
+
+
+#ifndef YYSTYPE
+#line 33 "zconf.y"
+typedef union {
+       int token;
+       char *string;
+       struct symbol *symbol;
+       struct expr *expr;
+       struct menu *menu;
+} yystype;
+/* Line 1281 of /usr/share/bison/yacc.c.  */
+#line 118 "zconf.tab.h"
+# define YYSTYPE yystype
+#endif
+
+extern YYSTYPE zconflval;
+
+
+#endif /* not BISON_ZCONF_TAB_H */
+
diff --git a/scripts/kconfig/zconf.tab.o b/scripts/kconfig/zconf.tab.o
new file mode 100644 (file)
index 0000000..3d1d070
Binary files /dev/null and b/scripts/kconfig/zconf.tab.o differ
diff --git a/scripts/reference_discarded.pl b/scripts/reference_discarded.pl
new file mode 100644 (file)
index 0000000..9d01ec5
--- /dev/null
@@ -0,0 +1,109 @@
+#!/usr/bin/perl -w
+#
+# reference_discarded.pl (C) Keith Owens 2001 <kaos@ocs.com.au>
+#
+# Released under GPL V2.
+#
+# List dangling references to vmlinux discarded sections.
+
+use strict;
+die($0 . " takes no arguments\n") if($#ARGV >= 0);
+
+my %object;
+my $object;
+my $line;
+my $ignore;
+my $errorcount;
+
+$| = 1;
+
+# printf("Finding objects, ");
+open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
+while (defined($line = <OBJDUMP_LIST>)) {
+       chomp($line);
+       if ($line =~ /:\s+file format/) {
+               ($object = $line) =~ s/:.*//;
+               $object{$object}->{'module'} = 0;
+               $object{$object}->{'size'} = 0;
+               $object{$object}->{'off'} = 0;
+       }
+       if ($line =~ /^\s*\d+\s+\.modinfo\s+/) {
+               $object{$object}->{'module'} = 1;
+       }
+       if ($line =~ /^\s*\d+\s+\.comment\s+/) {
+               ($object{$object}->{'size'}, $object{$object}->{'off'}) = (split(' ', $line))[2,5];
+       }
+}
+close(OBJDUMP_LIST);
+# printf("%d objects, ", scalar keys(%object));
+$ignore = 0;
+foreach $object (keys(%object)) {
+       if ($object{$object}->{'module'}) {
+               ++$ignore;
+               delete($object{$object});
+       }
+}
+# printf("ignoring %d module(s)\n", $ignore);
+
+# Ignore conglomerate objects, they have been built from multiple objects and we
+# only care about the individual objects.  If an object has more than one GCC:
+# string in the comment section then it is conglomerate.  This does not filter
+# out conglomerates that consist of exactly one object, can't be helped.
+
+# printf("Finding conglomerates, ");
+$ignore = 0;
+foreach $object (keys(%object)) {
+       if (exists($object{$object}->{'off'})) {
+               my ($off, $size, $comment, $l);
+               $off = hex($object{$object}->{'off'});
+               $size = hex($object{$object}->{'size'});
+               open(OBJECT, "<$object") || die "cannot read $object";
+               seek(OBJECT, $off, 0) || die "seek to $off in $object failed";
+               $l = read(OBJECT, $comment, $size);
+               die "read $size bytes from $object .comment failed" if ($l != $size);
+               close(OBJECT);
+               if ($comment =~ /GCC\:.*GCC\:/m) {
+                       ++$ignore;
+                       delete($object{$object});
+               }
+       }
+}
+# printf("ignoring %d conglomerate(s)\n", $ignore);
+
+# printf("Scanning objects\n");
+$errorcount = 0;
+foreach $object (keys(%object)) {
+       my $from;
+       open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
+       while (defined($line = <OBJDUMP>)) {
+               chomp($line);
+               if ($line =~ /RELOCATION RECORDS FOR /) {
+                       ($from = $line) =~ s/.*\[([^]]*).*/$1/;
+               }
+               if (($line =~ /\.text\.exit$/ ||
+                    $line =~ /\.exit\.text$/ ||
+                    $line =~ /\.data\.exit$/ ||
+                    $line =~ /\.exit\.data$/ ||
+                    $line =~ /\.exitcall\.exit$/) &&
+                   ($from !~ /\.text\.exit$/ &&
+                    $from !~ /\.exit\.text$/ &&
+                    $from !~ /\.data\.exit$/ &&
+                    $from !~ /\.exit\.data$/ &&
+                    $from !~ /\.altinstructions$/ &&
+                    $from !~ /\.debug_info$/ &&
+                    $from !~ /\.debug_aranges$/ &&
+                    $from !~ /\.debug_ranges$/ &&
+                    $from !~ /\.debug_line$/ &&
+                    $from !~ /\.debug_frame$/ &&
+                    $from !~ /\.exitcall\.exit$/ &&
+                    $from !~ /\.eh_frame$/ &&
+                    $from !~ /\.stab$/)) {
+                       printf("Error: %s %s refers to %s\n", $object, $from, $line);
+                       $errorcount = $errorcount + 1;
+               }
+       }
+       close(OBJDUMP);
+}
+# printf("Done\n");
+
+exit($errorcount);