From 050f48151ae282a6131dc08ca27a27a48c5a8bdd Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 14 Nov 2005 18:16:37 -0500 Subject: [PATCH] --- yaml --- r: 15837 b: refs/heads/master c: e74ac79956ecb56e71a398c57eb10fab8c58a562 h: refs/heads/master i: 15835: 891ca8f8e5d88ae61bed5cd0230d5eba14bcfc06 v: v3 --- [refs] | 2 +- trunk/CREDITS | 14 +- trunk/Documentation/00-INDEX | 6 - trunk/Documentation/DocBook/Makefile | 48 +- trunk/Documentation/DocBook/kernel-api.tmpl | 12 +- trunk/Documentation/DocBook/stylesheet.xsl | 1 - trunk/Documentation/DocBook/usb.tmpl | 1 - trunk/Documentation/HOWTO | 618 - trunk/Documentation/arm/00-INDEX | 2 - trunk/Documentation/arm/VFP/release-notes.txt | 2 +- trunk/Documentation/arm/memory.txt | 4 +- trunk/Documentation/atomic_ops.txt | 27 - trunk/Documentation/block/biodoc.txt | 4 +- trunk/Documentation/cpu-freq/governors.txt | 62 +- trunk/Documentation/devices.txt | 12 +- trunk/Documentation/dvb/README.dvb-usb | 50 +- trunk/Documentation/dvb/README.flexcop | 2 +- trunk/Documentation/dvb/avermedia.txt | 2 +- trunk/Documentation/dvb/cards.txt | 8 +- trunk/Documentation/dvb/contributors.txt | 4 +- trunk/Documentation/dvb/faq.txt | 1 + trunk/Documentation/dvb/readme.txt | 4 +- .../feature-removal-schedule.txt | 19 - trunk/Documentation/filesystems/affs.txt | 2 +- trunk/Documentation/filesystems/ext2.txt | 3 +- trunk/Documentation/filesystems/ext3.txt | 26 +- trunk/Documentation/floppy.txt | 10 +- trunk/Documentation/ioctl-number.txt | 2 +- trunk/Documentation/kernel-docs.txt | 60 +- trunk/Documentation/mca.txt | 2 +- trunk/Documentation/networking/driver.txt | 5 +- trunk/Documentation/networking/gianfar.txt | 72 - trunk/Documentation/networking/ifenslave.c | 9 +- trunk/Documentation/networking/ip-sysctl.txt | 23 - trunk/Documentation/networking/iphase.txt | 2 +- trunk/Documentation/networking/irda.txt | 8 +- trunk/Documentation/networking/ray_cs.txt | 3 +- trunk/Documentation/networking/vortex.txt | 28 +- trunk/Documentation/oops-tracing.txt | 7 +- trunk/Documentation/power/pci.txt | 2 +- trunk/Documentation/scsi/ChangeLog.megaraid | 35 - trunk/Documentation/scsi/ibmmca.txt | 4 +- trunk/Documentation/scsi/scsi_mid_low_api.txt | 37 +- trunk/Documentation/usb/bluetooth.txt | 44 + trunk/Documentation/usb/error-codes.txt | 5 +- trunk/Documentation/usb/ibmcam.txt | 4 +- trunk/Documentation/usb/ov511.txt | 4 +- trunk/Documentation/usb/rio.txt | 6 +- trunk/Documentation/video4linux/CARDLIST.bttv | 1 - .../video4linux/CARDLIST.saa7134 | 2 - .../Documentation/video4linux/CARDLIST.tuner | 1 - trunk/Documentation/video4linux/zr36120.txt | 7 +- trunk/Documentation/x86_64/boot-options.txt | 12 +- trunk/Documentation/x86_64/mm.txt | 6 +- trunk/MAINTAINERS | 75 +- trunk/Makefile | 19 +- trunk/README | 5 - trunk/arch/alpha/kernel/machvec_impl.h | 2 +- trunk/arch/arm/Kconfig | 20 +- trunk/arch/arm/boot/compressed/head.S | 30 +- trunk/arch/arm/common/locomo.c | 4 +- trunk/arch/arm/common/sa1111.c | 14 +- trunk/arch/arm/common/scoop.c | 2 +- trunk/arch/arm/configs/corgi_defconfig | 83 +- trunk/arch/arm/configs/poodle_defconfig | 1015 ++ trunk/arch/arm/configs/s3c2410_defconfig | 119 +- trunk/arch/arm/configs/spitz_defconfig | 100 +- trunk/arch/arm/kernel/apm.c | 1 - trunk/arch/arm/kernel/armksyms.c | 1 + trunk/arch/arm/kernel/calls.S | 8 +- trunk/arch/arm/kernel/entry-armv.S | 49 - trunk/arch/arm/kernel/entry-common.S | 23 +- trunk/arch/arm/kernel/head.S | 11 +- trunk/arch/arm/kernel/module.c | 2 - trunk/arch/arm/kernel/ptrace.c | 9 - trunk/arch/arm/kernel/signal.c | 25 +- trunk/arch/arm/kernel/smp.c | 4 +- trunk/arch/arm/kernel/vmlinux.lds.S | 6 +- trunk/arch/arm/lib/getuser.S | 11 + trunk/arch/arm/mach-clps7500/core.c | 2 +- trunk/arch/arm/mach-footbridge/common.c | 24 +- trunk/arch/arm/mach-ixp4xx/ixdp425-setup.c | 2 +- trunk/arch/arm/mach-pxa/Kconfig | 12 +- trunk/arch/arm/mach-pxa/Makefile | 5 +- trunk/arch/arm/mach-pxa/akita-ioexp.c | 223 - trunk/arch/arm/mach-pxa/corgi_lcd.c | 2 +- trunk/arch/arm/mach-pxa/corgi_pm.c | 228 - trunk/arch/arm/mach-pxa/mainstone.c | 21 - trunk/arch/arm/mach-pxa/pm.c | 9 +- trunk/arch/arm/mach-pxa/pxa27x.c | 6 - trunk/arch/arm/mach-pxa/sharpsl.h | 8 +- trunk/arch/arm/mach-pxa/sharpsl_pm.c | 109 +- trunk/arch/arm/mach-pxa/spitz.c | 49 - trunk/arch/arm/mach-pxa/spitz_pm.c | 233 - trunk/arch/arm/mach-pxa/tosa.c | 2 +- trunk/arch/arm/mach-realview/core.c | 1 + trunk/arch/arm/mach-realview/core.h | 2 + trunk/arch/arm/mach-realview/localtimer.c | 2 + trunk/arch/arm/mach-realview/platsmp.c | 3 +- trunk/arch/arm/mach-s3c2410/mach-bast.c | 28 +- trunk/arch/arm/mach-sa1100/assabet.c | 3 +- trunk/arch/arm/mm/Makefile | 2 +- trunk/arch/arm/mm/blockops.c | 185 + trunk/arch/arm/mm/consistent.c | 13 +- trunk/arch/arm/mm/flush.c | 7 +- trunk/arch/arm/mm/init.c | 24 +- trunk/arch/arm/mm/ioremap.c | 3 +- trunk/arch/arm/plat-omap/dmtimer.c | 2 +- trunk/arch/arm/plat-omap/ocpi.c | 2 +- trunk/arch/arm/plat-omap/pm.c | 2 +- trunk/arch/arm/plat-omap/sram-fn.S | 2 +- trunk/arch/arm/tools/mach-types | 14 +- trunk/arch/frv/kernel/pm.c | 1 - trunk/arch/frv/kernel/semaphore.c | 2 +- trunk/arch/frv/mb93090-mb00/pci-irq.c | 2 +- trunk/arch/frv/mm/init.c | 2 +- trunk/arch/frv/mm/pgalloc.c | 6 +- trunk/arch/i386/Kconfig | 2 +- trunk/arch/i386/kernel/acpi/boot.c | 28 +- trunk/arch/i386/kernel/apm.c | 1 - trunk/arch/i386/kernel/cpu/amd.c | 12 +- trunk/arch/i386/kernel/cpu/common.c | 40 +- .../i386/kernel/cpu/cpufreq/cpufreq-nforce2.c | 3 +- .../i386/kernel/cpu/cpufreq/powernow-k8.c | 50 +- .../i386/kernel/cpu/cpufreq/powernow-k8.h | 9 +- .../i386/kernel/cpu/cpufreq/speedstep-ich.c | 47 +- .../i386/kernel/cpu/cpufreq/speedstep-lib.c | 32 +- .../i386/kernel/cpu/cpufreq/speedstep-lib.h | 1 - .../i386/kernel/cpu/cpufreq/speedstep-smi.c | 1 - trunk/arch/i386/kernel/cpu/intel.c | 50 +- trunk/arch/i386/kernel/cpu/intel_cacheinfo.c | 46 +- trunk/arch/i386/kernel/cpu/mtrr/main.c | 8 - trunk/arch/i386/kernel/cpu/proc.c | 13 +- trunk/arch/i386/kernel/crash.c | 7 - trunk/arch/i386/kernel/entry.S | 7 +- trunk/arch/i386/kernel/io_apic.c | 4 +- trunk/arch/i386/kernel/kprobes.c | 2 +- trunk/arch/i386/kernel/mpparse.c | 5 +- trunk/arch/i386/kernel/process.c | 11 +- trunk/arch/i386/kernel/reboot.c | 8 - trunk/arch/i386/kernel/smpboot.c | 76 +- trunk/arch/i386/kernel/srat.c | 4 +- trunk/arch/i386/kernel/timers/timer_pit.c | 5 +- trunk/arch/i386/kernel/traps.c | 7 + trunk/arch/i386/mm/init.c | 3 +- trunk/arch/i386/mm/ioremap.c | 37 +- trunk/arch/i386/pci/Makefile | 2 +- trunk/arch/i386/pci/common.c | 4 +- trunk/arch/i386/pci/direct.c | 6 +- trunk/arch/i386/pci/i386.c | 7 +- trunk/arch/i386/pci/mmconfig.c | 65 +- trunk/arch/i386/pci/pci.h | 7 - trunk/arch/ia64/Kconfig | 4 - trunk/arch/ia64/configs/sn2_defconfig | 154 +- trunk/arch/ia64/configs/tiger_defconfig | 74 +- trunk/arch/ia64/ia32/binfmt_elf32.c | 2 + trunk/arch/ia64/ia32/ia32priv.h | 1 + trunk/arch/ia64/kernel/ia64_ksyms.c | 1 - trunk/arch/ia64/kernel/ivt.S | 133 +- trunk/arch/ia64/kernel/kprobes.c | 4 +- trunk/arch/ia64/kernel/process.c | 29 +- trunk/arch/ia64/kernel/salinfo.c | 2 +- trunk/arch/ia64/kernel/setup.c | 8 +- trunk/arch/ia64/kernel/time.c | 29 - trunk/arch/ia64/kernel/traps.c | 18 + trunk/arch/ia64/kernel/uncached.c | 6 +- trunk/arch/ia64/kernel/vmlinux.lds.S | 3 - trunk/arch/ia64/mm/discontig.c | 4 +- trunk/arch/ia64/sn/kernel/bte.c | 1 - trunk/arch/ia64/sn/kernel/io_init.c | 153 +- trunk/arch/ia64/sn/kernel/sn2/ptc_deadlock.S | 8 +- trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c | 5 +- trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c | 3 +- trunk/arch/ia64/sn/pci/pcibr/pcibr_reg.c | 48 +- trunk/arch/ia64/sn/pci/tioca_provider.c | 12 +- trunk/arch/m32r/kernel/io_mappi3.c | 54 +- trunk/arch/m32r/kernel/setup_mappi3.c | 20 +- trunk/arch/m32r/kernel/sys_m32r.c | 6 +- trunk/arch/m68k/fpsp040/skeleton.S | 6 +- trunk/arch/m68k/ifpsp060/iskeleton.S | 6 +- trunk/arch/m68k/kernel/asm-offsets.c | 10 +- trunk/arch/m68k/kernel/entry.S | 78 +- trunk/arch/m68k/kernel/ptrace.c | 15 +- trunk/arch/mips/Kconfig | 4 +- trunk/arch/mips/Makefile | 1 - trunk/arch/mips/au1000/common/power.c | 1 - trunk/arch/mips/au1000/common/setup.c | 2 +- trunk/arch/mips/au1000/common/usbdev.c | 4 +- trunk/arch/mips/au1000/db1x00/board_setup.c | 7 +- trunk/arch/mips/au1000/db1x00/init.c | 12 +- trunk/arch/mips/configs/atlas_defconfig | 169 +- trunk/arch/mips/configs/bigsur_defconfig | 158 +- trunk/arch/mips/configs/capcella_defconfig | 147 +- trunk/arch/mips/configs/cobalt_defconfig | 135 +- trunk/arch/mips/configs/db1000_defconfig | 173 +- trunk/arch/mips/configs/db1100_defconfig | 173 +- trunk/arch/mips/configs/db1200_defconfig | 179 +- trunk/arch/mips/configs/db1500_defconfig | 262 +- trunk/arch/mips/configs/db1550_defconfig | 173 +- trunk/arch/mips/configs/ddb5476_defconfig | 139 +- trunk/arch/mips/configs/ddb5477_defconfig | 135 +- trunk/arch/mips/configs/decstation_defconfig | 161 +- trunk/arch/mips/configs/e55_defconfig | 148 +- trunk/arch/mips/configs/ev64120_defconfig | 147 +- trunk/arch/mips/configs/ev96100_defconfig | 146 +- trunk/arch/mips/configs/ip22_defconfig | 169 +- trunk/arch/mips/configs/ip27_defconfig | 171 +- trunk/arch/mips/configs/ip32_defconfig | 138 +- trunk/arch/mips/configs/it8172_defconfig | 156 +- trunk/arch/mips/configs/ivr_defconfig | 151 +- trunk/arch/mips/configs/jaguar-atx_defconfig | 141 +- trunk/arch/mips/configs/jmr3927_defconfig | 138 +- trunk/arch/mips/configs/lasat200_defconfig | 152 +- trunk/arch/mips/configs/malta_defconfig | 169 +- trunk/arch/mips/configs/mipssim_defconfig | 159 +- trunk/arch/mips/configs/mpc30x_defconfig | 151 +- trunk/arch/mips/configs/ocelot_3_defconfig | 164 +- trunk/arch/mips/configs/ocelot_c_defconfig | 133 +- trunk/arch/mips/configs/ocelot_defconfig | 135 +- trunk/arch/mips/configs/ocelot_g_defconfig | 133 +- trunk/arch/mips/configs/pb1100_defconfig | 172 +- trunk/arch/mips/configs/pb1500_defconfig | 173 +- trunk/arch/mips/configs/pb1550_defconfig | 173 +- trunk/arch/mips/configs/pnx8550-jbs_defconfig | 185 +- .../arch/mips/configs/pnx8550-v2pci_defconfig | 192 +- trunk/arch/mips/configs/qemu_defconfig | 132 +- trunk/arch/mips/configs/rbhma4500_defconfig | 168 +- trunk/arch/mips/configs/rm200_defconfig | 177 +- .../arch/mips/configs/sb1250-swarm_defconfig | 152 +- trunk/arch/mips/configs/sead_defconfig | 122 +- trunk/arch/mips/configs/tb0226_defconfig | 155 +- trunk/arch/mips/configs/tb0229_defconfig | 151 +- trunk/arch/mips/configs/workpad_defconfig | 150 +- trunk/arch/mips/configs/yosemite_defconfig | 149 +- trunk/arch/mips/ddb5xxx/ddb5477/lcd44780.c | 10 +- trunk/arch/mips/defconfig | 169 +- trunk/arch/mips/jmr3927/common/rtc_ds1742.c | 2 +- trunk/arch/mips/jmr3927/rbhma3100/irq.c | 28 +- trunk/arch/mips/jmr3927/rbhma3100/setup.c | 4 +- trunk/arch/mips/kernel/cpu-probe.c | 4 +- trunk/arch/mips/kernel/irixsig.c | 4 + trunk/arch/mips/kernel/linux32.c | 4 +- trunk/arch/mips/kernel/scall32-o32.S | 18 +- trunk/arch/mips/kernel/scall64-64.S | 18 +- trunk/arch/mips/kernel/scall64-n32.S | 4 +- trunk/arch/mips/kernel/scall64-o32.S | 4 +- trunk/arch/mips/kernel/signal.c | 2 + trunk/arch/mips/kernel/signal32.c | 2 + trunk/arch/mips/kernel/traps.c | 5 +- trunk/arch/mips/mips-boards/sead/sead_int.c | 12 +- trunk/arch/mips/mips-boards/sead/sead_setup.c | 4 +- trunk/arch/mips/mm/init.c | 4 +- trunk/arch/mips/momentum/ocelot_g/gt-irq.c | 2 +- trunk/arch/mips/pci/Makefile | 2 +- trunk/arch/mips/pci/ops-tx3927.c | 114 +- trunk/arch/mips/pci/pci-jmr3927.c | 2 +- trunk/arch/mips/qemu/q-firmware.c | 13 +- trunk/arch/mips/sgi-ip32/crime.c | 7 +- trunk/arch/parisc/kernel/drivers.c | 8 +- trunk/arch/parisc/kernel/entry.S | 1 - trunk/arch/parisc/kernel/inventory.c | 2 +- trunk/arch/parisc/kernel/ioctl32.c | 546 + trunk/arch/parisc/kernel/irq.c | 110 +- trunk/arch/parisc/kernel/perf.c | 33 +- trunk/arch/parisc/kernel/ptrace.c | 5 +- trunk/arch/parisc/kernel/signal.c | 1 + trunk/arch/parisc/kernel/smp.c | 24 +- trunk/arch/parisc/kernel/syscall.S | 3 +- trunk/arch/powerpc/Kconfig | 20 +- trunk/arch/powerpc/Makefile | 52 +- trunk/arch/powerpc/configs/cell_defconfig | 176 +- trunk/arch/powerpc/configs/g5_defconfig | 54 +- trunk/arch/powerpc/configs/iseries_defconfig | 160 +- trunk/arch/powerpc/configs/maple_defconfig | 157 +- trunk/arch/powerpc/configs/pseries_defconfig | 208 +- trunk/arch/powerpc/kernel/Makefile | 27 +- trunk/arch/powerpc/kernel/asm-offsets.c | 6 +- trunk/arch/powerpc/kernel/entry_64.S | 4 +- trunk/arch/powerpc/kernel/head_fsl_booke.S | 2 +- trunk/arch/powerpc/kernel/irq.c | 9 +- trunk/arch/powerpc/kernel/lparcfg.c | 51 +- trunk/arch/powerpc/kernel/misc_32.S | 8 + trunk/arch/powerpc/kernel/ppc_ksyms.c | 16 +- trunk/arch/powerpc/kernel/process.c | 63 +- trunk/arch/powerpc/kernel/prom.c | 2 - trunk/arch/powerpc/kernel/prom_init.c | 2 +- trunk/arch/powerpc/kernel/ptrace.c | 3 +- trunk/arch/powerpc/kernel/ptrace32.c | 3 +- trunk/arch/powerpc/kernel/rtas-rtc.c | 105 - trunk/arch/powerpc/kernel/rtas_pci.c | 68 +- trunk/arch/powerpc/kernel/setup-common.c | 1 - trunk/arch/powerpc/kernel/setup_32.c | 4 + trunk/arch/powerpc/kernel/setup_64.c | 15 +- trunk/arch/powerpc/kernel/signal_32.c | 7 +- trunk/arch/powerpc/kernel/signal_64.c | 6 +- trunk/arch/powerpc/kernel/smp.c | 7 +- trunk/arch/powerpc/kernel/syscalls.c | 2 +- trunk/arch/powerpc/kernel/time.c | 28 - trunk/arch/powerpc/kernel/vdso.c | 9 +- trunk/arch/powerpc/kernel/vdso32/cacheflush.S | 2 - trunk/arch/powerpc/kernel/vdso32/datapage.S | 6 +- .../arch/powerpc/kernel/vdso32/gettimeofday.S | 16 +- trunk/arch/powerpc/kernel/vdso64/cacheflush.S | 2 - trunk/arch/powerpc/kernel/vdso64/datapage.S | 4 +- .../arch/powerpc/kernel/vdso64/gettimeofday.S | 35 +- trunk/arch/powerpc/mm/4xx_mmu.c | 4 + trunk/arch/powerpc/mm/fsl_booke_mmu.c | 2 +- trunk/arch/powerpc/mm/hash_utils_64.c | 4 +- trunk/arch/powerpc/mm/hugetlbpage.c | 105 +- trunk/arch/powerpc/mm/imalloc.c | 3 +- trunk/arch/powerpc/mm/init_64.c | 3 +- trunk/arch/powerpc/mm/lmb.c | 33 +- trunk/arch/powerpc/mm/mem.c | 10 +- trunk/arch/powerpc/mm/mmu_decl.h | 14 +- trunk/arch/powerpc/mm/numa.c | 7 +- trunk/arch/powerpc/mm/pgtable_64.c | 3 +- trunk/arch/powerpc/mm/stab.c | 7 +- trunk/arch/powerpc/mm/tlb_32.c | 6 - trunk/arch/powerpc/mm/tlb_64.c | 4 +- .../powerpc/oprofile/op_model_fsl_booke.c | 2 +- trunk/arch/powerpc/platforms/chrp/setup.c | 11 +- trunk/arch/powerpc/platforms/chrp/smp.c | 1 - trunk/arch/powerpc/platforms/chrp/time.c | 3 +- trunk/arch/powerpc/platforms/iseries/iommu.c | 2 +- trunk/arch/powerpc/platforms/iseries/irq.c | 25 +- trunk/arch/powerpc/platforms/iseries/pci.c | 3 +- trunk/arch/powerpc/platforms/iseries/setup.c | 6 + trunk/arch/powerpc/platforms/maple/pci.c | 16 +- trunk/arch/powerpc/platforms/maple/time.c | 11 +- .../arch/powerpc/platforms/powermac/feature.c | 29 +- trunk/arch/powerpc/platforms/powermac/pci.c | 62 +- trunk/arch/powerpc/platforms/powermac/smp.c | 6 +- trunk/arch/powerpc/platforms/powermac/time.c | 9 +- trunk/arch/powerpc/platforms/pseries/Makefile | 5 +- trunk/arch/powerpc/platforms/pseries/eeh.c | 3 +- trunk/arch/powerpc/platforms/pseries/iommu.c | 13 +- trunk/arch/powerpc/platforms/pseries/lpar.c | 12 + trunk/arch/powerpc/platforms/pseries/setup.c | 30 +- trunk/arch/powerpc/platforms/pseries/smp.c | 1 - trunk/arch/powerpc/platforms/pseries/xics.c | 21 +- trunk/arch/powerpc/sysdev/dart.h | 2 +- trunk/arch/powerpc/sysdev/mpic.c | 13 +- trunk/arch/powerpc/sysdev/u3_iommu.c | 4 +- trunk/arch/powerpc/xmon/xmon.c | 1 - trunk/arch/ppc/Kconfig | 6 +- trunk/arch/ppc/boot/simple/Makefile | 4 +- trunk/arch/ppc/kernel/Makefile | 4 +- trunk/arch/ppc/kernel/align.c | 410 + trunk/arch/ppc/kernel/head_fsl_booke.S | 2 +- trunk/arch/ppc/kernel/pci.c | 1 + trunk/arch/ppc/kernel/ppc_ksyms.c | 2 +- trunk/arch/ppc/kernel/process.c | 6 - trunk/arch/ppc/kernel/setup.c | 14 +- trunk/arch/ppc/kernel/smp.c | 4 - trunk/arch/ppc/mm/fsl_booke_mmu.c | 2 +- trunk/arch/ppc/mm/init.c | 23 +- trunk/arch/ppc/platforms/83xx/mpc834x_sys.c | 17 +- trunk/arch/ppc/platforms/83xx/mpc834x_sys.h | 2 +- trunk/arch/ppc/platforms/85xx/mpc8540_ads.c | 2 +- trunk/arch/ppc/platforms/85xx/mpc8540_ads.h | 2 +- trunk/arch/ppc/platforms/85xx/mpc8555_cds.h | 2 +- trunk/arch/ppc/platforms/85xx/mpc8560_ads.c | 2 +- trunk/arch/ppc/platforms/85xx/mpc8560_ads.h | 2 +- .../ppc/platforms/85xx/mpc85xx_ads_common.c | 2 +- .../ppc/platforms/85xx/mpc85xx_ads_common.h | 4 +- .../ppc/platforms/85xx/mpc85xx_cds_common.c | 5 +- .../ppc/platforms/85xx/mpc85xx_cds_common.h | 2 +- trunk/arch/ppc/platforms/85xx/sbc8560.c | 2 +- trunk/arch/ppc/platforms/85xx/stx_gp3.h | 2 + trunk/arch/ppc/platforms/pmac_feature.c | 28 +- trunk/arch/ppc/platforms/pq2ads.c | 2 +- trunk/arch/ppc/syslib/ipic.h | 2 +- trunk/arch/ppc/syslib/m82xx_pci.c | 3 +- trunk/arch/ppc/syslib/mpc83xx_devices.c | 2 +- trunk/arch/ppc/syslib/mpc83xx_sys.c | 30 +- trunk/arch/ppc/syslib/mpc85xx_devices.c | 2 +- trunk/arch/ppc/syslib/mpc85xx_sys.c | 2 +- trunk/arch/ppc/syslib/mpc8xx_devices.c | 2 +- trunk/arch/ppc/syslib/mpc8xx_sys.c | 2 +- trunk/arch/ppc/syslib/ppc4xx_dma.c | 1 - trunk/arch/ppc/syslib/ppc83xx_setup.c | 2 +- trunk/arch/ppc/syslib/ppc83xx_setup.h | 2 +- trunk/arch/ppc/syslib/ppc85xx_common.c | 2 +- trunk/arch/ppc/syslib/ppc85xx_common.h | 2 +- trunk/arch/ppc/syslib/ppc85xx_setup.c | 2 +- trunk/arch/ppc/syslib/ppc85xx_setup.h | 2 +- trunk/arch/ppc/syslib/ppc_sys.c | 2 +- trunk/arch/ppc/syslib/pq2_devices.c | 2 +- trunk/arch/ppc/syslib/pq2_sys.c | 2 +- trunk/arch/ppc/xmon/start.c | 5 +- trunk/arch/ppc64/Kconfig | 520 + trunk/arch/ppc64/Kconfig.debug | 65 + trunk/arch/ppc64/Makefile | 142 + trunk/arch/{powerpc => ppc64}/boot/Makefile | 5 +- trunk/arch/{powerpc => ppc64}/boot/README | 0 .../arch/{powerpc => ppc64}/boot/addRamDisk.c | 0 trunk/arch/{powerpc => ppc64}/boot/addnote.c | 0 trunk/arch/{powerpc => ppc64}/boot/crt0.S | 23 +- trunk/arch/{powerpc => ppc64}/boot/div64.S | 0 trunk/arch/{powerpc => ppc64}/boot/elf.h | 0 trunk/arch/{powerpc => ppc64}/boot/install.sh | 0 trunk/arch/{powerpc => ppc64}/boot/main.c | 122 +- trunk/arch/{powerpc => ppc64}/boot/page.h | 0 trunk/arch/{powerpc => ppc64}/boot/ppc_asm.h | 0 trunk/arch/{powerpc => ppc64}/boot/prom.c | 0 trunk/arch/{powerpc => ppc64}/boot/prom.h | 0 trunk/arch/{powerpc => ppc64}/boot/stdio.h | 0 trunk/arch/{powerpc => ppc64}/boot/string.S | 0 trunk/arch/{powerpc => ppc64}/boot/string.h | 0 trunk/arch/{powerpc => ppc64}/boot/zImage.lds | 0 trunk/arch/ppc64/configs/bpa_defconfig | 1024 ++ trunk/arch/ppc64/configs/g5_defconfig | 1392 ++ trunk/arch/ppc64/configs/iSeries_defconfig | 998 ++ trunk/arch/ppc64/configs/maple_defconfig | 1062 ++ trunk/arch/ppc64/configs/pSeries_defconfig | 1371 ++ .../ppc64_defconfig => ppc64/defconfig} | 347 +- trunk/arch/ppc64/kernel/Makefile | 46 + trunk/arch/{powerpc => ppc64}/kernel/align.c | 394 +- trunk/arch/ppc64/kernel/asm-offsets.c | 195 + trunk/arch/ppc64/kernel/btext.c | 792 + .../kernel/dma_64.c => ppc64/kernel/dma.c} | 0 trunk/arch/ppc64/kernel/head.S | 2007 +++ .../pseries => ppc64/kernel}/hvconsole.c | 0 .../pseries => ppc64/kernel}/hvcserver.c | 0 .../kernel/idle_64.c => ppc64/kernel/idle.c} | 0 trunk/arch/{powerpc => ppc64}/kernel/iomap.c | 0 trunk/arch/{powerpc => ppc64}/kernel/iommu.c | 0 .../arch/{powerpc => ppc64}/kernel/kprobes.c | 2 +- .../kernel/machine_kexec.c} | 63 +- trunk/arch/ppc64/kernel/misc.S | 940 ++ .../module_64.c => ppc64/kernel/module.c} | 0 .../nvram_64.c => ppc64/kernel/nvram.c} | 0 .../kernel/pci_64.c => ppc64/kernel/pci.c} | 88 +- .../kernel/pci_direct_iommu.c | 0 trunk/arch/{powerpc => ppc64}/kernel/pci_dn.c | 0 .../{powerpc => ppc64}/kernel/pci_iommu.c | 0 trunk/arch/ppc64/kernel/ppc_ksyms.c | 76 + trunk/arch/ppc64/kernel/prom.c | 1954 +++ trunk/arch/ppc64/kernel/prom_init.c | 2051 +++ trunk/arch/ppc64/kernel/rtc.c | 358 + trunk/arch/ppc64/kernel/semaphore.c | 136 + trunk/arch/ppc64/kernel/vdso.c | 625 + trunk/arch/ppc64/kernel/vmlinux.lds.S | 151 + trunk/arch/ppc64/xmon/privinst.h | 64 + trunk/arch/sparc/Kconfig | 4 - trunk/arch/sparc/Makefile | 2 +- trunk/arch/sparc/kernel/ebus.c | 24 +- trunk/arch/sparc/kernel/ioport.c | 2 +- trunk/arch/sparc/kernel/led.c | 2 +- trunk/arch/sparc/kernel/pcic.c | 2 +- trunk/arch/sparc/kernel/sys_sunos.c | 2 +- trunk/arch/sparc/kernel/time.c | 4 +- trunk/arch/sparc/kernel/vmlinux.lds.S | 18 +- trunk/arch/sparc/lib/atomic32.c | 33 +- trunk/arch/sparc/lib/bitext.c | 1 - trunk/arch/sparc/mm/generic.c | 10 +- trunk/arch/sparc/mm/sun4c.c | 2 +- trunk/arch/sparc64/Kconfig | 4 - trunk/arch/sparc64/Makefile | 5 + trunk/arch/sparc64/kernel/kprobes.c | 2 +- trunk/arch/sparc64/kernel/sbus.c | 2 +- trunk/arch/sparc64/kernel/sys_sunos32.c | 2 +- trunk/arch/sparc64/kernel/vmlinux.lds.S | 18 +- trunk/arch/sparc64/mm/generic.c | 16 +- trunk/arch/sparc64/solaris/misc.c | 2 +- trunk/arch/um/Kconfig | 12 +- trunk/arch/um/Kconfig.i386 | 10 +- trunk/arch/um/Makefile | 2 +- trunk/arch/um/Makefile-i386 | 1 + trunk/arch/um/Makefile-x86_64 | 4 - trunk/arch/um/drivers/chan_kern.c | 5 +- trunk/arch/um/drivers/chan_user.c | 2 +- trunk/arch/um/drivers/daemon_user.c | 6 +- trunk/arch/um/drivers/fd.c | 9 +- trunk/arch/um/drivers/mcast_user.c | 20 +- trunk/arch/um/drivers/port_user.c | 9 +- trunk/arch/um/drivers/pty.c | 11 +- trunk/arch/um/drivers/tty.c | 9 +- trunk/arch/um/drivers/xterm.c | 9 +- trunk/arch/um/include/chan_user.h | 4 +- trunk/arch/um/include/sysdep-i386/stub.h | 38 +- trunk/arch/um/include/sysdep-x86_64/stub.h | 42 +- trunk/arch/um/include/um_uaccess.h | 21 +- trunk/arch/um/kernel/skas/clone.c | 28 +- .../um/kernel/skas/include/uaccess-skas.h | 11 +- trunk/arch/um/kernel/skas/uaccess.c | 8 +- trunk/arch/um/kernel/trap_kern.c | 9 - trunk/arch/um/kernel/tt/include/uaccess-tt.h | 8 +- trunk/arch/um/kernel/tt/uaccess.c | 8 +- trunk/arch/um/os-Linux/start_up.c | 22 +- trunk/arch/um/os-Linux/user_syms.c | 5 - trunk/arch/um/scripts/Makefile.rules | 5 + trunk/arch/um/sys-i386/Makefile | 10 +- trunk/arch/um/sys-i386/ldt.c | 35 +- trunk/arch/um/sys-i386/stub_segv.c | 11 +- trunk/arch/um/sys-x86_64/Makefile | 7 +- trunk/arch/um/sys-x86_64/stub_segv.c | 20 +- trunk/arch/v850/Kconfig | 8 - trunk/arch/v850/kernel/irq.c | 715 +- trunk/arch/x86_64/Kconfig | 57 +- trunk/arch/x86_64/Kconfig.debug | 9 + trunk/arch/x86_64/defconfig | 98 +- trunk/arch/x86_64/ia32/ia32_aout.c | 3 + trunk/arch/x86_64/ia32/ia32_binfmt.c | 7 +- trunk/arch/x86_64/kernel/Makefile | 1 - trunk/arch/x86_64/kernel/aperture.c | 2 +- trunk/arch/x86_64/kernel/apic.c | 10 - trunk/arch/x86_64/kernel/e820.c | 3 +- trunk/arch/x86_64/kernel/entry.S | 3 - trunk/arch/x86_64/kernel/head.S | 37 +- trunk/arch/x86_64/kernel/head64.c | 14 +- trunk/arch/x86_64/kernel/i8259.c | 4 +- trunk/arch/x86_64/kernel/io_apic.c | 80 +- trunk/arch/x86_64/kernel/kprobes.c | 2 +- trunk/arch/x86_64/kernel/mce.c | 17 +- trunk/arch/x86_64/kernel/mce_amd.c | 538 - trunk/arch/x86_64/kernel/mpparse.c | 23 +- trunk/arch/x86_64/kernel/pci-gart.c | 8 +- trunk/arch/x86_64/kernel/process.c | 54 +- trunk/arch/x86_64/kernel/reboot.c | 7 +- trunk/arch/x86_64/kernel/setup.c | 95 +- trunk/arch/x86_64/kernel/setup64.c | 2 +- trunk/arch/x86_64/kernel/signal.c | 17 - trunk/arch/x86_64/kernel/smp.c | 7 +- trunk/arch/x86_64/kernel/smpboot.c | 113 +- trunk/arch/x86_64/kernel/sys_x86_64.c | 14 + trunk/arch/x86_64/kernel/time.c | 6 +- trunk/arch/x86_64/kernel/traps.c | 44 +- trunk/arch/x86_64/kernel/vmlinux.lds.S | 2 +- trunk/arch/x86_64/kernel/x8664_ksyms.c | 3 - trunk/arch/x86_64/lib/clear_page.S | 38 + trunk/arch/x86_64/lib/copy_page.S | 87 + trunk/arch/x86_64/lib/memcpy.S | 93 +- trunk/arch/x86_64/lib/memset.S | 94 + trunk/arch/x86_64/mm/fault.c | 19 +- trunk/arch/x86_64/mm/init.c | 129 +- trunk/arch/x86_64/mm/ioremap.c | 37 +- trunk/arch/x86_64/mm/k8topology.c | 1 - trunk/arch/x86_64/mm/numa.c | 124 +- trunk/arch/x86_64/mm/srat.c | 6 +- trunk/arch/x86_64/pci/Makefile | 2 +- trunk/arch/x86_64/pci/mmconfig.c | 65 +- trunk/block/as-iosched.c | 6 + trunk/block/cfq-iosched.c | 2 + trunk/block/deadline-iosched.c | 2 + trunk/block/elevator.c | 2 + trunk/block/ll_rw_blk.c | 42 +- trunk/block/scsi_ioctl.c | 47 +- trunk/drivers/Makefile | 3 +- trunk/drivers/acpi/Kconfig | 1 + trunk/drivers/acpi/Makefile | 2 +- trunk/drivers/acpi/bus.c | 3 +- trunk/drivers/acpi/pci_link.c | 2 +- trunk/drivers/acpi/processor_core.c | 15 - trunk/drivers/acpi/processor_idle.c | 75 +- trunk/drivers/acpi/processor_thermal.c | 42 +- trunk/drivers/acpi/scan.c | 2 +- trunk/drivers/acpi/thermal.c | 163 +- trunk/drivers/acpi/utilities/utmisc.c | 18 +- trunk/drivers/acpi/video.c | 2 +- trunk/drivers/atm/Kconfig | 7 - trunk/drivers/atm/Makefile | 1 - trunk/drivers/atm/adummy.c | 168 - trunk/drivers/atm/atmdev_init.c | 54 + trunk/drivers/atm/atmtcp.c | 20 +- trunk/drivers/atm/lanai.c | 102 +- trunk/drivers/base/bus.c | 21 +- trunk/drivers/base/dd.c | 8 +- trunk/drivers/base/firmware_class.c | 15 +- trunk/drivers/base/memory.c | 1 + trunk/drivers/block/Kconfig | 3 +- trunk/drivers/block/cciss.c | 39 +- trunk/drivers/block/cciss_scsi.c | 2 +- trunk/drivers/block/floppy.c | 6 + trunk/drivers/block/pktcdvd.c | 2 +- trunk/drivers/block/ub.c | 439 +- trunk/drivers/bluetooth/bcm203x.c | 1 + trunk/drivers/bluetooth/bfusb.c | 1 + trunk/drivers/bluetooth/bpa10x.c | 1 + trunk/drivers/bluetooth/hci_usb.c | 1 + trunk/drivers/char/Kconfig | 22 +- trunk/drivers/char/agp/amd64-agp.c | 21 +- trunk/drivers/char/agp/backend.c | 2 +- trunk/drivers/char/agp/uninorth-agp.c | 4 - trunk/drivers/char/agp/via-agp.c | 6 - trunk/drivers/char/drm/drm_context.c | 5 +- trunk/drivers/char/drm/drm_lock.c | 16 +- trunk/drivers/char/drm/drm_memory.c | 2 +- trunk/drivers/char/drm/drm_memory_debug.h | 2 +- trunk/drivers/char/drm/mga_drv.c | 2 +- trunk/drivers/char/drm/radeon_cp.c | 2 +- trunk/drivers/char/drm/radeon_drv.h | 4 +- trunk/drivers/char/ip2/i2pack.h | 2 +- trunk/drivers/char/ipmi/ipmi_msghandler.c | 4 +- trunk/drivers/char/ipmi/ipmi_si_intf.c | 8 +- trunk/drivers/char/keyboard.c | 10 +- trunk/drivers/char/mwave/mwavepub.h | 2 +- trunk/drivers/char/pcmcia/Kconfig | 24 - trunk/drivers/char/pcmcia/Makefile | 2 - trunk/drivers/char/pcmcia/cm4000_cs.c | 2079 --- trunk/drivers/char/pcmcia/cm4040_cs.c | 841 -- trunk/drivers/char/pcmcia/cm4040_cs.h | 47 - trunk/drivers/char/random.c | 10 +- trunk/drivers/char/synclink.c | 31 +- trunk/drivers/char/tpm/Kconfig | 2 +- trunk/drivers/char/tpm/tpm.c | 16 +- trunk/drivers/char/tpm/tpm.h | 7 +- trunk/drivers/char/tpm/tpm_atmel.c | 125 +- trunk/drivers/char/tpm/tpm_atmel.h | 131 - trunk/drivers/char/vc_screen.c | 2 +- trunk/drivers/char/watchdog/booke_wdt.c | 17 +- trunk/drivers/char/watchdog/mpcore_wdt.c | 4 + trunk/drivers/char/watchdog/pcwd_usb.c | 1 + trunk/drivers/char/watchdog/wdrtas.c | 2 +- trunk/drivers/connector/cn_proc.c | 5 - trunk/drivers/cpufreq/cpufreq.c | 38 +- trunk/drivers/cpufreq/cpufreq_conservative.c | 10 +- trunk/drivers/cpufreq/cpufreq_ondemand.c | 10 +- trunk/drivers/fc4/Kconfig | 8 +- trunk/drivers/firmware/Kconfig | 1 - trunk/drivers/firmware/dell_rbu.c | 6 +- trunk/drivers/hwmon/hdaps.c | 2 +- trunk/drivers/hwmon/it87.c | 7 - trunk/drivers/hwmon/lm78.c | 2 +- trunk/drivers/hwmon/w83627hf.c | 8 +- trunk/drivers/hwmon/w83792d.c | 25 +- trunk/drivers/i2c/busses/i2c-ixp2000.c | 6 +- trunk/drivers/i2c/busses/i2c-ixp4xx.c | 6 +- trunk/drivers/i2c/busses/i2c-mv64xxx.c | 11 +- trunk/drivers/ide/Kconfig | 16 +- trunk/drivers/ide/Makefile | 2 +- trunk/drivers/ide/ide-cd.c | 13 +- trunk/drivers/ide/ide-cd.h | 1 + trunk/drivers/ide/ide-disk.c | 8 +- trunk/drivers/ide/ide-dma.c | 15 +- trunk/drivers/ide/ide-floppy.c | 7 +- trunk/drivers/ide/ide-io.c | 6 + trunk/drivers/ide/ide-lib.c | 8 +- trunk/drivers/ide/ide-tape.c | 7 +- trunk/drivers/ide/ide-taskfile.c | 27 +- trunk/drivers/ide/mips/Makefile | 4 - trunk/drivers/ide/mips/au1xxx-ide.c | 1498 +- trunk/drivers/ide/mips/swarm.c | 201 - trunk/drivers/ide/pci/aec62xx.c | 47 + trunk/drivers/ide/pci/alim15x3.c | 9 +- trunk/drivers/ide/pci/cs5520.c | 5 +- trunk/drivers/ide/pci/sgiioc4.c | 8 +- trunk/drivers/ide/pci/siimage.c | 8 +- trunk/drivers/ide/pci/sis5513.c | 1 - trunk/drivers/ide/pci/sl82c105.c | 83 +- trunk/drivers/ide/pci/via82cxxx.c | 408 +- trunk/drivers/ide/ppc/pmac.c | 25 +- trunk/drivers/ide/setup-pci.c | 2 +- trunk/drivers/ieee1394/hosts.h | 1 - trunk/drivers/ieee1394/nodemgr.c | 67 +- trunk/drivers/ieee1394/sbp2.c | 6 - trunk/drivers/infiniband/core/mad.c | 4 +- trunk/drivers/infiniband/core/user_mad.c | 43 +- trunk/drivers/infiniband/core/uverbs.h | 11 - trunk/drivers/infiniband/core/uverbs_cmd.c | 90 +- trunk/drivers/infiniband/core/uverbs_main.c | 21 +- trunk/drivers/infiniband/hw/mthca/mthca_qp.c | 71 +- trunk/drivers/infiniband/hw/mthca/mthca_wqe.h | 3 +- trunk/drivers/infiniband/ulp/ipoib/ipoib_ib.c | 4 - .../drivers/infiniband/ulp/ipoib/ipoib_main.c | 13 +- .../infiniband/ulp/ipoib/ipoib_multicast.c | 12 +- trunk/drivers/infiniband/ulp/srp/ib_srp.c | 17 +- trunk/drivers/infiniband/ulp/srp/ib_srp.h | 1 - trunk/drivers/input/gameport/gameport.c | 12 +- trunk/drivers/input/input.c | 63 +- .../input/joystick/iforce/iforce-usb.c | 1 + trunk/drivers/input/joystick/warrior.c | 2 +- trunk/drivers/input/keyboard/atkbd.c | 99 +- trunk/drivers/input/misc/Kconfig | 12 +- trunk/drivers/input/misc/Makefile | 1 - trunk/drivers/input/misc/uinput.c | 325 +- trunk/drivers/input/misc/wistron_btns.c | 561 - trunk/drivers/input/mouse/alps.c | 2 +- trunk/drivers/input/mouse/sermouse.c | 2 +- trunk/drivers/input/serio/i8042.h | 2 +- trunk/drivers/input/serio/serio.c | 12 +- trunk/drivers/isdn/hisax/Kconfig | 12 +- trunk/drivers/isdn/hisax/hfc_usb.c | 33 +- trunk/drivers/isdn/hisax/st5481_init.c | 1 + trunk/drivers/isdn/pcbit/Kconfig | 2 +- trunk/drivers/macintosh/therm_pm72.c | 8 +- trunk/drivers/macintosh/windfarm_pm81.c | 4 +- trunk/drivers/md/bitmap.c | 4 +- trunk/drivers/md/dm-bio-list.h | 3 - trunk/drivers/md/dm-ioctl.c | 3 +- trunk/drivers/md/dm-log.c | 4 +- trunk/drivers/md/dm-mpath.c | 13 +- trunk/drivers/md/dm-raid1.c | 20 +- trunk/drivers/md/dm-table.c | 2 +- trunk/drivers/md/md.c | 42 +- trunk/drivers/md/raid1.c | 13 +- trunk/drivers/md/raid10.c | 6 +- trunk/drivers/md/raid5.c | 9 +- trunk/drivers/md/raid6main.c | 27 +- trunk/drivers/media/common/Kconfig | 6 +- trunk/drivers/media/common/Makefile | 4 +- trunk/drivers/media/common/ir-common.c | 61 - trunk/drivers/media/common/saa7146_core.c | 6 +- trunk/drivers/media/common/saa7146_fops.c | 32 +- trunk/drivers/media/common/saa7146_i2c.c | 16 +- trunk/drivers/media/common/saa7146_vbi.c | 4 +- trunk/drivers/media/common/saa7146_video.c | 46 +- trunk/drivers/media/dvb/b2c2/flexcop-common.h | 2 +- .../drivers/media/dvb/b2c2/flexcop-fe-tuner.c | 4 +- .../media/dvb/b2c2/flexcop-hw-filter.c | 2 +- trunk/drivers/media/dvb/b2c2/flexcop-usb.c | 1 + trunk/drivers/media/dvb/bt8xx/dst_ca.c | 6 +- trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c | 6 +- trunk/drivers/media/dvb/cinergyT2/cinergyT2.c | 12 +- trunk/drivers/media/dvb/dvb-core/demux.h | 92 +- trunk/drivers/media/dvb/dvb-core/dmxdev.c | 2 +- trunk/drivers/media/dvb/dvb-core/dmxdev.h | 64 +- .../media/dvb/dvb-core/dvb_ca_en50221.c | 71 +- trunk/drivers/media/dvb/dvb-core/dvb_filter.c | 332 +- trunk/drivers/media/dvb/dvb-core/dvb_filter.h | 102 +- .../drivers/media/dvb/dvb-core/dvb_frontend.c | 8 +- .../drivers/media/dvb/dvb-core/dvb_frontend.h | 8 +- trunk/drivers/media/dvb/dvb-core/dvb_net.c | 73 +- .../media/dvb/dvb-core/dvb_ringbuffer.c | 262 +- .../media/dvb/dvb-core/dvb_ringbuffer.h | 20 +- trunk/drivers/media/dvb/dvb-core/dvbdev.c | 142 +- trunk/drivers/media/dvb/dvb-core/dvbdev.h | 6 +- trunk/drivers/media/dvb/dvb-usb/a800.c | 3 +- trunk/drivers/media/dvb/dvb-usb/cxusb.c | 1 + .../drivers/media/dvb/dvb-usb/dibusb-common.c | 18 +- trunk/drivers/media/dvb/dvb-usb/dibusb-mb.c | 1 + trunk/drivers/media/dvb/dvb-usb/dibusb-mc.c | 1 + trunk/drivers/media/dvb/dvb-usb/digitv.c | 3 +- trunk/drivers/media/dvb/dvb-usb/dtt200u.c | 1 + .../drivers/media/dvb/dvb-usb/dvb-usb-init.c | 2 +- trunk/drivers/media/dvb/dvb-usb/nova-t-usb2.c | 1 + trunk/drivers/media/dvb/dvb-usb/umt-010.c | 1 + trunk/drivers/media/dvb/dvb-usb/vp702x-fe.c | 2 +- trunk/drivers/media/dvb/dvb-usb/vp702x.c | 1 + trunk/drivers/media/dvb/dvb-usb/vp7045-fe.c | 2 +- trunk/drivers/media/dvb/dvb-usb/vp7045.c | 1 + trunk/drivers/media/dvb/frontends/at76c651.c | 6 +- trunk/drivers/media/dvb/frontends/bcm3510.c | 4 +- trunk/drivers/media/dvb/frontends/cx22700.c | 10 +- trunk/drivers/media/dvb/frontends/cx22702.c | 4 +- trunk/drivers/media/dvb/frontends/cx22702.h | 4 +- trunk/drivers/media/dvb/frontends/cx24110.c | 312 +- trunk/drivers/media/dvb/frontends/l64781.c | 26 +- trunk/drivers/media/dvb/frontends/l64781.h | 2 +- trunk/drivers/media/dvb/frontends/lgdt330x.c | 8 +- trunk/drivers/media/dvb/frontends/mt312.c | 4 +- trunk/drivers/media/dvb/frontends/nxt2002.c | 6 +- trunk/drivers/media/dvb/frontends/nxt200x.c | 6 +- trunk/drivers/media/dvb/frontends/nxt6000.c | 10 +- trunk/drivers/media/dvb/frontends/or51132.c | 2 +- trunk/drivers/media/dvb/frontends/s5h1420.c | 6 +- trunk/drivers/media/dvb/frontends/s5h1420.h | 2 +- trunk/drivers/media/dvb/frontends/sp8870.c | 16 +- trunk/drivers/media/dvb/frontends/sp887x.c | 14 +- trunk/drivers/media/dvb/frontends/stv0299.c | 36 +- trunk/drivers/media/dvb/frontends/tda10021.c | 10 +- trunk/drivers/media/dvb/frontends/tda10021.h | 4 +- trunk/drivers/media/dvb/frontends/tda1004x.c | 2 +- trunk/drivers/media/dvb/frontends/tda8083.c | 20 +- trunk/drivers/media/dvb/frontends/ves1820.c | 14 +- trunk/drivers/media/dvb/ttpci/Kconfig | 1 - trunk/drivers/media/dvb/ttpci/av7110.c | 29 +- trunk/drivers/media/dvb/ttpci/av7110_ca.c | 1 - trunk/drivers/media/dvb/ttpci/av7110_hw.c | 20 +- trunk/drivers/media/dvb/ttpci/av7110_hw.h | 3 +- trunk/drivers/media/dvb/ttpci/av7110_v4l.c | 4 +- trunk/drivers/media/dvb/ttpci/budget-av.c | 2 - trunk/drivers/media/dvb/ttpci/budget-ci.c | 2 +- trunk/drivers/media/dvb/ttpci/budget-core.c | 2 +- trunk/drivers/media/dvb/ttpci/budget-patch.c | 326 +- trunk/drivers/media/dvb/ttpci/budget.c | 8 +- trunk/drivers/media/dvb/ttpci/budget.h | 2 +- trunk/drivers/media/dvb/ttpci/fdump.c | 2 +- trunk/drivers/media/dvb/ttpci/ttpci-eeprom.c | 41 +- .../media/dvb/ttusb-budget/dvb-ttusb-budget.c | 128 +- .../dvb/ttusb-budget/dvb-ttusb-dspbootcode.h | 3276 ++-- trunk/drivers/media/dvb/ttusb-dec/ttusb_dec.c | 4 +- trunk/drivers/media/video/Kconfig | 33 +- trunk/drivers/media/video/Makefile | 5 +- trunk/drivers/media/video/bt832.c | 14 +- trunk/drivers/media/video/bttv-cards.c | 30 +- trunk/drivers/media/video/bttv-driver.c | 153 +- trunk/drivers/media/video/bttv-gpio.c | 18 - trunk/drivers/media/video/bttv.h | 3 - trunk/drivers/media/video/bttvp.h | 3 - trunk/drivers/media/video/cpia_usb.c | 1 + trunk/drivers/media/video/cx25840/Makefile | 6 - .../media/video/cx25840/cx25840-audio.c | 368 - .../media/video/cx25840/cx25840-core.c | 1056 -- .../media/video/cx25840/cx25840-firmware.c | 167 - .../drivers/media/video/cx25840/cx25840-vbi.c | 315 - trunk/drivers/media/video/cx25840/cx25840.h | 92 - trunk/drivers/media/video/cx88/Kconfig | 20 +- trunk/drivers/media/video/cx88/Makefile | 27 +- .../drivers/media/video/cx88/cx88-blackbird.c | 2 - trunk/drivers/media/video/cx88/cx88-cards.c | 45 +- trunk/drivers/media/video/cx88/cx88-core.c | 35 +- trunk/drivers/media/video/cx88/cx88-dvb.c | 3 + trunk/drivers/media/video/cx88/cx88-input.c | 2 + trunk/drivers/media/video/cx88/cx88-tvaudio.c | 28 +- trunk/drivers/media/video/cx88/cx88.h | 5 +- .../drivers/media/video/em28xx/em28xx-core.c | 56 +- trunk/drivers/media/video/em28xx/em28xx-i2c.c | 2 +- .../drivers/media/video/em28xx/em28xx-input.c | 3 + .../drivers/media/video/em28xx/em28xx-video.c | 24 +- trunk/drivers/media/video/ir-kbd-gpio.c | 293 +- trunk/drivers/media/video/ir-kbd-i2c.c | 63 +- trunk/drivers/media/video/msp3400.c | 18 +- trunk/drivers/media/video/saa6588.c | 1 + trunk/drivers/media/video/saa7115.c | 1378 -- trunk/drivers/media/video/saa711x.c | 5 +- trunk/drivers/media/video/saa7127.c | 849 -- trunk/drivers/media/video/saa7134/Kconfig | 37 +- trunk/drivers/media/video/saa7134/Makefile | 29 +- trunk/drivers/media/video/saa7134/saa6752hs.c | 17 +- .../media/video/saa7134/saa7134-alsa.c | 484 +- .../media/video/saa7134/saa7134-cards.c | 34 +- .../media/video/saa7134/saa7134-core.c | 147 +- .../media/video/saa7134/saa7134-empress.c | 1 - .../drivers/media/video/saa7134/saa7134-i2c.c | 2 +- .../media/video/saa7134/saa7134-input.c | 111 +- .../drivers/media/video/saa7134/saa7134-oss.c | 187 +- trunk/drivers/media/video/saa7134/saa7134.h | 6 - trunk/drivers/media/video/tda8290.c | 4 - trunk/drivers/media/video/tda9887.c | 15 +- trunk/drivers/media/video/tuner-core.c | 11 +- trunk/drivers/media/video/tuner-simple.c | 4 +- trunk/drivers/media/video/tvaudio.c | 30 +- trunk/drivers/media/video/tveeprom.c | 69 +- trunk/drivers/media/video/tvp5150.c | 3 +- trunk/drivers/media/video/video-buf-dvb.c | 2 - trunk/drivers/media/video/video-buf.c | 9 +- trunk/drivers/media/video/videodev.c | 26 +- trunk/drivers/media/video/wm8775.c | 7 +- trunk/drivers/message/fusion/mptbase.c | 84 +- trunk/drivers/message/fusion/mptbase.h | 39 +- trunk/drivers/message/fusion/mptctl.c | 4 +- trunk/drivers/message/fusion/mptfc.c | 24 +- trunk/drivers/message/fusion/mptsas.c | 55 +- trunk/drivers/message/fusion/mptscsih.c | 978 +- trunk/drivers/message/fusion/mptscsih.h | 2 - trunk/drivers/message/fusion/mptspi.c | 24 +- trunk/drivers/message/i2o/pci.c | 8 +- trunk/drivers/mfd/ucb1x00-ts.c | 19 +- trunk/drivers/mmc/mmc.c | 17 +- trunk/drivers/mmc/mmc_block.c | 14 +- trunk/drivers/mmc/mmci.c | 1 + trunk/drivers/mtd/chips/cfi_cmdset_0001.c | 10 +- trunk/drivers/mtd/chips/cfi_probe.c | 8 +- trunk/drivers/mtd/chips/sharp.c | 123 +- trunk/drivers/mtd/devices/blkmtd.c | 8 +- trunk/drivers/mtd/devices/block2mtd.c | 6 +- trunk/drivers/mtd/devices/ms02-nv.c | 6 +- trunk/drivers/mtd/ftl.c | 6 +- trunk/drivers/mtd/maps/Kconfig | 8 +- trunk/drivers/mtd/maps/Makefile | 1 + trunk/drivers/mtd/maps/ipaq-flash.c | 6 +- trunk/drivers/mtd/maps/ixp2000.c | 22 +- trunk/drivers/mtd/maps/ixp4xx.c | 78 +- trunk/drivers/mtd/maps/nettel.c | 4 +- trunk/drivers/mtd/maps/pci.c | 4 +- trunk/drivers/mtd/maps/physmap.c | 3 +- trunk/drivers/mtd/maps/sc520cdp.c | 4 +- trunk/drivers/mtd/nand/h1910.c | 2 +- trunk/drivers/mtd/nand/nandsim.c | 2 +- trunk/drivers/mtd/onenand/generic.c | 4 +- trunk/drivers/mtd/onenand/onenand_base.c | 53 +- trunk/drivers/mtd/onenand/onenand_bbt.c | 4 +- trunk/drivers/mtd/rfd_ftl.c | 6 +- trunk/drivers/net/3c509.c | 13 +- trunk/drivers/net/8139too.c | 86 +- trunk/drivers/net/Kconfig | 17 +- trunk/drivers/net/Makefile | 7 +- trunk/drivers/net/au1000_eth.c | 1 - trunk/drivers/net/b44.c | 13 +- trunk/drivers/net/bonding/Makefile | 2 +- trunk/drivers/net/bonding/bond_3ad.c | 106 +- trunk/drivers/net/bonding/bond_3ad.h | 13 + trunk/drivers/net/bonding/bond_alb.c | 75 +- trunk/drivers/net/bonding/bond_alb.h | 9 + trunk/drivers/net/bonding/bond_main.c | 781 +- trunk/drivers/net/bonding/bond_sysfs.c | 1358 -- trunk/drivers/net/bonding/bonding.h | 52 +- trunk/drivers/net/chelsio/sge.c | 19 +- trunk/drivers/net/chelsio/sge.h | 2 + trunk/drivers/net/dgrs.c | 2 - trunk/drivers/net/e100.c | 275 +- trunk/drivers/net/e1000/e1000.h | 4 +- trunk/drivers/net/e1000/e1000_ethtool.c | 111 +- trunk/drivers/net/e1000/e1000_hw.c | 67 +- trunk/drivers/net/e1000/e1000_hw.h | 4 +- trunk/drivers/net/e1000/e1000_main.c | 78 +- trunk/drivers/net/fec_8xx/Kconfig | 2 +- trunk/drivers/net/forcedeth.c | 15 +- trunk/drivers/net/gianfar.c | 233 +- trunk/drivers/net/gianfar.h | 71 +- trunk/drivers/net/gianfar_ethtool.c | 4 +- trunk/drivers/net/gianfar_mii.c | 2 +- trunk/drivers/net/gianfar_mii.h | 3 +- trunk/drivers/net/gianfar_sysfs.c | 311 - trunk/drivers/net/ibm_emac/ibm_emac_core.c | 38 +- trunk/drivers/net/ibm_emac/ibm_emac_core.h | 2 - trunk/drivers/net/ioc3-eth.c | 2 +- trunk/drivers/net/irda/ali-ircc.c | 1 - trunk/drivers/net/irda/irda-usb.c | 1 + trunk/drivers/net/irda/nsc-ircc.c | 1 - trunk/drivers/net/irda/stir4200.c | 1 + trunk/drivers/net/ixp2000/Kconfig | 6 - trunk/drivers/net/ixp2000/Makefile | 3 - trunk/drivers/net/ixp2000/caleb.c | 137 - trunk/drivers/net/ixp2000/caleb.h | 22 - trunk/drivers/net/ixp2000/enp2611.c | 245 - trunk/drivers/net/ixp2000/ixp2400-msf.c | 213 - trunk/drivers/net/ixp2000/ixp2400-msf.h | 115 - trunk/drivers/net/ixp2000/ixp2400_rx.uc | 408 - trunk/drivers/net/ixp2000/ixp2400_rx.ucode | 130 - trunk/drivers/net/ixp2000/ixp2400_tx.uc | 272 - trunk/drivers/net/ixp2000/ixp2400_tx.ucode | 98 - trunk/drivers/net/ixp2000/ixpdev.c | 421 - trunk/drivers/net/ixp2000/ixpdev.h | 27 - trunk/drivers/net/ixp2000/ixpdev_priv.h | 57 - trunk/drivers/net/ixp2000/pm3386.c | 334 - trunk/drivers/net/ixp2000/pm3386.h | 28 - trunk/drivers/net/jazzsonic.c | 4 +- trunk/drivers/net/mipsnet.h | 30 +- trunk/drivers/net/ns83820.c | 1 - trunk/drivers/net/pcmcia/fmvj18x_cs.c | 32 +- trunk/drivers/net/pcnet32.c | 5 + trunk/drivers/net/phy/phy_device.c | 4 - trunk/drivers/net/ppp_generic.c | 3 + trunk/drivers/net/pppoe.c | 31 +- trunk/drivers/net/pppox.c | 10 +- trunk/drivers/net/r8169.c | 6 +- trunk/drivers/net/s2io.c | 210 +- trunk/drivers/net/s2io.h | 3 - trunk/drivers/net/saa9730.h | 36 +- trunk/drivers/net/sis900.c | 73 +- trunk/drivers/net/sis900.h | 45 - trunk/drivers/net/sk98lin/Makefile | 6 +- trunk/drivers/net/sk98lin/h/skdrv2nd.h | 13 +- trunk/drivers/net/sk98lin/h/skvpd.h | 8 + trunk/drivers/net/sk98lin/skcsum.c | 871 ++ trunk/drivers/net/sk98lin/skethtool.c | 50 - trunk/drivers/net/sk98lin/skge.c | 385 +- trunk/drivers/net/sk98lin/skproc.c | 265 + trunk/drivers/net/skge.c | 95 +- trunk/drivers/net/skge.h | 73 +- trunk/drivers/net/sky2.c | 3262 ---- trunk/drivers/net/sky2.h | 1922 --- trunk/drivers/net/smc91x.c | 17 +- trunk/drivers/net/smc91x.h | 16 +- trunk/drivers/net/sungem.c | 6 +- trunk/drivers/net/tg3.c | 269 +- trunk/drivers/net/tg3.h | 14 - trunk/drivers/net/wan/hdlc_cisco.c | 6 - trunk/drivers/net/wan/hdlc_fr.c | 4 - trunk/drivers/net/wan/hdlc_generic.c | 6 - trunk/drivers/net/wan/lmc/lmc_prot.h | 15 + trunk/drivers/net/wan/sdladrv.c | 2 +- trunk/drivers/net/wireless/Kconfig | 6 +- trunk/drivers/net/wireless/airo.c | 19 +- trunk/drivers/net/wireless/atmel.c | 1490 +- trunk/drivers/net/wireless/hermes.c | 6 +- trunk/drivers/net/wireless/hermes.h | 6 +- trunk/drivers/net/wireless/hostap/Makefile | 1 - .../hostap/{hostap_main.c => hostap.c} | 0 trunk/drivers/net/wireless/i82593.h | 11 +- trunk/drivers/net/wireless/ipw2100.c | 69 +- trunk/drivers/net/wireless/ipw2100.h | 4 +- trunk/drivers/net/wireless/ipw2200.c | 43 +- trunk/drivers/net/wireless/ipw2200.h | 6 +- trunk/drivers/net/wireless/orinoco.c | 3 +- trunk/drivers/net/wireless/orinoco_nortel.c | 6 +- trunk/drivers/net/wireless/prism54/isl_38xx.c | 4 +- trunk/drivers/parisc/iosapic.c | 26 +- trunk/drivers/parisc/superio.c | 35 +- trunk/drivers/pci/Makefile | 7 +- trunk/drivers/pci/hotplug/pciehp.h | 1 + trunk/drivers/pci/hotplug/pciehp_ctrl.c | 15 +- trunk/drivers/pci/hotplug/pciehp_hpc.c | 12 +- trunk/drivers/pci/hotplug/rpaphp_pci.c | 2 +- trunk/drivers/pci/hotplug/shpchp_hpc.c | 2 - trunk/drivers/pci/pci-acpi.c | 1 - trunk/drivers/pcmcia/cs.c | 6 - trunk/drivers/pcmcia/ds.c | 3 - trunk/drivers/pcmcia/i82365.c | 20 +- trunk/drivers/pcmcia/m32r_cfc.c | 3 +- trunk/drivers/s390/char/raw3270.c | 4 +- trunk/drivers/s390/net/qeth_eddp.c | 3 +- trunk/drivers/s390/net/qeth_main.c | 61 +- trunk/drivers/s390/net/qeth_mpc.c | 2 +- trunk/drivers/s390/net/qeth_mpc.h | 4 +- trunk/drivers/s390/net/qeth_proc.c | 250 +- trunk/drivers/s390/net/qeth_sys.c | 6 +- trunk/drivers/s390/net/qeth_tso.h | 4 +- trunk/drivers/s390/scsi/zfcp_aux.c | 14 - trunk/drivers/s390/scsi/zfcp_dbf.c | 4 + trunk/drivers/s390/scsi/zfcp_erp.c | 94 +- trunk/drivers/s390/scsi/zfcp_fsf.c | 110 +- trunk/drivers/s390/scsi/zfcp_scsi.c | 2 +- trunk/drivers/sbus/char/aurora.c | 12 +- trunk/drivers/sbus/char/jsflash.c | 19 +- trunk/drivers/sbus/char/uctrl.c | 10 +- trunk/drivers/sbus/char/vfc.h | 2 +- trunk/drivers/sbus/char/vfc_dev.c | 6 +- trunk/drivers/scsi/53c700.c | 6 +- trunk/drivers/scsi/53c700.h | 22 +- trunk/drivers/scsi/53c7xx.c | 7 +- trunk/drivers/scsi/Kconfig | 15 +- trunk/drivers/scsi/NCR5380.c | 7 +- trunk/drivers/scsi/aacraid/linit.c | 2 - trunk/drivers/scsi/aha152x.c | 7 +- trunk/drivers/scsi/ahci.c | 33 +- trunk/drivers/scsi/aic7xxx/aic79xx_osm.c | 13 +- trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c | 20 +- trunk/drivers/scsi/arm/Kconfig | 1 - trunk/drivers/scsi/arm/acornscsi.c | 7 +- trunk/drivers/scsi/ata_piix.c | 2 +- trunk/drivers/scsi/atari_NCR5380.c | 7 +- trunk/drivers/scsi/ch.c | 4 +- trunk/drivers/scsi/constants.c | 118 +- trunk/drivers/scsi/dpt_i2o.c | 34 +- trunk/drivers/scsi/ibmvscsi/ibmvscsi.h | 2 +- trunk/drivers/scsi/ibmvscsi/iseries_vscsi.c | 3 +- trunk/drivers/scsi/ibmvscsi/rpa_vscsi.c | 8 +- trunk/drivers/scsi/ide-scsi.c | 2 +- trunk/drivers/scsi/ipr.c | 17 +- trunk/drivers/scsi/ipr.h | 5 +- trunk/drivers/scsi/iscsi_tcp.c | 123 +- trunk/drivers/scsi/iscsi_tcp.h | 3 +- trunk/drivers/scsi/libata-core.c | 42 +- trunk/drivers/scsi/libata-scsi.c | 21 +- trunk/drivers/scsi/libata.h | 2 +- trunk/drivers/scsi/lpfc/lpfc.h | 14 +- trunk/drivers/scsi/lpfc/lpfc_attr.c | 92 +- trunk/drivers/scsi/lpfc/lpfc_crtn.h | 3 - trunk/drivers/scsi/lpfc/lpfc_disc.h | 2 - trunk/drivers/scsi/lpfc/lpfc_els.c | 4 - trunk/drivers/scsi/lpfc/lpfc_hbadisc.c | 18 +- trunk/drivers/scsi/lpfc/lpfc_hw.h | 40 +- trunk/drivers/scsi/lpfc/lpfc_init.c | 183 +- trunk/drivers/scsi/lpfc/lpfc_nportdisc.c | 69 +- trunk/drivers/scsi/lpfc/lpfc_scsi.c | 295 +- trunk/drivers/scsi/lpfc/lpfc_sli.c | 217 +- trunk/drivers/scsi/lpfc/lpfc_version.h | 2 +- trunk/drivers/scsi/megaraid.c | 58 +- trunk/drivers/scsi/megaraid/Kconfig.megaraid | 2 + trunk/drivers/scsi/megaraid/megaraid_mbox.c | 82 +- trunk/drivers/scsi/megaraid/megaraid_mbox.h | 4 +- trunk/drivers/scsi/ncr53c8xx.c | 749 +- trunk/drivers/scsi/ncr53c8xx.h | 1263 +- trunk/drivers/scsi/qla2xxx/Kconfig | 69 +- trunk/drivers/scsi/qla2xxx/Makefile | 5 +- trunk/drivers/scsi/qla2xxx/ql2400.c | 111 - trunk/drivers/scsi/qla2xxx/ql2400_fw.c | 12376 ---------------- trunk/drivers/scsi/qla2xxx/qla_attr.c | 2 +- trunk/drivers/scsi/qla2xxx/qla_def.h | 34 +- trunk/drivers/scsi/qla2xxx/qla_gbl.h | 4 +- trunk/drivers/scsi/qla2xxx/qla_init.c | 254 +- trunk/drivers/scsi/qla2xxx/qla_isr.c | 15 - trunk/drivers/scsi/qla2xxx/qla_os.c | 196 +- trunk/drivers/scsi/raid_class.c | 2 +- trunk/drivers/scsi/sata_mv.c | 997 +- trunk/drivers/scsi/sata_promise.c | 14 +- trunk/drivers/scsi/sata_qstor.c | 2 +- trunk/drivers/scsi/sata_sil24.c | 218 +- trunk/drivers/scsi/sata_svw.c | 2 +- trunk/drivers/scsi/sata_sx4.c | 5 +- trunk/drivers/scsi/sata_vsc.c | 2 +- trunk/drivers/scsi/scsi.c | 2 +- trunk/drivers/scsi/scsi_devinfo.c | 5 +- trunk/drivers/scsi/scsi_error.c | 54 +- trunk/drivers/scsi/scsi_lib.c | 289 +- trunk/drivers/scsi/scsi_priv.h | 4 +- trunk/drivers/scsi/scsi_scan.c | 54 +- trunk/drivers/scsi/scsi_sysfs.c | 4 +- trunk/drivers/scsi/scsi_transport_fc.c | 67 +- trunk/drivers/scsi/scsi_transport_iscsi.c | 2 +- trunk/drivers/scsi/scsi_transport_spi.c | 164 +- trunk/drivers/scsi/sd.c | 20 +- trunk/drivers/scsi/sg.c | 692 +- trunk/drivers/scsi/sr.c | 22 +- trunk/drivers/scsi/sr_vendor.c | 4 +- trunk/drivers/scsi/st.c | 299 +- trunk/drivers/scsi/st.h | 14 +- trunk/drivers/scsi/sun3_NCR5380.c | 7 +- trunk/drivers/scsi/sym53c8xx_2/sym_defs.h | 2 +- trunk/drivers/scsi/sym53c8xx_2/sym_fw.c | 18 + trunk/drivers/scsi/sym53c8xx_2/sym_fw.h | 6 + trunk/drivers/scsi/sym53c8xx_2/sym_fw1.h | 48 + trunk/drivers/scsi/sym53c8xx_2/sym_fw2.h | 52 + trunk/drivers/scsi/sym53c8xx_2/sym_glue.c | 122 +- trunk/drivers/scsi/sym53c8xx_2/sym_glue.h | 2 + trunk/drivers/scsi/sym53c8xx_2/sym_hipd.c | 168 +- trunk/drivers/scsi/sym53c8xx_2/sym_hipd.h | 104 +- trunk/drivers/scsi/sym53c8xx_2/sym_malloc.c | 4 + trunk/drivers/scsi/sym53c8xx_2/sym_nvram.c | 29 +- trunk/drivers/scsi/sym53c8xx_2/sym_nvram.h | 4 +- trunk/drivers/scsi/sym53c8xx_comm.h | 792 + trunk/drivers/scsi/sym53c8xx_defs.h | 1320 ++ trunk/drivers/serial/68328serial.c | 7 +- trunk/drivers/serial/8250.c | 7 +- trunk/drivers/serial/8250_pci.c | 4 +- trunk/drivers/serial/8250_pnp.c | 2 - trunk/drivers/serial/Kconfig | 12 +- trunk/drivers/serial/amba-pl011.c | 47 +- trunk/drivers/serial/cpm_uart/cpm_uart_core.c | 2 +- trunk/drivers/serial/cpm_uart/cpm_uart_cpm1.c | 2 +- trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c | 2 +- trunk/drivers/serial/dz.c | 48 +- trunk/drivers/serial/imx.c | 2 +- trunk/drivers/serial/mpc52xx_uart.c | 4 +- trunk/drivers/serial/mux.c | 19 +- trunk/drivers/serial/pxa.c | 4 +- trunk/drivers/serial/sa1100.c | 5 +- trunk/drivers/serial/serial_core.c | 86 +- trunk/drivers/serial/serial_cs.c | 6 +- trunk/drivers/tc/zs.c | 150 +- trunk/drivers/tc/zs.h | 13 +- trunk/drivers/usb/Makefile | 1 - trunk/drivers/usb/atm/Kconfig | 13 - trunk/drivers/usb/atm/Makefile | 5 - trunk/drivers/usb/atm/cxacru.c | 4 +- trunk/drivers/usb/atm/speedtch.c | 1 + trunk/drivers/usb/atm/ueagle-atm.c | 1820 --- trunk/drivers/usb/atm/usbatm.c | 8 +- trunk/drivers/usb/atm/usbatm.h | 5 + trunk/drivers/usb/atm/xusbatm.c | 1 + trunk/drivers/usb/class/audio.c | 1 + trunk/drivers/usb/class/cdc-acm.c | 232 +- trunk/drivers/usb/class/cdc-acm.h | 33 +- trunk/drivers/usb/class/usb-midi.c | 1 + trunk/drivers/usb/class/usblp.c | 45 +- trunk/drivers/usb/core/Makefile | 6 +- trunk/drivers/usb/core/buffer.c | 11 +- trunk/drivers/usb/core/config.c | 5 + trunk/drivers/usb/core/devices.c | 24 +- trunk/drivers/usb/core/devio.c | 9 +- trunk/drivers/usb/core/driver.c | 472 - trunk/drivers/usb/core/file.c | 6 + trunk/drivers/usb/core/hcd-pci.c | 48 +- trunk/drivers/usb/core/hcd.c | 30 +- trunk/drivers/usb/core/hcd.h | 8 +- trunk/drivers/usb/core/hub.c | 492 +- trunk/drivers/usb/core/hub.h | 3 +- trunk/drivers/usb/core/inode.c | 7 +- trunk/drivers/usb/core/message.c | 16 +- trunk/drivers/usb/core/notify.c | 6 + trunk/drivers/usb/core/sysfs.c | 7 + trunk/drivers/usb/core/urb.c | 6 + trunk/drivers/usb/core/usb.c | 478 +- trunk/drivers/usb/core/usb.h | 6 +- trunk/drivers/usb/gadget/dummy_hcd.c | 91 +- trunk/drivers/usb/gadget/file_storage.c | 93 +- trunk/drivers/usb/gadget/serial.c | 2 - trunk/drivers/usb/host/Makefile | 4 - trunk/drivers/usb/host/ehci-hcd.c | 169 +- trunk/drivers/usb/host/ehci-hub.c | 11 +- trunk/drivers/usb/host/ehci-pci.c | 399 +- trunk/drivers/usb/host/ehci-q.c | 38 +- trunk/drivers/usb/host/ehci-sched.c | 18 +- trunk/drivers/usb/host/isp116x-hcd.c | 422 +- trunk/drivers/usb/host/isp116x.h | 83 +- trunk/drivers/usb/host/ohci-hcd.c | 20 +- trunk/drivers/usb/host/ohci-hub.c | 26 +- trunk/drivers/usb/host/ohci-lh7a404.c | 2 +- trunk/drivers/usb/host/ohci-pci.c | 59 +- trunk/drivers/usb/host/ohci-ppc-soc.c | 2 +- trunk/drivers/usb/host/ohci-pxa27x.c | 121 +- trunk/drivers/usb/host/pci-quirks.c | 6 + trunk/drivers/usb/host/sl811-hcd.c | 14 +- trunk/drivers/usb/host/sl811_cs.c | 5 +- trunk/drivers/usb/host/uhci-debug.c | 14 +- trunk/drivers/usb/host/uhci-hcd.c | 36 +- trunk/drivers/usb/host/uhci-hcd.h | 32 +- trunk/drivers/usb/host/uhci-q.c | 30 +- trunk/drivers/usb/image/mdc800.c | 1 + trunk/drivers/usb/image/microtek.c | 36 +- trunk/drivers/usb/image/microtek.h | 2 +- trunk/drivers/usb/input/Kconfig | 14 - trunk/drivers/usb/input/Makefile | 5 - trunk/drivers/usb/input/acecad.c | 1 + trunk/drivers/usb/input/aiptek.c | 9 +- trunk/drivers/usb/input/appletouch.c | 1 + trunk/drivers/usb/input/ati_remote.c | 22 +- trunk/drivers/usb/input/ati_remote2.c | 477 - trunk/drivers/usb/input/fixp-arith.h | 2 +- trunk/drivers/usb/input/hid-core.c | 19 +- trunk/drivers/usb/input/hid-input.c | 5 +- trunk/drivers/usb/input/hiddev.c | 1 + trunk/drivers/usb/input/itmtouch.c | 8 + trunk/drivers/usb/input/kbtab.c | 3 +- trunk/drivers/usb/input/keyspan_remote.c | 8 +- trunk/drivers/usb/input/mtouchusb.c | 8 + trunk/drivers/usb/input/pid.c | 2 + trunk/drivers/usb/input/powermate.c | 1 + trunk/drivers/usb/input/touchkitusb.c | 153 +- trunk/drivers/usb/input/usbkbd.c | 1 + trunk/drivers/usb/input/usbmouse.c | 1 + trunk/drivers/usb/input/wacom.c | 136 +- trunk/drivers/usb/input/xpad.c | 7 +- trunk/drivers/usb/input/yealink.c | 1 + trunk/drivers/usb/media/dabusb.c | 1 + trunk/drivers/usb/media/dsbr100.c | 1 + trunk/drivers/usb/media/ibmcam.c | 2 +- trunk/drivers/usb/media/konicawc.c | 6 +- trunk/drivers/usb/media/ov511.c | 3 +- trunk/drivers/usb/media/pwc/pwc-ctrl.c | 2 +- trunk/drivers/usb/media/pwc/pwc-if.c | 1 + trunk/drivers/usb/media/se401.c | 1 + trunk/drivers/usb/media/sn9c102_core.c | 26 +- trunk/drivers/usb/media/stv680.c | 1 + trunk/drivers/usb/media/stv680.h | 6 +- trunk/drivers/usb/media/usbvideo.c | 4 +- trunk/drivers/usb/media/vicam.c | 1 + trunk/drivers/usb/media/w9968cf.c | 7 +- trunk/drivers/usb/misc/Makefile | 6 +- trunk/drivers/usb/misc/auerswald.c | 8 +- trunk/drivers/usb/misc/cytherm.c | 1 + trunk/drivers/usb/misc/emi26.c | 1 + trunk/drivers/usb/misc/emi62.c | 1 + trunk/drivers/usb/misc/idmouse.c | 1 + trunk/drivers/usb/misc/ldusb.c | 1 + trunk/drivers/usb/misc/legousbtower.c | 1 + trunk/drivers/usb/misc/phidgetkit.c | 1 + trunk/drivers/usb/misc/phidgetservo.c | 4 + trunk/drivers/usb/misc/rio500.c | 7 +- trunk/drivers/usb/misc/sisusbvga/sisusb.c | 11 +- trunk/drivers/usb/misc/usblcd.c | 1 + trunk/drivers/usb/misc/usbled.c | 4 + trunk/drivers/usb/misc/usbtest.c | 4 + trunk/drivers/usb/misc/uss720.c | 3 + trunk/drivers/usb/mon/mon_text.c | 19 +- trunk/drivers/usb/net/Makefile | 4 - trunk/drivers/usb/net/asix.c | 8 +- trunk/drivers/usb/net/catc.c | 1 + trunk/drivers/usb/net/cdc_ether.c | 4 + trunk/drivers/usb/net/cdc_subset.c | 4 + trunk/drivers/usb/net/gl620a.c | 4 + trunk/drivers/usb/net/kaweth.c | 14 +- trunk/drivers/usb/net/net1080.c | 4 + trunk/drivers/usb/net/pegasus.c | 146 +- trunk/drivers/usb/net/plusb.c | 4 + trunk/drivers/usb/net/rndis_host.c | 4 + trunk/drivers/usb/net/rtl8150.c | 1 + trunk/drivers/usb/net/usbnet.c | 3 + trunk/drivers/usb/net/zaurus.c | 4 + trunk/drivers/usb/net/zd1201.c | 11 +- .../{ChangeLog.history => ChangeLog.old} | 2 +- trunk/drivers/usb/serial/Kconfig | 18 +- trunk/drivers/usb/serial/Makefile | 2 +- trunk/drivers/usb/serial/airprime.c | 2 +- trunk/drivers/usb/serial/anydata.c | 123 - trunk/drivers/usb/serial/belkin_sa.c | 2 +- trunk/drivers/usb/serial/cp2101.c | 3 +- trunk/drivers/usb/serial/cyberjack.c | 2 +- trunk/drivers/usb/serial/cypress_m8.c | 1 - trunk/drivers/usb/serial/digi_acceleport.c | 2 +- trunk/drivers/usb/serial/empeg.c | 2 +- trunk/drivers/usb/serial/ftdi_sio.c | 8 +- trunk/drivers/usb/serial/ftdi_sio.h | 20 - trunk/drivers/usb/serial/garmin_gps.c | 2 +- trunk/drivers/usb/serial/generic.c | 3 +- trunk/drivers/usb/serial/hp4x.c | 2 +- trunk/drivers/usb/serial/io_edgeport.c | 6 +- trunk/drivers/usb/serial/io_edgeport.h | 3 + trunk/drivers/usb/serial/io_fw_boot2.h | 2 +- trunk/drivers/usb/serial/io_ti.c | 4 +- trunk/drivers/usb/serial/ipaq.c | 2 +- trunk/drivers/usb/serial/ipw.c | 3 +- trunk/drivers/usb/serial/ir-usb.c | 2 +- trunk/drivers/usb/serial/keyspan.h | 2 +- trunk/drivers/usb/serial/keyspan_pda.c | 2 +- trunk/drivers/usb/serial/kl5kusb105.c | 2 +- trunk/drivers/usb/serial/kobil_sct.c | 2 +- trunk/drivers/usb/serial/mct_u232.c | 2 +- trunk/drivers/usb/serial/nokia_dku2.c | 142 + trunk/drivers/usb/serial/omninet.c | 2 +- trunk/drivers/usb/serial/option.c | 2 +- trunk/drivers/usb/serial/pl2303.c | 10 +- trunk/drivers/usb/serial/pl2303.h | 2 - trunk/drivers/usb/serial/safe_serial.c | 6 +- trunk/drivers/usb/serial/ti_usb_3410_5052.c | 9 +- trunk/drivers/usb/serial/usb-serial.c | 48 +- trunk/drivers/usb/serial/usb-serial.h | 4 - trunk/drivers/usb/serial/visor.c | 2 +- trunk/drivers/usb/serial/whiteheat.c | 2 +- trunk/drivers/usb/storage/Kconfig | 25 +- trunk/drivers/usb/storage/Makefile | 5 - trunk/drivers/usb/storage/alauda.c | 1119 -- trunk/drivers/usb/storage/alauda.h | 100 - trunk/drivers/usb/storage/debug.c | 1 - trunk/drivers/usb/storage/initializers.h | 4 + trunk/drivers/usb/storage/libusual.c | 266 - trunk/drivers/usb/storage/onetouch.c | 27 - trunk/drivers/usb/storage/protocol.h | 14 + trunk/drivers/usb/storage/scsiglue.c | 4 +- trunk/drivers/usb/storage/sddr09.c | 214 +- trunk/drivers/usb/storage/sddr09.h | 15 +- trunk/drivers/usb/storage/shuttle_usbat.c | 2 +- trunk/drivers/usb/storage/transport.h | 31 + trunk/drivers/usb/storage/unusual_devs.h | 93 +- trunk/drivers/usb/storage/usb.c | 160 +- trunk/drivers/usb/storage/usb.h | 40 +- trunk/drivers/usb/usb-skeleton.c | 29 +- trunk/drivers/video/Kconfig | 21 +- trunk/drivers/video/arcfb.c | 2 +- trunk/drivers/video/bw2.c | 1 + trunk/drivers/video/cfbcopyarea.c | 8 +- trunk/drivers/video/cfbfillrect.c | 16 +- trunk/drivers/video/cfbimgblt.c | 35 +- trunk/drivers/video/cg14.c | 1 + trunk/drivers/video/cg3.c | 1 + trunk/drivers/video/cg6.c | 3 +- trunk/drivers/video/cirrusfb.c | 15 +- trunk/drivers/video/console/Kconfig | 20 +- trunk/drivers/video/console/fbcon.c | 57 +- trunk/drivers/video/console/fbcon.h | 3 +- trunk/drivers/video/console/fbcon_ccw.c | 16 +- trunk/drivers/video/console/fbcon_cw.c | 14 +- trunk/drivers/video/console/fbcon_rotate.h | 17 +- trunk/drivers/video/console/fbcon_ud.c | 30 +- trunk/drivers/video/console/vgacon.c | 1 - trunk/drivers/video/cyber2000fb.c | 4 +- trunk/drivers/video/fbmem.c | 32 +- trunk/drivers/video/ffb.c | 1 + trunk/drivers/video/intelfb/intelfb.h | 5 - trunk/drivers/video/intelfb/intelfbdrv.c | 51 +- trunk/drivers/video/leo.c | 1 + trunk/drivers/video/logo/Kconfig | 2 +- trunk/drivers/video/nvidia/nv_proto.h | 2 +- trunk/drivers/video/nvidia/nvidia.c | 2 +- trunk/drivers/video/offb.c | 41 +- trunk/drivers/video/p9100.c | 1 + trunk/drivers/video/pxafb.c | 3 +- trunk/drivers/video/sbuslib.c | 3 - trunk/drivers/video/tcx.c | 3 +- trunk/drivers/video/vesafb.c | 2 - trunk/drivers/video/w100fb.c | 2 +- trunk/drivers/w1/dscore.c | 1 + trunk/fs/9p/trans_sock.c | 1 - trunk/fs/9p/vfs_inode.c | 2 - trunk/fs/aio.c | 44 +- trunk/fs/bio.c | 38 +- trunk/fs/cifs/CHANGES | 6 +- trunk/fs/cifs/README | 30 +- trunk/fs/cifs/TODO | 4 +- trunk/fs/cifs/cifs_unicode.c | 13 +- trunk/fs/cifs/cifs_unicode.h | 6 +- trunk/fs/cifs/cifsencrypt.c | 2 +- trunk/fs/cifs/cifsfs.c | 130 +- trunk/fs/cifs/cifsfs.h | 2 - trunk/fs/cifs/cifspdu.h | 10 +- trunk/fs/cifs/cifssmb.c | 68 +- trunk/fs/cifs/connect.c | 91 +- trunk/fs/cifs/dir.c | 66 +- trunk/fs/cifs/file.c | 2 - trunk/fs/cifs/inode.c | 252 +- trunk/fs/cifs/misc.c | 19 +- trunk/fs/cifs/netmisc.c | 4 +- trunk/fs/cifs/readdir.c | 43 +- trunk/fs/cifs/transport.c | 5 +- trunk/fs/compat.c | 25 +- trunk/fs/compat_ioctl.c | 177 +- trunk/fs/dquot.c | 6 - trunk/fs/exec.c | 20 +- trunk/fs/ext2/super.c | 2 +- trunk/fs/ext3/inode.c | 4 +- trunk/fs/ext3/resize.c | 1 - trunk/fs/fuse/dir.c | 37 +- trunk/fs/hfsplus/hfsplus_fs.h | 1 - trunk/fs/hfsplus/hfsplus_raw.h | 12 +- trunk/fs/hfsplus/options.c | 6 +- trunk/fs/hfsplus/super.c | 20 - trunk/fs/hostfs/hostfs_kern.c | 9 +- trunk/fs/hugetlbfs/inode.c | 12 +- trunk/fs/inotify.c | 13 +- trunk/fs/jffs2/debug.h | 8 +- trunk/fs/jffs2/fs.c | 2 - trunk/fs/jffs2/super.c | 2 +- trunk/fs/lockd/clntlock.c | 4 - trunk/fs/nfs/callback.c | 3 - trunk/fs/nfs/dir.c | 3 - trunk/fs/nfs/direct.c | 24 +- trunk/fs/nfs/file.c | 26 +- trunk/fs/nfs/inode.c | 109 +- trunk/fs/nfs/nfs4proc.c | 17 +- trunk/fs/nfs/nfs4state.c | 20 +- trunk/fs/nfs/proc.c | 1 - trunk/fs/nfs/write.c | 6 +- trunk/fs/nfsd/nfs2acl.c | 2 +- trunk/fs/nfsd/nfs3acl.c | 2 +- trunk/fs/partitions/Kconfig | 2 +- trunk/fs/proc/generic.c | 47 +- trunk/fs/proc/task_mmu.c | 9 +- trunk/fs/read_write.c | 34 +- trunk/fs/reiserfs/inode.c | 28 +- trunk/fs/reiserfs/journal.c | 27 +- trunk/fs/relayfs/relay.c | 8 +- trunk/fs/xattr.c | 2 +- trunk/fs/xfs/linux-2.6/xfs_aops.c | 13 +- trunk/fs/xfs/quota/xfs_qm.c | 4 +- trunk/fs/xfs/xfs_attr_leaf.c | 11 +- trunk/fs/xfs/xfs_fsops.c | 2 +- trunk/fs/xfs/xfs_iomap.h | 2 +- trunk/fs/xfs/xfs_log_priv.h | 36 +- trunk/fs/xfs/xfs_vnodeops.c | 5 +- trunk/include/acpi/acglobal.h | 2 +- trunk/include/asm-alpha/atomic.h | 19 +- trunk/include/asm-alpha/bitops.h | 1 - .../asm-arm/arch-clps711x/uncompress.h | 2 +- trunk/include/asm-arm/arch-ebsa110/io.h | 2 +- .../asm-arm/arch-epxa10db/uncompress.h | 2 +- trunk/include/asm-arm/arch-h720x/uncompress.h | 2 +- trunk/include/asm-arm/arch-imx/irqs.h | 2 +- trunk/include/asm-arm/arch-imx/timex.h | 2 +- trunk/include/asm-arm/arch-integrator/smp.h | 2 +- trunk/include/asm-arm/arch-iop3xx/timex.h | 2 +- trunk/include/asm-arm/arch-ixp4xx/io.h | 9 +- .../include/asm-arm/arch-ixp4xx/ixp4xx-regs.h | 1 - trunk/include/asm-arm/arch-l7200/aux_reg.h | 2 +- trunk/include/asm-arm/arch-l7200/gp_timers.h | 2 +- trunk/include/asm-arm/arch-omap/gpio.h | 2 +- trunk/include/asm-arm/arch-omap/irqs.h | 2 +- trunk/include/asm-arm/arch-omap/mcbsp.h | 2 +- trunk/include/asm-arm/arch-omap/system.h | 2 +- trunk/include/asm-arm/arch-pxa/akita.h | 2 - trunk/include/asm-arm/arch-pxa/irq.h | 5 + trunk/include/asm-arm/arch-pxa/ohci.h | 18 - .../include/asm-arm/arch-realview/hardware.h | 1 - trunk/include/asm-arm/arch-realview/system.h | 2 +- trunk/include/asm-arm/arch-rpc/system.h | 2 +- .../include/asm-arm/arch-s3c2410/regs-gpio.h | 239 +- trunk/include/asm-arm/arch-sa1100/io.h | 2 + trunk/include/asm-arm/arch-sa1100/memory.h | 14 +- trunk/include/asm-arm/atomic.h | 44 - trunk/include/asm-arm/bitops.h | 3 - trunk/include/asm-arm/elf.h | 2 - trunk/include/asm-arm/hardware/amba_serial.h | 5 - trunk/include/asm-arm/hardware/dec21285.h | 2 +- trunk/include/asm-arm/io.h | 27 +- trunk/include/asm-arm/memory.h | 1 - trunk/include/asm-arm/mmu_context.h | 1 - trunk/include/asm-arm/numnodes.h | 2 - trunk/include/asm-arm/semaphore.h | 5 + trunk/include/asm-arm/spinlock.h | 26 +- trunk/include/asm-arm/system.h | 4 +- trunk/include/asm-arm/thread_info.h | 1 - trunk/include/asm-arm/uaccess.h | 8 +- trunk/include/asm-arm26/atomic.h | 29 - trunk/include/asm-arm26/bitops.h | 1 - trunk/include/asm-cris/atomic.h | 27 - trunk/include/asm-cris/bitops.h | 1 - trunk/include/asm-frv/atomic.h | 12 - trunk/include/asm-frv/bitops.h | 1 - trunk/include/asm-frv/hardirq.h | 1 - trunk/include/asm-frv/ide.h | 8 +- trunk/include/asm-frv/page.h | 4 +- trunk/include/asm-frv/semaphore.h | 2 +- trunk/include/asm-frv/thread_info.h | 2 +- trunk/include/asm-generic/bitops.h | 1 - trunk/include/asm-generic/sections.h | 1 - trunk/include/asm-h8300/atomic.h | 27 - trunk/include/asm-h8300/bitops.h | 1 - trunk/include/asm-i386/atomic.h | 21 - trunk/include/asm-i386/bitops.h | 1 - .../asm-i386/mach-default/mach_reboot.h | 2 +- trunk/include/asm-i386/param.h | 3 +- trunk/include/asm-i386/processor.h | 4 +- trunk/include/asm-i386/signal.h | 31 +- trunk/include/asm-i386/system.h | 42 +- trunk/include/asm-ia64/atomic.h | 12 - trunk/include/asm-ia64/bitops.h | 1 - trunk/include/asm-ia64/delay.h | 10 +- trunk/include/asm-ia64/ia32.h | 2 - trunk/include/asm-ia64/local.h | 4 +- trunk/include/asm-ia64/page.h | 3 +- trunk/include/asm-ia64/sal.h | 3 +- trunk/include/asm-ia64/sn/pcidev.h | 20 +- trunk/include/asm-ia64/sn/sn_sal.h | 34 - trunk/include/asm-ia64/sn/tioce.h | 26 +- trunk/include/asm-ia64/sn/tioce_provider.h | 17 +- trunk/include/asm-ia64/spinlock.h | 12 +- trunk/include/asm-ia64/topology.h | 2 +- trunk/include/asm-m32r/atomic.h | 21 - trunk/include/asm-m32r/bitops.h | 1 - trunk/include/asm-m32r/ide.h | 13 +- trunk/include/asm-m32r/mappi3/mappi3_pld.h | 2 +- trunk/include/asm-m32r/system.h | 64 +- trunk/include/asm-m68k/atomic.h | 12 - trunk/include/asm-m68k/bitops.h | 1 - trunk/include/asm-m68k/processor.h | 14 +- trunk/include/asm-m68k/thread_info.h | 91 +- trunk/include/asm-m68knommu/atomic.h | 12 - trunk/include/asm-m68knommu/bitops.h | 1 - trunk/include/asm-mips/atomic.h | 35 +- trunk/include/asm-mips/bitops.h | 2 +- trunk/include/asm-mips/io.h | 6 +- trunk/include/asm-mips/ip32/crime.h | 2 +- trunk/include/asm-mips/ip32/mace.h | 44 +- .../include/asm-mips/mach-au1x00/au1xxx_ide.h | 22 +- trunk/include/asm-mips/mach-db1x00/db1200.h | 3 - trunk/include/asm-mips/mach-db1x00/db1x00.h | 6 - .../include/asm-mips/mach-ip32/mc146818rtc.h | 7 +- .../asm-mips/mach-jmr3927/{ => asm}/ds1742.h | 6 +- trunk/include/asm-mips/mach-pb1x00/pb1200.h | 3 - trunk/include/asm-mips/mach-pb1x00/pb1550.h | 7 - trunk/include/asm-mips/mach-qemu/timex.h | 16 - trunk/include/asm-mips/mips-boards/seadint.h | 11 +- trunk/include/asm-mips/signal.h | 21 + trunk/include/asm-parisc/atomic.h | 20 - trunk/include/asm-parisc/bitops.h | 1 - trunk/include/asm-parisc/irq.h | 5 +- trunk/include/asm-parisc/smp.h | 7 +- trunk/include/asm-parisc/spinlock.h | 19 +- trunk/include/asm-parisc/tlbflush.h | 16 +- trunk/include/asm-powerpc/atomic.h | 27 - trunk/include/asm-powerpc/bitops.h | 1 - trunk/include/asm-powerpc/cputable.h | 22 +- trunk/include/asm-powerpc/delay.h | 19 - trunk/include/asm-powerpc/iommu.h | 2 +- trunk/include/asm-powerpc/kexec.h | 1 - trunk/include/asm-powerpc/machdep.h | 4 +- trunk/include/asm-powerpc/page.h | 179 - trunk/include/asm-powerpc/page_32.h | 40 - trunk/include/asm-powerpc/page_64.h | 183 - trunk/include/asm-powerpc/ppc-pci.h | 3 + trunk/include/asm-powerpc/tce.h | 2 +- trunk/include/asm-powerpc/topology.h | 4 - trunk/include/asm-powerpc/vdso.h | 2 +- trunk/include/asm-powerpc/vdso_datapage.h | 2 +- trunk/include/asm-ppc/cpm2.h | 2 - .../{asm-powerpc => asm-ppc}/dma-mapping.h | 138 +- trunk/include/asm-ppc/immap_85xx.h | 2 +- trunk/include/asm-ppc/io.h | 17 - trunk/include/asm-ppc/ipic.h | 2 +- trunk/include/asm-ppc/mpc83xx.h | 2 +- trunk/include/asm-ppc/mpc85xx.h | 2 +- trunk/include/asm-ppc/nvram.h | 73 + trunk/include/asm-ppc/pgalloc.h | 2 +- trunk/include/asm-ppc/ppc4xx_dma.h | 3 + trunk/include/asm-ppc/ppc_sys.h | 2 +- .../{asm-powerpc => asm-ppc64}/btext.h | 0 trunk/include/asm-ppc64/delay.h | 48 + trunk/include/asm-ppc64/dma-mapping.h | 136 + .../include/{asm-powerpc => asm-ppc64}/eeh.h | 4 +- .../{asm-powerpc => asm-ppc64}/floppy.h | 25 +- .../{asm-powerpc => asm-ppc64}/hvconsole.h | 0 .../{asm-powerpc => asm-ppc64}/hvcserver.h | 0 trunk/include/asm-ppc64/imalloc.h | 26 + trunk/include/{asm-powerpc => asm-ppc64}/io.h | 12 +- .../include/{asm-powerpc => asm-ppc64}/mmu.h | 17 +- .../{asm-powerpc => asm-ppc64}/mmu_context.h | 12 +- .../{asm-powerpc => asm-ppc64}/mmzone.h | 0 .../{asm-powerpc => asm-ppc64}/nvram.h | 17 +- trunk/include/asm-ppc64/page.h | 328 + .../{asm-powerpc => asm-ppc64}/pci-bridge.h | 26 +- .../include/{asm-powerpc => asm-ppc64}/pci.h | 110 +- .../{asm-powerpc => asm-ppc64}/pgalloc.h | 11 +- .../{asm-powerpc => asm-ppc64}/pgtable-4k.h | 0 .../{asm-powerpc => asm-ppc64}/pgtable-64k.h | 0 .../{asm-powerpc => asm-ppc64}/pgtable.h | 20 +- trunk/include/asm-ppc64/prom.h | 220 + .../asm-ppc64}/ptrace-common.h | 0 .../{asm-powerpc => asm-ppc64}/serial.h | 19 +- .../{asm-powerpc => asm-ppc64}/spinlock.h | 72 +- trunk/include/asm-ppc64/system.h | 310 + trunk/include/asm-s390/atomic.h | 12 - trunk/include/asm-s390/bitops.h | 1 - trunk/include/asm-sh/atomic.h | 29 - trunk/include/asm-sh/bitops.h | 1 - trunk/include/asm-sh64/atomic.h | 29 - trunk/include/asm-sh64/bitops.h | 1 - trunk/include/asm-sparc/atomic.h | 4 - trunk/include/asm-sparc/bitops.h | 1 - trunk/include/asm-sparc/memreg.h | 2 +- trunk/include/asm-sparc/pcic.h | 6 +- trunk/include/asm-sparc64/atomic.h | 13 - trunk/include/asm-sparc64/bitops.h | 1 - trunk/include/asm-sparc64/pgtable.h | 10 + trunk/include/asm-um/ldt-i386.h | 2 +- trunk/include/asm-um/{ldt-x86_64.h => ldt.h} | 7 +- trunk/include/asm-v850/atomic.h | 30 - trunk/include/asm-v850/bitops.h | 1 - trunk/include/asm-v850/hardirq.h | 4 - trunk/include/asm-x86_64/apic.h | 2 - trunk/include/asm-x86_64/atomic.h | 70 +- trunk/include/asm-x86_64/bitops.h | 27 - trunk/include/asm-x86_64/cache.h | 2 +- trunk/include/asm-x86_64/desc.h | 16 +- trunk/include/asm-x86_64/dma.h | 11 +- trunk/include/asm-x86_64/hpet.h | 35 +- trunk/include/asm-x86_64/hw_irq.h | 2 +- trunk/include/asm-x86_64/ia32.h | 5 - trunk/include/asm-x86_64/mce.h | 10 - trunk/include/asm-x86_64/mmzone.h | 9 +- trunk/include/asm-x86_64/mpspec.h | 7 +- trunk/include/asm-x86_64/msr.h | 4 +- trunk/include/asm-x86_64/numa.h | 2 - trunk/include/asm-x86_64/page.h | 2 +- trunk/include/asm-x86_64/param.h | 3 +- trunk/include/asm-x86_64/pda.h | 1 - trunk/include/asm-x86_64/pgtable.h | 5 +- trunk/include/asm-x86_64/processor.h | 4 +- trunk/include/asm-x86_64/proto.h | 4 - trunk/include/asm-x86_64/rwlock.h | 2 +- trunk/include/asm-x86_64/rwsem.h | 283 + trunk/include/asm-x86_64/smp.h | 3 +- trunk/include/asm-x86_64/spinlock.h | 12 +- trunk/include/asm-x86_64/topology.h | 4 +- trunk/include/asm-x86_64/unistd.h | 3 +- trunk/include/asm-xtensa/atomic.h | 20 - trunk/include/asm-xtensa/bitops.h | 1 - trunk/include/linux/acct.h | 2 - trunk/include/linux/aio.h | 13 +- trunk/include/linux/atmdev.h | 18 +- trunk/include/linux/bio.h | 2 - trunk/include/linux/bitops.h | 19 - trunk/include/linux/blkdev.h | 9 +- trunk/include/linux/cache.h | 2 +- trunk/include/linux/cciss_ioctl.h | 2 +- trunk/include/linux/cm4000_cs.h | 66 - trunk/include/linux/cn_proc.h | 10 +- trunk/include/linux/compat_ioctl.h | 67 - trunk/include/linux/cpu.h | 7 +- trunk/include/linux/cpufreq.h | 10 - trunk/include/linux/dccp.h | 7 +- trunk/include/linux/ds17287rtc.h | 67 - trunk/include/linux/ds1742rtc.h | 53 - trunk/include/linux/dvb/audio.h | 28 +- trunk/include/linux/dvb/ca.h | 36 +- trunk/include/linux/dvb/dmx.h | 20 +- trunk/include/linux/dvb/osd.h | 58 +- trunk/include/linux/dvb/video.h | 44 +- trunk/include/linux/etherdevice.h | 3 +- trunk/include/linux/fb.h | 30 - trunk/include/linux/file.h | 10 +- trunk/include/linux/fsl_devices.h | 2 +- trunk/include/linux/gfp.h | 25 +- trunk/include/linux/hardirq.h | 2 - trunk/include/linux/hdreg.h | 6 +- trunk/include/linux/hugetlb.h | 4 +- trunk/include/linux/i2c-id.h | 2 - trunk/include/linux/ide.h | 161 +- trunk/include/linux/if_pppox.h | 3 +- trunk/include/linux/init_task.h | 1 + trunk/include/linux/inotify.h | 2 - trunk/include/linux/interrupt.h | 1 - trunk/include/linux/ip.h | 121 +- trunk/include/linux/ipv6.h | 79 +- trunk/include/linux/ipv6_route.h | 1 - trunk/include/linux/irq.h | 2 +- trunk/include/linux/jbd.h | 17 + trunk/include/linux/kprobes.h | 8 +- trunk/include/linux/libata.h | 3 - trunk/include/linux/list.h | 26 +- trunk/include/linux/memory.h | 1 + trunk/include/linux/mm.h | 43 +- trunk/include/linux/mmc/protocol.h | 4 +- trunk/include/linux/mmzone.h | 40 +- trunk/include/linux/mtd/cfi.h | 18 +- trunk/include/linux/mtd/onenand.h | 5 +- trunk/include/linux/n_r3964.h | 20 +- trunk/include/linux/net.h | 4 +- trunk/include/linux/netdevice.h | 11 +- trunk/include/linux/netfilter/nfnetlink.h | 6 +- trunk/include/linux/netfilter_ipv4/ipt_sctp.h | 12 +- trunk/include/linux/nfs_fs.h | 1 - trunk/include/linux/page-flags.h | 4 + trunk/include/linux/pagemap.h | 4 +- trunk/include/linux/parport_pc.h | 2 +- trunk/include/linux/pci_ids.h | 10 - trunk/include/linux/percpu.h | 2 +- trunk/include/linux/pfkeyv2.h | 13 +- trunk/include/linux/pkt_sched.h | 7 - trunk/include/linux/pm.h | 49 + trunk/include/linux/pm_legacy.h | 56 - trunk/include/linux/preempt.h | 2 - trunk/include/linux/random.h | 6 +- trunk/include/linux/rcupdate.h | 2 - trunk/include/linux/relayfs_fs.h | 5 +- trunk/include/linux/rmap.h | 4 +- trunk/include/linux/rtnetlink.h | 4 - trunk/include/linux/sched.h | 33 +- trunk/include/linux/security.h | 132 - trunk/include/linux/serial_core.h | 3 - trunk/include/linux/skbuff.h | 12 +- trunk/include/linux/smp_lock.h | 3 +- trunk/include/linux/socket.h | 1 + trunk/include/linux/swap.h | 6 - trunk/include/linux/sysctl.h | 6 +- trunk/include/linux/tcp.h | 21 +- trunk/include/linux/thread_info.h | 47 +- trunk/include/linux/time.h | 3 +- trunk/include/linux/udp.h | 6 +- trunk/include/linux/uinput.h | 13 +- trunk/include/linux/usb.h | 40 +- trunk/include/linux/usb_usual.h | 126 - trunk/include/linux/videodev2.h | 1 - trunk/include/linux/xfrm.h | 29 - trunk/include/media/ir-common.h | 1 - trunk/include/media/ir-kbd-i2c.h | 2 - trunk/include/media/saa7146.h | 6 +- trunk/include/media/saa7146_vv.h | 10 +- trunk/include/media/tuner.h | 1 - trunk/include/media/tveeprom.h | 4 - trunk/include/media/v4l2-common.h | 110 - trunk/include/net/af_unix.h | 12 +- trunk/include/net/atmclip.h | 2 +- trunk/include/net/dn.h | 4 - trunk/include/net/dst.h | 1 - trunk/include/net/flow.h | 7 +- trunk/include/net/genetlink.h | 2 +- trunk/include/net/icmp.h | 9 +- trunk/include/net/ieee80211.h | 2 +- trunk/include/net/ieee80211_crypt.h | 9 +- trunk/include/net/if_inet6.h | 2 - trunk/include/net/inet6_connection_sock.h | 42 - trunk/include/net/inet6_hashtables.h | 32 +- trunk/include/net/inet_common.h | 4 +- trunk/include/net/inet_connection_sock.h | 45 +- trunk/include/net/inet_ecn.h | 2 - trunk/include/net/inet_hashtables.h | 24 +- trunk/include/net/inet_sock.h | 193 - trunk/include/net/inet_timewait_sock.h | 8 +- trunk/include/net/inetpeer.h | 1 - trunk/include/net/ip.h | 19 +- trunk/include/net/ip_fib.h | 2 - trunk/include/net/ip_vs.h | 12 +- trunk/include/net/ipv6.h | 14 +- trunk/include/net/llc_pdu.h | 2 +- trunk/include/net/ndisc.h | 17 +- trunk/include/net/neighbour.h | 2 +- trunk/include/net/pkt_act.h | 1 + trunk/include/net/protocol.h | 3 +- trunk/include/net/raw.h | 2 - trunk/include/net/request_sock.h | 2 +- trunk/include/net/route.h | 3 - trunk/include/net/sctp/structs.h | 76 +- trunk/include/net/sctp/user.h | 30 - trunk/include/net/sock.h | 32 +- trunk/include/net/tcp.h | 250 +- trunk/include/net/tcp_states.h | 16 - trunk/include/net/timewait_sock.h | 31 - trunk/include/net/transp_v6.h | 2 +- trunk/include/net/udp.h | 4 +- trunk/include/net/xfrm.h | 31 +- trunk/include/scsi/scsi_cmnd.h | 1 - trunk/include/scsi/scsi_dbg.h | 1 + trunk/include/scsi/scsi_device.h | 12 +- trunk/include/scsi/scsi_transport_fc.h | 11 - trunk/include/scsi/scsi_transport_spi.h | 4 - trunk/init/Kconfig | 27 +- trunk/init/main.c | 4 + trunk/ipc/sem.c | 2 - trunk/kernel/audit.c | 4 +- trunk/kernel/cpu.c | 83 +- trunk/kernel/cpuset.c | 5 +- trunk/kernel/exit.c | 2 +- trunk/kernel/fork.c | 15 +- trunk/kernel/futex.c | 21 +- trunk/kernel/irq/manage.c | 15 - trunk/kernel/kprobes.c | 36 +- trunk/kernel/params.c | 2 +- trunk/kernel/posix-cpu-timers.c | 2 +- trunk/kernel/posix-timers.c | 10 +- trunk/kernel/power/Kconfig | 9 - trunk/kernel/power/Makefile | 3 +- trunk/kernel/power/main.c | 21 +- trunk/kernel/power/pm.c | 1 - trunk/kernel/printk.c | 18 +- trunk/kernel/ptrace.c | 5 +- trunk/kernel/rcupdate.c | 59 +- trunk/kernel/rcutorture.c | 37 +- trunk/kernel/sched.c | 10 +- trunk/kernel/signal.c | 11 +- trunk/kernel/stop_machine.c | 6 +- trunk/kernel/sys.c | 3 +- trunk/kernel/sysctl.c | 29 +- trunk/kernel/time.c | 22 - trunk/kernel/workqueue.c | 12 +- trunk/lib/genalloc.c | 14 +- trunk/lib/spinlock_debug.c | 18 +- trunk/lib/swiotlb.c | 5 +- trunk/mm/Kconfig | 6 +- trunk/mm/bootmem.c | 2 - trunk/mm/filemap.c | 2 +- trunk/mm/fremap.c | 52 +- trunk/mm/hugetlb.c | 6 - trunk/mm/madvise.c | 2 +- trunk/mm/memory.c | 404 +- trunk/mm/memory_hotplug.c | 2 +- trunk/mm/mempolicy.c | 16 +- trunk/mm/mmap.c | 15 +- trunk/mm/mprotect.c | 8 + trunk/mm/mremap.c | 2 +- trunk/mm/msync.c | 12 +- trunk/mm/nommu.c | 2 +- trunk/mm/page-writeback.c | 1 - trunk/mm/page_alloc.c | 325 +- trunk/mm/rmap.c | 60 +- trunk/mm/slab.c | 55 +- trunk/mm/swap.c | 3 + trunk/mm/thrash.c | 10 +- trunk/mm/truncate.c | 6 +- trunk/mm/vmscan.c | 35 +- trunk/net/8021q/vlan.c | 6 +- trunk/net/8021q/vlan_dev.c | 3 - trunk/net/Makefile | 2 +- trunk/net/appletalk/ddp.c | 23 +- trunk/net/atm/atm_misc.c | 11 +- trunk/net/atm/common.c | 66 +- trunk/net/atm/common.h | 2 - trunk/net/atm/pvc.c | 2 +- trunk/net/atm/resources.c | 78 +- trunk/net/atm/resources.h | 3 +- trunk/net/atm/svc.c | 2 +- trunk/net/ax25/af_ax25.c | 6 +- trunk/net/bluetooth/af_bluetooth.c | 5 +- trunk/net/bluetooth/bnep/sock.c | 2 +- trunk/net/bluetooth/cmtp/sock.c | 2 +- trunk/net/bluetooth/hci_sock.c | 2 +- trunk/net/bluetooth/hidp/sock.c | 2 +- trunk/net/bluetooth/l2cap.c | 9 +- trunk/net/bluetooth/rfcomm/sock.c | 4 +- trunk/net/bluetooth/sco.c | 9 +- trunk/net/bridge/br.c | 1 - trunk/net/bridge/br_device.c | 91 +- trunk/net/bridge/br_if.c | 56 +- trunk/net/bridge/br_input.c | 11 +- trunk/net/bridge/br_netfilter.c | 23 +- trunk/net/bridge/br_notify.c | 14 +- trunk/net/bridge/br_private.h | 7 - trunk/net/bridge/br_stp_if.c | 5 +- trunk/net/bridge/netfilter/Kconfig | 6 +- trunk/net/bridge/netfilter/ebt_log.c | 73 +- trunk/net/bridge/netfilter/ebt_ulog.c | 53 +- trunk/net/core/datagram.c | 36 - trunk/net/core/dev.c | 7 +- trunk/net/core/filter.c | 116 +- trunk/net/core/flow.c | 8 +- trunk/net/core/netpoll.c | 1 - trunk/net/core/pktgen.c | 6 +- trunk/net/core/skbuff.c | 29 +- trunk/net/core/sock.c | 21 +- trunk/net/core/stream.c | 10 +- trunk/net/core/utils.c | 2 +- trunk/net/dccp/Makefile | 4 - trunk/net/dccp/ackvec.c | 33 +- trunk/net/dccp/ackvec.h | 12 +- trunk/net/dccp/ccid.h | 2 - trunk/net/dccp/dccp.h | 24 +- trunk/net/dccp/diag.c | 2 +- trunk/net/dccp/input.c | 79 +- trunk/net/dccp/ipv4.c | 307 +- trunk/net/dccp/ipv6.c | 1261 -- trunk/net/dccp/ipv6.h | 37 - trunk/net/dccp/minisocks.c | 23 +- trunk/net/dccp/output.c | 47 +- trunk/net/dccp/proto.c | 57 +- trunk/net/decnet/af_decnet.c | 31 +- trunk/net/decnet/dn_neigh.c | 13 +- trunk/net/decnet/dn_nsp_in.c | 17 +- trunk/net/decnet/sysctl_net_decnet.c | 33 - trunk/net/econet/af_econet.c | 9 +- trunk/net/ieee80211/Kconfig | 2 +- trunk/net/ieee80211/ieee80211_rx.c | 5 +- trunk/net/ipv4/Kconfig | 8 - trunk/net/ipv4/Makefile | 1 - trunk/net/ipv4/af_inet.c | 26 +- trunk/net/ipv4/ah4.c | 1 - trunk/net/ipv4/arp.c | 1 - trunk/net/ipv4/devinet.c | 41 +- trunk/net/ipv4/esp4.c | 1 - trunk/net/ipv4/fib_frontend.c | 11 +- trunk/net/ipv4/fib_hash.c | 3 +- trunk/net/ipv4/fib_rules.c | 1 - trunk/net/ipv4/fib_semantics.c | 4 +- trunk/net/ipv4/fib_trie.c | 11 - trunk/net/ipv4/icmp.c | 5 +- trunk/net/ipv4/igmp.c | 7 +- trunk/net/ipv4/inet_connection_sock.c | 25 +- trunk/net/ipv4/inet_diag.c | 14 +- trunk/net/ipv4/inet_hashtables.c | 178 - trunk/net/ipv4/inet_timewait_sock.c | 5 +- trunk/net/ipv4/inetpeer.c | 1 - trunk/net/ipv4/ip_fragment.c | 108 +- trunk/net/ipv4/ip_gre.c | 4 +- trunk/net/ipv4/ip_input.c | 1 - trunk/net/ipv4/ip_options.c | 1 - trunk/net/ipv4/ip_output.c | 3 +- trunk/net/ipv4/ip_sockglue.c | 14 +- trunk/net/ipv4/ipcomp.c | 1 - trunk/net/ipv4/ipconfig.c | 2 - trunk/net/ipv4/ipmr.c | 1 - trunk/net/ipv4/ipvs/ip_vs_app.c | 28 + trunk/net/ipv4/ipvs/ip_vs_conn.c | 23 +- trunk/net/ipv4/ipvs/ip_vs_core.c | 2 +- trunk/net/ipv4/ipvs/ip_vs_ctl.c | 14 +- trunk/net/ipv4/ipvs/ip_vs_dh.c | 2 - trunk/net/ipv4/ipvs/ip_vs_est.c | 3 - trunk/net/ipv4/ipvs/ip_vs_lblc.c | 29 +- trunk/net/ipv4/ipvs/ip_vs_lblcr.c | 29 +- trunk/net/ipv4/ipvs/ip_vs_proto_ah.c | 2 - trunk/net/ipv4/ipvs/ip_vs_proto_esp.c | 2 - trunk/net/ipv4/ipvs/ip_vs_proto_tcp.c | 26 +- trunk/net/ipv4/ipvs/ip_vs_proto_udp.c | 3 - trunk/net/ipv4/ipvs/ip_vs_sh.c | 2 - trunk/net/ipv4/ipvs/ip_vs_sync.c | 2 - trunk/net/ipv4/netfilter/Kconfig | 18 +- trunk/net/ipv4/netfilter/Makefile | 3 +- trunk/net/ipv4/netfilter/arp_tables.c | 175 +- .../net/ipv4/netfilter/ip_conntrack_amanda.c | 4 +- trunk/net/ipv4/netfilter/ip_conntrack_core.c | 22 +- trunk/net/ipv4/netfilter/ip_conntrack_ftp.c | 6 +- trunk/net/ipv4/netfilter/ip_conntrack_irc.c | 6 +- .../net/ipv4/netfilter/ip_conntrack_netlink.c | 103 +- .../ipv4/netfilter/ip_conntrack_proto_gre.c | 1 - .../ipv4/netfilter/ip_conntrack_proto_icmp.c | 4 +- .../ipv4/netfilter/ip_conntrack_proto_sctp.c | 4 +- .../ipv4/netfilter/ip_conntrack_proto_tcp.c | 45 +- .../ipv4/netfilter/ip_conntrack_proto_udp.c | 1 - .../ipv4/netfilter/ip_conntrack_standalone.c | 1 - trunk/net/ipv4/netfilter/ip_conntrack_tftp.c | 4 +- trunk/net/ipv4/netfilter/ip_nat_core.c | 2 +- trunk/net/ipv4/netfilter/ip_nat_snmp_basic.c | 2 - trunk/net/ipv4/netfilter/ip_nat_tftp.c | 5 +- trunk/net/ipv4/netfilter/ip_tables.c | 201 +- trunk/net/ipv4/netfilter/ipt_LOG.c | 4 +- trunk/net/ipv4/netfilter/ipt_MASQUERADE.c | 2 - trunk/net/ipv4/netfilter/ipt_physdev.c | 1 - trunk/net/ipv4/netfilter/ipt_recent.c | 1 - trunk/net/ipv4/proc.c | 11 +- trunk/net/ipv4/route.c | 5 +- trunk/net/ipv4/syncookies.c | 4 +- trunk/net/ipv4/sysctl_net_ipv4.c | 11 - trunk/net/ipv4/tcp.c | 18 +- trunk/net/ipv4/tcp_bic.c | 85 +- trunk/net/ipv4/tcp_cong.c | 28 - trunk/net/ipv4/tcp_cubic.c | 411 - trunk/net/ipv4/tcp_highspeed.c | 2 +- trunk/net/ipv4/tcp_input.c | 103 +- trunk/net/ipv4/tcp_ipv4.c | 269 +- trunk/net/ipv4/tcp_minisocks.c | 16 +- trunk/net/ipv4/tcp_output.c | 347 +- trunk/net/ipv4/tcp_vegas.c | 20 +- trunk/net/ipv4/udp.c | 22 +- trunk/net/ipv4/xfrm4_policy.c | 1 - trunk/net/ipv6/Makefile | 3 +- trunk/net/ipv6/addrconf.c | 156 +- trunk/net/ipv6/af_inet6.c | 137 +- trunk/net/ipv6/ah6.c | 1 - trunk/net/ipv6/datagram.c | 2 +- trunk/net/ipv6/esp6.c | 3 +- trunk/net/ipv6/exthdrs.c | 26 +- trunk/net/ipv6/icmp.c | 18 +- trunk/net/ipv6/inet6_connection_sock.c | 199 - trunk/net/ipv6/inet6_hashtables.c | 183 +- trunk/net/ipv6/ip6_flowlabel.c | 18 +- trunk/net/ipv6/ip6_output.c | 5 +- trunk/net/ipv6/ipcomp6.c | 1 - trunk/net/ipv6/ipv6_sockglue.c | 30 +- trunk/net/ipv6/mcast.c | 147 +- trunk/net/ipv6/netfilter/Kconfig | 52 +- trunk/net/ipv6/netfilter/ip6_tables.c | 193 +- trunk/net/ipv6/netfilter/ip6t_LOG.c | 1 - trunk/net/ipv6/netfilter/ip6t_ah.c | 1 - trunk/net/ipv6/netfilter/ip6t_esp.c | 1 - .../netfilter/nf_conntrack_l3proto_ipv6.c | 8 +- .../netfilter/nf_conntrack_proto_icmpv6.c | 12 +- trunk/net/ipv6/netfilter/nf_conntrack_reasm.c | 54 +- trunk/net/ipv6/raw.c | 20 +- trunk/net/ipv6/reassembly.c | 41 +- trunk/net/ipv6/route.c | 17 +- trunk/net/ipv6/tcp_ipv6.c | 658 +- trunk/net/ipv6/udp.c | 20 +- trunk/net/ipv6/xfrm6_policy.c | 1 - trunk/net/ipx/af_ipx.c | 6 +- trunk/net/irda/af_irda.c | 23 +- trunk/net/key/af_key.c | 201 +- trunk/net/llc/af_llc.c | 16 +- trunk/net/llc/llc_c_ac.c | 20 +- trunk/net/netfilter/Kconfig | 4 +- trunk/net/netfilter/nf_conntrack_core.c | 12 +- trunk/net/netfilter/nf_conntrack_proto_tcp.c | 35 +- trunk/net/netfilter/nf_conntrack_standalone.c | 2 +- trunk/net/netfilter/nfnetlink.c | 33 +- trunk/net/netfilter/nfnetlink_log.c | 8 +- trunk/net/netfilter/nfnetlink_queue.c | 11 +- trunk/net/netlink/af_netlink.c | 6 +- trunk/net/netlink/genetlink.c | 2 +- trunk/net/netrom/af_netrom.c | 16 +- trunk/net/netrom/nr_in.c | 6 +- trunk/net/nonet.c | 5 + trunk/net/packet/af_packet.c | 125 +- trunk/net/rose/af_rose.c | 2 +- trunk/net/sched/Kconfig | 37 +- trunk/net/sched/act_api.c | 2 +- trunk/net/sched/sch_netem.c | 51 +- trunk/net/sched/sch_teql.c | 1 - trunk/net/sctp/associola.c | 81 +- trunk/net/sctp/input.c | 36 +- trunk/net/sctp/ipv6.c | 2 +- trunk/net/sctp/output.c | 17 +- trunk/net/sctp/protocol.c | 3 +- trunk/net/sctp/sm_sideeffect.c | 26 +- trunk/net/sctp/sm_statefuns.c | 20 +- trunk/net/sctp/socket.c | 717 +- trunk/net/sctp/transport.c | 35 +- trunk/net/socket.c | 243 +- trunk/net/sunrpc/auth_gss/auth_gss.c | 6 +- trunk/net/sunrpc/rpc_pipe.c | 30 +- trunk/net/sunrpc/svcsock.c | 3 +- trunk/net/sunrpc/xprtsock.c | 2 - trunk/net/unix/af_unix.c | 55 +- trunk/net/unix/garbage.c | 4 +- trunk/net/wanrouter/af_wanpipe.c | 6 +- trunk/net/x25/af_x25.c | 6 +- trunk/net/xfrm/xfrm_policy.c | 137 +- trunk/net/xfrm/xfrm_state.c | 14 +- trunk/net/xfrm/xfrm_user.c | 148 +- trunk/scripts/kconfig/Makefile | 68 +- trunk/scripts/kernel-doc | 13 +- trunk/security/Kconfig | 13 - trunk/security/dummy.c | 45 +- trunk/security/keys/keyring.c | 2 +- trunk/security/selinux/Makefile | 2 - trunk/security/selinux/hooks.c | 39 - .../selinux/include/av_perm_to_string.h | 2 - .../security/selinux/include/av_permissions.h | 2 - trunk/security/selinux/include/xfrm.h | 54 - trunk/security/selinux/xfrm.c | 311 - trunk/sound/core/memalloc.c | 2 - trunk/sound/oss/ad1848.c | 1 - trunk/sound/oss/au1550_ac97.c | 29 +- trunk/sound/oss/cs4281/cs4281m.c | 1 - trunk/sound/oss/maestro.c | 1 - trunk/sound/oss/nm256_audio.c | 1 - trunk/sound/oss/opl3sa2.c | 18 +- trunk/sound/ppc/tumbler.c | 8 +- trunk/sound/sparc/Kconfig | 2 +- trunk/sound/usb/usbaudio.c | 1 + trunk/sound/usb/usx2y/usbusx2y.c | 1 + trunk/sound/usb/usx2y/usx2yhwdeppcm.c | 1 - 2049 files changed, 50675 insertions(+), 78394 deletions(-) delete mode 100644 trunk/Documentation/HOWTO delete mode 100644 trunk/Documentation/networking/gianfar.txt create mode 100644 trunk/Documentation/usb/bluetooth.txt create mode 100644 trunk/arch/arm/configs/poodle_defconfig delete mode 100644 trunk/arch/arm/mach-pxa/akita-ioexp.c delete mode 100644 trunk/arch/arm/mach-pxa/corgi_pm.c delete mode 100644 trunk/arch/arm/mach-pxa/spitz_pm.c create mode 100644 trunk/arch/arm/mm/blockops.c delete mode 100644 trunk/arch/powerpc/kernel/rtas-rtc.c create mode 100644 trunk/arch/ppc/kernel/align.c create mode 100644 trunk/arch/ppc64/Kconfig create mode 100644 trunk/arch/ppc64/Kconfig.debug create mode 100644 trunk/arch/ppc64/Makefile rename trunk/arch/{powerpc => ppc64}/boot/Makefile (96%) rename trunk/arch/{powerpc => ppc64}/boot/README (100%) rename trunk/arch/{powerpc => ppc64}/boot/addRamDisk.c (100%) rename trunk/arch/{powerpc => ppc64}/boot/addnote.c (100%) rename trunk/arch/{powerpc => ppc64}/boot/crt0.S (80%) rename trunk/arch/{powerpc => ppc64}/boot/div64.S (100%) rename trunk/arch/{powerpc => ppc64}/boot/elf.h (100%) rename trunk/arch/{powerpc => ppc64}/boot/install.sh (100%) rename trunk/arch/{powerpc => ppc64}/boot/main.c (77%) rename trunk/arch/{powerpc => ppc64}/boot/page.h (100%) rename trunk/arch/{powerpc => ppc64}/boot/ppc_asm.h (100%) rename trunk/arch/{powerpc => ppc64}/boot/prom.c (100%) rename trunk/arch/{powerpc => ppc64}/boot/prom.h (100%) rename trunk/arch/{powerpc => ppc64}/boot/stdio.h (100%) rename trunk/arch/{powerpc => ppc64}/boot/string.S (100%) rename trunk/arch/{powerpc => ppc64}/boot/string.h (100%) rename trunk/arch/{powerpc => ppc64}/boot/zImage.lds (100%) create mode 100644 trunk/arch/ppc64/configs/bpa_defconfig create mode 100644 trunk/arch/ppc64/configs/g5_defconfig create mode 100644 trunk/arch/ppc64/configs/iSeries_defconfig create mode 100644 trunk/arch/ppc64/configs/maple_defconfig create mode 100644 trunk/arch/ppc64/configs/pSeries_defconfig rename trunk/arch/{powerpc/configs/ppc64_defconfig => ppc64/defconfig} (86%) create mode 100644 trunk/arch/ppc64/kernel/Makefile rename trunk/arch/{powerpc => ppc64}/kernel/align.c (51%) create mode 100644 trunk/arch/ppc64/kernel/asm-offsets.c create mode 100644 trunk/arch/ppc64/kernel/btext.c rename trunk/arch/{powerpc/kernel/dma_64.c => ppc64/kernel/dma.c} (100%) create mode 100644 trunk/arch/ppc64/kernel/head.S rename trunk/arch/{powerpc/platforms/pseries => ppc64/kernel}/hvconsole.c (100%) rename trunk/arch/{powerpc/platforms/pseries => ppc64/kernel}/hvcserver.c (100%) rename trunk/arch/{powerpc/kernel/idle_64.c => ppc64/kernel/idle.c} (100%) rename trunk/arch/{powerpc => ppc64}/kernel/iomap.c (100%) rename trunk/arch/{powerpc => ppc64}/kernel/iommu.c (100%) rename trunk/arch/{powerpc => ppc64}/kernel/kprobes.c (99%) rename trunk/arch/{powerpc/kernel/machine_kexec_64.c => ppc64/kernel/machine_kexec.c} (85%) create mode 100644 trunk/arch/ppc64/kernel/misc.S rename trunk/arch/{powerpc/kernel/module_64.c => ppc64/kernel/module.c} (100%) rename trunk/arch/{powerpc/kernel/nvram_64.c => ppc64/kernel/nvram.c} (100%) rename trunk/arch/{powerpc/kernel/pci_64.c => ppc64/kernel/pci.c} (95%) rename trunk/arch/{powerpc => ppc64}/kernel/pci_direct_iommu.c (100%) rename trunk/arch/{powerpc => ppc64}/kernel/pci_dn.c (100%) rename trunk/arch/{powerpc => ppc64}/kernel/pci_iommu.c (100%) create mode 100644 trunk/arch/ppc64/kernel/ppc_ksyms.c create mode 100644 trunk/arch/ppc64/kernel/prom.c create mode 100644 trunk/arch/ppc64/kernel/prom_init.c create mode 100644 trunk/arch/ppc64/kernel/rtc.c create mode 100644 trunk/arch/ppc64/kernel/semaphore.c create mode 100644 trunk/arch/ppc64/kernel/vdso.c create mode 100644 trunk/arch/ppc64/kernel/vmlinux.lds.S create mode 100644 trunk/arch/ppc64/xmon/privinst.h delete mode 100644 trunk/arch/x86_64/kernel/mce_amd.c delete mode 100644 trunk/drivers/atm/adummy.c create mode 100644 trunk/drivers/atm/atmdev_init.c delete mode 100644 trunk/drivers/char/pcmcia/cm4000_cs.c delete mode 100644 trunk/drivers/char/pcmcia/cm4040_cs.c delete mode 100644 trunk/drivers/char/pcmcia/cm4040_cs.h delete mode 100644 trunk/drivers/char/tpm/tpm_atmel.h delete mode 100644 trunk/drivers/ide/mips/Makefile delete mode 100644 trunk/drivers/ide/mips/swarm.c delete mode 100644 trunk/drivers/input/misc/wistron_btns.c delete mode 100644 trunk/drivers/media/video/cx25840/Makefile delete mode 100644 trunk/drivers/media/video/cx25840/cx25840-audio.c delete mode 100644 trunk/drivers/media/video/cx25840/cx25840-core.c delete mode 100644 trunk/drivers/media/video/cx25840/cx25840-firmware.c delete mode 100644 trunk/drivers/media/video/cx25840/cx25840-vbi.c delete mode 100644 trunk/drivers/media/video/cx25840/cx25840.h delete mode 100644 trunk/drivers/media/video/saa7115.c delete mode 100644 trunk/drivers/media/video/saa7127.c delete mode 100644 trunk/drivers/net/bonding/bond_sysfs.c delete mode 100644 trunk/drivers/net/gianfar_sysfs.c delete mode 100644 trunk/drivers/net/ixp2000/Kconfig delete mode 100644 trunk/drivers/net/ixp2000/Makefile delete mode 100644 trunk/drivers/net/ixp2000/caleb.c delete mode 100644 trunk/drivers/net/ixp2000/caleb.h delete mode 100644 trunk/drivers/net/ixp2000/enp2611.c delete mode 100644 trunk/drivers/net/ixp2000/ixp2400-msf.c delete mode 100644 trunk/drivers/net/ixp2000/ixp2400-msf.h delete mode 100644 trunk/drivers/net/ixp2000/ixp2400_rx.uc delete mode 100644 trunk/drivers/net/ixp2000/ixp2400_rx.ucode delete mode 100644 trunk/drivers/net/ixp2000/ixp2400_tx.uc delete mode 100644 trunk/drivers/net/ixp2000/ixp2400_tx.ucode delete mode 100644 trunk/drivers/net/ixp2000/ixpdev.c delete mode 100644 trunk/drivers/net/ixp2000/ixpdev.h delete mode 100644 trunk/drivers/net/ixp2000/ixpdev_priv.h delete mode 100644 trunk/drivers/net/ixp2000/pm3386.c delete mode 100644 trunk/drivers/net/ixp2000/pm3386.h create mode 100644 trunk/drivers/net/sk98lin/skcsum.c create mode 100644 trunk/drivers/net/sk98lin/skproc.c delete mode 100644 trunk/drivers/net/sky2.c delete mode 100644 trunk/drivers/net/sky2.h create mode 100644 trunk/drivers/net/wan/lmc/lmc_prot.h rename trunk/drivers/net/wireless/hostap/{hostap_main.c => hostap.c} (100%) delete mode 100644 trunk/drivers/scsi/qla2xxx/ql2400.c delete mode 100644 trunk/drivers/scsi/qla2xxx/ql2400_fw.c create mode 100644 trunk/drivers/scsi/sym53c8xx_comm.h create mode 100644 trunk/drivers/scsi/sym53c8xx_defs.h delete mode 100644 trunk/drivers/usb/atm/ueagle-atm.c delete mode 100644 trunk/drivers/usb/core/driver.c delete mode 100644 trunk/drivers/usb/input/ati_remote2.c rename trunk/drivers/usb/serial/{ChangeLog.history => ChangeLog.old} (99%) delete mode 100644 trunk/drivers/usb/serial/anydata.c create mode 100644 trunk/drivers/usb/serial/nokia_dku2.c delete mode 100644 trunk/drivers/usb/storage/alauda.c delete mode 100644 trunk/drivers/usb/storage/alauda.h delete mode 100644 trunk/drivers/usb/storage/libusual.c delete mode 100644 trunk/include/asm-arm/arch-pxa/ohci.h rename trunk/include/asm-mips/mach-jmr3927/{ => asm}/ds1742.h (74%) delete mode 100644 trunk/include/asm-mips/mach-qemu/timex.h delete mode 100644 trunk/include/asm-powerpc/delay.h delete mode 100644 trunk/include/asm-powerpc/page.h delete mode 100644 trunk/include/asm-powerpc/page_32.h delete mode 100644 trunk/include/asm-powerpc/page_64.h rename trunk/include/{asm-powerpc => asm-ppc}/dma-mapping.h (56%) create mode 100644 trunk/include/asm-ppc/nvram.h rename trunk/include/{asm-powerpc => asm-ppc64}/btext.h (100%) create mode 100644 trunk/include/asm-ppc64/delay.h create mode 100644 trunk/include/asm-ppc64/dma-mapping.h rename trunk/include/{asm-powerpc => asm-ppc64}/eeh.h (98%) rename trunk/include/{asm-powerpc => asm-ppc64}/floppy.h (78%) rename trunk/include/{asm-powerpc => asm-ppc64}/hvconsole.h (100%) rename trunk/include/{asm-powerpc => asm-ppc64}/hvcserver.h (100%) create mode 100644 trunk/include/asm-ppc64/imalloc.h rename trunk/include/{asm-powerpc => asm-ppc64}/io.h (98%) rename trunk/include/{asm-powerpc => asm-ppc64}/mmu.h (98%) rename trunk/include/{asm-powerpc => asm-ppc64}/mmu_context.h (91%) rename trunk/include/{asm-powerpc => asm-ppc64}/mmzone.h (100%) rename trunk/include/{asm-powerpc => asm-ppc64}/nvram.h (90%) create mode 100644 trunk/include/asm-ppc64/page.h rename trunk/include/{asm-powerpc => asm-ppc64}/pci-bridge.h (89%) rename trunk/include/{asm-powerpc => asm-ppc64}/pci.h (63%) rename trunk/include/{asm-powerpc => asm-ppc64}/pgalloc.h (95%) rename trunk/include/{asm-powerpc => asm-ppc64}/pgtable-4k.h (100%) rename trunk/include/{asm-powerpc => asm-ppc64}/pgtable-64k.h (100%) rename trunk/include/{asm-powerpc => asm-ppc64}/pgtable.h (97%) create mode 100644 trunk/include/asm-ppc64/prom.h rename trunk/{arch/powerpc/kernel => include/asm-ppc64}/ptrace-common.h (100%) rename trunk/include/{asm-powerpc => asm-ppc64}/serial.h (53%) rename trunk/include/{asm-powerpc => asm-ppc64}/spinlock.h (80%) create mode 100644 trunk/include/asm-ppc64/system.h rename trunk/include/asm-um/{ldt-x86_64.h => ldt.h} (95%) create mode 100644 trunk/include/asm-x86_64/rwsem.h delete mode 100644 trunk/include/linux/cm4000_cs.h delete mode 100644 trunk/include/linux/ds17287rtc.h delete mode 100644 trunk/include/linux/ds1742rtc.h delete mode 100644 trunk/include/linux/pm_legacy.h delete mode 100644 trunk/include/linux/usb_usual.h delete mode 100644 trunk/include/media/v4l2-common.h delete mode 100644 trunk/include/net/inet6_connection_sock.h delete mode 100644 trunk/include/net/inet_sock.h delete mode 100644 trunk/include/net/timewait_sock.h delete mode 100644 trunk/net/dccp/ipv6.c delete mode 100644 trunk/net/dccp/ipv6.h delete mode 100644 trunk/net/ipv4/tcp_cubic.c delete mode 100644 trunk/net/ipv6/inet6_connection_sock.c delete mode 100644 trunk/security/selinux/include/xfrm.h delete mode 100644 trunk/security/selinux/xfrm.c diff --git a/[refs] b/[refs] index 2f0fe3bda333..ffc80c6cab68 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d779188d2baf436e67fe8816fca2ef53d246900f +refs/heads/master: e74ac79956ecb56e71a398c57eb10fab8c58a562 diff --git a/trunk/CREDITS b/trunk/CREDITS index 1b4f8694fa48..7fb4c73e0228 100644 --- a/trunk/CREDITS +++ b/trunk/CREDITS @@ -611,7 +611,8 @@ S: USA N: Randolph Chung E: tausq@debian.org D: Linux/PA-RISC hacker -S: Hong Kong +S: Los Altos, CA 94022 +S: USA N: Juan Jose Ciarlante W: http://juanjox.kernelnotes.org/ @@ -1096,7 +1097,7 @@ S: 80050-430 - Curitiba - Paran S: Brazil N: Kumar Gala -E: galak@kernel.crashing.org +E: kumar.gala@freescale.com D: Embedded PowerPC 6xx/7xx/74xx/82xx/83xx/85xx support S: Austin, Texas 78729 S: USA @@ -3404,15 +3405,6 @@ S: Chudenicka 8 S: 10200 Prague 10, Hostivar S: Czech Republic -N: Thibaut Varene -E: T-Bone@parisc-linux.org -W: http://www.parisc-linux.org/ -P: 1024D/B7D2F063 E67C 0D43 A75E 12A5 BB1C FA2F 1E32 C3DA B7D2 F063 -D: PA-RISC port minion, PDC and GSCPS2 drivers, debuglocks and other bits -D: Some bits in an ARM port, S1D13XXX FB driver, random patches here and there -D: AD1889 sound driver -S: Paris, France - N: Heikki Vatiainen E: hessu@cs.tut.fi D: Co-author of Multi-Protocol Over ATM (MPOA), some LANE hacks diff --git a/trunk/Documentation/00-INDEX b/trunk/Documentation/00-INDEX index 5f7f7d7f77d2..433cf5e9ae04 100644 --- a/trunk/Documentation/00-INDEX +++ b/trunk/Documentation/00-INDEX @@ -24,8 +24,6 @@ DMA-mapping.txt - info for PCI drivers using DMA portably across all platforms. DocBook/ - directory with DocBook templates etc. for kernel documentation. -HOWTO - - The process and procedures of how to do Linux kernel development. IO-mapping.txt - how to access I/O mapped memory from within device drivers. IPMI.txt @@ -258,10 +256,6 @@ specialix.txt - info on hardware/driver for specialix IO8+ multiport serial card. spinlocks.txt - info on using spinlocks to provide exclusive access in kernel. -stable_api_nonsense.txt - - info on why the kernel does not have a stable in-kernel api or abi. -stable_kernel_rules.txt - - rules and procedures for the -stable kernel releases. stallion.txt - info on using the Stallion multiport serial driver. svga.txt diff --git a/trunk/Documentation/DocBook/Makefile b/trunk/Documentation/DocBook/Makefile index 1c955883cf58..7018f5c6a447 100644 --- a/trunk/Documentation/DocBook/Makefile +++ b/trunk/Documentation/DocBook/Makefile @@ -20,12 +20,6 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ # +--> DIR=file (htmldocs) # +--> man/ (mandocs) - -# for PDF and PS output you can choose between xmlto and docbook-utils tools -PDF_METHOD = $(prefer-db2x) -PS_METHOD = $(prefer-db2x) - - ### # The targets that may be used. .PHONY: xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs @@ -99,39 +93,27 @@ C-procfs-example = procfs_example.xml C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example)) $(obj)/procfs-guide.xml: $(C-procfs-example2) -notfoundtemplate = echo "*** You have to install docbook-utils or xmlto ***"; \ - exit 1 -db2xtemplate = db2TYPE -o $(dir $@) $< -xmltotemplate = xmlto TYPE $(XMLTOFLAGS) -o $(dir $@) $< - -# determine which methods are available -ifeq ($(shell which db2ps >/dev/null 2>&1 && echo found),found) - use-db2x = db2x - prefer-db2x = db2x -else - use-db2x = notfound - prefer-db2x = $(use-xmlto) -endif -ifeq ($(shell which xmlto >/dev/null 2>&1 && echo found),found) - use-xmlto = xmlto - prefer-xmlto = xmlto -else - use-xmlto = notfound - prefer-xmlto = $(use-db2x) -endif +### +# Rules to generate postscript, PDF and HTML +# db2html creates a directory. Generate a html file used for timestamp -# the commands, generated from the chosen template -quiet_cmd_db2ps = PS $@ - cmd_db2ps = $(subst TYPE,ps, $($(PS_METHOD)template)) +quiet_cmd_db2ps = XMLTO $@ + cmd_db2ps = xmlto ps $(XMLTOFLAGS) -o $(dir $@) $< %.ps : %.xml + @(which xmlto > /dev/null 2>&1) || \ + (echo "*** You need to install xmlto ***"; \ + exit 1) $(call cmd,db2ps) -quiet_cmd_db2pdf = PDF $@ - cmd_db2pdf = $(subst TYPE,pdf, $($(PDF_METHOD)template)) +quiet_cmd_db2pdf = XMLTO $@ + cmd_db2pdf = xmlto pdf $(XMLTOFLAGS) -o $(dir $@) $< %.pdf : %.xml + @(which xmlto > /dev/null 2>&1) || \ + (echo "*** You need to install xmlto ***"; \ + exit 1) $(call cmd,db2pdf) -quiet_cmd_db2html = HTML $@ +quiet_cmd_db2html = XMLTO $@ cmd_db2html = xmlto xhtml $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \ echo ' \ Goto $(patsubst %.html,%,$(notdir $@))

' > $@ @@ -145,7 +127,7 @@ quiet_cmd_db2html = HTML $@ @if [ ! -z "$(PNG-$(basename $(notdir $@)))" ]; then \ cp $(PNG-$(basename $(notdir $@))) $(patsubst %.html,%,$@); fi -quiet_cmd_db2man = MAN $@ +quiet_cmd_db2man = XMLTO $@ cmd_db2man = if grep -q refentry $<; then xmlto man $(XMLTOFLAGS) -o $(obj)/man $< ; gzip -f $(obj)/man/*.9; fi %.9 : %.xml @(which xmlto > /dev/null 2>&1) || \ diff --git a/trunk/Documentation/DocBook/kernel-api.tmpl b/trunk/Documentation/DocBook/kernel-api.tmpl index 767433bdbc40..a8316b1a3e3d 100644 --- a/trunk/Documentation/DocBook/kernel-api.tmpl +++ b/trunk/Documentation/DocBook/kernel-api.tmpl @@ -68,7 +68,9 @@ X!Iinclude/linux/kobject.h Kernel utility functions !Iinclude/linux/kernel.h -!Ekernel/printk.c + !Ekernel/panic.c !Ekernel/sys.c !Ekernel/rcupdate.c @@ -237,10 +239,8 @@ X!Ilib/string.c Driver Support !Enet/core/dev.c !Enet/ethernet/eth.c -!Iinclude/linux/etherdevice.h - +!Einclude/linux/etherdevice.h +!Enet/core/wireless.c Synchronous PPP !Edrivers/net/wan/syncppp.c @@ -388,7 +388,7 @@ X!Edrivers/pnp/system.c Block Devices -!Eblock/ll_rw_blk.c +!Edrivers/block/ll_rw_blk.c diff --git a/trunk/Documentation/DocBook/stylesheet.xsl b/trunk/Documentation/DocBook/stylesheet.xsl index 3ccce886c349..64be9f7ee3bb 100644 --- a/trunk/Documentation/DocBook/stylesheet.xsl +++ b/trunk/Documentation/DocBook/stylesheet.xsl @@ -3,5 +3,4 @@ 1 ansi 80 - diff --git a/trunk/Documentation/DocBook/usb.tmpl b/trunk/Documentation/DocBook/usb.tmpl index 320af25de3a2..15ce0f21e5e0 100644 --- a/trunk/Documentation/DocBook/usb.tmpl +++ b/trunk/Documentation/DocBook/usb.tmpl @@ -253,7 +253,6 @@ !Edrivers/usb/core/urb.c !Edrivers/usb/core/message.c !Edrivers/usb/core/file.c -!Edrivers/usb/core/driver.c !Edrivers/usb/core/usb.c !Edrivers/usb/core/hub.c diff --git a/trunk/Documentation/HOWTO b/trunk/Documentation/HOWTO deleted file mode 100644 index 6c9e746267da..000000000000 --- a/trunk/Documentation/HOWTO +++ /dev/null @@ -1,618 +0,0 @@ -HOWTO do Linux kernel development ---------------------------------- - -This is the be-all, end-all document on this topic. It contains -instructions on how to become a Linux kernel developer and how to learn -to work with the Linux kernel development community. It tries to not -contain anything related to the technical aspects of kernel programming, -but will help point you in the right direction for that. - -If anything in this document becomes out of date, please send in patches -to the maintainer of this file, who is listed at the bottom of the -document. - - -Introduction ------------- - -So, you want to learn how to become a Linux kernel developer? Or you -have been told by your manager, "Go write a Linux driver for this -device." This document's goal is to teach you everything you need to -know to achieve this by describing the process you need to go through, -and hints on how to work with the community. It will also try to -explain some of the reasons why the community works like it does. - -The kernel is written mostly in C, with some architecture-dependent -parts written in assembly. A good understanding of C is required for -kernel development. Assembly (any architecture) is not required unless -you plan to do low-level development for that architecture. Though they -are not a good substitute for a solid C education and/or years of -experience, the following books are good for, if anything, reference: - - "The C Programming Language" by Kernighan and Ritchie [Prentice Hall] - - "Practical C Programming" by Steve Oualline [O'Reilly] - -The kernel is written using GNU C and the GNU toolchain. While it -adheres to the ISO C89 standard, it uses a number of extensions that are -not featured in the standard. The kernel is a freestanding C -environment, with no reliance on the standard C library, so some -portions of the C standard are not supported. Arbitrary long long -divisions and floating point are not allowed. It can sometimes be -difficult to understand the assumptions the kernel has on the toolchain -and the extensions that it uses, and unfortunately there is no -definitive reference for them. Please check the gcc info pages (`info -gcc`) for some information on them. - -Please remember that you are trying to learn how to work with the -existing development community. It is a diverse group of people, with -high standards for coding, style and procedure. These standards have -been created over time based on what they have found to work best for -such a large and geographically dispersed team. Try to learn as much as -possible about these standards ahead of time, as they are well -documented; do not expect people to adapt to you or your company's way -of doing things. - - -Legal Issues ------------- - -The Linux kernel source code is released under the GPL. Please see the -file, COPYING, in the main directory of the source tree, for details on -the license. If you have further questions about the license, please -contact a lawyer, and do not ask on the Linux kernel mailing list. The -people on the mailing lists are not lawyers, and you should not rely on -their statements on legal matters. - -For common questions and answers about the GPL, please see: - http://www.gnu.org/licenses/gpl-faq.html - - -Documentation ------------- - -The Linux kernel source tree has a large range of documents that are -invaluable for learning how to interact with the kernel community. When -new features are added to the kernel, it is recommended that new -documentation files are also added which explain how to use the feature. -When a kernel change causes the interface that the kernel exposes to -userspace to change, it is recommended that you send the information or -a patch to the manual pages explaining the change to the manual pages -maintainer at mtk-manpages@gmx.net. - -Here is a list of files that are in the kernel source tree that are -required reading: - README - This file gives a short background on the Linux kernel and describes - what is necessary to do to configure and build the kernel. People - who are new to the kernel should start here. - - Documentation/Changes - This file gives a list of the minimum levels of various software - packages that are necessary to build and run the kernel - successfully. - - Documentation/CodingStyle - This describes the Linux kernel coding style, and some of the - rationale behind it. All new code is expected to follow the - guidelines in this document. Most maintainers will only accept - patches if these rules are followed, and many people will only - review code if it is in the proper style. - - Documentation/SubmittingPatches - Documentation/SubmittingDrivers - These files describe in explicit detail how to successfully create - and send a patch, including (but not limited to): - - Email contents - - Email format - - Who to send it to - Following these rules will not guarantee success (as all patches are - subject to scrutiny for content and style), but not following them - will almost always prevent it. - - Other excellent descriptions of how to create patches properly are: - "The Perfect Patch" - http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt - "Linux kernel patch submission format" - http://linux.yyz.us/patch-format.html - - Documentation/stable_api_nonsense.txt - This file describes the rationale behind the conscious decision to - not have a stable API within the kernel, including things like: - - Subsystem shim-layers (for compatibility?) - - Driver portability between Operating Systems. - - Mitigating rapid change within the kernel source tree (or - preventing rapid change) - This document is crucial for understanding the Linux development - philosophy and is very important for people moving to Linux from - development on other Operating Systems. - - Documentation/SecurityBugs - If you feel you have found a security problem in the Linux kernel, - please follow the steps in this document to help notify the kernel - developers, and help solve the issue. - - Documentation/ManagementStyle - This document describes how Linux kernel maintainers operate and the - shared ethos behind their methodologies. This is important reading - for anyone new to kernel development (or anyone simply curious about - it), as it resolves a lot of common misconceptions and confusion - about the unique behavior of kernel maintainers. - - Documentation/stable_kernel_rules.txt - This file describes the rules on how the stable kernel releases - happen, and what to do if you want to get a change into one of these - releases. - - Documentation/kernel-docs.txt - A list of external documentation that pertains to kernel - development. Please consult this list if you do not find what you - are looking for within the in-kernel documentation. - - Documentation/applying-patches.txt - A good introduction describing exactly what a patch is and how to - apply it to the different development branches of the kernel. - -The kernel also has a large number of documents that can be -automatically generated from the source code itself. This includes a -full description of the in-kernel API, and rules on how to handle -locking properly. The documents will be created in the -Documentation/DocBook/ directory and can be generated as PDF, -Postscript, HTML, and man pages by running: - make pdfdocs - make psdocs - make htmldocs - make mandocs -respectively from the main kernel source directory. - - -Becoming A Kernel Developer ---------------------------- - -If you do not know anything about Linux kernel development, you should -look at the Linux KernelNewbies project: - http://kernelnewbies.org -It consists of a helpful mailing list where you can ask almost any type -of basic kernel development question (make sure to search the archives -first, before asking something that has already been answered in the -past.) It also has an IRC channel that you can use to ask questions in -real-time, and a lot of helpful documentation that is useful for -learning about Linux kernel development. - -The website has basic information about code organization, subsystems, -and current projects (both in-tree and out-of-tree). It also describes -some basic logistical information, like how to compile a kernel and -apply a patch. - -If you do not know where you want to start, but you want to look for -some task to start doing to join into the kernel development community, -go to the Linux Kernel Janitor's project: - http://janitor.kernelnewbies.org/ -It is a great place to start. It describes a list of relatively simple -problems that need to be cleaned up and fixed within the Linux kernel -source tree. Working with the developers in charge of this project, you -will learn the basics of getting your patch into the Linux kernel tree, -and possibly be pointed in the direction of what to go work on next, if -you do not already have an idea. - -If you already have a chunk of code that you want to put into the kernel -tree, but need some help getting it in the proper form, the -kernel-mentors project was created to help you out with this. It is a -mailing list, and can be found at: - http://selenic.com/mailman/listinfo/kernel-mentors - -Before making any actual modifications to the Linux kernel code, it is -imperative to understand how the code in question works. For this -purpose, nothing is better than reading through it directly (most tricky -bits are commented well), perhaps even with the help of specialized -tools. One such tool that is particularly recommended is the Linux -Cross-Reference project, which is able to present source code in a -self-referential, indexed webpage format. An excellent up-to-date -repository of the kernel code may be found at: - http://sosdg.org/~coywolf/lxr/ - - -The development process ------------------------ - -Linux kernel development process currently consists of a few different -main kernel "branches" and lots of different subsystem-specific kernel -branches. These different branches are: - - main 2.6.x kernel tree - - 2.6.x.y -stable kernel tree - - 2.6.x -git kernel patches - - 2.6.x -mm kernel patches - - subsystem specific kernel trees and patches - -2.6.x kernel tree ------------------ -2.6.x kernels are maintained by Linus Torvalds, and can be found on -kernel.org in the pub/linux/kernel/v2.6/ directory. Its development -process is as follows: - - As soon as a new kernel is released a two weeks window is open, - during this period of time maintainers can submit big diffs to - Linus, usually the patches that have already been included in the - -mm kernel for a few weeks. The preferred way to submit big changes - is using git (the kernel's source management tool, more information - can be found at http://git.or.cz/) but plain patches are also just - fine. - - After two weeks a -rc1 kernel is released it is now possible to push - only patches that do not include new features that could affect the - stability of the whole kernel. Please note that a whole new driver - (or filesystem) might be accepted after -rc1 because there is no - risk of causing regressions with such a change as long as the change - is self-contained and does not affect areas outside of the code that - is being added. git can be used to send patches to Linus after -rc1 - is released, but the patches need to also be sent to a public - mailing list for review. - - A new -rc is released whenever Linus deems the current git tree to - be in a reasonably sane state adequate for testing. The goal is to - release a new -rc kernel every week. - - Process continues until the kernel is considered "ready", the - process should last around 6 weeks. - -It is worth mentioning what Andrew Morton wrote on the linux-kernel -mailing list about kernel releases: - "Nobody knows when a kernel will be released, because it's - released according to perceived bug status, not according to a - preconceived timeline." - -2.6.x.y -stable kernel tree ---------------------------- -Kernels with 4 digit versions are -stable kernels. They contain -relatively small and critical fixes for security problems or significant -regressions discovered in a given 2.6.x kernel. - -This is the recommended branch for users who want the most recent stable -kernel and are not interested in helping test development/experimental -versions. - -If no 2.6.x.y kernel is available, then the highest numbered 2.6.x -kernel is the current stable kernel. - -2.6.x.y are maintained by the "stable" team , and are -released almost every other week. - -The file Documentation/stable_kernel_rules.txt in the kernel tree -documents what kinds of changes are acceptable for the -stable tree, and -how the release process works. - -2.6.x -git patches ------------------- -These are daily snapshots of Linus' kernel tree which are managed in a -git repository (hence the name.) These patches are usually released -daily and represent the current state of Linus' tree. They are more -experimental than -rc kernels since they are generated automatically -without even a cursory glance to see if they are sane. - -2.6.x -mm kernel patches ------------------------- -These are experimental kernel patches released by Andrew Morton. Andrew -takes all of the different subsystem kernel trees and patches and mushes -them together, along with a lot of patches that have been plucked from -the linux-kernel mailing list. This tree serves as a proving ground for -new features and patches. Once a patch has proved its worth in -mm for -a while Andrew or the subsystem maintainer pushes it on to Linus for -inclusion in mainline. - -It is heavily encouraged that all new patches get tested in the -mm tree -before they are sent to Linus for inclusion in the main kernel tree. - -These kernels are not appropriate for use on systems that are supposed -to be stable and they are more risky to run than any of the other -branches. - -If you wish to help out with the kernel development process, please test -and use these kernel releases and provide feedback to the linux-kernel -mailing list if you have any problems, and if everything works properly. - -In addition to all the other experimental patches, these kernels usually -also contain any changes in the mainline -git kernels available at the -time of release. - -The -mm kernels are not released on a fixed schedule, but usually a few --mm kernels are released in between each -rc kernel (1 to 3 is common). - -Subsystem Specific kernel trees and patches -------------------------------------------- -A number of the different kernel subsystem developers expose their -development trees so that others can see what is happening in the -different areas of the kernel. These trees are pulled into the -mm -kernel releases as described above. - -Here is a list of some of the different kernel trees available: - git trees: - - Kbuild development tree, Sam Ravnborg - kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git - - - ACPI development tree, Len Brown - kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git - - - Block development tree, Jens Axboe - kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git - - - DRM development tree, Dave Airlie - kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git - - - ia64 development tree, Tony Luck - kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git - - - ieee1394 development tree, Jody McIntyre - kernel.org:/pub/scm/linux/kernel/git/scjody/ieee1394.git - - - infiniband, Roland Dreier - kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git - - - libata, Jeff Garzik - kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git - - - network drivers, Jeff Garzik - kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git - - - pcmcia, Dominik Brodowski - kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git - - - SCSI, James Bottomley - kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git - - Other git kernel trees can be found listed at http://kernel.org/git - - quilt trees: - - USB, PCI, Driver Core, and I2C, Greg Kroah-Hartman - kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ - - -Bug Reporting -------------- - -bugzilla.kernel.org is where the Linux kernel developers track kernel -bugs. Users are encouraged to report all bugs that they find in this -tool. For details on how to use the kernel bugzilla, please see: - http://test.kernel.org/bugzilla/faq.html - -The file REPORTING-BUGS in the main kernel source directory has a good -template for how to report a possible kernel bug, and details what kind -of information is needed by the kernel developers to help track down the -problem. - - -Mailing lists -------------- - -As some of the above documents describe, the majority of the core kernel -developers participate on the Linux Kernel Mailing list. Details on how -to subscribe and unsubscribe from the list can be found at: - http://vger.kernel.org/vger-lists.html#linux-kernel -There are archives of the mailing list on the web in many different -places. Use a search engine to find these archives. For example: - http://dir.gmane.org/gmane.linux.kernel -It is highly recommended that you search the archives about the topic -you want to bring up, before you post it to the list. A lot of things -already discussed in detail are only recorded at the mailing list -archives. - -Most of the individual kernel subsystems also have their own separate -mailing list where they do their development efforts. See the -MAINTAINERS file for a list of what these lists are for the different -groups. - -Many of the lists are hosted on kernel.org. Information on them can be -found at: - http://vger.kernel.org/vger-lists.html - -Please remember to follow good behavioral habits when using the lists. -Though a bit cheesy, the following URL has some simple guidelines for -interacting with the list (or any list): - http://www.albion.com/netiquette/ - -If multiple people respond to your mail, the CC: list of recipients may -get pretty large. Don't remove anybody from the CC: list without a good -reason, or don't reply only to the list address. Get used to receiving the -mail twice, one from the sender and the one from the list, and don't try -to tune that by adding fancy mail-headers, people will not like it. - -Remember to keep the context and the attribution of your replies intact, -keep the "John Kernelhacker wrote ...:" lines at the top of your reply, and -add your statements between the individual quoted sections instead of -writing at the top of the mail. - -If you add patches to your mail, make sure they are plain readable text -as stated in Documentation/SubmittingPatches. Kernel developers don't -want to deal with attachments or compressed patches; they may want -to comment on individual lines of your patch, which works only that way. -Make sure you use a mail program that does not mangle spaces and tab -characters. A good first test is to send the mail to yourself and try -to apply your own patch by yourself. If that doesn't work, get your -mail program fixed or change it until it works. - -Above all, please remember to show respect to other subscribers. - - -Working with the community --------------------------- - -The goal of the kernel community is to provide the best possible kernel -there is. When you submit a patch for acceptance, it will be reviewed -on its technical merits and those alone. So, what should you be -expecting? - - criticism - - comments - - requests for change - - requests for justification - - silence - -Remember, this is part of getting your patch into the kernel. You have -to be able to take criticism and comments about your patches, evaluate -them at a technical level and either rework your patches or provide -clear and concise reasoning as to why those changes should not be made. -If there are no responses to your posting, wait a few days and try -again, sometimes things get lost in the huge volume. - -What should you not do? - - expect your patch to be accepted without question - - become defensive - - ignore comments - - resubmit the patch without making any of the requested changes - -In a community that is looking for the best technical solution possible, -there will always be differing opinions on how beneficial a patch is. -You have to be cooperative, and willing to adapt your idea to fit within -the kernel. Or at least be willing to prove your idea is worth it. -Remember, being wrong is acceptable as long as you are willing to work -toward a solution that is right. - -It is normal that the answers to your first patch might simply be a list -of a dozen things you should correct. This does _not_ imply that your -patch will not be accepted, and it is _not_ meant against you -personally. Simply correct all issues raised against your patch and -resend it. - - -Differences between the kernel community and corporate structures ------------------------------------------------------------------ - -The kernel community works differently than most traditional corporate -development environments. Here are a list of things that you can try to -do to try to avoid problems: - Good things to say regarding your proposed changes: - - "This solves multiple problems." - - "This deletes 2000 lines of code." - - "Here is a patch that explains what I am trying to describe." - - "I tested it on 5 different architectures..." - - "Here is a series of small patches that..." - - "This increases performance on typical machines..." - - Bad things you should avoid saying: - - "We did it this way in AIX/ptx/Solaris, so therefore it must be - good..." - - "I've being doing this for 20 years, so..." - - "This is required for my company to make money" - - "This is for our Enterprise product line." - - "Here is my 1000 page design document that describes my idea" - - "I've been working on this for 6 months..." - - "Here's a 5000 line patch that..." - - "I rewrote all of the current mess, and here it is..." - - "I have a deadline, and this patch needs to be applied now." - -Another way the kernel community is different than most traditional -software engineering work environments is the faceless nature of -interaction. One benefit of using email and irc as the primary forms of -communication is the lack of discrimination based on gender or race. -The Linux kernel work environment is accepting of women and minorities -because all you are is an email address. The international aspect also -helps to level the playing field because you can't guess gender based on -a person's name. A man may be named Andrea and a woman may be named Pat. -Most women who have worked in the Linux kernel and have expressed an -opinion have had positive experiences. - -The language barrier can cause problems for some people who are not -comfortable with English. A good grasp of the language can be needed in -order to get ideas across properly on mailing lists, so it is -recommended that you check your emails to make sure they make sense in -English before sending them. - - -Break up your changes ---------------------- - -The Linux kernel community does not gladly accept large chunks of code -dropped on it all at once. The changes need to be properly introduced, -discussed, and broken up into tiny, individual portions. This is almost -the exact opposite of what companies are used to doing. Your proposal -should also be introduced very early in the development process, so that -you can receive feedback on what you are doing. It also lets the -community feel that you are working with them, and not simply using them -as a dumping ground for your feature. However, don't send 50 emails at -one time to a mailing list, your patch series should be smaller than -that almost all of the time. - -The reasons for breaking things up are the following: - -1) Small patches increase the likelihood that your patches will be - applied, since they don't take much time or effort to verify for - correctness. A 5 line patch can be applied by a maintainer with - barely a second glance. However, a 500 line patch may take hours to - review for correctness (the time it takes is exponentially - proportional to the size of the patch, or something). - - Small patches also make it very easy to debug when something goes - wrong. It's much easier to back out patches one by one than it is - to dissect a very large patch after it's been applied (and broken - something). - -2) It's important not only to send small patches, but also to rewrite - and simplify (or simply re-order) patches before submitting them. - -Here is an analogy from kernel developer Al Viro: - "Think of a teacher grading homework from a math student. The - teacher does not want to see the student's trials and errors - before they came up with the solution. They want to see the - cleanest, most elegant answer. A good student knows this, and - would never submit her intermediate work before the final - solution." - - The same is true of kernel development. The maintainers and - reviewers do not want to see the thought process behind the - solution to the problem one is solving. They want to see a - simple and elegant solution." - -It may be challenging to keep the balance between presenting an elegant -solution and working together with the community and discussing your -unfinished work. Therefore it is good to get early in the process to -get feedback to improve your work, but also keep your changes in small -chunks that they may get already accepted, even when your whole task is -not ready for inclusion now. - -Also realize that it is not acceptable to send patches for inclusion -that are unfinished and will be "fixed up later." - - -Justify your change -------------------- - -Along with breaking up your patches, it is very important for you to let -the Linux community know why they should add this change. New features -must be justified as being needed and useful. - - -Document your change --------------------- - -When sending in your patches, pay special attention to what you say in -the text in your email. This information will become the ChangeLog -information for the patch, and will be preserved for everyone to see for -all time. It should describe the patch completely, containing: - - why the change is necessary - - the overall design approach in the patch - - implementation details - - testing results - -For more details on what this should all look like, please see the -ChangeLog section of the document: - "The Perfect Patch" - http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt - - - - -All of these things are sometimes very hard to do. It can take years to -perfect these practices (if at all). It's a continuous process of -improvement that requires a lot of patience and determination. But -don't give up, it's possible. Many have done it before, and each had to -start exactly where you are now. - - - - ----------- -Thanks to Paolo Ciarrocchi who allowed the "Development Process" section -to be based on text he had written, and to Randy Dunlap and Gerrit -Huizenga for some of the list of things you should and should not say. -Also thanks to Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers, -Vojtech Pavlik, Jan Kara, Josh Boyer, Kees Cook, Andrew Morton, Andi -Kleen, Vadim Lobanov, Jesper Juhl, Adrian Bunk, Keri Harris, Frans Pop, -David A. Wheeler, Junio Hamano, Michael Kerrisk, and Alex Shepard for -their review, comments, and contributions. Without their help, this -document would not have been possible. - - - -Maintainer: Greg Kroah-Hartman diff --git a/trunk/Documentation/arm/00-INDEX b/trunk/Documentation/arm/00-INDEX index 2c6a3b38967e..d753fe59a248 100644 --- a/trunk/Documentation/arm/00-INDEX +++ b/trunk/Documentation/arm/00-INDEX @@ -16,7 +16,5 @@ empeg - Empeg documentation mem_alignment - alignment abort handler documentation -memory.txt - - description of the virtual memory layout nwfpe - NWFPE floating point emulator documentation diff --git a/trunk/Documentation/arm/VFP/release-notes.txt b/trunk/Documentation/arm/VFP/release-notes.txt index 28a2795705ca..f28e0222f5e5 100644 --- a/trunk/Documentation/arm/VFP/release-notes.txt +++ b/trunk/Documentation/arm/VFP/release-notes.txt @@ -12,7 +12,7 @@ This release has been validated against the SoftFloat-2b library by John R. Hauser using the TestFloat-2a test suite. Details of this library and test suite can be found at: - http://www.jhauser.us/arithmetic/SoftFloat.html + http://www.cs.berkeley.edu/~jhauser/arithmetic/SoftFloat.html The operations which have been tested with this package are: diff --git a/trunk/Documentation/arm/memory.txt b/trunk/Documentation/arm/memory.txt index dc6045577a8b..4b1c93a8177b 100644 --- a/trunk/Documentation/arm/memory.txt +++ b/trunk/Documentation/arm/memory.txt @@ -1,7 +1,7 @@ Kernel Memory Layout on ARM Linux Russell King - November 17, 2005 (2.6.15) + May 21, 2004 (2.6.6) This document describes the virtual memory layout which the Linux kernel uses for ARM processors. It indicates which regions are @@ -37,8 +37,6 @@ ff000000 ffbfffff Reserved for future expansion of DMA mapping region. VMALLOC_END feffffff Free for platform use, recommended. - VMALLOC_END must be aligned to a 2MB - boundary. VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space. Memory returned by vmalloc/ioremap will diff --git a/trunk/Documentation/atomic_ops.txt b/trunk/Documentation/atomic_ops.txt index 23a1c2402bcc..8eedaa24f5e2 100644 --- a/trunk/Documentation/atomic_ops.txt +++ b/trunk/Documentation/atomic_ops.txt @@ -115,33 +115,6 @@ boolean is return which indicates whether the resulting counter value is negative. It requires explicit memory barrier semantics around the operation. -Then: - - int atomic_cmpxchg(atomic_t *v, int old, int new); - -This performs an atomic compare exchange operation on the atomic value v, -with the given old and new values. Like all atomic_xxx operations, -atomic_cmpxchg will only satisfy its atomicity semantics as long as all -other accesses of *v are performed through atomic_xxx operations. - -atomic_cmpxchg requires explicit memory barriers around the operation. - -The semantics for atomic_cmpxchg are the same as those defined for 'cas' -below. - -Finally: - - int atomic_add_unless(atomic_t *v, int a, int u); - -If the atomic value v is not equal to u, this function adds a to v, and -returns non zero. If v is equal to u then it returns zero. This is done as -an atomic operation. - -atomic_add_unless requires explicit memory barriers around the operation. - -atomic_inc_not_zero, equivalent to atomic_add_unless(v, 1, 0) - - If a caller requires memory barrier semantics around an atomic_t operation which does not return a value, a set of interfaces are defined which accomplish this: diff --git a/trunk/Documentation/block/biodoc.txt b/trunk/Documentation/block/biodoc.txt index 0fe01c805480..2d65c2182161 100644 --- a/trunk/Documentation/block/biodoc.txt +++ b/trunk/Documentation/block/biodoc.txt @@ -1063,8 +1063,8 @@ Aside: 4.4 I/O contexts I/O contexts provide a dynamically allocated per process data area. They may be used in I/O schedulers, and in the block layer (could be used for IO statis, -priorities for example). See *io_context in block/ll_rw_blk.c, and as-iosched.c -for an example of usage in an i/o scheduler. +priorities for example). See *io_context in drivers/block/ll_rw_blk.c, and +as-iosched.c for an example of usage in an i/o scheduler. 5. Scalability related changes diff --git a/trunk/Documentation/cpu-freq/governors.txt b/trunk/Documentation/cpu-freq/governors.txt index f4b8dc4237e6..933fae74c337 100644 --- a/trunk/Documentation/cpu-freq/governors.txt +++ b/trunk/Documentation/cpu-freq/governors.txt @@ -27,7 +27,6 @@ Contents: 2.2 Powersave 2.3 Userspace 2.4 Ondemand -2.5 Conservative 3. The Governor Interface in the CPUfreq Core @@ -111,64 +110,9 @@ directory. The CPUfreq govenor "ondemand" sets the CPU depending on the current usage. To do this the CPU must have the capability to -switch the frequency very quickly. There are a number of sysfs file -accessible parameters: - -sampling_rate: measured in uS (10^-6 seconds), this is how often you -want the kernel to look at the CPU usage and to make decisions on -what to do about the frequency. Typically this is set to values of -around '10000' or more. - -show_sampling_rate_(min|max): the minimum and maximum sampling rates -available that you may set 'sampling_rate' to. - -up_threshold: defines what the average CPU usaged between the samplings -of 'sampling_rate' needs to be for the kernel to make a decision on -whether it should increase the frequency. For example when it is set -to its default value of '80' it means that between the checking -intervals the CPU needs to be on average more than 80% in use to then -decide that the CPU frequency needs to be increased. - -sampling_down_factor: this parameter controls the rate that the CPU -makes a decision on when to decrease the frequency. When set to its -default value of '5' it means that at 1/5 the sampling_rate the kernel -makes a decision to lower the frequency. Five "lower rate" decisions -have to be made in a row before the CPU frequency is actually lower. -If set to '1' then the frequency decreases as quickly as it increases, -if set to '2' it decreases at half the rate of the increase. - -ignore_nice_load: this parameter takes a value of '0' or '1', when set -to '0' (its default) then all processes are counted towards towards the -'cpu utilisation' value. When set to '1' then processes that are -run with a 'nice' value will not count (and thus be ignored) in the -overal usage calculation. This is useful if you are running a CPU -intensive calculation on your laptop that you do not care how long it -takes to complete as you can 'nice' it and prevent it from taking part -in the deciding process of whether to increase your CPU frequency. - - -2.5 Conservative ----------------- - -The CPUfreq governor "conservative", much like the "ondemand" -governor, sets the CPU depending on the current usage. It differs in -behaviour in that it gracefully increases and decreases the CPU speed -rather than jumping to max speed the moment there is any load on the -CPU. This behaviour more suitable in a battery powered environment. -The governor is tweaked in the same manner as the "ondemand" governor -through sysfs with the addition of: - -freq_step: this describes what percentage steps the cpu freq should be -increased and decreased smoothly by. By default the cpu frequency will -increase in 5% chunks of your maximum cpu frequency. You can change this -value to anywhere between 0 and 100 where '0' will effectively lock your -CPU at a speed regardless of its load whilst '100' will, in theory, make -it behave identically to the "ondemand" governor. - -down_threshold: same as the 'up_threshold' found for the "ondemand" -governor but for the opposite direction. For example when set to its -default value of '20' it means that if the CPU usage needs to be below -20% between samples to have the frequency decreased. +switch the frequency very fast. + + 3. The Governor Interface in the CPUfreq Core ============================================= diff --git a/trunk/Documentation/devices.txt b/trunk/Documentation/devices.txt index 3c406acd4dfa..0f515175c72a 100644 --- a/trunk/Documentation/devices.txt +++ b/trunk/Documentation/devices.txt @@ -2903,14 +2903,14 @@ Your cooperation is appreciated. 196 = /dev/dvb/adapter3/video0 first video decoder of fourth card -216 char Bluetooth RFCOMM TTY devices - 0 = /dev/rfcomm0 First Bluetooth RFCOMM TTY device - 1 = /dev/rfcomm1 Second Bluetooth RFCOMM TTY device +216 char USB BlueTooth devices + 0 = /dev/ttyUB0 First USB BlueTooth device + 1 = /dev/ttyUB1 Second USB BlueTooth device ... -217 char Bluetooth RFCOMM TTY devices (alternate devices) - 0 = /dev/curf0 Callout device for rfcomm0 - 1 = /dev/curf1 Callout device for rfcomm1 +217 char USB BlueTooth devices (alternate devices) + 0 = /dev/cuub0 Callout device for ttyUB0 + 1 = /dev/cuub1 Callout device for ttyUB1 ... 218 char The Logical Company bus Unibus/Qbus adapters diff --git a/trunk/Documentation/dvb/README.dvb-usb b/trunk/Documentation/dvb/README.dvb-usb index 46b78b7331c2..ac0797ea646c 100644 --- a/trunk/Documentation/dvb/README.dvb-usb +++ b/trunk/Documentation/dvb/README.dvb-usb @@ -50,12 +50,12 @@ http://www.linuxtv.org/wiki/index.php/DVB_USB 0. History & News: 2005-06-30 - added support for WideView WT-220U (Thanks to Steve Chang) 2005-05-30 - added basic isochronous support to the dvb-usb-framework - added support for Conexant Hybrid reference design and Nebula DigiTV USB + added support for Conexant Hybrid reference design and Nebula DigiTV USB 2005-04-17 - all dibusb devices ported to make use of the dvb-usb-framework 2005-04-02 - re-enabled and improved remote control code. 2005-03-31 - ported the Yakumo/Hama/Typhoon DVB-T USB2.0 device to dvb-usb. 2005-03-30 - first commit of the dvb-usb-module based on the dibusb-source. First device is a new driver for the - TwinhanDTV Alpha / MagicBox II USB2.0-only DVB-T device. + TwinhanDTV Alpha / MagicBox II USB2.0-only DVB-T device. (change from dvb-dibusb to dvb-usb) 2005-03-28 - added support for the AVerMedia AverTV DVB-T USB2.0 device (Thanks to Glen Harris and Jiun-Kuei Jung, AVerMedia) @@ -64,50 +64,50 @@ http://www.linuxtv.org/wiki/index.php/DVB_USB 2005-02-02 - added support for the Hauppauge Win-TV Nova-T USB2 2005-01-31 - distorted streaming is gone for USB1.1 devices 2005-01-13 - moved the mirrored pid_filter_table back to dvb-dibusb - - first almost working version for HanfTek UMT-010 - - found out, that Yakumo/HAMA/Typhoon are predecessors of the HanfTek UMT-010 + - first almost working version for HanfTek UMT-010 + - found out, that Yakumo/HAMA/Typhoon are predecessors of the HanfTek UMT-010 2005-01-10 - refactoring completed, now everything is very delightful - - tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a - Panasonic Tuner assembled). Tunerprobing implemented. Thanks a lot to Gunnar Wittich. + - tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a + Panasonic Tuner assembled). Tunerprobing implemented. Thanks a lot to Gunnar Wittich. 2004-12-29 - after several days of struggling around bug of no returning URBs fixed. 2004-12-26 - refactored the dibusb-driver, splitted into separate files - - i2c-probing enabled + - i2c-probing enabled 2004-12-06 - possibility for demod i2c-address probing - - new usb IDs (Compro, Artec) + - new usb IDs (Compro, Artec) 2004-11-23 - merged changes from DiB3000MC_ver2.1 - - revised the debugging - - possibility to deliver the complete TS for USB2.0 + - revised the debugging + - possibility to deliver the complete TS for USB2.0 2004-11-21 - first working version of the dib3000mc/p frontend driver. 2004-11-12 - added additional remote control keys. Thanks to Uwe Hanke. 2004-11-07 - added remote control support. Thanks to David Matthews. 2004-11-05 - added support for a new devices (Grandtec/Avermedia/Artec) - - merged my changes (for dib3000mb/dibusb) to the FE_REFACTORING, because it became HEAD - - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems - better settled there (added xfer_ops-struct) - - created a common files for frontends (mc/p/mb) + - merged my changes (for dib3000mb/dibusb) to the FE_REFACTORING, because it became HEAD + - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems + better settled there (added xfer_ops-struct) + - created a common files for frontends (mc/p/mb) 2004-09-28 - added support for a new device (Unkown, vendor ID is Hyper-Paltek) 2004-09-20 - added support for a new device (Compro DVB-U2000), thanks - to Amaury Demol for reporting - - changed usb TS transfer method (several urbs, stopping transfer - before setting a new pid) + to Amaury Demol for reporting + - changed usb TS transfer method (several urbs, stopping transfer + before setting a new pid) 2004-09-13 - added support for a new device (Artec T1 USB TVBOX), thanks - to Christian Motschke for reporting + to Christian Motschke for reporting 2004-09-05 - released the dibusb device and dib3000mb-frontend driver (old news for vp7041.c) 2004-07-15 - found out, by accident, that the device has a TUA6010XS for - PLL + PLL 2004-07-12 - figured out, that the driver should also work with the - CTS Portable (Chinese Television System) + CTS Portable (Chinese Television System) 2004-07-08 - firmware-extraction-2.422-problem solved, driver is now working - properly with firmware extracted from 2.422 - - #if for 2.6.4 (dvb), compile issue - - changed firmware handling, see vp7041.txt sec 1.1 + properly with firmware extracted from 2.422 + - #if for 2.6.4 (dvb), compile issue + - changed firmware handling, see vp7041.txt sec 1.1 2004-07-02 - some tuner modifications, v0.1, cleanups, first public 2004-06-28 - now using the dvb_dmx_swfilter_packets, everything - runs fine now + runs fine now 2004-06-27 - able to watch and switching channels (pre-alpha) - - no section filtering yet + - no section filtering yet 2004-06-06 - first TS received, but kernel oops :/ 2004-05-14 - firmware loader is working 2004-05-11 - start writing the driver diff --git a/trunk/Documentation/dvb/README.flexcop b/trunk/Documentation/dvb/README.flexcop index 5515469de7cf..a50c70f9ca72 100644 --- a/trunk/Documentation/dvb/README.flexcop +++ b/trunk/Documentation/dvb/README.flexcop @@ -174,7 +174,7 @@ Debugging Everything which is identical in the following table, can be put into a common flexcop-module. - PCI USB + PCI USB ------------------------------------------------------------------------------- Different: Register access: accessing IO memory USB control message diff --git a/trunk/Documentation/dvb/avermedia.txt b/trunk/Documentation/dvb/avermedia.txt index 2dc260b2b0a4..09020ebd202b 100644 --- a/trunk/Documentation/dvb/avermedia.txt +++ b/trunk/Documentation/dvb/avermedia.txt @@ -1,6 +1,6 @@ HOWTO: Get An Avermedia DVB-T working under Linux - ______________________________________________ + ______________________________________________ Table of Contents Assumptions and Introduction diff --git a/trunk/Documentation/dvb/cards.txt b/trunk/Documentation/dvb/cards.txt index 9e10092440e1..19329cf7b097 100644 --- a/trunk/Documentation/dvb/cards.txt +++ b/trunk/Documentation/dvb/cards.txt @@ -16,7 +16,7 @@ Hardware supported by the linuxtv.org DVB drivers shielding, and the whole metal box has its own part number. -o Frontends drivers: +o Frontends drivers: - dvb_dummy_fe: for testing... DVB-S: - ves1x93 : Alps BSRV2 (ves1893 demodulator) and dbox2 (ves1993) @@ -24,7 +24,7 @@ o Frontends drivers: - grundig_29504-491 : Grundig 29504-491 (Philips TDA8083 demodulator), tsa5522 PLL - mt312 : Zarlink mt312 or Mitel vp310 demodulator, sl1935 or tsa5059 PLL - stv0299 : Alps BSRU6 (tsa5059 PLL), LG TDQB-S00x (tsa5059 PLL), - LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL), + LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL), Philips SU1278SH (tsa5059 PLL), Samsung TBMU24112IMB DVB-C: - ves1820 : various (ves1820 demodulator, sp5659c or spXXXX PLL) @@ -35,8 +35,8 @@ o Frontends drivers: - grundig_29504-401 : Grundig 29504-401 (LSI L64781 demodulator), tsa5060 PLL - tda1004x : Philips tda10045h (td1344 or tdm1316l PLL) - nxt6000 : Alps TDME7 (MITEL SP5659 PLL), Alps TDED4 (TI ALP510 PLL), - Comtech DVBT-6k07 (SP5730 PLL) - (NxtWave Communications NXT6000 demodulator) + Comtech DVBT-6k07 (SP5730 PLL) + (NxtWave Communications NXT6000 demodulator) - sp887x : Microtune 7202D - dib3000mb : DiBcom 3000-MB demodulator DVB-S/C/T: diff --git a/trunk/Documentation/dvb/contributors.txt b/trunk/Documentation/dvb/contributors.txt index 4c33cced5f65..2cbd2d0f6fdf 100644 --- a/trunk/Documentation/dvb/contributors.txt +++ b/trunk/Documentation/dvb/contributors.txt @@ -15,7 +15,7 @@ Michael Holzt Diego Picciani for CyberLogin for Linux which allows logging onto EON - (in case you are wondering where CyberLogin is, EON changed its login + (in case you are wondering where CyberLogin is, EON changed its login procedure and CyberLogin is no longer used.) Martin Schaller @@ -57,7 +57,7 @@ Augusto Cardoso Davor Emard for his work on the budget drivers, the demux code, the module unloading problems, ... - + Hans-Frieder Vogt for his work on calculating and checking the crc's for the TechnoTrend/Hauppauge DEC driver firmware diff --git a/trunk/Documentation/dvb/faq.txt b/trunk/Documentation/dvb/faq.txt index a42132d60dc8..3bf51e45c972 100644 --- a/trunk/Documentation/dvb/faq.txt +++ b/trunk/Documentation/dvb/faq.txt @@ -60,6 +60,7 @@ Some very frequently asked questions about linuxtv-dvb Metzler Bros. DVB development; alternate drivers and DVB utilities, include dvb-mpegtools and tuxzap. + http://www.linuxstb.org/ http://sourceforge.net/projects/dvbtools/ Dave Chapman's dvbtools package, including dvbstream and dvbtune diff --git a/trunk/Documentation/dvb/readme.txt b/trunk/Documentation/dvb/readme.txt index f5c50b22de3b..754c98c6ad94 100644 --- a/trunk/Documentation/dvb/readme.txt +++ b/trunk/Documentation/dvb/readme.txt @@ -20,7 +20,7 @@ http://linuxtv.org/downloads/ What's inside this directory: -"cards.txt" +"cards.txt" contains a list of supported hardware. "contributors.txt" @@ -37,7 +37,7 @@ that require it. contains detailed informations about the TT DEC2000/DEC3000 USB DVB hardware. -"bt8xx.txt" +"bt8xx.txt" contains detailed installation instructions for the various bt8xx based "budget" DVB cards (Nebula, Pinnacle PCTV, Twinhan DST) diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index 9b743198f77a..429db4bf98ec 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -140,22 +140,3 @@ What: EXPORT_SYMBOL(lookup_hash) When: January 2006 Why: Too low-level interface. Use lookup_one_len or lookup_create instead. Who: Christoph Hellwig - ---------------------------- - -What: START_ARRAY ioctl for md -When: July 2006 -Files: drivers/md/md.c -Why: Not reliable by design - can fail when most needed. - Alternatives exist -Who: NeilBrown - ---------------------------- - -What: au1x00_uart driver -When: January 2006 -Why: The 8250 serial driver now has the ability to deal with the differences - between the standard 8250 family of UARTs and their slightly strange - brother on Alchemy SOCs. The loss of features is not considered an - issue. -Who: Ralf Baechle diff --git a/trunk/Documentation/filesystems/affs.txt b/trunk/Documentation/filesystems/affs.txt index 2d1524469c25..30c9738590f4 100644 --- a/trunk/Documentation/filesystems/affs.txt +++ b/trunk/Documentation/filesystems/affs.txt @@ -216,4 +216,4 @@ due to an incompatibility with the Amiga floppy controller. If you are interested in an Amiga Emulator for Linux, look at -http://www.freiburg.linux.de/~uae/ +http://www-users.informatik.rwth-aachen.de/~crux/uae.html diff --git a/trunk/Documentation/filesystems/ext2.txt b/trunk/Documentation/filesystems/ext2.txt index 3dd2872416a1..a8edb376b041 100644 --- a/trunk/Documentation/filesystems/ext2.txt +++ b/trunk/Documentation/filesystems/ext2.txt @@ -369,8 +369,9 @@ The kernel source file:/usr/src/linux/fs/ext2/ e2fsprogs (e2fsck) http://e2fsprogs.sourceforge.net/ Design & Implementation http://e2fsprogs.sourceforge.net/ext2intro.html Journaling (ext3) ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/ +Hashed Directories http://kernelnewbies.org/~phillips/htree/ Filesystem Resizing http://ext2resize.sourceforge.net/ -Compression (*) http://e2compr.sourceforge.net/ +Compression (*) http://www.netspace.net.au/~reiter/e2compr/ Implementations for: Windows 95/98/NT/2000 http://uranus.it.swin.edu.au/~jn/linux/Explore2fs.htm diff --git a/trunk/Documentation/filesystems/ext3.txt b/trunk/Documentation/filesystems/ext3.txt index 9840d5b8d5b9..9ab7f446f7ad 100644 --- a/trunk/Documentation/filesystems/ext3.txt +++ b/trunk/Documentation/filesystems/ext3.txt @@ -57,19 +57,19 @@ oldalloc This disables the Orlov block allocator and enables the we'd like to get some feedback if it's the contrary for you. -user_xattr Enables Extended User Attributes. Additionally, you need - to have extended attribute support enabled in the kernel - configuration (CONFIG_EXT3_FS_XATTR). See the attr(5) - manual page and http://acl.bestbits.at to learn more - about extended attributes. - -nouser_xattr Disables Extended User Attributes. - -acl Enables POSIX Access Control Lists support. Additionally, - you need to have ACL support enabled in the kernel - configuration (CONFIG_EXT3_FS_POSIX_ACL). See the acl(5) - manual page and http://acl.bestbits.at for more - information. +user_xattr (*) Enables POSIX Extended Attributes. It's enabled by + default, however you need to confifure its support + (CONFIG_EXT3_FS_XATTR). This is neccesary if you want + to use POSIX Acces Control Lists support. You can visit + http://acl.bestbits.at to know more about POSIX Extended + attributes. + +nouser_xattr Disables POSIX Extended Attributes. + +acl (*) Enables POSIX Access Control Lists support. This is + enabled by default, however you need to configure + its support (CONFIG_EXT3_FS_POSIX_ACL). If you want + to know more about ACLs visit http://acl.bestbits.at noacl This option disables POSIX Access Control List support. diff --git a/trunk/Documentation/floppy.txt b/trunk/Documentation/floppy.txt index 6ccab88705cb..6fb10fcd82fb 100644 --- a/trunk/Documentation/floppy.txt +++ b/trunk/Documentation/floppy.txt @@ -4,7 +4,7 @@ FAQ list: ========= A FAQ list may be found in the fdutils package (see below), and also -at . +at http://fdutils.linux.lu/FAQ.html LILO configuration options (Thinkpad users, read this) @@ -217,10 +217,10 @@ It also contains additional documentation about the floppy driver. The latest version can be found at fdutils homepage: http://fdutils.linux.lu -The fdutils releases can be found at: - http://fdutils.linux.lu/download.html - http://www.tux.org/pub/knaff/fdutils/ - ftp://metalab.unc.edu/pub/Linux/utils/disk-management/ +The fdutils-5.4 release can be found at: + http://fdutils.linux.lu/fdutils-5.4.src.tar.gz + http://www.tux.org/pub/knaff/fdutils/fdutils-5.4.src.tar.gz + ftp://metalab.unc.edu/pub/Linux/utils/disk-management/fdutils-5.4.src.tar.gz Reporting problems about the floppy driver ========================================== diff --git a/trunk/Documentation/ioctl-number.txt b/trunk/Documentation/ioctl-number.txt index aa7ba00ec082..87f4d052e39c 100644 --- a/trunk/Documentation/ioctl-number.txt +++ b/trunk/Documentation/ioctl-number.txt @@ -133,7 +133,7 @@ Code Seq# Include File Comments 'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system 'l' 40-7F linux/udf_fs_i.h in development: - + 'm' all linux/mtio.h conflict! 'm' all linux/soundcard.h conflict! 'm' all linux/synclink.h conflict! diff --git a/trunk/Documentation/kernel-docs.txt b/trunk/Documentation/kernel-docs.txt index 99d24f2943ee..cb89fb3b61ef 100644 --- a/trunk/Documentation/kernel-docs.txt +++ b/trunk/Documentation/kernel-docs.txt @@ -196,7 +196,7 @@ * Title: "Writing Linux Device Drivers" Author: Michael K. Johnson. - URL: http://users.evitech.fi/~tk/rtos/writing_linux_device_d.html + URL: http://people.redhat.com/johnsonm/devices.html Keywords: files, VFS, file operations, kernel interface, character vs block devices, I/O access, hardware interrupts, DMA, access to user memory, memory allocation, timers. @@ -284,7 +284,7 @@ * Title: "Linux Kernel Module Programming Guide" Author: Ori Pomerantz. - URL: http://tldp.org/LDP/lkmpg/2.6/html/index.html + URL: http://www.tldp.org/LDP/lkmpg/mpg.html Keywords: modules, GPL book, /proc, ioctls, system calls, interrupt handlers . Description: Very nice 92 pages GPL book on the topic of modules @@ -292,7 +292,7 @@ * Title: "Device File System (devfs) Overview" Author: Richard Gooch. - URL: http://www.atnf.csiro.au/people/rgooch/linux/docs/devfs.html + URL: http://www.atnf.csiro.au/~rgooch/linux/docs/devfs.txt Keywords: filesystem, /dev, devfs, dynamic devices, major/minor allocation, device management. Description: Document describing Richard Gooch's controversial @@ -316,8 +316,9 @@ * Title: "The Kernel Hacking HOWTO" Author: Various Talented People, and Rusty. - Location: in kernel tree, Documentation/DocBook/kernel-hacking/ - (must be built as "make {htmldocs | psdocs | pdfdocs}) + URL: + http://www.lisoleg.net/doc/Kernel-Hacking-HOWTO/kernel-hacking-HOW + TO.html Keywords: HOWTO, kernel contexts, deadlock, locking, modules, symbols, return conventions. Description: From the Introduction: "Please understand that I @@ -331,13 +332,13 @@ originally written for the 2.3 kernels, but nearly all of it applies to 2.2 too; 2.0 is slightly different". - * Title: "Writing an ALSA Driver" - Author: Takashi Iwai - URL: http://www.alsa-project.org/~iwai/writing-an-alsa-driver/index.html + * Title: "ALSA 0.5.0 Developer documentation" + Author: Stephan 'Jumpy' Bartels . + URL: http://www.math.TU-Berlin.de/~sbartels/alsa/ Keywords: ALSA, sound, soundcard, driver, lowlevel, hardware. Description: Advanced Linux Sound Architecture for developers, - both at kernel and user-level sides. ALSA is the Linux kernel - sound architecture in the 2.6 kernel version. + both at kernel and user-level sides. Work in progress. ALSA is + supposed to be Linux's next generation sound architecture. * Title: "Programming Guide for Linux USB Device Drivers" Author: Detlef Fliegl. @@ -368,8 +369,8 @@ filesystems, IPC and Networking Code. * Title: "Linux Kernel Mailing List Glossary" - Author: various - URL: http://kernelnewbies.org/glossary/ + Author: John Levon. + URL: http://www.movement.uklinux.net/glossary.html Keywords: glossary, terms, linux-kernel. Description: From the introduction: "This glossary is intended as a brief description of some of the acronyms and terms you may hear @@ -377,8 +378,9 @@ * Title: "Linux Kernel Locking HOWTO" Author: Various Talented People, and Rusty. - Location: in kernel tree, Documentation/DocBook/kernel-locking/ - (must be built as "make {htmldocs | psdocs | pdfdocs}) + URL: + http://netfilter.kernelnotes.org/unreliable-guides/kernel-locking- + HOWTO.html Keywords: locks, locking, spinlock, semaphore, atomic, race condition, bottom halves, tasklets, softirqs. Description: The title says it all: document describing the @@ -488,7 +490,7 @@ * Title: "Get those boards talking under Linux." Author: Alex Ivchenko. - URL: http://www.edn.com/article/CA46968.html + URL: http://www.ednmag.com/ednmag/reg/2000/06222000/13df2.htm Keywords: data-acquisition boards, drivers, modules, interrupts, memory allocation. Description: Article written for people wishing to make their data @@ -496,7 +498,7 @@ overview on writing drivers, from the naming of functions to interrupt handling. Notes: Two-parts article. Part II is at - URL: http://www.edn.com/article/CA46998.html + http://www.ednmag.com/ednmag/reg/2000/07062000/14df.htm * Title: "Linux PCMCIA Programmer's Guide" Author: David Hinds. @@ -527,7 +529,7 @@ definitive guide for hackers, virus coders and system administrators." Author: pragmatic/THC. - URL: http://packetstormsecurity.org/docs/hack/LKM_HACKING.html + URL: http://packetstorm.securify.com/groups/thc/LKM_HACKING.html Keywords: syscalls, intercept, hide, abuse, symbol table. Description: Interesting paper on how to abuse the Linux kernel in order to intercept and modify syscalls, make @@ -535,7 +537,8 @@ write kernel modules based virus... and solutions for admins to avoid all those abuses. Notes: For 2.0.x kernels. Gives guidances to port it to 2.2.x - kernels. + kernels. Also available in txt format at + http://www.blacknemesis.org/hacking/txt/cllkm.txt BOOKS: (Not on-line) @@ -554,17 +557,7 @@ ISBN: 0-59600-008-1 Notes: Further information in http://www.oreilly.com/catalog/linuxdrive2/ - - * Title: "Linux Device Drivers, 3nd Edition" - Authors: Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman - Publisher: O'Reilly & Associates. - Date: 2005. - Pages: 636. - ISBN: 0-596-00590-3 - Notes: Further information in - http://www.oreilly.com/catalog/linuxdrive3/ - PDF format, URL: http://lwn.net/Kernel/LDD3/ - + * Title: "Linux Kernel Internals" Author: Michael Beck. Publisher: Addison-Wesley. @@ -773,15 +766,12 @@ documents, FAQs... * Name: "linux-kernel mailing list archives and search engines" - URL: http://vger.kernel.org/vger-lists.html URL: http://www.uwsg.indiana.edu/hypermail/linux/kernel/index.html - URL: http://marc.theaimsgroup.com/?l=linux-kernel - URL: http://groups.google.com/group/mlist.linux.kernel - URL: http://www.cs.helsinki.fi/linux/linux-kernel/ - URL: http://www.lib.uaa.alaska.edu/linux-kernel/ + URL: http://www.kernelnotes.org/lnxlists/linux-kernel/ + URL: http://www.geocrawler.com Keywords: linux-kernel, archives, search. Description: Some of the linux-kernel mailing list archivers. If you have a better/another one, please let me know. _________________________________________________________________ - Document last updated on Sat 2005-NOV-19 + Document last updated on Thu Jun 28 15:09:39 CEST 2001 diff --git a/trunk/Documentation/mca.txt b/trunk/Documentation/mca.txt index 60913354cb7d..6e32c305c65a 100644 --- a/trunk/Documentation/mca.txt +++ b/trunk/Documentation/mca.txt @@ -252,7 +252,7 @@ their names here, but I don't have a list handy. Check the MCA Linux home page (URL below) for a perpetually out-of-date list. ===================================================================== -MCA Linux Home Page: http://www.dgmicro.com/mca/ +MCA Linux Home Page: http://glycerine.itsmm.uni.edu/mca/ Christophe Beauregard chrisb@truespectra.com diff --git a/trunk/Documentation/networking/driver.txt b/trunk/Documentation/networking/driver.txt index a9ad58b49cc5..11fd0ef5ff57 100644 --- a/trunk/Documentation/networking/driver.txt +++ b/trunk/Documentation/networking/driver.txt @@ -1,4 +1,7 @@ -Document about softnet driver issues +Documents about softnet driver issues in general can be found +at: + + http://www.firstfloor.org/~andi/softnet/ Transmit path guidelines: diff --git a/trunk/Documentation/networking/gianfar.txt b/trunk/Documentation/networking/gianfar.txt deleted file mode 100644 index ad474ea07d07..000000000000 --- a/trunk/Documentation/networking/gianfar.txt +++ /dev/null @@ -1,72 +0,0 @@ -The Gianfar Ethernet Driver -Sysfs File description - -Author: Andy Fleming -Updated: 2005-07-28 - -SYSFS - -Several of the features of the gianfar driver are controlled -through sysfs files. These are: - -bd_stash: -To stash RX Buffer Descriptors in the L2, echo 'on' or '1' to -bd_stash, echo 'off' or '0' to disable - -rx_stash_len: -To stash the first n bytes of the packet in L2, echo the number -of bytes to buf_stash_len. echo 0 to disable. - -WARNING: You could really screw these up if you set them too low or high! -fifo_threshold: -To change the number of bytes the controller needs in the -fifo before it starts transmission, echo the number of bytes to -fifo_thresh. Range should be 0-511. - -fifo_starve: -When the FIFO has less than this many bytes during a transmit, it -enters starve mode, and increases the priority of TX memory -transactions. To change, echo the number of bytes to -fifo_starve. Range should be 0-511. - -fifo_starve_off: -Once in starve mode, the FIFO remains there until it has this -many bytes. To change, echo the number of bytes to -fifo_starve_off. Range should be 0-511. - -CHECKSUM OFFLOADING - -The eTSEC controller (first included in parts from late 2005 like -the 8548) has the ability to perform TCP, UDP, and IP checksums -in hardware. The Linux kernel only offloads the TCP and UDP -checksums (and always performs the pseudo header checksums), so -the driver only supports checksumming for TCP/IP and UDP/IP -packets. Use ethtool to enable or disable this feature for RX -and TX. - -VLAN - -In order to use VLAN, please consult Linux documentation on -configuring VLANs. The gianfar driver supports hardware insertion and -extraction of VLAN headers, but not filtering. Filtering will be -done by the kernel. - -MULTICASTING - -The gianfar driver supports using the group hash table on the -TSEC (and the extended hash table on the eTSEC) for multicast -filtering. On the eTSEC, the exact-match MAC registers are used -before the hash tables. See Linux documentation on how to join -multicast groups. - -PADDING - -The gianfar driver supports padding received frames with 2 bytes -to align the IP header to a 16-byte boundary, when supported by -hardware. - -ETHTOOL - -The gianfar driver supports the use of ethtool for many -configuration options. You must run ethtool only on currently -open interfaces. See ethtool documentation for details. diff --git a/trunk/Documentation/networking/ifenslave.c b/trunk/Documentation/networking/ifenslave.c index 545447ac503a..f315d20d3867 100644 --- a/trunk/Documentation/networking/ifenslave.c +++ b/trunk/Documentation/networking/ifenslave.c @@ -693,7 +693,13 @@ static int enslave(char *master_ifname, char *slave_ifname) /* Older bonding versions would panic if the slave has no IP * address, so get the IP setting from the master. */ - set_if_addr(master_ifname, slave_ifname); + res = set_if_addr(master_ifname, slave_ifname); + if (res) { + fprintf(stderr, + "Slave '%s': Error: set address failed\n", + slave_ifname); + return res; + } } else { res = clear_if_addr(slave_ifname); if (res) { @@ -1079,6 +1085,7 @@ static int set_if_addr(char *master_ifname, char *slave_ifname) slave_ifname, ifra[i].req_name, strerror(saved_errno)); + return res; } ipaddr = ifr.ifr_addr.sa_data; diff --git a/trunk/Documentation/networking/ip-sysctl.txt b/trunk/Documentation/networking/ip-sysctl.txt index 2b7cf19a06ad..ebc09a159f62 100644 --- a/trunk/Documentation/networking/ip-sysctl.txt +++ b/trunk/Documentation/networking/ip-sysctl.txt @@ -46,29 +46,6 @@ ipfrag_secret_interval - INTEGER for the hash secret) for IP fragments. Default: 600 -ipfrag_max_dist - INTEGER - ipfrag_max_dist is a non-negative integer value which defines the - maximum "disorder" which is allowed among fragments which share a - common IP source address. Note that reordering of packets is - not unusual, but if a large number of fragments arrive from a source - IP address while a particular fragment queue remains incomplete, it - probably indicates that one or more fragments belonging to that queue - have been lost. When ipfrag_max_dist is positive, an additional check - is done on fragments before they are added to a reassembly queue - if - ipfrag_max_dist (or more) fragments have arrived from a particular IP - address between additions to any IP fragment queue using that source - address, it's presumed that one or more fragments in the queue are - lost. The existing fragment queue will be dropped, and a new one - started. An ipfrag_max_dist value of zero disables this check. - - Using a very small value, e.g. 1 or 2, for ipfrag_max_dist can - result in unnecessarily dropping fragment queues when normal - reordering of packets occurs, which could lead to poor application - performance. Using a very large value, e.g. 50000, increases the - likelihood of incorrectly reassembling IP fragments that originate - from different IP datagrams, which could result in data corruption. - Default: 64 - INET peer storage: inet_peer_threshold - INTEGER diff --git a/trunk/Documentation/networking/iphase.txt b/trunk/Documentation/networking/iphase.txt index 493203a080a8..39ccb8595bf1 100644 --- a/trunk/Documentation/networking/iphase.txt +++ b/trunk/Documentation/networking/iphase.txt @@ -22,7 +22,7 @@ The features and limitations of this driver are as follows: - All variants of Interphase ATM PCI (i)Chip adapter cards are supported, including x575 (OC3, control memory 128K , 512K and packet memory 128K, 512K and 1M), x525 (UTP25) and x531 (DS3 and E3). See - http://www.iphase.com/site/iphase-web/?epi_menuItemID=e196f04b4b3b40502f150882e21046a0 + http://www.iphase.com/products/ClassSheet.cfm?ClassID=ATM for details. - Only x86 platforms are supported. - SMP is supported. diff --git a/trunk/Documentation/networking/irda.txt b/trunk/Documentation/networking/irda.txt index bff26c138be6..9e5b8e66d6a5 100644 --- a/trunk/Documentation/networking/irda.txt +++ b/trunk/Documentation/networking/irda.txt @@ -3,8 +3,12 @@ of the IrDA Utilities. More detailed information about these and associated programs can be found on http://irda.sourceforge.net/ For more information about how to use the IrDA protocol stack, see the -Linux Infrared HOWTO by Werner Heuser : - +Linux Infared HOWTO (http://www.tuxmobil.org/Infrared-HOWTO/Infrared-HOWTO.html) +by Werner Heuser There is an active mailing list for discussing Linux-IrDA matters called irda-users@lists.sourceforge.net + + + + diff --git a/trunk/Documentation/networking/ray_cs.txt b/trunk/Documentation/networking/ray_cs.txt index 5427f8c7df95..b1def00bc4a3 100644 --- a/trunk/Documentation/networking/ray_cs.txt +++ b/trunk/Documentation/networking/ray_cs.txt @@ -29,7 +29,8 @@ with nondefault parameters, they can be edited in will find them all. Information on card services is available at: - http://pcmcia-cs.sourceforge.net/ + ftp://hyper.stanford.edu/pub/pcmcia/doc + http://hyper.stanford.edu/HyperNews/get/pcmcia/home.html Card services user programs are still required for PCMCIA devices. diff --git a/trunk/Documentation/networking/vortex.txt b/trunk/Documentation/networking/vortex.txt index 3759acf95b29..80e1cb19609f 100644 --- a/trunk/Documentation/networking/vortex.txt +++ b/trunk/Documentation/networking/vortex.txt @@ -11,7 +11,7 @@ The driver was written by Donald Becker Don is no longer the prime maintainer of this version of the driver. Please report problems to one or more of: - Andrew Morton + Andrew Morton Netdev mailing list Linux kernel mailing list @@ -274,24 +274,24 @@ Details of the device driver implementation are at the top of the source file. Additional documentation is available at Don Becker's Linux Drivers site: - http://www.scyld.com/vortex.html + http://www.scyld.com/network/vortex.html Donald Becker's driver development site: - http://www.scyld.com/network.html + http://www.scyld.com/network Donald's vortex-diag program is useful for inspecting the NIC's state: - http://www.scyld.com/ethercard_diag.html + http://www.scyld.com/diag/#pci-diags Donald's mii-diag program may be used for inspecting and manipulating the NIC's Media Independent Interface subsystem: - http://www.scyld.com/ethercard_diag.html#mii-diag + http://www.scyld.com/diag/#mii-diag Donald's wake-on-LAN page: - http://www.scyld.com/wakeonlan.html + http://www.scyld.com/expert/wake-on-lan.html 3Com's documentation for many NICs, including the ones supported by this driver is available at @@ -305,7 +305,7 @@ this driver is available at Driver updates and a detailed changelog for the modifications which were made for the 2.3/2,4 series kernel is available at - http://www.zip.com.au/~akpm/linux/#3c59x-bc + http://www.uow.edu.au/~andrewm/linux/#3c59x-2.3 Autonegotiation notes @@ -434,8 +434,8 @@ steps you should take: send all logs to the maintainer. 3) Download you card's diagnostic tool from Donald - Becker's website . - Download mii-diag.c as well. Build these. + Backer's website http://www.scyld.com/diag. Download + mii-diag.c as well. Build these. a) Run 'vortex-diag -aaee' and 'mii-diag -v' when the card is working correctly. Save the output. @@ -443,8 +443,8 @@ steps you should take: b) Run the above commands when the card is malfunctioning. Send both sets of output. -Finally, please be patient and be prepared to do some work. You may -end up working on this problem for a week or more as the maintainer -asks more questions, asks for more tests, asks for patches to be -applied, etc. At the end of it all, the problem may even remain -unresolved. +Finally, please be patient and be prepared to do some work. You may end up working on +this problem for a week or more as the maintainer asks more questions, asks for more +tests, asks for patches to be applied, etc. At the end of it all, the problem may even +remain unresolved. + diff --git a/trunk/Documentation/oops-tracing.txt b/trunk/Documentation/oops-tracing.txt index 05960f8a748e..c563842ed805 100644 --- a/trunk/Documentation/oops-tracing.txt +++ b/trunk/Documentation/oops-tracing.txt @@ -30,12 +30,7 @@ the disk is not available then you have three options :- (1) Hand copy the text from the screen and type it in after the machine has restarted. Messy but it is the only option if you have not - planned for a crash. Alternatively, you can take a picture of - the screen with a digital camera - not nice, but better than - nothing. If the messages scroll off the top of the console, you - may find that booting with a higher resolution (eg, vga=791) - will allow you to read more of the text. (Caveat: This needs vesafb, - so won't help for 'early' oopses) + planned for a crash. (2) Boot with a serial console (see Documentation/serial-console.txt), run a null modem to a second machine and capture the output there diff --git a/trunk/Documentation/power/pci.txt b/trunk/Documentation/power/pci.txt index 73fc87e5dc38..6fc9d511fc39 100644 --- a/trunk/Documentation/power/pci.txt +++ b/trunk/Documentation/power/pci.txt @@ -335,5 +335,5 @@ this on the whole. PCI Local Bus Specification PCI Bus Power Management Interface Specification - http://www.pcisig.com + http://pcisig.org diff --git a/trunk/Documentation/scsi/ChangeLog.megaraid b/trunk/Documentation/scsi/ChangeLog.megaraid index 09f6300eda4b..5331d91432c7 100644 --- a/trunk/Documentation/scsi/ChangeLog.megaraid +++ b/trunk/Documentation/scsi/ChangeLog.megaraid @@ -1,38 +1,3 @@ -Release Date : Fri Nov 11 12:27:22 EST 2005 - Seokmann Ju -Current Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module) -Older Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module) - -1. Sorted out PCI IDs to remove megaraid support overlaps. - Based on the patch from Daniel, sorted out PCI IDs along with - charactor node name change from 'megadev' to 'megadev_legacy' to avoid - conflict. - --- - Hopefully we'll be getting the build restriction zapped much sooner, - but we should also be thinking about totally removing the hardware - support overlap in the megaraid drivers. - - This patch pencils in a date of Feb 06 for this, and performs some - printk abuse in hope that existing legacy users might pick up on what's - going on. - - Signed-off-by: Daniel Drake - --- - -2. Fixed a issue: megaraid always fails to reset handler. - --- - I found that the megaraid driver always fails to reset the - adapter with the following message: - megaraid: resetting the host... - megaraid mbox: reset sequence completed successfully - megaraid: fast sync command timed out - megaraid: reservation reset failed - when the "Cluster mode" of the adapter BIOS is enabled. - So, whenever the reset occurs, the adapter goes to - offline and just become unavailable. - - Jun'ichi Nomura [mailto:jnomura@mtc.biglobe.ne.jp] - --- - Release Date : Mon Mar 07 12:27:22 EST 2005 - Seokmann Ju Current Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module) Older Version : 2.20.4.5 (scsi module), 2.20.2.5 (cmm module) diff --git a/trunk/Documentation/scsi/ibmmca.txt b/trunk/Documentation/scsi/ibmmca.txt index d16ce5b540f4..2ffb3ae0ef4d 100644 --- a/trunk/Documentation/scsi/ibmmca.txt +++ b/trunk/Documentation/scsi/ibmmca.txt @@ -1108,7 +1108,7 @@ A: You have to activate MCA bus support, first. Q: Where can I find the latest info about this driver? A: See the file MAINTAINERS for the current WWW-address, which offers - updates, info and Q/A lists. At this file's origin, the webaddress + updates, info and Q/A lists. At this files' origin, the webaddress was: http://www.uni-mainz.de/~langm000/linux.html Q: My SCSI-adapter is not recognized by the driver, what can I do? A: Just force it to be recognized by kernel parameters. See section 5.1. @@ -1248,7 +1248,7 @@ -------------------- The address of the IBM SCSI-subsystem supporting WWW-page is: - http://www.staff.uni-mainz.de/mlang/linux.html + http://www.uni-mainz.de/~langm000/linux.html Here you can find info about the background of this driver, patches, troubleshooting support, news and a bugreport form. Please check that diff --git a/trunk/Documentation/scsi/scsi_mid_low_api.txt b/trunk/Documentation/scsi/scsi_mid_low_api.txt index c4af92bc705d..66565d42288f 100644 --- a/trunk/Documentation/scsi/scsi_mid_low_api.txt +++ b/trunk/Documentation/scsi/scsi_mid_low_api.txt @@ -150,8 +150,7 @@ scsi devices of which only the first 2 respond: LLD mid level LLD ===-------------------=========--------------------===------ scsi_host_alloc() --> -scsi_add_host() ----> -scsi_scan_host() -------+ +scsi_add_host() --------+ | slave_alloc() slave_configure() --> scsi_adjust_queue_depth() @@ -197,7 +196,7 @@ of the issues involved. See the section on reference counting below. The hotplug concept may be extended to SCSI devices. Currently, when an -HBA is added, the scsi_scan_host() function causes a scan for SCSI devices +HBA is added, the scsi_add_host() function causes a scan for SCSI devices attached to the HBA's SCSI transport. On newer SCSI transports the HBA may become aware of a new SCSI device _after_ the scan has completed. An LLD can use this sequence to make the mid level aware of a SCSI device: @@ -373,7 +372,7 @@ names all start with "scsi_". Summary: scsi_activate_tcq - turn on tag command queueing scsi_add_device - creates new scsi device (lu) instance - scsi_add_host - perform sysfs registration and set up transport class + scsi_add_host - perform sysfs registration and SCSI bus scan. scsi_adjust_queue_depth - change the queue depth on a SCSI device scsi_assign_lock - replace default host_lock with given lock scsi_bios_ptable - return copy of block device's partition table @@ -387,7 +386,6 @@ Summary: scsi_remove_device - detach and remove a SCSI device scsi_remove_host - detach and remove all SCSI devices owned by host scsi_report_bus_reset - report scsi _bus_ reset observed - scsi_scan_host - scan SCSI bus scsi_track_queue_full - track successive QUEUE_FULL events scsi_unblock_requests - allow further commands to be queued to given host scsi_unregister - [calls scsi_host_put()] @@ -427,10 +425,10 @@ void scsi_activate_tcq(struct scsi_device *sdev, int depth) * Might block: yes * * Notes: This call is usually performed internally during a scsi - * bus scan when an HBA is added (i.e. scsi_scan_host()). So it + * bus scan when an HBA is added (i.e. scsi_add_host()). So it * should only be called if the HBA becomes aware of a new scsi - * device (lu) after scsi_scan_host() has completed. If successful - * this call can lead to slave_alloc() and slave_configure() callbacks + * device (lu) after scsi_add_host() has completed. If successful + * this call we lead to slave_alloc() and slave_configure() callbacks * into the LLD. * * Defined in: drivers/scsi/scsi_scan.c @@ -441,7 +439,7 @@ struct scsi_device * scsi_add_device(struct Scsi_Host *shost, /** - * scsi_add_host - perform sysfs registration and set up transport class + * scsi_add_host - perform sysfs registration and SCSI bus scan. * @shost: pointer to scsi host instance * @dev: pointer to struct device of type scsi class * @@ -450,11 +448,7 @@ struct scsi_device * scsi_add_device(struct Scsi_Host *shost, * Might block: no * * Notes: Only required in "hotplug initialization model" after a - * successful call to scsi_host_alloc(). This function does not - * scan the bus; this can be done by calling scsi_scan_host() or - * in some other transport-specific way. The LLD must set up - * the transport template before calling this function and may only - * access the transport class data after this function has been called. + * successful call to scsi_host_alloc(). * * Defined in: drivers/scsi/hosts.c **/ @@ -565,7 +559,7 @@ void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) * area for the LLD's exclusive use. * Both associated refcounting objects have their refcount set to 1. * Full registration (in sysfs) and a bus scan are performed later when - * scsi_add_host() and scsi_scan_host() are called. + * scsi_add_host() is called. * * Defined in: drivers/scsi/hosts.c . **/ @@ -704,19 +698,6 @@ int scsi_remove_host(struct Scsi_Host *shost) void scsi_report_bus_reset(struct Scsi_Host * shost, int channel) -/** - * scsi_scan_host - scan SCSI bus - * @shost: a pointer to a scsi host instance - * - * Might block: yes - * - * Notes: Should be called after scsi_add_host() - * - * Defined in: drivers/scsi/scsi_scan.c - **/ -void scsi_scan_host(struct Scsi_Host *shost) - - /** * scsi_track_queue_full - track successive QUEUE_FULL events on given * device to determine if and when there is a need diff --git a/trunk/Documentation/usb/bluetooth.txt b/trunk/Documentation/usb/bluetooth.txt new file mode 100644 index 000000000000..774f5d3835cc --- /dev/null +++ b/trunk/Documentation/usb/bluetooth.txt @@ -0,0 +1,44 @@ +INTRODUCTION + + The USB Bluetooth driver supports any USB Bluetooth device. + It currently works well with the Linux USB Bluetooth stack from Axis + (available at http://developer.axis.com/software/bluetooth/ ) and + has been rumored to work with other Linux USB Bluetooth stacks. + + +CONFIGURATION + + Currently the driver can handle up to 256 different USB Bluetooth + devices at once. + + If you are not using devfs: + The major number that the driver uses is 216 so to use the driver, + create the following nodes: + mknod /dev/ttyUB0 c 216 0 + mknod /dev/ttyUB1 c 216 1 + mknod /dev/ttyUB2 c 216 2 + mknod /dev/ttyUB3 c 216 3 + . + . + . + mknod /dev/ttyUB254 c 216 254 + mknod /dev/ttyUB255 c 216 255 + + If you are using devfs: + The devices supported by this driver will show up as + /dev/usb/ttub/{0,1,...} + + When the device is connected and recognized by the driver, the driver + will print to the system log, which node the device has been bound to. + + +CONTACT: + + If anyone has any problems using this driver, please contact me, or + join the Linux-USB mailing list (information on joining the mailing + list, as well as a link to its searchable archive is at + http://www.linux-usb.org/ ) + + +Greg Kroah-Hartman +greg@kroah.com diff --git a/trunk/Documentation/usb/error-codes.txt b/trunk/Documentation/usb/error-codes.txt index 867f4c38f356..1e36f1661cd0 100644 --- a/trunk/Documentation/usb/error-codes.txt +++ b/trunk/Documentation/usb/error-codes.txt @@ -46,9 +46,8 @@ USB-specific: -EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable in the current interface altsetting. - (b) ISO packet is larger than the endpoint maxpacket. - (c) requested data transfer length is invalid: negative - or too large for the host controller. + (b) ISO packet is biger than endpoint maxpacket + (c) requested data transfer size is invalid (negative) -ENOSPC This request would overcommit the usb bandwidth reserved for periodic transfers (interrupt, isochronous). diff --git a/trunk/Documentation/usb/ibmcam.txt b/trunk/Documentation/usb/ibmcam.txt index c25003644131..ce2f21a3eac4 100644 --- a/trunk/Documentation/usb/ibmcam.txt +++ b/trunk/Documentation/usb/ibmcam.txt @@ -28,8 +28,8 @@ SUPPORTED CAMERAS: Xirlink "C-It" camera, also known as "IBM PC Camera". The device uses proprietary ASIC (and compression method); it is manufactured by Xirlink. See http://www.xirlink.com/ -(renamed to http://www.veo.com), http://www.ibmpccamera.com, -or http://www.c-itnow.com/ for details and pictures. +http://www.ibmpccamera.com or http://www.c-itnow.com/ for +details and pictures. This very chipset ("X Chip", as marked at the factory) is used in several other cameras, and they are supported diff --git a/trunk/Documentation/usb/ov511.txt b/trunk/Documentation/usb/ov511.txt index a7fc0432bff1..e1974ec8217e 100644 --- a/trunk/Documentation/usb/ov511.txt +++ b/trunk/Documentation/usb/ov511.txt @@ -22,8 +22,8 @@ WHAT YOU NEED: http://www.ovt.com/omniusbp.html - A Video4Linux compatible frame grabber program (I recommend vidcat and xawtv) - vidcat is part of the w3cam package: http://mpx.freeshell.net/ - xawtv is available at: http://linux.bytesex.org/xawtv/ + vidcat is part of the w3cam package: http://www.hdk-berlin.de/~rasca/w3cam/ + xawtv is available at: http://www.in-berlin.de/User/kraxel/xawtv.html HOW TO USE IT: diff --git a/trunk/Documentation/usb/rio.txt b/trunk/Documentation/usb/rio.txt index ab21db454694..0aa79ab0088c 100644 --- a/trunk/Documentation/usb/rio.txt +++ b/trunk/Documentation/usb/rio.txt @@ -46,9 +46,9 @@ Contact information: -------------------- The main page for the project is hosted at sourceforge.net in the following - URL: . You can also go to the project's - sourceforge home page at: . - There is also a mailing list: rio500-users@lists.sourceforge.net + address: http://rio500.sourceforge.net You can also go to the sourceforge + project page at: http://sourceforge.net/project/?group_id=1944 There is + also a mailing list: rio500-users@lists.sourceforge.net Authors: ------- diff --git a/trunk/Documentation/video4linux/CARDLIST.bttv b/trunk/Documentation/video4linux/CARDLIST.bttv index 330246ac80f8..2404099996ac 100644 --- a/trunk/Documentation/video4linux/CARDLIST.bttv +++ b/trunk/Documentation/video4linux/CARDLIST.bttv @@ -140,4 +140,3 @@ 139 -> Prolink PixelView PlayTV MPEG2 PV-M4900 140 -> Osprey 440 [0070:ff07] 141 -> Asound Skyeye PCTV -142 -> Sabrent TV-FM (bttv version) diff --git a/trunk/Documentation/video4linux/CARDLIST.saa7134 b/trunk/Documentation/video4linux/CARDLIST.saa7134 index efb708ec116a..57c9d631db56 100644 --- a/trunk/Documentation/video4linux/CARDLIST.saa7134 +++ b/trunk/Documentation/video4linux/CARDLIST.saa7134 @@ -80,5 +80,3 @@ 79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B) 80 -> ASUS Digimatrix TV [1043:0210] 81 -> Philips Tiger reference design [1131:2018] - 82 -> MSI TV@Anywhere plus [1462:6231] - diff --git a/trunk/Documentation/video4linux/CARDLIST.tuner b/trunk/Documentation/video4linux/CARDLIST.tuner index 9d6544ea9f41..ec840ca6f455 100644 --- a/trunk/Documentation/video4linux/CARDLIST.tuner +++ b/trunk/Documentation/video4linux/CARDLIST.tuner @@ -67,4 +67,3 @@ tuner=65 - Ymec TVF66T5-B/DFF tuner=66 - LG NTSC (TALN mini series) tuner=67 - Philips TD1316 Hybrid Tuner tuner=68 - Philips TUV1236D ATSC/NTSC dual in -tuner=69 - Tena TNF 5335 MF diff --git a/trunk/Documentation/video4linux/zr36120.txt b/trunk/Documentation/video4linux/zr36120.txt index 5d6357eefde4..4af6c52595eb 100644 --- a/trunk/Documentation/video4linux/zr36120.txt +++ b/trunk/Documentation/video4linux/zr36120.txt @@ -76,11 +76,8 @@ activates the GRAB bit. A few ms later the VSYNC (re-)rises and the zoran starts to work on a new and freshly broadcasted frame.... For pointers I used the specs of both chips. Below are the URLs: - http://www.zoran.com/ftp/download/devices/pci/ZR36120/36120data.pdf - http://www-us.semiconductor.philips.com/acrobat/datasheets/SAA_7110_A_1.pdf -Some alternatives for the Philips SAA 7110 datasheet are: - http://www.datasheetcatalog.com/datasheets_pdf/S/A/A/7/SAA7110.shtml - http://www.datasheetarchive.com/search.php?search=SAA7110&sType=part + http://www.zoran.com/ftp/download/devices/pci/ZR36120/36120data.pdf + http://www-us.semiconductor.philips.com/acrobat/datasheets/SAA_7110_A_1.pdf The documentation has very little on absolute numbers or timings needed for the various modes/resolutions, but there are other diff --git a/trunk/Documentation/x86_64/boot-options.txt b/trunk/Documentation/x86_64/boot-options.txt index e566affeed7f..ffe1c062088b 100644 --- a/trunk/Documentation/x86_64/boot-options.txt +++ b/trunk/Documentation/x86_64/boot-options.txt @@ -7,12 +7,10 @@ Machine check mce=off disable machine check mce=bootlog Enable logging of machine checks left over from booting. - Disabled by default on AMD because some BIOS leave bogus ones. + Disabled by default because some BIOS leave bogus ones. If your BIOS doesn't do that it's a good idea to enable though to make sure you log even machine check events that result - in a reboot. On Intel systems it is enabled by default. - mce=nobootlog - Disable boot machine check logging. + in a reboot. mce=tolerancelevel (number) 0: always panic, 1: panic if deadlock possible, 2: try to avoid panic, 3: never panic or exit (for testing) @@ -124,9 +122,6 @@ SMP cpumask=MASK only use cpus with bits set in mask - additional_cpus=NUM Allow NUM more CPUs for hotplug - (defaults are specified by the BIOS or half the available CPUs) - NUMA numa=off Only set up a single NUMA node spanning all memory. @@ -193,9 +188,6 @@ Debugging kstack=N Print that many words from the kernel stack in oops dumps. - pagefaulttrace Dump all page faults. Only useful for extreme debugging - and will create a lot of output. - Misc noreplacement Don't replace instructions with more appropiate ones diff --git a/trunk/Documentation/x86_64/mm.txt b/trunk/Documentation/x86_64/mm.txt index 133561b9cb0c..662b73971a67 100644 --- a/trunk/Documentation/x86_64/mm.txt +++ b/trunk/Documentation/x86_64/mm.txt @@ -6,7 +6,7 @@ Virtual memory map with 4 level page tables: 0000000000000000 - 00007fffffffffff (=47bits) user space, different per mm hole caused by [48:63] sign extension ffff800000000000 - ffff80ffffffffff (=40bits) guard hole -ffff810000000000 - ffffc0ffffffffff (=46bits) direct mapping of all phys. memory +ffff810000000000 - ffffc0ffffffffff (=46bits) direct mapping of phys. memory ffffc10000000000 - ffffc1ffffffffff (=40bits) hole ffffc20000000000 - ffffe1ffffffffff (=45bits) vmalloc/ioremap space ... unused hole ... @@ -14,10 +14,6 @@ ffffffff80000000 - ffffffff82800000 (=40MB) kernel text mapping, from phys 0 ... unused hole ... ffffffff88000000 - fffffffffff00000 (=1919MB) module mapping space -The direct mapping covers all memory in the system upto the highest -memory address (this means in some cases it can also include PCI memory -holes) - vmalloc space is lazily synchronized into the different PML4 pages of the processes using the page fault handler, with init_level4_pgt as reference. diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 3fd7687a6ad9..2313de23b0da 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -58,7 +58,6 @@ P: Person M: Mail patches to L: Mailing list that is relevant to this area W: Web-page with status/info -T: SCM tree type and location. Type is one of: git, hg, quilt. S: Status, one of the following: Supported: Someone is actually paid to look after this. @@ -184,7 +183,6 @@ P: Len Brown M: len.brown@intel.com L: acpi-devel@lists.sourceforge.net W: http://acpi.sourceforge.net/ -T: git kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git S: Maintained AD1816 SOUND DRIVER @@ -227,7 +225,6 @@ AGPGART DRIVER P: Dave Jones M: davej@codemonkey.org.uk W: http://www.codemonkey.org.uk/projects/agp/ -T: git kernel.org:/pub/scm/linux/kernel/git/davej/agpgart.git S: Maintained AHA152X SCSI DRIVER @@ -385,7 +382,6 @@ P: David Woodhouse M: dwmw2@infradead.org L: linux-audit@redhat.com W: http://people.redhat.com/sgrubb/audit/ -T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git S: Maintained AX.25 NETWORK LAYER @@ -422,7 +418,6 @@ BLOCK LAYER P: Jens Axboe M: axboe@suse.de L: linux-kernel@vger.kernel.org -T: git kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git S: Maintained BLUETOOTH SUBSYSTEM @@ -434,7 +429,6 @@ L: bluez-devel@lists.sf.net W: http://bluez.sf.net W: http://www.bluez.org W: http://www.holtmann.org/linux/bluetooth/ -T: git kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git S: Maintained BLUETOOTH RFCOMM LAYER @@ -536,7 +530,6 @@ P: Mauro Carvalho Chehab M: mchehab@brturbo.com.br L: video4linux-list@redhat.com W: http://linuxtv.org -T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git S: Maintained BUSLOGIC SCSI DRIVER @@ -551,7 +544,6 @@ P: Steve French M: sfrench@samba.org L: samba-technical@lists.samba.org W: http://us1.samba.org/samba/Linux_CIFS_client.html -T: git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git S: Supported CIRRUS LOGIC GENERIC FBDEV DRIVER @@ -613,7 +605,6 @@ P: Dave Jones M: davej@codemonkey.org.uk L: cpufreq@lists.linux.org.uk W: http://www.codemonkey.org.uk/projects/cpufreq/ -T: git kernel.org/pub/scm/linux/kernel/davej/cpufreq.git S: Maintained CPUID/MSR DRIVER @@ -647,7 +638,6 @@ M: herbert@gondor.apana.org.au P: David S. Miller M: davem@davemloft.net L: linux-crypto@vger.kernel.org -T: git kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6.git S: Maintained CYBERPRO FB DRIVER @@ -813,14 +803,12 @@ DRIVER CORE, KOBJECTS, AND SYSFS P: Greg Kroah-Hartman M: gregkh@suse.de L: linux-kernel@vger.kernel.org -T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ S: Supported DRM DRIVERS P: David Airlie M: airlied@linux.ie L: dri-devel@lists.sourceforge.net -T: git kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git S: Maintained DSCC4 DRIVER @@ -834,7 +822,6 @@ P: LinuxTV.org Project M: linux-dvb-maintainer@linuxtv.org L: linux-dvb@linuxtv.org (subscription required) W: http://linuxtv.org/ -T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git S: Supported EATA-DMA SCSI DRIVER @@ -1126,7 +1113,6 @@ P: Jean Delvare M: khali@linux-fr.org L: lm-sensors@lm-sensors.org W: http://www.lm-sensors.nu/ -T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ S: Maintained I2O @@ -1159,7 +1145,6 @@ P: Tony Luck M: tony.luck@intel.com L: linux-ia64@vger.kernel.org W: http://www.ia64-linux.org/ -T: git kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git S: Maintained SN-IA64 (Itanium) SUB-PLATFORM @@ -1193,7 +1178,6 @@ P: Bartlomiej Zolnierkiewicz M: B.Zolnierkiewicz@elka.pw.edu.pl L: linux-kernel@vger.kernel.org L: linux-ide@vger.kernel.org -T: git kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git S: Maintained IDE/ATAPI CDROM DRIVER @@ -1228,7 +1212,6 @@ P: Jody McIntyre M: scjody@steamballoon.com L: linux1394-devel@lists.sourceforge.net W: http://www.linux1394.org/ -T: git kernel.org:/pub/scm/linux/kernel/git/scjody/ieee1394.git S: Maintained IEEE 1394 OHCI DRIVER @@ -1280,15 +1263,13 @@ P: Hal Rosenstock M: halr@voltaire.com L: openib-general@openib.org W: http://www.openib.org/ -T: git kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git S: Supported INPUT (KEYBOARD, MOUSE, JOYSTICK) DRIVERS -P: Dmitry Torokhov -M: dtor_core@ameritech.net +P: Vojtech Pavlik +M: vojtech@suse.cz L: linux-input@atrey.karlin.mff.cuni.cz L: linux-joystick@atrey.karlin.mff.cuni.cz -T: git kernel.org:/pub/scm/linux/kernel/git/dtor/input.git S: Maintained INOTIFY @@ -1402,7 +1383,6 @@ P: Kai Germaschewski M: kai.germaschewski@gmx.de L: isdn4linux@listserv.isdn4linux.de W: http://www.isdn4linux.de -T: git kernel.org:/pub/scm/linux/kernel/kkeil/isdn-2.6.git S: Maintained ISDN SUBSYSTEM (Eicon active card driver) @@ -1431,7 +1411,6 @@ P: Dave Kleikamp M: shaggy@austin.ibm.com L: jfs-discussion@lists.sourceforge.net W: http://jfs.sourceforge.net/ -T: git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git S: Supported KCONFIG @@ -1457,7 +1436,6 @@ P: Kai Germaschewski M: kai@germaschewski.name P: Sam Ravnborg M: sam@ravnborg.org -T: git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git S: Maintained KERNEL JANITORS @@ -1546,7 +1524,6 @@ P: Paul Mackerras M: paulus@samba.org W: http://www.penguinppc.org/ L: linuxppc-dev@ozlabs.org -T: git kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc.git S: Supported LINUX FOR POWER MACINTOSH @@ -1588,7 +1565,7 @@ S: Maintained LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX P: Kumar Gala -M: galak@kernel.crashing.org +M: kumar.gala@freescale.com W: http://www.penguinppc.org/ L: linuxppc-embedded@ozlabs.org S: Maintained @@ -1614,7 +1591,6 @@ P: Chris Wright M: chrisw@osdl.org L: linux-security-module@wirex.com W: http://lsm.immunix.org -T: git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git S: Supported LM83 HARDWARE MONITOR DRIVER @@ -1636,15 +1612,6 @@ L: ldm-devel@lists.sourceforge.net W: http://ldm.sourceforge.net S: Maintained -LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) -P: Eric Moore -M: Eric.Moore@lsil.com -M: support@lsil.com -L: mpt_linux_developer@lsil.com -L: linux-scsi@vger.kernel.org -W: http://www.lsilogic.com/support -S: Supported - LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers P: Matthew Wilcox M: matthew@wil.cx @@ -1718,7 +1685,6 @@ P: David Woodhouse M: dwmw2@infradead.org W: http://www.linux-mtd.infradead.org/ L: linux-mtd@lists.infradead.org -T: git kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6.git S: Maintained MICROTEK X6 SCANNER @@ -1816,7 +1782,6 @@ M: akpm@osdl.org P: Jeff Garzik M: jgarzik@pobox.com L: netdev@vger.kernel.org -T: git kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git S: Maintained NETWORKING [GENERAL] @@ -1839,7 +1804,6 @@ M: yoshfuji@linux-ipv6.org P: Patrick McHardy M: kaber@coreworks.de L: netdev@vger.kernel.org -T: git kernel.org:/pub/scm/linux/kernel/davem/net-2.6.git S: Maintained IPVS @@ -1891,7 +1855,6 @@ M: aia21@cantab.net L: linux-ntfs-dev@lists.sourceforge.net L: linux-kernel@vger.kernel.org W: http://linux-ntfs.sf.net/ -T: git kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git S: Maintained NVIDIA (RIVA) FRAMEBUFFER DRIVER @@ -1910,16 +1873,6 @@ L: linux-tr@linuxtr.net W: http://www.linuxtr.net S: Maintained -OMNIKEY CARDMAN 4000 DRIVER -P: Harald Welte -M: laforge@gnumonks.org -S: Maintained - -OMNIKEY CARDMAN 4040 DRIVER -P: Harald Welte -M: laforge@gnumonks.org -S: Maintained - ONSTREAM SCSI TAPE DRIVER P: Willem Riede M: osst@riede.org @@ -1996,7 +1949,6 @@ P: Greg Kroah-Hartman M: gregkh@suse.de L: linux-kernel@vger.kernel.org L: linux-pci@atrey.karlin.mff.cuni.cz -T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ S: Supported PCI HOTPLUG CORE @@ -2018,7 +1970,6 @@ S: Maintained PCMCIA SUBSYSTEM P: Linux PCMCIA Team L: http://lists.infradead.org/mailman/listinfo/linux-pcmcia -T: git kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git S: Maintained PCNET32 NETWORK DRIVER @@ -2228,7 +2179,6 @@ SCSI SUBSYSTEM P: James E.J. Bottomley M: James.Bottomley@SteelEye.com L: linux-scsi@vger.kernel.org -T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git S: Maintained SCSI TAPE DRIVER @@ -2268,7 +2218,6 @@ SERIAL ATA (SATA) SUBSYSTEM: P: Jeff Garzik M: jgarzik@pobox.com L: linux-ide@vger.kernel.org -T: git kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git S: Supported SGI SN-IA64 (Altix) SERIAL CONSOLE DRIVER @@ -2415,7 +2364,6 @@ P: Anton Blanchard M: anton@samba.org L: sparclinux@vger.kernel.org L: ultralinux@vger.kernel.org -T: git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.git S: Maintained SHARP LH SUPPORT (LH7952X & LH7A40X) @@ -2554,7 +2502,6 @@ P: Adrian Bunk M: trivial@kernel.org L: linux-kernel@vger.kernel.org W: http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/ -T: git kernel.org:/pub/scm/linux/kernel/git/bunk/trivial.git S: Maintained TMS380 TOKEN-RING NETWORK DRIVER @@ -2640,12 +2587,6 @@ L: linux-usb-users@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net S: Maintained -USB ISP116X DRIVER -P: Olav Kongas -M: ok@artecdesign.ee -L: linux-usb-devel@lists.sourceforge.net -S: Maintained - USB KAWASAKI LSI DRIVER P: Oliver Neukum M: oliver@neukum.name @@ -2657,7 +2598,7 @@ USB MASS STORAGE DRIVER P: Matthew Dharm M: mdharm-usb@one-eyed-alien.net L: linux-usb-users@lists.sourceforge.net -L: usb-storage@lists.one-eyed-alien.net +L: linux-usb-devel@lists.sourceforge.net S: Maintained W: http://www.one-eyed-alien.net/~mdharm/linux-usb/ @@ -2798,7 +2739,6 @@ M: gregkh@suse.de L: linux-usb-users@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net W: http://www.linux-usb.org -T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ S: Supported USB UHCI DRIVER @@ -2894,7 +2834,6 @@ P: Latchesar Ionkov M: lucho@ionkov.net L: v9fs-developer@lists.sourceforge.net W: http://v9fs.sf.net -T: git kernel.org:/pub/scm/linux/kernel/ericvh/v9fs-devel.git S: Maintained VIDEO FOR LINUX @@ -2902,7 +2841,6 @@ P: Mauro Carvalho Chehab M: mchehab@brturbo.com.br L: video4linux-list@redhat.com W: http://linuxtv.org -T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git S: Maintained W1 DALLAS'S 1-WIRE BUS @@ -2943,11 +2881,6 @@ M: zaga@fly.cc.fer.hr L: linux-scsi@vger.kernel.org S: Maintained -WISTRON LAPTOP BUTTON DRIVER -P: Miloslav Trmac -M: mitr@volny.cz -S: Maintained - WL3501 WIRELESS PCMCIA CARD DRIVER P: Arnaldo Carvalho de Melo M: acme@conectiva.com.br diff --git a/trunk/Makefile b/trunk/Makefile index 497884d3d556..8560b79268ba 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,8 +1,8 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 15 -EXTRAVERSION = -NAME=Sliding Snow Leopard +EXTRAVERSION =-rc1 +NAME=Affluent Albatross # *DOCUMENTATION* # To see a list of typical targets execute "make help" @@ -408,7 +408,7 @@ outputmakefile: # of make so .config is not included in this case either (for *config). no-dot-config-targets := clean mrproper distclean \ - cscope TAGS tags help %docs check% + cscope TAGS tags help %docs check% kernelrelease config-targets := 0 mixed-targets := 0 @@ -1193,17 +1193,6 @@ else __srctree = $(srctree)/ endif -ifeq ($(ALLSOURCE_ARCHS),) -ifeq ($(ARCH),um) -ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH) -else -ALLINCLUDE_ARCHS := $(ARCH) -endif -else -#Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behaviour. -ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS) -endif - ALLSOURCE_ARCHS := $(ARCH) define all-sources @@ -1219,7 +1208,7 @@ define all-sources find $(__srctree)include $(RCS_FIND_IGNORE) \ \( -name config -o -name 'asm-*' \) -prune \ -o -name '*.[chS]' -print; \ - for ARCH in $(ALLINCLUDE_ARCHS) ; do \ + for ARCH in $(ALLSOURCE_ARCHS) ; do \ find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print; \ done ; \ diff --git a/trunk/README b/trunk/README index 61c4f7429233..4ee7dda88ba3 100644 --- a/trunk/README +++ b/trunk/README @@ -81,11 +81,6 @@ INSTALLING the kernel: failed patches (xxx# or xxx.rej). If there are, either you or me has made a mistake. - Unlike patches for the 2.6.x kernels, patches for the 2.6.x.y kernels - (also known as the -stable kernels) are not incremental but instead apply - directly to the base 2.6.x kernel. Please read - Documentation/applying-patches.txt for more information. - Alternatively, the script patch-kernel can be used to automate this process. It determines the current kernel version and applies any patches found. diff --git a/trunk/arch/alpha/kernel/machvec_impl.h b/trunk/arch/alpha/kernel/machvec_impl.h index 11f996f24fde..4959b7a3e1e6 100644 --- a/trunk/arch/alpha/kernel/machvec_impl.h +++ b/trunk/arch/alpha/kernel/machvec_impl.h @@ -41,7 +41,7 @@ #define CAT1(x,y) x##y #define CAT(x,y) CAT1(x,y) -#define DO_DEFAULT_RTC .rtc_port = 0x70 +#define DO_DEFAULT_RTC rtc_port: 0x70 #define DO_EV4_MMU \ .max_asn = EV4_MAX_ASN, \ diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig index 4b15f5f1e254..3df7cbd924a1 100644 --- a/trunk/arch/arm/Kconfig +++ b/trunk/arch/arm/Kconfig @@ -652,11 +652,25 @@ endmenu menu "Power management options" -source "kernel/power/Kconfig" +config PM + bool "Power Management support" + ---help--- + "Power Management" means that parts of your computer are shut + off or put into a power conserving "sleep" mode if they are not + being used. There are two competing standards for doing this: APM + and ACPI. If you want to use either one, say Y here and then also + to the requisite support below. + + Power Management is most important for battery powered laptop + computers; if you have a laptop, check out the Linux Laptop home + page on the WWW at or + Tuxmobil - Linux on Mobile Computers at + and the Battery Powered Linux mini-HOWTO, available from + . config APM tristate "Advanced Power Management Emulation" - depends on PM_LEGACY + depends on PM ---help--- APM is a BIOS specification for saving power using several different techniques. This is mostly useful for battery powered laptops with @@ -688,8 +702,6 @@ menu "Device Drivers" source "drivers/base/Kconfig" -source "drivers/connector/Kconfig" - if ALIGNMENT_TRAP source "drivers/mtd/Kconfig" endif diff --git a/trunk/arch/arm/boot/compressed/head.S b/trunk/arch/arm/boot/compressed/head.S index 6abafb6f1844..7c7f475e213e 100644 --- a/trunk/arch/arm/boot/compressed/head.S +++ b/trunk/arch/arm/boot/compressed/head.S @@ -19,28 +19,38 @@ */ #ifdef DEBUG +#include + #if defined(CONFIG_DEBUG_ICEDCC) .macro loadsp, rb .endm - .macro writeb, ch, rb + .macro writeb, ch, rb mcr p14, 0, \ch, c0, c1, 0 .endm #else - -#include - .macro writeb, ch, rb senduart \ch, \rb .endm -#if defined(CONFIG_ARCH_SA1100) +#if defined(CONFIG_FOOTBRIDGE) || \ + defined(CONFIG_ARCH_RPC) || \ + defined(CONFIG_ARCH_INTEGRATOR) || \ + defined(CONFIG_ARCH_PXA) || \ + defined(CONFIG_ARCH_IXP4XX) || \ + defined(CONFIG_ARCH_IXP2000) || \ + defined(CONFIG_ARCH_LH7A40X) || \ + defined(CONFIG_ARCH_OMAP) + .macro loadsp, rb + addruart \rb + .endm +#elif defined(CONFIG_ARCH_SA1100) .macro loadsp, rb mov \rb, #0x80000000 @ physical base address -#ifdef CONFIG_DEBUG_LL_SER3 +# if defined(CONFIG_DEBUG_LL_SER3) add \rb, \rb, #0x00050000 @ Ser3 -#else +# else add \rb, \rb, #0x00010000 @ Ser1 -#endif +# endif .endm #elif defined(CONFIG_ARCH_IOP331) .macro loadsp, rb @@ -54,9 +64,7 @@ add \rb, \rb, #0x4000 * CONFIG_S3C2410_LOWLEVEL_UART_PORT .endm #else - .macro loadsp, rb - addruart \rb - .endm +#error no serial architecture defined #endif #endif #endif diff --git a/trunk/arch/arm/common/locomo.c b/trunk/arch/arm/common/locomo.c index 1b7eaab02b9e..557e52c1c869 100644 --- a/trunk/arch/arm/common/locomo.c +++ b/trunk/arch/arm/common/locomo.c @@ -623,6 +623,8 @@ static int locomo_resume(struct platform_device *dev) locomo_writel(0x1, lchip->base + LOCOMO_KEYBOARD + LOCOMO_KCMD); spin_unlock_irqrestore(&lchip->lock, flags); + + dev->power.saved_state = NULL; kfree(save); return 0; @@ -773,7 +775,7 @@ static int locomo_probe(struct platform_device *dev) static int locomo_remove(struct platform_device *dev) { - struct locomo *lchip = platform_get_drvdata(dev); + struct locomo *lchip = platform__get_drvdata(dev); if (lchip) { __locomo_remove(lchip); diff --git a/trunk/arch/arm/common/sa1111.c b/trunk/arch/arm/common/sa1111.c index d0d6e6d2d649..7b07acb03f3b 100644 --- a/trunk/arch/arm/common/sa1111.c +++ b/trunk/arch/arm/common/sa1111.c @@ -32,7 +32,6 @@ #include #include #include -#include #include @@ -133,17 +132,6 @@ static struct sa1111_dev_info sa1111_devices[] = { }, }; -void __init sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes) -{ - unsigned int sz = SZ_1M >> PAGE_SHIFT; - - if (node != 0) - sz = 0; - - size[1] = size[0] - sz; - size[0] = sz; -} - /* * SA1111 interrupt support. Since clearing an IRQ while there are * active IRQs causes the interrupt output to pulse, the upper levels @@ -1278,7 +1266,7 @@ static void __exit sa1111_exit(void) bus_unregister(&sa1111_bus_type); } -subsys_initcall(sa1111_init); +module_init(sa1111_init); module_exit(sa1111_exit); MODULE_DESCRIPTION("Intel Corporation SA1111 core driver"); diff --git a/trunk/arch/arm/common/scoop.c b/trunk/arch/arm/common/scoop.c index 0c3cbd9a388b..32924c6714fe 100644 --- a/trunk/arch/arm/common/scoop.c +++ b/trunk/arch/arm/common/scoop.c @@ -153,7 +153,7 @@ int __init scoop_probe(struct platform_device *pdev) printk("Sharp Scoop Device found at 0x%08x -> 0x%08x\n",(unsigned int)mem->start,(unsigned int)devptr->base); SCOOP_REG(devptr->base, SCOOP_MCR) = 0x0140; - reset_scoop(&pdev->dev); + reset_scoop(dev); SCOOP_REG(devptr->base, SCOOP_GPCR) = inf->io_dir & 0xffff; SCOOP_REG(devptr->base, SCOOP_GPWR) = inf->io_out & 0xffff; diff --git a/trunk/arch/arm/configs/corgi_defconfig b/trunk/arch/arm/configs/corgi_defconfig index 06229026f78b..24987c89609a 100644 --- a/trunk/arch/arm/configs/corgi_defconfig +++ b/trunk/arch/arm/configs/corgi_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Mon Nov 28 10:30:09 2005 +# Linux kernel version: 2.6.14-rc3 +# Sun Oct 9 15:46:42 2005 # CONFIG_ARM=y CONFIG_MMU=y @@ -63,23 +63,6 @@ CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # System Type # @@ -102,7 +85,6 @@ CONFIG_ARCH_PXA=y # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set # CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_REALVIEW is not set # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set @@ -116,14 +98,12 @@ CONFIG_ARCH_PXA=y CONFIG_PXA_SHARPSL=y CONFIG_PXA_SHARPSL_25x=y # CONFIG_PXA_SHARPSL_27x is not set -CONFIG_MACH_POODLE=y +# CONFIG_MACH_POODLE is not set CONFIG_MACH_CORGI=y CONFIG_MACH_SHEPHERD=y CONFIG_MACH_HUSKY=y -CONFIG_MACH_TOSA=y CONFIG_PXA25x=y CONFIG_PXA_SHARP_C7xx=y -CONFIG_PXA_SSP=y # # Processor Type @@ -175,7 +155,6 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4096 CONFIG_ALIGNMENT_TRAP=y # @@ -256,10 +235,6 @@ CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# # CONFIG_NETFILTER_NETLINK is not set # @@ -381,10 +356,6 @@ CONFIG_IP6_NF_RAW=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set CONFIG_NET_CLS_ROUTE=y @@ -442,7 +413,6 @@ CONFIG_IRCOMM=m # CONFIG_SMC_IRCC_FIR is not set # CONFIG_ALI_FIR is not set # CONFIG_VIA_FIR is not set -CONFIG_PXA_FICP=m CONFIG_BT=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m @@ -461,6 +431,7 @@ 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_HCIBCM203X=m CONFIG_BT_HCIBPA10X=m CONFIG_BT_HCIBFUSB=m @@ -487,11 +458,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set -# -# Connector - unified userspace <-> kernelspace linker -# -# CONFIG_CONNECTOR is not set - # # Memory Technology Devices (MTD) # @@ -511,7 +477,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -566,11 +531,6 @@ CONFIG_MTD_NAND_IDS=y CONFIG_MTD_NAND_SHARPSL=y # CONFIG_MTD_NAND_NANDSIM is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -591,6 +551,14 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -657,7 +625,6 @@ CONFIG_SCSI_MULTI_LUN=y # # SCSI low-level drivers # -# CONFIG_ISCSI_TCP is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DEBUG is not set @@ -781,7 +748,6 @@ CONFIG_PPP_ASYNC=m # CONFIG_PPP_SYNC_TTY is not set # CONFIG_PPP_DEFLATE is not set CONFIG_PPP_BSDCOMP=m -# CONFIG_PPP_MPPE is not set # CONFIG_PPPOE is not set # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -884,15 +850,11 @@ CONFIG_UNIX98_PTYS=y # PCMCIA character devices # # CONFIG_SYNCLINK_CS is not set -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -927,7 +889,6 @@ CONFIG_I2C_PXA=y # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -996,10 +957,7 @@ CONFIG_VIDEO_DEV=m # CONFIG_VIDEO_SAA5246A is not set # CONFIG_VIDEO_SAA5249 is not set # CONFIG_TUNER_3036 is not set -# CONFIG_VIDEO_EM28XX is not set # CONFIG_VIDEO_OVCAMCHIP is not set -# CONFIG_VIDEO_AUDIO_DECODER is not set -# CONFIG_VIDEO_DECODER is not set # # Radio Adapters @@ -1018,12 +976,13 @@ CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set -# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_PXA is not set CONFIG_FB_W100=y +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -1032,7 +991,6 @@ CONFIG_FB_W100=y # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set CONFIG_FONTS=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y @@ -1129,15 +1087,15 @@ CONFIG_USB_SL811_CS=m # USB Device Class drivers # # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set -CONFIG_USB_ACM=m -CONFIG_USB_PRINTER=m # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem # +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m # -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set @@ -1149,6 +1107,7 @@ CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_SDDR55 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set # # USB Input Devices @@ -1226,7 +1185,6 @@ CONFIG_USB_MON=y CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y # CONFIG_USB_SERIAL_AIRPRIME is not set -# CONFIG_USB_SERIAL_ANYDATA is not set CONFIG_USB_SERIAL_BELKIN=m # CONFIG_USB_SERIAL_WHITEHEAT is not set CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m @@ -1382,7 +1340,6 @@ CONFIG_RAMFS=y CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y -CONFIG_JFFS2_SUMMARY=y CONFIG_JFFS2_COMPRESSION_OPTIONS=y CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -1509,9 +1466,7 @@ CONFIG_DETECT_SOFTLOCKUP=y CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set CONFIG_FRAME_POINTER=y -# CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_USER is not set # CONFIG_DEBUG_WAITQ is not set CONFIG_DEBUG_ERRORS=y diff --git a/trunk/arch/arm/configs/poodle_defconfig b/trunk/arch/arm/configs/poodle_defconfig new file mode 100644 index 000000000000..72822907759f --- /dev/null +++ b/trunk/arch/arm/configs/poodle_defconfig @@ -0,0 +1,1015 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.14-rc3 +# Sun Oct 9 17:04:29 2005 +# +CONFIG_ARM=y +CONFIG_MMU=y +CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +CONFIG_BSD_PROCESS_ACCT=y +# CONFIG_BSD_PROCESS_ACCT_V3 is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + +# +# System Type +# +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_CAMELOT is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_IOP3XX is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_L7200 is not set +CONFIG_ARCH_PXA=y +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_AAEC2000 is not set + +# +# Intel PXA2xx Implementations +# +# CONFIG_ARCH_LUBBOCK is not set +# CONFIG_MACH_MAINSTONE is not set +# CONFIG_ARCH_PXA_IDP is not set +CONFIG_PXA_SHARPSL=y +CONFIG_PXA_SHARPSL_25x=y +# CONFIG_PXA_SHARPSL_27x is not set +CONFIG_MACH_POODLE=y +# CONFIG_MACH_CORGI is not set +# CONFIG_MACH_SHEPHERD is not set +# CONFIG_MACH_HUSKY is not set +CONFIG_PXA25x=y + +# +# Processor Type +# +CONFIG_CPU_32=y +CONFIG_CPU_XSCALE=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_TLB_V4WBI=y + +# +# Processor Features +# +CONFIG_ARM_THUMB=y +CONFIG_XSCALE_PMU=y +CONFIG_SHARP_LOCOMO=y +CONFIG_SHARP_PARAM=y +CONFIG_SHARP_SCOOP=y + +# +# Bus support +# +CONFIG_ISA_DMA_API=y + +# +# PCCARD (PCMCIA/CardBus) support +# +CONFIG_PCCARD=y +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_IOCTL=y + +# +# PC-card bridges +# +CONFIG_PCMCIA_PXA2XX=y + +# +# Kernel Features +# +CONFIG_PREEMPT=y +# CONFIG_NO_IDLE_HZ is not set +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_ALIGNMENT_TRAP=y + +# +# Boot options +# +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 noinitrd root=/dev/mtdblock2 rootfstype=jffs2 debug" +# CONFIG_XIP_KERNEL is not set + +# +# Floating point emulation +# + +# +# At least one emulation must be selected +# +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set +# CONFIG_FPE_FASTFPE is not set + +# +# Userspace binary formats +# +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_AOUT=m +CONFIG_BINFMT_MISC=m +# CONFIG_ARTHUR is not set + +# +# Power management options +# +CONFIG_PM=y +CONFIG_APM=y + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE 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_INET_TUNNEL is not set +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_BIC=y +# CONFIG_IPV6 is not set +# CONFIG_NETFILTER is not set + +# +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_IEEE80211 is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set + +# +# Memory Technology Devices (MTD) +# +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set +# CONFIG_MTD_AFS_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set + +# +# RAM/ROM/Flash chip drivers +# +# CONFIG_MTD_CFI is not set +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_SHARP_SL=y +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set + +# +# NAND Flash Device Drivers +# +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_VERIFY_WRITE=y +# CONFIG_MTD_NAND_H1900 is not set +CONFIG_MTD_NAND_IDS=y +# CONFIG_MTD_NAND_DISKONCHIP is not set +CONFIG_MTD_NAND_SHARPSL=y +# CONFIG_MTD_NAND_NANDSIM is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# Block devices +# +# CONFIG_BLK_DEV_COW_COMMON 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_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +CONFIG_BLK_DEV_IDECS=y +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_IDE_TASK_IOCTL is not set + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=y +# CONFIG_IDE_ARM is not set +# CONFIG_BLK_DEV_IDEDMA is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +# CONFIG_SCSI is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# + +# +# I2O device support +# + +# +# Network device support +# +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# PHY device support +# +# CONFIG_PHYLIB is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_MII is not set +# CONFIG_SMC91X is not set +# CONFIG_DM9000 is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +CONFIG_NET_RADIO=y + +# +# Obsolete Wireless cards support (pre-802.11) +# +# CONFIG_STRIP is not set +# CONFIG_PCMCIA_WAVELAN is not set +# CONFIG_PCMCIA_NETWAVE is not set + +# +# Wireless 802.11 Frequency Hopping cards support +# +# CONFIG_PCMCIA_RAYCS is not set + +# +# Wireless 802.11b ISA/PCI cards support +# +# CONFIG_HERMES is not set +# CONFIG_ATMEL is not set + +# +# Wireless 802.11b Pcmcia/Cardbus cards support +# +# CONFIG_AIRO_CS is not set +# CONFIG_PCMCIA_WL3501 is not set +# CONFIG_HOSTAP is not set +CONFIG_NET_WIRELESS=y + +# +# PCMCIA network device support +# +CONFIG_NET_PCMCIA=y +# CONFIG_PCMCIA_3C589 is not set +# CONFIG_PCMCIA_3C574 is not set +# CONFIG_PCMCIA_FMVJ18X is not set +CONFIG_PCMCIA_PCNET=y +# CONFIG_PCMCIA_NMCLAN is not set +# CONFIG_PCMCIA_SMC91C92 is not set +# CONFIG_PCMCIA_XIRC2PS is not set +# CONFIG_PCMCIA_AXNET is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +CONFIG_PPP=m +# CONFIG_PPP_MULTILINK is not set +# CONFIG_PPP_FILTER is not set +CONFIG_PPP_ASYNC=m +# CONFIG_PPP_SYNC_TTY is not set +# CONFIG_PPP_DEFLATE is not set +CONFIG_PPP_BSDCOMP=m +# CONFIG_PPPOE is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_TSDEV=y +CONFIG_INPUT_TSDEV_SCREEN_X=240 +CONFIG_INPUT_TSDEV_SCREEN_Y=320 +CONFIG_INPUT_EVDEV=y +CONFIG_INPUT_EVBUG=y + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +CONFIG_KEYBOARD_LOCOMO=y +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_CORGI is not set +CONFIG_KEYBOARD_SPITZ=y +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_PXA=y +CONFIG_SERIAL_PXA_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +# CONFIG_LEGACY_PTYS is not set + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set + +# +# Ftape, the floppy tape device driver +# + +# +# PCMCIA character devices +# +# CONFIG_SYNCLINK_CS is not set +# CONFIG_RAW_DRIVER is not set + +# +# TPM devices +# + +# +# I2C support +# +CONFIG_I2C=y +# CONFIG_I2C_CHARDEV is not set + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=y +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_PXA is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_SENSORS_DS1337 is not set +# CONFIG_SENSORS_DS1374 is not set +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_SENSORS_MAX6875 is not set +CONFIG_I2C_DEBUG_CORE=y +CONFIG_I2C_DEBUG_ALGO=y +CONFIG_I2C_DEBUG_BUS=y +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# Hardware Monitoring support +# +CONFIG_HWMON=y +# CONFIG_HWMON_VID is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_ATXP1 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_FSCHER is not set +# CONFIG_SENSORS_FSCPOS is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_GL520SM is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_LM92 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83792D is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83627EHF is not set +# CONFIG_HWMON_DEBUG_CHIP is not set + +# +# Misc devices +# + +# +# Multimedia Capabilities Port drivers +# + +# +# Multimedia devices +# +CONFIG_VIDEO_DEV=m + +# +# Video For Linux +# + +# +# Video Adapters +# +# CONFIG_VIDEO_CPIA is not set +# CONFIG_VIDEO_SAA5246A is not set +# CONFIG_VIDEO_SAA5249 is not set +# CONFIG_TUNER_3036 is not set +# CONFIG_VIDEO_OVCAMCHIP is not set + +# +# Radio Adapters +# +# CONFIG_RADIO_MAESTRO is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +CONFIG_FB=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y +# CONFIG_FB_MACMODES is not set +CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_TILEBLITTING is not set +CONFIG_FB_PXA=y +# CONFIG_FB_W100 is not set +# CONFIG_FB_PXA_PARAMETERS is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_VIRTUAL is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FONTS=y +CONFIG_FONT_8x8=y +# CONFIG_FONT_8x16 is not set +# CONFIG_FONT_6x11 is not set +# CONFIG_FONT_7x14 is not set +# CONFIG_FONT_PEARL_8x8 is not set +# CONFIG_FONT_ACORN_8x8 is not set +# CONFIG_FONT_MINI_4x6 is not set +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_SUN12x22 is not set +# CONFIG_FONT_10x18 is not set + +# +# Logo configuration +# +# CONFIG_LOGO is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +CONFIG_USB_ARCH_HAS_HCD=y +# CONFIG_USB_ARCH_HAS_OHCI is not set +# CONFIG_USB is not set + +# +# USB Gadget Support +# +CONFIG_USB_GADGET=y +# CONFIG_USB_GADGET_DEBUG_FILES is not set +CONFIG_USB_GADGET_SELECTED=y +# CONFIG_USB_GADGET_NET2280 is not set +CONFIG_USB_GADGET_PXA2XX=y +CONFIG_USB_PXA2XX=y +# CONFIG_USB_PXA2XX_SMALL is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_GADGET_DUALSPEED is not set +# CONFIG_USB_ZERO is not set +CONFIG_USB_ETH=y +CONFIG_USB_ETH_RNDIS=y +# CONFIG_USB_GADGETFS is not set +# CONFIG_USB_FILE_STORAGE is not set +# CONFIG_USB_G_SERIAL is not set + +# +# MMC/SD Card support +# +CONFIG_MMC=y +CONFIG_MMC_DEBUG=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_PXA=y +# CONFIG_MMC_WBSD is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +# CONFIG_EXT2_FS_XIP is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +CONFIG_FS_POSIX_ACL=y +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_INOTIFY=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_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=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y +# CONFIG_RELAYFS_FS is not set + +# +# 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_JFFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_RTIME=y +CONFIG_JFFS2_RUBIN=y +# CONFIG_JFFS2_CMODE_NONE is not set +CONFIG_JFFS2_CMODE_PRIORITY=y +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_CRAMFS=m +# 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 is not set +# CONFIG_NFSD 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_AFS_FS is not set +# CONFIG_9P_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_EFI_PARTITION is not set + +# +# Native Language Support +# +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="cp437" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +CONFIG_NLS_UTF8=y + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_DEBUG_KERNEL=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_FS is not set +CONFIG_FRAME_POINTER=y +# CONFIG_DEBUG_USER is not set +# CONFIG_DEBUG_WAITQ is not set +CONFIG_DEBUG_ERRORS=y +# CONFIG_DEBUG_LL is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Hardware crypto devices +# + +# +# Library routines +# +CONFIG_CRC_CCITT=y +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y diff --git a/trunk/arch/arm/configs/s3c2410_defconfig b/trunk/arch/arm/configs/s3c2410_defconfig index 3f97590c91f2..756348bf5170 100644 --- a/trunk/arch/arm/configs/s3c2410_defconfig +++ b/trunk/arch/arm/configs/s3c2410_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc1 -# Sun Nov 13 17:41:24 2005 +# Linux kernel version: 2.6.13-git8 +# Thu Sep 8 19:24:02 2005 # CONFIG_ARM=y CONFIG_MMU=y @@ -61,23 +61,6 @@ CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # System Type # @@ -100,7 +83,6 @@ CONFIG_ARCH_S3C2410=y # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set # CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_REALVIEW is not set # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set @@ -126,7 +108,6 @@ CONFIG_CPU_S3C2440=y # S3C2410 Boot # # CONFIG_S3C2410_BOOT_WATCHDOG is not set -# CONFIG_S3C2410_BOOT_ERROR_RESET is not set # # S3C2410 Setup @@ -161,7 +142,6 @@ CONFIG_CPU_TLB_V4WBI=y # # Bus support # -CONFIG_ISA=y CONFIG_ISA_DMA_API=y # @@ -172,6 +152,7 @@ CONFIG_ISA_DMA_API=y # # Kernel Features # +# CONFIG_SMP is not set # CONFIG_PREEMPT is not set # CONFIG_NO_IDLE_HZ is not set # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set @@ -182,7 +163,6 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4096 CONFIG_ALIGNMENT_TRAP=y # @@ -273,10 +253,6 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set # CONFIG_NET_CLS_ROUTE is not set @@ -284,6 +260,7 @@ CONFIG_TCP_CONG_BIC=y # Network testing # # CONFIG_NET_PKTGEN is not set +# CONFIG_NETFILTER_NETLINK is not set # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set @@ -323,7 +300,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -359,6 +335,7 @@ CONFIG_MTD_ROM=y # CONFIG_MTD_COMPLEX_MAPPINGS is not set # CONFIG_MTD_PHYSMAP is not set # CONFIG_MTD_ARM_INTEGRATOR is not set +# CONFIG_MTD_EDB7312 is not set # CONFIG_MTD_IMPA7 is not set CONFIG_MTD_BAST=y CONFIG_MTD_BAST_MAXSIZE=4 @@ -392,11 +369,6 @@ CONFIG_MTD_NAND_S3C2410=y # CONFIG_MTD_NAND_DISKONCHIP is not set # CONFIG_MTD_NAND_NANDSIM is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -409,12 +381,10 @@ CONFIG_PARPORT_1284=y # # Plug and Play support # -# CONFIG_PNP is not set # # Block devices # -# CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y @@ -425,6 +395,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -450,7 +428,6 @@ CONFIG_BLK_DEV_IDEFLOPPY=m CONFIG_IDE_GENERIC=y # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDE_BAST=y -# CONFIG_IDE_CHIPSETS is not set # CONFIG_BLK_DEV_IDEDMA is not set # CONFIG_IDEDMA_AUTO is not set # CONFIG_BLK_DEV_HD is not set @@ -489,11 +466,6 @@ CONFIG_NETDEVICES=y # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set -# -# ARCnet devices -# -# CONFIG_ARCNET is not set - # # PHY device support # @@ -503,19 +475,9 @@ CONFIG_NETDEVICES=y # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -CONFIG_MII=y -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_LANCE is not set -# CONFIG_NET_VENDOR_SMC is not set +CONFIG_MII=m # CONFIG_SMC91X is not set -CONFIG_DM9000=y -# CONFIG_NET_VENDOR_RACAL is not set -# CONFIG_AT1700 is not set -# CONFIG_DEPCA is not set -# CONFIG_HP100 is not set -# CONFIG_NET_ISA is not set -# CONFIG_NET_PCI is not set -# CONFIG_NET_POCKET is not set +CONFIG_DM9000=m # # Ethernet (1000 Mbit) @@ -528,7 +490,6 @@ CONFIG_DM9000=y # # Token Ring devices # -# CONFIG_TR is not set # # Wireless LAN (non-hamradio) @@ -581,9 +542,6 @@ CONFIG_KEYBOARD_ATKBD=y CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y # CONFIG_MOUSE_SERIAL is not set -# CONFIG_MOUSE_INPORT is not set -# CONFIG_MOUSE_LOGIBM is not set -# CONFIG_MOUSE_PC110PAD is not set # CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set @@ -610,7 +568,6 @@ CONFIG_SERIAL_NONSTANDARD=y # CONFIG_ROCKETPORT is not set # CONFIG_CYCLADES is not set # CONFIG_DIGIEPCA is not set -# CONFIG_ESPSERIAL is not set # CONFIG_MOXA_INTELLIO is not set # CONFIG_MOXA_SMARTIO is not set # CONFIG_ISI is not set @@ -633,10 +590,6 @@ CONFIG_SERIAL_8250_MANY_PORTS=y CONFIG_SERIAL_8250_SHARE_IRQ=y # CONFIG_SERIAL_8250_DETECT_IRQ is not set # CONFIG_SERIAL_8250_RSA is not set -# CONFIG_SERIAL_8250_FOURPORT is not set -# CONFIG_SERIAL_8250_ACCENT is not set -# CONFIG_SERIAL_8250_BOCA is not set -# CONFIG_SERIAL_8250_HUB6 is not set # # Non-8250 serial port support @@ -669,13 +622,6 @@ CONFIG_WATCHDOG=y # # CONFIG_SOFT_WATCHDOG is not set CONFIG_S3C2410_WATCHDOG=y - -# -# ISA-based Watchdog Cards -# -# CONFIG_PCWATCHDOG is not set -# CONFIG_MIXCOMWD is not set -# CONFIG_WDT is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set CONFIG_S3C2410_RTC=y @@ -690,7 +636,6 @@ CONFIG_S3C2410_RTC=y # # TPM devices # -# CONFIG_TELCLOCK is not set # # I2C support @@ -708,7 +653,6 @@ CONFIG_I2C_ALGOBIT=m # # I2C Hardware Bus support # -# CONFIG_I2C_ELEKTOR is not set CONFIG_I2C_ISA=m # CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set @@ -727,7 +671,6 @@ CONFIG_SENSORS_EEPROM=m # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -794,28 +737,22 @@ CONFIG_SENSORS_LM85=m # Graphics support # CONFIG_FB=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_FILLRECT is not set +# CONFIG_FB_CFB_COPYAREA is not set +# CONFIG_FB_CFB_IMAGEBLIT is not set +# CONFIG_FB_SOFT_CURSOR is not set # CONFIG_FB_MACMODES is not set CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_S1D13XXX is not set -CONFIG_FB_S3C2410=y -# CONFIG_FB_S3C2410_DEBUG is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set -# CONFIG_FONTS is not set -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y +# CONFIG_FRAMEBUFFER_CONSOLE is not set # # Logo configuration @@ -835,10 +772,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -865,6 +798,10 @@ CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set + +# +# XFS support +# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set CONFIG_ROMFS_FS=y @@ -873,7 +810,6 @@ CONFIG_INOTIFY=y CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set # # CD-ROM/DVD Filesystems @@ -918,7 +854,6 @@ CONFIG_JFFS_FS_VERBOSE=0 CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_SUMMARY is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -949,7 +884,6 @@ CONFIG_SUNRPC=y # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set -# CONFIG_9P_FS is not set # # Partition Types @@ -1025,7 +959,7 @@ CONFIG_NLS_DEFAULT="iso8859-1" # # CONFIG_PRINTK_TIME is not set CONFIG_DEBUG_KERNEL=y -CONFIG_MAGIC_SYSRQ=y +# CONFIG_MAGIC_SYSRQ is not set CONFIG_LOG_BUF_SHIFT=16 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set @@ -1036,9 +970,7 @@ CONFIG_DETECT_SOFTLOCKUP=y CONFIG_DEBUG_BUGVERBOSE=y CONFIG_DEBUG_INFO=y # CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set CONFIG_FRAME_POINTER=y -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_DEBUG_USER=y # CONFIG_DEBUG_WAITQ is not set # CONFIG_DEBUG_ERRORS is not set @@ -1066,7 +998,6 @@ CONFIG_DEBUG_S3C2410_UART=0 # Library routines # # CONFIG_CRC_CCITT is not set -# CONFIG_CRC16 is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y diff --git a/trunk/arch/arm/configs/spitz_defconfig b/trunk/arch/arm/configs/spitz_defconfig index 9895539533d6..900e04f8e38c 100644 --- a/trunk/arch/arm/configs/spitz_defconfig +++ b/trunk/arch/arm/configs/spitz_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Mon Nov 28 10:26:52 2005 +# Linux kernel version: 2.6.14-rc3 +# Sun Oct 9 17:11:19 2005 # CONFIG_ARM=y CONFIG_MMU=y @@ -63,23 +63,6 @@ CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # System Type # @@ -102,7 +85,6 @@ CONFIG_ARCH_PXA=y # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set # CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_REALVIEW is not set # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set @@ -116,13 +98,10 @@ CONFIG_ARCH_PXA=y CONFIG_PXA_SHARPSL=y # CONFIG_PXA_SHARPSL_25x is not set CONFIG_PXA_SHARPSL_27x=y -CONFIG_MACH_AKITA=y CONFIG_MACH_SPITZ=y CONFIG_MACH_BORZOI=y CONFIG_PXA27x=y -CONFIG_IWMMXT=y CONFIG_PXA_SHARP_Cxx00=y -CONFIG_PXA_SSP=y # # Processor Type @@ -174,7 +153,6 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4096 CONFIG_ALIGNMENT_TRAP=y # @@ -255,10 +233,6 @@ CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# # CONFIG_NETFILTER_NETLINK is not set # @@ -380,10 +354,6 @@ CONFIG_IP6_NF_RAW=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set CONFIG_NET_CLS_ROUTE=y @@ -441,7 +411,6 @@ CONFIG_IRCOMM=m # CONFIG_SMC_IRCC_FIR is not set # CONFIG_ALI_FIR is not set # CONFIG_VIA_FIR is not set -CONFIG_PXA_FICP=m CONFIG_BT=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m @@ -460,6 +429,7 @@ 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_HCIBCM203X=m CONFIG_BT_HCIBPA10X=m CONFIG_BT_HCIBFUSB=m @@ -486,11 +456,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set -# -# Connector - unified userspace <-> kernelspace linker -# -# CONFIG_CONNECTOR is not set - # # Memory Technology Devices (MTD) # @@ -510,7 +475,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -565,11 +529,6 @@ CONFIG_MTD_NAND_IDS=y CONFIG_MTD_NAND_SHARPSL=y # CONFIG_MTD_NAND_NANDSIM is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -590,6 +549,14 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -656,7 +623,6 @@ CONFIG_SCSI_MULTI_LUN=y # # SCSI low-level drivers # -# CONFIG_ISCSI_TCP is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DEBUG is not set @@ -780,7 +746,6 @@ CONFIG_PPP_ASYNC=m # CONFIG_PPP_SYNC_TTY is not set # CONFIG_PPP_DEFLATE is not set CONFIG_PPP_BSDCOMP=m -# CONFIG_PPP_MPPE is not set # CONFIG_PPPOE is not set # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -806,7 +771,6 @@ CONFIG_INPUT=y # CONFIG_INPUT_TSDEV is not set CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_EVBUG is not set -# CONFIG_INPUT_POWER is not set # # Input Device Drivers @@ -884,37 +848,16 @@ CONFIG_UNIX98_PTYS=y # PCMCIA character devices # # CONFIG_SYNCLINK_CS is not set -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support # -CONFIG_I2C=y -# CONFIG_I2C_CHARDEV is not set - -# -# I2C Algorithms -# -# CONFIG_I2C_ALGOBIT is not set -# CONFIG_I2C_ALGOPCF is not set -# CONFIG_I2C_ALGOPCA is not set - -# -# I2C Hardware Bus support -# -CONFIG_I2C_PXA=y -# CONFIG_I2C_PXA_SLAVE is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_PCA_ISA is not set +# CONFIG_I2C is not set # # Hardware Monitoring support @@ -948,13 +891,14 @@ CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set -# CONFIG_FB_S1D13XXX is not set CONFIG_FB_PXA=y -# CONFIG_FB_PXA_PARAMETERS is not set # CONFIG_FB_W100 is not set +# CONFIG_FB_PXA_PARAMETERS is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -963,7 +907,6 @@ CONFIG_FB_PXA=y # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y CONFIG_FONTS=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y @@ -1022,15 +965,15 @@ CONFIG_USB_SL811_CS=m # # USB Device Class drivers # -CONFIG_USB_ACM=m -CONFIG_USB_PRINTER=m # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem # +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m # -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set @@ -1042,6 +985,7 @@ CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_SDDR55 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set # # USB Input Devices @@ -1114,7 +1058,6 @@ CONFIG_USB_MON=y CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y # CONFIG_USB_SERIAL_AIRPRIME is not set -# CONFIG_USB_SERIAL_ANYDATA is not set CONFIG_USB_SERIAL_BELKIN=m # CONFIG_USB_SERIAL_WHITEHEAT is not set CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m @@ -1275,7 +1218,6 @@ CONFIG_RAMFS=y CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y -CONFIG_JFFS2_SUMMARY=y CONFIG_JFFS2_COMPRESSION_OPTIONS=y CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -1402,9 +1344,7 @@ CONFIG_DETECT_SOFTLOCKUP=y CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set CONFIG_FRAME_POINTER=y -# CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_USER is not set # CONFIG_DEBUG_WAITQ is not set CONFIG_DEBUG_ERRORS=y diff --git a/trunk/arch/arm/kernel/apm.c b/trunk/arch/arm/kernel/apm.c index a2843be05557..b0bbd1e62ebb 100644 --- a/trunk/arch/arm/kernel/apm.c +++ b/trunk/arch/arm/kernel/apm.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/arch/arm/kernel/armksyms.c b/trunk/arch/arm/kernel/armksyms.c index 9997098009a9..7a3261f0bf79 100644 --- a/trunk/arch/arm/kernel/armksyms.c +++ b/trunk/arch/arm/kernel/armksyms.c @@ -120,6 +120,7 @@ EXPORT_SYMBOL(__arch_strncpy_from_user); EXPORT_SYMBOL(__get_user_1); EXPORT_SYMBOL(__get_user_2); EXPORT_SYMBOL(__get_user_4); +EXPORT_SYMBOL(__get_user_8); EXPORT_SYMBOL(__put_user_1); EXPORT_SYMBOL(__put_user_2); diff --git a/trunk/arch/arm/kernel/calls.S b/trunk/arch/arm/kernel/calls.S index 55076a75e5bf..2ad4aa2a1536 100644 --- a/trunk/arch/arm/kernel/calls.S +++ b/trunk/arch/arm/kernel/calls.S @@ -131,7 +131,7 @@ __syscall_start: .long sys_wait4 /* 115 */ .long sys_swapoff .long sys_sysinfo - .long sys_ipc + .long sys_ipc_wrapper .long sys_fsync .long sys_sigreturn_wrapper /* 120 */ .long sys_clone_wrapper @@ -254,7 +254,7 @@ __syscall_start: .long sys_fremovexattr .long sys_tkill .long sys_sendfile64 -/* 240 */ .long sys_futex +/* 240 */ .long sys_futex_wrapper .long sys_sched_setaffinity .long sys_sched_getaffinity .long sys_io_setup @@ -284,7 +284,7 @@ __syscall_start: .long sys_fstatfs64 .long sys_tgkill .long sys_utimes -/* 270 */ .long sys_arm_fadvise64_64 +/* 270 */ .long sys_arm_fadvise64_64_wrapper .long sys_pciconfig_iobase .long sys_pciconfig_read .long sys_pciconfig_write @@ -333,7 +333,7 @@ __syscall_start: .long sys_inotify_init .long sys_inotify_add_watch .long sys_inotify_rm_watch - .long sys_mbind + .long sys_mbind_wrapper /* 320 */ .long sys_get_mempolicy .long sys_set_mempolicy __syscall_end: diff --git a/trunk/arch/arm/kernel/entry-armv.S b/trunk/arch/arm/kernel/entry-armv.S index 2a8d27e18fa7..d9fb819bf7cc 100644 --- a/trunk/arch/arm/kernel/entry-armv.S +++ b/trunk/arch/arm/kernel/entry-armv.S @@ -611,47 +611,6 @@ ENTRY(__switch_to) .globl __kuser_helper_start __kuser_helper_start: -/* - * Reference prototype: - * - * void __kernel_memory_barrier(void) - * - * Input: - * - * lr = return address - * - * Output: - * - * none - * - * Clobbered: - * - * the Z flag might be lost - * - * Definition and user space usage example: - * - * typedef void (__kernel_dmb_t)(void); - * #define __kernel_dmb (*(__kernel_dmb_t *)0xffff0fa0) - * - * Apply any needed memory barrier to preserve consistency with data modified - * manually and __kuser_cmpxchg usage. - * - * This could be used as follows: - * - * #define __kernel_dmb() \ - * asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \ - * : : : "lr","cc" ) - */ - -__kuser_memory_barrier: @ 0xffff0fa0 - -#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP) - mcr p15, 0, r0, c7, c10, 5 @ dmb -#endif - mov pc, lr - - .align 5 - /* * Reference prototype: * @@ -683,8 +642,6 @@ __kuser_memory_barrier: @ 0xffff0fa0 * The C flag is also set if *ptr was changed to allow for assembly * optimization in the calling code. * - * Note: this routine already includes memory barriers as needed. - * * For example, a user space atomic_add implementation could look like this: * * #define atomic_add(ptr, val) \ @@ -741,16 +698,10 @@ __kuser_cmpxchg: @ 0xffff0fc0 #else -#ifdef CONFIG_SMP - mcr p15, 0, r0, c7, c10, 5 @ dmb -#endif ldrex r3, [r2] subs r3, r3, r0 strexeq r3, r1, [r2] rsbs r0, r3, #0 -#ifdef CONFIG_SMP - mcr p15, 0, r0, c7, c10, 5 @ dmb -#endif mov pc, lr #endif diff --git a/trunk/arch/arm/kernel/entry-common.S b/trunk/arch/arm/kernel/entry-common.S index e2b42997ad33..066597f4345a 100644 --- a/trunk/arch/arm/kernel/entry-common.S +++ b/trunk/arch/arm/kernel/entry-common.S @@ -48,7 +48,8 @@ work_pending: mov r0, sp @ 'regs' mov r2, why @ 'syscall' bl do_notify_resume - b ret_slow_syscall @ Check work again + disable_irq @ disable interrupts + b no_work_pending work_resched: bl schedule @@ -145,7 +146,7 @@ ENTRY(vector_swi) #endif enable_irq - stmdb sp!, {r4, r5} @ push fifth and sixth args + str r4, [sp, #-S_OFF]! @ push fifth arg get_thread_info tsk ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing @@ -204,7 +205,7 @@ ENTRY(sys_call_table) * Special system call wrappers */ @ r0 = syscall number -@ r8 = syscall table +@ r5 = syscall table .type sys_syscall, #function sys_syscall: eor scno, r0, #__NR_SYSCALL_BASE @@ -255,6 +256,22 @@ sys_sigaltstack_wrapper: ldr r2, [sp, #S_OFF + S_SP] b do_sigaltstack +sys_futex_wrapper: + str r5, [sp, #4] @ push sixth arg + b sys_futex + +sys_arm_fadvise64_64_wrapper: + str r5, [sp, #4] @ push r5 to stack + b sys_arm_fadvise64_64 + +sys_mbind_wrapper: + str r5, [sp, #4] + b sys_mbind + +sys_ipc_wrapper: + str r5, [sp, #4] @ push sixth arg + b sys_ipc + /* * Note: off_4k (r5) is always units of 4K. If we can't do the requested * offset, we return EINVAL. diff --git a/trunk/arch/arm/kernel/head.S b/trunk/arch/arm/kernel/head.S index d7d69fd7039f..8d8748407cbe 100644 --- a/trunk/arch/arm/kernel/head.S +++ b/trunk/arch/arm/kernel/head.S @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -82,7 +83,7 @@ ENTRY(stext) @ and irqs disabled bl __lookup_processor_type @ r5=procinfo r9=cpuid movs r10, r5 @ invalid processor (r5=0)? - beq __error_p @ yes, error 'p' + beq __error_p @ yes, error 'p' bl __lookup_machine_type @ r5=machinfo movs r8, r5 @ invalid machine (r5=0)? beq __error_a @ yes, error 'a' @@ -342,12 +343,16 @@ __create_page_tables: bne 1b #if defined(CONFIG_ARCH_NETWINDER) || defined(CONFIG_ARCH_CATS) /* - * If we're using the NetWinder or CATS, we also need to map - * in the 16550-type serial port for the debug messages + * If we're using the NetWinder, we need to map in + * the 16550-type serial port for the debug messages */ + teq r1, #MACH_TYPE_NETWINDER + teqne r1, #MACH_TYPE_CATS + bne 1f add r0, r4, #0xff000000 >> 18 orr r3, r7, #0x7c000000 str r3, [r0] +1: #endif #ifdef CONFIG_ARCH_RPC /* diff --git a/trunk/arch/arm/kernel/module.c b/trunk/arch/arm/kernel/module.c index 055bf5d28894..6055e1427ba3 100644 --- a/trunk/arch/arm/kernel/module.c +++ b/trunk/arch/arm/kernel/module.c @@ -101,8 +101,6 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, break; case R_ARM_PC24: - case R_ARM_CALL: - case R_ARM_JUMP24: offset = (*(u32 *)loc & 0x00ffffff) << 2; if (offset & 0x02000000) offset -= 0x04000000; diff --git a/trunk/arch/arm/kernel/ptrace.c b/trunk/arch/arm/kernel/ptrace.c index 2b84f78d7b0f..9a340e790da5 100644 --- a/trunk/arch/arm/kernel/ptrace.c +++ b/trunk/arch/arm/kernel/ptrace.c @@ -242,15 +242,6 @@ get_branch_address(struct task_struct *child, unsigned long pc, unsigned long in */ long aluop1, aluop2, ccbit; - if ((insn & 0x0fffffd0) == 0x012fff10) { - /* - * bx or blx - */ - alt = get_user_reg(child, insn & 15); - break; - } - - if ((insn & 0xf000) != 0xf000) break; diff --git a/trunk/arch/arm/kernel/signal.c b/trunk/arch/arm/kernel/signal.c index 765922bcf9e7..a917e3dd3666 100644 --- a/trunk/arch/arm/kernel/signal.c +++ b/trunk/arch/arm/kernel/signal.c @@ -595,22 +595,23 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, */ ret |= !valid_user_regs(regs); + /* + * Block the signal if we were unsuccessful. + */ if (ret != 0) { - force_sigsegv(sig, tsk); - return; + spin_lock_irq(&tsk->sighand->siglock); + sigorsets(&tsk->blocked, &tsk->blocked, + &ka->sa.sa_mask); + if (!(ka->sa.sa_flags & SA_NODEFER)) + sigaddset(&tsk->blocked, sig); + recalc_sigpending(); + spin_unlock_irq(&tsk->sighand->siglock); } - /* - * Block the signal if we were successful. - */ - spin_lock_irq(&tsk->sighand->siglock); - sigorsets(&tsk->blocked, &tsk->blocked, - &ka->sa.sa_mask); - if (!(ka->sa.sa_flags & SA_NODEFER)) - sigaddset(&tsk->blocked, sig); - recalc_sigpending(); - spin_unlock_irq(&tsk->sighand->siglock); + if (ret == 0) + return; + force_sigsegv(sig, tsk); } /* diff --git a/trunk/arch/arm/kernel/smp.c b/trunk/arch/arm/kernel/smp.c index 373c0959bc2f..e55ea952f7aa 100644 --- a/trunk/arch/arm/kernel/smp.c +++ b/trunk/arch/arm/kernel/smp.c @@ -256,7 +256,9 @@ void __cpuexit cpu_die(void) asmlinkage void __cpuinit secondary_start_kernel(void) { struct mm_struct *mm = &init_mm; - unsigned int cpu = smp_processor_id(); + unsigned int cpu; + + cpu = smp_processor_id(); printk("CPU%u: Booted secondary processor\n", cpu); diff --git a/trunk/arch/arm/kernel/vmlinux.lds.S b/trunk/arch/arm/kernel/vmlinux.lds.S index 9a47770114d4..80c8e4c8cefa 100644 --- a/trunk/arch/arm/kernel/vmlinux.lds.S +++ b/trunk/arch/arm/kernel/vmlinux.lds.S @@ -172,10 +172,6 @@ SECTIONS .comment 0 : { *(.comment) } } -/* - * These must never be empty - * If you have to comment these two assert statements out, your - * binutils is too old (for other reasons as well) - */ +/* those must never be empty */ ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support") ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined") diff --git a/trunk/arch/arm/lib/getuser.S b/trunk/arch/arm/lib/getuser.S index c03ea8e666ba..d204018070a4 100644 --- a/trunk/arch/arm/lib/getuser.S +++ b/trunk/arch/arm/lib/getuser.S @@ -54,6 +54,15 @@ __get_user_4: mov r0, #0 mov pc, lr + .global __get_user_8 +__get_user_8: +5: ldrt r2, [r0], #4 +6: ldrt r3, [r0] + mov r0, #0 + mov pc, lr + +__get_user_bad_8: + mov r3, #0 __get_user_bad: mov r2, #0 mov r0, #-EFAULT @@ -64,4 +73,6 @@ __get_user_bad: .long 2b, __get_user_bad .long 3b, __get_user_bad .long 4b, __get_user_bad + .long 5b, __get_user_bad_8 + .long 6b, __get_user_bad_8 .previous diff --git a/trunk/arch/arm/mach-clps7500/core.c b/trunk/arch/arm/mach-clps7500/core.c index d869af0023f8..0364ba4b539e 100644 --- a/trunk/arch/arm/mach-clps7500/core.c +++ b/trunk/arch/arm/mach-clps7500/core.c @@ -260,7 +260,7 @@ static void __init clps7500_init_irq(void) static struct map_desc cl7500_io_desc[] __initdata = { { /* IO space */ - .virtual = (unsigned long)IO_BASE, + .virtual = IO_BASE, .pfn = __phys_to_pfn(IO_START), .length = IO_SIZE, .type = MT_DEVICE diff --git a/trunk/arch/arm/mach-footbridge/common.c b/trunk/arch/arm/mach-footbridge/common.c index bbe6e4a0bf6a..dc09fd200c16 100644 --- a/trunk/arch/arm/mach-footbridge/common.c +++ b/trunk/arch/arm/mach-footbridge/common.c @@ -132,14 +132,14 @@ void __init footbridge_init_irq(void) static struct map_desc fb_common_io_desc[] __initdata = { { .virtual = ARMCSR_BASE, - .pfn = __phys_to_pfn(DC21285_ARMCSR_BASE), + .pfn = DC21285_ARMCSR_BASE, .length = ARMCSR_SIZE, - .type = MT_DEVICE, + .type = MT_DEVICE }, { .virtual = XBUS_BASE, .pfn = __phys_to_pfn(0x40000000), .length = XBUS_SIZE, - .type = MT_DEVICE, + .type = MT_DEVICE } }; @@ -153,28 +153,28 @@ static struct map_desc ebsa285_host_io_desc[] __initdata = { .virtual = PCIMEM_BASE, .pfn = __phys_to_pfn(DC21285_PCI_MEM), .length = PCIMEM_SIZE, - .type = MT_DEVICE, + .type = MT_DEVICE }, { .virtual = PCICFG0_BASE, .pfn = __phys_to_pfn(DC21285_PCI_TYPE_0_CONFIG), .length = PCICFG0_SIZE, - .type = MT_DEVICE, + .type = MT_DEVICE }, { .virtual = PCICFG1_BASE, .pfn = __phys_to_pfn(DC21285_PCI_TYPE_1_CONFIG), .length = PCICFG1_SIZE, - .type = MT_DEVICE, + .type = MT_DEVICE }, { .virtual = PCIIACK_BASE, .pfn = __phys_to_pfn(DC21285_PCI_IACK), .length = PCIIACK_SIZE, - .type = MT_DEVICE, + .type = MT_DEVICE }, { .virtual = PCIO_BASE, .pfn = __phys_to_pfn(DC21285_PCI_IO), .length = PCIO_SIZE, - .type = MT_DEVICE, - }, + .type = MT_DEVICE + } #endif }; @@ -187,13 +187,13 @@ static struct map_desc co285_io_desc[] __initdata = { .virtual = PCIO_BASE, .pfn = __phys_to_pfn(DC21285_PCI_IO), .length = PCIO_SIZE, - .type = MT_DEVICE, + .type = MT_DEVICE }, { .virtual = PCIMEM_BASE, .pfn = __phys_to_pfn(DC21285_PCI_MEM), .length = PCIMEM_SIZE, - .type = MT_DEVICE, - }, + .type = MT_DEVICE + } #endif }; diff --git a/trunk/arch/arm/mach-ixp4xx/ixdp425-setup.c b/trunk/arch/arm/mach-ixp4xx/ixdp425-setup.c index 3a22d84e1047..0a41080d2266 100644 --- a/trunk/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/trunk/arch/arm/mach-ixp4xx/ixdp425-setup.c @@ -85,7 +85,7 @@ static struct plat_serial8250_port ixdp425_uart_data[] = { { .mapbase = IXP4XX_UART2_BASE_PHYS, .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, - .irq = IRQ_IXP4XX_UART2, + .irq = IRQ_IXP4XX_UART1, .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, .iotype = UPIO_MEM, .regshift = 2, diff --git a/trunk/arch/arm/mach-pxa/Kconfig b/trunk/arch/arm/mach-pxa/Kconfig index 2a58499c0968..e201aa9765b9 100644 --- a/trunk/arch/arm/mach-pxa/Kconfig +++ b/trunk/arch/arm/mach-pxa/Kconfig @@ -44,7 +44,6 @@ config PXA_SHARPSL_25x config PXA_SHARPSL_27x bool "Sharp PXA270 models (SL-Cxx00)" select PXA27x - select IWMMXT endchoice @@ -61,6 +60,7 @@ config MACH_CORGI bool "Enable Sharp SL-C700 (Corgi) Support" depends PXA_SHARPSL_25x select PXA_SHARP_C7xx + select PXA_SSP config MACH_SHEPHERD bool "Enable Sharp SL-C750 (Shepherd) Support" @@ -72,14 +72,6 @@ config MACH_HUSKY depends PXA_SHARPSL_25x select PXA_SHARP_C7xx -config MACH_AKITA - bool "Enable Sharp SL-1000 (Akita) Support" - depends PXA_SHARPSL_27x - select PXA_SHARP_Cxx00 - select MACH_SPITZ - select I2C - select I2C_PXA - config MACH_SPITZ bool "Enable Sharp Zaurus SL-3000 (Spitz) Support" depends PXA_SHARPSL_27x @@ -92,7 +84,7 @@ config MACH_BORZOI config MACH_TOSA bool "Enable Sharp SL-6000x (Tosa) Support" - depends PXA_SHARPSL_25x + depends PXA_SHARPSL config PXA25x bool diff --git a/trunk/arch/arm/mach-pxa/Makefile b/trunk/arch/arm/mach-pxa/Makefile index 32526a0a6f86..d210bd5032ce 100644 --- a/trunk/arch/arm/mach-pxa/Makefile +++ b/trunk/arch/arm/mach-pxa/Makefile @@ -11,9 +11,8 @@ obj-$(CONFIG_PXA27x) += pxa27x.o obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o obj-$(CONFIG_ARCH_PXA_IDP) += idp.o -obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o -obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o -obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o +obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o +obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o obj-$(CONFIG_MACH_POODLE) += poodle.o obj-$(CONFIG_MACH_TOSA) += tosa.o diff --git a/trunk/arch/arm/mach-pxa/akita-ioexp.c b/trunk/arch/arm/mach-pxa/akita-ioexp.c deleted file mode 100644 index f6d73cc01f78..000000000000 --- a/trunk/arch/arm/mach-pxa/akita-ioexp.c +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Support for the Extra GPIOs on the Sharp SL-C1000 (Akita) - * (uses a Maxim MAX7310 8 Port IO Expander) - * - * Copyright 2005 Openedhand Ltd. - * - * Author: Richard Purdie - * - * 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 -#include -#include -#include -#include -#include -#include -#include - -/* MAX7310 Regiser Map */ -#define MAX7310_INPUT 0x00 -#define MAX7310_OUTPUT 0x01 -#define MAX7310_POLINV 0x02 -#define MAX7310_IODIR 0x03 /* 1 = Input, 0 = Output */ -#define MAX7310_TIMEOUT 0x04 - -/* Addresses to scan */ -static unsigned short normal_i2c[] = { 0x18, I2C_CLIENT_END }; - -/* I2C Magic */ -I2C_CLIENT_INSMOD; - -static int max7310_write(struct i2c_client *client, int address, int data); -static struct i2c_client max7310_template; -static void akita_ioexp_work(void *private_); - -static struct device *akita_ioexp_device; -static unsigned char ioexp_output_value = AKITA_IOEXP_IO_OUT; -DECLARE_WORK(akita_ioexp, akita_ioexp_work, NULL); - - -/* - * MAX7310 Access - */ -static int max7310_config(struct device *dev, int iomode, int polarity) -{ - int ret; - struct i2c_client *client = to_i2c_client(dev); - - ret = max7310_write(client, MAX7310_POLINV, polarity); - if (ret < 0) - return ret; - ret = max7310_write(client, MAX7310_IODIR, iomode); - return ret; -} - -static int max7310_set_ouputs(struct device *dev, int outputs) -{ - struct i2c_client *client = to_i2c_client(dev); - - return max7310_write(client, MAX7310_OUTPUT, outputs); -} - -/* - * I2C Functions - */ -static int max7310_write(struct i2c_client *client, int address, int value) -{ - u8 data[2]; - - data[0] = address & 0xff; - data[1] = value & 0xff; - - if (i2c_master_send(client, data, 2) == 2) - return 0; - return -1; -} - -static int max7310_detect(struct i2c_adapter *adapter, int address, int kind) -{ - struct i2c_client *new_client; - int err; - - if (!(new_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL))) - return -ENOMEM; - - max7310_template.adapter = adapter; - max7310_template.addr = address; - - memcpy(new_client, &max7310_template, sizeof(struct i2c_client)); - - if ((err = i2c_attach_client(new_client))) { - kfree(new_client); - return err; - } - - max7310_config(&new_client->dev, AKITA_IOEXP_IO_DIR, 0); - akita_ioexp_device = &new_client->dev; - schedule_work(&akita_ioexp); - - return 0; -} - -static int max7310_attach_adapter(struct i2c_adapter *adapter) -{ - return i2c_probe(adapter, &addr_data, max7310_detect); -} - -static int max7310_detach_client(struct i2c_client *client) -{ - int err; - - akita_ioexp_device = NULL; - - if ((err = i2c_detach_client(client))) - return err; - - kfree(client); - return 0; -} - -static struct i2c_driver max7310_i2c_driver = { - .owner = THIS_MODULE, - .name = "akita-max7310", - .id = I2C_DRIVERID_AKITAIOEXP, - .flags = I2C_DF_NOTIFY, - .attach_adapter = max7310_attach_adapter, - .detach_client = max7310_detach_client, -}; - -static struct i2c_client max7310_template = { - name: "akita-max7310", - flags: I2C_CLIENT_ALLOW_USE, - driver: &max7310_i2c_driver, -}; - -void akita_set_ioexp(struct device *dev, unsigned char bit) -{ - ioexp_output_value |= bit; - - if (akita_ioexp_device) - schedule_work(&akita_ioexp); - return; -} - -void akita_reset_ioexp(struct device *dev, unsigned char bit) -{ - ioexp_output_value &= ~bit; - - if (akita_ioexp_device) - schedule_work(&akita_ioexp); - return; -} - -EXPORT_SYMBOL(akita_set_ioexp); -EXPORT_SYMBOL(akita_reset_ioexp); - -static void akita_ioexp_work(void *private_) -{ - if (akita_ioexp_device) - max7310_set_ouputs(akita_ioexp_device, ioexp_output_value); -} - - -#ifdef CONFIG_PM -static int akita_ioexp_suspend(struct platform_device *pdev, pm_message_t state) -{ - flush_scheduled_work(); - return 0; -} - -static int akita_ioexp_resume(struct platform_device *pdev) -{ - schedule_work(&akita_ioexp); - return 0; -} -#else -#define akita_ioexp_suspend NULL -#define akita_ioexp_resume NULL -#endif - -static int __init akita_ioexp_probe(struct platform_device *pdev) -{ - return i2c_add_driver(&max7310_i2c_driver); -} - -static int akita_ioexp_remove(struct platform_device *pdev) -{ - i2c_del_driver(&max7310_i2c_driver); - return 0; -} - -static struct platform_driver akita_ioexp_driver = { - .probe = akita_ioexp_probe, - .remove = akita_ioexp_remove, - .suspend = akita_ioexp_suspend, - .resume = akita_ioexp_resume, - .driver = { - .name = "akita-ioexp", - }, -}; - -static int __init akita_ioexp_init(void) -{ - return platform_driver_register(&akita_ioexp_driver); -} - -static void __exit akita_ioexp_exit(void) -{ - platform_driver_unregister(&akita_ioexp_driver); -} - -MODULE_AUTHOR("Richard Purdie "); -MODULE_DESCRIPTION("Akita IO-Expander driver"); -MODULE_LICENSE("GPL"); - -fs_initcall(akita_ioexp_init); -module_exit(akita_ioexp_exit); - diff --git a/trunk/arch/arm/mach-pxa/corgi_lcd.c b/trunk/arch/arm/mach-pxa/corgi_lcd.c index 6dbcaf114ad7..698eb06545c4 100644 --- a/trunk/arch/arm/mach-pxa/corgi_lcd.c +++ b/trunk/arch/arm/mach-pxa/corgi_lcd.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/trunk/arch/arm/mach-pxa/corgi_pm.c b/trunk/arch/arm/mach-pxa/corgi_pm.c deleted file mode 100644 index 599be14754f9..000000000000 --- a/trunk/arch/arm/mach-pxa/corgi_pm.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Battery and Power Management code for the Sharp SL-C7xx - * - * Copyright (c) 2005 Richard Purdie - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include "sharpsl.h" - -static void corgi_charger_init(void) -{ - pxa_gpio_mode(CORGI_GPIO_ADC_TEMP_ON | GPIO_OUT); - pxa_gpio_mode(CORGI_GPIO_CHRG_ON | GPIO_OUT); - pxa_gpio_mode(CORGI_GPIO_CHRG_UKN | GPIO_OUT); - pxa_gpio_mode(CORGI_GPIO_KEY_INT | GPIO_IN); -} - -static void corgi_charge_led(int val) -{ - if (val == SHARPSL_LED_ERROR) { - dev_dbg(sharpsl_pm.dev, "Charge LED Error\n"); - } else if (val == SHARPSL_LED_ON) { - dev_dbg(sharpsl_pm.dev, "Charge LED On\n"); - GPSR0 = GPIO_bit(CORGI_GPIO_LED_ORANGE); - } else { - dev_dbg(sharpsl_pm.dev, "Charge LED Off\n"); - GPCR0 = GPIO_bit(CORGI_GPIO_LED_ORANGE); - } -} - -static void corgi_measure_temp(int on) -{ - if (on) - GPSR(CORGI_GPIO_ADC_TEMP_ON) = GPIO_bit(CORGI_GPIO_ADC_TEMP_ON); - else - GPCR(CORGI_GPIO_ADC_TEMP_ON) = GPIO_bit(CORGI_GPIO_ADC_TEMP_ON); -} - -static void corgi_charge(int on) -{ - if (on) { - if (machine_is_corgi() && (sharpsl_pm.flags & SHARPSL_SUSPENDED)) { - GPCR(CORGI_GPIO_CHRG_ON) = GPIO_bit(CORGI_GPIO_CHRG_ON); - GPSR(CORGI_GPIO_CHRG_UKN) = GPIO_bit(CORGI_GPIO_CHRG_UKN); - } else { - GPSR(CORGI_GPIO_CHRG_ON) = GPIO_bit(CORGI_GPIO_CHRG_ON); - GPCR(CORGI_GPIO_CHRG_UKN) = GPIO_bit(CORGI_GPIO_CHRG_UKN); - } - } else { - GPCR(CORGI_GPIO_CHRG_ON) = GPIO_bit(CORGI_GPIO_CHRG_ON); - GPCR(CORGI_GPIO_CHRG_UKN) = GPIO_bit(CORGI_GPIO_CHRG_UKN); - } -} - -static void corgi_discharge(int on) -{ - if (on) - GPSR(CORGI_GPIO_DISCHARGE_ON) = GPIO_bit(CORGI_GPIO_DISCHARGE_ON); - else - GPCR(CORGI_GPIO_DISCHARGE_ON) = GPIO_bit(CORGI_GPIO_DISCHARGE_ON); -} - -static void corgi_presuspend(void) -{ - int i; - unsigned long wakeup_mask; - - /* charging , so CHARGE_ON bit is HIGH during OFF. */ - if (READ_GPIO_BIT(CORGI_GPIO_CHRG_ON)) - PGSR1 |= GPIO_bit(CORGI_GPIO_CHRG_ON); - else - PGSR1 &= ~GPIO_bit(CORGI_GPIO_CHRG_ON); - - if (READ_GPIO_BIT(CORGI_GPIO_LED_ORANGE)) - PGSR0 |= GPIO_bit(CORGI_GPIO_LED_ORANGE); - else - PGSR0 &= ~GPIO_bit(CORGI_GPIO_LED_ORANGE); - - if (READ_GPIO_BIT(CORGI_GPIO_CHRG_UKN)) - PGSR1 |= GPIO_bit(CORGI_GPIO_CHRG_UKN); - else - PGSR1 &= ~GPIO_bit(CORGI_GPIO_CHRG_UKN); - - /* Resume on keyboard power key */ - PGSR2 = (PGSR2 & ~CORGI_GPIO_ALL_STROBE_BIT) | CORGI_GPIO_STROBE_BIT(0); - - wakeup_mask = GPIO_bit(CORGI_GPIO_KEY_INT) | GPIO_bit(CORGI_GPIO_WAKEUP) | GPIO_bit(CORGI_GPIO_AC_IN) | GPIO_bit(CORGI_GPIO_CHRG_FULL); - - if (!machine_is_corgi()) - wakeup_mask |= GPIO_bit(CORGI_GPIO_MAIN_BAT_LOW); - - PWER = wakeup_mask | PWER_RTC; - PRER = wakeup_mask; - PFER = wakeup_mask; - - for (i = 0; i <=15; i++) { - if (PRER & PFER & GPIO_bit(i)) { - if (GPLR0 & GPIO_bit(i) ) - PRER &= ~GPIO_bit(i); - else - PFER &= ~GPIO_bit(i); - } - } -} - -static void corgi_postsuspend(void) -{ -} - -/* - * Check what brought us out of the suspend. - * Return: 0 to sleep, otherwise wake - */ -static int corgi_should_wakeup(unsigned int resume_on_alarm) -{ - int is_resume = 0; - - dev_dbg(sharpsl_pm.dev, "GPLR0 = %x,%x\n", GPLR0, PEDR); - - if ((PEDR & GPIO_bit(CORGI_GPIO_AC_IN))) { - if (STATUS_AC_IN()) { - /* charge on */ - dev_dbg(sharpsl_pm.dev, "ac insert\n"); - sharpsl_pm.flags |= SHARPSL_DO_OFFLINE_CHRG; - } else { - /* charge off */ - dev_dbg(sharpsl_pm.dev, "ac remove\n"); - CHARGE_LED_OFF(); - CHARGE_OFF(); - sharpsl_pm.charge_mode = CHRG_OFF; - } - } - - if ((PEDR & GPIO_bit(CORGI_GPIO_CHRG_FULL))) - dev_dbg(sharpsl_pm.dev, "Charge full interrupt\n"); - - if (PEDR & GPIO_bit(CORGI_GPIO_KEY_INT)) - is_resume |= GPIO_bit(CORGI_GPIO_KEY_INT); - - if (PEDR & GPIO_bit(CORGI_GPIO_WAKEUP)) - is_resume |= GPIO_bit(CORGI_GPIO_WAKEUP); - - if (resume_on_alarm && (PEDR & PWER_RTC)) - is_resume |= PWER_RTC; - - dev_dbg(sharpsl_pm.dev, "is_resume: %x\n",is_resume); - return is_resume; -} - -static unsigned long corgi_charger_wakeup(void) -{ - return ~GPLR0 & ( GPIO_bit(CORGI_GPIO_AC_IN) | GPIO_bit(CORGI_GPIO_KEY_INT) | GPIO_bit(CORGI_GPIO_WAKEUP) ); -} - -static int corgi_acin_status(void) -{ - return ((GPLR(CORGI_GPIO_AC_IN) & GPIO_bit(CORGI_GPIO_AC_IN)) != 0); -} - -static struct sharpsl_charger_machinfo corgi_pm_machinfo = { - .init = corgi_charger_init, - .gpio_batlock = CORGI_GPIO_BAT_COVER, - .gpio_acin = CORGI_GPIO_AC_IN, - .gpio_batfull = CORGI_GPIO_CHRG_FULL, - .status_acin = corgi_acin_status, - .discharge = corgi_discharge, - .charge = corgi_charge, - .chargeled = corgi_charge_led, - .measure_temp = corgi_measure_temp, - .presuspend = corgi_presuspend, - .postsuspend = corgi_postsuspend, - .charger_wakeup = corgi_charger_wakeup, - .should_wakeup = corgi_should_wakeup, - .bat_levels = 40, - .bat_levels_noac = spitz_battery_levels_noac, - .bat_levels_acin = spitz_battery_levels_acin, - .status_high_acin = 188, - .status_low_acin = 178, - .status_high_noac = 185, - .status_low_noac = 175, -}; - -static struct platform_device *corgipm_device; - -static int __devinit corgipm_init(void) -{ - int ret; - - corgipm_device = platform_device_alloc("sharpsl-pm", -1); - if (!corgipm_device) - return -ENOMEM; - - corgipm_device->dev.platform_data = &corgi_pm_machinfo; - ret = platform_device_add(corgipm_device); - - if (ret) - platform_device_put(corgipm_device); - - return ret; -} - -static void corgipm_exit(void) -{ - platform_device_unregister(corgipm_device); -} - -module_init(corgipm_init); -module_exit(corgipm_exit); diff --git a/trunk/arch/arm/mach-pxa/mainstone.c b/trunk/arch/arm/mach-pxa/mainstone.c index 277498ae5b6c..07892f4012d8 100644 --- a/trunk/arch/arm/mach-pxa/mainstone.c +++ b/trunk/arch/arm/mach-pxa/mainstone.c @@ -43,7 +43,6 @@ #include #include #include -#include #include "generic.h" @@ -394,25 +393,6 @@ static struct platform_device *platform_devices[] __initdata = { &mst_flash_device[1], }; -static int mainstone_ohci_init(struct device *dev) -{ - /* setup Port1 GPIO pin. */ - pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */ - pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */ - - /* Set the Power Control Polarity Low and Power Sense - Polarity Low to active low. */ - UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) & - ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE); - - return 0; -} - -static struct pxaohci_platform_data mainstone_ohci_platform_data = { - .port_mode = PMM_PERPORT_MODE, - .init = mainstone_ohci_init, -}; - static void __init mainstone_init(void) { int SW7 = 0; /* FIXME: get from SCR (Mst doc section 3.2.1.1) */ @@ -444,7 +424,6 @@ static void __init mainstone_init(void) pxa_set_mci_info(&mainstone_mci_platform_data); pxa_set_ficp_info(&mainstone_ficp_platform_data); - pxa_set_ohci_info(&mainstone_ohci_platform_data); } diff --git a/trunk/arch/arm/mach-pxa/pm.c b/trunk/arch/arm/mach-pxa/pm.c index 852ea72d8c80..f74b9af112dc 100644 --- a/trunk/arch/arm/mach-pxa/pm.c +++ b/trunk/arch/arm/mach-pxa/pm.c @@ -155,20 +155,19 @@ int pxa_pm_enter(suspend_state_t state) PSPR = 0; /* restore registers */ - RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1); RESTORE_GPLEVEL(2); - RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2); RESTORE(GAFR0_L); RESTORE(GAFR0_U); RESTORE(GAFR1_L); RESTORE(GAFR1_U); RESTORE(GAFR2_L); RESTORE(GAFR2_U); + RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1); RESTORE_GPLEVEL(2); + RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2); RESTORE(GRER0); RESTORE(GRER1); RESTORE(GRER2); RESTORE(GFER0); RESTORE(GFER1); RESTORE(GFER2); RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2); #ifdef CONFIG_PXA27x RESTORE(MDREFR); - RESTORE_GPLEVEL(3); RESTORE(GPDR3); - RESTORE(GAFR3_L); RESTORE(GAFR3_U); - RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3); + RESTORE(GAFR3_L); RESTORE(GAFR3_U); RESTORE_GPLEVEL(3); + RESTORE(GPDR3); RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3); RESTORE(PWER); RESTORE(PCFR); RESTORE(PRER); RESTORE(PFER); RESTORE(PKWR); #endif diff --git a/trunk/arch/arm/mach-pxa/pxa27x.c b/trunk/arch/arm/mach-pxa/pxa27x.c index b41b1efaa2cf..c722a9a91fcc 100644 --- a/trunk/arch/arm/mach-pxa/pxa27x.c +++ b/trunk/arch/arm/mach-pxa/pxa27x.c @@ -21,7 +21,6 @@ #include #include #include -#include #include "generic.h" @@ -195,11 +194,6 @@ static struct platform_device ohci_device = { .resource = pxa27x_ohci_resources, }; -void __init pxa_set_ohci_info(struct pxaohci_platform_data *info) -{ - ohci_device.dev.platform_data = info; -} - static struct platform_device *devices[] __initdata = { &ohci_device, }; diff --git a/trunk/arch/arm/mach-pxa/sharpsl.h b/trunk/arch/arm/mach-pxa/sharpsl.h index b0c40a1d6671..4879c0f7da72 100644 --- a/trunk/arch/arm/mach-pxa/sharpsl.h +++ b/trunk/arch/arm/mach-pxa/sharpsl.h @@ -115,7 +115,7 @@ extern struct battery_thresh spitz_battery_levels_noac[]; #define CHARGE_LED_ERR() sharpsl_pm.machinfo->chargeled(SHARPSL_LED_ERROR) #define DISCHARGE_ON() sharpsl_pm.machinfo->discharge(1) #define DISCHARGE_OFF() sharpsl_pm.machinfo->discharge(0) -#define STATUS_AC_IN() sharpsl_pm.machinfo->status_acin() -#define STATUS_BATT_LOCKED() READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batlock) -#define STATUS_CHRG_FULL() READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batfull) -#define STATUS_FATAL() READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_fatal) +#define STATUS_AC_IN sharpsl_pm.machinfo->status_acin() +#define STATUS_BATT_LOCKED READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batlock) +#define STATUS_CHRG_FULL READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batfull) +#define STATUS_FATAL READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_fatal) diff --git a/trunk/arch/arm/mach-pxa/sharpsl_pm.c b/trunk/arch/arm/mach-pxa/sharpsl_pm.c index c10be00fb526..6c9e871c53d8 100644 --- a/trunk/arch/arm/mach-pxa/sharpsl_pm.c +++ b/trunk/arch/arm/mach-pxa/sharpsl_pm.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -45,15 +45,15 @@ #define SHARPSL_WAIT_DISCHARGE_ON 100 /* 100 msec */ #define SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP 10 /* 10 msec */ #define SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT 10 /* 10 msec */ -#define SHARPSL_CHECK_BATTERY_WAIT_TIME_ACIN 10 /* 10 msec */ +#define SHARPSL_CHECK_BATTERY_WAIT_TIME_JKVAD 10 /* 10 msec */ #define SHARPSL_CHARGE_WAIT_TIME 15 /* 15 msec */ #define SHARPSL_CHARGE_CO_CHECK_TIME 5 /* 5 msec */ #define SHARPSL_CHARGE_RETRY_CNT 1 /* eqv. 10 min */ #define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ #define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */ -#define SHARPSL_CHARGE_ON_ACIN_HIGH 0x9b /* 6V */ -#define SHARPSL_CHARGE_ON_ACIN_LOW 0x34 /* 2V */ +#define SHARPSL_CHARGE_ON_JKVAD_HIGH 0x9b /* 6V */ +#define SHARPSL_CHARGE_ON_JKVAD_LOW 0x34 /* 2V */ #define SHARPSL_FATAL_ACIN_VOLT 182 /* 3.45V */ #define SHARPSL_FATAL_NOACIN_VOLT 170 /* 3.40V */ @@ -160,10 +160,9 @@ struct battery_thresh spitz_battery_levels_noac[] = { /* * Prototypes */ -static int sharpsl_read_main_battery(void); +static int sharpsl_read_MainBattery(void); static int sharpsl_off_charge_battery(void); -static int sharpsl_check_battery_temp(void); -static int sharpsl_check_battery_voltage(void); +static int sharpsl_check_battery(int mode); static int sharpsl_ac_check(void); static int sharpsl_fatal_check(void); static int sharpsl_average_value(int ad); @@ -229,7 +228,7 @@ static void sharpsl_battery_thread(void *private_) if (!sharpsl_pm.machinfo) return; - sharpsl_pm.battstat.ac_status = (STATUS_AC_IN() ? APM_AC_ONLINE : APM_AC_OFFLINE); + sharpsl_pm.battstat.ac_status = (!(STATUS_AC_IN) ? APM_AC_OFFLINE : APM_AC_ONLINE); /* Corgi cannot confirm when battery fully charged so periodically kick! */ if (machine_is_corgi() && (sharpsl_pm.charge_mode == CHRG_ON) @@ -237,7 +236,7 @@ static void sharpsl_battery_thread(void *private_) schedule_work(&toggle_charger); while(1) { - voltage = sharpsl_read_main_battery(); + voltage = sharpsl_read_MainBattery(); if (voltage > 0) break; if (i++ > 5) { voltage = sharpsl_pm.machinfo->bat_levels_noac[0].voltage; @@ -318,10 +317,10 @@ static void sharpsl_charge_toggle(void *private_) { dev_dbg(sharpsl_pm.dev, "Toogling Charger at time: %lx\n", jiffies); - if (STATUS_AC_IN() == 0) { + if (STATUS_AC_IN == 0) { sharpsl_charge_off(); return; - } else if ((sharpsl_check_battery_temp() < 0) || (sharpsl_ac_check() < 0)) { + } else if ((sharpsl_check_battery(1) < 0) || (sharpsl_ac_check() < 0)) { sharpsl_charge_error(); return; } @@ -336,7 +335,7 @@ static void sharpsl_charge_toggle(void *private_) static void sharpsl_ac_timer(unsigned long data) { - int acin = STATUS_AC_IN(); + int acin = STATUS_AC_IN; dev_dbg(sharpsl_pm.dev, "AC Status: %d\n",acin); @@ -365,7 +364,7 @@ static void sharpsl_chrg_full_timer(unsigned long data) sharpsl_pm.full_count++; - if (STATUS_AC_IN() == 0) { + if (STATUS_AC_IN == 0) { dev_dbg(sharpsl_pm.dev, "Charge Full: AC removed - stop charging!\n"); if (sharpsl_pm.charge_mode == CHRG_ON) sharpsl_charge_off(); @@ -400,12 +399,12 @@ static irqreturn_t sharpsl_fatal_isr(int irq, void *dev_id, struct pt_regs *fp) { int is_fatal = 0; - if (STATUS_BATT_LOCKED() == 0) { + if (STATUS_BATT_LOCKED == 0) { dev_err(sharpsl_pm.dev, "Battery now Unlocked! Suspending.\n"); is_fatal = 1; } - if (sharpsl_pm.machinfo->gpio_fatal && (STATUS_FATAL() == 0)) { + if (sharpsl_pm.machinfo->gpio_fatal && (STATUS_FATAL == 0)) { dev_err(sharpsl_pm.dev, "Fatal Batt Error! Suspending.\n"); is_fatal = 1; } @@ -462,12 +461,12 @@ static int read_max1111(int channel) | MAXCTRL_SGL | MAXCTRL_UNI | MAXCTRL_STR); } -static int sharpsl_read_main_battery(void) +static int sharpsl_read_MainBattery(void) { return read_max1111(BATT_AD); } -static int sharpsl_read_temp(void) +static int sharpsl_read_Temp(void) { int temp; @@ -481,7 +480,7 @@ static int sharpsl_read_temp(void) return temp; } -static int sharpsl_read_acin(void) +static int sharpsl_read_jkvad(void) { return read_max1111(JK_VAD); } @@ -523,14 +522,16 @@ static int get_select_val(int *val) return (sum/3); } -static int sharpsl_check_battery_temp(void) +/* mode 0 - Check temperature and voltage + * 1 - Check temperature only */ +static int sharpsl_check_battery(int mode) { int val, i, buff[5]; /* Check battery temperature */ for (i=0; i<5; i++) { mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP); - buff[i] = sharpsl_read_temp(); + buff[i] = sharpsl_read_Temp(); } val = get_select_val(buff); @@ -538,13 +539,8 @@ static int sharpsl_check_battery_temp(void) dev_dbg(sharpsl_pm.dev, "Temperature: %d\n", val); if (val > SHARPSL_CHARGE_ON_TEMP) return -1; - - return 0; -} - -static int sharpsl_check_battery_voltage(void) -{ - int val, i, buff[5]; + if (mode == 1) + return 0; /* disable charge, enable discharge */ CHARGE_OFF(); @@ -556,7 +552,7 @@ static int sharpsl_check_battery_voltage(void) /* Check battery voltage */ for (i=0; i<5; i++) { - buff[i] = sharpsl_read_main_battery(); + buff[i] = sharpsl_read_MainBattery(); mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT); } @@ -579,14 +575,14 @@ static int sharpsl_ac_check(void) int temp, i, buff[5]; for (i=0; i<5; i++) { - buff[i] = sharpsl_read_acin(); - mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_ACIN); + buff[i] = sharpsl_read_jkvad(); + mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_JKVAD); } temp = get_select_val(buff); dev_dbg(sharpsl_pm.dev, "AC Voltage: %d\n",temp); - if ((temp > SHARPSL_CHARGE_ON_ACIN_HIGH) || (temp < SHARPSL_CHARGE_ON_ACIN_LOW)) { + if ((temp > SHARPSL_CHARGE_ON_JKVAD_HIGH) || (temp < SHARPSL_CHARGE_ON_JKVAD_LOW)) { dev_err(sharpsl_pm.dev, "Error: AC check failed.\n"); return -1; } @@ -595,7 +591,7 @@ static int sharpsl_ac_check(void) } #ifdef CONFIG_PM -static int sharpsl_pm_suspend(struct platform_device *pdev, pm_message_t state) +static int sharpsl_pm_suspend(struct device *dev, pm_message_t state) { sharpsl_pm.flags |= SHARPSL_SUSPENDED; flush_scheduled_work(); @@ -608,7 +604,7 @@ static int sharpsl_pm_suspend(struct platform_device *pdev, pm_message_t state) return 0; } -static int sharpsl_pm_resume(struct platform_device *pdev) +static int sharpsl_pm_resume(struct device *dev) { /* Clear the reset source indicators as they break the bootloader upon reboot */ RCSR = 0x0f; @@ -626,7 +622,7 @@ static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable dev_dbg(sharpsl_pm.dev, "Offline Charge Activate = %d\n",sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG); /* not charging and AC-IN! */ - if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (STATUS_AC_IN() != 0)) { + if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (STATUS_AC_IN != 0)) { dev_dbg(sharpsl_pm.dev, "Activating Offline Charger...\n"); sharpsl_pm.charge_mode = CHRG_OFF; sharpsl_pm.flags &= ~SHARPSL_DO_OFFLINE_CHRG; @@ -675,7 +671,7 @@ static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enab dev_dbg(sharpsl_pm.dev, "User triggered wakeup in offline charger.\n"); } - if ((STATUS_BATT_LOCKED() == 0) || (sharpsl_fatal_check() < 0) ) + if ((STATUS_BATT_LOCKED == 0) || (sharpsl_fatal_check() < 0) ) { dev_err(sharpsl_pm.dev, "Fatal condition. Suspend.\n"); corgi_goto_sleep(alarm_time, alarm_enable, state); @@ -715,7 +711,7 @@ static int sharpsl_fatal_check(void) dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check entered\n"); /* Check AC-Adapter */ - acin = STATUS_AC_IN(); + acin = STATUS_AC_IN; if (acin && (sharpsl_pm.charge_mode == CHRG_ON)) { CHARGE_OFF(); @@ -729,7 +725,7 @@ static int sharpsl_fatal_check(void) /* Check battery : check inserting battery ? */ for (i=0; i<5; i++) { - buff[i] = sharpsl_read_main_battery(); + buff[i] = sharpsl_read_MainBattery(); mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT); } @@ -743,7 +739,7 @@ static int sharpsl_fatal_check(void) } temp = get_select_val(buff); - dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %d\n", acin, temp, sharpsl_read_main_battery()); + dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %d\n", acin, temp, sharpsl_read_MainBattery()); if ((acin && (temp < SHARPSL_FATAL_ACIN_VOLT)) || (!acin && (temp < SHARPSL_FATAL_NOACIN_VOLT))) @@ -775,7 +771,7 @@ static int sharpsl_off_charge_battery(void) dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 1\n"); /* AC Check */ - if ((sharpsl_ac_check() < 0) || (sharpsl_check_battery_temp() < 0)) + if ((sharpsl_ac_check() < 0) || (sharpsl_check_battery(1) < 0)) return sharpsl_off_charge_error(); /* Start Charging */ @@ -797,7 +793,7 @@ static int sharpsl_off_charge_battery(void) dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 2\n"); - if ((sharpsl_check_battery_temp() < 0) || (sharpsl_check_battery_voltage() < 0)) + if (sharpsl_check_battery(0) < 0) return sharpsl_off_charge_error(); CHARGE_OFF(); @@ -815,7 +811,7 @@ static int sharpsl_off_charge_battery(void) /* Check for timeout */ if ((RCNR - time) > SHARPSL_WAIT_CO_TIME) return 1; - if (STATUS_CHRG_FULL()) { + if (STATUS_CHRG_FULL) { dev_dbg(sharpsl_pm.dev, "Offline Charger: Charge full occured. Retrying to check\n"); sharpsl_pm.full_count++; CHARGE_OFF(); @@ -844,7 +840,7 @@ static int sharpsl_off_charge_battery(void) sharpsl_pm.full_count++; return 1; } - if (STATUS_CHRG_FULL()) { + if (STATUS_CHRG_FULL) { dev_dbg(sharpsl_pm.dev, "Offline Charger: Charging complete.\n"); CHARGE_LED_OFF(); CHARGE_OFF(); @@ -890,13 +886,13 @@ static struct pm_ops sharpsl_pm_ops = { .finish = pxa_pm_finish, }; -static int __init sharpsl_pm_probe(struct platform_device *pdev) +static int __init sharpsl_pm_probe(struct device *dev) { - if (!pdev->dev.platform_data) + if (!dev->platform_data) return -EINVAL; - sharpsl_pm.dev = &pdev->dev; - sharpsl_pm.machinfo = pdev->dev.platform_data; + sharpsl_pm.dev = dev; + sharpsl_pm.machinfo = dev->platform_data; sharpsl_pm.charge_mode = CHRG_OFF; sharpsl_pm.flags = 0; @@ -939,8 +935,8 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev) else set_irq_type(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull),IRQT_RISING); } - device_create_file(&pdev->dev, &dev_attr_battery_percentage); - device_create_file(&pdev->dev, &dev_attr_battery_voltage); + device_create_file(dev, &dev_attr_battery_percentage); + device_create_file(dev, &dev_attr_battery_voltage); apm_get_power_status = sharpsl_apm_get_power_status; @@ -951,12 +947,12 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev) return 0; } -static int sharpsl_pm_remove(struct platform_device *pdev) +static int sharpsl_pm_remove(struct device *dev) { pm_set_ops(NULL); - device_remove_file(&pdev->dev, &dev_attr_battery_percentage); - device_remove_file(&pdev->dev, &dev_attr_battery_voltage); + device_remove_file(dev, &dev_attr_battery_percentage); + device_remove_file(dev, &dev_attr_battery_voltage); free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr); free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr); @@ -973,24 +969,23 @@ static int sharpsl_pm_remove(struct platform_device *pdev) return 0; } -static struct platform_driver sharpsl_pm_driver = { +static struct device_driver sharpsl_pm_driver = { + .name = "sharpsl-pm", + .bus = &platform_bus_type, .probe = sharpsl_pm_probe, .remove = sharpsl_pm_remove, .suspend = sharpsl_pm_suspend, .resume = sharpsl_pm_resume, - .driver = { - .name = "sharpsl-pm", - }, }; static int __devinit sharpsl_pm_init(void) { - return platform_driver_register(&sharpsl_pm_driver); + return driver_register(&sharpsl_pm_driver); } static void sharpsl_pm_exit(void) { - platform_driver_unregister(&sharpsl_pm_driver); + driver_unregister(&sharpsl_pm_driver); } late_initcall(sharpsl_pm_init); diff --git a/trunk/arch/arm/mach-pxa/spitz.c b/trunk/arch/arm/mach-pxa/spitz.c index 2df1b56615b1..4e9a699ee428 100644 --- a/trunk/arch/arm/mach-pxa/spitz.c +++ b/trunk/arch/arm/mach-pxa/spitz.c @@ -345,16 +345,6 @@ static void spitz_irda_transceiver_mode(struct device *dev, int mode) reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON); } -#ifdef CONFIG_MACH_AKITA -static void akita_irda_transceiver_mode(struct device *dev, int mode) -{ - if (mode & IR_OFF) - akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON); - else - akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON); -} -#endif - static struct pxaficp_platform_data spitz_ficp_platform_data = { .transceiver_cap = IR_SIRMODE | IR_OFF, .transceiver_mode = spitz_irda_transceiver_mode, @@ -427,32 +417,6 @@ static void __init spitz_init(void) platform_device_register(&spitzscoop2_device); } -#ifdef CONFIG_MACH_AKITA -/* - * Akita IO Expander - */ -struct platform_device akitaioexp_device = { - .name = "akita-ioexp", - .id = -1, -}; - -static void __init akita_init(void) -{ - spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; - - /* We just pretend the second element of the array doesn't exist */ - spitz_pcmcia_config.num_devs = 1; - platform_scoop_config = &spitz_pcmcia_config; - spitz_bl_machinfo.set_bl_intensity = akita_bl_set_intensity; - - platform_device_register(&akitaioexp_device); - - spitzscoop_device.dev.parent = &akitaioexp_device.dev; - common_init(); -} -#endif - - static void __init fixup_spitz(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { @@ -488,16 +452,3 @@ MACHINE_START(BORZOI, "SHARP Borzoi") .timer = &pxa_timer, MACHINE_END #endif - -#ifdef CONFIG_MACH_AKITA -MACHINE_START(AKITA, "SHARP Akita") - .phys_ram = 0xa0000000, - .phys_io = 0x40000000, - .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, - .fixup = fixup_spitz, - .map_io = pxa_map_io, - .init_irq = pxa_init_irq, - .init_machine = akita_init, - .timer = &pxa_timer, -MACHINE_END -#endif diff --git a/trunk/arch/arm/mach-pxa/spitz_pm.c b/trunk/arch/arm/mach-pxa/spitz_pm.c deleted file mode 100644 index 3ce7486daa51..000000000000 --- a/trunk/arch/arm/mach-pxa/spitz_pm.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Battery and Power Management code for the Sharp SL-Cxx00 - * - * Copyright (c) 2005 Richard Purdie - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include "sharpsl.h" - -static int spitz_last_ac_status; - -static void spitz_charger_init(void) -{ - pxa_gpio_mode(SPITZ_GPIO_KEY_INT | GPIO_IN); - pxa_gpio_mode(SPITZ_GPIO_SYNC | GPIO_IN); -} - -static void spitz_charge_led(int val) -{ - if (val == SHARPSL_LED_ERROR) { - dev_dbg(sharpsl_pm.dev, "Charge LED Error\n"); - } else if (val == SHARPSL_LED_ON) { - dev_dbg(sharpsl_pm.dev, "Charge LED On\n"); - set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_ORANGE); - } else { - dev_dbg(sharpsl_pm.dev, "Charge LED Off\n"); - reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_ORANGE); - } -} - -static void spitz_measure_temp(int on) -{ - if (on) - set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_ADC_TEMP_ON); - else - reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_ADC_TEMP_ON); -} - -static void spitz_charge(int on) -{ - if (on) { - if (sharpsl_pm.flags & SHARPSL_SUSPENDED) { - set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_JK_B); - reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CHRG_ON); - } else { - reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_JK_B); - reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CHRG_ON); - } - } else { - reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_JK_B); - set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CHRG_ON); - } -} - -static void spitz_discharge(int on) -{ - if (on) - set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_JK_A); - else - reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_JK_A); -} - -/* HACK - For unknown reasons, accurate voltage readings are only made with a load - on the power bus which the green led on spitz provides */ -static void spitz_discharge1(int on) -{ - if (on) - set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_GREEN); - else - reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_GREEN); -} - -static void spitz_presuspend(void) -{ - spitz_last_ac_status = STATUS_AC_IN(); - - /* GPIO Sleep Register */ - PGSR0 = 0x00144018; - PGSR1 = 0x00EF0000; - if (machine_is_akita()) { - PGSR2 = 0x2121C000; - PGSR3 = 0x00600400; - } else { - PGSR2 = 0x0121C000; - PGSR3 = 0x00600000; - } - - PGSR0 &= ~SPITZ_GPIO_G0_STROBE_BIT; - PGSR1 &= ~SPITZ_GPIO_G1_STROBE_BIT; - PGSR2 &= ~SPITZ_GPIO_G2_STROBE_BIT; - PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; - PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); - - pxa_gpio_mode(GPIO18_RDY|GPIO_OUT | GPIO_DFLT_HIGH); - - PRER = GPIO_bit(SPITZ_GPIO_KEY_INT); - PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); - PWER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET) | PWER_RTC; - PKWR = GPIO_bit(SPITZ_GPIO_SYNC) | GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); - PKSR = 0xffffffff; // clear - - /* nRESET_OUT Disable */ - PSLR |= PSLR_SL_ROD; - - /* Clear reset status */ - RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR; - - /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ - PCFR = PCFR_GPR_EN | PCFR_OPDE; -} - -static void spitz_postsuspend(void) -{ - pxa_gpio_mode(GPIO18_RDY_MD); - pxa_gpio_mode(10 | GPIO_IN); -} - -static int spitz_should_wakeup(unsigned int resume_on_alarm) -{ - int is_resume = 0; - int acin = STATUS_AC_IN(); - - if (spitz_last_ac_status != acin) { - if (acin) { - /* charge on */ - sharpsl_pm.flags |= SHARPSL_DO_OFFLINE_CHRG; - dev_dbg(sharpsl_pm.dev, "AC Inserted\n"); - } else { - /* charge off */ - dev_dbg(sharpsl_pm.dev, "AC Removed\n"); - CHARGE_LED_OFF(); - CHARGE_OFF(); - sharpsl_pm.charge_mode = CHRG_OFF; - } - spitz_last_ac_status = acin; - /* Return to suspend as this must be what we were woken for */ - return 0; - } - - if (PEDR & GPIO_bit(SPITZ_GPIO_KEY_INT)) - is_resume |= GPIO_bit(SPITZ_GPIO_KEY_INT); - - if (PKSR & GPIO_bit(SPITZ_GPIO_SYNC)) - is_resume |= GPIO_bit(SPITZ_GPIO_SYNC); - - if (resume_on_alarm && (PEDR & PWER_RTC)) - is_resume |= PWER_RTC; - - dev_dbg(sharpsl_pm.dev, "is_resume: %x\n",is_resume); - return is_resume; -} - -static unsigned long spitz_charger_wakeup(void) -{ - return (~GPLR0 & GPIO_bit(SPITZ_GPIO_KEY_INT)) | (GPLR0 & GPIO_bit(SPITZ_GPIO_SYNC)); -} - -static int spitz_acin_status(void) -{ - return (((~GPLR(SPITZ_GPIO_AC_IN)) & GPIO_bit(SPITZ_GPIO_AC_IN)) != 0); -} - -struct sharpsl_charger_machinfo spitz_pm_machinfo = { - .init = spitz_charger_init, - .gpio_batlock = SPITZ_GPIO_BAT_COVER, - .gpio_acin = SPITZ_GPIO_AC_IN, - .gpio_batfull = SPITZ_GPIO_CHRG_FULL, - .gpio_fatal = SPITZ_GPIO_FATAL_BAT, - .status_acin = spitz_acin_status, - .discharge = spitz_discharge, - .discharge1 = spitz_discharge1, - .charge = spitz_charge, - .chargeled = spitz_charge_led, - .measure_temp = spitz_measure_temp, - .presuspend = spitz_presuspend, - .postsuspend = spitz_postsuspend, - .charger_wakeup = spitz_charger_wakeup, - .should_wakeup = spitz_should_wakeup, - .bat_levels = 40, - .bat_levels_noac = spitz_battery_levels_noac, - .bat_levels_acin = spitz_battery_levels_acin, - .status_high_acin = 188, - .status_low_acin = 178, - .status_high_noac = 185, - .status_low_noac = 175, -}; - -static struct platform_device *spitzpm_device; - -static int __devinit spitzpm_init(void) -{ - int ret; - - spitzpm_device = platform_device_alloc("sharpsl-pm", -1); - if (!spitzpm_device) - return -ENOMEM; - - spitzpm_device->dev.platform_data = &spitz_pm_machinfo; - ret = platform_device_add(spitzpm_device); - - if (ret) - platform_device_put(spitzpm_device); - - return ret; -} - -static void spitzpm_exit(void) -{ - platform_device_unregister(spitzpm_device); -} - -module_init(spitzpm_init); -module_exit(spitzpm_exit); diff --git a/trunk/arch/arm/mach-pxa/tosa.c b/trunk/arch/arm/mach-pxa/tosa.c index e4f92efc616e..c312054dfb88 100644 --- a/trunk/arch/arm/mach-pxa/tosa.c +++ b/trunk/arch/arm/mach-pxa/tosa.c @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include diff --git a/trunk/arch/arm/mach-realview/core.c b/trunk/arch/arm/mach-realview/core.c index af6580f1ceb8..e2c6fa23d3cd 100644 --- a/trunk/arch/arm/mach-realview/core.c +++ b/trunk/arch/arm/mach-realview/core.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/arm/mach-realview/core.h b/trunk/arch/arm/mach-realview/core.h index c06e6041df41..d83e8bad2038 100644 --- a/trunk/arch/arm/mach-realview/core.h +++ b/trunk/arch/arm/mach-realview/core.h @@ -26,6 +26,8 @@ #include #include +#define __io_address(n) __io(IO_ADDRESS(n)) + extern struct sys_timer realview_timer; #define AMBA_DEVICE(name,busid,base,plat) \ diff --git a/trunk/arch/arm/mach-realview/localtimer.c b/trunk/arch/arm/mach-realview/localtimer.c index c9d7c596b200..5e917e37d095 100644 --- a/trunk/arch/arm/mach-realview/localtimer.c +++ b/trunk/arch/arm/mach-realview/localtimer.c @@ -21,6 +21,8 @@ #include #include +#include "core.h" + #define TWD_BASE(cpu) (__io_address(REALVIEW_TWD_BASE) + \ ((cpu) * REALVIEW_TWD_SIZE)) diff --git a/trunk/arch/arm/mach-realview/platsmp.c b/trunk/arch/arm/mach-realview/platsmp.c index a8fbd76d8be5..0c7d4ac9a7b3 100644 --- a/trunk/arch/arm/mach-realview/platsmp.c +++ b/trunk/arch/arm/mach-realview/platsmp.c @@ -17,7 +17,8 @@ #include #include #include -#include + +#include "core.h" extern void realview_secondary_startup(void); diff --git a/trunk/arch/arm/mach-s3c2410/mach-bast.c b/trunk/arch/arm/mach-s3c2410/mach-bast.c index 4d962717fdf7..1be2567a7486 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-bast.c +++ b/trunk/arch/arm/mach-s3c2410/mach-bast.c @@ -203,7 +203,7 @@ static struct s3c24xx_uart_clksrc bast_serial_clocks[] = { .name = "pclk", .divisor = 1, .min_baud = 0, - .max_baud = 0, + .max_baud = 0. } }; @@ -216,7 +216,7 @@ static struct s3c2410_uartcfg bast_uartcfgs[] = { .ulcon = ULCON, .ufcon = UFCON, .clocks = bast_serial_clocks, - .clocks_size = ARRAY_SIZE(bast_serial_clocks), + .clocks_size = ARRAY_SIZE(bast_serial_clocks) }, [1] = { .hwport = 1, @@ -225,7 +225,7 @@ static struct s3c2410_uartcfg bast_uartcfgs[] = { .ulcon = ULCON, .ufcon = UFCON, .clocks = bast_serial_clocks, - .clocks_size = ARRAY_SIZE(bast_serial_clocks), + .clocks_size = ARRAY_SIZE(bast_serial_clocks) }, /* port 2 is not actually used */ [2] = { @@ -235,7 +235,7 @@ static struct s3c2410_uartcfg bast_uartcfgs[] = { .ulcon = ULCON, .ufcon = UFCON, .clocks = bast_serial_clocks, - .clocks_size = ARRAY_SIZE(bast_serial_clocks), + .clocks_size = ARRAY_SIZE(bast_serial_clocks) } }; @@ -268,7 +268,7 @@ static struct mtd_partition bast_default_nand_part[] = { [0] = { .name = "Boot Agent", .size = SZ_16K, - .offset = 0, + .offset = 0 }, [1] = { .name = "/boot", @@ -296,28 +296,28 @@ static struct s3c2410_nand_set bast_nand_sets[] = { .nr_chips = 1, .nr_map = smartmedia_map, .nr_partitions = ARRAY_SIZE(bast_default_nand_part), - .partitions = bast_default_nand_part, + .partitions = bast_default_nand_part }, [1] = { .name = "chip0", .nr_chips = 1, .nr_map = chip0_map, .nr_partitions = ARRAY_SIZE(bast_default_nand_part), - .partitions = bast_default_nand_part, + .partitions = bast_default_nand_part }, [2] = { .name = "chip1", .nr_chips = 1, .nr_map = chip1_map, .nr_partitions = ARRAY_SIZE(bast_default_nand_part), - .partitions = bast_default_nand_part, + .partitions = bast_default_nand_part }, [3] = { .name = "chip2", .nr_chips = 1, .nr_map = chip2_map, .nr_partitions = ARRAY_SIZE(bast_default_nand_part), - .partitions = bast_default_nand_part, + .partitions = bast_default_nand_part } }; @@ -355,17 +355,17 @@ static struct resource bast_dm9k_resource[] = { [0] = { .start = S3C2410_CS5 + BAST_PA_DM9000, .end = S3C2410_CS5 + BAST_PA_DM9000 + 3, - .flags = IORESOURCE_MEM, + .flags = IORESOURCE_MEM }, [1] = { .start = S3C2410_CS5 + BAST_PA_DM9000 + 0x40, .end = S3C2410_CS5 + BAST_PA_DM9000 + 0x40 + 0x3f, - .flags = IORESOURCE_MEM, + .flags = IORESOURCE_MEM }, [2] = { .start = IRQ_DM9000, .end = IRQ_DM9000, - .flags = IORESOURCE_IRQ, + .flags = IORESOURCE_IRQ } }; @@ -375,7 +375,7 @@ static struct resource bast_dm9k_resource[] = { */ static struct dm9000_plat_data bast_dm9k_platdata = { - .flags = DM9000_PLATF_16BITONLY, + .flags = DM9000_PLATF_16BITONLY }; static struct platform_device bast_device_dm9k = { @@ -492,7 +492,7 @@ static struct s3c24xx_board bast_board __initdata = { .devices = bast_devices, .devices_count = ARRAY_SIZE(bast_devices), .clocks = bast_clocks, - .clocks_count = ARRAY_SIZE(bast_clocks), + .clocks_count = ARRAY_SIZE(bast_clocks) }; static void __init bast_map_io(void) diff --git a/trunk/arch/arm/mach-sa1100/assabet.c b/trunk/arch/arm/mach-sa1100/assabet.c index a66ac61233a2..75efb5da5b6d 100644 --- a/trunk/arch/arm/mach-sa1100/assabet.c +++ b/trunk/arch/arm/mach-sa1100/assabet.c @@ -293,8 +293,7 @@ static void __init get_assabet_scr(void) GPDR |= 0x3fc; /* Configure GPIO 9:2 as outputs */ GPSR = 0x3fc; /* Write 0xFF to GPIO 9:2 */ GPDR &= ~(0x3fc); /* Configure GPIO 9:2 as inputs */ - for(i = 100; i--; ) /* Read GPIO 9:2 */ - scr = GPLR; + for(i = 100; i--; scr = GPLR); /* Read GPIO 9:2 */ GPDR |= 0x3fc; /* restore correct pin direction */ scr &= 0x3fc; /* save as system configuration byte. */ SCR_value = scr; diff --git a/trunk/arch/arm/mm/Makefile b/trunk/arch/arm/mm/Makefile index ffe73ba2bf17..59f47d4c2dfe 100644 --- a/trunk/arch/arm/mm/Makefile +++ b/trunk/arch/arm/mm/Makefile @@ -51,4 +51,4 @@ obj-$(CONFIG_CPU_ARM1026) += proc-arm1026.o obj-$(CONFIG_CPU_SA110) += proc-sa110.o obj-$(CONFIG_CPU_SA1100) += proc-sa1100.o obj-$(CONFIG_CPU_XSCALE) += proc-xscale.o -obj-$(CONFIG_CPU_V6) += proc-v6.o +obj-$(CONFIG_CPU_V6) += proc-v6.o blockops.o diff --git a/trunk/arch/arm/mm/blockops.c b/trunk/arch/arm/mm/blockops.c new file mode 100644 index 000000000000..4f5ee2d08996 --- /dev/null +++ b/trunk/arch/arm/mm/blockops.c @@ -0,0 +1,185 @@ +#include +#include +#include +#include + +#include +#include +#include +#include + +extern struct cpu_cache_fns blk_cache_fns; + +#define HARVARD_CACHE + +/* + * blk_flush_kern_dcache_page(kaddr) + * + * Ensure that the data held in the page kaddr is written back + * to the page in question. + * + * - kaddr - kernel address (guaranteed to be page aligned) + */ +static void __attribute__((naked)) +blk_flush_kern_dcache_page(void *kaddr) +{ + asm( + "add r1, r0, %0 \n\ + sub r1, r1, %1 \n\ +1: .word 0xec401f0e @ mcrr p15, 0, r0, r1, c14, 0 @ blocking \n\ + mov r0, #0 \n\ + mcr p15, 0, r0, c7, c5, 0 \n\ + mcr p15, 0, r0, c7, c10, 4 \n\ + mov pc, lr" + : + : "I" (PAGE_SIZE), "I" (L1_CACHE_BYTES)); +} + +/* + * blk_dma_inv_range(start,end) + * + * Invalidate the data cache within the specified region; we will + * be performing a DMA operation in this region and we want to + * purge old data in the cache. + * + * - start - virtual start address of region + * - end - virtual end address of region + */ +static void __attribute__((naked)) +blk_dma_inv_range_unified(unsigned long start, unsigned long end) +{ + asm( + "tst r0, %0 \n\ + mcrne p15, 0, r0, c7, c11, 1 @ clean unified line \n\ + tst r1, %0 \n\ + mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line\n\ + .word 0xec401f06 @ mcrr p15, 0, r1, r0, c6, 0 @ blocking \n\ + mov r0, #0 \n\ + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer \n\ + mov pc, lr" + : + : "I" (L1_CACHE_BYTES - 1)); +} + +static void __attribute__((naked)) +blk_dma_inv_range_harvard(unsigned long start, unsigned long end) +{ + asm( + "tst r0, %0 \n\ + mcrne p15, 0, r0, c7, c10, 1 @ clean D line \n\ + tst r1, %0 \n\ + mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D line \n\ + .word 0xec401f06 @ mcrr p15, 0, r1, r0, c6, 0 @ blocking \n\ + mov r0, #0 \n\ + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer \n\ + mov pc, lr" + : + : "I" (L1_CACHE_BYTES - 1)); +} + +/* + * blk_dma_clean_range(start,end) + * - start - virtual start address of region + * - end - virtual end address of region + */ +static void __attribute__((naked)) +blk_dma_clean_range(unsigned long start, unsigned long end) +{ + asm( + ".word 0xec401f0c @ mcrr p15, 0, r1, r0, c12, 0 @ blocking \n\ + mov r0, #0 \n\ + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer \n\ + mov pc, lr"); +} + +/* + * blk_dma_flush_range(start,end) + * - start - virtual start address of region + * - end - virtual end address of region + */ +static void __attribute__((naked)) +blk_dma_flush_range(unsigned long start, unsigned long end) +{ + asm( + ".word 0xec401f0e @ mcrr p15, 0, r1, r0, c14, 0 @ blocking \n\ + mov pc, lr"); +} + +static int blockops_trap(struct pt_regs *regs, unsigned int instr) +{ + regs->ARM_r4 |= regs->ARM_r2; + regs->ARM_pc += 4; + return 0; +} + +static char *func[] = { + "Prefetch data range", + "Clean+Invalidate data range", + "Clean data range", + "Invalidate data range", + "Invalidate instr range" +}; + +static struct undef_hook blockops_hook __initdata = { + .instr_mask = 0x0fffffd0, + .instr_val = 0x0c401f00, + .cpsr_mask = PSR_T_BIT, + .cpsr_val = 0, + .fn = blockops_trap, +}; + +static int __init blockops_check(void) +{ + register unsigned int err asm("r4") = 0; + unsigned int err_pos = 1; + unsigned int cache_type; + int i; + + asm("mrc p15, 0, %0, c0, c0, 1" : "=r" (cache_type)); + + printk("Checking V6 block cache operations:\n"); + register_undef_hook(&blockops_hook); + + __asm__ ("mov r0, %0\n\t" + "mov r1, %1\n\t" + "mov r2, #1\n\t" + ".word 0xec401f2c @ mcrr p15, 0, r1, r0, c12, 2\n\t" + "mov r2, #2\n\t" + ".word 0xec401f0e @ mcrr p15, 0, r1, r0, c14, 0\n\t" + "mov r2, #4\n\t" + ".word 0xec401f0c @ mcrr p15, 0, r1, r0, c12, 0\n\t" + "mov r2, #8\n\t" + ".word 0xec401f06 @ mcrr p15, 0, r1, r0, c6, 0\n\t" + "mov r2, #16\n\t" + ".word 0xec401f05 @ mcrr p15, 0, r1, r0, c5, 0\n\t" + : + : "r" (PAGE_OFFSET), "r" (PAGE_OFFSET + 128) + : "r0", "r1", "r2"); + + unregister_undef_hook(&blockops_hook); + + for (i = 0; i < ARRAY_SIZE(func); i++, err_pos <<= 1) + printk("%30s: %ssupported\n", func[i], err & err_pos ? "not " : ""); + + if ((err & 8) == 0) { + printk(" --> Using %s block cache invalidate\n", + cache_type & (1 << 24) ? "harvard" : "unified"); + if (cache_type & (1 << 24)) + cpu_cache.dma_inv_range = blk_dma_inv_range_harvard; + else + cpu_cache.dma_inv_range = blk_dma_inv_range_unified; + } + if ((err & 4) == 0) { + printk(" --> Using block cache clean\n"); + cpu_cache.dma_clean_range = blk_dma_clean_range; + } + if ((err & 2) == 0) { + printk(" --> Using block cache clean+invalidate\n"); + cpu_cache.dma_flush_range = blk_dma_flush_range; + cpu_cache.flush_kern_dcache_page = blk_flush_kern_dcache_page; + } + + return 0; +} + +__initcall(blockops_check); diff --git a/trunk/arch/arm/mm/consistent.c b/trunk/arch/arm/mm/consistent.c index dbfe9e891f01..47b0b767f080 100644 --- a/trunk/arch/arm/mm/consistent.c +++ b/trunk/arch/arm/mm/consistent.c @@ -66,7 +66,6 @@ struct vm_region { unsigned long vm_start; unsigned long vm_end; struct page *vm_pages; - int vm_active; }; static struct vm_region consistent_head = { @@ -105,7 +104,6 @@ vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp) list_add_tail(&new->vm_list, &c->vm_list); new->vm_start = addr; new->vm_end = addr + size; - new->vm_active = 1; spin_unlock_irqrestore(&consistent_lock, flags); return new; @@ -122,7 +120,7 @@ static struct vm_region *vm_region_find(struct vm_region *head, unsigned long ad struct vm_region *c; list_for_each_entry(c, &head->vm_list, vm_list) { - if (c->vm_active && c->vm_start == addr) + if (c->vm_start == addr) goto out; } c = NULL; @@ -321,7 +319,6 @@ EXPORT_SYMBOL(dma_mmap_writecombine); /* * free a page as defined by the above mapping. - * Must not be called with IRQs disabled. */ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle) { @@ -329,18 +326,14 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr unsigned long flags, addr; pte_t *ptep; - WARN_ON(irqs_disabled()); - size = PAGE_ALIGN(size); spin_lock_irqsave(&consistent_lock, flags); + c = vm_region_find(&consistent_head, (unsigned long)cpu_addr); if (!c) goto no_area; - c->vm_active = 0; - spin_unlock_irqrestore(&consistent_lock, flags); - if ((c->vm_end - c->vm_start) != size) { printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n", __func__, c->vm_end - c->vm_start, size); @@ -379,8 +372,8 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr flush_tlb_kernel_range(c->vm_start, c->vm_end); - spin_lock_irqsave(&consistent_lock, flags); list_del(&c->vm_list); + spin_unlock_irqrestore(&consistent_lock, flags); kfree(c); diff --git a/trunk/arch/arm/mm/flush.c b/trunk/arch/arm/mm/flush.c index 330695b6b19d..c9a03981b785 100644 --- a/trunk/arch/arm/mm/flush.c +++ b/trunk/arch/arm/mm/flush.c @@ -155,19 +155,14 @@ static void __flush_dcache_aliases(struct address_space *mapping, struct page *p * space mappings, we can be lazy and remember that we may have dirty * kernel cache lines for later. Otherwise, we assume we have * aliasing mappings. - * - * Note that we disable the lazy flush for SMP. */ void flush_dcache_page(struct page *page) { struct address_space *mapping = page_mapping(page); -#ifndef CONFIG_SMP if (mapping && !mapping_mapped(mapping)) set_bit(PG_dcache_dirty, &page->flags); - else -#endif - { + else { __flush_dcache_page(mapping, page); if (mapping && cache_is_vivt()) __flush_dcache_aliases(mapping, page); diff --git a/trunk/arch/arm/mm/init.c b/trunk/arch/arm/mm/init.c index 8b276ee38acf..c168f322ef8c 100644 --- a/trunk/arch/arm/mm/init.c +++ b/trunk/arch/arm/mm/init.c @@ -420,8 +420,7 @@ static void __init bootmem_init(struct meminfo *mi) * Set up device the mappings. Since we clear out the page tables for all * mappings above VMALLOC_END, we will remove any debug device mappings. * This means you have to be careful how you debug this function, or any - * called function. This means you can't use any function or debugging - * method which may touch any device, otherwise the kernel _will_ crash. + * called function. (Do it by code inspection!) */ static void __init devicemaps_init(struct machine_desc *mdesc) { @@ -429,12 +428,6 @@ static void __init devicemaps_init(struct machine_desc *mdesc) unsigned long addr; void *vectors; - /* - * Allocate the vector page early. - */ - vectors = alloc_bootmem_low_pages(PAGE_SIZE); - BUG_ON(!vectors); - for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE) pmd_clear(pmd_off_k(addr)); @@ -468,6 +461,12 @@ static void __init devicemaps_init(struct machine_desc *mdesc) create_mapping(&map); #endif + flush_cache_all(); + local_flush_tlb_all(); + + vectors = alloc_bootmem_low_pages(PAGE_SIZE); + BUG_ON(!vectors); + /* * Create a mapping for the machine vectors at the high-vectors * location (0xffff0000). If we aren't using high-vectors, also @@ -492,13 +491,12 @@ static void __init devicemaps_init(struct machine_desc *mdesc) mdesc->map_io(); /* - * Finally flush the caches and tlb to ensure that we're in a - * consistent state wrt the writebuffer. This also ensures that - * any write-allocated cache lines in the vector page are written - * back. After this point, we can start to touch devices again. + * Finally flush the tlb again - this ensures that we're in a + * consistent state wrt the writebuffer if the writebuffer needs + * draining. After this point, we can start to touch devices + * again. */ local_flush_tlb_all(); - flush_cache_all(); } /* diff --git a/trunk/arch/arm/mm/ioremap.c b/trunk/arch/arm/mm/ioremap.c index 10901398e4a2..0f128c28fee4 100644 --- a/trunk/arch/arm/mm/ioremap.c +++ b/trunk/arch/arm/mm/ioremap.c @@ -130,7 +130,8 @@ remap_area_pages(unsigned long start, unsigned long phys_addr, * mapping. See include/asm-arm/proc-armv/pgtable.h for more information. */ void __iomem * -__ioremap(unsigned long phys_addr, size_t size, unsigned long flags) +__ioremap(unsigned long phys_addr, size_t size, unsigned long flags, + unsigned long align) { void * addr; struct vm_struct * area; diff --git a/trunk/arch/arm/plat-omap/dmtimer.c b/trunk/arch/arm/plat-omap/dmtimer.c index 38d7ebf87920..a1468d7326eb 100644 --- a/trunk/arch/arm/plat-omap/dmtimer.c +++ b/trunk/arch/arm/plat-omap/dmtimer.c @@ -26,7 +26,7 @@ */ #include -#include +#include #include #include #include diff --git a/trunk/arch/arm/plat-omap/ocpi.c b/trunk/arch/arm/plat-omap/ocpi.c index b86148227480..2ede2ee8cae4 100644 --- a/trunk/arch/arm/plat-omap/ocpi.c +++ b/trunk/arch/arm/plat-omap/ocpi.c @@ -34,7 +34,7 @@ #include #include -#include +#include #define OCPI_BASE 0xfffec320 #define OCPI_FAULT (OCPI_BASE + 0x00) diff --git a/trunk/arch/arm/plat-omap/pm.c b/trunk/arch/arm/plat-omap/pm.c index 1a24e2c10714..966cca031ca7 100644 --- a/trunk/arch/arm/plat-omap/pm.c +++ b/trunk/arch/arm/plat-omap/pm.c @@ -509,7 +509,7 @@ static void omap_pm_init_proc(void) * @state: suspend state we're entering. * */ -//#include +//#include static int omap_pm_prepare(suspend_state_t state) { diff --git a/trunk/arch/arm/plat-omap/sram-fn.S b/trunk/arch/arm/plat-omap/sram-fn.S index 66414cc8e6e3..4bea36964a00 100644 --- a/trunk/arch/arm/plat-omap/sram-fn.S +++ b/trunk/arch/arm/plat-omap/sram-fn.S @@ -12,7 +12,7 @@ #include #include #include -#include +#include .text diff --git a/trunk/arch/arm/tools/mach-types b/trunk/arch/arm/tools/mach-types index 465487470d0e..048c9c19aa4f 100644 --- a/trunk/arch/arm/tools/mach-types +++ b/trunk/arch/arm/tools/mach-types @@ -12,7 +12,7 @@ # # http://www.arm.linux.org.uk/developer/machines/?action=new # -# Last update: Fri Nov 25 14:43:04 2005 +# Last update: Fri Nov 11 21:55:04 2005 # # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number # @@ -857,12 +857,12 @@ osiris MACH_OSIRIS OSIRIS 842 maestro MACH_MAESTRO MAESTRO 843 tunge2 MACH_TUNGE2 TUNGE2 844 ixbbm MACH_IXBBM IXBBM 845 -mx27ads MACH_MX27 MX27 846 +mx27 MACH_MX27 MX27 846 ax8004 MACH_AX8004 AX8004 847 at91sam9261ek MACH_AT91SAM9261EK AT91SAM9261EK 848 loft MACH_LOFT LOFT 849 magpie MACH_MAGPIE MAGPIE 850 -mx21ads MACH_MX21 MX21 851 +mx21 MACH_MX21 MX21 851 mb87m3400 MACH_MB87M3400 MB87M3400 852 mguard_delta MACH_MGUARD_DELTA MGUARD_DELTA 853 davinci_dvdp MACH_DAVINCI_DVDP DAVINCI_DVDP 854 @@ -897,16 +897,10 @@ omi_board MACH_OMI_BOARD OMI_BOARD 882 mx21civ MACH_MX21CIV MX21CIV 883 mahi_cdac MACH_MAHI_CDAC MAHI_CDAC 884 xscale_palmtx MACH_XSCALE_PALMTX XSCALE_PALMTX 885 +arch_s3c2413 MACH_ARCH_S3C2413 ARCH_S3C2413 886 s3c2413 MACH_S3C2413 S3C2413 887 samsys_ep0 MACH_SAMSYS_EP0 SAMSYS_EP0 888 wg302v1 MACH_WG302V1 WG302V1 889 wg302v2 MACH_WG302V2 WG302V2 890 eb42x MACH_EB42X EB42X 891 iq331es MACH_IQ331ES IQ331ES 892 -cosydsp MACH_COSYDSP COSYDSP 893 -uplat7d MACH_UPLAT7D UPLAT7D 894 -ptdavinci MACH_PTDAVINCI PTDAVINCI 895 -mbus MACH_MBUS MBUS 896 -nadia2vb MACH_NADIA2VB NADIA2VB 897 -r1000 MACH_R1000 R1000 898 -hw90250 MACH_HW90250 HW90250 899 diff --git a/trunk/arch/frv/kernel/pm.c b/trunk/arch/frv/kernel/pm.c index 712c3c24c954..1a1e8a119c3d 100644 --- a/trunk/arch/frv/kernel/pm.c +++ b/trunk/arch/frv/kernel/pm.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/arch/frv/kernel/semaphore.c b/trunk/arch/frv/kernel/semaphore.c index 7971d680ae29..5cba9c1f2b3d 100644 --- a/trunk/arch/frv/kernel/semaphore.c +++ b/trunk/arch/frv/kernel/semaphore.c @@ -20,7 +20,7 @@ struct sem_waiter { struct task_struct *task; }; -#if SEMAPHORE_DEBUG +#if SEM_DEBUG void semtrace(struct semaphore *sem, const char *str) { if (sem->debug) diff --git a/trunk/arch/frv/mb93090-mb00/pci-irq.c b/trunk/arch/frv/mb93090-mb00/pci-irq.c index 24622d89b1ca..af981bda015c 100644 --- a/trunk/arch/frv/mb93090-mb00/pci-irq.c +++ b/trunk/arch/frv/mb93090-mb00/pci-irq.c @@ -60,7 +60,7 @@ void __init pcibios_fixup_irqs(void) } } -void __init pcibios_penalize_isa_irq(int irq) +void __init pcibios_penalize_isa_irq(int irq, int active) { } diff --git a/trunk/arch/frv/mm/init.c b/trunk/arch/frv/mm/init.c index 765088ea8a50..79433159b5f0 100644 --- a/trunk/arch/frv/mm/init.c +++ b/trunk/arch/frv/mm/init.c @@ -108,7 +108,7 @@ void __init paging_init(void) memset((void *) empty_zero_page, 0, PAGE_SIZE); -#ifdef CONFIG_HIGHMEM +#if CONFIG_HIGHMEM if (num_physpages - num_mappedpages) { pgd_t *pge; pud_t *pue; diff --git a/trunk/arch/frv/mm/pgalloc.c b/trunk/arch/frv/mm/pgalloc.c index f76dd03ddd99..2c67dfe5a6b3 100644 --- a/trunk/arch/frv/mm/pgalloc.c +++ b/trunk/arch/frv/mm/pgalloc.c @@ -85,7 +85,7 @@ static inline void pgd_list_add(pgd_t *pgd) struct page *page = virt_to_page(pgd); page->index = (unsigned long) pgd_list; if (pgd_list) - set_page_private(pgd_list, (unsigned long) &page->index); + pgd_list->private = (unsigned long) &page->index; pgd_list = page; set_page_private(page, (unsigned long)&pgd_list); } @@ -94,10 +94,10 @@ static inline void pgd_list_del(pgd_t *pgd) { struct page *next, **pprev, *page = virt_to_page(pgd); next = (struct page *) page->index; - pprev = (struct page **) page_private(page); + pprev = (struct page **)page_private(page); *pprev = next; if (next) - set_page_private(next, (unsigned long) pprev); + next->private = (unsigned long) pprev; } void pgd_ctor(void *pgd, kmem_cache_t *cache, unsigned long unused) diff --git a/trunk/arch/i386/Kconfig b/trunk/arch/i386/Kconfig index 6004bb0795e0..dbf90ad6eac3 100644 --- a/trunk/arch/i386/Kconfig +++ b/trunk/arch/i386/Kconfig @@ -699,7 +699,7 @@ depends on PM && !X86_VISWS config APM tristate "APM (Advanced Power Management) BIOS support" - depends on PM && PM_LEGACY + depends on PM ---help--- APM is a BIOS specification for saving power using several different techniques. This is mostly useful for battery powered laptops with diff --git a/trunk/arch/i386/kernel/acpi/boot.c b/trunk/arch/i386/kernel/acpi/boot.c index 447fa9e33ffb..b66c13c0cc0f 100644 --- a/trunk/arch/i386/kernel/acpi/boot.c +++ b/trunk/arch/i386/kernel/acpi/boot.c @@ -39,14 +39,17 @@ #ifdef CONFIG_X86_64 +static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id) +{ +} extern void __init clustered_apic_check(void); +static inline int ioapic_setup_disabled(void) +{ + return 0; +} -extern int gsi_irq_sharing(int gsi); #include -static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return 0; } - - #else /* X86 */ #ifdef CONFIG_X86_LOCAL_APIC @@ -54,8 +57,6 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return #include #endif /* CONFIG_X86_LOCAL_APIC */ -static inline int gsi_irq_sharing(int gsi) { return gsi; } - #endif /* X86 */ #define BAD_MADT_ENTRY(entry, end) ( \ @@ -248,7 +249,9 @@ acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end) acpi_table_print_madt_entry(header); - /* Register even disabled CPUs for cpu hotplug */ + /* no utility in registering a disabled processor */ + if (processor->flags.enabled == 0) + return 0; x86_acpiid_to_apicid[processor->acpi_id] = processor->id; @@ -456,7 +459,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) *irq = IO_APIC_VECTOR(gsi); else #endif - *irq = gsi_irq_sharing(gsi); + *irq = gsi; return 0; } @@ -540,7 +543,7 @@ acpi_scan_rsdp(unsigned long start, unsigned long length) * RSDP signature. */ for (offset = 0; offset < length; offset += 16) { - if (strncmp((char *)(phys_to_virt(start) + offset), "RSD PTR ", sig_len)) + if (strncmp((char *)(start + offset), "RSD PTR ", sig_len)) continue; return (start + offset); } @@ -638,13 +641,6 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size) return 0; pmtmr_ioport = fadt->xpm_tmr_blk.address; - /* - * "X" fields are optional extensions to the original V1.0 - * fields, so we must selectively expand V1.0 fields if the - * corresponding X field is zero. - */ - if (!pmtmr_ioport) - pmtmr_ioport = fadt->V1_pm_tmr_blk; } else { /* FADT rev. 1 */ pmtmr_ioport = fadt->V1_pm_tmr_blk; diff --git a/trunk/arch/i386/kernel/apm.c b/trunk/arch/i386/kernel/apm.c index 1e60acbed3c1..003548b8735f 100644 --- a/trunk/arch/i386/kernel/apm.c +++ b/trunk/arch/i386/kernel/apm.c @@ -218,7 +218,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/arch/i386/kernel/cpu/amd.c b/trunk/arch/i386/kernel/cpu/amd.c index e344ef88cfcd..53a1681cd964 100644 --- a/trunk/arch/i386/kernel/cpu/amd.c +++ b/trunk/arch/i386/kernel/cpu/amd.c @@ -206,9 +206,9 @@ static void __init init_amd(struct cpuinfo_x86 *c) display_cacheinfo(c); if (cpuid_eax(0x80000000) >= 0x80000008) { - c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; - if (c->x86_max_cores & (c->x86_max_cores - 1)) - c->x86_max_cores = 1; + c->x86_num_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; + if (c->x86_num_cores & (c->x86_num_cores - 1)) + c->x86_num_cores = 1; } #ifdef CONFIG_X86_HT @@ -217,15 +217,15 @@ static void __init init_amd(struct cpuinfo_x86 *c) * distingush the cores. Assumes number of cores is a power * of two. */ - if (c->x86_max_cores > 1) { + if (c->x86_num_cores > 1) { int cpu = smp_processor_id(); unsigned bits = 0; - while ((1 << bits) < c->x86_max_cores) + while ((1 << bits) < c->x86_num_cores) bits++; cpu_core_id[cpu] = phys_proc_id[cpu] & ((1<>= bits; printk(KERN_INFO "CPU %d(%d) -> Core %d\n", - cpu, c->x86_max_cores, cpu_core_id[cpu]); + cpu, c->x86_num_cores, cpu_core_id[cpu]); } #endif } diff --git a/trunk/arch/i386/kernel/cpu/common.c b/trunk/arch/i386/kernel/cpu/common.c index 31e344b26bae..c145fb30002e 100644 --- a/trunk/arch/i386/kernel/cpu/common.c +++ b/trunk/arch/i386/kernel/cpu/common.c @@ -231,10 +231,10 @@ static void __init early_cpu_detect(void) cpuid(0x00000001, &tfms, &misc, &junk, &cap0); c->x86 = (tfms >> 8) & 15; c->x86_model = (tfms >> 4) & 15; - if (c->x86 == 0xf) + if (c->x86 == 0xf) { c->x86 += (tfms >> 20) & 0xff; - if (c->x86 >= 0x6) c->x86_model += ((tfms >> 16) & 0xF) << 4; + } c->x86_mask = tfms & 15; if (cap0 & (1<<19)) c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8; @@ -333,7 +333,7 @@ void __devinit identify_cpu(struct cpuinfo_x86 *c) c->x86_model = c->x86_mask = 0; /* So far unknown... */ c->x86_vendor_id[0] = '\0'; /* Unset */ c->x86_model_id[0] = '\0'; /* Unset */ - c->x86_max_cores = 1; + c->x86_num_cores = 1; memset(&c->x86_capability, 0, sizeof c->x86_capability); if (!have_cpuid_p()) { @@ -443,44 +443,52 @@ void __devinit identify_cpu(struct cpuinfo_x86 *c) void __devinit detect_ht(struct cpuinfo_x86 *c) { u32 eax, ebx, ecx, edx; - int index_msb, core_bits; + int index_msb, tmp; int cpu = smp_processor_id(); - cpuid(1, &eax, &ebx, &ecx, &edx); - - c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0); - if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY)) return; + cpuid(1, &eax, &ebx, &ecx, &edx); smp_num_siblings = (ebx & 0xff0000) >> 16; if (smp_num_siblings == 1) { printk(KERN_INFO "CPU: Hyper-Threading is disabled\n"); } else if (smp_num_siblings > 1 ) { + index_msb = 31; if (smp_num_siblings > NR_CPUS) { printk(KERN_WARNING "CPU: Unsupported number of the siblings %d", smp_num_siblings); smp_num_siblings = 1; return; } - - index_msb = get_count_order(smp_num_siblings); + tmp = smp_num_siblings; + while ((tmp & 0x80000000 ) == 0) { + tmp <<=1 ; + index_msb--; + } + if (smp_num_siblings & (smp_num_siblings - 1)) + index_msb++; phys_proc_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb); printk(KERN_INFO "CPU: Physical Processor ID: %d\n", phys_proc_id[cpu]); - smp_num_siblings = smp_num_siblings / c->x86_max_cores; + smp_num_siblings = smp_num_siblings / c->x86_num_cores; - index_msb = get_count_order(smp_num_siblings) ; + tmp = smp_num_siblings; + index_msb = 31; + while ((tmp & 0x80000000) == 0) { + tmp <<=1 ; + index_msb--; + } - core_bits = get_count_order(c->x86_max_cores); + if (smp_num_siblings & (smp_num_siblings - 1)) + index_msb++; - cpu_core_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb) & - ((1 << core_bits) - 1); + cpu_core_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb); - if (c->x86_max_cores > 1) + if (c->x86_num_cores > 1) printk(KERN_INFO "CPU: Processor Core ID: %d\n", cpu_core_id[cpu]); } diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c b/trunk/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c index 2b62dee35c6c..04a405345203 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c @@ -177,10 +177,9 @@ static unsigned int nforce2_fsb_read(int bootfsb) */ static int nforce2_set_fsb(unsigned int fsb) { - u32 temp = 0; + u32 pll, temp = 0; unsigned int tfsb; int diff; - int pll = 0; if ((fsb > max_fsb) || (fsb < NFORCE2_MIN_FSB)) { printk(KERN_ERR "cpufreq: FSB %d is out of range!\n", fsb); diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index 0fbbd4c1072e..68a1fc87f4ca 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.c @@ -45,7 +45,7 @@ #define PFX "powernow-k8: " #define BFX PFX "BIOS error: " -#define VERSION "version 1.60.0" +#define VERSION "version 1.50.4" #include "powernow-k8.h" /* serialize freq changes */ @@ -216,10 +216,10 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid) do { wrmsr(MSR_FIDVID_CTL, lo, STOP_GRANT_5NS); - if (i++ > 100) { - printk(KERN_ERR PFX "internal error - pending bit very stuck - no further pstate changes possible\n"); - return 1; - } + if (i++ > 100) { + printk(KERN_ERR PFX "internal error - pending bit very stuck - no further pstate changes possible\n"); + return 1; + } } while (query_current_values_with_pending_wait(data)); if (savefid != data->currfid) { @@ -336,7 +336,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid /* Phase 2 - core frequency transition */ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) { - u32 vcoreqfid, vcocurrfid, vcofiddiff, fid_interval, savevid = data->currvid; + u32 vcoreqfid, vcocurrfid, vcofiddiff, savevid = data->currvid; if ((reqfid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) { printk(KERN_ERR PFX "ph2: illegal lo-lo transition 0x%x 0x%x\n", @@ -359,11 +359,9 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) : vcoreqfid - vcocurrfid; while (vcofiddiff > 2) { - (data->currfid & 1) ? (fid_interval = 1) : (fid_interval = 2); - if (reqfid > data->currfid) { if (data->currfid > LO_FID_TABLE_TOP) { - if (write_new_fid(data, data->currfid + fid_interval)) { + if (write_new_fid(data, data->currfid + 2)) { return 1; } } else { @@ -373,7 +371,7 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) } } } else { - if (write_new_fid(data, data->currfid - fid_interval)) + if (write_new_fid(data, data->currfid - 2)) return 1; } @@ -466,7 +464,7 @@ static int check_supported_cpu(unsigned int cpu) set_cpus_allowed(current, cpumask_of_cpu(cpu)); if (smp_processor_id() != cpu) { - printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu); + printk(KERN_ERR "limiting to cpu %u failed\n", cpu); goto out; } @@ -476,7 +474,7 @@ static int check_supported_cpu(unsigned int cpu) eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) || ((eax & CPUID_XFAM) != CPUID_XFAM_K8) || - ((eax & CPUID_XMOD) > CPUID_XMOD_REV_G)) { + ((eax & CPUID_XMOD) > CPUID_XMOD_REV_F)) { printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax); goto out; } @@ -519,24 +517,22 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 printk(KERN_ERR BFX "maxvid exceeded with pstate %d\n", j); return -ENODEV; } - if (pst[j].fid > MAX_FID) { - printk(KERN_ERR BFX "maxfid exceeded with pstate %d\n", j); - return -ENODEV; - } - if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) { + if ((pst[j].fid > MAX_FID) + || (pst[j].fid & 1) + || (j && (pst[j].fid < HI_FID_TABLE_BOTTOM))) { /* Only first fid is allowed to be in "low" range */ - printk(KERN_ERR BFX "two low fids - %d : 0x%x\n", j, pst[j].fid); + printk(KERN_ERR PFX "two low fids - %d : 0x%x\n", j, pst[j].fid); return -EINVAL; } if (pst[j].fid < lastfid) lastfid = pst[j].fid; } if (lastfid & 1) { - printk(KERN_ERR BFX "lastfid invalid\n"); + printk(KERN_ERR PFX "lastfid invalid\n"); return -EINVAL; } if (lastfid > LO_FID_TABLE_TOP) - printk(KERN_INFO BFX "first fid not from lo freq table\n"); + printk(KERN_INFO PFX "first fid not from lo freq table\n"); return 0; } @@ -635,7 +631,7 @@ static int find_psb_table(struct powernow_k8_data *data) dprintk("table vers: 0x%x\n", psb->tableversion); if (psb->tableversion != PSB_VERSION_1_4) { - printk(KERN_ERR BFX "PSB table is not v1.4\n"); + printk(KERN_INFO BFX "PSB table is not v1.4\n"); return -ENODEV; } @@ -693,7 +689,7 @@ static int find_psb_table(struct powernow_k8_data *data) * BIOS and Kernel Developer's Guide, which is available on * www.amd.com */ - printk(KERN_ERR PFX "BIOS error - no PSB or ACPI _PSS objects\n"); + printk(KERN_INFO PFX "BIOS error - no PSB or ACPI _PSS objects\n"); return -ENODEV; } @@ -916,7 +912,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); if (smp_processor_id() != pol->cpu) { - printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); + printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu); goto err_out; } @@ -986,9 +982,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol) cpumask_t oldmask = CPU_MASK_ALL; int rc, i; - if (!cpu_online(pol->cpu)) - return -ENODEV; - if (!check_supported_cpu(pol->cpu)) return -ENODEV; @@ -1028,7 +1021,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol) set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); if (smp_processor_id() != pol->cpu) { - printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); + printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu); goto err_out; } @@ -1169,9 +1162,10 @@ static void __exit powernowk8_exit(void) cpufreq_unregister_driver(&cpufreq_amd64_driver); } -MODULE_AUTHOR("Paul Devriendt and Mark Langsdorf "); +MODULE_AUTHOR("Paul Devriendt and Mark Langsdorf = interprocessor hypertransport link speed * (only applies to MP systems obviously) */ /* fids (frequency identifiers) are arranged in 2 tables - lo and hi */ -#define LO_FID_TABLE_TOP 7 /* fid values marking the boundary */ +#define LO_FID_TABLE_TOP 6 /* fid values marking the boundary */ #define HI_FID_TABLE_BOTTOM 8 /* between the low and high tables */ #define LO_VCOFREQ_TABLE_TOP 1400 /* corresponding vco frequency values */ @@ -107,7 +106,7 @@ struct powernow_k8_data { #define MIN_FREQ 800 /* Min and max freqs, per spec */ #define MAX_FREQ 5000 -#define INVALID_FID_MASK 0xffffffc0 /* not a valid fid if these bits are set */ +#define INVALID_FID_MASK 0xffffffc1 /* not a valid fid if these bits are set */ #define INVALID_VID_MASK 0xffffffc0 /* not a valid vid if these bits are set */ #define VID_OFF 0x3f diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c index b425cd3d1838..5b7d18a06afa 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c @@ -40,7 +40,6 @@ static struct pci_dev *speedstep_chipset_dev; */ static unsigned int speedstep_processor = 0; -static u32 pmbase; /* * There are only two frequency states for each processor. Values @@ -57,46 +56,33 @@ static struct cpufreq_frequency_table speedstep_freqs[] = { /** - * speedstep_find_register - read the PMBASE address + * speedstep_set_state - set the SpeedStep state + * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH) * - * Returns: -ENODEV if no register could be found + * Tries to change the SpeedStep state. */ -static int speedstep_find_register (void) +static void speedstep_set_state (unsigned int state) { - if (!speedstep_chipset_dev) - return -ENODEV; + u32 pmbase; + u8 pm2_blk; + u8 value; + unsigned long flags; + + if (!speedstep_chipset_dev || (state > 0x1)) + return; /* get PMBASE */ pci_read_config_dword(speedstep_chipset_dev, 0x40, &pmbase); if (!(pmbase & 0x01)) { printk(KERN_ERR "speedstep-ich: could not find speedstep register\n"); - return -ENODEV; + return; } pmbase &= 0xFFFFFFFE; if (!pmbase) { printk(KERN_ERR "speedstep-ich: could not find speedstep register\n"); - return -ENODEV; - } - - dprintk("pmbase is 0x%x\n", pmbase); - return 0; -} - -/** - * speedstep_set_state - set the SpeedStep state - * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH) - * - * Tries to change the SpeedStep state. - */ -static void speedstep_set_state (unsigned int state) -{ - u8 pm2_blk; - u8 value; - unsigned long flags; - - if (state > 0x1) return; + } /* Disable IRQs */ local_irq_save(flags); @@ -329,11 +315,10 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) cpus_allowed = current->cpus_allowed; set_cpus_allowed(current, policy->cpus); - /* detect low and high frequency and transition latency */ + /* detect low and high frequency */ result = speedstep_get_freqs(speedstep_processor, &speedstep_freqs[SPEEDSTEP_LOW].frequency, &speedstep_freqs[SPEEDSTEP_HIGH].frequency, - &policy->cpuinfo.transition_latency, &speedstep_set_state); set_cpus_allowed(current, cpus_allowed); if (result) @@ -350,6 +335,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) /* cpuinfo and default policy values */ policy->governor = CPUFREQ_DEFAULT_GOVERNOR; + policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cur = speed; result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs); @@ -414,9 +400,6 @@ static int __init speedstep_init(void) return -EINVAL; } - if (speedstep_find_register()) - return -ENODEV; - return cpufreq_register_driver(&speedstep_driver); } diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c index 7c47005a1805..d368b3f5fce8 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c @@ -320,13 +320,11 @@ EXPORT_SYMBOL_GPL(speedstep_detect_processor); unsigned int speedstep_get_freqs(unsigned int processor, unsigned int *low_speed, unsigned int *high_speed, - unsigned int *transition_latency, void (*set_state) (unsigned int state)) { unsigned int prev_speed; unsigned int ret = 0; unsigned long flags; - struct timeval tv1, tv2; if ((!processor) || (!low_speed) || (!high_speed) || (!set_state)) return -EINVAL; @@ -339,7 +337,7 @@ unsigned int speedstep_get_freqs(unsigned int processor, return -EIO; dprintk("previous speed is %u\n", prev_speed); - + local_irq_save(flags); /* switch to low state */ @@ -352,17 +350,8 @@ unsigned int speedstep_get_freqs(unsigned int processor, dprintk("low speed is %u\n", *low_speed); - /* start latency measurement */ - if (transition_latency) - do_gettimeofday(&tv1); - /* switch to high state */ set_state(SPEEDSTEP_HIGH); - - /* end latency measurement */ - if (transition_latency) - do_gettimeofday(&tv2); - *high_speed = speedstep_get_processor_frequency(processor); if (!*high_speed) { ret = -EIO; @@ -380,25 +369,6 @@ unsigned int speedstep_get_freqs(unsigned int processor, if (*high_speed != prev_speed) set_state(SPEEDSTEP_LOW); - if (transition_latency) { - *transition_latency = (tv2.tv_sec - tv1.tv_sec) * USEC_PER_SEC + - tv2.tv_usec - tv1.tv_usec; - dprintk("transition latency is %u uSec\n", *transition_latency); - - /* convert uSec to nSec and add 20% for safety reasons */ - *transition_latency *= 1200; - - /* check if the latency measurement is too high or too low - * and set it to a safe value (500uSec) in that case - */ - if (*transition_latency > 10000000 || *transition_latency < 50000) { - printk (KERN_WARNING "speedstep: frequency transition measured seems out of " - "range (%u nSec), falling back to a safe one of %u nSec.\n", - *transition_latency, 500000); - *transition_latency = 500000; - } - } - out: local_irq_restore(flags); return (ret); diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h index 6a727fd3a77e..261a2c9b7f6b 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h +++ b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h @@ -44,5 +44,4 @@ extern unsigned int speedstep_get_processor_frequency(unsigned int processor); extern unsigned int speedstep_get_freqs(unsigned int processor, unsigned int *low_speed, unsigned int *high_speed, - unsigned int *transition_latency, void (*set_state) (unsigned int state)); diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c index 28cc5d524afc..2718fb6f6aba 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c @@ -269,7 +269,6 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) result = speedstep_get_freqs(speedstep_processor, &speedstep_freqs[SPEEDSTEP_LOW].frequency, &speedstep_freqs[SPEEDSTEP_HIGH].frequency, - NULL, &speedstep_set_state); if (result) { diff --git a/trunk/arch/i386/kernel/cpu/intel.c b/trunk/arch/i386/kernel/cpu/intel.c index 5e2da704f0fa..43601de0f633 100644 --- a/trunk/arch/i386/kernel/cpu/intel.c +++ b/trunk/arch/i386/kernel/cpu/intel.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include @@ -158,7 +157,7 @@ static void __devinit init_intel(struct cpuinfo_x86 *c) if ( p ) strcpy(c->x86_model_id, p); - c->x86_max_cores = num_cpu_cores(c); + c->x86_num_cores = num_cpu_cores(c); detect_ht(c); @@ -265,52 +264,5 @@ __init int intel_cpu_init(void) return 0; } -#ifndef CONFIG_X86_CMPXCHG -unsigned long cmpxchg_386_u8(volatile void *ptr, u8 old, u8 new) -{ - u8 prev; - unsigned long flags; - - /* Poor man's cmpxchg for 386. Unsuitable for SMP */ - local_irq_save(flags); - prev = *(u8 *)ptr; - if (prev == old) - *(u8 *)ptr = new; - local_irq_restore(flags); - return prev; -} -EXPORT_SYMBOL(cmpxchg_386_u8); - -unsigned long cmpxchg_386_u16(volatile void *ptr, u16 old, u16 new) -{ - u16 prev; - unsigned long flags; - - /* Poor man's cmpxchg for 386. Unsuitable for SMP */ - local_irq_save(flags); - prev = *(u16 *)ptr; - if (prev == old) - *(u16 *)ptr = new; - local_irq_restore(flags); - return prev; -} -EXPORT_SYMBOL(cmpxchg_386_u16); - -unsigned long cmpxchg_386_u32(volatile void *ptr, u32 old, u32 new) -{ - u32 prev; - unsigned long flags; - - /* Poor man's cmpxchg for 386. Unsuitable for SMP */ - local_irq_save(flags); - prev = *(u32 *)ptr; - if (prev == old) - *(u32 *)ptr = new; - local_irq_restore(flags); - return prev; -} -EXPORT_SYMBOL(cmpxchg_386_u32); -#endif - // arch_initcall(intel_cpu_init); diff --git a/trunk/arch/i386/kernel/cpu/intel_cacheinfo.c b/trunk/arch/i386/kernel/cpu/intel_cacheinfo.c index fbfd374aa336..4dc42a189ae5 100644 --- a/trunk/arch/i386/kernel/cpu/intel_cacheinfo.c +++ b/trunk/arch/i386/kernel/cpu/intel_cacheinfo.c @@ -293,45 +293,29 @@ static struct _cpuid4_info *cpuid4_info[NR_CPUS]; #ifdef CONFIG_SMP static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) { - struct _cpuid4_info *this_leaf, *sibling_leaf; + struct _cpuid4_info *this_leaf; unsigned long num_threads_sharing; - int index_msb, i; - struct cpuinfo_x86 *c = cpu_data; +#ifdef CONFIG_X86_HT + struct cpuinfo_x86 *c = cpu_data + cpu; +#endif this_leaf = CPUID4_INFO_IDX(cpu, index); num_threads_sharing = 1 + this_leaf->eax.split.num_threads_sharing; if (num_threads_sharing == 1) cpu_set(cpu, this_leaf->shared_cpu_map); - else { - index_msb = get_count_order(num_threads_sharing); - - for_each_online_cpu(i) { - if (c[i].apicid >> index_msb == - c[cpu].apicid >> index_msb) { - cpu_set(i, this_leaf->shared_cpu_map); - if (i != cpu && cpuid4_info[i]) { - sibling_leaf = CPUID4_INFO_IDX(i, index); - cpu_set(cpu, sibling_leaf->shared_cpu_map); - } - } - } - } -} -static void __devinit cache_remove_shared_cpu_map(unsigned int cpu, int index) -{ - struct _cpuid4_info *this_leaf, *sibling_leaf; - int sibling; - - this_leaf = CPUID4_INFO_IDX(cpu, index); - for_each_cpu_mask(sibling, this_leaf->shared_cpu_map) { - sibling_leaf = CPUID4_INFO_IDX(sibling, index); - cpu_clear(cpu, sibling_leaf->shared_cpu_map); - } +#ifdef CONFIG_X86_HT + else if (num_threads_sharing == smp_num_siblings) + this_leaf->shared_cpu_map = cpu_sibling_map[cpu]; + else if (num_threads_sharing == (c->x86_num_cores * smp_num_siblings)) + this_leaf->shared_cpu_map = cpu_core_map[cpu]; + else + printk(KERN_DEBUG "Number of CPUs sharing cache didn't match " + "any known set of CPUs\n"); +#endif } #else static void __init cache_shared_cpu_map_setup(unsigned int cpu, int index) {} -static void __init cache_remove_shared_cpu_map(unsigned int cpu, int index) {} #endif static void free_cache_attributes(unsigned int cpu) @@ -590,10 +574,8 @@ static void __cpuexit cache_remove_dev(struct sys_device * sys_dev) unsigned int cpu = sys_dev->id; unsigned long i; - for (i = 0; i < num_cache_leaves; i++) { - cache_remove_shared_cpu_map(cpu, i); + for (i = 0; i < num_cache_leaves; i++) kobject_unregister(&(INDEX_KOBJECT_PTR(cpu,i)->kobj)); - } kobject_unregister(cache_kobject[cpu]); cpuid4_cache_sysfs_exit(cpu); return; diff --git a/trunk/arch/i386/kernel/cpu/mtrr/main.c b/trunk/arch/i386/kernel/cpu/mtrr/main.c index 1e9db198c440..dd4ebd6af7e4 100644 --- a/trunk/arch/i386/kernel/cpu/mtrr/main.c +++ b/trunk/arch/i386/kernel/cpu/mtrr/main.c @@ -626,14 +626,6 @@ void __init mtrr_bp_init(void) if (cpuid_eax(0x80000000) >= 0x80000008) { u32 phys_addr; phys_addr = cpuid_eax(0x80000008) & 0xff; - /* CPUID workaround for Intel 0F33/0F34 CPU */ - if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && - boot_cpu_data.x86 == 0xF && - boot_cpu_data.x86_model == 0x3 && - (boot_cpu_data.x86_mask == 0x3 || - boot_cpu_data.x86_mask == 0x4)) - phys_addr = 36; - size_or_mask = ~((1 << (phys_addr - PAGE_SHIFT)) - 1); size_and_mask = ~size_or_mask & 0xfff00000; } else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR && diff --git a/trunk/arch/i386/kernel/cpu/proc.c b/trunk/arch/i386/kernel/cpu/proc.c index 6d91b274589c..41b871ecf4b3 100644 --- a/trunk/arch/i386/kernel/cpu/proc.c +++ b/trunk/arch/i386/kernel/cpu/proc.c @@ -3,7 +3,6 @@ #include #include #include -#include /* * Get CPU information for use by the procfs. @@ -87,22 +86,20 @@ static int show_cpuinfo(struct seq_file *m, void *v) seq_printf(m, "stepping\t: unknown\n"); if ( cpu_has(c, X86_FEATURE_TSC) ) { - unsigned int freq = cpufreq_quick_get(n); - if (!freq) - freq = cpu_khz; seq_printf(m, "cpu MHz\t\t: %u.%03u\n", - freq / 1000, (freq % 1000)); + cpu_khz / 1000, (cpu_khz % 1000)); } /* Cache size */ if (c->x86_cache_size >= 0) seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); #ifdef CONFIG_X86_HT - if (c->x86_max_cores * smp_num_siblings > 1) { + if (c->x86_num_cores * smp_num_siblings > 1) { seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]); - seq_printf(m, "siblings\t: %d\n", cpus_weight(cpu_core_map[n])); + seq_printf(m, "siblings\t: %d\n", + c->x86_num_cores * smp_num_siblings); seq_printf(m, "core id\t\t: %d\n", cpu_core_id[n]); - seq_printf(m, "cpu cores\t: %d\n", c->booted_cores); + seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores); } #endif diff --git a/trunk/arch/i386/kernel/crash.c b/trunk/arch/i386/kernel/crash.c index 0248e084017c..af809ccf5fbe 100644 --- a/trunk/arch/i386/kernel/crash.c +++ b/trunk/arch/i386/kernel/crash.c @@ -21,7 +21,6 @@ #include #include #include -#include #include @@ -148,7 +147,6 @@ static int crash_nmi_callback(struct pt_regs *regs, int cpu) regs = &fixed_regs; } crash_save_this_cpu(regs, cpu); - disable_local_APIC(); atomic_dec(&waiting_for_crash_ipi); /* Assume hlt works */ halt(); @@ -188,7 +186,6 @@ static void nmi_shootdown_cpus(void) } /* Leave the nmi callback set */ - disable_local_APIC(); } #else static void nmi_shootdown_cpus(void) @@ -213,9 +210,5 @@ void machine_crash_shutdown(struct pt_regs *regs) /* Make a note of crashing cpu. Will be used in NMI callback.*/ crashing_cpu = smp_processor_id(); nmi_shootdown_cpus(); - lapic_shutdown(); -#if defined(CONFIG_X86_IO_APIC) - disable_IO_APIC(); -#endif crash_save_self(regs); } diff --git a/trunk/arch/i386/kernel/entry.S b/trunk/arch/i386/kernel/entry.S index e50b93155249..9e24f7b207ee 100644 --- a/trunk/arch/i386/kernel/entry.S +++ b/trunk/arch/i386/kernel/entry.S @@ -560,10 +560,11 @@ nmi_stack_fixup: nmi_debug_stack_check: cmpw $__KERNEL_CS,16(%esp) jne nmi_stack_correct - cmpl $debug,(%esp) - jb nmi_stack_correct + cmpl $debug - 1,(%esp) + jle nmi_stack_correct cmpl $debug_esp_fix_insn,(%esp) - ja nmi_stack_correct + jle nmi_debug_stack_fixup +nmi_debug_stack_fixup: FIX_STACK(24,nmi_stack_correct, 1) jmp nmi_stack_correct diff --git a/trunk/arch/i386/kernel/io_apic.c b/trunk/arch/i386/kernel/io_apic.c index 22c8675c79f4..cc5d7ac5b2e7 100644 --- a/trunk/arch/i386/kernel/io_apic.c +++ b/trunk/arch/i386/kernel/io_apic.c @@ -2009,7 +2009,7 @@ static void ack_edge_ioapic_vector(unsigned int vector) { int irq = vector_to_irq(vector); - move_native_irq(vector); + move_irq(vector); ack_edge_ioapic_irq(irq); } @@ -2024,7 +2024,7 @@ static void end_level_ioapic_vector (unsigned int vector) { int irq = vector_to_irq(vector); - move_native_irq(vector); + move_irq(vector); end_level_ioapic_irq(irq); } diff --git a/trunk/arch/i386/kernel/kprobes.c b/trunk/arch/i386/kernel/kprobes.c index 19edcd526ba4..32b0c24ab9a6 100644 --- a/trunk/arch/i386/kernel/kprobes.c +++ b/trunk/arch/i386/kernel/kprobes.c @@ -191,7 +191,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) */ save_previous_kprobe(kcb); set_current_kprobe(p, regs, kcb); - kprobes_inc_nmissed_count(p); + p->nmissed++; prepare_singlestep(p, regs); kcb->kprobe_status = KPROBE_REENTER; return 1; diff --git a/trunk/arch/i386/kernel/mpparse.c b/trunk/arch/i386/kernel/mpparse.c index 1ca5269b1e86..8f767d9aa45d 100644 --- a/trunk/arch/i386/kernel/mpparse.c +++ b/trunk/arch/i386/kernel/mpparse.c @@ -220,9 +220,8 @@ static void __devinit MP_processor_info (struct mpc_config_processor *m) num_processors++; if ((num_processors > 8) && - ((APIC_XAPIC(ver) && - (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)) || - (boot_cpu_data.x86_vendor == X86_VENDOR_AMD))) + APIC_XAPIC(ver) && + (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)) def_to_bigsmp = 1; else def_to_bigsmp = 0; diff --git a/trunk/arch/i386/kernel/process.c b/trunk/arch/i386/kernel/process.c index 2333aead0563..1cb261f225d5 100644 --- a/trunk/arch/i386/kernel/process.c +++ b/trunk/arch/i386/kernel/process.c @@ -393,6 +393,13 @@ void flush_thread(void) { struct task_struct *tsk = current; + /* + * Remove function-return probe instances associated with this task + * and put them back on the free list. Do not insert an exit probe for + * this function, it will be disabled by kprobe_flush_task if you do. + */ + kprobe_flush_task(tsk); + memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8); memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); /* @@ -554,9 +561,7 @@ int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) struct pt_regs ptregs; ptregs = *(struct pt_regs *) - ((unsigned long)tsk->thread_info + - /* see comments in copy_thread() about -8 */ - THREAD_SIZE - sizeof(ptregs) - 8); + ((unsigned long)tsk->thread_info+THREAD_SIZE - sizeof(ptregs)); ptregs.xcs &= 0xffff; ptregs.xds &= 0xffff; ptregs.xes &= 0xffff; diff --git a/trunk/arch/i386/kernel/reboot.c b/trunk/arch/i386/kernel/reboot.c index 2afe0f8d555a..350ea6680f63 100644 --- a/trunk/arch/i386/kernel/reboot.c +++ b/trunk/arch/i386/kernel/reboot.c @@ -111,14 +111,6 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"), }, }, - { /* Handle problems with rebooting on HP nc6120 */ - .callback = set_bios_reboot, - .ident = "HP Compaq nc6120", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), - DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nc6120"), - }, - }, { } }; diff --git a/trunk/arch/i386/kernel/smpboot.c b/trunk/arch/i386/kernel/smpboot.c index 9ed449af8e9f..bc5a9d97466b 100644 --- a/trunk/arch/i386/kernel/smpboot.c +++ b/trunk/arch/i386/kernel/smpboot.c @@ -72,11 +72,9 @@ int phys_proc_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID}; /* Core ID of each logical CPU */ int cpu_core_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID}; -/* representing HT siblings of each logical CPU */ cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly; EXPORT_SYMBOL(cpu_sibling_map); -/* representing HT and core siblings of each logical CPU */ cpumask_t cpu_core_map[NR_CPUS] __read_mostly; EXPORT_SYMBOL(cpu_core_map); @@ -444,60 +442,35 @@ static void __devinit smp_callin(void) static int cpucount; -/* representing cpus for which sibling maps can be computed */ -static cpumask_t cpu_sibling_setup_map; - static inline void set_cpu_sibling_map(int cpu) { int i; - struct cpuinfo_x86 *c = cpu_data; - - cpu_set(cpu, cpu_sibling_setup_map); if (smp_num_siblings > 1) { - for_each_cpu_mask(i, cpu_sibling_setup_map) { - if (phys_proc_id[cpu] == phys_proc_id[i] && - cpu_core_id[cpu] == cpu_core_id[i]) { + for (i = 0; i < NR_CPUS; i++) { + if (!cpu_isset(i, cpu_callout_map)) + continue; + if (cpu_core_id[cpu] == cpu_core_id[i]) { cpu_set(i, cpu_sibling_map[cpu]); cpu_set(cpu, cpu_sibling_map[i]); - cpu_set(i, cpu_core_map[cpu]); - cpu_set(cpu, cpu_core_map[i]); } } } else { cpu_set(cpu, cpu_sibling_map[cpu]); } - if (current_cpu_data.x86_max_cores == 1) { - cpu_core_map[cpu] = cpu_sibling_map[cpu]; - c[cpu].booted_cores = 1; - return; - } - - for_each_cpu_mask(i, cpu_sibling_setup_map) { - if (phys_proc_id[cpu] == phys_proc_id[i]) { - cpu_set(i, cpu_core_map[cpu]); - cpu_set(cpu, cpu_core_map[i]); - /* - * Does this new cpu bringup a new core? - */ - if (cpus_weight(cpu_sibling_map[cpu]) == 1) { - /* - * for each core in package, increment - * the booted_cores for this new cpu - */ - if (first_cpu(cpu_sibling_map[i]) == i) - c[cpu].booted_cores++; - /* - * increment the core count for all - * the other cpus in this package - */ - if (i != cpu) - c[i].booted_cores++; - } else if (i != cpu && !c[cpu].booted_cores) - c[cpu].booted_cores = c[i].booted_cores; + if (current_cpu_data.x86_num_cores > 1) { + for (i = 0; i < NR_CPUS; i++) { + if (!cpu_isset(i, cpu_callout_map)) + continue; + if (phys_proc_id[cpu] == phys_proc_id[i]) { + cpu_set(i, cpu_core_map[cpu]); + cpu_set(cpu, cpu_core_map[i]); + } } + } else { + cpu_core_map[cpu] = cpu_sibling_map[cpu]; } } @@ -1122,8 +1095,11 @@ static void __init smp_boot_cpus(unsigned int max_cpus) current_thread_info()->cpu = 0; smp_tune_scheduling(); + cpus_clear(cpu_sibling_map[0]); + cpu_set(0, cpu_sibling_map[0]); - set_cpu_sibling_map(0); + cpus_clear(cpu_core_map[0]); + cpu_set(0, cpu_core_map[0]); /* * If we couldn't find an SMP configuration at boot time, @@ -1302,24 +1278,15 @@ static void remove_siblinginfo(int cpu) { int sibling; - struct cpuinfo_x86 *c = cpu_data; - for_each_cpu_mask(sibling, cpu_core_map[cpu]) { - cpu_clear(cpu, cpu_core_map[sibling]); - /* - * last thread sibling in this cpu core going down - */ - if (cpus_weight(cpu_sibling_map[cpu]) == 1) - c[sibling].booted_cores--; - } - for_each_cpu_mask(sibling, cpu_sibling_map[cpu]) cpu_clear(cpu, cpu_sibling_map[sibling]); + for_each_cpu_mask(sibling, cpu_core_map[cpu]) + cpu_clear(cpu, cpu_core_map[sibling]); cpus_clear(cpu_sibling_map[cpu]); cpus_clear(cpu_core_map[cpu]); phys_proc_id[cpu] = BAD_APICID; cpu_core_id[cpu] = BAD_APICID; - cpu_clear(cpu, cpu_sibling_setup_map); } int __cpu_disable(void) @@ -1338,7 +1305,8 @@ int __cpu_disable(void) if (cpu == 0) return -EBUSY; - clear_local_APIC(); + /* We enable the timer again on the exit path of the death loop */ + disable_APIC_timer(); /* Allow any queued timer interrupts to get serviced */ local_irq_enable(); mdelay(1); diff --git a/trunk/arch/i386/kernel/srat.c b/trunk/arch/i386/kernel/srat.c index 52b3ed5d2cb5..8de658db8146 100644 --- a/trunk/arch/i386/kernel/srat.c +++ b/trunk/arch/i386/kernel/srat.c @@ -137,8 +137,8 @@ static void __init parse_memory_affinity_structure (char *sratp) "enabled and removable" : "enabled" ) ); } -#if MAX_NR_ZONES != 4 -#error "MAX_NR_ZONES != 4, chunk_to_zone requires review" +#if MAX_NR_ZONES != 3 +#error "MAX_NR_ZONES != 3, chunk_to_zone requires review" #endif /* Take a chunk of pages from page frame cstart to cend and count the number * of pages in each zone, returned via zones[]. diff --git a/trunk/arch/i386/kernel/timers/timer_pit.c b/trunk/arch/i386/kernel/timers/timer_pit.c index b9b6bd56b9ba..e42e46d35159 100644 --- a/trunk/arch/i386/kernel/timers/timer_pit.c +++ b/trunk/arch/i386/kernel/timers/timer_pit.c @@ -25,9 +25,8 @@ static int __init init_pit(char* override) { /* check clock override */ if (override[0] && strncmp(override,"pit",3)) - printk(KERN_ERR "Warning: clock= override failed. Defaulting " - "to PIT\n"); - init_cpu_khz(); + printk(KERN_ERR "Warning: clock= override failed. Defaulting to PIT\n"); + count_p = LATCH; return 0; } diff --git a/trunk/arch/i386/kernel/traps.c b/trunk/arch/i386/kernel/traps.c index f0dffa03fbba..c34d1bfc5161 100644 --- a/trunk/arch/i386/kernel/traps.c +++ b/trunk/arch/i386/kernel/traps.c @@ -650,6 +650,13 @@ fastcall void do_nmi(struct pt_regs * regs, long error_code) cpu = smp_processor_id(); +#ifdef CONFIG_HOTPLUG_CPU + if (!cpu_online(cpu)) { + nmi_exit(); + return; + } +#endif + ++nmi_count(cpu); if (!rcu_dereference(nmi_callback)(regs, cpu)) diff --git a/trunk/arch/i386/mm/init.c b/trunk/arch/i386/mm/init.c index 06e26f006238..542d9298da5e 100644 --- a/trunk/arch/i386/mm/init.c +++ b/trunk/arch/i386/mm/init.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -268,7 +267,7 @@ static void __init permanent_kmaps_init(pgd_t *pgd_base) pkmap_page_table = pte; } -static void __devinit free_new_highpage(struct page *page) +void __devinit free_new_highpage(struct page *page) { set_page_count(page, 1); __free_page(page); diff --git a/trunk/arch/i386/mm/ioremap.c b/trunk/arch/i386/mm/ioremap.c index 247fde76aaed..5d09de8d1c6b 100644 --- a/trunk/arch/i386/mm/ioremap.c +++ b/trunk/arch/i386/mm/ioremap.c @@ -223,15 +223,9 @@ void __iomem *ioremap_nocache (unsigned long phys_addr, unsigned long size) } EXPORT_SYMBOL(ioremap_nocache); -/** - * iounmap - Free a IO remapping - * @addr: virtual address from ioremap_* - * - * Caller must ensure there is only one unmapping for the same pointer. - */ void iounmap(volatile void __iomem *addr) { - struct vm_struct *p, *o; + struct vm_struct *p; if ((void __force *)addr <= high_memory) return; @@ -245,37 +239,22 @@ void iounmap(volatile void __iomem *addr) addr < phys_to_virt(ISA_END_ADDRESS)) return; - addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr); - - /* Use the vm area unlocked, assuming the caller - ensures there isn't another iounmap for the same address - in parallel. Reuse of the virtual address is prevented by - leaving it in the global lists until we're done with it. - cpa takes care of the direct mappings. */ - read_lock(&vmlist_lock); - for (p = vmlist; p; p = p->next) { - if (p->addr == addr) - break; - } - read_unlock(&vmlist_lock); - - if (!p) { - printk("iounmap: bad address %p\n", addr); + write_lock(&vmlist_lock); + p = __remove_vm_area((void *)(PAGE_MASK & (unsigned long __force)addr)); + if (!p) { + printk(KERN_WARNING "iounmap: bad address %p\n", addr); dump_stack(); - return; + goto out_unlock; } - /* Reset the direct mapping. Can block */ if ((p->flags >> 20) && p->phys_addr < virt_to_phys(high_memory) - 1) { change_page_attr(virt_to_page(__va(p->phys_addr)), p->size >> PAGE_SHIFT, PAGE_KERNEL); global_flush_tlb(); } - - /* Finally remove it */ - o = remove_vm_area((void *)addr); - BUG_ON(p != o || o == NULL); +out_unlock: + write_unlock(&vmlist_lock); kfree(p); } EXPORT_SYMBOL(iounmap); diff --git a/trunk/arch/i386/pci/Makefile b/trunk/arch/i386/pci/Makefile index 5461d4d5ea1e..ead6122dd06d 100644 --- a/trunk/arch/i386/pci/Makefile +++ b/trunk/arch/i386/pci/Makefile @@ -1,7 +1,7 @@ obj-y := i386.o obj-$(CONFIG_PCI_BIOS) += pcbios.o -obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o +obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o obj-$(CONFIG_PCI_DIRECT) += direct.o pci-y := fixup.o diff --git a/trunk/arch/i386/pci/common.c b/trunk/arch/i386/pci/common.c index f6bc48da4d2a..c96bea14b98f 100644 --- a/trunk/arch/i386/pci/common.c +++ b/trunk/arch/i386/pci/common.c @@ -132,7 +132,7 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum) } } - printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum); + printk("PCI: Probing PCI hardware (bus %02x)\n", busnum); return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, NULL); } @@ -144,7 +144,7 @@ static int __init pcibios_init(void) struct cpuinfo_x86 *c = &boot_cpu_data; if (!raw_pci_ops) { - printk(KERN_WARNING "PCI: System does not support PCI\n"); + printk("PCI: System does not support PCI\n"); return 0; } diff --git a/trunk/arch/i386/pci/direct.c b/trunk/arch/i386/pci/direct.c index e3ac502bf2fb..30b7e9b4f6a2 100644 --- a/trunk/arch/i386/pci/direct.c +++ b/trunk/arch/i386/pci/direct.c @@ -13,7 +13,7 @@ #define PCI_CONF1_ADDRESS(bus, devfn, reg) \ (0x80000000 | (bus << 16) | (devfn << 8) | (reg & ~3)) -int pci_conf1_read(unsigned int seg, unsigned int bus, +static int pci_conf1_read(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 *value) { unsigned long flags; @@ -42,7 +42,7 @@ int pci_conf1_read(unsigned int seg, unsigned int bus, return 0; } -int pci_conf1_write(unsigned int seg, unsigned int bus, +static int pci_conf1_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) { unsigned long flags; @@ -201,7 +201,7 @@ static int __init pci_sanity_check(struct pci_raw_ops *o) return 1; } - DBG(KERN_WARNING "PCI: Sanity check failed\n"); + DBG("PCI: Sanity check failed\n"); return 0; } diff --git a/trunk/arch/i386/pci/i386.c b/trunk/arch/i386/pci/i386.c index ed2c8c899bd3..6d6338500c3c 100644 --- a/trunk/arch/i386/pci/i386.c +++ b/trunk/arch/i386/pci/i386.c @@ -221,11 +221,6 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask) continue; r = &dev->resource[idx]; - if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM))) - continue; - if ((idx == PCI_ROM_RESOURCE) && - (!(r->flags & IORESOURCE_ROM_ENABLE))) - continue; if (!r->start && r->end) { printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev)); return -EINVAL; @@ -235,6 +230,8 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask) if (r->flags & IORESOURCE_MEM) cmd |= PCI_COMMAND_MEMORY; } + if (dev->resource[PCI_ROM_RESOURCE].start) + cmd |= PCI_COMMAND_MEMORY; if (cmd != old_cmd) { printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd); diff --git a/trunk/arch/i386/pci/mmconfig.c b/trunk/arch/i386/pci/mmconfig.c index 4bb4d4b0f73a..dfbf80cff834 100644 --- a/trunk/arch/i386/pci/mmconfig.c +++ b/trunk/arch/i386/pci/mmconfig.c @@ -19,25 +19,21 @@ /* The base address of the last MMCONFIG device accessed */ static u32 mmcfg_last_accessed_device; -static DECLARE_BITMAP(fallback_slots, 32); - /* * Functions for accessing PCI configuration space with MMCONFIG accesses */ -static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn) +static u32 get_base_addr(unsigned int seg, int bus) { int cfg_num = -1; struct acpi_table_mcfg_config *cfg; - if (seg == 0 && bus == 0 && - test_bit(PCI_SLOT(devfn), fallback_slots)) - return 0; - while (1) { ++cfg_num; if (cfg_num >= pci_mmcfg_config_num) { - /* Not found - fallback to type 1 */ - return 0; + /* something bad is going on, no cfg table is found. */ + /* so we fall back to the old way we used to do this */ + /* and just rely on the first entry to be correct. */ + return pci_mmcfg_config[0].base_address; } cfg = &pci_mmcfg_config[cfg_num]; if (cfg->pci_segment_group_number != seg) @@ -48,9 +44,9 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn) } } -static inline void pci_exp_set_dev_base(unsigned int base, int bus, int devfn) +static inline void pci_exp_set_dev_base(unsigned int seg, int bus, int devfn) { - u32 dev_base = base | (bus << 20) | (devfn << 12); + u32 dev_base = get_base_addr(seg, bus) | (bus << 20) | (devfn << 12); if (dev_base != mmcfg_last_accessed_device) { mmcfg_last_accessed_device = dev_base; set_fixmap_nocache(FIX_PCIE_MCFG, dev_base); @@ -61,18 +57,13 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 *value) { unsigned long flags; - u32 base; if (!value || (bus > 255) || (devfn > 255) || (reg > 4095)) return -EINVAL; - base = get_base_addr(seg, bus, devfn); - if (!base) - return pci_conf1_read(seg,bus,devfn,reg,len,value); - spin_lock_irqsave(&pci_config_lock, flags); - pci_exp_set_dev_base(base, bus, devfn); + pci_exp_set_dev_base(seg, bus, devfn); switch (len) { case 1: @@ -95,18 +86,13 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) { unsigned long flags; - u32 base; if ((bus > 255) || (devfn > 255) || (reg > 4095)) return -EINVAL; - base = get_base_addr(seg, bus, devfn); - if (!base) - return pci_conf1_write(seg,bus,devfn,reg,len,value); - spin_lock_irqsave(&pci_config_lock, flags); - pci_exp_set_dev_base(base, bus, devfn); + pci_exp_set_dev_base(seg, bus, devfn); switch (len) { case 1: @@ -130,37 +116,6 @@ static struct pci_raw_ops pci_mmcfg = { .write = pci_mmcfg_write, }; -/* K8 systems have some devices (typically in the builtin northbridge) - that are only accessible using type1 - Normally this can be expressed in the MCFG by not listing them - and assigning suitable _SEGs, but this isn't implemented in some BIOS. - Instead try to discover all devices on bus 0 that are unreachable using MM - and fallback for them. - We only do this for bus 0/seg 0 */ -static __init void unreachable_devices(void) -{ - int i; - unsigned long flags; - - for (i = 0; i < 32; i++) { - u32 val1; - u32 addr; - - pci_conf1_read(0, 0, PCI_DEVFN(i, 0), 0, 4, &val1); - if (val1 == 0xffffffff) - continue; - - /* Locking probably not needed, but safer */ - spin_lock_irqsave(&pci_config_lock, flags); - addr = get_base_addr(0, 0, PCI_DEVFN(i, 0)); - if (addr != 0) - pci_exp_set_dev_base(addr, 0, PCI_DEVFN(i, 0)); - if (addr == 0 || readl((u32 __iomem *)mmcfg_virt_addr) != val1) - set_bit(i, fallback_slots); - spin_unlock_irqrestore(&pci_config_lock, flags); - } -} - static int __init pci_mmcfg_init(void) { if ((pci_probe & PCI_PROBE_MMCONF) == 0) @@ -176,8 +131,6 @@ static int __init pci_mmcfg_init(void) raw_pci_ops = &pci_mmcfg; pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; - unreachable_devices(); - out: return 0; } diff --git a/trunk/arch/i386/pci/pci.h b/trunk/arch/i386/pci/pci.h index f550781ec310..127d53ad16be 100644 --- a/trunk/arch/i386/pci/pci.h +++ b/trunk/arch/i386/pci/pci.h @@ -74,10 +74,3 @@ extern spinlock_t pci_config_lock; extern int (*pcibios_enable_irq)(struct pci_dev *dev); extern void (*pcibios_disable_irq)(struct pci_dev *dev); - -extern int pci_conf1_write(unsigned int seg, unsigned int bus, - unsigned int devfn, int reg, int len, u32 value); -extern int pci_conf1_read(unsigned int seg, unsigned int bus, - unsigned int devfn, int reg, int len, u32 *value); - - diff --git a/trunk/arch/ia64/Kconfig b/trunk/arch/ia64/Kconfig index 199eeaf0f4e3..8796e12c56f3 100644 --- a/trunk/arch/ia64/Kconfig +++ b/trunk/arch/ia64/Kconfig @@ -58,10 +58,6 @@ config IA64_UNCACHED_ALLOCATOR bool select GENERIC_ALLOCATOR -config DMA_IS_DMA32 - bool - default y - choice prompt "System type" default IA64_GENERIC diff --git a/trunk/arch/ia64/configs/sn2_defconfig b/trunk/arch/ia64/configs/sn2_defconfig index ff8bb3770c9d..87cfd31a4a39 100644 --- a/trunk/arch/ia64/configs/sn2_defconfig +++ b/trunk/arch/ia64/configs/sn2_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc4 -# Fri Dec 2 10:33:48 2005 +# Linux kernel version: 2.6.13-rc6 +# Tue Aug 16 14:40:41 2005 # # @@ -16,7 +16,6 @@ CONFIG_INIT_ENV_ARG_LIMIT=32 # General setup # CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y @@ -27,7 +26,6 @@ CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set CONFIG_CPUSETS=y -CONFIG_INITRAMFS_SOURCE="" # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y @@ -57,30 +55,12 @@ CONFIG_OBSOLETE_MODPARM=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Processor type and features # CONFIG_IA64=y CONFIG_64BIT=y CONFIG_MMU=y -CONFIG_SWIOTLB=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_TIME_INTERPOLATION=y @@ -88,7 +68,6 @@ CONFIG_EFI=y CONFIG_GENERIC_IOMAP=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_IA64_UNCACHED_ALLOCATOR=y -CONFIG_ZONE_DMA_IS_DMA32=y # CONFIG_IA64_GENERIC is not set # CONFIG_IA64_DIG is not set # CONFIG_IA64_HP_ZX1 is not set @@ -108,12 +87,16 @@ CONFIG_HZ_250=y # CONFIG_HZ_1000 is not set CONFIG_HZ=250 CONFIG_IA64_L1_CACHE_SHIFT=7 +CONFIG_NUMA=y +CONFIG_VIRTUAL_MEM_MAP=y +CONFIG_HOLES_IN_ZONE=y +CONFIG_ARCH_DISCONTIGMEM_ENABLE=y # CONFIG_IA64_CYCLONE is not set CONFIG_IOSAPIC=y CONFIG_IA64_SGI_SN_XP=m -CONFIG_FORCE_MAX_ZONEORDER=17 +CONFIG_FORCE_MAX_ZONEORDER=18 CONFIG_SMP=y -CONFIG_NR_CPUS=1024 +CONFIG_NR_CPUS=512 # CONFIG_HOTPLUG_CPU is not set CONFIG_SCHED_SMT=y CONFIG_PREEMPT=y @@ -124,17 +107,7 @@ CONFIG_DISCONTIGMEM_MANUAL=y CONFIG_DISCONTIGMEM=y CONFIG_FLAT_NODE_MEM_MAP=y CONFIG_NEED_MULTIPLE_NODES=y -# CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_DISCONTIGMEM_ENABLE=y -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y -CONFIG_NUMA=y -CONFIG_VIRTUAL_MEM_MAP=y -CONFIG_HOLES_IN_ZONE=y -CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y +CONFIG_HAVE_DEC_LOCK=y CONFIG_IA32_SUPPORT=y CONFIG_COMPAT=y CONFIG_IA64_MCA_RECOVERY=y @@ -153,28 +126,20 @@ CONFIG_BINFMT_ELF=y # Power management and ACPI # CONFIG_PM=y -# CONFIG_PM_LEGACY is not set -# CONFIG_PM_DEBUG is not set +CONFIG_ACPI=y # # ACPI (Advanced Configuration and Power Interface) Support # -CONFIG_ACPI=y # CONFIG_ACPI_BUTTON is not set # CONFIG_ACPI_FAN is not set # CONFIG_ACPI_PROCESSOR is not set CONFIG_ACPI_NUMA=y -CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_POWER=y CONFIG_ACPI_SYSTEM=y # CONFIG_ACPI_CONTAINER is not set -# -# CPU Frequency scaling -# -# CONFIG_CPU_FREQ is not set - # # Bus options (PCI, PCMCIA) # @@ -182,6 +147,7 @@ CONFIG_PCI=y CONFIG_PCI_DOMAINS=y # CONFIG_PCI_MSI is not set CONFIG_PCI_LEGACY_PROC=y +CONFIG_PCI_NAMES=y # CONFIG_PCI_DEBUG is not set # @@ -225,8 +191,8 @@ CONFIG_SYN_COOKIES=y # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set -CONFIG_INET_DIAG=m -CONFIG_INET_TCP_DIAG=m +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_BIC=y CONFIG_IPV6=m @@ -238,11 +204,6 @@ CONFIG_IPV6=m # CONFIG_IPV6_TUNNEL is not set # CONFIG_NETFILTER is not set -# -# DCCP Configuration (EXPERIMENTAL) -# -# CONFIG_IP_DCCP is not set - # # SCTP Configuration (EXPERIMENTAL) # @@ -259,11 +220,8 @@ CONFIG_IPV6=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -272,7 +230,6 @@ CONFIG_IPV6=m # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set -# CONFIG_IEEE80211 is not set # # Device Drivers @@ -286,11 +243,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set -# -# Connector - unified userspace <-> kernelspace linker -# -# CONFIG_CONNECTOR is not set - # # Memory Technology Devices (MTD) # @@ -323,7 +275,16 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -388,7 +349,6 @@ CONFIG_IDEDMA_AUTO=y # # SCSI device support # -# CONFIG_RAID_ATTRS is not set CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y @@ -415,13 +375,11 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_FC_ATTRS=y -CONFIG_SCSI_ISCSI_ATTRS=m -CONFIG_SCSI_SAS_ATTRS=y +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -431,19 +389,15 @@ CONFIG_ISCSI_TCP=m # CONFIG_SCSI_AIC79XX is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set CONFIG_SCSI_SATA=y # CONFIG_SCSI_SATA_AHCI is not set # CONFIG_SCSI_SATA_SVW is not set # CONFIG_SCSI_ATA_PIIX is not set -# CONFIG_SCSI_SATA_MV is not set # CONFIG_SCSI_SATA_NV is not set -# CONFIG_SCSI_PDC_ADMA is not set -# CONFIG_SCSI_SATA_QSTOR is not set # CONFIG_SCSI_SATA_PROMISE is not set +# CONFIG_SCSI_SATA_QSTOR is not set # CONFIG_SCSI_SATA_SX4 is not set # CONFIG_SCSI_SATA_SIL is not set -# CONFIG_SCSI_SATA_SIL24 is not set # CONFIG_SCSI_SATA_SIS is not set # CONFIG_SCSI_SATA_ULI is not set # CONFIG_SCSI_SATA_VIA is not set @@ -457,6 +411,7 @@ CONFIG_SCSI_SATA_VITESSE=y # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_FC is not set CONFIG_SCSI_QLOGIC_1280=y +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set CONFIG_SCSI_QLA22XX=y @@ -496,7 +451,6 @@ CONFIG_DM_MULTIPATH_EMC=m CONFIG_FUSION=y CONFIG_FUSION_SPI=y CONFIG_FUSION_FC=y -CONFIG_FUSION_SAS=y CONFIG_FUSION_MAX_SGE=128 CONFIG_FUSION_CTL=m @@ -524,10 +478,6 @@ CONFIG_NETDEVICES=y # # CONFIG_ARCNET is not set -# -# PHY device support -# - # # Ethernet (10 or 100Mbit) # @@ -543,7 +493,6 @@ CONFIG_NETDEVICES=y # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set -# CONFIG_SIS190 is not set # CONFIG_SKGE is not set # CONFIG_SK98LIN is not set CONFIG_TIGON3=y @@ -552,10 +501,10 @@ CONFIG_TIGON3=y # # Ethernet (10000 Mbit) # -CONFIG_CHELSIO_T1=m # CONFIG_IXGB is not set CONFIG_S2IO=m # CONFIG_S2IO_NAPI is not set +# CONFIG_2BUFF_MODE is not set # # Token Ring devices @@ -634,7 +583,6 @@ CONFIG_HW_CONSOLE=y CONFIG_SERIAL_NONSTANDARD=y # CONFIG_ROCKETPORT is not set # CONFIG_CYCLADES is not set -# CONFIG_DIGIEPCA is not set # CONFIG_MOXA_SMARTIO is not set # CONFIG_ISI is not set # CONFIG_SYNCLINKMP is not set @@ -681,8 +629,7 @@ CONFIG_EFI_RTC=y # # Ftape, the floppy tape device driver # -CONFIG_AGP=y -CONFIG_AGP_SGI_TIOCA=y +# CONFIG_AGP is not set # CONFIG_DRM is not set CONFIG_RAW_DRIVER=m # CONFIG_HPET is not set @@ -694,12 +641,12 @@ CONFIG_MMTIMER=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support # # CONFIG_I2C is not set +# CONFIG_I2C_SENSOR is not set # # Dallas's 1-wire bus @@ -710,16 +657,11 @@ CONFIG_MMTIMER=y # Hardware Monitoring support # # CONFIG_HWMON is not set -# CONFIG_HWMON_VID is not set # # Misc devices # -# -# Multimedia Capabilities Port drivers -# - # # Multimedia devices # @@ -779,15 +721,12 @@ CONFIG_USB_UHCI_HCD=m # # USB Device Class drivers # +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # # CONFIG_USB_STORAGE is not set @@ -812,11 +751,9 @@ CONFIG_USB_HIDINPUT=y # CONFIG_USB_MTOUCH is not set # CONFIG_USB_ITMTOUCH is not set # CONFIG_USB_EGALAX is not set -# CONFIG_USB_YEALINK is not set # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set # CONFIG_USB_KEYSPAN_REMOTE is not set -# CONFIG_USB_APPLETOUCH is not set # # USB Imaging devices @@ -887,13 +824,11 @@ CONFIG_USB_MON=y # InfiniBand support # CONFIG_INFINIBAND=m -# CONFIG_INFINIBAND_USER_MAD is not set -CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_USER_VERBS=m CONFIG_INFINIBAND_MTHCA=m # CONFIG_INFINIBAND_MTHCA_DEBUG is not set CONFIG_INFINIBAND_IPOIB=m # CONFIG_INFINIBAND_IPOIB_DEBUG is not set -CONFIG_INFINIBAND_SRP=m # # SN Devices @@ -923,12 +858,16 @@ CONFIG_REISERFS_FS_POSIX_ACL=y CONFIG_REISERFS_FS_SECURITY=y # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y + +# +# XFS support +# CONFIG_XFS_FS=y CONFIG_XFS_EXPORT=y +CONFIG_XFS_RT=y CONFIG_XFS_QUOTA=y # CONFIG_XFS_SECURITY is not set CONFIG_XFS_POSIX_ACL=y -CONFIG_XFS_RT=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set CONFIG_INOTIFY=y @@ -939,7 +878,6 @@ CONFIG_QUOTACTL=y CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m -CONFIG_FUSE_FS=m # # CD-ROM/DVD Filesystems @@ -966,11 +904,13 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y +# CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y +CONFIG_TMPFS_XATTR=y +CONFIG_TMPFS_SECURITY=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y -CONFIG_RELAYFS_FS=m # # Miscellaneous filesystems @@ -1019,7 +959,6 @@ CONFIG_CIFS=m # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set -# CONFIG_9P_FS is not set # # Partition Types @@ -1089,21 +1028,18 @@ CONFIG_NLS_UTF8=y # Library routines # # CONFIG_CRC_CCITT is not set -CONFIG_CRC16=m CONFIG_CRC32=y -CONFIG_LIBCRC32C=m +# CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=m CONFIG_ZLIB_DEFLATE=m CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_PENDING_IRQ=y # -# Instrumentation Support +# Profiling support # # CONFIG_PROFILING is not set -# CONFIG_KPROBES is not set # # Kernel hacking @@ -1112,7 +1048,6 @@ CONFIG_GENERIC_PENDING_IRQ=y CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y CONFIG_LOG_BUF_SHIFT=20 -CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set CONFIG_DEBUG_PREEMPT=y @@ -1121,8 +1056,7 @@ CONFIG_DEBUG_PREEMPT=y # CONFIG_DEBUG_KOBJECT is not set CONFIG_DEBUG_INFO=y # CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_KPROBES is not set CONFIG_IA64_GRANULE_16MB=y # CONFIG_IA64_GRANULE_64MB is not set # CONFIG_IA64_PRINT_HAZARDS is not set @@ -1163,7 +1097,7 @@ CONFIG_CRYPTO_DES=m # CONFIG_CRYPTO_ANUBIS is not set CONFIG_CRYPTO_DEFLATE=m # CONFIG_CRYPTO_MICHAEL_MIC is not set -CONFIG_CRYPTO_CRC32C=m +# CONFIG_CRYPTO_CRC32C is not set # CONFIG_CRYPTO_TEST is not set # diff --git a/trunk/arch/ia64/configs/tiger_defconfig b/trunk/arch/ia64/configs/tiger_defconfig index b1e8f09e9fd5..9bc8bcafc905 100644 --- a/trunk/arch/ia64/configs/tiger_defconfig +++ b/trunk/arch/ia64/configs/tiger_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc4 -# Fri Dec 2 16:06:32 2005 +# Linux kernel version: 2.6.14-rc1 +# Wed Sep 14 15:17:57 2005 # # @@ -58,37 +58,18 @@ CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Processor type and features # CONFIG_IA64=y CONFIG_64BIT=y CONFIG_MMU=y -CONFIG_SWIOTLB=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_TIME_INTERPOLATION=y CONFIG_EFI=y CONFIG_GENERIC_IOMAP=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y -CONFIG_ZONE_DMA_IS_DMA32=y # CONFIG_IA64_GENERIC is not set CONFIG_IA64_DIG=y # CONFIG_IA64_HP_ZX1 is not set @@ -101,16 +82,18 @@ CONFIG_MCKINLEY=y # CONFIG_IA64_PAGE_SIZE_8KB is not set CONFIG_IA64_PAGE_SIZE_16KB=y # CONFIG_IA64_PAGE_SIZE_64KB is not set -CONFIG_PGTABLE_3=y -# CONFIG_PGTABLE_4 is not set # CONFIG_HZ_100 is not set CONFIG_HZ_250=y # CONFIG_HZ_1000 is not set CONFIG_HZ=250 CONFIG_IA64_L1_CACHE_SHIFT=7 +# CONFIG_NUMA is not set +CONFIG_VIRTUAL_MEM_MAP=y +CONFIG_HOLES_IN_ZONE=y CONFIG_IA64_CYCLONE=y CONFIG_IOSAPIC=y -CONFIG_FORCE_MAX_ZONEORDER=17 +# CONFIG_IA64_SGI_SN_XP is not set +CONFIG_FORCE_MAX_ZONEORDER=18 CONFIG_SMP=y CONFIG_NR_CPUS=4 CONFIG_HOTPLUG_CPU=y @@ -123,13 +106,7 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_DISCONTIGMEM_ENABLE=y -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_VIRTUAL_MEM_MAP=y -CONFIG_HOLES_IN_ZONE=y +CONFIG_HAVE_DEC_LOCK=y CONFIG_IA32_SUPPORT=y CONFIG_COMPAT=y CONFIG_IA64_MCA_RECOVERY=y @@ -141,6 +118,7 @@ CONFIG_IA64_PALINFO=y # CONFIG_EFI_VARS=y CONFIG_EFI_PCDP=y +# CONFIG_DELL_RBU is not set CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m @@ -148,7 +126,6 @@ CONFIG_BINFMT_MISC=m # Power management and ACPI # CONFIG_PM=y -CONFIG_PM_LEGACY=y # CONFIG_PM_DEBUG is not set # @@ -249,16 +226,14 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing # # CONFIG_NET_PKTGEN is not set +# CONFIG_NETFILTER_NETLINK is not set # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set @@ -320,6 +295,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -417,7 +400,6 @@ CONFIG_SCSI_FC_ATTRS=y # # SCSI low-level drivers # -# CONFIG_ISCSI_TCP is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -427,7 +409,6 @@ CONFIG_SCSI_FC_ATTRS=y # CONFIG_SCSI_AIC79XX is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set @@ -443,6 +424,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 CONFIG_SCSI_QLOGIC_FC=y # CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set CONFIG_SCSI_QLOGIC_1280=y +# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y CONFIG_SCSI_QLA21XX=m CONFIG_SCSI_QLA22XX=m @@ -481,7 +463,6 @@ CONFIG_DM_ZERO=m CONFIG_FUSION=y CONFIG_FUSION_SPI=y CONFIG_FUSION_FC=y -# CONFIG_FUSION_SAS is not set CONFIG_FUSION_MAX_SGE=128 CONFIG_FUSION_CTL=y @@ -522,7 +503,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=m # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -747,7 +727,6 @@ CONFIG_MAX_RAW_DEVS=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -833,15 +812,12 @@ CONFIG_USB_UHCI_HCD=y # # USB Device Class drivers # +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set @@ -1147,10 +1123,9 @@ CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_PENDING_IRQ=y # -# Instrumentation Support +# Profiling support # # CONFIG_PROFILING is not set -# CONFIG_KPROBES is not set # # Kernel hacking @@ -1167,8 +1142,7 @@ CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_KPROBES is not set CONFIG_IA64_GRANULE_16MB=y # CONFIG_IA64_GRANULE_64MB is not set # CONFIG_IA64_PRINT_HAZARDS is not set diff --git a/trunk/arch/ia64/ia32/binfmt_elf32.c b/trunk/arch/ia64/ia32/binfmt_elf32.c index 4e7a6a1ec6c7..a7280d9f6c16 100644 --- a/trunk/arch/ia64/ia32/binfmt_elf32.c +++ b/trunk/arch/ia64/ia32/binfmt_elf32.c @@ -261,6 +261,8 @@ elf32_set_personality (void) { set_personality(PER_LINUX32); current->thread.map_base = IA32_PAGE_OFFSET/3; + current->thread.task_size = IA32_PAGE_OFFSET; /* use what Linux/x86 uses... */ + set_fs(USER_DS); /* set addr limit for new TASK_SIZE */ } static unsigned long diff --git a/trunk/arch/ia64/ia32/ia32priv.h b/trunk/arch/ia64/ia32/ia32priv.h index 68ceb4e690c7..e3e9290e3ff2 100644 --- a/trunk/arch/ia64/ia32/ia32priv.h +++ b/trunk/arch/ia64/ia32/ia32priv.h @@ -305,6 +305,7 @@ struct old_linux32_dirent { #define ELF_DATA ELFDATA2LSB #define ELF_ARCH EM_386 +#define IA32_PAGE_OFFSET 0xc0000000 #define IA32_STACK_TOP IA32_PAGE_OFFSET #define IA32_GATE_OFFSET IA32_PAGE_OFFSET #define IA32_GATE_END IA32_PAGE_OFFSET + PAGE_SIZE diff --git a/trunk/arch/ia64/kernel/ia64_ksyms.c b/trunk/arch/ia64/kernel/ia64_ksyms.c index 5db9d3bcbbcb..01572814abe4 100644 --- a/trunk/arch/ia64/kernel/ia64_ksyms.c +++ b/trunk/arch/ia64/kernel/ia64_ksyms.c @@ -42,7 +42,6 @@ EXPORT_SYMBOL(clear_page); #ifdef CONFIG_VIRTUAL_MEM_MAP #include -EXPORT_SYMBOL(min_low_pfn); /* defined by bootmem.c, but not exported by generic code */ EXPORT_SYMBOL(max_low_pfn); /* defined by bootmem.c, but not exported by generic code */ #endif diff --git a/trunk/arch/ia64/kernel/ivt.S b/trunk/arch/ia64/kernel/ivt.S index 301f2e9d262e..e06f21f60dc5 100644 --- a/trunk/arch/ia64/kernel/ivt.S +++ b/trunk/arch/ia64/kernel/ivt.S @@ -91,17 +91,16 @@ ENTRY(vhpt_miss) * (the "original") TLB miss, which may either be caused by an instruction * fetch or a data access (or non-access). * - * What we do here is normal TLB miss handing for the _original_ miss, - * followed by inserting the TLB entry for the virtual page table page - * that the VHPT walker was attempting to access. The latter gets - * inserted as long as page table entry above pte level have valid - * mappings for the faulting address. The TLB entry for the original - * miss gets inserted only if the pte entry indicates that the page is - * present. + * What we do here is normal TLB miss handing for the _original_ miss, followed + * by inserting the TLB entry for the virtual page table page that the VHPT + * walker was attempting to access. The latter gets inserted as long + * as both L1 and L2 have valid mappings for the faulting address. + * The TLB entry for the original miss gets inserted only if + * the L3 entry indicates that the page is present. * * do_page_fault gets invoked in the following cases: * - the faulting virtual address uses unimplemented address bits - * - the faulting virtual address has no valid page table mapping + * - the faulting virtual address has no L1, L2, or L3 mapping */ mov r16=cr.ifa // get address that caused the TLB miss #ifdef CONFIG_HUGETLB_PAGE @@ -127,7 +126,7 @@ ENTRY(vhpt_miss) #endif ;; cmp.eq p6,p7=5,r17 // is IFA pointing into to region 5? - shr.u r18=r22,PGDIR_SHIFT // get bottom portion of pgd index bit + shr.u r18=r22,PGDIR_SHIFT // get bits 33-63 of the faulting address ;; (p7) dep r17=r17,r19,(PAGE_SHIFT-3),3 // put region number bits in place @@ -138,38 +137,38 @@ ENTRY(vhpt_miss) (p6) shr.u r21=r21,PGDIR_SHIFT+PAGE_SHIFT (p7) shr.u r21=r21,PGDIR_SHIFT+PAGE_SHIFT-3 ;; -(p6) dep r17=r18,r19,3,(PAGE_SHIFT-3) // r17=pgd_offset for region 5 -(p7) dep r17=r18,r17,3,(PAGE_SHIFT-6) // r17=pgd_offset for region[0-4] +(p6) dep r17=r18,r19,3,(PAGE_SHIFT-3) // r17=PTA + IFA(33,42)*8 +(p7) dep r17=r18,r17,3,(PAGE_SHIFT-6) // r17=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8) cmp.eq p7,p6=0,r21 // unused address bits all zeroes? #ifdef CONFIG_PGTABLE_4 - shr.u r28=r22,PUD_SHIFT // shift pud index into position + shr.u r28=r22,PUD_SHIFT // shift L2 index into position #else - shr.u r18=r22,PMD_SHIFT // shift pmd index into position + shr.u r18=r22,PMD_SHIFT // shift L3 index into position #endif ;; - ld8 r17=[r17] // get *pgd (may be 0) + ld8 r17=[r17] // fetch the L1 entry (may be 0) ;; -(p7) cmp.eq p6,p7=r17,r0 // was pgd_present(*pgd) == NULL? +(p7) cmp.eq p6,p7=r17,r0 // was L1 entry NULL? #ifdef CONFIG_PGTABLE_4 - dep r28=r28,r17,3,(PAGE_SHIFT-3) // r28=pud_offset(pgd,addr) + dep r28=r28,r17,3,(PAGE_SHIFT-3) // compute address of L2 page table entry ;; - shr.u r18=r22,PMD_SHIFT // shift pmd index into position -(p7) ld8 r29=[r28] // get *pud (may be 0) + shr.u r18=r22,PMD_SHIFT // shift L3 index into position +(p7) ld8 r29=[r28] // fetch the L2 entry (may be 0) ;; -(p7) cmp.eq.or.andcm p6,p7=r29,r0 // was pud_present(*pud) == NULL? - dep r17=r18,r29,3,(PAGE_SHIFT-3) // r17=pmd_offset(pud,addr) +(p7) cmp.eq.or.andcm p6,p7=r29,r0 // was L2 entry NULL? + dep r17=r18,r29,3,(PAGE_SHIFT-3) // compute address of L3 page table entry #else - dep r17=r18,r17,3,(PAGE_SHIFT-3) // r17=pmd_offset(pgd,addr) + dep r17=r18,r17,3,(PAGE_SHIFT-3) // compute address of L3 page table entry #endif ;; -(p7) ld8 r20=[r17] // get *pmd (may be 0) - shr.u r19=r22,PAGE_SHIFT // shift pte index into position +(p7) ld8 r20=[r17] // fetch the L3 entry (may be 0) + shr.u r19=r22,PAGE_SHIFT // shift L4 index into position ;; -(p7) cmp.eq.or.andcm p6,p7=r20,r0 // was pmd_present(*pmd) == NULL? - dep r21=r19,r20,3,(PAGE_SHIFT-3) // r21=pte_offset(pmd,addr) +(p7) cmp.eq.or.andcm p6,p7=r20,r0 // was L3 entry NULL? + dep r21=r19,r20,3,(PAGE_SHIFT-3) // compute address of L4 page table entry ;; -(p7) ld8 r18=[r21] // read *pte - mov r19=cr.isr // cr.isr bit 32 tells us if this is an insn miss +(p7) ld8 r18=[r21] // read the L4 PTE + mov r19=cr.isr // cr.isr bit 0 tells us if this is an insn miss ;; (p7) tbit.z p6,p7=r18,_PAGE_P_BIT // page present bit cleared? mov r22=cr.iha // get the VHPT address that caused the TLB miss @@ -203,33 +202,25 @@ ENTRY(vhpt_miss) dv_serialize_data /* - * Re-check pagetable entry. If they changed, we may have received a ptc.g + * Re-check L2 and L3 pagetable. If they changed, we may have received a ptc.g * between reading the pagetable and the "itc". If so, flush the entry we - * inserted and retry. At this point, we have: - * - * r28 = equivalent of pud_offset(pgd, ifa) - * r17 = equivalent of pmd_offset(pud, ifa) - * r21 = equivalent of pte_offset(pmd, ifa) - * - * r29 = *pud - * r20 = *pmd - * r18 = *pte + * inserted and retry. */ - ld8 r25=[r21] // read *pte again - ld8 r26=[r17] // read *pmd again + ld8 r25=[r21] // read L4 entry again + ld8 r26=[r17] // read L3 PTE again #ifdef CONFIG_PGTABLE_4 - ld8 r19=[r28] // read *pud again + ld8 r18=[r28] // read L2 entry again #endif cmp.ne p6,p7=r0,r0 ;; - cmp.ne.or.andcm p6,p7=r26,r20 // did *pmd change + cmp.ne.or.andcm p6,p7=r26,r20 // did L3 entry change #ifdef CONFIG_PGTABLE_4 - cmp.ne.or.andcm p6,p7=r19,r29 // did *pud change + cmp.ne.or.andcm p6,p7=r29,r18 // did L4 PTE change #endif mov r27=PAGE_SHIFT<<2 ;; (p6) ptc.l r22,r27 // purge PTE page translation -(p7) cmp.ne.or.andcm p6,p7=r25,r18 // did *pte change +(p7) cmp.ne.or.andcm p6,p7=r25,r18 // did L4 PTE change ;; (p6) ptc.l r16,r27 // purge translation #endif @@ -244,19 +235,19 @@ END(vhpt_miss) ENTRY(itlb_miss) DBG_FAULT(1) /* - * The ITLB handler accesses the PTE via the virtually mapped linear + * The ITLB handler accesses the L3 PTE via the virtually mapped linear * page table. If a nested TLB miss occurs, we switch into physical - * mode, walk the page table, and then re-execute the PTE read and - * go on normally after that. + * mode, walk the page table, and then re-execute the L3 PTE read + * and go on normally after that. */ mov r16=cr.ifa // get virtual address mov r29=b0 // save b0 mov r31=pr // save predicates .itlb_fault: - mov r17=cr.iha // get virtual address of PTE + mov r17=cr.iha // get virtual address of L3 PTE movl r30=1f // load nested fault continuation point ;; -1: ld8 r18=[r17] // read *pte +1: ld8 r18=[r17] // read L3 PTE ;; mov b0=r29 tbit.z p6,p0=r18,_PAGE_P_BIT // page present bit cleared? @@ -271,7 +262,7 @@ ENTRY(itlb_miss) */ dv_serialize_data - ld8 r19=[r17] // read *pte again and see if same + ld8 r19=[r17] // read L3 PTE again and see if same mov r20=PAGE_SHIFT<<2 // setup page size for purge ;; cmp.ne p7,p0=r18,r19 @@ -288,19 +279,19 @@ END(itlb_miss) ENTRY(dtlb_miss) DBG_FAULT(2) /* - * The DTLB handler accesses the PTE via the virtually mapped linear + * The DTLB handler accesses the L3 PTE via the virtually mapped linear * page table. If a nested TLB miss occurs, we switch into physical - * mode, walk the page table, and then re-execute the PTE read and - * go on normally after that. + * mode, walk the page table, and then re-execute the L3 PTE read + * and go on normally after that. */ mov r16=cr.ifa // get virtual address mov r29=b0 // save b0 mov r31=pr // save predicates dtlb_fault: - mov r17=cr.iha // get virtual address of PTE + mov r17=cr.iha // get virtual address of L3 PTE movl r30=1f // load nested fault continuation point ;; -1: ld8 r18=[r17] // read *pte +1: ld8 r18=[r17] // read L3 PTE ;; mov b0=r29 tbit.z p6,p0=r18,_PAGE_P_BIT // page present bit cleared? @@ -315,7 +306,7 @@ dtlb_fault: */ dv_serialize_data - ld8 r19=[r17] // read *pte again and see if same + ld8 r19=[r17] // read L3 PTE again and see if same mov r20=PAGE_SHIFT<<2 // setup page size for purge ;; cmp.ne p7,p0=r18,r19 @@ -429,7 +420,7 @@ ENTRY(nested_dtlb_miss) * r30: continuation address * r31: saved pr * - * Output: r17: physical address of PTE of faulting address + * Output: r17: physical address of L3 PTE of faulting address * r29: saved b0 * r30: continuation address * r31: saved pr @@ -459,33 +450,33 @@ ENTRY(nested_dtlb_miss) (p6) shr.u r21=r21,PGDIR_SHIFT+PAGE_SHIFT (p7) shr.u r21=r21,PGDIR_SHIFT+PAGE_SHIFT-3 ;; -(p6) dep r17=r18,r19,3,(PAGE_SHIFT-3) // r17=pgd_offset for region 5 -(p7) dep r17=r18,r17,3,(PAGE_SHIFT-6) // r17=pgd_offset for region[0-4] +(p6) dep r17=r18,r19,3,(PAGE_SHIFT-3) // r17=PTA + IFA(33,42)*8 +(p7) dep r17=r18,r17,3,(PAGE_SHIFT-6) // r17=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8) cmp.eq p7,p6=0,r21 // unused address bits all zeroes? #ifdef CONFIG_PGTABLE_4 - shr.u r18=r22,PUD_SHIFT // shift pud index into position + shr.u r18=r22,PUD_SHIFT // shift L2 index into position #else - shr.u r18=r22,PMD_SHIFT // shift pmd index into position + shr.u r18=r22,PMD_SHIFT // shift L3 index into position #endif ;; - ld8 r17=[r17] // get *pgd (may be 0) + ld8 r17=[r17] // fetch the L1 entry (may be 0) ;; -(p7) cmp.eq p6,p7=r17,r0 // was pgd_present(*pgd) == NULL? - dep r17=r18,r17,3,(PAGE_SHIFT-3) // r17=p[u|m]d_offset(pgd,addr) +(p7) cmp.eq p6,p7=r17,r0 // was L1 entry NULL? + dep r17=r18,r17,3,(PAGE_SHIFT-3) // compute address of L2 page table entry ;; #ifdef CONFIG_PGTABLE_4 -(p7) ld8 r17=[r17] // get *pud (may be 0) - shr.u r18=r22,PMD_SHIFT // shift pmd index into position +(p7) ld8 r17=[r17] // fetch the L2 entry (may be 0) + shr.u r18=r22,PMD_SHIFT // shift L3 index into position ;; -(p7) cmp.eq.or.andcm p6,p7=r17,r0 // was pud_present(*pud) == NULL? - dep r17=r18,r17,3,(PAGE_SHIFT-3) // r17=pmd_offset(pud,addr) +(p7) cmp.eq.or.andcm p6,p7=r17,r0 // was L2 entry NULL? + dep r17=r18,r17,3,(PAGE_SHIFT-3) // compute address of L2 page table entry ;; #endif -(p7) ld8 r17=[r17] // get *pmd (may be 0) - shr.u r19=r22,PAGE_SHIFT // shift pte index into position +(p7) ld8 r17=[r17] // fetch the L3 entry (may be 0) + shr.u r19=r22,PAGE_SHIFT // shift L4 index into position ;; -(p7) cmp.eq.or.andcm p6,p7=r17,r0 // was pmd_present(*pmd) == NULL? - dep r17=r19,r17,3,(PAGE_SHIFT-3) // r17=pte_offset(pmd,addr); +(p7) cmp.eq.or.andcm p6,p7=r17,r0 // was L3 entry NULL? + dep r17=r19,r17,3,(PAGE_SHIFT-3) // compute address of L4 page table entry (p6) br.cond.spnt page_fault mov b0=r30 br.sptk.many b0 // return to continuation point diff --git a/trunk/arch/ia64/kernel/kprobes.c b/trunk/arch/ia64/kernel/kprobes.c index 89a70400c4f6..801eeaeaf3de 100644 --- a/trunk/arch/ia64/kernel/kprobes.c +++ b/trunk/arch/ia64/kernel/kprobes.c @@ -630,7 +630,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args) */ save_previous_kprobe(kcb); set_current_kprobe(p, kcb); - kprobes_inc_nmissed_count(p); + p->nmissed++; prepare_ss(p, regs); kcb->kprobe_status = KPROBE_REENTER; return 1; @@ -740,7 +740,7 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, switch(val) { case DIE_BREAK: /* err is break number from ia64_bad_break() */ - if (args->err == 0x80200 || args->err == 0x80300 || args->err == 0) + if (args->err == 0x80200 || args->err == 0x80300) if (pre_kprobes_handler(args)) ret = NOTIFY_STOP; break; diff --git a/trunk/arch/ia64/kernel/process.c b/trunk/arch/ia64/kernel/process.c index e9904c74d2ba..e92ea64d8040 100644 --- a/trunk/arch/ia64/kernel/process.c +++ b/trunk/arch/ia64/kernel/process.c @@ -202,9 +202,12 @@ default_idle (void) { local_irq_enable(); while (!need_resched()) { - if (can_do_pal_halt) - safe_halt(); - else + if (can_do_pal_halt) { + local_irq_disable(); + if (!need_resched()) + safe_halt(); + local_irq_enable(); + } else cpu_relax(); } } @@ -269,14 +272,10 @@ cpu_idle (void) { void (*mark_idle)(int) = ia64_mark_idle; int cpu = smp_processor_id(); + set_thread_flag(TIF_POLLING_NRFLAG); /* endless idle loop with no priority at all */ while (1) { - if (can_do_pal_halt) - clear_thread_flag(TIF_POLLING_NRFLAG); - else - set_thread_flag(TIF_POLLING_NRFLAG); - if (!need_resched()) { void (*idle)(void); #ifdef CONFIG_SMP @@ -718,16 +717,18 @@ kernel_thread_helper (int (*fn)(void *), void *arg) void flush_thread (void) { + /* + * Remove function-return probe instances associated with this task + * and put them back on the free list. Do not insert an exit probe for + * this function, it will be disabled by kprobe_flush_task if you do. + */ + kprobe_flush_task(current); + /* drop floating-point and debug-register state if it exists: */ current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID); ia64_drop_fpu(current); -#ifdef CONFIG_IA32_SUPPORT - if (IS_IA32_PROCESS(ia64_task_regs(current))) { + if (IS_IA32_PROCESS(ia64_task_regs(current))) ia32_drop_partial_page_list(current); - current->thread.task_size = IA32_PAGE_OFFSET; - set_fs(USER_DS); - } -#endif } /* diff --git a/trunk/arch/ia64/kernel/salinfo.c b/trunk/arch/ia64/kernel/salinfo.c index 1461dc660b43..ca68e6e44a72 100644 --- a/trunk/arch/ia64/kernel/salinfo.c +++ b/trunk/arch/ia64/kernel/salinfo.c @@ -293,7 +293,7 @@ salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t if (file->f_flags & O_NONBLOCK) return -EAGAIN; if (down_interruptible(&data->sem)) - return -EINTR; + return -ERESTARTSYS; } n = data->cpu_check; diff --git a/trunk/arch/ia64/kernel/setup.c b/trunk/arch/ia64/kernel/setup.c index 088e5dded8dc..5add0bcf87a7 100644 --- a/trunk/arch/ia64/kernel/setup.c +++ b/trunk/arch/ia64/kernel/setup.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -518,7 +517,6 @@ show_cpuinfo (struct seq_file *m, void *v) char family[32], features[128], *cp, sep; struct cpuinfo_ia64 *c = v; unsigned long mask; - unsigned int proc_freq; int i; mask = c->features; @@ -551,10 +549,6 @@ show_cpuinfo (struct seq_file *m, void *v) sprintf(cp, " 0x%lx", mask); } - proc_freq = cpufreq_quick_get(cpunum); - if (!proc_freq) - proc_freq = c->proc_freq / 1000; - seq_printf(m, "processor : %d\n" "vendor : %s\n" @@ -571,7 +565,7 @@ show_cpuinfo (struct seq_file *m, void *v) "BogoMIPS : %lu.%02lu\n", cpunum, c->vendor, family, c->model, c->revision, c->archrev, features, c->ppn, c->number, - proc_freq / 1000, proc_freq % 1000, + c->proc_freq / 1000000, c->proc_freq % 1000000, c->itc_freq / 1000000, c->itc_freq % 1000000, lpj*HZ/500000, (lpj*HZ/5000) % 100); #ifdef CONFIG_SMP diff --git a/trunk/arch/ia64/kernel/time.c b/trunk/arch/ia64/kernel/time.c index 028a2b95936c..5b7e736f3b49 100644 --- a/trunk/arch/ia64/kernel/time.c +++ b/trunk/arch/ia64/kernel/time.c @@ -249,32 +249,3 @@ time_init (void) */ set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); } - -#define SMALLUSECS 100 - -void -udelay (unsigned long usecs) -{ - unsigned long start; - unsigned long cycles; - unsigned long smallusecs; - - /* - * Execute the non-preemptible delay loop (because the ITC might - * not be synchronized between CPUS) in relatively short time - * chunks, allowing preemption between the chunks. - */ - while (usecs > 0) { - smallusecs = (usecs > SMALLUSECS) ? SMALLUSECS : usecs; - preempt_disable(); - cycles = smallusecs*local_cpu_data->cyc_per_usec; - start = ia64_get_itc(); - - while (ia64_get_itc() - start < cycles) - cpu_relax(); - - preempt_enable(); - usecs -= smallusecs; - } -} -EXPORT_SYMBOL(udelay); diff --git a/trunk/arch/ia64/kernel/traps.c b/trunk/arch/ia64/kernel/traps.c index d3e0ecb56d62..fba5fdd1f968 100644 --- a/trunk/arch/ia64/kernel/traps.c +++ b/trunk/arch/ia64/kernel/traps.c @@ -132,6 +132,24 @@ __kprobes ia64_bad_break (unsigned long break_num, struct pt_regs *regs) siginfo_t siginfo; int sig, code; + /* break.b always sets cr.iim to 0, which causes problems for + * debuggers. Get the real break number from the original instruction, + * but only for kernel code. User space break.b is left alone, to + * preserve the existing behaviour. All break codings have the same + * format, so there is no need to check the slot type. + */ + if (break_num == 0 && !user_mode(regs)) { + struct ia64_psr *ipsr = ia64_psr(regs); + unsigned long *bundle = (unsigned long *)regs->cr_iip; + unsigned long slot; + switch (ipsr->ri) { + case 0: slot = (bundle[0] >> 5); break; + case 1: slot = (bundle[0] >> 46) | (bundle[1] << 18); break; + default: slot = (bundle[1] >> 23); break; + } + break_num = ((slot >> 36 & 1) << 20) | (slot >> 6 & 0xfffff); + } + /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */ siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); siginfo.si_imm = break_num; diff --git a/trunk/arch/ia64/kernel/uncached.c b/trunk/arch/ia64/kernel/uncached.c index b631cf86ed44..c6d40446c2c4 100644 --- a/trunk/arch/ia64/kernel/uncached.c +++ b/trunk/arch/ia64/kernel/uncached.c @@ -53,7 +53,7 @@ static void uncached_ipi_visibility(void *data) if ((status != PAL_VISIBILITY_OK) && (status != PAL_VISIBILITY_OK_REMOTE_NEEDED)) printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on " - "CPU %i\n", status, raw_smp_processor_id()); + "CPU %i\n", status, get_cpu()); } @@ -63,7 +63,7 @@ static void uncached_ipi_mc_drain(void *data) status = ia64_pal_mc_drain(); if (status) printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on " - "CPU %i\n", status, raw_smp_processor_id()); + "CPU %i\n", status, get_cpu()); } @@ -105,7 +105,7 @@ uncached_get_new_chunk(struct gen_pool *poolp) status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL); dprintk(KERN_INFO "pal_prefetch_visibility() returns %i on cpu %i\n", - status, raw_smp_processor_id()); + status, get_cpu()); if (!status) { status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1); diff --git a/trunk/arch/ia64/kernel/vmlinux.lds.S b/trunk/arch/ia64/kernel/vmlinux.lds.S index 73af6267d2ef..30d8564e9603 100644 --- a/trunk/arch/ia64/kernel/vmlinux.lds.S +++ b/trunk/arch/ia64/kernel/vmlinux.lds.S @@ -177,9 +177,6 @@ SECTIONS } . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose kernel data */ - .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) - { *(.data.read_mostly) } - .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) { *(.data.cacheline_aligned) } diff --git a/trunk/arch/ia64/mm/discontig.c b/trunk/arch/ia64/mm/discontig.c index c87d6d1d5813..0f776b032d31 100644 --- a/trunk/arch/ia64/mm/discontig.c +++ b/trunk/arch/ia64/mm/discontig.c @@ -50,10 +50,8 @@ static nodemask_t memory_less_mask __initdata; * To prevent cache aliasing effects, align per-node structures so that they * start at addresses that are strided by node number. */ -#define MAX_NODE_ALIGN_OFFSET (32 * 1024 * 1024) #define NODEDATA_ALIGN(addr, node) \ - ((((addr) + 1024*1024-1) & ~(1024*1024-1)) + \ - (((node)*PERCPU_PAGE_SIZE) & (MAX_NODE_ALIGN_OFFSET - 1))) + ((((addr) + 1024*1024-1) & ~(1024*1024-1)) + (node)*PERCPU_PAGE_SIZE) /** * build_node_maps - callback to setup bootmem structs for each node diff --git a/trunk/arch/ia64/sn/kernel/bte.c b/trunk/arch/ia64/sn/kernel/bte.c index dd73c0cb754b..d71f4de44f79 100644 --- a/trunk/arch/ia64/sn/kernel/bte.c +++ b/trunk/arch/ia64/sn/kernel/bte.c @@ -137,7 +137,6 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) bte = bte_if_on_node(nasid_to_try[nasid_index],bte_if_index); if (bte == NULL) { - nasid_index++; continue; } diff --git a/trunk/arch/ia64/sn/kernel/io_init.c b/trunk/arch/ia64/sn/kernel/io_init.c index 318087e35b66..05e4ea889981 100644 --- a/trunk/arch/ia64/sn/kernel/io_init.c +++ b/trunk/arch/ia64/sn/kernel/io_init.c @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. */ #include @@ -146,24 +146,6 @@ sal_get_pcidev_info(u64 segment, u64 bus_number, u64 devfn, u64 pci_dev, return ret_stuff.v0; } -/* - * sn_pcidev_info_get() - Retrieve the pcidev_info struct for the specified - * device. - */ -inline struct pcidev_info * -sn_pcidev_info_get(struct pci_dev *dev) -{ - struct pcidev_info *pcidev; - - list_for_each_entry(pcidev, - &(SN_PCI_CONTROLLER(dev)->pcidev_info), pdi_list) { - if (pcidev->pdi_linux_pcidev == dev) { - return pcidev; - } - } - return NULL; -} - /* * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for * each node in the system. @@ -247,50 +229,6 @@ static void sn_fixup_ionodes(void) } -/* - * sn_pci_window_fixup() - Create a pci_window for each device resource. - * Until ACPI support is added, we need this code - * to setup pci_windows for use by - * pcibios_bus_to_resource(), - * pcibios_resource_to_bus(), etc. - */ -static void -sn_pci_window_fixup(struct pci_dev *dev, unsigned int count, - int64_t * pci_addrs) -{ - struct pci_controller *controller = PCI_CONTROLLER(dev->bus); - unsigned int i; - unsigned int idx; - unsigned int new_count; - struct pci_window *new_window; - - if (count == 0) - return; - idx = controller->windows; - new_count = controller->windows + count; - new_window = kcalloc(new_count, sizeof(struct pci_window), GFP_KERNEL); - if (new_window == NULL) - BUG(); - if (controller->window) { - memcpy(new_window, controller->window, - sizeof(struct pci_window) * controller->windows); - kfree(controller->window); - } - - /* Setup a pci_window for each device resource. */ - for (i = 0; i <= PCI_ROM_RESOURCE; i++) { - if (pci_addrs[i] == -1) - continue; - - new_window[idx].offset = dev->resource[i].start - pci_addrs[i]; - new_window[idx].resource = dev->resource[i]; - idx++; - } - - controller->windows = new_count; - controller->window = new_window; -} - void sn_pci_unfixup_slot(struct pci_dev *dev) { struct pci_dev *host_pci_dev = SN_PCIDEV_INFO(dev)->host_pci_dev; @@ -308,23 +246,21 @@ void sn_pci_unfixup_slot(struct pci_dev *dev) */ void sn_pci_fixup_slot(struct pci_dev *dev) { - unsigned int count = 0; int idx; int segment = pci_domain_nr(dev->bus); int status = 0; struct pcibus_bussoft *bs; struct pci_bus *host_pci_bus; struct pci_dev *host_pci_dev; - struct pcidev_info *pcidev_info; - int64_t pci_addrs[PCI_ROM_RESOURCE + 1]; struct sn_irq_info *sn_irq_info; unsigned long size; unsigned int bus_no, devfn; pci_dev_get(dev); /* for the sysdata pointer */ - pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL); - if (pcidev_info <= 0) + dev->sysdata = kmalloc(sizeof(struct pcidev_info), GFP_KERNEL); + if (SN_PCIDEV_INFO(dev) <= 0) BUG(); /* Cannot afford to run out of memory */ + memset(SN_PCIDEV_INFO(dev), 0, sizeof(struct pcidev_info)); sn_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_KERNEL); if (sn_irq_info <= 0) @@ -334,34 +270,22 @@ void sn_pci_fixup_slot(struct pci_dev *dev) /* Call to retrieve pci device information needed by kernel. */ status = sal_get_pcidev_info((u64) segment, (u64) dev->bus->number, dev->devfn, - (u64) __pa(pcidev_info), + (u64) __pa(SN_PCIDEV_INFO(dev)), (u64) __pa(sn_irq_info)); if (status) BUG(); /* Cannot get platform pci device information */ - /* Add pcidev_info to list in sn_pci_controller struct */ - list_add_tail(&pcidev_info->pdi_list, - &(SN_PCI_CONTROLLER(dev->bus)->pcidev_info)); - /* Copy over PIO Mapped Addresses */ for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) { unsigned long start, end, addr; - if (!pcidev_info->pdi_pio_mapped_addr[idx]) { - pci_addrs[idx] = -1; + if (!SN_PCIDEV_INFO(dev)->pdi_pio_mapped_addr[idx]) continue; - } start = dev->resource[idx].start; end = dev->resource[idx].end; size = end - start; - if (size == 0) { - pci_addrs[idx] = -1; - continue; - } - pci_addrs[idx] = start; - count++; - addr = pcidev_info->pdi_pio_mapped_addr[idx]; + addr = SN_PCIDEV_INFO(dev)->pdi_pio_mapped_addr[idx]; addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET; dev->resource[idx].start = addr; dev->resource[idx].end = addr + size; @@ -370,27 +294,23 @@ void sn_pci_fixup_slot(struct pci_dev *dev) else dev->resource[idx].parent = &iomem_resource; } - /* Create a pci_window in the pci_controller struct for - * each device resource. - */ - if (count > 0) - sn_pci_window_fixup(dev, count, pci_addrs); /* * Using the PROMs values for the PCI host bus, get the Linux * PCI host_pci_dev struct and set up host bus linkages */ - bus_no = (pcidev_info->pdi_slot_host_handle >> 32) & 0xff; - devfn = pcidev_info->pdi_slot_host_handle & 0xffffffff; + bus_no = (SN_PCIDEV_INFO(dev)->pdi_slot_host_handle >> 32) & 0xff; + devfn = SN_PCIDEV_INFO(dev)->pdi_slot_host_handle & 0xffffffff; host_pci_bus = pci_find_bus(segment, bus_no); host_pci_dev = pci_get_slot(host_pci_bus, devfn); - pcidev_info->host_pci_dev = host_pci_dev; - pcidev_info->pdi_linux_pcidev = dev; - pcidev_info->pdi_host_pcidev_info = SN_PCIDEV_INFO(host_pci_dev); + SN_PCIDEV_INFO(dev)->host_pci_dev = host_pci_dev; + SN_PCIDEV_INFO(dev)->pdi_host_pcidev_info = + SN_PCIDEV_INFO(host_pci_dev); + SN_PCIDEV_INFO(dev)->pdi_linux_pcidev = dev; bs = SN_PCIBUS_BUSSOFT(dev->bus); - pcidev_info->pdi_pcibus_info = bs; + SN_PCIDEV_INFO(dev)->pdi_pcibus_info = bs; if (bs && bs->bs_asic_type < PCIIO_ASIC_MAX_TYPES) { SN_PCIDEV_BUSPROVIDER(dev) = sn_pci_provider[bs->bs_asic_type]; @@ -400,11 +320,11 @@ void sn_pci_fixup_slot(struct pci_dev *dev) /* Only set up IRQ stuff if this device has a host bus context */ if (bs && sn_irq_info->irq_irq) { - pcidev_info->pdi_sn_irq_info = sn_irq_info; - dev->irq = pcidev_info->pdi_sn_irq_info->irq_irq; + SN_PCIDEV_INFO(dev)->pdi_sn_irq_info = sn_irq_info; + dev->irq = SN_PCIDEV_INFO(dev)->pdi_sn_irq_info->irq_irq; sn_irq_fixup(dev, sn_irq_info); } else { - pcidev_info->pdi_sn_irq_info = NULL; + SN_PCIDEV_INFO(dev)->pdi_sn_irq_info = NULL; kfree(sn_irq_info); } } @@ -418,7 +338,6 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) int status = 0; int nasid, cnode; struct pci_controller *controller; - struct sn_pci_controller *sn_controller; struct pcibus_bussoft *prom_bussoft_ptr; struct hubdev_info *hubdev_info; void *provider_soft = NULL; @@ -430,15 +349,10 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) return; /*bus # does not exist */ prom_bussoft_ptr = __va(prom_bussoft_ptr); - /* Allocate a sn_pci_controller, which has a pci_controller struct - * as the first member. - */ - sn_controller = kzalloc(sizeof(struct sn_pci_controller), GFP_KERNEL); - if (!sn_controller) - BUG(); - INIT_LIST_HEAD(&sn_controller->pcidev_info); - controller = &sn_controller->pci_controller; + controller = kzalloc(sizeof(struct pci_controller), GFP_KERNEL); controller->segment = segment; + if (!controller) + BUG(); if (bus == NULL) { bus = pci_scan_bus(busnum, &pci_root_ops, controller); @@ -475,29 +389,6 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) goto error_return; } - /* - * Setup pci_windows for legacy IO and MEM space. - * (Temporary until ACPI support is in place.) - */ - controller->window = kcalloc(2, sizeof(struct pci_window), GFP_KERNEL); - if (controller->window == NULL) - BUG(); - controller->window[0].offset = prom_bussoft_ptr->bs_legacy_io; - controller->window[0].resource.name = "legacy_io"; - controller->window[0].resource.flags = IORESOURCE_IO; - controller->window[0].resource.start = prom_bussoft_ptr->bs_legacy_io; - controller->window[0].resource.end = - controller->window[0].resource.start + 0xffff; - controller->window[0].resource.parent = &ioport_resource; - controller->window[1].offset = prom_bussoft_ptr->bs_legacy_mem; - controller->window[1].resource.name = "legacy_mem"; - controller->window[1].resource.flags = IORESOURCE_MEM; - controller->window[1].resource.start = prom_bussoft_ptr->bs_legacy_mem; - controller->window[1].resource.end = - controller->window[1].resource.start + (1024 * 1024) - 1; - controller->window[1].resource.parent = &iomem_resource; - controller->windows = 2; - /* * Generic bus fixup goes here. Don't reference prom_bussoft_ptr * after this point. @@ -530,7 +421,7 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) error_return: - kfree(sn_controller); + kfree(controller); return; } @@ -543,7 +434,7 @@ void sn_bus_store_sysdata(struct pci_dev *dev) dev_dbg(dev, "%s: out of memory!\n", __FUNCTION__); return; } - element->sysdata = SN_PCIDEV_INFO(dev); + element->sysdata = dev->sysdata; list_add(&element->entry, &sn_sysdata_list); } diff --git a/trunk/arch/ia64/sn/kernel/sn2/ptc_deadlock.S b/trunk/arch/ia64/sn/kernel/sn2/ptc_deadlock.S index bebbcc4f8dd4..3fa95065a446 100644 --- a/trunk/arch/ia64/sn/kernel/sn2/ptc_deadlock.S +++ b/trunk/arch/ia64/sn/kernel/sn2/ptc_deadlock.S @@ -39,13 +39,9 @@ sn2_ptc_deadlock_recovery_core: mov r8=r0 1: - cmp.ne p8,p9=r0,ptc1 // Test for shub type (ptc1 non-null on shub1) - // p8 = 1 if shub1, p9 = 1 if shub2 - add scr2=ALIAS_OFFSET,piowc // Address of WRITE_STATUS alias register - mov scr1=7;; // Clear DEADLOCK, WRITE_ERROR, MULTI_WRITE_ERROR -(p8) st8.rel [scr2]=scr1;; -(p9) ld8.acq scr1=[scr2];; + ;; + ld8.acq scr1=[scr2];; 5: ld8.acq scr1=[piowc];; // Wait for PIOs to complete. hint @pause diff --git a/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c b/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c index 471bbaa65d1b..49b530c39a42 100644 --- a/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c @@ -202,7 +202,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, unsigned long end, unsigned long nbits) { int i, opt, shub1, cnode, mynasid, cpu, lcpu = 0, nasid, flushed = 0; - int mymm = (mm == current->active_mm && current->mm); + int mymm = (mm == current->active_mm); volatile unsigned long *ptc0, *ptc1; unsigned long itc, itc2, flags, data0 = 0, data1 = 0, rr_value; short nasids[MAX_NUMNODES], nix; @@ -492,9 +492,6 @@ static struct proc_dir_entry *proc_sn2_ptc; static int __init sn2_ptc_init(void) { - if (!ia64_platform_is("sn2")) - return -ENOSYS; - if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) { printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME); return -EINVAL; diff --git a/trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 19b54fbcd7ea..6c6fbca3229c 100644 --- a/trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c @@ -743,14 +743,13 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg) if ((r = sn_hwperf_enum_objects(&nobj, &objs)) == 0) { memset(p, 0, a.sz); for (i = 0; i < nobj; i++) { - int cpuobj_index = 0; if (!SN_HWPERF_IS_NODE(objs + i)) continue; node = sn_hwperf_obj_to_cnode(objs + i); for_each_online_cpu(j) { if (node != cpu_to_node(j)) continue; - cpuobj = (struct sn_hwperf_object_info *) p + cpuobj_index++; + cpuobj = (struct sn_hwperf_object_info *) p + j; slice = 'a' + cpuid_to_slice(j); cdata = cpu_data(j); cpuobj->id = j; diff --git a/trunk/arch/ia64/sn/pci/pcibr/pcibr_reg.c b/trunk/arch/ia64/sn/pci/pcibr/pcibr_reg.c index 79fdb91d7259..5d534091262c 100644 --- a/trunk/arch/ia64/sn/pci/pcibr/pcibr_reg.c +++ b/trunk/arch/ia64/sn/pci/pcibr/pcibr_reg.c @@ -25,7 +25,7 @@ union br_ptr { */ void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; if (pcibus_info) { switch (pcibus_info->pbi_bridge_type) { @@ -38,14 +38,14 @@ void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits) default: panic ("pcireg_control_bit_clr: unknown bridgetype bridge 0x%p", - ptr); + (void *)ptr); } } } void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; if (pcibus_info) { switch (pcibus_info->pbi_bridge_type) { @@ -58,7 +58,7 @@ void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) default: panic ("pcireg_control_bit_set: unknown bridgetype bridge 0x%p", - ptr); + (void *)ptr); } } } @@ -68,7 +68,7 @@ void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) */ uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; uint64_t ret = 0; if (pcibus_info) { @@ -82,7 +82,7 @@ uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info) default: panic ("pcireg_tflush_get: unknown bridgetype bridge 0x%p", - ptr); + (void *)ptr); } } @@ -98,7 +98,7 @@ uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info) */ uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; uint64_t ret = 0; if (pcibus_info) { @@ -112,7 +112,7 @@ uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info) default: panic ("pcireg_intr_status_get: unknown bridgetype bridge 0x%p", - ptr); + (void *)ptr); } } return ret; @@ -123,7 +123,7 @@ uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info) */ void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; if (pcibus_info) { switch (pcibus_info->pbi_bridge_type) { @@ -136,14 +136,14 @@ void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits) default: panic ("pcireg_intr_enable_bit_clr: unknown bridgetype bridge 0x%p", - ptr); + (void *)ptr); } } } void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; if (pcibus_info) { switch (pcibus_info->pbi_bridge_type) { @@ -156,7 +156,7 @@ void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) default: panic ("pcireg_intr_enable_bit_set: unknown bridgetype bridge 0x%p", - ptr); + (void *)ptr); } } } @@ -167,7 +167,7 @@ void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n, uint64_t addr) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; if (pcibus_info) { switch (pcibus_info->pbi_bridge_type) { @@ -186,7 +186,7 @@ void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n, default: panic ("pcireg_intr_addr_addr_get: unknown bridgetype bridge 0x%p", - ptr); + (void *)ptr); } } } @@ -196,7 +196,7 @@ void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n, */ void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; if (pcibus_info) { switch (pcibus_info->pbi_bridge_type) { @@ -209,7 +209,7 @@ void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n) default: panic ("pcireg_force_intr_set: unknown bridgetype bridge 0x%p", - ptr); + (void *)ptr); } } } @@ -219,7 +219,7 @@ void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n) */ uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; uint64_t ret = 0; if (pcibus_info) { @@ -233,7 +233,7 @@ uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device) __sn_readq_relaxed(&ptr->pic.p_wr_req_buf[device]); break; default: - panic("pcireg_wrb_flush_get: unknown bridgetype bridge 0x%p", ptr); + panic("pcireg_wrb_flush_get: unknown bridgetype bridge 0x%p", (void *)ptr); } } @@ -244,7 +244,7 @@ uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device) void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index, uint64_t val) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; if (pcibus_info) { switch (pcibus_info->pbi_bridge_type) { @@ -257,15 +257,15 @@ void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index, default: panic ("pcireg_int_ate_set: unknown bridgetype bridge 0x%p", - ptr); + (void *)ptr); } } } -uint64_t __iomem *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index) +uint64_t *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index) { - union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; - uint64_t __iomem *ret = NULL; + union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; + uint64_t *ret = (uint64_t *) 0; if (pcibus_info) { switch (pcibus_info->pbi_bridge_type) { @@ -278,7 +278,7 @@ uint64_t __iomem *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_i default: panic ("pcireg_int_ate_addr: unknown bridgetype bridge 0x%p", - ptr); + (void *)ptr); } } return ret; diff --git a/trunk/arch/ia64/sn/pci/tioca_provider.c b/trunk/arch/ia64/sn/pci/tioca_provider.c index 27aa1842dacc..46b646a6d345 100644 --- a/trunk/arch/ia64/sn/pci/tioca_provider.c +++ b/trunk/arch/ia64/sn/pci/tioca_provider.c @@ -38,10 +38,10 @@ tioca_gart_init(struct tioca_kernel *tioca_kern) uint64_t offset; struct page *tmp; struct tioca_common *tioca_common; - struct tioca __iomem *ca_base; + struct tioca *ca_base; tioca_common = tioca_kern->ca_common; - ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base; + ca_base = (struct tioca *)tioca_common->ca_common.bs_base; if (list_empty(tioca_kern->ca_devices)) return 0; @@ -215,7 +215,7 @@ tioca_fastwrite_enable(struct tioca_kernel *tioca_kern) { int cap_ptr; uint32_t reg; - struct tioca __iomem *tioca_base; + struct tioca *tioca_base; struct pci_dev *pdev; struct tioca_common *common; @@ -257,7 +257,7 @@ tioca_fastwrite_enable(struct tioca_kernel *tioca_kern) * Set ca's fw to match */ - tioca_base = (struct tioca __iomem*)common->ca_common.bs_base; + tioca_base = (struct tioca *)common->ca_common.bs_base; __sn_setq_relaxed(&tioca_base->ca_control1, CA_AGP_FW_ENABLE); } @@ -322,7 +322,7 @@ static uint64_t tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr) { struct tioca_common *tioca_common; - struct tioca __iomem *ca_base; + struct tioca *ca_base; uint64_t ct_addr; dma_addr_t bus_addr; uint32_t node_upper; @@ -330,7 +330,7 @@ tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr) struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(pdev); tioca_common = (struct tioca_common *)pcidev_info->pdi_pcibus_info; - ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base; + ca_base = (struct tioca *)tioca_common->ca_common.bs_base; ct_addr = PHYS_TO_TIODMA(paddr); if (!ct_addr) diff --git a/trunk/arch/m32r/kernel/io_mappi3.c b/trunk/arch/m32r/kernel/io_mappi3.c index f80321a58764..6716ffea769a 100644 --- a/trunk/arch/m32r/kernel/io_mappi3.c +++ b/trunk/arch/m32r/kernel/io_mappi3.c @@ -36,13 +36,12 @@ static inline void *_port2addr(unsigned long port) return (void *)(port + NONCACHE_OFFSET); } -#if defined(CONFIG_IDE) +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) static inline void *__port2addr_ata(unsigned long port) { static int dummy_reg; switch (port) { - /* IDE0 CF */ case 0x1f0: return (void *)0xb4002000; case 0x1f1: return (void *)0xb4012800; case 0x1f2: return (void *)0xb4012002; @@ -52,17 +51,6 @@ static inline void *__port2addr_ata(unsigned long port) case 0x1f6: return (void *)0xb4012006; case 0x1f7: return (void *)0xb4012806; case 0x3f6: return (void *)0xb401200e; - /* IDE1 IDE */ - case 0x170: return (void *)0xb4810000; /* Data 16bit */ - case 0x171: return (void *)0xb4810002; /* Features / Error */ - case 0x172: return (void *)0xb4810004; /* Sector count */ - case 0x173: return (void *)0xb4810006; /* Sector number */ - case 0x174: return (void *)0xb4810008; /* Cylinder low */ - case 0x175: return (void *)0xb481000a; /* Cylinder high */ - case 0x176: return (void *)0xb481000c; /* Device head */ - case 0x177: return (void *)0xb481000e; /* Command */ - case 0x376: return (void *)0xb480800c; /* Device control / Alt status */ - default: return (void *)&dummy_reg; } } @@ -120,9 +108,8 @@ unsigned char _inb(unsigned long port) { if (port >= LAN_IOSTART && port < LAN_IOEND) return _ne_inb(PORT2ADDR_NE(port)); -#if defined(CONFIG_IDE) - else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { return *(volatile unsigned char *)__port2addr_ata(port); } #endif @@ -140,9 +127,8 @@ unsigned short _inw(unsigned long port) { if (port >= LAN_IOSTART && port < LAN_IOEND) return _ne_inw(PORT2ADDR_NE(port)); -#if defined(CONFIG_IDE) - else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { return *(volatile unsigned short *)__port2addr_ata(port); } #endif @@ -199,9 +185,8 @@ void _outb(unsigned char b, unsigned long port) if (port >= LAN_IOSTART && port < LAN_IOEND) _ne_outb(b, PORT2ADDR_NE(port)); else -#if defined(CONFIG_IDE) - if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { *(volatile unsigned char *)__port2addr_ata(port) = b; } else #endif @@ -218,9 +203,8 @@ void _outw(unsigned short w, unsigned long port) if (port >= LAN_IOSTART && port < LAN_IOEND) _ne_outw(w, PORT2ADDR_NE(port)); else -#if defined(CONFIG_IDE) - if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { *(volatile unsigned short *)__port2addr_ata(port) = w; } else #endif @@ -269,9 +253,8 @@ void _insb(unsigned int port, void * addr, unsigned long count) { if (port >= LAN_IOSTART && port < LAN_IOEND) _ne_insb(PORT2ADDR_NE(port), addr, count); -#if defined(CONFIG_IDE) - else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { unsigned char *buf = addr; unsigned char *portp = __port2addr_ata(port); while (count--) @@ -306,9 +289,8 @@ void _insw(unsigned int port, void * addr, unsigned long count) pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), count, 1); #endif -#if defined(CONFIG_IDE) - } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { portp = __port2addr_ata(port); while (count--) *buf++ = *(volatile unsigned short *)portp; @@ -339,9 +321,8 @@ void _outsb(unsigned int port, const void * addr, unsigned long count) portp = PORT2ADDR_NE(port); while (count--) _ne_outb(*buf++, portp); -#if defined(CONFIG_IDE) - } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { portp = __port2addr_ata(port); while (count--) *(volatile unsigned char *)portp = *buf++; @@ -367,9 +348,8 @@ void _outsw(unsigned int port, const void * addr, unsigned long count) portp = PORT2ADDR_NE(port); while (count--) *(volatile unsigned short *)portp = *buf++; -#if defined(CONFIG_IDE) - } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ +#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) + } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { portp = __port2addr_ata(port); while (count--) *(volatile unsigned short *)portp = *buf++; diff --git a/trunk/arch/m32r/kernel/setup_mappi3.c b/trunk/arch/m32r/kernel/setup_mappi3.c index f6ecdf7f555c..9c79341a7b45 100644 --- a/trunk/arch/m32r/kernel/setup_mappi3.c +++ b/trunk/arch/m32r/kernel/setup_mappi3.c @@ -151,7 +151,7 @@ void __init init_IRQ(void) disable_mappi3_irq(M32R_IRQ_INT1); #endif /* CONFIG_USB */ - /* CFC IREQ */ + /* ICUCR40: CFC IREQ */ irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; irq_desc[PLD_IRQ_CFIREQ].handler = &mappi3_irq_type; irq_desc[PLD_IRQ_CFIREQ].action = 0; @@ -160,7 +160,7 @@ void __init init_IRQ(void) disable_mappi3_irq(PLD_IRQ_CFIREQ); #if defined(CONFIG_M32R_CFC) - /* ICUCR41: CFC Insert & eject */ + /* ICUCR41: CFC Insert */ irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; irq_desc[PLD_IRQ_CFC_INSERT].handler = &mappi3_irq_type; irq_desc[PLD_IRQ_CFC_INSERT].action = 0; @@ -168,16 +168,14 @@ void __init init_IRQ(void) icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00; disable_mappi3_irq(PLD_IRQ_CFC_INSERT); + /* ICUCR42: CFC Eject */ + irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED; + irq_desc[PLD_IRQ_CFC_EJECT].handler = &mappi3_irq_type; + irq_desc[PLD_IRQ_CFC_EJECT].action = 0; + irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ + icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; + disable_mappi3_irq(PLD_IRQ_CFC_EJECT); #endif /* CONFIG_M32R_CFC */ - - /* IDE IREQ */ - irq_desc[PLD_IRQ_IDEIREQ].status = IRQ_DISABLED; - irq_desc[PLD_IRQ_IDEIREQ].handler = &mappi3_irq_type; - irq_desc[PLD_IRQ_IDEIREQ].action = 0; - irq_desc[PLD_IRQ_IDEIREQ].depth = 1; /* disable nested irq */ - icu_data[PLD_IRQ_IDEIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; - disable_mappi3_irq(PLD_IRQ_IDEIREQ); - } #if defined(CONFIG_SMC91X) diff --git a/trunk/arch/m32r/kernel/sys_m32r.c b/trunk/arch/m32r/kernel/sys_m32r.c index fe55b28d3725..e0500e12c5fb 100644 --- a/trunk/arch/m32r/kernel/sys_m32r.c +++ b/trunk/arch/m32r/kernel/sys_m32r.c @@ -41,8 +41,7 @@ asmlinkage int sys_tas(int *addr) return -EFAULT; local_irq_save(flags); oldval = *addr; - if (!oldval) - *addr = 1; + *addr = 1; local_irq_restore(flags); return oldval; } @@ -60,8 +59,7 @@ asmlinkage int sys_tas(int *addr) _raw_spin_lock(&tas_lock); oldval = *addr; - if (!oldval) - *addr = 1; + *addr = 1; _raw_spin_unlock(&tas_lock); return oldval; diff --git a/trunk/arch/m68k/fpsp040/skeleton.S b/trunk/arch/m68k/fpsp040/skeleton.S index a1629194e3fd..9571a21d6ad4 100644 --- a/trunk/arch/m68k/fpsp040/skeleton.S +++ b/trunk/arch/m68k/fpsp040/skeleton.S @@ -381,8 +381,10 @@ fpsp_done: .Lnotkern: SAVE_ALL_INT GET_CURRENT(%d0) - | deliver signals, reschedule etc.. - jra ret_from_exception + tstb %curptr@(TASK_NEEDRESCHED) + jne ret_from_exception | deliver signals, + | reschedule etc.. + RESTORE_ALL | | mem_write --- write to user or supervisor address space diff --git a/trunk/arch/m68k/ifpsp060/iskeleton.S b/trunk/arch/m68k/ifpsp060/iskeleton.S index b2dbdf5ee309..4ba2c74da93d 100644 --- a/trunk/arch/m68k/ifpsp060/iskeleton.S +++ b/trunk/arch/m68k/ifpsp060/iskeleton.S @@ -75,8 +75,10 @@ _060_isp_done: .Lnotkern: SAVE_ALL_INT GET_CURRENT(%d0) - | deliver signals, reschedule etc.. - jra ret_from_exception + tstb %curptr@(TASK_NEEDRESCHED) + jne ret_from_exception | deliver signals, + | reschedule etc.. + RESTORE_ALL | | _060_real_chk(): diff --git a/trunk/arch/m68k/kernel/asm-offsets.c b/trunk/arch/m68k/kernel/asm-offsets.c index c787c5ba9513..cee3317b8665 100644 --- a/trunk/arch/m68k/kernel/asm-offsets.c +++ b/trunk/arch/m68k/kernel/asm-offsets.c @@ -25,8 +25,12 @@ int main(void) DEFINE(TASK_STATE, offsetof(struct task_struct, state)); DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); + DEFINE(TASK_WORK, offsetof(struct task_struct, thread.work)); + DEFINE(TASK_NEEDRESCHED, offsetof(struct task_struct, thread.work.need_resched)); + DEFINE(TASK_SYSCALL_TRACE, offsetof(struct task_struct, thread.work.syscall_trace)); + DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, thread.work.sigpending)); + DEFINE(TASK_NOTIFY_RESUME, offsetof(struct task_struct, thread.work.notify_resume)); DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); - DEFINE(TASK_INFO, offsetof(struct task_struct, thread.info)); DEFINE(TASK_MM, offsetof(struct task_struct, mm)); DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); @@ -41,10 +45,6 @@ int main(void) DEFINE(THREAD_FPCNTL, offsetof(struct thread_struct, fpcntl)); DEFINE(THREAD_FPSTATE, offsetof(struct thread_struct, fpstate)); - /* offsets into the thread_info struct */ - DEFINE(TINFO_PREEMPT, offsetof(struct thread_info, preempt_count)); - DEFINE(TINFO_FLAGS, offsetof(struct thread_info, flags)); - /* offsets into the pt_regs */ DEFINE(PT_D0, offsetof(struct pt_regs, d0)); DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0)); diff --git a/trunk/arch/m68k/kernel/entry.S b/trunk/arch/m68k/kernel/entry.S index 320fde05dc63..23ca60a45552 100644 --- a/trunk/arch/m68k/kernel/entry.S +++ b/trunk/arch/m68k/kernel/entry.S @@ -44,7 +44,9 @@ #include -.globl system_call, buserr, trap, resume +.globl system_call, buserr, trap +.globl resume, ret_from_exception +.globl ret_from_signal .globl inthandler, sys_call_table .globl sys_fork, sys_clone, sys_vfork .globl ret_from_interrupt, bad_interrupt @@ -56,7 +58,7 @@ ENTRY(buserr) movel %sp,%sp@- | stack frame pointer argument bsrl buserr_c addql #4,%sp - jra .Lret_from_exception + jra ret_from_exception ENTRY(trap) SAVE_ALL_INT @@ -64,7 +66,7 @@ ENTRY(trap) movel %sp,%sp@- | stack frame pointer argument bsrl trap_c addql #4,%sp - jra .Lret_from_exception + jra ret_from_exception | After a fork we jump here directly from resume, | so that %d1 contains the previous task @@ -73,31 +75,30 @@ ENTRY(ret_from_fork) movel %d1,%sp@- jsr schedule_tail addql #4,%sp - jra .Lret_from_exception + jra ret_from_exception -do_trace_entry: - movel #-ENOSYS,%sp@(PT_D0) | needed for strace - subql #4,%sp - SAVE_SWITCH_STACK - jbsr syscall_trace - RESTORE_SWITCH_STACK - addql #4,%sp - movel %sp@(PT_ORIG_D0),%d0 - cmpl #NR_syscalls,%d0 - jcs syscall badsys: movel #-ENOSYS,%sp@(PT_D0) - jra ret_from_syscall + jra ret_from_exception -do_trace_exit: +do_trace: + movel #-ENOSYS,%sp@(PT_D0) | needed for strace subql #4,%sp SAVE_SWITCH_STACK jbsr syscall_trace RESTORE_SWITCH_STACK addql #4,%sp - jra .Lret_from_exception + movel %sp@(PT_ORIG_D0),%d1 + movel #-ENOSYS,%d0 + cmpl #NR_syscalls,%d1 + jcc 1f + jbsr @(sys_call_table,%d1:l:4)@(0) +1: movel %d0,%sp@(PT_D0) | save the return value + subql #4,%sp | dummy return address + SAVE_SWITCH_STACK + jbsr syscall_trace -ENTRY(ret_from_signal) +ret_from_signal: RESTORE_SWITCH_STACK addql #4,%sp /* on 68040 complete pending writebacks if any */ @@ -110,7 +111,7 @@ ENTRY(ret_from_signal) addql #4,%sp 1: #endif - jra .Lret_from_exception + jra ret_from_exception ENTRY(system_call) SAVE_ALL_SYS @@ -119,34 +120,30 @@ ENTRY(system_call) | save top of frame movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0) - | syscall trace? - tstb %curptr@(TASK_INFO+TINFO_FLAGS+2) - jmi do_trace_entry + tstb %curptr@(TASK_SYSCALL_TRACE) + jne do_trace cmpl #NR_syscalls,%d0 jcc badsys -syscall: jbsr @(sys_call_table,%d0:l:4)@(0) movel %d0,%sp@(PT_D0) | save the return value -ret_from_syscall: + |oriw #0x0700,%sr - movew %curptr@(TASK_INFO+TINFO_FLAGS+2),%d0 + movel %curptr@(TASK_WORK),%d0 jne syscall_exit_work 1: RESTORE_ALL syscall_exit_work: btst #5,%sp@(PT_SR) | check if returning to kernel bnes 1b | if so, skip resched, signals - lslw #1,%d0 - jcs do_trace_exit - jmi do_delayed_trace - lslw #8,%d0 - jmi do_signal_return - pea resume_userspace - jra schedule + tstw %d0 + jeq do_signal_return + tstb %d0 + jne do_delayed_trace + pea resume_userspace + jmp schedule -ENTRY(ret_from_exception) -.Lret_from_exception: +ret_from_exception: btst #5,%sp@(PT_SR) | check if returning to kernel bnes 1f | if so, skip resched, signals | only allow interrupts when we are really the last one on the @@ -155,18 +152,19 @@ ENTRY(ret_from_exception) andw #ALLOWINT,%sr resume_userspace: - moveb %curptr@(TASK_INFO+TINFO_FLAGS+3),%d0 + movel %curptr@(TASK_WORK),%d0 + lsrl #8,%d0 jne exit_work 1: RESTORE_ALL exit_work: | save top of frame movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0) - lslb #1,%d0 - jmi do_signal_return - pea resume_userspace - jra schedule + tstb %d0 + jeq do_signal_return + pea resume_userspace + jmp schedule do_signal_return: |andw #ALLOWINT,%sr @@ -256,7 +254,7 @@ ret_from_interrupt: /* check if we need to do software interrupts */ tstl irq_stat+CPUSTAT_SOFTIRQ_PENDING - jeq .Lret_from_exception + jeq ret_from_exception pea ret_from_exception jra do_softirq diff --git a/trunk/arch/m68k/kernel/ptrace.c b/trunk/arch/m68k/kernel/ptrace.c index 540638ca81f9..7e54422685cf 100644 --- a/trunk/arch/m68k/kernel/ptrace.c +++ b/trunk/arch/m68k/kernel/ptrace.c @@ -109,7 +109,7 @@ static inline void singlestep_disable(struct task_struct *child) { unsigned long tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); put_reg(child, PT_SR, tmp); - clear_tsk_thread_flag(child, TIF_DELAYED_TRACE); + child->thread.work.delayed_trace = 0; } /* @@ -118,7 +118,7 @@ static inline void singlestep_disable(struct task_struct *child) void ptrace_disable(struct task_struct *child) { singlestep_disable(child); - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + child->thread.work.syscall_trace = 0; } long arch_ptrace(struct task_struct *child, long request, long addr, long data) @@ -198,9 +198,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) goto out_eio; if (request == PTRACE_SYSCALL) - set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + child->thread.work.syscall_trace = ~0; else - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + child->thread.work.syscall_trace = 0; child->exit_code = data; singlestep_disable(child); wake_up_process(child); @@ -223,10 +223,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) if (!valid_signal(data)) goto out_eio; - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + child->thread.work.syscall_trace = 0; tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16); put_reg(child, PT_SR, tmp); - set_tsk_thread_flag(child, TIF_DELAYED_TRACE); + child->thread.work.delayed_trace = 1; child->exit_code = data; /* give it a chance to run. */ @@ -288,6 +288,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) asmlinkage void syscall_trace(void) { + if (!current->thread.work.delayed_trace && + !current->thread.work.syscall_trace) + return; ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? 0x80 : 0)); /* diff --git a/trunk/arch/mips/Kconfig b/trunk/arch/mips/Kconfig index b50be449d3f5..e380a8322a94 100644 --- a/trunk/arch/mips/Kconfig +++ b/trunk/arch/mips/Kconfig @@ -6,6 +6,8 @@ config MIPS mainmenu "Linux/MIPS Kernel Configuration" +source "init/Kconfig" + menu "Machine selection" choice @@ -1641,8 +1643,6 @@ config RWSEM_GENERIC_SPINLOCK bool default y -source "init/Kconfig" - menu "Bus options (PCI, PCMCIA, EISA, ISA, TC)" config HW_HAS_EISA diff --git a/trunk/arch/mips/Makefile b/trunk/arch/mips/Makefile index e14ba5e01a36..02692027730a 100644 --- a/trunk/arch/mips/Makefile +++ b/trunk/arch/mips/Makefile @@ -700,7 +700,6 @@ load-$(CONFIG_SNI_RM200_PCI) += 0xffffffff80600000 # core-$(CONFIG_TOSHIBA_JMR3927) += arch/mips/jmr3927/rbhma3100/ \ arch/mips/jmr3927/common/ -cflags-$(CONFIG_TOSHIBA_JMR3927) += -Iinclude/asm-mips/mach-jmr3927 load-$(CONFIG_TOSHIBA_JMR3927) += 0xffffffff80050000 # diff --git a/trunk/arch/mips/au1000/common/power.c b/trunk/arch/mips/au1000/common/power.c index f4926315fb68..f85093b8d54d 100644 --- a/trunk/arch/mips/au1000/common/power.c +++ b/trunk/arch/mips/au1000/common/power.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/arch/mips/au1000/common/setup.c b/trunk/arch/mips/au1000/common/setup.c index 08c8c855cc9c..4f21f42d096b 100644 --- a/trunk/arch/mips/au1000/common/setup.c +++ b/trunk/arch/mips/au1000/common/setup.c @@ -93,7 +93,7 @@ void __init plat_setup(void) argptr = prom_getcmdline(); -#if defined(CONFIG_SERIAL_AU1X00_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) +#ifdef CONFIG_SERIAL_AU1X00_CONSOLE if ((argptr = strstr(argptr, "console=")) == NULL) { argptr = prom_getcmdline(); strcat(argptr, " console=ttyS0,115200"); diff --git a/trunk/arch/mips/au1000/common/usbdev.c b/trunk/arch/mips/au1000/common/usbdev.c index 2cab7629702c..0b21bed7ee55 100644 --- a/trunk/arch/mips/au1000/common/usbdev.c +++ b/trunk/arch/mips/au1000/common/usbdev.c @@ -348,7 +348,7 @@ endpoint_stall(endpoint_t * ep) { u32 cs; - warn("%s", __FUNCTION__); + warn(__FUNCTION__); cs = au_readl(ep->reg->ctrl_stat) | USBDEV_CS_STALL; au_writel(cs, ep->reg->ctrl_stat); @@ -360,7 +360,7 @@ endpoint_unstall(endpoint_t * ep) { u32 cs; - warn("%s", __FUNCTION__); + warn(__FUNCTION__); cs = au_readl(ep->reg->ctrl_stat) & ~USBDEV_CS_STALL; au_writel(cs, ep->reg->ctrl_stat); diff --git a/trunk/arch/mips/au1000/db1x00/board_setup.c b/trunk/arch/mips/au1000/db1x00/board_setup.c index f00ec3b175d8..ac05ba0ff63f 100644 --- a/trunk/arch/mips/au1000/db1x00/board_setup.c +++ b/trunk/arch/mips/au1000/db1x00/board_setup.c @@ -45,12 +45,13 @@ #include #include -static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; +/* not correct for db1550 */ +static BCSR * const bcsr = (BCSR *)0xAE000000; void board_reset (void) { /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ - bcsr->swreset = 0x0000; + au_writel(0x00000000, 0xAE00001C); } void __init board_setup(void) @@ -74,7 +75,7 @@ void __init board_setup(void) bcsr->resets |= BCSR_RESETS_IRDA_MODE_OFF; au_sync(); #endif - bcsr->pcmcia = 0x0000; /* turn off PCMCIA power */ + au_writel(0, 0xAE000010); /* turn off pcmcia power */ #ifdef CONFIG_MIPS_MIRAGE /* enable GPIO[31:0] inputs */ diff --git a/trunk/arch/mips/au1000/db1x00/init.c b/trunk/arch/mips/au1000/db1x00/init.c index 41e0522f3cf1..4b9d5e46edbb 100644 --- a/trunk/arch/mips/au1000/db1x00/init.c +++ b/trunk/arch/mips/au1000/db1x00/init.c @@ -61,17 +61,7 @@ void __init prom_init(void) prom_envp = (char **) fw_arg2; mips_machgroup = MACH_GROUP_ALCHEMY; - - /* Set the platform # */ -#if defined (CONFIG_MIPS_DB1550) - mips_machtype = MACH_DB1550; -#elif defined (CONFIG_MIPS_DB1500) - mips_machtype = MACH_DB1500; -#elif defined (CONFIG_MIPS_DB1100) - mips_machtype = MACH_DB1100; -#else - mips_machtype = MACH_DB1000; -#endif + mips_machtype = MACH_DB1000; /* set the platform # */ prom_init_cmdline(); diff --git a/trunk/arch/mips/configs/atlas_defconfig b/trunk/arch/mips/configs/atlas_defconfig index 89c21572a59c..132ec3dac63f 100644 --- a/trunk/arch/mips/configs/atlas_defconfig +++ b/trunk/arch/mips/configs/atlas_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:05:52 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:13 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -140,80 +191,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -328,10 +309,6 @@ CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m @@ -386,7 +363,6 @@ CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m -CONFIG_IP_NF_TARGET_NFQUEUE=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m @@ -436,7 +412,6 @@ CONFIG_IP6_NF_MATCH_PHYSDEV=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_TARGET_REJECT=m -CONFIG_IP6_NF_TARGET_NFQUEUE=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m CONFIG_IP6_NF_TARGET_HL=m @@ -497,18 +472,10 @@ CONFIG_IPDDP_DECAP=y CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set - -# -# Queueing/Scheduling -# CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m @@ -521,10 +488,8 @@ CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m - -# -# Classification -# +CONFIG_NET_QOS=y +CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_TCINDEX=m @@ -533,14 +498,13 @@ CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set +CONFIG_NET_CLS_IND=y # CONFIG_CLS_U32_MARK is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_EMATCH is not set # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y -CONFIG_NET_CLS_IND=y -CONFIG_NET_ESTIMATOR=y # # Network testing @@ -601,9 +565,18 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -670,7 +643,6 @@ CONFIG_SCSI_SAS_ATTRS=m # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -681,7 +653,6 @@ CONFIG_ISCSI_TCP=m # CONFIG_SCSI_DPT_I2O is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set @@ -736,7 +707,6 @@ CONFIG_DM_MULTIPATH_EMC=m # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support @@ -766,6 +736,7 @@ CONFIG_TUN=m # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -783,7 +754,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -963,7 +933,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -1022,10 +991,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -1072,7 +1037,7 @@ CONFIG_JFS_SECURITY=y CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m CONFIG_XFS_EXPORT=y -CONFIG_XFS_QUOTA=y +CONFIG_XFS_QUOTA=m CONFIG_XFS_SECURITY=y CONFIG_XFS_POSIX_ACL=y # CONFIG_XFS_RT is not set diff --git a/trunk/arch/mips/configs/bigsur_defconfig b/trunk/arch/mips/configs/bigsur_defconfig index 069f9d14983e..25e8a08e68be 100644 --- a/trunk/arch/mips/configs/bigsur_defconfig +++ b/trunk/arch/mips/configs/bigsur_defconfig @@ -1,10 +1,65 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:05:54 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:17 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +# CONFIG_CPUSETS is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y + # # Machine selection # @@ -72,8 +127,8 @@ CONFIG_SIBYTE_SB1xxx_SOC=y # CONFIG_CPU_SB1_PASS_2_112x is not set # CONFIG_CPU_SB1_PASS_3 is not set # CONFIG_SIMULATION is not set -# CONFIG_SB1_CEX_ALWAYS_FATAL is not set -# CONFIG_SB1_CERR_STALL is not set +# CONFIG_CONFIG_SB1_CEX_ALWAYS_FATAL is not set +# CONFIG_CONFIG_SB1_CERR_STALL is not set CONFIG_SIBYTE_CFE=y # CONFIG_SIBYTE_CFE_CONSOLE is not set # CONFIG_SIBYTE_BUS_WATCHER is not set @@ -143,7 +198,6 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_SMP=y CONFIG_NR_CPUS=4 CONFIG_PREEMPT_NONE=y @@ -151,78 +205,6 @@ CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT is not set # CONFIG_PREEMPT_BKL is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_LOCK_KERNEL=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -# CONFIG_CPUSETS is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y -CONFIG_STOP_MACHINE=y - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -313,11 +295,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -374,6 +353,14 @@ CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -456,7 +443,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -596,7 +582,6 @@ CONFIG_GEN_RTC=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -649,7 +634,6 @@ CONFIG_SENSORS_PCA9539=y CONFIG_SENSORS_PCF8591=y CONFIG_SENSORS_RTC8564=y CONFIG_SENSORS_MAX6875=y -# CONFIG_RTC_X1205_I2C is not set CONFIG_I2C_DEBUG_CORE=y CONFIG_I2C_DEBUG_ALGO=y CONFIG_I2C_DEBUG_BUS=y @@ -701,10 +685,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -843,8 +823,6 @@ CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" # CONFIG_DEBUG_STACK_USAGE is not set diff --git a/trunk/arch/mips/configs/capcella_defconfig b/trunk/arch/mips/configs/capcella_defconfig index 5261e29ccf37..bfbaa08c47cb 100644 --- a/trunk/arch/mips/configs/capcella_defconfig +++ b/trunk/arch/mips/configs/capcella_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:05:55 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:20 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -131,80 +182,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -289,11 +270,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -351,7 +329,16 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -425,6 +412,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -442,7 +430,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -599,7 +586,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set -# CONFIG_RTC_VR41XX is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -615,7 +601,6 @@ CONFIG_GPIO_VR41XX=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -674,10 +659,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/cobalt_defconfig b/trunk/arch/mips/configs/cobalt_defconfig index 216f4023a81b..4b4d1ddb3d42 100644 --- a/trunk/arch/mips/configs/cobalt_defconfig +++ b/trunk/arch/mips/configs/cobalt_defconfig @@ -1,10 +1,55 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:05:57 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:23 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +# CONFIG_MODULES is not set + # # Machine selection # @@ -127,74 +172,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -# CONFIG_MODULES is not set - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -275,11 +256,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -309,7 +287,6 @@ CONFIG_FW_LOADER=y # Connector - unified userspace <-> kernelspace linker # CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y # # Memory Technology Devices (MTD) @@ -339,9 +316,18 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=y CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=y # @@ -415,6 +401,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=y +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -432,7 +419,6 @@ CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -588,7 +574,6 @@ CONFIG_COBALT_LCD=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -647,10 +632,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/db1000_defconfig b/trunk/arch/mips/configs/db1000_defconfig index 18ac7926c058..6501144ec612 100644 --- a/trunk/arch/mips/configs/db1000_defconfig +++ b/trunk/arch/mips/configs/db1000_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:05:59 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:26 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -127,80 +178,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -220,6 +201,7 @@ CONFIG_PCMCIA_IOCTL=y # # PC-card bridges # +# CONFIG_TCIC is not set # CONFIG_PCMCIA_AU1X00 is not set # @@ -277,19 +259,15 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -315,11 +293,8 @@ CONFIG_NETFILTER_NETLINK_LOG=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -368,7 +343,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -425,11 +399,6 @@ CONFIG_MTD_ALCHEMY=y # # CONFIG_MTD_NAND is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -448,9 +417,18 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -495,6 +473,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -511,7 +490,6 @@ CONFIG_CICADA_PHY=m CONFIG_NET_ETHERNET=y CONFIG_MII=m CONFIG_MIPS_AU1X00_ENET=y -# CONFIG_SMC91X is not set # # Ethernet (1000 Mbit) @@ -554,7 +532,6 @@ CONFIG_PPP_ASYNC=m # CONFIG_PPP_SYNC_TTY is not set CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -621,17 +598,13 @@ CONFIG_HW_CONSOLE=y # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_CS=m -CONFIG_SERIAL_8250_NR_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_AU1X00=y +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # -# CONFIG_SERIAL_AU1X00 is not set +CONFIG_SERIAL_AU1X00=y +CONFIG_SERIAL_AU1X00_CONSOLE=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y @@ -660,15 +633,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # PCMCIA character devices # CONFIG_SYNCLINK_CS=m -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -727,10 +696,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/db1100_defconfig b/trunk/arch/mips/configs/db1100_defconfig index 4f55f7414c9c..b8cd2cd923dd 100644 --- a/trunk/arch/mips/configs/db1100_defconfig +++ b/trunk/arch/mips/configs/db1100_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:00 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:29 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -127,80 +178,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -266,19 +247,15 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -304,11 +281,8 @@ CONFIG_NETFILTER_NETLINK_LOG=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -357,7 +331,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -414,11 +387,6 @@ CONFIG_MTD_ALCHEMY=y # # CONFIG_MTD_NAND is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -437,9 +405,18 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -484,6 +461,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -500,7 +478,6 @@ CONFIG_CICADA_PHY=m CONFIG_NET_ETHERNET=y CONFIG_MII=m CONFIG_MIPS_AU1X00_ENET=y -# CONFIG_SMC91X is not set # # Ethernet (1000 Mbit) @@ -530,7 +507,6 @@ CONFIG_PPP_ASYNC=m # CONFIG_PPP_SYNC_TTY is not set CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -597,16 +573,13 @@ CONFIG_HW_CONSOLE=y # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_NR_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_AU1X00=y +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # -# CONFIG_SERIAL_AU1X00 is not set +CONFIG_SERIAL_AU1X00=y +CONFIG_SERIAL_AU1X00_CONSOLE=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y @@ -635,8 +608,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -679,11 +650,12 @@ CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set -# CONFIG_FB_S1D13XXX is not set CONFIG_FB_AU1100=y +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -692,7 +664,6 @@ CONFIG_FB_AU1100=y # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set CONFIG_FONTS=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y @@ -726,10 +697,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/db1200_defconfig b/trunk/arch/mips/configs/db1200_defconfig index 0e5de7d05f23..530b6c2d99f6 100644 --- a/trunk/arch/mips/configs/db1200_defconfig +++ b/trunk/arch/mips/configs/db1200_defconfig @@ -1,10 +1,62 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:03 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:32 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -127,81 +179,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -219,6 +200,7 @@ CONFIG_PCMCIA_IOCTL=y # # PC-card bridges # +# CONFIG_TCIC is not set CONFIG_PCMCIA_AU1X00=m # @@ -273,17 +255,13 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# # CONFIG_NETFILTER_NETLINK is not set -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -309,11 +287,8 @@ CONFIG_NETFILTER=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -358,7 +333,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -420,11 +394,6 @@ CONFIG_MTD_NAND_IDS=y # CONFIG_MTD_NAND_DISKONCHIP is not set # CONFIG_MTD_NAND_NANDSIM is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -445,7 +414,16 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -474,6 +452,7 @@ CONFIG_IDE_GENERIC=y CONFIG_BLK_DEV_IDE_AU1XXX=y CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA=y # CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA is not set +# CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON is not set CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128 # CONFIG_IDE_ARM is not set # CONFIG_BLK_DEV_IDEDMA is not set @@ -516,7 +495,6 @@ CONFIG_SCSI_MULTI_LUN=y # # SCSI low-level drivers # -# CONFIG_ISCSI_TCP is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DEBUG is not set @@ -567,7 +545,6 @@ CONFIG_NETDEVICES=y CONFIG_NET_ETHERNET=y CONFIG_MII=m # CONFIG_MIPS_AU1X00_ENET is not set -# CONFIG_SMC91X is not set # # Ethernet (1000 Mbit) @@ -661,17 +638,13 @@ CONFIG_HW_CONSOLE=y # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_CS is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_AU1X00=y +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # -# CONFIG_SERIAL_AU1X00 is not set +CONFIG_SERIAL_AU1X00=y +CONFIG_SERIAL_AU1X00_CONSOLE=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y @@ -700,15 +673,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # PCMCIA character devices # # CONFIG_SYNCLINK_CS is not set -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -751,11 +720,12 @@ CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set -# CONFIG_FB_S1D13XXX is not set CONFIG_FB_AU1200=y +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -786,10 +756,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -896,7 +862,6 @@ CONFIG_RAMFS=y CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_SUMMARY is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y diff --git a/trunk/arch/mips/configs/db1500_defconfig b/trunk/arch/mips/configs/db1500_defconfig index 86e7be8412f3..1c2784dee697 100644 --- a/trunk/arch/mips/configs/db1500_defconfig +++ b/trunk/arch/mips/configs/db1500_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:05 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:36 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -129,80 +180,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -227,6 +208,7 @@ CONFIG_CARDBUS=y # CONFIG_YENTA is not set # CONFIG_PD6729 is not set # CONFIG_I82092 is not set +# CONFIG_TCIC is not set CONFIG_PCMCIA_AU1X00=m # @@ -285,19 +267,15 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -323,11 +301,8 @@ CONFIG_NETFILTER_NETLINK_LOG=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -376,7 +351,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -434,11 +408,6 @@ CONFIG_MTD_ALCHEMY=y # # CONFIG_MTD_NAND is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -463,9 +432,18 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_UB is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -540,6 +518,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -558,9 +537,7 @@ CONFIG_NET_ETHERNET=y CONFIG_MIPS_AU1X00_ENET=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set -# CONFIG_SMC91X is not set # # Tulip family network device support @@ -622,7 +599,6 @@ CONFIG_PPP_ASYNC=m # CONFIG_PPP_SYNC_TTY is not set CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -688,17 +664,13 @@ CONFIG_SERIO_RAW=m # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_CS is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_AU1X00=y +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # -# CONFIG_SERIAL_AU1X00 is not set +CONFIG_SERIAL_AU1X00=y +CONFIG_SERIAL_AU1X00_CONSOLE=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_JSM is not set @@ -730,15 +702,12 @@ CONFIG_LEGACY_PTY_COUNT=256 # PCMCIA character devices # CONFIG_SYNCLINK_CS=m -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -787,94 +756,12 @@ CONFIG_SOUND=y # # Advanced Linux Sound Architecture # -CONFIG_SND=m -CONFIG_SND_AC97_CODEC=m -CONFIG_SND_AC97_BUS=m -CONFIG_SND_TIMER=m -CONFIG_SND_PCM=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_VERBOSE_PRINTK is not set -# CONFIG_SND_DEBUG is not set -CONFIG_SND_GENERIC_DRIVER=y - -# -# Generic devices -# -# CONFIG_SND_DUMMY is not set -CONFIG_SND_VIRMIDI=m -CONFIG_SND_MTPAV=m -# CONFIG_SND_SERIAL_U16550 is not set -# CONFIG_SND_MPU401 is not set - -# -# PCI devices -# -# CONFIG_SND_ALI5451 is not set -# CONFIG_SND_ATIIXP is not set -# CONFIG_SND_ATIIXP_MODEM is not set -# CONFIG_SND_AU8810 is not set -# CONFIG_SND_AU8820 is not set -# CONFIG_SND_AU8830 is not set -# CONFIG_SND_AZT3328 is not set -# CONFIG_SND_BT87X is not set -# CONFIG_SND_CS46XX is not set -# CONFIG_SND_CS4281 is not set -# CONFIG_SND_EMU10K1 is not set -# CONFIG_SND_EMU10K1X is not set -# CONFIG_SND_CA0106 is not set -# CONFIG_SND_KORG1212 is not set -# CONFIG_SND_MIXART is not set -# CONFIG_SND_NM256 is not set -# CONFIG_SND_RME32 is not set -# CONFIG_SND_RME96 is not set -# CONFIG_SND_RME9652 is not set -# CONFIG_SND_HDSP is not set -# CONFIG_SND_HDSPM is not set -# CONFIG_SND_TRIDENT is not set -# CONFIG_SND_YMFPCI is not set -# CONFIG_SND_AD1889 is not set -# CONFIG_SND_CMIPCI is not set -# CONFIG_SND_ENS1370 is not set -# CONFIG_SND_ENS1371 is not set -# CONFIG_SND_ES1938 is not set -# CONFIG_SND_ES1968 is not set -# CONFIG_SND_MAESTRO3 is not set -# CONFIG_SND_FM801 is not set -# CONFIG_SND_ICE1712 is not set -# CONFIG_SND_ICE1724 is not set -# CONFIG_SND_INTEL8X0 is not set -# CONFIG_SND_INTEL8X0M is not set -# CONFIG_SND_SONICVIBES is not set -# CONFIG_SND_VIA82XX is not set -# CONFIG_SND_VIA82XX_MODEM is not set -# CONFIG_SND_VX222 is not set -# CONFIG_SND_HDA_INTEL is not set - -# -# ALSA MIPS devices -# -CONFIG_SND_AU1X00=m - -# -# USB devices -# -# CONFIG_SND_USB_AUDIO is not set - -# -# PCMCIA devices -# +# CONFIG_SND is not set # # Open Sound System # CONFIG_SOUND_PRIME=y -CONFIG_OBSOLETE_OSS_DRIVER=y # CONFIG_SOUND_BT878 is not set # CONFIG_SOUND_CMPCI is not set # CONFIG_SOUND_EMU10K1 is not set @@ -887,7 +774,7 @@ CONFIG_OBSOLETE_OSS_DRIVER=y # CONFIG_SOUND_MAESTRO3 is not set # CONFIG_SOUND_ICH is not set # CONFIG_SOUND_SONICVIBES is not set -# CONFIG_SOUND_AU1000 is not set +CONFIG_SOUND_AU1000=y # CONFIG_SOUND_TRIDENT is not set # CONFIG_SOUND_MSNDCLAS is not set # CONFIG_SOUND_MSNDPIN is not set @@ -928,15 +815,12 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y # USB Device Class drivers # # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # # CONFIG_USB_STORAGE is not set diff --git a/trunk/arch/mips/configs/db1550_defconfig b/trunk/arch/mips/configs/db1550_defconfig index ea5ab0ca5774..64248e2e924a 100644 --- a/trunk/arch/mips/configs/db1550_defconfig +++ b/trunk/arch/mips/configs/db1550_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:07 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:39 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -128,80 +179,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -226,6 +207,7 @@ CONFIG_CARDBUS=y # CONFIG_YENTA is not set # CONFIG_PD6729 is not set # CONFIG_I82092 is not set +# CONFIG_TCIC is not set CONFIG_PCMCIA_AU1X00=m # @@ -284,19 +266,15 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -322,11 +300,8 @@ CONFIG_NETFILTER_NETLINK_LOG=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -375,7 +350,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -438,11 +412,6 @@ CONFIG_MTD_NAND_AU1550=m # CONFIG_MTD_NAND_DISKONCHIP is not set # CONFIG_MTD_NAND_NANDSIM is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -466,9 +435,18 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -572,6 +550,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -590,9 +569,7 @@ CONFIG_MII=m CONFIG_MIPS_AU1X00_ENET=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set -# CONFIG_SMC91X is not set # # Tulip family network device support @@ -662,7 +639,6 @@ CONFIG_PPP_ASYNC=m # CONFIG_PPP_SYNC_TTY is not set CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -728,17 +704,13 @@ CONFIG_SERIO_RAW=m # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_CS is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_AU1X00=y +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # -# CONFIG_SERIAL_AU1X00 is not set +CONFIG_SERIAL_AU1X00=y +CONFIG_SERIAL_AU1X00_CONSOLE=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_JSM is not set @@ -770,15 +742,12 @@ CONFIG_LEGACY_PTY_COUNT=256 # PCMCIA character devices # CONFIG_SYNCLINK_CS=m -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -831,10 +800,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/ddb5476_defconfig b/trunk/arch/mips/configs/ddb5476_defconfig index bea00a9e9269..326f3aa63741 100644 --- a/trunk/arch/mips/configs/ddb5476_defconfig +++ b/trunk/arch/mips/configs/ddb5476_defconfig @@ -1,10 +1,55 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:09 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:42 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +# CONFIG_MODULES is not set + # # Machine selection # @@ -128,74 +173,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -# CONFIG_MODULES is not set - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -280,11 +261,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -314,7 +292,6 @@ CONFIG_FW_LOADER=y # Connector - unified userspace <-> kernelspace linker # CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y # # Memory Technology Devices (MTD) @@ -344,9 +321,18 @@ CONFIG_PROC_EVENTS=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=y CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=y # @@ -426,6 +412,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=y +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -443,7 +430,6 @@ CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set @@ -457,6 +443,7 @@ CONFIG_NET_ETHERNET=y # CONFIG_HP100 is not set # CONFIG_NET_ISA is not set # CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) @@ -604,7 +591,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -647,6 +633,7 @@ CONFIG_FB=y # CONFIG_FB_CFB_FILLRECT is not set # CONFIG_FB_CFB_COPYAREA is not set # CONFIG_FB_CFB_IMAGEBLIT is not set +# CONFIG_FB_SOFT_CURSOR is not set # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set @@ -655,7 +642,6 @@ CONFIG_FB=y # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set -# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_MATROX is not set @@ -672,6 +658,7 @@ CONFIG_FB=y # CONFIG_FB_SMIVGX is not set # CONFIG_FB_CYBLA is not set # CONFIG_FB_TRIDENT is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -700,10 +687,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/ddb5477_defconfig b/trunk/arch/mips/configs/ddb5477_defconfig index 61f7171ca7ed..c2a01df3c8df 100644 --- a/trunk/arch/mips/configs/ddb5477_defconfig +++ b/trunk/arch/mips/configs/ddb5477_defconfig @@ -1,10 +1,55 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:11 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:45 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +# CONFIG_MODULES is not set + # # Machine selection # @@ -128,74 +173,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -# CONFIG_MODULES is not set - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -279,11 +260,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -313,7 +291,6 @@ CONFIG_FW_LOADER=y # Connector - unified userspace <-> kernelspace linker # CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y # # Memory Technology Devices (MTD) @@ -342,9 +319,18 @@ CONFIG_PROC_EVENTS=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=y CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=y # @@ -396,6 +382,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=y +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -413,7 +400,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -589,7 +575,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -648,10 +633,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/decstation_defconfig b/trunk/arch/mips/configs/decstation_defconfig index 08a4de6ec4a6..5bc885b72d14 100644 --- a/trunk/arch/mips/configs/decstation_defconfig +++ b/trunk/arch/mips/configs/decstation_defconfig @@ -1,10 +1,62 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:13 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:48 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# 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_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -126,81 +178,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# 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_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -281,11 +262,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -340,7 +318,16 @@ CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -378,13 +365,12 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_SPI_ATTRS=m # CONFIG_SCSI_FC_ATTRS is not set -CONFIG_SCSI_ISCSI_ATTRS=m +# CONFIG_SCSI_ISCSI_ATTRS is not set CONFIG_SCSI_SAS_ATTRS=m # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m CONFIG_SCSI_DECNCR=y # CONFIG_SCSI_DECSII is not set # CONFIG_SCSI_SATA is not set @@ -421,6 +407,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -504,7 +491,10 @@ CONFIG_ZS=y # # Non-8250 serial port support # -# CONFIG_SERIAL_DZ is not set +CONFIG_SERIAL_DZ=y +CONFIG_SERIAL_DZ_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 @@ -530,8 +520,6 @@ CONFIG_RTC=y # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -574,14 +562,15 @@ CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set -# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_PMAG_AA is not set CONFIG_FB_PMAG_BA=y CONFIG_FB_PMAGB_B=y # CONFIG_FB_MAXINE is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -605,10 +594,6 @@ CONFIG_LOGO_DEC_CLUT224=y # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -761,8 +746,6 @@ CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" # CONFIG_DEBUG_STACK_USAGE is not set diff --git a/trunk/arch/mips/configs/e55_defconfig b/trunk/arch/mips/configs/e55_defconfig index c9070cef08b1..c0d06ea5566c 100644 --- a/trunk/arch/mips/configs/e55_defconfig +++ b/trunk/arch/mips/configs/e55_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:14 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:51 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -129,80 +180,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -281,11 +262,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -339,7 +317,16 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -416,6 +403,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -439,6 +427,7 @@ CONFIG_NET_ETHERNET=y # CONFIG_HP100 is not set # CONFIG_NET_ISA is not set # CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) @@ -563,7 +552,6 @@ CONFIG_WATCHDOG=y # CONFIG_WDT is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set -# CONFIG_RTC_VR41XX is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -576,8 +564,6 @@ CONFIG_GPIO_VR41XX=y # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -636,10 +622,6 @@ CONFIG_DUMMY_CONSOLE=y # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/ev64120_defconfig b/trunk/arch/mips/configs/ev64120_defconfig index 14e3815f11e6..f1309d84d2fe 100644 --- a/trunk/arch/mips/configs/ev64120_defconfig +++ b/trunk/arch/mips/configs/ev64120_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:16 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:54 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +# CONFIG_KMOD is not set + # # Machine selection # @@ -130,80 +181,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -# CONFIG_KMOD is not set - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -286,11 +267,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -348,9 +326,18 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -402,6 +389,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -419,7 +407,6 @@ CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -477,7 +464,6 @@ CONFIG_PPP_ASYNC=y # CONFIG_PPP_SYNC_TTY is not set # CONFIG_PPP_DEFLATE is not set # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m # CONFIG_PPPOE is not set # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -583,7 +569,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -642,10 +627,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/ev96100_defconfig b/trunk/arch/mips/configs/ev96100_defconfig index 510819581d8a..8ac55b7acc01 100644 --- a/trunk/arch/mips/configs/ev96100_defconfig +++ b/trunk/arch/mips/configs/ev96100_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:18 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:57 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +# CONFIG_KMOD is not set + # # Machine selection # @@ -134,80 +185,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -# CONFIG_KMOD is not set - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -288,11 +269,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -345,9 +323,18 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -392,6 +379,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -530,8 +518,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -589,10 +575,6 @@ CONFIG_DUMMY_CONSOLE=y # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/ip22_defconfig b/trunk/arch/mips/configs/ip22_defconfig index 67979e3e606e..3ae3838f283c 100644 --- a/trunk/arch/mips/configs/ip22_defconfig +++ b/trunk/arch/mips/configs/ip22_defconfig @@ -1,10 +1,62 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:20 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:01 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -135,81 +187,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_PREEMPT_NONE is not set CONFIG_PREEMPT_VOLUNTARY=y # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -311,10 +292,6 @@ CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m @@ -368,7 +345,6 @@ CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m -CONFIG_IP_NF_TARGET_NFQUEUE=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m @@ -417,7 +393,6 @@ CONFIG_IP6_NF_MATCH_EUI64=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_TARGET_REJECT=m -CONFIG_IP6_NF_TARGET_NFQUEUE=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m CONFIG_IP6_NF_TARGET_HL=m @@ -449,18 +424,10 @@ CONFIG_SCTP_HMAC_MD5=y CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# CONFIG_NET_SCHED=y # CONFIG_NET_SCH_CLK_JIFFIES is not set CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y # CONFIG_NET_SCH_CLK_CPU is not set - -# -# Queueing/Scheduling -# CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m @@ -473,10 +440,8 @@ CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m - -# -# Classification -# +CONFIG_NET_QOS=y +CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_TCINDEX=m @@ -485,14 +450,13 @@ CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set +# CONFIG_NET_CLS_IND is not set # CONFIG_CLS_U32_MARK is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_EMATCH is not set # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y -# CONFIG_NET_CLS_IND is not set -CONFIG_NET_ESTIMATOR=y # # Network testing @@ -545,9 +509,18 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -591,7 +564,6 @@ CONFIG_SCSI_SAS_ATTRS=m # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m CONFIG_SGIWD93_SCSI=y # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DEBUG is not set @@ -627,6 +599,7 @@ CONFIG_TUN=m # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -779,8 +752,6 @@ CONFIG_MAX_RAW_DEVS=256 # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -849,10 +820,6 @@ CONFIG_LOGO_SGI_CLUT224=y # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -889,7 +856,7 @@ CONFIG_FS_MBCACHE=y CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m CONFIG_XFS_EXPORT=y -CONFIG_XFS_QUOTA=y +CONFIG_XFS_QUOTA=m CONFIG_XFS_SECURITY=y # CONFIG_XFS_POSIX_ACL is not set # CONFIG_XFS_RT is not set diff --git a/trunk/arch/mips/configs/ip27_defconfig b/trunk/arch/mips/configs/ip27_defconfig index 03af44d1d846..d962f61d5b98 100644 --- a/trunk/arch/mips/configs/ip27_defconfig +++ b/trunk/arch/mips/configs/ip27_defconfig @@ -1,10 +1,64 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:21 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:04 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_CPUSETS=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# 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_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y + # # Machine selection # @@ -132,7 +186,6 @@ CONFIG_DISCONTIGMEM=y CONFIG_FLAT_NODE_MEM_MAP=y CONFIG_NEED_MULTIPLE_NODES=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_SMP=y CONFIG_NR_CPUS=64 CONFIG_PREEMPT_NONE=y @@ -141,77 +194,6 @@ CONFIG_PREEMPT_NONE=y CONFIG_PREEMPT_BKL=y # CONFIG_MIPS_INSANE_LARGE is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_LOCK_KERNEL=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_POSIX_MQUEUE=y -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_CPUSETS=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# 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_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y -CONFIG_STOP_MACHINE=y - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -302,18 +284,10 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# CONFIG_NET_SCHED=y # CONFIG_NET_SCH_CLK_JIFFIES is not set CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y # CONFIG_NET_SCH_CLK_CPU is not set - -# -# Queueing/Scheduling -# CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m @@ -326,10 +300,8 @@ CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m - -# -# Classification -# +CONFIG_NET_QOS=y +CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_TCINDEX=m @@ -338,13 +310,12 @@ CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set +# CONFIG_NET_CLS_IND is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_EMATCH is not set # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y -# CONFIG_NET_CLS_IND is not set -CONFIG_NET_ESTIMATOR=y # # Network testing @@ -406,6 +377,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -449,7 +428,6 @@ CONFIG_SCSI_SAS_ATTRS=m # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -459,7 +437,6 @@ CONFIG_ISCSI_TCP=m # CONFIG_SCSI_AIC79XX is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set @@ -470,6 +447,7 @@ CONFIG_ISCSI_TCP=m # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_FC is not set CONFIG_SCSI_QLOGIC_1280=y +CONFIG_SCSI_QLOGIC_1280_1040=y CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set @@ -509,7 +487,6 @@ CONFIG_DM_MULTIPATH_EMC=m # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support @@ -539,6 +516,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -554,12 +532,8 @@ CONFIG_CICADA_PHY=m # CONFIG_NET_ETHERNET=y CONFIG_MII=y -CONFIG_SGI_IOC3_ETH=y -CONFIG_SGI_IOC3_ETH_HW_RX_CSUM=y -CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -698,7 +672,6 @@ CONFIG_SGI_IP27_RTC=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -751,10 +724,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -793,7 +762,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y +CONFIG_XFS_QUOTA=m CONFIG_XFS_SECURITY=y CONFIG_XFS_POSIX_ACL=y # CONFIG_XFS_RT is not set diff --git a/trunk/arch/mips/configs/ip32_defconfig b/trunk/arch/mips/configs/ip32_defconfig index cba2a49cceb1..bf8fb95b21dc 100644 --- a/trunk/arch/mips/configs/ip32_defconfig +++ b/trunk/arch/mips/configs/ip32_defconfig @@ -1,10 +1,56 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:24 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:07 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +CONFIG_BSD_PROCESS_ACCT=y +# CONFIG_BSD_PROCESS_ACCT_V3 is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +# CONFIG_MODULES is not set + # # Machine selection # @@ -133,74 +179,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_PREEMPT_NONE is not set CONFIG_PREEMPT_VOLUNTARY=y # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -CONFIG_BSD_PROCESS_ACCT=y -# CONFIG_BSD_PROCESS_ACCT_V3 is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -# CONFIG_MODULES is not set - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -289,11 +271,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -323,7 +302,6 @@ CONFIG_FW_LOADER=y # Connector - unified userspace <-> kernelspace linker # CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y # # Memory Technology Devices (MTD) @@ -356,6 +334,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_CDROM_PKTCDVD=y CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=y # @@ -399,7 +385,6 @@ CONFIG_SCSI_SAS_ATTRS=y # # SCSI low-level drivers # -# CONFIG_ISCSI_TCP is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -414,7 +399,6 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y # CONFIG_SCSI_AIC79XX is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set @@ -448,7 +432,6 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support @@ -478,6 +461,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=y +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -496,7 +480,6 @@ CONFIG_NET_ETHERNET=y CONFIG_SGI_O2MACE_ETH=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -654,7 +637,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -713,10 +695,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/it8172_defconfig b/trunk/arch/mips/configs/it8172_defconfig index e7ee1679af90..0940771bafb1 100644 --- a/trunk/arch/mips/configs/it8172_defconfig +++ b/trunk/arch/mips/configs/it8172_defconfig @@ -1,10 +1,62 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:26 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:09 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +CONFIG_BSD_PROCESS_ACCT=y +# CONFIG_BSD_PROCESS_ACCT_V3 is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -129,81 +181,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -CONFIG_BSD_PROCESS_ACCT=y -# CONFIG_BSD_PROCESS_ACCT_V3 is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -285,11 +266,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -337,7 +315,6 @@ CONFIG_MTD_CHAR=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -395,11 +372,6 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2 # # CONFIG_MTD_NAND is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -418,9 +390,18 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -486,6 +467,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -627,8 +609,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -689,10 +669,10 @@ CONFIG_SOUND=y # Open Sound System # CONFIG_SOUND_PRIME=y -# CONFIG_OBSOLETE_OSS_DRIVER is not set CONFIG_SOUND_IT8172=y # CONFIG_SOUND_MSNDCLAS is not set # CONFIG_SOUND_MSNDPIN is not set +# CONFIG_SOUND_AD1980 is not set # # USB support @@ -700,10 +680,6 @@ CONFIG_SOUND_IT8172=y # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/ivr_defconfig b/trunk/arch/mips/configs/ivr_defconfig index 138c8a60a4dc..9ba61dfc490d 100644 --- a/trunk/arch/mips/configs/ivr_defconfig +++ b/trunk/arch/mips/configs/ivr_defconfig @@ -1,10 +1,62 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:27 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:12 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +CONFIG_BSD_PROCESS_ACCT=y +# CONFIG_BSD_PROCESS_ACCT_V3 is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -126,81 +178,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -CONFIG_BSD_PROCESS_ACCT=y -# CONFIG_BSD_PROCESS_ACCT_V3 is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -284,11 +265,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -346,9 +324,18 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -422,6 +409,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -439,7 +427,6 @@ CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -552,8 +539,7 @@ CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set CONFIG_QTRONIX_KEYBOARD=y -CONFIG_IT8172_SCR0=y -CONFIG_IT8172_SCR1=y +# CONFIG_IT8172_SCR0 is not set # # Serial drivers @@ -597,7 +583,6 @@ CONFIG_RTC=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -656,10 +641,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/jaguar-atx_defconfig b/trunk/arch/mips/configs/jaguar-atx_defconfig index 6238e0d6a430..21b2b8042f91 100644 --- a/trunk/arch/mips/configs/jaguar-atx_defconfig +++ b/trunk/arch/mips/configs/jaguar-atx_defconfig @@ -1,10 +1,59 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:29 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:14 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -135,79 +184,11 @@ CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_SMP is not set CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -# CONFIG_EXPERIMENTAL is not set -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -278,11 +259,8 @@ CONFIG_IPV6_TUNNEL=m # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -339,9 +317,18 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -393,6 +380,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -410,7 +398,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -604,10 +591,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/jmr3927_defconfig b/trunk/arch/mips/configs/jmr3927_defconfig index a8ded3d74152..6390a753e80b 100644 --- a/trunk/arch/mips/configs/jmr3927_defconfig +++ b/trunk/arch/mips/configs/jmr3927_defconfig @@ -1,10 +1,55 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:31 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:17 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +# CONFIG_MODULES is not set + # # Machine selection # @@ -123,75 +168,11 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set CONFIG_RTC_DS1742=y -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -# CONFIG_MODULES is not set - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -275,11 +256,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -309,7 +287,6 @@ CONFIG_FW_LOADER=y # Connector - unified userspace <-> kernelspace linker # CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y # # Memory Technology Devices (MTD) @@ -338,9 +315,18 @@ CONFIG_PROC_EVENTS=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=y CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=y # @@ -392,6 +378,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=y +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -409,7 +396,6 @@ CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -575,7 +561,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -618,6 +603,7 @@ CONFIG_FB=y # CONFIG_FB_CFB_FILLRECT is not set # CONFIG_FB_CFB_COPYAREA is not set # CONFIG_FB_CFB_IMAGEBLIT is not set +# CONFIG_FB_SOFT_CURSOR is not set # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set @@ -626,7 +612,6 @@ CONFIG_FB=y # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set -# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_MATROX is not set @@ -643,6 +628,7 @@ CONFIG_FB=y # CONFIG_FB_SMIVGX is not set # CONFIG_FB_CYBLA is not set # CONFIG_FB_TRIDENT is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -670,10 +656,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/lasat200_defconfig b/trunk/arch/mips/configs/lasat200_defconfig index a7ad99b12fe5..03cd0ca6e639 100644 --- a/trunk/arch/mips/configs/lasat200_defconfig +++ b/trunk/arch/mips/configs/lasat200_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:33 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:19 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -133,80 +184,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -286,11 +267,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -339,7 +317,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -397,11 +374,6 @@ CONFIG_MTD_LASAT=y # # CONFIG_MTD_NAND is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -424,9 +396,18 @@ CONFIG_MTD_LASAT=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -530,6 +511,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -547,7 +529,6 @@ CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -703,7 +684,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -762,10 +742,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/malta_defconfig b/trunk/arch/mips/configs/malta_defconfig index d1c44216f1c1..2acdec959dd0 100644 --- a/trunk/arch/mips/configs/malta_defconfig +++ b/trunk/arch/mips/configs/malta_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:35 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:22 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -146,80 +197,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -334,10 +315,6 @@ CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m @@ -392,7 +369,6 @@ CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m -CONFIG_IP_NF_TARGET_NFQUEUE=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m @@ -442,7 +418,6 @@ CONFIG_IP6_NF_MATCH_PHYSDEV=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_TARGET_REJECT=m -CONFIG_IP6_NF_TARGET_NFQUEUE=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m CONFIG_IP6_NF_TARGET_HL=m @@ -503,18 +478,10 @@ CONFIG_IPDDP_DECAP=y CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set - -# -# Queueing/Scheduling -# CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m @@ -527,10 +494,8 @@ CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m - -# -# Classification -# +CONFIG_NET_QOS=y +CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_TCINDEX=m @@ -539,14 +504,13 @@ CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set +CONFIG_NET_CLS_IND=y # CONFIG_CLS_U32_MARK is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_EMATCH is not set # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y -CONFIG_NET_CLS_IND=y -CONFIG_NET_ESTIMATOR=y # # Network testing @@ -608,9 +572,18 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -707,7 +680,6 @@ CONFIG_SCSI_SAS_ATTRS=m # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m CONFIG_BLK_DEV_3W_XXXX_RAID=m CONFIG_SCSI_3W_9XXX=m CONFIG_SCSI_ACARD=m @@ -723,7 +695,6 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y # CONFIG_SCSI_DPT_I2O is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set @@ -774,7 +745,6 @@ CONFIG_DM_MULTIPATH_EMC=m # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support @@ -804,6 +774,7 @@ CONFIG_TUN=m # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -821,7 +792,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -997,7 +967,6 @@ CONFIG_RTC=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -1056,10 +1025,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -1106,7 +1071,7 @@ CONFIG_JFS_SECURITY=y CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m CONFIG_XFS_EXPORT=y -CONFIG_XFS_QUOTA=y +CONFIG_XFS_QUOTA=m CONFIG_XFS_SECURITY=y CONFIG_XFS_POSIX_ACL=y # CONFIG_XFS_RT is not set diff --git a/trunk/arch/mips/configs/mipssim_defconfig b/trunk/arch/mips/configs/mipssim_defconfig index ac39ab7feeb7..fb9bdd9e3151 100644 --- a/trunk/arch/mips/configs/mipssim_defconfig +++ b/trunk/arch/mips/configs/mipssim_defconfig @@ -1,10 +1,62 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:37 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:25 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -132,81 +184,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -300,18 +281,10 @@ CONFIG_SCTP_HMAC_MD5=y CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set - -# -# Queueing/Scheduling -# CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m @@ -324,10 +297,8 @@ CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m - -# -# Classification -# +CONFIG_NET_QOS=y +CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_TCINDEX=m @@ -340,7 +311,6 @@ CONFIG_NET_CLS_ROUTE=y # CONFIG_NET_EMATCH is not set # CONFIG_NET_CLS_ACT is not set # CONFIG_NET_CLS_POLICE is not set -CONFIG_NET_ESTIMATOR=y # # Network testing @@ -391,7 +361,16 @@ CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_NBD=y # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -558,8 +537,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -611,10 +588,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -748,8 +721,6 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_KOBJECT is not set CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="nfsroot=192.168.192.169:/u1/mipsel,timeo=20 ip=dhcp" # CONFIG_DEBUG_STACK_USAGE is not set diff --git a/trunk/arch/mips/configs/mpc30x_defconfig b/trunk/arch/mips/configs/mpc30x_defconfig index 2b5ea37484e4..e2c082128532 100644 --- a/trunk/arch/mips/configs/mpc30x_defconfig +++ b/trunk/arch/mips/configs/mpc30x_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:39 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:28 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -131,80 +182,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -229,6 +210,7 @@ CONFIG_PCMCIA_IOCTL=y # CONFIG_YENTA is not set # CONFIG_PD6729 is not set # CONFIG_I82092 is not set +# CONFIG_TCIC is not set CONFIG_PCMCIA_VRC4173=y # @@ -299,11 +281,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -362,7 +341,16 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_UB is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -624,7 +612,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set -# CONFIG_RTC_VR41XX is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -638,8 +625,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # PCMCIA character devices # # CONFIG_SYNCLINK_CS is not set -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set CONFIG_GPIO_VR41XX=y # CONFIG_RAW_DRIVER is not set @@ -647,7 +632,6 @@ CONFIG_GPIO_VR41XX=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -729,15 +713,12 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y # # USB Device Class drivers # +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # # CONFIG_USB_STORAGE is not set diff --git a/trunk/arch/mips/configs/ocelot_3_defconfig b/trunk/arch/mips/configs/ocelot_3_defconfig index 9081ea5a9dbd..f18d05c2ca77 100644 --- a/trunk/arch/mips/configs/ocelot_3_defconfig +++ b/trunk/arch/mips/configs/ocelot_3_defconfig @@ -1,10 +1,62 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:41 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:30 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + # # Machine selection # @@ -135,82 +187,11 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_SMP is not set CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -284,19 +265,15 @@ CONFIG_IPV6=m # CONFIG_IPV6_TUNNEL is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -328,11 +305,8 @@ CONFIG_NETFILTER_NETLINK_LOG=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -391,7 +365,16 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -428,13 +411,12 @@ CONFIG_SCSI_PROC_FS=y # # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_FC_ATTRS is not set -CONFIG_SCSI_ISCSI_ATTRS=m +# CONFIG_SCSI_ISCSI_ATTRS is not set CONFIG_SCSI_SAS_ATTRS=m # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -445,7 +427,6 @@ CONFIG_ISCSI_TCP=m # CONFIG_SCSI_DPT_I2O is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set @@ -480,7 +461,6 @@ CONFIG_SCSI_QLA2XXX=m # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support @@ -510,6 +490,7 @@ CONFIG_TUN=m # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -527,7 +508,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -609,7 +589,6 @@ CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_NET_FC is not set @@ -712,7 +691,6 @@ CONFIG_RTC=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -755,6 +733,7 @@ CONFIG_FB=y # CONFIG_FB_CFB_FILLRECT is not set # CONFIG_FB_CFB_COPYAREA is not set # CONFIG_FB_CFB_IMAGEBLIT is not set +# CONFIG_FB_SOFT_CURSOR is not set # CONFIG_FB_MACMODES is not set CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_TILEBLITTING is not set @@ -763,7 +742,6 @@ CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set -# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_MATROX is not set @@ -780,6 +758,7 @@ CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_SMIVGX is not set # CONFIG_FB_CYBLA is not set # CONFIG_FB_TRIDENT is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -788,7 +767,6 @@ CONFIG_FB_MODE_HELPERS=y # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y @@ -814,10 +792,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/ocelot_c_defconfig b/trunk/arch/mips/configs/ocelot_c_defconfig index 570fc4d18166..d3a5fee02b79 100644 --- a/trunk/arch/mips/configs/ocelot_c_defconfig +++ b/trunk/arch/mips/configs/ocelot_c_defconfig @@ -1,10 +1,55 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:43 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:33 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +# CONFIG_MODULES is not set + # # Machine selection # @@ -131,73 +176,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -# CONFIG_MODULES is not set - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -285,11 +267,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -319,7 +298,6 @@ CONFIG_FW_LOADER=y # Connector - unified userspace <-> kernelspace linker # CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y # # Memory Technology Devices (MTD) @@ -351,6 +329,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_CDROM_PKTCDVD=y CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=y # @@ -402,6 +388,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=y +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -419,7 +406,6 @@ CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -576,7 +562,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -635,10 +620,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/ocelot_defconfig b/trunk/arch/mips/configs/ocelot_defconfig index 6634ab24715c..1edde12ebff9 100644 --- a/trunk/arch/mips/configs/ocelot_defconfig +++ b/trunk/arch/mips/configs/ocelot_defconfig @@ -1,10 +1,55 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:44 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:35 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +# CONFIG_MODULES is not set + # # Machine selection # @@ -136,74 +181,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -# CONFIG_MODULES is not set - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -284,11 +265,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -318,7 +296,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Connector - unified userspace <-> kernelspace linker # CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y # # Memory Technology Devices (MTD) @@ -342,9 +319,18 @@ CONFIG_PROC_EVENTS=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=y CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=y # @@ -389,6 +375,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=y +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -526,8 +513,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -585,10 +570,6 @@ CONFIG_DUMMY_CONSOLE=y # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/ocelot_g_defconfig b/trunk/arch/mips/configs/ocelot_g_defconfig index 4c396e1e2f0a..e2d5188cdc15 100644 --- a/trunk/arch/mips/configs/ocelot_g_defconfig +++ b/trunk/arch/mips/configs/ocelot_g_defconfig @@ -1,10 +1,55 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:46 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:38 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +# CONFIG_MODULES is not set + # # Machine selection # @@ -134,73 +179,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -# CONFIG_MODULES is not set - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -288,11 +270,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -322,7 +301,6 @@ CONFIG_FW_LOADER=y # Connector - unified userspace <-> kernelspace linker # CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y # # Memory Technology Devices (MTD) @@ -354,6 +332,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_CDROM_PKTCDVD=y CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=y # @@ -405,6 +391,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=y +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -423,7 +410,6 @@ CONFIG_MII=y CONFIG_GALILEO_64240_ETH=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -579,7 +565,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -638,10 +623,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/pb1100_defconfig b/trunk/arch/mips/configs/pb1100_defconfig index 883626afc47d..47247addee1b 100644 --- a/trunk/arch/mips/configs/pb1100_defconfig +++ b/trunk/arch/mips/configs/pb1100_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:48 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:41 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -129,80 +180,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -222,6 +203,7 @@ CONFIG_PCMCIA_IOCTL=y # # PC-card bridges # +# CONFIG_TCIC is not set # CONFIG_PCMCIA_AU1X00 is not set # @@ -279,19 +261,15 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -317,11 +295,8 @@ CONFIG_NETFILTER_NETLINK_LOG=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -370,7 +345,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -427,11 +401,6 @@ CONFIG_MTD_ALCHEMY=y # # CONFIG_MTD_NAND is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -450,9 +419,18 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -497,6 +475,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -513,7 +492,6 @@ CONFIG_CICADA_PHY=m CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_MIPS_AU1X00_ENET is not set -# CONFIG_SMC91X is not set # # Ethernet (1000 Mbit) @@ -548,7 +526,6 @@ CONFIG_PPP_ASYNC=m # CONFIG_PPP_SYNC_TTY is not set CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -615,19 +592,12 @@ CONFIG_HW_CONSOLE=y # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_CS is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_AU1X00=y +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # # CONFIG_SERIAL_AU1X00 is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 @@ -654,15 +624,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # PCMCIA character devices # CONFIG_SYNCLINK_CS=m -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -721,10 +687,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/pb1500_defconfig b/trunk/arch/mips/configs/pb1500_defconfig index f8fbc77f924e..f91a4eaae51a 100644 --- a/trunk/arch/mips/configs/pb1500_defconfig +++ b/trunk/arch/mips/configs/pb1500_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:50 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:44 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -128,80 +179,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -226,6 +207,7 @@ CONFIG_CARDBUS=y # CONFIG_YENTA is not set CONFIG_PD6729=m # CONFIG_I82092 is not set +# CONFIG_TCIC is not set # CONFIG_PCMCIA_AU1X00 is not set CONFIG_PCCARD_NONSTATIC=m @@ -285,19 +267,15 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -323,11 +301,8 @@ CONFIG_NETFILTER_NETLINK_LOG=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -376,7 +351,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -434,11 +408,6 @@ CONFIG_MTD_ALCHEMY=y # # CONFIG_MTD_NAND is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -462,9 +431,18 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -568,6 +546,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -586,9 +565,7 @@ CONFIG_MII=m CONFIG_MIPS_AU1X00_ENET=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set -# CONFIG_SMC91X is not set # # Tulip family network device support @@ -658,7 +635,6 @@ CONFIG_PPP_ASYNC=m # CONFIG_PPP_SYNC_TTY is not set CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -724,17 +700,13 @@ CONFIG_SERIO_RAW=m # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_CS is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_AU1X00=y +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # -# CONFIG_SERIAL_AU1X00 is not set +CONFIG_SERIAL_AU1X00=y +CONFIG_SERIAL_AU1X00_CONSOLE=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_JSM is not set @@ -766,15 +738,12 @@ CONFIG_LEGACY_PTY_COUNT=256 # PCMCIA character devices # CONFIG_SYNCLINK_CS=m -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -827,10 +796,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/pb1550_defconfig b/trunk/arch/mips/configs/pb1550_defconfig index 3d694cd68d38..bbad27cb40a2 100644 --- a/trunk/arch/mips/configs/pb1550_defconfig +++ b/trunk/arch/mips/configs/pb1550_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:52 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:47 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -128,80 +179,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -226,6 +207,7 @@ CONFIG_CARDBUS=y # CONFIG_YENTA is not set CONFIG_PD6729=m # CONFIG_I82092 is not set +# CONFIG_TCIC is not set # CONFIG_PCMCIA_AU1X00 is not set CONFIG_PCCARD_NONSTATIC=m @@ -285,19 +267,15 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -323,11 +301,8 @@ CONFIG_NETFILTER_NETLINK_LOG=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -376,7 +351,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -434,11 +408,6 @@ CONFIG_MTD_ALCHEMY=y # # CONFIG_MTD_NAND is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -462,9 +431,18 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -568,6 +546,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -586,9 +565,7 @@ CONFIG_NET_ETHERNET=y CONFIG_MIPS_AU1X00_ENET=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set -# CONFIG_SMC91X is not set # # Tulip family network device support @@ -650,7 +627,6 @@ CONFIG_PPP_ASYNC=m # CONFIG_PPP_SYNC_TTY is not set CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -716,17 +692,13 @@ CONFIG_SERIO_RAW=m # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -# CONFIG_SERIAL_8250_CS is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -CONFIG_SERIAL_8250_AU1X00=y +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # -# CONFIG_SERIAL_AU1X00 is not set +CONFIG_SERIAL_AU1X00=y +CONFIG_SERIAL_AU1X00_CONSOLE=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_JSM is not set @@ -758,15 +730,12 @@ CONFIG_LEGACY_PTY_COUNT=256 # PCMCIA character devices # CONFIG_SYNCLINK_CS=m -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -819,10 +788,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/pnx8550-jbs_defconfig b/trunk/arch/mips/configs/pnx8550-jbs_defconfig index fba624a792a9..555837e4c06f 100644 --- a/trunk/arch/mips/configs/pnx8550-jbs_defconfig +++ b/trunk/arch/mips/configs/pnx8550-jbs_defconfig @@ -1,10 +1,62 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:54 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:50 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_MODULE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + # # Machine selection # @@ -127,81 +179,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -# CONFIG_MODULE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -284,11 +265,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -347,7 +325,16 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_INITRD=y +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -436,13 +423,12 @@ CONFIG_SCSI_CONSTANTS=y # # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_FC_ATTRS is not set -CONFIG_SCSI_ISCSI_ATTRS=m +# CONFIG_SCSI_ISCSI_ATTRS is not set # CONFIG_SCSI_SAS_ATTRS is not set # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -453,7 +439,6 @@ CONFIG_ISCSI_TCP=m # CONFIG_SCSI_DPT_I2O is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set @@ -488,7 +473,6 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support @@ -526,7 +510,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -698,7 +681,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -781,15 +763,12 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y # # USB Device Class drivers # +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set @@ -1060,8 +1039,6 @@ CONFIG_DEBUG_SLAB=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp" # CONFIG_DEBUG_STACK_USAGE is not set @@ -1078,31 +1055,7 @@ CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp" # # Cryptographic options # -CONFIG_CRYPTO=y -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_MD4 is not set -CONFIG_CRYPTO_MD5=m -# CONFIG_CRYPTO_SHA1 is not set -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_WP512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_DES is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_TWOFISH is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_AES is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_ARC4 is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_MICHAEL_MIC is not set -CONFIG_CRYPTO_CRC32C=m -# CONFIG_CRYPTO_TEST is not set +# CONFIG_CRYPTO is not set # # Hardware crypto devices @@ -1114,4 +1067,4 @@ CONFIG_CRYPTO_CRC32C=m CONFIG_CRC_CCITT=m # CONFIG_CRC16 is not set CONFIG_CRC32=y -CONFIG_LIBCRC32C=m +# CONFIG_LIBCRC32C is not set diff --git a/trunk/arch/mips/configs/pnx8550-v2pci_defconfig b/trunk/arch/mips/configs/pnx8550-v2pci_defconfig index d9a0d2fdba4f..37bd8d5c865d 100644 --- a/trunk/arch/mips/configs/pnx8550-v2pci_defconfig +++ b/trunk/arch/mips/configs/pnx8550-v2pci_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:06:58 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:53 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_MODULE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + # # Machine selection # @@ -129,80 +180,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -# CONFIG_MODULE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -274,17 +255,13 @@ CONFIG_IPV6=m # CONFIG_IPV6_TUNNEL is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# # CONFIG_NETFILTER_NETLINK is not set -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -316,11 +293,8 @@ CONFIG_NETFILTER=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -378,7 +352,16 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_INITRD=y +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -468,13 +451,12 @@ CONFIG_BLK_DEV_SD=y # CONFIG_SCSI_SPI_ATTRS=m # CONFIG_SCSI_FC_ATTRS is not set -CONFIG_SCSI_ISCSI_ATTRS=m +# CONFIG_SCSI_ISCSI_ATTRS is not set # CONFIG_SCSI_SAS_ATTRS is not set # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -490,7 +472,6 @@ CONFIG_AIC7XXX_DEBUG_MASK=0 # CONFIG_SCSI_DPT_I2O is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set @@ -525,7 +506,6 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support @@ -563,7 +543,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -643,7 +622,6 @@ CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m # CONFIG_PPPOE is not set # CONFIG_SLIP is not set # CONFIG_NET_FC is not set @@ -768,7 +746,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -819,7 +796,6 @@ CONFIG_I2C_ALGOBIT=m # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -896,6 +872,7 @@ CONFIG_FB=y # CONFIG_FB_CFB_FILLRECT is not set # CONFIG_FB_CFB_COPYAREA is not set # CONFIG_FB_CFB_IMAGEBLIT is not set +# CONFIG_FB_SOFT_CURSOR is not set # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set @@ -904,7 +881,6 @@ CONFIG_FB=y # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set -# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_MATROX is not set @@ -921,6 +897,7 @@ CONFIG_FB=y # CONFIG_FB_SMIVGX is not set # CONFIG_FB_CYBLA is not set # CONFIG_FB_TRIDENT is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -969,15 +946,12 @@ CONFIG_USB_DEVICEFS=y # # USB Device Class drivers # +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set @@ -1261,31 +1235,7 @@ CONFIG_CMDLINE="" # # Cryptographic options # -CONFIG_CRYPTO=y -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_MD4 is not set -CONFIG_CRYPTO_MD5=m -CONFIG_CRYPTO_SHA1=m -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_WP512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_DES is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_TWOFISH is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_AES is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -# CONFIG_CRYPTO_TEA is not set -CONFIG_CRYPTO_ARC4=m -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_MICHAEL_MIC is not set -CONFIG_CRYPTO_CRC32C=m -# CONFIG_CRYPTO_TEST is not set +# CONFIG_CRYPTO is not set # # Hardware crypto devices @@ -1297,6 +1247,6 @@ CONFIG_CRYPTO_CRC32C=m CONFIG_CRC_CCITT=m # CONFIG_CRC16 is not set CONFIG_CRC32=y -CONFIG_LIBCRC32C=m +# CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m diff --git a/trunk/arch/mips/configs/qemu_defconfig b/trunk/arch/mips/configs/qemu_defconfig index dee44606164c..741a9a971367 100644 --- a/trunk/arch/mips/configs/qemu_defconfig +++ b/trunk/arch/mips/configs/qemu_defconfig @@ -1,10 +1,54 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:07:00 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:56 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +# CONFIG_SWAP is not set +# CONFIG_SYSVIPC is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +# CONFIG_BUG is not set +# CONFIG_BASE_FULL is not set +# CONFIG_FUTEX is not set +# CONFIG_EPOLL is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +# CONFIG_SHMEM is not set +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_TINY_SHMEM=y +CONFIG_BASE_SMALL=1 + +# +# Loadable module support +# +# CONFIG_MODULES is not set + # # Machine selection # @@ -124,73 +168,10 @@ CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -# CONFIG_EXPERIMENTAL is not set -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -# CONFIG_SWAP is not set -# CONFIG_SYSVIPC is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_SYSCTL is not set -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -# CONFIG_BUG is not set -# CONFIG_BASE_FULL is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -# CONFIG_SHMEM is not set -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -CONFIG_TINY_SHMEM=y -CONFIG_BASE_SMALL=1 - -# -# Loadable module support -# -# CONFIG_MODULES is not set - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -# CONFIG_IOSCHED_DEADLINE is not set -# CONFIG_IOSCHED_CFQ is not set -# CONFIG_DEFAULT_AS is not set -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -CONFIG_DEFAULT_NOOP=y -CONFIG_DEFAULT_IOSCHED="noop" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -253,11 +234,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -287,7 +265,6 @@ CONFIG_STANDALONE=y # Connector - unified userspace <-> kernelspace linker # CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y # # Memory Technology Devices (MTD) @@ -312,7 +289,16 @@ CONFIG_PROC_EVENTS=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set # CONFIG_ATA_OVER_ETH is not set # @@ -367,6 +353,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=y +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -398,6 +385,7 @@ CONFIG_NET_ISA=y # CONFIG_ETH16I is not set CONFIG_NE2000=y # CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) @@ -569,10 +557,6 @@ CONFIG_DUMMY_CONSOLE=y # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/rbhma4500_defconfig b/trunk/arch/mips/configs/rbhma4500_defconfig index 1cc145023584..897420d39053 100644 --- a/trunk/arch/mips/configs/rbhma4500_defconfig +++ b/trunk/arch/mips/configs/rbhma4500_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:07:03 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:26:59 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +# CONFIG_KOBJECT_UEVENT is not set +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +# CONFIG_FUTEX is not set +# CONFIG_EPOLL is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_MODULE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + # # Machine selection # @@ -137,80 +188,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -# CONFIG_KOBJECT_UEVENT is not set -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -# CONFIG_MODULE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -284,19 +265,15 @@ CONFIG_IPV6=m # CONFIG_IPV6_TUNNEL is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m -# CONFIG_NF_CONNTRACK is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set +CONFIG_IP_NF_PPTP=m # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set @@ -328,11 +305,8 @@ CONFIG_NETFILTER_NETLINK_LOG=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -381,7 +355,6 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set # # RAM/ROM/Flash chip drivers @@ -438,11 +411,6 @@ CONFIG_MTD_CFI_UTIL=y # # CONFIG_MTD_NAND is not set -# -# OneNAND Flash Device Drivers -# -# CONFIG_MTD_ONENAND is not set - # # Parallel port support # @@ -470,7 +438,16 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_INITRD=y +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -579,6 +556,7 @@ CONFIG_TUN=m # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -596,7 +574,6 @@ CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set @@ -642,6 +619,7 @@ CONFIG_NET_PCI=y # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set # CONFIG_LAN_SAA9730 is not set +# CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) @@ -690,6 +668,7 @@ CONFIG_NET_RADIO=y # CONFIG_IPW2100 is not set # CONFIG_IPW_DEBUG is not set CONFIG_IPW2200=m +# CONFIG_AIRO is not set # CONFIG_HERMES is not set # CONFIG_ATMEL is not set @@ -713,7 +692,6 @@ CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set -CONFIG_PPP_MPPE=m CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_SHAPER is not set @@ -826,7 +804,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -870,6 +847,7 @@ CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set @@ -878,7 +856,6 @@ CONFIG_FB_CFB_IMAGEBLIT=y # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set -# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_MATROX is not set @@ -899,6 +876,7 @@ CONFIG_FB_ATY_CT=y # CONFIG_FB_SMIVGX is not set # CONFIG_FB_CYBLA is not set # CONFIG_FB_TRIDENT is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -948,15 +926,12 @@ CONFIG_USB=y # # USB Device Class drivers # +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # # CONFIG_USB_STORAGE is not set @@ -1131,7 +1106,6 @@ CONFIG_RELAYFS_FS=m CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_SUMMARY is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y diff --git a/trunk/arch/mips/configs/rm200_defconfig b/trunk/arch/mips/configs/rm200_defconfig index 30975b305ae5..988a05824f01 100644 --- a/trunk/arch/mips/configs/rm200_defconfig +++ b/trunk/arch/mips/configs/rm200_defconfig @@ -1,10 +1,63 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:07:06 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:27:03 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_BSD_PROCESS_ACCT=y +# CONFIG_BSD_PROCESS_ACCT_V3 is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + # # Machine selection # @@ -137,82 +190,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_PREEMPT_NONE is not set CONFIG_PREEMPT_VOLUNTARY=y # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_POSIX_MQUEUE=y -CONFIG_BSD_PROCESS_ACCT=y -# CONFIG_BSD_PROCESS_ACCT_V3 is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -291,10 +272,6 @@ CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m @@ -348,7 +325,6 @@ CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m -CONFIG_IP_NF_TARGET_NFQUEUE=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m @@ -398,7 +374,6 @@ CONFIG_IP6_NF_MATCH_PHYSDEV=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_TARGET_REJECT=m -CONFIG_IP6_NF_TARGET_NFQUEUE=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m CONFIG_IP6_NF_TARGET_HL=m @@ -455,18 +430,10 @@ CONFIG_DECNET=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set - -# -# Queueing/Scheduling -# CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m @@ -479,10 +446,8 @@ CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m - -# -# Classification -# +CONFIG_NET_QOS=y +CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_TCINDEX=m @@ -491,14 +456,13 @@ CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set +# CONFIG_NET_CLS_IND is not set # CONFIG_CLS_U32_MARK is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_EMATCH is not set # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y -# CONFIG_NET_CLS_IND is not set -CONFIG_NET_ESTIMATOR=y # # Network testing @@ -619,9 +583,18 @@ CONFIG_BLK_DEV_UB=m CONFIG_BLK_DEV_RAM=m CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -665,7 +638,6 @@ CONFIG_SCSI_SAS_ATTRS=m # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -679,7 +651,6 @@ CONFIG_ISCSI_TCP=m CONFIG_MEGARAID_NEWGEN=y CONFIG_MEGARAID_MM=m CONFIG_MEGARAID_MAILBOX=m -# CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set @@ -752,7 +723,6 @@ CONFIG_DM_MULTIPATH_EMC=m # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support @@ -782,6 +752,7 @@ CONFIG_TUN=m # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -799,7 +770,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set @@ -1014,7 +984,6 @@ CONFIG_RTC=m # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -1105,15 +1074,12 @@ CONFIG_USB_UHCI_HCD=m # # USB Device Class drivers # +CONFIG_USB_BLUETOOTH_TTY=m CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set @@ -1199,7 +1165,6 @@ CONFIG_USB_USS720=m CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_AIRPRIME=m -CONFIG_USB_SERIAL_ANYDATA=m CONFIG_USB_SERIAL_BELKIN=m CONFIG_USB_SERIAL_WHITEHEAT=m CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m @@ -1306,7 +1271,7 @@ CONFIG_REISERFS_FS_SECURITY=y CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m CONFIG_XFS_EXPORT=y -CONFIG_XFS_QUOTA=y +CONFIG_XFS_QUOTA=m CONFIG_XFS_SECURITY=y # CONFIG_XFS_POSIX_ACL is not set # CONFIG_XFS_RT is not set diff --git a/trunk/arch/mips/configs/sb1250-swarm_defconfig b/trunk/arch/mips/configs/sb1250-swarm_defconfig index 63f1be18e9bf..4365d9c8c42e 100644 --- a/trunk/arch/mips/configs/sb1250-swarm_defconfig +++ b/trunk/arch/mips/configs/sb1250-swarm_defconfig @@ -1,10 +1,63 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:07:09 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:27:05 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_CPUSETS=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y + # # Machine selection # @@ -73,8 +126,8 @@ CONFIG_CPU_SB1_PASS_1=y # CONFIG_CPU_SB1_PASS_3 is not set CONFIG_SIBYTE_HAS_LDT=y # CONFIG_SIMULATION is not set -# CONFIG_SB1_CEX_ALWAYS_FATAL is not set -# CONFIG_SB1_CERR_STALL is not set +# CONFIG_CONFIG_SB1_CEX_ALWAYS_FATAL is not set +# CONFIG_CONFIG_SB1_CERR_STALL is not set CONFIG_SIBYTE_CFE=y # CONFIG_SIBYTE_CFE_CONSOLE is not set # CONFIG_SIBYTE_BUS_WATCHER is not set @@ -147,7 +200,6 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_SMP=y CONFIG_NR_CPUS=2 CONFIG_PREEMPT_NONE=y @@ -155,76 +207,6 @@ CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT is not set CONFIG_PREEMPT_BKL=y -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_LOCK_KERNEL=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_CPUSETS=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y -CONFIG_STOP_MACHINE=y - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -313,11 +295,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -380,6 +359,14 @@ CONFIG_BLK_DEV_INITRD=y CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -454,6 +441,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -471,7 +459,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -612,7 +599,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -665,10 +651,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/sead_defconfig b/trunk/arch/mips/configs/sead_defconfig index 41dd70824976..d835f6db1f41 100644 --- a/trunk/arch/mips/configs/sead_defconfig +++ b/trunk/arch/mips/configs/sead_defconfig @@ -1,10 +1,52 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:07:10 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:27:07 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_HOTPLUG is not set +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +# CONFIG_MODULES is not set + # # Machine selection # @@ -131,71 +173,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -# CONFIG_SWAP is not set -CONFIG_SYSVIPC=y -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_HOTPLUG is not set -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -# CONFIG_MODULES is not set - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -261,8 +242,17 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=18432 CONFIG_BLK_DEV_INITRD=y +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y + # # ATA/ATAPI/MFM/RLL support # @@ -363,8 +353,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -415,10 +403,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/tb0226_defconfig b/trunk/arch/mips/configs/tb0226_defconfig index 83969466ecf6..bf60a17de2b0 100644 --- a/trunk/arch/mips/configs/tb0226_defconfig +++ b/trunk/arch/mips/configs/tb0226_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:07:12 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:27:10 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -132,80 +183,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -296,11 +277,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -361,7 +339,16 @@ CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=m CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -398,13 +385,12 @@ CONFIG_SCSI_MULTI_LUN=y # # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_FC_ATTRS is not set -CONFIG_SCSI_ISCSI_ATTRS=m +# CONFIG_SCSI_ISCSI_ATTRS is not set # CONFIG_SCSI_SAS_ATTRS is not set # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -415,7 +401,6 @@ CONFIG_ISCSI_TCP=m # CONFIG_SCSI_DPT_I2O is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set @@ -450,7 +435,6 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support @@ -480,6 +464,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -497,7 +482,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -650,7 +634,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set -# CONFIG_RTC_VR41XX is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -667,7 +650,6 @@ CONFIG_GPIO_VR41XX=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -751,15 +733,12 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y # # USB Device Class drivers # +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set diff --git a/trunk/arch/mips/configs/tb0229_defconfig b/trunk/arch/mips/configs/tb0229_defconfig index ce7b9ed44432..ac8b64e87b8a 100644 --- a/trunk/arch/mips/configs/tb0229_defconfig +++ b/trunk/arch/mips/configs/tb0229_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:07:15 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:27:13 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -132,80 +183,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -297,11 +278,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -363,9 +341,18 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -417,6 +404,7 @@ CONFIG_DUMMY=m # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -434,7 +422,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -517,7 +504,6 @@ CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m -CONFIG_PPP_MPPE=m CONFIG_PPPOE=m CONFIG_SLIP=m CONFIG_SLIP_COMPRESSED=y @@ -603,7 +589,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set -# CONFIG_RTC_VR41XX is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -620,7 +605,6 @@ CONFIG_GPIO_VR41XX=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -704,15 +688,12 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y # # USB Device Class drivers # +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # # CONFIG_USB_STORAGE is not set diff --git a/trunk/arch/mips/configs/workpad_defconfig b/trunk/arch/mips/configs/workpad_defconfig index 02b2551023d4..ab13621ef3b9 100644 --- a/trunk/arch/mips/configs/workpad_defconfig +++ b/trunk/arch/mips/configs/workpad_defconfig @@ -1,10 +1,61 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:07:17 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:27:16 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -129,80 +180,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -# CONFIG_IKCONFIG is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -292,11 +273,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -350,7 +328,16 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -428,6 +415,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -451,6 +439,7 @@ CONFIG_MII=m # CONFIG_HP100 is not set # CONFIG_NET_ISA is not set # CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) @@ -588,7 +577,6 @@ CONFIG_WATCHDOG=y # CONFIG_WDT is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set -# CONFIG_RTC_VR41XX is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -600,16 +588,12 @@ CONFIG_WATCHDOG=y # PCMCIA character devices # # CONFIG_SYNCLINK_CS is not set -# CONFIG_CARDMAN_4000 is not set -# CONFIG_CARDMAN_4040 is not set # CONFIG_GPIO_VR41XX is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -668,10 +652,6 @@ CONFIG_DUMMY_CONSOLE=y # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # diff --git a/trunk/arch/mips/configs/yosemite_defconfig b/trunk/arch/mips/configs/yosemite_defconfig index d51d5d16297c..5b0b7f30e205 100644 --- a/trunk/arch/mips/configs/yosemite_defconfig +++ b/trunk/arch/mips/configs/yosemite_defconfig @@ -1,10 +1,62 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:07:19 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:27:18 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set +CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +# CONFIG_CPUSETS is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y + # # Machine selection # @@ -129,7 +181,6 @@ CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_SMP=y CONFIG_NR_CPUS=2 CONFIG_PREEMPT_NONE=y @@ -137,76 +188,6 @@ CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT is not set CONFIG_PREEMPT_BKL=y -# -# Code maturity level options -# -# CONFIG_EXPERIMENTAL is not set -CONFIG_CLEAN_COMPILE=y -CONFIG_LOCK_KERNEL=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -# CONFIG_CPUSETS is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -CONFIG_OBSOLETE_MODPARM=y -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_KMOD=y -CONFIG_STOP_MACHINE=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -279,11 +260,8 @@ CONFIG_IPV6_TUNNEL=m # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -341,9 +319,18 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -395,6 +382,7 @@ CONFIG_NETDEVICES=y # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -412,7 +400,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # @@ -588,10 +575,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -707,8 +690,6 @@ CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_DEBUG_HIGHMEM is not set # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_CROSSCOMPILE=y CONFIG_CMDLINE="" # CONFIG_DEBUG_STACK_USAGE is not set diff --git a/trunk/arch/mips/ddb5xxx/ddb5477/lcd44780.c b/trunk/arch/mips/ddb5xxx/ddb5477/lcd44780.c index 9510b9ae6453..35c6c22610c5 100644 --- a/trunk/arch/mips/ddb5xxx/ddb5477/lcd44780.c +++ b/trunk/arch/mips/ddb5xxx/ddb5477/lcd44780.c @@ -55,7 +55,7 @@ void lcd44780_data(unsigned char c) void lcd44780_puts(const char* s) { - int j; + int i,j; int pos = 0; lcd44780_command(LCD44780_CLEAR); @@ -76,12 +76,8 @@ void lcd44780_puts(const char* s) } } #ifdef LCD44780_PUTS_PAUSE - { - int i; - - for(i = 1; i < 2000; i++) - lcd44780_wait(); - } + for(i = 1; i < 2000; i++) + lcd44780_wait(); #endif } diff --git a/trunk/arch/mips/defconfig b/trunk/arch/mips/defconfig index 2a1b844da43f..4b585e642c2a 100644 --- a/trunk/arch/mips/defconfig +++ b/trunk/arch/mips/defconfig @@ -1,10 +1,62 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc2 -# Thu Nov 24 01:05:49 2005 +# Linux kernel version: 2.6.14-rc2 +# Thu Oct 20 22:25:09 2005 # CONFIG_MIPS=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y + # # Machine selection # @@ -135,81 +187,10 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_PREEMPT_NONE is not set CONFIG_PREEMPT_VOLUNTARY=y # CONFIG_PREEMPT is not set -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 - -# -# General setup -# -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -# CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 -# CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=0 - -# -# Loadable module support -# -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_KMOD=y - -# -# Block layer -# -# CONFIG_LBD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Bus options (PCI, PCMCIA, EISA, ISA, TC) # @@ -311,10 +292,6 @@ CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m @@ -368,7 +345,6 @@ CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m -CONFIG_IP_NF_TARGET_NFQUEUE=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m @@ -417,7 +393,6 @@ CONFIG_IP6_NF_MATCH_EUI64=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_TARGET_REJECT=m -CONFIG_IP6_NF_TARGET_NFQUEUE=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m CONFIG_IP6_NF_TARGET_HL=m @@ -449,18 +424,10 @@ CONFIG_SCTP_HMAC_MD5=y CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# CONFIG_NET_SCHED=y # CONFIG_NET_SCH_CLK_JIFFIES is not set CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y # CONFIG_NET_SCH_CLK_CPU is not set - -# -# Queueing/Scheduling -# CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m @@ -473,10 +440,8 @@ CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m - -# -# Classification -# +CONFIG_NET_QOS=y +CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_TCINDEX=m @@ -485,14 +450,13 @@ CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set +# CONFIG_NET_CLS_IND is not set # CONFIG_CLS_U32_MARK is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_EMATCH is not set # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y -# CONFIG_NET_CLS_IND is not set -CONFIG_NET_ESTIMATOR=y # # Network testing @@ -545,9 +509,18 @@ CONFIG_CONNECTOR=m # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 +# CONFIG_LBD is not set CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y CONFIG_ATA_OVER_ETH=m # @@ -591,7 +564,6 @@ CONFIG_SCSI_SAS_ATTRS=m # # SCSI low-level drivers # -CONFIG_ISCSI_TCP=m CONFIG_SGIWD93_SCSI=y # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_DEBUG is not set @@ -627,6 +599,7 @@ CONFIG_TUN=m # PHY device support # CONFIG_PHYLIB=m +CONFIG_PHYCONTROL=y # # MII PHY device drivers @@ -779,8 +752,6 @@ CONFIG_MAX_RAW_DEVS=256 # # TPM devices # -# CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -849,10 +820,6 @@ CONFIG_LOGO_SGI_CLUT224=y # CONFIG_USB_ARCH_HAS_HCD is not set # CONFIG_USB_ARCH_HAS_OHCI is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -889,7 +856,7 @@ CONFIG_FS_MBCACHE=y CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m CONFIG_XFS_EXPORT=y -CONFIG_XFS_QUOTA=y +CONFIG_XFS_QUOTA=m CONFIG_XFS_SECURITY=y # CONFIG_XFS_POSIX_ACL is not set # CONFIG_XFS_RT is not set diff --git a/trunk/arch/mips/jmr3927/common/rtc_ds1742.c b/trunk/arch/mips/jmr3927/common/rtc_ds1742.c index 9a8bff153d80..8b407d7dc460 100644 --- a/trunk/arch/mips/jmr3927/common/rtc_ds1742.c +++ b/trunk/arch/mips/jmr3927/common/rtc_ds1742.c @@ -41,11 +41,11 @@ #include #include #include -#include #include #include +#include #include #define EPOCH 2000 diff --git a/trunk/arch/mips/jmr3927/rbhma3100/irq.c b/trunk/arch/mips/jmr3927/rbhma3100/irq.c index 2810727f1d4e..7cbe14483f13 100644 --- a/trunk/arch/mips/jmr3927/rbhma3100/irq.c +++ b/trunk/arch/mips/jmr3927/rbhma3100/irq.c @@ -113,8 +113,7 @@ static void jmr3927_irq_ack(unsigned int irq) static void jmr3927_irq_end(unsigned int irq) { - if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) - jmr3927_irq_enable(irq); + jmr3927_irq_enable(irq); } static void jmr3927_irq_disable(unsigned int irq_nr) @@ -122,7 +121,7 @@ static void jmr3927_irq_disable(unsigned int irq_nr) struct tb_irq_space* sp; unsigned long flags; - spin_lock_irqsave(&jmr3927_irq_lock, flags); + spinlock_irqsave(&jmr3927_irq_lock, flags); for (sp = tb_irq_spaces; sp; sp = sp->next) { if (sp->start_irqno <= irq_nr && irq_nr < sp->start_irqno + sp->nr_irqs) { @@ -132,7 +131,7 @@ static void jmr3927_irq_disable(unsigned int irq_nr) break; } } - spin_unlock_irqrestore(&jmr3927_irq_lock, flags); + spinlock_irqrestore(&jmr3927_irq_lock, flags); } static void jmr3927_irq_enable(unsigned int irq_nr) @@ -140,7 +139,7 @@ static void jmr3927_irq_enable(unsigned int irq_nr) struct tb_irq_space* sp; unsigned long flags; - spin_lock_irqsave(&jmr3927_irq_lock, flags); + spinlock_irqsave(&jmr3927_irq_lock, flags); for (sp = tb_irq_spaces; sp; sp = sp->next) { if (sp->start_irqno <= irq_nr && irq_nr < sp->start_irqno + sp->nr_irqs) { @@ -150,7 +149,7 @@ static void jmr3927_irq_enable(unsigned int irq_nr) break; } } - spin_unlock_irqrestore(&jmr3927_irq_lock, flags); + spinlock_irqrestore(&jmr3927_irq_lock, flags); } /* @@ -206,10 +205,7 @@ static void mask_irq_irc(int irq_nr, int space_id) /* update IRCSR */ tx3927_ircptr->imr = 0; tx3927_ircptr->imr = irc_elevel; - /* flush write buffer */ - (void)tx3927_ircptr->ssr; } - static void unmask_irq_irc(int irq_nr, int space_id) { volatile unsigned long *ilrp = &tx3927_ircptr->ilr[irq_nr / 2]; @@ -280,7 +276,7 @@ void jmr3927_irc_irqdispatch(struct pt_regs *regs) do_IRQ(irq + JMR3927_IRQ_IRC, regs); } -static irqreturn_t jmr3927_ioc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static void jmr3927_ioc_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned char istat = jmr3927_ioc_reg_in(JMR3927_IOC_INTS2_ADDR); int i; @@ -291,14 +287,13 @@ static irqreturn_t jmr3927_ioc_interrupt(int irq, void *dev_id, struct pt_regs * do_IRQ(irq, regs); } } - return IRQ_HANDLED; } static struct irqaction ioc_action = { jmr3927_ioc_interrupt, 0, CPU_MASK_NONE, "IOC", NULL, NULL, }; -static irqreturn_t jmr3927_isac_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static void jmr3927_isac_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned char istat = jmr3927_isac_reg_in(JMR3927_ISAC_INTS2_ADDR); int i; @@ -309,7 +304,6 @@ static irqreturn_t jmr3927_isac_interrupt(int irq, void *dev_id, struct pt_regs do_IRQ(irq, regs); } } - return IRQ_HANDLED; } static struct irqaction isac_action = { @@ -317,23 +311,19 @@ static struct irqaction isac_action = { }; -static irqreturn_t jmr3927_isaerr_interrupt(int irq, void * dev_id, struct pt_regs * regs) +static void jmr3927_isaerr_interrupt(int irq, void * dev_id, struct pt_regs * regs) { printk(KERN_WARNING "ISA error interrupt (irq 0x%x).\n", irq); - - return IRQ_HANDLED; } static struct irqaction isaerr_action = { jmr3927_isaerr_interrupt, 0, CPU_MASK_NONE, "ISA error", NULL, NULL, }; -static irqreturn_t jmr3927_pcierr_interrupt(int irq, void * dev_id, struct pt_regs * regs) +static void jmr3927_pcierr_interrupt(int irq, void * dev_id, struct pt_regs * regs) { printk(KERN_WARNING "PCI error interrupt (irq 0x%x).\n", irq); printk(KERN_WARNING "pcistat:%02x, lbstat:%04lx\n", tx3927_pcicptr->pcistat, tx3927_pcicptr->lbstat); - - return IRQ_HANDLED; } static struct irqaction pcierr_action = { jmr3927_pcierr_interrupt, 0, CPU_MASK_NONE, "PCI error", NULL, NULL, diff --git a/trunk/arch/mips/jmr3927/rbhma3100/setup.c b/trunk/arch/mips/jmr3927/rbhma3100/setup.c index 4763957df8fc..3e2fbdc66097 100644 --- a/trunk/arch/mips/jmr3927/rbhma3100/setup.c +++ b/trunk/arch/mips/jmr3927/rbhma3100/setup.c @@ -60,8 +60,6 @@ #include #include -extern void puts(unsigned char *cp); - /* Tick Timer divider */ #define JMR3927_TIMER_CCD 0 /* 1/2 */ #define JMR3927_TIMER_CLK (JMR3927_IMCLK / (2 << JMR3927_TIMER_CCD)) @@ -359,7 +357,7 @@ static void __init jmr3927_board_init(void) jmr3927_io_dipsw()); } -void __init tx3927_setup(void) +void __init plat_setup(void) { int i; diff --git a/trunk/arch/mips/kernel/cpu-probe.c b/trunk/arch/mips/kernel/cpu-probe.c index 5e1b08b00a33..a263fb7a3971 100644 --- a/trunk/arch/mips/kernel/cpu-probe.c +++ b/trunk/arch/mips/kernel/cpu-probe.c @@ -417,7 +417,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c) case PRID_IMP_R10000: c->cputype = CPU_R10000; c->isa_level = MIPS_CPU_ISA_IV; - c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | + c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_FPU | MIPS_CPU_32FPR | MIPS_CPU_COUNTER | MIPS_CPU_WATCH | MIPS_CPU_LLSC; @@ -426,7 +426,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c) case PRID_IMP_R12000: c->cputype = CPU_R12000; c->isa_level = MIPS_CPU_ISA_IV; - c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | + c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_FPU | MIPS_CPU_32FPR | MIPS_CPU_COUNTER | MIPS_CPU_WATCH | MIPS_CPU_LLSC; diff --git a/trunk/arch/mips/kernel/irixsig.c b/trunk/arch/mips/kernel/irixsig.c index 08273a2a501d..dd118c60bcd0 100644 --- a/trunk/arch/mips/kernel/irixsig.c +++ b/trunk/arch/mips/kernel/irixsig.c @@ -279,6 +279,8 @@ irix_sigreturn(struct pt_regs *regs) /* * Don't let your children do this ... */ + if (current_thread_info()->flags & TIF_SYSCALL_TRACE) + do_syscall_trace(regs, 1); __asm__ __volatile__( "move\t$29,%0\n\t" "j\tsyscall_exit" @@ -781,6 +783,8 @@ asmlinkage void irix_setcontext(struct pt_regs *regs) /* * Don't let your children do this ... */ + if (current_thread_info()->flags & TIF_SYSCALL_TRACE) + do_syscall_trace(regs, 1); __asm__ __volatile__( "move\t$29,%0\n\t" "j\tsyscall_exit" diff --git a/trunk/arch/mips/kernel/linux32.c b/trunk/arch/mips/kernel/linux32.c index 60353f5acc48..330cf84d21fe 100644 --- a/trunk/arch/mips/kernel/linux32.c +++ b/trunk/arch/mips/kernel/linux32.c @@ -420,7 +420,7 @@ asmlinkage ssize_t sys32_pread(unsigned int fd, char * buf, goto out; pos = merge_64(a4, a5); ret = rw_verify_area(READ, file, &pos, count); - if (ret < 0) + if (ret) goto out; ret = -EINVAL; if (!file->f_op || !(read = file->f_op->read)) @@ -455,7 +455,7 @@ asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char * buf, goto out; pos = merge_64(a4, a5); ret = rw_verify_area(WRITE, file, &pos, count); - if (ret < 0) + if (ret) goto out; ret = -EINVAL; if (!file->f_op || !(write = file->f_op->write)) diff --git a/trunk/arch/mips/kernel/scall32-o32.S b/trunk/arch/mips/kernel/scall32-o32.S index a42e0e8caa7b..4dd8e8b4fbc2 100644 --- a/trunk/arch/mips/kernel/scall32-o32.S +++ b/trunk/arch/mips/kernel/scall32-o32.S @@ -94,13 +94,11 @@ syscall_trace_entry: li a1, 0 jal do_syscall_trace - move t0, s0 - RESTORE_STATIC lw a0, PT_R4(sp) # Restore argument registers lw a1, PT_R5(sp) lw a2, PT_R6(sp) lw a3, PT_R7(sp) - jalr t0 + jalr s0 li t0, -EMAXERRNO - 1 # error? sltu t0, t0, v0 @@ -243,7 +241,19 @@ illegal_syscall: sw zero, PT_R7(sp) # success sw v0, PT_R2(sp) # result - j o32_syscall_exit # continue like a normal syscall + /* Success, so skip usual error handling garbage. */ + lw a2, TI_FLAGS($28) # syscall tracing enabled? + li t0, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT + and t0, a2, t0 + bnez t0, 1f + + j o32_syscall_exit + +1: SAVE_STATIC + move a0, sp + li a1, 1 + jal do_syscall_trace + j syscall_exit no_mem: li v0, -ENOMEM jr ra diff --git a/trunk/arch/mips/kernel/scall64-64.S b/trunk/arch/mips/kernel/scall64-64.S index 47bfbd416709..9085838d6ce3 100644 --- a/trunk/arch/mips/kernel/scall64-64.S +++ b/trunk/arch/mips/kernel/scall64-64.S @@ -93,15 +93,13 @@ syscall_trace_entry: li a1, 0 jal do_syscall_trace - move t0, s0 - RESTORE_STATIC ld a0, PT_R4(sp) # Restore argument registers ld a1, PT_R5(sp) ld a2, PT_R6(sp) ld a3, PT_R7(sp) ld a4, PT_R8(sp) ld a5, PT_R9(sp) - jalr t0 + jalr s0 li t0, -EMAXERRNO - 1 # error? sltu t0, t0, v0 @@ -176,7 +174,19 @@ illegal_syscall: sd zero, PT_R7(sp) # success sd v0, PT_R2(sp) # result - j n64_syscall_exit # continue like a normal syscall + /* Success, so skip usual error handling garbage. */ + li t0, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT + LONG_L a2, TI_FLAGS($28) # syscall tracing enabled? + and t0, a2, t0 + bnez t0, 1f + + j n64_syscall_exit + +1: SAVE_STATIC + move a0, sp + li a1, 1 + jal do_syscall_trace + j syscall_exit no_mem: li v0, -ENOMEM jr ra diff --git a/trunk/arch/mips/kernel/scall64-n32.S b/trunk/arch/mips/kernel/scall64-n32.S index b465ced1758f..7e66eb823bf6 100644 --- a/trunk/arch/mips/kernel/scall64-n32.S +++ b/trunk/arch/mips/kernel/scall64-n32.S @@ -90,15 +90,13 @@ n32_syscall_trace_entry: li a1, 0 jal do_syscall_trace - move t0, s0 - RESTORE_STATIC ld a0, PT_R4(sp) # Restore argument registers ld a1, PT_R5(sp) ld a2, PT_R6(sp) ld a3, PT_R7(sp) ld a4, PT_R8(sp) ld a5, PT_R9(sp) - jalr t0 + jalr s0 li t0, -EMAXERRNO - 1 # error? sltu t0, t0, v0 diff --git a/trunk/arch/mips/kernel/scall64-o32.S b/trunk/arch/mips/kernel/scall64-o32.S index 3d338ca7eeeb..5a16401e443a 100644 --- a/trunk/arch/mips/kernel/scall64-o32.S +++ b/trunk/arch/mips/kernel/scall64-o32.S @@ -124,8 +124,6 @@ trace_a_syscall: li a1, 0 jal do_syscall_trace - move t0, s0 - RESTORE_STATIC ld a0, PT_R4(sp) # Restore argument registers ld a1, PT_R5(sp) ld a2, PT_R6(sp) @@ -134,7 +132,7 @@ trace_a_syscall: ld a5, PT_R9(sp) ld a6, PT_R10(sp) ld a7, PT_R11(sp) # For indirect syscalls - jalr t0 + jalr s0 li t0, -EMAXERRNO - 1 # error? sltu t0, t0, v0 diff --git a/trunk/arch/mips/kernel/signal.c b/trunk/arch/mips/kernel/signal.c index 7d1800fe7038..05e09eedabff 100644 --- a/trunk/arch/mips/kernel/signal.c +++ b/trunk/arch/mips/kernel/signal.c @@ -220,6 +220,8 @@ _sys_sigreturn(nabi_no_regargs struct pt_regs regs) /* * Don't let your children do this ... */ + if (current_thread_info()->flags & TIF_SYSCALL_TRACE) + do_syscall_trace(®s, 1); __asm__ __volatile__( "move\t$29, %0\n\t" "j\tsyscall_exit" diff --git a/trunk/arch/mips/kernel/signal32.c b/trunk/arch/mips/kernel/signal32.c index c856dbc52abb..e315d3f6aa6e 100644 --- a/trunk/arch/mips/kernel/signal32.c +++ b/trunk/arch/mips/kernel/signal32.c @@ -497,6 +497,8 @@ _sys32_sigreturn(nabi_no_regargs struct pt_regs regs) /* * Don't let your children do this ... */ + if (current_thread_info()->flags & TIF_SYSCALL_TRACE) + do_syscall_trace(®s, 1); __asm__ __volatile__( "move\t$29, %0\n\t" "j\tsyscall_exit" diff --git a/trunk/arch/mips/kernel/traps.c b/trunk/arch/mips/kernel/traps.c index 7058893d5ad2..6f3ff9690686 100644 --- a/trunk/arch/mips/kernel/traps.c +++ b/trunk/arch/mips/kernel/traps.c @@ -534,14 +534,13 @@ static inline int simulate_rdhwr(struct pt_regs *regs) switch (rd) { case 29: regs->regs[rt] = ti->tp_value; - return 0; + break; default: return -EFAULT; } } - /* Not ours. */ - return -EFAULT; + return 0; } asmlinkage void do_ov(struct pt_regs *regs) diff --git a/trunk/arch/mips/mips-boards/sead/sead_int.c b/trunk/arch/mips/mips-boards/sead/sead_int.c index 90fda0d9915f..e1dd7e009750 100644 --- a/trunk/arch/mips/mips-boards/sead/sead_int.c +++ b/trunk/arch/mips/mips-boards/sead/sead_int.c @@ -30,9 +30,19 @@ extern asmlinkage void mipsIRQ(void); +asmlinkage void sead_hw0_irqdispatch(struct pt_regs *regs) +{ + do_IRQ(SEADINT_UART0, regs); +} + +asmlinkage void sead_hw1_irqdispatch(struct pt_regs *regs) +{ + do_IRQ(SEADINT_UART1, regs); +} + void __init arch_init_irq(void) { - mips_cpu_irq_init(MIPSCPU_INT_BASE); + mips_cpu_irq_init(0); /* Now safe to set the exception vector. */ set_except_vector(0, mipsIRQ); diff --git a/trunk/arch/mips/mips-boards/sead/sead_setup.c b/trunk/arch/mips/mips-boards/sead/sead_setup.c index f966bc161dfa..de90bec5505e 100644 --- a/trunk/arch/mips/mips-boards/sead/sead_setup.c +++ b/trunk/arch/mips/mips-boards/sead/sead_setup.c @@ -45,7 +45,7 @@ const char *get_system_type(void) return "MIPS SEAD"; } -void __init plat_setup(void) +static void __init sead_setup(void) { ioport_resource.end = 0x7fffffff; @@ -69,7 +69,7 @@ static void __init serial_init(void) #else s.iobase = SEAD_UART0_REGS_BASE+3; #endif - s.irq = MIPSCPU_INT_BASE + MIPSCPU_INT_UART0; + s.irq = SEADINT_UART0; s.uartclk = SEAD_BASE_BAUD * 16; s.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ; s.iotype = 0; diff --git a/trunk/arch/mips/mm/init.c b/trunk/arch/mips/mm/init.c index 4ee91c9a556f..f75ab748e8cd 100644 --- a/trunk/arch/mips/mm/init.c +++ b/trunk/arch/mips/mm/init.c @@ -67,8 +67,8 @@ unsigned long setup_zero_pages(void) page = virt_to_page(empty_zero_page); while (page < virt_to_page(empty_zero_page + (PAGE_SIZE << order))) { - SetPageReserved(page); - set_page_count(page, 1); + set_bit(PG_reserved, &page->flags); + set_page_count(page, 0); page++; } diff --git a/trunk/arch/mips/momentum/ocelot_g/gt-irq.c b/trunk/arch/mips/momentum/ocelot_g/gt-irq.c index e5eceed1beff..d0b5c9dd0ea4 100644 --- a/trunk/arch/mips/momentum/ocelot_g/gt-irq.c +++ b/trunk/arch/mips/momentum/ocelot_g/gt-irq.c @@ -178,7 +178,7 @@ void gt64240_time_init(void) timer.name = "timer"; timer.dev_id = NULL; timer.next = NULL; - timer.mask = CPU_MASK_NONE; + timer.mask = 0; irq_desc[6].action = &timer; enable_irq(6); diff --git a/trunk/arch/mips/pci/Makefile b/trunk/arch/mips/pci/Makefile index 741e67c9195a..7b7468304022 100644 --- a/trunk/arch/mips/pci/Makefile +++ b/trunk/arch/mips/pci/Makefile @@ -15,7 +15,7 @@ obj-$(CONFIG_MIPS_GT96100) += ops-gt96100.o obj-$(CONFIG_PCI_MARVELL) += ops-marvell.o obj-$(CONFIG_MIPS_MSC) += ops-msc.o obj-$(CONFIG_MIPS_NILE4) += ops-nile4.o -obj-$(CONFIG_MIPS_TX3927) += ops-tx3927.o +obj-$(CONFIG_MIPS_TX3927) += ops-jmr3927.o obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o obj-$(CONFIG_NEC_CMBVR4133) += fixup-vr4133.o diff --git a/trunk/arch/mips/pci/ops-tx3927.c b/trunk/arch/mips/pci/ops-tx3927.c index 42530a0b84b3..0e0daadc303d 100644 --- a/trunk/arch/mips/pci/ops-tx3927.c +++ b/trunk/arch/mips/pci/ops-tx3927.c @@ -72,9 +72,13 @@ static inline int check_abort(void) static int jmr3927_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val) { - int ret; + int ret, busno; - ret = mkaddr(bus->number, devfn, where); + /* check if the bus is top-level */ + if (bus->parent != NULL) + busno = bus->number; + + ret = mkaddr(busno, devfn, where); if (ret) return ret; @@ -98,9 +102,15 @@ static int jmr3927_pci_read_config(struct pci_bus *bus, unsigned int devfn, static int jmr3927_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val) { - int ret; + int ret, busno; + + /* check if the bus is top-level */ + if (bus->parent != NULL) + bus = bus->number; + else + bus = 0; - ret = mkaddr(bus->number, devfn, where); + ret = mkaddr(busno, devfn, where); if (ret) return ret; @@ -110,7 +120,7 @@ static int jmr3927_pci_write_config(struct pci_bus *bus, unsigned int devfn, break; case 2: - *(volatile u16 *) ((unsigned long) & tx3927_pcicptr->icd | (where & 2)) = + *(volatile u16 *) (unsigned longulong) & tx3927_pcicptr->icd | (where & 2)) = cpu_to_le16(val); break; @@ -127,8 +137,8 @@ static int jmr3927_pci_write_config(struct pci_bus *bus, unsigned int devfn, } struct pci_ops jmr3927_pci_ops = { - jmr3927_pci_read_config, - jmr3927_pci_write_config, + jmr3927_pcibios_read_config, + jmr3927_pcibios_write_config, }; @@ -149,14 +159,15 @@ unsigned long tc_readl(volatile __u32 * addr) { unsigned long val; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipciaddr = - (unsigned long) CPHYSADDR(addr); - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcibe = + addr = PHYSADDR(addr); + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipciaddr = + (unsigned long) addr; + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcibe = (PCI_IPCIBE_ICMD_MEMREAD << PCI_IPCIBE_ICMD_SHIFT) | PCI_IPCIBE_IBE_LONG; while (!(tx3927_pcicptr->istat & PCI_ISTAT_IDICC)); val = - le32_to_cpu(*(volatile u32 *) (unsigned long) & tx3927_pcicptr-> + le32_to_cpu(*(volatile u32 *) (ulong) & tx3927_pcicptr-> ipcidata); /* clear by setting */ tx3927_pcicptr->istat |= PCI_ISTAT_IDICC; @@ -165,11 +176,12 @@ unsigned long tc_readl(volatile __u32 * addr) void tc_writel(unsigned long data, volatile __u32 * addr) { - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcidata = + addr = PHYSADDR(addr); + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcidata = cpu_to_le32(data); - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipciaddr = - (unsigned long) CPHYSADDR(addr); - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcibe = + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipciaddr = + (unsigned long) addr; + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcibe = (PCI_IPCIBE_ICMD_MEMWRITE << PCI_IPCIBE_ICMD_SHIFT) | PCI_IPCIBE_IBE_LONG; while (!(tx3927_pcicptr->istat & PCI_ISTAT_IDICC)); @@ -186,15 +198,21 @@ unsigned char tx_ioinb(unsigned char *addr) ioaddr = (unsigned long) addr; offset = ioaddr & 0x3; - byte = 0xf & ~(8 >> offset); - - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipciaddr = + if (offset == 0) + byte = 0x7; + else if (offset == 1) + byte = 0xb; + else if (offset == 2) + byte = 0xd; + else if (offset == 3) + byte = 0xe; + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipciaddr = (unsigned long) ioaddr; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcibe = + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcibe = (PCI_IPCIBE_ICMD_IOREAD << PCI_IPCIBE_ICMD_SHIFT) | byte; while (!(tx3927_pcicptr->istat & PCI_ISTAT_IDICC)); val = - le32_to_cpu(*(volatile u32 *) (unsigned long) & tx3927_pcicptr-> + le32_to_cpu(*(volatile u32 *) (ulong) & tx3927_pcicptr-> ipcidata); val = val & 0xff; /* clear by setting */ @@ -211,12 +229,18 @@ void tx_iooutb(unsigned long data, unsigned char *addr) data = data | (data << 8) | (data << 16) | (data << 24); ioaddr = (unsigned long) addr; offset = ioaddr & 0x3; - byte = 0xf & ~(8 >> offset); - - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcidata = data; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipciaddr = + if (offset == 0) + byte = 0x7; + else if (offset == 1) + byte = 0xb; + else if (offset == 2) + byte = 0xd; + else if (offset == 3) + byte = 0xe; + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcidata = data; + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipciaddr = (unsigned long) ioaddr; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcibe = + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcibe = (PCI_IPCIBE_ICMD_IOWRITE << PCI_IPCIBE_ICMD_SHIFT) | byte; while (!(tx3927_pcicptr->istat & PCI_ISTAT_IDICC)); /* clear by setting */ @@ -231,16 +255,18 @@ unsigned short tx_ioinw(unsigned short *addr) int byte; ioaddr = (unsigned long) addr; - offset = ioaddr & 0x2; - byte = 3 << offset; - - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipciaddr = + offset = ioaddr & 0x3; + if (offset == 0) + byte = 0x3; + else if (offset == 2) + byte = 0xc; + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipciaddr = (unsigned long) ioaddr; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcibe = + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcibe = (PCI_IPCIBE_ICMD_IOREAD << PCI_IPCIBE_ICMD_SHIFT) | byte; while (!(tx3927_pcicptr->istat & PCI_ISTAT_IDICC)); val = - le32_to_cpu(*(volatile u32 *) (unsigned long) & tx3927_pcicptr-> + le32_to_cpu(*(volatile u32 *) (ulong) & tx3927_pcicptr-> ipcidata); val = val & 0xffff; /* clear by setting */ @@ -257,13 +283,15 @@ void tx_iooutw(unsigned long data, unsigned short *addr) data = data | (data << 16); ioaddr = (unsigned long) addr; - offset = ioaddr & 0x2; - byte = 3 << offset; - - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcidata = data; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipciaddr = + offset = ioaddr & 0x3; + if (offset == 0) + byte = 0x3; + else if (offset == 2) + byte = 0xc; + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcidata = data; + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipciaddr = (unsigned long) ioaddr; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcibe = + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcibe = (PCI_IPCIBE_ICMD_IOWRITE << PCI_IPCIBE_ICMD_SHIFT) | byte; while (!(tx3927_pcicptr->istat & PCI_ISTAT_IDICC)); /* clear by setting */ @@ -276,14 +304,14 @@ unsigned long tx_ioinl(unsigned int *addr) __u32 ioaddr; ioaddr = (unsigned long) addr; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipciaddr = + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipciaddr = (unsigned long) ioaddr; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcibe = + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcibe = (PCI_IPCIBE_ICMD_IOREAD << PCI_IPCIBE_ICMD_SHIFT) | PCI_IPCIBE_IBE_LONG; while (!(tx3927_pcicptr->istat & PCI_ISTAT_IDICC)); val = - le32_to_cpu(*(volatile u32 *) (unsigned long) & tx3927_pcicptr-> + le32_to_cpu(*(volatile u32 *) (ulong) & tx3927_pcicptr-> ipcidata); /* clear by setting */ tx3927_pcicptr->istat |= PCI_ISTAT_IDICC; @@ -295,11 +323,11 @@ void tx_iooutl(unsigned long data, unsigned int *addr) __u32 ioaddr; ioaddr = (unsigned long) addr; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcidata = + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcidata = cpu_to_le32(data); - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipciaddr = + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipciaddr = (unsigned long) ioaddr; - *(volatile u32 *) (unsigned long) & tx3927_pcicptr->ipcibe = + *(volatile u32 *) (ulong) & tx3927_pcicptr->ipcibe = (PCI_IPCIBE_ICMD_IOWRITE << PCI_IPCIBE_ICMD_SHIFT) | PCI_IPCIBE_IBE_LONG; while (!(tx3927_pcicptr->istat & PCI_ISTAT_IDICC)); diff --git a/trunk/arch/mips/pci/pci-jmr3927.c b/trunk/arch/mips/pci/pci-jmr3927.c index f02ef6e36b02..95a028769e56 100644 --- a/trunk/arch/mips/pci/pci-jmr3927.c +++ b/trunk/arch/mips/pci/pci-jmr3927.c @@ -54,5 +54,5 @@ struct pci_controller jmr3927_controller = { .pci_ops = &jmr3927_pci_ops, .io_resource = &pci_io_resource, .mem_resource = &pci_mem_resource, - .mem_offset = JMR3927_PCIMEM + .mem_offset = JMR3927_PCIMEM; }; diff --git a/trunk/arch/mips/qemu/q-firmware.c b/trunk/arch/mips/qemu/q-firmware.c index fb2a8673a6bf..5980f02b2df9 100644 --- a/trunk/arch/mips/qemu/q-firmware.c +++ b/trunk/arch/mips/qemu/q-firmware.c @@ -1,18 +1,7 @@ #include -#include -#include #include void __init prom_init(void) { - int *cmdline; - - cmdline = (int *) (CKSEG0 + (0x10 << 20) - 260); - if (*cmdline == 0x12345678) { - if (*(char *)(cmdline + 1)) - strcpy (arcs_cmdline, (char *)(cmdline + 1)); - add_memory_region(0x0<<20, cmdline[-1], BOOT_MEM_RAM); - } else { - add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM); - } + add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM); } diff --git a/trunk/arch/mips/sgi-ip32/crime.c b/trunk/arch/mips/sgi-ip32/crime.c index 41b5eca1148c..eb3a16a04fee 100644 --- a/trunk/arch/mips/sgi-ip32/crime.c +++ b/trunk/arch/mips/sgi-ip32/crime.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -19,10 +18,8 @@ #include #include -struct sgi_crime __iomem *crime; -struct sgi_mace __iomem *mace; - -EXPORT_SYMBOL_GPL(mace); +struct sgi_crime *crime; +struct sgi_mace *mace; void __init crime_init(void) { diff --git a/trunk/arch/parisc/kernel/drivers.c b/trunk/arch/parisc/kernel/drivers.c index d016d672ec2b..988844a169e6 100644 --- a/trunk/arch/parisc/kernel/drivers.c +++ b/trunk/arch/parisc/kernel/drivers.c @@ -499,12 +499,8 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) dev = create_parisc_device(mod_path); if (dev->id.hw_type != HPHW_FAULTY) { - printk(KERN_ERR "Two devices have hardware path [%s]. " - "IODC data for second device: " - "%02x%02x%02x%02x%02x%02x\n" - "Rearranging GSC cards sometimes helps\n", - parisc_pathname(dev), iodc_data[0], iodc_data[1], - iodc_data[3], iodc_data[4], iodc_data[5], iodc_data[6]); + printk("Two devices have hardware path %s. Please file a bug with HP.\n" + "In the meantime, you could try rearranging your cards.\n", parisc_pathname(dev)); return NULL; } diff --git a/trunk/arch/parisc/kernel/entry.S b/trunk/arch/parisc/kernel/entry.S index 9af4b22a6d77..c7e66ee5b083 100644 --- a/trunk/arch/parisc/kernel/entry.S +++ b/trunk/arch/parisc/kernel/entry.S @@ -1846,7 +1846,6 @@ sys_clone_wrapper: ldo -16(%r30),%r29 /* Reference param save area */ #endif - /* WARNING - Clobbers r19 and r21, userspace must save these! */ STREG %r2,PT_GR19(%r1) /* save for child */ STREG %r30,PT_GR21(%r1) BL sys_clone,%r2 diff --git a/trunk/arch/parisc/kernel/inventory.c b/trunk/arch/parisc/kernel/inventory.c index 8f563871e83c..1a1c66422736 100644 --- a/trunk/arch/parisc/kernel/inventory.c +++ b/trunk/arch/parisc/kernel/inventory.c @@ -188,7 +188,7 @@ pat_query_module(ulong pcell_loc, ulong mod_index) temp = pa_pdc_cell.cba; dev = alloc_pa_dev(PAT_GET_CBA(temp), &pa_pdc_cell.mod_path); if (!dev) { - return PDC_OK; + return PDC_NE_MOD; } /* alloc_pa_dev sets dev->hpa */ diff --git a/trunk/arch/parisc/kernel/ioctl32.c b/trunk/arch/parisc/kernel/ioctl32.c index 4eada1bb27f0..0a331104ad56 100644 --- a/trunk/arch/parisc/kernel/ioctl32.c +++ b/trunk/arch/parisc/kernel/ioctl32.c @@ -19,6 +19,536 @@ #define CODE #include "compat_ioctl.c" +/* Use this to get at 32-bit user passed pointers. + See sys_sparc32.c for description about these. */ +#define A(__x) ((unsigned long)(__x)) +/* The same for use with copy_from_user() and copy_to_user(). */ +#define B(__x) ((void *)(unsigned long)(__x)) + +#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE) +/* This really belongs in include/linux/drm.h -DaveM */ +#include "../../../drivers/char/drm/drm.h" + +typedef struct drm32_version { + int version_major; /* Major version */ + int version_minor; /* Minor version */ + int version_patchlevel;/* Patch level */ + int name_len; /* Length of name buffer */ + u32 name; /* Name of driver */ + int date_len; /* Length of date buffer */ + u32 date; /* User-space buffer to hold date */ + int desc_len; /* Length of desc buffer */ + u32 desc; /* User-space buffer to hold desc */ +} drm32_version_t; +#define DRM32_IOCTL_VERSION DRM_IOWR(0x00, drm32_version_t) + +static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + drm32_version_t *uversion = (drm32_version_t *)arg; + char *name_ptr, *date_ptr, *desc_ptr; + u32 tmp1, tmp2, tmp3; + drm_version_t kversion; + mm_segment_t old_fs; + int ret; + + memset(&kversion, 0, sizeof(kversion)); + if (get_user(kversion.name_len, &uversion->name_len) || + get_user(kversion.date_len, &uversion->date_len) || + get_user(kversion.desc_len, &uversion->desc_len) || + get_user(tmp1, &uversion->name) || + get_user(tmp2, &uversion->date) || + get_user(tmp3, &uversion->desc)) + return -EFAULT; + + name_ptr = (char *) A(tmp1); + date_ptr = (char *) A(tmp2); + desc_ptr = (char *) A(tmp3); + + ret = -ENOMEM; + if (kversion.name_len && name_ptr) { + kversion.name = kmalloc(kversion.name_len, GFP_KERNEL); + if (!kversion.name) + goto out; + } + if (kversion.date_len && date_ptr) { + kversion.date = kmalloc(kversion.date_len, GFP_KERNEL); + if (!kversion.date) + goto out; + } + if (kversion.desc_len && desc_ptr) { + kversion.desc = kmalloc(kversion.desc_len, GFP_KERNEL); + if (!kversion.desc) + goto out; + } + + old_fs = get_fs(); + set_fs(KERNEL_DS); + ret = sys_ioctl (fd, DRM_IOCTL_VERSION, (unsigned long)&kversion); + set_fs(old_fs); + + if (!ret) { + if ((kversion.name && + copy_to_user(name_ptr, kversion.name, kversion.name_len)) || + (kversion.date && + copy_to_user(date_ptr, kversion.date, kversion.date_len)) || + (kversion.desc && + copy_to_user(desc_ptr, kversion.desc, kversion.desc_len))) + ret = -EFAULT; + if (put_user(kversion.version_major, &uversion->version_major) || + put_user(kversion.version_minor, &uversion->version_minor) || + put_user(kversion.version_patchlevel, &uversion->version_patchlevel) || + put_user(kversion.name_len, &uversion->name_len) || + put_user(kversion.date_len, &uversion->date_len) || + put_user(kversion.desc_len, &uversion->desc_len)) + ret = -EFAULT; + } + +out: + kfree(kversion.name); + kfree(kversion.date); + kfree(kversion.desc); + return ret; +} + +typedef struct drm32_unique { + int unique_len; /* Length of unique */ + u32 unique; /* Unique name for driver instantiation */ +} drm32_unique_t; +#define DRM32_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm32_unique_t) +#define DRM32_IOCTL_SET_UNIQUE DRM_IOW( 0x10, drm32_unique_t) + +static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + drm32_unique_t *uarg = (drm32_unique_t *)arg; + drm_unique_t karg; + mm_segment_t old_fs; + char *uptr; + u32 tmp; + int ret; + + if (get_user(karg.unique_len, &uarg->unique_len)) + return -EFAULT; + karg.unique = NULL; + + if (get_user(tmp, &uarg->unique)) + return -EFAULT; + + uptr = (char *) A(tmp); + + if (uptr) { + karg.unique = kmalloc(karg.unique_len, GFP_KERNEL); + if (!karg.unique) + return -ENOMEM; + if (cmd == DRM32_IOCTL_SET_UNIQUE && + copy_from_user(karg.unique, uptr, karg.unique_len)) { + kfree(karg.unique); + return -EFAULT; + } + } + + old_fs = get_fs(); + set_fs(KERNEL_DS); + if (cmd == DRM32_IOCTL_GET_UNIQUE) + ret = sys_ioctl (fd, DRM_IOCTL_GET_UNIQUE, (unsigned long)&karg); + else + ret = sys_ioctl (fd, DRM_IOCTL_SET_UNIQUE, (unsigned long)&karg); + set_fs(old_fs); + + if (!ret) { + if (cmd == DRM32_IOCTL_GET_UNIQUE && + uptr != NULL && + copy_to_user(uptr, karg.unique, karg.unique_len)) + ret = -EFAULT; + if (put_user(karg.unique_len, &uarg->unique_len)) + ret = -EFAULT; + } + + kfree(karg.unique); + return ret; +} + +typedef struct drm32_map { + u32 offset; /* Requested physical address (0 for SAREA)*/ + u32 size; /* Requested physical size (bytes) */ + drm_map_type_t type; /* Type of memory to map */ + drm_map_flags_t flags; /* Flags */ + u32 handle; /* User-space: "Handle" to pass to mmap */ + /* Kernel-space: kernel-virtual address */ + int mtrr; /* MTRR slot used */ + /* Private data */ +} drm32_map_t; +#define DRM32_IOCTL_ADD_MAP DRM_IOWR(0x15, drm32_map_t) + +static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + drm32_map_t *uarg = (drm32_map_t *) arg; + drm_map_t karg; + mm_segment_t old_fs; + u32 tmp; + int ret; + + ret = get_user(karg.offset, &uarg->offset); + ret |= get_user(karg.size, &uarg->size); + ret |= get_user(karg.type, &uarg->type); + ret |= get_user(karg.flags, &uarg->flags); + ret |= get_user(tmp, &uarg->handle); + ret |= get_user(karg.mtrr, &uarg->mtrr); + if (ret) + return -EFAULT; + + karg.handle = (void *) A(tmp); + + old_fs = get_fs(); + set_fs(KERNEL_DS); + ret = sys_ioctl(fd, DRM_IOCTL_ADD_MAP, (unsigned long) &karg); + set_fs(old_fs); + + if (!ret) { + ret = put_user(karg.offset, &uarg->offset); + ret |= put_user(karg.size, &uarg->size); + ret |= put_user(karg.type, &uarg->type); + ret |= put_user(karg.flags, &uarg->flags); + tmp = (u32) (long)karg.handle; + ret |= put_user(tmp, &uarg->handle); + ret |= put_user(karg.mtrr, &uarg->mtrr); + if (ret) + ret = -EFAULT; + } + + return ret; +} + +typedef struct drm32_buf_info { + int count; /* Entries in list */ + u32 list; /* (drm_buf_desc_t *) */ +} drm32_buf_info_t; +#define DRM32_IOCTL_INFO_BUFS DRM_IOWR(0x18, drm32_buf_info_t) + +static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + drm32_buf_info_t *uarg = (drm32_buf_info_t *)arg; + drm_buf_desc_t *ulist; + drm_buf_info_t karg; + mm_segment_t old_fs; + int orig_count, ret; + u32 tmp; + + if (get_user(karg.count, &uarg->count) || + get_user(tmp, &uarg->list)) + return -EFAULT; + + ulist = (drm_buf_desc_t *) A(tmp); + + orig_count = karg.count; + + karg.list = kmalloc(karg.count * sizeof(drm_buf_desc_t), GFP_KERNEL); + if (!karg.list) + return -EFAULT; + + old_fs = get_fs(); + set_fs(KERNEL_DS); + ret = sys_ioctl(fd, DRM_IOCTL_INFO_BUFS, (unsigned long) &karg); + set_fs(old_fs); + + if (!ret) { + if (karg.count <= orig_count && + (copy_to_user(ulist, karg.list, + karg.count * sizeof(drm_buf_desc_t)))) + ret = -EFAULT; + if (put_user(karg.count, &uarg->count)) + ret = -EFAULT; + } + + kfree(karg.list); + return ret; +} + +typedef struct drm32_buf_free { + int count; + u32 list; /* (int *) */ +} drm32_buf_free_t; +#define DRM32_IOCTL_FREE_BUFS DRM_IOW( 0x1a, drm32_buf_free_t) + +static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + drm32_buf_free_t *uarg = (drm32_buf_free_t *)arg; + drm_buf_free_t karg; + mm_segment_t old_fs; + int *ulist; + int ret; + u32 tmp; + + if (get_user(karg.count, &uarg->count) || + get_user(tmp, &uarg->list)) + return -EFAULT; + + ulist = (int *) A(tmp); + + karg.list = kmalloc(karg.count * sizeof(int), GFP_KERNEL); + if (!karg.list) + return -ENOMEM; + + ret = -EFAULT; + if (copy_from_user(karg.list, ulist, (karg.count * sizeof(int)))) + goto out; + + old_fs = get_fs(); + set_fs(KERNEL_DS); + ret = sys_ioctl(fd, DRM_IOCTL_FREE_BUFS, (unsigned long) &karg); + set_fs(old_fs); + +out: + kfree(karg.list); + return ret; +} + +typedef struct drm32_buf_pub { + int idx; /* Index into master buflist */ + int total; /* Buffer size */ + int used; /* Amount of buffer in use (for DMA) */ + u32 address; /* Address of buffer (void *) */ +} drm32_buf_pub_t; + +typedef struct drm32_buf_map { + int count; /* Length of buflist */ + u32 virtual; /* Mmaped area in user-virtual (void *) */ + u32 list; /* Buffer information (drm_buf_pub_t *) */ +} drm32_buf_map_t; +#define DRM32_IOCTL_MAP_BUFS DRM_IOWR(0x19, drm32_buf_map_t) + +static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + drm32_buf_map_t *uarg = (drm32_buf_map_t *)arg; + drm32_buf_pub_t *ulist; + drm_buf_map_t karg; + mm_segment_t old_fs; + int orig_count, ret, i; + u32 tmp1, tmp2; + + if (get_user(karg.count, &uarg->count) || + get_user(tmp1, &uarg->virtual) || + get_user(tmp2, &uarg->list)) + return -EFAULT; + + karg.virtual = (void *) A(tmp1); + ulist = (drm32_buf_pub_t *) A(tmp2); + + orig_count = karg.count; + + karg.list = kmalloc(karg.count * sizeof(drm_buf_pub_t), GFP_KERNEL); + if (!karg.list) + return -ENOMEM; + + ret = -EFAULT; + for (i = 0; i < karg.count; i++) { + if (get_user(karg.list[i].idx, &ulist[i].idx) || + get_user(karg.list[i].total, &ulist[i].total) || + get_user(karg.list[i].used, &ulist[i].used) || + get_user(tmp1, &ulist[i].address)) + goto out; + + karg.list[i].address = (void *) A(tmp1); + } + + old_fs = get_fs(); + set_fs(KERNEL_DS); + ret = sys_ioctl(fd, DRM_IOCTL_MAP_BUFS, (unsigned long) &karg); + set_fs(old_fs); + + if (!ret) { + for (i = 0; i < orig_count; i++) { + tmp1 = (u32) (long) karg.list[i].address; + if (put_user(karg.list[i].idx, &ulist[i].idx) || + put_user(karg.list[i].total, &ulist[i].total) || + put_user(karg.list[i].used, &ulist[i].used) || + put_user(tmp1, &ulist[i].address)) { + ret = -EFAULT; + goto out; + } + } + if (put_user(karg.count, &uarg->count)) + ret = -EFAULT; + } + +out: + kfree(karg.list); + return ret; +} + +typedef struct drm32_dma { + /* Indices here refer to the offset into + buflist in drm_buf_get_t. */ + int context; /* Context handle */ + int send_count; /* Number of buffers to send */ + u32 send_indices; /* List of handles to buffers (int *) */ + u32 send_sizes; /* Lengths of data to send (int *) */ + drm_dma_flags_t flags; /* Flags */ + int request_count; /* Number of buffers requested */ + int request_size; /* Desired size for buffers */ + u32 request_indices; /* Buffer information (int *) */ + u32 request_sizes; /* (int *) */ + int granted_count; /* Number of buffers granted */ +} drm32_dma_t; +#define DRM32_IOCTL_DMA DRM_IOWR(0x29, drm32_dma_t) + +/* RED PEN The DRM layer blindly dereferences the send/request + * indice/size arrays even though they are userland + * pointers. -DaveM + */ +static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + drm32_dma_t *uarg = (drm32_dma_t *) arg; + int *u_si, *u_ss, *u_ri, *u_rs; + drm_dma_t karg; + mm_segment_t old_fs; + int ret; + u32 tmp1, tmp2, tmp3, tmp4; + + karg.send_indices = karg.send_sizes = NULL; + karg.request_indices = karg.request_sizes = NULL; + + if (get_user(karg.context, &uarg->context) || + get_user(karg.send_count, &uarg->send_count) || + get_user(tmp1, &uarg->send_indices) || + get_user(tmp2, &uarg->send_sizes) || + get_user(karg.flags, &uarg->flags) || + get_user(karg.request_count, &uarg->request_count) || + get_user(karg.request_size, &uarg->request_size) || + get_user(tmp3, &uarg->request_indices) || + get_user(tmp4, &uarg->request_sizes) || + get_user(karg.granted_count, &uarg->granted_count)) + return -EFAULT; + + u_si = (int *) A(tmp1); + u_ss = (int *) A(tmp2); + u_ri = (int *) A(tmp3); + u_rs = (int *) A(tmp4); + + if (karg.send_count) { + karg.send_indices = kmalloc(karg.send_count * sizeof(int), GFP_KERNEL); + karg.send_sizes = kmalloc(karg.send_count * sizeof(int), GFP_KERNEL); + + ret = -ENOMEM; + if (!karg.send_indices || !karg.send_sizes) + goto out; + + ret = -EFAULT; + if (copy_from_user(karg.send_indices, u_si, + (karg.send_count * sizeof(int))) || + copy_from_user(karg.send_sizes, u_ss, + (karg.send_count * sizeof(int)))) + goto out; + } + + if (karg.request_count) { + karg.request_indices = kmalloc(karg.request_count * sizeof(int), GFP_KERNEL); + karg.request_sizes = kmalloc(karg.request_count * sizeof(int), GFP_KERNEL); + + ret = -ENOMEM; + if (!karg.request_indices || !karg.request_sizes) + goto out; + + ret = -EFAULT; + if (copy_from_user(karg.request_indices, u_ri, + (karg.request_count * sizeof(int))) || + copy_from_user(karg.request_sizes, u_rs, + (karg.request_count * sizeof(int)))) + goto out; + } + + old_fs = get_fs(); + set_fs(KERNEL_DS); + ret = sys_ioctl(fd, DRM_IOCTL_DMA, (unsigned long) &karg); + set_fs(old_fs); + + if (!ret) { + if (put_user(karg.context, &uarg->context) || + put_user(karg.send_count, &uarg->send_count) || + put_user(karg.flags, &uarg->flags) || + put_user(karg.request_count, &uarg->request_count) || + put_user(karg.request_size, &uarg->request_size) || + put_user(karg.granted_count, &uarg->granted_count)) + ret = -EFAULT; + + if (karg.send_count) { + if (copy_to_user(u_si, karg.send_indices, + (karg.send_count * sizeof(int))) || + copy_to_user(u_ss, karg.send_sizes, + (karg.send_count * sizeof(int)))) + ret = -EFAULT; + } + if (karg.request_count) { + if (copy_to_user(u_ri, karg.request_indices, + (karg.request_count * sizeof(int))) || + copy_to_user(u_rs, karg.request_sizes, + (karg.request_count * sizeof(int)))) + ret = -EFAULT; + } + } + +out: + kfree(karg.send_indices); + kfree(karg.send_sizes); + kfree(karg.request_indices); + kfree(karg.request_sizes); + return ret; +} + +typedef struct drm32_ctx_res { + int count; + u32 contexts; /* (drm_ctx_t *) */ +} drm32_ctx_res_t; +#define DRM32_IOCTL_RES_CTX DRM_IOWR(0x26, drm32_ctx_res_t) + +static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + drm32_ctx_res_t *uarg = (drm32_ctx_res_t *) arg; + drm_ctx_t *ulist; + drm_ctx_res_t karg; + mm_segment_t old_fs; + int orig_count, ret; + u32 tmp; + + karg.contexts = NULL; + if (get_user(karg.count, &uarg->count) || + get_user(tmp, &uarg->contexts)) + return -EFAULT; + + ulist = (drm_ctx_t *) A(tmp); + + orig_count = karg.count; + if (karg.count && ulist) { + karg.contexts = kmalloc((karg.count * sizeof(drm_ctx_t)), GFP_KERNEL); + if (!karg.contexts) + return -ENOMEM; + if (copy_from_user(karg.contexts, ulist, + (karg.count * sizeof(drm_ctx_t)))) { + kfree(karg.contexts); + return -EFAULT; + } + } + + old_fs = get_fs(); + set_fs(KERNEL_DS); + ret = sys_ioctl(fd, DRM_IOCTL_RES_CTX, (unsigned long) &karg); + set_fs(old_fs); + + if (!ret) { + if (orig_count) { + if (copy_to_user(ulist, karg.contexts, + (orig_count * sizeof(drm_ctx_t)))) + ret = -EFAULT; + } + if (put_user(karg.count, &uarg->count)) + ret = -EFAULT; + } + + kfree(karg.contexts); + return ret; +} + +#endif + #define HANDLE_IOCTL(cmd, handler) { cmd, (ioctl_trans_handler_t)handler, NULL }, #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd, sys_ioctl) @@ -31,6 +561,11 @@ IOCTL_TABLE_START #define DECLARES #include "compat_ioctl.c" +/* PA-specific ioctls */ +COMPATIBLE_IOCTL(PA_PERF_ON) +COMPATIBLE_IOCTL(PA_PERF_OFF) +COMPATIBLE_IOCTL(PA_PERF_VERSION) + /* And these ioctls need translation */ HANDLE_IOCTL(SIOCGPPPSTATS, dev_ifsioc) HANDLE_IOCTL(SIOCGPPPCSTATS, dev_ifsioc) @@ -55,6 +590,17 @@ HANDLE_IOCTL(RTC_EPOCH_READ, w_long) COMPATIBLE_IOCTL(RTC_EPOCH_SET) #endif +#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE) +HANDLE_IOCTL(DRM32_IOCTL_VERSION, drm32_version); +HANDLE_IOCTL(DRM32_IOCTL_GET_UNIQUE, drm32_getsetunique); +HANDLE_IOCTL(DRM32_IOCTL_SET_UNIQUE, drm32_getsetunique); +HANDLE_IOCTL(DRM32_IOCTL_ADD_MAP, drm32_addmap); +HANDLE_IOCTL(DRM32_IOCTL_INFO_BUFS, drm32_info_bufs); +HANDLE_IOCTL(DRM32_IOCTL_FREE_BUFS, drm32_free_bufs); +HANDLE_IOCTL(DRM32_IOCTL_MAP_BUFS, drm32_map_bufs); +HANDLE_IOCTL(DRM32_IOCTL_DMA, drm32_dma); +HANDLE_IOCTL(DRM32_IOCTL_RES_CTX, drm32_res_ctx); +#endif /* DRM */ IOCTL_TABLE_END int ioctl_table_size = ARRAY_SIZE(ioctl_start); diff --git a/trunk/arch/parisc/kernel/irq.c b/trunk/arch/parisc/kernel/irq.c index 197936d9359a..006385dbee66 100644 --- a/trunk/arch/parisc/kernel/irq.c +++ b/trunk/arch/parisc/kernel/irq.c @@ -30,9 +30,6 @@ #include #include #include -#include - -#include #undef PARISC_IRQ_CR16_COUNTS @@ -46,34 +43,26 @@ extern irqreturn_t ipi_interrupt(int, void *, struct pt_regs *); */ static volatile unsigned long cpu_eiem = 0; -static void cpu_disable_irq(unsigned int irq) +static void cpu_set_eiem(void *info) +{ + set_eiem((unsigned long) info); +} + +static inline void cpu_disable_irq(unsigned int irq) { unsigned long eirr_bit = EIEM_MASK(irq); cpu_eiem &= ~eirr_bit; - /* Do nothing on the other CPUs. If they get this interrupt, - * The & cpu_eiem in the do_cpu_irq_mask() ensures they won't - * handle it, and the set_eiem() at the bottom will ensure it - * then gets disabled */ + on_each_cpu(cpu_set_eiem, (void *) cpu_eiem, 1, 1); } static void cpu_enable_irq(unsigned int irq) { unsigned long eirr_bit = EIEM_MASK(irq); + mtctl(eirr_bit, 23); /* clear EIRR bit before unmasking */ cpu_eiem |= eirr_bit; - - /* FIXME: while our interrupts aren't nested, we cannot reset - * the eiem mask if we're already in an interrupt. Once we - * implement nested interrupts, this can go away - */ - if (!in_interrupt()) - set_eiem(cpu_eiem); - - /* This is just a simple NOP IPI. But what it does is cause - * all the other CPUs to do a set_eiem(cpu_eiem) at the end - * of the interrupt handler */ - smp_send_all_nop(); + on_each_cpu(cpu_set_eiem, (void *) cpu_eiem, 1, 1); } static unsigned int cpu_startup_irq(unsigned int irq) @@ -85,35 +74,6 @@ static unsigned int cpu_startup_irq(unsigned int irq) void no_ack_irq(unsigned int irq) { } void no_end_irq(unsigned int irq) { } -#ifdef CONFIG_SMP -int cpu_check_affinity(unsigned int irq, cpumask_t *dest) -{ - int cpu_dest; - - /* timer and ipi have to always be received on all CPUs */ - if (irq == TIMER_IRQ || irq == IPI_IRQ) { - /* Bad linux design decision. The mask has already - * been set; we must reset it */ - irq_affinity[irq] = CPU_MASK_ALL; - return -EINVAL; - } - - /* whatever mask they set, we just allow one CPU */ - cpu_dest = first_cpu(*dest); - *dest = cpumask_of_cpu(cpu_dest); - - return 0; -} - -static void cpu_set_affinity_irq(unsigned int irq, cpumask_t dest) -{ - if (cpu_check_affinity(irq, &dest)) - return; - - irq_affinity[irq] = dest; -} -#endif - static struct hw_interrupt_type cpu_interrupt_type = { .typename = "CPU", .startup = cpu_startup_irq, @@ -122,9 +82,7 @@ static struct hw_interrupt_type cpu_interrupt_type = { .disable = cpu_disable_irq, .ack = no_ack_irq, .end = no_end_irq, -#ifdef CONFIG_SMP - .set_affinity = cpu_set_affinity_irq, -#endif +// .set_affinity = cpu_set_affinity_irq, }; int show_interrupts(struct seq_file *p, void *v) @@ -261,17 +219,6 @@ int txn_alloc_irq(unsigned int bits_wide) return -1; } - -unsigned long txn_affinity_addr(unsigned int irq, int cpu) -{ -#ifdef CONFIG_SMP - irq_affinity[irq] = cpumask_of_cpu(cpu); -#endif - - return cpu_data[cpu].txn_addr; -} - - unsigned long txn_alloc_addr(unsigned int virt_irq) { static int next_cpu = -1; @@ -286,7 +233,7 @@ unsigned long txn_alloc_addr(unsigned int virt_irq) if (next_cpu >= NR_CPUS) next_cpu = 0; /* nothing else, assign monarch */ - return txn_affinity_addr(virt_irq, next_cpu); + return cpu_data[next_cpu].txn_addr; } @@ -303,11 +250,10 @@ void do_cpu_irq_mask(struct pt_regs *regs) irq_enter(); /* - * Don't allow TIMER or IPI nested interrupts. - * Allowing any single interrupt to nest can lead to that CPU - * handling interrupts with all enabled interrupts unmasked. + * Only allow interrupt processing to be interrupted by the + * timer tick */ - set_eiem(0UL); + set_eiem(EIEM_MASK(TIMER_IRQ)); /* 1) only process IRQs that are enabled/unmasked (cpu_eiem) * 2) We loop here on EIRR contents in order to avoid @@ -321,41 +267,23 @@ void do_cpu_irq_mask(struct pt_regs *regs) if (!eirr_val) break; + if (eirr_val & EIEM_MASK(TIMER_IRQ)) + set_eiem(0); + mtctl(eirr_val, 23); /* reset bits we are going to process */ /* Work our way from MSb to LSb...same order we alloc EIRs */ for (irq = TIMER_IRQ; eirr_val && bit; bit>>=1, irq++) { -#ifdef CONFIG_SMP - cpumask_t dest = irq_affinity[irq]; -#endif if (!(bit & eirr_val)) continue; /* clear bit in mask - can exit loop sooner */ eirr_val &= ~bit; -#ifdef CONFIG_SMP - /* FIXME: because generic set affinity mucks - * with the affinity before sending it to us - * we can get the situation where the affinity is - * wrong for our CPU type interrupts */ - if (irq != TIMER_IRQ && irq != IPI_IRQ && - !cpu_isset(smp_processor_id(), dest)) { - int cpu = first_cpu(dest); - - printk(KERN_DEBUG "redirecting irq %d from CPU %d to %d\n", - irq, smp_processor_id(), cpu); - gsc_writel(irq + CPU_IRQ_BASE, - cpu_data[cpu].hpa); - continue; - } -#endif - __do_IRQ(irq, regs); } } - - set_eiem(cpu_eiem); /* restore original mask */ + set_eiem(cpu_eiem); irq_exit(); } @@ -363,14 +291,12 @@ void do_cpu_irq_mask(struct pt_regs *regs) static struct irqaction timer_action = { .handler = timer_interrupt, .name = "timer", - .flags = SA_INTERRUPT, }; #ifdef CONFIG_SMP static struct irqaction ipi_action = { .handler = ipi_interrupt, .name = "IPI", - .flags = SA_INTERRUPT, }; #endif diff --git a/trunk/arch/parisc/kernel/perf.c b/trunk/arch/parisc/kernel/perf.c index f6fec62b6a2f..44670d6e06f4 100644 --- a/trunk/arch/parisc/kernel/perf.c +++ b/trunk/arch/parisc/kernel/perf.c @@ -196,7 +196,8 @@ static int perf_open(struct inode *inode, struct file *file); static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t *ppos); static ssize_t perf_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos); -static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg); +static int perf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg); static void perf_start_counters(void); static int perf_stop_counters(uint32_t *raddr); static struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num); @@ -437,56 +438,48 @@ static void perf_patch_images(void) * must be running on the processor that you wish to change. */ -static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +static int perf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) { long error_start; - uint32_t raddr[4]; - int error = 0; + uint32_t raddr[4]; - lock_kernel(); switch (cmd) { case PA_PERF_ON: /* Start the counters */ perf_start_counters(); - break; + return 0; case PA_PERF_OFF: error_start = perf_stop_counters(raddr); if (error_start != 0) { printk(KERN_ERR "perf_off: perf_stop_counters = %ld\n", error_start); - error = -EFAULT; - break; + return -EFAULT; } /* copy out the Counters */ if (copy_to_user((void __user *)arg, raddr, sizeof (raddr)) != 0) { - error = -EFAULT; - break; + return -EFAULT; } - break; + return 0; case PA_PERF_VERSION: /* Return the version # */ - error = put_user(PERF_VERSION, (int *)arg); - break; + return put_user(PERF_VERSION, (int *)arg); default: - error = -ENOTTY; + break; } - - unlock_kernel(); - - return error; + return -ENOTTY; } static struct file_operations perf_fops = { .llseek = no_llseek, .read = perf_read, .write = perf_write, - .unlocked_ioctl = perf_ioctl, - .compat_ioctl = perf_ioctl, + .ioctl = perf_ioctl, .open = perf_open, .release = perf_release }; diff --git a/trunk/arch/parisc/kernel/ptrace.c b/trunk/arch/parisc/kernel/ptrace.c index 27160e8bf15b..b6fe202a620d 100644 --- a/trunk/arch/parisc/kernel/ptrace.c +++ b/trunk/arch/parisc/kernel/ptrace.c @@ -264,7 +264,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) * sigkill. perhaps it should be put in the status * that it wants to exit. */ - ret = 0; DBG("sys_ptrace(KILL)\n"); if (child->exit_state == EXIT_ZOMBIE) /* already dead */ goto out_tsk; @@ -345,11 +344,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) case PTRACE_GETEVENTMSG: ret = put_user(child->ptrace_message, (unsigned int __user *) data); - goto out_tsk; + goto out; default: ret = ptrace_request(child, request, addr, data); - goto out_tsk; + goto out; } out_wake_notrap: diff --git a/trunk/arch/parisc/kernel/signal.c b/trunk/arch/parisc/kernel/signal.c index 3a25a7bd673e..82c24e62ab63 100644 --- a/trunk/arch/parisc/kernel/signal.c +++ b/trunk/arch/parisc/kernel/signal.c @@ -296,6 +296,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, struct rt_sigframe __user *frame; unsigned long rp, usp; unsigned long haddr, sigframe_size; + struct siginfo si; int err = 0; #ifdef __LP64__ compat_int_t compat_val; diff --git a/trunk/arch/parisc/kernel/smp.c b/trunk/arch/parisc/kernel/smp.c index ce89da0f654d..a9ecf6465784 100644 --- a/trunk/arch/parisc/kernel/smp.c +++ b/trunk/arch/parisc/kernel/smp.c @@ -181,19 +181,12 @@ ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs) while (ops) { unsigned long which = ffz(~ops); - ops &= ~(1 << which); - switch (which) { - case IPI_NOP: -#if (kDEBUG>=100) - printk(KERN_DEBUG "CPU%d IPI_NOP\n",this_cpu); -#endif /* kDEBUG */ - break; - case IPI_RESCHEDULE: #if (kDEBUG>=100) printk(KERN_DEBUG "CPU%d IPI_RESCHEDULE\n",this_cpu); #endif /* kDEBUG */ + ops &= ~(1 << IPI_RESCHEDULE); /* * Reschedule callback. Everything to be * done is done by the interrupt return path. @@ -204,6 +197,7 @@ ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs) #if (kDEBUG>=100) printk(KERN_DEBUG "CPU%d IPI_CALL_FUNC\n",this_cpu); #endif /* kDEBUG */ + ops &= ~(1 << IPI_CALL_FUNC); { volatile struct smp_call_struct *data; void (*func)(void *info); @@ -237,6 +231,7 @@ ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs) #if (kDEBUG>=100) printk(KERN_DEBUG "CPU%d IPI_CPU_START\n",this_cpu); #endif /* kDEBUG */ + ops &= ~(1 << IPI_CPU_START); #ifdef ENTRY_SYS_CPUS p->state = STATE_RUNNING; #endif @@ -246,6 +241,7 @@ ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs) #if (kDEBUG>=100) printk(KERN_DEBUG "CPU%d IPI_CPU_STOP\n",this_cpu); #endif /* kDEBUG */ + ops &= ~(1 << IPI_CPU_STOP); #ifdef ENTRY_SYS_CPUS #else halt_processor(); @@ -256,11 +252,13 @@ ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs) #if (kDEBUG>=100) printk(KERN_DEBUG "CPU%d is alive!\n",this_cpu); #endif /* kDEBUG */ + ops &= ~(1 << IPI_CPU_TEST); break; default: printk(KERN_CRIT "Unknown IPI num on CPU%d: %lu\n", this_cpu, which); + ops &= ~(1 << which); return IRQ_NONE; } /* Switch */ } /* while (ops) */ @@ -314,12 +312,6 @@ smp_send_start(void) { send_IPI_allbutself(IPI_CPU_START); } void smp_send_reschedule(int cpu) { send_IPI_single(cpu, IPI_RESCHEDULE); } -void -smp_send_all_nop(void) -{ - send_IPI_allbutself(IPI_NOP); -} - /** * Run a function on all other CPUs. @@ -346,10 +338,6 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait) /* Can deadlock when called with interrupts disabled */ WARN_ON(irqs_disabled()); - - /* can also deadlock if IPIs are disabled */ - WARN_ON((get_eiem() & (1UL<<(CPU_IRQ_MAX - IPI_IRQ))) == 0); - data.func = func; data.info = info; diff --git a/trunk/arch/parisc/kernel/syscall.S b/trunk/arch/parisc/kernel/syscall.S index d66163492890..b29b76b42bb7 100644 --- a/trunk/arch/parisc/kernel/syscall.S +++ b/trunk/arch/parisc/kernel/syscall.S @@ -164,7 +164,7 @@ linux_gateway_entry: #endif STREG %r2, TASK_PT_GR30(%r1) /* ... and save it */ - STREG %r20, TASK_PT_GR20(%r1) /* Syscall number */ + STREG %r20, TASK_PT_GR20(%r1) STREG %r21, TASK_PT_GR21(%r1) STREG %r22, TASK_PT_GR22(%r1) STREG %r23, TASK_PT_GR23(%r1) /* 4th argument */ @@ -527,7 +527,6 @@ lws_compare_and_swap: We *must* giveup this call and fail. */ ldw 4(%sr2,%r20), %r28 /* Load thread register */ - /* WARNING: If cr27 cycles to the same value we have problems */ mfctl %cr27, %r21 /* Get current thread register */ cmpb,<>,n %r21, %r28, cas_lock /* Called recursive? */ b lws_exit /* Return error! */ diff --git a/trunk/arch/powerpc/Kconfig b/trunk/arch/powerpc/Kconfig index db93dbc0e21a..c523029674e6 100644 --- a/trunk/arch/powerpc/Kconfig +++ b/trunk/arch/powerpc/Kconfig @@ -227,7 +227,7 @@ config SMP If you don't know what to do here, say N. config NR_CPUS - int "Maximum number of CPUs (2-128)" + int "Maximum number of CPUs (2-32)" range 2 128 depends on SMP default "32" if PPC64 @@ -261,7 +261,7 @@ config PPC_ISERIES config EMBEDDED6xx bool "Embedded 6xx/7xx/7xxx-based board" - depends on PPC32 && BROKEN + depends on PPC32 config APUS bool "Amiga-APUS" @@ -305,7 +305,7 @@ config PPC_PMAC64 config PPC_PREP bool " PowerPC Reference Platform (PReP) based machines" - depends on PPC_MULTIPLATFORM && PPC32 && BROKEN + depends on PPC_MULTIPLATFORM && PPC32 select PPC_I8259 select PPC_INDIRECT_PCI default y @@ -598,6 +598,19 @@ config ARCH_MEMORY_PROBE def_bool y depends on MEMORY_HOTPLUG +# Some NUMA nodes have memory ranges that span +# other nodes. Even though a pfn is valid and +# between a node's start and end pfns, it may not +# reside on that node. +# +# This is a relatively temporary hack that should +# be able to go away when sparsemem is fully in +# place + +config NODES_SPAN_OTHER_NODES + def_bool y + depends on NEED_MULTIPLE_NODES + config PPC_64K_PAGES bool "64k page size" depends on PPC64 @@ -919,7 +932,6 @@ source "arch/powerpc/oprofile/Kconfig" config KPROBES bool "Kprobes (EXPERIMENTAL)" - depends on PPC64 help Kprobes allows you to trap at almost any kernel address and execute a callback function. register_kprobe() establishes diff --git a/trunk/arch/powerpc/Makefile b/trunk/arch/powerpc/Makefile index a13eb575f834..5bc11bd36c1f 100644 --- a/trunk/arch/powerpc/Makefile +++ b/trunk/arch/powerpc/Makefile @@ -14,6 +14,10 @@ HAS_BIARCH := $(call cc-option-yn, -m32) +ifeq ($(CONFIG_PPC64),y) +OLDARCH := ppc64 +SZ := 64 + # Set default 32 bits cross compilers for vdso and boot wrapper CROSS32_COMPILE ?= @@ -33,12 +37,6 @@ endif export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY -KBUILD_DEFCONFIG := $(shell uname -m)_defconfig - -ifeq ($(CONFIG_PPC64),y) -OLDARCH := ppc64 -SZ := 64 - new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) ifeq ($(new_nm),y) @@ -61,17 +59,15 @@ endif LDFLAGS_vmlinux := -Bstatic # The -Iarch/$(ARCH)/include is temporary while we are merging -CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -Iarch/$(ARCH)/include -AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) +CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include +AFLAGS += -Iarch/$(ARCH) +CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc -CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple -CPPFLAGS += $(CPPFLAGS-y) -AFLAGS += $(AFLAGS-y) -CFLAGS += -msoft-float -pipe $(CFLAGS-y) +CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple +CFLAGS += $(CFLAGS-y) CPP = $(CC) -E $(CFLAGS) # Temporary hack until we have migrated to asm-powerpc -LINUXINCLUDE-$(CONFIG_PPC32) := -Iarch/$(ARCH)/include -LINUXINCLUDE += $(LINUXINCLUDE-y) +LINUXINCLUDE += -Iarch/$(ARCH)/include CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__ @@ -115,6 +111,9 @@ cpu-as-$(CONFIG_E200) += -Wa,-me200 AFLAGS += $(cpu-as-y) CFLAGS += $(cpu-as-y) +# Default to the common case. +KBUILD_DEFCONFIG := common_defconfig + head-y := arch/powerpc/kernel/head_32.o head-$(CONFIG_PPC64) := arch/powerpc/kernel/head_64.o head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o @@ -126,11 +125,11 @@ head-$(CONFIG_PPC64) += arch/powerpc/kernel/entry_64.o head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o core-y += arch/powerpc/kernel/ \ + arch/$(OLDARCH)/kernel/ \ arch/powerpc/mm/ \ arch/powerpc/lib/ \ arch/powerpc/sysdev/ \ arch/powerpc/platforms/ -core-$(CONFIG_PPC32) += arch/ppc/kernel/ core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/ core-$(CONFIG_XMON) += arch/powerpc/xmon/ core-$(CONFIG_APUS) += arch/ppc/amiga/ @@ -140,7 +139,7 @@ drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ -defaultimage-$(CONFIG_PPC32) := zImage +defaultimage-$(CONFIG_PPC32) := uImage zImage defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux defaultimage-$(CONFIG_PPC_PSERIES) := zImage KBUILD_IMAGE := $(defaultimage-y) @@ -155,33 +154,42 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm .PHONY: $(BOOT_TARGETS) -boot := arch/$(ARCH)/boot +boot := arch/$(OLDARCH)/boot +# urk +ifeq ($(CONFIG_PPC64),y) $(BOOT_TARGETS): vmlinux $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) +else +$(BOOT_TARGETS): vmlinux + $(Q)$(MAKE) ARCH=ppc $(build)=$(boot) $@ +endif + +uImage: vmlinux + $(Q)$(MAKE) ARCH=$(OLDARCH) $(build)=$(boot)/images $(boot)/images/$@ define archhelp - @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' + @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)' + @echo ' uImage - Create a bootable image for U-Boot / PPCBoot' @echo ' install - Install kernel using' @echo ' (your) ~/bin/installkernel or' @echo ' (distribution) /sbin/installkernel or' @echo ' install to $$(INSTALL_PATH) and run lilo' - @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' + @echo ' *_defconfig - Select default config from arch/$(ARCH)/ppc/configs' endef archclean: $(Q)$(MAKE) $(clean)=$(boot) + # Temporary hack until we have migrated to asm-powerpc $(Q)rm -rf arch/$(ARCH)/include archprepare: checkbin -ifeq ($(CONFIG_PPC32),y) # Temporary hack until we have migrated to asm-powerpc include/asm: arch/$(ARCH)/include/asm -arch/$(ARCH)/include/asm: FORCE +arch/$(ARCH)/include/asm: $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi $(Q)ln -fsn $(srctree)/include/asm-$(OLDARCH) arch/$(ARCH)/include/asm -endif # Use the file '.tmp_gas_check' for binutils tests, as gas won't output # to stdout and these checks are run even on install targets. diff --git a/trunk/arch/powerpc/configs/cell_defconfig b/trunk/arch/powerpc/configs/cell_defconfig index b657f7e44762..67ffecbc05cb 100644 --- a/trunk/arch/powerpc/configs/cell_defconfig +++ b/trunk/arch/powerpc/configs/cell_defconfig @@ -1,33 +1,18 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc5 -# Tue Dec 20 15:59:26 2005 +# Linux kernel version: 2.6.14-rc4 +# Thu Oct 20 08:29:10 2005 # -CONFIG_PPC64=y CONFIG_64BIT=y -CONFIG_PPC_MERGE=y CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_PPC=y +CONFIG_GENERIC_ISA_DMA=y CONFIG_EARLY_PRINTK=y CONFIG_COMPAT=y -CONFIG_SYSVIPC_COMPAT=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y - -# -# Processor support -# -# CONFIG_POWER4_ONLY is not set -CONFIG_POWER3=y -CONFIG_POWER4=y -CONFIG_PPC_FPU=y -CONFIG_ALTIVEC=y -CONFIG_PPC_STD_MMU=y -CONFIG_SMP=y -CONFIG_NR_CPUS=4 +CONFIG_FORCE_MAX_ZONEORDER=13 # # Code maturity level options @@ -53,7 +38,6 @@ CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_CPUSETS is not set CONFIG_INITRAMFS_SOURCE="" -CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set @@ -82,69 +66,31 @@ CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_KMOD is not set CONFIG_STOP_MACHINE=y - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" +CONFIG_SYSVIPC_COMPAT=y # # Platform support # -CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_ISERIES is not set -# CONFIG_EMBEDDED6xx is not set -# CONFIG_APUS is not set +CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_PSERIES is not set +CONFIG_PPC_BPA=y # CONFIG_PPC_PMAC is not set # CONFIG_PPC_MAPLE is not set -CONFIG_PPC_CELL=y +CONFIG_PPC=y +CONFIG_PPC64=y CONFIG_PPC_OF=y +CONFIG_BPA_IIC=y +CONFIG_ALTIVEC=y +CONFIG_KEXEC=y # CONFIG_U3_DART is not set -CONFIG_PPC_RTAS=y -# CONFIG_RTAS_ERROR_LOGGING is not set -CONFIG_RTAS_PROC=y -CONFIG_RTAS_FLASH=y -CONFIG_MMIO_NVRAM=y -CONFIG_CELL_IIC=y -# CONFIG_PPC_MPC106 is not set -# CONFIG_GENERIC_TBSYNC is not set -# CONFIG_CPU_FREQ is not set -# CONFIG_WANT_EARLY_SERIAL is not set - -# -# Kernel options -# -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -CONFIG_PREEMPT_BKL=y -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -CONFIG_FORCE_MAX_ZONEORDER=13 +# CONFIG_BOOTX_TEXT is not set +# CONFIG_POWER4_ONLY is not set # CONFIG_IOMMU_VMERGE is not set -CONFIG_KEXEC=y -CONFIG_IRQ_ALL_CPUS=y -# CONFIG_NUMA is not set +CONFIG_SMP=y +CONFIG_NR_CPUS=4 CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y # CONFIG_DISCONTIGMEM_MANUAL is not set @@ -152,21 +98,30 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_PPC_64K_PAGES is not set +# CONFIG_NUMA is not set CONFIG_SCHED_SMT=y +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +CONFIG_PREEMPT_BKL=y +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_GENERIC_HARDIRQS=y +CONFIG_PPC_RTAS=y +CONFIG_RTAS_PROC=y +CONFIG_RTAS_FLASH=y +CONFIG_SECCOMP=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set CONFIG_PROC_DEVICETREE=y # CONFIG_CMDLINE_BOOL is not set -# CONFIG_PM is not set -CONFIG_SECCOMP=y CONFIG_ISA_DMA_API=y # -# Bus options +# Bus Options # -CONFIG_GENERIC_ISA_DMA=y -# CONFIG_PPC_I8259 is not set -# CONFIG_PPC_INDIRECT_PCI is not set CONFIG_PCI=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_LEGACY_PROC=y @@ -181,7 +136,6 @@ CONFIG_PCI_LEGACY_PROC=y # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set -CONFIG_KERNEL_START=0xc000000000000000 # # Networking @@ -229,10 +183,6 @@ CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# # CONFIG_NETFILTER_NETLINK is not set # @@ -334,10 +284,6 @@ CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set CONFIG_NET_CLS_ROUTE=y @@ -399,6 +345,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=131072 CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -488,7 +442,6 @@ CONFIG_IDEDMA_AUTO=y # # Macintosh device drivers # -# CONFIG_WINDFARM is not set # # Network device support @@ -542,6 +495,7 @@ CONFIG_SKGE=m # CONFIG_SK98LIN is not set # CONFIG_TIGON3 is not set # CONFIG_BNX2 is not set +# CONFIG_SPIDER_NET is not set # CONFIG_MV643XX_ETH is not set # @@ -671,7 +625,7 @@ CONFIG_WATCHDOG=y # Watchdog Device Drivers # # CONFIG_SOFT_WATCHDOG is not set -# CONFIG_WATCHDOG_RTAS is not set +CONFIG_WATCHDOG_RTAS=y # # PCI-based Watchdog Cards @@ -679,8 +633,6 @@ CONFIG_WATCHDOG=y # CONFIG_PCIPCWATCHDOG is not set # CONFIG_WDTPCI is not set # CONFIG_RTC is not set -CONFIG_GEN_RTC=y -# CONFIG_GEN_RTC_X is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -697,7 +649,6 @@ CONFIG_GEN_RTC=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -748,7 +699,6 @@ CONFIG_I2C_ALGOBIT=y # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -806,10 +756,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -997,24 +943,9 @@ CONFIG_NLS_ISO8859_15=m # CONFIG_NLS_UTF8 is not set # -# Library routines -# -# CONFIG_CRC_CCITT is not set -# CONFIG_CRC16 is not set -CONFIG_CRC32=y -# CONFIG_LIBCRC32C is not set -CONFIG_ZLIB_INFLATE=m -CONFIG_ZLIB_DEFLATE=m -CONFIG_TEXTSEARCH=y -CONFIG_TEXTSEARCH_KMP=m -CONFIG_TEXTSEARCH_BM=m -CONFIG_TEXTSEARCH_FSM=m - -# -# Instrumentation Support +# Profiling support # # CONFIG_PROFILING is not set -# CONFIG_KPROBES is not set # # Kernel hacking @@ -1031,14 +962,13 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_FS=y -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_KPROBES is not set # CONFIG_DEBUG_STACK_USAGE is not set CONFIG_DEBUGGER=y # CONFIG_XMON is not set +# CONFIG_PPCDBG is not set CONFIG_IRQSTACKS=y -# CONFIG_BOOTX_TEXT is not set # # Security options @@ -1078,3 +1008,17 @@ CONFIG_CRYPTO_DEFLATE=m # # Hardware crypto devices # + +# +# Library routines +# +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m diff --git a/trunk/arch/powerpc/configs/g5_defconfig b/trunk/arch/powerpc/configs/g5_defconfig index 3c22ccb18519..e76854f8c121 100644 --- a/trunk/arch/powerpc/configs/g5_defconfig +++ b/trunk/arch/powerpc/configs/g5_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc5 -# Tue Dec 20 15:59:30 2005 +# Linux kernel version: 2.6.14 +# Mon Nov 7 13:37:59 2005 # CONFIG_PPC64=y CONFIG_64BIT=y @@ -53,7 +53,6 @@ CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_CPUSETS is not set CONFIG_INITRAMFS_SOURCE="" -CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set @@ -83,23 +82,6 @@ CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" - # # Platform support # @@ -155,7 +137,6 @@ CONFIG_IRQ_ALL_CPUS=y # CONFIG_NUMA is not set CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y # CONFIG_DISCONTIGMEM_MANUAL is not set @@ -234,10 +215,6 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# # CONFIG_NETFILTER_NETLINK is not set # @@ -405,6 +382,19 @@ CONFIG_BLK_DEV_INITRD=y CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_AS=y +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="anticipatory" # CONFIG_ATA_OVER_ETH is not set # @@ -666,6 +656,7 @@ CONFIG_SUNGEM=y # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set # CONFIG_NET_PCI is not set +# CONFIG_FEC_8XX is not set # # Ethernet (1000 Mbit) @@ -719,7 +710,6 @@ CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m -# CONFIG_PPP_MPPE is not set CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_NET_FC is not set @@ -814,8 +804,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set -CONFIG_GEN_RTC=y -# CONFIG_GEN_RTC_X is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -929,6 +917,7 @@ CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y CONFIG_FB_MACMODES=y CONFIG_FB_MODE_HELPERS=y CONFIG_FB_TILEBLITTING=y @@ -943,7 +932,6 @@ CONFIG_FB_OF=y # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set -# CONFIG_FB_S1D13XXX is not set CONFIG_FB_NVIDIA=y CONFIG_FB_NVIDIA_I2C=y # CONFIG_FB_RIVA is not set @@ -962,6 +950,7 @@ CONFIG_FB_RADEON_I2C=y # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_CYBLA is not set # CONFIG_FB_TRIDENT is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -970,7 +959,6 @@ CONFIG_FB_RADEON_I2C=y # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y @@ -1204,7 +1192,6 @@ CONFIG_USB_MON=y CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y # CONFIG_USB_SERIAL_AIRPRIME is not set -# CONFIG_USB_SERIAL_ANYDATA is not set CONFIG_USB_SERIAL_BELKIN=m CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m # CONFIG_USB_SERIAL_CP2101 is not set @@ -1235,6 +1222,7 @@ 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_NOKIA_DKU2 is not set CONFIG_USB_SERIAL_PL2303=m # CONFIG_USB_SERIAL_HP4X is not set CONFIG_USB_SERIAL_SAFE=m @@ -1486,11 +1474,10 @@ CONFIG_TEXTSEARCH_BM=m CONFIG_TEXTSEARCH_FSM=m # -# Instrumentation Support +# Profiling support # CONFIG_PROFILING=y CONFIG_OPROFILE=y -# CONFIG_KPROBES is not set # # Kernel hacking @@ -1510,6 +1497,7 @@ CONFIG_DEBUG_FS=y # CONFIG_DEBUG_VM is not set # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_KPROBES is not set # CONFIG_DEBUG_STACK_USAGE is not set # CONFIG_DEBUGGER is not set CONFIG_IRQSTACKS=y diff --git a/trunk/arch/powerpc/configs/iseries_defconfig b/trunk/arch/powerpc/configs/iseries_defconfig index 751a622fb7a7..62e92c7e9e27 100644 --- a/trunk/arch/powerpc/configs/iseries_defconfig +++ b/trunk/arch/powerpc/configs/iseries_defconfig @@ -1,33 +1,18 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc5 -# Tue Dec 20 15:59:32 2005 +# Linux kernel version: 2.6.14-rc4 +# Thu Oct 20 08:30:56 2005 # -CONFIG_PPC64=y CONFIG_64BIT=y -CONFIG_PPC_MERGE=y CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_PPC=y +CONFIG_GENERIC_ISA_DMA=y CONFIG_EARLY_PRINTK=y CONFIG_COMPAT=y -CONFIG_SYSVIPC_COMPAT=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y - -# -# Processor support -# -# CONFIG_POWER4_ONLY is not set -CONFIG_POWER3=y -CONFIG_POWER4=y -CONFIG_PPC_FPU=y -# CONFIG_ALTIVEC is not set -CONFIG_PPC_STD_MMU=y -CONFIG_SMP=y -CONFIG_NR_CPUS=32 +CONFIG_FORCE_MAX_ZONEORDER=13 # # Code maturity level options @@ -55,7 +40,6 @@ CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_CPUSETS is not set CONFIG_INITRAMFS_SOURCE="" -CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set @@ -84,60 +68,22 @@ CONFIG_MODVERSIONS=y CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" +CONFIG_SYSVIPC_COMPAT=y # # Platform support # -# CONFIG_PPC_MULTIPLATFORM is not set CONFIG_PPC_ISERIES=y -# CONFIG_EMBEDDED6xx is not set -# CONFIG_APUS is not set -# CONFIG_PPC_RTAS is not set -# CONFIG_MMIO_NVRAM is not set +# CONFIG_PPC_MULTIPLATFORM is not set +CONFIG_PPC=y +CONFIG_PPC64=y CONFIG_IBMVIO=y -# CONFIG_PPC_MPC106 is not set -# CONFIG_GENERIC_TBSYNC is not set -# CONFIG_CPU_FREQ is not set -# CONFIG_WANT_EARLY_SERIAL is not set - -# -# Kernel options -# -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -# CONFIG_PREEMPT_BKL is not set -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -CONFIG_FORCE_MAX_ZONEORDER=13 +# CONFIG_POWER4_ONLY is not set CONFIG_IOMMU_VMERGE=y -CONFIG_IRQ_ALL_CPUS=y -CONFIG_LPARCFG=y -# CONFIG_NUMA is not set +CONFIG_SMP=y +CONFIG_NR_CPUS=32 CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y # CONFIG_DISCONTIGMEM_MANUAL is not set @@ -145,20 +91,26 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_PPC_64K_PAGES is not set +# CONFIG_NUMA is not set # CONFIG_SCHED_SMT is not set -CONFIG_PROC_DEVICETREE=y -# CONFIG_PM is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_BKL is not set +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_GENERIC_HARDIRQS=y +CONFIG_LPARCFG=y CONFIG_SECCOMP=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set CONFIG_ISA_DMA_API=y # -# Bus options +# Bus Options # -CONFIG_GENERIC_ISA_DMA=y -# CONFIG_PPC_I8259 is not set -# CONFIG_PPC_INDIRECT_PCI is not set CONFIG_PCI=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_LEGACY_PROC=y @@ -173,7 +125,6 @@ CONFIG_PCI_LEGACY_PROC=y # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set -CONFIG_KERNEL_START=0xc000000000000000 # # Networking @@ -215,10 +166,6 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# # CONFIG_NETFILTER_NETLINK is not set # @@ -318,10 +265,6 @@ CONFIG_LLC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set CONFIG_NET_CLS_ROUTE=y @@ -383,6 +326,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=65536 CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -426,7 +377,6 @@ CONFIG_SCSI_FC_ATTRS=y # # SCSI low-level drivers # -# CONFIG_ISCSI_TCP is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -504,7 +454,6 @@ CONFIG_DM_ZERO=m # # Macintosh device drivers # -# CONFIG_WINDFARM is not set # # Network device support @@ -612,7 +561,6 @@ CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m -# CONFIG_PPP_MPPE is not set CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_NET_FC is not set @@ -695,8 +643,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set -CONFIG_GEN_RTC=y -# CONFIG_GEN_RTC_X is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -714,7 +660,6 @@ CONFIG_MAX_RAW_DEVS=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -767,10 +712,6 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - # # USB Gadget Support # @@ -976,25 +917,10 @@ CONFIG_VIOTAPE=m CONFIG_VIOPATH=y # -# Library routines -# -CONFIG_CRC_CCITT=m -# CONFIG_CRC16 is not set -CONFIG_CRC32=y -CONFIG_LIBCRC32C=m -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=m -CONFIG_TEXTSEARCH=y -CONFIG_TEXTSEARCH_KMP=m -CONFIG_TEXTSEARCH_BM=m -CONFIG_TEXTSEARCH_FSM=m - -# -# Instrumentation Support +# Profiling support # CONFIG_PROFILING=y CONFIG_OPROFILE=y -# CONFIG_KPROBES is not set # # Kernel hacking @@ -1011,11 +937,11 @@ CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_FS=y -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_DEBUG_STACKOVERFLOW=y +# CONFIG_KPROBES is not set CONFIG_DEBUG_STACK_USAGE=y # CONFIG_DEBUGGER is not set +# CONFIG_PPCDBG is not set CONFIG_IRQSTACKS=y # @@ -1056,3 +982,17 @@ CONFIG_CRYPTO_TEST=m # # Hardware crypto devices # + +# +# Library routines +# +CONFIG_CRC_CCITT=m +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m diff --git a/trunk/arch/powerpc/configs/maple_defconfig b/trunk/arch/powerpc/configs/maple_defconfig index 07b6d3d23360..7b480f3d1406 100644 --- a/trunk/arch/powerpc/configs/maple_defconfig +++ b/trunk/arch/powerpc/configs/maple_defconfig @@ -1,32 +1,18 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc5 -# Tue Dec 20 15:59:36 2005 +# Linux kernel version: 2.6.14-rc4 +# Thu Oct 20 08:31:24 2005 # -CONFIG_PPC64=y CONFIG_64BIT=y -CONFIG_PPC_MERGE=y CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_PPC=y +CONFIG_GENERIC_ISA_DMA=y CONFIG_EARLY_PRINTK=y CONFIG_COMPAT=y -CONFIG_SYSVIPC_COMPAT=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y - -# -# Processor support -# -CONFIG_POWER4_ONLY=y -CONFIG_POWER4=y -CONFIG_PPC_FPU=y -# CONFIG_ALTIVEC is not set -CONFIG_PPC_STD_MMU=y -CONFIG_SMP=y -CONFIG_NR_CPUS=2 +CONFIG_FORCE_MAX_ZONEORDER=13 # # Code maturity level options @@ -53,7 +39,6 @@ CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_CPUSETS is not set CONFIG_INITRAMFS_SOURCE="" -CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y @@ -82,67 +67,32 @@ CONFIG_MODVERSIONS=y CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" +CONFIG_SYSVIPC_COMPAT=y # # Platform support # -CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_ISERIES is not set -# CONFIG_EMBEDDED6xx is not set -# CONFIG_APUS is not set +CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_PSERIES is not set +# CONFIG_PPC_BPA is not set # CONFIG_PPC_PMAC is not set CONFIG_PPC_MAPLE=y -# CONFIG_PPC_CELL is not set +CONFIG_PPC=y +CONFIG_PPC64=y CONFIG_PPC_OF=y -CONFIG_U3_DART=y CONFIG_MPIC=y -# CONFIG_PPC_RTAS is not set -# CONFIG_MMIO_NVRAM is not set +# CONFIG_ALTIVEC is not set +CONFIG_KEXEC=y +CONFIG_U3_DART=y CONFIG_MPIC_BROKEN_U3=y -# CONFIG_PPC_MPC106 is not set -CONFIG_GENERIC_TBSYNC=y -# CONFIG_CPU_FREQ is not set -# CONFIG_WANT_EARLY_SERIAL is not set - -# -# Kernel options -# -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -# CONFIG_PREEMPT_BKL is not set -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -CONFIG_FORCE_MAX_ZONEORDER=13 +CONFIG_BOOTX_TEXT=y +CONFIG_POWER4_ONLY=y CONFIG_IOMMU_VMERGE=y -CONFIG_KEXEC=y -CONFIG_IRQ_ALL_CPUS=y -# CONFIG_NUMA is not set +CONFIG_SMP=y +CONFIG_NR_CPUS=2 CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y # CONFIG_DISCONTIGMEM_MANUAL is not set @@ -150,21 +100,27 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_PPC_64K_PAGES is not set +# CONFIG_NUMA is not set # CONFIG_SCHED_SMT is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_BKL is not set +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_GENERIC_HARDIRQS=y +CONFIG_SECCOMP=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set CONFIG_PROC_DEVICETREE=y # CONFIG_CMDLINE_BOOL is not set -# CONFIG_PM is not set -CONFIG_SECCOMP=y CONFIG_ISA_DMA_API=y # -# Bus options +# Bus Options # -CONFIG_GENERIC_ISA_DMA=y -# CONFIG_PPC_I8259 is not set -# CONFIG_PPC_INDIRECT_PCI is not set CONFIG_PCI=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_LEGACY_PROC=y @@ -179,7 +135,6 @@ CONFIG_PCI_LEGACY_PROC=y # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set -CONFIG_KERNEL_START=0xc000000000000000 # # Networking @@ -238,11 +193,8 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -302,6 +254,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=8192 # CONFIG_BLK_DEV_INITRD is not set # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -391,7 +351,6 @@ CONFIG_IDEDMA_AUTO=y # # Macintosh device drivers # -# CONFIG_WINDFARM is not set # # Network device support @@ -574,8 +533,6 @@ CONFIG_LEGACY_PTY_COUNT=256 # # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set -CONFIG_GEN_RTC=y -# CONFIG_GEN_RTC_X is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -592,7 +549,6 @@ CONFIG_GEN_RTC=y # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -643,7 +599,6 @@ CONFIG_I2C_AMD8111=y # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -726,15 +681,12 @@ CONFIG_USB_UHCI_HCD=y # # USB Device Class drivers # +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # # CONFIG_USB_STORAGE is not set @@ -794,7 +746,6 @@ CONFIG_USB_SERIAL=y # CONFIG_USB_SERIAL_CONSOLE is not set CONFIG_USB_SERIAL_GENERIC=y # CONFIG_USB_SERIAL_AIRPRIME is not set -# CONFIG_USB_SERIAL_ANYDATA is not set # CONFIG_USB_SERIAL_BELKIN is not set # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set # CONFIG_USB_SERIAL_CP2101 is not set @@ -1034,19 +985,9 @@ CONFIG_NLS_DEFAULT="utf-8" CONFIG_NLS_UTF8=y # -# Library routines -# -CONFIG_CRC_CCITT=y -# CONFIG_CRC16 is not set -CONFIG_CRC32=y -# CONFIG_LIBCRC32C is not set -CONFIG_ZLIB_INFLATE=y - -# -# Instrumentation Support +# Profiling support # # CONFIG_PROFILING is not set -# CONFIG_KPROBES is not set # # Kernel hacking @@ -1063,15 +1004,14 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_FS=y -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_DEBUG_STACKOVERFLOW=y +# CONFIG_KPROBES is not set CONFIG_DEBUG_STACK_USAGE=y CONFIG_DEBUGGER=y CONFIG_XMON=y CONFIG_XMON_DEFAULT=y +# CONFIG_PPCDBG is not set # CONFIG_IRQSTACKS is not set -CONFIG_BOOTX_TEXT=y # # Security options @@ -1111,3 +1051,12 @@ CONFIG_CRYPTO_DES=y # # Hardware crypto devices # + +# +# Library routines +# +CONFIG_CRC_CCITT=y +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y diff --git a/trunk/arch/powerpc/configs/pseries_defconfig b/trunk/arch/powerpc/configs/pseries_defconfig index a50ce0fa9243..9f09dff9e11a 100644 --- a/trunk/arch/powerpc/configs/pseries_defconfig +++ b/trunk/arch/powerpc/configs/pseries_defconfig @@ -1,33 +1,18 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc5 -# Tue Dec 20 15:59:40 2005 +# Linux kernel version: 2.6.14-rc4 +# Thu Oct 20 08:32:17 2005 # -CONFIG_PPC64=y CONFIG_64BIT=y -CONFIG_PPC_MERGE=y CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_PPC=y +CONFIG_GENERIC_ISA_DMA=y CONFIG_EARLY_PRINTK=y CONFIG_COMPAT=y -CONFIG_SYSVIPC_COMPAT=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y - -# -# Processor support -# -# CONFIG_POWER4_ONLY is not set -CONFIG_POWER3=y -CONFIG_POWER4=y -CONFIG_PPC_FPU=y -CONFIG_ALTIVEC=y -CONFIG_PPC_STD_MMU=y -CONFIG_SMP=y -CONFIG_NR_CPUS=128 +CONFIG_FORCE_MAX_ZONEORDER=13 # # Code maturity level options @@ -55,7 +40,6 @@ CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_CPUSETS=y CONFIG_INITRAMFS_SOURCE="" -CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y @@ -84,102 +68,75 @@ CONFIG_MODVERSIONS=y CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" +CONFIG_SYSVIPC_COMPAT=y # # Platform support # -CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_ISERIES is not set -# CONFIG_EMBEDDED6xx is not set -# CONFIG_APUS is not set +CONFIG_PPC_MULTIPLATFORM=y CONFIG_PPC_PSERIES=y +# CONFIG_PPC_BPA is not set # CONFIG_PPC_PMAC is not set # CONFIG_PPC_MAPLE is not set -# CONFIG_PPC_CELL is not set +CONFIG_PPC=y +CONFIG_PPC64=y CONFIG_PPC_OF=y CONFIG_XICS=y -# CONFIG_U3_DART is not set CONFIG_MPIC=y -CONFIG_PPC_RTAS=y -CONFIG_RTAS_ERROR_LOGGING=y -CONFIG_RTAS_PROC=y -CONFIG_RTAS_FLASH=m -# CONFIG_MMIO_NVRAM is not set +CONFIG_ALTIVEC=y +CONFIG_PPC_SPLPAR=y +CONFIG_KEXEC=y CONFIG_IBMVIO=y -# CONFIG_PPC_MPC106 is not set -# CONFIG_GENERIC_TBSYNC is not set -# CONFIG_CPU_FREQ is not set -# CONFIG_WANT_EARLY_SERIAL is not set - -# -# Kernel options -# -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -# CONFIG_PREEMPT_BKL is not set -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -CONFIG_FORCE_MAX_ZONEORDER=13 +# CONFIG_U3_DART is not set +# CONFIG_BOOTX_TEXT is not set +# CONFIG_POWER4_ONLY is not set CONFIG_IOMMU_VMERGE=y -CONFIG_HOTPLUG_CPU=y -CONFIG_KEXEC=y -CONFIG_IRQ_ALL_CPUS=y -CONFIG_PPC_SPLPAR=y -CONFIG_EEH=y -CONFIG_SCANLOG=m -CONFIG_LPARCFG=y -CONFIG_NUMA=y +CONFIG_SMP=y +CONFIG_NR_CPUS=128 CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_DISCONTIGMEM_ENABLE=y +CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_FLATMEM_MANUAL is not set -# CONFIG_DISCONTIGMEM_MANUAL is not set -CONFIG_SPARSEMEM_MANUAL=y -CONFIG_SPARSEMEM=y +CONFIG_DISCONTIGMEM_MANUAL=y +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_DISCONTIGMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y CONFIG_NEED_MULTIPLE_NODES=y -CONFIG_HAVE_MEMORY_PRESENT=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPARSEMEM_EXTREME=y -# CONFIG_MEMORY_HOTPLUG is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y -# CONFIG_PPC_64K_PAGES is not set +CONFIG_NODES_SPAN_OTHER_NODES=y +CONFIG_NUMA=y CONFIG_SCHED_SMT=y +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_BKL is not set +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_EEH=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_PPC_RTAS=y +CONFIG_RTAS_PROC=y +CONFIG_RTAS_FLASH=m +CONFIG_SCANLOG=m +CONFIG_LPARCFG=y +CONFIG_SECCOMP=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +CONFIG_HOTPLUG_CPU=y CONFIG_PROC_DEVICETREE=y # CONFIG_CMDLINE_BOOL is not set -# CONFIG_PM is not set -CONFIG_SECCOMP=y CONFIG_ISA_DMA_API=y # -# Bus options +# Bus Options # -CONFIG_GENERIC_ISA_DMA=y -CONFIG_PPC_I8259=y -# CONFIG_PPC_INDIRECT_PCI is not set CONFIG_PCI=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_LEGACY_PROC=y @@ -199,7 +156,6 @@ CONFIG_HOTPLUG_PCI=m # CONFIG_HOTPLUG_PCI_SHPC is not set CONFIG_HOTPLUG_PCI_RPA=m CONFIG_HOTPLUG_PCI_RPA_DLPAR=m -CONFIG_KERNEL_START=0xc000000000000000 # # Networking @@ -241,10 +197,6 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=y CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m @@ -347,10 +299,6 @@ CONFIG_LLC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set CONFIG_NET_CLS_ROUTE=y @@ -420,6 +368,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=65536 CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -517,7 +473,6 @@ CONFIG_SCSI_ISCSI_ATTRS=m # # SCSI low-level drivers # -# CONFIG_ISCSI_TCP is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -604,7 +559,6 @@ CONFIG_DM_MULTIPATH_EMC=m # # Macintosh device drivers # -# CONFIG_WINDFARM is not set # # Network device support @@ -691,6 +645,7 @@ CONFIG_IXGB=m # CONFIG_IXGB_NAPI is not set CONFIG_S2IO=m # CONFIG_S2IO_NAPI is not set +# CONFIG_2BUFF_MODE is not set # # Token Ring devices @@ -719,7 +674,6 @@ CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m -# CONFIG_PPP_MPPE is not set CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_NET_FC is not set @@ -830,8 +784,6 @@ CONFIG_HVCS=m # # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set -CONFIG_GEN_RTC=y -# CONFIG_GEN_RTC_X is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -849,7 +801,6 @@ CONFIG_MAX_RAW_DEVS=1024 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -901,7 +852,6 @@ CONFIG_I2C_ALGOBIT=y # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -943,6 +893,7 @@ CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y CONFIG_FB_MACMODES=y CONFIG_FB_MODE_HELPERS=y CONFIG_FB_TILEBLITTING=y @@ -954,7 +905,6 @@ CONFIG_FB_OF=y # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set -# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set CONFIG_FB_MATROX=y @@ -977,6 +927,7 @@ CONFIG_FB_RADEON_I2C=y # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_CYBLA is not set # CONFIG_FB_TRIDENT is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -985,7 +936,6 @@ CONFIG_FB_RADEON_I2C=y # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y @@ -1040,15 +990,12 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y # # USB Device Class drivers # +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set @@ -1159,7 +1106,6 @@ CONFIG_INFINIBAND_MTHCA=m # CONFIG_INFINIBAND_MTHCA_DEBUG is not set CONFIG_INFINIBAND_IPOIB=m # CONFIG_INFINIBAND_IPOIB_DEBUG is not set -# CONFIG_INFINIBAND_SRP is not set # # SN Devices @@ -1342,25 +1288,10 @@ CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_UTF8 is not set # -# Library routines -# -CONFIG_CRC_CCITT=m -# CONFIG_CRC16 is not set -CONFIG_CRC32=y -CONFIG_LIBCRC32C=m -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=m -CONFIG_TEXTSEARCH=y -CONFIG_TEXTSEARCH_KMP=m -CONFIG_TEXTSEARCH_BM=m -CONFIG_TEXTSEARCH_FSM=m - -# -# Instrumentation Support +# Profiling support # CONFIG_PROFILING=y CONFIG_OPROFILE=y -# CONFIG_KPROBES is not set # # Kernel hacking @@ -1377,15 +1308,14 @@ CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_FS=y -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_DEBUG_STACKOVERFLOW=y +# CONFIG_KPROBES is not set CONFIG_DEBUG_STACK_USAGE=y CONFIG_DEBUGGER=y CONFIG_XMON=y CONFIG_XMON_DEFAULT=y +# CONFIG_PPCDBG is not set CONFIG_IRQSTACKS=y -# CONFIG_BOOTX_TEXT is not set # # Security options @@ -1425,3 +1355,17 @@ CONFIG_CRYPTO_TEST=m # # Hardware crypto devices # + +# +# Library routines +# +CONFIG_CRC_CCITT=m +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m diff --git a/trunk/arch/powerpc/kernel/Makefile b/trunk/arch/powerpc/kernel/Makefile index 9ed551b6c172..9a74b7ab03a4 100644 --- a/trunk/arch/powerpc/kernel/Makefile +++ b/trunk/arch/powerpc/kernel/Makefile @@ -12,12 +12,12 @@ CFLAGS_btext.o += -fPIC endif obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ - irq.o align.o signal_32.o pmc.o vdso.o + irq.o signal_32.o pmc.o vdso.o obj-y += vdso32/ obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ signal_64.o ptrace32.o systbl.o \ paca.o ioctl32.o cpu_setup_power4.o \ - firmware.o sysfs.o udbg.o idle_64.o + firmware.o sysfs.o udbg.o obj-$(CONFIG_PPC64) += vdso64/ obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o obj-$(CONFIG_POWER4) += idle_power4.o @@ -25,7 +25,7 @@ obj-$(CONFIG_PPC_OF) += of_device.o procfs-$(CONFIG_PPC64) := proc_ppc64.o obj-$(CONFIG_PROC_FS) += $(procfs-y) rtaspci-$(CONFIG_PPC64) := rtas_pci.o -obj-$(CONFIG_PPC_RTAS) += rtas.o rtas-rtc.o $(rtaspci-y) +obj-$(CONFIG_PPC_RTAS) += rtas.o $(rtaspci-y) obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o obj-$(CONFIG_RTAS_PROC) += rtas-proc.o obj-$(CONFIG_LPARCFG) += lparcfg.o @@ -35,7 +35,6 @@ obj-$(CONFIG_PPC_PSERIES) += udbg_16550.o obj-$(CONFIG_PPC_MAPLE) += udbg_16550.o udbgscc-$(CONFIG_PPC64) := udbg_scc.o obj-$(CONFIG_PPC_PMAC) += $(udbgscc-y) -obj64-$(CONFIG_PPC_MULTIPLATFORM) += nvram_64.o ifeq ($(CONFIG_PPC_MERGE),y) @@ -50,23 +49,12 @@ extra-y += vmlinux.lds obj-y += process.o init_task.o time.o \ prom.o traps.o setup-common.o obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o -obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o +obj-$(CONFIG_PPC64) += misc_64.o obj-$(CONFIG_PPC_OF) += prom_init.o obj-$(CONFIG_MODULES) += ppc_ksyms.o obj-$(CONFIG_BOOTX_TEXT) += btext.o obj-$(CONFIG_6xx) += idle_6xx.o obj-$(CONFIG_SMP) += smp.o -obj-$(CONFIG_KPROBES) += kprobes.o - -module-$(CONFIG_PPC64) += module_64.o -obj-$(CONFIG_MODULES) += $(module-y) - -pci64-$(CONFIG_PPC64) += pci_64.o pci_dn.o pci_iommu.o \ - pci_direct_iommu.o iomap.o -obj-$(CONFIG_PCI) += $(pci64-y) - -kexec64-$(CONFIG_PPC64) += machine_kexec_64.o -obj-$(CONFIG_KEXEC) += $(kexec64-y) ifeq ($(CONFIG_PPC_ISERIES),y) $(obj)/head_64.o: $(obj)/lparmap.s @@ -74,12 +62,13 @@ AFLAGS_head_64.o += -I$(obj) endif else -# stuff used from here for ARCH=ppc +# stuff used from here for ARCH=ppc or ARCH=ppc64 smpobj-$(CONFIG_SMP) += smp.o +obj-$(CONFIG_PPC64) += traps.o process.o init_task.o time.o \ + setup-common.o $(smpobj-y) -endif -obj-$(CONFIG_PPC64) += $(obj64-y) +endif extra-$(CONFIG_PPC_FPU) += fpu.o extra-$(CONFIG_PPC64) += entry_64.o diff --git a/trunk/arch/powerpc/kernel/asm-offsets.c b/trunk/arch/powerpc/kernel/asm-offsets.c index 91538d2445bf..4550eb4f4fbd 100644 --- a/trunk/arch/powerpc/kernel/asm-offsets.c +++ b/trunk/arch/powerpc/kernel/asm-offsets.c @@ -270,15 +270,13 @@ int main(void) DEFINE(TVAL64_TV_USEC, offsetof(struct timeval, tv_usec)); DEFINE(TVAL32_TV_SEC, offsetof(struct compat_timeval, tv_sec)); DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec)); - DEFINE(TSPC64_TV_SEC, offsetof(struct timespec, tv_sec)); - DEFINE(TSPC64_TV_NSEC, offsetof(struct timespec, tv_nsec)); DEFINE(TSPC32_TV_SEC, offsetof(struct compat_timespec, tv_sec)); DEFINE(TSPC32_TV_NSEC, offsetof(struct compat_timespec, tv_nsec)); #else DEFINE(TVAL32_TV_SEC, offsetof(struct timeval, tv_sec)); DEFINE(TVAL32_TV_USEC, offsetof(struct timeval, tv_usec)); - DEFINE(TSPC32_TV_SEC, offsetof(struct timespec, tv_sec)); - DEFINE(TSPC32_TV_NSEC, offsetof(struct timespec, tv_nsec)); + DEFINE(TSPEC32_TV_SEC, offsetof(struct timespec, tv_sec)); + DEFINE(TSPEC32_TV_NSEC, offsetof(struct timespec, tv_nsec)); #endif /* timeval/timezone offsets for use by vdso */ DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest)); diff --git a/trunk/arch/powerpc/kernel/entry_64.S b/trunk/arch/powerpc/kernel/entry_64.S index bce33a38399f..2d22bf03484e 100644 --- a/trunk/arch/powerpc/kernel/entry_64.S +++ b/trunk/arch/powerpc/kernel/entry_64.S @@ -183,8 +183,8 @@ syscall_exit_trace_cont: ld r13,GPR13(r1) /* returning to usermode */ 1: ld r2,GPR2(r1) li r12,MSR_RI - andc r11,r10,r12 - mtmsrd r11,1 /* clear MSR.RI */ + andc r10,r10,r12 + mtmsrd r10,1 /* clear MSR.RI */ ld r1,GPR1(r1) mtlr r4 mtcr r5 diff --git a/trunk/arch/powerpc/kernel/head_fsl_booke.S b/trunk/arch/powerpc/kernel/head_fsl_booke.S index 8d60fa99fc4b..5063c603fad4 100644 --- a/trunk/arch/powerpc/kernel/head_fsl_booke.S +++ b/trunk/arch/powerpc/kernel/head_fsl_booke.S @@ -24,7 +24,7 @@ * Copyright 2002-2004 MontaVista Software, Inc. * PowerPC 44x support, Matt Porter * Copyright 2004 Freescale Semiconductor, Inc - * PowerPC e500 modifications, Kumar Gala + * PowerPC e500 modifications, Kumar Gala * * 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 diff --git a/trunk/arch/powerpc/kernel/irq.c b/trunk/arch/powerpc/kernel/irq.c index 5a71ed9612fe..4b7940693f3d 100644 --- a/trunk/arch/powerpc/kernel/irq.c +++ b/trunk/arch/powerpc/kernel/irq.c @@ -71,11 +71,6 @@ #include #endif -int __irq_offset_value; -#ifdef CONFIG_PPC32 -EXPORT_SYMBOL(__irq_offset_value); -#endif - static int ppc_spurious_interrupts; #if defined(CONFIG_PPC_ISERIES) && defined(CONFIG_SMP) @@ -103,6 +98,7 @@ extern atomic_t ipi_sent; EXPORT_SYMBOL(irq_desc); int distribute_irqs = 1; +int __irq_offset_value; u64 ppc64_interrupt_controller; #endif /* CONFIG_PPC64 */ @@ -315,6 +311,7 @@ void __init init_IRQ(void) } #ifdef CONFIG_PPC64 +#ifndef CONFIG_PPC_ISERIES /* * Virtual IRQ mapping code, used on systems with XICS interrupt controllers. */ @@ -423,6 +420,8 @@ unsigned int real_irq_to_virt_slowpath(unsigned int real_irq) } +#endif /* CONFIG_PPC_ISERIES */ + #ifdef CONFIG_IRQSTACKS struct thread_info *softirq_ctx[NR_CPUS]; struct thread_info *hardirq_ctx[NR_CPUS]; diff --git a/trunk/arch/powerpc/kernel/lparcfg.c b/trunk/arch/powerpc/kernel/lparcfg.c index 9dda16ccde78..1b3ba8a440a6 100644 --- a/trunk/arch/powerpc/kernel/lparcfg.c +++ b/trunk/arch/powerpc/kernel/lparcfg.c @@ -42,6 +42,32 @@ /* #define LPARCFG_DEBUG */ +/* find a better place for this function... */ +static void log_plpar_hcall_return(unsigned long rc, char *tag) +{ + if (rc == 0) /* success, return */ + return; +/* check for null tag ? */ + if (rc == H_Hardware) + printk(KERN_INFO + "plpar-hcall (%s) failed with hardware fault\n", tag); + else if (rc == H_Function) + printk(KERN_INFO + "plpar-hcall (%s) failed; function not allowed\n", tag); + else if (rc == H_Authority) + printk(KERN_INFO + "plpar-hcall (%s) failed; not authorized to this function\n", + tag); + else if (rc == H_Parameter) + printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n", + tag); + else + printk(KERN_INFO + "plpar-hcall (%s) failed with unexpected rc(0x%lx)\n", + tag, rc); + +} + static struct proc_dir_entry *proc_ppc64_lparcfg; #define LPARCFG_BUFF_SIZE 4096 @@ -146,31 +172,6 @@ static int lparcfg_data(struct seq_file *m, void *v) /* * Methods used to fetch LPAR data when running on a pSeries platform. */ -/* find a better place for this function... */ -static void log_plpar_hcall_return(unsigned long rc, char *tag) -{ - if (rc == 0) /* success, return */ - return; -/* check for null tag ? */ - if (rc == H_Hardware) - printk(KERN_INFO - "plpar-hcall (%s) failed with hardware fault\n", tag); - else if (rc == H_Function) - printk(KERN_INFO - "plpar-hcall (%s) failed; function not allowed\n", tag); - else if (rc == H_Authority) - printk(KERN_INFO - "plpar-hcall (%s) failed; not authorized to this function\n", - tag); - else if (rc == H_Parameter) - printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n", - tag); - else - printk(KERN_INFO - "plpar-hcall (%s) failed with unexpected rc(0x%lx)\n", - tag, rc); - -} /* * H_GET_PPP hcall returns info in 4 parms. diff --git a/trunk/arch/powerpc/kernel/misc_32.S b/trunk/arch/powerpc/kernel/misc_32.S index 624a983a9676..f6d84a75ed26 100644 --- a/trunk/arch/powerpc/kernel/misc_32.S +++ b/trunk/arch/powerpc/kernel/misc_32.S @@ -27,6 +27,14 @@ .text + .align 5 +_GLOBAL(__delay) + cmpwi 0,r3,0 + mtctr r3 + beqlr +1: bdnz 1b + blr + /* * This returns the high 64 bits of the product of two 64-bit numbers. */ diff --git a/trunk/arch/powerpc/kernel/ppc_ksyms.c b/trunk/arch/powerpc/kernel/ppc_ksyms.c index 94db25708456..5dcf4ba05ee8 100644 --- a/trunk/arch/powerpc/kernel/ppc_ksyms.c +++ b/trunk/arch/powerpc/kernel/ppc_ksyms.c @@ -105,13 +105,6 @@ EXPORT_SYMBOL(__clear_user); EXPORT_SYMBOL(__strncpy_from_user); EXPORT_SYMBOL(__strnlen_user); -#ifndef __powerpc64__ -EXPORT_SYMBOL(__ide_mm_insl); -EXPORT_SYMBOL(__ide_mm_outsw); -EXPORT_SYMBOL(__ide_mm_insw); -EXPORT_SYMBOL(__ide_mm_outsl); -#endif - EXPORT_SYMBOL(_insb); EXPORT_SYMBOL(_outsb); EXPORT_SYMBOL(_insw); @@ -146,6 +139,9 @@ EXPORT_SYMBOL(pci_bus_io_base); EXPORT_SYMBOL(pci_bus_io_base_phys); EXPORT_SYMBOL(pci_bus_mem_base_phys); EXPORT_SYMBOL(pci_bus_to_hose); +EXPORT_SYMBOL(pci_resource_to_bus); +EXPORT_SYMBOL(pci_phys_to_bus); +EXPORT_SYMBOL(pci_bus_to_phys); #endif /* CONFIG_PCI */ #ifdef CONFIG_NOT_COHERENT_CACHE @@ -163,13 +159,15 @@ EXPORT_SYMBOL(giveup_altivec); EXPORT_SYMBOL(giveup_spe); #endif /* CONFIG_SPE */ -#ifndef CONFIG_PPC64 +#ifdef CONFIG_PPC64 +EXPORT_SYMBOL(__flush_icache_range); +#else EXPORT_SYMBOL(flush_instruction_cache); +EXPORT_SYMBOL(flush_icache_range); EXPORT_SYMBOL(flush_tlb_kernel_range); EXPORT_SYMBOL(flush_tlb_page); EXPORT_SYMBOL(_tlbie); #endif -EXPORT_SYMBOL(__flush_icache_range); EXPORT_SYMBOL(flush_dcache_range); #ifdef CONFIG_SMP diff --git a/trunk/arch/powerpc/kernel/process.c b/trunk/arch/powerpc/kernel/process.c index 105d5609ff57..de69fb37c731 100644 --- a/trunk/arch/powerpc/kernel/process.c +++ b/trunk/arch/powerpc/kernel/process.c @@ -201,28 +201,6 @@ int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs) } #endif /* CONFIG_SPE */ -/* - * If we are doing lazy switching of CPU state (FP, altivec or SPE), - * and the current task has some state, discard it. - */ -static inline void discard_lazy_cpu_state(void) -{ -#ifndef CONFIG_SMP - preempt_disable(); - if (last_task_used_math == current) - last_task_used_math = NULL; -#ifdef CONFIG_ALTIVEC - if (last_task_used_altivec == current) - last_task_used_altivec = NULL; -#endif /* CONFIG_ALTIVEC */ -#ifdef CONFIG_SPE - if (last_task_used_spe == current) - last_task_used_spe = NULL; -#endif - preempt_enable(); -#endif /* CONFIG_SMP */ -} - int set_dabr(unsigned long dabr) { if (ppc_md.set_dabr) @@ -456,7 +434,19 @@ void show_regs(struct pt_regs * regs) void exit_thread(void) { kprobe_flush_task(current); - discard_lazy_cpu_state(); + +#ifndef CONFIG_SMP + if (last_task_used_math == current) + last_task_used_math = NULL; +#ifdef CONFIG_ALTIVEC + if (last_task_used_altivec == current) + last_task_used_altivec = NULL; +#endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + if (last_task_used_spe == current) + last_task_used_spe = NULL; +#endif +#endif /* CONFIG_SMP */ } void flush_thread(void) @@ -467,8 +457,20 @@ void flush_thread(void) if (t->flags & _TIF_ABI_PENDING) t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); #endif + kprobe_flush_task(current); - discard_lazy_cpu_state(); +#ifndef CONFIG_SMP + if (last_task_used_math == current) + last_task_used_math = NULL; +#ifdef CONFIG_ALTIVEC + if (last_task_used_altivec == current) + last_task_used_altivec = NULL; +#endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + if (last_task_used_spe == current) + last_task_used_spe = NULL; +#endif +#endif /* CONFIG_SMP */ #ifdef CONFIG_PPC64 /* for now */ if (current->thread.dabr) { @@ -634,7 +636,18 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) } #endif - discard_lazy_cpu_state(); +#ifndef CONFIG_SMP + if (last_task_used_math == current) + last_task_used_math = NULL; +#ifdef CONFIG_ALTIVEC + if (last_task_used_altivec == current) + last_task_used_altivec = NULL; +#endif +#ifdef CONFIG_SPE + if (last_task_used_spe == current) + last_task_used_spe = NULL; +#endif +#endif /* CONFIG_SMP */ memset(current->thread.fpr, 0, sizeof(current->thread.fpr)); current->thread.fpscr.val = 0; #ifdef CONFIG_ALTIVEC diff --git a/trunk/arch/powerpc/kernel/prom.c b/trunk/arch/powerpc/kernel/prom.c index 3bf968e74095..6a5b468edb4d 100644 --- a/trunk/arch/powerpc/kernel/prom.c +++ b/trunk/arch/powerpc/kernel/prom.c @@ -1368,7 +1368,6 @@ prom_n_addr_cells(struct device_node* np) /* No #address-cells property for the root node, default to 1 */ return 1; } -EXPORT_SYMBOL(prom_n_addr_cells); int prom_n_size_cells(struct device_node* np) @@ -1384,7 +1383,6 @@ prom_n_size_cells(struct device_node* np) /* No #size-cells property for the root node, default to 1 */ return 1; } -EXPORT_SYMBOL(prom_n_size_cells); /** * Work out the sense (active-low level / active-high edge) diff --git a/trunk/arch/powerpc/kernel/prom_init.c b/trunk/arch/powerpc/kernel/prom_init.c index bcdc209dca85..4ce0105c308e 100644 --- a/trunk/arch/powerpc/kernel/prom_init.c +++ b/trunk/arch/powerpc/kernel/prom_init.c @@ -265,7 +265,7 @@ static int __init call_prom_ret(const char *service, int nargs, int nret, va_end(list); for (i = 0; i < nret; i++) - args.args[nargs+i] = 0; + rets[nargs+i] = 0; if (enter_prom(&args, RELOC(prom_entry)) < 0) return PROM_ERROR; diff --git a/trunk/arch/powerpc/kernel/ptrace.c b/trunk/arch/powerpc/kernel/ptrace.c index 400793c71304..3d2abd95c7ae 100644 --- a/trunk/arch/powerpc/kernel/ptrace.c +++ b/trunk/arch/powerpc/kernel/ptrace.c @@ -36,9 +36,8 @@ #include #include #include - #ifdef CONFIG_PPC64 -#include "ptrace-common.h" +#include #endif #ifdef CONFIG_PPC32 diff --git a/trunk/arch/powerpc/kernel/ptrace32.c b/trunk/arch/powerpc/kernel/ptrace32.c index 61762640b877..91eb952e0293 100644 --- a/trunk/arch/powerpc/kernel/ptrace32.c +++ b/trunk/arch/powerpc/kernel/ptrace32.c @@ -33,8 +33,7 @@ #include #include #include - -#include "ptrace-common.h" +#include /* * does not yet catch signals sent when the child dies. diff --git a/trunk/arch/powerpc/kernel/rtas-rtc.c b/trunk/arch/powerpc/kernel/rtas-rtc.c deleted file mode 100644 index 635d3b9a8811..000000000000 --- a/trunk/arch/powerpc/kernel/rtas-rtc.c +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#define MAX_RTC_WAIT 5000 /* 5 sec */ -#define RTAS_CLOCK_BUSY (-2) -unsigned long __init rtas_get_boot_time(void) -{ - int ret[8]; - int error, wait_time; - u64 max_wait_tb; - - max_wait_tb = get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; - do { - error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); - if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { - wait_time = rtas_extended_busy_delay_time(error); - /* This is boot time so we spin. */ - udelay(wait_time*1000); - error = RTAS_CLOCK_BUSY; - } - } while (error == RTAS_CLOCK_BUSY && (get_tb() < max_wait_tb)); - - if (error != 0 && printk_ratelimit()) { - printk(KERN_WARNING "error: reading the clock failed (%d)\n", - error); - return 0; - } - - return mktime(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]); -} - -/* NOTE: get_rtc_time will get an error if executed in interrupt context - * and if a delay is needed to read the clock. In this case we just - * silently return without updating rtc_tm. - */ -void rtas_get_rtc_time(struct rtc_time *rtc_tm) -{ - int ret[8]; - int error, wait_time; - u64 max_wait_tb; - - max_wait_tb = get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; - do { - error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); - if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { - if (in_interrupt() && printk_ratelimit()) { - memset(&rtc_tm, 0, sizeof(struct rtc_time)); - printk(KERN_WARNING "error: reading clock" - " would delay interrupt\n"); - return; /* delay not allowed */ - } - wait_time = rtas_extended_busy_delay_time(error); - msleep(wait_time); - error = RTAS_CLOCK_BUSY; - } - } while (error == RTAS_CLOCK_BUSY && (get_tb() < max_wait_tb)); - - if (error != 0 && printk_ratelimit()) { - printk(KERN_WARNING "error: reading the clock failed (%d)\n", - error); - return; - } - - rtc_tm->tm_sec = ret[5]; - rtc_tm->tm_min = ret[4]; - rtc_tm->tm_hour = ret[3]; - rtc_tm->tm_mday = ret[2]; - rtc_tm->tm_mon = ret[1] - 1; - rtc_tm->tm_year = ret[0] - 1900; -} - -int rtas_set_rtc_time(struct rtc_time *tm) -{ - int error, wait_time; - u64 max_wait_tb; - - max_wait_tb = get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; - do { - error = rtas_call(rtas_token("set-time-of-day"), 7, 1, NULL, - tm->tm_year + 1900, tm->tm_mon + 1, - tm->tm_mday, tm->tm_hour, tm->tm_min, - tm->tm_sec, 0); - if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { - if (in_interrupt()) - return 1; /* probably decrementer */ - wait_time = rtas_extended_busy_delay_time(error); - msleep(wait_time); - error = RTAS_CLOCK_BUSY; - } - } while (error == RTAS_CLOCK_BUSY && (get_tb() < max_wait_tb)); - - if (error != 0 && printk_ratelimit()) - printk(KERN_WARNING "error: setting the clock failed (%d)\n", - error); - - return 0; -} diff --git a/trunk/arch/powerpc/kernel/rtas_pci.c b/trunk/arch/powerpc/kernel/rtas_pci.c index 60dec2401c26..0e5a8e116653 100644 --- a/trunk/arch/powerpc/kernel/rtas_pci.c +++ b/trunk/arch/powerpc/kernel/rtas_pci.c @@ -304,18 +304,75 @@ static int __devinit setup_phb(struct device_node *dev, struct pci_controller *phb, unsigned int addr_size_words) { + pci_setup_pci_controller(phb); + if (is_python(dev)) python_countermeasures(dev, addr_size_words); if (phb_set_bus_ranges(dev, phb)) return 1; + phb->arch_data = dev; phb->ops = &rtas_pci_ops; phb->buid = get_phb_buid(dev); return 0; } +static void __devinit add_linux_pci_domain(struct device_node *dev, + struct pci_controller *phb, + struct property *of_prop) +{ + memset(of_prop, 0, sizeof(struct property)); + of_prop->name = "linux,pci-domain"; + of_prop->length = sizeof(phb->global_number); + of_prop->value = (unsigned char *)&of_prop[1]; + memcpy(of_prop->value, &phb->global_number, sizeof(phb->global_number)); + prom_add_property(dev, of_prop); +} + +static struct pci_controller * __init alloc_phb(struct device_node *dev, + unsigned int addr_size_words) +{ + struct pci_controller *phb; + struct property *of_prop; + + phb = alloc_bootmem(sizeof(struct pci_controller)); + if (phb == NULL) + return NULL; + + of_prop = alloc_bootmem(sizeof(struct property) + + sizeof(phb->global_number)); + if (!of_prop) + return NULL; + + if (setup_phb(dev, phb, addr_size_words)) + return NULL; + + add_linux_pci_domain(dev, phb, of_prop); + + return phb; +} + +static struct pci_controller * __devinit alloc_phb_dynamic(struct device_node *dev, unsigned int addr_size_words) +{ + struct pci_controller *phb; + + phb = (struct pci_controller *)kmalloc(sizeof(struct pci_controller), + GFP_KERNEL); + if (phb == NULL) + return NULL; + + if (setup_phb(dev, phb, addr_size_words)) + return NULL; + + phb->is_dynamic = 1; + + /* TODO: linux,pci-domain? */ + + return phb; +} + unsigned long __init find_and_init_phbs(void) { struct device_node *node; @@ -340,10 +397,10 @@ unsigned long __init find_and_init_phbs(void) if (node->type == NULL || strcmp(node->type, "pci") != 0) continue; - phb = pcibios_alloc_controller(node); + phb = alloc_phb(node, root_size_cells); if (!phb) continue; - setup_phb(node, phb, root_size_cells); + pci_process_bridge_OF_ranges(phb, node, 0); pci_setup_phb_io(phb, index == 0); #ifdef CONFIG_PPC_PSERIES @@ -389,10 +446,10 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) root_size_cells = prom_n_size_cells(root); primary = list_empty(&hose_list); - phb = pcibios_alloc_controller(dn); + phb = alloc_phb_dynamic(dn, root_size_cells); if (!phb) return NULL; - setup_phb(dn, phb, root_size_cells); + pci_process_bridge_OF_ranges(phb, dn, primary); pci_setup_phb_io_dynamic(phb, primary); @@ -448,7 +505,8 @@ int pcibios_remove_root_bus(struct pci_controller *phb) } list_del(&phb->list_node); - pcibios_free_controller(phb); + if (phb->is_dynamic) + kfree(phb); return 0; } diff --git a/trunk/arch/powerpc/kernel/setup-common.c b/trunk/arch/powerpc/kernel/setup-common.c index bd3eb4292b53..33e7f2c7f194 100644 --- a/trunk/arch/powerpc/kernel/setup-common.c +++ b/trunk/arch/powerpc/kernel/setup-common.c @@ -59,7 +59,6 @@ #undef DEBUG #ifdef DEBUG -#include #define DBG(fmt...) udbg_printf(fmt) #else #define DBG(fmt...) diff --git a/trunk/arch/powerpc/kernel/setup_32.c b/trunk/arch/powerpc/kernel/setup_32.c index e5694335bf10..c98cfcc9cd9a 100644 --- a/trunk/arch/powerpc/kernel/setup_32.c +++ b/trunk/arch/powerpc/kernel/setup_32.c @@ -57,6 +57,10 @@ extern void power4_idle(void); boot_infos_t *boot_infos; struct ide_machdep_calls ppc_ide_md; +/* XXX should go elsewhere */ +int __irq_offset_value; +EXPORT_SYMBOL(__irq_offset_value); + int boot_cpuid; EXPORT_SYMBOL_GPL(boot_cpuid); int boot_cpuid_phys; diff --git a/trunk/arch/powerpc/kernel/setup_64.c b/trunk/arch/powerpc/kernel/setup_64.c index e3fb78397dc6..fdbd9f9122f2 100644 --- a/trunk/arch/powerpc/kernel/setup_64.c +++ b/trunk/arch/powerpc/kernel/setup_64.c @@ -59,7 +59,6 @@ #include #include #include -#include #include "setup.h" @@ -102,15 +101,7 @@ int boot_cpuid_phys = 0; dev_t boot_dev; u64 ppc64_pft_size; -/* Pick defaults since we might want to patch instructions - * before we've read this from the device tree. - */ -struct ppc64_caches ppc64_caches = { - .dline_size = 0x80, - .log_dline_size = 7, - .iline_size = 0x80, - .log_iline_size = 7 -}; +struct ppc64_caches ppc64_caches; EXPORT_SYMBOL_GPL(ppc64_caches); /* @@ -424,10 +415,6 @@ void __init setup_system(void) */ unflatten_device_tree(); -#ifdef CONFIG_KEXEC - kexec_setup(); /* requires unflattened device tree. */ -#endif - /* * Fill the ppc64_caches & systemcfg structures with informations * retreived from the device-tree. Need to be called before diff --git a/trunk/arch/powerpc/kernel/signal_32.c b/trunk/arch/powerpc/kernel/signal_32.c index 5a2eba60dd39..8bdf95b7e420 100644 --- a/trunk/arch/powerpc/kernel/signal_32.c +++ b/trunk/arch/powerpc/kernel/signal_32.c @@ -403,6 +403,8 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, ELF_NFPREG * sizeof(double))) return 1; + current->thread.fpscr.val = 0; /* turn off all fp exceptions */ + #ifdef CONFIG_ALTIVEC /* save altivec registers */ if (current->thread.used_vr) { @@ -816,9 +818,6 @@ static int handle_rt_signal(unsigned long sig, struct k_sigaction *ka, goto badframe; regs->link = (unsigned long) frame->tramp; } - - current->thread.fpscr.val = 0; /* turn off all fp exceptions */ - if (put_user(regs->gpr[1], (u32 __user *)newsp)) goto badframe; regs->gpr[1] = newsp; @@ -1098,8 +1097,6 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka, regs->link = (unsigned long) frame->mctx.tramp; } - current->thread.fpscr.val = 0; /* turn off all fp exceptions */ - if (put_user(regs->gpr[1], (u32 __user *)newsp)) goto badframe; regs->gpr[1] = newsp; diff --git a/trunk/arch/powerpc/kernel/signal_64.c b/trunk/arch/powerpc/kernel/signal_64.c index 1decf2785530..58194e150711 100644 --- a/trunk/arch/powerpc/kernel/signal_64.c +++ b/trunk/arch/powerpc/kernel/signal_64.c @@ -131,6 +131,9 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, flush_fp_to_thread(current); + /* Make sure signal doesn't get spurrious FP exceptions */ + current->thread.fpscr.val = 0; + #ifdef CONFIG_ALTIVEC err |= __put_user(v_regs, &sc->v_regs); @@ -420,9 +423,6 @@ static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, if (err) goto badframe; - /* Make sure signal handler doesn't get spurious FP exceptions */ - current->thread.fpscr.val = 0; - /* Set up to return from userspace. */ if (vdso64_rt_sigtramp && current->thread.vdso_base) { regs->link = current->thread.vdso_base + vdso64_rt_sigtramp; diff --git a/trunk/arch/powerpc/kernel/smp.c b/trunk/arch/powerpc/kernel/smp.c index 30374d2f88e5..62dfc5b8d765 100644 --- a/trunk/arch/powerpc/kernel/smp.c +++ b/trunk/arch/powerpc/kernel/smp.c @@ -49,16 +49,15 @@ #include #endif +int smp_hw_index[NR_CPUS]; +struct thread_info *secondary_ti; + #ifdef DEBUG -#include #define DBG(fmt...) udbg_printf(fmt) #else #define DBG(fmt...) #endif -int smp_hw_index[NR_CPUS]; -struct thread_info *secondary_ti; - cpumask_t cpu_possible_map = CPU_MASK_NONE; cpumask_t cpu_online_map = CPU_MASK_NONE; cpumask_t cpu_sibling_map[NR_CPUS] = { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; diff --git a/trunk/arch/powerpc/kernel/syscalls.c b/trunk/arch/powerpc/kernel/syscalls.c index 91b93d917b64..f72ced11212d 100644 --- a/trunk/arch/powerpc/kernel/syscalls.c +++ b/trunk/arch/powerpc/kernel/syscalls.c @@ -247,7 +247,7 @@ long ppc64_personality(unsigned long personality) #define OVERRIDE_MACHINE 0 #endif -static inline int override_machine(char __user *mach) +static inline int override_machine(char *mach) { if (OVERRIDE_MACHINE) { /* change ppc64 to ppc */ diff --git a/trunk/arch/powerpc/kernel/time.c b/trunk/arch/powerpc/kernel/time.c index de8479769bb7..070b4b458aaf 100644 --- a/trunk/arch/powerpc/kernel/time.c +++ b/trunk/arch/powerpc/kernel/time.c @@ -130,34 +130,6 @@ unsigned long tb_last_stamp; */ DEFINE_PER_CPU(unsigned long, last_jiffy); -void __delay(unsigned long loops) -{ - unsigned long start; - int diff; - - if (__USE_RTC()) { - start = get_rtcl(); - do { - /* the RTCL register wraps at 1000000000 */ - diff = get_rtcl() - start; - if (diff < 0) - diff += 1000000000; - } while (diff < loops); - } else { - start = get_tbl(); - while (get_tbl() - start < loops) - HMT_low(); - HMT_medium(); - } -} -EXPORT_SYMBOL(__delay); - -void udelay(unsigned long usecs) -{ - __delay(tb_ticks_per_usec * usecs); -} -EXPORT_SYMBOL(udelay); - static __inline__ void timer_check_rtc(void) { /* diff --git a/trunk/arch/powerpc/kernel/vdso.c b/trunk/arch/powerpc/kernel/vdso.c index f0c47dab0903..0d4d8bec0df4 100644 --- a/trunk/arch/powerpc/kernel/vdso.c +++ b/trunk/arch/powerpc/kernel/vdso.c @@ -145,7 +145,8 @@ static void dump_vdso_pages(struct vm_area_struct * vma) struct page *pg = virt_to_page(vdso32_kbase + i*PAGE_SIZE); struct page *upg = (vma && vma->vm_mm) ? - follow_page(vma, vma->vm_start + i*PAGE_SIZE, 0) + follow_page(vma->vm_mm, vma->vm_start + + i*PAGE_SIZE, 0) : NULL; dump_one_vdso_page(pg, upg); } @@ -156,7 +157,8 @@ static void dump_vdso_pages(struct vm_area_struct * vma) struct page *pg = virt_to_page(vdso64_kbase + i*PAGE_SIZE); struct page *upg = (vma && vma->vm_mm) ? - follow_page(vma, vma->vm_start + i*PAGE_SIZE, 0) + follow_page(vma->vm_mm, vma->vm_start + + i*PAGE_SIZE, 0) : NULL; dump_one_vdso_page(pg, upg); } @@ -283,7 +285,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, * It's fine to use that for setting breakpoints in the vDSO code * pages though */ - vma->vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC; + vma->vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | + VM_MAYEXEC | VM_RESERVED; vma->vm_flags |= mm->def_flags; vma->vm_page_prot = protection_map[vma->vm_flags & 0x7]; vma->vm_ops = &vdso_vmops; diff --git a/trunk/arch/powerpc/kernel/vdso32/cacheflush.S b/trunk/arch/powerpc/kernel/vdso32/cacheflush.S index 09629aea3e47..c8db993574ee 100644 --- a/trunk/arch/powerpc/kernel/vdso32/cacheflush.S +++ b/trunk/arch/powerpc/kernel/vdso32/cacheflush.S @@ -35,7 +35,6 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache) subf r8,r6,r4 /* compute length */ add r8,r8,r5 /* ensure we get enough */ srwi. r8,r8,7 /* compute line count */ - crclr cr0*4+so beqlr /* nothing to do? */ mtctr r8 mr r3,r6 @@ -59,7 +58,6 @@ V_FUNCTION_END(__kernel_sync_dicache) */ V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) .cfi_startproc - crclr cr0*4+so sync isync li r3,0 diff --git a/trunk/arch/powerpc/kernel/vdso32/datapage.S b/trunk/arch/powerpc/kernel/vdso32/datapage.S index 4709f1d9542c..a08c26e87835 100644 --- a/trunk/arch/powerpc/kernel/vdso32/datapage.S +++ b/trunk/arch/powerpc/kernel/vdso32/datapage.S @@ -54,6 +54,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) .cfi_startproc mflr r12 .cfi_register lr,r12 + mr r4,r3 bl __get_datapage@local mtlr r12 @@ -62,7 +63,6 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) beqlr li r0,__NR_syscalls stw r0,0(r4) - crclr cr0*4+so blr .cfi_endproc V_FUNCTION_END(__kernel_get_syscall_map) @@ -77,10 +77,8 @@ V_FUNCTION_BEGIN(__kernel_get_tbfreq) mflr r12 .cfi_register lr,r12 bl __get_datapage@local - lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3) lwz r3,CFG_TB_TICKS_PER_SEC(r3) + lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3) mtlr r12 - crclr cr0*4+so - blr .cfi_endproc V_FUNCTION_END(__kernel_get_tbfreq) diff --git a/trunk/arch/powerpc/kernel/vdso32/gettimeofday.S b/trunk/arch/powerpc/kernel/vdso32/gettimeofday.S index 7eebff03a041..aeb5fc9b87b3 100644 --- a/trunk/arch/powerpc/kernel/vdso32/gettimeofday.S +++ b/trunk/arch/powerpc/kernel/vdso32/gettimeofday.S @@ -59,7 +59,6 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) stw r5,TZONE_TZ_DSTTIME(r11) 1: mtlr r12 - crclr cr0*4+so li r3,0 blr @@ -84,7 +83,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) /* Check for supported clock IDs */ cmpli cr0,r3,CLOCK_REALTIME cmpli cr1,r3,CLOCK_MONOTONIC - cror cr0*4+eq,cr0*4+eq,cr1*4+eq + cror cr0,cr0,cr1 bne cr0,99f mflr r12 /* r12 saves lr */ @@ -92,7 +91,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) mr r10,r3 /* r10 saves id */ mr r11,r4 /* r11 saves tp */ bl __get_datapage@local /* get data page */ - mr r9,r3 /* datapage ptr in r9 */ + mr r9, r3 /* datapage ptr in r9 */ beq cr1,50f /* if monotonic -> jump there */ /* @@ -118,7 +117,6 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) mulli r5,r5,1000 stw r5,TSPC32_TV_NSEC(r11) mtlr r12 - crclr cr0*4+so li r3,0 blr @@ -175,19 +173,14 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) add r4,r4,r7 lis r5,NSEC_PER_SEC@h ori r5,r5,NSEC_PER_SEC@l - cmpl cr0,r4,r5 - cmpli cr1,r4,0 + cmpli cr0,r4,r5 blt 1f subf r4,r5,r4 addi r3,r3,1 -1: bge cr1,1f - addi r3,r3,-1 - add r4,r4,r5 1: stw r3,TSPC32_TV_SEC(r11) stw r4,TSPC32_TV_NSEC(r11) mtlr r12 - crclr cr0*4+so li r3,0 blr @@ -217,12 +210,11 @@ V_FUNCTION_BEGIN(__kernel_clock_getres) /* Check for supported clock IDs */ cmpwi cr0,r3,CLOCK_REALTIME cmpwi cr1,r3,CLOCK_MONOTONIC - cror cr0*4+eq,cr0*4+eq,cr1*4+eq + cror cr0,cr0,cr1 bne cr0,99f li r3,0 cmpli cr0,r4,0 - crclr cr0*4+so beqlr lis r5,CLOCK_REALTIME_RES@h ori r5,r5,CLOCK_REALTIME_RES@l diff --git a/trunk/arch/powerpc/kernel/vdso64/cacheflush.S b/trunk/arch/powerpc/kernel/vdso64/cacheflush.S index cb4ae0a5edd0..d4a0ad28d534 100644 --- a/trunk/arch/powerpc/kernel/vdso64/cacheflush.S +++ b/trunk/arch/powerpc/kernel/vdso64/cacheflush.S @@ -35,7 +35,6 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache) subf r8,r6,r4 /* compute length */ add r8,r8,r5 /* ensure we get enough */ srwi. r8,r8,7 /* compute line count */ - crclr cr0*4+so beqlr /* nothing to do? */ mtctr r8 mr r3,r6 @@ -59,7 +58,6 @@ V_FUNCTION_END(__kernel_sync_dicache) */ V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) .cfi_startproc - crclr cr0*4+so sync isync li r3,0 diff --git a/trunk/arch/powerpc/kernel/vdso64/datapage.S b/trunk/arch/powerpc/kernel/vdso64/datapage.S index 3b2dd7d0c1eb..e67eda0f8cda 100644 --- a/trunk/arch/powerpc/kernel/vdso64/datapage.S +++ b/trunk/arch/powerpc/kernel/vdso64/datapage.S @@ -54,12 +54,12 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) .cfi_startproc mflr r12 .cfi_register lr,r12 + mr r4,r3 bl V_LOCAL_FUNC(__get_datapage) mtlr r12 addi r3,r3,CFG_SYSCALL_MAP64 cmpli cr0,r4,0 - crclr cr0*4+so beqlr li r0,__NR_syscalls stw r0,0(r4) @@ -80,7 +80,5 @@ V_FUNCTION_BEGIN(__kernel_get_tbfreq) bl V_LOCAL_FUNC(__get_datapage) ld r3,CFG_TB_TICKS_PER_SEC(r3) mtlr r12 - crclr cr0*4+so - blr .cfi_endproc V_FUNCTION_END(__kernel_get_tbfreq) diff --git a/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S b/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S index ccaeda5136d1..d371c02a8c0e 100644 --- a/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S +++ b/trunk/arch/powerpc/kernel/vdso64/gettimeofday.S @@ -1,5 +1,4 @@ - - /* +/* * Userland implementation of gettimeofday() for 64 bits processes in a * ppc64 kernel for use in the vDSO * @@ -52,7 +51,6 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) stw r4,TZONE_TZ_MINWEST(r10) stw r5,TZONE_TZ_DSTTIME(r10) 1: mtlr r12 - crclr cr0*4+so li r3,0 /* always success */ blr .cfi_endproc @@ -70,7 +68,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) /* Check for supported clock IDs */ cmpwi cr0,r3,CLOCK_REALTIME cmpwi cr1,r3,CLOCK_MONOTONIC - cror cr0*4+eq,cr0*4+eq,cr1*4+eq + cror cr0,cr0,cr1 bne cr0,99f mflr r12 /* r12 saves lr */ @@ -86,21 +84,19 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */ - lis r7,15 /* r7 = 1000000 = USEC_PER_SEC */ - ori r7,r7,16960 + lis r7,0x3b9a /* r7 = 1000000000 = NSEC_PER_SEC */ + ori r7,r7,0xca00 rldicl r5,r4,44,20 /* r5 = sec = xsec / XSEC_PER_SEC */ rldicr r6,r5,20,43 /* r6 = sec * XSEC_PER_SEC */ std r5,TSPC64_TV_SEC(r11) /* store sec in tv */ subf r0,r6,r4 /* r0 = xsec = (xsec - r6) */ - mulld r0,r0,r7 /* usec = (xsec * USEC_PER_SEC) / + mulld r0,r0,r7 /* nsec = (xsec * NSEC_PER_SEC) / * XSEC_PER_SEC */ rldicl r0,r0,44,20 - mulli r0,r0,1000 /* nsec = usec * 1000 */ std r0,TSPC64_TV_NSEC(r11) /* store nsec in tp */ mtlr r12 - crclr cr0*4+so li r3,0 blr @@ -110,16 +106,15 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) 50: bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */ - lis r7,15 /* r7 = 1000000 = USEC_PER_SEC */ - ori r7,r7,16960 + lis r7,0x3b9a /* r7 = 1000000000 = NSEC_PER_SEC */ + ori r7,r7,0xca00 rldicl r5,r4,44,20 /* r5 = sec = xsec / XSEC_PER_SEC */ rldicr r6,r5,20,43 /* r6 = sec * XSEC_PER_SEC */ subf r0,r6,r4 /* r0 = xsec = (xsec - r6) */ - mulld r0,r0,r7 /* usec = (xsec * USEC_PER_SEC) / + mulld r0,r0,r7 /* nsec = (xsec * NSEC_PER_SEC) / * XSEC_PER_SEC */ rldicl r6,r0,44,20 - mulli r6,r6,1000 /* nsec = usec * 1000 */ /* now we must fixup using wall to monotonic. We need to snapshot * that value and do the counter trick again. Fortunately, we still @@ -128,8 +123,8 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) * can be used */ - lwa r4,WTOM_CLOCK_SEC(r3) - lwa r7,WTOM_CLOCK_NSEC(r3) + lwz r4,WTOM_CLOCK_SEC(r9) + lwz r7,WTOM_CLOCK_NSEC(r9) /* We now have our result in r4,r7. We create a fake dependency * on that result and re-check the counter @@ -149,19 +144,14 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) add r7,r7,r6 lis r9,NSEC_PER_SEC@h ori r9,r9,NSEC_PER_SEC@l - cmpl cr0,r7,r9 - cmpli cr1,r7,0 + cmpli cr0,r7,r9 blt 1f subf r7,r9,r7 addi r4,r4,1 -1: bge cr1,1f - addi r4,r4,-1 - add r7,r7,r9 1: std r4,TSPC64_TV_SEC(r11) std r7,TSPC64_TV_NSEC(r11) mtlr r12 - crclr cr0*4+so li r3,0 blr @@ -191,12 +181,11 @@ V_FUNCTION_BEGIN(__kernel_clock_getres) /* Check for supported clock IDs */ cmpwi cr0,r3,CLOCK_REALTIME cmpwi cr1,r3,CLOCK_MONOTONIC - cror cr0*4+eq,cr0*4+eq,cr1*4+eq + cror cr0,cr0,cr1 bne cr0,99f li r3,0 cmpli cr0,r4,0 - crclr cr0*4+so beqlr lis r5,CLOCK_REALTIME_RES@h ori r5,r5,CLOCK_REALTIME_RES@l diff --git a/trunk/arch/powerpc/mm/4xx_mmu.c b/trunk/arch/powerpc/mm/4xx_mmu.c index 4d006aa1a0d1..b7bcbc232f39 100644 --- a/trunk/arch/powerpc/mm/4xx_mmu.c +++ b/trunk/arch/powerpc/mm/4xx_mmu.c @@ -110,11 +110,13 @@ unsigned long __init mmu_mapin_ram(void) pmd_t *pmdp; unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE; + spin_lock(&init_mm.page_table_lock); pmdp = pmd_offset(pgd_offset_k(v), v); pmd_val(*pmdp++) = val; pmd_val(*pmdp++) = val; pmd_val(*pmdp++) = val; pmd_val(*pmdp++) = val; + spin_unlock(&init_mm.page_table_lock); v += LARGE_PAGE_SIZE_16M; p += LARGE_PAGE_SIZE_16M; @@ -125,8 +127,10 @@ unsigned long __init mmu_mapin_ram(void) pmd_t *pmdp; unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE; + spin_lock(&init_mm.page_table_lock); pmdp = pmd_offset(pgd_offset_k(v), v); pmd_val(*pmdp) = val; + spin_unlock(&init_mm.page_table_lock); v += LARGE_PAGE_SIZE_4M; p += LARGE_PAGE_SIZE_4M; diff --git a/trunk/arch/powerpc/mm/fsl_booke_mmu.c b/trunk/arch/powerpc/mm/fsl_booke_mmu.c index 5d581bb3aa12..af9ca0eb6d55 100644 --- a/trunk/arch/powerpc/mm/fsl_booke_mmu.c +++ b/trunk/arch/powerpc/mm/fsl_booke_mmu.c @@ -1,5 +1,5 @@ /* - * Modifications by Kumar Gala (galak@kernel.crashing.org) to support + * Modifications by Kumar Gala (kumar.gala@freescale.com) to support * E500 Book E processors. * * Copyright 2004 Freescale Semiconductor, Inc diff --git a/trunk/arch/powerpc/mm/hash_utils_64.c b/trunk/arch/powerpc/mm/hash_utils_64.c index a606504678bd..706e8a63ced9 100644 --- a/trunk/arch/powerpc/mm/hash_utils_64.c +++ b/trunk/arch/powerpc/mm/hash_utils_64.c @@ -514,7 +514,7 @@ void __init htab_initialize(void) #undef KB #undef MB -void htab_initialize_secondary(void) +void __init htab_initialize_secondary(void) { if (!platform_is_lpar()) mtspr(SPRN_SDR1, _SDR1); @@ -601,7 +601,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) /* Handle hugepage regions */ if (unlikely(in_hugepage_area(mm->context, ea))) { DBG_LOW(" -> huge page !\n"); - return hash_huge_page(mm, access, ea, vsid, local, trap); + return hash_huge_page(mm, access, ea, vsid, local); } /* Get PTE and page size from page tables */ diff --git a/trunk/arch/powerpc/mm/hugetlbpage.c b/trunk/arch/powerpc/mm/hugetlbpage.c index 54131b877da3..426c269e552e 100644 --- a/trunk/arch/powerpc/mm/hugetlbpage.c +++ b/trunk/arch/powerpc/mm/hugetlbpage.c @@ -148,63 +148,43 @@ int is_aligned_hugepage_range(unsigned long addr, unsigned long len) return 0; } -struct slb_flush_info { - struct mm_struct *mm; - u16 newareas; -}; - static void flush_low_segments(void *parm) { - struct slb_flush_info *fi = parm; + u16 areas = (unsigned long) parm; unsigned long i; - BUILD_BUG_ON((sizeof(fi->newareas)*8) != NUM_LOW_AREAS); - - if (current->active_mm != fi->mm) - return; - - /* Only need to do anything if this CPU is working in the same - * mm as the one which has changed */ + asm volatile("isync" : : : "memory"); - /* update the paca copy of the context struct */ - get_paca()->context = current->active_mm->context; + BUILD_BUG_ON((sizeof(areas)*8) != NUM_LOW_AREAS); - asm volatile("isync" : : : "memory"); for (i = 0; i < NUM_LOW_AREAS; i++) { - if (! (fi->newareas & (1U << i))) + if (! (areas & (1U << i))) continue; asm volatile("slbie %0" : : "r" ((i << SID_SHIFT) | SLBIE_C)); } + asm volatile("isync" : : : "memory"); } static void flush_high_segments(void *parm) { - struct slb_flush_info *fi = parm; + u16 areas = (unsigned long) parm; unsigned long i, j; + asm volatile("isync" : : : "memory"); - BUILD_BUG_ON((sizeof(fi->newareas)*8) != NUM_HIGH_AREAS); - - if (current->active_mm != fi->mm) - return; - - /* Only need to do anything if this CPU is working in the same - * mm as the one which has changed */ - - /* update the paca copy of the context struct */ - get_paca()->context = current->active_mm->context; + BUILD_BUG_ON((sizeof(areas)*8) != NUM_HIGH_AREAS); - asm volatile("isync" : : : "memory"); for (i = 0; i < NUM_HIGH_AREAS; i++) { - if (! (fi->newareas & (1U << i))) + if (! (areas & (1U << i))) continue; for (j = 0; j < (1UL << (HTLB_AREA_SHIFT-SID_SHIFT)); j++) asm volatile("slbie %0" :: "r" (((i << HTLB_AREA_SHIFT) - + (j << SID_SHIFT)) | SLBIE_C)); + + (j << SID_SHIFT)) | SLBIE_C)); } + asm volatile("isync" : : : "memory"); } @@ -249,7 +229,6 @@ static int prepare_high_area_for_htlb(struct mm_struct *mm, unsigned long area) static int open_low_hpage_areas(struct mm_struct *mm, u16 newareas) { unsigned long i; - struct slb_flush_info fi; BUILD_BUG_ON((sizeof(newareas)*8) != NUM_LOW_AREAS); BUILD_BUG_ON((sizeof(mm->context.low_htlb_areas)*8) != NUM_LOW_AREAS); @@ -265,20 +244,19 @@ static int open_low_hpage_areas(struct mm_struct *mm, u16 newareas) mm->context.low_htlb_areas |= newareas; + /* update the paca copy of the context struct */ + get_paca()->context = mm->context; + /* the context change must make it to memory before the flush, * so that further SLB misses do the right thing. */ mb(); - - fi.mm = mm; - fi.newareas = newareas; - on_each_cpu(flush_low_segments, &fi, 0, 1); + on_each_cpu(flush_low_segments, (void *)(unsigned long)newareas, 0, 1); return 0; } static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas) { - struct slb_flush_info fi; unsigned long i; BUILD_BUG_ON((sizeof(newareas)*8) != NUM_HIGH_AREAS); @@ -302,25 +280,22 @@ static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas) /* the context change must make it to memory before the flush, * so that further SLB misses do the right thing. */ mb(); - - fi.mm = mm; - fi.newareas = newareas; - on_each_cpu(flush_high_segments, &fi, 0, 1); + on_each_cpu(flush_high_segments, (void *)(unsigned long)newareas, 0, 1); return 0; } int prepare_hugepage_range(unsigned long addr, unsigned long len) { - int err = 0; + int err; if ( (addr+len) < addr ) return -EINVAL; - if (addr < 0x100000000UL) + if ((addr + len) < 0x100000000UL) err = open_low_hpage_areas(current->mm, LOW_ESID_MASK(addr, len)); - if ((addr + len) > 0x100000000UL) + else err = open_high_hpage_areas(current->mm, HTLB_AREA_MASK(addr, len)); if (err) { @@ -664,36 +639,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, return -ENOMEM; } -/* - * Called by asm hashtable.S for doing lazy icache flush - */ -static unsigned int hash_huge_page_do_lazy_icache(unsigned long rflags, - pte_t pte, int trap) -{ - struct page *page; - int i; - - if (!pfn_valid(pte_pfn(pte))) - return rflags; - - page = pte_page(pte); - - /* page is dirty */ - if (!test_bit(PG_arch_1, &page->flags) && !PageReserved(page)) { - if (trap == 0x400) { - for (i = 0; i < (HPAGE_SIZE / PAGE_SIZE); i++) - __flush_dcache_icache(page_address(page+i)); - set_bit(PG_arch_1, &page->flags); - } else { - rflags |= HPTE_R_N; - } - } - return rflags; -} - int hash_huge_page(struct mm_struct *mm, unsigned long access, - unsigned long ea, unsigned long vsid, int local, - unsigned long trap) + unsigned long ea, unsigned long vsid, int local) { pte_t *ptep; unsigned long old_pte, new_pte; @@ -744,11 +691,6 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access, rflags = 0x2 | (!(new_pte & _PAGE_RW)); /* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */ rflags |= ((new_pte & _PAGE_EXEC) ? 0 : HPTE_R_N); - if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) - /* No CPU has hugepages but lacks no execute, so we - * don't need to worry about that case */ - rflags = hash_huge_page_do_lazy_icache(rflags, __pte(old_pte), - trap); /* Check if pte already has an hpte (case 2) */ if (unlikely(old_pte & _PAGE_HASHPTE)) { @@ -761,8 +703,7 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access, slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; slot += (old_pte & _PAGE_F_GIX) >> 12; - if (ppc_md.hpte_updatepp(slot, rflags, va, mmu_huge_psize, - local) == -1) + if (ppc_md.hpte_updatepp(slot, rflags, va, 1, local) == -1) old_pte &= ~_PAGE_HPTEFLAGS; } @@ -813,7 +754,9 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access, } /* - * No need to use ldarx/stdcx here + * No need to use ldarx/stdcx here because all who + * might be updating the pte will hold the + * page_table_lock */ *ptep = __pte(new_pte & ~_PAGE_BUSY); diff --git a/trunk/arch/powerpc/mm/imalloc.c b/trunk/arch/powerpc/mm/imalloc.c index f9587bcc6a48..f4ca29cf5364 100644 --- a/trunk/arch/powerpc/mm/imalloc.c +++ b/trunk/arch/powerpc/mm/imalloc.c @@ -14,10 +14,9 @@ #include #include #include +#include #include -#include "mmu_decl.h" - static DECLARE_MUTEX(imlist_sem); struct vm_struct * imlist = NULL; diff --git a/trunk/arch/powerpc/mm/init_64.c b/trunk/arch/powerpc/mm/init_64.c index 81cfb0c2ec58..1134f70f231d 100644 --- a/trunk/arch/powerpc/mm/init_64.c +++ b/trunk/arch/powerpc/mm/init_64.c @@ -64,8 +64,7 @@ #include #include #include - -#include "mmu_decl.h" +#include #ifdef DEBUG #define DBG(fmt...) printk(fmt) diff --git a/trunk/arch/powerpc/mm/lmb.c b/trunk/arch/powerpc/mm/lmb.c index 9584608fd768..9b5aa6808eb8 100644 --- a/trunk/arch/powerpc/mm/lmb.c +++ b/trunk/arch/powerpc/mm/lmb.c @@ -22,38 +22,35 @@ #include "mmu_decl.h" /* for __max_low_memory */ #endif -#undef DEBUG - -#ifdef DEBUG -#include -#define DBG(fmt...) udbg_printf(fmt) -#else -#define DBG(fmt...) -#endif - struct lmb lmb; +#undef DEBUG + void lmb_dump_all(void) { #ifdef DEBUG unsigned long i; - DBG("lmb_dump_all:\n"); - DBG(" memory.cnt = 0x%lx\n", lmb.memory.cnt); - DBG(" memory.size = 0x%lx\n", lmb.memory.size); + udbg_printf("lmb_dump_all:\n"); + udbg_printf(" memory.cnt = 0x%lx\n", + lmb.memory.cnt); + udbg_printf(" memory.size = 0x%lx\n", + lmb.memory.size); for (i=0; i < lmb.memory.cnt ;i++) { - DBG(" memory.region[0x%x].base = 0x%lx\n", + udbg_printf(" memory.region[0x%x].base = 0x%lx\n", i, lmb.memory.region[i].base); - DBG(" .size = 0x%lx\n", + udbg_printf(" .size = 0x%lx\n", lmb.memory.region[i].size); } - DBG("\n reserved.cnt = 0x%lx\n", lmb.reserved.cnt); - DBG(" reserved.size = 0x%lx\n", lmb.reserved.size); + udbg_printf("\n reserved.cnt = 0x%lx\n", + lmb.reserved.cnt); + udbg_printf(" reserved.size = 0x%lx\n", + lmb.reserved.size); for (i=0; i < lmb.reserved.cnt ;i++) { - DBG(" reserved.region[0x%x].base = 0x%lx\n", + udbg_printf(" reserved.region[0x%x].base = 0x%lx\n", i, lmb.reserved.region[i].base); - DBG(" .size = 0x%lx\n", + udbg_printf(" .size = 0x%lx\n", lmb.reserved.region[i].size); } #endif /* DEBUG */ diff --git a/trunk/arch/powerpc/mm/mem.c b/trunk/arch/powerpc/mm/mem.c index ed6ed2e30dac..e2c95fcb8055 100644 --- a/trunk/arch/powerpc/mm/mem.c +++ b/trunk/arch/powerpc/mm/mem.c @@ -200,8 +200,6 @@ void show_mem(void) unsigned long flags; pgdat_resize_lock(pgdat, &flags); for (i = 0; i < pgdat->node_spanned_pages; i++) { - if (!pfn_valid(pgdat->node_start_pfn + i)) - continue; page = pgdat_page_nr(pgdat, i); total++; if (PageHighMem(page)) @@ -338,7 +336,7 @@ void __init mem_init(void) struct page *page; unsigned long reservedpages = 0, codesize, initsize, datasize, bsssize; - num_physpages = lmb.memory.size >> PAGE_SHIFT; + num_physpages = max_pfn; /* RAM is assumed contiguous */ high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); #ifdef CONFIG_NEED_MULTIPLE_NODES @@ -350,13 +348,11 @@ void __init mem_init(void) } } #else - max_mapnr = max_pfn; + max_mapnr = num_physpages; totalram_pages += free_all_bootmem(); #endif for_each_pgdat(pgdat) { for (i = 0; i < pgdat->node_spanned_pages; i++) { - if (!pfn_valid(pgdat->node_start_pfn + i)) - continue; page = pgdat_page_nr(pgdat, i); if (PageReserved(page)) reservedpages++; @@ -495,7 +491,7 @@ EXPORT_SYMBOL(flush_icache_user_range); * We use it to preload an HPTE into the hash table corresponding to * the updated linux PTE. * - * This must always be called with the pte lock held. + * This must always be called with the mm->page_table_lock held */ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) diff --git a/trunk/arch/powerpc/mm/mmu_decl.h b/trunk/arch/powerpc/mm/mmu_decl.h index bea2d21ac6f7..a4d7a327c0e5 100644 --- a/trunk/arch/powerpc/mm/mmu_decl.h +++ b/trunk/arch/powerpc/mm/mmu_decl.h @@ -33,6 +33,7 @@ extern void invalidate_tlbcam_entry(int index); extern int __map_without_bats; extern unsigned long ioremap_base; +extern unsigned long ioremap_bot; extern unsigned int rtas_data, rtas_size; extern PTE *Hash, *Hash_end; @@ -41,7 +42,6 @@ extern unsigned long Hash_size, Hash_mask; extern unsigned int num_tlbcam_entries; #endif -extern unsigned long ioremap_bot; extern unsigned long __max_low_memory; extern unsigned long __initial_memory_limit; extern unsigned long total_memory; @@ -84,16 +84,4 @@ static inline void flush_HPTE(unsigned context, unsigned long va, else _tlbie(va); } -#else /* CONFIG_PPC64 */ -/* imalloc region types */ -#define IM_REGION_UNUSED 0x1 -#define IM_REGION_SUBSET 0x2 -#define IM_REGION_EXISTS 0x4 -#define IM_REGION_OVERLAP 0x8 -#define IM_REGION_SUPERSET 0x10 - -extern struct vm_struct * im_get_free_area(unsigned long size); -extern struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size, - int region_type); -extern void im_free(void *addr); #endif diff --git a/trunk/arch/powerpc/mm/numa.c b/trunk/arch/powerpc/mm/numa.c index ba7a3055a9fc..bd2cf1336885 100644 --- a/trunk/arch/powerpc/mm/numa.c +++ b/trunk/arch/powerpc/mm/numa.c @@ -125,7 +125,7 @@ void __init get_region(unsigned int nid, unsigned long *start_pfn, /* We didnt find a matching region, return start/end as 0 */ if (*start_pfn == -1UL) - *start_pfn = 0; + start_pfn = 0; } static inline void map_cpu_to_node(int cpu, int node) @@ -483,7 +483,6 @@ static void __init setup_nonnuma(void) { unsigned long top_of_ram = lmb_end_of_DRAM(); unsigned long total_ram = lmb_phys_mem_size(); - unsigned int i; printk(KERN_INFO "Top of RAM: 0x%lx, Total RAM: 0x%lx\n", top_of_ram, total_ram); @@ -491,9 +490,7 @@ static void __init setup_nonnuma(void) (top_of_ram - total_ram) >> 20); map_cpu_to_node(boot_cpuid, 0); - for (i = 0; i < lmb.memory.cnt; ++i) - add_region(0, lmb.memory.region[i].base >> PAGE_SHIFT, - lmb_size_pages(&lmb.memory, i)); + add_region(0, 0, lmb_end_of_DRAM() >> PAGE_SHIFT); node_set_online(0); } diff --git a/trunk/arch/powerpc/mm/pgtable_64.c b/trunk/arch/powerpc/mm/pgtable_64.c index 2ffca63602c5..c7f7bb6f30b3 100644 --- a/trunk/arch/powerpc/mm/pgtable_64.c +++ b/trunk/arch/powerpc/mm/pgtable_64.c @@ -64,8 +64,7 @@ #include #include #include - -#include "mmu_decl.h" +#include unsigned long ioremap_bot = IMALLOC_BASE; static unsigned long phbs_io_bot = PHBS_IO_BASE; diff --git a/trunk/arch/powerpc/mm/stab.c b/trunk/arch/powerpc/mm/stab.c index 51e7951414e5..cfbb4e1f966b 100644 --- a/trunk/arch/powerpc/mm/stab.c +++ b/trunk/arch/powerpc/mm/stab.c @@ -288,6 +288,11 @@ void stab_initialize(unsigned long stab) return; } #endif /* CONFIG_PPC_ISERIES */ - +#ifdef CONFIG_PPC_PSERIES + if (platform_is_lpar()) { + plpar_hcall_norets(H_SET_ASR, stabreal); + return; + } +#endif mtspr(SPRN_ASR, stabreal); } diff --git a/trunk/arch/powerpc/mm/tlb_32.c b/trunk/arch/powerpc/mm/tlb_32.c index ad580f3742e5..6c3dc3c44c86 100644 --- a/trunk/arch/powerpc/mm/tlb_32.c +++ b/trunk/arch/powerpc/mm/tlb_32.c @@ -149,12 +149,6 @@ void flush_tlb_mm(struct mm_struct *mm) return; } - /* - * It is safe to go down the mm's list of vmas when called - * from dup_mmap, holding mmap_sem. It would also be safe from - * unmap_region or exit_mmap, but not from vmtruncate on SMP - - * but it seems dup_mmap is the only SMP case which gets here. - */ for (mp = mm->mmap; mp != NULL; mp = mp->vm_next) flush_range(mp->vm_mm, mp->vm_start, mp->vm_end); FINISH_FLUSH; diff --git a/trunk/arch/powerpc/mm/tlb_64.c b/trunk/arch/powerpc/mm/tlb_64.c index 859d29a0cac5..53e31b834ace 100644 --- a/trunk/arch/powerpc/mm/tlb_64.c +++ b/trunk/arch/powerpc/mm/tlb_64.c @@ -95,7 +95,7 @@ static void pte_free_submit(struct pte_freelist_batch *batch) void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf) { - /* This is safe since tlb_gather_mmu has disabled preemption */ + /* This is safe as we are holding page_table_lock */ cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id()); struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur); @@ -206,7 +206,7 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch) void pte_free_finish(void) { - /* This is safe since tlb_gather_mmu has disabled preemption */ + /* This is safe as we are holding page_table_lock */ struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur); if (*batchp == NULL) diff --git a/trunk/arch/powerpc/oprofile/op_model_fsl_booke.c b/trunk/arch/powerpc/oprofile/op_model_fsl_booke.c index 26539cda6023..86124a94c9af 100644 --- a/trunk/arch/powerpc/oprofile/op_model_fsl_booke.c +++ b/trunk/arch/powerpc/oprofile/op_model_fsl_booke.c @@ -7,7 +7,7 @@ * Copyright (c) 2004 Freescale Semiconductor, Inc * * Author: Andy Fleming - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/trunk/arch/powerpc/platforms/chrp/setup.c b/trunk/arch/powerpc/platforms/chrp/setup.c index dda5f2c72c25..4099ddab9205 100644 --- a/trunk/arch/powerpc/platforms/chrp/setup.c +++ b/trunk/arch/powerpc/platforms/chrp/setup.c @@ -257,13 +257,6 @@ void __init chrp_setup_arch(void) if (rtas_token("display-character") >= 0) ppc_md.progress = rtas_progress; - /* use RTAS time-of-day routines if available */ - if (rtas_token("get-time-of-day") != RTAS_UNKNOWN_SERVICE) { - ppc_md.get_boot_time = rtas_get_boot_time; - ppc_md.get_rtc_time = rtas_get_rtc_time; - ppc_md.set_rtc_time = rtas_set_rtc_time; - } - #ifdef CONFIG_BOOTX_TEXT if (ppc_md.progress == NULL && boot_text_mapped) ppc_md.progress = btext_progress; @@ -512,11 +505,9 @@ void __init chrp_init(void) ppc_md.halt = rtas_halt; ppc_md.time_init = chrp_time_init; - ppc_md.calibrate_decr = chrp_calibrate_decr; - - /* this may get overridden with rtas routines later... */ ppc_md.set_rtc_time = chrp_set_rtc_time; ppc_md.get_rtc_time = chrp_get_rtc_time; + ppc_md.calibrate_decr = chrp_calibrate_decr; #ifdef CONFIG_SMP smp_ops = &chrp_smp_ops; diff --git a/trunk/arch/powerpc/platforms/chrp/smp.c b/trunk/arch/powerpc/platforms/chrp/smp.c index b616053bc331..bb2315997d45 100644 --- a/trunk/arch/powerpc/platforms/chrp/smp.c +++ b/trunk/arch/powerpc/platforms/chrp/smp.c @@ -34,7 +34,6 @@ #include #include #include -#include static void __devinit smp_chrp_kick_cpu(int nr) { diff --git a/trunk/arch/powerpc/platforms/chrp/time.c b/trunk/arch/powerpc/platforms/chrp/time.c index 737ee5d9f0aa..9e53535ddb82 100644 --- a/trunk/arch/powerpc/platforms/chrp/time.c +++ b/trunk/arch/powerpc/platforms/chrp/time.c @@ -87,6 +87,7 @@ int chrp_set_rtc_time(struct rtc_time *tmarg) chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT); + tm.tm_year -= 1900; if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { BIN_TO_BCD(tm.tm_sec); BIN_TO_BCD(tm.tm_min); @@ -155,7 +156,7 @@ void chrp_get_rtc_time(struct rtc_time *tm) BCD_TO_BIN(mon); BCD_TO_BIN(year); } - if (year < 70) + if ((year += 1900) < 1970) year += 100; tm->tm_sec = sec; tm->tm_min = min; diff --git a/trunk/arch/powerpc/platforms/iseries/iommu.c b/trunk/arch/powerpc/platforms/iseries/iommu.c index 2b54eeb2c899..bf081b345820 100644 --- a/trunk/arch/powerpc/platforms/iseries/iommu.c +++ b/trunk/arch/powerpc/platforms/iseries/iommu.c @@ -3,7 +3,7 @@ * * Rewrite, cleanup: * - * Copyright (C) 2004 Olof Johansson , IBM Corporation + * Copyright (C) 2004 Olof Johansson , IBM Corporation * * Dynamic DMA mapping support, iSeries-specific parts. * diff --git a/trunk/arch/powerpc/platforms/iseries/irq.c b/trunk/arch/powerpc/platforms/iseries/irq.c index a58daa153686..01090e9ce0cf 100644 --- a/trunk/arch/powerpc/platforms/iseries/irq.c +++ b/trunk/arch/powerpc/platforms/iseries/irq.c @@ -42,6 +42,13 @@ #include "irq.h" #include "call_pci.h" +/* This maps virtual irq numbers to real irqs */ +unsigned int virt_irq_to_real_map[NR_IRQS]; + +/* The next available virtual irq number */ +/* Note: the pcnet32 driver assumes irq numbers < 2 aren't valid. :( */ +static int next_virtual_irq = 2; + static long Pci_Interrupt_Count; static long Pci_Event_Count; @@ -343,14 +350,26 @@ static hw_irq_controller iSeries_IRQ_handler = { int __init iSeries_allocate_IRQ(HvBusNumber busNumber, HvSubBusNumber subBusNumber, HvAgentId deviceId) { - int virtirq; - unsigned int realirq; + unsigned int realirq, virtirq; u8 idsel = (deviceId >> 4); u8 function = deviceId & 7; + virtirq = next_virtual_irq++; realirq = ((busNumber - 1) << 6) + ((idsel - 1) << 3) + function; - virtirq = virt_irq_create_mapping(realirq); + virt_irq_to_real_map[virtirq] = realirq; irq_desc[virtirq].handler = &iSeries_IRQ_handler; return virtirq; } + +int virt_irq_create_mapping(unsigned int real_irq) +{ + BUG(); /* Don't call this on iSeries, yet */ + + return 0; +} + +void virt_irq_init(void) +{ + return; +} diff --git a/trunk/arch/powerpc/platforms/iseries/pci.c b/trunk/arch/powerpc/platforms/iseries/pci.c index dafc518fbb83..4b75131773a6 100644 --- a/trunk/arch/powerpc/platforms/iseries/pci.c +++ b/trunk/arch/powerpc/platforms/iseries/pci.c @@ -244,9 +244,10 @@ unsigned long __init find_and_init_phbs(void) if (ret == 0) { printk("bus %d appears to exist\n", bus); - phb = pcibios_alloc_controller(NULL); + phb = (struct pci_controller *)kmalloc(sizeof(struct pci_controller), GFP_KERNEL); if (phb == NULL) return -ENOMEM; + pci_setup_pci_controller(phb); phb->pci_mem_offset = phb->local_number = bus; phb->first_busno = bus; diff --git a/trunk/arch/powerpc/platforms/iseries/setup.c b/trunk/arch/powerpc/platforms/iseries/setup.c index da26639190db..6a29f301436b 100644 --- a/trunk/arch/powerpc/platforms/iseries/setup.c +++ b/trunk/arch/powerpc/platforms/iseries/setup.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -547,6 +548,8 @@ static unsigned long __init build_iSeries_Memory_Map(void) */ static void __init iSeries_setup_arch(void) { + unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index; + if (get_paca()->lppaca.shared_proc) { ppc_md.idle_loop = iseries_shared_idle; printk(KERN_INFO "Using shared processor idle loop\n"); @@ -562,6 +565,9 @@ static void __init iSeries_setup_arch(void) itVpdAreas.xSlicMaxLogicalProcs); printk("Max physical processors = %d\n", itVpdAreas.xSlicMaxPhysicalProcs); + + _systemcfg->processor = xIoHriProcessorVpd[procIx].xPVR; + printk("Processor version = %x\n", _systemcfg->processor); } static void iSeries_show_cpuinfo(struct seq_file *m) diff --git a/trunk/arch/powerpc/platforms/maple/pci.c b/trunk/arch/powerpc/platforms/maple/pci.c index f40451da037c..895aeb3f75d0 100644 --- a/trunk/arch/powerpc/platforms/maple/pci.c +++ b/trunk/arch/powerpc/platforms/maple/pci.c @@ -326,12 +326,26 @@ static int __init add_bridge(struct device_node *dev) dev->full_name); } - hose = pcibios_alloc_controller(dev); + hose = alloc_bootmem(sizeof(struct pci_controller)); if (hose == NULL) return -ENOMEM; + pci_setup_pci_controller(hose); + + hose->arch_data = dev; hose->first_busno = bus_range ? bus_range[0] : 0; hose->last_busno = bus_range ? bus_range[1] : 0xff; + of_prop = alloc_bootmem(sizeof(struct property) + + sizeof(hose->global_number)); + if (of_prop) { + memset(of_prop, 0, sizeof(struct property)); + of_prop->name = "linux,pci-domain"; + of_prop->length = sizeof(hose->global_number); + of_prop->value = (unsigned char *)&of_prop[1]; + memcpy(of_prop->value, &hose->global_number, sizeof(hose->global_number)); + prom_add_property(dev, of_prop); + } + disp_name = NULL; if (device_is_compatible(dev, "u3-agp")) { setup_u3_agp(hose); diff --git a/trunk/arch/powerpc/platforms/maple/time.c b/trunk/arch/powerpc/platforms/maple/time.c index 15846cc938ac..40fc07a8e606 100644 --- a/trunk/arch/powerpc/platforms/maple/time.c +++ b/trunk/arch/powerpc/platforms/maple/time.c @@ -158,11 +158,6 @@ int maple_set_rtc_time(struct rtc_time *tm) return 0; } -static struct resource rtc_iores = { - .name = "rtc", - .flags = IORESOURCE_BUSY, -}; - unsigned long __init maple_get_boot_time(void) { struct rtc_time tm; @@ -177,11 +172,7 @@ unsigned long __init maple_get_boot_time(void) printk(KERN_INFO "Maple: No device node for RTC, assuming " "legacy address (0x%x)\n", maple_rtc_addr); } - - rtc_iores.start = maple_rtc_addr; - rtc_iores.end = maple_rtc_addr + 7; - request_resource(&ioport_resource, &rtc_iores); - + maple_get_rtc_time(&tm); return mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); diff --git a/trunk/arch/powerpc/platforms/powermac/feature.c b/trunk/arch/powerpc/platforms/powermac/feature.c index f6e22da2a5da..10f1d942c661 100644 --- a/trunk/arch/powerpc/platforms/powermac/feature.c +++ b/trunk/arch/powerpc/platforms/powermac/feature.c @@ -1650,19 +1650,11 @@ void pmac_tweak_clock_spreading(int enable) */ if (macio->type == macio_intrepid) { - struct device_node *clock = - of_find_node_by_path("/uni-n@f8000000/hw-clock"); - if (clock && get_property(clock, "platform-do-clockspreading", - NULL)) { - printk(KERN_INFO "%sabling clock spreading on Intrepid" - " ASIC\n", enable ? "En" : "Dis"); - if (enable) - UN_OUT(UNI_N_CLOCK_SPREADING, 2); - else - UN_OUT(UNI_N_CLOCK_SPREADING, 0); - mdelay(40); - } - of_node_put(clock); + if (enable) + UN_OUT(UNI_N_CLOCK_SPREADING, 2); + else + UN_OUT(UNI_N_CLOCK_SPREADING, 0); + mdelay(40); } while (machine_is_compatible("PowerBook5,2") || @@ -1732,9 +1724,6 @@ void pmac_tweak_clock_spreading(int enable) pmac_low_i2c_close(ui2c); break; } - printk(KERN_INFO "%sabling clock spreading on i2c clock chip\n", - enable ? "En" : "Dis"); - pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub); rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9); DBG("write result: %d,", rc); @@ -2373,14 +2362,6 @@ static struct pmac_mb_def pmac_mb_defs[] = { PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, - { "PowerBook5,8", "PowerBook G4 15\"", - PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, - }, - { "PowerBook5,9", "PowerBook G4 17\"", - PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, - }, { "PowerBook6,1", "PowerBook G4 12\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, diff --git a/trunk/arch/powerpc/platforms/powermac/pci.c b/trunk/arch/powerpc/platforms/powermac/pci.c index 443be526cde7..dfd41b9781a9 100644 --- a/trunk/arch/powerpc/platforms/powermac/pci.c +++ b/trunk/arch/powerpc/platforms/powermac/pci.c @@ -640,16 +640,15 @@ static void __init setup_u3_ht(struct pci_controller* hose) * the reg address cell, we shall fix that by killing struct * reg_property and using some accessor functions instead */ - hose->cfg_data = (volatile unsigned char *)ioremap(0xf2000000, - 0x02000000); + hose->cfg_data = (volatile unsigned char *)ioremap(0xf2000000, 0x02000000); /* - * /ht node doesn't expose a "ranges" property, so we "remove" - * regions that have been allocated to AGP. So far, this version of - * the code doesn't assign any of the 0xfxxxxxxx "fine" memory regions - * to /ht. We need to fix that sooner or later by either parsing all - * child "ranges" properties or figuring out the U3 address space - * decoding logic and then read its configuration register (if any). + * /ht node doesn't expose a "ranges" property, so we "remove" regions that + * have been allocated to AGP. So far, this version of the code doesn't assign + * any of the 0xfxxxxxxx "fine" memory regions to /ht. + * We need to fix that sooner or later by either parsing all child "ranges" + * properties or figuring out the U3 address space decoding logic and + * then read its configuration register (if any). */ hose->io_base_phys = 0xf4000000; hose->pci_io_size = 0x00400000; @@ -672,10 +671,10 @@ static void __init setup_u3_ht(struct pci_controller* hose) return; } - /* We "remove" the AGP resources from the resources allocated to HT, - * that is we create "holes". However, that code does assumptions - * that so far happen to be true (cross fingers...), typically that - * resources in the AGP node are properly ordered + /* We "remove" the AGP resources from the resources allocated to HT, that + * is we create "holes". However, that code does assumptions that so far + * happen to be true (cross fingers...), typically that resources in the + * AGP node are properly ordered */ cur = 0; for (i=0; i<3; i++) { @@ -685,30 +684,23 @@ static void __init setup_u3_ht(struct pci_controller* hose) /* We don't care about "fine" resources */ if (res->start >= 0xf0000000) continue; - /* Check if it's just a matter of "shrinking" us in one - * direction - */ + /* Check if it's just a matter of "shrinking" us in one direction */ if (hose->mem_resources[cur].start == res->start) { DBG("U3/HT: shrink start of %d, %08lx -> %08lx\n", - cur, hose->mem_resources[cur].start, - res->end + 1); + cur, hose->mem_resources[cur].start, res->end + 1); hose->mem_resources[cur].start = res->end + 1; continue; } if (hose->mem_resources[cur].end == res->end) { DBG("U3/HT: shrink end of %d, %08lx -> %08lx\n", - cur, hose->mem_resources[cur].end, - res->start - 1); + cur, hose->mem_resources[cur].end, res->start - 1); hose->mem_resources[cur].end = res->start - 1; continue; } /* No, it's not the case, we need a hole */ if (cur == 2) { - /* not enough resources for a hole, we drop part - * of the range - */ - printk(KERN_WARNING "Running out of resources" - " for /ht host !\n"); + /* not enough resources for a hole, we drop part of the range */ + printk(KERN_WARNING "Running out of resources for /ht host !\n"); hose->mem_resources[cur].end = res->start - 1; continue; } @@ -722,6 +714,17 @@ static void __init setup_u3_ht(struct pci_controller* hose) hose->mem_resources[cur-1].end = res->start - 1; } } + +/* XXX this needs to be converged between ppc32 and ppc64... */ +static struct pci_controller * __init pcibios_alloc_controller(void) +{ + struct pci_controller *hose; + + hose = alloc_bootmem(sizeof(struct pci_controller)); + if (hose) + pci_setup_pci_controller(hose); + return hose; +} #endif /* @@ -753,16 +756,11 @@ static int __init add_bridge(struct device_node *dev) #endif bus_range = (int *) get_property(dev, "bus-range", &len); if (bus_range == NULL || len < 2 * sizeof(int)) { - printk(KERN_WARNING "Can't get bus-range for %s, assume" - " bus 0\n", dev->full_name); + printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n", + dev->full_name); } - /* XXX Different prototypes, to be merged */ -#ifdef CONFIG_PPC64 - hose = pcibios_alloc_controller(dev); -#else hose = pcibios_alloc_controller(); -#endif if (!hose) return -ENOMEM; hose->arch_data = dev; @@ -770,7 +768,7 @@ static int __init add_bridge(struct device_node *dev) hose->last_busno = bus_range ? bus_range[1] : 0xff; disp_name = NULL; -#ifdef CONFIG_PPC64 +#ifdef CONFIG_POWER4 if (device_is_compatible(dev, "u3-agp")) { setup_u3_agp(hose); disp_name = "U3-AGP"; diff --git a/trunk/arch/powerpc/platforms/powermac/smp.c b/trunk/arch/powerpc/platforms/powermac/smp.c index fb2a7c798e82..957b09103422 100644 --- a/trunk/arch/powerpc/platforms/powermac/smp.c +++ b/trunk/arch/powerpc/platforms/powermac/smp.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -632,9 +631,8 @@ void smp_core99_give_timebase(void) mb(); /* wait for the secondary to have taken it */ - /* note: can't use udelay here, since it needs the timebase running */ - for (t = 10000000; t > 0 && sec_tb_reset; --t) - barrier(); + for (t = 100000; t > 0 && sec_tb_reset; --t) + udelay(10); if (sec_tb_reset) /* XXX BUG_ON here? */ printk(KERN_WARNING "Timeout waiting sync(2) on second CPU\n"); diff --git a/trunk/arch/powerpc/platforms/powermac/time.c b/trunk/arch/powerpc/platforms/powermac/time.c index feb0a94e7819..5947b21a8588 100644 --- a/trunk/arch/powerpc/platforms/powermac/time.c +++ b/trunk/arch/powerpc/platforms/powermac/time.c @@ -102,7 +102,7 @@ static unsigned long from_rtc_time(struct rtc_time *tm) static unsigned long cuda_get_time(void) { struct adb_request req; - unsigned int now; + unsigned long now; if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_GET_TIME) < 0) return 0; @@ -113,7 +113,7 @@ static unsigned long cuda_get_time(void) req.reply_len); now = (req.reply[3] << 24) + (req.reply[4] << 16) + (req.reply[5] << 8) + req.reply[6]; - return ((unsigned long)now) - RTC_OFFSET; + return now - RTC_OFFSET; } #define cuda_get_rtc_time(tm) to_rtc_time(cuda_get_time(), (tm)) @@ -146,7 +146,7 @@ static int cuda_set_rtc_time(struct rtc_time *tm) static unsigned long pmu_get_time(void) { struct adb_request req; - unsigned int now; + unsigned long now; if (pmu_request(&req, NULL, 1, PMU_READ_RTC) < 0) return 0; @@ -156,7 +156,7 @@ static unsigned long pmu_get_time(void) req.reply_len); now = (req.reply[0] << 24) + (req.reply[1] << 16) + (req.reply[2] << 8) + req.reply[3]; - return ((unsigned long)now) - RTC_OFFSET; + return now - RTC_OFFSET; } #define pmu_get_rtc_time(tm) to_rtc_time(pmu_get_time(), (tm)) @@ -199,7 +199,6 @@ static unsigned long smu_get_time(void) #define smu_set_rtc_time(tm, spin) 0 #endif -/* Can't be __init, it's called when suspending and resuming */ unsigned long pmac_get_boot_time(void) { /* Get the time from the RTC, used only at boot time */ diff --git a/trunk/arch/powerpc/platforms/pseries/Makefile b/trunk/arch/powerpc/platforms/pseries/Makefile index 06d5ef501218..e7ca5b1f591e 100644 --- a/trunk/arch/powerpc/platforms/pseries/Makefile +++ b/trunk/arch/powerpc/platforms/pseries/Makefile @@ -4,7 +4,4 @@ obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_XICS) += xics.o obj-$(CONFIG_SCANLOG) += scanlog.o -obj-$(CONFIG_EEH) += eeh.o eeh_event.o - -obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o -obj-$(CONFIG_HVCS) += hvcserver.o +obj-$(CONFIG_EEH) += eeh.o eeh_event.o diff --git a/trunk/arch/powerpc/platforms/pseries/eeh.c b/trunk/arch/powerpc/platforms/pseries/eeh.c index c8d2a40dc5b4..79de2310e70b 100644 --- a/trunk/arch/powerpc/platforms/pseries/eeh.c +++ b/trunk/arch/powerpc/platforms/pseries/eeh.c @@ -86,8 +86,7 @@ static int ibm_read_slot_reset_state; static int ibm_read_slot_reset_state2; static int ibm_slot_error_detail; -int eeh_subsystem_enabled; -EXPORT_SYMBOL(eeh_subsystem_enabled); +static int eeh_subsystem_enabled; /* Lock to avoid races due to multiple reports of an error */ static DEFINE_SPINLOCK(confirm_error_lock); diff --git a/trunk/arch/powerpc/platforms/pseries/iommu.c b/trunk/arch/powerpc/platforms/pseries/iommu.c index 2043659ea7b1..97ba5214417f 100644 --- a/trunk/arch/powerpc/platforms/pseries/iommu.c +++ b/trunk/arch/powerpc/platforms/pseries/iommu.c @@ -5,7 +5,7 @@ * * Rewrite, cleanup: * - * Copyright (C) 2004 Olof Johansson , IBM Corporation + * Copyright (C) 2004 Olof Johansson , IBM Corporation * * Dynamic DMA mapping support, pSeries-specific parts, both SMP and LPAR. * @@ -109,9 +109,6 @@ static void tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum, u64 rc; union tce_entry tce; - tcenum <<= TCE_PAGE_FACTOR; - npages <<= TCE_PAGE_FACTOR; - tce.te_word = 0; tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT; tce.te_rdwr = 1; @@ -146,7 +143,10 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, union tce_entry tce, *tcep; long l, limit; - if (TCE_PAGE_FACTOR == 0 && npages == 1) + tcenum <<= TCE_PAGE_FACTOR; + npages <<= TCE_PAGE_FACTOR; + + if (npages == 1) return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr, direction); @@ -164,9 +164,6 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, __get_cpu_var(tce_page) = tcep; } - tcenum <<= TCE_PAGE_FACTOR; - npages <<= TCE_PAGE_FACTOR; - tce.te_word = 0; tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT; tce.te_rdwr = 1; diff --git a/trunk/arch/powerpc/platforms/pseries/lpar.c b/trunk/arch/powerpc/platforms/pseries/lpar.c index cf1bc11b3346..a50e5f3f396d 100644 --- a/trunk/arch/powerpc/platforms/pseries/lpar.c +++ b/trunk/arch/powerpc/platforms/pseries/lpar.c @@ -298,6 +298,18 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group, if (!(vflags & HPTE_V_BOLTED)) DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r); +#if 1 + { + int i; + for (i=0;i<8;i++) { + unsigned long w0, w1; + plpar_pte_read(0, hpte_group, &w0, &w1); + BUG_ON (HPTE_V_COMPARE(hpte_v, w0) + && (w0 & HPTE_V_VALID)); + } + } +#endif + /* Now fill in the actual HPTE */ /* Set CEC cookie to 0 */ /* Zero page = 0 */ diff --git a/trunk/arch/powerpc/platforms/pseries/setup.c b/trunk/arch/powerpc/platforms/pseries/setup.c index 4a465f067ede..31990829310c 100644 --- a/trunk/arch/powerpc/platforms/pseries/setup.c +++ b/trunk/arch/powerpc/platforms/pseries/setup.c @@ -200,12 +200,14 @@ static void __init pSeries_setup_arch(void) if (ppc64_interrupt_controller == IC_OPEN_PIC) { ppc_md.init_IRQ = pSeries_init_mpic; ppc_md.get_irq = mpic_get_irq; + ppc_md.cpu_irq_down = mpic_teardown_this_cpu; /* Allocate the mpic now, so that find_and_init_phbs() can * fill the ISUs */ pSeries_setup_mpic(); } else { ppc_md.init_IRQ = xics_init_IRQ; ppc_md.get_irq = xics_get_irq; + ppc_md.cpu_irq_down = xics_teardown_cpu; } #ifdef CONFIG_SMP @@ -504,7 +506,7 @@ static void pseries_dedicated_idle(void) lpaca->lppaca.idle = 1; if (!need_resched()) { - start_snooze = get_tb() + + start_snooze = __get_tb() + *smt_snooze_delay * tb_ticks_per_usec; while (!need_resched() && !cpu_is_offline(cpu)) { @@ -518,7 +520,7 @@ static void pseries_dedicated_idle(void) HMT_very_low(); if (*smt_snooze_delay != 0 && - get_tb() > start_snooze) { + __get_tb() > start_snooze) { HMT_medium(); dedicated_idle_sleep(cpu); } @@ -593,27 +595,6 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus) return PCI_PROBE_NORMAL; } -#ifdef CONFIG_KEXEC -static void pseries_kexec_cpu_down(int crash_shutdown, int secondary) -{ - /* Don't risk a hypervisor call if we're crashing */ - if (!crash_shutdown) { - unsigned long vpa = __pa(&get_paca()->lppaca); - - if (unregister_vpa(hard_smp_processor_id(), vpa)) { - printk("VPA deregistration of cpu %u (hw_cpu_id %d) " - "failed\n", smp_processor_id(), - hard_smp_processor_id()); - } - } - - if (ppc64_interrupt_controller == IC_OPEN_PIC) - mpic_teardown_this_cpu(secondary); - else - xics_teardown_cpu(secondary); -} -#endif - struct machdep_calls __initdata pSeries_md = { .probe = pSeries_probe, .setup_arch = pSeries_setup_arch, @@ -636,7 +617,4 @@ struct machdep_calls __initdata pSeries_md = { .check_legacy_ioport = pSeries_check_legacy_ioport, .system_reset_exception = pSeries_system_reset_exception, .machine_check_exception = pSeries_machine_check_exception, -#ifdef CONFIG_KEXEC - .kexec_cpu_down = pseries_kexec_cpu_down, -#endif }; diff --git a/trunk/arch/powerpc/platforms/pseries/smp.c b/trunk/arch/powerpc/platforms/pseries/smp.c index 25181c594d73..5800cde7d5ad 100644 --- a/trunk/arch/powerpc/platforms/pseries/smp.c +++ b/trunk/arch/powerpc/platforms/pseries/smp.c @@ -51,7 +51,6 @@ #include "plpar_wrappers.h" #ifdef DEBUG -#include #define DBG(fmt...) udbg_printf(fmt) #else #define DBG(fmt...) diff --git a/trunk/arch/powerpc/platforms/pseries/xics.c b/trunk/arch/powerpc/platforms/pseries/xics.c index 0377decc0719..72ac18067ece 100644 --- a/trunk/arch/powerpc/platforms/pseries/xics.c +++ b/trunk/arch/powerpc/platforms/pseries/xics.c @@ -48,6 +48,11 @@ static struct hw_interrupt_type xics_pic = { .set_affinity = xics_set_affinity }; +static struct hw_interrupt_type xics_8259_pic = { + .typename = " XICS/8259", + .ack = xics_mask_and_ack_irq, +}; + /* This is used to map real irq numbers to virtual */ static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_ATOMIC); @@ -362,7 +367,12 @@ int xics_get_irq(struct pt_regs *regs) /* for sanity, this had better be < NR_IRQS - 16 */ if (vec == xics_irq_8259_cascade_real) { irq = i8259_irq(regs); - xics_end_irq(irq_offset_up(xics_irq_8259_cascade)); + if (irq == -1) { + /* Spurious cascaded interrupt. Still must ack xics */ + xics_end_irq(irq_offset_up(xics_irq_8259_cascade)); + + irq = -1; + } } else if (vec == XICS_IRQ_SPURIOUS) { irq = -1; } else { @@ -532,7 +542,6 @@ void xics_init_IRQ(void) xics_irq_8259_cascade_real = *ireg; xics_irq_8259_cascade = virt_irq_create_mapping(xics_irq_8259_cascade_real); - i8259_init(0, 0); of_node_put(np); } @@ -556,7 +565,12 @@ void xics_init_IRQ(void) #endif /* CONFIG_SMP */ } - for (i = irq_offset_value(); i < NR_IRQS; ++i) + xics_8259_pic.enable = i8259_pic.enable; + xics_8259_pic.disable = i8259_pic.disable; + xics_8259_pic.end = i8259_pic.end; + for (i = 0; i < 16; ++i) + get_irq_desc(i)->handler = &xics_8259_pic; + for (; i < NR_IRQS; ++i) get_irq_desc(i)->handler = &xics_pic; xics_setup_cpu(); @@ -576,6 +590,7 @@ static int __init xics_setup_i8259(void) no_action, 0, "8259 cascade", NULL)) printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 " "cascade\n"); + i8259_init(0, 0); } return 0; } diff --git a/trunk/arch/powerpc/sysdev/dart.h b/trunk/arch/powerpc/sysdev/dart.h index 33ed9ed7fc1e..ea8f0d9eed8a 100644 --- a/trunk/arch/powerpc/sysdev/dart.h +++ b/trunk/arch/powerpc/sysdev/dart.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004 Olof Johansson , IBM Corporation + * Copyright (C) 2004 Olof Johansson , IBM Corporation * * 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 diff --git a/trunk/arch/powerpc/sysdev/mpic.c b/trunk/arch/powerpc/sysdev/mpic.c index 58d1cc2023c8..105f05341a41 100644 --- a/trunk/arch/powerpc/sysdev/mpic.c +++ b/trunk/arch/powerpc/sysdev/mpic.c @@ -361,8 +361,7 @@ static void mpic_enable_irq(unsigned int irq) DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src); mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, - mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & - ~MPIC_VECPRI_MASK); + mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & ~MPIC_VECPRI_MASK); /* make sure mask gets to controller before we return to user */ do { @@ -382,8 +381,7 @@ static void mpic_disable_irq(unsigned int irq) DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src); mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, - mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) | - MPIC_VECPRI_MASK); + mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) | MPIC_VECPRI_MASK); /* make sure mask gets to controller before we return to user */ do { @@ -737,13 +735,12 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri) spin_lock_irqsave(&mpic_lock, flags); if (is_ipi) { - reg = mpic_ipi_read(irq - mpic->ipi_offset) & - ~MPIC_VECPRI_PRIORITY_MASK; + reg = mpic_ipi_read(irq - mpic->ipi_offset) & MPIC_VECPRI_PRIORITY_MASK; mpic_ipi_write(irq - mpic->ipi_offset, reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); } else { - reg = mpic_irq_read(irq - mpic->irq_offset,MPIC_IRQ_VECTOR_PRI) - & ~MPIC_VECPRI_PRIORITY_MASK; + reg = mpic_irq_read(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI) + & MPIC_VECPRI_PRIORITY_MASK; mpic_irq_write(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI, reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); } diff --git a/trunk/arch/powerpc/sysdev/u3_iommu.c b/trunk/arch/powerpc/sysdev/u3_iommu.c index 5c1a26a6d00c..f32baf7f4693 100644 --- a/trunk/arch/powerpc/sysdev/u3_iommu.c +++ b/trunk/arch/powerpc/sysdev/u3_iommu.c @@ -1,11 +1,11 @@ /* * arch/powerpc/sysdev/u3_iommu.c * - * Copyright (C) 2004 Olof Johansson , IBM Corporation + * Copyright (C) 2004 Olof Johansson , IBM Corporation * * Based on pSeries_iommu.c: * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation - * Copyright (C) 2004 Olof Johansson , IBM Corporation + * Copyright (C) 2004 Olof Johansson , IBM Corporation * * Dynamic DMA mapping support, Apple U3 & IBM CPC925 "DART" iommu. * diff --git a/trunk/arch/powerpc/xmon/xmon.c b/trunk/arch/powerpc/xmon/xmon.c index c45a6ad5f3b7..ef4356b29a97 100644 --- a/trunk/arch/powerpc/xmon/xmon.c +++ b/trunk/arch/powerpc/xmon/xmon.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/trunk/arch/ppc/Kconfig b/trunk/arch/ppc/Kconfig index cc3f64c084c5..8fa51b0a32d2 100644 --- a/trunk/arch/ppc/Kconfig +++ b/trunk/arch/ppc/Kconfig @@ -767,14 +767,14 @@ config CPM2 on it (826x, 827x, 8560). config PPC_CHRP - bool + bool " Common Hardware Reference Platform (CHRP) based machines" depends on PPC_MULTIPLATFORM select PPC_I8259 select PPC_INDIRECT_PCI default y config PPC_PMAC - bool + bool " Apple PowerMac based machines" depends on PPC_MULTIPLATFORM select PPC_INDIRECT_PCI default y @@ -785,7 +785,7 @@ config PPC_PMAC64 default y config PPC_PREP - bool + bool " PowerPC Reference Platform (PReP) based machines" depends on PPC_MULTIPLATFORM select PPC_I8259 select PPC_INDIRECT_PCI diff --git a/trunk/arch/ppc/boot/simple/Makefile b/trunk/arch/ppc/boot/simple/Makefile index f3e9c534aa82..82df88b01bbe 100644 --- a/trunk/arch/ppc/boot/simple/Makefile +++ b/trunk/arch/ppc/boot/simple/Makefile @@ -262,11 +262,11 @@ $(images)/zImage.initrd-STRIPELF: $(obj)/zvmlinux.initrd skip=64 bs=1k $(images)/zImage-TREE: $(obj)/zvmlinux $(MKTREE) - $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(end-y) $(entrypoint-y) + $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(end-y) $(ENTRYPOINT) $(images)/zImage.initrd-TREE: $(obj)/zvmlinux.initrd $(MKTREE) $(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(end-y) \ - $(entrypoint-y) + $(ENTRYPOINT) $(images)/zImage-PPLUS: $(obj)/zvmlinux $(MKPREP) $(MKBUGBOOT) $(MKPREP) -pbp $(obj)/zvmlinux $(images)/zImage.$(end-y) diff --git a/trunk/arch/ppc/kernel/Makefile b/trunk/arch/ppc/kernel/Makefile index 0bb23fce4293..17a4da65e275 100644 --- a/trunk/arch/ppc/kernel/Makefile +++ b/trunk/arch/ppc/kernel/Makefile @@ -13,7 +13,7 @@ extra-$(CONFIG_POWER4) += idle_power4.o extra-y += vmlinux.lds obj-y := entry.o traps.o idle.o time.o misc.o \ - process.o \ + process.o align.o \ setup.o \ ppc_htab.o obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o @@ -38,7 +38,7 @@ endif # These are here while we do the architecture merge else -obj-y := idle.o +obj-y := idle.o align.o obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o obj-$(CONFIG_MODULES) += module.o diff --git a/trunk/arch/ppc/kernel/align.c b/trunk/arch/ppc/kernel/align.c new file mode 100644 index 000000000000..ab398c4b70b6 --- /dev/null +++ b/trunk/arch/ppc/kernel/align.c @@ -0,0 +1,410 @@ +/* + * align.c - handle alignment exceptions for the Power PC. + * + * Copyright (c) 1996 Paul Mackerras + * Copyright (c) 1998-1999 TiVo, Inc. + * PowerPC 403GCX modifications. + * Copyright (c) 1999 Grant Erickson + * PowerPC 403GCX/405GP modifications. + */ +#include +#include +#include +#include +#include +#include +#include +#include + +struct aligninfo { + unsigned char len; + unsigned char flags; +}; + +#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) || defined(CONFIG_BOOKE) +#define OPCD(inst) (((inst) & 0xFC000000) >> 26) +#define RS(inst) (((inst) & 0x03E00000) >> 21) +#define RA(inst) (((inst) & 0x001F0000) >> 16) +#define IS_XFORM(code) ((code) == 31) +#endif + +#define INVALID { 0, 0 } + +#define LD 1 /* load */ +#define ST 2 /* store */ +#define SE 4 /* sign-extend value */ +#define F 8 /* to/from fp regs */ +#define U 0x10 /* update index register */ +#define M 0x20 /* multiple load/store */ +#define S 0x40 /* single-precision fp, or byte-swap value */ +#define SX 0x40 /* byte count in XER */ +#define HARD 0x80 /* string, stwcx. */ + +#define DCBZ 0x5f /* 8xx/82xx dcbz faults when cache not enabled */ + +/* + * The PowerPC stores certain bits of the instruction that caused the + * alignment exception in the DSISR register. This array maps those + * bits to information about the operand length and what the + * instruction would do. + */ +static struct aligninfo aligninfo[128] = { + { 4, LD }, /* 00 0 0000: lwz / lwarx */ + INVALID, /* 00 0 0001 */ + { 4, ST }, /* 00 0 0010: stw */ + INVALID, /* 00 0 0011 */ + { 2, LD }, /* 00 0 0100: lhz */ + { 2, LD+SE }, /* 00 0 0101: lha */ + { 2, ST }, /* 00 0 0110: sth */ + { 4, LD+M }, /* 00 0 0111: lmw */ + { 4, LD+F+S }, /* 00 0 1000: lfs */ + { 8, LD+F }, /* 00 0 1001: lfd */ + { 4, ST+F+S }, /* 00 0 1010: stfs */ + { 8, ST+F }, /* 00 0 1011: stfd */ + INVALID, /* 00 0 1100 */ + INVALID, /* 00 0 1101: ld/ldu/lwa */ + INVALID, /* 00 0 1110 */ + INVALID, /* 00 0 1111: std/stdu */ + { 4, LD+U }, /* 00 1 0000: lwzu */ + INVALID, /* 00 1 0001 */ + { 4, ST+U }, /* 00 1 0010: stwu */ + INVALID, /* 00 1 0011 */ + { 2, LD+U }, /* 00 1 0100: lhzu */ + { 2, LD+SE+U }, /* 00 1 0101: lhau */ + { 2, ST+U }, /* 00 1 0110: sthu */ + { 4, ST+M }, /* 00 1 0111: stmw */ + { 4, LD+F+S+U }, /* 00 1 1000: lfsu */ + { 8, LD+F+U }, /* 00 1 1001: lfdu */ + { 4, ST+F+S+U }, /* 00 1 1010: stfsu */ + { 8, ST+F+U }, /* 00 1 1011: stfdu */ + INVALID, /* 00 1 1100 */ + INVALID, /* 00 1 1101 */ + INVALID, /* 00 1 1110 */ + INVALID, /* 00 1 1111 */ + INVALID, /* 01 0 0000: ldx */ + INVALID, /* 01 0 0001 */ + INVALID, /* 01 0 0010: stdx */ + INVALID, /* 01 0 0011 */ + INVALID, /* 01 0 0100 */ + INVALID, /* 01 0 0101: lwax */ + INVALID, /* 01 0 0110 */ + INVALID, /* 01 0 0111 */ + { 4, LD+M+HARD+SX }, /* 01 0 1000: lswx */ + { 4, LD+M+HARD }, /* 01 0 1001: lswi */ + { 4, ST+M+HARD+SX }, /* 01 0 1010: stswx */ + { 4, ST+M+HARD }, /* 01 0 1011: stswi */ + INVALID, /* 01 0 1100 */ + INVALID, /* 01 0 1101 */ + INVALID, /* 01 0 1110 */ + INVALID, /* 01 0 1111 */ + INVALID, /* 01 1 0000: ldux */ + INVALID, /* 01 1 0001 */ + INVALID, /* 01 1 0010: stdux */ + INVALID, /* 01 1 0011 */ + INVALID, /* 01 1 0100 */ + INVALID, /* 01 1 0101: lwaux */ + INVALID, /* 01 1 0110 */ + INVALID, /* 01 1 0111 */ + INVALID, /* 01 1 1000 */ + INVALID, /* 01 1 1001 */ + INVALID, /* 01 1 1010 */ + INVALID, /* 01 1 1011 */ + INVALID, /* 01 1 1100 */ + INVALID, /* 01 1 1101 */ + INVALID, /* 01 1 1110 */ + INVALID, /* 01 1 1111 */ + INVALID, /* 10 0 0000 */ + INVALID, /* 10 0 0001 */ + { 0, ST+HARD }, /* 10 0 0010: stwcx. */ + INVALID, /* 10 0 0011 */ + INVALID, /* 10 0 0100 */ + INVALID, /* 10 0 0101 */ + INVALID, /* 10 0 0110 */ + INVALID, /* 10 0 0111 */ + { 4, LD+S }, /* 10 0 1000: lwbrx */ + INVALID, /* 10 0 1001 */ + { 4, ST+S }, /* 10 0 1010: stwbrx */ + INVALID, /* 10 0 1011 */ + { 2, LD+S }, /* 10 0 1100: lhbrx */ + INVALID, /* 10 0 1101 */ + { 2, ST+S }, /* 10 0 1110: sthbrx */ + INVALID, /* 10 0 1111 */ + INVALID, /* 10 1 0000 */ + INVALID, /* 10 1 0001 */ + INVALID, /* 10 1 0010 */ + INVALID, /* 10 1 0011 */ + INVALID, /* 10 1 0100 */ + INVALID, /* 10 1 0101 */ + INVALID, /* 10 1 0110 */ + INVALID, /* 10 1 0111 */ + INVALID, /* 10 1 1000 */ + INVALID, /* 10 1 1001 */ + INVALID, /* 10 1 1010 */ + INVALID, /* 10 1 1011 */ + INVALID, /* 10 1 1100 */ + INVALID, /* 10 1 1101 */ + INVALID, /* 10 1 1110 */ + { 0, ST+HARD }, /* 10 1 1111: dcbz */ + { 4, LD }, /* 11 0 0000: lwzx */ + INVALID, /* 11 0 0001 */ + { 4, ST }, /* 11 0 0010: stwx */ + INVALID, /* 11 0 0011 */ + { 2, LD }, /* 11 0 0100: lhzx */ + { 2, LD+SE }, /* 11 0 0101: lhax */ + { 2, ST }, /* 11 0 0110: sthx */ + INVALID, /* 11 0 0111 */ + { 4, LD+F+S }, /* 11 0 1000: lfsx */ + { 8, LD+F }, /* 11 0 1001: lfdx */ + { 4, ST+F+S }, /* 11 0 1010: stfsx */ + { 8, ST+F }, /* 11 0 1011: stfdx */ + INVALID, /* 11 0 1100 */ + INVALID, /* 11 0 1101: lmd */ + INVALID, /* 11 0 1110 */ + INVALID, /* 11 0 1111: stmd */ + { 4, LD+U }, /* 11 1 0000: lwzux */ + INVALID, /* 11 1 0001 */ + { 4, ST+U }, /* 11 1 0010: stwux */ + INVALID, /* 11 1 0011 */ + { 2, LD+U }, /* 11 1 0100: lhzux */ + { 2, LD+SE+U }, /* 11 1 0101: lhaux */ + { 2, ST+U }, /* 11 1 0110: sthux */ + INVALID, /* 11 1 0111 */ + { 4, LD+F+S+U }, /* 11 1 1000: lfsux */ + { 8, LD+F+U }, /* 11 1 1001: lfdux */ + { 4, ST+F+S+U }, /* 11 1 1010: stfsux */ + { 8, ST+F+U }, /* 11 1 1011: stfdux */ + INVALID, /* 11 1 1100 */ + INVALID, /* 11 1 1101 */ + INVALID, /* 11 1 1110 */ + INVALID, /* 11 1 1111 */ +}; + +#define SWAP(a, b) (t = (a), (a) = (b), (b) = t) + +int +fix_alignment(struct pt_regs *regs) +{ + int instr, nb, flags; +#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) || defined(CONFIG_BOOKE) + int opcode, f1, f2, f3; +#endif + int i, t; + int reg, areg; + int offset, nb0; + unsigned char __user *addr; + unsigned char *rptr; + union { + long l; + float f; + double d; + unsigned char v[8]; + } data; + + CHECK_FULL_REGS(regs); + +#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) || defined(CONFIG_BOOKE) + /* The 4xx-family & Book-E processors have no DSISR register, + * so we emulate it. + * The POWER4 has a DSISR register but doesn't set it on + * an alignment fault. -- paulus + */ + + if (__get_user(instr, (unsigned int __user *) regs->nip)) + return 0; + opcode = OPCD(instr); + reg = RS(instr); + areg = RA(instr); + + if (!IS_XFORM(opcode)) { + f1 = 0; + f2 = (instr & 0x04000000) >> 26; + f3 = (instr & 0x78000000) >> 27; + } else { + f1 = (instr & 0x00000006) >> 1; + f2 = (instr & 0x00000040) >> 6; + f3 = (instr & 0x00000780) >> 7; + } + + instr = ((f1 << 5) | (f2 << 4) | f3); +#else + reg = (regs->dsisr >> 5) & 0x1f; /* source/dest register */ + areg = regs->dsisr & 0x1f; /* register to update */ + instr = (regs->dsisr >> 10) & 0x7f; +#endif + + nb = aligninfo[instr].len; + if (nb == 0) { + long __user *p; + int i; + + if (instr != DCBZ) + return 0; /* too hard or invalid instruction */ + /* + * The dcbz (data cache block zero) instruction + * gives an alignment fault if used on non-cacheable + * memory. We handle the fault mainly for the + * case when we are running with the cache disabled + * for debugging. + */ + p = (long __user *) (regs->dar & -L1_CACHE_BYTES); + if (user_mode(regs) + && !access_ok(VERIFY_WRITE, p, L1_CACHE_BYTES)) + return -EFAULT; + for (i = 0; i < L1_CACHE_BYTES / sizeof(long); ++i) + if (__put_user(0, p+i)) + return -EFAULT; + return 1; + } + + flags = aligninfo[instr].flags; + if ((flags & (LD|ST)) == 0) + return 0; + + /* For the 4xx-family & Book-E processors, the 'dar' field of the + * pt_regs structure is overloaded and is really from the DEAR. + */ + + addr = (unsigned char __user *)regs->dar; + + if (flags & M) { + /* lmw, stmw, lswi/x, stswi/x */ + nb0 = 0; + if (flags & HARD) { + if (flags & SX) { + nb = regs->xer & 127; + if (nb == 0) + return 1; + } else { + if (__get_user(instr, + (unsigned int __user *)regs->nip)) + return 0; + nb = (instr >> 11) & 0x1f; + if (nb == 0) + nb = 32; + } + if (nb + reg * 4 > 128) { + nb0 = nb + reg * 4 - 128; + nb = 128 - reg * 4; + } + } else { + /* lwm, stmw */ + nb = (32 - reg) * 4; + } + + if (!access_ok((flags & ST? VERIFY_WRITE: VERIFY_READ), addr, nb+nb0)) + return -EFAULT; /* bad address */ + + rptr = (unsigned char *) ®s->gpr[reg]; + if (flags & LD) { + for (i = 0; i < nb; ++i) + if (__get_user(rptr[i], addr+i)) + return -EFAULT; + if (nb0 > 0) { + rptr = (unsigned char *) ®s->gpr[0]; + addr += nb; + for (i = 0; i < nb0; ++i) + if (__get_user(rptr[i], addr+i)) + return -EFAULT; + } + for (; (i & 3) != 0; ++i) + rptr[i] = 0; + } else { + for (i = 0; i < nb; ++i) + if (__put_user(rptr[i], addr+i)) + return -EFAULT; + if (nb0 > 0) { + rptr = (unsigned char *) ®s->gpr[0]; + addr += nb; + for (i = 0; i < nb0; ++i) + if (__put_user(rptr[i], addr+i)) + return -EFAULT; + } + } + return 1; + } + + offset = 0; + if (nb < 4) { + /* read/write the least significant bits */ + data.l = 0; + offset = 4 - nb; + } + + /* Verify the address of the operand */ + if (user_mode(regs)) { + if (!access_ok((flags & ST? VERIFY_WRITE: VERIFY_READ), addr, nb)) + return -EFAULT; /* bad address */ + } + + if (flags & F) { + preempt_disable(); + if (regs->msr & MSR_FP) + giveup_fpu(current); + preempt_enable(); + } + + /* If we read the operand, copy it in, else get register values */ + if (flags & LD) { + for (i = 0; i < nb; ++i) + if (__get_user(data.v[offset+i], addr+i)) + return -EFAULT; + } else if (flags & F) { + data.d = current->thread.fpr[reg]; + } else { + data.l = regs->gpr[reg]; + } + + switch (flags & ~U) { + case LD+SE: /* sign extend */ + if (data.v[2] >= 0x80) + data.v[0] = data.v[1] = -1; + break; + + case LD+S: /* byte-swap */ + case ST+S: + if (nb == 2) { + SWAP(data.v[2], data.v[3]); + } else { + SWAP(data.v[0], data.v[3]); + SWAP(data.v[1], data.v[2]); + } + break; + + /* Single-precision FP load and store require conversions... */ + case LD+F+S: +#ifdef CONFIG_PPC_FPU + preempt_disable(); + enable_kernel_fp(); + cvt_fd(&data.f, &data.d, ¤t->thread); + preempt_enable(); +#else + return 0; +#endif + break; + case ST+F+S: +#ifdef CONFIG_PPC_FPU + preempt_disable(); + enable_kernel_fp(); + cvt_df(&data.d, &data.f, ¤t->thread); + preempt_enable(); +#else + return 0; +#endif + break; + } + + if (flags & ST) { + for (i = 0; i < nb; ++i) + if (__put_user(data.v[offset+i], addr+i)) + return -EFAULT; + } else if (flags & F) { + current->thread.fpr[reg] = data.d; + } else { + regs->gpr[reg] = data.l; + } + + if (flags & U) + regs->gpr[areg] = regs->dar; + + return 1; +} diff --git a/trunk/arch/ppc/kernel/head_fsl_booke.S b/trunk/arch/ppc/kernel/head_fsl_booke.S index 8d60fa99fc4b..5063c603fad4 100644 --- a/trunk/arch/ppc/kernel/head_fsl_booke.S +++ b/trunk/arch/ppc/kernel/head_fsl_booke.S @@ -24,7 +24,7 @@ * Copyright 2002-2004 MontaVista Software, Inc. * PowerPC 44x support, Matt Porter * Copyright 2004 Freescale Semiconductor, Inc - * PowerPC e500 modifications, Kumar Gala + * PowerPC e500 modifications, Kumar Gala * * 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 diff --git a/trunk/arch/ppc/kernel/pci.c b/trunk/arch/ppc/kernel/pci.c index f7fae5f153b2..48ed58f995c0 100644 --- a/trunk/arch/ppc/kernel/pci.c +++ b/trunk/arch/ppc/kernel/pci.c @@ -45,6 +45,7 @@ static void update_bridge_base(struct pci_bus *bus, int i); static void pcibios_fixup_resources(struct pci_dev* dev); static void fixup_broken_pcnet32(struct pci_dev* dev); static int reparent_resources(struct resource *parent, struct resource *res); +static void fixup_rev1_53c810(struct pci_dev* dev); static void fixup_cpc710_pci64(struct pci_dev* dev); #ifdef CONFIG_PPC_OF static u8* pci_to_OF_bus_map; diff --git a/trunk/arch/ppc/kernel/ppc_ksyms.c b/trunk/arch/ppc/kernel/ppc_ksyms.c index bb6a5c6a64be..66073f775193 100644 --- a/trunk/arch/ppc/kernel/ppc_ksyms.c +++ b/trunk/arch/ppc/kernel/ppc_ksyms.c @@ -184,7 +184,7 @@ EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(flush_instruction_cache); EXPORT_SYMBOL(giveup_fpu); -EXPORT_SYMBOL(__flush_icache_range); +EXPORT_SYMBOL(flush_icache_range); EXPORT_SYMBOL(flush_dcache_range); EXPORT_SYMBOL(flush_icache_user_range); EXPORT_SYMBOL(flush_dcache_page); diff --git a/trunk/arch/ppc/kernel/process.c b/trunk/arch/ppc/kernel/process.c index 25cbdc8d2941..cb1c7b92f8c6 100644 --- a/trunk/arch/ppc/kernel/process.c +++ b/trunk/arch/ppc/kernel/process.c @@ -417,7 +417,6 @@ void show_regs(struct pt_regs * regs) void exit_thread(void) { - preempt_disable(); if (last_task_used_math == current) last_task_used_math = NULL; if (last_task_used_altivec == current) @@ -426,12 +425,10 @@ void exit_thread(void) if (last_task_used_spe == current) last_task_used_spe = NULL; #endif - preempt_enable(); } void flush_thread(void) { - preempt_disable(); if (last_task_used_math == current) last_task_used_math = NULL; if (last_task_used_altivec == current) @@ -440,7 +437,6 @@ void flush_thread(void) if (last_task_used_spe == current) last_task_used_spe = NULL; #endif - preempt_enable(); } void @@ -539,7 +535,6 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp) regs->nip = nip; regs->gpr[1] = sp; regs->msr = MSR_USER; - preempt_disable(); if (last_task_used_math == current) last_task_used_math = NULL; if (last_task_used_altivec == current) @@ -548,7 +543,6 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp) if (last_task_used_spe == current) last_task_used_spe = NULL; #endif - preempt_enable(); memset(current->thread.fpr, 0, sizeof(current->thread.fpr)); current->thread.fpscr.val = 0; #ifdef CONFIG_ALTIVEC diff --git a/trunk/arch/ppc/kernel/setup.c b/trunk/arch/ppc/kernel/setup.c index 0eb0b7085e6a..dc55e1abc45b 100644 --- a/trunk/arch/ppc/kernel/setup.c +++ b/trunk/arch/ppc/kernel/setup.c @@ -602,19 +602,7 @@ void parse_bootinfo(struct bi_record *rec) #endif /* CONFIG_BLK_DEV_INITRD */ #ifdef CONFIG_PPC_MULTIPLATFORM case BI_MACHTYPE: - /* Machine types changed with the merge. Since the - * bootinfo are now deprecated, we can just hard code - * the appropriate conversion here for when we are - * called with yaboot which passes us a machine type - * this way. - */ - switch(data[0]) { - case 1: _machine = _MACH_prep; break; - case 2: _machine = _MACH_Pmac; break; - case 4: _machine = _MACH_chrp; break; - default: - _machine = data[0]; - } + _machine = data[0]; break; #endif case BI_MEMSIZE: diff --git a/trunk/arch/ppc/kernel/smp.c b/trunk/arch/ppc/kernel/smp.c index becbfa397556..43b8fc2ca591 100644 --- a/trunk/arch/ppc/kernel/smp.c +++ b/trunk/arch/ppc/kernel/smp.c @@ -301,10 +301,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus) /* Probe platform for CPUs: always linear. */ num_cpus = smp_ops->probe(); - - if (num_cpus < 2) - smp_tb_synchronized = 1; - for (i = 0; i < num_cpus; ++i) cpu_set(i, cpu_possible_map); diff --git a/trunk/arch/ppc/mm/fsl_booke_mmu.c b/trunk/arch/ppc/mm/fsl_booke_mmu.c index 5d581bb3aa12..af9ca0eb6d55 100644 --- a/trunk/arch/ppc/mm/fsl_booke_mmu.c +++ b/trunk/arch/ppc/mm/fsl_booke_mmu.c @@ -1,5 +1,5 @@ /* - * Modifications by Kumar Gala (galak@kernel.crashing.org) to support + * Modifications by Kumar Gala (kumar.gala@freescale.com) to support * E500 Book E processors. * * Copyright 2004 Freescale Semiconductor, Inc diff --git a/trunk/arch/ppc/mm/init.c b/trunk/arch/ppc/mm/init.c index 45f0782059f1..99b48abd3296 100644 --- a/trunk/arch/ppc/mm/init.c +++ b/trunk/arch/ppc/mm/init.c @@ -597,20 +597,21 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, if (pfn_valid(pfn)) { struct page *page = pfn_to_page(pfn); -#ifdef CONFIG_8xx - /* On 8xx, the TLB handlers work in 2 stages: - * First, a zeroed entry is loaded by TLBMiss handler, - * which causes the TLBError handler to be triggered. - * That means the zeroed TLB has to be invalidated - * whenever a page miss occurs. - */ - _tlbie(address); -#endif if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags)) { - if (vma->vm_mm == current->active_mm) + if (vma->vm_mm == current->active_mm) { +#ifdef CONFIG_8xx + /* On 8xx, cache control instructions (particularly + * "dcbst" from flush_dcache_icache) fault as write + * operation if there is an unpopulated TLB entry + * for the address in question. To workaround that, + * we invalidate the TLB here, thus avoiding dcbst + * misbehaviour. + */ + _tlbie(address); +#endif __flush_dcache_icache((void *) address); - else + } else flush_dcache_icache_page(page); set_bit(PG_arch_1, &page->flags); } diff --git a/trunk/arch/ppc/platforms/83xx/mpc834x_sys.c b/trunk/arch/ppc/platforms/83xx/mpc834x_sys.c index 04bdc39bf47b..98edc75f4105 100644 --- a/trunk/arch/ppc/platforms/83xx/mpc834x_sys.c +++ b/trunk/arch/ppc/platforms/83xx/mpc834x_sys.c @@ -3,7 +3,7 @@ * * MPC834x SYS board specific routines * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor Inc. * @@ -73,19 +73,12 @@ mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) * A B C D */ { - {PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x11 */ - {PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x12 */ - {PIRQD, PIRQA, PIRQB, PIRQC}, /* idsel 0x13 */ - {0, 0, 0, 0}, - {PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x15 */ - {PIRQD, PIRQA, PIRQB, PIRQC}, /* idsel 0x16 */ - {PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x17 */ - {PIRQB, PIRQC, PIRQD, PIRQA}, /* idsel 0x18 */ - {0, 0, 0, 0}, /* idsel 0x19 */ - {0, 0, 0, 0}, /* idsel 0x20 */ + {PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x11 */ + {PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x12 */ + {PIRQD, PIRQA, PIRQB, PIRQC} /* idsel 0x13 */ }; - const long min_idsel = 0x11, max_idsel = 0x20, irqs_per_slot = 4; + const long min_idsel = 0x11, max_idsel = 0x13, irqs_per_slot = 4; return PCI_IRQ_TABLE_LOOKUP; } diff --git a/trunk/arch/ppc/platforms/83xx/mpc834x_sys.h b/trunk/arch/ppc/platforms/83xx/mpc834x_sys.h index 2e514d316fb8..58e44c042535 100644 --- a/trunk/arch/ppc/platforms/83xx/mpc834x_sys.h +++ b/trunk/arch/ppc/platforms/83xx/mpc834x_sys.h @@ -3,7 +3,7 @@ * * MPC834X SYS common board definitions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor, Inc. * diff --git a/trunk/arch/ppc/platforms/85xx/mpc8540_ads.c b/trunk/arch/ppc/platforms/85xx/mpc8540_ads.c index c5cde97c6ef0..7e952c1228cb 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc8540_ads.c +++ b/trunk/arch/ppc/platforms/85xx/mpc8540_ads.c @@ -3,7 +3,7 @@ * * MPC8540ADS board specific routines * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/platforms/85xx/mpc8540_ads.h b/trunk/arch/ppc/platforms/85xx/mpc8540_ads.h index e48ca3a97397..3d05d7c4a938 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc8540_ads.h +++ b/trunk/arch/ppc/platforms/85xx/mpc8540_ads.h @@ -3,7 +3,7 @@ * * MPC8540ADS board definitions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/platforms/85xx/mpc8555_cds.h b/trunk/arch/ppc/platforms/85xx/mpc8555_cds.h index 1a8e6c67355d..e0e75568bc57 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc8555_cds.h +++ b/trunk/arch/ppc/platforms/85xx/mpc8555_cds.h @@ -3,7 +3,7 @@ * * MPC8555CDS board definitions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/platforms/85xx/mpc8560_ads.c b/trunk/arch/ppc/platforms/85xx/mpc8560_ads.c index 8e39a5517092..208433f1e93a 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc8560_ads.c +++ b/trunk/arch/ppc/platforms/85xx/mpc8560_ads.c @@ -3,7 +3,7 @@ * * MPC8560ADS board specific routines * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/platforms/85xx/mpc8560_ads.h b/trunk/arch/ppc/platforms/85xx/mpc8560_ads.h index 143ae7eefa7c..7df885d73e9d 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc8560_ads.h +++ b/trunk/arch/ppc/platforms/85xx/mpc8560_ads.h @@ -3,7 +3,7 @@ * * MPC8540ADS board definitions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.c b/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.c index 17ce48fe3503..16ad092d8a06 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.c +++ b/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.c @@ -3,7 +3,7 @@ * * MPC85xx ADS board common routines * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.h b/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.h index 198a6a02cde8..84acf6e8d45e 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.h +++ b/trunk/arch/ppc/platforms/85xx/mpc85xx_ads_common.h @@ -3,7 +3,7 @@ * * MPC85XX ADS common board definitions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * @@ -25,8 +25,6 @@ #define BCSR_ADDR ((uint)0xf8000000) #define BCSR_SIZE ((uint)(32 * 1024)) -struct seq_file; - extern int mpc85xx_ads_show_cpuinfo(struct seq_file *m); extern void mpc85xx_ads_init_IRQ(void) __init; extern void mpc85xx_ads_map_io(void) __init; diff --git a/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.c index 5e8cc5ec6ab5..a21156967a5e 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.c +++ b/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.c @@ -3,7 +3,7 @@ * * MPC85xx CDS board specific routines * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor, Inc * @@ -130,11 +130,10 @@ mpc85xx_cds_show_cpuinfo(struct seq_file *m) } #ifdef CONFIG_CPM2 -static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) +static void cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) { while((irq = cpm2_get_irq(regs)) >= 0) __do_IRQ(irq, regs); - return IRQ_HANDLED; } static struct irqaction cpm2_irqaction = { diff --git a/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.h b/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.h index 5b588cfd0e41..12b292c6ae32 100644 --- a/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.h +++ b/trunk/arch/ppc/platforms/85xx/mpc85xx_cds_common.h @@ -3,7 +3,7 @@ * * MPC85xx CDS board definitions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor, Inc * diff --git a/trunk/arch/ppc/platforms/85xx/sbc8560.c b/trunk/arch/ppc/platforms/85xx/sbc8560.c index 45a5b81b4ed1..b4ee1707a836 100644 --- a/trunk/arch/ppc/platforms/85xx/sbc8560.c +++ b/trunk/arch/ppc/platforms/85xx/sbc8560.c @@ -3,7 +3,7 @@ * * Wind River SBC8560 board specific routines * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/platforms/85xx/stx_gp3.h b/trunk/arch/ppc/platforms/85xx/stx_gp3.h index 2f25b5195152..7bcc6c35a417 100644 --- a/trunk/arch/ppc/platforms/85xx/stx_gp3.h +++ b/trunk/arch/ppc/platforms/85xx/stx_gp3.h @@ -21,6 +21,7 @@ #include #include +#include #include #define BOARD_CCSRBAR ((uint)0xe0000000) @@ -42,6 +43,7 @@ extern void mpc85xx_setup_hose(void) __init; extern void mpc85xx_restart(char *cmd); extern void mpc85xx_power_off(void); extern void mpc85xx_halt(void); +extern int mpc85xx_show_cpuinfo(struct seq_file *m); extern void mpc85xx_init_IRQ(void) __init; extern unsigned long mpc85xx_find_end_of_memory(void) __init; extern void mpc85xx_calibrate_decr(void) __init; diff --git a/trunk/arch/ppc/platforms/pmac_feature.c b/trunk/arch/ppc/platforms/pmac_feature.c index 6b7b3a150631..58884a63ebdb 100644 --- a/trunk/arch/ppc/platforms/pmac_feature.c +++ b/trunk/arch/ppc/platforms/pmac_feature.c @@ -1606,19 +1606,11 @@ void pmac_tweak_clock_spreading(int enable) */ if (macio->type == macio_intrepid) { - struct device_node *clock = - of_find_node_by_path("/uni-n@f8000000/hw-clock"); - if (clock && get_property(clock, "platform-do-clockspreading", - NULL)) { - printk(KERN_INFO "%sabling clock spreading on Intrepid" - " ASIC\n", enable ? "En" : "Dis"); - if (enable) - UN_OUT(UNI_N_CLOCK_SPREADING, 2); - else - UN_OUT(UNI_N_CLOCK_SPREADING, 0); - mdelay(40); - } - of_node_put(clock); + if (enable) + UN_OUT(UNI_N_CLOCK_SPREADING, 2); + else + UN_OUT(UNI_N_CLOCK_SPREADING, 0); + mdelay(40); } while (machine_is_compatible("PowerBook5,2") || @@ -1688,8 +1680,6 @@ void pmac_tweak_clock_spreading(int enable) pmac_low_i2c_close(ui2c); break; } - printk(KERN_INFO "%sabling clock spreading on i2c clock chip\n", - enable ? "En" : "Dis"); pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub); rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9); DBG("write result: %d,", rc); @@ -2327,14 +2317,6 @@ static struct pmac_mb_def pmac_mb_defs[] = { PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, - { "PowerBook5,8", "PowerBook G4 15\"", - PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, - }, - { "PowerBook5,9", "PowerBook G4 17\"", - PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, - PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, - }, { "PowerBook6,1", "PowerBook G4 12\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, diff --git a/trunk/arch/ppc/platforms/pq2ads.c b/trunk/arch/ppc/platforms/pq2ads.c index 71c9fca1fe9b..6a1475c1e128 100644 --- a/trunk/arch/ppc/platforms/pq2ads.c +++ b/trunk/arch/ppc/platforms/pq2ads.c @@ -3,7 +3,7 @@ * * PQ2ADS platform support * - * Author: Kumar Gala + * Author: Kumar Gala * Derived from: est8260_setup.c by Allen Curtis * * Copyright 2004 Freescale Semiconductor, Inc. diff --git a/trunk/arch/ppc/syslib/ipic.h b/trunk/arch/ppc/syslib/ipic.h index a7ce7da8785c..2b56a4fcf373 100644 --- a/trunk/arch/ppc/syslib/ipic.h +++ b/trunk/arch/ppc/syslib/ipic.h @@ -3,7 +3,7 @@ * * IPIC private definitions and structure. * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor, Inc * diff --git a/trunk/arch/ppc/syslib/m82xx_pci.c b/trunk/arch/ppc/syslib/m82xx_pci.c index 1941a8c7ca9a..1d1c3956c1ae 100644 --- a/trunk/arch/ppc/syslib/m82xx_pci.c +++ b/trunk/arch/ppc/syslib/m82xx_pci.c @@ -248,8 +248,7 @@ pq2ads_setup_pci(struct pci_controller *hose) pci_div = ( (sccr & SCCR_PCI_MODCK) ? 2 : 1) * ( ( (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT) + 1); freq = (uint)((2*binfo->bi_cpmfreq)/(pci_div)); - time = (int)66666666/freq; - + time = (int)666666/freq; /* due to PCI Local Bus spec, some devices needs to wait such a long time after RST deassertion. More specifically, 0.508s for 66MHz & twice more for 33 */ printk("%s: The PCI bus is %d Mhz.\nWaiting %s after deasserting RST...\n",__FILE__,freq, diff --git a/trunk/arch/ppc/syslib/mpc83xx_devices.c b/trunk/arch/ppc/syslib/mpc83xx_devices.c index 847df4409982..f43fbf9a9389 100644 --- a/trunk/arch/ppc/syslib/mpc83xx_devices.c +++ b/trunk/arch/ppc/syslib/mpc83xx_devices.c @@ -3,7 +3,7 @@ * * MPC83xx Device descriptions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/syslib/mpc83xx_sys.c b/trunk/arch/ppc/syslib/mpc83xx_sys.c index 82cf3ab77f4a..da743446789b 100644 --- a/trunk/arch/ppc/syslib/mpc83xx_sys.c +++ b/trunk/arch/ppc/syslib/mpc83xx_sys.c @@ -3,7 +3,7 @@ * * MPC83xx System descriptions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor Inc. * @@ -68,34 +68,10 @@ struct ppc_sys_spec ppc_sys_specs[] = { MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO }, }, - { - .ppc_sys_name = "8347E", - .mask = 0xFFFF0000, - .value = 0x80540000, - .num_devices = 9, - .device_list = (enum ppc_sys_devices[]) - { - MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, - MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2, - MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO - }, - }, - { - .ppc_sys_name = "8347", - .mask = 0xFFFF0000, - .value = 0x80550000, - .num_devices = 8, - .device_list = (enum ppc_sys_devices[]) - { - MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, - MPC83xx_IIC2, MPC83xx_DUART, - MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO - }, - }, { .ppc_sys_name = "8343E", .mask = 0xFFFF0000, - .value = 0x80560000, + .value = 0x80540000, .num_devices = 8, .device_list = (enum ppc_sys_devices[]) { @@ -107,7 +83,7 @@ struct ppc_sys_spec ppc_sys_specs[] = { { .ppc_sys_name = "8343", .mask = 0xFFFF0000, - .value = 0x80570000, + .value = 0x80550000, .num_devices = 7, .device_list = (enum ppc_sys_devices[]) { diff --git a/trunk/arch/ppc/syslib/mpc85xx_devices.c b/trunk/arch/ppc/syslib/mpc85xx_devices.c index 69949d255658..2ede677a0a53 100644 --- a/trunk/arch/ppc/syslib/mpc85xx_devices.c +++ b/trunk/arch/ppc/syslib/mpc85xx_devices.c @@ -3,7 +3,7 @@ * * MPC85xx Device descriptions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/syslib/mpc85xx_sys.c b/trunk/arch/ppc/syslib/mpc85xx_sys.c index 397cfbcce5ea..cb68d8c58348 100644 --- a/trunk/arch/ppc/syslib/mpc85xx_sys.c +++ b/trunk/arch/ppc/syslib/mpc85xx_sys.c @@ -3,7 +3,7 @@ * * MPC85xx System descriptions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/syslib/mpc8xx_devices.c b/trunk/arch/ppc/syslib/mpc8xx_devices.c index 92dc98b36bde..2b5f0e701687 100644 --- a/trunk/arch/ppc/syslib/mpc8xx_devices.c +++ b/trunk/arch/ppc/syslib/mpc8xx_devices.c @@ -3,7 +3,7 @@ * * MPC8xx Device descriptions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug * diff --git a/trunk/arch/ppc/syslib/mpc8xx_sys.c b/trunk/arch/ppc/syslib/mpc8xx_sys.c index d3c617521603..3cc27d29e3af 100644 --- a/trunk/arch/ppc/syslib/mpc8xx_sys.c +++ b/trunk/arch/ppc/syslib/mpc8xx_sys.c @@ -3,7 +3,7 @@ * * MPC8xx System descriptions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug * diff --git a/trunk/arch/ppc/syslib/ppc4xx_dma.c b/trunk/arch/ppc/syslib/ppc4xx_dma.c index 05ccd598dd4e..f15e64285f96 100644 --- a/trunk/arch/ppc/syslib/ppc4xx_dma.c +++ b/trunk/arch/ppc/syslib/ppc4xx_dma.c @@ -30,7 +30,6 @@ #include #include -#include #include ppc_dma_ch_t dma_channels[MAX_PPC4xx_DMA_CHANNELS]; diff --git a/trunk/arch/ppc/syslib/ppc83xx_setup.c b/trunk/arch/ppc/syslib/ppc83xx_setup.c index 1b5fe9e398d4..4da168a6ad03 100644 --- a/trunk/arch/ppc/syslib/ppc83xx_setup.c +++ b/trunk/arch/ppc/syslib/ppc83xx_setup.c @@ -3,7 +3,7 @@ * * MPC83XX common board code * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/syslib/ppc83xx_setup.h b/trunk/arch/ppc/syslib/ppc83xx_setup.h index a122a7322e5e..c766c1a5f786 100644 --- a/trunk/arch/ppc/syslib/ppc83xx_setup.h +++ b/trunk/arch/ppc/syslib/ppc83xx_setup.h @@ -3,7 +3,7 @@ * * MPC83XX common board definitions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/syslib/ppc85xx_common.c b/trunk/arch/ppc/syslib/ppc85xx_common.c index 19ad537225e4..da841dacdc13 100644 --- a/trunk/arch/ppc/syslib/ppc85xx_common.c +++ b/trunk/arch/ppc/syslib/ppc85xx_common.c @@ -3,7 +3,7 @@ * * MPC85xx support routines * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/syslib/ppc85xx_common.h b/trunk/arch/ppc/syslib/ppc85xx_common.h index 94edf32151dd..2c8f304441bf 100644 --- a/trunk/arch/ppc/syslib/ppc85xx_common.h +++ b/trunk/arch/ppc/syslib/ppc85xx_common.h @@ -3,7 +3,7 @@ * * MPC85xx support routines * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/syslib/ppc85xx_setup.c b/trunk/arch/ppc/syslib/ppc85xx_setup.c index 1a47ff4b831d..de2f90576577 100644 --- a/trunk/arch/ppc/syslib/ppc85xx_setup.c +++ b/trunk/arch/ppc/syslib/ppc85xx_setup.c @@ -3,7 +3,7 @@ * * MPC85XX common board code * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/syslib/ppc85xx_setup.h b/trunk/arch/ppc/syslib/ppc85xx_setup.h index e340b0545fb5..6e6cfe162faf 100644 --- a/trunk/arch/ppc/syslib/ppc85xx_setup.h +++ b/trunk/arch/ppc/syslib/ppc85xx_setup.h @@ -3,7 +3,7 @@ * * MPC85XX common board definitions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor Inc. * diff --git a/trunk/arch/ppc/syslib/ppc_sys.c b/trunk/arch/ppc/syslib/ppc_sys.c index c0b93c4191ee..603f01190816 100644 --- a/trunk/arch/ppc/syslib/ppc_sys.c +++ b/trunk/arch/ppc/syslib/ppc_sys.c @@ -3,7 +3,7 @@ * * PPC System library functions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor Inc. * Copyright 2005 MontaVista, Inc. by Vitaly Bordug diff --git a/trunk/arch/ppc/syslib/pq2_devices.c b/trunk/arch/ppc/syslib/pq2_devices.c index 6ff3aab82fc3..e960fe935325 100644 --- a/trunk/arch/ppc/syslib/pq2_devices.c +++ b/trunk/arch/ppc/syslib/pq2_devices.c @@ -3,7 +3,7 @@ * * PQ2 Device descriptions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * 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 diff --git a/trunk/arch/ppc/syslib/pq2_sys.c b/trunk/arch/ppc/syslib/pq2_sys.c index 36d6e2179940..7b6c9ebdb9e3 100644 --- a/trunk/arch/ppc/syslib/pq2_sys.c +++ b/trunk/arch/ppc/syslib/pq2_sys.c @@ -3,7 +3,7 @@ * * PQ2 System descriptions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * 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 diff --git a/trunk/arch/ppc/xmon/start.c b/trunk/arch/ppc/xmon/start.c index c80177f8ec04..98612d420346 100644 --- a/trunk/arch/ppc/xmon/start.c +++ b/trunk/arch/ppc/xmon/start.c @@ -184,9 +184,7 @@ xmon_map_scc(void) sccc = base + (addr & ~PAGE_MASK); sccd = sccc + 0x10; - } -#ifdef CONFIG_PPC_CHRP - else { + } else { base = (volatile unsigned char *) isa_io_base; if (_machine == _MACH_chrp) base = (volatile unsigned char *) @@ -202,7 +200,6 @@ xmon_map_scc(void) RXRDY = 1; DLAB = 0x80; } -#endif /* CONFIG_PPC_CHRP */ #elif defined(CONFIG_GEMINI) /* should already be mapped by the kernel boot */ sccc = (volatile unsigned char *) 0xffeffb0d; diff --git a/trunk/arch/ppc64/Kconfig b/trunk/arch/ppc64/Kconfig new file mode 100644 index 000000000000..9d10c12e87fe --- /dev/null +++ b/trunk/arch/ppc64/Kconfig @@ -0,0 +1,520 @@ +# +# For a description of the syntax of this configuration file, +# see Documentation/kbuild/kconfig-language.txt. +# + +config 64BIT + def_bool y + +config MMU + bool + default y + +config PPC_STD_MMU + def_bool y + +config UID16 + bool + +config RWSEM_GENERIC_SPINLOCK + bool + +config RWSEM_XCHGADD_ALGORITHM + bool + default y + +config GENERIC_CALIBRATE_DELAY + bool + default y + +config GENERIC_ISA_DMA + bool + default y + +config EARLY_PRINTK + bool + default y + +config COMPAT + bool + default y + +config SCHED_NO_NO_OMIT_FRAME_POINTER + bool + default y + +config ARCH_MAY_HAVE_PC_FDC + bool + default y + +config PPC_STD_MMU + bool + default y + +# We optimistically allocate largepages from the VM, so make the limit +# large enough (16MB). This badly named config option is actually +# max order + 1 +config FORCE_MAX_ZONEORDER + int + default "9" if PPC_64K_PAGES + default "13" + +source "init/Kconfig" + +config SYSVIPC_COMPAT + bool + depends on COMPAT && SYSVIPC + default y + +menu "Platform support" + +choice + prompt "Platform Type" + default PPC_MULTIPLATFORM + +config PPC_ISERIES + bool "IBM Legacy iSeries" + +config PPC_MULTIPLATFORM + bool "Generic" + +endchoice + +config PPC_PSERIES + depends on PPC_MULTIPLATFORM + bool " IBM pSeries & new iSeries" + default y + +config PPC_BPA + bool " Broadband Processor Architecture" + depends on PPC_MULTIPLATFORM + +config PPC_PMAC + depends on PPC_MULTIPLATFORM + bool " Apple G5 based machines" + default y + select U3_DART + select GENERIC_TBSYNC + +config PPC_MAPLE + depends on PPC_MULTIPLATFORM + bool " Maple 970FX Evaluation Board" + select U3_DART + select MPIC_BROKEN_U3 + select GENERIC_TBSYNC + default n + help + This option enables support for the Maple 970FX Evaluation Board. + For more informations, refer to + +config PPC + bool + default y + +config PPC64 + bool + default y + +config PPC_OF + depends on PPC_MULTIPLATFORM + bool + default y + +config XICS + depends on PPC_PSERIES + bool + default y + +config MPIC + depends on PPC_PSERIES || PPC_PMAC || PPC_MAPLE + bool + default y + +config PPC_I8259 + depends on PPC_PSERIES + bool + default y + +config BPA_IIC + depends on PPC_BPA + bool + default y + +# VMX is pSeries only for now until somebody writes the iSeries +# exception vectors for it +config ALTIVEC + bool "Support for VMX (Altivec) vector unit" + depends on PPC_MULTIPLATFORM + default y + +config PPC_SPLPAR + depends on PPC_PSERIES + bool "Support for shared-processor logical partitions" + default n + help + Enabling this option will make the kernel run more efficiently + on logically-partitioned pSeries systems which use shared + processors, that is, which share physical processors between + two or more partitions. + +config KEXEC + bool "kexec system call (EXPERIMENTAL)" + depends on PPC_MULTIPLATFORM && EXPERIMENTAL + help + kexec is a system call that implements the ability to shutdown your + current kernel, and to start another kernel. It is like a reboot + but it is indepedent of the system firmware. And like a reboot + you can start any kernel with it, not just Linux. + + The name comes from the similiarity to the exec system call. + + It is an ongoing process to be certain the hardware in a machine + is properly shutdown, so do not be surprised if this code does not + initially work for you. It may help to enable device hotplugging + support. As of this writing the exact hardware interface is + strongly in flux, so no good recommendation can be made. + +source "drivers/cpufreq/Kconfig" + +config CPU_FREQ_PMAC64 + bool "Support for some Apple G5s" + depends on CPU_FREQ && PMAC_SMU && PPC64 + select CPU_FREQ_TABLE + help + This adds support for frequency switching on Apple iMac G5, + and some of the more recent desktop G5 machines as well. + +config IBMVIO + depends on PPC_PSERIES || PPC_ISERIES + bool + default y + +config U3_DART + bool + depends on PPC_MULTIPLATFORM + default n + +config MPIC_BROKEN_U3 + bool + depends on PPC_MAPLE + default y + +config GENERIC_TBSYNC + def_bool n + +config PPC_PMAC64 + bool + depends on PPC_PMAC + default y + +config BOOTX_TEXT + bool "Support for early boot text console" + depends PPC_OF + help + Say Y here to see progress messages from the boot firmware in text + mode. Requires an Open Firmware compatible video card. + +config POWER4 + def_bool y + +config PPC_FPU + def_bool y + +config POWER4_ONLY + bool "Optimize for POWER4" + default n + ---help--- + Cause the compiler to optimize for POWER4 processors. The resulting + binary will not work on POWER3 or RS64 processors when compiled with + binutils 2.15 or later. + +config IOMMU_VMERGE + bool "Enable IOMMU virtual merging (EXPERIMENTAL)" + depends on EXPERIMENTAL + default n + help + Cause IO segments sent to a device for DMA to be merged virtually + by the IOMMU when they happen to have been allocated contiguously. + This doesn't add pressure to the IOMMU allocator. However, some + drivers don't support getting large merged segments coming back + from *_map_sg(). Say Y if you know the drivers you are using are + properly handling this case. + +config SMP + bool "Symmetric multi-processing support" + ---help--- + This enables support for systems with more than one CPU. If you have + a system with only one CPU, say N. If you have a system with more + than one CPU, say Y. + + If you say N here, the kernel will run on single and multiprocessor + machines, but will use only one CPU of a multiprocessor machine. If + you say Y here, the kernel will run on single-processor machines. + On a single-processor machine, the kernel will run faster if you say + N here. + + If you don't know what to do here, say Y. + +config NR_CPUS + int "Maximum number of CPUs (2-128)" + range 2 128 + depends on SMP + default "32" + +config HMT + bool "Hardware multithreading" + depends on SMP && PPC_PSERIES && BROKEN + help + This option enables hardware multithreading on RS64 cpus. + pSeries systems p620 and p660 have such a cpu type. + +config NUMA + bool "NUMA support" + default y if SMP && PPC_PSERIES + +config ARCH_SELECT_MEMORY_MODEL + def_bool y + +config ARCH_FLATMEM_ENABLE + def_bool y + depends on !NUMA + +config ARCH_SPARSEMEM_ENABLE + def_bool y + +config ARCH_SPARSEMEM_DEFAULT + def_bool y + depends on NUMA + +source "mm/Kconfig" + +config HAVE_ARCH_EARLY_PFN_TO_NID + def_bool y + depends on NEED_MULTIPLE_NODES + +config ARCH_MEMORY_PROBE + def_bool y + depends on MEMORY_HOTPLUG + +# Some NUMA nodes have memory ranges that span +# other nodes. Even though a pfn is valid and +# between a node's start and end pfns, it may not +# reside on that node. +# +# This is a relatively temporary hack that should +# be able to go away when sparsemem is fully in +# place +config NODES_SPAN_OTHER_NODES + def_bool y + depends on NEED_MULTIPLE_NODES + +config PPC_64K_PAGES + bool "64k page size" + help + This option changes the kernel logical page size to 64k. On machines + without processor support for 64k pages, the kernel will simulate + them by loading each individual 4k page on demand transparently, + while on hardware with such support, it will be used to map + normal application pages. + +config SCHED_SMT + bool "SMT (Hyperthreading) scheduler support" + depends on SMP + default off + help + SMT scheduler support improves the CPU scheduler's decision making + when dealing with POWER5 cpus at a cost of slightly increased + overhead in some places. If unsure say N here. + +source "kernel/Kconfig.preempt" +source kernel/Kconfig.hz + +config EEH + bool "PCI Extended Error Handling (EEH)" if EMBEDDED + depends on PPC_PSERIES + default y if !EMBEDDED + +# +# Use the generic interrupt handling code in kernel/irq/: +# +config GENERIC_HARDIRQS + bool + default y + +config PPC_RTAS + bool + depends on PPC_PSERIES || PPC_BPA + default y + +config RTAS_ERROR_LOGGING + bool + depends on PPC_RTAS + default y + +config RTAS_PROC + bool "Proc interface to RTAS" + depends on PPC_RTAS + default y + +config RTAS_FLASH + tristate "Firmware flash interface" + depends on RTAS_PROC + +config SCANLOG + tristate "Scanlog dump interface" + depends on RTAS_PROC && PPC_PSERIES + +config LPARCFG + tristate "LPAR Configuration Data" + depends on PPC_PSERIES || PPC_ISERIES + help + Provide system capacity information via human readable + = pairs through a /proc/ppc64/lparcfg interface. + +config SECCOMP + bool "Enable seccomp to safely compute untrusted bytecode" + depends on PROC_FS + default y + help + This kernel feature is useful for number crunching applications + that may need to compute untrusted bytecode during their + execution. By using pipes or other transports made available to + the process as file descriptors supporting the read/write + syscalls, it's possible to isolate those applications in + their own address space using seccomp. Once seccomp is + enabled via /proc//seccomp, it cannot be disabled + and the task is only allowed to execute a few safe syscalls + defined by each seccomp mode. + + If unsure, say Y. Only embedded should say N here. + +source "fs/Kconfig.binfmt" + +config HOTPLUG_CPU + bool "Support for hot-pluggable CPUs" + depends on SMP && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC) + select HOTPLUG + ---help--- + Say Y here to be able to turn CPUs off and on. + + Say N if you are unsure. + +config PROC_DEVICETREE + bool "Support for Open Firmware device tree in /proc" + help + This option adds a device-tree directory under /proc which contains + an image of the device tree that the kernel copies from Open + Firmware. If unsure, say Y here. + +config CMDLINE_BOOL + bool "Default bootloader kernel arguments" + depends on !PPC_ISERIES + +config CMDLINE + string "Initial kernel command string" + depends on CMDLINE_BOOL + default "console=ttyS0,9600 console=tty0 root=/dev/sda2" + help + On some platforms, there is currently no way for the boot loader to + pass arguments to the kernel. For these platforms, you can supply + some command-line options at build time by entering them here. In + most cases you will need to specify the root device here. + +endmenu + +config ISA_DMA_API + bool + default y + +menu "Bus Options" + +config ISA + bool + help + Find out whether you have ISA slots on your motherboard. ISA is the + name of a bus system, i.e. the way the CPU talks to the other stuff + inside your box. If you have an Apple machine, say N here; if you + have an IBM RS/6000 or pSeries machine or a PReP machine, say Y. If + you have an embedded board, consult your board documentation. + +config SBUS + bool + +config MCA + bool + +config EISA + bool + +config PCI + bool "support for PCI devices" if (EMBEDDED && PPC_ISERIES) + default y + help + Find out whether your system includes a PCI bus. PCI is the name of + a bus system, i.e. the way the CPU talks to the other stuff inside + your box. If you say Y here, the kernel will include drivers and + infrastructure code to support PCI bus devices. + +config PCI_DOMAINS + bool + default PCI + +source "drivers/pci/Kconfig" + +source "drivers/pcmcia/Kconfig" + +source "drivers/pci/hotplug/Kconfig" + +endmenu + +source "net/Kconfig" + +source "drivers/Kconfig" + +source "fs/Kconfig" + +menu "iSeries device drivers" + depends on PPC_ISERIES + +config VIOCONS + tristate "iSeries Virtual Console Support" + +config VIODASD + tristate "iSeries Virtual I/O disk support" + help + If you are running on an iSeries system and you want to use + virtual disks created and managed by OS/400, say Y. + +config VIOCD + tristate "iSeries Virtual I/O CD support" + help + If you are running Linux on an IBM iSeries system and you want to + read a CD drive owned by OS/400, say Y here. + +config VIOTAPE + tristate "iSeries Virtual Tape Support" + help + If you are running Linux on an iSeries system and you want Linux + to read and/or write a tape drive owned by OS/400, say Y here. + +endmenu + +config VIOPATH + bool + depends on VIOCONS || VIODASD || VIOCD || VIOTAPE || VETH + default y + +source "arch/powerpc/oprofile/Kconfig" + +source "arch/ppc64/Kconfig.debug" + +source "security/Kconfig" + +config KEYS_COMPAT + bool + depends on COMPAT && KEYS + default y + +source "crypto/Kconfig" + +source "lib/Kconfig" diff --git a/trunk/arch/ppc64/Kconfig.debug b/trunk/arch/ppc64/Kconfig.debug new file mode 100644 index 000000000000..b258c9314a1b --- /dev/null +++ b/trunk/arch/ppc64/Kconfig.debug @@ -0,0 +1,65 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config DEBUG_STACKOVERFLOW + bool "Check for stack overflows" + depends on DEBUG_KERNEL + help + This option will cause messages to be printed if free stack space + drops below a certain limit. + +config KPROBES + bool "Kprobes" + depends on DEBUG_KERNEL + help + Kprobes allows you to trap at almost any kernel address and + execute a callback function. register_kprobe() establishes + a probepoint and specifies the callback. Kprobes is useful + for kernel debugging, non-intrusive instrumentation and testing. + If in doubt, say "N". + +config DEBUG_STACK_USAGE + bool "Stack utilization instrumentation" + depends on DEBUG_KERNEL + help + Enables the display of the minimum amount of free stack which each + task has ever had available in the sysrq-T and sysrq-P debug output. + + This option will slow down process creation somewhat. + +config DEBUGGER + bool "Enable debugger hooks" + depends on DEBUG_KERNEL + help + Include in-kernel hooks for kernel debuggers. Unless you are + intending to debug the kernel, say N here. + +config XMON + bool "Include xmon kernel debugger" + depends on DEBUGGER && !PPC_ISERIES + help + Include in-kernel hooks for the xmon kernel monitor/debugger. + Unless you are intending to debug the kernel, say N here. + Make sure to enable also CONFIG_BOOTX_TEXT on Macs. Otherwise + nothing will appear on the screen (xmon writes directly to the + framebuffer memory). + The cmdline option 'xmon' or 'xmon=early' will drop into xmon very + early during boot. 'xmon=on' will just enable the xmon debugger hooks. + 'xmon=off' will disable the debugger hooks if CONFIG_XMON_DEFAULT is set. + +config XMON_DEFAULT + bool "Enable xmon by default" + depends on XMON + help + xmon is normally disabled unless booted with 'xmon=on'. + Use 'xmon=off' to disable xmon init during runtime. + +config IRQSTACKS + bool "Use separate kernel stacks when processing interrupts" + help + If you say Y here the kernel will use separate kernel stacks + for handling hard and soft interrupts. This can help avoid + overflowing the process kernel stacks. + +endmenu diff --git a/trunk/arch/ppc64/Makefile b/trunk/arch/ppc64/Makefile new file mode 100644 index 000000000000..a55a82d145d4 --- /dev/null +++ b/trunk/arch/ppc64/Makefile @@ -0,0 +1,142 @@ +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. Remember to do have actions +# for "archclean" and "archdep" for cleaning up and making dependencies for +# this architecture +# +# 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) 1994 by Linus Torvalds +# Changes for PPC by Gary Thomas +# Rewritten by Cort Dougan and Paul Mackerras +# Adjusted for PPC64 by Tom Gall +# + +KERNELLOAD := 0xc000000000000000 + +# Set default 32 bits cross compilers for vdso and boot wrapper +CROSS32_COMPILE ?= + +CROSS32CC := $(CROSS32_COMPILE)gcc +CROSS32AS := $(CROSS32_COMPILE)as +CROSS32LD := $(CROSS32_COMPILE)ld +CROSS32OBJCOPY := $(CROSS32_COMPILE)objcopy + +# If we have a biarch compiler, use it for 32 bits cross compile if +# CROSS32_COMPILE wasn't explicitely defined, and add proper explicit +# target type to target compilers + +HAS_BIARCH := $(call cc-option-yn, -m64) +ifeq ($(HAS_BIARCH),y) +ifeq ($(CROSS32_COMPILE),) +CROSS32CC := $(CC) -m32 +CROSS32AS := $(AS) -a32 +CROSS32LD := $(LD) -m elf32ppc +CROSS32OBJCOPY := $(OBJCOPY) +endif +override AS += -a64 +override LD += -m elf64ppc +override CC += -m64 +endif + +export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY + +new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) + +ifeq ($(new_nm),y) +NM := $(NM) --synthetic + +endif + +CHECKFLAGS += -m64 -D__powerpc__ -D__powerpc64__ + +LDFLAGS := -m elf64ppc +LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD) +CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \ + -mcall-aixdesc +# Temporary hack until we have migrated to asm-powerpc +CPPFLAGS += -Iarch/$(ARCH)/include + +GCC_VERSION := $(call cc-version) +GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi ;) + +ifeq ($(CONFIG_POWER4_ONLY),y) +ifeq ($(CONFIG_ALTIVEC),y) +ifeq ($(GCC_BROKEN_VEC),y) + CFLAGS += $(call cc-option,-mcpu=970) +else + CFLAGS += $(call cc-option,-mcpu=power4) +endif +else + CFLAGS += $(call cc-option,-mcpu=power4) +endif +else + CFLAGS += $(call cc-option,-mtune=power4) +endif + +# No AltiVec instruction when building kernel +CFLAGS += $(call cc-option, -mno-altivec) + +# Enable unit-at-a-time mode when possible. It shrinks the +# kernel considerably. +CFLAGS += $(call cc-option,-funit-at-a-time) + +head-y := arch/ppc64/kernel/head.o +head-y += arch/powerpc/kernel/fpu.o +head-y += arch/powerpc/kernel/entry_64.o + +core-y += arch/ppc64/kernel/ arch/powerpc/kernel/ +core-y += arch/powerpc/mm/ +core-y += arch/powerpc/sysdev/ +core-y += arch/powerpc/platforms/ +core-y += arch/powerpc/lib/ +core-$(CONFIG_XMON) += arch/powerpc/xmon/ +drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ + +boot := arch/ppc64/boot + +boottargets-$(CONFIG_PPC_PSERIES) += zImage zImage.initrd +boottargets-$(CONFIG_PPC_PMAC) += zImage.vmode zImage.initrd.vmode +boottargets-$(CONFIG_PPC_MAPLE) += zImage zImage.initrd +boottargets-$(CONFIG_PPC_ISERIES) += vmlinux.sminitrd vmlinux.initrd vmlinux.sm +boottargets-$(CONFIG_PPC_BPA) += zImage zImage.initrd +$(boottargets-y): vmlinux + $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ + +bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage +bootimage-$(CONFIG_PPC_PMAC) := vmlinux +bootimage-$(CONFIG_PPC_MAPLE) := $(boot)/zImage +bootimage-$(CONFIG_PPC_BPA) := $(boot)/zImage +bootimage-$(CONFIG_PPC_ISERIES) := vmlinux +BOOTIMAGE := $(bootimage-y) +install: vmlinux + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ + +defaultimage-$(CONFIG_PPC_PSERIES) := zImage +defaultimage-$(CONFIG_PPC_PMAC) := zImage.vmode +defaultimage-$(CONFIG_PPC_MAPLE) := zImage +defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux +KBUILD_IMAGE := $(defaultimage-y) +all: $(KBUILD_IMAGE) + +archclean: + $(Q)$(MAKE) $(clean)=$(boot) + # Temporary hack until we have migrated to asm-powerpc + $(Q)rm -rf arch/$(ARCH)/include + + +# Temporary hack until we have migrated to asm-powerpc +include/asm: arch/$(ARCH)/include/asm +arch/$(ARCH)/include/asm: + $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi + $(Q)ln -fsn $(srctree)/include/asm-powerpc arch/$(ARCH)/include/asm + +define archhelp + echo ' zImage.vmode - Compressed kernel image (arch/$(ARCH)/boot/zImage.vmode)' + echo ' zImage.initrd.vmode - Compressed kernel image with initrd attached,' + echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz' + echo ' (arch/$(ARCH)/boot/zImage.initrd.vmode)' + echo ' zImage - zImage for pSeries machines' + echo ' zImage.initrd - zImage with initrd for pSeries machines' +endef diff --git a/trunk/arch/powerpc/boot/Makefile b/trunk/arch/ppc64/boot/Makefile similarity index 96% rename from trunk/arch/powerpc/boot/Makefile rename to trunk/arch/ppc64/boot/Makefile index 9770f587af73..301bc1536c49 100644 --- a/trunk/arch/powerpc/boot/Makefile +++ b/trunk/arch/ppc64/boot/Makefile @@ -22,8 +22,7 @@ HOSTCC := gcc -BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \ - $(shell $(CROSS32CC) -print-file-name=include) -fPIC +BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem $(shell $(CROSS32CC) -print-file-name=include) -fPIC BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc BOOTLFLAGS := -T $(srctree)/$(src)/zImage.lds OBJCOPYFLAGS := contents,alloc,load,readonly,data @@ -99,7 +98,7 @@ quiet_cmd_ramdisk = RAMDISK $@ cmd_ramdisk = $(obj)/addRamDisk $(obj)/ramdisk.image.gz $< $@ quiet_cmd_stripvm = STRIP $@ - cmd_stripvm = $(STRIP) -s -R .comment $< -o $@ + cmd_stripvm = $(STRIP) -s $< -o $@ vmlinux.strip: vmlinux $(call if_changed,stripvm) diff --git a/trunk/arch/powerpc/boot/README b/trunk/arch/ppc64/boot/README similarity index 100% rename from trunk/arch/powerpc/boot/README rename to trunk/arch/ppc64/boot/README diff --git a/trunk/arch/powerpc/boot/addRamDisk.c b/trunk/arch/ppc64/boot/addRamDisk.c similarity index 100% rename from trunk/arch/powerpc/boot/addRamDisk.c rename to trunk/arch/ppc64/boot/addRamDisk.c diff --git a/trunk/arch/powerpc/boot/addnote.c b/trunk/arch/ppc64/boot/addnote.c similarity index 100% rename from trunk/arch/powerpc/boot/addnote.c rename to trunk/arch/ppc64/boot/addnote.c diff --git a/trunk/arch/powerpc/boot/crt0.S b/trunk/arch/ppc64/boot/crt0.S similarity index 80% rename from trunk/arch/powerpc/boot/crt0.S rename to trunk/arch/ppc64/boot/crt0.S index d2f2ace56cd3..9cc442263939 100644 --- a/trunk/arch/powerpc/boot/crt0.S +++ b/trunk/arch/ppc64/boot/crt0.S @@ -14,42 +14,43 @@ .text .globl _zimage_start _zimage_start: - bl 1f + bl reloc_offset -1: +reloc_offset: mflr r0 - lis r9,1b@ha - addi r9,r9,1b@l + lis r9,reloc_offset@ha + addi r9,r9,reloc_offset@l subf. r0,r9,r0 - beq 3f + beq clear_caches +reloc_got2: lis r9,__got2_start@ha addi r9,r9,__got2_start@l lis r8,__got2_end@ha addi r8,r8,__got2_end@l subf. r8,r9,r8 - beq 3f + beq clear_caches srwi. r8,r8,2 mtctr r8 add r9,r0,r9 -2: +reloc_got2_loop: lwz r8,0(r9) add r8,r8,r0 stw r8,0(r9) addi r9,r9,4 - bdnz 2b + bdnz reloc_got2_loop -3: +clear_caches: lis r9,_start@h add r9,r0,r9 lis r8,_etext@ha addi r8,r8,_etext@l add r8,r0,r8 -4: dcbf r0,r9 +1: dcbf r0,r9 icbi r0,r9 addi r9,r9,0x20 cmplwi 0,r9,8 - blt 4b + blt 1b sync isync diff --git a/trunk/arch/powerpc/boot/div64.S b/trunk/arch/ppc64/boot/div64.S similarity index 100% rename from trunk/arch/powerpc/boot/div64.S rename to trunk/arch/ppc64/boot/div64.S diff --git a/trunk/arch/powerpc/boot/elf.h b/trunk/arch/ppc64/boot/elf.h similarity index 100% rename from trunk/arch/powerpc/boot/elf.h rename to trunk/arch/ppc64/boot/elf.h diff --git a/trunk/arch/powerpc/boot/install.sh b/trunk/arch/ppc64/boot/install.sh similarity index 100% rename from trunk/arch/powerpc/boot/install.sh rename to trunk/arch/ppc64/boot/install.sh diff --git a/trunk/arch/powerpc/boot/main.c b/trunk/arch/ppc64/boot/main.c similarity index 77% rename from trunk/arch/powerpc/boot/main.c rename to trunk/arch/ppc64/boot/main.c index 64ec93116fa6..e0dde24a72ce 100644 --- a/trunk/arch/powerpc/boot/main.c +++ b/trunk/arch/ppc64/boot/main.c @@ -42,8 +42,6 @@ static struct addr_range vmlinux; static struct addr_range vmlinuz; static struct addr_range initrd; -static unsigned long elfoffset; - static char scratch[46912]; /* scratch space for gunzip, from zlib_inflate_workspacesize() */ static char elfheader[256]; @@ -133,70 +131,13 @@ static unsigned long try_claim(unsigned long size) return addr; } -static int is_elf64(void *hdr) -{ - Elf64_Ehdr *elf64 = hdr; - Elf64_Phdr *elf64ph; - unsigned int i; - - if (!(elf64->e_ident[EI_MAG0] == ELFMAG0 && - elf64->e_ident[EI_MAG1] == ELFMAG1 && - elf64->e_ident[EI_MAG2] == ELFMAG2 && - elf64->e_ident[EI_MAG3] == ELFMAG3 && - elf64->e_ident[EI_CLASS] == ELFCLASS64 && - elf64->e_ident[EI_DATA] == ELFDATA2MSB && - elf64->e_type == ET_EXEC && - elf64->e_machine == EM_PPC64)) - return 0; - - elf64ph = (Elf64_Phdr *)((unsigned long)elf64 + - (unsigned long)elf64->e_phoff); - for (i = 0; i < (unsigned int)elf64->e_phnum; i++, elf64ph++) - if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0) - break; - if (i >= (unsigned int)elf64->e_phnum) - return 0; - - elfoffset = (unsigned long)elf64ph->p_offset; - vmlinux.size = (unsigned long)elf64ph->p_filesz + elfoffset; - vmlinux.memsize = (unsigned long)elf64ph->p_memsz + elfoffset; - return 1; -} - -static int is_elf32(void *hdr) -{ - Elf32_Ehdr *elf32 = hdr; - Elf32_Phdr *elf32ph; - unsigned int i; - - if (!(elf32->e_ident[EI_MAG0] == ELFMAG0 && - elf32->e_ident[EI_MAG1] == ELFMAG1 && - elf32->e_ident[EI_MAG2] == ELFMAG2 && - elf32->e_ident[EI_MAG3] == ELFMAG3 && - elf32->e_ident[EI_CLASS] == ELFCLASS32 && - elf32->e_ident[EI_DATA] == ELFDATA2MSB && - elf32->e_type == ET_EXEC && - elf32->e_machine == EM_PPC)) - return 0; - - elf32 = (Elf32_Ehdr *)elfheader; - elf32ph = (Elf32_Phdr *) ((unsigned long)elf32 + elf32->e_phoff); - for (i = 0; i < elf32->e_phnum; i++, elf32ph++) - if (elf32ph->p_type == PT_LOAD && elf32ph->p_offset != 0) - break; - if (i >= elf32->e_phnum) - return 0; - - elfoffset = elf32ph->p_offset; - vmlinux.size = elf32ph->p_filesz + elf32ph->p_offset; - vmlinux.memsize = elf32ph->p_memsz + elf32ph->p_offset; - return 1; -} - void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) { + unsigned long i; int len; kernel_entry_t kernel_entry; + Elf64_Ehdr *elf64; + Elf64_Phdr *elf64ph; memset(__bss_start, 0, _end - __bss_start); @@ -212,22 +153,6 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", _start, sp); - vmlinuz.addr = (unsigned long)_vmlinux_start; - vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start); - - /* gunzip the ELF header of the kernel */ - if (*(unsigned short *)vmlinuz.addr == 0x1f8b) { - len = vmlinuz.size; - gunzip(elfheader, sizeof(elfheader), - (unsigned char *)vmlinuz.addr, &len); - } else - memcpy(elfheader, (const void *)vmlinuz.addr, sizeof(elfheader)); - - if (!is_elf64(elfheader) && !is_elf32(elfheader)) { - printf("Error: not a valid PPC32 or PPC64 ELF file!\n\r"); - exit(); - } - /* * The first available claim_base must be above the end of the * the loaded kernel wrapper file (_start to _end includes the @@ -247,11 +172,46 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) claim_base = PROG_START; #endif + vmlinuz.addr = (unsigned long)_vmlinux_start; + vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start); + + /* gunzip the ELF header of the kernel */ + if (*(unsigned short *)vmlinuz.addr == 0x1f8b) { + len = vmlinuz.size; + gunzip(elfheader, sizeof(elfheader), + (unsigned char *)vmlinuz.addr, &len); + } else + memcpy(elfheader, (const void *)vmlinuz.addr, sizeof(elfheader)); + + elf64 = (Elf64_Ehdr *)elfheader; + if ( elf64->e_ident[EI_MAG0] != ELFMAG0 || + elf64->e_ident[EI_MAG1] != ELFMAG1 || + elf64->e_ident[EI_MAG2] != ELFMAG2 || + elf64->e_ident[EI_MAG3] != ELFMAG3 || + elf64->e_ident[EI_CLASS] != ELFCLASS64 || + elf64->e_ident[EI_DATA] != ELFDATA2MSB || + elf64->e_type != ET_EXEC || + elf64->e_machine != EM_PPC64 ) + { + printf("Error: not a valid PPC64 ELF file!\n\r"); + exit(); + } + + elf64ph = (Elf64_Phdr *)((unsigned long)elf64 + + (unsigned long)elf64->e_phoff); + for(i=0; i < (unsigned int)elf64->e_phnum ;i++,elf64ph++) { + if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0) + break; + } + vmlinux.size = (unsigned long)elf64ph->p_filesz + + (unsigned long)elf64ph->p_offset; /* We need to claim the memsize plus the file offset since gzip * will expand the header (file offset), then the kernel, then * possible rubbish we don't care about. But the kernel bss must * be claimed (it will be zero'd by the kernel itself) */ + vmlinux.memsize = (unsigned long)elf64ph->p_memsz + + (unsigned long)elf64ph->p_offset; printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize); vmlinux.addr = try_claim(vmlinux.memsize); if (vmlinux.addr == 0) { @@ -294,9 +254,9 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) /* Skip over the ELF header */ #ifdef DEBUG printf("... skipping 0x%lx bytes of ELF header\n\r", - elfoffset); + (unsigned long)elf64ph->p_offset); #endif - vmlinux.addr += elfoffset; + vmlinux.addr += (unsigned long)elf64ph->p_offset; flush_cache((void *)vmlinux.addr, vmlinux.size); @@ -312,7 +272,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) (unsigned long)prom, NULL); #endif - kernel_entry(a1, a2, prom, NULL); + kernel_entry( a1, a2, prom, NULL ); printf("Error: Linux kernel returned to zImage bootloader!\n\r"); diff --git a/trunk/arch/powerpc/boot/page.h b/trunk/arch/ppc64/boot/page.h similarity index 100% rename from trunk/arch/powerpc/boot/page.h rename to trunk/arch/ppc64/boot/page.h diff --git a/trunk/arch/powerpc/boot/ppc_asm.h b/trunk/arch/ppc64/boot/ppc_asm.h similarity index 100% rename from trunk/arch/powerpc/boot/ppc_asm.h rename to trunk/arch/ppc64/boot/ppc_asm.h diff --git a/trunk/arch/powerpc/boot/prom.c b/trunk/arch/ppc64/boot/prom.c similarity index 100% rename from trunk/arch/powerpc/boot/prom.c rename to trunk/arch/ppc64/boot/prom.c diff --git a/trunk/arch/powerpc/boot/prom.h b/trunk/arch/ppc64/boot/prom.h similarity index 100% rename from trunk/arch/powerpc/boot/prom.h rename to trunk/arch/ppc64/boot/prom.h diff --git a/trunk/arch/powerpc/boot/stdio.h b/trunk/arch/ppc64/boot/stdio.h similarity index 100% rename from trunk/arch/powerpc/boot/stdio.h rename to trunk/arch/ppc64/boot/stdio.h diff --git a/trunk/arch/powerpc/boot/string.S b/trunk/arch/ppc64/boot/string.S similarity index 100% rename from trunk/arch/powerpc/boot/string.S rename to trunk/arch/ppc64/boot/string.S diff --git a/trunk/arch/powerpc/boot/string.h b/trunk/arch/ppc64/boot/string.h similarity index 100% rename from trunk/arch/powerpc/boot/string.h rename to trunk/arch/ppc64/boot/string.h diff --git a/trunk/arch/powerpc/boot/zImage.lds b/trunk/arch/ppc64/boot/zImage.lds similarity index 100% rename from trunk/arch/powerpc/boot/zImage.lds rename to trunk/arch/ppc64/boot/zImage.lds diff --git a/trunk/arch/ppc64/configs/bpa_defconfig b/trunk/arch/ppc64/configs/bpa_defconfig new file mode 100644 index 000000000000..67ffecbc05cb --- /dev/null +++ b/trunk/arch/ppc64/configs/bpa_defconfig @@ -0,0 +1,1024 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.14-rc4 +# Thu Oct 20 08:29:10 2005 +# +CONFIG_64BIT=y +CONFIG_MMU=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_EARLY_PRINTK=y +CONFIG_COMPAT=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_FORCE_MAX_ZONEORDER=13 + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +# CONFIG_CPUSETS is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# 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_MODULE_SRCVERSION_ALL is not set +# CONFIG_KMOD is not set +CONFIG_STOP_MACHINE=y +CONFIG_SYSVIPC_COMPAT=y + +# +# Platform support +# +# CONFIG_PPC_ISERIES is not set +CONFIG_PPC_MULTIPLATFORM=y +# CONFIG_PPC_PSERIES is not set +CONFIG_PPC_BPA=y +# CONFIG_PPC_PMAC is not set +# CONFIG_PPC_MAPLE is not set +CONFIG_PPC=y +CONFIG_PPC64=y +CONFIG_PPC_OF=y +CONFIG_BPA_IIC=y +CONFIG_ALTIVEC=y +CONFIG_KEXEC=y +# CONFIG_U3_DART is not set +# CONFIG_BOOTX_TEXT is not set +# CONFIG_POWER4_ONLY is not set +# CONFIG_IOMMU_VMERGE is not set +CONFIG_SMP=y +CONFIG_NR_CPUS=4 +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_NUMA is not set +CONFIG_SCHED_SMT=y +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +CONFIG_PREEMPT_BKL=y +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_GENERIC_HARDIRQS=y +CONFIG_PPC_RTAS=y +CONFIG_RTAS_PROC=y +CONFIG_RTAS_FLASH=y +CONFIG_SECCOMP=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +CONFIG_PROC_DEVICETREE=y +# CONFIG_CMDLINE_BOOL is not set +CONFIG_ISA_DMA_API=y + +# +# Bus Options +# +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LEGACY_PROC=y +# CONFIG_PCI_DEBUG is not set + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_UNIX=y +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_PNP is not set +CONFIG_NET_IPIP=y +# 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_INET_TUNNEL=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_BIC=y + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set +CONFIG_IPV6=y +# CONFIG_IPV6_PRIVACY is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_INET6_TUNNEL=m +CONFIG_IPV6_TUNNEL=m +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +# CONFIG_NETFILTER_NETLINK is not set + +# +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=y +# CONFIG_IP_NF_CT_ACCT is not set +# CONFIG_IP_NF_CONNTRACK_MARK is not set +# CONFIG_IP_NF_CONNTRACK_EVENTS is not set +CONFIG_IP_NF_CT_PROTO_SCTP=y +CONFIG_IP_NF_FTP=m +CONFIG_IP_NF_IRC=m +# CONFIG_IP_NF_NETBIOS_NS is not set +CONFIG_IP_NF_TFTP=m +CONFIG_IP_NF_AMANDA=m +# CONFIG_IP_NF_PPTP is not set +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_ADDRTYPE=m +CONFIG_IP_NF_MATCH_REALM=m +CONFIG_IP_NF_MATCH_SCTP=m +# CONFIG_IP_NF_MATCH_DCCP is not set +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m +CONFIG_IP_NF_MATCH_STRING=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_TARGET_NFQUEUE=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_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_TTL=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# IPv6: Netfilter Configuration (EXPERIMENTAL) +# +# CONFIG_IP6_NF_QUEUE is not set +# CONFIG_IP6_NF_IPTABLES is not set +# CONFIG_IP6_NF_TARGET_NFQUEUE is not set + +# +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_SCHED is not set +CONFIG_NET_CLS_ROUTE=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_IEEE80211 is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set + +# +# Connector - unified userspace <-> kernelspace linker +# +# CONFIG_CONNECTOR is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# 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_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +CONFIG_BLK_DEV_NBD=y +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=131072 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +CONFIG_IDEDISK_MULTI_MODE=y +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_IDE_TASK_IOCTL is not set + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=y +CONFIG_BLK_DEV_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_SL82C105 is not set +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_AEC62XX=y +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5520 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +CONFIG_BLK_DEV_SIIMAGE=y +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_IDE_ARM is not set +CONFIG_BLK_DEV_IDEDMA=y +# CONFIG_IDEDMA_IVB is not set +CONFIG_IDEDMA_AUTO=y +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +# CONFIG_SCSI is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD 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 +# + +# +# Network device support +# +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# PHY device support +# +# CONFIG_PHYLIB is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_CASSINI 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=m +# CONFIG_E1000_NAPI is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SIS190 is not set +CONFIG_SKGE=m +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2 is not set +# CONFIG_SPIDER_NET is not set +# CONFIG_MV643XX_ETH is not set + +# +# Ethernet (10000 Mbit) +# +# CONFIG_CHELSIO_T1 is not set +# CONFIG_IXGB is not set +# CONFIG_S2IO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD 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 + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +# CONFIG_SERIO_I8042 is not set +CONFIG_SERIO_SERPORT=y +# CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_RAW is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +CONFIG_SERIAL_NONSTANDARD=y +# CONFIG_ROCKETPORT is not set +# CONFIG_CYCLADES is not set +# CONFIG_DIGIEPCA is not set +# CONFIG_MOXA_SMARTIO is not set +# CONFIG_ISI is not set +# CONFIG_SYNCLINK is not set +# CONFIG_SYNCLINKMP is not set +# CONFIG_N_HDLC is not set +# CONFIG_SPECIALIX is not set +# CONFIG_SX is not set +# CONFIG_STALDRV 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_SERIAL_JSM is not set +CONFIG_UNIX98_PTYS=y +# CONFIG_LEGACY_PTYS is not set + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +CONFIG_WATCHDOG_RTAS=y + +# +# PCI-based Watchdog Cards +# +# CONFIG_PCIPCWATCHDOG is not set +# CONFIG_WDTPCI is not set +# CONFIG_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_AGP is not set +# CONFIG_DRM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_HANGCHECK_TIMER is not set + +# +# TPM devices +# +# CONFIG_TCG_TPM is not set + +# +# I2C support +# +CONFIG_I2C=y +# CONFIG_I2C_CHARDEV is not set + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=y +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_SENSORS_DS1337 is not set +# CONFIG_SENSORS_DS1374 is not set +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_SENSORS_MAX6875 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Hardware Monitoring support +# +# CONFIG_HWMON is not set +# CONFIG_HWMON_VID is not set + +# +# Misc devices +# + +# +# Multimedia Capabilities Port drivers +# + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +# CONFIG_FB is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +# CONFIG_USB is not set + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + +# +# SN Devices +# + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +CONFIG_FS_POSIX_ACL=y +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_INOTIFY=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_RAMFS=y +# CONFIG_RELAYFS_FS is not set + +# +# 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=m +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set +CONFIG_NFSD=m +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +# CONFIG_NFSD_V4 is not set +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=m +CONFIG_NFS_ACL_SUPPORT=m +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=m +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 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_AFS_FS is not set +# CONFIG_9P_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +CONFIG_EFI_PARTITION=y + +# +# Native Language Support +# +CONFIG_NLS=m +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +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 is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_DEBUG_KERNEL=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_LOG_BUF_SHIFT=15 +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +CONFIG_DEBUG_SPINLOCK_SLEEP=y +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_FS=y +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_KPROBES is not set +# CONFIG_DEBUG_STACK_USAGE is not set +CONFIG_DEBUGGER=y +# CONFIG_XMON is not set +# CONFIG_PPCDBG is not set +CONFIG_IRQSTACKS=y + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +CONFIG_CRYPTO=y +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_MD4 is not set +CONFIG_CRYPTO_MD5=m +CONFIG_CRYPTO_SHA1=m +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_WP512 is not set +# CONFIG_CRYPTO_TGR192 is not set +CONFIG_CRYPTO_DES=m +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_TWOFISH is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_AES is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_ANUBIS is not set +CONFIG_CRYPTO_DEFLATE=m +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_TEST is not set + +# +# Hardware crypto devices +# + +# +# Library routines +# +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m diff --git a/trunk/arch/ppc64/configs/g5_defconfig b/trunk/arch/ppc64/configs/g5_defconfig new file mode 100644 index 000000000000..6323065fbf2c --- /dev/null +++ b/trunk/arch/ppc64/configs/g5_defconfig @@ -0,0 +1,1392 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.14-rc4 +# Thu Oct 20 08:30:23 2005 +# +CONFIG_64BIT=y +CONFIG_MMU=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_EARLY_PRINTK=y +CONFIG_COMPAT=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_FORCE_MAX_ZONEORDER=13 + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +# CONFIG_CPUSETS is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y +CONFIG_SYSVIPC_COMPAT=y + +# +# Platform support +# +# CONFIG_PPC_ISERIES is not set +CONFIG_PPC_MULTIPLATFORM=y +# CONFIG_PPC_PSERIES is not set +# CONFIG_PPC_BPA is not set +CONFIG_PPC_PMAC=y +# CONFIG_PPC_MAPLE is not set +CONFIG_PPC=y +CONFIG_PPC64=y +CONFIG_PPC_OF=y +CONFIG_MPIC=y +CONFIG_ALTIVEC=y +CONFIG_KEXEC=y +CONFIG_U3_DART=y +CONFIG_PPC_PMAC64=y +CONFIG_BOOTX_TEXT=y +CONFIG_POWER4_ONLY=y +CONFIG_IOMMU_VMERGE=y +CONFIG_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_NUMA is not set +# CONFIG_SCHED_SMT is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_BKL is not set +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_GENERIC_HARDIRQS=y +CONFIG_SECCOMP=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_HOTPLUG_CPU is not set +CONFIG_PROC_DEVICETREE=y +# CONFIG_CMDLINE_BOOL is not set +CONFIG_ISA_DMA_API=y + +# +# Bus Options +# +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LEGACY_PROC=y +# CONFIG_PCI_DEBUG is not set + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +CONFIG_NET_KEY=m +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_PNP is not set +CONFIG_NET_IPIP=y +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_TUNNEL=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_BIC=y + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set +# CONFIG_IPV6 is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +# CONFIG_NETFILTER_NETLINK is not set + +# +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=m +CONFIG_IP_NF_CT_ACCT=y +CONFIG_IP_NF_CONNTRACK_MARK=y +CONFIG_IP_NF_CONNTRACK_EVENTS=y +CONFIG_IP_NF_CT_PROTO_SCTP=m +CONFIG_IP_NF_FTP=m +CONFIG_IP_NF_IRC=m +# CONFIG_IP_NF_NETBIOS_NS is not set +CONFIG_IP_NF_TFTP=m +CONFIG_IP_NF_AMANDA=m +# CONFIG_IP_NF_PPTP is not set +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_ADDRTYPE=m +CONFIG_IP_NF_MATCH_REALM=m +CONFIG_IP_NF_MATCH_SCTP=m +# CONFIG_IP_NF_MATCH_DCCP is not set +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_CONNBYTES=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m +CONFIG_IP_NF_MATCH_STRING=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_TARGET_NFQUEUE=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_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_TTL=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +CONFIG_LLC=y +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_SCHED is not set +CONFIG_NET_CLS_ROUTE=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_IEEE80211 is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set + +# +# Connector - unified userspace <-> kernelspace linker +# +# CONFIG_CONNECTOR is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# 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_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_BLK_DEV_INITRD=y +CONFIG_CDROM_PKTCDVD=m +CONFIG_CDROM_PKTCDVD_BUFFERS=8 +# CONFIG_CDROM_PKTCDVD_WCACHE is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +CONFIG_BLK_DEV_IDECD=y +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=y +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_IDEPCI_SHARE_IRQ is not set +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_SL82C105 is not set +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_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5520 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +CONFIG_BLK_DEV_IDE_PMAC=y +CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y +CONFIG_BLK_DEV_IDEDMA_PMAC=y +# CONFIG_BLK_DEV_IDE_PMAC_BLINK is not set +# CONFIG_IDE_ARM 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_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_CHR_DEV_ST=y +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=y +CONFIG_BLK_DEV_SR_VENDOR=y +CONFIG_CHR_DEV_SG=y +# CONFIG_CHR_DEV_SCH is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI Transport Attributes +# +CONFIG_SCSI_SPI_ATTRS=y +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_SAS is not set +CONFIG_SCSI_SATA=y +# CONFIG_SCSI_SATA_AHCI is not set +CONFIG_SCSI_SATA_SVW=y +# CONFIG_SCSI_ATA_PIIX is not set +# CONFIG_SCSI_SATA_MV is not set +# CONFIG_SCSI_SATA_NV is not set +# CONFIG_SCSI_SATA_PROMISE is not set +# CONFIG_SCSI_SATA_QSTOR is not set +# CONFIG_SCSI_SATA_SX4 is not set +# CONFIG_SCSI_SATA_SIL is not set +# CONFIG_SCSI_SATA_SIS is not set +# CONFIG_SCSI_SATA_ULI is not set +# CONFIG_SCSI_SATA_VIA is not set +# CONFIG_SCSI_SATA_VITESSE is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_QLOGIC_FC is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +CONFIG_SCSI_QLA2XXX=y +# CONFIG_SCSI_QLA21XX is not set +# CONFIG_SCSI_QLA22XX is not set +# CONFIG_SCSI_QLA2300 is not set +# CONFIG_SCSI_QLA2322 is not set +# CONFIG_SCSI_QLA6312 is not set +# CONFIG_SCSI_QLA24XX is not set +# CONFIG_SCSI_LPFC is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Multi-device support (RAID and LVM) +# +CONFIG_MD=y +CONFIG_BLK_DEV_MD=y +CONFIG_MD_LINEAR=y +CONFIG_MD_RAID0=y +CONFIG_MD_RAID1=y +CONFIG_MD_RAID10=m +CONFIG_MD_RAID5=y +CONFIG_MD_RAID6=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=y +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m +# CONFIG_DM_MULTIPATH is not set + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set +# CONFIG_FUSION_SPI is not set +# CONFIG_FUSION_FC is not set +# CONFIG_FUSION_SAS is not set + +# +# IEEE 1394 (FireWire) support +# +CONFIG_IEEE1394=y + +# +# Subsystem Options +# +# CONFIG_IEEE1394_VERBOSEDEBUG is not set +CONFIG_IEEE1394_OUI_DB=y +CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y +CONFIG_IEEE1394_CONFIG_ROM_IP1394=y +# CONFIG_IEEE1394_EXPORT_FULL_API is not set + +# +# Device Drivers +# +# CONFIG_IEEE1394_PCILYNX is not set +CONFIG_IEEE1394_OHCI1394=y + +# +# Protocol Drivers +# +CONFIG_IEEE1394_VIDEO1394=m +CONFIG_IEEE1394_SBP2=m +# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set +CONFIG_IEEE1394_ETH1394=m +CONFIG_IEEE1394_DV1394=m +CONFIG_IEEE1394_RAWIO=y +# CONFIG_IEEE1394_CMP is not set + +# +# I2O device support +# +# CONFIG_I2O is not set + +# +# Macintosh device drivers +# +CONFIG_ADB_PMU=y +CONFIG_PMAC_SMU=y +CONFIG_THERM_PM72=y + +# +# Network device support +# +CONFIG_NETDEVICES=y +CONFIG_DUMMY=m +CONFIG_BONDING=m +# CONFIG_EQUALIZER is not set +CONFIG_TUN=m + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# PHY device support +# +# CONFIG_PHYLIB is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +CONFIG_SUNGEM=y +# CONFIG_CASSINI 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=y +CONFIG_ACENIC_OMIT_TIGON_I=y +# CONFIG_DL2K is not set +CONFIG_E1000=y +# CONFIG_E1000_NAPI is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SIS190 is not set +# CONFIG_SKGE is not set +# CONFIG_SK98LIN is not set +CONFIG_TIGON3=m +# CONFIG_BNX2 is not set +# CONFIG_MV643XX_ETH is not set + +# +# Ethernet (10000 Mbit) +# +# CONFIG_CHELSIO_T1 is not set +# CONFIG_IXGB is not set +# CONFIG_S2IO is not set + +# +# Token Ring devices +# +CONFIG_TR=y +CONFIG_IBMOL=y +# CONFIG_3C359 is not set +# CONFIG_TMS380TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +CONFIG_PPP=m +# CONFIG_PPP_MULTILINK is not set +# CONFIG_PPP_FILTER is not set +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPPOE=m +# CONFIG_SLIP is not set +# CONFIG_NET_FC is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +# CONFIG_INPUT_MOUSEDEV_PSAUX 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 Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_INPUT_MOUSE=y +# CONFIG_MOUSE_PS2 is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +# CONFIG_SERIO_I8042 is not set +# CONFIG_SERIO_SERPORT is not set +# CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_RAW is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_PMACZILOG is not set +# CONFIG_SERIAL_JSM is not set +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_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_AGP=m +CONFIG_AGP_UNINORTH=m +# CONFIG_DRM is not set +CONFIG_RAW_DRIVER=y +CONFIG_MAX_RAW_DEVS=256 +# CONFIG_HANGCHECK_TIMER is not set + +# +# TPM devices +# +# CONFIG_TCG_TPM is not set + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=y +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_PIIX4 is not set +CONFIG_I2C_KEYWEST=y +CONFIG_I2C_PMAC_SMU=y +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_SENSORS_DS1337 is not set +# CONFIG_SENSORS_DS1374 is not set +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_SENSORS_MAX6875 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Hardware Monitoring support +# +# CONFIG_HWMON is not set +# CONFIG_HWMON_VID is not set + +# +# Misc devices +# + +# +# Multimedia Capabilities Port drivers +# + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +CONFIG_FB=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y +CONFIG_FB_MACMODES=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_CYBER2000 is not set +CONFIG_FB_OF=y +# CONFIG_FB_CONTROL is not set +# CONFIG_FB_PLATINUM is not set +# CONFIG_FB_VALKYRIE is not set +# CONFIG_FB_CT65550 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_VGA16 is not set +# CONFIG_FB_NVIDIA is not set +CONFIG_FB_RIVA=y +# CONFIG_FB_RIVA_I2C is not set +# CONFIG_FB_RIVA_DEBUG is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON_OLD is not set +CONFIG_FB_RADEON=y +CONFIG_FB_RADEON_I2C=y +# CONFIG_FB_RADEON_DEBUG is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_CYBLA is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_VIRTUAL is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y + +# +# Logo configuration +# +CONFIG_LOGO=y +CONFIG_LOGO_LINUX_MONO=y +CONFIG_LOGO_LINUX_VGA16=y +CONFIG_LOGO_LINUX_CLUT224=y +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=m +CONFIG_BACKLIGHT_DEVICE=y +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_DEVICE=y + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +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 +# CONFIG_USB_OTG is not set + +# +# USB Host Controller Drivers +# +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_EHCI_SPLIT_ISO is not set +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set +# CONFIG_USB_ISP116X_HCD is not set +CONFIG_USB_OHCI_HCD=y +# CONFIG_USB_OHCI_BIG_ENDIAN is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_BLUETOOTH_TTY is not set +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_DPCM=y +# CONFIG_USB_STORAGE_USBAT is not set +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +# CONFIG_USB_STORAGE_ONETOUCH is not set + +# +# USB Input Devices +# +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 is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_ACECAD is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_MTOUCH is not set +# CONFIG_USB_ITMTOUCH is not set +# CONFIG_USB_EGALAX is not set +# CONFIG_USB_YEALINK is not set +# CONFIG_USB_XPAD is not set +# CONFIG_USB_ATI_REMOTE is not set +# CONFIG_USB_KEYSPAN_REMOTE is not set +# CONFIG_USB_APPLETOUCH is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set + +# +# USB Multimedia devices +# +# CONFIG_USB_DABUSB is not set + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network Adapters +# +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8150=m +CONFIG_USB_USBNET=m +# CONFIG_USB_NET_AX8817X is not set +CONFIG_USB_NET_CDCETHER=m +# CONFIG_USB_NET_GL620A is not set +# CONFIG_USB_NET_NET1080 is not set +# CONFIG_USB_NET_PLUSB is not set +# CONFIG_USB_NET_RNDIS_HOST is not set +# CONFIG_USB_NET_CDC_SUBSET is not set +# CONFIG_USB_NET_ZAURUS is not set +CONFIG_USB_MON=y + +# +# USB port drivers +# + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_AIRPRIME is not set +CONFIG_USB_SERIAL_BELKIN=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +# CONFIG_USB_SERIAL_CP2101 is not set +CONFIG_USB_SERIAL_CYPRESS_M8=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_GARMIN=m +CONFIG_USB_SERIAL_IPW=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_HP4X is not set +CONFIG_USB_SERIAL_SAFE=m +CONFIG_USB_SERIAL_SAFE_PADDED=y +CONFIG_USB_SERIAL_TI=m +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 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set +# CONFIG_USB_PHIDGETSERVO is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_SISUSBVGA is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TEST is not set + +# +# USB DSL modem support +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + +# +# SN Devices +# + +# +# File systems +# +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +CONFIG_EXT2_FS_XIP=y +CONFIG_FS_XIP=y +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +CONFIG_REISERFS_FS=y +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +# CONFIG_JFS_FS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +CONFIG_XFS_EXPORT=y +# CONFIG_XFS_QUOTA is not set +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +# CONFIG_XFS_RT is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_INOTIFY=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=m +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_ZISOFS_FS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_RAMFS=y +# CONFIG_RELAYFS_FS is not set + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +CONFIG_HFS_FS=m +CONFIG_HFSPLUS_FS=m +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_CRAMFS=y +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +# CONFIG_NFS_DIRECTIO is not set +CONFIG_NFSD=y +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_RPCSEC_GSS_KRB5=y +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_EXPERIMENTAL is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +# CONFIG_9P_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +CONFIG_MAC_PARTITION=y +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_EFI_PARTITION is not set + +# +# Native Language Support +# +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +CONFIG_NLS_CODEPAGE_1250=y +CONFIG_NLS_CODEPAGE_1251=y +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +CONFIG_NLS_ISO8859_15=y +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +CONFIG_NLS_UTF8=y + +# +# Profiling support +# +CONFIG_PROFILING=y +CONFIG_OPROFILE=y + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_DEBUG_KERNEL=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_LOG_BUF_SHIFT=17 +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_FS=y +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_KPROBES is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUGGER is not set +# CONFIG_PPCDBG is not set +CONFIG_IRQSTACKS=y + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +CONFIG_CRYPTO=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +# CONFIG_CRYPTO_TGR192 is not set +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_TEST=m + +# +# Hardware crypto devices +# + +# +# Library routines +# +CONFIG_CRC_CCITT=m +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m diff --git a/trunk/arch/ppc64/configs/iSeries_defconfig b/trunk/arch/ppc64/configs/iSeries_defconfig new file mode 100644 index 000000000000..62e92c7e9e27 --- /dev/null +++ b/trunk/arch/ppc64/configs/iSeries_defconfig @@ -0,0 +1,998 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.14-rc4 +# Thu Oct 20 08:30:56 2005 +# +CONFIG_64BIT=y +CONFIG_MMU=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_EARLY_PRINTK=y +CONFIG_COMPAT=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_FORCE_MAX_ZONEORDER=13 + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +# CONFIG_CPUSETS is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y +CONFIG_SYSVIPC_COMPAT=y + +# +# Platform support +# +CONFIG_PPC_ISERIES=y +# CONFIG_PPC_MULTIPLATFORM is not set +CONFIG_PPC=y +CONFIG_PPC64=y +CONFIG_IBMVIO=y +# CONFIG_POWER4_ONLY is not set +CONFIG_IOMMU_VMERGE=y +CONFIG_SMP=y +CONFIG_NR_CPUS=32 +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_NUMA is not set +# CONFIG_SCHED_SMT is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_BKL is not set +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_GENERIC_HARDIRQS=y +CONFIG_LPARCFG=y +CONFIG_SECCOMP=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +CONFIG_ISA_DMA_API=y + +# +# Bus Options +# +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LEGACY_PROC=y +# CONFIG_PCI_DEBUG is not set + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +CONFIG_NET_KEY=m +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_PNP is not set +CONFIG_NET_IPIP=y +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_TUNNEL=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_BIC=y + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set +# CONFIG_IPV6 is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +# CONFIG_NETFILTER_NETLINK is not set + +# +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=m +CONFIG_IP_NF_CT_ACCT=y +CONFIG_IP_NF_CONNTRACK_MARK=y +CONFIG_IP_NF_CONNTRACK_EVENTS=y +CONFIG_IP_NF_CT_PROTO_SCTP=m +CONFIG_IP_NF_FTP=m +CONFIG_IP_NF_IRC=m +# CONFIG_IP_NF_NETBIOS_NS is not set +CONFIG_IP_NF_TFTP=m +CONFIG_IP_NF_AMANDA=m +# CONFIG_IP_NF_PPTP is not set +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_ADDRTYPE=m +CONFIG_IP_NF_MATCH_REALM=m +CONFIG_IP_NF_MATCH_SCTP=m +# CONFIG_IP_NF_MATCH_DCCP is not set +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_CONNBYTES=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m +CONFIG_IP_NF_MATCH_STRING=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_TARGET_NFQUEUE=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_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_TTL=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +CONFIG_LLC=y +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_SCHED is not set +CONFIG_NET_CLS_ROUTE=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_IEEE80211 is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=m +# CONFIG_DEBUG_DRIVER is not set + +# +# Connector - unified userspace <-> kernelspace linker +# +# CONFIG_CONNECTOR is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# 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_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set + +# +# ATA/ATAPI/MFM/RLL support +# +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_CHR_DEV_ST=y +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=y +CONFIG_BLK_DEV_SR_VENDOR=y +CONFIG_CHR_DEV_SG=y +# CONFIG_CHR_DEV_SCH is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI Transport Attributes +# +CONFIG_SCSI_SPI_ATTRS=y +CONFIG_SCSI_FC_ATTRS=y +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_SAS is not set +# CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_IPS is not set +CONFIG_SCSI_IBMVSCSI=m +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_QLOGIC_FC is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +CONFIG_SCSI_QLA2XXX=y +# CONFIG_SCSI_QLA21XX is not set +# CONFIG_SCSI_QLA22XX is not set +# CONFIG_SCSI_QLA2300 is not set +# CONFIG_SCSI_QLA2322 is not set +# CONFIG_SCSI_QLA6312 is not set +# CONFIG_SCSI_QLA24XX is not set +# CONFIG_SCSI_LPFC is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Multi-device support (RAID and LVM) +# +CONFIG_MD=y +CONFIG_BLK_DEV_MD=y +CONFIG_MD_LINEAR=y +CONFIG_MD_RAID0=y +CONFIG_MD_RAID1=y +CONFIG_MD_RAID10=m +CONFIG_MD_RAID5=y +CONFIG_MD_RAID6=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=y +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m +# CONFIG_DM_MULTIPATH is not set + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set +# CONFIG_FUSION_SPI is not set +# CONFIG_FUSION_FC is not set +# CONFIG_FUSION_SAS is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_IEEE1394 is not set + +# +# I2O device support +# +# CONFIG_I2O is not set + +# +# Macintosh device drivers +# + +# +# Network device support +# +CONFIG_NETDEVICES=y +CONFIG_DUMMY=m +CONFIG_BONDING=m +# CONFIG_EQUALIZER is not set +CONFIG_TUN=m + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# PHY device support +# +# CONFIG_PHYLIB is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_CASSINI is not set +# CONFIG_NET_VENDOR_3COM is not set + +# +# Tulip family network device support +# +# CONFIG_NET_TULIP is not set +# CONFIG_HP100 is not set +CONFIG_NET_PCI=y +CONFIG_PCNET32=y +# CONFIG_AMD8111_ETH is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_B44 is not set +# CONFIG_FORCEDETH is not set +# CONFIG_DGRS is not set +# CONFIG_EEPRO100 is not set +CONFIG_E100=y +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_SIS900 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SUNDANCE is not set +# CONFIG_VIA_RHINE is not set + +# +# Ethernet (1000 Mbit) +# +CONFIG_ACENIC=m +# CONFIG_ACENIC_OMIT_TIGON_I is not set +# CONFIG_DL2K is not set +CONFIG_E1000=m +# CONFIG_E1000_NAPI is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SIS190 is not set +# CONFIG_SKGE is not set +# CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2 is not set + +# +# Ethernet (10000 Mbit) +# +# CONFIG_CHELSIO_T1 is not set +# CONFIG_IXGB is not set +# CONFIG_S2IO is not set + +# +# Token Ring devices +# +CONFIG_TR=y +CONFIG_IBMOL=y +# CONFIG_3C359 is not set +# CONFIG_TMS380TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +CONFIG_ISERIES_VETH=y +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +CONFIG_PPP=m +# CONFIG_PPP_MULTILINK is not set +# CONFIG_PPP_FILTER is not set +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPPOE=m +# CONFIG_SLIP is not set +# CONFIG_NET_FC is not set +# CONFIG_SHAPER is not set +CONFIG_NETCONSOLE=y +CONFIG_NETPOLL=y +CONFIG_NETPOLL_RX=y +CONFIG_NETPOLL_TRAP=y +CONFIG_NET_POLL_CONTROLLER=y + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD 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 + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=m +CONFIG_SERIAL_ICOM=m +# CONFIG_SERIAL_JSM is not set +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_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_AGP is not set +# CONFIG_DRM is not set +CONFIG_RAW_DRIVER=y +CONFIG_MAX_RAW_DEVS=256 +# CONFIG_HANGCHECK_TIMER is not set + +# +# TPM devices +# +# CONFIG_TCG_TPM is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Hardware Monitoring support +# +# CONFIG_HWMON is not set +# CONFIG_HWMON_VID is not set + +# +# Misc devices +# + +# +# Multimedia Capabilities Port drivers +# + +# +# 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_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +# CONFIG_USB is not set + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + +# +# SN Devices +# + +# +# File systems +# +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +CONFIG_EXT2_FS_XIP=y +CONFIG_FS_XIP=y +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +CONFIG_REISERFS_FS=y +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +CONFIG_XFS_EXPORT=y +# CONFIG_XFS_QUOTA is not set +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +# CONFIG_XFS_RT is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_INOTIFY=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=m +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_ZISOFS_FS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_HUGETLBFS is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y +# CONFIG_RELAYFS_FS is not set + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_CRAMFS=y +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +# CONFIG_NFS_DIRECTIO is not set +CONFIG_NFSD=m +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=m +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_RPCSEC_GSS_KRB5=y +CONFIG_RPCSEC_GSS_SPKM3=m +# CONFIG_SMB_FS is not set +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +CONFIG_CIFS_XATTR=y +CONFIG_CIFS_POSIX=y +# CONFIG_CIFS_EXPERIMENTAL is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +# CONFIG_9P_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y + +# +# Native Language Support +# +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# iSeries device drivers +# +CONFIG_VIOCONS=y +CONFIG_VIODASD=y +CONFIG_VIOCD=m +CONFIG_VIOTAPE=m +CONFIG_VIOPATH=y + +# +# Profiling support +# +CONFIG_PROFILING=y +CONFIG_OPROFILE=y + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_DEBUG_KERNEL=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_LOG_BUF_SHIFT=17 +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_STACKOVERFLOW=y +# CONFIG_KPROBES is not set +CONFIG_DEBUG_STACK_USAGE=y +# CONFIG_DEBUGGER is not set +# CONFIG_PPCDBG is not set +CONFIG_IRQSTACKS=y + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +CONFIG_CRYPTO=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_TEST=m + +# +# Hardware crypto devices +# + +# +# Library routines +# +CONFIG_CRC_CCITT=m +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m diff --git a/trunk/arch/ppc64/configs/maple_defconfig b/trunk/arch/ppc64/configs/maple_defconfig new file mode 100644 index 000000000000..7b480f3d1406 --- /dev/null +++ b/trunk/arch/ppc64/configs/maple_defconfig @@ -0,0 +1,1062 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.14-rc4 +# Thu Oct 20 08:31:24 2005 +# +CONFIG_64BIT=y +CONFIG_MMU=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_EARLY_PRINTK=y +CONFIG_COMPAT=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_FORCE_MAX_ZONEORDER=13 + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +# CONFIG_CPUSETS is not set +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y +CONFIG_SYSVIPC_COMPAT=y + +# +# Platform support +# +# CONFIG_PPC_ISERIES is not set +CONFIG_PPC_MULTIPLATFORM=y +# CONFIG_PPC_PSERIES is not set +# CONFIG_PPC_BPA is not set +# CONFIG_PPC_PMAC is not set +CONFIG_PPC_MAPLE=y +CONFIG_PPC=y +CONFIG_PPC64=y +CONFIG_PPC_OF=y +CONFIG_MPIC=y +# CONFIG_ALTIVEC is not set +CONFIG_KEXEC=y +CONFIG_U3_DART=y +CONFIG_MPIC_BROKEN_U3=y +CONFIG_BOOTX_TEXT=y +CONFIG_POWER4_ONLY=y +CONFIG_IOMMU_VMERGE=y +CONFIG_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_NUMA is not set +# CONFIG_SCHED_SMT is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_BKL is not set +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_GENERIC_HARDIRQS=y +CONFIG_SECCOMP=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +CONFIG_PROC_DEVICETREE=y +# CONFIG_CMDLINE_BOOL is not set +CONFIG_ISA_DMA_API=y + +# +# Bus Options +# +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LEGACY_PROC=y +# CONFIG_PCI_DEBUG is not set + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +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_FIB_HASH=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +# CONFIG_IP_PNP_BOOTP is not set +# 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 is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_BIC=y +# CONFIG_IPV6 is not set +# CONFIG_NETFILTER is not set + +# +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_IEEE80211 is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set +# CONFIG_DEBUG_DRIVER is not set + +# +# Connector - unified userspace <-> kernelspace linker +# +# CONFIG_CONNECTOR is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# 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_COW_COMMON is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=8192 +# CONFIG_BLK_DEV_INITRD is not set +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +CONFIG_BLK_DEV_IDECD=y +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +CONFIG_IDE_TASK_IOCTL=y + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=y +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_IDEPCI_SHARE_IRQ=y +# CONFIG_BLK_DEV_OFFBOARD is not set +CONFIG_BLK_DEV_GENERIC=y +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_SL82C105 is not set +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_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +CONFIG_BLK_DEV_AMD74XX=y +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5520 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_IDE_ARM 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_RAID_ATTRS is not set +# 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 +# + +# +# Network device support +# +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# PHY device support +# +# CONFIG_PHYLIB is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_CASSINI 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=y +# CONFIG_PCNET32 is not set +CONFIG_AMD8111_ETH=y +# CONFIG_AMD8111E_NAPI is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_B44 is not set +# CONFIG_FORCEDETH is not set +# CONFIG_DGRS is not set +# CONFIG_EEPRO100 is not set +# CONFIG_E100 is not set +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_SIS900 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SUNDANCE is not set +# CONFIG_VIA_RHINE is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +CONFIG_E1000=y +# CONFIG_E1000_NAPI is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SIS190 is not set +# CONFIG_SKGE is not set +# CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set +# CONFIG_TIGON3 is not set +# CONFIG_BNX2 is not set +# CONFIG_MV643XX_ETH is not set + +# +# Ethernet (10000 Mbit) +# +# CONFIG_CHELSIO_T1 is not set +# CONFIG_IXGB is not set +# CONFIG_S2IO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1600 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=1200 +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD 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 + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_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_AGP is not set +# CONFIG_DRM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_HANGCHECK_TIMER is not set + +# +# TPM devices +# +# CONFIG_TCG_TPM is not set + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=y +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +CONFIG_I2C_AMD8111=y +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_SENSORS_DS1337 is not set +# CONFIG_SENSORS_DS1374 is not set +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_SENSORS_MAX6875 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Hardware Monitoring support +# +# CONFIG_HWMON is not set +# CONFIG_HWMON_VID is not set + +# +# Misc devices +# + +# +# Multimedia Capabilities Port drivers +# + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +# CONFIG_FB is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +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 +# CONFIG_USB_OTG is not set + +# +# USB Host Controller Drivers +# +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_SPLIT_ISO=y +CONFIG_USB_EHCI_ROOT_HUB_TT=y +# CONFIG_USB_ISP116X_HCD is not set +CONFIG_USB_OHCI_HCD=y +# CONFIG_USB_OHCI_BIG_ENDIAN is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +CONFIG_USB_UHCI_HCD=y +# CONFIG_USB_SL811_HCD is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_BLUETOOTH_TTY is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# +# CONFIG_USB_STORAGE is not set + +# +# USB Input Devices +# +CONFIG_USB_HID=y +CONFIG_USB_HIDINPUT=y +# CONFIG_HID_FF is not set +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_ACECAD is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_MTOUCH is not set +# CONFIG_USB_ITMTOUCH is not set +# CONFIG_USB_EGALAX is not set +# CONFIG_USB_YEALINK is not set +# CONFIG_USB_XPAD is not set +# CONFIG_USB_ATI_REMOTE is not set +# CONFIG_USB_KEYSPAN_REMOTE is not set +# CONFIG_USB_APPLETOUCH is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set + +# +# USB Multimedia devices +# +# CONFIG_USB_DABUSB is not set + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network Adapters +# +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +CONFIG_USB_PEGASUS=y +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_USBNET is not set +CONFIG_USB_MON=y + +# +# USB port drivers +# + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=y +# CONFIG_USB_SERIAL_CONSOLE is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_AIRPRIME is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_CP2101 is not set +CONFIG_USB_SERIAL_CYPRESS_M8=m +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +CONFIG_USB_SERIAL_KEYSPAN=y +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 is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_HP4X is not set +# CONFIG_USB_SERIAL_SAFE is not set +CONFIG_USB_SERIAL_TI=m +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set +CONFIG_USB_EZUSB=y + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set +# CONFIG_USB_PHIDGETSERVO is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_SISUSBVGA is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TEST is not set + +# +# USB DSL modem support +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + +# +# SN Devices +# + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +CONFIG_EXT2_FS_XIP=y +CONFIG_FS_XIP=y +CONFIG_EXT3_FS=y +# CONFIG_EXT3_FS_XATTR is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +CONFIG_FS_POSIX_ACL=y +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_INOTIFY=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_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=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_RAMFS=y +# CONFIG_RELAYFS_FS is not set + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_CRAMFS=y +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_NFSD is not set +CONFIG_ROOT_NFS=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_RPCSEC_GSS_KRB5=y +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +# CONFIG_9P_FS 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=y +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_EFI_PARTITION is not set + +# +# Native Language Support +# +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="utf-8" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +CONFIG_NLS_UTF8=y + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_DEBUG_KERNEL=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_LOG_BUF_SHIFT=17 +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_SCHEDSTATS is not set +CONFIG_DEBUG_SLAB=y +# CONFIG_DEBUG_SPINLOCK is not set +CONFIG_DEBUG_SPINLOCK_SLEEP=y +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_STACKOVERFLOW=y +# CONFIG_KPROBES is not set +CONFIG_DEBUG_STACK_USAGE=y +CONFIG_DEBUGGER=y +CONFIG_XMON=y +CONFIG_XMON_DEFAULT=y +# CONFIG_PPCDBG is not set +# CONFIG_IRQSTACKS is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +CONFIG_CRYPTO=y +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_MD4 is not set +CONFIG_CRYPTO_MD5=y +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_WP512 is not set +# CONFIG_CRYPTO_TGR192 is not set +CONFIG_CRYPTO_DES=y +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_TWOFISH is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_AES is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_TEST is not set + +# +# Hardware crypto devices +# + +# +# Library routines +# +CONFIG_CRC_CCITT=y +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y diff --git a/trunk/arch/ppc64/configs/pSeries_defconfig b/trunk/arch/ppc64/configs/pSeries_defconfig new file mode 100644 index 000000000000..9f09dff9e11a --- /dev/null +++ b/trunk/arch/ppc64/configs/pSeries_defconfig @@ -0,0 +1,1371 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.14-rc4 +# Thu Oct 20 08:32:17 2005 +# +CONFIG_64BIT=y +CONFIG_MMU=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_EARLY_PRINTK=y +CONFIG_COMPAT=y +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_FORCE_MAX_ZONEORDER=13 + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_CPUSETS=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y +CONFIG_SYSVIPC_COMPAT=y + +# +# Platform support +# +# CONFIG_PPC_ISERIES is not set +CONFIG_PPC_MULTIPLATFORM=y +CONFIG_PPC_PSERIES=y +# CONFIG_PPC_BPA is not set +# CONFIG_PPC_PMAC is not set +# CONFIG_PPC_MAPLE is not set +CONFIG_PPC=y +CONFIG_PPC64=y +CONFIG_PPC_OF=y +CONFIG_XICS=y +CONFIG_MPIC=y +CONFIG_ALTIVEC=y +CONFIG_PPC_SPLPAR=y +CONFIG_KEXEC=y +CONFIG_IBMVIO=y +# CONFIG_U3_DART is not set +# CONFIG_BOOTX_TEXT is not set +# CONFIG_POWER4_ONLY is not set +CONFIG_IOMMU_VMERGE=y +CONFIG_SMP=y +CONFIG_NR_CPUS=128 +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_DISCONTIGMEM_ENABLE=y +CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_SELECT_MEMORY_MODEL=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_DISCONTIGMEM_MANUAL=y +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_DISCONTIGMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_NEED_MULTIPLE_NODES=y +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y +CONFIG_NODES_SPAN_OTHER_NODES=y +CONFIG_NUMA=y +CONFIG_SCHED_SMT=y +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_BKL is not set +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_EEH=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_PPC_RTAS=y +CONFIG_RTAS_PROC=y +CONFIG_RTAS_FLASH=m +CONFIG_SCANLOG=m +CONFIG_LPARCFG=y +CONFIG_SECCOMP=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +CONFIG_HOTPLUG_CPU=y +CONFIG_PROC_DEVICETREE=y +# CONFIG_CMDLINE_BOOL is not set +CONFIG_ISA_DMA_API=y + +# +# Bus Options +# +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LEGACY_PROC=y +# CONFIG_PCI_DEBUG is not set + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PCI Hotplug Support +# +CONFIG_HOTPLUG_PCI=m +# CONFIG_HOTPLUG_PCI_FAKE is not set +# CONFIG_HOTPLUG_PCI_CPCI is not set +# CONFIG_HOTPLUG_PCI_SHPC is not set +CONFIG_HOTPLUG_PCI_RPA=m +CONFIG_HOTPLUG_PCI_RPA_DLPAR=m + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_XFRM_USER=m +CONFIG_NET_KEY=m +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_PNP is not set +CONFIG_NET_IPIP=y +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_TUNNEL=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_BIC=y + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set +# CONFIG_IPV6 is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_NETFILTER_NETLINK=y +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m + +# +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=m +CONFIG_IP_NF_CT_ACCT=y +CONFIG_IP_NF_CONNTRACK_MARK=y +CONFIG_IP_NF_CONNTRACK_EVENTS=y +CONFIG_IP_NF_CONNTRACK_NETLINK=m +CONFIG_IP_NF_CT_PROTO_SCTP=m +CONFIG_IP_NF_FTP=m +CONFIG_IP_NF_IRC=m +# CONFIG_IP_NF_NETBIOS_NS is not set +CONFIG_IP_NF_TFTP=m +CONFIG_IP_NF_AMANDA=m +# CONFIG_IP_NF_PPTP is not set +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_ADDRTYPE=m +CONFIG_IP_NF_MATCH_REALM=m +CONFIG_IP_NF_MATCH_SCTP=m +# CONFIG_IP_NF_MATCH_DCCP is not set +CONFIG_IP_NF_MATCH_COMMENT=m +CONFIG_IP_NF_MATCH_CONNMARK=m +CONFIG_IP_NF_MATCH_CONNBYTES=m +CONFIG_IP_NF_MATCH_HASHLIMIT=m +CONFIG_IP_NF_MATCH_STRING=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_TARGET_NFQUEUE=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_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_TTL=m +CONFIG_IP_NF_TARGET_CONNMARK=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +CONFIG_IP_NF_RAW=m +CONFIG_IP_NF_TARGET_NOTRACK=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m +CONFIG_IP_NF_ARP_MANGLE=m + +# +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +CONFIG_LLC=y +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_SCHED is not set +CONFIG_NET_CLS_ROUTE=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_IEEE80211 is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set + +# +# Connector - unified userspace <-> kernelspace linker +# +# CONFIG_CONNECTOR is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +CONFIG_PARPORT=m +CONFIG_PARPORT_PC=m +# CONFIG_PARPORT_SERIAL is not set +# CONFIG_PARPORT_PC_FIFO is not set +# CONFIG_PARPORT_PC_SUPERIO is not set +# CONFIG_PARPORT_GSC is not set +# CONFIG_PARPORT_1284 is not set + +# +# Plug and Play support +# + +# +# Block devices +# +CONFIG_BLK_DEV_FD=m +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +CONFIG_BLK_DEV_IDECD=y +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=y +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_IDEPCI_SHARE_IRQ=y +# CONFIG_BLK_DEV_OFFBOARD is not set +CONFIG_BLK_DEV_GENERIC=y +# CONFIG_BLK_DEV_OPTI621 is not set +CONFIG_BLK_DEV_SL82C105=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_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +CONFIG_BLK_DEV_AMD74XX=y +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5520 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_IDE_ARM 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_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +CONFIG_CHR_DEV_ST=y +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=y +CONFIG_BLK_DEV_SR_VENDOR=y +CONFIG_CHR_DEV_SG=y +# CONFIG_CHR_DEV_SCH is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +CONFIG_SCSI_MULTI_LUN=y +CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI Transport Attributes +# +CONFIG_SCSI_SPI_ATTRS=y +CONFIG_SCSI_FC_ATTRS=y +CONFIG_SCSI_ISCSI_ATTRS=m +# CONFIG_SCSI_SAS_ATTRS is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_SAS is not set +# CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_IPS is not set +CONFIG_SCSI_IBMVSCSI=y +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_PPA is not set +# CONFIG_SCSI_IMM is not set +CONFIG_SCSI_SYM53C8XX_2=y +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 +CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 +CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 +# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set +CONFIG_SCSI_IPR=y +CONFIG_SCSI_IPR_TRACE=y +CONFIG_SCSI_IPR_DUMP=y +# CONFIG_SCSI_QLOGIC_FC is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +CONFIG_SCSI_QLA2XXX=y +CONFIG_SCSI_QLA21XX=m +CONFIG_SCSI_QLA22XX=m +CONFIG_SCSI_QLA2300=m +CONFIG_SCSI_QLA2322=m +CONFIG_SCSI_QLA6312=m +CONFIG_SCSI_QLA24XX=m +CONFIG_SCSI_LPFC=m +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Multi-device support (RAID and LVM) +# +CONFIG_MD=y +CONFIG_BLK_DEV_MD=y +CONFIG_MD_LINEAR=y +CONFIG_MD_RAID0=y +CONFIG_MD_RAID1=y +CONFIG_MD_RAID10=m +CONFIG_MD_RAID5=y +CONFIG_MD_RAID6=m +CONFIG_MD_MULTIPATH=m +CONFIG_MD_FAULTY=m +CONFIG_BLK_DEV_DM=y +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m +CONFIG_DM_MULTIPATH=m +CONFIG_DM_MULTIPATH_EMC=m + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set +# CONFIG_FUSION_SPI is not set +# CONFIG_FUSION_FC is not set +# CONFIG_FUSION_SAS is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_IEEE1394 is not set + +# +# I2O device support +# +# CONFIG_I2O is not set + +# +# Macintosh device drivers +# + +# +# Network device support +# +CONFIG_NETDEVICES=y +CONFIG_DUMMY=m +CONFIG_BONDING=m +# CONFIG_EQUALIZER is not set +CONFIG_TUN=m + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# PHY device support +# +# CONFIG_PHYLIB is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_CASSINI is not set +CONFIG_NET_VENDOR_3COM=y +CONFIG_VORTEX=y +# CONFIG_TYPHOON is not set + +# +# Tulip family network device support +# +# CONFIG_NET_TULIP is not set +# CONFIG_HP100 is not set +CONFIG_IBMVETH=y +CONFIG_NET_PCI=y +CONFIG_PCNET32=y +# CONFIG_AMD8111_ETH is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_B44 is not set +# CONFIG_FORCEDETH is not set +# CONFIG_DGRS is not set +# CONFIG_EEPRO100 is not set +CONFIG_E100=y +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_SIS900 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SUNDANCE is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +CONFIG_ACENIC=y +CONFIG_ACENIC_OMIT_TIGON_I=y +# CONFIG_DL2K is not set +CONFIG_E1000=y +# CONFIG_E1000_NAPI is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SIS190 is not set +# CONFIG_SKGE is not set +# CONFIG_SK98LIN is not set +# CONFIG_VIA_VELOCITY is not set +CONFIG_TIGON3=y +# CONFIG_BNX2 is not set +# CONFIG_MV643XX_ETH is not set + +# +# Ethernet (10000 Mbit) +# +# CONFIG_CHELSIO_T1 is not set +CONFIG_IXGB=m +# CONFIG_IXGB_NAPI is not set +CONFIG_S2IO=m +# CONFIG_S2IO_NAPI is not set +# CONFIG_2BUFF_MODE is not set + +# +# Token Ring devices +# +CONFIG_TR=y +CONFIG_IBMOL=y +# CONFIG_3C359 is not set +# CONFIG_TMS380TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +CONFIG_PPP=m +# CONFIG_PPP_MULTILINK is not set +# CONFIG_PPP_FILTER is not set +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPPOE=m +# CONFIG_SLIP is not set +# CONFIG_NET_FC is not set +# CONFIG_SHAPER is not set +CONFIG_NETCONSOLE=y +CONFIG_NETPOLL=y +CONFIG_NETPOLL_RX=y +CONFIG_NETPOLL_TRAP=y +CONFIG_NET_POLL_CONTROLLER=y + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +CONFIG_INPUT_MISC=y +CONFIG_INPUT_PCSPKR=m +# CONFIG_INPUT_UINPUT is not set + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +# CONFIG_SERIO_SERPORT is not set +# CONFIG_SERIO_PARKBD is not set +# CONFIG_SERIO_PCIPS2 is not set +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# 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_SERIAL_ICOM=m +# CONFIG_SERIAL_JSM is not set +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +# CONFIG_PRINTER is not set +# CONFIG_PPDEV is not set +# CONFIG_TIPAR is not set +CONFIG_HVC_CONSOLE=y +CONFIG_HVCS=m + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_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_AGP is not set +# CONFIG_DRM is not set +CONFIG_RAW_DRIVER=y +CONFIG_MAX_RAW_DEVS=1024 +# CONFIG_HANGCHECK_TIMER is not set + +# +# TPM devices +# +# CONFIG_TCG_TPM is not set + +# +# I2C support +# +CONFIG_I2C=y +# CONFIG_I2C_CHARDEV is not set + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=y +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_SENSORS_DS1337 is not set +# CONFIG_SENSORS_DS1374 is not set +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_SENSORS_MAX6875 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Hardware Monitoring support +# +# CONFIG_HWMON is not set +# CONFIG_HWMON_VID is not set + +# +# Misc devices +# + +# +# Multimedia Capabilities Port drivers +# + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +CONFIG_FB=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y +CONFIG_FB_MACMODES=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_CYBER2000 is not set +CONFIG_FB_OF=y +# CONFIG_FB_CT65550 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_VGA16 is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +CONFIG_FB_MATROX=y +CONFIG_FB_MATROX_MILLENIUM=y +CONFIG_FB_MATROX_MYSTIQUE=y +CONFIG_FB_MATROX_G=y +# CONFIG_FB_MATROX_I2C is not set +CONFIG_FB_MATROX_MULTIHEAD=y +# CONFIG_FB_RADEON_OLD is not set +CONFIG_FB_RADEON=y +CONFIG_FB_RADEON_I2C=y +# CONFIG_FB_RADEON_DEBUG is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_CYBLA is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_VIRTUAL is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y + +# +# Logo configuration +# +CONFIG_LOGO=y +CONFIG_LOGO_LINUX_MONO=y +CONFIG_LOGO_LINUX_VGA16=y +CONFIG_LOGO_LINUX_CLUT224=y +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=m +CONFIG_BACKLIGHT_DEVICE=y +CONFIG_LCD_CLASS_DEVICE=m +CONFIG_LCD_DEVICE=y + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +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 +# CONFIG_USB_OTG is not set + +# +# USB Host Controller Drivers +# +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_EHCI_SPLIT_ISO is not set +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set +# CONFIG_USB_ISP116X_HCD is not set +CONFIG_USB_OHCI_HCD=y +# CONFIG_USB_OHCI_BIG_ENDIAN is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_BLUETOOTH_TTY is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set + +# +# USB Input Devices +# +CONFIG_USB_HID=y +CONFIG_USB_HIDINPUT=y +# CONFIG_HID_FF is not set +CONFIG_USB_HIDDEV=y +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_ACECAD is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_MTOUCH is not set +# CONFIG_USB_ITMTOUCH is not set +# CONFIG_USB_EGALAX is not set +# CONFIG_USB_YEALINK is not set +# CONFIG_USB_XPAD is not set +# CONFIG_USB_ATI_REMOTE is not set +# CONFIG_USB_KEYSPAN_REMOTE is not set +# CONFIG_USB_APPLETOUCH is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set + +# +# USB Multimedia devices +# +# CONFIG_USB_DABUSB is not set + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network Adapters +# +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_USBNET is not set +CONFIG_USB_MON=y + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETKIT is not set +# CONFIG_USB_PHIDGETSERVO is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_SISUSBVGA is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TEST is not set + +# +# USB DSL modem support +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +CONFIG_INFINIBAND=m +# CONFIG_INFINIBAND_USER_MAD is not set +# CONFIG_INFINIBAND_USER_ACCESS is not set +CONFIG_INFINIBAND_MTHCA=m +# CONFIG_INFINIBAND_MTHCA_DEBUG is not set +CONFIG_INFINIBAND_IPOIB=m +# CONFIG_INFINIBAND_IPOIB_DEBUG is not set + +# +# SN Devices +# + +# +# File systems +# +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +CONFIG_EXT2_FS_XIP=y +CONFIG_FS_XIP=y +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +CONFIG_REISERFS_FS=y +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_REISERFS_FS_XATTR=y +CONFIG_REISERFS_FS_POSIX_ACL=y +CONFIG_REISERFS_FS_SECURITY=y +CONFIG_JFS_FS=m +CONFIG_JFS_POSIX_ACL=y +CONFIG_JFS_SECURITY=y +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +CONFIG_XFS_EXPORT=y +# CONFIG_XFS_QUOTA is not set +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +# CONFIG_XFS_RT is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_INOTIFY=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +CONFIG_AUTOFS_FS=m +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_ZISOFS_FS=y +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_RAMFS=y +# CONFIG_RELAYFS_FS is not set + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_CRAMFS=y +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +# CONFIG_NFS_DIRECTIO is not set +CONFIG_NFSD=y +CONFIG_NFSD_V2_ACL=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V3_ACL=y +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_RPCSEC_GSS_KRB5=y +CONFIG_RPCSEC_GSS_SPKM3=m +# CONFIG_SMB_FS is not set +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +CONFIG_CIFS_XATTR=y +CONFIG_CIFS_POSIX=y +# CONFIG_CIFS_EXPERIMENTAL is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +# CONFIG_9P_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y + +# +# Native Language Support +# +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Profiling support +# +CONFIG_PROFILING=y +CONFIG_OPROFILE=y + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_DEBUG_KERNEL=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_LOG_BUF_SHIFT=17 +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_STACKOVERFLOW=y +# CONFIG_KPROBES is not set +CONFIG_DEBUG_STACK_USAGE=y +CONFIG_DEBUGGER=y +CONFIG_XMON=y +CONFIG_XMON_DEFAULT=y +# CONFIG_PPCDBG is not set +CONFIG_IRQSTACKS=y + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +CONFIG_CRYPTO=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_TEST=m + +# +# Hardware crypto devices +# + +# +# Library routines +# +CONFIG_CRC_CCITT=m +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m diff --git a/trunk/arch/powerpc/configs/ppc64_defconfig b/trunk/arch/ppc64/defconfig similarity index 86% rename from trunk/arch/powerpc/configs/ppc64_defconfig rename to trunk/arch/ppc64/defconfig index 509399eab6f5..e79fd60bc122 100644 --- a/trunk/arch/powerpc/configs/ppc64_defconfig +++ b/trunk/arch/ppc64/defconfig @@ -1,33 +1,18 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc5 -# Tue Dec 20 15:59:38 2005 +# Linux kernel version: 2.6.14-rc4 +# Thu Oct 20 08:28:33 2005 # -CONFIG_PPC64=y CONFIG_64BIT=y -CONFIG_PPC_MERGE=y CONFIG_MMU=y -CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_PPC=y +CONFIG_GENERIC_ISA_DMA=y CONFIG_EARLY_PRINTK=y CONFIG_COMPAT=y -CONFIG_SYSVIPC_COMPAT=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y - -# -# Processor support -# -# CONFIG_POWER4_ONLY is not set -CONFIG_POWER3=y -CONFIG_POWER4=y -CONFIG_PPC_FPU=y -CONFIG_ALTIVEC=y -CONFIG_PPC_STD_MMU=y -CONFIG_SMP=y -CONFIG_NR_CPUS=32 +CONFIG_FORCE_MAX_ZONEORDER=13 # # Code maturity level options @@ -54,10 +39,9 @@ CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_CPUSETS=y CONFIG_INITRAMFS_SOURCE="" -CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y -CONFIG_KALLSYMS_ALL=y +# CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_PRINTK=y CONFIG_BUG=y @@ -83,115 +67,78 @@ CONFIG_MODVERSIONS=y CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y - -# -# Block layer -# - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_AS=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_AS=y -# CONFIG_DEFAULT_DEADLINE is not set -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="anticipatory" +CONFIG_SYSVIPC_COMPAT=y # # Platform support # -CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_ISERIES is not set -# CONFIG_EMBEDDED6xx is not set -# CONFIG_APUS is not set +CONFIG_PPC_MULTIPLATFORM=y CONFIG_PPC_PSERIES=y +CONFIG_PPC_BPA=y CONFIG_PPC_PMAC=y -CONFIG_PPC_PMAC64=y CONFIG_PPC_MAPLE=y -# CONFIG_PPC_CELL is not set +CONFIG_PPC=y +CONFIG_PPC64=y CONFIG_PPC_OF=y CONFIG_XICS=y -CONFIG_U3_DART=y CONFIG_MPIC=y -CONFIG_PPC_RTAS=y -CONFIG_RTAS_ERROR_LOGGING=y -CONFIG_RTAS_PROC=y -CONFIG_RTAS_FLASH=m -# CONFIG_MMIO_NVRAM is not set -CONFIG_MPIC_BROKEN_U3=y +CONFIG_BPA_IIC=y +CONFIG_ALTIVEC=y +CONFIG_PPC_SPLPAR=y +CONFIG_KEXEC=y CONFIG_IBMVIO=y -# CONFIG_PPC_MPC106 is not set -CONFIG_GENERIC_TBSYNC=y -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_TABLE=y -# CONFIG_CPU_FREQ_DEBUG is not set -CONFIG_CPU_FREQ_STAT=y -# CONFIG_CPU_FREQ_STAT_DETAILS is not set -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=y -CONFIG_CPU_FREQ_GOV_USERSPACE=y -# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set -CONFIG_CPU_FREQ_PMAC64=y -# CONFIG_WANT_EARLY_SERIAL is not set - -# -# Kernel options -# -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -# CONFIG_PREEMPT_BKL is not set -CONFIG_BINFMT_ELF=y -CONFIG_BINFMT_MISC=m -CONFIG_FORCE_MAX_ZONEORDER=13 +CONFIG_U3_DART=y +CONFIG_MPIC_BROKEN_U3=y +CONFIG_PPC_PMAC64=y +CONFIG_BOOTX_TEXT=y +# CONFIG_POWER4_ONLY is not set CONFIG_IOMMU_VMERGE=y -CONFIG_HOTPLUG_CPU=y -CONFIG_KEXEC=y -CONFIG_IRQ_ALL_CPUS=y -CONFIG_PPC_SPLPAR=y -CONFIG_EEH=y -CONFIG_SCANLOG=m -CONFIG_LPARCFG=y -# CONFIG_NUMA is not set +CONFIG_SMP=y +CONFIG_NR_CPUS=32 CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_DISCONTIGMEM_ENABLE=y +CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_FLATMEM_MANUAL is not set -# CONFIG_DISCONTIGMEM_MANUAL is not set -CONFIG_SPARSEMEM_MANUAL=y -CONFIG_SPARSEMEM=y -CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_DISCONTIGMEM_MANUAL=y +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_DISCONTIGMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_NEED_MULTIPLE_NODES=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPARSEMEM_EXTREME=y -# CONFIG_MEMORY_HOTPLUG is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_PPC_64K_PAGES is not set +CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y +CONFIG_NODES_SPAN_OTHER_NODES=y +# CONFIG_NUMA is not set # CONFIG_SCHED_SMT is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_PREEMPT_BKL is not set +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=250 +CONFIG_EEH=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_PPC_RTAS=y +CONFIG_RTAS_PROC=y +CONFIG_RTAS_FLASH=m +CONFIG_SCANLOG=m +CONFIG_LPARCFG=y +CONFIG_SECCOMP=y +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=m +CONFIG_HOTPLUG_CPU=y CONFIG_PROC_DEVICETREE=y # CONFIG_CMDLINE_BOOL is not set -# CONFIG_PM is not set -CONFIG_SECCOMP=y CONFIG_ISA_DMA_API=y # -# Bus options +# Bus Options # -CONFIG_GENERIC_ISA_DMA=y -CONFIG_PPC_I8259=y -# CONFIG_PPC_INDIRECT_PCI is not set CONFIG_PCI=y CONFIG_PCI_DOMAINS=y # CONFIG_PCI_LEGACY_PROC is not set @@ -211,7 +158,6 @@ CONFIG_HOTPLUG_PCI=m # CONFIG_HOTPLUG_PCI_SHPC is not set CONFIG_HOTPLUG_PCI_RPA=m CONFIG_HOTPLUG_PCI_RPA_DLPAR=m -CONFIG_KERNEL_START=0xc000000000000000 # # Networking @@ -253,10 +199,6 @@ CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set - -# -# Core Netfilter Configuration -# CONFIG_NETFILTER_NETLINK=y CONFIG_NETFILTER_NETLINK_QUEUE=m CONFIG_NETFILTER_NETLINK_LOG=m @@ -359,10 +301,6 @@ CONFIG_LLC=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set - -# -# QoS and/or fair queueing -# # CONFIG_NET_SCHED is not set CONFIG_NET_CLS_ROUTE=y @@ -400,7 +338,13 @@ CONFIG_FW_LOADER=y # # Parallel port support # -# CONFIG_PARPORT is not set +CONFIG_PARPORT=m +CONFIG_PARPORT_PC=m +# CONFIG_PARPORT_SERIAL is not set +# CONFIG_PARPORT_PC_FIFO is not set +# CONFIG_PARPORT_PC_SUPERIO is not set +# CONFIG_PARPORT_GSC is not set +# CONFIG_PARPORT_1284 is not set # # Plug and Play support @@ -410,6 +354,7 @@ CONFIG_FW_LOADER=y # Block devices # CONFIG_BLK_DEV_FD=y +# CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set @@ -425,6 +370,14 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=65536 CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # @@ -454,7 +407,7 @@ 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_SL82C105 is not set +CONFIG_BLK_DEV_SL82C105=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y @@ -526,7 +479,6 @@ CONFIG_SCSI_ISCSI_ATTRS=m # # SCSI low-level drivers # -# CONFIG_ISCSI_TCP is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set @@ -543,12 +495,10 @@ CONFIG_SCSI_SATA_SVW=y # CONFIG_SCSI_ATA_PIIX is not set # CONFIG_SCSI_SATA_MV is not set # CONFIG_SCSI_SATA_NV is not set -# CONFIG_SCSI_PDC_ADMA is not set -# CONFIG_SCSI_SATA_QSTOR is not set # CONFIG_SCSI_SATA_PROMISE is not set +# CONFIG_SCSI_SATA_QSTOR is not set # CONFIG_SCSI_SATA_SX4 is not set # CONFIG_SCSI_SATA_SIL is not set -# CONFIG_SCSI_SATA_SIL24 is not set # CONFIG_SCSI_SATA_SIS is not set # CONFIG_SCSI_SATA_ULI is not set # CONFIG_SCSI_SATA_VIA is not set @@ -562,6 +512,8 @@ CONFIG_SCSI_SATA_SVW=y CONFIG_SCSI_IBMVSCSI=y # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_PPA is not set +# CONFIG_SCSI_IMM is not set CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 @@ -656,9 +608,6 @@ CONFIG_IEEE1394_AMDTP=m CONFIG_ADB_PMU=y CONFIG_PMAC_SMU=y CONFIG_THERM_PM72=y -CONFIG_WINDFARM=y -CONFIG_WINDFARM_PM81=y -CONFIG_WINDFARM_PM91=y # # Network device support @@ -715,6 +664,7 @@ CONFIG_E100=y # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_VIA_RHINE is not set +# CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) @@ -734,6 +684,7 @@ CONFIG_E1000=y # CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=y # CONFIG_BNX2 is not set +# CONFIG_SPIDER_NET is not set # CONFIG_MV643XX_ETH is not set # @@ -763,6 +714,7 @@ CONFIG_IBMOL=y # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set +# CONFIG_PLIP is not set CONFIG_PPP=m # CONFIG_PPP_MULTILINK is not set # CONFIG_PPP_FILTER is not set @@ -770,7 +722,6 @@ CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m -# CONFIG_PPP_MPPE is not set CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_NET_FC is not set @@ -833,6 +784,7 @@ CONFIG_INPUT_PCSPKR=m CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set +# CONFIG_SERIO_PARKBD is not set # CONFIG_SERIO_PCIPS2 is not set CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set @@ -865,6 +817,10 @@ CONFIG_SERIAL_JSM=m CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_PRINTER=m +# CONFIG_LP_CONSOLE is not set +# CONFIG_PPDEV is not set +# CONFIG_TIPAR is not set CONFIG_HVC_CONSOLE=y CONFIG_HVCS=m @@ -878,7 +834,6 @@ CONFIG_HVCS=m # # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set -# CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -896,7 +851,6 @@ CONFIG_MAX_RAW_DEVS=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -925,6 +879,7 @@ CONFIG_I2C_AMD8111=y CONFIG_I2C_KEYWEST=y CONFIG_I2C_PMAC_SMU=y # CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set @@ -949,7 +904,6 @@ CONFIG_I2C_PMAC_SMU=y # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -991,6 +945,7 @@ CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y CONFIG_FB_MACMODES=y CONFIG_FB_MODE_HELPERS=y CONFIG_FB_TILEBLITTING=y @@ -1005,7 +960,6 @@ CONFIG_FB_OF=y # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set -# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set CONFIG_FB_MATROX=y @@ -1029,6 +983,7 @@ CONFIG_FB_RADEON_I2C=y # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_CYBLA is not set # CONFIG_FB_TRIDENT is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -1037,7 +992,6 @@ CONFIG_FB_RADEON_I2C=y # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y @@ -1058,94 +1012,7 @@ CONFIG_LCD_DEVICE=y # # Sound # -CONFIG_SOUND=m - -# -# Advanced Linux Sound Architecture -# -CONFIG_SND=m -CONFIG_SND_TIMER=m -CONFIG_SND_PCM=m -CONFIG_SND_SEQUENCER=m -CONFIG_SND_SEQ_DUMMY=m -CONFIG_SND_OSSEMUL=y -CONFIG_SND_MIXER_OSS=m -CONFIG_SND_PCM_OSS=m -CONFIG_SND_SEQUENCER_OSS=y -# CONFIG_SND_VERBOSE_PRINTK is not set -# CONFIG_SND_DEBUG is not set -CONFIG_SND_GENERIC_DRIVER=y - -# -# Generic devices -# -# CONFIG_SND_DUMMY is not set -# CONFIG_SND_VIRMIDI is not set -# CONFIG_SND_MTPAV is not set -# CONFIG_SND_SERIAL_U16550 is not set -# CONFIG_SND_MPU401 is not set - -# -# PCI devices -# -# CONFIG_SND_ALI5451 is not set -# CONFIG_SND_ATIIXP is not set -# CONFIG_SND_ATIIXP_MODEM is not set -# CONFIG_SND_AU8810 is not set -# CONFIG_SND_AU8820 is not set -# CONFIG_SND_AU8830 is not set -# CONFIG_SND_AZT3328 is not set -# CONFIG_SND_BT87X is not set -# CONFIG_SND_CS46XX is not set -# CONFIG_SND_CS4281 is not set -# CONFIG_SND_EMU10K1 is not set -# CONFIG_SND_EMU10K1X is not set -# CONFIG_SND_CA0106 is not set -# CONFIG_SND_KORG1212 is not set -# CONFIG_SND_MIXART is not set -# CONFIG_SND_NM256 is not set -# CONFIG_SND_RME32 is not set -# CONFIG_SND_RME96 is not set -# CONFIG_SND_RME9652 is not set -# CONFIG_SND_HDSP is not set -# CONFIG_SND_HDSPM is not set -# CONFIG_SND_TRIDENT is not set -# CONFIG_SND_YMFPCI is not set -# CONFIG_SND_AD1889 is not set -# CONFIG_SND_ALS4000 is not set -# CONFIG_SND_CMIPCI is not set -# CONFIG_SND_ENS1370 is not set -# CONFIG_SND_ENS1371 is not set -# CONFIG_SND_ES1938 is not set -# CONFIG_SND_ES1968 is not set -# CONFIG_SND_MAESTRO3 is not set -# CONFIG_SND_FM801 is not set -# CONFIG_SND_ICE1712 is not set -# CONFIG_SND_ICE1724 is not set -# CONFIG_SND_INTEL8X0 is not set -# CONFIG_SND_INTEL8X0M is not set -# CONFIG_SND_SONICVIBES is not set -# CONFIG_SND_VIA82XX is not set -# CONFIG_SND_VIA82XX_MODEM is not set -# CONFIG_SND_VX222 is not set -# CONFIG_SND_HDA_INTEL is not set - -# -# ALSA PowerMac devices -# -CONFIG_SND_POWERMAC=m -CONFIG_SND_POWERMAC_AUTO_DRC=y - -# -# USB devices -# -# CONFIG_SND_USB_AUDIO is not set -# CONFIG_SND_USB_USX2Y is not set - -# -# Open Sound System -# -# CONFIG_SOUND_PRIME is not set +# CONFIG_SOUND is not set # # USB support @@ -1179,16 +1046,12 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y # # USB Device Class drivers # -# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set @@ -1243,7 +1106,7 @@ CONFIG_USB_HIDDEV=y # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set +CONFIG_USB_PEGASUS=y # CONFIG_USB_RTL8150 is not set # CONFIG_USB_USBNET is not set # CONFIG_USB_MON is not set @@ -1251,6 +1114,7 @@ CONFIG_USB_HIDDEV=y # # USB port drivers # +# CONFIG_USB_USS720 is not set # # USB Serial Converter support @@ -1299,7 +1163,6 @@ CONFIG_INFINIBAND_MTHCA=m # CONFIG_INFINIBAND_MTHCA_DEBUG is not set CONFIG_INFINIBAND_IPOIB=m # CONFIG_INFINIBAND_IPOIB_DEBUG is not set -# CONFIG_INFINIBAND_SRP is not set # # SN Devices @@ -1495,25 +1358,10 @@ CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m # -# Library routines -# -CONFIG_CRC_CCITT=m -# CONFIG_CRC16 is not set -CONFIG_CRC32=y -CONFIG_LIBCRC32C=m -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=m -CONFIG_TEXTSEARCH=y -CONFIG_TEXTSEARCH_KMP=m -CONFIG_TEXTSEARCH_BM=m -CONFIG_TEXTSEARCH_FSM=m - -# -# Instrumentation Support +# Profiling support # CONFIG_PROFILING=y CONFIG_OPROFILE=y -# CONFIG_KPROBES is not set # # Kernel hacking @@ -1530,15 +1378,14 @@ CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_FS=y -# CONFIG_DEBUG_VM is not set -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_DEBUG_STACKOVERFLOW=y +# CONFIG_KPROBES is not set CONFIG_DEBUG_STACK_USAGE=y CONFIG_DEBUGGER=y CONFIG_XMON=y # CONFIG_XMON_DEFAULT is not set +# CONFIG_PPCDBG is not set CONFIG_IRQSTACKS=y -CONFIG_BOOTX_TEXT=y # # Security options @@ -1578,3 +1425,17 @@ CONFIG_CRYPTO_TEST=m # # Hardware crypto devices # + +# +# Library routines +# +CONFIG_CRC_CCITT=m +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=m +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m diff --git a/trunk/arch/ppc64/kernel/Makefile b/trunk/arch/ppc64/kernel/Makefile new file mode 100644 index 000000000000..dac4cc20fa93 --- /dev/null +++ b/trunk/arch/ppc64/kernel/Makefile @@ -0,0 +1,46 @@ +# +# Makefile for the linux ppc64 kernel. +# + +ifneq ($(CONFIG_PPC_MERGE),y) + +EXTRA_CFLAGS += -mno-minimal-toc +extra-y := head.o vmlinux.lds + +obj-y := misc.o prom.o + +endif + +obj-y += idle.o dma.o \ + align.o \ + rtc.o \ + iommu.o + +pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o + +obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y) + +obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o +ifneq ($(CONFIG_PPC_MERGE),y) +obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o +endif + +obj-$(CONFIG_KEXEC) += machine_kexec.o +obj-$(CONFIG_MODULES) += module.o +ifneq ($(CONFIG_PPC_MERGE),y) +obj-$(CONFIG_MODULES) += ppc_ksyms.o +endif +obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o +ifneq ($(CONFIG_PPC_MERGE),y) +obj-$(CONFIG_BOOTX_TEXT) += btext.o +endif +obj-$(CONFIG_HVCS) += hvcserver.o + +obj-$(CONFIG_KPROBES) += kprobes.o + +ifneq ($(CONFIG_PPC_MERGE),y) +ifeq ($(CONFIG_PPC_ISERIES),y) +arch/ppc64/kernel/head.o: arch/powerpc/kernel/lparmap.s +AFLAGS_head.o += -Iarch/powerpc/kernel +endif +endif diff --git a/trunk/arch/powerpc/kernel/align.c b/trunk/arch/ppc64/kernel/align.c similarity index 51% rename from trunk/arch/powerpc/kernel/align.c rename to trunk/arch/ppc64/kernel/align.c index faaec9c6f78f..256d5b592aa1 100644 --- a/trunk/arch/powerpc/kernel/align.c +++ b/trunk/arch/ppc64/kernel/align.c @@ -7,9 +7,6 @@ * PowerPC 403GCX/405GP modifications. * Copyright (c) 2001-2002 PPC64 team, IBM Corp * 64-bit and Power4 support - * Copyright (c) 2005 Benjamin Herrenschmidt, IBM Corp - * - * Merge ppc32 and ppc64 implementations * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -41,15 +38,10 @@ struct aligninfo { #define F 8 /* to/from fp regs */ #define U 0x10 /* update index register */ #define M 0x20 /* multiple load/store */ -#define SW 0x40 /* byte swap int or ... */ -#define S 0x40 /* ... single-precision fp */ -#define SX 0x40 /* byte count in XER */ -#define HARD 0x80 /* string, stwcx. */ +#define SW 0x40 /* byte swap */ #define DCBZ 0x5f /* 8xx/82xx dcbz faults when cache not enabled */ -#define SWAP(a, b) (t = (a), (a) = (b), (b) = t) - /* * The PowerPC stores certain bits of the instruction that caused the * alignment exception in the DSISR register. This array maps those @@ -65,14 +57,14 @@ static struct aligninfo aligninfo[128] = { { 2, LD+SE }, /* 00 0 0101: lha */ { 2, ST }, /* 00 0 0110: sth */ { 4, LD+M }, /* 00 0 0111: lmw */ - { 4, LD+F+S }, /* 00 0 1000: lfs */ + { 4, LD+F }, /* 00 0 1000: lfs */ { 8, LD+F }, /* 00 0 1001: lfd */ - { 4, ST+F+S }, /* 00 0 1010: stfs */ + { 4, ST+F }, /* 00 0 1010: stfs */ { 8, ST+F }, /* 00 0 1011: stfd */ INVALID, /* 00 0 1100 */ - { 8, LD }, /* 00 0 1101: ld/ldu/lwa */ + { 8, LD }, /* 00 0 1101: ld */ INVALID, /* 00 0 1110 */ - { 8, ST }, /* 00 0 1111: std/stdu */ + { 8, ST }, /* 00 0 1111: std */ { 4, LD+U }, /* 00 1 0000: lwzu */ INVALID, /* 00 1 0001 */ { 4, ST+U }, /* 00 1 0010: stwu */ @@ -81,9 +73,9 @@ static struct aligninfo aligninfo[128] = { { 2, LD+SE+U }, /* 00 1 0101: lhau */ { 2, ST+U }, /* 00 1 0110: sthu */ { 4, ST+M }, /* 00 1 0111: stmw */ - { 4, LD+F+S+U }, /* 00 1 1000: lfsu */ + { 4, LD+F+U }, /* 00 1 1000: lfsu */ { 8, LD+F+U }, /* 00 1 1001: lfdu */ - { 4, ST+F+S+U }, /* 00 1 1010: stfsu */ + { 4, ST+F+U }, /* 00 1 1010: stfsu */ { 8, ST+F+U }, /* 00 1 1011: stfdu */ INVALID, /* 00 1 1100 */ INVALID, /* 00 1 1101 */ @@ -97,10 +89,10 @@ static struct aligninfo aligninfo[128] = { { 4, LD+SE }, /* 01 0 0101: lwax */ INVALID, /* 01 0 0110 */ INVALID, /* 01 0 0111 */ - { 4, LD+M+HARD+SX }, /* 01 0 1000: lswx */ - { 4, LD+M+HARD }, /* 01 0 1001: lswi */ - { 4, ST+M+HARD+SX }, /* 01 0 1010: stswx */ - { 4, ST+M+HARD }, /* 01 0 1011: stswi */ + { 0, LD }, /* 01 0 1000: lswx */ + { 0, LD }, /* 01 0 1001: lswi */ + { 0, ST }, /* 01 0 1010: stswx */ + { 0, ST }, /* 01 0 1011: stswi */ INVALID, /* 01 0 1100 */ { 8, LD+U }, /* 01 0 1101: ldu */ INVALID, /* 01 0 1110 */ @@ -123,7 +115,7 @@ static struct aligninfo aligninfo[128] = { INVALID, /* 01 1 1111 */ INVALID, /* 10 0 0000 */ INVALID, /* 10 0 0001 */ - INVALID, /* 10 0 0010: stwcx. */ + { 0, ST }, /* 10 0 0010: stwcx. */ INVALID, /* 10 0 0011 */ INVALID, /* 10 0 0100 */ INVALID, /* 10 0 0101 */ @@ -152,7 +144,7 @@ static struct aligninfo aligninfo[128] = { INVALID, /* 10 1 1100 */ INVALID, /* 10 1 1101 */ INVALID, /* 10 1 1110 */ - { 0, ST+HARD }, /* 10 1 1111: dcbz */ + { L1_CACHE_BYTES, ST }, /* 10 1 1111: dcbz */ { 4, LD }, /* 11 0 0000: lwzx */ INVALID, /* 11 0 0001 */ { 4, ST }, /* 11 0 0010: stwx */ @@ -161,9 +153,9 @@ static struct aligninfo aligninfo[128] = { { 2, LD+SE }, /* 11 0 0101: lhax */ { 2, ST }, /* 11 0 0110: sthx */ INVALID, /* 11 0 0111 */ - { 4, LD+F+S }, /* 11 0 1000: lfsx */ + { 4, LD+F }, /* 11 0 1000: lfsx */ { 8, LD+F }, /* 11 0 1001: lfdx */ - { 4, ST+F+S }, /* 11 0 1010: stfsx */ + { 4, ST+F }, /* 11 0 1010: stfsx */ { 8, ST+F }, /* 11 0 1011: stfdx */ INVALID, /* 11 0 1100 */ { 8, LD+M }, /* 11 0 1101: lmd */ @@ -177,9 +169,9 @@ static struct aligninfo aligninfo[128] = { { 2, LD+SE+U }, /* 11 1 0101: lhaux */ { 2, ST+U }, /* 11 1 0110: sthux */ INVALID, /* 11 1 0111 */ - { 4, LD+F+S+U }, /* 11 1 1000: lfsux */ + { 4, LD+F+U }, /* 11 1 1000: lfsux */ { 8, LD+F+U }, /* 11 1 1001: lfdux */ - { 4, ST+F+S+U }, /* 11 1 1010: stfsux */ + { 4, ST+F+U }, /* 11 1 1010: stfsux */ { 8, ST+F+U }, /* 11 1 1011: stfdux */ INVALID, /* 11 1 1100 */ INVALID, /* 11 1 1101 */ @@ -187,175 +179,45 @@ static struct aligninfo aligninfo[128] = { INVALID, /* 11 1 1111 */ }; -/* - * Create a DSISR value from the instruction - */ +#define SWAP(a, b) (t = (a), (a) = (b), (b) = t) + static inline unsigned make_dsisr(unsigned instr) { unsigned dsisr; - - - /* bits 6:15 --> 22:31 */ - dsisr = (instr & 0x03ff0000) >> 16; - - if (IS_XFORM(instr)) { - /* bits 29:30 --> 15:16 */ - dsisr |= (instr & 0x00000006) << 14; - /* bit 25 --> 17 */ - dsisr |= (instr & 0x00000040) << 8; - /* bits 21:24 --> 18:21 */ - dsisr |= (instr & 0x00000780) << 3; - } else { - /* bit 5 --> 17 */ - dsisr |= (instr & 0x04000000) >> 12; - /* bits 1: 4 --> 18:21 */ - dsisr |= (instr & 0x78000000) >> 17; - /* bits 30:31 --> 12:13 */ - if (IS_DSFORM(instr)) - dsisr |= (instr & 0x00000003) << 18; + + /* create a DSISR value from the instruction */ + dsisr = (instr & 0x03ff0000) >> 16; /* bits 6:15 --> 22:31 */ + + if ( IS_XFORM(instr) ) { + dsisr |= (instr & 0x00000006) << 14; /* bits 29:30 --> 15:16 */ + dsisr |= (instr & 0x00000040) << 8; /* bit 25 --> 17 */ + dsisr |= (instr & 0x00000780) << 3; /* bits 21:24 --> 18:21 */ } - - return dsisr; -} - -/* - * The dcbz (data cache block zero) instruction - * gives an alignment fault if used on non-cacheable - * memory. We handle the fault mainly for the - * case when we are running with the cache disabled - * for debugging. - */ -static int emulate_dcbz(struct pt_regs *regs, unsigned char __user *addr) -{ - long __user *p; - int i, size; - -#ifdef __powerpc64__ - size = ppc64_caches.dline_size; -#else - size = L1_CACHE_BYTES; -#endif - p = (long __user *) (regs->dar & -size); - if (user_mode(regs) && !access_ok(VERIFY_WRITE, p, size)) - return -EFAULT; - for (i = 0; i < size / sizeof(long); ++i) - if (__put_user(0, p+i)) - return -EFAULT; - return 1; -} - -/* - * Emulate load & store multiple instructions - * On 64-bit machines, these instructions only affect/use the - * bottom 4 bytes of each register, and the loads clear the - * top 4 bytes of the affected register. - */ -#ifdef CONFIG_PPC64 -#define REG_BYTE(rp, i) *((u8 *)((rp) + ((i) >> 2)) + ((i) & 3) + 4) -#else -#define REG_BYTE(rp, i) *((u8 *)(rp) + (i)) -#endif - -static int emulate_multiple(struct pt_regs *regs, unsigned char __user *addr, - unsigned int reg, unsigned int nb, - unsigned int flags, unsigned int instr) -{ - unsigned long *rptr; - unsigned int nb0, i; - - /* - * We do not try to emulate 8 bytes multiple as they aren't really - * available in our operating environments and we don't try to - * emulate multiples operations in kernel land as they should never - * be used/generated there at least not on unaligned boundaries - */ - if (unlikely((nb > 4) || !user_mode(regs))) - return 0; - - /* lmw, stmw, lswi/x, stswi/x */ - nb0 = 0; - if (flags & HARD) { - if (flags & SX) { - nb = regs->xer & 127; - if (nb == 0) - return 1; - } else { - if (__get_user(instr, - (unsigned int __user *)regs->nip)) - return -EFAULT; - nb = (instr >> 11) & 0x1f; - if (nb == 0) - nb = 32; + else { + dsisr |= (instr & 0x04000000) >> 12; /* bit 5 --> 17 */ + dsisr |= (instr & 0x78000000) >> 17; /* bits 1: 4 --> 18:21 */ + if ( IS_DSFORM(instr) ) { + dsisr |= (instr & 0x00000003) << 18; /* bits 30:31 --> 12:13 */ } - if (nb + reg * 4 > 128) { - nb0 = nb + reg * 4 - 128; - nb = 128 - reg * 4; - } - } else { - /* lwm, stmw */ - nb = (32 - reg) * 4; } - - if (!access_ok((flags & ST ? VERIFY_WRITE: VERIFY_READ), addr, nb+nb0)) - return -EFAULT; /* bad address */ - - rptr = ®s->gpr[reg]; - if (flags & LD) { - /* - * This zeroes the top 4 bytes of the affected registers - * in 64-bit mode, and also zeroes out any remaining - * bytes of the last register for lsw*. - */ - memset(rptr, 0, ((nb + 3) / 4) * sizeof(unsigned long)); - if (nb0 > 0) - memset(®s->gpr[0], 0, - ((nb0 + 3) / 4) * sizeof(unsigned long)); - - for (i = 0; i < nb; ++i) - if (__get_user(REG_BYTE(rptr, i), addr + i)) - return -EFAULT; - if (nb0 > 0) { - rptr = ®s->gpr[0]; - addr += nb; - for (i = 0; i < nb0; ++i) - if (__get_user(REG_BYTE(rptr, i), addr + i)) - return -EFAULT; - } - - } else { - for (i = 0; i < nb; ++i) - if (__put_user(REG_BYTE(rptr, i), addr + i)) - return -EFAULT; - if (nb0 > 0) { - rptr = ®s->gpr[0]; - addr += nb; - for (i = 0; i < nb0; ++i) - if (__put_user(REG_BYTE(rptr, i), addr + i)) - return -EFAULT; - } - } - return 1; + + return dsisr; } - -/* - * Called on alignment exception. Attempts to fixup - * - * Return 1 on success - * Return 0 if unable to handle the interrupt - * Return -EFAULT if data address is bad - */ - -int fix_alignment(struct pt_regs *regs) +int +fix_alignment(struct pt_regs *regs) { unsigned int instr, nb, flags; - unsigned int reg, areg; - unsigned int dsisr; + int t; + unsigned long reg, areg; + unsigned long i; + int ret; + unsigned dsisr; unsigned char __user *addr; unsigned char __user *p; - int ret, t; + unsigned long __user *lp; union { - u64 ll; + long ll; double dd; unsigned char v[8]; struct { @@ -369,22 +231,18 @@ int fix_alignment(struct pt_regs *regs) } data; /* - * We require a complete register set, if not, then our assembly - * is broken + * Return 1 on success + * Return 0 if unable to handle the interrupt + * Return -EFAULT if data address is bad */ - CHECK_FULL_REGS(regs); dsisr = regs->dsisr; - /* Some processors don't provide us with a DSISR we can use here, - * let's make one up from the instruction - */ if (cpu_has_feature(CPU_FTR_NODSISRALIGN)) { - unsigned int real_instr; - if (unlikely(__get_user(real_instr, - (unsigned int __user *)regs->nip))) - return -EFAULT; - dsisr = make_dsisr(real_instr); + unsigned int real_instr; + if (__get_user(real_instr, (unsigned int __user *)regs->nip)) + return 0; + dsisr = make_dsisr(real_instr); } /* extract the operation and registers from the dsisr */ @@ -400,37 +258,33 @@ int fix_alignment(struct pt_regs *regs) /* DAR has the operand effective address */ addr = (unsigned char __user *)regs->dar; - /* A size of 0 indicates an instruction we don't support, with - * the exception of DCBZ which is handled as a special case here - */ - if (instr == DCBZ) - return emulate_dcbz(regs, addr); - if (unlikely(nb == 0)) - return 0; + /* A size of 0 indicates an instruction we don't support */ + /* we also don't support the multiples (lmw, stmw, lmd, stmd) */ + if ((nb == 0) || (flags & M)) + return 0; /* too hard or invalid instruction */ - /* Load/Store Multiple instructions are handled in their own - * function + /* + * Special handling for dcbz + * dcbz may give an alignment exception for accesses to caching inhibited + * storage */ - if (flags & M) - return emulate_multiple(regs, addr, reg, nb, flags, instr); + if (instr == DCBZ) + addr = (unsigned char __user *) ((unsigned long)addr & -L1_CACHE_BYTES); /* Verify the address of the operand */ - if (unlikely(user_mode(regs) && - !access_ok((flags & ST ? VERIFY_WRITE : VERIFY_READ), - addr, nb))) - return -EFAULT; + if (user_mode(regs)) { + if (!access_ok((flags & ST? VERIFY_WRITE: VERIFY_READ), addr, nb)) + return -EFAULT; /* bad address */ + } /* Force the fprs into the save area so we can reference them */ if (flags & F) { - /* userland only */ - if (unlikely(!user_mode(regs))) + if (!user_mode(regs)) return 0; flush_fp_to_thread(current); } - - /* If we are loading, get the data from user space, else - * get it from register values - */ + + /* If we are loading, get the data from user space */ if (flags & LD) { data.ll = 0; ret = 0; @@ -447,62 +301,75 @@ int fix_alignment(struct pt_regs *regs) case 2: ret |= __get_user(data.v[6], p++); ret |= __get_user(data.v[7], p++); - if (unlikely(ret)) + if (ret) return -EFAULT; } - } else if (flags & F) - data.dd = current->thread.fpr[reg]; - else - data.ll = regs->gpr[reg]; - - /* Perform other misc operations like sign extension, byteswap, - * or floating point single precision conversion - */ - switch (flags & ~U) { - case LD+SE: /* sign extend */ + } + + /* If we are storing, get the data from the saved gpr or fpr */ + if (flags & ST) { + if (flags & F) { + if (nb == 4) { + /* Doing stfs, have to convert to single */ + preempt_disable(); + enable_kernel_fp(); + cvt_df(¤t->thread.fpr[reg], (float *)&data.v[4], ¤t->thread); + disable_kernel_fp(); + preempt_enable(); + } + else + data.dd = current->thread.fpr[reg]; + } + else + data.ll = regs->gpr[reg]; + } + + /* Swap bytes as needed */ + if (flags & SW) { + if (nb == 2) + SWAP(data.v[6], data.v[7]); + else { /* nb must be 4 */ + SWAP(data.v[4], data.v[7]); + SWAP(data.v[5], data.v[6]); + } + } + + /* Sign extend as needed */ + if (flags & SE) { if ( nb == 2 ) data.ll = data.x16.low16; else /* nb must be 4 */ data.ll = data.x32.low32; - break; - case LD+S: /* byte-swap */ - case ST+S: - if (nb == 2) { - SWAP(data.v[6], data.v[7]); - } else { - SWAP(data.v[4], data.v[7]); - SWAP(data.v[5], data.v[6]); + } + + /* If we are loading, move the data to the gpr or fpr */ + if (flags & LD) { + if (flags & F) { + if (nb == 4) { + /* Doing lfs, have to convert to double */ + preempt_disable(); + enable_kernel_fp(); + cvt_fd((float *)&data.v[4], ¤t->thread.fpr[reg], ¤t->thread); + disable_kernel_fp(); + preempt_enable(); + } + else + current->thread.fpr[reg] = data.dd; } - break; - - /* Single-precision FP load and store require conversions... */ - case LD+F+S: -#ifdef CONFIG_PPC_FPU - preempt_disable(); - enable_kernel_fp(); - cvt_fd((float *)&data.v[4], &data.dd, ¤t->thread); - preempt_enable(); -#else - return 0; -#endif - break; - case ST+F+S: -#ifdef CONFIG_PPC_FPU - preempt_disable(); - enable_kernel_fp(); - cvt_df(&data.dd, (float *)&data.v[4], ¤t->thread); - preempt_enable(); -#else - return 0; -#endif - break; + else + regs->gpr[reg] = data.ll; } - - /* Store result to memory or update registers */ + + /* If we are storing, copy the data to the user */ if (flags & ST) { ret = 0; p = addr; switch (nb) { + case 128: /* Special case - must be dcbz */ + lp = (unsigned long __user *)p; + for (i = 0; i < L1_CACHE_BYTES / sizeof(long); ++i) + ret |= __put_user(0, lp++); + break; case 8: ret |= __put_user(data.v[0], p++); ret |= __put_user(data.v[1], p++); @@ -515,16 +382,15 @@ int fix_alignment(struct pt_regs *regs) ret |= __put_user(data.v[6], p++); ret |= __put_user(data.v[7], p++); } - if (unlikely(ret)) + if (ret) return -EFAULT; - } else if (flags & F) - current->thread.fpr[reg] = data.dd; - else - regs->gpr[reg] = data.ll; - + } + /* Update RA as needed */ - if (flags & U) + if (flags & U) { regs->gpr[areg] = regs->dar; + } return 1; } + diff --git a/trunk/arch/ppc64/kernel/asm-offsets.c b/trunk/arch/ppc64/kernel/asm-offsets.c new file mode 100644 index 000000000000..84ab5c18ef52 --- /dev/null +++ b/trunk/arch/ppc64/kernel/asm-offsets.c @@ -0,0 +1,195 @@ +/* + * This program is used to generate definitions needed by + * assembly language modules. + * + * We use the technique used in the OSF Mach kernel code: + * generate asm statements containing #defines, + * compile this file to assembler, and then extract the + * #defines from the assembly-language output. + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +int main(void) +{ + /* thread struct on stack */ + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); + DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror)); + + /* task_struct->thread */ + DEFINE(THREAD, offsetof(struct task_struct, thread)); + DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); + DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode)); + DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0])); + DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr)); + DEFINE(KSP, offsetof(struct thread_struct, ksp)); + DEFINE(KSP_VSID, offsetof(struct thread_struct, ksp_vsid)); + +#ifdef CONFIG_ALTIVEC + DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0])); + DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave)); + DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr)); + DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr)); +#endif /* CONFIG_ALTIVEC */ + DEFINE(MM, offsetof(struct task_struct, mm)); + DEFINE(AUDITCONTEXT, offsetof(struct task_struct, audit_context)); + + DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size)); + DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_dline_size)); + DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, dlines_per_page)); + DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size)); + DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size)); + DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page)); + DEFINE(PLATFORM_LPAR, PLATFORM_LPAR); + + /* paca */ + DEFINE(PACA_SIZE, sizeof(struct paca_struct)); + DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index)); + DEFINE(PACAPROCSTART, offsetof(struct paca_struct, cpu_start)); + DEFINE(PACAKSAVE, offsetof(struct paca_struct, kstack)); + DEFINE(PACACURRENT, offsetof(struct paca_struct, __current)); + DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, saved_msr)); + DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real)); + DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr)); + DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr)); + DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1)); + DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc)); + DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, proc_enabled)); + DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache)); + DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr)); + DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id)); +#ifdef CONFIG_PPC_64K_PAGES + DEFINE(PACAPGDIR, offsetof(struct paca_struct, pgdir)); +#endif +#ifdef CONFIG_HUGETLB_PAGE + DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas)); + DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas)); +#endif /* CONFIG_HUGETLB_PAGE */ + DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr)); + DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen)); + DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc)); + DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb)); + DEFINE(PACA_EXDSI, offsetof(struct paca_struct, exdsi)); + DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp)); + DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca)); + DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id)); + DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0)); + DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1)); + DEFINE(LPPACAANYINT, offsetof(struct lppaca, int_dword.any_int)); + DEFINE(LPPACADECRINT, offsetof(struct lppaca, int_dword.fields.decr_int)); + + /* RTAS */ + DEFINE(RTASBASE, offsetof(struct rtas_t, base)); + DEFINE(RTASENTRY, offsetof(struct rtas_t, entry)); + + /* Interrupt register frame */ + DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD); + + DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); + + /* 288 = # of volatile regs, int & fp, for leaf routines */ + /* which do not stack a frame. See the PPC64 ABI. */ + DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 288); + /* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */ + DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); + DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); + DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0])); + DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1])); + DEFINE(GPR2, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[2])); + DEFINE(GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[3])); + DEFINE(GPR4, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[4])); + DEFINE(GPR5, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[5])); + DEFINE(GPR6, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[6])); + DEFINE(GPR7, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[7])); + DEFINE(GPR8, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[8])); + DEFINE(GPR9, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[9])); + DEFINE(GPR10, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[10])); + DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11])); + DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12])); + DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13])); + /* + * Note: these symbols include _ because they overlap with special + * register names + */ + DEFINE(_NIP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, nip)); + DEFINE(_MSR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, msr)); + DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr)); + DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link)); + DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr)); + DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer)); + DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar)); + DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); + DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3)); + DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result)); + DEFINE(_TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); + DEFINE(SOFTE, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, softe)); + + /* These _only_ to be used with {PROM,RTAS}_FRAME_SIZE!!! */ + DEFINE(_SRR0, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)); + DEFINE(_SRR1, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)+8); + + DEFINE(CLONE_VM, CLONE_VM); + DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); + + /* About the CPU features table */ + DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec)); + DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask)); + DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value)); + DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); + DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); + + /* systemcfg offsets for use by vdso */ + DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct systemcfg, tb_orig_stamp)); + DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct systemcfg, tb_ticks_per_sec)); + DEFINE(CFG_TB_TO_XS, offsetof(struct systemcfg, tb_to_xs)); + DEFINE(CFG_STAMP_XSEC, offsetof(struct systemcfg, stamp_xsec)); + DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct systemcfg, tb_update_count)); + DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct systemcfg, tz_minuteswest)); + DEFINE(CFG_TZ_DSTTIME, offsetof(struct systemcfg, tz_dsttime)); + DEFINE(CFG_SYSCALL_MAP32, offsetof(struct systemcfg, syscall_map_32)); + DEFINE(CFG_SYSCALL_MAP64, offsetof(struct systemcfg, syscall_map_64)); + + /* timeval/timezone offsets for use by vdso */ + DEFINE(TVAL64_TV_SEC, offsetof(struct timeval, tv_sec)); + DEFINE(TVAL64_TV_USEC, offsetof(struct timeval, tv_usec)); + DEFINE(TVAL32_TV_SEC, offsetof(struct compat_timeval, tv_sec)); + DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec)); + DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest)); + DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime)); + + return 0; +} diff --git a/trunk/arch/ppc64/kernel/btext.c b/trunk/arch/ppc64/kernel/btext.c new file mode 100644 index 000000000000..506a37885c5c --- /dev/null +++ b/trunk/arch/ppc64/kernel/btext.c @@ -0,0 +1,792 @@ +/* + * Procedures for drawing on the screen early on in the boot process. + * + * Benjamin Herrenschmidt + */ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#undef NO_SCROLL + +#ifndef NO_SCROLL +static void scrollscreen(void); +#endif + +static void draw_byte(unsigned char c, long locX, long locY); +static void draw_byte_32(unsigned char *bits, unsigned int *base, int rb); +static void draw_byte_16(unsigned char *bits, unsigned int *base, int rb); +static void draw_byte_8(unsigned char *bits, unsigned int *base, int rb); + +static int g_loc_X; +static int g_loc_Y; +static int g_max_loc_X; +static int g_max_loc_Y; + +static int dispDeviceRowBytes; +static int dispDeviceDepth; +static int dispDeviceRect[4]; +static unsigned char *dispDeviceBase, *logicalDisplayBase; + +unsigned long disp_BAT[2] __initdata = {0, 0}; + +#define cmapsz (16*256) + +static unsigned char vga_font[cmapsz]; + +int boot_text_mapped; +int force_printk_to_btext = 0; + + +/* Here's a small text engine to use during early boot + * or for debugging purposes + * + * todo: + * + * - build some kind of vgacon with it to enable early printk + * - move to a separate file + * - add a few video driver hooks to keep in sync with display + * changes. + */ + +void map_boot_text(void) +{ + unsigned long base, offset, size; + unsigned char *vbase; + + /* By default, we are no longer mapped */ + boot_text_mapped = 0; + if (dispDeviceBase == 0) + return; + base = ((unsigned long) dispDeviceBase) & 0xFFFFF000UL; + offset = ((unsigned long) dispDeviceBase) - base; + size = dispDeviceRowBytes * dispDeviceRect[3] + offset + + dispDeviceRect[0]; + vbase = __ioremap(base, size, _PAGE_NO_CACHE); + if (vbase == 0) + return; + logicalDisplayBase = vbase + offset; + boot_text_mapped = 1; +} + +int btext_initialize(struct device_node *np) +{ + unsigned int width, height, depth, pitch; + unsigned long address = 0; + u32 *prop; + + prop = (u32 *)get_property(np, "width", NULL); + if (prop == NULL) + return -EINVAL; + width = *prop; + prop = (u32 *)get_property(np, "height", NULL); + if (prop == NULL) + return -EINVAL; + height = *prop; + prop = (u32 *)get_property(np, "depth", NULL); + if (prop == NULL) + return -EINVAL; + depth = *prop; + pitch = width * ((depth + 7) / 8); + prop = (u32 *)get_property(np, "linebytes", NULL); + if (prop) + pitch = *prop; + if (pitch == 1) + pitch = 0x1000; + prop = (u32 *)get_property(np, "address", NULL); + if (prop) + address = *prop; + + /* FIXME: Add support for PCI reg properties */ + + if (address == 0) + return -EINVAL; + + g_loc_X = 0; + g_loc_Y = 0; + g_max_loc_X = width / 8; + g_max_loc_Y = height / 16; + logicalDisplayBase = (unsigned char *)address; + dispDeviceBase = (unsigned char *)address; + dispDeviceRowBytes = pitch; + dispDeviceDepth = depth; + dispDeviceRect[0] = dispDeviceRect[1] = 0; + dispDeviceRect[2] = width; + dispDeviceRect[3] = height; + + map_boot_text(); + + return 0; +} + +static void btext_putc(unsigned char c) +{ + btext_drawchar(c); +} + +void __init init_boot_display(void) +{ + char *name; + struct device_node *np = NULL; + int rc = -ENODEV; + + printk("trying to initialize btext ...\n"); + + name = (char *)get_property(of_chosen, "linux,stdout-path", NULL); + if (name != NULL) { + np = of_find_node_by_path(name); + if (np != NULL) { + if (strcmp(np->type, "display") != 0) { + printk("boot stdout isn't a display !\n"); + of_node_put(np); + np = NULL; + } + } + } + if (np) + rc = btext_initialize(np); + if (rc) { + for (np = NULL; (np = of_find_node_by_type(np, "display"));) { + if (get_property(np, "linux,opened", NULL)) { + printk("trying %s ...\n", np->full_name); + rc = btext_initialize(np); + printk("result: %d\n", rc); + } + if (rc == 0) + break; + } + } + if (rc == 0 && udbg_putc == NULL) + udbg_putc = btext_putc; +} + + +/* Calc the base address of a given point (x,y) */ +static unsigned char * calc_base(int x, int y) +{ + unsigned char *base; + + base = logicalDisplayBase; + if (base == 0) + base = dispDeviceBase; + base += (x + dispDeviceRect[0]) * (dispDeviceDepth >> 3); + base += (y + dispDeviceRect[1]) * dispDeviceRowBytes; + return base; +} + +/* Adjust the display to a new resolution */ +void btext_update_display(unsigned long phys, int width, int height, + int depth, int pitch) +{ + if (dispDeviceBase == 0) + return; + + /* check it's the same frame buffer (within 256MB) */ + if ((phys ^ (unsigned long)dispDeviceBase) & 0xf0000000) + return; + + dispDeviceBase = (__u8 *) phys; + dispDeviceRect[0] = 0; + dispDeviceRect[1] = 0; + dispDeviceRect[2] = width; + dispDeviceRect[3] = height; + dispDeviceDepth = depth; + dispDeviceRowBytes = pitch; + if (boot_text_mapped) { + iounmap(logicalDisplayBase); + boot_text_mapped = 0; + } + map_boot_text(); + g_loc_X = 0; + g_loc_Y = 0; + g_max_loc_X = width / 8; + g_max_loc_Y = height / 16; +} + +void btext_clearscreen(void) +{ + unsigned long *base = (unsigned long *)calc_base(0, 0); + unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) * + (dispDeviceDepth >> 3)) >> 3; + int i,j; + + for (i=0; i<(dispDeviceRect[3] - dispDeviceRect[1]); i++) + { + unsigned long *ptr = base; + for(j=width; j; --j) + *(ptr++) = 0; + base += (dispDeviceRowBytes >> 3); + } +} + +#ifndef NO_SCROLL +static void scrollscreen(void) +{ + unsigned long *src = (unsigned long *)calc_base(0,16); + unsigned long *dst = (unsigned long *)calc_base(0,0); + unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) * + (dispDeviceDepth >> 3)) >> 3; + int i,j; + + for (i=0; i<(dispDeviceRect[3] - dispDeviceRect[1] - 16); i++) + { + unsigned long *src_ptr = src; + unsigned long *dst_ptr = dst; + for(j=width; j; --j) + *(dst_ptr++) = *(src_ptr++); + src += (dispDeviceRowBytes >> 3); + dst += (dispDeviceRowBytes >> 3); + } + for (i=0; i<16; i++) + { + unsigned long *dst_ptr = dst; + for(j=width; j; --j) + *(dst_ptr++) = 0; + dst += (dispDeviceRowBytes >> 3); + } +} +#endif /* ndef NO_SCROLL */ + +void btext_drawchar(char c) +{ + int cline = 0; +#ifdef NO_SCROLL + int x; +#endif + if (!boot_text_mapped) + return; + + switch (c) { + case '\b': + if (g_loc_X > 0) + --g_loc_X; + break; + case '\t': + g_loc_X = (g_loc_X & -8) + 8; + break; + case '\r': + g_loc_X = 0; + break; + case '\n': + g_loc_X = 0; + g_loc_Y++; + cline = 1; + break; + default: + draw_byte(c, g_loc_X++, g_loc_Y); + } + if (g_loc_X >= g_max_loc_X) { + g_loc_X = 0; + g_loc_Y++; + cline = 1; + } +#ifndef NO_SCROLL + while (g_loc_Y >= g_max_loc_Y) { + scrollscreen(); + g_loc_Y--; + } +#else + /* wrap around from bottom to top of screen so we don't + waste time scrolling each line. -- paulus. */ + if (g_loc_Y >= g_max_loc_Y) + g_loc_Y = 0; + if (cline) { + for (x = 0; x < g_max_loc_X; ++x) + draw_byte(' ', x, g_loc_Y); + } +#endif +} + +void btext_drawstring(const char *c) +{ + if (!boot_text_mapped) + return; + while (*c) + btext_drawchar(*c++); +} + +void btext_drawhex(unsigned long v) +{ + char *hex_table = "0123456789abcdef"; + + if (!boot_text_mapped) + return; + btext_drawchar(hex_table[(v >> 60) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 56) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 52) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 48) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 44) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 40) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 36) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 32) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 28) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 24) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 20) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 16) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 12) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 8) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 4) & 0x0000000FUL]); + btext_drawchar(hex_table[(v >> 0) & 0x0000000FUL]); + btext_drawchar(' '); +} + +static void draw_byte(unsigned char c, long locX, long locY) +{ + unsigned char *base = calc_base(locX << 3, locY << 4); + unsigned char *font = &vga_font[((unsigned int)c) * 16]; + int rb = dispDeviceRowBytes; + + switch(dispDeviceDepth) { + case 24: + case 32: + draw_byte_32(font, (unsigned int *)base, rb); + break; + case 15: + case 16: + draw_byte_16(font, (unsigned int *)base, rb); + break; + case 8: + draw_byte_8(font, (unsigned int *)base, rb); + break; + } +} + +static unsigned int expand_bits_8[16] = { + 0x00000000, + 0x000000ff, + 0x0000ff00, + 0x0000ffff, + 0x00ff0000, + 0x00ff00ff, + 0x00ffff00, + 0x00ffffff, + 0xff000000, + 0xff0000ff, + 0xff00ff00, + 0xff00ffff, + 0xffff0000, + 0xffff00ff, + 0xffffff00, + 0xffffffff +}; + +static unsigned int expand_bits_16[4] = { + 0x00000000, + 0x0000ffff, + 0xffff0000, + 0xffffffff +}; + + +static void draw_byte_32(unsigned char *font, unsigned int *base, int rb) +{ + int l, bits; + int fg = 0xFFFFFFFFUL; + int bg = 0x00000000UL; + + for (l = 0; l < 16; ++l) + { + bits = *font++; + base[0] = (-(bits >> 7) & fg) ^ bg; + base[1] = (-((bits >> 6) & 1) & fg) ^ bg; + base[2] = (-((bits >> 5) & 1) & fg) ^ bg; + base[3] = (-((bits >> 4) & 1) & fg) ^ bg; + base[4] = (-((bits >> 3) & 1) & fg) ^ bg; + base[5] = (-((bits >> 2) & 1) & fg) ^ bg; + base[6] = (-((bits >> 1) & 1) & fg) ^ bg; + base[7] = (-(bits & 1) & fg) ^ bg; + base = (unsigned int *) ((char *)base + rb); + } +} + +static void draw_byte_16(unsigned char *font, unsigned int *base, int rb) +{ + int l, bits; + int fg = 0xFFFFFFFFUL; + int bg = 0x00000000UL; + unsigned int *eb = (int *)expand_bits_16; + + for (l = 0; l < 16; ++l) + { + bits = *font++; + base[0] = (eb[bits >> 6] & fg) ^ bg; + base[1] = (eb[(bits >> 4) & 3] & fg) ^ bg; + base[2] = (eb[(bits >> 2) & 3] & fg) ^ bg; + base[3] = (eb[bits & 3] & fg) ^ bg; + base = (unsigned int *) ((char *)base + rb); + } +} + +static void draw_byte_8(unsigned char *font, unsigned int *base, int rb) +{ + int l, bits; + int fg = 0x0F0F0F0FUL; + int bg = 0x00000000UL; + unsigned int *eb = (int *)expand_bits_8; + + for (l = 0; l < 16; ++l) + { + bits = *font++; + base[0] = (eb[bits >> 4] & fg) ^ bg; + base[1] = (eb[bits & 0xf] & fg) ^ bg; + base = (unsigned int *) ((char *)base + rb); + } +} + +static unsigned char vga_font[cmapsz] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, +0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff, +0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, +0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, +0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, +0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, +0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, +0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x0e, +0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, +0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63, +0x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, +0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, +0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e, +0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, +0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb, +0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, +0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, +0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, +0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, +0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, +0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, +0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, +0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, +0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, +0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, +0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, +0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, +0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, +0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, +0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0xc6, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, +0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, +0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, +0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, +0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, +0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, +0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xde, 0xde, +0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, +0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, +0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c, +0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, +0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, +0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c, +0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, +0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xe7, +0xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, +0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, +0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, +0x0c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, +0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, +0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, +0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, +0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18, +0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, +0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, +0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, +0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, +0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60, +0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, +0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, +0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60, +0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60, +0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb, +0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, +0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, +0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30, +0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, +0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, +0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, +0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18, +0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, +0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, +0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00, +0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, +0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, +0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, +0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, +0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, +0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06, +0x3c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, +0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, +0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18, +0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66, +0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, +0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, +0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00, +0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, +0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b, +0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6c, +0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00, +0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6, +0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, +0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, +0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc, +0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, +0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00, +0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, +0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, +0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, +0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18, +0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, +0x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00, +0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, +0xd8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c, +0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, +0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc, +0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, +0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, +0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, +0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, +0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06, +0x0c, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, +0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, +0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, +0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44, +0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, +0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, +0x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, +0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, +0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, +0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36, +0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8, +0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, +0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, +0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, +0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, +0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, +0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, +0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, +0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, +0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, +0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, +0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, +0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, +0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, +0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, +0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, +0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, +0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, +0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, +0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, +0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0, +0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, +0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66, +0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, +0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, +0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60, +0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, +0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, +0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, +0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x1b, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, +0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, +0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c, +0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, +0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, +}; diff --git a/trunk/arch/powerpc/kernel/dma_64.c b/trunk/arch/ppc64/kernel/dma.c similarity index 100% rename from trunk/arch/powerpc/kernel/dma_64.c rename to trunk/arch/ppc64/kernel/dma.c diff --git a/trunk/arch/ppc64/kernel/head.S b/trunk/arch/ppc64/kernel/head.S new file mode 100644 index 000000000000..1c869ea72d28 --- /dev/null +++ b/trunk/arch/ppc64/kernel/head.S @@ -0,0 +1,2007 @@ +/* + * arch/ppc64/kernel/head.S + * + * PowerPC version + * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) + * + * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP + * Copyright (C) 1996 Cort Dougan + * Adapted for Power Macintosh by Paul Mackerras. + * Low-level exception handlers and MMU support + * rewritten by Paul Mackerras. + * Copyright (C) 1996 Paul Mackerras. + * + * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and + * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com + * + * This file contains the low-level support and setup for the + * PowerPC-64 platform, including trap and interrupt dispatch. + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_PPC_ISERIES +#define DO_SOFT_DISABLE +#endif + +/* + * We layout physical memory as follows: + * 0x0000 - 0x00ff : Secondary processor spin code + * 0x0100 - 0x2fff : pSeries Interrupt prologs + * 0x3000 - 0x5fff : interrupt support, iSeries and common interrupt prologs + * 0x6000 - 0x6fff : Initial (CPU0) segment table + * 0x7000 - 0x7fff : FWNMI data area + * 0x8000 - : Early init and support code + */ + +/* + * SPRG Usage + * + * Register Definition + * + * SPRG0 reserved for hypervisor + * SPRG1 temp - used to save gpr + * SPRG2 temp - used to save gpr + * SPRG3 virt addr of paca + */ + +/* + * Entering into this code we make the following assumptions: + * For pSeries: + * 1. The MMU is off & open firmware is running in real mode. + * 2. The kernel is entered at __start + * + * For iSeries: + * 1. The MMU is on (as it always is for iSeries) + * 2. The kernel is entered at system_reset_iSeries + */ + + .text + .globl _stext +_stext: +#ifdef CONFIG_PPC_MULTIPLATFORM +_GLOBAL(__start) + /* NOP this out unconditionally */ +BEGIN_FTR_SECTION + b .__start_initialization_multiplatform +END_FTR_SECTION(0, 1) +#endif /* CONFIG_PPC_MULTIPLATFORM */ + + /* Catch branch to 0 in real mode */ + trap + +#ifdef CONFIG_PPC_ISERIES + /* + * At offset 0x20, there is a pointer to iSeries LPAR data. + * This is required by the hypervisor + */ + . = 0x20 + .llong hvReleaseData-KERNELBASE + + /* + * At offset 0x28 and 0x30 are offsets to the mschunks_map + * array (used by the iSeries LPAR debugger to do translation + * between physical addresses and absolute addresses) and + * to the pidhash table (also used by the debugger) + */ + .llong mschunks_map-KERNELBASE + .llong 0 /* pidhash-KERNELBASE SFRXXX */ + + /* Offset 0x38 - Pointer to start of embedded System.map */ + .globl embedded_sysmap_start +embedded_sysmap_start: + .llong 0 + /* Offset 0x40 - Pointer to end of embedded System.map */ + .globl embedded_sysmap_end +embedded_sysmap_end: + .llong 0 + +#endif /* CONFIG_PPC_ISERIES */ + + /* Secondary processors spin on this value until it goes to 1. */ + .globl __secondary_hold_spinloop +__secondary_hold_spinloop: + .llong 0x0 + + /* Secondary processors write this value with their cpu # */ + /* after they enter the spin loop immediately below. */ + .globl __secondary_hold_acknowledge +__secondary_hold_acknowledge: + .llong 0x0 + + . = 0x60 +/* + * The following code is used on pSeries to hold secondary processors + * in a spin loop after they have been freed from OpenFirmware, but + * before the bulk of the kernel has been relocated. This code + * is relocated to physical address 0x60 before prom_init is run. + * All of it must fit below the first exception vector at 0x100. + */ +_GLOBAL(__secondary_hold) + mfmsr r24 + ori r24,r24,MSR_RI + mtmsrd r24 /* RI on */ + + /* Grab our linux cpu number */ + mr r24,r3 + + /* Tell the master cpu we're here */ + /* Relocation is off & we are located at an address less */ + /* than 0x100, so only need to grab low order offset. */ + std r24,__secondary_hold_acknowledge@l(0) + sync + + /* All secondary cpus wait here until told to start. */ +100: ld r4,__secondary_hold_spinloop@l(0) + cmpdi 0,r4,1 + bne 100b + +#ifdef CONFIG_HMT + b .hmt_init +#else +#ifdef CONFIG_SMP + mr r3,r24 + b .pSeries_secondary_smp_init +#else + BUG_OPCODE +#endif +#endif + +/* This value is used to mark exception frames on the stack. */ + .section ".toc","aw" +exception_marker: + .tc ID_72656773_68657265[TC],0x7265677368657265 + .text + +/* + * The following macros define the code that appears as + * the prologue to each of the exception handlers. They + * are split into two parts to allow a single kernel binary + * to be used for pSeries and iSeries. + * LOL. One day... - paulus + */ + +/* + * We make as much of the exception code common between native + * exception handlers (including pSeries LPAR) and iSeries LPAR + * implementations as possible. + */ + +/* + * This is the start of the interrupt handlers for pSeries + * This code runs with relocation off. + */ +#define EX_R9 0 +#define EX_R10 8 +#define EX_R11 16 +#define EX_R12 24 +#define EX_R13 32 +#define EX_SRR0 40 +#define EX_DAR 48 +#define EX_DSISR 56 +#define EX_CCR 60 +#define EX_R3 64 +#define EX_LR 72 + +#define EXCEPTION_PROLOG_PSERIES(area, label) \ + mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ + std r9,area+EX_R9(r13); /* save r9 - r12 */ \ + std r10,area+EX_R10(r13); \ + std r11,area+EX_R11(r13); \ + std r12,area+EX_R12(r13); \ + mfspr r9,SPRN_SPRG1; \ + std r9,area+EX_R13(r13); \ + mfcr r9; \ + clrrdi r12,r13,32; /* get high part of &label */ \ + mfmsr r10; \ + mfspr r11,SPRN_SRR0; /* save SRR0 */ \ + ori r12,r12,(label)@l; /* virt addr of handler */ \ + ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \ + mtspr SPRN_SRR0,r12; \ + mfspr r12,SPRN_SRR1; /* and SRR1 */ \ + mtspr SPRN_SRR1,r10; \ + rfid; \ + b . /* prevent speculative execution */ + +/* + * This is the start of the interrupt handlers for iSeries + * This code runs with relocation on. + */ +#define EXCEPTION_PROLOG_ISERIES_1(area) \ + mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ + std r9,area+EX_R9(r13); /* save r9 - r12 */ \ + std r10,area+EX_R10(r13); \ + std r11,area+EX_R11(r13); \ + std r12,area+EX_R12(r13); \ + mfspr r9,SPRN_SPRG1; \ + std r9,area+EX_R13(r13); \ + mfcr r9 + +#define EXCEPTION_PROLOG_ISERIES_2 \ + mfmsr r10; \ + ld r11,PACALPPACA+LPPACASRR0(r13); \ + ld r12,PACALPPACA+LPPACASRR1(r13); \ + ori r10,r10,MSR_RI; \ + mtmsrd r10,1 + +/* + * The common exception prolog is used for all except a few exceptions + * such as a segment miss on a kernel address. We have to be prepared + * to take another exception from the point where we first touch the + * kernel stack onwards. + * + * On entry r13 points to the paca, r9-r13 are saved in the paca, + * r9 contains the saved CR, r11 and r12 contain the saved SRR0 and + * SRR1, and relocation is on. + */ +#define EXCEPTION_PROLOG_COMMON(n, area) \ + andi. r10,r12,MSR_PR; /* See if coming from user */ \ + mr r10,r1; /* Save r1 */ \ + subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \ + beq- 1f; \ + ld r1,PACAKSAVE(r13); /* kernel stack to use */ \ +1: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \ + bge- cr1,bad_stack; /* abort if it is */ \ + std r9,_CCR(r1); /* save CR in stackframe */ \ + std r11,_NIP(r1); /* save SRR0 in stackframe */ \ + std r12,_MSR(r1); /* save SRR1 in stackframe */ \ + std r10,0(r1); /* make stack chain pointer */ \ + std r0,GPR0(r1); /* save r0 in stackframe */ \ + std r10,GPR1(r1); /* save r1 in stackframe */ \ + std r2,GPR2(r1); /* save r2 in stackframe */ \ + SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \ + SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \ + ld r9,area+EX_R9(r13); /* move r9, r10 to stackframe */ \ + ld r10,area+EX_R10(r13); \ + std r9,GPR9(r1); \ + std r10,GPR10(r1); \ + ld r9,area+EX_R11(r13); /* move r11 - r13 to stackframe */ \ + ld r10,area+EX_R12(r13); \ + ld r11,area+EX_R13(r13); \ + std r9,GPR11(r1); \ + std r10,GPR12(r1); \ + std r11,GPR13(r1); \ + ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \ + mflr r9; /* save LR in stackframe */ \ + std r9,_LINK(r1); \ + mfctr r10; /* save CTR in stackframe */ \ + std r10,_CTR(r1); \ + mfspr r11,SPRN_XER; /* save XER in stackframe */ \ + std r11,_XER(r1); \ + li r9,(n)+1; \ + std r9,_TRAP(r1); /* set trap number */ \ + li r10,0; \ + ld r11,exception_marker@toc(r2); \ + std r10,RESULT(r1); /* clear regs->result */ \ + std r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */ + +/* + * Exception vectors. + */ +#define STD_EXCEPTION_PSERIES(n, label) \ + . = n; \ + .globl label##_pSeries; \ +label##_pSeries: \ + HMT_MEDIUM; \ + mtspr SPRN_SPRG1,r13; /* save r13 */ \ + RUNLATCH_ON(r13); \ + EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) + +#define STD_EXCEPTION_ISERIES(n, label, area) \ + .globl label##_iSeries; \ +label##_iSeries: \ + HMT_MEDIUM; \ + mtspr SPRN_SPRG1,r13; /* save r13 */ \ + RUNLATCH_ON(r13); \ + EXCEPTION_PROLOG_ISERIES_1(area); \ + EXCEPTION_PROLOG_ISERIES_2; \ + b label##_common + +#define MASKABLE_EXCEPTION_ISERIES(n, label) \ + .globl label##_iSeries; \ +label##_iSeries: \ + HMT_MEDIUM; \ + mtspr SPRN_SPRG1,r13; /* save r13 */ \ + RUNLATCH_ON(r13); \ + EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ + lbz r10,PACAPROCENABLED(r13); \ + cmpwi 0,r10,0; \ + beq- label##_iSeries_masked; \ + EXCEPTION_PROLOG_ISERIES_2; \ + b label##_common; \ + +#ifdef DO_SOFT_DISABLE +#define DISABLE_INTS \ + lbz r10,PACAPROCENABLED(r13); \ + li r11,0; \ + std r10,SOFTE(r1); \ + mfmsr r10; \ + stb r11,PACAPROCENABLED(r13); \ + ori r10,r10,MSR_EE; \ + mtmsrd r10,1 + +#define ENABLE_INTS \ + lbz r10,PACAPROCENABLED(r13); \ + mfmsr r11; \ + std r10,SOFTE(r1); \ + ori r11,r11,MSR_EE; \ + mtmsrd r11,1 + +#else /* hard enable/disable interrupts */ +#define DISABLE_INTS + +#define ENABLE_INTS \ + ld r12,_MSR(r1); \ + mfmsr r11; \ + rlwimi r11,r12,0,MSR_EE; \ + mtmsrd r11,1 + +#endif + +#define STD_EXCEPTION_COMMON(trap, label, hdlr) \ + .align 7; \ + .globl label##_common; \ +label##_common: \ + EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ + DISABLE_INTS; \ + bl .save_nvgprs; \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + bl hdlr; \ + b .ret_from_except + +#define STD_EXCEPTION_COMMON_LITE(trap, label, hdlr) \ + .align 7; \ + .globl label##_common; \ +label##_common: \ + EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ + DISABLE_INTS; \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + bl hdlr; \ + b .ret_from_except_lite + +/* + * Start of pSeries system interrupt routines + */ + . = 0x100 + .globl __start_interrupts +__start_interrupts: + + STD_EXCEPTION_PSERIES(0x100, system_reset) + + . = 0x200 +_machine_check_pSeries: + HMT_MEDIUM + mtspr SPRN_SPRG1,r13 /* save r13 */ + RUNLATCH_ON(r13) + EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) + + . = 0x300 + .globl data_access_pSeries +data_access_pSeries: + HMT_MEDIUM + mtspr SPRN_SPRG1,r13 +BEGIN_FTR_SECTION + mtspr SPRN_SPRG2,r12 + mfspr r13,SPRN_DAR + mfspr r12,SPRN_DSISR + srdi r13,r13,60 + rlwimi r13,r12,16,0x20 + mfcr r12 + cmpwi r13,0x2c + beq .do_stab_bolted_pSeries + mtcrf 0x80,r12 + mfspr r12,SPRN_SPRG2 +END_FTR_SECTION_IFCLR(CPU_FTR_SLB) + EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common) + + . = 0x380 + .globl data_access_slb_pSeries +data_access_slb_pSeries: + HMT_MEDIUM + mtspr SPRN_SPRG1,r13 + RUNLATCH_ON(r13) + mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ + std r3,PACA_EXSLB+EX_R3(r13) + mfspr r3,SPRN_DAR + std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ + mfcr r9 +#ifdef __DISABLED__ + /* Keep that around for when we re-implement dynamic VSIDs */ + cmpdi r3,0 + bge slb_miss_user_pseries +#endif /* __DISABLED__ */ + std r10,PACA_EXSLB+EX_R10(r13) + std r11,PACA_EXSLB+EX_R11(r13) + std r12,PACA_EXSLB+EX_R12(r13) + mfspr r10,SPRN_SPRG1 + std r10,PACA_EXSLB+EX_R13(r13) + mfspr r12,SPRN_SRR1 /* and SRR1 */ + b .slb_miss_realmode /* Rel. branch works in real mode */ + + STD_EXCEPTION_PSERIES(0x400, instruction_access) + + . = 0x480 + .globl instruction_access_slb_pSeries +instruction_access_slb_pSeries: + HMT_MEDIUM + mtspr SPRN_SPRG1,r13 + RUNLATCH_ON(r13) + mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ + std r3,PACA_EXSLB+EX_R3(r13) + mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ + std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ + mfcr r9 +#ifdef __DISABLED__ + /* Keep that around for when we re-implement dynamic VSIDs */ + cmpdi r3,0 + bge slb_miss_user_pseries +#endif /* __DISABLED__ */ + std r10,PACA_EXSLB+EX_R10(r13) + std r11,PACA_EXSLB+EX_R11(r13) + std r12,PACA_EXSLB+EX_R12(r13) + mfspr r10,SPRN_SPRG1 + std r10,PACA_EXSLB+EX_R13(r13) + mfspr r12,SPRN_SRR1 /* and SRR1 */ + b .slb_miss_realmode /* Rel. branch works in real mode */ + + STD_EXCEPTION_PSERIES(0x500, hardware_interrupt) + STD_EXCEPTION_PSERIES(0x600, alignment) + STD_EXCEPTION_PSERIES(0x700, program_check) + STD_EXCEPTION_PSERIES(0x800, fp_unavailable) + STD_EXCEPTION_PSERIES(0x900, decrementer) + STD_EXCEPTION_PSERIES(0xa00, trap_0a) + STD_EXCEPTION_PSERIES(0xb00, trap_0b) + + . = 0xc00 + .globl system_call_pSeries +system_call_pSeries: + HMT_MEDIUM + RUNLATCH_ON(r9) + mr r9,r13 + mfmsr r10 + mfspr r13,SPRN_SPRG3 + mfspr r11,SPRN_SRR0 + clrrdi r12,r13,32 + oris r12,r12,system_call_common@h + ori r12,r12,system_call_common@l + mtspr SPRN_SRR0,r12 + ori r10,r10,MSR_IR|MSR_DR|MSR_RI + mfspr r12,SPRN_SRR1 + mtspr SPRN_SRR1,r10 + rfid + b . /* prevent speculative execution */ + + STD_EXCEPTION_PSERIES(0xd00, single_step) + STD_EXCEPTION_PSERIES(0xe00, trap_0e) + + /* We need to deal with the Altivec unavailable exception + * here which is at 0xf20, thus in the middle of the + * prolog code of the PerformanceMonitor one. A little + * trickery is thus necessary + */ + . = 0xf00 + b performance_monitor_pSeries + + STD_EXCEPTION_PSERIES(0xf20, altivec_unavailable) + + STD_EXCEPTION_PSERIES(0x1300, instruction_breakpoint) + STD_EXCEPTION_PSERIES(0x1700, altivec_assist) + + . = 0x3000 + +/*** pSeries interrupt support ***/ + + /* moved from 0xf00 */ + STD_EXCEPTION_PSERIES(., performance_monitor) + + .align 7 +_GLOBAL(do_stab_bolted_pSeries) + mtcrf 0x80,r12 + mfspr r12,SPRN_SPRG2 + EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) + +/* + * We have some room here we use that to put + * the peries slb miss user trampoline code so it's reasonably + * away from slb_miss_user_common to avoid problems with rfid + * + * This is used for when the SLB miss handler has to go virtual, + * which doesn't happen for now anymore but will once we re-implement + * dynamic VSIDs for shared page tables + */ +#ifdef __DISABLED__ +slb_miss_user_pseries: + std r10,PACA_EXGEN+EX_R10(r13) + std r11,PACA_EXGEN+EX_R11(r13) + std r12,PACA_EXGEN+EX_R12(r13) + mfspr r10,SPRG1 + ld r11,PACA_EXSLB+EX_R9(r13) + ld r12,PACA_EXSLB+EX_R3(r13) + std r10,PACA_EXGEN+EX_R13(r13) + std r11,PACA_EXGEN+EX_R9(r13) + std r12,PACA_EXGEN+EX_R3(r13) + clrrdi r12,r13,32 + mfmsr r10 + mfspr r11,SRR0 /* save SRR0 */ + ori r12,r12,slb_miss_user_common@l /* virt addr of handler */ + ori r10,r10,MSR_IR|MSR_DR|MSR_RI + mtspr SRR0,r12 + mfspr r12,SRR1 /* and SRR1 */ + mtspr SRR1,r10 + rfid + b . /* prevent spec. execution */ +#endif /* __DISABLED__ */ + +/* + * Vectors for the FWNMI option. Share common code. + */ + .globl system_reset_fwnmi +system_reset_fwnmi: + HMT_MEDIUM + mtspr SPRN_SPRG1,r13 /* save r13 */ + RUNLATCH_ON(r13) + EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) + + .globl machine_check_fwnmi +machine_check_fwnmi: + HMT_MEDIUM + mtspr SPRN_SPRG1,r13 /* save r13 */ + RUNLATCH_ON(r13) + EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) + +#ifdef CONFIG_PPC_ISERIES +/*** ISeries-LPAR interrupt handlers ***/ + + STD_EXCEPTION_ISERIES(0x200, machine_check, PACA_EXMC) + + .globl data_access_iSeries +data_access_iSeries: + mtspr SPRN_SPRG1,r13 +BEGIN_FTR_SECTION + mtspr SPRN_SPRG2,r12 + mfspr r13,SPRN_DAR + mfspr r12,SPRN_DSISR + srdi r13,r13,60 + rlwimi r13,r12,16,0x20 + mfcr r12 + cmpwi r13,0x2c + beq .do_stab_bolted_iSeries + mtcrf 0x80,r12 + mfspr r12,SPRN_SPRG2 +END_FTR_SECTION_IFCLR(CPU_FTR_SLB) + EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN) + EXCEPTION_PROLOG_ISERIES_2 + b data_access_common + +.do_stab_bolted_iSeries: + mtcrf 0x80,r12 + mfspr r12,SPRN_SPRG2 + EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) + EXCEPTION_PROLOG_ISERIES_2 + b .do_stab_bolted + + .globl data_access_slb_iSeries +data_access_slb_iSeries: + mtspr SPRN_SPRG1,r13 /* save r13 */ + mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ + std r3,PACA_EXSLB+EX_R3(r13) + mfspr r3,SPRN_DAR + std r9,PACA_EXSLB+EX_R9(r13) + mfcr r9 +#ifdef __DISABLED__ + cmpdi r3,0 + bge slb_miss_user_iseries +#endif + std r10,PACA_EXSLB+EX_R10(r13) + std r11,PACA_EXSLB+EX_R11(r13) + std r12,PACA_EXSLB+EX_R12(r13) + mfspr r10,SPRN_SPRG1 + std r10,PACA_EXSLB+EX_R13(r13) + ld r12,PACALPPACA+LPPACASRR1(r13); + b .slb_miss_realmode + + STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN) + + .globl instruction_access_slb_iSeries +instruction_access_slb_iSeries: + mtspr SPRN_SPRG1,r13 /* save r13 */ + mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ + std r3,PACA_EXSLB+EX_R3(r13) + ld r3,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */ + std r9,PACA_EXSLB+EX_R9(r13) + mfcr r9 +#ifdef __DISABLED__ + cmpdi r3,0 + bge .slb_miss_user_iseries +#endif + std r10,PACA_EXSLB+EX_R10(r13) + std r11,PACA_EXSLB+EX_R11(r13) + std r12,PACA_EXSLB+EX_R12(r13) + mfspr r10,SPRN_SPRG1 + std r10,PACA_EXSLB+EX_R13(r13) + ld r12,PACALPPACA+LPPACASRR1(r13); + b .slb_miss_realmode + +#ifdef __DISABLED__ +slb_miss_user_iseries: + std r10,PACA_EXGEN+EX_R10(r13) + std r11,PACA_EXGEN+EX_R11(r13) + std r12,PACA_EXGEN+EX_R12(r13) + mfspr r10,SPRG1 + ld r11,PACA_EXSLB+EX_R9(r13) + ld r12,PACA_EXSLB+EX_R3(r13) + std r10,PACA_EXGEN+EX_R13(r13) + std r11,PACA_EXGEN+EX_R9(r13) + std r12,PACA_EXGEN+EX_R3(r13) + EXCEPTION_PROLOG_ISERIES_2 + b slb_miss_user_common +#endif + + MASKABLE_EXCEPTION_ISERIES(0x500, hardware_interrupt) + STD_EXCEPTION_ISERIES(0x600, alignment, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0x700, program_check, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0x800, fp_unavailable, PACA_EXGEN) + MASKABLE_EXCEPTION_ISERIES(0x900, decrementer) + STD_EXCEPTION_ISERIES(0xa00, trap_0a, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0xb00, trap_0b, PACA_EXGEN) + + .globl system_call_iSeries +system_call_iSeries: + mr r9,r13 + mfspr r13,SPRN_SPRG3 + EXCEPTION_PROLOG_ISERIES_2 + b system_call_common + + STD_EXCEPTION_ISERIES( 0xd00, single_step, PACA_EXGEN) + STD_EXCEPTION_ISERIES( 0xe00, trap_0e, PACA_EXGEN) + STD_EXCEPTION_ISERIES( 0xf00, performance_monitor, PACA_EXGEN) + + .globl system_reset_iSeries +system_reset_iSeries: + mfspr r13,SPRN_SPRG3 /* Get paca address */ + mfmsr r24 + ori r24,r24,MSR_RI + mtmsrd r24 /* RI on */ + lhz r24,PACAPACAINDEX(r13) /* Get processor # */ + cmpwi 0,r24,0 /* Are we processor 0? */ + beq .__start_initialization_iSeries /* Start up the first processor */ + mfspr r4,SPRN_CTRLF + li r5,CTRL_RUNLATCH /* Turn off the run light */ + andc r4,r4,r5 + mtspr SPRN_CTRLT,r4 + +1: + HMT_LOW +#ifdef CONFIG_SMP + lbz r23,PACAPROCSTART(r13) /* Test if this processor + * should start */ + sync + LOADADDR(r3,current_set) + sldi r28,r24,3 /* get current_set[cpu#] */ + ldx r3,r3,r28 + addi r1,r3,THREAD_SIZE + subi r1,r1,STACK_FRAME_OVERHEAD + + cmpwi 0,r23,0 + beq iSeries_secondary_smp_loop /* Loop until told to go */ + bne .__secondary_start /* Loop until told to go */ +iSeries_secondary_smp_loop: + /* Let the Hypervisor know we are alive */ + /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */ + lis r3,0x8002 + rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */ +#else /* CONFIG_SMP */ + /* Yield the processor. This is required for non-SMP kernels + which are running on multi-threaded machines. */ + lis r3,0x8000 + rldicr r3,r3,32,15 /* r3 = (r3 << 32) & 0xffff000000000000 */ + addi r3,r3,18 /* r3 = 0x8000000000000012 which is "yield" */ + li r4,0 /* "yield timed" */ + li r5,-1 /* "yield forever" */ +#endif /* CONFIG_SMP */ + li r0,-1 /* r0=-1 indicates a Hypervisor call */ + sc /* Invoke the hypervisor via a system call */ + mfspr r13,SPRN_SPRG3 /* Put r13 back ???? */ + b 1b /* If SMP not configured, secondaries + * loop forever */ + + .globl decrementer_iSeries_masked +decrementer_iSeries_masked: + li r11,1 + stb r11,PACALPPACA+LPPACADECRINT(r13) + lwz r12,PACADEFAULTDECR(r13) + mtspr SPRN_DEC,r12 + /* fall through */ + + .globl hardware_interrupt_iSeries_masked +hardware_interrupt_iSeries_masked: + mtcrf 0x80,r9 /* Restore regs */ + ld r11,PACALPPACA+LPPACASRR0(r13) + ld r12,PACALPPACA+LPPACASRR1(r13) + mtspr SPRN_SRR0,r11 + mtspr SPRN_SRR1,r12 + ld r9,PACA_EXGEN+EX_R9(r13) + ld r10,PACA_EXGEN+EX_R10(r13) + ld r11,PACA_EXGEN+EX_R11(r13) + ld r12,PACA_EXGEN+EX_R12(r13) + ld r13,PACA_EXGEN+EX_R13(r13) + rfid + b . /* prevent speculative execution */ +#endif /* CONFIG_PPC_ISERIES */ + +/*** Common interrupt handlers ***/ + + STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception) + + /* + * Machine check is different because we use a different + * save area: PACA_EXMC instead of PACA_EXGEN. + */ + .align 7 + .globl machine_check_common +machine_check_common: + EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC) + DISABLE_INTS + bl .save_nvgprs + addi r3,r1,STACK_FRAME_OVERHEAD + bl .machine_check_exception + b .ret_from_except + + STD_EXCEPTION_COMMON_LITE(0x900, decrementer, .timer_interrupt) + STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception) + STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) + STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) + STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception) + STD_EXCEPTION_COMMON(0xf00, performance_monitor, .performance_monitor_exception) + STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception) +#ifdef CONFIG_ALTIVEC + STD_EXCEPTION_COMMON(0x1700, altivec_assist, .altivec_assist_exception) +#else + STD_EXCEPTION_COMMON(0x1700, altivec_assist, .unknown_exception) +#endif + +/* + * Here we have detected that the kernel stack pointer is bad. + * R9 contains the saved CR, r13 points to the paca, + * r10 contains the (bad) kernel stack pointer, + * r11 and r12 contain the saved SRR0 and SRR1. + * We switch to using an emergency stack, save the registers there, + * and call kernel_bad_stack(), which panics. + */ +bad_stack: + ld r1,PACAEMERGSP(r13) + subi r1,r1,64+INT_FRAME_SIZE + std r9,_CCR(r1) + std r10,GPR1(r1) + std r11,_NIP(r1) + std r12,_MSR(r1) + mfspr r11,SPRN_DAR + mfspr r12,SPRN_DSISR + std r11,_DAR(r1) + std r12,_DSISR(r1) + mflr r10 + mfctr r11 + mfxer r12 + std r10,_LINK(r1) + std r11,_CTR(r1) + std r12,_XER(r1) + SAVE_GPR(0,r1) + SAVE_GPR(2,r1) + SAVE_4GPRS(3,r1) + SAVE_2GPRS(7,r1) + SAVE_10GPRS(12,r1) + SAVE_10GPRS(22,r1) + addi r11,r1,INT_FRAME_SIZE + std r11,0(r1) + li r12,0 + std r12,0(r11) + ld r2,PACATOC(r13) +1: addi r3,r1,STACK_FRAME_OVERHEAD + bl .kernel_bad_stack + b 1b + +/* + * Return from an exception with minimal checks. + * The caller is assumed to have done EXCEPTION_PROLOG_COMMON. + * If interrupts have been enabled, or anything has been + * done that might have changed the scheduling status of + * any task or sent any task a signal, you should use + * ret_from_except or ret_from_except_lite instead of this. + */ + .globl fast_exception_return +fast_exception_return: + ld r12,_MSR(r1) + ld r11,_NIP(r1) + andi. r3,r12,MSR_RI /* check if RI is set */ + beq- unrecov_fer + ld r3,_CCR(r1) + ld r4,_LINK(r1) + ld r5,_CTR(r1) + ld r6,_XER(r1) + mtcr r3 + mtlr r4 + mtctr r5 + mtxer r6 + REST_GPR(0, r1) + REST_8GPRS(2, r1) + + mfmsr r10 + clrrdi r10,r10,2 /* clear RI (LE is 0 already) */ + mtmsrd r10,1 + + mtspr SPRN_SRR1,r12 + mtspr SPRN_SRR0,r11 + REST_4GPRS(10, r1) + ld r1,GPR1(r1) + rfid + b . /* prevent speculative execution */ + +unrecov_fer: + bl .save_nvgprs +1: addi r3,r1,STACK_FRAME_OVERHEAD + bl .unrecoverable_exception + b 1b + +/* + * Here r13 points to the paca, r9 contains the saved CR, + * SRR0 and SRR1 are saved in r11 and r12, + * r9 - r13 are saved in paca->exgen. + */ + .align 7 + .globl data_access_common +data_access_common: + RUNLATCH_ON(r10) /* It wont fit in the 0x300 handler */ + mfspr r10,SPRN_DAR + std r10,PACA_EXGEN+EX_DAR(r13) + mfspr r10,SPRN_DSISR + stw r10,PACA_EXGEN+EX_DSISR(r13) + EXCEPTION_PROLOG_COMMON(0x300, PACA_EXGEN) + ld r3,PACA_EXGEN+EX_DAR(r13) + lwz r4,PACA_EXGEN+EX_DSISR(r13) + li r5,0x300 + b .do_hash_page /* Try to handle as hpte fault */ + + .align 7 + .globl instruction_access_common +instruction_access_common: + EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN) + ld r3,_NIP(r1) + andis. r4,r12,0x5820 + li r5,0x400 + b .do_hash_page /* Try to handle as hpte fault */ + +/* + * Here is the common SLB miss user that is used when going to virtual + * mode for SLB misses, that is currently not used + */ +#ifdef __DISABLED__ + .align 7 + .globl slb_miss_user_common +slb_miss_user_common: + mflr r10 + std r3,PACA_EXGEN+EX_DAR(r13) + stw r9,PACA_EXGEN+EX_CCR(r13) + std r10,PACA_EXGEN+EX_LR(r13) + std r11,PACA_EXGEN+EX_SRR0(r13) + bl .slb_allocate_user + + ld r10,PACA_EXGEN+EX_LR(r13) + ld r3,PACA_EXGEN+EX_R3(r13) + lwz r9,PACA_EXGEN+EX_CCR(r13) + ld r11,PACA_EXGEN+EX_SRR0(r13) + mtlr r10 + beq- slb_miss_fault + + andi. r10,r12,MSR_RI /* check for unrecoverable exception */ + beq- unrecov_user_slb + mfmsr r10 + +.machine push +.machine "power4" + mtcrf 0x80,r9 +.machine pop + + clrrdi r10,r10,2 /* clear RI before setting SRR0/1 */ + mtmsrd r10,1 + + mtspr SRR0,r11 + mtspr SRR1,r12 + + ld r9,PACA_EXGEN+EX_R9(r13) + ld r10,PACA_EXGEN+EX_R10(r13) + ld r11,PACA_EXGEN+EX_R11(r13) + ld r12,PACA_EXGEN+EX_R12(r13) + ld r13,PACA_EXGEN+EX_R13(r13) + rfid + b . + +slb_miss_fault: + EXCEPTION_PROLOG_COMMON(0x380, PACA_EXGEN) + ld r4,PACA_EXGEN+EX_DAR(r13) + li r5,0 + std r4,_DAR(r1) + std r5,_DSISR(r1) + b .handle_page_fault + +unrecov_user_slb: + EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN) + DISABLE_INTS + bl .save_nvgprs +1: addi r3,r1,STACK_FRAME_OVERHEAD + bl .unrecoverable_exception + b 1b + +#endif /* __DISABLED__ */ + + +/* + * r13 points to the PACA, r9 contains the saved CR, + * r12 contain the saved SRR1, SRR0 is still ready for return + * r3 has the faulting address + * r9 - r13 are saved in paca->exslb. + * r3 is saved in paca->slb_r3 + * We assume we aren't going to take any exceptions during this procedure. + */ +_GLOBAL(slb_miss_realmode) + mflr r10 + + stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */ + std r10,PACA_EXSLB+EX_LR(r13) /* save LR */ + + bl .slb_allocate_realmode + + /* All done -- return from exception. */ + + ld r10,PACA_EXSLB+EX_LR(r13) + ld r3,PACA_EXSLB+EX_R3(r13) + lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ +#ifdef CONFIG_PPC_ISERIES + ld r11,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */ +#endif /* CONFIG_PPC_ISERIES */ + + mtlr r10 + + andi. r10,r12,MSR_RI /* check for unrecoverable exception */ + beq- unrecov_slb + +.machine push +.machine "power4" + mtcrf 0x80,r9 + mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */ +.machine pop + +#ifdef CONFIG_PPC_ISERIES + mtspr SPRN_SRR0,r11 + mtspr SPRN_SRR1,r12 +#endif /* CONFIG_PPC_ISERIES */ + ld r9,PACA_EXSLB+EX_R9(r13) + ld r10,PACA_EXSLB+EX_R10(r13) + ld r11,PACA_EXSLB+EX_R11(r13) + ld r12,PACA_EXSLB+EX_R12(r13) + ld r13,PACA_EXSLB+EX_R13(r13) + rfid + b . /* prevent speculative execution */ + +unrecov_slb: + EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB) + DISABLE_INTS + bl .save_nvgprs +1: addi r3,r1,STACK_FRAME_OVERHEAD + bl .unrecoverable_exception + b 1b + + .align 7 + .globl hardware_interrupt_common + .globl hardware_interrupt_entry +hardware_interrupt_common: + EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN) +hardware_interrupt_entry: + DISABLE_INTS + addi r3,r1,STACK_FRAME_OVERHEAD + bl .do_IRQ + b .ret_from_except_lite + + .align 7 + .globl alignment_common +alignment_common: + mfspr r10,SPRN_DAR + std r10,PACA_EXGEN+EX_DAR(r13) + mfspr r10,SPRN_DSISR + stw r10,PACA_EXGEN+EX_DSISR(r13) + EXCEPTION_PROLOG_COMMON(0x600, PACA_EXGEN) + ld r3,PACA_EXGEN+EX_DAR(r13) + lwz r4,PACA_EXGEN+EX_DSISR(r13) + std r3,_DAR(r1) + std r4,_DSISR(r1) + bl .save_nvgprs + addi r3,r1,STACK_FRAME_OVERHEAD + ENABLE_INTS + bl .alignment_exception + b .ret_from_except + + .align 7 + .globl program_check_common +program_check_common: + EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN) + bl .save_nvgprs + addi r3,r1,STACK_FRAME_OVERHEAD + ENABLE_INTS + bl .program_check_exception + b .ret_from_except + + .align 7 + .globl fp_unavailable_common +fp_unavailable_common: + EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN) + bne .load_up_fpu /* if from user, just load it up */ + bl .save_nvgprs + addi r3,r1,STACK_FRAME_OVERHEAD + ENABLE_INTS + bl .kernel_fp_unavailable_exception + BUG_OPCODE + + .align 7 + .globl altivec_unavailable_common +altivec_unavailable_common: + EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN) +#ifdef CONFIG_ALTIVEC +BEGIN_FTR_SECTION + bne .load_up_altivec /* if from user, just load it up */ +END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) +#endif + bl .save_nvgprs + addi r3,r1,STACK_FRAME_OVERHEAD + ENABLE_INTS + bl .altivec_unavailable_exception + b .ret_from_except + +#ifdef CONFIG_ALTIVEC +/* + * load_up_altivec(unused, unused, tsk) + * Disable VMX for the task which had it previously, + * and save its vector registers in its thread_struct. + * Enables the VMX for use in the kernel on return. + * On SMP we know the VMX is free, since we give it up every + * switch (ie, no lazy save of the vector registers). + * On entry: r13 == 'current' && last_task_used_altivec != 'current' + */ +_STATIC(load_up_altivec) + mfmsr r5 /* grab the current MSR */ + oris r5,r5,MSR_VEC@h + mtmsrd r5 /* enable use of VMX now */ + isync + +/* + * For SMP, we don't do lazy VMX switching because it just gets too + * horrendously complex, especially when a task switches from one CPU + * to another. Instead we call giveup_altvec in switch_to. + * VRSAVE isn't dealt with here, that is done in the normal context + * switch code. Note that we could rely on vrsave value to eventually + * avoid saving all of the VREGs here... + */ +#ifndef CONFIG_SMP + ld r3,last_task_used_altivec@got(r2) + ld r4,0(r3) + cmpdi 0,r4,0 + beq 1f + /* Save VMX state to last_task_used_altivec's THREAD struct */ + addi r4,r4,THREAD + SAVE_32VRS(0,r5,r4) + mfvscr vr0 + li r10,THREAD_VSCR + stvx vr0,r10,r4 + /* Disable VMX for last_task_used_altivec */ + ld r5,PT_REGS(r4) + ld r4,_MSR-STACK_FRAME_OVERHEAD(r5) + lis r6,MSR_VEC@h + andc r4,r4,r6 + std r4,_MSR-STACK_FRAME_OVERHEAD(r5) +1: +#endif /* CONFIG_SMP */ + /* Hack: if we get an altivec unavailable trap with VRSAVE + * set to all zeros, we assume this is a broken application + * that fails to set it properly, and thus we switch it to + * all 1's + */ + mfspr r4,SPRN_VRSAVE + cmpdi 0,r4,0 + bne+ 1f + li r4,-1 + mtspr SPRN_VRSAVE,r4 +1: + /* enable use of VMX after return */ + ld r4,PACACURRENT(r13) + addi r5,r4,THREAD /* Get THREAD */ + oris r12,r12,MSR_VEC@h + std r12,_MSR(r1) + li r4,1 + li r10,THREAD_VSCR + stw r4,THREAD_USED_VR(r5) + lvx vr0,r10,r5 + mtvscr vr0 + REST_32VRS(0,r4,r5) +#ifndef CONFIG_SMP + /* Update last_task_used_math to 'current' */ + subi r4,r5,THREAD /* Back to 'current' */ + std r4,0(r3) +#endif /* CONFIG_SMP */ + /* restore registers and return */ + b fast_exception_return +#endif /* CONFIG_ALTIVEC */ + +/* + * Hash table stuff + */ + .align 7 +_GLOBAL(do_hash_page) + std r3,_DAR(r1) + std r4,_DSISR(r1) + + andis. r0,r4,0xa450 /* weird error? */ + bne- .handle_page_fault /* if not, try to insert a HPTE */ +BEGIN_FTR_SECTION + andis. r0,r4,0x0020 /* Is it a segment table fault? */ + bne- .do_ste_alloc /* If so handle it */ +END_FTR_SECTION_IFCLR(CPU_FTR_SLB) + + /* + * We need to set the _PAGE_USER bit if MSR_PR is set or if we are + * accessing a userspace segment (even from the kernel). We assume + * kernel addresses always have the high bit set. + */ + rlwinm r4,r4,32-25+9,31-9,31-9 /* DSISR_STORE -> _PAGE_RW */ + rotldi r0,r3,15 /* Move high bit into MSR_PR posn */ + orc r0,r12,r0 /* MSR_PR | ~high_bit */ + rlwimi r4,r0,32-13,30,30 /* becomes _PAGE_USER access bit */ + ori r4,r4,1 /* add _PAGE_PRESENT */ + rlwimi r4,r5,22+2,31-2,31-2 /* Set _PAGE_EXEC if trap is 0x400 */ + + /* + * On iSeries, we soft-disable interrupts here, then + * hard-enable interrupts so that the hash_page code can spin on + * the hash_table_lock without problems on a shared processor. + */ + DISABLE_INTS + + /* + * r3 contains the faulting address + * r4 contains the required access permissions + * r5 contains the trap number + * + * at return r3 = 0 for success + */ + bl .hash_page /* build HPTE if possible */ + cmpdi r3,0 /* see if hash_page succeeded */ + +#ifdef DO_SOFT_DISABLE + /* + * If we had interrupts soft-enabled at the point where the + * DSI/ISI occurred, and an interrupt came in during hash_page, + * handle it now. + * We jump to ret_from_except_lite rather than fast_exception_return + * because ret_from_except_lite will check for and handle pending + * interrupts if necessary. + */ + beq .ret_from_except_lite + /* For a hash failure, we don't bother re-enabling interrupts */ + ble- 12f + + /* + * hash_page couldn't handle it, set soft interrupt enable back + * to what it was before the trap. Note that .local_irq_restore + * handles any interrupts pending at this point. + */ + ld r3,SOFTE(r1) + bl .local_irq_restore + b 11f +#else + beq fast_exception_return /* Return from exception on success */ + ble- 12f /* Failure return from hash_page */ + + /* fall through */ +#endif + +/* Here we have a page fault that hash_page can't handle. */ +_GLOBAL(handle_page_fault) + ENABLE_INTS +11: ld r4,_DAR(r1) + ld r5,_DSISR(r1) + addi r3,r1,STACK_FRAME_OVERHEAD + bl .do_page_fault + cmpdi r3,0 + beq+ .ret_from_except_lite + bl .save_nvgprs + mr r5,r3 + addi r3,r1,STACK_FRAME_OVERHEAD + lwz r4,_DAR(r1) + bl .bad_page_fault + b .ret_from_except + +/* We have a page fault that hash_page could handle but HV refused + * the PTE insertion + */ +12: bl .save_nvgprs + addi r3,r1,STACK_FRAME_OVERHEAD + lwz r4,_DAR(r1) + bl .low_hash_fault + b .ret_from_except + + /* here we have a segment miss */ +_GLOBAL(do_ste_alloc) + bl .ste_allocate /* try to insert stab entry */ + cmpdi r3,0 + beq+ fast_exception_return + b .handle_page_fault + +/* + * r13 points to the PACA, r9 contains the saved CR, + * r11 and r12 contain the saved SRR0 and SRR1. + * r9 - r13 are saved in paca->exslb. + * We assume we aren't going to take any exceptions during this procedure. + * We assume (DAR >> 60) == 0xc. + */ + .align 7 +_GLOBAL(do_stab_bolted) + stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */ + std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */ + + /* Hash to the primary group */ + ld r10,PACASTABVIRT(r13) + mfspr r11,SPRN_DAR + srdi r11,r11,28 + rldimi r10,r11,7,52 /* r10 = first ste of the group */ + + /* Calculate VSID */ + /* This is a kernel address, so protovsid = ESID */ + ASM_VSID_SCRAMBLE(r11, r9) + rldic r9,r11,12,16 /* r9 = vsid << 12 */ + + /* Search the primary group for a free entry */ +1: ld r11,0(r10) /* Test valid bit of the current ste */ + andi. r11,r11,0x80 + beq 2f + addi r10,r10,16 + andi. r11,r10,0x70 + bne 1b + + /* Stick for only searching the primary group for now. */ + /* At least for now, we use a very simple random castout scheme */ + /* Use the TB as a random number ; OR in 1 to avoid entry 0 */ + mftb r11 + rldic r11,r11,4,57 /* r11 = (r11 << 4) & 0x70 */ + ori r11,r11,0x10 + + /* r10 currently points to an ste one past the group of interest */ + /* make it point to the randomly selected entry */ + subi r10,r10,128 + or r10,r10,r11 /* r10 is the entry to invalidate */ + + isync /* mark the entry invalid */ + ld r11,0(r10) + rldicl r11,r11,56,1 /* clear the valid bit */ + rotldi r11,r11,8 + std r11,0(r10) + sync + + clrrdi r11,r11,28 /* Get the esid part of the ste */ + slbie r11 + +2: std r9,8(r10) /* Store the vsid part of the ste */ + eieio + + mfspr r11,SPRN_DAR /* Get the new esid */ + clrrdi r11,r11,28 /* Permits a full 32b of ESID */ + ori r11,r11,0x90 /* Turn on valid and kp */ + std r11,0(r10) /* Put new entry back into the stab */ + + sync + + /* All done -- return from exception. */ + lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ + ld r11,PACA_EXSLB+EX_SRR0(r13) /* get saved SRR0 */ + + andi. r10,r12,MSR_RI + beq- unrecov_slb + + mtcrf 0x80,r9 /* restore CR */ + + mfmsr r10 + clrrdi r10,r10,2 + mtmsrd r10,1 + + mtspr SPRN_SRR0,r11 + mtspr SPRN_SRR1,r12 + ld r9,PACA_EXSLB+EX_R9(r13) + ld r10,PACA_EXSLB+EX_R10(r13) + ld r11,PACA_EXSLB+EX_R11(r13) + ld r12,PACA_EXSLB+EX_R12(r13) + ld r13,PACA_EXSLB+EX_R13(r13) + rfid + b . /* prevent speculative execution */ + +/* + * Space for CPU0's segment table. + * + * On iSeries, the hypervisor must fill in at least one entry before + * we get control (with relocate on). The address is give to the hv + * as a page number (see xLparMap in lpardata.c), so this must be at a + * fixed address (the linker can't compute (u64)&initial_stab >> + * PAGE_SHIFT). + */ + . = STAB0_PHYS_ADDR /* 0x6000 */ + .globl initial_stab +initial_stab: + .space 4096 + +/* + * Data area reserved for FWNMI option. + * This address (0x7000) is fixed by the RPA. + */ + .= 0x7000 + .globl fwnmi_data_area +fwnmi_data_area: + + /* iSeries does not use the FWNMI stuff, so it is safe to put + * this here, even if we later allow kernels that will boot on + * both pSeries and iSeries */ +#ifdef CONFIG_PPC_ISERIES + . = LPARMAP_PHYS +#include "lparmap.s" +/* + * This ".text" is here for old compilers that generate a trailing + * .note section when compiling .c files to .s + */ + .text +#endif /* CONFIG_PPC_ISERIES */ + + . = 0x8000 + +/* + * On pSeries, secondary processors spin in the following code. + * At entry, r3 = this processor's number (physical cpu id) + */ +_GLOBAL(pSeries_secondary_smp_init) + mr r24,r3 + + /* turn on 64-bit mode */ + bl .enable_64b_mode + isync + + /* Copy some CPU settings from CPU 0 */ + bl .__restore_cpu_setup + + /* Set up a paca value for this processor. Since we have the + * physical cpu id in r24, we need to search the pacas to find + * which logical id maps to our physical one. + */ + LOADADDR(r13, paca) /* Get base vaddr of paca array */ + li r5,0 /* logical cpu id */ +1: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */ + cmpw r6,r24 /* Compare to our id */ + beq 2f + addi r13,r13,PACA_SIZE /* Loop to next PACA on miss */ + addi r5,r5,1 + cmpwi r5,NR_CPUS + blt 1b + + mr r3,r24 /* not found, copy phys to r3 */ + b .kexec_wait /* next kernel might do better */ + +2: mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */ + /* From now on, r24 is expected to be logical cpuid */ + mr r24,r5 +3: HMT_LOW + lbz r23,PACAPROCSTART(r13) /* Test if this processor should */ + /* start. */ + sync + + /* Create a temp kernel stack for use before relocation is on. */ + ld r1,PACAEMERGSP(r13) + subi r1,r1,STACK_FRAME_OVERHEAD + + cmpwi 0,r23,0 +#ifdef CONFIG_SMP + bne .__secondary_start +#endif + b 3b /* Loop until told to go */ + +#ifdef CONFIG_PPC_ISERIES +_STATIC(__start_initialization_iSeries) + /* Clear out the BSS */ + LOADADDR(r11,__bss_stop) + LOADADDR(r8,__bss_start) + sub r11,r11,r8 /* bss size */ + addi r11,r11,7 /* round up to an even double word */ + rldicl. r11,r11,61,3 /* shift right by 3 */ + beq 4f + addi r8,r8,-8 + li r0,0 + mtctr r11 /* zero this many doublewords */ +3: stdu r0,8(r8) + bdnz 3b +4: + LOADADDR(r1,init_thread_union) + addi r1,r1,THREAD_SIZE + li r0,0 + stdu r0,-STACK_FRAME_OVERHEAD(r1) + + LOADADDR(r3,cpu_specs) + LOADADDR(r4,cur_cpu_spec) + li r5,0 + bl .identify_cpu + + LOADADDR(r2,__toc_start) + addi r2,r2,0x4000 + addi r2,r2,0x4000 + + bl .iSeries_early_setup + bl .early_setup + + /* relocation is on at this point */ + + b .start_here_common +#endif /* CONFIG_PPC_ISERIES */ + +#ifdef CONFIG_PPC_MULTIPLATFORM + +_STATIC(__mmu_off) + mfmsr r3 + andi. r0,r3,MSR_IR|MSR_DR + beqlr + andc r3,r3,r0 + mtspr SPRN_SRR0,r4 + mtspr SPRN_SRR1,r3 + sync + rfid + b . /* prevent speculative execution */ + + +/* + * Here is our main kernel entry point. We support currently 2 kind of entries + * depending on the value of r5. + * + * r5 != NULL -> OF entry, we go to prom_init, "legacy" parameter content + * in r3...r7 + * + * r5 == NULL -> kexec style entry. r3 is a physical pointer to the + * DT block, r4 is a physical pointer to the kernel itself + * + */ +_GLOBAL(__start_initialization_multiplatform) + /* + * Are we booted from a PROM Of-type client-interface ? + */ + cmpldi cr0,r5,0 + bne .__boot_from_prom /* yes -> prom */ + + /* Save parameters */ + mr r31,r3 + mr r30,r4 + + /* Make sure we are running in 64 bits mode */ + bl .enable_64b_mode + + /* Setup some critical 970 SPRs before switching MMU off */ + bl .__970_cpu_preinit + + /* cpu # */ + li r24,0 + + /* Switch off MMU if not already */ + LOADADDR(r4, .__after_prom_start - KERNELBASE) + add r4,r4,r30 + bl .__mmu_off + b .__after_prom_start + +_STATIC(__boot_from_prom) + /* Save parameters */ + mr r31,r3 + mr r30,r4 + mr r29,r5 + mr r28,r6 + mr r27,r7 + + /* Make sure we are running in 64 bits mode */ + bl .enable_64b_mode + + /* put a relocation offset into r3 */ + bl .reloc_offset + + LOADADDR(r2,__toc_start) + addi r2,r2,0x4000 + addi r2,r2,0x4000 + + /* Relocate the TOC from a virt addr to a real addr */ + sub r2,r2,r3 + + /* Restore parameters */ + mr r3,r31 + mr r4,r30 + mr r5,r29 + mr r6,r28 + mr r7,r27 + + /* Do all of the interaction with OF client interface */ + bl .prom_init + /* We never return */ + trap + +/* + * At this point, r3 contains the physical address we are running at, + * returned by prom_init() + */ +_STATIC(__after_prom_start) + +/* + * We need to run with __start at physical address 0. + * This will leave some code in the first 256B of + * real memory, which are reserved for software use. + * The remainder of the first page is loaded with the fixed + * interrupt vectors. The next two pages are filled with + * unknown exception placeholders. + * + * Note: This process overwrites the OF exception vectors. + * r26 == relocation offset + * r27 == KERNELBASE + */ + bl .reloc_offset + mr r26,r3 + SET_REG_TO_CONST(r27,KERNELBASE) + + li r3,0 /* target addr */ + + // XXX FIXME: Use phys returned by OF (r30) + sub r4,r27,r26 /* source addr */ + /* current address of _start */ + /* i.e. where we are running */ + /* the source addr */ + + LOADADDR(r5,copy_to_here) /* # bytes of memory to copy */ + sub r5,r5,r27 + + li r6,0x100 /* Start offset, the first 0x100 */ + /* bytes were copied earlier. */ + + bl .copy_and_flush /* copy the first n bytes */ + /* this includes the code being */ + /* executed here. */ + + LOADADDR(r0, 4f) /* Jump to the copy of this code */ + mtctr r0 /* that we just made/relocated */ + bctr + +4: LOADADDR(r5,klimit) + sub r5,r5,r26 + ld r5,0(r5) /* get the value of klimit */ + sub r5,r5,r27 + bl .copy_and_flush /* copy the rest */ + b .start_here_multiplatform + +#endif /* CONFIG_PPC_MULTIPLATFORM */ + +/* + * Copy routine used to copy the kernel to start at physical address 0 + * and flush and invalidate the caches as needed. + * r3 = dest addr, r4 = source addr, r5 = copy limit, r6 = start offset + * on exit, r3, r4, r5 are unchanged, r6 is updated to be >= r5. + * + * Note: this routine *only* clobbers r0, r6 and lr + */ +_GLOBAL(copy_and_flush) + addi r5,r5,-8 + addi r6,r6,-8 +4: li r0,16 /* Use the least common */ + /* denominator cache line */ + /* size. This results in */ + /* extra cache line flushes */ + /* but operation is correct. */ + /* Can't get cache line size */ + /* from NACA as it is being */ + /* moved too. */ + + mtctr r0 /* put # words/line in ctr */ +3: addi r6,r6,8 /* copy a cache line */ + ldx r0,r6,r4 + stdx r0,r6,r3 + bdnz 3b + dcbst r6,r3 /* write it to memory */ + sync + icbi r6,r3 /* flush the icache line */ + cmpld 0,r6,r5 + blt 4b + sync + addi r5,r5,8 + addi r6,r6,8 + blr + +.align 8 +copy_to_here: + +#ifdef CONFIG_SMP +#ifdef CONFIG_PPC_PMAC +/* + * On PowerMac, secondary processors starts from the reset vector, which + * is temporarily turned into a call to one of the functions below. + */ + .section ".text"; + .align 2 ; + + .globl __secondary_start_pmac_0 +__secondary_start_pmac_0: + /* NB the entries for cpus 0, 1, 2 must each occupy 8 bytes. */ + li r24,0 + b 1f + li r24,1 + b 1f + li r24,2 + b 1f + li r24,3 +1: + +_GLOBAL(pmac_secondary_start) + /* turn on 64-bit mode */ + bl .enable_64b_mode + isync + + /* Copy some CPU settings from CPU 0 */ + bl .__restore_cpu_setup + + /* pSeries do that early though I don't think we really need it */ + mfmsr r3 + ori r3,r3,MSR_RI + mtmsrd r3 /* RI on */ + + /* Set up a paca value for this processor. */ + LOADADDR(r4, paca) /* Get base vaddr of paca array */ + mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */ + add r13,r13,r4 /* for this processor. */ + mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */ + + /* Create a temp kernel stack for use before relocation is on. */ + ld r1,PACAEMERGSP(r13) + subi r1,r1,STACK_FRAME_OVERHEAD + + b .__secondary_start + +#endif /* CONFIG_PPC_PMAC */ + +/* + * This function is called after the master CPU has released the + * secondary processors. The execution environment is relocation off. + * The paca for this processor has the following fields initialized at + * this point: + * 1. Processor number + * 2. Segment table pointer (virtual address) + * On entry the following are set: + * r1 = stack pointer. vaddr for iSeries, raddr (temp stack) for pSeries + * r24 = cpu# (in Linux terms) + * r13 = paca virtual address + * SPRG3 = paca virtual address + */ +_GLOBAL(__secondary_start) + + HMT_MEDIUM /* Set thread priority to MEDIUM */ + + ld r2,PACATOC(r13) + + /* Do early setup for that CPU */ + bl .early_setup_secondary + + /* Initialize the kernel stack. Just a repeat for iSeries. */ + LOADADDR(r3,current_set) + sldi r28,r24,3 /* get current_set[cpu#] */ + ldx r1,r3,r28 + addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD + std r1,PACAKSAVE(r13) + + li r7,0 + mtlr r7 + + /* enable MMU and jump to start_secondary */ + LOADADDR(r3,.start_secondary_prolog) + SET_REG_TO_CONST(r4, MSR_KERNEL) +#ifdef DO_SOFT_DISABLE + ori r4,r4,MSR_EE +#endif + mtspr SPRN_SRR0,r3 + mtspr SPRN_SRR1,r4 + rfid + b . /* prevent speculative execution */ + +/* + * Running with relocation on at this point. All we want to do is + * zero the stack back-chain pointer before going into C code. + */ +_GLOBAL(start_secondary_prolog) + li r3,0 + std r3,0(r1) /* Zero the stack frame pointer */ + bl .start_secondary +#endif + +/* + * This subroutine clobbers r11 and r12 + */ +_GLOBAL(enable_64b_mode) + mfmsr r11 /* grab the current MSR */ + li r12,1 + rldicr r12,r12,MSR_SF_LG,(63-MSR_SF_LG) + or r11,r11,r12 + li r12,1 + rldicr r12,r12,MSR_ISF_LG,(63-MSR_ISF_LG) + or r11,r11,r12 + mtmsrd r11 + isync + blr + +#ifdef CONFIG_PPC_MULTIPLATFORM +/* + * This is where the main kernel code starts. + */ +_STATIC(start_here_multiplatform) + /* get a new offset, now that the kernel has moved. */ + bl .reloc_offset + mr r26,r3 + + /* Clear out the BSS. It may have been done in prom_init, + * already but that's irrelevant since prom_init will soon + * be detached from the kernel completely. Besides, we need + * to clear it now for kexec-style entry. + */ + LOADADDR(r11,__bss_stop) + LOADADDR(r8,__bss_start) + sub r11,r11,r8 /* bss size */ + addi r11,r11,7 /* round up to an even double word */ + rldicl. r11,r11,61,3 /* shift right by 3 */ + beq 4f + addi r8,r8,-8 + li r0,0 + mtctr r11 /* zero this many doublewords */ +3: stdu r0,8(r8) + bdnz 3b +4: + + mfmsr r6 + ori r6,r6,MSR_RI + mtmsrd r6 /* RI on */ + +#ifdef CONFIG_HMT + /* Start up the second thread on cpu 0 */ + mfspr r3,SPRN_PVR + srwi r3,r3,16 + cmpwi r3,0x34 /* Pulsar */ + beq 90f + cmpwi r3,0x36 /* Icestar */ + beq 90f + cmpwi r3,0x37 /* SStar */ + beq 90f + b 91f /* HMT not supported */ +90: li r3,0 + bl .hmt_start_secondary +91: +#endif + + /* The following gets the stack and TOC set up with the regs */ + /* pointing to the real addr of the kernel stack. This is */ + /* all done to support the C function call below which sets */ + /* up the htab. This is done because we have relocated the */ + /* kernel but are still running in real mode. */ + + LOADADDR(r3,init_thread_union) + sub r3,r3,r26 + + /* set up a stack pointer (physical address) */ + addi r1,r3,THREAD_SIZE + li r0,0 + stdu r0,-STACK_FRAME_OVERHEAD(r1) + + /* set up the TOC (physical address) */ + LOADADDR(r2,__toc_start) + addi r2,r2,0x4000 + addi r2,r2,0x4000 + sub r2,r2,r26 + + LOADADDR(r3,cpu_specs) + sub r3,r3,r26 + LOADADDR(r4,cur_cpu_spec) + sub r4,r4,r26 + mr r5,r26 + bl .identify_cpu + + /* Save some low level config HIDs of CPU0 to be copied to + * other CPUs later on, or used for suspend/resume + */ + bl .__save_cpu_setup + sync + + /* Setup a valid physical PACA pointer in SPRG3 for early_setup + * note that boot_cpuid can always be 0 nowadays since there is + * nowhere it can be initialized differently before we reach this + * code + */ + LOADADDR(r27, boot_cpuid) + sub r27,r27,r26 + lwz r27,0(r27) + + LOADADDR(r24, paca) /* Get base vaddr of paca array */ + mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */ + add r13,r13,r24 /* for this processor. */ + sub r13,r13,r26 /* convert to physical addr */ + mtspr SPRN_SPRG3,r13 /* PPPBBB: Temp... -Peter */ + + /* Do very early kernel initializations, including initial hash table, + * stab and slb setup before we turn on relocation. */ + + /* Restore parameters passed from prom_init/kexec */ + mr r3,r31 + bl .early_setup + + LOADADDR(r3,.start_here_common) + SET_REG_TO_CONST(r4, MSR_KERNEL) + mtspr SPRN_SRR0,r3 + mtspr SPRN_SRR1,r4 + rfid + b . /* prevent speculative execution */ +#endif /* CONFIG_PPC_MULTIPLATFORM */ + + /* This is where all platforms converge execution */ +_STATIC(start_here_common) + /* relocation is on at this point */ + + /* The following code sets up the SP and TOC now that we are */ + /* running with translation enabled. */ + + LOADADDR(r3,init_thread_union) + + /* set up the stack */ + addi r1,r3,THREAD_SIZE + li r0,0 + stdu r0,-STACK_FRAME_OVERHEAD(r1) + + /* Apply the CPUs-specific fixups (nop out sections not relevant + * to this CPU + */ + li r3,0 + bl .do_cpu_ftr_fixups + + LOADADDR(r26, boot_cpuid) + lwz r26,0(r26) + + LOADADDR(r24, paca) /* Get base vaddr of paca array */ + mulli r13,r26,PACA_SIZE /* Calculate vaddr of right paca */ + add r13,r13,r24 /* for this processor. */ + mtspr SPRN_SPRG3,r13 + + /* ptr to current */ + LOADADDR(r4,init_task) + std r4,PACACURRENT(r13) + + /* Load the TOC */ + ld r2,PACATOC(r13) + std r1,PACAKSAVE(r13) + + bl .setup_system + + /* Load up the kernel context */ +5: +#ifdef DO_SOFT_DISABLE + li r5,0 + stb r5,PACAPROCENABLED(r13) /* Soft Disabled */ + mfmsr r5 + ori r5,r5,MSR_EE /* Hard Enabled */ + mtmsrd r5 +#endif + + bl .start_kernel + +_GLOBAL(hmt_init) +#ifdef CONFIG_HMT + LOADADDR(r5, hmt_thread_data) + mfspr r7,SPRN_PVR + srwi r7,r7,16 + cmpwi r7,0x34 /* Pulsar */ + beq 90f + cmpwi r7,0x36 /* Icestar */ + beq 91f + cmpwi r7,0x37 /* SStar */ + beq 91f + b 101f +90: mfspr r6,SPRN_PIR + andi. r6,r6,0x1f + b 92f +91: mfspr r6,SPRN_PIR + andi. r6,r6,0x3ff +92: sldi r4,r24,3 + stwx r6,r5,r4 + bl .hmt_start_secondary + b 101f + +__hmt_secondary_hold: + LOADADDR(r5, hmt_thread_data) + clrldi r5,r5,4 + li r7,0 + mfspr r6,SPRN_PIR + mfspr r8,SPRN_PVR + srwi r8,r8,16 + cmpwi r8,0x34 + bne 93f + andi. r6,r6,0x1f + b 103f +93: andi. r6,r6,0x3f + +103: lwzx r8,r5,r7 + cmpw r8,r6 + beq 104f + addi r7,r7,8 + b 103b + +104: addi r7,r7,4 + lwzx r9,r5,r7 + mr r24,r9 +101: +#endif + mr r3,r24 + b .pSeries_secondary_smp_init + +#ifdef CONFIG_HMT +_GLOBAL(hmt_start_secondary) + LOADADDR(r4,__hmt_secondary_hold) + clrldi r4,r4,4 + mtspr SPRN_NIADORM, r4 + mfspr r4, SPRN_MSRDORM + li r5, -65 + and r4, r4, r5 + mtspr SPRN_MSRDORM, r4 + lis r4,0xffef + ori r4,r4,0x7403 + mtspr SPRN_TSC, r4 + li r4,0x1f4 + mtspr SPRN_TST, r4 + mfspr r4, SPRN_HID0 + ori r4, r4, 0x1 + mtspr SPRN_HID0, r4 + mfspr r4, SPRN_CTRLF + oris r4, r4, 0x40 + mtspr SPRN_CTRLT, r4 + blr +#endif + +/* + * We put a few things here that have to be page-aligned. + * This stuff goes at the beginning of the bss, which is page-aligned. + */ + .section ".bss" + + .align PAGE_SHIFT + + .globl empty_zero_page +empty_zero_page: + .space PAGE_SIZE + + .globl swapper_pg_dir +swapper_pg_dir: + .space PAGE_SIZE + +/* + * This space gets a copy of optional info passed to us by the bootstrap + * Used to pass parameters into the kernel like root=/dev/sda1, etc. + */ + .globl cmd_line +cmd_line: + .space COMMAND_LINE_SIZE diff --git a/trunk/arch/powerpc/platforms/pseries/hvconsole.c b/trunk/arch/ppc64/kernel/hvconsole.c similarity index 100% rename from trunk/arch/powerpc/platforms/pseries/hvconsole.c rename to trunk/arch/ppc64/kernel/hvconsole.c diff --git a/trunk/arch/powerpc/platforms/pseries/hvcserver.c b/trunk/arch/ppc64/kernel/hvcserver.c similarity index 100% rename from trunk/arch/powerpc/platforms/pseries/hvcserver.c rename to trunk/arch/ppc64/kernel/hvcserver.c diff --git a/trunk/arch/powerpc/kernel/idle_64.c b/trunk/arch/ppc64/kernel/idle.c similarity index 100% rename from trunk/arch/powerpc/kernel/idle_64.c rename to trunk/arch/ppc64/kernel/idle.c diff --git a/trunk/arch/powerpc/kernel/iomap.c b/trunk/arch/ppc64/kernel/iomap.c similarity index 100% rename from trunk/arch/powerpc/kernel/iomap.c rename to trunk/arch/ppc64/kernel/iomap.c diff --git a/trunk/arch/powerpc/kernel/iommu.c b/trunk/arch/ppc64/kernel/iommu.c similarity index 100% rename from trunk/arch/powerpc/kernel/iommu.c rename to trunk/arch/ppc64/kernel/iommu.c diff --git a/trunk/arch/powerpc/kernel/kprobes.c b/trunk/arch/ppc64/kernel/kprobes.c similarity index 99% rename from trunk/arch/powerpc/kernel/kprobes.c rename to trunk/arch/ppc64/kernel/kprobes.c index 5368f9c2e6bf..511af54e6230 100644 --- a/trunk/arch/powerpc/kernel/kprobes.c +++ b/trunk/arch/ppc64/kernel/kprobes.c @@ -177,7 +177,7 @@ static inline int kprobe_handler(struct pt_regs *regs) save_previous_kprobe(kcb); set_current_kprobe(p, regs, kcb); kcb->kprobe_saved_msr = regs->msr; - kprobes_inc_nmissed_count(p); + p->nmissed++; prepare_singlestep(p, regs); kcb->kprobe_status = KPROBE_REENTER; return 1; diff --git a/trunk/arch/powerpc/kernel/machine_kexec_64.c b/trunk/arch/ppc64/kernel/machine_kexec.c similarity index 85% rename from trunk/arch/powerpc/kernel/machine_kexec_64.c rename to trunk/arch/ppc64/kernel/machine_kexec.c index 97c51e452be7..07ea03598c00 100644 --- a/trunk/arch/powerpc/kernel/machine_kexec_64.c +++ b/trunk/arch/ppc64/kernel/machine_kexec.c @@ -185,8 +185,8 @@ void kexec_copy_flush(struct kimage *image) */ void kexec_smp_down(void *arg) { - if (ppc_md.kexec_cpu_down) - ppc_md.kexec_cpu_down(0, 1); + if (ppc_md.cpu_irq_down) + ppc_md.cpu_irq_down(1); local_irq_disable(); kexec_smp_wait(); @@ -233,8 +233,8 @@ static void kexec_prepare_cpus(void) } /* after we tell the others to go down */ - if (ppc_md.kexec_cpu_down) - ppc_md.kexec_cpu_down(0, 0); + if (ppc_md.cpu_irq_down) + ppc_md.cpu_irq_down(0); put_cpu(); @@ -255,8 +255,8 @@ static void kexec_prepare_cpus(void) * UP to an SMP kernel. */ smp_release_cpus(); - if (ppc_md.kexec_cpu_down) - ppc_md.kexec_cpu_down(0, 0); + if (ppc_md.cpu_irq_down) + ppc_md.cpu_irq_down(0); local_irq_disable(); } @@ -305,54 +305,3 @@ void machine_kexec(struct kimage *image) ppc_md.hpte_clear_all); /* NOTREACHED */ } - -/* Values we need to export to the second kernel via the device tree. */ -static unsigned long htab_base, htab_size, kernel_end; - -static struct property htab_base_prop = { - .name = "linux,htab-base", - .length = sizeof(unsigned long), - .value = (unsigned char *)&htab_base, -}; - -static struct property htab_size_prop = { - .name = "linux,htab-size", - .length = sizeof(unsigned long), - .value = (unsigned char *)&htab_size, -}; - -static struct property kernel_end_prop = { - .name = "linux,kernel-end", - .length = sizeof(unsigned long), - .value = (unsigned char *)&kernel_end, -}; - -static void __init export_htab_values(void) -{ - struct device_node *node; - - node = of_find_node_by_path("/chosen"); - if (!node) - return; - - kernel_end = __pa(_end); - prom_add_property(node, &kernel_end_prop); - - /* On machines with no htab htab_address is NULL */ - if (NULL == htab_address) - goto out; - - htab_base = __pa(htab_address); - prom_add_property(node, &htab_base_prop); - - htab_size = 1UL << ppc64_pft_size; - prom_add_property(node, &htab_size_prop); - - out: - of_node_put(node); -} - -void __init kexec_setup(void) -{ - export_htab_values(); -} diff --git a/trunk/arch/ppc64/kernel/misc.S b/trunk/arch/ppc64/kernel/misc.S new file mode 100644 index 000000000000..5e089deb0a2b --- /dev/null +++ b/trunk/arch/ppc64/kernel/misc.S @@ -0,0 +1,940 @@ +/* + * arch/ppc/kernel/misc.S + * + * + * + * This file contains miscellaneous low-level functions. + * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) + * + * Largely rewritten by Cort Dougan (cort@cs.nmt.edu) + * and Paul Mackerras. + * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com) + * PPC64 updates by Dave Engebretsen (engebret@us.ibm.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. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + .text + +/* + * Returns (address we were linked at) - (address we are running at) + * for use before the text and data are mapped to KERNELBASE. + */ + +_GLOBAL(reloc_offset) + mflr r0 + bl 1f +1: mflr r3 + LOADADDR(r4,1b) + sub r3,r4,r3 + mtlr r0 + blr + +_GLOBAL(get_msr) + mfmsr r3 + blr + +_GLOBAL(get_dar) + mfdar r3 + blr + +_GLOBAL(get_srr0) + mfsrr0 r3 + blr + +_GLOBAL(get_srr1) + mfsrr1 r3 + blr + +_GLOBAL(get_sp) + mr r3,r1 + blr + +#ifdef CONFIG_IRQSTACKS +_GLOBAL(call_do_softirq) + mflr r0 + std r0,16(r1) + stdu r1,THREAD_SIZE-112(r3) + mr r1,r3 + bl .__do_softirq + ld r1,0(r1) + ld r0,16(r1) + mtlr r0 + blr + +_GLOBAL(call___do_IRQ) + mflr r0 + std r0,16(r1) + stdu r1,THREAD_SIZE-112(r5) + mr r1,r5 + bl .__do_IRQ + ld r1,0(r1) + ld r0,16(r1) + mtlr r0 + blr +#endif /* CONFIG_IRQSTACKS */ + + /* + * To be called by C code which needs to do some operations with MMU + * disabled. Note that interrupts have to be disabled by the caller + * prior to calling us. The code called _MUST_ be in the RMO of course + * and part of the linear mapping as we don't attempt to translate the + * stack pointer at all. The function is called with the stack switched + * to this CPU emergency stack + * + * prototype is void *call_with_mmu_off(void *func, void *data); + * + * the called function is expected to be of the form + * + * void *called(void *data); + */ +_GLOBAL(call_with_mmu_off) + mflr r0 /* get link, save it on stackframe */ + std r0,16(r1) + mr r1,r5 /* save old stack ptr */ + ld r1,PACAEMERGSP(r13) /* get emerg. stack */ + subi r1,r1,STACK_FRAME_OVERHEAD + std r0,16(r1) /* save link on emerg. stack */ + std r5,0(r1) /* save old stack ptr in backchain */ + ld r3,0(r3) /* get to real function ptr (assume same TOC) */ + bl 2f /* we need LR to return, continue at label 2 */ + + ld r0,16(r1) /* we return here from the call, get LR and */ + ld r1,0(r1) /* .. old stack ptr */ + mtspr SPRN_SRR0,r0 /* and get back to virtual mode with these */ + mfmsr r4 + ori r4,r4,MSR_IR|MSR_DR + mtspr SPRN_SRR1,r4 + rfid + +2: mtspr SPRN_SRR0,r3 /* coming from above, enter real mode */ + mr r3,r4 /* get parameter */ + mfmsr r0 + ori r0,r0,MSR_IR|MSR_DR + xori r0,r0,MSR_IR|MSR_DR + mtspr SPRN_SRR1,r0 + rfid + + + .section ".toc","aw" +PPC64_CACHES: + .tc ppc64_caches[TC],ppc64_caches + .section ".text" + +/* + * Write any modified data cache blocks out to memory + * and invalidate the corresponding instruction cache blocks. + * + * flush_icache_range(unsigned long start, unsigned long stop) + * + * flush all bytes from start through stop-1 inclusive + */ + +_KPROBE(__flush_icache_range) + +/* + * Flush the data cache to memory + * + * Different systems have different cache line sizes + * and in some cases i-cache and d-cache line sizes differ from + * each other. + */ + ld r10,PPC64_CACHES@toc(r2) + lwz r7,DCACHEL1LINESIZE(r10)/* Get cache line size */ + addi r5,r7,-1 + andc r6,r3,r5 /* round low to line bdy */ + subf r8,r6,r4 /* compute length */ + add r8,r8,r5 /* ensure we get enough */ + lwz r9,DCACHEL1LOGLINESIZE(r10) /* Get log-2 of cache line size */ + srw. r8,r8,r9 /* compute line count */ + beqlr /* nothing to do? */ + mtctr r8 +1: dcbst 0,r6 + add r6,r6,r7 + bdnz 1b + sync + +/* Now invalidate the instruction cache */ + + lwz r7,ICACHEL1LINESIZE(r10) /* Get Icache line size */ + addi r5,r7,-1 + andc r6,r3,r5 /* round low to line bdy */ + subf r8,r6,r4 /* compute length */ + add r8,r8,r5 + lwz r9,ICACHEL1LOGLINESIZE(r10) /* Get log-2 of Icache line size */ + srw. r8,r8,r9 /* compute line count */ + beqlr /* nothing to do? */ + mtctr r8 +2: icbi 0,r6 + add r6,r6,r7 + bdnz 2b + isync + blr + + .text +/* + * Like above, but only do the D-cache. + * + * flush_dcache_range(unsigned long start, unsigned long stop) + * + * flush all bytes from start to stop-1 inclusive + */ +_GLOBAL(flush_dcache_range) + +/* + * Flush the data cache to memory + * + * Different systems have different cache line sizes + */ + ld r10,PPC64_CACHES@toc(r2) + lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */ + addi r5,r7,-1 + andc r6,r3,r5 /* round low to line bdy */ + subf r8,r6,r4 /* compute length */ + add r8,r8,r5 /* ensure we get enough */ + lwz r9,DCACHEL1LOGLINESIZE(r10) /* Get log-2 of dcache line size */ + srw. r8,r8,r9 /* compute line count */ + beqlr /* nothing to do? */ + mtctr r8 +0: dcbst 0,r6 + add r6,r6,r7 + bdnz 0b + sync + blr + +/* + * Like above, but works on non-mapped physical addresses. + * Use only for non-LPAR setups ! It also assumes real mode + * is cacheable. Used for flushing out the DART before using + * it as uncacheable memory + * + * flush_dcache_phys_range(unsigned long start, unsigned long stop) + * + * flush all bytes from start to stop-1 inclusive + */ +_GLOBAL(flush_dcache_phys_range) + ld r10,PPC64_CACHES@toc(r2) + lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */ + addi r5,r7,-1 + andc r6,r3,r5 /* round low to line bdy */ + subf r8,r6,r4 /* compute length */ + add r8,r8,r5 /* ensure we get enough */ + lwz r9,DCACHEL1LOGLINESIZE(r10) /* Get log-2 of dcache line size */ + srw. r8,r8,r9 /* compute line count */ + beqlr /* nothing to do? */ + mfmsr r5 /* Disable MMU Data Relocation */ + ori r0,r5,MSR_DR + xori r0,r0,MSR_DR + sync + mtmsr r0 + sync + isync + mtctr r8 +0: dcbst 0,r6 + add r6,r6,r7 + bdnz 0b + sync + isync + mtmsr r5 /* Re-enable MMU Data Relocation */ + sync + isync + blr + +_GLOBAL(flush_inval_dcache_range) + ld r10,PPC64_CACHES@toc(r2) + lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */ + addi r5,r7,-1 + andc r6,r3,r5 /* round low to line bdy */ + subf r8,r6,r4 /* compute length */ + add r8,r8,r5 /* ensure we get enough */ + lwz r9,DCACHEL1LOGLINESIZE(r10)/* Get log-2 of dcache line size */ + srw. r8,r8,r9 /* compute line count */ + beqlr /* nothing to do? */ + sync + isync + mtctr r8 +0: dcbf 0,r6 + add r6,r6,r7 + bdnz 0b + sync + isync + blr + + +/* + * Flush a particular page from the data cache to RAM. + * Note: this is necessary because the instruction cache does *not* + * snoop from the data cache. + * + * void __flush_dcache_icache(void *page) + */ +_GLOBAL(__flush_dcache_icache) +/* + * Flush the data cache to memory + * + * Different systems have different cache line sizes + */ + +/* Flush the dcache */ + ld r7,PPC64_CACHES@toc(r2) + clrrdi r3,r3,PAGE_SHIFT /* Page align */ + lwz r4,DCACHEL1LINESPERPAGE(r7) /* Get # dcache lines per page */ + lwz r5,DCACHEL1LINESIZE(r7) /* Get dcache line size */ + mr r6,r3 + mtctr r4 +0: dcbst 0,r6 + add r6,r6,r5 + bdnz 0b + sync + +/* Now invalidate the icache */ + + lwz r4,ICACHEL1LINESPERPAGE(r7) /* Get # icache lines per page */ + lwz r5,ICACHEL1LINESIZE(r7) /* Get icache line size */ + mtctr r4 +1: icbi 0,r3 + add r3,r3,r5 + bdnz 1b + isync + blr + +/* + * I/O string operations + * + * insb(port, buf, len) + * outsb(port, buf, len) + * insw(port, buf, len) + * outsw(port, buf, len) + * insl(port, buf, len) + * outsl(port, buf, len) + * insw_ns(port, buf, len) + * outsw_ns(port, buf, len) + * insl_ns(port, buf, len) + * outsl_ns(port, buf, len) + * + * The *_ns versions don't do byte-swapping. + */ +_GLOBAL(_insb) + cmpwi 0,r5,0 + mtctr r5 + subi r4,r4,1 + blelr- +00: lbz r5,0(r3) + eieio + stbu r5,1(r4) + bdnz 00b + twi 0,r5,0 + isync + blr + +_GLOBAL(_outsb) + cmpwi 0,r5,0 + mtctr r5 + subi r4,r4,1 + blelr- +00: lbzu r5,1(r4) + stb r5,0(r3) + bdnz 00b + sync + blr + +_GLOBAL(_insw) + cmpwi 0,r5,0 + mtctr r5 + subi r4,r4,2 + blelr- +00: lhbrx r5,0,r3 + eieio + sthu r5,2(r4) + bdnz 00b + twi 0,r5,0 + isync + blr + +_GLOBAL(_outsw) + cmpwi 0,r5,0 + mtctr r5 + subi r4,r4,2 + blelr- +00: lhzu r5,2(r4) + sthbrx r5,0,r3 + bdnz 00b + sync + blr + +_GLOBAL(_insl) + cmpwi 0,r5,0 + mtctr r5 + subi r4,r4,4 + blelr- +00: lwbrx r5,0,r3 + eieio + stwu r5,4(r4) + bdnz 00b + twi 0,r5,0 + isync + blr + +_GLOBAL(_outsl) + cmpwi 0,r5,0 + mtctr r5 + subi r4,r4,4 + blelr- +00: lwzu r5,4(r4) + stwbrx r5,0,r3 + bdnz 00b + sync + blr + +/* _GLOBAL(ide_insw) now in drivers/ide/ide-iops.c */ +_GLOBAL(_insw_ns) + cmpwi 0,r5,0 + mtctr r5 + subi r4,r4,2 + blelr- +00: lhz r5,0(r3) + eieio + sthu r5,2(r4) + bdnz 00b + twi 0,r5,0 + isync + blr + +/* _GLOBAL(ide_outsw) now in drivers/ide/ide-iops.c */ +_GLOBAL(_outsw_ns) + cmpwi 0,r5,0 + mtctr r5 + subi r4,r4,2 + blelr- +00: lhzu r5,2(r4) + sth r5,0(r3) + bdnz 00b + sync + blr + +_GLOBAL(_insl_ns) + cmpwi 0,r5,0 + mtctr r5 + subi r4,r4,4 + blelr- +00: lwz r5,0(r3) + eieio + stwu r5,4(r4) + bdnz 00b + twi 0,r5,0 + isync + blr + +_GLOBAL(_outsl_ns) + cmpwi 0,r5,0 + mtctr r5 + subi r4,r4,4 + blelr- +00: lwzu r5,4(r4) + stw r5,0(r3) + bdnz 00b + sync + blr + +/* + * identify_cpu and calls setup_cpu + * In: r3 = base of the cpu_specs array + * r4 = address of cur_cpu_spec + * r5 = relocation offset + */ +_GLOBAL(identify_cpu) + mfpvr r7 +1: + lwz r8,CPU_SPEC_PVR_MASK(r3) + and r8,r8,r7 + lwz r9,CPU_SPEC_PVR_VALUE(r3) + cmplw 0,r9,r8 + beq 1f + addi r3,r3,CPU_SPEC_ENTRY_SIZE + b 1b +1: + add r0,r3,r5 + std r0,0(r4) + ld r4,CPU_SPEC_SETUP(r3) + sub r4,r4,r5 + ld r4,0(r4) + sub r4,r4,r5 + mtctr r4 + /* Calling convention for cpu setup is r3=offset, r4=cur_cpu_spec */ + mr r4,r3 + mr r3,r5 + bctr + +/* + * do_cpu_ftr_fixups - goes through the list of CPU feature fixups + * and writes nop's over sections of code that don't apply for this cpu. + * r3 = data offset (not changed) + */ +_GLOBAL(do_cpu_ftr_fixups) + /* Get CPU 0 features */ + LOADADDR(r6,cur_cpu_spec) + sub r6,r6,r3 + ld r4,0(r6) + sub r4,r4,r3 + ld r4,CPU_SPEC_FEATURES(r4) + /* Get the fixup table */ + LOADADDR(r6,__start___ftr_fixup) + sub r6,r6,r3 + LOADADDR(r7,__stop___ftr_fixup) + sub r7,r7,r3 + /* Do the fixup */ +1: cmpld r6,r7 + bgelr + addi r6,r6,32 + ld r8,-32(r6) /* mask */ + and r8,r8,r4 + ld r9,-24(r6) /* value */ + cmpld r8,r9 + beq 1b + ld r8,-16(r6) /* section begin */ + ld r9,-8(r6) /* section end */ + subf. r9,r8,r9 + beq 1b + /* write nops over the section of code */ + /* todo: if large section, add a branch at the start of it */ + srwi r9,r9,2 + mtctr r9 + sub r8,r8,r3 + lis r0,0x60000000@h /* nop */ +3: stw r0,0(r8) + andi. r10,r4,CPU_FTR_SPLIT_ID_CACHE@l + beq 2f + dcbst 0,r8 /* suboptimal, but simpler */ + sync + icbi 0,r8 +2: addi r8,r8,4 + bdnz 3b + sync /* additional sync needed on g4 */ + isync + b 1b + +#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) +/* + * Do an IO access in real mode + */ +_GLOBAL(real_readb) + mfmsr r7 + ori r0,r7,MSR_DR + xori r0,r0,MSR_DR + sync + mtmsrd r0 + sync + isync + mfspr r6,SPRN_HID4 + rldicl r5,r6,32,0 + ori r5,r5,0x100 + rldicl r5,r5,32,0 + sync + mtspr SPRN_HID4,r5 + isync + slbia + isync + lbz r3,0(r3) + sync + mtspr SPRN_HID4,r6 + isync + slbia + isync + mtmsrd r7 + sync + isync + blr + +/* + * Do an IO access in real mode + */ +_GLOBAL(real_writeb) + mfmsr r7 + ori r0,r7,MSR_DR + xori r0,r0,MSR_DR + sync + mtmsrd r0 + sync + isync + mfspr r6,SPRN_HID4 + rldicl r5,r6,32,0 + ori r5,r5,0x100 + rldicl r5,r5,32,0 + sync + mtspr SPRN_HID4,r5 + isync + slbia + isync + stb r3,0(r4) + sync + mtspr SPRN_HID4,r6 + isync + slbia + isync + mtmsrd r7 + sync + isync + blr +#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */ + +/* + * SCOM access functions for 970 (FX only for now) + * + * unsigned long scom970_read(unsigned int address); + * void scom970_write(unsigned int address, unsigned long value); + * + * The address passed in is the 24 bits register address. This code + * is 970 specific and will not check the status bits, so you should + * know what you are doing. + */ +_GLOBAL(scom970_read) + /* interrupts off */ + mfmsr r4 + ori r0,r4,MSR_EE + xori r0,r0,MSR_EE + mtmsrd r0,1 + + /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits + * (including parity). On current CPUs they must be 0'd, + * and finally or in RW bit + */ + rlwinm r3,r3,8,0,15 + ori r3,r3,0x8000 + + /* do the actual scom read */ + sync + mtspr SPRN_SCOMC,r3 + isync + mfspr r3,SPRN_SCOMD + isync + mfspr r0,SPRN_SCOMC + isync + + /* XXX: fixup result on some buggy 970's (ouch ! we lost a bit, bah + * that's the best we can do). Not implemented yet as we don't use + * the scom on any of the bogus CPUs yet, but may have to be done + * ultimately + */ + + /* restore interrupts */ + mtmsrd r4,1 + blr + + +_GLOBAL(scom970_write) + /* interrupts off */ + mfmsr r5 + ori r0,r5,MSR_EE + xori r0,r0,MSR_EE + mtmsrd r0,1 + + /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits + * (including parity). On current CPUs they must be 0'd. + */ + + rlwinm r3,r3,8,0,15 + + sync + mtspr SPRN_SCOMD,r4 /* write data */ + isync + mtspr SPRN_SCOMC,r3 /* write command */ + isync + mfspr 3,SPRN_SCOMC + isync + + /* restore interrupts */ + mtmsrd r5,1 + blr + + +/* + * Create a kernel thread + * kernel_thread(fn, arg, flags) + */ +_GLOBAL(kernel_thread) + std r29,-24(r1) + std r30,-16(r1) + stdu r1,-STACK_FRAME_OVERHEAD(r1) + mr r29,r3 + mr r30,r4 + ori r3,r5,CLONE_VM /* flags */ + oris r3,r3,(CLONE_UNTRACED>>16) + li r4,0 /* new sp (unused) */ + li r0,__NR_clone + sc + cmpdi 0,r3,0 /* parent or child? */ + bne 1f /* return if parent */ + li r0,0 + stdu r0,-STACK_FRAME_OVERHEAD(r1) + ld r2,8(r29) + ld r29,0(r29) + mtlr r29 /* fn addr in lr */ + mr r3,r30 /* load arg and call fn */ + blrl + li r0,__NR_exit /* exit after child exits */ + li r3,0 + sc +1: addi r1,r1,STACK_FRAME_OVERHEAD + ld r29,-24(r1) + ld r30,-16(r1) + blr + +/* + * disable_kernel_fp() + * Disable the FPU. + */ +_GLOBAL(disable_kernel_fp) + mfmsr r3 + rldicl r0,r3,(63-MSR_FP_LG),1 + rldicl r3,r0,(MSR_FP_LG+1),0 + mtmsrd r3 /* disable use of fpu now */ + isync + blr + +#ifdef CONFIG_ALTIVEC + +#if 0 /* this has no callers for now */ +/* + * disable_kernel_altivec() + * Disable the VMX. + */ +_GLOBAL(disable_kernel_altivec) + mfmsr r3 + rldicl r0,r3,(63-MSR_VEC_LG),1 + rldicl r3,r0,(MSR_VEC_LG+1),0 + mtmsrd r3 /* disable use of VMX now */ + isync + blr +#endif /* 0 */ + +/* + * giveup_altivec(tsk) + * Disable VMX for the task given as the argument, + * and save the vector registers in its thread_struct. + * Enables the VMX for use in the kernel on return. + */ +_GLOBAL(giveup_altivec) + mfmsr r5 + oris r5,r5,MSR_VEC@h + mtmsrd r5 /* enable use of VMX now */ + isync + cmpdi 0,r3,0 + beqlr- /* if no previous owner, done */ + addi r3,r3,THREAD /* want THREAD of task */ + ld r5,PT_REGS(r3) + cmpdi 0,r5,0 + SAVE_32VRS(0,r4,r3) + mfvscr vr0 + li r4,THREAD_VSCR + stvx vr0,r4,r3 + beq 1f + ld r4,_MSR-STACK_FRAME_OVERHEAD(r5) + lis r3,MSR_VEC@h + andc r4,r4,r3 /* disable FP for previous task */ + std r4,_MSR-STACK_FRAME_OVERHEAD(r5) +1: +#ifndef CONFIG_SMP + li r5,0 + ld r4,last_task_used_altivec@got(r2) + std r5,0(r4) +#endif /* CONFIG_SMP */ + blr + +#endif /* CONFIG_ALTIVEC */ + +_GLOBAL(__setup_cpu_power3) + blr + +_GLOBAL(execve) + li r0,__NR_execve + sc + bnslr + neg r3,r3 + blr + +/* kexec_wait(phys_cpu) + * + * wait for the flag to change, indicating this kernel is going away but + * the slave code for the next one is at addresses 0 to 100. + * + * This is used by all slaves. + * + * Physical (hardware) cpu id should be in r3. + */ +_GLOBAL(kexec_wait) + bl 1f +1: mflr r5 + addi r5,r5,kexec_flag-1b + +99: HMT_LOW +#ifdef CONFIG_KEXEC /* use no memory without kexec */ + lwz r4,0(r5) + cmpwi 0,r4,0 + bnea 0x60 +#endif + b 99b + +/* this can be in text because we won't change it until we are + * running in real anyways + */ +kexec_flag: + .long 0 + + +#ifdef CONFIG_KEXEC + +/* kexec_smp_wait(void) + * + * call with interrupts off + * note: this is a terminal routine, it does not save lr + * + * get phys id from paca + * set paca id to -1 to say we got here + * switch to real mode + * join other cpus in kexec_wait(phys_id) + */ +_GLOBAL(kexec_smp_wait) + lhz r3,PACAHWCPUID(r13) + li r4,-1 + sth r4,PACAHWCPUID(r13) /* let others know we left */ + bl real_mode + b .kexec_wait + +/* + * switch to real mode (turn mmu off) + * we use the early kernel trick that the hardware ignores bits + * 0 and 1 (big endian) of the effective address in real mode + * + * don't overwrite r3 here, it is live for kexec_wait above. + */ +real_mode: /* assume normal blr return */ +1: li r9,MSR_RI + li r10,MSR_DR|MSR_IR + mflr r11 /* return address to SRR0 */ + mfmsr r12 + andc r9,r12,r9 + andc r10,r12,r10 + + mtmsrd r9,1 + mtspr SPRN_SRR1,r10 + mtspr SPRN_SRR0,r11 + rfid + + +/* + * kexec_sequence(newstack, start, image, control, clear_all()) + * + * does the grungy work with stack switching and real mode switches + * also does simple calls to other code + */ + +_GLOBAL(kexec_sequence) + mflr r0 + std r0,16(r1) + + /* switch stacks to newstack -- &kexec_stack.stack */ + stdu r1,THREAD_SIZE-112(r3) + mr r1,r3 + + li r0,0 + std r0,16(r1) + + /* save regs for local vars on new stack. + * yes, we won't go back, but ... + */ + std r31,-8(r1) + std r30,-16(r1) + std r29,-24(r1) + std r28,-32(r1) + std r27,-40(r1) + std r26,-48(r1) + std r25,-56(r1) + + stdu r1,-112-64(r1) + + /* save args into preserved regs */ + mr r31,r3 /* newstack (both) */ + mr r30,r4 /* start (real) */ + mr r29,r5 /* image (virt) */ + mr r28,r6 /* control, unused */ + mr r27,r7 /* clear_all() fn desc */ + mr r26,r8 /* spare */ + lhz r25,PACAHWCPUID(r13) /* get our phys cpu from paca */ + + /* disable interrupts, we are overwriting kernel data next */ + mfmsr r3 + rlwinm r3,r3,0,17,15 + mtmsrd r3,1 + + /* copy dest pages, flush whole dest image */ + mr r3,r29 + bl .kexec_copy_flush /* (image) */ + + /* turn off mmu */ + bl real_mode + + /* clear out hardware hash page table and tlb */ + ld r5,0(r27) /* deref function descriptor */ + mtctr r5 + bctrl /* ppc_md.hash_clear_all(void); */ + +/* + * kexec image calling is: + * the first 0x100 bytes of the entry point are copied to 0 + * + * all slaves branch to slave = 0x60 (absolute) + * slave(phys_cpu_id); + * + * master goes to start = entry point + * start(phys_cpu_id, start, 0); + * + * + * a wrapper is needed to call existing kernels, here is an approximate + * description of one method: + * + * v2: (2.6.10) + * start will be near the boot_block (maybe 0x100 bytes before it?) + * it will have a 0x60, which will b to boot_block, where it will wait + * and 0 will store phys into struct boot-block and load r3 from there, + * copy kernel 0-0x100 and tell slaves to back down to 0x60 again + * + * v1: (2.6.9) + * boot block will have all cpus scanning device tree to see if they + * are the boot cpu ????? + * other device tree differences (prop sizes, va vs pa, etc)... + */ + + /* copy 0x100 bytes starting at start to 0 */ + li r3,0 + mr r4,r30 + li r5,0x100 + li r6,0 + bl .copy_and_flush /* (dest, src, copy limit, start offset) */ +1: /* assume normal blr return */ + + /* release other cpus to the new kernel secondary start at 0x60 */ + mflr r5 + li r6,1 + stw r6,kexec_flag-1b(5) + mr r3,r25 # my phys cpu + mr r4,r30 # start, aka phys mem offset + mtlr 4 + li r5,0 + blr /* image->start(physid, image->start, 0); */ +#endif /* CONFIG_KEXEC */ diff --git a/trunk/arch/powerpc/kernel/module_64.c b/trunk/arch/ppc64/kernel/module.c similarity index 100% rename from trunk/arch/powerpc/kernel/module_64.c rename to trunk/arch/ppc64/kernel/module.c diff --git a/trunk/arch/powerpc/kernel/nvram_64.c b/trunk/arch/ppc64/kernel/nvram.c similarity index 100% rename from trunk/arch/powerpc/kernel/nvram_64.c rename to trunk/arch/ppc64/kernel/nvram.c diff --git a/trunk/arch/powerpc/kernel/pci_64.c b/trunk/arch/ppc64/kernel/pci.c similarity index 95% rename from trunk/arch/powerpc/kernel/pci_64.c rename to trunk/arch/ppc64/kernel/pci.c index 8b6008ab217d..3cef1b8f57f0 100644 --- a/trunk/arch/powerpc/kernel/pci_64.c +++ b/trunk/arch/ppc64/kernel/pci.c @@ -30,17 +30,17 @@ #include #include #include +#include #include #ifdef DEBUG -#include #define DBG(fmt...) udbg_printf(fmt) #else #define DBG(fmt...) #endif unsigned long pci_probe_only = 1; -int pci_assign_all_buses = 0; +unsigned long pci_assign_all_buses = 0; /* * legal IO pages under MAX_ISA_PORT. This is to ensure we don't touch @@ -55,6 +55,11 @@ static void fixup_resource(struct resource *res, struct pci_dev *dev); static void do_bus_setup(struct pci_bus *bus); #endif +unsigned int pcibios_assign_all_busses(void) +{ + return pci_assign_all_buses; +} + /* pci_io_base -- the base address from which io bars are offsets. * This is the lowest I/O base address (so bar values are always positive), * and it *must* be the start of ISA space if an ISA bus exists because @@ -182,7 +187,7 @@ static DEFINE_SPINLOCK(hose_spinlock); /* * pci_controller(phb) initialized common variables. */ -static void __devinit pci_setup_pci_controller(struct pci_controller *hose) +void __devinit pci_setup_pci_controller(struct pci_controller *hose) { memset(hose, 0, sizeof(struct pci_controller)); @@ -192,65 +197,6 @@ static void __devinit pci_setup_pci_controller(struct pci_controller *hose) spin_unlock(&hose_spinlock); } -static void add_linux_pci_domain(struct device_node *dev, - struct pci_controller *phb) -{ - struct property *of_prop; - unsigned int size; - - of_prop = (struct property *) - get_property(dev, "linux,pci-domain", &size); - if (of_prop != NULL) - return; - WARN_ON(of_prop && size < sizeof(int)); - if (of_prop && size < sizeof(int)) - of_prop = NULL; - size = sizeof(struct property) + sizeof(int); - if (of_prop == NULL) { - if (mem_init_done) - of_prop = kmalloc(size, GFP_KERNEL); - else - of_prop = alloc_bootmem(size); - } - memset(of_prop, 0, sizeof(struct property)); - of_prop->name = "linux,pci-domain"; - of_prop->length = sizeof(int); - of_prop->value = (unsigned char *)&of_prop[1]; - *((int *)of_prop->value) = phb->global_number; - prom_add_property(dev, of_prop); -} - -struct pci_controller * pcibios_alloc_controller(struct device_node *dev) -{ - struct pci_controller *phb; - - if (mem_init_done) - phb = kmalloc(sizeof(struct pci_controller), GFP_KERNEL); - else - phb = alloc_bootmem(sizeof (struct pci_controller)); - if (phb == NULL) - return NULL; - pci_setup_pci_controller(phb); - phb->arch_data = dev; - phb->is_dynamic = mem_init_done; - if (dev) - add_linux_pci_domain(dev, phb); - return phb; -} - -void pcibios_free_controller(struct pci_controller *phb) -{ - if (phb->arch_data) { - struct device_node *np = phb->arch_data; - int *domain = (int *)get_property(np, - "linux,pci-domain", NULL); - if (domain) - *domain = -1; - } - if (phb->is_dynamic) - kfree(phb); -} - static void __init pcibios_claim_one_bus(struct pci_bus *b) { struct pci_dev *dev; @@ -961,10 +907,9 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, * (size depending on dev->n_addr_cells) * cells 4+5 or 5+6: the size of the range */ - ranges = (unsigned int *) get_property(dev, "ranges", &rlen); - if (ranges == NULL) - return; + rlen = 0; hose->io_base_phys = 0; + ranges = (unsigned int *) get_property(dev, "ranges", &rlen); while ((rlen -= np * sizeof(unsigned int)) >= 0) { res = NULL; pci_space = ranges[0]; @@ -1162,8 +1107,6 @@ int remap_bus_range(struct pci_bus *bus) if (get_bus_io_range(bus, &start_phys, &start_virt, &size)) return 1; - if (start_phys == 0) - return 1; printk("mapping IO %lx -> %lx, size: %lx\n", start_phys, start_virt, size); if (__ioremap_explicit(start_phys, start_virt, size, _PAGE_NO_CACHE | _PAGE_GUARDED)) @@ -1181,6 +1124,17 @@ void phbs_remap_io(void) remap_bus_range(hose->bus); } +/* + * ppc64 can have multifunction devices that do not respond to function 0. + * In this case we must scan all functions. + * XXX this can go now, we use the OF device tree in all the + * cases that caused problems. -- paulus + */ +int pcibios_scan_all_fns(struct pci_bus *bus, int devfn) +{ + return 0; +} + static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev) { struct pci_controller *hose = pci_bus_to_host(dev->bus); diff --git a/trunk/arch/powerpc/kernel/pci_direct_iommu.c b/trunk/arch/ppc64/kernel/pci_direct_iommu.c similarity index 100% rename from trunk/arch/powerpc/kernel/pci_direct_iommu.c rename to trunk/arch/ppc64/kernel/pci_direct_iommu.c diff --git a/trunk/arch/powerpc/kernel/pci_dn.c b/trunk/arch/ppc64/kernel/pci_dn.c similarity index 100% rename from trunk/arch/powerpc/kernel/pci_dn.c rename to trunk/arch/ppc64/kernel/pci_dn.c diff --git a/trunk/arch/powerpc/kernel/pci_iommu.c b/trunk/arch/ppc64/kernel/pci_iommu.c similarity index 100% rename from trunk/arch/powerpc/kernel/pci_iommu.c rename to trunk/arch/ppc64/kernel/pci_iommu.c diff --git a/trunk/arch/ppc64/kernel/ppc_ksyms.c b/trunk/arch/ppc64/kernel/ppc_ksyms.c new file mode 100644 index 000000000000..84006e26342c --- /dev/null +++ b/trunk/arch/ppc64/kernel/ppc_ksyms.c @@ -0,0 +1,76 @@ +/* + * c 2001 PPC 64 Team, IBM Corp + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +EXPORT_SYMBOL(strcpy); +EXPORT_SYMBOL(strncpy); +EXPORT_SYMBOL(strcat); +EXPORT_SYMBOL(strncat); +EXPORT_SYMBOL(strchr); +EXPORT_SYMBOL(strrchr); +EXPORT_SYMBOL(strpbrk); +EXPORT_SYMBOL(strstr); +EXPORT_SYMBOL(strlen); +EXPORT_SYMBOL(strnlen); +EXPORT_SYMBOL(strcmp); +EXPORT_SYMBOL(strncmp); + +EXPORT_SYMBOL(csum_partial); +EXPORT_SYMBOL(csum_partial_copy_generic); +EXPORT_SYMBOL(ip_fast_csum); +EXPORT_SYMBOL(csum_tcpudp_magic); + +EXPORT_SYMBOL(__copy_tofrom_user); +EXPORT_SYMBOL(__clear_user); +EXPORT_SYMBOL(__strncpy_from_user); +EXPORT_SYMBOL(__strnlen_user); + +EXPORT_SYMBOL(reloc_offset); + +EXPORT_SYMBOL(_insb); +EXPORT_SYMBOL(_outsb); +EXPORT_SYMBOL(_insw); +EXPORT_SYMBOL(_outsw); +EXPORT_SYMBOL(_insl); +EXPORT_SYMBOL(_outsl); +EXPORT_SYMBOL(_insw_ns); +EXPORT_SYMBOL(_outsw_ns); +EXPORT_SYMBOL(_insl_ns); +EXPORT_SYMBOL(_outsl_ns); + +EXPORT_SYMBOL(kernel_thread); + +EXPORT_SYMBOL(giveup_fpu); +#ifdef CONFIG_ALTIVEC +EXPORT_SYMBOL(giveup_altivec); +#endif +EXPORT_SYMBOL(__flush_icache_range); +EXPORT_SYMBOL(flush_dcache_range); + +EXPORT_SYMBOL(memcpy); +EXPORT_SYMBOL(memset); +EXPORT_SYMBOL(memmove); +EXPORT_SYMBOL(memscan); +EXPORT_SYMBOL(memcmp); +EXPORT_SYMBOL(memchr); + +EXPORT_SYMBOL(timer_interrupt); +EXPORT_SYMBOL(console_drivers); diff --git a/trunk/arch/ppc64/kernel/prom.c b/trunk/arch/ppc64/kernel/prom.c new file mode 100644 index 000000000000..fbad2c360784 --- /dev/null +++ b/trunk/arch/ppc64/kernel/prom.c @@ -0,0 +1,1954 @@ +/* + * + * + * Procedures for interfacing to Open Firmware. + * + * Paul Mackerras August 1996. + * Copyright (C) 1996 Paul Mackerras. + * + * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner. + * {engebret|bergner}@us.ibm.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. + */ + +#undef DEBUG + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef DEBUG +#define DBG(fmt...) udbg_printf(fmt) +#else +#define DBG(fmt...) +#endif + +struct pci_reg_property { + struct pci_address addr; + u32 size_hi; + u32 size_lo; +}; + +struct isa_reg_property { + u32 space; + u32 address; + u32 size; +}; + + +typedef int interpret_func(struct device_node *, unsigned long *, + int, int, int); + +extern struct rtas_t rtas; +extern struct lmb lmb; +extern unsigned long klimit; +extern unsigned long memory_limit; + +static int __initdata dt_root_addr_cells; +static int __initdata dt_root_size_cells; +static int __initdata iommu_is_off; +int __initdata iommu_force_on; +unsigned long tce_alloc_start, tce_alloc_end; + +typedef u32 cell_t; + +#if 0 +static struct boot_param_header *initial_boot_params __initdata; +#else +struct boot_param_header *initial_boot_params; +#endif + +static struct device_node *allnodes = NULL; + +/* use when traversing tree through the allnext, child, sibling, + * or parent members of struct device_node. + */ +static DEFINE_RWLOCK(devtree_lock); + +/* export that to outside world */ +struct device_node *of_chosen; + +/* + * Wrapper for allocating memory for various data that needs to be + * attached to device nodes as they are processed at boot or when + * added to the device tree later (e.g. DLPAR). At boot there is + * already a region reserved so we just increment *mem_start by size; + * otherwise we call kmalloc. + */ +static void * prom_alloc(unsigned long size, unsigned long *mem_start) +{ + unsigned long tmp; + + if (!mem_start) + return kmalloc(size, GFP_KERNEL); + + tmp = *mem_start; + *mem_start += size; + return (void *)tmp; +} + +/* + * Find the device_node with a given phandle. + */ +static struct device_node * find_phandle(phandle ph) +{ + struct device_node *np; + + for (np = allnodes; np != 0; np = np->allnext) + if (np->linux_phandle == ph) + return np; + return NULL; +} + +/* + * Find the interrupt parent of a node. + */ +static struct device_node * __devinit intr_parent(struct device_node *p) +{ + phandle *parp; + + parp = (phandle *) get_property(p, "interrupt-parent", NULL); + if (parp == NULL) + return p->parent; + return find_phandle(*parp); +} + +/* + * Find out the size of each entry of the interrupts property + * for a node. + */ +int __devinit prom_n_intr_cells(struct device_node *np) +{ + struct device_node *p; + unsigned int *icp; + + for (p = np; (p = intr_parent(p)) != NULL; ) { + icp = (unsigned int *) + get_property(p, "#interrupt-cells", NULL); + if (icp != NULL) + return *icp; + if (get_property(p, "interrupt-controller", NULL) != NULL + || get_property(p, "interrupt-map", NULL) != NULL) { + printk("oops, node %s doesn't have #interrupt-cells\n", + p->full_name); + return 1; + } + } +#ifdef DEBUG_IRQ + printk("prom_n_intr_cells failed for %s\n", np->full_name); +#endif + return 1; +} + +/* + * Map an interrupt from a device up to the platform interrupt + * descriptor. + */ +static int __devinit map_interrupt(unsigned int **irq, struct device_node **ictrler, + struct device_node *np, unsigned int *ints, + int nintrc) +{ + struct device_node *p, *ipar; + unsigned int *imap, *imask, *ip; + int i, imaplen, match; + int newintrc = 0, newaddrc = 0; + unsigned int *reg; + int naddrc; + + reg = (unsigned int *) get_property(np, "reg", NULL); + naddrc = prom_n_addr_cells(np); + p = intr_parent(np); + while (p != NULL) { + if (get_property(p, "interrupt-controller", NULL) != NULL) + /* this node is an interrupt controller, stop here */ + break; + imap = (unsigned int *) + get_property(p, "interrupt-map", &imaplen); + if (imap == NULL) { + p = intr_parent(p); + continue; + } + imask = (unsigned int *) + get_property(p, "interrupt-map-mask", NULL); + if (imask == NULL) { + printk("oops, %s has interrupt-map but no mask\n", + p->full_name); + return 0; + } + imaplen /= sizeof(unsigned int); + match = 0; + ipar = NULL; + while (imaplen > 0 && !match) { + /* check the child-interrupt field */ + match = 1; + for (i = 0; i < naddrc && match; ++i) + match = ((reg[i] ^ imap[i]) & imask[i]) == 0; + for (; i < naddrc + nintrc && match; ++i) + match = ((ints[i-naddrc] ^ imap[i]) & imask[i]) == 0; + imap += naddrc + nintrc; + imaplen -= naddrc + nintrc; + /* grab the interrupt parent */ + ipar = find_phandle((phandle) *imap++); + --imaplen; + if (ipar == NULL) { + printk("oops, no int parent %x in map of %s\n", + imap[-1], p->full_name); + return 0; + } + /* find the parent's # addr and intr cells */ + ip = (unsigned int *) + get_property(ipar, "#interrupt-cells", NULL); + if (ip == NULL) { + printk("oops, no #interrupt-cells on %s\n", + ipar->full_name); + return 0; + } + newintrc = *ip; + ip = (unsigned int *) + get_property(ipar, "#address-cells", NULL); + newaddrc = (ip == NULL)? 0: *ip; + imap += newaddrc + newintrc; + imaplen -= newaddrc + newintrc; + } + if (imaplen < 0) { + printk("oops, error decoding int-map on %s, len=%d\n", + p->full_name, imaplen); + return 0; + } + if (!match) { +#ifdef DEBUG_IRQ + printk("oops, no match in %s int-map for %s\n", + p->full_name, np->full_name); +#endif + return 0; + } + p = ipar; + naddrc = newaddrc; + nintrc = newintrc; + ints = imap - nintrc; + reg = ints - naddrc; + } + if (p == NULL) { +#ifdef DEBUG_IRQ + printk("hmmm, int tree for %s doesn't have ctrler\n", + np->full_name); +#endif + return 0; + } + *irq = ints; + *ictrler = p; + return nintrc; +} + +static int __devinit finish_node_interrupts(struct device_node *np, + unsigned long *mem_start, + int measure_only) +{ + unsigned int *ints; + int intlen, intrcells, intrcount; + int i, j, n; + unsigned int *irq, virq; + struct device_node *ic; + + ints = (unsigned int *) get_property(np, "interrupts", &intlen); + if (ints == NULL) + return 0; + intrcells = prom_n_intr_cells(np); + intlen /= intrcells * sizeof(unsigned int); + + np->intrs = prom_alloc(intlen * sizeof(*(np->intrs)), mem_start); + if (!np->intrs) + return -ENOMEM; + + if (measure_only) + return 0; + + intrcount = 0; + for (i = 0; i < intlen; ++i, ints += intrcells) { + n = map_interrupt(&irq, &ic, np, ints, intrcells); + if (n <= 0) + continue; + + /* don't map IRQ numbers under a cascaded 8259 controller */ + if (ic && device_is_compatible(ic, "chrp,iic")) { + np->intrs[intrcount].line = irq[0]; + } else { + virq = virt_irq_create_mapping(irq[0]); + if (virq == NO_IRQ) { + printk(KERN_CRIT "Could not allocate interrupt" + " number for %s\n", np->full_name); + continue; + } + np->intrs[intrcount].line = irq_offset_up(virq); + } + + /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ + if (_machine == PLATFORM_POWERMAC && ic && ic->parent) { + char *name = get_property(ic->parent, "name", NULL); + if (name && !strcmp(name, "u3")) + np->intrs[intrcount].line += 128; + else if (!(name && !strcmp(name, "mac-io"))) + /* ignore other cascaded controllers, such as + the k2-sata-root */ + break; + } + np->intrs[intrcount].sense = 1; + if (n > 1) + np->intrs[intrcount].sense = irq[1]; + if (n > 2) { + printk("hmmm, got %d intr cells for %s:", n, + np->full_name); + for (j = 0; j < n; ++j) + printk(" %d", irq[j]); + printk("\n"); + } + ++intrcount; + } + np->n_intrs = intrcount; + + return 0; +} + +static int __devinit interpret_pci_props(struct device_node *np, + unsigned long *mem_start, + int naddrc, int nsizec, + int measure_only) +{ + struct address_range *adr; + struct pci_reg_property *pci_addrs; + int i, l, n_addrs; + + pci_addrs = (struct pci_reg_property *) + get_property(np, "assigned-addresses", &l); + if (!pci_addrs) + return 0; + + n_addrs = l / sizeof(*pci_addrs); + + adr = prom_alloc(n_addrs * sizeof(*adr), mem_start); + if (!adr) + return -ENOMEM; + + if (measure_only) + return 0; + + np->addrs = adr; + np->n_addrs = n_addrs; + + for (i = 0; i < n_addrs; i++) { + adr[i].space = pci_addrs[i].addr.a_hi; + adr[i].address = pci_addrs[i].addr.a_lo | + ((u64)pci_addrs[i].addr.a_mid << 32); + adr[i].size = pci_addrs[i].size_lo; + } + + return 0; +} + +static int __init interpret_dbdma_props(struct device_node *np, + unsigned long *mem_start, + int naddrc, int nsizec, + int measure_only) +{ + struct reg_property32 *rp; + struct address_range *adr; + unsigned long base_address; + int i, l; + struct device_node *db; + + base_address = 0; + if (!measure_only) { + for (db = np->parent; db != NULL; db = db->parent) { + if (!strcmp(db->type, "dbdma") && db->n_addrs != 0) { + base_address = db->addrs[0].address; + break; + } + } + } + + rp = (struct reg_property32 *) get_property(np, "reg", &l); + if (rp != 0 && l >= sizeof(struct reg_property32)) { + i = 0; + adr = (struct address_range *) (*mem_start); + while ((l -= sizeof(struct reg_property32)) >= 0) { + if (!measure_only) { + adr[i].space = 2; + adr[i].address = rp[i].address + base_address; + adr[i].size = rp[i].size; + } + ++i; + } + np->addrs = adr; + np->n_addrs = i; + (*mem_start) += i * sizeof(struct address_range); + } + + return 0; +} + +static int __init interpret_macio_props(struct device_node *np, + unsigned long *mem_start, + int naddrc, int nsizec, + int measure_only) +{ + struct reg_property32 *rp; + struct address_range *adr; + unsigned long base_address; + int i, l; + struct device_node *db; + + base_address = 0; + if (!measure_only) { + for (db = np->parent; db != NULL; db = db->parent) { + if (!strcmp(db->type, "mac-io") && db->n_addrs != 0) { + base_address = db->addrs[0].address; + break; + } + } + } + + rp = (struct reg_property32 *) get_property(np, "reg", &l); + if (rp != 0 && l >= sizeof(struct reg_property32)) { + i = 0; + adr = (struct address_range *) (*mem_start); + while ((l -= sizeof(struct reg_property32)) >= 0) { + if (!measure_only) { + adr[i].space = 2; + adr[i].address = rp[i].address + base_address; + adr[i].size = rp[i].size; + } + ++i; + } + np->addrs = adr; + np->n_addrs = i; + (*mem_start) += i * sizeof(struct address_range); + } + + return 0; +} + +static int __init interpret_isa_props(struct device_node *np, + unsigned long *mem_start, + int naddrc, int nsizec, + int measure_only) +{ + struct isa_reg_property *rp; + struct address_range *adr; + int i, l; + + rp = (struct isa_reg_property *) get_property(np, "reg", &l); + if (rp != 0 && l >= sizeof(struct isa_reg_property)) { + i = 0; + adr = (struct address_range *) (*mem_start); + while ((l -= sizeof(struct isa_reg_property)) >= 0) { + if (!measure_only) { + adr[i].space = rp[i].space; + adr[i].address = rp[i].address; + adr[i].size = rp[i].size; + } + ++i; + } + np->addrs = adr; + np->n_addrs = i; + (*mem_start) += i * sizeof(struct address_range); + } + + return 0; +} + +static int __init interpret_root_props(struct device_node *np, + unsigned long *mem_start, + int naddrc, int nsizec, + int measure_only) +{ + struct address_range *adr; + int i, l; + unsigned int *rp; + int rpsize = (naddrc + nsizec) * sizeof(unsigned int); + + rp = (unsigned int *) get_property(np, "reg", &l); + if (rp != 0 && l >= rpsize) { + i = 0; + adr = (struct address_range *) (*mem_start); + while ((l -= rpsize) >= 0) { + if (!measure_only) { + adr[i].space = 0; + adr[i].address = rp[naddrc - 1]; + adr[i].size = rp[naddrc + nsizec - 1]; + } + ++i; + rp += naddrc + nsizec; + } + np->addrs = adr; + np->n_addrs = i; + (*mem_start) += i * sizeof(struct address_range); + } + + return 0; +} + +static int __devinit finish_node(struct device_node *np, + unsigned long *mem_start, + interpret_func *ifunc, + int naddrc, int nsizec, + int measure_only) +{ + struct device_node *child; + int *ip, rc = 0; + + /* get the device addresses and interrupts */ + if (ifunc != NULL) + rc = ifunc(np, mem_start, naddrc, nsizec, measure_only); + if (rc) + goto out; + + rc = finish_node_interrupts(np, mem_start, measure_only); + if (rc) + goto out; + + /* Look for #address-cells and #size-cells properties. */ + ip = (int *) get_property(np, "#address-cells", NULL); + if (ip != NULL) + naddrc = *ip; + ip = (int *) get_property(np, "#size-cells", NULL); + if (ip != NULL) + nsizec = *ip; + + if (!strcmp(np->name, "device-tree") || np->parent == NULL) + ifunc = interpret_root_props; + else if (np->type == 0) + ifunc = NULL; + else if (!strcmp(np->type, "pci") || !strcmp(np->type, "vci")) + ifunc = interpret_pci_props; + else if (!strcmp(np->type, "dbdma")) + ifunc = interpret_dbdma_props; + else if (!strcmp(np->type, "mac-io") || ifunc == interpret_macio_props) + ifunc = interpret_macio_props; + else if (!strcmp(np->type, "isa")) + ifunc = interpret_isa_props; + else if (!strcmp(np->name, "uni-n") || !strcmp(np->name, "u3")) + ifunc = interpret_root_props; + else if (!((ifunc == interpret_dbdma_props + || ifunc == interpret_macio_props) + && (!strcmp(np->type, "escc") + || !strcmp(np->type, "media-bay")))) + ifunc = NULL; + + for (child = np->child; child != NULL; child = child->sibling) { + rc = finish_node(child, mem_start, ifunc, + naddrc, nsizec, measure_only); + if (rc) + goto out; + } +out: + return rc; +} + +/** + * finish_device_tree is called once things are running normally + * (i.e. with text and data mapped to the address they were linked at). + * It traverses the device tree and fills in some of the additional, + * fields in each node like {n_}addrs and {n_}intrs, the virt interrupt + * mapping is also initialized at this point. + */ +void __init finish_device_tree(void) +{ + unsigned long start, end, size = 0; + + DBG(" -> finish_device_tree\n"); + + if (ppc64_interrupt_controller == IC_INVALID) { + DBG("failed to configure interrupt controller type\n"); + panic("failed to configure interrupt controller type\n"); + } + + /* Initialize virtual IRQ map */ + virt_irq_init(); + + /* + * Finish device-tree (pre-parsing some properties etc...) + * We do this in 2 passes. One with "measure_only" set, which + * will only measure the amount of memory needed, then we can + * allocate that memory, and call finish_node again. However, + * we must be careful as most routines will fail nowadays when + * prom_alloc() returns 0, so we must make sure our first pass + * doesn't start at 0. We pre-initialize size to 16 for that + * reason and then remove those additional 16 bytes + */ + size = 16; + finish_node(allnodes, &size, NULL, 0, 0, 1); + size -= 16; + end = start = (unsigned long)abs_to_virt(lmb_alloc(size, 128)); + finish_node(allnodes, &end, NULL, 0, 0, 0); + BUG_ON(end != start + size); + + DBG(" <- finish_device_tree\n"); +} + +#ifdef DEBUG +#define printk udbg_printf +#endif + +static inline char *find_flat_dt_string(u32 offset) +{ + return ((char *)initial_boot_params) + + initial_boot_params->off_dt_strings + offset; +} + +/** + * This function is used to scan the flattened device-tree, it is + * used to extract the memory informations at boot before we can + * unflatten the tree + */ +int __init of_scan_flat_dt(int (*it)(unsigned long node, + const char *uname, int depth, + void *data), + void *data) +{ + unsigned long p = ((unsigned long)initial_boot_params) + + initial_boot_params->off_dt_struct; + int rc = 0; + int depth = -1; + + do { + u32 tag = *((u32 *)p); + char *pathp; + + p += 4; + if (tag == OF_DT_END_NODE) { + depth --; + continue; + } + if (tag == OF_DT_NOP) + continue; + if (tag == OF_DT_END) + break; + if (tag == OF_DT_PROP) { + u32 sz = *((u32 *)p); + p += 8; + if (initial_boot_params->version < 0x10) + p = _ALIGN(p, sz >= 8 ? 8 : 4); + p += sz; + p = _ALIGN(p, 4); + continue; + } + if (tag != OF_DT_BEGIN_NODE) { + printk(KERN_WARNING "Invalid tag %x scanning flattened" + " device tree !\n", tag); + return -EINVAL; + } + depth++; + pathp = (char *)p; + p = _ALIGN(p + strlen(pathp) + 1, 4); + if ((*pathp) == '/') { + char *lp, *np; + for (lp = NULL, np = pathp; *np; np++) + if ((*np) == '/') + lp = np+1; + if (lp != NULL) + pathp = lp; + } + rc = it(p, pathp, depth, data); + if (rc != 0) + break; + } while(1); + + return rc; +} + +/** + * This function can be used within scan_flattened_dt callback to get + * access to properties + */ +void* __init of_get_flat_dt_prop(unsigned long node, const char *name, + unsigned long *size) +{ + unsigned long p = node; + + do { + u32 tag = *((u32 *)p); + u32 sz, noff; + const char *nstr; + + p += 4; + if (tag == OF_DT_NOP) + continue; + if (tag != OF_DT_PROP) + return NULL; + + sz = *((u32 *)p); + noff = *((u32 *)(p + 4)); + p += 8; + if (initial_boot_params->version < 0x10) + p = _ALIGN(p, sz >= 8 ? 8 : 4); + + nstr = find_flat_dt_string(noff); + if (nstr == NULL) { + printk(KERN_WARNING "Can't find property index" + " name !\n"); + return NULL; + } + if (strcmp(name, nstr) == 0) { + if (size) + *size = sz; + return (void *)p; + } + p += sz; + p = _ALIGN(p, 4); + } while(1); +} + +static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size, + unsigned long align) +{ + void *res; + + *mem = _ALIGN(*mem, align); + res = (void *)*mem; + *mem += size; + + return res; +} + +static unsigned long __init unflatten_dt_node(unsigned long mem, + unsigned long *p, + struct device_node *dad, + struct device_node ***allnextpp, + unsigned long fpsize) +{ + struct device_node *np; + struct property *pp, **prev_pp = NULL; + char *pathp; + u32 tag; + unsigned int l, allocl; + int has_name = 0; + int new_format = 0; + + tag = *((u32 *)(*p)); + if (tag != OF_DT_BEGIN_NODE) { + printk("Weird tag at start of node: %x\n", tag); + return mem; + } + *p += 4; + pathp = (char *)*p; + l = allocl = strlen(pathp) + 1; + *p = _ALIGN(*p + l, 4); + + /* version 0x10 has a more compact unit name here instead of the full + * path. we accumulate the full path size using "fpsize", we'll rebuild + * it later. We detect this because the first character of the name is + * not '/'. + */ + if ((*pathp) != '/') { + new_format = 1; + if (fpsize == 0) { + /* root node: special case. fpsize accounts for path + * plus terminating zero. root node only has '/', so + * fpsize should be 2, but we want to avoid the first + * level nodes to have two '/' so we use fpsize 1 here + */ + fpsize = 1; + allocl = 2; + } else { + /* account for '/' and path size minus terminal 0 + * already in 'l' + */ + fpsize += l; + allocl = fpsize; + } + } + + + np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl, + __alignof__(struct device_node)); + if (allnextpp) { + memset(np, 0, sizeof(*np)); + np->full_name = ((char*)np) + sizeof(struct device_node); + if (new_format) { + char *p = np->full_name; + /* rebuild full path for new format */ + if (dad && dad->parent) { + strcpy(p, dad->full_name); +#ifdef DEBUG + if ((strlen(p) + l + 1) != allocl) { + DBG("%s: p: %d, l: %d, a: %d\n", + pathp, strlen(p), l, allocl); + } +#endif + p += strlen(p); + } + *(p++) = '/'; + memcpy(p, pathp, l); + } else + memcpy(np->full_name, pathp, l); + prev_pp = &np->properties; + **allnextpp = np; + *allnextpp = &np->allnext; + if (dad != NULL) { + np->parent = dad; + /* we temporarily use the next field as `last_child'*/ + if (dad->next == 0) + dad->child = np; + else + dad->next->sibling = np; + dad->next = np; + } + kref_init(&np->kref); + } + while(1) { + u32 sz, noff; + char *pname; + + tag = *((u32 *)(*p)); + if (tag == OF_DT_NOP) { + *p += 4; + continue; + } + if (tag != OF_DT_PROP) + break; + *p += 4; + sz = *((u32 *)(*p)); + noff = *((u32 *)((*p) + 4)); + *p += 8; + if (initial_boot_params->version < 0x10) + *p = _ALIGN(*p, sz >= 8 ? 8 : 4); + + pname = find_flat_dt_string(noff); + if (pname == NULL) { + printk("Can't find property name in list !\n"); + break; + } + if (strcmp(pname, "name") == 0) + has_name = 1; + l = strlen(pname) + 1; + pp = unflatten_dt_alloc(&mem, sizeof(struct property), + __alignof__(struct property)); + if (allnextpp) { + if (strcmp(pname, "linux,phandle") == 0) { + np->node = *((u32 *)*p); + if (np->linux_phandle == 0) + np->linux_phandle = np->node; + } + if (strcmp(pname, "ibm,phandle") == 0) + np->linux_phandle = *((u32 *)*p); + pp->name = pname; + pp->length = sz; + pp->value = (void *)*p; + *prev_pp = pp; + prev_pp = &pp->next; + } + *p = _ALIGN((*p) + sz, 4); + } + /* with version 0x10 we may not have the name property, recreate + * it here from the unit name if absent + */ + if (!has_name) { + char *p = pathp, *ps = pathp, *pa = NULL; + int sz; + + while (*p) { + if ((*p) == '@') + pa = p; + if ((*p) == '/') + ps = p + 1; + p++; + } + if (pa < ps) + pa = p; + sz = (pa - ps) + 1; + pp = unflatten_dt_alloc(&mem, sizeof(struct property) + sz, + __alignof__(struct property)); + if (allnextpp) { + pp->name = "name"; + pp->length = sz; + pp->value = (unsigned char *)(pp + 1); + *prev_pp = pp; + prev_pp = &pp->next; + memcpy(pp->value, ps, sz - 1); + ((char *)pp->value)[sz - 1] = 0; + DBG("fixed up name for %s -> %s\n", pathp, pp->value); + } + } + if (allnextpp) { + *prev_pp = NULL; + np->name = get_property(np, "name", NULL); + np->type = get_property(np, "device_type", NULL); + + if (!np->name) + np->name = ""; + if (!np->type) + np->type = ""; + } + while (tag == OF_DT_BEGIN_NODE) { + mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize); + tag = *((u32 *)(*p)); + } + if (tag != OF_DT_END_NODE) { + printk("Weird tag at end of node: %x\n", tag); + return mem; + } + *p += 4; + return mem; +} + + +/** + * unflattens the device-tree passed by the firmware, creating the + * tree of struct device_node. It also fills the "name" and "type" + * pointers of the nodes so the normal device-tree walking functions + * can be used (this used to be done by finish_device_tree) + */ +void __init unflatten_device_tree(void) +{ + unsigned long start, mem, size; + struct device_node **allnextp = &allnodes; + char *p = NULL; + int l = 0; + + DBG(" -> unflatten_device_tree()\n"); + + /* First pass, scan for size */ + start = ((unsigned long)initial_boot_params) + + initial_boot_params->off_dt_struct; + size = unflatten_dt_node(0, &start, NULL, NULL, 0); + size = (size | 3) + 1; + + DBG(" size is %lx, allocating...\n", size); + + /* Allocate memory for the expanded device tree */ + mem = lmb_alloc(size + 4, __alignof__(struct device_node)); + if (!mem) { + DBG("Couldn't allocate memory with lmb_alloc()!\n"); + panic("Couldn't allocate memory with lmb_alloc()!\n"); + } + mem = (unsigned long)abs_to_virt(mem); + + ((u32 *)mem)[size / 4] = 0xdeadbeef; + + DBG(" unflattening...\n", mem); + + /* Second pass, do actual unflattening */ + start = ((unsigned long)initial_boot_params) + + initial_boot_params->off_dt_struct; + unflatten_dt_node(mem, &start, NULL, &allnextp, 0); + if (*((u32 *)start) != OF_DT_END) + printk(KERN_WARNING "Weird tag at end of tree: %08x\n", *((u32 *)start)); + if (((u32 *)mem)[size / 4] != 0xdeadbeef) + printk(KERN_WARNING "End of tree marker overwritten: %08x\n", + ((u32 *)mem)[size / 4] ); + *allnextp = NULL; + + /* Get pointer to OF "/chosen" node for use everywhere */ + of_chosen = of_find_node_by_path("/chosen"); + + /* Retreive command line */ + if (of_chosen != NULL) { + p = (char *)get_property(of_chosen, "bootargs", &l); + if (p != NULL && l > 0) + strlcpy(cmd_line, p, min(l, COMMAND_LINE_SIZE)); + } +#ifdef CONFIG_CMDLINE + if (l == 0 || (l == 1 && (*p) == 0)) + strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); +#endif /* CONFIG_CMDLINE */ + + DBG("Command line is: %s\n", cmd_line); + + DBG(" <- unflatten_device_tree()\n"); +} + + +static int __init early_init_dt_scan_cpus(unsigned long node, + const char *uname, int depth, void *data) +{ + char *type = of_get_flat_dt_prop(node, "device_type", NULL); + u32 *prop; + unsigned long size; + + /* We are scanning "cpu" nodes only */ + if (type == NULL || strcmp(type, "cpu") != 0) + return 0; + + if (initial_boot_params && initial_boot_params->version >= 2) { + /* version 2 of the kexec param format adds the phys cpuid + * of booted proc. + */ + boot_cpuid_phys = initial_boot_params->boot_cpuid_phys; + boot_cpuid = 0; + } else { + /* Check if it's the boot-cpu, set it's hw index in paca now */ + if (of_get_flat_dt_prop(node, "linux,boot-cpu", NULL) + != NULL) { + u32 *prop = of_get_flat_dt_prop(node, "reg", NULL); + set_hard_smp_processor_id(0, prop == NULL ? 0 : *prop); + boot_cpuid_phys = get_hard_smp_processor_id(0); + } + } + +#ifdef CONFIG_ALTIVEC + /* Check if we have a VMX and eventually update CPU features */ + prop = (u32 *)of_get_flat_dt_prop(node, "ibm,vmx", NULL); + if (prop && (*prop) > 0) { + cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; + cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; + } + + /* Same goes for Apple's "altivec" property */ + prop = (u32 *)of_get_flat_dt_prop(node, "altivec", NULL); + if (prop) { + cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; + cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; + } +#endif /* CONFIG_ALTIVEC */ + + /* + * Check for an SMT capable CPU and set the CPU feature. We do + * this by looking at the size of the ibm,ppc-interrupt-server#s + * property + */ + prop = (u32 *)of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s", + &size); + cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT; + if (prop && ((size / sizeof(u32)) > 1)) + cur_cpu_spec->cpu_features |= CPU_FTR_SMT; + + return 0; +} + +static int __init early_init_dt_scan_chosen(unsigned long node, + const char *uname, int depth, void *data) +{ + u32 *prop; + u64 *prop64; + + DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname); + + if (depth != 1 || strcmp(uname, "chosen") != 0) + return 0; + + /* get platform type */ + prop = (u32 *)of_get_flat_dt_prop(node, "linux,platform", NULL); + if (prop == NULL) + return 0; + _machine = *prop; + + /* check if iommu is forced on or off */ + if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL) + iommu_is_off = 1; + if (of_get_flat_dt_prop(node, "linux,iommu-force-on", NULL) != NULL) + iommu_force_on = 1; + + prop64 = (u64*)of_get_flat_dt_prop(node, "linux,memory-limit", NULL); + if (prop64) + memory_limit = *prop64; + + prop64 = (u64*)of_get_flat_dt_prop(node, "linux,tce-alloc-start",NULL); + if (prop64) + tce_alloc_start = *prop64; + + prop64 = (u64*)of_get_flat_dt_prop(node, "linux,tce-alloc-end", NULL); + if (prop64) + tce_alloc_end = *prop64; + +#ifdef CONFIG_PPC_RTAS + /* To help early debugging via the front panel, we retreive a minimal + * set of RTAS infos now if available + */ + { + u64 *basep, *entryp; + + basep = (u64*)of_get_flat_dt_prop(node, + "linux,rtas-base", NULL); + entryp = (u64*)of_get_flat_dt_prop(node, + "linux,rtas-entry", NULL); + prop = (u32*)of_get_flat_dt_prop(node, + "linux,rtas-size", NULL); + if (basep && entryp && prop) { + rtas.base = *basep; + rtas.entry = *entryp; + rtas.size = *prop; + } + } +#endif /* CONFIG_PPC_RTAS */ + + /* break now */ + return 1; +} + +static int __init early_init_dt_scan_root(unsigned long node, + const char *uname, int depth, void *data) +{ + u32 *prop; + + if (depth != 0) + return 0; + + prop = (u32 *)of_get_flat_dt_prop(node, "#size-cells", NULL); + dt_root_size_cells = (prop == NULL) ? 1 : *prop; + DBG("dt_root_size_cells = %x\n", dt_root_size_cells); + + prop = (u32 *)of_get_flat_dt_prop(node, "#address-cells", NULL); + dt_root_addr_cells = (prop == NULL) ? 2 : *prop; + DBG("dt_root_addr_cells = %x\n", dt_root_addr_cells); + + /* break now */ + return 1; +} + +static unsigned long __init dt_mem_next_cell(int s, cell_t **cellp) +{ + cell_t *p = *cellp; + unsigned long r = 0; + + /* Ignore more than 2 cells */ + while (s > 2) { + p++; + s--; + } + while (s) { + r <<= 32; + r |= *(p++); + s--; + } + + *cellp = p; + return r; +} + + +static int __init early_init_dt_scan_memory(unsigned long node, + const char *uname, int depth, void *data) +{ + char *type = of_get_flat_dt_prop(node, "device_type", NULL); + cell_t *reg, *endp; + unsigned long l; + + /* We are scanning "memory" nodes only */ + if (type == NULL || strcmp(type, "memory") != 0) + return 0; + + reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l); + if (reg == NULL) + return 0; + + endp = reg + (l / sizeof(cell_t)); + + DBG("memory scan node %s ..., reg size %ld, data: %x %x %x %x, ...\n", + uname, l, reg[0], reg[1], reg[2], reg[3]); + + while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) { + unsigned long base, size; + + base = dt_mem_next_cell(dt_root_addr_cells, ®); + size = dt_mem_next_cell(dt_root_size_cells, ®); + + if (size == 0) + continue; + DBG(" - %lx , %lx\n", base, size); + if (iommu_is_off) { + if (base >= 0x80000000ul) + continue; + if ((base + size) > 0x80000000ul) + size = 0x80000000ul - base; + } + lmb_add(base, size); + } + return 0; +} + +static void __init early_reserve_mem(void) +{ + u64 base, size; + u64 *reserve_map = (u64 *)(((unsigned long)initial_boot_params) + + initial_boot_params->off_mem_rsvmap); + while (1) { + base = *(reserve_map++); + size = *(reserve_map++); + if (size == 0) + break; + DBG("reserving: %lx -> %lx\n", base, size); + lmb_reserve(base, size); + } + +#if 0 + DBG("memory reserved, lmbs :\n"); + lmb_dump_all(); +#endif +} + +void __init early_init_devtree(void *params) +{ + DBG(" -> early_init_devtree()\n"); + + /* Setup flat device-tree pointer */ + initial_boot_params = params; + + /* Retreive various informations from the /chosen node of the + * device-tree, including the platform type, initrd location and + * size, TCE reserve, and more ... + */ + of_scan_flat_dt(early_init_dt_scan_chosen, NULL); + + /* Scan memory nodes and rebuild LMBs */ + lmb_init(); + of_scan_flat_dt(early_init_dt_scan_root, NULL); + of_scan_flat_dt(early_init_dt_scan_memory, NULL); + lmb_enforce_memory_limit(memory_limit); + lmb_analyze(); + lmb_reserve(0, __pa(klimit)); + + /* Reserve LMB regions used by kernel, initrd, dt, etc... */ + early_reserve_mem(); + + DBG("Scanning CPUs ...\n"); + + /* Retreive hash table size from flattened tree plus other + * CPU related informations (altivec support, boot CPU ID, ...) + */ + of_scan_flat_dt(early_init_dt_scan_cpus, NULL); + + DBG(" <- early_init_devtree()\n"); +} + +#undef printk + +int +prom_n_addr_cells(struct device_node* np) +{ + int* ip; + do { + if (np->parent) + np = np->parent; + ip = (int *) get_property(np, "#address-cells", NULL); + if (ip != NULL) + return *ip; + } while (np->parent); + /* No #address-cells property for the root node, default to 1 */ + return 1; +} + +int +prom_n_size_cells(struct device_node* np) +{ + int* ip; + do { + if (np->parent) + np = np->parent; + ip = (int *) get_property(np, "#size-cells", NULL); + if (ip != NULL) + return *ip; + } while (np->parent); + /* No #size-cells property for the root node, default to 1 */ + return 1; +} + +/** + * Work out the sense (active-low level / active-high edge) + * of each interrupt from the device tree. + */ +void __init prom_get_irq_senses(unsigned char *senses, int off, int max) +{ + struct device_node *np; + int i, j; + + /* default to level-triggered */ + memset(senses, 1, max - off); + + for (np = allnodes; np != 0; np = np->allnext) { + for (j = 0; j < np->n_intrs; j++) { + i = np->intrs[j].line; + if (i >= off && i < max) + senses[i-off] = np->intrs[j].sense ? + IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE : + IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE; + } + } +} + +/** + * Construct and return a list of the device_nodes with a given name. + */ +struct device_node * +find_devices(const char *name) +{ + struct device_node *head, **prevp, *np; + + prevp = &head; + for (np = allnodes; np != 0; np = np->allnext) { + if (np->name != 0 && strcasecmp(np->name, name) == 0) { + *prevp = np; + prevp = &np->next; + } + } + *prevp = NULL; + return head; +} +EXPORT_SYMBOL(find_devices); + +/** + * Construct and return a list of the device_nodes with a given type. + */ +struct device_node * +find_type_devices(const char *type) +{ + struct device_node *head, **prevp, *np; + + prevp = &head; + for (np = allnodes; np != 0; np = np->allnext) { + if (np->type != 0 && strcasecmp(np->type, type) == 0) { + *prevp = np; + prevp = &np->next; + } + } + *prevp = NULL; + return head; +} +EXPORT_SYMBOL(find_type_devices); + +/** + * Returns all nodes linked together + */ +struct device_node * +find_all_nodes(void) +{ + struct device_node *head, **prevp, *np; + + prevp = &head; + for (np = allnodes; np != 0; np = np->allnext) { + *prevp = np; + prevp = &np->next; + } + *prevp = NULL; + return head; +} +EXPORT_SYMBOL(find_all_nodes); + +/** Checks if the given "compat" string matches one of the strings in + * the device's "compatible" property + */ +int +device_is_compatible(struct device_node *device, const char *compat) +{ + const char* cp; + int cplen, l; + + cp = (char *) get_property(device, "compatible", &cplen); + if (cp == NULL) + return 0; + while (cplen > 0) { + if (strncasecmp(cp, compat, strlen(compat)) == 0) + return 1; + l = strlen(cp) + 1; + cp += l; + cplen -= l; + } + + return 0; +} +EXPORT_SYMBOL(device_is_compatible); + + +/** + * Indicates whether the root node has a given value in its + * compatible property. + */ +int +machine_is_compatible(const char *compat) +{ + struct device_node *root; + int rc = 0; + + root = of_find_node_by_path("/"); + if (root) { + rc = device_is_compatible(root, compat); + of_node_put(root); + } + return rc; +} +EXPORT_SYMBOL(machine_is_compatible); + +/** + * Construct and return a list of the device_nodes with a given type + * and compatible property. + */ +struct device_node * +find_compatible_devices(const char *type, const char *compat) +{ + struct device_node *head, **prevp, *np; + + prevp = &head; + for (np = allnodes; np != 0; np = np->allnext) { + if (type != NULL + && !(np->type != 0 && strcasecmp(np->type, type) == 0)) + continue; + if (device_is_compatible(np, compat)) { + *prevp = np; + prevp = &np->next; + } + } + *prevp = NULL; + return head; +} +EXPORT_SYMBOL(find_compatible_devices); + +/** + * Find the device_node with a given full_name. + */ +struct device_node * +find_path_device(const char *path) +{ + struct device_node *np; + + for (np = allnodes; np != 0; np = np->allnext) + if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0) + return np; + return NULL; +} +EXPORT_SYMBOL(find_path_device); + +/******* + * + * New implementation of the OF "find" APIs, return a refcounted + * object, call of_node_put() when done. The device tree and list + * are protected by a rw_lock. + * + * Note that property management will need some locking as well, + * this isn't dealt with yet. + * + *******/ + +/** + * of_find_node_by_name - Find a node by its "name" property + * @from: The node to start searching from or NULL, the node + * you pass will not be searched, only the next one + * will; typically, you pass what the previous call + * returned. of_node_put() will be called on it + * @name: The name string to match against + * + * Returns a node pointer with refcount incremented, use + * of_node_put() on it when done. + */ +struct device_node *of_find_node_by_name(struct device_node *from, + const char *name) +{ + struct device_node *np; + + read_lock(&devtree_lock); + np = from ? from->allnext : allnodes; + for (; np != 0; np = np->allnext) + if (np->name != 0 && strcasecmp(np->name, name) == 0 + && of_node_get(np)) + break; + if (from) + of_node_put(from); + read_unlock(&devtree_lock); + return np; +} +EXPORT_SYMBOL(of_find_node_by_name); + +/** + * of_find_node_by_type - Find a node by its "device_type" property + * @from: The node to start searching from or NULL, the node + * you pass will not be searched, only the next one + * will; typically, you pass what the previous call + * returned. of_node_put() will be called on it + * @name: The type string to match against + * + * Returns a node pointer with refcount incremented, use + * of_node_put() on it when done. + */ +struct device_node *of_find_node_by_type(struct device_node *from, + const char *type) +{ + struct device_node *np; + + read_lock(&devtree_lock); + np = from ? from->allnext : allnodes; + for (; np != 0; np = np->allnext) + if (np->type != 0 && strcasecmp(np->type, type) == 0 + && of_node_get(np)) + break; + if (from) + of_node_put(from); + read_unlock(&devtree_lock); + return np; +} +EXPORT_SYMBOL(of_find_node_by_type); + +/** + * of_find_compatible_node - Find a node based on type and one of the + * tokens in its "compatible" property + * @from: The node to start searching from or NULL, the node + * you pass will not be searched, only the next one + * will; typically, you pass what the previous call + * returned. of_node_put() will be called on it + * @type: The type string to match "device_type" or NULL to ignore + * @compatible: The string to match to one of the tokens in the device + * "compatible" list. + * + * Returns a node pointer with refcount incremented, use + * of_node_put() on it when done. + */ +struct device_node *of_find_compatible_node(struct device_node *from, + const char *type, const char *compatible) +{ + struct device_node *np; + + read_lock(&devtree_lock); + np = from ? from->allnext : allnodes; + for (; np != 0; np = np->allnext) { + if (type != NULL + && !(np->type != 0 && strcasecmp(np->type, type) == 0)) + continue; + if (device_is_compatible(np, compatible) && of_node_get(np)) + break; + } + if (from) + of_node_put(from); + read_unlock(&devtree_lock); + return np; +} +EXPORT_SYMBOL(of_find_compatible_node); + +/** + * of_find_node_by_path - Find a node matching a full OF path + * @path: The full path to match + * + * Returns a node pointer with refcount incremented, use + * of_node_put() on it when done. + */ +struct device_node *of_find_node_by_path(const char *path) +{ + struct device_node *np = allnodes; + + read_lock(&devtree_lock); + for (; np != 0; np = np->allnext) { + if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0 + && of_node_get(np)) + break; + } + read_unlock(&devtree_lock); + return np; +} +EXPORT_SYMBOL(of_find_node_by_path); + +/** + * of_find_node_by_phandle - Find a node given a phandle + * @handle: phandle of the node to find + * + * Returns a node pointer with refcount incremented, use + * of_node_put() on it when done. + */ +struct device_node *of_find_node_by_phandle(phandle handle) +{ + struct device_node *np; + + read_lock(&devtree_lock); + for (np = allnodes; np != 0; np = np->allnext) + if (np->linux_phandle == handle) + break; + if (np) + of_node_get(np); + read_unlock(&devtree_lock); + return np; +} +EXPORT_SYMBOL(of_find_node_by_phandle); + +/** + * of_find_all_nodes - Get next node in global list + * @prev: Previous node or NULL to start iteration + * of_node_put() will be called on it + * + * Returns a node pointer with refcount incremented, use + * of_node_put() on it when done. + */ +struct device_node *of_find_all_nodes(struct device_node *prev) +{ + struct device_node *np; + + read_lock(&devtree_lock); + np = prev ? prev->allnext : allnodes; + for (; np != 0; np = np->allnext) + if (of_node_get(np)) + break; + if (prev) + of_node_put(prev); + read_unlock(&devtree_lock); + return np; +} +EXPORT_SYMBOL(of_find_all_nodes); + +/** + * of_get_parent - Get a node's parent if any + * @node: Node to get parent + * + * Returns a node pointer with refcount incremented, use + * of_node_put() on it when done. + */ +struct device_node *of_get_parent(const struct device_node *node) +{ + struct device_node *np; + + if (!node) + return NULL; + + read_lock(&devtree_lock); + np = of_node_get(node->parent); + read_unlock(&devtree_lock); + return np; +} +EXPORT_SYMBOL(of_get_parent); + +/** + * of_get_next_child - Iterate a node childs + * @node: parent node + * @prev: previous child of the parent node, or NULL to get first + * + * Returns a node pointer with refcount incremented, use + * of_node_put() on it when done. + */ +struct device_node *of_get_next_child(const struct device_node *node, + struct device_node *prev) +{ + struct device_node *next; + + read_lock(&devtree_lock); + next = prev ? prev->sibling : node->child; + for (; next != 0; next = next->sibling) + if (of_node_get(next)) + break; + if (prev) + of_node_put(prev); + read_unlock(&devtree_lock); + return next; +} +EXPORT_SYMBOL(of_get_next_child); + +/** + * of_node_get - Increment refcount of a node + * @node: Node to inc refcount, NULL is supported to + * simplify writing of callers + * + * Returns node. + */ +struct device_node *of_node_get(struct device_node *node) +{ + if (node) + kref_get(&node->kref); + return node; +} +EXPORT_SYMBOL(of_node_get); + +static inline struct device_node * kref_to_device_node(struct kref *kref) +{ + return container_of(kref, struct device_node, kref); +} + +/** + * of_node_release - release a dynamically allocated node + * @kref: kref element of the node to be released + * + * In of_node_put() this function is passed to kref_put() + * as the destructor. + */ +static void of_node_release(struct kref *kref) +{ + struct device_node *node = kref_to_device_node(kref); + struct property *prop = node->properties; + + if (!OF_IS_DYNAMIC(node)) + return; + while (prop) { + struct property *next = prop->next; + kfree(prop->name); + kfree(prop->value); + kfree(prop); + prop = next; + } + kfree(node->intrs); + kfree(node->addrs); + kfree(node->full_name); + kfree(node->data); + kfree(node); +} + +/** + * of_node_put - Decrement refcount of a node + * @node: Node to dec refcount, NULL is supported to + * simplify writing of callers + * + */ +void of_node_put(struct device_node *node) +{ + if (node) + kref_put(&node->kref, of_node_release); +} +EXPORT_SYMBOL(of_node_put); + +/* + * Fix up the uninitialized fields in a new device node: + * name, type, n_addrs, addrs, n_intrs, intrs, and pci-specific fields + * + * A lot of boot-time code is duplicated here, because functions such + * as finish_node_interrupts, interpret_pci_props, etc. cannot use the + * slab allocator. + * + * This should probably be split up into smaller chunks. + */ + +static int of_finish_dynamic_node(struct device_node *node, + unsigned long *unused1, int unused2, + int unused3, int unused4) +{ + struct device_node *parent = of_get_parent(node); + int err = 0; + phandle *ibm_phandle; + + node->name = get_property(node, "name", NULL); + node->type = get_property(node, "device_type", NULL); + + if (!parent) { + err = -ENODEV; + goto out; + } + + /* We don't support that function on PowerMac, at least + * not yet + */ + if (_machine == PLATFORM_POWERMAC) + return -ENODEV; + + /* fix up new node's linux_phandle field */ + if ((ibm_phandle = (unsigned int *)get_property(node, "ibm,phandle", NULL))) + node->linux_phandle = *ibm_phandle; + +out: + of_node_put(parent); + return err; +} + +/* + * Plug a device node into the tree and global list. + */ +void of_attach_node(struct device_node *np) +{ + write_lock(&devtree_lock); + np->sibling = np->parent->child; + np->allnext = allnodes; + np->parent->child = np; + allnodes = np; + write_unlock(&devtree_lock); +} + +/* + * "Unplug" a node from the device tree. The caller must hold + * a reference to the node. The memory associated with the node + * is not freed until its refcount goes to zero. + */ +void of_detach_node(const struct device_node *np) +{ + struct device_node *parent; + + write_lock(&devtree_lock); + + parent = np->parent; + + if (allnodes == np) + allnodes = np->allnext; + else { + struct device_node *prev; + for (prev = allnodes; + prev->allnext != np; + prev = prev->allnext) + ; + prev->allnext = np->allnext; + } + + if (parent->child == np) + parent->child = np->sibling; + else { + struct device_node *prevsib; + for (prevsib = np->parent->child; + prevsib->sibling != np; + prevsib = prevsib->sibling) + ; + prevsib->sibling = np->sibling; + } + + write_unlock(&devtree_lock); +} + +static int prom_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node) +{ + int err; + + switch (action) { + case PSERIES_RECONFIG_ADD: + err = finish_node(node, NULL, of_finish_dynamic_node, 0, 0, 0); + if (err < 0) { + printk(KERN_ERR "finish_node returned %d\n", err); + err = NOTIFY_BAD; + } + break; + default: + err = NOTIFY_DONE; + break; + } + return err; +} + +static struct notifier_block prom_reconfig_nb = { + .notifier_call = prom_reconfig_notifier, + .priority = 10, /* This one needs to run first */ +}; + +static int __init prom_reconfig_setup(void) +{ + return pSeries_reconfig_notifier_register(&prom_reconfig_nb); +} +__initcall(prom_reconfig_setup); + +/* + * Find a property with a given name for a given node + * and return the value. + */ +unsigned char * +get_property(struct device_node *np, const char *name, int *lenp) +{ + struct property *pp; + + for (pp = np->properties; pp != 0; pp = pp->next) + if (strcmp(pp->name, name) == 0) { + if (lenp != 0) + *lenp = pp->length; + return pp->value; + } + return NULL; +} +EXPORT_SYMBOL(get_property); + +/* + * Add a property to a node. + */ +int +prom_add_property(struct device_node* np, struct property* prop) +{ + struct property **next; + + prop->next = NULL; + write_lock(&devtree_lock); + next = &np->properties; + while (*next) { + if (strcmp(prop->name, (*next)->name) == 0) { + /* duplicate ! don't insert it */ + write_unlock(&devtree_lock); + return -1; + } + next = &(*next)->next; + } + *next = prop; + write_unlock(&devtree_lock); + + /* try to add to proc as well if it was initialized */ + if (np->pde) + proc_device_tree_add_prop(np->pde, prop); + + return 0; +} + +#if 0 +void +print_properties(struct device_node *np) +{ + struct property *pp; + char *cp; + int i, n; + + for (pp = np->properties; pp != 0; pp = pp->next) { + printk(KERN_INFO "%s", pp->name); + for (i = strlen(pp->name); i < 16; ++i) + printk(" "); + cp = (char *) pp->value; + for (i = pp->length; i > 0; --i, ++cp) + if ((i > 1 && (*cp < 0x20 || *cp > 0x7e)) + || (i == 1 && *cp != 0)) + break; + if (i == 0 && pp->length > 1) { + /* looks like a string */ + printk(" %s\n", (char *) pp->value); + } else { + /* dump it in hex */ + n = pp->length; + if (n > 64) + n = 64; + if (pp->length % 4 == 0) { + unsigned int *p = (unsigned int *) pp->value; + + n /= 4; + for (i = 0; i < n; ++i) { + if (i != 0 && (i % 4) == 0) + printk("\n "); + printk(" %08x", *p++); + } + } else { + unsigned char *bp = pp->value; + + for (i = 0; i < n; ++i) { + if (i != 0 && (i % 16) == 0) + printk("\n "); + printk(" %02x", *bp++); + } + } + printk("\n"); + if (pp->length > 64) + printk(" ... (length = %d)\n", + pp->length); + } + } +} +#endif + + + + + + + + + + diff --git a/trunk/arch/ppc64/kernel/prom_init.c b/trunk/arch/ppc64/kernel/prom_init.c new file mode 100644 index 000000000000..6375f40b23db --- /dev/null +++ b/trunk/arch/ppc64/kernel/prom_init.c @@ -0,0 +1,2051 @@ +/* + * + * + * Procedures for interfacing to Open Firmware. + * + * Paul Mackerras August 1996. + * Copyright (C) 1996 Paul Mackerras. + * + * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner. + * {engebret|bergner}@us.ibm.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. + */ + +#undef DEBUG_PROM + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_LOGO_LINUX_CLUT224 +#include +extern const struct linux_logo logo_linux_clut224; +#endif + +/* + * Properties whose value is longer than this get excluded from our + * copy of the device tree. This value does need to be big enough to + * ensure that we don't lose things like the interrupt-map property + * on a PCI-PCI bridge. + */ +#define MAX_PROPERTY_LENGTH (1UL * 1024 * 1024) + +/* + * Eventually bump that one up + */ +#define DEVTREE_CHUNK_SIZE 0x100000 + +/* + * This is the size of the local memory reserve map that gets copied + * into the boot params passed to the kernel. That size is totally + * flexible as the kernel just reads the list until it encounters an + * entry with size 0, so it can be changed without breaking binary + * compatibility + */ +#define MEM_RESERVE_MAP_SIZE 8 + +/* + * prom_init() is called very early on, before the kernel text + * and data have been mapped to KERNELBASE. At this point the code + * is running at whatever address it has been loaded at, so + * references to extern and static variables must be relocated + * explicitly. The procedure reloc_offset() returns the address + * we're currently running at minus the address we were linked at. + * (Note that strings count as static variables.) + * + * Because OF may have mapped I/O devices into the area starting at + * KERNELBASE, particularly on CHRP machines, we can't safely call + * OF once the kernel has been mapped to KERNELBASE. Therefore all + * OF calls should be done within prom_init(), and prom_init() + * and all routines called within it must be careful to relocate + * references as necessary. + * + * Note that the bss is cleared *after* prom_init runs, so we have + * to make sure that any static or extern variables it accesses + * are put in the data segment. + */ + + +#define PROM_BUG() do { \ + prom_printf("kernel BUG at %s line 0x%x!\n", \ + RELOC(__FILE__), __LINE__); \ + __asm__ __volatile__(".long " BUG_ILLEGAL_INSTR); \ +} while (0) + +#ifdef DEBUG_PROM +#define prom_debug(x...) prom_printf(x) +#else +#define prom_debug(x...) +#endif + + +typedef u32 prom_arg_t; + +struct prom_args { + u32 service; + u32 nargs; + u32 nret; + prom_arg_t args[10]; + prom_arg_t *rets; /* Pointer to return values in args[16]. */ +}; + +struct prom_t { + unsigned long entry; + ihandle root; + ihandle chosen; + int cpu; + ihandle stdout; + ihandle disp_node; + struct prom_args args; + unsigned long version; + unsigned long root_size_cells; + unsigned long root_addr_cells; +}; + +struct pci_reg_property { + struct pci_address addr; + u32 size_hi; + u32 size_lo; +}; + +struct mem_map_entry { + u64 base; + u64 size; +}; + +typedef u32 cell_t; + +extern void __start(unsigned long r3, unsigned long r4, unsigned long r5); + +extern void enter_prom(struct prom_args *args, unsigned long entry); +extern void copy_and_flush(unsigned long dest, unsigned long src, + unsigned long size, unsigned long offset); + +extern unsigned long klimit; + +/* prom structure */ +static struct prom_t __initdata prom; + +#define PROM_SCRATCH_SIZE 256 + +static char __initdata of_stdout_device[256]; +static char __initdata prom_scratch[PROM_SCRATCH_SIZE]; + +static unsigned long __initdata dt_header_start; +static unsigned long __initdata dt_struct_start, dt_struct_end; +static unsigned long __initdata dt_string_start, dt_string_end; + +static unsigned long __initdata prom_initrd_start, prom_initrd_end; + +static int __initdata iommu_force_on; +static int __initdata ppc64_iommu_off; +static int __initdata of_platform; + +static char __initdata prom_cmd_line[COMMAND_LINE_SIZE]; + +static unsigned long __initdata prom_memory_limit; +static unsigned long __initdata prom_tce_alloc_start; +static unsigned long __initdata prom_tce_alloc_end; + +static unsigned long __initdata alloc_top; +static unsigned long __initdata alloc_top_high; +static unsigned long __initdata alloc_bottom; +static unsigned long __initdata rmo_top; +static unsigned long __initdata ram_top; + +static struct mem_map_entry __initdata mem_reserve_map[MEM_RESERVE_MAP_SIZE]; +static int __initdata mem_reserve_cnt; + +static cell_t __initdata regbuf[1024]; + + +#define MAX_CPU_THREADS 2 + +/* TO GO */ +#ifdef CONFIG_HMT +struct { + unsigned int pir; + unsigned int threadid; +} hmt_thread_data[NR_CPUS]; +#endif /* CONFIG_HMT */ + +/* + * This are used in calls to call_prom. The 4th and following + * arguments to call_prom should be 32-bit values. 64 bit values + * are truncated to 32 bits (and fortunately don't get interpreted + * as two arguments). + */ +#define ADDR(x) (u32) ((unsigned long)(x) - offset) + +/* + * Error results ... some OF calls will return "-1" on error, some + * will return 0, some will return either. To simplify, here are + * macros to use with any ihandle or phandle return value to check if + * it is valid + */ + +#define PROM_ERROR (-1u) +#define PHANDLE_VALID(p) ((p) != 0 && (p) != PROM_ERROR) +#define IHANDLE_VALID(i) ((i) != 0 && (i) != PROM_ERROR) + + +/* This is the one and *ONLY* place where we actually call open + * firmware from, since we need to make sure we're running in 32b + * mode when we do. We switch back to 64b mode upon return. + */ + +static int __init call_prom(const char *service, int nargs, int nret, ...) +{ + int i; + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + va_list list; + + _prom->args.service = ADDR(service); + _prom->args.nargs = nargs; + _prom->args.nret = nret; + _prom->args.rets = (prom_arg_t *)&(_prom->args.args[nargs]); + + va_start(list, nret); + for (i=0; i < nargs; i++) + _prom->args.args[i] = va_arg(list, prom_arg_t); + va_end(list); + + for (i=0; i < nret ;i++) + _prom->args.rets[i] = 0; + + enter_prom(&_prom->args, _prom->entry); + + return (nret > 0) ? _prom->args.rets[0] : 0; +} + + +static unsigned int __init prom_claim(unsigned long virt, unsigned long size, + unsigned long align) +{ + return (unsigned int)call_prom("claim", 3, 1, + (prom_arg_t)virt, (prom_arg_t)size, + (prom_arg_t)align); +} + +static void __init prom_print(const char *msg) +{ + const char *p, *q; + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + + if (_prom->stdout == 0) + return; + + for (p = msg; *p != 0; p = q) { + for (q = p; *q != 0 && *q != '\n'; ++q) + ; + if (q > p) + call_prom("write", 3, 1, _prom->stdout, p, q - p); + if (*q == 0) + break; + ++q; + call_prom("write", 3, 1, _prom->stdout, ADDR("\r\n"), 2); + } +} + + +static void __init prom_print_hex(unsigned long val) +{ + unsigned long offset = reloc_offset(); + int i, nibbles = sizeof(val)*2; + char buf[sizeof(val)*2+1]; + struct prom_t *_prom = PTRRELOC(&prom); + + for (i = nibbles-1; i >= 0; i--) { + buf[i] = (val & 0xf) + '0'; + if (buf[i] > '9') + buf[i] += ('a'-'0'-10); + val >>= 4; + } + buf[nibbles] = '\0'; + call_prom("write", 3, 1, _prom->stdout, buf, nibbles); +} + + +static void __init prom_printf(const char *format, ...) +{ + unsigned long offset = reloc_offset(); + const char *p, *q, *s; + va_list args; + unsigned long v; + struct prom_t *_prom = PTRRELOC(&prom); + + va_start(args, format); + for (p = PTRRELOC(format); *p != 0; p = q) { + for (q = p; *q != 0 && *q != '\n' && *q != '%'; ++q) + ; + if (q > p) + call_prom("write", 3, 1, _prom->stdout, p, q - p); + if (*q == 0) + break; + if (*q == '\n') { + ++q; + call_prom("write", 3, 1, _prom->stdout, + ADDR("\r\n"), 2); + continue; + } + ++q; + if (*q == 0) + break; + switch (*q) { + case 's': + ++q; + s = va_arg(args, const char *); + prom_print(s); + break; + case 'x': + ++q; + v = va_arg(args, unsigned long); + prom_print_hex(v); + break; + } + } +} + + +static void __init __attribute__((noreturn)) prom_panic(const char *reason) +{ + unsigned long offset = reloc_offset(); + + prom_print(PTRRELOC(reason)); + /* ToDo: should put up an SRC here */ + call_prom("exit", 0, 0); + + for (;;) /* should never get here */ + ; +} + + +static int __init prom_next_node(phandle *nodep) +{ + phandle node; + + if ((node = *nodep) != 0 + && (*nodep = call_prom("child", 1, 1, node)) != 0) + return 1; + if ((*nodep = call_prom("peer", 1, 1, node)) != 0) + return 1; + for (;;) { + if ((node = call_prom("parent", 1, 1, node)) == 0) + return 0; + if ((*nodep = call_prom("peer", 1, 1, node)) != 0) + return 1; + } +} + +static int __init prom_getprop(phandle node, const char *pname, + void *value, size_t valuelen) +{ + unsigned long offset = reloc_offset(); + + return call_prom("getprop", 4, 1, node, ADDR(pname), + (u32)(unsigned long) value, (u32) valuelen); +} + +static int __init prom_getproplen(phandle node, const char *pname) +{ + unsigned long offset = reloc_offset(); + + return call_prom("getproplen", 2, 1, node, ADDR(pname)); +} + +static int __init prom_setprop(phandle node, const char *pname, + void *value, size_t valuelen) +{ + unsigned long offset = reloc_offset(); + + return call_prom("setprop", 4, 1, node, ADDR(pname), + (u32)(unsigned long) value, (u32) valuelen); +} + +/* We can't use the standard versions because of RELOC headaches. */ +#define isxdigit(c) (('0' <= (c) && (c) <= '9') \ + || ('a' <= (c) && (c) <= 'f') \ + || ('A' <= (c) && (c) <= 'F')) + +#define isdigit(c) ('0' <= (c) && (c) <= '9') +#define islower(c) ('a' <= (c) && (c) <= 'z') +#define toupper(c) (islower(c) ? ((c) - 'a' + 'A') : (c)) + +unsigned long prom_strtoul(const char *cp, const char **endp) +{ + unsigned long result = 0, base = 10, value; + + if (*cp == '0') { + base = 8; + cp++; + if (toupper(*cp) == 'X') { + cp++; + base = 16; + } + } + + while (isxdigit(*cp) && + (value = isdigit(*cp) ? *cp - '0' : toupper(*cp) - 'A' + 10) < base) { + result = result * base + value; + cp++; + } + + if (endp) + *endp = cp; + + return result; +} + +unsigned long prom_memparse(const char *ptr, const char **retptr) +{ + unsigned long ret = prom_strtoul(ptr, retptr); + int shift = 0; + + /* + * We can't use a switch here because GCC *may* generate a + * jump table which won't work, because we're not running at + * the address we're linked at. + */ + if ('G' == **retptr || 'g' == **retptr) + shift = 30; + + if ('M' == **retptr || 'm' == **retptr) + shift = 20; + + if ('K' == **retptr || 'k' == **retptr) + shift = 10; + + if (shift) { + ret <<= shift; + (*retptr)++; + } + + return ret; +} + +/* + * Early parsing of the command line passed to the kernel, used for + * "mem=x" and the options that affect the iommu + */ +static void __init early_cmdline_parse(void) +{ + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + char *opt, *p; + int l = 0; + + RELOC(prom_cmd_line[0]) = 0; + p = RELOC(prom_cmd_line); + if ((long)_prom->chosen > 0) + l = prom_getprop(_prom->chosen, "bootargs", p, COMMAND_LINE_SIZE-1); +#ifdef CONFIG_CMDLINE + if (l == 0) /* dbl check */ + strlcpy(RELOC(prom_cmd_line), + RELOC(CONFIG_CMDLINE), sizeof(prom_cmd_line)); +#endif /* CONFIG_CMDLINE */ + prom_printf("command line: %s\n", RELOC(prom_cmd_line)); + + opt = strstr(RELOC(prom_cmd_line), RELOC("iommu=")); + if (opt) { + prom_printf("iommu opt is: %s\n", opt); + opt += 6; + while (*opt && *opt == ' ') + opt++; + if (!strncmp(opt, RELOC("off"), 3)) + RELOC(ppc64_iommu_off) = 1; + else if (!strncmp(opt, RELOC("force"), 5)) + RELOC(iommu_force_on) = 1; + } + + opt = strstr(RELOC(prom_cmd_line), RELOC("mem=")); + if (opt) { + opt += 4; + RELOC(prom_memory_limit) = prom_memparse(opt, (const char **)&opt); + /* Align to 16 MB == size of large page */ + RELOC(prom_memory_limit) = ALIGN(RELOC(prom_memory_limit), 0x1000000); + } +} + +/* + * To tell the firmware what our capabilities are, we have to pass + * it a fake 32-bit ELF header containing a couple of PT_NOTE sections + * that contain structures that contain the actual values. + */ +static struct fake_elf { + Elf32_Ehdr elfhdr; + Elf32_Phdr phdr[2]; + struct chrpnote { + u32 namesz; + u32 descsz; + u32 type; + char name[8]; /* "PowerPC" */ + struct chrpdesc { + u32 real_mode; + u32 real_base; + u32 real_size; + u32 virt_base; + u32 virt_size; + u32 load_base; + } chrpdesc; + } chrpnote; + struct rpanote { + u32 namesz; + u32 descsz; + u32 type; + char name[24]; /* "IBM,RPA-Client-Config" */ + struct rpadesc { + u32 lpar_affinity; + u32 min_rmo_size; + u32 min_rmo_percent; + u32 max_pft_size; + u32 splpar; + u32 min_load; + u32 new_mem_def; + u32 ignore_me; + } rpadesc; + } rpanote; +} fake_elf = { + .elfhdr = { + .e_ident = { 0x7f, 'E', 'L', 'F', + ELFCLASS32, ELFDATA2MSB, EV_CURRENT }, + .e_type = ET_EXEC, /* yeah right */ + .e_machine = EM_PPC, + .e_version = EV_CURRENT, + .e_phoff = offsetof(struct fake_elf, phdr), + .e_phentsize = sizeof(Elf32_Phdr), + .e_phnum = 2 + }, + .phdr = { + [0] = { + .p_type = PT_NOTE, + .p_offset = offsetof(struct fake_elf, chrpnote), + .p_filesz = sizeof(struct chrpnote) + }, [1] = { + .p_type = PT_NOTE, + .p_offset = offsetof(struct fake_elf, rpanote), + .p_filesz = sizeof(struct rpanote) + } + }, + .chrpnote = { + .namesz = sizeof("PowerPC"), + .descsz = sizeof(struct chrpdesc), + .type = 0x1275, + .name = "PowerPC", + .chrpdesc = { + .real_mode = ~0U, /* ~0 means "don't care" */ + .real_base = ~0U, + .real_size = ~0U, + .virt_base = ~0U, + .virt_size = ~0U, + .load_base = ~0U + }, + }, + .rpanote = { + .namesz = sizeof("IBM,RPA-Client-Config"), + .descsz = sizeof(struct rpadesc), + .type = 0x12759999, + .name = "IBM,RPA-Client-Config", + .rpadesc = { + .lpar_affinity = 0, + .min_rmo_size = 64, /* in megabytes */ + .min_rmo_percent = 0, + .max_pft_size = 48, /* 2^48 bytes max PFT size */ + .splpar = 1, + .min_load = ~0U, + .new_mem_def = 0 + } + } +}; + +static void __init prom_send_capabilities(void) +{ + unsigned long offset = reloc_offset(); + ihandle elfloader; + + elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader")); + if (elfloader == 0) { + prom_printf("couldn't open /packages/elf-loader\n"); + return; + } + call_prom("call-method", 3, 1, ADDR("process-elf-header"), + elfloader, ADDR(&fake_elf)); + call_prom("close", 1, 0, elfloader); +} + +/* + * Memory allocation strategy... our layout is normally: + * + * at 14Mb or more we vmlinux, then a gap and initrd. In some rare cases, initrd + * might end up beeing before the kernel though. We assume this won't override + * the final kernel at 0, we have no provision to handle that in this version, + * but it should hopefully never happen. + * + * alloc_top is set to the top of RMO, eventually shrink down if the TCEs overlap + * alloc_bottom is set to the top of kernel/initrd + * + * from there, allocations are done that way : rtas is allocated topmost, and + * the device-tree is allocated from the bottom. We try to grow the device-tree + * allocation as we progress. If we can't, then we fail, we don't currently have + * a facility to restart elsewhere, but that shouldn't be necessary neither + * + * Note that calls to reserve_mem have to be done explicitely, memory allocated + * with either alloc_up or alloc_down isn't automatically reserved. + */ + + +/* + * Allocates memory in the RMO upward from the kernel/initrd + * + * When align is 0, this is a special case, it means to allocate in place + * at the current location of alloc_bottom or fail (that is basically + * extending the previous allocation). Used for the device-tree flattening + */ +static unsigned long __init alloc_up(unsigned long size, unsigned long align) +{ + unsigned long offset = reloc_offset(); + unsigned long base = _ALIGN_UP(RELOC(alloc_bottom), align); + unsigned long addr = 0; + + prom_debug("alloc_up(%x, %x)\n", size, align); + if (RELOC(ram_top) == 0) + prom_panic("alloc_up() called with mem not initialized\n"); + + if (align) + base = _ALIGN_UP(RELOC(alloc_bottom), align); + else + base = RELOC(alloc_bottom); + + for(; (base + size) <= RELOC(alloc_top); + base = _ALIGN_UP(base + 0x100000, align)) { + prom_debug(" trying: 0x%x\n\r", base); + addr = (unsigned long)prom_claim(base, size, 0); + if (addr != PROM_ERROR) + break; + addr = 0; + if (align == 0) + break; + } + if (addr == 0) + return 0; + RELOC(alloc_bottom) = addr; + + prom_debug(" -> %x\n", addr); + prom_debug(" alloc_bottom : %x\n", RELOC(alloc_bottom)); + prom_debug(" alloc_top : %x\n", RELOC(alloc_top)); + prom_debug(" alloc_top_hi : %x\n", RELOC(alloc_top_high)); + prom_debug(" rmo_top : %x\n", RELOC(rmo_top)); + prom_debug(" ram_top : %x\n", RELOC(ram_top)); + + return addr; +} + +/* + * Allocates memory downard, either from top of RMO, or if highmem + * is set, from the top of RAM. Note that this one doesn't handle + * failures. In does claim memory if highmem is not set. + */ +static unsigned long __init alloc_down(unsigned long size, unsigned long align, + int highmem) +{ + unsigned long offset = reloc_offset(); + unsigned long base, addr = 0; + + prom_debug("alloc_down(%x, %x, %s)\n", size, align, + highmem ? RELOC("(high)") : RELOC("(low)")); + if (RELOC(ram_top) == 0) + prom_panic("alloc_down() called with mem not initialized\n"); + + if (highmem) { + /* Carve out storage for the TCE table. */ + addr = _ALIGN_DOWN(RELOC(alloc_top_high) - size, align); + if (addr <= RELOC(alloc_bottom)) + return 0; + else { + /* Will we bump into the RMO ? If yes, check out that we + * didn't overlap existing allocations there, if we did, + * we are dead, we must be the first in town ! + */ + if (addr < RELOC(rmo_top)) { + /* Good, we are first */ + if (RELOC(alloc_top) == RELOC(rmo_top)) + RELOC(alloc_top) = RELOC(rmo_top) = addr; + else + return 0; + } + RELOC(alloc_top_high) = addr; + } + goto bail; + } + + base = _ALIGN_DOWN(RELOC(alloc_top) - size, align); + for(; base > RELOC(alloc_bottom); base = _ALIGN_DOWN(base - 0x100000, align)) { + prom_debug(" trying: 0x%x\n\r", base); + addr = (unsigned long)prom_claim(base, size, 0); + if (addr != PROM_ERROR) + break; + addr = 0; + } + if (addr == 0) + return 0; + RELOC(alloc_top) = addr; + + bail: + prom_debug(" -> %x\n", addr); + prom_debug(" alloc_bottom : %x\n", RELOC(alloc_bottom)); + prom_debug(" alloc_top : %x\n", RELOC(alloc_top)); + prom_debug(" alloc_top_hi : %x\n", RELOC(alloc_top_high)); + prom_debug(" rmo_top : %x\n", RELOC(rmo_top)); + prom_debug(" ram_top : %x\n", RELOC(ram_top)); + + return addr; +} + +/* + * Parse a "reg" cell + */ +static unsigned long __init prom_next_cell(int s, cell_t **cellp) +{ + cell_t *p = *cellp; + unsigned long r = 0; + + /* Ignore more than 2 cells */ + while (s > 2) { + p++; + s--; + } + while (s) { + r <<= 32; + r |= *(p++); + s--; + } + + *cellp = p; + return r; +} + +/* + * Very dumb function for adding to the memory reserve list, but + * we don't need anything smarter at this point + * + * XXX Eventually check for collisions. They should NEVER happen + * if problems seem to show up, it would be a good start to track + * them down. + */ +static void reserve_mem(unsigned long base, unsigned long size) +{ + unsigned long offset = reloc_offset(); + unsigned long top = base + size; + unsigned long cnt = RELOC(mem_reserve_cnt); + + if (size == 0) + return; + + /* We need to always keep one empty entry so that we + * have our terminator with "size" set to 0 since we are + * dumb and just copy this entire array to the boot params + */ + base = _ALIGN_DOWN(base, PAGE_SIZE); + top = _ALIGN_UP(top, PAGE_SIZE); + size = top - base; + + if (cnt >= (MEM_RESERVE_MAP_SIZE - 1)) + prom_panic("Memory reserve map exhausted !\n"); + RELOC(mem_reserve_map)[cnt].base = base; + RELOC(mem_reserve_map)[cnt].size = size; + RELOC(mem_reserve_cnt) = cnt + 1; +} + +/* + * Initialize memory allocation mecanism, parse "memory" nodes and + * obtain that way the top of memory and RMO to setup out local allocator + */ +static void __init prom_init_mem(void) +{ + phandle node; + char *path, type[64]; + unsigned int plen; + cell_t *p, *endp; + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + + /* + * We iterate the memory nodes to find + * 1) top of RMO (first node) + * 2) top of memory + */ + prom_debug("root_addr_cells: %x\n", (long)_prom->root_addr_cells); + prom_debug("root_size_cells: %x\n", (long)_prom->root_size_cells); + + prom_debug("scanning memory:\n"); + path = RELOC(prom_scratch); + + for (node = 0; prom_next_node(&node); ) { + type[0] = 0; + prom_getprop(node, "device_type", type, sizeof(type)); + + if (strcmp(type, RELOC("memory"))) + continue; + + plen = prom_getprop(node, "reg", RELOC(regbuf), sizeof(regbuf)); + if (plen > sizeof(regbuf)) { + prom_printf("memory node too large for buffer !\n"); + plen = sizeof(regbuf); + } + p = RELOC(regbuf); + endp = p + (plen / sizeof(cell_t)); + +#ifdef DEBUG_PROM + memset(path, 0, PROM_SCRATCH_SIZE); + call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1); + prom_debug(" node %s :\n", path); +#endif /* DEBUG_PROM */ + + while ((endp - p) >= (_prom->root_addr_cells + _prom->root_size_cells)) { + unsigned long base, size; + + base = prom_next_cell(_prom->root_addr_cells, &p); + size = prom_next_cell(_prom->root_size_cells, &p); + + if (size == 0) + continue; + prom_debug(" %x %x\n", base, size); + if (base == 0) + RELOC(rmo_top) = size; + if ((base + size) > RELOC(ram_top)) + RELOC(ram_top) = base + size; + } + } + + RELOC(alloc_bottom) = PAGE_ALIGN(RELOC(klimit) - offset + 0x4000); + + /* Check if we have an initrd after the kernel, if we do move our bottom + * point to after it + */ + if (RELOC(prom_initrd_start)) { + if (RELOC(prom_initrd_end) > RELOC(alloc_bottom)) + RELOC(alloc_bottom) = PAGE_ALIGN(RELOC(prom_initrd_end)); + } + + /* + * If prom_memory_limit is set we reduce the upper limits *except* for + * alloc_top_high. This must be the real top of RAM so we can put + * TCE's up there. + */ + + RELOC(alloc_top_high) = RELOC(ram_top); + + if (RELOC(prom_memory_limit)) { + if (RELOC(prom_memory_limit) <= RELOC(alloc_bottom)) { + prom_printf("Ignoring mem=%x <= alloc_bottom.\n", + RELOC(prom_memory_limit)); + RELOC(prom_memory_limit) = 0; + } else if (RELOC(prom_memory_limit) >= RELOC(ram_top)) { + prom_printf("Ignoring mem=%x >= ram_top.\n", + RELOC(prom_memory_limit)); + RELOC(prom_memory_limit) = 0; + } else { + RELOC(ram_top) = RELOC(prom_memory_limit); + RELOC(rmo_top) = min(RELOC(rmo_top), RELOC(prom_memory_limit)); + } + } + + /* + * Setup our top alloc point, that is top of RMO or top of + * segment 0 when running non-LPAR. + */ + if ( RELOC(of_platform) == PLATFORM_PSERIES_LPAR ) + RELOC(alloc_top) = RELOC(rmo_top); + else + /* Some RS64 machines have buggy firmware where claims up at 1GB + * fails. Cap at 768MB as a workaround. Still plenty of room. + */ + RELOC(alloc_top) = RELOC(rmo_top) = min(0x30000000ul, RELOC(ram_top)); + + prom_printf("memory layout at init:\n"); + prom_printf(" memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit)); + prom_printf(" alloc_bottom : %x\n", RELOC(alloc_bottom)); + prom_printf(" alloc_top : %x\n", RELOC(alloc_top)); + prom_printf(" alloc_top_hi : %x\n", RELOC(alloc_top_high)); + prom_printf(" rmo_top : %x\n", RELOC(rmo_top)); + prom_printf(" ram_top : %x\n", RELOC(ram_top)); +} + + +/* + * Allocate room for and instanciate RTAS + */ +static void __init prom_instantiate_rtas(void) +{ + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + phandle rtas_node; + ihandle rtas_inst; + u32 base, entry = 0; + u32 size = 0; + + prom_debug("prom_instantiate_rtas: start...\n"); + + rtas_node = call_prom("finddevice", 1, 1, ADDR("/rtas")); + prom_debug("rtas_node: %x\n", rtas_node); + if (!PHANDLE_VALID(rtas_node)) + return; + + prom_getprop(rtas_node, "rtas-size", &size, sizeof(size)); + if (size == 0) + return; + + base = alloc_down(size, PAGE_SIZE, 0); + if (base == 0) { + prom_printf("RTAS allocation failed !\n"); + return; + } + + rtas_inst = call_prom("open", 1, 1, ADDR("/rtas")); + if (!IHANDLE_VALID(rtas_inst)) { + prom_printf("opening rtas package failed"); + return; + } + + prom_printf("instantiating rtas at 0x%x ...", base); + + if (call_prom("call-method", 3, 2, + ADDR("instantiate-rtas"), + rtas_inst, base) != PROM_ERROR) { + entry = (long)_prom->args.rets[1]; + } + if (entry == 0) { + prom_printf(" failed\n"); + return; + } + prom_printf(" done\n"); + + reserve_mem(base, size); + + prom_setprop(rtas_node, "linux,rtas-base", &base, sizeof(base)); + prom_setprop(rtas_node, "linux,rtas-entry", &entry, sizeof(entry)); + + prom_debug("rtas base = 0x%x\n", base); + prom_debug("rtas entry = 0x%x\n", entry); + prom_debug("rtas size = 0x%x\n", (long)size); + + prom_debug("prom_instantiate_rtas: end...\n"); +} + + +/* + * Allocate room for and initialize TCE tables + */ +static void __init prom_initialize_tce_table(void) +{ + phandle node; + ihandle phb_node; + unsigned long offset = reloc_offset(); + char compatible[64], type[64], model[64]; + char *path = RELOC(prom_scratch); + u64 base, align; + u32 minalign, minsize; + u64 tce_entry, *tce_entryp; + u64 local_alloc_top, local_alloc_bottom; + u64 i; + + if (RELOC(ppc64_iommu_off)) + return; + + prom_debug("starting prom_initialize_tce_table\n"); + + /* Cache current top of allocs so we reserve a single block */ + local_alloc_top = RELOC(alloc_top_high); + local_alloc_bottom = local_alloc_top; + + /* Search all nodes looking for PHBs. */ + for (node = 0; prom_next_node(&node); ) { + compatible[0] = 0; + type[0] = 0; + model[0] = 0; + prom_getprop(node, "compatible", + compatible, sizeof(compatible)); + prom_getprop(node, "device_type", type, sizeof(type)); + prom_getprop(node, "model", model, sizeof(model)); + + if ((type[0] == 0) || (strstr(type, RELOC("pci")) == NULL)) + continue; + + /* Keep the old logic in tack to avoid regression. */ + if (compatible[0] != 0) { + if ((strstr(compatible, RELOC("python")) == NULL) && + (strstr(compatible, RELOC("Speedwagon")) == NULL) && + (strstr(compatible, RELOC("Winnipeg")) == NULL)) + continue; + } else if (model[0] != 0) { + if ((strstr(model, RELOC("ython")) == NULL) && + (strstr(model, RELOC("peedwagon")) == NULL) && + (strstr(model, RELOC("innipeg")) == NULL)) + continue; + } + + if (prom_getprop(node, "tce-table-minalign", &minalign, + sizeof(minalign)) == PROM_ERROR) + minalign = 0; + if (prom_getprop(node, "tce-table-minsize", &minsize, + sizeof(minsize)) == PROM_ERROR) + minsize = 4UL << 20; + + /* + * Even though we read what OF wants, we just set the table + * size to 4 MB. This is enough to map 2GB of PCI DMA space. + * By doing this, we avoid the pitfalls of trying to DMA to + * MMIO space and the DMA alias hole. + * + * On POWER4, firmware sets the TCE region by assuming + * each TCE table is 8MB. Using this memory for anything + * else will impact performance, so we always allocate 8MB. + * Anton + */ + if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p)) + minsize = 8UL << 20; + else + minsize = 4UL << 20; + + /* Align to the greater of the align or size */ + align = max(minalign, minsize); + base = alloc_down(minsize, align, 1); + if (base == 0) + prom_panic("ERROR, cannot find space for TCE table.\n"); + if (base < local_alloc_bottom) + local_alloc_bottom = base; + + /* Save away the TCE table attributes for later use. */ + prom_setprop(node, "linux,tce-base", &base, sizeof(base)); + prom_setprop(node, "linux,tce-size", &minsize, sizeof(minsize)); + + /* It seems OF doesn't null-terminate the path :-( */ + memset(path, 0, sizeof(path)); + /* Call OF to setup the TCE hardware */ + if (call_prom("package-to-path", 3, 1, node, + path, PROM_SCRATCH_SIZE-1) == PROM_ERROR) { + prom_printf("package-to-path failed\n"); + } + + prom_debug("TCE table: %s\n", path); + prom_debug("\tnode = 0x%x\n", node); + prom_debug("\tbase = 0x%x\n", base); + prom_debug("\tsize = 0x%x\n", minsize); + + /* Initialize the table to have a one-to-one mapping + * over the allocated size. + */ + tce_entryp = (unsigned long *)base; + for (i = 0; i < (minsize >> 3) ;tce_entryp++, i++) { + tce_entry = (i << PAGE_SHIFT); + tce_entry |= 0x3; + *tce_entryp = tce_entry; + } + + prom_printf("opening PHB %s", path); + phb_node = call_prom("open", 1, 1, path); + if (phb_node == 0) + prom_printf("... failed\n"); + else + prom_printf("... done\n"); + + call_prom("call-method", 6, 0, ADDR("set-64-bit-addressing"), + phb_node, -1, minsize, + (u32) base, (u32) (base >> 32)); + call_prom("close", 1, 0, phb_node); + } + + reserve_mem(local_alloc_bottom, local_alloc_top - local_alloc_bottom); + + if (RELOC(prom_memory_limit)) { + /* + * We align the start to a 16MB boundary so we can map the TCE area + * using large pages if possible. The end should be the top of RAM + * so no need to align it. + */ + RELOC(prom_tce_alloc_start) = _ALIGN_DOWN(local_alloc_bottom, 0x1000000); + RELOC(prom_tce_alloc_end) = local_alloc_top; + } + + /* Flag the first invalid entry */ + prom_debug("ending prom_initialize_tce_table\n"); +} + +/* + * With CHRP SMP we need to use the OF to start the other + * processors so we can't wait until smp_boot_cpus (the OF is + * trashed by then) so we have to put the processors into + * a holding pattern controlled by the kernel (not OF) before + * we destroy the OF. + * + * This uses a chunk of low memory, puts some holding pattern + * code there and sends the other processors off to there until + * smp_boot_cpus tells them to do something. The holding pattern + * checks that address until its cpu # is there, when it is that + * cpu jumps to __secondary_start(). smp_boot_cpus() takes care + * of setting those values. + * + * We also use physical address 0x4 here to tell when a cpu + * is in its holding pattern code. + * + * Fixup comment... DRENG / PPPBBB - Peter + * + * -- Cort + */ +static void __init prom_hold_cpus(void) +{ + unsigned long i; + unsigned int reg; + phandle node; + unsigned long offset = reloc_offset(); + char type[64]; + int cpuid = 0; + unsigned int interrupt_server[MAX_CPU_THREADS]; + unsigned int cpu_threads, hw_cpu_num; + int propsize; + extern void __secondary_hold(void); + extern unsigned long __secondary_hold_spinloop; + extern unsigned long __secondary_hold_acknowledge; + unsigned long *spinloop + = (void *)virt_to_abs(&__secondary_hold_spinloop); + unsigned long *acknowledge + = (void *)virt_to_abs(&__secondary_hold_acknowledge); + unsigned long secondary_hold + = virt_to_abs(*PTRRELOC((unsigned long *)__secondary_hold)); + struct prom_t *_prom = PTRRELOC(&prom); + + prom_debug("prom_hold_cpus: start...\n"); + prom_debug(" 1) spinloop = 0x%x\n", (unsigned long)spinloop); + prom_debug(" 1) *spinloop = 0x%x\n", *spinloop); + prom_debug(" 1) acknowledge = 0x%x\n", + (unsigned long)acknowledge); + prom_debug(" 1) *acknowledge = 0x%x\n", *acknowledge); + prom_debug(" 1) secondary_hold = 0x%x\n", secondary_hold); + + /* Set the common spinloop variable, so all of the secondary cpus + * will block when they are awakened from their OF spinloop. + * This must occur for both SMP and non SMP kernels, since OF will + * be trashed when we move the kernel. + */ + *spinloop = 0; + +#ifdef CONFIG_HMT + for (i=0; i < NR_CPUS; i++) { + RELOC(hmt_thread_data)[i].pir = 0xdeadbeef; + } +#endif + /* look for cpus */ + for (node = 0; prom_next_node(&node); ) { + type[0] = 0; + prom_getprop(node, "device_type", type, sizeof(type)); + if (strcmp(type, RELOC("cpu")) != 0) + continue; + + /* Skip non-configured cpus. */ + if (prom_getprop(node, "status", type, sizeof(type)) > 0) + if (strcmp(type, RELOC("okay")) != 0) + continue; + + reg = -1; + prom_getprop(node, "reg", ®, sizeof(reg)); + + prom_debug("\ncpuid = 0x%x\n", cpuid); + prom_debug("cpu hw idx = 0x%x\n", reg); + + /* Init the acknowledge var which will be reset by + * the secondary cpu when it awakens from its OF + * spinloop. + */ + *acknowledge = (unsigned long)-1; + + propsize = prom_getprop(node, "ibm,ppc-interrupt-server#s", + &interrupt_server, + sizeof(interrupt_server)); + if (propsize < 0) { + /* no property. old hardware has no SMT */ + cpu_threads = 1; + interrupt_server[0] = reg; /* fake it with phys id */ + } else { + /* We have a threaded processor */ + cpu_threads = propsize / sizeof(u32); + if (cpu_threads > MAX_CPU_THREADS) { + prom_printf("SMT: too many threads!\n" + "SMT: found %x, max is %x\n", + cpu_threads, MAX_CPU_THREADS); + cpu_threads = 1; /* ToDo: panic? */ + } + } + + hw_cpu_num = interrupt_server[0]; + if (hw_cpu_num != _prom->cpu) { + /* Primary Thread of non-boot cpu */ + prom_printf("%x : starting cpu hw idx %x... ", cpuid, reg); + call_prom("start-cpu", 3, 0, node, + secondary_hold, reg); + + for ( i = 0 ; (i < 100000000) && + (*acknowledge == ((unsigned long)-1)); i++ ) + mb(); + + if (*acknowledge == reg) { + prom_printf("done\n"); + /* We have to get every CPU out of OF, + * even if we never start it. */ + if (cpuid >= NR_CPUS) + goto next; + } else { + prom_printf("failed: %x\n", *acknowledge); + } + } +#ifdef CONFIG_SMP + else + prom_printf("%x : boot cpu %x\n", cpuid, reg); +#endif +next: +#ifdef CONFIG_SMP + /* Init paca for secondary threads. They start later. */ + for (i=1; i < cpu_threads; i++) { + cpuid++; + if (cpuid >= NR_CPUS) + continue; + } +#endif /* CONFIG_SMP */ + cpuid++; + } +#ifdef CONFIG_HMT + /* Only enable HMT on processors that provide support. */ + if (__is_processor(PV_PULSAR) || + __is_processor(PV_ICESTAR) || + __is_processor(PV_SSTAR)) { + prom_printf(" starting secondary threads\n"); + + for (i = 0; i < NR_CPUS; i += 2) { + if (!cpu_online(i)) + continue; + + if (i == 0) { + unsigned long pir = mfspr(SPRN_PIR); + if (__is_processor(PV_PULSAR)) { + RELOC(hmt_thread_data)[i].pir = + pir & 0x1f; + } else { + RELOC(hmt_thread_data)[i].pir = + pir & 0x3ff; + } + } + } + } else { + prom_printf("Processor is not HMT capable\n"); + } +#endif + + if (cpuid > NR_CPUS) + prom_printf("WARNING: maximum CPUs (" __stringify(NR_CPUS) + ") exceeded: ignoring extras\n"); + + prom_debug("prom_hold_cpus: end...\n"); +} + + +static void __init prom_init_client_services(unsigned long pp) +{ + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + + /* Get a handle to the prom entry point before anything else */ + _prom->entry = pp; + + /* Init default value for phys size */ + _prom->root_size_cells = 1; + _prom->root_addr_cells = 2; + + /* get a handle for the stdout device */ + _prom->chosen = call_prom("finddevice", 1, 1, ADDR("/chosen")); + if (!PHANDLE_VALID(_prom->chosen)) + prom_panic("cannot find chosen"); /* msg won't be printed :( */ + + /* get device tree root */ + _prom->root = call_prom("finddevice", 1, 1, ADDR("/")); + if (!PHANDLE_VALID(_prom->root)) + prom_panic("cannot find device tree root"); /* msg won't be printed :( */ +} + +static void __init prom_init_stdout(void) +{ + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + char *path = RELOC(of_stdout_device); + char type[16]; + u32 val; + + if (prom_getprop(_prom->chosen, "stdout", &val, sizeof(val)) <= 0) + prom_panic("cannot find stdout"); + + _prom->stdout = val; + + /* Get the full OF pathname of the stdout device */ + memset(path, 0, 256); + call_prom("instance-to-path", 3, 1, _prom->stdout, path, 255); + val = call_prom("instance-to-package", 1, 1, _prom->stdout); + prom_setprop(_prom->chosen, "linux,stdout-package", &val, sizeof(val)); + prom_printf("OF stdout device is: %s\n", RELOC(of_stdout_device)); + prom_setprop(_prom->chosen, "linux,stdout-path", + RELOC(of_stdout_device), strlen(RELOC(of_stdout_device))+1); + + /* If it's a display, note it */ + memset(type, 0, sizeof(type)); + prom_getprop(val, "device_type", type, sizeof(type)); + if (strcmp(type, RELOC("display")) == 0) { + _prom->disp_node = val; + prom_setprop(val, "linux,boot-display", NULL, 0); + } +} + +static void __init prom_close_stdin(void) +{ + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + ihandle val; + + if (prom_getprop(_prom->chosen, "stdin", &val, sizeof(val)) > 0) + call_prom("close", 1, 0, val); +} + +static int __init prom_find_machine_type(void) +{ + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + char compat[256]; + int len, i = 0; + phandle rtas; + + len = prom_getprop(_prom->root, "compatible", + compat, sizeof(compat)-1); + if (len > 0) { + compat[len] = 0; + while (i < len) { + char *p = &compat[i]; + int sl = strlen(p); + if (sl == 0) + break; + if (strstr(p, RELOC("Power Macintosh")) || + strstr(p, RELOC("MacRISC4"))) + return PLATFORM_POWERMAC; + if (strstr(p, RELOC("Momentum,Maple"))) + return PLATFORM_MAPLE; + i += sl + 1; + } + } + /* Default to pSeries. We need to know if we are running LPAR */ + rtas = call_prom("finddevice", 1, 1, ADDR("/rtas")); + if (PHANDLE_VALID(rtas)) { + int x = prom_getproplen(rtas, "ibm,hypertas-functions"); + if (x != PROM_ERROR) { + prom_printf("Hypertas detected, assuming LPAR !\n"); + return PLATFORM_PSERIES_LPAR; + } + } + return PLATFORM_PSERIES; +} + +static int __init prom_set_color(ihandle ih, int i, int r, int g, int b) +{ + unsigned long offset = reloc_offset(); + + return call_prom("call-method", 6, 1, ADDR("color!"), ih, i, b, g, r); +} + +/* + * If we have a display that we don't know how to drive, + * we will want to try to execute OF's open method for it + * later. However, OF will probably fall over if we do that + * we've taken over the MMU. + * So we check whether we will need to open the display, + * and if so, open it now. + */ +static void __init prom_check_displays(void) +{ + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + char type[16], *path; + phandle node; + ihandle ih; + int i; + + static unsigned char default_colors[] = { + 0x00, 0x00, 0x00, + 0x00, 0x00, 0xaa, + 0x00, 0xaa, 0x00, + 0x00, 0xaa, 0xaa, + 0xaa, 0x00, 0x00, + 0xaa, 0x00, 0xaa, + 0xaa, 0xaa, 0x00, + 0xaa, 0xaa, 0xaa, + 0x55, 0x55, 0x55, + 0x55, 0x55, 0xff, + 0x55, 0xff, 0x55, + 0x55, 0xff, 0xff, + 0xff, 0x55, 0x55, + 0xff, 0x55, 0xff, + 0xff, 0xff, 0x55, + 0xff, 0xff, 0xff + }; + const unsigned char *clut; + + prom_printf("Looking for displays\n"); + for (node = 0; prom_next_node(&node); ) { + memset(type, 0, sizeof(type)); + prom_getprop(node, "device_type", type, sizeof(type)); + if (strcmp(type, RELOC("display")) != 0) + continue; + + /* It seems OF doesn't null-terminate the path :-( */ + path = RELOC(prom_scratch); + memset(path, 0, PROM_SCRATCH_SIZE); + + /* + * leave some room at the end of the path for appending extra + * arguments + */ + if (call_prom("package-to-path", 3, 1, node, path, + PROM_SCRATCH_SIZE-10) == PROM_ERROR) + continue; + prom_printf("found display : %s, opening ... ", path); + + ih = call_prom("open", 1, 1, path); + if (ih == 0) { + prom_printf("failed\n"); + continue; + } + + /* Success */ + prom_printf("done\n"); + prom_setprop(node, "linux,opened", NULL, 0); + + /* + * stdout wasn't a display node, pick the first we can find + * for btext + */ + if (_prom->disp_node == 0) + _prom->disp_node = node; + + /* Setup a useable color table when the appropriate + * method is available. Should update this to set-colors */ + clut = RELOC(default_colors); + for (i = 0; i < 32; i++, clut += 3) + if (prom_set_color(ih, i, clut[0], clut[1], + clut[2]) != 0) + break; + +#ifdef CONFIG_LOGO_LINUX_CLUT224 + clut = PTRRELOC(RELOC(logo_linux_clut224.clut)); + for (i = 0; i < RELOC(logo_linux_clut224.clutsize); i++, clut += 3) + if (prom_set_color(ih, i + 32, clut[0], clut[1], + clut[2]) != 0) + break; +#endif /* CONFIG_LOGO_LINUX_CLUT224 */ + } +} + + +/* Return (relocated) pointer to this much memory: moves initrd if reqd. */ +static void __init *make_room(unsigned long *mem_start, unsigned long *mem_end, + unsigned long needed, unsigned long align) +{ + unsigned long offset = reloc_offset(); + void *ret; + + *mem_start = _ALIGN(*mem_start, align); + while ((*mem_start + needed) > *mem_end) { + unsigned long room, chunk; + + prom_debug("Chunk exhausted, claiming more at %x...\n", + RELOC(alloc_bottom)); + room = RELOC(alloc_top) - RELOC(alloc_bottom); + if (room > DEVTREE_CHUNK_SIZE) + room = DEVTREE_CHUNK_SIZE; + if (room < PAGE_SIZE) + prom_panic("No memory for flatten_device_tree (no room)"); + chunk = alloc_up(room, 0); + if (chunk == 0) + prom_panic("No memory for flatten_device_tree (claim failed)"); + *mem_end = RELOC(alloc_top); + } + + ret = (void *)*mem_start; + *mem_start += needed; + + return ret; +} + +#define dt_push_token(token, mem_start, mem_end) \ + do { *((u32 *)make_room(mem_start, mem_end, 4, 4)) = token; } while(0) + +static unsigned long __init dt_find_string(char *str) +{ + unsigned long offset = reloc_offset(); + char *s, *os; + + s = os = (char *)RELOC(dt_string_start); + s += 4; + while (s < (char *)RELOC(dt_string_end)) { + if (strcmp(s, str) == 0) + return s - os; + s += strlen(s) + 1; + } + return 0; +} + +/* + * The Open Firmware 1275 specification states properties must be 31 bytes or + * less, however not all firmwares obey this. Make it 64 bytes to be safe. + */ +#define MAX_PROPERTY_NAME 64 + +static void __init scan_dt_build_strings(phandle node, + unsigned long *mem_start, + unsigned long *mem_end) +{ + unsigned long offset = reloc_offset(); + char *prev_name, *namep, *sstart; + unsigned long soff; + phandle child; + + sstart = (char *)RELOC(dt_string_start); + + /* get and store all property names */ + prev_name = RELOC(""); + for (;;) { + /* 64 is max len of name including nul. */ + namep = make_room(mem_start, mem_end, MAX_PROPERTY_NAME, 1); + if (call_prom("nextprop", 3, 1, node, prev_name, namep) != 1) { + /* No more nodes: unwind alloc */ + *mem_start = (unsigned long)namep; + break; + } + + /* skip "name" */ + if (strcmp(namep, RELOC("name")) == 0) { + *mem_start = (unsigned long)namep; + prev_name = RELOC("name"); + continue; + } + /* get/create string entry */ + soff = dt_find_string(namep); + if (soff != 0) { + *mem_start = (unsigned long)namep; + namep = sstart + soff; + } else { + /* Trim off some if we can */ + *mem_start = (unsigned long)namep + strlen(namep) + 1; + RELOC(dt_string_end) = *mem_start; + } + prev_name = namep; + } + + /* do all our children */ + child = call_prom("child", 1, 1, node); + while (child != 0) { + scan_dt_build_strings(child, mem_start, mem_end); + child = call_prom("peer", 1, 1, child); + } +} + +static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, + unsigned long *mem_end) +{ + phandle child; + char *namep, *prev_name, *sstart, *p, *ep, *lp, *path; + unsigned long soff; + unsigned char *valp; + unsigned long offset = reloc_offset(); + static char pname[MAX_PROPERTY_NAME]; + int l; + + dt_push_token(OF_DT_BEGIN_NODE, mem_start, mem_end); + + /* get the node's full name */ + namep = (char *)*mem_start; + l = call_prom("package-to-path", 3, 1, node, + namep, *mem_end - *mem_start); + if (l >= 0) { + /* Didn't fit? Get more room. */ + if ((l+1) > (*mem_end - *mem_start)) { + namep = make_room(mem_start, mem_end, l+1, 1); + call_prom("package-to-path", 3, 1, node, namep, l); + } + namep[l] = '\0'; + + /* Fixup an Apple bug where they have bogus \0 chars in the + * middle of the path in some properties + */ + for (p = namep, ep = namep + l; p < ep; p++) + if (*p == '\0') { + memmove(p, p+1, ep - p); + ep--; l--; p--; + } + + /* now try to extract the unit name in that mess */ + for (p = namep, lp = NULL; *p; p++) + if (*p == '/') + lp = p + 1; + if (lp != NULL) + memmove(namep, lp, strlen(lp) + 1); + *mem_start = _ALIGN(((unsigned long) namep) + + strlen(namep) + 1, 4); + } + + /* get it again for debugging */ + path = RELOC(prom_scratch); + memset(path, 0, PROM_SCRATCH_SIZE); + call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1); + + /* get and store all properties */ + prev_name = RELOC(""); + sstart = (char *)RELOC(dt_string_start); + for (;;) { + if (call_prom("nextprop", 3, 1, node, prev_name, + RELOC(pname)) != 1) + break; + + /* skip "name" */ + if (strcmp(RELOC(pname), RELOC("name")) == 0) { + prev_name = RELOC("name"); + continue; + } + + /* find string offset */ + soff = dt_find_string(RELOC(pname)); + if (soff == 0) { + prom_printf("WARNING: Can't find string index for" + " <%s>, node %s\n", RELOC(pname), path); + break; + } + prev_name = sstart + soff; + + /* get length */ + l = call_prom("getproplen", 2, 1, node, RELOC(pname)); + + /* sanity checks */ + if (l == PROM_ERROR) + continue; + if (l > MAX_PROPERTY_LENGTH) { + prom_printf("WARNING: ignoring large property "); + /* It seems OF doesn't null-terminate the path :-( */ + prom_printf("[%s] ", path); + prom_printf("%s length 0x%x\n", RELOC(pname), l); + continue; + } + + /* push property head */ + dt_push_token(OF_DT_PROP, mem_start, mem_end); + dt_push_token(l, mem_start, mem_end); + dt_push_token(soff, mem_start, mem_end); + + /* push property content */ + valp = make_room(mem_start, mem_end, l, 4); + call_prom("getprop", 4, 1, node, RELOC(pname), valp, l); + *mem_start = _ALIGN(*mem_start, 4); + } + + /* Add a "linux,phandle" property. */ + soff = dt_find_string(RELOC("linux,phandle")); + if (soff == 0) + prom_printf("WARNING: Can't find string index for" + " node %s\n", path); + else { + dt_push_token(OF_DT_PROP, mem_start, mem_end); + dt_push_token(4, mem_start, mem_end); + dt_push_token(soff, mem_start, mem_end); + valp = make_room(mem_start, mem_end, 4, 4); + *(u32 *)valp = node; + } + + /* do all our children */ + child = call_prom("child", 1, 1, node); + while (child != 0) { + scan_dt_build_struct(child, mem_start, mem_end); + child = call_prom("peer", 1, 1, child); + } + + dt_push_token(OF_DT_END_NODE, mem_start, mem_end); +} + +static void __init flatten_device_tree(void) +{ + phandle root; + unsigned long offset = reloc_offset(); + unsigned long mem_start, mem_end, room; + struct boot_param_header *hdr; + struct prom_t *_prom = PTRRELOC(&prom); + char *namep; + u64 *rsvmap; + + /* + * Check how much room we have between alloc top & bottom (+/- a + * few pages), crop to 4Mb, as this is our "chuck" size + */ + room = RELOC(alloc_top) - RELOC(alloc_bottom) - 0x4000; + if (room > DEVTREE_CHUNK_SIZE) + room = DEVTREE_CHUNK_SIZE; + prom_debug("starting device tree allocs at %x\n", RELOC(alloc_bottom)); + + /* Now try to claim that */ + mem_start = (unsigned long)alloc_up(room, PAGE_SIZE); + if (mem_start == 0) + prom_panic("Can't allocate initial device-tree chunk\n"); + mem_end = RELOC(alloc_top); + + /* Get root of tree */ + root = call_prom("peer", 1, 1, (phandle)0); + if (root == (phandle)0) + prom_panic ("couldn't get device tree root\n"); + + /* Build header and make room for mem rsv map */ + mem_start = _ALIGN(mem_start, 4); + hdr = make_room(&mem_start, &mem_end, + sizeof(struct boot_param_header), 4); + RELOC(dt_header_start) = (unsigned long)hdr; + rsvmap = make_room(&mem_start, &mem_end, sizeof(mem_reserve_map), 8); + + /* Start of strings */ + mem_start = PAGE_ALIGN(mem_start); + RELOC(dt_string_start) = mem_start; + mem_start += 4; /* hole */ + + /* Add "linux,phandle" in there, we'll need it */ + namep = make_room(&mem_start, &mem_end, 16, 1); + strcpy(namep, RELOC("linux,phandle")); + mem_start = (unsigned long)namep + strlen(namep) + 1; + + /* Build string array */ + prom_printf("Building dt strings...\n"); + scan_dt_build_strings(root, &mem_start, &mem_end); + RELOC(dt_string_end) = mem_start; + + /* Build structure */ + mem_start = PAGE_ALIGN(mem_start); + RELOC(dt_struct_start) = mem_start; + prom_printf("Building dt structure...\n"); + scan_dt_build_struct(root, &mem_start, &mem_end); + dt_push_token(OF_DT_END, &mem_start, &mem_end); + RELOC(dt_struct_end) = PAGE_ALIGN(mem_start); + + /* Finish header */ + hdr->boot_cpuid_phys = _prom->cpu; + hdr->magic = OF_DT_HEADER; + hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start); + hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start); + hdr->off_dt_strings = RELOC(dt_string_start) - RELOC(dt_header_start); + hdr->dt_strings_size = RELOC(dt_string_end) - RELOC(dt_string_start); + hdr->off_mem_rsvmap = ((unsigned long)rsvmap) - RELOC(dt_header_start); + hdr->version = OF_DT_VERSION; + /* Version 16 is not backward compatible */ + hdr->last_comp_version = 0x10; + + /* Reserve the whole thing and copy the reserve map in, we + * also bump mem_reserve_cnt to cause further reservations to + * fail since it's too late. + */ + reserve_mem(RELOC(dt_header_start), hdr->totalsize); + memcpy(rsvmap, RELOC(mem_reserve_map), sizeof(mem_reserve_map)); + +#ifdef DEBUG_PROM + { + int i; + prom_printf("reserved memory map:\n"); + for (i = 0; i < RELOC(mem_reserve_cnt); i++) + prom_printf(" %x - %x\n", RELOC(mem_reserve_map)[i].base, + RELOC(mem_reserve_map)[i].size); + } +#endif + RELOC(mem_reserve_cnt) = MEM_RESERVE_MAP_SIZE; + + prom_printf("Device tree strings 0x%x -> 0x%x\n", + RELOC(dt_string_start), RELOC(dt_string_end)); + prom_printf("Device tree struct 0x%x -> 0x%x\n", + RELOC(dt_struct_start), RELOC(dt_struct_end)); + +} + + +static void __init fixup_device_tree(void) +{ + unsigned long offset = reloc_offset(); + phandle u3, i2c, mpic; + u32 u3_rev; + u32 interrupts[2]; + u32 parent; + + /* Some G5s have a missing interrupt definition, fix it up here */ + u3 = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000")); + if (!PHANDLE_VALID(u3)) + return; + i2c = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/i2c@f8001000")); + if (!PHANDLE_VALID(i2c)) + return; + mpic = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/mpic@f8040000")); + if (!PHANDLE_VALID(mpic)) + return; + + /* check if proper rev of u3 */ + if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) + == PROM_ERROR) + return; + if (u3_rev < 0x35 || u3_rev > 0x39) + return; + /* does it need fixup ? */ + if (prom_getproplen(i2c, "interrupts") > 0) + return; + + prom_printf("fixing up bogus interrupts for u3 i2c...\n"); + + /* interrupt on this revision of u3 is number 0 and level */ + interrupts[0] = 0; + interrupts[1] = 1; + prom_setprop(i2c, "interrupts", &interrupts, sizeof(interrupts)); + parent = (u32)mpic; + prom_setprop(i2c, "interrupt-parent", &parent, sizeof(parent)); +} + + +static void __init prom_find_boot_cpu(void) +{ + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + u32 getprop_rval; + ihandle prom_cpu; + phandle cpu_pkg; + + if (prom_getprop(_prom->chosen, "cpu", &prom_cpu, sizeof(prom_cpu)) <= 0) + prom_panic("cannot find boot cpu"); + + cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu); + + prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval)); + _prom->cpu = getprop_rval; + + prom_debug("Booting CPU hw index = 0x%x\n", _prom->cpu); +} + +static void __init prom_check_initrd(unsigned long r3, unsigned long r4) +{ +#ifdef CONFIG_BLK_DEV_INITRD + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + + if ( r3 && r4 && r4 != 0xdeadbeef) { + u64 val; + + RELOC(prom_initrd_start) = (r3 >= KERNELBASE) ? __pa(r3) : r3; + RELOC(prom_initrd_end) = RELOC(prom_initrd_start) + r4; + + val = (u64)RELOC(prom_initrd_start); + prom_setprop(_prom->chosen, "linux,initrd-start", &val, sizeof(val)); + val = (u64)RELOC(prom_initrd_end); + prom_setprop(_prom->chosen, "linux,initrd-end", &val, sizeof(val)); + + reserve_mem(RELOC(prom_initrd_start), + RELOC(prom_initrd_end) - RELOC(prom_initrd_start)); + + prom_debug("initrd_start=0x%x\n", RELOC(prom_initrd_start)); + prom_debug("initrd_end=0x%x\n", RELOC(prom_initrd_end)); + } +#endif /* CONFIG_BLK_DEV_INITRD */ +} + +/* + * We enter here early on, when the Open Firmware prom is still + * handling exceptions and the MMU hash table for us. + */ + +unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long pp, + unsigned long r6, unsigned long r7) +{ + unsigned long offset = reloc_offset(); + struct prom_t *_prom = PTRRELOC(&prom); + unsigned long phys = KERNELBASE - offset; + u32 getprop_rval; + + /* + * First zero the BSS + */ + memset(PTRRELOC(&__bss_start), 0, __bss_stop - __bss_start); + + /* + * Init interface to Open Firmware, get some node references, + * like /chosen + */ + prom_init_client_services(pp); + + /* + * Init prom stdout device + */ + prom_init_stdout(); + prom_debug("klimit=0x%x\n", RELOC(klimit)); + prom_debug("offset=0x%x\n", offset); + + /* + * Check for an initrd + */ + prom_check_initrd(r3, r4); + + /* + * Get default machine type. At this point, we do not differenciate + * between pSeries SMP and pSeries LPAR + */ + RELOC(of_platform) = prom_find_machine_type(); + getprop_rval = RELOC(of_platform); + prom_setprop(_prom->chosen, "linux,platform", + &getprop_rval, sizeof(getprop_rval)); + + /* + * On pSeries, inform the firmware about our capabilities + */ + if (RELOC(of_platform) == PLATFORM_PSERIES || + RELOC(of_platform) == PLATFORM_PSERIES_LPAR) + prom_send_capabilities(); + + /* + * On pSeries and Cell, copy the CPU hold code + */ + if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_CELL)) + copy_and_flush(0, KERNELBASE - offset, 0x100, 0); + + /* + * Get memory cells format + */ + getprop_rval = 1; + prom_getprop(_prom->root, "#size-cells", + &getprop_rval, sizeof(getprop_rval)); + _prom->root_size_cells = getprop_rval; + getprop_rval = 2; + prom_getprop(_prom->root, "#address-cells", + &getprop_rval, sizeof(getprop_rval)); + _prom->root_addr_cells = getprop_rval; + + /* + * Do early parsing of command line + */ + early_cmdline_parse(); + + /* + * Initialize memory management within prom_init + */ + prom_init_mem(); + + /* + * Determine which cpu is actually running right _now_ + */ + prom_find_boot_cpu(); + + /* + * Initialize display devices + */ + prom_check_displays(); + + /* + * Initialize IOMMU (TCE tables) on pSeries. Do that before anything else + * that uses the allocator, we need to make sure we get the top of memory + * available for us here... + */ + if (RELOC(of_platform) == PLATFORM_PSERIES) + prom_initialize_tce_table(); + + /* + * On non-powermacs, try to instantiate RTAS and puts all CPUs + * in spin-loops. PowerMacs don't have a working RTAS and use + * a different way to spin CPUs + */ + if (RELOC(of_platform) != PLATFORM_POWERMAC) { + prom_instantiate_rtas(); + prom_hold_cpus(); + } + + /* + * Fill in some infos for use by the kernel later on + */ + if (RELOC(ppc64_iommu_off)) + prom_setprop(_prom->chosen, "linux,iommu-off", NULL, 0); + + if (RELOC(iommu_force_on)) + prom_setprop(_prom->chosen, "linux,iommu-force-on", NULL, 0); + + if (RELOC(prom_memory_limit)) + prom_setprop(_prom->chosen, "linux,memory-limit", + PTRRELOC(&prom_memory_limit), sizeof(RELOC(prom_memory_limit))); + + if (RELOC(prom_tce_alloc_start)) { + prom_setprop(_prom->chosen, "linux,tce-alloc-start", + PTRRELOC(&prom_tce_alloc_start), sizeof(RELOC(prom_tce_alloc_start))); + prom_setprop(_prom->chosen, "linux,tce-alloc-end", + PTRRELOC(&prom_tce_alloc_end), sizeof(RELOC(prom_tce_alloc_end))); + } + + /* + * Fixup any known bugs in the device-tree + */ + fixup_device_tree(); + + /* + * Now finally create the flattened device-tree + */ + prom_printf("copying OF device tree ...\n"); + flatten_device_tree(); + + /* in case stdin is USB and still active on IBM machines... */ + prom_close_stdin(); + + /* + * Call OF "quiesce" method to shut down pending DMA's from + * devices etc... + */ + prom_printf("Calling quiesce ...\n"); + call_prom("quiesce", 0, 0); + + /* + * And finally, call the kernel passing it the flattened device + * tree and NULL as r5, thus triggering the new entry point which + * is common to us and kexec + */ + prom_printf("returning from prom_init\n"); + prom_debug("->dt_header_start=0x%x\n", RELOC(dt_header_start)); + prom_debug("->phys=0x%x\n", phys); + + __start(RELOC(dt_header_start), phys, 0); + + return 0; +} + diff --git a/trunk/arch/ppc64/kernel/rtc.c b/trunk/arch/ppc64/kernel/rtc.c new file mode 100644 index 000000000000..79e7ed2858dd --- /dev/null +++ b/trunk/arch/ppc64/kernel/rtc.c @@ -0,0 +1,358 @@ +/* + * Real Time Clock interface for PPC64. + * + * Based on rtc.c by Paul Gortmaker + * + * This driver allows use of the real time clock + * from user space. It exports the /dev/rtc + * interface supporting various ioctl() and also the + * /proc/driver/rtc pseudo-file for status information. + * + * Interface does not support RTC interrupts nor an alarm. + * + * 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. + * + * 1.0 Mike Corrigan: IBM iSeries rtc support + * 1.1 Dave Engebretsen: IBM pSeries rtc support + */ + +#define RTC_VERSION "1.1" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +/* + * We sponge a minor off of the misc major. No need slurping + * up another valuable major dev number for this. If you add + * an ioctl, make sure you don't conflict with SPARC's RTC + * ioctls. + */ + +static ssize_t rtc_read(struct file *file, char __user *buf, + size_t count, loff_t *ppos); + +static int rtc_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); + +static int rtc_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data); + +/* + * If this driver ever becomes modularised, it will be really nice + * to make the epoch retain its value across module reload... + */ + +static unsigned long epoch = 1900; /* year corresponding to 0x00 */ + +static const unsigned char days_in_mo[] = +{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + +/* + * Now all the various file operations that we export. + */ + +static ssize_t rtc_read(struct file *file, char __user *buf, + size_t count, loff_t *ppos) +{ + return -EIO; +} + +static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) +{ + struct rtc_time wtime; + + switch (cmd) { + case RTC_RD_TIME: /* Read the time/date from RTC */ + { + memset(&wtime, 0, sizeof(struct rtc_time)); + ppc_md.get_rtc_time(&wtime); + break; + } + case RTC_SET_TIME: /* Set the RTC */ + { + struct rtc_time rtc_tm; + unsigned char mon, day, hrs, min, sec, leap_yr; + unsigned int yrs; + + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + if (copy_from_user(&rtc_tm, (struct rtc_time __user *)arg, + sizeof(struct rtc_time))) + return -EFAULT; + + yrs = rtc_tm.tm_year; + mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */ + day = rtc_tm.tm_mday; + hrs = rtc_tm.tm_hour; + min = rtc_tm.tm_min; + sec = rtc_tm.tm_sec; + + if (yrs < 70) + return -EINVAL; + + leap_yr = ((!(yrs % 4) && (yrs % 100)) || !(yrs % 400)); + + if ((mon > 12) || (day == 0)) + return -EINVAL; + + if (day > (days_in_mo[mon] + ((mon == 2) && leap_yr))) + return -EINVAL; + + if ((hrs >= 24) || (min >= 60) || (sec >= 60)) + return -EINVAL; + + if ( yrs > 169 ) + return -EINVAL; + + ppc_md.set_rtc_time(&rtc_tm); + + return 0; + } + case RTC_EPOCH_READ: /* Read the epoch. */ + { + return put_user (epoch, (unsigned long __user *)arg); + } + case RTC_EPOCH_SET: /* Set the epoch. */ + { + /* + * There were no RTC clocks before 1900. + */ + if (arg < 1900) + return -EINVAL; + + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + epoch = arg; + return 0; + } + default: + return -EINVAL; + } + return copy_to_user((void __user *)arg, &wtime, sizeof wtime) ? -EFAULT : 0; +} + +static int rtc_open(struct inode *inode, struct file *file) +{ + nonseekable_open(inode, file); + return 0; +} + +static int rtc_release(struct inode *inode, struct file *file) +{ + return 0; +} + +/* + * The various file operations we support. + */ +static struct file_operations rtc_fops = { + .owner = THIS_MODULE, + .llseek = no_llseek, + .read = rtc_read, + .ioctl = rtc_ioctl, + .open = rtc_open, + .release = rtc_release, +}; + +static struct miscdevice rtc_dev = { + .minor = RTC_MINOR, + .name = "rtc", + .fops = &rtc_fops +}; + +static int __init rtc_init(void) +{ + int retval; + + retval = misc_register(&rtc_dev); + if(retval < 0) + return retval; + +#ifdef CONFIG_PROC_FS + if (create_proc_read_entry("driver/rtc", 0, NULL, rtc_read_proc, NULL) + == NULL) { + misc_deregister(&rtc_dev); + return -ENOMEM; + } +#endif + + printk(KERN_INFO "i/pSeries Real Time Clock Driver v" RTC_VERSION "\n"); + + return 0; +} + +static void __exit rtc_exit (void) +{ + remove_proc_entry ("driver/rtc", NULL); + misc_deregister(&rtc_dev); +} + +module_init(rtc_init); +module_exit(rtc_exit); + +/* + * Info exported via "/proc/driver/rtc". + */ + +static int rtc_proc_output (char *buf) +{ + + char *p; + struct rtc_time tm; + + p = buf; + + ppc_md.get_rtc_time(&tm); + + /* + * There is no way to tell if the luser has the RTC set for local + * time or for Universal Standard Time (GMT). Probably local though. + */ + p += sprintf(p, + "rtc_time\t: %02d:%02d:%02d\n" + "rtc_date\t: %04d-%02d-%02d\n" + "rtc_epoch\t: %04lu\n", + tm.tm_hour, tm.tm_min, tm.tm_sec, + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, epoch); + + p += sprintf(p, + "DST_enable\t: no\n" + "BCD\t\t: yes\n" + "24hr\t\t: yes\n" ); + + return p - buf; +} + +static int rtc_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = rtc_proc_output (page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + return len; +} + +#ifdef CONFIG_PPC_RTAS +#define MAX_RTC_WAIT 5000 /* 5 sec */ +#define RTAS_CLOCK_BUSY (-2) +unsigned long rtas_get_boot_time(void) +{ + int ret[8]; + int error, wait_time; + unsigned long max_wait_tb; + + max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; + do { + error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); + if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { + wait_time = rtas_extended_busy_delay_time(error); + /* This is boot time so we spin. */ + udelay(wait_time*1000); + error = RTAS_CLOCK_BUSY; + } + } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); + + if (error != 0 && printk_ratelimit()) { + printk(KERN_WARNING "error: reading the clock failed (%d)\n", + error); + return 0; + } + + return mktime(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]); +} + +/* NOTE: get_rtc_time will get an error if executed in interrupt context + * and if a delay is needed to read the clock. In this case we just + * silently return without updating rtc_tm. + */ +void rtas_get_rtc_time(struct rtc_time *rtc_tm) +{ + int ret[8]; + int error, wait_time; + unsigned long max_wait_tb; + + max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; + do { + error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); + if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { + if (in_interrupt() && printk_ratelimit()) { + printk(KERN_WARNING "error: reading clock would delay interrupt\n"); + return; /* delay not allowed */ + } + wait_time = rtas_extended_busy_delay_time(error); + msleep_interruptible(wait_time); + error = RTAS_CLOCK_BUSY; + } + } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); + + if (error != 0 && printk_ratelimit()) { + printk(KERN_WARNING "error: reading the clock failed (%d)\n", + error); + return; + } + + rtc_tm->tm_sec = ret[5]; + rtc_tm->tm_min = ret[4]; + rtc_tm->tm_hour = ret[3]; + rtc_tm->tm_mday = ret[2]; + rtc_tm->tm_mon = ret[1] - 1; + rtc_tm->tm_year = ret[0] - 1900; +} + +int rtas_set_rtc_time(struct rtc_time *tm) +{ + int error, wait_time; + unsigned long max_wait_tb; + + max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; + do { + error = rtas_call(rtas_token("set-time-of-day"), 7, 1, NULL, + tm->tm_year + 1900, tm->tm_mon + 1, + tm->tm_mday, tm->tm_hour, tm->tm_min, + tm->tm_sec, 0); + if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { + if (in_interrupt()) + return 1; /* probably decrementer */ + wait_time = rtas_extended_busy_delay_time(error); + msleep_interruptible(wait_time); + error = RTAS_CLOCK_BUSY; + } + } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); + + if (error != 0 && printk_ratelimit()) + printk(KERN_WARNING "error: setting the clock failed (%d)\n", + error); + + return 0; +} +#endif diff --git a/trunk/arch/ppc64/kernel/semaphore.c b/trunk/arch/ppc64/kernel/semaphore.c new file mode 100644 index 000000000000..a1c1db573e9c --- /dev/null +++ b/trunk/arch/ppc64/kernel/semaphore.c @@ -0,0 +1,136 @@ +/* + * + * + * PowerPC-specific semaphore code. + * + * Copyright (C) 1999 Cort Dougan + * + * 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. + * + * April 2001 - Reworked by Paul Mackerras + * to eliminate the SMP races in the old version between the updates + * of `count' and `waking'. Now we use negative `count' values to + * indicate that some process(es) are waiting for the semaphore. + */ + +#include +#include +#include + +#include +#include +#include + +/* + * Atomically update sem->count. + * This does the equivalent of the following: + * + * old_count = sem->count; + * tmp = MAX(old_count, 0) + incr; + * sem->count = tmp; + * return old_count; + */ +static inline int __sem_update_count(struct semaphore *sem, int incr) +{ + int old_count, tmp; + + __asm__ __volatile__("\n" +"1: lwarx %0,0,%3\n" +" srawi %1,%0,31\n" +" andc %1,%0,%1\n" +" add %1,%1,%4\n" +" stwcx. %1,0,%3\n" +" bne 1b" + : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count) + : "r" (&sem->count), "r" (incr), "m" (sem->count) + : "cc"); + + return old_count; +} + +void __up(struct semaphore *sem) +{ + /* + * Note that we incremented count in up() before we came here, + * but that was ineffective since the result was <= 0, and + * any negative value of count is equivalent to 0. + * This ends up setting count to 1, unless count is now > 0 + * (i.e. because some other cpu has called up() in the meantime), + * in which case we just increment count. + */ + __sem_update_count(sem, 1); + wake_up(&sem->wait); +} +EXPORT_SYMBOL(__up); + +/* + * Note that when we come in to __down or __down_interruptible, + * we have already decremented count, but that decrement was + * ineffective since the result was < 0, and any negative value + * of count is equivalent to 0. + * Thus it is only when we decrement count from some value > 0 + * that we have actually got the semaphore. + */ +void __sched __down(struct semaphore *sem) +{ + struct task_struct *tsk = current; + DECLARE_WAITQUEUE(wait, tsk); + + __set_task_state(tsk, TASK_UNINTERRUPTIBLE); + add_wait_queue_exclusive(&sem->wait, &wait); + + /* + * Try to get the semaphore. If the count is > 0, then we've + * got the semaphore; we decrement count and exit the loop. + * If the count is 0 or negative, we set it to -1, indicating + * that we are asleep, and then sleep. + */ + while (__sem_update_count(sem, -1) <= 0) { + schedule(); + set_task_state(tsk, TASK_UNINTERRUPTIBLE); + } + remove_wait_queue(&sem->wait, &wait); + __set_task_state(tsk, TASK_RUNNING); + + /* + * If there are any more sleepers, wake one of them up so + * that it can either get the semaphore, or set count to -1 + * indicating that there are still processes sleeping. + */ + wake_up(&sem->wait); +} +EXPORT_SYMBOL(__down); + +int __sched __down_interruptible(struct semaphore * sem) +{ + int retval = 0; + struct task_struct *tsk = current; + DECLARE_WAITQUEUE(wait, tsk); + + __set_task_state(tsk, TASK_INTERRUPTIBLE); + add_wait_queue_exclusive(&sem->wait, &wait); + + while (__sem_update_count(sem, -1) <= 0) { + if (signal_pending(current)) { + /* + * A signal is pending - give up trying. + * Set sem->count to 0 if it is negative, + * since we are no longer sleeping. + */ + __sem_update_count(sem, 0); + retval = -EINTR; + break; + } + schedule(); + set_task_state(tsk, TASK_INTERRUPTIBLE); + } + remove_wait_queue(&sem->wait, &wait); + __set_task_state(tsk, TASK_RUNNING); + + wake_up(&sem->wait); + return retval; +} +EXPORT_SYMBOL(__down_interruptible); diff --git a/trunk/arch/ppc64/kernel/vdso.c b/trunk/arch/ppc64/kernel/vdso.c new file mode 100644 index 000000000000..1bbacac44988 --- /dev/null +++ b/trunk/arch/ppc64/kernel/vdso.c @@ -0,0 +1,625 @@ +/* + * linux/arch/ppc64/kernel/vdso.c + * + * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp. + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#undef DEBUG + +#ifdef DEBUG +#define DBG(fmt...) printk(fmt) +#else +#define DBG(fmt...) +#endif + + +/* + * The vDSOs themselves are here + */ +extern char vdso64_start, vdso64_end; +extern char vdso32_start, vdso32_end; + +static void *vdso64_kbase = &vdso64_start; +static void *vdso32_kbase = &vdso32_start; + +unsigned int vdso64_pages; +unsigned int vdso32_pages; + +/* Signal trampolines user addresses */ + +unsigned long vdso64_rt_sigtramp; +unsigned long vdso32_sigtramp; +unsigned long vdso32_rt_sigtramp; + +/* Format of the patch table */ +struct vdso_patch_def +{ + u32 pvr_mask, pvr_value; + const char *gen_name; + const char *fix_name; +}; + +/* Table of functions to patch based on the CPU type/revision + * + * TODO: Improve by adding whole lists for each entry + */ +static struct vdso_patch_def vdso_patches[] = { + { + 0xffff0000, 0x003a0000, /* POWER5 */ + "__kernel_sync_dicache", "__kernel_sync_dicache_p5" + }, + { + 0xffff0000, 0x003b0000, /* POWER5 */ + "__kernel_sync_dicache", "__kernel_sync_dicache_p5" + }, +}; + +/* + * Some infos carried around for each of them during parsing at + * boot time. + */ +struct lib32_elfinfo +{ + Elf32_Ehdr *hdr; /* ptr to ELF */ + Elf32_Sym *dynsym; /* ptr to .dynsym section */ + unsigned long dynsymsize; /* size of .dynsym section */ + char *dynstr; /* ptr to .dynstr section */ + unsigned long text; /* offset of .text section in .so */ +}; + +struct lib64_elfinfo +{ + Elf64_Ehdr *hdr; + Elf64_Sym *dynsym; + unsigned long dynsymsize; + char *dynstr; + unsigned long text; +}; + + +#ifdef __DEBUG +static void dump_one_vdso_page(struct page *pg, struct page *upg) +{ + printk("kpg: %p (c:%d,f:%08lx)", __va(page_to_pfn(pg) << PAGE_SHIFT), + page_count(pg), + pg->flags); + if (upg/* && pg != upg*/) { + printk(" upg: %p (c:%d,f:%08lx)", __va(page_to_pfn(upg) << PAGE_SHIFT), + page_count(upg), + upg->flags); + } + printk("\n"); +} + +static void dump_vdso_pages(struct vm_area_struct * vma) +{ + int i; + + if (!vma || test_thread_flag(TIF_32BIT)) { + printk("vDSO32 @ %016lx:\n", (unsigned long)vdso32_kbase); + for (i=0; ivm_mm) ? + follow_page(vma->vm_mm, vma->vm_start + i*PAGE_SIZE, 0) + : NULL; + dump_one_vdso_page(pg, upg); + } + } + if (!vma || !test_thread_flag(TIF_32BIT)) { + printk("vDSO64 @ %016lx:\n", (unsigned long)vdso64_kbase); + for (i=0; ivm_mm) ? + follow_page(vma->vm_mm, vma->vm_start + i*PAGE_SIZE, 0) + : NULL; + dump_one_vdso_page(pg, upg); + } + } +} +#endif /* DEBUG */ + +/* + * Keep a dummy vma_close for now, it will prevent VMA merging. + */ +static void vdso_vma_close(struct vm_area_struct * vma) +{ +} + +/* + * Our nopage() function, maps in the actual vDSO kernel pages, they will + * be mapped read-only by do_no_page(), and eventually COW'ed, either + * right away for an initial write access, or by do_wp_page(). + */ +static struct page * vdso_vma_nopage(struct vm_area_struct * vma, + unsigned long address, int *type) +{ + unsigned long offset = address - vma->vm_start; + struct page *pg; + void *vbase = test_thread_flag(TIF_32BIT) ? vdso32_kbase : vdso64_kbase; + + DBG("vdso_vma_nopage(current: %s, address: %016lx, off: %lx)\n", + current->comm, address, offset); + + if (address < vma->vm_start || address > vma->vm_end) + return NOPAGE_SIGBUS; + + /* + * Last page is systemcfg. + */ + if ((vma->vm_end - address) <= PAGE_SIZE) + pg = virt_to_page(_systemcfg); + else + pg = virt_to_page(vbase + offset); + + get_page(pg); + DBG(" ->page count: %d\n", page_count(pg)); + + return pg; +} + +static struct vm_operations_struct vdso_vmops = { + .close = vdso_vma_close, + .nopage = vdso_vma_nopage, +}; + +/* + * This is called from binfmt_elf, we create the special vma for the + * vDSO and insert it into the mm struct tree + */ +int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack) +{ + struct mm_struct *mm = current->mm; + struct vm_area_struct *vma; + unsigned long vdso_pages; + unsigned long vdso_base; + + if (test_thread_flag(TIF_32BIT)) { + vdso_pages = vdso32_pages; + vdso_base = VDSO32_MBASE; + } else { + vdso_pages = vdso64_pages; + vdso_base = VDSO64_MBASE; + } + + current->thread.vdso_base = 0; + + /* vDSO has a problem and was disabled, just don't "enable" it for the + * process + */ + if (vdso_pages == 0) + return 0; + + vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); + if (vma == NULL) + return -ENOMEM; + + memset(vma, 0, sizeof(*vma)); + + /* + * pick a base address for the vDSO in process space. We try to put it + * at vdso_base which is the "natural" base for it, but we might fail + * and end up putting it elsewhere. + */ + vdso_base = get_unmapped_area(NULL, vdso_base, + vdso_pages << PAGE_SHIFT, 0, 0); + if (vdso_base & ~PAGE_MASK) { + kmem_cache_free(vm_area_cachep, vma); + return (int)vdso_base; + } + + current->thread.vdso_base = vdso_base; + + vma->vm_mm = mm; + vma->vm_start = current->thread.vdso_base; + + /* + * the VMA size is one page more than the vDSO since systemcfg + * is mapped in the last one + */ + vma->vm_end = vma->vm_start + ((vdso_pages + 1) << PAGE_SHIFT); + + /* + * our vma flags don't have VM_WRITE so by default, the process isn't allowed + * to write those pages. + * gdb can break that with ptrace interface, and thus trigger COW on those + * pages but it's then your responsibility to never do that on the "data" page + * of the vDSO or you'll stop getting kernel updates and your nice userland + * gettimeofday will be totally dead. It's fine to use that for setting + * breakpoints in the vDSO code pages though + */ + vma->vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC | VM_RESERVED; + vma->vm_flags |= mm->def_flags; + vma->vm_page_prot = protection_map[vma->vm_flags & 0x7]; + vma->vm_ops = &vdso_vmops; + + down_write(&mm->mmap_sem); + if (insert_vm_struct(mm, vma)) { + up_write(&mm->mmap_sem); + kmem_cache_free(vm_area_cachep, vma); + return -ENOMEM; + } + mm->total_vm += (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; + up_write(&mm->mmap_sem); + + return 0; +} + +static void * __init find_section32(Elf32_Ehdr *ehdr, const char *secname, + unsigned long *size) +{ + Elf32_Shdr *sechdrs; + unsigned int i; + char *secnames; + + /* Grab section headers and strings so we can tell who is who */ + sechdrs = (void *)ehdr + ehdr->e_shoff; + secnames = (void *)ehdr + sechdrs[ehdr->e_shstrndx].sh_offset; + + /* Find the section they want */ + for (i = 1; i < ehdr->e_shnum; i++) { + if (strcmp(secnames+sechdrs[i].sh_name, secname) == 0) { + if (size) + *size = sechdrs[i].sh_size; + return (void *)ehdr + sechdrs[i].sh_offset; + } + } + *size = 0; + return NULL; +} + +static void * __init find_section64(Elf64_Ehdr *ehdr, const char *secname, + unsigned long *size) +{ + Elf64_Shdr *sechdrs; + unsigned int i; + char *secnames; + + /* Grab section headers and strings so we can tell who is who */ + sechdrs = (void *)ehdr + ehdr->e_shoff; + secnames = (void *)ehdr + sechdrs[ehdr->e_shstrndx].sh_offset; + + /* Find the section they want */ + for (i = 1; i < ehdr->e_shnum; i++) { + if (strcmp(secnames+sechdrs[i].sh_name, secname) == 0) { + if (size) + *size = sechdrs[i].sh_size; + return (void *)ehdr + sechdrs[i].sh_offset; + } + } + if (size) + *size = 0; + return NULL; +} + +static Elf32_Sym * __init find_symbol32(struct lib32_elfinfo *lib, const char *symname) +{ + unsigned int i; + char name[32], *c; + + for (i = 0; i < (lib->dynsymsize / sizeof(Elf32_Sym)); i++) { + if (lib->dynsym[i].st_name == 0) + continue; + strlcpy(name, lib->dynstr + lib->dynsym[i].st_name, 32); + c = strchr(name, '@'); + if (c) + *c = 0; + if (strcmp(symname, name) == 0) + return &lib->dynsym[i]; + } + return NULL; +} + +static Elf64_Sym * __init find_symbol64(struct lib64_elfinfo *lib, const char *symname) +{ + unsigned int i; + char name[32], *c; + + for (i = 0; i < (lib->dynsymsize / sizeof(Elf64_Sym)); i++) { + if (lib->dynsym[i].st_name == 0) + continue; + strlcpy(name, lib->dynstr + lib->dynsym[i].st_name, 32); + c = strchr(name, '@'); + if (c) + *c = 0; + if (strcmp(symname, name) == 0) + return &lib->dynsym[i]; + } + return NULL; +} + +/* Note that we assume the section is .text and the symbol is relative to + * the library base + */ +static unsigned long __init find_function32(struct lib32_elfinfo *lib, const char *symname) +{ + Elf32_Sym *sym = find_symbol32(lib, symname); + + if (sym == NULL) { + printk(KERN_WARNING "vDSO32: function %s not found !\n", symname); + return 0; + } + return sym->st_value - VDSO32_LBASE; +} + +/* Note that we assume the section is .text and the symbol is relative to + * the library base + */ +static unsigned long __init find_function64(struct lib64_elfinfo *lib, const char *symname) +{ + Elf64_Sym *sym = find_symbol64(lib, symname); + + if (sym == NULL) { + printk(KERN_WARNING "vDSO64: function %s not found !\n", symname); + return 0; + } +#ifdef VDS64_HAS_DESCRIPTORS + return *((u64 *)(vdso64_kbase + sym->st_value - VDSO64_LBASE)) - VDSO64_LBASE; +#else + return sym->st_value - VDSO64_LBASE; +#endif +} + + +static __init int vdso_do_find_sections(struct lib32_elfinfo *v32, + struct lib64_elfinfo *v64) +{ + void *sect; + + /* + * Locate symbol tables & text section + */ + + v32->dynsym = find_section32(v32->hdr, ".dynsym", &v32->dynsymsize); + v32->dynstr = find_section32(v32->hdr, ".dynstr", NULL); + if (v32->dynsym == NULL || v32->dynstr == NULL) { + printk(KERN_ERR "vDSO32: a required symbol section was not found\n"); + return -1; + } + sect = find_section32(v32->hdr, ".text", NULL); + if (sect == NULL) { + printk(KERN_ERR "vDSO32: the .text section was not found\n"); + return -1; + } + v32->text = sect - vdso32_kbase; + + v64->dynsym = find_section64(v64->hdr, ".dynsym", &v64->dynsymsize); + v64->dynstr = find_section64(v64->hdr, ".dynstr", NULL); + if (v64->dynsym == NULL || v64->dynstr == NULL) { + printk(KERN_ERR "vDSO64: a required symbol section was not found\n"); + return -1; + } + sect = find_section64(v64->hdr, ".text", NULL); + if (sect == NULL) { + printk(KERN_ERR "vDSO64: the .text section was not found\n"); + return -1; + } + v64->text = sect - vdso64_kbase; + + return 0; +} + +static __init void vdso_setup_trampolines(struct lib32_elfinfo *v32, + struct lib64_elfinfo *v64) +{ + /* + * Find signal trampolines + */ + + vdso64_rt_sigtramp = find_function64(v64, "__kernel_sigtramp_rt64"); + vdso32_sigtramp = find_function32(v32, "__kernel_sigtramp32"); + vdso32_rt_sigtramp = find_function32(v32, "__kernel_sigtramp_rt32"); +} + +static __init int vdso_fixup_datapage(struct lib32_elfinfo *v32, + struct lib64_elfinfo *v64) +{ + Elf32_Sym *sym32; + Elf64_Sym *sym64; + + sym32 = find_symbol32(v32, "__kernel_datapage_offset"); + if (sym32 == NULL) { + printk(KERN_ERR "vDSO32: Can't find symbol __kernel_datapage_offset !\n"); + return -1; + } + *((int *)(vdso32_kbase + (sym32->st_value - VDSO32_LBASE))) = + (vdso32_pages << PAGE_SHIFT) - (sym32->st_value - VDSO32_LBASE); + + sym64 = find_symbol64(v64, "__kernel_datapage_offset"); + if (sym64 == NULL) { + printk(KERN_ERR "vDSO64: Can't find symbol __kernel_datapage_offset !\n"); + return -1; + } + *((int *)(vdso64_kbase + sym64->st_value - VDSO64_LBASE)) = + (vdso64_pages << PAGE_SHIFT) - (sym64->st_value - VDSO64_LBASE); + + return 0; +} + +static int vdso_do_func_patch32(struct lib32_elfinfo *v32, + struct lib64_elfinfo *v64, + const char *orig, const char *fix) +{ + Elf32_Sym *sym32_gen, *sym32_fix; + + sym32_gen = find_symbol32(v32, orig); + if (sym32_gen == NULL) { + printk(KERN_ERR "vDSO32: Can't find symbol %s !\n", orig); + return -1; + } + sym32_fix = find_symbol32(v32, fix); + if (sym32_fix == NULL) { + printk(KERN_ERR "vDSO32: Can't find symbol %s !\n", fix); + return -1; + } + sym32_gen->st_value = sym32_fix->st_value; + sym32_gen->st_size = sym32_fix->st_size; + sym32_gen->st_info = sym32_fix->st_info; + sym32_gen->st_other = sym32_fix->st_other; + sym32_gen->st_shndx = sym32_fix->st_shndx; + + return 0; +} + +static int vdso_do_func_patch64(struct lib32_elfinfo *v32, + struct lib64_elfinfo *v64, + const char *orig, const char *fix) +{ + Elf64_Sym *sym64_gen, *sym64_fix; + + sym64_gen = find_symbol64(v64, orig); + if (sym64_gen == NULL) { + printk(KERN_ERR "vDSO64: Can't find symbol %s !\n", orig); + return -1; + } + sym64_fix = find_symbol64(v64, fix); + if (sym64_fix == NULL) { + printk(KERN_ERR "vDSO64: Can't find symbol %s !\n", fix); + return -1; + } + sym64_gen->st_value = sym64_fix->st_value; + sym64_gen->st_size = sym64_fix->st_size; + sym64_gen->st_info = sym64_fix->st_info; + sym64_gen->st_other = sym64_fix->st_other; + sym64_gen->st_shndx = sym64_fix->st_shndx; + + return 0; +} + +static __init int vdso_fixup_alt_funcs(struct lib32_elfinfo *v32, + struct lib64_elfinfo *v64) +{ + u32 pvr; + int i; + + pvr = mfspr(SPRN_PVR); + for (i = 0; i < ARRAY_SIZE(vdso_patches); i++) { + struct vdso_patch_def *patch = &vdso_patches[i]; + int match = (pvr & patch->pvr_mask) == patch->pvr_value; + + DBG("patch %d (mask: %x, pvr: %x) : %s\n", + i, patch->pvr_mask, patch->pvr_value, match ? "match" : "skip"); + + if (!match) + continue; + + DBG("replacing %s with %s...\n", patch->gen_name, patch->fix_name); + + /* + * Patch the 32 bits and 64 bits symbols. Note that we do not patch + * the "." symbol on 64 bits. It would be easy to do, but doesn't + * seem to be necessary, patching the OPD symbol is enough. + */ + vdso_do_func_patch32(v32, v64, patch->gen_name, patch->fix_name); + vdso_do_func_patch64(v32, v64, patch->gen_name, patch->fix_name); + } + + return 0; +} + + +static __init int vdso_setup(void) +{ + struct lib32_elfinfo v32; + struct lib64_elfinfo v64; + + v32.hdr = vdso32_kbase; + v64.hdr = vdso64_kbase; + + if (vdso_do_find_sections(&v32, &v64)) + return -1; + + if (vdso_fixup_datapage(&v32, &v64)) + return -1; + + if (vdso_fixup_alt_funcs(&v32, &v64)) + return -1; + + vdso_setup_trampolines(&v32, &v64); + + return 0; +} + +void __init vdso_init(void) +{ + int i; + + vdso64_pages = (&vdso64_end - &vdso64_start) >> PAGE_SHIFT; + vdso32_pages = (&vdso32_end - &vdso32_start) >> PAGE_SHIFT; + + DBG("vdso64_kbase: %p, 0x%x pages, vdso32_kbase: %p, 0x%x pages\n", + vdso64_kbase, vdso64_pages, vdso32_kbase, vdso32_pages); + + /* + * Initialize the vDSO images in memory, that is do necessary + * fixups of vDSO symbols, locate trampolines, etc... + */ + if (vdso_setup()) { + printk(KERN_ERR "vDSO setup failure, not enabled !\n"); + /* XXX should free pages here ? */ + vdso64_pages = vdso32_pages = 0; + return; + } + + /* Make sure pages are in the correct state */ + for (i = 0; i < vdso64_pages; i++) { + struct page *pg = virt_to_page(vdso64_kbase + i*PAGE_SIZE); + ClearPageReserved(pg); + get_page(pg); + } + for (i = 0; i < vdso32_pages; i++) { + struct page *pg = virt_to_page(vdso32_kbase + i*PAGE_SIZE); + ClearPageReserved(pg); + get_page(pg); + } + + get_page(virt_to_page(_systemcfg)); +} + +int in_gate_area_no_task(unsigned long addr) +{ + return 0; +} + +int in_gate_area(struct task_struct *task, unsigned long addr) +{ + return 0; +} + +struct vm_area_struct *get_gate_vma(struct task_struct *tsk) +{ + return NULL; +} + diff --git a/trunk/arch/ppc64/kernel/vmlinux.lds.S b/trunk/arch/ppc64/kernel/vmlinux.lds.S new file mode 100644 index 000000000000..022f220e772f --- /dev/null +++ b/trunk/arch/ppc64/kernel/vmlinux.lds.S @@ -0,0 +1,151 @@ +#include +#include + +OUTPUT_ARCH(powerpc:common64) +jiffies = jiffies_64; +SECTIONS +{ + /* Sections to be discarded. */ + /DISCARD/ : { + *(.exitcall.exit) + } + + + /* Read-only sections, merged into text segment: */ + .text : { + *(.text .text.*) + SCHED_TEXT + LOCK_TEXT + KPROBES_TEXT + *(.fixup) + . = ALIGN(PAGE_SIZE); + _etext = .; + } + + __ex_table : { + __start___ex_table = .; + *(__ex_table) + __stop___ex_table = .; + } + + __bug_table : { + __start___bug_table = .; + *(__bug_table) + __stop___bug_table = .; + } + + __ftr_fixup : { + __start___ftr_fixup = .; + *(__ftr_fixup) + __stop___ftr_fixup = .; + } + + RODATA + + + /* will be freed after init */ + . = ALIGN(PAGE_SIZE); + __init_begin = .; + + .init.text : { + _sinittext = .; + *(.init.text) + _einittext = .; + } + + .init.data : { + *(.init.data) + } + + . = ALIGN(16); + .init.setup : { + __setup_start = .; + *(.init.setup) + __setup_end = .; + } + + .initcall.init : { + __initcall_start = .; + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + __initcall_end = .; + } + + .con_initcall.init : { + __con_initcall_start = .; + *(.con_initcall.init) + __con_initcall_end = .; + } + + SECURITY_INIT + + . = ALIGN(PAGE_SIZE); + .init.ramfs : { + __initramfs_start = .; + *(.init.ramfs) + __initramfs_end = .; + } + + .data.percpu : { + __per_cpu_start = .; + *(.data.percpu) + __per_cpu_end = .; + } + + . = ALIGN(PAGE_SIZE); + . = ALIGN(16384); + __init_end = .; + /* freed after init ends here */ + + + /* Read/write sections */ + . = ALIGN(PAGE_SIZE); + . = ALIGN(16384); + _sdata = .; + /* The initial task and kernel stack */ + .data.init_task : { + *(.data.init_task) + } + + . = ALIGN(PAGE_SIZE); + .data.page_aligned : { + *(.data.page_aligned) + } + + .data.cacheline_aligned : { + *(.data.cacheline_aligned) + } + + .data : { + *(.data .data.rel* .toc1) + *(.branch_lt) + } + + .opd : { + *(.opd) + } + + .got : { + __toc_start = .; + *(.got) + *(.toc) + . = ALIGN(PAGE_SIZE); + _edata = .; + } + + + . = ALIGN(PAGE_SIZE); + .bss : { + __bss_start = .; + *(.bss) + __bss_stop = .; + } + + . = ALIGN(PAGE_SIZE); + _end = . ; +} diff --git a/trunk/arch/ppc64/xmon/privinst.h b/trunk/arch/ppc64/xmon/privinst.h new file mode 100644 index 000000000000..02eb40dac0b3 --- /dev/null +++ b/trunk/arch/ppc64/xmon/privinst.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 1996 Paul Mackerras. + * + * 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. + */ + +#define GETREG(reg) \ + static inline unsigned long get_ ## reg (void) \ + { unsigned long ret; asm volatile ("mf" #reg " %0" : "=r" (ret) :); return ret; } + +#define SETREG(reg) \ + static inline void set_ ## reg (unsigned long val) \ + { asm volatile ("mt" #reg " %0" : : "r" (val)); } + +GETREG(msr) +SETREG(msrd) +GETREG(cr) + +#define GSETSPR(n, name) \ + static inline long get_ ## name (void) \ + { long ret; asm volatile ("mfspr %0," #n : "=r" (ret) : ); return ret; } \ + static inline void set_ ## name (long val) \ + { asm volatile ("mtspr " #n ",%0" : : "r" (val)); } + +GSETSPR(0, mq) +GSETSPR(1, xer) +GSETSPR(4, rtcu) +GSETSPR(5, rtcl) +GSETSPR(8, lr) +GSETSPR(9, ctr) +GSETSPR(18, dsisr) +GSETSPR(19, dar) +GSETSPR(22, dec) +GSETSPR(25, sdr1) +GSETSPR(26, srr0) +GSETSPR(27, srr1) +GSETSPR(272, sprg0) +GSETSPR(273, sprg1) +GSETSPR(274, sprg2) +GSETSPR(275, sprg3) +GSETSPR(282, ear) +GSETSPR(287, pvr) +GSETSPR(1008, hid0) +GSETSPR(1009, hid1) +GSETSPR(1010, iabr) +GSETSPR(1023, pir) + +static inline void store_inst(void *p) +{ + asm volatile ("dcbst 0,%0; sync; icbi 0,%0; isync" : : "r" (p)); +} + +static inline void cflush(void *p) +{ + asm volatile ("dcbf 0,%0; icbi 0,%0" : : "r" (p)); +} + +static inline void cinval(void *p) +{ + asm volatile ("dcbi 0,%0; icbi 0,%0" : : "r" (p)); +} diff --git a/trunk/arch/sparc/Kconfig b/trunk/arch/sparc/Kconfig index 56c34e7fd4ee..3cfb8be3ff6d 100644 --- a/trunk/arch/sparc/Kconfig +++ b/trunk/arch/sparc/Kconfig @@ -55,10 +55,6 @@ config NR_CPUS depends on SMP default "32" -config SPARC - bool - default y - # Identify this as a Sparc32 build config SPARC32 bool diff --git a/trunk/arch/sparc/Makefile b/trunk/arch/sparc/Makefile index 4cdbb2d59ed0..dea48f6cff38 100644 --- a/trunk/arch/sparc/Makefile +++ b/trunk/arch/sparc/Makefile @@ -34,7 +34,7 @@ libs-y += arch/sparc/prom/ arch/sparc/lib/ # Renaming is done to avoid confusing pattern matching rules in 2.5.45 (multy-) INIT_Y := $(patsubst %/, %/built-in.o, $(init-y)) CORE_Y := $(core-y) -CORE_Y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ +CORE_Y += kernel/ mm/ fs/ ipc/ security/ crypto/ CORE_Y := $(patsubst %/, %/built-in.o, $(CORE_Y)) DRIVERS_Y := $(patsubst %/, %/built-in.o, $(drivers-y)) NET_Y := $(patsubst %/, %/built-in.o, $(net-y)) diff --git a/trunk/arch/sparc/kernel/ebus.c b/trunk/arch/sparc/kernel/ebus.c index 5c3529ceb5d6..1754192c69d0 100644 --- a/trunk/arch/sparc/kernel/ebus.c +++ b/trunk/arch/sparc/kernel/ebus.c @@ -22,7 +22,7 @@ #include #include -struct linux_ebus *ebus_chain = NULL; +struct linux_ebus *ebus_chain = 0; /* We are together with pcic.c under CONFIG_PCI. */ extern unsigned int pcic_pin_to_irq(unsigned int, char *name); @@ -46,7 +46,7 @@ static struct ebus_device_irq je1_1[] = { { "SUNW,CS4231", 0 }, { "parallel", 0 }, { "se", 2 }, - { NULL, 0 } + { 0, 0 } }; /* @@ -55,7 +55,7 @@ static struct ebus_device_irq je1_1[] = { */ static struct ebus_system_entry ebus_blacklist[] = { { "SUNW,JavaEngine1", je1_1 }, - { NULL, NULL } + { 0, 0 } }; static struct ebus_device_irq *ebus_blackp = NULL; @@ -233,7 +233,7 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev) ebus_alloc(sizeof(struct linux_ebus_child)); child = dev->children; - child->next = NULL; + child->next = 0; child->parent = dev; child->bus = dev->bus; fill_ebus_child(node, ®s[0], child); @@ -243,7 +243,7 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev) ebus_alloc(sizeof(struct linux_ebus_child)); child = child->next; - child->next = NULL; + child->next = 0; child->parent = dev; child->bus = dev->bus; fill_ebus_child(node, ®s[0], child); @@ -275,7 +275,7 @@ void __init ebus_init(void) } } - pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, NULL); + pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, 0); if (!pdev) { return; } @@ -284,7 +284,7 @@ void __init ebus_init(void) ebus_chain = ebus = (struct linux_ebus *) ebus_alloc(sizeof(struct linux_ebus)); - ebus->next = NULL; + ebus->next = 0; while (ebusnd) { @@ -325,8 +325,8 @@ void __init ebus_init(void) ebus_alloc(sizeof(struct linux_ebus_device)); dev = ebus->devices; - dev->next = NULL; - dev->children = NULL; + dev->next = 0; + dev->children = 0; dev->bus = ebus; fill_ebus_device(nd, dev); @@ -335,8 +335,8 @@ void __init ebus_init(void) ebus_alloc(sizeof(struct linux_ebus_device)); dev = dev->next; - dev->next = NULL; - dev->children = NULL; + dev->next = 0; + dev->children = 0; dev->bus = ebus; fill_ebus_device(nd, dev); } @@ -353,7 +353,7 @@ void __init ebus_init(void) ebus->next = (struct linux_ebus *) ebus_alloc(sizeof(struct linux_ebus)); ebus = ebus->next; - ebus->next = NULL; + ebus->next = 0; ++num_ebus; } if (pdev) diff --git a/trunk/arch/sparc/kernel/ioport.c b/trunk/arch/sparc/kernel/ioport.c index d39c9f206271..d0f2bd227c4c 100644 --- a/trunk/arch/sparc/kernel/ioport.c +++ b/trunk/arch/sparc/kernel/ioport.c @@ -252,7 +252,7 @@ void *sbus_alloc_consistent(struct sbus_dev *sdev, long len, u32 *dma_addrp) } order = get_order(len_total); - if ((va = __get_free_pages(GFP_KERNEL|__GFP_COMP, order)) == 0) + if ((va = __get_free_pages(GFP_KERNEL, order)) == 0) goto err_nopages; if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) diff --git a/trunk/arch/sparc/kernel/led.c b/trunk/arch/sparc/kernel/led.c index 313d1620ae8e..2a3afca453c9 100644 --- a/trunk/arch/sparc/kernel/led.c +++ b/trunk/arch/sparc/kernel/led.c @@ -55,7 +55,7 @@ static int led_read_proc(char *buf, char **start, off_t offset, int count, return len; } -static int led_write_proc(struct file *file, const char __user *buffer, +static int led_write_proc(struct file *file, const char *buffer, unsigned long count, void *data) { char *buf = NULL; diff --git a/trunk/arch/sparc/kernel/pcic.c b/trunk/arch/sparc/kernel/pcic.c index 42002b742deb..cccfc12802ed 100644 --- a/trunk/arch/sparc/kernel/pcic.c +++ b/trunk/arch/sparc/kernel/pcic.c @@ -161,7 +161,7 @@ static struct pcic_sn2list pcic_known_sysnames[] = { static int pcic0_up; static struct linux_pcic pcic0; -void __iomem *pcic_regs; +void * __iomem pcic_regs; volatile int pcic_speculative; volatile int pcic_trapped; diff --git a/trunk/arch/sparc/kernel/sys_sunos.c b/trunk/arch/sparc/kernel/sys_sunos.c index d07ae02101ad..81c894acd0db 100644 --- a/trunk/arch/sparc/kernel/sys_sunos.c +++ b/trunk/arch/sparc/kernel/sys_sunos.c @@ -894,7 +894,7 @@ asmlinkage long sunos_sysconf (int name) ret = ARG_MAX; break; case _SC_CHILD_MAX: - ret = -1; /* no limit */ + ret = CHILD_MAX; break; case _SC_CLK_TCK: ret = HZ; diff --git a/trunk/arch/sparc/kernel/time.c b/trunk/arch/sparc/kernel/time.c index 7dadcdb4ca42..24814d58f9e1 100644 --- a/trunk/arch/sparc/kernel/time.c +++ b/trunk/arch/sparc/kernel/time.c @@ -49,7 +49,7 @@ DEFINE_SPINLOCK(rtc_lock); enum sparc_clock_type sp_clock_typ; DEFINE_SPINLOCK(mostek_lock); void __iomem *mstk48t02_regs = NULL; -static struct mostek48t08 __iomem *mstk48t08_regs = NULL; +static struct mostek48t08 *mstk48t08_regs = NULL; static int set_rtc_mmss(unsigned long); static int sbus_do_settimeofday(struct timespec *tv); @@ -342,7 +342,7 @@ static __inline__ void clock_probe(void) /* XXX r/o attribute is somewhere in r.flags */ r.flags = clk_reg[0].which_io; r.start = clk_reg[0].phys_addr; - mstk48t08_regs = sbus_ioremap(&r, 0, + mstk48t08_regs = (struct mostek48t08 *) sbus_ioremap(&r, 0, sizeof(struct mostek48t08), "mk48t08"); mstk48t02_regs = &mstk48t08_regs->regs; diff --git a/trunk/arch/sparc/kernel/vmlinux.lds.S b/trunk/arch/sparc/kernel/vmlinux.lds.S index 346c19a949fd..38938d2e63aa 100644 --- a/trunk/arch/sparc/kernel/vmlinux.lds.S +++ b/trunk/arch/sparc/kernel/vmlinux.lds.S @@ -85,9 +85,19 @@ SECTIONS } _end = . ; PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug 0 : { *(.debug) } + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_sfnames 0 : { *(.debug_sfnames) } + .line 0 : { *(.line) } /DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) } - - STABS_DEBUG - - DWARF_DEBUG } diff --git a/trunk/arch/sparc/lib/atomic32.c b/trunk/arch/sparc/lib/atomic32.c index de84f8534bac..2e64e8c3e8e5 100644 --- a/trunk/arch/sparc/lib/atomic32.c +++ b/trunk/arch/sparc/lib/atomic32.c @@ -37,42 +37,17 @@ int __atomic_add_return(int i, atomic_t *v) spin_unlock_irqrestore(ATOMIC_HASH(v), flags); return ret; } -EXPORT_SYMBOL(__atomic_add_return); -int atomic_cmpxchg(atomic_t *v, int old, int new) +void atomic_set(atomic_t *v, int i) { - int ret; unsigned long flags; - spin_lock_irqsave(ATOMIC_HASH(v), flags); - ret = v->counter; - if (likely(ret == old)) - v->counter = new; - - spin_unlock_irqrestore(ATOMIC_HASH(v), flags); - return ret; -} -int atomic_add_unless(atomic_t *v, int a, int u) -{ - int ret; - unsigned long flags; + v->counter = i; - spin_lock_irqsave(ATOMIC_HASH(v), flags); - ret = v->counter; - if (ret != u) - v->counter += a; spin_unlock_irqrestore(ATOMIC_HASH(v), flags); - return ret != u; } -/* Atomic operations are already serializing */ -void atomic_set(atomic_t *v, int i) -{ - unsigned long flags; - - spin_lock_irqsave(ATOMIC_HASH(v), flags); - v->counter = i; - spin_unlock_irqrestore(ATOMIC_HASH(v), flags); -} +EXPORT_SYMBOL(__atomic_add_return); EXPORT_SYMBOL(atomic_set); + diff --git a/trunk/arch/sparc/lib/bitext.c b/trunk/arch/sparc/lib/bitext.c index 2e168d16547f..94b05e8c906c 100644 --- a/trunk/arch/sparc/lib/bitext.c +++ b/trunk/arch/sparc/lib/bitext.c @@ -10,7 +10,6 @@ */ #include -#include #include #include diff --git a/trunk/arch/sparc/mm/generic.c b/trunk/arch/sparc/mm/generic.c index 2cb0728cee05..9604893ffdbd 100644 --- a/trunk/arch/sparc/mm/generic.c +++ b/trunk/arch/sparc/mm/generic.c @@ -32,7 +32,9 @@ static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte, unsigne if (end > PMD_SIZE) end = PMD_SIZE; do { - set_pte_at(mm, address, pte, mk_pte_io(offset, prot, space)); + pte_t oldpage = *pte; + pte_clear(mm, address, pte); + set_pte(pte, mk_pte_io(offset, prot, space)); address += PAGE_SIZE; offset += PAGE_SIZE; pte++; @@ -61,7 +63,7 @@ static inline int io_remap_pmd_range(struct mm_struct *mm, pmd_t * pmd, unsigned } int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, - unsigned long pfn, unsigned long size, pgprot_t prot) + unsigned long pfn, unsigned long size, pgprot_t prot) { int error = 0; pgd_t * dir; @@ -72,9 +74,7 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT; /* See comment in mm/memory.c remap_pfn_range */ - vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; - vma->vm_pgoff = (offset >> PAGE_SHIFT) | - ((unsigned long)space << 28UL); + vma->vm_flags |= VM_IO | VM_RESERVED; prot = __pgprot(pg_iobits); offset -= from; diff --git a/trunk/arch/sparc/mm/sun4c.c b/trunk/arch/sparc/mm/sun4c.c index 731f19603cad..1d560390e282 100644 --- a/trunk/arch/sparc/mm/sun4c.c +++ b/trunk/arch/sparc/mm/sun4c.c @@ -497,7 +497,7 @@ static void __init sun4c_probe_mmu(void) patch_kernel_fault_handler(); } -volatile unsigned long __iomem *sun4c_memerr_reg = NULL; +volatile unsigned long *sun4c_memerr_reg = NULL; void __init sun4c_probe_memerr_reg(void) { diff --git a/trunk/arch/sparc64/Kconfig b/trunk/arch/sparc64/Kconfig index c4b7ad70cd7c..3fded69b1922 100644 --- a/trunk/arch/sparc64/Kconfig +++ b/trunk/arch/sparc64/Kconfig @@ -5,10 +5,6 @@ mainmenu "Linux/UltraSPARC Kernel Configuration" -config SPARC - bool - default y - config SPARC64 bool default y diff --git a/trunk/arch/sparc64/Makefile b/trunk/arch/sparc64/Makefile index cad10c5b83d3..43fe382da078 100644 --- a/trunk/arch/sparc64/Makefile +++ b/trunk/arch/sparc64/Makefile @@ -17,6 +17,7 @@ CC := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then NEW_GCC := $(call cc-option-yn, -m64 -mcmodel=medlow) NEW_GAS := $(shell if $(LD) -V 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi) UNDECLARED_REGS := $(shell if $(CC) -c -x assembler /dev/null -Wa,--help | grep undeclared-regs > /dev/null; then echo y; else echo n; fi; ) +INLINE_LIMIT := $(call cc-option-yn, -m64 -finline-limit=100000) export NEW_GCC @@ -48,6 +49,10 @@ else AFLAGS += -m64 -mcpu=ultrasparc $(CC_UNDECL) endif +ifeq ($(INLINE_LIMIT),y) + CFLAGS := $(CFLAGS) -finline-limit=100000 +endif + ifeq ($(CONFIG_MCOUNT),y) CFLAGS := $(CFLAGS) -pg endif diff --git a/trunk/arch/sparc64/kernel/kprobes.c b/trunk/arch/sparc64/kernel/kprobes.c index a97b0f0727ab..96bd09b098f4 100644 --- a/trunk/arch/sparc64/kernel/kprobes.c +++ b/trunk/arch/sparc64/kernel/kprobes.c @@ -138,7 +138,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) */ save_previous_kprobe(kcb); set_current_kprobe(p, regs, kcb); - kprobes_inc_nmissed_count(p); + p->nmissed++; kcb->kprobe_status = KPROBE_REENTER; prepare_singlestep(p, regs, kcb); return 1; diff --git a/trunk/arch/sparc64/kernel/sbus.c b/trunk/arch/sparc64/kernel/sbus.c index d95a1bcf163d..96b825055668 100644 --- a/trunk/arch/sparc64/kernel/sbus.c +++ b/trunk/arch/sparc64/kernel/sbus.c @@ -327,7 +327,7 @@ void *sbus_alloc_consistent(struct sbus_dev *sdev, size_t size, dma_addr_t *dvma order = get_order(size); if (order >= 10) return NULL; - first_page = __get_free_pages(GFP_KERNEL|__GFP_COMP, order); + first_page = __get_free_pages(GFP_KERNEL, order); if (first_page == 0UL) return NULL; memset((char *)first_page, 0, PAGE_SIZE << order); diff --git a/trunk/arch/sparc64/kernel/sys_sunos32.c b/trunk/arch/sparc64/kernel/sys_sunos32.c index bfa4aa68312d..d0592ed54ea5 100644 --- a/trunk/arch/sparc64/kernel/sys_sunos32.c +++ b/trunk/arch/sparc64/kernel/sys_sunos32.c @@ -854,7 +854,7 @@ asmlinkage s32 sunos_sysconf (int name) ret = ARG_MAX; break; case _SC_CHILD_MAX: - ret = -1; /* no limit */ + ret = CHILD_MAX; break; case _SC_CLK_TCK: ret = HZ; diff --git a/trunk/arch/sparc64/kernel/vmlinux.lds.S b/trunk/arch/sparc64/kernel/vmlinux.lds.S index 467d13a0d5c1..2af0cf0a8640 100644 --- a/trunk/arch/sparc64/kernel/vmlinux.lds.S +++ b/trunk/arch/sparc64/kernel/vmlinux.lds.S @@ -90,9 +90,19 @@ SECTIONS } _end = . ; PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug 0 : { *(.debug) } + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_sfnames 0 : { *(.debug_sfnames) } + .line 0 : { *(.line) } /DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) } - - STABS_DEBUG - - DWARF_DEBUG } diff --git a/trunk/arch/sparc64/mm/generic.c b/trunk/arch/sparc64/mm/generic.c index 580b63da836b..112c316e7cd2 100644 --- a/trunk/arch/sparc64/mm/generic.c +++ b/trunk/arch/sparc64/mm/generic.c @@ -15,15 +15,6 @@ #include #include -static inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space) -{ - pte_t pte; - pte_val(pte) = (((page) | pgprot_val(prot) | _PAGE_E) & - ~(unsigned long)_PAGE_CACHE); - pte_val(pte) |= (((unsigned long)space) << 32); - return pte; -} - /* Remap IO memory, the same way as remap_pfn_range(), but use * the obio memory space. * @@ -77,7 +68,6 @@ static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte, BUG_ON(!pte_none(*pte)); set_pte_at(mm, address, pte, entry); address += PAGE_SIZE; - pte_val(entry) += PAGE_SIZE; pte++; } while (address < curend); } while (address < end); @@ -136,13 +126,9 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, struct mm_struct *mm = vma->vm_mm; int space = GET_IOSPACE(pfn); unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT; - unsigned long phys_base; - - phys_base = offset | (((unsigned long) space) << 32UL); /* See comment in mm/memory.c remap_pfn_range */ - vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; - vma->vm_pgoff = phys_base >> PAGE_SHIFT; + vma->vm_flags |= VM_IO | VM_RESERVED; prot = __pgprot(pg_iobits); offset -= from; diff --git a/trunk/arch/sparc64/solaris/misc.c b/trunk/arch/sparc64/solaris/misc.c index 3ab4677395f2..302efbcba70e 100644 --- a/trunk/arch/sparc64/solaris/misc.c +++ b/trunk/arch/sparc64/solaris/misc.c @@ -353,7 +353,7 @@ asmlinkage int solaris_sysconf(int id) { switch (id) { case SOLARIS_CONFIG_NGROUPS: return NGROUPS_MAX; - case SOLARIS_CONFIG_CHILD_MAX: return -1; /* no limit */ + case SOLARIS_CONFIG_CHILD_MAX: return CHILD_MAX; case SOLARIS_CONFIG_OPEN_FILES: return OPEN_MAX; case SOLARIS_CONFIG_POSIX_VER: return 199309; case SOLARIS_CONFIG_PAGESIZE: return PAGE_SIZE; diff --git a/trunk/arch/um/Kconfig b/trunk/arch/um/Kconfig index 1eb21de9d1b5..3b5f47c46907 100644 --- a/trunk/arch/um/Kconfig +++ b/trunk/arch/um/Kconfig @@ -7,6 +7,7 @@ config UML bool default y +# XXX: does UM have a mmu/swap? config MMU bool default y @@ -35,6 +36,12 @@ config IRQ_RELEASE_METHOD bool default y +menu "Host processor type and features" + +source "arch/i386/Kconfig.cpu" + +endmenu + menu "UML-specific options" config MODE_TT @@ -202,8 +209,7 @@ config MAGIC_SYSRQ config SMP bool "Symmetric multi-processing support (EXPERIMENTAL)" default n - #SMP_BROKEN is for x86_64. - depends on MODE_TT && EXPERIMENTAL && (!SMP_BROKEN || (BROKEN && SMP_BROKEN)) + depends on (MODE_TT && EXPERIMENTAL && !SMP_BROKEN) || (BROKEN && SMP_BROKEN) help This option enables UML SMP support. It is NOT related to having a real SMP box. Not directly, at least. @@ -289,8 +295,6 @@ source "arch/um/Kconfig.net" source "drivers/net/Kconfig" -source "drivers/connector/Kconfig" - source "fs/Kconfig" source "security/Kconfig" diff --git a/trunk/arch/um/Kconfig.i386 b/trunk/arch/um/Kconfig.i386 index c71b39a677aa..5d92cacd56c6 100644 --- a/trunk/arch/um/Kconfig.i386 +++ b/trunk/arch/um/Kconfig.i386 @@ -1,9 +1,3 @@ -menu "Host processor type and features" - -source "arch/i386/Kconfig.cpu" - -endmenu - config UML_X86 bool default y @@ -48,3 +42,7 @@ config ARCH_HAS_SC_SIGNALS config ARCH_REUSE_HOST_VSYSCALL_AREA bool default y + +config X86_CMPXCHG + bool + default y diff --git a/trunk/arch/um/Makefile b/trunk/arch/um/Makefile index 1b12feeba368..e55d32e903bc 100644 --- a/trunk/arch/um/Makefile +++ b/trunk/arch/um/Makefile @@ -17,7 +17,7 @@ core-y += $(ARCH_DIR)/kernel/ \ # Have to precede the include because the included Makefiles reference them. SYMLINK_HEADERS := archparam.h system.h sigcontext.h processor.h ptrace.h \ - module.h vm-flags.h elf.h ldt.h + module.h vm-flags.h elf.h SYMLINK_HEADERS := $(foreach header,$(SYMLINK_HEADERS),include/asm-um/$(header)) # XXX: The "os" symlink is only used by arch/um/include/os.h, which includes diff --git a/trunk/arch/um/Makefile-i386 b/trunk/arch/um/Makefile-i386 index 7a0e04e34bf9..1f7dcb064aee 100644 --- a/trunk/arch/um/Makefile-i386 +++ b/trunk/arch/um/Makefile-i386 @@ -35,3 +35,4 @@ cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) CFLAGS += $(cflags-y) USER_CFLAGS += $(cflags-y) + diff --git a/trunk/arch/um/Makefile-x86_64 b/trunk/arch/um/Makefile-x86_64 index 38df311e75dc..4f118d5cc2ee 100644 --- a/trunk/arch/um/Makefile-x86_64 +++ b/trunk/arch/um/Makefile-x86_64 @@ -12,7 +12,3 @@ CHECKFLAGS += -m64 ELF_ARCH := i386:x86-64 ELF_FORMAT := elf64-x86-64 - -# Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example. - -LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64 diff --git a/trunk/arch/um/drivers/chan_kern.c b/trunk/arch/um/drivers/chan_kern.c index 5b58fad45290..16e7dc89f61d 100644 --- a/trunk/arch/um/drivers/chan_kern.c +++ b/trunk/arch/um/drivers/chan_kern.c @@ -89,7 +89,8 @@ static int not_configged_write(int fd, const char *buf, int len, void *data) return(-EIO); } -static int not_configged_console_write(int fd, const char *buf, int len) +static int not_configged_console_write(int fd, const char *buf, int len, + void *data) { my_puts("Using a channel type which is configured out of " "UML\n"); @@ -298,7 +299,7 @@ int console_write_chan(struct list_head *chans, const char *buf, int len) chan = list_entry(ele, struct chan, list); if(!chan->output || (chan->ops->console_write == NULL)) continue; - n = chan->ops->console_write(chan->fd, buf, len); + n = chan->ops->console_write(chan->fd, buf, len, chan->data); if(chan->primary) ret = n; } return(ret); diff --git a/trunk/arch/um/drivers/chan_user.c b/trunk/arch/um/drivers/chan_user.c index 5d50d4a44abf..1c55d5802489 100644 --- a/trunk/arch/um/drivers/chan_user.c +++ b/trunk/arch/um/drivers/chan_user.c @@ -20,7 +20,7 @@ #include "choose-mode.h" #include "mode.h" -int generic_console_write(int fd, const char *buf, int n) +int generic_console_write(int fd, const char *buf, int n, void *unused) { struct termios save, new; int err; diff --git a/trunk/arch/um/drivers/daemon_user.c b/trunk/arch/um/drivers/daemon_user.c index 1bb085b2824d..c1b03f7c1daa 100644 --- a/trunk/arch/um/drivers/daemon_user.c +++ b/trunk/arch/um/drivers/daemon_user.c @@ -98,7 +98,7 @@ static int connect_to_switch(struct daemon_data *pri) printk("daemon_open : control setup request failed, err = %d\n", -n); err = -ENOTCONN; - goto out_free; + goto out; } n = os_read_file(pri->control, sun, sizeof(*sun)); @@ -106,14 +106,12 @@ static int connect_to_switch(struct daemon_data *pri) printk("daemon_open : read of data socket failed, err = %d\n", -n); err = -ENOTCONN; - goto out_free; + goto out_close; } pri->data_addr = sun; return(fd); - out_free: - kfree(sun); out_close: os_close_file(fd); out: diff --git a/trunk/arch/um/drivers/fd.c b/trunk/arch/um/drivers/fd.c index 3296e86a03a5..f0b888f66e05 100644 --- a/trunk/arch/um/drivers/fd.c +++ b/trunk/arch/um/drivers/fd.c @@ -76,6 +76,13 @@ static void fd_close(int fd, void *d) } } +static int fd_console_write(int fd, const char *buf, int n, void *d) +{ + struct fd_chan *data = d; + + return(generic_console_write(fd, buf, n, &data->tt)); +} + struct chan_ops fd_ops = { .type = "fd", .init = fd_init, @@ -83,7 +90,7 @@ struct chan_ops fd_ops = { .close = fd_close, .read = generic_read, .write = generic_write, - .console_write = generic_console_write, + .console_write = fd_console_write, .window_size = generic_window_size, .free = generic_free, .winch = 1, diff --git a/trunk/arch/um/drivers/mcast_user.c b/trunk/arch/um/drivers/mcast_user.c index afe85bfa66e0..5db136e2651c 100644 --- a/trunk/arch/um/drivers/mcast_user.c +++ b/trunk/arch/um/drivers/mcast_user.c @@ -54,7 +54,7 @@ static int mcast_open(void *data) struct mcast_data *pri = data; struct sockaddr_in *sin = pri->mcast_addr; struct ip_mreq mreq; - int fd, yes = 1, err = -EINVAL; + int fd, yes = 1, err = 0; if ((sin->sin_addr.s_addr == 0) || (sin->sin_port == 0)) @@ -63,40 +63,40 @@ static int mcast_open(void *data) fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd < 0){ - err = -errno; printk("mcast_open : data socket failed, errno = %d\n", errno); + err = -errno; goto out; } if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) { - err = -errno; printk("mcast_open: SO_REUSEADDR failed, errno = %d\n", errno); + err = -errno; goto out_close; } /* set ttl according to config */ if (setsockopt(fd, SOL_IP, IP_MULTICAST_TTL, &pri->ttl, sizeof(pri->ttl)) < 0) { - err = -errno; printk("mcast_open: IP_MULTICAST_TTL failed, error = %d\n", errno); + err = -errno; goto out_close; } /* set LOOP, so data does get fed back to local sockets */ if (setsockopt(fd, SOL_IP, IP_MULTICAST_LOOP, &yes, sizeof(yes)) < 0) { - err = -errno; printk("mcast_open: IP_MULTICAST_LOOP failed, error = %d\n", errno); + err = -errno; goto out_close; } /* bind socket to mcast address */ if (bind(fd, (struct sockaddr *) sin, sizeof(*sin)) < 0) { - err = -errno; printk("mcast_open : data bind failed, errno = %d\n", errno); + err = -errno; goto out_close; } @@ -105,22 +105,22 @@ static int mcast_open(void *data) mreq.imr_interface.s_addr = 0; if (setsockopt(fd, SOL_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) { - err = -errno; printk("mcast_open: IP_ADD_MEMBERSHIP failed, error = %d\n", errno); printk("There appears not to be a multicast-capable network " "interface on the host.\n"); printk("eth0 should be configured in order to use the " "multicast transport.\n"); - goto out_close; + err = -errno; + goto out_close; } return fd; out_close: - os_close_file(fd); + os_close_file(fd); out: - return err; + return err; } static void mcast_close(int fd, void *data) diff --git a/trunk/arch/um/drivers/port_user.c b/trunk/arch/um/drivers/port_user.c index c43e8bb32502..ed4a1a6c5d83 100644 --- a/trunk/arch/um/drivers/port_user.c +++ b/trunk/arch/um/drivers/port_user.c @@ -100,6 +100,13 @@ static void port_close(int fd, void *d) os_close_file(fd); } +static int port_console_write(int fd, const char *buf, int n, void *d) +{ + struct port_chan *data = d; + + return(generic_console_write(fd, buf, n, &data->tt)); +} + struct chan_ops port_ops = { .type = "port", .init = port_init, @@ -107,7 +114,7 @@ struct chan_ops port_ops = { .close = port_close, .read = generic_read, .write = generic_write, - .console_write = generic_console_write, + .console_write = port_console_write, .window_size = generic_window_size, .free = port_free, .winch = 1, diff --git a/trunk/arch/um/drivers/pty.c b/trunk/arch/um/drivers/pty.c index 1c555c38de4d..0306a1b215b7 100644 --- a/trunk/arch/um/drivers/pty.c +++ b/trunk/arch/um/drivers/pty.c @@ -118,6 +118,13 @@ static int pty_open(int input, int output, int primary, void *d, return(fd); } +static int pty_console_write(int fd, const char *buf, int n, void *d) +{ + struct pty_chan *data = d; + + return(generic_console_write(fd, buf, n, &data->tt)); +} + struct chan_ops pty_ops = { .type = "pty", .init = pty_chan_init, @@ -125,7 +132,7 @@ struct chan_ops pty_ops = { .close = generic_close, .read = generic_read, .write = generic_write, - .console_write = generic_console_write, + .console_write = pty_console_write, .window_size = generic_window_size, .free = generic_free, .winch = 0, @@ -138,7 +145,7 @@ struct chan_ops pts_ops = { .close = generic_close, .read = generic_read, .write = generic_write, - .console_write = generic_console_write, + .console_write = pty_console_write, .window_size = generic_window_size, .free = generic_free, .winch = 0, diff --git a/trunk/arch/um/drivers/tty.c b/trunk/arch/um/drivers/tty.c index 94c9265a4f2c..6fbb670ee274 100644 --- a/trunk/arch/um/drivers/tty.c +++ b/trunk/arch/um/drivers/tty.c @@ -60,6 +60,13 @@ static int tty_open(int input, int output, int primary, void *d, return(fd); } +static int tty_console_write(int fd, const char *buf, int n, void *d) +{ + struct tty_chan *data = d; + + return(generic_console_write(fd, buf, n, &data->tt)); +} + struct chan_ops tty_ops = { .type = "tty", .init = tty_chan_init, @@ -67,7 +74,7 @@ struct chan_ops tty_ops = { .close = generic_close, .read = generic_read, .write = generic_write, - .console_write = generic_console_write, + .console_write = tty_console_write, .window_size = generic_window_size, .free = generic_free, .winch = 0, diff --git a/trunk/arch/um/drivers/xterm.c b/trunk/arch/um/drivers/xterm.c index aaa636661043..b530f1a6540d 100644 --- a/trunk/arch/um/drivers/xterm.c +++ b/trunk/arch/um/drivers/xterm.c @@ -194,6 +194,13 @@ static void xterm_free(void *d) free(d); } +static int xterm_console_write(int fd, const char *buf, int n, void *d) +{ + struct xterm_chan *data = d; + + return(generic_console_write(fd, buf, n, &data->tt)); +} + struct chan_ops xterm_ops = { .type = "xterm", .init = xterm_init, @@ -201,7 +208,7 @@ struct chan_ops xterm_ops = { .close = xterm_close, .read = generic_read, .write = generic_write, - .console_write = generic_console_write, + .console_write = xterm_console_write, .window_size = generic_window_size, .free = xterm_free, .winch = 1, diff --git a/trunk/arch/um/include/chan_user.h b/trunk/arch/um/include/chan_user.h index 659bb3cac32f..f77d9aa4c164 100644 --- a/trunk/arch/um/include/chan_user.h +++ b/trunk/arch/um/include/chan_user.h @@ -25,7 +25,7 @@ struct chan_ops { void (*close)(int, void *); int (*read)(int, char *, void *); int (*write)(int, const char *, int, void *); - int (*console_write)(int, const char *, int); + int (*console_write)(int, const char *, int, void *); int (*window_size)(int, void *, unsigned short *, unsigned short *); void (*free)(void *); int winch; @@ -37,7 +37,7 @@ extern struct chan_ops fd_ops, null_ops, port_ops, pts_ops, pty_ops, tty_ops, extern void generic_close(int fd, void *unused); extern int generic_read(int fd, char *c_out, void *unused); extern int generic_write(int fd, const char *buf, int n, void *unused); -extern int generic_console_write(int fd, const char *buf, int n); +extern int generic_console_write(int fd, const char *buf, int n, void *state); extern int generic_window_size(int fd, void *unused, unsigned short *rows_out, unsigned short *cols_out); extern void generic_free(void *data); diff --git a/trunk/arch/um/include/sysdep-i386/stub.h b/trunk/arch/um/include/sysdep-i386/stub.h index b492b12b4a10..a49ceb199ee5 100644 --- a/trunk/arch/um/include/sysdep-i386/stub.h +++ b/trunk/arch/um/include/sysdep-i386/stub.h @@ -6,12 +6,8 @@ #ifndef __SYSDEP_STUB_H #define __SYSDEP_STUB_H -#include #include #include -#include "stub-data.h" -#include "kern_constants.h" -#include "uml-config.h" extern void stub_segv_handler(int sig); extern void stub_clone_handler(void); @@ -20,15 +16,6 @@ extern void stub_clone_handler(void); #define STUB_MMAP_NR __NR_mmap2 #define MMAP_OFFSET(o) ((o) >> PAGE_SHIFT) -static inline long stub_syscall0(long syscall) -{ - long ret; - - __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall)); - - return ret; -} - static inline long stub_syscall1(long syscall, long arg1) { long ret; @@ -80,22 +67,23 @@ static inline long stub_syscall5(long syscall, long arg1, long arg2, long arg3, return ret; } -static inline void trap_myself(void) +static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, + long arg4, long arg5, long arg6) { - __asm("int3"); + long ret; + + __asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; movl %1,%%eax ; " + "int $0x80 ; pop %%ebp" + : "=a" (ret) + : "g" (syscall), "b" (arg1), "c" (arg2), "d" (arg3), + "S" (arg4), "D" (arg5), "0" (arg6)); + + return ret; } -static inline void remap_stack(int fd, unsigned long offset) +static inline void trap_myself(void) { - __asm__ volatile ("movl %%eax,%%ebp ; movl %0,%%eax ; int $0x80 ;" - "movl %7, %%ebx ; movl %%eax, (%%ebx)" - : : "g" (STUB_MMAP_NR), "b" (UML_CONFIG_STUB_DATA), - "c" (UM_KERN_PAGE_SIZE), - "d" (PROT_READ | PROT_WRITE), - "S" (MAP_FIXED | MAP_SHARED), "D" (fd), - "a" (offset), - "i" (&((struct stub_data *) UML_CONFIG_STUB_DATA)->err) - : "memory"); + __asm("int3"); } #endif diff --git a/trunk/arch/um/include/sysdep-x86_64/stub.h b/trunk/arch/um/include/sysdep-x86_64/stub.h index 92e989f81761..2bd6e7a97286 100644 --- a/trunk/arch/um/include/sysdep-x86_64/stub.h +++ b/trunk/arch/um/include/sysdep-x86_64/stub.h @@ -6,12 +6,9 @@ #ifndef __SYSDEP_STUB_H #define __SYSDEP_STUB_H -#include +#include #include #include -#include "stub-data.h" -#include "kern_constants.h" -#include "uml-config.h" extern void stub_segv_handler(int sig); extern void stub_clone_handler(void); @@ -23,17 +20,6 @@ extern void stub_clone_handler(void); #define __syscall_clobber "r11","rcx","memory" #define __syscall "syscall" -static inline long stub_syscall0(long syscall) -{ - long ret; - - __asm__ volatile (__syscall - : "=a" (ret) - : "0" (syscall) : __syscall_clobber ); - - return ret; -} - static inline long stub_syscall2(long syscall, long arg1, long arg2) { long ret; @@ -85,23 +71,23 @@ static inline long stub_syscall5(long syscall, long arg1, long arg2, long arg3, return ret; } -static inline void trap_myself(void) +static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, + long arg4, long arg5, long arg6) { - __asm("int3"); + long ret; + + __asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " + "movq %7, %%r9; " __syscall : "=a" (ret) + : "0" (syscall), "D" (arg1), "S" (arg2), "d" (arg3), + "g" (arg4), "g" (arg5), "g" (arg6) + : __syscall_clobber, "r10", "r8", "r9" ); + + return ret; } -static inline void remap_stack(long fd, unsigned long offset) +static inline void trap_myself(void) { - __asm__ volatile ("movq %4,%%r10 ; movq %5,%%r8 ; " - "movq %6, %%r9; " __syscall "; movq %7, %%rbx ; " - "movq %%rax, (%%rbx)": - : "a" (STUB_MMAP_NR), "D" (UML_CONFIG_STUB_DATA), - "S" (UM_KERN_PAGE_SIZE), - "d" (PROT_READ | PROT_WRITE), - "g" (MAP_FIXED | MAP_SHARED), "g" (fd), - "g" (offset), - "i" (&((struct stub_data *) UML_CONFIG_STUB_DATA)->err) - : __syscall_clobber, "r10", "r8", "r9" ); + __asm("int3"); } #endif diff --git a/trunk/arch/um/include/um_uaccess.h b/trunk/arch/um/include/um_uaccess.h index 4567f1eeb4a7..84c0868cd561 100644 --- a/trunk/arch/um/include/um_uaccess.h +++ b/trunk/arch/um/include/um_uaccess.h @@ -17,27 +17,8 @@ #include "uaccess-skas.h" #endif -#include "asm/fixmap.h" - -#define __under_task_size(addr, size) \ - (((unsigned long) (addr) < TASK_SIZE) && \ - (((unsigned long) (addr) + (size)) < TASK_SIZE)) - -#define __access_ok_vsyscall(type, addr, size) \ - ((type == VERIFY_READ) && \ - ((unsigned long) (addr) >= FIXADDR_USER_START) && \ - ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ - ((unsigned long) (addr) + (size) >= (unsigned long)(addr))) - -#define __addr_range_nowrap(addr, size) \ - ((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) - #define access_ok(type, addr, size) \ - (__addr_range_nowrap(addr, size) && \ - (__under_task_size(addr, size) || \ - __access_ok_vsyscall(type, addr, size) || \ - segment_eq(get_fs(), KERNEL_DS) || \ - CHOOSE_MODE_PROC(access_ok_tt, access_ok_skas, type, addr, size))) + CHOOSE_MODE_PROC(access_ok_tt, access_ok_skas, type, addr, size) static inline int copy_from_user(void *to, const void __user *from, int n) { diff --git a/trunk/arch/um/kernel/skas/clone.c b/trunk/arch/um/kernel/skas/clone.c index 47b812b3bca8..4dc55f10cd18 100644 --- a/trunk/arch/um/kernel/skas/clone.c +++ b/trunk/arch/um/kernel/skas/clone.c @@ -9,23 +9,18 @@ #include "stub-data.h" #include "uml-config.h" #include "sysdep/stub.h" -#include "kern_constants.h" /* This is in a separate file because it needs to be compiled with any * extraneous gcc flags (-pg, -fprofile-arcs, -ftest-coverage) disabled - * - * Use UM_KERN_PAGE_SIZE instead of PAGE_SIZE because that calls getpagesize - * on some systems. */ - void __attribute__ ((__section__ (".__syscall_stub"))) stub_clone_handler(void) { - struct stub_data *data = (struct stub_data *) UML_CONFIG_STUB_DATA; long err; + struct stub_data *from = (struct stub_data *) UML_CONFIG_STUB_DATA; err = stub_syscall2(__NR_clone, CLONE_PARENT | CLONE_FILES | SIGCHLD, - UML_CONFIG_STUB_DATA + UM_KERN_PAGE_SIZE / 2 - + UML_CONFIG_STUB_DATA + PAGE_SIZE / 2 - sizeof(void *)); if(err != 0) goto out; @@ -34,21 +29,16 @@ stub_clone_handler(void) if(err) goto out; - err = stub_syscall3(__NR_setitimer, ITIMER_VIRTUAL, - (long) &data->timer, 0); + err = stub_syscall3(__NR_setitimer, ITIMER_VIRTUAL, + (long) &from->timer, 0); if(err) goto out; - remap_stack(data->fd, data->offset); - goto done; - + err = stub_syscall6(STUB_MMAP_NR, UML_CONFIG_STUB_DATA, PAGE_SIZE, + PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, + from->fd, from->offset); out: - /* save current result. - * Parent: pid; - * child: retcode of mmap already saved and it jumps around this - * assignment - */ - data->err = err; - done: + /* save current result. Parent: pid; child: retcode of mmap */ + from->err = err; trap_myself(); } diff --git a/trunk/arch/um/kernel/skas/include/uaccess-skas.h b/trunk/arch/um/kernel/skas/include/uaccess-skas.h index 64516c556cdf..7da0c2def0ef 100644 --- a/trunk/arch/um/kernel/skas/include/uaccess-skas.h +++ b/trunk/arch/um/kernel/skas/include/uaccess-skas.h @@ -7,9 +7,16 @@ #define __SKAS_UACCESS_H #include "asm/errno.h" +#include "asm/fixmap.h" -/* No SKAS-specific checking. */ -#define access_ok_skas(type, addr, size) 0 +#define access_ok_skas(type, addr, size) \ + ((segment_eq(get_fs(), KERNEL_DS)) || \ + (((unsigned long) (addr) < TASK_SIZE) && \ + ((unsigned long) (addr) + (size) <= TASK_SIZE)) || \ + ((type == VERIFY_READ ) && \ + ((unsigned long) (addr) >= FIXADDR_USER_START) && \ + ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ + ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))) extern int copy_from_user_skas(void *to, const void __user *from, int n); extern int copy_to_user_skas(void __user *to, const void *from, int n); diff --git a/trunk/arch/um/kernel/skas/uaccess.c b/trunk/arch/um/kernel/skas/uaccess.c index a5a47528dec7..75195281081e 100644 --- a/trunk/arch/um/kernel/skas/uaccess.c +++ b/trunk/arch/um/kernel/skas/uaccess.c @@ -143,7 +143,7 @@ int copy_from_user_skas(void *to, const void __user *from, int n) return(0); } - return(access_ok(VERIFY_READ, from, n) ? + return(access_ok_skas(VERIFY_READ, from, n) ? buffer_op((unsigned long) from, n, 0, copy_chunk_from_user, &to): n); } @@ -164,7 +164,7 @@ int copy_to_user_skas(void __user *to, const void *from, int n) return(0); } - return(access_ok(VERIFY_WRITE, to, n) ? + return(access_ok_skas(VERIFY_WRITE, to, n) ? buffer_op((unsigned long) to, n, 1, copy_chunk_to_user, &from) : n); } @@ -193,7 +193,7 @@ int strncpy_from_user_skas(char *dst, const char __user *src, int count) return(strnlen(dst, count)); } - if(!access_ok(VERIFY_READ, src, 1)) + if(!access_ok_skas(VERIFY_READ, src, 1)) return(-EFAULT); n = buffer_op((unsigned long) src, count, 0, strncpy_chunk_from_user, @@ -221,7 +221,7 @@ int clear_user_skas(void __user *mem, int len) return(0); } - return(access_ok(VERIFY_WRITE, mem, len) ? + return(access_ok_skas(VERIFY_WRITE, mem, len) ? buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL) : len); } diff --git a/trunk/arch/um/kernel/trap_kern.c b/trunk/arch/um/kernel/trap_kern.c index 0d4c10a73607..95c8f8733baf 100644 --- a/trunk/arch/um/kernel/trap_kern.c +++ b/trunk/arch/um/kernel/trap_kern.c @@ -95,16 +95,7 @@ int handle_page_fault(unsigned long address, unsigned long ip, pte = pte_offset_kernel(pmd, address); } while(!pte_present(*pte)); err = 0; - /* The below warning was added in place of - * pte_mkyoung(); if (is_write) pte_mkdirty(); - * If it's triggered, we'd see normally a hang here (a clean pte is - * marked read-only to emulate the dirty bit). - * However, the generic code can mark a PTE writable but clean on a - * concurrent read fault, triggering this harmlessly. So comment it out. - */ -#if 0 WARN_ON(!pte_young(*pte) || (is_write && !pte_dirty(*pte))); -#endif flush_tlb_page(vma, address); out: up_read(&mm->mmap_sem); diff --git a/trunk/arch/um/kernel/tt/include/uaccess-tt.h b/trunk/arch/um/kernel/tt/include/uaccess-tt.h index b9bfe9c481c4..dc2ebfa8c54f 100644 --- a/trunk/arch/um/kernel/tt/include/uaccess-tt.h +++ b/trunk/arch/um/kernel/tt/include/uaccess-tt.h @@ -19,13 +19,19 @@ extern unsigned long end_vm; extern unsigned long uml_physmem; +#define under_task_size(addr, size) \ + (((unsigned long) (addr) < TASK_SIZE) && \ + (((unsigned long) (addr) + (size)) < TASK_SIZE)) + #define is_stack(addr, size) \ (((unsigned long) (addr) < STACK_TOP) && \ ((unsigned long) (addr) >= STACK_TOP - ABOVE_KMEM) && \ (((unsigned long) (addr) + (size)) <= STACK_TOP)) #define access_ok_tt(type, addr, size) \ - (is_stack(addr, size)) + ((type == VERIFY_READ) || (segment_eq(get_fs(), KERNEL_DS)) || \ + (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \ + (under_task_size(addr, size) || is_stack(addr, size)))) extern unsigned long get_fault_addr(void); diff --git a/trunk/arch/um/kernel/tt/uaccess.c b/trunk/arch/um/kernel/tt/uaccess.c index 1cb60726567e..a72aa632972f 100644 --- a/trunk/arch/um/kernel/tt/uaccess.c +++ b/trunk/arch/um/kernel/tt/uaccess.c @@ -8,7 +8,7 @@ int copy_from_user_tt(void *to, const void __user *from, int n) { - if(!access_ok(VERIFY_READ, from, n)) + if(!access_ok_tt(VERIFY_READ, from, n)) return(n); return(__do_copy_from_user(to, from, n, ¤t->thread.fault_addr, @@ -17,7 +17,7 @@ int copy_from_user_tt(void *to, const void __user *from, int n) int copy_to_user_tt(void __user *to, const void *from, int n) { - if(!access_ok(VERIFY_WRITE, to, n)) + if(!access_ok_tt(VERIFY_WRITE, to, n)) return(n); return(__do_copy_to_user(to, from, n, ¤t->thread.fault_addr, @@ -28,7 +28,7 @@ int strncpy_from_user_tt(char *dst, const char __user *src, int count) { int n; - if(!access_ok(VERIFY_READ, src, 1)) + if(!access_ok_tt(VERIFY_READ, src, 1)) return(-EFAULT); n = __do_strncpy_from_user(dst, src, count, @@ -47,7 +47,7 @@ int __clear_user_tt(void __user *mem, int len) int clear_user_tt(void __user *mem, int len) { - if(!access_ok(VERIFY_WRITE, mem, len)) + if(!access_ok_tt(VERIFY_WRITE, mem, len)) return(len); return(__do_clear_user(mem, len, ¤t->thread.fault_addr, diff --git a/trunk/arch/um/os-Linux/start_up.c b/trunk/arch/um/os-Linux/start_up.c index 29a9e3f43763..37517d49c4ae 100644 --- a/trunk/arch/um/os-Linux/start_up.c +++ b/trunk/arch/um/os-Linux/start_up.c @@ -116,16 +116,16 @@ static int stop_ptraced_child(int pid, void *stack, int exitcode, if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) { int exit_with = WEXITSTATUS(status); if (exit_with == 2) - printf("check_ptrace : child exited with status 2. " + printk("check_ptrace : child exited with status 2. " "Serious trouble happening! Try updating your " "host skas patch!\nDisabling SYSEMU support."); - printf("check_ptrace : child exited with exitcode %d, while " + printk("check_ptrace : child exited with exitcode %d, while " "expecting %d; status 0x%x", exit_with, exitcode, status); if (mustpanic) panic("\n"); else - printf("\n"); + printk("\n"); ret = -1; } @@ -183,7 +183,7 @@ static void __init check_sysemu(void) void *stack; int pid, n, status, count=0; - printf("Checking syscall emulation patch for ptrace..."); + printk("Checking syscall emulation patch for ptrace..."); sysemu_supported = 0; pid = start_ptraced_child(&stack); @@ -207,10 +207,10 @@ static void __init check_sysemu(void) goto fail_stopped; sysemu_supported = 1; - printf("OK\n"); + printk("OK\n"); set_using_sysemu(!force_sysemu_disabled); - printf("Checking advanced syscall emulation patch for ptrace..."); + printk("Checking advanced syscall emulation patch for ptrace..."); pid = start_ptraced_child(&stack); if(ptrace(PTRACE_OLDSETOPTIONS, pid, 0, @@ -246,7 +246,7 @@ static void __init check_sysemu(void) goto fail_stopped; sysemu_supported = 2; - printf("OK\n"); + printk("OK\n"); if ( !force_sysemu_disabled ) set_using_sysemu(sysemu_supported); @@ -255,7 +255,7 @@ static void __init check_sysemu(void) fail: stop_ptraced_child(pid, stack, 1, 0); fail_stopped: - printf("missing\n"); + printk("missing\n"); } static void __init check_ptrace(void) @@ -263,7 +263,7 @@ static void __init check_ptrace(void) void *stack; int pid, syscall, n, status; - printf("Checking that ptrace can change system call numbers..."); + printk("Checking that ptrace can change system call numbers..."); pid = start_ptraced_child(&stack); if(ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) @@ -292,7 +292,7 @@ static void __init check_ptrace(void) } } stop_ptraced_child(pid, stack, 0, 1); - printf("OK\n"); + printk("OK\n"); check_sysemu(); } @@ -472,8 +472,6 @@ int can_do_skas(void) int have_devanon = 0; -/* Runs on boot kernel stack - already safe to use printk. */ - void check_devanon(void) { int fd; diff --git a/trunk/arch/um/os-Linux/user_syms.c b/trunk/arch/um/os-Linux/user_syms.c index 8da6ab31152a..56d3f870926b 100644 --- a/trunk/arch/um/os-Linux/user_syms.c +++ b/trunk/arch/um/os-Linux/user_syms.c @@ -34,11 +34,6 @@ EXPORT_SYMBOL(strstr); int sym(void); \ EXPORT_SYMBOL(sym); -extern void readdir64(void) __attribute__((weak)); -EXPORT_SYMBOL(readdir64); -extern void truncate64(void) __attribute__((weak)); -EXPORT_SYMBOL(truncate64); - #ifdef SUBARCH_i386 EXPORT_SYMBOL(vsyscall_ehdr); EXPORT_SYMBOL(vsyscall_end); diff --git a/trunk/arch/um/scripts/Makefile.rules b/trunk/arch/um/scripts/Makefile.rules index 2e41cabd3d93..b3fbf125709b 100644 --- a/trunk/arch/um/scripts/Makefile.rules +++ b/trunk/arch/um/scripts/Makefile.rules @@ -21,6 +21,11 @@ define unprofile endef +# The stubs and unmap.o can't try to call mcount or update basic block data +define unprofile + $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1))) +endef + # cmd_make_link checks to see if the $(foo-dir) variable starts with a /. If # so, it's considered to be a path relative to $(srcdir) rather than # $(srcdir)/arch/$(SUBARCH). This is because x86_64 wants to get ldt.c from diff --git a/trunk/arch/um/sys-i386/Makefile b/trunk/arch/um/sys-i386/Makefile index f5fd5b0156d0..6dfeb70f6957 100644 --- a/trunk/arch/um/sys-i386/Makefile +++ b/trunk/arch/um/sys-i386/Makefile @@ -1,13 +1,11 @@ -obj-y := bitops.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ - ptrace_user.o semaphore.o signal.o sigcontext.o syscalls.o sysrq.o \ - sys_call_table.o - -obj-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o +obj-y = bitops.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ + ptrace_user.o semaphore.o signal.o sigcontext.o stub.o stub_segv.o \ + syscalls.o sysrq.o sys_call_table.o obj-$(CONFIG_HIGHMEM) += highmem.o obj-$(CONFIG_MODULES) += module.o -USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o stub_segv.o +USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o SYMLINKS = bitops.c semaphore.c highmem.c module.c diff --git a/trunk/arch/um/sys-i386/ldt.c b/trunk/arch/um/sys-i386/ldt.c index 17746b4c08ff..6360f1c958d0 100644 --- a/trunk/arch/um/sys-i386/ldt.c +++ b/trunk/arch/um/sys-i386/ldt.c @@ -228,7 +228,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) size = LDT_ENTRY_SIZE*LDT_DIRECT_ENTRIES; if(size > bytecount) size = bytecount; - if(copy_to_user(ptr, ldt->u.entries, size)) + if(copy_to_user(ptr, ldt->entries, size)) err = -EFAULT; bytecount -= size; ptr += size; @@ -239,7 +239,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) size = PAGE_SIZE; if(size > bytecount) size = bytecount; - if(copy_to_user(ptr, ldt->u.pages[i], size)){ + if(copy_to_user(ptr, ldt->pages[i], size)){ err = -EFAULT; break; } @@ -321,11 +321,10 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int func) i*LDT_ENTRIES_PER_PAGE <= ldt_info.entry_number; i++){ if(i == 0) - memcpy(&entry0, ldt->u.entries, - sizeof(entry0)); - ldt->u.pages[i] = (struct ldt_entry *) - __get_free_page(GFP_KERNEL|__GFP_ZERO); - if(!ldt->u.pages[i]){ + memcpy(&entry0, ldt->entries, sizeof(entry0)); + ldt->pages[i] = (struct ldt_entry *) + __get_free_page(GFP_KERNEL|__GFP_ZERO); + if(!ldt->pages[i]){ err = -ENOMEM; /* Undo the change in host */ memset(&ldt_info, 0, sizeof(ldt_info)); @@ -333,9 +332,8 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int func) goto out_unlock; } if(i == 0) { - memcpy(ldt->u.pages[0], &entry0, - sizeof(entry0)); - memcpy(ldt->u.pages[0]+1, ldt->u.entries+1, + memcpy(ldt->pages[0], &entry0, sizeof(entry0)); + memcpy(ldt->pages[0]+1, ldt->entries+1, sizeof(entry0)*(LDT_DIRECT_ENTRIES-1)); } ldt->entry_count = (i + 1) * LDT_ENTRIES_PER_PAGE; @@ -345,9 +343,9 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int func) ldt->entry_count = ldt_info.entry_number + 1; if(ldt->entry_count <= LDT_DIRECT_ENTRIES) - ldt_p = ldt->u.entries + ldt_info.entry_number; + ldt_p = ldt->entries + ldt_info.entry_number; else - ldt_p = ldt->u.pages[ldt_info.entry_number/LDT_ENTRIES_PER_PAGE] + + ldt_p = ldt->pages[ldt_info.entry_number/LDT_ENTRIES_PER_PAGE] + ldt_info.entry_number%LDT_ENTRIES_PER_PAGE; if(ldt_info.base_addr == 0 && ldt_info.limit == 0 && @@ -503,8 +501,8 @@ long init_new_ldt(struct mmu_context_skas * new_mm, */ down(&from_mm->ldt.semaphore); if(from_mm->ldt.entry_count <= LDT_DIRECT_ENTRIES){ - memcpy(new_mm->ldt.u.entries, from_mm->ldt.u.entries, - sizeof(new_mm->ldt.u.entries)); + memcpy(new_mm->ldt.entries, from_mm->ldt.entries, + sizeof(new_mm->ldt.entries)); } else{ i = from_mm->ldt.entry_count / LDT_ENTRIES_PER_PAGE; @@ -514,10 +512,9 @@ long init_new_ldt(struct mmu_context_skas * new_mm, err = -ENOMEM; break; } - new_mm->ldt.u.pages[i] = - (struct ldt_entry *) page; - memcpy(new_mm->ldt.u.pages[i], - from_mm->ldt.u.pages[i], PAGE_SIZE); + new_mm->ldt.pages[i] = (struct ldt_entry*)page; + memcpy(new_mm->ldt.pages[i], + from_mm->ldt.pages[i], PAGE_SIZE); } } new_mm->ldt.entry_count = from_mm->ldt.entry_count; @@ -535,7 +532,7 @@ void free_ldt(struct mmu_context_skas * mm) if(!ptrace_ldt && mm->ldt.entry_count > LDT_DIRECT_ENTRIES){ i = mm->ldt.entry_count / LDT_ENTRIES_PER_PAGE; while(i-- > 0){ - free_page((long )mm->ldt.u.pages[i]); + free_page((long )mm->ldt.pages[i]); } } mm->ldt.entry_count = 0; diff --git a/trunk/arch/um/sys-i386/stub_segv.c b/trunk/arch/um/sys-i386/stub_segv.c index a37f672ec964..1e88b275edac 100644 --- a/trunk/arch/um/sys-i386/stub_segv.c +++ b/trunk/arch/um/sys-i386/stub_segv.c @@ -3,11 +3,9 @@ * Licensed under the GPL */ -#include -#include /* The only way I can see to get sigset_t */ +#include #include #include "uml-config.h" -#include "sysdep/stub.h" #include "sysdep/sigcontext.h" #include "sysdep/faultinfo.h" @@ -15,14 +13,13 @@ void __attribute__ ((__section__ (".__syscall_stub"))) stub_segv_handler(int sig) { struct sigcontext *sc = (struct sigcontext *) (&sig + 1); - int pid; GET_FAULTINFO_FROM_SC(*((struct faultinfo *) UML_CONFIG_STUB_DATA), sc); - pid = stub_syscall0(__NR_getpid); - stub_syscall2(__NR_kill, pid, SIGUSR1); - + __asm__("movl %0, %%eax ; int $0x80": : "g" (__NR_getpid)); + __asm__("movl %%eax, %%ebx ; movl %0, %%eax ; movl %1, %%ecx ;" + "int $0x80": : "g" (__NR_kill), "g" (SIGUSR1)); /* Load pointer to sigcontext into esp, since we need to leave * the stack in its original form when we do the sigreturn here, by * hand. diff --git a/trunk/arch/um/sys-x86_64/Makefile b/trunk/arch/um/sys-x86_64/Makefile index a351091fbd99..ea977df395a1 100644 --- a/trunk/arch/um/sys-x86_64/Makefile +++ b/trunk/arch/um/sys-x86_64/Makefile @@ -6,14 +6,13 @@ #XXX: why into lib-y? lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o ldt.o mem.o memcpy.o \ - ptrace.o ptrace_user.o sigcontext.o signal.o syscalls.o \ - syscall_table.o sysrq.o thunk.o -lib-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o + ptrace.o ptrace_user.o sigcontext.o signal.o stub.o \ + stub_segv.o syscalls.o syscall_table.o sysrq.o thunk.o obj-y := ksyms.o obj-$(CONFIG_MODULES) += module.o um_module.o -USER_OBJS := ptrace_user.o sigcontext.o stub_segv.o +USER_OBJS := ptrace_user.o sigcontext.o SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c ldt.c memcpy.S \ thunk.S module.c diff --git a/trunk/arch/um/sys-x86_64/stub_segv.c b/trunk/arch/um/sys-x86_64/stub_segv.c index a27099533198..d1e53bdf2e85 100644 --- a/trunk/arch/um/sys-x86_64/stub_segv.c +++ b/trunk/arch/um/sys-x86_64/stub_segv.c @@ -3,14 +3,14 @@ * Licensed under the GPL */ -#include -#include +#include #include #include +#include #include "uml-config.h" #include "sysdep/sigcontext.h" #include "sysdep/faultinfo.h" -#include "sysdep/stub.h" +#include /* Copied from sys-x86_64/signal.c - Can't find an equivalent definition * in the libc headers anywhere. @@ -31,21 +31,21 @@ void __attribute__ ((__section__ (".__syscall_stub"))) stub_segv_handler(int sig) { struct ucontext *uc; - int pid; __asm__("movq %%rdx, %0" : "=g" (uc) :); GET_FAULTINFO_FROM_SC(*((struct faultinfo *) UML_CONFIG_STUB_DATA), &uc->uc_mcontext); - pid = stub_syscall0(__NR_getpid); - stub_syscall2(__NR_kill, pid, SIGUSR1); - + __asm__("movq %0, %%rax ; syscall": : "g" (__NR_getpid)); + __asm__("movq %%rax, %%rdi ; movq %0, %%rax ; movq %1, %%rsi ;" + "syscall": : "g" (__NR_kill), "g" (SIGUSR1) : + "%rdi", "%rax", "%rsi"); /* sys_sigreturn expects that the stack pointer will be 8 bytes into * the signal frame. So, we use the ucontext pointer, which we know * already, to get the signal frame pointer, and add 8 to that. */ - __asm__("movq %0, %%rsp; movq %1, %%rax ; syscall": : + __asm__("movq %0, %%rsp": : "g" ((unsigned long) container_of(uc, struct rt_sigframe, - uc) + 8), - "g" (__NR_rt_sigreturn)); + uc) + 8)); + __asm__("movq %0, %%rax ; syscall" : : "g" (__NR_rt_sigreturn)); } diff --git a/trunk/arch/v850/Kconfig b/trunk/arch/v850/Kconfig index 310865903234..89c053b6c2c4 100644 --- a/trunk/arch/v850/Kconfig +++ b/trunk/arch/v850/Kconfig @@ -23,14 +23,6 @@ config GENERIC_CALIBRATE_DELAY bool default y -config GENERIC_HARDIRQS - bool - default y - -config GENERIC_IRQ_PROBE - bool - default y - # Turn off some random 386 crap that can affect device config config ISA bool diff --git a/trunk/arch/v850/kernel/irq.c b/trunk/arch/v850/kernel/irq.c index 7a151c26f82e..9e85969ba976 100644 --- a/trunk/arch/v850/kernel/irq.c +++ b/trunk/arch/v850/kernel/irq.c @@ -1,8 +1,8 @@ /* * arch/v850/kernel/irq.c -- High-level interrupt handling * - * Copyright (C) 2001,02,03,04,05 NEC Electronics Corporation - * Copyright (C) 2001,02,03,04,05 Miles Bader + * Copyright (C) 2001,02,03,04 NEC Electronics Corporation + * Copyright (C) 2001,02,03,04 Miles Bader * Copyright (C) 1994-2000 Ralf Baechle * Copyright (C) 1992 Linus Torvalds * @@ -27,15 +27,55 @@ #include /* - * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesn't deserve - * a generic callback i think. + * Controller mappings for all interrupt sources: */ -void ack_bad_irq(unsigned int irq) +irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { + [0 ... NR_IRQS-1] = { + .handler = &no_irq_type, + .lock = SPIN_LOCK_UNLOCKED + } +}; + +/* + * Special irq handlers. + */ + +irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) +{ + return IRQ_NONE; +} + +/* + * Generic no controller code + */ + +static void enable_none(unsigned int irq) { } +static unsigned int startup_none(unsigned int irq) { return 0; } +static void disable_none(unsigned int irq) { } +static void ack_none(unsigned int irq) { + /* + * 'what should we do if we get a hw irq event on an illegal vector'. + * each architecture has to answer this themselves, it doesn't deserve + * a generic callback i think. + */ printk("received IRQ %d with unknown interrupt type\n", irq); } +/* startup is the same as "enable", shutdown is same as "disable" */ +#define shutdown_none disable_none +#define end_none enable_none + +struct hw_interrupt_type no_irq_type = { + .typename = "none", + .startup = startup_none, + .shutdown = shutdown_none, + .enable = enable_none, + .disable = disable_none, + .ack = ack_none, + .end = end_none +}; + volatile unsigned long irq_err_count, spurious_count; /* @@ -44,68 +84,643 @@ volatile unsigned long irq_err_count, spurious_count; int show_interrupts(struct seq_file *p, void *v) { - int irq = *(loff_t *) v; + int i = *(loff_t *) v; + struct irqaction * action; + unsigned long flags; - if (irq == 0) { - int cpu; + if (i == 0) { seq_puts(p, " "); - for (cpu=0; cpu < 1 /*smp_num_cpus*/; cpu++) - seq_printf(p, "CPU%d ", cpu); + for (i=0; i < 1 /*smp_num_cpus*/; i++) + seq_printf(p, "CPU%d ", i); seq_putc(p, '\n'); } - if (irq < NR_IRQS) { - unsigned long flags; - struct irqaction *action; + if (i < NR_IRQS) { + int j, count, num; + const char *type_name = irq_desc[i].handler->typename; + spin_lock_irqsave(&irq_desc[j].lock, flags); + action = irq_desc[i].action; + if (!action) + goto skip; - spin_lock_irqsave(&irq_desc[irq].lock, flags); + count = 0; + num = -1; + for (j = 0; j < NR_IRQS; j++) + if (irq_desc[j].handler->typename == type_name) { + if (i == j) + num = count; + count++; + } - action = irq_desc[irq].action; - if (action) { - int j; - int count = 0; - int num = -1; - const char *type_name = irq_desc[irq].handler->typename; - - for (j = 0; j < NR_IRQS; j++) - if (irq_desc[j].handler->typename == type_name){ - if (irq == j) - num = count; - count++; - } - - seq_printf(p, "%3d: ",irq); - seq_printf(p, "%10u ", kstat_irqs(irq)); - if (count > 1) { - int prec = (num >= 100 ? 3 : num >= 10 ? 2 : 1); - seq_printf(p, " %*s%d", 14 - prec, - type_name, num); - } else - seq_printf(p, " %14s", type_name); + seq_printf(p, "%3d: ",i); + seq_printf(p, "%10u ", kstat_irqs(i)); + if (count > 1) { + int prec = (num >= 100 ? 3 : num >= 10 ? 2 : 1); + seq_printf(p, " %*s%d", 14 - prec, type_name, num); + } else + seq_printf(p, " %14s", type_name); - seq_printf(p, " %s", action->name); - for (action=action->next; action; action = action->next) - seq_printf(p, ", %s", action->name); - seq_putc(p, '\n'); - } - - spin_unlock_irqrestore(&irq_desc[irq].lock, flags); - } else if (irq == NR_IRQS) + seq_printf(p, " %s", action->name); + for (action=action->next; action; action = action->next) + seq_printf(p, ", %s", action->name); + seq_putc(p, '\n'); +skip: + spin_unlock_irqrestore(&irq_desc[j].lock, flags); + } else if (i == NR_IRQS) seq_printf(p, "ERR: %10lu\n", irq_err_count); - return 0; } +/* + * This should really return information about whether + * we should do bottom half handling etc. Right now we + * end up _always_ checking the bottom half, which is a + * waste of time and is not what some drivers would + * prefer. + */ +int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, struct irqaction * action) +{ + int status = 1; /* Force the "do bottom halves" bit */ + int ret; + + if (!(action->flags & SA_INTERRUPT)) + local_irq_enable(); + + do { + ret = action->handler(irq, action->dev_id, regs); + if (ret == IRQ_HANDLED) + status |= action->flags; + action = action->next; + } while (action); + if (status & SA_SAMPLE_RANDOM) + add_interrupt_randomness(irq); + local_irq_disable(); + + return status; +} + +/* + * Generic enable/disable code: this just calls + * down into the PIC-specific version for the actual + * hardware disable after having gotten the irq + * controller lock. + */ + +/** + * disable_irq_nosync - disable an irq without waiting + * @irq: Interrupt to disable + * + * Disable the selected interrupt line. Disables of an interrupt + * stack. Unlike disable_irq(), this function does not ensure existing + * instances of the IRQ handler have completed before returning. + * + * This function may be called from IRQ context. + */ + +void inline disable_irq_nosync(unsigned int irq) +{ + irq_desc_t *desc = irq_desc + irq; + unsigned long flags; + + spin_lock_irqsave(&desc->lock, flags); + if (!desc->depth++) { + desc->status |= IRQ_DISABLED; + desc->handler->disable(irq); + } + spin_unlock_irqrestore(&desc->lock, flags); +} + +/** + * disable_irq - disable an irq and wait for completion + * @irq: Interrupt to disable + * + * Disable the selected interrupt line. Disables of an interrupt + * stack. That is for two disables you need two enables. This + * function waits for any pending IRQ handlers for this interrupt + * to complete before returning. If you use this function while + * holding a resource the IRQ handler may need you will deadlock. + * + * This function may be called - with care - from IRQ context. + */ + +void disable_irq(unsigned int irq) +{ + disable_irq_nosync(irq); + synchronize_irq(irq); +} + +/** + * enable_irq - enable interrupt handling on an irq + * @irq: Interrupt to enable + * + * Re-enables the processing of interrupts on this IRQ line + * providing no disable_irq calls are now in effect. + * + * This function may be called from IRQ context. + */ + +void enable_irq(unsigned int irq) +{ + irq_desc_t *desc = irq_desc + irq; + unsigned long flags; + + spin_lock_irqsave(&desc->lock, flags); + switch (desc->depth) { + case 1: { + unsigned int status = desc->status & ~IRQ_DISABLED; + desc->status = status; + if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { + desc->status = status | IRQ_REPLAY; + hw_resend_irq(desc->handler,irq); + } + desc->handler->enable(irq); + /* fall-through */ + } + default: + desc->depth--; + break; + case 0: + printk("enable_irq(%u) unbalanced from %p\n", irq, + __builtin_return_address(0)); + } + spin_unlock_irqrestore(&desc->lock, flags); +} + /* Handle interrupt IRQ. REGS are the registers at the time of ther interrupt. */ unsigned int handle_irq (int irq, struct pt_regs *regs) { + /* + * We ack quickly, we don't want the irq controller + * thinking we're snobs just because some other CPU has + * disabled global interrupts (we have already done the + * INT_ACK cycles, it's too late to try to pretend to the + * controller that we aren't taking the interrupt). + * + * 0 return value means that this irq is already being + * handled by some other CPU. (or is disabled) + */ + int cpu = smp_processor_id(); + irq_desc_t *desc = irq_desc + irq; + struct irqaction * action; + unsigned int status; + irq_enter(); - __do_IRQ(irq, regs); + kstat_cpu(cpu).irqs[irq]++; + spin_lock(&desc->lock); + desc->handler->ack(irq); + /* + REPLAY is when Linux resends an IRQ that was dropped earlier + WAITING is used by probe to mark irqs that are being tested + */ + status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); + status |= IRQ_PENDING; /* we _want_ to handle it */ + + /* + * If the IRQ is disabled for whatever reason, we cannot + * use the action we have. + */ + action = NULL; + if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) { + action = desc->action; + status &= ~IRQ_PENDING; /* we commit to handling */ + status |= IRQ_INPROGRESS; /* we are handling it */ + } + desc->status = status; + + /* + * If there is no IRQ handler or it was disabled, exit early. + Since we set PENDING, if another processor is handling + a different instance of this same irq, the other processor + will take care of it. + */ + if (unlikely(!action)) + goto out; + + /* + * Edge triggered interrupts need to remember + * pending events. + * This applies to any hw interrupts that allow a second + * instance of the same irq to arrive while we are in handle_irq + * or in the handler. But the code here only handles the _second_ + * instance of the irq, not the third or fourth. So it is mostly + * useful for irq hardware that does not mask cleanly in an + * SMP environment. + */ + for (;;) { + spin_unlock(&desc->lock); + handle_IRQ_event(irq, regs, action); + spin_lock(&desc->lock); + + if (likely(!(desc->status & IRQ_PENDING))) + break; + desc->status &= ~IRQ_PENDING; + } + desc->status &= ~IRQ_INPROGRESS; + +out: + /* + * The ->end() handler has to deal with interrupts which got + * disabled while the handler was running. + */ + desc->handler->end(irq); + spin_unlock(&desc->lock); + irq_exit(); + return 1; } +/** + * request_irq - allocate an interrupt line + * @irq: Interrupt line to allocate + * @handler: Function to be called when the IRQ occurs + * @irqflags: Interrupt type flags + * @devname: An ascii name for the claiming device + * @dev_id: A cookie passed back to the handler function + * + * This call allocates interrupt resources and enables the + * interrupt line and IRQ handling. From the point this + * call is made your handler function may be invoked. Since + * your handler function must clear any interrupt the board + * raises, you must take care both to initialise your hardware + * and to set up the interrupt handler in the right order. + * + * Dev_id must be globally unique. Normally the address of the + * device data structure is used as the cookie. Since the handler + * receives this value it makes sense to use it. + * + * If your interrupt is shared you must pass a non NULL dev_id + * as this is required when freeing the interrupt. + * + * Flags: + * + * SA_SHIRQ Interrupt is shared + * + * SA_INTERRUPT Disable local interrupts while processing + * + * SA_SAMPLE_RANDOM The interrupt can be used for entropy + * + */ + +int request_irq(unsigned int irq, + irqreturn_t (*handler)(int, void *, struct pt_regs *), + unsigned long irqflags, + const char * devname, + void *dev_id) +{ + int retval; + struct irqaction * action; + +#if 1 + /* + * Sanity-check: shared interrupts should REALLY pass in + * a real dev-ID, otherwise we'll have trouble later trying + * to figure out which interrupt is which (messes up the + * interrupt freeing logic etc). + */ + if (irqflags & SA_SHIRQ) { + if (!dev_id) + printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]); + } +#endif + + if (irq >= NR_IRQS) + return -EINVAL; + if (!handler) + return -EINVAL; + + action = (struct irqaction *) + kmalloc(sizeof(struct irqaction), GFP_KERNEL); + if (!action) + return -ENOMEM; + + action->handler = handler; + action->flags = irqflags; + cpus_clear(action->mask); + action->name = devname; + action->next = NULL; + action->dev_id = dev_id; + + retval = setup_irq(irq, action); + if (retval) + kfree(action); + return retval; +} + +EXPORT_SYMBOL(request_irq); + +/** + * free_irq - free an interrupt + * @irq: Interrupt line to free + * @dev_id: Device identity to free + * + * Remove an interrupt handler. The handler is removed and if the + * interrupt line is no longer in use by any driver it is disabled. + * On a shared IRQ the caller must ensure the interrupt is disabled + * on the card it drives before calling this function. The function + * does not return until any executing interrupts for this IRQ + * have completed. + * + * This function may be called from interrupt context. + * + * Bugs: Attempting to free an irq in a handler for the same irq hangs + * the machine. + */ + +void free_irq(unsigned int irq, void *dev_id) +{ + irq_desc_t *desc; + struct irqaction **p; + unsigned long flags; + + if (irq >= NR_IRQS) + return; + + desc = irq_desc + irq; + spin_lock_irqsave(&desc->lock,flags); + p = &desc->action; + for (;;) { + struct irqaction * action = *p; + if (action) { + struct irqaction **pp = p; + p = &action->next; + if (action->dev_id != dev_id) + continue; + + /* Found it - now remove it from the list of entries */ + *pp = action->next; + if (!desc->action) { + desc->status |= IRQ_DISABLED; + desc->handler->shutdown(irq); + } + spin_unlock_irqrestore(&desc->lock,flags); + + synchronize_irq(irq); + kfree(action); + return; + } + printk("Trying to free free IRQ%d\n",irq); + spin_unlock_irqrestore(&desc->lock,flags); + return; + } +} + +EXPORT_SYMBOL(free_irq); + +/* + * IRQ autodetection code.. + * + * This depends on the fact that any interrupt that + * comes in on to an unassigned handler will get stuck + * with "IRQ_WAITING" cleared and the interrupt + * disabled. + */ + +static DECLARE_MUTEX(probe_sem); + +/** + * probe_irq_on - begin an interrupt autodetect + * + * Commence probing for an interrupt. The interrupts are scanned + * and a mask of potential interrupt lines is returned. + * + */ + +unsigned long probe_irq_on(void) +{ + unsigned int i; + irq_desc_t *desc; + unsigned long val; + unsigned long delay; + + down(&probe_sem); + /* + * something may have generated an irq long ago and we want to + * flush such a longstanding irq before considering it as spurious. + */ + for (i = NR_IRQS-1; i > 0; i--) { + desc = irq_desc + i; + + spin_lock_irq(&desc->lock); + if (!irq_desc[i].action) + irq_desc[i].handler->startup(i); + spin_unlock_irq(&desc->lock); + } + + /* Wait for longstanding interrupts to trigger. */ + for (delay = jiffies + HZ/50; time_after(delay, jiffies); ) + /* about 20ms delay */ barrier(); + + /* + * enable any unassigned irqs + * (we must startup again here because if a longstanding irq + * happened in the previous stage, it may have masked itself) + */ + for (i = NR_IRQS-1; i > 0; i--) { + desc = irq_desc + i; + + spin_lock_irq(&desc->lock); + if (!desc->action) { + desc->status |= IRQ_AUTODETECT | IRQ_WAITING; + if (desc->handler->startup(i)) + desc->status |= IRQ_PENDING; + } + spin_unlock_irq(&desc->lock); + } + + /* + * Wait for spurious interrupts to trigger + */ + for (delay = jiffies + HZ/10; time_after(delay, jiffies); ) + /* about 100ms delay */ barrier(); + + /* + * Now filter out any obviously spurious interrupts + */ + val = 0; + for (i = 0; i < NR_IRQS; i++) { + irq_desc_t *desc = irq_desc + i; + unsigned int status; + + spin_lock_irq(&desc->lock); + status = desc->status; + + if (status & IRQ_AUTODETECT) { + /* It triggered already - consider it spurious. */ + if (!(status & IRQ_WAITING)) { + desc->status = status & ~IRQ_AUTODETECT; + desc->handler->shutdown(i); + } else + if (i < 32) + val |= 1 << i; + } + spin_unlock_irq(&desc->lock); + } + + return val; +} + +EXPORT_SYMBOL(probe_irq_on); + +/* + * Return a mask of triggered interrupts (this + * can handle only legacy ISA interrupts). + */ + +/** + * probe_irq_mask - scan a bitmap of interrupt lines + * @val: mask of interrupts to consider + * + * Scan the ISA bus interrupt lines and return a bitmap of + * active interrupts. The interrupt probe logic state is then + * returned to its previous value. + * + * Note: we need to scan all the irq's even though we will + * only return ISA irq numbers - just so that we reset them + * all to a known state. + */ +unsigned int probe_irq_mask(unsigned long val) +{ + int i; + unsigned int mask; + + mask = 0; + for (i = 0; i < NR_IRQS; i++) { + irq_desc_t *desc = irq_desc + i; + unsigned int status; + + spin_lock_irq(&desc->lock); + status = desc->status; + + if (status & IRQ_AUTODETECT) { + if (i < 16 && !(status & IRQ_WAITING)) + mask |= 1 << i; + + desc->status = status & ~IRQ_AUTODETECT; + desc->handler->shutdown(i); + } + spin_unlock_irq(&desc->lock); + } + up(&probe_sem); + + return mask & val; +} + +/* + * Return the one interrupt that triggered (this can + * handle any interrupt source). + */ + +/** + * probe_irq_off - end an interrupt autodetect + * @val: mask of potential interrupts (unused) + * + * Scans the unused interrupt lines and returns the line which + * appears to have triggered the interrupt. If no interrupt was + * found then zero is returned. If more than one interrupt is + * found then minus the first candidate is returned to indicate + * their is doubt. + * + * The interrupt probe logic state is returned to its previous + * value. + * + * BUGS: When used in a module (which arguably shouldnt happen) + * nothing prevents two IRQ probe callers from overlapping. The + * results of this are non-optimal. + */ + +int probe_irq_off(unsigned long val) +{ + int i, irq_found, nr_irqs; + + nr_irqs = 0; + irq_found = 0; + for (i = 0; i < NR_IRQS; i++) { + irq_desc_t *desc = irq_desc + i; + unsigned int status; + + spin_lock_irq(&desc->lock); + status = desc->status; + + if (status & IRQ_AUTODETECT) { + if (!(status & IRQ_WAITING)) { + if (!nr_irqs) + irq_found = i; + nr_irqs++; + } + desc->status = status & ~IRQ_AUTODETECT; + desc->handler->shutdown(i); + } + spin_unlock_irq(&desc->lock); + } + up(&probe_sem); + + if (nr_irqs > 1) + irq_found = -irq_found; + return irq_found; +} + +EXPORT_SYMBOL(probe_irq_off); + +/* this was setup_x86_irq but it seems pretty generic */ +int setup_irq(unsigned int irq, struct irqaction * new) +{ + int shared = 0; + unsigned long flags; + struct irqaction *old, **p; + irq_desc_t *desc = irq_desc + irq; + + /* + * Some drivers like serial.c use request_irq() heavily, + * so we have to be careful not to interfere with a + * running system. + */ + if (new->flags & SA_SAMPLE_RANDOM) { + /* + * This function might sleep, we want to call it first, + * outside of the atomic block. + * Yes, this might clear the entropy pool if the wrong + * driver is attempted to be loaded, without actually + * installing a new handler, but is this really a problem, + * only the sysadmin is able to do this. + */ + rand_initialize_irq(irq); + } + + /* + * The following block of code has to be executed atomically + */ + spin_lock_irqsave(&desc->lock,flags); + p = &desc->action; + if ((old = *p) != NULL) { + /* Can't share interrupts unless both agree to */ + if (!(old->flags & new->flags & SA_SHIRQ)) { + spin_unlock_irqrestore(&desc->lock,flags); + return -EBUSY; + } + + /* add new interrupt at end of irq queue */ + do { + p = &old->next; + old = *p; + } while (old); + shared = 1; + } + + *p = new; + + if (!shared) { + desc->depth = 0; + desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS); + desc->handler->startup(irq); + } + spin_unlock_irqrestore(&desc->lock,flags); + + /* register_irq_proc(irq); */ + return 0; +} + /* Initialize irq handling for IRQs. BASE_IRQ, BASE_IRQ+INTERVAL, ..., BASE_IRQ+NUM*INTERVAL to IRQ_TYPE. An IRQ_TYPE of 0 means to use a generic interrupt type. */ @@ -121,3 +736,9 @@ init_irq_handlers (int base_irq, int num, int interval, base_irq += interval; } } + +#if defined(CONFIG_PROC_FS) && defined(CONFIG_SYSCTL) +void init_irq_proc(void) +{ +} +#endif /* CONFIG_PROC_FS && CONFIG_SYSCTL */ diff --git a/trunk/arch/x86_64/Kconfig b/trunk/arch/x86_64/Kconfig index 6ece645e4dbe..4cce2f6f170c 100644 --- a/trunk/arch/x86_64/Kconfig +++ b/trunk/arch/x86_64/Kconfig @@ -226,42 +226,22 @@ config SCHED_SMT source "kernel/Kconfig.preempt" -config NUMA - bool "Non Uniform Memory Access (NUMA) Support" - depends on SMP - help - Enable NUMA (Non Uniform Memory Access) support. The kernel - will try to allocate memory used by a CPU on the local memory - controller of the CPU and add some more NUMA awareness to the kernel. - This code is recommended on all multiprocessor Opteron systems. - If the system is EM64T, you should say N unless your system is EM64T - NUMA. - config K8_NUMA - bool "Old style AMD Opteron NUMA detection" - depends on NUMA - default y - help - Enable K8 NUMA node topology detection. You should say Y here if - you have a multi processor AMD K8 system. This uses an old - method to read the NUMA configurtion directly from the builtin - Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA - instead, which also takes priority if both are compiled in. - -# Dummy CONFIG option to select ACPI_NUMA from drivers/acpi/Kconfig. - -config X86_64_ACPI_NUMA - bool "ACPI NUMA detection" - depends on NUMA - select ACPI - select ACPI_NUMA - default y + bool "K8 NUMA support" + select NUMA + depends on SMP help - Enable ACPI SRAT based node topology detection. + Enable NUMA (Non Unified Memory Architecture) support for + AMD Opteron Multiprocessor systems. The kernel will try to allocate + memory used by a CPU on the local memory controller of the CPU + and add some more NUMA awareness to the kernel. + This code is recommended on all multiprocessor Opteron systems + and normally doesn't hurt on others. config NUMA_EMU - bool "NUMA emulation" - depends on NUMA + bool "NUMA emulation support" + select NUMA + depends on SMP help Enable NUMA emulation. A flat machine will be split into virtual nodes when booted with "numa=fake=N", where N is the @@ -272,6 +252,9 @@ config ARCH_DISCONTIGMEM_ENABLE depends on NUMA default y +config NUMA + bool + default n config ARCH_DISCONTIGMEM_ENABLE def_bool y @@ -391,14 +374,6 @@ config X86_MCE_INTEL Additional support for intel specific MCE features such as the thermal monitor. -config X86_MCE_AMD - bool "AMD MCE features" - depends on X86_MCE && X86_LOCAL_APIC - default y - help - Additional support for AMD specific MCE features such as - the DRAM Error Threshold. - config PHYSICAL_START hex "Physical address where the kernel is loaded" if EMBEDDED default "0x100000" @@ -527,7 +502,7 @@ config IA32_EMULATION left. config IA32_AOUT - tristate "IA32 a.out support" + bool "IA32 a.out support" depends on IA32_EMULATION help Support old a.out binaries in the 32bit emulation. diff --git a/trunk/arch/x86_64/Kconfig.debug b/trunk/arch/x86_64/Kconfig.debug index e2c6e64a85ec..d584ecc27ea1 100644 --- a/trunk/arch/x86_64/Kconfig.debug +++ b/trunk/arch/x86_64/Kconfig.debug @@ -2,6 +2,15 @@ menu "Kernel hacking" source "lib/Kconfig.debug" +# !SMP for now because the context switch early causes GPF in segment reloading +# and the GS base checking does the wrong thing then, causing a hang. +config CHECKING + bool "Additional run-time checks" + depends on DEBUG_KERNEL && !SMP + help + Enables some internal consistency checks for kernel debugging. + You should normally say N. + config INIT_DEBUG bool "Debug __init statements" depends on DEBUG_KERNEL diff --git a/trunk/arch/x86_64/defconfig b/trunk/arch/x86_64/defconfig index 5d56542fb68f..f8db7e500fbf 100644 --- a/trunk/arch/x86_64/defconfig +++ b/trunk/arch/x86_64/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.14-git7 -# Sat Nov 5 15:55:50 2005 +# Linux kernel version: 2.6.13-git11 +# Mon Sep 12 16:16:16 2005 # CONFIG_X86_64=y CONFIG_64BIT=y @@ -35,7 +35,7 @@ CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y +# CONFIG_HOTPLUG is not set CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y @@ -93,11 +93,10 @@ CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set CONFIG_PREEMPT_BKL=y -CONFIG_NUMA=y CONFIG_K8_NUMA=y -CONFIG_X86_64_ACPI_NUMA=y # CONFIG_NUMA_EMU is not set CONFIG_ARCH_DISCONTIGMEM_ENABLE=y +CONFIG_NUMA=y CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_SELECT_MEMORY_MODEL=y @@ -108,10 +107,9 @@ CONFIG_DISCONTIGMEM=y CONFIG_FLAT_NODE_MEM_MAP=y CONFIG_NEED_MULTIPLE_NODES=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y +CONFIG_HAVE_DEC_LOCK=y CONFIG_NR_CPUS=32 -CONFIG_HOTPLUG_CPU=y CONFIG_HPET_TIMER=y CONFIG_X86_PM_TIMER=y CONFIG_HPET_EMULATE_RTC=y @@ -119,7 +117,6 @@ CONFIG_GART_IOMMU=y CONFIG_SWIOTLB=y CONFIG_X86_MCE=y CONFIG_X86_MCE_INTEL=y -CONFIG_X86_MCE_AMD=y CONFIG_PHYSICAL_START=0x100000 # CONFIG_KEXEC is not set CONFIG_SECCOMP=y @@ -139,15 +136,11 @@ CONFIG_PM=y # CONFIG_PM_DEBUG is not set CONFIG_SOFTWARE_SUSPEND=y CONFIG_PM_STD_PARTITION="" -CONFIG_SUSPEND_SMP=y # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y -CONFIG_ACPI_SLEEP=y -CONFIG_ACPI_SLEEP_PROC_FS=y -CONFIG_ACPI_SLEEP_PROC_SLEEP=y CONFIG_ACPI_AC=y CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y @@ -155,7 +148,6 @@ CONFIG_ACPI_BUTTON=y CONFIG_ACPI_HOTKEY=m CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y -CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_THERMAL=y CONFIG_ACPI_NUMA=y # CONFIG_ACPI_ASUS is not set @@ -166,7 +158,7 @@ CONFIG_ACPI_BLACKLIST_YEAR=2001 CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_SYSTEM=y -CONFIG_ACPI_CONTAINER=y +# CONFIG_ACPI_CONTAINER is not set # # CPU Frequency scaling @@ -301,6 +293,7 @@ CONFIG_IPV6=y # Network testing # # CONFIG_NET_PKTGEN is not set +# CONFIG_NETFILTER_NETLINK is not set # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set @@ -318,11 +311,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set # CONFIG_DEBUG_DRIVER is not set -# -# Connector - unified userspace <-> kernelspace linker -# -# CONFIG_CONNECTOR is not set - # # Memory Technology Devices (MTD) # @@ -366,11 +354,6 @@ CONFIG_IOSCHED_NOOP=y # CONFIG_IOSCHED_AS is not set CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y -# CONFIG_DEFAULT_AS is not set -CONFIG_DEFAULT_DEADLINE=y -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="cfq" # CONFIG_ATA_OVER_ETH is not set # @@ -467,7 +450,6 @@ CONFIG_BLK_DEV_SD=y CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_FC_ATTRS is not set # CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_ATTRS is not set # # SCSI low-level drivers @@ -487,24 +469,20 @@ CONFIG_AIC79XX_DEBUG_MASK=0 # CONFIG_AIC79XX_REG_PRETTY_PRINT is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set CONFIG_SCSI_SATA=y # CONFIG_SCSI_SATA_AHCI is not set # CONFIG_SCSI_SATA_SVW is not set CONFIG_SCSI_ATA_PIIX=y # CONFIG_SCSI_SATA_MV is not set -CONFIG_SCSI_SATA_NV=y -# CONFIG_SCSI_PDC_ADMA is not set -# CONFIG_SCSI_SATA_QSTOR is not set +# CONFIG_SCSI_SATA_NV is not set # CONFIG_SCSI_SATA_PROMISE is not set +# CONFIG_SCSI_SATA_QSTOR is not set # CONFIG_SCSI_SATA_SX4 is not set # CONFIG_SCSI_SATA_SIL is not set -# CONFIG_SCSI_SATA_SIL24 is not set # CONFIG_SCSI_SATA_SIS is not set # CONFIG_SCSI_SATA_ULI is not set CONFIG_SCSI_SATA_VIA=y # CONFIG_SCSI_SATA_VITESSE is not set -CONFIG_SCSI_SATA_INTEL_COMBINED=y # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set @@ -547,7 +525,6 @@ CONFIG_BLK_DEV_DM=y CONFIG_FUSION=y CONFIG_FUSION_SPI=y # CONFIG_FUSION_FC is not set -# CONFIG_FUSION_SAS is not set CONFIG_FUSION_MAX_SGE=128 # CONFIG_FUSION_CTL is not set @@ -587,7 +564,6 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set CONFIG_NET_VENDOR_3COM=y CONFIG_VORTEX=y # CONFIG_TYPHOON is not set @@ -764,43 +740,7 @@ CONFIG_LEGACY_PTY_COUNT=256 # # Watchdog Cards # -CONFIG_WATCHDOG=y -# CONFIG_WATCHDOG_NOWAYOUT is not set - -# -# Watchdog Device Drivers -# -CONFIG_SOFT_WATCHDOG=y -# CONFIG_ACQUIRE_WDT is not set -# CONFIG_ADVANTECH_WDT is not set -# CONFIG_ALIM1535_WDT is not set -# CONFIG_ALIM7101_WDT is not set -# CONFIG_SC520_WDT is not set -# CONFIG_EUROTECH_WDT is not set -# CONFIG_IB700_WDT is not set -# CONFIG_IBMASR is not set -# CONFIG_WAFER_WDT is not set -# CONFIG_I6300ESB_WDT is not set -# CONFIG_I8XX_TCO is not set -# CONFIG_SC1200_WDT is not set -# CONFIG_60XX_WDT is not set -# CONFIG_SBC8360_WDT is not set -# CONFIG_CPU5_WDT is not set -# CONFIG_W83627HF_WDT is not set -# CONFIG_W83877F_WDT is not set -# CONFIG_W83977F_WDT is not set -# CONFIG_MACHZ_WDT is not set - -# -# PCI-based Watchdog Cards -# -# CONFIG_PCIPCWATCHDOG is not set -# CONFIG_WDTPCI is not set - -# -# USB-based Watchdog Cards -# -# CONFIG_USBPCWATCHDOG is not set +# CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=y # CONFIG_NVRAM is not set CONFIG_RTC=y @@ -827,7 +767,6 @@ CONFIG_MAX_RAW_DEVS=256 # TPM devices # # CONFIG_TCG_TPM is not set -# CONFIG_TELCLOCK is not set # # I2C support @@ -844,7 +783,6 @@ CONFIG_MAX_RAW_DEVS=256 # CONFIG_HWMON=y # CONFIG_HWMON_VID is not set -# CONFIG_SENSORS_HDAPS is not set # CONFIG_HWMON_DEBUG_CHIP is not set # @@ -948,15 +886,12 @@ CONFIG_USB_UHCI_HCD=y # USB Device Class drivers # # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set +# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set CONFIG_USB_PRINTER=y # -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# - -# -# may also be needed; see USB_STORAGE Help for more information +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set @@ -989,7 +924,6 @@ CONFIG_USB_HIDINPUT=y # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set # CONFIG_USB_KEYSPAN_REMOTE is not set -# CONFIG_USB_APPLETOUCH is not set # # USB Imaging devices @@ -1071,7 +1005,7 @@ CONFIG_USB_MON=y # # CONFIG_EDD is not set # CONFIG_DELL_RBU is not set -# CONFIG_DCDBAS is not set +CONFIG_DCDBAS=m # # File systems @@ -1103,7 +1037,7 @@ CONFIG_INOTIFY=y # CONFIG_QUOTA is not set CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=y -CONFIG_AUTOFS4_FS=y +# CONFIG_AUTOFS4_FS is not set # CONFIG_FUSE_FS is not set # @@ -1134,7 +1068,7 @@ CONFIG_TMPFS=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y -CONFIG_RELAYFS_FS=y +# CONFIG_RELAYFS_FS is not set # # Miscellaneous filesystems @@ -1252,9 +1186,7 @@ CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_FS=y -# CONFIG_DEBUG_VM is not set # CONFIG_FRAME_POINTER is not set -# CONFIG_RCU_TORTURE_TEST is not set CONFIG_INIT_DEBUG=y # CONFIG_IOMMU_DEBUG is not set CONFIG_KPROBES=y diff --git a/trunk/arch/x86_64/ia32/ia32_aout.c b/trunk/arch/x86_64/ia32/ia32_aout.c index 3bf58af98936..93c60f4aa47a 100644 --- a/trunk/arch/x86_64/ia32/ia32_aout.c +++ b/trunk/arch/x86_64/ia32/ia32_aout.c @@ -36,6 +36,9 @@ #undef WARN_OLD #undef CORE_DUMP /* probably broken */ +extern int ia32_setup_arg_pages(struct linux_binprm *bprm, + unsigned long stack_top, int exec_stack); + static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs); static int load_aout_library(struct file*); diff --git a/trunk/arch/x86_64/ia32/ia32_binfmt.c b/trunk/arch/x86_64/ia32/ia32_binfmt.c index 2b760d0d9ce2..d9161e395978 100644 --- a/trunk/arch/x86_64/ia32/ia32_binfmt.c +++ b/trunk/arch/x86_64/ia32/ia32_binfmt.c @@ -217,7 +217,8 @@ elf_core_copy_task_fpregs(struct task_struct *tsk, struct pt_regs *regs, elf_fpr if (!tsk_used_math(tsk)) return 0; if (!regs) - regs = ((struct pt_regs *)tsk->thread.rsp0) - 1; + regs = (struct pt_regs *)tsk->thread.rsp0; + --regs; if (tsk == current) unlazy_fpu(tsk); set_fs(KERNEL_DS); @@ -334,8 +335,7 @@ static void elf32_init(struct pt_regs *regs) me->thread.es = __USER_DS; } -int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, - int executable_stack) +int setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, int executable_stack) { unsigned long stack_base; struct vm_area_struct *mpnt; @@ -389,7 +389,6 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, return 0; } -EXPORT_SYMBOL(ia32_setup_arg_pages); static unsigned long elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type) diff --git a/trunk/arch/x86_64/kernel/Makefile b/trunk/arch/x86_64/kernel/Makefile index fe4cbd1c4b2f..14328cab5d3a 100644 --- a/trunk/arch/x86_64/kernel/Makefile +++ b/trunk/arch/x86_64/kernel/Makefile @@ -11,7 +11,6 @@ obj-y := process.o signal.o entry.o traps.o irq.o \ obj-$(CONFIG_X86_MCE) += mce.o obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o -obj-$(CONFIG_X86_MCE_AMD) += mce_amd.o obj-$(CONFIG_MTRR) += ../../i386/kernel/cpu/mtrr/ obj-$(CONFIG_ACPI) += acpi/ obj-$(CONFIG_X86_MSR) += msr.o diff --git a/trunk/arch/x86_64/kernel/aperture.c b/trunk/arch/x86_64/kernel/aperture.c index c7f4fdd20f05..962ad4823b6a 100644 --- a/trunk/arch/x86_64/kernel/aperture.c +++ b/trunk/arch/x86_64/kernel/aperture.c @@ -196,7 +196,7 @@ static __u32 __init search_agp_bridge(u32 *order, int *valid_agp) void __init iommu_hole_init(void) { int fix, num; - u32 aper_size, aper_alloc = 0, aper_order = 0, last_aper_order = 0; + u32 aper_size, aper_alloc = 0, aper_order, last_aper_order = 0; u64 aper_base, last_aper_base = 0; int valid_agp = 0; diff --git a/trunk/arch/x86_64/kernel/apic.c b/trunk/arch/x86_64/kernel/apic.c index 18691ce4c759..b6e7715d877f 100644 --- a/trunk/arch/x86_64/kernel/apic.c +++ b/trunk/arch/x86_64/kernel/apic.c @@ -833,16 +833,6 @@ int setup_profiling_timer(unsigned int multiplier) return 0; } -#ifdef CONFIG_X86_MCE_AMD -void setup_threshold_lvt(unsigned long lvt_off) -{ - unsigned int v = 0; - unsigned long reg = (lvt_off << 4) + 0x500; - v |= THRESHOLD_APIC_VECTOR; - apic_write(reg, v); -} -#endif /* CONFIG_X86_MCE_AMD */ - #undef APIC_DIVISOR /* diff --git a/trunk/arch/x86_64/kernel/e820.c b/trunk/arch/x86_64/kernel/e820.c index 17579a1a174b..ab3f87aaff70 100644 --- a/trunk/arch/x86_64/kernel/e820.c +++ b/trunk/arch/x86_64/kernel/e820.c @@ -23,7 +23,8 @@ #include #include #include -#include + +extern char _end[]; /* * PFN of last memory page. diff --git a/trunk/arch/x86_64/kernel/entry.S b/trunk/arch/x86_64/kernel/entry.S index 9ff42041bb6b..7937971d1853 100644 --- a/trunk/arch/x86_64/kernel/entry.S +++ b/trunk/arch/x86_64/kernel/entry.S @@ -612,9 +612,6 @@ retint_kernel: ENTRY(thermal_interrupt) apicinterrupt THERMAL_APIC_VECTOR,smp_thermal_interrupt -ENTRY(threshold_interrupt) - apicinterrupt THRESHOLD_APIC_VECTOR,mce_threshold_interrupt - #ifdef CONFIG_SMP ENTRY(reschedule_interrupt) apicinterrupt RESCHEDULE_VECTOR,smp_reschedule_interrupt diff --git a/trunk/arch/x86_64/kernel/head.S b/trunk/arch/x86_64/kernel/head.S index 15290968e49d..b92e5f45ed46 100644 --- a/trunk/arch/x86_64/kernel/head.S +++ b/trunk/arch/x86_64/kernel/head.S @@ -12,7 +12,6 @@ #include #include -#include #include #include #include @@ -71,7 +70,7 @@ startup_32: movl %eax, %cr4 /* Setup early boot stage 4 level pagetables */ - movl $(boot_level4_pgt - __START_KERNEL_map), %eax + movl $(init_level4_pgt - __START_KERNEL_map), %eax movl %eax, %cr3 /* Setup EFER (Extended Feature Enable Register) */ @@ -114,7 +113,7 @@ startup_64: movq %rax, %cr4 /* Setup early boot stage 4 level pagetables. */ - movq $(boot_level4_pgt - __START_KERNEL_map), %rax + movq $(init_level4_pgt - __START_KERNEL_map), %rax movq %rax, %cr3 /* Check if nx is implemented */ @@ -241,10 +240,20 @@ ljumpvector: ENTRY(stext) ENTRY(_stext) + /* + * This default setting generates an ident mapping at address 0x100000 + * and a mapping for the kernel that precisely maps virtual address + * 0xffffffff80000000 to physical address 0x000000. (always using + * 2Mbyte large pages provided by PAE mode) + */ .org 0x1000 ENTRY(init_level4_pgt) - /* This gets initialized in x86_64_start_kernel */ - .fill 512,8,0 + .quad 0x0000000000002007 + __PHYSICAL_START /* -> level3_ident_pgt */ + .fill 255,8,0 + .quad 0x000000000000a007 + __PHYSICAL_START + .fill 254,8,0 + /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ + .quad 0x0000000000003007 + __PHYSICAL_START /* -> level3_kernel_pgt */ .org 0x2000 ENTRY(level3_ident_pgt) @@ -341,24 +350,6 @@ ENTRY(wakeup_level4_pgt) .quad 0x0000000000003007 + __PHYSICAL_START /* -> level3_kernel_pgt */ #endif -#ifndef CONFIG_HOTPLUG_CPU - __INITDATA -#endif - /* - * This default setting generates an ident mapping at address 0x100000 - * and a mapping for the kernel that precisely maps virtual address - * 0xffffffff80000000 to physical address 0x000000. (always using - * 2Mbyte large pages provided by PAE mode) - */ - .align PAGE_SIZE -ENTRY(boot_level4_pgt) - .quad 0x0000000000002007 + __PHYSICAL_START /* -> level3_ident_pgt */ - .fill 255,8,0 - .quad 0x000000000000a007 + __PHYSICAL_START - .fill 254,8,0 - /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ - .quad 0x0000000000003007 + __PHYSICAL_START /* -> level3_kernel_pgt */ - .data .align 16 diff --git a/trunk/arch/x86_64/kernel/head64.c b/trunk/arch/x86_64/kernel/head64.c index b675c5add01e..cf6ab147a2a5 100644 --- a/trunk/arch/x86_64/kernel/head64.c +++ b/trunk/arch/x86_64/kernel/head64.c @@ -19,15 +19,14 @@ #include #include #include -#include -#include /* Don't add a printk in there. printk relies on the PDA which is not initialized yet. */ static void __init clear_bss(void) { + extern char __bss_start[], __bss_end[]; memset(__bss_start, 0, - (unsigned long) __bss_stop - (unsigned long) __bss_start); + (unsigned long) __bss_end - (unsigned long) __bss_start); } #define NEW_CL_POINTER 0x228 /* Relative to real mode data */ @@ -76,6 +75,8 @@ static void __init setup_boot_cpu_data(void) boot_cpu_data.x86_mask = eax & 0xf; } +extern char _end[]; + void __init x86_64_start_kernel(char * real_mode_data) { char *s; @@ -85,13 +86,6 @@ void __init x86_64_start_kernel(char * real_mode_data) set_intr_gate(i, early_idt_handler); asm volatile("lidt %0" :: "m" (idt_descr)); clear_bss(); - - /* - * switch to init_level4_pgt from boot_level4_pgt - */ - memcpy(init_level4_pgt, boot_level4_pgt, PTRS_PER_PGD*sizeof(pgd_t)); - asm volatile("movq %0,%%cr3" :: "r" (__pa_symbol(&init_level4_pgt))); - pda_init(0); copy_bootdata(real_mode_data); #ifdef CONFIG_SMP diff --git a/trunk/arch/x86_64/kernel/i8259.c b/trunk/arch/x86_64/kernel/i8259.c index 6e5101ad3d1a..c6c9791d77c1 100644 --- a/trunk/arch/x86_64/kernel/i8259.c +++ b/trunk/arch/x86_64/kernel/i8259.c @@ -492,7 +492,6 @@ void invalidate_interrupt5(void); void invalidate_interrupt6(void); void invalidate_interrupt7(void); void thermal_interrupt(void); -void threshold_interrupt(void); void i8254_timer_resume(void); static void setup_timer_hardware(void) @@ -516,7 +515,7 @@ void i8254_timer_resume(void) } static struct sysdev_class timer_sysclass = { - set_kset_name("timer_pit"), + set_kset_name("timer"), .resume = timer_resume, }; @@ -581,7 +580,6 @@ void __init init_IRQ(void) set_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); #endif set_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); - set_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt); #ifdef CONFIG_X86_LOCAL_APIC /* self generated IPI for local APIC timer */ diff --git a/trunk/arch/x86_64/kernel/io_apic.c b/trunk/arch/x86_64/kernel/io_apic.c index 97154ab058b4..c8eee20cd519 100644 --- a/trunk/arch/x86_64/kernel/io_apic.c +++ b/trunk/arch/x86_64/kernel/io_apic.c @@ -57,7 +57,7 @@ int nr_ioapic_registers[MAX_IO_APICS]; * Rough estimation of how many shared IRQs there are, can * be changed anytime. */ -#define MAX_PLUS_SHARED_IRQS NR_IRQ_VECTORS +#define MAX_PLUS_SHARED_IRQS NR_IRQS #define PIN_MAP_SIZE (MAX_PLUS_SHARED_IRQS + NR_IRQS) /* @@ -85,7 +85,6 @@ int vector_irq[NR_VECTORS] __read_mostly = { [0 ... NR_VECTORS - 1] = -1}; int pin; \ struct irq_pin_list *entry = irq_2_pin + irq; \ \ - BUG_ON(irq >= NR_IRQS); \ for (;;) { \ unsigned int reg; \ pin = entry->pin; \ @@ -128,8 +127,6 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) } #endif -static u8 gsi_2_irq[NR_IRQ_VECTORS] = { [0 ... NR_IRQ_VECTORS-1] = 0xFF }; - /* * The common case is 1:1 IRQ<->pin mappings. Sometimes there are * shared ISA-space IRQs, so we have to support them. We are super @@ -140,7 +137,6 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin) static int first_free_entry = NR_IRQS; struct irq_pin_list *entry = irq_2_pin + irq; - BUG_ON(irq >= NR_IRQS); while (entry->next) entry = irq_2_pin + entry->next; @@ -148,7 +144,7 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin) entry->next = first_free_entry; entry = irq_2_pin + entry->next; if (++first_free_entry >= PIN_MAP_SIZE) - panic("io_apic.c: ran out of irq_2_pin entries!"); + panic("io_apic.c: whoops"); } entry->apic = apic; entry->pin = pin; @@ -424,7 +420,6 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin) best_guess = irq; } } - BUG_ON(best_guess >= NR_IRQS); return best_guess; } @@ -615,64 +610,6 @@ static inline int irq_trigger(int idx) return MPBIOS_trigger(idx); } -static int next_irq = 16; - -/* - * gsi_irq_sharing -- Name overload! "irq" can be either a legacy IRQ - * in the range 0-15, a linux IRQ in the range 0-223, or a GSI number - * from ACPI, which can reach 800 in large boxen. - * - * Compact the sparse GSI space into a sequential IRQ series and reuse - * vectors if possible. - */ -int gsi_irq_sharing(int gsi) -{ - int i, tries, vector; - - BUG_ON(gsi >= NR_IRQ_VECTORS); - - if (platform_legacy_irq(gsi)) - return gsi; - - if (gsi_2_irq[gsi] != 0xFF) - return (int)gsi_2_irq[gsi]; - - tries = NR_IRQS; - try_again: - vector = assign_irq_vector(gsi); - - /* - * Sharing vectors means sharing IRQs, so scan irq_vectors for previous - * use of vector and if found, return that IRQ. However, we never want - * to share legacy IRQs, which usually have a different trigger mode - * than PCI. - */ - for (i = 0; i < NR_IRQS; i++) - if (IO_APIC_VECTOR(i) == vector) - break; - if (platform_legacy_irq(i)) { - if (--tries >= 0) { - IO_APIC_VECTOR(i) = 0; - goto try_again; - } - panic("gsi_irq_sharing: didn't find an IRQ using vector 0x%02X for GSI %d", vector, gsi); - } - if (i < NR_IRQS) { - gsi_2_irq[gsi] = i; - printk(KERN_INFO "GSI %d sharing vector 0x%02X and IRQ %d\n", - gsi, vector, i); - return i; - } - - i = next_irq++; - BUG_ON(i >= NR_IRQS); - gsi_2_irq[gsi] = i; - IO_APIC_VECTOR(i) = vector; - printk(KERN_INFO "GSI %d assigned vector 0x%02X and IRQ %d\n", - gsi, vector, i); - return i; -} - static int pin_2_irq(int idx, int apic, int pin) { int irq, i; @@ -702,7 +639,6 @@ static int pin_2_irq(int idx, int apic, int pin) while (i < apic) irq += nr_ioapic_registers[i++]; irq += pin; - irq = gsi_irq_sharing(irq); break; } default: @@ -712,7 +648,6 @@ static int pin_2_irq(int idx, int apic, int pin) break; } } - BUG_ON(irq >= NR_IRQS); /* * PCI IRQ command line redirection. Yes, limits are hardcoded. @@ -728,7 +663,6 @@ static int pin_2_irq(int idx, int apic, int pin) } } } - BUG_ON(irq >= NR_IRQS); return irq; } @@ -756,8 +690,8 @@ int assign_irq_vector(int irq) { static int current_vector = FIRST_DEVICE_VECTOR, offset = 0; - BUG_ON(irq != AUTO_ASSIGN && (unsigned)irq >= NR_IRQ_VECTORS); - if (irq != AUTO_ASSIGN && IO_APIC_VECTOR(irq) > 0) + BUG_ON(irq >= NR_IRQ_VECTORS); + if (IO_APIC_VECTOR(irq) > 0) return IO_APIC_VECTOR(irq); next: current_vector += 8; @@ -765,8 +699,9 @@ int assign_irq_vector(int irq) goto next; if (current_vector >= FIRST_SYSTEM_VECTOR) { - /* If we run out of vectors on large boxen, must share them. */ - offset = (offset + 1) % 8; + offset++; + if (!(offset%8)) + return -ENOSPC; current_vector = FIRST_DEVICE_VECTOR + offset; } @@ -1982,7 +1917,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a entry.polarity = active_high_low; entry.mask = 1; /* Disabled (masked) */ - irq = gsi_irq_sharing(irq); /* * IRQs < 16 are already in the irq_2_pin[] map */ diff --git a/trunk/arch/x86_64/kernel/kprobes.c b/trunk/arch/x86_64/kernel/kprobes.c index afe11f4fbd1d..dddeb678b440 100644 --- a/trunk/arch/x86_64/kernel/kprobes.c +++ b/trunk/arch/x86_64/kernel/kprobes.c @@ -329,7 +329,7 @@ int __kprobes kprobe_handler(struct pt_regs *regs) */ save_previous_kprobe(kcb); set_current_kprobe(p, regs, kcb); - kprobes_inc_nmissed_count(p); + p->nmissed++; prepare_singlestep(p, regs); kcb->kprobe_status = KPROBE_REENTER; return 1; diff --git a/trunk/arch/x86_64/kernel/mce.c b/trunk/arch/x86_64/kernel/mce.c index 183dc6105429..69541db5ff2c 100644 --- a/trunk/arch/x86_64/kernel/mce.c +++ b/trunk/arch/x86_64/kernel/mce.c @@ -37,7 +37,7 @@ static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL }; static unsigned long console_logged; static int notify_user; static int rip_msr; -static int mce_bootlog = 1; +static int mce_bootlog; /* * Lockless MCE logging infrastructure. @@ -347,11 +347,7 @@ static void __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c) /* disable GART TBL walk error reporting, which trips off incorrectly with the IOMMU & 3ware & Cerberus. */ clear_bit(10, &bank[4]); - /* Lots of broken BIOS around that don't clear them - by default and leave crap in there. Don't log. */ - mce_bootlog = 0; } - } static void __cpuinit mce_cpu_features(struct cpuinfo_x86 *c) @@ -360,9 +356,6 @@ static void __cpuinit mce_cpu_features(struct cpuinfo_x86 *c) case X86_VENDOR_INTEL: mce_intel_feature_init(c); break; - case X86_VENDOR_AMD: - mce_amd_feature_init(c); - break; default: break; } @@ -502,16 +495,16 @@ static int __init mcheck_disable(char *str) /* mce=off disables machine check. Note you can reenable it later using sysfs. mce=TOLERANCELEVEL (number, see above) - mce=bootlog Log MCEs from before booting. Disabled by default on AMD. - mce=nobootlog Don't log MCEs from before booting. */ + mce=bootlog Log MCEs from before booting. Disabled by default to work + around buggy BIOS that leave bogus MCEs. */ static int __init mcheck_enable(char *str) { if (*str == '=') str++; if (!strcmp(str, "off")) mce_dont_init = 1; - else if (!strcmp(str, "bootlog") || !strcmp(str,"nobootlog")) - mce_bootlog = str[0] == 'b'; + else if (!strcmp(str, "bootlog")) + mce_bootlog = 1; else if (isdigit(str[0])) get_option(&str, &tolerant); else diff --git a/trunk/arch/x86_64/kernel/mce_amd.c b/trunk/arch/x86_64/kernel/mce_amd.c deleted file mode 100644 index 1f76175ace02..000000000000 --- a/trunk/arch/x86_64/kernel/mce_amd.c +++ /dev/null @@ -1,538 +0,0 @@ -/* - * (c) 2005 Advanced Micro Devices, Inc. - * Your use of this code is subject to the terms and conditions of the - * GNU general public license version 2. See "COPYING" or - * http://www.gnu.org/licenses/gpl.html - * - * Written by Jacob Shin - AMD, Inc. - * - * Support : jacob.shin@amd.com - * - * MC4_MISC0 DRAM ECC Error Threshold available under AMD K8 Rev F. - * MC4_MISC0 exists per physical processor. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define PFX "mce_threshold: " -#define VERSION "version 1.00.9" -#define NR_BANKS 5 -#define THRESHOLD_MAX 0xFFF -#define INT_TYPE_APIC 0x00020000 -#define MASK_VALID_HI 0x80000000 -#define MASK_LVTOFF_HI 0x00F00000 -#define MASK_COUNT_EN_HI 0x00080000 -#define MASK_INT_TYPE_HI 0x00060000 -#define MASK_OVERFLOW_HI 0x00010000 -#define MASK_ERR_COUNT_HI 0x00000FFF -#define MASK_OVERFLOW 0x0001000000000000L - -struct threshold_bank { - unsigned int cpu; - u8 bank; - u8 interrupt_enable; - u16 threshold_limit; - struct kobject kobj; -}; - -static struct threshold_bank threshold_defaults = { - .interrupt_enable = 0, - .threshold_limit = THRESHOLD_MAX, -}; - -#ifdef CONFIG_SMP -static unsigned char shared_bank[NR_BANKS] = { - 0, 0, 0, 0, 1 -}; -#endif - -static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */ - -/* - * CPU Initialization - */ - -/* must be called with correct cpu affinity */ -static void threshold_restart_bank(struct threshold_bank *b, - int reset, u16 old_limit) -{ - u32 mci_misc_hi, mci_misc_lo; - - rdmsr(MSR_IA32_MC0_MISC + b->bank * 4, mci_misc_lo, mci_misc_hi); - - if (b->threshold_limit < (mci_misc_hi & THRESHOLD_MAX)) - reset = 1; /* limit cannot be lower than err count */ - - if (reset) { /* reset err count and overflow bit */ - mci_misc_hi = - (mci_misc_hi & ~(MASK_ERR_COUNT_HI | MASK_OVERFLOW_HI)) | - (THRESHOLD_MAX - b->threshold_limit); - } else if (old_limit) { /* change limit w/o reset */ - int new_count = (mci_misc_hi & THRESHOLD_MAX) + - (old_limit - b->threshold_limit); - mci_misc_hi = (mci_misc_hi & ~MASK_ERR_COUNT_HI) | - (new_count & THRESHOLD_MAX); - } - - b->interrupt_enable ? - (mci_misc_hi = (mci_misc_hi & ~MASK_INT_TYPE_HI) | INT_TYPE_APIC) : - (mci_misc_hi &= ~MASK_INT_TYPE_HI); - - mci_misc_hi |= MASK_COUNT_EN_HI; - wrmsr(MSR_IA32_MC0_MISC + b->bank * 4, mci_misc_lo, mci_misc_hi); -} - -void __cpuinit mce_amd_feature_init(struct cpuinfo_x86 *c) -{ - int bank; - u32 mci_misc_lo, mci_misc_hi; - unsigned int cpu = smp_processor_id(); - - for (bank = 0; bank < NR_BANKS; ++bank) { - rdmsr(MSR_IA32_MC0_MISC + bank * 4, mci_misc_lo, mci_misc_hi); - - /* !valid, !counter present, bios locked */ - if (!(mci_misc_hi & MASK_VALID_HI) || - !(mci_misc_hi & MASK_VALID_HI >> 1) || - (mci_misc_hi & MASK_VALID_HI >> 2)) - continue; - - per_cpu(bank_map, cpu) |= (1 << bank); - -#ifdef CONFIG_SMP - if (shared_bank[bank] && cpu_core_id[cpu]) - continue; -#endif - - setup_threshold_lvt((mci_misc_hi & MASK_LVTOFF_HI) >> 20); - threshold_defaults.cpu = cpu; - threshold_defaults.bank = bank; - threshold_restart_bank(&threshold_defaults, 0, 0); - } -} - -/* - * APIC Interrupt Handler - */ - -/* - * threshold interrupt handler will service THRESHOLD_APIC_VECTOR. - * the interrupt goes off when error_count reaches threshold_limit. - * the handler will simply log mcelog w/ software defined bank number. - */ -asmlinkage void mce_threshold_interrupt(void) -{ - int bank; - struct mce m; - - ack_APIC_irq(); - irq_enter(); - - memset(&m, 0, sizeof(m)); - rdtscll(m.tsc); - m.cpu = smp_processor_id(); - - /* assume first bank caused it */ - for (bank = 0; bank < NR_BANKS; ++bank) { - m.bank = MCE_THRESHOLD_BASE + bank; - rdmsrl(MSR_IA32_MC0_MISC + bank * 4, m.misc); - - if (m.misc & MASK_OVERFLOW) { - mce_log(&m); - goto out; - } - } - out: - irq_exit(); -} - -/* - * Sysfs Interface - */ - -static struct sysdev_class threshold_sysclass = { - set_kset_name("threshold"), -}; - -static DEFINE_PER_CPU(struct sys_device, device_threshold); - -struct threshold_attr { - struct attribute attr; - ssize_t(*show) (struct threshold_bank *, char *); - ssize_t(*store) (struct threshold_bank *, const char *, size_t count); -}; - -static DEFINE_PER_CPU(struct threshold_bank *, threshold_banks[NR_BANKS]); - -static cpumask_t affinity_set(unsigned int cpu) -{ - cpumask_t oldmask = current->cpus_allowed; - cpumask_t newmask = CPU_MASK_NONE; - cpu_set(cpu, newmask); - set_cpus_allowed(current, newmask); - return oldmask; -} - -static void affinity_restore(cpumask_t oldmask) -{ - set_cpus_allowed(current, oldmask); -} - -#define SHOW_FIELDS(name) \ - static ssize_t show_ ## name(struct threshold_bank * b, char *buf) \ - { \ - return sprintf(buf, "%lx\n", (unsigned long) b->name); \ - } -SHOW_FIELDS(interrupt_enable) -SHOW_FIELDS(threshold_limit) - -static ssize_t store_interrupt_enable(struct threshold_bank *b, - const char *buf, size_t count) -{ - char *end; - cpumask_t oldmask; - unsigned long new = simple_strtoul(buf, &end, 0); - if (end == buf) - return -EINVAL; - b->interrupt_enable = !!new; - - oldmask = affinity_set(b->cpu); - threshold_restart_bank(b, 0, 0); - affinity_restore(oldmask); - - return end - buf; -} - -static ssize_t store_threshold_limit(struct threshold_bank *b, - const char *buf, size_t count) -{ - char *end; - cpumask_t oldmask; - u16 old; - unsigned long new = simple_strtoul(buf, &end, 0); - if (end == buf) - return -EINVAL; - if (new > THRESHOLD_MAX) - new = THRESHOLD_MAX; - if (new < 1) - new = 1; - old = b->threshold_limit; - b->threshold_limit = new; - - oldmask = affinity_set(b->cpu); - threshold_restart_bank(b, 0, old); - affinity_restore(oldmask); - - return end - buf; -} - -static ssize_t show_error_count(struct threshold_bank *b, char *buf) -{ - u32 high, low; - cpumask_t oldmask; - oldmask = affinity_set(b->cpu); - rdmsr(MSR_IA32_MC0_MISC + b->bank * 4, low, high); /* ignore low 32 */ - affinity_restore(oldmask); - return sprintf(buf, "%x\n", - (high & 0xFFF) - (THRESHOLD_MAX - b->threshold_limit)); -} - -static ssize_t store_error_count(struct threshold_bank *b, - const char *buf, size_t count) -{ - cpumask_t oldmask; - oldmask = affinity_set(b->cpu); - threshold_restart_bank(b, 1, 0); - affinity_restore(oldmask); - return 1; -} - -#define THRESHOLD_ATTR(_name,_mode,_show,_store) { \ - .attr = {.name = __stringify(_name), .mode = _mode }, \ - .show = _show, \ - .store = _store, \ -}; - -#define ATTR_FIELDS(name) \ - static struct threshold_attr name = \ - THRESHOLD_ATTR(name, 0644, show_## name, store_## name) - -ATTR_FIELDS(interrupt_enable); -ATTR_FIELDS(threshold_limit); -ATTR_FIELDS(error_count); - -static struct attribute *default_attrs[] = { - &interrupt_enable.attr, - &threshold_limit.attr, - &error_count.attr, - NULL -}; - -#define to_bank(k) container_of(k,struct threshold_bank,kobj) -#define to_attr(a) container_of(a,struct threshold_attr,attr) - -static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf) -{ - struct threshold_bank *b = to_bank(kobj); - struct threshold_attr *a = to_attr(attr); - ssize_t ret; - ret = a->show ? a->show(b, buf) : -EIO; - return ret; -} - -static ssize_t store(struct kobject *kobj, struct attribute *attr, - const char *buf, size_t count) -{ - struct threshold_bank *b = to_bank(kobj); - struct threshold_attr *a = to_attr(attr); - ssize_t ret; - ret = a->store ? a->store(b, buf, count) : -EIO; - return ret; -} - -static struct sysfs_ops threshold_ops = { - .show = show, - .store = store, -}; - -static struct kobj_type threshold_ktype = { - .sysfs_ops = &threshold_ops, - .default_attrs = default_attrs, -}; - -/* symlinks sibling shared banks to first core. first core owns dir/files. */ -static __cpuinit int threshold_create_bank(unsigned int cpu, int bank) -{ - int err = 0; - struct threshold_bank *b = 0; - -#ifdef CONFIG_SMP - if (cpu_core_id[cpu] && shared_bank[bank]) { /* symlink */ - char name[16]; - unsigned lcpu = first_cpu(cpu_core_map[cpu]); - if (cpu_core_id[lcpu]) - goto out; /* first core not up yet */ - - b = per_cpu(threshold_banks, lcpu)[bank]; - if (!b) - goto out; - sprintf(name, "bank%i", bank); - err = sysfs_create_link(&per_cpu(device_threshold, cpu).kobj, - &b->kobj, name); - if (err) - goto out; - per_cpu(threshold_banks, cpu)[bank] = b; - goto out; - } -#endif - - b = kmalloc(sizeof(struct threshold_bank), GFP_KERNEL); - if (!b) { - err = -ENOMEM; - goto out; - } - memset(b, 0, sizeof(struct threshold_bank)); - - b->cpu = cpu; - b->bank = bank; - b->interrupt_enable = 0; - b->threshold_limit = THRESHOLD_MAX; - kobject_set_name(&b->kobj, "bank%i", bank); - b->kobj.parent = &per_cpu(device_threshold, cpu).kobj; - b->kobj.ktype = &threshold_ktype; - - err = kobject_register(&b->kobj); - if (err) { - kfree(b); - goto out; - } - per_cpu(threshold_banks, cpu)[bank] = b; - out: - return err; -} - -/* create dir/files for all valid threshold banks */ -static __cpuinit int threshold_create_device(unsigned int cpu) -{ - int bank; - int err = 0; - - per_cpu(device_threshold, cpu).id = cpu; - per_cpu(device_threshold, cpu).cls = &threshold_sysclass; - err = sysdev_register(&per_cpu(device_threshold, cpu)); - if (err) - goto out; - - for (bank = 0; bank < NR_BANKS; ++bank) { - if (!(per_cpu(bank_map, cpu) & 1 << bank)) - continue; - err = threshold_create_bank(cpu, bank); - if (err) - goto out; - } - out: - return err; -} - -#ifdef CONFIG_HOTPLUG_CPU -/* - * let's be hotplug friendly. - * in case of multiple core processors, the first core always takes ownership - * of shared sysfs dir/files, and rest of the cores will be symlinked to it. - */ - -/* cpu hotplug call removes all symlinks before first core dies */ -static __cpuinit void threshold_remove_bank(unsigned int cpu, int bank) -{ - struct threshold_bank *b; - char name[16]; - - b = per_cpu(threshold_banks, cpu)[bank]; - if (!b) - return; - if (shared_bank[bank] && atomic_read(&b->kobj.kref.refcount) > 2) { - sprintf(name, "bank%i", bank); - sysfs_remove_link(&per_cpu(device_threshold, cpu).kobj, name); - per_cpu(threshold_banks, cpu)[bank] = 0; - } else { - kobject_unregister(&b->kobj); - kfree(per_cpu(threshold_banks, cpu)[bank]); - } -} - -static __cpuinit void threshold_remove_device(unsigned int cpu) -{ - int bank; - - for (bank = 0; bank < NR_BANKS; ++bank) { - if (!(per_cpu(bank_map, cpu) & 1 << bank)) - continue; - threshold_remove_bank(cpu, bank); - } - sysdev_unregister(&per_cpu(device_threshold, cpu)); -} - -/* link all existing siblings when first core comes up */ -static __cpuinit int threshold_create_symlinks(unsigned int cpu) -{ - int bank, err = 0; - unsigned int lcpu = 0; - - if (cpu_core_id[cpu]) - return 0; - for_each_cpu_mask(lcpu, cpu_core_map[cpu]) { - if (lcpu == cpu) - continue; - for (bank = 0; bank < NR_BANKS; ++bank) { - if (!(per_cpu(bank_map, cpu) & 1 << bank)) - continue; - if (!shared_bank[bank]) - continue; - err = threshold_create_bank(lcpu, bank); - } - } - return err; -} - -/* remove all symlinks before first core dies. */ -static __cpuinit void threshold_remove_symlinks(unsigned int cpu) -{ - int bank; - unsigned int lcpu = 0; - if (cpu_core_id[cpu]) - return; - for_each_cpu_mask(lcpu, cpu_core_map[cpu]) { - if (lcpu == cpu) - continue; - for (bank = 0; bank < NR_BANKS; ++bank) { - if (!(per_cpu(bank_map, cpu) & 1 << bank)) - continue; - if (!shared_bank[bank]) - continue; - threshold_remove_bank(lcpu, bank); - } - } -} -#else /* !CONFIG_HOTPLUG_CPU */ -static __cpuinit void threshold_create_symlinks(unsigned int cpu) -{ -} -static __cpuinit void threshold_remove_symlinks(unsigned int cpu) -{ -} -static void threshold_remove_device(unsigned int cpu) -{ -} -#endif - -/* get notified when a cpu comes on/off */ -static __cpuinit int threshold_cpu_callback(struct notifier_block *nfb, - unsigned long action, void *hcpu) -{ - /* cpu was unsigned int to begin with */ - unsigned int cpu = (unsigned long)hcpu; - - if (cpu >= NR_CPUS) - goto out; - - switch (action) { - case CPU_ONLINE: - threshold_create_device(cpu); - threshold_create_symlinks(cpu); - break; - case CPU_DOWN_PREPARE: - threshold_remove_symlinks(cpu); - break; - case CPU_DOWN_FAILED: - threshold_create_symlinks(cpu); - break; - case CPU_DEAD: - threshold_remove_device(cpu); - break; - default: - break; - } - out: - return NOTIFY_OK; -} - -static struct notifier_block threshold_cpu_notifier = { - .notifier_call = threshold_cpu_callback, -}; - -static __init int threshold_init_device(void) -{ - int err; - int lcpu = 0; - - err = sysdev_class_register(&threshold_sysclass); - if (err) - goto out; - - /* to hit CPUs online before the notifier is up */ - for_each_online_cpu(lcpu) { - err = threshold_create_device(lcpu); - if (err) - goto out; - } - register_cpu_notifier(&threshold_cpu_notifier); - - out: - return err; -} - -device_initcall(threshold_init_device); diff --git a/trunk/arch/x86_64/kernel/mpparse.c b/trunk/arch/x86_64/kernel/mpparse.c index 1105250bf02c..f16d38d09daf 100644 --- a/trunk/arch/x86_64/kernel/mpparse.c +++ b/trunk/arch/x86_64/kernel/mpparse.c @@ -42,7 +42,7 @@ int acpi_found_madt; * Various Linux-internal data structures created from the * MP-table. */ -unsigned char apic_version [MAX_APICS]; +int apic_version [MAX_APICS]; unsigned char mp_bus_id_to_type [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 }; int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 }; @@ -65,9 +65,7 @@ unsigned long mp_lapic_addr = 0; /* Processor that is doing the boot up */ unsigned int boot_cpu_id = -1U; /* Internal processor count */ -unsigned int num_processors __initdata = 0; - -unsigned disabled_cpus __initdata; +static unsigned int num_processors = 0; /* Bitmask of physically existing CPUs */ physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE; @@ -108,14 +106,11 @@ static int __init mpf_checksum(unsigned char *mp, int len) static void __init MP_processor_info (struct mpc_config_processor *m) { - int cpu; - unsigned char ver; + int ver, cpu; static int found_bsp=0; - if (!(m->mpc_cpuflag & CPU_ENABLED)) { - disabled_cpus++; + if (!(m->mpc_cpuflag & CPU_ENABLED)) return; - } printk(KERN_INFO "Processor #%d %d:%d APIC version %d\n", m->mpc_apicid, @@ -134,14 +129,12 @@ static void __init MP_processor_info (struct mpc_config_processor *m) } cpu = num_processors++; - -#if MAX_APICS < 255 - if ((int)m->mpc_apicid > MAX_APICS) { + + if (m->mpc_apicid > MAX_APICS) { printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n", m->mpc_apicid, MAX_APICS); return; } -#endif ver = m->mpc_apicver; physid_set(m->mpc_apicid, phys_cpu_present_map); @@ -225,7 +218,7 @@ static void __init MP_intsrc_info (struct mpc_config_intsrc *m) m->mpc_irqtype, m->mpc_irqflag & 3, (m->mpc_irqflag >> 2) & 3, m->mpc_srcbus, m->mpc_srcbusirq, m->mpc_dstapic, m->mpc_dstirq); - if (++mp_irq_entries >= MAX_IRQ_SOURCES) + if (++mp_irq_entries == MAX_IRQ_SOURCES) panic("Max # of irq sources exceeded!!\n"); } @@ -556,7 +549,7 @@ void __init get_smp_config (void) * Read the physical hardware table. Anything here will * override the defaults. */ - if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr))) { + if (!smp_read_mpc((void *)(unsigned long)mpf->mpf_physptr)) { smp_found_config = 0; printk(KERN_ERR "BIOS bug, MP table errors detected!...\n"); printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n"); diff --git a/trunk/arch/x86_64/kernel/pci-gart.c b/trunk/arch/x86_64/kernel/pci-gart.c index 2e28e855ec3c..88be97c96987 100644 --- a/trunk/arch/x86_64/kernel/pci-gart.c +++ b/trunk/arch/x86_64/kernel/pci-gart.c @@ -220,12 +220,6 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, uses the normal dma_mask for alloc_coherent. */ dma_mask &= *dev->dma_mask; - /* Why <=? Even when the mask is smaller than 4GB it is often larger - than 16MB and in this case we have a chance of finding fitting memory - in the next higher zone first. If not retry with true GFP_DMA. -AK */ - if (dma_mask <= 0xffffffff) - gfp |= GFP_DMA32; - again: memory = dma_alloc_pages(dev, gfp, get_order(size)); if (memory == NULL) @@ -251,7 +245,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, } if (!(gfp & GFP_DMA)) { - gfp = (gfp & ~GFP_DMA32) | GFP_DMA; + gfp |= GFP_DMA; goto again; } return NULL; diff --git a/trunk/arch/x86_64/kernel/process.c b/trunk/arch/x86_64/kernel/process.c index 7519fc520eb3..59be85d9a4bc 100644 --- a/trunk/arch/x86_64/kernel/process.c +++ b/trunk/arch/x86_64/kernel/process.c @@ -144,8 +144,7 @@ void cpu_idle_wait(void) do { ssleep(1); for_each_online_cpu(cpu) { - if (cpu_isset(cpu, map) && - !per_cpu(cpu_idle_state, cpu)) + if (cpu_isset(cpu, map) && !per_cpu(cpu_idle_state, cpu)) cpu_clear(cpu, map); } cpus_and(map, map, cpu_online_map); @@ -276,8 +275,7 @@ void __show_regs(struct pt_regs * regs) system_utsname.version); printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip); printk_address(regs->rip); - printk("\nRSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->rsp, - regs->eflags); + printk("\nRSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->rsp, regs->eflags); printk("RAX: %016lx RBX: %016lx RCX: %016lx\n", regs->rax, regs->rbx, regs->rcx); printk("RDX: %016lx RSI: %016lx RDI: %016lx\n", @@ -351,6 +349,13 @@ void flush_thread(void) struct task_struct *tsk = current; struct thread_info *t = current_thread_info(); + /* + * Remove function-return probe instances associated with this task + * and put them back on the free list. Do not insert an exit probe for + * this function, it will be disabled by kprobe_flush_task if you do. + */ + kprobe_flush_task(tsk); + if (t->flags & _TIF_ABI_PENDING) t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32); @@ -422,14 +427,15 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp, struct pt_regs * childregs; struct task_struct *me = current; - childregs = ((struct pt_regs *) - (THREAD_SIZE + (unsigned long) p->thread_info)) - 1; + childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1; + *childregs = *regs; childregs->rax = 0; childregs->rsp = rsp; - if (rsp == ~0UL) + if (rsp == ~0UL) { childregs->rsp = (unsigned long)childregs; + } p->thread.rsp = (unsigned long) childregs; p->thread.rsp0 = (unsigned long) (childregs+1); @@ -451,8 +457,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp, p->thread.io_bitmap_max = 0; return -ENOMEM; } - memcpy(p->thread.io_bitmap_ptr, me->thread.io_bitmap_ptr, - IO_BITMAP_BYTES); + memcpy(p->thread.io_bitmap_ptr, me->thread.io_bitmap_ptr, IO_BITMAP_BYTES); } /* @@ -489,8 +494,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp, * - fold all the options into a flag word and test it with a single test. * - could test fs/gs bitsliced */ -struct task_struct * -__switch_to(struct task_struct *prev_p, struct task_struct *next_p) +struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *next_p) { struct thread_struct *prev = &prev_p->thread, *next = &next_p->thread; @@ -561,8 +565,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) prev->userrsp = read_pda(oldrsp); write_pda(oldrsp, next->userrsp); write_pda(pcurrent, next_p); - write_pda(kernelstack, - (unsigned long)next_p->thread_info + THREAD_SIZE - PDA_STACKOFFSET); + write_pda(kernelstack, (unsigned long)next_p->thread_info + THREAD_SIZE - PDA_STACKOFFSET); /* * Now maybe reload the debug registers @@ -643,9 +646,7 @@ asmlinkage long sys_fork(struct pt_regs *regs) return do_fork(SIGCHLD, regs->rsp, regs, 0, NULL, NULL); } -asmlinkage long -sys_clone(unsigned long clone_flags, unsigned long newsp, - void __user *parent_tid, void __user *child_tid, struct pt_regs *regs) +asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp, void __user *parent_tid, void __user *child_tid, struct pt_regs *regs) { if (!newsp) newsp = regs->rsp; @@ -681,8 +682,7 @@ unsigned long get_wchan(struct task_struct *p) return 0; fp = *(u64 *)(p->thread.rsp); do { - if (fp < (unsigned long)stack || - fp > (unsigned long)stack+THREAD_SIZE) + if (fp < (unsigned long)stack || fp > (unsigned long)stack+THREAD_SIZE) return 0; rip = *(u64 *)(fp+8); if (!in_sched_functions(rip)) @@ -717,8 +717,8 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) task->thread.gsindex = 0; task->thread.gs = addr; if (doit) { - load_gs_index(0); - ret = checking_wrmsrl(MSR_KERNEL_GS_BASE, addr); + load_gs_index(0); + ret = checking_wrmsrl(MSR_KERNEL_GS_BASE, addr); } } put_cpu(); @@ -735,7 +735,7 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) set_32bit_tls(task, FS_TLS, addr); if (doit) { load_TLS(&task->thread, cpu); - asm volatile("movl %0,%%fs" :: "r"(FS_TLS_SEL)); + asm volatile("movl %0,%%fs" :: "r" (FS_TLS_SEL)); } task->thread.fsindex = FS_TLS_SEL; task->thread.fs = 0; @@ -745,8 +745,8 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) if (doit) { /* set the selector to 0 to not confuse __switch_to */ - asm volatile("movl %0,%%fs" :: "r" (0)); - ret = checking_wrmsrl(MSR_FS_BASE, addr); + asm volatile("movl %0,%%fs" :: "r" (0)); + ret = checking_wrmsrl(MSR_FS_BASE, addr); } } put_cpu(); @@ -755,9 +755,9 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) unsigned long base; if (task->thread.fsindex == FS_TLS_SEL) base = read_32bit_tls(task, FS_TLS); - else if (doit) + else if (doit) { rdmsrl(MSR_FS_BASE, base); - else + } else base = task->thread.fs; ret = put_user(base, (unsigned long __user *)addr); break; @@ -766,9 +766,9 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) unsigned long base; if (task->thread.gsindex == GS_TLS_SEL) base = read_32bit_tls(task, GS_TLS); - else if (doit) + else if (doit) { rdmsrl(MSR_KERNEL_GS_BASE, base); - else + } else base = task->thread.gs; ret = put_user(base, (unsigned long __user *)addr); break; diff --git a/trunk/arch/x86_64/kernel/reboot.c b/trunk/arch/x86_64/kernel/reboot.c index 75235ed2b31b..47f95687905f 100644 --- a/trunk/arch/x86_64/kernel/reboot.c +++ b/trunk/arch/x86_64/kernel/reboot.c @@ -77,7 +77,6 @@ static inline void kb_wait(void) void machine_shutdown(void) { - unsigned long flags; /* Stop the cpus and apics */ #ifdef CONFIG_SMP int reboot_cpu_id; @@ -99,7 +98,7 @@ void machine_shutdown(void) smp_send_stop(); #endif - local_irq_save(flags); + local_irq_disable(); #ifndef CONFIG_SMP disable_local_APIC(); @@ -107,7 +106,7 @@ void machine_shutdown(void) disable_IO_APIC(); - local_irq_restore(flags); + local_irq_enable(); } void machine_emergency_restart(void) @@ -121,7 +120,7 @@ void machine_emergency_restart(void) /* Could also try the reset bit in the Hammer NB */ switch (reboot_type) { case BOOT_KBD: - for (i=0; i<10; i++) { + for (i=0; i<100; i++) { kb_wait(); udelay(50); outb(0xfe,0x64); /* pulse reset low */ diff --git a/trunk/arch/x86_64/kernel/setup.c b/trunk/arch/x86_64/kernel/setup.c index 64c4534b930c..da0bc3e7bdf5 100644 --- a/trunk/arch/x86_64/kernel/setup.c +++ b/trunk/arch/x86_64/kernel/setup.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include @@ -61,7 +60,6 @@ #include #include #include -#include /* * Machine setup.. @@ -105,6 +103,7 @@ struct edid_info edid_info; struct e820map e820; extern int root_mountflags; +extern char _text, _etext, _edata, _end; char command_line[COMMAND_LINE_SIZE]; @@ -413,6 +412,7 @@ contig_initmem_init(unsigned long start_pfn, unsigned long end_pfn) { unsigned long bootmap_size, bootmap; + memory_present(0, start_pfn, end_pfn); bootmap_size = bootmem_bootmap_pages(end_pfn)<x86_max_cores) + while ((1 << bits) < c->x86_num_cores) bits++; /* Low order bits define the core id (index of core in socket) */ @@ -823,10 +823,10 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c) if (!node_online(node)) node = nearby_node(apicid); } - numa_set_node(cpu, node); + cpu_to_node[cpu] = node; printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n", - cpu, c->x86_max_cores, node, cpu_core_id[cpu]); + cpu, c->x86_num_cores, node, cpu_core_id[cpu]); #endif #endif } @@ -875,9 +875,9 @@ static int __init init_amd(struct cpuinfo_x86 *c) display_cacheinfo(c); if (c->extended_cpuid_level >= 0x80000008) { - c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; - if (c->x86_max_cores & (c->x86_max_cores - 1)) - c->x86_max_cores = 1; + c->x86_num_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; + if (c->x86_num_cores & (c->x86_num_cores - 1)) + c->x86_num_cores = 1; amd_detect_cmp(c); } @@ -889,44 +889,54 @@ static void __cpuinit detect_ht(struct cpuinfo_x86 *c) { #ifdef CONFIG_SMP u32 eax, ebx, ecx, edx; - int index_msb, core_bits; + int index_msb, tmp; int cpu = smp_processor_id(); - - cpuid(1, &eax, &ebx, &ecx, &edx); - - c->apicid = phys_pkg_id(0); - + if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY)) return; + cpuid(1, &eax, &ebx, &ecx, &edx); smp_num_siblings = (ebx & 0xff0000) >> 16; - + if (smp_num_siblings == 1) { printk(KERN_INFO "CPU: Hyper-Threading is disabled\n"); - } else if (smp_num_siblings > 1 ) { - + } else if (smp_num_siblings > 1) { + index_msb = 31; + /* + * At this point we only support two siblings per + * processor package. + */ if (smp_num_siblings > NR_CPUS) { printk(KERN_WARNING "CPU: Unsupported number of the siblings %d", smp_num_siblings); smp_num_siblings = 1; return; } - - index_msb = get_count_order(smp_num_siblings); + tmp = smp_num_siblings; + while ((tmp & 0x80000000 ) == 0) { + tmp <<=1 ; + index_msb--; + } + if (smp_num_siblings & (smp_num_siblings - 1)) + index_msb++; phys_proc_id[cpu] = phys_pkg_id(index_msb); - + printk(KERN_INFO "CPU: Physical Processor ID: %d\n", phys_proc_id[cpu]); - smp_num_siblings = smp_num_siblings / c->x86_max_cores; - - index_msb = get_count_order(smp_num_siblings) ; + smp_num_siblings = smp_num_siblings / c->x86_num_cores; - core_bits = get_count_order(c->x86_max_cores); + tmp = smp_num_siblings; + index_msb = 31; + while ((tmp & 0x80000000) == 0) { + tmp <<=1 ; + index_msb--; + } + if (smp_num_siblings & (smp_num_siblings - 1)) + index_msb++; - cpu_core_id[cpu] = phys_pkg_id(index_msb) & - ((1 << core_bits) - 1); + cpu_core_id[cpu] = phys_pkg_id(index_msb); - if (c->x86_max_cores > 1) + if (c->x86_num_cores > 1) printk(KERN_INFO "CPU: Processor Core ID: %d\n", cpu_core_id[cpu]); } @@ -965,7 +975,7 @@ static void srat_detect_node(void) node = apicid_to_node[hard_smp_processor_id()]; if (node == NUMA_NO_NODE) node = 0; - numa_set_node(cpu, node); + cpu_to_node[cpu] = node; if (acpi_numa > 0) printk(KERN_INFO "CPU %d -> Node %d\n", cpu, node); @@ -983,18 +993,13 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) unsigned eax = cpuid_eax(0x80000008); c->x86_virt_bits = (eax >> 8) & 0xff; c->x86_phys_bits = eax & 0xff; - /* CPUID workaround for Intel 0F34 CPU */ - if (c->x86_vendor == X86_VENDOR_INTEL && - c->x86 == 0xF && c->x86_model == 0x3 && - c->x86_mask == 0x4) - c->x86_phys_bits = 36; } if (c->x86 == 15) c->x86_cache_alignment = c->x86_clflush_size * 2; if (c->x86 >= 15) set_bit(X86_FEATURE_CONSTANT_TSC, &c->x86_capability); - c->x86_max_cores = intel_num_cpu_cores(c); + c->x86_num_cores = intel_num_cpu_cores(c); srat_detect_node(); } @@ -1032,7 +1037,7 @@ void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c) c->x86_model_id[0] = '\0'; /* Unset */ c->x86_clflush_size = 64; c->x86_cache_alignment = c->x86_clflush_size; - c->x86_max_cores = 1; + c->x86_num_cores = 1; c->extended_cpuid_level = 0; memset(&c->x86_capability, 0, sizeof c->x86_capability); @@ -1055,10 +1060,10 @@ void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c) c->x86 = (tfms >> 8) & 0xf; c->x86_model = (tfms >> 4) & 0xf; c->x86_mask = tfms & 0xf; - if (c->x86 == 0xf) + if (c->x86 == 0xf) { c->x86 += (tfms >> 20) & 0xff; - if (c->x86 >= 0x6) c->x86_model += ((tfms >> 16) & 0xF) << 4; + } if (c->x86_capability[0] & (1<<19)) c->x86_clflush_size = ((misc >> 8) & 0xff) * 8; } else { @@ -1257,11 +1262,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) seq_printf(m, "stepping\t: unknown\n"); if (cpu_has(c,X86_FEATURE_TSC)) { - unsigned int freq = cpufreq_quick_get((unsigned)(c-cpu_data)); - if (!freq) - freq = cpu_khz; seq_printf(m, "cpu MHz\t\t: %u.%03u\n", - freq / 1000, (freq % 1000)); + cpu_khz / 1000, (cpu_khz % 1000)); } /* Cache size */ @@ -1269,12 +1271,13 @@ static int show_cpuinfo(struct seq_file *m, void *v) seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); #ifdef CONFIG_SMP - if (smp_num_siblings * c->x86_max_cores > 1) { + if (smp_num_siblings * c->x86_num_cores > 1) { int cpu = c - cpu_data; seq_printf(m, "physical id\t: %d\n", phys_proc_id[cpu]); - seq_printf(m, "siblings\t: %d\n", cpus_weight(cpu_core_map[cpu])); + seq_printf(m, "siblings\t: %d\n", + c->x86_num_cores * smp_num_siblings); seq_printf(m, "core id\t\t: %d\n", cpu_core_id[cpu]); - seq_printf(m, "cpu cores\t: %d\n", c->booted_cores); + seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores); } #endif diff --git a/trunk/arch/x86_64/kernel/setup64.c b/trunk/arch/x86_64/kernel/setup64.c index 06dc354375c3..79190891fbc5 100644 --- a/trunk/arch/x86_64/kernel/setup64.c +++ b/trunk/arch/x86_64/kernel/setup64.c @@ -141,6 +141,7 @@ void pda_init(int cpu) panic("cannot allocate irqstack for cpu %d", cpu); } + asm volatile("movq %0,%%cr3" :: "r" (__pa_symbol(&init_level4_pgt))); pda->irqstackptr += IRQSTACKSIZE-64; } @@ -196,7 +197,6 @@ void __cpuinit cpu_init (void) /* CPU 0 is initialised in head64.c */ if (cpu != 0) { pda_init(cpu); - zap_low_mappings(cpu); } else estacks = boot_exception_stacks; diff --git a/trunk/arch/x86_64/kernel/signal.c b/trunk/arch/x86_64/kernel/signal.c index 5876df116c92..d642fbf3da29 100644 --- a/trunk/arch/x86_64/kernel/signal.c +++ b/trunk/arch/x86_64/kernel/signal.c @@ -110,15 +110,6 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned COPY(r14); COPY(r15); - /* Kernel saves and restores only the CS segment register on signals, - * which is the bare minimum needed to allow mixed 32/64-bit code. - * App's signal handler can save/restore other segments if needed. */ - { - unsigned cs; - err |= __get_user(cs, &sc->cs); - regs->cs = cs | 3; /* Force into user mode */ - } - { unsigned int tmpflags; err |= __get_user(tmpflags, &sc->eflags); @@ -196,7 +187,6 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned lo { int err = 0; - err |= __put_user(regs->cs, &sc->cs); err |= __put_user(0, &sc->gs); err |= __put_user(0, &sc->fs); @@ -328,14 +318,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, regs->rsp = (unsigned long)frame; - /* Set up the CS register to run signal handlers in 64-bit mode, - even if the handler happens to be interrupting 32-bit code. */ - regs->cs = __USER_CS; - - /* This, by contrast, has nothing to do with segment registers - - see include/asm-x86_64/uaccess.h for details. */ set_fs(USER_DS); - regs->eflags &= ~TF_MASK; if (test_thread_flag(TIF_SINGLESTEP)) ptrace_notify(SIGTRAP); diff --git a/trunk/arch/x86_64/kernel/smp.c b/trunk/arch/x86_64/kernel/smp.c index cfc3d9dccbd9..9db9dda161b4 100644 --- a/trunk/arch/x86_64/kernel/smp.c +++ b/trunk/arch/x86_64/kernel/smp.c @@ -28,6 +28,8 @@ #include #include +#define __cpuinit __init + /* * Smarter SMP flushing macros. * c/o Linus Torvalds. @@ -450,14 +452,13 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, void smp_stop_cpu(void) { - unsigned long flags; /* * Remove this CPU: */ cpu_clear(smp_processor_id(), cpu_online_map); - local_irq_save(flags); + local_irq_disable(); disable_local_APIC(); - local_irq_restore(flags); + local_irq_enable(); } static void smp_really_stop_cpu(void *dummy) diff --git a/trunk/arch/x86_64/kernel/smpboot.c b/trunk/arch/x86_64/kernel/smpboot.c index ecbd7b83acc1..c4e59bbdc187 100644 --- a/trunk/arch/x86_64/kernel/smpboot.c +++ b/trunk/arch/x86_64/kernel/smpboot.c @@ -64,7 +64,6 @@ int smp_num_siblings = 1; /* Package ID of each logical CPU */ u8 phys_proc_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID }; -/* core ID of each logical CPU */ u8 cpu_core_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID }; /* Bitmask of currently online CPUs */ @@ -88,10 +87,7 @@ struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; /* Set when the idlers are all forked */ int smp_threads_ready; -/* representing HT siblings of each logical CPU */ cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly; - -/* representing HT and core siblings of each logical CPU */ cpumask_t cpu_core_map[NR_CPUS] __read_mostly; EXPORT_SYMBOL(cpu_core_map); @@ -438,59 +434,30 @@ void __cpuinit smp_callin(void) cpu_set(cpuid, cpu_callin_map); } -/* representing cpus for which sibling maps can be computed */ -static cpumask_t cpu_sibling_setup_map; - static inline void set_cpu_sibling_map(int cpu) { int i; - struct cpuinfo_x86 *c = cpu_data; - - cpu_set(cpu, cpu_sibling_setup_map); if (smp_num_siblings > 1) { - for_each_cpu_mask(i, cpu_sibling_setup_map) { - if (phys_proc_id[cpu] == phys_proc_id[i] && - cpu_core_id[cpu] == cpu_core_id[i]) { + for_each_cpu(i) { + if (cpu_core_id[cpu] == cpu_core_id[i]) { cpu_set(i, cpu_sibling_map[cpu]); cpu_set(cpu, cpu_sibling_map[i]); - cpu_set(i, cpu_core_map[cpu]); - cpu_set(cpu, cpu_core_map[i]); } } } else { cpu_set(cpu, cpu_sibling_map[cpu]); } - if (current_cpu_data.x86_max_cores == 1) { - cpu_core_map[cpu] = cpu_sibling_map[cpu]; - c[cpu].booted_cores = 1; - return; - } - - for_each_cpu_mask(i, cpu_sibling_setup_map) { - if (phys_proc_id[cpu] == phys_proc_id[i]) { - cpu_set(i, cpu_core_map[cpu]); - cpu_set(cpu, cpu_core_map[i]); - /* - * Does this new cpu bringup a new core? - */ - if (cpus_weight(cpu_sibling_map[cpu]) == 1) { - /* - * for each core in package, increment - * the booted_cores for this new cpu - */ - if (first_cpu(cpu_sibling_map[i]) == i) - c[cpu].booted_cores++; - /* - * increment the core count for all - * the other cpus in this package - */ - if (i != cpu) - c[i].booted_cores++; - } else if (i != cpu && !c[cpu].booted_cores) - c[cpu].booted_cores = c[i].booted_cores; + if (current_cpu_data.x86_num_cores > 1) { + for_each_cpu(i) { + if (phys_proc_id[cpu] == phys_proc_id[i]) { + cpu_set(i, cpu_core_map[cpu]); + cpu_set(cpu, cpu_core_map[i]); + } } + } else { + cpu_core_map[cpu] = cpu_sibling_map[cpu]; } } @@ -912,9 +879,6 @@ static __init void disable_smp(void) } #ifdef CONFIG_HOTPLUG_CPU - -int additional_cpus __initdata = -1; - /* * cpu_possible_map should be static, it cannot change as cpu's * are onlined, or offlined. The reason is per-cpu data-structures @@ -923,38 +887,14 @@ int additional_cpus __initdata = -1; * cpu_present_map on the other hand can change dynamically. * In case when cpu_hotplug is not compiled, then we resort to current * behaviour, which is cpu_possible == cpu_present. + * If cpu-hotplug is supported, then we need to preallocate for all + * those NR_CPUS, hence cpu_possible_map represents entire NR_CPUS range. * - Ashok Raj - * - * Three ways to find out the number of additional hotplug CPUs: - * - If the BIOS specified disabled CPUs in ACPI/mptables use that. - * - otherwise use half of the available CPUs or 2, whatever is more. - * - The user can overwrite it with additional_cpus=NUM - * We do this because additional CPUs waste a lot of memory. - * -AK */ __init void prefill_possible_map(void) { int i; - int possible; - - if (additional_cpus == -1) { - if (disabled_cpus > 0) { - additional_cpus = disabled_cpus; - } else { - additional_cpus = num_processors / 2; - if (additional_cpus == 0) - additional_cpus = 2; - } - } - possible = num_processors + additional_cpus; - if (possible > NR_CPUS) - possible = NR_CPUS; - - printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", - possible, - max_t(int, possible - num_processors, 0)); - - for (i = 0; i < possible; i++) + for (i = 0; i < NR_CPUS; i++) cpu_set(i, cpu_possible_map); } #endif @@ -1025,7 +965,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus) nmi_watchdog_default(); current_cpu_data = boot_cpu_data; current_thread_info()->cpu = 0; /* needed? */ - set_cpu_sibling_map(0); if (smp_sanity_check(max_cpus) < 0) { printk(KERN_INFO "SMP disabled\n"); @@ -1069,6 +1008,8 @@ void __init smp_prepare_boot_cpu(void) int me = smp_processor_id(); cpu_set(me, cpu_online_map); cpu_set(me, cpu_callout_map); + cpu_set(0, cpu_sibling_map[0]); + cpu_set(0, cpu_core_map[0]); per_cpu(cpu_state, me) = CPU_ONLINE; } @@ -1121,6 +1062,9 @@ int __cpuinit __cpu_up(unsigned int cpu) */ void __init smp_cpus_done(unsigned int max_cpus) { +#ifndef CONFIG_HOTPLUG_CPU + zap_low_mappings(); +#endif smp_cleanup_boot(); #ifdef CONFIG_X86_IO_APIC @@ -1137,24 +1081,15 @@ void __init smp_cpus_done(unsigned int max_cpus) static void remove_siblinginfo(int cpu) { int sibling; - struct cpuinfo_x86 *c = cpu_data; - for_each_cpu_mask(sibling, cpu_core_map[cpu]) { - cpu_clear(cpu, cpu_core_map[sibling]); - /* - * last thread sibling in this cpu core going down - */ - if (cpus_weight(cpu_sibling_map[cpu]) == 1) - c[sibling].booted_cores--; - } - for_each_cpu_mask(sibling, cpu_sibling_map[cpu]) cpu_clear(cpu, cpu_sibling_map[sibling]); + for_each_cpu_mask(sibling, cpu_core_map[cpu]) + cpu_clear(cpu, cpu_core_map[sibling]); cpus_clear(cpu_sibling_map[cpu]); cpus_clear(cpu_core_map[cpu]); phys_proc_id[cpu] = BAD_APICID; cpu_core_id[cpu] = BAD_APICID; - cpu_clear(cpu, cpu_sibling_setup_map); } void remove_cpu_from_maps(void) @@ -1181,7 +1116,7 @@ int __cpu_disable(void) if (cpu == 0) return -EBUSY; - clear_local_APIC(); + disable_APIC_timer(); /* * HACK: @@ -1218,12 +1153,6 @@ void __cpu_die(unsigned int cpu) printk(KERN_ERR "CPU %u didn't die...\n", cpu); } -static __init int setup_additional_cpus(char *s) -{ - return get_option(&s, &additional_cpus); -} -__setup("additional_cpus=", setup_additional_cpus); - #else /* ... !CONFIG_HOTPLUG_CPU */ int __cpu_disable(void) diff --git a/trunk/arch/x86_64/kernel/sys_x86_64.c b/trunk/arch/x86_64/kernel/sys_x86_64.c index 6449ea8fe756..cc7821c68851 100644 --- a/trunk/arch/x86_64/kernel/sys_x86_64.c +++ b/trunk/arch/x86_64/kernel/sys_x86_64.c @@ -154,3 +154,17 @@ asmlinkage long sys_uname(struct new_utsname __user * name) err |= copy_to_user(&name->machine, "i686", 5); return err ? -EFAULT : 0; } + +asmlinkage long sys_time64(long __user * tloc) +{ + struct timeval now; + int i; + + do_gettimeofday(&now); + i = now.tv_sec; + if (tloc) { + if (put_user(i,tloc)) + i = -EFAULT; + } + return i; +} diff --git a/trunk/arch/x86_64/kernel/time.c b/trunk/arch/x86_64/kernel/time.c index 74102796e5c0..fdaddc4e5284 100644 --- a/trunk/arch/x86_64/kernel/time.c +++ b/trunk/arch/x86_64/kernel/time.c @@ -59,7 +59,7 @@ static int notsc __initdata = 0; unsigned int cpu_khz; /* TSC clocks / usec, not used here */ static unsigned long hpet_period; /* fsecs / HPET clock */ unsigned long hpet_tick; /* HPET clocks / interrupt */ -static int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */ +static int hpet_use_timer; unsigned long vxtime_hz = PIT_TICK_RATE; int report_lost_ticks; /* command line option */ unsigned long long monotonic_base; @@ -908,14 +908,12 @@ void __init time_init(void) if (!hpet_init()) vxtime_hz = (1000000000000000L + hpet_period / 2) / hpet_period; - else - vxtime.hpet_address = 0; if (hpet_use_timer) { cpu_khz = hpet_calibrate_tsc(); timename = "HPET"; #ifdef CONFIG_X86_PM_TIMER - } else if (pmtmr_ioport && !vxtime.hpet_address) { + } else if (pmtmr_ioport) { vxtime_hz = PM_TIMER_FREQUENCY; timename = "PM"; pit_init(); diff --git a/trunk/arch/x86_64/kernel/traps.c b/trunk/arch/x86_64/kernel/traps.c index bf337f493189..b5e09e6b5536 100644 --- a/trunk/arch/x86_64/kernel/traps.c +++ b/trunk/arch/x86_64/kernel/traps.c @@ -428,6 +428,19 @@ static void __kprobes do_trap(int trapnr, int signr, char *str, { conditional_sti(regs); +#ifdef CONFIG_CHECKING + { + unsigned long gs; + struct x8664_pda *pda = cpu_pda + safe_smp_processor_id(); + rdmsrl(MSR_GS_BASE, gs); + if (gs != (unsigned long)pda) { + wrmsrl(MSR_GS_BASE, pda); + printk("%s: wrong gs %lx expected %p rip %lx\n", str, gs, pda, + regs->rip); + } + } +#endif + if (user_mode(regs)) { struct task_struct *tsk = current; @@ -500,6 +513,20 @@ asmlinkage void __kprobes do_general_protection(struct pt_regs * regs, { conditional_sti(regs); +#ifdef CONFIG_CHECKING + { + unsigned long gs; + struct x8664_pda *pda = cpu_pda + safe_smp_processor_id(); + rdmsrl(MSR_GS_BASE, gs); + if (gs != (unsigned long)pda) { + wrmsrl(MSR_GS_BASE, pda); + oops_in_progress++; + printk("general protection handler: wrong gs %lx expected %p\n", gs, pda); + oops_in_progress--; + } + } +#endif + if (user_mode(regs)) { struct task_struct *tsk = current; @@ -638,6 +665,19 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs, struct task_struct *tsk = current; siginfo_t info; +#ifdef CONFIG_CHECKING + { + /* RED-PEN interaction with debugger - could destroy gs */ + unsigned long gs; + struct x8664_pda *pda = cpu_pda + safe_smp_processor_id(); + rdmsrl(MSR_GS_BASE, gs); + if (gs != (unsigned long)pda) { + wrmsrl(MSR_GS_BASE, pda); + printk("debug handler: wrong gs %lx expected %p\n", gs, pda); + } + } +#endif + get_debugreg(condition, 6); if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code, @@ -848,10 +888,6 @@ asmlinkage void __attribute__((weak)) smp_thermal_interrupt(void) { } -asmlinkage void __attribute__((weak)) mce_threshold_interrupt(void) -{ -} - /* * 'math_state_restore()' saves the current math information in the * old math state array, and gets the new ones from the current task diff --git a/trunk/arch/x86_64/kernel/vmlinux.lds.S b/trunk/arch/x86_64/kernel/vmlinux.lds.S index 58b19215b4b3..6dd642cad2ef 100644 --- a/trunk/arch/x86_64/kernel/vmlinux.lds.S +++ b/trunk/arch/x86_64/kernel/vmlinux.lds.S @@ -50,7 +50,7 @@ SECTIONS *(.bss.page_aligned) *(.bss) } - __bss_stop = .; + __bss_end = .; . = ALIGN(PAGE_SIZE); . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); diff --git a/trunk/arch/x86_64/kernel/x8664_ksyms.c b/trunk/arch/x86_64/kernel/x8664_ksyms.c index 4a54221e10bc..fd99ddd009bc 100644 --- a/trunk/arch/x86_64/kernel/x8664_ksyms.c +++ b/trunk/arch/x86_64/kernel/x8664_ksyms.c @@ -203,6 +203,3 @@ EXPORT_SYMBOL(flush_tlb_page); #endif EXPORT_SYMBOL(cpu_khz); - -EXPORT_SYMBOL(load_gs_index); - diff --git a/trunk/arch/x86_64/lib/clear_page.S b/trunk/arch/x86_64/lib/clear_page.S index 43d9fa136180..30a9da458c15 100644 --- a/trunk/arch/x86_64/lib/clear_page.S +++ b/trunk/arch/x86_64/lib/clear_page.S @@ -5,8 +5,46 @@ .globl clear_page .p2align 4 clear_page: + xorl %eax,%eax + movl $4096/64,%ecx + .p2align 4 +.Lloop: + decl %ecx +#define PUT(x) movq %rax,x*8(%rdi) + movq %rax,(%rdi) + PUT(1) + PUT(2) + PUT(3) + PUT(4) + PUT(5) + PUT(6) + PUT(7) + leaq 64(%rdi),%rdi + jnz .Lloop + nop + ret +clear_page_end: + + /* C stepping K8 run faster using the string instructions. + It is also a lot simpler. Use this when possible */ + +#include + + .section .altinstructions,"a" + .align 8 + .quad clear_page + .quad clear_page_c + .byte X86_FEATURE_K8_C + .byte clear_page_end-clear_page + .byte clear_page_c_end-clear_page_c + .previous + + .section .altinstr_replacement,"ax" +clear_page_c: movl $4096/8,%ecx xorl %eax,%eax rep stosq ret +clear_page_c_end: + .previous diff --git a/trunk/arch/x86_64/lib/copy_page.S b/trunk/arch/x86_64/lib/copy_page.S index 621a19769406..dd3aa47b6bf5 100644 --- a/trunk/arch/x86_64/lib/copy_page.S +++ b/trunk/arch/x86_64/lib/copy_page.S @@ -8,7 +8,94 @@ .globl copy_page .p2align 4 copy_page: + subq $3*8,%rsp + movq %rbx,(%rsp) + movq %r12,1*8(%rsp) + movq %r13,2*8(%rsp) + + movl $(4096/64)-5,%ecx + .p2align 4 +.Loop64: + dec %rcx + + movq (%rsi), %rax + movq 8 (%rsi), %rbx + movq 16 (%rsi), %rdx + movq 24 (%rsi), %r8 + movq 32 (%rsi), %r9 + movq 40 (%rsi), %r10 + movq 48 (%rsi), %r11 + movq 56 (%rsi), %r12 + + prefetcht0 5*64(%rsi) + + movq %rax, (%rdi) + movq %rbx, 8 (%rdi) + movq %rdx, 16 (%rdi) + movq %r8, 24 (%rdi) + movq %r9, 32 (%rdi) + movq %r10, 40 (%rdi) + movq %r11, 48 (%rdi) + movq %r12, 56 (%rdi) + + leaq 64 (%rsi), %rsi + leaq 64 (%rdi), %rdi + + jnz .Loop64 + + movl $5,%ecx + .p2align 4 +.Loop2: + decl %ecx + + movq (%rsi), %rax + movq 8 (%rsi), %rbx + movq 16 (%rsi), %rdx + movq 24 (%rsi), %r8 + movq 32 (%rsi), %r9 + movq 40 (%rsi), %r10 + movq 48 (%rsi), %r11 + movq 56 (%rsi), %r12 + + movq %rax, (%rdi) + movq %rbx, 8 (%rdi) + movq %rdx, 16 (%rdi) + movq %r8, 24 (%rdi) + movq %r9, 32 (%rdi) + movq %r10, 40 (%rdi) + movq %r11, 48 (%rdi) + movq %r12, 56 (%rdi) + + leaq 64(%rdi),%rdi + leaq 64(%rsi),%rsi + + jnz .Loop2 + + movq (%rsp),%rbx + movq 1*8(%rsp),%r12 + movq 2*8(%rsp),%r13 + addq $3*8,%rsp + ret + + /* C stepping K8 run faster using the string copy instructions. + It is also a lot simpler. Use this when possible */ + +#include + + .section .altinstructions,"a" + .align 8 + .quad copy_page + .quad copy_page_c + .byte X86_FEATURE_K8_C + .byte copy_page_c_end-copy_page_c + .byte copy_page_c_end-copy_page_c + .previous + + .section .altinstr_replacement,"ax" +copy_page_c: movl $4096/8,%ecx rep movsq ret +copy_page_c_end: + .previous diff --git a/trunk/arch/x86_64/lib/memcpy.S b/trunk/arch/x86_64/lib/memcpy.S index 92dd80544602..c6c46494fef5 100644 --- a/trunk/arch/x86_64/lib/memcpy.S +++ b/trunk/arch/x86_64/lib/memcpy.S @@ -11,8 +11,6 @@ * * Output: * rax original destination - * - * TODO: check best memcpy for PSC */ .globl __memcpy @@ -20,6 +18,95 @@ .p2align 4 __memcpy: memcpy: + pushq %rbx + movq %rdi,%rax + + movl %edx,%ecx + shrl $6,%ecx + jz .Lhandle_tail + + .p2align 4 +.Lloop_64: + decl %ecx + + movq (%rsi),%r11 + movq 8(%rsi),%r8 + + movq %r11,(%rdi) + movq %r8,1*8(%rdi) + + movq 2*8(%rsi),%r9 + movq 3*8(%rsi),%r10 + + movq %r9,2*8(%rdi) + movq %r10,3*8(%rdi) + + movq 4*8(%rsi),%r11 + movq 5*8(%rsi),%r8 + + movq %r11,4*8(%rdi) + movq %r8,5*8(%rdi) + + movq 6*8(%rsi),%r9 + movq 7*8(%rsi),%r10 + + movq %r9,6*8(%rdi) + movq %r10,7*8(%rdi) + + leaq 64(%rsi),%rsi + leaq 64(%rdi),%rdi + jnz .Lloop_64 + +.Lhandle_tail: + movl %edx,%ecx + andl $63,%ecx + shrl $3,%ecx + jz .Lhandle_7 + .p2align 4 +.Lloop_8: + decl %ecx + movq (%rsi),%r8 + movq %r8,(%rdi) + leaq 8(%rdi),%rdi + leaq 8(%rsi),%rsi + jnz .Lloop_8 + +.Lhandle_7: + movl %edx,%ecx + andl $7,%ecx + jz .Lende + .p2align 4 +.Lloop_1: + movb (%rsi),%r8b + movb %r8b,(%rdi) + incq %rdi + incq %rsi + decl %ecx + jnz .Lloop_1 + +.Lende: + popq %rbx + ret +.Lfinal: + + /* C stepping K8 run faster using the string copy instructions. + It is also a lot simpler. Use this when possible */ + + .section .altinstructions,"a" + .align 8 + .quad memcpy + .quad memcpy_c + .byte X86_FEATURE_K8_C + .byte .Lfinal-memcpy + .byte memcpy_c_end-memcpy_c + .previous + + .section .altinstr_replacement,"ax" + /* rdi destination + * rsi source + * rdx count + */ +memcpy_c: movq %rdi,%rax movl %edx,%ecx shrl $3,%ecx @@ -30,3 +117,5 @@ memcpy: rep movsb ret +memcpy_c_end: + .previous diff --git a/trunk/arch/x86_64/lib/memset.S b/trunk/arch/x86_64/lib/memset.S index 2aa48f24ed1e..4b4c40638640 100644 --- a/trunk/arch/x86_64/lib/memset.S +++ b/trunk/arch/x86_64/lib/memset.S @@ -13,6 +13,98 @@ .p2align 4 memset: __memset: + movq %rdi,%r10 + movq %rdx,%r11 + + /* expand byte value */ + movzbl %sil,%ecx + movabs $0x0101010101010101,%rax + mul %rcx /* with rax, clobbers rdx */ + + /* align dst */ + movl %edi,%r9d + andl $7,%r9d + jnz .Lbad_alignment +.Lafter_bad_alignment: + + movl %r11d,%ecx + shrl $6,%ecx + jz .Lhandle_tail + + .p2align 4 +.Lloop_64: + decl %ecx + movq %rax,(%rdi) + movq %rax,8(%rdi) + movq %rax,16(%rdi) + movq %rax,24(%rdi) + movq %rax,32(%rdi) + movq %rax,40(%rdi) + movq %rax,48(%rdi) + movq %rax,56(%rdi) + leaq 64(%rdi),%rdi + jnz .Lloop_64 + + /* Handle tail in loops. The loops should be faster than hard + to predict jump tables. */ + .p2align 4 +.Lhandle_tail: + movl %r11d,%ecx + andl $63&(~7),%ecx + jz .Lhandle_7 + shrl $3,%ecx + .p2align 4 +.Lloop_8: + decl %ecx + movq %rax,(%rdi) + leaq 8(%rdi),%rdi + jnz .Lloop_8 + +.Lhandle_7: + movl %r11d,%ecx + andl $7,%ecx + jz .Lende + .p2align 4 +.Lloop_1: + decl %ecx + movb %al,(%rdi) + leaq 1(%rdi),%rdi + jnz .Lloop_1 + +.Lende: + movq %r10,%rax + ret + +.Lbad_alignment: + cmpq $7,%r11 + jbe .Lhandle_7 + movq %rax,(%rdi) /* unaligned store */ + movq $8,%r8 + subq %r9,%r8 + addq %r8,%rdi + subq %r8,%r11 + jmp .Lafter_bad_alignment + + /* C stepping K8 run faster using the string instructions. + It is also a lot simpler. Use this when possible */ + +#include + + .section .altinstructions,"a" + .align 8 + .quad memset + .quad memset_c + .byte X86_FEATURE_K8_C + .byte memset_c_end-memset_c + .byte memset_c_end-memset_c + .previous + + .section .altinstr_replacement,"ax" + /* rdi destination + * rsi value + * rdx count + */ +memset_c: movq %rdi,%r9 movl %edx,%r8d andl $7,%r8d @@ -29,3 +121,5 @@ __memset: stosb movq %r9,%rax ret +memset_c_end: + .previous diff --git a/trunk/arch/x86_64/mm/fault.c b/trunk/arch/x86_64/mm/fault.c index 3a63707a698b..b75b872ec154 100644 --- a/trunk/arch/x86_64/mm/fault.c +++ b/trunk/arch/x86_64/mm/fault.c @@ -308,6 +308,18 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, unsigned long flags; siginfo_t info; +#ifdef CONFIG_CHECKING + { + unsigned long gs; + struct x8664_pda *pda = cpu_pda + stack_smp_processor_id(); + rdmsrl(MSR_GS_BASE, gs); + if (gs != (unsigned long)pda) { + wrmsrl(MSR_GS_BASE, pda); + printk("page_fault: wrong gs %lx expected %p\n", gs, pda); + } + } +#endif + /* get the address */ __asm__("movq %%cr2,%0":"=r" (address)); if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14, @@ -559,10 +571,3 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, force_sig_info(SIGBUS, &info, tsk); return; } - -static int __init enable_pagefaulttrace(char *str) -{ - page_fault_trace = 1; - return 0; -} -__setup("pagefaulttrace", enable_pagefaulttrace); diff --git a/trunk/arch/x86_64/mm/init.c b/trunk/arch/x86_64/mm/init.c index c016dfe84784..e60a1a848de8 100644 --- a/trunk/arch/x86_64/mm/init.c +++ b/trunk/arch/x86_64/mm/init.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -37,13 +36,16 @@ #include #include #include -#include #ifndef Dprintk #define Dprintk(x...) #endif -static unsigned long dma_reserve __initdata; +#ifdef CONFIG_GART_IOMMU +extern int swiotlb; +#endif + +extern char _stext[]; DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); @@ -84,6 +86,9 @@ void show_mem(void) /* References to section boundaries */ +extern char _text, _etext, _edata, __bss_start, _end[]; +extern char __init_begin, __init_end; + int after_bootmem; static void *spp_getpage(void) @@ -303,81 +308,42 @@ void __init init_memory_mapping(unsigned long start, unsigned long end) table_end< end_pfn) - dma32_pfn = end_pfn; - z[ZONE_DMA32] = dma32_pfn - start_pfn; - } - z[ZONE_NORMAL] = end_pfn - start_pfn; - - /* Remove lower zones from higher ones. */ - w = 0; - for (i = 0; i < MAX_NR_ZONES; i++) { - if (z[i]) - z[i] -= w; - w += z[i]; - } - - /* Compute holes */ - w = start_pfn; - for (i = 0; i < MAX_NR_ZONES; i++) { - unsigned long s = w; - w += z[i]; - h[i] = e820_hole_size(s, w); - } - - /* Add the space pace needed for mem_map to the holes too. */ - for (i = 0; i < MAX_NR_ZONES; i++) - h[i] += (z[i] * sizeof(struct page)) / PAGE_SIZE; - - /* The 16MB DMA zone has the kernel and other misc mappings. - Account them too */ - if (h[ZONE_DMA]) { - h[ZONE_DMA] += dma_reserve; - if (h[ZONE_DMA] >= z[ZONE_DMA]) { - printk(KERN_WARNING - "Kernel too large and filling up ZONE_DMA?\n"); - h[ZONE_DMA] = z[ZONE_DMA]; - } - } + pgd_t *pgd = pgd_offset_k(0UL); + pgd_clear(pgd); + flush_tlb_all(); } #ifndef CONFIG_NUMA void __init paging_init(void) { - unsigned long zones[MAX_NR_ZONES], holes[MAX_NR_ZONES]; - size_zones(zones, holes, 0, end_pfn); - free_area_init_node(0, NODE_DATA(0), zones, - __pa(PAGE_OFFSET) >> PAGE_SHIFT, holes); + { + unsigned long zones_size[MAX_NR_ZONES]; + unsigned long holes[MAX_NR_ZONES]; + unsigned int max_dma; + + memset(zones_size, 0, sizeof(zones_size)); + memset(holes, 0, sizeof(holes)); + + max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; + + if (end_pfn < max_dma) { + zones_size[ZONE_DMA] = end_pfn; + holes[ZONE_DMA] = e820_hole_size(0, end_pfn); + } else { + zones_size[ZONE_DMA] = max_dma; + holes[ZONE_DMA] = e820_hole_size(0, max_dma); + zones_size[ZONE_NORMAL] = end_pfn - max_dma; + holes[ZONE_NORMAL] = e820_hole_size(max_dma, end_pfn); + } + free_area_init_node(0, NODE_DATA(0), zones_size, + __pa(PAGE_OFFSET) >> PAGE_SHIFT, holes); + } + return; } #endif @@ -472,16 +438,19 @@ void __init mem_init(void) datasize >> 10, initsize >> 10); -#ifdef CONFIG_SMP /* - * Sync boot_level4_pgt mappings with the init_level4_pgt - * except for the low identity mappings which are already zapped - * in init_level4_pgt. This sync-up is essential for AP's bringup + * Subtle. SMP is doing its boot stuff late (because it has to + * fork idle threads) - but it also needs low mappings for the + * protected-mode entry to work. We zap these entries only after + * the WP-bit has been tested. */ - memcpy(boot_level4_pgt+1, init_level4_pgt+1, (PTRS_PER_PGD-1)*sizeof(pgd_t)); +#ifndef CONFIG_SMP + zap_low_mappings(); #endif } +extern char __initdata_begin[], __initdata_end[]; + void free_initmem(void) { unsigned long addr; @@ -495,7 +464,7 @@ void free_initmem(void) totalram_pages++; } memset(__initdata_begin, 0xba, __initdata_end - __initdata_begin); - printk ("Freeing unused kernel memory: %luk freed\n", (__init_end - __init_begin) >> 10); + printk ("Freeing unused kernel memory: %luk freed\n", (&__init_end - &__init_begin) >> 10); } #ifdef CONFIG_BLK_DEV_INITRD @@ -522,8 +491,6 @@ void __init reserve_bootmem_generic(unsigned long phys, unsigned len) #else reserve_bootmem(phys, len); #endif - if (phys+len <= MAX_DMA_PFN*PAGE_SIZE) - dma_reserve += len / PAGE_SIZE; } int kern_addr_valid(unsigned long addr) @@ -565,6 +532,10 @@ extern int exception_trace, page_fault_trace; static ctl_table debug_table2[] = { { 99, "exception-trace", &exception_trace, sizeof(int), 0644, NULL, proc_dointvec }, +#ifdef CONFIG_CHECKING + { 100, "page-fault-trace", &page_fault_trace, sizeof(int), 0644, NULL, + proc_dointvec }, +#endif { 0, } }; diff --git a/trunk/arch/x86_64/mm/ioremap.c b/trunk/arch/x86_64/mm/ioremap.c index ae207064201e..ecf7acb5db9b 100644 --- a/trunk/arch/x86_64/mm/ioremap.c +++ b/trunk/arch/x86_64/mm/ioremap.c @@ -247,15 +247,9 @@ void __iomem *ioremap_nocache (unsigned long phys_addr, unsigned long size) return __ioremap(phys_addr, size, _PAGE_PCD); } -/** - * iounmap - Free a IO remapping - * @addr: virtual address from ioremap_* - * - * Caller must ensure there is only one unmapping for the same pointer. - */ void iounmap(volatile void __iomem *addr) { - struct vm_struct *p, *o; + struct vm_struct *p; if (addr <= high_memory) return; @@ -263,31 +257,12 @@ void iounmap(volatile void __iomem *addr) addr < phys_to_virt(ISA_END_ADDRESS)) return; - addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr); - /* Use the vm area unlocked, assuming the caller - ensures there isn't another iounmap for the same address - in parallel. Reuse of the virtual address is prevented by - leaving it in the global lists until we're done with it. - cpa takes care of the direct mappings. */ - read_lock(&vmlist_lock); - for (p = vmlist; p; p = p->next) { - if (p->addr == addr) - break; - } - read_unlock(&vmlist_lock); - - if (!p) { + write_lock(&vmlist_lock); + p = __remove_vm_area((void *)((unsigned long)addr & PAGE_MASK)); + if (!p) printk("iounmap: bad address %p\n", addr); - dump_stack(); - return; - } - - /* Reset the direct mapping. Can block */ - if (p->flags >> 20) + else if (p->flags >> 20) ioremap_change_attr(p->phys_addr, p->size, 0); - - /* Finally remove it */ - o = remove_vm_area((void *)addr); - BUG_ON(p != o || o == NULL); + write_unlock(&vmlist_lock); kfree(p); } diff --git a/trunk/arch/x86_64/mm/k8topology.c b/trunk/arch/x86_64/mm/k8topology.c index a5663e0bb01c..65417b040c1b 100644 --- a/trunk/arch/x86_64/mm/k8topology.c +++ b/trunk/arch/x86_64/mm/k8topology.c @@ -108,7 +108,6 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end) limit >>= 16; limit <<= 24; limit |= (1<<24)-1; - limit++; if (limit > end_pfn << PAGE_SHIFT) limit = end_pfn << PAGE_SHIFT; diff --git a/trunk/arch/x86_64/mm/numa.c b/trunk/arch/x86_64/mm/numa.c index 15b67d2760cb..214803821001 100644 --- a/trunk/arch/x86_64/mm/numa.c +++ b/trunk/arch/x86_64/mm/numa.c @@ -38,59 +38,38 @@ cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; int numa_off __initdata; - -/* - * Given a shift value, try to populate memnodemap[] - * Returns : - * 1 if OK - * 0 if memnodmap[] too small (of shift too small) - * -1 if node overlap or lost ram (shift too big) - */ -static int __init populate_memnodemap( - const struct node *nodes, int numnodes, int shift) +int __init compute_hash_shift(struct node *nodes, int numnodes) { int i; - int res = -1; - unsigned long addr, end; + int shift = 20; + unsigned long addr,maxend=0; + + for (i = 0; i < numnodes; i++) + if ((nodes[i].start != nodes[i].end) && (nodes[i].end > maxend)) + maxend = nodes[i].end; - if (shift >= 64) - return -1; - memset(memnodemap, 0xff, sizeof(memnodemap)); + while ((1UL << shift) < (maxend / NODEMAPSIZE)) + shift++; + + printk (KERN_DEBUG"Using %d for the hash shift. Max adder is %lx \n", + shift,maxend); + memset(memnodemap,0xff,sizeof(*memnodemap) * NODEMAPSIZE); for (i = 0; i < numnodes; i++) { - addr = nodes[i].start; - end = nodes[i].end; - if (addr >= end) + if (nodes[i].start == nodes[i].end) continue; - if ((end >> shift) >= NODEMAPSIZE) - return 0; - do { - if (memnodemap[addr >> shift] != 0xff) + for (addr = nodes[i].start; + addr < nodes[i].end; + addr += (1UL << shift)) { + if (memnodemap[addr >> shift] != 0xff) { + printk(KERN_INFO + "Your memory is not aligned you need to rebuild your kernel " + "with a bigger NODEMAPSIZE shift=%d adder=%lu\n", + shift,addr); return -1; + } memnodemap[addr >> shift] = i; - addr += (1UL << shift); - } while (addr < end); - res = 1; + } } - return res; -} - -int __init compute_hash_shift(struct node *nodes, int numnodes) -{ - int shift = 20; - - while (populate_memnodemap(nodes, numnodes, shift + 1) >= 0) - shift++; - - printk(KERN_DEBUG "Using %d for the hash shift.\n", - shift); - - if (populate_memnodemap(nodes, numnodes, shift) != 1) { - printk(KERN_INFO - "Your memory is not aligned you need to rebuild your kernel " - "with a bigger NODEMAPSIZE shift=%d\n", - shift); - return -1; - } return shift; } @@ -115,6 +94,7 @@ void __init setup_node_bootmem(int nodeid, unsigned long start, unsigned long en start_pfn = start >> PAGE_SHIFT; end_pfn = end >> PAGE_SHIFT; + memory_present(nodeid, start_pfn, end_pfn); nodedata_phys = find_e820_area(start, end, pgdat_size); if (nodedata_phys == -1L) panic("Cannot find memory pgdat in node %d\n", nodeid); @@ -152,14 +132,29 @@ void __init setup_node_zones(int nodeid) unsigned long start_pfn, end_pfn; unsigned long zones[MAX_NR_ZONES]; unsigned long holes[MAX_NR_ZONES]; + unsigned long dma_end_pfn; - start_pfn = node_start_pfn(nodeid); - end_pfn = node_end_pfn(nodeid); + memset(zones, 0, sizeof(unsigned long) * MAX_NR_ZONES); + memset(holes, 0, sizeof(unsigned long) * MAX_NR_ZONES); - Dprintk(KERN_INFO "setting up node %d %lx-%lx\n", - nodeid, start_pfn, end_pfn); + start_pfn = node_start_pfn(nodeid); + end_pfn = node_end_pfn(nodeid); - size_zones(zones, holes, start_pfn, end_pfn); + Dprintk(KERN_INFO "setting up node %d %lx-%lx\n", nodeid, start_pfn, end_pfn); + + /* All nodes > 0 have a zero length zone DMA */ + dma_end_pfn = __pa(MAX_DMA_ADDRESS) >> PAGE_SHIFT; + if (start_pfn < dma_end_pfn) { + zones[ZONE_DMA] = dma_end_pfn - start_pfn; + holes[ZONE_DMA] = e820_hole_size(start_pfn, dma_end_pfn); + zones[ZONE_NORMAL] = end_pfn - dma_end_pfn; + holes[ZONE_NORMAL] = e820_hole_size(dma_end_pfn, end_pfn); + + } else { + zones[ZONE_NORMAL] = end_pfn - start_pfn; + holes[ZONE_NORMAL] = e820_hole_size(start_pfn, end_pfn); + } + free_area_init_node(nodeid, NODE_DATA(nodeid), zones, start_pfn, holes); } @@ -176,7 +171,7 @@ void __init numa_init_array(void) for (i = 0; i < NR_CPUS; i++) { if (cpu_to_node[i] != NUMA_NO_NODE) continue; - numa_set_node(i, rr); + cpu_to_node[i] = rr; rr = next_node(rr, node_online_map); if (rr == MAX_NUMNODES) rr = first_node(node_online_map); @@ -210,6 +205,8 @@ static int numa_emulation(unsigned long start_pfn, unsigned long end_pfn) if (i == numa_fake-1) sz = (end_pfn<start = nd->end; } if (nd->end > end) { + if (!(end & 0xfff)) + end--; nd->end = end; if (nd->start > nd->end) nd->start = nd->end; @@ -164,6 +166,8 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) if (nd->end < end) nd->end = end; } + if (!(nd->end & 0xfff)) + nd->end--; printk(KERN_INFO "SRAT: Node %u PXM %u %Lx-%Lx\n", node, pxm, nd->start, nd->end); } @@ -199,7 +203,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) if (cpu_to_node[i] == NUMA_NO_NODE) continue; if (!node_isset(cpu_to_node[i], nodes_parsed)) - numa_set_node(i, NUMA_NO_NODE); + cpu_to_node[i] = NUMA_NO_NODE; } numa_init_array(); return 0; diff --git a/trunk/arch/x86_64/pci/Makefile b/trunk/arch/x86_64/pci/Makefile index a8f75a2a0f6f..bb34e5ef916c 100644 --- a/trunk/arch/x86_64/pci/Makefile +++ b/trunk/arch/x86_64/pci/Makefile @@ -11,7 +11,7 @@ obj-y += fixup.o obj-$(CONFIG_ACPI) += acpi.o obj-y += legacy.o irq.o common.o # mmconfig has a 64bit special -obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o +obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o obj-$(CONFIG_NUMA) += k8-bus.o diff --git a/trunk/arch/x86_64/pci/mmconfig.c b/trunk/arch/x86_64/pci/mmconfig.c index f16c0d57c552..a0838c4a94e4 100644 --- a/trunk/arch/x86_64/pci/mmconfig.c +++ b/trunk/arch/x86_64/pci/mmconfig.c @@ -8,21 +8,18 @@ #include #include #include -#include #include "pci.h" #define MMCONFIG_APER_SIZE (256*1024*1024) -static DECLARE_BITMAP(fallback_slots, 32); - /* Static virtual mapping of the MMCONFIG aperture */ struct mmcfg_virt { struct acpi_table_mcfg_config *cfg; - char __iomem *virt; + char *virt; }; static struct mmcfg_virt *pci_mmcfg_virt; -static char __iomem *get_virt(unsigned int seg, unsigned bus) +static char *get_virt(unsigned int seg, int bus) { int cfg_num = -1; struct acpi_table_mcfg_config *cfg; @@ -30,9 +27,10 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus) while (1) { ++cfg_num; if (cfg_num >= pci_mmcfg_config_num) { - /* Not found - fall back to type 1. This happens - e.g. on the internal devices of a K8 northbridge. */ - return NULL; + /* something bad is going on, no cfg table is found. */ + /* so we fall back to the old way we used to do this */ + /* and just rely on the first entry to be correct. */ + return pci_mmcfg_virt[0].virt; } cfg = pci_mmcfg_virt[cfg_num].cfg; if (cfg->pci_segment_group_number != seg) @@ -43,30 +41,20 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus) } } -static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) +static inline char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) { - char __iomem *addr; - if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots)) - return NULL; - addr = get_virt(seg, bus); - if (!addr) - return NULL; - return addr + ((bus << 20) | (devfn << 12)); + + return get_virt(seg, bus) + ((bus << 20) | (devfn << 12)); } static int pci_mmcfg_read(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 *value) { - char __iomem *addr; + char *addr = pci_dev_base(seg, bus, devfn); - /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095))) return -EINVAL; - addr = pci_dev_base(seg, bus, devfn); - if (!addr) - return pci_conf1_read(seg,bus,devfn,reg,len,value); - switch (len) { case 1: *value = readb(addr + reg); @@ -85,16 +73,11 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus, static int pci_mmcfg_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) { - char __iomem *addr; + char *addr = pci_dev_base(seg, bus, devfn); - /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) return -EINVAL; - addr = pci_dev_base(seg, bus, devfn); - if (!addr) - return pci_conf1_write(seg,bus,devfn,reg,len,value); - switch (len) { case 1: writeb(value, addr + reg); @@ -115,30 +98,6 @@ static struct pci_raw_ops pci_mmcfg = { .write = pci_mmcfg_write, }; -/* K8 systems have some devices (typically in the builtin northbridge) - that are only accessible using type1 - Normally this can be expressed in the MCFG by not listing them - and assigning suitable _SEGs, but this isn't implemented in some BIOS. - Instead try to discover all devices on bus 0 that are unreachable using MM - and fallback for them. - We only do this for bus 0/seg 0 */ -static __init void unreachable_devices(void) -{ - int i; - for (i = 0; i < 32; i++) { - u32 val1; - char __iomem *addr; - - pci_conf1_read(0, 0, PCI_DEVFN(i,0), 0, 4, &val1); - if (val1 == 0xffffffff) - continue; - addr = pci_dev_base(0, 0, PCI_DEVFN(i, 0)); - if (addr == NULL|| readl(addr) != val1) { - set_bit(i, &fallback_slots); - } - } -} - static int __init pci_mmcfg_init(void) { int i; @@ -169,8 +128,6 @@ static int __init pci_mmcfg_init(void) printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_config[i].base_address); } - unreachable_devices(); - raw_pci_ops = &pci_mmcfg; pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; diff --git a/trunk/block/as-iosched.c b/trunk/block/as-iosched.c index 43fa20495688..a78e160b59a3 100644 --- a/trunk/block/as-iosched.c +++ b/trunk/block/as-iosched.c @@ -1,4 +1,6 @@ /* + * linux/drivers/block/as-iosched.c + * * Anticipatory & deadline i/o scheduler. * * Copyright (C) 2002 Jens Axboe @@ -1371,6 +1373,10 @@ static void as_add_request(request_queue_t *q, struct request *rq) struct as_rq *alias; int data_dir; + if (arq->state != AS_RQ_PRESCHED) { + printk("arq->state: %d\n", arq->state); + WARN_ON(1); + } arq->state = AS_RQ_NEW; if (rq_data_dir(arq->request) == READ diff --git a/trunk/block/cfq-iosched.c b/trunk/block/cfq-iosched.c index ee0bb41694b0..2b64f5852bfd 100644 --- a/trunk/block/cfq-iosched.c +++ b/trunk/block/cfq-iosched.c @@ -1,4 +1,6 @@ /* + * linux/drivers/block/cfq-iosched.c + * * CFQ, or complete fairness queueing, disk scheduler. * * Based on ideas from a previously unfinished io diff --git a/trunk/block/deadline-iosched.c b/trunk/block/deadline-iosched.c index 9cbec09e8415..7929471d7df7 100644 --- a/trunk/block/deadline-iosched.c +++ b/trunk/block/deadline-iosched.c @@ -1,4 +1,6 @@ /* + * linux/drivers/block/deadline-iosched.c + * * Deadline i/o scheduler. * * Copyright (C) 2002 Jens Axboe diff --git a/trunk/block/elevator.c b/trunk/block/elevator.c index 6c3fc8a10bf2..e4c58827bb46 100644 --- a/trunk/block/elevator.c +++ b/trunk/block/elevator.c @@ -1,4 +1,6 @@ /* + * linux/drivers/block/elevator.c + * * Block device elevator/IO-scheduler. * * Copyright (C) 2000 Andrea Arcangeli SuSE diff --git a/trunk/block/ll_rw_blk.c b/trunk/block/ll_rw_blk.c index d4beb9a89ee0..5f52e30b43f8 100644 --- a/trunk/block/ll_rw_blk.c +++ b/trunk/block/ll_rw_blk.c @@ -1,4 +1,6 @@ /* + * linux/drivers/block/ll_rw_blk.c + * * Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1994, Karl Keyte: Added support for disk statistics * Elevator latency, (C) 2000 Andrea Arcangeli SuSE @@ -239,7 +241,7 @@ void blk_queue_make_request(request_queue_t * q, make_request_fn * mfn) q->backing_dev_info.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE; q->backing_dev_info.state = 0; q->backing_dev_info.capabilities = BDI_CAP_MAP_COPY; - blk_queue_max_sectors(q, SAFE_MAX_SECTORS); + blk_queue_max_sectors(q, MAX_SECTORS); blk_queue_hardsect_size(q, 512); blk_queue_dma_alignment(q, 511); blk_queue_congestion_threshold(q); @@ -555,12 +557,7 @@ void blk_queue_max_sectors(request_queue_t *q, unsigned short max_sectors) printk("%s: set to minimum %d\n", __FUNCTION__, max_sectors); } - if (BLK_DEF_MAX_SECTORS > max_sectors) - q->max_hw_sectors = q->max_sectors = max_sectors; - else { - q->max_sectors = BLK_DEF_MAX_SECTORS; - q->max_hw_sectors = max_sectors; - } + q->max_sectors = q->max_hw_sectors = max_sectors; } EXPORT_SYMBOL(blk_queue_max_sectors); @@ -662,8 +659,8 @@ EXPORT_SYMBOL(blk_queue_hardsect_size); void blk_queue_stack_limits(request_queue_t *t, request_queue_t *b) { /* zero is "infinity" */ - t->max_sectors = min_not_zero(t->max_sectors,b->max_sectors); - t->max_hw_sectors = min_not_zero(t->max_hw_sectors,b->max_hw_sectors); + t->max_sectors = t->max_hw_sectors = + min_not_zero(t->max_sectors,b->max_sectors); t->max_phys_segments = min(t->max_phys_segments,b->max_phys_segments); t->max_hw_segments = min(t->max_hw_segments,b->max_hw_segments); @@ -1298,15 +1295,9 @@ static inline int ll_new_hw_segment(request_queue_t *q, static int ll_back_merge_fn(request_queue_t *q, struct request *req, struct bio *bio) { - unsigned short max_sectors; int len; - if (unlikely(blk_pc_request(req))) - max_sectors = q->max_hw_sectors; - else - max_sectors = q->max_sectors; - - if (req->nr_sectors + bio_sectors(bio) > max_sectors) { + if (req->nr_sectors + bio_sectors(bio) > q->max_sectors) { req->flags |= REQ_NOMERGE; if (req == q->last_merge) q->last_merge = NULL; @@ -1336,16 +1327,9 @@ static int ll_back_merge_fn(request_queue_t *q, struct request *req, static int ll_front_merge_fn(request_queue_t *q, struct request *req, struct bio *bio) { - unsigned short max_sectors; int len; - if (unlikely(blk_pc_request(req))) - max_sectors = q->max_hw_sectors; - else - max_sectors = q->max_sectors; - - - if (req->nr_sectors + bio_sectors(bio) > max_sectors) { + if (req->nr_sectors + bio_sectors(bio) > q->max_sectors) { req->flags |= REQ_NOMERGE; if (req == q->last_merge) q->last_merge = NULL; @@ -2162,7 +2146,7 @@ int blk_rq_map_user(request_queue_t *q, struct request *rq, void __user *ubuf, struct bio *bio; int reading; - if (len > (q->max_hw_sectors << 9)) + if (len > (q->max_sectors << 9)) return -EINVAL; if (!len || !ubuf) return -EINVAL; @@ -2277,7 +2261,7 @@ int blk_rq_map_kern(request_queue_t *q, struct request *rq, void *kbuf, { struct bio *bio; - if (len > (q->max_hw_sectors << 9)) + if (len > (q->max_sectors << 9)) return -EINVAL; if (!len || !kbuf) return -EINVAL; @@ -2324,8 +2308,6 @@ void blk_execute_rq_nowait(request_queue_t *q, struct gendisk *bd_disk, generic_unplug_device(q); } -EXPORT_SYMBOL_GPL(blk_execute_rq_nowait); - /** * blk_execute_rq - insert a request into queue for execution * @q: queue to insert the request in @@ -2464,7 +2446,7 @@ void disk_round_stats(struct gendisk *disk) /* * queue lock must be held */ -void __blk_put_request(request_queue_t *q, struct request *req) +static void __blk_put_request(request_queue_t *q, struct request *req) { struct request_list *rl = req->rl; @@ -2493,8 +2475,6 @@ void __blk_put_request(request_queue_t *q, struct request *req) } } -EXPORT_SYMBOL_GPL(__blk_put_request); - void blk_put_request(struct request *req) { unsigned long flags; diff --git a/trunk/block/scsi_ioctl.c b/trunk/block/scsi_ioctl.c index 1d8852f7bbff..382dea7b224c 100644 --- a/trunk/block/scsi_ioctl.c +++ b/trunk/block/scsi_ioctl.c @@ -233,7 +233,7 @@ static int sg_io(struct file *file, request_queue_t *q, if (verify_command(file, cmd)) return -EPERM; - if (hdr->dxfer_len > (q->max_hw_sectors << 9)) + if (hdr->dxfer_len > (q->max_sectors << 9)) return -EIO; if (hdr->dxfer_len) @@ -442,37 +442,11 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q, return err; } - -/* Send basic block requests */ -static int __blk_send_generic(request_queue_t *q, struct gendisk *bd_disk, int cmd, int data) -{ - struct request *rq; - int err; - - rq = blk_get_request(q, WRITE, __GFP_WAIT); - rq->flags |= REQ_BLOCK_PC; - rq->data = NULL; - rq->data_len = 0; - rq->timeout = BLK_DEFAULT_TIMEOUT; - memset(rq->cmd, 0, sizeof(rq->cmd)); - rq->cmd[0] = cmd; - rq->cmd[4] = data; - rq->cmd_len = 6; - err = blk_execute_rq(q, bd_disk, rq, 0); - blk_put_request(rq); - - return err; -} - -static inline int blk_send_start_stop(request_queue_t *q, struct gendisk *bd_disk, int data) -{ - return __blk_send_generic(q, bd_disk, GPCMD_START_STOP_UNIT, data); -} - int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, void __user *arg) { request_queue_t *q; - int err; + struct request *rq; + int close = 0, err; q = bd_disk->queue; if (!q) @@ -590,10 +564,19 @@ int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, err = sg_scsi_ioctl(file, q, bd_disk, arg); break; case CDROMCLOSETRAY: - err = blk_send_start_stop(q, bd_disk, 0x03); - break; + close = 1; case CDROMEJECT: - err = blk_send_start_stop(q, bd_disk, 0x02); + rq = blk_get_request(q, WRITE, __GFP_WAIT); + rq->flags |= REQ_BLOCK_PC; + rq->data = NULL; + rq->data_len = 0; + rq->timeout = BLK_DEFAULT_TIMEOUT; + memset(rq->cmd, 0, sizeof(rq->cmd)); + rq->cmd[0] = GPCMD_START_STOP_UNIT; + rq->cmd[4] = 0x02 + (close != 0); + rq->cmd_len = 6; + err = blk_execute_rq(q, bd_disk, rq, 0); + blk_put_request(rq); break; default: err = -ENOTTY; diff --git a/trunk/drivers/Makefile b/trunk/drivers/Makefile index ea410b6b7644..fac1e1603097 100644 --- a/trunk/drivers/Makefile +++ b/trunk/drivers/Makefile @@ -5,7 +5,7 @@ # Rewritten to use lists instead of if-statements. # -obj-$(CONFIG_PCI) += pci/ +obj-$(CONFIG_PCI) += pci/ usb/ obj-$(CONFIG_PARISC) += parisc/ obj-$(CONFIG_RAPIDIO) += rapidio/ obj-y += video/ @@ -49,7 +49,6 @@ obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/ obj-$(CONFIG_PARIDE) += block/paride/ obj-$(CONFIG_TC) += tc/ obj-$(CONFIG_USB) += usb/ -obj-$(CONFIG_PCI) += usb/ obj-$(CONFIG_USB_GADGET) += usb/gadget/ obj-$(CONFIG_GAMEPORT) += input/gameport/ obj-$(CONFIG_INPUT) += input/ diff --git a/trunk/drivers/acpi/Kconfig b/trunk/drivers/acpi/Kconfig index fce21c257523..fe1e8126fbae 100644 --- a/trunk/drivers/acpi/Kconfig +++ b/trunk/drivers/acpi/Kconfig @@ -197,6 +197,7 @@ config ACPI_ASUS config ACPI_IBM tristate "IBM ThinkPad Laptop Extras" depends on X86 + default y ---help--- This is a Linux ACPI driver for the IBM ThinkPad laptops. It adds support for Fn-Fx key combinations, Bluetooth control, video diff --git a/trunk/drivers/acpi/Makefile b/trunk/drivers/acpi/Makefile index 5984b4f6715a..a18243488c66 100644 --- a/trunk/drivers/acpi/Makefile +++ b/trunk/drivers/acpi/Makefile @@ -16,7 +16,7 @@ EXTRA_CFLAGS += $(ACPI_CFLAGS) # ACPI Boot-Time Table Parsing # obj-y += tables.o -obj-$(CONFIG_X86) += blacklist.o +obj-y += blacklist.o # # ACPI Core Subsystem (Interpreter) diff --git a/trunk/drivers/acpi/bus.c b/trunk/drivers/acpi/bus.c index 606f8733a776..6a4da417c16b 100644 --- a/trunk/drivers/acpi/bus.c +++ b/trunk/drivers/acpi/bus.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #ifdef CONFIG_X86 @@ -755,7 +754,7 @@ static int __init acpi_init(void) result = acpi_bus_init(); if (!result) { -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM if (!PM_IS_ACTIVE()) pm_active = 1; else { diff --git a/trunk/drivers/acpi/pci_link.c b/trunk/drivers/acpi/pci_link.c index 78927c0f1551..82292b77e5c6 100644 --- a/trunk/drivers/acpi/pci_link.c +++ b/trunk/drivers/acpi/pci_link.c @@ -316,7 +316,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) if (!link || !irq) return_VALUE(-EINVAL); - resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC); + resource = kmalloc(sizeof(*resource) + 1, GFP_KERNEL); if (!resource) return_VALUE(-ENOMEM); diff --git a/trunk/drivers/acpi/processor_core.c b/trunk/drivers/acpi/processor_core.c index 0c561c571f29..421792562642 100644 --- a/trunk/drivers/acpi/processor_core.c +++ b/trunk/drivers/acpi/processor_core.c @@ -543,8 +543,6 @@ static int acpi_processor_get_info(struct acpi_processor *pr) return_VALUE(0); } -static void *processor_device_array[NR_CPUS]; - static int acpi_processor_start(struct acpi_device *device) { int result = 0; @@ -563,19 +561,6 @@ static int acpi_processor_start(struct acpi_device *device) BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0)); - /* - * Buggy BIOS check - * ACPI id of processors can be reported wrongly by the BIOS. - * Don't trust it blindly - */ - if (processor_device_array[pr->id] != NULL && - processor_device_array[pr->id] != (void *)device) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "BIOS reporting wrong ACPI id" - "for the processor\n")); - return_VALUE(-ENODEV); - } - processor_device_array[pr->id] = (void *)device; - processors[pr->id] = pr; result = acpi_processor_add_fs(device); diff --git a/trunk/drivers/acpi/processor_idle.c b/trunk/drivers/acpi/processor_idle.c index 807b0df308f1..573b6a97bb1f 100644 --- a/trunk/drivers/acpi/processor_idle.c +++ b/trunk/drivers/acpi/processor_idle.c @@ -169,11 +169,15 @@ acpi_processor_power_activate(struct acpi_processor *pr, static void acpi_safe_halt(void) { - clear_thread_flag(TIF_POLLING_NRFLAG); - smp_mb__after_clear_bit(); + int polling = test_thread_flag(TIF_POLLING_NRFLAG); + if (polling) { + clear_thread_flag(TIF_POLLING_NRFLAG); + smp_mb__after_clear_bit(); + } if (!need_resched()) safe_halt(); - set_thread_flag(TIF_POLLING_NRFLAG); + if (polling) + set_thread_flag(TIF_POLLING_NRFLAG); } static atomic_t c3_cpu_count; @@ -274,17 +278,6 @@ static void acpi_processor_idle(void) } } -#ifdef CONFIG_HOTPLUG_CPU - /* - * Check for P_LVL2_UP flag before entering C2 and above on - * an SMP system. We do it here instead of doing it at _CST/P_LVL - * detection phase, to work cleanly with logical CPU hotplug. - */ - if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && - !pr->flags.has_cst && !acpi_fadt.plvl2_up) - cx = &pr->power.states[ACPI_STATE_C1]; -#endif - cx->usage++; /* @@ -292,16 +285,6 @@ static void acpi_processor_idle(void) * ------ * Invoke the current Cx state to put the processor to sleep. */ - if (cx->type == ACPI_STATE_C2 || cx->type == ACPI_STATE_C3) { - clear_thread_flag(TIF_POLLING_NRFLAG); - smp_mb__after_clear_bit(); - if (need_resched()) { - set_thread_flag(TIF_POLLING_NRFLAG); - local_irq_enable(); - return; - } - } - switch (cx->type) { case ACPI_STATE_C1: @@ -334,7 +317,6 @@ static void acpi_processor_idle(void) t2 = inl(acpi_fadt.xpm_tmr_blk.address); /* Re-enable interrupts */ local_irq_enable(); - set_thread_flag(TIF_POLLING_NRFLAG); /* Compute time (ticks) that we were actually asleep */ sleep_ticks = ticks_elapsed(t1, t2) - cx->latency_ticks - C2_OVERHEAD; @@ -374,7 +356,6 @@ static void acpi_processor_idle(void) /* Re-enable interrupts */ local_irq_enable(); - set_thread_flag(TIF_POLLING_NRFLAG); /* Compute time (ticks) that we were actually asleep */ sleep_ticks = ticks_elapsed(t1, t2) - cx->latency_ticks - C3_OVERHEAD; @@ -387,15 +368,6 @@ static void acpi_processor_idle(void) next_state = pr->power.state; -#ifdef CONFIG_HOTPLUG_CPU - /* Don't do promotion/demotion */ - if ((cx->type == ACPI_STATE_C1) && (num_online_cpus() > 1) && - !pr->flags.has_cst && !acpi_fadt.plvl2_up) { - next_state = cx; - goto end; - } -#endif - /* * Promotion? * ---------- @@ -542,6 +514,8 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr) static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) { + int i; + ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_fadt"); if (!pr) @@ -550,7 +524,8 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) if (!pr->pblk) return_VALUE(-ENODEV); - memset(pr->power.states, 0, sizeof(pr->power.states)); + for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++) + memset(pr->power.states, 0, sizeof(struct acpi_processor_cx)); /* if info is obtained from pblk/fadt, type equals state */ pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1; @@ -562,15 +537,6 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) pr->power.states[ACPI_STATE_C0].valid = 1; pr->power.states[ACPI_STATE_C1].valid = 1; -#ifndef CONFIG_HOTPLUG_CPU - /* - * Check for P_LVL2_UP flag before entering C2 and above on - * an SMP system. - */ - if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up) - return_VALUE(-ENODEV); -#endif - /* determine C2 and C3 address from pblk */ pr->power.states[ACPI_STATE_C2].address = pr->pblk + 4; pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5; @@ -589,9 +555,13 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr) { + int i; + ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1"); - memset(pr->power.states, 0, sizeof(pr->power.states)); + for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++) + memset(&(pr->power.states[i]), 0, + sizeof(struct acpi_processor_cx)); /* if info is obtained from pblk/fadt, type equals state */ pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1; @@ -727,7 +697,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) /* Validate number of power states discovered */ if (pr->power.count < 2) - status = -EFAULT; + status = -ENODEV; end: acpi_os_free(buffer.pointer); @@ -878,11 +848,11 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) * this function */ result = acpi_processor_get_power_info_cst(pr); - if (result == -ENODEV) + if ((result) || (acpi_processor_power_verify(pr) < 2)) { result = acpi_processor_get_power_info_fadt(pr); - - if ((result) || (acpi_processor_power_verify(pr) < 2)) - result = acpi_processor_get_power_info_default_c1(pr); + if ((result) || (acpi_processor_power_verify(pr) < 2)) + result = acpi_processor_get_power_info_default_c1(pr); + } /* * Set Default Policy @@ -903,8 +873,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { if (pr->power.states[i].valid) { pr->power.count = i; - if (pr->power.states[i].type >= ACPI_STATE_C2) - pr->flags.power = 1; + pr->flags.power = 1; } } diff --git a/trunk/drivers/acpi/processor_thermal.c b/trunk/drivers/acpi/processor_thermal.c index dc9817cfb882..37528c3b64b0 100644 --- a/trunk/drivers/acpi/processor_thermal.c +++ b/trunk/drivers/acpi/processor_thermal.c @@ -101,9 +101,11 @@ static unsigned int acpi_thermal_cpufreq_is_init = 0; static int cpu_has_cpufreq(unsigned int cpu) { struct cpufreq_policy policy; - if (!acpi_thermal_cpufreq_is_init || cpufreq_get_policy(&policy, cpu)) - return 0; - return 1; + if (!acpi_thermal_cpufreq_is_init) + return -ENODEV; + if (!cpufreq_get_policy(&policy, cpu)) + return -ENODEV; + return 0; } static int acpi_thermal_cpufreq_increase(unsigned int cpu) @@ -125,13 +127,13 @@ static int acpi_thermal_cpufreq_decrease(unsigned int cpu) if (!cpu_has_cpufreq(cpu)) return -ENODEV; - if (cpufreq_thermal_reduction_pctg[cpu] > 20) + if (cpufreq_thermal_reduction_pctg[cpu] >= 20) { cpufreq_thermal_reduction_pctg[cpu] -= 20; - else - cpufreq_thermal_reduction_pctg[cpu] = 0; - cpufreq_update_policy(cpu); - /* We reached max freq again and can leave passive mode */ - return !cpufreq_thermal_reduction_pctg[cpu]; + cpufreq_update_policy(cpu); + return 0; + } + + return -ERANGE; } static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb, @@ -198,7 +200,7 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type) int result = 0; struct acpi_processor *pr = NULL; struct acpi_device *device = NULL; - int tx = 0, max_tx_px = 0; + int tx = 0; ACPI_FUNCTION_TRACE("acpi_processor_set_thermal_limit"); @@ -257,27 +259,19 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type) /* if going down: T-states first, P-states later */ if (pr->flags.throttling) { - if (tx == 0) { - max_tx_px = 1; + if (tx == 0) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "At minimum throttling state\n")); - } else { + else { tx--; goto end; } } result = acpi_thermal_cpufreq_decrease(pr->id); - if (result) { - /* - * We only could get -ERANGE, 1 or 0. - * In the first two cases we reached max freq again. - */ + if (result == -ERANGE) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "At minimum performance state\n")); - max_tx_px = 1; - } else - max_tx_px = 0; break; } @@ -296,10 +290,8 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type) pr->limit.thermal.px, pr->limit.thermal.tx)); } else result = 0; - if (max_tx_px) - return_VALUE(1); - else - return_VALUE(result); + + return_VALUE(result); } int acpi_processor_get_limit_info(struct acpi_processor *pr) diff --git a/trunk/drivers/acpi/scan.c b/trunk/drivers/acpi/scan.c index 31218e1d2a18..23e2c6968a11 100644 --- a/trunk/drivers/acpi/scan.c +++ b/trunk/drivers/acpi/scan.c @@ -1110,7 +1110,7 @@ acpi_add_single_object(struct acpi_device **child, * * TBD: Assumes LDM provides driver hot-plug capability. */ - acpi_bus_find_driver(device); + result = acpi_bus_find_driver(device); end: if (!result) diff --git a/trunk/drivers/acpi/thermal.c b/trunk/drivers/acpi/thermal.c index 19f3ea48475e..a24847c08f7f 100644 --- a/trunk/drivers/acpi/thermal.c +++ b/trunk/drivers/acpi/thermal.c @@ -72,7 +72,7 @@ #define _COMPONENT ACPI_THERMAL_COMPONENT ACPI_MODULE_NAME("acpi_thermal") -MODULE_AUTHOR("Paul Diefenbaugh"); + MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION(ACPI_THERMAL_DRIVER_NAME); MODULE_LICENSE("GPL"); @@ -517,9 +517,9 @@ static int acpi_thermal_hot(struct acpi_thermal *tz) return_VALUE(0); } -static void acpi_thermal_passive(struct acpi_thermal *tz) +static int acpi_thermal_passive(struct acpi_thermal *tz) { - int result = 1; + int result = 0; struct acpi_thermal_passive *passive = NULL; int trend = 0; int i = 0; @@ -527,7 +527,7 @@ static void acpi_thermal_passive(struct acpi_thermal *tz) ACPI_FUNCTION_TRACE("acpi_thermal_passive"); if (!tz || !tz->trips.passive.flags.valid) - return; + return_VALUE(-EINVAL); passive = &(tz->trips.passive); @@ -547,7 +547,7 @@ static void acpi_thermal_passive(struct acpi_thermal *tz) trend, passive->tc1, tz->temperature, tz->last_temperature, passive->tc2, tz->temperature, passive->temperature)); - passive->flags.enabled = 1; + tz->trips.passive.flags.enabled = 1; /* Heating up? */ if (trend > 0) for (i = 0; i < passive->devices.count; i++) @@ -556,32 +556,12 @@ static void acpi_thermal_passive(struct acpi_thermal *tz) handles[i], ACPI_PROCESSOR_LIMIT_INCREMENT); /* Cooling off? */ - else if (trend < 0) { + else if (trend < 0) for (i = 0; i < passive->devices.count; i++) - /* - * assume that we are on highest - * freq/lowest thrott and can leave - * passive mode, even in error case - */ - if (!acpi_processor_set_thermal_limit - (passive->devices.handles[i], - ACPI_PROCESSOR_LIMIT_DECREMENT)) - result = 0; - /* - * Leave cooling mode, even if the temp might - * higher than trip point This is because some - * machines might have long thermal polling - * frequencies (tsp) defined. We will fall back - * into passive mode in next cycle (probably quicker) - */ - if (result) { - passive->flags.enabled = 0; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Disabling passive cooling, still above threshold," - " but we are cooling down\n")); - } - } - return; + acpi_processor_set_thermal_limit(passive-> + devices. + handles[i], + ACPI_PROCESSOR_LIMIT_DECREMENT); } /* @@ -591,21 +571,23 @@ static void acpi_thermal_passive(struct acpi_thermal *tz) * and avoid thrashing around the passive trip point. Note that we * assume symmetry. */ - if (!passive->flags.enabled) - return; - for (i = 0; i < passive->devices.count; i++) - if (!acpi_processor_set_thermal_limit - (passive->devices.handles[i], - ACPI_PROCESSOR_LIMIT_DECREMENT)) - result = 0; - if (result) { - passive->flags.enabled = 0; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Disabling passive cooling (zone is cool)\n")); + else if (tz->trips.passive.flags.enabled) { + for (i = 0; i < passive->devices.count; i++) + result = + acpi_processor_set_thermal_limit(passive->devices. + handles[i], + ACPI_PROCESSOR_LIMIT_DECREMENT); + if (result == 1) { + tz->trips.passive.flags.enabled = 0; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Disabling passive cooling (zone is cool)\n")); + } } + + return_VALUE(0); } -static void acpi_thermal_active(struct acpi_thermal *tz) +static int acpi_thermal_active(struct acpi_thermal *tz) { int result = 0; struct acpi_thermal_active *active = NULL; @@ -616,66 +598,74 @@ static void acpi_thermal_active(struct acpi_thermal *tz) ACPI_FUNCTION_TRACE("acpi_thermal_active"); if (!tz) - return; + return_VALUE(-EINVAL); for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { + active = &(tz->trips.active[i]); if (!active || !active->flags.valid) break; + + /* + * Above Threshold? + * ---------------- + * If not already enabled, turn ON all cooling devices + * associated with this active threshold. + */ if (tz->temperature >= active->temperature) { - /* - * Above Threshold? - * ---------------- - * If not already enabled, turn ON all cooling devices - * associated with this active threshold. - */ if (active->temperature > maxtemp) - tz->state.active_index = i; - maxtemp = active->temperature; - if (active->flags.enabled) - continue; - for (j = 0; j < active->devices.count; j++) { - result = - acpi_bus_set_power(active->devices. - handles[j], - ACPI_STATE_D0); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, - "Unable to turn cooling device [%p] 'on'\n", + tz->state.active_index = i, maxtemp = + active->temperature; + if (!active->flags.enabled) { + for (j = 0; j < active->devices.count; j++) { + result = + acpi_bus_set_power(active->devices. + handles[j], + ACPI_STATE_D0); + if (result) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Unable to turn cooling device [%p] 'on'\n", + active-> + devices. + handles[j])); + continue; + } + active->flags.enabled = 1; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Cooling device [%p] now 'on'\n", active->devices. handles[j])); - continue; } - active->flags.enabled = 1; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Cooling device [%p] now 'on'\n", - active->devices.handles[j])); } - continue; } - if (!active->flags.enabled) - continue; /* * Below Threshold? * ---------------- * Turn OFF all cooling devices associated with this * threshold. */ - for (j = 0; j < active->devices.count; j++) { - result = acpi_bus_set_power(active->devices.handles[j], - ACPI_STATE_D3); - if (result) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, - "Unable to turn cooling device [%p] 'off'\n", + else if (active->flags.enabled) { + for (j = 0; j < active->devices.count; j++) { + result = + acpi_bus_set_power(active->devices. + handles[j], + ACPI_STATE_D3); + if (result) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Unable to turn cooling device [%p] 'off'\n", + active->devices. + handles[j])); + continue; + } + active->flags.enabled = 0; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Cooling device [%p] now 'off'\n", active->devices.handles[j])); - continue; } - active->flags.enabled = 0; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Cooling device [%p] now 'off'\n", - active->devices.handles[j])); } } + + return_VALUE(0); } static void acpi_thermal_check(void *context); @@ -754,12 +744,15 @@ static void acpi_thermal_check(void *data) * Again, separated from the above two to allow independent policy * decisions. */ - tz->state.critical = tz->trips.critical.flags.enabled; - tz->state.hot = tz->trips.hot.flags.enabled; - tz->state.passive = tz->trips.passive.flags.enabled; - tz->state.active = 0; + if (tz->trips.critical.flags.enabled) + tz->state.critical = 1; + if (tz->trips.hot.flags.enabled) + tz->state.hot = 1; + if (tz->trips.passive.flags.enabled) + tz->state.passive = 1; for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) - tz->state.active |= tz->trips.active[i].flags.enabled; + if (tz->trips.active[i].flags.enabled) + tz->state.active = 1; /* * Calculate Sleep Time diff --git a/trunk/drivers/acpi/utilities/utmisc.c b/trunk/drivers/acpi/utilities/utmisc.c index 2ce872d75890..0c5abc536c7a 100644 --- a/trunk/drivers/acpi/utilities/utmisc.c +++ b/trunk/drivers/acpi/utilities/utmisc.c @@ -84,14 +84,14 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) /* Find a free owner ID */ - for (i = 0; i < 64; i++) { - if (!(acpi_gbl_owner_id_mask & (1ULL << i))) { + for (i = 0; i < 32; i++) { + if (!(acpi_gbl_owner_id_mask & (1 << i))) { ACPI_DEBUG_PRINT((ACPI_DB_VALUES, - "Current owner_id mask: %16.16LX New ID: %2.2X\n", + "Current owner_id mask: %8.8X New ID: %2.2X\n", acpi_gbl_owner_id_mask, (unsigned int)(i + 1))); - acpi_gbl_owner_id_mask |= (1ULL << i); + acpi_gbl_owner_id_mask |= (1 << i); *owner_id = (acpi_owner_id) (i + 1); goto exit; } @@ -106,7 +106,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) */ *owner_id = 0; status = AE_OWNER_ID_LIMIT; - ACPI_REPORT_ERROR(("Could not allocate new owner_id (64 max), AE_OWNER_ID_LIMIT\n")); + ACPI_REPORT_ERROR(("Could not allocate new owner_id (32 max), AE_OWNER_ID_LIMIT\n")); exit: (void)acpi_ut_release_mutex(ACPI_MTX_CACHES); @@ -123,7 +123,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) * control method or unloading a table. Either way, we would * ignore any error anyway. * - * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 64 + * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 32 * ******************************************************************************/ @@ -140,7 +140,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) /* Zero is not a valid owner_iD */ - if ((owner_id == 0) || (owner_id > 64)) { + if ((owner_id == 0) || (owner_id > 32)) { ACPI_REPORT_ERROR(("Invalid owner_id: %2.2X\n", owner_id)); return_VOID; } @@ -158,8 +158,8 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) /* Free the owner ID only if it is valid */ - if (acpi_gbl_owner_id_mask & (1ULL << owner_id)) { - acpi_gbl_owner_id_mask ^= (1ULL << owner_id); + if (acpi_gbl_owner_id_mask & (1 << owner_id)) { + acpi_gbl_owner_id_mask ^= (1 << owner_id); } (void)acpi_ut_release_mutex(ACPI_MTX_CACHES); diff --git a/trunk/drivers/acpi/video.c b/trunk/drivers/acpi/video.c index d10668f14699..f051b151580d 100644 --- a/trunk/drivers/acpi/video.c +++ b/trunk/drivers/acpi/video.c @@ -812,7 +812,7 @@ acpi_video_device_write_brightness(struct file *file, ACPI_FUNCTION_TRACE("acpi_video_device_write_brightness"); - if (!dev || !dev->brightness || count + 1 > sizeof str) + if (!dev || count + 1 > sizeof str) return_VALUE(-EINVAL); if (copy_from_user(str, buffer, count)) diff --git a/trunk/drivers/atm/Kconfig b/trunk/drivers/atm/Kconfig index 01a9f1cb7743..489de81ea609 100644 --- a/trunk/drivers/atm/Kconfig +++ b/trunk/drivers/atm/Kconfig @@ -5,13 +5,6 @@ menu "ATM drivers" depends on NETDEVICES && ATM -config ATM_DUMMY - tristate "Dummy ATM driver" - depends on ATM - help - Dummy ATM driver. Useful for proxy signalling, testing, - and development. If unsure, say N. - config ATM_TCP tristate "ATM over TCP" depends on INET && ATM diff --git a/trunk/drivers/atm/Makefile b/trunk/drivers/atm/Makefile index b5077ce8cb40..5b77188527a9 100644 --- a/trunk/drivers/atm/Makefile +++ b/trunk/drivers/atm/Makefile @@ -31,7 +31,6 @@ ifeq ($(CONFIG_ATM_IDT77252_USE_SUNI),y) obj-$(CONFIG_ATM_IDT77252) += suni.o endif -obj-$(CONFIG_ATM_DUMMY) += adummy.o obj-$(CONFIG_ATM_TCP) += atmtcp.o obj-$(CONFIG_ATM_FIRESTREAM) += firestream.o obj-$(CONFIG_ATM_LANAI) += lanai.o diff --git a/trunk/drivers/atm/adummy.c b/trunk/drivers/atm/adummy.c deleted file mode 100644 index d1387cfe2d30..000000000000 --- a/trunk/drivers/atm/adummy.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - * adummy.c: a dummy ATM driver - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* version definition */ - -#define DRV_VERSION "1.0" - -#define DEV_LABEL "adummy" - -#define ADUMMY_DEV(dev) ((struct adummy_dev *) (dev)->dev_data) - -struct adummy_dev { - struct atm_dev *atm_dev; - - struct list_head entry; -}; - -/* globals */ - -static LIST_HEAD(adummy_devs); - -static int __init -adummy_start(struct atm_dev *dev) -{ - dev->ci_range.vpi_bits = 4; - dev->ci_range.vci_bits = 12; - - return 0; -} - -static int -adummy_open(struct atm_vcc *vcc) -{ - short vpi = vcc->vpi; - int vci = vcc->vci; - - if (vci == ATM_VCI_UNSPEC || vpi == ATM_VPI_UNSPEC) - return 0; - - set_bit(ATM_VF_ADDR, &vcc->flags); - set_bit(ATM_VF_READY, &vcc->flags); - - return 0; -} - -static void -adummy_close(struct atm_vcc *vcc) -{ - clear_bit(ATM_VF_READY, &vcc->flags); - clear_bit(ATM_VF_ADDR, &vcc->flags); -} - -static int -adummy_send(struct atm_vcc *vcc, struct sk_buff *skb) -{ - if (vcc->pop) - vcc->pop(vcc, skb); - else - dev_kfree_skb_any(skb); - atomic_inc(&vcc->stats->tx); - - return 0; -} - -static int -adummy_proc_read(struct atm_dev *dev, loff_t *pos, char *page) -{ - int left = *pos; - - if (!left--) - return sprintf(page, "version %s\n", DRV_VERSION); - - return 0; -} - -static struct atmdev_ops adummy_ops = -{ - .open = adummy_open, - .close = adummy_close, - .send = adummy_send, - .proc_read = adummy_proc_read, - .owner = THIS_MODULE -}; - -static int __init adummy_init(void) -{ - struct atm_dev *atm_dev; - struct adummy_dev *adummy_dev; - int err = 0; - - printk(KERN_ERR "adummy: version %s\n", DRV_VERSION); - - adummy_dev = (struct adummy_dev *) kmalloc(sizeof(struct adummy_dev), - GFP_KERNEL); - if (!adummy_dev) { - printk(KERN_ERR DEV_LABEL ": kmalloc() failed\n"); - err = -ENOMEM; - goto out; - } - memset(adummy_dev, 0, sizeof(struct adummy_dev)); - - atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, NULL); - if (!atm_dev) { - printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n"); - err = -ENODEV; - goto out_kfree; - } - - adummy_dev->atm_dev = atm_dev; - atm_dev->dev_data = adummy_dev; - - if (adummy_start(atm_dev)) { - printk(KERN_ERR DEV_LABEL ": adummy_start() failed\n"); - err = -ENODEV; - goto out_unregister; - } - - list_add(&adummy_dev->entry, &adummy_devs); -out: - return err; - -out_unregister: - atm_dev_deregister(atm_dev); -out_kfree: - kfree(adummy_dev); - goto out; -} - -static void __exit adummy_cleanup(void) -{ - struct adummy_dev *adummy_dev, *next; - - list_for_each_entry_safe(adummy_dev, next, &adummy_devs, entry) { - atm_dev_deregister(adummy_dev->atm_dev); - kfree(adummy_dev); - } -} - -module_init(adummy_init); -module_exit(adummy_cleanup); - -MODULE_AUTHOR("chas williams "); -MODULE_DESCRIPTION("dummy ATM driver"); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/atm/atmdev_init.c b/trunk/drivers/atm/atmdev_init.c new file mode 100644 index 000000000000..0e09e5c28e3f --- /dev/null +++ b/trunk/drivers/atm/atmdev_init.c @@ -0,0 +1,54 @@ +/* drivers/atm/atmdev_init.c - ATM device driver initialization */ + +/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ + + +#include +#include + + +#ifdef CONFIG_ATM_ZATM +extern int zatm_detect(void); +#endif +#ifdef CONFIG_ATM_AMBASSADOR +extern int amb_detect(void); +#endif +#ifdef CONFIG_ATM_HORIZON +extern int hrz_detect(void); +#endif +#ifdef CONFIG_ATM_FORE200E +extern int fore200e_detect(void); +#endif +#ifdef CONFIG_ATM_LANAI +extern int lanai_detect(void); +#endif + + +/* + * For historical reasons, atmdev_init returns the number of devices found. + * Note that some detections may not go via atmdev_init (e.g. eni.c), so this + * number is meaningless. + */ + +int __init atmdev_init(void) +{ + int devs; + + devs = 0; +#ifdef CONFIG_ATM_ZATM + devs += zatm_detect(); +#endif +#ifdef CONFIG_ATM_AMBASSADOR + devs += amb_detect(); +#endif +#ifdef CONFIG_ATM_HORIZON + devs += hrz_detect(); +#endif +#ifdef CONFIG_ATM_FORE200E + devs += fore200e_detect(); +#endif +#ifdef CONFIG_ATM_LANAI + devs += lanai_detect(); +#endif + return devs; +} diff --git a/trunk/drivers/atm/atmtcp.c b/trunk/drivers/atm/atmtcp.c index fc518d85543d..57f1810fdccd 100644 --- a/trunk/drivers/atm/atmtcp.c +++ b/trunk/drivers/atm/atmtcp.c @@ -246,6 +246,10 @@ static void atmtcp_c_close(struct atm_vcc *vcc) { struct atm_dev *atmtcp_dev; struct atmtcp_dev_data *dev_data; + struct sock *s; + struct hlist_node *node; + struct atm_vcc *walk; + int i; atmtcp_dev = (struct atm_dev *) vcc->dev_data; dev_data = PRIV(atmtcp_dev); @@ -253,8 +257,20 @@ static void atmtcp_c_close(struct atm_vcc *vcc) if (dev_data->persist) return; atmtcp_dev->dev_data = NULL; kfree(dev_data); - atm_dev_deregister(atmtcp_dev); + shutdown_atm_dev(atmtcp_dev); vcc->dev_data = NULL; + read_lock(&vcc_sklist_lock); + for(i = 0; i < VCC_HTABLE_SIZE; ++i) { + struct hlist_head *head = &vcc_hash[i]; + + sk_for_each(s, node, head) { + walk = atm_sk(s); + if (walk->dev != atmtcp_dev) + continue; + wake_up(s->sk_sleep); + } + } + read_unlock(&vcc_sklist_lock); module_put(THIS_MODULE); } @@ -434,7 +450,7 @@ static int atmtcp_remove_persistent(int itf) if (PRIV(dev)->vcc) return 0; kfree(dev_data); atm_dev_put(dev); - atm_dev_deregister(dev); + shutdown_atm_dev(dev); return 0; } diff --git a/trunk/drivers/atm/lanai.c b/trunk/drivers/atm/lanai.c index 69f4c7ce9a63..51ec14787293 100644 --- a/trunk/drivers/atm/lanai.c +++ b/trunk/drivers/atm/lanai.c @@ -39,7 +39,7 @@ * o lanai_change_qos() isn't written yet * * o There aren't any ioctl's yet -- I'd like to eventually support - * setting loopback and LED modes that way. + * setting loopback and LED modes that way. (see lanai_ioctl) * * o If the segmentation engine or DMA gets shut down we should restart * card as per section 17.0i. (see lanai_reset) @@ -305,7 +305,7 @@ struct lanai_dev { * vci with their bit set */ static void vci_bitfield_iterate(struct lanai_dev *lanai, - const unsigned long *lp, + /*const*/ unsigned long *lp, void (*func)(struct lanai_dev *,vci_t vci)) { vci_t vci = find_first_bit(lp, NUM_VCI); @@ -951,7 +951,7 @@ static int __devinit eeprom_read(struct lanai_dev *lanai) /* read a big-endian 4-byte value out of eeprom */ static inline u32 eeprom_be4(const struct lanai_dev *lanai, int address) { - return be32_to_cpup((const u32 *) &lanai->eeprom[address]); + return be32_to_cpup((u32 *) (&lanai->eeprom[address])); } /* Checksum/validate EEPROM contents */ @@ -1160,7 +1160,7 @@ static inline int vcc_tx_space(const struct lanai_vcc *lvcc, int endptr) } /* test if VCC is currently backlogged */ -static inline int vcc_is_backlogged(const struct lanai_vcc *lvcc) +static inline int vcc_is_backlogged(/*const*/ struct lanai_vcc *lvcc) { return !skb_queue_empty(&lvcc->tx.backlog); } @@ -1395,8 +1395,7 @@ static void vcc_rx_aal5(struct lanai_vcc *lvcc, int endptr) { int size; struct sk_buff *skb; - const u32 *x; - u32 *end = &lvcc->rx.buf.start[endptr * 4]; + /*const*/ u32 *x, *end = &lvcc->rx.buf.start[endptr * 4]; int n = ((unsigned long) end) - ((unsigned long) lvcc->rx.buf.ptr); if (n < 0) n += lanai_buf_size(&lvcc->rx.buf); @@ -2112,7 +2111,7 @@ static int lanai_normalize_ci(struct lanai_dev *lanai, * shifted by that much as we compute * */ -static int pcr_to_cbricg(const struct atm_qos *qos) +static int pcr_to_cbricg(/*const*/ struct atm_qos *qos) { int rounddown = 0; /* 1 = Round PCR down, i.e. round ICG _up_ */ int x, icg, pcr = atm_pcr_goal(&qos->txtp); @@ -2435,6 +2434,93 @@ static int lanai_open(struct atm_vcc *atmvcc) return result; } +#if 0 +/* ioctl operations for card */ +/* NOTE: these are all DEBUGGING ONLY currently */ +static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void __user *arg) +{ + int result = 0; + struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data; + switch(cmd) { + case 2106275: + shutdown_atm_dev(atmdev); + return 0; + case 2200000: { + unsigned long flags; + spin_lock_irqsave(&lanai->servicelock, flags); + run_service(lanai); + spin_unlock_irqrestore(&lanai->servicelock, flags); + return 0; } + case 2200002: + get_statistics(lanai); + return 0; + case 2200003: { + unsigned int i; + for (i = 0; i <= 0x5C ; i += 4) { + if (i==0x48) /* Write-only butt reg */ + continue; + printk(KERN_CRIT DEV_LABEL " 0x%02X: " + "0x%08X\n", i, + (unsigned int) readl(lanai->base + i)); + barrier(); mb(); + pcistatus_check(lanai, 0); + barrier(); mb(); + } + return 0; } + case 2200004: { + u8 b; + u16 w; + u32 dw; + struct pci_dev *pci = lanai->pci; + (void) pci_read_config_word(pci, PCI_VENDOR_ID, &w); + DPRINTK("vendor = 0x%X\n", (unsigned int) w); + (void) pci_read_config_word(pci, PCI_DEVICE_ID, &w); + DPRINTK("device = 0x%X\n", (unsigned int) w); + (void) pci_read_config_word(pci, PCI_COMMAND, &w); + DPRINTK("command = 0x%X\n", (unsigned int) w); + (void) pci_read_config_word(pci, PCI_STATUS, &w); + DPRINTK("status = 0x%X\n", (unsigned int) w); + (void) pci_read_config_dword(pci, + PCI_CLASS_REVISION, &dw); + DPRINTK("class/revision = 0x%X\n", (unsigned int) dw); + (void) pci_read_config_byte(pci, + PCI_CACHE_LINE_SIZE, &b); + DPRINTK("cache line size = 0x%X\n", (unsigned int) b); + (void) pci_read_config_byte(pci, PCI_LATENCY_TIMER, &b); + DPRINTK("latency = %d (0x%X)\n", + (int) b, (unsigned int) b); + (void) pci_read_config_byte(pci, PCI_HEADER_TYPE, &b); + DPRINTK("header type = 0x%X\n", (unsigned int) b); + (void) pci_read_config_byte(pci, PCI_BIST, &b); + DPRINTK("bist = 0x%X\n", (unsigned int) b); + /* skipping a few here */ + (void) pci_read_config_byte(pci, + PCI_INTERRUPT_LINE, &b); + DPRINTK("pci_int_line = 0x%X\n", (unsigned int) b); + (void) pci_read_config_byte(pci, + PCI_INTERRUPT_PIN, &b); + DPRINTK("pci_int_pin = 0x%X\n", (unsigned int) b); + (void) pci_read_config_byte(pci, PCI_MIN_GNT, &b); + DPRINTK("min_gnt = 0x%X\n", (unsigned int) b); + (void) pci_read_config_byte(pci, PCI_MAX_LAT, &b); + DPRINTK("max_lat = 0x%X\n", (unsigned int) b); } + return 0; +#ifdef USE_POWERDOWN + case 2200005: + DPRINTK("Coming out of powerdown\n"); + lanai->conf1 &= ~CONFIG1_POWERDOWN; + conf1_write(lanai); + return 0; +#endif + default: + result = -ENOIOCTLCMD; + } + return result; +} +#else /* !0 */ +#define lanai_ioctl NULL +#endif /* 0 */ + static int lanai_send(struct atm_vcc *atmvcc, struct sk_buff *skb) { struct lanai_vcc *lvcc = (struct lanai_vcc *) atmvcc->dev_data; @@ -2592,6 +2678,7 @@ static const struct atmdev_ops ops = { .dev_close = lanai_dev_close, .open = lanai_open, .close = lanai_close, + .ioctl = lanai_ioctl, .getsockopt = NULL, .setsockopt = NULL, .send = lanai_send, @@ -2673,7 +2760,6 @@ static void __exit lanai_module_exit(void) * gone, so there isn't much to do */ DPRINTK("cleanup_module()\n"); - pci_unregister_driver(&lanai_driver); } module_init(lanai_module_init); diff --git a/trunk/drivers/base/bus.c b/trunk/drivers/base/bus.c index fa601b085eba..03204bfd17af 100644 --- a/trunk/drivers/base/bus.c +++ b/trunk/drivers/base/bus.c @@ -133,7 +133,7 @@ static struct kobj_type ktype_bus = { decl_subsys(bus, &ktype_bus, NULL); -/* Manually detach a device from its associated driver. */ +/* Manually detach a device from it's associated driver. */ static int driver_helper(struct device *dev, void *data) { const char *name = data; @@ -151,13 +151,14 @@ static ssize_t driver_unbind(struct device_driver *drv, int err = -ENODEV; dev = bus_find_device(bus, NULL, (void *)buf, driver_helper); - if (dev && dev->driver == drv) { + if ((dev) && + (dev->driver == drv)) { device_release_driver(dev); err = count; } - put_device(dev); - put_bus(bus); - return err; + if (err) + return err; + return count; } static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind); @@ -174,14 +175,16 @@ static ssize_t driver_bind(struct device_driver *drv, int err = -ENODEV; dev = bus_find_device(bus, NULL, (void *)buf, driver_helper); - if (dev && dev->driver == NULL) { + if ((dev) && + (dev->driver == NULL)) { down(&dev->sem); err = driver_probe_device(drv, dev); up(&dev->sem); + put_device(dev); } - put_device(dev); - put_bus(bus); - return err; + if (err) + return err; + return count; } static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind); diff --git a/trunk/drivers/base/dd.c b/trunk/drivers/base/dd.c index 3b419c9a1e7e..3565e9795301 100644 --- a/trunk/drivers/base/dd.c +++ b/trunk/drivers/base/dd.c @@ -62,6 +62,7 @@ void device_bind_driver(struct device * dev) * because we don't know the format of the ID structures, nor what * is to be considered a match and what is not. * + * * This function returns 1 if a match is found, an error if one * occurs (that is not -ENODEV or -ENXIO), and 0 otherwise. * @@ -157,6 +158,7 @@ static int __driver_attach(struct device * dev, void * data) driver_probe_device(drv, dev); up(&dev->sem); + return 0; } @@ -223,15 +225,15 @@ void driver_detach(struct device_driver * drv) struct device * dev; for (;;) { - spin_lock(&drv->klist_devices.k_lock); + spin_lock_irq(&drv->klist_devices.k_lock); if (list_empty(&drv->klist_devices.k_list)) { - spin_unlock(&drv->klist_devices.k_lock); + spin_unlock_irq(&drv->klist_devices.k_lock); break; } dev = list_entry(drv->klist_devices.k_list.prev, struct device, knode_driver.n_node); get_device(dev); - spin_unlock(&drv->klist_devices.k_lock); + spin_unlock_irq(&drv->klist_devices.k_lock); down(&dev->sem); if (dev->driver == drv) diff --git a/trunk/drivers/base/firmware_class.c b/trunk/drivers/base/firmware_class.c index 59dacb6552c0..98f6c02d6790 100644 --- a/trunk/drivers/base/firmware_class.c +++ b/trunk/drivers/base/firmware_class.c @@ -526,23 +526,18 @@ request_firmware_work_func(void *arg) { struct firmware_work *fw_work = arg; const struct firmware *fw; - int ret; if (!arg) { WARN_ON(1); return 0; } daemonize("%s/%s", "firmware", fw_work->name); - ret = _request_firmware(&fw, fw_work->name, fw_work->device, + _request_firmware(&fw, fw_work->name, fw_work->device, fw_work->hotplug); - if (ret < 0) - fw_work->cont(NULL, fw_work->context); - else { - fw_work->cont(fw, fw_work->context); - release_firmware(fw); - } + fw_work->cont(fw, fw_work->context); + release_firmware(fw); module_put(fw_work->module); kfree(fw_work); - return ret; + return 0; } /** @@ -591,8 +586,6 @@ request_firmware_nowait( if (ret < 0) { fw_work->cont(NULL, fw_work->context); - module_put(fw_work->module); - kfree(fw_work); return ret; } return 0; diff --git a/trunk/drivers/base/memory.c b/trunk/drivers/base/memory.c index bc3ca6a656b2..b7ddd651d664 100644 --- a/trunk/drivers/base/memory.c +++ b/trunk/drivers/base/memory.c @@ -28,6 +28,7 @@ static struct sysdev_class memory_sysdev_class = { set_kset_name(MEMORY_CLASS_NAME), }; +EXPORT_SYMBOL(memory_sysdev_class); static char *memory_hotplug_name(struct kset *kset, struct kobject *kobj) { diff --git a/trunk/drivers/block/Kconfig b/trunk/drivers/block/Kconfig index c4b9d2adfc08..7b1cd93892be 100644 --- a/trunk/drivers/block/Kconfig +++ b/trunk/drivers/block/Kconfig @@ -358,8 +358,7 @@ config BLK_DEV_UB This driver supports certain USB attached storage devices such as flash keys. - If you enable this driver, it is recommended to avoid conflicts - with usb-storage by enabling USB_LIBUSUAL. + Warning: Enabling this cripples the usb-storage driver. If unsure, say N. diff --git a/trunk/drivers/block/cciss.c b/trunk/drivers/block/cciss.c index c3441b3f086e..e239a6c29230 100644 --- a/trunk/drivers/block/cciss.c +++ b/trunk/drivers/block/cciss.c @@ -1017,11 +1017,10 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, status = -ENOMEM; goto cleanup1; } - if (ioc->Request.Type.Direction == XFER_WRITE) { - if (copy_from_user(buff[sg_used], data_ptr, sz)) { + if (ioc->Request.Type.Direction == XFER_WRITE && + copy_from_user(buff[sg_used], data_ptr, sz)) { status = -ENOMEM; - goto cleanup1; - } + goto cleanup1; } else { memset(buff[sg_used], 0, sz); } @@ -1139,14 +1138,8 @@ static int revalidate_allvol(ctlr_info_t *host) for(i=0; i< NWD; i++) { struct gendisk *disk = host->gendisk[i]; - if (disk) { - request_queue_t *q = disk->queue; - - if (disk->flags & GENHD_FL_UP) - del_gendisk(disk); - if (q) - blk_cleanup_queue(q); - } + if (disk->flags & GENHD_FL_UP) + del_gendisk(disk); } /* @@ -1460,14 +1453,10 @@ static int deregister_disk(struct gendisk *disk, drive_info_struct *drv, * allows us to delete disk zero but keep the controller registered. */ if (h->gendisk[0] != disk){ - if (disk) { - request_queue_t *q = disk->queue; - if (disk->flags & GENHD_FL_UP) - del_gendisk(disk); - if (q) { - blk_cleanup_queue(q); - drv->queue = NULL; - } + if (disk->flags & GENHD_FL_UP){ + blk_cleanup_queue(disk->queue); + del_gendisk(disk); + drv->queue = NULL; } } @@ -3236,13 +3225,9 @@ static void __devexit cciss_remove_one (struct pci_dev *pdev) /* remove it from the disk list */ for (j = 0; j < NWD; j++) { struct gendisk *disk = hba[i]->gendisk[j]; - if (disk) { - request_queue_t *q = disk->queue; - - if (disk->flags & GENHD_FL_UP) - del_gendisk(disk); - if (q) - blk_cleanup_queue(q); + if (disk->flags & GENHD_FL_UP) { + del_gendisk(disk); + blk_cleanup_queue(disk->queue); } } diff --git a/trunk/drivers/block/cciss_scsi.c b/trunk/drivers/block/cciss_scsi.c index 2942d32280a5..3226aa11c6ef 100644 --- a/trunk/drivers/block/cciss_scsi.c +++ b/trunk/drivers/block/cciss_scsi.c @@ -255,7 +255,7 @@ scsi_cmd_stack_free(int ctlr) #define DEVICETYPE(n) (n<0 || n>MAX_SCSI_DEVICE_CODE) ? \ "Unknown" : scsi_device_types[n] -#if 0 +#if 1 static int xmargin=8; static int amargin=60; diff --git a/trunk/drivers/block/floppy.c b/trunk/drivers/block/floppy.c index f7e765a1d313..13b8a9bed66e 100644 --- a/trunk/drivers/block/floppy.c +++ b/trunk/drivers/block/floppy.c @@ -3714,6 +3714,12 @@ static int floppy_open(struct inode *inode, struct file *filp) USETF(FD_VERIFY); } + /* set underlying gendisk policy to reflect real ro/rw status */ + if (UTESTF(FD_DISK_WRITABLE)) + inode->i_bdev->bd_disk->policy = 0; + else + inode->i_bdev->bd_disk->policy = 1; + if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (filp->f_flags & O_EXCL))) goto out2; diff --git a/trunk/drivers/block/pktcdvd.c b/trunk/drivers/block/pktcdvd.c index c0233efabeba..59e5982a5db3 100644 --- a/trunk/drivers/block/pktcdvd.c +++ b/trunk/drivers/block/pktcdvd.c @@ -1188,7 +1188,7 @@ static void pkt_count_states(struct pktcdvd_device *pd, int *states) struct packet_data *pkt; int i; - for (i = 0; i < PACKET_NUM_STATES; i++) + for (i = 0; i <= PACKET_NUM_STATES; i++) states[i] = 0; spin_lock(&pd->cdrw.active_list_lock); diff --git a/trunk/drivers/block/ub.c b/trunk/drivers/block/ub.c index 10740a065088..bfb23d543ff7 100644 --- a/trunk/drivers/block/ub.c +++ b/trunk/drivers/block/ub.c @@ -9,6 +9,7 @@ * * TODO (sorted by decreasing priority) * -- Kill first_open (Al Viro fixed the block layer now) + * -- Do resets with usb_device_reset (needs a thread context, use khubd) * -- set readonly flag for CDs, set removable flag for CF readers * -- do inquiry and verify we got a disk and not a tape (for LUN mismatch) * -- special case some senses, e.g. 3a/0 -> no media present, reduce retries @@ -28,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -106,6 +106,16 @@ * +--------+ */ +/* + * Definitions which have to be scattered once we understand the layout better. + */ + +/* Transport (despite PR in the name) */ +#define US_PR_BULK 0x50 /* bulk only */ + +/* Protocol */ +#define US_SC_SCSI 0x06 /* Transparent */ + /* * This many LUNs per USB device. * Every one of them takes a host, see UB_MAX_HOSTS. @@ -115,7 +125,7 @@ /* */ -#define UB_PARTS_PER_LUN 8 +#define UB_MINORS_PER_MAJOR 8 #define UB_MAX_CDB_SIZE 16 /* Corresponds to Bulk */ @@ -235,13 +245,6 @@ struct ub_scsi_cmd { void *back; }; -struct ub_request { - struct request *rq; - unsigned int current_try; - unsigned int nsg; /* sgv[nsg] */ - struct scatterlist sgv[UB_MAX_REQ_SG]; -}; - /* */ struct ub_capacity { @@ -337,8 +340,6 @@ struct ub_lun { int readonly; int first_open; /* Kludge. See ub_bd_open. */ - struct ub_request urq; - /* Use Ingo's mempool if or when we have more than one command. */ /* * Currently we never need more than one command for the whole device. @@ -359,7 +360,6 @@ struct ub_dev { atomic_t poison; /* The USB device is disconnected */ int openc; /* protected by ub_lock! */ /* kref is too implicit for our taste */ - int reset; /* Reset is running */ unsigned int tagcnt; char name[12]; struct usb_device *dev; @@ -387,9 +387,6 @@ struct ub_dev { struct bulk_cs_wrap work_bcs; struct usb_ctrlrequest work_cr; - struct work_struct reset_work; - wait_queue_head_t reset_wait; - int sg_stat[6]; struct ub_scsi_trace tr; }; @@ -398,14 +395,12 @@ struct ub_dev { */ static void ub_cleanup(struct ub_dev *sc); static int ub_request_fn_1(struct ub_lun *lun, struct request *rq); -static void ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun, - struct ub_scsi_cmd *cmd, struct ub_request *urq); -static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun, - struct ub_scsi_cmd *cmd, struct ub_request *urq); +static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun, + struct ub_scsi_cmd *cmd, struct request *rq); +static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun, + struct ub_scsi_cmd *cmd, struct request *rq); static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd); static void ub_end_rq(struct request *rq, int uptodate); -static int ub_rw_cmd_retry(struct ub_dev *sc, struct ub_lun *lun, - struct ub_request *urq, struct ub_scsi_cmd *cmd); static int ub_submit_scsi(struct ub_dev *sc, struct ub_scsi_cmd *cmd); static void ub_urb_complete(struct urb *urb, struct pt_regs *pt); static void ub_scsi_action(unsigned long _dev); @@ -420,8 +415,6 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd); static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd, int stalled_pipe); static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd); -static void ub_reset_enter(struct ub_dev *sc); -static void ub_reset_task(void *arg); static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun); static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun, struct ub_capacity *ret); @@ -429,18 +422,13 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum); /* */ -#ifdef CONFIG_USB_LIBUSUAL - -#define ub_usb_ids storage_usb_ids -#else - static struct usb_device_id ub_usb_ids[] = { + // { USB_DEVICE_VER(0x0781, 0x0002, 0x0009, 0x0009) }, /* SDDR-31 */ { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_BULK) }, { } }; MODULE_DEVICE_TABLE(usb, ub_usb_ids); -#endif /* CONFIG_USB_LIBUSUAL */ /* * Find me a way to identify "next free minor" for add_disk(), @@ -533,9 +521,6 @@ static ssize_t ub_diag_show(struct device *dev, struct device_attribute *attr, cnt = 0; spin_lock_irqsave(&sc->lock, flags); - cnt += sprintf(page + cnt, - "poison %d reset %d\n", - atomic_read(&sc->poison), sc->reset); cnt += sprintf(page + cnt, "qlen %d qmax %d\n", sc->cmd_queue.qlen, sc->cmd_queue.qmax); @@ -785,8 +770,7 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq) { struct ub_dev *sc = lun->udev; struct ub_scsi_cmd *cmd; - struct ub_request *urq; - int n_elem; + int rc; if (atomic_read(&sc->poison) || lun->changed) { blkdev_dequeue_request(rq); @@ -794,70 +778,65 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq) return 0; } - if (lun->urq.rq != NULL) - return -1; if ((cmd = ub_get_cmd(lun)) == NULL) return -1; memset(cmd, 0, sizeof(struct ub_scsi_cmd)); blkdev_dequeue_request(rq); - - urq = &lun->urq; - memset(urq, 0, sizeof(struct ub_request)); - urq->rq = rq; - - /* - * get scatterlist from block layer - */ - n_elem = blk_rq_map_sg(lun->disk->queue, rq, &urq->sgv[0]); - if (n_elem < 0) { - printk(KERN_INFO "%s: failed request map (%d)\n", - lun->name, n_elem); /* P3 */ - goto drop; - } - if (n_elem > UB_MAX_REQ_SG) { /* Paranoia */ - printk(KERN_WARNING "%s: request with %d segments\n", - lun->name, n_elem); - goto drop; - } - urq->nsg = n_elem; - sc->sg_stat[n_elem < 5 ? n_elem : 5]++; - if (blk_pc_request(rq)) { - ub_cmd_build_packet(sc, lun, cmd, urq); + rc = ub_cmd_build_packet(sc, lun, cmd, rq); } else { - ub_cmd_build_block(sc, lun, cmd, urq); + rc = ub_cmd_build_block(sc, lun, cmd, rq); + } + if (rc != 0) { + ub_put_cmd(lun, cmd); + ub_end_rq(rq, 0); + return 0; } cmd->state = UB_CMDST_INIT; cmd->lun = lun; cmd->done = ub_rw_cmd_done; - cmd->back = urq; + cmd->back = rq; cmd->tag = sc->tagcnt++; - if (ub_submit_scsi(sc, cmd) != 0) - goto drop; - - return 0; + if (ub_submit_scsi(sc, cmd) != 0) { + ub_put_cmd(lun, cmd); + ub_end_rq(rq, 0); + return 0; + } -drop: - ub_put_cmd(lun, cmd); - ub_end_rq(rq, 0); return 0; } -static void ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun, - struct ub_scsi_cmd *cmd, struct ub_request *urq) +static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun, + struct ub_scsi_cmd *cmd, struct request *rq) { - struct request *rq = urq->rq; + int ub_dir; + int n_elem; unsigned int block, nblks; if (rq_data_dir(rq) == WRITE) - cmd->dir = UB_DIR_WRITE; + ub_dir = UB_DIR_WRITE; else - cmd->dir = UB_DIR_READ; + ub_dir = UB_DIR_READ; + cmd->dir = ub_dir; - cmd->nsg = urq->nsg; - memcpy(cmd->sgv, urq->sgv, sizeof(struct scatterlist) * cmd->nsg); + /* + * get scatterlist from block layer + */ + n_elem = blk_rq_map_sg(lun->disk->queue, rq, &cmd->sgv[0]); + if (n_elem <= 0) { + printk(KERN_INFO "%s: failed request map (%d)\n", + sc->name, n_elem); /* P3 */ + return -1; /* request with no s/g entries? */ + } + if (n_elem > UB_MAX_REQ_SG) { /* Paranoia */ + printk(KERN_WARNING "%s: request with %d segments\n", + sc->name, n_elem); + return -1; + } + cmd->nsg = n_elem; + sc->sg_stat[n_elem < 5 ? n_elem : 5]++; /* * build the command @@ -868,7 +847,7 @@ static void ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun, block = rq->sector >> lun->capacity.bshift; nblks = rq->nr_sectors >> lun->capacity.bshift; - cmd->cdb[0] = (cmd->dir == UB_DIR_READ)? READ_10: WRITE_10; + cmd->cdb[0] = (ub_dir == UB_DIR_READ)? READ_10: WRITE_10; /* 10-byte uses 4 bytes of LBA: 2147483648KB, 2097152MB, 2048GB */ cmd->cdb[2] = block >> 24; cmd->cdb[3] = block >> 16; @@ -879,12 +858,14 @@ static void ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun, cmd->cdb_len = 10; cmd->len = rq->nr_sectors * 512; + + return 0; } -static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun, - struct ub_scsi_cmd *cmd, struct ub_request *urq) +static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun, + struct ub_scsi_cmd *cmd, struct request *rq) { - struct request *rq = urq->rq; + int n_elem; if (rq->data_len == 0) { cmd->dir = UB_DIR_NONE; @@ -893,26 +874,40 @@ static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun, cmd->dir = UB_DIR_WRITE; else cmd->dir = UB_DIR_READ; + } - cmd->nsg = urq->nsg; - memcpy(cmd->sgv, urq->sgv, sizeof(struct scatterlist) * cmd->nsg); + /* + * get scatterlist from block layer + */ + n_elem = blk_rq_map_sg(lun->disk->queue, rq, &cmd->sgv[0]); + if (n_elem < 0) { + printk(KERN_INFO "%s: failed request map (%d)\n", + sc->name, n_elem); /* P3 */ + return -1; + } + if (n_elem > UB_MAX_REQ_SG) { /* Paranoia */ + printk(KERN_WARNING "%s: request with %d segments\n", + sc->name, n_elem); + return -1; + } + cmd->nsg = n_elem; + sc->sg_stat[n_elem < 5 ? n_elem : 5]++; memcpy(&cmd->cdb, rq->cmd, rq->cmd_len); cmd->cdb_len = rq->cmd_len; cmd->len = rq->data_len; + + return 0; } static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd) { + struct request *rq = cmd->back; struct ub_lun *lun = cmd->lun; - struct ub_request *urq = cmd->back; - struct request *rq; int uptodate; - rq = urq->rq; - if (cmd->error == 0) { uptodate = 1; @@ -933,16 +928,9 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd) rq->errors = SAM_STAT_CHECK_CONDITION; else rq->errors = DID_ERROR << 16; - } else { - if (cmd->error == -EIO) { - if (ub_rw_cmd_retry(sc, lun, urq, cmd) == 0) - return; - } } } - urq->rq = NULL; - ub_put_cmd(lun, cmd); ub_end_rq(rq, uptodate); blk_start_queue(lun->disk->queue); @@ -950,43 +938,11 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd) static void ub_end_rq(struct request *rq, int uptodate) { - end_that_request_first(rq, uptodate, rq->hard_nr_sectors); - end_that_request_last(rq); -} - -static int ub_rw_cmd_retry(struct ub_dev *sc, struct ub_lun *lun, - struct ub_request *urq, struct ub_scsi_cmd *cmd) -{ - - if (atomic_read(&sc->poison)) - return -ENXIO; - - ub_reset_enter(sc); - - if (urq->current_try >= 3) - return -EIO; - urq->current_try++; - /* P3 */ printk("%s: dir %c len/act %d/%d " - "[sense %x %02x %02x] retry %d\n", - sc->name, UB_DIR_CHAR(cmd->dir), cmd->len, cmd->act_len, - cmd->key, cmd->asc, cmd->ascq, urq->current_try); - - memset(cmd, 0, sizeof(struct ub_scsi_cmd)); - ub_cmd_build_block(sc, lun, cmd, urq); - - cmd->state = UB_CMDST_INIT; - cmd->lun = lun; - cmd->done = ub_rw_cmd_done; - cmd->back = urq; - - cmd->tag = sc->tagcnt++; + int rc; -#if 0 /* Wasteful */ - return ub_submit_scsi(sc, cmd); -#else - ub_cmdq_add(sc, cmd); - return 0; -#endif + rc = end_that_request_first(rq, uptodate, rq->hard_nr_sectors); + // assert(rc == 0); + end_that_request_last(rq); } /* @@ -1119,7 +1075,7 @@ static void ub_scsi_dispatch(struct ub_dev *sc) struct ub_scsi_cmd *cmd; int rc; - while (!sc->reset && (cmd = ub_cmdq_peek(sc)) != NULL) { + while ((cmd = ub_cmdq_peek(sc)) != NULL) { if (cmd->state == UB_CMDST_DONE) { ub_cmdq_pop(sc); (*cmd->done)(sc, cmd); @@ -1142,12 +1098,11 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) { struct urb *urb = &sc->work_urb; struct bulk_cs_wrap *bcs; - int len; int rc; if (atomic_read(&sc->poison)) { - ub_state_done(sc, cmd, -ENODEV); - return; + /* A little too simplistic, I feel... */ + goto Bad_End; } if (cmd->state == UB_CMDST_CLEAR) { @@ -1155,6 +1110,7 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) /* * STALL while clearning STALL. * The control pipe clears itself - nothing to do. + * XXX Might try to reset the device here and retry. */ printk(KERN_NOTICE "%s: stall on control pipe\n", sc->name); @@ -1173,6 +1129,11 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) } else if (cmd->state == UB_CMDST_CLR2STS) { if (urb->status == -EPIPE) { + /* + * STALL while clearning STALL. + * The control pipe clears itself - nothing to do. + * XXX Might try to reset the device here and retry. + */ printk(KERN_NOTICE "%s: stall on control pipe\n", sc->name); goto Bad_End; @@ -1190,6 +1151,11 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) } else if (cmd->state == UB_CMDST_CLRRS) { if (urb->status == -EPIPE) { + /* + * STALL while clearning STALL. + * The control pipe clears itself - nothing to do. + * XXX Might try to reset the device here and retry. + */ printk(KERN_NOTICE "%s: stall on control pipe\n", sc->name); goto Bad_End; @@ -1206,12 +1172,7 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) ub_state_stat_counted(sc, cmd); } else if (cmd->state == UB_CMDST_CMD) { - switch (urb->status) { - case 0: - break; - case -EOVERFLOW: - goto Bad_End; - case -EPIPE: + if (urb->status == -EPIPE) { rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe); if (rc != 0) { printk(KERN_NOTICE "%s: " @@ -1221,20 +1182,17 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) * This is typically ENOMEM or some other such shit. * Retrying is pointless. Just do Bad End on it... */ - ub_state_done(sc, cmd, rc); - return; + goto Bad_End; } cmd->state = UB_CMDST_CLEAR; ub_cmdtr_state(sc, cmd); return; - case -ESHUTDOWN: /* unplug */ - case -EILSEQ: /* unplug timeout on uhci */ - ub_state_done(sc, cmd, -ENODEV); - return; - default: + } + if (urb->status != 0) { goto Bad_End; } if (urb->actual_length != US_BULK_CB_WRAP_LEN) { + /* XXX Must do reset here to unconfuse the device */ goto Bad_End; } @@ -1253,8 +1211,11 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) printk(KERN_NOTICE "%s: " "unable to submit clear (%d)\n", sc->name, rc); - ub_state_done(sc, cmd, rc); - return; + /* + * This is typically ENOMEM or some other such shit. + * Retrying is pointless. Just do Bad End on it... + */ + goto Bad_End; } cmd->state = UB_CMDST_CLR2STS; ub_cmdtr_state(sc, cmd); @@ -1263,50 +1224,14 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) if (urb->status == -EOVERFLOW) { /* * A babble? Failure, but we must transfer CSW now. + * XXX This is going to end in perpetual babble. Reset. */ cmd->error = -EOVERFLOW; /* A cheap trick... */ ub_state_stat(sc, cmd); return; } - - if (cmd->dir == UB_DIR_WRITE) { - /* - * Do not continue writes in case of a failure. - * Doing so would cause sectors to be mixed up, - * which is worse than sectors lost. - * - * We must try to read the CSW, or many devices - * get confused. - */ - len = urb->actual_length; - if (urb->status != 0 || - len != cmd->sgv[cmd->current_sg].length) { - cmd->act_len += len; - ub_cmdtr_act_len(sc, cmd); - - cmd->error = -EIO; - ub_state_stat(sc, cmd); - return; - } - - } else { - /* - * If an error occurs on read, we record it, and - * continue to fetch data in order to avoid bubble. - * - * As a small shortcut, we stop if we detect that - * a CSW mixed into data. - */ - if (urb->status != 0) - cmd->error = -EIO; - - len = urb->actual_length; - if (urb->status != 0 || - len != cmd->sgv[cmd->current_sg].length) { - if ((len & 0x1FF) == US_BULK_CS_WRAP_LEN) - goto Bad_End; - } - } + if (urb->status != 0) + goto Bad_End; cmd->act_len += urb->actual_length; ub_cmdtr_act_len(sc, cmd); @@ -1324,8 +1249,11 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) printk(KERN_NOTICE "%s: " "unable to submit clear (%d)\n", sc->name, rc); - ub_state_done(sc, cmd, rc); - return; + /* + * This is typically ENOMEM or some other such shit. + * Retrying is pointless. Just do Bad End on it... + */ + goto Bad_End; } /* @@ -1338,8 +1266,14 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) ub_cmdtr_state(sc, cmd); return; } - - /* Catch everything, including -EOVERFLOW and other nasties. */ + if (urb->status == -EOVERFLOW) { + /* + * XXX We are screwed here. Retrying is pointless, + * because the pipelined data will not get in until + * we read with a big enough buffer. We must reset XXX. + */ + goto Bad_End; + } if (urb->status != 0) goto Bad_End; @@ -1385,15 +1319,15 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) return; } - len = le32_to_cpu(bcs->Residue); - if (len != cmd->len - cmd->act_len) { + rc = le32_to_cpu(bcs->Residue); + if (rc != cmd->len - cmd->act_len) { /* * It is all right to transfer less, the caller has * to check. But it's not all right if the device * counts disagree with our counts. */ /* P3 */ printk("%s: resid %d len %d act %d\n", - sc->name, len, cmd->len, cmd->act_len); + sc->name, rc, cmd->len, cmd->act_len); goto Bad_End; } @@ -1404,13 +1338,13 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) ub_state_sense(sc, cmd); return; case US_BULK_STAT_PHASE: + /* XXX We must reset the transport here */ /* P3 */ printk("%s: status PHASE\n", sc->name); goto Bad_End; default: printk(KERN_INFO "%s: unknown CSW status 0x%x\n", sc->name, bcs->Status); - ub_state_done(sc, cmd, -EINVAL); - return; + goto Bad_End; } /* Not zeroing error to preserve a babble indicator */ @@ -1430,8 +1364,7 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) printk(KERN_WARNING "%s: " "wrong command state %d\n", sc->name, cmd->state); - ub_state_done(sc, cmd, -EINVAL); - return; + goto Bad_End; } return; @@ -1678,93 +1611,6 @@ static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd) ub_scsi_urb_compl(sc, cmd); } -/* - * Reset management - */ - -static void ub_reset_enter(struct ub_dev *sc) -{ - - if (sc->reset) { - /* This happens often on multi-LUN devices. */ - return; - } - sc->reset = 1; - -#if 0 /* Not needed because the disconnect waits for us. */ - unsigned long flags; - spin_lock_irqsave(&ub_lock, flags); - sc->openc++; - spin_unlock_irqrestore(&ub_lock, flags); -#endif - -#if 0 /* We let them stop themselves. */ - struct list_head *p; - struct ub_lun *lun; - list_for_each(p, &sc->luns) { - lun = list_entry(p, struct ub_lun, link); - blk_stop_queue(lun->disk->queue); - } -#endif - - schedule_work(&sc->reset_work); -} - -static void ub_reset_task(void *arg) -{ - struct ub_dev *sc = arg; - unsigned long flags; - struct list_head *p; - struct ub_lun *lun; - int lkr, rc; - - if (!sc->reset) { - printk(KERN_WARNING "%s: Running reset unrequested\n", - sc->name); - return; - } - - if (atomic_read(&sc->poison)) { - printk(KERN_NOTICE "%s: Not resetting disconnected device\n", - sc->name); /* P3 This floods. Remove soon. XXX */ - } else if (sc->dev->actconfig->desc.bNumInterfaces != 1) { - printk(KERN_NOTICE "%s: Not resetting multi-interface device\n", - sc->name); /* P3 This floods. Remove soon. XXX */ - } else { - if ((lkr = usb_lock_device_for_reset(sc->dev, sc->intf)) < 0) { - printk(KERN_NOTICE - "%s: usb_lock_device_for_reset failed (%d)\n", - sc->name, lkr); - } else { - rc = usb_reset_device(sc->dev); - if (rc < 0) { - printk(KERN_NOTICE "%s: " - "usb_lock_device_for_reset failed (%d)\n", - sc->name, rc); - } - - if (lkr) - usb_unlock_device(sc->dev); - } - } - - /* - * In theory, no commands can be running while reset is active, - * so nobody can ask for another reset, and so we do not need any - * queues of resets or anything. We do need a spinlock though, - * to interact with block layer. - */ - spin_lock_irqsave(&sc->lock, flags); - sc->reset = 0; - tasklet_schedule(&sc->tasklet); - list_for_each(p, &sc->luns) { - lun = list_entry(p, struct ub_lun, link); - blk_start_queue(lun->disk->queue); - } - wake_up(&sc->reset_wait); - spin_unlock_irqrestore(&sc->lock, flags); -} - /* * This is called from a process context. */ @@ -2300,7 +2146,7 @@ static int ub_get_pipes(struct ub_dev *sc, struct usb_device *dev, if (ep_in == NULL || ep_out == NULL) { printk(KERN_NOTICE "%s: failed endpoint check\n", sc->name); - return -ENODEV; + return -EIO; } /* Calculate and store the pipe values */ @@ -2326,9 +2172,6 @@ static int ub_probe(struct usb_interface *intf, int rc; int i; - if (usb_usual_check_type(dev_id, USB_US_TYPE_UB)) - return -ENXIO; - rc = -ENOMEM; if ((sc = kmalloc(sizeof(struct ub_dev), GFP_KERNEL)) == NULL) goto err_core; @@ -2338,8 +2181,6 @@ static int ub_probe(struct usb_interface *intf, usb_init_urb(&sc->work_urb); tasklet_init(&sc->tasklet, ub_scsi_action, (unsigned long)sc); atomic_set(&sc->poison, 0); - INIT_WORK(&sc->reset_work, ub_reset_task, sc); - init_waitqueue_head(&sc->reset_wait); init_timer(&sc->work_timer); sc->work_timer.data = (unsigned long) sc; @@ -2360,8 +2201,7 @@ static int ub_probe(struct usb_interface *intf, /* XXX Verify that we can handle the device (from descriptors) */ - if (ub_get_pipes(sc, sc->dev, intf) != 0) - goto err_dev_desc; + ub_get_pipes(sc, sc->dev, intf); if (device_create_file(&sc->intf->dev, &dev_attr_diag) != 0) goto err_diag; @@ -2432,7 +2272,6 @@ static int ub_probe(struct usb_interface *intf, /* device_remove_file(&sc->intf->dev, &dev_attr_diag); */ err_diag: -err_dev_desc: usb_set_intfdata(intf, NULL); // usb_put_intf(sc->intf); usb_put_dev(sc->dev); @@ -2470,14 +2309,14 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum) ub_revalidate(sc, lun); rc = -ENOMEM; - if ((disk = alloc_disk(UB_PARTS_PER_LUN)) == NULL) + if ((disk = alloc_disk(UB_MINORS_PER_MAJOR)) == NULL) goto err_diskalloc; lun->disk = disk; sprintf(disk->disk_name, DRV_NAME "%c", lun->id + 'a'); sprintf(disk->devfs_name, DEVFS_NAME "/%c", lun->id + 'a'); disk->major = UB_MAJOR; - disk->first_minor = lun->id * UB_PARTS_PER_LUN; + disk->first_minor = lun->id * UB_MINORS_PER_MAJOR; disk->fops = &ub_bd_fops; disk->private_data = lun; disk->driverfs_dev = &sc->intf->dev; @@ -2540,11 +2379,6 @@ static void ub_disconnect(struct usb_interface *intf) */ atomic_set(&sc->poison, 1); - /* - * Wait for reset to end, if any. - */ - wait_event(sc->reset_wait, !sc->reset); - /* * Blow away queued commands. * @@ -2558,7 +2392,7 @@ static void ub_disconnect(struct usb_interface *intf) { struct ub_scsi_cmd *cmd; int cnt = 0; - while ((cmd = ub_cmdq_peek(sc)) != NULL) { + while ((cmd = ub_cmdq_pop(sc)) != NULL) { cmd->error = -ENOTCONN; cmd->state = UB_CMDST_DONE; ub_cmdtr_state(sc, cmd); @@ -2627,6 +2461,7 @@ static void ub_disconnect(struct usb_interface *intf) } static struct usb_driver ub_driver = { + .owner = THIS_MODULE, .name = "ub", .probe = ub_probe, .disconnect = ub_disconnect, @@ -2644,7 +2479,6 @@ static int __init ub_init(void) if ((rc = usb_register(&ub_driver)) != 0) goto err_register; - usb_usual_set_present(USB_US_TYPE_UB); return 0; err_register: @@ -2660,7 +2494,6 @@ static void __exit ub_exit(void) devfs_remove(DEVFS_NAME); unregister_blkdev(UB_MAJOR, DRV_NAME); - usb_usual_clear_present(USB_US_TYPE_UB); } module_init(ub_init); diff --git a/trunk/drivers/bluetooth/bcm203x.c b/trunk/drivers/bluetooth/bcm203x.c index 3e7a067cc087..8e7fb3551775 100644 --- a/trunk/drivers/bluetooth/bcm203x.c +++ b/trunk/drivers/bluetooth/bcm203x.c @@ -275,6 +275,7 @@ static void bcm203x_disconnect(struct usb_interface *intf) } static struct usb_driver bcm203x_driver = { + .owner = THIS_MODULE, .name = "bcm203x", .probe = bcm203x_probe, .disconnect = bcm203x_disconnect, diff --git a/trunk/drivers/bluetooth/bfusb.c b/trunk/drivers/bluetooth/bfusb.c index 8947c8837dac..067e27893e4a 100644 --- a/trunk/drivers/bluetooth/bfusb.c +++ b/trunk/drivers/bluetooth/bfusb.c @@ -768,6 +768,7 @@ static void bfusb_disconnect(struct usb_interface *intf) } static struct usb_driver bfusb_driver = { + .owner = THIS_MODULE, .name = "bfusb", .probe = bfusb_probe, .disconnect = bfusb_disconnect, diff --git a/trunk/drivers/bluetooth/bpa10x.c b/trunk/drivers/bluetooth/bpa10x.c index 9446960ac742..394796315adc 100644 --- a/trunk/drivers/bluetooth/bpa10x.c +++ b/trunk/drivers/bluetooth/bpa10x.c @@ -619,6 +619,7 @@ static void bpa10x_disconnect(struct usb_interface *intf) } static struct usb_driver bpa10x_driver = { + .owner = THIS_MODULE, .name = "bpa10x", .probe = bpa10x_probe, .disconnect = bpa10x_disconnect, diff --git a/trunk/drivers/bluetooth/hci_usb.c b/trunk/drivers/bluetooth/hci_usb.c index 92382e823285..057cb2b6e6d1 100644 --- a/trunk/drivers/bluetooth/hci_usb.c +++ b/trunk/drivers/bluetooth/hci_usb.c @@ -1044,6 +1044,7 @@ static void hci_usb_disconnect(struct usb_interface *intf) } static struct usb_driver hci_usb_driver = { + .owner = THIS_MODULE, .name = "hci_usb", .probe = hci_usb_probe, .disconnect = hci_usb_disconnect, diff --git a/trunk/drivers/char/Kconfig b/trunk/drivers/char/Kconfig index 84e68cdd451b..fdf4370db994 100644 --- a/trunk/drivers/char/Kconfig +++ b/trunk/drivers/char/Kconfig @@ -687,7 +687,7 @@ config NVRAM config RTC tristate "Enhanced Real Time Clock Support" - depends on !PPC32 && !PARISC && !IA64 && !M68K && (!SPARC || PCI) + depends on !PPC32 && !PARISC && !IA64 && !M68K ---help--- If you say Y here and create a character special file /dev/rtc with major number 10 and minor number 135 using mknod ("man mknod"), you @@ -735,7 +735,7 @@ config SGI_IP27_RTC config GEN_RTC tristate "Generic /dev/rtc emulation" - depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC + depends on RTC!=y && !IA64 && !ARM && !PPC64 && !M32R && !SPARC32 && !SPARC64 ---help--- If you say Y here and create a character special file /dev/rtc with major number 10 and minor number 135 using mknod ("man mknod"), you @@ -943,15 +943,6 @@ config RAW_DRIVER Applications should simply open the device (eg /dev/hda1) with the O_DIRECT flag. -config MAX_RAW_DEVS - int "Maximum number of RAW devices to support (1-8192)" - depends on RAW_DRIVER - default "256" - help - The maximum number of RAW devices that are supported. - Default is 256. Increase this number in case you need lots of - raw devices. - config HPET bool "HPET - High Precision Event Timer" if (X86 || IA64) default n @@ -983,6 +974,15 @@ config HPET_MMAP exposed to the user. If this applies to your hardware, say N here. +config MAX_RAW_DEVS + int "Maximum number of RAW devices to support (1-8192)" + depends on RAW_DRIVER + default "256" + help + The maximum number of RAW devices that are supported. + Default is 256. Increase this number in case you need lots of + raw devices. + config HANGCHECK_TIMER tristate "Hangcheck timer" depends on X86 || IA64 || PPC64 || ARCH_S390 diff --git a/trunk/drivers/char/agp/amd64-agp.c b/trunk/drivers/char/agp/amd64-agp.c index 810679dcbbb0..78ce98a69f37 100644 --- a/trunk/drivers/char/agp/amd64-agp.c +++ b/trunk/drivers/char/agp/amd64-agp.c @@ -57,8 +57,9 @@ static int nr_garts; static struct pci_dev * hammers[MAX_HAMMER_GARTS]; static struct resource *aperture_resource; -static int __initdata agp_try_unsupported = 1; +static int __initdata agp_try_unsupported; +static int gart_iterator; #define for_each_nb() for(gart_iterator=0;gart_iteratorgatt_table_real); - int gart_iterator; /* Configure AGP regs in each x86-64 host bridge. */ for_each_nb() { @@ -236,7 +235,7 @@ static int amd_8151_configure(void) static void amd64_cleanup(void) { u32 tmp; - int gart_iterator; + for_each_nb() { /* disable gart translation */ pci_read_config_dword (hammers[gart_iterator], AMD64_GARTAPERTURECTL, &tmp); @@ -416,7 +415,7 @@ static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data } -static const struct aper_size_info_32 uli_sizes[7] = +static struct aper_size_info_32 uli_sizes[7] = { {256, 65536, 6, 10}, {128, 32768, 5, 9}, @@ -470,7 +469,7 @@ static int __devinit uli_agp_init(struct pci_dev *pdev) } -static const struct aper_size_info_32 nforce3_sizes[5] = +static struct aper_size_info_32 nforce3_sizes[5] = { {512, 131072, 7, 0x00000000 }, {256, 65536, 6, 0x00000008 }, @@ -698,16 +697,6 @@ static struct pci_device_id agp_amd64_pci_table[] = { .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, }, - /* ALI/ULI M1695 */ - { - .class = (PCI_CLASS_BRIDGE_HOST << 8), - .class_mask = ~0, - .vendor = PCI_VENDOR_ID_AL, - .device = 0x1689, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, - }, - { } }; diff --git a/trunk/drivers/char/agp/backend.c b/trunk/drivers/char/agp/backend.c index 80ee17a8fc23..27bca34b4a65 100644 --- a/trunk/drivers/char/agp/backend.c +++ b/trunk/drivers/char/agp/backend.c @@ -97,7 +97,7 @@ void agp_backend_release(struct agp_bridge_data *bridge) EXPORT_SYMBOL(agp_backend_release); -static const struct { int mem, agp; } maxes_table[] = { +static struct { int mem, agp; } maxes_table[] = { {0, 0}, {32, 4}, {64, 28}, diff --git a/trunk/drivers/char/agp/uninorth-agp.c b/trunk/drivers/char/agp/uninorth-agp.c index 50947e38501a..c8255312b8c1 100644 --- a/trunk/drivers/char/agp/uninorth-agp.c +++ b/trunk/drivers/char/agp/uninorth-agp.c @@ -557,10 +557,6 @@ static struct agp_device_ids uninorth_agp_device_ids[] __devinitdata = { .device_id = PCI_DEVICE_ID_APPLE_U3H_AGP, .chipset_name = "U3H", }, - { - .device_id = PCI_DEVICE_ID_APPLE_IPID2_AGP, - .chipset_name = "UniNorth/Intrepid2", - }, }; static int __devinit agp_uninorth_probe(struct pci_dev *pdev, diff --git a/trunk/drivers/char/agp/via-agp.c b/trunk/drivers/char/agp/via-agp.c index 97b0a890ba7f..c847df575cf5 100644 --- a/trunk/drivers/char/agp/via-agp.c +++ b/trunk/drivers/char/agp/via-agp.c @@ -371,11 +371,6 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata = .device_id = PCI_DEVICE_ID_VIA_3296_0, .chipset_name = "P4M800", }, - /* P4M800CE */ - { - .device_id = PCI_DEVICE_ID_VIA_P4M800CE, - .chipset_name = "P4M800CE", - }, { }, /* dummy final entry, always present */ }; @@ -516,7 +511,6 @@ static struct pci_device_id agp_via_pci_table[] = { ID(PCI_DEVICE_ID_VIA_3269_0), ID(PCI_DEVICE_ID_VIA_83_87XX_1), ID(PCI_DEVICE_ID_VIA_3296_0), - ID(PCI_DEVICE_ID_VIA_P4M800CE), { } }; diff --git a/trunk/drivers/char/drm/drm_context.c b/trunk/drivers/char/drm/drm_context.c index bd958d69a2ac..bdd168d88f49 100644 --- a/trunk/drivers/char/drm/drm_context.c +++ b/trunk/drivers/char/drm/drm_context.c @@ -432,10 +432,7 @@ int drm_addctx(struct inode *inode, struct file *filp, if (ctx.handle != DRM_KERNEL_CONTEXT) { if (dev->driver->context_ctor) - if (!dev->driver->context_ctor(dev, ctx.handle)) { - DRM_DEBUG( "Running out of ctxs or memory.\n"); - return -ENOMEM; - } + dev->driver->context_ctor(dev, ctx.handle); } ctx_entry = drm_alloc(sizeof(*ctx_entry), DRM_MEM_CTXLIST); diff --git a/trunk/drivers/char/drm/drm_lock.c b/trunk/drivers/char/drm/drm_lock.c index b48a595d54ec..b276ae8a6633 100644 --- a/trunk/drivers/char/drm/drm_lock.c +++ b/trunk/drivers/char/drm/drm_lock.c @@ -104,10 +104,6 @@ int drm_lock(struct inode *inode, struct file *filp, __set_current_state(TASK_RUNNING); remove_wait_queue(&dev->lock.lock_queue, &entry); - DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock"); - if (ret) - return ret; - sigemptyset(&dev->sigmask); sigaddset(&dev->sigmask, SIGSTOP); sigaddset(&dev->sigmask, SIGTSTP); @@ -120,12 +116,8 @@ int drm_lock(struct inode *inode, struct file *filp, if (dev->driver->dma_ready && (lock.flags & _DRM_LOCK_READY)) dev->driver->dma_ready(dev); - if (dev->driver->dma_quiescent && (lock.flags & _DRM_LOCK_QUIESCENT)) { - if (dev->driver->dma_quiescent(dev)) { - DRM_DEBUG("%d waiting for DMA quiescent\n", lock.context); - return DRM_ERR(EBUSY); - } - } + if (dev->driver->dma_quiescent && (lock.flags & _DRM_LOCK_QUIESCENT)) + return dev->driver->dma_quiescent(dev); /* dev->driver->kernel_context_switch isn't used by any of the x86 * drivers but is used by the Sparc driver. @@ -136,7 +128,9 @@ int drm_lock(struct inode *inode, struct file *filp, dev->driver->kernel_context_switch(dev, dev->last_context, lock.context); } - return 0; + DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock"); + + return ret; } /** diff --git a/trunk/drivers/char/drm/drm_memory.c b/trunk/drivers/char/drm/drm_memory.c index abef2acf99f5..2c74155aa84f 100644 --- a/trunk/drivers/char/drm/drm_memory.c +++ b/trunk/drivers/char/drm/drm_memory.c @@ -95,7 +95,7 @@ unsigned long drm_alloc_pages(int order, int area) unsigned long addr; unsigned int sz; - address = __get_free_pages(GFP_KERNEL|__GFP_COMP, order); + address = __get_free_pages(GFP_KERNEL, order); if (!address) return 0; diff --git a/trunk/drivers/char/drm/drm_memory_debug.h b/trunk/drivers/char/drm/drm_memory_debug.h index b370aca718d2..4542353195bd 100644 --- a/trunk/drivers/char/drm/drm_memory_debug.h +++ b/trunk/drivers/char/drm/drm_memory_debug.h @@ -221,7 +221,7 @@ unsigned long DRM(alloc_pages) (int order, int area) { } spin_unlock(&DRM(mem_lock)); - address = __get_free_pages(GFP_KERNEL|__GFP_COMP, order); + address = __get_free_pages(GFP_KERNEL, order); if (!address) { spin_lock(&DRM(mem_lock)); ++DRM(mem_stats)[area].fail_count; diff --git a/trunk/drivers/char/drm/mga_drv.c b/trunk/drivers/char/drm/mga_drv.c index 1713451a5cc6..0cc7c305a7f6 100644 --- a/trunk/drivers/char/drm/mga_drv.c +++ b/trunk/drivers/char/drm/mga_drv.c @@ -161,7 +161,7 @@ static int mga_driver_device_is_agp(drm_device_t * dev) * device. */ - if ((pdev->device == 0x0525) && pdev->bus->self + if ((pdev->device == 0x0525) && (pdev->bus->self->vendor == 0x3388) && (pdev->bus->self->device == 0x0021)) { return 0; diff --git a/trunk/drivers/char/drm/radeon_cp.c b/trunk/drivers/char/drm/radeon_cp.c index 342302d46743..03839ea31092 100644 --- a/trunk/drivers/char/drm/radeon_cp.c +++ b/trunk/drivers/char/drm/radeon_cp.c @@ -1311,7 +1311,7 @@ static void radeon_set_pcigart(drm_radeon_private_t * dev_priv, int on) static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init) { - drm_radeon_private_t *dev_priv = dev->dev_private; + drm_radeon_private_t *dev_priv = dev->dev_private;; DRM_DEBUG("\n"); dev_priv->is_pci = init->is_pci; diff --git a/trunk/drivers/char/drm/radeon_drv.h b/trunk/drivers/char/drm/radeon_drv.h index d92ccee3e54c..120ee5a8ebcc 100644 --- a/trunk/drivers/char/drm/radeon_drv.h +++ b/trunk/drivers/char/drm/radeon_drv.h @@ -214,6 +214,8 @@ typedef struct drm_radeon_private { int microcode_version; + int is_pci; + struct { u32 boxes; int freelist_timeouts; @@ -273,7 +275,6 @@ typedef struct drm_radeon_private { /* starting from here on, data is preserved accross an open */ uint32_t flags; /* see radeon_chip_flags */ - int is_pci; } drm_radeon_private_t; typedef struct drm_radeon_buf_priv { @@ -379,7 +380,6 @@ extern int r300_do_cp_cmdbuf(drm_device_t * dev, DRMFILE filp, # define RADEON_PLL_WR_EN (1 << 7) #define RADEON_CLOCK_CNTL_INDEX 0x0008 #define RADEON_CONFIG_APER_SIZE 0x0108 -#define RADEON_CONFIG_MEMSIZE 0x00f8 #define RADEON_CRTC_OFFSET 0x0224 #define RADEON_CRTC_OFFSET_CNTL 0x0228 # define RADEON_CRTC_TILE_EN (1 << 15) diff --git a/trunk/drivers/char/ip2/i2pack.h b/trunk/drivers/char/ip2/i2pack.h index 00342a677c90..e9b87a78622c 100644 --- a/trunk/drivers/char/ip2/i2pack.h +++ b/trunk/drivers/char/ip2/i2pack.h @@ -358,7 +358,7 @@ typedef struct _failStat #define MB_OUT_STRIPPED 0x40 // Board has read all output from fifo #define MB_FATAL_ERROR 0x20 // Board has encountered a fatal error -#pragma pack() // Reset padding to command-line default +#pragma pack(4) // Reset padding to command-line default #endif // I2PACK_H diff --git a/trunk/drivers/char/ipmi/ipmi_msghandler.c b/trunk/drivers/char/ipmi/ipmi_msghandler.c index 1f56b4cf0f58..d16bd4b5c117 100644 --- a/trunk/drivers/char/ipmi/ipmi_msghandler.c +++ b/trunk/drivers/char/ipmi/ipmi_msghandler.c @@ -48,7 +48,7 @@ #define PFX "IPMI message handler: " -#define IPMI_DRIVER_VERSION "38.0" +#define IPMI_DRIVER_VERSION "36.0" static struct ipmi_recv_msg *ipmi_alloc_recv_msg(void); static int ipmi_init_msghandler(void); @@ -2986,7 +2986,7 @@ static void send_panic_events(char *str) msg.cmd = 2; /* Platform event command. */ msg.data = data; msg.data_len = 8; - data[0] = 0x41; /* Kernel generator ID, IPMI table 5-4 */ + data[0] = 0x21; /* Kernel generator ID, IPMI table 5-4 */ data[1] = 0x03; /* This is for IPMI 1.0. */ data[2] = 0x20; /* OS Critical Stop, IPMI table 36-3 */ data[4] = 0x6f; /* Sensor specific, IPMI table 36-1 */ diff --git a/trunk/drivers/char/ipmi/ipmi_si_intf.c b/trunk/drivers/char/ipmi/ipmi_si_intf.c index beea450ee4b2..ea89dca3dbb5 100644 --- a/trunk/drivers/char/ipmi/ipmi_si_intf.c +++ b/trunk/drivers/char/ipmi/ipmi_si_intf.c @@ -2203,7 +2203,7 @@ static void setup_xaction_handlers(struct smi_info *smi_info) static inline void wait_for_timer_and_thread(struct smi_info *smi_info) { - if (smi_info->thread != NULL && smi_info->thread != ERR_PTR(-ENOMEM)) + if (smi_info->thread != ERR_PTR(-ENOMEM)) kthread_stop(smi_info->thread); del_timer_sync(&smi_info->si_timer); } @@ -2399,8 +2399,7 @@ static int init_one_smi(int intf_num, struct smi_info **smi) new_smi->handlers->cleanup(new_smi->si_sm); kfree(new_smi->si_sm); } - if (new_smi->io_cleanup) - new_smi->io_cleanup(new_smi); + new_smi->io_cleanup(new_smi); return rv; } @@ -2519,8 +2518,7 @@ static void __exit cleanup_one_si(struct smi_info *to_clean) kfree(to_clean->si_sm); - if (to_clean->io_cleanup) - to_clean->io_cleanup(to_clean); + to_clean->io_cleanup(to_clean); } static __exit void cleanup_ipmi_si(void) diff --git a/trunk/drivers/char/keyboard.c b/trunk/drivers/char/keyboard.c index 8b603b2d1c42..449d029ad4f4 100644 --- a/trunk/drivers/char/keyboard.c +++ b/trunk/drivers/char/keyboard.c @@ -930,8 +930,8 @@ static void kbd_refresh_leds(struct input_handle *handle) } #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\ - defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\ - defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\ + defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) ||\ + defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\ (defined(CONFIG_ARM) && defined(CONFIG_KEYBOARD_ATKBD) && !defined(CONFIG_ARCH_RPC)) #define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\ @@ -958,7 +958,7 @@ static unsigned short x86_keycodes[256] = extern int mac_hid_mouse_emulate_buttons(int, int, int); #endif /* CONFIG_MAC_EMUMOUSEBTN */ -#ifdef CONFIG_SPARC +#if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) static int sparc_l1_a_state = 0; extern void sun_do_break(void); #endif @@ -1045,7 +1045,7 @@ static void kbd_keycode(unsigned int keycode, int down, if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT) sysrq_alt = down; -#ifdef CONFIG_SPARC +#if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) if (keycode == KEY_STOP) sparc_l1_a_state = down; #endif @@ -1072,7 +1072,7 @@ static void kbd_keycode(unsigned int keycode, int down, return; } #endif -#ifdef CONFIG_SPARC +#if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) if (keycode == KEY_A && sparc_l1_a_state) { sparc_l1_a_state = 0; sun_do_break(); diff --git a/trunk/drivers/char/mwave/mwavepub.h b/trunk/drivers/char/mwave/mwavepub.h index 60c961ae23b4..f1f9da7a65c1 100644 --- a/trunk/drivers/char/mwave/mwavepub.h +++ b/trunk/drivers/char/mwave/mwavepub.h @@ -69,7 +69,7 @@ typedef struct _MW_ABILITIES { typedef struct _MW_READWRITE { unsigned short usDspAddress; /* The dsp address */ unsigned long ulDataLength; /* The size in bytes of the data or user buffer */ - void __user *pBuf; /* Input:variable sized buffer */ + void *pBuf; /* Input:variable sized buffer */ } MW_READWRITE, *pMW_READWRITE; #define IOCTL_MW_RESET _IO(MWAVE_MINOR,1) diff --git a/trunk/drivers/char/pcmcia/Kconfig b/trunk/drivers/char/pcmcia/Kconfig index 27c1179ee527..d22bfdc13563 100644 --- a/trunk/drivers/char/pcmcia/Kconfig +++ b/trunk/drivers/char/pcmcia/Kconfig @@ -18,29 +18,5 @@ config SYNCLINK_CS The module will be called synclinkmp. If you want to do that, say M here. -config CARDMAN_4000 - tristate "Omnikey Cardman 4000 support" - depends on PCMCIA - help - Enable support for the Omnikey Cardman 4000 PCMCIA Smartcard - reader. - - This kernel driver requires additional userspace support, either - by the vendor-provided PC/SC ifd_handler (http://www.omnikey.com/), - or via the cm4000 backend of OpenCT (http://www.opensc.com/). - -config CARDMAN_4040 - tristate "Omnikey CardMan 4040 support" - depends on PCMCIA - help - Enable support for the Omnikey CardMan 4040 PCMCIA Smartcard - reader. - - This card is basically a USB CCID device connected to a FIFO - in I/O space. To use the kernel driver, you will need either the - PC/SC ifdhandler provided from the Omnikey homepage - (http://www.omnikey.com/), or a current development version of OpenCT - (http://www.opensc.org/). - endmenu diff --git a/trunk/drivers/char/pcmcia/Makefile b/trunk/drivers/char/pcmcia/Makefile index 0aae20985d57..1fcd4c591958 100644 --- a/trunk/drivers/char/pcmcia/Makefile +++ b/trunk/drivers/char/pcmcia/Makefile @@ -5,5 +5,3 @@ # obj-$(CONFIG_SYNCLINK_CS) += synclink_cs.o -obj-$(CONFIG_CARDMAN_4000) += cm4000_cs.o -obj-$(CONFIG_CARDMAN_4040) += cm4040_cs.o diff --git a/trunk/drivers/char/pcmcia/cm4000_cs.c b/trunk/drivers/char/pcmcia/cm4000_cs.c deleted file mode 100644 index 61681c9f3f72..000000000000 --- a/trunk/drivers/char/pcmcia/cm4000_cs.c +++ /dev/null @@ -1,2079 +0,0 @@ - /* - * A driver for the PCMCIA Smartcard Reader "Omnikey CardMan Mobile 4000" - * - * cm4000_cs.c support.linux@omnikey.com - * - * Tue Oct 23 11:32:43 GMT 2001 herp - cleaned up header files - * Sun Jan 20 10:11:15 MET 2002 herp - added modversion header files - * Thu Nov 14 16:34:11 GMT 2002 mh - added PPS functionality - * Tue Nov 19 16:36:27 GMT 2002 mh - added SUSPEND/RESUME functionailty - * Wed Jul 28 12:55:01 CEST 2004 mh - kernel 2.6 adjustments - * - * current version: 2.4.0gm4 - * - * (C) 2000,2001,2002,2003,2004 Omnikey AG - * - * (C) 2005 Harald Welte - * - Adhere to Kernel CodingStyle - * - Port to 2.6.13 "new" style PCMCIA - * - Check for copy_{from,to}_user return values - * - Use nonseekable_open() - * - * All rights reserved. Licensed under dual BSD/GPL license. - */ - -/* #define PCMCIA_DEBUG 6 */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -/* #define ATR_CSUM */ - -#ifdef PCMCIA_DEBUG -#define reader_to_dev(x) (&handle_to_dev(x->link.handle)) -static int pc_debug = PCMCIA_DEBUG; -module_param(pc_debug, int, 0600); -#define DEBUGP(n, rdr, x, args...) do { \ - if (pc_debug >= (n)) \ - dev_printk(KERN_DEBUG, reader_to_dev(rdr), "%s:" x, \ - __FUNCTION__ , ## args); \ - } while (0) -#else -#define DEBUGP(n, rdr, x, args...) -#endif -static char *version = "cm4000_cs.c v2.4.0gm5 - All bugs added by Harald Welte"; - -#define T_1SEC (HZ) -#define T_10MSEC msecs_to_jiffies(10) -#define T_20MSEC msecs_to_jiffies(20) -#define T_40MSEC msecs_to_jiffies(40) -#define T_50MSEC msecs_to_jiffies(50) -#define T_100MSEC msecs_to_jiffies(100) -#define T_500MSEC msecs_to_jiffies(500) - -static void cm4000_detach(dev_link_t *link); -static void cm4000_release(dev_link_t *link); - -static int major; /* major number we get from the kernel */ - -/* note: the first state has to have number 0 always */ - -#define M_FETCH_ATR 0 -#define M_TIMEOUT_WAIT 1 -#define M_READ_ATR_LEN 2 -#define M_READ_ATR 3 -#define M_ATR_PRESENT 4 -#define M_BAD_CARD 5 -#define M_CARDOFF 6 - -#define LOCK_IO 0 -#define LOCK_MONITOR 1 - -#define IS_AUTOPPS_ACT 6 -#define IS_PROCBYTE_PRESENT 7 -#define IS_INVREV 8 -#define IS_ANY_T0 9 -#define IS_ANY_T1 10 -#define IS_ATR_PRESENT 11 -#define IS_ATR_VALID 12 -#define IS_CMM_ABSENT 13 -#define IS_BAD_LENGTH 14 -#define IS_BAD_CSUM 15 -#define IS_BAD_CARD 16 - -#define REG_FLAGS0(x) (x + 0) -#define REG_FLAGS1(x) (x + 1) -#define REG_NUM_BYTES(x) (x + 2) -#define REG_BUF_ADDR(x) (x + 3) -#define REG_BUF_DATA(x) (x + 4) -#define REG_NUM_SEND(x) (x + 5) -#define REG_BAUDRATE(x) (x + 6) -#define REG_STOPBITS(x) (x + 7) - -struct cm4000_dev { - dev_link_t link; /* pcmcia link */ - dev_node_t node; /* OS node (major,minor) */ - - unsigned char atr[MAX_ATR]; - unsigned char rbuf[512]; - unsigned char sbuf[512]; - - wait_queue_head_t devq; /* when removing cardman must not be - zeroed! */ - - wait_queue_head_t ioq; /* if IO is locked, wait on this Q */ - wait_queue_head_t atrq; /* wait for ATR valid */ - wait_queue_head_t readq; /* used by write to wake blk.read */ - - /* warning: do not move this fields. - * initialising to zero depends on it - see ZERO_DEV below. */ - unsigned char atr_csum; - unsigned char atr_len_retry; - unsigned short atr_len; - unsigned short rlen; /* bytes avail. after write */ - unsigned short rpos; /* latest read pos. write zeroes */ - unsigned char procbyte; /* T=0 procedure byte */ - unsigned char mstate; /* state of card monitor */ - unsigned char cwarn; /* slow down warning */ - unsigned char flags0; /* cardman IO-flags 0 */ - unsigned char flags1; /* cardman IO-flags 1 */ - unsigned int mdelay; /* variable monitor speeds, in jiffies */ - - unsigned int baudv; /* baud value for speed */ - unsigned char ta1; - unsigned char proto; /* T=0, T=1, ... */ - unsigned long flags; /* lock+flags (MONITOR,IO,ATR) * for concurrent - access */ - - unsigned char pts[4]; - - struct timer_list timer; /* used to keep monitor running */ - int monitor_running; -}; - -#define ZERO_DEV(dev) \ - memset(&dev->atr_csum,0, \ - sizeof(struct cm4000_dev) - \ - /*link*/ sizeof(dev_link_t) - \ - /*node*/ sizeof(dev_node_t) - \ - /*atr*/ MAX_ATR*sizeof(char) - \ - /*rbuf*/ 512*sizeof(char) - \ - /*sbuf*/ 512*sizeof(char) - \ - /*queue*/ 4*sizeof(wait_queue_head_t)) - -static dev_info_t dev_info = MODULE_NAME; -static dev_link_t *dev_table[CM4000_MAX_DEV]; - -/* This table doesn't use spaces after the comma between fields and thus - * violates CodingStyle. However, I don't really think wrapping it around will - * make it any clearer to read -HW */ -static unsigned char fi_di_table[10][14] = { -/*FI 00 01 02 03 04 05 06 07 08 09 10 11 12 13 */ -/*DI */ -/* 0 */ {0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11}, -/* 1 */ {0x01,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x91,0x11,0x11,0x11,0x11}, -/* 2 */ {0x02,0x12,0x22,0x32,0x11,0x11,0x11,0x11,0x11,0x92,0xA2,0xB2,0x11,0x11}, -/* 3 */ {0x03,0x13,0x23,0x33,0x43,0x53,0x63,0x11,0x11,0x93,0xA3,0xB3,0xC3,0xD3}, -/* 4 */ {0x04,0x14,0x24,0x34,0x44,0x54,0x64,0x11,0x11,0x94,0xA4,0xB4,0xC4,0xD4}, -/* 5 */ {0x00,0x15,0x25,0x35,0x45,0x55,0x65,0x11,0x11,0x95,0xA5,0xB5,0xC5,0xD5}, -/* 6 */ {0x06,0x16,0x26,0x36,0x46,0x56,0x66,0x11,0x11,0x96,0xA6,0xB6,0xC6,0xD6}, -/* 7 */ {0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11}, -/* 8 */ {0x08,0x11,0x28,0x38,0x48,0x58,0x68,0x11,0x11,0x98,0xA8,0xB8,0xC8,0xD8}, -/* 9 */ {0x09,0x19,0x29,0x39,0x49,0x59,0x69,0x11,0x11,0x99,0xA9,0xB9,0xC9,0xD9} -}; - -#ifndef PCMCIA_DEBUG -#define xoutb outb -#define xinb inb -#else -static inline void xoutb(unsigned char val, unsigned short port) -{ - if (pc_debug >= 7) - printk(KERN_DEBUG "outb(val=%.2x,port=%.4x)\n", val, port); - outb(val, port); -} -static inline unsigned char xinb(unsigned short port) -{ - unsigned char val; - - val = inb(port); - if (pc_debug >= 7) - printk(KERN_DEBUG "%.2x=inb(%.4x)\n", val, port); - - return val; -} -#endif - -#define b_0000 15 -#define b_0001 14 -#define b_0010 13 -#define b_0011 12 -#define b_0100 11 -#define b_0101 10 -#define b_0110 9 -#define b_0111 8 -#define b_1000 7 -#define b_1001 6 -#define b_1010 5 -#define b_1011 4 -#define b_1100 3 -#define b_1101 2 -#define b_1110 1 -#define b_1111 0 - -static unsigned char irtab[16] = { - b_0000, b_1000, b_0100, b_1100, - b_0010, b_1010, b_0110, b_1110, - b_0001, b_1001, b_0101, b_1101, - b_0011, b_1011, b_0111, b_1111 -}; - -static void str_invert_revert(unsigned char *b, int len) -{ - int i; - - for (i = 0; i < len; i++) - b[i] = (irtab[b[i] & 0x0f] << 4) | irtab[b[i] >> 4]; -} - -static unsigned char invert_revert(unsigned char ch) -{ - return (irtab[ch & 0x0f] << 4) | irtab[ch >> 4]; -} - -#define ATRLENCK(dev,pos) \ - if (pos>=dev->atr_len || pos>=MAX_ATR) \ - goto return_0; - -static unsigned int calc_baudv(unsigned char fidi) -{ - unsigned int wcrcf, wbrcf, fi_rfu, di_rfu; - - fi_rfu = 372; - di_rfu = 1; - - /* FI */ - switch ((fidi >> 4) & 0x0F) { - case 0x00: - wcrcf = 372; - break; - case 0x01: - wcrcf = 372; - break; - case 0x02: - wcrcf = 558; - break; - case 0x03: - wcrcf = 744; - break; - case 0x04: - wcrcf = 1116; - break; - case 0x05: - wcrcf = 1488; - break; - case 0x06: - wcrcf = 1860; - break; - case 0x07: - wcrcf = fi_rfu; - break; - case 0x08: - wcrcf = fi_rfu; - break; - case 0x09: - wcrcf = 512; - break; - case 0x0A: - wcrcf = 768; - break; - case 0x0B: - wcrcf = 1024; - break; - case 0x0C: - wcrcf = 1536; - break; - case 0x0D: - wcrcf = 2048; - break; - default: - wcrcf = fi_rfu; - break; - } - - /* DI */ - switch (fidi & 0x0F) { - case 0x00: - wbrcf = di_rfu; - break; - case 0x01: - wbrcf = 1; - break; - case 0x02: - wbrcf = 2; - break; - case 0x03: - wbrcf = 4; - break; - case 0x04: - wbrcf = 8; - break; - case 0x05: - wbrcf = 16; - break; - case 0x06: - wbrcf = 32; - break; - case 0x07: - wbrcf = di_rfu; - break; - case 0x08: - wbrcf = 12; - break; - case 0x09: - wbrcf = 20; - break; - default: - wbrcf = di_rfu; - break; - } - - return (wcrcf / wbrcf); -} - -static unsigned short io_read_num_rec_bytes(ioaddr_t iobase, unsigned short *s) -{ - unsigned short tmp; - - tmp = *s = 0; - do { - *s = tmp; - tmp = inb(REG_NUM_BYTES(iobase)) | - (inb(REG_FLAGS0(iobase)) & 4 ? 0x100 : 0); - } while (tmp != *s); - - return *s; -} - -static int parse_atr(struct cm4000_dev *dev) -{ - unsigned char any_t1, any_t0; - unsigned char ch, ifno; - int ix, done; - - DEBUGP(3, dev, "-> parse_atr: dev->atr_len = %i\n", dev->atr_len); - - if (dev->atr_len < 3) { - DEBUGP(5, dev, "parse_atr: atr_len < 3\n"); - return 0; - } - - if (dev->atr[0] == 0x3f) - set_bit(IS_INVREV, &dev->flags); - else - clear_bit(IS_INVREV, &dev->flags); - ix = 1; - ifno = 1; - ch = dev->atr[1]; - dev->proto = 0; /* XXX PROTO */ - any_t1 = any_t0 = done = 0; - dev->ta1 = 0x11; /* defaults to 9600 baud */ - do { - if (ifno == 1 && (ch & 0x10)) { - /* read first interface byte and TA1 is present */ - dev->ta1 = dev->atr[2]; - DEBUGP(5, dev, "Card says FiDi is 0x%.2x\n", dev->ta1); - ifno++; - } else if ((ifno == 2) && (ch & 0x10)) { /* TA(2) */ - dev->ta1 = 0x11; - ifno++; - } - - DEBUGP(5, dev, "Yi=%.2x\n", ch & 0xf0); - ix += ((ch & 0x10) >> 4) /* no of int.face chars */ - +((ch & 0x20) >> 5) - + ((ch & 0x40) >> 6) - + ((ch & 0x80) >> 7); - /* ATRLENCK(dev,ix); */ - if (ch & 0x80) { /* TDi */ - ch = dev->atr[ix]; - if ((ch & 0x0f)) { - any_t1 = 1; - DEBUGP(5, dev, "card is capable of T=1\n"); - } else { - any_t0 = 1; - DEBUGP(5, dev, "card is capable of T=0\n"); - } - } else - done = 1; - } while (!done); - - DEBUGP(5, dev, "ix=%d noHist=%d any_t1=%d\n", - ix, dev->atr[1] & 15, any_t1); - if (ix + 1 + (dev->atr[1] & 0x0f) + any_t1 != dev->atr_len) { - DEBUGP(5, dev, "length error\n"); - return 0; - } - if (any_t0) - set_bit(IS_ANY_T0, &dev->flags); - - if (any_t1) { /* compute csum */ - dev->atr_csum = 0; -#ifdef ATR_CSUM - for (i = 1; i < dev->atr_len; i++) - dev->atr_csum ^= dev->atr[i]; - if (dev->atr_csum) { - set_bit(IS_BAD_CSUM, &dev->flags); - DEBUGP(5, dev, "bad checksum\n"); - goto return_0; - } -#endif - if (any_t0 == 0) - dev->proto = 1; /* XXX PROTO */ - set_bit(IS_ANY_T1, &dev->flags); - } - - return 1; -} - -struct card_fixup { - char atr[12]; - u_int8_t atr_len; - u_int8_t stopbits; -}; - -static struct card_fixup card_fixups[] = { - { /* ACOS */ - .atr = { 0x3b, 0xb3, 0x11, 0x00, 0x00, 0x41, 0x01 }, - .atr_len = 7, - .stopbits = 0x03, - }, - { /* Motorola */ - .atr = {0x3b, 0x76, 0x13, 0x00, 0x00, 0x80, 0x62, 0x07, - 0x41, 0x81, 0x81 }, - .atr_len = 11, - .stopbits = 0x04, - }, -}; - -static void set_cardparameter(struct cm4000_dev *dev) -{ - int i; - ioaddr_t iobase = dev->link.io.BasePort1; - u_int8_t stopbits = 0x02; /* ISO default */ - - DEBUGP(3, dev, "-> set_cardparameter\n"); - - dev->flags1 = dev->flags1 | (((dev->baudv - 1) & 0x0100) >> 8); - xoutb(dev->flags1, REG_FLAGS1(iobase)); - DEBUGP(5, dev, "flags1 = 0x%02x\n", dev->flags1); - - /* set baudrate */ - xoutb((unsigned char)((dev->baudv - 1) & 0xFF), REG_BAUDRATE(iobase)); - - DEBUGP(5, dev, "baudv = %i -> write 0x%02x\n", dev->baudv, - ((dev->baudv - 1) & 0xFF)); - - /* set stopbits */ - for (i = 0; i < ARRAY_SIZE(card_fixups); i++) { - if (!memcmp(dev->atr, card_fixups[i].atr, - card_fixups[i].atr_len)) - stopbits = card_fixups[i].stopbits; - } - xoutb(stopbits, REG_STOPBITS(iobase)); - - DEBUGP(3, dev, "<- set_cardparameter\n"); -} - -static int set_protocol(struct cm4000_dev *dev, struct ptsreq *ptsreq) -{ - - unsigned long tmp, i; - unsigned short num_bytes_read; - unsigned char pts_reply[4]; - ssize_t rc; - ioaddr_t iobase = dev->link.io.BasePort1; - - rc = 0; - - DEBUGP(3, dev, "-> set_protocol\n"); - DEBUGP(5, dev, "ptsreq->Protocol = 0x%.8x, ptsreq->Flags=0x%.8x, " - "ptsreq->pts1=0x%.2x, ptsreq->pts2=0x%.2x, " - "ptsreq->pts3=0x%.2x\n", (unsigned int)ptsreq->protocol, - (unsigned int)ptsreq->flags, ptsreq->pts1, ptsreq->pts2, - ptsreq->pts3); - - /* Fill PTS structure */ - dev->pts[0] = 0xff; - dev->pts[1] = 0x00; - tmp = ptsreq->protocol; - while ((tmp = (tmp >> 1)) > 0) - dev->pts[1]++; - dev->proto = dev->pts[1]; /* Set new protocol */ - dev->pts[1] = (0x01 << 4) | (dev->pts[1]); - - /* Correct Fi/Di according to CM4000 Fi/Di table */ - DEBUGP(5, dev, "Ta(1) from ATR is 0x%.2x\n", dev->ta1); - /* set Fi/Di according to ATR TA(1) */ - dev->pts[2] = fi_di_table[dev->ta1 & 0x0F][(dev->ta1 >> 4) & 0x0F]; - - /* Calculate PCK character */ - dev->pts[3] = dev->pts[0] ^ dev->pts[1] ^ dev->pts[2]; - - DEBUGP(5, dev, "pts0=%.2x, pts1=%.2x, pts2=%.2x, pts3=%.2x\n", - dev->pts[0], dev->pts[1], dev->pts[2], dev->pts[3]); - - /* check card convention */ - if (test_bit(IS_INVREV, &dev->flags)) - str_invert_revert(dev->pts, 4); - - /* reset SM */ - xoutb(0x80, REG_FLAGS0(iobase)); - - /* Enable access to the message buffer */ - DEBUGP(5, dev, "Enable access to the messages buffer\n"); - dev->flags1 = 0x20 /* T_Active */ - | (test_bit(IS_INVREV, &dev->flags) ? 0x02 : 0x00) /* inv parity */ - | ((dev->baudv >> 8) & 0x01); /* MSB-baud */ - xoutb(dev->flags1, REG_FLAGS1(iobase)); - - DEBUGP(5, dev, "Enable message buffer -> flags1 = 0x%.2x\n", - dev->flags1); - - /* write challenge to the buffer */ - DEBUGP(5, dev, "Write challenge to buffer: "); - for (i = 0; i < 4; i++) { - xoutb(i, REG_BUF_ADDR(iobase)); - xoutb(dev->pts[i], REG_BUF_DATA(iobase)); /* buf data */ -#ifdef PCMCIA_DEBUG - if (pc_debug >= 5) - printk("0x%.2x ", dev->pts[i]); - } - if (pc_debug >= 5) - printk("\n"); -#else - } -#endif - - /* set number of bytes to write */ - DEBUGP(5, dev, "Set number of bytes to write\n"); - xoutb(0x04, REG_NUM_SEND(iobase)); - - /* Trigger CARDMAN CONTROLLER */ - xoutb(0x50, REG_FLAGS0(iobase)); - - /* Monitor progress */ - /* wait for xmit done */ - DEBUGP(5, dev, "Waiting for NumRecBytes getting valid\n"); - - for (i = 0; i < 100; i++) { - if (inb(REG_FLAGS0(iobase)) & 0x08) { - DEBUGP(5, dev, "NumRecBytes is valid\n"); - break; - } - mdelay(10); - } - if (i == 100) { - DEBUGP(5, dev, "Timeout waiting for NumRecBytes getting " - "valid\n"); - rc = -EIO; - goto exit_setprotocol; - } - - DEBUGP(5, dev, "Reading NumRecBytes\n"); - for (i = 0; i < 100; i++) { - io_read_num_rec_bytes(iobase, &num_bytes_read); - if (num_bytes_read >= 4) { - DEBUGP(2, dev, "NumRecBytes = %i\n", num_bytes_read); - break; - } - mdelay(10); - } - - /* check whether it is a short PTS reply? */ - if (num_bytes_read == 3) - i = 0; - - if (i == 100) { - DEBUGP(5, dev, "Timeout reading num_bytes_read\n"); - rc = -EIO; - goto exit_setprotocol; - } - - DEBUGP(5, dev, "Reset the CARDMAN CONTROLLER\n"); - xoutb(0x80, REG_FLAGS0(iobase)); - - /* Read PPS reply */ - DEBUGP(5, dev, "Read PPS reply\n"); - for (i = 0; i < num_bytes_read; i++) { - xoutb(i, REG_BUF_ADDR(iobase)); - pts_reply[i] = inb(REG_BUF_DATA(iobase)); - } - -#ifdef PCMCIA_DEBUG - DEBUGP(2, dev, "PTSreply: "); - for (i = 0; i < num_bytes_read; i++) { - if (pc_debug >= 5) - printk("0x%.2x ", pts_reply[i]); - } - printk("\n"); -#endif /* PCMCIA_DEBUG */ - - DEBUGP(5, dev, "Clear Tactive in Flags1\n"); - xoutb(0x20, REG_FLAGS1(iobase)); - - /* Compare ptsreq and ptsreply */ - if ((dev->pts[0] == pts_reply[0]) && - (dev->pts[1] == pts_reply[1]) && - (dev->pts[2] == pts_reply[2]) && (dev->pts[3] == pts_reply[3])) { - /* setcardparameter according to PPS */ - dev->baudv = calc_baudv(dev->pts[2]); - set_cardparameter(dev); - } else if ((dev->pts[0] == pts_reply[0]) && - ((dev->pts[1] & 0xef) == pts_reply[1]) && - ((pts_reply[0] ^ pts_reply[1]) == pts_reply[2])) { - /* short PTS reply, set card parameter to default values */ - dev->baudv = calc_baudv(0x11); - set_cardparameter(dev); - } else - rc = -EIO; - -exit_setprotocol: - DEBUGP(3, dev, "<- set_protocol\n"); - return rc; -} - -static int io_detect_cm4000(ioaddr_t iobase, struct cm4000_dev *dev) -{ - - /* note: statemachine is assumed to be reset */ - if (inb(REG_FLAGS0(iobase)) & 8) { - clear_bit(IS_ATR_VALID, &dev->flags); - set_bit(IS_CMM_ABSENT, &dev->flags); - return 0; /* detect CMM = 1 -> failure */ - } - /* xoutb(0x40, REG_FLAGS1(iobase)); detectCMM */ - xoutb(dev->flags1 | 0x40, REG_FLAGS1(iobase)); - if ((inb(REG_FLAGS0(iobase)) & 8) == 0) { - clear_bit(IS_ATR_VALID, &dev->flags); - set_bit(IS_CMM_ABSENT, &dev->flags); - return 0; /* detect CMM=0 -> failure */ - } - /* clear detectCMM again by restoring original flags1 */ - xoutb(dev->flags1, REG_FLAGS1(iobase)); - return 1; -} - -static void terminate_monitor(struct cm4000_dev *dev) -{ - - /* tell the monitor to stop and wait until - * it terminates. - */ - DEBUGP(3, dev, "-> terminate_monitor\n"); - wait_event_interruptible(dev->devq, - test_and_set_bit(LOCK_MONITOR, - (void *)&dev->flags)); - - /* now, LOCK_MONITOR has been set. - * allow a last cycle in the monitor. - * the monitor will indicate that it has - * finished by clearing this bit. - */ - DEBUGP(5, dev, "Now allow last cycle of monitor!\n"); - while (test_bit(LOCK_MONITOR, (void *)&dev->flags)) - msleep(25); - - DEBUGP(5, dev, "Delete timer\n"); - del_timer_sync(&dev->timer); -#ifdef PCMCIA_DEBUG - dev->monitor_running = 0; -#endif - - DEBUGP(3, dev, "<- terminate_monitor\n"); -} - -/* - * monitor the card every 50msec. as a side-effect, retrieve the - * atr once a card is inserted. another side-effect of retrieving the - * atr is that the card will be powered on, so there is no need to - * power on the card explictely from the application: the driver - * is already doing that for you. - */ - -static void monitor_card(unsigned long p) -{ - struct cm4000_dev *dev = (struct cm4000_dev *) p; - ioaddr_t iobase = dev->link.io.BasePort1; - unsigned short s; - struct ptsreq ptsreq; - int i, atrc; - - DEBUGP(7, dev, "-> monitor_card\n"); - - /* if someone has set the lock for us: we're done! */ - if (test_and_set_bit(LOCK_MONITOR, &dev->flags)) { - DEBUGP(4, dev, "About to stop monitor\n"); - /* no */ - dev->rlen = - dev->rpos = - dev->atr_csum = dev->atr_len_retry = dev->cwarn = 0; - dev->mstate = M_FETCH_ATR; - clear_bit(LOCK_MONITOR, &dev->flags); - /* close et al. are sleeping on devq, so wake it */ - wake_up_interruptible(&dev->devq); - DEBUGP(2, dev, "<- monitor_card (we are done now)\n"); - return; - } - - /* try to lock io: if it is already locked, just add another timer */ - if (test_and_set_bit(LOCK_IO, (void *)&dev->flags)) { - DEBUGP(4, dev, "Couldn't get IO lock\n"); - goto return_with_timer; - } - - /* is a card/a reader inserted at all ? */ - dev->flags0 = xinb(REG_FLAGS0(iobase)); - DEBUGP(7, dev, "dev->flags0 = 0x%2x\n", dev->flags0); - DEBUGP(7, dev, "smartcard present: %s\n", - dev->flags0 & 1 ? "yes" : "no"); - DEBUGP(7, dev, "cardman present: %s\n", - dev->flags0 == 0xff ? "no" : "yes"); - - if ((dev->flags0 & 1) == 0 /* no smartcard inserted */ - || dev->flags0 == 0xff) { /* no cardman inserted */ - /* no */ - dev->rlen = - dev->rpos = - dev->atr_csum = dev->atr_len_retry = dev->cwarn = 0; - dev->mstate = M_FETCH_ATR; - - dev->flags &= 0x000000ff; /* only keep IO and MONITOR locks */ - - if (dev->flags0 == 0xff) { - DEBUGP(4, dev, "set IS_CMM_ABSENT bit\n"); - set_bit(IS_CMM_ABSENT, &dev->flags); - } else if (test_bit(IS_CMM_ABSENT, &dev->flags)) { - DEBUGP(4, dev, "clear IS_CMM_ABSENT bit " - "(card is removed)\n"); - clear_bit(IS_CMM_ABSENT, &dev->flags); - } - - goto release_io; - } else if ((dev->flags0 & 1) && test_bit(IS_CMM_ABSENT, &dev->flags)) { - /* cardman and card present but cardman was absent before - * (after suspend with inserted card) */ - DEBUGP(4, dev, "clear IS_CMM_ABSENT bit (card is inserted)\n"); - clear_bit(IS_CMM_ABSENT, &dev->flags); - } - - if (test_bit(IS_ATR_VALID, &dev->flags) == 1) { - DEBUGP(7, dev, "believe ATR is already valid (do nothing)\n"); - goto release_io; - } - - switch (dev->mstate) { - unsigned char flags0; - case M_CARDOFF: - DEBUGP(4, dev, "M_CARDOFF\n"); - flags0 = inb(REG_FLAGS0(iobase)); - if (flags0 & 0x02) { - /* wait until Flags0 indicate power is off */ - dev->mdelay = T_10MSEC; - } else { - /* Flags0 indicate power off and no card inserted now; - * Reset CARDMAN CONTROLLER */ - xoutb(0x80, REG_FLAGS0(iobase)); - - /* prepare for fetching ATR again: after card off ATR - * is read again automatically */ - dev->rlen = - dev->rpos = - dev->atr_csum = - dev->atr_len_retry = dev->cwarn = 0; - dev->mstate = M_FETCH_ATR; - - /* minimal gap between CARDOFF and read ATR is 50msec */ - dev->mdelay = T_50MSEC; - } - break; - case M_FETCH_ATR: - DEBUGP(4, dev, "M_FETCH_ATR\n"); - xoutb(0x80, REG_FLAGS0(iobase)); - DEBUGP(4, dev, "Reset BAUDV to 9600\n"); - dev->baudv = 0x173; /* 9600 */ - xoutb(0x02, REG_STOPBITS(iobase)); /* stopbits=2 */ - xoutb(0x73, REG_BAUDRATE(iobase)); /* baud value */ - xoutb(0x21, REG_FLAGS1(iobase)); /* T_Active=1, baud - value */ - /* warm start vs. power on: */ - xoutb(dev->flags0 & 2 ? 0x46 : 0x44, REG_FLAGS0(iobase)); - dev->mdelay = T_40MSEC; - dev->mstate = M_TIMEOUT_WAIT; - break; - case M_TIMEOUT_WAIT: - DEBUGP(4, dev, "M_TIMEOUT_WAIT\n"); - /* numRecBytes */ - io_read_num_rec_bytes(iobase, &dev->atr_len); - dev->mdelay = T_10MSEC; - dev->mstate = M_READ_ATR_LEN; - break; - case M_READ_ATR_LEN: - DEBUGP(4, dev, "M_READ_ATR_LEN\n"); - /* infinite loop possible, since there is no timeout */ - -#define MAX_ATR_LEN_RETRY 100 - - if (dev->atr_len == io_read_num_rec_bytes(iobase, &s)) { - if (dev->atr_len_retry++ >= MAX_ATR_LEN_RETRY) { /* + XX msec */ - dev->mdelay = T_10MSEC; - dev->mstate = M_READ_ATR; - } - } else { - dev->atr_len = s; - dev->atr_len_retry = 0; /* set new timeout */ - } - - DEBUGP(4, dev, "Current ATR_LEN = %i\n", dev->atr_len); - break; - case M_READ_ATR: - DEBUGP(4, dev, "M_READ_ATR\n"); - xoutb(0x80, REG_FLAGS0(iobase)); /* reset SM */ - for (i = 0; i < dev->atr_len; i++) { - xoutb(i, REG_BUF_ADDR(iobase)); - dev->atr[i] = inb(REG_BUF_DATA(iobase)); - } - /* Deactivate T_Active flags */ - DEBUGP(4, dev, "Deactivate T_Active flags\n"); - dev->flags1 = 0x01; - xoutb(dev->flags1, REG_FLAGS1(iobase)); - - /* atr is present (which doesnt mean it's valid) */ - set_bit(IS_ATR_PRESENT, &dev->flags); - if (dev->atr[0] == 0x03) - str_invert_revert(dev->atr, dev->atr_len); - atrc = parse_atr(dev); - if (atrc == 0) { /* atr invalid */ - dev->mdelay = 0; - dev->mstate = M_BAD_CARD; - } else { - dev->mdelay = T_50MSEC; - dev->mstate = M_ATR_PRESENT; - set_bit(IS_ATR_VALID, &dev->flags); - } - - if (test_bit(IS_ATR_VALID, &dev->flags) == 1) { - DEBUGP(4, dev, "monitor_card: ATR valid\n"); - /* if ta1 == 0x11, no PPS necessary (default values) */ - /* do not do PPS with multi protocol cards */ - if ((test_bit(IS_AUTOPPS_ACT, &dev->flags) == 0) && - (dev->ta1 != 0x11) && - !(test_bit(IS_ANY_T0, &dev->flags) && - test_bit(IS_ANY_T1, &dev->flags))) { - DEBUGP(4, dev, "Perform AUTOPPS\n"); - set_bit(IS_AUTOPPS_ACT, &dev->flags); - ptsreq.protocol = ptsreq.protocol = - (0x01 << dev->proto); - ptsreq.flags = 0x01; - ptsreq.pts1 = 0x00; - ptsreq.pts2 = 0x00; - ptsreq.pts3 = 0x00; - if (set_protocol(dev, &ptsreq) == 0) { - DEBUGP(4, dev, "AUTOPPS ret SUCC\n"); - clear_bit(IS_AUTOPPS_ACT, &dev->flags); - wake_up_interruptible(&dev->atrq); - } else { - DEBUGP(4, dev, "AUTOPPS failed: " - "repower using defaults\n"); - /* prepare for repowering */ - clear_bit(IS_ATR_PRESENT, &dev->flags); - clear_bit(IS_ATR_VALID, &dev->flags); - dev->rlen = - dev->rpos = - dev->atr_csum = - dev->atr_len_retry = dev->cwarn = 0; - dev->mstate = M_FETCH_ATR; - - dev->mdelay = T_50MSEC; - } - } else { - /* for cards which use slightly different - * params (extra guard time) */ - set_cardparameter(dev); - if (test_bit(IS_AUTOPPS_ACT, &dev->flags) == 1) - DEBUGP(4, dev, "AUTOPPS already active " - "2nd try:use default values\n"); - if (dev->ta1 == 0x11) - DEBUGP(4, dev, "No AUTOPPS necessary " - "TA(1)==0x11\n"); - if (test_bit(IS_ANY_T0, &dev->flags) - && test_bit(IS_ANY_T1, &dev->flags)) - DEBUGP(4, dev, "Do NOT perform AUTOPPS " - "with multiprotocol cards\n"); - clear_bit(IS_AUTOPPS_ACT, &dev->flags); - wake_up_interruptible(&dev->atrq); - } - } else { - DEBUGP(4, dev, "ATR invalid\n"); - wake_up_interruptible(&dev->atrq); - } - break; - case M_BAD_CARD: - DEBUGP(4, dev, "M_BAD_CARD\n"); - /* slow down warning, but prompt immediately after insertion */ - if (dev->cwarn == 0 || dev->cwarn == 10) { - set_bit(IS_BAD_CARD, &dev->flags); - printk(KERN_WARNING MODULE_NAME ": device %s: ", - dev->node.dev_name); - if (test_bit(IS_BAD_CSUM, &dev->flags)) { - DEBUGP(4, dev, "ATR checksum (0x%.2x, should " - "be zero) failed\n", dev->atr_csum); - } -#ifdef PCMCIA_DEBUG - else if (test_bit(IS_BAD_LENGTH, &dev->flags)) { - DEBUGP(4, dev, "ATR length error\n"); - } else { - DEBUGP(4, dev, "card damaged or wrong way " - "inserted\n"); - } -#endif - dev->cwarn = 0; - wake_up_interruptible(&dev->atrq); /* wake open */ - } - dev->cwarn++; - dev->mdelay = T_100MSEC; - dev->mstate = M_FETCH_ATR; - break; - default: - DEBUGP(7, dev, "Unknown action\n"); - break; /* nothing */ - } - -release_io: - DEBUGP(7, dev, "release_io\n"); - clear_bit(LOCK_IO, &dev->flags); - wake_up_interruptible(&dev->ioq); /* whoever needs IO */ - -return_with_timer: - DEBUGP(7, dev, "<- monitor_card (returns with timer)\n"); - dev->timer.expires = jiffies + dev->mdelay; - add_timer(&dev->timer); - clear_bit(LOCK_MONITOR, &dev->flags); -} - -/* Interface to userland (file_operations) */ - -static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count, - loff_t *ppos) -{ - struct cm4000_dev *dev = filp->private_data; - ioaddr_t iobase = dev->link.io.BasePort1; - ssize_t rc; - int i, j, k; - - DEBUGP(2, dev, "-> cmm_read(%s,%d)\n", current->comm, current->pid); - - if (count == 0) /* according to manpage */ - return 0; - - if ((dev->link.state & DEV_PRESENT) == 0 || /* socket removed */ - test_bit(IS_CMM_ABSENT, &dev->flags)) - return -ENODEV; - - if (test_bit(IS_BAD_CSUM, &dev->flags)) - return -EIO; - - /* also see the note about this in cmm_write */ - if (wait_event_interruptible - (dev->atrq, - ((filp->f_flags & O_NONBLOCK) - || (test_bit(IS_ATR_PRESENT, (void *)&dev->flags) != 0)))) { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - return -ERESTARTSYS; - } - - if (test_bit(IS_ATR_VALID, &dev->flags) == 0) - return -EIO; - - /* this one implements blocking IO */ - if (wait_event_interruptible - (dev->readq, - ((filp->f_flags & O_NONBLOCK) || (dev->rpos < dev->rlen)))) { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - return -ERESTARTSYS; - } - - /* lock io */ - if (wait_event_interruptible - (dev->ioq, - ((filp->f_flags & O_NONBLOCK) - || (test_and_set_bit(LOCK_IO, (void *)&dev->flags) == 0)))) { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - return -ERESTARTSYS; - } - - rc = 0; - dev->flags0 = inb(REG_FLAGS0(iobase)); - if ((dev->flags0 & 1) == 0 /* no smartcard inserted */ - || dev->flags0 == 0xff) { /* no cardman inserted */ - clear_bit(IS_ATR_VALID, &dev->flags); - if (dev->flags0 & 1) { - set_bit(IS_CMM_ABSENT, &dev->flags); - rc = -ENODEV; - } - rc = -EIO; - goto release_io; - } - - DEBUGP(4, dev, "begin read answer\n"); - j = min(count, (size_t)(dev->rlen - dev->rpos)); - k = dev->rpos; - if (k + j > 255) - j = 256 - k; - DEBUGP(4, dev, "read1 j=%d\n", j); - for (i = 0; i < j; i++) { - xoutb(k++, REG_BUF_ADDR(iobase)); - dev->rbuf[i] = xinb(REG_BUF_DATA(iobase)); - } - j = min(count, (size_t)(dev->rlen - dev->rpos)); - if (k + j > 255) { - DEBUGP(4, dev, "read2 j=%d\n", j); - dev->flags1 |= 0x10; /* MSB buf addr set */ - xoutb(dev->flags1, REG_FLAGS1(iobase)); - for (; i < j; i++) { - xoutb(k++, REG_BUF_ADDR(iobase)); - dev->rbuf[i] = xinb(REG_BUF_DATA(iobase)); - } - } - - if (dev->proto == 0 && count > dev->rlen - dev->rpos) { - DEBUGP(4, dev, "T=0 and count > buffer\n"); - dev->rbuf[i] = dev->rbuf[i - 1]; - dev->rbuf[i - 1] = dev->procbyte; - j++; - } - count = j; - - dev->rpos = dev->rlen + 1; - - /* Clear T1Active */ - DEBUGP(4, dev, "Clear T1Active\n"); - dev->flags1 &= 0xdf; - xoutb(dev->flags1, REG_FLAGS1(iobase)); - - xoutb(0, REG_FLAGS1(iobase)); /* clear detectCMM */ - /* last check before exit */ - if (!io_detect_cm4000(iobase, dev)) - count = -ENODEV; - - if (test_bit(IS_INVREV, &dev->flags) && count > 0) - str_invert_revert(dev->rbuf, count); - - if (copy_to_user(buf, dev->rbuf, count)) - return -EFAULT; - -release_io: - clear_bit(LOCK_IO, &dev->flags); - wake_up_interruptible(&dev->ioq); - - DEBUGP(2, dev, "<- cmm_read returns: rc = %Zi\n", - (rc < 0 ? rc : count)); - return rc < 0 ? rc : count; -} - -static ssize_t cmm_write(struct file *filp, const char __user *buf, - size_t count, loff_t *ppos) -{ - struct cm4000_dev *dev = (struct cm4000_dev *) filp->private_data; - ioaddr_t iobase = dev->link.io.BasePort1; - unsigned short s; - unsigned char tmp; - unsigned char infolen; - unsigned char sendT0; - unsigned short nsend; - unsigned short nr; - ssize_t rc; - int i; - - DEBUGP(2, dev, "-> cmm_write(%s,%d)\n", current->comm, current->pid); - - if (count == 0) /* according to manpage */ - return 0; - - if (dev->proto == 0 && count < 4) { - /* T0 must have at least 4 bytes */ - DEBUGP(4, dev, "T0 short write\n"); - return -EIO; - } - - nr = count & 0x1ff; /* max bytes to write */ - - sendT0 = dev->proto ? 0 : nr > 5 ? 0x08 : 0; - - if ((dev->link.state & DEV_PRESENT) == 0 || /* socket removed */ - test_bit(IS_CMM_ABSENT, &dev->flags)) - return -ENODEV; - - if (test_bit(IS_BAD_CSUM, &dev->flags)) { - DEBUGP(4, dev, "bad csum\n"); - return -EIO; - } - - /* - * wait for atr to become valid. - * note: it is important to lock this code. if we dont, the monitor - * could be run between test_bit and the the call the sleep on the - * atr-queue. if *then* the monitor detects atr valid, it will wake up - * any process on the atr-queue, *but* since we have been interrupted, - * we do not yet sleep on this queue. this would result in a missed - * wake_up and the calling process would sleep forever (until - * interrupted). also, do *not* restore_flags before sleep_on, because - * this could result in the same situation! - */ - if (wait_event_interruptible - (dev->atrq, - ((filp->f_flags & O_NONBLOCK) - || (test_bit(IS_ATR_PRESENT, (void *)&dev->flags) != 0)))) { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - return -ERESTARTSYS; - } - - if (test_bit(IS_ATR_VALID, &dev->flags) == 0) { /* invalid atr */ - DEBUGP(4, dev, "invalid ATR\n"); - return -EIO; - } - - /* lock io */ - if (wait_event_interruptible - (dev->ioq, - ((filp->f_flags & O_NONBLOCK) - || (test_and_set_bit(LOCK_IO, (void *)&dev->flags) == 0)))) { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - return -ERESTARTSYS; - } - - if (copy_from_user(dev->sbuf, buf, ((count > 512) ? 512 : count))) - return -EFAULT; - - rc = 0; - dev->flags0 = inb(REG_FLAGS0(iobase)); - if ((dev->flags0 & 1) == 0 /* no smartcard inserted */ - || dev->flags0 == 0xff) { /* no cardman inserted */ - clear_bit(IS_ATR_VALID, &dev->flags); - if (dev->flags0 & 1) { - set_bit(IS_CMM_ABSENT, &dev->flags); - rc = -ENODEV; - } else { - DEBUGP(4, dev, "IO error\n"); - rc = -EIO; - } - goto release_io; - } - - xoutb(0x80, REG_FLAGS0(iobase)); /* reset SM */ - - if (!io_detect_cm4000(iobase, dev)) { - rc = -ENODEV; - goto release_io; - } - - /* reflect T=0 send/read mode in flags1 */ - dev->flags1 |= (sendT0); - - set_cardparameter(dev); - - /* dummy read, reset flag procedure received */ - tmp = inb(REG_FLAGS1(iobase)); - - dev->flags1 = 0x20 /* T_Active */ - | (sendT0) - | (test_bit(IS_INVREV, &dev->flags) ? 2 : 0)/* inverse parity */ - | (((dev->baudv - 1) & 0x0100) >> 8); /* MSB-Baud */ - DEBUGP(1, dev, "set dev->flags1 = 0x%.2x\n", dev->flags1); - xoutb(dev->flags1, REG_FLAGS1(iobase)); - - /* xmit data */ - DEBUGP(4, dev, "Xmit data\n"); - for (i = 0; i < nr; i++) { - if (i >= 256) { - dev->flags1 = 0x20 /* T_Active */ - | (sendT0) /* SendT0 */ - /* inverse parity: */ - | (test_bit(IS_INVREV, &dev->flags) ? 2 : 0) - | (((dev->baudv - 1) & 0x0100) >> 8) /* MSB-Baud */ - | 0x10; /* set address high */ - DEBUGP(4, dev, "dev->flags = 0x%.2x - set address " - "high\n", dev->flags1); - xoutb(dev->flags1, REG_FLAGS1(iobase)); - } - if (test_bit(IS_INVREV, &dev->flags)) { - DEBUGP(4, dev, "Apply inverse convention for 0x%.2x " - "-> 0x%.2x\n", (unsigned char)dev->sbuf[i], - invert_revert(dev->sbuf[i])); - xoutb(i, REG_BUF_ADDR(iobase)); - xoutb(invert_revert(dev->sbuf[i]), - REG_BUF_DATA(iobase)); - } else { - xoutb(i, REG_BUF_ADDR(iobase)); - xoutb(dev->sbuf[i], REG_BUF_DATA(iobase)); - } - } - DEBUGP(4, dev, "Xmit done\n"); - - if (dev->proto == 0) { - /* T=0 proto: 0 byte reply */ - if (nr == 4) { - DEBUGP(4, dev, "T=0 assumes 0 byte reply\n"); - xoutb(i, REG_BUF_ADDR(iobase)); - if (test_bit(IS_INVREV, &dev->flags)) - xoutb(0xff, REG_BUF_DATA(iobase)); - else - xoutb(0x00, REG_BUF_DATA(iobase)); - } - - /* numSendBytes */ - if (sendT0) - nsend = nr; - else { - if (nr == 4) - nsend = 5; - else { - nsend = 5 + (unsigned char)dev->sbuf[4]; - if (dev->sbuf[4] == 0) - nsend += 0x100; - } - } - } else - nsend = nr; - - /* T0: output procedure byte */ - if (test_bit(IS_INVREV, &dev->flags)) { - DEBUGP(4, dev, "T=0 set Procedure byte (inverse-reverse) " - "0x%.2x\n", invert_revert(dev->sbuf[1])); - xoutb(invert_revert(dev->sbuf[1]), REG_NUM_BYTES(iobase)); - } else { - DEBUGP(4, dev, "T=0 set Procedure byte 0x%.2x\n", dev->sbuf[1]); - xoutb(dev->sbuf[1], REG_NUM_BYTES(iobase)); - } - - DEBUGP(1, dev, "set NumSendBytes = 0x%.2x\n", - (unsigned char)(nsend & 0xff)); - xoutb((unsigned char)(nsend & 0xff), REG_NUM_SEND(iobase)); - - DEBUGP(1, dev, "Trigger CARDMAN CONTROLLER (0x%.2x)\n", - 0x40 /* SM_Active */ - | (dev->flags0 & 2 ? 0 : 4) /* power on if needed */ - |(dev->proto ? 0x10 : 0x08) /* T=1/T=0 */ - |(nsend & 0x100) >> 8 /* MSB numSendBytes */ ); - xoutb(0x40 /* SM_Active */ - | (dev->flags0 & 2 ? 0 : 4) /* power on if needed */ - |(dev->proto ? 0x10 : 0x08) /* T=1/T=0 */ - |(nsend & 0x100) >> 8, /* MSB numSendBytes */ - REG_FLAGS0(iobase)); - - /* wait for xmit done */ - if (dev->proto == 1) { - DEBUGP(4, dev, "Wait for xmit done\n"); - for (i = 0; i < 1000; i++) { - if (inb(REG_FLAGS0(iobase)) & 0x08) - break; - msleep_interruptible(10); - } - if (i == 1000) { - DEBUGP(4, dev, "timeout waiting for xmit done\n"); - rc = -EIO; - goto release_io; - } - } - - /* T=1: wait for infoLen */ - - infolen = 0; - if (dev->proto) { - /* wait until infoLen is valid */ - for (i = 0; i < 6000; i++) { /* max waiting time of 1 min */ - io_read_num_rec_bytes(iobase, &s); - if (s >= 3) { - infolen = inb(REG_FLAGS1(iobase)); - DEBUGP(4, dev, "infolen=%d\n", infolen); - break; - } - msleep_interruptible(10); - } - if (i == 6000) { - DEBUGP(4, dev, "timeout waiting for infoLen\n"); - rc = -EIO; - goto release_io; - } - } else - clear_bit(IS_PROCBYTE_PRESENT, &dev->flags); - - /* numRecBytes | bit9 of numRecytes */ - io_read_num_rec_bytes(iobase, &dev->rlen); - for (i = 0; i < 600; i++) { /* max waiting time of 2 sec */ - if (dev->proto) { - if (dev->rlen >= infolen + 4) - break; - } - msleep_interruptible(10); - /* numRecBytes | bit9 of numRecytes */ - io_read_num_rec_bytes(iobase, &s); - if (s > dev->rlen) { - DEBUGP(1, dev, "NumRecBytes inc (reset timeout)\n"); - i = 0; /* reset timeout */ - dev->rlen = s; - } - /* T=0: we are done when numRecBytes doesn't - * increment any more and NoProcedureByte - * is set and numRecBytes == bytes sent + 6 - * (header bytes + data + 1 for sw2) - * except when the card replies an error - * which means, no data will be sent back. - */ - else if (dev->proto == 0) { - if ((inb(REG_BUF_ADDR(iobase)) & 0x80)) { - /* no procedure byte received since last read */ - DEBUGP(1, dev, "NoProcedure byte set\n"); - /* i=0; */ - } else { - /* procedure byte received since last read */ - DEBUGP(1, dev, "NoProcedure byte unset " - "(reset timeout)\n"); - dev->procbyte = inb(REG_FLAGS1(iobase)); - DEBUGP(1, dev, "Read procedure byte 0x%.2x\n", - dev->procbyte); - i = 0; /* resettimeout */ - } - if (inb(REG_FLAGS0(iobase)) & 0x08) { - DEBUGP(1, dev, "T0Done flag (read reply)\n"); - break; - } - } - if (dev->proto) - infolen = inb(REG_FLAGS1(iobase)); - } - if (i == 600) { - DEBUGP(1, dev, "timeout waiting for numRecBytes\n"); - rc = -EIO; - goto release_io; - } else { - if (dev->proto == 0) { - DEBUGP(1, dev, "Wait for T0Done bit to be set\n"); - for (i = 0; i < 1000; i++) { - if (inb(REG_FLAGS0(iobase)) & 0x08) - break; - msleep_interruptible(10); - } - if (i == 1000) { - DEBUGP(1, dev, "timeout waiting for T0Done\n"); - rc = -EIO; - goto release_io; - } - - dev->procbyte = inb(REG_FLAGS1(iobase)); - DEBUGP(4, dev, "Read procedure byte 0x%.2x\n", - dev->procbyte); - - io_read_num_rec_bytes(iobase, &dev->rlen); - DEBUGP(4, dev, "Read NumRecBytes = %i\n", dev->rlen); - - } - } - /* T=1: read offset=zero, T=0: read offset=after challenge */ - dev->rpos = dev->proto ? 0 : nr == 4 ? 5 : nr > dev->rlen ? 5 : nr; - DEBUGP(4, dev, "dev->rlen = %i, dev->rpos = %i, nr = %i\n", - dev->rlen, dev->rpos, nr); - -release_io: - DEBUGP(4, dev, "Reset SM\n"); - xoutb(0x80, REG_FLAGS0(iobase)); /* reset SM */ - - if (rc < 0) { - DEBUGP(4, dev, "Write failed but clear T_Active\n"); - dev->flags1 &= 0xdf; - xoutb(dev->flags1, REG_FLAGS1(iobase)); - } - - clear_bit(LOCK_IO, &dev->flags); - wake_up_interruptible(&dev->ioq); - wake_up_interruptible(&dev->readq); /* tell read we have data */ - - /* ITSEC E2: clear write buffer */ - memset((char *)dev->sbuf, 0, 512); - - /* return error or actually written bytes */ - DEBUGP(2, dev, "<- cmm_write\n"); - return rc < 0 ? rc : nr; -} - -static void start_monitor(struct cm4000_dev *dev) -{ - DEBUGP(3, dev, "-> start_monitor\n"); - if (!dev->monitor_running) { - DEBUGP(5, dev, "create, init and add timer\n"); - init_timer(&dev->timer); - dev->monitor_running = 1; - dev->timer.expires = jiffies; - dev->timer.data = (unsigned long) dev; - dev->timer.function = monitor_card; - add_timer(&dev->timer); - } else - DEBUGP(5, dev, "monitor already running\n"); - DEBUGP(3, dev, "<- start_monitor\n"); -} - -static void stop_monitor(struct cm4000_dev *dev) -{ - DEBUGP(3, dev, "-> stop_monitor\n"); - if (dev->monitor_running) { - DEBUGP(5, dev, "stopping monitor\n"); - terminate_monitor(dev); - /* reset monitor SM */ - clear_bit(IS_ATR_VALID, &dev->flags); - clear_bit(IS_ATR_PRESENT, &dev->flags); - } else - DEBUGP(5, dev, "monitor already stopped\n"); - DEBUGP(3, dev, "<- stop_monitor\n"); -} - -static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg) -{ - struct cm4000_dev *dev = filp->private_data; - ioaddr_t iobase = dev->link.io.BasePort1; - dev_link_t *link; - int size; - int rc; - void __user *argp = (void __user *)arg; -#ifdef PCMCIA_DEBUG - char *ioctl_names[CM_IOC_MAXNR + 1] = { - [_IOC_NR(CM_IOCGSTATUS)] "CM_IOCGSTATUS", - [_IOC_NR(CM_IOCGATR)] "CM_IOCGATR", - [_IOC_NR(CM_IOCARDOFF)] "CM_IOCARDOFF", - [_IOC_NR(CM_IOCSPTS)] "CM_IOCSPTS", - [_IOC_NR(CM_IOSDBGLVL)] "CM4000_DBGLVL", - }; -#endif - DEBUGP(3, dev, "cmm_ioctl(device=%d.%d) %s\n", imajor(inode), - iminor(inode), ioctl_names[_IOC_NR(cmd)]); - - link = dev_table[iminor(inode)]; - if (!(DEV_OK(link))) { - DEBUGP(4, dev, "DEV_OK false\n"); - return -ENODEV; - } - - if (test_bit(IS_CMM_ABSENT, &dev->flags)) { - DEBUGP(4, dev, "CMM_ABSENT flag set\n"); - return -ENODEV; - } - - if (_IOC_TYPE(cmd) != CM_IOC_MAGIC) { - DEBUGP(4, dev, "ioctype mismatch\n"); - return -EINVAL; - } - if (_IOC_NR(cmd) > CM_IOC_MAXNR) { - DEBUGP(4, dev, "iocnr mismatch\n"); - return -EINVAL; - } - size = _IOC_SIZE(cmd); - rc = 0; - DEBUGP(4, dev, "iocdir=%.4x iocr=%.4x iocw=%.4x iocsize=%d cmd=%.4x\n", - _IOC_DIR(cmd), _IOC_READ, _IOC_WRITE, size, cmd); - - if (_IOC_DIR(cmd) & _IOC_READ) { - if (!access_ok(VERIFY_WRITE, argp, size)) - return -EFAULT; - } - if (_IOC_DIR(cmd) & _IOC_WRITE) { - if (!access_ok(VERIFY_READ, argp, size)) - return -EFAULT; - } - - switch (cmd) { - case CM_IOCGSTATUS: - DEBUGP(4, dev, " ... in CM_IOCGSTATUS\n"); - { - int status; - - /* clear other bits, but leave inserted & powered as - * they are */ - status = dev->flags0 & 3; - if (test_bit(IS_ATR_PRESENT, &dev->flags)) - status |= CM_ATR_PRESENT; - if (test_bit(IS_ATR_VALID, &dev->flags)) - status |= CM_ATR_VALID; - if (test_bit(IS_CMM_ABSENT, &dev->flags)) - status |= CM_NO_READER; - if (test_bit(IS_BAD_CARD, &dev->flags)) - status |= CM_BAD_CARD; - if (copy_to_user(argp, &status, sizeof(int))) - return -EFAULT; - } - return 0; - case CM_IOCGATR: - DEBUGP(4, dev, "... in CM_IOCGATR\n"); - { - struct atreq __user *atreq = argp; - int tmp; - /* allow nonblocking io and being interrupted */ - if (wait_event_interruptible - (dev->atrq, - ((filp->f_flags & O_NONBLOCK) - || (test_bit(IS_ATR_PRESENT, (void *)&dev->flags) - != 0)))) { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - return -ERESTARTSYS; - } - - if (test_bit(IS_ATR_VALID, &dev->flags) == 0) { - tmp = -1; - if (copy_to_user(&(atreq->atr_len), &tmp, - sizeof(int))) - return -EFAULT; - } else { - if (copy_to_user(atreq->atr, dev->atr, - dev->atr_len)) - return -EFAULT; - - tmp = dev->atr_len; - if (copy_to_user(&(atreq->atr_len), &tmp, sizeof(int))) - return -EFAULT; - } - return 0; - } - case CM_IOCARDOFF: - -#ifdef PCMCIA_DEBUG - DEBUGP(4, dev, "... in CM_IOCARDOFF\n"); - if (dev->flags0 & 0x01) { - DEBUGP(4, dev, " Card inserted\n"); - } else { - DEBUGP(2, dev, " No card inserted\n"); - } - if (dev->flags0 & 0x02) { - DEBUGP(4, dev, " Card powered\n"); - } else { - DEBUGP(2, dev, " Card not powered\n"); - } -#endif - - /* is a card inserted and powered? */ - if ((dev->flags0 & 0x01) && (dev->flags0 & 0x02)) { - - /* get IO lock */ - if (wait_event_interruptible - (dev->ioq, - ((filp->f_flags & O_NONBLOCK) - || (test_and_set_bit(LOCK_IO, (void *)&dev->flags) - == 0)))) { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - return -ERESTARTSYS; - } - /* Set Flags0 = 0x42 */ - DEBUGP(4, dev, "Set Flags0=0x42 \n"); - xoutb(0x42, REG_FLAGS0(iobase)); - clear_bit(IS_ATR_PRESENT, &dev->flags); - clear_bit(IS_ATR_VALID, &dev->flags); - dev->mstate = M_CARDOFF; - clear_bit(LOCK_IO, &dev->flags); - if (wait_event_interruptible - (dev->atrq, - ((filp->f_flags & O_NONBLOCK) - || (test_bit(IS_ATR_VALID, (void *)&dev->flags) != - 0)))) { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - return -ERESTARTSYS; - } - } - /* release lock */ - clear_bit(LOCK_IO, &dev->flags); - wake_up_interruptible(&dev->ioq); - - return 0; - case CM_IOCSPTS: - { - struct ptsreq krnptsreq; - - if (copy_from_user(&krnptsreq, argp, - sizeof(struct ptsreq))) - return -EFAULT; - - rc = 0; - DEBUGP(4, dev, "... in CM_IOCSPTS\n"); - /* wait for ATR to get valid */ - if (wait_event_interruptible - (dev->atrq, - ((filp->f_flags & O_NONBLOCK) - || (test_bit(IS_ATR_PRESENT, (void *)&dev->flags) - != 0)))) { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - return -ERESTARTSYS; - } - /* get IO lock */ - if (wait_event_interruptible - (dev->ioq, - ((filp->f_flags & O_NONBLOCK) - || (test_and_set_bit(LOCK_IO, (void *)&dev->flags) - == 0)))) { - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - return -ERESTARTSYS; - } - - if ((rc = set_protocol(dev, &krnptsreq)) != 0) { - /* auto power_on again */ - dev->mstate = M_FETCH_ATR; - clear_bit(IS_ATR_VALID, &dev->flags); - } - /* release lock */ - clear_bit(LOCK_IO, &dev->flags); - wake_up_interruptible(&dev->ioq); - - } - return rc; -#ifdef PCMCIA_DEBUG - case CM_IOSDBGLVL: /* set debug log level */ - { - int old_pc_debug = 0; - - old_pc_debug = pc_debug; - if (copy_from_user(&pc_debug, argp, sizeof(int))) - return -EFAULT; - - if (old_pc_debug != pc_debug) - DEBUGP(0, dev, "Changed debug log level " - "to %i\n", pc_debug); - } - return rc; -#endif - default: - DEBUGP(4, dev, "... in default (unknown IOCTL code)\n"); - return -EINVAL; - } -} - -static int cmm_open(struct inode *inode, struct file *filp) -{ - struct cm4000_dev *dev; - dev_link_t *link; - int rc, minor = iminor(inode); - - if (minor >= CM4000_MAX_DEV) - return -ENODEV; - - link = dev_table[minor]; - if (link == NULL || !(DEV_OK(link))) - return -ENODEV; - - if (link->open) - return -EBUSY; - - dev = link->priv; - filp->private_data = dev; - - DEBUGP(2, dev, "-> cmm_open(device=%d.%d process=%s,%d)\n", - imajor(inode), minor, current->comm, current->pid); - - /* init device variables, they may be "polluted" after close - * or, the device may never have been closed (i.e. open failed) - */ - - ZERO_DEV(dev); - - /* opening will always block since the - * monitor will be started by open, which - * means we have to wait for ATR becoming - * vaild = block until valid (or card - * inserted) - */ - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; - - dev->mdelay = T_50MSEC; - - /* start monitoring the cardstatus */ - start_monitor(dev); - - link->open = 1; /* only one open per device */ - rc = 0; - - DEBUGP(2, dev, "<- cmm_open\n"); - return nonseekable_open(inode, filp); -} - -static int cmm_close(struct inode *inode, struct file *filp) -{ - struct cm4000_dev *dev; - dev_link_t *link; - int minor = iminor(inode); - - if (minor >= CM4000_MAX_DEV) - return -ENODEV; - - link = dev_table[minor]; - if (link == NULL) - return -ENODEV; - - dev = link->priv; - - DEBUGP(2, dev, "-> cmm_close(maj/min=%d.%d)\n", - imajor(inode), minor); - - stop_monitor(dev); - - ZERO_DEV(dev); - - link->open = 0; /* only one open per device */ - wake_up(&dev->devq); /* socket removed? */ - - DEBUGP(2, dev, "cmm_close\n"); - return 0; -} - -static void cmm_cm4000_release(dev_link_t * link) -{ - struct cm4000_dev *dev = link->priv; - - /* dont terminate the monitor, rather rely on - * close doing that for us. - */ - DEBUGP(3, dev, "-> cmm_cm4000_release\n"); - while (link->open) { - printk(KERN_INFO MODULE_NAME ": delaying release until " - "process has terminated\n"); - /* note: don't interrupt us: - * close the applications which own - * the devices _first_ ! - */ - wait_event(dev->devq, (link->open == 0)); - } - /* dev->devq=NULL; this cannot be zeroed earlier */ - DEBUGP(3, dev, "<- cmm_cm4000_release\n"); - return; -} - -/*==== Interface to PCMCIA Layer =======================================*/ - -static void cm4000_config(dev_link_t * link, int devno) -{ - client_handle_t handle = link->handle; - struct cm4000_dev *dev; - tuple_t tuple; - cisparse_t parse; - config_info_t conf; - u_char buf[64]; - int fail_fn, fail_rc; - int rc; - - /* read the config-tuples */ - tuple.DesiredTuple = CISTPL_CONFIG; - tuple.Attributes = 0; - tuple.TupleData = buf; - tuple.TupleDataMax = sizeof(buf); - tuple.TupleOffset = 0; - - if ((fail_rc = pcmcia_get_first_tuple(handle, &tuple)) != CS_SUCCESS) { - fail_fn = GetFirstTuple; - goto cs_failed; - } - if ((fail_rc = pcmcia_get_tuple_data(handle, &tuple)) != CS_SUCCESS) { - fail_fn = GetTupleData; - goto cs_failed; - } - if ((fail_rc = - pcmcia_parse_tuple(handle, &tuple, &parse)) != CS_SUCCESS) { - fail_fn = ParseTuple; - goto cs_failed; - } - if ((fail_rc = - pcmcia_get_configuration_info(handle, &conf)) != CS_SUCCESS) { - fail_fn = GetConfigurationInfo; - goto cs_failed; - } - - link->state |= DEV_CONFIG; - link->conf.ConfigBase = parse.config.base; - link->conf.Present = parse.config.rmask[0]; - link->conf.Vcc = conf.Vcc; - - link->io.BasePort2 = 0; - link->io.NumPorts2 = 0; - link->io.Attributes2 = 0; - tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; - for (rc = pcmcia_get_first_tuple(handle, &tuple); - rc == CS_SUCCESS; rc = pcmcia_get_next_tuple(handle, &tuple)) { - - rc = pcmcia_get_tuple_data(handle, &tuple); - if (rc != CS_SUCCESS) - continue; - rc = pcmcia_parse_tuple(handle, &tuple, &parse); - if (rc != CS_SUCCESS) - continue; - - link->conf.ConfigIndex = parse.cftable_entry.index; - - if (!parse.cftable_entry.io.nwin) - continue; - - /* Get the IOaddr */ - link->io.BasePort1 = parse.cftable_entry.io.win[0].base; - link->io.NumPorts1 = parse.cftable_entry.io.win[0].len; - link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; - if (!(parse.cftable_entry.io.flags & CISTPL_IO_8BIT)) - link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; - if (!(parse.cftable_entry.io.flags & CISTPL_IO_16BIT)) - link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; - link->io.IOAddrLines = parse.cftable_entry.io.flags - & CISTPL_IO_LINES_MASK; - - rc = pcmcia_request_io(handle, &link->io); - if (rc == CS_SUCCESS) - break; /* we are done */ - } - if (rc != CS_SUCCESS) - goto cs_release; - - link->conf.IntType = 00000002; - - if ((fail_rc = - pcmcia_request_configuration(handle, &link->conf)) != CS_SUCCESS) { - fail_fn = RequestConfiguration; - goto cs_release; - } - - dev = link->priv; - sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno); - dev->node.major = major; - dev->node.minor = devno; - dev->node.next = NULL; - link->dev = &dev->node; - link->state &= ~DEV_CONFIG_PENDING; - - return; - -cs_failed: - cs_error(handle, fail_fn, fail_rc); -cs_release: - cm4000_release(link); - - link->state &= ~DEV_CONFIG_PENDING; -} - -static int cm4000_event(event_t event, int priority, - event_callback_args_t *args) -{ - dev_link_t *link; - struct cm4000_dev *dev; - int devno; - - link = args->client_data; - dev = link->priv; - - DEBUGP(3, dev, "-> cm4000_event\n"); - for (devno = 0; devno < CM4000_MAX_DEV; devno++) - if (dev_table[devno] == link) - break; - - if (devno == CM4000_MAX_DEV) - return CS_BAD_ADAPTER; - - switch (event) { - case CS_EVENT_CARD_INSERTION: - DEBUGP(5, dev, "CS_EVENT_CARD_INSERTION\n"); - link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; - cm4000_config(link, devno); - break; - case CS_EVENT_CARD_REMOVAL: - DEBUGP(5, dev, "CS_EVENT_CARD_REMOVAL\n"); - link->state &= ~DEV_PRESENT; - stop_monitor(dev); - break; - case CS_EVENT_PM_SUSPEND: - DEBUGP(5, dev, "CS_EVENT_PM_SUSPEND " - "(fall-through to CS_EVENT_RESET_PHYSICAL)\n"); - link->state |= DEV_SUSPEND; - /* fall-through */ - case CS_EVENT_RESET_PHYSICAL: - DEBUGP(5, dev, "CS_EVENT_RESET_PHYSICAL\n"); - if (link->state & DEV_CONFIG) { - DEBUGP(5, dev, "ReleaseConfiguration\n"); - pcmcia_release_configuration(link->handle); - } - stop_monitor(dev); - break; - case CS_EVENT_PM_RESUME: - DEBUGP(5, dev, "CS_EVENT_PM_RESUME " - "(fall-through to CS_EVENT_CARD_RESET)\n"); - link->state &= ~DEV_SUSPEND; - /* fall-through */ - case CS_EVENT_CARD_RESET: - DEBUGP(5, dev, "CS_EVENT_CARD_RESET\n"); - if ((link->state & DEV_CONFIG)) { - DEBUGP(5, dev, "RequestConfiguration\n"); - pcmcia_request_configuration(link->handle, &link->conf); - } - if (link->open) - start_monitor(dev); - break; - default: - DEBUGP(5, dev, "unknown event %.2x\n", event); - break; - } - DEBUGP(3, dev, "<- cm4000_event\n"); - return CS_SUCCESS; -} - -static void cm4000_release(dev_link_t *link) -{ - cmm_cm4000_release(link->priv); /* delay release until device closed */ - pcmcia_release_configuration(link->handle); - pcmcia_release_io(link->handle, &link->io); -} - -static dev_link_t *cm4000_attach(void) -{ - struct cm4000_dev *dev; - dev_link_t *link; - client_reg_t client_reg; - int i; - - for (i = 0; i < CM4000_MAX_DEV; i++) - if (dev_table[i] == NULL) - break; - - if (i == CM4000_MAX_DEV) { - printk(KERN_NOTICE MODULE_NAME ": all devices in use\n"); - return NULL; - } - - /* create a new cm4000_cs device */ - dev = kzalloc(sizeof(struct cm4000_dev), GFP_KERNEL); - if (dev == NULL) - return NULL; - - link = &dev->link; - link->priv = dev; - link->conf.IntType = INT_MEMORY_AND_IO; - dev_table[i] = link; - - /* register with card services */ - client_reg.dev_info = &dev_info; - client_reg.EventMask = - CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | - CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | - CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; - client_reg.Version = 0x0210; - client_reg.event_callback_args.client_data = link; - - i = pcmcia_register_client(&link->handle, &client_reg); - if (i) { - cs_error(link->handle, RegisterClient, i); - cm4000_detach(link); - return NULL; - } - - init_waitqueue_head(&dev->devq); - init_waitqueue_head(&dev->ioq); - init_waitqueue_head(&dev->atrq); - init_waitqueue_head(&dev->readq); - - return link; -} - -static void cm4000_detach_by_devno(int devno, dev_link_t * link) -{ - struct cm4000_dev *dev = link->priv; - - DEBUGP(3, dev, "-> detach_by_devno(devno=%d)\n", devno); - - if (link->state & DEV_CONFIG) { - DEBUGP(5, dev, "device still configured (try to release it)\n"); - cm4000_release(link); - } - - if (link->handle) { - pcmcia_deregister_client(link->handle); - } - - dev_table[devno] = NULL; - kfree(dev); - return; -} - -static void cm4000_detach(dev_link_t * link) -{ - int i; - - /* find device */ - for (i = 0; i < CM4000_MAX_DEV; i++) - if (dev_table[i] == link) - break; - - if (i == CM4000_MAX_DEV) - return; - - cm4000_detach_by_devno(i, link); - return; -} - -static struct file_operations cm4000_fops = { - .owner = THIS_MODULE, - .read = cmm_read, - .write = cmm_write, - .ioctl = cmm_ioctl, - .open = cmm_open, - .release= cmm_close, -}; - -static struct pcmcia_device_id cm4000_ids[] = { - PCMCIA_DEVICE_MANF_CARD(0x0223, 0x0002), - PCMCIA_DEVICE_PROD_ID12("CardMan", "4000", 0x2FB368CA, 0xA2BD8C39), - PCMCIA_DEVICE_NULL, -}; -MODULE_DEVICE_TABLE(pcmcia, cm4000_ids); - -static struct pcmcia_driver cm4000_driver = { - .owner = THIS_MODULE, - .drv = { - .name = "cm4000_cs", - }, - .attach = cm4000_attach, - .detach = cm4000_detach, - .event = cm4000_event, - .id_table = cm4000_ids, -}; - -static int __init cmm_init(void) -{ - printk(KERN_INFO "%s\n", version); - pcmcia_register_driver(&cm4000_driver); - major = register_chrdev(0, DEVICE_NAME, &cm4000_fops); - if (major < 0) { - printk(KERN_WARNING MODULE_NAME - ": could not get major number\n"); - return -1; - } - - return 0; -} - -static void __exit cmm_exit(void) -{ - int i; - - printk(KERN_INFO MODULE_NAME ": unloading\n"); - pcmcia_unregister_driver(&cm4000_driver); - for (i = 0; i < CM4000_MAX_DEV; i++) - if (dev_table[i]) - cm4000_detach_by_devno(i, dev_table[i]); - unregister_chrdev(major, DEVICE_NAME); -}; - -module_init(cmm_init); -module_exit(cmm_exit); -MODULE_LICENSE("Dual BSD/GPL"); diff --git a/trunk/drivers/char/pcmcia/cm4040_cs.c b/trunk/drivers/char/pcmcia/cm4040_cs.c deleted file mode 100644 index 4c698d908ffa..000000000000 --- a/trunk/drivers/char/pcmcia/cm4040_cs.c +++ /dev/null @@ -1,841 +0,0 @@ -/* - * A driver for the Omnikey PCMCIA smartcard reader CardMan 4040 - * - * (c) 2000-2004 Omnikey AG (http://www.omnikey.com/) - * - * (C) 2005 Harald Welte - * - add support for poll() - * - driver cleanup - * - add waitqueues - * - adhere to linux kernel coding style and policies - * - support 2.6.13 "new style" pcmcia interface - * - * The device basically is a USB CCID compliant device that has been - * attached to an I/O-Mapped FIFO. - * - * All rights reserved, Dual BSD/GPL Licensed. - */ - -/* #define PCMCIA_DEBUG 6 */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "cm4040_cs.h" - - -#ifdef PCMCIA_DEBUG -#define reader_to_dev(x) (&handle_to_dev(x->link.handle)) -static int pc_debug = PCMCIA_DEBUG; -module_param(pc_debug, int, 0600); -#define DEBUGP(n, rdr, x, args...) do { \ - if (pc_debug >= (n)) \ - dev_printk(KERN_DEBUG, reader_to_dev(rdr), "%s:" x, \ - __FUNCTION__ , ##args); \ - } while (0) -#else -#define DEBUGP(n, rdr, x, args...) -#endif - -static char *version = -"OMNIKEY CardMan 4040 v1.1.0gm4 - All bugs added by Harald Welte"; - -#define CCID_DRIVER_BULK_DEFAULT_TIMEOUT (150*HZ) -#define CCID_DRIVER_ASYNC_POWERUP_TIMEOUT (35*HZ) -#define CCID_DRIVER_MINIMUM_TIMEOUT (3*HZ) -#define READ_WRITE_BUFFER_SIZE 512 -#define POLL_LOOP_COUNT 1000 - -/* how often to poll for fifo status change */ -#define POLL_PERIOD msecs_to_jiffies(10) - -static void reader_release(dev_link_t *link); -static void reader_detach(dev_link_t *link); - -static int major; - -#define BS_READABLE 0x01 -#define BS_WRITABLE 0x02 - -struct reader_dev { - dev_link_t link; - dev_node_t node; - wait_queue_head_t devq; - wait_queue_head_t poll_wait; - wait_queue_head_t read_wait; - wait_queue_head_t write_wait; - unsigned long buffer_status; - unsigned long timeout; - unsigned char s_buf[READ_WRITE_BUFFER_SIZE]; - unsigned char r_buf[READ_WRITE_BUFFER_SIZE]; - struct timer_list poll_timer; -}; - -static dev_info_t dev_info = MODULE_NAME; -static dev_link_t *dev_table[CM_MAX_DEV]; - -#ifndef PCMCIA_DEBUG -#define xoutb outb -#define xinb inb -#else -static inline void xoutb(unsigned char val, unsigned short port) -{ - if (pc_debug >= 7) - printk(KERN_DEBUG "outb(val=%.2x,port=%.4x)\n", val, port); - outb(val, port); -} - -static inline unsigned char xinb(unsigned short port) -{ - unsigned char val; - - val = inb(port); - if (pc_debug >= 7) - printk(KERN_DEBUG "%.2x=inb(%.4x)\n", val, port); - return val; -} -#endif - -/* poll the device fifo status register. not to be confused with - * the poll syscall. */ -static void cm4040_do_poll(unsigned long dummy) -{ - struct reader_dev *dev = (struct reader_dev *) dummy; - unsigned int obs = xinb(dev->link.io.BasePort1 - + REG_OFFSET_BUFFER_STATUS); - - if ((obs & BSR_BULK_IN_FULL)) { - set_bit(BS_READABLE, &dev->buffer_status); - DEBUGP(4, dev, "waking up read_wait\n"); - wake_up_interruptible(&dev->read_wait); - } else - clear_bit(BS_READABLE, &dev->buffer_status); - - if (!(obs & BSR_BULK_OUT_FULL)) { - set_bit(BS_WRITABLE, &dev->buffer_status); - DEBUGP(4, dev, "waking up write_wait\n"); - wake_up_interruptible(&dev->write_wait); - } else - clear_bit(BS_WRITABLE, &dev->buffer_status); - - if (dev->buffer_status) - wake_up_interruptible(&dev->poll_wait); - - mod_timer(&dev->poll_timer, jiffies + POLL_PERIOD); -} - -static void cm4040_stop_poll(struct reader_dev *dev) -{ - del_timer_sync(&dev->poll_timer); -} - -static int wait_for_bulk_out_ready(struct reader_dev *dev) -{ - int i, rc; - int iobase = dev->link.io.BasePort1; - - for (i = 0; i < POLL_LOOP_COUNT; i++) { - if ((xinb(iobase + REG_OFFSET_BUFFER_STATUS) - & BSR_BULK_OUT_FULL) == 0) { - DEBUGP(4, dev, "BulkOut empty (i=%d)\n", i); - return 1; - } - } - - DEBUGP(4, dev, "wait_event_interruptible_timeout(timeout=%ld\n", - dev->timeout); - rc = wait_event_interruptible_timeout(dev->write_wait, - test_and_clear_bit(BS_WRITABLE, - &dev->buffer_status), - dev->timeout); - - if (rc > 0) - DEBUGP(4, dev, "woke up: BulkOut empty\n"); - else if (rc == 0) - DEBUGP(4, dev, "woke up: BulkOut full, returning 0 :(\n"); - else if (rc < 0) - DEBUGP(4, dev, "woke up: signal arrived\n"); - - return rc; -} - -/* Write to Sync Control Register */ -static int write_sync_reg(unsigned char val, struct reader_dev *dev) -{ - int iobase = dev->link.io.BasePort1; - int rc; - - rc = wait_for_bulk_out_ready(dev); - if (rc <= 0) - return rc; - - xoutb(val, iobase + REG_OFFSET_SYNC_CONTROL); - rc = wait_for_bulk_out_ready(dev); - if (rc <= 0) - return rc; - - return 1; -} - -static int wait_for_bulk_in_ready(struct reader_dev *dev) -{ - int i, rc; - int iobase = dev->link.io.BasePort1; - - for (i = 0; i < POLL_LOOP_COUNT; i++) { - if ((xinb(iobase + REG_OFFSET_BUFFER_STATUS) - & BSR_BULK_IN_FULL) == BSR_BULK_IN_FULL) { - DEBUGP(3, dev, "BulkIn full (i=%d)\n", i); - return 1; - } - } - - DEBUGP(4, dev, "wait_event_interruptible_timeout(timeout=%ld\n", - dev->timeout); - rc = wait_event_interruptible_timeout(dev->read_wait, - test_and_clear_bit(BS_READABLE, - &dev->buffer_status), - dev->timeout); - if (rc > 0) - DEBUGP(4, dev, "woke up: BulkIn full\n"); - else if (rc == 0) - DEBUGP(4, dev, "woke up: BulkIn not full, returning 0 :(\n"); - else if (rc < 0) - DEBUGP(4, dev, "woke up: signal arrived\n"); - - return rc; -} - -static ssize_t cm4040_read(struct file *filp, char __user *buf, - size_t count, loff_t *ppos) -{ - struct reader_dev *dev = filp->private_data; - int iobase = dev->link.io.BasePort1; - size_t bytes_to_read; - unsigned long i; - size_t min_bytes_to_read; - int rc; - unsigned char uc; - - DEBUGP(2, dev, "-> cm4040_read(%s,%d)\n", current->comm, current->pid); - - if (count == 0) - return 0; - - if (count < 10) - return -EFAULT; - - if (filp->f_flags & O_NONBLOCK) { - DEBUGP(4, dev, "filep->f_flags O_NONBLOCK set\n"); - DEBUGP(2, dev, "<- cm4040_read (failure)\n"); - return -EAGAIN; - } - - if ((dev->link.state & DEV_PRESENT)==0) - return -ENODEV; - - for (i = 0; i < 5; i++) { - rc = wait_for_bulk_in_ready(dev); - if (rc <= 0) { - DEBUGP(5, dev, "wait_for_bulk_in_ready rc=%.2x\n", rc); - DEBUGP(2, dev, "<- cm4040_read (failed)\n"); - if (rc == -ERESTARTSYS) - return rc; - return -EIO; - } - dev->r_buf[i] = xinb(iobase + REG_OFFSET_BULK_IN); -#ifdef PCMCIA_DEBUG - if (pc_debug >= 6) - printk(KERN_DEBUG "%lu:%2x ", i, dev->r_buf[i]); - } - printk("\n"); -#else - } -#endif - - bytes_to_read = 5 + le32_to_cpu(*(__le32 *)&dev->r_buf[1]); - - DEBUGP(6, dev, "BytesToRead=%lu\n", bytes_to_read); - - min_bytes_to_read = min(count, bytes_to_read + 5); - - DEBUGP(6, dev, "Min=%lu\n", min_bytes_to_read); - - for (i = 0; i < (min_bytes_to_read-5); i++) { - rc = wait_for_bulk_in_ready(dev); - if (rc <= 0) { - DEBUGP(5, dev, "wait_for_bulk_in_ready rc=%.2x\n", rc); - DEBUGP(2, dev, "<- cm4040_read (failed)\n"); - if (rc == -ERESTARTSYS) - return rc; - return -EIO; - } - dev->r_buf[i+5] = xinb(iobase + REG_OFFSET_BULK_IN); -#ifdef PCMCIA_DEBUG - if (pc_debug >= 6) - printk(KERN_DEBUG "%lu:%2x ", i, dev->r_buf[i]); - } - printk("\n"); -#else - } -#endif - - *ppos = min_bytes_to_read; - if (copy_to_user(buf, dev->r_buf, min_bytes_to_read)) - return -EFAULT; - - rc = wait_for_bulk_in_ready(dev); - if (rc <= 0) { - DEBUGP(5, dev, "wait_for_bulk_in_ready rc=%.2x\n", rc); - DEBUGP(2, dev, "<- cm4040_read (failed)\n"); - if (rc == -ERESTARTSYS) - return rc; - return -EIO; - } - - rc = write_sync_reg(SCR_READER_TO_HOST_DONE, dev); - if (rc <= 0) { - DEBUGP(5, dev, "write_sync_reg c=%.2x\n", rc); - DEBUGP(2, dev, "<- cm4040_read (failed)\n"); - if (rc == -ERESTARTSYS) - return rc; - else - return -EIO; - } - - uc = xinb(iobase + REG_OFFSET_BULK_IN); - - DEBUGP(2, dev, "<- cm4040_read (successfully)\n"); - return min_bytes_to_read; -} - -static ssize_t cm4040_write(struct file *filp, const char __user *buf, - size_t count, loff_t *ppos) -{ - struct reader_dev *dev = filp->private_data; - int iobase = dev->link.io.BasePort1; - ssize_t rc; - int i; - unsigned int bytes_to_write; - - DEBUGP(2, dev, "-> cm4040_write(%s,%d)\n", current->comm, current->pid); - - if (count == 0) { - DEBUGP(2, dev, "<- cm4040_write empty read (successfully)\n"); - return 0; - } - - if (count < 5) { - DEBUGP(2, dev, "<- cm4040_write buffersize=%Zd < 5\n", count); - return -EIO; - } - - if (filp->f_flags & O_NONBLOCK) { - DEBUGP(4, dev, "filep->f_flags O_NONBLOCK set\n"); - DEBUGP(4, dev, "<- cm4040_write (failure)\n"); - return -EAGAIN; - } - - if ((dev->link.state & DEV_PRESENT) == 0) - return -ENODEV; - - bytes_to_write = count; - if (copy_from_user(dev->s_buf, buf, bytes_to_write)) - return -EFAULT; - - switch (dev->s_buf[0]) { - case CMD_PC_TO_RDR_XFRBLOCK: - case CMD_PC_TO_RDR_SECURE: - case CMD_PC_TO_RDR_TEST_SECURE: - case CMD_PC_TO_RDR_OK_SECURE: - dev->timeout = CCID_DRIVER_BULK_DEFAULT_TIMEOUT; - break; - - case CMD_PC_TO_RDR_ICCPOWERON: - dev->timeout = CCID_DRIVER_ASYNC_POWERUP_TIMEOUT; - break; - - case CMD_PC_TO_RDR_GETSLOTSTATUS: - case CMD_PC_TO_RDR_ICCPOWEROFF: - case CMD_PC_TO_RDR_GETPARAMETERS: - case CMD_PC_TO_RDR_RESETPARAMETERS: - case CMD_PC_TO_RDR_SETPARAMETERS: - case CMD_PC_TO_RDR_ESCAPE: - case CMD_PC_TO_RDR_ICCCLOCK: - default: - dev->timeout = CCID_DRIVER_MINIMUM_TIMEOUT; - break; - } - - rc = write_sync_reg(SCR_HOST_TO_READER_START, dev); - if (rc <= 0) { - DEBUGP(5, dev, "write_sync_reg c=%.2Zx\n", rc); - DEBUGP(2, dev, "<- cm4040_write (failed)\n"); - if (rc == -ERESTARTSYS) - return rc; - else - return -EIO; - } - - DEBUGP(4, dev, "start \n"); - - for (i = 0; i < bytes_to_write; i++) { - rc = wait_for_bulk_out_ready(dev); - if (rc <= 0) { - DEBUGP(5, dev, "wait_for_bulk_out_ready rc=%.2Zx\n", - rc); - DEBUGP(2, dev, "<- cm4040_write (failed)\n"); - if (rc == -ERESTARTSYS) - return rc; - else - return -EIO; - } - - xoutb(dev->s_buf[i],iobase + REG_OFFSET_BULK_OUT); - } - DEBUGP(4, dev, "end\n"); - - rc = write_sync_reg(SCR_HOST_TO_READER_DONE, dev); - - if (rc <= 0) { - DEBUGP(5, dev, "write_sync_reg c=%.2Zx\n", rc); - DEBUGP(2, dev, "<- cm4040_write (failed)\n"); - if (rc == -ERESTARTSYS) - return rc; - else - return -EIO; - } - - DEBUGP(2, dev, "<- cm4040_write (successfully)\n"); - return count; -} - -static unsigned int cm4040_poll(struct file *filp, poll_table *wait) -{ - struct reader_dev *dev = filp->private_data; - unsigned int mask = 0; - - poll_wait(filp, &dev->poll_wait, wait); - - if (test_and_clear_bit(BS_READABLE, &dev->buffer_status)) - mask |= POLLIN | POLLRDNORM; - if (test_and_clear_bit(BS_WRITABLE, &dev->buffer_status)) - mask |= POLLOUT | POLLWRNORM; - - DEBUGP(2, dev, "<- cm4040_poll(%u)\n", mask); - - return mask; -} - -static int cm4040_open(struct inode *inode, struct file *filp) -{ - struct reader_dev *dev; - dev_link_t *link; - int minor = iminor(inode); - - if (minor >= CM_MAX_DEV) - return -ENODEV; - - link = dev_table[minor]; - if (link == NULL || !(DEV_OK(link))) - return -ENODEV; - - if (link->open) - return -EBUSY; - - dev = link->priv; - filp->private_data = dev; - - if (filp->f_flags & O_NONBLOCK) { - DEBUGP(4, dev, "filep->f_flags O_NONBLOCK set\n"); - return -EAGAIN; - } - - link->open = 1; - - dev->poll_timer.data = (unsigned long) dev; - mod_timer(&dev->poll_timer, jiffies + POLL_PERIOD); - - DEBUGP(2, dev, "<- cm4040_open (successfully)\n"); - return nonseekable_open(inode, filp); -} - -static int cm4040_close(struct inode *inode, struct file *filp) -{ - struct reader_dev *dev = filp->private_data; - dev_link_t *link; - int minor = iminor(inode); - - DEBUGP(2, dev, "-> cm4040_close(maj/min=%d.%d)\n", imajor(inode), - iminor(inode)); - - if (minor >= CM_MAX_DEV) - return -ENODEV; - - link = dev_table[minor]; - if (link == NULL) - return -ENODEV; - - cm4040_stop_poll(dev); - - link->open = 0; - wake_up(&dev->devq); - - DEBUGP(2, dev, "<- cm4040_close\n"); - return 0; -} - -static void cm4040_reader_release(dev_link_t *link) -{ - struct reader_dev *dev = link->priv; - - DEBUGP(3, dev, "-> cm4040_reader_release\n"); - while (link->open) { - DEBUGP(3, dev, KERN_INFO MODULE_NAME ": delaying release " - "until process has terminated\n"); - wait_event(dev->devq, (link->open == 0)); - } - DEBUGP(3, dev, "<- cm4040_reader_release\n"); - return; -} - -static void reader_config(dev_link_t *link, int devno) -{ - client_handle_t handle; - struct reader_dev *dev; - tuple_t tuple; - cisparse_t parse; - config_info_t conf; - u_char buf[64]; - int fail_fn, fail_rc; - int rc; - - handle = link->handle; - - tuple.DesiredTuple = CISTPL_CONFIG; - tuple.Attributes = 0; - tuple.TupleData = buf; - tuple.TupleDataMax = sizeof(buf); - tuple.TupleOffset = 0; - - if ((fail_rc = pcmcia_get_first_tuple(handle, &tuple)) != CS_SUCCESS) { - fail_fn = GetFirstTuple; - goto cs_failed; - } - if ((fail_rc = pcmcia_get_tuple_data(handle, &tuple)) != CS_SUCCESS) { - fail_fn = GetTupleData; - goto cs_failed; - } - if ((fail_rc = pcmcia_parse_tuple(handle, &tuple, &parse)) - != CS_SUCCESS) { - fail_fn = ParseTuple; - goto cs_failed; - } - if ((fail_rc = pcmcia_get_configuration_info(handle, &conf)) - != CS_SUCCESS) { - fail_fn = GetConfigurationInfo; - goto cs_failed; - } - - link->state |= DEV_CONFIG; - link->conf.ConfigBase = parse.config.base; - link->conf.Present = parse.config.rmask[0]; - link->conf.Vcc = conf.Vcc; - - link->io.BasePort2 = 0; - link->io.NumPorts2 = 0; - link->io.Attributes2 = 0; - tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; - for (rc = pcmcia_get_first_tuple(handle, &tuple); - rc == CS_SUCCESS; - rc = pcmcia_get_next_tuple(handle, &tuple)) { - rc = pcmcia_get_tuple_data(handle, &tuple); - if (rc != CS_SUCCESS) - continue; - rc = pcmcia_parse_tuple(handle, &tuple, &parse); - if (rc != CS_SUCCESS) - continue; - - link->conf.ConfigIndex = parse.cftable_entry.index; - - if (!parse.cftable_entry.io.nwin) - continue; - - link->io.BasePort1 = parse.cftable_entry.io.win[0].base; - link->io.NumPorts1 = parse.cftable_entry.io.win[0].len; - link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; - if (!(parse.cftable_entry.io.flags & CISTPL_IO_8BIT)) - link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; - if (!(parse.cftable_entry.io.flags & CISTPL_IO_16BIT)) - link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; - link->io.IOAddrLines = parse.cftable_entry.io.flags - & CISTPL_IO_LINES_MASK; - rc = pcmcia_request_io(handle, &link->io); - - dev_printk(KERN_INFO, &handle_to_dev(handle), "foo"); - if (rc == CS_SUCCESS) - break; - else - dev_printk(KERN_INFO, &handle_to_dev(handle), - "pcmcia_request_io failed 0x%x\n", rc); - } - if (rc != CS_SUCCESS) - goto cs_release; - - link->conf.IntType = 00000002; - - if ((fail_rc = pcmcia_request_configuration(handle,&link->conf)) - !=CS_SUCCESS) { - fail_fn = RequestConfiguration; - dev_printk(KERN_INFO, &handle_to_dev(handle), - "pcmcia_request_configuration failed 0x%x\n", - fail_rc); - goto cs_release; - } - - dev = link->priv; - sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno); - dev->node.major = major; - dev->node.minor = devno; - dev->node.next = NULL; - link->dev = &dev->node; - link->state &= ~DEV_CONFIG_PENDING; - - DEBUGP(2, dev, "device " DEVICE_NAME "%d at 0x%.4x-0x%.4x\n", devno, - link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1); - DEBUGP(2, dev, "<- reader_config (succ)\n"); - - return; - -cs_failed: - cs_error(handle, fail_fn, fail_rc); -cs_release: - reader_release(link); - link->state &= ~DEV_CONFIG_PENDING; -} - -static int reader_event(event_t event, int priority, - event_callback_args_t *args) -{ - dev_link_t *link; - struct reader_dev *dev; - int devno; - - link = args->client_data; - dev = link->priv; - DEBUGP(3, dev, "-> reader_event\n"); - for (devno = 0; devno < CM_MAX_DEV; devno++) { - if (dev_table[devno] == link) - break; - } - if (devno == CM_MAX_DEV) - return CS_BAD_ADAPTER; - - switch (event) { - case CS_EVENT_CARD_INSERTION: - DEBUGP(5, dev, "CS_EVENT_CARD_INSERTION\n"); - link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; - reader_config(link, devno); - break; - case CS_EVENT_CARD_REMOVAL: - DEBUGP(5, dev, "CS_EVENT_CARD_REMOVAL\n"); - link->state &= ~DEV_PRESENT; - break; - case CS_EVENT_PM_SUSPEND: - DEBUGP(5, dev, "CS_EVENT_PM_SUSPEND " - "(fall-through to CS_EVENT_RESET_PHYSICAL)\n"); - link->state |= DEV_SUSPEND; - - case CS_EVENT_RESET_PHYSICAL: - DEBUGP(5, dev, "CS_EVENT_RESET_PHYSICAL\n"); - if (link->state & DEV_CONFIG) { - DEBUGP(5, dev, "ReleaseConfiguration\n"); - pcmcia_release_configuration(link->handle); - } - break; - case CS_EVENT_PM_RESUME: - DEBUGP(5, dev, "CS_EVENT_PM_RESUME " - "(fall-through to CS_EVENT_CARD_RESET)\n"); - link->state &= ~DEV_SUSPEND; - - case CS_EVENT_CARD_RESET: - DEBUGP(5, dev, "CS_EVENT_CARD_RESET\n"); - if ((link->state & DEV_CONFIG)) { - DEBUGP(5, dev, "RequestConfiguration\n"); - pcmcia_request_configuration(link->handle, - &link->conf); - } - break; - default: - DEBUGP(5, dev, "reader_event: unknown event %.2x\n", - event); - break; - } - DEBUGP(3, dev, "<- reader_event\n"); - return CS_SUCCESS; -} - -static void reader_release(dev_link_t *link) -{ - cm4040_reader_release(link->priv); - pcmcia_release_configuration(link->handle); - pcmcia_release_io(link->handle, &link->io); -} - -static dev_link_t *reader_attach(void) -{ - struct reader_dev *dev; - dev_link_t *link; - client_reg_t client_reg; - int i; - - for (i = 0; i < CM_MAX_DEV; i++) { - if (dev_table[i] == NULL) - break; - } - - if (i == CM_MAX_DEV) - return NULL; - - dev = kzalloc(sizeof(struct reader_dev), GFP_KERNEL); - if (dev == NULL) - return NULL; - - dev->timeout = CCID_DRIVER_MINIMUM_TIMEOUT; - dev->buffer_status = 0; - - link = &dev->link; - link->priv = dev; - - link->conf.IntType = INT_MEMORY_AND_IO; - dev_table[i] = link; - - client_reg.dev_info = &dev_info; - client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; - client_reg.EventMask= - CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | - CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | - CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; - client_reg.Version = 0x0210; - client_reg.event_callback_args.client_data = link; - i = pcmcia_register_client(&link->handle, &client_reg); - if (i) { - cs_error(link->handle, RegisterClient, i); - reader_detach(link); - return NULL; - } - init_waitqueue_head(&dev->devq); - init_waitqueue_head(&dev->poll_wait); - init_waitqueue_head(&dev->read_wait); - init_waitqueue_head(&dev->write_wait); - init_timer(&dev->poll_timer); - dev->poll_timer.function = &cm4040_do_poll; - - return link; -} - -static void reader_detach_by_devno(int devno, dev_link_t *link) -{ - struct reader_dev *dev = link->priv; - - if (link->state & DEV_CONFIG) { - DEBUGP(5, dev, "device still configured (try to release it)\n"); - reader_release(link); - } - - pcmcia_deregister_client(link->handle); - dev_table[devno] = NULL; - DEBUGP(5, dev, "freeing dev=%p\n", dev); - cm4040_stop_poll(dev); - kfree(dev); - return; -} - -static void reader_detach(dev_link_t *link) -{ - int i; - - /* find device */ - for (i = 0; i < CM_MAX_DEV; i++) { - if (dev_table[i] == link) - break; - } - if (i == CM_MAX_DEV) - return; - - reader_detach_by_devno(i, link); - return; -} - -static struct file_operations reader_fops = { - .owner = THIS_MODULE, - .read = cm4040_read, - .write = cm4040_write, - .open = cm4040_open, - .release = cm4040_close, - .poll = cm4040_poll, -}; - -static struct pcmcia_device_id cm4040_ids[] = { - PCMCIA_DEVICE_MANF_CARD(0x0223, 0x0200), - PCMCIA_DEVICE_PROD_ID12("OMNIKEY", "CardMan 4040", - 0xE32CDD8C, 0x8F23318B), - PCMCIA_DEVICE_NULL, -}; -MODULE_DEVICE_TABLE(pcmcia, cm4040_ids); - -static struct pcmcia_driver reader_driver = { - .owner = THIS_MODULE, - .drv = { - .name = "cm4040_cs", - }, - .attach = reader_attach, - .detach = reader_detach, - .event = reader_event, - .id_table = cm4040_ids, -}; - -static int __init cm4040_init(void) -{ - printk(KERN_INFO "%s\n", version); - pcmcia_register_driver(&reader_driver); - major = register_chrdev(0, DEVICE_NAME, &reader_fops); - if (major < 0) { - printk(KERN_WARNING MODULE_NAME - ": could not get major number\n"); - return -1; - } - return 0; -} - -static void __exit cm4040_exit(void) -{ - int i; - - printk(KERN_INFO MODULE_NAME ": unloading\n"); - pcmcia_unregister_driver(&reader_driver); - for (i = 0; i < CM_MAX_DEV; i++) { - if (dev_table[i]) - reader_detach_by_devno(i, dev_table[i]); - } - unregister_chrdev(major, DEVICE_NAME); -} - -module_init(cm4040_init); -module_exit(cm4040_exit); -MODULE_LICENSE("Dual BSD/GPL"); diff --git a/trunk/drivers/char/pcmcia/cm4040_cs.h b/trunk/drivers/char/pcmcia/cm4040_cs.h deleted file mode 100644 index 9a8b805c5095..000000000000 --- a/trunk/drivers/char/pcmcia/cm4040_cs.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _CM4040_H_ -#define _CM4040_H_ - -#define CM_MAX_DEV 4 - -#define DEVICE_NAME "cmx" -#define MODULE_NAME "cm4040_cs" - -#define REG_OFFSET_BULK_OUT 0 -#define REG_OFFSET_BULK_IN 0 -#define REG_OFFSET_BUFFER_STATUS 1 -#define REG_OFFSET_SYNC_CONTROL 2 - -#define BSR_BULK_IN_FULL 0x02 -#define BSR_BULK_OUT_FULL 0x01 - -#define SCR_HOST_TO_READER_START 0x80 -#define SCR_ABORT 0x40 -#define SCR_EN_NOTIFY 0x20 -#define SCR_ACK_NOTIFY 0x10 -#define SCR_READER_TO_HOST_DONE 0x08 -#define SCR_HOST_TO_READER_DONE 0x04 -#define SCR_PULSE_INTERRUPT 0x02 -#define SCR_POWER_DOWN 0x01 - - -#define CMD_PC_TO_RDR_ICCPOWERON 0x62 -#define CMD_PC_TO_RDR_GETSLOTSTATUS 0x65 -#define CMD_PC_TO_RDR_ICCPOWEROFF 0x63 -#define CMD_PC_TO_RDR_SECURE 0x69 -#define CMD_PC_TO_RDR_GETPARAMETERS 0x6C -#define CMD_PC_TO_RDR_RESETPARAMETERS 0x6D -#define CMD_PC_TO_RDR_SETPARAMETERS 0x61 -#define CMD_PC_TO_RDR_XFRBLOCK 0x6F -#define CMD_PC_TO_RDR_ESCAPE 0x6B -#define CMD_PC_TO_RDR_ICCCLOCK 0x6E -#define CMD_PC_TO_RDR_TEST_SECURE 0x74 -#define CMD_PC_TO_RDR_OK_SECURE 0x89 - - -#define CMD_RDR_TO_PC_SLOTSTATUS 0x81 -#define CMD_RDR_TO_PC_DATABLOCK 0x80 -#define CMD_RDR_TO_PC_PARAMETERS 0x82 -#define CMD_RDR_TO_PC_ESCAPE 0x83 -#define CMD_RDR_TO_PC_OK_SECURE 0x89 - -#endif /* _CM4040_H_ */ diff --git a/trunk/drivers/char/random.c b/trunk/drivers/char/random.c index bdfdfd28594d..7999da25fe40 100644 --- a/trunk/drivers/char/random.c +++ b/trunk/drivers/char/random.c @@ -1554,8 +1554,10 @@ __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, EXPORT_SYMBOL(secure_tcp_sequence_number); -/* Generate secure starting point for ephemeral IPV4 transport port search */ -u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport) + + +/* Generate secure starting point for ephemeral TCP port search */ +u32 secure_tcp_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport) { struct keydata *keyptr = get_keyptr(); u32 hash[4]; @@ -1573,7 +1575,7 @@ u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport) } #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -u32 secure_ipv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, __u16 dport) +u32 secure_tcpv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, __u16 dport) { struct keydata *keyptr = get_keyptr(); u32 hash[12]; @@ -1584,7 +1586,7 @@ u32 secure_ipv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, __u16 dpo return twothirdsMD4Transform(daddr, hash); } -EXPORT_SYMBOL(secure_ipv6_port_ephemeral); +EXPORT_SYMBOL(secure_tcpv6_port_ephemeral); #endif #if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE) diff --git a/trunk/drivers/char/synclink.c b/trunk/drivers/char/synclink.c index 62aa0e534a6d..82c6abde68df 100644 --- a/trunk/drivers/char/synclink.c +++ b/trunk/drivers/char/synclink.c @@ -1,7 +1,7 @@ /* * linux/drivers/char/synclink.c * - * $Id: synclink.c,v 4.38 2005/11/07 16:30:34 paulkf Exp $ + * $Id: synclink.c,v 4.37 2005/09/07 13:13:19 paulkf Exp $ * * Device driver for Microgate SyncLink ISA and PCI * high speed multiprotocol serial adapters. @@ -101,7 +101,6 @@ #include #include #include -#include #ifdef CONFIG_HDLC_MODULE #define CONFIG_HDLC 1 @@ -149,7 +148,6 @@ typedef struct _DMABUFFERENTRY u32 link; /* 32-bit flat link to next buffer entry */ char *virt_addr; /* virtual address of data buffer */ u32 phys_entry; /* physical address of this buffer entry */ - dma_addr_t dma_addr; } DMABUFFERENTRY, *DMAPBUFFERENTRY; /* The queue of BH actions to be performed */ @@ -235,8 +233,7 @@ struct mgsl_struct { int ri_chkcount; char *buffer_list; /* virtual address of Rx & Tx buffer lists */ - u32 buffer_list_phys; - dma_addr_t buffer_list_dma_addr; + unsigned long buffer_list_phys; unsigned int rx_buffer_count; /* count of total allocated Rx buffers */ DMABUFFERENTRY *rx_buffer_list; /* list of receive buffer entries */ @@ -899,7 +896,7 @@ module_param_array(txdmabufs, int, NULL, 0); module_param_array(txholdbufs, int, NULL, 0); static char *driver_name = "SyncLink serial driver"; -static char *driver_version = "$Revision: 4.38 $"; +static char *driver_version = "$Revision: 4.37 $"; static int synclink_init_one (struct pci_dev *dev, const struct pci_device_id *ent); @@ -3814,10 +3811,11 @@ static int mgsl_alloc_buffer_list_memory( struct mgsl_struct *info ) /* inspect portions of the buffer while other portions are being */ /* updated by the adapter using Bus Master DMA. */ - info->buffer_list = dma_alloc_coherent(NULL, BUFFERLISTSIZE, &info->buffer_list_dma_addr, GFP_KERNEL); - if (info->buffer_list == NULL) + info->buffer_list = kmalloc(BUFFERLISTSIZE, GFP_KERNEL | GFP_DMA); + if ( info->buffer_list == NULL ) return -ENOMEM; - info->buffer_list_phys = (u32)(info->buffer_list_dma_addr); + + info->buffer_list_phys = isa_virt_to_bus(info->buffer_list); } /* We got the memory for the buffer entry lists. */ @@ -3884,8 +3882,8 @@ static int mgsl_alloc_buffer_list_memory( struct mgsl_struct *info ) */ static void mgsl_free_buffer_list_memory( struct mgsl_struct *info ) { - if (info->buffer_list && info->bus_type != MGSL_BUS_TYPE_PCI) - dma_free_coherent(NULL, BUFFERLISTSIZE, info->buffer_list, info->buffer_list_dma_addr); + if ( info->buffer_list && info->bus_type != MGSL_BUS_TYPE_PCI ) + kfree(info->buffer_list); info->buffer_list = NULL; info->rx_buffer_list = NULL; @@ -3912,7 +3910,7 @@ static void mgsl_free_buffer_list_memory( struct mgsl_struct *info ) static int mgsl_alloc_frame_memory(struct mgsl_struct *info,DMABUFFERENTRY *BufferList,int Buffercount) { int i; - u32 phys_addr; + unsigned long phys_addr; /* Allocate page sized buffers for the receive buffer list */ @@ -3924,10 +3922,11 @@ static int mgsl_alloc_frame_memory(struct mgsl_struct *info,DMABUFFERENTRY *Buff info->last_mem_alloc += DMABUFFERSIZE; } else { /* ISA adapter uses system memory. */ - BufferList[i].virt_addr = dma_alloc_coherent(NULL, DMABUFFERSIZE, &BufferList[i].dma_addr, GFP_KERNEL); - if (BufferList[i].virt_addr == NULL) + BufferList[i].virt_addr = + kmalloc(DMABUFFERSIZE, GFP_KERNEL | GFP_DMA); + if ( BufferList[i].virt_addr == NULL ) return -ENOMEM; - phys_addr = (u32)(BufferList[i].dma_addr); + phys_addr = isa_virt_to_bus(BufferList[i].virt_addr); } BufferList[i].phys_addr = phys_addr; } @@ -3958,7 +3957,7 @@ static void mgsl_free_frame_memory(struct mgsl_struct *info, DMABUFFERENTRY *Buf for ( i = 0 ; i < Buffercount ; i++ ) { if ( BufferList[i].virt_addr ) { if ( info->bus_type != MGSL_BUS_TYPE_PCI ) - dma_free_coherent(NULL, DMABUFFERSIZE, BufferList[i].virt_addr, BufferList[i].dma_addr); + kfree(BufferList[i].virt_addr); BufferList[i].virt_addr = NULL; } } diff --git a/trunk/drivers/char/tpm/Kconfig b/trunk/drivers/char/tpm/Kconfig index a6873bf89ffa..b58adfe3ed19 100644 --- a/trunk/drivers/char/tpm/Kconfig +++ b/trunk/drivers/char/tpm/Kconfig @@ -6,7 +6,7 @@ menu "TPM devices" config TCG_TPM tristate "TPM Hardware Support" - depends on EXPERIMENTAL + depends on EXPERIMENTAL && PCI ---help--- If you have a TPM security chip in your system, which implements the Trusted Computing Group's specification, diff --git a/trunk/drivers/char/tpm/tpm.c b/trunk/drivers/char/tpm/tpm.c index a9be0e8eaea5..303f15880466 100644 --- a/trunk/drivers/char/tpm/tpm.c +++ b/trunk/drivers/char/tpm/tpm.c @@ -43,13 +43,6 @@ static void user_reader_timeout(unsigned long ptr) { struct tpm_chip *chip = (struct tpm_chip *) ptr; - schedule_work(&chip->work); -} - -static void timeout_work(void * ptr) -{ - struct tpm_chip *chip = ptr; - down(&chip->buffer_mutex); atomic_set(&chip->data_pending, 0); memset(chip->data_buffer, 0, TPM_BUFSIZE); @@ -377,7 +370,6 @@ int tpm_release(struct inode *inode, struct file *file) file->private_data = NULL; chip->num_opens--; del_singleshot_timer_sync(&chip->user_read_timer); - flush_scheduled_work(); atomic_set(&chip->data_pending, 0); put_device(chip->dev); kfree(chip->data_buffer); @@ -429,7 +421,6 @@ ssize_t tpm_read(struct file * file, char __user *buf, int ret_size; del_singleshot_timer_sync(&chip->user_read_timer); - flush_scheduled_work(); ret_size = atomic_read(&chip->data_pending); atomic_set(&chip->data_pending, 0); if (ret_size > 0) { /* relay data */ @@ -437,7 +428,8 @@ ssize_t tpm_read(struct file * file, char __user *buf, ret_size = size; down(&chip->buffer_mutex); - if (copy_to_user(buf, chip->data_buffer, ret_size)) + if (copy_to_user + ((void __user *) buf, chip->data_buffer, ret_size)) ret_size = -EFAULT; up(&chip->buffer_mutex); } @@ -468,7 +460,7 @@ void tpm_remove_hardware(struct device *dev) sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= - ~(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); + !(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); kfree(chip); @@ -536,8 +528,6 @@ int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry) init_MUTEX(&chip->tpm_mutex); INIT_LIST_HEAD(&chip->list); - INIT_WORK(&chip->work, timeout_work, chip); - init_timer(&chip->user_read_timer); chip->user_read_timer.function = user_reader_timeout; chip->user_read_timer.data = (unsigned long) chip; diff --git a/trunk/drivers/char/tpm/tpm.h b/trunk/drivers/char/tpm/tpm.h index 159882ca69dd..9293bcc4dc62 100644 --- a/trunk/drivers/char/tpm/tpm.h +++ b/trunk/drivers/char/tpm/tpm.h @@ -50,11 +50,7 @@ struct tpm_vendor_specific { u8 req_complete_mask; u8 req_complete_val; u8 req_canceled; - void __iomem *iobase; /* ioremapped address */ - unsigned long base; /* TPM base address */ - - int region_size; - int have_region; + u16 base; /* TPM base address */ int (*recv) (struct tpm_chip *, u8 *, size_t); int (*send) (struct tpm_chip *, u8 *, size_t); @@ -77,7 +73,6 @@ struct tpm_chip { struct semaphore buffer_mutex; struct timer_list user_read_timer; /* user needs to claim result */ - struct work_struct work; struct semaphore tpm_mutex; /* tpm is processing */ struct tpm_vendor_specific *vendor; diff --git a/trunk/drivers/char/tpm/tpm_atmel.c b/trunk/drivers/char/tpm/tpm_atmel.c index ff3654964fe3..32e01450c425 100644 --- a/trunk/drivers/char/tpm/tpm_atmel.c +++ b/trunk/drivers/char/tpm/tpm_atmel.c @@ -19,8 +19,14 @@ * */ +#include #include "tpm.h" -#include "tpm_atmel.h" + +/* Atmel definitions */ +enum tpm_atmel_addr { + TPM_ATMEL_BASE_ADDR_LO = 0x08, + TPM_ATMEL_BASE_ADDR_HI = 0x09 +}; /* write status bits */ enum tpm_atmel_write_status { @@ -47,12 +53,13 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count) return -EIO; for (i = 0; i < 6; i++) { - status = ioread8(chip->vendor->iobase + 1); + status = inb(chip->vendor->base + 1); if ((status & ATML_STATUS_DATA_AVAIL) == 0) { - dev_err(chip->dev, "error reading header\n"); + dev_err(chip->dev, + "error reading header\n"); return -EIO; } - *buf++ = ioread8(chip->vendor->iobase); + *buf++ = inb(chip->vendor->base); } /* size of the data received */ @@ -63,9 +70,10 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count) dev_err(chip->dev, "Recv size(%d) less than available space\n", size); for (; i < size; i++) { /* clear the waiting data anyway */ - status = ioread8(chip->vendor->iobase + 1); + status = inb(chip->vendor->base + 1); if ((status & ATML_STATUS_DATA_AVAIL) == 0) { - dev_err(chip->dev, "error reading data\n"); + dev_err(chip->dev, + "error reading data\n"); return -EIO; } } @@ -74,17 +82,17 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count) /* read all the data available */ for (; i < size; i++) { - status = ioread8(chip->vendor->iobase + 1); + status = inb(chip->vendor->base + 1); if ((status & ATML_STATUS_DATA_AVAIL) == 0) { - dev_err(chip->dev, "error reading data\n"); + dev_err(chip->dev, + "error reading data\n"); return -EIO; } - *buf++ = ioread8(chip->vendor->iobase); + *buf++ = inb(chip->vendor->base); } /* make sure data available is gone */ - status = ioread8(chip->vendor->iobase + 1); - + status = inb(chip->vendor->base + 1); if (status & ATML_STATUS_DATA_AVAIL) { dev_err(chip->dev, "data available is stuck\n"); return -EIO; @@ -100,7 +108,7 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count) dev_dbg(chip->dev, "tpm_atml_send:\n"); for (i = 0; i < count; i++) { dev_dbg(chip->dev, "%d 0x%x(%d)\n", i, buf[i], buf[i]); - iowrite8(buf[i], chip->vendor->iobase); + outb(buf[i], chip->vendor->base); } return count; @@ -108,12 +116,12 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count) static void tpm_atml_cancel(struct tpm_chip *chip) { - iowrite8(ATML_STATUS_ABORT, chip->vendor->iobase + 1); + outb(ATML_STATUS_ABORT, chip->vendor->base + 1); } static u8 tpm_atml_status(struct tpm_chip *chip) { - return ioread8(chip->vendor->iobase + 1); + return inb(chip->vendor->base + 1); } static struct file_operations atmel_ops = { @@ -154,17 +162,12 @@ static struct tpm_vendor_specific tpm_atmel = { static struct platform_device *pdev; -static void atml_plat_remove(void) +static void __devexit tpm_atml_remove(struct device *dev) { - struct tpm_chip *chip = dev_get_drvdata(&pdev->dev); - + struct tpm_chip *chip = dev_get_drvdata(dev); if (chip) { - if (chip->vendor->have_region) - atmel_release_region(chip->vendor->base, - chip->vendor->region_size); - atmel_put_base_addr(chip->vendor); + release_region(chip->vendor->base, 2); tpm_remove_hardware(chip->dev); - platform_device_unregister(pdev); } } @@ -179,46 +182,72 @@ static struct device_driver atml_drv = { static int __init init_atmel(void) { int rc = 0; + int lo, hi; driver_register(&atml_drv); - if ((tpm_atmel.iobase = atmel_get_base_addr(&tpm_atmel)) == NULL) { - rc = -ENODEV; - goto err_unreg_drv; + lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO); + hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI); + + tpm_atmel.base = (hi<<8)|lo; + + /* verify that it is an Atmel part */ + if (tpm_read_index(TPM_ADDR, 4) != 'A' || tpm_read_index(TPM_ADDR, 5) != 'T' + || tpm_read_index(TPM_ADDR, 6) != 'M' || tpm_read_index(TPM_ADDR, 7) != 'L') { + return -ENODEV; } - tpm_atmel.have_region = - (atmel_request_region - (tpm_atmel.base, tpm_atmel.region_size, - "tpm_atmel0") == NULL) ? 0 : 1; + /* verify chip version number is 1.1 */ + if ( (tpm_read_index(TPM_ADDR, 0x00) != 0x01) || + (tpm_read_index(TPM_ADDR, 0x01) != 0x01 )) + return -ENODEV; + + pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL); + if ( !pdev ) + return -ENOMEM; + + pdev->name = "tpm_atmel0"; + pdev->id = -1; + pdev->num_resources = 0; + pdev->dev.release = tpm_atml_remove; + pdev->dev.driver = &atml_drv; + + if ((rc = platform_device_register(pdev)) < 0) { + kfree(pdev); + pdev = NULL; + return rc; + } - if (IS_ERR - (pdev = - platform_device_register_simple("tpm_atmel", -1, NULL, 0))) { - rc = PTR_ERR(pdev); - goto err_rel_reg; + if (request_region(tpm_atmel.base, 2, "tpm_atmel0") == NULL ) { + platform_device_unregister(pdev); + kfree(pdev); + pdev = NULL; + return -EBUSY; } - if ((rc = tpm_register_hardware(&pdev->dev, &tpm_atmel)) < 0) - goto err_unreg_dev; - return 0; + if ((rc = tpm_register_hardware(&pdev->dev, &tpm_atmel)) < 0) { + release_region(tpm_atmel.base, 2); + platform_device_unregister(pdev); + kfree(pdev); + pdev = NULL; + return rc; + } -err_unreg_dev: - platform_device_unregister(pdev); -err_rel_reg: - atmel_put_base_addr(&tpm_atmel); - if (tpm_atmel.have_region) - atmel_release_region(tpm_atmel.base, - tpm_atmel.region_size); -err_unreg_drv: - driver_unregister(&atml_drv); - return rc; + dev_info(&pdev->dev, "Atmel TPM 1.1, Base Address: 0x%x\n", + tpm_atmel.base); + return 0; } static void __exit cleanup_atmel(void) { + if (pdev) { + tpm_atml_remove(&pdev->dev); + platform_device_unregister(pdev); + kfree(pdev); + pdev = NULL; + } + driver_unregister(&atml_drv); - atml_plat_remove(); } module_init(init_atmel); diff --git a/trunk/drivers/char/tpm/tpm_atmel.h b/trunk/drivers/char/tpm/tpm_atmel.h deleted file mode 100644 index d3478aaadd77..000000000000 --- a/trunk/drivers/char/tpm/tpm_atmel.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (C) 2005 IBM Corporation - * - * Authors: - * Kylene Hall - * - * Maintained by: - * - * Device driver for TCG/TCPA TPM (trusted platform module). - * Specifications at www.trustedcomputinggroup.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, version 2 of the - * License. - * - * These difference are required on power because the device must be - * discovered through the device tree and iomap must be used to get - * around the need for holes in the io_page_mask. This does not happen - * automatically because the tpm is not a normal pci device and lives - * under the root node. - * - */ - -#ifdef CONFIG_PPC64 -#define atmel_getb(chip, offset) readb(chip->vendor->iobase + offset); -#define atmel_putb(val, chip, offset) writeb(val, chip->vendor->iobase + offset) -#define atmel_request_region request_mem_region -#define atmel_release_region release_mem_region - -static inline void atmel_put_base_addr(struct tpm_vendor_specific - *vendor) -{ - iounmap(vendor->iobase); -} - -static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific *vendor) -{ - struct device_node *dn; - unsigned long address, size; - unsigned int *reg; - int reglen; - int naddrc; - int nsizec; - - dn = of_find_node_by_name(NULL, "tpm"); - - if (!dn) - return NULL; - - if (!device_is_compatible(dn, "AT97SC3201")) { - of_node_put(dn); - return NULL; - } - - reg = (unsigned int *) get_property(dn, "reg", ®len); - naddrc = prom_n_addr_cells(dn); - nsizec = prom_n_size_cells(dn); - - of_node_put(dn); - - - if (naddrc == 2) - address = ((unsigned long) reg[0] << 32) | reg[1]; - else - address = reg[0]; - - if (nsizec == 2) - size = - ((unsigned long) reg[naddrc] << 32) | reg[naddrc + 1]; - else - size = reg[naddrc]; - - vendor->base = address; - vendor->region_size = size; - return ioremap(vendor->base, vendor->region_size); -} -#else -#define atmel_getb(chip, offset) inb(chip->vendor->base + offset) -#define atmel_putb(val, chip, offset) outb(val, chip->vendor->base + offset) -#define atmel_request_region request_region -#define atmel_release_region release_region -/* Atmel definitions */ -enum tpm_atmel_addr { - TPM_ATMEL_BASE_ADDR_LO = 0x08, - TPM_ATMEL_BASE_ADDR_HI = 0x09 -}; - -/* Verify this is a 1.1 Atmel TPM */ -static int atmel_verify_tpm11(void) -{ - - /* verify that it is an Atmel part */ - if (tpm_read_index(TPM_ADDR, 4) != 'A' || - tpm_read_index(TPM_ADDR, 5) != 'T' || - tpm_read_index(TPM_ADDR, 6) != 'M' || - tpm_read_index(TPM_ADDR, 7) != 'L') - return 1; - - /* query chip for its version number */ - if (tpm_read_index(TPM_ADDR, 0x00) != 1 || - tpm_read_index(TPM_ADDR, 0x01) != 1) - return 1; - - /* This is an atmel supported part */ - return 0; -} - -static inline void atmel_put_base_addr(struct tpm_vendor_specific - *vendor) -{ -} - -/* Determine where to talk to device */ -static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific - *vendor) -{ - int lo, hi; - - if (atmel_verify_tpm11() != 0) - return NULL; - - lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO); - hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI); - - vendor->base = (hi << 8) | lo; - vendor->region_size = 2; - - return ioport_map(vendor->base, vendor->region_size); -} -#endif diff --git a/trunk/drivers/char/vc_screen.c b/trunk/drivers/char/vc_screen.c index 3c1dafaa3441..f66c7ad6fd38 100644 --- a/trunk/drivers/char/vc_screen.c +++ b/trunk/drivers/char/vc_screen.c @@ -419,7 +419,7 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) while (this_round > 1) { unsigned short w; - w = get_unaligned(((unsigned short *)con_buf0)); + w = get_unaligned(((const unsigned short *)con_buf0)); vcs_scr_writew(vc, w, org++); con_buf0 += 2; this_round -= 2; diff --git a/trunk/drivers/char/watchdog/booke_wdt.c b/trunk/drivers/char/watchdog/booke_wdt.c index b6640606b44d..abc30cca6645 100644 --- a/trunk/drivers/char/watchdog/booke_wdt.c +++ b/trunk/drivers/char/watchdog/booke_wdt.c @@ -4,7 +4,7 @@ * Watchdog timer for PowerPC Book-E systems * * Author: Matthew McClintock - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor Inc. * @@ -72,7 +72,7 @@ static __inline__ void booke_wdt_ping(void) /* * booke_wdt_write: */ -static ssize_t booke_wdt_write (struct file *file, const char __user *buf, +static ssize_t booke_wdt_write (struct file *file, const char *buf, size_t count, loff_t *ppos) { booke_wdt_ping(); @@ -92,15 +92,14 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { u32 tmp = 0; - u32 __user *p = (u32 __user *)arg; switch (cmd) { case WDIOC_GETSUPPORT: - if (copy_to_user ((struct watchdog_info __user *) arg, &ident, + if (copy_to_user ((struct watchdog_info *) arg, &ident, sizeof(struct watchdog_info))) return -EFAULT; case WDIOC_GETSTATUS: - return put_user(ident.options, p); + return put_user(ident.options, (u32 *) arg); case WDIOC_GETBOOTSTATUS: /* XXX: something is clearing TSR */ tmp = mfspr(SPRN_TSR) & TSR_WRS(3); @@ -110,14 +109,14 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file, booke_wdt_ping(); return 0; case WDIOC_SETTIMEOUT: - if (get_user(booke_wdt_period, p)) + if (get_user(booke_wdt_period, (u32 *) arg)) return -EFAULT; mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period)); return 0; case WDIOC_GETTIMEOUT: - return put_user(booke_wdt_period, p); + return put_user(booke_wdt_period, (u32 *) arg); case WDIOC_SETOPTIONS: - if (get_user(tmp, p)) + if (get_user(tmp, (u32 *) arg)) return -EINVAL; if (tmp == WDIOS_ENABLECARD) { booke_wdt_ping(); @@ -173,7 +172,7 @@ static int __init booke_wdt_init(void) int ret = 0; printk (KERN_INFO "PowerPC Book-E Watchdog Timer Loaded\n"); - ident.firmware_version = cur_cpu_spec->pvr_value; + ident.firmware_version = cpu_specs[0].pvr_value; ret = misc_register(&booke_wdt_miscdev); if (ret) { diff --git a/trunk/drivers/char/watchdog/mpcore_wdt.c b/trunk/drivers/char/watchdog/mpcore_wdt.c index b4d843489881..9defcf861b67 100644 --- a/trunk/drivers/char/watchdog/mpcore_wdt.c +++ b/trunk/drivers/char/watchdog/mpcore_wdt.c @@ -180,6 +180,10 @@ static ssize_t mpcore_wdt_write(struct file *file, const char *data, size_t len, { struct mpcore_wdt *wdt = file->private_data; + /* Can't seek (pwrite) on this device */ + if (ppos != &file->f_pos) + return -ESPIPE; + /* * Refresh the timer. */ diff --git a/trunk/drivers/char/watchdog/pcwd_usb.c b/trunk/drivers/char/watchdog/pcwd_usb.c index 1533f56baa42..092e9b133750 100644 --- a/trunk/drivers/char/watchdog/pcwd_usb.c +++ b/trunk/drivers/char/watchdog/pcwd_usb.c @@ -151,6 +151,7 @@ static void usb_pcwd_disconnect (struct usb_interface *interface); /* usb specific object needed to register this driver with the usb subsystem */ static struct usb_driver usb_pcwd_driver = { + .owner = THIS_MODULE, .name = DRIVER_NAME, .probe = usb_pcwd_probe, .disconnect = usb_pcwd_disconnect, diff --git a/trunk/drivers/char/watchdog/wdrtas.c b/trunk/drivers/char/watchdog/wdrtas.c index dacfe31caccf..619e2ffca33f 100644 --- a/trunk/drivers/char/watchdog/wdrtas.c +++ b/trunk/drivers/char/watchdog/wdrtas.c @@ -320,7 +320,7 @@ static int wdrtas_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - int __user *argp = (void __user *)arg; + int __user *argp = (void *)arg; int i; static struct watchdog_info wdinfo = { .options = WDRTAS_SUPPORTED_MASK, diff --git a/trunk/drivers/connector/cn_proc.c b/trunk/drivers/connector/cn_proc.c index 969d2b4aaec0..fcdf0fff13a6 100644 --- a/trunk/drivers/connector/cn_proc.c +++ b/trunk/drivers/connector/cn_proc.c @@ -56,7 +56,6 @@ void proc_fork_connector(struct task_struct *task) msg = (struct cn_msg*)buffer; ev = (struct proc_event*)msg->data; get_seq(&msg->seq, &ev->cpu); - getnstimestamp(&ev->timestamp); ev->what = PROC_EVENT_FORK; ev->event_data.fork.parent_pid = task->real_parent->pid; ev->event_data.fork.parent_tgid = task->real_parent->tgid; @@ -82,7 +81,6 @@ void proc_exec_connector(struct task_struct *task) msg = (struct cn_msg*)buffer; ev = (struct proc_event*)msg->data; get_seq(&msg->seq, &ev->cpu); - getnstimestamp(&ev->timestamp); ev->what = PROC_EVENT_EXEC; ev->event_data.exec.process_pid = task->pid; ev->event_data.exec.process_tgid = task->tgid; @@ -116,7 +114,6 @@ void proc_id_connector(struct task_struct *task, int which_id) } else return; get_seq(&msg->seq, &ev->cpu); - getnstimestamp(&ev->timestamp); memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); msg->ack = 0; /* not used */ @@ -136,7 +133,6 @@ void proc_exit_connector(struct task_struct *task) msg = (struct cn_msg*)buffer; ev = (struct proc_event*)msg->data; get_seq(&msg->seq, &ev->cpu); - getnstimestamp(&ev->timestamp); ev->what = PROC_EVENT_EXIT; ev->event_data.exit.process_pid = task->pid; ev->event_data.exit.process_tgid = task->tgid; @@ -169,7 +165,6 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack) msg = (struct cn_msg*)buffer; ev = (struct proc_event*)msg->data; msg->seq = rcvd_seq; - getnstimestamp(&ev->timestamp); ev->cpu = -1; ev->what = PROC_EVENT_NONE; ev->event_data.ack.err = err; diff --git a/trunk/drivers/cpufreq/cpufreq.c b/trunk/drivers/cpufreq/cpufreq.c index a9163d02983a..23a63207d747 100644 --- a/trunk/drivers/cpufreq/cpufreq.c +++ b/trunk/drivers/cpufreq/cpufreq.c @@ -693,8 +693,8 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev) unsigned int cpu = sys_dev->id; unsigned long flags; struct cpufreq_policy *data; -#ifdef CONFIG_SMP struct sys_device *cpu_sys_dev; +#ifdef CONFIG_SMP unsigned int j; #endif @@ -822,30 +822,6 @@ static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, unsigne } -/** - * cpufreq_quick_get - get the CPU frequency (in kHz) frpm policy->cur - * @cpu: CPU number - * - * This is the last known freq, without actually getting it from the driver. - * Return value will be same as what is shown in scaling_cur_freq in sysfs. - */ -unsigned int cpufreq_quick_get(unsigned int cpu) -{ - struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); - unsigned int ret = 0; - - if (policy) { - down(&policy->lock); - ret = policy->cur; - up(&policy->lock); - cpufreq_cpu_put(policy); - } - - return (ret); -} -EXPORT_SYMBOL(cpufreq_quick_get); - - /** * cpufreq_get - get the current CPU frequency (in kHz) * @cpu: CPU number @@ -1137,13 +1113,21 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, { int retval = -EINVAL; - lock_cpu_hotplug(); + /* + * If we are already in context of hotplug thread, we dont need to + * acquire the hotplug lock. Otherwise acquire cpucontrol to prevent + * hotplug from removing this cpu that we are working on. + */ + if (!current_in_cpu_hotplug()) + lock_cpu_hotplug(); + dprintk("target for CPU %u: %u kHz, relation %u\n", policy->cpu, target_freq, relation); if (cpu_online(policy->cpu) && cpufreq_driver->target) retval = cpufreq_driver->target(policy, target_freq, relation); - unlock_cpu_hotplug(); + if (!current_in_cpu_hotplug()) + unlock_cpu_hotplug(); return retval; } diff --git a/trunk/drivers/cpufreq/cpufreq_conservative.c b/trunk/drivers/cpufreq/cpufreq_conservative.c index 39543a2bed0f..2ed5c4363b53 100644 --- a/trunk/drivers/cpufreq/cpufreq_conservative.c +++ b/trunk/drivers/cpufreq/cpufreq_conservative.c @@ -93,7 +93,7 @@ static inline unsigned int get_cpu_idle_time(unsigned int cpu) { return kstat_cpu(cpu).cpustat.idle + kstat_cpu(cpu).cpustat.iowait + - ( dbs_tuners_ins.ignore_nice ? + ( !dbs_tuners_ins.ignore_nice ? kstat_cpu(cpu).cpustat.nice : 0); } @@ -127,7 +127,7 @@ show_one(sampling_rate, sampling_rate); show_one(sampling_down_factor, sampling_down_factor); show_one(up_threshold, up_threshold); show_one(down_threshold, down_threshold); -show_one(ignore_nice_load, ignore_nice); +show_one(ignore_nice, ignore_nice); show_one(freq_step, freq_step); static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, @@ -207,7 +207,7 @@ static ssize_t store_down_threshold(struct cpufreq_policy *unused, return count; } -static ssize_t store_ignore_nice_load(struct cpufreq_policy *policy, +static ssize_t store_ignore_nice(struct cpufreq_policy *policy, const char *buf, size_t count) { unsigned int input; @@ -272,7 +272,7 @@ define_one_rw(sampling_rate); define_one_rw(sampling_down_factor); define_one_rw(up_threshold); define_one_rw(down_threshold); -define_one_rw(ignore_nice_load); +define_one_rw(ignore_nice); define_one_rw(freq_step); static struct attribute * dbs_attributes[] = { @@ -282,7 +282,7 @@ static struct attribute * dbs_attributes[] = { &sampling_down_factor.attr, &up_threshold.attr, &down_threshold.attr, - &ignore_nice_load.attr, + &ignore_nice.attr, &freq_step.attr, NULL }; diff --git a/trunk/drivers/cpufreq/cpufreq_ondemand.c b/trunk/drivers/cpufreq/cpufreq_ondemand.c index e69fd8dd1f1c..17741111246b 100644 --- a/trunk/drivers/cpufreq/cpufreq_ondemand.c +++ b/trunk/drivers/cpufreq/cpufreq_ondemand.c @@ -89,7 +89,7 @@ static inline unsigned int get_cpu_idle_time(unsigned int cpu) { return kstat_cpu(cpu).cpustat.idle + kstat_cpu(cpu).cpustat.iowait + - ( dbs_tuners_ins.ignore_nice ? + ( !dbs_tuners_ins.ignore_nice ? kstat_cpu(cpu).cpustat.nice : 0); } @@ -122,7 +122,7 @@ static ssize_t show_##file_name \ show_one(sampling_rate, sampling_rate); show_one(sampling_down_factor, sampling_down_factor); show_one(up_threshold, up_threshold); -show_one(ignore_nice_load, ignore_nice); +show_one(ignore_nice, ignore_nice); static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, const char *buf, size_t count) @@ -182,7 +182,7 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused, return count; } -static ssize_t store_ignore_nice_load(struct cpufreq_policy *policy, +static ssize_t store_ignore_nice(struct cpufreq_policy *policy, const char *buf, size_t count) { unsigned int input; @@ -223,7 +223,7 @@ __ATTR(_name, 0644, show_##_name, store_##_name) define_one_rw(sampling_rate); define_one_rw(sampling_down_factor); define_one_rw(up_threshold); -define_one_rw(ignore_nice_load); +define_one_rw(ignore_nice); static struct attribute * dbs_attributes[] = { &sampling_rate_max.attr, @@ -231,7 +231,7 @@ static struct attribute * dbs_attributes[] = { &sampling_rate.attr, &sampling_down_factor.attr, &up_threshold.attr, - &ignore_nice_load.attr, + &ignore_nice.attr, NULL }; diff --git a/trunk/drivers/fc4/Kconfig b/trunk/drivers/fc4/Kconfig index 345dbe6f10df..f00c02a13ed6 100644 --- a/trunk/drivers/fc4/Kconfig +++ b/trunk/drivers/fc4/Kconfig @@ -26,7 +26,7 @@ comment "FC4 drivers" config FC4_SOC tristate "Sun SOC/Sbus" - depends on FC4!=n && SPARC + depends on FC4!=n && (SPARC32 || SPARC64) help Serial Optical Channel is an interface card with one or two Fibre Optic ports, each of which can be connected to a disk array. Note @@ -38,7 +38,7 @@ config FC4_SOC config FC4_SOCAL tristate "Sun SOC+ (aka SOCAL)" - depends on FC4!=n && SPARC + depends on FC4!=n && (SPARC32 || SPARC64) ---help--- Serial Optical Channel Plus is an interface card with up to two Fibre Optic ports. This card supports FC Arbitrated Loop (usually @@ -62,7 +62,7 @@ config SCSI_PLUTO be called pluto. config SCSI_FCAL - tristate "Sun Enterprise Network Array (A5000 and EX500)" if SPARC + tristate "Sun Enterprise Network Array (A5000 and EX500)" if SPARC32 || SPARC64 depends on FC4!=n && SCSI help This driver drives FC-AL disks connected through a Fibre Channel @@ -75,7 +75,7 @@ config SCSI_FCAL config SCSI_FCAL prompt "Generic FC-AL disk driver" - depends on FC4!=n && SCSI && !SPARC + depends on FC4!=n && SCSI && !SPARC32 && !SPARC64 endmenu diff --git a/trunk/drivers/firmware/Kconfig b/trunk/drivers/firmware/Kconfig index 1e371a510dd2..b6815c6c29a2 100644 --- a/trunk/drivers/firmware/Kconfig +++ b/trunk/drivers/firmware/Kconfig @@ -60,7 +60,6 @@ config EFI_PCDP config DELL_RBU tristate "BIOS update support for DELL systems via sysfs" - depends on X86 select FW_LOADER help Say m if you want to have the option of updating the BIOS for your diff --git a/trunk/drivers/firmware/dell_rbu.c b/trunk/drivers/firmware/dell_rbu.c index dfedb777d8c9..6d83299e7c9b 100644 --- a/trunk/drivers/firmware/dell_rbu.c +++ b/trunk/drivers/firmware/dell_rbu.c @@ -105,8 +105,8 @@ static int create_packet(void *data, size_t length) int ordernum = 0; int retval = 0; unsigned int packet_array_size = 0; - void **invalid_addr_packet_array = NULL; - void *packet_data_temp_buf = NULL; + void **invalid_addr_packet_array = 0; + void *packet_data_temp_buf = 0; unsigned int idx = 0; pr_debug("create_packet: entry \n"); @@ -178,7 +178,7 @@ static int create_packet(void *data, size_t length) packet_data_temp_buf), allocation_floor); invalid_addr_packet_array[idx++] = packet_data_temp_buf; - packet_data_temp_buf = NULL; + packet_data_temp_buf = 0; } } spin_lock(&rbu_data.lock); diff --git a/trunk/drivers/hwmon/hdaps.c b/trunk/drivers/hwmon/hdaps.c index 23a9e1ea8e32..c81bd4bce1b8 100644 --- a/trunk/drivers/hwmon/hdaps.c +++ b/trunk/drivers/hwmon/hdaps.c @@ -570,7 +570,7 @@ static int __init hdaps_init(void) hdaps_idev->evbit[0] = BIT(EV_ABS); input_set_abs_params(hdaps_idev, ABS_X, -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT); - input_set_abs_params(hdaps_idev, ABS_Y, + input_set_abs_params(hdaps_idev, ABS_X, -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT); input_register_device(hdaps_idev); diff --git a/trunk/drivers/hwmon/it87.c b/trunk/drivers/hwmon/it87.c index a61f5d00f10a..6c41e25e670b 100644 --- a/trunk/drivers/hwmon/it87.c +++ b/trunk/drivers/hwmon/it87.c @@ -522,15 +522,8 @@ static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr, struct i2c_client *client = to_i2c_client(dev); struct it87_data *data = i2c_get_clientdata(client); int val = simple_strtol(buf, NULL, 10); - u8 reg = it87_read_value(client, IT87_REG_FAN_DIV); down(&data->update_lock); - switch (nr) { - case 0: data->fan_div[nr] = reg & 0x07; break; - case 1: data->fan_div[nr] = (reg >> 3) & 0x07; break; - case 2: data->fan_div[nr] = (reg & 0x40) ? 3 : 1; break; - } - data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); it87_write_value(client, IT87_REG_FAN_MIN(nr), data->fan_min[nr]); up(&data->update_lock); diff --git a/trunk/drivers/hwmon/lm78.c b/trunk/drivers/hwmon/lm78.c index 78cdd506439f..bde0cda9477e 100644 --- a/trunk/drivers/hwmon/lm78.c +++ b/trunk/drivers/hwmon/lm78.c @@ -451,7 +451,7 @@ static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL); static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf) { struct lm78_data *data = lm78_update_device(dev); - return sprintf(buf, "%d\n", vid_from_reg(data->vid, 82)); + return sprintf(buf, "%d\n", vid_from_reg(82, data->vid)); } static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); diff --git a/trunk/drivers/hwmon/w83627hf.c b/trunk/drivers/hwmon/w83627hf.c index bbb3dcde146b..4e9a04e1f08e 100644 --- a/trunk/drivers/hwmon/w83627hf.c +++ b/trunk/drivers/hwmon/w83627hf.c @@ -456,9 +456,7 @@ static ssize_t store_regs_in_min0(struct device *dev, struct device_attribute *a (w83627thf == data->type || w83637hf == data->type)) /* use VRM9 calculation */ - data->in_min[0] = - SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0, - 255); + data->in_min[0] = (u8)(((val * 100) - 70000 + 244) / 488); else /* use VRM8 (standard) calculation */ data->in_min[0] = IN_TO_REG(val); @@ -483,9 +481,7 @@ static ssize_t store_regs_in_max0(struct device *dev, struct device_attribute *a (w83627thf == data->type || w83637hf == data->type)) /* use VRM9 calculation */ - data->in_max[0] = - SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0, - 255); + data->in_max[0] = (u8)(((val * 100) - 70000 + 244) / 488); else /* use VRM8 (standard) calculation */ data->in_max[0] = IN_TO_REG(val); diff --git a/trunk/drivers/hwmon/w83792d.c b/trunk/drivers/hwmon/w83792d.c index 1ba072630361..4be59dbb78c4 100644 --- a/trunk/drivers/hwmon/w83792d.c +++ b/trunk/drivers/hwmon/w83792d.c @@ -193,7 +193,6 @@ static const u8 W83792D_REG_LEVELS[3][4] = { 0xE2 } /* (bit3-0) SmartFanII: Fan3 Level 3 */ }; -#define W83792D_REG_GPIO_EN 0x1A #define W83792D_REG_CONFIG 0x40 #define W83792D_REG_VID_FANDIV 0x47 #define W83792D_REG_CHIPID 0x49 @@ -258,7 +257,7 @@ DIV_TO_REG(long val) { int i; val = SENSORS_LIMIT(val, 1, 128) >> 1; - for (i = 0; i < 7; i++) { + for (i = 0; i < 6; i++) { if (val == 0) break; val >>= 1; @@ -1283,8 +1282,8 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind) w83792d_init_client(new_client); /* A few vars need to be filled upon startup */ - for (i = 0; i < 7; i++) { - data->fan_min[i] = w83792d_read_value(new_client, + for (i = 1; i <= 7; i++) { + data->fan_min[i - 1] = w83792d_read_value(new_client, W83792D_REG_FAN_MIN[i]); } @@ -1307,20 +1306,10 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind) device_create_file_fan(new_client, 1); device_create_file_fan(new_client, 2); device_create_file_fan(new_client, 3); - - /* Read GPIO enable register to check if pins for fan 4,5 are used as - GPIO */ - val1 = w83792d_read_value(new_client, W83792D_REG_GPIO_EN); - if (!(val1 & 0x40)) - device_create_file_fan(new_client, 4); - if (!(val1 & 0x20)) - device_create_file_fan(new_client, 5); - - val1 = w83792d_read_value(new_client, W83792D_REG_PIN); - if (val1 & 0x40) - device_create_file_fan(new_client, 6); - if (val1 & 0x04) - device_create_file_fan(new_client, 7); + device_create_file_fan(new_client, 4); + device_create_file_fan(new_client, 5); + device_create_file_fan(new_client, 6); + device_create_file_fan(new_client, 7); device_create_file_temp1(new_client); /* Temp1 */ device_create_file_temp_add(new_client, 2); /* Temp2 */ diff --git a/trunk/drivers/i2c/busses/i2c-ixp2000.c b/trunk/drivers/i2c/busses/i2c-ixp2000.c index cd6f45d186ab..cef024a7d048 100644 --- a/trunk/drivers/i2c/busses/i2c-ixp2000.c +++ b/trunk/drivers/i2c/busses/i2c-ixp2000.c @@ -36,6 +36,8 @@ #include /* Pick up IXP2000-specific bits */ #include +static struct device_driver ixp2000_i2c_driver; + static inline int ixp2000_scl_pin(void *data) { return ((struct ixp2000_i2c_pins*)data)->scl_pin; @@ -118,7 +120,7 @@ static int ixp2000_i2c_probe(struct platform_device *plat_dev) drv_data->algo_data.timeout = 100; drv_data->adapter.id = I2C_HW_B_IXP2000, - strlcpy(drv_data->adapter.name, plat_dev->dev.driver->name, + strlcpy(drv_data->adapter.name, ixp2000_i2c_driver.name, I2C_NAME_SIZE); drv_data->adapter.algo_data = &drv_data->algo_data, @@ -130,7 +132,7 @@ static int ixp2000_i2c_probe(struct platform_device *plat_dev) gpio_line_set(gpio->sda_pin, 0); if ((err = i2c_bit_add_bus(&drv_data->adapter)) != 0) { - dev_err(&plat_dev->dev, "Could not install, error %d\n", err); + dev_err(dev, "Could not install, error %d\n", err); kfree(drv_data); return err; } diff --git a/trunk/drivers/i2c/busses/i2c-ixp4xx.c b/trunk/drivers/i2c/busses/i2c-ixp4xx.c index e422d8b2d4d6..aa36855fa995 100644 --- a/trunk/drivers/i2c/busses/i2c-ixp4xx.c +++ b/trunk/drivers/i2c/busses/i2c-ixp4xx.c @@ -35,6 +35,8 @@ #include /* Pick up IXP4xx-specific bits */ +static struct device_driver ixp4xx_i2c_driver; + static inline int ixp4xx_scl_pin(void *data) { return ((struct ixp4xx_i2c_pins*)data)->scl_pin; @@ -126,7 +128,7 @@ static int ixp4xx_i2c_probe(struct platform_device *plat_dev) drv_data->algo_data.timeout = 100; drv_data->adapter.id = I2C_HW_B_IXP4XX; - strlcpy(drv_data->adapter.name, plat_dev->dev.driver->name, + strlcpy(drv_data->adapter.name, ixp4xx_i2c_driver.name, I2C_NAME_SIZE); drv_data->adapter.algo_data = &drv_data->algo_data; @@ -138,7 +140,7 @@ static int ixp4xx_i2c_probe(struct platform_device *plat_dev) gpio_line_set(gpio->sda_pin, 0); if ((err = i2c_bit_add_bus(&drv_data->adapter) != 0)) { - printk(KERN_ERR "ERROR: Could not install %s\n", plat_dev->dev.bus_id); + printk(KERN_ERR "ERROR: Could not install %s\n", dev->bus_id); kfree(drv_data); return err; diff --git a/trunk/drivers/i2c/busses/i2c-mv64xxx.c b/trunk/drivers/i2c/busses/i2c-mv64xxx.c index 81031eb51056..afd7634e5cc9 100644 --- a/trunk/drivers/i2c/busses/i2c-mv64xxx.c +++ b/trunk/drivers/i2c/busses/i2c-mv64xxx.c @@ -529,15 +529,14 @@ mv64xxx_i2c_probe(struct platform_device *pd) i2c_set_adapdata(&drv_data->adapter, drv_data); if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, - MV64XXX_I2C_CTLR_NAME, drv_data)) { - dev_err(&drv_data->adapter.dev, - "mv64xxx: Can't register intr handler irq: %d\n", - drv_data->irq); + MV64XXX_I2C_CTLR_NAME, drv_data)) { + + dev_err(dev, "mv64xxx: Can't register intr handler " + "irq: %d\n", drv_data->irq); rc = -EINVAL; goto exit_unmap_regs; } else if ((rc = i2c_add_adapter(&drv_data->adapter)) != 0) { - dev_err(&drv_data->adapter.dev, - "mv64xxx: Can't add i2c adapter, rc: %d\n", -rc); + dev_err(dev, "mv64xxx: Can't add i2c adapter, rc: %d\n", -rc); goto exit_free_irq; } diff --git a/trunk/drivers/ide/Kconfig b/trunk/drivers/ide/Kconfig index 1c81174595b3..42e5b8175cbf 100644 --- a/trunk/drivers/ide/Kconfig +++ b/trunk/drivers/ide/Kconfig @@ -625,7 +625,7 @@ config BLK_DEV_NS87415 tristate "NS87415 chipset support" help This driver adds detection and support for the NS87415 chip - (used mainly on SPARC64 and PA-RISC machines). + (used in SPARC64, among others). Please read the comments at the top of . @@ -787,10 +787,6 @@ config BLK_DEV_IDE_PMAC_BLINK This option enables the use of the sleep LED as a hard drive activity LED. -config BLK_DEV_IDE_SWARM - tristate "IDE for Sibyte evaluation boards" - depends on SIBYTE_SB1xxx_SOC - config BLK_DEV_IDE_AU1XXX bool "IDE for AMD Alchemy Au1200" depends on SOC_AU1200 @@ -807,6 +803,14 @@ config BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX endchoice +config BLK_DEV_IDE_AU1XXX_BURSTABLE_ON + bool "Enable burstable Mode on DbDMA" + default false + depends BLK_DEV_IDE_AU1XXX + help + This option enable the burstable Flag on DbDMA controller + (cf. "AMD Alchemy 'Au1200' Processor Data Book - PRELIMINARY"). + config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ int "Maximum transfer size (KB) per request (up to 128)" default "128" @@ -932,7 +936,7 @@ config BLK_DEV_Q40IDE config BLK_DEV_MPC8xx_IDE bool "MPC8xx IDE support" - depends on 8xx && IDE=y && BLK_DEV_IDE=y + depends on 8xx help This option provides support for IDE on Motorola MPC8xx Systems. Please see 'Type of MPC8xx IDE interface' for details. diff --git a/trunk/drivers/ide/Makefile b/trunk/drivers/ide/Makefile index 569fae717503..cca9c075966d 100644 --- a/trunk/drivers/ide/Makefile +++ b/trunk/drivers/ide/Makefile @@ -48,6 +48,6 @@ obj-$(CONFIG_BLK_DEV_IDECD) += ide-cd.o obj-$(CONFIG_BLK_DEV_IDETAPE) += ide-tape.o obj-$(CONFIG_BLK_DEV_IDEFLOPPY) += ide-floppy.o -obj-$(CONFIG_BLK_DEV_IDE) += legacy/ arm/ mips/ +obj-$(CONFIG_BLK_DEV_IDE) += legacy/ arm/ obj-$(CONFIG_BLK_DEV_HD) += legacy/ obj-$(CONFIG_ETRAX_IDE) += cris/ diff --git a/trunk/drivers/ide/ide-cd.c b/trunk/drivers/ide/ide-cd.c index b4d7a3efb90f..c2f47923d174 100644 --- a/trunk/drivers/ide/ide-cd.c +++ b/trunk/drivers/ide/ide-cd.c @@ -1292,6 +1292,7 @@ static ide_startstop_t cdrom_start_seek (ide_drive_t *drive, unsigned int block) struct cdrom_info *info = drive->driver_data; info->dma = 0; + info->cmd = 0; info->start_seek = jiffies; return cdrom_start_packet_command(drive, 0, cdrom_start_seek_continuation); } @@ -1343,6 +1344,8 @@ static ide_startstop_t cdrom_start_read (ide_drive_t *drive, unsigned int block) (rq->nr_sectors & (sectors_per_frame - 1))) info->dma = 0; + info->cmd = READ; + /* Start sending the read request to the drive. */ return cdrom_start_packet_command(drive, 32768, cdrom_start_read_continuation); } @@ -1481,6 +1484,7 @@ static ide_startstop_t cdrom_do_packet_command (ide_drive_t *drive) struct cdrom_info *info = drive->driver_data; info->dma = 0; + info->cmd = 0; rq->flags &= ~REQ_FAILED; len = rq->data_len; @@ -1887,6 +1891,7 @@ static ide_startstop_t cdrom_start_write(ide_drive_t *drive, struct request *rq) /* use dma, if possible. we don't need to check more, since we * know that the transfer is always (at least!) frame aligned */ info->dma = drive->using_dma ? 1 : 0; + info->cmd = WRITE; info->devinfo.media_written = 1; @@ -1911,6 +1916,7 @@ static ide_startstop_t cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) rq->flags |= REQ_QUIET; info->dma = 0; + info->cmd = 0; /* * sg request @@ -1919,6 +1925,7 @@ static ide_startstop_t cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) int mask = drive->queue->dma_alignment; unsigned long addr = (unsigned long) page_address(bio_page(rq->bio)); + info->cmd = rq_data_dir(rq); info->dma = drive->using_dma; /* @@ -3321,8 +3328,8 @@ static ide_proc_entry_t idecd_proc[] = { #endif static ide_driver_t ide_cdrom_driver = { + .owner = THIS_MODULE, .gen_driver = { - .owner = THIS_MODULE, .name = "ide-cdrom", .bus = &ide_bus_type, .probe = ide_cd_probe, @@ -3503,8 +3510,8 @@ static void __exit ide_cdrom_exit(void) { driver_unregister(&ide_cdrom_driver.gen_driver); } - -static int __init ide_cdrom_init(void) + +static int ide_cdrom_init(void) { return driver_register(&ide_cdrom_driver.gen_driver); } diff --git a/trunk/drivers/ide/ide-cd.h b/trunk/drivers/ide/ide-cd.h index ad1f2ed14a37..7ca3e5afc665 100644 --- a/trunk/drivers/ide/ide-cd.h +++ b/trunk/drivers/ide/ide-cd.h @@ -480,6 +480,7 @@ struct cdrom_info { struct request request_sense_request; int dma; + int cmd; unsigned long last_block; unsigned long start_seek; /* Buffer to hold mechanism status and changer slot table. */ diff --git a/trunk/drivers/ide/ide-disk.c b/trunk/drivers/ide/ide-disk.c index 449522f0540c..e827b39e4b3c 100644 --- a/trunk/drivers/ide/ide-disk.c +++ b/trunk/drivers/ide/ide-disk.c @@ -1034,12 +1034,12 @@ static int ide_disk_remove(struct device *dev) struct ide_disk_obj *idkp = drive->driver_data; struct gendisk *g = idkp->disk; + ide_cacheflush_p(drive); + ide_unregister_subdriver(drive, idkp->driver); del_gendisk(g); - ide_cacheflush_p(drive); - ide_disk_put(idkp); return 0; @@ -1089,8 +1089,8 @@ static void ide_device_shutdown(struct device *dev) } static ide_driver_t idedisk_driver = { + .owner = THIS_MODULE, .gen_driver = { - .owner = THIS_MODULE, .name = "ide-disk", .bus = &ide_bus_type, .probe = ide_disk_probe, @@ -1266,7 +1266,7 @@ static void __exit idedisk_exit (void) driver_unregister(&idedisk_driver.gen_driver); } -static int __init idedisk_init(void) +static int idedisk_init (void) { return driver_register(&idedisk_driver.gen_driver); } diff --git a/trunk/drivers/ide/ide-dma.c b/trunk/drivers/ide/ide-dma.c index 0523da77425a..1e1531334c25 100644 --- a/trunk/drivers/ide/ide-dma.c +++ b/trunk/drivers/ide/ide-dma.c @@ -90,6 +90,11 @@ #include #include +struct drive_list_entry { + const char *id_model; + const char *id_firmware; +}; + static const struct drive_list_entry drive_whitelist [] = { { "Micropolis 2112A" , "ALL" }, @@ -134,7 +139,7 @@ static const struct drive_list_entry drive_blacklist [] = { }; /** - * ide_in_drive_list - look for drive in black/white list + * in_drive_list - look for drive in black/white list * @id: drive identifier * @drive_table: list to inspect * @@ -142,7 +147,7 @@ static const struct drive_list_entry drive_blacklist [] = { * Returns 1 if the drive is found in the table. */ -int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table) +static int in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table) { for ( ; drive_table->id_model ; drive_table++) if ((!strcmp(drive_table->id_model, id->model)) && @@ -152,8 +157,6 @@ int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *driv return 0; } -EXPORT_SYMBOL_GPL(ide_in_drive_list); - /** * ide_dma_intr - IDE DMA interrupt handler * @drive: the drive the interrupt is for @@ -660,7 +663,7 @@ int __ide_dma_bad_drive (ide_drive_t *drive) { struct hd_driveid *id = drive->id; - int blacklist = ide_in_drive_list(id, drive_blacklist); + int blacklist = in_drive_list(id, drive_blacklist); if (blacklist) { printk(KERN_WARNING "%s: Disabling (U)DMA for %s (blacklisted)\n", drive->name, id->model); @@ -674,7 +677,7 @@ EXPORT_SYMBOL(__ide_dma_bad_drive); int __ide_dma_good_drive (ide_drive_t *drive) { struct hd_driveid *id = drive->id; - return ide_in_drive_list(id, drive_whitelist); + return in_drive_list(id, drive_whitelist); } EXPORT_SYMBOL(__ide_dma_good_drive); diff --git a/trunk/drivers/ide/ide-floppy.c b/trunk/drivers/ide/ide-floppy.c index 9e293c8063dc..f615ab759962 100644 --- a/trunk/drivers/ide/ide-floppy.c +++ b/trunk/drivers/ide/ide-floppy.c @@ -1925,8 +1925,8 @@ static ide_proc_entry_t idefloppy_proc[] = { static int ide_floppy_probe(struct device *); static ide_driver_t idefloppy_driver = { + .owner = THIS_MODULE, .gen_driver = { - .owner = THIS_MODULE, .name = "ide-floppy", .bus = &ide_bus_type, .probe = ide_floppy_probe, @@ -2191,7 +2191,10 @@ static void __exit idefloppy_exit (void) driver_unregister(&idefloppy_driver.gen_driver); } -static int __init idefloppy_init(void) +/* + * idefloppy_init will register the driver for each floppy. + */ +static int idefloppy_init (void) { printk("ide-floppy driver " IDEFLOPPY_VERSION "\n"); return driver_register(&idefloppy_driver.gen_driver); diff --git a/trunk/drivers/ide/ide-io.c b/trunk/drivers/ide/ide-io.c index ecfafcdafea4..5275cbb1afe9 100644 --- a/trunk/drivers/ide/ide-io.c +++ b/trunk/drivers/ide/ide-io.c @@ -1629,6 +1629,12 @@ EXPORT_SYMBOL(ide_init_drive_cmd); * for the new rq to be completed. This is VERY DANGEROUS, and is * intended for careful use by the ATAPI tape/cdrom driver code. * + * If action is ide_next, then the rq is queued immediately after + * the currently-being-processed-request (if any), and the function + * returns without waiting for the new rq to be completed. As above, + * This is VERY DANGEROUS, and is intended for careful use by the + * ATAPI tape/cdrom driver code. + * * If action is ide_end, then the rq is queued at the end of the * request queue, and the function returns immediately without waiting * for the new rq to be completed. This is again intended for careful diff --git a/trunk/drivers/ide/ide-lib.c b/trunk/drivers/ide/ide-lib.c index 41d46dbe6c24..b09a6537c7a8 100644 --- a/trunk/drivers/ide/ide-lib.c +++ b/trunk/drivers/ide/ide-lib.c @@ -410,10 +410,10 @@ void ide_toggle_bounce(ide_drive_t *drive, int on) { u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */ - if (!PCI_DMA_BUS_IS_PHYS) { - addr = BLK_BOUNCE_ANY; - } else if (on && drive->media == ide_disk) { - if (HWIF(drive)->pci_dev) + if (on && drive->media == ide_disk) { + if (!PCI_DMA_BUS_IS_PHYS) + addr = BLK_BOUNCE_ANY; + else if (HWIF(drive)->pci_dev) addr = HWIF(drive)->pci_dev->dma_mask; } diff --git a/trunk/drivers/ide/ide-tape.c b/trunk/drivers/ide/ide-tape.c index 7d7944ed4158..0ac7eb8f40d5 100644 --- a/trunk/drivers/ide/ide-tape.c +++ b/trunk/drivers/ide/ide-tape.c @@ -4748,8 +4748,8 @@ static ide_proc_entry_t idetape_proc[] = { static int ide_tape_probe(struct device *); static ide_driver_t idetape_driver = { + .owner = THIS_MODULE, .gen_driver = { - .owner = THIS_MODULE, .name = "ide-tape", .bus = &ide_bus_type, .probe = ide_tape_probe, @@ -4916,7 +4916,10 @@ static void __exit idetape_exit (void) unregister_chrdev(IDETAPE_MAJOR, "ht"); } -static int __init idetape_init(void) +/* + * idetape_init will register the driver for each tape. + */ +static int idetape_init (void) { int error = 1; idetape_sysfs_class = class_create(THIS_MODULE, "ide_tape"); diff --git a/trunk/drivers/ide/ide-taskfile.c b/trunk/drivers/ide/ide-taskfile.c index 62ebefd6394a..54f9639c2a8c 100644 --- a/trunk/drivers/ide/ide-taskfile.c +++ b/trunk/drivers/ide/ide-taskfile.c @@ -51,6 +51,8 @@ #include #include +#define DEBUG_TASKFILE 0 /* unset when fixed */ + static void ata_bswap_data (void *buffer, int wcount) { u16 *p = buffer; @@ -763,6 +765,9 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task) ide_hwif_t *hwif = HWIF(drive); task_struct_t *taskfile = (task_struct_t *) task->tfRegister; hob_struct_t *hobfile = (hob_struct_t *) task->hobRegister; +#if DEBUG_TASKFILE + u8 status; +#endif if (task->data_phase == TASKFILE_MULTI_IN || task->data_phase == TASKFILE_MULTI_OUT) { @@ -773,13 +778,19 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task) } /* - * (ks) Check taskfile in flags. + * (ks) Check taskfile in/out flags. * If set, then execute as it is defined. * If not set, then define default settings. * The default values are: - * read all taskfile registers (except data) - * read the hob registers (sector, nsector, lcyl, hcyl) + * write and read all taskfile registers (except data) + * write and read the hob registers (sector,nsector,lcyl,hcyl) */ + if (task->tf_out_flags.all == 0) { + task->tf_out_flags.all = IDE_TASKFILE_STD_OUT_FLAGS; + if (drive->addressing == 1) + task->tf_out_flags.all |= (IDE_HOB_STD_OUT_FLAGS << 8); + } + if (task->tf_in_flags.all == 0) { task->tf_in_flags.all = IDE_TASKFILE_STD_IN_FLAGS; if (drive->addressing == 1) @@ -792,6 +803,16 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task) hwif->OUTB(drive->ctl, IDE_CONTROL_REG); SELECT_MASK(drive, 0); +#if DEBUG_TASKFILE + status = hwif->INB(IDE_STATUS_REG); + if (status & 0x80) { + printk("flagged_taskfile -> Bad status. Status = %02x. wait 100 usec ...\n", status); + udelay(100); + status = hwif->INB(IDE_STATUS_REG); + printk("flagged_taskfile -> Status = %02x\n", status); + } +#endif + if (task->tf_out_flags.b.data) { u16 data = taskfile->data + (hobfile->data << 8); hwif->OUTW(data, IDE_DATA_REG); diff --git a/trunk/drivers/ide/mips/Makefile b/trunk/drivers/ide/mips/Makefile deleted file mode 100644 index 677c7b2bac92..000000000000 --- a/trunk/drivers/ide/mips/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -obj-$(CONFIG_BLK_DEV_IDE_SWARM) += swarm.o -obj-$(CONFIG_BLK_DEV_IDE_AU1XXX) += au1xxx-ide.o - -EXTRA_CFLAGS := -Idrivers/ide diff --git a/trunk/drivers/ide/mips/au1xxx-ide.c b/trunk/drivers/ide/mips/au1xxx-ide.c index 32431dcf5d8e..2b6327c576b9 100644 --- a/trunk/drivers/ide/mips/au1xxx-ide.c +++ b/trunk/drivers/ide/mips/au1xxx-ide.c @@ -31,638 +31,865 @@ */ #undef REALLY_SLOW_IO /* most systems can safely undef this */ +#include /* for CONFIG_BLK_DEV_IDEPCI */ #include #include #include #include -#include - +#include +#include +#include +#include #include #include #include #include -#include "ide-timing.h" - #include #include #include +#if CONFIG_PM +#include +#endif + #include #define DRV_NAME "au1200-ide" #define DRV_VERSION "1.0" -#define DRV_AUTHOR "Enrico Walther / Pete Popov " - -/* enable the burstmode in the dbdma */ -#define IDE_AU1XXX_BURSTMODE 1 +#define DRV_AUTHOR "AMD PCS / Pete Popov " +#define DRV_DESC "Au1200 IDE" static _auide_hwif auide_hwif; -static int dbdma_init_done; +static spinlock_t ide_tune_drive_spin_lock = SPIN_LOCK_UNLOCKED; +static spinlock_t ide_tune_chipset_spin_lock = SPIN_LOCK_UNLOCKED; +static int dbdma_init_done = 0; -#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA) +/* + * local I/O functions + */ +u8 auide_inb(unsigned long port) +{ + return (au_readb(port)); +} + +u16 auide_inw(unsigned long port) +{ + return (au_readw(port)); +} + +u32 auide_inl(unsigned long port) +{ + return (au_readl(port)); +} void auide_insw(unsigned long port, void *addr, u32 count) { - _auide_hwif *ahwif = &auide_hwif; - chan_tab_t *ctp; - au1x_ddma_desc_t *dp; +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA) - if(!put_dest_flags(ahwif->rx_chan, (void*)addr, count << 1, - DDMA_FLAGS_NOIE)) { - printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__); - return; - } - ctp = *((chan_tab_t **)ahwif->rx_chan); - dp = ctp->cur_ptr; - while (dp->dscr_cmd0 & DSCR_CMD0_V) - ; - ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp); + _auide_hwif *ahwif = &auide_hwif; + chan_tab_t *ctp; + au1x_ddma_desc_t *dp; + + if(!put_dest_flags(ahwif->rx_chan, (void*)addr, count << 1, + DDMA_FLAGS_NOIE)) { + printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__); + return; + } + ctp = *((chan_tab_t **)ahwif->rx_chan); + dp = ctp->cur_ptr; + while (dp->dscr_cmd0 & DSCR_CMD0_V) + ; + ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp); +#else + while (count--) + { + *(u16 *)addr = au_readw(port); + addr +=2 ; + } +#endif } -void auide_outsw(unsigned long port, void *addr, u32 count) +void auide_insl(unsigned long port, void *addr, u32 count) { - _auide_hwif *ahwif = &auide_hwif; - chan_tab_t *ctp; - au1x_ddma_desc_t *dp; + while (count--) + { + *(u32 *)addr = au_readl(port); + /* NOTE: For IDE interfaces over PCMCIA, + * 32-bit access does not work + */ + addr += 4; + } +} - if(!put_source_flags(ahwif->tx_chan, (void*)addr, - count << 1, DDMA_FLAGS_NOIE)) { - printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__); - return; - } - ctp = *((chan_tab_t **)ahwif->tx_chan); - dp = ctp->cur_ptr; - while (dp->dscr_cmd0 & DSCR_CMD0_V) - ; - ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp); +void auide_outb(u8 addr, unsigned long port) +{ + return (au_writeb(addr, port)); } -#endif +void auide_outbsync(ide_drive_t *drive, u8 addr, unsigned long port) +{ + return (au_writeb(addr, port)); +} -static void auide_tune_drive(ide_drive_t *drive, byte pio) +void auide_outw(u16 addr, unsigned long port) { - int mem_sttime; - int mem_stcfg; - u8 speed; - - /* get the best pio mode for the drive */ - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); - - printk(KERN_INFO "%s: setting Au1XXX IDE to PIO mode%d\n", - drive->name, pio); - - mem_sttime = 0; - mem_stcfg = au_readl(MEM_STCFG2); - - /* set pio mode! */ - switch(pio) { - case 0: - mem_sttime = SBC_IDE_TIMING(PIO0); - - /* set configuration for RCS2# */ - mem_stcfg |= TS_MASK; - mem_stcfg &= ~TCSOE_MASK; - mem_stcfg &= ~TOECS_MASK; - mem_stcfg |= SBC_IDE_PIO0_TCSOE | SBC_IDE_PIO0_TOECS; - break; - - case 1: - mem_sttime = SBC_IDE_TIMING(PIO1); - - /* set configuration for RCS2# */ - mem_stcfg |= TS_MASK; - mem_stcfg &= ~TCSOE_MASK; - mem_stcfg &= ~TOECS_MASK; - mem_stcfg |= SBC_IDE_PIO1_TCSOE | SBC_IDE_PIO1_TOECS; - break; - - case 2: - mem_sttime = SBC_IDE_TIMING(PIO2); - - /* set configuration for RCS2# */ - mem_stcfg &= ~TS_MASK; - mem_stcfg &= ~TCSOE_MASK; - mem_stcfg &= ~TOECS_MASK; - mem_stcfg |= SBC_IDE_PIO2_TCSOE | SBC_IDE_PIO2_TOECS; - break; - - case 3: - mem_sttime = SBC_IDE_TIMING(PIO3); - - /* set configuration for RCS2# */ - mem_stcfg &= ~TS_MASK; - mem_stcfg &= ~TCSOE_MASK; - mem_stcfg &= ~TOECS_MASK; - mem_stcfg |= SBC_IDE_PIO3_TCSOE | SBC_IDE_PIO3_TOECS; - - break; - - case 4: - mem_sttime = SBC_IDE_TIMING(PIO4); - - /* set configuration for RCS2# */ - mem_stcfg &= ~TS_MASK; - mem_stcfg &= ~TCSOE_MASK; - mem_stcfg &= ~TOECS_MASK; - mem_stcfg |= SBC_IDE_PIO4_TCSOE | SBC_IDE_PIO4_TOECS; - break; - } + return (au_writew(addr, port)); +} - au_writel(mem_sttime,MEM_STTIME2); - au_writel(mem_stcfg,MEM_STCFG2); +void auide_outl(u32 addr, unsigned long port) +{ + return (au_writel(addr, port)); +} - speed = pio + XFER_PIO_0; - ide_config_drive_speed(drive, speed); +void auide_outsw(unsigned long port, void *addr, u32 count) +{ +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA) + _auide_hwif *ahwif = &auide_hwif; + chan_tab_t *ctp; + au1x_ddma_desc_t *dp; + + if(!put_source_flags(ahwif->tx_chan, (void*)addr, + count << 1, DDMA_FLAGS_NOIE)) { + printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__); + return; + } + ctp = *((chan_tab_t **)ahwif->tx_chan); + dp = ctp->cur_ptr; + while (dp->dscr_cmd0 & DSCR_CMD0_V) + ; + ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp); +#else + while (count--) + { + au_writew(*(u16 *)addr, port); + addr += 2; + } +#endif } -static int auide_tune_chipset (ide_drive_t *drive, u8 speed) +void auide_outsl(unsigned long port, void *addr, u32 count) +{ + while (count--) + { + au_writel(*(u32 *)addr, port); + /* NOTE: For IDE interfaces over PCMCIA, + * 32-bit access does not work + */ + addr += 4; + } +} + +static void auide_tune_drive(ide_drive_t *drive, byte pio) { - int mem_sttime; - int mem_stcfg; - unsigned long mode; + int mem_sttime; + int mem_stcfg; + unsigned long flags; + u8 speed; + + /* get the best pio mode for the drive */ + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); + + printk("%s: setting Au1XXX IDE to PIO mode%d\n", + drive->name, pio); + + spin_lock_irqsave(&ide_tune_drive_spin_lock, flags); + + mem_sttime = 0; + mem_stcfg = au_readl(MEM_STCFG2); + + /* set pio mode! */ + switch(pio) { + case 0: + /* set timing parameters for RCS2# */ + mem_sttime = SBC_IDE_PIO0_TWCS + | SBC_IDE_PIO0_TCSH + | SBC_IDE_PIO0_TCSOFF + | SBC_IDE_PIO0_TWP + | SBC_IDE_PIO0_TCSW + | SBC_IDE_PIO0_TPM + | SBC_IDE_PIO0_TA; + /* set configuration for RCS2# */ + mem_stcfg |= TS_MASK; + mem_stcfg &= ~TCSOE_MASK; + mem_stcfg &= ~TOECS_MASK; + mem_stcfg |= SBC_IDE_PIO0_TCSOE | SBC_IDE_PIO0_TOECS; + + au_writel(mem_sttime,MEM_STTIME2); + au_writel(mem_stcfg,MEM_STCFG2); + break; + + case 1: + /* set timing parameters for RCS2# */ + mem_sttime = SBC_IDE_PIO1_TWCS + | SBC_IDE_PIO1_TCSH + | SBC_IDE_PIO1_TCSOFF + | SBC_IDE_PIO1_TWP + | SBC_IDE_PIO1_TCSW + | SBC_IDE_PIO1_TPM + | SBC_IDE_PIO1_TA; + /* set configuration for RCS2# */ + mem_stcfg |= TS_MASK; + mem_stcfg &= ~TCSOE_MASK; + mem_stcfg &= ~TOECS_MASK; + mem_stcfg |= SBC_IDE_PIO1_TCSOE | SBC_IDE_PIO1_TOECS; + break; + + case 2: + /* set timing parameters for RCS2# */ + mem_sttime = SBC_IDE_PIO2_TWCS + | SBC_IDE_PIO2_TCSH + | SBC_IDE_PIO2_TCSOFF + | SBC_IDE_PIO2_TWP + | SBC_IDE_PIO2_TCSW + | SBC_IDE_PIO2_TPM + | SBC_IDE_PIO2_TA; + /* set configuration for RCS2# */ + mem_stcfg &= ~TS_MASK; + mem_stcfg &= ~TCSOE_MASK; + mem_stcfg &= ~TOECS_MASK; + mem_stcfg |= SBC_IDE_PIO2_TCSOE | SBC_IDE_PIO2_TOECS; + break; + + case 3: + /* set timing parameters for RCS2# */ + mem_sttime = SBC_IDE_PIO3_TWCS + | SBC_IDE_PIO3_TCSH + | SBC_IDE_PIO3_TCSOFF + | SBC_IDE_PIO3_TWP + | SBC_IDE_PIO3_TCSW + | SBC_IDE_PIO3_TPM + | SBC_IDE_PIO3_TA; + /* set configuration for RCS2# */ + mem_stcfg |= TS_MASK; + mem_stcfg &= ~TS_MASK; + mem_stcfg &= ~TCSOE_MASK; + mem_stcfg &= ~TOECS_MASK; + mem_stcfg |= SBC_IDE_PIO3_TCSOE | SBC_IDE_PIO3_TOECS; + + break; + + case 4: + /* set timing parameters for RCS2# */ + mem_sttime = SBC_IDE_PIO4_TWCS + | SBC_IDE_PIO4_TCSH + | SBC_IDE_PIO4_TCSOFF + | SBC_IDE_PIO4_TWP + | SBC_IDE_PIO4_TCSW + | SBC_IDE_PIO4_TPM + | SBC_IDE_PIO4_TA; + /* set configuration for RCS2# */ + mem_stcfg &= ~TS_MASK; + mem_stcfg &= ~TCSOE_MASK; + mem_stcfg &= ~TOECS_MASK; + mem_stcfg |= SBC_IDE_PIO4_TCSOE | SBC_IDE_PIO4_TOECS; + break; + } + + au_writel(mem_sttime,MEM_STTIME2); + au_writel(mem_stcfg,MEM_STCFG2); + + spin_unlock_irqrestore(&ide_tune_drive_spin_lock, flags); + + speed = pio + XFER_PIO_0; + ide_config_drive_speed(drive, speed); +} +static int auide_tune_chipset (ide_drive_t *drive, u8 speed) +{ + u8 mode = 0; + int mem_sttime; + int mem_stcfg; + unsigned long flags; #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - if (ide_use_dma(drive)) - mode = ide_dma_speed(drive, 0); + struct hd_driveid *id = drive->id; + + /* + * Now see what the current drive is capable of, + * selecting UDMA only if the mate said it was ok. + */ + if (id && (id->capability & 1) && drive->autodma && + !__ide_dma_bad_drive(drive)) { + if (!mode && (id->field_valid & 2) && (id->dma_mword & 7)) { + if (id->dma_mword & 4) + mode = XFER_MW_DMA_2; + else if (id->dma_mword & 2) + mode = XFER_MW_DMA_1; + else if (id->dma_mword & 1) + mode = XFER_MW_DMA_0; + } + } #endif - mem_sttime = 0; - mem_stcfg = au_readl(MEM_STCFG2); + spin_lock_irqsave(&ide_tune_chipset_spin_lock, flags); - if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) { - auide_tune_drive(drive, speed - XFER_PIO_0); - return 0; - } - - switch(speed) { + mem_sttime = 0; + mem_stcfg = au_readl(MEM_STCFG2); + + switch(speed) { + case XFER_PIO_4: + case XFER_PIO_3: + case XFER_PIO_2: + case XFER_PIO_1: + case XFER_PIO_0: + auide_tune_drive(drive, (speed - XFER_PIO_0)); + break; #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - case XFER_MW_DMA_2: - mem_sttime = SBC_IDE_TIMING(MDMA2); - - /* set configuration for RCS2# */ - mem_stcfg &= ~TS_MASK; - mem_stcfg &= ~TCSOE_MASK; - mem_stcfg &= ~TOECS_MASK; - mem_stcfg |= SBC_IDE_MDMA2_TCSOE | SBC_IDE_MDMA2_TOECS; - - mode = XFER_MW_DMA_2; - break; - case XFER_MW_DMA_1: - mem_sttime = SBC_IDE_TIMING(MDMA1); - - /* set configuration for RCS2# */ - mem_stcfg &= ~TS_MASK; - mem_stcfg &= ~TCSOE_MASK; - mem_stcfg &= ~TOECS_MASK; - mem_stcfg |= SBC_IDE_MDMA1_TCSOE | SBC_IDE_MDMA1_TOECS; - - mode = XFER_MW_DMA_1; - break; - case XFER_MW_DMA_0: - mem_sttime = SBC_IDE_TIMING(MDMA0); - - /* set configuration for RCS2# */ - mem_stcfg |= TS_MASK; - mem_stcfg &= ~TCSOE_MASK; - mem_stcfg &= ~TOECS_MASK; - mem_stcfg |= SBC_IDE_MDMA0_TCSOE | SBC_IDE_MDMA0_TOECS; - - mode = XFER_MW_DMA_0; - break; + case XFER_MW_DMA_2: + /* set timing parameters for RCS2# */ + mem_sttime = SBC_IDE_MDMA2_TWCS + | SBC_IDE_MDMA2_TCSH + | SBC_IDE_MDMA2_TCSOFF + | SBC_IDE_MDMA2_TWP + | SBC_IDE_MDMA2_TCSW + | SBC_IDE_MDMA2_TPM + | SBC_IDE_MDMA2_TA; + /* set configuration for RCS2# */ + mem_stcfg &= ~TS_MASK; + mem_stcfg &= ~TCSOE_MASK; + mem_stcfg &= ~TOECS_MASK; + mem_stcfg |= SBC_IDE_MDMA2_TCSOE | SBC_IDE_MDMA2_TOECS; + + mode = XFER_MW_DMA_2; + break; + case XFER_MW_DMA_1: + /* set timing parameters for RCS2# */ + mem_sttime = SBC_IDE_MDMA1_TWCS + | SBC_IDE_MDMA1_TCSH + | SBC_IDE_MDMA1_TCSOFF + | SBC_IDE_MDMA1_TWP + | SBC_IDE_MDMA1_TCSW + | SBC_IDE_MDMA1_TPM + | SBC_IDE_MDMA1_TA; + /* set configuration for RCS2# */ + mem_stcfg &= ~TS_MASK; + mem_stcfg &= ~TCSOE_MASK; + mem_stcfg &= ~TOECS_MASK; + mem_stcfg |= SBC_IDE_MDMA1_TCSOE | SBC_IDE_MDMA1_TOECS; + + mode = XFER_MW_DMA_1; + break; + case XFER_MW_DMA_0: + /* set timing parameters for RCS2# */ + mem_sttime = SBC_IDE_MDMA0_TWCS + | SBC_IDE_MDMA0_TCSH + | SBC_IDE_MDMA0_TCSOFF + | SBC_IDE_MDMA0_TWP + | SBC_IDE_MDMA0_TCSW + | SBC_IDE_MDMA0_TPM + | SBC_IDE_MDMA0_TA; + /* set configuration for RCS2# */ + mem_stcfg |= TS_MASK; + mem_stcfg &= ~TCSOE_MASK; + mem_stcfg &= ~TOECS_MASK; + mem_stcfg |= SBC_IDE_MDMA0_TCSOE | SBC_IDE_MDMA0_TOECS; + + mode = XFER_MW_DMA_0; + break; #endif - default: - return 1; - } - - if (ide_config_drive_speed(drive, mode)) - return 1; + default: + return 1; + } - au_writel(mem_sttime,MEM_STTIME2); - au_writel(mem_stcfg,MEM_STCFG2); + /* + * Tell the drive to switch to the new mode; abort on failure. + */ + if (!mode || ide_config_drive_speed(drive, mode)) + { + return 1; /* failure */ + } - return 0; + + au_writel(mem_sttime,MEM_STTIME2); + au_writel(mem_stcfg,MEM_STCFG2); + + spin_unlock_irqrestore(&ide_tune_chipset_spin_lock, flags); + + return 0; } /* * Multi-Word DMA + DbDMA functions */ - #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA +static int in_drive_list(struct hd_driveid *id, + const struct drive_list_entry *drive_table) +{ + for ( ; drive_table->id_model ; drive_table++){ + if ((!strcmp(drive_table->id_model, id->model)) && + ((strstr(drive_table->id_firmware, id->fw_rev)) || + (!strcmp(drive_table->id_firmware, "ALL"))) + ) + return 1; + } + return 0; +} + static int auide_build_sglist(ide_drive_t *drive, struct request *rq) { - ide_hwif_t *hwif = drive->hwif; - _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; - struct scatterlist *sg = hwif->sg_table; + ide_hwif_t *hwif = drive->hwif; + _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; + struct scatterlist *sg = hwif->sg_table; - ide_map_sg(drive, rq); + ide_map_sg(drive, rq); - if (rq_data_dir(rq) == READ) - hwif->sg_dma_direction = DMA_FROM_DEVICE; - else - hwif->sg_dma_direction = DMA_TO_DEVICE; + if (rq_data_dir(rq) == READ) + hwif->sg_dma_direction = DMA_FROM_DEVICE; + else + hwif->sg_dma_direction = DMA_TO_DEVICE; - return dma_map_sg(ahwif->dev, sg, hwif->sg_nents, - hwif->sg_dma_direction); + return dma_map_sg(ahwif->dev, sg, hwif->sg_nents, + hwif->sg_dma_direction); } static int auide_build_dmatable(ide_drive_t *drive) { - int i, iswrite, count = 0; - ide_hwif_t *hwif = HWIF(drive); - - struct request *rq = HWGROUP(drive)->rq; - - _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; - struct scatterlist *sg; - - iswrite = (rq_data_dir(rq) == WRITE); - /* Save for interrupt context */ - ahwif->drive = drive; - - /* Build sglist */ - hwif->sg_nents = i = auide_build_sglist(drive, rq); - - if (!i) - return 0; - - /* fill the descriptors */ - sg = hwif->sg_table; - while (i && sg_dma_len(sg)) { - u32 cur_addr; - u32 cur_len; - - cur_addr = sg_dma_address(sg); - cur_len = sg_dma_len(sg); - - while (cur_len) { - u32 flags = DDMA_FLAGS_NOIE; - unsigned int tc = (cur_len < 0xfe00)? cur_len: 0xfe00; - - if (++count >= PRD_ENTRIES) { - printk(KERN_WARNING "%s: DMA table too small\n", - drive->name); - goto use_pio_instead; - } - - /* Lets enable intr for the last descriptor only */ - if (1==i) - flags = DDMA_FLAGS_IE; - else - flags = DDMA_FLAGS_NOIE; - - if (iswrite) { - if(!put_source_flags(ahwif->tx_chan, - (void*)(page_address(sg->page) - + sg->offset), - tc, flags)) { - printk(KERN_ERR "%s failed %d\n", - __FUNCTION__, __LINE__); + int i, iswrite, count = 0; + ide_hwif_t *hwif = HWIF(drive); + + struct request *rq = HWGROUP(drive)->rq; + + _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; + struct scatterlist *sg; + + iswrite = (rq_data_dir(rq) == WRITE); + /* Save for interrupt context */ + ahwif->drive = drive; + + /* Build sglist */ + hwif->sg_nents = i = auide_build_sglist(drive, rq); + + if (!i) + return 0; + + /* fill the descriptors */ + sg = hwif->sg_table; + while (i && sg_dma_len(sg)) { + u32 cur_addr; + u32 cur_len; + + cur_addr = sg_dma_address(sg); + cur_len = sg_dma_len(sg); + + while (cur_len) { + u32 flags = DDMA_FLAGS_NOIE; + unsigned int tc = (cur_len < 0xfe00)? cur_len: 0xfe00; + + if (++count >= PRD_ENTRIES) { + printk(KERN_WARNING "%s: DMA table too small\n", + drive->name); + goto use_pio_instead; + } + + /* Lets enable intr for the last descriptor only */ + if (1==i) + flags = DDMA_FLAGS_IE; + else + flags = DDMA_FLAGS_NOIE; + + if (iswrite) { + if(!put_source_flags(ahwif->tx_chan, + (void*)(page_address(sg->page) + + sg->offset), + tc, flags)) { + printk(KERN_ERR "%s failed %d\n", + __FUNCTION__, __LINE__); } - } else + } else { - if(!put_dest_flags(ahwif->rx_chan, - (void*)(page_address(sg->page) - + sg->offset), - tc, flags)) { - printk(KERN_ERR "%s failed %d\n", - __FUNCTION__, __LINE__); + if(!put_dest_flags(ahwif->rx_chan, + (void*)(page_address(sg->page) + + sg->offset), + tc, flags)) { + printk(KERN_ERR "%s failed %d\n", + __FUNCTION__, __LINE__); } - } + } - cur_addr += tc; - cur_len -= tc; - } - sg++; - i--; - } + cur_addr += tc; + cur_len -= tc; + } + sg++; + i--; + } - if (count) - return 1; + if (count) + return 1; - use_pio_instead: - dma_unmap_sg(ahwif->dev, - hwif->sg_table, - hwif->sg_nents, - hwif->sg_dma_direction); +use_pio_instead: + dma_unmap_sg(ahwif->dev, + hwif->sg_table, + hwif->sg_nents, + hwif->sg_dma_direction); - return 0; /* revert to PIO for this request */ + return 0; /* revert to PIO for this request */ } static int auide_dma_end(ide_drive_t *drive) { - ide_hwif_t *hwif = HWIF(drive); - _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; + ide_hwif_t *hwif = HWIF(drive); + _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; - if (hwif->sg_nents) { - dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents, - hwif->sg_dma_direction); - hwif->sg_nents = 0; - } + if (hwif->sg_nents) { + dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents, + hwif->sg_dma_direction); + hwif->sg_nents = 0; + } - return 0; + return 0; } static void auide_dma_start(ide_drive_t *drive ) { +// printk("%s\n", __FUNCTION__); } +ide_startstop_t auide_dma_intr(ide_drive_t *drive) +{ + //printk("%s\n", __FUNCTION__); + + u8 stat = 0, dma_stat = 0; + + dma_stat = HWIF(drive)->ide_dma_end(drive); + stat = HWIF(drive)->INB(IDE_STATUS_REG); /* get drive status */ + if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { + if (!dma_stat) { + struct request *rq = HWGROUP(drive)->rq; + + ide_end_request(drive, 1, rq->nr_sectors); + return ide_stopped; + } + printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", + drive->name, dma_stat); + } + return ide_error(drive, "dma_intr", stat); +} static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command) { - /* issue cmd to drive */ - ide_execute_command(drive, command, &ide_dma_intr, - (2*WAIT_CMD), NULL); + //printk("%s\n", __FUNCTION__); + + /* issue cmd to drive */ + ide_execute_command(drive, command, &auide_dma_intr, + (2*WAIT_CMD), NULL); } static int auide_dma_setup(ide_drive_t *drive) -{ - struct request *rq = HWGROUP(drive)->rq; +{ +// printk("%s\n", __FUNCTION__); - if (!auide_build_dmatable(drive)) { - ide_map_sg(drive, rq); - return 1; - } + if (drive->media != ide_disk) + return 1; - drive->waiting_for_dma = 1; - return 0; + if (!auide_build_dmatable(drive)) + /* try PIO instead of DMA */ + return 1; + + drive->waiting_for_dma = 1; + + return 0; } static int auide_dma_check(ide_drive_t *drive) { - u8 speed; +// printk("%s\n", __FUNCTION__); #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - - if( dbdma_init_done == 0 ){ - auide_hwif.white_list = ide_in_drive_list(drive->id, - dma_white_list); - auide_hwif.black_list = ide_in_drive_list(drive->id, - dma_black_list); - auide_hwif.drive = drive; - auide_ddma_init(&auide_hwif); - dbdma_init_done = 1; - } + if( !dbdma_init_done ){ + auide_hwif.white_list = in_drive_list(drive->id, + dma_white_list); + auide_hwif.black_list = in_drive_list(drive->id, + dma_black_list); + auide_hwif.drive = drive; + auide_ddma_init(&auide_hwif); + dbdma_init_done = 1; + } #endif - /* Is the drive in our DMA black list? */ - - if ( auide_hwif.black_list ) { - drive->using_dma = 0; - - /* Borrowed the warning message from ide-dma.c */ + /* Is the drive in our DMA black list? */ + if ( auide_hwif.black_list ) { + drive->using_dma = 0; + printk("%s found in dma_blacklist[]! Disabling DMA.\n", + drive->id->model); + } + else + drive->using_dma = 1; - printk(KERN_WARNING "%s: Disabling DMA for %s (blacklisted)\n", - drive->name, drive->id->model); - } - else - drive->using_dma = 1; - - speed = ide_find_best_mode(drive, XFER_PIO | XFER_MWDMA); - - if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) - return HWIF(drive)->ide_dma_on(drive); - - return HWIF(drive)->ide_dma_off_quietly(drive); + return HWIF(drive)->ide_dma_host_on(drive); } static int auide_dma_test_irq(ide_drive_t *drive) -{ - if (drive->waiting_for_dma == 0) - printk(KERN_WARNING "%s: ide_dma_test_irq \ +{ +// printk("%s\n", __FUNCTION__); + + if (!drive->waiting_for_dma) + printk(KERN_WARNING "%s: ide_dma_test_irq \ called while not waiting\n", drive->name); - /* If dbdma didn't execute the STOP command yet, the - * active bit is still set + /* If dbdma didn't execute the STOP command yet, the + * active bit is still set */ - drive->waiting_for_dma++; - if (drive->waiting_for_dma >= DMA_WAIT_TIMEOUT) { - printk(KERN_WARNING "%s: timeout waiting for ddma to \ + drive->waiting_for_dma++; + if (drive->waiting_for_dma >= DMA_WAIT_TIMEOUT) { + printk(KERN_WARNING "%s: timeout waiting for ddma to \ complete\n", drive->name); - return 1; - } - udelay(10); - return 0; + return 1; + } + udelay(10); + return 0; } static int auide_dma_host_on(ide_drive_t *drive) { - return 0; +// printk("%s\n", __FUNCTION__); + return 0; } static int auide_dma_on(ide_drive_t *drive) { - drive->using_dma = 1; - return auide_dma_host_on(drive); +// printk("%s\n", __FUNCTION__); + drive->using_dma = 1; + return auide_dma_host_on(drive); } static int auide_dma_host_off(ide_drive_t *drive) { - return 0; +// printk("%s\n", __FUNCTION__); + return 0; } static int auide_dma_off_quietly(ide_drive_t *drive) { - drive->using_dma = 0; - return auide_dma_host_off(drive); +// printk("%s\n", __FUNCTION__); + drive->using_dma = 0; + return auide_dma_host_off(drive); } static int auide_dma_lostirq(ide_drive_t *drive) { - printk(KERN_ERR "%s: IRQ lost\n", drive->name); - return 0; +// printk("%s\n", __FUNCTION__); + + printk(KERN_ERR "%s: IRQ lost\n", drive->name); + return 0; } static void auide_ddma_tx_callback(int irq, void *param, struct pt_regs *regs) { - _auide_hwif *ahwif = (_auide_hwif*)param; - ahwif->drive->waiting_for_dma = 0; +// printk("%s\n", __FUNCTION__); + + _auide_hwif *ahwif = (_auide_hwif*)param; + ahwif->drive->waiting_for_dma = 0; + return; } static void auide_ddma_rx_callback(int irq, void *param, struct pt_regs *regs) { - _auide_hwif *ahwif = (_auide_hwif*)param; - ahwif->drive->waiting_for_dma = 0; -} - -#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ +// printk("%s\n", __FUNCTION__); -static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags) -{ - dev->dev_id = dev_id; - dev->dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; - dev->dev_intlevel = 0; - dev->dev_intpolarity = 0; - dev->dev_tsize = tsize; - dev->dev_devwidth = devwidth; - dev->dev_flags = flags; + _auide_hwif *ahwif = (_auide_hwif*)param; + ahwif->drive->waiting_for_dma = 0; + return; } - -#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) static int auide_dma_timeout(ide_drive_t *drive) { // printk("%s\n", __FUNCTION__); - printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); + printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); - if (HWIF(drive)->ide_dma_test_irq(drive)) - return 0; + if (HWIF(drive)->ide_dma_test_irq(drive)) + return 0; - return HWIF(drive)->ide_dma_end(drive); + return HWIF(drive)->ide_dma_end(drive); } - +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ -static int auide_ddma_init(_auide_hwif *auide) { - - dbdev_tab_t source_dev_tab, target_dev_tab; - u32 dev_id, tsize, devwidth, flags; - ide_hwif_t *hwif = auide->hwif; - dev_id = AU1XXX_ATA_DDMA_REQ; +static int auide_ddma_init( _auide_hwif *auide ) +{ +// printk("%s\n", __FUNCTION__); - if (auide->white_list || auide->black_list) { - tsize = 8; - devwidth = 32; - } - else { - tsize = 1; - devwidth = 16; - - printk(KERN_ERR "au1xxx-ide: %s is not on ide driver whitelist.\n",auide_hwif.drive->id->model); - printk(KERN_ERR " please read 'Documentation/mips/AU1xxx_IDE.README'"); - } + dbdev_tab_t source_dev_tab; +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) + dbdev_tab_t target_dev_tab; + ide_hwif_t *hwif = auide->hwif; + char warning_output [2][80]; + int i; +#endif -#ifdef IDE_AU1XXX_BURSTMODE - flags = DEV_FLAGS_SYNC | DEV_FLAGS_BURSTABLE; + /* Add our custom device to DDMA device table */ + /* Create our new device entries in the table */ +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) + source_dev_tab.dev_id = AU1XXX_ATA_DDMA_REQ; + + if( auide->white_list || auide->black_list ){ + source_dev_tab.dev_tsize = 8; + source_dev_tab.dev_devwidth = 32; + source_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; + source_dev_tab.dev_intlevel = 0; + source_dev_tab.dev_intpolarity = 0; + + /* init device table for target - static bus controller - */ + target_dev_tab.dev_id = DSCR_CMD0_ALWAYS; + target_dev_tab.dev_tsize = 8; + target_dev_tab.dev_devwidth = 32; + target_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; + target_dev_tab.dev_intlevel = 0; + target_dev_tab.dev_intpolarity = 0; + target_dev_tab.dev_flags = DEV_FLAGS_ANYUSE; + } + else{ + source_dev_tab.dev_tsize = 1; + source_dev_tab.dev_devwidth = 16; + source_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; + source_dev_tab.dev_intlevel = 0; + source_dev_tab.dev_intpolarity = 0; + + /* init device table for target - static bus controller - */ + target_dev_tab.dev_id = DSCR_CMD0_ALWAYS; + target_dev_tab.dev_tsize = 1; + target_dev_tab.dev_devwidth = 16; + target_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; + target_dev_tab.dev_intlevel = 0; + target_dev_tab.dev_intpolarity = 0; + target_dev_tab.dev_flags = DEV_FLAGS_ANYUSE; + + sprintf(&warning_output[0][0], + "%s is not on ide driver white list.", + auide_hwif.drive->id->model); + for ( i=strlen(&warning_output[0][0]) ; i<76; i++ ){ + sprintf(&warning_output[0][i]," "); + } + + sprintf(&warning_output[1][0], + "To add %s please read 'Documentation/mips/AU1xxx_IDE.README'.", + auide_hwif.drive->id->model); + for ( i=strlen(&warning_output[1][0]) ; i<76; i++ ){ + sprintf(&warning_output[1][i]," "); + } + + printk("\n****************************************"); + printk("****************************************\n"); + printk("* %s *\n",&warning_output[0][0]); + printk("* Switch to safe MWDMA Mode! "); + printk(" *\n"); + printk("* %s *\n",&warning_output[1][0]); + printk("****************************************"); + printk("****************************************\n\n"); + } #else - flags = DEV_FLAGS_SYNC; + source_dev_tab.dev_id = DSCR_CMD0_ALWAYS; + source_dev_tab.dev_tsize = 8; + source_dev_tab.dev_devwidth = 32; + source_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; + source_dev_tab.dev_intlevel = 0; + source_dev_tab.dev_intpolarity = 0; #endif - /* setup dev_tab for tx channel */ - auide_init_dbdma_dev( &source_dev_tab, - dev_id, - tsize, devwidth, DEV_FLAGS_OUT | flags); - auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); - - auide_init_dbdma_dev( &source_dev_tab, - dev_id, - tsize, devwidth, DEV_FLAGS_IN | flags); - auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); - - /* We also need to add a target device for the DMA */ - auide_init_dbdma_dev( &target_dev_tab, - (u32)DSCR_CMD0_ALWAYS, - tsize, devwidth, DEV_FLAGS_ANYUSE); - auide->target_dev_id = au1xxx_ddma_add_device(&target_dev_tab); - - /* Get a channel for TX */ - auide->tx_chan = au1xxx_dbdma_chan_alloc(auide->target_dev_id, - auide->tx_dev_id, - auide_ddma_tx_callback, - (void*)auide); - - /* Get a channel for RX */ - auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id, - auide->target_dev_id, - auide_ddma_rx_callback, - (void*)auide); - - auide->tx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->tx_chan, - NUM_DESCRIPTORS); - auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan, - NUM_DESCRIPTORS); - - hwif->dmatable_cpu = dma_alloc_coherent(auide->dev, - PRD_ENTRIES * PRD_BYTES, /* 1 Page */ - &hwif->dmatable_dma, GFP_KERNEL); - - au1xxx_dbdma_start( auide->tx_chan ); - au1xxx_dbdma_start( auide->rx_chan ); - - return 0; -} +#if CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON + /* set flags for tx channel */ + source_dev_tab.dev_flags = DEV_FLAGS_OUT + | DEV_FLAGS_SYNC + | DEV_FLAGS_BURSTABLE; + auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); + /* set flags for rx channel */ + source_dev_tab.dev_flags = DEV_FLAGS_IN + | DEV_FLAGS_SYNC + | DEV_FLAGS_BURSTABLE; + auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); #else - -static int auide_ddma_init( _auide_hwif *auide ) -{ - dbdev_tab_t source_dev_tab; - int flags; + /* set flags for tx channel */ + source_dev_tab.dev_flags = DEV_FLAGS_OUT | DEV_FLAGS_SYNC; + auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); + /* set flags for rx channel */ + source_dev_tab.dev_flags = DEV_FLAGS_IN | DEV_FLAGS_SYNC; + auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); +#endif -#ifdef IDE_AU1XXX_BURSTMODE - flags = DEV_FLAGS_SYNC | DEV_FLAGS_BURSTABLE; -#else - flags = DEV_FLAGS_SYNC; +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) + + auide->target_dev_id = au1xxx_ddma_add_device(&target_dev_tab); + + /* Get a channel for TX */ + auide->tx_chan = au1xxx_dbdma_chan_alloc(auide->target_dev_id, + auide->tx_dev_id, + auide_ddma_tx_callback, + (void*)auide); + /* Get a channel for RX */ + auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id, + auide->target_dev_id, + auide_ddma_rx_callback, + (void*)auide); +#else /* CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA */ + /* + * Note: if call back is not enabled, update ctp->cur_ptr manually + */ + auide->tx_chan = au1xxx_dbdma_chan_alloc(DSCR_CMD0_ALWAYS, + auide->tx_dev_id, + NULL, + (void*)auide); + auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id, + DSCR_CMD0_ALWAYS, + NULL, + (void*)auide); #endif + auide->tx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->tx_chan, + NUM_DESCRIPTORS); + auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan, + NUM_DESCRIPTORS); - /* setup dev_tab for tx channel */ - auide_init_dbdma_dev( &source_dev_tab, - (u32)DSCR_CMD0_ALWAYS, - 8, 32, DEV_FLAGS_OUT | flags); - auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); - - auide_init_dbdma_dev( &source_dev_tab, - (u32)DSCR_CMD0_ALWAYS, - 8, 32, DEV_FLAGS_IN | flags); - auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); - - /* Get a channel for TX */ - auide->tx_chan = au1xxx_dbdma_chan_alloc(DSCR_CMD0_ALWAYS, - auide->tx_dev_id, - NULL, - (void*)auide); - - /* Get a channel for RX */ - auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id, - DSCR_CMD0_ALWAYS, - NULL, - (void*)auide); - - auide->tx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->tx_chan, - NUM_DESCRIPTORS); - auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan, - NUM_DESCRIPTORS); - - au1xxx_dbdma_start( auide->tx_chan ); - au1xxx_dbdma_start( auide->rx_chan ); - - return 0; -} +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) + hwif->dmatable_cpu = dma_alloc_coherent(auide->dev, + PRD_ENTRIES * PRD_BYTES, /* 1 Page */ + &hwif->dmatable_dma, GFP_KERNEL); + + auide->sg_table = kmalloc(sizeof(struct scatterlist) * PRD_ENTRIES, + GFP_KERNEL|GFP_DMA); + if (auide->sg_table == NULL) { + return -ENOMEM; + } #endif + au1xxx_dbdma_start( auide->tx_chan ); + au1xxx_dbdma_start( auide->rx_chan ); + return 0; +} static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif) { - int i; - unsigned long *ata_regs = hw->io_ports; - - /* FIXME? */ - for (i = 0; i < IDE_CONTROL_OFFSET; i++) { - *ata_regs++ = ahwif->regbase + (i << AU1XXX_ATA_REG_OFFSET); - } - - /* set the Alternative Status register */ - *ata_regs = ahwif->regbase + (14 << AU1XXX_ATA_REG_OFFSET); + int i; +#define ide_ioreg_t unsigned long + ide_ioreg_t *ata_regs = hw->io_ports; + + /* fixme */ + for (i = 0; i < IDE_CONTROL_OFFSET; i++) { + *ata_regs++ = (ide_ioreg_t) ahwif->regbase + + (ide_ioreg_t)(i << AU1XXX_ATA_REG_OFFSET); + } + + /* set the Alternative Status register */ + *ata_regs = (ide_ioreg_t) ahwif->regbase + + (ide_ioreg_t)(14 << AU1XXX_ATA_REG_OFFSET); } static int au_ide_probe(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); - _auide_hwif *ahwif = &auide_hwif; - ide_hwif_t *hwif; + _auide_hwif *ahwif = &auide_hwif; + ide_hwif_t *hwif; struct resource *res; int ret = 0; #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) - char *mode = "MWDMA2"; + char *mode = "MWDMA2"; #elif defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA) - char *mode = "PIO+DDMA(offload)"; + char *mode = "PIO+DDMA(offload)"; #endif - memset(&auide_hwif, 0, sizeof(_auide_hwif)); - auide_hwif.dev = 0; + memset(&auide_hwif, 0, sizeof(_auide_hwif)); + auide_hwif.dev = 0; ahwif->dev = dev; ahwif->irq = platform_get_irq(pdev, 0); @@ -675,11 +902,11 @@ static int au_ide_probe(struct device *dev) goto out; } - if (!request_mem_region (res->start, res->end-res->start, pdev->name)) { + if (!request_mem_region (res->start, res->end-res->start, pdev->name)) { pr_debug("%s: request_mem_region failed\n", DRV_NAME); - ret = -EBUSY; + ret = -EBUSY; goto out; - } + } ahwif->regbase = (u32)ioremap(res->start, res->end-res->start); if (ahwif->regbase == 0) { @@ -687,92 +914,130 @@ static int au_ide_probe(struct device *dev) goto out; } - /* FIXME: This might possibly break PCMCIA IDE devices */ - - hwif = &ide_hwifs[pdev->id]; + hwif = &ide_hwifs[pdev->id]; hw_regs_t *hw = &hwif->hw; - hwif->irq = hw->irq = ahwif->irq; - hwif->chipset = ide_au1xxx; + hwif->irq = hw->irq = ahwif->irq; + hwif->chipset = ide_au1xxx; - auide_setup_ports(hw, ahwif); + auide_setup_ports(hw, ahwif); memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports)); - hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ -#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - hwif->mwdma_mask = 0x07; /* Multimode-2 DMA */ - hwif->swdma_mask = 0x00; -#else - hwif->mwdma_mask = 0x0; - hwif->swdma_mask = 0x0; +#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ + hwif->rqsize = CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ; + hwif->rqsize = ((hwif->rqsize > AU1XXX_ATA_RQSIZE) + || (hwif->rqsize < 32)) ? AU1XXX_ATA_RQSIZE : hwif->rqsize; +#else /* if kernel config is not set */ + hwif->rqsize = AU1XXX_ATA_RQSIZE; #endif - hwif->noprobe = 0; - hwif->drives[0].unmask = 1; - hwif->drives[1].unmask = 1; - - /* hold should be on in all cases */ - hwif->hold = 1; - hwif->mmio = 2; - - /* If the user has selected DDMA assisted copies, - then set up a few local I/O function entry points - */ - -#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA - hwif->INSW = auide_insw; - hwif->OUTSW = auide_outsw; + hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ +#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA + hwif->mwdma_mask = 0x07; /* Multimode-2 DMA */ + hwif->swdma_mask = 0x07; +#else + hwif->mwdma_mask = 0x0; + hwif->swdma_mask = 0x0; #endif - - hwif->tuneproc = &auide_tune_drive; - hwif->speedproc = &auide_tune_chipset; + //hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; + hwif->noprobe = 0; + hwif->drives[0].unmask = 1; + hwif->drives[1].unmask = 1; + + /* hold should be on in all cases */ + hwif->hold = 1; + hwif->mmio = 2; + + /* set up local I/O function entry points */ + hwif->INB = auide_inb; + hwif->INW = auide_inw; + hwif->INL = auide_inl; + hwif->INSW = auide_insw; + hwif->INSL = auide_insl; + hwif->OUTB = auide_outb; + hwif->OUTBSYNC = auide_outbsync; + hwif->OUTW = auide_outw; + hwif->OUTL = auide_outl; + hwif->OUTSW = auide_outsw; + hwif->OUTSL = auide_outsl; + + hwif->tuneproc = &auide_tune_drive; + hwif->speedproc = &auide_tune_chipset; #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - hwif->ide_dma_off_quietly = &auide_dma_off_quietly; - hwif->ide_dma_timeout = &auide_dma_timeout; - - hwif->ide_dma_check = &auide_dma_check; - hwif->dma_exec_cmd = &auide_dma_exec_cmd; - hwif->dma_start = &auide_dma_start; - hwif->ide_dma_end = &auide_dma_end; - hwif->dma_setup = &auide_dma_setup; - hwif->ide_dma_test_irq = &auide_dma_test_irq; - hwif->ide_dma_host_off = &auide_dma_host_off; - hwif->ide_dma_host_on = &auide_dma_host_on; - hwif->ide_dma_lostirq = &auide_dma_lostirq; - hwif->ide_dma_on = &auide_dma_on; - - hwif->autodma = 1; - hwif->drives[0].autodma = hwif->autodma; - hwif->drives[1].autodma = hwif->autodma; - hwif->atapi_dma = 1; - + hwif->ide_dma_off_quietly = &auide_dma_off_quietly; + hwif->ide_dma_timeout = &auide_dma_timeout; + + hwif->ide_dma_check = &auide_dma_check; + hwif->dma_exec_cmd = &auide_dma_exec_cmd; + hwif->dma_start = &auide_dma_start; + hwif->ide_dma_end = &auide_dma_end; + hwif->dma_setup = &auide_dma_setup; + hwif->ide_dma_test_irq = &auide_dma_test_irq; + hwif->ide_dma_host_off = &auide_dma_host_off; + hwif->ide_dma_host_on = &auide_dma_host_on; + hwif->ide_dma_lostirq = &auide_dma_lostirq; + hwif->ide_dma_on = &auide_dma_on; + + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->autodma; + hwif->drives[1].autodma = hwif->autodma; + hwif->atapi_dma = 1; + hwif->drives[0].using_dma = 1; + hwif->drives[1].using_dma = 1; #else /* !CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ - hwif->autodma = 0; - hwif->channel = 0; - hwif->hold = 1; - hwif->select_data = 0; /* no chipset-specific code */ - hwif->config_data = 0; /* no chipset-specific code */ - - hwif->drives[0].autodma = 0; - hwif->drives[0].autotune = 1; /* 1=autotune, 2=noautotune, 0=default */ + hwif->autodma = 0; + hwif->channel = 0; + hwif->hold = 1; + hwif->select_data = 0; /* no chipset-specific code */ + hwif->config_data = 0; /* no chipset-specific code */ + + hwif->drives[0].autodma = 0; + hwif->drives[0].drive_data = 0; /* no drive data */ + hwif->drives[0].using_dma = 0; + hwif->drives[0].waiting_for_dma = 0; + hwif->drives[0].autotune = 1; /* 1=autotune, 2=noautotune, 0=default */ + /* secondary hdd not supported */ + hwif->drives[1].autodma = 0; + + hwif->drives[1].drive_data = 0; + hwif->drives[1].using_dma = 0; + hwif->drives[1].waiting_for_dma = 0; + hwif->drives[1].autotune = 2; /* 1=autotune, 2=noautotune, 0=default */ +#endif + hwif->drives[0].io_32bit = 0; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ + hwif->drives[1].io_32bit = 0; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ + + /*Register Driver with PM Framework*/ +#ifdef CONFIG_PM + auide_hwif.pm.lock = SPIN_LOCK_UNLOCKED; + auide_hwif.pm.stopped = 0; + + auide_hwif.pm.dev = new_au1xxx_power_device( "ide", + &au1200ide_pm_callback, + NULL); + if ( auide_hwif.pm.dev == NULL ) + printk(KERN_INFO "Unable to create a power management \ + device entry for the au1200-IDE.\n"); + else + printk(KERN_INFO "Power management device entry for the \ + au1200-IDE loaded.\n"); #endif - hwif->drives[0].no_io_32bit = 1; - auide_hwif.hwif = hwif; - hwif->hwif_data = &auide_hwif; + auide_hwif.hwif = hwif; + hwif->hwif_data = &auide_hwif; -#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA - auide_ddma_init(&auide_hwif); - dbdma_init_done = 1; +#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA + auide_ddma_init(&auide_hwif); + dbdma_init_done = 1; #endif probe_hwif_init(hwif); dev_set_drvdata(dev, hwif); - printk(KERN_INFO "Au1xxx IDE(builtin) configured for %s\n", mode ); + printk(KERN_INFO "Au1xxx IDE(builtin) configured for %s\n", mode ); - out: - return ret; +out: + return ret; } static int au_ide_remove(struct device *dev) @@ -780,7 +1045,7 @@ static int au_ide_remove(struct device *dev) struct platform_device *pdev = to_platform_device(dev); struct resource *res; ide_hwif_t *hwif = dev_get_drvdata(dev); - _auide_hwif *ahwif = &auide_hwif; + _auide_hwif *ahwif = &auide_hwif; ide_unregister(hwif - ide_hwifs); @@ -804,11 +1069,180 @@ static int __init au_ide_init(void) return driver_register(&au1200_ide_driver); } -static void __exit au_ide_exit(void) +static void __init au_ide_exit(void) { driver_unregister(&au1200_ide_driver); } +#ifdef CONFIG_PM +int au1200ide_pm_callback( au1xxx_power_dev_t *dev,\ + au1xxx_request_t request, void *data) { + + unsigned int d, err = 0; + unsigned long flags; + + spin_lock_irqsave(auide_hwif.pm.lock, flags); + + switch (request){ + case AU1XXX_PM_SLEEP: + err = au1xxxide_pm_sleep(dev); + break; + case AU1XXX_PM_WAKEUP: + d = *((unsigned int*)data); + if ( d > 0 && d <= 99) { + err = au1xxxide_pm_standby(dev); + } + else { + err = au1xxxide_pm_resume(dev); + } + break; + case AU1XXX_PM_GETSTATUS: + err = au1xxxide_pm_getstatus(dev); + break; + case AU1XXX_PM_ACCESS: + err = au1xxxide_pm_access(dev); + break; + case AU1XXX_PM_IDLE: + err = au1xxxide_pm_idle(dev); + break; + case AU1XXX_PM_CLEANUP: + err = au1xxxide_pm_cleanup(dev); + break; + default: + err = -1; + break; + } + + spin_unlock_irqrestore(auide_hwif.pm.lock, flags); + + return err; +} + +static int au1xxxide_pm_standby( au1xxx_power_dev_t *dev ) { + return 0; +} + +static int au1xxxide_pm_sleep( au1xxx_power_dev_t *dev ) { + + int retval; + ide_hwif_t *hwif = auide_hwif.hwif; + struct request rq; + struct request_pm_state rqpm; + ide_task_t args; + + if(auide_hwif.pm.stopped) + return -1; + + /* + * wait until hard disc is ready + */ + if ( wait_for_ready(&hwif->drives[0], 35000) ) { + printk("Wait for drive sleep timeout!\n"); + retval = -1; + } + + /* + * sequenz to tell the high level ide driver that pm is resuming + */ + memset(&rq, 0, sizeof(rq)); + memset(&rqpm, 0, sizeof(rqpm)); + memset(&args, 0, sizeof(args)); + rq.flags = REQ_PM_SUSPEND; + rq.special = &args; + rq.pm = &rqpm; + rqpm.pm_step = ide_pm_state_start_suspend; + rqpm.pm_state = PMSG_SUSPEND; + + retval = ide_do_drive_cmd(&hwif->drives[0], &rq, ide_wait); + + if (wait_for_ready (&hwif->drives[0], 35000)) { + printk("Wait for drive sleep timeout!\n"); + retval = -1; + } + + /* + * stop dbdma channels + */ + au1xxx_dbdma_reset(auide_hwif.tx_chan); + au1xxx_dbdma_reset(auide_hwif.rx_chan); + + auide_hwif.pm.stopped = 1; + + return retval; +} + +static int au1xxxide_pm_resume( au1xxx_power_dev_t *dev ) { + + int retval; + ide_hwif_t *hwif = auide_hwif.hwif; + struct request rq; + struct request_pm_state rqpm; + ide_task_t args; + + if(!auide_hwif.pm.stopped) + return -1; + + /* + * start dbdma channels + */ + au1xxx_dbdma_start(auide_hwif.tx_chan); + au1xxx_dbdma_start(auide_hwif.rx_chan); + + /* + * wait until hard disc is ready + */ + if (wait_for_ready ( &hwif->drives[0], 35000)) { + printk("Wait for drive wake up timeout!\n"); + retval = -1; + } + + /* + * sequenz to tell the high level ide driver that pm is resuming + */ + memset(&rq, 0, sizeof(rq)); + memset(&rqpm, 0, sizeof(rqpm)); + memset(&args, 0, sizeof(args)); + rq.flags = REQ_PM_RESUME; + rq.special = &args; + rq.pm = &rqpm; + rqpm.pm_step = ide_pm_state_start_resume; + rqpm.pm_state = PMSG_ON; + + retval = ide_do_drive_cmd(&hwif->drives[0], &rq, ide_head_wait); + + /* + * wait for hard disc + */ + if ( wait_for_ready(&hwif->drives[0], 35000) ) { + printk("Wait for drive wake up timeout!\n"); + retval = -1; + } + + auide_hwif.pm.stopped = 0; + + return retval; +} + +static int au1xxxide_pm_getstatus( au1xxx_power_dev_t *dev ) { + return dev->cur_state; +} + +static int au1xxxide_pm_access( au1xxx_power_dev_t *dev ) { + if (dev->cur_state != AWAKE_STATE) + return 0; + else + return -1; +} + +static int au1xxxide_pm_idle( au1xxx_power_dev_t *dev ) { + return 0; +} + +static int au1xxxide_pm_cleanup( au1xxx_power_dev_t *dev ) { + return 0; +} +#endif /* CONFIG_PM */ + MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("AU1200 IDE driver"); diff --git a/trunk/drivers/ide/mips/swarm.c b/trunk/drivers/ide/mips/swarm.c deleted file mode 100644 index 66f6064f4640..000000000000 --- a/trunk/drivers/ide/mips/swarm.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (C) 2001, 2002, 2003 Broadcom Corporation - * Copyright (C) 2004 MontaVista Software Inc. - * Author: Manish Lachwani, mlachwani@mvista.com - * Copyright (C) 2004 MIPS Technologies, Inc. All rights reserved. - * Author: Maciej W. Rozycki - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/* - * Derived loosely from ide-pmac.c, so: - * Copyright (C) 1998 Paul Mackerras. - * Copyright (C) 1995-1998 Mark Lord - */ - -/* - * Boards with SiByte processors so far have supported IDE devices via - * the Generic Bus, PCI bus, and built-in PCMCIA interface. In all - * cases, byte-swapping must be avoided for these devices (whereas - * other PCI devices, for example, will require swapping). Any - * SiByte-targetted kernel including IDE support will include this - * file. Probing of a Generic Bus for an IDE device is controlled by - * the definition of "SIBYTE_HAVE_IDE", which is provided by - * for Broadcom boards. - */ - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#define DRV_NAME "ide-swarm" - -static char swarm_ide_string[] = DRV_NAME; - -static struct resource swarm_ide_resource = { - .name = "SWARM GenBus IDE", - .flags = IORESOURCE_MEM, -}; - -static struct platform_device *swarm_ide_dev; - -/* - * swarm_ide_probe - if the board header indicates the existence of - * Generic Bus IDE, allocate a HWIF for it. - */ -static int __devinit swarm_ide_probe(struct device *dev) -{ - ide_hwif_t *hwif; - u8 __iomem *base; - phys_t offset, size; - int i; - - if (!SIBYTE_HAVE_IDE) - return -ENODEV; - - /* Find an empty slot. */ - for (i = 0; i < MAX_HWIFS; i++) - if (!ide_hwifs[i].io_ports[IDE_DATA_OFFSET]) - break; - if (i >= MAX_HWIFS) { - printk(KERN_ERR DRV_NAME ": no free slot for interface\n"); - return -ENOMEM; - } - - hwif = ide_hwifs + i; - - base = ioremap(A_IO_EXT_BASE, 0x800); - offset = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_START_ADDR, IDE_CS)); - size = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_MULT_SIZE, IDE_CS)); - iounmap(base); - - offset = G_IO_START_ADDR(offset) << S_IO_ADDRBASE; - size = (G_IO_MULT_SIZE(size) + 1) << S_IO_REGSIZE; - if (offset < A_PHYS_GENBUS || offset >= A_PHYS_GENBUS_END) { - printk(KERN_INFO DRV_NAME - ": IDE interface at GenBus disabled\n"); - return -EBUSY; - } - - printk(KERN_INFO DRV_NAME ": IDE interface at GenBus slot %i\n", - IDE_CS); - - swarm_ide_resource.start = offset; - swarm_ide_resource.end = offset + size - 1; - if (request_resource(&iomem_resource, &swarm_ide_resource)) { - printk(KERN_ERR DRV_NAME - ": can't request I/O memory resource\n"); - return -EBUSY; - } - - base = ioremap(offset, size); - - /* Setup MMIO ops. */ - default_hwif_mmiops(hwif); - /* Prevent resource map manipulation. */ - hwif->mmio = 2; - hwif->noprobe = 0; - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) - hwif->hw.io_ports[i] = - (unsigned long)(base + ((0x1f0 + i) << 5)); - hwif->hw.io_ports[IDE_CONTROL_OFFSET] = - (unsigned long)(base + (0x3f6 << 5)); - hwif->hw.irq = K_INT_GB_IDE; - - memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); - hwif->irq = hwif->hw.irq; - - dev_set_drvdata(dev, hwif); - - return 0; -} - -static struct device_driver swarm_ide_driver = { - .name = swarm_ide_string, - .bus = &platform_bus_type, - .probe = swarm_ide_probe, -}; - -static void swarm_ide_platform_release(struct device *device) -{ - struct platform_device *pldev; - - /* free device */ - pldev = to_platform_device(device); - kfree(pldev); -} - -static int __devinit swarm_ide_init_module(void) -{ - struct platform_device *pldev; - int err; - - printk(KERN_INFO "SWARM IDE driver\n"); - - if (driver_register(&swarm_ide_driver)) { - printk(KERN_ERR "Driver registration failed\n"); - err = -ENODEV; - goto out; - } - - if (!(pldev = kmalloc(sizeof (*pldev), GFP_KERNEL))) { - err = -ENOMEM; - goto out_unregister_driver; - } - - memset (pldev, 0, sizeof (*pldev)); - pldev->name = swarm_ide_string; - pldev->id = 0; - pldev->dev.release = swarm_ide_platform_release; - - if (platform_device_register(pldev)) { - err = -ENODEV; - goto out_free_pldev; - } - - if (!pldev->dev.driver) { - /* - * The driver was not bound to this device, there was - * no hardware at this address. Unregister it, as the - * release fuction will take care of freeing the - * allocated structure - */ - platform_device_unregister (pldev); - } - - swarm_ide_dev = pldev; - - return 0; - -out_free_pldev: - kfree(pldev); - -out_unregister_driver: - driver_unregister(&swarm_ide_driver); -out: - return err; -} - -module_init(swarm_ide_init_module); diff --git a/trunk/drivers/ide/pci/aec62xx.c b/trunk/drivers/ide/pci/aec62xx.c index a21b1e11eef4..52cadc005d72 100644 --- a/trunk/drivers/ide/pci/aec62xx.c +++ b/trunk/drivers/ide/pci/aec62xx.c @@ -65,6 +65,23 @@ static struct chipset_bus_clock_list_entry aec6xxx_34_base [] = { #define BUSCLOCK(D) \ ((struct chipset_bus_clock_list_entry *) pci_get_drvdata((D))) +#if 0 + if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) { + (void) pci_read_config_byte(dev, 0x54, &art); + p += sprintf(p, "DMA Mode: %s(%s)", + (c0&0x20)?((art&0x03)?"UDMA":" DMA"):" PIO", + (art&0x02)?"2":(art&0x01)?"1":"0"); + p += sprintf(p, " %s(%s)", + (c0&0x40)?((art&0x0c)?"UDMA":" DMA"):" PIO", + (art&0x08)?"2":(art&0x04)?"1":"0"); + p += sprintf(p, " %s(%s)", + (c1&0x20)?((art&0x30)?"UDMA":" DMA"):" PIO", + (art&0x20)?"2":(art&0x10)?"1":"0"); + p += sprintf(p, " %s(%s)\n", + (c1&0x40)?((art&0xc0)?"UDMA":" DMA"):" PIO", + (art&0x80)?"2":(art&0x40)?"1":"0"); + } else { +#endif /* * TO DO: active tuning and correction of cards without a bios. @@ -95,9 +112,13 @@ static u8 aec62xx_ratemask (ide_drive_t *drive) switch(hwif->pci_dev->device) { case PCI_DEVICE_ID_ARTOP_ATP865: case PCI_DEVICE_ID_ARTOP_ATP865R: +#if 0 + mode = (hwif->INB(hwif->dma_master) & 0x10) ? 4 : 3; +#else mode = (hwif->INB(((hwif->channel) ? hwif->mate->dma_status : hwif->dma_status)) & 0x10) ? 4 : 3; +#endif break; case PCI_DEVICE_ID_ARTOP_ATP860: case PCI_DEVICE_ID_ARTOP_ATP860R: @@ -242,9 +263,35 @@ static int aec62xx_irq_timeout (ide_drive_t *drive) case PCI_DEVICE_ID_ARTOP_ATP865: case PCI_DEVICE_ID_ARTOP_ATP865R: printk(" AEC62XX time out "); +#if 0 + { + int i = 0; + u8 reg49h = 0; + pci_read_config_byte(HWIF(drive)->pci_dev, 0x49, ®49h); + for (i=0;i<256;i++) + pci_write_config_byte(HWIF(drive)->pci_dev, 0x49, reg49h|0x10); + pci_write_config_byte(HWIF(drive)->pci_dev, 0x49, reg49h & ~0x10); + } + return 0; +#endif default: break; } +#if 0 + { + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 tmp1 = 0, tmp2 = 0, mode6 = 0; + + pci_read_config_byte(dev, 0x44, &tmp1); + pci_read_config_byte(dev, 0x45, &tmp2); + printk(" AEC6280 r44=%x r45=%x ",tmp1,tmp2); + mode6 = HWIF(drive)->INB(((hwif->channel) ? + hwif->mate->dma_status : + hwif->dma_status)); + printk(" AEC6280 133=%x ", (mode6 & 0x10)); + } +#endif return 0; } diff --git a/trunk/drivers/ide/pci/alim15x3.c b/trunk/drivers/ide/pci/alim15x3.c index cf84350efc55..6cf49394a80f 100644 --- a/trunk/drivers/ide/pci/alim15x3.c +++ b/trunk/drivers/ide/pci/alim15x3.c @@ -876,15 +876,10 @@ static ide_pci_device_t ali15x3_chipset __devinitdata = { static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_device_id *id) { - static struct pci_device_id ati_rs100[] = { - { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS100) }, - { }, - }; - ide_pci_device_t *d = &ali15x3_chipset; - if (pci_dev_present(ati_rs100)) - printk(KERN_WARNING "alim15x3: ATI Radeon IGP Northbridge is not yet fully tested.\n"); + if(pci_find_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS100, NULL)) + printk(KERN_ERR "Warning: ATI Radeon IGP Northbridge is not yet fully tested.\n"); #if defined(CONFIG_SPARC64) d->init_hwif = init_hwif_common_ali15x3; diff --git a/trunk/drivers/ide/pci/cs5520.c b/trunk/drivers/ide/pci/cs5520.c index ea3c52cc8ac1..7dc24682d197 100644 --- a/trunk/drivers/ide/pci/cs5520.c +++ b/trunk/drivers/ide/pci/cs5520.c @@ -222,9 +222,10 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic /* We must not grab the entire device, it has 'ISA' space in its BARS too and we will freak out other bits of the kernel */ - if (pci_enable_device_bars(dev, 1<<2)) { + if(pci_enable_device_bars(dev, 1<<2)) + { printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name); - return -ENODEV; + return 1; } pci_set_master(dev); if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) { diff --git a/trunk/drivers/ide/pci/sgiioc4.c b/trunk/drivers/ide/pci/sgiioc4.c index 4ee597d08797..af526b671c4e 100644 --- a/trunk/drivers/ide/pci/sgiioc4.c +++ b/trunk/drivers/ide/pci/sgiioc4.c @@ -622,18 +622,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d) ide_hwif_t *hwif; int h; - /* - * Find an empty HWIF; if none available, return -ENOMEM. - */ for (h = 0; h < MAX_HWIFS; ++h) { hwif = &ide_hwifs[h]; + /* Find an empty HWIF */ if (hwif->chipset == ide_unknown) break; } - if (h == MAX_HWIFS) { - printk(KERN_ERR "%s: too many IDE interfaces, no room in table\n", d->name); - return -ENOMEM; - } /* Get the CmdBlk and CtrlBlk Base Registers */ base = pci_resource_start(dev, 0) + IOC4_CMD_OFFSET; diff --git a/trunk/drivers/ide/pci/siimage.c b/trunk/drivers/ide/pci/siimage.c index f1ca154dd52c..022d244f2eb0 100644 --- a/trunk/drivers/ide/pci/siimage.c +++ b/trunk/drivers/ide/pci/siimage.c @@ -6,13 +6,7 @@ * * May be copied or modified under the terms of the GNU General Public License * - * Documentation for CMD680: - * http://gkernel.sourceforge.net/specs/sii/sii-0680a-v1.31.pdf.bz2 - * - * Documentation for SiI 3112: - * http://gkernel.sourceforge.net/specs/sii/3112A_SiI-DS-0095-B2.pdf.bz2 - * - * Errata and other documentation only available under NDA. + * Documentation available under NDA only * * * FAQ Items: diff --git a/trunk/drivers/ide/pci/sis5513.c b/trunk/drivers/ide/pci/sis5513.c index 75a2253a3e68..16b3e2d8bfb1 100644 --- a/trunk/drivers/ide/pci/sis5513.c +++ b/trunk/drivers/ide/pci/sis5513.c @@ -87,7 +87,6 @@ static const struct { u8 chipset_family; u8 flags; } SiSHostChipInfo[] = { - { "SiS965", PCI_DEVICE_ID_SI_965, ATA_133 }, { "SiS745", PCI_DEVICE_ID_SI_745, ATA_100 }, { "SiS735", PCI_DEVICE_ID_SI_735, ATA_100 }, { "SiS733", PCI_DEVICE_ID_SI_733, ATA_100 }, diff --git a/trunk/drivers/ide/pci/sl82c105.c b/trunk/drivers/ide/pci/sl82c105.c index 8a5c7b286b2b..ea0806c82be0 100644 --- a/trunk/drivers/ide/pci/sl82c105.c +++ b/trunk/drivers/ide/pci/sl82c105.c @@ -399,6 +399,34 @@ static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const c return dev->irq; } +static void __devinit init_dma_sl82c105(ide_hwif_t *hwif, unsigned long dma_base) +{ + unsigned int rev; + u8 dma_state; + + DBG(("init_dma_sl82c105(hwif: ide%d, dma_base: 0x%08x)\n", hwif->index, dma_base)); + + hwif->autodma = 0; + + if (!dma_base) + return; + + dma_state = hwif->INB(dma_base + 2); + rev = sl82c105_bridge_revision(hwif->pci_dev); + if (rev <= 5) { + printk(" %s: Winbond 553 bridge revision %d, BM-DMA disabled\n", + hwif->name, rev); + dma_state &= ~0x60; + } else { + dma_state |= 0x60; + if (!noautodma) + hwif->autodma = 1; + } + hwif->OUTB(dma_state, dma_base + 2); + + ide_setup_dma(hwif, dma_base, 8); +} + /* * Initialise the chip */ @@ -406,8 +434,6 @@ static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const c static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif) { struct pci_dev *dev = hwif->pci_dev; - unsigned int rev; - u8 dma_state; u32 val; DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index)); @@ -429,54 +455,33 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif) pci_read_config_dword(dev, 0x40, &val); *((u32 *)&hwif->hwif_data) = val; - hwif->atapi_dma = 0; - hwif->mwdma_mask = 0; - hwif->swdma_mask = 0; - hwif->autodma = 0; - if (!hwif->dma_base) return; - dma_state = hwif->INB(hwif->dma_base + 2) & ~0x60; - rev = sl82c105_bridge_revision(hwif->pci_dev); - if (rev <= 5) { - /* - * Never ever EVER under any circumstances enable - * DMA when the bridge is this old. - */ - printk(" %s: Winbond 553 bridge revision %d, BM-DMA disabled\n", - hwif->name, rev); - } else { -#ifdef CONFIG_BLK_DEV_IDEDMA - dma_state |= 0x60; - - hwif->atapi_dma = 1; - hwif->mwdma_mask = 0x07; - hwif->swdma_mask = 0x07; - - hwif->ide_dma_check = &sl82c105_check_drive; - hwif->ide_dma_on = &sl82c105_ide_dma_on; - hwif->ide_dma_off_quietly = &sl82c105_ide_dma_off_quietly; - hwif->ide_dma_lostirq = &sl82c105_ide_dma_lost_irq; - hwif->dma_start = &sl82c105_ide_dma_start; - hwif->ide_dma_timeout = &sl82c105_ide_dma_timeout; + hwif->atapi_dma = 1; + hwif->mwdma_mask = 0x07; + hwif->swdma_mask = 0x07; - if (!noautodma) - hwif->autodma = 1; - hwif->drives[0].autodma = hwif->autodma; - hwif->drives[1].autodma = hwif->autodma; - - if (hwif->mate) - hwif->serialized = hwif->mate->serialized = 1; +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_check = &sl82c105_check_drive; + hwif->ide_dma_on = &sl82c105_ide_dma_on; + hwif->ide_dma_off_quietly = &sl82c105_ide_dma_off_quietly; + hwif->ide_dma_lostirq = &sl82c105_ide_dma_lost_irq; + hwif->dma_start = &sl82c105_ide_dma_start; + hwif->ide_dma_timeout = &sl82c105_ide_dma_timeout; + + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->autodma; + hwif->drives[1].autodma = hwif->autodma; #endif /* CONFIG_BLK_DEV_IDEDMA */ - } - hwif->OUTB(dma_state, hwif->dma_base + 2); } static ide_pci_device_t sl82c105_chipset __devinitdata = { .name = "W82C105", .init_chipset = init_chipset_sl82c105, .init_hwif = init_hwif_sl82c105, + .init_dma = init_dma_sl82c105, .channels = 2, .autodma = NOAUTODMA, .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}}, diff --git a/trunk/drivers/ide/pci/via82cxxx.c b/trunk/drivers/ide/pci/via82cxxx.c index 86fb1e0286d3..a4d099c937ff 100644 --- a/trunk/drivers/ide/pci/via82cxxx.c +++ b/trunk/drivers/ide/pci/via82cxxx.c @@ -79,8 +79,6 @@ static struct via_isa_bridge { u8 rev_max; u16 flags; } via_isa_bridges[] = { - { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, - { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, @@ -102,14 +100,185 @@ static struct via_isa_bridge { { NULL } }; +static struct via_isa_bridge *via_config; +static unsigned int via_80w; static unsigned int via_clock; static char *via_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" }; -struct via82cxxx_dev +/* + * VIA /proc entry. + */ + +#if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS) + +#include +#include + +static u8 via_proc = 0; +static unsigned long via_base; +static struct pci_dev *bmide_dev, *isa_dev; + +static char *via_control3[] = { "No limit", "64", "128", "192" }; + +#define via_print(format, arg...) p += sprintf(p, format "\n" , ## arg) +#define via_print_drive(name, format, arg...)\ + p += sprintf(p, name); for (i = 0; i < 4; i++) p += sprintf(p, format, ## arg); p += sprintf(p, "\n"); + + +/** + * via_get_info - generate via /proc file + * @buffer: buffer for data + * @addr: set to start of data to use + * @offset: current file offset + * @count: size of read + * + * Fills in buffer with the debugging/configuration information for + * the VIA chipset tuning and attached drives + */ + +static int via_get_info(char *buffer, char **addr, off_t offset, int count) { - struct via_isa_bridge *via_config; - unsigned int via_80w; -}; + int speed[4], cycle[4], setup[4], active[4], recover[4], den[4], + uen[4], udma[4], umul[4], active8b[4], recover8b[4]; + struct pci_dev *dev = bmide_dev; + unsigned int v, u, i; + int len; + u16 c, w; + u8 t, x; + char *p = buffer; + + via_print("----------VIA BusMastering IDE Configuration" + "----------------"); + + via_print("Driver Version: 3.38"); + via_print("South Bridge: VIA %s", + via_config->name); + + pci_read_config_byte(isa_dev, PCI_REVISION_ID, &t); + pci_read_config_byte(dev, PCI_REVISION_ID, &x); + via_print("Revision: ISA %#x IDE %#x", t, x); + via_print("Highest DMA rate: %s", + via_dma[via_config->flags & VIA_UDMA]); + + via_print("BM-DMA base: %#lx", via_base); + via_print("PCI clock: %d.%dMHz", + via_clock / 1000, via_clock / 100 % 10); + + pci_read_config_byte(dev, VIA_MISC_1, &t); + via_print("Master Read Cycle IRDY: %dws", + (t & 64) >> 6); + via_print("Master Write Cycle IRDY: %dws", + (t & 32) >> 5); + via_print("BM IDE Status Register Read Retry: %s", + (t & 8) ? "yes" : "no"); + + pci_read_config_byte(dev, VIA_MISC_3, &t); + via_print("Max DRDY Pulse Width: %s%s", + via_control3[(t & 0x03)], (t & 0x03) ? " PCI clocks" : ""); + + via_print("-----------------------Primary IDE" + "-------Secondary IDE------"); + via_print("Read DMA FIFO flush: %10s%20s", + (t & 0x80) ? "yes" : "no", (t & 0x40) ? "yes" : "no"); + via_print("End Sector FIFO flush: %10s%20s", + (t & 0x20) ? "yes" : "no", (t & 0x10) ? "yes" : "no"); + + pci_read_config_byte(dev, VIA_IDE_CONFIG, &t); + via_print("Prefetch Buffer: %10s%20s", + (t & 0x80) ? "yes" : "no", (t & 0x20) ? "yes" : "no"); + via_print("Post Write Buffer: %10s%20s", + (t & 0x40) ? "yes" : "no", (t & 0x10) ? "yes" : "no"); + + pci_read_config_byte(dev, VIA_IDE_ENABLE, &t); + via_print("Enabled: %10s%20s", + (t & 0x02) ? "yes" : "no", (t & 0x01) ? "yes" : "no"); + + c = inb(via_base + 0x02) | (inb(via_base + 0x0a) << 8); + via_print("Simplex only: %10s%20s", + (c & 0x80) ? "yes" : "no", (c & 0x8000) ? "yes" : "no"); + + via_print("Cable Type: %10s%20s", + (via_80w & 1) ? "80w" : "40w", (via_80w & 2) ? "80w" : "40w"); + + via_print("-------------------drive0----drive1" + "----drive2----drive3-----"); + + pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t); + pci_read_config_dword(dev, VIA_DRIVE_TIMING, &v); + pci_read_config_word(dev, VIA_8BIT_TIMING, &w); + + if (via_config->flags & VIA_UDMA) + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); + else u = 0; + + for (i = 0; i < 4; i++) { + + setup[i] = ((t >> ((3 - i) << 1)) & 0x3) + 1; + recover8b[i] = ((w >> ((1 - (i >> 1)) << 3)) & 0xf) + 1; + active8b[i] = ((w >> (((1 - (i >> 1)) << 3) + 4)) & 0xf) + 1; + active[i] = ((v >> (((3 - i) << 3) + 4)) & 0xf) + 1; + recover[i] = ((v >> ((3 - i) << 3)) & 0xf) + 1; + udma[i] = ((u >> ((3 - i) << 3)) & 0x7) + 2; + umul[i] = ((u >> (((3 - i) & 2) << 3)) & 0x8) ? 1 : 2; + uen[i] = ((u >> ((3 - i) << 3)) & 0x20); + den[i] = (c & ((i & 1) ? 0x40 : 0x20) << ((i & 2) << 2)); + + speed[i] = 2 * via_clock / (active[i] + recover[i]); + cycle[i] = 1000000 * (active[i] + recover[i]) / via_clock; + + if (!uen[i] || !den[i]) + continue; + + switch (via_config->flags & VIA_UDMA) { + + case VIA_UDMA_33: + speed[i] = 2 * via_clock / udma[i]; + cycle[i] = 1000000 * udma[i] / via_clock; + break; + + case VIA_UDMA_66: + speed[i] = 4 * via_clock / (udma[i] * umul[i]); + cycle[i] = 500000 * (udma[i] * umul[i]) / via_clock; + break; + + case VIA_UDMA_100: + speed[i] = 6 * via_clock / udma[i]; + cycle[i] = 333333 * udma[i] / via_clock; + break; + + case VIA_UDMA_133: + speed[i] = 8 * via_clock / udma[i]; + cycle[i] = 250000 * udma[i] / via_clock; + break; + } + } + + via_print_drive("Transfer Mode: ", "%10s", + den[i] ? (uen[i] ? "UDMA" : "DMA") : "PIO"); + + via_print_drive("Address Setup: ", "%8dns", + 1000000 * setup[i] / via_clock); + via_print_drive("Cmd Active: ", "%8dns", + 1000000 * active8b[i] / via_clock); + via_print_drive("Cmd Recovery: ", "%8dns", + 1000000 * recover8b[i] / via_clock); + via_print_drive("Data Active: ", "%8dns", + 1000000 * active[i] / via_clock); + via_print_drive("Data Recovery: ", "%8dns", + 1000000 * recover[i] / via_clock); + via_print_drive("Cycle Time: ", "%8dns", + cycle[i]); + via_print_drive("Transfer Rate: ", "%4d.%dMB/s", + speed[i] / 1000, speed[i] / 100 % 10); + + /* hoping it is less than 4K... */ + len = (p - buffer) - offset; + *addr = buffer + offset; + + return len > count ? count : len; +} + +#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */ /** * via_set_speed - write timing registers @@ -120,13 +289,11 @@ struct via82cxxx_dev * via_set_speed writes timing values to the chipset registers */ -static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing) +static void via_set_speed(struct pci_dev *dev, u8 dn, struct ide_timing *timing) { - struct pci_dev *dev = hwif->pci_dev; - struct via82cxxx_dev *vdev = ide_get_hwifdata(hwif); u8 t; - if (~vdev->via_config->flags & VIA_BAD_AST) { + if (~via_config->flags & VIA_BAD_AST) { pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t); t = (t & ~(3 << ((3 - dn) << 1))) | ((FIT(timing->setup, 1, 4) - 1) << ((3 - dn) << 1)); pci_write_config_byte(dev, VIA_ADDRESS_SETUP, t); @@ -138,7 +305,7 @@ static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing) pci_write_config_byte(dev, VIA_DRIVE_TIMING + (3 - dn), ((FIT(timing->active, 1, 16) - 1) << 4) | (FIT(timing->recover, 1, 16) - 1)); - switch (vdev->via_config->flags & VIA_UDMA) { + switch (via_config->flags & VIA_UDMA) { case VIA_UDMA_33: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break; case VIA_UDMA_66: t = timing->udma ? (0xe8 | (FIT(timing->udma, 2, 9) - 2)) : 0x0f; break; case VIA_UDMA_100: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break; @@ -162,7 +329,6 @@ static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing) static int via_set_drive(ide_drive_t *drive, u8 speed) { ide_drive_t *peer = HWIF(drive)->drives + (~drive->dn & 1); - struct via82cxxx_dev *vdev = ide_get_hwifdata(drive->hwif); struct ide_timing t, p; unsigned int T, UT; @@ -171,7 +337,7 @@ static int via_set_drive(ide_drive_t *drive, u8 speed) T = 1000000000 / via_clock; - switch (vdev->via_config->flags & VIA_UDMA) { + switch (via_config->flags & VIA_UDMA) { case VIA_UDMA_33: UT = T; break; case VIA_UDMA_66: UT = T/2; break; case VIA_UDMA_100: UT = T/3; break; @@ -186,7 +352,7 @@ static int via_set_drive(ide_drive_t *drive, u8 speed) ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT); } - via_set_speed(HWIF(drive), drive->dn, &t); + via_set_speed(HWIF(drive)->pci_dev, drive->dn, &t); if (!drive->init_speed) drive->init_speed = speed; @@ -224,41 +390,20 @@ static void via82cxxx_tune_drive(ide_drive_t *drive, u8 pio) static int via82cxxx_ide_dma_check (ide_drive_t *drive) { - ide_hwif_t *hwif = HWIF(drive); - struct via82cxxx_dev *vdev = ide_get_hwifdata(hwif); - u16 w80 = hwif->udma_four; + u16 w80 = HWIF(drive)->udma_four; u16 speed = ide_find_best_mode(drive, XFER_PIO | XFER_EPIO | XFER_SWDMA | XFER_MWDMA | - (vdev->via_config->flags & VIA_UDMA ? XFER_UDMA : 0) | - (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_66 ? XFER_UDMA_66 : 0) | - (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_100 ? XFER_UDMA_100 : 0) | - (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_133 ? XFER_UDMA_133 : 0)); + (via_config->flags & VIA_UDMA ? XFER_UDMA : 0) | + (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_66 ? XFER_UDMA_66 : 0) | + (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_100 ? XFER_UDMA_100 : 0) | + (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_133 ? XFER_UDMA_133 : 0)); via_set_drive(drive, speed); if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) - return hwif->ide_dma_on(drive); - return hwif->ide_dma_off_quietly(drive); -} - -static struct via_isa_bridge *via_config_find(struct pci_dev **isa) -{ - struct via_isa_bridge *via_config; - u8 t; - - for (via_config = via_isa_bridges; via_config->id; via_config++) - if ((*isa = pci_find_device(PCI_VENDOR_ID_VIA + - !!(via_config->flags & VIA_BAD_ID), - via_config->id, NULL))) { - - pci_read_config_byte(*isa, PCI_REVISION_ID, &t); - if (t >= via_config->rev_min && - t <= via_config->rev_max) - break; - } - - return via_config; + return HWIF(drive)->ide_dma_on(drive); + return HWIF(drive)->ide_dma_off_quietly(drive); } /** @@ -273,28 +418,82 @@ static struct via_isa_bridge *via_config_find(struct pci_dev **isa) static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const char *name) { struct pci_dev *isa = NULL; - struct via_isa_bridge *via_config; u8 t, v; unsigned int u; + int i; /* * Find the ISA bridge to see how good the IDE is. */ - via_config = via_config_find(&isa); + + for (via_config = via_isa_bridges; via_config->id; via_config++) + if ((isa = pci_find_device(PCI_VENDOR_ID_VIA + + !!(via_config->flags & VIA_BAD_ID), + via_config->id, NULL))) { + + pci_read_config_byte(isa, PCI_REVISION_ID, &t); + if (t >= via_config->rev_min && + t <= via_config->rev_max) + break; + } + if (!via_config->id) { printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n"); return -ENODEV; } /* - * Setup or disable Clk66 if appropriate + * Check 80-wire cable presence and setup Clk66. */ - if ((via_config->flags & VIA_UDMA) == VIA_UDMA_66) { - /* Enable Clk66 */ - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); - pci_write_config_dword(dev, VIA_UDMA_TIMING, u|0x80008); - } else if (via_config->flags & VIA_BAD_CLK66) { + switch (via_config->flags & VIA_UDMA) { + + case VIA_UDMA_66: + /* Enable Clk66 */ + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); + pci_write_config_dword(dev, VIA_UDMA_TIMING, u|0x80008); + for (i = 24; i >= 0; i -= 8) + if (((u >> (i & 16)) & 8) && + ((u >> i) & 0x20) && + (((u >> i) & 7) < 2)) { + /* + * 2x PCI clock and + * UDMA w/ < 3T/cycle + */ + via_80w |= (1 << (1 - (i >> 4))); + } + break; + + case VIA_UDMA_100: + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); + for (i = 24; i >= 0; i -= 8) + if (((u >> i) & 0x10) || + (((u >> i) & 0x20) && + (((u >> i) & 7) < 4))) { + /* BIOS 80-wire bit or + * UDMA w/ < 60ns/cycle + */ + via_80w |= (1 << (1 - (i >> 4))); + } + break; + + case VIA_UDMA_133: + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); + for (i = 24; i >= 0; i -= 8) + if (((u >> i) & 0x10) || + (((u >> i) & 0x20) && + (((u >> i) & 7) < 6))) { + /* BIOS 80-wire bit or + * UDMA w/ < 60ns/cycle + */ + via_80w |= (1 << (1 - (i >> 4))); + } + break; + + } + + /* Disable Clk66 */ + if (via_config->flags & VIA_BAD_CLK66) { /* Would cause trouble on 596a and 686 */ pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); pci_write_config_dword(dev, VIA_UDMA_TIMING, u & ~0x80008); @@ -361,78 +560,26 @@ static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const via_dma[via_config->flags & VIA_UDMA], pci_name(dev)); - return 0; -} - -/* - * Check and handle 80-wire cable presence - */ -static void __devinit via_cable_detect(struct pci_dev *dev, struct via82cxxx_dev *vdev) -{ - unsigned int u; - int i; - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); - - switch (vdev->via_config->flags & VIA_UDMA) { - - case VIA_UDMA_66: - for (i = 24; i >= 0; i -= 8) - if (((u >> (i & 16)) & 8) && - ((u >> i) & 0x20) && - (((u >> i) & 7) < 2)) { - /* - * 2x PCI clock and - * UDMA w/ < 3T/cycle - */ - vdev->via_80w |= (1 << (1 - (i >> 4))); - } - break; - - case VIA_UDMA_100: - for (i = 24; i >= 0; i -= 8) - if (((u >> i) & 0x10) || - (((u >> i) & 0x20) && - (((u >> i) & 7) < 4))) { - /* BIOS 80-wire bit or - * UDMA w/ < 60ns/cycle - */ - vdev->via_80w |= (1 << (1 - (i >> 4))); - } - break; - - case VIA_UDMA_133: - for (i = 24; i >= 0; i -= 8) - if (((u >> i) & 0x10) || - (((u >> i) & 0x20) && - (((u >> i) & 7) < 6))) { - /* BIOS 80-wire bit or - * UDMA w/ < 60ns/cycle - */ - vdev->via_80w |= (1 << (1 - (i >> 4))); - } - break; + /* + * Setup /proc/ide/via entry. + */ +#if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS) + if (!via_proc) { + via_base = pci_resource_start(dev, 4); + bmide_dev = dev; + isa_dev = isa; + ide_pci_create_host_proc("via", via_get_info); + via_proc = 1; } +#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */ + return 0; } static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) { - struct via82cxxx_dev *vdev = kmalloc(sizeof(struct via82cxxx_dev), - GFP_KERNEL); - struct pci_dev *isa = NULL; int i; - if (vdev == NULL) { - printk(KERN_ERR "VP_IDE: out of memory :(\n"); - return; - } - - memset(vdev, 0, sizeof(struct via82cxxx_dev)); - ide_set_hwifdata(hwif, vdev); - - vdev->via_config = via_config_find(&isa); - via_cable_detect(hwif->pci_dev, vdev); - hwif->autodma = 0; hwif->tuneproc = &via82cxxx_tune_drive; @@ -447,7 +594,7 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) for (i = 0; i < 2; i++) { hwif->drives[i].io_32bit = 1; - hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1; + hwif->drives[i].unmask = (via_config->flags & VIA_NO_UNMASK) ? 0 : 1; hwif->drives[i].autotune = 1; hwif->drives[i].dn = hwif->channel * 2 + i; } @@ -461,7 +608,7 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) hwif->swdma_mask = 0x07; if (!hwif->udma_four) - hwif->udma_four = (vdev->via_80w >> hwif->channel) & 1; + hwif->udma_four = (via_80w >> hwif->channel) & 1; hwif->ide_dma_check = &via82cxxx_ide_dma_check; if (!noautodma) hwif->autodma = 1; @@ -469,35 +616,24 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) hwif->drives[1].autodma = hwif->autodma; } -static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = { - { /* 0 */ - .name = "VP_IDE", - .init_chipset = init_chipset_via82cxxx, - .init_hwif = init_hwif_via82cxxx, - .channels = 2, - .autodma = NOAUTODMA, - .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, - .bootable = ON_BOARD - },{ /* 1 */ - .name = "VP_IDE", - .init_chipset = init_chipset_via82cxxx, - .init_hwif = init_hwif_via82cxxx, - .channels = 2, - .autodma = AUTODMA, - .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, - .bootable = ON_BOARD, - } +static ide_pci_device_t via82cxxx_chipset __devinitdata = { + .name = "VP_IDE", + .init_chipset = init_chipset_via82cxxx, + .init_hwif = init_hwif_via82cxxx, + .channels = 2, + .autodma = NOAUTODMA, + .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, + .bootable = ON_BOARD, }; static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id) { - return ide_setup_pci_device(dev, &via82cxxx_chipsets[id->driver_data]); + return ide_setup_pci_device(dev, &via82cxxx_chipset); } static struct pci_device_id via_pci_tbl[] = { { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_6410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, { 0, }, }; MODULE_DEVICE_TABLE(pci, via_pci_tbl); diff --git a/trunk/drivers/ide/ppc/pmac.c b/trunk/drivers/ide/ppc/pmac.c index 16b28357885b..b3e65a65d202 100644 --- a/trunk/drivers/ide/ppc/pmac.c +++ b/trunk/drivers/ide/ppc/pmac.c @@ -1401,6 +1401,20 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif) /* We probe the hwif now */ probe_hwif_init(hwif); + /* The code IDE code will have set hwif->present if we have devices attached, + * if we don't, the discard the interface except if we are on a media bay slot + */ + if (!hwif->present && !pmif->mediabay) { + printk(KERN_INFO "ide%d: Bus empty, interface released.\n", + hwif->index); + default_hwif_iops(hwif); + for (i = IDE_DATA_OFFSET; i <= IDE_CONTROL_OFFSET; ++i) + hwif->io_ports[i] = 0; + hwif->chipset = ide_unknown; + hwif->noprobe = 1; + return -ENODEV; + } + return 0; } @@ -1653,16 +1667,11 @@ static struct macio_driver pmac_ide_macio_driver = }; static struct pci_device_id pmac_ide_pci_match[] = { - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_ATA, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID_ATA100, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_K2_ATA100, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_K2_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_SH_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID2_ATA, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, }; static struct pci_driver pmac_ide_pci_driver = { diff --git a/trunk/drivers/ide/setup-pci.c b/trunk/drivers/ide/setup-pci.c index 7ebf992e8c2f..d4f2111d4364 100644 --- a/trunk/drivers/ide/setup-pci.c +++ b/trunk/drivers/ide/setup-pci.c @@ -787,7 +787,7 @@ static int pre_init = 1; /* Before first ordered IDE scan */ static LIST_HEAD(ide_pci_drivers); /* - * __ide_pci_register_driver - attach IDE driver + * __ide_register_pci_driver - attach IDE driver * @driver: pci driver * @module: owner module of the driver * diff --git a/trunk/drivers/ieee1394/hosts.h b/trunk/drivers/ieee1394/hosts.h index ae9b02cc013f..38f42112dff0 100644 --- a/trunk/drivers/ieee1394/hosts.h +++ b/trunk/drivers/ieee1394/hosts.h @@ -41,7 +41,6 @@ struct hpsb_host { /* this nodes state */ unsigned in_bus_reset:1; unsigned is_shutdown:1; - unsigned resume_packet_sent:1; /* this nodes' duties on the bus */ unsigned is_root:1; diff --git a/trunk/drivers/ieee1394/nodemgr.c b/trunk/drivers/ieee1394/nodemgr.c index 0ea37b1bccb2..7fff5a1d2ea4 100644 --- a/trunk/drivers/ieee1394/nodemgr.c +++ b/trunk/drivers/ieee1394/nodemgr.c @@ -1349,33 +1349,6 @@ static void nodemgr_update_pdrv(struct node_entry *ne) } -/* Write the BROADCAST_CHANNEL as per IEEE1394a 8.3.2.3.11 and 8.4.2.3. This - * seems like an optional service but in the end it is practically mandatory - * as a consequence of these clauses. - * - * Note that we cannot do a broadcast write to all nodes at once because some - * pre-1394a devices would hang. */ -static void nodemgr_irm_write_bc(struct node_entry *ne, int generation) -{ - const u64 bc_addr = (CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL); - quadlet_t bc_remote, bc_local; - int ret; - - if (!ne->host->is_irm || ne->generation != generation || - ne->nodeid == ne->host->node_id) - return; - - bc_local = cpu_to_be32(ne->host->csr.broadcast_channel); - - /* Check if the register is implemented and 1394a compliant. */ - ret = hpsb_read(ne->host, ne->nodeid, generation, bc_addr, &bc_remote, - sizeof(bc_remote)); - if (!ret && bc_remote & cpu_to_be32(0x80000000) && - bc_remote != bc_local) - hpsb_node_write(ne, bc_addr, &bc_local, sizeof(bc_local)); -} - - static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int generation) { struct device *dev; @@ -1387,8 +1360,6 @@ static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int ge if (!dev) return; - nodemgr_irm_write_bc(ne, generation); - /* If "needs_probe", then this is either a new or changed node we * rescan totally. If the generation matches for an existing node * (one that existed prior to the bus reset) we send update calls @@ -1442,25 +1413,9 @@ static void nodemgr_node_probe(struct host_info *hi, int generation) return; } -static int nodemgr_send_resume_packet(struct hpsb_host *host) -{ - struct hpsb_packet *packet; - int ret = 1; - - packet = hpsb_make_phypacket(host, - 0x003c0000 | NODEID_TO_NODE(host->node_id) << 24); - if (packet) { - packet->no_waiter = 1; - packet->generation = get_hpsb_generation(host); - ret = hpsb_send_packet(packet); - } - if (ret) - HPSB_WARN("fw-host%d: Failed to broadcast resume packet", - host->id); - return ret; -} - -/* Perform a few high-level IRM responsibilities. */ +/* Because we are a 1394a-2000 compliant IRM, we need to inform all the other + * nodes of the broadcast channel. (Really we're only setting the validity + * bit). Other IRM responsibilities go in here as well. */ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles) { quadlet_t bc; @@ -1469,8 +1424,13 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles) if (!host->is_irm || host->irm_id == (nodeid_t)-1) return 1; - /* We are a 1394a-2000 compliant IRM. Set the validity bit. */ - host->csr.broadcast_channel |= 0x40000000; + host->csr.broadcast_channel |= 0x40000000; /* set validity bit */ + + bc = cpu_to_be32(host->csr.broadcast_channel); + + hpsb_write(host, LOCAL_BUS | ALL_NODES, get_hpsb_generation(host), + (CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL), + &bc, sizeof(quadlet_t)); /* If there is no bus manager then we should set the root node's * force_root bit to promote bus stability per the 1394 @@ -1503,13 +1463,6 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles) } } - /* Some devices suspend their ports while being connected to an inactive - * host adapter, i.e. if connected before the low-level driver is - * loaded. They become visible either when physically unplugged and - * replugged, or when receiving a resume packet. Send one once. */ - if (!host->resume_packet_sent && !nodemgr_send_resume_packet(host)) - host->resume_packet_sent = 1; - return 1; } diff --git a/trunk/drivers/ieee1394/sbp2.c b/trunk/drivers/ieee1394/sbp2.c index f7e18ccc5c0a..12cec7c4a342 100644 --- a/trunk/drivers/ieee1394/sbp2.c +++ b/trunk/drivers/ieee1394/sbp2.c @@ -2350,7 +2350,6 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int dest struct scsi_cmnd *SCpnt = NULL; u32 scsi_status = SBP2_SCSI_STATUS_GOOD; struct sbp2_command_info *command; - unsigned long flags; SBP2_DEBUG("sbp2_handle_status_write"); @@ -2452,11 +2451,9 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int dest * null out last orb so that next time around we write directly to the orb pointer... * Quick start saves one 1394 bus transaction. */ - spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags); if (list_empty(&scsi_id->sbp2_command_orb_inuse)) { scsi_id->last_orb = NULL; } - spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags); } else { @@ -2566,11 +2563,9 @@ static void sbp2scsi_complete_all_commands(struct scsi_id_instance_data *scsi_id struct sbp2scsi_host_info *hi = scsi_id->hi; struct list_head *lh; struct sbp2_command_info *command; - unsigned long flags; SBP2_DEBUG("sbp2scsi_complete_all_commands"); - spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags); while (!list_empty(&scsi_id->sbp2_command_orb_inuse)) { SBP2_DEBUG("Found pending command to complete"); lh = scsi_id->sbp2_command_orb_inuse.next; @@ -2587,7 +2582,6 @@ static void sbp2scsi_complete_all_commands(struct scsi_id_instance_data *scsi_id command->Current_done(command->Current_SCpnt); } } - spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags); return; } diff --git a/trunk/drivers/infiniband/core/mad.c b/trunk/drivers/infiniband/core/mad.c index d393b504bf26..41d6b4017acb 100644 --- a/trunk/drivers/infiniband/core/mad.c +++ b/trunk/drivers/infiniband/core/mad.c @@ -355,9 +355,9 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device, spin_unlock_irqrestore(&port_priv->reg_lock, flags); kfree(reg_req); error3: - ib_dereg_mr(mad_agent_priv->agent.mr); -error2: kfree(mad_agent_priv); +error2: + ib_dereg_mr(mad_agent_priv->agent.mr); error1: return ret; } diff --git a/trunk/drivers/infiniband/core/user_mad.c b/trunk/drivers/infiniband/core/user_mad.c index eb7f52537ccc..5ea741f47fc8 100644 --- a/trunk/drivers/infiniband/core/user_mad.c +++ b/trunk/drivers/infiniband/core/user_mad.c @@ -310,9 +310,9 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf, u8 method; __be64 *tid; int ret, length, hdr_len, copy_offset; - int rmpp_active, has_rmpp_header; + int rmpp_active = 0; - if (count < sizeof (struct ib_user_mad) + IB_MGMT_RMPP_HDR) + if (count < sizeof (struct ib_user_mad)) return -EINVAL; length = count - sizeof (struct ib_user_mad); @@ -360,31 +360,28 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf, } rmpp_mad = (struct ib_rmpp_mad *) packet->mad.data; - if (rmpp_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_ADM) { - hdr_len = IB_MGMT_SA_HDR; + if (ib_get_rmpp_flags(&rmpp_mad->rmpp_hdr) & IB_MGMT_RMPP_FLAG_ACTIVE) { + /* RMPP active */ + if (!agent->rmpp_version) { + ret = -EINVAL; + goto err_ah; + } + + /* Validate that the management class can support RMPP */ + if (rmpp_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_ADM) { + hdr_len = IB_MGMT_SA_HDR; + } else if ((rmpp_mad->mad_hdr.mgmt_class >= IB_MGMT_CLASS_VENDOR_RANGE2_START) && + (rmpp_mad->mad_hdr.mgmt_class <= IB_MGMT_CLASS_VENDOR_RANGE2_END)) { + hdr_len = IB_MGMT_VENDOR_HDR; + } else { + ret = -EINVAL; + goto err_ah; + } + rmpp_active = 1; copy_offset = IB_MGMT_RMPP_HDR; - has_rmpp_header = 1; - } else if (rmpp_mad->mad_hdr.mgmt_class >= IB_MGMT_CLASS_VENDOR_RANGE2_START && - rmpp_mad->mad_hdr.mgmt_class <= IB_MGMT_CLASS_VENDOR_RANGE2_END) { - hdr_len = IB_MGMT_VENDOR_HDR; - copy_offset = IB_MGMT_RMPP_HDR; - has_rmpp_header = 1; } else { hdr_len = IB_MGMT_MAD_HDR; copy_offset = IB_MGMT_MAD_HDR; - has_rmpp_header = 0; - } - - if (has_rmpp_header) - rmpp_active = ib_get_rmpp_flags(&rmpp_mad->rmpp_hdr) & - IB_MGMT_RMPP_FLAG_ACTIVE; - else - rmpp_active = 0; - - /* Validate that the management class can support RMPP */ - if (rmpp_active && !agent->rmpp_version) { - ret = -EINVAL; - goto err_ah; } packet->msg = ib_create_send_mad(agent, diff --git a/trunk/drivers/infiniband/core/uverbs.h b/trunk/drivers/infiniband/core/uverbs.h index 7114e3fbab00..ecb830127865 100644 --- a/trunk/drivers/infiniband/core/uverbs.h +++ b/trunk/drivers/infiniband/core/uverbs.h @@ -105,23 +105,12 @@ struct ib_uverbs_event { u32 *counter; }; -struct ib_uverbs_mcast_entry { - struct list_head list; - union ib_gid gid; - u16 lid; -}; - struct ib_uevent_object { struct ib_uobject uobject; struct list_head event_list; u32 events_reported; }; -struct ib_uqp_object { - struct ib_uevent_object uevent; - struct list_head mcast_list; -}; - struct ib_ucq_object { struct ib_uobject uobject; struct ib_uverbs_file *uverbs_file; diff --git a/trunk/drivers/infiniband/core/uverbs_cmd.c b/trunk/drivers/infiniband/core/uverbs_cmd.c index a57d021d435a..ed45da892b1c 100644 --- a/trunk/drivers/infiniband/core/uverbs_cmd.c +++ b/trunk/drivers/infiniband/core/uverbs_cmd.c @@ -815,7 +815,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file, struct ib_uverbs_create_qp cmd; struct ib_uverbs_create_qp_resp resp; struct ib_udata udata; - struct ib_uqp_object *uobj; + struct ib_uevent_object *uobj; struct ib_pd *pd; struct ib_cq *scq, *rcq; struct ib_srq *srq; @@ -866,11 +866,10 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file, attr.cap.max_recv_sge = cmd.max_recv_sge; attr.cap.max_inline_data = cmd.max_inline_data; - uobj->uevent.uobject.user_handle = cmd.user_handle; - uobj->uevent.uobject.context = file->ucontext; - uobj->uevent.events_reported = 0; - INIT_LIST_HEAD(&uobj->uevent.event_list); - INIT_LIST_HEAD(&uobj->mcast_list); + uobj->uobject.user_handle = cmd.user_handle; + uobj->uobject.context = file->ucontext; + uobj->events_reported = 0; + INIT_LIST_HEAD(&uobj->event_list); qp = pd->device->create_qp(pd, &attr, &udata); if (IS_ERR(qp)) { @@ -883,7 +882,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file, qp->send_cq = attr.send_cq; qp->recv_cq = attr.recv_cq; qp->srq = attr.srq; - qp->uobject = &uobj->uevent.uobject; + qp->uobject = &uobj->uobject; qp->event_handler = attr.event_handler; qp->qp_context = attr.qp_context; qp->qp_type = attr.qp_type; @@ -902,14 +901,14 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file, goto err_destroy; } - ret = idr_get_new(&ib_uverbs_qp_idr, qp, &uobj->uevent.uobject.id); + ret = idr_get_new(&ib_uverbs_qp_idr, qp, &uobj->uobject.id); if (ret == -EAGAIN) goto retry; if (ret) goto err_destroy; - resp.qp_handle = uobj->uevent.uobject.id; + resp.qp_handle = uobj->uobject.id; resp.max_recv_sge = attr.cap.max_recv_sge; resp.max_send_sge = attr.cap.max_send_sge; resp.max_recv_wr = attr.cap.max_recv_wr; @@ -923,7 +922,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file, } down(&file->mutex); - list_add_tail(&uobj->uevent.uobject.list, &file->ucontext->qp_list); + list_add_tail(&uobj->uobject.list, &file->ucontext->qp_list); up(&file->mutex); up(&ib_uverbs_idr_mutex); @@ -931,7 +930,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file, return in_len; err_idr: - idr_remove(&ib_uverbs_qp_idr, uobj->uevent.uobject.id); + idr_remove(&ib_uverbs_qp_idr, uobj->uobject.id); err_destroy: ib_destroy_qp(qp); @@ -1033,7 +1032,7 @@ ssize_t ib_uverbs_destroy_qp(struct ib_uverbs_file *file, struct ib_uverbs_destroy_qp cmd; struct ib_uverbs_destroy_qp_resp resp; struct ib_qp *qp; - struct ib_uqp_object *uobj; + struct ib_uevent_object *uobj; int ret = -EINVAL; if (copy_from_user(&cmd, buf, sizeof cmd)) @@ -1047,12 +1046,7 @@ ssize_t ib_uverbs_destroy_qp(struct ib_uverbs_file *file, if (!qp || qp->uobject->context != file->ucontext) goto out; - uobj = container_of(qp->uobject, struct ib_uqp_object, uevent.uobject); - - if (!list_empty(&uobj->mcast_list)) { - ret = -EBUSY; - goto out; - } + uobj = container_of(qp->uobject, struct ib_uevent_object, uobject); ret = ib_destroy_qp(qp); if (ret) @@ -1061,12 +1055,12 @@ ssize_t ib_uverbs_destroy_qp(struct ib_uverbs_file *file, idr_remove(&ib_uverbs_qp_idr, cmd.qp_handle); down(&file->mutex); - list_del(&uobj->uevent.uobject.list); + list_del(&uobj->uobject.list); up(&file->mutex); - ib_uverbs_release_uevent(file, &uobj->uevent); + ib_uverbs_release_uevent(file, uobj); - resp.events_reported = uobj->uevent.events_reported; + resp.events_reported = uobj->events_reported; kfree(uobj); @@ -1548,8 +1542,6 @@ ssize_t ib_uverbs_attach_mcast(struct ib_uverbs_file *file, { struct ib_uverbs_attach_mcast cmd; struct ib_qp *qp; - struct ib_uqp_object *uobj; - struct ib_uverbs_mcast_entry *mcast; int ret = -EINVAL; if (copy_from_user(&cmd, buf, sizeof cmd)) @@ -1558,36 +1550,9 @@ ssize_t ib_uverbs_attach_mcast(struct ib_uverbs_file *file, down(&ib_uverbs_idr_mutex); qp = idr_find(&ib_uverbs_qp_idr, cmd.qp_handle); - if (!qp || qp->uobject->context != file->ucontext) - goto out; - - uobj = container_of(qp->uobject, struct ib_uqp_object, uevent.uobject); - - list_for_each_entry(mcast, &uobj->mcast_list, list) - if (cmd.mlid == mcast->lid && - !memcmp(cmd.gid, mcast->gid.raw, sizeof mcast->gid.raw)) { - ret = 0; - goto out; - } + if (qp && qp->uobject->context == file->ucontext) + ret = ib_attach_mcast(qp, (union ib_gid *) cmd.gid, cmd.mlid); - mcast = kmalloc(sizeof *mcast, GFP_KERNEL); - if (!mcast) { - ret = -ENOMEM; - goto out; - } - - mcast->lid = cmd.mlid; - memcpy(mcast->gid.raw, cmd.gid, sizeof mcast->gid.raw); - - ret = ib_attach_mcast(qp, &mcast->gid, cmd.mlid); - if (!ret) { - uobj = container_of(qp->uobject, struct ib_uqp_object, - uevent.uobject); - list_add_tail(&mcast->list, &uobj->mcast_list); - } else - kfree(mcast); - -out: up(&ib_uverbs_idr_mutex); return ret ? ret : in_len; @@ -1598,9 +1563,7 @@ ssize_t ib_uverbs_detach_mcast(struct ib_uverbs_file *file, int out_len) { struct ib_uverbs_detach_mcast cmd; - struct ib_uqp_object *uobj; struct ib_qp *qp; - struct ib_uverbs_mcast_entry *mcast; int ret = -EINVAL; if (copy_from_user(&cmd, buf, sizeof cmd)) @@ -1609,24 +1572,9 @@ ssize_t ib_uverbs_detach_mcast(struct ib_uverbs_file *file, down(&ib_uverbs_idr_mutex); qp = idr_find(&ib_uverbs_qp_idr, cmd.qp_handle); - if (!qp || qp->uobject->context != file->ucontext) - goto out; - - ret = ib_detach_mcast(qp, (union ib_gid *) cmd.gid, cmd.mlid); - if (ret) - goto out; + if (qp && qp->uobject->context == file->ucontext) + ret = ib_detach_mcast(qp, (union ib_gid *) cmd.gid, cmd.mlid); - uobj = container_of(qp->uobject, struct ib_uqp_object, uevent.uobject); - - list_for_each_entry(mcast, &uobj->mcast_list, list) - if (cmd.mlid == mcast->lid && - !memcmp(cmd.gid, mcast->gid.raw, sizeof mcast->gid.raw)) { - list_del(&mcast->list); - kfree(mcast); - break; - } - -out: up(&ib_uverbs_idr_mutex); return ret ? ret : in_len; diff --git a/trunk/drivers/infiniband/core/uverbs_main.c b/trunk/drivers/infiniband/core/uverbs_main.c index 81737bd6faea..de6581d7cb8d 100644 --- a/trunk/drivers/infiniband/core/uverbs_main.c +++ b/trunk/drivers/infiniband/core/uverbs_main.c @@ -160,18 +160,6 @@ void ib_uverbs_release_uevent(struct ib_uverbs_file *file, spin_unlock_irq(&file->async_file->lock); } -static void ib_uverbs_detach_umcast(struct ib_qp *qp, - struct ib_uqp_object *uobj) -{ - struct ib_uverbs_mcast_entry *mcast, *tmp; - - list_for_each_entry_safe(mcast, tmp, &uobj->mcast_list, list) { - ib_detach_mcast(qp, &mcast->gid, mcast->lid); - list_del(&mcast->list); - kfree(mcast); - } -} - static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, struct ib_ucontext *context) { @@ -192,14 +180,13 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, list_for_each_entry_safe(uobj, tmp, &context->qp_list, list) { struct ib_qp *qp = idr_find(&ib_uverbs_qp_idr, uobj->id); - struct ib_uqp_object *uqp = - container_of(uobj, struct ib_uqp_object, uevent.uobject); + struct ib_uevent_object *uevent = + container_of(uobj, struct ib_uevent_object, uobject); idr_remove(&ib_uverbs_qp_idr, uobj->id); - ib_uverbs_detach_umcast(qp, uqp); ib_destroy_qp(qp); list_del(&uobj->list); - ib_uverbs_release_uevent(file, &uqp->uevent); - kfree(uqp); + ib_uverbs_release_uevent(file, uevent); + kfree(uevent); } list_for_each_entry_safe(uobj, tmp, &context->cq_list, list) { diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_qp.c b/trunk/drivers/infiniband/hw/mthca/mthca_qp.c index 7450550db736..760c418d5bc9 100644 --- a/trunk/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/trunk/drivers/infiniband/hw/mthca/mthca_qp.c @@ -730,15 +730,14 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) } if (attr_mask & IB_QP_ACCESS_FLAGS) { - qp_context->params2 |= - cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_WRITE ? - MTHCA_QP_BIT_RWE : 0); - /* - * Only enable RDMA reads and atomics if we have - * responder resources set to a non-zero value. + * Only enable RDMA/atomics if we have responder + * resources set to a non-zero value. */ if (qp->resp_depth) { + qp_context->params2 |= + cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_WRITE ? + MTHCA_QP_BIT_RWE : 0); qp_context->params2 |= cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_READ ? MTHCA_QP_BIT_RRE : 0); @@ -760,19 +759,22 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) if (qp->resp_depth && !attr->max_dest_rd_atomic) { /* * Lowering our responder resources to zero. - * Turn off reads RDMA and atomics as responder. - * (RRE/RAE in params2 already zero) + * Turn off RDMA/atomics as responder. + * (RWE/RRE/RAE in params2 already zero) */ - qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRE | + qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RWE | + MTHCA_QP_OPTPAR_RRE | MTHCA_QP_OPTPAR_RAE); } if (!qp->resp_depth && attr->max_dest_rd_atomic) { /* * Increasing our responder resources from - * zero. Turn on RDMA reads and atomics as - * appropriate. + * zero. Turn on RDMA/atomics as appropriate. */ + qp_context->params2 |= + cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_WRITE ? + MTHCA_QP_BIT_RWE : 0); qp_context->params2 |= cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_READ ? MTHCA_QP_BIT_RRE : 0); @@ -780,7 +782,8 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_ATOMIC ? MTHCA_QP_BIT_RAE : 0); - qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRE | + qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RWE | + MTHCA_QP_OPTPAR_RRE | MTHCA_QP_OPTPAR_RAE); } @@ -871,10 +874,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); mthca_wq_init(&qp->sq); - qp->sq.last = get_send_wqe(qp, qp->sq.max - 1); - mthca_wq_init(&qp->rq); - qp->rq.last = get_recv_wqe(qp, qp->rq.max - 1); if (mthca_is_memfree(dev)) { *qp->sq.db = 0; @@ -921,12 +921,10 @@ static void mthca_adjust_qp_caps(struct mthca_dev *dev, else qp->max_inline_data = max_data_size - MTHCA_INLINE_HEADER_SIZE; - qp->sq.max_gs = min_t(int, dev->limits.max_sg, - max_data_size / sizeof (struct mthca_data_seg)); - qp->rq.max_gs = min_t(int, dev->limits.max_sg, - (min(dev->limits.max_desc_sz, 1 << qp->rq.wqe_shift) - - sizeof (struct mthca_next_seg)) / - sizeof (struct mthca_data_seg)); + qp->sq.max_gs = max_data_size / sizeof (struct mthca_data_seg); + qp->rq.max_gs = (min(dev->limits.max_desc_sz, 1 << qp->rq.wqe_shift) - + sizeof (struct mthca_next_seg)) / + sizeof (struct mthca_data_seg); } /* @@ -1822,7 +1820,6 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, { struct mthca_dev *dev = to_mdev(ibqp->device); struct mthca_qp *qp = to_mqp(ibqp); - __be32 doorbell[2]; void *wqe; void *prev_wqe; unsigned long flags; @@ -1842,34 +1839,6 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, ind = qp->sq.head & (qp->sq.max - 1); for (nreq = 0; wr; ++nreq, wr = wr->next) { - if (unlikely(nreq == MTHCA_ARBEL_MAX_WQES_PER_SEND_DB)) { - nreq = 0; - - doorbell[0] = cpu_to_be32((MTHCA_ARBEL_MAX_WQES_PER_SEND_DB << 24) | - ((qp->sq.head & 0xffff) << 8) | - f0 | op0); - doorbell[1] = cpu_to_be32((qp->qpn << 8) | size0); - - qp->sq.head += MTHCA_ARBEL_MAX_WQES_PER_SEND_DB; - size0 = 0; - - /* - * Make sure that descriptors are written before - * doorbell record. - */ - wmb(); - *qp->sq.db = cpu_to_be32(qp->sq.head & 0xffff); - - /* - * Make sure doorbell record is written before we - * write MMIO send doorbell. - */ - wmb(); - mthca_write64(doorbell, - dev->kar + MTHCA_SEND_DOORBELL, - MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); - } - if (mthca_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)) { mthca_err(dev, "SQ %06x full (%u head, %u tail," " %d max, %d nreq)\n", qp->qpn, @@ -2046,6 +2015,8 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, out: if (likely(nreq)) { + __be32 doorbell[2]; + doorbell[0] = cpu_to_be32((nreq << 24) | ((qp->sq.head & 0xffff) << 8) | f0 | op0); diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_wqe.h b/trunk/drivers/infiniband/hw/mthca/mthca_wqe.h index e7d2c1e86199..73f1c0b9021e 100644 --- a/trunk/drivers/infiniband/hw/mthca/mthca_wqe.h +++ b/trunk/drivers/infiniband/hw/mthca/mthca_wqe.h @@ -50,8 +50,7 @@ enum { enum { MTHCA_INVAL_LKEY = 0x100, - MTHCA_TAVOR_MAX_WQES_PER_RECV_DB = 256, - MTHCA_ARBEL_MAX_WQES_PER_SEND_DB = 255 + MTHCA_TAVOR_MAX_WQES_PER_RECV_DB = 256 }; struct mthca_next_seg { diff --git a/trunk/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/trunk/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 23885801b6d2..54ef2fea530f 100644 --- a/trunk/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/trunk/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -608,13 +608,9 @@ void ipoib_ib_dev_flush(void *_dev) if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) ipoib_ib_dev_up(dev); - down(&priv->vlan_mutex); - /* Flush any child interfaces too */ list_for_each_entry(cpriv, &priv->child_intfs, list) ipoib_ib_dev_flush(&cpriv->dev); - - up(&priv->vlan_mutex); } void ipoib_ib_dev_cleanup(struct net_device *dev) diff --git a/trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c b/trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c index 780009c7eaa6..2fa30751f362 100644 --- a/trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -47,8 +47,6 @@ #include #include -#include - MODULE_AUTHOR("Roland Dreier"); MODULE_DESCRIPTION("IP-over-InfiniBand net driver"); MODULE_LICENSE("Dual BSD/GPL"); @@ -96,10 +94,8 @@ int ipoib_open(struct net_device *dev) if (ipoib_ib_dev_open(dev)) return -EINVAL; - if (ipoib_ib_dev_up(dev)) { - ipoib_ib_dev_stop(dev); + if (ipoib_ib_dev_up(dev)) return -EINVAL; - } if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) { struct ipoib_dev_priv *cpriv; @@ -402,9 +398,9 @@ static void path_rec_completion(int status, while ((skb = __skb_dequeue(&neigh->queue))) __skb_queue_tail(&skqueue, skb); } - } + } else + path->query = NULL; - path->query = NULL; complete(&path->done); spin_unlock_irqrestore(&priv->lock, flags); @@ -432,6 +428,7 @@ static struct ipoib_path *path_rec_create(struct net_device *dev, skb_queue_head_init(&path->queue); INIT_LIST_HEAD(&path->neigh_list); + init_completion(&path->done); memcpy(path->pathrec.dgid.raw, gid->raw, sizeof (union ib_gid)); path->pathrec.sgid = priv->local_gid; @@ -449,8 +446,6 @@ static int path_rec_start(struct net_device *dev, ipoib_dbg(priv, "Start path record lookup for " IPOIB_GID_FMT "\n", IPOIB_GID_ARG(path->pathrec.dgid)); - init_completion(&path->done); - path->query_id = ib_sa_path_rec_get(priv->ca, priv->port, &path->pathrec, diff --git a/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index ed0c2ead8bc1..c33ed87f9dff 100644 --- a/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c @@ -43,8 +43,6 @@ #include #include -#include - #include "ipoib.h" #ifdef CONFIG_INFINIBAND_IPOIB_DEBUG @@ -137,14 +135,20 @@ static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev, if (!mcast) return NULL; + init_completion(&mcast->done); + mcast->dev = dev; mcast->created = jiffies; mcast->backoff = 1; + mcast->logcount = 0; INIT_LIST_HEAD(&mcast->list); INIT_LIST_HEAD(&mcast->neigh_list); skb_queue_head_init(&mcast->pkt_queue); + mcast->ah = NULL; + mcast->query = NULL; + return mcast; } @@ -346,8 +350,6 @@ static int ipoib_mcast_sendonly_join(struct ipoib_mcast *mcast) rec.port_gid = priv->local_gid; rec.pkey = cpu_to_be16(priv->pkey); - init_completion(&mcast->done); - ret = ib_sa_mcmember_rec_set(priv->ca, priv->port, &rec, IB_SA_MCMEMBER_REC_MGID | IB_SA_MCMEMBER_REC_PORT_GID | @@ -467,8 +469,6 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast, rec.traffic_class = priv->broadcast->mcmember.traffic_class; } - init_completion(&mcast->done); - ret = ib_sa_mcmember_rec_set(priv->ca, priv->port, &rec, comp_mask, mcast->backoff * 1000, GFP_ATOMIC, ipoib_mcast_join_complete, diff --git a/trunk/drivers/infiniband/ulp/srp/ib_srp.c b/trunk/drivers/infiniband/ulp/srp/ib_srp.c index ee9fe226ae99..321a3a10e69b 100644 --- a/trunk/drivers/infiniband/ulp/srp/ib_srp.c +++ b/trunk/drivers/infiniband/ulp/srp/ib_srp.c @@ -802,21 +802,13 @@ static int srp_post_recv(struct srp_target_port *target) /* * Must be called with target->scsi_host->host_lock held to protect - * req_lim and tx_head. Lock cannot be dropped between call here and - * call to __srp_post_send(). + * req_lim and tx_head. */ static struct srp_iu *__srp_get_tx_iu(struct srp_target_port *target) { if (target->tx_head - target->tx_tail >= SRP_SQ_SIZE) return NULL; - if (unlikely(target->req_lim < 1)) { - if (printk_ratelimit()) - printk(KERN_DEBUG PFX "Target has req_lim %d\n", - target->req_lim); - return NULL; - } - return target->tx_ring[target->tx_head & SRP_SQ_SIZE]; } @@ -831,6 +823,11 @@ static int __srp_post_send(struct srp_target_port *target, struct ib_send_wr wr, *bad_wr; int ret = 0; + if (target->req_lim < 1) { + printk(KERN_ERR PFX "Target has req_lim %d\n", target->req_lim); + return -EAGAIN; + } + list.addr = iu->dma; list.length = len; list.lkey = target->srp_host->mr->lkey; @@ -1420,8 +1417,6 @@ static ssize_t srp_create_target(struct class_device *class_dev, if (!target_host) return -ENOMEM; - target_host->max_lun = SRP_MAX_LUN; - target = host_to_target(target_host); memset(target, 0, sizeof *target); diff --git a/trunk/drivers/infiniband/ulp/srp/ib_srp.h b/trunk/drivers/infiniband/ulp/srp/ib_srp.h index b564f18caf78..4fec28a71367 100644 --- a/trunk/drivers/infiniband/ulp/srp/ib_srp.h +++ b/trunk/drivers/infiniband/ulp/srp/ib_srp.h @@ -54,7 +54,6 @@ enum { SRP_PORT_REDIRECT = 1, SRP_DLID_REDIRECT = 2, - SRP_MAX_LUN = 512, SRP_MAX_IU_LEN = 256, SRP_RQ_SHIFT = 6, diff --git a/trunk/drivers/input/gameport/gameport.c b/trunk/drivers/input/gameport/gameport.c index caac6d63d46f..0506934244f0 100644 --- a/trunk/drivers/input/gameport/gameport.c +++ b/trunk/drivers/input/gameport/gameport.c @@ -339,20 +339,14 @@ static struct gameport_event *gameport_get_event(void) return event; } -static void gameport_handle_event(void) +static void gameport_handle_events(void) { struct gameport_event *event; struct gameport_driver *gameport_drv; down(&gameport_sem); - /* - * Note that we handle only one event here to give swsusp - * a chance to freeze kgameportd thread. Gameport events - * should be pretty rare so we are not concerned about - * taking performance hit. - */ - if ((event = gameport_get_event())) { + while ((event = gameport_get_event())) { switch (event->type) { case GAMEPORT_REGISTER_PORT: @@ -439,7 +433,7 @@ static struct gameport *gameport_get_pending_child(struct gameport *parent) static int gameport_thread(void *nothing) { do { - gameport_handle_event(); + gameport_handle_events(); wait_event_interruptible(gameport_wait, kthread_should_stop() || !list_empty(&gameport_event_list)); try_to_freeze(); diff --git a/trunk/drivers/input/input.c b/trunk/drivers/input/input.c index bdd2a7fc268d..c8ae2bb054e0 100644 --- a/trunk/drivers/input/input.c +++ b/trunk/drivers/input/input.c @@ -536,7 +536,7 @@ static struct attribute *input_dev_attrs[] = { NULL }; -static struct attribute_group input_dev_attr_group = { +static struct attribute_group input_dev_group = { .attrs = input_dev_attrs, }; @@ -717,14 +717,35 @@ struct input_dev *input_allocate_device(void) return dev; } -int input_register_device(struct input_dev *dev) +static void input_register_classdevice(struct input_dev *dev) { static atomic_t input_no = ATOMIC_INIT(0); + const char *path; + + __module_get(THIS_MODULE); + + dev->dev = dev->cdev.dev; + + snprintf(dev->cdev.class_id, sizeof(dev->cdev.class_id), + "input%ld", (unsigned long) atomic_inc_return(&input_no) - 1); + + path = kobject_get_path(&dev->cdev.class->subsys.kset.kobj, GFP_KERNEL); + printk(KERN_INFO "input: %s as %s/%s\n", + dev->name ? dev->name : "Unspecified device", + path ? path : "", dev->cdev.class_id); + kfree(path); + + class_device_add(&dev->cdev); + sysfs_create_group(&dev->cdev.kobj, &input_dev_group); + sysfs_create_group(&dev->cdev.kobj, &input_dev_id_attr_group); + sysfs_create_group(&dev->cdev.kobj, &input_dev_caps_attr_group); +} + +int input_register_device(struct input_dev *dev) +{ struct input_handle *handle; struct input_handler *handler; struct input_device_id *id; - const char *path; - int error; if (!dev->dynalloc) { printk(KERN_WARNING "input: device %s is statically allocated, will not register\n" @@ -752,32 +773,7 @@ int input_register_device(struct input_dev *dev) INIT_LIST_HEAD(&dev->h_list); list_add_tail(&dev->node, &input_dev_list); - dev->cdev.class = &input_class; - snprintf(dev->cdev.class_id, sizeof(dev->cdev.class_id), - "input%ld", (unsigned long) atomic_inc_return(&input_no) - 1); - - error = class_device_add(&dev->cdev); - if (error) - return error; - - error = sysfs_create_group(&dev->cdev.kobj, &input_dev_attr_group); - if (error) - goto fail1; - - error = sysfs_create_group(&dev->cdev.kobj, &input_dev_id_attr_group); - if (error) - goto fail2; - - error = sysfs_create_group(&dev->cdev.kobj, &input_dev_caps_attr_group); - if (error) - goto fail3; - - __module_get(THIS_MODULE); - - path = kobject_get_path(&dev->cdev.kobj, GFP_KERNEL); - printk(KERN_INFO "input: %s as %s\n", - dev->name ? dev->name : "Unspecified device", path ? path : "N/A"); - kfree(path); + input_register_classdevice(dev); list_for_each_entry(handler, &input_handler_list, node) if (!handler->blacklist || !input_match_device(handler->blacklist, dev)) @@ -788,11 +784,6 @@ int input_register_device(struct input_dev *dev) input_wakeup_procfs_readers(); return 0; - - fail3: sysfs_remove_group(&dev->cdev.kobj, &input_dev_id_attr_group); - fail2: sysfs_remove_group(&dev->cdev.kobj, &input_dev_attr_group); - fail1: class_device_del(&dev->cdev); - return error; } void input_unregister_device(struct input_dev *dev) @@ -814,7 +805,7 @@ void input_unregister_device(struct input_dev *dev) sysfs_remove_group(&dev->cdev.kobj, &input_dev_caps_attr_group); sysfs_remove_group(&dev->cdev.kobj, &input_dev_id_attr_group); - sysfs_remove_group(&dev->cdev.kobj, &input_dev_attr_group); + sysfs_remove_group(&dev->cdev.kobj, &input_dev_group); class_device_unregister(&dev->cdev); input_wakeup_procfs_readers(); diff --git a/trunk/drivers/input/joystick/iforce/iforce-usb.c b/trunk/drivers/input/joystick/iforce/iforce-usb.c index bc2fce60f9f8..64b4a3080985 100644 --- a/trunk/drivers/input/joystick/iforce/iforce-usb.c +++ b/trunk/drivers/input/joystick/iforce/iforce-usb.c @@ -235,6 +235,7 @@ static struct usb_device_id iforce_usb_ids [] = { MODULE_DEVICE_TABLE (usb, iforce_usb_ids); struct usb_driver iforce_usb_driver = { + .owner = THIS_MODULE, .name = "iforce", .probe = iforce_usb_probe, .disconnect = iforce_usb_disconnect, diff --git a/trunk/drivers/input/joystick/warrior.c b/trunk/drivers/input/joystick/warrior.c index 1849b176cf18..99a642d2a1fe 100644 --- a/trunk/drivers/input/joystick/warrior.c +++ b/trunk/drivers/input/joystick/warrior.c @@ -172,7 +172,7 @@ static int warrior_connect(struct serio *serio, struct serio_driver *drv) input_set_abs_params(input_dev, ABS_Y, -64, 64, 0, 8); input_set_abs_params(input_dev, ABS_THROTTLE, -112, 112, 0, 0); input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0); - input_set_abs_params(input_dev, ABS_HAT0Y, -1, 1, 0, 0); + input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0); serio_set_drvdata(serio, warrior); diff --git a/trunk/drivers/input/keyboard/atkbd.c b/trunk/drivers/input/keyboard/atkbd.c index a0256f8de8ef..820c7fd9a604 100644 --- a/trunk/drivers/input/keyboard/atkbd.c +++ b/trunk/drivers/input/keyboard/atkbd.c @@ -166,9 +166,6 @@ static unsigned char atkbd_unxlate_table[128] = { #define ATKBD_SPECIAL 248 -#define ATKBD_LED_EVENT_BIT 0 -#define ATKBD_REP_EVENT_BIT 1 - static struct { unsigned char keycode; unsigned char set2; @@ -214,10 +211,6 @@ struct atkbd { unsigned char err_xl; unsigned int last; unsigned long time; - - struct work_struct event_work; - struct semaphore event_sem; - unsigned long event_mask; }; static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf, @@ -431,86 +424,58 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, } /* - * atkbd_event_work() is used to complete processing of events that - * can not be processed by input_event() which is often called from - * interrupt context. + * Event callback from the input module. Events that change the state of + * the hardware are processed here. */ -static void atkbd_event_work(void *data) +static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) { + struct atkbd *atkbd = dev->private; const short period[32] = { 33, 37, 42, 46, 50, 54, 58, 63, 67, 75, 83, 92, 100, 109, 116, 125, 133, 149, 167, 182, 200, 217, 232, 250, 270, 303, 333, 370, 400, 435, 470, 500 }; const short delay[4] = { 250, 500, 750, 1000 }; - - struct atkbd *atkbd = data; - struct input_dev *dev = atkbd->dev; unsigned char param[2]; int i, j; - down(&atkbd->event_sem); - - if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) { - param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0) - | (test_bit(LED_NUML, dev->led) ? 2 : 0) - | (test_bit(LED_CAPSL, dev->led) ? 4 : 0); - ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS); - - if (atkbd->extra) { - param[0] = 0; - param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0) - | (test_bit(LED_SLEEP, dev->led) ? 0x02 : 0) - | (test_bit(LED_SUSPEND, dev->led) ? 0x04 : 0) - | (test_bit(LED_MISC, dev->led) ? 0x10 : 0) - | (test_bit(LED_MUTE, dev->led) ? 0x20 : 0); - ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_EX_SETLEDS); - } - } - - if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) { - i = j = 0; - while (i < 31 && period[i] < dev->rep[REP_PERIOD]) - i++; - while (j < 3 && delay[j] < dev->rep[REP_DELAY]) - j++; - dev->rep[REP_PERIOD] = period[i]; - dev->rep[REP_DELAY] = delay[j]; - param[0] = i | (j << 5); - ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETREP); - } - - up(&atkbd->event_sem); -} - -/* - * Event callback from the input module. Events that change the state of - * the hardware are processed here. If action can not be performed in - * interrupt context it is offloaded to atkbd_event_work. - */ - -static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) -{ - struct atkbd *atkbd = dev->private; - if (!atkbd->write) return -1; switch (type) { case EV_LED: - set_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask); - wmb(); - schedule_work(&atkbd->event_work); + + param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0) + | (test_bit(LED_NUML, dev->led) ? 2 : 0) + | (test_bit(LED_CAPSL, dev->led) ? 4 : 0); + ps2_schedule_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS); + + if (atkbd->extra) { + param[0] = 0; + param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0) + | (test_bit(LED_SLEEP, dev->led) ? 0x02 : 0) + | (test_bit(LED_SUSPEND, dev->led) ? 0x04 : 0) + | (test_bit(LED_MISC, dev->led) ? 0x10 : 0) + | (test_bit(LED_MUTE, dev->led) ? 0x20 : 0); + ps2_schedule_command(&atkbd->ps2dev, param, ATKBD_CMD_EX_SETLEDS); + } + return 0; case EV_REP: - if (!atkbd->softrepeat) { - set_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask); - wmb(); - schedule_work(&atkbd->event_work); - } + if (atkbd->softrepeat) return 0; + + i = j = 0; + while (i < 31 && period[i] < dev->rep[REP_PERIOD]) + i++; + while (j < 3 && delay[j] < dev->rep[REP_DELAY]) + j++; + dev->rep[REP_PERIOD] = period[i]; + dev->rep[REP_DELAY] = delay[j]; + param[0] = i | (j << 5); + ps2_schedule_command(&atkbd->ps2dev, param, ATKBD_CMD_SETREP); return 0; } @@ -845,8 +810,6 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) atkbd->dev = dev; ps2_init(&atkbd->ps2dev, serio); - INIT_WORK(&atkbd->event_work, atkbd_event_work, atkbd); - init_MUTEX(&atkbd->event_sem); switch (serio->id.type) { diff --git a/trunk/drivers/input/misc/Kconfig b/trunk/drivers/input/misc/Kconfig index e08dbe08f46d..b3eaac1b35b6 100644 --- a/trunk/drivers/input/misc/Kconfig +++ b/trunk/drivers/input/misc/Kconfig @@ -26,7 +26,7 @@ config INPUT_PCSPKR config INPUT_SPARCSPKR tristate "SPARC Speaker support" - depends on PCI && SPARC + depends on PCI && (SPARC32 || SPARC64) help Say Y here if you want the standard Speaker on Sparc PCI systems to be used for bells and whistles. @@ -40,16 +40,6 @@ config INPUT_M68K_BEEP tristate "M68k Beeper support" depends on M68K -config INPUT_WISTRON_BTNS - tristate "x86 Wistron laptop button interface" - depends on X86 && !X86_64 - help - Say Y here for support of Winstron laptop button interface, used on - laptops of various brands, including Acer and Fujitsu-Siemens. - - To compile this driver as a module, choose M here: the module will - be called wistron_btns. - config INPUT_UINPUT tristate "User level driver support" help diff --git a/trunk/drivers/input/misc/Makefile b/trunk/drivers/input/misc/Makefile index ce44cce01285..f8d01c69f349 100644 --- a/trunk/drivers/input/misc/Makefile +++ b/trunk/drivers/input/misc/Makefile @@ -9,5 +9,4 @@ obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o obj-$(CONFIG_INPUT_98SPKR) += 98spkr.o obj-$(CONFIG_INPUT_UINPUT) += uinput.o -obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o diff --git a/trunk/drivers/input/misc/uinput.c b/trunk/drivers/input/misc/uinput.c index 546ed9b4901d..948c1cc01bc9 100644 --- a/trunk/drivers/input/misc/uinput.c +++ b/trunk/drivers/input/misc/uinput.c @@ -92,19 +92,24 @@ static void uinput_request_done(struct uinput_device *udev, struct uinput_reques { /* Mark slot as available */ udev->requests[request->id] = NULL; - wake_up(&udev->requests_waitq); + wake_up_interruptible(&udev->requests_waitq); complete(&request->done); } static int uinput_request_submit(struct input_dev *dev, struct uinput_request *request) { + int retval; + /* Tell our userspace app about this new request by queueing an input event */ uinput_dev_event(dev, EV_UINPUT, request->code, request->id); /* Wait for the request to complete */ - wait_for_completion(&request->done); - return request->retval; + retval = wait_for_completion_interruptible(&request->done); + if (!retval) + retval = request->retval; + + return retval; } static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *effect) @@ -147,62 +152,67 @@ static int uinput_dev_erase_effect(struct input_dev *dev, int effect_id) return retval; } -static void uinput_destroy_device(struct uinput_device *udev) +static int uinput_create_device(struct uinput_device *udev) { - const char *name, *phys; - - if (udev->dev) { - name = udev->dev->name; - phys = udev->dev->phys; - if (udev->state == UIST_CREATED) - input_unregister_device(udev->dev); - else - input_free_device(udev->dev); - kfree(name); - kfree(phys); - udev->dev = NULL; + if (!udev->dev->name) { + printk(KERN_DEBUG "%s: write device info first\n", UINPUT_NAME); + return -EINVAL; } - udev->state = UIST_NEW_DEVICE; + udev->dev->event = uinput_dev_event; + udev->dev->upload_effect = uinput_dev_upload_effect; + udev->dev->erase_effect = uinput_dev_erase_effect; + udev->dev->private = udev; + + init_waitqueue_head(&udev->waitq); + + input_register_device(udev->dev); + + set_bit(UIST_CREATED, &udev->state); + + return 0; } -static int uinput_create_device(struct uinput_device *udev) +static int uinput_destroy_device(struct uinput_device *udev) { - int error; - - if (udev->state != UIST_SETUP_COMPLETE) { - printk(KERN_DEBUG "%s: write device info first\n", UINPUT_NAME); + if (!test_bit(UIST_CREATED, &udev->state)) { + printk(KERN_WARNING "%s: create the device first\n", UINPUT_NAME); return -EINVAL; } - error = input_register_device(udev->dev); - if (error) { - uinput_destroy_device(udev); - return error; - } + input_unregister_device(udev->dev); - udev->state = UIST_CREATED; + clear_bit(UIST_CREATED, &udev->state); return 0; } static int uinput_open(struct inode *inode, struct file *file) { - struct uinput_device *newdev; + struct uinput_device *newdev; + struct input_dev *newinput; - newdev = kzalloc(sizeof(struct uinput_device), GFP_KERNEL); + newdev = kmalloc(sizeof(struct uinput_device), GFP_KERNEL); if (!newdev) - return -ENOMEM; - - init_MUTEX(&newdev->sem); + goto error; + memset(newdev, 0, sizeof(struct uinput_device)); spin_lock_init(&newdev->requests_lock); init_waitqueue_head(&newdev->requests_waitq); - init_waitqueue_head(&newdev->waitq); - newdev->state = UIST_NEW_DEVICE; + + newinput = kmalloc(sizeof(struct input_dev), GFP_KERNEL); + if (!newinput) + goto cleanup; + memset(newinput, 0, sizeof(struct input_dev)); + + newdev->dev = newinput; file->private_data = newdev; return 0; +cleanup: + kfree(newdev); +error: + return -ENOMEM; } static int uinput_validate_absbits(struct input_dev *dev) @@ -236,55 +246,34 @@ static int uinput_validate_absbits(struct input_dev *dev) return retval; } -static int uinput_allocate_device(struct uinput_device *udev) -{ - udev->dev = input_allocate_device(); - if (!udev->dev) - return -ENOMEM; - - udev->dev->event = uinput_dev_event; - udev->dev->upload_effect = uinput_dev_upload_effect; - udev->dev->erase_effect = uinput_dev_erase_effect; - udev->dev->private = udev; - - return 0; -} - -static int uinput_setup_device(struct uinput_device *udev, const char __user *buffer, size_t count) +static int uinput_alloc_device(struct file *file, const char __user *buffer, size_t count) { struct uinput_user_dev *user_dev; struct input_dev *dev; + struct uinput_device *udev; char *name; int size; int retval; - if (count != sizeof(struct uinput_user_dev)) - return -EINVAL; - - if (!udev->dev) { - retval = uinput_allocate_device(udev); - if (retval) - return retval; - } + retval = count; + udev = file->private_data; dev = udev->dev; user_dev = kmalloc(sizeof(struct uinput_user_dev), GFP_KERNEL); - if (!user_dev) - return -ENOMEM; - - if (copy_from_user(user_dev, buffer, sizeof(struct uinput_user_dev))) { - retval = -EFAULT; + if (!user_dev) { + retval = -ENOMEM; goto exit; } - size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1; - if (!size) { - retval = -EINVAL; + if (copy_from_user(user_dev, buffer, sizeof(struct uinput_user_dev))) { + retval = -EFAULT; goto exit; } kfree(dev->name); + + size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1; dev->name = name = kmalloc(size, GFP_KERNEL); if (!name) { retval = -ENOMEM; @@ -307,50 +296,32 @@ static int uinput_setup_device(struct uinput_device *udev, const char __user *bu /* check if absmin/absmax/absfuzz/absflat are filled as * told in Documentation/input/input-programming.txt */ if (test_bit(EV_ABS, dev->evbit)) { - retval = uinput_validate_absbits(dev); - if (retval < 0) - goto exit; + int err = uinput_validate_absbits(dev); + if (err < 0) { + retval = err; + kfree(dev->name); + } } - udev->state = UIST_SETUP_COMPLETE; - retval = count; - - exit: +exit: kfree(user_dev); return retval; } -static inline ssize_t uinput_inject_event(struct uinput_device *udev, const char __user *buffer, size_t count) -{ - struct input_event ev; - - if (count != sizeof(struct input_event)) - return -EINVAL; - - if (copy_from_user(&ev, buffer, sizeof(struct input_event))) - return -EFAULT; - - input_event(udev->dev, ev.type, ev.code, ev.value); - - return sizeof(struct input_event); -} - static ssize_t uinput_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { struct uinput_device *udev = file->private_data; - int retval; - - retval = down_interruptible(&udev->sem); - if (retval) - return retval; - retval = udev->state == UIST_CREATED ? - uinput_inject_event(udev, buffer, count) : - uinput_setup_device(udev, buffer, count); + if (test_bit(UIST_CREATED, &udev->state)) { + struct input_event ev; - up(&udev->sem); + if (copy_from_user(&ev, buffer, sizeof(struct input_event))) + return -EFAULT; + input_event(udev->dev, ev.type, ev.code, ev.value); + } else + count = uinput_alloc_device(file, buffer, count); - return retval; + return count; } static ssize_t uinput_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) @@ -358,38 +329,28 @@ static ssize_t uinput_read(struct file *file, char __user *buffer, size_t count, struct uinput_device *udev = file->private_data; int retval = 0; - if (udev->state != UIST_CREATED) + if (!test_bit(UIST_CREATED, &udev->state)) return -ENODEV; if (udev->head == udev->tail && (file->f_flags & O_NONBLOCK)) return -EAGAIN; retval = wait_event_interruptible(udev->waitq, - udev->head != udev->tail || udev->state != UIST_CREATED); - if (retval) - return retval; - - retval = down_interruptible(&udev->sem); + udev->head != udev->tail || !test_bit(UIST_CREATED, &udev->state)); if (retval) return retval; - if (udev->state != UIST_CREATED) { - retval = -ENODEV; - goto out; - } + if (!test_bit(UIST_CREATED, &udev->state)) + return -ENODEV; - while (udev->head != udev->tail && retval + sizeof(struct input_event) <= count) { - if (copy_to_user(buffer + retval, &udev->buff[udev->tail], sizeof(struct input_event))) { - retval = -EFAULT; - goto out; - } + while ((udev->head != udev->tail) && + (retval + sizeof(struct input_event) <= count)) { + if (copy_to_user(buffer + retval, &udev->buff[udev->tail], sizeof(struct input_event))) + return -EFAULT; udev->tail = (udev->tail + 1) % UINPUT_BUFFER_SIZE; retval += sizeof(struct input_event); } - out: - up(&udev->sem); - return retval; } @@ -405,30 +366,28 @@ static unsigned int uinput_poll(struct file *file, poll_table *wait) return 0; } -static int uinput_release(struct inode *inode, struct file *file) +static int uinput_burn_device(struct uinput_device *udev) { - struct uinput_device *udev = file->private_data; + if (test_bit(UIST_CREATED, &udev->state)) + uinput_destroy_device(udev); - uinput_destroy_device(udev); + kfree(udev->dev->name); + kfree(udev->dev->phys); + kfree(udev->dev); kfree(udev); return 0; } -#define uinput_set_bit(_arg, _bit, _max) \ -({ \ - int __ret = 0; \ - if (udev->state == UIST_CREATED) \ - __ret = -EINVAL; \ - else if ((_arg) > (_max)) \ - __ret = -EINVAL; \ - else set_bit((_arg), udev->dev->_bit); \ - __ret; \ -}) - -static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +static int uinput_close(struct inode *inode, struct file *file) { - int retval; + uinput_burn_device(file->private_data); + return 0; +} + +static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +{ + int retval = 0; struct uinput_device *udev; void __user *p = (void __user *)arg; struct uinput_ff_upload ff_up; @@ -439,14 +398,19 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg) udev = file->private_data; - retval = down_interruptible(&udev->sem); - if (retval) - return retval; - - if (!udev->dev) { - retval = uinput_allocate_device(udev); - if (retval) - goto out; + /* device attributes can not be changed after the device is created */ + switch (cmd) { + case UI_SET_EVBIT: + case UI_SET_KEYBIT: + case UI_SET_RELBIT: + case UI_SET_ABSBIT: + case UI_SET_MSCBIT: + case UI_SET_LEDBIT: + case UI_SET_SNDBIT: + case UI_SET_FFBIT: + case UI_SET_PHYS: + if (test_bit(UIST_CREATED, &udev->state)) + return -EINVAL; } switch (cmd) { @@ -455,50 +419,74 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg) break; case UI_DEV_DESTROY: - uinput_destroy_device(udev); + retval = uinput_destroy_device(udev); break; case UI_SET_EVBIT: - retval = uinput_set_bit(arg, evbit, EV_MAX); + if (arg > EV_MAX) { + retval = -EINVAL; + break; + } + set_bit(arg, udev->dev->evbit); break; case UI_SET_KEYBIT: - retval = uinput_set_bit(arg, keybit, KEY_MAX); + if (arg > KEY_MAX) { + retval = -EINVAL; + break; + } + set_bit(arg, udev->dev->keybit); break; case UI_SET_RELBIT: - retval = uinput_set_bit(arg, relbit, REL_MAX); + if (arg > REL_MAX) { + retval = -EINVAL; + break; + } + set_bit(arg, udev->dev->relbit); break; case UI_SET_ABSBIT: - retval = uinput_set_bit(arg, absbit, ABS_MAX); + if (arg > ABS_MAX) { + retval = -EINVAL; + break; + } + set_bit(arg, udev->dev->absbit); break; case UI_SET_MSCBIT: - retval = uinput_set_bit(arg, mscbit, MSC_MAX); + if (arg > MSC_MAX) { + retval = -EINVAL; + break; + } + set_bit(arg, udev->dev->mscbit); break; case UI_SET_LEDBIT: - retval = uinput_set_bit(arg, ledbit, LED_MAX); + if (arg > LED_MAX) { + retval = -EINVAL; + break; + } + set_bit(arg, udev->dev->ledbit); break; case UI_SET_SNDBIT: - retval = uinput_set_bit(arg, sndbit, SND_MAX); + if (arg > SND_MAX) { + retval = -EINVAL; + break; + } + set_bit(arg, udev->dev->sndbit); break; case UI_SET_FFBIT: - retval = uinput_set_bit(arg, ffbit, FF_MAX); - break; - - case UI_SET_SWBIT: - retval = uinput_set_bit(arg, swbit, SW_MAX); + if (arg > FF_MAX) { + retval = -EINVAL; + break; + } + set_bit(arg, udev->dev->ffbit); break; case UI_SET_PHYS: - if (udev->state == UIST_CREATED) { - retval = -EINVAL; - goto out; - } length = strnlen_user(p, 1024); if (length <= 0) { retval = -EFAULT; @@ -587,26 +575,23 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg) default: retval = -EINVAL; } - - out: - up(&udev->sem); return retval; } static struct file_operations uinput_fops = { - .owner = THIS_MODULE, - .open = uinput_open, - .release = uinput_release, - .read = uinput_read, - .write = uinput_write, - .poll = uinput_poll, - .unlocked_ioctl = uinput_ioctl, + .owner = THIS_MODULE, + .open = uinput_open, + .release = uinput_close, + .read = uinput_read, + .write = uinput_write, + .poll = uinput_poll, + .ioctl = uinput_ioctl, }; static struct miscdevice uinput_misc = { - .fops = &uinput_fops, - .minor = UINPUT_MINOR, - .name = UINPUT_NAME, + .fops = &uinput_fops, + .minor = UINPUT_MINOR, + .name = UINPUT_NAME, }; static int __init uinput_init(void) diff --git a/trunk/drivers/input/misc/wistron_btns.c b/trunk/drivers/input/misc/wistron_btns.c deleted file mode 100644 index bac3085185fe..000000000000 --- a/trunk/drivers/input/misc/wistron_btns.c +++ /dev/null @@ -1,561 +0,0 @@ -/* - * Wistron laptop button driver - * Copyright (C) 2005 Miloslav Trmac - * Copyright (C) 2005 Bernhard Rosenkraenzer - * Copyright (C) 2005 Dmitry Torokhov - * - * You can redistribute and/or modify this program under the terms of the - * GNU General Public License version 2 as published by the Free Software - * Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - * Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place Suite 330, Boston, MA 02111-1307, USA. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Number of attempts to read data from queue per poll; - * the queue can hold up to 31 entries - */ -#define MAX_POLL_ITERATIONS 64 - -#define POLL_FREQUENCY 10 /* Number of polls per second */ - -#if POLL_FREQUENCY > HZ -#error "POLL_FREQUENCY too high" -#endif - -/* BIOS subsystem IDs */ -#define WIFI 0x35 -#define BLUETOOTH 0x34 - -MODULE_AUTHOR("Miloslav Trmac "); -MODULE_DESCRIPTION("Wistron laptop button driver"); -MODULE_LICENSE("GPL v2"); -MODULE_VERSION("0.1"); - -static int force; /* = 0; */ -module_param(force, bool, 0); -MODULE_PARM_DESC(force, "Load even if computer is not in database"); - -static char *keymap_name; /* = NULL; */ -module_param_named(keymap, keymap_name, charp, 0); -MODULE_PARM_DESC(keymap, "Keymap name, if it can't be autodetected"); - -static struct platform_device *wistron_device; - - /* BIOS interface implementation */ - -static void __iomem *bios_entry_point; /* BIOS routine entry point */ -static void __iomem *bios_code_map_base; -static void __iomem *bios_data_map_base; - -static u8 cmos_address; - -struct regs { - u32 eax, ebx, ecx; -}; - -static void call_bios(struct regs *regs) -{ - unsigned long flags; - - preempt_disable(); - local_irq_save(flags); - asm volatile ("pushl %%ebp;" - "movl %7, %%ebp;" - "call *%6;" - "popl %%ebp" - : "=a" (regs->eax), "=b" (regs->ebx), "=c" (regs->ecx) - : "0" (regs->eax), "1" (regs->ebx), "2" (regs->ecx), - "m" (bios_entry_point), "m" (bios_data_map_base) - : "edx", "edi", "esi", "memory"); - local_irq_restore(flags); - preempt_enable(); -} - -static size_t __init locate_wistron_bios(void __iomem *base) -{ - static const unsigned char __initdata signature[] = - { 0x42, 0x21, 0x55, 0x30 }; - size_t offset; - - for (offset = 0; offset < 0x10000; offset += 0x10) { - if (check_signature(base + offset, signature, - sizeof(signature)) != 0) - return offset; - } - return -1; -} - -static int __init map_bios(void) -{ - void __iomem *base; - size_t offset; - u32 entry_point; - - base = ioremap(0xF0000, 0x10000); /* Can't fail */ - offset = locate_wistron_bios(base); - if (offset < 0) { - printk(KERN_ERR "wistron_btns: BIOS entry point not found\n"); - iounmap(base); - return -ENODEV; - } - - entry_point = readl(base + offset + 5); - printk(KERN_DEBUG - "wistron_btns: BIOS signature found at %p, entry point %08X\n", - base + offset, entry_point); - - if (entry_point >= 0xF0000) { - bios_code_map_base = base; - bios_entry_point = bios_code_map_base + (entry_point & 0xFFFF); - } else { - iounmap(base); - bios_code_map_base = ioremap(entry_point & ~0x3FFF, 0x4000); - if (bios_code_map_base == NULL) { - printk(KERN_ERR - "wistron_btns: Can't map BIOS code at %08X\n", - entry_point & ~0x3FFF); - goto err; - } - bios_entry_point = bios_code_map_base + (entry_point & 0x3FFF); - } - /* The Windows driver maps 0x10000 bytes, we keep only one page... */ - bios_data_map_base = ioremap(0x400, 0xc00); - if (bios_data_map_base == NULL) { - printk(KERN_ERR "wistron_btns: Can't map BIOS data\n"); - goto err_code; - } - return 0; - -err_code: - iounmap(bios_code_map_base); -err: - return -ENOMEM; -} - -static inline void unmap_bios(void) -{ - iounmap(bios_code_map_base); - iounmap(bios_data_map_base); -} - - /* BIOS calls */ - -static u16 bios_pop_queue(void) -{ - struct regs regs; - - memset(®s, 0, sizeof (regs)); - regs.eax = 0x9610; - regs.ebx = 0x061C; - regs.ecx = 0x0000; - call_bios(®s); - - return regs.eax; -} - -static void __init bios_attach(void) -{ - struct regs regs; - - memset(®s, 0, sizeof (regs)); - regs.eax = 0x9610; - regs.ebx = 0x012E; - call_bios(®s); -} - -static void bios_detach(void) -{ - struct regs regs; - - memset(®s, 0, sizeof (regs)); - regs.eax = 0x9610; - regs.ebx = 0x002E; - call_bios(®s); -} - -static u8 __init bios_get_cmos_address(void) -{ - struct regs regs; - - memset(®s, 0, sizeof (regs)); - regs.eax = 0x9610; - regs.ebx = 0x051C; - call_bios(®s); - - return regs.ecx; -} - -static u16 __init bios_get_default_setting(u8 subsys) -{ - struct regs regs; - - memset(®s, 0, sizeof (regs)); - regs.eax = 0x9610; - regs.ebx = 0x0200 | subsys; - call_bios(®s); - - return regs.eax; -} - -static void bios_set_state(u8 subsys, int enable) -{ - struct regs regs; - - memset(®s, 0, sizeof (regs)); - regs.eax = 0x9610; - regs.ebx = (enable ? 0x0100 : 0x0000) | subsys; - call_bios(®s); -} - -/* Hardware database */ - -struct key_entry { - char type; /* See KE_* below */ - u8 code; - unsigned keycode; /* For KE_KEY */ -}; - -enum { KE_END, KE_KEY, KE_WIFI, KE_BLUETOOTH }; - -static const struct key_entry *keymap; /* = NULL; Current key map */ -static int have_wifi; -static int have_bluetooth; - -static int __init dmi_matched(struct dmi_system_id *dmi) -{ - const struct key_entry *key; - - keymap = dmi->driver_data; - for (key = keymap; key->type != KE_END; key++) { - if (key->type == KE_WIFI) { - have_wifi = 1; - break; - } else if (key->type == KE_BLUETOOTH) { - have_bluetooth = 1; - break; - } - } - return 1; -} - -static struct key_entry keymap_empty[] = { - { KE_END, 0 } -}; - -static struct key_entry keymap_fs_amilo_pro_v2000[] = { - { KE_KEY, 0x01, KEY_HELP }, - { KE_KEY, 0x11, KEY_PROG1 }, - { KE_KEY, 0x12, KEY_PROG2 }, - { KE_WIFI, 0x30, 0 }, - { KE_KEY, 0x31, KEY_MAIL }, - { KE_KEY, 0x36, KEY_WWW }, - { KE_END, 0 } -}; - -static struct key_entry keymap_wistron_ms2141[] = { - { KE_KEY, 0x11, KEY_PROG1 }, - { KE_KEY, 0x12, KEY_PROG2 }, - { KE_WIFI, 0x30, 0 }, - { KE_KEY, 0x22, KEY_REWIND }, - { KE_KEY, 0x23, KEY_FORWARD }, - { KE_KEY, 0x24, KEY_PLAYPAUSE }, - { KE_KEY, 0x25, KEY_STOPCD }, - { KE_KEY, 0x31, KEY_MAIL }, - { KE_KEY, 0x36, KEY_WWW }, - { KE_END, 0 } -}; - -static struct key_entry keymap_acer_aspire_1500[] = { - { KE_KEY, 0x11, KEY_PROG1 }, - { KE_KEY, 0x12, KEY_PROG2 }, - { KE_WIFI, 0x30, 0 }, - { KE_KEY, 0x31, KEY_MAIL }, - { KE_KEY, 0x36, KEY_WWW }, - { KE_BLUETOOTH, 0x44, 0 }, - { KE_END, 0 } -}; - -/* - * If your machine is not here (which is currently rather likely), please send - * a list of buttons and their key codes (reported when loading this module - * with force=1) and the output of dmidecode to $MODULE_AUTHOR. - */ -static struct dmi_system_id dmi_ids[] = { - { - .callback = dmi_matched, - .ident = "Fujitsu-Siemens Amilo Pro V2000", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), - DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2000"), - }, - .driver_data = keymap_fs_amilo_pro_v2000 - }, - { - .callback = dmi_matched, - .ident = "Acer Aspire 1500", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1500"), - }, - .driver_data = keymap_acer_aspire_1500 - }, - { NULL, } -}; - -static int __init select_keymap(void) -{ - if (keymap_name != NULL) { - if (strcmp (keymap_name, "1557/MS2141") == 0) - keymap = keymap_wistron_ms2141; - else { - printk(KERN_ERR "wistron_btns: Keymap unknown\n"); - return -EINVAL; - } - } - dmi_check_system(dmi_ids); - if (keymap == NULL) { - if (!force) { - printk(KERN_ERR "wistron_btns: System unknown\n"); - return -ENODEV; - } - keymap = keymap_empty; - } - return 0; -} - - /* Input layer interface */ - -static struct input_dev *input_dev; - -static int __init setup_input_dev(void) -{ - const struct key_entry *key; - int error; - - input_dev = input_allocate_device(); - if (!input_dev) - return -ENOMEM; - - input_dev->name = "Wistron laptop buttons"; - input_dev->phys = "wistron/input0"; - input_dev->id.bustype = BUS_HOST; - input_dev->cdev.dev = &wistron_device->dev; - - for (key = keymap; key->type != KE_END; key++) { - if (key->type == KE_KEY) { - input_dev->evbit[LONG(EV_KEY)] = BIT(EV_KEY); - set_bit(key->keycode, input_dev->keybit); - } - } - - error = input_register_device(input_dev); - if (error) { - input_free_device(input_dev); - return error; - } - - return 0; -} - -static void report_key(unsigned keycode) -{ - input_report_key(input_dev, keycode, 1); - input_sync(input_dev); - input_report_key(input_dev, keycode, 0); - input_sync(input_dev); -} - - /* Driver core */ - -static int wifi_enabled; -static int bluetooth_enabled; - -static void poll_bios(unsigned long); - -static struct timer_list poll_timer = TIMER_INITIALIZER(poll_bios, 0, 0); - -static void handle_key(u8 code) -{ - const struct key_entry *key; - - for (key = keymap; key->type != KE_END; key++) { - if (code == key->code) { - switch (key->type) { - case KE_KEY: - report_key(key->keycode); - break; - - case KE_WIFI: - if (have_wifi) { - wifi_enabled = !wifi_enabled; - bios_set_state(WIFI, wifi_enabled); - } - break; - - case KE_BLUETOOTH: - if (have_bluetooth) { - bluetooth_enabled = !bluetooth_enabled; - bios_set_state(BLUETOOTH, bluetooth_enabled); - } - break; - - case KE_END: - default: - BUG(); - } - return; - } - } - printk(KERN_NOTICE "wistron_btns: Unknown key code %02X\n", code); -} - -static void poll_bios(unsigned long discard) -{ - u8 qlen; - u16 val; - - for (;;) { - qlen = CMOS_READ(cmos_address); - if (qlen == 0) - break; - val = bios_pop_queue(); - if (val != 0 && !discard) - handle_key((u8)val); - } - - mod_timer(&poll_timer, jiffies + HZ / POLL_FREQUENCY); -} - -static int wistron_suspend(struct platform_device *dev, pm_message_t state) -{ - del_timer_sync(&poll_timer); - - if (have_wifi) - bios_set_state(WIFI, 0); - - if (have_bluetooth) - bios_set_state(BLUETOOTH, 0); - - return 0; -} - -static int wistron_resume(struct platform_device *dev) -{ - if (have_wifi) - bios_set_state(WIFI, wifi_enabled); - - if (have_bluetooth) - bios_set_state(BLUETOOTH, bluetooth_enabled); - - poll_bios(1); - - return 0; -} - -static struct platform_driver wistron_driver = { - .suspend = wistron_suspend, - .resume = wistron_resume, - .driver = { - .name = "wistron-bios", - }, -}; - -static int __init wb_module_init(void) -{ - int err; - - err = select_keymap(); - if (err) - return err; - - err = map_bios(); - if (err) - return err; - - bios_attach(); - cmos_address = bios_get_cmos_address(); - - err = platform_driver_register(&wistron_driver); - if (err) - goto err_detach_bios; - - wistron_device = platform_device_register_simple("wistron-bios", -1, NULL, 0); - if (IS_ERR(wistron_device)) { - err = PTR_ERR(wistron_device); - goto err_unregister_driver; - } - - if (have_wifi) { - u16 wifi = bios_get_default_setting(WIFI); - if (wifi & 1) - wifi_enabled = (wifi & 2) ? 1 : 0; - else - have_wifi = 0; - - if (have_wifi) - bios_set_state(WIFI, wifi_enabled); - } - - if (have_bluetooth) { - u16 bt = bios_get_default_setting(BLUETOOTH); - if (bt & 1) - bluetooth_enabled = (bt & 2) ? 1 : 0; - else - have_bluetooth = 0; - - if (have_bluetooth) - bios_set_state(BLUETOOTH, bluetooth_enabled); - } - - err = setup_input_dev(); - if (err) - goto err_unregister_device; - - poll_bios(1); /* Flush stale event queue and arm timer */ - - return 0; - - err_unregister_device: - platform_device_unregister(wistron_device); - err_unregister_driver: - platform_driver_unregister(&wistron_driver); - err_detach_bios: - bios_detach(); - unmap_bios(); - - return err; -} - -static void __exit wb_module_exit(void) -{ - del_timer_sync(&poll_timer); - input_unregister_device(input_dev); - platform_device_unregister(wistron_device); - platform_driver_unregister(&wistron_driver); - bios_detach(); - unmap_bios(); -} - -module_init(wb_module_init); -module_exit(wb_module_exit); diff --git a/trunk/drivers/input/mouse/alps.c b/trunk/drivers/input/mouse/alps.c index 4f41ec3e4332..4acc7fd4cd0f 100644 --- a/trunk/drivers/input/mouse/alps.c +++ b/trunk/drivers/input/mouse/alps.c @@ -42,7 +42,7 @@ static struct alps_model_info alps_model_data[] = { { { 0x53, 0x02, 0x14 }, 0xf8, 0xf8, 0 }, { { 0x63, 0x02, 0x0a }, 0xf8, 0xf8, 0 }, { { 0x63, 0x02, 0x14 }, 0xf8, 0xf8, 0 }, - { { 0x63, 0x02, 0x28 }, 0xf8, 0xf8, ALPS_FW_BK_2 }, /* Fujitsu Siemens S6010 */ + { { 0x63, 0x02, 0x28 }, 0xf8, 0xf8, 0 }, { { 0x63, 0x02, 0x3c }, 0x8f, 0x8f, ALPS_WHEEL }, /* Toshiba Satellite S2400-103 */ { { 0x63, 0x02, 0x50 }, 0xef, 0xef, ALPS_FW_BK_1 }, /* NEC Versa L320 */ { { 0x63, 0x02, 0x64 }, 0xf8, 0xf8, 0 }, diff --git a/trunk/drivers/input/mouse/sermouse.c b/trunk/drivers/input/mouse/sermouse.c index 2f9a04ae725f..4bf584364d28 100644 --- a/trunk/drivers/input/mouse/sermouse.c +++ b/trunk/drivers/input/mouse/sermouse.c @@ -95,7 +95,7 @@ static void sermouse_process_msc(struct sermouse *sermouse, signed char data, st input_sync(dev); - if (++sermouse->count == 5) + if (++sermouse->count == (5 - ((sermouse->type == SERIO_SUN) << 1))) sermouse->count = 0; } diff --git a/trunk/drivers/input/serio/i8042.h b/trunk/drivers/input/serio/i8042.h index cbbf3842da5b..13835039a2a7 100644 --- a/trunk/drivers/input/serio/i8042.h +++ b/trunk/drivers/input/serio/i8042.h @@ -21,7 +21,7 @@ #include "i8042-ip22io.h" #elif defined(CONFIG_PPC) #include "i8042-ppcio.h" -#elif defined(CONFIG_SPARC) +#elif defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) #include "i8042-sparcio.h" #elif defined(CONFIG_X86) || defined(CONFIG_IA64) #include "i8042-x86ia64io.h" diff --git a/trunk/drivers/input/serio/serio.c b/trunk/drivers/input/serio/serio.c index fbb69ef6a77b..edd15db17715 100644 --- a/trunk/drivers/input/serio/serio.c +++ b/trunk/drivers/input/serio/serio.c @@ -269,20 +269,14 @@ static struct serio_event *serio_get_event(void) return event; } -static void serio_handle_event(void) +static void serio_handle_events(void) { struct serio_event *event; struct serio_driver *serio_drv; down(&serio_sem); - /* - * Note that we handle only one event here to give swsusp - * a chance to freeze kseriod thread. Serio events should - * be pretty rare so we are not concerned about taking - * performance hit. - */ - if ((event = serio_get_event())) { + while ((event = serio_get_event())) { switch (event->type) { case SERIO_REGISTER_PORT: @@ -374,7 +368,7 @@ static struct serio *serio_get_pending_child(struct serio *parent) static int serio_thread(void *nothing) { do { - serio_handle_event(); + serio_handle_events(); wait_event_interruptible(serio_wait, kthread_should_stop() || !list_empty(&serio_event_list)); try_to_freeze(); diff --git a/trunk/drivers/isdn/hisax/Kconfig b/trunk/drivers/isdn/hisax/Kconfig index c82105920d71..801c98f30e5c 100644 --- a/trunk/drivers/isdn/hisax/Kconfig +++ b/trunk/drivers/isdn/hisax/Kconfig @@ -110,7 +110,7 @@ config HISAX_16_3 config HISAX_TELESPCI bool "Teles PCI" - depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K)) + depends on PCI && (BROKEN || !(SPARC64 || PPC)) help This enables HiSax support for the Teles PCI. See on how to configure it. @@ -238,7 +238,7 @@ config HISAX_MIC config HISAX_NETJET bool "NETjet card" - depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K)) + depends on PCI && (BROKEN || !(SPARC64 || PPC)) help This enables HiSax support for the NetJet from Traverse Technologies. @@ -249,7 +249,7 @@ config HISAX_NETJET config HISAX_NETJET_U bool "NETspider U card" - depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K)) + depends on PCI && (BROKEN || !(SPARC64 || PPC)) help This enables HiSax support for the Netspider U interface ISDN card from Traverse Technologies. @@ -317,7 +317,7 @@ config HISAX_GAZEL config HISAX_HFC_PCI bool "HFC PCI-Bus cards" - depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K)) + depends on PCI && (BROKEN || !(SPARC64 || PPC)) help This enables HiSax support for the HFC-S PCI 2BDS0 based cards. @@ -344,14 +344,14 @@ config HISAX_HFC_SX config HISAX_ENTERNOW_PCI bool "Formula-n enter:now PCI card" - depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K)) + depends on PCI && (BROKEN || !(SPARC64 || PPC)) help This enables HiSax support for the Formula-n enter:now PCI ISDN card. config HISAX_AMD7930 bool "Am7930 (EXPERIMENTAL)" - depends on EXPERIMENTAL && SPARC + depends on EXPERIMENTAL && (SPARC32 || SPARC64) help This enables HiSax support for the AMD7930 chips on some SPARCs. This code is not finished yet. diff --git a/trunk/drivers/isdn/hisax/hfc_usb.c b/trunk/drivers/isdn/hisax/hfc_usb.c index ca5b4a3b683e..32bf0d5d0f9a 100644 --- a/trunk/drivers/isdn/hisax/hfc_usb.c +++ b/trunk/drivers/isdn/hisax/hfc_usb.c @@ -71,68 +71,78 @@ typedef struct { /****************************************/ static struct usb_device_id hfcusb_idtab[] = { { - USB_DEVICE(0x0959, 0x2bd0), + .idVendor = 0x0959, + .idProduct = 0x2bd0, .driver_info = (unsigned long) &((hfcsusb_vdata) {LED_OFF, {4, 0, 2, 1}, "ISDN USB TA (Cologne Chip HFC-S USB based)"}), }, { - USB_DEVICE(0x0675, 0x1688), + .idVendor = 0x0675, + .idProduct = 0x1688, .driver_info = (unsigned long) &((hfcsusb_vdata) {LED_SCHEME1, {1, 2, 0, 0}, "DrayTek miniVigor 128 USB ISDN TA"}), }, { - USB_DEVICE(0x07b0, 0x0007), + .idVendor = 0x07b0, + .idProduct = 0x0007, .driver_info = (unsigned long) &((hfcsusb_vdata) {LED_SCHEME1, {0x80, -64, -32, -16}, "Billion tiny USB ISDN TA 128"}), }, { - USB_DEVICE(0x0742, 0x2008), + .idVendor = 0x0742, + .idProduct = 0x2008, .driver_info = (unsigned long) &((hfcsusb_vdata) {LED_SCHEME1, {4, 0, 2, 1}, "Stollmann USB TA"}), }, { - USB_DEVICE(0x0742, 0x2009), + .idVendor = 0x0742, + .idProduct = 0x2009, .driver_info = (unsigned long) &((hfcsusb_vdata) {LED_SCHEME1, {4, 0, 2, 1}, "Aceex USB ISDN TA"}), }, { - USB_DEVICE(0x0742, 0x200A), + .idVendor = 0x0742, + .idProduct = 0x200A, .driver_info = (unsigned long) &((hfcsusb_vdata) {LED_SCHEME1, {4, 0, 2, 1}, "OEM USB ISDN TA"}), }, { - USB_DEVICE(0x08e3, 0x0301), + .idVendor = 0x08e3, + .idProduct = 0x0301, .driver_info = (unsigned long) &((hfcsusb_vdata) {LED_SCHEME1, {2, 0, 1, 4}, "Olitec USB RNIS"}), }, { - USB_DEVICE(0x07fa, 0x0846), + .idVendor = 0x07fa, + .idProduct = 0x0846, .driver_info = (unsigned long) &((hfcsusb_vdata) {LED_SCHEME1, {0x80, -64, -32, -16}, "Bewan Modem RNIS USB"}), }, { - USB_DEVICE(0x07fa, 0x0847), + .idVendor = 0x07fa, + .idProduct = 0x0847, .driver_info = (unsigned long) &((hfcsusb_vdata) {LED_SCHEME1, {0x80, -64, -32, -16}, "Djinn Numeris USB"}), }, { - USB_DEVICE(0x07b0, 0x0006), + .idVendor = 0x07b0, + .idProduct = 0x0006, .driver_info = (unsigned long) &((hfcsusb_vdata) {LED_SCHEME1, {0x80, -64, -32, -16}, "Twister ISDN TA"}), }, - { } }; + /***************************************************************/ /* structure defining input+output fifos (interrupt/bulk mode) */ /***************************************************************/ @@ -1715,6 +1725,7 @@ hfc_usb_disconnect(struct usb_interface /* our driver information structure */ /************************************/ static struct usb_driver hfc_drv = { + .owner = THIS_MODULE, .name = "hfc_usb", .id_table = hfcusb_idtab, .probe = hfc_usb_probe, diff --git a/trunk/drivers/isdn/hisax/st5481_init.c b/trunk/drivers/isdn/hisax/st5481_init.c index 99cb0f3d59a1..8e192a3a3490 100644 --- a/trunk/drivers/isdn/hisax/st5481_init.c +++ b/trunk/drivers/isdn/hisax/st5481_init.c @@ -180,6 +180,7 @@ static struct usb_device_id st5481_ids[] = { MODULE_DEVICE_TABLE (usb, st5481_ids); static struct usb_driver st5481_usb_driver = { + .owner = THIS_MODULE, .name = "st5481_usb", .probe = probe_st5481, .disconnect = disconnect_st5481, diff --git a/trunk/drivers/isdn/pcbit/Kconfig b/trunk/drivers/isdn/pcbit/Kconfig index 0933881ab0c2..f06997faef16 100644 --- a/trunk/drivers/isdn/pcbit/Kconfig +++ b/trunk/drivers/isdn/pcbit/Kconfig @@ -3,7 +3,7 @@ # config ISDN_DRV_PCBIT tristate "PCBIT-D support" - depends on ISDN_I4L && ISA && (BROKEN || X86) + depends on ISDN_I4L && ISA && (BROKEN || !PPC) help This enables support for the PCBIT ISDN-card. This card is manufactured in Portugal by Octal. For running this card, diff --git a/trunk/drivers/macintosh/therm_pm72.c b/trunk/drivers/macintosh/therm_pm72.c index 190878eef990..3fc8cdd94c3d 100644 --- a/trunk/drivers/macintosh/therm_pm72.c +++ b/trunk/drivers/macintosh/therm_pm72.c @@ -923,7 +923,7 @@ static void do_monitor_cpu_combined(void) if (temp_combi >= ((state0->mpu.tmax + 8) << 16)) { printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n", temp_combi >> 16); - state0->overtemp += CPU_MAX_OVERTEMP / 4; + state0->overtemp = CPU_MAX_OVERTEMP; } else if (temp_combi > (state0->mpu.tmax << 16)) state0->overtemp++; else @@ -933,7 +933,7 @@ static void do_monitor_cpu_combined(void) if (state0->overtemp > 0) { state0->rpm = state0->mpu.rmaxn_exhaust_fan; state0->intake_rpm = intake = state0->mpu.rmaxn_intake_fan; - pump = state0->pump_max; + pump = state0->pump_min; goto do_set_fans; } @@ -998,7 +998,7 @@ static void do_monitor_cpu_split(struct cpu_pid_state *state) printk(KERN_WARNING "Warning ! CPU %d temperature way above maximum" " (%d) !\n", state->index, temp >> 16); - state->overtemp += CPU_MAX_OVERTEMP / 4; + state->overtemp = CPU_MAX_OVERTEMP; } else if (temp > (state->mpu.tmax << 16)) state->overtemp++; else @@ -1060,7 +1060,7 @@ static void do_monitor_cpu_rack(struct cpu_pid_state *state) printk(KERN_WARNING "Warning ! CPU %d temperature way above maximum" " (%d) !\n", state->index, temp >> 16); - state->overtemp = CPU_MAX_OVERTEMP / 4; + state->overtemp = CPU_MAX_OVERTEMP; } else if (temp > (state->mpu.tmax << 16)) state->overtemp++; else diff --git a/trunk/drivers/macintosh/windfarm_pm81.c b/trunk/drivers/macintosh/windfarm_pm81.c index 80ddf9776bde..322c74b2687f 100644 --- a/trunk/drivers/macintosh/windfarm_pm81.c +++ b/trunk/drivers/macintosh/windfarm_pm81.c @@ -207,7 +207,7 @@ static struct wf_smu_sys_fans_param wf_smu_sys_all_params[] = { }, /* Model ID 3 */ { - .model_id = 3, + .model_id = 2, .itarget = 0x350000, .gd = 0x08e00000, .gp = 0x00566666, @@ -219,7 +219,7 @@ static struct wf_smu_sys_fans_param wf_smu_sys_all_params[] = { }, /* Model ID 5 */ { - .model_id = 5, + .model_id = 2, .itarget = 0x3a0000, .gd = 0x15400000, .gp = 0x00233333, diff --git a/trunk/drivers/md/bitmap.c b/trunk/drivers/md/bitmap.c index 252d55df9642..51315302a85e 100644 --- a/trunk/drivers/md/bitmap.c +++ b/trunk/drivers/md/bitmap.c @@ -326,9 +326,9 @@ static int write_page(struct bitmap *bitmap, struct page *page, int wait) } } - ret = page->mapping->a_ops->prepare_write(bitmap->file, page, 0, PAGE_SIZE); + ret = page->mapping->a_ops->prepare_write(NULL, page, 0, PAGE_SIZE); if (!ret) - ret = page->mapping->a_ops->commit_write(bitmap->file, page, 0, + ret = page->mapping->a_ops->commit_write(NULL, page, 0, PAGE_SIZE); if (ret) { unlock_page(page); diff --git a/trunk/drivers/md/dm-bio-list.h b/trunk/drivers/md/dm-bio-list.h index bbf4615f0e30..bc021e1fd4d1 100644 --- a/trunk/drivers/md/dm-bio-list.h +++ b/trunk/drivers/md/dm-bio-list.h @@ -33,9 +33,6 @@ static inline void bio_list_add(struct bio_list *bl, struct bio *bio) static inline void bio_list_merge(struct bio_list *bl, struct bio_list *bl2) { - if (!bl2->head) - return; - if (bl->tail) bl->tail->bi_next = bl2->head; else diff --git a/trunk/drivers/md/dm-ioctl.c b/trunk/drivers/md/dm-ioctl.c index 07d44e19536e..54ec737195e0 100644 --- a/trunk/drivers/md/dm-ioctl.c +++ b/trunk/drivers/md/dm-ioctl.c @@ -425,8 +425,8 @@ static void list_version_get_needed(struct target_type *tt, void *needed_param) { size_t *needed = needed_param; - *needed += sizeof(struct dm_target_versions); *needed += strlen(tt->name); + *needed += sizeof(tt->version); *needed += ALIGN_MASK; } @@ -974,7 +974,6 @@ static int table_load(struct dm_ioctl *param, size_t param_size) if (!hc) { DMWARN("device doesn't appear to be in the dev hash table."); up_write(&_hash_lock); - dm_table_put(t); return -ENXIO; } diff --git a/trunk/drivers/md/dm-log.c b/trunk/drivers/md/dm-log.c index a76349cb10a5..e110655eabdb 100644 --- a/trunk/drivers/md/dm-log.c +++ b/trunk/drivers/md/dm-log.c @@ -333,10 +333,10 @@ static int core_ctr(struct dirty_log *log, struct dm_target *ti, lc->sync = sync; /* - * Work out how many "unsigned long"s we need to hold the bitset. + * Work out how many words we need to hold the bitset. */ bitset_size = dm_round_up(region_count, - sizeof(unsigned long) << BYTE_SHIFT); + sizeof(*lc->clean_bits) << BYTE_SHIFT); bitset_size >>= BYTE_SHIFT; lc->bitset_uint32_count = bitset_size / 4; diff --git a/trunk/drivers/md/dm-mpath.c b/trunk/drivers/md/dm-mpath.c index f72a82fb9434..f9b7b32d5d5c 100644 --- a/trunk/drivers/md/dm-mpath.c +++ b/trunk/drivers/md/dm-mpath.c @@ -1000,7 +1000,6 @@ static int do_end_io(struct multipath *m, struct bio *bio, { struct hw_handler *hwh = &m->hw_handler; unsigned err_flags = MP_FAIL_PATH; /* Default behavior */ - unsigned long flags; if (!error) return 0; /* I/O complete */ @@ -1011,17 +1010,17 @@ static int do_end_io(struct multipath *m, struct bio *bio, if (error == -EOPNOTSUPP) return error; - spin_lock_irqsave(&m->lock, flags); + spin_lock(&m->lock); if (!m->nr_valid_paths) { if (!m->queue_if_no_path) { - spin_unlock_irqrestore(&m->lock, flags); + spin_unlock(&m->lock); return -EIO; } else { - spin_unlock_irqrestore(&m->lock, flags); + spin_unlock(&m->lock); goto requeue; } } - spin_unlock_irqrestore(&m->lock, flags); + spin_unlock(&m->lock); if (hwh->type && hwh->type->error) err_flags = hwh->type->error(hwh, bio); @@ -1041,12 +1040,12 @@ static int do_end_io(struct multipath *m, struct bio *bio, dm_bio_restore(&mpio->details, bio); /* queue for the daemon to resubmit or fail */ - spin_lock_irqsave(&m->lock, flags); + spin_lock(&m->lock); bio_list_add(&m->queued_ios, bio); m->queue_size++; if (!m->queue_io) queue_work(kmultipathd, &m->process_queued_ios); - spin_unlock_irqrestore(&m->lock, flags); + spin_unlock(&m->lock); return 1; /* io not complete */ } diff --git a/trunk/drivers/md/dm-raid1.c b/trunk/drivers/md/dm-raid1.c index 6b0fc1670929..2375709a392c 100644 --- a/trunk/drivers/md/dm-raid1.c +++ b/trunk/drivers/md/dm-raid1.c @@ -376,18 +376,16 @@ static void rh_inc(struct region_hash *rh, region_t region) read_lock(&rh->hash_lock); reg = __rh_find(rh, region); - spin_lock_irq(&rh->region_lock); atomic_inc(®->pending); + spin_lock_irq(&rh->region_lock); if (reg->state == RH_CLEAN) { - reg->state = RH_DIRTY; - list_del_init(®->list); /* take off the clean list */ - spin_unlock_irq(&rh->region_lock); - rh->log->type->mark_region(rh->log, reg->key); - } else - spin_unlock_irq(&rh->region_lock); + reg->state = RH_DIRTY; + list_del_init(®->list); /* take off the clean list */ + } + spin_unlock_irq(&rh->region_lock); read_unlock(&rh->hash_lock); } @@ -410,17 +408,21 @@ static void rh_dec(struct region_hash *rh, region_t region) reg = __rh_lookup(rh, region); read_unlock(&rh->hash_lock); - spin_lock_irqsave(&rh->region_lock, flags); if (atomic_dec_and_test(®->pending)) { + spin_lock_irqsave(&rh->region_lock, flags); + if (atomic_read(®->pending)) { /* check race */ + spin_unlock_irqrestore(&rh->region_lock, flags); + return; + } if (reg->state == RH_RECOVERING) { list_add_tail(®->list, &rh->quiesced_regions); } else { reg->state = RH_CLEAN; list_add(®->list, &rh->clean_regions); } + spin_unlock_irqrestore(&rh->region_lock, flags); should_wake = 1; } - spin_unlock_irqrestore(&rh->region_lock, flags); if (should_wake) wake(); diff --git a/trunk/drivers/md/dm-table.c b/trunk/drivers/md/dm-table.c index a6f2dc66c3db..a6d3baa46f61 100644 --- a/trunk/drivers/md/dm-table.c +++ b/trunk/drivers/md/dm-table.c @@ -638,7 +638,7 @@ int dm_split_args(int *argc, char ***argvp, char *input) static void check_for_valid_limits(struct io_restrictions *rs) { if (!rs->max_sectors) - rs->max_sectors = SAFE_MAX_SECTORS; + rs->max_sectors = MAX_SECTORS; if (!rs->max_phys_segments) rs->max_phys_segments = MAX_PHYS_SEGMENTS; if (!rs->max_hw_segments) diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index 8175a2a222da..adf960d8a7c9 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -1028,6 +1028,7 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev) mddev->size = le64_to_cpu(sb->size)/2; mddev->events = le64_to_cpu(sb->events); mddev->bitmap_offset = 0; + mddev->default_bitmap_offset = 0; mddev->default_bitmap_offset = 1024; mddev->recovery_cp = le64_to_cpu(sb->resync_offset); @@ -1729,7 +1730,7 @@ level_show(mddev_t *mddev, char *page) if (p == NULL && mddev->raid_disks == 0) return 0; if (mddev->level >= 0) - return sprintf(page, "raid%d\n", mddev->level); + return sprintf(page, "RAID-%d\n", mddev->level); else return sprintf(page, "%s\n", p->name); } @@ -2931,9 +2932,6 @@ static int set_array_info(mddev_t * mddev, mdu_array_info_t *info) mddev->sb_dirty = 1; - mddev->default_bitmap_offset = MD_SB_BYTES >> 9; - mddev->bitmap_offset = 0; - /* * Generate a 128 bit UUID */ @@ -3158,7 +3156,7 @@ static int md_ioctl(struct inode *inode, struct file *file, if (cnt > 0 ) { printk(KERN_WARNING "md: %s(pid %d) used deprecated START_ARRAY ioctl. " - "This will not be supported beyond July 2006\n", + "This will not be supported beyond 2.6\n", current->comm, current->pid); cnt--; } @@ -3439,19 +3437,10 @@ static int md_thread(void * arg) allow_signal(SIGKILL); while (!kthread_should_stop()) { - /* We need to wait INTERRUPTIBLE so that - * we don't add to the load-average. - * That means we need to be sure no signals are - * pending - */ - if (signal_pending(current)) - flush_signals(current); - - wait_event_interruptible_timeout - (thread->wqueue, - test_bit(THREAD_WAKEUP, &thread->flags) - || kthread_should_stop(), - thread->timeout); + wait_event_timeout(thread->wqueue, + test_bit(THREAD_WAKEUP, &thread->flags) + || kthread_should_stop(), + thread->timeout); try_to_freeze(); clear_bit(THREAD_WAKEUP, &thread->flags); @@ -3848,20 +3837,11 @@ static int is_mddev_idle(mddev_t *mddev) curr_events = disk_stat_read(disk, sectors[0]) + disk_stat_read(disk, sectors[1]) - atomic_read(&disk->sync_io); - /* The difference between curr_events and last_events - * will be affected by any new non-sync IO (making - * curr_events bigger) and any difference in the amount of - * in-flight syncio (making current_events bigger or smaller) - * The amount in-flight is currently limited to - * 32*64K in raid1/10 and 256*PAGE_SIZE in raid5/6 - * which is at most 4096 sectors. - * These numbers are fairly fragile and should be made - * more robust, probably by enforcing the - * 'window size' that md_do_sync sort-of uses. - * + /* Allow some slack between valud of curr_events and last_events, + * as there are some uninteresting races. * Note: the following is an unsigned comparison. */ - if ((curr_events - rdev->last_events + 4096) > 8192) { + if ((curr_events - rdev->last_events + 32) > 64) { rdev->last_events = curr_events; idle = 0; } @@ -4120,7 +4100,7 @@ static void md_do_sync(mddev_t *mddev) if (currspeed > sysctl_speed_limit_min) { if ((currspeed > sysctl_speed_limit_max) || !is_mddev_idle(mddev)) { - msleep(500); + msleep(250); goto repeat; } } diff --git a/trunk/drivers/md/raid1.c b/trunk/drivers/md/raid1.c index 229d7b204297..2da9d3ba902d 100644 --- a/trunk/drivers/md/raid1.c +++ b/trunk/drivers/md/raid1.c @@ -320,6 +320,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int * this branch is our 'one mirror IO has finished' event handler: */ r1_bio->bios[mirror] = NULL; + bio_put(bio); if (!uptodate) { md_error(r1_bio->mddev, conf->mirrors[mirror].rdev); /* an I/O failed, we can't clear the bitmap */ @@ -376,6 +377,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int } if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { /* free extra copy of the data pages */ +/* FIXME bio has been freed!!! */ int i = bio->bi_vcnt; while (i--) __free_page(bio->bi_io_vec[i].bv_page); @@ -389,9 +391,6 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int raid_end_bio_io(r1_bio); } - if (r1_bio->bios[mirror]==NULL) - bio_put(bio); - rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev); return 0; } @@ -954,6 +953,9 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) int mirror = 0; mirror_info_t *p; + if (rdev->saved_raid_disk >= 0 && + conf->mirrors[rdev->saved_raid_disk].rdev == NULL) + mirror = rdev->saved_raid_disk; for (mirror=0; mirror < mddev->raid_disks; mirror++) if ( !(p=conf->mirrors+mirror)->rdev) { @@ -970,10 +972,7 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) p->head_position = 0; rdev->raid_disk = mirror; found = 1; - /* As all devices are equivalent, we don't need a full recovery - * if this was recently any drive of the array - */ - if (rdev->saved_raid_disk < 0) + if (rdev->saved_raid_disk != mirror) conf->fullsync = 1; rcu_assign_pointer(p->rdev, rdev); break; diff --git a/trunk/drivers/md/raid10.c b/trunk/drivers/md/raid10.c index 713dc9c2c730..867f06ae33d9 100644 --- a/trunk/drivers/md/raid10.c +++ b/trunk/drivers/md/raid10.c @@ -552,11 +552,7 @@ static int read_balance(conf_t *conf, r10bio_t *r10_bio) !test_bit(In_sync, &rdev->flags)) continue; - /* This optimisation is debatable, and completely destroys - * sequential read speed for 'far copies' arrays. So only - * keep it for 'near' arrays, and review those later. - */ - if (conf->near_copies > 1 && !atomic_read(&rdev->nr_pending)) { + if (!atomic_read(&rdev->nr_pending)) { disk = ndisk; slot = nslot; break; diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c index fafc4bc045f7..e2a40283e323 100644 --- a/trunk/drivers/md/raid5.c +++ b/trunk/drivers/md/raid5.c @@ -98,7 +98,7 @@ static inline void __release_stripe(raid5_conf_t *conf, struct stripe_head *sh) list_add_tail(&sh->lru, &conf->inactive_list); atomic_dec(&conf->active_stripes); if (!conf->inactive_blocked || - atomic_read(&conf->active_stripes) < (conf->max_nr_stripes*3/4)) + atomic_read(&conf->active_stripes) < (NR_STRIPES*3/4)) wake_up(&conf->wait_for_stripe); } } @@ -264,8 +264,7 @@ static struct stripe_head *get_active_stripe(raid5_conf_t *conf, sector_t sector conf->inactive_blocked = 1; wait_event_lock_irq(conf->wait_for_stripe, !list_empty(&conf->inactive_list) && - (atomic_read(&conf->active_stripes) - < (conf->max_nr_stripes *3/4) + (atomic_read(&conf->active_stripes) < (NR_STRIPES *3/4) || !conf->inactive_blocked), conf->device_lock, unplug_slaves(conf->mddev); @@ -1705,9 +1704,7 @@ static void raid5d (mddev_t *mddev) if (conf->seq_flush - conf->seq_write > 0) { int seq = conf->seq_flush; - spin_unlock_irq(&conf->device_lock); bitmap_unplug(mddev->bitmap); - spin_lock_irq(&conf->device_lock); conf->seq_write = seq; activate_bit_delay(conf); } @@ -1918,7 +1915,7 @@ static int run(mddev_t *mddev) goto abort; } } - memory = conf->max_nr_stripes * (sizeof(struct stripe_head) + +memory = conf->max_nr_stripes * (sizeof(struct stripe_head) + conf->raid_disks * ((sizeof(struct bio) + PAGE_SIZE))) / 1024; if (grow_stripes(conf, conf->max_nr_stripes)) { printk(KERN_ERR diff --git a/trunk/drivers/md/raid6main.c b/trunk/drivers/md/raid6main.c index 0000d162d198..eae5a35629c5 100644 --- a/trunk/drivers/md/raid6main.c +++ b/trunk/drivers/md/raid6main.c @@ -1702,8 +1702,6 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i int data_disks = raid_disks - 2; sector_t max_sector = mddev->size << 1; int sync_blocks; - int still_degraded = 0; - int i; if (sector_nr >= max_sector) { /* just being told to finish up .. nothing much to do */ @@ -1712,7 +1710,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i if (mddev->curr_resync < max_sector) /* aborted */ bitmap_end_sync(mddev->bitmap, mddev->curr_resync, &sync_blocks, 1); - else /* completed sync */ + else /* compelted sync */ conf->fullsync = 0; bitmap_close_sync(mddev->bitmap); @@ -1750,16 +1748,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i */ schedule_timeout_uninterruptible(1); } - /* Need to check if array will still be degraded after recovery/resync - * We don't need to check the 'failed' flag as when that gets set, - * recovery aborts. - */ - for (i=0; iraid_disks; i++) - if (conf->disks[i].rdev == NULL) - still_degraded = 1; - - bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, still_degraded); - + bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 0); spin_lock(&sh->lock); set_bit(STRIPE_SYNCING, &sh->state); clear_bit(STRIPE_INSYNC, &sh->state); @@ -1795,9 +1784,7 @@ static void raid6d (mddev_t *mddev) if (conf->seq_flush - conf->seq_write > 0) { int seq = conf->seq_flush; - spin_unlock_irq(&conf->device_lock); bitmap_unplug(mddev->bitmap); - spin_lock_irq(&conf->device_lock); conf->seq_write = seq; activate_bit_delay(conf); } @@ -2158,15 +2145,9 @@ static int raid6_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) /* no point adding a device */ return 0; /* - * find the disk ... but prefer rdev->saved_raid_disk - * if possible. + * find the disk ... */ - if (rdev->saved_raid_disk >= 0 && - conf->disks[rdev->saved_raid_disk].rdev == NULL) - disk = rdev->saved_raid_disk; - else - disk = 0; - for ( ; disk < mddev->raid_disks; disk++) + for (disk=0; disk < mddev->raid_disks; disk++) if ((p=conf->disks + disk)->rdev == NULL) { clear_bit(In_sync, &rdev->flags); rdev->raid_disk = disk; diff --git a/trunk/drivers/media/common/Kconfig b/trunk/drivers/media/common/Kconfig index 6a901a0268e1..caebd0a1c021 100644 --- a/trunk/drivers/media/common/Kconfig +++ b/trunk/drivers/media/common/Kconfig @@ -1,12 +1,12 @@ config VIDEO_SAA7146 - tristate + tristate select I2C config VIDEO_SAA7146_VV - tristate + tristate select VIDEO_BUF select VIDEO_VIDEOBUF select VIDEO_SAA7146 config VIDEO_VIDEOBUF - tristate + tristate diff --git a/trunk/drivers/media/common/Makefile b/trunk/drivers/media/common/Makefile index bd458cb9b4ea..97b4341255ea 100644 --- a/trunk/drivers/media/common/Makefile +++ b/trunk/drivers/media/common/Makefile @@ -1,5 +1,5 @@ -saa7146-objs := saa7146_i2c.o saa7146_core.o -saa7146_vv-objs := saa7146_vv_ksyms.o saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o +saa7146-objs := saa7146_i2c.o saa7146_core.o +saa7146_vv-objs := saa7146_vv_ksyms.o saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o diff --git a/trunk/drivers/media/common/ir-common.c b/trunk/drivers/media/common/ir-common.c index 97fa3fc571c4..4b71fd6f7aed 100644 --- a/trunk/drivers/media/common/ir-common.c +++ b/trunk/drivers/media/common/ir-common.c @@ -126,66 +126,6 @@ IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = { }; EXPORT_SYMBOL_GPL(ir_codes_winfast); -IR_KEYTAB_TYPE ir_codes_pinnacle[IR_KEYTAB_SIZE] = { - [ 0x59 ] = KEY_MUTE, - [ 0x4a ] = KEY_POWER, - - [ 0x18 ] = KEY_TEXT, - [ 0x26 ] = KEY_TV, - [ 0x3d ] = KEY_PRINT, - - [ 0x48 ] = KEY_RED, - [ 0x04 ] = KEY_GREEN, - [ 0x11 ] = KEY_YELLOW, - [ 0x00 ] = KEY_BLUE, - - [ 0x2d ] = KEY_VOLUMEUP, - [ 0x1e ] = KEY_VOLUMEDOWN, - - [ 0x49 ] = KEY_MENU, - - [ 0x16 ] = KEY_CHANNELUP, - [ 0x17 ] = KEY_CHANNELDOWN, - - [ 0x20 ] = KEY_UP, - [ 0x21 ] = KEY_DOWN, - [ 0x22 ] = KEY_LEFT, - [ 0x23 ] = KEY_RIGHT, - [ 0x0d ] = KEY_SELECT, - - - - [ 0x08 ] = KEY_BACK, - [ 0x07 ] = KEY_REFRESH, - - [ 0x2f ] = KEY_ZOOM, - [ 0x29 ] = KEY_RECORD, - - [ 0x4b ] = KEY_PAUSE, - [ 0x4d ] = KEY_REWIND, - [ 0x2e ] = KEY_PLAY, - [ 0x4e ] = KEY_FORWARD, - [ 0x53 ] = KEY_PREVIOUS, - [ 0x4c ] = KEY_STOP, - [ 0x54 ] = KEY_NEXT, - - [ 0x69 ] = KEY_KP0, - [ 0x6a ] = KEY_KP1, - [ 0x6b ] = KEY_KP2, - [ 0x6c ] = KEY_KP3, - [ 0x6d ] = KEY_KP4, - [ 0x6e ] = KEY_KP5, - [ 0x6f ] = KEY_KP6, - [ 0x70 ] = KEY_KP7, - [ 0x71 ] = KEY_KP8, - [ 0x72 ] = KEY_KP9, - - [ 0x74 ] = KEY_CHANNEL, - [ 0x0a ] = KEY_BACKSPACE, -}; - -EXPORT_SYMBOL_GPL(ir_codes_pinnacle); - /* empty keytable, can be used as placeholder for not-yet created keytables */ IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE] = { [ 42 ] = KEY_COFFEE, @@ -313,7 +253,6 @@ void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, if (ir_codes) memcpy(ir->ir_codes, ir_codes, sizeof(ir->ir_codes)); - dev->keycode = ir->ir_codes; dev->keycodesize = sizeof(IR_KEYTAB_TYPE); dev->keycodemax = IR_KEYTAB_SIZE; diff --git a/trunk/drivers/media/common/saa7146_core.c b/trunk/drivers/media/common/saa7146_core.c index 2899d34e5f7e..206cc2f61f26 100644 --- a/trunk/drivers/media/common/saa7146_core.c +++ b/trunk/drivers/media/common/saa7146_core.c @@ -174,8 +174,8 @@ void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt) int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt) { - u32 *cpu; - dma_addr_t dma_addr; + u32 *cpu; + dma_addr_t dma_addr; cpu = pci_alloc_consistent(pci, PAGE_SIZE, &dma_addr); if (NULL == cpu) { @@ -405,7 +405,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent pci_set_drvdata(pci, dev); - init_MUTEX(&dev->lock); + init_MUTEX(&dev->lock); spin_lock_init(&dev->int_slock); spin_lock_init(&dev->slock); diff --git a/trunk/drivers/media/common/saa7146_fops.c b/trunk/drivers/media/common/saa7146_fops.c index 09ec964dec5c..37888989ea2e 100644 --- a/trunk/drivers/media/common/saa7146_fops.c +++ b/trunk/drivers/media/common/saa7146_fops.c @@ -1,6 +1,6 @@ #include -#define BOARD_CAN_DO_VBI(dev) (dev->revision != 0 && dev->vv_data->vbi_minor != -1) +#define BOARD_CAN_DO_VBI(dev) (dev->revision != 0 && dev->vv_data->vbi_minor != -1) /****************************************************************************/ /* resource management functions, shamelessly stolen from saa7134 driver */ @@ -102,9 +102,9 @@ void saa7146_buffer_finish(struct saa7146_dev *dev, /* finish current buffer */ if (NULL == q->curr) { DEB_D(("aiii. no current buffer\n")); - return; + return; } - + q->curr->vb.state = state; do_gettimeofday(&q->curr->vb.ts); wake_up(&q->curr->vb.done); @@ -143,13 +143,13 @@ void saa7146_buffer_next(struct saa7146_dev *dev, // fixme: fix this for vflip != 0 saa7146_write(dev, PROT_ADDR1, 0); - saa7146_write(dev, MC2, (MASK_02|MASK_18)); + saa7146_write(dev, MC2, (MASK_02|MASK_18)); /* write the address of the rps-program */ saa7146_write(dev, RPS_ADDR0, dev->d_rps0.dma_handle); /* turn on rps */ saa7146_write(dev, MC1, (MASK_12 | MASK_28)); - + /* printk("vdma%d.base_even: 0x%08x\n", 1,saa7146_read(dev,BASE_EVEN1)); printk("vdma%d.base_odd: 0x%08x\n", 1,saa7146_read(dev,BASE_ODD1)); @@ -246,7 +246,7 @@ static int fops_open(struct inode *inode, struct file *file) goto out; } memset(fh,0,sizeof(*fh)); - + file->private_data = fh; fh->dev = dev; fh->type = type; @@ -275,7 +275,7 @@ static int fops_open(struct inode *inode, struct file *file) file->private_data = NULL; } up(&saa7146_devices_lock); - return result; + return result; } static int fops_release(struct inode *inode, struct file *file) @@ -405,7 +405,7 @@ static struct file_operations video_fops = static void vv_callback(struct saa7146_dev *dev, unsigned long status) { u32 isr = status; - + DEB_INT(("dev:%p, isr:0x%08x\n",dev,(u32)status)); if (0 != (isr & (MASK_27))) { @@ -454,11 +454,11 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) handle different devices that might need different configuration data) */ dev->ext_vv_data = ext_vv; - + vv->video_minor = -1; vv->vbi_minor = -1; - vv->d_clipping.cpu_addr = pci_alloc_consistent(dev->pci, SAA7146_CLIPPING_MEM, &vv->d_clipping.dma_handle); + vv->d_clipping.cpu_addr = pci_alloc_consistent(dev->pci, SAA7146_CLIPPING_MEM, &vv->d_clipping.dma_handle); if( NULL == vv->d_clipping.cpu_addr ) { ERR(("out of memory. aborting.\n")); kfree(vv); @@ -468,7 +468,7 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) saa7146_video_uops.init(dev,vv); saa7146_vbi_uops.init(dev,vv); - + dev->vv_data = vv; dev->vv_callback = &vv_callback; @@ -480,12 +480,12 @@ int saa7146_vv_release(struct saa7146_dev* dev) struct saa7146_vv *vv = dev->vv_data; DEB_EE(("dev:%p\n",dev)); - + pci_free_consistent(dev->pci, SAA7146_RPS_MEM, vv->d_clipping.cpu_addr, vv->d_clipping.dma_handle); - kfree(vv); + kfree(vv); dev->vv_data = NULL; dev->vv_callback = NULL; - + return 0; } @@ -498,7 +498,7 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev, DEB_EE(("dev:%p, name:'%s', type:%d\n",dev,name,type)); // released by vfd->release - vfd = video_device_alloc(); + vfd = video_device_alloc(); if (vfd == NULL) return -ENOMEM; @@ -530,7 +530,7 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev, int saa7146_unregister_device(struct video_device **vid, struct saa7146_dev* dev) { struct saa7146_vv *vv = dev->vv_data; - + DEB_EE(("dev:%p\n",dev)); if( VFL_TYPE_GRABBER == (*vid)->type ) { diff --git a/trunk/drivers/media/common/saa7146_i2c.c b/trunk/drivers/media/common/saa7146_i2c.c index 8aabdd8fb3c5..fec6beab8c28 100644 --- a/trunk/drivers/media/common/saa7146_i2c.c +++ b/trunk/drivers/media/common/saa7146_i2c.c @@ -276,8 +276,8 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in int i = 0, count = 0; u32* buffer = dev->d_i2c.cpu_addr; int err = 0; - int address_err = 0; - int short_delay = 0; + int address_err = 0; + int short_delay = 0; if (down_interruptible (&dev->i2c_lock)) return -ERESTARTSYS; @@ -325,7 +325,7 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) { goto out; } - address_err++; + address_err++; } DEB_I2C(("error while sending message(s). starting again.\n")); break; @@ -336,14 +336,14 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in break; } - /* delay a bit before retrying */ - msleep(10); + /* delay a bit before retrying */ + msleep(10); } while (err != num && retries--); - /* if every retry had an address error, exit right away */ - if (address_err == retries) { - goto out; + /* if every retry had an address error, exit right away */ + if (address_err == retries) { + goto out; } /* if any things had to be read, get the results */ diff --git a/trunk/drivers/media/common/saa7146_vbi.c b/trunk/drivers/media/common/saa7146_vbi.c index 063986ec16b5..cb86a97fda1f 100644 --- a/trunk/drivers/media/common/saa7146_vbi.c +++ b/trunk/drivers/media/common/saa7146_vbi.c @@ -6,8 +6,8 @@ static int vbi_workaround(struct saa7146_dev *dev) { struct saa7146_vv *vv = dev->vv_data; - u32 *cpu; - dma_addr_t dma_addr; + u32 *cpu; + dma_addr_t dma_addr; int count = 0; int i; diff --git a/trunk/drivers/media/common/saa7146_video.c b/trunk/drivers/media/common/saa7146_video.c index 1d961023b837..8dd4d15ca36d 100644 --- a/trunk/drivers/media/common/saa7146_video.c +++ b/trunk/drivers/media/common/saa7146_video.c @@ -150,23 +150,23 @@ static int try_win(struct saa7146_dev *dev, struct v4l2_window *win) maxh = vv->standard->v_max_out; if (V4L2_FIELD_ANY == field) { - field = (win->w.height > maxh/2) - ? V4L2_FIELD_INTERLACED - : V4L2_FIELD_TOP; - } - switch (field) { - case V4L2_FIELD_TOP: - case V4L2_FIELD_BOTTOM: - case V4L2_FIELD_ALTERNATE: - maxh = maxh / 2; - break; - case V4L2_FIELD_INTERLACED: - break; - default: { + field = (win->w.height > maxh/2) + ? V4L2_FIELD_INTERLACED + : V4L2_FIELD_TOP; + } + switch (field) { + case V4L2_FIELD_TOP: + case V4L2_FIELD_BOTTOM: + case V4L2_FIELD_ALTERNATE: + maxh = maxh / 2; + break; + case V4L2_FIELD_INTERLACED: + break; + default: { DEB_D(("no known field mode '%d'.\n",field)); - return -EINVAL; - } + return -EINVAL; } + } win->field = field; if (win->w.width > maxw) @@ -887,7 +887,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int DEB_EE(("VIDIOC_QUERYCAP\n")); - strcpy(cap->driver, "saa7146 v4l2"); + strcpy(cap->driver, "saa7146 v4l2"); strlcpy(cap->card, dev->ext->name, sizeof(cap->card)); sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); cap->version = SAA7146_VERSION_CODE; @@ -1011,19 +1011,19 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int err = set_control(fh,arg); return err; } - case VIDIOC_G_PARM: - { - struct v4l2_streamparm *parm = arg; + case VIDIOC_G_PARM: + { + struct v4l2_streamparm *parm = arg; if( parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ) { return -EINVAL; } - memset(&parm->parm.capture,0,sizeof(struct v4l2_captureparm)); + memset(&parm->parm.capture,0,sizeof(struct v4l2_captureparm)); parm->parm.capture.readbuffers = 1; // fixme: only for PAL! parm->parm.capture.timeperframe.numerator = 1; parm->parm.capture.timeperframe.denominator = 25; - return 0; - } + return 0; + } case VIDIOC_G_FMT: { struct v4l2_format *f = arg; @@ -1383,7 +1383,7 @@ static struct videobuf_queue_ops video_qops = { static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv) { - INIT_LIST_HEAD(&vv->video_q.queue); + INIT_LIST_HEAD(&vv->video_q.queue); init_timer(&vv->video_q.timeout); vv->video_q.timeout.function = saa7146_buffer_timeout; diff --git a/trunk/drivers/media/dvb/b2c2/flexcop-common.h b/trunk/drivers/media/dvb/b2c2/flexcop-common.h index 344a3c898460..a94912ac1872 100644 --- a/trunk/drivers/media/dvb/b2c2/flexcop-common.h +++ b/trunk/drivers/media/dvb/b2c2/flexcop-common.h @@ -132,7 +132,7 @@ int flexcop_eeprom_check_mac_addr(struct flexcop_device *fc, int extended); * I2C-channel of the flexcop. */ int flexcop_i2c_request(struct flexcop_device*, flexcop_access_op_t, - flexcop_i2c_port_t, u8 chipaddr, u8 addr, u8 *buf, u16 len); + flexcop_i2c_port_t, u8 chipaddr, u8 addr, u8 *buf, u16 len); /* from flexcop-sram.c */ int flexcop_sram_set_dest(struct flexcop_device *fc, flexcop_sram_dest_t dest, flexcop_sram_dest_target_t target); diff --git a/trunk/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/trunk/drivers/media/dvb/b2c2/flexcop-fe-tuner.c index 21a9045b3ef6..a35330315f65 100644 --- a/trunk/drivers/media/dvb/b2c2/flexcop-fe-tuner.c +++ b/trunk/drivers/media/dvb/b2c2/flexcop-fe-tuner.c @@ -298,7 +298,7 @@ static int flexcop_fe_request_firmware(struct dvb_frontend* fe, const struct fir } static int lgdt3303_pll_set(struct dvb_frontend* fe, - struct dvb_frontend_parameters* params) + struct dvb_frontend_parameters* params) { struct flexcop_device *fc = fe->dvb->priv; u8 buf[4]; @@ -332,7 +332,7 @@ static int lgdt3303_pll_set(struct dvb_frontend* fe, return -EREMOTEIO; } - return 0; + return 0; } static struct lgdt330x_config air2pc_atsc_hd5000_config = { diff --git a/trunk/drivers/media/dvb/b2c2/flexcop-hw-filter.c b/trunk/drivers/media/dvb/b2c2/flexcop-hw-filter.c index b386cc66c6b3..75cf237196eb 100644 --- a/trunk/drivers/media/dvb/b2c2/flexcop-hw-filter.c +++ b/trunk/drivers/media/dvb/b2c2/flexcop-hw-filter.c @@ -19,7 +19,7 @@ void flexcop_smc_ctrl(struct flexcop_device *fc, int onoff) flexcop_set_ibi_value(ctrl_208,SMC_Enable_sig,onoff); } -static void flexcop_null_filter_ctrl(struct flexcop_device *fc, int onoff) +void flexcop_null_filter_ctrl(struct flexcop_device *fc, int onoff) { flexcop_set_ibi_value(ctrl_208,Null_filter_sig,onoff); } diff --git a/trunk/drivers/media/dvb/b2c2/flexcop-usb.c b/trunk/drivers/media/dvb/b2c2/flexcop-usb.c index a6c91db40ad6..0a78ba3737a5 100644 --- a/trunk/drivers/media/dvb/b2c2/flexcop-usb.c +++ b/trunk/drivers/media/dvb/b2c2/flexcop-usb.c @@ -544,6 +544,7 @@ static struct usb_device_id flexcop_usb_table [] = { /* usb specific object needed to register this driver with the usb subsystem */ static struct usb_driver flexcop_usb_driver = { + .owner = THIS_MODULE, .name = "b2c2_flexcop_usb", .probe = flexcop_usb_probe, .disconnect = flexcop_usb_disconnect, diff --git a/trunk/drivers/media/dvb/bt8xx/dst_ca.c b/trunk/drivers/media/dvb/bt8xx/dst_ca.c index 2239651969c8..e6541aff3996 100644 --- a/trunk/drivers/media/dvb/bt8xx/dst_ca.c +++ b/trunk/drivers/media/dvb/bt8xx/dst_ca.c @@ -406,7 +406,7 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, } dprintk(verbose, DST_CA_DEBUG, 1, " "); - if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg))) { + if (copy_from_user(p_ca_message, (void *)arg, sizeof (struct ca_msg))) { result = -EFAULT; goto free_mem_and_exit; } @@ -579,7 +579,7 @@ static int dst_ca_release(struct inode *inode, struct file *file) return 0; } -static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset) +static int dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset) { int bytes_read = 0; @@ -588,7 +588,7 @@ static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length return bytes_read; } -static ssize_t dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset) +static int dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset) { dprintk(verbose, DST_CA_DEBUG, 1, " Device write."); diff --git a/trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c index 77977e9c013e..2e398090cf63 100644 --- a/trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c @@ -556,9 +556,9 @@ static int tdvs_tua6034_pll_set(struct dvb_frontend* fe, struct dvb_frontend_par dprintk("%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n", __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]); if ((err = i2c_transfer(card->i2c_adapter, &msg, 1)) != 1) { - printk(KERN_WARNING "dvb-bt8xx: %s error " - "(addr %02x <- %02x, err = %i)\n", - __FUNCTION__, buf[0], buf[1], err); + printk(KERN_WARNING "dvb-bt8xx: %s error " + "(addr %02x <- %02x, err = %i)\n", + __FUNCTION__, buf[0], buf[1], err); if (err < 0) return err; else diff --git a/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c b/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c index b996fb59b7e4..a1607e7d6d6b 100644 --- a/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c @@ -276,7 +276,7 @@ static void cinergyt2_free_stream_urbs (struct cinergyt2 *cinergyt2) if (cinergyt2->stream_urb[i]) usb_free_urb(cinergyt2->stream_urb[i]); - usb_buffer_free(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE, + pci_free_consistent(NULL, STREAM_URB_COUNT*STREAM_BUF_SIZE, cinergyt2->streambuf, cinergyt2->streambuf_dmahandle); } @@ -284,8 +284,9 @@ static int cinergyt2_alloc_stream_urbs (struct cinergyt2 *cinergyt2) { int i; - cinergyt2->streambuf = usb_buffer_alloc(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE, - SLAB_KERNEL, &cinergyt2->streambuf_dmahandle); + cinergyt2->streambuf = pci_alloc_consistent(NULL, + STREAM_URB_COUNT*STREAM_BUF_SIZE, + &cinergyt2->streambuf_dmahandle); if (!cinergyt2->streambuf) { dprintk(1, "failed to alloc consistent stream memory area, bailing out!\n"); return -ENOMEM; @@ -772,15 +773,13 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2) input_dev->name = DRIVER_NAME " remote control"; input_dev->phys = cinergyt2->phys; input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); - for (i = 0; i < ARRAY_SIZE(rc_keys); i += 3) + for (i = 0; ARRAY_SIZE(rc_keys); i += 3) set_bit(rc_keys[i + 2], input_dev->keybit); input_dev->keycodesize = 0; input_dev->keycodemax = 0; input_register_device(cinergyt2->rc_input_dev); schedule_delayed_work(&cinergyt2->rc_query_work, HZ/2); - - return 0; } static void cinergyt2_unregister_rc(struct cinergyt2 *cinergyt2) @@ -986,6 +985,7 @@ static const struct usb_device_id cinergyt2_table [] __devinitdata = { MODULE_DEVICE_TABLE(usb, cinergyt2_table); static struct usb_driver cinergyt2_driver = { + .owner = THIS_MODULE, .name = "cinergyT2", .probe = cinergyt2_probe, .disconnect = cinergyt2_disconnect, diff --git a/trunk/drivers/media/dvb/dvb-core/demux.h b/trunk/drivers/media/dvb/dvb-core/demux.h index 9f025825b2d2..7d7b0067f228 100644 --- a/trunk/drivers/media/dvb/dvb-core/demux.h +++ b/trunk/drivers/media/dvb/dvb-core/demux.h @@ -86,25 +86,25 @@ enum dmx_success { enum dmx_ts_pes { /* also send packets to decoder (if it exists) */ - DMX_TS_PES_AUDIO0, + DMX_TS_PES_AUDIO0, DMX_TS_PES_VIDEO0, DMX_TS_PES_TELETEXT0, DMX_TS_PES_SUBTITLE0, DMX_TS_PES_PCR0, - DMX_TS_PES_AUDIO1, + DMX_TS_PES_AUDIO1, DMX_TS_PES_VIDEO1, DMX_TS_PES_TELETEXT1, DMX_TS_PES_SUBTITLE1, DMX_TS_PES_PCR1, - DMX_TS_PES_AUDIO2, + DMX_TS_PES_AUDIO2, DMX_TS_PES_VIDEO2, DMX_TS_PES_TELETEXT2, DMX_TS_PES_SUBTITLE2, DMX_TS_PES_PCR2, - DMX_TS_PES_AUDIO3, + DMX_TS_PES_AUDIO3, DMX_TS_PES_VIDEO3, DMX_TS_PES_TELETEXT3, DMX_TS_PES_SUBTITLE3, @@ -121,17 +121,17 @@ enum dmx_ts_pes struct dmx_ts_feed { - int is_filtering; /* Set to non-zero when filtering in progress */ - struct dmx_demux *parent; /* Back-pointer */ - void *priv; /* Pointer to private data of the API client */ - int (*set) (struct dmx_ts_feed *feed, + int is_filtering; /* Set to non-zero when filtering in progress */ + struct dmx_demux *parent; /* Back-pointer */ + void *priv; /* Pointer to private data of the API client */ + int (*set) (struct dmx_ts_feed *feed, u16 pid, int type, enum dmx_ts_pes pes_type, size_t circular_buffer_size, struct timespec timeout); - int (*start_filtering) (struct dmx_ts_feed* feed); - int (*stop_filtering) (struct dmx_ts_feed* feed); + int (*start_filtering) (struct dmx_ts_feed* feed); + int (*stop_filtering) (struct dmx_ts_feed* feed); }; /*--------------------------------------------------------------------------*/ @@ -139,35 +139,35 @@ struct dmx_ts_feed { /*--------------------------------------------------------------------------*/ struct dmx_section_filter { - u8 filter_value [DMX_MAX_FILTER_SIZE]; - u8 filter_mask [DMX_MAX_FILTER_SIZE]; - u8 filter_mode [DMX_MAX_FILTER_SIZE]; - struct dmx_section_feed* parent; /* Back-pointer */ - void* priv; /* Pointer to private data of the API client */ + u8 filter_value [DMX_MAX_FILTER_SIZE]; + u8 filter_mask [DMX_MAX_FILTER_SIZE]; + u8 filter_mode [DMX_MAX_FILTER_SIZE]; + struct dmx_section_feed* parent; /* Back-pointer */ + void* priv; /* Pointer to private data of the API client */ }; struct dmx_section_feed { - int is_filtering; /* Set to non-zero when filtering in progress */ - struct dmx_demux* parent; /* Back-pointer */ - void* priv; /* Pointer to private data of the API client */ + int is_filtering; /* Set to non-zero when filtering in progress */ + struct dmx_demux* parent; /* Back-pointer */ + void* priv; /* Pointer to private data of the API client */ - int check_crc; + int check_crc; u32 crc_val; - u8 *secbuf; - u8 secbuf_base[DMX_MAX_SECFEED_SIZE]; - u16 secbufp, seclen, tsfeedp; + u8 *secbuf; + u8 secbuf_base[DMX_MAX_SECFEED_SIZE]; + u16 secbufp, seclen, tsfeedp; - int (*set) (struct dmx_section_feed* feed, + int (*set) (struct dmx_section_feed* feed, u16 pid, size_t circular_buffer_size, int check_crc); - int (*allocate_filter) (struct dmx_section_feed* feed, + int (*allocate_filter) (struct dmx_section_feed* feed, struct dmx_section_filter** filter); - int (*release_filter) (struct dmx_section_feed* feed, + int (*release_filter) (struct dmx_section_feed* feed, struct dmx_section_filter* filter); - int (*start_filtering) (struct dmx_section_feed* feed); - int (*stop_filtering) (struct dmx_section_feed* feed); + int (*start_filtering) (struct dmx_section_feed* feed); + int (*stop_filtering) (struct dmx_section_feed* feed); }; /*--------------------------------------------------------------------------*/ @@ -205,10 +205,10 @@ enum dmx_frontend_source { }; struct dmx_frontend { - struct list_head connectivity_list; /* List of front-ends that can + struct list_head connectivity_list; /* List of front-ends that can be connected to a particular demux */ - enum dmx_frontend_source source; + enum dmx_frontend_source source; }; /*--------------------------------------------------------------------------*/ @@ -240,38 +240,38 @@ struct dmx_frontend { #define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list) struct dmx_demux { - u32 capabilities; /* Bitfield of capability flags */ - struct dmx_frontend* frontend; /* Front-end connected to the demux */ - void* priv; /* Pointer to private data of the API client */ - int (*open) (struct dmx_demux* demux); - int (*close) (struct dmx_demux* demux); - int (*write) (struct dmx_demux* demux, const char* buf, size_t count); - int (*allocate_ts_feed) (struct dmx_demux* demux, + u32 capabilities; /* Bitfield of capability flags */ + struct dmx_frontend* frontend; /* Front-end connected to the demux */ + void* priv; /* Pointer to private data of the API client */ + int (*open) (struct dmx_demux* demux); + int (*close) (struct dmx_demux* demux); + int (*write) (struct dmx_demux* demux, const char* buf, size_t count); + int (*allocate_ts_feed) (struct dmx_demux* demux, struct dmx_ts_feed** feed, dmx_ts_cb callback); - int (*release_ts_feed) (struct dmx_demux* demux, + int (*release_ts_feed) (struct dmx_demux* demux, struct dmx_ts_feed* feed); - int (*allocate_section_feed) (struct dmx_demux* demux, + int (*allocate_section_feed) (struct dmx_demux* demux, struct dmx_section_feed** feed, dmx_section_cb callback); - int (*release_section_feed) (struct dmx_demux* demux, + int (*release_section_feed) (struct dmx_demux* demux, struct dmx_section_feed* feed); - int (*add_frontend) (struct dmx_demux* demux, + int (*add_frontend) (struct dmx_demux* demux, struct dmx_frontend* frontend); - int (*remove_frontend) (struct dmx_demux* demux, + int (*remove_frontend) (struct dmx_demux* demux, struct dmx_frontend* frontend); - struct list_head* (*get_frontends) (struct dmx_demux* demux); - int (*connect_frontend) (struct dmx_demux* demux, + struct list_head* (*get_frontends) (struct dmx_demux* demux); + int (*connect_frontend) (struct dmx_demux* demux, struct dmx_frontend* frontend); - int (*disconnect_frontend) (struct dmx_demux* demux); + int (*disconnect_frontend) (struct dmx_demux* demux); - int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids); + int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids); int (*get_caps) (struct dmx_demux* demux, struct dmx_caps *caps); int (*set_source) (struct dmx_demux* demux, const dmx_source_t *src); - int (*get_stc) (struct dmx_demux* demux, unsigned int num, + int (*get_stc) (struct dmx_demux* demux, unsigned int num, u64 *stc, unsigned int *base); }; diff --git a/trunk/drivers/media/dvb/dvb-core/dmxdev.c b/trunk/drivers/media/dvb/dvb-core/dmxdev.c index 7b8373ad121b..8028c3a5e287 100644 --- a/trunk/drivers/media/dvb/dvb-core/dmxdev.c +++ b/trunk/drivers/media/dvb/dvb-core/dmxdev.c @@ -947,7 +947,7 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, case DMX_GET_STC: if (!dmxdev->demux->get_stc) { - ret=-EINVAL; + ret=-EINVAL; break; } ret = dmxdev->demux->get_stc(dmxdev->demux, diff --git a/trunk/drivers/media/dvb/dvb-core/dmxdev.h b/trunk/drivers/media/dvb/dvb-core/dmxdev.h index fd72920c2199..395a9cd75012 100644 --- a/trunk/drivers/media/dvb/dvb-core/dmxdev.h +++ b/trunk/drivers/media/dvb/dvb-core/dmxdev.h @@ -53,51 +53,51 @@ enum dmxdev_state { }; struct dmxdev_buffer { - u8 *data; - int size; - int pread; - int pwrite; + u8 *data; + int size; + int pread; + int pwrite; wait_queue_head_t queue; - int error; + int error; }; struct dmxdev_filter { struct dvb_device *dvbdev; - union { - struct dmx_section_filter *sec; + union { + struct dmx_section_filter *sec; } filter; - union { - struct dmx_ts_feed *ts; - struct dmx_section_feed *sec; + union { + struct dmx_ts_feed *ts; + struct dmx_section_feed *sec; } feed; - union { - struct dmx_sct_filter_params sec; - struct dmx_pes_filter_params pes; + union { + struct dmx_sct_filter_params sec; + struct dmx_pes_filter_params pes; } params; - int type; - enum dmxdev_state state; - struct dmxdev *dev; - struct dmxdev_buffer buffer; + int type; + enum dmxdev_state state; + struct dmxdev *dev; + struct dmxdev_buffer buffer; struct semaphore mutex; - /* only for sections */ - struct timer_list timer; - int todo; - u8 secheader[3]; + /* only for sections */ + struct timer_list timer; + int todo; + u8 secheader[3]; - u16 pid; + u16 pid; }; struct dmxdev_dvr { - int state; - struct dmxdev *dev; - struct dmxdev_buffer buffer; + int state; + struct dmxdev *dev; + struct dmxdev_buffer buffer; }; @@ -105,16 +105,16 @@ struct dmxdev { struct dvb_device *dvbdev; struct dvb_device *dvr_dvbdev; - struct dmxdev_filter *filter; - struct dmxdev_dvr *dvr; - struct dmx_demux *demux; + struct dmxdev_filter *filter; + struct dmxdev_dvr *dvr; + struct dmx_demux *demux; - int filternum; - int capabilities; + int filternum; + int capabilities; #define DMXDEV_CAP_DUPLEX 1 - struct dmx_frontend *dvr_orig_fe; + struct dmx_frontend *dvr_orig_fe; - struct dmxdev_buffer dvr_buffer; + struct dmxdev_buffer dvr_buffer; #define DVR_BUFFER_SIZE (10*188*1024) struct semaphore mutex; diff --git a/trunk/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/trunk/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index 5956c35d34ac..2aa767f9bd7d 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/trunk/drivers/media/dvb/dvb-core/dvb_ca_en50221.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include "dvb_ca_en50221.h" @@ -111,6 +111,9 @@ struct dvb_ca_slot { /* size of the buffer to use when talking to the CAM */ int link_buf_size; + /* semaphore for syncing access to slot structure */ + struct rw_semaphore sem; + /* buffer for incoming packets */ struct dvb_ringbuffer rx_buffer; @@ -498,7 +501,7 @@ static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot) /* process the CFTABLE_ENTRY tuples, and any after those */ while ((!end_chain) && (address < 0x1000)) { if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType, - &tupleLength, tuple)) < 0) + &tupleLength, tuple)) < 0) return status; switch (tupleType) { case 0x1B: // CISTPL_CFTABLE_ENTRY @@ -599,11 +602,14 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb if (ebuf == NULL) { int buf_free; + down_read(&ca->slot_info[slot].sem); if (ca->slot_info[slot].rx_buffer.data == NULL) { + up_read(&ca->slot_info[slot].sem); status = -EIO; goto exit; } buf_free = dvb_ringbuffer_free(&ca->slot_info[slot].rx_buffer); + up_read(&ca->slot_info[slot].sem); if (buf_free < (ca->slot_info[slot].link_buf_size + DVB_RINGBUFFER_PKTHDRSIZE)) { status = -EAGAIN; @@ -674,11 +680,14 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb /* OK, add it to the receive buffer, or copy into external buffer if supplied */ if (ebuf == NULL) { + down_read(&ca->slot_info[slot].sem); if (ca->slot_info[slot].rx_buffer.data == NULL) { + up_read(&ca->slot_info[slot].sem); status = -EIO; goto exit; } dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read); + up_read(&ca->slot_info[slot].sem); } else { memcpy(ebuf, buf, bytes_read); } @@ -793,8 +802,12 @@ static int dvb_ca_en50221_slot_shutdown(struct dvb_ca_private *ca, int slot) { dprintk("%s\n", __FUNCTION__); + down_write(&ca->slot_info[slot].sem); ca->pub->slot_shutdown(ca->pub, slot); ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; + vfree(ca->slot_info[slot].rx_buffer.data); + ca->slot_info[slot].rx_buffer.data = NULL; + up_write(&ca->slot_info[slot].sem); /* need to wake up all processes to check if they're now trying to write to a defunct CAM */ @@ -880,7 +893,7 @@ void dvb_ca_en50221_frda_irq(struct dvb_ca_en50221 *pubca, int slot) case DVB_CA_SLOTSTATE_RUNNING: if (ca->open) - dvb_ca_en50221_thread_wakeup(ca); + dvb_ca_en50221_read_data(ca, slot, NULL, 0); break; } } @@ -1114,16 +1127,16 @@ static int dvb_ca_en50221_thread(void *data) break; } - if (ca->slot_info[slot].rx_buffer.data == NULL) { - rxbuf = vmalloc(RX_BUFFER_SIZE); - if (rxbuf == NULL) { - printk("dvb_ca adapter %d: Unable to allocate CAM rx buffer :(\n", ca->dvbdev->adapter->num); - ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; - dvb_ca_en50221_thread_update_delay(ca); - break; - } - dvb_ringbuffer_init(&ca->slot_info[slot].rx_buffer, rxbuf, RX_BUFFER_SIZE); + rxbuf = vmalloc(RX_BUFFER_SIZE); + if (rxbuf == NULL) { + printk("dvb_ca adapter %d: Unable to allocate CAM rx buffer :(\n", ca->dvbdev->adapter->num); + ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; + dvb_ca_en50221_thread_update_delay(ca); + break; } + down_write(&ca->slot_info[slot].sem); + dvb_ringbuffer_init(&ca->slot_info[slot].rx_buffer, rxbuf, RX_BUFFER_SIZE); + up_write(&ca->slot_info[slot].sem); ca->pub->slot_ts_enable(ca->pub, slot); ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_RUNNING; @@ -1135,7 +1148,11 @@ static int dvb_ca_en50221_thread(void *data) if (!ca->open) continue; - // poll slots for data + // no need to poll if the CAM supports IRQs + if (ca->slot_info[slot].da_irq_supported) + break; + + // poll mode pktcount = 0; while ((status = dvb_ca_en50221_read_data(ca, slot, NULL, 0)) > 0) { if (!ca->open) @@ -1350,13 +1367,12 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file, /** * Condition for waking up in dvb_ca_en50221_io_read_condition */ -static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, - int *result, int *_slot) +static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, int *result, int *_slot) { int slot; int slot_count = 0; int idx; - size_t fraglen; + int fraglen; int connection_id = -1; int found = 0; u8 hdr[2]; @@ -1366,7 +1382,10 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_RUNNING) goto nextslot; + down_read(&ca->slot_info[slot].sem); + if (ca->slot_info[slot].rx_buffer.data == NULL) { + up_read(&ca->slot_info[slot].sem); return 0; } @@ -1384,7 +1403,10 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, idx = dvb_ringbuffer_pkt_next(&ca->slot_info[slot].rx_buffer, idx, &fraglen); } -nextslot: + if (!found) + up_read(&ca->slot_info[slot].sem); + + nextslot: slot = (slot + 1) % ca->slot_count; slot_count++; } @@ -1489,7 +1511,8 @@ static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user * buf, goto exit; status = pktlen; -exit: + exit: + up_read(&ca->slot_info[slot].sem); return status; } @@ -1521,11 +1544,11 @@ static int dvb_ca_en50221_io_open(struct inode *inode, struct file *file) for (i = 0; i < ca->slot_count; i++) { if (ca->slot_info[i].slot_state == DVB_CA_SLOTSTATE_RUNNING) { + down_write(&ca->slot_info[i].sem); if (ca->slot_info[i].rx_buffer.data != NULL) { - /* it is safe to call this here without locks because - * ca->open == 0. Data is not read in this case */ dvb_ringbuffer_flush(&ca->slot_info[i].rx_buffer); } + up_write(&ca->slot_info[i].sem); } } @@ -1584,6 +1607,7 @@ static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table * wait) dprintk("%s\n", __FUNCTION__); if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { + up_read(&ca->slot_info[slot].sem); mask |= POLLIN; } @@ -1595,6 +1619,7 @@ static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table * wait) poll_wait(file, &ca->wait_queue, wait); if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { + up_read(&ca->slot_info[slot].sem); mask |= POLLIN; } @@ -1684,6 +1709,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, ca->slot_info[i].slot_state = DVB_CA_SLOTSTATE_NONE; atomic_set(&ca->slot_info[i].camchange_count, 0); ca->slot_info[i].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED; + init_rwsem(&ca->slot_info[i].sem); } if (signal_pending(current)) { @@ -1703,7 +1729,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, ca->thread_pid = ret; return 0; -error: + error: if (ca != NULL) { if (ca->dvbdev != NULL) dvb_unregister_device(ca->dvbdev); @@ -1745,9 +1771,6 @@ void dvb_ca_en50221_release(struct dvb_ca_en50221 *pubca) for (i = 0; i < ca->slot_count; i++) { dvb_ca_en50221_slot_shutdown(ca, i); - if (ca->slot_info[i].rx_buffer.data != NULL) { - vfree(ca->slot_info[i].rx_buffer.data); - } } kfree(ca->slot_info); dvb_unregister_device(ca->dvbdev); diff --git a/trunk/drivers/media/dvb/dvb-core/dvb_filter.c b/trunk/drivers/media/dvb/dvb-core/dvb_filter.c index c49fd0bd7181..bd5143906084 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvb_filter.c +++ b/trunk/drivers/media/dvb/dvb-core/dvb_filter.c @@ -72,12 +72,12 @@ static int read_picture_header(u8 *headr, struct mpg_picture *pic, int field, in u8 pct; if (pr) printk( "Pic header: "); - pic->temporal_reference[field] = (( headr[0] << 2 ) | + pic->temporal_reference[field] = (( headr[0] << 2 ) | (headr[1] & 0x03) )& 0x03ff; if (pr) printk( " temp ref: 0x%04x", pic->temporal_reference[field]); pct = ( headr[1] >> 2 ) & 0x07; - pic->picture_coding_type[field] = pct; + pic->picture_coding_type[field] = pct; if (pr) { switch(pct){ case I_FRAME: @@ -93,17 +93,17 @@ static int read_picture_header(u8 *headr, struct mpg_picture *pic, int field, in } - pic->vinfo.vbv_delay = (( headr[1] >> 5 ) | ( headr[2] << 3) | + pic->vinfo.vbv_delay = (( headr[1] >> 5 ) | ( headr[2] << 3) | ( (headr[3] & 0x1F) << 11) ) & 0xffff; if (pr) printk( " vbv delay: 0x%04x", pic->vinfo.vbv_delay); - pic->picture_header_parameter = ( headr[3] & 0xe0 ) | + pic->picture_header_parameter = ( headr[3] & 0xe0 ) | ((headr[4] & 0x80) >> 3); - if ( pct == B_FRAME ){ - pic->picture_header_parameter |= ( headr[4] >> 3 ) & 0x0f; - } + if ( pct == B_FRAME ){ + pic->picture_header_parameter |= ( headr[4] >> 3 ) & 0x0f; + } if (pr) printk( " pic head param: 0x%x", pic->picture_header_parameter); @@ -124,18 +124,18 @@ static int read_gop_header(u8 *headr, struct mpg_picture *pic, int pr) ((headr[0]<<4)& 0x30)| ((headr[1]>>4)& 0x0F), ((headr[1]<<3)& 0x38)| ((headr[2]>>5)& 0x0F)); - if ( ( headr[3] & 0x40 ) != 0 ){ - pic->closed_gop = 1; - } else { - pic->closed_gop = 0; - } + if ( ( headr[3] & 0x40 ) != 0 ){ + pic->closed_gop = 1; + } else { + pic->closed_gop = 0; + } if (pr) printk("closed: %d", pic->closed_gop); - if ( ( headr[3] & 0x20 ) != 0 ){ - pic->broken_link = 1; - } else { - pic->broken_link = 0; - } + if ( ( headr[3] & 0x20 ) != 0 ){ + pic->broken_link = 1; + } else { + pic->broken_link = 0; + } if (pr) printk(" broken: %d\n", pic->broken_link); return 0; @@ -146,7 +146,7 @@ static int read_gop_header(u8 *headr, struct mpg_picture *pic, int pr) /* needs 8 byte input */ static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) { - int sw; + int sw; int form = -1; if (pr) printk("Reading sequence header\n"); @@ -154,9 +154,9 @@ static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) vi->horizontal_size = ((headr[1] &0xF0) >> 4) | (headr[0] << 4); vi->vertical_size = ((headr[1] &0x0F) << 8) | (headr[2]); - sw = (int)((headr[3]&0xF0) >> 4) ; + sw = (int)((headr[3]&0xF0) >> 4) ; - switch( sw ){ + switch( sw ){ case 1: if (pr) printk("Videostream: ASPECT: 1:1"); @@ -165,84 +165,84 @@ static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) case 2: if (pr) printk("Videostream: ASPECT: 4:3"); - vi->aspect_ratio = 133; + vi->aspect_ratio = 133; break; case 3: if (pr) printk("Videostream: ASPECT: 16:9"); - vi->aspect_ratio = 177; + vi->aspect_ratio = 177; break; case 4: if (pr) printk("Videostream: ASPECT: 2.21:1"); - vi->aspect_ratio = 221; + vi->aspect_ratio = 221; break; - case 5 ... 15: + case 5 ... 15: if (pr) printk("Videostream: ASPECT: reserved"); - vi->aspect_ratio = 0; + vi->aspect_ratio = 0; break; - default: - vi->aspect_ratio = 0; - return -1; + default: + vi->aspect_ratio = 0; + return -1; } if (pr) printk(" Size = %dx%d",vi->horizontal_size,vi->vertical_size); - sw = (int)(headr[3]&0x0F); + sw = (int)(headr[3]&0x0F); - switch ( sw ) { + switch ( sw ) { case 1: if (pr) printk(" FRate: 23.976 fps"); - vi->framerate = 23976; + vi->framerate = 23976; form = -1; break; case 2: if (pr) printk(" FRate: 24 fps"); - vi->framerate = 24000; + vi->framerate = 24000; form = -1; break; case 3: if (pr) printk(" FRate: 25 fps"); - vi->framerate = 25000; + vi->framerate = 25000; form = VIDEO_MODE_PAL; break; case 4: if (pr) printk(" FRate: 29.97 fps"); - vi->framerate = 29970; + vi->framerate = 29970; form = VIDEO_MODE_NTSC; break; case 5: if (pr) printk(" FRate: 30 fps"); - vi->framerate = 30000; + vi->framerate = 30000; form = VIDEO_MODE_NTSC; break; case 6: if (pr) printk(" FRate: 50 fps"); - vi->framerate = 50000; + vi->framerate = 50000; form = VIDEO_MODE_PAL; break; case 7: if (pr) printk(" FRate: 60 fps"); - vi->framerate = 60000; + vi->framerate = 60000; form = VIDEO_MODE_NTSC; break; } vi->bit_rate = (headr[4] << 10) | (headr[5] << 2) | (headr[6] & 0x03); - vi->vbv_buffer_size - = (( headr[6] & 0xF8) >> 3 ) | (( headr[7] & 0x1F )<< 5); + vi->vbv_buffer_size + = (( headr[6] & 0xF8) >> 3 ) | (( headr[7] & 0x1F )<< 5); if (pr){ printk(" BRate: %d Mbit/s",4*(vi->bit_rate)/10000); @@ -250,7 +250,7 @@ static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) printk("\n"); } - vi->video_format = form; + vi->video_format = form; return 0; } @@ -308,7 +308,7 @@ static int get_ainfo(u8 *mbuf, int count, struct dvb_audio_info *ai, int pr) if (!found) return -1; if (c+3 >= count) return -1; - headr = mbuf+c; + headr = mbuf+c; ai->layer = (headr[1] & 0x06) >> 1; @@ -368,7 +368,7 @@ int dvb_filter_get_ac3info(u8 *mbuf, int count, struct dvb_audio_info *ai, int p if (c+5 >= count) return -1; ai->layer = 0; // 0 for AC3 - headr = mbuf+c+2; + headr = mbuf+c+2; frame = (headr[2]&0x3f); ai->bit_rate = ac3_bitrates[frame >> 1]*1000; @@ -396,159 +396,159 @@ EXPORT_SYMBOL(dvb_filter_get_ac3info); #if 0 static u8 *skip_pes_header(u8 **bufp) { - u8 *inbuf = *bufp; - u8 *buf = inbuf; - u8 *pts = NULL; - int skip = 0; + u8 *inbuf = *bufp; + u8 *buf = inbuf; + u8 *pts = NULL; + int skip = 0; static const int mpeg1_skip_table[16] = { 1, 0xffff, 5, 10, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; - if ((inbuf[6] & 0xc0) == 0x80){ /* mpeg2 */ - if (buf[7] & PTS_ONLY) - pts = buf+9; - else pts = NULL; - buf = inbuf + 9 + inbuf[8]; - } else { /* mpeg1 */ - for (buf = inbuf + 6; *buf == 0xff; buf++) - if (buf == inbuf + 6 + 16) { - break; - } - if ((*buf & 0xc0) == 0x40) - buf += 2; - skip = mpeg1_skip_table [*buf >> 4]; - if (skip == 5 || skip == 10) pts = buf; - else pts = NULL; - - buf += mpeg1_skip_table [*buf >> 4]; - } - - *bufp = buf; - return pts; + if ((inbuf[6] & 0xc0) == 0x80){ /* mpeg2 */ + if (buf[7] & PTS_ONLY) + pts = buf+9; + else pts = NULL; + buf = inbuf + 9 + inbuf[8]; + } else { /* mpeg1 */ + for (buf = inbuf + 6; *buf == 0xff; buf++) + if (buf == inbuf + 6 + 16) { + break; + } + if ((*buf & 0xc0) == 0x40) + buf += 2; + skip = mpeg1_skip_table [*buf >> 4]; + if (skip == 5 || skip == 10) pts = buf; + else pts = NULL; + + buf += mpeg1_skip_table [*buf >> 4]; + } + + *bufp = buf; + return pts; } #endif #if 0 static void initialize_quant_matrix( u32 *matrix ) { - int i; - - matrix[0] = 0x08101013; - matrix[1] = 0x10131616; - matrix[2] = 0x16161616; - matrix[3] = 0x1a181a1b; - matrix[4] = 0x1b1b1a1a; - matrix[5] = 0x1a1a1b1b; - matrix[6] = 0x1b1d1d1d; - matrix[7] = 0x2222221d; - matrix[8] = 0x1d1d1b1b; - matrix[9] = 0x1d1d2020; - matrix[10] = 0x22222526; - matrix[11] = 0x25232322; - matrix[12] = 0x23262628; - matrix[13] = 0x28283030; - matrix[14] = 0x2e2e3838; - matrix[15] = 0x3a454553; - - for ( i = 16 ; i < 32 ; i++ ) - matrix[i] = 0x10101010; + int i; + + matrix[0] = 0x08101013; + matrix[1] = 0x10131616; + matrix[2] = 0x16161616; + matrix[3] = 0x1a181a1b; + matrix[4] = 0x1b1b1a1a; + matrix[5] = 0x1a1a1b1b; + matrix[6] = 0x1b1d1d1d; + matrix[7] = 0x2222221d; + matrix[8] = 0x1d1d1b1b; + matrix[9] = 0x1d1d2020; + matrix[10] = 0x22222526; + matrix[11] = 0x25232322; + matrix[12] = 0x23262628; + matrix[13] = 0x28283030; + matrix[14] = 0x2e2e3838; + matrix[15] = 0x3a454553; + + for ( i = 16 ; i < 32 ; i++ ) + matrix[i] = 0x10101010; } #endif #if 0 static void initialize_mpg_picture(struct mpg_picture *pic) { - int i; - - /* set MPEG1 */ - pic->mpeg1_flag = 1; - pic->profile_and_level = 0x4A ; /* MP@LL */ - pic->progressive_sequence = 1; - pic->low_delay = 0; - - pic->sequence_display_extension_flag = 0; - for ( i = 0 ; i < 4 ; i++ ){ - pic->frame_centre_horizontal_offset[i] = 0; - pic->frame_centre_vertical_offset[i] = 0; - } - pic->last_frame_centre_horizontal_offset = 0; - pic->last_frame_centre_vertical_offset = 0; - - pic->picture_display_extension_flag[0] = 0; - pic->picture_display_extension_flag[1] = 0; - pic->sequence_header_flag = 0; + int i; + + /* set MPEG1 */ + pic->mpeg1_flag = 1; + pic->profile_and_level = 0x4A ; /* MP@LL */ + pic->progressive_sequence = 1; + pic->low_delay = 0; + + pic->sequence_display_extension_flag = 0; + for ( i = 0 ; i < 4 ; i++ ){ + pic->frame_centre_horizontal_offset[i] = 0; + pic->frame_centre_vertical_offset[i] = 0; + } + pic->last_frame_centre_horizontal_offset = 0; + pic->last_frame_centre_vertical_offset = 0; + + pic->picture_display_extension_flag[0] = 0; + pic->picture_display_extension_flag[1] = 0; + pic->sequence_header_flag = 0; pic->gop_flag = 0; - pic->sequence_end_flag = 0; + pic->sequence_end_flag = 0; } #endif #if 0 static void mpg_set_picture_parameter( int32_t field_type, struct mpg_picture *pic ) { - int16_t last_h_offset; - int16_t last_v_offset; - - int16_t *p_h_offset; - int16_t *p_v_offset; - - if ( pic->mpeg1_flag ){ - pic->picture_structure[field_type] = VIDEO_FRAME_PICTURE; - pic->top_field_first = 0; - pic->repeat_first_field = 0; - pic->progressive_frame = 1; - pic->picture_coding_parameter = 0x000010; - } - - /* Reset flag */ - pic->picture_display_extension_flag[field_type] = 0; - - last_h_offset = pic->last_frame_centre_horizontal_offset; - last_v_offset = pic->last_frame_centre_vertical_offset; - if ( field_type == FIRST_FIELD ){ - p_h_offset = pic->frame_centre_horizontal_offset; - p_v_offset = pic->frame_centre_vertical_offset; - *p_h_offset = last_h_offset; - *(p_h_offset + 1) = last_h_offset; - *(p_h_offset + 2) = last_h_offset; - *p_v_offset = last_v_offset; - *(p_v_offset + 1) = last_v_offset; - *(p_v_offset + 2) = last_v_offset; - } else { - pic->frame_centre_horizontal_offset[3] = last_h_offset; - pic->frame_centre_vertical_offset[3] = last_v_offset; - } + int16_t last_h_offset; + int16_t last_v_offset; + + int16_t *p_h_offset; + int16_t *p_v_offset; + + if ( pic->mpeg1_flag ){ + pic->picture_structure[field_type] = VIDEO_FRAME_PICTURE; + pic->top_field_first = 0; + pic->repeat_first_field = 0; + pic->progressive_frame = 1; + pic->picture_coding_parameter = 0x000010; + } + + /* Reset flag */ + pic->picture_display_extension_flag[field_type] = 0; + + last_h_offset = pic->last_frame_centre_horizontal_offset; + last_v_offset = pic->last_frame_centre_vertical_offset; + if ( field_type == FIRST_FIELD ){ + p_h_offset = pic->frame_centre_horizontal_offset; + p_v_offset = pic->frame_centre_vertical_offset; + *p_h_offset = last_h_offset; + *(p_h_offset + 1) = last_h_offset; + *(p_h_offset + 2) = last_h_offset; + *p_v_offset = last_v_offset; + *(p_v_offset + 1) = last_v_offset; + *(p_v_offset + 2) = last_v_offset; + } else { + pic->frame_centre_horizontal_offset[3] = last_h_offset; + pic->frame_centre_vertical_offset[3] = last_v_offset; + } } #endif #if 0 static void init_mpg_picture( struct mpg_picture *pic, int chan, int32_t field_type) { - pic->picture_header = 0; - pic->sequence_header_data - = ( INIT_HORIZONTAL_SIZE << 20 ) - | ( INIT_VERTICAL_SIZE << 8 ) - | ( INIT_ASPECT_RATIO << 4 ) - | ( INIT_FRAME_RATE ); - pic->mpeg1_flag = 0; - pic->vinfo.horizontal_size - = INIT_DISP_HORIZONTAL_SIZE; - pic->vinfo.vertical_size - = INIT_DISP_VERTICAL_SIZE; - pic->picture_display_extension_flag[field_type] - = 0; - pic->pts_flag[field_type] = 0; - - pic->sequence_gop_header = 0; - pic->picture_header = 0; - pic->sequence_header_flag = 0; - pic->gop_flag = 0; - pic->sequence_end_flag = 0; - pic->sequence_display_extension_flag = 0; - pic->last_frame_centre_horizontal_offset = 0; - pic->last_frame_centre_vertical_offset = 0; + pic->picture_header = 0; + pic->sequence_header_data + = ( INIT_HORIZONTAL_SIZE << 20 ) + | ( INIT_VERTICAL_SIZE << 8 ) + | ( INIT_ASPECT_RATIO << 4 ) + | ( INIT_FRAME_RATE ); + pic->mpeg1_flag = 0; + pic->vinfo.horizontal_size + = INIT_DISP_HORIZONTAL_SIZE; + pic->vinfo.vertical_size + = INIT_DISP_VERTICAL_SIZE; + pic->picture_display_extension_flag[field_type] + = 0; + pic->pts_flag[field_type] = 0; + + pic->sequence_gop_header = 0; + pic->picture_header = 0; + pic->sequence_header_flag = 0; + pic->gop_flag = 0; + pic->sequence_end_flag = 0; + pic->sequence_display_extension_flag = 0; + pic->last_frame_centre_horizontal_offset = 0; + pic->last_frame_centre_vertical_offset = 0; pic->channel = chan; } #endif @@ -588,11 +588,11 @@ int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, buf[1]&=~0x40; } if (!len) - return 0; + return 0; buf[3]=0x30|((p2ts->cc++)&0x0f); rest=183-len; if (rest) { - buf[5]=0x00; + buf[5]=0x00; if (rest-1) memset(buf+6, 0xff, rest-1); } diff --git a/trunk/drivers/media/dvb/dvb-core/dvb_filter.h b/trunk/drivers/media/dvb/dvb-core/dvb_filter.h index 375e3be184b1..b0848f7836b7 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvb_filter.h +++ b/trunk/drivers/media/dvb/dvb-core/dvb_filter.h @@ -29,8 +29,8 @@ typedef int (dvb_filter_pes2ts_cb_t) (void *, unsigned char *); struct dvb_filter_pes2ts { unsigned char buf[188]; - unsigned char cc; - dvb_filter_pes2ts_cb_t *cb; + unsigned char cc; + dvb_filter_pes2ts_cb_t *cb; void *priv; }; @@ -162,7 +162,7 @@ struct dvb_video_info { u32 bit_rate; u32 comp_bit_rate; u32 vbv_buffer_size; - s16 vbv_delay; + s16 vbv_delay; u32 CSPF; u32 off; }; @@ -173,60 +173,60 @@ struct dvb_video_info { #define VIDEO_FRAME_PICTURE 0x03 struct mpg_picture { - int channel; + int channel; struct dvb_video_info vinfo; - u32 *sequence_gop_header; - u32 *picture_header; - s32 time_code; - int low_delay; - int closed_gop; - int broken_link; - int sequence_header_flag; - int gop_flag; - int sequence_end_flag; - - u8 profile_and_level; - s32 picture_coding_parameter; - u32 matrix[32]; - s8 matrix_change_flag; - - u8 picture_header_parameter; + u32 *sequence_gop_header; + u32 *picture_header; + s32 time_code; + int low_delay; + int closed_gop; + int broken_link; + int sequence_header_flag; + int gop_flag; + int sequence_end_flag; + + u8 profile_and_level; + s32 picture_coding_parameter; + u32 matrix[32]; + s8 matrix_change_flag; + + u8 picture_header_parameter; /* bit 0 - 2: bwd f code bit 3 : fpb vector bit 4 - 6: fwd f code bit 7 : fpf vector */ - int mpeg1_flag; - int progressive_sequence; - int sequence_display_extension_flag; - u32 sequence_header_data; - s16 last_frame_centre_horizontal_offset; - s16 last_frame_centre_vertical_offset; - - u32 pts[2]; /* [0] 1st field, [1] 2nd field */ - int top_field_first; - int repeat_first_field; - int progressive_frame; - int bank; - int forward_bank; - int backward_bank; - int compress; - s16 frame_centre_horizontal_offset[OFF_SIZE]; - /* [0-2] 1st field, [3] 2nd field */ - s16 frame_centre_vertical_offset[OFF_SIZE]; - /* [0-2] 1st field, [3] 2nd field */ - s16 temporal_reference[2]; - /* [0] 1st field, [1] 2nd field */ - - s8 picture_coding_type[2]; - /* [0] 1st field, [1] 2nd field */ - s8 picture_structure[2]; - /* [0] 1st field, [1] 2nd field */ - s8 picture_display_extension_flag[2]; - /* [0] 1st field, [1] 2nd field */ - /* picture_display_extenion() 0:no 1:exit*/ - s8 pts_flag[2]; - /* [0] 1st field, [1] 2nd field */ + int mpeg1_flag; + int progressive_sequence; + int sequence_display_extension_flag; + u32 sequence_header_data; + s16 last_frame_centre_horizontal_offset; + s16 last_frame_centre_vertical_offset; + + u32 pts[2]; /* [0] 1st field, [1] 2nd field */ + int top_field_first; + int repeat_first_field; + int progressive_frame; + int bank; + int forward_bank; + int backward_bank; + int compress; + s16 frame_centre_horizontal_offset[OFF_SIZE]; + /* [0-2] 1st field, [3] 2nd field */ + s16 frame_centre_vertical_offset[OFF_SIZE]; + /* [0-2] 1st field, [3] 2nd field */ + s16 temporal_reference[2]; + /* [0] 1st field, [1] 2nd field */ + + s8 picture_coding_type[2]; + /* [0] 1st field, [1] 2nd field */ + s8 picture_structure[2]; + /* [0] 1st field, [1] 2nd field */ + s8 picture_display_extension_flag[2]; + /* [0] 1st field, [1] 2nd field */ + /* picture_display_extenion() 0:no 1:exit*/ + s8 pts_flag[2]; + /* [0] 1st field, [1] 2nd field */ }; struct dvb_audio_info { diff --git a/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c b/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c index 95ea5095e07e..6ffa6b216363 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -372,10 +372,10 @@ static int dvb_frontend_thread(void *data) snprintf (name, sizeof(name), "kdvb-fe-%i", fe->dvb->num); - lock_kernel(); - daemonize(name); - sigfillset(¤t->blocked); - unlock_kernel(); + lock_kernel(); + daemonize(name); + sigfillset(¤t->blocked); + unlock_kernel(); fepriv->status = 0; dvb_frontend_init(fe); diff --git a/trunk/drivers/media/dvb/dvb-core/dvb_frontend.h b/trunk/drivers/media/dvb/dvb-core/dvb_frontend.h index 1e0840d02f1f..348c9b0b988a 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvb_frontend.h +++ b/trunk/drivers/media/dvb/dvb-core/dvb_frontend.h @@ -41,10 +41,10 @@ #include "dvbdev.h" struct dvb_frontend_tune_settings { - int min_delay_ms; - int step_size; - int max_drift; - struct dvb_frontend_parameters parameters; + int min_delay_ms; + int step_size; + int max_drift; + struct dvb_frontend_parameters parameters; }; struct dvb_frontend; diff --git a/trunk/drivers/media/dvb/dvb-core/dvb_net.c b/trunk/drivers/media/dvb/dvb-core/dvb_net.c index 86bba81e851e..87935490bfb2 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvb_net.c +++ b/trunk/drivers/media/dvb/dvb-core/dvb_net.c @@ -151,8 +151,6 @@ struct dvb_net_priv { unsigned char ule_bridged; /* Whether the ULE_BRIDGED extension header was found. */ int ule_sndu_remain; /* Nr. of bytes still required for current ULE SNDU. */ unsigned long ts_count; /* Current ts cell counter. */ - - struct semaphore mutex; }; @@ -713,7 +711,7 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len, if (buffer1_len > 32768) printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len); /* printk("TS callback: %u bytes, %u TS cells @ %p.\n", - buffer1_len, buffer1_len / TS_SZ, buffer1); */ + buffer1_len, buffer1_len / TS_SZ, buffer1); */ dvb_net_ule(dev, buffer1, buffer1_len); return 0; } @@ -721,8 +719,8 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len, static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) { - u8 *eth; - struct sk_buff *skb; + u8 *eth; + struct sk_buff *skb; struct net_device_stats *stats = &(((struct dvb_net_priv *) dev->priv)->stats); int snap = 0; @@ -754,7 +752,7 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) return; } snap = 8; - } + } if (pkt[7]) { /* FIXME: assemble datagram from multiple sections */ stats->rx_errors++; @@ -778,14 +776,14 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) memcpy(eth + 14, pkt + 12 + snap, pkt_len - 12 - 4 - snap); /* create ethernet header: */ - eth[0]=pkt[0x0b]; - eth[1]=pkt[0x0a]; - eth[2]=pkt[0x09]; - eth[3]=pkt[0x08]; - eth[4]=pkt[0x04]; - eth[5]=pkt[0x03]; + eth[0]=pkt[0x0b]; + eth[1]=pkt[0x0a]; + eth[2]=pkt[0x09]; + eth[3]=pkt[0x08]; + eth[4]=pkt[0x04]; + eth[5]=pkt[0x03]; - eth[6]=eth[7]=eth[8]=eth[9]=eth[10]=eth[11]=0; + eth[6]=eth[7]=eth[8]=eth[9]=eth[10]=eth[11]=0; if (snap) { eth[12] = pkt[18]; @@ -807,7 +805,7 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) stats->rx_packets++; stats->rx_bytes+=skb->len; - netif_rx(skb); + netif_rx(skb); } static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len, @@ -815,7 +813,7 @@ static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len, struct dmx_section_filter *filter, enum dmx_success success) { - struct net_device *dev = filter->priv; + struct net_device *dev = filter->priv; /** * we rely on the DVB API definition where exactly one complete @@ -883,13 +881,12 @@ static int dvb_net_filter_sec_set(struct net_device *dev, static int dvb_net_feed_start(struct net_device *dev) { - int ret = 0, i; + int ret, i; struct dvb_net_priv *priv = dev->priv; - struct dmx_demux *demux = priv->demux; - unsigned char *mac = (unsigned char *) dev->dev_addr; + struct dmx_demux *demux = priv->demux; + unsigned char *mac = (unsigned char *) dev->dev_addr; dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode); - down(&priv->mutex); if (priv->tsfeed || priv->secfeed || priv->secfilter || priv->multi_secfilter[0]) printk("%s: BUG %d\n", __FUNCTION__, __LINE__); @@ -903,7 +900,7 @@ static int dvb_net_feed_start(struct net_device *dev) dvb_net_sec_callback); if (ret<0) { printk("%s: could not allocate section feed\n", dev->name); - goto error; + return ret; } ret = priv->secfeed->set(priv->secfeed, priv->pid, 32768, 1); @@ -912,7 +909,7 @@ static int dvb_net_feed_start(struct net_device *dev) printk("%s: could not set section feed\n", dev->name); priv->demux->release_section_feed(priv->demux, priv->secfeed); priv->secfeed=NULL; - goto error; + return ret; } if (priv->rx_mode != RX_MODE_PROMISC) { @@ -951,7 +948,7 @@ static int dvb_net_feed_start(struct net_device *dev) ret = demux->allocate_ts_feed(demux, &priv->tsfeed, dvb_net_ts_callback); if (ret < 0) { printk("%s: could not allocate ts feed\n", dev->name); - goto error; + return ret; } /* Set netdevice pointer for ts decaps callback. */ @@ -965,26 +962,23 @@ static int dvb_net_feed_start(struct net_device *dev) printk("%s: could not set ts feed\n", dev->name); priv->demux->release_ts_feed(priv->demux, priv->tsfeed); priv->tsfeed = NULL; - goto error; + return ret; } dprintk("%s: start filtering\n", __FUNCTION__); priv->tsfeed->start_filtering(priv->tsfeed); } else - ret = -EINVAL; + return -EINVAL; -error: - up(&priv->mutex); - return ret; + return 0; } static int dvb_net_feed_stop(struct net_device *dev) { struct dvb_net_priv *priv = dev->priv; - int i, ret = 0; + int i; dprintk("%s\n", __FUNCTION__); - down(&priv->mutex); if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) { if (priv->secfeed) { if (priv->secfeed->is_filtering) { @@ -1025,9 +1019,8 @@ static int dvb_net_feed_stop(struct net_device *dev) else printk("%s: no ts feed to stop\n", dev->name); } else - ret = -EINVAL; - up(&priv->mutex); - return ret; + return -EINVAL; + return 0; } @@ -1051,8 +1044,8 @@ static void wq_set_multicast_list (void *data) struct dvb_net_priv *priv = dev->priv; dvb_net_feed_stop(dev); + priv->rx_mode = RX_MODE_UNI; - spin_lock_bh(&dev->xmit_lock); if (dev->flags & IFF_PROMISC) { dprintk("%s: promiscuous mode\n", dev->name); @@ -1077,7 +1070,6 @@ static void wq_set_multicast_list (void *data) } } - spin_unlock_bh(&dev->xmit_lock); dvb_net_feed_start(dev); } @@ -1129,12 +1121,12 @@ static int dvb_net_stop(struct net_device *dev) struct dvb_net_priv *priv = dev->priv; priv->in_use--; - return dvb_net_feed_stop(dev); + return dvb_net_feed_stop(dev); } static struct net_device_stats * dvb_net_get_stats(struct net_device *dev) { - return &((struct dvb_net_priv*) dev->priv)->stats; + return &((struct dvb_net_priv*) dev->priv)->stats; } static void dvb_net_setup(struct net_device *dev) @@ -1208,7 +1200,6 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net); INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net); - init_MUTEX(&priv->mutex); net->base_addr = pid; @@ -1360,10 +1351,10 @@ static struct file_operations dvb_net_fops = { }; static struct dvb_device dvbdev_net = { - .priv = NULL, - .users = 1, - .writers = 1, - .fops = &dvb_net_fops, + .priv = NULL, + .users = 1, + .writers = 1, + .fops = &dvb_net_fops, }; diff --git a/trunk/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/trunk/drivers/media/dvb/dvb-core/dvb_ringbuffer.c index 283c6e9339a4..fb6d94a69d71 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvb_ringbuffer.c +++ b/trunk/drivers/media/dvb/dvb-core/dvb_ringbuffer.c @@ -42,216 +42,216 @@ void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len) { - rbuf->pread=rbuf->pwrite=0; - rbuf->data=data; - rbuf->size=len; + rbuf->pread=rbuf->pwrite=0; + rbuf->data=data; + rbuf->size=len; - init_waitqueue_head(&rbuf->queue); + init_waitqueue_head(&rbuf->queue); - spin_lock_init(&(rbuf->lock)); + spin_lock_init(&(rbuf->lock)); } int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf) { - return (rbuf->pread==rbuf->pwrite); + return (rbuf->pread==rbuf->pwrite); } ssize_t dvb_ringbuffer_free(struct dvb_ringbuffer *rbuf) { - ssize_t free; + ssize_t free; - free = rbuf->pread - rbuf->pwrite; - if (free <= 0) - free += rbuf->size; - return free-1; + free = rbuf->pread - rbuf->pwrite; + if (free <= 0) + free += rbuf->size; + return free-1; } ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf) { - ssize_t avail; + ssize_t avail; - avail = rbuf->pwrite - rbuf->pread; - if (avail < 0) - avail += rbuf->size; - return avail; + avail = rbuf->pwrite - rbuf->pread; + if (avail < 0) + avail += rbuf->size; + return avail; } void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf) { - rbuf->pread = rbuf->pwrite; + rbuf->pread = rbuf->pwrite; } void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf) { - unsigned long flags; + unsigned long flags; - spin_lock_irqsave(&rbuf->lock, flags); - dvb_ringbuffer_flush(rbuf); - spin_unlock_irqrestore(&rbuf->lock, flags); + spin_lock_irqsave(&rbuf->lock, flags); + dvb_ringbuffer_flush(rbuf); + spin_unlock_irqrestore(&rbuf->lock, flags); - wake_up(&rbuf->queue); + wake_up(&rbuf->queue); } ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len, int usermem) { - size_t todo = len; - size_t split; - - split = (rbuf->pread + len > rbuf->size) ? rbuf->size - rbuf->pread : 0; - if (split > 0) { - if (!usermem) - memcpy(buf, rbuf->data+rbuf->pread, split); - else - if (copy_to_user(buf, rbuf->data+rbuf->pread, split)) - return -EFAULT; - buf += split; - todo -= split; - rbuf->pread = 0; - } - if (!usermem) - memcpy(buf, rbuf->data+rbuf->pread, todo); - else - if (copy_to_user(buf, rbuf->data+rbuf->pread, todo)) - return -EFAULT; - - rbuf->pread = (rbuf->pread + todo) % rbuf->size; - - return len; + size_t todo = len; + size_t split; + + split = (rbuf->pread + len > rbuf->size) ? rbuf->size - rbuf->pread : 0; + if (split > 0) { + if (!usermem) + memcpy(buf, rbuf->data+rbuf->pread, split); + else + if (copy_to_user(buf, rbuf->data+rbuf->pread, split)) + return -EFAULT; + buf += split; + todo -= split; + rbuf->pread = 0; + } + if (!usermem) + memcpy(buf, rbuf->data+rbuf->pread, todo); + else + if (copy_to_user(buf, rbuf->data+rbuf->pread, todo)) + return -EFAULT; + + rbuf->pread = (rbuf->pread + todo) % rbuf->size; + + return len; } ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, size_t len) { - size_t todo = len; - size_t split; + size_t todo = len; + size_t split; - split = (rbuf->pwrite + len > rbuf->size) ? rbuf->size - rbuf->pwrite : 0; + split = (rbuf->pwrite + len > rbuf->size) ? rbuf->size - rbuf->pwrite : 0; - if (split > 0) { - memcpy(rbuf->data+rbuf->pwrite, buf, split); - buf += split; - todo -= split; - rbuf->pwrite = 0; - } - memcpy(rbuf->data+rbuf->pwrite, buf, todo); - rbuf->pwrite = (rbuf->pwrite + todo) % rbuf->size; + if (split > 0) { + memcpy(rbuf->data+rbuf->pwrite, buf, split); + buf += split; + todo -= split; + rbuf->pwrite = 0; + } + memcpy(rbuf->data+rbuf->pwrite, buf, todo); + rbuf->pwrite = (rbuf->pwrite + todo) % rbuf->size; - return len; + return len; } ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len) { - int status; - ssize_t oldpwrite = rbuf->pwrite; + int status; + ssize_t oldpwrite = rbuf->pwrite; - DVB_RINGBUFFER_WRITE_BYTE(rbuf, len >> 8); - DVB_RINGBUFFER_WRITE_BYTE(rbuf, len & 0xff); - DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY); - status = dvb_ringbuffer_write(rbuf, buf, len); + DVB_RINGBUFFER_WRITE_BYTE(rbuf, len >> 8); + DVB_RINGBUFFER_WRITE_BYTE(rbuf, len & 0xff); + DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY); + status = dvb_ringbuffer_write(rbuf, buf, len); - if (status < 0) rbuf->pwrite = oldpwrite; - return status; + if (status < 0) rbuf->pwrite = oldpwrite; + return status; } ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx, - int offset, u8* buf, size_t len, int usermem) + int offset, u8* buf, size_t len, int usermem) { - size_t todo; - size_t split; - size_t pktlen; - - pktlen = rbuf->data[idx] << 8; - pktlen |= rbuf->data[(idx + 1) % rbuf->size]; - if (offset > pktlen) return -EINVAL; - if ((offset + len) > pktlen) len = pktlen - offset; - - idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size; - todo = len; - split = ((idx + len) > rbuf->size) ? rbuf->size - idx : 0; - if (split > 0) { - if (!usermem) - memcpy(buf, rbuf->data+idx, split); - else - if (copy_to_user(buf, rbuf->data+idx, split)) - return -EFAULT; - buf += split; - todo -= split; - idx = 0; - } - if (!usermem) - memcpy(buf, rbuf->data+idx, todo); - else - if (copy_to_user(buf, rbuf->data+idx, todo)) - return -EFAULT; - - return len; + size_t todo; + size_t split; + size_t pktlen; + + pktlen = rbuf->data[idx] << 8; + pktlen |= rbuf->data[(idx + 1) % rbuf->size]; + if (offset > pktlen) return -EINVAL; + if ((offset + len) > pktlen) len = pktlen - offset; + + idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size; + todo = len; + split = ((idx + len) > rbuf->size) ? rbuf->size - idx : 0; + if (split > 0) { + if (!usermem) + memcpy(buf, rbuf->data+idx, split); + else + if (copy_to_user(buf, rbuf->data+idx, split)) + return -EFAULT; + buf += split; + todo -= split; + idx = 0; + } + if (!usermem) + memcpy(buf, rbuf->data+idx, todo); + else + if (copy_to_user(buf, rbuf->data+idx, todo)) + return -EFAULT; + + return len; } void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx) { - size_t pktlen; - - rbuf->data[(idx + 2) % rbuf->size] = PKT_DISPOSED; - - // clean up disposed packets - while(dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) { - if (DVB_RINGBUFFER_PEEK(rbuf, 2) == PKT_DISPOSED) { - pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8; - pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1); - DVB_RINGBUFFER_SKIP(rbuf, pktlen + DVB_RINGBUFFER_PKTHDRSIZE); - } else { - // first packet is not disposed, so we stop cleaning now - break; - } - } + size_t pktlen; + + rbuf->data[(idx + 2) % rbuf->size] = PKT_DISPOSED; + + // clean up disposed packets + while(dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) { + if (DVB_RINGBUFFER_PEEK(rbuf, 2) == PKT_DISPOSED) { + pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8; + pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1); + DVB_RINGBUFFER_SKIP(rbuf, pktlen + DVB_RINGBUFFER_PKTHDRSIZE); + } else { + // first packet is not disposed, so we stop cleaning now + break; + } + } } ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* pktlen) { - int consumed; - int curpktlen; - int curpktstatus; + int consumed; + int curpktlen; + int curpktstatus; - if (idx == -1) { + if (idx == -1) { idx = rbuf->pread; } else { - curpktlen = rbuf->data[idx] << 8; - curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; - idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; + curpktlen = rbuf->data[idx] << 8; + curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; + idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; } - consumed = (idx - rbuf->pread) % rbuf->size; + consumed = (idx - rbuf->pread) % rbuf->size; - while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) { + while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) { - curpktlen = rbuf->data[idx] << 8; - curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; - curpktstatus = rbuf->data[(idx + 2) % rbuf->size]; + curpktlen = rbuf->data[idx] << 8; + curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; + curpktstatus = rbuf->data[(idx + 2) % rbuf->size]; - if (curpktstatus == PKT_READY) { - *pktlen = curpktlen; - return idx; - } + if (curpktstatus == PKT_READY) { + *pktlen = curpktlen; + return idx; + } - consumed += curpktlen + DVB_RINGBUFFER_PKTHDRSIZE; - idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; - } + consumed += curpktlen + DVB_RINGBUFFER_PKTHDRSIZE; + idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; + } - // no packets available - return -1; + // no packets available + return -1; } diff --git a/trunk/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/trunk/drivers/media/dvb/dvb-core/dvb_ringbuffer.h index fa476f662f82..d18e9c4ba9ea 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvb_ringbuffer.h +++ b/trunk/drivers/media/dvb/dvb-core/dvb_ringbuffer.h @@ -31,13 +31,13 @@ #include struct dvb_ringbuffer { - u8 *data; - ssize_t size; - ssize_t pread; - ssize_t pwrite; + u8 *data; + ssize_t size; + ssize_t pread; + ssize_t pwrite; - wait_queue_head_t queue; - spinlock_t lock; + wait_queue_head_t queue; + spinlock_t lock; }; #define DVB_RINGBUFFER_PKTHDRSIZE 3 @@ -106,7 +106,7 @@ extern void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf); ** returns number of bytes transferred or -EFAULT */ extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, - size_t len, int usermem); + size_t len, int usermem); /* write routines & macros */ @@ -121,7 +121,7 @@ extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, ** returns number of bytes transferred or -EFAULT */ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, - size_t len); + size_t len); /** @@ -133,7 +133,7 @@ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, * returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL. */ extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, - size_t len); + size_t len); /** * Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this @@ -149,7 +149,7 @@ extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, * returns Number of bytes read, or -EFAULT. */ extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx, - int offset, u8* buf, size_t len, int usermem); + int offset, u8* buf, size_t len, int usermem); /** * Dispose of a packet in the ring buffer. diff --git a/trunk/drivers/media/dvb/dvb-core/dvbdev.c b/trunk/drivers/media/dvb/dvb-core/dvbdev.c index a4aee8665854..477b4fa56430 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvbdev.c +++ b/trunk/drivers/media/dvb/dvb-core/dvbdev.c @@ -47,7 +47,7 @@ static LIST_HEAD(dvb_adapter_list); static DECLARE_MUTEX(dvbdev_register_lock); static const char * const dnames[] = { - "video", "audio", "sec", "frontend", "demux", "dvr", "ca", + "video", "audio", "sec", "frontend", "demux", "dvr", "ca", "net", "osd" }; @@ -90,15 +90,15 @@ static int dvb_device_open(struct inode *inode, struct file *file) file->private_data = dvbdev; old_fops = file->f_op; - file->f_op = fops_get(dvbdev->fops); - if(file->f_op->open) - err = file->f_op->open(inode,file); - if (err) { - fops_put(file->f_op); - file->f_op = fops_get(old_fops); - } - fops_put(old_fops); - return err; + file->f_op = fops_get(dvbdev->fops); + if(file->f_op->open) + err = file->f_op->open(inode,file); + if (err) { + fops_put(file->f_op); + file->f_op = fops_get(old_fops); + } + fops_put(old_fops); + return err; } return -ENODEV; } @@ -117,21 +117,21 @@ static struct cdev dvb_device_cdev = { int dvb_generic_open(struct inode *inode, struct file *file) { - struct dvb_device *dvbdev = file->private_data; + struct dvb_device *dvbdev = file->private_data; - if (!dvbdev) - return -ENODEV; + if (!dvbdev) + return -ENODEV; if (!dvbdev->users) - return -EBUSY; + return -EBUSY; if ((file->f_flags & O_ACCMODE) == O_RDONLY) { - if (!dvbdev->readers) - return -EBUSY; + if (!dvbdev->readers) + return -EBUSY; dvbdev->readers--; } else { - if (!dvbdev->writers) - return -EBUSY; + if (!dvbdev->writers) + return -EBUSY; dvbdev->writers--; } @@ -143,10 +143,10 @@ EXPORT_SYMBOL(dvb_generic_open); int dvb_generic_release(struct inode *inode, struct file *file) { - struct dvb_device *dvbdev = file->private_data; + struct dvb_device *dvbdev = file->private_data; if (!dvbdev) - return -ENODEV; + return -ENODEV; if ((file->f_flags & O_ACCMODE) == O_RDONLY) { dvbdev->readers++; @@ -163,10 +163,10 @@ EXPORT_SYMBOL(dvb_generic_release); int dvb_generic_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - struct dvb_device *dvbdev = file->private_data; + struct dvb_device *dvbdev = file->private_data; - if (!dvbdev) - return -ENODEV; + if (!dvbdev) + return -ENODEV; if (!dvbdev->kernel_ioctl) return -EINVAL; @@ -334,63 +334,63 @@ EXPORT_SYMBOL(dvb_unregister_adapter); to the v4l "videodev.o" module, which is unnecessary for some cards (ie. the budget dvb-cards don't need the v4l module...) */ int dvb_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, + unsigned int cmd, unsigned long arg, int (*func)(struct inode *inode, struct file *file, unsigned int cmd, void *arg)) { - char sbuf[128]; - void *mbuf = NULL; - void *parg = NULL; - int err = -EINVAL; - - /* Copy arguments into temp kernel buffer */ - switch (_IOC_DIR(cmd)) { - case _IOC_NONE: + char sbuf[128]; + void *mbuf = NULL; + void *parg = NULL; + int err = -EINVAL; + + /* Copy arguments into temp kernel buffer */ + switch (_IOC_DIR(cmd)) { + case _IOC_NONE: /* * For this command, the pointer is actually an integer * argument. */ parg = (void *) arg; break; - case _IOC_READ: /* some v4l ioctls are marked wrong ... */ - case _IOC_WRITE: - case (_IOC_WRITE | _IOC_READ): - if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { - parg = sbuf; - } else { - /* too big to allocate from stack */ - mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); - if (NULL == mbuf) - return -ENOMEM; - parg = mbuf; - } - - err = -EFAULT; - if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) - goto out; - break; - } - - /* call driver */ - if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) - err = -EINVAL; - - if (err < 0) - goto out; - - /* Copy results into user buffer */ - switch (_IOC_DIR(cmd)) - { - case _IOC_READ: - case (_IOC_WRITE | _IOC_READ): - if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) - err = -EFAULT; - break; - } + case _IOC_READ: /* some v4l ioctls are marked wrong ... */ + case _IOC_WRITE: + case (_IOC_WRITE | _IOC_READ): + if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { + parg = sbuf; + } else { + /* too big to allocate from stack */ + mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); + if (NULL == mbuf) + return -ENOMEM; + parg = mbuf; + } + + err = -EFAULT; + if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) + goto out; + break; + } + + /* call driver */ + if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) + err = -EINVAL; + + if (err < 0) + goto out; + + /* Copy results into user buffer */ + switch (_IOC_DIR(cmd)) + { + case _IOC_READ: + case (_IOC_WRITE | _IOC_READ): + if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) + err = -EFAULT; + break; + } out: - kfree(mbuf); - return err; + kfree(mbuf); + return err; } static int __init init_dvbdev(void) @@ -427,10 +427,10 @@ static int __init init_dvbdev(void) static void __exit exit_dvbdev(void) { - devfs_remove("dvb"); + devfs_remove("dvb"); class_destroy(dvb_class); cdev_del(&dvb_device_cdev); - unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS); + unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS); } module_init(init_dvbdev); diff --git a/trunk/drivers/media/dvb/dvb-core/dvbdev.h b/trunk/drivers/media/dvb/dvb-core/dvbdev.h index 0cc6e4a0e27c..a251867f30f1 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvbdev.h +++ b/trunk/drivers/media/dvb/dvb-core/dvbdev.h @@ -68,8 +68,8 @@ struct dvb_device { int writers; int users; - /* don't really need those !? -- FIXME: use video_usercopy */ - int (*kernel_ioctl)(struct inode *inode, struct file *file, + /* don't really need those !? -- FIXME: use video_usercopy */ + int (*kernel_ioctl)(struct inode *inode, struct file *file, unsigned int cmd, void *arg); void *priv; @@ -97,7 +97,7 @@ we simply define out own dvb_usercopy(), which will hopefully become generic_usercopy() someday... */ extern int dvb_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, + unsigned int cmd, unsigned long arg, int (*func)(struct inode *inode, struct file *file, unsigned int cmd, void *arg)); diff --git a/trunk/drivers/media/dvb/dvb-usb/a800.c b/trunk/drivers/media/dvb/dvb-usb/a800.c index ce44aa6bbb83..49f541d9a042 100644 --- a/trunk/drivers/media/dvb/dvb-usb/a800.c +++ b/trunk/drivers/media/dvb/dvb-usb/a800.c @@ -65,7 +65,7 @@ static struct dvb_usb_rc_key a800_rc_keys[] = { }; -static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) +int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) { u8 key[5]; if (usb_control_msg(d->udev,usb_rcvctrlpipe(d->udev,0), @@ -144,6 +144,7 @@ static struct dvb_usb_properties a800_properties = { }; static struct usb_driver a800_driver = { + .owner = THIS_MODULE, .name = "dvb_usb_a800", .probe = a800_probe, .disconnect = dvb_usb_device_exit, diff --git a/trunk/drivers/media/dvb/dvb-usb/cxusb.c b/trunk/drivers/media/dvb/dvb-usb/cxusb.c index d05fab01cccd..3fe383f4bb4c 100644 --- a/trunk/drivers/media/dvb/dvb-usb/cxusb.c +++ b/trunk/drivers/media/dvb/dvb-usb/cxusb.c @@ -241,6 +241,7 @@ static struct dvb_usb_properties cxusb_properties = { }; static struct usb_driver cxusb_driver = { + .owner = THIS_MODULE, .name = "dvb_usb_cxusb", .probe = cxusb_probe, .disconnect = dvb_usb_device_exit, diff --git a/trunk/drivers/media/dvb/dvb-usb/dibusb-common.c b/trunk/drivers/media/dvb/dvb-usb/dibusb-common.c index 269d899da488..00b946419b40 100644 --- a/trunk/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/trunk/drivers/media/dvb/dvb-usb/dibusb-common.c @@ -21,9 +21,9 @@ MODULE_LICENSE("GPL"); int dibusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) { if (d->priv != NULL) { - struct dibusb_state *st = d->priv; - if (st->ops.fifo_ctrl != NULL) - if (st->ops.fifo_ctrl(d->fe,onoff)) { + struct dib_fe_xfer_ops *ops = d->priv; + if (ops->fifo_ctrl != NULL) + if (ops->fifo_ctrl(d->fe,onoff)) { err("error while controlling the fifo of the demod."); return -ENODEV; } @@ -35,9 +35,9 @@ EXPORT_SYMBOL(dibusb_streaming_ctrl); int dibusb_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int onoff) { if (d->priv != NULL) { - struct dibusb_state *st = d->priv; - if (st->ops.pid_ctrl != NULL) - st->ops.pid_ctrl(d->fe,index,pid,onoff); + struct dib_fe_xfer_ops *ops = d->priv; + if (d->pid_filtering && ops->pid_ctrl != NULL) + ops->pid_ctrl(d->fe,index,pid,onoff); } return 0; } @@ -46,9 +46,9 @@ EXPORT_SYMBOL(dibusb_pid_filter); int dibusb_pid_filter_ctrl(struct dvb_usb_device *d, int onoff) { if (d->priv != NULL) { - struct dibusb_state *st = d->priv; - if (st->ops.pid_parse != NULL) - if (st->ops.pid_parse(d->fe,onoff) < 0) + struct dib_fe_xfer_ops *ops = d->priv; + if (ops->pid_parse != NULL) + if (ops->pid_parse(d->fe,onoff) < 0) err("could not handle pid_parser"); } return 0; diff --git a/trunk/drivers/media/dvb/dvb-usb/dibusb-mb.c b/trunk/drivers/media/dvb/dvb-usb/dibusb-mb.c index 52ac3e5adf5d..aa271a2496d5 100644 --- a/trunk/drivers/media/dvb/dvb-usb/dibusb-mb.c +++ b/trunk/drivers/media/dvb/dvb-usb/dibusb-mb.c @@ -373,6 +373,7 @@ static struct dvb_usb_properties artec_t1_usb2_properties = { }; static struct usb_driver dibusb_driver = { + .owner = THIS_MODULE, .name = "dvb_usb_dibusb_mb", .probe = dibusb_probe, .disconnect = dvb_usb_device_exit, diff --git a/trunk/drivers/media/dvb/dvb-usb/dibusb-mc.c b/trunk/drivers/media/dvb/dvb-usb/dibusb-mc.c index 55802fba3c29..6a0912eab396 100644 --- a/trunk/drivers/media/dvb/dvb-usb/dibusb-mc.c +++ b/trunk/drivers/media/dvb/dvb-usb/dibusb-mc.c @@ -82,6 +82,7 @@ static struct dvb_usb_properties dibusb_mc_properties = { }; static struct usb_driver dibusb_mc_driver = { + .owner = THIS_MODULE, .name = "dvb_usb_dibusb_mc", .probe = dibusb_mc_probe, .disconnect = dvb_usb_device_exit, diff --git a/trunk/drivers/media/dvb/dvb-usb/digitv.c b/trunk/drivers/media/dvb/dvb-usb/digitv.c index 450417a9e64b..74545f82eff1 100644 --- a/trunk/drivers/media/dvb/dvb-usb/digitv.c +++ b/trunk/drivers/media/dvb/dvb-usb/digitv.c @@ -148,7 +148,7 @@ static struct dvb_usb_rc_key digitv_rc_keys[] = { }; /* TODO is it really the NEC protocol ? */ -static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) +int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) { u8 key[5]; @@ -233,6 +233,7 @@ static struct dvb_usb_properties digitv_properties = { }; static struct usb_driver digitv_driver = { + .owner = THIS_MODULE, .name = "dvb_usb_digitv", .probe = digitv_probe, .disconnect = dvb_usb_device_exit, diff --git a/trunk/drivers/media/dvb/dvb-usb/dtt200u.c b/trunk/drivers/media/dvb/dvb-usb/dtt200u.c index 6e2bac873445..b595476332cd 100644 --- a/trunk/drivers/media/dvb/dvb-usb/dtt200u.c +++ b/trunk/drivers/media/dvb/dvb-usb/dtt200u.c @@ -198,6 +198,7 @@ static struct dvb_usb_properties wt220u_properties = { /* usb specific object needed to register this driver with the usb subsystem */ static struct usb_driver dtt200u_usb_driver = { + .owner = THIS_MODULE, .name = "dvb_usb_dtt200u", .probe = dtt200u_usb_probe, .disconnect = dvb_usb_device_exit, diff --git a/trunk/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/trunk/drivers/media/dvb/dvb-usb/dvb-usb-init.c index dd8e0b94edba..a902059812a2 100644 --- a/trunk/drivers/media/dvb/dvb-usb/dvb-usb-init.c +++ b/trunk/drivers/media/dvb/dvb-usb/dvb-usb-init.c @@ -23,7 +23,7 @@ module_param_named(disable_rc_polling, dvb_usb_disable_rc_polling, int, 0644); MODULE_PARM_DESC(disable_rc_polling, "disable remote control polling (default: 0)."); /* general initialization functions */ -static int dvb_usb_exit(struct dvb_usb_device *d) +int dvb_usb_exit(struct dvb_usb_device *d) { deb_info("state before exiting everything: %x\n",d->state); dvb_usb_remote_exit(d); diff --git a/trunk/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/trunk/drivers/media/dvb/dvb-usb/nova-t-usb2.c index fac48fc7a4ac..1841a66427bf 100644 --- a/trunk/drivers/media/dvb/dvb-usb/nova-t-usb2.c +++ b/trunk/drivers/media/dvb/dvb-usb/nova-t-usb2.c @@ -202,6 +202,7 @@ static struct dvb_usb_properties nova_t_properties = { }; static struct usb_driver nova_t_driver = { + .owner = THIS_MODULE, .name = "dvb_usb_nova_t_usb2", .probe = nova_t_probe, .disconnect = dvb_usb_device_exit, diff --git a/trunk/drivers/media/dvb/dvb-usb/umt-010.c b/trunk/drivers/media/dvb/dvb-usb/umt-010.c index 14f1911c79bb..6fd67657c269 100644 --- a/trunk/drivers/media/dvb/dvb-usb/umt-010.c +++ b/trunk/drivers/media/dvb/dvb-usb/umt-010.c @@ -128,6 +128,7 @@ static struct dvb_usb_properties umt_properties = { }; static struct usb_driver umt_driver = { + .owner = THIS_MODULE, .name = "dvb_usb_umt_010", .probe = umt_probe, .disconnect = dvb_usb_device_exit, diff --git a/trunk/drivers/media/dvb/dvb-usb/vp702x-fe.c b/trunk/drivers/media/dvb/dvb-usb/vp702x-fe.c index 104b5d016c7b..f20d8dbd0be8 100644 --- a/trunk/drivers/media/dvb/dvb-usb/vp702x-fe.c +++ b/trunk/drivers/media/dvb/dvb-usb/vp702x-fe.c @@ -190,7 +190,7 @@ static int vp702x_fe_get_frontend(struct dvb_frontend* fe, } static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe, - struct dvb_diseqc_master_cmd *m) + struct dvb_diseqc_master_cmd *m) { struct vp702x_fe_state *st = fe->demodulator_priv; u8 cmd[8],ibuf[10]; diff --git a/trunk/drivers/media/dvb/dvb-usb/vp702x.c b/trunk/drivers/media/dvb/dvb-usb/vp702x.c index afa00fdb5ec0..de13c04e8e64 100644 --- a/trunk/drivers/media/dvb/dvb-usb/vp702x.c +++ b/trunk/drivers/media/dvb/dvb-usb/vp702x.c @@ -256,6 +256,7 @@ static struct dvb_usb_properties vp702x_properties = { /* usb specific object needed to register this driver with the usb subsystem */ static struct usb_driver vp702x_usb_driver = { + .owner = THIS_MODULE, .name = "dvb-usb-vp702x", .probe = vp702x_usb_probe, .disconnect = dvb_usb_device_exit, diff --git a/trunk/drivers/media/dvb/dvb-usb/vp7045-fe.c b/trunk/drivers/media/dvb/dvb-usb/vp7045-fe.c index 83f1de1e7e57..2746edfeccba 100644 --- a/trunk/drivers/media/dvb/dvb-usb/vp7045-fe.c +++ b/trunk/drivers/media/dvb/dvb-usb/vp7045-fe.c @@ -58,7 +58,7 @@ static int vp7045_fe_read_ber(struct dvb_frontend* fe, u32 *ber) struct vp7045_fe_state *state = fe->demodulator_priv; *ber = (vp7045_read_reg(state->d, 0x0D) << 16) | (vp7045_read_reg(state->d, 0x0E) << 8) | - vp7045_read_reg(state->d, 0x0F); + vp7045_read_reg(state->d, 0x0F); return 0; } diff --git a/trunk/drivers/media/dvb/dvb-usb/vp7045.c b/trunk/drivers/media/dvb/dvb-usb/vp7045.c index 3835235b68df..75765e3a569c 100644 --- a/trunk/drivers/media/dvb/dvb-usb/vp7045.c +++ b/trunk/drivers/media/dvb/dvb-usb/vp7045.c @@ -253,6 +253,7 @@ static struct dvb_usb_properties vp7045_properties = { /* usb specific object needed to register this driver with the usb subsystem */ static struct usb_driver vp7045_usb_driver = { + .owner = THIS_MODULE, .name = "dvb_usb_vp7045", .probe = vp7045_usb_probe, .disconnect = dvb_usb_device_exit, diff --git a/trunk/drivers/media/dvb/frontends/at76c651.c b/trunk/drivers/media/dvb/frontends/at76c651.c index 8e0f4b3a1417..72a2b5455b0b 100644 --- a/trunk/drivers/media/dvb/frontends/at76c651.c +++ b/trunk/drivers/media/dvb/frontends/at76c651.c @@ -361,9 +361,9 @@ static int at76c651_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) static int at76c651_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *fesettings) { - fesettings->min_delay_ms = 50; - fesettings->step_size = 0; - fesettings->max_drift = 0; + fesettings->min_delay_ms = 50; + fesettings->step_size = 0; + fesettings->max_drift = 0; return 0; } diff --git a/trunk/drivers/media/dvb/frontends/bcm3510.c b/trunk/drivers/media/dvb/frontends/bcm3510.c index 8ceb9a33c7af..f6d4ee78bdd4 100644 --- a/trunk/drivers/media/dvb/frontends/bcm3510.c +++ b/trunk/drivers/media/dvb/frontends/bcm3510.c @@ -69,7 +69,7 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=i2c (|-able))."); #define dbufout(b,l,m) {\ int i; \ for (i = 0; i < l; i++) \ - m("%02x ",b[i]); \ + m("%02x ",b[i]); \ } #define deb_info(args...) dprintk(0x01,args) #define deb_i2c(args...) dprintk(0x02,args) @@ -827,7 +827,7 @@ static struct dvb_frontend_ops bcm3510_ops = { .type = FE_ATSC, .frequency_min = 54000000, .frequency_max = 803000000, - /* stepsize is just a guess */ + /* stepsize is just a guess */ .frequency_stepsize = 0, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | diff --git a/trunk/drivers/media/dvb/frontends/cx22700.c b/trunk/drivers/media/dvb/frontends/cx22700.c index 755f774f6b7d..0c2ed4438618 100644 --- a/trunk/drivers/media/dvb/frontends/cx22700.c +++ b/trunk/drivers/media/dvb/frontends/cx22700.c @@ -355,10 +355,10 @@ static int cx22700_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par static int cx22700_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) { - fesettings->min_delay_ms = 150; - fesettings->step_size = 166667; - fesettings->max_drift = 166667*2; - return 0; + fesettings->min_delay_ms = 150; + fesettings->step_size = 166667; + fesettings->max_drift = 166667*2; + return 0; } static void cx22700_release(struct dvb_frontend* fe) @@ -407,7 +407,7 @@ static struct dvb_frontend_ops cx22700_ops = { .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | - FE_CAN_RECOVER + FE_CAN_RECOVER }, .release = cx22700_release, diff --git a/trunk/drivers/media/dvb/frontends/cx22702.c b/trunk/drivers/media/dvb/frontends/cx22702.c index 5de0e6d350b1..9f639297a9f2 100644 --- a/trunk/drivers/media/dvb/frontends/cx22702.c +++ b/trunk/drivers/media/dvb/frontends/cx22702.c @@ -2,12 +2,12 @@ Conexant 22702 DVB OFDM demodulator driver based on: - Alps TDMB7 DVB OFDM demodulator driver + Alps TDMB7 DVB OFDM demodulator driver Copyright (C) 2001-2002 Convergence Integrated Media GmbH Holger Waechtler - Copyright (C) 2004 Steven Toth + Copyright (C) 2004 Steven Toth 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 diff --git a/trunk/drivers/media/dvb/frontends/cx22702.h b/trunk/drivers/media/dvb/frontends/cx22702.h index 5633976a58f1..11f86806756e 100644 --- a/trunk/drivers/media/dvb/frontends/cx22702.h +++ b/trunk/drivers/media/dvb/frontends/cx22702.h @@ -2,12 +2,12 @@ Conexant 22702 DVB OFDM demodulator driver based on: - Alps TDMB7 DVB OFDM demodulator driver + Alps TDMB7 DVB OFDM demodulator driver Copyright (C) 2001-2002 Convergence Integrated Media GmbH Holger Waechtler - Copyright (C) 2004 Steven Toth + Copyright (C) 2004 Steven Toth 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 diff --git a/trunk/drivers/media/dvb/frontends/cx24110.c b/trunk/drivers/media/dvb/frontends/cx24110.c index 0c4db80ec332..654d7dc879d9 100644 --- a/trunk/drivers/media/dvb/frontends/cx24110.c +++ b/trunk/drivers/media/dvb/frontends/cx24110.c @@ -55,81 +55,81 @@ static int debug; } while (0) static struct {u8 reg; u8 data;} cx24110_regdata[]= - /* Comments beginning with @ denote this value should - be the default */ - {{0x09,0x01}, /* SoftResetAll */ - {0x09,0x00}, /* release reset */ - {0x01,0xe8}, /* MSB of code rate 27.5MS/s */ - {0x02,0x17}, /* middle byte " */ - {0x03,0x29}, /* LSB " */ - {0x05,0x03}, /* @ DVB mode, standard code rate 3/4 */ - {0x06,0xa5}, /* @ PLL 60MHz */ - {0x07,0x01}, /* @ Fclk, i.e. sampling clock, 60MHz */ - {0x0a,0x00}, /* @ partial chip disables, do not set */ - {0x0b,0x01}, /* set output clock in gapped mode, start signal low - active for first byte */ - {0x0c,0x11}, /* no parity bytes, large hold time, serial data out */ - {0x0d,0x6f}, /* @ RS Sync/Unsync thresholds */ - {0x10,0x40}, /* chip doc is misleading here: write bit 6 as 1 - to avoid starting the BER counter. Reset the - CRC test bit. Finite counting selected */ - {0x15,0xff}, /* @ size of the limited time window for RS BER - estimation. It is *256 RS blocks, this - gives approx. 2.6 sec at 27.5MS/s, rate 3/4 */ - {0x16,0x00}, /* @ enable all RS output ports */ - {0x17,0x04}, /* @ time window allowed for the RS to sync */ - {0x18,0xae}, /* @ allow all standard DVB code rates to be scanned - for automatically */ - /* leave the current code rate and normalization - registers as they are after reset... */ - {0x21,0x10}, /* @ during AutoAcq, search each viterbi setting - only once */ - {0x23,0x18}, /* @ size of the limited time window for Viterbi BER - estimation. It is *65536 channel bits, i.e. - approx. 38ms at 27.5MS/s, rate 3/4 */ - {0x24,0x24}, /* do not trigger Viterbi CRC test. Finite count window */ - /* leave front-end AGC parameters at default values */ - /* leave decimation AGC parameters at default values */ - {0x35,0x40}, /* disable all interrupts. They are not connected anyway */ - {0x36,0xff}, /* clear all interrupt pending flags */ - {0x37,0x00}, /* @ fully enable AutoAcqq state machine */ - {0x38,0x07}, /* @ enable fade recovery, but not autostart AutoAcq */ - /* leave the equalizer parameters on their default values */ - /* leave the final AGC parameters on their default values */ - {0x41,0x00}, /* @ MSB of front-end derotator frequency */ - {0x42,0x00}, /* @ middle bytes " */ - {0x43,0x00}, /* @ LSB " */ - /* leave the carrier tracking loop parameters on default */ - /* leave the bit timing loop parameters at gefault */ - {0x56,0x4d}, /* set the filtune voltage to 2.7V, as recommended by */ - /* the cx24108 data sheet for symbol rates above 15MS/s */ - {0x57,0x00}, /* @ Filter sigma delta enabled, positive */ - {0x61,0x95}, /* GPIO pins 1-4 have special function */ - {0x62,0x05}, /* GPIO pin 5 has special function, pin 6 is GPIO */ - {0x63,0x00}, /* All GPIO pins use CMOS output characteristics */ - {0x64,0x20}, /* GPIO 6 is input, all others are outputs */ - {0x6d,0x30}, /* tuner auto mode clock freq 62kHz */ - {0x70,0x15}, /* use auto mode, tuner word is 21 bits long */ - {0x73,0x00}, /* @ disable several demod bypasses */ - {0x74,0x00}, /* @ " */ - {0x75,0x00} /* @ " */ - /* the remaining registers are for SEC */ + /* Comments beginning with @ denote this value should + be the default */ + {{0x09,0x01}, /* SoftResetAll */ + {0x09,0x00}, /* release reset */ + {0x01,0xe8}, /* MSB of code rate 27.5MS/s */ + {0x02,0x17}, /* middle byte " */ + {0x03,0x29}, /* LSB " */ + {0x05,0x03}, /* @ DVB mode, standard code rate 3/4 */ + {0x06,0xa5}, /* @ PLL 60MHz */ + {0x07,0x01}, /* @ Fclk, i.e. sampling clock, 60MHz */ + {0x0a,0x00}, /* @ partial chip disables, do not set */ + {0x0b,0x01}, /* set output clock in gapped mode, start signal low + active for first byte */ + {0x0c,0x11}, /* no parity bytes, large hold time, serial data out */ + {0x0d,0x6f}, /* @ RS Sync/Unsync thresholds */ + {0x10,0x40}, /* chip doc is misleading here: write bit 6 as 1 + to avoid starting the BER counter. Reset the + CRC test bit. Finite counting selected */ + {0x15,0xff}, /* @ size of the limited time window for RS BER + estimation. It is *256 RS blocks, this + gives approx. 2.6 sec at 27.5MS/s, rate 3/4 */ + {0x16,0x00}, /* @ enable all RS output ports */ + {0x17,0x04}, /* @ time window allowed for the RS to sync */ + {0x18,0xae}, /* @ allow all standard DVB code rates to be scanned + for automatically */ + /* leave the current code rate and normalization + registers as they are after reset... */ + {0x21,0x10}, /* @ during AutoAcq, search each viterbi setting + only once */ + {0x23,0x18}, /* @ size of the limited time window for Viterbi BER + estimation. It is *65536 channel bits, i.e. + approx. 38ms at 27.5MS/s, rate 3/4 */ + {0x24,0x24}, /* do not trigger Viterbi CRC test. Finite count window */ + /* leave front-end AGC parameters at default values */ + /* leave decimation AGC parameters at default values */ + {0x35,0x40}, /* disable all interrupts. They are not connected anyway */ + {0x36,0xff}, /* clear all interrupt pending flags */ + {0x37,0x00}, /* @ fully enable AutoAcqq state machine */ + {0x38,0x07}, /* @ enable fade recovery, but not autostart AutoAcq */ + /* leave the equalizer parameters on their default values */ + /* leave the final AGC parameters on their default values */ + {0x41,0x00}, /* @ MSB of front-end derotator frequency */ + {0x42,0x00}, /* @ middle bytes " */ + {0x43,0x00}, /* @ LSB " */ + /* leave the carrier tracking loop parameters on default */ + /* leave the bit timing loop parameters at gefault */ + {0x56,0x4d}, /* set the filtune voltage to 2.7V, as recommended by */ + /* the cx24108 data sheet for symbol rates above 15MS/s */ + {0x57,0x00}, /* @ Filter sigma delta enabled, positive */ + {0x61,0x95}, /* GPIO pins 1-4 have special function */ + {0x62,0x05}, /* GPIO pin 5 has special function, pin 6 is GPIO */ + {0x63,0x00}, /* All GPIO pins use CMOS output characteristics */ + {0x64,0x20}, /* GPIO 6 is input, all others are outputs */ + {0x6d,0x30}, /* tuner auto mode clock freq 62kHz */ + {0x70,0x15}, /* use auto mode, tuner word is 21 bits long */ + {0x73,0x00}, /* @ disable several demod bypasses */ + {0x74,0x00}, /* @ " */ + {0x75,0x00} /* @ " */ + /* the remaining registers are for SEC */ }; static int cx24110_writereg (struct cx24110_state* state, int reg, int data) { - u8 buf [] = { reg, data }; + u8 buf [] = { reg, data }; struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; int err; - if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { + if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { dprintk ("%s: writereg error (err == %i, reg == 0x%02x," " data == 0x%02x)\n", __FUNCTION__, err, reg, data); return -EREMOTEIO; } - return 0; + return 0; } static int cx24110_readreg (struct cx24110_state* state, u8 reg) @@ -153,27 +153,27 @@ static int cx24110_set_inversion (struct cx24110_state* state, fe_spectral_inver switch (inversion) { case INVERSION_OFF: - cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1); - /* AcqSpectrInvDis on. No idea why someone should want this */ - cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)&0xf7); - /* Initial value 0 at start of acq */ - cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)&0xef); - /* current value 0 */ - /* The cx24110 manual tells us this reg is read-only. - But what the heck... set it ayways */ - break; + cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1); + /* AcqSpectrInvDis on. No idea why someone should want this */ + cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)&0xf7); + /* Initial value 0 at start of acq */ + cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)&0xef); + /* current value 0 */ + /* The cx24110 manual tells us this reg is read-only. + But what the heck... set it ayways */ + break; case INVERSION_ON: - cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1); - /* AcqSpectrInvDis on. No idea why someone should want this */ - cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)|0x08); - /* Initial value 1 at start of acq */ - cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)|0x10); - /* current value 1 */ - break; + cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1); + /* AcqSpectrInvDis on. No idea why someone should want this */ + cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)|0x08); + /* Initial value 1 at start of acq */ + cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)|0x10); + /* current value 1 */ + break; case INVERSION_AUTO: - cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xfe); - /* AcqSpectrInvDis off. Leave initial & current states as is */ - break; + cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xfe); + /* AcqSpectrInvDis off. Leave initial & current states as is */ + break; default: return -EINVAL; } @@ -185,18 +185,18 @@ static int cx24110_set_fec (struct cx24110_state* state, fe_code_rate_t fec) { /* fixme (low): error handling */ - static const int rate[]={-1,1,2,3,5,7,-1}; - static const int g1[]={-1,0x01,0x02,0x05,0x15,0x45,-1}; - static const int g2[]={-1,0x01,0x03,0x06,0x1a,0x7a,-1}; + static const int rate[]={-1,1,2,3,5,7,-1}; + static const int g1[]={-1,0x01,0x02,0x05,0x15,0x45,-1}; + static const int g2[]={-1,0x01,0x03,0x06,0x1a,0x7a,-1}; - /* Well, the AutoAcq engine of the cx24106 and 24110 automatically - searches all enabled viterbi rates, and can handle non-standard - rates as well. */ + /* Well, the AutoAcq engine of the cx24106 and 24110 automatically + searches all enabled viterbi rates, and can handle non-standard + rates as well. */ - if (fec>FEC_AUTO) - fec=FEC_AUTO; + if (fec>FEC_AUTO) + fec=FEC_AUTO; - if (fec==FEC_AUTO) { /* (re-)establish AutoAcq behaviour */ + if (fec==FEC_AUTO) { /* (re-)establish AutoAcq behaviour */ cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xdf); /* clear AcqVitDis bit */ cx24110_writereg(state,0x18,0xae); @@ -208,7 +208,7 @@ static int cx24110_set_fec (struct cx24110_state* state, fe_code_rate_t fec) cx24110_writereg(state,0x1a,0x05); cx24110_writereg(state,0x1b,0x06); /* set the puncture registers for code rate 3/4 */ return 0; - } else { + } else { cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x20); /* set AcqVitDis bit */ if(rate[fec]>0) { @@ -219,10 +219,10 @@ static int cx24110_set_fec (struct cx24110_state* state, fe_code_rate_t fec) cx24110_writereg(state,0x1a,g1[fec]); cx24110_writereg(state,0x1b,g2[fec]); /* not sure if this is the right way: I always used AutoAcq mode */ - } else + } else return -EOPNOTSUPP; /* fixme (low): which is the correct return code? */ - }; + }; return 0; } @@ -245,72 +245,72 @@ static fe_code_rate_t cx24110_get_fec (struct cx24110_state* state) static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate) { /* fixme (low): add error handling */ - u32 ratio; - u32 tmp, fclk, BDRI; + u32 ratio; + u32 tmp, fclk, BDRI; - static const u32 bands[]={5000000UL,15000000UL,90999000UL/2}; - int i; + static const u32 bands[]={5000000UL,15000000UL,90999000UL/2}; + int i; dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate); - if (srate>90999000UL/2) - srate=90999000UL/2; - if (srate<500000) - srate=500000; + if (srate>90999000UL/2) + srate=90999000UL/2; + if (srate<500000) + srate=500000; - for(i=0;(ibands[i]);i++) + for(i=0;(ibands[i]);i++) ; - /* first, check which sample rate is appropriate: 45, 60 80 or 90 MHz, - and set the PLL accordingly (R07[1:0] Fclk, R06[7:4] PLLmult, - R06[3:0] PLLphaseDetGain */ - tmp=cx24110_readreg(state,0x07)&0xfc; - if(srate<90999000UL/4) { /* sample rate 45MHz*/ + /* first, check which sample rate is appropriate: 45, 60 80 or 90 MHz, + and set the PLL accordingly (R07[1:0] Fclk, R06[7:4] PLLmult, + R06[3:0] PLLphaseDetGain */ + tmp=cx24110_readreg(state,0x07)&0xfc; + if(srate<90999000UL/4) { /* sample rate 45MHz*/ cx24110_writereg(state,0x07,tmp); cx24110_writereg(state,0x06,0x78); fclk=90999000UL/2; - } else if(srate<60666000UL/2) { /* sample rate 60MHz */ + } else if(srate<60666000UL/2) { /* sample rate 60MHz */ cx24110_writereg(state,0x07,tmp|0x1); cx24110_writereg(state,0x06,0xa5); fclk=60666000UL; - } else if(srate<80888000UL/2) { /* sample rate 80MHz */ + } else if(srate<80888000UL/2) { /* sample rate 80MHz */ cx24110_writereg(state,0x07,tmp|0x2); cx24110_writereg(state,0x06,0x87); fclk=80888000UL; - } else { /* sample rate 90MHz */ + } else { /* sample rate 90MHz */ cx24110_writereg(state,0x07,tmp|0x3); cx24110_writereg(state,0x06,0x78); fclk=90999000UL; - }; - dprintk("cx24110 debug: fclk %d Hz\n",fclk); - /* we need to divide two integers with approx. 27 bits in 32 bit - arithmetic giving a 25 bit result */ - /* the maximum dividend is 90999000/2, 0x02b6446c, this number is - also the most complex divisor. Hence, the dividend has, - assuming 32bit unsigned arithmetic, 6 clear bits on top, the - divisor 2 unused bits at the bottom. Also, the quotient is - always less than 1/2. Borrowed from VES1893.c, of course */ + }; + dprintk("cx24110 debug: fclk %d Hz\n",fclk); + /* we need to divide two integers with approx. 27 bits in 32 bit + arithmetic giving a 25 bit result */ + /* the maximum dividend is 90999000/2, 0x02b6446c, this number is + also the most complex divisor. Hence, the dividend has, + assuming 32bit unsigned arithmetic, 6 clear bits on top, the + divisor 2 unused bits at the bottom. Also, the quotient is + always less than 1/2. Borrowed from VES1893.c, of course */ - tmp=srate<<6; - BDRI=fclk>>2; - ratio=(tmp/BDRI); + tmp=srate<<6; + BDRI=fclk>>2; + ratio=(tmp/BDRI); - tmp=(tmp%BDRI)<<8; - ratio=(ratio<<8)+(tmp/BDRI); + tmp=(tmp%BDRI)<<8; + ratio=(ratio<<8)+(tmp/BDRI); - tmp=(tmp%BDRI)<<8; - ratio=(ratio<<8)+(tmp/BDRI); + tmp=(tmp%BDRI)<<8; + ratio=(ratio<<8)+(tmp/BDRI); - tmp=(tmp%BDRI)<<1; - ratio=(ratio<<1)+(tmp/BDRI); + tmp=(tmp%BDRI)<<1; + ratio=(ratio<<1)+(tmp/BDRI); - dprintk("srate= %d (range %d, up to %d)\n", srate,i,bands[i]); - dprintk("fclk = %d\n", fclk); - dprintk("ratio= %08x\n", ratio); + dprintk("srate= %d (range %d, up to %d)\n", srate,i,bands[i]); + dprintk("fclk = %d\n", fclk); + dprintk("ratio= %08x\n", ratio); - cx24110_writereg(state, 0x1, (ratio>>16)&0xff); - cx24110_writereg(state, 0x2, (ratio>>8)&0xff); - cx24110_writereg(state, 0x3, (ratio)&0xff); + cx24110_writereg(state, 0x1, (ratio>>16)&0xff); + cx24110_writereg(state, 0x2, (ratio>>8)&0xff); + cx24110_writereg(state, 0x3, (ratio)&0xff); - return 0; + return 0; } @@ -324,48 +324,48 @@ int cx24110_pll_write (struct dvb_frontend* fe, u32 data) dprintk("cx24110 debug: cx24108_write(%8.8x)\n",data); - cx24110_writereg(state,0x6d,0x30); /* auto mode at 62kHz */ - cx24110_writereg(state,0x70,0x15); /* auto mode 21 bits */ + cx24110_writereg(state,0x6d,0x30); /* auto mode at 62kHz */ + cx24110_writereg(state,0x70,0x15); /* auto mode 21 bits */ - /* if the auto tuner writer is still busy, clear it out */ - while (cx24110_readreg(state,0x6d)&0x80) + /* if the auto tuner writer is still busy, clear it out */ + while (cx24110_readreg(state,0x6d)&0x80) cx24110_writereg(state,0x72,0); - /* write the topmost 8 bits */ - cx24110_writereg(state,0x72,(data>>24)&0xff); + /* write the topmost 8 bits */ + cx24110_writereg(state,0x72,(data>>24)&0xff); - /* wait for the send to be completed */ - while ((cx24110_readreg(state,0x6d)&0xc0)==0x80) + /* wait for the send to be completed */ + while ((cx24110_readreg(state,0x6d)&0xc0)==0x80) ; - /* send another 8 bytes */ - cx24110_writereg(state,0x72,(data>>16)&0xff); - while ((cx24110_readreg(state,0x6d)&0xc0)==0x80) + /* send another 8 bytes */ + cx24110_writereg(state,0x72,(data>>16)&0xff); + while ((cx24110_readreg(state,0x6d)&0xc0)==0x80) ; - /* and the topmost 5 bits of this byte */ - cx24110_writereg(state,0x72,(data>>8)&0xff); - while ((cx24110_readreg(state,0x6d)&0xc0)==0x80) + /* and the topmost 5 bits of this byte */ + cx24110_writereg(state,0x72,(data>>8)&0xff); + while ((cx24110_readreg(state,0x6d)&0xc0)==0x80) ; - /* now strobe the enable line once */ - cx24110_writereg(state,0x6d,0x32); - cx24110_writereg(state,0x6d,0x30); + /* now strobe the enable line once */ + cx24110_writereg(state,0x6d,0x32); + cx24110_writereg(state,0x6d,0x30); - return 0; + return 0; } static int cx24110_initfe(struct dvb_frontend* fe) { struct cx24110_state *state = fe->demodulator_priv; /* fixme (low): error handling */ - int i; + int i; dprintk("%s: init chip\n", __FUNCTION__); - for(i=0;iconfig->pll_init) state->config->pll_init(fe); diff --git a/trunk/drivers/media/dvb/frontends/l64781.c b/trunk/drivers/media/dvb/frontends/l64781.c index 1c7c91224472..19b4bf7c21a7 100644 --- a/trunk/drivers/media/dvb/frontends/l64781.c +++ b/trunk/drivers/media/dvb/frontends/l64781.c @@ -2,7 +2,7 @@ driver for LSI L64781 COFDM demodulator Copyright (C) 2001 Holger Waechtler for Convergence Integrated Media GmbH - Marko Kohtala + Marko Kohtala 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 @@ -433,7 +433,7 @@ static int l64781_init(struct dvb_frontend* fe) { struct l64781_state* state = fe->demodulator_priv; - reset_and_configure (state); + reset_and_configure (state); /* Power up */ l64781_writereg (state, 0x3e, 0xa5); @@ -456,9 +456,9 @@ static int l64781_init(struct dvb_frontend* fe) l64781_writereg (state, 0x0d, 0x8c); /* With ppm=8000, it seems the DTR_SENSITIVITY will result in - value of 2 with all possible bandwidths and guard - intervals, which is the initial value anyway. */ - /*l64781_writereg (state, 0x19, 0x92);*/ + value of 2 with all possible bandwidths and guard + intervals, which is the initial value anyway. */ + /*l64781_writereg (state, 0x19, 0x92);*/ /* Everything is two's complement, soft bit and CSI_OUT too */ l64781_writereg (state, 0x1e, 0x09); @@ -477,10 +477,10 @@ static int l64781_init(struct dvb_frontend* fe) static int l64781_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) { - fesettings->min_delay_ms = 4000; - fesettings->step_size = 0; - fesettings->max_drift = 0; - return 0; + fesettings->min_delay_ms = 4000; + fesettings->step_size = 0; + fesettings->max_drift = 0; + return 0; } static void l64781_release(struct dvb_frontend* fe) @@ -522,7 +522,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, /* The chip always responds to reads */ if (i2c_transfer(state->i2c, msg, 2) != 2) { - dprintk("No response to read on I2C bus\n"); + dprintk("No response to read on I2C bus\n"); goto error; } @@ -531,7 +531,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, /* Reading the POWER_DOWN register always returns 0 */ if (reg0x3e != 0) { - dprintk("Device doesn't look like L64781\n"); + dprintk("Device doesn't look like L64781\n"); goto error; } @@ -540,7 +540,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, /* Responds to all reads with 0 */ if (l64781_readreg(state, 0x1a) != 0) { - dprintk("Read 1 returned unexpcted value\n"); + dprintk("Read 1 returned unexpcted value\n"); goto error; } @@ -549,7 +549,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, /* Responds with register default value */ if (l64781_readreg(state, 0x1a) != 0xa1) { - dprintk("Read 2 returned unexpcted value\n"); + dprintk("Read 2 returned unexpcted value\n"); goto error; } diff --git a/trunk/drivers/media/dvb/frontends/l64781.h b/trunk/drivers/media/dvb/frontends/l64781.h index 947f65f87465..7e30fb0fdfa7 100644 --- a/trunk/drivers/media/dvb/frontends/l64781.h +++ b/trunk/drivers/media/dvb/frontends/l64781.h @@ -2,7 +2,7 @@ driver for LSI L64781 COFDM demodulator Copyright (C) 2001 Holger Waechtler for Convergence Integrated Media GmbH - Marko Kohtala + Marko Kohtala 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 diff --git a/trunk/drivers/media/dvb/frontends/lgdt330x.c b/trunk/drivers/media/dvb/frontends/lgdt330x.c index cb5301865d07..6a33f5a19a8d 100644 --- a/trunk/drivers/media/dvb/frontends/lgdt330x.c +++ b/trunk/drivers/media/dvb/frontends/lgdt330x.c @@ -301,10 +301,10 @@ static int lgdt330x_set_parameters(struct dvb_frontend* fe, static u8 lgdt3303_8vsb_44_data[] = { 0x04, 0x00, 0x0d, 0x40, - 0x0e, 0x87, - 0x0f, 0x8e, - 0x10, 0x01, - 0x47, 0x8b }; + 0x0e, 0x87, + 0x0f, 0x8e, + 0x10, 0x01, + 0x47, 0x8b }; /* * Array of byte pairs diff --git a/trunk/drivers/media/dvb/frontends/mt312.c b/trunk/drivers/media/dvb/frontends/mt312.c index 8d672283c93d..9c67f406d581 100644 --- a/trunk/drivers/media/dvb/frontends/mt312.c +++ b/trunk/drivers/media/dvb/frontends/mt312.c @@ -554,7 +554,7 @@ static int mt312_set_frontend(struct dvb_frontend* fe, if ((ret = mt312_write(state, SYM_RATE_H, buf, sizeof(buf))) < 0) return ret; - mt312_reset(state, 0); + mt312_reset(state, 0); return 0; } @@ -695,7 +695,7 @@ static struct dvb_frontend_ops vp310_mt312_ops = { FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_MUTE_TS | - FE_CAN_RECOVER + FE_CAN_RECOVER }, .release = mt312_release, diff --git a/trunk/drivers/media/dvb/frontends/nxt2002.c b/trunk/drivers/media/dvb/frontends/nxt2002.c index 52c416043a62..30786b1911bd 100644 --- a/trunk/drivers/media/dvb/frontends/nxt2002.c +++ b/trunk/drivers/media/dvb/frontends/nxt2002.c @@ -527,7 +527,7 @@ static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr) else snrdb = 1000*0 + ( 1000*(12-0) * ( temp2 - 0 ) / ( 0x7C00 - 0 ) ); - /* the value reported back from the frontend will be FFFF=32db 0000=0db */ + /* the value reported back from the frontend will be FFFF=32db 0000=0db */ *snr = snrdb * (0xFFFF/32000); @@ -646,7 +646,7 @@ struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config, memcpy(&state->ops, &nxt2002_ops, sizeof(struct dvb_frontend_ops)); state->initialised = 0; - /* Check the first 5 registers to ensure this a revision we can handle */ + /* Check the first 5 registers to ensure this a revision we can handle */ i2c_readbytes(state, 0x00, buf, 5); if (buf[0] != 0x04) goto error; /* device id */ @@ -672,7 +672,7 @@ static struct dvb_frontend_ops nxt2002_ops = { .type = FE_ATSC, .frequency_min = 54000000, .frequency_max = 860000000, - /* stepsize is just a guess */ + /* stepsize is just a guess */ .frequency_stepsize = 166666, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | diff --git a/trunk/drivers/media/dvb/frontends/nxt200x.c b/trunk/drivers/media/dvb/frontends/nxt200x.c index aeafef46e3eb..bad0933eb714 100644 --- a/trunk/drivers/media/dvb/frontends/nxt200x.c +++ b/trunk/drivers/media/dvb/frontends/nxt200x.c @@ -44,8 +44,6 @@ #include #include #include -#include -#include #include "dvb_frontend.h" #include "dvb-pll.h" @@ -339,7 +337,7 @@ static int nxt200x_writetuner (struct nxt200x_state* state, u8* data) switch (state->demod_chip) { case NXT2004: if (i2c_writebytes(state, state->config->pll_address, data, 4)) - printk(KERN_WARNING "nxt200x: error writing to tuner\n"); + printk(KERN_WARNING "nxt200x: error writing to tuner\n"); /* wait until we have a lock */ while (count < 20) { i2c_readbytes(state, state->config->pll_address, &buf, 1); @@ -497,7 +495,7 @@ static int nxt2004_load_firmware (struct dvb_frontend* fe, const struct firmware /* calculate firmware CRC */ for (position = 0; position < fw->size; position++) { - crc = nxt200x_crc(crc, fw->data[position]); + crc = nxt200x_crc(crc, fw->data[position]); } buf[0] = rambase >> 8; diff --git a/trunk/drivers/media/dvb/frontends/nxt6000.c b/trunk/drivers/media/dvb/frontends/nxt6000.c index a458a3bfff70..88a57b791112 100644 --- a/trunk/drivers/media/dvb/frontends/nxt6000.c +++ b/trunk/drivers/media/dvb/frontends/nxt6000.c @@ -574,11 +574,11 @@ static struct dvb_frontend_ops nxt6000_ops = { .symbol_rate_max = 9360000, /* FIXME */ .symbol_rate_tolerance = 4000, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | - FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | - FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO | - FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | - FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | - FE_CAN_HIERARCHY_AUTO, + FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | + FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO | + FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | + FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | + FE_CAN_HIERARCHY_AUTO, }, .release = nxt6000_release, diff --git a/trunk/drivers/media/dvb/frontends/or51132.c b/trunk/drivers/media/dvb/frontends/or51132.c index 80e0f28127b7..78bded861d02 100644 --- a/trunk/drivers/media/dvb/frontends/or51132.c +++ b/trunk/drivers/media/dvb/frontends/or51132.c @@ -503,7 +503,7 @@ static int or51132_read_signal_strength(struct dvb_frontend* fe, u16* strength) rcvr_stat = rec_buf[1]; usK = (rcvr_stat & 0x10) ? 3 : 0; - /* The value reported back from the frontend will be FFFF=100% 0000=0% */ + /* The value reported back from the frontend will be FFFF=100% 0000=0% */ signal_strength = (((8952 - i20Log10(snr_equ) - usK*100)/3+5)*65535)/1000; if (signal_strength > 0xffff) *strength = 0xffff; diff --git a/trunk/drivers/media/dvb/frontends/s5h1420.c b/trunk/drivers/media/dvb/frontends/s5h1420.c index 18715091aed8..f265418e3261 100644 --- a/trunk/drivers/media/dvb/frontends/s5h1420.c +++ b/trunk/drivers/media/dvb/frontends/s5h1420.c @@ -494,7 +494,7 @@ static int s5h1420_getfreqoffset(struct s5h1420_state* state) } static void s5h1420_setfec_inversion(struct s5h1420_state* state, - struct dvb_frontend_parameters *p) + struct dvb_frontend_parameters *p) { u8 inversion = 0; @@ -521,8 +521,8 @@ static void s5h1420_setfec_inversion(struct s5h1420_state* state, case FEC_3_4: s5h1420_writereg(state, 0x30, 0x04); - s5h1420_writereg(state, 0x31, 0x12 | inversion); - break; + s5h1420_writereg(state, 0x31, 0x12 | inversion); + break; case FEC_5_6: s5h1420_writereg(state, 0x30, 0x08); diff --git a/trunk/drivers/media/dvb/frontends/s5h1420.h b/trunk/drivers/media/dvb/frontends/s5h1420.h index 73296f13c324..872028ddf2a2 100644 --- a/trunk/drivers/media/dvb/frontends/s5h1420.h +++ b/trunk/drivers/media/dvb/frontends/s5h1420.h @@ -39,6 +39,6 @@ struct s5h1420_config }; extern struct dvb_frontend* s5h1420_attach(const struct s5h1420_config* config, - struct i2c_adapter* i2c); + struct i2c_adapter* i2c); #endif // S5H1420_H diff --git a/trunk/drivers/media/dvb/frontends/sp8870.c b/trunk/drivers/media/dvb/frontends/sp8870.c index fc06cd6b46c3..1c6b2e9264bc 100644 --- a/trunk/drivers/media/dvb/frontends/sp8870.c +++ b/trunk/drivers/media/dvb/frontends/sp8870.c @@ -67,16 +67,16 @@ static int debug; static int sp8870_writereg (struct sp8870_state* state, u16 reg, u16 data) { - u8 buf [] = { reg >> 8, reg & 0xff, data >> 8, data & 0xff }; + u8 buf [] = { reg >> 8, reg & 0xff, data >> 8, data & 0xff }; struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 4 }; int err; - if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) { + if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) { dprintk ("%s: writereg error (err == %i, reg == 0x%02x, data == 0x%02x)\n", __FUNCTION__, err, reg, data); return -EREMOTEIO; } - return 0; + return 0; } static int sp8870_readreg (struct sp8870_state* state, u16 reg) @@ -305,7 +305,7 @@ static int sp8870_set_frontend_parameters (struct dvb_frontend* fe, static int sp8870_init (struct dvb_frontend* fe) { struct sp8870_state* state = fe->demodulator_priv; - const struct firmware *fw = NULL; + const struct firmware *fw = NULL; sp8870_wake_up(state); if (state->initialised) return 0; @@ -534,10 +534,10 @@ static int sp8870_sleep(struct dvb_frontend* fe) static int sp8870_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) { - fesettings->min_delay_ms = 350; - fesettings->step_size = 0; - fesettings->max_drift = 0; - return 0; + fesettings->min_delay_ms = 350; + fesettings->step_size = 0; + fesettings->max_drift = 0; + return 0; } static void sp8870_release(struct dvb_frontend* fe) diff --git a/trunk/drivers/media/dvb/frontends/sp887x.c b/trunk/drivers/media/dvb/frontends/sp887x.c index e3b665782243..73384e75625e 100644 --- a/trunk/drivers/media/dvb/frontends/sp887x.c +++ b/trunk/drivers/media/dvb/frontends/sp887x.c @@ -80,7 +80,7 @@ static int sp887x_readreg (struct sp887x_state* state, u16 reg) u8 b1 [2]; int ret; struct i2c_msg msg[] = {{ .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 2 }, - { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 2 }}; + { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 2 }}; if ((ret = i2c_transfer(state->i2c, msg, 2)) != 2) { printk("%s: readreg error (ret == %i)\n", __FUNCTION__, ret); @@ -498,7 +498,7 @@ static int sp887x_sleep(struct dvb_frontend* fe) static int sp887x_init(struct dvb_frontend* fe) { struct sp887x_state* state = fe->demodulator_priv; - const struct firmware *fw = NULL; + const struct firmware *fw = NULL; int ret; if (!state->initialised) { @@ -528,10 +528,10 @@ static int sp887x_init(struct dvb_frontend* fe) static int sp887x_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) { - fesettings->min_delay_ms = 350; - fesettings->step_size = 166666*2; - fesettings->max_drift = (166666*2)+1; - return 0; + fesettings->min_delay_ms = 350; + fesettings->step_size = 166666*2; + fesettings->max_drift = (166666*2)+1; + return 0; } static void sp887x_release(struct dvb_frontend* fe) @@ -581,7 +581,7 @@ static struct dvb_frontend_ops sp887x_ops = { .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | - FE_CAN_RECOVER + FE_CAN_RECOVER }, .release = sp887x_release, diff --git a/trunk/drivers/media/dvb/frontends/stv0299.c b/trunk/drivers/media/dvb/frontends/stv0299.c index 177d71d56b67..29c48665e130 100644 --- a/trunk/drivers/media/dvb/frontends/stv0299.c +++ b/trunk/drivers/media/dvb/frontends/stv0299.c @@ -95,7 +95,7 @@ static int stv0299_writeregI (struct stv0299_state* state, u8 reg, u8 data) int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; return stv0299_writeregI(state, reg, data); } @@ -220,7 +220,7 @@ static int stv0299_wait_diseqc_idle (struct stv0299_state* state, int timeout) static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; u64 big = srate; u32 ratio; @@ -271,7 +271,7 @@ static int stv0299_get_symbolrate (struct stv0299_state* state) static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *m) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; u8 val; int i; @@ -301,7 +301,7 @@ static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; u8 val; dprintk ("%s\n", __FUNCTION__); @@ -328,7 +328,7 @@ static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; u8 val; if (stv0299_wait_diseqc_idle (state, 100) < 0) @@ -350,7 +350,7 @@ static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; u8 reg0x08; u8 reg0x0c; @@ -442,7 +442,7 @@ static int stv0299_send_legacy_dish_cmd (struct dvb_frontend* fe, u32 cmd) static int stv0299_init (struct dvb_frontend* fe) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; int i; dprintk("stv0299: init chip\n"); @@ -461,7 +461,7 @@ static int stv0299_init (struct dvb_frontend* fe) static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; u8 signal = 0xff - stv0299_readreg (state, 0x18); u8 sync = stv0299_readreg (state, 0x1b); @@ -489,7 +489,7 @@ static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; if (state->errmode != STATUS_BER) return 0; *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); @@ -499,7 +499,7 @@ static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber) static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; s32 signal = 0xffff - ((stv0299_readreg (state, 0x18) << 8) | stv0299_readreg (state, 0x19)); @@ -516,7 +516,7 @@ static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength) static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; s32 xsnr = 0xffff - ((stv0299_readreg (state, 0x24) << 8) | stv0299_readreg (state, 0x25)); @@ -528,7 +528,7 @@ static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr) static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0; else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); @@ -538,7 +538,7 @@ static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; int invval = 0; dprintk ("%s : FE_SET_FRONTEND\n", __FUNCTION__); @@ -571,7 +571,7 @@ static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; s32 derot_freq; int invval; @@ -596,7 +596,7 @@ static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par static int stv0299_sleep(struct dvb_frontend* fe) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; stv0299_writeregI(state, 0x02, 0x80); state->initialised = 0; @@ -606,7 +606,7 @@ static int stv0299_sleep(struct dvb_frontend* fe) static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) { - struct stv0299_state* state = fe->demodulator_priv; + struct stv0299_state* state = fe->demodulator_priv; fesettings->min_delay_ms = state->config->min_delay_ms; if (fesettings->parameters.u.qpsk.symbol_rate < 10000000) { @@ -658,7 +658,7 @@ struct dvb_frontend* stv0299_attach(const struct stv0299_config* config, /* create dvb_frontend */ state->frontend.ops = &state->ops; - state->frontend.demodulator_priv = state; + state->frontend.demodulator_priv = state; return &state->frontend; error: @@ -714,7 +714,7 @@ MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); MODULE_DESCRIPTION("ST STV0299 DVB Demodulator driver"); MODULE_AUTHOR("Ralph Metzler, Holger Waechtler, Peter Schildmann, Felix Domke, " - "Andreas Oberritter, Andrew de Quincey, Kenneth Aafløy"); + "Andreas Oberritter, Andrew de Quincey, Kenneth Aafløy"); MODULE_LICENSE("GPL"); EXPORT_SYMBOL(stv0299_writereg); diff --git a/trunk/drivers/media/dvb/frontends/tda10021.c b/trunk/drivers/media/dvb/frontends/tda10021.c index 425cd19136fe..eaf130e666d8 100644 --- a/trunk/drivers/media/dvb/frontends/tda10021.c +++ b/trunk/drivers/media/dvb/frontends/tda10021.c @@ -1,10 +1,10 @@ /* TDA10021 - Single Chip Cable Channel Receiver driver module - used on the the Siemens DVB-C cards + used on the the Siemens DVB-C cards Copyright (C) 1999 Convergence Integrated Media GmbH Copyright (C) 2004 Markus Schulz - Support for TDA10021 + Support for TDA10021 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 @@ -76,9 +76,9 @@ static u8 tda10021_inittab[0x40]= static int tda10021_writereg (struct tda10021_state* state, u8 reg, u8 data) { - u8 buf[] = { reg, data }; + u8 buf[] = { reg, data }; struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; - int ret; + int ret; ret = i2c_transfer (state->i2c, &msg, 1); if (ret != 1) @@ -95,7 +95,7 @@ static u8 tda10021_readreg (struct tda10021_state* state, u8 reg) u8 b0 [] = { reg }; u8 b1 [] = { 0 }; struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 }, - { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; + { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; int ret; ret = i2c_transfer (state->i2c, msg, 2); diff --git a/trunk/drivers/media/dvb/frontends/tda10021.h b/trunk/drivers/media/dvb/frontends/tda10021.h index 53be939e8c55..7d6a51ce291e 100644 --- a/trunk/drivers/media/dvb/frontends/tda10021.h +++ b/trunk/drivers/media/dvb/frontends/tda10021.h @@ -1,10 +1,10 @@ /* TDA10021 - Single Chip Cable Channel Receiver driver module - used on the the Siemens DVB-C cards + used on the the Siemens DVB-C cards Copyright (C) 1999 Convergence Integrated Media GmbH Copyright (C) 2004 Markus Schulz - Support for TDA10021 + Support for TDA10021 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 diff --git a/trunk/drivers/media/dvb/frontends/tda1004x.c b/trunk/drivers/media/dvb/frontends/tda1004x.c index dd02aff467fe..7968743826fc 100644 --- a/trunk/drivers/media/dvb/frontends/tda1004x.c +++ b/trunk/drivers/media/dvb/frontends/tda1004x.c @@ -475,7 +475,7 @@ static int tda10046_fwupload(struct dvb_frontend* fe) ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE); if (ret) { printk(KERN_ERR "tda1004x: no firmware upload (timeout or file not found?)\n"); - return ret; + return ret; } tda1004x_write_mask(state, TDA1004X_CONFC4, 8, 8); // going to boot from HOST ret = tda1004x_do_upload(state, fw->data, fw->size, TDA10046H_CODE_CPT, TDA10046H_CODE_IN); diff --git a/trunk/drivers/media/dvb/frontends/tda8083.c b/trunk/drivers/media/dvb/frontends/tda8083.c index 91baa9cedd79..c05cf1861051 100644 --- a/trunk/drivers/media/dvb/frontends/tda8083.c +++ b/trunk/drivers/media/dvb/frontends/tda8083.c @@ -66,13 +66,13 @@ static int tda8083_writereg (struct tda8083_state* state, u8 reg, u8 data) u8 buf [] = { reg, data }; struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; - ret = i2c_transfer(state->i2c, &msg, 1); + ret = i2c_transfer(state->i2c, &msg, 1); - if (ret != 1) - dprintk ("%s: writereg error (reg %02x, ret == %i)\n", + if (ret != 1) + dprintk ("%s: writereg error (reg %02x, ret == %i)\n", __FUNCTION__, reg, ret); - return (ret != 1) ? -1 : 0; + return (ret != 1) ? -1 : 0; } static int tda8083_readregs (struct tda8083_state* state, u8 reg1, u8 *b, u8 len) @@ -87,7 +87,7 @@ static int tda8083_readregs (struct tda8083_state* state, u8 reg1, u8 *b, u8 len dprintk ("%s: readreg error (reg %02x, ret == %i)\n", __FUNCTION__, reg1, ret); - return ret == 2 ? 0 : -1; + return ret == 2 ? 0 : -1; } static inline u8 tda8083_readreg (struct tda8083_state* state, u8 reg) @@ -132,14 +132,14 @@ static fe_code_rate_t tda8083_get_fec (struct tda8083_state* state) static int tda8083_set_symbolrate (struct tda8083_state* state, u32 srate) { - u32 ratio; + u32 ratio; u32 tmp; u8 filter; if (srate > 32000000) - srate = 32000000; - if (srate < 500000) - srate = 500000; + srate = 32000000; + if (srate < 500000) + srate = 500000; filter = 0; if (srate < 24000000) @@ -174,7 +174,7 @@ static void tda8083_wait_diseqc_fifo (struct tda8083_state* state, int timeout) unsigned long start = jiffies; while (jiffies - start < timeout && - !(tda8083_readreg(state, 0x02) & 0x80)) + !(tda8083_readreg(state, 0x02) & 0x80)) { msleep(50); }; diff --git a/trunk/drivers/media/dvb/frontends/ves1820.c b/trunk/drivers/media/dvb/frontends/ves1820.c index ad8647a3c85e..c6d276618e86 100644 --- a/trunk/drivers/media/dvb/frontends/ves1820.c +++ b/trunk/drivers/media/dvb/frontends/ves1820.c @@ -140,25 +140,25 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate) /* yeuch! */ fpxin = state->config->xin * 10; fptmp = fpxin; do_div(fptmp, 123); - if (symbolrate < fptmp) + if (symbolrate < fptmp); SFIL = 1; fptmp = fpxin; do_div(fptmp, 160); - if (symbolrate < fptmp) + if (symbolrate < fptmp); SFIL = 0; fptmp = fpxin; do_div(fptmp, 246); - if (symbolrate < fptmp) + if (symbolrate < fptmp); SFIL = 1; fptmp = fpxin; do_div(fptmp, 320); - if (symbolrate < fptmp) + if (symbolrate < fptmp); SFIL = 0; fptmp = fpxin; do_div(fptmp, 492); - if (symbolrate < fptmp) + if (symbolrate < fptmp); SFIL = 1; fptmp = fpxin; do_div(fptmp, 640); - if (symbolrate < fptmp) + if (symbolrate < fptmp); SFIL = 0; fptmp = fpxin; do_div(fptmp, 984); - if (symbolrate < fptmp) + if (symbolrate < fptmp); SFIL = 1; fin = state->config->xin >> 4; diff --git a/trunk/drivers/media/dvb/ttpci/Kconfig b/trunk/drivers/media/dvb/ttpci/Kconfig index fa5034a9ecf5..d8bf65877897 100644 --- a/trunk/drivers/media/dvb/ttpci/Kconfig +++ b/trunk/drivers/media/dvb/ttpci/Kconfig @@ -81,7 +81,6 @@ config DVB_BUDGET_CI tristate "Budget cards with onboard CI connector" depends on DVB_CORE && PCI select VIDEO_SAA7146 - select DVB_STV0297 select DVB_STV0299 select DVB_TDA1004X help diff --git a/trunk/drivers/media/dvb/ttpci/av7110.c b/trunk/drivers/media/dvb/ttpci/av7110.c index 7dae91e5863c..87ea52757a21 100644 --- a/trunk/drivers/media/dvb/ttpci/av7110.c +++ b/trunk/drivers/media/dvb/ttpci/av7110.c @@ -176,9 +176,6 @@ static void init_av7110_av(struct av7110 *av7110) } } - if (dev->pci->subsystem_vendor == 0x13c2 && dev->pci->subsystem_device == 0x000e) - av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, SpdifSwitch, 1, 0); // SPDIF on - ret = av7110_set_volume(av7110, av7110->mixer.volume_left, av7110->mixer.volume_right); if (ret < 0) printk("dvb-ttpci:cannot set volume :%d\n",ret); @@ -220,10 +217,10 @@ static int arm_thread(void *data) dprintk(4, "%p\n",av7110); - lock_kernel(); - daemonize("arm_mon"); - sigfillset(¤t->blocked); - unlock_kernel(); + lock_kernel(); + daemonize("arm_mon"); + sigfillset(¤t->blocked); + unlock_kernel(); av7110->arm_thread = current; @@ -1538,7 +1535,7 @@ static int alps_bsrv2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param buf[2] = ((div & 0x18000) >> 10) | 0x95; buf[3] = (pwr << 6) | 0x30; - // NOTE: since we're using a prescaler of 2, we set the + // NOTE: since we're using a prescaler of 2, we set the // divisor frequency to 62.5kHz and divide by 125 above if (i2c_transfer (&av7110->i2c_adap, &msg, 1) != 1) @@ -1814,7 +1811,7 @@ static struct tda8083_config grundig_29504_451_config = { static int philips_cd1516_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) { - struct av7110* av7110 = fe->dvb->priv; + struct av7110* av7110 = fe->dvb->priv; u32 div; u32 f = params->frequency; u8 data[4]; @@ -2205,7 +2202,7 @@ static u8 read_pwm(struct av7110* av7110) struct i2c_msg msg[] = { { .addr = 0x50,.flags = 0,.buf = &b,.len = 1 }, { .addr = 0x50,.flags = I2C_M_RD,.buf = &pwm,.len = 1} }; - if ((i2c_transfer(&av7110->i2c_adap, msg, 2) != 2) || (pwm == 0xff)) + if ((i2c_transfer(&av7110->i2c_adap, msg, 2) != 2) || (pwm == 0xff)) pwm = 0x48; return pwm; @@ -2248,7 +2245,7 @@ static int frontend_init(struct av7110 *av7110) } // Try the grundig 29504-451 - av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap); + av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap); if (av7110->fe) { av7110->fe->ops->diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; av7110->fe->ops->diseqc_send_burst = av7110_diseqc_send_burst; @@ -2274,12 +2271,12 @@ static int frontend_init(struct av7110 *av7110) case 0x0001: // Hauppauge/TT Nexus-T premium rev1.X // ALPS TDLB7 - av7110->fe = sp8870_attach(&alps_tdlb7_config, &av7110->i2c_adap); + av7110->fe = sp8870_attach(&alps_tdlb7_config, &av7110->i2c_adap); break; case 0x0002: // Hauppauge/TT DVB-C premium rev2.X - av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110)); + av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110)); break; case 0x0006: /* Fujitsu-Siemens DVB-S rev 1.6 */ @@ -2424,9 +2421,9 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d dprintk(4, "dev: %p\n", dev); - /* Set RPS_IRQ to 1 to track rps1 activity. - * Enabling this won't send any interrupt to PC CPU. - */ + /* Set RPS_IRQ to 1 to track rps1 activity. + * Enabling this won't send any interrupt to PC CPU. + */ #define RPS_IRQ 0 if (budgetpatch == 1) { diff --git a/trunk/drivers/media/dvb/ttpci/av7110_ca.c b/trunk/drivers/media/dvb/ttpci/av7110_ca.c index 6079e8865d5b..c3801e328fe9 100644 --- a/trunk/drivers/media/dvb/ttpci/av7110_ca.c +++ b/trunk/drivers/media/dvb/ttpci/av7110_ca.c @@ -40,7 +40,6 @@ #include "av7110.h" #include "av7110_hw.h" -#include "av7110_ca.h" void CI_handle(struct av7110 *av7110, u8 *data, u16 len) diff --git a/trunk/drivers/media/dvb/ttpci/av7110_hw.c b/trunk/drivers/media/dvb/ttpci/av7110_hw.c index 87106e8bf35b..7442f56a72ec 100644 --- a/trunk/drivers/media/dvb/ttpci/av7110_hw.c +++ b/trunk/drivers/media/dvb/ttpci/av7110_hw.c @@ -1203,15 +1203,15 @@ int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc) int av7110_osd_capability(struct av7110 *av7110, osd_cap_t *cap) { - switch (cap->cmd) { - case OSD_CAP_MEMSIZE: - if (FW_4M_SDRAM(av7110->arm_app)) - cap->val = 1000000; - else - cap->val = 92000; - return 0; - default: - return -EINVAL; - } + switch (cap->cmd) { + case OSD_CAP_MEMSIZE: + if (FW_4M_SDRAM(av7110->arm_app)) + cap->val = 1000000; + else + cap->val = 92000; + return 0; + default: + return -EINVAL; + } } #endif /* CONFIG_DVB_AV7110_OSD */ diff --git a/trunk/drivers/media/dvb/ttpci/av7110_hw.h b/trunk/drivers/media/dvb/ttpci/av7110_hw.h index 2a5e87ba1052..fedd20f9815d 100644 --- a/trunk/drivers/media/dvb/ttpci/av7110_hw.h +++ b/trunk/drivers/media/dvb/ttpci/av7110_hw.h @@ -143,8 +143,7 @@ enum av7110_audio_command { MainSwitch, ADSwitch, SendDiSEqC, - SetRegister, - SpdifSwitch + SetRegister }; enum av7110_request_command { diff --git a/trunk/drivers/media/dvb/ttpci/av7110_v4l.c b/trunk/drivers/media/dvb/ttpci/av7110_v4l.c index b5aea4129fa7..6af74f78b3e5 100644 --- a/trunk/drivers/media/dvb/ttpci/av7110_v4l.c +++ b/trunk/drivers/media/dvb/ttpci/av7110_v4l.c @@ -120,8 +120,8 @@ static int ves1820_writereg(struct saa7146_dev *dev, u8 addr, u8 reg, u8 data) static int stv0297_writereg(struct saa7146_dev *dev, u8 addr, u8 reg, u8 data) { - u8 buf [] = { reg, data }; - struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = buf, .len = 2 }; + u8 buf [] = { reg, data }; + struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = buf, .len = 2 }; if (1 != saa7146_i2c_transfer(dev, &msg, 1, 1)) return -1; diff --git a/trunk/drivers/media/dvb/ttpci/budget-av.c b/trunk/drivers/media/dvb/ttpci/budget-av.c index 9f51bae7194c..aa75dc03a0b3 100644 --- a/trunk/drivers/media/dvb/ttpci/budget-av.c +++ b/trunk/drivers/media/dvb/ttpci/budget-av.c @@ -1020,8 +1020,6 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); static struct saa7146_extension budget_extension = { .name = "budget_av", - .flags = SAA7146_I2C_SHORT_DELAY, - .pci_tbl = pci_tbl, .module = THIS_MODULE, diff --git a/trunk/drivers/media/dvb/ttpci/budget-ci.c b/trunk/drivers/media/dvb/ttpci/budget-ci.c index b9b3cd9c0369..75fb92d60998 100644 --- a/trunk/drivers/media/dvb/ttpci/budget-ci.c +++ b/trunk/drivers/media/dvb/ttpci/budget-ci.c @@ -1166,7 +1166,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); static struct saa7146_extension budget_extension = { .name = "budget_ci dvb\0", - .flags = SAA7146_I2C_SHORT_DELAY, + .flags = 0, .module = THIS_MODULE, .pci_tbl = &pci_tbl[0], diff --git a/trunk/drivers/media/dvb/ttpci/budget-core.c b/trunk/drivers/media/dvb/ttpci/budget-core.c index 017fcbccb8cc..0498a055a4cd 100644 --- a/trunk/drivers/media/dvb/ttpci/budget-core.c +++ b/trunk/drivers/media/dvb/ttpci/budget-core.c @@ -87,7 +87,7 @@ static int start_ts_capture(struct budget *budget) * Pitch: 188, NumBytes3: 188, NumLines3: 1024 */ - switch(budget->card->type) { + switch(budget->card->type) { case BUDGET_FS_ACTIVY: saa7146_write(dev, DD1_INIT, 0x04000000); saa7146_write(dev, MC2, (MASK_09 | MASK_25)); diff --git a/trunk/drivers/media/dvb/ttpci/budget-patch.c b/trunk/drivers/media/dvb/ttpci/budget-patch.c index fc416cf5253c..755df81cbc49 100644 --- a/trunk/drivers/media/dvb/ttpci/budget-patch.c +++ b/trunk/drivers/media/dvb/ttpci/budget-patch.c @@ -45,11 +45,11 @@ MAKE_BUDGET_INFO(ttbp, "TT-Budget/Patch DVB-S 1.x PCI", BUDGET_PATCH); //MAKE_BUDGET_INFO(satel,"TT-Budget/Patch SATELCO PCI", BUDGET_TT_HW_DISEQC); static struct pci_device_id pci_tbl[] = { - MAKE_EXTENSION_PCI(ttbp,0x13c2, 0x0000), + MAKE_EXTENSION_PCI(ttbp,0x13c2, 0x0000), // MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013), - { - .vendor = 0, - } + { + .vendor = 0, + } }; /* those lines are for budget-patch to be tried @@ -165,57 +165,57 @@ static int budget_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t m static int budget_av7110_send_fw_cmd(struct budget_patch *budget, u16* buf, int length) { - int i; - - dprintk(2, "budget: %p\n", budget); - - for (i = 2; i < length; i++) - { - ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2*i, 2, (u32) buf[i], 0,0); - msleep(5); - } - if (length) - ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2, 2, (u32) buf[1], 0,0); - else - ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2, 2, 0, 0,0); - msleep(5); - ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND, 2, (u32) buf[0], 0,0); - msleep(5); - return 0; + int i; + + dprintk(2, "budget: %p\n", budget); + + for (i = 2; i < length; i++) + { + ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2*i, 2, (u32) buf[i], 0,0); + msleep(5); + } + if (length) + ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2, 2, (u32) buf[1], 0,0); + else + ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2, 2, 0, 0,0); + msleep(5); + ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND, 2, (u32) buf[0], 0,0); + msleep(5); + return 0; } static void av7110_set22k(struct budget_patch *budget, int state) { - u16 buf[2] = {( COMTYPE_AUDIODAC << 8) | (state ? ON22K : OFF22K), 0}; + u16 buf[2] = {( COMTYPE_AUDIODAC << 8) | (state ? ON22K : OFF22K), 0}; - dprintk(2, "budget: %p\n", budget); - budget_av7110_send_fw_cmd(budget, buf, 2); + dprintk(2, "budget: %p\n", budget); + budget_av7110_send_fw_cmd(budget, buf, 2); } static int av7110_send_diseqc_msg(struct budget_patch *budget, int len, u8 *msg, int burst) { - int i; - u16 buf[18] = { ((COMTYPE_AUDIODAC << 8) | SendDiSEqC), - 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + int i; + u16 buf[18] = { ((COMTYPE_AUDIODAC << 8) | SendDiSEqC), + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - dprintk(2, "budget: %p\n", budget); + dprintk(2, "budget: %p\n", budget); - if (len>10) - len=10; + if (len>10) + len=10; - buf[1] = len+2; - buf[2] = len; + buf[1] = len+2; + buf[2] = len; - if (burst != -1) - buf[3]=burst ? 0x01 : 0x00; - else - buf[3]=0xffff; + if (burst != -1) + buf[3]=burst ? 0x01 : 0x00; + else + buf[3]=0xffff; - for (i=0; i> 10) | 0x95; buf[3] = (pwr << 6) | 0x30; - // NOTE: since we're using a prescaler of 2, we set the + // NOTE: since we're using a prescaler of 2, we set the // divisor frequency to 62.5kHz and divide by 125 above if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; @@ -294,7 +294,7 @@ static u8 alps_bsru6_inittab[] = { 0x01, 0x15, 0x02, 0x00, 0x03, 0x00, - 0x04, 0x7d, /* F22FR = 0x7d, F22 = f_VCO / 128 / 0x7d = 22 kHz */ + 0x04, 0x7d, /* F22FR = 0x7d, F22 = f_VCO / 128 / 0x7d = 22 kHz */ 0x05, 0x35, /* I2CT = 0, SCLT = 1, SDAT = 1 */ 0x06, 0x40, /* DAC not used, set to high impendance mode */ 0x07, 0x00, /* DAC LSB */ @@ -413,7 +413,7 @@ static void frontend_init(struct budget_patch* budget) { switch(budget->dev->pci->subsystem_device) { case 0x0000: // Hauppauge/TT WinTV DVB-S rev1.X - case 0x1013: // SATELCO Multimedia PCI + case 0x1013: // SATELCO Multimedia PCI // try the ALPS BSRV2 first of all budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); @@ -463,8 +463,8 @@ static void frontend_init(struct budget_patch* budget) /* written by Emard */ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *info) { - struct budget_patch *budget; - int err; + struct budget_patch *budget; + int err; int count = 0; int detected = 0; @@ -472,12 +472,12 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte #define RPS_IRQ 0 #define HPS_SETUP 0 #if PATCH_RESET - saa7146_write(dev, MC1, MASK_31); - msleep(40); + saa7146_write(dev, MC1, MASK_31); + msleep(40); #endif #if HPS_SETUP - // initialize registers. Better to have it like this - // than leaving something unconfigured + // initialize registers. Better to have it like this + // than leaving something unconfigured saa7146_write(dev, DD1_STREAM_B, 0); // port B VSYNC at rising edge saa7146_write(dev, DD1_INIT, 0x00000200); // have this in budget-core too! @@ -486,29 +486,29 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte // debi config // saa7146_write(dev, DEBI_CONFIG, MASK_30|MASK_28|MASK_18); - // zero all HPS registers - saa7146_write(dev, HPS_H_PRESCALE, 0); // r68 - saa7146_write(dev, HPS_H_SCALE, 0); // r6c - saa7146_write(dev, BCS_CTRL, 0); // r70 - saa7146_write(dev, HPS_V_SCALE, 0); // r60 - saa7146_write(dev, HPS_V_GAIN, 0); // r64 - saa7146_write(dev, CHROMA_KEY_RANGE, 0); // r74 - saa7146_write(dev, CLIP_FORMAT_CTRL, 0); // r78 - // Set HPS prescaler for port B input - saa7146_write(dev, HPS_CTRL, (1<<30) | (0<<29) | (1<<28) | (0<<12) ); - saa7146_write(dev, MC2, - 0 * (MASK_08 | MASK_24) | // BRS control - 0 * (MASK_09 | MASK_25) | // a - 0 * (MASK_10 | MASK_26) | // b - 1 * (MASK_06 | MASK_22) | // HPS_CTRL1 - 1 * (MASK_05 | MASK_21) | // HPS_CTRL2 - 0 * (MASK_01 | MASK_15) // DEBI - ); + // zero all HPS registers + saa7146_write(dev, HPS_H_PRESCALE, 0); // r68 + saa7146_write(dev, HPS_H_SCALE, 0); // r6c + saa7146_write(dev, BCS_CTRL, 0); // r70 + saa7146_write(dev, HPS_V_SCALE, 0); // r60 + saa7146_write(dev, HPS_V_GAIN, 0); // r64 + saa7146_write(dev, CHROMA_KEY_RANGE, 0); // r74 + saa7146_write(dev, CLIP_FORMAT_CTRL, 0); // r78 + // Set HPS prescaler for port B input + saa7146_write(dev, HPS_CTRL, (1<<30) | (0<<29) | (1<<28) | (0<<12) ); + saa7146_write(dev, MC2, + 0 * (MASK_08 | MASK_24) | // BRS control + 0 * (MASK_09 | MASK_25) | // a + 0 * (MASK_10 | MASK_26) | // b + 1 * (MASK_06 | MASK_22) | // HPS_CTRL1 + 1 * (MASK_05 | MASK_21) | // HPS_CTRL2 + 0 * (MASK_01 | MASK_15) // DEBI + ); #endif // Disable RPS1 and RPS0 - saa7146_write(dev, MC1, ( MASK_29 | MASK_28)); - // RPS1 timeout disable - saa7146_write(dev, RPS_TOV1, 0); + saa7146_write(dev, MC1, ( MASK_29 | MASK_28)); + // RPS1 timeout disable + saa7146_write(dev, RPS_TOV1, 0); // code for autodetection // will wait for VBI_B event (vertical blank at port B) @@ -521,38 +521,38 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte WRITE_RPS1(cpu_to_le32(CMD_UPLOAD | MASK_10 | MASK_09 | MASK_08 | MASK_06 | MASK_05 | MASK_04 | MASK_03 | MASK_02 )); #endif - WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_VBI_B)); - WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); - WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); - WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTLO<<24)); + WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_VBI_B)); + WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); + WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); + WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTLO<<24)); #if RPS_IRQ - // issue RPS1 interrupt to increment counter - WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); - // at least a NOP is neede between two interrupts - WRITE_RPS1(cpu_to_le32(CMD_NOP)); - // interrupt again - WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); + // issue RPS1 interrupt to increment counter + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); + // at least a NOP is neede between two interrupts + WRITE_RPS1(cpu_to_le32(CMD_NOP)); + // interrupt again + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); #endif - WRITE_RPS1(cpu_to_le32(CMD_STOP)); + WRITE_RPS1(cpu_to_le32(CMD_STOP)); #if RPS_IRQ - // set event counter 1 source as RPS1 interrupt (0x03) (rE4 p53) - // use 0x03 to track RPS1 interrupts - increase by 1 every gpio3 is toggled - // use 0x15 to track VPE interrupts - increase by 1 every vpeirq() is called - saa7146_write(dev, EC1SSR, (0x03<<2) | 3 ); - // set event counter 1 treshold to maximum allowed value (rEC p55) - saa7146_write(dev, ECT1R, 0x3fff ); + // set event counter 1 source as RPS1 interrupt (0x03) (rE4 p53) + // use 0x03 to track RPS1 interrupts - increase by 1 every gpio3 is toggled + // use 0x15 to track VPE interrupts - increase by 1 every vpeirq() is called + saa7146_write(dev, EC1SSR, (0x03<<2) | 3 ); + // set event counter 1 treshold to maximum allowed value (rEC p55) + saa7146_write(dev, ECT1R, 0x3fff ); #endif - // Fix VSYNC level - saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); - // Set RPS1 Address register to point to RPS code (r108 p42) - saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); - // Enable RPS1, (rFC p33) - saa7146_write(dev, MC1, (MASK_13 | MASK_29 )); + // Fix VSYNC level + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); + // Set RPS1 Address register to point to RPS code (r108 p42) + saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); + // Enable RPS1, (rFC p33) + saa7146_write(dev, MC1, (MASK_13 | MASK_29 )); - mdelay(50); - saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); + mdelay(50); + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); mdelay(150); @@ -560,17 +560,17 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte detected = 1; #if RPS_IRQ - printk("Event Counter 1 0x%04x\n", saa7146_read(dev, EC1R) & 0x3fff ); + printk("Event Counter 1 0x%04x\n", saa7146_read(dev, EC1R) & 0x3fff ); #endif // Disable RPS1 - saa7146_write(dev, MC1, ( MASK_29 )); + saa7146_write(dev, MC1, ( MASK_29 )); if(detected == 0) - printk("budget-patch not detected or saa7146 in non-default state.\n" - "try enabling ressetting of 7146 with MASK_31 in MC1 register\n"); + printk("budget-patch not detected or saa7146 in non-default state.\n" + "try enabling ressetting of 7146 with MASK_31 in MC1 register\n"); else - printk("BUDGET-PATCH DETECTED.\n"); + printk("BUDGET-PATCH DETECTED.\n"); /* OLD (Original design by Roberto Deza): @@ -641,83 +641,83 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte */ // Setup RPS1 "program" (p35) - count = 0; + count = 0; - // Wait Source Line Counter Threshold (p36) - WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_HS)); - // Set GPIO3=1 (p42) - WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); - WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); - WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTHI<<24)); + // Wait Source Line Counter Threshold (p36) + WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_HS)); + // Set GPIO3=1 (p42) + WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); + WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); + WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTHI<<24)); #if RPS_IRQ - // issue RPS1 interrupt - WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); + // issue RPS1 interrupt + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); #endif - // Wait reset Source Line Counter Threshold (p36) - WRITE_RPS1(cpu_to_le32(CMD_PAUSE | RPS_INV | EVT_HS)); - // Set GPIO3=0 (p42) - WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); - WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); - WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTLO<<24)); + // Wait reset Source Line Counter Threshold (p36) + WRITE_RPS1(cpu_to_le32(CMD_PAUSE | RPS_INV | EVT_HS)); + // Set GPIO3=0 (p42) + WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); + WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); + WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTLO<<24)); #if RPS_IRQ - // issue RPS1 interrupt - WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); + // issue RPS1 interrupt + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); #endif - // Jump to begin of RPS program (p37) - WRITE_RPS1(cpu_to_le32(CMD_JUMP)); - WRITE_RPS1(cpu_to_le32(dev->d_rps1.dma_handle)); + // Jump to begin of RPS program (p37) + WRITE_RPS1(cpu_to_le32(CMD_JUMP)); + WRITE_RPS1(cpu_to_le32(dev->d_rps1.dma_handle)); - // Fix VSYNC level - saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); - // Set RPS1 Address register to point to RPS code (r108 p42) - saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); - // Set Source Line Counter Threshold, using BRS (rCC p43) - // It generates HS event every TS_HEIGHT lines - // this is related to TS_WIDTH set in register - // NUM_LINE_BYTE3 in budget-core.c. If NUM_LINE_BYTE - // low 16 bits are set to TS_WIDTH bytes (TS_WIDTH=2*188 - //,then RPS_THRESH1 - // should be set to trigger every TS_HEIGHT (512) lines. - // - saa7146_write(dev, RPS_THRESH1, (TS_HEIGHT*1) | MASK_12 ); - - // saa7146_write(dev, RPS_THRESH0, ((TS_HEIGHT/2)<<16) |MASK_28| (TS_HEIGHT/2) |MASK_12 ); - // Enable RPS1 (rFC p33) - saa7146_write(dev, MC1, (MASK_13 | MASK_29)); - - - if (!(budget = kmalloc (sizeof(struct budget_patch), GFP_KERNEL))) - return -ENOMEM; + // Fix VSYNC level + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); + // Set RPS1 Address register to point to RPS code (r108 p42) + saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); + // Set Source Line Counter Threshold, using BRS (rCC p43) + // It generates HS event every TS_HEIGHT lines + // this is related to TS_WIDTH set in register + // NUM_LINE_BYTE3 in budget-core.c. If NUM_LINE_BYTE + // low 16 bits are set to TS_WIDTH bytes (TS_WIDTH=2*188 + //,then RPS_THRESH1 + // should be set to trigger every TS_HEIGHT (512) lines. + // + saa7146_write(dev, RPS_THRESH1, (TS_HEIGHT*1) | MASK_12 ); - dprintk(2, "budget: %p\n", budget); + // saa7146_write(dev, RPS_THRESH0, ((TS_HEIGHT/2)<<16) |MASK_28| (TS_HEIGHT/2) |MASK_12 ); + // Enable RPS1 (rFC p33) + saa7146_write(dev, MC1, (MASK_13 | MASK_29)); - if ((err = ttpci_budget_init (budget, dev, info, THIS_MODULE))) { - kfree (budget); - return err; - } + if (!(budget = kmalloc (sizeof(struct budget_patch), GFP_KERNEL))) + return -ENOMEM; + + dprintk(2, "budget: %p\n", budget); - dev->ext_priv = budget; + if ((err = ttpci_budget_init (budget, dev, info, THIS_MODULE))) { + kfree (budget); + return err; + } + + + dev->ext_priv = budget; budget->dvb_adapter.priv = budget; frontend_init(budget); - return 0; + return 0; } static int budget_patch_detach (struct saa7146_dev* dev) { - struct budget_patch *budget = (struct budget_patch*) dev->ext_priv; - int err; + struct budget_patch *budget = (struct budget_patch*) dev->ext_priv; + int err; if (budget->dvb_frontend) dvb_unregister_frontend(budget->dvb_frontend); - err = ttpci_budget_deinit (budget); + err = ttpci_budget_deinit (budget); - kfree (budget); + kfree (budget); - return err; + return err; } static int __init budget_patch_init(void) @@ -727,20 +727,20 @@ static int __init budget_patch_init(void) static void __exit budget_patch_exit(void) { - saa7146_unregister_extension(&budget_extension); + saa7146_unregister_extension(&budget_extension); } static struct saa7146_extension budget_extension = { - .name = "budget_patch dvb\0", - .flags = 0, + .name = "budget_patch dvb\0", + .flags = 0, - .module = THIS_MODULE, - .pci_tbl = pci_tbl, - .attach = budget_patch_attach, - .detach = budget_patch_detach, + .module = THIS_MODULE, + .pci_tbl = pci_tbl, + .attach = budget_patch_attach, + .detach = budget_patch_detach, - .irq_mask = MASK_10, - .irq_func = ttpci_budget_irq10_handler, + .irq_mask = MASK_10, + .irq_func = ttpci_budget_irq10_handler, }; module_init(budget_patch_init); @@ -749,4 +749,4 @@ module_exit(budget_patch_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Emard, Roberto Deza, Holger Waechtler, Michael Hunold, others"); MODULE_DESCRIPTION("Driver for full TS modified DVB-S SAA7146+AV7110 " - "based so-called Budget Patch cards"); + "based so-called Budget Patch cards"); diff --git a/trunk/drivers/media/dvb/ttpci/budget.c b/trunk/drivers/media/dvb/ttpci/budget.c index fafe6407b3d0..4fd8bbc47037 100644 --- a/trunk/drivers/media/dvb/ttpci/budget.c +++ b/trunk/drivers/media/dvb/ttpci/budget.c @@ -256,7 +256,7 @@ static int alps_bsrv2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param buf[2] = ((div & 0x18000) >> 10) | 0x95; buf[3] = (pwr << 6) | 0x30; - // NOTE: since we're using a prescaler of 2, we set the + // NOTE: since we're using a prescaler of 2, we set the // divisor frequency to 62.5kHz and divide by 125 above if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; @@ -565,7 +565,7 @@ static u8 read_pwm(struct budget* budget) struct i2c_msg msg[] = { { .addr = 0x50,.flags = 0,.buf = &b,.len = 1 }, { .addr = 0x50,.flags = I2C_M_RD,.buf = &pwm,.len = 1} }; - if ((i2c_transfer(&budget->i2c_adap, msg, 2) != 2) || (pwm == 0xff)) + if ((i2c_transfer(&budget->i2c_adap, msg, 2) != 2) || (pwm == 0xff)) pwm = 0x48; return pwm; @@ -593,7 +593,7 @@ static void frontend_init(struct budget *budget) budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); if (budget->dvb_frontend) { budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_diseqc_send_master_cmd; - budget->dvb_frontend->ops->diseqc_send_burst = budget_diseqc_send_burst; + budget->dvb_frontend->ops->diseqc_send_burst = budget_diseqc_send_burst; budget->dvb_frontend->ops->set_tone = budget_set_tone; break; } @@ -738,7 +738,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); static struct saa7146_extension budget_extension = { .name = "budget dvb\0", - .flags = SAA7146_I2C_SHORT_DELAY, + .flags = 0, .module = THIS_MODULE, .pci_tbl = pci_tbl, diff --git a/trunk/drivers/media/dvb/ttpci/budget.h b/trunk/drivers/media/dvb/ttpci/budget.h index fdaa3318ad3a..c6ef496ba70a 100644 --- a/trunk/drivers/media/dvb/ttpci/budget.h +++ b/trunk/drivers/media/dvb/ttpci/budget.h @@ -19,7 +19,7 @@ extern int budget_debug; #endif #define dprintk(level,args...) \ - do { if ((budget_debug & level)) { printk("%s: %s(): ",__stringify(KBUILD_MODNAME), __FUNCTION__); printk(args); } } while (0) + do { if ((budget_debug & level)) { printk("%s: %s(): ",__stringify(KBUILD_MODNAME), __FUNCTION__); printk(args); } } while (0) struct budget_info { char *name; diff --git a/trunk/drivers/media/dvb/ttpci/fdump.c b/trunk/drivers/media/dvb/ttpci/fdump.c index c90001d35e7d..0b478db3e744 100644 --- a/trunk/drivers/media/dvb/ttpci/fdump.c +++ b/trunk/drivers/media/dvb/ttpci/fdump.c @@ -36,7 +36,7 @@ int main(int argc, char **argv) } fprintf(fd_out, "\n};\n\n"); - + fclose(fd_in); fclose(fd_out); diff --git a/trunk/drivers/media/dvb/ttpci/ttpci-eeprom.c b/trunk/drivers/media/dvb/ttpci/ttpci-eeprom.c index 18aa22b5478d..e9a8457b0727 100644 --- a/trunk/drivers/media/dvb/ttpci/ttpci-eeprom.c +++ b/trunk/drivers/media/dvb/ttpci/ttpci-eeprom.c @@ -13,7 +13,7 @@ Holger Waechtler Convergence Copyright (C) 2002-2003 Ralph Metzler - Metzler Brothers Systementwicklung GbR + Metzler Brothers Systementwicklung GbR 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 @@ -37,7 +37,6 @@ #include #include -#include "ttpci-eeprom.h" #if 1 #define dprintk(x...) do { printk(x); } while (0) @@ -48,41 +47,41 @@ static int check_mac_tt(u8 *buf) { - int i; - u16 tmp = 0xffff; - - for (i = 0; i < 8; i++) { - tmp = (tmp << 8) | ((tmp >> 8) ^ buf[i]); - tmp ^= (tmp >> 4) & 0x0f; - tmp ^= (tmp << 12) ^ ((tmp & 0xff) << 5); - } - tmp ^= 0xffff; - return (((tmp >> 8) ^ buf[8]) | ((tmp & 0xff) ^ buf[9])); + int i; + u16 tmp = 0xffff; + + for (i = 0; i < 8; i++) { + tmp = (tmp << 8) | ((tmp >> 8) ^ buf[i]); + tmp ^= (tmp >> 4) & 0x0f; + tmp ^= (tmp << 12) ^ ((tmp & 0xff) << 5); + } + tmp ^= 0xffff; + return (((tmp >> 8) ^ buf[8]) | ((tmp & 0xff) ^ buf[9])); } static int getmac_tt(u8 * decodedMAC, u8 * encodedMAC) { - u8 xor[20] = { 0x72, 0x23, 0x68, 0x19, 0x5c, 0xa8, 0x71, 0x2c, + u8 xor[20] = { 0x72, 0x23, 0x68, 0x19, 0x5c, 0xa8, 0x71, 0x2c, 0x54, 0xd3, 0x7b, 0xf1, 0x9E, 0x23, 0x16, 0xf6, 0x1d, 0x36, 0x64, 0x78}; - u8 data[20]; - int i; + u8 data[20]; + int i; /* In case there is a sig check failure have the orig contents available */ memcpy(data, encodedMAC, 20); for (i = 0; i < 20; i++) - data[i] ^= xor[i]; - for (i = 0; i < 10; i++) - data[i] = ((data[2 * i + 1] << 8) | data[2 * i]) + data[i] ^= xor[i]; + for (i = 0; i < 10; i++) + data[i] = ((data[2 * i + 1] << 8) | data[2 * i]) >> ((data[2 * i + 1] >> 6) & 3); - if (check_mac_tt(data)) - return -ENODEV; + if (check_mac_tt(data)) + return -ENODEV; decodedMAC[0] = data[2]; decodedMAC[1] = data[1]; decodedMAC[2] = data[0]; decodedMAC[3] = data[6]; decodedMAC[4] = data[5]; decodedMAC[5] = data[4]; - return 0; + return 0; } static int ttpci_eeprom_read_encodedMAC(struct i2c_adapter *adapter, u8 * encodedMAC) diff --git a/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 104df610dbe1..fd53d6010502 100644 --- a/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c @@ -225,8 +225,8 @@ static int ttusb_i2c_msg(struct ttusb *ttusb, err = ttusb_result(ttusb, b, 0x20); - /* check if the i2c transaction was successful */ - if ((snd_len != b[5]) || (rcv_len != b[6])) return -EREMOTEIO; + /* check if the i2c transaction was successful */ + if ((snd_len != b[5]) || (rcv_len != b[6])) return -EREMOTEIO; if (rcv_len > 0) { @@ -489,27 +489,27 @@ static int ttusb_send_diseqc(struct dvb_frontend* fe, static int lnbp21_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) { - struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; - int ret; - u8 data[1]; - struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = data, .len = sizeof(data) }; - - switch(voltage) { - case SEC_VOLTAGE_OFF: - data[0] = 0x00; - break; - case SEC_VOLTAGE_13: - data[0] = 0x44; - break; - case SEC_VOLTAGE_18: - data[0] = 0x4c; - break; - default: - return -EINVAL; - }; - - ret = i2c_transfer(&ttusb->i2c_adap, &msg, 1); - return (ret != 1) ? -EIO : 0; + struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; + int ret; + u8 data[1]; + struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = data, .len = sizeof(data) }; + + switch(voltage) { + case SEC_VOLTAGE_OFF: + data[0] = 0x00; + break; + case SEC_VOLTAGE_13: + data[0] = 0x44; + break; + case SEC_VOLTAGE_18: + data[0] = 0x4c; + break; + default: + return -EINVAL; + }; + + ret = i2c_transfer(&ttusb->i2c_adap, &msg, 1); + return (ret != 1) ? -EIO : 0; } static int ttusb_update_lnb(struct ttusb *ttusb) @@ -1184,45 +1184,45 @@ static struct tda1004x_config philips_tdm1316l_config = { }; static u8 alps_bsbe1_inittab[] = { - 0x01, 0x15, - 0x02, 0x30, - 0x03, 0x00, - 0x04, 0x7d, /* F22FR = 0x7d, F22 = f_VCO / 128 / 0x7d = 22 kHz */ - 0x05, 0x35, /* I2CT = 0, SCLT = 1, SDAT = 1 */ - 0x06, 0x40, /* DAC not used, set to high impendance mode */ - 0x07, 0x00, /* DAC LSB */ - 0x08, 0x40, /* DiSEqC off, LNB power on OP2/LOCK pin on */ - 0x09, 0x00, /* FIFO */ - 0x0c, 0x51, /* OP1 ctl = Normal, OP1 val = 1 (LNB Power ON) */ - 0x0d, 0x82, /* DC offset compensation = ON, beta_agc1 = 2 */ - 0x0e, 0x23, /* alpha_tmg = 2, beta_tmg = 3 */ - 0x10, 0x3f, // AGC2 0x3d - 0x11, 0x84, - 0x12, 0xb9, - 0x15, 0xc9, // lock detector threshold - 0x16, 0x00, - 0x17, 0x00, - 0x18, 0x00, - 0x19, 0x00, - 0x1a, 0x00, - 0x1f, 0x50, - 0x20, 0x00, - 0x21, 0x00, - 0x22, 0x00, - 0x23, 0x00, - 0x28, 0x00, // out imp: normal out type: parallel FEC mode:0 - 0x29, 0x1e, // 1/2 threshold - 0x2a, 0x14, // 2/3 threshold - 0x2b, 0x0f, // 3/4 threshold - 0x2c, 0x09, // 5/6 threshold - 0x2d, 0x05, // 7/8 threshold - 0x2e, 0x01, - 0x31, 0x1f, // test all FECs - 0x32, 0x19, // viterbi and synchro search - 0x33, 0xfc, // rs control - 0x34, 0x93, // error control - 0x0f, 0x92, - 0xff, 0xff + 0x01, 0x15, + 0x02, 0x30, + 0x03, 0x00, + 0x04, 0x7d, /* F22FR = 0x7d, F22 = f_VCO / 128 / 0x7d = 22 kHz */ + 0x05, 0x35, /* I2CT = 0, SCLT = 1, SDAT = 1 */ + 0x06, 0x40, /* DAC not used, set to high impendance mode */ + 0x07, 0x00, /* DAC LSB */ + 0x08, 0x40, /* DiSEqC off, LNB power on OP2/LOCK pin on */ + 0x09, 0x00, /* FIFO */ + 0x0c, 0x51, /* OP1 ctl = Normal, OP1 val = 1 (LNB Power ON) */ + 0x0d, 0x82, /* DC offset compensation = ON, beta_agc1 = 2 */ + 0x0e, 0x23, /* alpha_tmg = 2, beta_tmg = 3 */ + 0x10, 0x3f, // AGC2 0x3d + 0x11, 0x84, + 0x12, 0xb9, + 0x15, 0xc9, // lock detector threshold + 0x16, 0x00, + 0x17, 0x00, + 0x18, 0x00, + 0x19, 0x00, + 0x1a, 0x00, + 0x1f, 0x50, + 0x20, 0x00, + 0x21, 0x00, + 0x22, 0x00, + 0x23, 0x00, + 0x28, 0x00, // out imp: normal out type: parallel FEC mode:0 + 0x29, 0x1e, // 1/2 threshold + 0x2a, 0x14, // 2/3 threshold + 0x2b, 0x0f, // 3/4 threshold + 0x2c, 0x09, // 5/6 threshold + 0x2d, 0x05, // 7/8 threshold + 0x2e, 0x01, + 0x31, 0x1f, // test all FECs + 0x32, 0x19, // viterbi and synchro search + 0x33, 0xfc, // rs control + 0x34, 0x93, // error control + 0x0f, 0x92, + 0xff, 0xff }; static u8 alps_bsru6_inittab[] = { @@ -1350,7 +1350,7 @@ static int ttusb_novas_grundig_29504_491_pll_set(struct dvb_frontend *fe, struct u32 div; struct i2c_msg msg = {.addr = 0x61,.flags = 0,.buf = buf,.len = sizeof(buf) }; - div = params->frequency / 125; + div = params->frequency / 125; buf[0] = (div >> 8) & 0x7f; buf[1] = div & 0xff; @@ -1487,7 +1487,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i udev = interface_to_usbdev(intf); - if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV; + if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV; if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL))) return -ENOMEM; diff --git a/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-dspbootcode.h b/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-dspbootcode.h index 8c3cd545e8f4..95ee7995455e 100644 --- a/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-dspbootcode.h +++ b/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-dspbootcode.h @@ -2,1643 +2,1643 @@ #include static u8 dsp_bootcode [] = { - 0x08, 0xaa, 0x00, 0x18, 0x00, 0x03, 0x08, 0x00, - 0x00, 0x10, 0x00, 0x00, 0x01, 0x80, 0x18, 0x5f, - 0x00, 0x00, 0x01, 0x80, 0x77, 0x18, 0x2a, 0xeb, - 0x6b, 0xf8, 0x00, 0x18, 0x03, 0xff, 0x68, 0xf8, - 0x00, 0x18, 0xff, 0xfe, 0xf7, 0xb8, 0xf7, 0xbe, - 0xf6, 0xb9, 0xf4, 0xa0, 0xf6, 0xb7, 0xf6, 0xb5, - 0xf6, 0xb6, 0xf0, 0x20, 0x19, 0xdf, 0xf1, 0x00, - 0x00, 0x01, 0xf8, 0x4d, 0x01, 0xab, 0xf6, 0xb8, - 0xf0, 0x20, 0x19, 0xdf, 0xf0, 0x73, 0x01, 0xa5, - 0x7e, 0xf8, 0x00, 0x12, 0xf0, 0x00, 0x00, 0x01, - 0x47, 0xf8, 0x00, 0x11, 0x7e, 0x92, 0x00, 0xf8, - 0x00, 0x11, 0xf0, 0x00, 0x00, 0x01, 0x7e, 0xf8, - 0x00, 0x11, 0xf0, 0x00, 0x00, 0x01, 0x6c, 0x89, - 0x01, 0x9a, 0xf7, 0xb8, 0xee, 0xfc, 0xf0, 0x20, - 0xff, 0xff, 0xf1, 0x00, 0x00, 0x01, 0xf8, 0x4d, - 0x01, 0xbf, 0xf2, 0x73, 0x01, 0xb9, 0x4e, 0x02, - 0xf4, 0x95, 0xf5, 0xe3, 0x56, 0x02, 0x7e, 0x00, - 0x11, 0x00, 0xfa, 0x4c, 0x01, 0xb7, 0x6b, 0x03, - 0x00, 0x01, 0xf6, 0xb8, 0xee, 0x04, 0xf0, 0x74, - 0x0d, 0xa7, 0xf0, 0x74, 0x01, 0xc5, 0x4a, 0x11, - 0x4a, 0x16, 0x72, 0x11, 0x2a, 0xe6, 0x10, 0xf8, - 0x00, 0x11, 0xfa, 0x45, 0x01, 0xdb, 0xf4, 0x95, - 0xee, 0xff, 0x48, 0x11, 0xf0, 0x00, 0x2a, 0xc6, - 0x88, 0x16, 0xf4, 0x95, 0xf4, 0x95, 0x10, 0xee, - 0xff, 0xff, 0xf4, 0xe3, 0x6c, 0xe9, 0xff, 0xff, - 0x01, 0xd5, 0x10, 0xf8, 0x2a, 0xe7, 0xf8, 0x45, - 0x01, 0xe2, 0x10, 0xf8, 0x2a, 0xe7, 0xf4, 0xe3, - 0xf0, 0x74, 0x01, 0xff, 0xee, 0x01, 0x8a, 0x16, - 0x8a, 0x11, 0xfc, 0x00, 0xf7, 0xb8, 0xe9, 0x20, - 0x4a, 0x11, 0x09, 0xf8, 0x2a, 0xe6, 0xf8, 0x4e, - 0x01, 0xf3, 0xf2, 0x73, 0x01, 0xfd, 0xf4, 0x95, - 0xe8, 0x01, 0x72, 0x11, 0x2a, 0xe6, 0x49, 0x11, - 0x80, 0xe1, 0x2a, 0xc6, 0xf3, 0x00, 0x00, 0x01, - 0xe8, 0x00, 0x81, 0xf8, 0x2a, 0xe6, 0x8a, 0x11, - 0xfc, 0x00, 0xf4, 0x95, 0xf0, 0x73, 0x02, 0x00, - 0x10, 0xf8, 0x2a, 0x0f, 0xfc, 0x00, 0x4a, 0x11, - 0xf0, 0x74, 0x02, 0x02, 0x80, 0xf8, 0x2a, 0x10, - 0x73, 0x08, 0x00, 0x09, 0x40, 0xf8, 0x2a, 0x15, - 0x82, 0xf8, 0x00, 0x11, 0xf4, 0x95, 0x77, 0x10, - 0x03, 0xe8, 0xf5, 0xa9, 0xf8, 0x30, 0x02, 0x21, - 0x71, 0xf8, 0x2a, 0x10, 0x2a, 0x15, 0x56, 0xf8, - 0x2a, 0x0c, 0xf0, 0xe3, 0x4e, 0xf8, 0x2a, 0x16, - 0xe8, 0x00, 0x4e, 0xf8, 0x2a, 0x0c, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x06, 0x4a, 0x07, 0x4a, 0x1d, - 0x68, 0xf8, 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, - 0x00, 0x07, 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, - 0xff, 0xfc, 0x6b, 0xf8, 0x2a, 0x0f, 0x00, 0x01, - 0x8a, 0x1d, 0x8a, 0x07, 0x8a, 0x06, 0xf4, 0xeb, - 0xee, 0xfd, 0x76, 0xf8, 0x2a, 0x0f, 0x00, 0x00, - 0x76, 0x00, 0x00, 0x00, 0xfb, 0x80, 0x19, 0x4c, - 0xf4, 0x95, 0xe8, 0x00, 0x80, 0xf8, 0x2a, 0x11, - 0xf9, 0x80, 0x19, 0x07, 0x80, 0xf8, 0x2a, 0x0e, - 0xf9, 0x80, 0x16, 0x66, 0x76, 0x00, 0x2a, 0x12, - 0x10, 0xf8, 0x2a, 0x11, 0xf9, 0x80, 0x18, 0xe3, - 0x10, 0xf8, 0x2a, 0x0e, 0xf9, 0x80, 0x16, 0x66, - 0x10, 0xf8, 0x2a, 0x0e, 0xf9, 0x80, 0x16, 0x87, - 0xee, 0x03, 0xfc, 0x00, 0x4a, 0x11, 0xf6, 0xb8, - 0xf4, 0x95, 0xf0, 0x20, 0x80, 0x00, 0x11, 0xf8, - 0x2a, 0x5a, 0xf8, 0x4d, 0x02, 0x93, 0x11, 0xf8, - 0x2a, 0x9f, 0xf8, 0x4c, 0x02, 0x7c, 0x77, 0x12, - 0x2a, 0x39, 0x49, 0x12, 0x01, 0xf8, 0x2a, 0x9f, - 0x89, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x71, 0x81, - 0x00, 0x11, 0x6c, 0xe1, 0xff, 0xab, 0x02, 0x93, - 0x6b, 0xf8, 0x2a, 0x9f, 0x00, 0x01, 0xe9, 0x05, - 0x01, 0xe2, 0x00, 0x03, 0x81, 0xf8, 0x2a, 0xa0, - 0xf0, 0x73, 0x02, 0x95, 0x72, 0x11, 0x2a, 0x9f, - 0xf4, 0x95, 0x10, 0xe1, 0x2a, 0x39, 0x6b, 0xf8, - 0x2a, 0x9f, 0x00, 0x01, 0x11, 0xf8, 0x2a, 0x9f, - 0x09, 0xf8, 0x2a, 0xa0, 0xf8, 0x4c, 0x02, 0x93, - 0x76, 0xf8, 0x2a, 0x5a, 0x00, 0x00, 0x76, 0xf8, - 0x2a, 0x9f, 0x00, 0x00, 0x76, 0xf8, 0x2a, 0xa0, - 0x00, 0x00, 0x88, 0x11, 0xf4, 0x95, 0x48, 0x11, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, - 0x10, 0xf8, 0x2a, 0x5a, 0xf8, 0x44, 0x02, 0xb2, - 0x76, 0xf8, 0x2a, 0x5a, 0x00, 0x01, 0xf0, 0x74, - 0x02, 0x58, 0x88, 0x11, 0xf4, 0x95, 0x77, 0x10, - 0x80, 0x00, 0xf4, 0xa9, 0xf8, 0x30, 0x02, 0xb2, - 0x48, 0x11, 0xf0, 0x30, 0x00, 0xff, 0x80, 0x00, - 0x10, 0xf8, 0x2a, 0x5b, 0xf9, 0x80, 0x18, 0xd6, - 0xee, 0x02, 0x8a, 0x11, 0xfc, 0x00, 0xf4, 0x95, - 0x4a, 0x08, 0x4a, 0x09, 0x4a, 0x0a, 0x4a, 0x0b, - 0x4a, 0x0c, 0x4a, 0x0d, 0x4a, 0x10, 0x4a, 0x11, - 0x4a, 0x12, 0x4a, 0x13, 0x4a, 0x14, 0x4a, 0x15, - 0x4a, 0x16, 0x4a, 0x17, 0x4a, 0x17, 0x4a, 0x19, - 0x4a, 0x0e, 0x4a, 0x06, 0x4a, 0x07, 0x4a, 0x1a, - 0x4a, 0x1d, 0x4a, 0x1b, 0x4a, 0x1c, 0x68, 0xf8, - 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, 0x00, 0x07, - 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, 0xff, 0xfc, - 0x48, 0x18, 0x68, 0xf8, 0x00, 0x18, 0xff, 0xfe, - 0xf4, 0x95, 0xf4, 0x95, 0x4a, 0x08, 0xee, 0xfd, - 0xf0, 0x74, 0x02, 0x58, 0x88, 0x11, 0xf4, 0x95, - 0x77, 0x10, 0x80, 0x00, 0xf4, 0xa9, 0xf8, 0x30, - 0x02, 0xef, 0x48, 0x11, 0xf0, 0x30, 0x00, 0xff, - 0x80, 0x00, 0x10, 0xf8, 0x2a, 0x5b, 0xf9, 0x80, - 0x18, 0xd6, 0xee, 0x03, 0x8a, 0x18, 0xf4, 0x95, - 0x8a, 0x1c, 0x8a, 0x1b, 0x8a, 0x1d, 0x8a, 0x1a, - 0x8a, 0x07, 0x8a, 0x06, 0x8a, 0x0e, 0x8a, 0x19, - 0x8a, 0x17, 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x15, - 0x8a, 0x14, 0x8a, 0x13, 0x8a, 0x12, 0x8a, 0x11, - 0x8a, 0x10, 0x8a, 0x0d, 0x8a, 0x0c, 0x8a, 0x0b, - 0x8a, 0x0a, 0x8a, 0x09, 0x8a, 0x08, 0xf4, 0xeb, - 0x4a, 0x11, 0x77, 0x11, 0x2a, 0x39, 0x76, 0x81, - 0x00, 0x55, 0x77, 0x12, 0x2a, 0x18, 0x10, 0xe2, - 0x00, 0x01, 0x80, 0xe1, 0x00, 0x01, 0x10, 0xe2, - 0x00, 0x02, 0x80, 0xe1, 0x00, 0x02, 0x76, 0xe1, - 0x00, 0x03, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x04, - 0x00, 0xaa, 0xf0, 0x74, 0x02, 0x98, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0x88, 0x11, 0xf4, 0x95, - 0xf4, 0x95, 0x10, 0x81, 0x6f, 0xf8, 0x2a, 0x9e, - 0x0c, 0x88, 0xe8, 0xff, 0x18, 0xe1, 0x00, 0x01, - 0x1a, 0xf8, 0x2a, 0x9e, 0xf0, 0x30, 0x1f, 0xff, - 0x80, 0xf8, 0x2a, 0x9e, 0x8a, 0x11, 0xfc, 0x00, - 0x4a, 0x11, 0x77, 0x11, 0x2a, 0x39, 0x76, 0x81, - 0x00, 0x55, 0x77, 0x12, 0x2a, 0x18, 0x11, 0xe2, - 0x00, 0x01, 0x81, 0xe1, 0x00, 0x01, 0x11, 0xe2, - 0x00, 0x02, 0x81, 0xe1, 0x00, 0x02, 0x76, 0xe1, - 0x00, 0x03, 0x00, 0x02, 0x48, 0x08, 0x6f, 0xe1, - 0x00, 0x04, 0x0c, 0x98, 0xf0, 0x30, 0x00, 0xff, - 0x80, 0xe1, 0x00, 0x05, 0x76, 0xe1, 0x00, 0x06, - 0x00, 0xaa, 0xf0, 0x74, 0x02, 0x98, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0x77, 0x11, 0x2a, 0x39, - 0x76, 0x81, 0x00, 0x55, 0x77, 0x12, 0x2a, 0x18, - 0x10, 0xe2, 0x00, 0x01, 0x80, 0xe1, 0x00, 0x01, - 0x10, 0xe2, 0x00, 0x02, 0x80, 0xe1, 0x00, 0x02, - 0x76, 0xe1, 0x00, 0x03, 0x00, 0x04, 0x48, 0x11, - 0xf0, 0x00, 0x00, 0x04, 0x88, 0x12, 0xf4, 0x95, - 0x77, 0x13, 0x2a, 0x76, 0xe9, 0x00, 0xe5, 0x98, - 0xf3, 0x00, 0x00, 0x01, 0xf6, 0xb8, 0x48, 0x0b, - 0x08, 0xf8, 0x2a, 0x3c, 0xf8, 0x43, 0x03, 0x71, - 0x76, 0x82, 0x00, 0xaa, 0xf0, 0x74, 0x02, 0x98, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xf0, - 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x71, 0x81, - 0x00, 0x14, 0x71, 0xe1, 0x00, 0x01, 0x00, 0x15, - 0x49, 0x11, 0xf3, 0x00, 0x00, 0x02, 0x89, 0x11, - 0xe7, 0x82, 0x6d, 0xea, 0x00, 0x04, 0xe7, 0x83, - 0x6d, 0xeb, 0x00, 0x0a, 0x77, 0x1a, 0x00, 0x05, - 0xf0, 0x72, 0x03, 0xaa, 0x11, 0x81, 0xf2, 0xe8, - 0x80, 0x82, 0xe9, 0xff, 0x19, 0xe1, 0x00, 0x01, - 0xf1, 0xa0, 0x81, 0x92, 0x11, 0xe1, 0x00, 0x0c, - 0xf2, 0xe8, 0x80, 0x83, 0xe9, 0xff, 0x19, 0xe1, - 0x00, 0x0d, 0xf1, 0xa0, 0x81, 0x93, 0x6d, 0xe9, - 0x00, 0x02, 0x48, 0x18, 0x49, 0x18, 0x70, 0x00, - 0x00, 0x15, 0xf0, 0x00, 0x00, 0x04, 0xf3, 0x00, - 0x00, 0x0a, 0x80, 0x01, 0x81, 0x02, 0xf2, 0x74, - 0x0e, 0x54, 0xf4, 0x95, 0x48, 0x14, 0xee, 0x10, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xf0, 0x74, - 0x0c, 0x5e, 0x80, 0xf8, 0x2a, 0x5c, 0x77, 0x12, - 0x2a, 0x39, 0x76, 0x82, 0x00, 0x55, 0x77, 0x11, - 0x2a, 0x18, 0x10, 0xe1, 0x00, 0x01, 0x80, 0xe2, - 0x00, 0x01, 0x10, 0xe1, 0x00, 0x02, 0x80, 0xe2, - 0x00, 0x02, 0x76, 0xe2, 0x00, 0x03, 0x00, 0x1c, - 0xf6, 0xb8, 0x56, 0xf8, 0x2a, 0x16, 0xf0, 0xf0, - 0xf0, 0xf8, 0x80, 0xe2, 0x00, 0x07, 0x56, 0xf8, - 0x2a, 0x16, 0xf1, 0xf0, 0xe8, 0xff, 0xf2, 0x80, - 0x80, 0xe2, 0x00, 0x06, 0x56, 0xf8, 0x2a, 0x16, - 0xf1, 0xf8, 0xe8, 0xff, 0xf2, 0x80, 0x80, 0xe2, - 0x00, 0x05, 0x57, 0xf8, 0x2a, 0x16, 0xe8, 0xff, - 0xf2, 0x80, 0x80, 0xe2, 0x00, 0x04, 0x56, 0xf8, - 0x27, 0x6c, 0xf0, 0xf0, 0xf0, 0xf8, 0x80, 0xe2, - 0x00, 0x0b, 0x56, 0xf8, 0x27, 0x6c, 0xf1, 0xf0, - 0xe8, 0xff, 0xf2, 0x80, 0x80, 0xe2, 0x00, 0x0a, - 0x56, 0xf8, 0x27, 0x6c, 0xf1, 0xf8, 0xe8, 0xff, - 0xf2, 0x80, 0x80, 0xe2, 0x00, 0x09, 0xe8, 0xff, - 0x57, 0xf8, 0x27, 0x6c, 0xf2, 0x80, 0x80, 0xe2, - 0x00, 0x08, 0x56, 0xf8, 0x27, 0x6a, 0xf0, 0xf0, - 0xf0, 0xf8, 0x80, 0xe2, 0x00, 0x0f, 0x56, 0xf8, - 0x27, 0x6a, 0xf1, 0xf0, 0xe8, 0xff, 0xf2, 0x80, - 0x80, 0xe2, 0x00, 0x0e, 0x56, 0xf8, 0x27, 0x6a, - 0xf1, 0xf8, 0xe8, 0xff, 0xf2, 0x80, 0x80, 0xe2, - 0x00, 0x0d, 0x57, 0xf8, 0x27, 0x6a, 0xe8, 0xff, - 0xf2, 0x80, 0x80, 0xe2, 0x00, 0x0c, 0x76, 0xe2, - 0x00, 0x13, 0x00, 0x00, 0x76, 0xe2, 0x00, 0x12, - 0x00, 0x00, 0x6f, 0xf8, 0x2a, 0x5c, 0x0c, 0x58, - 0x80, 0xe2, 0x00, 0x11, 0xe8, 0xff, 0x18, 0xf8, - 0x2a, 0x5c, 0x80, 0xe2, 0x00, 0x10, 0x76, 0xe2, - 0x00, 0x17, 0x00, 0x00, 0x76, 0xe2, 0x00, 0x16, - 0x00, 0x00, 0x6f, 0xf8, 0x2a, 0x9e, 0x0c, 0x58, - 0x80, 0xe2, 0x00, 0x15, 0xe8, 0xff, 0x18, 0xf8, - 0x2a, 0x9e, 0x80, 0xe2, 0x00, 0x14, 0x76, 0xe2, - 0x00, 0x1b, 0x00, 0x00, 0x76, 0xe2, 0x00, 0x1a, - 0x00, 0x00, 0x76, 0xe2, 0x00, 0x19, 0x00, 0x00, - 0x70, 0xe2, 0x00, 0x18, 0x27, 0x6e, 0x76, 0xe2, - 0x00, 0x1f, 0x00, 0x00, 0x76, 0xe2, 0x00, 0x1e, - 0x00, 0x00, 0x76, 0xe2, 0x00, 0x1d, 0x00, 0x00, - 0x76, 0xe2, 0x00, 0x1c, 0x00, 0x00, 0x76, 0xe2, - 0x00, 0x20, 0x00, 0xaa, 0xf0, 0x74, 0x02, 0x98, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, - 0x10, 0xf8, 0x2a, 0x38, 0xf8, 0x45, 0x04, 0xed, - 0x77, 0x12, 0x2a, 0x18, 0x10, 0xe2, 0x00, 0x02, - 0x88, 0x11, 0xf4, 0x95, 0x77, 0x10, 0x00, 0x08, - 0x6d, 0xe9, 0xff, 0xdf, 0xf6, 0xa9, 0xf8, 0x20, - 0x04, 0x75, 0xf0, 0x73, 0x04, 0x7d, 0xf0, 0x10, - 0x00, 0x21, 0xf0, 0x00, 0x1a, 0x83, 0x48, 0x08, - 0x7e, 0xf8, 0x00, 0x08, 0xf4, 0xe2, 0xf0, 0x74, - 0x03, 0x0a, 0xf0, 0x73, 0x04, 0xea, 0x48, 0x12, - 0xf2, 0x74, 0x03, 0x23, 0xf0, 0x00, 0x00, 0x04, - 0xf2, 0x74, 0x03, 0x36, 0xf4, 0x95, 0xe8, 0x00, - 0xf0, 0x73, 0x04, 0xea, 0x77, 0x11, 0x2a, 0x18, - 0xe8, 0xff, 0x6f, 0xe1, 0x00, 0x04, 0x0d, 0x48, - 0x18, 0xe1, 0x00, 0x05, 0xf2, 0x74, 0x09, 0x69, - 0xf4, 0x95, 0xf2, 0xa0, 0xf0, 0x74, 0x03, 0x36, - 0xf0, 0x73, 0x04, 0xea, 0x77, 0x11, 0x2a, 0x18, - 0xe8, 0xff, 0x6f, 0xe1, 0x00, 0x04, 0x0d, 0x48, - 0x18, 0xe1, 0x00, 0x05, 0xf2, 0x74, 0x09, 0x41, - 0xf4, 0x95, 0xf2, 0xa0, 0xf0, 0x74, 0x03, 0x36, - 0xf0, 0x73, 0x04, 0xea, 0xf0, 0x74, 0x03, 0x57, - 0xf0, 0x73, 0x04, 0xea, 0x10, 0xf8, 0x2a, 0x1c, - 0xf0, 0x74, 0x12, 0xa4, 0xf2, 0x74, 0x03, 0x36, - 0xf4, 0x95, 0xe8, 0x00, 0xf0, 0x73, 0x04, 0xea, - 0x48, 0x12, 0xf2, 0x74, 0x03, 0x80, 0xf0, 0x00, - 0x00, 0x04, 0xf2, 0x74, 0x03, 0x36, 0xf4, 0x95, - 0xe8, 0x00, 0xf0, 0x73, 0x04, 0xea, 0x10, 0xf8, - 0x2a, 0x1c, 0xf0, 0x74, 0x12, 0xc5, 0xf2, 0x74, - 0x03, 0x36, 0xf4, 0x95, 0xe8, 0x00, 0xf0, 0x73, - 0x04, 0xea, 0x77, 0x11, 0x2a, 0x18, 0xe8, 0xff, - 0x6f, 0xe1, 0x00, 0x06, 0x0d, 0x48, 0x18, 0xe1, - 0x00, 0x07, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0xf2, 0xa0, 0x70, 0x00, 0x00, 0x12, 0x80, 0x01, - 0x10, 0xe1, 0x00, 0x04, 0xf0, 0x74, 0x0e, 0x7a, - 0xf2, 0x74, 0x03, 0x36, 0xf4, 0x95, 0xe8, 0x00, - 0xf0, 0x73, 0x04, 0xea, 0xf0, 0x74, 0x03, 0xbc, - 0x76, 0xf8, 0x2a, 0x38, 0x00, 0x00, 0xee, 0x02, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x77, 0x11, - 0x2a, 0x39, 0x76, 0x81, 0x00, 0x55, 0x77, 0x12, - 0x2a, 0x18, 0x10, 0xe2, 0x00, 0x01, 0x80, 0xe1, - 0x00, 0x01, 0x10, 0xe2, 0x00, 0x02, 0x80, 0xe1, - 0x00, 0x02, 0x76, 0xe1, 0x00, 0x03, 0x00, 0x09, - 0x48, 0x11, 0xf0, 0x00, 0x00, 0x04, 0x88, 0x12, - 0xf4, 0x95, 0x77, 0x13, 0x2a, 0x86, 0xe9, 0x00, - 0xe5, 0x98, 0xf3, 0x00, 0x00, 0x01, 0xf6, 0xb8, - 0x48, 0x0b, 0x08, 0xf8, 0x2a, 0x3c, 0xf8, 0x43, - 0x05, 0x0a, 0x76, 0x82, 0x00, 0xaa, 0xf0, 0x74, - 0x02, 0x98, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, - 0x77, 0x11, 0x2a, 0x39, 0x76, 0x81, 0x00, 0x55, - 0x77, 0x13, 0x2a, 0x18, 0x10, 0xe3, 0x00, 0x01, - 0x80, 0xe1, 0x00, 0x01, 0x10, 0xe3, 0x00, 0x02, - 0x80, 0xe1, 0x00, 0x02, 0x13, 0xe3, 0x00, 0x03, - 0x81, 0xe1, 0x00, 0x03, 0x48, 0x11, 0x77, 0x11, - 0x00, 0x00, 0xf8, 0x4d, 0x05, 0x44, 0xf0, 0x00, - 0x00, 0x04, 0x88, 0x12, 0x48, 0x13, 0xf0, 0x00, - 0x00, 0x04, 0x88, 0x13, 0xf4, 0x95, 0xf4, 0x95, - 0xe5, 0x98, 0x6d, 0x91, 0xf6, 0xb8, 0x48, 0x11, - 0x08, 0xf8, 0x2a, 0x3c, 0xf8, 0x43, 0x05, 0x3a, - 0xf0, 0x20, 0x2a, 0x39, 0x49, 0x11, 0xf5, 0x00, - 0x89, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x76, 0xe1, - 0x00, 0x04, 0x00, 0xaa, 0xf0, 0x74, 0x02, 0x98, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x77, 0x11, - 0x2a, 0x39, 0x76, 0x81, 0x00, 0x55, 0x77, 0x12, - 0x2a, 0x18, 0x10, 0xe2, 0x00, 0x01, 0x80, 0xe1, - 0x00, 0x01, 0x10, 0xe2, 0x00, 0x02, 0x80, 0xe1, - 0x00, 0x02, 0x76, 0xe1, 0x00, 0x03, 0x00, 0x0c, - 0x48, 0x11, 0xf0, 0x00, 0x00, 0x04, 0x88, 0x12, - 0xf4, 0x95, 0x77, 0x13, 0x2a, 0x7a, 0xe9, 0x00, - 0xe5, 0x98, 0xf3, 0x00, 0x00, 0x01, 0xf6, 0xb8, - 0x48, 0x0b, 0x08, 0xf8, 0x2a, 0x3c, 0xf8, 0x43, - 0x05, 0x6a, 0x76, 0x82, 0x00, 0xaa, 0xf0, 0x74, - 0x02, 0x98, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, - 0x77, 0x11, 0x2a, 0x39, 0x76, 0x81, 0x00, 0x55, - 0x77, 0x12, 0x2a, 0x18, 0x10, 0xe2, 0x00, 0x01, - 0x80, 0xe1, 0x00, 0x01, 0x10, 0xe2, 0x00, 0x02, - 0x80, 0xe1, 0x00, 0x02, 0x76, 0xe1, 0x00, 0x03, - 0x00, 0x19, 0x48, 0x11, 0xf0, 0x00, 0x00, 0x04, - 0x88, 0x12, 0xf4, 0x95, 0x77, 0x13, 0x2a, 0x5d, - 0xe9, 0x00, 0xe5, 0x98, 0xf3, 0x00, 0x00, 0x01, - 0xf6, 0xb8, 0x48, 0x0b, 0x08, 0xf8, 0x2a, 0x3c, - 0xf8, 0x43, 0x05, 0x93, 0x76, 0x82, 0x00, 0xaa, - 0xf0, 0x74, 0x02, 0x98, 0x8a, 0x11, 0xfc, 0x00, - 0x4a, 0x11, 0x88, 0x11, 0x10, 0xf8, 0x2a, 0x38, - 0xf8, 0x44, 0x05, 0xe3, 0x10, 0xf8, 0x2a, 0xa1, - 0xf8, 0x44, 0x05, 0xba, 0x6c, 0xe1, 0xff, 0x56, - 0x05, 0xe3, 0x72, 0x12, 0x2a, 0xa1, 0xf4, 0x95, - 0x70, 0xe2, 0x2a, 0x18, 0x00, 0x11, 0x6b, 0xf8, - 0x2a, 0xa1, 0x00, 0x01, 0xf0, 0x73, 0x05, 0xe3, - 0x72, 0x12, 0x2a, 0xa1, 0xf4, 0x95, 0x70, 0xe2, - 0x2a, 0x18, 0x00, 0x11, 0x10, 0xf8, 0x2a, 0xa1, - 0xf0, 0x00, 0x00, 0x01, 0x88, 0x12, 0xf4, 0x95, - 0xf4, 0x95, 0x6e, 0xe2, 0xff, 0xfc, 0x05, 0xd1, - 0x73, 0x12, 0x2a, 0xa1, 0x48, 0x11, 0xf0, 0x00, - 0x00, 0x05, 0x80, 0xf8, 0x2a, 0xa2, 0x10, 0xf8, - 0x2a, 0xa1, 0x08, 0xf8, 0x2a, 0xa2, 0xf8, 0x44, - 0x05, 0xe3, 0x6c, 0xe1, 0xff, 0xab, 0x05, 0xdd, - 0x76, 0xf8, 0x2a, 0x38, 0x00, 0x01, 0x76, 0xf8, - 0x2a, 0xa1, 0x00, 0x00, 0x76, 0xf8, 0x2a, 0xa2, - 0x00, 0x00, 0x8a, 0x11, 0xfc, 0x00, 0xf4, 0x95, - 0x4a, 0x08, 0x4a, 0x09, 0x4a, 0x0a, 0x4a, 0x0b, - 0x4a, 0x0c, 0x4a, 0x0d, 0x4a, 0x10, 0x4a, 0x11, - 0x4a, 0x12, 0x4a, 0x13, 0x4a, 0x14, 0x4a, 0x15, - 0x4a, 0x16, 0x4a, 0x17, 0x4a, 0x17, 0x4a, 0x19, - 0x4a, 0x0e, 0x4a, 0x06, 0x4a, 0x07, 0x4a, 0x1a, - 0x4a, 0x1d, 0x4a, 0x1b, 0x4a, 0x1c, 0x68, 0xf8, - 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, 0x00, 0x07, - 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, 0xff, 0xfc, - 0x48, 0x18, 0x68, 0xf8, 0x00, 0x18, 0xff, 0xfe, - 0xf4, 0x95, 0xf4, 0x95, 0x4a, 0x08, 0xee, 0xff, - 0x10, 0xf8, 0x2a, 0x5b, 0xf9, 0x80, 0x18, 0x04, - 0xf0, 0x74, 0x05, 0xa2, 0xee, 0x01, 0x8a, 0x18, - 0xf4, 0x95, 0x8a, 0x1c, 0x8a, 0x1b, 0x8a, 0x1d, - 0x8a, 0x1a, 0x8a, 0x07, 0x8a, 0x06, 0x8a, 0x0e, - 0x8a, 0x19, 0x8a, 0x17, 0x8a, 0x17, 0x8a, 0x16, - 0x8a, 0x15, 0x8a, 0x14, 0x8a, 0x13, 0x8a, 0x12, - 0x8a, 0x11, 0x8a, 0x10, 0x8a, 0x0d, 0x8a, 0x0c, - 0x8a, 0x0b, 0x8a, 0x0a, 0x8a, 0x09, 0x8a, 0x08, - 0xf4, 0xeb, 0xee, 0xfd, 0x76, 0xf8, 0x2a, 0x38, - 0x00, 0x00, 0x76, 0xf8, 0x2a, 0x5a, 0x00, 0x00, - 0xe8, 0x01, 0x4e, 0x00, 0xfb, 0x80, 0x17, 0xd6, - 0xf4, 0x95, 0xe8, 0x01, 0x80, 0xf8, 0x2a, 0x5b, - 0x76, 0x00, 0x2a, 0x8f, 0xf9, 0x80, 0x16, 0xaa, - 0x10, 0xf8, 0x2a, 0x5b, 0xf9, 0x80, 0x17, 0x5c, - 0x10, 0xf8, 0x2a, 0x5b, 0xf9, 0x80, 0x17, 0x6f, - 0xfb, 0x80, 0x16, 0x66, 0xf4, 0x95, 0xe8, 0x1a, - 0xfb, 0x80, 0x16, 0x87, 0xf4, 0x95, 0xe8, 0x1a, - 0xfb, 0x80, 0x16, 0x66, 0xf4, 0x95, 0xe8, 0x1b, - 0xfb, 0x80, 0x16, 0x87, 0xf4, 0x95, 0xe8, 0x1b, - 0xee, 0x03, 0xfc, 0x00, 0x4a, 0x11, 0xf4, 0x95, - 0x13, 0x02, 0x88, 0x11, 0xe8, 0x00, 0xf8, 0x4d, - 0x06, 0x6a, 0xf3, 0x10, 0x00, 0x01, 0x89, 0x1a, - 0xf4, 0x95, 0xf0, 0x72, 0x06, 0x69, 0x1c, 0x91, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x88, 0x11, - 0x12, 0x03, 0x11, 0x02, 0xf8, 0x45, 0x06, 0x79, - 0xf0, 0x10, 0x00, 0x01, 0x88, 0x1a, 0xf4, 0x95, - 0xf0, 0x72, 0x06, 0x78, 0x81, 0x91, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0xf4, 0x95, 0x71, 0x02, - 0x00, 0x11, 0x11, 0x03, 0x61, 0xf8, 0x00, 0x11, - 0x00, 0x01, 0xf8, 0x30, 0x06, 0x91, 0xf6, 0xb8, - 0x6f, 0xf8, 0x00, 0x11, 0x0c, 0x1f, 0x88, 0x11, - 0xf3, 0xe8, 0xe8, 0xff, 0x18, 0x81, 0xf1, 0xa0, - 0x81, 0x81, 0xf0, 0x73, 0x06, 0x9d, 0xf6, 0xb8, - 0x6f, 0xf8, 0x00, 0x11, 0x0c, 0x1f, 0x88, 0x11, - 0xf3, 0x30, 0x00, 0xff, 0xf0, 0x20, 0xff, 0x00, - 0x18, 0x81, 0xf1, 0xa0, 0x81, 0x81, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0xf4, 0x95, 0x11, 0x02, - 0x61, 0xf8, 0x00, 0x0b, 0x00, 0x01, 0xf8, 0x20, - 0x06, 0xb1, 0x49, 0x0b, 0xf6, 0x1f, 0x88, 0x11, - 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, 0xf2, 0x73, - 0x06, 0xb8, 0xf0, 0x30, 0x00, 0xff, 0x49, 0x0b, - 0xf6, 0x1f, 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, - 0x12, 0x81, 0xf4, 0x78, 0x8a, 0x11, 0xfc, 0x00, - 0x4a, 0x11, 0xf4, 0x95, 0x71, 0x02, 0x00, 0x12, - 0x13, 0x03, 0x88, 0x11, 0xe8, 0x00, 0xf8, 0x4d, - 0x06, 0xcc, 0xf3, 0x10, 0x00, 0x01, 0x89, 0x1a, - 0xf4, 0x95, 0xf0, 0x72, 0x06, 0xcb, 0x11, 0x92, - 0xf2, 0xc0, 0x81, 0x91, 0x8a, 0x11, 0xfc, 0x00, - 0x88, 0x12, 0x12, 0x02, 0x71, 0x01, 0x00, 0x13, - 0xf8, 0x45, 0x06, 0xdb, 0xf0, 0x10, 0x00, 0x01, - 0x88, 0x1a, 0xf4, 0x95, 0xf0, 0x72, 0x06, 0xda, - 0xe5, 0x98, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, - 0x88, 0x11, 0x11, 0x04, 0x10, 0x06, 0x71, 0x05, - 0x00, 0x12, 0x61, 0xf8, 0x00, 0x12, 0x00, 0x01, - 0xf8, 0x20, 0x06, 0xea, 0xf0, 0x00, 0x00, 0x01, - 0xf6, 0xb8, 0xf0, 0x00, 0x00, 0x01, 0x6f, 0xf8, - 0x00, 0x12, 0x0f, 0x1f, 0x48, 0x08, 0x81, 0x00, - 0xf4, 0x7f, 0x80, 0x01, 0xf2, 0x74, 0x06, 0xba, - 0xf4, 0x95, 0x48, 0x11, 0xee, 0x02, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, 0x88, 0x12, - 0x11, 0x04, 0x10, 0x06, 0x71, 0x05, 0x00, 0x13, - 0x61, 0xf8, 0x00, 0x13, 0x00, 0x01, 0xf8, 0x20, - 0x07, 0x09, 0xf0, 0x00, 0x00, 0x01, 0xf0, 0x00, - 0x00, 0x01, 0x88, 0x11, 0xf6, 0xb8, 0x6f, 0xf8, - 0x00, 0x13, 0x0f, 0x1f, 0x81, 0x00, 0x48, 0x11, - 0xf4, 0x7f, 0x80, 0x01, 0xf2, 0x74, 0x06, 0xce, - 0xf4, 0x95, 0x48, 0x12, 0x48, 0x11, 0xf0, 0x30, - 0xff, 0xfe, 0xee, 0x02, 0x8a, 0x11, 0xfc, 0x00, - 0x4a, 0x11, 0x4a, 0x16, 0x4a, 0x17, 0xee, 0xfc, - 0xf4, 0x95, 0x80, 0x02, 0x71, 0x08, 0x00, 0x16, - 0x10, 0x09, 0x71, 0x0b, 0x00, 0x17, 0x80, 0x03, - 0x71, 0x0a, 0x00, 0x11, 0x48, 0x17, 0xf8, 0x45, - 0x07, 0x3f, 0x70, 0x00, 0x00, 0x11, 0x10, 0x03, - 0xf0, 0x74, 0x06, 0x9f, 0x80, 0x01, 0x70, 0x00, - 0x00, 0x16, 0x10, 0x02, 0xf0, 0x74, 0x06, 0x7b, - 0x6d, 0x91, 0x6d, 0x96, 0x6c, 0xef, 0xff, 0xff, - 0x07, 0x2f, 0xee, 0x04, 0x8a, 0x17, 0x8a, 0x16, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, - 0x10, 0xf8, 0x2a, 0xe8, 0x08, 0xf8, 0x2a, 0xe9, - 0xf8, 0x45, 0x07, 0x64, 0x76, 0x00, 0x00, 0x01, - 0x62, 0xf8, 0x2a, 0xe9, 0x00, 0x5e, 0xf2, 0x74, - 0x12, 0x0b, 0xf0, 0x00, 0x30, 0x40, 0x72, 0x11, - 0x2a, 0xe9, 0x77, 0x10, 0x00, 0x0f, 0xf5, 0xa9, - 0xf8, 0x20, 0x07, 0x61, 0x6b, 0xf8, 0x2a, 0xe9, - 0x00, 0x01, 0xf0, 0x73, 0x07, 0x64, 0x76, 0xf8, - 0x2a, 0xe9, 0x00, 0x00, 0xee, 0x02, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0x88, 0x11, 0xe8, 0x00, - 0x75, 0xf8, 0x00, 0x08, 0x00, 0x08, 0xe8, 0x00, - 0x75, 0xf8, 0x00, 0x08, 0x00, 0x09, 0xf6, 0xb8, - 0xf4, 0x95, 0xf0, 0x20, 0xfc, 0x3f, 0x75, 0xf8, - 0x00, 0x08, 0x00, 0x0d, 0xf0, 0x20, 0x0c, 0x30, - 0x75, 0xf8, 0x00, 0x08, 0x00, 0x0c, 0x76, 0xf8, - 0x2a, 0xe8, 0x00, 0x00, 0x76, 0xf8, 0x2a, 0xe9, - 0x00, 0x00, 0x6c, 0x81, 0x07, 0x92, 0x76, 0xf8, - 0x2a, 0xea, 0x00, 0x00, 0xfb, 0x80, 0x16, 0x76, - 0xf4, 0x95, 0xe8, 0x10, 0xe8, 0x00, 0x75, 0xf8, - 0x00, 0x08, 0x00, 0x00, 0xf0, 0x73, 0x07, 0xa8, - 0x76, 0xf8, 0x2a, 0xea, 0x00, 0x01, 0xfb, 0x80, - 0x16, 0x66, 0xf4, 0x95, 0xe8, 0x10, 0xfb, 0x80, - 0x16, 0x87, 0xf4, 0x95, 0xe8, 0x10, 0xe8, 0x00, - 0x75, 0xf8, 0x00, 0x08, 0x00, 0x00, 0xf6, 0xb8, - 0xf4, 0x95, 0xf0, 0x20, 0xff, 0xff, 0x75, 0xf8, - 0x00, 0x08, 0x00, 0x00, 0x8a, 0x11, 0xfc, 0x00, - 0xf4, 0x95, 0x4a, 0x08, 0x4a, 0x09, 0x4a, 0x0a, - 0x4a, 0x06, 0x4a, 0x07, 0x4a, 0x1d, 0x68, 0xf8, - 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, 0x00, 0x07, - 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, 0xff, 0xfc, - 0x10, 0xf8, 0x2a, 0xea, 0xf8, 0x45, 0x07, 0xe1, - 0x10, 0xf8, 0x2a, 0xe8, 0xf0, 0x00, 0x00, 0x01, - 0xf0, 0x30, 0x00, 0x0f, 0x80, 0xf8, 0x2a, 0xe8, - 0x10, 0xf8, 0x2a, 0xe8, 0xf8, 0x44, 0x07, 0xd6, - 0xf6, 0xb8, 0xf4, 0x95, 0xf0, 0x20, 0xfc, 0x3f, - 0x75, 0xf8, 0x00, 0x08, 0x00, 0x0d, 0xf0, 0x20, - 0x0c, 0x30, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x0c, - 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x00, - 0xf6, 0xb8, 0xf4, 0x95, 0xf0, 0x20, 0xff, 0xff, - 0x75, 0xf8, 0x00, 0x08, 0x00, 0x00, 0x8a, 0x1d, - 0x8a, 0x07, 0x8a, 0x06, 0x8a, 0x0a, 0x8a, 0x09, - 0x8a, 0x08, 0xf4, 0xeb, 0xee, 0xff, 0xf2, 0x74, - 0x07, 0x67, 0xf4, 0x95, 0xe8, 0x01, 0xee, 0x01, - 0xfc, 0x00, 0x4a, 0x07, 0x4a, 0x1d, 0x68, 0xf8, - 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, 0x00, 0x07, - 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, 0xff, 0xfc, - 0x8a, 0x1d, 0x8a, 0x07, 0xf4, 0xeb, 0x4a, 0x11, - 0x77, 0x11, 0x00, 0x28, 0x76, 0x81, 0x24, 0x00, - 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, - 0xf2, 0x74, 0x07, 0x67, 0xf4, 0x95, 0xe8, 0x00, - 0x77, 0x11, 0x00, 0x1d, 0x68, 0x81, 0x00, 0x7f, - 0xf6, 0xb8, 0xf4, 0x95, 0xf0, 0x20, 0xff, 0x80, - 0x77, 0x11, 0x00, 0x1d, 0xf0, 0x30, 0x01, 0x00, - 0x1a, 0x81, 0x80, 0x81, 0xf0, 0x74, 0x0a, 0x33, - 0xf0, 0x74, 0x11, 0xac, 0xf9, 0x80, 0x13, 0x25, - 0xf9, 0x80, 0x16, 0x53, 0xf9, 0x80, 0x17, 0x82, - 0xf0, 0x74, 0x06, 0x2f, 0xf9, 0x80, 0x14, 0xb2, - 0xf9, 0x80, 0x19, 0x10, 0xf0, 0x74, 0x0d, 0xe3, - 0xf0, 0x74, 0x07, 0xe8, 0xf0, 0x74, 0x02, 0x36, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x60, 0xf8, - 0x27, 0x7b, 0xff, 0xff, 0xf8, 0x30, 0x08, 0x39, - 0x71, 0xf8, 0x27, 0x7b, 0x27, 0x79, 0x60, 0xf8, - 0x27, 0x79, 0xff, 0xff, 0xf8, 0x30, 0x08, 0xb2, - 0x10, 0xf8, 0x29, 0x86, 0x08, 0xf8, 0x27, 0x79, - 0xf0, 0x30, 0x7f, 0xff, 0x88, 0x11, 0xf4, 0x95, - 0x77, 0x10, 0x40, 0x00, 0xf6, 0xa9, 0xf8, 0x30, - 0x08, 0x58, 0x10, 0xf8, 0x27, 0x79, 0x08, 0xf8, - 0x27, 0x7a, 0xf0, 0x30, 0x7f, 0xff, 0x88, 0x11, - 0xf4, 0x95, 0x77, 0x10, 0x40, 0x00, 0xf6, 0xa9, - 0xf8, 0x20, 0x08, 0x63, 0x76, 0xf8, 0x27, 0x79, - 0xff, 0xff, 0x76, 0xf8, 0x27, 0x7b, 0xff, 0xff, - 0xf7, 0xb8, 0xf2, 0x73, 0x08, 0xd9, 0xf0, 0x20, - 0xff, 0xff, 0xf6, 0xb8, 0x56, 0xf8, 0x27, 0x74, - 0xf0, 0xf9, 0x88, 0x11, 0x56, 0xf8, 0x27, 0x72, - 0xf0, 0xf9, 0x88, 0x12, 0xf4, 0x95, 0xf4, 0x95, - 0xe7, 0x20, 0xf4, 0xa9, 0xf8, 0x30, 0x08, 0x8f, - 0xf1, 0x20, 0x27, 0x7c, 0x48, 0x11, 0xf6, 0x00, - 0x88, 0x13, 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x83, - 0x08, 0xf8, 0x27, 0x79, 0xf0, 0x30, 0x7f, 0xff, - 0x88, 0x13, 0xf4, 0x95, 0x77, 0x10, 0x40, 0x00, - 0xf5, 0xab, 0xf8, 0x30, 0x08, 0x8f, 0x6d, 0x91, - 0x48, 0x11, 0xf0, 0x30, 0x01, 0xff, 0x88, 0x11, - 0xf4, 0x95, 0xe7, 0x20, 0xf7, 0xa9, 0xf8, 0x30, - 0x08, 0x74, 0x6d, 0x89, 0x48, 0x11, 0xf0, 0x30, - 0x01, 0xff, 0xf0, 0xe7, 0xf4, 0x95, 0x48, 0x08, - 0x4e, 0xf8, 0x27, 0x74, 0x48, 0x08, 0xf1, 0xf9, - 0x89, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x71, 0xe1, - 0x27, 0x7c, 0x27, 0x7a, 0x60, 0xf8, 0x27, 0x7b, - 0xff, 0xff, 0xf8, 0x30, 0x08, 0xab, 0x48, 0x08, - 0x4e, 0xf8, 0x27, 0x72, 0x76, 0xf8, 0x27, 0x7b, - 0xff, 0xff, 0x76, 0xf8, 0x27, 0x79, 0xff, 0xff, - 0xf2, 0x73, 0x08, 0xd9, 0xf4, 0x95, 0xe8, 0x00, - 0x44, 0xf8, 0x27, 0x73, 0x40, 0xf8, 0x27, 0x75, - 0x82, 0xf8, 0x00, 0x11, 0xf4, 0x95, 0x77, 0x10, - 0x80, 0x00, 0xf6, 0xa9, 0xf8, 0x20, 0x08, 0xd8, - 0xf6, 0xb8, 0x10, 0xf8, 0x27, 0x73, 0xf0, 0x00, - 0x80, 0x00, 0x48, 0x08, 0x4e, 0xf8, 0x27, 0x74, - 0x48, 0x08, 0xf0, 0xf9, 0x88, 0x11, 0xf4, 0x95, - 0xf4, 0x95, 0x71, 0xe1, 0x27, 0x7c, 0x27, 0x7a, - 0xf7, 0xb8, 0x57, 0xf8, 0x27, 0x74, 0xf0, 0x62, - 0xff, 0xff, 0xf0, 0x40, 0xff, 0x80, 0xf2, 0x80, - 0x4e, 0xf8, 0x27, 0x74, 0xe8, 0x00, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0x4a, 0x16, 0xee, 0xfb, - 0x11, 0xf8, 0x27, 0x71, 0x09, 0xf8, 0x27, 0x73, - 0x89, 0x11, 0x88, 0x10, 0xf4, 0x95, 0xf4, 0x95, - 0xf6, 0xa9, 0xf8, 0x20, 0x08, 0xed, 0xf2, 0x73, - 0x09, 0x0e, 0xf4, 0x95, 0xe8, 0x00, 0xf6, 0x20, - 0x76, 0x00, 0x00, 0x41, 0xf0, 0x74, 0x12, 0xee, - 0x88, 0x16, 0xf4, 0x95, 0xf7, 0xb8, 0x6d, 0x96, - 0x10, 0xf8, 0x00, 0x16, 0xf8, 0x47, 0x09, 0x0a, - 0xe7, 0x61, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01, - 0x00, 0x80, 0x76, 0x02, 0x00, 0xff, 0x76, 0x03, - 0x00, 0x00, 0xf2, 0x74, 0x0c, 0xb9, 0xf4, 0x95, - 0xe8, 0x00, 0x6c, 0xe9, 0xff, 0xff, 0x08, 0xfb, - 0x73, 0x16, 0x00, 0x0e, 0xf0, 0x66, 0x00, 0x41, - 0xee, 0x05, 0x8a, 0x16, 0x8a, 0x11, 0xfc, 0x00, - 0x4a, 0x11, 0xf4, 0x95, 0x71, 0x02, 0x00, 0x13, - 0xf6, 0xb8, 0x77, 0x11, 0x7f, 0xff, 0x57, 0xf8, - 0x27, 0x72, 0x48, 0x11, 0xf2, 0x80, 0xf0, 0x00, - 0x80, 0x00, 0x88, 0x11, 0xf6, 0x40, 0xf0, 0xe0, - 0xf1, 0xf1, 0xe8, 0x01, 0xf2, 0x80, 0x80, 0xf8, - 0x27, 0x78, 0x77, 0x12, 0x80, 0x00, 0x57, 0xf8, - 0x27, 0x72, 0x48, 0x12, 0xf2, 0x80, 0x88, 0x12, - 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x82, 0x09, 0x38, - 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, - 0xf0, 0x73, 0x09, 0x3d, 0xf0, 0x20, 0x80, 0x01, - 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, 0x70, 0x81, - 0x00, 0x13, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, - 0xf0, 0x30, 0x7f, 0xff, 0x11, 0xf8, 0x29, 0x86, - 0xf5, 0x20, 0xf3, 0x30, 0x7f, 0xff, 0x89, 0x11, - 0xf4, 0x95, 0x77, 0x10, 0x40, 0x00, 0xf6, 0xa9, - 0xf8, 0x20, 0x09, 0x54, 0xf2, 0x73, 0x09, 0x67, - 0xf4, 0x95, 0xe8, 0x02, 0x6f, 0xf8, 0x27, 0x7a, - 0x0d, 0x20, 0xf3, 0x30, 0x7f, 0xff, 0x89, 0x11, - 0xf4, 0x95, 0x77, 0x10, 0x40, 0x00, 0xf6, 0xa9, - 0xf8, 0x20, 0x09, 0x64, 0xf2, 0x73, 0x09, 0x67, - 0xf4, 0x95, 0xe8, 0x01, 0x80, 0xf8, 0x27, 0x7b, - 0xe8, 0x00, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, - 0x11, 0xf8, 0x29, 0x86, 0xf5, 0x20, 0xf3, 0x30, - 0x7f, 0xff, 0x89, 0x11, 0xf4, 0x95, 0x77, 0x10, - 0x40, 0x00, 0xf6, 0xa9, 0xf8, 0x20, 0x09, 0x7a, - 0xf2, 0x73, 0x09, 0x8d, 0xf4, 0x95, 0xe8, 0x02, - 0x6f, 0xf8, 0x27, 0x7a, 0x0d, 0x20, 0xf3, 0x30, - 0x7f, 0xff, 0x89, 0x11, 0xf4, 0x95, 0x77, 0x10, - 0x40, 0x00, 0xf6, 0xa9, 0xf8, 0x20, 0x09, 0x8a, - 0xf2, 0x73, 0x09, 0x8d, 0xf4, 0x95, 0xe8, 0x01, - 0x80, 0xf8, 0x27, 0x79, 0xe8, 0x00, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0xf4, 0x95, 0x71, 0x02, - 0x00, 0x12, 0x88, 0x11, 0xf6, 0xb8, 0x57, 0xf8, - 0x27, 0x72, 0xf0, 0x20, 0x7f, 0xff, 0xf2, 0x80, - 0xf0, 0x00, 0x80, 0x00, 0x80, 0x81, 0x57, 0xf8, - 0x27, 0x72, 0xe8, 0x01, 0xf3, 0xf1, 0xf2, 0x80, - 0x80, 0xf8, 0x27, 0x78, 0x77, 0x11, 0x80, 0x00, - 0x48, 0x11, 0x57, 0xf8, 0x27, 0x72, 0xf2, 0x80, - 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x81, - 0x09, 0xb5, 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, - 0x00, 0x01, 0xf0, 0x73, 0x09, 0xba, 0xf0, 0x20, - 0x80, 0x01, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, - 0x45, 0xf8, 0x27, 0x71, 0x43, 0xf8, 0x27, 0x73, - 0x83, 0xf8, 0x00, 0x11, 0xf4, 0x95, 0xe7, 0x20, - 0xf6, 0xa9, 0xf8, 0x30, 0x09, 0xc9, 0xf2, 0x73, - 0x09, 0xe4, 0x77, 0x12, 0x00, 0x00, 0x57, 0xf8, - 0x27, 0x72, 0xf0, 0x20, 0x7f, 0xff, 0xf2, 0x80, - 0x49, 0x12, 0xf5, 0x00, 0xf3, 0x00, 0x80, 0x00, - 0x61, 0xf8, 0x00, 0x0b, 0x80, 0x00, 0xf8, 0x30, - 0x09, 0xdc, 0xf1, 0x20, 0x80, 0x00, 0xf5, 0x20, - 0x89, 0x12, 0xf4, 0x95, 0x48, 0x12, 0x6f, 0xf8, - 0x27, 0x73, 0x0d, 0x00, 0xf4, 0x95, 0x49, 0x0b, - 0x4f, 0xf8, 0x27, 0x72, 0x8a, 0x11, 0xfe, 0x00, - 0x48, 0x12, 0xf4, 0x95, 0x4a, 0x11, 0x4a, 0x16, - 0x4a, 0x17, 0xee, 0xfc, 0xf4, 0x95, 0x71, 0x08, - 0x00, 0x16, 0x88, 0x17, 0xf0, 0x74, 0x08, 0x30, - 0x48, 0x18, 0x70, 0x00, 0x00, 0x16, 0xf2, 0x74, - 0x09, 0x8f, 0xf0, 0x00, 0x00, 0x02, 0x88, 0x11, - 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x81, 0x0a, 0x0a, - 0xf2, 0x74, 0x08, 0xdb, 0xf4, 0x95, 0x48, 0x16, - 0x48, 0x18, 0x70, 0x00, 0x00, 0x16, 0xf2, 0x74, - 0x09, 0x8f, 0xf0, 0x00, 0x00, 0x02, 0x88, 0x11, - 0x10, 0x02, 0x70, 0x01, 0x00, 0x11, 0x80, 0x00, - 0xf2, 0x74, 0x06, 0xce, 0xf4, 0x95, 0x48, 0x17, - 0x49, 0x11, 0x48, 0x17, 0xf6, 0x00, 0x88, 0x17, - 0xe7, 0x60, 0xf5, 0xa9, 0xf8, 0x20, 0x0a, 0x2d, - 0x48, 0x16, 0xf6, 0x20, 0x88, 0x11, 0x48, 0x18, - 0x70, 0x00, 0x00, 0x11, 0xf2, 0x74, 0x09, 0x8f, - 0xf0, 0x00, 0x00, 0x02, 0x88, 0x11, 0x70, 0x01, - 0x00, 0x11, 0x10, 0x02, 0x80, 0x00, 0xf2, 0x74, - 0x06, 0xce, 0xf4, 0x95, 0x48, 0x17, 0xee, 0x04, - 0x48, 0x16, 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x11, - 0xfc, 0x00, 0xee, 0xfd, 0xe8, 0x00, 0x4e, 0xf8, - 0x27, 0x70, 0xe8, 0x00, 0x4e, 0xf8, 0x27, 0x72, - 0xe8, 0x00, 0x4e, 0xf8, 0x27, 0x74, 0xe8, 0x00, - 0x4e, 0xf8, 0x27, 0x76, 0x76, 0xf8, 0x27, 0x79, - 0xff, 0xff, 0x76, 0xf8, 0x27, 0x7a, 0x00, 0x00, - 0x76, 0xf8, 0x27, 0x7b, 0xff, 0xff, 0x76, 0xf8, - 0x27, 0x78, 0x00, 0x00, 0xe8, 0x00, 0x75, 0xf8, - 0x00, 0x08, 0x00, 0x01, 0x76, 0x00, 0x00, 0x00, - 0x76, 0x01, 0x02, 0x00, 0xf2, 0x74, 0x12, 0xdc, - 0xf0, 0x20, 0x27, 0x7c, 0xee, 0x03, 0xfc, 0x00, - 0x4a, 0x11, 0xee, 0xfc, 0xf4, 0x95, 0x4e, 0x00, - 0x77, 0x12, 0x7f, 0xff, 0xf6, 0xb8, 0x49, 0x12, - 0xf1, 0x80, 0xf3, 0x00, 0x80, 0x00, 0x89, 0x12, - 0xf0, 0xe0, 0xf1, 0xf1, 0x4f, 0x02, 0xe9, 0x01, - 0xf4, 0x95, 0x48, 0x0b, 0xf5, 0x40, 0x56, 0x02, - 0xf1, 0x80, 0x81, 0xf8, 0x27, 0x78, 0x77, 0x11, - 0x80, 0x00, 0x56, 0x00, 0x49, 0x11, 0xf1, 0x80, - 0x89, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x81, - 0x0a, 0x81, 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, - 0x00, 0x01, 0xf0, 0x73, 0x0a, 0x86, 0xf0, 0x20, - 0x80, 0x01, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, - 0x10, 0x82, 0xee, 0x04, 0x8a, 0x11, 0xfc, 0x00, - 0x4a, 0x11, 0xee, 0xfe, 0xf4, 0x95, 0x4e, 0x00, - 0x77, 0x11, 0x7f, 0xff, 0xf6, 0xb8, 0x49, 0x11, - 0xf1, 0x80, 0xf3, 0x00, 0x80, 0x00, 0x89, 0x11, - 0xf0, 0xe0, 0xf1, 0xf1, 0xe8, 0x01, 0xf2, 0x80, - 0x80, 0xf8, 0x27, 0x78, 0x56, 0x00, 0xf1, 0x20, - 0x80, 0x00, 0xf1, 0x80, 0xf4, 0x95, 0x49, 0x0b, - 0xf8, 0x4d, 0x0a, 0xab, 0xf0, 0x20, 0x80, 0x01, - 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, 0xf0, 0x73, - 0x0a, 0xaf, 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, - 0x00, 0x01, 0xee, 0x02, 0x48, 0x11, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0x88, 0x12, 0x13, 0x02, - 0x77, 0x11, 0x00, 0x00, 0xf8, 0x4d, 0x0a, 0xcb, - 0xf3, 0x10, 0x00, 0x01, 0x89, 0x1a, 0xf4, 0x95, - 0xf0, 0x72, 0x0a, 0xca, 0x48, 0x11, 0x1c, 0xf8, - 0x29, 0x7e, 0x88, 0x11, 0x11, 0xf8, 0x29, 0x7e, - 0xf2, 0x00, 0x00, 0x01, 0x80, 0xf8, 0x29, 0x7e, - 0x81, 0x92, 0x48, 0x11, 0x8a, 0x11, 0xfc, 0x00, - 0x4a, 0x11, 0xf4, 0x95, 0x71, 0x02, 0x00, 0x11, - 0x88, 0x12, 0xf6, 0xb8, 0xf0, 0x20, 0x7f, 0xff, - 0x57, 0xf8, 0x27, 0x70, 0xf2, 0x80, 0xf0, 0x00, - 0x80, 0x00, 0x80, 0x82, 0x57, 0xf8, 0x27, 0x70, - 0xe8, 0x01, 0xf3, 0xf1, 0xf2, 0x80, 0x80, 0xf8, - 0x27, 0x78, 0x77, 0x12, 0x80, 0x00, 0x48, 0x12, - 0x57, 0xf8, 0x27, 0x70, 0xf2, 0x80, 0x88, 0x12, - 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x82, 0x0a, 0xf4, - 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, - 0xf0, 0x73, 0x0a, 0xf9, 0xf0, 0x20, 0x80, 0x01, - 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, 0x45, 0xf8, - 0x27, 0x75, 0xe7, 0x10, 0x43, 0xf8, 0x27, 0x71, - 0x83, 0xf8, 0x00, 0x12, 0x6d, 0xe8, 0x00, 0x04, - 0x6d, 0x8a, 0xf6, 0xaa, 0xf8, 0x30, 0x0b, 0x0a, - 0xf2, 0x73, 0x0b, 0x25, 0x77, 0x11, 0x00, 0x00, - 0x57, 0xf8, 0x27, 0x70, 0xf0, 0x20, 0x7f, 0xff, - 0xf2, 0x80, 0x49, 0x11, 0xf5, 0x00, 0xf3, 0x00, - 0x80, 0x00, 0x61, 0xf8, 0x00, 0x0b, 0x80, 0x00, - 0xf8, 0x30, 0x0b, 0x1d, 0xf1, 0x20, 0x80, 0x00, - 0xf5, 0x20, 0x89, 0x11, 0xf4, 0x95, 0x48, 0x11, - 0x6f, 0xf8, 0x27, 0x71, 0x0d, 0x00, 0xf4, 0x95, - 0x49, 0x0b, 0x4f, 0xf8, 0x27, 0x70, 0x48, 0x11, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x4a, 0x16, - 0x4a, 0x17, 0xee, 0xf0, 0x88, 0x17, 0x10, 0x17, - 0x80, 0x05, 0x10, 0x16, 0x80, 0x06, 0x10, 0x15, - 0x80, 0x07, 0x71, 0x14, 0x00, 0x11, 0x10, 0x05, - 0xf0, 0x30, 0x00, 0x01, 0x88, 0x10, 0x10, 0x06, - 0xf0, 0x30, 0x00, 0x01, 0x80, 0x08, 0x49, 0x11, - 0x10, 0x05, 0xf6, 0x01, 0x80, 0x09, 0x10, 0x06, - 0x61, 0xf8, 0x00, 0x08, 0x00, 0x01, 0xf8, 0x20, - 0x0b, 0x4b, 0x10, 0x09, 0xf0, 0x00, 0x00, 0x01, - 0x80, 0x09, 0x71, 0x08, 0x00, 0x12, 0xf4, 0xaa, - 0xf8, 0x30, 0x0b, 0x54, 0x10, 0x09, 0xf0, 0x00, - 0x00, 0x01, 0x80, 0x09, 0x12, 0x09, 0x49, 0x11, - 0xf4, 0x7f, 0x80, 0x09, 0xf6, 0x20, 0x80, 0x0a, - 0x56, 0xf8, 0x27, 0x70, 0x4e, 0x0c, 0x10, 0x09, - 0x80, 0x00, 0x48, 0x18, 0xf2, 0x74, 0x0a, 0xce, - 0xf0, 0x00, 0x00, 0x04, 0x88, 0x16, 0xf4, 0x95, - 0xf4, 0x95, 0x6c, 0x86, 0x0b, 0x6d, 0xf2, 0x73, - 0x0c, 0x59, 0xf4, 0x95, 0xe8, 0x00, 0xf6, 0xb8, - 0xf4, 0x95, 0x56, 0x0c, 0xf0, 0xf9, 0x88, 0x12, - 0xf4, 0x95, 0xf4, 0x95, 0x70, 0xe2, 0x27, 0x7c, - 0x29, 0x86, 0xe8, 0x00, 0x80, 0x0e, 0x48, 0x11, - 0xf8, 0x45, 0x0b, 0xcc, 0x77, 0x10, 0x00, 0x01, - 0xf4, 0xa9, 0xf8, 0x30, 0x0b, 0x89, 0x6c, 0xe1, - 0xff, 0xfd, 0x0b, 0x8b, 0x10, 0xe7, 0x00, 0x02, - 0x80, 0x0e, 0xf0, 0x73, 0x0b, 0x8b, 0x10, 0x87, - 0x80, 0x0e, 0xe7, 0x10, 0xf5, 0xae, 0xf8, 0x20, - 0x0b, 0xb2, 0x70, 0x00, 0x00, 0x17, 0x70, 0x01, - 0x00, 0x16, 0x10, 0x04, 0xf0, 0x74, 0x06, 0xce, - 0x48, 0x17, 0x49, 0x16, 0xf6, 0x00, 0x88, 0x17, - 0x48, 0x11, 0xf6, 0x20, 0x88, 0x11, 0x10, 0x09, - 0xf6, 0x20, 0x80, 0x00, 0x48, 0x18, 0xf2, 0x74, - 0x0a, 0xce, 0xf0, 0x00, 0x00, 0x04, 0x88, 0x16, - 0x10, 0x04, 0x70, 0x00, 0x00, 0x17, 0x70, 0x01, - 0x00, 0x11, 0xf0, 0x74, 0x06, 0xce, 0x48, 0x11, - 0x00, 0x04, 0x80, 0x04, 0xf0, 0x73, 0x0b, 0xbc, - 0x70, 0x00, 0x00, 0x17, 0x70, 0x01, 0x00, 0x11, - 0x10, 0x04, 0xf0, 0x74, 0x06, 0xce, 0x48, 0x11, - 0x00, 0x04, 0x80, 0x04, 0x49, 0x11, 0x48, 0x16, - 0xf6, 0x20, 0x88, 0x16, 0xf4, 0x95, 0xf4, 0x95, - 0x6c, 0x86, 0x0b, 0xcc, 0x10, 0x0a, 0x80, 0x00, - 0x48, 0x18, 0xf2, 0x74, 0x0a, 0xce, 0xf0, 0x00, - 0x00, 0x04, 0x88, 0x16, 0x12, 0x0a, 0xf8, 0x45, - 0x0c, 0x33, 0x71, 0x0a, 0x00, 0x10, 0xf4, 0xae, - 0xf8, 0x30, 0x0c, 0x1c, 0x48, 0x16, 0xf0, 0xe1, - 0x88, 0x11, 0x12, 0x08, 0xf8, 0x45, 0x0b, 0xdb, - 0x6d, 0x89, 0x12, 0x07, 0xf8, 0x45, 0x0b, 0xe9, - 0x10, 0x07, 0x80, 0x00, 0x70, 0x02, 0x00, 0x11, - 0x10, 0x06, 0x80, 0x01, 0x10, 0x04, 0xf0, 0x74, - 0x06, 0xdc, 0xf0, 0x73, 0x0b, 0xef, 0x48, 0x11, - 0x6f, 0x00, 0x0c, 0x9f, 0x10, 0x04, 0xf0, 0x74, - 0x0a, 0xb3, 0x11, 0x0e, 0xf1, 0xc0, 0x81, 0x0e, - 0x10, 0x06, 0x49, 0x11, 0xf6, 0x00, 0x80, 0x06, - 0x10, 0x05, 0xf6, 0x20, 0x88, 0x11, 0xf0, 0x00, - 0x00, 0x01, 0x48, 0x08, 0x6f, 0x00, 0x0c, 0x9f, - 0x48, 0x18, 0xf2, 0x74, 0x0a, 0xce, 0xf0, 0x00, - 0x00, 0x04, 0x12, 0x07, 0xf8, 0x45, 0x0c, 0x11, - 0x10, 0x07, 0x80, 0x00, 0x70, 0x02, 0x00, 0x11, - 0x10, 0x06, 0x80, 0x01, 0x10, 0x04, 0xf0, 0x74, - 0x06, 0xdc, 0xf0, 0x73, 0x0c, 0x17, 0x48, 0x11, - 0x6f, 0x00, 0x0c, 0x9f, 0x10, 0x04, 0xf0, 0x74, - 0x0a, 0xb3, 0x11, 0x0e, 0xf1, 0xc0, 0x81, 0x0e, - 0xf0, 0x73, 0x0c, 0x33, 0x12, 0x07, 0xf8, 0x45, - 0x0c, 0x2a, 0x10, 0x07, 0x80, 0x00, 0x10, 0x06, - 0x80, 0x01, 0x10, 0x05, 0x80, 0x02, 0x10, 0x04, - 0xf0, 0x74, 0x06, 0xdc, 0xf0, 0x73, 0x0c, 0x30, - 0x12, 0x05, 0x6f, 0x00, 0x0c, 0x9f, 0x10, 0x04, - 0xf0, 0x74, 0x0a, 0xb3, 0x11, 0x0e, 0xf1, 0xc0, - 0x81, 0x0e, 0x76, 0x00, 0x00, 0x01, 0x48, 0x18, - 0xf2, 0x74, 0x0a, 0xce, 0xf0, 0x00, 0x00, 0x04, - 0x71, 0x04, 0x00, 0x11, 0x70, 0x81, 0x29, 0x86, - 0x10, 0x0e, 0x1c, 0xf8, 0x29, 0x86, 0x80, 0x0e, - 0x76, 0x00, 0x00, 0x01, 0x48, 0x18, 0xf2, 0x74, - 0x0a, 0xce, 0xf0, 0x00, 0x00, 0x04, 0x10, 0x0e, - 0x71, 0x04, 0x00, 0x11, 0x80, 0x81, 0x10, 0xf8, - 0x29, 0x86, 0xf0, 0x00, 0x00, 0x01, 0xf0, 0x30, - 0x7f, 0xff, 0x80, 0xf8, 0x29, 0x86, 0x10, 0x09, - 0xf0, 0x00, 0x00, 0x02, 0x80, 0x09, 0xee, 0x10, - 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x11, 0xfc, 0x00, - 0x10, 0xf8, 0x27, 0x75, 0x08, 0xf8, 0x27, 0x71, - 0xf0, 0x10, 0x00, 0x01, 0x48, 0x08, 0xfc, 0x00, - 0x4a, 0x11, 0x4a, 0x16, 0xee, 0xff, 0xf4, 0x95, - 0x71, 0x04, 0x00, 0x16, 0xf0, 0x00, 0x00, 0x01, - 0x48, 0x08, 0x4e, 0xf8, 0x29, 0x7c, 0x6d, 0xee, - 0xff, 0xfd, 0x48, 0x16, 0xf8, 0x45, 0x0c, 0x99, - 0x56, 0xf8, 0x29, 0x7c, 0xf0, 0x74, 0x0a, 0x5a, - 0x88, 0x11, 0x10, 0xf8, 0x29, 0x7d, 0xf0, 0x00, - 0x00, 0x01, 0x48, 0x08, 0x4e, 0xf8, 0x29, 0x7c, - 0x10, 0xf8, 0x29, 0x82, 0xf0, 0x00, 0x00, 0x01, - 0x88, 0x10, 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0xa9, - 0xfa, 0x30, 0x0c, 0x96, 0x80, 0xf8, 0x29, 0x82, - 0x56, 0xf8, 0x29, 0x80, 0xf0, 0x00, 0x00, 0x01, - 0x4e, 0xf8, 0x29, 0x80, 0x73, 0x11, 0x29, 0x82, - 0x6c, 0xee, 0xff, 0xff, 0x0c, 0x76, 0xee, 0x01, - 0x8a, 0x16, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, - 0x76, 0xf8, 0x29, 0x84, 0x00, 0x00, 0x76, 0xf8, - 0x29, 0x85, 0x00, 0x01, 0xe8, 0x00, 0x4e, 0xf8, - 0x2a, 0x0c, 0x76, 0xf8, 0x29, 0x86, 0x00, 0x00, - 0x76, 0xf8, 0x29, 0x87, 0x00, 0x00, 0x77, 0x11, - 0x29, 0x88, 0x76, 0x81, 0xaa, 0xaa, 0x76, 0xe1, - 0x00, 0x01, 0xaa, 0xaa, 0x76, 0xe1, 0x00, 0x02, - 0x00, 0x00, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, - 0xee, 0xfc, 0xf4, 0x95, 0x71, 0x06, 0x00, 0x14, - 0x71, 0x07, 0x00, 0x13, 0x71, 0x08, 0x00, 0x12, - 0x71, 0x09, 0x00, 0x15, 0x77, 0x10, 0x00, 0xff, - 0xf4, 0xaa, 0xf8, 0x30, 0x0d, 0x44, 0x49, 0x13, - 0x53, 0xf8, 0x2a, 0x0c, 0x4f, 0xf8, 0x2a, 0x0c, - 0x73, 0x12, 0x00, 0x0e, 0xf1, 0x66, 0x00, 0x0d, - 0x89, 0x11, 0xf4, 0x95, 0x77, 0x10, 0x00, 0x01, - 0x71, 0xe1, 0x24, 0x00, 0x00, 0x11, 0xf4, 0xa9, - 0xf8, 0x30, 0x0d, 0x17, 0x77, 0x10, 0x00, 0x02, - 0xf4, 0xa9, 0xf8, 0x30, 0x0c, 0xec, 0x77, 0x11, - 0x29, 0x8a, 0x76, 0x81, 0x00, 0x00, 0xe8, 0x00, - 0x77, 0x14, 0x00, 0x00, 0x77, 0x13, 0x00, 0x00, - 0xf0, 0x73, 0x0d, 0x48, 0x6c, 0x83, 0x0c, 0xfa, - 0x77, 0x11, 0x29, 0x8a, 0x48, 0x12, 0xf0, 0xe8, - 0xf0, 0x40, 0x80, 0x00, 0x80, 0x81, 0xe8, 0x00, - 0x77, 0x14, 0x00, 0x00, 0xf0, 0x73, 0x0d, 0x48, - 0x49, 0x13, 0xf3, 0x40, 0x80, 0x00, 0x81, 0xf8, - 0x29, 0x8a, 0x61, 0xf8, 0x00, 0x15, 0x00, 0x01, - 0xf8, 0x20, 0x0d, 0x07, 0x69, 0xf8, 0x29, 0x8a, - 0x40, 0x00, 0x61, 0xf8, 0x00, 0x14, 0x00, 0x01, - 0xf8, 0x20, 0x0d, 0x0f, 0x69, 0xf8, 0x29, 0x8a, - 0x20, 0x00, 0x77, 0x11, 0x29, 0x8a, 0x49, 0x12, - 0xf3, 0xe8, 0x1b, 0x81, 0x81, 0x81, 0xf0, 0x73, - 0x0d, 0x48, 0x11, 0xf8, 0x29, 0x84, 0xf8, 0x4c, - 0x0d, 0x37, 0x77, 0x11, 0x29, 0x88, 0x76, 0x81, - 0xaa, 0xaa, 0x11, 0xf8, 0x29, 0x85, 0xf3, 0x10, - 0x00, 0x01, 0xf3, 0x40, 0xaa, 0x00, 0x81, 0xe1, - 0x00, 0x01, 0x76, 0x00, 0x00, 0x02, 0x80, 0x01, - 0x70, 0x02, 0x00, 0x14, 0x70, 0x03, 0x00, 0x13, - 0xf2, 0x74, 0x0b, 0x28, 0xf4, 0x95, 0x48, 0x11, - 0x71, 0xf8, 0x29, 0x85, 0x29, 0x84, 0xf0, 0x73, - 0x0d, 0x73, 0x76, 0x00, 0x00, 0x00, 0x80, 0x01, - 0x76, 0x02, 0x00, 0x00, 0x70, 0x03, 0x00, 0x13, - 0xf2, 0x74, 0x0b, 0x28, 0xf4, 0x95, 0xe8, 0x00, - 0xf0, 0x73, 0x0d, 0x73, 0x77, 0x11, 0x29, 0x8a, - 0x70, 0x81, 0x00, 0x13, 0x11, 0xf8, 0x29, 0x84, - 0xf8, 0x4c, 0x0d, 0x68, 0x77, 0x11, 0x29, 0x88, - 0x76, 0x81, 0xaa, 0xaa, 0x11, 0xf8, 0x29, 0x85, - 0xf3, 0x10, 0x00, 0x01, 0xf3, 0x40, 0xaa, 0x00, - 0x81, 0xe1, 0x00, 0x01, 0x76, 0x00, 0x00, 0x03, - 0x80, 0x01, 0x70, 0x02, 0x00, 0x14, 0x70, 0x03, - 0x00, 0x13, 0xf2, 0x74, 0x0b, 0x28, 0xf4, 0x95, - 0x48, 0x11, 0x71, 0xf8, 0x29, 0x85, 0x29, 0x84, - 0xf0, 0x73, 0x0d, 0x73, 0x76, 0x00, 0x00, 0x01, - 0x80, 0x01, 0x70, 0x02, 0x00, 0x14, 0x70, 0x03, - 0x00, 0x13, 0xf2, 0x74, 0x0b, 0x28, 0xf4, 0x95, - 0x48, 0x11, 0x6b, 0xf8, 0x29, 0x84, 0xff, 0xff, - 0xee, 0x04, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, - 0xf5, 0x40, 0xf4, 0x95, 0x48, 0x0b, 0xf4, 0x78, - 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0xe1, - 0xff, 0xb9, 0x0d, 0x88, 0xf2, 0x73, 0x0d, 0xa5, - 0xf4, 0x95, 0xe8, 0x60, 0xf2, 0x00, 0x00, 0x06, - 0x61, 0xf8, 0x00, 0x11, 0x00, 0x20, 0xf8, 0x30, - 0x0d, 0x98, 0x61, 0xf8, 0x00, 0x0b, 0x00, 0x01, - 0xf8, 0x20, 0x0d, 0xa3, 0xf2, 0x00, 0x00, 0x07, - 0xf0, 0x73, 0x0d, 0xa3, 0x61, 0xf8, 0x00, 0x0b, - 0x00, 0x01, 0xf8, 0x20, 0x0d, 0xa1, 0xf2, 0x73, - 0x0d, 0xa3, 0xf0, 0x00, 0x00, 0x01, 0xf0, 0x00, - 0x00, 0x02, 0x48, 0x08, 0xf4, 0x7f, 0x8a, 0x11, - 0xfc, 0x00, 0xee, 0xff, 0xf0, 0x74, 0x07, 0xfd, - 0xf0, 0x74, 0x07, 0x44, 0xf0, 0x74, 0x0d, 0xb4, - 0xf0, 0x74, 0x02, 0x05, 0xf0, 0x74, 0x04, 0x60, - 0xf0, 0x73, 0x0d, 0xaa, 0xee, 0xfd, 0x10, 0xf8, - 0x2a, 0xa3, 0xf8, 0x44, 0x0d, 0xcb, 0x10, 0xf8, - 0x2a, 0xa4, 0xf8, 0x45, 0x0d, 0xd7, 0x76, 0x00, - 0x02, 0x00, 0xf2, 0x74, 0x09, 0xe8, 0xf0, 0x20, - 0x22, 0x00, 0x76, 0xf8, 0x2a, 0xa4, 0x00, 0x00, - 0x76, 0xf8, 0x2a, 0xa7, 0x00, 0x00, 0xf0, 0x73, - 0x0d, 0xd7, 0x76, 0x00, 0x02, 0x00, 0xf2, 0x74, - 0x09, 0xe8, 0xf0, 0x20, 0x20, 0x00, 0x76, 0xf8, - 0x2a, 0xa3, 0x00, 0x00, 0x76, 0xf8, 0x2a, 0xa7, - 0x00, 0x01, 0xf0, 0x74, 0x0c, 0x5e, 0xf0, 0xe0, - 0xf0, 0x10, 0x3a, 0x98, 0xf8, 0x47, 0x0d, 0xe1, - 0x76, 0xf8, 0x27, 0x6e, 0x00, 0x00, 0xee, 0x03, - 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, 0x77, 0x11, - 0x20, 0x00, 0x76, 0x00, 0xaa, 0xaa, 0x76, 0x01, - 0x02, 0x00, 0xf2, 0x74, 0x06, 0x6c, 0xf4, 0x95, - 0x48, 0x11, 0x76, 0x00, 0x55, 0x55, 0x76, 0x01, - 0x02, 0x00, 0x48, 0x11, 0xf2, 0x74, 0x06, 0x6c, - 0xf0, 0x00, 0x02, 0x00, 0x76, 0xf8, 0x2a, 0xa3, - 0x00, 0x00, 0x76, 0xf8, 0x2a, 0xa4, 0x00, 0x00, - 0xe8, 0x00, 0x4e, 0x00, 0xfb, 0x80, 0x15, 0x3e, - 0xf4, 0x95, 0xe8, 0x04, 0x80, 0xf8, 0x2a, 0xa5, - 0x76, 0x00, 0x2a, 0xa8, 0xf9, 0x80, 0x14, 0x87, - 0x76, 0x00, 0x2a, 0xad, 0xfb, 0x80, 0x13, 0x62, - 0xf4, 0x95, 0xe8, 0x02, 0x10, 0xf8, 0x2a, 0xa5, - 0xf9, 0x80, 0x14, 0x63, 0xfb, 0x80, 0x16, 0x66, - 0xf4, 0x95, 0xe8, 0x1c, 0xfb, 0x80, 0x16, 0x87, - 0xf4, 0x95, 0xe8, 0x1c, 0xe8, 0x01, 0x4e, 0x00, - 0xfb, 0x80, 0x17, 0xd6, 0xf4, 0x95, 0xe8, 0x00, - 0x80, 0xf8, 0x2a, 0xa6, 0x76, 0x00, 0x2a, 0xb7, - 0xf9, 0x80, 0x16, 0xaa, 0x10, 0xf8, 0x2a, 0xa6, - 0xf9, 0x80, 0x17, 0x5c, 0x10, 0xf8, 0x2a, 0xa6, - 0xf9, 0x80, 0x17, 0x6f, 0xee, 0x02, 0x8a, 0x11, - 0xfc, 0x00, 0xf4, 0x95, 0x4a, 0x08, 0x4a, 0x09, - 0x4a, 0x0a, 0x4a, 0x07, 0x4a, 0x1d, 0x68, 0xf8, - 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, 0x00, 0x07, - 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, 0xff, 0xfc, - 0x10, 0xf8, 0x2a, 0xa7, 0xf8, 0x44, 0x0e, 0x4b, - 0x76, 0xf8, 0x2a, 0xa3, 0x00, 0x01, 0xf0, 0x73, - 0x0e, 0x4e, 0x76, 0xf8, 0x2a, 0xa4, 0x00, 0x01, - 0x8a, 0x1d, 0x8a, 0x07, 0x8a, 0x0a, 0x8a, 0x09, - 0x8a, 0x08, 0xf4, 0xeb, 0x4a, 0x11, 0x4a, 0x16, - 0x4a, 0x17, 0xee, 0xfe, 0x88, 0x0e, 0x71, 0x08, - 0x00, 0x16, 0x71, 0x06, 0x00, 0x17, 0x11, 0x07, - 0xf0, 0x66, 0x00, 0x0d, 0xf0, 0x00, 0x25, 0xa0, - 0x88, 0x11, 0x76, 0x01, 0x00, 0x06, 0x81, 0x00, - 0xf2, 0x74, 0x06, 0xce, 0xf0, 0x00, 0x00, 0x01, - 0x76, 0x01, 0x00, 0x06, 0x70, 0x00, 0x00, 0x16, - 0x48, 0x11, 0xf2, 0x74, 0x06, 0xce, 0xf0, 0x00, - 0x00, 0x07, 0x70, 0x81, 0x00, 0x17, 0xee, 0x02, - 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x11, 0xfc, 0x00, - 0x4a, 0x11, 0x88, 0x0e, 0x71, 0x02, 0x00, 0x12, - 0x11, 0x03, 0xf0, 0x66, 0x00, 0x0d, 0xf0, 0x00, - 0x24, 0x00, 0x88, 0x11, 0xf4, 0x95, 0x70, 0x81, - 0x00, 0x12, 0x6e, 0xe2, 0xff, 0xfe, 0x0e, 0x8d, - 0xf4, 0x95, 0xe8, 0x00, 0xe8, 0x01, 0x80, 0xe1, - 0x00, 0x02, 0x76, 0xe1, 0x00, 0x03, 0x00, 0xff, - 0x76, 0xe1, 0x00, 0x04, 0x00, 0x00, 0x76, 0xe1, - 0x00, 0x0b, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x0c, - 0x00, 0x00, 0x81, 0xe1, 0x00, 0x01, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfc, 0x88, 0x0e, - 0xf4, 0x95, 0xf1, 0x66, 0x00, 0x0d, 0xf3, 0x00, - 0x24, 0x00, 0x89, 0x11, 0xf4, 0x95, 0xf4, 0x95, - 0x76, 0xe1, 0x00, 0x0c, 0x00, 0x00, 0x76, 0xe1, - 0x00, 0x0b, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x02, - 0x00, 0x01, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01, - 0x00, 0x00, 0x80, 0x02, 0x76, 0x03, 0x00, 0x00, - 0xf2, 0x74, 0x0c, 0xb9, 0xf4, 0x95, 0xe8, 0x00, - 0xee, 0x04, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, - 0x88, 0x19, 0xf4, 0x95, 0x73, 0x19, 0x00, 0x0e, - 0xf1, 0x66, 0x00, 0x0d, 0xf2, 0x00, 0x24, 0x00, - 0x77, 0x15, 0x25, 0xa0, 0x77, 0x14, 0x00, 0x00, - 0x77, 0x1a, 0x00, 0x1f, 0xf0, 0x72, 0x0f, 0x14, - 0xf6, 0xb8, 0x49, 0x19, 0x09, 0x85, 0xf8, 0x4c, - 0x0f, 0x13, 0xf1, 0x00, 0x00, 0x05, 0x89, 0x11, - 0x49, 0x15, 0xf3, 0x00, 0x00, 0x01, 0x89, 0x13, - 0x49, 0x15, 0xf3, 0x00, 0x00, 0x07, 0x89, 0x12, - 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x10, - 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x80, 0x0f, 0x13, - 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x10, - 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x80, 0x0f, 0x13, - 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x10, - 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x80, 0x0f, 0x13, - 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x10, - 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x80, 0x0f, 0x13, - 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x10, - 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x80, 0x0f, 0x13, - 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x11, - 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x81, 0x0f, 0x13, - 0x6d, 0x94, 0x6d, 0xed, 0x00, 0x0d, 0x48, 0x14, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x4a, 0x16, - 0x4a, 0x17, 0xee, 0xf8, 0x88, 0x17, 0x10, 0x0d, - 0x80, 0x04, 0x10, 0x0c, 0x80, 0x05, 0x71, 0x0e, - 0x00, 0x16, 0x73, 0x17, 0x00, 0x0e, 0xf0, 0x66, - 0x00, 0x0d, 0xf0, 0x00, 0x24, 0x00, 0x88, 0x11, - 0x10, 0xf8, 0x27, 0x63, 0xf8, 0x45, 0x0f, 0x32, - 0xf2, 0x74, 0x0e, 0x9f, 0xf4, 0x95, 0x48, 0x17, - 0x10, 0xf8, 0x27, 0x60, 0xf8, 0x44, 0x0f, 0x3d, - 0x60, 0xe1, 0x00, 0x02, 0x00, 0x01, 0xf8, 0x20, - 0x0f, 0x6d, 0xf0, 0x73, 0x11, 0x33, 0x10, 0x04, - 0x80, 0x00, 0x10, 0x05, 0xf0, 0x74, 0x06, 0x9f, - 0x11, 0x04, 0xf3, 0x00, 0x00, 0x01, 0x81, 0x04, - 0x6d, 0x8e, 0x77, 0x10, 0x00, 0x01, 0x71, 0xe1, - 0x00, 0x02, 0x00, 0x12, 0xf4, 0xaa, 0xf8, 0x30, - 0x0f, 0x62, 0x77, 0x10, 0x00, 0x02, 0xf4, 0xaa, - 0xf8, 0x30, 0x0f, 0x6d, 0x45, 0xe1, 0x00, 0x0b, - 0x88, 0x10, 0x43, 0xe1, 0x00, 0x0c, 0x83, 0xf8, - 0x00, 0x12, 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0xaa, - 0xf8, 0x30, 0x0f, 0x6d, 0xf0, 0x73, 0x0f, 0x96, - 0xf5, 0x00, 0x81, 0x04, 0x49, 0x16, 0xf5, 0x20, - 0x89, 0x16, 0x76, 0xe1, 0x00, 0x0c, 0x00, 0x00, - 0x76, 0xe1, 0x00, 0x04, 0x00, 0x00, 0x48, 0x16, - 0xf8, 0x45, 0x11, 0x33, 0xf7, 0xb8, 0x71, 0xe1, - 0x00, 0x02, 0x00, 0x12, 0x10, 0xf8, 0x00, 0x12, - 0xf0, 0x10, 0x00, 0x03, 0xf8, 0x46, 0x0f, 0x8c, - 0x10, 0xf8, 0x00, 0x12, 0xf0, 0x10, 0x00, 0x03, - 0xf8, 0x45, 0x10, 0x16, 0x77, 0x10, 0x00, 0x01, - 0xf4, 0xaa, 0xf8, 0x30, 0x0f, 0x9c, 0x77, 0x10, - 0x00, 0x02, 0xf4, 0xaa, 0xf8, 0x30, 0x0f, 0xa8, - 0xf0, 0x73, 0x0f, 0x96, 0x77, 0x10, 0x00, 0x04, - 0xf4, 0xaa, 0xf8, 0x30, 0x10, 0xb7, 0x77, 0x10, - 0x00, 0x05, 0xf4, 0xaa, 0xf8, 0x30, 0x10, 0xbc, - 0xf2, 0x74, 0x0e, 0x9f, 0xf4, 0x95, 0x48, 0x17, - 0xf0, 0x73, 0x11, 0x31, 0x76, 0xe1, 0x00, 0x0c, - 0x00, 0x00, 0x76, 0xe1, 0x00, 0x0b, 0x00, 0x00, - 0x76, 0xe1, 0x00, 0x04, 0x00, 0x00, 0x76, 0xe1, - 0x00, 0x02, 0x00, 0x02, 0x11, 0xe1, 0x00, 0x0c, - 0xe8, 0x03, 0xf6, 0x20, 0x89, 0x12, 0xf4, 0x95, - 0x77, 0x10, 0x00, 0x03, 0xf5, 0xaa, 0xf8, 0x30, - 0x0f, 0xb6, 0x6b, 0xf8, 0x27, 0x6f, 0x00, 0x01, - 0x88, 0x10, 0xf4, 0x95, 0xf4, 0x95, 0xf5, 0xae, - 0xf8, 0x20, 0x0f, 0xbd, 0x48, 0x16, 0x80, 0x06, - 0x88, 0x13, 0xf4, 0x95, 0x77, 0x10, 0x00, 0x03, - 0xf6, 0xab, 0xf8, 0x20, 0x0f, 0xc8, 0x6b, 0xf8, - 0x27, 0x6f, 0x00, 0x01, 0x12, 0x06, 0xf8, 0x45, - 0x10, 0x00, 0x10, 0xe1, 0x00, 0x04, 0x80, 0x00, - 0x10, 0x05, 0x80, 0x01, 0x10, 0x04, 0x80, 0x02, - 0x10, 0x06, 0x80, 0x03, 0x48, 0x11, 0xf2, 0x74, - 0x07, 0x1e, 0xf0, 0x00, 0x00, 0x05, 0x10, 0x06, - 0x00, 0xe1, 0x00, 0x04, 0x80, 0xe1, 0x00, 0x04, - 0x10, 0x06, 0x00, 0xe1, 0x00, 0x0c, 0x80, 0xe1, - 0x00, 0x0c, 0x88, 0x12, 0x11, 0x06, 0x10, 0x04, - 0xf6, 0x00, 0x80, 0x04, 0x48, 0x16, 0xf6, 0x20, - 0x88, 0x16, 0x89, 0x13, 0xf4, 0x95, 0x77, 0x10, - 0x00, 0x03, 0xf6, 0xab, 0xf8, 0x20, 0x0f, 0xf5, - 0x6b, 0xf8, 0x27, 0x6f, 0x00, 0x01, 0x77, 0x10, - 0x00, 0x0c, 0x71, 0xe1, 0x00, 0x04, 0x00, 0x13, - 0xf6, 0xab, 0xf8, 0x20, 0x10, 0x00, 0x6b, 0xf8, - 0x27, 0x6f, 0x00, 0x01, 0x6c, 0xe2, 0xff, 0xfd, - 0x11, 0x31, 0xf6, 0xb8, 0x6f, 0xe1, 0x00, 0x05, - 0x0c, 0x48, 0x6f, 0xe1, 0x00, 0x06, 0x0c, 0x18, - 0xf0, 0x30, 0x0f, 0xff, 0xf0, 0x00, 0x00, 0x03, - 0x80, 0xe1, 0x00, 0x0b, 0x76, 0xe1, 0x00, 0x02, - 0x00, 0x03, 0x48, 0x16, 0xf8, 0x45, 0x11, 0x33, - 0x71, 0xe1, 0x00, 0x0c, 0x00, 0x12, 0x10, 0xe1, - 0x00, 0x0b, 0x49, 0x12, 0xf6, 0x20, 0x88, 0x13, - 0xe8, 0x0c, 0xf6, 0x20, 0x88, 0x10, 0xf4, 0x95, - 0xf4, 0x95, 0xf5, 0xab, 0xf8, 0x20, 0x10, 0x27, - 0x48, 0x13, 0x80, 0x06, 0x88, 0x10, 0xf4, 0x95, - 0xf4, 0x95, 0xf5, 0xae, 0xf8, 0x20, 0x10, 0x30, - 0x70, 0x06, 0x00, 0x16, 0x12, 0x06, 0xf8, 0x45, - 0x10, 0x5f, 0x10, 0xe1, 0x00, 0x04, 0x80, 0x00, - 0x10, 0x05, 0x80, 0x01, 0x10, 0x04, 0x80, 0x02, - 0x10, 0x06, 0x80, 0x03, 0x48, 0x11, 0xf2, 0x74, - 0x07, 0x1e, 0xf0, 0x00, 0x00, 0x05, 0x10, 0x06, - 0x00, 0xe1, 0x00, 0x04, 0x80, 0xe1, 0x00, 0x04, - 0x10, 0x06, 0x00, 0xe1, 0x00, 0x0c, 0x80, 0xe1, - 0x00, 0x0c, 0x88, 0x12, 0x11, 0x06, 0x10, 0x04, - 0xf6, 0x00, 0x80, 0x04, 0x48, 0x16, 0xf6, 0x20, - 0x88, 0x16, 0xf4, 0x95, 0x77, 0x10, 0x00, 0x0c, - 0x71, 0xe1, 0x00, 0x04, 0x00, 0x13, 0xf6, 0xab, - 0xf8, 0x20, 0x10, 0x5f, 0x6b, 0xf8, 0x27, 0x6f, - 0x00, 0x01, 0x77, 0x10, 0x00, 0x0c, 0xf6, 0xaa, - 0xf8, 0x20, 0x10, 0x6b, 0xf2, 0x74, 0x0e, 0x9f, - 0xf4, 0x95, 0x48, 0x17, 0x71, 0xe1, 0x00, 0x0c, - 0x00, 0x12, 0x77, 0x10, 0x00, 0x0c, 0xf4, 0xaa, - 0xf8, 0x30, 0x10, 0x7c, 0x77, 0x10, 0x00, 0x0c, - 0x71, 0xe1, 0x00, 0x0b, 0x00, 0x13, 0xf6, 0xab, - 0xf8, 0x30, 0x10, 0xb4, 0xe7, 0x30, 0xf7, 0xaa, - 0xf8, 0x30, 0x10, 0xb4, 0xf2, 0x74, 0x0e, 0xc1, - 0xf4, 0x95, 0x48, 0x17, 0x88, 0x12, 0xf4, 0x95, - 0xf4, 0x95, 0x6c, 0x82, 0x10, 0x8d, 0x76, 0xe1, - 0x00, 0x04, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x02, - 0x00, 0x05, 0xf0, 0x73, 0x10, 0xb4, 0x76, 0xe1, - 0x00, 0x02, 0x00, 0x04, 0x77, 0x10, 0x00, 0x0c, - 0x71, 0xe1, 0x00, 0x0b, 0x00, 0x12, 0xf5, 0xaa, - 0xf8, 0x20, 0x10, 0x9a, 0xf0, 0x73, 0x10, 0x9c, - 0x77, 0x12, 0x00, 0x0c, 0x76, 0x00, 0x00, 0x00, - 0x70, 0x01, 0x00, 0x12, 0x70, 0x02, 0x00, 0x17, - 0x76, 0x03, 0x00, 0x01, 0x48, 0x11, 0xf2, 0x74, - 0x0c, 0xb9, 0xf0, 0x00, 0x00, 0x05, 0x76, 0xe1, - 0x00, 0x04, 0x00, 0x00, 0x77, 0x10, 0x00, 0x0c, - 0x71, 0xe1, 0x00, 0x0b, 0x00, 0x12, 0xf6, 0xaa, - 0xf8, 0x20, 0x11, 0x1c, 0x48, 0x16, 0xf8, 0x45, - 0x11, 0x33, 0x60, 0xe1, 0x00, 0x02, 0x00, 0x05, - 0xf8, 0x20, 0x10, 0xdf, 0x10, 0xe1, 0x00, 0x0b, - 0x08, 0xe1, 0x00, 0x0c, 0x11, 0xe1, 0x00, 0x04, - 0xf8, 0x4d, 0x10, 0xc7, 0x6b, 0xf8, 0x27, 0x6f, - 0x00, 0x01, 0x88, 0x10, 0xf4, 0x95, 0xf4, 0x95, - 0xf5, 0xae, 0xf8, 0x20, 0x10, 0xcf, 0x48, 0x16, - 0xf4, 0x95, 0x48, 0x08, 0xf8, 0x45, 0x11, 0x16, - 0x6f, 0xe1, 0x00, 0x0c, 0x0d, 0x00, 0x81, 0xe1, - 0x00, 0x0c, 0x11, 0x04, 0xf5, 0x00, 0x81, 0x04, - 0x49, 0x16, 0xf5, 0x20, 0x89, 0x16, 0xf0, 0x73, - 0x11, 0x0e, 0x10, 0xe1, 0x00, 0x0b, 0x71, 0xe1, - 0x00, 0x0c, 0x00, 0x12, 0x88, 0x10, 0xf4, 0x95, - 0xf4, 0x95, 0xf6, 0xaa, 0xf8, 0x30, 0x11, 0x16, - 0x49, 0x12, 0xf6, 0x20, 0x88, 0x10, 0xf4, 0x95, - 0xf4, 0x95, 0xf5, 0xae, 0xf8, 0x20, 0x10, 0xf3, - 0x48, 0x16, 0x80, 0x06, 0x48, 0x08, 0xf8, 0x45, - 0x11, 0x16, 0x10, 0x04, 0x70, 0x02, 0x00, 0x17, - 0x80, 0x00, 0x76, 0x03, 0x00, 0x00, 0x10, 0x06, - 0x80, 0x01, 0x10, 0x05, 0xf0, 0x74, 0x0c, 0xb9, - 0x10, 0x06, 0x00, 0xe1, 0x00, 0x0c, 0x80, 0xe1, - 0x00, 0x0c, 0x11, 0x06, 0x10, 0x04, 0xf6, 0x00, - 0x80, 0x04, 0x48, 0x16, 0xf6, 0x20, 0x88, 0x16, - 0x10, 0xe1, 0x00, 0x0c, 0x08, 0xe1, 0x00, 0x0b, - 0xf8, 0x45, 0x11, 0x1c, 0xf0, 0x73, 0x11, 0x31, - 0xf2, 0x74, 0x0e, 0x9f, 0xf4, 0x95, 0x48, 0x17, - 0xf0, 0x73, 0x11, 0x33, 0x76, 0xe1, 0x00, 0x0c, - 0x00, 0x00, 0x76, 0xe1, 0x00, 0x0b, 0x00, 0x00, - 0x76, 0xe1, 0x00, 0x02, 0x00, 0x01, 0x10, 0x04, - 0x80, 0x00, 0x10, 0x05, 0xf0, 0x74, 0x06, 0x9f, - 0x88, 0x12, 0xf4, 0x95, 0x77, 0x10, 0x00, 0xff, - 0xf4, 0xaa, 0xf8, 0x30, 0x11, 0x33, 0x6c, 0x86, - 0x0f, 0x70, 0xee, 0x08, 0x8a, 0x17, 0x8a, 0x16, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfc, - 0xf4, 0x95, 0x71, 0x06, 0x00, 0x12, 0x88, 0x11, - 0x73, 0x12, 0x00, 0x0e, 0xf1, 0x66, 0x00, 0x0d, - 0xf3, 0x00, 0x24, 0x00, 0x89, 0x14, 0x13, 0x81, - 0xf7, 0x7a, 0xf3, 0x30, 0x00, 0x01, 0x81, 0xf8, - 0x27, 0x60, 0x13, 0xe1, 0x00, 0x01, 0xf7, 0x7c, - 0xf3, 0x30, 0x00, 0x03, 0x81, 0xf8, 0x27, 0x61, - 0xe9, 0x0f, 0x19, 0xe1, 0x00, 0x01, 0x81, 0xf8, - 0x27, 0x62, 0x71, 0xe4, 0x00, 0x03, 0x00, 0x13, - 0xf6, 0xb8, 0x49, 0x13, 0xf3, 0x00, 0x00, 0x01, - 0xf3, 0x30, 0x00, 0x0f, 0x49, 0x0b, 0x09, 0xf8, - 0x27, 0x62, 0xf8, 0x4d, 0x11, 0x75, 0x77, 0x10, - 0x00, 0xff, 0xf4, 0xab, 0xf8, 0x30, 0x11, 0x75, - 0x57, 0xf8, 0x27, 0x6c, 0xf3, 0x00, 0x00, 0x01, - 0x4f, 0xf8, 0x27, 0x6c, 0x76, 0xf8, 0x27, 0x63, - 0x00, 0x01, 0xf0, 0x73, 0x11, 0x78, 0x76, 0xf8, - 0x27, 0x63, 0x00, 0x00, 0x70, 0xe4, 0x00, 0x03, - 0x27, 0x62, 0x76, 0xf8, 0x27, 0x64, 0x00, 0x00, - 0x11, 0xf8, 0x27, 0x61, 0x61, 0xf8, 0x00, 0x0b, - 0x00, 0x02, 0xf8, 0x20, 0x11, 0x8d, 0xe9, 0x01, - 0x6f, 0xe1, 0x00, 0x02, 0x0f, 0x18, 0x81, 0xf8, - 0x27, 0x64, 0x11, 0xf8, 0x27, 0x61, 0x61, 0xf8, - 0x00, 0x0b, 0x00, 0x01, 0xf8, 0x20, 0x11, 0xa9, - 0x10, 0xf8, 0x27, 0x64, 0xf1, 0x00, 0x00, 0x04, - 0x89, 0x13, 0xe9, 0xb8, 0xf5, 0x20, 0x81, 0xf8, - 0x27, 0x65, 0x60, 0x84, 0x00, 0x02, 0xf8, 0x20, - 0x11, 0xa9, 0x70, 0x00, 0x00, 0x11, 0x70, 0x01, - 0x00, 0x13, 0x70, 0x02, 0x27, 0x65, 0xf2, 0x74, - 0x0f, 0x18, 0xf4, 0x95, 0x48, 0x12, 0xee, 0x04, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x4a, 0x16, - 0x4a, 0x17, 0xee, 0xfc, 0xe8, 0x00, 0x4e, 0xf8, - 0x27, 0x66, 0xe8, 0x00, 0x4e, 0xf8, 0x27, 0x68, - 0xe8, 0x00, 0x4e, 0xf8, 0x27, 0x6c, 0xe8, 0x00, - 0x4e, 0xf8, 0x27, 0x6a, 0x77, 0x12, 0x27, 0x40, - 0x77, 0x11, 0x24, 0x00, 0x77, 0x1a, 0x00, 0x1f, - 0xf0, 0x72, 0x11, 0xdb, 0x70, 0x92, 0x00, 0x11, - 0x76, 0xe1, 0x00, 0x01, 0xff, 0xff, 0x76, 0x81, - 0x00, 0x00, 0x76, 0xe1, 0x00, 0x02, 0x00, 0x00, - 0x76, 0xe1, 0x00, 0x03, 0x00, 0xff, 0x76, 0xe1, - 0x00, 0x0c, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x0b, - 0x00, 0x00, 0x76, 0xe1, 0x00, 0x04, 0x00, 0x00, - 0x6d, 0xe9, 0x00, 0x0d, 0xf0, 0x20, 0x25, 0xa0, - 0xf1, 0x00, 0x00, 0x07, 0x89, 0x11, 0xf1, 0x00, - 0x00, 0x01, 0x81, 0x02, 0x88, 0x16, 0xf4, 0x95, - 0x77, 0x17, 0x00, 0x20, 0x76, 0x86, 0x00, 0xff, - 0x76, 0x00, 0x00, 0x00, 0x76, 0x01, 0x00, 0x06, - 0x10, 0x02, 0xf0, 0x74, 0x06, 0x6c, 0x76, 0x00, - 0x00, 0x00, 0x76, 0x01, 0x00, 0x06, 0xf2, 0x74, - 0x06, 0x6c, 0xf4, 0x95, 0x48, 0x11, 0x10, 0x02, - 0xf0, 0x00, 0x00, 0x0d, 0x80, 0x02, 0x6d, 0xe9, - 0x00, 0x0d, 0x6d, 0xee, 0x00, 0x0d, 0x6c, 0xef, - 0xff, 0xff, 0x11, 0xe8, 0xf0, 0x74, 0x0c, 0x9d, - 0xee, 0x04, 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x11, - 0xfc, 0x00, 0x4a, 0x11, 0x4a, 0x16, 0x4a, 0x17, - 0xee, 0xfa, 0x88, 0x11, 0x10, 0x0a, 0x49, 0x11, - 0xf8, 0x4d, 0x12, 0x9f, 0x48, 0x08, 0xf8, 0x45, - 0x12, 0x9f, 0x80, 0x04, 0x12, 0x81, 0xf5, 0x78, - 0x89, 0x12, 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0xe2, - 0xff, 0xb9, 0x12, 0x8a, 0x61, 0xf8, 0x00, 0x08, - 0x00, 0x80, 0xf8, 0x30, 0x12, 0x8a, 0x13, 0xe1, - 0x00, 0x01, 0xf0, 0xe8, 0xf7, 0x78, 0xf1, 0xa0, - 0xf2, 0x30, 0x1f, 0xff, 0x88, 0x17, 0xf4, 0x95, - 0x77, 0x12, 0x24, 0x00, 0x77, 0x16, 0x00, 0x00, - 0x77, 0x13, 0x00, 0x20, 0xf6, 0xb8, 0x48, 0x17, - 0x08, 0xe2, 0x00, 0x01, 0xf8, 0x45, 0x12, 0x42, - 0x6d, 0xea, 0x00, 0x0d, 0x6d, 0x96, 0x6c, 0xeb, - 0xff, 0xff, 0x12, 0x34, 0xf0, 0x73, 0x12, 0x90, - 0x56, 0xf8, 0x27, 0x6a, 0xf0, 0x00, 0x00, 0x01, - 0x4e, 0xf8, 0x27, 0x6a, 0x60, 0x82, 0x00, 0x01, - 0xf8, 0x30, 0x12, 0x54, 0x70, 0x00, 0x00, 0x16, - 0xf2, 0x74, 0x11, 0x38, 0xf4, 0x95, 0x48, 0x11, - 0xf0, 0x73, 0x12, 0x90, 0x70, 0x00, 0x00, 0x16, - 0xf2, 0x74, 0x11, 0x38, 0xf4, 0x95, 0x48, 0x11, - 0x72, 0x10, 0x2a, 0x9e, 0xf4, 0x95, 0xf4, 0xaf, - 0xf8, 0x30, 0x12, 0x6e, 0x76, 0x00, 0x00, 0x00, - 0x76, 0x01, 0x00, 0xbc, 0x70, 0x02, 0x00, 0x16, - 0x76, 0x03, 0x00, 0x00, 0xf2, 0x74, 0x0c, 0xb9, - 0xf4, 0x95, 0x48, 0x11, 0xf0, 0x73, 0x12, 0x90, - 0x10, 0xf8, 0x27, 0x6e, 0xf8, 0x44, 0x12, 0x90, - 0x76, 0x00, 0x00, 0x00, 0x76, 0x01, 0x00, 0xbc, - 0x70, 0x02, 0x00, 0x16, 0x76, 0x03, 0x00, 0x00, - 0xf2, 0x74, 0x0c, 0xb9, 0xf4, 0x95, 0x48, 0x11, - 0xf0, 0x74, 0x0c, 0x5e, 0xf0, 0xe0, 0xf0, 0x10, - 0x13, 0x88, 0xf8, 0x42, 0x12, 0x90, 0x76, 0xf8, - 0x27, 0x6e, 0x00, 0x01, 0xf0, 0x73, 0x12, 0x90, - 0x56, 0xf8, 0x27, 0x66, 0xf0, 0x00, 0x00, 0x01, - 0x4e, 0xf8, 0x27, 0x66, 0x6d, 0xe9, 0x00, 0x5e, - 0x56, 0xf8, 0x27, 0x68, 0xf0, 0x00, 0x00, 0x01, - 0x4e, 0xf8, 0x27, 0x68, 0x71, 0x04, 0x00, 0x12, - 0x6e, 0xea, 0xff, 0xff, 0x12, 0x18, 0x70, 0x04, - 0x00, 0x12, 0xee, 0x06, 0x8a, 0x17, 0x8a, 0x16, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, - 0x88, 0x0e, 0xf4, 0x95, 0xf0, 0x66, 0x00, 0x0d, - 0xf0, 0x00, 0x25, 0xa0, 0x88, 0x11, 0xf4, 0x95, - 0xf4, 0x95, 0x76, 0x81, 0x00, 0xff, 0x76, 0x00, - 0x00, 0x00, 0x76, 0x01, 0x00, 0x06, 0xf2, 0x74, - 0x06, 0x6c, 0xf0, 0x00, 0x00, 0x01, 0x76, 0x00, - 0x00, 0x00, 0x76, 0x01, 0x00, 0x06, 0x48, 0x11, - 0xf2, 0x74, 0x06, 0x6c, 0xf0, 0x00, 0x00, 0x07, - 0xee, 0x02, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, - 0x88, 0x0e, 0xf4, 0x95, 0xf0, 0x66, 0x00, 0x0d, - 0xf0, 0x00, 0x24, 0x00, 0x88, 0x11, 0xf4, 0x95, - 0xf4, 0x95, 0x76, 0xe1, 0x00, 0x01, 0xff, 0xff, - 0x76, 0x81, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x02, - 0x00, 0x00, 0x76, 0xe1, 0x00, 0x03, 0x00, 0xff, - 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xf4, 0x95, - 0x13, 0x03, 0x88, 0x11, 0xfa, 0x4d, 0x12, 0xec, - 0x71, 0x02, 0x00, 0x12, 0xf3, 0x10, 0x00, 0x01, - 0x89, 0x1a, 0xf4, 0x95, 0xf0, 0x72, 0x12, 0xeb, - 0x70, 0x91, 0x00, 0x12, 0x8a, 0x11, 0xfc, 0x00, - 0xf4, 0x95, 0x4a, 0x0b, 0x4a, 0x0c, 0x4a, 0x0d, - 0xf7, 0xb8, 0xee, 0xfe, 0x10, 0xf8, 0x00, 0x08, - 0x11, 0x06, 0xf1, 0xc0, 0x83, 0x00, 0xf4, 0x85, - 0x11, 0x06, 0xf7, 0x85, 0x81, 0x06, 0xf6, 0xb8, - 0xec, 0x0f, 0x1e, 0x06, 0x61, 0x00, 0x80, 0x00, - 0xf8, 0x20, 0x13, 0x05, 0xf4, 0x84, 0xee, 0x02, - 0x8a, 0x0d, 0x8a, 0x0c, 0x8a, 0x0b, 0xfc, 0x00, - 0xf4, 0x95, 0x4a, 0x0b, 0x4a, 0x0c, 0x4a, 0x0d, - 0xee, 0xfe, 0xf7, 0xb8, 0x80, 0x00, 0x10, 0xf8, - 0x00, 0x08, 0xf4, 0x85, 0x11, 0x06, 0xf7, 0x85, - 0x81, 0x06, 0xf6, 0xb8, 0xec, 0x0f, 0x1e, 0x06, - 0xf0, 0xf0, 0x61, 0x00, 0x80, 0x00, 0xf8, 0x20, - 0x13, 0x20, 0xf4, 0x84, 0xee, 0x02, 0x8a, 0x0d, - 0x8a, 0x0c, 0x8a, 0x0b, 0xfc, 0x00, 0x4a, 0x11, - 0x77, 0x11, 0x00, 0x7b, 0x76, 0x81, 0x2e, 0xec, - 0x77, 0x11, 0x00, 0x7b, 0xee, 0xff, 0x71, 0x81, - 0x00, 0x11, 0xee, 0x01, 0x76, 0xe1, 0x00, 0x01, - 0x00, 0x00, 0x76, 0xe1, 0x00, 0x04, 0x00, 0x00, - 0x76, 0xe1, 0x00, 0x06, 0x00, 0x00, 0x76, 0xe1, - 0x00, 0x62, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x76, - 0x00, 0x00, 0x76, 0xe1, 0x00, 0x92, 0x00, 0x00, - 0x76, 0xe1, 0x00, 0x94, 0x00, 0x00, 0x76, 0xe1, - 0x00, 0xb0, 0x00, 0x00, 0x76, 0xe1, 0x00, 0xb3, - 0x00, 0x00, 0x76, 0xe1, 0x00, 0xbe, 0x00, 0x00, - 0x76, 0xe1, 0x00, 0xbf, 0x00, 0x00, 0x76, 0xe1, - 0x00, 0xc1, 0x00, 0x00, 0x76, 0xe1, 0x00, 0xc3, - 0x00, 0x00, 0x76, 0xe1, 0x00, 0xc5, 0x00, 0x00, - 0x76, 0xe1, 0x00, 0xc7, 0x00, 0x00, 0x76, 0x81, - 0x00, 0x00, 0x8a, 0x11, 0xf4, 0x95, 0xf4, 0xe4, - 0x4a, 0x11, 0x4a, 0x16, 0x4a, 0x17, 0xee, 0xff, - 0xf4, 0x95, 0x71, 0x06, 0x00, 0x16, 0xfb, 0x80, - 0x16, 0xa2, 0x88, 0x17, 0xf4, 0x95, 0xf7, 0xb8, - 0x10, 0xf8, 0x00, 0x17, 0xf0, 0x10, 0x00, 0x02, - 0xfa, 0x46, 0x13, 0x88, 0x77, 0x11, 0x00, 0x00, - 0x10, 0xf8, 0x00, 0x17, 0xf0, 0x10, 0x00, 0x02, - 0xf8, 0x45, 0x13, 0xf9, 0x10, 0xf8, 0x00, 0x17, - 0xf8, 0x45, 0x14, 0x39, 0x10, 0xf8, 0x00, 0x17, - 0xf0, 0x10, 0x00, 0x01, 0xf8, 0x45, 0x14, 0x1f, - 0xf0, 0x73, 0x14, 0x52, 0x10, 0xf8, 0x00, 0x17, - 0xf0, 0x10, 0x00, 0x03, 0xf8, 0x45, 0x13, 0xd3, - 0x10, 0xf8, 0x00, 0x17, 0xf0, 0x10, 0x00, 0x06, - 0xf8, 0x44, 0x14, 0x52, 0x77, 0x12, 0x00, 0x7b, - 0x71, 0x82, 0x00, 0x14, 0x61, 0xe4, 0x00, 0x07, - 0x00, 0x40, 0xf8, 0x30, 0x14, 0x52, 0x49, 0x14, - 0x48, 0x17, 0xf6, 0x00, 0x88, 0x12, 0xf4, 0x95, - 0x77, 0x13, 0x00, 0x55, 0x77, 0x11, 0x00, 0x57, - 0x6d, 0xea, 0x00, 0x3b, 0xe5, 0x01, 0x10, 0xe6, - 0x00, 0x06, 0x80, 0x81, 0x48, 0x14, 0x00, 0xf8, - 0x00, 0x17, 0x88, 0x12, 0xf4, 0x95, 0x77, 0x11, - 0x00, 0x55, 0x10, 0xe2, 0x00, 0x40, 0x80, 0x81, - 0x77, 0x11, 0x00, 0x57, 0x10, 0xe6, 0x00, 0x07, - 0x80, 0x81, 0x77, 0x11, 0x00, 0x55, 0x10, 0xe2, - 0x00, 0x45, 0x80, 0x81, 0x10, 0xe6, 0x00, 0x08, - 0x77, 0x11, 0x00, 0x57, 0x80, 0x81, 0x77, 0x11, - 0x00, 0x55, 0x10, 0xe2, 0x00, 0x4a, 0x80, 0x81, - 0x77, 0x11, 0x00, 0x57, 0x10, 0xe6, 0x00, 0x09, - 0x80, 0x81, 0xf2, 0x73, 0x14, 0x52, 0x77, 0x11, - 0x03, 0xc0, 0x77, 0x12, 0x00, 0x7b, 0x10, 0x82, - 0xf0, 0x00, 0x00, 0x07, 0x88, 0x13, 0xf4, 0x95, - 0xf4, 0x95, 0x96, 0x1b, 0xf8, 0x30, 0x14, 0x52, - 0x10, 0xe3, 0x00, 0x35, 0x77, 0x12, 0x00, 0x55, - 0x80, 0x82, 0x77, 0x12, 0x00, 0x57, 0x10, 0xe6, - 0x00, 0x04, 0x80, 0x82, 0x77, 0x12, 0x00, 0x55, - 0x10, 0xe3, 0x00, 0x37, 0x80, 0x82, 0x77, 0x12, - 0x00, 0x57, 0x10, 0xe6, 0x00, 0x05, 0x80, 0x82, - 0x48, 0x11, 0xf0, 0x40, 0x00, 0x10, 0xf2, 0x73, - 0x14, 0x50, 0xf0, 0x40, 0x00, 0x20, 0x77, 0x12, - 0x00, 0x7b, 0x10, 0x82, 0xf0, 0x00, 0x00, 0x07, - 0x88, 0x12, 0xf4, 0x95, 0xf4, 0x95, 0x96, 0x0d, - 0xf8, 0x30, 0x14, 0x52, 0x10, 0xe2, 0x00, 0x34, - 0x77, 0x13, 0x00, 0x55, 0x80, 0x83, 0x77, 0x13, - 0x00, 0x57, 0x10, 0xe6, 0x00, 0x02, 0x80, 0x83, - 0x10, 0xe2, 0x00, 0x36, 0x77, 0x12, 0x00, 0x55, - 0x80, 0x82, 0x77, 0x12, 0x00, 0x57, 0x10, 0xe6, - 0x00, 0x03, 0x80, 0x82, 0x48, 0x11, 0xf0, 0x40, - 0x00, 0x04, 0xf2, 0x73, 0x14, 0x50, 0xf0, 0x40, - 0x00, 0x08, 0x77, 0x12, 0x00, 0x7b, 0x10, 0x82, - 0xf0, 0x00, 0x00, 0x07, 0x88, 0x12, 0xf4, 0x95, - 0xf4, 0x95, 0x96, 0x0e, 0xf8, 0x30, 0x14, 0x52, - 0x10, 0xe2, 0x00, 0x33, 0x77, 0x12, 0x00, 0x55, - 0x80, 0x82, 0x77, 0x12, 0x00, 0x57, 0x10, 0xe6, - 0x00, 0x01, 0x80, 0x82, 0x48, 0x11, 0xf2, 0x73, - 0x14, 0x50, 0xf0, 0x40, 0x00, 0x02, 0x77, 0x12, - 0x00, 0x7b, 0x10, 0x82, 0xf0, 0x00, 0x00, 0x07, - 0x88, 0x12, 0xf4, 0x95, 0xf4, 0x95, 0x96, 0x0f, - 0xf8, 0x30, 0x14, 0x52, 0x10, 0xe2, 0x00, 0x32, - 0x77, 0x12, 0x00, 0x55, 0x77, 0x13, 0x00, 0x57, - 0x80, 0x82, 0x48, 0x11, 0xe7, 0x62, 0xf0, 0x40, - 0x00, 0x01, 0xe5, 0x01, 0x88, 0x11, 0xf4, 0x95, - 0x77, 0x12, 0x00, 0x7b, 0x48, 0x11, 0x71, 0x82, - 0x00, 0x12, 0x1a, 0xe2, 0x00, 0x07, 0x80, 0xe2, - 0x00, 0x07, 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x01, - 0x8a, 0x17, 0x48, 0x11, 0x8a, 0x16, 0x8a, 0x11, - 0xf4, 0xe4, 0x4a, 0x11, 0x88, 0x11, 0x77, 0x0e, - 0x00, 0x05, 0x77, 0x12, 0x00, 0x55, 0xe8, 0x04, - 0xf6, 0xb8, 0x28, 0xe1, 0x00, 0x02, 0xee, 0xff, - 0x80, 0x82, 0x77, 0x12, 0x00, 0x57, 0xf0, 0x20, - 0x80, 0x00, 0xee, 0x01, 0x1a, 0x82, 0x77, 0x12, - 0x00, 0x57, 0x80, 0x82, 0xe8, 0x01, 0x32, 0xe1, - 0x00, 0x02, 0xf5, 0x82, 0x77, 0x11, 0x00, 0x54, - 0xf6, 0x93, 0x18, 0x81, 0x77, 0x11, 0x00, 0x54, - 0xf2, 0xa0, 0x80, 0x81, 0x8a, 0x11, 0xf4, 0x95, - 0xf4, 0xe4, 0x4a, 0x11, 0x4a, 0x16, 0xf4, 0x95, - 0x71, 0x04, 0x00, 0x11, 0xfb, 0x80, 0x16, 0xa2, - 0x88, 0x16, 0xf4, 0x95, 0x77, 0x12, 0x00, 0x55, - 0x10, 0xe6, 0x00, 0x03, 0x80, 0x82, 0x77, 0x12, - 0x00, 0x56, 0x10, 0xe1, 0x00, 0x02, 0x77, 0x13, - 0x00, 0x56, 0x80, 0x82, 0x77, 0x12, 0x00, 0x56, - 0x10, 0xe1, 0x00, 0x03, 0x80, 0x82, 0x10, 0xe1, - 0x00, 0x04, 0x77, 0x12, 0x00, 0x56, 0x80, 0x82, - 0x77, 0x12, 0x00, 0x56, 0x10, 0xe1, 0x00, 0x01, - 0x80, 0x82, 0xe7, 0x12, 0xe5, 0x01, 0xf9, 0x80, - 0x16, 0x9a, 0x8a, 0x16, 0x8a, 0x11, 0xf4, 0xe4, - 0x4a, 0x11, 0x4a, 0x16, 0x4a, 0x17, 0xee, 0xf9, - 0x77, 0x11, 0x00, 0x7b, 0x76, 0x00, 0x00, 0x16, - 0x76, 0x01, 0x00, 0x17, 0x76, 0x02, 0x00, 0x1a, - 0x76, 0x03, 0x00, 0x1b, 0x76, 0x04, 0x00, 0x1c, - 0x76, 0x05, 0x00, 0x1d, 0x71, 0x81, 0x00, 0x17, - 0x71, 0xe7, 0x00, 0x06, 0x00, 0x11, 0x10, 0x81, - 0xf8, 0x44, 0x14, 0xdf, 0xf9, 0x80, 0x16, 0x53, - 0xf6, 0xb8, 0xfb, 0x80, 0x15, 0x85, 0xf0, 0x20, - 0xff, 0xff, 0xf6, 0xb8, 0xfb, 0x80, 0x16, 0x08, - 0xf0, 0x20, 0xff, 0xff, 0x77, 0x11, 0x00, 0x7b, - 0x71, 0x81, 0x00, 0x17, 0x76, 0xe7, 0x00, 0x06, - 0x00, 0x01, 0x48, 0x17, 0x77, 0x16, 0x00, 0x00, - 0x77, 0x10, 0x00, 0x04, 0x77, 0x15, 0x00, 0x03, - 0x77, 0x14, 0x00, 0x02, 0x77, 0x13, 0x00, 0x01, - 0xf0, 0x00, 0x00, 0x39, 0x76, 0xe7, 0x00, 0x08, - 0x00, 0x1f, 0x76, 0xe7, 0x00, 0x07, 0x00, 0x00, - 0x88, 0x0e, 0x77, 0x1a, 0x00, 0x05, 0x48, 0x17, - 0xf0, 0x00, 0x00, 0x09, 0x88, 0x12, 0x48, 0x18, - 0x88, 0x19, 0xe8, 0x00, 0xf0, 0x72, 0x15, 0x2c, - 0x73, 0x19, 0x00, 0x11, 0x76, 0x82, 0x00, 0x00, - 0x11, 0x91, 0x73, 0x11, 0x00, 0x19, 0x70, 0xe2, - 0x00, 0x03, 0x00, 0x16, 0x70, 0xe2, 0x00, 0x04, - 0x00, 0x13, 0x70, 0xe2, 0x00, 0x05, 0x00, 0x14, - 0x81, 0xe2, 0x00, 0x01, 0x70, 0xe2, 0x00, 0x06, - 0x00, 0x15, 0x70, 0xe2, 0x00, 0x07, 0x00, 0x10, - 0x80, 0xe2, 0x00, 0x02, 0x73, 0x0e, 0x00, 0x11, - 0xf1, 0x00, 0x00, 0x1e, 0x6d, 0xee, 0x00, 0x05, - 0x6d, 0xeb, 0x00, 0x05, 0x6d, 0xec, 0x00, 0x05, - 0x6d, 0xed, 0x00, 0x05, 0x6d, 0xe8, 0x00, 0x05, - 0xf0, 0x00, 0x00, 0x01, 0x81, 0x91, 0x6d, 0xea, - 0x00, 0x08, 0x73, 0x11, 0x00, 0x0e, 0xee, 0x07, - 0x76, 0xe7, 0x00, 0x41, 0x00, 0x24, 0x76, 0xe7, - 0x00, 0x46, 0x00, 0x25, 0x76, 0xe7, 0x00, 0x4b, - 0x00, 0x26, 0x76, 0xe7, 0x00, 0x50, 0x00, 0x27, - 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x11, 0xf4, 0xe4, - 0x4a, 0x11, 0x4a, 0x16, 0xee, 0xfe, 0x88, 0x11, - 0x56, 0x06, 0x4e, 0x00, 0xf9, 0x80, 0x16, 0xa2, - 0xf7, 0xb8, 0x10, 0xf8, 0x00, 0x11, 0xf0, 0x10, - 0xff, 0xff, 0xfa, 0x45, 0x15, 0x60, 0x77, 0x16, - 0xff, 0xff, 0x77, 0x12, 0x00, 0x7b, 0x49, 0x11, - 0x10, 0x82, 0xf6, 0x03, 0xf0, 0x00, 0x00, 0x09, - 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, - 0xf8, 0x44, 0x15, 0x71, 0xf2, 0x73, 0x15, 0x71, - 0xf4, 0x95, 0xe7, 0x16, 0x77, 0x11, 0x00, 0x7b, - 0x10, 0x81, 0xf0, 0x00, 0x00, 0x09, 0x88, 0x11, - 0xf4, 0x95, 0x77, 0x12, 0x00, 0x06, 0x10, 0x81, - 0xf8, 0x45, 0x15, 0x5c, 0x6e, 0xea, 0xff, 0xff, - 0x15, 0x69, 0x6d, 0xe9, 0x00, 0x08, 0x76, 0x86, - 0x00, 0x01, 0xe9, 0x01, 0x56, 0x00, 0xf1, 0x80, - 0x10, 0xf8, 0x00, 0x0b, 0xf8, 0x45, 0x15, 0x7e, - 0xfb, 0x80, 0x15, 0x85, 0xf4, 0x95, 0x48, 0x16, - 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x02, 0x48, 0x16, - 0x8a, 0x16, 0x8a, 0x11, 0xf4, 0xe4, 0x4a, 0x11, - 0xee, 0xff, 0xfb, 0x80, 0x16, 0xa2, 0x88, 0x11, - 0xf4, 0x95, 0x77, 0x10, 0xff, 0xff, 0xf4, 0xa9, - 0xf8, 0x30, 0x15, 0xc4, 0x10, 0xe1, 0x00, 0x03, - 0x77, 0x12, 0x00, 0x55, 0x80, 0x82, 0x77, 0x12, - 0x00, 0x56, 0x76, 0x82, 0x00, 0x00, 0x77, 0x12, - 0x00, 0x56, 0x76, 0x82, 0x00, 0x00, 0x77, 0x12, - 0x00, 0x56, 0x76, 0x82, 0x00, 0x00, 0x77, 0x12, - 0x00, 0x56, 0x76, 0x82, 0x00, 0x00, 0x77, 0x12, - 0x00, 0x56, 0x76, 0x82, 0x00, 0x00, 0x10, 0xe1, - 0x00, 0x02, 0xf0, 0x00, 0x00, 0x08, 0x32, 0xf8, - 0x00, 0x08, 0x77, 0x12, 0x00, 0x54, 0xe8, 0x01, - 0xf4, 0x82, 0xf4, 0x93, 0x18, 0x82, 0x77, 0x12, - 0x00, 0x54, 0xf0, 0x40, 0x00, 0x00, 0x80, 0x82, - 0x10, 0xe1, 0x00, 0x01, 0xf9, 0x80, 0x16, 0x76, - 0x10, 0xe1, 0x00, 0x01, 0xf9, 0x80, 0x16, 0x66, - 0xf0, 0x73, 0x16, 0x03, 0x77, 0x11, 0x00, 0x7b, - 0x71, 0x81, 0x00, 0x11, 0x71, 0xe1, 0x00, 0x07, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x10, 0xe1, - 0x00, 0x09, 0xf9, 0x80, 0x15, 0x85, 0x77, 0x11, - 0x00, 0x7b, 0x71, 0x81, 0x00, 0x11, 0x10, 0xe1, - 0x00, 0x09, 0xfb, 0x80, 0x15, 0x85, 0xf0, 0x00, - 0x00, 0x08, 0x77, 0x11, 0x00, 0x7b, 0x71, 0x81, - 0x00, 0x11, 0x10, 0xe1, 0x00, 0x09, 0xfb, 0x80, - 0x15, 0x85, 0xf0, 0x00, 0x00, 0x10, 0x77, 0x11, - 0x00, 0x7b, 0x71, 0x81, 0x00, 0x11, 0x10, 0xe1, - 0x00, 0x09, 0xfb, 0x80, 0x15, 0x85, 0xf0, 0x00, - 0x00, 0x18, 0x77, 0x11, 0x00, 0x7b, 0x71, 0x81, - 0x00, 0x11, 0x10, 0xe1, 0x00, 0x09, 0xfb, 0x80, - 0x15, 0x85, 0xf0, 0x00, 0x00, 0x20, 0x77, 0x11, - 0x00, 0x7b, 0x71, 0x81, 0x00, 0x11, 0x10, 0xe1, - 0x00, 0x09, 0xfb, 0x80, 0x15, 0x85, 0xf0, 0x00, - 0x00, 0x28, 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x01, - 0x8a, 0x11, 0xf4, 0xe4, 0x4a, 0x11, 0xee, 0xff, - 0xfb, 0x80, 0x16, 0xa2, 0x88, 0x11, 0xf4, 0x95, - 0x77, 0x10, 0xff, 0xff, 0xf4, 0xa9, 0xf8, 0x30, - 0x16, 0x41, 0x77, 0x11, 0x00, 0x55, 0x76, 0x81, - 0x00, 0x1e, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, - 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, - 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, - 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, - 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, - 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, - 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, - 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, - 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, - 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0xf2, 0x73, - 0x16, 0x4e, 0x76, 0x81, 0x00, 0x00, 0x77, 0x11, - 0x00, 0x7b, 0x71, 0x81, 0x00, 0x11, 0x71, 0xe1, - 0x00, 0x07, 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, - 0x10, 0xe1, 0x00, 0x39, 0xf9, 0x80, 0x16, 0x08, - 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x01, 0x8a, 0x11, - 0xf4, 0xe4, 0x4a, 0x11, 0x77, 0x11, 0x00, 0x7b, - 0x10, 0x81, 0xf0, 0x00, 0x00, 0x04, 0x88, 0x11, - 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, 0xfa, 0x44, - 0x16, 0x63, 0xf4, 0x95, 0xee, 0xff, 0x76, 0x81, - 0x00, 0x01, 0xee, 0x01, 0x8a, 0x11, 0xf4, 0xe4, - 0xf0, 0x10, 0x00, 0x10, 0x4a, 0x11, 0x32, 0xf8, - 0x00, 0x08, 0xee, 0xff, 0x77, 0x11, 0x00, 0x01, - 0xe8, 0x01, 0xee, 0x01, 0xf4, 0x82, 0x1a, 0x81, - 0x80, 0x81, 0x8a, 0x11, 0xf4, 0x95, 0xf4, 0xe4, - 0xf0, 0x10, 0x00, 0x10, 0x4a, 0x11, 0x32, 0xf8, - 0x00, 0x08, 0xee, 0xff, 0xe8, 0x01, 0x77, 0x11, - 0x00, 0x00, 0xf4, 0x82, 0xee, 0x01, 0xf4, 0x93, - 0x18, 0x81, 0x80, 0x81, 0x8a, 0x11, 0xf4, 0x95, - 0xf4, 0xe4, 0x4a, 0x11, 0xf0, 0x10, 0x00, 0x10, - 0x77, 0x11, 0x00, 0x00, 0x32, 0xf8, 0x00, 0x08, - 0xee, 0xff, 0x11, 0x81, 0xe8, 0x01, 0xee, 0x01, - 0x77, 0x11, 0x00, 0x00, 0xf4, 0x82, 0xf2, 0xa0, - 0x80, 0x81, 0x8a, 0x11, 0xf4, 0x95, 0xf4, 0xe4, - 0xf2, 0x73, 0x16, 0x9e, 0xf6, 0xbb, 0xf4, 0x95, - 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0xe4, - 0xf2, 0x73, 0x16, 0xa6, 0xf7, 0xbb, 0xf4, 0x95, - 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0xe4, - 0x4a, 0x11, 0x4a, 0x16, 0xf4, 0x95, 0x71, 0x04, - 0x00, 0x16, 0xfb, 0x80, 0x16, 0xa2, 0x88, 0x11, - 0xf4, 0x95, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x0e, 0x10, 0xe6, 0x00, 0x0e, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x80, 0x82, - 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, - 0x00, 0x0d, 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, - 0x10, 0xe6, 0x00, 0x0d, 0x80, 0x82, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x0c, - 0x10, 0xe6, 0x00, 0x0c, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x0b, 0x10, 0xe6, - 0x00, 0x0b, 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, - 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x0a, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x10, 0xe6, 0x00, 0x0a, 0x80, 0x82, - 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, - 0x00, 0x09, 0x10, 0xe6, 0x00, 0x09, 0x71, 0xe1, - 0x00, 0x06, 0x00, 0x12, 0x80, 0x82, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x08, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x10, 0xe6, - 0x00, 0x08, 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x07, 0x10, 0xe6, - 0x00, 0x07, 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, - 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x06, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x10, 0xe6, 0x00, 0x06, 0x80, 0x82, - 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, - 0x00, 0x05, 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, - 0x10, 0xe6, 0x00, 0x05, 0x80, 0x82, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x04, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x10, 0xe6, - 0x00, 0x04, 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x03, 0x71, 0xe1, - 0x00, 0x06, 0x00, 0x12, 0x10, 0xe6, 0x00, 0x03, - 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x02, 0x10, 0xe6, 0x00, 0x02, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x80, 0x82, - 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, - 0x00, 0x01, 0x10, 0xe6, 0x00, 0x01, 0x71, 0xe1, - 0x00, 0x06, 0x00, 0x12, 0x80, 0x82, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x13, 0xe7, 0x62, - 0xe5, 0x01, 0xf9, 0x80, 0x16, 0x9a, 0x8a, 0x16, - 0x8a, 0x11, 0xf4, 0xe4, 0x4a, 0x11, 0x88, 0x11, - 0xf4, 0x95, 0xf4, 0x95, 0x71, 0xe1, 0x00, 0x05, - 0x00, 0x12, 0xee, 0xff, 0x76, 0x82, 0x00, 0x00, - 0xee, 0x01, 0x71, 0xe1, 0x00, 0x06, 0x00, 0x11, - 0x69, 0x81, 0x00, 0x01, 0x8a, 0x11, 0xf4, 0x95, - 0xf4, 0xe4, 0x4a, 0x11, 0x88, 0x11, 0xf4, 0x95, - 0xf4, 0x95, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0xee, 0xff, 0x76, 0x82, 0x00, 0x01, 0xee, 0x01, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x11, 0x69, 0x81, - 0x00, 0x01, 0x8a, 0x11, 0xf4, 0x95, 0xf4, 0xe4, - 0x4a, 0x11, 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, - 0xf0, 0x00, 0x00, 0x94, 0x88, 0x11, 0xf4, 0x95, - 0xf4, 0x95, 0x10, 0x81, 0xfa, 0x44, 0x17, 0x9c, - 0xf4, 0x95, 0xee, 0xff, 0xf9, 0x80, 0x16, 0x53, - 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, 0xf0, 0x00, - 0x00, 0x94, 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, - 0x76, 0x81, 0x00, 0x01, 0xee, 0x01, 0x76, 0xe1, - 0x00, 0x01, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x02, - 0x00, 0x21, 0x76, 0xe1, 0x00, 0x03, 0x00, 0x20, - 0x76, 0xe1, 0x00, 0x04, 0x00, 0x23, 0x76, 0xe1, - 0x00, 0x05, 0x00, 0x22, 0x76, 0xe1, 0x00, 0x06, - 0x00, 0x38, 0x76, 0xe1, 0x00, 0x07, 0x00, 0x39, - 0x76, 0xe1, 0x00, 0x08, 0x00, 0x15, 0x76, 0xe1, - 0x00, 0x09, 0x00, 0x14, 0x76, 0xe1, 0x00, 0x0a, - 0x00, 0x00, 0x76, 0xe1, 0x00, 0x0b, 0x00, 0x41, - 0x76, 0xe1, 0x00, 0x0c, 0x00, 0x40, 0x76, 0xe1, - 0x00, 0x0d, 0x00, 0x43, 0x76, 0xe1, 0x00, 0x0e, - 0x00, 0x42, 0x76, 0xe1, 0x00, 0x0f, 0x00, 0x48, - 0x76, 0xe1, 0x00, 0x10, 0x00, 0x49, 0x76, 0xe1, - 0x00, 0x11, 0x00, 0x1b, 0x76, 0xe1, 0x00, 0x12, - 0x00, 0x1a, 0x8a, 0x11, 0xf4, 0x95, 0xf4, 0xe4, - 0x4a, 0x11, 0xee, 0xfd, 0x88, 0x11, 0x56, 0x06, - 0x4e, 0x00, 0xf9, 0x80, 0x16, 0xa2, 0x77, 0x12, - 0x00, 0x7b, 0x77, 0x0e, 0x00, 0x09, 0x10, 0x82, - 0x28, 0xf8, 0x00, 0x11, 0xf0, 0x00, 0x00, 0x95, - 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, - 0xf8, 0x45, 0x17, 0xf0, 0xf2, 0x73, 0x17, 0xfd, - 0x77, 0x11, 0xff, 0xff, 0x76, 0x81, 0x00, 0x01, - 0xe9, 0x01, 0x56, 0x00, 0xf1, 0x80, 0x10, 0xf8, - 0x00, 0x0b, 0xf8, 0x45, 0x17, 0xfd, 0xfb, 0x80, - 0x18, 0x10, 0xf4, 0x95, 0x48, 0x11, 0xf9, 0x80, - 0x16, 0x9a, 0xee, 0x03, 0x48, 0x11, 0x8a, 0x11, - 0xf4, 0x95, 0xf4, 0xe4, 0x4a, 0x11, 0x88, 0x11, - 0xf4, 0x95, 0xee, 0xff, 0x71, 0xe1, 0x00, 0x01, - 0x00, 0x11, 0xee, 0x01, 0x10, 0x81, 0x8a, 0x11, - 0xf4, 0x95, 0xf4, 0xe4, 0x4a, 0x11, 0xee, 0xff, - 0xfb, 0x80, 0x16, 0xa2, 0x88, 0x11, 0xf4, 0x95, - 0x77, 0x10, 0xff, 0xff, 0xf4, 0xa9, 0xf8, 0x30, - 0x18, 0xc3, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x01, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, - 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x02, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x03, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, - 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x04, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x05, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, - 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x06, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x01, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x07, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, - 0x20, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x08, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x09, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, - 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x0a, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x0b, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, - 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x0c, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, - 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x0d, - 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, - 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, - 0x76, 0x82, 0x00, 0x0e, 0x71, 0xe1, 0x00, 0x06, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x10, 0xe1, - 0x00, 0x07, 0xf9, 0x80, 0x16, 0x76, 0x10, 0xe1, - 0x00, 0x08, 0xf9, 0x80, 0x16, 0x76, 0x10, 0xe1, - 0x00, 0x07, 0xf9, 0x80, 0x16, 0x66, 0x10, 0xe1, - 0x00, 0x08, 0xf9, 0x80, 0x16, 0x66, 0xf0, 0x73, - 0x18, 0xd1, 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, - 0xfb, 0x80, 0x18, 0x10, 0xf0, 0x00, 0x00, 0x95, - 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, 0xfb, 0x80, - 0x18, 0x10, 0xf0, 0x00, 0x00, 0x9e, 0xf9, 0x80, - 0x16, 0x9a, 0xee, 0x01, 0x8a, 0x11, 0xf4, 0xe4, - 0x4a, 0x11, 0x88, 0x11, 0xee, 0xff, 0xf4, 0x95, - 0x10, 0x04, 0x71, 0xe1, 0x00, 0x03, 0x00, 0x11, - 0xee, 0x01, 0x80, 0x81, 0x8a, 0x11, 0xf4, 0x95, - 0xf4, 0xe4, 0x4a, 0x11, 0x4a, 0x16, 0xf4, 0x95, - 0x71, 0x04, 0x00, 0x16, 0xfb, 0x80, 0x16, 0xa2, - 0x88, 0x11, 0xf4, 0x95, 0x71, 0xe1, 0x00, 0x02, - 0x00, 0x12, 0x76, 0x82, 0x00, 0x10, 0x10, 0xe6, - 0x00, 0x01, 0x71, 0xe1, 0x00, 0x03, 0x00, 0x12, - 0x80, 0x82, 0x71, 0xe1, 0x00, 0x04, 0x00, 0x12, - 0x10, 0xe6, 0x00, 0x02, 0x80, 0x82, 0xe7, 0x62, - 0x71, 0xe1, 0x00, 0x02, 0x00, 0x13, 0xe5, 0x01, - 0xf9, 0x80, 0x16, 0x9a, 0x8a, 0x16, 0x8a, 0x11, - 0xf4, 0xe4, 0x4a, 0x11, 0x88, 0x11, 0xee, 0xff, - 0xee, 0x01, 0x10, 0xe1, 0x00, 0x01, 0x8a, 0x11, - 0xf4, 0x95, 0xf4, 0xe4, 0x4a, 0x11, 0x77, 0x11, - 0x00, 0x7b, 0x10, 0x81, 0xf0, 0x00, 0x00, 0xb3, - 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, - 0xfa, 0x44, 0x19, 0x2a, 0xf4, 0x95, 0xee, 0xff, - 0xf9, 0x80, 0x16, 0x53, 0x77, 0x11, 0x00, 0x7b, - 0x10, 0x81, 0xf0, 0x00, 0x00, 0xb3, 0x88, 0x11, - 0xf4, 0x95, 0xf4, 0x95, 0x76, 0x81, 0x00, 0x01, - 0xee, 0x01, 0x76, 0xe1, 0x00, 0x01, 0x00, 0x00, - 0x76, 0xe1, 0x00, 0x02, 0x00, 0x13, 0x76, 0xe1, - 0x00, 0x03, 0x00, 0x26, 0x76, 0xe1, 0x00, 0x04, - 0x00, 0x25, 0x76, 0xe1, 0x00, 0x05, 0x00, 0x24, - 0x76, 0xe1, 0x00, 0x06, 0x00, 0x00, 0x76, 0xe1, - 0x00, 0x07, 0x00, 0x17, 0x76, 0xe1, 0x00, 0x08, - 0x00, 0x32, 0x76, 0xe1, 0x00, 0x09, 0x00, 0x31, - 0x76, 0xe1, 0x00, 0x0a, 0x00, 0x30, 0x8a, 0x11, - 0xf4, 0x95, 0xf4, 0xe4, 0x4a, 0x11, 0x4a, 0x16, - 0x4a, 0x17, 0xee, 0xff, 0xf4, 0x95, 0x71, 0x06, - 0x00, 0x17, 0xfb, 0x80, 0x16, 0xa2, 0x88, 0x11, - 0xf4, 0x95, 0xf7, 0xb8, 0x10, 0xf8, 0x00, 0x11, - 0xf0, 0x10, 0xff, 0xff, 0xfa, 0x45, 0x19, 0x73, - 0x77, 0x16, 0xff, 0xff, 0x77, 0x12, 0x00, 0x7b, - 0x77, 0x0e, 0x00, 0x05, 0x10, 0x82, 0x28, 0xf8, - 0x00, 0x11, 0xf0, 0x00, 0x00, 0xb4, 0x88, 0x11, - 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, 0xf8, 0x44, - 0x19, 0x84, 0xf2, 0x73, 0x19, 0x84, 0xf4, 0x95, - 0xe7, 0x16, 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, - 0xf0, 0x00, 0x00, 0xb4, 0x88, 0x11, 0xf4, 0x95, - 0x77, 0x12, 0x00, 0x02, 0x10, 0x81, 0xf8, 0x45, - 0x19, 0x6f, 0x6e, 0xea, 0xff, 0xff, 0x19, 0x7c, - 0x6d, 0xe9, 0x00, 0x05, 0x61, 0xf8, 0x00, 0x17, - 0x00, 0x01, 0xfa, 0x20, 0x19, 0x8f, 0x76, 0x86, - 0x00, 0x01, 0xfb, 0x80, 0x19, 0x97, 0xf4, 0x95, - 0x48, 0x16, 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x01, - 0x8a, 0x17, 0x48, 0x16, 0x8a, 0x16, 0x8a, 0x11, - 0xf4, 0xe4, 0x4a, 0x11, 0xee, 0xff, 0xfb, 0x80, - 0x16, 0xa2, 0x88, 0x11, 0xf4, 0x95, 0x77, 0x10, - 0xff, 0xff, 0xf4, 0xa9, 0xf8, 0x30, 0x19, 0xcc, - 0x71, 0xe1, 0x00, 0x02, 0x00, 0x12, 0x69, 0x82, - 0x00, 0x10, 0x71, 0xe1, 0x00, 0x02, 0x00, 0x12, - 0x68, 0x82, 0xf7, 0xff, 0x71, 0xe1, 0x00, 0x02, - 0x00, 0x12, 0x68, 0x82, 0xfb, 0xff, 0x71, 0xe1, - 0x00, 0x02, 0x00, 0x12, 0x68, 0x82, 0xff, 0xf0, - 0x71, 0xe1, 0x00, 0x03, 0x00, 0x12, 0x76, 0x82, - 0xff, 0xff, 0x71, 0xe1, 0x00, 0x04, 0x00, 0x12, - 0x76, 0x82, 0xff, 0xff, 0x71, 0xe1, 0x00, 0x02, - 0x00, 0x12, 0x69, 0x82, 0x00, 0x20, 0x71, 0xe1, - 0x00, 0x02, 0x00, 0x11, 0xf2, 0x73, 0x19, 0xda, - 0x68, 0x81, 0xff, 0xef, 0x77, 0x11, 0x00, 0x7b, - 0x10, 0x81, 0xfb, 0x80, 0x19, 0x97, 0xf0, 0x00, - 0x00, 0xb4, 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, - 0xfb, 0x80, 0x19, 0x97, 0xf0, 0x00, 0x00, 0xb9, - 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x01, 0x8a, 0x11, - 0xf4, 0xe4, 0x00, 0xa4, 0x00, 0x00, 0x19, 0xdf, - 0x00, 0x01, 0x2a, 0xe6, 0x00, 0x00, 0x00, 0x01, - 0x2a, 0xe7, 0x00, 0x00, 0x00, 0x03, 0x2a, 0x12, - 0x0c, 0x01, 0xc3, 0x4f, 0x00, 0x00, 0x00, 0x01, - 0x2a, 0x15, 0x00, 0x00, 0x00, 0x02, 0x2a, 0x16, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x2a, 0x5d, - 0x00, 0x43, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x79, - 0x00, 0x72, 0x00, 0x69, 0x00, 0x67, 0x00, 0x68, - 0x00, 0x74, 0x00, 0x20, 0x00, 0x54, 0x00, 0x65, - 0x00, 0x63, 0x00, 0x68, 0x00, 0x6e, 0x00, 0x6f, - 0x00, 0x54, 0x00, 0x72, 0x00, 0x65, 0x00, 0x6e, - 0x00, 0x64, 0x00, 0x20, 0x00, 0x41, 0x00, 0x47, - 0x00, 0x00, 0x00, 0x04, 0x2a, 0x76, 0x00, 0x30, - 0x00, 0x2e, 0x00, 0x30, 0x00, 0x00, 0x00, 0x0c, - 0x2a, 0x7a, 0x00, 0x46, 0x00, 0x65, 0x00, 0x62, - 0x00, 0x20, 0x00, 0x32, 0x00, 0x37, 0x00, 0x20, - 0x00, 0x32, 0x00, 0x30, 0x00, 0x30, 0x00, 0x31, - 0x00, 0x00, 0x00, 0x09, 0x2a, 0x86, 0x00, 0x31, - 0x00, 0x34, 0x00, 0x3a, 0x00, 0x33, 0x00, 0x35, - 0x00, 0x3a, 0x00, 0x33, 0x00, 0x33, 0x00, 0x00, - 0x00, 0x0f, 0x2a, 0x8f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x2a, 0x9e, 0x00, 0x00, - 0x00, 0x01, 0x2a, 0x9f, 0x00, 0x00, 0x00, 0x01, - 0x2a, 0xa0, 0x00, 0x00, 0x00, 0x01, 0x2a, 0xa1, - 0x00, 0x00, 0x00, 0x01, 0x2a, 0xa2, 0x00, 0x00, - 0x00, 0x01, 0x29, 0x7e, 0x00, 0x00, 0x00, 0x02, - 0x29, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x29, 0x82, 0xff, 0xff, 0x00, 0x01, 0x2a, 0xa7, - 0x00, 0x00, 0x00, 0x05, 0x2a, 0xa8, 0x71, 0x41, - 0x20, 0x00, 0x20, 0x00, 0x00, 0x23, 0x04, 0x00, - 0x00, 0x0a, 0x2a, 0xad, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0f, 0x2a, 0xb7, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x40, 0x00, 0xa0, 0x82, 0x40, - 0x00, 0x08, 0x30, 0x7f, 0x00, 0x80, 0x01, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x27, 0x6e, 0x00, 0x00, - 0x00, 0x01, 0x27, 0x6f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x09, 0x00, 0x00, 0x1a, 0x83, 0x04, 0xe8, - 0x04, 0xcf, 0x04, 0xc5, 0x04, 0xba, 0x04, 0xb0, - 0x04, 0xac, 0x04, 0x9c, 0x04, 0x8c, 0x04, 0x81, - 0x00, 0x78, 0x00, 0x00, 0x01, 0x00, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xaa, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x02, 0x23, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x05, 0xe5, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x02, 0xb5, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x0e, 0x33, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, - 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0x00, 0x00, + 0x08, 0xaa, 0x00, 0x18, 0x00, 0x03, 0x08, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x01, 0x80, 0x18, 0x5f, + 0x00, 0x00, 0x01, 0x80, 0x77, 0x18, 0x2a, 0xeb, + 0x6b, 0xf8, 0x00, 0x18, 0x03, 0xff, 0x68, 0xf8, + 0x00, 0x18, 0xff, 0xfe, 0xf7, 0xb8, 0xf7, 0xbe, + 0xf6, 0xb9, 0xf4, 0xa0, 0xf6, 0xb7, 0xf6, 0xb5, + 0xf6, 0xb6, 0xf0, 0x20, 0x19, 0xdf, 0xf1, 0x00, + 0x00, 0x01, 0xf8, 0x4d, 0x01, 0xab, 0xf6, 0xb8, + 0xf0, 0x20, 0x19, 0xdf, 0xf0, 0x73, 0x01, 0xa5, + 0x7e, 0xf8, 0x00, 0x12, 0xf0, 0x00, 0x00, 0x01, + 0x47, 0xf8, 0x00, 0x11, 0x7e, 0x92, 0x00, 0xf8, + 0x00, 0x11, 0xf0, 0x00, 0x00, 0x01, 0x7e, 0xf8, + 0x00, 0x11, 0xf0, 0x00, 0x00, 0x01, 0x6c, 0x89, + 0x01, 0x9a, 0xf7, 0xb8, 0xee, 0xfc, 0xf0, 0x20, + 0xff, 0xff, 0xf1, 0x00, 0x00, 0x01, 0xf8, 0x4d, + 0x01, 0xbf, 0xf2, 0x73, 0x01, 0xb9, 0x4e, 0x02, + 0xf4, 0x95, 0xf5, 0xe3, 0x56, 0x02, 0x7e, 0x00, + 0x11, 0x00, 0xfa, 0x4c, 0x01, 0xb7, 0x6b, 0x03, + 0x00, 0x01, 0xf6, 0xb8, 0xee, 0x04, 0xf0, 0x74, + 0x0d, 0xa7, 0xf0, 0x74, 0x01, 0xc5, 0x4a, 0x11, + 0x4a, 0x16, 0x72, 0x11, 0x2a, 0xe6, 0x10, 0xf8, + 0x00, 0x11, 0xfa, 0x45, 0x01, 0xdb, 0xf4, 0x95, + 0xee, 0xff, 0x48, 0x11, 0xf0, 0x00, 0x2a, 0xc6, + 0x88, 0x16, 0xf4, 0x95, 0xf4, 0x95, 0x10, 0xee, + 0xff, 0xff, 0xf4, 0xe3, 0x6c, 0xe9, 0xff, 0xff, + 0x01, 0xd5, 0x10, 0xf8, 0x2a, 0xe7, 0xf8, 0x45, + 0x01, 0xe2, 0x10, 0xf8, 0x2a, 0xe7, 0xf4, 0xe3, + 0xf0, 0x74, 0x01, 0xff, 0xee, 0x01, 0x8a, 0x16, + 0x8a, 0x11, 0xfc, 0x00, 0xf7, 0xb8, 0xe9, 0x20, + 0x4a, 0x11, 0x09, 0xf8, 0x2a, 0xe6, 0xf8, 0x4e, + 0x01, 0xf3, 0xf2, 0x73, 0x01, 0xfd, 0xf4, 0x95, + 0xe8, 0x01, 0x72, 0x11, 0x2a, 0xe6, 0x49, 0x11, + 0x80, 0xe1, 0x2a, 0xc6, 0xf3, 0x00, 0x00, 0x01, + 0xe8, 0x00, 0x81, 0xf8, 0x2a, 0xe6, 0x8a, 0x11, + 0xfc, 0x00, 0xf4, 0x95, 0xf0, 0x73, 0x02, 0x00, + 0x10, 0xf8, 0x2a, 0x0f, 0xfc, 0x00, 0x4a, 0x11, + 0xf0, 0x74, 0x02, 0x02, 0x80, 0xf8, 0x2a, 0x10, + 0x73, 0x08, 0x00, 0x09, 0x40, 0xf8, 0x2a, 0x15, + 0x82, 0xf8, 0x00, 0x11, 0xf4, 0x95, 0x77, 0x10, + 0x03, 0xe8, 0xf5, 0xa9, 0xf8, 0x30, 0x02, 0x21, + 0x71, 0xf8, 0x2a, 0x10, 0x2a, 0x15, 0x56, 0xf8, + 0x2a, 0x0c, 0xf0, 0xe3, 0x4e, 0xf8, 0x2a, 0x16, + 0xe8, 0x00, 0x4e, 0xf8, 0x2a, 0x0c, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x06, 0x4a, 0x07, 0x4a, 0x1d, + 0x68, 0xf8, 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, + 0x00, 0x07, 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, + 0xff, 0xfc, 0x6b, 0xf8, 0x2a, 0x0f, 0x00, 0x01, + 0x8a, 0x1d, 0x8a, 0x07, 0x8a, 0x06, 0xf4, 0xeb, + 0xee, 0xfd, 0x76, 0xf8, 0x2a, 0x0f, 0x00, 0x00, + 0x76, 0x00, 0x00, 0x00, 0xfb, 0x80, 0x19, 0x4c, + 0xf4, 0x95, 0xe8, 0x00, 0x80, 0xf8, 0x2a, 0x11, + 0xf9, 0x80, 0x19, 0x07, 0x80, 0xf8, 0x2a, 0x0e, + 0xf9, 0x80, 0x16, 0x66, 0x76, 0x00, 0x2a, 0x12, + 0x10, 0xf8, 0x2a, 0x11, 0xf9, 0x80, 0x18, 0xe3, + 0x10, 0xf8, 0x2a, 0x0e, 0xf9, 0x80, 0x16, 0x66, + 0x10, 0xf8, 0x2a, 0x0e, 0xf9, 0x80, 0x16, 0x87, + 0xee, 0x03, 0xfc, 0x00, 0x4a, 0x11, 0xf6, 0xb8, + 0xf4, 0x95, 0xf0, 0x20, 0x80, 0x00, 0x11, 0xf8, + 0x2a, 0x5a, 0xf8, 0x4d, 0x02, 0x93, 0x11, 0xf8, + 0x2a, 0x9f, 0xf8, 0x4c, 0x02, 0x7c, 0x77, 0x12, + 0x2a, 0x39, 0x49, 0x12, 0x01, 0xf8, 0x2a, 0x9f, + 0x89, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x71, 0x81, + 0x00, 0x11, 0x6c, 0xe1, 0xff, 0xab, 0x02, 0x93, + 0x6b, 0xf8, 0x2a, 0x9f, 0x00, 0x01, 0xe9, 0x05, + 0x01, 0xe2, 0x00, 0x03, 0x81, 0xf8, 0x2a, 0xa0, + 0xf0, 0x73, 0x02, 0x95, 0x72, 0x11, 0x2a, 0x9f, + 0xf4, 0x95, 0x10, 0xe1, 0x2a, 0x39, 0x6b, 0xf8, + 0x2a, 0x9f, 0x00, 0x01, 0x11, 0xf8, 0x2a, 0x9f, + 0x09, 0xf8, 0x2a, 0xa0, 0xf8, 0x4c, 0x02, 0x93, + 0x76, 0xf8, 0x2a, 0x5a, 0x00, 0x00, 0x76, 0xf8, + 0x2a, 0x9f, 0x00, 0x00, 0x76, 0xf8, 0x2a, 0xa0, + 0x00, 0x00, 0x88, 0x11, 0xf4, 0x95, 0x48, 0x11, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, + 0x10, 0xf8, 0x2a, 0x5a, 0xf8, 0x44, 0x02, 0xb2, + 0x76, 0xf8, 0x2a, 0x5a, 0x00, 0x01, 0xf0, 0x74, + 0x02, 0x58, 0x88, 0x11, 0xf4, 0x95, 0x77, 0x10, + 0x80, 0x00, 0xf4, 0xa9, 0xf8, 0x30, 0x02, 0xb2, + 0x48, 0x11, 0xf0, 0x30, 0x00, 0xff, 0x80, 0x00, + 0x10, 0xf8, 0x2a, 0x5b, 0xf9, 0x80, 0x18, 0xd6, + 0xee, 0x02, 0x8a, 0x11, 0xfc, 0x00, 0xf4, 0x95, + 0x4a, 0x08, 0x4a, 0x09, 0x4a, 0x0a, 0x4a, 0x0b, + 0x4a, 0x0c, 0x4a, 0x0d, 0x4a, 0x10, 0x4a, 0x11, + 0x4a, 0x12, 0x4a, 0x13, 0x4a, 0x14, 0x4a, 0x15, + 0x4a, 0x16, 0x4a, 0x17, 0x4a, 0x17, 0x4a, 0x19, + 0x4a, 0x0e, 0x4a, 0x06, 0x4a, 0x07, 0x4a, 0x1a, + 0x4a, 0x1d, 0x4a, 0x1b, 0x4a, 0x1c, 0x68, 0xf8, + 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, 0x00, 0x07, + 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, 0xff, 0xfc, + 0x48, 0x18, 0x68, 0xf8, 0x00, 0x18, 0xff, 0xfe, + 0xf4, 0x95, 0xf4, 0x95, 0x4a, 0x08, 0xee, 0xfd, + 0xf0, 0x74, 0x02, 0x58, 0x88, 0x11, 0xf4, 0x95, + 0x77, 0x10, 0x80, 0x00, 0xf4, 0xa9, 0xf8, 0x30, + 0x02, 0xef, 0x48, 0x11, 0xf0, 0x30, 0x00, 0xff, + 0x80, 0x00, 0x10, 0xf8, 0x2a, 0x5b, 0xf9, 0x80, + 0x18, 0xd6, 0xee, 0x03, 0x8a, 0x18, 0xf4, 0x95, + 0x8a, 0x1c, 0x8a, 0x1b, 0x8a, 0x1d, 0x8a, 0x1a, + 0x8a, 0x07, 0x8a, 0x06, 0x8a, 0x0e, 0x8a, 0x19, + 0x8a, 0x17, 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x15, + 0x8a, 0x14, 0x8a, 0x13, 0x8a, 0x12, 0x8a, 0x11, + 0x8a, 0x10, 0x8a, 0x0d, 0x8a, 0x0c, 0x8a, 0x0b, + 0x8a, 0x0a, 0x8a, 0x09, 0x8a, 0x08, 0xf4, 0xeb, + 0x4a, 0x11, 0x77, 0x11, 0x2a, 0x39, 0x76, 0x81, + 0x00, 0x55, 0x77, 0x12, 0x2a, 0x18, 0x10, 0xe2, + 0x00, 0x01, 0x80, 0xe1, 0x00, 0x01, 0x10, 0xe2, + 0x00, 0x02, 0x80, 0xe1, 0x00, 0x02, 0x76, 0xe1, + 0x00, 0x03, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x04, + 0x00, 0xaa, 0xf0, 0x74, 0x02, 0x98, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0x88, 0x11, 0xf4, 0x95, + 0xf4, 0x95, 0x10, 0x81, 0x6f, 0xf8, 0x2a, 0x9e, + 0x0c, 0x88, 0xe8, 0xff, 0x18, 0xe1, 0x00, 0x01, + 0x1a, 0xf8, 0x2a, 0x9e, 0xf0, 0x30, 0x1f, 0xff, + 0x80, 0xf8, 0x2a, 0x9e, 0x8a, 0x11, 0xfc, 0x00, + 0x4a, 0x11, 0x77, 0x11, 0x2a, 0x39, 0x76, 0x81, + 0x00, 0x55, 0x77, 0x12, 0x2a, 0x18, 0x11, 0xe2, + 0x00, 0x01, 0x81, 0xe1, 0x00, 0x01, 0x11, 0xe2, + 0x00, 0x02, 0x81, 0xe1, 0x00, 0x02, 0x76, 0xe1, + 0x00, 0x03, 0x00, 0x02, 0x48, 0x08, 0x6f, 0xe1, + 0x00, 0x04, 0x0c, 0x98, 0xf0, 0x30, 0x00, 0xff, + 0x80, 0xe1, 0x00, 0x05, 0x76, 0xe1, 0x00, 0x06, + 0x00, 0xaa, 0xf0, 0x74, 0x02, 0x98, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0x77, 0x11, 0x2a, 0x39, + 0x76, 0x81, 0x00, 0x55, 0x77, 0x12, 0x2a, 0x18, + 0x10, 0xe2, 0x00, 0x01, 0x80, 0xe1, 0x00, 0x01, + 0x10, 0xe2, 0x00, 0x02, 0x80, 0xe1, 0x00, 0x02, + 0x76, 0xe1, 0x00, 0x03, 0x00, 0x04, 0x48, 0x11, + 0xf0, 0x00, 0x00, 0x04, 0x88, 0x12, 0xf4, 0x95, + 0x77, 0x13, 0x2a, 0x76, 0xe9, 0x00, 0xe5, 0x98, + 0xf3, 0x00, 0x00, 0x01, 0xf6, 0xb8, 0x48, 0x0b, + 0x08, 0xf8, 0x2a, 0x3c, 0xf8, 0x43, 0x03, 0x71, + 0x76, 0x82, 0x00, 0xaa, 0xf0, 0x74, 0x02, 0x98, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xf0, + 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x71, 0x81, + 0x00, 0x14, 0x71, 0xe1, 0x00, 0x01, 0x00, 0x15, + 0x49, 0x11, 0xf3, 0x00, 0x00, 0x02, 0x89, 0x11, + 0xe7, 0x82, 0x6d, 0xea, 0x00, 0x04, 0xe7, 0x83, + 0x6d, 0xeb, 0x00, 0x0a, 0x77, 0x1a, 0x00, 0x05, + 0xf0, 0x72, 0x03, 0xaa, 0x11, 0x81, 0xf2, 0xe8, + 0x80, 0x82, 0xe9, 0xff, 0x19, 0xe1, 0x00, 0x01, + 0xf1, 0xa0, 0x81, 0x92, 0x11, 0xe1, 0x00, 0x0c, + 0xf2, 0xe8, 0x80, 0x83, 0xe9, 0xff, 0x19, 0xe1, + 0x00, 0x0d, 0xf1, 0xa0, 0x81, 0x93, 0x6d, 0xe9, + 0x00, 0x02, 0x48, 0x18, 0x49, 0x18, 0x70, 0x00, + 0x00, 0x15, 0xf0, 0x00, 0x00, 0x04, 0xf3, 0x00, + 0x00, 0x0a, 0x80, 0x01, 0x81, 0x02, 0xf2, 0x74, + 0x0e, 0x54, 0xf4, 0x95, 0x48, 0x14, 0xee, 0x10, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xf0, 0x74, + 0x0c, 0x5e, 0x80, 0xf8, 0x2a, 0x5c, 0x77, 0x12, + 0x2a, 0x39, 0x76, 0x82, 0x00, 0x55, 0x77, 0x11, + 0x2a, 0x18, 0x10, 0xe1, 0x00, 0x01, 0x80, 0xe2, + 0x00, 0x01, 0x10, 0xe1, 0x00, 0x02, 0x80, 0xe2, + 0x00, 0x02, 0x76, 0xe2, 0x00, 0x03, 0x00, 0x1c, + 0xf6, 0xb8, 0x56, 0xf8, 0x2a, 0x16, 0xf0, 0xf0, + 0xf0, 0xf8, 0x80, 0xe2, 0x00, 0x07, 0x56, 0xf8, + 0x2a, 0x16, 0xf1, 0xf0, 0xe8, 0xff, 0xf2, 0x80, + 0x80, 0xe2, 0x00, 0x06, 0x56, 0xf8, 0x2a, 0x16, + 0xf1, 0xf8, 0xe8, 0xff, 0xf2, 0x80, 0x80, 0xe2, + 0x00, 0x05, 0x57, 0xf8, 0x2a, 0x16, 0xe8, 0xff, + 0xf2, 0x80, 0x80, 0xe2, 0x00, 0x04, 0x56, 0xf8, + 0x27, 0x6c, 0xf0, 0xf0, 0xf0, 0xf8, 0x80, 0xe2, + 0x00, 0x0b, 0x56, 0xf8, 0x27, 0x6c, 0xf1, 0xf0, + 0xe8, 0xff, 0xf2, 0x80, 0x80, 0xe2, 0x00, 0x0a, + 0x56, 0xf8, 0x27, 0x6c, 0xf1, 0xf8, 0xe8, 0xff, + 0xf2, 0x80, 0x80, 0xe2, 0x00, 0x09, 0xe8, 0xff, + 0x57, 0xf8, 0x27, 0x6c, 0xf2, 0x80, 0x80, 0xe2, + 0x00, 0x08, 0x56, 0xf8, 0x27, 0x6a, 0xf0, 0xf0, + 0xf0, 0xf8, 0x80, 0xe2, 0x00, 0x0f, 0x56, 0xf8, + 0x27, 0x6a, 0xf1, 0xf0, 0xe8, 0xff, 0xf2, 0x80, + 0x80, 0xe2, 0x00, 0x0e, 0x56, 0xf8, 0x27, 0x6a, + 0xf1, 0xf8, 0xe8, 0xff, 0xf2, 0x80, 0x80, 0xe2, + 0x00, 0x0d, 0x57, 0xf8, 0x27, 0x6a, 0xe8, 0xff, + 0xf2, 0x80, 0x80, 0xe2, 0x00, 0x0c, 0x76, 0xe2, + 0x00, 0x13, 0x00, 0x00, 0x76, 0xe2, 0x00, 0x12, + 0x00, 0x00, 0x6f, 0xf8, 0x2a, 0x5c, 0x0c, 0x58, + 0x80, 0xe2, 0x00, 0x11, 0xe8, 0xff, 0x18, 0xf8, + 0x2a, 0x5c, 0x80, 0xe2, 0x00, 0x10, 0x76, 0xe2, + 0x00, 0x17, 0x00, 0x00, 0x76, 0xe2, 0x00, 0x16, + 0x00, 0x00, 0x6f, 0xf8, 0x2a, 0x9e, 0x0c, 0x58, + 0x80, 0xe2, 0x00, 0x15, 0xe8, 0xff, 0x18, 0xf8, + 0x2a, 0x9e, 0x80, 0xe2, 0x00, 0x14, 0x76, 0xe2, + 0x00, 0x1b, 0x00, 0x00, 0x76, 0xe2, 0x00, 0x1a, + 0x00, 0x00, 0x76, 0xe2, 0x00, 0x19, 0x00, 0x00, + 0x70, 0xe2, 0x00, 0x18, 0x27, 0x6e, 0x76, 0xe2, + 0x00, 0x1f, 0x00, 0x00, 0x76, 0xe2, 0x00, 0x1e, + 0x00, 0x00, 0x76, 0xe2, 0x00, 0x1d, 0x00, 0x00, + 0x76, 0xe2, 0x00, 0x1c, 0x00, 0x00, 0x76, 0xe2, + 0x00, 0x20, 0x00, 0xaa, 0xf0, 0x74, 0x02, 0x98, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, + 0x10, 0xf8, 0x2a, 0x38, 0xf8, 0x45, 0x04, 0xed, + 0x77, 0x12, 0x2a, 0x18, 0x10, 0xe2, 0x00, 0x02, + 0x88, 0x11, 0xf4, 0x95, 0x77, 0x10, 0x00, 0x08, + 0x6d, 0xe9, 0xff, 0xdf, 0xf6, 0xa9, 0xf8, 0x20, + 0x04, 0x75, 0xf0, 0x73, 0x04, 0x7d, 0xf0, 0x10, + 0x00, 0x21, 0xf0, 0x00, 0x1a, 0x83, 0x48, 0x08, + 0x7e, 0xf8, 0x00, 0x08, 0xf4, 0xe2, 0xf0, 0x74, + 0x03, 0x0a, 0xf0, 0x73, 0x04, 0xea, 0x48, 0x12, + 0xf2, 0x74, 0x03, 0x23, 0xf0, 0x00, 0x00, 0x04, + 0xf2, 0x74, 0x03, 0x36, 0xf4, 0x95, 0xe8, 0x00, + 0xf0, 0x73, 0x04, 0xea, 0x77, 0x11, 0x2a, 0x18, + 0xe8, 0xff, 0x6f, 0xe1, 0x00, 0x04, 0x0d, 0x48, + 0x18, 0xe1, 0x00, 0x05, 0xf2, 0x74, 0x09, 0x69, + 0xf4, 0x95, 0xf2, 0xa0, 0xf0, 0x74, 0x03, 0x36, + 0xf0, 0x73, 0x04, 0xea, 0x77, 0x11, 0x2a, 0x18, + 0xe8, 0xff, 0x6f, 0xe1, 0x00, 0x04, 0x0d, 0x48, + 0x18, 0xe1, 0x00, 0x05, 0xf2, 0x74, 0x09, 0x41, + 0xf4, 0x95, 0xf2, 0xa0, 0xf0, 0x74, 0x03, 0x36, + 0xf0, 0x73, 0x04, 0xea, 0xf0, 0x74, 0x03, 0x57, + 0xf0, 0x73, 0x04, 0xea, 0x10, 0xf8, 0x2a, 0x1c, + 0xf0, 0x74, 0x12, 0xa4, 0xf2, 0x74, 0x03, 0x36, + 0xf4, 0x95, 0xe8, 0x00, 0xf0, 0x73, 0x04, 0xea, + 0x48, 0x12, 0xf2, 0x74, 0x03, 0x80, 0xf0, 0x00, + 0x00, 0x04, 0xf2, 0x74, 0x03, 0x36, 0xf4, 0x95, + 0xe8, 0x00, 0xf0, 0x73, 0x04, 0xea, 0x10, 0xf8, + 0x2a, 0x1c, 0xf0, 0x74, 0x12, 0xc5, 0xf2, 0x74, + 0x03, 0x36, 0xf4, 0x95, 0xe8, 0x00, 0xf0, 0x73, + 0x04, 0xea, 0x77, 0x11, 0x2a, 0x18, 0xe8, 0xff, + 0x6f, 0xe1, 0x00, 0x06, 0x0d, 0x48, 0x18, 0xe1, + 0x00, 0x07, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0xf2, 0xa0, 0x70, 0x00, 0x00, 0x12, 0x80, 0x01, + 0x10, 0xe1, 0x00, 0x04, 0xf0, 0x74, 0x0e, 0x7a, + 0xf2, 0x74, 0x03, 0x36, 0xf4, 0x95, 0xe8, 0x00, + 0xf0, 0x73, 0x04, 0xea, 0xf0, 0x74, 0x03, 0xbc, + 0x76, 0xf8, 0x2a, 0x38, 0x00, 0x00, 0xee, 0x02, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x77, 0x11, + 0x2a, 0x39, 0x76, 0x81, 0x00, 0x55, 0x77, 0x12, + 0x2a, 0x18, 0x10, 0xe2, 0x00, 0x01, 0x80, 0xe1, + 0x00, 0x01, 0x10, 0xe2, 0x00, 0x02, 0x80, 0xe1, + 0x00, 0x02, 0x76, 0xe1, 0x00, 0x03, 0x00, 0x09, + 0x48, 0x11, 0xf0, 0x00, 0x00, 0x04, 0x88, 0x12, + 0xf4, 0x95, 0x77, 0x13, 0x2a, 0x86, 0xe9, 0x00, + 0xe5, 0x98, 0xf3, 0x00, 0x00, 0x01, 0xf6, 0xb8, + 0x48, 0x0b, 0x08, 0xf8, 0x2a, 0x3c, 0xf8, 0x43, + 0x05, 0x0a, 0x76, 0x82, 0x00, 0xaa, 0xf0, 0x74, + 0x02, 0x98, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, + 0x77, 0x11, 0x2a, 0x39, 0x76, 0x81, 0x00, 0x55, + 0x77, 0x13, 0x2a, 0x18, 0x10, 0xe3, 0x00, 0x01, + 0x80, 0xe1, 0x00, 0x01, 0x10, 0xe3, 0x00, 0x02, + 0x80, 0xe1, 0x00, 0x02, 0x13, 0xe3, 0x00, 0x03, + 0x81, 0xe1, 0x00, 0x03, 0x48, 0x11, 0x77, 0x11, + 0x00, 0x00, 0xf8, 0x4d, 0x05, 0x44, 0xf0, 0x00, + 0x00, 0x04, 0x88, 0x12, 0x48, 0x13, 0xf0, 0x00, + 0x00, 0x04, 0x88, 0x13, 0xf4, 0x95, 0xf4, 0x95, + 0xe5, 0x98, 0x6d, 0x91, 0xf6, 0xb8, 0x48, 0x11, + 0x08, 0xf8, 0x2a, 0x3c, 0xf8, 0x43, 0x05, 0x3a, + 0xf0, 0x20, 0x2a, 0x39, 0x49, 0x11, 0xf5, 0x00, + 0x89, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x76, 0xe1, + 0x00, 0x04, 0x00, 0xaa, 0xf0, 0x74, 0x02, 0x98, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x77, 0x11, + 0x2a, 0x39, 0x76, 0x81, 0x00, 0x55, 0x77, 0x12, + 0x2a, 0x18, 0x10, 0xe2, 0x00, 0x01, 0x80, 0xe1, + 0x00, 0x01, 0x10, 0xe2, 0x00, 0x02, 0x80, 0xe1, + 0x00, 0x02, 0x76, 0xe1, 0x00, 0x03, 0x00, 0x0c, + 0x48, 0x11, 0xf0, 0x00, 0x00, 0x04, 0x88, 0x12, + 0xf4, 0x95, 0x77, 0x13, 0x2a, 0x7a, 0xe9, 0x00, + 0xe5, 0x98, 0xf3, 0x00, 0x00, 0x01, 0xf6, 0xb8, + 0x48, 0x0b, 0x08, 0xf8, 0x2a, 0x3c, 0xf8, 0x43, + 0x05, 0x6a, 0x76, 0x82, 0x00, 0xaa, 0xf0, 0x74, + 0x02, 0x98, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, + 0x77, 0x11, 0x2a, 0x39, 0x76, 0x81, 0x00, 0x55, + 0x77, 0x12, 0x2a, 0x18, 0x10, 0xe2, 0x00, 0x01, + 0x80, 0xe1, 0x00, 0x01, 0x10, 0xe2, 0x00, 0x02, + 0x80, 0xe1, 0x00, 0x02, 0x76, 0xe1, 0x00, 0x03, + 0x00, 0x19, 0x48, 0x11, 0xf0, 0x00, 0x00, 0x04, + 0x88, 0x12, 0xf4, 0x95, 0x77, 0x13, 0x2a, 0x5d, + 0xe9, 0x00, 0xe5, 0x98, 0xf3, 0x00, 0x00, 0x01, + 0xf6, 0xb8, 0x48, 0x0b, 0x08, 0xf8, 0x2a, 0x3c, + 0xf8, 0x43, 0x05, 0x93, 0x76, 0x82, 0x00, 0xaa, + 0xf0, 0x74, 0x02, 0x98, 0x8a, 0x11, 0xfc, 0x00, + 0x4a, 0x11, 0x88, 0x11, 0x10, 0xf8, 0x2a, 0x38, + 0xf8, 0x44, 0x05, 0xe3, 0x10, 0xf8, 0x2a, 0xa1, + 0xf8, 0x44, 0x05, 0xba, 0x6c, 0xe1, 0xff, 0x56, + 0x05, 0xe3, 0x72, 0x12, 0x2a, 0xa1, 0xf4, 0x95, + 0x70, 0xe2, 0x2a, 0x18, 0x00, 0x11, 0x6b, 0xf8, + 0x2a, 0xa1, 0x00, 0x01, 0xf0, 0x73, 0x05, 0xe3, + 0x72, 0x12, 0x2a, 0xa1, 0xf4, 0x95, 0x70, 0xe2, + 0x2a, 0x18, 0x00, 0x11, 0x10, 0xf8, 0x2a, 0xa1, + 0xf0, 0x00, 0x00, 0x01, 0x88, 0x12, 0xf4, 0x95, + 0xf4, 0x95, 0x6e, 0xe2, 0xff, 0xfc, 0x05, 0xd1, + 0x73, 0x12, 0x2a, 0xa1, 0x48, 0x11, 0xf0, 0x00, + 0x00, 0x05, 0x80, 0xf8, 0x2a, 0xa2, 0x10, 0xf8, + 0x2a, 0xa1, 0x08, 0xf8, 0x2a, 0xa2, 0xf8, 0x44, + 0x05, 0xe3, 0x6c, 0xe1, 0xff, 0xab, 0x05, 0xdd, + 0x76, 0xf8, 0x2a, 0x38, 0x00, 0x01, 0x76, 0xf8, + 0x2a, 0xa1, 0x00, 0x00, 0x76, 0xf8, 0x2a, 0xa2, + 0x00, 0x00, 0x8a, 0x11, 0xfc, 0x00, 0xf4, 0x95, + 0x4a, 0x08, 0x4a, 0x09, 0x4a, 0x0a, 0x4a, 0x0b, + 0x4a, 0x0c, 0x4a, 0x0d, 0x4a, 0x10, 0x4a, 0x11, + 0x4a, 0x12, 0x4a, 0x13, 0x4a, 0x14, 0x4a, 0x15, + 0x4a, 0x16, 0x4a, 0x17, 0x4a, 0x17, 0x4a, 0x19, + 0x4a, 0x0e, 0x4a, 0x06, 0x4a, 0x07, 0x4a, 0x1a, + 0x4a, 0x1d, 0x4a, 0x1b, 0x4a, 0x1c, 0x68, 0xf8, + 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, 0x00, 0x07, + 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, 0xff, 0xfc, + 0x48, 0x18, 0x68, 0xf8, 0x00, 0x18, 0xff, 0xfe, + 0xf4, 0x95, 0xf4, 0x95, 0x4a, 0x08, 0xee, 0xff, + 0x10, 0xf8, 0x2a, 0x5b, 0xf9, 0x80, 0x18, 0x04, + 0xf0, 0x74, 0x05, 0xa2, 0xee, 0x01, 0x8a, 0x18, + 0xf4, 0x95, 0x8a, 0x1c, 0x8a, 0x1b, 0x8a, 0x1d, + 0x8a, 0x1a, 0x8a, 0x07, 0x8a, 0x06, 0x8a, 0x0e, + 0x8a, 0x19, 0x8a, 0x17, 0x8a, 0x17, 0x8a, 0x16, + 0x8a, 0x15, 0x8a, 0x14, 0x8a, 0x13, 0x8a, 0x12, + 0x8a, 0x11, 0x8a, 0x10, 0x8a, 0x0d, 0x8a, 0x0c, + 0x8a, 0x0b, 0x8a, 0x0a, 0x8a, 0x09, 0x8a, 0x08, + 0xf4, 0xeb, 0xee, 0xfd, 0x76, 0xf8, 0x2a, 0x38, + 0x00, 0x00, 0x76, 0xf8, 0x2a, 0x5a, 0x00, 0x00, + 0xe8, 0x01, 0x4e, 0x00, 0xfb, 0x80, 0x17, 0xd6, + 0xf4, 0x95, 0xe8, 0x01, 0x80, 0xf8, 0x2a, 0x5b, + 0x76, 0x00, 0x2a, 0x8f, 0xf9, 0x80, 0x16, 0xaa, + 0x10, 0xf8, 0x2a, 0x5b, 0xf9, 0x80, 0x17, 0x5c, + 0x10, 0xf8, 0x2a, 0x5b, 0xf9, 0x80, 0x17, 0x6f, + 0xfb, 0x80, 0x16, 0x66, 0xf4, 0x95, 0xe8, 0x1a, + 0xfb, 0x80, 0x16, 0x87, 0xf4, 0x95, 0xe8, 0x1a, + 0xfb, 0x80, 0x16, 0x66, 0xf4, 0x95, 0xe8, 0x1b, + 0xfb, 0x80, 0x16, 0x87, 0xf4, 0x95, 0xe8, 0x1b, + 0xee, 0x03, 0xfc, 0x00, 0x4a, 0x11, 0xf4, 0x95, + 0x13, 0x02, 0x88, 0x11, 0xe8, 0x00, 0xf8, 0x4d, + 0x06, 0x6a, 0xf3, 0x10, 0x00, 0x01, 0x89, 0x1a, + 0xf4, 0x95, 0xf0, 0x72, 0x06, 0x69, 0x1c, 0x91, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x88, 0x11, + 0x12, 0x03, 0x11, 0x02, 0xf8, 0x45, 0x06, 0x79, + 0xf0, 0x10, 0x00, 0x01, 0x88, 0x1a, 0xf4, 0x95, + 0xf0, 0x72, 0x06, 0x78, 0x81, 0x91, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0xf4, 0x95, 0x71, 0x02, + 0x00, 0x11, 0x11, 0x03, 0x61, 0xf8, 0x00, 0x11, + 0x00, 0x01, 0xf8, 0x30, 0x06, 0x91, 0xf6, 0xb8, + 0x6f, 0xf8, 0x00, 0x11, 0x0c, 0x1f, 0x88, 0x11, + 0xf3, 0xe8, 0xe8, 0xff, 0x18, 0x81, 0xf1, 0xa0, + 0x81, 0x81, 0xf0, 0x73, 0x06, 0x9d, 0xf6, 0xb8, + 0x6f, 0xf8, 0x00, 0x11, 0x0c, 0x1f, 0x88, 0x11, + 0xf3, 0x30, 0x00, 0xff, 0xf0, 0x20, 0xff, 0x00, + 0x18, 0x81, 0xf1, 0xa0, 0x81, 0x81, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0xf4, 0x95, 0x11, 0x02, + 0x61, 0xf8, 0x00, 0x0b, 0x00, 0x01, 0xf8, 0x20, + 0x06, 0xb1, 0x49, 0x0b, 0xf6, 0x1f, 0x88, 0x11, + 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, 0xf2, 0x73, + 0x06, 0xb8, 0xf0, 0x30, 0x00, 0xff, 0x49, 0x0b, + 0xf6, 0x1f, 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, + 0x12, 0x81, 0xf4, 0x78, 0x8a, 0x11, 0xfc, 0x00, + 0x4a, 0x11, 0xf4, 0x95, 0x71, 0x02, 0x00, 0x12, + 0x13, 0x03, 0x88, 0x11, 0xe8, 0x00, 0xf8, 0x4d, + 0x06, 0xcc, 0xf3, 0x10, 0x00, 0x01, 0x89, 0x1a, + 0xf4, 0x95, 0xf0, 0x72, 0x06, 0xcb, 0x11, 0x92, + 0xf2, 0xc0, 0x81, 0x91, 0x8a, 0x11, 0xfc, 0x00, + 0x88, 0x12, 0x12, 0x02, 0x71, 0x01, 0x00, 0x13, + 0xf8, 0x45, 0x06, 0xdb, 0xf0, 0x10, 0x00, 0x01, + 0x88, 0x1a, 0xf4, 0x95, 0xf0, 0x72, 0x06, 0xda, + 0xe5, 0x98, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, + 0x88, 0x11, 0x11, 0x04, 0x10, 0x06, 0x71, 0x05, + 0x00, 0x12, 0x61, 0xf8, 0x00, 0x12, 0x00, 0x01, + 0xf8, 0x20, 0x06, 0xea, 0xf0, 0x00, 0x00, 0x01, + 0xf6, 0xb8, 0xf0, 0x00, 0x00, 0x01, 0x6f, 0xf8, + 0x00, 0x12, 0x0f, 0x1f, 0x48, 0x08, 0x81, 0x00, + 0xf4, 0x7f, 0x80, 0x01, 0xf2, 0x74, 0x06, 0xba, + 0xf4, 0x95, 0x48, 0x11, 0xee, 0x02, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, 0x88, 0x12, + 0x11, 0x04, 0x10, 0x06, 0x71, 0x05, 0x00, 0x13, + 0x61, 0xf8, 0x00, 0x13, 0x00, 0x01, 0xf8, 0x20, + 0x07, 0x09, 0xf0, 0x00, 0x00, 0x01, 0xf0, 0x00, + 0x00, 0x01, 0x88, 0x11, 0xf6, 0xb8, 0x6f, 0xf8, + 0x00, 0x13, 0x0f, 0x1f, 0x81, 0x00, 0x48, 0x11, + 0xf4, 0x7f, 0x80, 0x01, 0xf2, 0x74, 0x06, 0xce, + 0xf4, 0x95, 0x48, 0x12, 0x48, 0x11, 0xf0, 0x30, + 0xff, 0xfe, 0xee, 0x02, 0x8a, 0x11, 0xfc, 0x00, + 0x4a, 0x11, 0x4a, 0x16, 0x4a, 0x17, 0xee, 0xfc, + 0xf4, 0x95, 0x80, 0x02, 0x71, 0x08, 0x00, 0x16, + 0x10, 0x09, 0x71, 0x0b, 0x00, 0x17, 0x80, 0x03, + 0x71, 0x0a, 0x00, 0x11, 0x48, 0x17, 0xf8, 0x45, + 0x07, 0x3f, 0x70, 0x00, 0x00, 0x11, 0x10, 0x03, + 0xf0, 0x74, 0x06, 0x9f, 0x80, 0x01, 0x70, 0x00, + 0x00, 0x16, 0x10, 0x02, 0xf0, 0x74, 0x06, 0x7b, + 0x6d, 0x91, 0x6d, 0x96, 0x6c, 0xef, 0xff, 0xff, + 0x07, 0x2f, 0xee, 0x04, 0x8a, 0x17, 0x8a, 0x16, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, + 0x10, 0xf8, 0x2a, 0xe8, 0x08, 0xf8, 0x2a, 0xe9, + 0xf8, 0x45, 0x07, 0x64, 0x76, 0x00, 0x00, 0x01, + 0x62, 0xf8, 0x2a, 0xe9, 0x00, 0x5e, 0xf2, 0x74, + 0x12, 0x0b, 0xf0, 0x00, 0x30, 0x40, 0x72, 0x11, + 0x2a, 0xe9, 0x77, 0x10, 0x00, 0x0f, 0xf5, 0xa9, + 0xf8, 0x20, 0x07, 0x61, 0x6b, 0xf8, 0x2a, 0xe9, + 0x00, 0x01, 0xf0, 0x73, 0x07, 0x64, 0x76, 0xf8, + 0x2a, 0xe9, 0x00, 0x00, 0xee, 0x02, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0x88, 0x11, 0xe8, 0x00, + 0x75, 0xf8, 0x00, 0x08, 0x00, 0x08, 0xe8, 0x00, + 0x75, 0xf8, 0x00, 0x08, 0x00, 0x09, 0xf6, 0xb8, + 0xf4, 0x95, 0xf0, 0x20, 0xfc, 0x3f, 0x75, 0xf8, + 0x00, 0x08, 0x00, 0x0d, 0xf0, 0x20, 0x0c, 0x30, + 0x75, 0xf8, 0x00, 0x08, 0x00, 0x0c, 0x76, 0xf8, + 0x2a, 0xe8, 0x00, 0x00, 0x76, 0xf8, 0x2a, 0xe9, + 0x00, 0x00, 0x6c, 0x81, 0x07, 0x92, 0x76, 0xf8, + 0x2a, 0xea, 0x00, 0x00, 0xfb, 0x80, 0x16, 0x76, + 0xf4, 0x95, 0xe8, 0x10, 0xe8, 0x00, 0x75, 0xf8, + 0x00, 0x08, 0x00, 0x00, 0xf0, 0x73, 0x07, 0xa8, + 0x76, 0xf8, 0x2a, 0xea, 0x00, 0x01, 0xfb, 0x80, + 0x16, 0x66, 0xf4, 0x95, 0xe8, 0x10, 0xfb, 0x80, + 0x16, 0x87, 0xf4, 0x95, 0xe8, 0x10, 0xe8, 0x00, + 0x75, 0xf8, 0x00, 0x08, 0x00, 0x00, 0xf6, 0xb8, + 0xf4, 0x95, 0xf0, 0x20, 0xff, 0xff, 0x75, 0xf8, + 0x00, 0x08, 0x00, 0x00, 0x8a, 0x11, 0xfc, 0x00, + 0xf4, 0x95, 0x4a, 0x08, 0x4a, 0x09, 0x4a, 0x0a, + 0x4a, 0x06, 0x4a, 0x07, 0x4a, 0x1d, 0x68, 0xf8, + 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, 0x00, 0x07, + 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, 0xff, 0xfc, + 0x10, 0xf8, 0x2a, 0xea, 0xf8, 0x45, 0x07, 0xe1, + 0x10, 0xf8, 0x2a, 0xe8, 0xf0, 0x00, 0x00, 0x01, + 0xf0, 0x30, 0x00, 0x0f, 0x80, 0xf8, 0x2a, 0xe8, + 0x10, 0xf8, 0x2a, 0xe8, 0xf8, 0x44, 0x07, 0xd6, + 0xf6, 0xb8, 0xf4, 0x95, 0xf0, 0x20, 0xfc, 0x3f, + 0x75, 0xf8, 0x00, 0x08, 0x00, 0x0d, 0xf0, 0x20, + 0x0c, 0x30, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x0c, + 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x00, + 0xf6, 0xb8, 0xf4, 0x95, 0xf0, 0x20, 0xff, 0xff, + 0x75, 0xf8, 0x00, 0x08, 0x00, 0x00, 0x8a, 0x1d, + 0x8a, 0x07, 0x8a, 0x06, 0x8a, 0x0a, 0x8a, 0x09, + 0x8a, 0x08, 0xf4, 0xeb, 0xee, 0xff, 0xf2, 0x74, + 0x07, 0x67, 0xf4, 0x95, 0xe8, 0x01, 0xee, 0x01, + 0xfc, 0x00, 0x4a, 0x07, 0x4a, 0x1d, 0x68, 0xf8, + 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, 0x00, 0x07, + 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, 0xff, 0xfc, + 0x8a, 0x1d, 0x8a, 0x07, 0xf4, 0xeb, 0x4a, 0x11, + 0x77, 0x11, 0x00, 0x28, 0x76, 0x81, 0x24, 0x00, + 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, + 0xf2, 0x74, 0x07, 0x67, 0xf4, 0x95, 0xe8, 0x00, + 0x77, 0x11, 0x00, 0x1d, 0x68, 0x81, 0x00, 0x7f, + 0xf6, 0xb8, 0xf4, 0x95, 0xf0, 0x20, 0xff, 0x80, + 0x77, 0x11, 0x00, 0x1d, 0xf0, 0x30, 0x01, 0x00, + 0x1a, 0x81, 0x80, 0x81, 0xf0, 0x74, 0x0a, 0x33, + 0xf0, 0x74, 0x11, 0xac, 0xf9, 0x80, 0x13, 0x25, + 0xf9, 0x80, 0x16, 0x53, 0xf9, 0x80, 0x17, 0x82, + 0xf0, 0x74, 0x06, 0x2f, 0xf9, 0x80, 0x14, 0xb2, + 0xf9, 0x80, 0x19, 0x10, 0xf0, 0x74, 0x0d, 0xe3, + 0xf0, 0x74, 0x07, 0xe8, 0xf0, 0x74, 0x02, 0x36, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x60, 0xf8, + 0x27, 0x7b, 0xff, 0xff, 0xf8, 0x30, 0x08, 0x39, + 0x71, 0xf8, 0x27, 0x7b, 0x27, 0x79, 0x60, 0xf8, + 0x27, 0x79, 0xff, 0xff, 0xf8, 0x30, 0x08, 0xb2, + 0x10, 0xf8, 0x29, 0x86, 0x08, 0xf8, 0x27, 0x79, + 0xf0, 0x30, 0x7f, 0xff, 0x88, 0x11, 0xf4, 0x95, + 0x77, 0x10, 0x40, 0x00, 0xf6, 0xa9, 0xf8, 0x30, + 0x08, 0x58, 0x10, 0xf8, 0x27, 0x79, 0x08, 0xf8, + 0x27, 0x7a, 0xf0, 0x30, 0x7f, 0xff, 0x88, 0x11, + 0xf4, 0x95, 0x77, 0x10, 0x40, 0x00, 0xf6, 0xa9, + 0xf8, 0x20, 0x08, 0x63, 0x76, 0xf8, 0x27, 0x79, + 0xff, 0xff, 0x76, 0xf8, 0x27, 0x7b, 0xff, 0xff, + 0xf7, 0xb8, 0xf2, 0x73, 0x08, 0xd9, 0xf0, 0x20, + 0xff, 0xff, 0xf6, 0xb8, 0x56, 0xf8, 0x27, 0x74, + 0xf0, 0xf9, 0x88, 0x11, 0x56, 0xf8, 0x27, 0x72, + 0xf0, 0xf9, 0x88, 0x12, 0xf4, 0x95, 0xf4, 0x95, + 0xe7, 0x20, 0xf4, 0xa9, 0xf8, 0x30, 0x08, 0x8f, + 0xf1, 0x20, 0x27, 0x7c, 0x48, 0x11, 0xf6, 0x00, + 0x88, 0x13, 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x83, + 0x08, 0xf8, 0x27, 0x79, 0xf0, 0x30, 0x7f, 0xff, + 0x88, 0x13, 0xf4, 0x95, 0x77, 0x10, 0x40, 0x00, + 0xf5, 0xab, 0xf8, 0x30, 0x08, 0x8f, 0x6d, 0x91, + 0x48, 0x11, 0xf0, 0x30, 0x01, 0xff, 0x88, 0x11, + 0xf4, 0x95, 0xe7, 0x20, 0xf7, 0xa9, 0xf8, 0x30, + 0x08, 0x74, 0x6d, 0x89, 0x48, 0x11, 0xf0, 0x30, + 0x01, 0xff, 0xf0, 0xe7, 0xf4, 0x95, 0x48, 0x08, + 0x4e, 0xf8, 0x27, 0x74, 0x48, 0x08, 0xf1, 0xf9, + 0x89, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x71, 0xe1, + 0x27, 0x7c, 0x27, 0x7a, 0x60, 0xf8, 0x27, 0x7b, + 0xff, 0xff, 0xf8, 0x30, 0x08, 0xab, 0x48, 0x08, + 0x4e, 0xf8, 0x27, 0x72, 0x76, 0xf8, 0x27, 0x7b, + 0xff, 0xff, 0x76, 0xf8, 0x27, 0x79, 0xff, 0xff, + 0xf2, 0x73, 0x08, 0xd9, 0xf4, 0x95, 0xe8, 0x00, + 0x44, 0xf8, 0x27, 0x73, 0x40, 0xf8, 0x27, 0x75, + 0x82, 0xf8, 0x00, 0x11, 0xf4, 0x95, 0x77, 0x10, + 0x80, 0x00, 0xf6, 0xa9, 0xf8, 0x20, 0x08, 0xd8, + 0xf6, 0xb8, 0x10, 0xf8, 0x27, 0x73, 0xf0, 0x00, + 0x80, 0x00, 0x48, 0x08, 0x4e, 0xf8, 0x27, 0x74, + 0x48, 0x08, 0xf0, 0xf9, 0x88, 0x11, 0xf4, 0x95, + 0xf4, 0x95, 0x71, 0xe1, 0x27, 0x7c, 0x27, 0x7a, + 0xf7, 0xb8, 0x57, 0xf8, 0x27, 0x74, 0xf0, 0x62, + 0xff, 0xff, 0xf0, 0x40, 0xff, 0x80, 0xf2, 0x80, + 0x4e, 0xf8, 0x27, 0x74, 0xe8, 0x00, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0x4a, 0x16, 0xee, 0xfb, + 0x11, 0xf8, 0x27, 0x71, 0x09, 0xf8, 0x27, 0x73, + 0x89, 0x11, 0x88, 0x10, 0xf4, 0x95, 0xf4, 0x95, + 0xf6, 0xa9, 0xf8, 0x20, 0x08, 0xed, 0xf2, 0x73, + 0x09, 0x0e, 0xf4, 0x95, 0xe8, 0x00, 0xf6, 0x20, + 0x76, 0x00, 0x00, 0x41, 0xf0, 0x74, 0x12, 0xee, + 0x88, 0x16, 0xf4, 0x95, 0xf7, 0xb8, 0x6d, 0x96, + 0x10, 0xf8, 0x00, 0x16, 0xf8, 0x47, 0x09, 0x0a, + 0xe7, 0x61, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01, + 0x00, 0x80, 0x76, 0x02, 0x00, 0xff, 0x76, 0x03, + 0x00, 0x00, 0xf2, 0x74, 0x0c, 0xb9, 0xf4, 0x95, + 0xe8, 0x00, 0x6c, 0xe9, 0xff, 0xff, 0x08, 0xfb, + 0x73, 0x16, 0x00, 0x0e, 0xf0, 0x66, 0x00, 0x41, + 0xee, 0x05, 0x8a, 0x16, 0x8a, 0x11, 0xfc, 0x00, + 0x4a, 0x11, 0xf4, 0x95, 0x71, 0x02, 0x00, 0x13, + 0xf6, 0xb8, 0x77, 0x11, 0x7f, 0xff, 0x57, 0xf8, + 0x27, 0x72, 0x48, 0x11, 0xf2, 0x80, 0xf0, 0x00, + 0x80, 0x00, 0x88, 0x11, 0xf6, 0x40, 0xf0, 0xe0, + 0xf1, 0xf1, 0xe8, 0x01, 0xf2, 0x80, 0x80, 0xf8, + 0x27, 0x78, 0x77, 0x12, 0x80, 0x00, 0x57, 0xf8, + 0x27, 0x72, 0x48, 0x12, 0xf2, 0x80, 0x88, 0x12, + 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x82, 0x09, 0x38, + 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, + 0xf0, 0x73, 0x09, 0x3d, 0xf0, 0x20, 0x80, 0x01, + 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, 0x70, 0x81, + 0x00, 0x13, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, + 0xf0, 0x30, 0x7f, 0xff, 0x11, 0xf8, 0x29, 0x86, + 0xf5, 0x20, 0xf3, 0x30, 0x7f, 0xff, 0x89, 0x11, + 0xf4, 0x95, 0x77, 0x10, 0x40, 0x00, 0xf6, 0xa9, + 0xf8, 0x20, 0x09, 0x54, 0xf2, 0x73, 0x09, 0x67, + 0xf4, 0x95, 0xe8, 0x02, 0x6f, 0xf8, 0x27, 0x7a, + 0x0d, 0x20, 0xf3, 0x30, 0x7f, 0xff, 0x89, 0x11, + 0xf4, 0x95, 0x77, 0x10, 0x40, 0x00, 0xf6, 0xa9, + 0xf8, 0x20, 0x09, 0x64, 0xf2, 0x73, 0x09, 0x67, + 0xf4, 0x95, 0xe8, 0x01, 0x80, 0xf8, 0x27, 0x7b, + 0xe8, 0x00, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, + 0x11, 0xf8, 0x29, 0x86, 0xf5, 0x20, 0xf3, 0x30, + 0x7f, 0xff, 0x89, 0x11, 0xf4, 0x95, 0x77, 0x10, + 0x40, 0x00, 0xf6, 0xa9, 0xf8, 0x20, 0x09, 0x7a, + 0xf2, 0x73, 0x09, 0x8d, 0xf4, 0x95, 0xe8, 0x02, + 0x6f, 0xf8, 0x27, 0x7a, 0x0d, 0x20, 0xf3, 0x30, + 0x7f, 0xff, 0x89, 0x11, 0xf4, 0x95, 0x77, 0x10, + 0x40, 0x00, 0xf6, 0xa9, 0xf8, 0x20, 0x09, 0x8a, + 0xf2, 0x73, 0x09, 0x8d, 0xf4, 0x95, 0xe8, 0x01, + 0x80, 0xf8, 0x27, 0x79, 0xe8, 0x00, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0xf4, 0x95, 0x71, 0x02, + 0x00, 0x12, 0x88, 0x11, 0xf6, 0xb8, 0x57, 0xf8, + 0x27, 0x72, 0xf0, 0x20, 0x7f, 0xff, 0xf2, 0x80, + 0xf0, 0x00, 0x80, 0x00, 0x80, 0x81, 0x57, 0xf8, + 0x27, 0x72, 0xe8, 0x01, 0xf3, 0xf1, 0xf2, 0x80, + 0x80, 0xf8, 0x27, 0x78, 0x77, 0x11, 0x80, 0x00, + 0x48, 0x11, 0x57, 0xf8, 0x27, 0x72, 0xf2, 0x80, + 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x81, + 0x09, 0xb5, 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, + 0x00, 0x01, 0xf0, 0x73, 0x09, 0xba, 0xf0, 0x20, + 0x80, 0x01, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, + 0x45, 0xf8, 0x27, 0x71, 0x43, 0xf8, 0x27, 0x73, + 0x83, 0xf8, 0x00, 0x11, 0xf4, 0x95, 0xe7, 0x20, + 0xf6, 0xa9, 0xf8, 0x30, 0x09, 0xc9, 0xf2, 0x73, + 0x09, 0xe4, 0x77, 0x12, 0x00, 0x00, 0x57, 0xf8, + 0x27, 0x72, 0xf0, 0x20, 0x7f, 0xff, 0xf2, 0x80, + 0x49, 0x12, 0xf5, 0x00, 0xf3, 0x00, 0x80, 0x00, + 0x61, 0xf8, 0x00, 0x0b, 0x80, 0x00, 0xf8, 0x30, + 0x09, 0xdc, 0xf1, 0x20, 0x80, 0x00, 0xf5, 0x20, + 0x89, 0x12, 0xf4, 0x95, 0x48, 0x12, 0x6f, 0xf8, + 0x27, 0x73, 0x0d, 0x00, 0xf4, 0x95, 0x49, 0x0b, + 0x4f, 0xf8, 0x27, 0x72, 0x8a, 0x11, 0xfe, 0x00, + 0x48, 0x12, 0xf4, 0x95, 0x4a, 0x11, 0x4a, 0x16, + 0x4a, 0x17, 0xee, 0xfc, 0xf4, 0x95, 0x71, 0x08, + 0x00, 0x16, 0x88, 0x17, 0xf0, 0x74, 0x08, 0x30, + 0x48, 0x18, 0x70, 0x00, 0x00, 0x16, 0xf2, 0x74, + 0x09, 0x8f, 0xf0, 0x00, 0x00, 0x02, 0x88, 0x11, + 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x81, 0x0a, 0x0a, + 0xf2, 0x74, 0x08, 0xdb, 0xf4, 0x95, 0x48, 0x16, + 0x48, 0x18, 0x70, 0x00, 0x00, 0x16, 0xf2, 0x74, + 0x09, 0x8f, 0xf0, 0x00, 0x00, 0x02, 0x88, 0x11, + 0x10, 0x02, 0x70, 0x01, 0x00, 0x11, 0x80, 0x00, + 0xf2, 0x74, 0x06, 0xce, 0xf4, 0x95, 0x48, 0x17, + 0x49, 0x11, 0x48, 0x17, 0xf6, 0x00, 0x88, 0x17, + 0xe7, 0x60, 0xf5, 0xa9, 0xf8, 0x20, 0x0a, 0x2d, + 0x48, 0x16, 0xf6, 0x20, 0x88, 0x11, 0x48, 0x18, + 0x70, 0x00, 0x00, 0x11, 0xf2, 0x74, 0x09, 0x8f, + 0xf0, 0x00, 0x00, 0x02, 0x88, 0x11, 0x70, 0x01, + 0x00, 0x11, 0x10, 0x02, 0x80, 0x00, 0xf2, 0x74, + 0x06, 0xce, 0xf4, 0x95, 0x48, 0x17, 0xee, 0x04, + 0x48, 0x16, 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x11, + 0xfc, 0x00, 0xee, 0xfd, 0xe8, 0x00, 0x4e, 0xf8, + 0x27, 0x70, 0xe8, 0x00, 0x4e, 0xf8, 0x27, 0x72, + 0xe8, 0x00, 0x4e, 0xf8, 0x27, 0x74, 0xe8, 0x00, + 0x4e, 0xf8, 0x27, 0x76, 0x76, 0xf8, 0x27, 0x79, + 0xff, 0xff, 0x76, 0xf8, 0x27, 0x7a, 0x00, 0x00, + 0x76, 0xf8, 0x27, 0x7b, 0xff, 0xff, 0x76, 0xf8, + 0x27, 0x78, 0x00, 0x00, 0xe8, 0x00, 0x75, 0xf8, + 0x00, 0x08, 0x00, 0x01, 0x76, 0x00, 0x00, 0x00, + 0x76, 0x01, 0x02, 0x00, 0xf2, 0x74, 0x12, 0xdc, + 0xf0, 0x20, 0x27, 0x7c, 0xee, 0x03, 0xfc, 0x00, + 0x4a, 0x11, 0xee, 0xfc, 0xf4, 0x95, 0x4e, 0x00, + 0x77, 0x12, 0x7f, 0xff, 0xf6, 0xb8, 0x49, 0x12, + 0xf1, 0x80, 0xf3, 0x00, 0x80, 0x00, 0x89, 0x12, + 0xf0, 0xe0, 0xf1, 0xf1, 0x4f, 0x02, 0xe9, 0x01, + 0xf4, 0x95, 0x48, 0x0b, 0xf5, 0x40, 0x56, 0x02, + 0xf1, 0x80, 0x81, 0xf8, 0x27, 0x78, 0x77, 0x11, + 0x80, 0x00, 0x56, 0x00, 0x49, 0x11, 0xf1, 0x80, + 0x89, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x81, + 0x0a, 0x81, 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, + 0x00, 0x01, 0xf0, 0x73, 0x0a, 0x86, 0xf0, 0x20, + 0x80, 0x01, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, + 0x10, 0x82, 0xee, 0x04, 0x8a, 0x11, 0xfc, 0x00, + 0x4a, 0x11, 0xee, 0xfe, 0xf4, 0x95, 0x4e, 0x00, + 0x77, 0x11, 0x7f, 0xff, 0xf6, 0xb8, 0x49, 0x11, + 0xf1, 0x80, 0xf3, 0x00, 0x80, 0x00, 0x89, 0x11, + 0xf0, 0xe0, 0xf1, 0xf1, 0xe8, 0x01, 0xf2, 0x80, + 0x80, 0xf8, 0x27, 0x78, 0x56, 0x00, 0xf1, 0x20, + 0x80, 0x00, 0xf1, 0x80, 0xf4, 0x95, 0x49, 0x0b, + 0xf8, 0x4d, 0x0a, 0xab, 0xf0, 0x20, 0x80, 0x01, + 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, 0xf0, 0x73, + 0x0a, 0xaf, 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, + 0x00, 0x01, 0xee, 0x02, 0x48, 0x11, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0x88, 0x12, 0x13, 0x02, + 0x77, 0x11, 0x00, 0x00, 0xf8, 0x4d, 0x0a, 0xcb, + 0xf3, 0x10, 0x00, 0x01, 0x89, 0x1a, 0xf4, 0x95, + 0xf0, 0x72, 0x0a, 0xca, 0x48, 0x11, 0x1c, 0xf8, + 0x29, 0x7e, 0x88, 0x11, 0x11, 0xf8, 0x29, 0x7e, + 0xf2, 0x00, 0x00, 0x01, 0x80, 0xf8, 0x29, 0x7e, + 0x81, 0x92, 0x48, 0x11, 0x8a, 0x11, 0xfc, 0x00, + 0x4a, 0x11, 0xf4, 0x95, 0x71, 0x02, 0x00, 0x11, + 0x88, 0x12, 0xf6, 0xb8, 0xf0, 0x20, 0x7f, 0xff, + 0x57, 0xf8, 0x27, 0x70, 0xf2, 0x80, 0xf0, 0x00, + 0x80, 0x00, 0x80, 0x82, 0x57, 0xf8, 0x27, 0x70, + 0xe8, 0x01, 0xf3, 0xf1, 0xf2, 0x80, 0x80, 0xf8, + 0x27, 0x78, 0x77, 0x12, 0x80, 0x00, 0x48, 0x12, + 0x57, 0xf8, 0x27, 0x70, 0xf2, 0x80, 0x88, 0x12, + 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x82, 0x0a, 0xf4, + 0xe8, 0x00, 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, + 0xf0, 0x73, 0x0a, 0xf9, 0xf0, 0x20, 0x80, 0x01, + 0x75, 0xf8, 0x00, 0x08, 0x00, 0x01, 0x45, 0xf8, + 0x27, 0x75, 0xe7, 0x10, 0x43, 0xf8, 0x27, 0x71, + 0x83, 0xf8, 0x00, 0x12, 0x6d, 0xe8, 0x00, 0x04, + 0x6d, 0x8a, 0xf6, 0xaa, 0xf8, 0x30, 0x0b, 0x0a, + 0xf2, 0x73, 0x0b, 0x25, 0x77, 0x11, 0x00, 0x00, + 0x57, 0xf8, 0x27, 0x70, 0xf0, 0x20, 0x7f, 0xff, + 0xf2, 0x80, 0x49, 0x11, 0xf5, 0x00, 0xf3, 0x00, + 0x80, 0x00, 0x61, 0xf8, 0x00, 0x0b, 0x80, 0x00, + 0xf8, 0x30, 0x0b, 0x1d, 0xf1, 0x20, 0x80, 0x00, + 0xf5, 0x20, 0x89, 0x11, 0xf4, 0x95, 0x48, 0x11, + 0x6f, 0xf8, 0x27, 0x71, 0x0d, 0x00, 0xf4, 0x95, + 0x49, 0x0b, 0x4f, 0xf8, 0x27, 0x70, 0x48, 0x11, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x4a, 0x16, + 0x4a, 0x17, 0xee, 0xf0, 0x88, 0x17, 0x10, 0x17, + 0x80, 0x05, 0x10, 0x16, 0x80, 0x06, 0x10, 0x15, + 0x80, 0x07, 0x71, 0x14, 0x00, 0x11, 0x10, 0x05, + 0xf0, 0x30, 0x00, 0x01, 0x88, 0x10, 0x10, 0x06, + 0xf0, 0x30, 0x00, 0x01, 0x80, 0x08, 0x49, 0x11, + 0x10, 0x05, 0xf6, 0x01, 0x80, 0x09, 0x10, 0x06, + 0x61, 0xf8, 0x00, 0x08, 0x00, 0x01, 0xf8, 0x20, + 0x0b, 0x4b, 0x10, 0x09, 0xf0, 0x00, 0x00, 0x01, + 0x80, 0x09, 0x71, 0x08, 0x00, 0x12, 0xf4, 0xaa, + 0xf8, 0x30, 0x0b, 0x54, 0x10, 0x09, 0xf0, 0x00, + 0x00, 0x01, 0x80, 0x09, 0x12, 0x09, 0x49, 0x11, + 0xf4, 0x7f, 0x80, 0x09, 0xf6, 0x20, 0x80, 0x0a, + 0x56, 0xf8, 0x27, 0x70, 0x4e, 0x0c, 0x10, 0x09, + 0x80, 0x00, 0x48, 0x18, 0xf2, 0x74, 0x0a, 0xce, + 0xf0, 0x00, 0x00, 0x04, 0x88, 0x16, 0xf4, 0x95, + 0xf4, 0x95, 0x6c, 0x86, 0x0b, 0x6d, 0xf2, 0x73, + 0x0c, 0x59, 0xf4, 0x95, 0xe8, 0x00, 0xf6, 0xb8, + 0xf4, 0x95, 0x56, 0x0c, 0xf0, 0xf9, 0x88, 0x12, + 0xf4, 0x95, 0xf4, 0x95, 0x70, 0xe2, 0x27, 0x7c, + 0x29, 0x86, 0xe8, 0x00, 0x80, 0x0e, 0x48, 0x11, + 0xf8, 0x45, 0x0b, 0xcc, 0x77, 0x10, 0x00, 0x01, + 0xf4, 0xa9, 0xf8, 0x30, 0x0b, 0x89, 0x6c, 0xe1, + 0xff, 0xfd, 0x0b, 0x8b, 0x10, 0xe7, 0x00, 0x02, + 0x80, 0x0e, 0xf0, 0x73, 0x0b, 0x8b, 0x10, 0x87, + 0x80, 0x0e, 0xe7, 0x10, 0xf5, 0xae, 0xf8, 0x20, + 0x0b, 0xb2, 0x70, 0x00, 0x00, 0x17, 0x70, 0x01, + 0x00, 0x16, 0x10, 0x04, 0xf0, 0x74, 0x06, 0xce, + 0x48, 0x17, 0x49, 0x16, 0xf6, 0x00, 0x88, 0x17, + 0x48, 0x11, 0xf6, 0x20, 0x88, 0x11, 0x10, 0x09, + 0xf6, 0x20, 0x80, 0x00, 0x48, 0x18, 0xf2, 0x74, + 0x0a, 0xce, 0xf0, 0x00, 0x00, 0x04, 0x88, 0x16, + 0x10, 0x04, 0x70, 0x00, 0x00, 0x17, 0x70, 0x01, + 0x00, 0x11, 0xf0, 0x74, 0x06, 0xce, 0x48, 0x11, + 0x00, 0x04, 0x80, 0x04, 0xf0, 0x73, 0x0b, 0xbc, + 0x70, 0x00, 0x00, 0x17, 0x70, 0x01, 0x00, 0x11, + 0x10, 0x04, 0xf0, 0x74, 0x06, 0xce, 0x48, 0x11, + 0x00, 0x04, 0x80, 0x04, 0x49, 0x11, 0x48, 0x16, + 0xf6, 0x20, 0x88, 0x16, 0xf4, 0x95, 0xf4, 0x95, + 0x6c, 0x86, 0x0b, 0xcc, 0x10, 0x0a, 0x80, 0x00, + 0x48, 0x18, 0xf2, 0x74, 0x0a, 0xce, 0xf0, 0x00, + 0x00, 0x04, 0x88, 0x16, 0x12, 0x0a, 0xf8, 0x45, + 0x0c, 0x33, 0x71, 0x0a, 0x00, 0x10, 0xf4, 0xae, + 0xf8, 0x30, 0x0c, 0x1c, 0x48, 0x16, 0xf0, 0xe1, + 0x88, 0x11, 0x12, 0x08, 0xf8, 0x45, 0x0b, 0xdb, + 0x6d, 0x89, 0x12, 0x07, 0xf8, 0x45, 0x0b, 0xe9, + 0x10, 0x07, 0x80, 0x00, 0x70, 0x02, 0x00, 0x11, + 0x10, 0x06, 0x80, 0x01, 0x10, 0x04, 0xf0, 0x74, + 0x06, 0xdc, 0xf0, 0x73, 0x0b, 0xef, 0x48, 0x11, + 0x6f, 0x00, 0x0c, 0x9f, 0x10, 0x04, 0xf0, 0x74, + 0x0a, 0xb3, 0x11, 0x0e, 0xf1, 0xc0, 0x81, 0x0e, + 0x10, 0x06, 0x49, 0x11, 0xf6, 0x00, 0x80, 0x06, + 0x10, 0x05, 0xf6, 0x20, 0x88, 0x11, 0xf0, 0x00, + 0x00, 0x01, 0x48, 0x08, 0x6f, 0x00, 0x0c, 0x9f, + 0x48, 0x18, 0xf2, 0x74, 0x0a, 0xce, 0xf0, 0x00, + 0x00, 0x04, 0x12, 0x07, 0xf8, 0x45, 0x0c, 0x11, + 0x10, 0x07, 0x80, 0x00, 0x70, 0x02, 0x00, 0x11, + 0x10, 0x06, 0x80, 0x01, 0x10, 0x04, 0xf0, 0x74, + 0x06, 0xdc, 0xf0, 0x73, 0x0c, 0x17, 0x48, 0x11, + 0x6f, 0x00, 0x0c, 0x9f, 0x10, 0x04, 0xf0, 0x74, + 0x0a, 0xb3, 0x11, 0x0e, 0xf1, 0xc0, 0x81, 0x0e, + 0xf0, 0x73, 0x0c, 0x33, 0x12, 0x07, 0xf8, 0x45, + 0x0c, 0x2a, 0x10, 0x07, 0x80, 0x00, 0x10, 0x06, + 0x80, 0x01, 0x10, 0x05, 0x80, 0x02, 0x10, 0x04, + 0xf0, 0x74, 0x06, 0xdc, 0xf0, 0x73, 0x0c, 0x30, + 0x12, 0x05, 0x6f, 0x00, 0x0c, 0x9f, 0x10, 0x04, + 0xf0, 0x74, 0x0a, 0xb3, 0x11, 0x0e, 0xf1, 0xc0, + 0x81, 0x0e, 0x76, 0x00, 0x00, 0x01, 0x48, 0x18, + 0xf2, 0x74, 0x0a, 0xce, 0xf0, 0x00, 0x00, 0x04, + 0x71, 0x04, 0x00, 0x11, 0x70, 0x81, 0x29, 0x86, + 0x10, 0x0e, 0x1c, 0xf8, 0x29, 0x86, 0x80, 0x0e, + 0x76, 0x00, 0x00, 0x01, 0x48, 0x18, 0xf2, 0x74, + 0x0a, 0xce, 0xf0, 0x00, 0x00, 0x04, 0x10, 0x0e, + 0x71, 0x04, 0x00, 0x11, 0x80, 0x81, 0x10, 0xf8, + 0x29, 0x86, 0xf0, 0x00, 0x00, 0x01, 0xf0, 0x30, + 0x7f, 0xff, 0x80, 0xf8, 0x29, 0x86, 0x10, 0x09, + 0xf0, 0x00, 0x00, 0x02, 0x80, 0x09, 0xee, 0x10, + 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x11, 0xfc, 0x00, + 0x10, 0xf8, 0x27, 0x75, 0x08, 0xf8, 0x27, 0x71, + 0xf0, 0x10, 0x00, 0x01, 0x48, 0x08, 0xfc, 0x00, + 0x4a, 0x11, 0x4a, 0x16, 0xee, 0xff, 0xf4, 0x95, + 0x71, 0x04, 0x00, 0x16, 0xf0, 0x00, 0x00, 0x01, + 0x48, 0x08, 0x4e, 0xf8, 0x29, 0x7c, 0x6d, 0xee, + 0xff, 0xfd, 0x48, 0x16, 0xf8, 0x45, 0x0c, 0x99, + 0x56, 0xf8, 0x29, 0x7c, 0xf0, 0x74, 0x0a, 0x5a, + 0x88, 0x11, 0x10, 0xf8, 0x29, 0x7d, 0xf0, 0x00, + 0x00, 0x01, 0x48, 0x08, 0x4e, 0xf8, 0x29, 0x7c, + 0x10, 0xf8, 0x29, 0x82, 0xf0, 0x00, 0x00, 0x01, + 0x88, 0x10, 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0xa9, + 0xfa, 0x30, 0x0c, 0x96, 0x80, 0xf8, 0x29, 0x82, + 0x56, 0xf8, 0x29, 0x80, 0xf0, 0x00, 0x00, 0x01, + 0x4e, 0xf8, 0x29, 0x80, 0x73, 0x11, 0x29, 0x82, + 0x6c, 0xee, 0xff, 0xff, 0x0c, 0x76, 0xee, 0x01, + 0x8a, 0x16, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, + 0x76, 0xf8, 0x29, 0x84, 0x00, 0x00, 0x76, 0xf8, + 0x29, 0x85, 0x00, 0x01, 0xe8, 0x00, 0x4e, 0xf8, + 0x2a, 0x0c, 0x76, 0xf8, 0x29, 0x86, 0x00, 0x00, + 0x76, 0xf8, 0x29, 0x87, 0x00, 0x00, 0x77, 0x11, + 0x29, 0x88, 0x76, 0x81, 0xaa, 0xaa, 0x76, 0xe1, + 0x00, 0x01, 0xaa, 0xaa, 0x76, 0xe1, 0x00, 0x02, + 0x00, 0x00, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, + 0xee, 0xfc, 0xf4, 0x95, 0x71, 0x06, 0x00, 0x14, + 0x71, 0x07, 0x00, 0x13, 0x71, 0x08, 0x00, 0x12, + 0x71, 0x09, 0x00, 0x15, 0x77, 0x10, 0x00, 0xff, + 0xf4, 0xaa, 0xf8, 0x30, 0x0d, 0x44, 0x49, 0x13, + 0x53, 0xf8, 0x2a, 0x0c, 0x4f, 0xf8, 0x2a, 0x0c, + 0x73, 0x12, 0x00, 0x0e, 0xf1, 0x66, 0x00, 0x0d, + 0x89, 0x11, 0xf4, 0x95, 0x77, 0x10, 0x00, 0x01, + 0x71, 0xe1, 0x24, 0x00, 0x00, 0x11, 0xf4, 0xa9, + 0xf8, 0x30, 0x0d, 0x17, 0x77, 0x10, 0x00, 0x02, + 0xf4, 0xa9, 0xf8, 0x30, 0x0c, 0xec, 0x77, 0x11, + 0x29, 0x8a, 0x76, 0x81, 0x00, 0x00, 0xe8, 0x00, + 0x77, 0x14, 0x00, 0x00, 0x77, 0x13, 0x00, 0x00, + 0xf0, 0x73, 0x0d, 0x48, 0x6c, 0x83, 0x0c, 0xfa, + 0x77, 0x11, 0x29, 0x8a, 0x48, 0x12, 0xf0, 0xe8, + 0xf0, 0x40, 0x80, 0x00, 0x80, 0x81, 0xe8, 0x00, + 0x77, 0x14, 0x00, 0x00, 0xf0, 0x73, 0x0d, 0x48, + 0x49, 0x13, 0xf3, 0x40, 0x80, 0x00, 0x81, 0xf8, + 0x29, 0x8a, 0x61, 0xf8, 0x00, 0x15, 0x00, 0x01, + 0xf8, 0x20, 0x0d, 0x07, 0x69, 0xf8, 0x29, 0x8a, + 0x40, 0x00, 0x61, 0xf8, 0x00, 0x14, 0x00, 0x01, + 0xf8, 0x20, 0x0d, 0x0f, 0x69, 0xf8, 0x29, 0x8a, + 0x20, 0x00, 0x77, 0x11, 0x29, 0x8a, 0x49, 0x12, + 0xf3, 0xe8, 0x1b, 0x81, 0x81, 0x81, 0xf0, 0x73, + 0x0d, 0x48, 0x11, 0xf8, 0x29, 0x84, 0xf8, 0x4c, + 0x0d, 0x37, 0x77, 0x11, 0x29, 0x88, 0x76, 0x81, + 0xaa, 0xaa, 0x11, 0xf8, 0x29, 0x85, 0xf3, 0x10, + 0x00, 0x01, 0xf3, 0x40, 0xaa, 0x00, 0x81, 0xe1, + 0x00, 0x01, 0x76, 0x00, 0x00, 0x02, 0x80, 0x01, + 0x70, 0x02, 0x00, 0x14, 0x70, 0x03, 0x00, 0x13, + 0xf2, 0x74, 0x0b, 0x28, 0xf4, 0x95, 0x48, 0x11, + 0x71, 0xf8, 0x29, 0x85, 0x29, 0x84, 0xf0, 0x73, + 0x0d, 0x73, 0x76, 0x00, 0x00, 0x00, 0x80, 0x01, + 0x76, 0x02, 0x00, 0x00, 0x70, 0x03, 0x00, 0x13, + 0xf2, 0x74, 0x0b, 0x28, 0xf4, 0x95, 0xe8, 0x00, + 0xf0, 0x73, 0x0d, 0x73, 0x77, 0x11, 0x29, 0x8a, + 0x70, 0x81, 0x00, 0x13, 0x11, 0xf8, 0x29, 0x84, + 0xf8, 0x4c, 0x0d, 0x68, 0x77, 0x11, 0x29, 0x88, + 0x76, 0x81, 0xaa, 0xaa, 0x11, 0xf8, 0x29, 0x85, + 0xf3, 0x10, 0x00, 0x01, 0xf3, 0x40, 0xaa, 0x00, + 0x81, 0xe1, 0x00, 0x01, 0x76, 0x00, 0x00, 0x03, + 0x80, 0x01, 0x70, 0x02, 0x00, 0x14, 0x70, 0x03, + 0x00, 0x13, 0xf2, 0x74, 0x0b, 0x28, 0xf4, 0x95, + 0x48, 0x11, 0x71, 0xf8, 0x29, 0x85, 0x29, 0x84, + 0xf0, 0x73, 0x0d, 0x73, 0x76, 0x00, 0x00, 0x01, + 0x80, 0x01, 0x70, 0x02, 0x00, 0x14, 0x70, 0x03, + 0x00, 0x13, 0xf2, 0x74, 0x0b, 0x28, 0xf4, 0x95, + 0x48, 0x11, 0x6b, 0xf8, 0x29, 0x84, 0xff, 0xff, + 0xee, 0x04, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, + 0xf5, 0x40, 0xf4, 0x95, 0x48, 0x0b, 0xf4, 0x78, + 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0xe1, + 0xff, 0xb9, 0x0d, 0x88, 0xf2, 0x73, 0x0d, 0xa5, + 0xf4, 0x95, 0xe8, 0x60, 0xf2, 0x00, 0x00, 0x06, + 0x61, 0xf8, 0x00, 0x11, 0x00, 0x20, 0xf8, 0x30, + 0x0d, 0x98, 0x61, 0xf8, 0x00, 0x0b, 0x00, 0x01, + 0xf8, 0x20, 0x0d, 0xa3, 0xf2, 0x00, 0x00, 0x07, + 0xf0, 0x73, 0x0d, 0xa3, 0x61, 0xf8, 0x00, 0x0b, + 0x00, 0x01, 0xf8, 0x20, 0x0d, 0xa1, 0xf2, 0x73, + 0x0d, 0xa3, 0xf0, 0x00, 0x00, 0x01, 0xf0, 0x00, + 0x00, 0x02, 0x48, 0x08, 0xf4, 0x7f, 0x8a, 0x11, + 0xfc, 0x00, 0xee, 0xff, 0xf0, 0x74, 0x07, 0xfd, + 0xf0, 0x74, 0x07, 0x44, 0xf0, 0x74, 0x0d, 0xb4, + 0xf0, 0x74, 0x02, 0x05, 0xf0, 0x74, 0x04, 0x60, + 0xf0, 0x73, 0x0d, 0xaa, 0xee, 0xfd, 0x10, 0xf8, + 0x2a, 0xa3, 0xf8, 0x44, 0x0d, 0xcb, 0x10, 0xf8, + 0x2a, 0xa4, 0xf8, 0x45, 0x0d, 0xd7, 0x76, 0x00, + 0x02, 0x00, 0xf2, 0x74, 0x09, 0xe8, 0xf0, 0x20, + 0x22, 0x00, 0x76, 0xf8, 0x2a, 0xa4, 0x00, 0x00, + 0x76, 0xf8, 0x2a, 0xa7, 0x00, 0x00, 0xf0, 0x73, + 0x0d, 0xd7, 0x76, 0x00, 0x02, 0x00, 0xf2, 0x74, + 0x09, 0xe8, 0xf0, 0x20, 0x20, 0x00, 0x76, 0xf8, + 0x2a, 0xa3, 0x00, 0x00, 0x76, 0xf8, 0x2a, 0xa7, + 0x00, 0x01, 0xf0, 0x74, 0x0c, 0x5e, 0xf0, 0xe0, + 0xf0, 0x10, 0x3a, 0x98, 0xf8, 0x47, 0x0d, 0xe1, + 0x76, 0xf8, 0x27, 0x6e, 0x00, 0x00, 0xee, 0x03, + 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, 0x77, 0x11, + 0x20, 0x00, 0x76, 0x00, 0xaa, 0xaa, 0x76, 0x01, + 0x02, 0x00, 0xf2, 0x74, 0x06, 0x6c, 0xf4, 0x95, + 0x48, 0x11, 0x76, 0x00, 0x55, 0x55, 0x76, 0x01, + 0x02, 0x00, 0x48, 0x11, 0xf2, 0x74, 0x06, 0x6c, + 0xf0, 0x00, 0x02, 0x00, 0x76, 0xf8, 0x2a, 0xa3, + 0x00, 0x00, 0x76, 0xf8, 0x2a, 0xa4, 0x00, 0x00, + 0xe8, 0x00, 0x4e, 0x00, 0xfb, 0x80, 0x15, 0x3e, + 0xf4, 0x95, 0xe8, 0x04, 0x80, 0xf8, 0x2a, 0xa5, + 0x76, 0x00, 0x2a, 0xa8, 0xf9, 0x80, 0x14, 0x87, + 0x76, 0x00, 0x2a, 0xad, 0xfb, 0x80, 0x13, 0x62, + 0xf4, 0x95, 0xe8, 0x02, 0x10, 0xf8, 0x2a, 0xa5, + 0xf9, 0x80, 0x14, 0x63, 0xfb, 0x80, 0x16, 0x66, + 0xf4, 0x95, 0xe8, 0x1c, 0xfb, 0x80, 0x16, 0x87, + 0xf4, 0x95, 0xe8, 0x1c, 0xe8, 0x01, 0x4e, 0x00, + 0xfb, 0x80, 0x17, 0xd6, 0xf4, 0x95, 0xe8, 0x00, + 0x80, 0xf8, 0x2a, 0xa6, 0x76, 0x00, 0x2a, 0xb7, + 0xf9, 0x80, 0x16, 0xaa, 0x10, 0xf8, 0x2a, 0xa6, + 0xf9, 0x80, 0x17, 0x5c, 0x10, 0xf8, 0x2a, 0xa6, + 0xf9, 0x80, 0x17, 0x6f, 0xee, 0x02, 0x8a, 0x11, + 0xfc, 0x00, 0xf4, 0x95, 0x4a, 0x08, 0x4a, 0x09, + 0x4a, 0x0a, 0x4a, 0x07, 0x4a, 0x1d, 0x68, 0xf8, + 0x00, 0x07, 0x7d, 0x3f, 0x69, 0xf8, 0x00, 0x07, + 0x40, 0x00, 0x68, 0xf8, 0x00, 0x1d, 0xff, 0xfc, + 0x10, 0xf8, 0x2a, 0xa7, 0xf8, 0x44, 0x0e, 0x4b, + 0x76, 0xf8, 0x2a, 0xa3, 0x00, 0x01, 0xf0, 0x73, + 0x0e, 0x4e, 0x76, 0xf8, 0x2a, 0xa4, 0x00, 0x01, + 0x8a, 0x1d, 0x8a, 0x07, 0x8a, 0x0a, 0x8a, 0x09, + 0x8a, 0x08, 0xf4, 0xeb, 0x4a, 0x11, 0x4a, 0x16, + 0x4a, 0x17, 0xee, 0xfe, 0x88, 0x0e, 0x71, 0x08, + 0x00, 0x16, 0x71, 0x06, 0x00, 0x17, 0x11, 0x07, + 0xf0, 0x66, 0x00, 0x0d, 0xf0, 0x00, 0x25, 0xa0, + 0x88, 0x11, 0x76, 0x01, 0x00, 0x06, 0x81, 0x00, + 0xf2, 0x74, 0x06, 0xce, 0xf0, 0x00, 0x00, 0x01, + 0x76, 0x01, 0x00, 0x06, 0x70, 0x00, 0x00, 0x16, + 0x48, 0x11, 0xf2, 0x74, 0x06, 0xce, 0xf0, 0x00, + 0x00, 0x07, 0x70, 0x81, 0x00, 0x17, 0xee, 0x02, + 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x11, 0xfc, 0x00, + 0x4a, 0x11, 0x88, 0x0e, 0x71, 0x02, 0x00, 0x12, + 0x11, 0x03, 0xf0, 0x66, 0x00, 0x0d, 0xf0, 0x00, + 0x24, 0x00, 0x88, 0x11, 0xf4, 0x95, 0x70, 0x81, + 0x00, 0x12, 0x6e, 0xe2, 0xff, 0xfe, 0x0e, 0x8d, + 0xf4, 0x95, 0xe8, 0x00, 0xe8, 0x01, 0x80, 0xe1, + 0x00, 0x02, 0x76, 0xe1, 0x00, 0x03, 0x00, 0xff, + 0x76, 0xe1, 0x00, 0x04, 0x00, 0x00, 0x76, 0xe1, + 0x00, 0x0b, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x0c, + 0x00, 0x00, 0x81, 0xe1, 0x00, 0x01, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfc, 0x88, 0x0e, + 0xf4, 0x95, 0xf1, 0x66, 0x00, 0x0d, 0xf3, 0x00, + 0x24, 0x00, 0x89, 0x11, 0xf4, 0x95, 0xf4, 0x95, + 0x76, 0xe1, 0x00, 0x0c, 0x00, 0x00, 0x76, 0xe1, + 0x00, 0x0b, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x02, + 0x00, 0x01, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01, + 0x00, 0x00, 0x80, 0x02, 0x76, 0x03, 0x00, 0x00, + 0xf2, 0x74, 0x0c, 0xb9, 0xf4, 0x95, 0xe8, 0x00, + 0xee, 0x04, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, + 0x88, 0x19, 0xf4, 0x95, 0x73, 0x19, 0x00, 0x0e, + 0xf1, 0x66, 0x00, 0x0d, 0xf2, 0x00, 0x24, 0x00, + 0x77, 0x15, 0x25, 0xa0, 0x77, 0x14, 0x00, 0x00, + 0x77, 0x1a, 0x00, 0x1f, 0xf0, 0x72, 0x0f, 0x14, + 0xf6, 0xb8, 0x49, 0x19, 0x09, 0x85, 0xf8, 0x4c, + 0x0f, 0x13, 0xf1, 0x00, 0x00, 0x05, 0x89, 0x11, + 0x49, 0x15, 0xf3, 0x00, 0x00, 0x01, 0x89, 0x13, + 0x49, 0x15, 0xf3, 0x00, 0x00, 0x07, 0x89, 0x12, + 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x10, + 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x80, 0x0f, 0x13, + 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x10, + 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x80, 0x0f, 0x13, + 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x10, + 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x80, 0x0f, 0x13, + 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x10, + 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x80, 0x0f, 0x13, + 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x10, + 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x80, 0x0f, 0x13, + 0x11, 0x93, 0x1d, 0x91, 0x19, 0x92, 0x89, 0x11, + 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0x81, 0x0f, 0x13, + 0x6d, 0x94, 0x6d, 0xed, 0x00, 0x0d, 0x48, 0x14, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x4a, 0x16, + 0x4a, 0x17, 0xee, 0xf8, 0x88, 0x17, 0x10, 0x0d, + 0x80, 0x04, 0x10, 0x0c, 0x80, 0x05, 0x71, 0x0e, + 0x00, 0x16, 0x73, 0x17, 0x00, 0x0e, 0xf0, 0x66, + 0x00, 0x0d, 0xf0, 0x00, 0x24, 0x00, 0x88, 0x11, + 0x10, 0xf8, 0x27, 0x63, 0xf8, 0x45, 0x0f, 0x32, + 0xf2, 0x74, 0x0e, 0x9f, 0xf4, 0x95, 0x48, 0x17, + 0x10, 0xf8, 0x27, 0x60, 0xf8, 0x44, 0x0f, 0x3d, + 0x60, 0xe1, 0x00, 0x02, 0x00, 0x01, 0xf8, 0x20, + 0x0f, 0x6d, 0xf0, 0x73, 0x11, 0x33, 0x10, 0x04, + 0x80, 0x00, 0x10, 0x05, 0xf0, 0x74, 0x06, 0x9f, + 0x11, 0x04, 0xf3, 0x00, 0x00, 0x01, 0x81, 0x04, + 0x6d, 0x8e, 0x77, 0x10, 0x00, 0x01, 0x71, 0xe1, + 0x00, 0x02, 0x00, 0x12, 0xf4, 0xaa, 0xf8, 0x30, + 0x0f, 0x62, 0x77, 0x10, 0x00, 0x02, 0xf4, 0xaa, + 0xf8, 0x30, 0x0f, 0x6d, 0x45, 0xe1, 0x00, 0x0b, + 0x88, 0x10, 0x43, 0xe1, 0x00, 0x0c, 0x83, 0xf8, + 0x00, 0x12, 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0xaa, + 0xf8, 0x30, 0x0f, 0x6d, 0xf0, 0x73, 0x0f, 0x96, + 0xf5, 0x00, 0x81, 0x04, 0x49, 0x16, 0xf5, 0x20, + 0x89, 0x16, 0x76, 0xe1, 0x00, 0x0c, 0x00, 0x00, + 0x76, 0xe1, 0x00, 0x04, 0x00, 0x00, 0x48, 0x16, + 0xf8, 0x45, 0x11, 0x33, 0xf7, 0xb8, 0x71, 0xe1, + 0x00, 0x02, 0x00, 0x12, 0x10, 0xf8, 0x00, 0x12, + 0xf0, 0x10, 0x00, 0x03, 0xf8, 0x46, 0x0f, 0x8c, + 0x10, 0xf8, 0x00, 0x12, 0xf0, 0x10, 0x00, 0x03, + 0xf8, 0x45, 0x10, 0x16, 0x77, 0x10, 0x00, 0x01, + 0xf4, 0xaa, 0xf8, 0x30, 0x0f, 0x9c, 0x77, 0x10, + 0x00, 0x02, 0xf4, 0xaa, 0xf8, 0x30, 0x0f, 0xa8, + 0xf0, 0x73, 0x0f, 0x96, 0x77, 0x10, 0x00, 0x04, + 0xf4, 0xaa, 0xf8, 0x30, 0x10, 0xb7, 0x77, 0x10, + 0x00, 0x05, 0xf4, 0xaa, 0xf8, 0x30, 0x10, 0xbc, + 0xf2, 0x74, 0x0e, 0x9f, 0xf4, 0x95, 0x48, 0x17, + 0xf0, 0x73, 0x11, 0x31, 0x76, 0xe1, 0x00, 0x0c, + 0x00, 0x00, 0x76, 0xe1, 0x00, 0x0b, 0x00, 0x00, + 0x76, 0xe1, 0x00, 0x04, 0x00, 0x00, 0x76, 0xe1, + 0x00, 0x02, 0x00, 0x02, 0x11, 0xe1, 0x00, 0x0c, + 0xe8, 0x03, 0xf6, 0x20, 0x89, 0x12, 0xf4, 0x95, + 0x77, 0x10, 0x00, 0x03, 0xf5, 0xaa, 0xf8, 0x30, + 0x0f, 0xb6, 0x6b, 0xf8, 0x27, 0x6f, 0x00, 0x01, + 0x88, 0x10, 0xf4, 0x95, 0xf4, 0x95, 0xf5, 0xae, + 0xf8, 0x20, 0x0f, 0xbd, 0x48, 0x16, 0x80, 0x06, + 0x88, 0x13, 0xf4, 0x95, 0x77, 0x10, 0x00, 0x03, + 0xf6, 0xab, 0xf8, 0x20, 0x0f, 0xc8, 0x6b, 0xf8, + 0x27, 0x6f, 0x00, 0x01, 0x12, 0x06, 0xf8, 0x45, + 0x10, 0x00, 0x10, 0xe1, 0x00, 0x04, 0x80, 0x00, + 0x10, 0x05, 0x80, 0x01, 0x10, 0x04, 0x80, 0x02, + 0x10, 0x06, 0x80, 0x03, 0x48, 0x11, 0xf2, 0x74, + 0x07, 0x1e, 0xf0, 0x00, 0x00, 0x05, 0x10, 0x06, + 0x00, 0xe1, 0x00, 0x04, 0x80, 0xe1, 0x00, 0x04, + 0x10, 0x06, 0x00, 0xe1, 0x00, 0x0c, 0x80, 0xe1, + 0x00, 0x0c, 0x88, 0x12, 0x11, 0x06, 0x10, 0x04, + 0xf6, 0x00, 0x80, 0x04, 0x48, 0x16, 0xf6, 0x20, + 0x88, 0x16, 0x89, 0x13, 0xf4, 0x95, 0x77, 0x10, + 0x00, 0x03, 0xf6, 0xab, 0xf8, 0x20, 0x0f, 0xf5, + 0x6b, 0xf8, 0x27, 0x6f, 0x00, 0x01, 0x77, 0x10, + 0x00, 0x0c, 0x71, 0xe1, 0x00, 0x04, 0x00, 0x13, + 0xf6, 0xab, 0xf8, 0x20, 0x10, 0x00, 0x6b, 0xf8, + 0x27, 0x6f, 0x00, 0x01, 0x6c, 0xe2, 0xff, 0xfd, + 0x11, 0x31, 0xf6, 0xb8, 0x6f, 0xe1, 0x00, 0x05, + 0x0c, 0x48, 0x6f, 0xe1, 0x00, 0x06, 0x0c, 0x18, + 0xf0, 0x30, 0x0f, 0xff, 0xf0, 0x00, 0x00, 0x03, + 0x80, 0xe1, 0x00, 0x0b, 0x76, 0xe1, 0x00, 0x02, + 0x00, 0x03, 0x48, 0x16, 0xf8, 0x45, 0x11, 0x33, + 0x71, 0xe1, 0x00, 0x0c, 0x00, 0x12, 0x10, 0xe1, + 0x00, 0x0b, 0x49, 0x12, 0xf6, 0x20, 0x88, 0x13, + 0xe8, 0x0c, 0xf6, 0x20, 0x88, 0x10, 0xf4, 0x95, + 0xf4, 0x95, 0xf5, 0xab, 0xf8, 0x20, 0x10, 0x27, + 0x48, 0x13, 0x80, 0x06, 0x88, 0x10, 0xf4, 0x95, + 0xf4, 0x95, 0xf5, 0xae, 0xf8, 0x20, 0x10, 0x30, + 0x70, 0x06, 0x00, 0x16, 0x12, 0x06, 0xf8, 0x45, + 0x10, 0x5f, 0x10, 0xe1, 0x00, 0x04, 0x80, 0x00, + 0x10, 0x05, 0x80, 0x01, 0x10, 0x04, 0x80, 0x02, + 0x10, 0x06, 0x80, 0x03, 0x48, 0x11, 0xf2, 0x74, + 0x07, 0x1e, 0xf0, 0x00, 0x00, 0x05, 0x10, 0x06, + 0x00, 0xe1, 0x00, 0x04, 0x80, 0xe1, 0x00, 0x04, + 0x10, 0x06, 0x00, 0xe1, 0x00, 0x0c, 0x80, 0xe1, + 0x00, 0x0c, 0x88, 0x12, 0x11, 0x06, 0x10, 0x04, + 0xf6, 0x00, 0x80, 0x04, 0x48, 0x16, 0xf6, 0x20, + 0x88, 0x16, 0xf4, 0x95, 0x77, 0x10, 0x00, 0x0c, + 0x71, 0xe1, 0x00, 0x04, 0x00, 0x13, 0xf6, 0xab, + 0xf8, 0x20, 0x10, 0x5f, 0x6b, 0xf8, 0x27, 0x6f, + 0x00, 0x01, 0x77, 0x10, 0x00, 0x0c, 0xf6, 0xaa, + 0xf8, 0x20, 0x10, 0x6b, 0xf2, 0x74, 0x0e, 0x9f, + 0xf4, 0x95, 0x48, 0x17, 0x71, 0xe1, 0x00, 0x0c, + 0x00, 0x12, 0x77, 0x10, 0x00, 0x0c, 0xf4, 0xaa, + 0xf8, 0x30, 0x10, 0x7c, 0x77, 0x10, 0x00, 0x0c, + 0x71, 0xe1, 0x00, 0x0b, 0x00, 0x13, 0xf6, 0xab, + 0xf8, 0x30, 0x10, 0xb4, 0xe7, 0x30, 0xf7, 0xaa, + 0xf8, 0x30, 0x10, 0xb4, 0xf2, 0x74, 0x0e, 0xc1, + 0xf4, 0x95, 0x48, 0x17, 0x88, 0x12, 0xf4, 0x95, + 0xf4, 0x95, 0x6c, 0x82, 0x10, 0x8d, 0x76, 0xe1, + 0x00, 0x04, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x02, + 0x00, 0x05, 0xf0, 0x73, 0x10, 0xb4, 0x76, 0xe1, + 0x00, 0x02, 0x00, 0x04, 0x77, 0x10, 0x00, 0x0c, + 0x71, 0xe1, 0x00, 0x0b, 0x00, 0x12, 0xf5, 0xaa, + 0xf8, 0x20, 0x10, 0x9a, 0xf0, 0x73, 0x10, 0x9c, + 0x77, 0x12, 0x00, 0x0c, 0x76, 0x00, 0x00, 0x00, + 0x70, 0x01, 0x00, 0x12, 0x70, 0x02, 0x00, 0x17, + 0x76, 0x03, 0x00, 0x01, 0x48, 0x11, 0xf2, 0x74, + 0x0c, 0xb9, 0xf0, 0x00, 0x00, 0x05, 0x76, 0xe1, + 0x00, 0x04, 0x00, 0x00, 0x77, 0x10, 0x00, 0x0c, + 0x71, 0xe1, 0x00, 0x0b, 0x00, 0x12, 0xf6, 0xaa, + 0xf8, 0x20, 0x11, 0x1c, 0x48, 0x16, 0xf8, 0x45, + 0x11, 0x33, 0x60, 0xe1, 0x00, 0x02, 0x00, 0x05, + 0xf8, 0x20, 0x10, 0xdf, 0x10, 0xe1, 0x00, 0x0b, + 0x08, 0xe1, 0x00, 0x0c, 0x11, 0xe1, 0x00, 0x04, + 0xf8, 0x4d, 0x10, 0xc7, 0x6b, 0xf8, 0x27, 0x6f, + 0x00, 0x01, 0x88, 0x10, 0xf4, 0x95, 0xf4, 0x95, + 0xf5, 0xae, 0xf8, 0x20, 0x10, 0xcf, 0x48, 0x16, + 0xf4, 0x95, 0x48, 0x08, 0xf8, 0x45, 0x11, 0x16, + 0x6f, 0xe1, 0x00, 0x0c, 0x0d, 0x00, 0x81, 0xe1, + 0x00, 0x0c, 0x11, 0x04, 0xf5, 0x00, 0x81, 0x04, + 0x49, 0x16, 0xf5, 0x20, 0x89, 0x16, 0xf0, 0x73, + 0x11, 0x0e, 0x10, 0xe1, 0x00, 0x0b, 0x71, 0xe1, + 0x00, 0x0c, 0x00, 0x12, 0x88, 0x10, 0xf4, 0x95, + 0xf4, 0x95, 0xf6, 0xaa, 0xf8, 0x30, 0x11, 0x16, + 0x49, 0x12, 0xf6, 0x20, 0x88, 0x10, 0xf4, 0x95, + 0xf4, 0x95, 0xf5, 0xae, 0xf8, 0x20, 0x10, 0xf3, + 0x48, 0x16, 0x80, 0x06, 0x48, 0x08, 0xf8, 0x45, + 0x11, 0x16, 0x10, 0x04, 0x70, 0x02, 0x00, 0x17, + 0x80, 0x00, 0x76, 0x03, 0x00, 0x00, 0x10, 0x06, + 0x80, 0x01, 0x10, 0x05, 0xf0, 0x74, 0x0c, 0xb9, + 0x10, 0x06, 0x00, 0xe1, 0x00, 0x0c, 0x80, 0xe1, + 0x00, 0x0c, 0x11, 0x06, 0x10, 0x04, 0xf6, 0x00, + 0x80, 0x04, 0x48, 0x16, 0xf6, 0x20, 0x88, 0x16, + 0x10, 0xe1, 0x00, 0x0c, 0x08, 0xe1, 0x00, 0x0b, + 0xf8, 0x45, 0x11, 0x1c, 0xf0, 0x73, 0x11, 0x31, + 0xf2, 0x74, 0x0e, 0x9f, 0xf4, 0x95, 0x48, 0x17, + 0xf0, 0x73, 0x11, 0x33, 0x76, 0xe1, 0x00, 0x0c, + 0x00, 0x00, 0x76, 0xe1, 0x00, 0x0b, 0x00, 0x00, + 0x76, 0xe1, 0x00, 0x02, 0x00, 0x01, 0x10, 0x04, + 0x80, 0x00, 0x10, 0x05, 0xf0, 0x74, 0x06, 0x9f, + 0x88, 0x12, 0xf4, 0x95, 0x77, 0x10, 0x00, 0xff, + 0xf4, 0xaa, 0xf8, 0x30, 0x11, 0x33, 0x6c, 0x86, + 0x0f, 0x70, 0xee, 0x08, 0x8a, 0x17, 0x8a, 0x16, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfc, + 0xf4, 0x95, 0x71, 0x06, 0x00, 0x12, 0x88, 0x11, + 0x73, 0x12, 0x00, 0x0e, 0xf1, 0x66, 0x00, 0x0d, + 0xf3, 0x00, 0x24, 0x00, 0x89, 0x14, 0x13, 0x81, + 0xf7, 0x7a, 0xf3, 0x30, 0x00, 0x01, 0x81, 0xf8, + 0x27, 0x60, 0x13, 0xe1, 0x00, 0x01, 0xf7, 0x7c, + 0xf3, 0x30, 0x00, 0x03, 0x81, 0xf8, 0x27, 0x61, + 0xe9, 0x0f, 0x19, 0xe1, 0x00, 0x01, 0x81, 0xf8, + 0x27, 0x62, 0x71, 0xe4, 0x00, 0x03, 0x00, 0x13, + 0xf6, 0xb8, 0x49, 0x13, 0xf3, 0x00, 0x00, 0x01, + 0xf3, 0x30, 0x00, 0x0f, 0x49, 0x0b, 0x09, 0xf8, + 0x27, 0x62, 0xf8, 0x4d, 0x11, 0x75, 0x77, 0x10, + 0x00, 0xff, 0xf4, 0xab, 0xf8, 0x30, 0x11, 0x75, + 0x57, 0xf8, 0x27, 0x6c, 0xf3, 0x00, 0x00, 0x01, + 0x4f, 0xf8, 0x27, 0x6c, 0x76, 0xf8, 0x27, 0x63, + 0x00, 0x01, 0xf0, 0x73, 0x11, 0x78, 0x76, 0xf8, + 0x27, 0x63, 0x00, 0x00, 0x70, 0xe4, 0x00, 0x03, + 0x27, 0x62, 0x76, 0xf8, 0x27, 0x64, 0x00, 0x00, + 0x11, 0xf8, 0x27, 0x61, 0x61, 0xf8, 0x00, 0x0b, + 0x00, 0x02, 0xf8, 0x20, 0x11, 0x8d, 0xe9, 0x01, + 0x6f, 0xe1, 0x00, 0x02, 0x0f, 0x18, 0x81, 0xf8, + 0x27, 0x64, 0x11, 0xf8, 0x27, 0x61, 0x61, 0xf8, + 0x00, 0x0b, 0x00, 0x01, 0xf8, 0x20, 0x11, 0xa9, + 0x10, 0xf8, 0x27, 0x64, 0xf1, 0x00, 0x00, 0x04, + 0x89, 0x13, 0xe9, 0xb8, 0xf5, 0x20, 0x81, 0xf8, + 0x27, 0x65, 0x60, 0x84, 0x00, 0x02, 0xf8, 0x20, + 0x11, 0xa9, 0x70, 0x00, 0x00, 0x11, 0x70, 0x01, + 0x00, 0x13, 0x70, 0x02, 0x27, 0x65, 0xf2, 0x74, + 0x0f, 0x18, 0xf4, 0x95, 0x48, 0x12, 0xee, 0x04, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0x4a, 0x16, + 0x4a, 0x17, 0xee, 0xfc, 0xe8, 0x00, 0x4e, 0xf8, + 0x27, 0x66, 0xe8, 0x00, 0x4e, 0xf8, 0x27, 0x68, + 0xe8, 0x00, 0x4e, 0xf8, 0x27, 0x6c, 0xe8, 0x00, + 0x4e, 0xf8, 0x27, 0x6a, 0x77, 0x12, 0x27, 0x40, + 0x77, 0x11, 0x24, 0x00, 0x77, 0x1a, 0x00, 0x1f, + 0xf0, 0x72, 0x11, 0xdb, 0x70, 0x92, 0x00, 0x11, + 0x76, 0xe1, 0x00, 0x01, 0xff, 0xff, 0x76, 0x81, + 0x00, 0x00, 0x76, 0xe1, 0x00, 0x02, 0x00, 0x00, + 0x76, 0xe1, 0x00, 0x03, 0x00, 0xff, 0x76, 0xe1, + 0x00, 0x0c, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x0b, + 0x00, 0x00, 0x76, 0xe1, 0x00, 0x04, 0x00, 0x00, + 0x6d, 0xe9, 0x00, 0x0d, 0xf0, 0x20, 0x25, 0xa0, + 0xf1, 0x00, 0x00, 0x07, 0x89, 0x11, 0xf1, 0x00, + 0x00, 0x01, 0x81, 0x02, 0x88, 0x16, 0xf4, 0x95, + 0x77, 0x17, 0x00, 0x20, 0x76, 0x86, 0x00, 0xff, + 0x76, 0x00, 0x00, 0x00, 0x76, 0x01, 0x00, 0x06, + 0x10, 0x02, 0xf0, 0x74, 0x06, 0x6c, 0x76, 0x00, + 0x00, 0x00, 0x76, 0x01, 0x00, 0x06, 0xf2, 0x74, + 0x06, 0x6c, 0xf4, 0x95, 0x48, 0x11, 0x10, 0x02, + 0xf0, 0x00, 0x00, 0x0d, 0x80, 0x02, 0x6d, 0xe9, + 0x00, 0x0d, 0x6d, 0xee, 0x00, 0x0d, 0x6c, 0xef, + 0xff, 0xff, 0x11, 0xe8, 0xf0, 0x74, 0x0c, 0x9d, + 0xee, 0x04, 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x11, + 0xfc, 0x00, 0x4a, 0x11, 0x4a, 0x16, 0x4a, 0x17, + 0xee, 0xfa, 0x88, 0x11, 0x10, 0x0a, 0x49, 0x11, + 0xf8, 0x4d, 0x12, 0x9f, 0x48, 0x08, 0xf8, 0x45, + 0x12, 0x9f, 0x80, 0x04, 0x12, 0x81, 0xf5, 0x78, + 0x89, 0x12, 0xf4, 0x95, 0xf4, 0x95, 0x6c, 0xe2, + 0xff, 0xb9, 0x12, 0x8a, 0x61, 0xf8, 0x00, 0x08, + 0x00, 0x80, 0xf8, 0x30, 0x12, 0x8a, 0x13, 0xe1, + 0x00, 0x01, 0xf0, 0xe8, 0xf7, 0x78, 0xf1, 0xa0, + 0xf2, 0x30, 0x1f, 0xff, 0x88, 0x17, 0xf4, 0x95, + 0x77, 0x12, 0x24, 0x00, 0x77, 0x16, 0x00, 0x00, + 0x77, 0x13, 0x00, 0x20, 0xf6, 0xb8, 0x48, 0x17, + 0x08, 0xe2, 0x00, 0x01, 0xf8, 0x45, 0x12, 0x42, + 0x6d, 0xea, 0x00, 0x0d, 0x6d, 0x96, 0x6c, 0xeb, + 0xff, 0xff, 0x12, 0x34, 0xf0, 0x73, 0x12, 0x90, + 0x56, 0xf8, 0x27, 0x6a, 0xf0, 0x00, 0x00, 0x01, + 0x4e, 0xf8, 0x27, 0x6a, 0x60, 0x82, 0x00, 0x01, + 0xf8, 0x30, 0x12, 0x54, 0x70, 0x00, 0x00, 0x16, + 0xf2, 0x74, 0x11, 0x38, 0xf4, 0x95, 0x48, 0x11, + 0xf0, 0x73, 0x12, 0x90, 0x70, 0x00, 0x00, 0x16, + 0xf2, 0x74, 0x11, 0x38, 0xf4, 0x95, 0x48, 0x11, + 0x72, 0x10, 0x2a, 0x9e, 0xf4, 0x95, 0xf4, 0xaf, + 0xf8, 0x30, 0x12, 0x6e, 0x76, 0x00, 0x00, 0x00, + 0x76, 0x01, 0x00, 0xbc, 0x70, 0x02, 0x00, 0x16, + 0x76, 0x03, 0x00, 0x00, 0xf2, 0x74, 0x0c, 0xb9, + 0xf4, 0x95, 0x48, 0x11, 0xf0, 0x73, 0x12, 0x90, + 0x10, 0xf8, 0x27, 0x6e, 0xf8, 0x44, 0x12, 0x90, + 0x76, 0x00, 0x00, 0x00, 0x76, 0x01, 0x00, 0xbc, + 0x70, 0x02, 0x00, 0x16, 0x76, 0x03, 0x00, 0x00, + 0xf2, 0x74, 0x0c, 0xb9, 0xf4, 0x95, 0x48, 0x11, + 0xf0, 0x74, 0x0c, 0x5e, 0xf0, 0xe0, 0xf0, 0x10, + 0x13, 0x88, 0xf8, 0x42, 0x12, 0x90, 0x76, 0xf8, + 0x27, 0x6e, 0x00, 0x01, 0xf0, 0x73, 0x12, 0x90, + 0x56, 0xf8, 0x27, 0x66, 0xf0, 0x00, 0x00, 0x01, + 0x4e, 0xf8, 0x27, 0x66, 0x6d, 0xe9, 0x00, 0x5e, + 0x56, 0xf8, 0x27, 0x68, 0xf0, 0x00, 0x00, 0x01, + 0x4e, 0xf8, 0x27, 0x68, 0x71, 0x04, 0x00, 0x12, + 0x6e, 0xea, 0xff, 0xff, 0x12, 0x18, 0x70, 0x04, + 0x00, 0x12, 0xee, 0x06, 0x8a, 0x17, 0x8a, 0x16, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xee, 0xfe, + 0x88, 0x0e, 0xf4, 0x95, 0xf0, 0x66, 0x00, 0x0d, + 0xf0, 0x00, 0x25, 0xa0, 0x88, 0x11, 0xf4, 0x95, + 0xf4, 0x95, 0x76, 0x81, 0x00, 0xff, 0x76, 0x00, + 0x00, 0x00, 0x76, 0x01, 0x00, 0x06, 0xf2, 0x74, + 0x06, 0x6c, 0xf0, 0x00, 0x00, 0x01, 0x76, 0x00, + 0x00, 0x00, 0x76, 0x01, 0x00, 0x06, 0x48, 0x11, + 0xf2, 0x74, 0x06, 0x6c, 0xf0, 0x00, 0x00, 0x07, + 0xee, 0x02, 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, + 0x88, 0x0e, 0xf4, 0x95, 0xf0, 0x66, 0x00, 0x0d, + 0xf0, 0x00, 0x24, 0x00, 0x88, 0x11, 0xf4, 0x95, + 0xf4, 0x95, 0x76, 0xe1, 0x00, 0x01, 0xff, 0xff, + 0x76, 0x81, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x02, + 0x00, 0x00, 0x76, 0xe1, 0x00, 0x03, 0x00, 0xff, + 0x8a, 0x11, 0xfc, 0x00, 0x4a, 0x11, 0xf4, 0x95, + 0x13, 0x03, 0x88, 0x11, 0xfa, 0x4d, 0x12, 0xec, + 0x71, 0x02, 0x00, 0x12, 0xf3, 0x10, 0x00, 0x01, + 0x89, 0x1a, 0xf4, 0x95, 0xf0, 0x72, 0x12, 0xeb, + 0x70, 0x91, 0x00, 0x12, 0x8a, 0x11, 0xfc, 0x00, + 0xf4, 0x95, 0x4a, 0x0b, 0x4a, 0x0c, 0x4a, 0x0d, + 0xf7, 0xb8, 0xee, 0xfe, 0x10, 0xf8, 0x00, 0x08, + 0x11, 0x06, 0xf1, 0xc0, 0x83, 0x00, 0xf4, 0x85, + 0x11, 0x06, 0xf7, 0x85, 0x81, 0x06, 0xf6, 0xb8, + 0xec, 0x0f, 0x1e, 0x06, 0x61, 0x00, 0x80, 0x00, + 0xf8, 0x20, 0x13, 0x05, 0xf4, 0x84, 0xee, 0x02, + 0x8a, 0x0d, 0x8a, 0x0c, 0x8a, 0x0b, 0xfc, 0x00, + 0xf4, 0x95, 0x4a, 0x0b, 0x4a, 0x0c, 0x4a, 0x0d, + 0xee, 0xfe, 0xf7, 0xb8, 0x80, 0x00, 0x10, 0xf8, + 0x00, 0x08, 0xf4, 0x85, 0x11, 0x06, 0xf7, 0x85, + 0x81, 0x06, 0xf6, 0xb8, 0xec, 0x0f, 0x1e, 0x06, + 0xf0, 0xf0, 0x61, 0x00, 0x80, 0x00, 0xf8, 0x20, + 0x13, 0x20, 0xf4, 0x84, 0xee, 0x02, 0x8a, 0x0d, + 0x8a, 0x0c, 0x8a, 0x0b, 0xfc, 0x00, 0x4a, 0x11, + 0x77, 0x11, 0x00, 0x7b, 0x76, 0x81, 0x2e, 0xec, + 0x77, 0x11, 0x00, 0x7b, 0xee, 0xff, 0x71, 0x81, + 0x00, 0x11, 0xee, 0x01, 0x76, 0xe1, 0x00, 0x01, + 0x00, 0x00, 0x76, 0xe1, 0x00, 0x04, 0x00, 0x00, + 0x76, 0xe1, 0x00, 0x06, 0x00, 0x00, 0x76, 0xe1, + 0x00, 0x62, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x76, + 0x00, 0x00, 0x76, 0xe1, 0x00, 0x92, 0x00, 0x00, + 0x76, 0xe1, 0x00, 0x94, 0x00, 0x00, 0x76, 0xe1, + 0x00, 0xb0, 0x00, 0x00, 0x76, 0xe1, 0x00, 0xb3, + 0x00, 0x00, 0x76, 0xe1, 0x00, 0xbe, 0x00, 0x00, + 0x76, 0xe1, 0x00, 0xbf, 0x00, 0x00, 0x76, 0xe1, + 0x00, 0xc1, 0x00, 0x00, 0x76, 0xe1, 0x00, 0xc3, + 0x00, 0x00, 0x76, 0xe1, 0x00, 0xc5, 0x00, 0x00, + 0x76, 0xe1, 0x00, 0xc7, 0x00, 0x00, 0x76, 0x81, + 0x00, 0x00, 0x8a, 0x11, 0xf4, 0x95, 0xf4, 0xe4, + 0x4a, 0x11, 0x4a, 0x16, 0x4a, 0x17, 0xee, 0xff, + 0xf4, 0x95, 0x71, 0x06, 0x00, 0x16, 0xfb, 0x80, + 0x16, 0xa2, 0x88, 0x17, 0xf4, 0x95, 0xf7, 0xb8, + 0x10, 0xf8, 0x00, 0x17, 0xf0, 0x10, 0x00, 0x02, + 0xfa, 0x46, 0x13, 0x88, 0x77, 0x11, 0x00, 0x00, + 0x10, 0xf8, 0x00, 0x17, 0xf0, 0x10, 0x00, 0x02, + 0xf8, 0x45, 0x13, 0xf9, 0x10, 0xf8, 0x00, 0x17, + 0xf8, 0x45, 0x14, 0x39, 0x10, 0xf8, 0x00, 0x17, + 0xf0, 0x10, 0x00, 0x01, 0xf8, 0x45, 0x14, 0x1f, + 0xf0, 0x73, 0x14, 0x52, 0x10, 0xf8, 0x00, 0x17, + 0xf0, 0x10, 0x00, 0x03, 0xf8, 0x45, 0x13, 0xd3, + 0x10, 0xf8, 0x00, 0x17, 0xf0, 0x10, 0x00, 0x06, + 0xf8, 0x44, 0x14, 0x52, 0x77, 0x12, 0x00, 0x7b, + 0x71, 0x82, 0x00, 0x14, 0x61, 0xe4, 0x00, 0x07, + 0x00, 0x40, 0xf8, 0x30, 0x14, 0x52, 0x49, 0x14, + 0x48, 0x17, 0xf6, 0x00, 0x88, 0x12, 0xf4, 0x95, + 0x77, 0x13, 0x00, 0x55, 0x77, 0x11, 0x00, 0x57, + 0x6d, 0xea, 0x00, 0x3b, 0xe5, 0x01, 0x10, 0xe6, + 0x00, 0x06, 0x80, 0x81, 0x48, 0x14, 0x00, 0xf8, + 0x00, 0x17, 0x88, 0x12, 0xf4, 0x95, 0x77, 0x11, + 0x00, 0x55, 0x10, 0xe2, 0x00, 0x40, 0x80, 0x81, + 0x77, 0x11, 0x00, 0x57, 0x10, 0xe6, 0x00, 0x07, + 0x80, 0x81, 0x77, 0x11, 0x00, 0x55, 0x10, 0xe2, + 0x00, 0x45, 0x80, 0x81, 0x10, 0xe6, 0x00, 0x08, + 0x77, 0x11, 0x00, 0x57, 0x80, 0x81, 0x77, 0x11, + 0x00, 0x55, 0x10, 0xe2, 0x00, 0x4a, 0x80, 0x81, + 0x77, 0x11, 0x00, 0x57, 0x10, 0xe6, 0x00, 0x09, + 0x80, 0x81, 0xf2, 0x73, 0x14, 0x52, 0x77, 0x11, + 0x03, 0xc0, 0x77, 0x12, 0x00, 0x7b, 0x10, 0x82, + 0xf0, 0x00, 0x00, 0x07, 0x88, 0x13, 0xf4, 0x95, + 0xf4, 0x95, 0x96, 0x1b, 0xf8, 0x30, 0x14, 0x52, + 0x10, 0xe3, 0x00, 0x35, 0x77, 0x12, 0x00, 0x55, + 0x80, 0x82, 0x77, 0x12, 0x00, 0x57, 0x10, 0xe6, + 0x00, 0x04, 0x80, 0x82, 0x77, 0x12, 0x00, 0x55, + 0x10, 0xe3, 0x00, 0x37, 0x80, 0x82, 0x77, 0x12, + 0x00, 0x57, 0x10, 0xe6, 0x00, 0x05, 0x80, 0x82, + 0x48, 0x11, 0xf0, 0x40, 0x00, 0x10, 0xf2, 0x73, + 0x14, 0x50, 0xf0, 0x40, 0x00, 0x20, 0x77, 0x12, + 0x00, 0x7b, 0x10, 0x82, 0xf0, 0x00, 0x00, 0x07, + 0x88, 0x12, 0xf4, 0x95, 0xf4, 0x95, 0x96, 0x0d, + 0xf8, 0x30, 0x14, 0x52, 0x10, 0xe2, 0x00, 0x34, + 0x77, 0x13, 0x00, 0x55, 0x80, 0x83, 0x77, 0x13, + 0x00, 0x57, 0x10, 0xe6, 0x00, 0x02, 0x80, 0x83, + 0x10, 0xe2, 0x00, 0x36, 0x77, 0x12, 0x00, 0x55, + 0x80, 0x82, 0x77, 0x12, 0x00, 0x57, 0x10, 0xe6, + 0x00, 0x03, 0x80, 0x82, 0x48, 0x11, 0xf0, 0x40, + 0x00, 0x04, 0xf2, 0x73, 0x14, 0x50, 0xf0, 0x40, + 0x00, 0x08, 0x77, 0x12, 0x00, 0x7b, 0x10, 0x82, + 0xf0, 0x00, 0x00, 0x07, 0x88, 0x12, 0xf4, 0x95, + 0xf4, 0x95, 0x96, 0x0e, 0xf8, 0x30, 0x14, 0x52, + 0x10, 0xe2, 0x00, 0x33, 0x77, 0x12, 0x00, 0x55, + 0x80, 0x82, 0x77, 0x12, 0x00, 0x57, 0x10, 0xe6, + 0x00, 0x01, 0x80, 0x82, 0x48, 0x11, 0xf2, 0x73, + 0x14, 0x50, 0xf0, 0x40, 0x00, 0x02, 0x77, 0x12, + 0x00, 0x7b, 0x10, 0x82, 0xf0, 0x00, 0x00, 0x07, + 0x88, 0x12, 0xf4, 0x95, 0xf4, 0x95, 0x96, 0x0f, + 0xf8, 0x30, 0x14, 0x52, 0x10, 0xe2, 0x00, 0x32, + 0x77, 0x12, 0x00, 0x55, 0x77, 0x13, 0x00, 0x57, + 0x80, 0x82, 0x48, 0x11, 0xe7, 0x62, 0xf0, 0x40, + 0x00, 0x01, 0xe5, 0x01, 0x88, 0x11, 0xf4, 0x95, + 0x77, 0x12, 0x00, 0x7b, 0x48, 0x11, 0x71, 0x82, + 0x00, 0x12, 0x1a, 0xe2, 0x00, 0x07, 0x80, 0xe2, + 0x00, 0x07, 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x01, + 0x8a, 0x17, 0x48, 0x11, 0x8a, 0x16, 0x8a, 0x11, + 0xf4, 0xe4, 0x4a, 0x11, 0x88, 0x11, 0x77, 0x0e, + 0x00, 0x05, 0x77, 0x12, 0x00, 0x55, 0xe8, 0x04, + 0xf6, 0xb8, 0x28, 0xe1, 0x00, 0x02, 0xee, 0xff, + 0x80, 0x82, 0x77, 0x12, 0x00, 0x57, 0xf0, 0x20, + 0x80, 0x00, 0xee, 0x01, 0x1a, 0x82, 0x77, 0x12, + 0x00, 0x57, 0x80, 0x82, 0xe8, 0x01, 0x32, 0xe1, + 0x00, 0x02, 0xf5, 0x82, 0x77, 0x11, 0x00, 0x54, + 0xf6, 0x93, 0x18, 0x81, 0x77, 0x11, 0x00, 0x54, + 0xf2, 0xa0, 0x80, 0x81, 0x8a, 0x11, 0xf4, 0x95, + 0xf4, 0xe4, 0x4a, 0x11, 0x4a, 0x16, 0xf4, 0x95, + 0x71, 0x04, 0x00, 0x11, 0xfb, 0x80, 0x16, 0xa2, + 0x88, 0x16, 0xf4, 0x95, 0x77, 0x12, 0x00, 0x55, + 0x10, 0xe6, 0x00, 0x03, 0x80, 0x82, 0x77, 0x12, + 0x00, 0x56, 0x10, 0xe1, 0x00, 0x02, 0x77, 0x13, + 0x00, 0x56, 0x80, 0x82, 0x77, 0x12, 0x00, 0x56, + 0x10, 0xe1, 0x00, 0x03, 0x80, 0x82, 0x10, 0xe1, + 0x00, 0x04, 0x77, 0x12, 0x00, 0x56, 0x80, 0x82, + 0x77, 0x12, 0x00, 0x56, 0x10, 0xe1, 0x00, 0x01, + 0x80, 0x82, 0xe7, 0x12, 0xe5, 0x01, 0xf9, 0x80, + 0x16, 0x9a, 0x8a, 0x16, 0x8a, 0x11, 0xf4, 0xe4, + 0x4a, 0x11, 0x4a, 0x16, 0x4a, 0x17, 0xee, 0xf9, + 0x77, 0x11, 0x00, 0x7b, 0x76, 0x00, 0x00, 0x16, + 0x76, 0x01, 0x00, 0x17, 0x76, 0x02, 0x00, 0x1a, + 0x76, 0x03, 0x00, 0x1b, 0x76, 0x04, 0x00, 0x1c, + 0x76, 0x05, 0x00, 0x1d, 0x71, 0x81, 0x00, 0x17, + 0x71, 0xe7, 0x00, 0x06, 0x00, 0x11, 0x10, 0x81, + 0xf8, 0x44, 0x14, 0xdf, 0xf9, 0x80, 0x16, 0x53, + 0xf6, 0xb8, 0xfb, 0x80, 0x15, 0x85, 0xf0, 0x20, + 0xff, 0xff, 0xf6, 0xb8, 0xfb, 0x80, 0x16, 0x08, + 0xf0, 0x20, 0xff, 0xff, 0x77, 0x11, 0x00, 0x7b, + 0x71, 0x81, 0x00, 0x17, 0x76, 0xe7, 0x00, 0x06, + 0x00, 0x01, 0x48, 0x17, 0x77, 0x16, 0x00, 0x00, + 0x77, 0x10, 0x00, 0x04, 0x77, 0x15, 0x00, 0x03, + 0x77, 0x14, 0x00, 0x02, 0x77, 0x13, 0x00, 0x01, + 0xf0, 0x00, 0x00, 0x39, 0x76, 0xe7, 0x00, 0x08, + 0x00, 0x1f, 0x76, 0xe7, 0x00, 0x07, 0x00, 0x00, + 0x88, 0x0e, 0x77, 0x1a, 0x00, 0x05, 0x48, 0x17, + 0xf0, 0x00, 0x00, 0x09, 0x88, 0x12, 0x48, 0x18, + 0x88, 0x19, 0xe8, 0x00, 0xf0, 0x72, 0x15, 0x2c, + 0x73, 0x19, 0x00, 0x11, 0x76, 0x82, 0x00, 0x00, + 0x11, 0x91, 0x73, 0x11, 0x00, 0x19, 0x70, 0xe2, + 0x00, 0x03, 0x00, 0x16, 0x70, 0xe2, 0x00, 0x04, + 0x00, 0x13, 0x70, 0xe2, 0x00, 0x05, 0x00, 0x14, + 0x81, 0xe2, 0x00, 0x01, 0x70, 0xe2, 0x00, 0x06, + 0x00, 0x15, 0x70, 0xe2, 0x00, 0x07, 0x00, 0x10, + 0x80, 0xe2, 0x00, 0x02, 0x73, 0x0e, 0x00, 0x11, + 0xf1, 0x00, 0x00, 0x1e, 0x6d, 0xee, 0x00, 0x05, + 0x6d, 0xeb, 0x00, 0x05, 0x6d, 0xec, 0x00, 0x05, + 0x6d, 0xed, 0x00, 0x05, 0x6d, 0xe8, 0x00, 0x05, + 0xf0, 0x00, 0x00, 0x01, 0x81, 0x91, 0x6d, 0xea, + 0x00, 0x08, 0x73, 0x11, 0x00, 0x0e, 0xee, 0x07, + 0x76, 0xe7, 0x00, 0x41, 0x00, 0x24, 0x76, 0xe7, + 0x00, 0x46, 0x00, 0x25, 0x76, 0xe7, 0x00, 0x4b, + 0x00, 0x26, 0x76, 0xe7, 0x00, 0x50, 0x00, 0x27, + 0x8a, 0x17, 0x8a, 0x16, 0x8a, 0x11, 0xf4, 0xe4, + 0x4a, 0x11, 0x4a, 0x16, 0xee, 0xfe, 0x88, 0x11, + 0x56, 0x06, 0x4e, 0x00, 0xf9, 0x80, 0x16, 0xa2, + 0xf7, 0xb8, 0x10, 0xf8, 0x00, 0x11, 0xf0, 0x10, + 0xff, 0xff, 0xfa, 0x45, 0x15, 0x60, 0x77, 0x16, + 0xff, 0xff, 0x77, 0x12, 0x00, 0x7b, 0x49, 0x11, + 0x10, 0x82, 0xf6, 0x03, 0xf0, 0x00, 0x00, 0x09, + 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, + 0xf8, 0x44, 0x15, 0x71, 0xf2, 0x73, 0x15, 0x71, + 0xf4, 0x95, 0xe7, 0x16, 0x77, 0x11, 0x00, 0x7b, + 0x10, 0x81, 0xf0, 0x00, 0x00, 0x09, 0x88, 0x11, + 0xf4, 0x95, 0x77, 0x12, 0x00, 0x06, 0x10, 0x81, + 0xf8, 0x45, 0x15, 0x5c, 0x6e, 0xea, 0xff, 0xff, + 0x15, 0x69, 0x6d, 0xe9, 0x00, 0x08, 0x76, 0x86, + 0x00, 0x01, 0xe9, 0x01, 0x56, 0x00, 0xf1, 0x80, + 0x10, 0xf8, 0x00, 0x0b, 0xf8, 0x45, 0x15, 0x7e, + 0xfb, 0x80, 0x15, 0x85, 0xf4, 0x95, 0x48, 0x16, + 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x02, 0x48, 0x16, + 0x8a, 0x16, 0x8a, 0x11, 0xf4, 0xe4, 0x4a, 0x11, + 0xee, 0xff, 0xfb, 0x80, 0x16, 0xa2, 0x88, 0x11, + 0xf4, 0x95, 0x77, 0x10, 0xff, 0xff, 0xf4, 0xa9, + 0xf8, 0x30, 0x15, 0xc4, 0x10, 0xe1, 0x00, 0x03, + 0x77, 0x12, 0x00, 0x55, 0x80, 0x82, 0x77, 0x12, + 0x00, 0x56, 0x76, 0x82, 0x00, 0x00, 0x77, 0x12, + 0x00, 0x56, 0x76, 0x82, 0x00, 0x00, 0x77, 0x12, + 0x00, 0x56, 0x76, 0x82, 0x00, 0x00, 0x77, 0x12, + 0x00, 0x56, 0x76, 0x82, 0x00, 0x00, 0x77, 0x12, + 0x00, 0x56, 0x76, 0x82, 0x00, 0x00, 0x10, 0xe1, + 0x00, 0x02, 0xf0, 0x00, 0x00, 0x08, 0x32, 0xf8, + 0x00, 0x08, 0x77, 0x12, 0x00, 0x54, 0xe8, 0x01, + 0xf4, 0x82, 0xf4, 0x93, 0x18, 0x82, 0x77, 0x12, + 0x00, 0x54, 0xf0, 0x40, 0x00, 0x00, 0x80, 0x82, + 0x10, 0xe1, 0x00, 0x01, 0xf9, 0x80, 0x16, 0x76, + 0x10, 0xe1, 0x00, 0x01, 0xf9, 0x80, 0x16, 0x66, + 0xf0, 0x73, 0x16, 0x03, 0x77, 0x11, 0x00, 0x7b, + 0x71, 0x81, 0x00, 0x11, 0x71, 0xe1, 0x00, 0x07, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x10, 0xe1, + 0x00, 0x09, 0xf9, 0x80, 0x15, 0x85, 0x77, 0x11, + 0x00, 0x7b, 0x71, 0x81, 0x00, 0x11, 0x10, 0xe1, + 0x00, 0x09, 0xfb, 0x80, 0x15, 0x85, 0xf0, 0x00, + 0x00, 0x08, 0x77, 0x11, 0x00, 0x7b, 0x71, 0x81, + 0x00, 0x11, 0x10, 0xe1, 0x00, 0x09, 0xfb, 0x80, + 0x15, 0x85, 0xf0, 0x00, 0x00, 0x10, 0x77, 0x11, + 0x00, 0x7b, 0x71, 0x81, 0x00, 0x11, 0x10, 0xe1, + 0x00, 0x09, 0xfb, 0x80, 0x15, 0x85, 0xf0, 0x00, + 0x00, 0x18, 0x77, 0x11, 0x00, 0x7b, 0x71, 0x81, + 0x00, 0x11, 0x10, 0xe1, 0x00, 0x09, 0xfb, 0x80, + 0x15, 0x85, 0xf0, 0x00, 0x00, 0x20, 0x77, 0x11, + 0x00, 0x7b, 0x71, 0x81, 0x00, 0x11, 0x10, 0xe1, + 0x00, 0x09, 0xfb, 0x80, 0x15, 0x85, 0xf0, 0x00, + 0x00, 0x28, 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x01, + 0x8a, 0x11, 0xf4, 0xe4, 0x4a, 0x11, 0xee, 0xff, + 0xfb, 0x80, 0x16, 0xa2, 0x88, 0x11, 0xf4, 0x95, + 0x77, 0x10, 0xff, 0xff, 0xf4, 0xa9, 0xf8, 0x30, + 0x16, 0x41, 0x77, 0x11, 0x00, 0x55, 0x76, 0x81, + 0x00, 0x1e, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, + 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, + 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, + 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, + 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, + 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, + 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, + 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, + 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0x76, 0x81, + 0x00, 0x00, 0x77, 0x11, 0x00, 0x56, 0xf2, 0x73, + 0x16, 0x4e, 0x76, 0x81, 0x00, 0x00, 0x77, 0x11, + 0x00, 0x7b, 0x71, 0x81, 0x00, 0x11, 0x71, 0xe1, + 0x00, 0x07, 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, + 0x10, 0xe1, 0x00, 0x39, 0xf9, 0x80, 0x16, 0x08, + 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x01, 0x8a, 0x11, + 0xf4, 0xe4, 0x4a, 0x11, 0x77, 0x11, 0x00, 0x7b, + 0x10, 0x81, 0xf0, 0x00, 0x00, 0x04, 0x88, 0x11, + 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, 0xfa, 0x44, + 0x16, 0x63, 0xf4, 0x95, 0xee, 0xff, 0x76, 0x81, + 0x00, 0x01, 0xee, 0x01, 0x8a, 0x11, 0xf4, 0xe4, + 0xf0, 0x10, 0x00, 0x10, 0x4a, 0x11, 0x32, 0xf8, + 0x00, 0x08, 0xee, 0xff, 0x77, 0x11, 0x00, 0x01, + 0xe8, 0x01, 0xee, 0x01, 0xf4, 0x82, 0x1a, 0x81, + 0x80, 0x81, 0x8a, 0x11, 0xf4, 0x95, 0xf4, 0xe4, + 0xf0, 0x10, 0x00, 0x10, 0x4a, 0x11, 0x32, 0xf8, + 0x00, 0x08, 0xee, 0xff, 0xe8, 0x01, 0x77, 0x11, + 0x00, 0x00, 0xf4, 0x82, 0xee, 0x01, 0xf4, 0x93, + 0x18, 0x81, 0x80, 0x81, 0x8a, 0x11, 0xf4, 0x95, + 0xf4, 0xe4, 0x4a, 0x11, 0xf0, 0x10, 0x00, 0x10, + 0x77, 0x11, 0x00, 0x00, 0x32, 0xf8, 0x00, 0x08, + 0xee, 0xff, 0x11, 0x81, 0xe8, 0x01, 0xee, 0x01, + 0x77, 0x11, 0x00, 0x00, 0xf4, 0x82, 0xf2, 0xa0, + 0x80, 0x81, 0x8a, 0x11, 0xf4, 0x95, 0xf4, 0xe4, + 0xf2, 0x73, 0x16, 0x9e, 0xf6, 0xbb, 0xf4, 0x95, + 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0xe4, + 0xf2, 0x73, 0x16, 0xa6, 0xf7, 0xbb, 0xf4, 0x95, + 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0x95, 0xf4, 0xe4, + 0x4a, 0x11, 0x4a, 0x16, 0xf4, 0x95, 0x71, 0x04, + 0x00, 0x16, 0xfb, 0x80, 0x16, 0xa2, 0x88, 0x11, + 0xf4, 0x95, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x0e, 0x10, 0xe6, 0x00, 0x0e, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x80, 0x82, + 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, + 0x00, 0x0d, 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, + 0x10, 0xe6, 0x00, 0x0d, 0x80, 0x82, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x0c, + 0x10, 0xe6, 0x00, 0x0c, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x0b, 0x10, 0xe6, + 0x00, 0x0b, 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, + 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x0a, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x10, 0xe6, 0x00, 0x0a, 0x80, 0x82, + 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, + 0x00, 0x09, 0x10, 0xe6, 0x00, 0x09, 0x71, 0xe1, + 0x00, 0x06, 0x00, 0x12, 0x80, 0x82, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x08, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x10, 0xe6, + 0x00, 0x08, 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x07, 0x10, 0xe6, + 0x00, 0x07, 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, + 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x06, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x10, 0xe6, 0x00, 0x06, 0x80, 0x82, + 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, + 0x00, 0x05, 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, + 0x10, 0xe6, 0x00, 0x05, 0x80, 0x82, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x04, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x10, 0xe6, + 0x00, 0x04, 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x03, 0x71, 0xe1, + 0x00, 0x06, 0x00, 0x12, 0x10, 0xe6, 0x00, 0x03, + 0x80, 0x82, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x02, 0x10, 0xe6, 0x00, 0x02, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x80, 0x82, + 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, + 0x00, 0x01, 0x10, 0xe6, 0x00, 0x01, 0x71, 0xe1, + 0x00, 0x06, 0x00, 0x12, 0x80, 0x82, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x13, 0xe7, 0x62, + 0xe5, 0x01, 0xf9, 0x80, 0x16, 0x9a, 0x8a, 0x16, + 0x8a, 0x11, 0xf4, 0xe4, 0x4a, 0x11, 0x88, 0x11, + 0xf4, 0x95, 0xf4, 0x95, 0x71, 0xe1, 0x00, 0x05, + 0x00, 0x12, 0xee, 0xff, 0x76, 0x82, 0x00, 0x00, + 0xee, 0x01, 0x71, 0xe1, 0x00, 0x06, 0x00, 0x11, + 0x69, 0x81, 0x00, 0x01, 0x8a, 0x11, 0xf4, 0x95, + 0xf4, 0xe4, 0x4a, 0x11, 0x88, 0x11, 0xf4, 0x95, + 0xf4, 0x95, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0xee, 0xff, 0x76, 0x82, 0x00, 0x01, 0xee, 0x01, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x11, 0x69, 0x81, + 0x00, 0x01, 0x8a, 0x11, 0xf4, 0x95, 0xf4, 0xe4, + 0x4a, 0x11, 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, + 0xf0, 0x00, 0x00, 0x94, 0x88, 0x11, 0xf4, 0x95, + 0xf4, 0x95, 0x10, 0x81, 0xfa, 0x44, 0x17, 0x9c, + 0xf4, 0x95, 0xee, 0xff, 0xf9, 0x80, 0x16, 0x53, + 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, 0xf0, 0x00, + 0x00, 0x94, 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, + 0x76, 0x81, 0x00, 0x01, 0xee, 0x01, 0x76, 0xe1, + 0x00, 0x01, 0x00, 0x00, 0x76, 0xe1, 0x00, 0x02, + 0x00, 0x21, 0x76, 0xe1, 0x00, 0x03, 0x00, 0x20, + 0x76, 0xe1, 0x00, 0x04, 0x00, 0x23, 0x76, 0xe1, + 0x00, 0x05, 0x00, 0x22, 0x76, 0xe1, 0x00, 0x06, + 0x00, 0x38, 0x76, 0xe1, 0x00, 0x07, 0x00, 0x39, + 0x76, 0xe1, 0x00, 0x08, 0x00, 0x15, 0x76, 0xe1, + 0x00, 0x09, 0x00, 0x14, 0x76, 0xe1, 0x00, 0x0a, + 0x00, 0x00, 0x76, 0xe1, 0x00, 0x0b, 0x00, 0x41, + 0x76, 0xe1, 0x00, 0x0c, 0x00, 0x40, 0x76, 0xe1, + 0x00, 0x0d, 0x00, 0x43, 0x76, 0xe1, 0x00, 0x0e, + 0x00, 0x42, 0x76, 0xe1, 0x00, 0x0f, 0x00, 0x48, + 0x76, 0xe1, 0x00, 0x10, 0x00, 0x49, 0x76, 0xe1, + 0x00, 0x11, 0x00, 0x1b, 0x76, 0xe1, 0x00, 0x12, + 0x00, 0x1a, 0x8a, 0x11, 0xf4, 0x95, 0xf4, 0xe4, + 0x4a, 0x11, 0xee, 0xfd, 0x88, 0x11, 0x56, 0x06, + 0x4e, 0x00, 0xf9, 0x80, 0x16, 0xa2, 0x77, 0x12, + 0x00, 0x7b, 0x77, 0x0e, 0x00, 0x09, 0x10, 0x82, + 0x28, 0xf8, 0x00, 0x11, 0xf0, 0x00, 0x00, 0x95, + 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, + 0xf8, 0x45, 0x17, 0xf0, 0xf2, 0x73, 0x17, 0xfd, + 0x77, 0x11, 0xff, 0xff, 0x76, 0x81, 0x00, 0x01, + 0xe9, 0x01, 0x56, 0x00, 0xf1, 0x80, 0x10, 0xf8, + 0x00, 0x0b, 0xf8, 0x45, 0x17, 0xfd, 0xfb, 0x80, + 0x18, 0x10, 0xf4, 0x95, 0x48, 0x11, 0xf9, 0x80, + 0x16, 0x9a, 0xee, 0x03, 0x48, 0x11, 0x8a, 0x11, + 0xf4, 0x95, 0xf4, 0xe4, 0x4a, 0x11, 0x88, 0x11, + 0xf4, 0x95, 0xee, 0xff, 0x71, 0xe1, 0x00, 0x01, + 0x00, 0x11, 0xee, 0x01, 0x10, 0x81, 0x8a, 0x11, + 0xf4, 0x95, 0xf4, 0xe4, 0x4a, 0x11, 0xee, 0xff, + 0xfb, 0x80, 0x16, 0xa2, 0x88, 0x11, 0xf4, 0x95, + 0x77, 0x10, 0xff, 0xff, 0xf4, 0xa9, 0xf8, 0x30, + 0x18, 0xc3, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x01, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, + 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x02, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x03, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, + 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x04, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x05, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, + 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x06, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x01, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x07, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, + 0x20, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x08, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x09, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, + 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x0a, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x0b, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, + 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x0c, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x71, 0xe1, + 0x00, 0x05, 0x00, 0x12, 0x76, 0x82, 0x00, 0x0d, + 0x71, 0xe1, 0x00, 0x06, 0x00, 0x12, 0x76, 0x82, + 0x00, 0x00, 0x71, 0xe1, 0x00, 0x05, 0x00, 0x12, + 0x76, 0x82, 0x00, 0x0e, 0x71, 0xe1, 0x00, 0x06, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x00, 0x10, 0xe1, + 0x00, 0x07, 0xf9, 0x80, 0x16, 0x76, 0x10, 0xe1, + 0x00, 0x08, 0xf9, 0x80, 0x16, 0x76, 0x10, 0xe1, + 0x00, 0x07, 0xf9, 0x80, 0x16, 0x66, 0x10, 0xe1, + 0x00, 0x08, 0xf9, 0x80, 0x16, 0x66, 0xf0, 0x73, + 0x18, 0xd1, 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, + 0xfb, 0x80, 0x18, 0x10, 0xf0, 0x00, 0x00, 0x95, + 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, 0xfb, 0x80, + 0x18, 0x10, 0xf0, 0x00, 0x00, 0x9e, 0xf9, 0x80, + 0x16, 0x9a, 0xee, 0x01, 0x8a, 0x11, 0xf4, 0xe4, + 0x4a, 0x11, 0x88, 0x11, 0xee, 0xff, 0xf4, 0x95, + 0x10, 0x04, 0x71, 0xe1, 0x00, 0x03, 0x00, 0x11, + 0xee, 0x01, 0x80, 0x81, 0x8a, 0x11, 0xf4, 0x95, + 0xf4, 0xe4, 0x4a, 0x11, 0x4a, 0x16, 0xf4, 0x95, + 0x71, 0x04, 0x00, 0x16, 0xfb, 0x80, 0x16, 0xa2, + 0x88, 0x11, 0xf4, 0x95, 0x71, 0xe1, 0x00, 0x02, + 0x00, 0x12, 0x76, 0x82, 0x00, 0x10, 0x10, 0xe6, + 0x00, 0x01, 0x71, 0xe1, 0x00, 0x03, 0x00, 0x12, + 0x80, 0x82, 0x71, 0xe1, 0x00, 0x04, 0x00, 0x12, + 0x10, 0xe6, 0x00, 0x02, 0x80, 0x82, 0xe7, 0x62, + 0x71, 0xe1, 0x00, 0x02, 0x00, 0x13, 0xe5, 0x01, + 0xf9, 0x80, 0x16, 0x9a, 0x8a, 0x16, 0x8a, 0x11, + 0xf4, 0xe4, 0x4a, 0x11, 0x88, 0x11, 0xee, 0xff, + 0xee, 0x01, 0x10, 0xe1, 0x00, 0x01, 0x8a, 0x11, + 0xf4, 0x95, 0xf4, 0xe4, 0x4a, 0x11, 0x77, 0x11, + 0x00, 0x7b, 0x10, 0x81, 0xf0, 0x00, 0x00, 0xb3, + 0x88, 0x11, 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, + 0xfa, 0x44, 0x19, 0x2a, 0xf4, 0x95, 0xee, 0xff, + 0xf9, 0x80, 0x16, 0x53, 0x77, 0x11, 0x00, 0x7b, + 0x10, 0x81, 0xf0, 0x00, 0x00, 0xb3, 0x88, 0x11, + 0xf4, 0x95, 0xf4, 0x95, 0x76, 0x81, 0x00, 0x01, + 0xee, 0x01, 0x76, 0xe1, 0x00, 0x01, 0x00, 0x00, + 0x76, 0xe1, 0x00, 0x02, 0x00, 0x13, 0x76, 0xe1, + 0x00, 0x03, 0x00, 0x26, 0x76, 0xe1, 0x00, 0x04, + 0x00, 0x25, 0x76, 0xe1, 0x00, 0x05, 0x00, 0x24, + 0x76, 0xe1, 0x00, 0x06, 0x00, 0x00, 0x76, 0xe1, + 0x00, 0x07, 0x00, 0x17, 0x76, 0xe1, 0x00, 0x08, + 0x00, 0x32, 0x76, 0xe1, 0x00, 0x09, 0x00, 0x31, + 0x76, 0xe1, 0x00, 0x0a, 0x00, 0x30, 0x8a, 0x11, + 0xf4, 0x95, 0xf4, 0xe4, 0x4a, 0x11, 0x4a, 0x16, + 0x4a, 0x17, 0xee, 0xff, 0xf4, 0x95, 0x71, 0x06, + 0x00, 0x17, 0xfb, 0x80, 0x16, 0xa2, 0x88, 0x11, + 0xf4, 0x95, 0xf7, 0xb8, 0x10, 0xf8, 0x00, 0x11, + 0xf0, 0x10, 0xff, 0xff, 0xfa, 0x45, 0x19, 0x73, + 0x77, 0x16, 0xff, 0xff, 0x77, 0x12, 0x00, 0x7b, + 0x77, 0x0e, 0x00, 0x05, 0x10, 0x82, 0x28, 0xf8, + 0x00, 0x11, 0xf0, 0x00, 0x00, 0xb4, 0x88, 0x11, + 0xf4, 0x95, 0xf4, 0x95, 0x10, 0x81, 0xf8, 0x44, + 0x19, 0x84, 0xf2, 0x73, 0x19, 0x84, 0xf4, 0x95, + 0xe7, 0x16, 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, + 0xf0, 0x00, 0x00, 0xb4, 0x88, 0x11, 0xf4, 0x95, + 0x77, 0x12, 0x00, 0x02, 0x10, 0x81, 0xf8, 0x45, + 0x19, 0x6f, 0x6e, 0xea, 0xff, 0xff, 0x19, 0x7c, + 0x6d, 0xe9, 0x00, 0x05, 0x61, 0xf8, 0x00, 0x17, + 0x00, 0x01, 0xfa, 0x20, 0x19, 0x8f, 0x76, 0x86, + 0x00, 0x01, 0xfb, 0x80, 0x19, 0x97, 0xf4, 0x95, + 0x48, 0x16, 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x01, + 0x8a, 0x17, 0x48, 0x16, 0x8a, 0x16, 0x8a, 0x11, + 0xf4, 0xe4, 0x4a, 0x11, 0xee, 0xff, 0xfb, 0x80, + 0x16, 0xa2, 0x88, 0x11, 0xf4, 0x95, 0x77, 0x10, + 0xff, 0xff, 0xf4, 0xa9, 0xf8, 0x30, 0x19, 0xcc, + 0x71, 0xe1, 0x00, 0x02, 0x00, 0x12, 0x69, 0x82, + 0x00, 0x10, 0x71, 0xe1, 0x00, 0x02, 0x00, 0x12, + 0x68, 0x82, 0xf7, 0xff, 0x71, 0xe1, 0x00, 0x02, + 0x00, 0x12, 0x68, 0x82, 0xfb, 0xff, 0x71, 0xe1, + 0x00, 0x02, 0x00, 0x12, 0x68, 0x82, 0xff, 0xf0, + 0x71, 0xe1, 0x00, 0x03, 0x00, 0x12, 0x76, 0x82, + 0xff, 0xff, 0x71, 0xe1, 0x00, 0x04, 0x00, 0x12, + 0x76, 0x82, 0xff, 0xff, 0x71, 0xe1, 0x00, 0x02, + 0x00, 0x12, 0x69, 0x82, 0x00, 0x20, 0x71, 0xe1, + 0x00, 0x02, 0x00, 0x11, 0xf2, 0x73, 0x19, 0xda, + 0x68, 0x81, 0xff, 0xef, 0x77, 0x11, 0x00, 0x7b, + 0x10, 0x81, 0xfb, 0x80, 0x19, 0x97, 0xf0, 0x00, + 0x00, 0xb4, 0x77, 0x11, 0x00, 0x7b, 0x10, 0x81, + 0xfb, 0x80, 0x19, 0x97, 0xf0, 0x00, 0x00, 0xb9, + 0xf9, 0x80, 0x16, 0x9a, 0xee, 0x01, 0x8a, 0x11, + 0xf4, 0xe4, 0x00, 0xa4, 0x00, 0x00, 0x19, 0xdf, + 0x00, 0x01, 0x2a, 0xe6, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0xe7, 0x00, 0x00, 0x00, 0x03, 0x2a, 0x12, + 0x0c, 0x01, 0xc3, 0x4f, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0x15, 0x00, 0x00, 0x00, 0x02, 0x2a, 0x16, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x2a, 0x5d, + 0x00, 0x43, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x79, + 0x00, 0x72, 0x00, 0x69, 0x00, 0x67, 0x00, 0x68, + 0x00, 0x74, 0x00, 0x20, 0x00, 0x54, 0x00, 0x65, + 0x00, 0x63, 0x00, 0x68, 0x00, 0x6e, 0x00, 0x6f, + 0x00, 0x54, 0x00, 0x72, 0x00, 0x65, 0x00, 0x6e, + 0x00, 0x64, 0x00, 0x20, 0x00, 0x41, 0x00, 0x47, + 0x00, 0x00, 0x00, 0x04, 0x2a, 0x76, 0x00, 0x30, + 0x00, 0x2e, 0x00, 0x30, 0x00, 0x00, 0x00, 0x0c, + 0x2a, 0x7a, 0x00, 0x46, 0x00, 0x65, 0x00, 0x62, + 0x00, 0x20, 0x00, 0x32, 0x00, 0x37, 0x00, 0x20, + 0x00, 0x32, 0x00, 0x30, 0x00, 0x30, 0x00, 0x31, + 0x00, 0x00, 0x00, 0x09, 0x2a, 0x86, 0x00, 0x31, + 0x00, 0x34, 0x00, 0x3a, 0x00, 0x33, 0x00, 0x35, + 0x00, 0x3a, 0x00, 0x33, 0x00, 0x33, 0x00, 0x00, + 0x00, 0x0f, 0x2a, 0x8f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0x9e, 0x00, 0x00, + 0x00, 0x01, 0x2a, 0x9f, 0x00, 0x00, 0x00, 0x01, + 0x2a, 0xa0, 0x00, 0x00, 0x00, 0x01, 0x2a, 0xa1, + 0x00, 0x00, 0x00, 0x01, 0x2a, 0xa2, 0x00, 0x00, + 0x00, 0x01, 0x29, 0x7e, 0x00, 0x00, 0x00, 0x02, + 0x29, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x29, 0x82, 0xff, 0xff, 0x00, 0x01, 0x2a, 0xa7, + 0x00, 0x00, 0x00, 0x05, 0x2a, 0xa8, 0x71, 0x41, + 0x20, 0x00, 0x20, 0x00, 0x00, 0x23, 0x04, 0x00, + 0x00, 0x0a, 0x2a, 0xad, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0f, 0x2a, 0xb7, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x00, 0xa0, 0x82, 0x40, + 0x00, 0x08, 0x30, 0x7f, 0x00, 0x80, 0x01, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x27, 0x6e, 0x00, 0x00, + 0x00, 0x01, 0x27, 0x6f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x09, 0x00, 0x00, 0x1a, 0x83, 0x04, 0xe8, + 0x04, 0xcf, 0x04, 0xc5, 0x04, 0xba, 0x04, 0xb0, + 0x04, 0xac, 0x04, 0x9c, 0x04, 0x8c, 0x04, 0x81, + 0x00, 0x78, 0x00, 0x00, 0x01, 0x00, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xaa, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x02, 0x23, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x05, 0xe5, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x02, 0xb5, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x0e, 0x33, 0xf4, 0x95, 0xf4, 0x95, 0xf2, 0x73, + 0x07, 0xef, 0xf4, 0x95, 0xf4, 0x95, 0x00, 0x00, }; diff --git a/trunk/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/trunk/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 8abc21890129..832d179f26fa 100644 --- a/trunk/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/trunk/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -1203,7 +1203,7 @@ static int ttusb_init_rc(struct ttusb_dec *dec) input_dev->keycode = rc_keys; for (i = 0; i < ARRAY_SIZE(rc_keys); i++) - set_bit(rc_keys[i], input_dev->keybit); + set_bit(rc_keys[i], input_dev->keybit); input_register_device(input_dev); @@ -1529,7 +1529,7 @@ static void ttusb_dec_exit_rc(struct ttusb_dec *dec) usb_free_urb(dec->irq_urb); usb_buffer_free(dec->udev,IRQ_PACKET_SIZE, - dec->irq_buffer, dec->irq_dma_handle); + dec->irq_buffer, dec->irq_dma_handle); if (dec->rc_input_dev) { input_unregister_device(dec->rc_input_dev); diff --git a/trunk/drivers/media/video/Kconfig b/trunk/drivers/media/video/Kconfig index fc87efc5049c..199b01188858 100644 --- a/trunk/drivers/media/video/Kconfig +++ b/trunk/drivers/media/video/Kconfig @@ -26,12 +26,15 @@ config VIDEO_BT848 module will be called bttv. config VIDEO_BT848_DVB - bool "DVB/ATSC Support for bt878 based TV cards" + tristate "DVB/ATSC Support for bt878 based TV cards" depends on VIDEO_BT848 && DVB_CORE select DVB_BT8XX ---help--- This adds support for DVB/ATSC cards based on the BT878 chip. + To compile this driver as a module, choose M here: the + module will be called dvb-bt8xx. + config VIDEO_SAA6588 tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards" depends on VIDEO_DEV && I2C && VIDEO_BT848 @@ -188,7 +191,7 @@ config VIDEO_ZORAN To compile this driver as a module, choose M here: the module will be called zr36067. - + config VIDEO_ZORAN_BUZ tristate "Iomega Buz support" depends on VIDEO_ZORAN @@ -204,8 +207,8 @@ config VIDEO_ZORAN_DC10 config VIDEO_ZORAN_DC30 tristate "Pinnacle/Miro DC30(+) support" - depends on VIDEO_ZORAN - help + depends on VIDEO_ZORAN + help Support for the Pinnacle/Miro DC30(+) MJPEG capture/playback card. This also supports really old DC10 cards based on the zr36050 MJPEG codec and zr36016 VFE. @@ -260,7 +263,7 @@ config VIDEO_MXB ---help--- This is a video4linux driver for the 'Multimedia eXtension Board' TV card by Siemens-Nixdorf. - + To compile this driver as a module, choose M here: the module will be called mxb. @@ -274,7 +277,7 @@ config VIDEO_DPC for SAA7146 bases boards, so if you have some unsupported saa7146 based, analog video card, chances are good that it will work with this skeleton driver. - + To compile this driver as a module, choose M here: the module will be called dpc7146. @@ -285,7 +288,7 @@ config VIDEO_HEXIUM_ORION ---help--- This is a video4linux driver for the Hexium HV-PCI6 and Orion frame grabber cards by Hexium. - + To compile this driver as a module, choose M here: the module will be called hexium_orion. @@ -297,7 +300,7 @@ config VIDEO_HEXIUM_GEMINI This is a video4linux driver for the Hexium Gemini frame grabber card by Hexium. Please note that the Gemini Dual card is *not* fully supported. - + To compile this driver as a module, choose M here: the module will be called hexium_gemini. @@ -330,18 +333,4 @@ config VIDEO_M32R_AR_M64278 Say Y here to use the Renesas M64278E-800 camera module, which supports VGA(640x480 pixcels) size of images. -config VIDEO_AUDIO_DECODER - tristate "Add support for additional audio chipsets" - depends on VIDEO_DEV && I2C && EXPERIMENTAL - ---help--- - Say Y here to compile drivers for WM8775 and CS53L32A audio - decoders. - -config VIDEO_DECODER - tristate "Add support for additional video chipsets" - depends on VIDEO_DEV && I2C && EXPERIMENTAL - ---help--- - Say Y here to compile drivers for SAA7115, SAA7127 and CX25840 - video decoders. - endmenu diff --git a/trunk/drivers/media/video/Makefile b/trunk/drivers/media/video/Makefile index 82060f9909d8..3ac465992400 100644 --- a/trunk/drivers/media/video/Makefile +++ b/trunk/drivers/media/video/Makefile @@ -36,11 +36,10 @@ obj-$(CONFIG_VIDEO_CPIA) += cpia.o obj-$(CONFIG_VIDEO_CPIA_PP) += cpia_pp.o obj-$(CONFIG_VIDEO_CPIA_USB) += cpia_usb.o obj-$(CONFIG_VIDEO_MEYE) += meye.o -obj-$(CONFIG_VIDEO_SAA7134) += ir-kbd-i2c.o saa7134/ +obj-$(CONFIG_VIDEO_SAA7134) += saa7134/ obj-$(CONFIG_VIDEO_CX88) += cx88/ obj-$(CONFIG_VIDEO_EM28XX) += em28xx/ obj-$(CONFIG_VIDEO_EM28XX) += saa711x.o tvp5150.o -obj-$(CONFIG_VIDEO_AUDIO_DECODER) += wm8775.o cs53l32a.o obj-$(CONFIG_VIDEO_OVCAMCHIP) += ovcamchip/ obj-$(CONFIG_VIDEO_MXB) += saa7111.o tuner.o tda9840.o tea6415c.o tea6420.o mxb.o obj-$(CONFIG_VIDEO_HEXIUM_ORION) += hexium_orion.o @@ -56,6 +55,4 @@ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o obj-$(CONFIG_VIDEO_M32R_AR_M64278) += arv.o -obj-$(CONFIG_VIDEO_DECODER) += saa7115.o cx25840/ saa7127.o - EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core diff --git a/trunk/drivers/media/video/bt832.c b/trunk/drivers/media/video/bt832.c index 3ca1d768bfd3..e4063950ae57 100644 --- a/trunk/drivers/media/video/bt832.c +++ b/trunk/drivers/media/video/bt832.c @@ -231,18 +231,18 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "i2c bt832 driver", - .id = -1, /* FIXME */ - .flags = I2C_DF_NOTIFY, - .attach_adapter = bt832_probe, - .detach_client = bt832_detach, - .command = bt832_command, + .name = "i2c bt832 driver", + .id = -1, /* FIXME */ + .flags = I2C_DF_NOTIFY, + .attach_adapter = bt832_probe, + .detach_client = bt832_detach, + .command = bt832_command, }; static struct i2c_client client_template = { .name = "bt832", .flags = I2C_CLIENT_ALLOW_USE, - .driver = &driver, + .driver = &driver, }; diff --git a/trunk/drivers/media/video/bttv-cards.c b/trunk/drivers/media/video/bttv-cards.c index 012be639aa18..3413bace443a 100644 --- a/trunk/drivers/media/video/bttv-cards.c +++ b/trunk/drivers/media/video/bttv-cards.c @@ -2133,10 +2133,7 @@ struct tvcard bttv_tvcards[] = { .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .has_dvb = 1, - .has_remote = 1, - .gpiomask = 0x1b, .no_gpioirq = 1, - .any_irq = 1, }, [BTTV_BOARD_PV143] = { /* Jorge Boncompte - DTI2 */ @@ -2799,24 +2796,7 @@ struct tvcard bttv_tvcards[] = { .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, }, - /* ---- card 0x8e ---------------------------------- */ - [BTTV_BOARD_SABRENT_TVFM] = { - .name = "Sabrent TV-FM (bttv version)", - .video_inputs = 3, - .audio_inputs = 1, - .tuner = 0, - .svhs = 2, - .gpiomask = 0x108007, - .muxsel = { 2, 3, 1, 1}, - .audiomux = { 100000, 100002, 100002, 100000}, - .no_msp34xx = 1, - .no_tda9875 = 1, - .no_tda7432 = 1, - .pll = PLL_28, - .tuner_type = TUNER_TNF_5335MF, - .tuner_addr = ADDR_UNSET, - .has_radio = 1, - }, + }; static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards); @@ -2904,7 +2884,7 @@ void __devinit bttv_idcard(struct bttv *btv) */ /* Some Modular Technology cards have an eeprom, but no subsystem ID */ -static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]) +void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]) { int type = -1; @@ -3387,8 +3367,6 @@ void __devinit bttv_init_card2(struct bttv *btv) btv->has_remote=1; if (!bttv_tvcards[btv->c.type].no_gpioirq) btv->gpioirq=1; - if (bttv_tvcards[btv->c.type].any_irq) - btv->any_irq = 1; if (bttv_tvcards[btv->c.type].audio_hook) btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook; @@ -3879,7 +3857,7 @@ static void __devinit init_PXC200(struct bttv *btv) * error. ERROR_CPLD_Check_Failed. */ /* ----------------------------------------------------------------------- */ -static void +void init_RTV24 (struct bttv *btv) { uint32_t dataRead = 0; @@ -4103,7 +4081,7 @@ void tea5757_set_freq(struct bttv *btv, unsigned short freq) /* ----------------------------------------------------------------------- */ /* winview */ -static void winview_audio(struct bttv *btv, struct video_audio *v, int set) +void winview_audio(struct bttv *btv, struct video_audio *v, int set) { /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */ int bits_out, loops, vol, data; diff --git a/trunk/drivers/media/video/bttv-driver.c b/trunk/drivers/media/video/bttv-driver.c index 1ddf9ba613ef..0005741d5514 100644 --- a/trunk/drivers/media/video/bttv-driver.c +++ b/trunk/drivers/media/video/bttv-driver.c @@ -727,71 +727,71 @@ void free_btres(struct bttv *btv, struct bttv_fh *fh, int bits) static void set_pll_freq(struct bttv *btv, unsigned int fin, unsigned int fout) { - unsigned char fl, fh, fi; + unsigned char fl, fh, fi; - /* prevent overflows */ - fin/=4; - fout/=4; + /* prevent overflows */ + fin/=4; + fout/=4; - fout*=12; - fi=fout/fin; + fout*=12; + fi=fout/fin; - fout=(fout%fin)*256; - fh=fout/fin; + fout=(fout%fin)*256; + fh=fout/fin; - fout=(fout%fin)*256; - fl=fout/fin; + fout=(fout%fin)*256; + fl=fout/fin; - btwrite(fl, BT848_PLL_F_LO); - btwrite(fh, BT848_PLL_F_HI); - btwrite(fi|BT848_PLL_X, BT848_PLL_XCI); + btwrite(fl, BT848_PLL_F_LO); + btwrite(fh, BT848_PLL_F_HI); + btwrite(fi|BT848_PLL_X, BT848_PLL_XCI); } static void set_pll(struct bttv *btv) { - int i; + int i; - if (!btv->pll.pll_crystal) - return; + if (!btv->pll.pll_crystal) + return; if (btv->pll.pll_ofreq == btv->pll.pll_current) { dprintk("bttv%d: PLL: no change required\n",btv->c.nr); - return; - } + return; + } - if (btv->pll.pll_ifreq == btv->pll.pll_ofreq) { - /* no PLL needed */ - if (btv->pll.pll_current == 0) - return; + if (btv->pll.pll_ifreq == btv->pll.pll_ofreq) { + /* no PLL needed */ + if (btv->pll.pll_current == 0) + return; bttv_printk(KERN_INFO "bttv%d: PLL can sleep, using XTAL (%d).\n", - btv->c.nr,btv->pll.pll_ifreq); - btwrite(0x00,BT848_TGCTRL); - btwrite(0x00,BT848_PLL_XCI); - btv->pll.pll_current = 0; - return; - } + btv->c.nr,btv->pll.pll_ifreq); + btwrite(0x00,BT848_TGCTRL); + btwrite(0x00,BT848_PLL_XCI); + btv->pll.pll_current = 0; + return; + } bttv_printk(KERN_INFO "bttv%d: PLL: %d => %d ",btv->c.nr, - btv->pll.pll_ifreq, btv->pll.pll_ofreq); + btv->pll.pll_ifreq, btv->pll.pll_ofreq); set_pll_freq(btv, btv->pll.pll_ifreq, btv->pll.pll_ofreq); - for (i=0; i<10; i++) { + for (i=0; i<10; i++) { /* Let other people run while the PLL stabilizes */ bttv_printk("."); msleep(10); - if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) { + if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) { btwrite(0,BT848_DSTATUS); - } else { - btwrite(0x08,BT848_TGCTRL); - btv->pll.pll_current = btv->pll.pll_ofreq; + } else { + btwrite(0x08,BT848_TGCTRL); + btv->pll.pll_current = btv->pll.pll_ofreq; bttv_printk(" ok\n"); - return; - } - } - btv->pll.pll_current = -1; + return; + } + } + btv->pll.pll_current = -1; bttv_printk("failed\n"); - return; + return; } /* used to switch between the bt848's analog/digital video capture modes */ @@ -1720,7 +1720,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) memset(i,0,sizeof(*i)); i->index = n; i->type = V4L2_INPUT_TYPE_CAMERA; - i->audioset = 0; + i->audioset = 1; if (i->index == bttv_tvcards[btv->c.type].tuner) { sprintf(i->name, "Television"); i->type = V4L2_INPUT_TYPE_TUNER; @@ -1771,19 +1771,11 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) memset(t,0,sizeof(*t)); strcpy(t->name, "Television"); t->type = V4L2_TUNER_ANALOG_TV; + t->rangehigh = 0xffffffffUL; t->capability = V4L2_TUNER_CAP_NORM; t->rxsubchans = V4L2_TUNER_SUB_MONO; if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC) t->signal = 0xffff; - { - struct video_tuner tuner; - - memset(&tuner, 0, sizeof (tuner)); - tuner.rangehigh = 0xffffffffUL; - bttv_call_i2c_clients(btv, VIDIOCGTUNER, &tuner); - t->rangelow = tuner.rangelow; - t->rangehigh = tuner.rangehigh; - } { /* Hmmm ... */ struct video_audio va; @@ -1861,7 +1853,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) } case VIDIOC_LOG_STATUS: { - bttv_call_i2c_clients(btv, VIDIOC_LOG_STATUS, NULL); + bttv_call_i2c_clients(btv, VIDIOC_LOG_STATUS, 0); return 0; } @@ -1964,7 +1956,7 @@ static int setup_window(struct bttv_fh *fh, struct bttv *btv, } down(&fh->cap.lock); - kfree(fh->ov.clips); + kfree(fh->ov.clips); fh->ov.clips = clips; fh->ov.nclips = n; @@ -2037,33 +2029,19 @@ static int bttv_switch_type(struct bttv_fh *fh, enum v4l2_buf_type type) return 0; } -static void -pix_format_set_size (struct v4l2_pix_format * f, - const struct bttv_format * fmt, - unsigned int width, - unsigned int height) -{ - f->width = width; - f->height = height; - - if (fmt->flags & FORMAT_FLAGS_PLANAR) { - f->bytesperline = width; /* Y plane */ - f->sizeimage = (width * height * fmt->depth) >> 3; - } else { - f->bytesperline = (width * fmt->depth) >> 3; - f->sizeimage = height * f->bytesperline; - } -} - static int bttv_g_fmt(struct bttv_fh *fh, struct v4l2_format *f) { switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: memset(&f->fmt.pix,0,sizeof(struct v4l2_pix_format)); - pix_format_set_size (&f->fmt.pix, fh->fmt, - fh->width, fh->height); + f->fmt.pix.width = fh->width; + f->fmt.pix.height = fh->height; f->fmt.pix.field = fh->cap.field; f->fmt.pix.pixelformat = fh->fmt->fourcc; + f->fmt.pix.bytesperline = + (f->fmt.pix.width * fh->fmt->depth) >> 3; + f->fmt.pix.sizeimage = + f->fmt.pix.height * f->fmt.pix.bytesperline; return 0; case V4L2_BUF_TYPE_VIDEO_OVERLAY: memset(&f->fmt.win,0,sizeof(struct v4l2_window)); @@ -2128,9 +2106,11 @@ static int bttv_try_fmt(struct bttv_fh *fh, struct bttv *btv, f->fmt.pix.width = maxw; if (f->fmt.pix.height > maxh) f->fmt.pix.height = maxh; - pix_format_set_size (&f->fmt.pix, fmt, - f->fmt.pix.width & ~3, - f->fmt.pix.height); + f->fmt.pix.width &= ~0x03; + f->fmt.pix.bytesperline = + (f->fmt.pix.width * fmt->depth) >> 3; + f->fmt.pix.sizeimage = + f->fmt.pix.height * f->fmt.pix.bytesperline; return 0; } @@ -2298,15 +2278,6 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, retval = -EINVAL; goto fh_unlock_and_return; } - if (fmt->flags & FORMAT_FLAGS_RAW) { - /* VIDIOCMCAPTURE uses gbufsize, not RAW_BPL * - RAW_LINES * 2. F1 is stored at offset 0, F2 - at buffer size / 2. */ - fh->width = RAW_BPL; - fh->height = gbufsize / RAW_BPL; - btv->init.width = RAW_BPL; - btv->init.height = gbufsize / RAW_BPL; - } fh->ovfmt = fmt; fh->fmt = fmt; btv->init.ovfmt = fmt; @@ -2618,11 +2589,9 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, if (0 == v4l2) return -EINVAL; - memset(cap, 0, sizeof (*cap)); - strlcpy(cap->driver, "bttv", sizeof (cap->driver)); - strlcpy(cap->card, btv->video_dev->name, sizeof (cap->card)); - snprintf(cap->bus_info, sizeof (cap->bus_info), - "PCI:%s", pci_name(btv->c.pci)); + strcpy(cap->driver,"bttv"); + strlcpy(cap->card,btv->video_dev->name,sizeof(cap->card)); + sprintf(cap->bus_info,"PCI:%s",pci_name(btv->c.pci)); cap->version = BTTV_VERSION_CODE; cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | @@ -2758,7 +2727,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, fh->ov.w.height = fb->fmt.height; btv->init.ov.w.width = fb->fmt.width; btv->init.ov.w.height = fb->fmt.height; - kfree(fh->ov.clips); + kfree(fh->ov.clips); fh->ov.clips = NULL; fh->ov.nclips = 0; @@ -2983,8 +2952,6 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait) fh->cap.read_buf->memory = V4L2_MEMORY_USERPTR; field = videobuf_next_field(&fh->cap); if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,field)) { - kfree (fh->cap.read_buf); - fh->cap.read_buf = NULL; up(&fh->cap.lock); return POLLERR; } @@ -3700,10 +3667,6 @@ static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs) int handled = 0; btv=(struct bttv *)dev_id; - - if (btv->any_irq) - handled = bttv_any_irq(&btv->c); - count=0; while (1) { /* get/clear interrupt status bits */ diff --git a/trunk/drivers/media/video/bttv-gpio.c b/trunk/drivers/media/video/bttv-gpio.c index 616a5b7e510c..575ce8b8e714 100644 --- a/trunk/drivers/media/video/bttv-gpio.c +++ b/trunk/drivers/media/video/bttv-gpio.c @@ -113,24 +113,6 @@ void bttv_gpio_irq(struct bttv_core *core) } } -int bttv_any_irq(struct bttv_core *core) -{ - struct bttv_sub_driver *drv; - struct bttv_sub_device *dev; - struct list_head *item; - int handled = 0; - - list_for_each(item,&core->subs) { - dev = list_entry(item,struct bttv_sub_device,list); - drv = to_bttv_sub_drv(dev->dev.driver); - if (drv && drv->any_irq) { - if (drv->any_irq(dev)) - handled = 1; - } - } - return handled; -} - /* ----------------------------------------------------------------------- */ /* external: sub-driver register/unregister */ diff --git a/trunk/drivers/media/video/bttv.h b/trunk/drivers/media/video/bttv.h index 93298f06e019..124ea41dada4 100644 --- a/trunk/drivers/media/video/bttv.h +++ b/trunk/drivers/media/video/bttv.h @@ -162,7 +162,6 @@ #define BTTV_BOARD_PV_M4900 0x8b #define BTTV_BOARD_OSPREY440 0x8c #define BTTV_BOARD_ASOUND_SKYEYE 0x8d -#define BTTV_BOARD_SABRENT_TVFM 0x8e /* i2c address list */ #define I2C_TSA5522 0xc2 @@ -235,7 +234,6 @@ struct tvcard unsigned int has_dvb:1; unsigned int has_remote:1; unsigned int no_gpioirq:1; - unsigned int any_irq:1; /* other settings */ unsigned int pll; @@ -335,7 +333,6 @@ struct bttv_sub_driver { struct device_driver drv; char wanted[BUS_ID_SIZE]; void (*gpio_irq)(struct bttv_sub_device *sub); - int (*any_irq)(struct bttv_sub_device *sub); }; #define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv) diff --git a/trunk/drivers/media/video/bttvp.h b/trunk/drivers/media/video/bttvp.h index 1e6a5632c3c7..386f546f7d11 100644 --- a/trunk/drivers/media/video/bttvp.h +++ b/trunk/drivers/media/video/bttvp.h @@ -45,7 +45,6 @@ #include #include - #include "bt848.h" #include "bttv.h" #include "btcx-risc.h" @@ -209,7 +208,6 @@ extern struct bus_type bttv_sub_bus_type; int bttv_sub_add_device(struct bttv_core *core, char *name); int bttv_sub_del_devices(struct bttv_core *core); void bttv_gpio_irq(struct bttv_core *core); -int bttv_any_irq(struct bttv_core *core); /* ---------------------------------------------------------- */ @@ -275,7 +273,6 @@ struct bttv { struct bttv_pll_info pll; int triton1; int gpioirq; - int any_irq; int use_i2c_hw; /* old gpio interface */ diff --git a/trunk/drivers/media/video/cpia_usb.c b/trunk/drivers/media/video/cpia_usb.c index 1439cb752874..9774e94d1e7d 100644 --- a/trunk/drivers/media/video/cpia_usb.c +++ b/trunk/drivers/media/video/cpia_usb.c @@ -582,6 +582,7 @@ MODULE_LICENSE("GPL"); static struct usb_driver cpia_driver = { + .owner = THIS_MODULE, .name = "cpia", .probe = cpia_probe, .disconnect = cpia_disconnect, diff --git a/trunk/drivers/media/video/cx25840/Makefile b/trunk/drivers/media/video/cx25840/Makefile deleted file mode 100644 index 543ebacdc9d7..000000000000 --- a/trunk/drivers/media/video/cx25840/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -cx25840-objs := cx25840-core.o cx25840-audio.o cx25840-firmware.o \ - cx25840-vbi.o - -obj-$(CONFIG_VIDEO_DECODER) += cx25840.o - -EXTRA_CFLAGS += -I$(src)/.. diff --git a/trunk/drivers/media/video/cx25840/cx25840-audio.c b/trunk/drivers/media/video/cx25840/cx25840-audio.c deleted file mode 100644 index 740908f8027d..000000000000 --- a/trunk/drivers/media/video/cx25840/cx25840-audio.c +++ /dev/null @@ -1,368 +0,0 @@ -/* cx25840 audio functions - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - - -#include -#include -#include -#include - -#include "cx25840.h" - -inline static int set_audclk_freq(struct i2c_client *client, - enum v4l2_audio_clock_freq freq) -{ - struct cx25840_state *state = i2c_get_clientdata(client); - - /* assert soft reset */ - cx25840_and_or(client, 0x810, ~0x1, 0x01); - - /* common for all inputs and rates */ - /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */ - cx25840_write(client, 0x127, 0x50); - - switch (state->audio_input) { - case AUDIO_TUNER: - switch (freq) { - case V4L2_AUDCLK_32_KHZ: - /* VID_PLL and AUX_PLL */ - cx25840_write4(client, 0x108, 0x0f040610); - - /* AUX_PLL_FRAC */ - cx25840_write4(client, 0x110, 0xee39bb01); - - /* src3/4/6_ctl = 0x0801f77f */ - cx25840_write4(client, 0x900, 0x7ff70108); - cx25840_write4(client, 0x904, 0x7ff70108); - cx25840_write4(client, 0x90c, 0x7ff70108); - break; - - case V4L2_AUDCLK_441_KHZ: - /* VID_PLL and AUX_PLL */ - cx25840_write4(client, 0x108, 0x0f040910); - - /* AUX_PLL_FRAC */ - cx25840_write4(client, 0x110, 0xd66bec00); - - /* src3/4/6_ctl = 0x08016d59 */ - cx25840_write4(client, 0x900, 0x596d0108); - cx25840_write4(client, 0x904, 0x596d0108); - cx25840_write4(client, 0x90c, 0x596d0108); - break; - - case V4L2_AUDCLK_48_KHZ: - /* VID_PLL and AUX_PLL */ - cx25840_write4(client, 0x108, 0x0f040a10); - - /* AUX_PLL_FRAC */ - cx25840_write4(client, 0x110, 0xe5d69800); - - /* src3/4/6_ctl = 0x08014faa */ - cx25840_write4(client, 0x900, 0xaa4f0108); - cx25840_write4(client, 0x904, 0xaa4f0108); - cx25840_write4(client, 0x90c, 0xaa4f0108); - break; - } - break; - - case AUDIO_EXTERN_1: - case AUDIO_EXTERN_2: - case AUDIO_INTERN: - case AUDIO_RADIO: - switch (freq) { - case V4L2_AUDCLK_32_KHZ: - /* VID_PLL and AUX_PLL */ - cx25840_write4(client, 0x108, 0x0f04081e); - - /* AUX_PLL_FRAC */ - cx25840_write4(client, 0x110, 0x69082a01); - - /* src1_ctl = 0x08010000 */ - cx25840_write4(client, 0x8f8, 0x00000108); - - /* src3/4/6_ctl = 0x08020000 */ - cx25840_write4(client, 0x900, 0x00000208); - cx25840_write4(client, 0x904, 0x00000208); - cx25840_write4(client, 0x90c, 0x00000208); - - /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x14 */ - cx25840_write(client, 0x127, 0x54); - break; - - case V4L2_AUDCLK_441_KHZ: - /* VID_PLL and AUX_PLL */ - cx25840_write4(client, 0x108, 0x0f040918); - - /* AUX_PLL_FRAC */ - cx25840_write4(client, 0x110, 0xd66bec00); - - /* src1_ctl = 0x08010000 */ - cx25840_write4(client, 0x8f8, 0xcd600108); - - /* src3/4/6_ctl = 0x08020000 */ - cx25840_write4(client, 0x900, 0x85730108); - cx25840_write4(client, 0x904, 0x85730108); - cx25840_write4(client, 0x90c, 0x85730108); - break; - - case V4L2_AUDCLK_48_KHZ: - /* VID_PLL and AUX_PLL */ - cx25840_write4(client, 0x108, 0x0f040a18); - - /* AUX_PLL_FRAC */ - cx25840_write4(client, 0x110, 0xe5d69800); - - /* src1_ctl = 0x08010000 */ - cx25840_write4(client, 0x8f8, 0x00800108); - - /* src3/4/6_ctl = 0x08020000 */ - cx25840_write4(client, 0x900, 0x55550108); - cx25840_write4(client, 0x904, 0x55550108); - cx25840_write4(client, 0x90c, 0x55550108); - break; - } - break; - } - - /* deassert soft reset */ - cx25840_and_or(client, 0x810, ~0x1, 0x00); - - state->audclk_freq = freq; - - return 0; -} - -static int set_input(struct i2c_client *client, int audio_input) -{ - struct cx25840_state *state = i2c_get_clientdata(client); - - cx25840_dbg("set audio input (%d)\n", audio_input); - - /* stop microcontroller */ - cx25840_and_or(client, 0x803, ~0x10, 0); - - /* Mute everything to prevent the PFFT! */ - cx25840_write(client, 0x8d3, 0x1f); - - switch (audio_input) { - case AUDIO_TUNER: - /* Set Path1 to Analog Demod Main Channel */ - cx25840_write4(client, 0x8d0, 0x7038061f); - - /* When the microcontroller detects the - * audio format, it will unmute the lines */ - cx25840_and_or(client, 0x803, ~0x10, 0x10); - break; - - case AUDIO_EXTERN_1: - case AUDIO_EXTERN_2: - case AUDIO_INTERN: - case AUDIO_RADIO: - /* Set Path1 to Serial Audio Input */ - cx25840_write4(client, 0x8d0, 0x12100101); - - /* The microcontroller should not be started for the - * non-tuner inputs: autodetection is specific for - * TV audio. */ - break; - - default: - cx25840_dbg("Invalid audio input selection %d\n", audio_input); - return -EINVAL; - } - - state->audio_input = audio_input; - - return set_audclk_freq(client, state->audclk_freq); -} - -inline static int get_volume(struct i2c_client *client) -{ - /* Volume runs +18dB to -96dB in 1/2dB steps - * change to fit the msp3400 -114dB to +12dB range */ - - /* check PATH1_VOLUME */ - int vol = 228 - cx25840_read(client, 0x8d4); - vol = (vol / 2) + 23; - return vol << 9; -} - -inline static void set_volume(struct i2c_client *client, int volume) -{ - /* First convert the volume to msp3400 values (0-127) */ - int vol = volume >> 9; - /* now scale it up to cx25840 values - * -114dB to -96dB maps to 0 - * this should be 19, but in my testing that was 4dB too loud */ - if (vol <= 23) { - vol = 0; - } else { - vol -= 23; - } - - /* PATH1_VOLUME */ - cx25840_write(client, 0x8d4, 228 - (vol * 2)); -} - -inline static int get_bass(struct i2c_client *client) -{ - /* bass is 49 steps +12dB to -12dB */ - - /* check PATH1_EQ_BASS_VOL */ - int bass = cx25840_read(client, 0x8d9) & 0x3f; - bass = (((48 - bass) * 0xffff) + 47) / 48; - return bass; -} - -inline static void set_bass(struct i2c_client *client, int bass) -{ - /* PATH1_EQ_BASS_VOL */ - cx25840_and_or(client, 0x8d9, ~0x3f, 48 - (bass * 48 / 0xffff)); -} - -inline static int get_treble(struct i2c_client *client) -{ - /* treble is 49 steps +12dB to -12dB */ - - /* check PATH1_EQ_TREBLE_VOL */ - int treble = cx25840_read(client, 0x8db) & 0x3f; - treble = (((48 - treble) * 0xffff) + 47) / 48; - return treble; -} - -inline static void set_treble(struct i2c_client *client, int treble) -{ - /* PATH1_EQ_TREBLE_VOL */ - cx25840_and_or(client, 0x8db, ~0x3f, 48 - (treble * 48 / 0xffff)); -} - -inline static int get_balance(struct i2c_client *client) -{ - /* balance is 7 bit, 0 to -96dB */ - - /* check PATH1_BAL_LEVEL */ - int balance = cx25840_read(client, 0x8d5) & 0x7f; - /* check PATH1_BAL_LEFT */ - if ((cx25840_read(client, 0x8d5) & 0x80) == 0) - balance = 0x80 - balance; - else - balance = 0x80 + balance; - return balance << 8; -} - -inline static void set_balance(struct i2c_client *client, int balance) -{ - int bal = balance >> 8; - if (bal > 0x80) { - /* PATH1_BAL_LEFT */ - cx25840_and_or(client, 0x8d5, 0x7f, 0x80); - /* PATH1_BAL_LEVEL */ - cx25840_and_or(client, 0x8d5, ~0x7f, bal & 0x7f); - } else { - /* PATH1_BAL_LEFT */ - cx25840_and_or(client, 0x8d5, 0x7f, 0x00); - /* PATH1_BAL_LEVEL */ - cx25840_and_or(client, 0x8d5, ~0x7f, 0x80 - bal); - } -} - -inline static int get_mute(struct i2c_client *client) -{ - /* check SRC1_MUTE_EN */ - return cx25840_read(client, 0x8d3) & 0x2 ? 1 : 0; -} - -inline static void set_mute(struct i2c_client *client, int mute) -{ - struct cx25840_state *state = i2c_get_clientdata(client); - - if (state->audio_input == AUDIO_TUNER) { - /* Must turn off microcontroller in order to mute sound. - * Not sure if this is the best method, but it does work. - * If the microcontroller is running, then it will undo any - * changes to the mute register. */ - if (mute) { - /* disable microcontroller */ - cx25840_and_or(client, 0x803, ~0x10, 0x00); - cx25840_write(client, 0x8d3, 0x1f); - } else { - /* enable microcontroller */ - cx25840_and_or(client, 0x803, ~0x10, 0x10); - } - } else { - /* SRC1_MUTE_EN */ - cx25840_and_or(client, 0x8d3, ~0x2, mute ? 0x02 : 0x00); - } -} - -int cx25840_audio(struct i2c_client *client, unsigned int cmd, void *arg) -{ - struct v4l2_control *ctrl = arg; - - switch (cmd) { - case AUDC_SET_INPUT: - return set_input(client, *(int *)arg); - case VIDIOC_INT_AUDIO_CLOCK_FREQ: - return set_audclk_freq(client, *(enum v4l2_audio_clock_freq *)arg); - case VIDIOC_G_CTRL: - switch (ctrl->id) { - case V4L2_CID_AUDIO_VOLUME: - ctrl->value = get_volume(client); - break; - case V4L2_CID_AUDIO_BASS: - ctrl->value = get_bass(client); - break; - case V4L2_CID_AUDIO_TREBLE: - ctrl->value = get_treble(client); - break; - case V4L2_CID_AUDIO_BALANCE: - ctrl->value = get_balance(client); - break; - case V4L2_CID_AUDIO_MUTE: - ctrl->value = get_mute(client); - break; - default: - return -EINVAL; - } - break; - case VIDIOC_S_CTRL: - switch (ctrl->id) { - case V4L2_CID_AUDIO_VOLUME: - set_volume(client, ctrl->value); - break; - case V4L2_CID_AUDIO_BASS: - set_bass(client, ctrl->value); - break; - case V4L2_CID_AUDIO_TREBLE: - set_treble(client, ctrl->value); - break; - case V4L2_CID_AUDIO_BALANCE: - set_balance(client, ctrl->value); - break; - case V4L2_CID_AUDIO_MUTE: - set_mute(client, ctrl->value); - break; - default: - return -EINVAL; - } - break; - default: - return -EINVAL; - } - - return 0; -} diff --git a/trunk/drivers/media/video/cx25840/cx25840-core.c b/trunk/drivers/media/video/cx25840/cx25840-core.c deleted file mode 100644 index 5b93723a1768..000000000000 --- a/trunk/drivers/media/video/cx25840/cx25840-core.c +++ /dev/null @@ -1,1056 +0,0 @@ -/* cx25840 - Conexant CX25840 audio/video decoder driver - * - * Copyright (C) 2004 Ulf Eklund - * - * Based on the saa7115 driver and on the first verison of Chris Kennedy's - * cx25840 driver. - * - * Changes by Tyler Trafford - * - cleanup/rewrite for V4L2 API (2005) - * - * VBI support by Hans Verkuil . - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - - -#include -#include -#include -#include -#include -#include -#include - -#include "cx25840.h" - -MODULE_DESCRIPTION("Conexant CX25840 audio/video decoder driver"); -MODULE_AUTHOR("Ulf Eklund, Chris Kennedy, Hans Verkuil, Tyler Trafford"); -MODULE_LICENSE("GPL"); - -static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END }; - - -int cx25840_debug = 0; - -module_param(cx25840_debug, bool, 0644); - -MODULE_PARM_DESC(cx25840_debug, "Debugging messages [0=Off (default) 1=On]"); - -I2C_CLIENT_INSMOD; - -/* ----------------------------------------------------------------------- */ - -int cx25840_write(struct i2c_client *client, u16 addr, u8 value) -{ - u8 buffer[3]; - buffer[0] = addr >> 8; - buffer[1] = addr & 0xff; - buffer[2] = value; - return i2c_master_send(client, buffer, 3); -} - -int cx25840_write4(struct i2c_client *client, u16 addr, u32 value) -{ - u8 buffer[6]; - buffer[0] = addr >> 8; - buffer[1] = addr & 0xff; - buffer[2] = value >> 24; - buffer[3] = (value >> 16) & 0xff; - buffer[4] = (value >> 8) & 0xff; - buffer[5] = value & 0xff; - return i2c_master_send(client, buffer, 6); -} - -u8 cx25840_read(struct i2c_client * client, u16 addr) -{ - u8 buffer[2]; - buffer[0] = addr >> 8; - buffer[1] = addr & 0xff; - - if (i2c_master_send(client, buffer, 2) < 2) - return 0; - - if (i2c_master_recv(client, buffer, 1) < 1) - return 0; - - return buffer[0]; -} - -u32 cx25840_read4(struct i2c_client * client, u16 addr) -{ - u8 buffer[4]; - buffer[0] = addr >> 8; - buffer[1] = addr & 0xff; - - if (i2c_master_send(client, buffer, 2) < 2) - return 0; - - if (i2c_master_recv(client, buffer, 4) < 4) - return 0; - - return (buffer[0] << 24) | (buffer[1] << 16) | - (buffer[2] << 8) | buffer[3]; -} - -int cx25840_and_or(struct i2c_client *client, u16 addr, u8 and_mask, - u8 or_value) -{ - return cx25840_write(client, addr, - (cx25840_read(client, addr) & and_mask) | - or_value); -} - -/* ----------------------------------------------------------------------- */ - -static int set_input(struct i2c_client *, enum cx25840_input); -static void input_change(struct i2c_client *); -static void log_status(struct i2c_client *client); - -/* ----------------------------------------------------------------------- */ - -static inline void init_dll1(struct i2c_client *client) -{ - /* This is the Hauppauge sequence used to - * initialize the Delay Lock Loop 1 (ADC DLL). */ - cx25840_write(client, 0x159, 0x23); - cx25840_write(client, 0x15a, 0x87); - cx25840_write(client, 0x15b, 0x06); - cx25840_write(client, 0x159, 0xe1); - cx25840_write(client, 0x15a, 0x86); - cx25840_write(client, 0x159, 0xe0); - cx25840_write(client, 0x159, 0xe1); - cx25840_write(client, 0x15b, 0x10); -} - -static inline void init_dll2(struct i2c_client *client) -{ - /* This is the Hauppauge sequence used to - * initialize the Delay Lock Loop 2 (ADC DLL). */ - cx25840_write(client, 0x15d, 0xe3); - cx25840_write(client, 0x15e, 0x86); - cx25840_write(client, 0x15f, 0x06); - cx25840_write(client, 0x15d, 0xe1); - cx25840_write(client, 0x15d, 0xe0); - cx25840_write(client, 0x15d, 0xe1); -} - -static void cx25840_initialize(struct i2c_client *client, int loadfw) -{ - struct cx25840_state *state = i2c_get_clientdata(client); - - /* datasheet startup in numbered steps, refer to page 3-77 */ - /* 2. */ - cx25840_and_or(client, 0x803, ~0x10, 0x00); - /* The default of this register should be 4, but I get 0 instead. - * Set this register to 4 manually. */ - cx25840_write(client, 0x000, 0x04); - /* 3. */ - init_dll1(client); - init_dll2(client); - cx25840_write(client, 0x136, 0x0a); - /* 4. */ - cx25840_write(client, 0x13c, 0x01); - cx25840_write(client, 0x13c, 0x00); - /* 5. */ - if (loadfw) - cx25840_loadfw(client); - /* 6. */ - cx25840_write(client, 0x115, 0x8c); - cx25840_write(client, 0x116, 0x07); - cx25840_write(client, 0x118, 0x02); - /* 7. */ - cx25840_write(client, 0x4a5, 0x80); - cx25840_write(client, 0x4a5, 0x00); - cx25840_write(client, 0x402, 0x00); - /* 8. */ - cx25840_write(client, 0x401, 0x18); - cx25840_write(client, 0x4a2, 0x10); - cx25840_write(client, 0x402, 0x04); - /* 10. */ - cx25840_write(client, 0x8d3, 0x1f); - cx25840_write(client, 0x8e3, 0x03); - - cx25840_vbi_setup(client); - - /* trial and error says these are needed to get audio */ - cx25840_write(client, 0x914, 0xa0); - cx25840_write(client, 0x918, 0xa0); - cx25840_write(client, 0x919, 0x01); - - /* stereo prefered */ - cx25840_write(client, 0x809, 0x04); - /* AC97 shift */ - cx25840_write(client, 0x8cf, 0x0f); - - /* (re)set video input */ - set_input(client, state->input); - /* (re)set audio input */ - cx25840_audio(client, AUDC_SET_INPUT, &state->audio_input); - - /* start microcontroller */ - cx25840_and_or(client, 0x803, ~0x10, 0x10); -} - -/* ----------------------------------------------------------------------- */ - -static void input_change(struct i2c_client *client) -{ - struct cx25840_state *state = i2c_get_clientdata(client); - v4l2_std_id std = cx25840_get_v4lstd(client); - - /* Note: perhaps V4L2_STD_PAL_M should be handled as V4L2_STD_NTSC - instead of V4L2_STD_PAL. Someone needs to test this. */ - if (std & V4L2_STD_PAL) { - /* Follow tuner change procedure for PAL */ - cx25840_write(client, 0x808, 0xff); - cx25840_write(client, 0x80b, 0x10); - } else if (std & V4L2_STD_SECAM) { - /* Select autodetect for SECAM */ - cx25840_write(client, 0x808, 0xff); - cx25840_write(client, 0x80b, 0x10); - } else if (std & V4L2_STD_NTSC) { - /* NTSC */ - if (state->cardtype == CARDTYPE_PVR150_WORKAROUND) { - /* Certain Hauppauge PVR150 models have a hardware bug - that causes audio to drop out. For these models the - audio standard must be set explicitly. - To be precise: it affects cards with tuner models - 85, 99 and 112 (model numbers from tveeprom). */ - if (std == V4L2_STD_NTSC_M_JP) { - /* Japan uses EIAJ audio standard */ - cx25840_write(client, 0x808, 0x2f); - } else { - /* Others use the BTSC audio standard */ - cx25840_write(client, 0x808, 0x1f); - } - /* South Korea uses the A2-M (aka Zweiton M) audio - standard, and should set 0x808 to 0x3f, but I don't - know how to detect this. */ - } else if (std == V4L2_STD_NTSC_M_JP) { - /* Japan uses EIAJ audio standard */ - cx25840_write(client, 0x808, 0xf7); - } else { - /* Others use the BTSC audio standard */ - cx25840_write(client, 0x808, 0xf6); - } - /* South Korea uses the A2-M (aka Zweiton M) audio standard, - and should set 0x808 to 0xf8, but I don't know how to - detect this. */ - cx25840_write(client, 0x80b, 0x00); - } - - if (cx25840_read(client, 0x803) & 0x10) { - /* restart audio decoder microcontroller */ - cx25840_and_or(client, 0x803, ~0x10, 0x00); - cx25840_and_or(client, 0x803, ~0x10, 0x10); - } -} - -static int set_input(struct i2c_client *client, enum cx25840_input input) -{ - struct cx25840_state *state = i2c_get_clientdata(client); - - cx25840_dbg("decoder set input (%d)\n", input); - - switch (input) { - case CX25840_TUNER: - cx25840_dbg("now setting Tuner input\n"); - - if (state->cardtype == CARDTYPE_PVR150 || - state->cardtype == CARDTYPE_PVR150_WORKAROUND) { - /* CH_SEL_ADC2=1 */ - cx25840_and_or(client, 0x102, ~0x2, 0x02); - } - - /* Video Input Control */ - if (state->cardtype == CARDTYPE_PG600) { - cx25840_write(client, 0x103, 0x11); - } else { - cx25840_write(client, 0x103, 0x46); - } - - /* INPUT_MODE=0 */ - cx25840_and_or(client, 0x401, ~0x6, 0x00); - break; - - case CX25840_COMPOSITE0: - case CX25840_COMPOSITE1: - cx25840_dbg("now setting Composite input\n"); - - /* Video Input Control */ - if (state->cardtype == CARDTYPE_PG600) { - cx25840_write(client, 0x103, 0x00); - } else { - cx25840_write(client, 0x103, 0x02); - } - - /* INPUT_MODE=0 */ - cx25840_and_or(client, 0x401, ~0x6, 0x00); - break; - - case CX25840_SVIDEO0: - case CX25840_SVIDEO1: - cx25840_dbg("now setting S-Video input\n"); - - /* CH_SEL_ADC2=0 */ - cx25840_and_or(client, 0x102, ~0x2, 0x00); - - /* Video Input Control */ - if (state->cardtype == CARDTYPE_PG600) { - cx25840_write(client, 0x103, 0x02); - } else { - cx25840_write(client, 0x103, 0x10); - } - - /* INPUT_MODE=1 */ - cx25840_and_or(client, 0x401, ~0x6, 0x02); - break; - - default: - cx25840_err("%d is not a valid input!\n", input); - return -EINVAL; - } - - state->input = input; - input_change(client); - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int set_v4lstd(struct i2c_client *client, v4l2_std_id std) -{ - u8 fmt=0; /* zero is autodetect */ - - /* First tests should be against specific std */ - if (std & V4L2_STD_NTSC_M_JP) { - fmt=0x2; - } else if (std & V4L2_STD_NTSC_443) { - fmt=0x3; - } else if (std & V4L2_STD_PAL_M) { - fmt=0x5; - } else if (std & V4L2_STD_PAL_N) { - fmt=0x6; - } else if (std & V4L2_STD_PAL_Nc) { - fmt=0x7; - } else if (std & V4L2_STD_PAL_60) { - fmt=0x8; - } else { - /* Then, test against generic ones */ - if (std & V4L2_STD_NTSC) { - fmt=0x1; - } else if (std & V4L2_STD_PAL) { - fmt=0x4; - } else if (std & V4L2_STD_SECAM) { - fmt=0xc; - } - } - - cx25840_and_or(client, 0x400, ~0xf, fmt); - cx25840_vbi_setup(client); - return 0; -} - -v4l2_std_id cx25840_get_v4lstd(struct i2c_client * client) -{ - /* check VID_FMT_SEL first */ - u8 fmt = cx25840_read(client, 0x400) & 0xf; - - if (!fmt) { - /* check AFD_FMT_STAT if set to autodetect */ - fmt = cx25840_read(client, 0x40d) & 0xf; - } - - switch (fmt) { - case 0x1: return V4L2_STD_NTSC_M; - case 0x2: return V4L2_STD_NTSC_M_JP; - case 0x3: return V4L2_STD_NTSC_443; - case 0x4: return V4L2_STD_PAL; - case 0x5: return V4L2_STD_PAL_M; - case 0x6: return V4L2_STD_PAL_N; - case 0x7: return V4L2_STD_PAL_Nc; - case 0x8: return V4L2_STD_PAL_60; - case 0xc: return V4L2_STD_SECAM; - default: return V4L2_STD_UNKNOWN; - } -} - -/* ----------------------------------------------------------------------- */ - -static int set_v4lctrl(struct i2c_client *client, struct v4l2_control *ctrl) -{ - struct cx25840_state *state = i2c_get_clientdata(client); - - switch (ctrl->id) { - case CX25840_CID_CARDTYPE: - switch (ctrl->value) { - case CARDTYPE_PVR150: - case CARDTYPE_PVR150_WORKAROUND: - case CARDTYPE_PG600: - state->cardtype = ctrl->value; - break; - default: - return -ERANGE; - } - - set_input(client, state->input); - break; - - case V4L2_CID_BRIGHTNESS: - if (ctrl->value < 0 || ctrl->value > 255) { - cx25840_err("invalid brightness setting %d\n", - ctrl->value); - return -ERANGE; - } - - cx25840_write(client, 0x414, ctrl->value - 128); - break; - - case V4L2_CID_CONTRAST: - if (ctrl->value < 0 || ctrl->value > 127) { - cx25840_err("invalid contrast setting %d\n", - ctrl->value); - return -ERANGE; - } - - cx25840_write(client, 0x415, ctrl->value << 1); - break; - - case V4L2_CID_SATURATION: - if (ctrl->value < 0 || ctrl->value > 127) { - cx25840_err("invalid saturation setting %d\n", - ctrl->value); - return -ERANGE; - } - - cx25840_write(client, 0x420, ctrl->value << 1); - cx25840_write(client, 0x421, ctrl->value << 1); - break; - - case V4L2_CID_HUE: - if (ctrl->value < -127 || ctrl->value > 127) { - cx25840_err("invalid hue setting %d\n", ctrl->value); - return -ERANGE; - } - - cx25840_write(client, 0x422, ctrl->value); - break; - - case V4L2_CID_AUDIO_VOLUME: - case V4L2_CID_AUDIO_BASS: - case V4L2_CID_AUDIO_TREBLE: - case V4L2_CID_AUDIO_BALANCE: - case V4L2_CID_AUDIO_MUTE: - return cx25840_audio(client, VIDIOC_S_CTRL, ctrl); - } - - return 0; -} - -static int get_v4lctrl(struct i2c_client *client, struct v4l2_control *ctrl) -{ - struct cx25840_state *state = i2c_get_clientdata(client); - - switch (ctrl->id) { - case CX25840_CID_CARDTYPE: - ctrl->value = state->cardtype; - break; - case V4L2_CID_BRIGHTNESS: - ctrl->value = cx25840_read(client, 0x414) + 128; - break; - case V4L2_CID_CONTRAST: - ctrl->value = cx25840_read(client, 0x415) >> 1; - break; - case V4L2_CID_SATURATION: - ctrl->value = cx25840_read(client, 0x420) >> 1; - break; - case V4L2_CID_HUE: - ctrl->value = cx25840_read(client, 0x422); - break; - case V4L2_CID_AUDIO_VOLUME: - case V4L2_CID_AUDIO_BASS: - case V4L2_CID_AUDIO_TREBLE: - case V4L2_CID_AUDIO_BALANCE: - case V4L2_CID_AUDIO_MUTE: - return cx25840_audio(client, VIDIOC_G_CTRL, ctrl); - default: - return -EINVAL; - } - - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int get_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt) -{ - switch (fmt->type) { - case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: - return cx25840_vbi(client, VIDIOC_G_FMT, fmt); - default: - return -EINVAL; - } - - return 0; -} - -static int set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt) -{ - struct v4l2_pix_format *pix; - int HSC, VSC, Vsrc, Hsrc, filter, Vlines; - int is_pal = !(cx25840_get_v4lstd(client) & V4L2_STD_NTSC); - - switch (fmt->type) { - case V4L2_BUF_TYPE_VIDEO_CAPTURE: - pix = &(fmt->fmt.pix); - - Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4; - Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4; - - Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4; - Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4; - - Vlines = pix->height + (is_pal ? 4 : 7); - - if ((pix->width * 16 < Hsrc) || (Hsrc < pix->width) || - (Vlines * 8 < Vsrc) || (Vsrc < Vlines)) { - cx25840_err("%dx%d is not a valid size!\n", - pix->width, pix->height); - return -ERANGE; - } - - HSC = (Hsrc * (1 << 20)) / pix->width - (1 << 20); - VSC = (1 << 16) - (Vsrc * (1 << 9) / Vlines - (1 << 9)); - VSC &= 0x1fff; - - if (pix->width >= 385) - filter = 0; - else if (pix->width > 192) - filter = 1; - else if (pix->width > 96) - filter = 2; - else - filter = 3; - - cx25840_dbg("decoder set size %dx%d -> scale %ux%u\n", - pix->width, pix->height, HSC, VSC); - - /* HSCALE=HSC */ - cx25840_write(client, 0x418, HSC & 0xff); - cx25840_write(client, 0x419, (HSC >> 8) & 0xff); - cx25840_write(client, 0x41a, HSC >> 16); - /* VSCALE=VSC */ - cx25840_write(client, 0x41c, VSC & 0xff); - cx25840_write(client, 0x41d, VSC >> 8); - /* VS_INTRLACE=1 VFILT=filter */ - cx25840_write(client, 0x41e, 0x8 | filter); - break; - - case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: - return cx25840_vbi(client, VIDIOC_S_FMT, fmt); - - case V4L2_BUF_TYPE_VBI_CAPTURE: - return cx25840_vbi(client, VIDIOC_S_FMT, fmt); - - default: - return -EINVAL; - } - - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int cx25840_command(struct i2c_client *client, unsigned int cmd, - void *arg) -{ - struct cx25840_state *state = i2c_get_clientdata(client); - struct v4l2_tuner *vt = arg; - int result = 0; - - switch (cmd) { - case 0: - break; - -#ifdef CONFIG_VIDEO_ADV_DEBUG - /* ioctls to allow direct access to the - * cx25840 registers for testing */ - case VIDIOC_INT_G_REGISTER: - { - struct v4l2_register *reg = arg; - - if (reg->i2c_id != I2C_DRIVERID_CX25840) - return -EINVAL; - reg->val = cx25840_read(client, reg->reg & 0x0fff); - break; - } - - case VIDIOC_INT_S_REGISTER: - { - struct v4l2_register *reg = arg; - - if (reg->i2c_id != I2C_DRIVERID_CX25840) - return -EINVAL; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - cx25840_write(client, reg->reg & 0x0fff, reg->val & 0xff); - break; - } -#endif - - case VIDIOC_INT_DECODE_VBI_LINE: - return cx25840_vbi(client, cmd, arg); - - case VIDIOC_INT_AUDIO_CLOCK_FREQ: - case AUDC_SET_INPUT: - result = cx25840_audio(client, cmd, arg); - break; - - case VIDIOC_STREAMON: - cx25840_dbg("enable output\n"); - cx25840_write(client, 0x115, 0x8c); - cx25840_write(client, 0x116, 0x07); - break; - - case VIDIOC_STREAMOFF: - cx25840_dbg("disable output\n"); - cx25840_write(client, 0x115, 0x00); - cx25840_write(client, 0x116, 0x00); - break; - - case VIDIOC_LOG_STATUS: - log_status(client); - break; - - case VIDIOC_G_CTRL: - result = get_v4lctrl(client, (struct v4l2_control *)arg); - break; - - case VIDIOC_S_CTRL: - result = set_v4lctrl(client, (struct v4l2_control *)arg); - break; - - case VIDIOC_G_STD: - *(v4l2_std_id *)arg = cx25840_get_v4lstd(client); - break; - - case VIDIOC_S_STD: - result = set_v4lstd(client, *(v4l2_std_id *)arg); - break; - - case VIDIOC_G_INPUT: - *(int *)arg = state->input; - break; - - case VIDIOC_S_INPUT: - result = set_input(client, *(int *)arg); - break; - - case VIDIOC_S_FREQUENCY: - input_change(client); - break; - - case VIDIOC_G_TUNER: - { - u8 mode = cx25840_read(client, 0x804); - u8 pref = cx25840_read(client, 0x809) & 0xf; - u8 vpres = cx25840_read(client, 0x80a) & 0x10; - int val = 0; - - vt->capability |= - V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_LANG1 | - V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP; - - vt->signal = vpres ? 0xffff : 0x0; - - /* get rxsubchans and audmode */ - if ((mode & 0xf) == 1) - val |= V4L2_TUNER_SUB_STEREO; - else - val |= V4L2_TUNER_SUB_MONO; - - if (mode == 2 || mode == 4) - val |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; - - if (mode & 0x10) - val |= V4L2_TUNER_SUB_SAP; - - vt->rxsubchans = val; - - switch (pref) { - case 0: - vt->audmode = V4L2_TUNER_MODE_MONO; - break; - case 1: - case 2: - vt->audmode = V4L2_TUNER_MODE_LANG2; - break; - case 4: - default: - vt->audmode = V4L2_TUNER_MODE_STEREO; - } - break; - } - - case VIDIOC_S_TUNER: - switch (vt->audmode) { - case V4L2_TUNER_MODE_MONO: - case V4L2_TUNER_MODE_LANG1: - /* Force PREF_MODE to MONO */ - cx25840_and_or(client, 0x809, ~0xf, 0x00); - break; - case V4L2_TUNER_MODE_STEREO: - /* Force PREF_MODE to STEREO */ - cx25840_and_or(client, 0x809, ~0xf, 0x04); - break; - case V4L2_TUNER_MODE_LANG2: - /* Force PREF_MODE to LANG2 */ - cx25840_and_or(client, 0x809, ~0xf, 0x01); - break; - } - break; - - case VIDIOC_G_FMT: - result = get_v4lfmt(client, (struct v4l2_format *)arg); - break; - - case VIDIOC_S_FMT: - result = set_v4lfmt(client, (struct v4l2_format *)arg); - break; - - case VIDIOC_INT_RESET: - cx25840_initialize(client, 0); - break; - - case VIDIOC_INT_G_CHIP_IDENT: - *(enum v4l2_chip_ident *)arg = - V4L2_IDENT_CX25840 + ((cx25840_read(client, 0x100) >> 4) & 0xf); - break; - - default: - cx25840_err("invalid ioctl %x\n", cmd); - return -EINVAL; - } - - return result; -} - -/* ----------------------------------------------------------------------- */ - -static struct i2c_driver i2c_driver_cx25840; - -static int cx25840_detect_client(struct i2c_adapter *adapter, int address, - int kind) -{ - struct i2c_client *client; - struct cx25840_state *state; - u16 device_id; - - /* Check if the adapter supports the needed features - * Not until kernel version 2.6.11 did the bit-algo - * correctly report that it would do an I2C-level xfer */ - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) - return 0; - - client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) - return -ENOMEM; - - memset(client, 0, sizeof(struct i2c_client)); - client->addr = address; - client->adapter = adapter; - client->driver = &i2c_driver_cx25840; - client->flags = I2C_CLIENT_ALLOW_USE; - snprintf(client->name, sizeof(client->name) - 1, "cx25840"); - - cx25840_dbg("detecting cx25840 client on address 0x%x\n", address << 1); - - device_id = cx25840_read(client, 0x101) << 8; - device_id |= cx25840_read(client, 0x100); - - /* The high byte of the device ID should be - * 0x84 if chip is present */ - if ((device_id & 0xff00) != 0x8400) { - cx25840_dbg("cx25840 not found\n"); - kfree(client); - return 0; - } - - cx25840_info("cx25%3x-2%x found @ 0x%x (%s)\n", - (device_id & 0xfff0) >> 4, - (device_id & 0x0f) < 3 ? (device_id & 0x0f) + 1 : 3, - address << 1, adapter->name); - - state = kmalloc(sizeof(struct cx25840_state), GFP_KERNEL); - if (state == NULL) { - kfree(client); - return -ENOMEM; - } - - i2c_set_clientdata(client, state); - memset(state, 0, sizeof(struct cx25840_state)); - state->input = CX25840_TUNER; - state->audclk_freq = V4L2_AUDCLK_48_KHZ; - state->audio_input = AUDIO_TUNER; - state->cardtype = CARDTYPE_PVR150; - - cx25840_initialize(client, 1); - - i2c_attach_client(client); - - return 0; -} - -static int cx25840_attach_adapter(struct i2c_adapter *adapter) -{ -#ifdef I2C_CLASS_TV_ANALOG - if (adapter->class & I2C_CLASS_TV_ANALOG) -#else - if (adapter->id == I2C_HW_B_BT848) -#endif - return i2c_probe(adapter, &addr_data, &cx25840_detect_client); - return 0; -} - -static int cx25840_detach_client(struct i2c_client *client) -{ - struct cx25840_state *state = i2c_get_clientdata(client); - int err; - - err = i2c_detach_client(client); - if (err) { - return err; - } - - kfree(state); - kfree(client); - - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static struct i2c_driver i2c_driver_cx25840 = { - .name = "cx25840", - - .id = I2C_DRIVERID_CX25840, - .flags = I2C_DF_NOTIFY, - - .attach_adapter = cx25840_attach_adapter, - .detach_client = cx25840_detach_client, - .command = cx25840_command, - .owner = THIS_MODULE, -}; - - -static int __init m__init(void) -{ - return i2c_add_driver(&i2c_driver_cx25840); -} - -static void __exit m__exit(void) -{ - i2c_del_driver(&i2c_driver_cx25840); -} - -module_init(m__init); -module_exit(m__exit); - -/* ----------------------------------------------------------------------- */ - -static void log_status(struct i2c_client *client) -{ - static const char *const fmt_strs[] = { - "0x0", - "NTSC-M", "NTSC-J", "NTSC-4.43", - "PAL-BDGHI", "PAL-M", "PAL-N", "PAL-Nc", "PAL-60", - "0x9", "0xA", "0xB", - "SECAM", - "0xD", "0xE", "0xF" - }; - - struct cx25840_state *state = i2c_get_clientdata(client); - u8 microctrl_vidfmt = cx25840_read(client, 0x80a); - u8 vidfmt_sel = cx25840_read(client, 0x400) & 0xf; - u8 gen_stat1 = cx25840_read(client, 0x40d); - u8 download_ctl = cx25840_read(client, 0x803); - u8 mod_det_stat0 = cx25840_read(client, 0x804); - u8 mod_det_stat1 = cx25840_read(client, 0x805); - u8 audio_config = cx25840_read(client, 0x808); - u8 pref_mode = cx25840_read(client, 0x809); - u8 afc0 = cx25840_read(client, 0x80b); - u8 mute_ctl = cx25840_read(client, 0x8d3); - char *p; - - cx25840_info("Video signal: %spresent\n", - (microctrl_vidfmt & 0x10) ? "" : "not "); - cx25840_info("Detected format: %s\n", - fmt_strs[gen_stat1 & 0xf]); - - switch (mod_det_stat0) { - case 0x00: p = "mono"; break; - case 0x01: p = "stereo"; break; - case 0x02: p = "dual"; break; - case 0x04: p = "tri"; break; - case 0x10: p = "mono with SAP"; break; - case 0x11: p = "stereo with SAP"; break; - case 0x12: p = "dual with SAP"; break; - case 0x14: p = "tri with SAP"; break; - case 0xfe: p = "forced mode"; break; - default: p = "not defined"; - } - cx25840_info("Detected audio mode: %s\n", p); - - switch (mod_det_stat1) { - case 0x00: p = "not defined"; break; - case 0x01: p = "EIAJ"; break; - case 0x02: p = "A2-M"; break; - case 0x03: p = "A2-BG"; break; - case 0x04: p = "A2-DK1"; break; - case 0x05: p = "A2-DK2"; break; - case 0x06: p = "A2-DK3"; break; - case 0x07: p = "A1 (6.0 MHz FM Mono)"; break; - case 0x08: p = "AM-L"; break; - case 0x09: p = "NICAM-BG"; break; - case 0x0a: p = "NICAM-DK"; break; - case 0x0b: p = "NICAM-I"; break; - case 0x0c: p = "NICAM-L"; break; - case 0x0d: p = "BTSC/EIAJ/A2-M Mono (4.5 MHz FMMono)"; break; - case 0x0e: p = "IF FM Radio"; break; - case 0x0f: p = "BTSC"; break; - case 0x10: p = "high-deviation FM"; break; - case 0x11: p = "very high-deviation FM"; break; - case 0xfd: p = "unknown audio standard"; break; - case 0xfe: p = "forced audio standard"; break; - case 0xff: p = "no detected audio standard"; break; - default: p = "not defined"; - } - cx25840_info("Detected audio standard: %s\n", p); - cx25840_info("Audio muted: %s\n", - (mute_ctl & 0x2) ? "yes" : "no"); - cx25840_info("Audio microcontroller: %s\n", - (download_ctl & 0x10) ? "running" : "stopped"); - - switch (audio_config >> 4) { - case 0x00: p = "undefined"; break; - case 0x01: p = "BTSC"; break; - case 0x02: p = "EIAJ"; break; - case 0x03: p = "A2-M"; break; - case 0x04: p = "A2-BG"; break; - case 0x05: p = "A2-DK1"; break; - case 0x06: p = "A2-DK2"; break; - case 0x07: p = "A2-DK3"; break; - case 0x08: p = "A1 (6.0 MHz FM Mono)"; break; - case 0x09: p = "AM-L"; break; - case 0x0a: p = "NICAM-BG"; break; - case 0x0b: p = "NICAM-DK"; break; - case 0x0c: p = "NICAM-I"; break; - case 0x0d: p = "NICAM-L"; break; - case 0x0e: p = "FM radio"; break; - case 0x0f: p = "automatic detection"; break; - default: p = "undefined"; - } - cx25840_info("Configured audio standard: %s\n", p); - - if ((audio_config >> 4) < 0xF) { - switch (audio_config & 0xF) { - case 0x00: p = "MONO1 (LANGUAGE A/Mono L+R channel for BTSC, EIAJ, A2)"; break; - case 0x01: p = "MONO2 (LANGUAGE B)"; break; - case 0x02: p = "MONO3 (STEREO forced MONO)"; break; - case 0x03: p = "MONO4 (NICAM ANALOG-Language C/Analog Fallback)"; break; - case 0x04: p = "STEREO"; break; - case 0x05: p = "DUAL1 (AB)"; break; - case 0x06: p = "DUAL2 (AC) (FM)"; break; - case 0x07: p = "DUAL3 (BC) (FM)"; break; - case 0x08: p = "DUAL4 (AC) (AM)"; break; - case 0x09: p = "DUAL5 (BC) (AM)"; break; - case 0x0a: p = "SAP"; break; - default: p = "undefined"; - } - cx25840_info("Configured audio mode: %s\n", p); - } else { - switch (audio_config & 0xF) { - case 0x00: p = "BG"; break; - case 0x01: p = "DK1"; break; - case 0x02: p = "DK2"; break; - case 0x03: p = "DK3"; break; - case 0x04: p = "I"; break; - case 0x05: p = "L"; break; - case 0x06: p = "BTSC"; break; - case 0x07: p = "EIAJ"; break; - case 0x08: p = "A2-M"; break; - case 0x09: p = "FM Radio"; break; - case 0x0f: p = "automatic standard and mode detection"; break; - default: p = "undefined"; - } - cx25840_info("Configured audio system: %s\n", p); - } - - cx25840_info("Specified standard: %s\n", - vidfmt_sel ? fmt_strs[vidfmt_sel] : "automatic detection"); - - switch (state->input) { - case CX25840_COMPOSITE0: p = "Composite 0"; break; - case CX25840_COMPOSITE1: p = "Composite 1"; break; - case CX25840_SVIDEO0: p = "S-Video 0"; break; - case CX25840_SVIDEO1: p = "S-Video 1"; break; - case CX25840_TUNER: p = "Tuner"; break; - } - cx25840_info("Specified input: %s\n", p); - cx25840_info("Specified audio input: %s\n", - state->audio_input == 0 ? "Tuner" : "External"); - - switch (state->audclk_freq) { - case V4L2_AUDCLK_441_KHZ: p = "44.1 kHz"; break; - case V4L2_AUDCLK_48_KHZ: p = "48 kHz"; break; - case V4L2_AUDCLK_32_KHZ: p = "32 kHz"; break; - default: p = "undefined"; - } - cx25840_info("Specified audioclock freq: %s\n", p); - - switch (pref_mode & 0xf) { - case 0: p = "mono/language A"; break; - case 1: p = "language B"; break; - case 2: p = "language C"; break; - case 3: p = "analog fallback"; break; - case 4: p = "stereo"; break; - case 5: p = "language AC"; break; - case 6: p = "language BC"; break; - case 7: p = "language AB"; break; - default: p = "undefined"; - } - cx25840_info("Preferred audio mode: %s\n", p); - - if ((audio_config & 0xf) == 0xf) { - switch ((afc0 >> 3) & 0x3) { - case 0: p = "system DK"; break; - case 1: p = "system L"; break; - case 2: p = "autodetect"; break; - default: p = "undefined"; - } - cx25840_info("Selected 65 MHz format: %s\n", p); - - switch (afc0 & 0x7) { - case 0: p = "chroma"; break; - case 1: p = "BTSC"; break; - case 2: p = "EIAJ"; break; - case 3: p = "A2-M"; break; - case 4: p = "autodetect"; break; - default: p = "undefined"; - } - cx25840_info("Selected 45 MHz format: %s\n", p); - } -} diff --git a/trunk/drivers/media/video/cx25840/cx25840-firmware.c b/trunk/drivers/media/video/cx25840/cx25840-firmware.c deleted file mode 100644 index df9d50a75542..000000000000 --- a/trunk/drivers/media/video/cx25840/cx25840-firmware.c +++ /dev/null @@ -1,167 +0,0 @@ -/* cx25840 firmware functions - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - - -#include -#include -#include -#include -#include - -#include "cx25840.h" - -#define FWFILE "v4l-cx25840.fw" -#define FWSEND 1024 - -#define FWDEV(x) &((x)->adapter->dev) - -static int fastfw = 1; -static char *firmware = FWFILE; - -module_param(fastfw, bool, 0444); -module_param(firmware, charp, 0444); - -MODULE_PARM_DESC(fastfw, "Load firmware fast [0=100MHz 1=333MHz (default)]"); -MODULE_PARM_DESC(firmware, "Firmware image [default: " FWFILE "]"); - -static inline void set_i2c_delay(struct i2c_client *client, int delay) -{ - struct i2c_algo_bit_data *algod = client->adapter->algo_data; - - /* We aren't guaranteed to be using algo_bit, - * so avoid the null pointer dereference - * and disable the 'fast firmware load' */ - if (algod) { - algod->udelay = delay; - } else { - fastfw = 0; - } -} - -static inline void start_fw_load(struct i2c_client *client) -{ - /* DL_ADDR_LB=0 DL_ADDR_HB=0 */ - cx25840_write(client, 0x800, 0x00); - cx25840_write(client, 0x801, 0x00); - // DL_MAP=3 DL_AUTO_INC=0 DL_ENABLE=1 - cx25840_write(client, 0x803, 0x0b); - /* AUTO_INC_DIS=1 */ - cx25840_write(client, 0x000, 0x20); - - if (fastfw) - set_i2c_delay(client, 3); -} - -static inline void end_fw_load(struct i2c_client *client) -{ - if (fastfw) - set_i2c_delay(client, 10); - - /* AUTO_INC_DIS=0 */ - cx25840_write(client, 0x000, 0x00); - /* DL_ENABLE=0 */ - cx25840_write(client, 0x803, 0x03); -} - -static inline int check_fw_load(struct i2c_client *client, int size) -{ - /* DL_ADDR_HB DL_ADDR_LB */ - int s = cx25840_read(client, 0x801) << 8; - s |= cx25840_read(client, 0x800); - - if (size != s) { - cx25840_err("firmware %s load failed\n", firmware); - return -EINVAL; - } - - cx25840_info("loaded %s firmware (%d bytes)\n", firmware, size); - return 0; -} - -static inline int fw_write(struct i2c_client *client, u8 * data, int size) -{ - if (i2c_master_send(client, data, size) < size) { - - if (fastfw) { - cx25840_err("333MHz i2c firmware load failed\n"); - fastfw = 0; - set_i2c_delay(client, 10); - - if (i2c_master_send(client, data, size) < size) { - cx25840_err - ("100MHz i2c firmware load failed\n"); - return -ENOSYS; - } - - } else { - cx25840_err("firmware load i2c failure\n"); - return -ENOSYS; - } - - } - - return 0; -} - -int cx25840_loadfw(struct i2c_client *client) -{ - const struct firmware *fw = NULL; - u8 buffer[4], *ptr; - int size, send, retval; - - if (request_firmware(&fw, firmware, FWDEV(client)) != 0) { - cx25840_err("unable to open firmware %s\n", firmware); - return -EINVAL; - } - - start_fw_load(client); - - buffer[0] = 0x08; - buffer[1] = 0x02; - buffer[2] = fw->data[0]; - buffer[3] = fw->data[1]; - retval = fw_write(client, buffer, 4); - - if (retval < 0) { - release_firmware(fw); - return retval; - } - - size = fw->size - 2; - ptr = fw->data; - while (size > 0) { - ptr[0] = 0x08; - ptr[1] = 0x02; - send = size > (FWSEND - 2) ? FWSEND : size + 2; - retval = fw_write(client, ptr, send); - - if (retval < 0) { - release_firmware(fw); - return retval; - } - - size -= FWSEND - 2; - ptr += FWSEND - 2; - } - - end_fw_load(client); - - size = fw->size; - release_firmware(fw); - - return check_fw_load(client, size); -} diff --git a/trunk/drivers/media/video/cx25840/cx25840-vbi.c b/trunk/drivers/media/video/cx25840/cx25840-vbi.c deleted file mode 100644 index 13ba4e15ddea..000000000000 --- a/trunk/drivers/media/video/cx25840/cx25840-vbi.c +++ /dev/null @@ -1,315 +0,0 @@ -/* cx25840 VBI functions - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - - -#include -#include -#include - -#include "cx25840.h" - -static inline int odd_parity(u8 c) -{ - c ^= (c >> 4); - c ^= (c >> 2); - c ^= (c >> 1); - - return c & 1; -} - -static inline int decode_vps(u8 * dst, u8 * p) -{ - static const u8 biphase_tbl[] = { - 0xf0, 0x78, 0x70, 0xf0, 0xb4, 0x3c, 0x34, 0xb4, - 0xb0, 0x38, 0x30, 0xb0, 0xf0, 0x78, 0x70, 0xf0, - 0xd2, 0x5a, 0x52, 0xd2, 0x96, 0x1e, 0x16, 0x96, - 0x92, 0x1a, 0x12, 0x92, 0xd2, 0x5a, 0x52, 0xd2, - 0xd0, 0x58, 0x50, 0xd0, 0x94, 0x1c, 0x14, 0x94, - 0x90, 0x18, 0x10, 0x90, 0xd0, 0x58, 0x50, 0xd0, - 0xf0, 0x78, 0x70, 0xf0, 0xb4, 0x3c, 0x34, 0xb4, - 0xb0, 0x38, 0x30, 0xb0, 0xf0, 0x78, 0x70, 0xf0, - 0xe1, 0x69, 0x61, 0xe1, 0xa5, 0x2d, 0x25, 0xa5, - 0xa1, 0x29, 0x21, 0xa1, 0xe1, 0x69, 0x61, 0xe1, - 0xc3, 0x4b, 0x43, 0xc3, 0x87, 0x0f, 0x07, 0x87, - 0x83, 0x0b, 0x03, 0x83, 0xc3, 0x4b, 0x43, 0xc3, - 0xc1, 0x49, 0x41, 0xc1, 0x85, 0x0d, 0x05, 0x85, - 0x81, 0x09, 0x01, 0x81, 0xc1, 0x49, 0x41, 0xc1, - 0xe1, 0x69, 0x61, 0xe1, 0xa5, 0x2d, 0x25, 0xa5, - 0xa1, 0x29, 0x21, 0xa1, 0xe1, 0x69, 0x61, 0xe1, - 0xe0, 0x68, 0x60, 0xe0, 0xa4, 0x2c, 0x24, 0xa4, - 0xa0, 0x28, 0x20, 0xa0, 0xe0, 0x68, 0x60, 0xe0, - 0xc2, 0x4a, 0x42, 0xc2, 0x86, 0x0e, 0x06, 0x86, - 0x82, 0x0a, 0x02, 0x82, 0xc2, 0x4a, 0x42, 0xc2, - 0xc0, 0x48, 0x40, 0xc0, 0x84, 0x0c, 0x04, 0x84, - 0x80, 0x08, 0x00, 0x80, 0xc0, 0x48, 0x40, 0xc0, - 0xe0, 0x68, 0x60, 0xe0, 0xa4, 0x2c, 0x24, 0xa4, - 0xa0, 0x28, 0x20, 0xa0, 0xe0, 0x68, 0x60, 0xe0, - 0xf0, 0x78, 0x70, 0xf0, 0xb4, 0x3c, 0x34, 0xb4, - 0xb0, 0x38, 0x30, 0xb0, 0xf0, 0x78, 0x70, 0xf0, - 0xd2, 0x5a, 0x52, 0xd2, 0x96, 0x1e, 0x16, 0x96, - 0x92, 0x1a, 0x12, 0x92, 0xd2, 0x5a, 0x52, 0xd2, - 0xd0, 0x58, 0x50, 0xd0, 0x94, 0x1c, 0x14, 0x94, - 0x90, 0x18, 0x10, 0x90, 0xd0, 0x58, 0x50, 0xd0, - 0xf0, 0x78, 0x70, 0xf0, 0xb4, 0x3c, 0x34, 0xb4, - 0xb0, 0x38, 0x30, 0xb0, 0xf0, 0x78, 0x70, 0xf0, - }; - - u8 c, err = 0; - int i; - - for (i = 0; i < 2 * 13; i += 2) { - err |= biphase_tbl[p[i]] | biphase_tbl[p[i + 1]]; - c = (biphase_tbl[p[i + 1]] & 0xf) | - ((biphase_tbl[p[i]] & 0xf) << 4); - dst[i / 2] = c; - } - - return err & 0xf0; -} - -void cx25840_vbi_setup(struct i2c_client *client) -{ - v4l2_std_id std = cx25840_get_v4lstd(client); - - if (std & ~V4L2_STD_NTSC) { - /* datasheet startup, step 8d */ - cx25840_write(client, 0x49f, 0x11); - - cx25840_write(client, 0x470, 0x84); - cx25840_write(client, 0x471, 0x00); - cx25840_write(client, 0x472, 0x2d); - cx25840_write(client, 0x473, 0x5d); - - cx25840_write(client, 0x474, 0x24); - cx25840_write(client, 0x475, 0x40); - cx25840_write(client, 0x476, 0x24); - cx25840_write(client, 0x477, 0x28); - - cx25840_write(client, 0x478, 0x1f); - cx25840_write(client, 0x479, 0x02); - - if (std & V4L2_STD_SECAM) { - cx25840_write(client, 0x47a, 0x80); - cx25840_write(client, 0x47b, 0x00); - cx25840_write(client, 0x47c, 0x5f); - cx25840_write(client, 0x47d, 0x42); - } else { - cx25840_write(client, 0x47a, 0x90); - cx25840_write(client, 0x47b, 0x20); - cx25840_write(client, 0x47c, 0x63); - cx25840_write(client, 0x47d, 0x82); - } - - cx25840_write(client, 0x47e, 0x0a); - cx25840_write(client, 0x47f, 0x01); - } else { - /* datasheet startup, step 8d */ - cx25840_write(client, 0x49f, 0x14); - - cx25840_write(client, 0x470, 0x7a); - cx25840_write(client, 0x471, 0x00); - cx25840_write(client, 0x472, 0x2d); - cx25840_write(client, 0x473, 0x5b); - - cx25840_write(client, 0x474, 0x1a); - cx25840_write(client, 0x475, 0x70); - cx25840_write(client, 0x476, 0x1e); - cx25840_write(client, 0x477, 0x1e); - - cx25840_write(client, 0x478, 0x1f); - cx25840_write(client, 0x479, 0x02); - cx25840_write(client, 0x47a, 0x50); - cx25840_write(client, 0x47b, 0x66); - - cx25840_write(client, 0x47c, 0x1f); - cx25840_write(client, 0x47d, 0x7c); - cx25840_write(client, 0x47e, 0x08); - cx25840_write(client, 0x47f, 0x00); - } -} - -int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg) -{ - struct v4l2_format *fmt; - struct v4l2_sliced_vbi_format *svbi; - - switch (cmd) { - case VIDIOC_G_FMT: - { - static u16 lcr2vbi[] = { - 0, V4L2_SLICED_TELETEXT_B, 0, /* 1 */ - 0, V4L2_SLICED_WSS_625, 0, /* 4 */ - V4L2_SLICED_CAPTION_525, /* 6 */ - 0, 0, V4L2_SLICED_VPS, 0, 0, /* 9 */ - 0, 0, 0, 0 - }; - int i; - - fmt = arg; - if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) - return -EINVAL; - svbi = &fmt->fmt.sliced; - memset(svbi, 0, sizeof(*svbi)); - /* we're done if raw VBI is active */ - if ((cx25840_read(client, 0x404) & 0x10) == 0) - break; - - for (i = 7; i <= 23; i++) { - u8 v = cx25840_read(client, 0x424 + i - 7); - - svbi->service_lines[0][i] = lcr2vbi[v >> 4]; - svbi->service_lines[1][i] = lcr2vbi[v & 0xf]; - svbi->service_set |= - svbi->service_lines[0][i] | svbi->service_lines[1][i]; - } - break; - } - - case VIDIOC_S_FMT: - { - int is_pal = !(cx25840_get_v4lstd(client) & V4L2_STD_NTSC); - int vbi_offset = is_pal ? 1 : 0; - int i, x; - u8 lcr[24]; - - fmt = arg; - if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) - return -EINVAL; - svbi = &fmt->fmt.sliced; - if (svbi->service_set == 0) { - /* raw VBI */ - memset(svbi, 0, sizeof(*svbi)); - - /* Setup VBI */ - cx25840_vbi_setup(client); - - /* VBI Offset */ - cx25840_write(client, 0x47f, vbi_offset); - cx25840_write(client, 0x404, 0x2e); - break; - } - - for (x = 0; x <= 23; x++) - lcr[x] = 0x00; - - /* Setup VBI */ - cx25840_vbi_setup(client); - - /* Sliced VBI */ - cx25840_write(client, 0x404, 0x36); /* Ancillery data */ - cx25840_write(client, 0x406, 0x13); - cx25840_write(client, 0x47f, vbi_offset); - - if (is_pal) { - for (i = 0; i <= 6; i++) - svbi->service_lines[0][i] = - svbi->service_lines[1][i] = 0; - } else { - for (i = 0; i <= 9; i++) - svbi->service_lines[0][i] = - svbi->service_lines[1][i] = 0; - - for (i = 22; i <= 23; i++) - svbi->service_lines[0][i] = - svbi->service_lines[1][i] = 0; - } - - for (i = 7; i <= 23; i++) { - for (x = 0; x <= 1; x++) { - switch (svbi->service_lines[1-x][i]) { - case V4L2_SLICED_TELETEXT_B: - lcr[i] |= 1 << (4 * x); - break; - case V4L2_SLICED_WSS_625: - lcr[i] |= 4 << (4 * x); - break; - case V4L2_SLICED_CAPTION_525: - lcr[i] |= 6 << (4 * x); - break; - case V4L2_SLICED_VPS: - lcr[i] |= 9 << (4 * x); - break; - } - } - } - - for (x = 1, i = 0x424; i <= 0x434; i++, x++) { - cx25840_write(client, i, lcr[6 + x]); - } - - cx25840_write(client, 0x43c, 0x16); - - if (is_pal) { - cx25840_write(client, 0x474, 0x2a); - } else { - cx25840_write(client, 0x474, 0x1a + 6); - } - break; - } - - case VIDIOC_INT_DECODE_VBI_LINE: - { - struct v4l2_decode_vbi_line *vbi = arg; - u8 *p = vbi->p; - int id1, id2, l, err = 0; - - if (p[0] || p[1] != 0xff || p[2] != 0xff || - (p[3] != 0x55 && p[3] != 0x91)) { - vbi->line = vbi->type = 0; - break; - } - - p += 4; - id1 = p[-1]; - id2 = p[0] & 0xf; - l = p[2] & 0x3f; - l += 5; - p += 4; - - switch (id2) { - case 1: - id2 = V4L2_SLICED_TELETEXT_B; - break; - case 4: - id2 = V4L2_SLICED_WSS_625; - break; - case 6: - id2 = V4L2_SLICED_CAPTION_525; - err = !odd_parity(p[0]) || !odd_parity(p[1]); - break; - case 9: - id2 = V4L2_SLICED_VPS; - if (decode_vps(p, p) != 0) { - err = 1; - } - break; - default: - id2 = 0; - err = 1; - break; - } - - vbi->type = err ? 0 : id2; - vbi->line = err ? 0 : l; - vbi->is_second_field = err ? 0 : (id1 == 0x55); - vbi->p = p; - break; - } - } - - return 0; -} diff --git a/trunk/drivers/media/video/cx25840/cx25840.h b/trunk/drivers/media/video/cx25840/cx25840.h deleted file mode 100644 index 4932ed1c9b19..000000000000 --- a/trunk/drivers/media/video/cx25840/cx25840.h +++ /dev/null @@ -1,92 +0,0 @@ -/* cx25840 API header - * - * Copyright (C) 2003-2004 Chris Kennedy - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef _CX25840_H_ -#define _CX25840_H_ - - -#include -#include - -extern int cx25840_debug; - -#define cx25840_dbg(fmt, arg...) do { if (cx25840_debug) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) - -#define cx25840_err(fmt, arg...) do { \ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) - -#define cx25840_info(fmt, arg...) do { \ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) - -#define CX25840_CID_CARDTYPE (V4L2_CID_PRIVATE_BASE+0) - -/* The CARDTYPE_PVR150_WORKAROUND cardtype activates a workaround for a - hardware bug that is present in PVR150 (and possible PVR500) cards that - have certain NTSC tuners (tveeprom model numbers 85, 99 and 112). The - audio autodetect fails on some channels for these models and the workaround - is to select the audio standard explicitly. Many thanks to Hauppauge for - providing this information. */ -enum cx25840_cardtype { - CARDTYPE_PVR150, - CARDTYPE_PG600, - CARDTYPE_PVR150_WORKAROUND, -}; - -enum cx25840_input { - CX25840_TUNER, - CX25840_COMPOSITE0, - CX25840_COMPOSITE1, - CX25840_SVIDEO0, - CX25840_SVIDEO1 -}; - -struct cx25840_state { - enum cx25840_cardtype cardtype; - enum cx25840_input input; - int audio_input; - enum v4l2_audio_clock_freq audclk_freq; -}; - -/* ----------------------------------------------------------------------- */ -/* cx25850-core.c */ -int cx25840_write(struct i2c_client *client, u16 addr, u8 value); -int cx25840_write4(struct i2c_client *client, u16 addr, u32 value); -u8 cx25840_read(struct i2c_client *client, u16 addr); -u32 cx25840_read4(struct i2c_client *client, u16 addr); -int cx25840_and_or(struct i2c_client *client, u16 addr, u8 mask, u8 value); -v4l2_std_id cx25840_get_v4lstd(struct i2c_client *client); - -/* ----------------------------------------------------------------------- */ -/* cx25850-firmware.c */ -int cx25840_loadfw(struct i2c_client *client); - -/* ----------------------------------------------------------------------- */ -/* cx25850-audio.c */ -int cx25840_audio(struct i2c_client *client, unsigned int cmd, void *arg); - -/* ----------------------------------------------------------------------- */ -/* cx25850-vbi.c */ -void cx25840_vbi_setup(struct i2c_client *client); -int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg); - -#endif diff --git a/trunk/drivers/media/video/cx88/Kconfig b/trunk/drivers/media/video/cx88/Kconfig index 85ba4106dc79..41818b6205b3 100644 --- a/trunk/drivers/media/video/cx88/Kconfig +++ b/trunk/drivers/media/video/cx88/Kconfig @@ -46,8 +46,8 @@ config VIDEO_CX88_DVB_ALL_FRONTENDS If you are unsure, choose Y. config VIDEO_CX88_DVB_MT352 - bool "Zarlink MT352 DVB-T Support" - default y + tristate "Zarlink MT352 DVB-T Support" + default m depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS select DVB_MT352 ---help--- @@ -55,8 +55,8 @@ config VIDEO_CX88_DVB_MT352 Connexant 2388x chip and the MT352 demodulator. config VIDEO_CX88_DVB_OR51132 - bool "OR51132 ATSC Support" - default y + tristate "OR51132 ATSC Support" + default m depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS select DVB_OR51132 ---help--- @@ -64,8 +64,8 @@ config VIDEO_CX88_DVB_OR51132 Connexant 2388x chip and the OR51132 demodulator. config VIDEO_CX88_DVB_CX22702 - bool "Conexant CX22702 DVB-T Support" - default y + tristate "Conexant CX22702 DVB-T Support" + default m depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS select DVB_CX22702 ---help--- @@ -73,8 +73,8 @@ config VIDEO_CX88_DVB_CX22702 Connexant 2388x chip and the CX22702 demodulator. config VIDEO_CX88_DVB_LGDT330X - bool "LG Electronics DT3302/DT3303 ATSC Support" - default y + tristate "LG Electronics DT3302/DT3303 ATSC Support" + default m depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS select DVB_LGDT330X ---help--- @@ -82,8 +82,8 @@ config VIDEO_CX88_DVB_LGDT330X Connexant 2388x chip and the LGDT3302/LGDT3303 demodulator. config VIDEO_CX88_DVB_NXT200X - bool "NXT2002/NXT2004 ATSC Support" - default y + tristate "NXT2002/NXT2004 ATSC Support" + default m depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS select DVB_NXT200X ---help--- diff --git a/trunk/drivers/media/video/cx88/Makefile b/trunk/drivers/media/video/cx88/Makefile index 54401b02b7ce..0df40b773454 100644 --- a/trunk/drivers/media/video/cx88/Makefile +++ b/trunk/drivers/media/video/cx88/Makefile @@ -9,12 +9,21 @@ obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o EXTRA_CFLAGS += -I$(src)/.. EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends - -extra-cflags-$(CONFIG_VIDEO_BUF_DVB) += -DHAVE_VIDEO_BUF_DVB=1 -extra-cflags-$(CONFIG_DVB_CX22702) += -DHAVE_CX22702=1 -extra-cflags-$(CONFIG_DVB_OR51132) += -DHAVE_OR51132=1 -extra-cflags-$(CONFIG_DVB_LGDT330X) += -DHAVE_LGDT330X=1 -extra-cflags-$(CONFIG_DVB_MT352) += -DHAVE_MT352=1 -extra-cflags-$(CONFIG_DVB_NXT200X) += -DHAVE_NXT200X=1 - -EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m) +ifneq ($(CONFIG_VIDEO_BUF_DVB),n) + EXTRA_CFLAGS += -DHAVE_VIDEO_BUF_DVB=1 +endif +ifneq ($(CONFIG_DVB_CX22702),n) + EXTRA_CFLAGS += -DHAVE_CX22702=1 +endif +ifneq ($(CONFIG_DVB_OR51132),n) + EXTRA_CFLAGS += -DHAVE_OR51132=1 +endif +ifneq ($(CONFIG_DVB_LGDT330X),n) + EXTRA_CFLAGS += -DHAVE_LGDT330X=1 +endif +ifneq ($(CONFIG_DVB_MT352),n) + EXTRA_CFLAGS += -DHAVE_MT352=1 +endif +ifneq ($(CONFIG_DVB_NXT200X),n) + EXTRA_CFLAGS += -DHAVE_NXT200X=1 +endif diff --git a/trunk/drivers/media/video/cx88/cx88-blackbird.c b/trunk/drivers/media/video/cx88/cx88-blackbird.c index 74e57a53116f..4ae3f78cccf2 100644 --- a/trunk/drivers/media/video/cx88/cx88-blackbird.c +++ b/trunk/drivers/media/video/cx88/cx88-blackbird.c @@ -616,8 +616,6 @@ static int blackbird_load_firmware(struct cx8802_dev *dev) retval = request_firmware(&firmware, BLACKBIRD_FIRM_ENC_FILENAME, &dev->pci->dev); - - if (retval != 0) { dprintk(0, "ERROR: Hotplug firmware request failed (%s).\n", BLACKBIRD_FIRM_ENC_FILENAME); diff --git a/trunk/drivers/media/video/cx88/cx88-cards.c b/trunk/drivers/media/video/cx88/cx88-cards.c index 951709aa88ba..f2268631b7c0 100644 --- a/trunk/drivers/media/video/cx88/cx88-cards.c +++ b/trunk/drivers/media/video/cx88/cx88-cards.c @@ -567,7 +567,6 @@ struct cx88_board cx88_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - .tda9887_conf = TDA9887_PRESENT, .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, @@ -712,7 +711,6 @@ struct cx88_board cx88_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - .tda9887_conf = TDA9887_PRESENT, .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, @@ -1085,28 +1083,41 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data) tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data); core->tuner_type = tv.tuner_type; core->has_radio = tv.has_radio; +} - /* Make sure we support the board model */ - switch (tv.model) - { - case 90002: /* Nova-T-PCI (9002) */ - case 92001: /* Nova-S-Plus (Video and IR) */ - case 92002: /* Nova-S-Plus (Video and IR) */ - case 90003: /* Nova-T-PCI (9002 No RF out) */ - case 90500: /* Nova-T-PCI (oem) */ - case 90501: /* Nova-T-PCI (oem/IR) */ - case 92000: /* Nova-SE2 (OEM, No Video or IR) */ +static int hauppauge_eeprom_dvb(struct cx88_core *core, u8 *ee) +{ + int model; + int tuner; + /* Make sure we support the board model */ + model = ee[0x1f] << 24 | ee[0x1e] << 16 | ee[0x1d] << 8 | ee[0x1c]; + switch(model) { + case 90002: + case 90500: + case 90501: /* known */ break; default: printk("%s: warning: unknown hauppauge model #%d\n", - core->name, tv.model); + core->name, model); break; } - printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n", - core->name, tv.model); + /* Make sure we support the tuner */ + tuner = ee[0x2d]; + switch(tuner) { + case 0x4B: /* dtt 7595 */ + case 0x4C: /* dtt 7592 */ + break; + default: + printk("%s: error: unknown hauppauge tuner 0x%02x\n", + core->name, tuner); + return -ENODEV; + } + printk(KERN_INFO "%s: hauppauge eeprom: model=%d, tuner=%d\n", + core->name, model, tuner); + return 0; } /* ----------------------------------------------------------------------- */ @@ -1190,7 +1201,7 @@ void cx88_card_list(struct cx88_core *core, struct pci_dev *pci) void cx88_card_setup(struct cx88_core *core) { - static u8 eeprom[256]; + static u8 eeprom[128]; if (0 == core->i2c_rc) { core->i2c_client.addr = 0xa0 >> 1; @@ -1213,7 +1224,7 @@ void cx88_card_setup(struct cx88_core *core) break; case CX88_BOARD_HAUPPAUGE_DVB_T1: if (0 == core->i2c_rc) - hauppauge_eeprom(core,eeprom); + hauppauge_eeprom_dvb(core,eeprom); break; case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: diff --git a/trunk/drivers/media/video/cx88/cx88-core.c b/trunk/drivers/media/video/cx88/cx88-core.c index bb6eb54e19ce..eb806af17182 100644 --- a/trunk/drivers/media/video/cx88/cx88-core.c +++ b/trunk/drivers/media/video/cx88/cx88-core.c @@ -837,29 +837,6 @@ static int set_pll(struct cx88_core *core, int prescale, u32 ofreq) return -1; } -int cx88_start_audio_dma(struct cx88_core *core) -{ - /* setup fifo + format */ - cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0); - cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0); - - cx_write(MO_AUDD_LNGTH, 128); /* fifo bpl size */ - cx_write(MO_AUDR_LNGTH, 128); /* fifo bpl size */ - - /* start dma */ - cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */ - - return 0; -} - -int cx88_stop_audio_dma(struct cx88_core *core) -{ - /* stop dma */ - cx_write(MO_AUD_DMACNTRL, 0x0000); - - return 0; -} - static int set_tvaudio(struct cx88_core *core) { struct cx88_tvnorm *norm = core->tvnorm; @@ -900,16 +877,12 @@ static int set_tvaudio(struct cx88_core *core) cx88_set_tvaudio(core); /* cx88_set_stereo(dev,V4L2_TUNER_MODE_STEREO); */ -/* - This should be needed only on cx88-alsa. It seems that some cx88 chips have - bugs and does require DMA enabled for it to work. - */ - cx88_start_audio_dma(core); + cx_write(MO_AUDD_LNGTH, 128); /* fifo size */ + cx_write(MO_AUDR_LNGTH, 128); /* fifo size */ + cx_write(MO_AUD_DMACNTRL, 0x03); /* need audio fifo */ return 0; } - - int cx88_set_tvnorm(struct cx88_core *core, struct cx88_tvnorm *norm) { u32 fsc8; @@ -1231,8 +1204,6 @@ EXPORT_SYMBOL(cx88_set_scale); EXPORT_SYMBOL(cx88_vdev_init); EXPORT_SYMBOL(cx88_core_get); EXPORT_SYMBOL(cx88_core_put); -EXPORT_SYMBOL(cx88_start_audio_dma); -EXPORT_SYMBOL(cx88_stop_audio_dma); /* * Local variables: diff --git a/trunk/drivers/media/video/cx88/cx88-dvb.c b/trunk/drivers/media/video/cx88/cx88-dvb.c index 99ea955f5987..9cce91ec334b 100644 --- a/trunk/drivers/media/video/cx88/cx88-dvb.c +++ b/trunk/drivers/media/video/cx88/cx88-dvb.c @@ -439,6 +439,9 @@ static int dvb_register(struct cx8802_dev *dev) /* Put the analog decoder in standby to keep it quiet */ cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); + /* Put the analog decoder in standby to keep it quiet */ + cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); + /* register everything */ return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev); } diff --git a/trunk/drivers/media/video/cx88/cx88-input.c b/trunk/drivers/media/video/cx88/cx88-input.c index 461019dca901..38b12ebaa49e 100644 --- a/trunk/drivers/media/video/cx88/cx88-input.c +++ b/trunk/drivers/media/video/cx88/cx88-input.c @@ -453,6 +453,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) input_dev->id.product = pci->device; } input_dev->cdev.dev = &pci->dev; + /* record handles to ourself */ ir->core = core; core->ir = ir; @@ -585,6 +586,7 @@ void cx88_ir_irq(struct cx88_core *core) MODULE_AUTHOR("Gerd Knorr, Pavel Machek, Chris Pascoe"); MODULE_DESCRIPTION("input driver for cx88 GPIO-based IR remote controls"); MODULE_LICENSE("GPL"); + /* * Local variables: * c-basic-offset: 8 diff --git a/trunk/drivers/media/video/cx88/cx88-tvaudio.c b/trunk/drivers/media/video/cx88/cx88-tvaudio.c index a1b120c8a9b5..6d9bec1c583b 100644 --- a/trunk/drivers/media/video/cx88/cx88-tvaudio.c +++ b/trunk/drivers/media/video/cx88/cx88-tvaudio.c @@ -119,10 +119,13 @@ static void set_audio_registers(struct cx88_core *core, const struct rlist *l) static void set_audio_start(struct cx88_core *core, u32 mode) { - /* mute */ + // mute cx_write(AUD_VOL_CTL, (1 << 6)); - /* start programming */ + // start programming + cx_write(MO_AUD_DMACNTRL, 0x0000); + msleep(100); + //cx_write(AUD_CTL, 0x0000); cx_write(AUD_INIT, mode); cx_write(AUD_INIT_LD, 0x0001); cx_write(AUD_SOFT_RESET, 0x0001); @@ -132,21 +135,17 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl) { u32 volume; - /* restart dma; This avoids buzz in NICAM and is good in others */ - cx88_stop_audio_dma(core); - cx_write(AUD_RATE_THRES_DMD, 0x000000C0); - cx88_start_audio_dma(core); - if (cx88_boards[core->board].blackbird) { - /* sets sound input from external adc */ + // sets sound input from external adc cx_set(AUD_CTL, EN_I2SIN_ENABLE); + //cx_write(AUD_I2SINPUTCNTL, 0); cx_write(AUD_I2SINPUTCNTL, 4); cx_write(AUD_BAUDRATE, 1); - /* 'pass-thru mode': this enables the i2s output to the mpeg encoder */ + // 'pass-thru mode': this enables the i2s output to the mpeg encoder cx_set(AUD_CTL, EN_I2SOUT_ENABLE); cx_write(AUD_I2SOUTPUTCNTL, 1); cx_write(AUD_I2SCNTL, 0); - /* cx_write(AUD_APB_IN_RATE_ADJ, 0); */ + //cx_write(AUD_APB_IN_RATE_ADJ, 0); } else { ctl |= EN_DAC_ENABLE; cx_write(AUD_CTL, ctl); @@ -154,6 +153,7 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl) /* finish programming */ cx_write(AUD_SOFT_RESET, 0x0000); + cx_write(MO_AUD_DMACNTRL, 0x0003); /* unmute */ volume = cx_sread(SHADOW_AUD_VOL_CTL); @@ -313,6 +313,7 @@ static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode) {AUD_RATE_ADJ3, 0x00000100}, {AUD_RATE_ADJ4, 0x00000400}, {AUD_RATE_ADJ5, 0x00001000}, + //{ AUD_DMD_RA_DDS, 0x00c0d5ce }, {AUD_ERRLOGPERIOD_R, 0x00000fff}, {AUD_ERRINTRPTTHSHLD1_R, 0x000003ff}, {AUD_ERRINTRPTTHSHLD2_R, 0x000000ff}, @@ -350,12 +351,12 @@ static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode) set_audio_registers(core, nicam_l); break; case WW_I: - dprintk("%s PAL-I NICAM (status: known-good)\n", __FUNCTION__); + dprintk("%s PAL-I NICAM (status: devel)\n", __FUNCTION__); set_audio_registers(core, nicam_bgdki_common); set_audio_registers(core, nicam_i); break; default: - dprintk("%s PAL-BGDK NICAM (status: known-good)\n", __FUNCTION__); + dprintk("%s PAL-BGDK NICAM (status: unknown)\n", __FUNCTION__); set_audio_registers(core, nicam_bgdki_common); set_audio_registers(core, nicam_default); break; @@ -714,7 +715,8 @@ int cx88_detect_nicam(struct cx88_core *core) /* if bit1=1 then nicam is detected */ j += ((cx_read(AUD_NICAM_STATUS2) & 0x02) >> 1); - if (j == 1) { + /* 3x detected: absolutly sure now */ + if (j == 3) { dprintk("nicam is detected.\n"); return 1; } diff --git a/trunk/drivers/media/video/cx88/cx88.h b/trunk/drivers/media/video/cx88/cx88.h index 77beafc5c327..b19d3a9e2298 100644 --- a/trunk/drivers/media/video/cx88/cx88.h +++ b/trunk/drivers/media/video/cx88/cx88.h @@ -411,6 +411,7 @@ struct cx8802_dev { struct videobuf_dvb dvb; void* fe_handle; int (*fe_release)(void *handle); + /* for switching modulation types */ unsigned char ts_gen_cntrl; @@ -490,10 +491,6 @@ extern struct cx88_core* cx88_core_get(struct pci_dev *pci); extern void cx88_core_put(struct cx88_core *core, struct pci_dev *pci); -extern int cx88_start_audio_dma(struct cx88_core *core); -extern int cx88_stop_audio_dma(struct cx88_core *core); - - /* ----------------------------------------------------------- */ /* cx88-vbi.c */ diff --git a/trunk/drivers/media/video/em28xx/em28xx-core.c b/trunk/drivers/media/video/em28xx/em28xx-core.c index 0cfe75416ec6..d54bc0127484 100644 --- a/trunk/drivers/media/video/em28xx/em28xx-core.c +++ b/trunk/drivers/media/video/em28xx/em28xx-core.c @@ -32,7 +32,7 @@ /* #define ENABLE_DEBUG_ISOC_FRAMES */ -static unsigned int core_debug; +unsigned int core_debug; module_param(core_debug,int,0644); MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); @@ -41,7 +41,7 @@ MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); printk(KERN_INFO "%s %s :"fmt, \ dev->name, __FUNCTION__ , ##arg); } while (0) -static unsigned int reg_debug; +unsigned int reg_debug; module_param(reg_debug,int,0644); MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]"); @@ -50,7 +50,7 @@ MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]"); printk(KERN_INFO "%s %s :"fmt, \ dev->name, __FUNCTION__ , ##arg); } while (0) -static unsigned int isoc_debug; +unsigned int isoc_debug; module_param(isoc_debug,int,0644); MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]"); @@ -116,6 +116,47 @@ void em28xx_print_ioctl(char *name, unsigned int cmd) } } +static void *rvmalloc(size_t size) +{ + void *mem; + unsigned long adr; + + size = PAGE_ALIGN(size); + + mem = vmalloc_32((unsigned long)size); + if (!mem) + return NULL; + + memset(mem, 0, size); + + adr = (unsigned long)mem; + while (size > 0) { + SetPageReserved(vmalloc_to_page((void *)adr)); + adr += PAGE_SIZE; + size -= PAGE_SIZE; + } + + return mem; +} + +static void rvfree(void *mem, size_t size) +{ + unsigned long adr; + + if (!mem) + return; + + size = PAGE_ALIGN(size); + + adr = (unsigned long)mem; + while (size > 0) { + ClearPageReserved(vmalloc_to_page((void *)adr)); + adr += PAGE_SIZE; + size -= PAGE_SIZE; + } + + vfree(mem); +} /* * em28xx_request_buffers() @@ -126,16 +167,14 @@ u32 em28xx_request_buffers(struct em28xx *dev, u32 count) const size_t imagesize = PAGE_ALIGN(dev->frame_size); /*needs to be page aligned cause the buffers can be mapped individually! */ void *buff = NULL; u32 i; - em28xx_coredbg("requested %i buffers with size %zd", count, imagesize); + em28xx_coredbg("requested %i buffers with size %i", count, imagesize); if (count > EM28XX_NUM_FRAMES) count = EM28XX_NUM_FRAMES; dev->num_frames = count; while (dev->num_frames > 0) { - if ((buff = vmalloc_32(dev->num_frames * imagesize))) { - memset(buff, 0, dev->num_frames * imagesize); + if ((buff = rvmalloc(dev->num_frames * imagesize))) break; - } dev->num_frames--; } @@ -178,7 +217,8 @@ void em28xx_queue_unusedframes(struct em28xx *dev) void em28xx_release_buffers(struct em28xx *dev) { if (dev->num_frames) { - vfree(dev->frame[0].bufmem); + rvfree(dev->frame[0].bufmem, + dev->num_frames * PAGE_ALIGN(dev->frame[0].buf.length)); dev->num_frames = 0; } } diff --git a/trunk/drivers/media/video/em28xx/em28xx-i2c.c b/trunk/drivers/media/video/em28xx/em28xx-i2c.c index 7f5603054f02..b32d9852f34c 100644 --- a/trunk/drivers/media/video/em28xx/em28xx-i2c.c +++ b/trunk/drivers/media/video/em28xx/em28xx-i2c.c @@ -41,7 +41,7 @@ module_param(i2c_debug, int, 0644); MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]"); #define dprintk1(lvl,fmt, args...) if (i2c_debug>=lvl) do {\ - printk(fmt, ##args); } while (0) + printk(fmt , ##args); } while (0) #define dprintk2(lvl,fmt, args...) if (i2c_debug>=lvl) do{ \ printk(KERN_DEBUG "%s at %s: " fmt, \ dev->name, __FUNCTION__ , ##args); } while (0) diff --git a/trunk/drivers/media/video/em28xx/em28xx-input.c b/trunk/drivers/media/video/em28xx/em28xx-input.c index 9b94f77d6fd7..32c49df58adc 100644 --- a/trunk/drivers/media/video/em28xx/em28xx-input.c +++ b/trunk/drivers/media/video/em28xx/em28xx-input.c @@ -120,6 +120,9 @@ static int get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) if (buf[1]==0xff) return 0; + /* avoid fast reapeating */ + if (buf[1]==ir->old) + return 0; ir->old=buf[1]; /* Rearranges bits to the right order */ diff --git a/trunk/drivers/media/video/em28xx/em28xx-video.c b/trunk/drivers/media/video/em28xx/em28xx-video.c index 3a56120397ae..57c1826b928e 100644 --- a/trunk/drivers/media/video/em28xx/em28xx-video.c +++ b/trunk/drivers/media/video/em28xx/em28xx-video.c @@ -189,6 +189,16 @@ static DECLARE_RWSEM(em28xx_disconnect); /********************* v4l2 interface ******************************************/ +static inline unsigned long kvirt_to_pa(unsigned long adr) +{ + unsigned long kva, ret; + + kva = (unsigned long)page_address(vmalloc_to_page((void *)adr)); + kva |= adr & (PAGE_SIZE - 1); + ret = __pa(kva); + return ret; +} + /* * em28xx_config() * inits registers with sane defaults @@ -216,7 +226,7 @@ static int em28xx_config(struct em28xx *dev) * em28xx_config_i2c() * configure i2c attached devices */ -static void em28xx_config_i2c(struct em28xx *dev) +void em28xx_config_i2c(struct em28xx *dev) { struct v4l2_frequency f; struct video_decoder_init em28xx_vdi = {.data = NULL }; @@ -606,8 +616,7 @@ static struct vm_operations_struct em28xx_vm_ops = { static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma) { unsigned long size = vma->vm_end - vma->vm_start, - start = vma->vm_start; - void *pos; + start = vma->vm_start, pos, page; u32 i; struct em28xx *dev = filp->private_data; @@ -648,10 +657,12 @@ static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma) vma->vm_flags |= VM_IO; vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ - pos = dev->frame[i].bufmem; + pos = (unsigned long)dev->frame[i].bufmem; while (size > 0) { /* size is page-aligned */ - if (vm_insert_page(vma, start, vmalloc_to_page(pos))) { - em28xx_videodbg("mmap: vm_insert_page failed\n"); + page = vmalloc_to_pfn((void *)pos); + if (remap_pfn_range(vma, start, page, PAGE_SIZE, + vma->vm_page_prot)) { + em28xx_videodbg("mmap: rename page map failed\n"); up(&dev->fileop_lock); return -EAGAIN; } @@ -1884,6 +1895,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) } static struct usb_driver em28xx_usb_driver = { + .owner = THIS_MODULE, .name = "em28xx", .probe = em28xx_usb_probe, .disconnect = em28xx_usb_disconnect, diff --git a/trunk/drivers/media/video/ir-kbd-gpio.c b/trunk/drivers/media/video/ir-kbd-gpio.c index de1385e5d05e..ed81934ef3cd 100644 --- a/trunk/drivers/media/video/ir-kbd-gpio.c +++ b/trunk/drivers/media/video/ir-kbd-gpio.c @@ -221,98 +221,24 @@ static IR_KEYTAB_TYPE ir_codes_conceptronic[IR_KEYTAB_SIZE] = { [ 24 ] = KEY_MUTE // mute/unmute }; -static IR_KEYTAB_TYPE ir_codes_nebula[IR_KEYTAB_SIZE] = { - [0x00] = KEY_KP0, - [0x01] = KEY_KP1, - [0x02] = KEY_KP2, - [0x03] = KEY_KP3, - [0x04] = KEY_KP4, - [0x05] = KEY_KP5, - [0x06] = KEY_KP6, - [0x07] = KEY_KP7, - [0x08] = KEY_KP8, - [0x09] = KEY_KP9, - [0x0a] = KEY_TV, - [0x0b] = KEY_AUX, - [0x0c] = KEY_DVD, - [0x0d] = KEY_POWER, - [0x0e] = KEY_MHP, /* labelled 'Picture' */ - [0x0f] = KEY_AUDIO, - [0x10] = KEY_INFO, - [0x11] = KEY_F13, /* 16:9 */ - [0x12] = KEY_F14, /* 14:9 */ - [0x13] = KEY_EPG, - [0x14] = KEY_EXIT, - [0x15] = KEY_MENU, - [0x16] = KEY_UP, - [0x17] = KEY_DOWN, - [0x18] = KEY_LEFT, - [0x19] = KEY_RIGHT, - [0x1a] = KEY_ENTER, - [0x1b] = KEY_CHANNELUP, - [0x1c] = KEY_CHANNELDOWN, - [0x1d] = KEY_VOLUMEUP, - [0x1e] = KEY_VOLUMEDOWN, - [0x1f] = KEY_RED, - [0x20] = KEY_GREEN, - [0x21] = KEY_YELLOW, - [0x22] = KEY_BLUE, - [0x23] = KEY_SUBTITLE, - [0x24] = KEY_F15, /* AD */ - [0x25] = KEY_TEXT, - [0x26] = KEY_MUTE, - [0x27] = KEY_REWIND, - [0x28] = KEY_STOP, - [0x29] = KEY_PLAY, - [0x2a] = KEY_FASTFORWARD, - [0x2b] = KEY_F16, /* chapter */ - [0x2c] = KEY_PAUSE, - [0x2d] = KEY_PLAY, - [0x2e] = KEY_RECORD, - [0x2f] = KEY_F17, /* picture in picture */ - [0x30] = KEY_KPPLUS, /* zoom in */ - [0x31] = KEY_KPMINUS, /* zoom out */ - [0x32] = KEY_F18, /* capture */ - [0x33] = KEY_F19, /* web */ - [0x34] = KEY_EMAIL, - [0x35] = KEY_PHONE, - [0x36] = KEY_PC -}; - struct IR { struct bttv_sub_device *sub; struct input_dev *input; struct ir_input_state ir; char name[32]; char phys[32]; - - /* Usual gpio signalling */ - u32 mask_keycode; u32 mask_keydown; u32 mask_keyup; - u32 polling; + + int polling; u32 last_gpio; struct work_struct work; struct timer_list timer; - - /* RC5 gpio */ - u32 rc5_gpio; - struct timer_list timer_end; /* timer_end for code completion */ - struct timer_list timer_keyup; /* timer_end for key release */ - u32 last_rc5; /* last good rc5 code */ - u32 last_bit; /* last raw bit seen */ - u32 code; /* raw code under construction */ - struct timeval base_time; /* time of last seen code */ - int active; /* building raw code */ }; static int debug; module_param(debug, int, 0644); /* debug level (0,1,2) */ -static int repeat_delay = 500; -module_param(repeat_delay, int, 0644); -static int repeat_period = 33; -module_param(repeat_period, int, 0644); #define DEVNAME "ir-kbd-gpio" #define dprintk(fmt, arg...) if (debug) \ @@ -328,7 +254,7 @@ static struct bttv_sub_driver driver = { .probe = ir_probe, .remove = ir_remove, }, - .gpio_irq = ir_irq, + .gpio_irq = ir_irq, }; /* ---------------------------------------------------------------------- */ @@ -401,173 +327,6 @@ static void ir_work(void *data) mod_timer(&ir->timer, timeout); } -/* ---------------------------------------------------------------*/ - -static int rc5_remote_gap = 885; -module_param(rc5_remote_gap, int, 0644); -static int rc5_key_timeout = 200; -module_param(rc5_key_timeout, int, 0644); - -#define RC5_START(x) (((x)>>12)&3) -#define RC5_TOGGLE(x) (((x)>>11)&1) -#define RC5_ADDR(x) (((x)>>6)&31) -#define RC5_INSTR(x) ((x)&63) - -/* decode raw bit pattern to RC5 code */ -static u32 rc5_decode(unsigned int code) -{ - unsigned int org_code = code; - unsigned int pair; - unsigned int rc5 = 0; - int i; - - code = (code << 1) | 1; - for (i = 0; i < 14; ++i) { - pair = code & 0x3; - code >>= 2; - - rc5 <<= 1; - switch (pair) { - case 0: - case 2: - break; - case 1: - rc5 |= 1; - break; - case 3: - dprintk("bad code: %x\n", org_code); - return 0; - } - } - dprintk("code=%x, rc5=%x, start=%x, toggle=%x, address=%x, " - "instr=%x\n", rc5, org_code, RC5_START(rc5), - RC5_TOGGLE(rc5), RC5_ADDR(rc5), RC5_INSTR(rc5)); - return rc5; -} - -static int ir_rc5_irq(struct bttv_sub_device *sub) -{ - struct IR *ir = dev_get_drvdata(&sub->dev); - struct timeval tv; - u32 gpio; - u32 gap; - unsigned long current_jiffies, timeout; - - /* read gpio port */ - gpio = bttv_gpio_read(ir->sub->core); - - /* remote IRQ? */ - if (!(gpio & 0x20)) - return 0; - - /* get time of bit */ - current_jiffies = jiffies; - do_gettimeofday(&tv); - - /* avoid overflow with gap >1s */ - if (tv.tv_sec - ir->base_time.tv_sec > 1) { - gap = 200000; - } else { - gap = 1000000 * (tv.tv_sec - ir->base_time.tv_sec) + - tv.tv_usec - ir->base_time.tv_usec; - } - - /* active code => add bit */ - if (ir->active) { - /* only if in the code (otherwise spurious IRQ or timer - late) */ - if (ir->last_bit < 28) { - ir->last_bit = (gap - rc5_remote_gap / 2) / - rc5_remote_gap; - ir->code |= 1 << ir->last_bit; - } - /* starting new code */ - } else { - ir->active = 1; - ir->code = 0; - ir->base_time = tv; - ir->last_bit = 0; - - timeout = current_jiffies + (500 + 30 * HZ) / 1000; - mod_timer(&ir->timer_end, timeout); - } - - /* toggle GPIO pin 4 to reset the irq */ - bttv_gpio_write(ir->sub->core, gpio & ~(1 << 4)); - bttv_gpio_write(ir->sub->core, gpio | (1 << 4)); - return 1; -} - -static void ir_rc5_timer_end(unsigned long data) -{ - struct IR *ir = (struct IR *)data; - struct timeval tv; - unsigned long current_jiffies, timeout; - u32 gap; - - /* get time */ - current_jiffies = jiffies; - do_gettimeofday(&tv); - - /* avoid overflow with gap >1s */ - if (tv.tv_sec - ir->base_time.tv_sec > 1) { - gap = 200000; - } else { - gap = 1000000 * (tv.tv_sec - ir->base_time.tv_sec) + - tv.tv_usec - ir->base_time.tv_usec; - } - - /* Allow some timmer jitter (RC5 is ~24ms anyway so this is ok) */ - if (gap < 28000) { - dprintk("spurious timer_end\n"); - return; - } - - ir->active = 0; - if (ir->last_bit < 20) { - /* ignore spurious codes (caused by light/other remotes) */ - dprintk("short code: %x\n", ir->code); - } else { - u32 rc5 = rc5_decode(ir->code); - - /* two start bits? */ - if (RC5_START(rc5) != 3) { - dprintk("rc5 start bits invalid: %u\n", RC5_START(rc5)); - - /* right address? */ - } else if (RC5_ADDR(rc5) == 0x0) { - u32 toggle = RC5_TOGGLE(rc5); - u32 instr = RC5_INSTR(rc5); - - /* Good code, decide if repeat/repress */ - if (toggle != RC5_TOGGLE(ir->last_rc5) || - instr != RC5_INSTR(ir->last_rc5)) { - dprintk("instruction %x, toggle %x\n", instr, - toggle); - ir_input_nokey(ir->input, &ir->ir); - ir_input_keydown(ir->input, &ir->ir, instr, - instr); - } - - /* Set/reset key-up timer */ - timeout = current_jiffies + (500 + rc5_key_timeout - * HZ) / 1000; - mod_timer(&ir->timer_keyup, timeout); - - /* Save code for repeat test */ - ir->last_rc5 = rc5; - } - } -} - -static void ir_rc5_timer_keyup(unsigned long data) -{ - struct IR *ir = (struct IR *)data; - - dprintk("key released\n"); - ir_input_nokey(ir->input, &ir->ir); -} - /* ---------------------------------------------------------------------- */ static int ir_probe(struct device *dev) @@ -641,12 +400,6 @@ static int ir_probe(struct device *dev) ir->mask_keyup = 0x006000; ir->polling = 50; // ms break; - case BTTV_BOARD_NEBULA_DIGITV: - ir_codes = ir_codes_nebula; - driver.any_irq = ir_rc5_irq; - driver.gpio_irq = NULL; - ir->rc5_gpio = 1; - break; } if (NULL == ir_codes) { kfree(ir); @@ -654,17 +407,9 @@ static int ir_probe(struct device *dev) return -ENODEV; } - if (ir->rc5_gpio) { - u32 gpio; - /* enable remote irq */ - bttv_gpio_inout(sub->core, (1 << 4), 1 << 4); - gpio = bttv_gpio_read(sub->core); - bttv_gpio_write(sub->core, gpio & ~(1 << 4)); - bttv_gpio_write(sub->core, gpio | (1 << 4)); - } else { - /* init hardware-specific stuff */ - bttv_gpio_inout(sub->core, ir->mask_keycode | ir->mask_keydown, 0); - } + /* init hardware-specific stuff */ + bttv_gpio_inout(sub->core, ir->mask_keycode | ir->mask_keydown, 0); + ir->sub = sub; /* init input device */ snprintf(ir->name, sizeof(ir->name), "bttv IR (card=%d)", @@ -686,34 +431,18 @@ static int ir_probe(struct device *dev) } input_dev->cdev.dev = &sub->core->pci->dev; - ir->input = input_dev; - ir->sub = sub; - if (ir->polling) { INIT_WORK(&ir->work, ir_work, ir); init_timer(&ir->timer); ir->timer.function = ir_timer; ir->timer.data = (unsigned long)ir; schedule_work(&ir->work); - } else if (ir->rc5_gpio) { - /* set timer_end for code completion */ - init_timer(&ir->timer_end); - ir->timer_end.function = ir_rc5_timer_end; - ir->timer_end.data = (unsigned long)ir; - - init_timer(&ir->timer_keyup); - ir->timer_keyup.function = ir_rc5_timer_keyup; - ir->timer_keyup.data = (unsigned long)ir; } /* all done */ dev_set_drvdata(dev, ir); input_register_device(ir->input); - /* the remote isn't as bouncy as a keyboard */ - ir->input->rep[REP_DELAY] = repeat_delay; - ir->input->rep[REP_PERIOD] = repeat_period; - return 0; } @@ -726,16 +455,6 @@ static int ir_remove(struct device *dev) flush_scheduled_work(); } - if (ir->rc5_gpio) { - u32 gpio; - - del_timer(&ir->timer_end); - flush_scheduled_work(); - - gpio = bttv_gpio_read(ir->sub->core); - bttv_gpio_write(ir->sub->core, gpio & ~(1 << 4)); - } - input_unregister_device(ir->input); kfree(ir); return 0; diff --git a/trunk/drivers/media/video/ir-kbd-i2c.c b/trunk/drivers/media/video/ir-kbd-i2c.c index 740e543311af..0085567a1421 100644 --- a/trunk/drivers/media/video/ir-kbd-i2c.c +++ b/trunk/drivers/media/video/ir-kbd-i2c.c @@ -40,7 +40,6 @@ #include #include #include - #include #include @@ -184,58 +183,6 @@ static int get_key_knc1(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) return 1; } -/* The new pinnacle PCTV remote (with the colored buttons) - * - * Ricardo Cerqueira - */ - -int get_key_pinnacle(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) -{ - unsigned char b[4]; - unsigned int start = 0,parity = 0,code = 0; - - /* poll IR chip */ - if (4 != i2c_master_recv(&ir->c,b,4)) { - dprintk(2,"read error\n"); - return -EIO; - } - - for (start = 0; start<4; start++) { - if (b[start] == 0x80) { - code=b[(start+3)%4]; - parity=b[(start+2)%4]; - } - } - - /* Empty Request */ - if (parity==0) - return 0; - - /* Repeating... */ - if (ir->old == parity) - return 0; - - - ir->old = parity; - - /* Reduce code value to fit inside IR_KEYTAB_SIZE - * - * this is the only value that results in 42 unique - * codes < 128 - */ - - code %= 0x88; - - *ir_raw = code; - *ir_key = code; - - dprintk(1,"Pinnacle PCTV key %02x\n", code); - - return 1; -} - -EXPORT_SYMBOL_GPL(get_key_pinnacle); - /* ----------------------------------------------------------------------- */ static void ir_key_poll(struct IR_i2c *ir) @@ -279,7 +226,7 @@ static int ir_probe(struct i2c_adapter *adap); static struct i2c_driver driver = { .name = "ir remote kbd driver", - .id = I2C_DRIVERID_INFRARED, + .id = I2C_DRIVERID_EXP3, /* FIXME */ .flags = I2C_DF_NOTIFY, .attach_adapter = ir_probe, .detach_client = ir_detach, @@ -297,15 +244,15 @@ static int ir_attach(struct i2c_adapter *adap, int addr, IR_KEYTAB_TYPE *ir_codes = NULL; char *name; int ir_type; - struct IR_i2c *ir; + struct IR_i2c *ir; struct input_dev *input_dev; - ir = kzalloc(sizeof(struct IR_i2c),GFP_KERNEL); + ir = kzalloc(sizeof(struct IR_i2c), GFP_KERNEL); input_dev = input_allocate_device(); if (!ir || !input_dev) { kfree(ir); input_free_device(input_dev); - return -ENOMEM; + return -ENOMEM; } ir->c = client_template; @@ -361,7 +308,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr, /* register i2c device * At device register, IR codes may be changed to be * board dependent. - */ + */ i2c_attach_client(&ir->c); /* If IR not supported or disabled, unregisters driver */ diff --git a/trunk/drivers/media/video/msp3400.c b/trunk/drivers/media/video/msp3400.c index d86f8e92e534..a23fb0338986 100644 --- a/trunk/drivers/media/video/msp3400.c +++ b/trunk/drivers/media/video/msp3400.c @@ -134,7 +134,7 @@ struct msp3400c { int rxsubchans; int muted; - int left, right; /* volume */ + int left, right; /* volume */ int bass, treble; /* shadow register set */ @@ -882,7 +882,6 @@ static void watch_stereo(struct i2c_client *client) msp->watch_stereo = 0; } - static int msp3400c_thread(void *data) { struct i2c_client *client = data; @@ -890,7 +889,6 @@ static int msp3400c_thread(void *data) struct CARRIER_DETECT *cd; int count, max1,max2,val1,val2, val,this; - msp3400_info("msp3400 daemon started\n"); for (;;) { msp3400_dbg_mediumvol("msp3400 thread: sleep\n"); @@ -1164,7 +1162,6 @@ static int msp3410d_thread(void *data) int mode,val,i,std; msp3400_info("msp3410 daemon started\n"); - for (;;) { msp3400_dbg_mediumvol("msp3410 thread: sleep\n"); msp34xx_sleep(msp,-1); @@ -1387,7 +1384,6 @@ static int msp34xxg_thread(void *data) int val, std, i; msp3400_info("msp34xxg daemon started\n"); - msp->source = 1; /* default */ for (;;) { msp3400_dbg_mediumvol("msp34xxg thread: sleep\n"); @@ -1563,11 +1559,11 @@ static void msp_wake_thread(struct i2c_client *client); static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "msp3400", - .id = I2C_DRIVERID_MSP3400, - .flags = I2C_DF_NOTIFY, - .attach_adapter = msp_probe, - .detach_client = msp_detach, - .command = msp_command, + .id = I2C_DRIVERID_MSP3400, + .flags = I2C_DF_NOTIFY, + .attach_adapter = msp_probe, + .detach_client = msp_detach, + .command = msp_command, .driver = { .suspend = msp_suspend, .resume = msp_resume, @@ -1578,7 +1574,7 @@ static struct i2c_client client_template = { .name = "(unset)", .flags = I2C_CLIENT_ALLOW_USE, - .driver = &driver, + .driver = &driver, }; static int msp_attach(struct i2c_adapter *adap, int addr, int kind) diff --git a/trunk/drivers/media/video/saa6588.c b/trunk/drivers/media/video/saa6588.c index 923322503e8f..dca3ddfd510f 100644 --- a/trunk/drivers/media/video/saa6588.c +++ b/trunk/drivers/media/video/saa6588.c @@ -422,6 +422,7 @@ static int saa6588_attach(struct i2c_adapter *adap, int addr, int kind) s->timer.function = saa6588_timer; s->timer.data = (unsigned long)s; schedule_work(&s->work); + return 0; } diff --git a/trunk/drivers/media/video/saa7115.c b/trunk/drivers/media/video/saa7115.c deleted file mode 100644 index e717e30d8187..000000000000 --- a/trunk/drivers/media/video/saa7115.c +++ /dev/null @@ -1,1378 +0,0 @@ -/* saa7115 - Philips SAA7114/SAA7115 video decoder driver - * - * Based on saa7114 driver by Maxim Yevtyushkin, which is based on - * the saa7111 driver by Dave Perks. - * - * Copyright (C) 1998 Dave Perks - * Copyright (C) 2002 Maxim Yevtyushkin - * - * Slight changes for video timing and attachment output by - * Wolfgang Scherr - * - * Moved over to the linux >= 2.4.x i2c protocol (1/1/2003) - * by Ronald Bultje - * - * Added saa7115 support by Kevin Thayer - * (2/17/2003) - * - * VBI support (2004) and cleanups (2005) by Hans Verkuil - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - - -#include -#include -#include -#include -#include -#include - -MODULE_DESCRIPTION("Philips SAA7114/SAA7115 video decoder driver"); -MODULE_AUTHOR("Maxim Yevtyushkin, Kevin Thayer, Chris Kennedy, Hans Verkuil"); -MODULE_LICENSE("GPL"); - -static int debug = 0; -module_param(debug, int, 0644); - -MODULE_PARM_DESC(debug, "Debug level (0-1)"); - -#define saa7115_dbg(fmt,arg...) \ - do { \ - if (debug) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); \ - } while (0) - -#define saa7115_err(fmt, arg...) do { \ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) -#define saa7115_info(fmt, arg...) do { \ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) - -static unsigned short normal_i2c[] = { 0x42 >> 1, 0x40 >> 1, I2C_CLIENT_END }; - - -I2C_CLIENT_INSMOD; - -struct saa7115_state { - v4l2_std_id std; - int input; - int enable; - int bright; - int contrast; - int hue; - int sat; - enum v4l2_chip_ident ident; - enum v4l2_audio_clock_freq audclk_freq; -}; - -/* ----------------------------------------------------------------------- */ - -static inline int saa7115_write(struct i2c_client *client, u8 reg, u8 value) -{ - return i2c_smbus_write_byte_data(client, reg, value); -} - -static int saa7115_writeregs(struct i2c_client *client, const unsigned char *regs) -{ - unsigned char reg, data; - - while (*regs != 0x00) { - reg = *(regs++); - data = *(regs++); - if (saa7115_write(client, reg, data) < 0) - return -1; - } - return 0; -} - -static inline int saa7115_read(struct i2c_client *client, u8 reg) -{ - return i2c_smbus_read_byte_data(client, reg); -} - -/* ----------------------------------------------------------------------- */ - -/* If a value differs from the Hauppauge driver values, then the comment starts with - 'was 0xXX' to denote the Hauppauge value. Otherwise the value is identical to what the - Hauppauge driver sets. */ - -static const unsigned char saa7115_init_auto_input[] = { - 0x01, 0x48, /* white peak control disabled */ - 0x03, 0x20, /* was 0x30. 0x20: long vertical blanking */ - 0x04, 0x90, /* analog gain set to 0 */ - 0x05, 0x90, /* analog gain set to 0 */ - 0x06, 0xeb, /* horiz sync begin = -21 */ - 0x07, 0xe0, /* horiz sync stop = -17 */ - 0x0a, 0x80, /* was 0x88. decoder brightness, 0x80 is itu standard */ - 0x0b, 0x44, /* was 0x48. decoder contrast, 0x44 is itu standard */ - 0x0c, 0x40, /* was 0x47. decoder saturation, 0x40 is itu standard */ - 0x0d, 0x00, /* chrominance hue control */ - 0x0f, 0x00, /* chrominance gain control: use automicatic mode */ - 0x10, 0x06, /* chrominance/luminance control: active adaptive combfilter */ - 0x11, 0x00, /* delay control */ - 0x12, 0x9d, /* RTS0 output control: VGATE */ - 0x13, 0x80, /* X-port output control: ITU656 standard mode, RTCO output enable RTCE */ - 0x14, 0x00, /* analog/ADC/auto compatibility control */ - 0x18, 0x40, /* raw data gain 0x00 = nominal */ - 0x19, 0x80, /* raw data offset 0x80 = 0 LSB */ - 0x1a, 0x77, /* color killer level control 0x77 = recommended */ - 0x1b, 0x42, /* misc chroma control 0x42 = recommended */ - 0x1c, 0xa9, /* combfilter control 0xA9 = recommended */ - 0x1d, 0x01, /* combfilter control 0x01 = recommended */ - 0x88, 0xd0, /* reset device */ - 0x88, 0xf0, /* set device programmed, all in operational mode */ - 0x00, 0x00 -}; - -static const unsigned char saa7115_cfg_reset_scaler[] = { - 0x87, 0x00, /* disable I-port output */ - 0x88, 0xd0, /* reset scaler */ - 0x88, 0xf0, /* activate scaler */ - 0x87, 0x01, /* enable I-port output */ - 0x00, 0x00 -}; - -/* ============== SAA7715 VIDEO templates ============= */ - -static const unsigned char saa7115_cfg_60hz_fullres_x[] = { - 0xcc, 0xd0, /* hsize low (output), hor. output window size = 0x2d0 = 720 */ - 0xcd, 0x02, /* hsize hi (output) */ - - /* Why not in 60hz-Land, too? */ - 0xd0, 0x01, /* downscale = 1 */ - 0xd8, 0x00, /* hor lum scaling 0x0400 = 1 */ - 0xd9, 0x04, - 0xdc, 0x00, /* hor chrom scaling 0x0200. must be hor lum scaling / 2 */ - 0xdd, 0x02, /* H-scaling incr chroma */ - - 0x00, 0x00 -}; -static const unsigned char saa7115_cfg_60hz_fullres_y[] = { - 0xce, 0xf8, /* vsize low (output), ver. output window size = 248 (but 60hz is 240?) */ - 0xcf, 0x00, /* vsize hi (output) */ - - /* Why not in 60hz-Land, too? */ - 0xd5, 0x40, /* Lum contrast, nominal value = 0x40 */ - 0xd6, 0x40, /* Chroma satur. nominal value = 0x80 */ - - 0xe0, 0x00, /* V-scaling incr luma low */ - 0xe1, 0x04, /* " hi */ - 0xe2, 0x00, /* V-scaling incr chroma low */ - 0xe3, 0x04, /* " hi */ - - 0x00, 0x00 -}; - -static const unsigned char saa7115_cfg_60hz_video[] = { - 0x80, 0x00, /* reset tasks */ - 0x88, 0xd0, /* reset scaler */ - - 0x15, 0x03, /* VGATE pulse start */ - 0x16, 0x11, /* VGATE pulse stop */ - 0x17, 0x9c, /* VGATE MSB and other values */ - - 0x08, 0x68, /* 0xBO: auto detection, 0x68 = NTSC */ - 0x0e, 0x07, /* lots of different stuff... video autodetection is on */ - - 0x5a, 0x06, /* Vertical offset, standard 60hz value for ITU656 line counting */ - - /* Task A */ - 0x90, 0x80, /* Task Handling Control */ - 0x91, 0x48, /* X-port formats/config */ - 0x92, 0x40, /* Input Ref. signal Def. */ - 0x93, 0x84, /* I-port config */ - 0x94, 0x01, /* hoffset low (input), 0x0002 is minimum */ - 0x95, 0x00, /* hoffset hi (input) */ - 0x96, 0xd0, /* hsize low (input), 0x02d0 = 720 */ - 0x97, 0x02, /* hsize hi (input) */ - 0x98, 0x05, /* voffset low (input) */ - 0x99, 0x00, /* voffset hi (input) */ - 0x9a, 0x0c, /* vsize low (input), 0x0c = 12 */ - 0x9b, 0x00, /* vsize hi (input) */ - 0x9c, 0xa0, /* hsize low (output), 0x05a0 = 1440 */ - 0x9d, 0x05, /* hsize hi (output) */ - 0x9e, 0x0c, /* vsize low (output), 0x0c = 12 */ - 0x9f, 0x00, /* vsize hi (output) */ - - /* Task B */ - 0xc0, 0x00, /* Task Handling Control */ - 0xc1, 0x08, /* X-port formats/config */ - 0xc2, 0x00, /* Input Ref. signal Def. */ - 0xc3, 0x80, /* I-port config */ - 0xc4, 0x02, /* hoffset low (input), 0x0002 is minimum */ - 0xc5, 0x00, /* hoffset hi (input) */ - 0xc6, 0xd0, /* hsize low (input), 0x02d0 = 720 */ - 0xc7, 0x02, /* hsize hi (input) */ - 0xc8, 0x12, /* voffset low (input), 0x12 = 18 */ - 0xc9, 0x00, /* voffset hi (input) */ - 0xca, 0xf8, /* vsize low (input), 0xf8 = 248 */ - 0xcb, 0x00, /* vsize hi (input) */ - 0xcc, 0xd0, /* hsize low (output), 0x02d0 = 720 */ - 0xcd, 0x02, /* hsize hi (output) */ - - 0xf0, 0xad, /* Set PLL Register. 60hz 525 lines per frame, 27 MHz */ - 0xf1, 0x05, /* low bit with 0xF0 */ - 0xf5, 0xad, /* Set pulse generator register */ - 0xf6, 0x01, - - 0x87, 0x00, /* Disable I-port output */ - 0x88, 0xd0, /* reset scaler */ - 0x80, 0x20, /* Activate only task "B", continuous mode (was 0xA0) */ - 0x88, 0xf0, /* activate scaler */ - 0x87, 0x01, /* Enable I-port output */ - 0x00, 0x00 -}; - -static const unsigned char saa7115_cfg_50hz_fullres_x[] = { - 0xcc, 0xd0, /* hsize low (output), 720 same as 60hz */ - 0xcd, 0x02, /* hsize hi (output) */ - - 0xd0, 0x01, /* down scale = 1 */ - 0xd8, 0x00, /* hor lum scaling 0x0400 = 1 */ - 0xd9, 0x04, - 0xdc, 0x00, /* hor chrom scaling 0x0200. must be hor lum scaling / 2 */ - 0xdd, 0x02, /* H-scaling incr chroma */ - - 0x00, 0x00 -}; -static const unsigned char saa7115_cfg_50hz_fullres_y[] = { - 0xce, 0x20, /* vsize low (output), 0x0120 = 288 */ - 0xcf, 0x01, /* vsize hi (output) */ - - 0xd5, 0x40, /* Lum contrast, nominal value = 0x40 */ - 0xd6, 0x40, /* Chroma satur. nominal value = 0x80 */ - - 0xe0, 0x00, /* V-scaling incr luma low */ - 0xe1, 0x04, /* " hi */ - 0xe2, 0x00, /* V-scaling incr chroma low */ - 0xe3, 0x04, /* " hi */ - - 0x00, 0x00 -}; - -static const unsigned char saa7115_cfg_50hz_video[] = { - 0x80, 0x00, /* reset tasks */ - 0x88, 0xd0, /* reset scaler */ - - 0x15, 0x37, /* VGATE start */ - 0x16, 0x16, /* VGATE stop */ - 0x17, 0x99, /* VGATE MSB and other values */ - - 0x08, 0x28, /* 0x28 = PAL */ - 0x0e, 0x07, /* chrominance control 1 */ - - 0x5a, 0x03, /* Vertical offset, standard 50hz value */ - - /* Task A */ - 0x90, 0x81, /* Task Handling Control */ - 0x91, 0x48, /* X-port formats/config */ - 0x92, 0x40, /* Input Ref. signal Def. */ - 0x93, 0x84, /* I-port config */ - /* This is weird: the datasheet says that you should use 2 as the minimum value, */ - /* but Hauppauge uses 0, and changing that to 2 causes indeed problems (for 50hz) */ - 0x94, 0x00, /* hoffset low (input), 0x0002 is minimum */ - 0x95, 0x00, /* hoffset hi (input) */ - 0x96, 0xd0, /* hsize low (input), 0x02d0 = 720 */ - 0x97, 0x02, /* hsize hi (input) */ - 0x98, 0x03, /* voffset low (input) */ - 0x99, 0x00, /* voffset hi (input) */ - 0x9a, 0x12, /* vsize low (input), 0x12 = 18 */ - 0x9b, 0x00, /* vsize hi (input) */ - 0x9c, 0xa0, /* hsize low (output), 0x05a0 = 1440 */ - 0x9d, 0x05, /* hsize hi (output) */ - 0x9e, 0x12, /* vsize low (output), 0x12 = 18 */ - 0x9f, 0x00, /* vsize hi (output) */ - - /* Task B */ - 0xc0, 0x00, /* Task Handling Control */ - 0xc1, 0x08, /* X-port formats/config */ - 0xc2, 0x00, /* Input Ref. signal Def. */ - 0xc3, 0x80, /* I-port config */ - 0xc4, 0x00, /* hoffset low (input), 0x0002 is minimum. See comment at 0x94 above. */ - 0xc5, 0x00, /* hoffset hi (input) */ - 0xc6, 0xd0, /* hsize low (input), 0x02d0 = 720 */ - 0xc7, 0x02, /* hsize hi (input) */ - 0xc8, 0x16, /* voffset low (input), 0x16 = 22 */ - 0xc9, 0x00, /* voffset hi (input) */ - 0xca, 0x20, /* vsize low (input), 0x0120 = 288 */ - 0xcb, 0x01, /* vsize hi (input) */ - 0xcc, 0xd0, /* hsize low (output), 0x02d0 = 720 */ - 0xcd, 0x02, /* hsize hi (output) */ - 0xce, 0x20, /* vsize low (output), 0x0120 = 288 */ - 0xcf, 0x01, /* vsize hi (output) */ - - 0xf0, 0xb0, /* Set PLL Register. 50hz 625 lines per frame, 27 MHz */ - 0xf1, 0x05, /* low bit with 0xF0, (was 0x05) */ - 0xf5, 0xb0, /* Set pulse generator register */ - 0xf6, 0x01, - - 0x87, 0x00, /* Disable I-port output */ - 0x88, 0xd0, /* reset scaler (was 0xD0) */ - 0x80, 0x20, /* Activate only task "B" */ - 0x88, 0xf0, /* activate scaler */ - 0x87, 0x01, /* Enable I-port output */ - 0x00, 0x00 -}; - -/* ============== SAA7715 VIDEO templates (end) ======= */ - -static const unsigned char saa7115_cfg_vbi_on[] = { - 0x80, 0x00, /* reset tasks */ - 0x88, 0xd0, /* reset scaler */ - 0x80, 0x30, /* Activate both tasks */ - 0x88, 0xf0, /* activate scaler */ - 0x87, 0x01, /* Enable I-port output */ - 0x00, 0x00 -}; - -static const unsigned char saa7115_cfg_vbi_off[] = { - 0x80, 0x00, /* reset tasks */ - 0x88, 0xd0, /* reset scaler */ - 0x80, 0x20, /* Activate only task "B" */ - 0x88, 0xf0, /* activate scaler */ - 0x87, 0x01, /* Enable I-port output */ - 0x00, 0x00 -}; - -static const unsigned char saa7115_init_misc[] = { - 0x38, 0x03, /* audio stuff */ - 0x39, 0x10, - 0x3a, 0x08, - - 0x81, 0x01, /* reg 0x15,0x16 define blanking window */ - 0x82, 0x00, - 0x83, 0x01, /* I port settings */ - 0x84, 0x20, - 0x85, 0x21, - 0x86, 0xc5, - 0x87, 0x01, - - /* Task A */ - 0xa0, 0x01, /* down scale = 1 */ - 0xa1, 0x00, /* prescale accumulation length = 1 */ - 0xa2, 0x00, /* dc gain and fir prefilter control */ - 0xa4, 0x80, /* Lum Brightness, nominal value = 0x80 */ - 0xa5, 0x40, /* Lum contrast, nominal value = 0x40 */ - 0xa6, 0x40, /* Chroma satur. nominal value = 0x80 */ - 0xa8, 0x00, /* hor lum scaling 0x0200 = 2 zoom */ - 0xa9, 0x02, /* note: 2 x zoom ensures that VBI lines have same length as video lines. */ - 0xaa, 0x00, /* H-phase offset Luma = 0 */ - 0xac, 0x00, /* hor chrom scaling 0x0200. must be hor lum scaling / 2 */ - 0xad, 0x01, /* H-scaling incr chroma */ - 0xae, 0x00, /* H-phase offset chroma. must be offset luma / 2 */ - - 0xb0, 0x00, /* V-scaling incr luma low */ - 0xb1, 0x04, /* " hi */ - 0xb2, 0x00, /* V-scaling incr chroma low */ - 0xb3, 0x04, /* " hi */ - 0xb4, 0x01, /* V-scaling mode control */ - 0xb8, 0x00, /* V-phase offset chroma 00 */ - 0xb9, 0x00, /* V-phase offset chroma 01 */ - 0xba, 0x00, /* V-phase offset chroma 10 */ - 0xbb, 0x00, /* V-phase offset chroma 11 */ - 0xbc, 0x00, /* V-phase offset luma 00 */ - 0xbd, 0x00, /* V-phase offset luma 01 */ - 0xbe, 0x00, /* V-phase offset luma 10 */ - 0xbf, 0x00, /* V-phase offset luma 11 */ - - /* Task B */ - 0xd0, 0x01, /* down scale = 1 */ - 0xd1, 0x00, /* prescale accumulation length = 1 */ - 0xd2, 0x00, /* dc gain and fir prefilter control */ - 0xd4, 0x80, /* Lum Brightness, nominal value = 0x80 */ - 0xd5, 0x40, /* Lum contrast, nominal value = 0x40 */ - 0xd6, 0x40, /* Chroma satur. nominal value = 0x80 */ - 0xd8, 0x00, /* hor lum scaling 0x0400 = 1 */ - 0xd9, 0x04, - 0xda, 0x00, /* H-phase offset Luma = 0 */ - 0xdc, 0x00, /* hor chrom scaling 0x0200. must be hor lum scaling / 2 */ - 0xdd, 0x02, /* H-scaling incr chroma */ - 0xde, 0x00, /* H-phase offset chroma. must be offset luma / 2 */ - - 0xe0, 0x00, /* V-scaling incr luma low */ - 0xe1, 0x04, /* " hi */ - 0xe2, 0x00, /* V-scaling incr chroma low */ - 0xe3, 0x04, /* " hi */ - 0xe4, 0x01, /* V-scaling mode control */ - 0xe8, 0x00, /* V-phase offset chroma 00 */ - 0xe9, 0x00, /* V-phase offset chroma 01 */ - 0xea, 0x00, /* V-phase offset chroma 10 */ - 0xeb, 0x00, /* V-phase offset chroma 11 */ - 0xec, 0x00, /* V-phase offset luma 00 */ - 0xed, 0x00, /* V-phase offset luma 01 */ - 0xee, 0x00, /* V-phase offset luma 10 */ - 0xef, 0x00, /* V-phase offset luma 11 */ - - 0xf2, 0x50, /* crystal clock = 24.576 MHz, target = 27MHz */ - 0xf3, 0x46, - 0xf4, 0x00, - 0xf7, 0x4b, /* not the recommended settings! */ - 0xf8, 0x00, - 0xf9, 0x4b, - 0xfa, 0x00, - 0xfb, 0x4b, - 0xff, 0x88, /* PLL2 lock detection settings: 71 lines 50% phase error */ - - /* Turn off VBI */ - 0x40, 0x20, /* No framing code errors allowed. */ - 0x41, 0xff, - 0x42, 0xff, - 0x43, 0xff, - 0x44, 0xff, - 0x45, 0xff, - 0x46, 0xff, - 0x47, 0xff, - 0x48, 0xff, - 0x49, 0xff, - 0x4a, 0xff, - 0x4b, 0xff, - 0x4c, 0xff, - 0x4d, 0xff, - 0x4e, 0xff, - 0x4f, 0xff, - 0x50, 0xff, - 0x51, 0xff, - 0x52, 0xff, - 0x53, 0xff, - 0x54, 0xff, - 0x55, 0xff, - 0x56, 0xff, - 0x57, 0xff, - 0x58, 0x40, - 0x59, 0x47, - 0x5b, 0x83, - 0x5d, 0xbd, - 0x5e, 0x35, - - 0x02, 0x84, /* input tuner -> input 4, amplifier active */ - 0x09, 0x53, /* 0x53, was 0x56 for 60hz. luminance control */ - - 0x80, 0x20, /* enable task B */ - 0x88, 0xd0, - 0x88, 0xf0, - 0x00, 0x00 -}; - -/* ============== SAA7715 AUDIO settings ============= */ - -/* 48.0 kHz */ -static const unsigned char saa7115_cfg_48_audio[] = { - 0x34, 0xce, - 0x35, 0xfb, - 0x36, 0x30, - 0x00, 0x00 -}; - -/* 44.1 kHz */ -static const unsigned char saa7115_cfg_441_audio[] = { - 0x34, 0xf2, - 0x35, 0x00, - 0x36, 0x2d, - 0x00, 0x00 -}; - -/* 32.0 kHz */ -static const unsigned char saa7115_cfg_32_audio[] = { - 0x34, 0xdf, - 0x35, 0xa7, - 0x36, 0x20, - 0x00, 0x00 -}; - -/* 48.0 kHz 60hz */ -static const unsigned char saa7115_cfg_60hz_48_audio[] = { - 0x30, 0xcd, - 0x31, 0x20, - 0x32, 0x03, - 0x00, 0x00 -}; - -/* 48.0 kHz 50hz */ -static const unsigned char saa7115_cfg_50hz_48_audio[] = { - 0x30, 0x00, - 0x31, 0xc0, - 0x32, 0x03, - 0x00, 0x00 -}; - -/* 44.1 kHz 60hz */ -static const unsigned char saa7115_cfg_60hz_441_audio[] = { - 0x30, 0xbc, - 0x31, 0xdf, - 0x32, 0x02, - 0x00, 0x00 -}; - -/* 44.1 kHz 50hz */ -static const unsigned char saa7115_cfg_50hz_441_audio[] = { - 0x30, 0x00, - 0x31, 0x72, - 0x32, 0x03, - 0x00, 0x00 -}; - -/* 32.0 kHz 60hz */ -static const unsigned char saa7115_cfg_60hz_32_audio[] = { - 0x30, 0xde, - 0x31, 0x15, - 0x32, 0x02, - 0x00, 0x00 -}; - -/* 32.0 kHz 50hz */ -static const unsigned char saa7115_cfg_50hz_32_audio[] = { - 0x30, 0x00, - 0x31, 0x80, - 0x32, 0x02, - 0x00, 0x00 -}; - -static int saa7115_odd_parity(u8 c) -{ - c ^= (c >> 4); - c ^= (c >> 2); - c ^= (c >> 1); - - return c & 1; -} - -static int saa7115_decode_vps(u8 * dst, u8 * p) -{ - static const u8 biphase_tbl[] = { - 0xf0, 0x78, 0x70, 0xf0, 0xb4, 0x3c, 0x34, 0xb4, - 0xb0, 0x38, 0x30, 0xb0, 0xf0, 0x78, 0x70, 0xf0, - 0xd2, 0x5a, 0x52, 0xd2, 0x96, 0x1e, 0x16, 0x96, - 0x92, 0x1a, 0x12, 0x92, 0xd2, 0x5a, 0x52, 0xd2, - 0xd0, 0x58, 0x50, 0xd0, 0x94, 0x1c, 0x14, 0x94, - 0x90, 0x18, 0x10, 0x90, 0xd0, 0x58, 0x50, 0xd0, - 0xf0, 0x78, 0x70, 0xf0, 0xb4, 0x3c, 0x34, 0xb4, - 0xb0, 0x38, 0x30, 0xb0, 0xf0, 0x78, 0x70, 0xf0, - 0xe1, 0x69, 0x61, 0xe1, 0xa5, 0x2d, 0x25, 0xa5, - 0xa1, 0x29, 0x21, 0xa1, 0xe1, 0x69, 0x61, 0xe1, - 0xc3, 0x4b, 0x43, 0xc3, 0x87, 0x0f, 0x07, 0x87, - 0x83, 0x0b, 0x03, 0x83, 0xc3, 0x4b, 0x43, 0xc3, - 0xc1, 0x49, 0x41, 0xc1, 0x85, 0x0d, 0x05, 0x85, - 0x81, 0x09, 0x01, 0x81, 0xc1, 0x49, 0x41, 0xc1, - 0xe1, 0x69, 0x61, 0xe1, 0xa5, 0x2d, 0x25, 0xa5, - 0xa1, 0x29, 0x21, 0xa1, 0xe1, 0x69, 0x61, 0xe1, - 0xe0, 0x68, 0x60, 0xe0, 0xa4, 0x2c, 0x24, 0xa4, - 0xa0, 0x28, 0x20, 0xa0, 0xe0, 0x68, 0x60, 0xe0, - 0xc2, 0x4a, 0x42, 0xc2, 0x86, 0x0e, 0x06, 0x86, - 0x82, 0x0a, 0x02, 0x82, 0xc2, 0x4a, 0x42, 0xc2, - 0xc0, 0x48, 0x40, 0xc0, 0x84, 0x0c, 0x04, 0x84, - 0x80, 0x08, 0x00, 0x80, 0xc0, 0x48, 0x40, 0xc0, - 0xe0, 0x68, 0x60, 0xe0, 0xa4, 0x2c, 0x24, 0xa4, - 0xa0, 0x28, 0x20, 0xa0, 0xe0, 0x68, 0x60, 0xe0, - 0xf0, 0x78, 0x70, 0xf0, 0xb4, 0x3c, 0x34, 0xb4, - 0xb0, 0x38, 0x30, 0xb0, 0xf0, 0x78, 0x70, 0xf0, - 0xd2, 0x5a, 0x52, 0xd2, 0x96, 0x1e, 0x16, 0x96, - 0x92, 0x1a, 0x12, 0x92, 0xd2, 0x5a, 0x52, 0xd2, - 0xd0, 0x58, 0x50, 0xd0, 0x94, 0x1c, 0x14, 0x94, - 0x90, 0x18, 0x10, 0x90, 0xd0, 0x58, 0x50, 0xd0, - 0xf0, 0x78, 0x70, 0xf0, 0xb4, 0x3c, 0x34, 0xb4, - 0xb0, 0x38, 0x30, 0xb0, 0xf0, 0x78, 0x70, 0xf0, - }; - int i; - u8 c, err = 0; - - for (i = 0; i < 2 * 13; i += 2) { - err |= biphase_tbl[p[i]] | biphase_tbl[p[i + 1]]; - c = (biphase_tbl[p[i + 1]] & 0xf) | ((biphase_tbl[p[i]] & 0xf) << 4); - dst[i / 2] = c; - } - return err & 0xf0; -} - -static int saa7115_decode_wss(u8 * p) -{ - static const int wss_bits[8] = { - 0, 0, 0, 1, 0, 1, 1, 1 - }; - unsigned char parity; - int wss = 0; - int i; - - for (i = 0; i < 16; i++) { - int b1 = wss_bits[p[i] & 7]; - int b2 = wss_bits[(p[i] >> 3) & 7]; - - if (b1 == b2) - return -1; - wss |= b2 << i; - } - parity = wss & 15; - parity ^= parity >> 2; - parity ^= parity >> 1; - - if (!(parity & 1)) - return -1; - - return wss; -} - - -static int saa7115_set_audio_clock_freq(struct i2c_client *client, enum v4l2_audio_clock_freq freq) -{ - struct saa7115_state *state = i2c_get_clientdata(client); - - saa7115_dbg("set audio clock freq: %d\n", freq); - switch (freq) { - case V4L2_AUDCLK_32_KHZ: - saa7115_writeregs(client, saa7115_cfg_32_audio); - if (state->std & V4L2_STD_525_60) { - saa7115_writeregs(client, saa7115_cfg_60hz_32_audio); - } else { - saa7115_writeregs(client, saa7115_cfg_50hz_32_audio); - } - break; - case V4L2_AUDCLK_441_KHZ: - saa7115_writeregs(client, saa7115_cfg_441_audio); - if (state->std & V4L2_STD_525_60) { - saa7115_writeregs(client, saa7115_cfg_60hz_441_audio); - } else { - saa7115_writeregs(client, saa7115_cfg_50hz_441_audio); - } - break; - case V4L2_AUDCLK_48_KHZ: - saa7115_writeregs(client, saa7115_cfg_48_audio); - if (state->std & V4L2_STD_525_60) { - saa7115_writeregs(client, saa7115_cfg_60hz_48_audio); - } else { - saa7115_writeregs(client, saa7115_cfg_50hz_48_audio); - } - break; - default: - saa7115_dbg("invalid audio setting %d\n", freq); - return -EINVAL; - } - state->audclk_freq = freq; - return 0; -} - -static int saa7115_set_v4lctrl(struct i2c_client *client, struct v4l2_control *ctrl) -{ - struct saa7115_state *state = i2c_get_clientdata(client); - - switch (ctrl->id) { - case V4L2_CID_BRIGHTNESS: - if (ctrl->value < 0 || ctrl->value > 255) { - saa7115_err("invalid brightness setting %d\n", ctrl->value); - return -ERANGE; - } - - state->bright = ctrl->value; - saa7115_write(client, 0x0a, state->bright); - break; - - case V4L2_CID_CONTRAST: - if (ctrl->value < 0 || ctrl->value > 127) { - saa7115_err("invalid contrast setting %d\n", ctrl->value); - return -ERANGE; - } - - state->contrast = ctrl->value; - saa7115_write(client, 0x0b, state->contrast); - break; - - case V4L2_CID_SATURATION: - if (ctrl->value < 0 || ctrl->value > 127) { - saa7115_err("invalid saturation setting %d\n", ctrl->value); - return -ERANGE; - } - - state->sat = ctrl->value; - saa7115_write(client, 0x0c, state->sat); - break; - - case V4L2_CID_HUE: - if (ctrl->value < -127 || ctrl->value > 127) { - saa7115_err("invalid hue setting %d\n", ctrl->value); - return -ERANGE; - } - - state->hue = ctrl->value; - saa7115_write(client, 0x0d, state->hue); - break; - } - - return 0; -} - -static int saa7115_get_v4lctrl(struct i2c_client *client, struct v4l2_control *ctrl) -{ - struct saa7115_state *state = i2c_get_clientdata(client); - - switch (ctrl->id) { - case V4L2_CID_BRIGHTNESS: - ctrl->value = state->bright; - break; - case V4L2_CID_CONTRAST: - ctrl->value = state->contrast; - break; - case V4L2_CID_SATURATION: - ctrl->value = state->sat; - break; - case V4L2_CID_HUE: - ctrl->value = state->hue; - break; - default: - return -EINVAL; - } - - return 0; -} - -static void saa7115_set_v4lstd(struct i2c_client *client, v4l2_std_id std) -{ - struct saa7115_state *state = i2c_get_clientdata(client); - int taskb = saa7115_read(client, 0x80) & 0x10; - - // This works for NTSC-M, SECAM-L and the 50Hz PAL variants. - if (std & V4L2_STD_525_60) { - saa7115_dbg("decoder set standard 60 Hz\n"); - saa7115_writeregs(client, saa7115_cfg_60hz_video); - } else { - saa7115_dbg("decoder set standard 50 Hz\n"); - saa7115_writeregs(client, saa7115_cfg_50hz_video); - } - - state->std = std; - - /* restart task B if needed */ - if (taskb && state->ident == V4L2_IDENT_SAA7114) { - saa7115_writeregs(client, saa7115_cfg_vbi_on); - } - - /* switch audio mode too! */ - saa7115_set_audio_clock_freq(client, state->audclk_freq); -} - -static v4l2_std_id saa7115_get_v4lstd(struct i2c_client *client) -{ - struct saa7115_state *state = i2c_get_clientdata(client); - - return state->std; -} - -static void saa7115_log_status(struct i2c_client *client) -{ - struct saa7115_state *state = i2c_get_clientdata(client); - char *audfreq = "undefined"; - int reg1e, reg1f; - int signalOk; - int vcr; - - switch (state->audclk_freq) { - case V4L2_AUDCLK_32_KHZ: audfreq = "32 kHz"; break; - case V4L2_AUDCLK_441_KHZ: audfreq = "44.1 kHz"; break; - case V4L2_AUDCLK_48_KHZ: audfreq = "48 kHz"; break; - } - - saa7115_info("Audio frequency: %s\n", audfreq); - if (client->name[6] == '4') { - /* status for the saa7114 */ - reg1f = saa7115_read(client, 0x1f); - signalOk = (reg1f & 0xc1) == 0x81; - saa7115_info("Video signal: %s\n", signalOk ? "ok" : "bad"); - saa7115_info("Frequency: %s\n", (reg1f & 0x20) ? "60Hz" : "50Hz"); - return; - } - - /* status for the saa7115 */ - reg1e = saa7115_read(client, 0x1e); - reg1f = saa7115_read(client, 0x1f); - - signalOk = (reg1f & 0xc1) == 0x81 && (reg1e & 0xc0) == 0x80; - vcr = !(reg1f & 0x10); - - saa7115_info("Video signal: %s\n", signalOk ? (vcr ? "VCR" : "broadcast/DVD") : "bad"); - saa7115_info("Frequency: %s\n", (reg1f & 0x20) ? "60Hz" : "50Hz"); - - switch (reg1e & 0x03) { - case 1: - saa7115_info("Detected format: NTSC\n"); - break; - case 2: - saa7115_info("Detected format: PAL\n"); - break; - case 3: - saa7115_info("Detected format: SECAM\n"); - break; - default: - saa7115_info("Detected format: BW/No color\n"); - break; - } -} - -/* setup the sliced VBI lcr registers according to the sliced VBI format */ -static void saa7115_set_lcr(struct i2c_client *client, struct v4l2_sliced_vbi_format *fmt) -{ - struct saa7115_state *state = i2c_get_clientdata(client); - int is_50hz = (state->std & V4L2_STD_625_50); - u8 lcr[24]; - int i, x; - - /* saa7114 doesn't yet support VBI */ - if (state->ident == V4L2_IDENT_SAA7114) - return; - - for (i = 0; i <= 23; i++) - lcr[i] = 0xff; - - if (fmt->service_set == 0) { - /* raw VBI */ - if (is_50hz) - for (i = 6; i <= 23; i++) - lcr[i] = 0xdd; - else - for (i = 10; i <= 21; i++) - lcr[i] = 0xdd; - } else { - /* sliced VBI */ - /* first clear lines that cannot be captured */ - if (is_50hz) { - for (i = 0; i <= 5; i++) - fmt->service_lines[0][i] = - fmt->service_lines[1][i] = 0; - } - else { - for (i = 0; i <= 9; i++) - fmt->service_lines[0][i] = - fmt->service_lines[1][i] = 0; - for (i = 22; i <= 23; i++) - fmt->service_lines[0][i] = - fmt->service_lines[1][i] = 0; - } - - /* Now set the lcr values according to the specified service */ - for (i = 6; i <= 23; i++) { - lcr[i] = 0; - for (x = 0; x <= 1; x++) { - switch (fmt->service_lines[1-x][i]) { - case 0: - lcr[i] |= 0xf << (4 * x); - break; - case V4L2_SLICED_TELETEXT_B: - lcr[i] |= 1 << (4 * x); - break; - case V4L2_SLICED_CAPTION_525: - lcr[i] |= 4 << (4 * x); - break; - case V4L2_SLICED_WSS_625: - lcr[i] |= 5 << (4 * x); - break; - case V4L2_SLICED_VPS: - lcr[i] |= 7 << (4 * x); - break; - } - } - } - } - - /* write the lcr registers */ - for (i = 2; i <= 23; i++) { - saa7115_write(client, i - 2 + 0x41, lcr[i]); - } - - /* enable/disable raw VBI capturing */ - saa7115_writeregs(client, fmt->service_set == 0 ? saa7115_cfg_vbi_on : saa7115_cfg_vbi_off); -} - -static int saa7115_get_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt) -{ - static u16 lcr2vbi[] = { - 0, V4L2_SLICED_TELETEXT_B, 0, /* 1 */ - 0, V4L2_SLICED_CAPTION_525, /* 4 */ - V4L2_SLICED_WSS_625, 0, /* 5 */ - V4L2_SLICED_VPS, 0, 0, 0, 0, /* 7 */ - 0, 0, 0, 0 - }; - struct v4l2_sliced_vbi_format *sliced = &fmt->fmt.sliced; - int i; - - if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) - return -EINVAL; - memset(sliced, 0, sizeof(*sliced)); - /* done if using raw VBI */ - if (saa7115_read(client, 0x80) & 0x10) - return 0; - for (i = 2; i <= 23; i++) { - u8 v = saa7115_read(client, i - 2 + 0x41); - - sliced->service_lines[0][i] = lcr2vbi[v >> 4]; - sliced->service_lines[1][i] = lcr2vbi[v & 0xf]; - sliced->service_set |= - sliced->service_lines[0][i] | sliced->service_lines[1][i]; - } - return 0; -} - -static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt) -{ - struct saa7115_state *state = i2c_get_clientdata(client); - struct v4l2_pix_format *pix; - int HPSC, HFSC; - int VSCY, Vsrc; - int is_50hz = state->std & V4L2_STD_625_50; - - if (fmt->type == V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) { - saa7115_set_lcr(client, &fmt->fmt.sliced); - return 0; - } - if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) - return -EINVAL; - - pix = &(fmt->fmt.pix); - - saa7115_dbg("decoder set size\n"); - - /* FIXME need better bounds checking here */ - if ((pix->width < 1) || (pix->width > 1440)) - return -EINVAL; - if ((pix->height < 1) || (pix->height > 960)) - return -EINVAL; - - /* probably have a valid size, let's set it */ - /* Set output width/height */ - /* width */ - saa7115_write(client, 0xcc, (u8) (pix->width & 0xff)); - saa7115_write(client, 0xcd, (u8) ((pix->width >> 8) & 0xff)); - /* height */ - saa7115_write(client, 0xce, (u8) (pix->height & 0xff)); - saa7115_write(client, 0xcf, (u8) ((pix->height >> 8) & 0xff)); - - /* Scaling settings */ - /* Hprescaler is floor(inres/outres) */ - /* FIXME hardcoding input res */ - if (pix->width != 720) { - HPSC = (int)(720 / pix->width); - /* 0 is not allowed (div. by zero) */ - HPSC = HPSC ? HPSC : 1; - HFSC = (int)((1024 * 720) / (HPSC * pix->width)); - - saa7115_dbg("Hpsc: 0x%05x, Hfsc: 0x%05x\n", HPSC, HFSC); - /* FIXME hardcodes to "Task B" - * write H prescaler integer */ - saa7115_write(client, 0xd0, (u8) (HPSC & 0x3f)); - - /* write H fine-scaling (luminance) */ - saa7115_write(client, 0xd8, (u8) (HFSC & 0xff)); - saa7115_write(client, 0xd9, (u8) ((HFSC >> 8) & 0xff)); - /* write H fine-scaling (chrominance) - * must be lum/2, so i'll just bitshift :) */ - saa7115_write(client, 0xDC, (u8) ((HFSC >> 1) & 0xff)); - saa7115_write(client, 0xDD, (u8) ((HFSC >> 9) & 0xff)); - } else { - if (is_50hz) { - saa7115_dbg("Setting full 50hz width\n"); - saa7115_writeregs(client, saa7115_cfg_50hz_fullres_x); - } else { - saa7115_dbg("Setting full 60hz width\n"); - saa7115_writeregs(client, saa7115_cfg_60hz_fullres_x); - } - } - - Vsrc = is_50hz ? 576 : 480; - - if (pix->height != Vsrc) { - VSCY = (int)((1024 * Vsrc) / pix->height); - saa7115_dbg("Vsrc: %d, Vscy: 0x%05x\n", Vsrc, VSCY); - - /* Correct Contrast and Luminance */ - saa7115_write(client, 0xd5, (u8) (64 * 1024 / VSCY)); - saa7115_write(client, 0xd6, (u8) (64 * 1024 / VSCY)); - - /* write V fine-scaling (luminance) */ - saa7115_write(client, 0xe0, (u8) (VSCY & 0xff)); - saa7115_write(client, 0xe1, (u8) ((VSCY >> 8) & 0xff)); - /* write V fine-scaling (chrominance) */ - saa7115_write(client, 0xe2, (u8) (VSCY & 0xff)); - saa7115_write(client, 0xe3, (u8) ((VSCY >> 8) & 0xff)); - } else { - if (is_50hz) { - saa7115_dbg("Setting full 50Hz height\n"); - saa7115_writeregs(client, saa7115_cfg_50hz_fullres_y); - } else { - saa7115_dbg("Setting full 60hz height\n"); - saa7115_writeregs(client, saa7115_cfg_60hz_fullres_y); - } - } - - saa7115_writeregs(client, saa7115_cfg_reset_scaler); - return 0; -} - -/* Decode the sliced VBI data stream as created by the saa7115. - The format is described in the saa7115 datasheet in Tables 25 and 26 - and in Figure 33. - The current implementation uses SAV/EAV codes and not the ancillary data - headers. The vbi->p pointer points to the SDID byte right after the SAV - code. */ -static void saa7115_decode_vbi_line(struct i2c_client *client, - struct v4l2_decode_vbi_line *vbi) -{ - static const char vbi_no_data_pattern[] = { - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0 - }; - struct saa7115_state *state = i2c_get_clientdata(client); - u8 *p = vbi->p; - u32 wss; - int id1, id2; /* the ID1 and ID2 bytes from the internal header */ - - vbi->type = 0; /* mark result as a failure */ - id1 = p[2]; - id2 = p[3]; - /* Note: the field bit is inverted for 60 Hz video */ - if (state->std & V4L2_STD_525_60) - id1 ^= 0x40; - - /* Skip internal header, p now points to the start of the payload */ - p += 4; - vbi->p = p; - - /* calculate field and line number of the VBI packet (1-23) */ - vbi->is_second_field = ((id1 & 0x40) != 0); - vbi->line = (id1 & 0x3f) << 3; - vbi->line |= (id2 & 0x70) >> 4; - - /* Obtain data type */ - id2 &= 0xf; - - /* If the VBI slicer does not detect any signal it will fill up - the payload buffer with 0xa0 bytes. */ - if (!memcmp(p, vbi_no_data_pattern, sizeof(vbi_no_data_pattern))) - return; - - /* decode payloads */ - switch (id2) { - case 1: - vbi->type = V4L2_SLICED_TELETEXT_B; - break; - case 4: - if (!saa7115_odd_parity(p[0]) || !saa7115_odd_parity(p[1])) - return; - vbi->type = V4L2_SLICED_CAPTION_525; - break; - case 5: - wss = saa7115_decode_wss(p); - if (wss == -1) - return; - p[0] = wss & 0xff; - p[1] = wss >> 8; - vbi->type = V4L2_SLICED_WSS_625; - break; - case 7: - if (saa7115_decode_vps(p, p) != 0) - return; - vbi->type = V4L2_SLICED_VPS; - break; - default: - return; - } -} - -/* ============ SAA7115 AUDIO settings (end) ============= */ - -static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *arg) -{ - struct saa7115_state *state = i2c_get_clientdata(client); - int *iarg = arg; - - /* ioctls to allow direct access to the saa7115 registers for testing */ - switch (cmd) { - case VIDIOC_S_FMT: - return saa7115_set_v4lfmt(client, (struct v4l2_format *)arg); - - case VIDIOC_G_FMT: - return saa7115_get_v4lfmt(client, (struct v4l2_format *)arg); - - case VIDIOC_INT_AUDIO_CLOCK_FREQ: - return saa7115_set_audio_clock_freq(client, *(enum v4l2_audio_clock_freq *)arg); - - case VIDIOC_G_TUNER: - { - struct v4l2_tuner *vt = arg; - int status; - - status = saa7115_read(client, 0x1f); - - saa7115_dbg("status: 0x%02x\n", status); - vt->signal = ((status & (1 << 6)) == 0) ? 0xffff : 0x0; - break; - } - - case VIDIOC_LOG_STATUS: - saa7115_log_status(client); - break; - - case VIDIOC_G_CTRL: - return saa7115_get_v4lctrl(client, (struct v4l2_control *)arg); - - case VIDIOC_S_CTRL: - return saa7115_set_v4lctrl(client, (struct v4l2_control *)arg); - - case VIDIOC_G_STD: - *(v4l2_std_id *)arg = saa7115_get_v4lstd(client); - break; - - case VIDIOC_S_STD: - saa7115_set_v4lstd(client, *(v4l2_std_id *)arg); - break; - - case VIDIOC_G_INPUT: - *(int *)arg = state->input; - break; - - case VIDIOC_S_INPUT: - saa7115_dbg("decoder set input %d\n", *iarg); - /* inputs from 0-9 are available */ - if (*iarg < 0 || *iarg > 9) { - return -EINVAL; - } - - if (state->input == *iarg) - break; - saa7115_dbg("now setting %s input\n", - *iarg >= 6 ? "S-Video" : "Composite"); - state->input = *iarg; - - /* select mode */ - saa7115_write(client, 0x02, - (saa7115_read(client, 0x02) & 0xf0) | - state->input); - - /* bypass chrominance trap for modes 6..9 */ - saa7115_write(client, 0x09, - (saa7115_read(client, 0x09) & 0x7f) | - (state->input < 6 ? 0x0 : 0x80)); - break; - - case VIDIOC_STREAMON: - case VIDIOC_STREAMOFF: - saa7115_dbg("%s output\n", - (cmd == VIDIOC_STREAMON) ? "enable" : "disable"); - - if (state->enable != (cmd == VIDIOC_STREAMON)) { - state->enable = (cmd == VIDIOC_STREAMON); - saa7115_write(client, 0x87, state->enable); - } - break; - - case VIDIOC_INT_DECODE_VBI_LINE: - saa7115_decode_vbi_line(client, arg); - break; - - case VIDIOC_INT_RESET: - saa7115_dbg("decoder RESET\n"); - saa7115_writeregs(client, saa7115_cfg_reset_scaler); - break; - - case VIDIOC_INT_G_VBI_DATA: - { - struct v4l2_sliced_vbi_data *data = arg; - - switch (data->id) { - case V4L2_SLICED_WSS_625: - if (saa7115_read(client, 0x6b) & 0xc0) - return -EIO; - data->data[0] = saa7115_read(client, 0x6c); - data->data[1] = saa7115_read(client, 0x6d); - return 0; - case V4L2_SLICED_CAPTION_525: - if (data->field == 0) { - /* CC */ - if (saa7115_read(client, 0x66) & 0xc0) - return -EIO; - data->data[0] = saa7115_read(client, 0x67); - data->data[1] = saa7115_read(client, 0x68); - return 0; - } - /* XDS */ - if (saa7115_read(client, 0x66) & 0x30) - return -EIO; - data->data[0] = saa7115_read(client, 0x69); - data->data[1] = saa7115_read(client, 0x6a); - return 0; - default: - return -EINVAL; - } - break; - } - -#ifdef CONFIG_VIDEO_ADV_DEBUG - case VIDIOC_INT_G_REGISTER: - { - struct v4l2_register *reg = arg; - - if (reg->i2c_id != I2C_DRIVERID_SAA711X) - return -EINVAL; - reg->val = saa7115_read(client, reg->reg & 0xff); - break; - } - - case VIDIOC_INT_S_REGISTER: - { - struct v4l2_register *reg = arg; - - if (reg->i2c_id != I2C_DRIVERID_SAA711X) - return -EINVAL; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - saa7115_write(client, reg->reg & 0xff, reg->val & 0xff); - break; - } -#endif - - case VIDIOC_INT_G_CHIP_IDENT: - *iarg = state->ident; - break; - - default: - return -EINVAL; - } - - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static struct i2c_driver i2c_driver_saa7115; - -static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) -{ - struct i2c_client *client; - struct saa7115_state *state; - u8 chip_id; - - /* Check if the adapter supports the needed features */ - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) - return 0; - - client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) - return -ENOMEM; - memset(client, 0, sizeof(struct i2c_client)); - client->addr = address; - client->adapter = adapter; - client->driver = &i2c_driver_saa7115; - client->flags = I2C_CLIENT_ALLOW_USE; - snprintf(client->name, sizeof(client->name) - 1, "saa7115"); - - saa7115_dbg("detecting saa7115 client on address 0x%x\n", address << 1); - - saa7115_write(client, 0, 5); - chip_id = saa7115_read(client, 0) & 0x0f; - if (chip_id != 4 && chip_id != 5) { - saa7115_dbg("saa7115 not found\n"); - kfree(client); - return 0; - } - if (chip_id == 4) { - snprintf(client->name, sizeof(client->name) - 1, "saa7114"); - } - saa7115_info("saa711%d found @ 0x%x (%s)\n", chip_id, address << 1, adapter->name); - - state = kmalloc(sizeof(struct saa7115_state), GFP_KERNEL); - i2c_set_clientdata(client, state); - if (state == NULL) { - kfree(client); - return -ENOMEM; - } - memset(state, 0, sizeof(struct saa7115_state)); - state->std = V4L2_STD_NTSC; - state->input = -1; - state->enable = 1; - state->bright = 128; - state->contrast = 64; - state->hue = 0; - state->sat = 64; - state->ident = (chip_id == 4) ? V4L2_IDENT_SAA7114 : V4L2_IDENT_SAA7115; - state->audclk_freq = V4L2_AUDCLK_48_KHZ; - - saa7115_dbg("writing init values\n"); - - /* init to 60hz/48khz */ - saa7115_writeregs(client, saa7115_init_auto_input); - saa7115_writeregs(client, saa7115_init_misc); - saa7115_writeregs(client, saa7115_cfg_60hz_fullres_x); - saa7115_writeregs(client, saa7115_cfg_60hz_fullres_y); - saa7115_writeregs(client, saa7115_cfg_60hz_video); - saa7115_writeregs(client, saa7115_cfg_48_audio); - saa7115_writeregs(client, saa7115_cfg_60hz_48_audio); - saa7115_writeregs(client, saa7115_cfg_reset_scaler); - - i2c_attach_client(client); - - saa7115_dbg("status: (1E) 0x%02x, (1F) 0x%02x\n", - saa7115_read(client, 0x1e), saa7115_read(client, 0x1f)); - - return 0; -} - -static int saa7115_probe(struct i2c_adapter *adapter) -{ -#ifdef I2C_CLASS_TV_ANALOG - if (adapter->class & I2C_CLASS_TV_ANALOG) -#else - if (adapter->id == I2C_HW_B_BT848) -#endif - return i2c_probe(adapter, &addr_data, &saa7115_attach); - return 0; -} - -static int saa7115_detach(struct i2c_client *client) -{ - struct saa7115_state *state = i2c_get_clientdata(client); - int err; - - err = i2c_detach_client(client); - if (err) { - return err; - } - - kfree(state); - kfree(client); - return 0; -} - -/* ----------------------------------------------------------------------- */ - -/* i2c implementation */ -static struct i2c_driver i2c_driver_saa7115 = { - .name = "saa7115", - .id = I2C_DRIVERID_SAA711X, - .flags = I2C_DF_NOTIFY, - .attach_adapter = saa7115_probe, - .detach_client = saa7115_detach, - .command = saa7115_command, - .owner = THIS_MODULE, -}; - - -static int __init saa7115_init_module(void) -{ - return i2c_add_driver(&i2c_driver_saa7115); -} - -static void __exit saa7115_cleanup_module(void) -{ - i2c_del_driver(&i2c_driver_saa7115); -} - -module_init(saa7115_init_module); -module_exit(saa7115_cleanup_module); diff --git a/trunk/drivers/media/video/saa711x.c b/trunk/drivers/media/video/saa711x.c index 31f7b950b01c..9aa8827de2c3 100644 --- a/trunk/drivers/media/video/saa711x.c +++ b/trunk/drivers/media/video/saa711x.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,7 @@ MODULE_PARM_DESC(debug, " Set the default Debug level. Default: 0 (Off) - (0-1) #define dprintk(num, format, args...) \ do { \ if (debug >= num) \ - printk(format, ##args); \ + printk(format , ##args); \ } while (0) /* ----------------------------------------------------------------------- */ @@ -323,7 +324,7 @@ saa711x_command (struct i2c_client *client, case VIDEO_MODE_SECAM: saa711x_write(client, 0x08, - (decoder->reg[0x08] & 0x3f) | 0x00); + (decoder->reg[0x0e] & 0x3f) | 0x00); saa711x_write(client, 0x0e, (decoder->reg[0x0e] & 0x8f) | 0x50); break; diff --git a/trunk/drivers/media/video/saa7127.c b/trunk/drivers/media/video/saa7127.c deleted file mode 100644 index c36f014f1fdf..000000000000 --- a/trunk/drivers/media/video/saa7127.c +++ /dev/null @@ -1,849 +0,0 @@ -/* - * saa7127 - Philips SAA7127/SAA7129 video encoder driver - * - * Copyright (C) 2003 Roy Bulter - * - * Based on SAA7126 video encoder driver by Gillem & Andreas Oberritter - * - * Copyright (C) 2000-2001 Gillem - * Copyright (C) 2002 Andreas Oberritter - * - * Based on Stadis 4:2:2 MPEG-2 Decoder Driver by Nathan Laredo - * - * Copyright (C) 1999 Nathan Laredo - * - * This driver is designed for the Hauppauge 250/350 Linux driver - * from the ivtv Project - * - * Copyright (C) 2003 Kevin Thayer - * - * Dual output support: - * Copyright (C) 2004 Eric Varsanyi - * - * NTSC Tuning and 7.5 IRE Setup - * Copyright (C) 2004 Chris Kennedy - * - * VBI additions & cleanup: - * Copyright (C) 2004, 2005 Hans Verkuil - * - * Note: the saa7126 is identical to the saa7127, and the saa7128 is - * identical to the saa7129, except that the saa7126 and saa7128 have - * macrovision anti-taping support. This driver will almost certainly - * work find for those chips, except of course for the missing anti-taping - * support. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -#include -#include -#include -#include -#include -#include - -static int debug = 0; -static int test_image = 0; - -MODULE_DESCRIPTION("Philips SAA7127/9 video encoder driver"); -MODULE_AUTHOR("Kevin Thayer, Chris Kennedy, Hans Verkuil"); -MODULE_LICENSE("GPL"); -module_param(debug, int, 0644); -module_param(test_image, int, 0644); -MODULE_PARM_DESC(debug, "debug level (0-2)"); -MODULE_PARM_DESC(test_image, "test_image (0-1)"); - -#define saa7127_dbg(fmt, arg...) \ - do { \ - if (debug >= 1) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); \ - } while (0) - -/* High volume debug. Use with care. */ -#define saa7127_dbg_highvol(fmt, arg...) \ - do { \ - if (debug == 2) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); \ - } while (0) - -#define saa7127_err(fmt, arg...) do { \ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) -#define saa7127_info(fmt, arg...) do { \ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ - i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) - -static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END }; - - -I2C_CLIENT_INSMOD; - -/* - * SAA7127 registers - */ - -#define SAA7127_REG_STATUS 0x00 -#define SAA7127_REG_WIDESCREEN_CONFIG 0x26 -#define SAA7127_REG_WIDESCREEN_ENABLE 0x27 -#define SAA7127_REG_BURST_START 0x28 -#define SAA7127_REG_BURST_END 0x29 -#define SAA7127_REG_COPYGEN_0 0x2a -#define SAA7127_REG_COPYGEN_1 0x2b -#define SAA7127_REG_COPYGEN_2 0x2c -#define SAA7127_REG_OUTPUT_PORT_CONTROL 0x2d -#define SAA7127_REG_GAIN_LUMINANCE_RGB 0x38 -#define SAA7127_REG_GAIN_COLORDIFF_RGB 0x39 -#define SAA7127_REG_INPUT_PORT_CONTROL_1 0x3a -#define SAA7129_REG_FADE_KEY_COL2 0x4f -#define SAA7127_REG_CHROMA_PHASE 0x5a -#define SAA7127_REG_GAINU 0x5b -#define SAA7127_REG_GAINV 0x5c -#define SAA7127_REG_BLACK_LEVEL 0x5d -#define SAA7127_REG_BLANKING_LEVEL 0x5e -#define SAA7127_REG_VBI_BLANKING 0x5f -#define SAA7127_REG_DAC_CONTROL 0x61 -#define SAA7127_REG_BURST_AMP 0x62 -#define SAA7127_REG_SUBC3 0x63 -#define SAA7127_REG_SUBC2 0x64 -#define SAA7127_REG_SUBC1 0x65 -#define SAA7127_REG_SUBC0 0x66 -#define SAA7127_REG_LINE_21_ODD_0 0x67 -#define SAA7127_REG_LINE_21_ODD_1 0x68 -#define SAA7127_REG_LINE_21_EVEN_0 0x69 -#define SAA7127_REG_LINE_21_EVEN_1 0x6a -#define SAA7127_REG_RCV_PORT_CONTROL 0x6b -#define SAA7127_REG_VTRIG 0x6c -#define SAA7127_REG_HTRIG_HI 0x6d -#define SAA7127_REG_MULTI 0x6e -#define SAA7127_REG_CLOSED_CAPTION 0x6f -#define SAA7127_REG_RCV2_OUTPUT_START 0x70 -#define SAA7127_REG_RCV2_OUTPUT_END 0x71 -#define SAA7127_REG_RCV2_OUTPUT_MSBS 0x72 -#define SAA7127_REG_TTX_REQUEST_H_START 0x73 -#define SAA7127_REG_TTX_REQUEST_H_DELAY_LENGTH 0x74 -#define SAA7127_REG_CSYNC_ADVANCE_VSYNC_SHIFT 0x75 -#define SAA7127_REG_TTX_ODD_REQ_VERT_START 0x76 -#define SAA7127_REG_TTX_ODD_REQ_VERT_END 0x77 -#define SAA7127_REG_TTX_EVEN_REQ_VERT_START 0x78 -#define SAA7127_REG_TTX_EVEN_REQ_VERT_END 0x79 -#define SAA7127_REG_FIRST_ACTIVE 0x7a -#define SAA7127_REG_LAST_ACTIVE 0x7b -#define SAA7127_REG_MSB_VERTICAL 0x7c -#define SAA7127_REG_DISABLE_TTX_LINE_LO_0 0x7e -#define SAA7127_REG_DISABLE_TTX_LINE_LO_1 0x7f - -/* - ********************************************************************** - * - * Arrays with configuration parameters for the SAA7127 - * - ********************************************************************** - */ - -struct i2c_reg_value { - unsigned char reg; - unsigned char value; -}; - -static const struct i2c_reg_value saa7129_init_config_extra[] = { - { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x38 }, - { SAA7127_REG_VTRIG, 0xfa }, -}; - -static const struct i2c_reg_value saa7127_init_config_common[] = { - { SAA7127_REG_WIDESCREEN_CONFIG, 0x0d }, - { SAA7127_REG_WIDESCREEN_ENABLE, 0x00 }, - { SAA7127_REG_COPYGEN_0, 0x77 }, - { SAA7127_REG_COPYGEN_1, 0x41 }, - { SAA7127_REG_COPYGEN_2, 0x00 }, /* Macrovision enable/disable */ - { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x9e }, - { SAA7127_REG_GAIN_LUMINANCE_RGB, 0x00 }, - { SAA7127_REG_GAIN_COLORDIFF_RGB, 0x00 }, - { SAA7127_REG_INPUT_PORT_CONTROL_1, 0x80 }, /* for color bars */ - { SAA7127_REG_LINE_21_ODD_0, 0x77 }, - { SAA7127_REG_LINE_21_ODD_1, 0x41 }, - { SAA7127_REG_LINE_21_EVEN_0, 0x88 }, - { SAA7127_REG_LINE_21_EVEN_1, 0x41 }, - { SAA7127_REG_RCV_PORT_CONTROL, 0x12 }, - { SAA7127_REG_VTRIG, 0xf9 }, - { SAA7127_REG_HTRIG_HI, 0x00 }, - { SAA7127_REG_RCV2_OUTPUT_START, 0x41 }, - { SAA7127_REG_RCV2_OUTPUT_END, 0xc3 }, - { SAA7127_REG_RCV2_OUTPUT_MSBS, 0x00 }, - { SAA7127_REG_TTX_REQUEST_H_START, 0x3e }, - { SAA7127_REG_TTX_REQUEST_H_DELAY_LENGTH, 0xb8 }, - { SAA7127_REG_CSYNC_ADVANCE_VSYNC_SHIFT, 0x03 }, - { SAA7127_REG_TTX_ODD_REQ_VERT_START, 0x15 }, - { SAA7127_REG_TTX_ODD_REQ_VERT_END, 0x16 }, - { SAA7127_REG_TTX_EVEN_REQ_VERT_START, 0x15 }, - { SAA7127_REG_TTX_EVEN_REQ_VERT_END, 0x16 }, - { SAA7127_REG_FIRST_ACTIVE, 0x1a }, - { SAA7127_REG_LAST_ACTIVE, 0x01 }, - { SAA7127_REG_MSB_VERTICAL, 0xc0 }, - { SAA7127_REG_DISABLE_TTX_LINE_LO_0, 0x00 }, - { SAA7127_REG_DISABLE_TTX_LINE_LO_1, 0x00 }, - { 0, 0 } -}; - -#define SAA7127_60HZ_DAC_CONTROL 0x15 -static const struct i2c_reg_value saa7127_init_config_60hz[] = { - { SAA7127_REG_BURST_START, 0x19 }, - /* BURST_END is also used as a chip ID in saa7127_detect_client */ - { SAA7127_REG_BURST_END, 0x1d }, - { SAA7127_REG_CHROMA_PHASE, 0xa3 }, - { SAA7127_REG_GAINU, 0x98 }, - { SAA7127_REG_GAINV, 0xd3 }, - { SAA7127_REG_BLACK_LEVEL, 0x39 }, - { SAA7127_REG_BLANKING_LEVEL, 0x2e }, - { SAA7127_REG_VBI_BLANKING, 0x2e }, - { SAA7127_REG_DAC_CONTROL, 0x15 }, - { SAA7127_REG_BURST_AMP, 0x4d }, - { SAA7127_REG_SUBC3, 0x1f }, - { SAA7127_REG_SUBC2, 0x7c }, - { SAA7127_REG_SUBC1, 0xf0 }, - { SAA7127_REG_SUBC0, 0x21 }, - { SAA7127_REG_MULTI, 0x90 }, - { SAA7127_REG_CLOSED_CAPTION, 0x11 }, - { 0, 0 } -}; - -#define SAA7127_50HZ_DAC_CONTROL 0x02 -static struct i2c_reg_value saa7127_init_config_50hz[] = { - { SAA7127_REG_BURST_START, 0x21 }, - /* BURST_END is also used as a chip ID in saa7127_detect_client */ - { SAA7127_REG_BURST_END, 0x1d }, - { SAA7127_REG_CHROMA_PHASE, 0x3f }, - { SAA7127_REG_GAINU, 0x7d }, - { SAA7127_REG_GAINV, 0xaf }, - { SAA7127_REG_BLACK_LEVEL, 0x33 }, - { SAA7127_REG_BLANKING_LEVEL, 0x35 }, - { SAA7127_REG_VBI_BLANKING, 0x35 }, - { SAA7127_REG_DAC_CONTROL, 0x02 }, - { SAA7127_REG_BURST_AMP, 0x2f }, - { SAA7127_REG_SUBC3, 0xcb }, - { SAA7127_REG_SUBC2, 0x8a }, - { SAA7127_REG_SUBC1, 0x09 }, - { SAA7127_REG_SUBC0, 0x2a }, - { SAA7127_REG_MULTI, 0xa0 }, - { SAA7127_REG_CLOSED_CAPTION, 0x00 }, - { 0, 0 } -}; - -/* Enumeration for the Supported input types */ -enum saa7127_input_type { - SAA7127_INPUT_TYPE_NORMAL, - SAA7127_INPUT_TYPE_TEST_IMAGE -}; - -/* Enumeration for the Supported Output signal types */ -enum saa7127_output_type { - SAA7127_OUTPUT_TYPE_BOTH, - SAA7127_OUTPUT_TYPE_COMPOSITE, - SAA7127_OUTPUT_TYPE_SVIDEO, - SAA7127_OUTPUT_TYPE_RGB, - SAA7127_OUTPUT_TYPE_YUV_C, - SAA7127_OUTPUT_TYPE_YUV_V -}; - -/* - ********************************************************************** - * - * Encoder Struct, holds the configuration state of the encoder - * - ********************************************************************** - */ - -struct saa7127_state { - v4l2_std_id std; - enum v4l2_chip_ident ident; - enum saa7127_input_type input_type; - enum saa7127_output_type output_type; - int video_enable; - int wss_enable; - u16 wss_mode; - int cc_enable; - u16 cc_data; - int xds_enable; - u16 xds_data; - int vps_enable; - u8 vps_data[5]; - u8 reg_2d; - u8 reg_3a; - u8 reg_3a_cb; /* colorbar bit */ - u8 reg_61; -}; - -static const char * const output_strs[] = -{ - "S-Video + Composite", - "Composite", - "S-Video", - "RGB", - "YUV C", - "YUV V" -}; - -static const char * const wss_strs[] = { - "invalid", - "letterbox 14:9 center", - "letterbox 14:9 top", - "invalid", - "letterbox 16:9 top", - "invalid", - "invalid", - "16:9 full format anamorphic" - "4:3 full format", - "invalid", - "invalid", - "letterbox 16:9 center", - "invalid", - "letterbox >16:9 center", - "14:9 full format center", - "invalid", -}; - -/* ----------------------------------------------------------------------- */ - -static int saa7127_read(struct i2c_client *client, u8 reg) -{ - return i2c_smbus_read_byte_data(client, reg); -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_write(struct i2c_client *client, u8 reg, u8 val) -{ - int i; - - for (i = 0; i < 3; i++) { - if (i2c_smbus_write_byte_data(client, reg, val) == 0) - return 0; - } - saa7127_err("I2C Write Problem\n"); - return -1; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_write_inittab(struct i2c_client *client, - const struct i2c_reg_value *regs) -{ - while (regs->reg != 0) { - saa7127_write(client, regs->reg, regs->value); - regs++; - } - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_data *data) -{ - struct saa7127_state *state = i2c_get_clientdata(client); - int enable = (data->line != 0); - - if (enable && (data->field != 0 || data->line != 16)) - return -EINVAL; - if (state->vps_enable != enable) { - saa7127_dbg("Turn VPS Signal %s\n", enable ? "on" : "off"); - saa7127_write(client, 0x54, enable << 7); - state->vps_enable = enable; - } - if (!enable) - return 0; - - state->vps_data[0] = data->data[4]; - state->vps_data[1] = data->data[10]; - state->vps_data[2] = data->data[11]; - state->vps_data[3] = data->data[12]; - state->vps_data[4] = data->data[13]; - saa7127_dbg("Set VPS data %02x %02x %02x %02x %02x\n", - state->vps_data[0], state->vps_data[1], - state->vps_data[2], state->vps_data[3], - state->vps_data[4]); - saa7127_write(client, 0x55, state->vps_data[0]); - saa7127_write(client, 0x56, state->vps_data[1]); - saa7127_write(client, 0x57, state->vps_data[2]); - saa7127_write(client, 0x58, state->vps_data[3]); - saa7127_write(client, 0x59, state->vps_data[4]); - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data *data) -{ - struct saa7127_state *state = i2c_get_clientdata(client); - u16 cc = data->data[1] << 8 | data->data[0]; - int enable = (data->line != 0); - - if (enable && (data->field != 0 || data->line != 21)) - return -EINVAL; - if (state->cc_enable != enable) { - saa7127_dbg("Turn CC %s\n", enable ? "on" : "off"); - saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, - (state->xds_enable << 7) | (enable << 6) | 0x11); - state->cc_enable = enable; - } - if (!enable) - return 0; - - saa7127_dbg_highvol("CC data: %04x\n", cc); - saa7127_write(client, SAA7127_REG_LINE_21_ODD_0, cc & 0xff); - saa7127_write(client, SAA7127_REG_LINE_21_ODD_1, cc >> 8); - state->cc_data = cc; - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_data *data) -{ - struct saa7127_state *state = i2c_get_clientdata(client); - u16 xds = data->data[1] << 8 | data->data[0]; - int enable = (data->line != 0); - - if (enable && (data->field != 1 || data->line != 21)) - return -EINVAL; - if (state->xds_enable != enable) { - saa7127_dbg("Turn XDS %s\n", enable ? "on" : "off"); - saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, - (enable << 7) | (state->cc_enable << 6) | 0x11); - state->xds_enable = enable; - } - if (!enable) - return 0; - - saa7127_dbg_highvol("XDS data: %04x\n", xds); - saa7127_write(client, SAA7127_REG_LINE_21_EVEN_0, xds & 0xff); - saa7127_write(client, SAA7127_REG_LINE_21_EVEN_1, xds >> 8); - state->xds_data = xds; - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_set_wss(struct i2c_client *client, struct v4l2_sliced_vbi_data *data) -{ - struct saa7127_state *state = i2c_get_clientdata(client); - int enable = (data->line != 0); - - if (enable && (data->field != 0 || data->line != 23)) - return -EINVAL; - if (state->wss_enable != enable) { - saa7127_dbg("Turn WSS %s\n", enable ? "on" : "off"); - saa7127_write(client, 0x27, enable << 7); - state->wss_enable = enable; - } - if (!enable) - return 0; - - saa7127_write(client, 0x26, data->data[0]); - saa7127_write(client, 0x27, 0x80 | (data->data[1] & 0x3f)); - saa7127_dbg("WSS mode: %s\n", wss_strs[data->data[0] & 0xf]); - state->wss_mode = (data->data[1] & 0x3f) << 8 | data->data[0]; - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_set_video_enable(struct i2c_client *client, int enable) -{ - struct saa7127_state *state = i2c_get_clientdata(client); - - if (enable) { - saa7127_dbg("Enable Video Output\n"); - saa7127_write(client, 0x2d, state->reg_2d); - saa7127_write(client, 0x61, state->reg_61); - } else { - saa7127_dbg("Disable Video Output\n"); - saa7127_write(client, 0x2d, (state->reg_2d & 0xf0)); - saa7127_write(client, 0x61, (state->reg_61 | 0xc0)); - } - state->video_enable = enable; - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_set_std(struct i2c_client *client, v4l2_std_id std) -{ - struct saa7127_state *state = i2c_get_clientdata(client); - const struct i2c_reg_value *inittab; - - if (std & V4L2_STD_525_60) { - saa7127_dbg("Selecting 60 Hz video Standard\n"); - inittab = saa7127_init_config_60hz; - state->reg_61 = SAA7127_60HZ_DAC_CONTROL; - } else { - saa7127_dbg("Selecting 50 Hz video Standard\n"); - inittab = saa7127_init_config_50hz; - state->reg_61 = SAA7127_50HZ_DAC_CONTROL; - } - - /* Write Table */ - saa7127_write_inittab(client, inittab); - state->std = std; - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_set_output_type(struct i2c_client *client, int output) -{ - struct saa7127_state *state = i2c_get_clientdata(client); - - switch (output) { - case SAA7127_OUTPUT_TYPE_RGB: - state->reg_2d = 0x0f; /* RGB + CVBS (for sync) */ - state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ - break; - - case SAA7127_OUTPUT_TYPE_COMPOSITE: - state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */ - state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ - break; - - case SAA7127_OUTPUT_TYPE_SVIDEO: - state->reg_2d = 0xff; /* 11111111 croma -> R, luma -> CVBS + G + B */ - state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ - break; - - case SAA7127_OUTPUT_TYPE_YUV_V: - state->reg_2d = 0x4f; /* reg 2D = 01001111, all DAC's on, RGB + VBS */ - state->reg_3a = 0x0b; /* reg 3A = 00001011, bypass RGB-matrix */ - break; - - case SAA7127_OUTPUT_TYPE_YUV_C: - state->reg_2d = 0x0f; /* reg 2D = 00001111, all DAC's on, RGB + CVBS */ - state->reg_3a = 0x0b; /* reg 3A = 00001011, bypass RGB-matrix */ - break; - - case SAA7127_OUTPUT_TYPE_BOTH: - state->reg_2d = 0xbf; - state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ - break; - - default: - return -EINVAL; - } - saa7127_dbg("Selecting %s output type\n", output_strs[output]); - - /* Configure Encoder */ - saa7127_write(client, 0x2d, state->reg_2d); - saa7127_write(client, 0x3a, state->reg_3a | state->reg_3a_cb); - state->output_type = output; - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_set_input_type(struct i2c_client *client, int input) -{ - struct saa7127_state *state = i2c_get_clientdata(client); - - switch (input) { - case SAA7127_INPUT_TYPE_NORMAL: /* avia */ - saa7127_dbg("Selecting Normal Encoder Input\n"); - state->reg_3a_cb = 0; - break; - - case SAA7127_INPUT_TYPE_TEST_IMAGE: /* color bar */ - saa7127_dbg("Selecting Color Bar generator\n"); - state->reg_3a_cb = 0x80; - break; - - default: - return -EINVAL; - } - saa7127_write(client, 0x3a, state->reg_3a | state->reg_3a_cb); - state->input_type = input; - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_command(struct i2c_client *client, - unsigned int cmd, void *arg) -{ - struct saa7127_state *state = i2c_get_clientdata(client); - struct v4l2_format *fmt = arg; - int *iarg = arg; - - switch (cmd) { - case VIDIOC_S_STD: - if (state->std == *(v4l2_std_id *)arg) - break; - return saa7127_set_std(client, *(v4l2_std_id *)arg); - - case VIDIOC_G_STD: - *(v4l2_std_id *)arg = state->std; - break; - - case VIDIOC_S_INPUT: - if (state->input_type == *iarg) - break; - return saa7127_set_input_type(client, *iarg); - - case VIDIOC_S_OUTPUT: - if (state->output_type == *iarg) - break; - return saa7127_set_output_type(client, *iarg); - - case VIDIOC_STREAMON: - case VIDIOC_STREAMOFF: - if (state->video_enable == (cmd == VIDIOC_STREAMON)) - break; - return saa7127_set_video_enable(client, cmd == VIDIOC_STREAMON); - - case VIDIOC_G_FMT: - if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) - return -EINVAL; - - memset(&fmt->fmt.sliced, 0, sizeof(fmt->fmt.sliced)); - if (state->vps_enable) - fmt->fmt.sliced.service_lines[0][16] = V4L2_SLICED_VPS; - if (state->wss_enable) - fmt->fmt.sliced.service_lines[0][23] = V4L2_SLICED_WSS_625; - if (state->cc_enable) { - fmt->fmt.sliced.service_lines[0][21] = V4L2_SLICED_CAPTION_525; - fmt->fmt.sliced.service_lines[1][21] = V4L2_SLICED_CAPTION_525; - } - fmt->fmt.sliced.service_set = - (state->vps_enable ? V4L2_SLICED_VPS : 0) | - (state->wss_enable ? V4L2_SLICED_WSS_625 : 0) | - (state->cc_enable ? V4L2_SLICED_CAPTION_525 : 0); - break; - - case VIDIOC_LOG_STATUS: - saa7127_info("Standard: %s\n", (state->std & V4L2_STD_525_60) ? "60 Hz" : "50 Hz"); - saa7127_info("Input: %s\n", state->input_type ? "color bars" : "normal"); - saa7127_info("Output: %s\n", state->video_enable ? - output_strs[state->output_type] : "disabled"); - saa7127_info("WSS: %s\n", state->wss_enable ? - wss_strs[state->wss_mode] : "disabled"); - saa7127_info("VPS: %s\n", state->vps_enable ? "enabled" : "disabled"); - saa7127_info("CC: %s\n", state->cc_enable ? "enabled" : "disabled"); - break; - -#ifdef CONFIG_VIDEO_ADV_DEBUG - case VIDIOC_INT_G_REGISTER: - { - struct v4l2_register *reg = arg; - - if (reg->i2c_id != I2C_DRIVERID_SAA7127) - return -EINVAL; - reg->val = saa7127_read(client, reg->reg & 0xff); - break; - } - - case VIDIOC_INT_S_REGISTER: - { - struct v4l2_register *reg = arg; - - if (reg->i2c_id != I2C_DRIVERID_SAA7127) - return -EINVAL; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - saa7127_write(client, reg->reg & 0xff, reg->val & 0xff); - break; - } -#endif - - case VIDIOC_INT_S_VBI_DATA: - { - struct v4l2_sliced_vbi_data *data = arg; - - switch (data->id) { - case V4L2_SLICED_WSS_625: - return saa7127_set_wss(client, data); - case V4L2_SLICED_VPS: - return saa7127_set_vps(client, data); - case V4L2_SLICED_CAPTION_525: - if (data->field == 0) - return saa7127_set_cc(client, data); - return saa7127_set_xds(client, data); - default: - return -EINVAL; - } - break; - } - - case VIDIOC_INT_G_CHIP_IDENT: - *(enum v4l2_chip_ident *)arg = state->ident; - break; - - default: - return -EINVAL; - } - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static struct i2c_driver i2c_driver_saa7127; - -/* ----------------------------------------------------------------------- */ - -static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) -{ - struct i2c_client *client; - struct saa7127_state *state; - struct v4l2_sliced_vbi_data vbi = { 0, 0, 0, 0 }; /* set to disabled */ - int read_result = 0; - - /* Check if the adapter supports the needed features */ - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) - return 0; - - client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) - return -ENOMEM; - - memset(client, 0, sizeof(struct i2c_client)); - client->addr = address; - client->adapter = adapter; - client->driver = &i2c_driver_saa7127; - client->flags = I2C_CLIENT_ALLOW_USE; - snprintf(client->name, sizeof(client->name) - 1, "saa7127"); - - saa7127_dbg("detecting saa7127 client on address 0x%x\n", address << 1); - - /* First test register 0: Bits 5-7 are a version ID (should be 0), - and bit 2 should also be 0. - This is rather general, so the second test is more specific and - looks at the 'ending point of burst in clock cycles' which is - 0x1d after a reset and not expected to ever change. */ - if ((saa7127_read(client, 0) & 0xe4) != 0 || - (saa7127_read(client, 0x29) & 0x3f) != 0x1d) { - saa7127_dbg("saa7127 not found\n"); - kfree(client); - return 0; - } - state = kmalloc(sizeof(struct saa7127_state), GFP_KERNEL); - - if (state == NULL) { - kfree(client); - return (-ENOMEM); - } - - i2c_set_clientdata(client, state); - memset(state, 0, sizeof(struct saa7127_state)); - - /* Configure Encoder */ - - saa7127_dbg("Configuring encoder\n"); - saa7127_write_inittab(client, saa7127_init_config_common); - saa7127_set_std(client, V4L2_STD_NTSC); - saa7127_set_output_type(client, SAA7127_OUTPUT_TYPE_BOTH); - saa7127_set_vps(client, &vbi); - saa7127_set_wss(client, &vbi); - saa7127_set_cc(client, &vbi); - saa7127_set_xds(client, &vbi); - if (test_image == 1) { - /* The Encoder has an internal Colorbar generator */ - /* This can be used for debugging */ - saa7127_set_input_type(client, SAA7127_INPUT_TYPE_TEST_IMAGE); - } else { - saa7127_set_input_type(client, SAA7127_INPUT_TYPE_NORMAL); - } - saa7127_set_video_enable(client, 1); - - /* Detect if it's an saa7129 */ - read_result = saa7127_read(client, SAA7129_REG_FADE_KEY_COL2); - saa7127_write(client, SAA7129_REG_FADE_KEY_COL2, 0xaa); - if (saa7127_read(client, SAA7129_REG_FADE_KEY_COL2) == 0xaa) { - saa7127_info("saa7129 found @ 0x%x (%s)\n", address << 1, adapter->name); - saa7127_write(client, SAA7129_REG_FADE_KEY_COL2, read_result); - saa7127_write_inittab(client, saa7129_init_config_extra); - state->ident = V4L2_IDENT_SAA7129; - } else { - saa7127_info("saa7127 found @ 0x%x (%s)\n", address << 1, adapter->name); - state->ident = V4L2_IDENT_SAA7127; - } - - i2c_attach_client(client); - - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_probe(struct i2c_adapter *adapter) -{ -#ifdef I2C_CLASS_TV_ANALOG - if (adapter->class & I2C_CLASS_TV_ANALOG) -#else - if (adapter->id == I2C_HW_B_BT848) -#endif - return i2c_probe(adapter, &addr_data, saa7127_attach); - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static int saa7127_detach(struct i2c_client *client) -{ - struct saa7127_state *state = i2c_get_clientdata(client); - int err; - - /* Turn off TV output */ - saa7127_set_video_enable(client, 0); - - err = i2c_detach_client(client); - - if (err) { - return err; - } - - kfree(state); - kfree(client); - return 0; -} - -/* ----------------------------------------------------------------------- */ - -static struct i2c_driver i2c_driver_saa7127 = { - .name = "saa7127", - .id = I2C_DRIVERID_SAA7127, - .flags = I2C_DF_NOTIFY, - .attach_adapter = saa7127_probe, - .detach_client = saa7127_detach, - .command = saa7127_command, - .owner = THIS_MODULE, -}; - - -/* ----------------------------------------------------------------------- */ - -static int __init saa7127_init_module(void) -{ - return i2c_add_driver(&i2c_driver_saa7127); -} - -/* ----------------------------------------------------------------------- */ - -static void __exit saa7127_cleanup_module(void) -{ - i2c_del_driver(&i2c_driver_saa7127); -} - -/* ----------------------------------------------------------------------- */ - -module_init(saa7127_init_module); -module_exit(saa7127_cleanup_module); diff --git a/trunk/drivers/media/video/saa7134/Kconfig b/trunk/drivers/media/video/saa7134/Kconfig index 8a5c3e71b37d..624e8808a517 100644 --- a/trunk/drivers/media/video/saa7134/Kconfig +++ b/trunk/drivers/media/video/saa7134/Kconfig @@ -1,6 +1,6 @@ config VIDEO_SAA7134 tristate "Philips SAA7134 support" - depends on VIDEO_DEV && PCI && I2C + depends on VIDEO_DEV && PCI && I2C && SOUND select VIDEO_BUF select VIDEO_IR select VIDEO_TUNER @@ -12,29 +12,6 @@ config VIDEO_SAA7134 To compile this driver as a module, choose M here: the module will be called saa7134. -config VIDEO_SAA7134_ALSA - tristate "Philips SAA7134 DMA audio support" - depends on VIDEO_SAA7134 && SND - select SND_PCM_OSS - ---help--- - This is a video4linux driver for direct (DMA) audio in - Philips SAA713x based TV cards using ALSA - - To compile this driver as a module, choose M here: the - module will be called saa7134-alsa. - -config VIDEO_SAA7134_OSS - tristate "Philips SAA7134 DMA audio support (OSS, DEPRECATED)" - depends on VIDEO_SAA7134 && SOUND_PRIME && !VIDEO_SAA7134_ALSA - ---help--- - This is a video4linux driver for direct (DMA) audio in - Philips SAA713x based TV cards using OSS - - This is deprecated in favor of the ALSA module - - To compile this driver as a module, choose M here: the - module will be called saa7134-oss. - config VIDEO_SAA7134_DVB tristate "DVB/ATSC Support for saa7134 based TV cards" depends on VIDEO_SAA7134 && DVB_CORE @@ -64,8 +41,8 @@ config VIDEO_SAA7134_DVB_ALL_FRONTENDS If you are unsure, choose Y. config VIDEO_SAA7134_DVB_MT352 - bool "Zarlink MT352 DVB-T Support" - default y + tristate "Zarlink MT352 DVB-T Support" + default m depends on VIDEO_SAA7134_DVB && !VIDEO_SAA7134_DVB_ALL_FRONTENDS select DVB_MT352 ---help--- @@ -73,8 +50,8 @@ config VIDEO_SAA7134_DVB_MT352 Philips saa7134 chip and the MT352 demodulator. config VIDEO_SAA7134_DVB_TDA1004X - bool "Phillips TDA10045H/TDA10046H DVB-T Support" - default y + tristate "Phillips TDA10045H/TDA10046H DVB-T Support" + default m depends on VIDEO_SAA7134_DVB && !VIDEO_SAA7134_DVB_ALL_FRONTENDS select DVB_TDA1004X ---help--- @@ -82,8 +59,8 @@ config VIDEO_SAA7134_DVB_TDA1004X Philips saa7134 chip and the TDA10045H/TDA10046H demodulator. config VIDEO_SAA7134_DVB_NXT200X - bool "NXT2002/NXT2004 ATSC Support" - default y + tristate "NXT2002/NXT2004 ATSC Support" + default m depends on VIDEO_SAA7134_DVB && !VIDEO_SAA7134_DVB_ALL_FRONTENDS select DVB_NXT200X ---help--- diff --git a/trunk/drivers/media/video/saa7134/Makefile b/trunk/drivers/media/video/saa7134/Makefile index 1ba998424bbd..e0b28f0533af 100644 --- a/trunk/drivers/media/video/saa7134/Makefile +++ b/trunk/drivers/media/video/saa7134/Makefile @@ -1,23 +1,24 @@ saa7134-objs := saa7134-cards.o saa7134-core.o saa7134-i2c.o \ - saa7134-ts.o saa7134-tvaudio.o saa7134-vbi.o \ - saa7134-video.o saa7134-input.o + saa7134-oss.o saa7134-ts.o saa7134-tvaudio.o \ + saa7134-vbi.o saa7134-video.o saa7134-input.o obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o \ - saa6752hs.o - -obj-$(CONFIG_VIDEO_SAA7134_ALSA) += saa7134-alsa.o -obj-$(CONFIG_VIDEO_SAA7134_OSS) += saa7134-oss.o - + saa6752hs.o saa7134-alsa.o obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o EXTRA_CFLAGS += -I$(src)/.. EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends - -extra-cflags-$(CONFIG_VIDEO_BUF_DVB) += -DHAVE_VIDEO_BUF_DVB=1 -extra-cflags-$(CONFIG_DVB_MT352) += -DHAVE_MT352=1 -extra-cflags-$(CONFIG_DVB_TDA1004X) += -DHAVE_TDA1004X=1 -extra-cflags-$(CONFIG_DVB_NXT200X) += -DHAVE_NXT200X=1 - -EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m) +ifneq ($(CONFIG_VIDEO_BUF_DVB),n) + EXTRA_CFLAGS += -DHAVE_VIDEO_BUF_DVB=1 +endif +ifneq ($(CONFIG_DVB_MT352),n) + EXTRA_CFLAGS += -DHAVE_MT352=1 +endif +ifneq ($(CONFIG_DVB_TDA1004X),n) + EXTRA_CFLAGS += -DHAVE_TDA1004X=1 +endif +ifneq ($(CONFIG_DVB_NXT200X),n) + EXTRA_CFLAGS += -DHAVE_NXT200X=1 +endif diff --git a/trunk/drivers/media/video/saa7134/saa6752hs.c b/trunk/drivers/media/video/saa7134/saa6752hs.c index a61d24f588f7..cdd1ed9c8065 100644 --- a/trunk/drivers/media/video/saa7134/saa6752hs.c +++ b/trunk/drivers/media/video/saa7134/saa6752hs.c @@ -523,8 +523,7 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) h->standard = 0; i2c_set_clientdata(&h->client, h); - i2c_attach_client(&h->client); - + i2c_attach_client(&h->client); return 0; } @@ -598,19 +597,19 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "i2c saa6752hs MPEG encoder", - .id = I2C_DRIVERID_SAA6752HS, - .flags = I2C_DF_NOTIFY, - .attach_adapter = saa6752hs_probe, - .detach_client = saa6752hs_detach, - .command = saa6752hs_command, + .name = "i2c saa6752hs MPEG encoder", + .id = I2C_DRIVERID_SAA6752HS, + .flags = I2C_DF_NOTIFY, + .attach_adapter = saa6752hs_probe, + .detach_client = saa6752hs_detach, + .command = saa6752hs_command, }; static struct i2c_client client_template = { .name = "saa6752hs", .flags = I2C_CLIENT_ALLOW_USE, - .driver = &driver, + .driver = &driver, }; static int __init saa6752hs_init_module(void) diff --git a/trunk/drivers/media/video/saa7134/saa7134-alsa.c b/trunk/drivers/media/video/saa7134/saa7134-alsa.c index ade05f75fdb0..4f3c42354329 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-alsa.c +++ b/trunk/drivers/media/video/saa7134/saa7134-alsa.c @@ -30,9 +30,7 @@ #include #include #include -#include #include -#include #include "saa7134.h" #include "saa7134-reg.h" @@ -51,7 +49,6 @@ MODULE_PARM_DESC(debug,"enable debug messages [alsa]"); #define MIXER_ADDR_LINE2 2 #define MIXER_ADDR_LAST 2 - static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; @@ -60,21 +57,18 @@ module_param_array(index, int, NULL, 0444); MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); #define dprintk(fmt, arg...) if (debug) \ - printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg) - - + printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ## arg) /* * Main chip structure */ - typedef struct snd_card_saa7134 { snd_card_t *card; spinlock_t mixer_lock; int mixer_volume[MIXER_ADDR_LAST+1][2]; int capture_source[MIXER_ADDR_LAST+1][2]; struct pci_dev *pci; - struct saa7134_dev *dev; + struct saa7134_dev *saadev; unsigned long iobase; int irq; @@ -89,10 +83,12 @@ typedef struct snd_card_saa7134 { */ typedef struct snd_card_saa7134_pcm { - struct saa7134_dev *dev; + struct saa7134_dev *saadev; spinlock_t lock; - + unsigned int pcm_size; /* buffer size */ + unsigned int pcm_count; /* bytes per period */ + unsigned int pcm_bps; /* bytes per second */ snd_pcm_substream_t *substream; } snd_card_saa7134_pcm_t; @@ -104,11 +100,13 @@ static snd_card_t *snd_saa7134_cards[SNDRV_CARDS]; * * Called when the capture device is released or the buffer overflows * - * - Copied verbatim from saa7134-oss's dsp_dma_stop. + * - Copied verbatim from saa7134-oss's dsp_dma_stop. Can be dropped + * if we just share dsp_dma_stop and use it here * */ static void saa7134_dma_stop(struct saa7134_dev *dev) + { dev->dmasound.dma_blk = -1; dev->dmasound.dma_running = 0; @@ -120,7 +118,8 @@ static void saa7134_dma_stop(struct saa7134_dev *dev) * * Called when preparing the capture device for use * - * - Copied verbatim from saa7134-oss's dsp_dma_start. + * - Copied verbatim from saa7134-oss's dsp_dma_start. Can be dropped + * if we just share dsp_dma_start and use it here * */ @@ -142,8 +141,7 @@ static void saa7134_dma_start(struct saa7134_dev *dev) * */ -static void saa7134_irq_alsa_done(struct saa7134_dev *dev, - unsigned long status) +void saa7134_irq_alsa_done(struct saa7134_dev *dev, unsigned long status) { int next_blk, reg = 0; @@ -172,9 +170,9 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev, if (dev->dmasound.read_count >= dev->dmasound.blksize * (dev->dmasound.blocks-2)) { dprintk("irq: overrun [full=%d/%d] - Blocks in %d\n",dev->dmasound.read_count, dev->dmasound.bufsize, dev->dmasound.blocks); - spin_unlock(&dev->slock); snd_pcm_stop(dev->dmasound.substream,SNDRV_PCM_STATE_XRUN); - return; + saa7134_dma_stop(dev); + goto done; } /* next block addr */ @@ -196,7 +194,6 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev, snd_pcm_period_elapsed(dev->dmasound.substream); spin_lock(&dev->slock); } - done: spin_unlock(&dev->slock); @@ -212,9 +209,7 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev, static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id, struct pt_regs *regs) { - struct saa7134_dmasound *dmasound = dev_id; - struct saa7134_dev *dev = dmasound->priv_data; - + struct saa7134_dev *dev = (struct saa7134_dev*) dev_id; unsigned long report, status; int loop, handled = 0; @@ -253,23 +248,56 @@ static int snd_card_saa7134_capture_trigger(snd_pcm_substream_t * substream, int cmd) { snd_pcm_runtime_t *runtime = substream->runtime; - snd_card_saa7134_pcm_t *pcm = runtime->private_data; - struct saa7134_dev *dev=pcm->dev; + snd_card_saa7134_pcm_t *saapcm = runtime->private_data; + struct saa7134_dev *dev=saapcm->saadev; int err = 0; - spin_lock(&dev->slock); - if (cmd == SNDRV_PCM_TRIGGER_START) { + spin_lock_irq(&dev->slock); + if (cmd == SNDRV_PCM_TRIGGER_START) { /* start dma */ saa7134_dma_start(dev); - } else if (cmd == SNDRV_PCM_TRIGGER_STOP) { + } else if (cmd == SNDRV_PCM_TRIGGER_STOP) { /* stop dma */ saa7134_dma_stop(dev); - } else { - err = -EINVAL; - } - spin_unlock(&dev->slock); + } else { + err = -EINVAL; + } + spin_unlock_irq(&dev->slock); - return err; + return err; +} + +/* + * DMA buffer config + * + * Sets the values that will later be used as the size of the buffer, + * size of the fragments, and total number of fragments. + * Must be called during the preparation stage, before memory is + * allocated + * + * - Copied verbatim from saa7134-oss. Can be dropped + * if we just share dsp_buffer_conf from OSS. + */ + +static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks) +{ + if (blksize < 0x100) + blksize = 0x100; + if (blksize > 0x10000) + blksize = 0x10000; + + if (blocks < 2) + blocks = 2; + if ((blksize * blocks) > 1024*1024) + blocks = 1024*1024 / blksize; + + dev->dmasound.blocks = blocks; + dev->dmasound.blksize = blksize; + dev->dmasound.bufsize = blksize * blocks; + + dprintk("buffer config: %d blocks / %d bytes, %d kB total\n", + blocks,blksize,blksize * blocks / 1024); + return 0; } /* @@ -279,16 +307,16 @@ static int snd_card_saa7134_capture_trigger(snd_pcm_substream_t * substream, * ALSA, but I was unable to use ALSA's own DMA, and had to force the * usage of V4L's * - * - Copied verbatim from saa7134-oss. - * + * - Copied verbatim from saa7134-oss. Can be dropped + * if we just share dsp_buffer_init from OSS. */ static int dsp_buffer_init(struct saa7134_dev *dev) { int err; - BUG_ON(!dev->dmasound.bufsize); - + if (!dev->dmasound.bufsize) + BUG(); videobuf_dma_init(&dev->dmasound.dma); err = videobuf_dma_init_kernel(&dev->dmasound.dma, PCI_DMA_FROMDEVICE, (dev->dmasound.bufsize + PAGE_SIZE) >> PAGE_SHIFT); @@ -297,28 +325,6 @@ static int dsp_buffer_init(struct saa7134_dev *dev) return 0; } -/* - * DMA buffer release - * - * Called after closing the device, during snd_card_saa7134_capture_close - * - */ - -static int dsp_buffer_free(struct saa7134_dev *dev) -{ - if (!dev->dmasound.blksize) - BUG(); - - videobuf_dma_free(&dev->dmasound.dma); - - dev->dmasound.blocks = 0; - dev->dmasound.blksize = 0; - dev->dmasound.bufsize = 0; - - return 0; -} - - /* * ALSA PCM preparation * @@ -334,30 +340,84 @@ static int dsp_buffer_free(struct saa7134_dev *dev) static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) { snd_pcm_runtime_t *runtime = substream->runtime; - int bswap, sign; + int err, bswap, sign; u32 fmt, control; snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); struct saa7134_dev *dev; - snd_card_saa7134_pcm_t *pcm = runtime->private_data; + snd_card_saa7134_pcm_t *saapcm = runtime->private_data; + unsigned int bps; + unsigned long size; + unsigned count; - pcm->dev->dmasound.substream = substream; + size = snd_pcm_lib_buffer_bytes(substream); + count = snd_pcm_lib_period_bytes(substream); + + saapcm->saadev->dmasound.substream = substream; + bps = runtime->rate * runtime->channels; + bps *= snd_pcm_format_width(runtime->format); + bps /= 8; + if (bps <= 0) + return -EINVAL; + saapcm->pcm_bps = bps; + saapcm->pcm_size = snd_pcm_lib_buffer_bytes(substream); + saapcm->pcm_count = snd_pcm_lib_period_bytes(substream); + + + dev=saa7134->saadev; + + dsp_buffer_conf(dev,saapcm->pcm_count,(saapcm->pcm_size/saapcm->pcm_count)); + + err = dsp_buffer_init(dev); + if (0 != err) + goto fail2; + + /* prepare buffer */ + if (0 != (err = videobuf_dma_pci_map(dev->pci,&dev->dmasound.dma))) + return err; + if (0 != (err = saa7134_pgtable_alloc(dev->pci,&dev->dmasound.pt))) + goto fail1; + if (0 != (err = saa7134_pgtable_build(dev->pci,&dev->dmasound.pt, + dev->dmasound.dma.sglist, + dev->dmasound.dma.sglen, + 0))) + goto fail2; - dev = saa7134->dev; - if (snd_pcm_format_width(runtime->format) == 8) + + switch (runtime->format) { + case SNDRV_PCM_FORMAT_U8: + case SNDRV_PCM_FORMAT_S8: fmt = 0x00; - else + break; + case SNDRV_PCM_FORMAT_U16_LE: + case SNDRV_PCM_FORMAT_U16_BE: + case SNDRV_PCM_FORMAT_S16_LE: + case SNDRV_PCM_FORMAT_S16_BE: fmt = 0x01; + break; + default: + err = -EINVAL; + return 1; + } - if (snd_pcm_format_signed(runtime->format)) + switch (runtime->format) { + case SNDRV_PCM_FORMAT_S8: + case SNDRV_PCM_FORMAT_S16_LE: + case SNDRV_PCM_FORMAT_S16_BE: sign = 1; - else + break; + default: sign = 0; + break; + } - if (snd_pcm_format_big_endian(runtime->format)) - bswap = 1; - else - bswap = 0; + switch (runtime->format) { + case SNDRV_PCM_FORMAT_U16_BE: + case SNDRV_PCM_FORMAT_S16_BE: + bswap = 1; break; + default: + bswap = 0; break; + } switch (dev->pci->device) { case PCI_DEVICE_ID_PHILIPS_SAA7134: @@ -385,6 +445,7 @@ static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) fmt |= 0x04; saa_writel(SAA7133_NUM_SAMPLES, dev->dmasound.blksize -1); saa_writel(SAA7133_AUDIO_CHANNEL, 0x543210 | (fmt << 24)); + //saa_writel(SAA7133_AUDIO_CHANNEL, 0x543210); break; } @@ -398,6 +459,12 @@ static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) if (bswap) control |= SAA7134_RS_CONTROL_BSWAP; + /* I should be able to use runtime->dma_addr in the control + byte, but it doesn't work. So I allocate the DMA using the + V4L functions, and force ALSA to use that as the DMA area */ + + runtime->dma_area = dev->dmasound.dma.vmalloc; + saa_writel(SAA7134_RS_BA1(6),0); saa_writel(SAA7134_RS_BA2(6),dev->dmasound.blksize); saa_writel(SAA7134_RS_PITCH(6),0); @@ -406,6 +473,12 @@ static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) dev->dmasound.rate = runtime->rate; return 0; + fail2: + saa7134_pgtable_free(dev->pci,&dev->dmasound.pt); + fail1: + videobuf_dma_pci_unmap(dev->pci,&dev->dmasound.dma); + return err; + } @@ -423,8 +496,10 @@ static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) static snd_pcm_uframes_t snd_card_saa7134_capture_pointer(snd_pcm_substream_t * substream) { snd_pcm_runtime_t *runtime = substream->runtime; - snd_card_saa7134_pcm_t *pcm = runtime->private_data; - struct saa7134_dev *dev=pcm->dev; + snd_card_saa7134_pcm_t *saapcm = runtime->private_data; + struct saa7134_dev *dev=saapcm->saadev; + + if (dev->dmasound.read_count) { dev->dmasound.read_count -= snd_pcm_lib_period_bytes(substream); @@ -465,9 +540,9 @@ static snd_pcm_hardware_t snd_card_saa7134_capture = static void snd_card_saa7134_runtime_free(snd_pcm_runtime_t *runtime) { - snd_card_saa7134_pcm_t *pcm = runtime->private_data; + snd_card_saa7134_pcm_t *saapcm = runtime->private_data; - kfree(pcm); + kfree(saapcm); } @@ -477,76 +552,17 @@ static void snd_card_saa7134_runtime_free(snd_pcm_runtime_t *runtime) * - One of the ALSA capture callbacks. * * Called on initialization, right before the PCM preparation + * Usually used in ALSA to allocate the DMA, but since we don't use the + * ALSA DMA it does nothing * */ static int snd_card_saa7134_hw_params(snd_pcm_substream_t * substream, snd_pcm_hw_params_t * hw_params) { - snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); - struct saa7134_dev *dev; - unsigned int period_size, periods; - int err; - - period_size = params_period_bytes(hw_params); - periods = params_periods(hw_params); - - snd_assert(period_size >= 0x100 && period_size <= 0x10000, - return -EINVAL); - snd_assert(periods >= 2, return -EINVAL); - snd_assert(period_size * periods <= 1024 * 1024, return -EINVAL); - - dev = saa7134->dev; - - if (dev->dmasound.blocks == periods && - dev->dmasound.blksize == period_size) - return 0; - /* release the old buffer */ - if (substream->runtime->dma_area) { - saa7134_pgtable_free(dev->pci, &dev->dmasound.pt); - videobuf_dma_pci_unmap(dev->pci, &dev->dmasound.dma); - dsp_buffer_free(dev); - substream->runtime->dma_area = NULL; - } - dev->dmasound.blocks = periods; - dev->dmasound.blksize = period_size; - dev->dmasound.bufsize = period_size * periods; - - err = dsp_buffer_init(dev); - if (0 != err) { - dev->dmasound.blocks = 0; - dev->dmasound.blksize = 0; - dev->dmasound.bufsize = 0; - return err; - } - - if (0 != (err = videobuf_dma_pci_map(dev->pci, &dev->dmasound.dma))) { - dsp_buffer_free(dev); - return err; - } - if (0 != (err = saa7134_pgtable_alloc(dev->pci,&dev->dmasound.pt))) { - videobuf_dma_pci_unmap(dev->pci, &dev->dmasound.dma); - dsp_buffer_free(dev); - return err; - } - if (0 != (err = saa7134_pgtable_build(dev->pci,&dev->dmasound.pt, - dev->dmasound.dma.sglist, - dev->dmasound.dma.sglen, - 0))) { - saa7134_pgtable_free(dev->pci, &dev->dmasound.pt); - videobuf_dma_pci_unmap(dev->pci, &dev->dmasound.dma); - dsp_buffer_free(dev); - return err; - } - - /* I should be able to use runtime->dma_addr in the control - byte, but it doesn't work. So I allocate the DMA using the - V4L functions, and force ALSA to use that as the DMA area */ - - substream->runtime->dma_area = dev->dmasound.dma.vmalloc; + return 0; - return 1; } @@ -556,23 +572,33 @@ static int snd_card_saa7134_hw_params(snd_pcm_substream_t * substream, * - One of the ALSA capture callbacks. * * Called after closing the device, but before snd_card_saa7134_capture_close - * It stops the DMA audio and releases the buffers. + * Usually used in ALSA to free the DMA, but since we don't use the + * ALSA DMA I'm almost sure this isn't necessary. * */ static int snd_card_saa7134_hw_free(snd_pcm_substream_t * substream) { - snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); - struct saa7134_dev *dev; + return 0; +} - dev = saa7134->dev; +/* + * DMA buffer release + * + * Called after closing the device, during snd_card_saa7134_capture_close + * + */ - if (substream->runtime->dma_area) { - saa7134_pgtable_free(dev->pci, &dev->dmasound.pt); - videobuf_dma_pci_unmap(dev->pci, &dev->dmasound.dma); - dsp_buffer_free(dev); - substream->runtime->dma_area = NULL; - } +static int dsp_buffer_free(struct saa7134_dev *dev) +{ + if (!dev->dmasound.blksize) + BUG(); + + videobuf_dma_free(&dev->dmasound.dma); + + dev->dmasound.blocks = 0; + dev->dmasound.blksize = 0; + dev->dmasound.bufsize = 0; return 0; } @@ -582,12 +608,21 @@ static int snd_card_saa7134_hw_free(snd_pcm_substream_t * substream) * * - One of the ALSA capture callbacks. * - * Called after closing the device. + * Called after closing the device. It stops the DMA audio and releases + * the buffers * */ static int snd_card_saa7134_capture_close(snd_pcm_substream_t * substream) { + snd_card_saa7134_t *chip = snd_pcm_substream_chip(substream); + struct saa7134_dev *dev = chip->saadev; + + /* unlock buffer */ + saa7134_pgtable_free(dev->pci,&dev->dmasound.pt); + videobuf_dma_pci_unmap(dev->pci,&dev->dmasound.dma); + + dsp_buffer_free(dev); return 0; } @@ -604,28 +639,29 @@ static int snd_card_saa7134_capture_close(snd_pcm_substream_t * substream) static int snd_card_saa7134_capture_open(snd_pcm_substream_t * substream) { snd_pcm_runtime_t *runtime = substream->runtime; - snd_card_saa7134_pcm_t *pcm; + snd_card_saa7134_pcm_t *saapcm; snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); - struct saa7134_dev *dev = saa7134->dev; + struct saa7134_dev *dev = saa7134->saadev; int err; down(&dev->dmasound.lock); + dev->dmasound.afmt = SNDRV_PCM_FORMAT_U8; + dev->dmasound.channels = 2; dev->dmasound.read_count = 0; dev->dmasound.read_offset = 0; up(&dev->dmasound.lock); - pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); - if (pcm == NULL) + saapcm = kzalloc(sizeof(*saapcm), GFP_KERNEL); + if (saapcm == NULL) return -ENOMEM; + saapcm->saadev=saa7134->saadev; - pcm->dev=saa7134->dev; - - spin_lock_init(&pcm->lock); + spin_lock_init(&saapcm->lock); - pcm->substream = substream; - runtime->private_data = pcm; + saapcm->substream = substream; + runtime->private_data = saapcm; runtime->private_free = snd_card_saa7134_runtime_free; runtime->hw = snd_card_saa7134_capture; @@ -700,6 +736,7 @@ static int snd_saa7134_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ static int snd_saa7134_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) { snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); + unsigned long flags; int change, addr = kcontrol->private_value; int left, right; @@ -713,12 +750,12 @@ static int snd_saa7134_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ right = 0; if (right > 20) right = 20; - spin_lock_irq(&chip->mixer_lock); + spin_lock_irqsave(&chip->mixer_lock, flags); change = chip->mixer_volume[addr][0] != left || chip->mixer_volume[addr][1] != right; chip->mixer_volume[addr][0] = left; chip->mixer_volume[addr][1] = right; - spin_unlock_irq(&chip->mixer_lock); + spin_unlock_irqrestore(&chip->mixer_lock, flags); return change; } @@ -740,37 +777,38 @@ static int snd_saa7134_capsrc_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_ static int snd_saa7134_capsrc_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) { snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); + unsigned long flags; int addr = kcontrol->private_value; - spin_lock_irq(&chip->mixer_lock); + spin_lock_irqsave(&chip->mixer_lock, flags); ucontrol->value.integer.value[0] = chip->capture_source[addr][0]; ucontrol->value.integer.value[1] = chip->capture_source[addr][1]; - spin_unlock_irq(&chip->mixer_lock); - + spin_unlock_irqrestore(&chip->mixer_lock, flags); return 0; } static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) { snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); + unsigned long flags; int change, addr = kcontrol->private_value; int left, right; u32 anabar, xbarin; int analog_io, rate; struct saa7134_dev *dev; - dev = chip->dev; + dev = chip->saadev; left = ucontrol->value.integer.value[0] & 1; right = ucontrol->value.integer.value[1] & 1; - spin_lock_irq(&chip->mixer_lock); + spin_lock_irqsave(&chip->mixer_lock, flags); change = chip->capture_source[addr][0] != left || chip->capture_source[addr][1] != right; chip->capture_source[addr][0] = left; chip->capture_source[addr][1] = right; dev->dmasound.input=addr; - spin_unlock_irq(&chip->mixer_lock); + spin_unlock_irqrestore(&chip->mixer_lock, flags); if (change) { @@ -860,44 +898,43 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip) return 0; } -static void snd_saa7134_free(snd_card_t * card) +static int snd_saa7134_free(snd_card_saa7134_t *chip) { - snd_card_saa7134_t *chip = card->private_data; - - if (chip->dev->dmasound.priv_data == NULL) - return; - - if (chip->irq >= 0) { - synchronize_irq(chip->irq); - free_irq(chip->irq, &chip->dev->dmasound); - } - - chip->dev->dmasound.priv_data = NULL; + return 0; +} +static int snd_saa7134_dev_free(snd_device_t *device) +{ + snd_card_saa7134_t *chip = device->device_data; + return snd_saa7134_free(chip); } /* * ALSA initialization * - * Called by the init routine, once for each saa7134 device present, - * it creates the basic structures and registers the ALSA devices + * Called by saa7134-core, it creates the basic structures and registers + * the ALSA devices * */ -static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) +int alsa_card_saa7134_create (struct saa7134_dev *saadev) { + static int dev; snd_card_t *card; snd_card_saa7134_t *chip; int err; + static snd_device_ops_t ops = { + .dev_free = snd_saa7134_dev_free, + }; - if (devnum >= SNDRV_CARDS) + if (dev >= SNDRV_CARDS) return -ENODEV; - if (!enable[devnum]) + if (!enable[dev]) return -ENODEV; - card = snd_card_new(index[devnum], id[devnum], THIS_MODULE, sizeof(snd_card_saa7134_t)); + card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); if (card == NULL) return -ENOMEM; @@ -906,33 +943,34 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) /* Card "creation" */ - card->private_free = snd_saa7134_free; - chip = (snd_card_saa7134_t *) card->private_data; + chip = kcalloc(1, sizeof(*chip), GFP_KERNEL); + if (chip == NULL) { + return -ENOMEM; + } spin_lock_init(&chip->lock); spin_lock_init(&chip->mixer_lock); - chip->dev = dev; + chip->saadev = saadev; chip->card = card; - chip->pci = dev->pci; - chip->iobase = pci_resource_start(dev->pci, 0); + chip->pci = saadev->pci; + chip->irq = saadev->pci->irq; + chip->iobase = pci_resource_start(saadev->pci, 0); - - err = request_irq(dev->pci->irq, saa7134_alsa_irq, - SA_SHIRQ | SA_INTERRUPT, dev->name, - (void*) &dev->dmasound); + err = request_irq(saadev->pci->irq, saa7134_alsa_irq, + SA_SHIRQ | SA_INTERRUPT, saadev->name, saadev); if (err < 0) { printk(KERN_ERR "%s: can't get IRQ %d for ALSA\n", - dev->name, dev->pci->irq); + saadev->name, saadev->pci->irq); goto __nodev; } - chip->irq = dev->pci->irq; - - init_MUTEX(&dev->dmasound.lock); + if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { + goto __nodev; + } if ((err = snd_card_saa7134_new_mixer(chip)) < 0) goto __nodev; @@ -946,36 +984,19 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) strcpy(card->shortname, "SAA7134"); sprintf(card->longname, "%s at 0x%lx irq %d", - chip->dev->name, chip->iobase, chip->irq); - - printk(KERN_INFO "%s/alsa: %s registered as card %d\n",dev->name,card->longname,index[devnum]); + chip->saadev->name, chip->iobase, chip->irq); if ((err = snd_card_register(card)) == 0) { - snd_saa7134_cards[devnum] = card; + snd_saa7134_cards[dev] = card; return 0; } __nodev: snd_card_free(card); + kfree(chip); return err; } - -static int alsa_device_init(struct saa7134_dev *dev) -{ - dev->dmasound.priv_data = dev; - alsa_card_saa7134_create(dev,dev->nr); - return 1; -} - -static int alsa_device_exit(struct saa7134_dev *dev) -{ - - snd_card_free(snd_saa7134_cards[dev->nr]); - snd_saa7134_cards[dev->nr] = NULL; - return 1; -} - /* * Module initializer * @@ -986,30 +1007,17 @@ static int alsa_device_exit(struct saa7134_dev *dev) static int saa7134_alsa_init(void) { - struct saa7134_dev *dev = NULL; - struct list_head *list; - - if (!dmasound_init && !dmasound_exit) { - dmasound_init = alsa_device_init; - dmasound_exit = alsa_device_exit; - } else { - printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n"); - return -EBUSY; - } + struct saa7134_dev *saadev = NULL; + struct list_head *list; printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); - list_for_each(list,&saa7134_devlist) { - dev = list_entry(list, struct saa7134_dev, devlist); - if (dev->dmasound.priv_data == NULL) { - alsa_device_init(dev); - } else { - printk(KERN_ERR "saa7134 ALSA: DMA sound is being handled by OSS. ignoring %s\n",dev->name); - return -EBUSY; - } - } + list_for_each(list,&saa7134_devlist) { + saadev = list_entry(list, struct saa7134_dev, devlist); + alsa_card_saa7134_create(saadev); + } - if (dev == NULL) + if (saadev == NULL) printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); return 0; @@ -1020,7 +1028,7 @@ static int saa7134_alsa_init(void) * Module destructor */ -static void saa7134_alsa_exit(void) +void saa7134_alsa_exit(void) { int idx; @@ -1028,18 +1036,12 @@ static void saa7134_alsa_exit(void) snd_card_free(snd_saa7134_cards[idx]); } - dmasound_init = NULL; - dmasound_exit = NULL; printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); return; } -/* We initialize this late, to make sure the sound system is up and running */ -late_initcall(saa7134_alsa_init); +module_init(saa7134_alsa_init); module_exit(saa7134_alsa_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Ricardo Cerqueira"); - - - diff --git a/trunk/drivers/media/video/saa7134/saa7134-cards.c b/trunk/drivers/media/video/saa7134/saa7134-cards.c index 672fb205959f..663d03e5bc67 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-cards.c +++ b/trunk/drivers/media/video/saa7134/saa7134-cards.c @@ -976,7 +976,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, + .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER, .inputs = {{ .name = name_tv, .vmux = 3, @@ -2529,32 +2529,6 @@ struct saa7134_board saa7134_boards[] = { .amux = LINE1, }}, }, - [SAA7134_BOARD_MSI_TVATANYWHERE_PLUS] = { - .name = "MSI TV@Anywhere plus", - .audio_clock = 0x00187de7, - .tuner_type = TUNER_PHILIPS_TDA8290, - .radio_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .inputs = {{ - .name = name_tv, - .vmux = 1, - .amux = TV, - .tv = 1, - },{ - .name = name_comp1, - .vmux = 3, - .amux = LINE1, - },{ - .name = name_svideo, - .vmux = 0, - .amux = LINE1, - }}, - .radio = { - .name = name_radio, - .amux = LINE1, - }, - }, }; const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); @@ -2995,12 +2969,6 @@ struct pci_device_id saa7134_pci_tbl[] = { .subvendor = PCI_VENDOR_ID_PHILIPS, .subdevice = 0x2018, .driver_data = SAA7134_BOARD_PHILIPS_TIGER, - },{ - .vendor = PCI_VENDOR_ID_PHILIPS, - .device = PCI_DEVICE_ID_PHILIPS_SAA7133, - .subvendor = 0x1462, - .subdevice = 0x6231, - .driver_data = SAA7134_BOARD_MSI_TVATANYWHERE_PLUS, },{ /* --- boards without eeprom + subsystem ID --- */ .vendor = PCI_VENDOR_ID_PHILIPS, diff --git a/trunk/drivers/media/video/saa7134/saa7134-core.c b/trunk/drivers/media/video/saa7134/saa7134-core.c index 23d8747338ed..19b88744fb31 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-core.c +++ b/trunk/drivers/media/video/saa7134/saa7134-core.c @@ -53,13 +53,13 @@ static unsigned int gpio_tracking = 0; module_param(gpio_tracking, int, 0644); MODULE_PARM_DESC(gpio_tracking,"enable debug messages [gpio]"); -static unsigned int alsa = 0; -module_param(alsa, int, 0644); -MODULE_PARM_DESC(alsa,"enable ALSA DMA sound [dmasound]"); - static unsigned int oss = 0; -module_param(oss, int, 0644); -MODULE_PARM_DESC(oss,"enable OSS DMA sound [dmasound]"); +module_param(oss, int, 0444); +MODULE_PARM_DESC(oss,"register oss devices (default: no)"); + +static unsigned int alsa = 0; +module_param(alsa, int, 0444); +MODULE_PARM_DESC(alsa,"register alsa devices (default: no)"); static unsigned int latency = UNSET; module_param(latency, int, 0444); @@ -68,19 +68,24 @@ MODULE_PARM_DESC(latency,"pci latency timer"); static unsigned int video_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; static unsigned int vbi_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; static unsigned int radio_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; +static unsigned int dsp_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; +static unsigned int mixer_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; static unsigned int tuner[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; static unsigned int card[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; - module_param_array(video_nr, int, NULL, 0444); module_param_array(vbi_nr, int, NULL, 0444); module_param_array(radio_nr, int, NULL, 0444); +module_param_array(dsp_nr, int, NULL, 0444); +module_param_array(mixer_nr, int, NULL, 0444); module_param_array(tuner, int, NULL, 0444); module_param_array(card, int, NULL, 0444); MODULE_PARM_DESC(video_nr, "video device number"); MODULE_PARM_DESC(vbi_nr, "vbi device number"); MODULE_PARM_DESC(radio_nr, "radio device number"); +MODULE_PARM_DESC(dsp_nr, "oss dsp device number"); +MODULE_PARM_DESC(mixer_nr, "oss mixer device number"); MODULE_PARM_DESC(tuner, "tuner type"); MODULE_PARM_DESC(card, "card type"); @@ -89,9 +94,6 @@ LIST_HEAD(saa7134_devlist); static LIST_HEAD(mops_list); static unsigned int saa7134_devcount; -int (*dmasound_init)(struct saa7134_dev *dev); -int (*dmasound_exit)(struct saa7134_dev *dev); - #define dprintk(fmt, arg...) if (core_debug) \ printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg) @@ -188,11 +190,11 @@ void saa7134_track_gpio(struct saa7134_dev *dev, char *msg) /* ----------------------------------------------------------- */ /* delayed request_module */ -#if defined(CONFIG_MODULES) && defined(MODULE) +#ifdef CONFIG_MODULES + static int need_empress; static int need_dvb; static int need_alsa; -static int need_oss; static int pending_call(struct notifier_block *self, unsigned long state, void *module) @@ -206,8 +208,6 @@ static int pending_call(struct notifier_block *self, unsigned long state, request_module("saa7134-dvb"); if (need_alsa) request_module("saa7134-alsa"); - if (need_oss) - request_module("saa7134-oss"); return NOTIFY_DONE; } @@ -218,11 +218,10 @@ static struct notifier_block pending_notifier = { static void request_module_depend(char *name, int *flag) { - int err; switch (THIS_MODULE->state) { case MODULE_STATE_COMING: if (!pending_registered) { - err = register_module_notifier(&pending_notifier); + register_module_notifier(&pending_notifier); pending_registered = 1; } *flag = 1; @@ -237,7 +236,9 @@ static void request_module_depend(char *name, int *flag) } #else + #define request_module_depend(name,flag) + #endif /* CONFIG_MODULES */ /* ------------------------------------------------------------------ */ @@ -577,14 +578,12 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) goto out; } - /* If dmasound support is active and we get a sound report, exit - and let the saa7134-alsa/oss module deal with it */ + /* If alsa support is active and we get a sound report, exit + and let the saa7134-alsa module deal with it */ - if ((report & SAA7134_IRQ_REPORT_DONE_RA3) && - (dev->dmasound.priv_data != NULL) ) - { + if ((report & SAA7134_IRQ_REPORT_DONE_RA3) && alsa) { if (irq_debug > 1) - printk(KERN_DEBUG "%s/irq: ignoring interrupt for DMA sound\n", + printk(KERN_DEBUG "%s/irq: ignoring interrupt for ALSA\n", dev->name); goto out; } @@ -610,6 +609,12 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) card_has_mpeg(dev)) saa7134_irq_ts_done(dev,status); + if ((report & SAA7134_IRQ_REPORT_DONE_RA3)) { + if (oss) { + saa7134_irq_oss_done(dev,status); + } + } + if ((report & (SAA7134_IRQ_REPORT_GPIO16 | SAA7134_IRQ_REPORT_GPIO18)) && dev->remote) @@ -684,6 +689,14 @@ static int saa7134_hwinit1(struct saa7134_dev *dev) * audio will not work. */ + switch (dev->pci->device) { + case PCI_DEVICE_ID_PHILIPS_SAA7134: + case PCI_DEVICE_ID_PHILIPS_SAA7133: + case PCI_DEVICE_ID_PHILIPS_SAA7135: + saa7134_oss_init1(dev); + break; + } + /* enable peripheral devices */ saa_writeb(SAA7134_SPECIAL_MODE, 0x01); @@ -715,6 +728,8 @@ static int saa7134_hwinit2(struct saa7134_dev *dev) irq2_mask |= (SAA7134_IRQ2_INTE_GPIO18 | SAA7134_IRQ2_INTE_GPIO18A | SAA7134_IRQ2_INTE_GPIO16 ); + else if (dev->has_remote == SAA7134_REMOTE_I2C) + request_module("ir-kbd-i2c"); saa_writel(SAA7134_IRQ1, 0); saa_writel(SAA7134_IRQ2, irq2_mask); @@ -727,6 +742,13 @@ static int saa7134_hwfini(struct saa7134_dev *dev) { dprintk("hwfini\n"); + switch (dev->pci->device) { + case PCI_DEVICE_ID_PHILIPS_SAA7134: + case PCI_DEVICE_ID_PHILIPS_SAA7133: + case PCI_DEVICE_ID_PHILIPS_SAA7135: + saa7134_oss_fini(dev); + break; + } if (card_has_mpeg(dev)) saa7134_ts_fini(dev); saa7134_input_fini(dev); @@ -964,12 +986,11 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, if (card_is_dvb(dev)) request_module_depend("saa7134-dvb",&need_dvb); - - if (alsa) + if (!oss && alsa) { + dprintk("Requesting ALSA module\n"); request_module_depend("saa7134-alsa",&need_alsa); + } - if (oss) - request_module_depend("saa7134-oss",&need_oss); v4l2_prio_init(&dev->prio); @@ -1003,6 +1024,32 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, dev->name,dev->radio_dev->minor & 0x1f); } + /* register oss devices */ + switch (dev->pci->device) { + case PCI_DEVICE_ID_PHILIPS_SAA7134: + case PCI_DEVICE_ID_PHILIPS_SAA7133: + case PCI_DEVICE_ID_PHILIPS_SAA7135: + if (oss) { + err = dev->dmasound.minor_dsp = + register_sound_dsp(&saa7134_dsp_fops, + dsp_nr[dev->nr]); + if (err < 0) { + goto fail4; + } + printk(KERN_INFO "%s: registered device dsp%d\n", + dev->name,dev->dmasound.minor_dsp >> 4); + + err = dev->dmasound.minor_mixer = + register_sound_mixer(&saa7134_mixer_fops, + mixer_nr[dev->nr]); + if (err < 0) + goto fail5; + printk(KERN_INFO "%s: registered device mixer%d\n", + dev->name,dev->dmasound.minor_mixer >> 4); + } + break; + } + /* everything worked */ pci_set_drvdata(pci_dev,dev); saa7134_devcount++; @@ -1017,13 +1064,17 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, /* check for signal */ saa7134_irq_video_intl(dev); - - if (dmasound_init && !dev->dmasound.priv_data) { - dmasound_init(dev); - } - return 0; + fail5: + switch (dev->pci->device) { + case PCI_DEVICE_ID_PHILIPS_SAA7134: + case PCI_DEVICE_ID_PHILIPS_SAA7133: + case PCI_DEVICE_ID_PHILIPS_SAA7135: + if (oss) + unregister_sound_dsp(dev->dmasound.minor_dsp); + break; + } fail4: saa7134_unregister_video(dev); saa7134_i2c_unregister(dev); @@ -1045,11 +1096,6 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev) struct list_head *item; struct saa7134_mpeg_ops *mops; - /* Release DMA sound modules if present */ - if (dmasound_exit && dev->dmasound.priv_data) { - dmasound_exit(dev); - } - /* debugging ... */ if (irq_debug) { u32 report = saa_readl(SAA7134_IRQ_REPORT); @@ -1079,18 +1125,19 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev) saa7134_devcount--; saa7134_i2c_unregister(dev); - saa7134_unregister_video(dev); - - - /* the DMA sound modules should be unloaded before reaching - this, but just in case they are still present... */ - if (dev->dmasound.priv_data != NULL) { - free_irq(pci_dev->irq, &dev->dmasound); - dev->dmasound.priv_data = NULL; + switch (dev->pci->device) { + case PCI_DEVICE_ID_PHILIPS_SAA7134: + case PCI_DEVICE_ID_PHILIPS_SAA7133: + case PCI_DEVICE_ID_PHILIPS_SAA7135: + if (oss) { + unregister_sound_mixer(dev->dmasound.minor_mixer); + unregister_sound_dsp(dev->dmasound.minor_dsp); + } + break; } + saa7134_unregister_video(dev); - - /* release resources */ + /* release ressources */ free_irq(pci_dev->irq, dev); iounmap(dev->lmmio); release_mem_region(pci_resource_start(pci_dev,0), @@ -1161,10 +1208,10 @@ static int saa7134_init(void) static void saa7134_fini(void) { -#if defined(CONFIG_MODULES) && defined(MODULE) +#ifdef CONFIG_MODULES if (pending_registered) unregister_module_notifier(&pending_notifier); -#endif /* CONFIG_MODULES */ +#endif pci_unregister_driver(&saa7134_pci_driver); } @@ -1178,10 +1225,8 @@ EXPORT_SYMBOL(saa7134_i2c_call_clients); EXPORT_SYMBOL(saa7134_devlist); EXPORT_SYMBOL(saa7134_boards); -/* ----------------- for the DMA sound modules --------------- */ +/* ----------------- For ALSA -------------------------------- */ -EXPORT_SYMBOL(dmasound_init); -EXPORT_SYMBOL(dmasound_exit); EXPORT_SYMBOL(saa7134_pgtable_free); EXPORT_SYMBOL(saa7134_pgtable_build); EXPORT_SYMBOL(saa7134_pgtable_alloc); diff --git a/trunk/drivers/media/video/saa7134/saa7134-empress.c b/trunk/drivers/media/video/saa7134/saa7134-empress.c index 575f3e835f91..e9ec69efb4c9 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-empress.c +++ b/trunk/drivers/media/video/saa7134/saa7134-empress.c @@ -36,7 +36,6 @@ MODULE_AUTHOR("Gerd Knorr [SuSE Labs]"); MODULE_LICENSE("GPL"); static unsigned int empress_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; - module_param_array(empress_nr, int, NULL, 0444); MODULE_PARM_DESC(empress_nr,"ts device number"); diff --git a/trunk/drivers/media/video/saa7134/saa7134-i2c.c b/trunk/drivers/media/video/saa7134/saa7134-i2c.c index df9dd36721e0..7575043f0874 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-i2c.c +++ b/trunk/drivers/media/video/saa7134/saa7134-i2c.c @@ -333,7 +333,7 @@ static int attach_inform(struct i2c_client *client) struct tuner_setup tun_setup; d1printk( "%s i2c attach [addr=0x%x,client=%s]\n", - client->driver->name, client->addr, client->name); + client->driver->name, client->addr, client->name); /* Am I an i2c remote control? */ diff --git a/trunk/drivers/media/video/saa7134/saa7134-input.c b/trunk/drivers/media/video/saa7134/saa7134-input.c index ab75ca5ac356..329accda6d45 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-input.c +++ b/trunk/drivers/media/video/saa7134/saa7134-input.c @@ -485,6 +485,64 @@ static IR_KEYTAB_TYPE ir_codes_purpletv[IR_KEYTAB_SIZE] = { }; +static IR_KEYTAB_TYPE ir_codes_pinnacle[IR_KEYTAB_SIZE] = { + [ 0x59 ] = KEY_MUTE, + [ 0x4a ] = KEY_POWER, + + [ 0x18 ] = KEY_TEXT, + [ 0x26 ] = KEY_TV, + [ 0x3d ] = KEY_PRINT, + + [ 0x48 ] = KEY_RED, + [ 0x04 ] = KEY_GREEN, + [ 0x11 ] = KEY_YELLOW, + [ 0x00 ] = KEY_BLUE, + + [ 0x2d ] = KEY_VOLUMEUP, + [ 0x1e ] = KEY_VOLUMEDOWN, + + [ 0x49 ] = KEY_MENU, + + [ 0x16 ] = KEY_CHANNELUP, + [ 0x17 ] = KEY_CHANNELDOWN, + + [ 0x20 ] = KEY_UP, + [ 0x21 ] = KEY_DOWN, + [ 0x22 ] = KEY_LEFT, + [ 0x23 ] = KEY_RIGHT, + [ 0x0d ] = KEY_SELECT, + + + + [ 0x08 ] = KEY_BACK, + [ 0x07 ] = KEY_REFRESH, + + [ 0x2f ] = KEY_ZOOM, + [ 0x29 ] = KEY_RECORD, + + [ 0x4b ] = KEY_PAUSE, + [ 0x4d ] = KEY_REWIND, + [ 0x2e ] = KEY_PLAY, + [ 0x4e ] = KEY_FORWARD, + [ 0x53 ] = KEY_PREVIOUS, + [ 0x4c ] = KEY_STOP, + [ 0x54 ] = KEY_NEXT, + + [ 0x69 ] = KEY_KP0, + [ 0x6a ] = KEY_KP1, + [ 0x6b ] = KEY_KP2, + [ 0x6c ] = KEY_KP3, + [ 0x6d ] = KEY_KP4, + [ 0x6e ] = KEY_KP5, + [ 0x6f ] = KEY_KP6, + [ 0x70 ] = KEY_KP7, + [ 0x71 ] = KEY_KP8, + [ 0x72 ] = KEY_KP9, + + [ 0x74 ] = KEY_CHANNEL, + [ 0x0a ] = KEY_BACKSPACE, +}; + /* Mapping for the 28 key remote control as seen at http://www.sednacomputer.com/photo/cardbus-tv.jpg Pavel Mihaylov */ @@ -577,6 +635,57 @@ static int get_key_purpletv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) return 1; } +/* The new pinnacle PCTV remote (with the colored buttons) + * + * Ricardo Cerqueira + */ + +static int get_key_pinnacle(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) +{ + unsigned char b[4]; + unsigned int start = 0,parity = 0,code = 0; + + /* poll IR chip */ + if (4 != i2c_master_recv(&ir->c,b,4)) { + i2cdprintk("read error\n"); + return -EIO; + } + + for (start = 0; start<4; start++) { + if (b[start] == 0x80) { + code=b[(start+3)%4]; + parity=b[(start+2)%4]; + } + } + + /* Empty Request */ + if (parity==0) + return 0; + + /* Repeating... */ + if (ir->old == parity) + return 0; + + + ir->old = parity; + + /* Reduce code value to fit inside IR_KEYTAB_SIZE + * + * this is the only value that results in 42 unique + * codes < 128 + */ + + code %= 0x88; + + *ir_raw = code; + *ir_key = code; + + i2cdprintk("Pinnacle PCTV key %02x\n", code); + + return 1; +} + + void saa7134_input_irq(struct saa7134_dev *dev) { struct saa7134_ir *ir = dev->remote; @@ -713,8 +822,6 @@ int saa7134_input_init1(struct saa7134_dev *dev) return -ENOMEM; } - ir->dev = input_dev; - /* init hardware-specific stuff */ ir->mask_keycode = mask_keycode; ir->mask_keydown = mask_keydown; diff --git a/trunk/drivers/media/video/saa7134/saa7134-oss.c b/trunk/drivers/media/video/saa7134/saa7134-oss.c index 8badd2a9cb2f..fd53dfcc1644 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-oss.c +++ b/trunk/drivers/media/video/saa7134/saa7134-oss.c @@ -4,8 +4,6 @@ * oss dsp interface * * (c) 2001,02 Gerd Knorr [SuSE Labs] - * 2005 conversion to standalone module: - * Ricardo Cerqueira * * 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 @@ -27,9 +25,7 @@ #include #include #include -#include #include -#include #include #include "saa7134-reg.h" @@ -37,23 +33,15 @@ /* ------------------------------------------------------------------ */ -static unsigned int debug = 0; -module_param(debug, int, 0644); -MODULE_PARM_DESC(debug,"enable debug messages [oss]"); +static unsigned int oss_debug = 0; +module_param(oss_debug, int, 0644); +MODULE_PARM_DESC(oss_debug,"enable debug messages [oss]"); -static unsigned int rate = 0; -module_param(rate, int, 0444); -MODULE_PARM_DESC(rate,"sample rate (valid are: 32000,48000)"); +static unsigned int oss_rate = 0; +module_param(oss_rate, int, 0444); +MODULE_PARM_DESC(oss_rate,"sample rate (valid are: 32000,48000)"); -static unsigned int dsp_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -MODULE_PARM_DESC(dsp_nr, "device numbers for SAA7134 capture interface(s)."); -module_param_array(dsp_nr, int, NULL, 0444); - -static unsigned int mixer_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; -MODULE_PARM_DESC(mixer_nr, "mixer numbers for SAA7134 capture interface(s)."); -module_param_array(mixer_nr, int, NULL, 0444); - -#define dprintk(fmt, arg...) if (debug) \ +#define dprintk(fmt, arg...) if (oss_debug) \ printk(KERN_DEBUG "%s/oss: " fmt, dev->name , ## arg) @@ -381,7 +369,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file, int __user *p = argp; int val = 0; - if (debug > 1) + if (oss_debug > 1) saa7134_print_ioctl(dev->name,cmd); switch (cmd) { case OSS_GETVERSION: @@ -677,7 +665,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, void __user *argp = (void __user *) arg; int __user *p = argp; - if (debug > 1) + if (oss_debug > 1) saa7134_print_ioctl(dev->name,cmd); switch (cmd) { case OSS_GETVERSION: @@ -780,41 +768,8 @@ struct file_operations saa7134_mixer_fops = { /* ------------------------------------------------------------------ */ -static irqreturn_t saa7134_oss_irq(int irq, void *dev_id, struct pt_regs *regs) -{ - struct saa7134_dmasound *dmasound = dev_id; - struct saa7134_dev *dev = dmasound->priv_data; - unsigned long report, status; - int loop, handled = 0; - - for (loop = 0; loop < 10; loop++) { - report = saa_readl(SAA7134_IRQ_REPORT); - status = saa_readl(SAA7134_IRQ_STATUS); - - if (report & SAA7134_IRQ_REPORT_DONE_RA3) { - handled = 1; - saa_writel(SAA7134_IRQ_REPORT,report); - saa7134_irq_oss_done(dev, status); - } else { - goto out; - } - } - - if (loop == 10) { - dprintk("error! looping IRQ!"); - } -out: - return IRQ_RETVAL(handled); -} - int saa7134_oss_init1(struct saa7134_dev *dev) { - - if ((request_irq(dev->pci->irq, saa7134_oss_irq, - SA_SHIRQ | SA_INTERRUPT, dev->name, - (void*) &dev->dmasound)) < 0) - return -1; - /* general */ init_MUTEX(&dev->dmasound.lock); init_waitqueue_head(&dev->dmasound.wq); @@ -830,8 +785,8 @@ int saa7134_oss_init1(struct saa7134_dev *dev) /* dsp */ dev->dmasound.rate = 32000; - if (rate) - dev->dmasound.rate = rate; + if (oss_rate) + dev->dmasound.rate = oss_rate; dev->dmasound.rate = (dev->dmasound.rate > 40000) ? 48000 : 32000; /* mixer */ @@ -885,7 +840,7 @@ void saa7134_irq_oss_done(struct saa7134_dev *dev, unsigned long status) /* next block addr */ next_blk = (dev->dmasound.dma_blk + 2) % dev->dmasound.blocks; saa_writel(reg,next_blk * dev->dmasound.blksize); - if (debug > 2) + if (oss_debug > 2) dprintk("irq: ok, %s, next_blk=%d, addr=%x\n", (status & 0x10000000) ? "even" : "odd ", next_blk, next_blk * dev->dmasound.blksize); @@ -899,124 +854,6 @@ void saa7134_irq_oss_done(struct saa7134_dev *dev, unsigned long status) spin_unlock(&dev->slock); } -static int saa7134_dsp_create(struct saa7134_dev *dev) -{ - int err; - - err = dev->dmasound.minor_dsp = - register_sound_dsp(&saa7134_dsp_fops, - dsp_nr[dev->nr]); - if (err < 0) { - goto fail; - } - printk(KERN_INFO "%s: registered device dsp%d\n", - dev->name,dev->dmasound.minor_dsp >> 4); - - err = dev->dmasound.minor_mixer = - register_sound_mixer(&saa7134_mixer_fops, - mixer_nr[dev->nr]); - if (err < 0) - goto fail; - printk(KERN_INFO "%s: registered device mixer%d\n", - dev->name,dev->dmasound.minor_mixer >> 4); - - return 0; - -fail: - unregister_sound_dsp(dev->dmasound.minor_dsp); - return 0; - - -} - -static int oss_device_init(struct saa7134_dev *dev) -{ - dev->dmasound.priv_data = dev; - saa7134_oss_init1(dev); - saa7134_dsp_create(dev); - return 1; -} - -static int oss_device_exit(struct saa7134_dev *dev) -{ - - unregister_sound_mixer(dev->dmasound.minor_mixer); - unregister_sound_dsp(dev->dmasound.minor_dsp); - - saa7134_oss_fini(dev); - - if (dev->pci->irq > 0) { - synchronize_irq(dev->pci->irq); - free_irq(dev->pci->irq,&dev->dmasound); - } - - dev->dmasound.priv_data = NULL; - return 1; -} - -static int saa7134_oss_init(void) -{ - struct saa7134_dev *dev = NULL; - struct list_head *list; - - if (!dmasound_init && !dmasound_exit) { - dmasound_init = oss_device_init; - dmasound_exit = oss_device_exit; - } else { - printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n"); - return -EBUSY; - } - - printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n"); - - - list_for_each(list,&saa7134_devlist) { - dev = list_entry(list, struct saa7134_dev, devlist); - if (dev->dmasound.priv_data == NULL) { - oss_device_init(dev); - } else { - printk(KERN_ERR "saa7134 OSS: DMA sound is being handled by ALSA, ignoring %s\n",dev->name); - return -EBUSY; - } - } - - if (dev == NULL) - printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n"); - - return 0; - -} - -static void saa7134_oss_exit(void) -{ - struct saa7134_dev *dev = NULL; - struct list_head *list; - - list_for_each(list,&saa7134_devlist) { - dev = list_entry(list, struct saa7134_dev, devlist); - - /* Device isn't registered by OSS, probably ALSA's */ - if (!dev->dmasound.minor_dsp) - continue; - - oss_device_exit(dev); - - } - - dmasound_init = NULL; - dmasound_exit = NULL; - - printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); - - return; -} - -/* We initialize this late, to make sure the sound system is up and running */ -late_initcall(saa7134_oss_init); -module_exit(saa7134_oss_exit); -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Gerd Knorr [SuSE Labs]"); - /* ----------------------------------------------------------- */ /* * Local variables: diff --git a/trunk/drivers/media/video/saa7134/saa7134.h b/trunk/drivers/media/video/saa7134/saa7134.h index add49db1ad41..fb9727471661 100644 --- a/trunk/drivers/media/video/saa7134/saa7134.h +++ b/trunk/drivers/media/video/saa7134/saa7134.h @@ -208,7 +208,6 @@ struct saa7134_format { #define SAA7134_BOARD_SEDNA_PC_TV_CARDBUS 79 #define SAA7134_BOARD_ASUSTEK_DIGIMATRIX_TV 80 #define SAA7134_BOARD_PHILIPS_TIGER 81 -#define SAA7134_BOARD_MSI_TVATANYWHERE_PLUS 82 #define SAA7134_MAXBOARDS 8 #define SAA7134_INPUT_MAX 8 @@ -384,7 +383,6 @@ struct saa7134_dmasound { unsigned int dma_blk; unsigned int read_offset; unsigned int read_count; - void * priv_data; snd_pcm_substream_t *substream; }; @@ -571,10 +569,6 @@ void saa7134_dma_free(struct saa7134_dev *dev,struct saa7134_buf *buf); int saa7134_set_dmabits(struct saa7134_dev *dev); -extern int (*dmasound_init)(struct saa7134_dev *dev); -extern int (*dmasound_exit)(struct saa7134_dev *dev); - - /* ----------------------------------------------------------- */ /* saa7134-cards.c */ diff --git a/trunk/drivers/media/video/tda8290.c b/trunk/drivers/media/video/tda8290.c index 61d94ddaff41..b2dfe07e9f9d 100644 --- a/trunk/drivers/media/video/tda8290.c +++ b/trunk/drivers/media/video/tda8290.c @@ -437,10 +437,6 @@ static void set_audio(struct tuner *t) t->sgIF = 124; t->tda8290_easy_mode = 0x20; mode = "L"; - } else if (t->std & V4L2_STD_SECAM_LC) { - t->sgIF = 20; - t->tda8290_easy_mode = 0x40; - mode = "LC"; } tuner_dbg("setting tda8290 to system %s\n", mode); } diff --git a/trunk/drivers/media/video/tda9887.c b/trunk/drivers/media/video/tda9887.c index 2f2414e90e8b..4249127c0a1d 100644 --- a/trunk/drivers/media/video/tda9887.c +++ b/trunk/drivers/media/video/tda9887.c @@ -12,7 +12,6 @@ #include #include - /* Chips: TDA9885 (PAL, NTSC) TDA9886 (PAL, SECAM, NTSC) @@ -820,12 +819,12 @@ static int tda9887_resume(struct device * dev) static struct i2c_driver driver = { .owner = THIS_MODULE, - .name = "i2c tda9887 driver", - .id = -1, /* FIXME */ - .flags = I2C_DF_NOTIFY, - .attach_adapter = tda9887_probe, - .detach_client = tda9887_detach, - .command = tda9887_command, + .name = "i2c tda9887 driver", + .id = -1, /* FIXME */ + .flags = I2C_DF_NOTIFY, + .attach_adapter = tda9887_probe, + .detach_client = tda9887_detach, + .command = tda9887_command, .driver = { .suspend = tda9887_suspend, .resume = tda9887_resume, @@ -835,7 +834,7 @@ static struct i2c_client client_template = { .name = "tda9887", .flags = I2C_CLIENT_ALLOW_USE, - .driver = &driver, + .driver = &driver, }; static int __init tda9887_init_module(void) diff --git a/trunk/drivers/media/video/tuner-core.c b/trunk/drivers/media/video/tuner-core.c index e58abdfcaab8..73c4041c35d7 100644 --- a/trunk/drivers/media/video/tuner-core.c +++ b/trunk/drivers/media/video/tuner-core.c @@ -251,7 +251,7 @@ static inline int check_mode(struct tuner *t, char *cmd) static char pal[] = "-"; module_param_string(pal, pal, sizeof(pal), 0644); -static char secam[] = "--"; +static char secam[] = "-"; module_param_string(secam, secam, sizeof(secam), 0644); /* get more precise norm info from insmod option */ @@ -307,13 +307,8 @@ static int tuner_fixup_std(struct tuner *t) break; case 'l': case 'L': - if ((secam[1]=='C')||(secam[1]=='c')) { - tuner_dbg ("insmod fixup: SECAM => SECAM-L'\n"); - t->std = V4L2_STD_SECAM_LC; - } else { - tuner_dbg ("insmod fixup: SECAM => SECAM-L\n"); - t->std = V4L2_STD_SECAM_L; - } + tuner_dbg ("insmod fixup: SECAM => SECAM-L\n"); + t->std = V4L2_STD_SECAM_L; break; case '-': /* default parameter, do nothing */ diff --git a/trunk/drivers/media/video/tuner-simple.c b/trunk/drivers/media/video/tuner-simple.c index e0c9fdb9914a..d832205818f2 100644 --- a/trunk/drivers/media/video/tuner-simple.c +++ b/trunk/drivers/media/video/tuner-simple.c @@ -233,7 +233,7 @@ static struct tunertype tuners[] = { { "Ymec TVision TVF-5533MF", Philips, NTSC, 16*160.00,16*454.00,0x01,0x02,0x04,0x8e,732}, - /* 60-69 */ + /* 60-68 */ { "Thomson DDT 7611 (ATSC/NTSC)", THOMSON, ATSC, 16*157.25,16*454.00,0x39,0x3a,0x3c,0x8e,732}, { "Tena TNF9533-D/IF/TNF9533-B/DF", Philips, PAL, @@ -252,8 +252,6 @@ static struct tunertype tuners[] = { 16*160.00,16*442.00,0xa1,0xa2,0xa4,0xc8,623 }, { "Philips TUV1236D ATSC/NTSC dual in", Philips, ATSC, 16*157.25,16*454.00,0x01,0x02,0x04,0xce,732 }, - { "Tena TNF 5335 MF", Philips, NTSC, - 16*157.25,16*454.00,0x01,0x02,0x04,0x8e,732 }, }; unsigned const int tuner_count = ARRAY_SIZE(tuners); diff --git a/trunk/drivers/media/video/tvaudio.c b/trunk/drivers/media/video/tvaudio.c index 5b20e8177cad..c31bf28b73fe 100644 --- a/trunk/drivers/media/video/tvaudio.c +++ b/trunk/drivers/media/video/tvaudio.c @@ -188,7 +188,7 @@ static int chip_write(struct CHIPSTATE *chip, int subaddr, int val) buffer[1] = val; if (2 != i2c_master_send(&chip->c,buffer,2)) { tvaudio_warn("%s: I/O error (write reg%d=0x%x)\n", - chip->c.name, subaddr, val); + chip->c.name, subaddr, val); return -1; } } @@ -216,7 +216,7 @@ static int chip_read(struct CHIPSTATE *chip) chip->c.name); return -1; } - tvaudio_dbg("%s: chip_read: 0x%x\n",chip->c.name, buffer); + tvaudio_dbg("%s: chip_read: 0x%x\n",chip->c.name,buffer); return buffer; } @@ -235,7 +235,7 @@ static int chip_read2(struct CHIPSTATE *chip, int subaddr) return -1; } tvaudio_dbg("%s: chip_read2: reg%d=0x%x\n", - chip->c.name, subaddr,read[0]); + chip->c.name,subaddr,read[0]); return read[0]; } @@ -248,7 +248,7 @@ static int chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd) /* update our shadow register set; print bytes if (debug > 0) */ tvaudio_dbg("%s: chip_cmd(%s): reg=%d, data:", - chip->c.name, name,cmd->bytes[0]); + chip->c.name,name,cmd->bytes[0]); for (i = 1; i < cmd->count; i++) { if (debug) printk(" 0x%x",cmd->bytes[i]); @@ -322,7 +322,7 @@ static void generic_checkmode(struct CHIPSTATE *chip) int mode = desc->getmode(chip); if (mode == chip->prevmode) - return; + return; tvaudio_dbg("%s: thread checkmode\n", chip->c.name); chip->prevmode = mode; @@ -1506,18 +1506,18 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind) return -EIO; } tvaudio_info("%s found @ 0x%x (%s)\n", desc->name, addr<<1, adap->name); - if (desc->flags) { - tvaudio_dbg("matches:%s%s%s.\n", - (desc->flags & CHIP_HAS_VOLUME) ? " volume" : "", - (desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "", - (desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : ""); - } + if (desc->flags) { + tvaudio_dbg("matches:%s%s%s.\n", + (desc->flags & CHIP_HAS_VOLUME) ? " volume" : "", + (desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "", + (desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : ""); + } /* fill required data structures */ - strcpy(chip->c.name, desc->name); + strcpy(chip->c.name,desc->name); chip->type = desc-chiplist; chip->shadow.count = desc->registers+1; - chip->prevmode = -1; + chip->prevmode = -1; /* register */ i2c_attach_client(&chip->c); @@ -1604,7 +1604,7 @@ static int chip_command(struct i2c_client *client, struct CHIPSTATE *chip = i2c_get_clientdata(client); struct CHIPDESC *desc = chiplist + chip->type; - tvaudio_dbg("%s: chip_command 0x%x\n", chip->c.name, cmd); + tvaudio_dbg("%s: chip_command 0x%x\n",chip->c.name,cmd); switch (cmd) { case AUDC_SET_INPUT: @@ -1624,7 +1624,7 @@ static int chip_command(struct i2c_client *client, /* --- v4l ioctls --- */ /* take care: bttv does userspace copying, we'll get a - kernel pointer here... */ + kernel pointer here... */ case VIDIOCGAUDIO: { struct video_audio *va = arg; diff --git a/trunk/drivers/media/video/tveeprom.c b/trunk/drivers/media/video/tveeprom.c index 5ac235365dd8..72e8741e8b59 100644 --- a/trunk/drivers/media/video/tveeprom.c +++ b/trunk/drivers/media/video/tveeprom.c @@ -81,7 +81,7 @@ hauppauge_tuner_fmt[] = { 0x00000010, " PAL(I)" }, { 0x00400000, " SECAM(L/L')" }, { 0x00000e00, " PAL(D/K)" }, - { 0x03000000, " ATSC/DVB Digital" }, + { 0x03000000, " ATSC Digital" }, }; /* This is the full list of possible tuners. Many thanks to Hauppauge for @@ -206,30 +206,16 @@ hauppauge_tuner[] = { TUNER_ABSENT, "TCL 2002MI_3H"}, { TUNER_TCL_2002N, "TCL 2002N 5H"}, /* 100-109 */ - { TUNER_PHILIPS_FMD1216ME_MK3, "Philips FMD1216ME"}, + { TUNER_ABSENT, "Philips FMD1216ME"}, { TUNER_TEA5767, "Philips TEA5768HL FM Radio"}, { TUNER_ABSENT, "Panasonic ENV57H12D5"}, - { TUNER_PHILIPS_FM1236_MK3, "TCL MFNM05-4"}, + { TUNER_ABSENT, "TCL MFNM05-4"}, { TUNER_ABSENT, "TCL MNM05-4"}, { TUNER_PHILIPS_FM1216ME_MK3, "TCL MPE05-2"}, { TUNER_ABSENT, "TCL MQNM05-4"}, { TUNER_ABSENT, "LG TAPC-W701D"}, { TUNER_ABSENT, "TCL 9886P-WM"}, { TUNER_ABSENT, "TCL 1676NM-WM"}, - /* 110-119 */ - { TUNER_ABSENT, "Thompson DTT75105"}, - { TUNER_ABSENT, "Conexant_CX24109"}, - { TUNER_ABSENT, "TCL M2523_5N_E"}, - { TUNER_ABSENT, "TCL M2523_3DB_E"}, - { TUNER_ABSENT, "Philips 8275A"}, - { TUNER_ABSENT, "Microtune MT2060"}, - { TUNER_ABSENT, "Philips FM1236 MK5"}, - { TUNER_ABSENT, "Philips FM1216ME MK5"}, - { TUNER_ABSENT, "TCL M2523_3DI_E"}, - { TUNER_ABSENT, "Samsung THPD5222FG30A"}, - /* 120-129 */ - { TUNER_ABSENT, "Xceive XC3028"}, - { TUNER_ABSENT, "Philips FQ1216LME MK5"}, }; static struct HAUPPAUGE_AUDIOIC @@ -339,7 +325,6 @@ static int hasRadioTuner(int tunerType) case 78: //PNPEnv_TUNER_TDA8275C1_8290_FM: case 89: //PNPEnv_TUNER_TCL_MFPE05_2: case 92: //PNPEnv_TUNER_PHILIPS_FQ1236A_MK4: - case 105: return 1; } return 0; @@ -383,15 +368,10 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, memset(tvee, 0, sizeof(*tvee)); done = len = beenhere = 0; - /* Hack for processing eeprom for em28xx and cx 2388x*/ - if ((eeprom_data[0] == 0x1a) && (eeprom_data[1] == 0xeb) && - (eeprom_data[2] == 0x67) && (eeprom_data[3] == 0x95)) - start=0xa0; /* Generic em28xx offset */ - else if (((eeprom_data[0] & 0xf0) == 0x10) && - (eeprom_data[1] == 0x00) && - (eeprom_data[2] == 0x00) && - (eeprom_data[8] == 0x84)) - start=8; /* Generic cx2388x offset */ + /* Hack for processing eeprom for em28xx */ + if ((eeprom_data[0]==0x1a)&&(eeprom_data[1]==0xeb)&& + (eeprom_data[2]==0x67)&&(eeprom_data[3]==0x95)) + start=0xa0; else start=0; @@ -468,17 +448,6 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, eeprom_data[i+5] + (eeprom_data[i+6] << 8) + (eeprom_data[i+7] << 16); - - if ( (eeprom_data[i + 8] && 0xf0) && - (tvee->serial_number < 0xffffff) ) { - tvee->MAC_address[0] = 0x00; - tvee->MAC_address[1] = 0x0D; - tvee->MAC_address[2] = 0xFE; - tvee->MAC_address[3] = eeprom_data[i + 7]; - tvee->MAC_address[4] = eeprom_data[i + 6]; - tvee->MAC_address[5] = eeprom_data[i + 5]; - tvee->has_MAC_address = 1; - } break; case 0x05: @@ -497,14 +466,11 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, case 0x06: /* tag 'ModelRev' */ tvee->model = - eeprom_data[i + 1] + - (eeprom_data[i + 2] << 8) + - (eeprom_data[i + 3] << 16) + - (eeprom_data[i + 4] << 24); - tvee->revision = - eeprom_data[i +5 ] + - (eeprom_data[i + 6] << 8) + - (eeprom_data[i + 7] << 16); + eeprom_data[i+1] + + (eeprom_data[i+2] << 8); + tvee->revision = eeprom_data[i+5] + + (eeprom_data[i+6] << 8) + + (eeprom_data[i+7] << 16); break; case 0x07: @@ -597,8 +563,6 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, t_name2 = "unknown"; } - tvee->tuner_hauppauge_model = tuner1; - tvee->tuner2_hauppauge_model = tuner2; tvee->tuner_formats = 0; tvee->tuner2_formats = 0; for (i = j = 0; i < 8; i++) { @@ -614,12 +578,6 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, tveeprom_info("Hauppauge model %d, rev %s, serial# %d\n", tvee->model, tvee->rev_str, tvee->serial_number); - if (tvee->has_MAC_address == 1) { - tveeprom_info("MAC address is %02X-%02X-%02X-%02X-%02X-%02X\n", - tvee->MAC_address[0], tvee->MAC_address[1], - tvee->MAC_address[2], tvee->MAC_address[3], - tvee->MAC_address[4], tvee->MAC_address[5]); - } tveeprom_info("tuner model is %s (idx %d, type %d)\n", t_name1, tuner1, tvee->tuner_type); tveeprom_info("TV standards%s%s%s%s%s%s%s%s (eeprom 0x%02x)\n", @@ -753,8 +711,7 @@ tveeprom_detect_client(struct i2c_adapter *adapter, client->driver = &i2c_driver_tveeprom; client->flags = I2C_CLIENT_ALLOW_USE; snprintf(client->name, sizeof(client->name), "tveeprom"); - i2c_attach_client(client); - + i2c_attach_client(client); return 0; } diff --git a/trunk/drivers/media/video/tvp5150.c b/trunk/drivers/media/video/tvp5150.c index 97431e26d229..81e6d4494e7d 100644 --- a/trunk/drivers/media/video/tvp5150.c +++ b/trunk/drivers/media/video/tvp5150.c @@ -31,7 +31,7 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)"); #define dprintk(num, format, args...) \ do { \ if (debug >= num) \ - printk(format, ##args); \ + printk(format , ##args); \ } while (0) /* supported controls */ @@ -770,6 +770,7 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter, if (debug > 1) dump_reg(client); + return 0; } diff --git a/trunk/drivers/media/video/video-buf-dvb.c b/trunk/drivers/media/video/video-buf-dvb.c index 0a4004a4393c..55f129e964eb 100644 --- a/trunk/drivers/media/video/video-buf-dvb.c +++ b/trunk/drivers/media/video/video-buf-dvb.c @@ -13,7 +13,6 @@ * (at your option) any later version. */ - #include #include #include @@ -248,4 +247,3 @@ EXPORT_SYMBOL(videobuf_dvb_unregister); * compile-command: "make DVB=1" * End: */ - diff --git a/trunk/drivers/media/video/video-buf.c b/trunk/drivers/media/video/video-buf.c index 9a6bf287e26a..acfd3a103f35 100644 --- a/trunk/drivers/media/video/video-buf.c +++ b/trunk/drivers/media/video/video-buf.c @@ -753,9 +753,10 @@ videobuf_read_zerocopy(struct videobuf_queue *q, char __user *data, int retval; /* setup stuff */ + retval = -ENOMEM; q->read_buf = videobuf_alloc(q->msize); if (NULL == q->read_buf) - return -ENOMEM; + goto done; q->read_buf->memory = V4L2_MEMORY_USERPTR; q->read_buf->baddr = (unsigned long)data; @@ -816,14 +817,10 @@ ssize_t videobuf_read_one(struct videobuf_queue *q, if (NULL == q->read_buf) goto done; q->read_buf->memory = V4L2_MEMORY_USERPTR; - q->read_buf->bsize = count; /* preferred size */ field = videobuf_next_field(q); retval = q->ops->buf_prepare(q,q->read_buf,field); - if (0 != retval) { - kfree (q->read_buf); - q->read_buf = NULL; + if (0 != retval) goto done; - } spin_lock_irqsave(q->irqlock,flags); q->ops->buf_queue(q,q->read_buf); spin_unlock_irqrestore(q->irqlock,flags); diff --git a/trunk/drivers/media/video/videodev.c b/trunk/drivers/media/video/videodev.c index 6de5b0094b82..83c49f9610d0 100644 --- a/trunk/drivers/media/video/videodev.c +++ b/trunk/drivers/media/video/videodev.c @@ -76,14 +76,14 @@ static void video_release(struct class_device *cd) } static struct class video_class = { - .name = VIDEO_NAME, + .name = VIDEO_NAME, .release = video_release, }; /* - * Active devices + * Active devices */ - + static struct video_device *video_device[VIDEO_NUM_DEVICES]; static DECLARE_MUTEX(videodev_lock); @@ -101,7 +101,7 @@ static int video_open(struct inode *inode, struct file *file) int err = 0; struct video_device *vfl; struct file_operations *old_fops; - + if(minor>=VIDEO_NUM_DEVICES) return -ENODEV; down(&videodev_lock); @@ -189,7 +189,7 @@ video_usercopy(struct inode *inode, struct file *file, return -ENOMEM; parg = mbuf; } - + err = -EFAULT; if (_IOC_DIR(cmd) & _IOC_WRITE) if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) @@ -240,7 +240,7 @@ int video_exclusive_open(struct inode *inode, struct file *file) int video_exclusive_release(struct inode *inode, struct file *file) { struct video_device *vfl = video_devdata(file); - + vfl->users--; return 0; } @@ -253,7 +253,7 @@ static struct file_operations video_fops; * @type: type of device to register * @nr: which device number (0 == /dev/video0, 1 == /dev/video1, ... * -1 == first free) - * + * * The registration code assigns minor numbers based on the type * requested. -ENFILE is returned in all the device slots for this * category are full. If not then the minor field is set and the @@ -269,7 +269,7 @@ static struct file_operations video_fops; * * %VFL_TYPE_VBI - Vertical blank data (undecoded) * - * %VFL_TYPE_RADIO - A radio card + * %VFL_TYPE_RADIO - A radio card */ int video_register_device(struct video_device *vfd, int type, int nr) @@ -278,7 +278,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) int base; int end; char *name_base; - + switch(type) { case VFL_TYPE_GRABBER: @@ -293,7 +293,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) break; case VFL_TYPE_VBI: base=224; - end=256; + end=240; name_base = "vbi"; break; case VFL_TYPE_RADIO: @@ -334,7 +334,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) init_MUTEX(&vfd->lock); /* sysfs class */ - memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev)); + memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev)); if (vfd->dev) vfd->class_dev.dev = vfd->dev; vfd->class_dev.class = &video_class; @@ -360,7 +360,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) * This unregisters the passed device and deassigns the minor * number. Future open calls will be met with errors. */ - + void video_unregister_device(struct video_device *vfd) { down(&videodev_lock); @@ -384,7 +384,7 @@ static struct file_operations video_fops= /* * Initialise video for linux */ - + static int __init videodev_init(void) { int ret; diff --git a/trunk/drivers/media/video/wm8775.c b/trunk/drivers/media/video/wm8775.c index a6936ad74fcf..22f286222004 100644 --- a/trunk/drivers/media/video/wm8775.c +++ b/trunk/drivers/media/video/wm8775.c @@ -5,11 +5,6 @@ * * Based on saa7115 driver * - * Copyright (C) 2005 Hans Verkuil - * - Cleanup - * - V4L2 API update - * - sound fixes - * * 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 @@ -36,7 +31,7 @@ #include MODULE_DESCRIPTION("wm8775 driver"); -MODULE_AUTHOR("Ulf Eklund, Hans Verkuil"); +MODULE_AUTHOR("Ulf Eklund"); MODULE_LICENSE("GPL"); #define wm8775_err(fmt, arg...) do { \ diff --git a/trunk/drivers/message/fusion/mptbase.c b/trunk/drivers/message/fusion/mptbase.c index 537836068c49..74022316fc63 100644 --- a/trunk/drivers/message/fusion/mptbase.c +++ b/trunk/drivers/message/fusion/mptbase.c @@ -91,9 +91,9 @@ static int mfcounter = 0; * Public data... */ int mpt_lan_index = -1; -int mpt_stm_index = -1; +static int mpt_stm_index = -1; -struct proc_dir_entry *mpt_proc_root_dir; +static struct proc_dir_entry *mpt_proc_root_dir; #define WHOINIT_UNKNOWN 0xAA @@ -313,13 +313,13 @@ mpt_reply(MPT_ADAPTER *ioc, u32 pa) u32 log_info = le32_to_cpu(mr->u.reply.IOCLogInfo); if (ioc->bus_type == FC) mpt_fc_log_info(ioc, log_info); - else if (ioc->bus_type == SPI) + else if (ioc->bus_type == SCSI) mpt_sp_log_info(ioc, log_info); else if (ioc->bus_type == SAS) mpt_sas_log_info(ioc, log_info); } if (ioc_stat & MPI_IOCSTATUS_MASK) { - if (ioc->bus_type == SPI && + if (ioc->bus_type == SCSI && cb_idx != mpt_stm_index && cb_idx != mpt_lan_index) mpt_sp_ioc_info(ioc, (u32)ioc_stat, mf); @@ -1118,65 +1118,6 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp) return -1; } -int -mpt_alt_ioc_wait(MPT_ADAPTER *ioc) -{ - int loop_count = 30 * 4; /* Wait 30 seconds */ - int status = -1; /* -1 means failed to get board READY */ - - do { - spin_lock(&ioc->initializing_hba_lock); - if (ioc->initializing_hba_lock_flag == 0) { - ioc->initializing_hba_lock_flag=1; - spin_unlock(&ioc->initializing_hba_lock); - status = 0; - break; - } - spin_unlock(&ioc->initializing_hba_lock); - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ/4); - } while (--loop_count); - - return status; -} - -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - * mpt_bringup_adapter - This is a wrapper function for mpt_do_ioc_recovery - * @ioc: Pointer to MPT adapter structure - * @sleepFlag: Use schedule if CAN_SLEEP else use udelay. - * - * This routine performs all the steps necessary to bring the IOC - * to a OPERATIONAL state. - * - * Special Note: This function was added with spin lock's so as to allow - * the dv(domain validation) work thread to succeed on the other channel - * that maybe occuring at the same time when this function is called. - * Without this lock, the dv would fail when message frames were - * requested during hba bringup on the alternate ioc. - */ -static int -mpt_bringup_adapter(MPT_ADAPTER *ioc, int sleepFlag) -{ - int r; - - if(ioc->alt_ioc) { - if((r=mpt_alt_ioc_wait(ioc->alt_ioc)!=0)) - return r; - } - - r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP, - CAN_SLEEP); - - if(ioc->alt_ioc) { - spin_lock(&ioc->alt_ioc->initializing_hba_lock); - ioc->alt_ioc->initializing_hba_lock_flag=0; - spin_unlock(&ioc->alt_ioc->initializing_hba_lock); - } - -return r; -} - /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * mpt_attach - Install a PCI intelligent MPT adapter. @@ -1245,7 +1186,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ioc->pcidev = pdev; ioc->diagPending = 0; spin_lock_init(&ioc->diagLock); - spin_lock_init(&ioc->initializing_hba_lock); /* Initialize the event logging. */ @@ -1376,7 +1316,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) } else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) { ioc->prod_name = "LSI53C1030"; - ioc->bus_type = SPI; + ioc->bus_type = SCSI; /* 1030 Chip Fix. Disable Split transactions * for PCIX. Set MOST bits to zero if Rev < C0( = 8). */ @@ -1389,7 +1329,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) } else if (pdev->device == MPI_MANUFACTPAGE_DEVID_1030_53C1035) { ioc->prod_name = "LSI53C1035"; - ioc->bus_type = SPI; + ioc->bus_type = SCSI; } else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1064) { ioc->prod_name = "LSISAS1064"; @@ -1468,7 +1408,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) */ mpt_detect_bound_ports(ioc, pdev); - if ((r = mpt_bringup_adapter(ioc, CAN_SLEEP)) != 0){ + if ((r = mpt_do_ioc_recovery(ioc, + MPT_HOSTEVENT_IOC_BRINGUP, CAN_SLEEP)) != 0) { printk(KERN_WARNING MYNAM ": WARNING - %s did not initialize properly! (%d)\n", ioc->name, r); @@ -3042,7 +2983,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, MpiFwHeader_t *pFwHeader, int sleepFlag) /* Clear the internal flash bad bit - autoincrementing register, * so must do two writes. */ - if (ioc->bus_type == SPI) { + if (ioc->bus_type == SCSI) { /* * 1030 and 1035 H/W errata, workaround to access * the ClearFlashBadSignatureBit @@ -3152,7 +3093,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) int cnt,cntdn; dinitprintk((KERN_WARNING MYNAM ": KickStarting %s!\n", ioc->name)); - if (ioc->bus_type == SPI) { + if (ioc->bus_type == SCSI) { /* Always issue a Msg Unit Reset first. This will clear some * SCSI bus hang conditions. */ @@ -3580,7 +3521,7 @@ initChainBuffers(MPT_ADAPTER *ioc) dinitprintk((KERN_INFO MYNAM ": %s Now numSGE=%d num_sge=%d num_chain=%d\n", ioc->name, numSGE, num_sge, num_chain)); - if (ioc->bus_type == SPI) + if (ioc->bus_type == SCSI) num_chain *= MPT_SCSI_CAN_QUEUE; else num_chain *= MPT_FC_CAN_QUEUE; @@ -6330,7 +6271,6 @@ EXPORT_SYMBOL(mpt_resume); EXPORT_SYMBOL(mpt_suspend); #endif EXPORT_SYMBOL(ioc_list); -EXPORT_SYMBOL(mpt_proc_root_dir); EXPORT_SYMBOL(mpt_register); EXPORT_SYMBOL(mpt_deregister); EXPORT_SYMBOL(mpt_event_register); @@ -6348,7 +6288,6 @@ EXPORT_SYMBOL(mpt_verify_adapter); EXPORT_SYMBOL(mpt_GetIocState); EXPORT_SYMBOL(mpt_print_ioc_summary); EXPORT_SYMBOL(mpt_lan_index); -EXPORT_SYMBOL(mpt_stm_index); EXPORT_SYMBOL(mpt_HardResetHandler); EXPORT_SYMBOL(mpt_config); EXPORT_SYMBOL(mpt_toolbox); @@ -6357,7 +6296,6 @@ EXPORT_SYMBOL(mpt_read_ioc_pg_3); EXPORT_SYMBOL(mpt_alloc_fw_memory); EXPORT_SYMBOL(mpt_free_fw_memory); EXPORT_SYMBOL(mptbase_sas_persist_operation); -EXPORT_SYMBOL(mpt_alt_ioc_wait); /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ diff --git a/trunk/drivers/message/fusion/mptbase.h b/trunk/drivers/message/fusion/mptbase.h index 6c48d1f54ac9..8ad277a9afa1 100644 --- a/trunk/drivers/message/fusion/mptbase.h +++ b/trunk/drivers/message/fusion/mptbase.h @@ -76,8 +76,8 @@ #define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR #endif -#define MPT_LINUX_VERSION_COMMON "3.03.05" -#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.05" +#define MPT_LINUX_VERSION_COMMON "3.03.04" +#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.04" #define WHAT_MAGIC_STRING "@" "(" "#" ")" #define show_mptmod_ver(s,ver) \ @@ -321,7 +321,7 @@ typedef struct _SYSIF_REGS * Dynamic Multi-Pathing specific stuff... */ -/* VirtTarget negoFlags field */ +/* VirtDevice negoFlags field */ #define MPT_TARGET_NO_NEGO_WIDE 0x01 #define MPT_TARGET_NO_NEGO_SYNC 0x02 #define MPT_TARGET_NO_NEGO_QAS 0x04 @@ -330,7 +330,8 @@ typedef struct _SYSIF_REGS /* * VirtDevice - FC LUN device or SCSI target device */ -typedef struct _VirtTarget { +typedef struct _VirtDevice { + struct scsi_device *device; u8 tflags; u8 ioc_id; u8 target_id; @@ -341,18 +342,21 @@ typedef struct _VirtTarget { u8 negoFlags; /* bit field, see above */ u8 raidVolume; /* set, if RAID Volume */ u8 type; /* byte 0 of Inquiry data */ + u8 cflags; /* controller flags */ + u8 rsvd1raid; + u16 fc_phys_lun; + u16 fc_xlat_lun; u32 num_luns; u32 luns[8]; /* Max LUNs is 256 */ + u8 pad[4]; u8 inq_data[8]; -} VirtTarget; - -typedef struct _VirtDevice { - VirtTarget *vtarget; - u8 ioc_id; - u8 bus_id; - u8 target_id; - u8 configured_lun; - u32 lun; + /* IEEE Registered Extended Identifier + obtained via INQUIRY VPD page 0x83 */ + /* NOTE: Do not separate uniq_prepad and uniq_data + as they are treateed as a single entity in the code */ + u8 uniq_prepad[8]; + u8 uniq_data[20]; + u8 pad2[4]; } VirtDevice; /* @@ -607,8 +611,6 @@ typedef struct _MPT_ADAPTER int DoneCtx; int TaskCtx; int InternalCtx; - spinlock_t initializing_hba_lock; - int initializing_hba_lock_flag; struct list_head list; struct net_device *netdev; struct list_head sas_topology; @@ -899,7 +901,7 @@ typedef struct _MPT_LOCAL_REPLY { typedef enum { FC, - SPI, + SCSI, SAS } BUS_TYPE; @@ -908,7 +910,7 @@ typedef struct _MPT_SCSI_HOST { int port; u32 pad0; struct scsi_cmnd **ScsiLookup; - VirtTarget **Targets; + VirtDevice **Targets; MPT_LOCAL_REPLY *pLocal; /* used for internal commands */ struct timer_list timer; /* Pool of memory for holding SCpnts before doing @@ -999,16 +1001,13 @@ extern void mpt_free_fw_memory(MPT_ADAPTER *ioc); extern int mpt_findImVolumes(MPT_ADAPTER *ioc); extern int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc); extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); -extern int mpt_alt_ioc_wait(MPT_ADAPTER *ioc); /* * Public data decl's... */ extern struct list_head ioc_list; -extern struct proc_dir_entry *mpt_proc_root_dir; extern int mpt_lan_index; /* needed by mptlan.c */ -extern int mpt_stm_index; /* needed by mptstm.c */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ #endif /* } __KERNEL__ */ diff --git a/trunk/drivers/message/fusion/mptctl.c b/trunk/drivers/message/fusion/mptctl.c index 959d2c5951b8..602138f8544d 100644 --- a/trunk/drivers/message/fusion/mptctl.c +++ b/trunk/drivers/message/fusion/mptctl.c @@ -1245,7 +1245,7 @@ mptctl_gettargetinfo (unsigned long arg) MPT_ADAPTER *ioc; struct Scsi_Host *sh; MPT_SCSI_HOST *hd; - VirtTarget *vdev; + VirtDevice *vdev; char *pmem; int *pdata; IOCPage2_t *pIoc2; @@ -1822,7 +1822,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) case MPI_FUNCTION_SCSI_IO_REQUEST: if (ioc->sh) { SCSIIORequest_t *pScsiReq = (SCSIIORequest_t *) mf; - VirtTarget *pTarget = NULL; + VirtDevice *pTarget = NULL; MPT_SCSI_HOST *hd = NULL; int qtag = MPI_SCSIIO_CONTROL_UNTAGGED; int scsidir = 0; diff --git a/trunk/drivers/message/fusion/mptfc.c b/trunk/drivers/message/fusion/mptfc.c index ba61e1828858..a628be9bbbad 100644 --- a/trunk/drivers/message/fusion/mptfc.c +++ b/trunk/drivers/message/fusion/mptfc.c @@ -84,16 +84,13 @@ static int mptfcTaskCtx = -1; static int mptfcInternalCtx = -1; /* Used only for internal commands */ static struct scsi_host_template mptfc_driver_template = { - .module = THIS_MODULE, .proc_name = "mptfc", .proc_info = mptscsih_proc_info, .name = "MPT FC Host", .info = mptscsih_info, .queuecommand = mptscsih_qcmd, - .target_alloc = mptscsih_target_alloc, .slave_alloc = mptscsih_slave_alloc, .slave_configure = mptscsih_slave_configure, - .target_destroy = mptscsih_target_destroy, .slave_destroy = mptscsih_slave_destroy, .change_queue_depth = mptscsih_change_queue_depth, .eh_abort_handler = mptscsih_abort, @@ -170,15 +167,13 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) printk(MYIOC_s_WARN_FMT "Skipping because it's not operational!\n", ioc->name); - error = -ENODEV; - goto out_mptfc_probe; + return -ENODEV; } if (!ioc->active) { printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n", ioc->name); - error = -ENODEV; - goto out_mptfc_probe; + return -ENODEV; } /* Sanity check - ensure at least 1 port is INITIATOR capable @@ -203,8 +198,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) printk(MYIOC_s_WARN_FMT "Unable to register controller with SCSI subsystem\n", ioc->name); - error = -1; - goto out_mptfc_probe; + return -1; } spin_lock_irqsave(&ioc->FreeQlock, flags); @@ -272,7 +266,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) mem = kmalloc(sz, GFP_ATOMIC); if (mem == NULL) { error = -ENOMEM; - goto out_mptfc_probe; + goto mptfc_probe_failed; } memset(mem, 0, sz); @@ -290,14 +284,14 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) mem = kmalloc(sz, GFP_ATOMIC); if (mem == NULL) { error = -ENOMEM; - goto out_mptfc_probe; + goto mptfc_probe_failed; } memset(mem, 0, sz); - hd->Targets = (VirtTarget **) mem; + hd->Targets = (VirtDevice **) mem; dprintk((KERN_INFO - " vdev @ %p, sz=%d\n", hd->Targets, sz)); + " Targets @ %p, sz=%d\n", hd->Targets, sz)); /* Clear the TM flags */ @@ -336,13 +330,13 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) if(error) { dprintk((KERN_ERR MYNAM "scsi_add_host failed\n")); - goto out_mptfc_probe; + goto mptfc_probe_failed; } scsi_scan_host(sh); return 0; -out_mptfc_probe: +mptfc_probe_failed: mptscsih_remove(pdev); return error; diff --git a/trunk/drivers/message/fusion/mptsas.c b/trunk/drivers/message/fusion/mptsas.c index 17e9757e728b..e0a8bb8ba7d8 100644 --- a/trunk/drivers/message/fusion/mptsas.c +++ b/trunk/drivers/message/fusion/mptsas.c @@ -228,35 +228,31 @@ static void mptsas_print_expander_pg1(SasExpanderPage1_t *pg1) * implement ->target_alloc. */ static int -mptsas_slave_alloc(struct scsi_device *sdev) +mptsas_slave_alloc(struct scsi_device *device) { - struct Scsi_Host *host = sdev->host; + struct Scsi_Host *host = device->host; MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; struct sas_rphy *rphy; struct mptsas_portinfo *p; - VirtTarget *vtarget; VirtDevice *vdev; - struct scsi_target *starget; + uint target = device->id; int i; + if ((vdev = hd->Targets[target]) != NULL) + goto out; + vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL); if (!vdev) { printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", hd->ioc->name, sizeof(VirtDevice)); return -ENOMEM; } + memset(vdev, 0, sizeof(VirtDevice)); + vdev->tflags = MPT_TARGET_FLAGS_Q_YES|MPT_TARGET_FLAGS_VALID_INQUIRY; vdev->ioc_id = hd->ioc->id; - sdev->hostdata = vdev; - starget = scsi_target(sdev); - vtarget = starget->hostdata; - vdev->vtarget = vtarget; - if (vtarget->num_luns == 0) { - vtarget->tflags = MPT_TARGET_FLAGS_Q_YES|MPT_TARGET_FLAGS_VALID_INQUIRY; - hd->Targets[sdev->id] = vtarget; - } - rphy = dev_to_rphy(sdev->sdev_target->dev.parent); + rphy = dev_to_rphy(device->sdev_target->dev.parent); list_for_each_entry(p, &hd->ioc->sas_topology, list) { for (i = 0; i < p->num_phys; i++) { if (p->phy_info[i].attached.sas_address == @@ -264,7 +260,7 @@ mptsas_slave_alloc(struct scsi_device *sdev) vdev->target_id = p->phy_info[i].attached.target; vdev->bus_id = p->phy_info[i].attached.bus; - vdev->lun = sdev->lun; + hd->Targets[device->id] = vdev; goto out; } } @@ -275,24 +271,19 @@ mptsas_slave_alloc(struct scsi_device *sdev) return -ENODEV; out: - vtarget->ioc_id = vdev->ioc_id; - vtarget->target_id = vdev->target_id; - vtarget->bus_id = vdev->bus_id; - vtarget->num_luns++; + vdev->num_luns++; + device->hostdata = vdev; return 0; } static struct scsi_host_template mptsas_driver_template = { - .module = THIS_MODULE, .proc_name = "mptsas", .proc_info = mptscsih_proc_info, .name = "MPT SPI Host", .info = mptscsih_info, .queuecommand = mptscsih_qcmd, - .target_alloc = mptscsih_target_alloc, .slave_alloc = mptsas_slave_alloc, .slave_configure = mptscsih_slave_configure, - .target_destroy = mptscsih_target_destroy, .slave_destroy = mptscsih_slave_destroy, .change_queue_depth = mptscsih_change_queue_depth, .eh_abort_handler = mptscsih_abort, @@ -995,6 +986,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc, int *index) goto out_free_port_info; list_add_tail(&port_info->list, &ioc->sas_topology); + for (i = 0; i < port_info->num_phys; i++) { mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i], (MPI_SAS_PHY_PGAD_FORM_PHY_NUMBER << @@ -1141,15 +1133,13 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) printk(MYIOC_s_WARN_FMT "Skipping because it's not operational!\n", ioc->name); - error = -ENODEV; - goto out_mptsas_probe; + return -ENODEV; } if (!ioc->active) { printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n", ioc->name); - error = -ENODEV; - goto out_mptsas_probe; + return -ENODEV; } /* Sanity check - ensure at least 1 port is INITIATOR capable @@ -1173,8 +1163,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) printk(MYIOC_s_WARN_FMT "Unable to register controller with SCSI subsystem\n", ioc->name); - error = -1; - goto out_mptsas_probe; + return -1; } spin_lock_irqsave(&ioc->FreeQlock, flags); @@ -1248,7 +1237,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) mem = kmalloc(sz, GFP_ATOMIC); if (mem == NULL) { error = -ENOMEM; - goto out_mptsas_probe; + goto mptsas_probe_failed; } memset(mem, 0, sz); @@ -1266,14 +1255,14 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) mem = kmalloc(sz, GFP_ATOMIC); if (mem == NULL) { error = -ENOMEM; - goto out_mptsas_probe; + goto mptsas_probe_failed; } memset(mem, 0, sz); - hd->Targets = (VirtTarget **) mem; + hd->Targets = (VirtDevice **) mem; dprintk((KERN_INFO - " vtarget @ %p, sz=%d\n", hd->Targets, sz)); + " Targets @ %p, sz=%d\n", hd->Targets, sz)); /* Clear the TM flags */ @@ -1319,14 +1308,14 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (error) { dprintk((KERN_ERR MYNAM "scsi_add_host failed\n")); - goto out_mptsas_probe; + goto mptsas_probe_failed; } mptsas_scan_sas_topology(ioc); return 0; -out_mptsas_probe: +mptsas_probe_failed: mptscsih_remove(pdev); return error; diff --git a/trunk/drivers/message/fusion/mptscsih.c b/trunk/drivers/message/fusion/mptscsih.c index 93a16fa3c4ba..4330ed0cedaa 100644 --- a/trunk/drivers/message/fusion/mptscsih.c +++ b/trunk/drivers/message/fusion/mptscsih.c @@ -150,29 +150,28 @@ static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 tar int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); -static void mptscsih_initTarget(MPT_SCSI_HOST *hd, VirtTarget *vtarget, u8 lun, char *data, int dlen); -static void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *vtarget, char byte56); +static void mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen); +static void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56); +static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq); static void mptscsih_setDevicePage1Flags (u8 width, u8 factor, u8 offset, int *requestedPtr, int *configurationPtr, u8 flags); -static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, struct scsi_cmnd *sc); +static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id); static int mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target, int flags); static int mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus); int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd); -static void mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice); -static void mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget); -static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id); +static int mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum); static struct work_struct mptscsih_persistTask; #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION static int mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io); static void mptscsih_domainValidation(void *hd); +static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id); static void mptscsih_qas_check(MPT_SCSI_HOST *hd, int id); static int mptscsih_doDv(MPT_SCSI_HOST *hd, int channel, int target); static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage); static void mptscsih_fillbuf(char *buffer, int size, int index, int width); static void mptscsih_set_dvflags_raid(MPT_SCSI_HOST *hd, int id); -static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, struct scsi_cmnd *sc); #endif void mptscsih_remove(struct pci_dev *); @@ -628,7 +627,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) dreplyprintk((KERN_NOTICE "Reply ha=%d id=%d lun=%d:\n" "IOCStatus=%04xh SCSIState=%02xh SCSIStatus=%02xh\n" "resid=%d bufflen=%d xfer_cnt=%d\n", - ioc->id, sc->device->id, sc->device->lun, + ioc->id, pScsiReq->TargetID, pScsiReq->LUN[1], status, scsi_state, scsi_status, sc->resid, sc->request_bufflen, xfer_cnt)); @@ -642,7 +641,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) pScsiReply->ResponseInfo) { printk(KERN_NOTICE "ha=%d id=%d lun=%d: " "FCP_ResponseInfo=%08xh\n", - ioc->id, sc->device->id, sc->device->lun, + ioc->id, pScsiReq->TargetID, pScsiReq->LUN[1], le32_to_cpu(pScsiReply->ResponseInfo)); } @@ -678,8 +677,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) sc->result = DID_RESET << 16; /* GEM Workaround. */ - if (ioc->bus_type == SPI) - mptscsih_no_negotiate(hd, sc); + if (ioc->bus_type == SCSI) + mptscsih_no_negotiate(hd, sc->device->id); break; case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */ @@ -893,15 +892,16 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd) * when a lun is disable by mid-layer. * Do NOT access the referenced scsi_cmnd structure or * members. Will cause either a paging or NULL ptr error. - * @hd: Pointer to a SCSI HOST structure - * @vdevice: per device private data + * @hd: Pointer to a SCSI HOST structure + * @target: target id + * @lun: lun * * Returns: None. * * Called from slave_destroy. */ static void -mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) +mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, uint target, uint lun) { SCSIIORequest_t *mf = NULL; int ii; @@ -909,7 +909,7 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) struct scsi_cmnd *sc; dsprintk((KERN_INFO MYNAM ": search_running target %d lun %d max %d\n", - vdevice->target_id, vdevice->lun, max)); + target, lun, max)); for (ii=0; ii < max; ii++) { if ((sc = hd->ScsiLookup[ii]) != NULL) { @@ -919,7 +919,7 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) dsprintk(( "search_running: found (sc=%p, mf = %p) target %d, lun %d \n", hd->ScsiLookup[ii], mf, mf->TargetID, mf->LUN[1])); - if ((mf->TargetID != ((u8)vdevice->target_id)) || (mf->LUN[1] != ((u8) vdevice->lun))) + if ((mf->TargetID != ((u8)target)) || (mf->LUN[1] != ((u8) lun))) continue; /* Cleanup @@ -993,10 +993,8 @@ mptscsih_remove(struct pci_dev *pdev) MPT_ADAPTER *ioc = pci_get_drvdata(pdev); struct Scsi_Host *host = ioc->sh; MPT_SCSI_HOST *hd; -#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION int count; unsigned long flags; -#endif int sz1; if(!host) { @@ -1077,6 +1075,11 @@ mptscsih_shutdown(struct pci_dev *pdev) hd = (MPT_SCSI_HOST *)host->hostdata; + /* Flush the cache of this adapter + */ + if(hd != NULL) + mptscsih_synchronize_cache(hd, 0); + } #ifdef CONFIG_PM @@ -1283,7 +1286,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) MPT_SCSI_HOST *hd; MPT_FRAME_HDR *mf; SCSIIORequest_t *pScsiReq; - VirtDevice *vdev = SCpnt->device->hostdata; + VirtDevice *pTarget = SCpnt->device->hostdata; int lun; u32 datalen; u32 scsictl; @@ -1338,8 +1341,8 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) /* Default to untagged. Once a target structure has been allocated, * use the Inquiry data to determine if device supports tagged. */ - if (vdev - && (vdev->vtarget->tflags & MPT_TARGET_FLAGS_Q_YES) + if (pTarget + && (pTarget->tflags & MPT_TARGET_FLAGS_Q_YES) && (SCpnt->device->tagged_supported)) { scsictl = scsidir | MPI_SCSIIO_CONTROL_SIMPLEQ; } else { @@ -1348,8 +1351,8 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) /* Use the above information to set up the message frame */ - pScsiReq->TargetID = (u8) vdev->target_id; - pScsiReq->Bus = vdev->bus_id; + pScsiReq->TargetID = (u8) pTarget->target_id; + pScsiReq->Bus = pTarget->bus_id; pScsiReq->ChainOffset = 0; pScsiReq->Function = MPI_FUNCTION_SCSI_IO_REQUEST; pScsiReq->CDBLength = SCpnt->cmd_len; @@ -1400,8 +1403,8 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) SCpnt->host_scribble = NULL; #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION - if (hd->ioc->bus_type == SPI) { - int dvStatus = hd->ioc->spi_data.dvStatus[vdev->target_id]; + if (hd->ioc->bus_type == SCSI) { + int dvStatus = hd->ioc->spi_data.dvStatus[pTarget->target_id]; int issueCmd = 1; if (dvStatus || hd->ioc->spi_data.forceDv) { @@ -1434,7 +1437,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) /* Set the DV flags. */ if (dvStatus & MPT_SCSICFG_DV_NOT_DONE) - mptscsih_set_dvflags(hd, SCpnt); + mptscsih_set_dvflags(hd, pScsiReq); if (!issueCmd) goto fail; @@ -1738,7 +1741,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) u32 ctx2abort; int scpnt_idx; int retval; - VirtDevice *vdev; /* If we can't locate our host adapter structure, return FAILED status. */ @@ -1788,9 +1790,8 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) hd->abortSCpnt = SCpnt; - vdev = SCpnt->device->hostdata; retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK, - vdev->bus_id, vdev->target_id, vdev->lun, + SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun, ctx2abort, 2 /* 2 second timeout */); printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n", @@ -1821,7 +1822,6 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt) { MPT_SCSI_HOST *hd; int retval; - VirtDevice *vdev; /* If we can't locate our host adapter structure, return FAILED status. */ @@ -1839,9 +1839,8 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt) hd->ioc->name, SCpnt); scsi_print_command(SCpnt); - vdev = SCpnt->device->hostdata; retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, - vdev->bus_id, vdev->target_id, + SCpnt->device->channel, SCpnt->device->id, 0, 0, 5 /* 5 second timeout */); printk (KERN_WARNING MYNAM ": %s: target reset: %s (sc=%p)\n", @@ -1872,7 +1871,6 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt) { MPT_SCSI_HOST *hd; int retval; - VirtDevice *vdev; /* If we can't locate our host adapter structure, return FAILED status. */ @@ -1890,9 +1888,8 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt) if (hd->timeouts < -1) hd->timeouts++; - vdev = SCpnt->device->hostdata; retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, - vdev->bus_id, 0, 0, 0, 5 /* 5 second timeout */); + SCpnt->device->channel, 0, 0, 0, 5 /* 5 second timeout */); printk (KERN_WARNING MYNAM ": %s: bus reset: %s (sc=%p)\n", hd->ioc->name, @@ -2151,39 +2148,26 @@ mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, return 0; } -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* - * OS entry point to allow host driver to alloc memory - * for each scsi target. Called once per device the bus scan. - * Return non-zero if allocation fails. - */ -int -mptscsih_target_alloc(struct scsi_target *starget) -{ - VirtTarget *vtarget; - - vtarget = kmalloc(sizeof(VirtTarget), GFP_KERNEL); - if (!vtarget) - return -ENOMEM; - memset(vtarget, 0, sizeof(VirtTarget)); - starget->hostdata = vtarget; - return 0; -} - /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * OS entry point to allow host driver to alloc memory * for each scsi device. Called once per device the bus scan. * Return non-zero if allocation fails. + * Init memory once per id (not LUN). */ int -mptscsih_slave_alloc(struct scsi_device *sdev) +mptscsih_slave_alloc(struct scsi_device *device) { - struct Scsi_Host *host = sdev->host; + struct Scsi_Host *host = device->host; MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; - VirtTarget *vtarget; VirtDevice *vdev; - struct scsi_target *starget; + uint target = device->id; + + if (hd == NULL) + return -ENODEV; + + if ((vdev = hd->Targets[target]) != NULL) + goto out; vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL); if (!vdev) { @@ -2193,46 +2177,26 @@ mptscsih_slave_alloc(struct scsi_device *sdev) } memset(vdev, 0, sizeof(VirtDevice)); + vdev->tflags = MPT_TARGET_FLAGS_Q_YES; vdev->ioc_id = hd->ioc->id; - vdev->target_id = sdev->id; - vdev->bus_id = sdev->channel; - vdev->lun = sdev->lun; - sdev->hostdata = vdev; - - starget = scsi_target(sdev); - vtarget = starget->hostdata; - vdev->vtarget = vtarget; - - if (vtarget->num_luns == 0) { - hd->Targets[sdev->id] = vtarget; - vtarget->ioc_id = hd->ioc->id; - vtarget->tflags = MPT_TARGET_FLAGS_Q_YES; - vtarget->target_id = sdev->id; - vtarget->bus_id = sdev->channel; - if (hd->ioc->bus_type == SPI) { - if (hd->ioc->raid_data.isRaid & (1 << sdev->id)) { - vtarget->raidVolume = 1; - ddvtprintk((KERN_INFO - "RAID Volume @ id %d\n", sdev->id)); - } - } else { - vtarget->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY; + vdev->target_id = device->id; + vdev->bus_id = device->channel; + vdev->raidVolume = 0; + hd->Targets[device->id] = vdev; + if (hd->ioc->bus_type == SCSI) { + if (hd->ioc->raid_data.isRaid & (1 << device->id)) { + vdev->raidVolume = 1; + ddvtprintk((KERN_INFO + "RAID Volume @ id %d\n", device->id)); } + } else { + vdev->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY; } - vtarget->num_luns++; - return 0; -} -/* - * OS entry point to allow for host driver to free allocated memory - * Called if no device present or device being unloaded - */ -void -mptscsih_target_destroy(struct scsi_target *starget) -{ - if (starget->hostdata) - kfree(starget->hostdata); - starget->hostdata = NULL; + out: + vdev->num_luns++; + device->hostdata = vdev; + return 0; } /* @@ -2240,40 +2204,40 @@ mptscsih_target_destroy(struct scsi_target *starget) * Called if no device present or device being unloaded */ void -mptscsih_slave_destroy(struct scsi_device *sdev) +mptscsih_slave_destroy(struct scsi_device *device) { - struct Scsi_Host *host = sdev->host; + struct Scsi_Host *host = device->host; MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; - VirtTarget *vtarget; - VirtDevice *vdevice; - struct scsi_target *starget; - - starget = scsi_target(sdev); - vtarget = starget->hostdata; - vdevice = sdev->hostdata; - - mptscsih_search_running_cmds(hd, vdevice); - vtarget->luns[0] &= ~(1 << vdevice->lun); - vtarget->num_luns--; - if (vtarget->num_luns == 0) { - mptscsih_negotiate_to_asyn_narrow(hd, vtarget); - if (hd->ioc->bus_type == SPI) { - if (mptscsih_is_phys_disk(hd->ioc, vtarget->target_id)) { - hd->ioc->spi_data.forceDv |= MPT_SCSICFG_RELOAD_IOC_PG3; - } else { - hd->ioc->spi_data.dvStatus[vtarget->target_id] = - MPT_SCSICFG_NEGOTIATE; - if (!hd->negoNvram) { - hd->ioc->spi_data.dvStatus[vtarget->target_id] |= - MPT_SCSICFG_DV_NOT_DONE; - } + VirtDevice *vdev; + uint target = device->id; + uint lun = device->lun; + + if (hd == NULL) + return; + + mptscsih_search_running_cmds(hd, target, lun); + + vdev = hd->Targets[target]; + vdev->luns[0] &= ~(1 << lun); + if (--vdev->num_luns) + return; + + kfree(hd->Targets[target]); + hd->Targets[target] = NULL; + + if (hd->ioc->bus_type == SCSI) { + if (mptscsih_is_phys_disk(hd->ioc, target)) { + hd->ioc->spi_data.forceDv |= MPT_SCSICFG_RELOAD_IOC_PG3; + } else { + hd->ioc->spi_data.dvStatus[target] = + MPT_SCSICFG_NEGOTIATE; + + if (!hd->negoNvram) { + hd->ioc->spi_data.dvStatus[target] |= + MPT_SCSICFG_DV_NOT_DONE; } } - hd->Targets[sdev->id] = NULL; } - mptscsih_synchronize_cache(hd, vdevice); - kfree(vdevice); - sdev->hostdata = NULL; } /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ @@ -2287,21 +2251,22 @@ mptscsih_slave_destroy(struct scsi_device *sdev) int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth) { - MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)sdev->host->hostdata; - VirtTarget *vtarget; - struct scsi_target *starget; - int max_depth; - int tagged; - - starget = scsi_target(sdev); - vtarget = starget->hostdata; - - if (hd->ioc->bus_type == SPI) { - if (vtarget->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY) { - if (!(vtarget->tflags & MPT_TARGET_FLAGS_Q_YES)) + MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)sdev->host->hostdata; + VirtDevice *pTarget; + int max_depth; + int tagged; + + if (hd == NULL) + return 0; + if (!(pTarget = hd->Targets[sdev->id])) + return 0; + + if (hd->ioc->bus_type == SCSI) { + if (pTarget->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY) { + if (!(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) max_depth = 1; - else if (((vtarget->inq_data[0] & 0x1f) == 0x00) && - (vtarget->minSyncFactor <= MPT_ULTRA160 )) + else if (((pTarget->inq_data[0] & 0x1f) == 0x00) && + (pTarget->minSyncFactor <= MPT_ULTRA160 )) max_depth = MPT_SCSI_CMD_PER_DEV_HIGH; else max_depth = MPT_SCSI_CMD_PER_DEV_LOW; @@ -2330,58 +2295,64 @@ mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth) * Return non-zero if fails. */ int -mptscsih_slave_configure(struct scsi_device *sdev) +mptscsih_slave_configure(struct scsi_device *device) { - struct Scsi_Host *sh = sdev->host; - VirtTarget *vtarget; - VirtDevice *vdevice; - struct scsi_target *starget; + struct Scsi_Host *sh = device->host; + VirtDevice *pTarget; MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)sh->hostdata; - int indexed_lun, lun_index; - starget = scsi_target(sdev); - vtarget = starget->hostdata; - vdevice = sdev->hostdata; + if ((hd == NULL) || (hd->Targets == NULL)) { + return 0; + } dsprintk((MYIOC_s_INFO_FMT "device @ %p, id=%d, LUN=%d, channel=%d\n", - hd->ioc->name, sdev, sdev->id, sdev->lun, sdev->channel)); - if (hd->ioc->bus_type == SPI) - dsprintk((MYIOC_s_INFO_FMT - "sdtr %d wdtr %d ppr %d inq length=%d\n", - hd->ioc->name, sdev->sdtr, sdev->wdtr, - sdev->ppr, sdev->inquiry_len)); - - if (sdev->id > sh->max_id) { + hd->ioc->name, device, device->id, device->lun, device->channel)); + dsprintk((MYIOC_s_INFO_FMT + "sdtr %d wdtr %d ppr %d inq length=%d\n", + hd->ioc->name, device->sdtr, device->wdtr, + device->ppr, device->inquiry_len)); + + if (device->id > sh->max_id) { /* error case, should never happen */ - scsi_adjust_queue_depth(sdev, 0, 1); + scsi_adjust_queue_depth(device, 0, 1); + goto slave_configure_exit; + } + + pTarget = hd->Targets[device->id]; + + if (pTarget == NULL) { + /* Driver doesn't know about this device. + * Kernel may generate a "Dummy Lun 0" which + * may become a real Lun if a + * "scsi add-single-device" command is executed + * while the driver is active (hot-plug a + * device). LSI Raid controllers need + * queue_depth set to DEV_HIGH for this reason. + */ + scsi_adjust_queue_depth(device, MSG_SIMPLE_TAG, + MPT_SCSI_CMD_PER_DEV_HIGH); goto slave_configure_exit; } - vdevice->configured_lun=1; - lun_index = (vdevice->lun >> 5); /* 32 luns per lun_index */ - indexed_lun = (vdevice->lun % 32); - vtarget->luns[lun_index] |= (1 << indexed_lun); - mptscsih_initTarget(hd, vtarget, sdev->lun, sdev->inquiry, - sdev->inquiry_len ); - mptscsih_change_queue_depth(sdev, MPT_SCSI_CMD_PER_DEV_HIGH); + mptscsih_initTarget(hd, device->channel, device->id, device->lun, + device->inquiry, device->inquiry_len ); + mptscsih_change_queue_depth(device, MPT_SCSI_CMD_PER_DEV_HIGH); dsprintk((MYIOC_s_INFO_FMT "Queue depth=%d, tflags=%x\n", - hd->ioc->name, sdev->queue_depth, vtarget->tflags)); + hd->ioc->name, device->queue_depth, pTarget->tflags)); - if (hd->ioc->bus_type == SPI) - dsprintk((MYIOC_s_INFO_FMT - "negoFlags=%x, maxOffset=%x, SyncFactor=%x\n", - hd->ioc->name, vtarget->negoFlags, vtarget->maxOffset, - vtarget->minSyncFactor)); + dsprintk((MYIOC_s_INFO_FMT + "negoFlags=%x, maxOffset=%x, SyncFactor=%x\n", + hd->ioc->name, pTarget->negoFlags, pTarget->maxOffset, pTarget->minSyncFactor)); slave_configure_exit: dsprintk((MYIOC_s_INFO_FMT "tagged %d, simple %d, ordered %d\n", - hd->ioc->name,sdev->tagged_supported, sdev->simple_tags, - sdev->ordered_tags)); + hd->ioc->name,device->tagged_supported, device->simple_tags, + device->ordered_tags)); return 0; } @@ -2399,14 +2370,16 @@ mptscsih_slave_configure(struct scsi_device *sdev) static void mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply) { - VirtDevice *vdev; + VirtDevice *target; SCSIIORequest_t *pReq; u32 sense_count = le32_to_cpu(pScsiReply->SenseCount); + int index; /* Get target structure */ pReq = (SCSIIORequest_t *) mf; - vdev = sc->device->hostdata; + index = (int) pReq->TargetID; + target = hd->Targets[index]; if (sense_count) { u8 *sense_data; @@ -2420,7 +2393,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR /* Log SMART data (asc = 0x5D, non-IM case only) if required. */ if ((hd->ioc->events) && (hd->ioc->eventTypes & (1 << MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE))) { - if ((sense_data[12] == 0x5D) && (vdev->vtarget->raidVolume == 0)) { + if ((sense_data[12] == 0x5D) && (target->raidVolume == 0)) { int idx; MPT_ADAPTER *ioc = hd->ioc; @@ -2430,7 +2403,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR ioc->events[idx].data[0] = (pReq->LUN[1] << 24) || (MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) || - (sc->device->channel << 8) || sc->device->id; + (pReq->Bus << 8) || pReq->TargetID; ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12]; @@ -2530,9 +2503,9 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) /* 2. Chain Buffer initialization */ - /* 4. Renegotiate to all devices, if SPI + /* 4. Renegotiate to all devices, if SCSI */ - if (ioc->bus_type == SPI) { + if (ioc->bus_type == SCSI) { dnegoprintk(("writeSDP1: ALL_IDS USE_NVRAM\n")); mptscsih_writeSDP1(hd, 0, 0, MPT_SCSICFG_ALL_IDS | MPT_SCSICFG_USE_NVRAM); } @@ -2561,7 +2534,7 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) /* 7. Set flag to force DV and re-read IOC Page 3 */ - if (ioc->bus_type == SPI) { + if (ioc->bus_type == SCSI) { ioc->spi_data.forceDv = MPT_SCSICFG_NEED_DV | MPT_SCSICFG_RELOAD_IOC_PG3; ddvtprintk(("Set reload IOC Pg3 Flag\n")); } @@ -2603,7 +2576,7 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) break; case MPI_EVENT_IOC_BUS_RESET: /* 04 */ case MPI_EVENT_EXT_BUS_RESET: /* 05 */ - if (hd && (ioc->bus_type == SPI) && (hd->soft_resets < -1)) + if (hd && (ioc->bus_type == SCSI) && (hd->soft_resets < -1)) hd->soft_resets++; break; case MPI_EVENT_LOGOUT: /* 09 */ @@ -2624,11 +2597,11 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) case MPI_EVENT_INTEGRATED_RAID: /* 0B */ { -#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION pMpiEventDataRaid_t pRaidEventData = (pMpiEventDataRaid_t) pEvReply->Data; +#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION /* Domain Validation Needed */ - if (ioc->bus_type == SPI && + if (ioc->bus_type == SCSI && pRaidEventData->ReasonCode == MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED) mptscsih_set_dvflags_raid(hd, pRaidEventData->PhysDiskNum); @@ -2659,7 +2632,8 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) /* * mptscsih_initTarget - Target, LUN alloc/free functionality. * @hd: Pointer to MPT_SCSI_HOST structure - * @vtarget: per target private data + * @bus_id: Bus number (?) + * @target_id: SCSI target id * @lun: SCSI LUN id * @data: Pointer to data * @dlen: Number of INQUIRY bytes @@ -2672,14 +2646,15 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) * */ static void -mptscsih_initTarget(MPT_SCSI_HOST *hd, VirtTarget *vtarget, u8 lun, char *data, int dlen) +mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen) { + int indexed_lun, lun_index; + VirtDevice *vdev; SpiCfgData *pSpi; char data_56; - int inq_len; dinitprintk((MYIOC_s_INFO_FMT "initTarget bus=%d id=%d lun=%d hd=%p\n", - hd->ioc->name, vtarget->bus_id, vtarget->target_id, lun, hd)); + hd->ioc->name, bus_id, target_id, lun, hd)); /* * If the peripheral qualifier filter is enabled then if the target reports a 0x1 @@ -2699,68 +2674,75 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, VirtTarget *vtarget, u8 lun, char *data, if (data[0] & 0xe0) return; - if (vtarget == NULL) - return; - - if (data) - vtarget->type = data[0]; - - if (hd->ioc->bus_type != SPI) + if ((vdev = hd->Targets[target_id]) == NULL) { return; + } - if ((data[0] == TYPE_PROCESSOR) && (hd->ioc->spi_data.Saf_Te)) { - /* Treat all Processors as SAF-TE if - * command line option is set */ - vtarget->tflags |= MPT_TARGET_FLAGS_SAF_TE_ISSUED; - mptscsih_writeIOCPage4(hd, vtarget->target_id, vtarget->bus_id); - }else if ((data[0] == TYPE_PROCESSOR) && - !(vtarget->tflags & MPT_TARGET_FLAGS_SAF_TE_ISSUED )) { - if ( dlen > 49 ) { - vtarget->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY; - if ( data[44] == 'S' && - data[45] == 'A' && - data[46] == 'F' && - data[47] == '-' && - data[48] == 'T' && - data[49] == 'E' ) { - vtarget->tflags |= MPT_TARGET_FLAGS_SAF_TE_ISSUED; - mptscsih_writeIOCPage4(hd, vtarget->target_id, vtarget->bus_id); + lun_index = (lun >> 5); /* 32 luns per lun_index */ + indexed_lun = (lun % 32); + vdev->luns[lun_index] |= (1 << indexed_lun); + + if (hd->ioc->bus_type == SCSI) { + if ((data[0] == TYPE_PROCESSOR) && (hd->ioc->spi_data.Saf_Te)) { + /* Treat all Processors as SAF-TE if + * command line option is set */ + vdev->tflags |= MPT_TARGET_FLAGS_SAF_TE_ISSUED; + mptscsih_writeIOCPage4(hd, target_id, bus_id); + }else if ((data[0] == TYPE_PROCESSOR) && + !(vdev->tflags & MPT_TARGET_FLAGS_SAF_TE_ISSUED )) { + if ( dlen > 49 ) { + vdev->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY; + if ( data[44] == 'S' && + data[45] == 'A' && + data[46] == 'F' && + data[47] == '-' && + data[48] == 'T' && + data[49] == 'E' ) { + vdev->tflags |= MPT_TARGET_FLAGS_SAF_TE_ISSUED; + mptscsih_writeIOCPage4(hd, target_id, bus_id); + } } } - } - if (!(vtarget->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY)) { - inq_len = dlen < 8 ? dlen : 8; - memcpy (vtarget->inq_data, data, inq_len); - /* If have not done DV, set the DV flag. - */ - pSpi = &hd->ioc->spi_data; - if ((data[0] == TYPE_TAPE) || (data[0] == TYPE_PROCESSOR)) { - if (pSpi->dvStatus[vtarget->target_id] & MPT_SCSICFG_DV_NOT_DONE) - pSpi->dvStatus[vtarget->target_id] |= MPT_SCSICFG_NEED_DV; - } - vtarget->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY; + if (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY)) { + if ( dlen > 8 ) { + memcpy (vdev->inq_data, data, 8); + } else { + memcpy (vdev->inq_data, data, dlen); + } - data_56 = 0x0F; /* Default to full capabilities if Inq data length is < 57 */ - if (dlen > 56) { - if ( (!(vtarget->tflags & MPT_TARGET_FLAGS_VALID_56))) { - /* Update the target capabilities + /* If have not done DV, set the DV flag. */ - data_56 = data[56]; - vtarget->tflags |= MPT_TARGET_FLAGS_VALID_56; + pSpi = &hd->ioc->spi_data; + if ((data[0] == TYPE_TAPE) || (data[0] == TYPE_PROCESSOR)) { + if (pSpi->dvStatus[target_id] & MPT_SCSICFG_DV_NOT_DONE) + pSpi->dvStatus[target_id] |= MPT_SCSICFG_NEED_DV; } - } - mptscsih_setTargetNegoParms(hd, vtarget, data_56); - } else { - /* Initial Inquiry may not request enough data bytes to - * obtain byte 57. DV will; if target doesn't return - * at least 57 bytes, data[56] will be zero. */ - if (dlen > 56) { - if ( (!(vtarget->tflags & MPT_TARGET_FLAGS_VALID_56))) { - /* Update the target capabilities - */ - data_56 = data[56]; - vtarget->tflags |= MPT_TARGET_FLAGS_VALID_56; - mptscsih_setTargetNegoParms(hd, vtarget, data_56); + + vdev->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY; + + + data_56 = 0x0F; /* Default to full capabilities if Inq data length is < 57 */ + if (dlen > 56) { + if ( (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_56))) { + /* Update the target capabilities + */ + data_56 = data[56]; + vdev->tflags |= MPT_TARGET_FLAGS_VALID_56; + } + } + mptscsih_setTargetNegoParms(hd, vdev, data_56); + } else { + /* Initial Inquiry may not request enough data bytes to + * obtain byte 57. DV will; if target doesn't return + * at least 57 bytes, data[56] will be zero. */ + if (dlen > 56) { + if ( (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_56))) { + /* Update the target capabilities + */ + data_56 = data[56]; + vdev->tflags |= MPT_TARGET_FLAGS_VALID_56; + mptscsih_setTargetNegoParms(hd, vdev, data_56); + } } } } @@ -2773,12 +2755,12 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, VirtTarget *vtarget, u8 lun, char *data, * */ static void -mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target, char byte56) +mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56) { SpiCfgData *pspi_data = &hd->ioc->spi_data; int id = (int) target->target_id; int nvram; - VirtTarget *vtarget; + VirtDevice *vdev; int ii; u8 width = MPT_NARROW; u8 factor = MPT_ASYNC; @@ -2923,9 +2905,9 @@ mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target, char byte56) ddvtprintk((KERN_INFO "Disabling QAS due to noQas=%02x on id=%d!\n", noQas, id)); for (ii = 0; ii < id; ii++) { - if ( (vtarget = hd->Targets[ii]) ) { - vtarget->negoFlags |= MPT_TARGET_NO_NEGO_QAS; - mptscsih_writeSDP1(hd, 0, ii, vtarget->negoFlags); + if ( (vdev = hd->Targets[ii]) ) { + vdev->negoFlags |= MPT_TARGET_NO_NEGO_QAS; + mptscsih_writeSDP1(hd, 0, ii, vdev->negoFlags); } } } @@ -2943,18 +2925,106 @@ mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target, char byte56) } } +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* If DV disabled (negoNvram set to USE_NVARM) or if not LUN 0, return. + * Else set the NEED_DV flag after Read Capacity Issued (disks) + * or Mode Sense (cdroms). + * + * Tapes, initTarget will set this flag on completion of Inquiry command. + * Called only if DV_NOT_DONE flag is set + */ +static void +mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq) +{ + MPT_ADAPTER *ioc = hd->ioc; + u8 cmd; + SpiCfgData *pSpi; + + ddvtprintk((MYIOC_s_NOTE_FMT + " set_dvflags: id=%d lun=%d negoNvram=%x cmd=%x\n", + hd->ioc->name, pReq->TargetID, pReq->LUN[1], hd->negoNvram, pReq->CDB[0])); + + if ((pReq->LUN[1] != 0) || (hd->negoNvram != 0)) + return; + + cmd = pReq->CDB[0]; + + if ((cmd == READ_CAPACITY) || (cmd == MODE_SENSE)) { + pSpi = &ioc->spi_data; + if ((ioc->raid_data.isRaid & (1 << pReq->TargetID)) && ioc->raid_data.pIocPg3) { + /* Set NEED_DV for all hidden disks + */ + Ioc3PhysDisk_t *pPDisk = ioc->raid_data.pIocPg3->PhysDisk; + int numPDisk = ioc->raid_data.pIocPg3->NumPhysDisks; + + while (numPDisk) { + pSpi->dvStatus[pPDisk->PhysDiskID] |= MPT_SCSICFG_NEED_DV; + ddvtprintk(("NEED_DV set for phys disk id %d\n", pPDisk->PhysDiskID)); + pPDisk++; + numPDisk--; + } + } + pSpi->dvStatus[pReq->TargetID] |= MPT_SCSICFG_NEED_DV; + ddvtprintk(("NEED_DV set for visible disk id %d\n", pReq->TargetID)); + } +} + +/* mptscsih_raid_set_dv_flags() + * + * New or replaced disk. Set DV flag and schedule DV. + */ +static void +mptscsih_set_dvflags_raid(MPT_SCSI_HOST *hd, int id) +{ + MPT_ADAPTER *ioc = hd->ioc; + SpiCfgData *pSpi = &ioc->spi_data; + Ioc3PhysDisk_t *pPDisk; + int numPDisk; + + if (hd->negoNvram != 0) + return; + + ddvtprintk(("DV requested for phys disk id %d\n", id)); + if (ioc->raid_data.pIocPg3) { + pPDisk = ioc->raid_data.pIocPg3->PhysDisk; + numPDisk = ioc->raid_data.pIocPg3->NumPhysDisks; + while (numPDisk) { + if (id == pPDisk->PhysDiskNum) { + pSpi->dvStatus[pPDisk->PhysDiskID] = + (MPT_SCSICFG_NEED_DV | MPT_SCSICFG_DV_NOT_DONE); + pSpi->forceDv = MPT_SCSICFG_NEED_DV; + ddvtprintk(("NEED_DV set for phys disk id %d\n", + pPDisk->PhysDiskID)); + break; + } + pPDisk++; + numPDisk--; + } + + if (numPDisk == 0) { + /* The physical disk that needs DV was not found + * in the stored IOC Page 3. The driver must reload + * this page. DV routine will set the NEED_DV flag for + * all phys disks that have DV_NOT_DONE set. + */ + pSpi->forceDv = MPT_SCSICFG_NEED_DV | MPT_SCSICFG_RELOAD_IOC_PG3; + ddvtprintk(("phys disk %d not found. Setting reload IOC Pg3 Flag\n",id)); + } + } +} + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * If no Target, bus reset on 1st I/O. Set the flag to * prevent any future negotiations to this device. */ static void -mptscsih_no_negotiate(MPT_SCSI_HOST *hd, struct scsi_cmnd *sc) +mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id) { - VirtDevice *vdev; - if ((vdev = sc->device->hostdata) != NULL) - hd->ioc->spi_data.dvStatus[vdev->target_id] |= MPT_SCSICFG_BLK_NEGO; + if ((hd->Targets) && (hd->Targets[target_id] == NULL)) + hd->ioc->spi_data.dvStatus[target_id] |= MPT_SCSICFG_BLK_NEGO; + return; } @@ -3030,7 +3100,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags) MPT_ADAPTER *ioc = hd->ioc; Config_t *pReq; SCSIDevicePage1_t *pData; - VirtTarget *vtarget=NULL; + VirtDevice *pTarget=NULL; MPT_FRAME_HDR *mf; dma_addr_t dataDma; u16 req_idx; @@ -3110,11 +3180,11 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags) /* If id is not a raid volume, get the updated * transmission settings from the target structure. */ - if (hd->Targets && (vtarget = hd->Targets[id]) && !vtarget->raidVolume) { - width = vtarget->maxWidth; - factor = vtarget->minSyncFactor; - offset = vtarget->maxOffset; - negoFlags = vtarget->negoFlags; + if (hd->Targets && (pTarget = hd->Targets[id]) && !pTarget->raidVolume) { + width = pTarget->maxWidth; + factor = pTarget->minSyncFactor; + offset = pTarget->maxOffset; + negoFlags = pTarget->negoFlags; } #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION @@ -3834,139 +3904,149 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io) /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** - * mptscsih_negotiate_to_asyn_narrow - Restore devices to default state - * @hd: Pointer to a SCSI HOST structure - * @vtarget: per device private data + * mptscsih_synchronize_cache - Send SYNCHRONIZE_CACHE to all disks. + * @hd: Pointer to MPT_SCSI_HOST structure + * @portnum: IOC port number * * Uses the ISR, but with special processing. * MUST be single-threaded. * + * Return: 0 on completion */ -static void -mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget) +static int +mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum) { MPT_ADAPTER *ioc= hd->ioc; - SCSIDevicePage1_t *pcfg1Data; + VirtDevice *pTarget; + SCSIDevicePage1_t *pcfg1Data = NULL; + INTERNAL_CMD iocmd; CONFIGPARMS cfg; - dma_addr_t cfg1_dma_addr; - ConfigPageHeader_t header; - int id; - int requested, configuration, data,i; + dma_addr_t cfg1_dma_addr = -1; + ConfigPageHeader_t header1; + int bus = 0; + int id = 0; + int lun; + int indexed_lun, lun_index; + int hostId = ioc->pfacts[portnum].PortSCSIID; + int max_id; + int requested, configuration, data; + int doConfig = 0; u8 flags, factor; - if (ioc->bus_type != SPI) - return; + max_id = ioc->sh->max_id - 1; - if (!ioc->spi_data.sdp1length) - return; + /* Following parameters will not change + * in this routine. + */ + iocmd.cmd = SYNCHRONIZE_CACHE; + iocmd.flags = 0; + iocmd.physDiskNum = -1; + iocmd.data = NULL; + iocmd.data_dma = -1; + iocmd.size = 0; + iocmd.rsvd = iocmd.rsvd2 = 0; - pcfg1Data = (SCSIDevicePage1_t *)pci_alloc_consistent(ioc->pcidev, - ioc->spi_data.sdp1length * 4, &cfg1_dma_addr); + /* No SCSI hosts + */ + if (hd->Targets == NULL) + return 0; - if (pcfg1Data == NULL) - return; + /* Skip the host + */ + if (id == hostId) + id++; - header.PageVersion = ioc->spi_data.sdp1version; - header.PageLength = ioc->spi_data.sdp1length; - header.PageNumber = 1; - header.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; - cfg.cfghdr.hdr = &header; - cfg.physAddr = cfg1_dma_addr; - cfg.action = MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT; - cfg.dir = 1; - cfg.timeout = 0; + /* Write SDP1 for all SCSI devices + * Alloc memory and set up config buffer + */ + if (ioc->bus_type == SCSI) { + if (ioc->spi_data.sdp1length > 0) { + pcfg1Data = (SCSIDevicePage1_t *)pci_alloc_consistent(ioc->pcidev, + ioc->spi_data.sdp1length * 4, &cfg1_dma_addr); + + if (pcfg1Data != NULL) { + doConfig = 1; + header1.PageVersion = ioc->spi_data.sdp1version; + header1.PageLength = ioc->spi_data.sdp1length; + header1.PageNumber = 1; + header1.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; + cfg.cfghdr.hdr = &header1; + cfg.physAddr = cfg1_dma_addr; + cfg.action = MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT; + cfg.dir = 1; + cfg.timeout = 0; + } + } + } - if (vtarget->raidVolume && ioc->raid_data.pIocPg3) { - for (i = 0; i < ioc->raid_data.pIocPg3->NumPhysDisks; i++) { - id = ioc->raid_data.pIocPg3->PhysDisk[i].PhysDiskID; - flags = hd->ioc->spi_data.noQas; - if (hd->ioc->spi_data.nvram && (hd->ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) { - data = hd->ioc->spi_data.nvram[id]; - if (data & MPT_NVRAM_WIDE_DISABLE) - flags |= MPT_TARGET_NO_NEGO_WIDE; - factor = (data & MPT_NVRAM_SYNC_MASK) >> MPT_NVRAM_SYNC_SHIFT; - if ((factor == 0) || (factor == MPT_ASYNC)) - flags |= MPT_TARGET_NO_NEGO_SYNC; + /* loop through all devices on this port + */ + while (bus < MPT_MAX_BUS) { + iocmd.bus = bus; + iocmd.id = id; + pTarget = hd->Targets[(int)id]; + + if (doConfig) { + + /* Set the negotiation flags */ + if (pTarget && (pTarget = hd->Targets[id]) && !pTarget->raidVolume) { + flags = pTarget->negoFlags; + } else { + flags = hd->ioc->spi_data.noQas; + if (hd->ioc->spi_data.nvram && (hd->ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) { + data = hd->ioc->spi_data.nvram[id]; + + if (data & MPT_NVRAM_WIDE_DISABLE) + flags |= MPT_TARGET_NO_NEGO_WIDE; + + factor = (data & MPT_NVRAM_SYNC_MASK) >> MPT_NVRAM_SYNC_SHIFT; + if ((factor == 0) || (factor == MPT_ASYNC)) + flags |= MPT_TARGET_NO_NEGO_SYNC; + } } + + /* Force to async, narrow */ mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested, - &configuration, flags); + &configuration, flags); dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC " "offset=0 negoFlags=%x request=%x config=%x\n", id, flags, requested, configuration)); pcfg1Data->RequestedParameters = cpu_to_le32(requested); pcfg1Data->Reserved = 0; pcfg1Data->Configuration = cpu_to_le32(configuration); - cfg.pageAddr = (vtarget->bus_id<<8) | id; + cfg.pageAddr = (bus<<8) | id; mpt_config(hd->ioc, &cfg); } - } else { - flags = vtarget->negoFlags; - mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested, - &configuration, flags); - dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC " - "offset=0 negoFlags=%x request=%x config=%x\n", - vtarget->target_id, flags, requested, configuration)); - pcfg1Data->RequestedParameters = cpu_to_le32(requested); - pcfg1Data->Reserved = 0; - pcfg1Data->Configuration = cpu_to_le32(configuration); - cfg.pageAddr = (vtarget->bus_id<<8) | vtarget->target_id; - mpt_config(hd->ioc, &cfg); - } - - if (pcfg1Data) - pci_free_consistent(ioc->pcidev, header.PageLength * 4, pcfg1Data, cfg1_dma_addr); -} - -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * mptscsih_synchronize_cache - Send SYNCHRONIZE_CACHE to all disks. - * @hd: Pointer to a SCSI HOST structure - * @vtarget: per device private data - * @lun: lun - * - * Uses the ISR, but with special processing. - * MUST be single-threaded. - * - */ -static void -mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice) -{ - INTERNAL_CMD iocmd; - /* Following parameters will not change - * in this routine. - */ - iocmd.cmd = SYNCHRONIZE_CACHE; - iocmd.flags = 0; - iocmd.physDiskNum = -1; - iocmd.data = NULL; - iocmd.data_dma = -1; - iocmd.size = 0; - iocmd.rsvd = iocmd.rsvd2 = 0; - iocmd.bus = vdevice->bus_id; - iocmd.id = vdevice->target_id; - iocmd.lun = (u8)vdevice->lun; + /* If target Ptr NULL or if this target is NOT a disk, skip. + */ + if ((pTarget) && (pTarget->inq_data[0] == TYPE_DISK)){ + for (lun=0; lun <= MPT_LAST_LUN; lun++) { + /* If LUN present, issue the command + */ + lun_index = (lun >> 5); /* 32 luns per lun_index */ + indexed_lun = (lun % 32); + if (pTarget->luns[lun_index] & (1<vtarget->type & TYPE_DISK) && - (vdevice->configured_lun)) - mptscsih_do_cmd(hd, &iocmd); -} + /* get next relevant device */ + id++; -/* Search IOC page 3 to determine if this is hidden physical disk - */ -/* Search IOC page 3 to determine if this is hidden physical disk - */ -static int -mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id) -{ - int i; + if (id == hostId) + id++; - if (!ioc->raid_data.isRaid || !ioc->raid_data.pIocPg3) - return 0; + if (id > max_id) { + id = 0; + bus++; + } + } - for (i = 0; i < ioc->raid_data.pIocPg3->NumPhysDisks; i++) { - if (id == ioc->raid_data.pIocPg3->PhysDisk[i].PhysDiskID) - return 1; + if (pcfg1Data) { + pci_free_consistent(ioc->pcidev, header1.PageLength * 4, pcfg1Data, cfg1_dma_addr); } return 0; @@ -4021,8 +4101,8 @@ mptscsih_domainValidation(void *arg) msleep(250); - /* DV only to SPI adapters */ - if (ioc->bus_type != SPI) + /* DV only to SCSI adapters */ + if (ioc->bus_type != SCSI) continue; /* Make sure everything looks ok */ @@ -4082,12 +4162,6 @@ mptscsih_domainValidation(void *arg) } } - if(mpt_alt_ioc_wait(hd->ioc)!=0) { - ddvprintk((MYIOC_s_WARN_FMT "alt_ioc busy!\n", - hd->ioc->name)); - continue; - } - if (mptscsih_doDv(hd, 0, id) == 1) { /* Untagged device was busy, try again */ @@ -4099,10 +4173,6 @@ mptscsih_domainValidation(void *arg) hd->ioc->spi_data.dvStatus[id] &= ~(MPT_SCSICFG_DV_NOT_DONE | MPT_SCSICFG_DV_PENDING); } - spin_lock(&hd->ioc->initializing_hba_lock); - hd->ioc->initializing_hba_lock_flag=0; - spin_unlock(&hd->ioc->initializing_hba_lock); - if (isPhysDisk) { for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) { if (hd->ioc->raid_data.isRaid & (1 << ii)) { @@ -4125,12 +4195,32 @@ mptscsih_domainValidation(void *arg) return; } +/* Search IOC page 3 to determine if this is hidden physical disk + */ +/* Search IOC page 3 to determine if this is hidden physical disk + */ +static int +mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id) +{ + int i; + + if (!ioc->raid_data.isRaid || !ioc->raid_data.pIocPg3) + return 0; + + for (i = 0; i < ioc->raid_data.pIocPg3->NumPhysDisks; i++) { + if (id == ioc->raid_data.pIocPg3->PhysDisk[i].PhysDiskID) + return 1; + } + + return 0; +} + /* Write SDP1 if no QAS has been enabled */ static void mptscsih_qas_check(MPT_SCSI_HOST *hd, int id) { - VirtTarget *vtarget; + VirtDevice *pTarget; int ii; if (hd->Targets == NULL) @@ -4143,11 +4233,11 @@ mptscsih_qas_check(MPT_SCSI_HOST *hd, int id) if ((hd->ioc->spi_data.dvStatus[ii] & MPT_SCSICFG_DV_NOT_DONE) != 0) continue; - vtarget = hd->Targets[ii]; + pTarget = hd->Targets[ii]; - if ((vtarget != NULL) && (!vtarget->raidVolume)) { - if ((vtarget->negoFlags & hd->ioc->spi_data.noQas) == 0) { - vtarget->negoFlags |= hd->ioc->spi_data.noQas; + if ((pTarget != NULL) && (!pTarget->raidVolume)) { + if ((pTarget->negoFlags & hd->ioc->spi_data.noQas) == 0) { + pTarget->negoFlags |= hd->ioc->spi_data.noQas; dnegoprintk(("writeSDP1: id=%d flags=0\n", id)); mptscsih_writeSDP1(hd, 0, ii, 0); } @@ -4187,7 +4277,7 @@ static int mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id) { MPT_ADAPTER *ioc = hd->ioc; - VirtTarget *vtarget; + VirtDevice *pTarget; SCSIDevicePage1_t *pcfg1Data; SCSIDevicePage0_t *pcfg0Data; u8 *pbuf1; @@ -4258,12 +4348,12 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id) iocmd.physDiskNum = -1; iocmd.rsvd = iocmd.rsvd2 = 0; - vtarget = hd->Targets[id]; + pTarget = hd->Targets[id]; /* Use tagged commands if possible. */ - if (vtarget) { - if (vtarget->tflags & MPT_TARGET_FLAGS_Q_YES) + if (pTarget) { + if (pTarget->tflags & MPT_TARGET_FLAGS_Q_YES) iocmd.flags |= MPT_ICFLAG_TAGGED_CMD; else { if (hd->ioc->facts.FWVersion.Word < 0x01000600) @@ -4479,7 +4569,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id) /* Reset the size for disks */ inq0 = (*pbuf1) & 0x1F; - if ((inq0 == 0) && vtarget && !vtarget->raidVolume) { + if ((inq0 == 0) && pTarget && !pTarget->raidVolume) { sz = 0x40; iocmd.size = sz; } @@ -4489,7 +4579,8 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id) */ if (inq0 == TYPE_PROCESSOR) { mptscsih_initTarget(hd, - vtarget, + bus, + id, lun, pbuf1, sz); @@ -4503,22 +4594,22 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id) goto target_done; if (sz == 0x40) { - if ((vtarget->maxWidth == 1) && (vtarget->maxOffset) && (nfactor < 0x0A) - && (vtarget->minSyncFactor > 0x09)) { + if ((pTarget->maxWidth == 1) && (pTarget->maxOffset) && (nfactor < 0x0A) + && (pTarget->minSyncFactor > 0x09)) { if ((pbuf1[56] & 0x04) == 0) ; else if ((pbuf1[56] & 0x01) == 1) { - vtarget->minSyncFactor = + pTarget->minSyncFactor = nfactor > MPT_ULTRA320 ? nfactor : MPT_ULTRA320; } else { - vtarget->minSyncFactor = + pTarget->minSyncFactor = nfactor > MPT_ULTRA160 ? nfactor : MPT_ULTRA160; } - dv.max.factor = vtarget->minSyncFactor; + dv.max.factor = pTarget->minSyncFactor; if ((pbuf1[56] & 0x02) == 0) { - vtarget->negoFlags |= MPT_TARGET_NO_NEGO_QAS; + pTarget->negoFlags |= MPT_TARGET_NO_NEGO_QAS; hd->ioc->spi_data.noQas = MPT_TARGET_NO_NEGO_QAS; ddvprintk((MYIOC_s_NOTE_FMT "DV: Start Basic noQas on id=%d due to pbuf1[56]=%x\n", @@ -4601,7 +4692,8 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id) "DV:Inquiry compared id=%d, calling initTarget\n", ioc->name, id)); hd->ioc->spi_data.dvStatus[id] &= ~MPT_SCSICFG_DV_NOT_DONE; mptscsih_initTarget(hd, - vtarget, + bus, + id, lun, pbuf1, sz); @@ -5102,7 +5194,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id) static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage) { - VirtTarget *vtarget; + VirtDevice *pTarget; SCSIDevicePage0_t *pPage0; SCSIDevicePage1_t *pPage1; int val = 0, data, configuration; @@ -5122,11 +5214,11 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage) * already throttled back. */ negoFlags = hd->ioc->spi_data.noQas; - if ((hd->Targets)&&((vtarget = hd->Targets[(int)id]) != NULL) && !vtarget->raidVolume) { - width = vtarget->maxWidth; - offset = vtarget->maxOffset; - factor = vtarget->minSyncFactor; - negoFlags |= vtarget->negoFlags; + if ((hd->Targets)&&((pTarget = hd->Targets[(int)id]) != NULL) && !pTarget->raidVolume) { + width = pTarget->maxWidth; + offset = pTarget->maxOffset; + factor = pTarget->minSyncFactor; + negoFlags |= pTarget->negoFlags; } else { if (hd->ioc->spi_data.nvram && (hd->ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) { data = hd->ioc->spi_data.nvram[id]; @@ -5328,11 +5420,11 @@ mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage) * or overwrite nvram (phys disks only). */ - if ((hd->Targets)&&((vtarget = hd->Targets[(int)id]) != NULL) && !vtarget->raidVolume ) { - vtarget->maxWidth = dv->now.width; - vtarget->maxOffset = dv->now.offset; - vtarget->minSyncFactor = dv->now.factor; - vtarget->negoFlags = dv->now.flags; + if ((hd->Targets)&&((pTarget = hd->Targets[(int)id]) != NULL) && !pTarget->raidVolume ) { + pTarget->maxWidth = dv->now.width; + pTarget->maxOffset = dv->now.offset; + pTarget->minSyncFactor = dv->now.factor; + pTarget->negoFlags = dv->now.flags; } else { /* Preserv all flags, use * read-modify-write algorithm @@ -5486,94 +5578,6 @@ mptscsih_fillbuf(char *buffer, int size, int index, int width) break; } } - -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/* If DV disabled (negoNvram set to USE_NVARM) or if not LUN 0, return. - * Else set the NEED_DV flag after Read Capacity Issued (disks) - * or Mode Sense (cdroms). - * - * Tapes, initTarget will set this flag on completion of Inquiry command. - * Called only if DV_NOT_DONE flag is set - */ -static void -mptscsih_set_dvflags(MPT_SCSI_HOST *hd, struct scsi_cmnd *sc) -{ - MPT_ADAPTER *ioc = hd->ioc; - u8 cmd; - SpiCfgData *pSpi; - - ddvtprintk((MYIOC_s_NOTE_FMT - " set_dvflags: id=%d lun=%d negoNvram=%x cmd=%x\n", - hd->ioc->name, sc->device->id, sc->device->lun , hd->negoNvram, sc->cmnd[0])); - - if ((sc->device->lun != 0) || (hd->negoNvram != 0)) - return; - - cmd = sc->cmnd[0]; - - if ((cmd == READ_CAPACITY) || (cmd == MODE_SENSE)) { - pSpi = &ioc->spi_data; - if ((ioc->raid_data.isRaid & (1 << sc->device->id)) && ioc->raid_data.pIocPg3) { - /* Set NEED_DV for all hidden disks - */ - Ioc3PhysDisk_t *pPDisk = ioc->raid_data.pIocPg3->PhysDisk; - int numPDisk = ioc->raid_data.pIocPg3->NumPhysDisks; - - while (numPDisk) { - pSpi->dvStatus[pPDisk->PhysDiskID] |= MPT_SCSICFG_NEED_DV; - ddvtprintk(("NEED_DV set for phys disk id %d\n", pPDisk->PhysDiskID)); - pPDisk++; - numPDisk--; - } - } - pSpi->dvStatus[sc->device->id] |= MPT_SCSICFG_NEED_DV; - ddvtprintk(("NEED_DV set for visible disk id %d\n", sc->device->id)); - } -} - -/* mptscsih_raid_set_dv_flags() - * - * New or replaced disk. Set DV flag and schedule DV. - */ -static void -mptscsih_set_dvflags_raid(MPT_SCSI_HOST *hd, int id) -{ - MPT_ADAPTER *ioc = hd->ioc; - SpiCfgData *pSpi = &ioc->spi_data; - Ioc3PhysDisk_t *pPDisk; - int numPDisk; - - if (hd->negoNvram != 0) - return; - - ddvtprintk(("DV requested for phys disk id %d\n", id)); - if (ioc->raid_data.pIocPg3) { - pPDisk = ioc->raid_data.pIocPg3->PhysDisk; - numPDisk = ioc->raid_data.pIocPg3->NumPhysDisks; - while (numPDisk) { - if (id == pPDisk->PhysDiskNum) { - pSpi->dvStatus[pPDisk->PhysDiskID] = - (MPT_SCSICFG_NEED_DV | MPT_SCSICFG_DV_NOT_DONE); - pSpi->forceDv = MPT_SCSICFG_NEED_DV; - ddvtprintk(("NEED_DV set for phys disk id %d\n", - pPDisk->PhysDiskID)); - break; - } - pPDisk++; - numPDisk--; - } - - if (numPDisk == 0) { - /* The physical disk that needs DV was not found - * in the stored IOC Page 3. The driver must reload - * this page. DV routine will set the NEED_DV flag for - * all phys disks that have DV_NOT_DONE set. - */ - pSpi->forceDv = MPT_SCSICFG_NEED_DV | MPT_SCSICFG_RELOAD_IOC_PG3; - ddvtprintk(("phys disk %d not found. Setting reload IOC Pg3 Flag\n",id)); - } - } -} #endif /* ~MPTSCSIH_ENABLE_DOMAIN_VALIDATION */ EXPORT_SYMBOL(mptscsih_remove); @@ -5585,9 +5589,7 @@ EXPORT_SYMBOL(mptscsih_resume); EXPORT_SYMBOL(mptscsih_proc_info); EXPORT_SYMBOL(mptscsih_info); EXPORT_SYMBOL(mptscsih_qcmd); -EXPORT_SYMBOL(mptscsih_target_alloc); EXPORT_SYMBOL(mptscsih_slave_alloc); -EXPORT_SYMBOL(mptscsih_target_destroy); EXPORT_SYMBOL(mptscsih_slave_destroy); EXPORT_SYMBOL(mptscsih_slave_configure); EXPORT_SYMBOL(mptscsih_abort); diff --git a/trunk/drivers/message/fusion/mptscsih.h b/trunk/drivers/message/fusion/mptscsih.h index d3cba12f4bd9..971fda4b8b57 100644 --- a/trunk/drivers/message/fusion/mptscsih.h +++ b/trunk/drivers/message/fusion/mptscsih.h @@ -91,9 +91,7 @@ extern int mptscsih_resume(struct pci_dev *pdev); extern int mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int func); extern const char * mptscsih_info(struct Scsi_Host *SChost); extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)); -extern int mptscsih_target_alloc(struct scsi_target *starget); extern int mptscsih_slave_alloc(struct scsi_device *device); -extern void mptscsih_target_destroy(struct scsi_target *starget); extern void mptscsih_slave_destroy(struct scsi_device *device); extern int mptscsih_slave_configure(struct scsi_device *device); extern int mptscsih_abort(struct scsi_cmnd * SCpnt); diff --git a/trunk/drivers/message/fusion/mptspi.c b/trunk/drivers/message/fusion/mptspi.c index ce332a6085e5..5c0e307d1d5d 100644 --- a/trunk/drivers/message/fusion/mptspi.c +++ b/trunk/drivers/message/fusion/mptspi.c @@ -103,16 +103,13 @@ static int mptspiTaskCtx = -1; static int mptspiInternalCtx = -1; /* Used only for internal commands */ static struct scsi_host_template mptspi_driver_template = { - .module = THIS_MODULE, .proc_name = "mptspi", .proc_info = mptscsih_proc_info, .name = "MPT SPI Host", .info = mptscsih_info, .queuecommand = mptscsih_qcmd, - .target_alloc = mptscsih_target_alloc, .slave_alloc = mptscsih_slave_alloc, .slave_configure = mptscsih_slave_configure, - .target_destroy = mptscsih_target_destroy, .slave_destroy = mptscsih_slave_destroy, .change_queue_depth = mptscsih_change_queue_depth, .eh_abort_handler = mptscsih_abort, @@ -180,15 +177,13 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) printk(MYIOC_s_WARN_FMT "Skipping because it's not operational!\n", ioc->name); - error = -ENODEV; - goto out_mptspi_probe; + return -ENODEV; } if (!ioc->active) { printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n", ioc->name); - error = -ENODEV; - goto out_mptspi_probe; + return -ENODEV; } /* Sanity check - ensure at least 1 port is INITIATOR capable @@ -213,8 +208,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) printk(MYIOC_s_WARN_FMT "Unable to register controller with SCSI subsystem\n", ioc->name); - error = -1; - goto out_mptspi_probe; + return -1; } spin_lock_irqsave(&ioc->FreeQlock, flags); @@ -292,7 +286,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) mem = kmalloc(sz, GFP_ATOMIC); if (mem == NULL) { error = -ENOMEM; - goto out_mptspi_probe; + goto mptspi_probe_failed; } memset(mem, 0, sz); @@ -310,14 +304,14 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) mem = kmalloc(sz, GFP_ATOMIC); if (mem == NULL) { error = -ENOMEM; - goto out_mptspi_probe; + goto mptspi_probe_failed; } memset(mem, 0, sz); - hd->Targets = (VirtTarget **) mem; + hd->Targets = (VirtDevice **) mem; dprintk((KERN_INFO - " vdev @ %p, sz=%d\n", hd->Targets, sz)); + " Targets @ %p, sz=%d\n", hd->Targets, sz)); /* Clear the TM flags */ @@ -391,13 +385,13 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) if(error) { dprintk((KERN_ERR MYNAM "scsi_add_host failed\n")); - goto out_mptspi_probe; + goto mptspi_probe_failed; } scsi_scan_host(sh); return 0; -out_mptspi_probe: +mptspi_probe_failed: mptscsih_remove(pdev); return error; diff --git a/trunk/drivers/message/i2o/pci.c b/trunk/drivers/message/i2o/pci.c index ee7075fa1ec3..66c03e882570 100644 --- a/trunk/drivers/message/i2o/pci.c +++ b/trunk/drivers/message/i2o/pci.c @@ -303,7 +303,6 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev, struct i2o_controller *c; int rc; struct pci_dev *i960 = NULL; - int pci_dev_busy = 0; printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n"); @@ -396,8 +395,6 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev, if ((rc = i2o_pci_alloc(c))) { printk(KERN_ERR "%s: DMA / IO allocation for I2O controller " " failed\n", c->name); - if (rc == -ENODEV) - pci_dev_busy = 1; goto free_controller; } @@ -424,12 +421,11 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev, i2o_pci_free(c); free_controller: - put_device(c->device.parent); i2o_iop_free(c); + put_device(c->device.parent); disable: - if (!pci_dev_busy) - pci_disable_device(pdev); + pci_disable_device(pdev); return rc; } diff --git a/trunk/drivers/mfd/ucb1x00-ts.c b/trunk/drivers/mfd/ucb1x00-ts.c index 551061c2eadf..a984c0efabf0 100644 --- a/trunk/drivers/mfd/ucb1x00-ts.c +++ b/trunk/drivers/mfd/ucb1x00-ts.c @@ -59,18 +59,16 @@ static int adcsync; static inline void ucb1x00_ts_evt_add(struct ucb1x00_ts *ts, u16 pressure, u16 x, u16 y) { - struct input_dev *idev = ts->idev; - input_report_abs(idev, ABS_X, x); - input_report_abs(idev, ABS_Y, y); - input_report_abs(idev, ABS_PRESSURE, pressure); - input_sync(idev); + input_report_abs(ts->idev, ABS_X, x); + input_report_abs(ts->idev, ABS_Y, y); + input_report_abs(ts->idev, ABS_PRESSURE, pressure); + input_sync(ts->idev); } static inline void ucb1x00_ts_event_release(struct ucb1x00_ts *ts) { - struct input_dev *idev = ts->idev; - input_report_abs(idev, ABS_PRESSURE, 0); - input_sync(idev); + input_report_abs(ts->idev, ABS_PRESSURE, 0); + input_sync(ts->idev); } /* @@ -299,7 +297,7 @@ static void ucb1x00_ts_irq(int idx, void *id) static int ucb1x00_ts_open(struct input_dev *idev) { - struct ucb1x00_ts *ts = idev->private; + struct ucb1x00_ts *ts = (struct ucb1x00_ts *)idev; int ret = 0; BUG_ON(ts->rtask); @@ -336,7 +334,7 @@ static int ucb1x00_ts_open(struct input_dev *idev) */ static void ucb1x00_ts_close(struct input_dev *idev) { - struct ucb1x00_ts *ts = idev->private; + struct ucb1x00_ts *ts = (struct ucb1x00_ts *)idev; if (ts->rtask) kthread_stop(ts->rtask); @@ -388,7 +386,6 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev) ts->ucb = dev->ucb; ts->adcsync = adcsync ? UCB_SYNC : UCB_NOSYNC; - ts->idev->private = ts; ts->idev->name = "Touchscreen panel"; ts->idev->id.product = ts->ucb->id; ts->idev->open = ucb1x00_ts_open; diff --git a/trunk/drivers/mmc/mmc.c b/trunk/drivers/mmc/mmc.c index eb41391e06e9..da528390acf8 100644 --- a/trunk/drivers/mmc/mmc.c +++ b/trunk/drivers/mmc/mmc.c @@ -679,15 +679,7 @@ static void mmc_idle_cards(struct mmc_host *host) } /* - * Apply power to the MMC stack. This is a two-stage process. - * First, we enable power to the card without the clock running. - * We then wait a bit for the power to stabilise. Finally, - * enable the bus drivers and clock to the card. - * - * We must _NOT_ enable the clock prior to power stablising. - * - * If a host does all the power sequencing itself, ignore the - * initial MMC_POWER_UP stage. + * Apply power to the MMC stack. */ static void mmc_power_up(struct mmc_host *host) { @@ -824,7 +816,7 @@ static void mmc_discover_cards(struct mmc_host *host) cmd.opcode = SD_SEND_RELATIVE_ADDR; cmd.arg = 0; - cmd.flags = MMC_RSP_R6; + cmd.flags = MMC_RSP_R1; err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES); if (err != MMC_ERR_NONE) @@ -940,9 +932,8 @@ static void mmc_read_scrs(struct mmc_host *host) sg_init_one(&sg, (u8*)card->raw_scr, 8); - mmc_wait_for_req(host, &mrq); - - if (cmd.error != MMC_ERR_NONE || data.error != MMC_ERR_NONE) { + err = mmc_wait_for_req(host, &mrq); + if (err != MMC_ERR_NONE) { mmc_card_set_dead(card); continue; } diff --git a/trunk/drivers/mmc/mmc_block.c b/trunk/drivers/mmc/mmc_block.c index abcf19116d70..d91fcf7c3178 100644 --- a/trunk/drivers/mmc/mmc_block.c +++ b/trunk/drivers/mmc/mmc_block.c @@ -359,12 +359,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) md->block_bits = card->csd.read_blkbits; blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits); - - /* - * The CSD capacity field is in units of read_blkbits. - * set_capacity takes units of 512 bytes. - */ - set_capacity(md->disk, card->csd.capacity << (card->csd.read_blkbits - 9)); + set_capacity(md->disk, card->csd.capacity); } out: return md; @@ -378,7 +373,7 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card) mmc_card_claim_host(card); cmd.opcode = MMC_SET_BLOCKLEN; - cmd.arg = 1 << md->block_bits; + cmd.arg = 1 << card->csd.read_blkbits; cmd.flags = MMC_RSP_R1; err = mmc_wait_for_cmd(card->host, &cmd, 5); mmc_card_release_host(card); @@ -417,9 +412,10 @@ static int mmc_blk_probe(struct mmc_card *card) if (err) goto out; - printk(KERN_INFO "%s: %s %s %luKiB %s\n", + printk(KERN_INFO "%s: %s %s %dKiB %s\n", md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), - get_capacity(md->disk) >> 1, mmc_blk_readonly(card)?"(ro)":""); + (card->csd.capacity << card->csd.read_blkbits) / 1024, + mmc_blk_readonly(card)?"(ro)":""); mmc_set_drvdata(card, md); add_disk(md->disk); diff --git a/trunk/drivers/mmc/mmci.c b/trunk/drivers/mmc/mmci.c index 166c9b0ad04e..1e6bdba26756 100644 --- a/trunk/drivers/mmc/mmci.c +++ b/trunk/drivers/mmc/mmci.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/mtd/chips/cfi_cmdset_0001.c b/trunk/drivers/mtd/chips/cfi_cmdset_0001.c index 69c04945591f..143f01a4c170 100644 --- a/trunk/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/trunk/drivers/mtd/chips/cfi_cmdset_0001.c @@ -4,7 +4,7 @@ * * (C) 2000 Red Hat. GPL'd * - * $Id: cfi_cmdset_0001.c,v 1.186 2005/11/23 22:07:52 nico Exp $ + * $Id: cfi_cmdset_0001.c,v 1.185 2005/11/07 11:14:22 gleixner Exp $ * * * 10/10/2000 Nicolas Pitre @@ -644,8 +644,9 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr * * - contension arbitration is handled in the owner's context. * - * The 'shared' struct can be read and/or written only when - * its lock is taken. + * The 'shared' struct can be read when its lock is taken. + * However any writes to it can only be made when the current + * owner's lock is also held. */ struct flchip_shared *shared = chip->priv; struct flchip *contender; @@ -674,13 +675,14 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr } timeo = jiffies + HZ; spin_lock(&shared->lock); - spin_unlock(contender->mutex); } /* We now own it */ shared->writing = chip; if (mode == FL_ERASING) shared->erasing = chip; + if (contender && contender != chip) + spin_unlock(contender->mutex); spin_unlock(&shared->lock); } diff --git a/trunk/drivers/mtd/chips/cfi_probe.c b/trunk/drivers/mtd/chips/cfi_probe.c index e636aa86bc24..90eb30e06b7c 100644 --- a/trunk/drivers/mtd/chips/cfi_probe.c +++ b/trunk/drivers/mtd/chips/cfi_probe.c @@ -1,7 +1,7 @@ /* Common Flash Interface probe code. (C) 2000 Red Hat. GPL'd. - $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $ + $Id: cfi_probe.c,v 1.84 2005/11/07 11:14:23 gleixner Exp $ */ #include @@ -230,8 +230,8 @@ static int __xipram cfi_chip_setup(struct map_info *map, cfi_send_gen_cmd(0xaa, 0x555, base, map, cfi, cfi->device_type, NULL); cfi_send_gen_cmd(0x55, 0x2aa, base, map, cfi, cfi->device_type, NULL); cfi_send_gen_cmd(0x90, 0x555, base, map, cfi, cfi->device_type, NULL); - cfi->mfr = cfi_read_query16(map, base); - cfi->id = cfi_read_query16(map, base + ofs_factor); + cfi->mfr = cfi_read_query(map, base); + cfi->id = cfi_read_query(map, base + ofs_factor); /* Put it back into Read Mode */ cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); @@ -426,7 +426,7 @@ static struct mtd_chip_driver cfi_chipdrv = { .module = THIS_MODULE }; -static int __init cfi_probe_init(void) +int __init cfi_probe_init(void) { register_mtd_chip_driver(&cfi_chipdrv); return 0; diff --git a/trunk/drivers/mtd/chips/sharp.c b/trunk/drivers/mtd/chips/sharp.c index 36f61a6a766e..2d26bdef82d5 100644 --- a/trunk/drivers/mtd/chips/sharp.c +++ b/trunk/drivers/mtd/chips/sharp.c @@ -4,7 +4,7 @@ * Copyright 2000,2001 David A. Schleef * 2000,2001 Lineo, Inc. * - * $Id: sharp.c,v 1.17 2005/11/29 14:28:28 gleixner Exp $ + * $Id: sharp.c,v 1.16 2005/11/07 11:14:23 gleixner Exp $ * * Devices supported: * LH28F016SCT Symmetrical block flash memory, 2Mx8 @@ -160,28 +160,22 @@ struct mtd_info *sharp_probe(struct map_info *map) return mtd; } -static inline void sharp_send_cmd(struct map_info *map, unsigned long cmd, unsigned long adr) -{ - map_word map_cmd; - map_cmd.x[0] = cmd; - map_write(map, map_cmd, adr); -} - static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd) { - map_word tmp, read0, read4; + unsigned long tmp; unsigned long base = 0; + u32 read0, read4; int width = 4; - tmp = map_read(map, base+0); + tmp = map_read32(map, base+0); - sharp_send_cmd(map, CMD_READ_ID, base+0); + map_write32(map, CMD_READ_ID, base+0); - read0 = map_read(map, base+0); - read4 = map_read(map, base+4); - if(read0.x[0] == 0x89898989){ + read0=map_read32(map, base+0); + read4=map_read32(map, base+4); + if(read0 == 0x89898989){ printk("Looks like sharp flash\n"); - switch(read4.x[0]){ + switch(read4){ case 0xaaaaaaaa: case 0xa0a0a0a0: /* aa - LH28F016SCT-L95 2Mx8, 32 64k blocks*/ @@ -203,16 +197,16 @@ static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd) return width; #endif default: - printk("Sort-of looks like sharp flash, 0x%08lx 0x%08lx\n", - read0.x[0], read4.x[0]); + printk("Sort-of looks like sharp flash, 0x%08x 0x%08x\n", + read0,read4); } - }else if((map_read(map, base+0).x[0] == CMD_READ_ID)){ + }else if((map_read32(map, base+0) == CMD_READ_ID)){ /* RAM, probably */ printk("Looks like RAM\n"); - map_write(map, tmp, base+0); + map_write32(map, tmp, base+0); }else{ - printk("Doesn't look like sharp flash, 0x%08lx 0x%08lx\n", - read0.x[0], read4.x[0]); + printk("Doesn't look like sharp flash, 0x%08x 0x%08x\n", + read0,read4); } return 0; @@ -221,8 +215,7 @@ static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd) /* This function returns with the chip->mutex lock held. */ static int sharp_wait(struct map_info *map, struct flchip *chip) { - int i; - map_word status; + int status, i; unsigned long timeo = jiffies + HZ; DECLARE_WAITQUEUE(wait, current); int adr = 0; @@ -232,12 +225,12 @@ static int sharp_wait(struct map_info *map, struct flchip *chip) switch(chip->state){ case FL_READY: - sharp_send_cmd(map, CMD_READ_STATUS, adr); + map_write32(map,CMD_READ_STATUS,adr); chip->state = FL_STATUS; case FL_STATUS: for(i=0;i<100;i++){ - status = map_read(map, adr); - if((status.x[0] & SR_READY)==SR_READY) + status = map_read32(map,adr); + if((status & SR_READY)==SR_READY) break; udelay(1); } @@ -261,7 +254,7 @@ static int sharp_wait(struct map_info *map, struct flchip *chip) goto retry; } - sharp_send_cmd(map, CMD_RESET, adr); + map_write32(map,CMD_RESET, adr); chip->state = FL_READY; @@ -358,39 +351,37 @@ static int sharp_write_oneword(struct map_info *map, struct flchip *chip, int timeo; int try; int i; - map_word data, status; + int status = 0; - status.x[0] = 0; ret = sharp_wait(map,chip); for(try=0;try<10;try++){ - sharp_send_cmd(map, CMD_BYTE_WRITE, adr); + map_write32(map,CMD_BYTE_WRITE,adr); /* cpu_to_le32 -> hack to fix the writel be->le conversion */ - data.x[0] = cpu_to_le32(datum); - map_write(map, data, adr); + map_write32(map,cpu_to_le32(datum),adr); chip->state = FL_WRITING; timeo = jiffies + (HZ/2); - sharp_send_cmd(map, CMD_READ_STATUS, adr); + map_write32(map,CMD_READ_STATUS,adr); for(i=0;i<100;i++){ - status = map_read(map, adr); - if((status.x[0] & SR_READY) == SR_READY) + status = map_read32(map,adr); + if((status & SR_READY)==SR_READY) break; } if(i==100){ printk("sharp: timed out writing\n"); } - if(!(status.x[0] & SR_ERRORS)) + if(!(status&SR_ERRORS)) break; - printk("sharp: error writing byte at addr=%08lx status=%08lx\n", adr, status.x[0]); + printk("sharp: error writing byte at addr=%08lx status=%08x\n",adr,status); - sharp_send_cmd(map, CMD_CLEAR_STATUS, adr); + map_write32(map,CMD_CLEAR_STATUS,adr); } - sharp_send_cmd(map, CMD_RESET, adr); + map_write32(map,CMD_RESET,adr); chip->state = FL_READY; wake_up(&chip->wq); @@ -443,18 +434,18 @@ static int sharp_do_wait_for_ready(struct map_info *map, struct flchip *chip, { int ret; unsigned long timeo; - map_word status; + int status; DECLARE_WAITQUEUE(wait, current); - sharp_send_cmd(map, CMD_READ_STATUS, adr); - status = map_read(map, adr); + map_write32(map,CMD_READ_STATUS,adr); + status = map_read32(map,adr); timeo = jiffies + HZ; while(time_before(jiffies, timeo)){ - sharp_send_cmd(map, CMD_READ_STATUS, adr); - status = map_read(map, adr); - if((status.x[0] & SR_READY)==SR_READY){ + map_write32(map,CMD_READ_STATUS,adr); + status = map_read32(map,adr); + if((status & SR_READY)==SR_READY){ ret = 0; goto out; } @@ -485,7 +476,7 @@ static int sharp_erase_oneblock(struct map_info *map, struct flchip *chip, { int ret; //int timeo; - map_word status; + int status; //int i; //printk("sharp_erase_oneblock()\n"); @@ -495,26 +486,26 @@ static int sharp_erase_oneblock(struct map_info *map, struct flchip *chip, sharp_unlock_oneblock(map,chip,adr); #endif - sharp_send_cmd(map, CMD_BLOCK_ERASE_1, adr); - sharp_send_cmd(map, CMD_BLOCK_ERASE_2, adr); + map_write32(map,CMD_BLOCK_ERASE_1,adr); + map_write32(map,CMD_BLOCK_ERASE_2,adr); chip->state = FL_ERASING; ret = sharp_do_wait_for_ready(map,chip,adr); if(ret<0)return ret; - sharp_send_cmd(map, CMD_READ_STATUS, adr); - status = map_read(map, adr); + map_write32(map,CMD_READ_STATUS,adr); + status = map_read32(map,adr); - if(!(status.x[0] & SR_ERRORS)){ - sharp_send_cmd(map, CMD_RESET, adr); + if(!(status&SR_ERRORS)){ + map_write32(map,CMD_RESET,adr); chip->state = FL_READY; //spin_unlock_bh(chip->mutex); return 0; } - printk("sharp: error erasing block at addr=%08lx status=%08lx\n", adr, status.x[0]); - sharp_send_cmd(map, CMD_CLEAR_STATUS, adr); + printk("sharp: error erasing block at addr=%08lx status=%08x\n",adr,status); + map_write32(map,CMD_CLEAR_STATUS,adr); //spin_unlock_bh(chip->mutex); @@ -526,20 +517,20 @@ static void sharp_unlock_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr) { int i; - map_word status; + int status; - sharp_send_cmd(map, CMD_CLEAR_BLOCK_LOCKS_1, adr); - sharp_send_cmd(map, CMD_CLEAR_BLOCK_LOCKS_2, adr); + map_write32(map,CMD_CLEAR_BLOCK_LOCKS_1,adr); + map_write32(map,CMD_CLEAR_BLOCK_LOCKS_2,adr); udelay(100); - status = map_read(map, adr); - printk("status=%08lx\n", status.x[0]); + status = map_read32(map,adr); + printk("status=%08x\n",status); for(i=0;i<1000;i++){ - //sharp_send_cmd(map, CMD_READ_STATUS, adr); - status = map_read(map, adr); - if((status.x[0] & SR_READY) == SR_READY) + //map_write32(map,CMD_READ_STATUS,adr); + status = map_read32(map,adr); + if((status & SR_READY)==SR_READY) break; udelay(100); } @@ -547,14 +538,14 @@ static void sharp_unlock_oneblock(struct map_info *map, struct flchip *chip, printk("sharp: timed out unlocking block\n"); } - if(!(status.x[0] & SR_ERRORS)){ - sharp_send_cmd(map, CMD_RESET, adr); + if(!(status&SR_ERRORS)){ + map_write32(map,CMD_RESET,adr); chip->state = FL_READY; return; } - printk("sharp: error unlocking block at addr=%08lx status=%08lx\n", adr, status.x[0]); - sharp_send_cmd(map, CMD_CLEAR_STATUS, adr); + printk("sharp: error unlocking block at addr=%08lx status=%08x\n",adr,status); + map_write32(map,CMD_CLEAR_STATUS,adr); } #endif diff --git a/trunk/drivers/mtd/devices/blkmtd.c b/trunk/drivers/mtd/devices/blkmtd.c index 04f864d238db..f9db52f6bf00 100644 --- a/trunk/drivers/mtd/devices/blkmtd.c +++ b/trunk/drivers/mtd/devices/blkmtd.c @@ -113,7 +113,7 @@ static int bi_write_complete(struct bio *bio, unsigned int bytes_done, int error ClearPageUptodate(page); SetPageError(page); } - clear_page_dirty(page); + ClearPageDirty(page); unlock_page(page); page_cache_release(page); } while (bvec >= bio->bi_io_vec); @@ -289,7 +289,7 @@ static int write_pages(struct blkmtd_dev *dev, const u_char *buf, loff_t to, BUG(); } memcpy(page_address(page)+offset, buf, start_len); - set_page_dirty(page); + SetPageDirty(page); SetPageUptodate(page); buf += start_len; thislen = start_len; @@ -336,7 +336,7 @@ static int write_pages(struct blkmtd_dev *dev, const u_char *buf, loff_t to, } pagenr++; pagecnt--; - set_page_dirty(page); + SetPageDirty(page); SetPageUptodate(page); pagesc--; thislen += PAGE_SIZE; @@ -357,7 +357,7 @@ static int write_pages(struct blkmtd_dev *dev, const u_char *buf, loff_t to, BUG(); } memcpy(page_address(page), buf, end_len); - set_page_dirty(page); + SetPageDirty(page); SetPageUptodate(page); DEBUG(3, "blkmtd: write: writing out partial end\n"); thislen += end_len; diff --git a/trunk/drivers/mtd/devices/block2mtd.c b/trunk/drivers/mtd/devices/block2mtd.c index 7ff403b2a0a0..0aaa0ced9aba 100644 --- a/trunk/drivers/mtd/devices/block2mtd.c +++ b/trunk/drivers/mtd/devices/block2mtd.c @@ -1,5 +1,5 @@ /* - * $Id: block2mtd.c,v 1.30 2005/11/29 14:48:32 gleixner Exp $ + * $Id: block2mtd.c,v 1.29 2005/11/07 11:14:24 gleixner Exp $ * * block2mtd.c - create an mtd from a block device * @@ -19,7 +19,7 @@ #include #include -#define VERSION "$Revision: 1.30 $" +#define VERSION "$Revision: 1.29 $" #define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args) @@ -40,7 +40,7 @@ static LIST_HEAD(blkmtd_device_list); #define PAGE_READAHEAD 64 -static void cache_readahead(struct address_space *mapping, int index) +void cache_readahead(struct address_space *mapping, int index) { filler_t *filler = (filler_t*)mapping->a_ops->readpage; int i, pagei; diff --git a/trunk/drivers/mtd/devices/ms02-nv.c b/trunk/drivers/mtd/devices/ms02-nv.c index 0ff2e4378244..f5026cee087f 100644 --- a/trunk/drivers/mtd/devices/ms02-nv.c +++ b/trunk/drivers/mtd/devices/ms02-nv.c @@ -6,7 +6,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * $Id: ms02-nv.c,v 1.11 2005/11/14 13:41:47 macro Exp $ + * $Id: ms02-nv.c,v 1.10 2005/06/20 12:24:41 macro Exp $ */ #include @@ -293,13 +293,13 @@ static int __init ms02nv_init(void) switch (mips_machtype) { case MACH_DS5000_200: - csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR); + csr = (volatile u32 *)KN02_CSR_BASE; if (*csr & KN02_CSR_BNK32M) stride = 2; break; case MACH_DS5000_2X0: case MACH_DS5900: - csr = (volatile u32 *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_MCR); + csr = (volatile u32 *)KN03_MCR_BASE; if (*csr & KN03_MCR_BNK32M) stride = 2; break; diff --git a/trunk/drivers/mtd/ftl.c b/trunk/drivers/mtd/ftl.c index 8a878b34eca0..de7e231d6d18 100644 --- a/trunk/drivers/mtd/ftl.c +++ b/trunk/drivers/mtd/ftl.c @@ -1,5 +1,5 @@ /* This version ported to the Linux-MTD system by dwmw2@infradead.org - * $Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $ + * $Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $ * * Fixes: Arnaldo Carvalho de Melo * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups @@ -1084,9 +1084,9 @@ struct mtd_blktrans_ops ftl_tr = { .owner = THIS_MODULE, }; -static int init_ftl(void) +int init_ftl(void) { - DEBUG(0, "$Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $\n"); + DEBUG(0, "$Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $\n"); return register_mtd_blktrans(&ftl_tr); } diff --git a/trunk/drivers/mtd/maps/Kconfig b/trunk/drivers/mtd/maps/Kconfig index b9b77cf39a18..846a533323a8 100644 --- a/trunk/drivers/mtd/maps/Kconfig +++ b/trunk/drivers/mtd/maps/Kconfig @@ -62,7 +62,7 @@ config MTD_PHYSMAP_BANKWIDTH config MTD_SUN_UFLASH tristate "Sun Microsystems userflash support" - depends on SPARC && MTD_CFI + depends on (SPARC32 || SPARC64) && MTD_CFI help This provides a 'mapping' driver which supports the way in which user-programmable flash chips are connected on various @@ -538,6 +538,12 @@ config MTD_MPC1211 This enables access to the flash chips on the Interface MPC-1211(CTP/PCI/MPC-SH02). If you have such a board, say 'Y'. +config MTD_PQ2FADS + tristate "JEDEC flash SIMM mapped on PQ2FADS and 8272ADS boards" + depends on (ADS8272 || PQ2FADS) && MTD_PARTITIONS && MTD_JEDECPROBE && MTD_PHYSMAP && MTD_CFI_GEOMETRY && MTD_CFI_INTELEXT + help + This enables access to flash SIMM on PQ2FADS-like boards + config MTD_OMAP_NOR tristate "TI OMAP board mappings" depends on MTD_CFI && ARCH_OMAP diff --git a/trunk/drivers/mtd/maps/Makefile b/trunk/drivers/mtd/maps/Makefile index 2f7e254912f0..7d9e940a1dcd 100644 --- a/trunk/drivers/mtd/maps/Makefile +++ b/trunk/drivers/mtd/maps/Makefile @@ -70,5 +70,6 @@ obj-$(CONFIG_MTD_DMV182) += dmv182.o obj-$(CONFIG_MTD_SHARP_SL) += sharpsl-flash.o obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o +obj-$(CONFIG_MTD_PQ2FADS) += pq2fads.o obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o obj-$(CONFIG_MTD_TQM834x) += tqm834x.o diff --git a/trunk/drivers/mtd/maps/ipaq-flash.c b/trunk/drivers/mtd/maps/ipaq-flash.c index b8ccb0a95789..35097c9bbf50 100644 --- a/trunk/drivers/mtd/maps/ipaq-flash.c +++ b/trunk/drivers/mtd/maps/ipaq-flash.c @@ -246,7 +246,7 @@ int __init ipaq_mtd_init(void) ipaq_map[i].size = h3xxx_max_flash_size; ipaq_map[i].set_vpp = h3xxx_set_vpp; ipaq_map[i].phys = cs_phys[i]; - ipaq_map[i].virt = ioremap(cs_phys[i], 0x04000000); + ipaq_map[i].virt = __ioremap(cs_phys[i], 0x04000000, 0, 1); if (machine_is_h3100 () || machine_is_h1900()) ipaq_map[i].bankwidth = 2; } @@ -280,7 +280,7 @@ int __init ipaq_mtd_init(void) nb_parts = ARRAY_SIZE(jornada_partitions); ipaq_map[0].size = jornada_max_flash_size; ipaq_map[0].set_vpp = jornada56x_set_vpp; - ipaq_map[0].virt = (__u32)ioremap(0x0, 0x04000000); + ipaq_map[0].virt = (__u32)__ioremap(0x0, 0x04000000, 0, 1); } #endif #ifdef CONFIG_SA1100_JORNADA720 @@ -442,7 +442,7 @@ static int __init h1900_special_case(void) ipaq_map[0].size = 0x80000; ipaq_map[0].set_vpp = h3xxx_set_vpp; ipaq_map[0].phys = 0x0; - ipaq_map[0].virt = ioremap(0x0, 0x04000000); + ipaq_map[0].virt = __ioremap(0x0, 0x04000000, 0, 1); ipaq_map[0].bankwidth = 2; printk(KERN_NOTICE "iPAQ flash: probing %d-bit flash bus, window=%lx with JEDEC.\n", ipaq_map[0].bankwidth*8, ipaq_map[0].virt); diff --git a/trunk/drivers/mtd/maps/ixp2000.c b/trunk/drivers/mtd/maps/ixp2000.c index 2c9cc7f37e92..fc7a78e31735 100644 --- a/trunk/drivers/mtd/maps/ixp2000.c +++ b/trunk/drivers/mtd/maps/ixp2000.c @@ -159,12 +159,12 @@ static int ixp2000_flash_probe(struct platform_device *dev) return -ENODEV; window_size = dev->resource->end - dev->resource->start + 1; - dev_info(&dev->dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n", - ixp_data->nr_banks, ((u32)window_size >> 20)); + dev_info(_dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n", + ixp_data->nr_banks, ((u32)window_size >> 20)); if (plat->width != 1) { - dev_err(&dev->dev, "IXP2000 MTD map only supports 8-bit mode, asking for %d\n", - plat->width * 8); + dev_err(_dev, "IXP2000 MTD map only supports 8-bit mode, asking for %d\n", + plat->width * 8); return -EIO; } @@ -202,7 +202,7 @@ static int ixp2000_flash_probe(struct platform_device *dev) dev->resource->end - dev->resource->start + 1, dev->dev.bus_id); if (!info->res) { - dev_err(&dev->dev, "Could not reserve memory region\n"); + dev_err(_dev, "Could not reserve memory region\n"); err = -ENOMEM; goto Error; } @@ -210,7 +210,7 @@ static int ixp2000_flash_probe(struct platform_device *dev) info->map.map_priv_1 = (unsigned long) ioremap(dev->resource->start, dev->resource->end - dev->resource->start + 1); if (!info->map.map_priv_1) { - dev_err(&dev->dev, "Failed to ioremap flash region\n"); + dev_err(_dev, "Failed to ioremap flash region\n"); err = -EIO; goto Error; } @@ -221,13 +221,13 @@ static int ixp2000_flash_probe(struct platform_device *dev) */ erratum44_workaround = ixp2000_has_broken_slowport(); - dev_info(&dev->dev, "Erratum 44 workaround %s\n", + dev_info(_dev, "Erratum 44 workaround %s\n", erratum44_workaround ? "enabled" : "disabled"); #endif info->mtd = do_map_probe(plat->map_name, &info->map); if (!info->mtd) { - dev_err(&dev->dev, "map_probe failed\n"); + dev_err(_dev, "map_probe failed\n"); err = -ENXIO; goto Error; } @@ -237,7 +237,7 @@ static int ixp2000_flash_probe(struct platform_device *dev) if (err > 0) { err = add_mtd_partitions(info->mtd, info->partitions, err); if(err) - dev_err(&dev->dev, "Could not parse partitions\n"); + dev_err(_dev, "Could not parse partitions\n"); } if (err) @@ -251,8 +251,8 @@ static int ixp2000_flash_probe(struct platform_device *dev) } static struct platform_driver ixp2000_flash_driver = { - .probe = ixp2000_flash_probe, - .remove = ixp2000_flash_remove, + .probe = &ixp2000_flash_probe, + .remove = &ixp2000_flash_remove .driver = { .name = "IXP2000-Flash", }, diff --git a/trunk/drivers/mtd/maps/ixp4xx.c b/trunk/drivers/mtd/maps/ixp4xx.c index 986c58628390..a59f8027903c 100644 --- a/trunk/drivers/mtd/maps/ixp4xx.c +++ b/trunk/drivers/mtd/maps/ixp4xx.c @@ -1,5 +1,5 @@ /* - * $Id: ixp4xx.c,v 1.13 2005/11/16 16:23:21 dvrabel Exp $ + * $Id: ixp4xx.c,v 1.12 2005/11/07 11:14:27 gleixner Exp $ * * drivers/mtd/maps/ixp4xx.c * @@ -34,55 +34,10 @@ #include -/* - * Read/write a 16 bit word from flash address 'addr'. - * - * When the cpu is in little-endian mode it swizzles the address lines - * ('address coherency') so we need to undo the swizzling to ensure commands - * and the like end up on the correct flash address. - * - * To further complicate matters, due to the way the expansion bus controller - * handles 32 bit reads, the byte stream ABCD is stored on the flash as: - * D15 D0 - * +---+---+ - * | A | B | 0 - * +---+---+ - * | C | D | 2 - * +---+---+ - * This means that on LE systems each 16 bit word must be swapped. Note that - * this requires CONFIG_MTD_CFI_BE_BYTE_SWAP to be enabled to 'unswap' the CFI - * data and other flash commands which are always in D7-D0. - */ #ifndef __ARMEB__ -#ifndef CONFIG_MTD_CFI_BE_BYTE_SWAP -# error CONFIG_MTD_CFI_BE_BYTE_SWAP required -#endif - -static inline u16 flash_read16(void __iomem *addr) -{ - return be16_to_cpu(__raw_readw((void __iomem *)((unsigned long)addr ^ 0x2))); -} - -static inline void flash_write16(u16 d, void __iomem *addr) -{ - __raw_writew(cpu_to_be16(d), (void __iomem *)((unsigned long)addr ^ 0x2)); -} - #define BYTE0(h) ((h) & 0xFF) #define BYTE1(h) (((h) >> 8) & 0xFF) - #else - -static inline u16 flash_read16(const void __iomem *addr) -{ - return __raw_readw(addr); -} - -static inline void flash_write16(u16 d, void __iomem *addr) -{ - __raw_writew(d, addr); -} - #define BYTE0(h) (((h) >> 8) & 0xFF) #define BYTE1(h) ((h) & 0xFF) #endif @@ -90,7 +45,7 @@ static inline void flash_write16(u16 d, void __iomem *addr) static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs) { map_word val; - val.x[0] = flash_read16(map->virt + ofs); + val.x[0] = le16_to_cpu(readw(map->virt + ofs)); return val; } @@ -102,28 +57,19 @@ static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs) static void ixp4xx_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len) { + int i; u8 *dest = (u8 *) to; void __iomem *src = map->virt + from; + u16 data; - if (len <= 0) - return; - - if (from & 1) { - *dest++ = BYTE1(flash_read16(src)); - src++; - --len; + for (i = 0; i < (len / 2); i++) { + data = le16_to_cpu(readw(src + 2*i)); + dest[i * 2] = BYTE0(data); + dest[i * 2 + 1] = BYTE1(data); } - while (len >= 2) { - u16 data = flash_read16(src); - *dest++ = BYTE0(data); - *dest++ = BYTE1(data); - src += 2; - len -= 2; - } - - if (len > 0) - *dest++ = BYTE0(flash_read16(src)); + if (len & 1) + dest[len - 1] = BYTE0(le16_to_cpu(readw(src + 2*i))); } /* @@ -133,7 +79,7 @@ static void ixp4xx_copy_from(struct map_info *map, void *to, static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr) { if (!(adr & 1)) - flash_write16(d.x[0], map->virt + adr); + writew(cpu_to_le16(d.x[0]), map->virt + adr); } /* @@ -141,7 +87,7 @@ static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long */ static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr) { - flash_write16(d.x[0], map->virt + adr); + writew(cpu_to_le16(d.x[0]), map->virt + adr); } struct ixp4xx_flash_info { diff --git a/trunk/drivers/mtd/maps/nettel.c b/trunk/drivers/mtd/maps/nettel.c index 632eb2aa968f..f00ee7e54dba 100644 --- a/trunk/drivers/mtd/maps/nettel.c +++ b/trunk/drivers/mtd/maps/nettel.c @@ -6,7 +6,7 @@ * (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com) * (C) Copyright 2001-2002, SnapGear (www.snapgear.com) * - * $Id: nettel.c,v 1.12 2005/11/29 14:30:00 gleixner Exp $ + * $Id: nettel.c,v 1.11 2005/11/07 11:14:27 gleixner Exp $ */ /****************************************************************************/ @@ -479,7 +479,7 @@ void __exit nettel_cleanup(void) } if (nettel_intel_map.virt) { iounmap(nettel_intel_map.virt); - nettel_intel_map.virt = NULL; + nettel_intel_map.virt = 0; } #endif } diff --git a/trunk/drivers/mtd/maps/pci.c b/trunk/drivers/mtd/maps/pci.c index 21822c2edbe4..8b3570b09095 100644 --- a/trunk/drivers/mtd/maps/pci.c +++ b/trunk/drivers/mtd/maps/pci.c @@ -7,7 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * $Id: pci.c,v 1.14 2005/11/17 08:20:27 dwmw2 Exp $ + * $Id: pci.c,v 1.13 2005/11/07 11:14:27 gleixner Exp $ * * Generic PCI memory map driver. We support the following boards: * - Intel IQ80310 ATU. @@ -102,7 +102,7 @@ static void mtd_pci_copyto(struct map_info *_map, unsigned long to, const void * memcpy_toio(map->base + map->translate(map, to), from, len); } -static const struct map_info mtd_pci_map = { +static struct map_info mtd_pci_map = { .phys = NO_XIP, .copy_from = mtd_pci_copyfrom, .copy_to = mtd_pci_copyto, diff --git a/trunk/drivers/mtd/maps/physmap.c b/trunk/drivers/mtd/maps/physmap.c index f49ebc3c4606..9ee760f97bc6 100644 --- a/trunk/drivers/mtd/maps/physmap.c +++ b/trunk/drivers/mtd/maps/physmap.c @@ -1,5 +1,5 @@ /* - * $Id: physmap.c,v 1.39 2005/11/29 14:49:36 gleixner Exp $ + * $Id: physmap.c,v 1.38 2005/11/07 11:14:28 gleixner Exp $ * * Normal mappings of chips in physical memory * @@ -19,7 +19,6 @@ #include #include #include -#include static struct mtd_info *mymtd; diff --git a/trunk/drivers/mtd/maps/sc520cdp.c b/trunk/drivers/mtd/maps/sc520cdp.c index ed92afadd8a9..6fb9f3c57aab 100644 --- a/trunk/drivers/mtd/maps/sc520cdp.c +++ b/trunk/drivers/mtd/maps/sc520cdp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: sc520cdp.c,v 1.23 2005/11/17 08:20:27 dwmw2 Exp $ + * $Id: sc520cdp.c,v 1.22 2005/11/07 11:14:28 gleixner Exp $ * * * The SC520CDP is an evaluation board for the Elan SC520 processor available @@ -164,7 +164,7 @@ struct sc520_par_table unsigned long default_address; }; -static const struct sc520_par_table par_table[NUM_FLASH_BANKS] = +static struct sc520_par_table par_table[NUM_FLASH_BANKS] = { { /* Flash Bank #0: selected by ROMCS0 */ SC520_PAR_ROMCS0, diff --git a/trunk/drivers/mtd/nand/h1910.c b/trunk/drivers/mtd/nand/h1910.c index f68f7a99a630..041e4b3358fb 100644 --- a/trunk/drivers/mtd/nand/h1910.c +++ b/trunk/drivers/mtd/nand/h1910.c @@ -112,7 +112,7 @@ static int __init h1910_init (void) if (!machine_is_h1900()) return -ENODEV; - nandaddr = ioremap(0x08000000, 0x1000); + nandaddr = __ioremap(0x08000000, 0x1000, 0, 1); if (!nandaddr) { printk("Failed to ioremap nand flash.\n"); return -ENOMEM; diff --git a/trunk/drivers/mtd/nand/nandsim.c b/trunk/drivers/mtd/nand/nandsim.c index a0af92cc7efd..de4500395300 100644 --- a/trunk/drivers/mtd/nand/nandsim.c +++ b/trunk/drivers/mtd/nand/nandsim.c @@ -1486,7 +1486,7 @@ ns_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len) /* * Module initialization function */ -static int __init ns_init_module(void) +int __init ns_init_module(void) { struct nand_chip *chip; struct nandsim *nand; diff --git a/trunk/drivers/mtd/onenand/generic.c b/trunk/drivers/mtd/onenand/generic.c index 45c077d0f063..48cce431f89f 100644 --- a/trunk/drivers/mtd/onenand/generic.c +++ b/trunk/drivers/mtd/onenand/generic.c @@ -12,9 +12,9 @@ * This is a device driver for the OneNAND flash for generic boards. */ +#include #include #include -#include #include #include #include @@ -39,7 +39,7 @@ static int __devinit generic_onenand_probe(struct device *dev) { struct onenand_info *info; struct platform_device *pdev = to_platform_device(dev); - struct flash_platform_data *pdata = pdev->dev.platform_data; + struct onenand_platform_data *pdata = pdev->dev.platform_data; struct resource *res = pdev->resource; unsigned long size = res->end - res->start + 1; int err; diff --git a/trunk/drivers/mtd/onenand/onenand_base.c b/trunk/drivers/mtd/onenand/onenand_base.c index a53a73fc2a5a..f67d5d6eb9a6 100644 --- a/trunk/drivers/mtd/onenand/onenand_base.c +++ b/trunk/drivers/mtd/onenand/onenand_base.c @@ -940,7 +940,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, u_char *eccbuf, struct nand_oobinfo *oobsel) { struct onenand_chip *this = mtd->priv; - unsigned char *pbuf; + unsigned char buffer[MAX_ONENAND_PAGESIZE], *pbuf; size_t total_len, len; int i, written = 0; int ret = 0; @@ -975,7 +975,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, /* Loop until all keve's data has been written */ len = 0; while (count) { - pbuf = this->page_buf; + pbuf = buffer; /* * If the given tuple is >= pagesize then * write it out from the iov @@ -995,7 +995,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, int cnt = 0, thislen; while (cnt < mtd->oobblock) { thislen = min_t(int, mtd->oobblock - cnt, vecs->iov_len - len); - memcpy(this->page_buf + cnt, vecs->iov_base + len, thislen); + memcpy(buffer + cnt, vecs->iov_base + len, thislen); cnt += thislen; len += thislen; @@ -1296,12 +1296,6 @@ static int onenand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len) /* Block lock scheme */ for (block = start; block < end; block++) { - /* Set block address */ - value = onenand_block_address(this, block); - this->write_word(value, this->base + ONENAND_REG_START_ADDRESS1); - /* Select DataRAM for DDP */ - value = onenand_bufferram_address(this, block); - this->write_word(value, this->base + ONENAND_REG_START_ADDRESS2); /* Set start block address */ this->write_word(block, this->base + ONENAND_REG_START_BLOCK_ADDRESS); /* Write unlock command */ @@ -1315,6 +1309,10 @@ static int onenand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len) & ONENAND_CTRL_ONGO) continue; + /* Set block address for read block status */ + value = onenand_block_address(this, block); + this->write_word(value, this->base + ONENAND_REG_START_ADDRESS1); + /* Check lock status */ status = this->read_word(this->base + ONENAND_REG_WP_STATUS); if (!(status & ONENAND_WP_US)) @@ -1348,6 +1346,7 @@ static void onenand_print_device_info(int device) static const struct onenand_manufacturers onenand_manuf_ids[] = { {ONENAND_MFR_SAMSUNG, "Samsung"}, + {ONENAND_MFR_UNKNOWN, "Unknown"} }; /** @@ -1358,22 +1357,17 @@ static const struct onenand_manufacturers onenand_manuf_ids[] = { */ static int onenand_check_maf(int manuf) { - int size = ARRAY_SIZE(onenand_manuf_ids); - char *name; int i; - for (i = 0; i < size; i++) + for (i = 0; onenand_manuf_ids[i].id; i++) { if (manuf == onenand_manuf_ids[i].id) break; + } - if (i < size) - name = onenand_manuf_ids[i].name; - else - name = "Unknown"; - - printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", name, manuf); + printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", + onenand_manuf_ids[i].name, manuf); - return (i == size); + return (i != ONENAND_MFR_UNKNOWN); } /** @@ -1519,18 +1513,6 @@ int onenand_scan(struct mtd_info *mtd, int maxchips) this->read_bufferram = onenand_sync_read_bufferram; } - /* Allocate buffers, if necessary */ - if (!this->page_buf) { - size_t len; - len = mtd->oobblock + mtd->oobsize; - this->page_buf = kmalloc(len, GFP_KERNEL); - if (!this->page_buf) { - printk(KERN_ERR "onenand_scan(): Can't allocate page_buf\n"); - return -ENOMEM; - } - this->options |= ONENAND_PAGEBUF_ALLOC; - } - this->state = FL_READY; init_waitqueue_head(&this->wq); spin_lock_init(&this->chip_lock); @@ -1592,21 +1574,12 @@ int onenand_scan(struct mtd_info *mtd, int maxchips) */ void onenand_release(struct mtd_info *mtd) { - struct onenand_chip *this = mtd->priv; - #ifdef CONFIG_MTD_PARTITIONS /* Deregister partitions */ del_mtd_partitions (mtd); #endif /* Deregister the device */ del_mtd_device (mtd); - - /* Free bad block table memory, if allocated */ - if (this->bbm) - kfree(this->bbm); - /* Buffer allocated by onenand_scan */ - if (this->options & ONENAND_PAGEBUF_ALLOC) - kfree(this->page_buf); } EXPORT_SYMBOL_GPL(onenand_scan); diff --git a/trunk/drivers/mtd/onenand/onenand_bbt.c b/trunk/drivers/mtd/onenand/onenand_bbt.c index 4510d3361eaa..f40190f499e1 100644 --- a/trunk/drivers/mtd/onenand/onenand_bbt.c +++ b/trunk/drivers/mtd/onenand/onenand_bbt.c @@ -118,10 +118,10 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr */ static inline int onenand_memory_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd) { - struct onenand_chip *this = mtd->priv; + unsigned char data_buf[MAX_ONENAND_PAGESIZE]; bd->options &= ~NAND_BBT_SCANEMPTY; - return create_bbt(mtd, this->page_buf, bd, -1); + return create_bbt(mtd, data_buf, bd, -1); } /** diff --git a/trunk/drivers/mtd/rfd_ftl.c b/trunk/drivers/mtd/rfd_ftl.c index 20ce212638fc..0ab8d29caeea 100644 --- a/trunk/drivers/mtd/rfd_ftl.c +++ b/trunk/drivers/mtd/rfd_ftl.c @@ -30,9 +30,11 @@ MODULE_PARM_DESC(block_size, "Block size to use by RFD, defaults to erase unit s #define PREFIX "rfd_ftl: " -/* This major has been assigned by device@lanana.org */ +/* Major device # for FTL device */ + +/* A request for this major has been sent to device@lanana.org */ #ifndef RFD_FTL_MAJOR -#define RFD_FTL_MAJOR 256 +#define RFD_FTL_MAJOR 95 #endif /* Maximum number of partitions in an FTL region */ diff --git a/trunk/drivers/net/3c509.c b/trunk/drivers/net/3c509.c index 824e430486c2..977935a3d898 100644 --- a/trunk/drivers/net/3c509.c +++ b/trunk/drivers/net/3c509.c @@ -84,7 +84,6 @@ static int max_interrupt_work = 10; #include #include #include -#include #include #include /* for udelay() */ #include @@ -174,7 +173,7 @@ struct el3_private { /* skb send-queue */ int head, size; struct sk_buff *queue[SKB_QUEUE_SIZE]; -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM struct pm_dev *pmdev; #endif enum { @@ -201,7 +200,7 @@ static void el3_tx_timeout (struct net_device *dev); static void el3_down(struct net_device *dev); static void el3_up(struct net_device *dev); static struct ethtool_ops ethtool_ops; -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM static int el3_suspend(struct pm_dev *pdev); static int el3_resume(struct pm_dev *pdev); static int el3_pm_callback(struct pm_dev *pdev, pm_request_t rqst, void *data); @@ -362,7 +361,7 @@ static void el3_common_remove (struct net_device *dev) struct el3_private *lp = netdev_priv(dev); (void) lp; /* Keep gcc quiet... */ -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM if (lp->pmdev) pm_unregister(lp->pmdev); #endif @@ -572,7 +571,7 @@ static int __init el3_probe(int card_idx) if (err) goto out1; -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM /* register power management */ lp->pmdev = pm_register(PM_ISA_DEV, card_idx, el3_pm_callback); if (lp->pmdev) { @@ -1480,7 +1479,7 @@ el3_up(struct net_device *dev) } /* Power Management support functions */ -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM static int el3_suspend(struct pm_dev *pdev) @@ -1549,7 +1548,7 @@ el3_pm_callback(struct pm_dev *pdev, pm_request_t rqst, void *data) return 0; } -#endif /* CONFIG_PM_LEGACY */ +#endif /* CONFIG_PM */ /* Parameters that may be passed into the module. */ static int debug = -1; diff --git a/trunk/drivers/net/8139too.c b/trunk/drivers/net/8139too.c index d2102a27d307..30bee11c48bd 100644 --- a/trunk/drivers/net/8139too.c +++ b/trunk/drivers/net/8139too.c @@ -586,16 +586,16 @@ struct rtl8139_private { dma_addr_t tx_bufs_dma; signed char phys[4]; /* MII device addresses. */ char twistie, twist_row, twist_col; /* Twister tune state. */ - unsigned int default_port : 4; /* Last dev->if_port value. */ - unsigned int have_thread : 1; + unsigned int default_port:4; /* Last dev->if_port value. */ spinlock_t lock; spinlock_t rx_lock; chip_t chipset; + pid_t thr_pid; + wait_queue_head_t thr_wait; + struct completion thr_exited; u32 rx_config; struct rtl_extra_stats xstats; - - struct work_struct thread; - + int time_to_die; struct mii_if_info mii; unsigned int regs_len; unsigned long fifo_copy_timeout; @@ -620,7 +620,7 @@ static int rtl8139_open (struct net_device *dev); static int mdio_read (struct net_device *dev, int phy_id, int location); static void mdio_write (struct net_device *dev, int phy_id, int location, int val); -static void rtl8139_start_thread(struct rtl8139_private *tp); +static void rtl8139_start_thread(struct net_device *dev); static void rtl8139_tx_timeout (struct net_device *dev); static void rtl8139_init_ring (struct net_device *dev); static int rtl8139_start_xmit (struct sk_buff *skb, @@ -637,7 +637,6 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev); static void rtl8139_set_rx_mode (struct net_device *dev); static void __set_rx_mode (struct net_device *dev); static void rtl8139_hw_start (struct net_device *dev); -static void rtl8139_thread (void *_data); static struct ethtool_ops rtl8139_ethtool_ops; /* write MMIO register, with flush */ @@ -1008,7 +1007,8 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, (debug < 0 ? RTL8139_DEF_MSG_ENABLE : ((1 << debug) - 1)); spin_lock_init (&tp->lock); spin_lock_init (&tp->rx_lock); - INIT_WORK(&tp->thread, rtl8139_thread, dev); + init_waitqueue_head (&tp->thr_wait); + init_completion (&tp->thr_exited); tp->mii.dev = dev; tp->mii.mdio_read = mdio_read; tp->mii.mdio_write = mdio_write; @@ -1345,7 +1345,7 @@ static int rtl8139_open (struct net_device *dev) dev->irq, RTL_R8 (MediaStatus), tp->mii.full_duplex ? "full" : "half"); - rtl8139_start_thread(tp); + rtl8139_start_thread(dev); return 0; } @@ -1594,43 +1594,55 @@ static inline void rtl8139_thread_iter (struct net_device *dev, RTL_R8 (Config1)); } -static void rtl8139_thread (void *_data) +static int rtl8139_thread (void *data) { - struct net_device *dev = _data; + struct net_device *dev = data; struct rtl8139_private *tp = netdev_priv(dev); - unsigned long thr_delay; + unsigned long timeout; + + daemonize("%s", dev->name); + allow_signal(SIGTERM); + + while (1) { + timeout = next_tick; + do { + timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout); + /* make swsusp happy with our thread */ + try_to_freeze(); + } while (!signal_pending (current) && (timeout > 0)); + + if (signal_pending (current)) { + flush_signals(current); + } - if (rtnl_shlock_nowait() == 0) { + if (tp->time_to_die) + break; + + if (rtnl_lock_interruptible ()) + break; rtl8139_thread_iter (dev, tp, tp->mmio_addr); rtnl_unlock (); - - thr_delay = next_tick; - } else { - /* unlikely race. mitigate with fast poll. */ - thr_delay = HZ / 2; } - schedule_delayed_work(&tp->thread, thr_delay); + complete_and_exit (&tp->thr_exited, 0); } -static void rtl8139_start_thread(struct rtl8139_private *tp) +static void rtl8139_start_thread(struct net_device *dev) { + struct rtl8139_private *tp = netdev_priv(dev); + + tp->thr_pid = -1; tp->twistie = 0; + tp->time_to_die = 0; if (tp->chipset == CH_8139_K) tp->twistie = 1; else if (tp->drv_flags & HAS_LNK_CHNG) return; - tp->have_thread = 1; - - schedule_delayed_work(&tp->thread, next_tick); -} - -static void rtl8139_stop_thread(struct rtl8139_private *tp) -{ - if (tp->have_thread) { - cancel_rearming_delayed_work(&tp->thread); - tp->have_thread = 0; + tp->thr_pid = kernel_thread(rtl8139_thread, dev, CLONE_FS|CLONE_FILES); + if (tp->thr_pid < 0) { + printk (KERN_WARNING "%s: unable to start kernel thread\n", + dev->name); } } @@ -2212,12 +2224,22 @@ static int rtl8139_close (struct net_device *dev) { struct rtl8139_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->mmio_addr; + int ret = 0; unsigned long flags; netif_stop_queue (dev); - rtl8139_stop_thread(tp); - + if (tp->thr_pid >= 0) { + tp->time_to_die = 1; + wmb(); + ret = kill_proc (tp->thr_pid, SIGTERM, 1); + if (ret) { + printk (KERN_ERR "%s: unable to signal thread\n", dev->name); + return ret; + } + wait_for_completion (&tp->thr_exited); + } + if (netif_msg_ifdown(tp)) printk(KERN_DEBUG "%s: Shutting down ethercard, status was 0x%4.4x.\n", dev->name, RTL_R16 (IntrStatus)); diff --git a/trunk/drivers/net/Kconfig b/trunk/drivers/net/Kconfig index e2fa29b612cd..ebd7313d7fc1 100644 --- a/trunk/drivers/net/Kconfig +++ b/trunk/drivers/net/Kconfig @@ -1901,8 +1901,6 @@ config E1000_NAPI If in doubt, say N. -source "drivers/net/ixp2000/Kconfig" - config MYRI_SBUS tristate "MyriCOM Gigabit Ethernet support" depends on SBUS @@ -2010,18 +2008,7 @@ config SKGE It does not support the link failover and network management features that "portable" vendor supplied sk98lin driver does. - - -config SKY2 - tristate "SysKonnect Yukon2 support (EXPERIMENTAL)" - depends on PCI && EXPERIMENTAL - select CRC32 - ---help--- - This driver support the Marvell Yukon 2 Gigabit Ethernet adapter. - - To compile this driver as a module, choose M here: the module - will be called sky2. This is recommended. - + config SK98LIN tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support" depends on PCI @@ -2133,7 +2120,7 @@ config BNX2 config SPIDER_NET tristate "Spider Gigabit Ethernet driver" - depends on PCI && PPC_CELL + depends on PCI && PPC_BPA help This driver supports the Gigabit Ethernet chips present on the Cell Processor-Based Blades from IBM. diff --git a/trunk/drivers/net/Makefile b/trunk/drivers/net/Makefile index b74a7cb5bae6..4cffd34442aa 100644 --- a/trunk/drivers/net/Makefile +++ b/trunk/drivers/net/Makefile @@ -13,10 +13,7 @@ obj-$(CONFIG_CHELSIO_T1) += chelsio/ obj-$(CONFIG_BONDING) += bonding/ obj-$(CONFIG_GIANFAR) += gianfar_driver.o -gianfar_driver-objs := gianfar.o \ - gianfar_ethtool.o \ - gianfar_mii.o \ - gianfar_sysfs.o +gianfar_driver-objs := gianfar.o gianfar_ethtool.o gianfar_mii.o # # link order important here @@ -62,7 +59,6 @@ spidernet-y += spider_net.o spider_net_ethtool.o sungem_phy.o obj-$(CONFIG_SPIDER_NET) += spidernet.o obj-$(CONFIG_TC35815) += tc35815.o obj-$(CONFIG_SKGE) += skge.o -obj-$(CONFIG_SKY2) += sky2.o obj-$(CONFIG_SK98LIN) += sk98lin/ obj-$(CONFIG_SKFP) += skfp/ obj-$(CONFIG_VIA_RHINE) += via-rhine.o @@ -206,7 +202,6 @@ obj-$(CONFIG_NET_TULIP) += tulip/ obj-$(CONFIG_HAMRADIO) += hamradio/ obj-$(CONFIG_IRDA) += irda/ obj-$(CONFIG_ETRAX_ETHERNET) += cris/ -obj-$(CONFIG_ENP2611_MSF_NET) += ixp2000/ obj-$(CONFIG_NETCONSOLE) += netconsole.o diff --git a/trunk/drivers/net/au1000_eth.c b/trunk/drivers/net/au1000_eth.c index cd0b1dccfb61..332e9953c55c 100644 --- a/trunk/drivers/net/au1000_eth.c +++ b/trunk/drivers/net/au1000_eth.c @@ -32,7 +32,6 @@ * */ -#include #include #include #include diff --git a/trunk/drivers/net/b44.c b/trunk/drivers/net/b44.c index 7aa49b974dc5..c53848f787eb 100644 --- a/trunk/drivers/net/b44.c +++ b/trunk/drivers/net/b44.c @@ -28,8 +28,8 @@ #define DRV_MODULE_NAME "b44" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "0.97" -#define DRV_MODULE_RELDATE "Nov 30, 2005" +#define DRV_MODULE_VERSION "0.96" +#define DRV_MODULE_RELDATE "Nov 8, 2005" #define B44_DEF_MSG_ENABLE \ (NETIF_MSG_DRV | \ @@ -1417,7 +1417,6 @@ static int b44_open(struct net_device *dev) add_timer(&bp->timer); b44_enable_ints(bp); - netif_start_queue(dev); out: return err; } @@ -1838,15 +1837,12 @@ static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { struct mii_ioctl_data *data = if_mii(ifr); struct b44 *bp = netdev_priv(dev); - int err = -EINVAL; - - if (!netif_running(dev)) - goto out; + int err; spin_lock_irq(&bp->lock); err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL); spin_unlock_irq(&bp->lock); -out: + return err; } @@ -2117,7 +2113,6 @@ static int b44_resume(struct pci_dev *pdev) add_timer(&bp->timer); b44_enable_ints(bp); - netif_wake_queue(dev); return 0; } diff --git a/trunk/drivers/net/bonding/Makefile b/trunk/drivers/net/bonding/Makefile index 5cdae2bc055a..cf50384b469e 100644 --- a/trunk/drivers/net/bonding/Makefile +++ b/trunk/drivers/net/bonding/Makefile @@ -4,5 +4,5 @@ obj-$(CONFIG_BONDING) += bonding.o -bonding-objs := bond_main.o bond_3ad.o bond_alb.o bond_sysfs.o +bonding-objs := bond_main.o bond_3ad.o bond_alb.o diff --git a/trunk/drivers/net/bonding/bond_3ad.c b/trunk/drivers/net/bonding/bond_3ad.c index f3f5825469d6..d2f34d5a8083 100644 --- a/trunk/drivers/net/bonding/bond_3ad.c +++ b/trunk/drivers/net/bonding/bond_3ad.c @@ -18,6 +18,38 @@ * The full GNU General Public License is included in this distribution in the * file called LICENSE. * + * + * Changes: + * + * 2003/05/01 - Tsippy Mendelson and + * Amir Noam + * - Added support for lacp_rate module param. + * + * 2003/05/01 - Shmulik Hen + * - Based on discussion on mailing list, changed locking scheme + * to use lock/unlock or lock_bh/unlock_bh appropriately instead + * of lock_irqsave/unlock_irqrestore. The new scheme helps exposing + * hidden bugs and solves system hangs that occurred due to the fact + * that holding lock_irqsave doesn't prevent softirqs from running. + * This also increases total throughput since interrupts are not + * blocked on each transmitted packets or monitor timeout. + * + * 2003/05/01 - Shmulik Hen + * - Renamed bond_3ad_link_status_changed() to + * bond_3ad_handle_link_change() for compatibility with TLB. + * + * 2003/05/20 - Amir Noam + * - Fix long fail over time when releasing last slave of an active + * aggregator - send LACPDU on unbind of slave to tell partner this + * port is no longer aggregatable. + * + * 2003/06/25 - Tsippy Mendelson + * - Send LACPDU as highest priority packet to further fix the above + * problem on very high Tx traffic load where packets may get dropped + * by the slave. + * + * 2003/12/01 - Shmulik Hen + * - Code cleanup and style changes */ //#define BONDING_DEBUG 1 @@ -1166,10 +1198,10 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) // detect loopback situation if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) { // INFO_RECEIVED_LOOPBACK_FRAMES - printk(KERN_ERR DRV_NAME ": %s: An illegal loopback occurred on " - "adapter (%s). Check the configuration to verify that all " - "Adapters are connected to 802.3ad compliant switch ports\n", - port->slave->dev->master->name, port->slave->dev->name); + printk(KERN_ERR DRV_NAME ": An illegal loopback occurred on adapter (%s)\n", + port->slave->dev->name); + printk(KERN_ERR "Check the configuration to verify that all Adapters " + "are connected to 802.3ad compliant switch ports\n"); __release_rx_machine_lock(port); return; } @@ -1346,9 +1378,8 @@ static void ad_port_selection_logic(struct port *port) } } if (!curr_port) { // meaning: the port was related to an aggregator but was not on the aggregator port list - printk(KERN_WARNING DRV_NAME ": %s: Warning: Port %d (on %s) was " + printk(KERN_WARNING DRV_NAME ": Warning: Port %d (on %s) was " "related to aggregator %d but was not on its port list\n", - port->slave->dev->master->name, port->actor_port_number, port->slave->dev->name, port->aggregator->aggregator_identifier); } @@ -1419,8 +1450,7 @@ static void ad_port_selection_logic(struct port *port) dprintk("Port %d joined LAG %d(new LAG)\n", port->actor_port_number, port->aggregator->aggregator_identifier); } else { - printk(KERN_ERR DRV_NAME ": %s: Port %d (on %s) did not find a suitable aggregator\n", - port->slave->dev->master->name, + printk(KERN_ERR DRV_NAME ": Port %d (on %s) did not find a suitable aggregator\n", port->actor_port_number, port->slave->dev->name); } } @@ -1552,9 +1582,8 @@ static void ad_agg_selection_logic(struct aggregator *aggregator) // check if any partner replys if (best_aggregator->is_individual) { - printk(KERN_WARNING DRV_NAME ": %s: Warning: No 802.3ad response from " - "the link partner for any adapters in the bond\n", - best_aggregator->slave->dev->master->name); + printk(KERN_WARNING DRV_NAME ": Warning: No 802.3ad response from the link partner " + "for any adapters in the bond\n"); } // check if there are more than one aggregator @@ -1886,8 +1915,7 @@ int bond_3ad_bind_slave(struct slave *slave) struct aggregator *aggregator; if (bond == NULL) { - printk(KERN_ERR DRV_NAME ": %s: The slave %s is not attached to its bond\n", - slave->dev->master->name, slave->dev->name); + printk(KERN_ERR "The slave %s is not attached to its bond\n", slave->dev->name); return -1; } @@ -1962,9 +1990,7 @@ void bond_3ad_unbind_slave(struct slave *slave) // if slave is null, the whole port is not initialized if (!port->slave) { - printk(KERN_WARNING DRV_NAME ": Warning: %s: Trying to " - "unbind an uninitialized port on %s\n", - slave->dev->master->name, slave->dev->name); + printk(KERN_WARNING DRV_NAME ": Trying to unbind an uninitialized port on %s\n", slave->dev->name); return; } @@ -1995,8 +2021,7 @@ void bond_3ad_unbind_slave(struct slave *slave) dprintk("Some port(s) related to LAG %d - replaceing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier); if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) { - printk(KERN_INFO DRV_NAME ": %s: Removing an active aggregator\n", - aggregator->slave->dev->master->name); + printk(KERN_INFO DRV_NAME ": Removing an active aggregator\n"); // select new active aggregator select_new_active_agg = 1; } @@ -2026,17 +2051,15 @@ void bond_3ad_unbind_slave(struct slave *slave) ad_agg_selection_logic(__get_first_agg(port)); } } else { - printk(KERN_WARNING DRV_NAME ": %s: Warning: unbinding aggregator, " - "and could not find a new aggregator for its ports\n", - slave->dev->master->name); + printk(KERN_WARNING DRV_NAME ": Warning: unbinding aggregator, " + "and could not find a new aggregator for its ports\n"); } } else { // in case that the only port related to this aggregator is the one we want to remove select_new_active_agg = aggregator->is_active; // clear the aggregator ad_clear_agg(aggregator); if (select_new_active_agg) { - printk(KERN_INFO DRV_NAME ": %s: Removing an active aggregator\n", - slave->dev->master->name); + printk(KERN_INFO "Removing an active aggregator\n"); // select new active aggregator ad_agg_selection_logic(__get_first_agg(port)); } @@ -2062,8 +2085,7 @@ void bond_3ad_unbind_slave(struct slave *slave) // clear the aggregator ad_clear_agg(temp_aggregator); if (select_new_active_agg) { - printk(KERN_INFO DRV_NAME ": %s: Removing an active aggregator\n", - slave->dev->master->name); + printk(KERN_INFO "Removing an active aggregator\n"); // select new active aggregator ad_agg_selection_logic(__get_first_agg(port)); } @@ -2109,8 +2131,7 @@ void bond_3ad_state_machine_handler(struct bonding *bond) // select the active aggregator for the bond if ((port = __get_first_port(bond))) { if (!port->slave) { - printk(KERN_WARNING DRV_NAME ": %s: Warning: bond's first port is " - "uninitialized\n", bond->dev->name); + printk(KERN_WARNING DRV_NAME ": Warning: bond's first port is uninitialized\n"); goto re_arm; } @@ -2122,8 +2143,7 @@ void bond_3ad_state_machine_handler(struct bonding *bond) // for each port run the state machines for (port = __get_first_port(bond); port; port = __get_next_port(port)) { if (!port->slave) { - printk(KERN_WARNING DRV_NAME ": %s: Warning: Found an uninitialized " - "port\n", bond->dev->name); + printk(KERN_WARNING DRV_NAME ": Warning: Found an uninitialized port\n"); goto re_arm; } @@ -2164,8 +2184,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u port = &(SLAVE_AD_INFO(slave).port); if (!port->slave) { - printk(KERN_WARNING DRV_NAME ": %s: Warning: port of slave %s is " - "uninitialized\n", slave->dev->name, slave->dev->master->name); + printk(KERN_WARNING DRV_NAME ": Warning: port of slave %s is uninitialized\n", slave->dev->name); return; } @@ -2211,9 +2230,8 @@ void bond_3ad_adapter_speed_changed(struct slave *slave) // if slave is null, the whole port is not initialized if (!port->slave) { - printk(KERN_WARNING DRV_NAME ": Warning: %s: speed " - "changed for uninitialized port on %s\n", - slave->dev->master->name, slave->dev->name); + printk(KERN_WARNING DRV_NAME ": Warning: speed changed for uninitialized port on %s\n", + slave->dev->name); return; } @@ -2239,9 +2257,8 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave) // if slave is null, the whole port is not initialized if (!port->slave) { - printk(KERN_WARNING DRV_NAME ": %s: Warning: duplex changed " - "for uninitialized port on %s\n", - slave->dev->master->name, slave->dev->name); + printk(KERN_WARNING DRV_NAME ": Warning: duplex changed for uninitialized port on %s\n", + slave->dev->name); return; } @@ -2268,9 +2285,8 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) // if slave is null, the whole port is not initialized if (!port->slave) { - printk(KERN_WARNING DRV_NAME ": Warning: %s: link status changed for " - "uninitialized port on %s\n", - slave->dev->master->name, slave->dev->name); + printk(KERN_WARNING DRV_NAME ": Warning: link status changed for uninitialized port on %s\n", + slave->dev->name); return; } @@ -2347,8 +2363,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) } if (bond_3ad_get_active_agg_info(bond, &ad_info)) { - printk(KERN_DEBUG DRV_NAME ": %s: Error: " - "bond_3ad_get_active_agg_info failed\n", dev->name); + printk(KERN_DEBUG "ERROR: bond_3ad_get_active_agg_info failed\n"); goto out; } @@ -2357,9 +2372,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) if (slaves_in_agg == 0) { /*the aggregator is empty*/ - printk(KERN_DEBUG DRV_NAME ": %s: Error: active " - "aggregator is empty\n", - dev->name); + printk(KERN_DEBUG "ERROR: active aggregator is empty\n"); goto out; } @@ -2377,8 +2390,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) } if (slave_agg_no >= 0) { - printk(KERN_ERR DRV_NAME ": %s: Error: Couldn't find a slave to tx on " - "for aggregator ID %d\n", dev->name, agg_id); + printk(KERN_ERR DRV_NAME ": Error: Couldn't find a slave to tx on for aggregator ID %d\n", agg_id); goto out; } diff --git a/trunk/drivers/net/bonding/bond_3ad.h b/trunk/drivers/net/bonding/bond_3ad.h index 5ee2cef5b037..673a30af5660 100644 --- a/trunk/drivers/net/bonding/bond_3ad.h +++ b/trunk/drivers/net/bonding/bond_3ad.h @@ -18,6 +18,19 @@ * The full GNU General Public License is included in this distribution in the * file called LICENSE. * + * + * Changes: + * + * 2003/05/01 - Tsippy Mendelson and + * Amir Noam + * - Added support for lacp_rate module param. + * + * 2003/05/01 - Shmulik Hen + * - Renamed bond_3ad_link_status_changed() to + * bond_3ad_handle_link_change() for compatibility with TLB. + * + * 2003/12/01 - Shmulik Hen + * - Code cleanup and style changes */ #ifndef __BOND_3AD_H__ diff --git a/trunk/drivers/net/bonding/bond_alb.c b/trunk/drivers/net/bonding/bond_alb.c index 854ddfb90da1..f8fce3961197 100644 --- a/trunk/drivers/net/bonding/bond_alb.c +++ b/trunk/drivers/net/bonding/bond_alb.c @@ -18,6 +18,25 @@ * The full GNU General Public License is included in this distribution in the * file called LICENSE. * + * + * Changes: + * + * 2003/06/25 - Shmulik Hen + * - Fixed signed/unsigned calculation errors that caused load sharing + * to collapse to one slave under very heavy UDP Tx stress. + * + * 2003/08/06 - Amir Noam + * - Add support for setting bond's MAC address with special + * handling required for ALB/TLB. + * + * 2003/12/01 - Shmulik Hen + * - Code cleanup and style changes + * + * 2003/12/30 - Amir Noam + * - Fixed: Cannot remove and re-enslave the original active slave. + * + * 2004/01/14 - Shmulik Hen + * - Add capability to tag self generated packets in ALB/TLB modes. */ //#define BONDING_DEBUG 1 @@ -179,21 +198,20 @@ static int tlb_initialize(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); int size = TLB_HASH_TABLE_SIZE * sizeof(struct tlb_client_info); - struct tlb_client_info *new_hashtbl; int i; spin_lock_init(&(bond_info->tx_hashtbl_lock)); - new_hashtbl = kmalloc(size, GFP_KERNEL); - if (!new_hashtbl) { + _lock_tx_hashtbl(bond); + + bond_info->tx_hashtbl = kmalloc(size, GFP_KERNEL); + if (!bond_info->tx_hashtbl) { printk(KERN_ERR DRV_NAME - ": %s: Error: Failed to allocate TLB hash table\n", + ": Error: %s: Failed to allocate TLB hash table\n", bond->dev->name); + _unlock_tx_hashtbl(bond); return -1; } - _lock_tx_hashtbl(bond); - - bond_info->tx_hashtbl = new_hashtbl; memset(bond_info->tx_hashtbl, 0, size); @@ -495,8 +513,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) client_info->mac_dst); if (!skb) { printk(KERN_ERR DRV_NAME - ": %s: Error: failed to create an ARP packet\n", - client_info->slave->dev->master->name); + ": Error: failed to create an ARP packet\n"); continue; } @@ -506,8 +523,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) skb = vlan_put_tag(skb, client_info->vlan_id); if (!skb) { printk(KERN_ERR DRV_NAME - ": %s: Error: failed to insert VLAN tag\n", - client_info->slave->dev->master->name); + ": Error: failed to insert VLAN tag\n"); continue; } } @@ -590,9 +606,8 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip) if (!client_info->slave) { printk(KERN_ERR DRV_NAME - ": %s: Error: found a client with no channel in " - "the client's hash table\n", - bond->dev->name); + ": Error: found a client with no channel in " + "the client's hash table\n"); continue; } /*update all clients using this src_ip, that are not assigned @@ -782,22 +797,21 @@ static int rlb_initialize(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct packet_type *pk_type = &(BOND_ALB_INFO(bond).rlb_pkt_type); - struct rlb_client_info *new_hashtbl; int size = RLB_HASH_TABLE_SIZE * sizeof(struct rlb_client_info); int i; spin_lock_init(&(bond_info->rx_hashtbl_lock)); - new_hashtbl = kmalloc(size, GFP_KERNEL); - if (!new_hashtbl) { + _lock_rx_hashtbl(bond); + + bond_info->rx_hashtbl = kmalloc(size, GFP_KERNEL); + if (!bond_info->rx_hashtbl) { printk(KERN_ERR DRV_NAME - ": %s: Error: Failed to allocate RLB hash table\n", + ": Error: %s: Failed to allocate RLB hash table\n", bond->dev->name); + _unlock_rx_hashtbl(bond); return -1; } - _lock_rx_hashtbl(bond); - - bond_info->rx_hashtbl = new_hashtbl; bond_info->rx_hashtbl_head = RLB_NULL_INDEX; @@ -913,8 +927,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) skb = vlan_put_tag(skb, vlan->vlan_id); if (!skb) { printk(KERN_ERR DRV_NAME - ": %s: Error: failed to insert VLAN tag\n", - bond->dev->name); + ": Error: failed to insert VLAN tag\n"); continue; } } @@ -943,11 +956,11 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) s_addr.sa_family = dev->type; if (dev_set_mac_address(dev, &s_addr)) { printk(KERN_ERR DRV_NAME - ": %s: Error: dev_set_mac_address of dev %s failed! ALB " + ": Error: dev_set_mac_address of dev %s failed! ALB " "mode requires that the base driver support setting " "the hw address also when the network device's " "interface is open\n", - dev->master->name, dev->name); + dev->name); return -EOPNOTSUPP; } return 0; @@ -1140,16 +1153,16 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav bond->alb_info.rlb_enabled); printk(KERN_WARNING DRV_NAME - ": %s: Warning: the hw address of slave %s is in use by " + ": Warning: the hw address of slave %s is in use by " "the bond; giving it the hw address of %s\n", - bond->dev->name, slave->dev->name, free_mac_slave->dev->name); + slave->dev->name, free_mac_slave->dev->name); } else if (has_bond_addr) { printk(KERN_ERR DRV_NAME - ": %s: Error: the hw address of slave %s is in use by the " + ": Error: the hw address of slave %s is in use by the " "bond; couldn't find a slave with a free hw address to " "give it (this should not have happened)\n", - bond->dev->name, slave->dev->name); + slave->dev->name); return -EFAULT; } @@ -1237,8 +1250,6 @@ int bond_alb_initialize(struct bonding *bond, int rlb_enabled) tlb_deinitialize(bond); return res; } - } else { - bond->alb_info.rlb_enabled = 0; } return 0; @@ -1398,7 +1409,7 @@ void bond_alb_monitor(struct bonding *bond) read_lock(&bond->curr_slave_lock); bond_for_each_slave(bond, slave, i) { - alb_send_learning_packets(slave, slave->dev->dev_addr); + alb_send_learning_packets(slave,slave->dev->dev_addr); } read_unlock(&bond->curr_slave_lock); diff --git a/trunk/drivers/net/bonding/bond_alb.h b/trunk/drivers/net/bonding/bond_alb.h index 28f2a2fd1b5a..e4091cd8d654 100644 --- a/trunk/drivers/net/bonding/bond_alb.h +++ b/trunk/drivers/net/bonding/bond_alb.h @@ -18,6 +18,15 @@ * The full GNU General Public License is included in this distribution in the * file called LICENSE. * + * + * Changes: + * + * 2003/08/06 - Amir Noam + * - Add support for setting bond's MAC address with special + * handling required for ALB/TLB. + * + * 2003/12/01 - Shmulik Hen + * - Code cleanup and style changes */ #ifndef __BOND_ALB_H__ diff --git a/trunk/drivers/net/bonding/bond_main.c b/trunk/drivers/net/bonding/bond_main.c index 2582d98ef5c3..94cec3cf2a13 100644 --- a/trunk/drivers/net/bonding/bond_main.c +++ b/trunk/drivers/net/bonding/bond_main.c @@ -29,6 +29,466 @@ * b: if a hw mac address already is there, eth0's hw mac address * will then be set from bond0. * + * v0.1 - first working version. + * v0.2 - changed stats to be calculated by summing slaves stats. + * + * Changes: + * Arnaldo Carvalho de Melo + * - fix leaks on failure at bond_init + * + * 2000/09/30 - Willy Tarreau + * - added trivial code to release a slave device. + * - fixed security bug (CAP_NET_ADMIN not checked) + * - implemented MII link monitoring to disable dead links : + * All MII capable slaves are checked every milliseconds + * (100 ms seems good). This value can be changed by passing it to + * insmod. A value of zero disables the monitoring (default). + * - fixed an infinite loop in bond_xmit_roundrobin() when there's no + * good slave. + * - made the code hopefully SMP safe + * + * 2000/10/03 - Willy Tarreau + * - optimized slave lists based on relevant suggestions from Thomas Davis + * - implemented active-backup method to obtain HA with two switches: + * stay as long as possible on the same active interface, while we + * also monitor the backup one (MII link status) because we want to know + * if we are able to switch at any time. ( pass "mode=1" to insmod ) + * - lots of stress testings because we need it to be more robust than the + * wires ! :-> + * + * 2000/10/09 - Willy Tarreau + * - added up and down delays after link state change. + * - optimized the slaves chaining so that when we run forward, we never + * repass through the bond itself, but we can find it by searching + * backwards. Renders the deletion more difficult, but accelerates the + * scan. + * - smarter enslaving and releasing. + * - finer and more robust SMP locking + * + * 2000/10/17 - Willy Tarreau + * - fixed two potential SMP race conditions + * + * 2000/10/18 - Willy Tarreau + * - small fixes to the monitoring FSM in case of zero delays + * 2000/11/01 - Willy Tarreau + * - fixed first slave not automatically used in trunk mode. + * 2000/11/10 : spelling of "EtherChannel" corrected. + * 2000/11/13 : fixed a race condition in case of concurrent accesses to ioctl(). + * 2000/12/16 : fixed improper usage of rtnl_exlock_nowait(). + * + * 2001/1/3 - Chad N. Tindel + * - The bonding driver now simulates MII status monitoring, just like + * a normal network device. It will show that the link is down iff + * every slave in the bond shows that their links are down. If at least + * one slave is up, the bond's MII status will appear as up. + * + * 2001/2/7 - Chad N. Tindel + * - Applications can now query the bond from user space to get + * information which may be useful. They do this by calling + * the BOND_INFO_QUERY ioctl. Once the app knows how many slaves + * are in the bond, it can call the BOND_SLAVE_INFO_QUERY ioctl to + * get slave specific information (# link failures, etc). See + * for more details. The structs of interest + * are ifbond and ifslave. + * + * 2001/4/5 - Chad N. Tindel + * - Ported to 2.4 Kernel + * + * 2001/5/2 - Jeffrey E. Mast + * - When a device is detached from a bond, the slave device is no longer + * left thinking that is has a master. + * + * 2001/5/16 - Jeffrey E. Mast + * - memset did not appropriately initialized the bond rw_locks. Used + * rwlock_init to initialize to unlocked state to prevent deadlock when + * first attempting a lock + * - Called SET_MODULE_OWNER for bond device + * + * 2001/5/17 - Tim Anderson + * - 2 paths for releasing for slave release; 1 through ioctl + * and 2) through close. Both paths need to release the same way. + * - the free slave in bond release is changing slave status before + * the free. The netdev_set_master() is intended to change slave state + * so it should not be done as part of the release process. + * - Simple rule for slave state at release: only the active in A/B and + * only one in the trunked case. + * + * 2001/6/01 - Tim Anderson + * - Now call dev_close when releasing a slave so it doesn't screw up + * out routing table. + * + * 2001/6/01 - Chad N. Tindel + * - Added /proc support for getting bond and slave information. + * Information is in /proc/net//info. + * - Changed the locking when calling bond_close to prevent deadlock. + * + * 2001/8/05 - Janice Girouard + * - correct problem where refcnt of slave is not incremented in bond_ioctl + * so the system hangs when halting. + * - correct locking problem when unable to malloc in bond_enslave. + * - adding bond_xmit_xor logic. + * - adding multiple bond device support. + * + * 2001/8/13 - Erik Habbinga + * - correct locking problem with rtnl_exlock_nowait + * + * 2001/8/23 - Janice Girouard + * - bzero initial dev_bonds, to correct oops + * - convert SIOCDEVPRIVATE to new MII ioctl calls + * + * 2001/9/13 - Takao Indoh + * - Add the BOND_CHANGE_ACTIVE ioctl implementation + * + * 2001/9/14 - Mark Huth + * - Change MII_LINK_READY to not check for end of auto-negotiation, + * but only for an up link. + * + * 2001/9/20 - Chad N. Tindel + * - Add the device field to bonding_t. Previously the net_device + * corresponding to a bond wasn't available from the bonding_t + * structure. + * + * 2001/9/25 - Janice Girouard + * - add arp_monitor for active backup mode + * + * 2001/10/23 - Takao Indoh + * - Various memory leak fixes + * + * 2001/11/5 - Mark Huth + * - Don't take rtnl lock in bond_mii_monitor as it deadlocks under + * certain hotswap conditions. + * Note: this same change may be required in bond_arp_monitor ??? + * - Remove possibility of calling bond_sethwaddr with NULL slave_dev ptr + * - Handle hot swap ethernet interface deregistration events to remove + * kernel oops following hot swap of enslaved interface + * + * 2002/1/2 - Chad N. Tindel + * - Restore original slave flags at release time. + * + * 2002/02/18 - Erik Habbinga + * - bond_release(): calling kfree on our_slave after call to + * bond_restore_slave_flags, not before + * - bond_enslave(): saving slave flags into original_flags before + * call to netdev_set_master, so the IFF_SLAVE flag doesn't end + * up in original_flags + * + * 2002/04/05 - Mark Smith and + * Steve Mead + * - Port Gleb Natapov's multicast support patchs from 2.4.12 + * to 2.4.18 adding support for multicast. + * + * 2002/06/10 - Tony Cureington + * - corrected uninitialized pointer (ifr.ifr_data) in bond_check_dev_link; + * actually changed function to use MIIPHY, then MIIREG, and finally + * ETHTOOL to determine the link status + * - fixed bad ifr_data pointer assignments in bond_ioctl + * - corrected mode 1 being reported as active-backup in bond_get_info; + * also added text to distinguish type of load balancing (rr or xor) + * - change arp_ip_target module param from "1-12s" (array of 12 ptrs) + * to "s" (a single ptr) + * + * 2002/08/30 - Jay Vosburgh + * - Removed acquisition of xmit_lock in set_multicast_list; caused + * deadlock on SMP (lock is held by caller). + * - Revamped SIOCGMIIPHY, SIOCGMIIREG portion of bond_check_dev_link(). + * + * 2002/09/18 - Jay Vosburgh + * - Fixed up bond_check_dev_link() (and callers): removed some magic + * numbers, banished local MII_ defines, wrapped ioctl calls to + * prevent EFAULT errors + * + * 2002/9/30 - Jay Vosburgh + * - make sure the ip target matches the arp_target before saving the + * hw address. + * + * 2002/9/30 - Dan Eisner + * - make sure my_ip is set before taking down the link, since + * not all switches respond if the source ip is not set. + * + * 2002/10/8 - Janice Girouard + * - read in the local ip address when enslaving a device + * - add primary support + * - make sure 2*arp_interval has passed when a new device + * is brought on-line before taking it down. + * + * 2002/09/11 - Philippe De Muyter + * - Added bond_xmit_broadcast logic. + * - Added bond_mode() support function. + * + * 2002/10/26 - Laurent Deniel + * - allow to register multicast addresses only on active slave + * (useful in active-backup mode) + * - add multicast module parameter + * - fix deletion of multicast groups after unloading module + * + * 2002/11/06 - Kameshwara Rayaprolu + * - Changes to prevent panic from closing the device twice; if we close + * the device in bond_release, we must set the original_flags to down + * so it won't be closed again by the network layer. + * + * 2002/11/07 - Tony Cureington + * - Fix arp_target_hw_addr memory leak + * - Created activebackup_arp_monitor function to handle arp monitoring + * in active backup mode - the bond_arp_monitor had several problems... + * such as allowing slaves to tx arps sequentially without any delay + * for a response + * - Renamed bond_arp_monitor to loadbalance_arp_monitor and re-wrote + * this function to just handle arp monitoring in load-balancing mode; + * it is a lot more compact now + * - Changes to ensure one and only one slave transmits in active-backup + * mode + * - Robustesize parameters; warn users about bad combinations of + * parameters; also if miimon is specified and a network driver does + * not support MII or ETHTOOL, inform the user of this + * - Changes to support link_failure_count when in arp monitoring mode + * - Fix up/down delay reported in /proc + * - Added version; log version; make version available from "modinfo -d" + * - Fixed problem in bond_check_dev_link - if the first IOCTL (SIOCGMIIPH) + * failed, the ETHTOOL ioctl never got a chance + * + * 2002/11/16 - Laurent Deniel + * - fix multicast handling in activebackup_arp_monitor + * - remove one unnecessary and confusing curr_active_slave == slave test + * in activebackup_arp_monitor + * + * 2002/11/17 - Laurent Deniel + * - fix bond_slave_info_query when slave_id = num_slaves + * + * 2002/11/19 - Janice Girouard + * - correct ifr_data reference. Update ifr_data reference + * to mii_ioctl_data struct values to avoid confusion. + * + * 2002/11/22 - Bert Barbe + * - Add support for multiple arp_ip_target + * + * 2002/12/13 - Jay Vosburgh + * - Changed to allow text strings for mode and multicast, e.g., + * insmod bonding mode=active-backup. The numbers still work. + * One change: an invalid choice will cause module load failure, + * rather than the previous behavior of just picking one. + * - Minor cleanups; got rid of dup ctype stuff, atoi function + * + * 2003/02/07 - Jay Vosburgh + * - Added use_carrier module parameter that causes miimon to + * use netif_carrier_ok() test instead of MII/ETHTOOL ioctls. + * - Minor cleanups; consolidated ioctl calls to one function. + * + * 2003/02/07 - Tony Cureington + * - Fix bond_mii_monitor() logic error that could result in + * bonding round-robin mode ignoring links after failover/recovery + * + * 2003/03/17 - Jay Vosburgh + * - kmalloc fix (GFP_KERNEL to GFP_ATOMIC) reported by + * Shmulik dot Hen at intel.com. + * - Based on discussion on mailing list, changed use of + * update_slave_cnt(), created wrapper functions for adding/removing + * slaves, changed bond_xmit_xor() to check slave_cnt instead of + * checking slave and slave->dev (which only worked by accident). + * - Misc code cleanup: get arp_send() prototype from header file, + * add max_bonds to bonding.txt. + * + * 2003/03/18 - Tsippy Mendelson and + * Shmulik Hen + * - Make sure only bond_attach_slave() and bond_detach_slave() can + * manipulate the slave list, including slave_cnt, even when in + * bond_release_all(). + * - Fixed hang in bond_release() with traffic running: + * netdev_set_master() must not be called from within the bond lock. + * + * 2003/03/18 - Tsippy Mendelson and + * Shmulik Hen + * - Fixed hang in bond_enslave() with traffic running: + * netdev_set_master() must not be called from within the bond lock. + * + * 2003/03/18 - Amir Noam + * - Added support for getting slave's speed and duplex via ethtool. + * Needed for 802.3ad and other future modes. + * + * 2003/03/18 - Tsippy Mendelson and + * Shmulik Hen + * - Enable support of modes that need to use the unique mac address of + * each slave. + * * bond_enslave(): Moved setting the slave's mac address, and + * openning it, from the application to the driver. This breaks + * backward comaptibility with old versions of ifenslave that open + * the slave before enalsving it !!!. + * * bond_release(): The driver also takes care of closing the slave + * and restoring its original mac address. + * - Removed the code that restores all base driver's flags. + * Flags are automatically restored once all undo stages are done + * properly. + * - Block possibility of enslaving before the master is up. This + * prevents putting the system in an unstable state. + * + * 2003/03/18 - Amir Noam , + * Tsippy Mendelson and + * Shmulik Hen + * - Added support for IEEE 802.3ad Dynamic link aggregation mode. + * + * 2003/05/01 - Amir Noam + * - Added ABI version control to restore compatibility between + * new/old ifenslave and new/old bonding. + * + * 2003/05/01 - Shmulik Hen + * - Fixed bug in bond_release_all(): save old value of curr_active_slave + * before setting it to NULL. + * - Changed driver versioning scheme to include version number instead + * of release date (that is already in another field). There are 3 + * fields X.Y.Z where: + * X - Major version - big behavior changes + * Y - Minor version - addition of features + * Z - Extra version - minor changes and bug fixes + * The current version is 1.0.0 as a base line. + * + * 2003/05/01 - Tsippy Mendelson and + * Amir Noam + * - Added support for lacp_rate module param. + * - Code beautification and style changes (mainly in comments). + * new version - 1.0.1 + * + * 2003/05/01 - Shmulik Hen + * - Based on discussion on mailing list, changed locking scheme + * to use lock/unlock or lock_bh/unlock_bh appropriately instead + * of lock_irqsave/unlock_irqrestore. The new scheme helps exposing + * hidden bugs and solves system hangs that occurred due to the fact + * that holding lock_irqsave doesn't prevent softirqs from running. + * This also increases total throughput since interrupts are not + * blocked on each transmitted packets or monitor timeout. + * new version - 2.0.0 + * + * 2003/05/01 - Shmulik Hen + * - Added support for Transmit load balancing mode. + * - Concentrate all assignments of curr_active_slave to a single point + * so specific modes can take actions when the primary adapter is + * changed. + * - Take the updelay parameter into consideration during bond_enslave + * since some adapters loose their link during setting the device. + * - Renamed bond_3ad_link_status_changed() to + * bond_3ad_handle_link_change() for compatibility with TLB. + * new version - 2.1.0 + * + * 2003/05/01 - Tsippy Mendelson + * - Added support for Adaptive load balancing mode which is + * equivalent to Transmit load balancing + Receive load balancing. + * new version - 2.2.0 + * + * 2003/05/15 - Jay Vosburgh + * - Applied fix to activebackup_arp_monitor posted to bonding-devel + * by Tony Cureington . Fixes ARP + * monitor endless failover bug. Version to 2.2.10 + * + * 2003/05/20 - Amir Noam + * - Fixed bug in ABI version control - Don't commit to a specific + * ABI version if receiving unsupported ioctl commands. + * + * 2003/05/22 - Jay Vosburgh + * - Fix ifenslave -c causing bond to loose existing routes; + * added bond_set_mac_address() that doesn't require the + * bond to be down. + * - In conjunction with fix for ifenslave -c, in + * bond_change_active(), changing to the already active slave + * is no longer an error (it successfully does nothing). + * + * 2003/06/30 - Amir Noam + * - Fixed bond_change_active() for ALB/TLB modes. + * Version to 2.2.14. + * + * 2003/07/29 - Amir Noam + * - Fixed ARP monitoring bug. + * Version to 2.2.15. + * + * 2003/07/31 - Willy Tarreau + * - Fixed kernel panic when using ARP monitoring without + * setting bond's IP address. + * Version to 2.2.16. + * + * 2003/08/06 - Amir Noam + * - Back port from 2.6: use alloc_netdev(); fix /proc handling; + * made stats a part of bond struct so no need to allocate + * and free it separately; use standard list operations instead + * of pre-allocated array of bonds. + * Version to 2.3.0. + * + * 2003/08/07 - Jay Vosburgh , + * Amir Noam and + * Shmulik Hen + * - Propagating master's settings: Distinguish between modes that + * use a primary slave from those that don't, and propagate settings + * accordingly; Consolidate change_active opeartions and add + * reselect_active and find_best opeartions; Decouple promiscuous + * handling from the multicast mode setting; Add support for changing + * HW address and MTU with proper unwind; Consolidate procfs code, + * add CHANGENAME handler; Enhance netdev notification handling. + * Version to 2.4.0. + * + * 2003/09/15 - Stephen Hemminger , + * Amir Noam + * - Convert /proc to seq_file interface. + * Change /proc/net/bondX/info to /proc/net/bonding/bondX. + * Set version to 2.4.1. + * + * 2003/11/20 - Amir Noam + * - Fix /proc creation/destruction. + * + * 2003/12/01 - Shmulik Hen + * - Massive cleanup - Set version to 2.5.0 + * Code changes: + * o Consolidate format of prints and debug prints. + * o Remove bonding_t/slave_t typedefs and consolidate all casts. + * o Remove dead code and unnecessary checks. + * o Consolidate starting/stopping timers. + * o Consolidate handling of primary module param throughout the code. + * o Removed multicast module param support - all settings are done + * according to mode. + * o Slave list iteration - bond is no longer part of the list, + * added cyclic list iteration macros. + * o Consolidate error handling in all xmit functions. + * Style changes: + * o Consolidate function naming and declarations. + * o Consolidate function params and local variables names. + * o Consolidate return values. + * o Consolidate curly braces. + * o Consolidate conditionals format. + * o Change struct member names and types. + * o Chomp trailing spaces, remove empty lines, fix indentations. + * o Re-organize code according to context. + * + * 2003/12/30 - Amir Noam + * - Fixed: Cannot remove and re-enslave the original active slave. + * - Fixed: Releasing the original active slave causes mac address + * duplication. + * - Add support for slaves that use ethtool_ops. + * Set version to 2.5.3. + * + * 2004/01/05 - Amir Noam + * - Save bonding parameters per bond instead of using the global values. + * Set version to 2.5.4. + * + * 2004/01/14 - Shmulik Hen + * - Enhance VLAN support: + * * Add support for VLAN hardware acceleration capable slaves. + * * Add capability to tag self generated packets in ALB/TLB modes. + * Set version to 2.6.0. + * 2004/10/29 - Mitch Williams + * - Fixed bug when unloading module while using 802.3ad. If + * spinlock debugging is turned on, this causes a stack dump. + * Solution is to move call to dev_remove_pack outside of the + * spinlock. + * Set version to 2.6.1. + * 2005/06/05 - Jay Vosburgh + * - Support for generating gratuitous ARPs in active-backup mode. + * Includes support for VLAN tagging all bonding-generated ARPs + * as needed. Set version to 2.6.2. + * 2005/06/08 - Jason Gabler + * - alternate hashing policy support for mode 2 + * * Added kernel parameter "xmit_hash_policy" to allow the selection + * of different hashing policies for mode 2. The original mode 2 + * policy is the default, now found in xmit_hash_policy_layer2(). + * * Added xmit_hash_policy_layer34() + * - Modified by Jay Vosburgh to also support mode 4. + * Set version to 2.6.3. + * 2005/09/26 - Jay Vosburgh + * - Removed backwards compatibility for old ifenslaves. Version 2.6.4. */ //#define BONDING_DEBUG 1 @@ -97,7 +557,6 @@ static char *lacp_rate = NULL; static char *xmit_hash_policy = NULL; static int arp_interval = BOND_LINK_ARP_INTERV; static char *arp_ip_target[BOND_MAX_ARP_TARGETS] = { NULL, }; -struct bond_params bonding_defaults; module_param(max_bonds, int, 0); MODULE_PARM_DESC(max_bonds, "Max number of bonded devices"); @@ -106,24 +565,17 @@ MODULE_PARM_DESC(miimon, "Link check interval in milliseconds"); module_param(updelay, int, 0); MODULE_PARM_DESC(updelay, "Delay before considering link up, in milliseconds"); module_param(downdelay, int, 0); -MODULE_PARM_DESC(downdelay, "Delay before considering link down, " - "in milliseconds"); +MODULE_PARM_DESC(downdelay, "Delay before considering link down, in milliseconds"); module_param(use_carrier, int, 0); -MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; " - "0 for off, 1 for on (default)"); +MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default)"); module_param(mode, charp, 0); -MODULE_PARM_DESC(mode, "Mode of operation : 0 for balance-rr, " - "1 for active-backup, 2 for balance-xor, " - "3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, " - "6 for balance-alb"); +MODULE_PARM_DESC(mode, "Mode of operation : 0 for round robin, 1 for active-backup, 2 for xor"); module_param(primary, charp, 0); MODULE_PARM_DESC(primary, "Primary network device to use"); module_param(lacp_rate, charp, 0); -MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner " - "(slow/fast)"); +MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner (slow/fast)"); module_param(xmit_hash_policy, charp, 0); -MODULE_PARM_DESC(xmit_hash_policy, "XOR hashing method: 0 for layer 2 (default)" - ", 1 for layer 3+4"); +MODULE_PARM_DESC(xmit_hash_policy, "XOR hashing method : 0 for layer 2 (default), 1 for layer 3+4"); module_param(arp_interval, int, 0); MODULE_PARM_DESC(arp_interval, "arp interval in milliseconds"); module_param_array(arp_ip_target, charp, NULL, 0); @@ -134,27 +586,30 @@ MODULE_PARM_DESC(arp_ip_target, "arp targets in n.n.n.n form"); static const char *version = DRV_DESCRIPTION ": v" DRV_VERSION " (" DRV_RELDATE ")\n"; -LIST_HEAD(bond_dev_list); +static LIST_HEAD(bond_dev_list); #ifdef CONFIG_PROC_FS static struct proc_dir_entry *bond_proc_dir = NULL; #endif -extern struct rw_semaphore bonding_rwsem; static u32 arp_target[BOND_MAX_ARP_TARGETS] = { 0, } ; static int arp_ip_count = 0; static int bond_mode = BOND_MODE_ROUNDROBIN; static int xmit_hashtype= BOND_XMIT_POLICY_LAYER2; static int lacp_fast = 0; +struct bond_parm_tbl { + char *modename; + int mode; +}; -struct bond_parm_tbl bond_lacp_tbl[] = { +static struct bond_parm_tbl bond_lacp_tbl[] = { { "slow", AD_LACP_SLOW}, { "fast", AD_LACP_FAST}, { NULL, -1}, }; -struct bond_parm_tbl bond_mode_tbl[] = { +static struct bond_parm_tbl bond_mode_tbl[] = { { "balance-rr", BOND_MODE_ROUNDROBIN}, { "active-backup", BOND_MODE_ACTIVEBACKUP}, { "balance-xor", BOND_MODE_XOR}, @@ -165,7 +620,7 @@ struct bond_parm_tbl bond_mode_tbl[] = { { NULL, -1}, }; -struct bond_parm_tbl xmit_hashtype_tbl[] = { +static struct bond_parm_tbl xmit_hashtype_tbl[] = { { "layer2", BOND_XMIT_POLICY_LAYER2}, { "layer3+4", BOND_XMIT_POLICY_LAYER34}, { NULL, -1}, @@ -173,11 +628,12 @@ struct bond_parm_tbl xmit_hashtype_tbl[] = { /*-------------------------- Forward declarations ---------------------------*/ +static inline void bond_set_mode_ops(struct bonding *bond, int mode); static void bond_send_gratuitous_arp(struct bonding *bond); /*---------------------------- General routines -----------------------------*/ -const char *bond_mode_name(int mode) +static const char *bond_mode_name(int mode) { switch (mode) { case BOND_MODE_ROUNDROBIN : @@ -454,7 +910,7 @@ static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) res = bond_add_vlan(bond, vid); if (res) { printk(KERN_ERR DRV_NAME - ": %s: Error: Failed to add vlan id %d\n", + ": %s: Failed to add vlan id %d\n", bond_dev->name, vid); } } @@ -488,7 +944,7 @@ static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) res = bond_del_vlan(bond, vid); if (res) { printk(KERN_ERR DRV_NAME - ": %s: Error: Failed to remove vlan id %d\n", + ": %s: Failed to remove vlan id %d\n", bond_dev->name, vid); } } @@ -993,7 +1449,7 @@ static struct slave *bond_find_best_slave(struct bonding *bond) * * Warning: Caller must hold curr_slave_lock for writing. */ -void bond_change_active_slave(struct bonding *bond, struct slave *new_active) +static void bond_change_active_slave(struct bonding *bond, struct slave *new_active) { struct slave *old_active = bond->curr_active_slave; @@ -1067,7 +1523,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) * * Warning: Caller must hold curr_slave_lock for writing. */ -void bond_select_active_slave(struct bonding *bond) +static void bond_select_active_slave(struct bonding *bond) { struct slave *best_slave; @@ -1135,7 +1591,7 @@ static void bond_detach_slave(struct bonding *bond, struct slave *slave) /*---------------------------------- IOCTL ----------------------------------*/ -int bond_sethwaddr(struct net_device *bond_dev, struct net_device *slave_dev) +static int bond_sethwaddr(struct net_device *bond_dev, struct net_device *slave_dev) { dprintk("bond_dev=%p\n", bond_dev); dprintk("slave_dev=%p\n", slave_dev); @@ -1175,7 +1631,7 @@ static int bond_compute_features(struct bonding *bond) } /* enslave device to bond device */ -int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) +static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) { struct bonding *bond = bond_dev->priv; struct slave *new_slave = NULL; @@ -1188,8 +1644,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL && slave_dev->do_ioctl == NULL) { printk(KERN_WARNING DRV_NAME - ": %s: Warning: no link monitoring support for %s\n", - bond_dev->name, slave_dev->name); + ": Warning : no link monitoring support for %s\n", + slave_dev->name); } /* bond must be initialized by bond_open() before enslaving */ @@ -1210,17 +1666,17 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) dprintk("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); if (!list_empty(&bond->vlan_list)) { printk(KERN_ERR DRV_NAME - ": %s: Error: cannot enslave VLAN " + ": Error: cannot enslave VLAN " "challenged slave %s on VLAN enabled " - "bond %s\n", bond_dev->name, slave_dev->name, + "bond %s\n", slave_dev->name, bond_dev->name); return -EPERM; } else { printk(KERN_WARNING DRV_NAME - ": %s: Warning: enslaved VLAN challenged " + ": Warning: enslaved VLAN challenged " "slave %s. Adding VLANs will be blocked as " "long as %s is part of bond %s\n", - bond_dev->name, slave_dev->name, slave_dev->name, + slave_dev->name, slave_dev->name, bond_dev->name); bond_dev->features |= NETIF_F_VLAN_CHALLENGED; } @@ -1250,11 +1706,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) if (slave_dev->set_mac_address == NULL) { printk(KERN_ERR DRV_NAME - ": %s: Error: The slave device you specified does " - "not support setting the MAC address. " - "Your kernel likely does not support slave " - "devices.\n", bond_dev->name); - res = -EOPNOTSUPP; + ": Error: The slave device you specified does " + "not support setting the MAC address.\n"); + printk(KERN_ERR + "Your kernel likely does not support slave devices.\n"); + + res = -EOPNOTSUPP; goto err_undo_flags; } @@ -1370,21 +1827,21 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) * the messages for netif_carrier. */ printk(KERN_WARNING DRV_NAME - ": %s: Warning: MII and ETHTOOL support not " + ": Warning: MII and ETHTOOL support not " "available for interface %s, and " "arp_interval/arp_ip_target module parameters " "not specified, thus bonding will not detect " "link failures! see bonding.txt for details.\n", - bond_dev->name, slave_dev->name); + slave_dev->name); } else if (link_reporting == -1) { /* unable get link status using mii/ethtool */ printk(KERN_WARNING DRV_NAME - ": %s: Warning: can't get link status from " + ": Warning: can't get link status from " "interface %s; the network driver associated " "with this interface does not support MII or " "ETHTOOL link status reporting, thus miimon " "has no effect on this interface.\n", - bond_dev->name, slave_dev->name); + slave_dev->name); } } @@ -1411,15 +1868,15 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) if (bond_update_speed_duplex(new_slave) && (new_slave->link != BOND_LINK_DOWN)) { printk(KERN_WARNING DRV_NAME - ": %s: Warning: failed to get speed and duplex from %s, " + ": Warning: failed to get speed and duplex from %s, " "assumed to be 100Mb/sec and Full.\n", - bond_dev->name, new_slave->dev->name); + new_slave->dev->name); if (bond->params.mode == BOND_MODE_8023AD) { - printk(KERN_WARNING DRV_NAME - ": %s: Warning: Operation of 802.3ad mode requires ETHTOOL " + printk(KERN_WARNING + "Operation of 802.3ad mode requires ETHTOOL " "support in base driver for proper aggregator " - "selection.\n", bond_dev->name); + "selection.\n"); } } @@ -1501,10 +1958,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) write_unlock_bh(&bond->lock); - res = bond_create_slave_symlinks(bond_dev, slave_dev); - if (res) - goto err_unset_master; - printk(KERN_INFO DRV_NAME ": %s: enslaving %s as a%s interface with a%s link.\n", bond_dev->name, slave_dev->name, @@ -1546,7 +1999,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) * for Bonded connections: * The first up interface should be left on and all others downed. */ -int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) +static int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) { struct bonding *bond = bond_dev->priv; struct slave *slave, *oldcurrent; @@ -1557,7 +2010,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) if (!(slave_dev->flags & IFF_SLAVE) || (slave_dev->master != bond_dev)) { printk(KERN_ERR DRV_NAME - ": %s: Error: cannot release %s.\n", + ": Error: %s: cannot release %s.\n", bond_dev->name, slave_dev->name); return -EINVAL; } @@ -1578,12 +2031,11 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) ETH_ALEN); if (!mac_addr_differ && (bond->slave_cnt > 1)) { printk(KERN_WARNING DRV_NAME - ": %s: Warning: the permanent HWaddr of %s " + ": Warning: the permanent HWaddr of %s " "- %02X:%02X:%02X:%02X:%02X:%02X - is " "still in use by %s. Set the HWaddr of " "%s to a different address to avoid " "conflicts.\n", - bond_dev->name, slave_dev->name, slave->perm_hwaddr[0], slave->perm_hwaddr[1], @@ -1659,28 +2111,24 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) bond_dev->features |= NETIF_F_VLAN_CHALLENGED; } else { printk(KERN_WARNING DRV_NAME - ": %s: Warning: clearing HW address of %s while it " + ": Warning: clearing HW address of %s while it " "still has VLANs.\n", - bond_dev->name, bond_dev->name); - printk(KERN_WARNING DRV_NAME - ": %s: When re-adding slaves, make sure the bond's " - "HW address matches its VLANs'.\n", bond_dev->name); + printk(KERN_WARNING DRV_NAME + ": When re-adding slaves, make sure the bond's " + "HW address matches its VLANs'.\n"); } } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) && !bond_has_challenged_slaves(bond)) { printk(KERN_INFO DRV_NAME - ": %s: last VLAN challenged slave %s " + ": last VLAN challenged slave %s " "left bond %s. VLAN blocking is removed\n", - bond_dev->name, slave_dev->name, bond_dev->name); + slave_dev->name, bond_dev->name); bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED; } write_unlock_bh(&bond->lock); - /* must do this from outside any spinlocks */ - bond_destroy_slave_symlinks(bond_dev, slave_dev); - bond_del_vlans_from_slave(bond, slave_dev); /* If the mode USES_PRIMARY, then we should only remove its @@ -1772,7 +2220,6 @@ static int bond_release_all(struct net_device *bond_dev) */ write_unlock_bh(&bond->lock); - bond_destroy_slave_symlinks(bond_dev, slave_dev); bond_del_vlans_from_slave(bond, slave_dev); /* If the mode USES_PRIMARY, then we should only remove its @@ -1827,13 +2274,12 @@ static int bond_release_all(struct net_device *bond_dev) bond_dev->features |= NETIF_F_VLAN_CHALLENGED; } else { printk(KERN_WARNING DRV_NAME - ": %s: Warning: clearing HW address of %s while it " + ": Warning: clearing HW address of %s while it " "still has VLANs.\n", - bond_dev->name, bond_dev->name); - printk(KERN_WARNING DRV_NAME - ": %s: When re-adding slaves, make sure the bond's " - "HW address matches its VLANs'.\n", bond_dev->name); + printk(KERN_WARNING DRV_NAME + ": When re-adding slaves, make sure the bond's " + "HW address matches its VLANs'.\n"); } printk(KERN_INFO DRV_NAME @@ -1951,7 +2397,7 @@ static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *in /*-------------------------------- Monitoring -------------------------------*/ /* this function is called regularly to monitor each slave's link. */ -void bond_mii_monitor(struct net_device *bond_dev) +static void bond_mii_monitor(struct net_device *bond_dev) { struct bonding *bond = bond_dev->priv; struct slave *slave, *oldcurrent; @@ -2150,11 +2596,8 @@ void bond_mii_monitor(struct net_device *bond_dev) break; default: /* Should not happen */ - printk(KERN_ERR DRV_NAME - ": %s: Error: %s Illegal value (link=%d)\n", - bond_dev->name, - slave->dev->name, - slave->link); + printk(KERN_ERR "bonding: Error: %s Illegal value (link=%d)\n", + slave->dev->name, slave->link); goto out; } /* end of switch (slave->link) */ @@ -2278,9 +2721,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) struct flowi fl; struct rtable *rt; - for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { - if (!targets[i]) - continue; + for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { dprintk("basa: target %x\n", targets[i]); if (list_empty(&bond->vlan_list)) { dprintk("basa: empty vlan: arp_send\n"); @@ -2384,7 +2825,7 @@ static void bond_send_gratuitous_arp(struct bonding *bond) * arp is transmitted to generate traffic. see activebackup_arp_monitor for * arp monitoring in active backup mode. */ -void bond_loadbalance_arp_mon(struct net_device *bond_dev) +static void bond_loadbalance_arp_mon(struct net_device *bond_dev) { struct bonding *bond = bond_dev->priv; struct slave *slave, *oldcurrent; @@ -2522,7 +2963,7 @@ void bond_loadbalance_arp_mon(struct net_device *bond_dev) * may have received. * see loadbalance_arp_monitor for arp monitoring in load balancing mode */ -void bond_activebackup_arp_mon(struct net_device *bond_dev) +static void bond_activebackup_arp_mon(struct net_device *bond_dev) { struct bonding *bond = bond_dev->priv; struct slave *slave; @@ -2808,8 +3249,6 @@ static void bond_info_show_master(struct seq_file *seq) { struct bonding *bond = seq->private; struct slave *curr; - int i; - u32 target; read_lock(&bond->curr_slave_lock); curr = bond->curr_active_slave; @@ -2818,17 +3257,10 @@ static void bond_info_show_master(struct seq_file *seq) seq_printf(seq, "Bonding Mode: %s\n", bond_mode_name(bond->params.mode)); - if (bond->params.mode == BOND_MODE_XOR || - bond->params.mode == BOND_MODE_8023AD) { - seq_printf(seq, "Transmit Hash Policy: %s (%d)\n", - xmit_hashtype_tbl[bond->params.xmit_policy].modename, - bond->params.xmit_policy); - } - if (USES_PRIMARY(bond->params.mode)) { seq_printf(seq, "Primary Slave: %s\n", - (bond->primary_slave) ? - bond->primary_slave->dev->name : "None"); + (bond->params.primary[0]) ? + bond->params.primary : "None"); seq_printf(seq, "Currently Active Slave: %s\n", (curr) ? curr->dev->name : "None"); @@ -2841,27 +3273,6 @@ static void bond_info_show_master(struct seq_file *seq) seq_printf(seq, "Down Delay (ms): %d\n", bond->params.downdelay * bond->params.miimon); - - /* ARP information */ - if(bond->params.arp_interval > 0) { - int printed=0; - seq_printf(seq, "ARP Polling Interval (ms): %d\n", - bond->params.arp_interval); - - seq_printf(seq, "ARP IP target/s (n.n.n.n form):"); - - for(i = 0; (i < BOND_MAX_ARP_TARGETS) ;i++) { - if (!bond->params.arp_targets[i]) - continue; - if (printed) - seq_printf(seq, ","); - target = ntohl(bond->params.arp_targets[i]); - seq_printf(seq, " %d.%d.%d.%d", HIPQUAD(target)); - printed = 1; - } - seq_printf(seq, "\n"); - } - if (bond->params.mode == BOND_MODE_8023AD) { struct ad_info ad_info; @@ -3067,10 +3478,7 @@ static int bond_event_changename(struct bonding *bond) bond_remove_proc_entry(bond); bond_create_proc_entry(bond); #endif - down_write(&(bonding_rwsem)); - bond_destroy_sysfs_entry(bond); - bond_create_sysfs_entry(bond); - up_write(&(bonding_rwsem)); + return NOTIFY_DONE; } @@ -3547,7 +3955,6 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd return -EPERM; } - down_write(&(bonding_rwsem)); slave_dev = dev_get_by_name(ifr->ifr_slave); dprintk("slave_dev=%p: \n", slave_dev); @@ -3580,7 +3987,6 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd dev_put(slave_dev); } - up_write(&(bonding_rwsem)); return res; } @@ -3665,7 +4071,6 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) bond_for_each_slave(bond, slave, i) { dprintk("s %p s->p %p c_m %p\n", slave, slave->prev, slave->dev->change_mtu); - res = dev_set_mtu(slave->dev, new_mtu); if (res) { @@ -3992,9 +4397,8 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev) struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); if (!skb2) { printk(KERN_ERR DRV_NAME - ": %s: Error: bond_xmit_broadcast(): " - "skb_clone() failed\n", - bond_dev->name); + ": Error: bond_xmit_broadcast(): " + "skb_clone() failed\n"); continue; } @@ -4027,7 +4431,7 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev) /* * set bond mode specific net device operations */ -void bond_set_mode_ops(struct bonding *bond, int mode) +static inline void bond_set_mode_ops(struct bonding *bond, int mode) { struct net_device *bond_dev = bond->dev; @@ -4063,8 +4467,7 @@ void bond_set_mode_ops(struct bonding *bond, int mode) default: /* Should never happen, mode already checked */ printk(KERN_ERR DRV_NAME - ": %s: Error: Unknown bonding mode %d\n", - bond_dev->name, + ": Error: Unknown bonding mode %d\n", mode); break; } @@ -4088,7 +4491,7 @@ static struct ethtool_ops bond_ethtool_ops = { * Does not allocate but creates a /proc entry. * Allowed to fail. */ -static int bond_init(struct net_device *bond_dev, struct bond_params *params) +static int __init bond_init(struct net_device *bond_dev, struct bond_params *params) { struct bonding *bond = bond_dev->priv; @@ -4162,7 +4565,7 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params) /* De-initialize device specific data. * Caller must hold rtnl_lock. */ -void bond_deinit(struct net_device *bond_dev) +static inline void bond_deinit(struct net_device *bond_dev) { struct bonding *bond = bond_dev->priv; @@ -4198,7 +4601,7 @@ static void bond_free_all(void) * Convert string input module parms. Accept either the * number of the mode or its string name. */ -int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl) +static inline int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl) { int i; @@ -4267,7 +4670,7 @@ static int bond_check_params(struct bond_params *params) if (max_bonds < 1 || max_bonds > INT_MAX) { printk(KERN_WARNING DRV_NAME ": Warning: max_bonds (%d) not in range %d-%d, so it " - "was reset to BOND_DEFAULT_MAX_BONDS (%d)\n", + "was reset to BOND_DEFAULT_MAX_BONDS (%d)", max_bonds, 1, INT_MAX, BOND_DEFAULT_MAX_BONDS); max_bonds = BOND_DEFAULT_MAX_BONDS; } @@ -4478,96 +4881,81 @@ static int bond_check_params(struct bond_params *params) return 0; } -/* Create a new bond based on the specified name and bonding parameters. - * Caller must NOT hold rtnl_lock; we need to release it here before we - * set up our sysfs entries. - */ -int bond_create(char *name, struct bond_params *params, struct bonding **newbond) -{ - struct net_device *bond_dev; - int res; - - rtnl_lock(); - bond_dev = alloc_netdev(sizeof(struct bonding), name, ether_setup); - if (!bond_dev) { - printk(KERN_ERR DRV_NAME - ": %s: eek! can't alloc netdev!\n", - name); - res = -ENOMEM; - goto out_rtnl; - } - - /* bond_init() must be called after dev_alloc_name() (for the - * /proc files), but before register_netdevice(), because we - * need to set function pointers. - */ - - res = bond_init(bond_dev, params); - if (res < 0) { - goto out_netdev; - } - - SET_MODULE_OWNER(bond_dev); - - res = register_netdevice(bond_dev); - if (res < 0) { - goto out_bond; - } - if (newbond) - *newbond = bond_dev->priv; - - rtnl_unlock(); /* allows sysfs registration of net device */ - res = bond_create_sysfs_entry(bond_dev->priv); - goto done; -out_bond: - bond_deinit(bond_dev); -out_netdev: - free_netdev(bond_dev); -out_rtnl: - rtnl_unlock(); -done: - return res; -} - static int __init bonding_init(void) { + struct bond_params params; int i; int res; - char new_bond_name[8]; /* Enough room for 999 bonds at init. */ printk(KERN_INFO "%s", version); - res = bond_check_params(&bonding_defaults); + res = bond_check_params(¶ms); if (res) { - goto out; + return res; } + rtnl_lock(); + #ifdef CONFIG_PROC_FS bond_create_proc_dir(); #endif + for (i = 0; i < max_bonds; i++) { - sprintf(new_bond_name, "bond%d",i); - res = bond_create(new_bond_name,&bonding_defaults, NULL); - if (res) - goto err; - } + struct net_device *bond_dev; - res = bond_create_sysfs(); - if (res) - goto err; + bond_dev = alloc_netdev(sizeof(struct bonding), "", ether_setup); + if (!bond_dev) { + res = -ENOMEM; + goto out_err; + } + res = dev_alloc_name(bond_dev, "bond%d"); + if (res < 0) { + free_netdev(bond_dev); + goto out_err; + } + + /* bond_init() must be called after dev_alloc_name() (for the + * /proc files), but before register_netdevice(), because we + * need to set function pointers. + */ + res = bond_init(bond_dev, ¶ms); + if (res < 0) { + free_netdev(bond_dev); + goto out_err; + } + + SET_MODULE_OWNER(bond_dev); + + res = register_netdevice(bond_dev); + if (res < 0) { + bond_deinit(bond_dev); + free_netdev(bond_dev); + goto out_err; + } + } + + rtnl_unlock(); register_netdevice_notifier(&bond_netdev_notifier); register_inetaddr_notifier(&bond_inetaddr_notifier); - goto out; -err: + return 0; + +out_err: + /* + * rtnl_unlock() will run netdev_run_todo(), putting the + * thus-far-registered bonding devices into a state which + * unregigister_netdevice() will accept + */ + rtnl_unlock(); rtnl_lock(); + + /* free and unregister all bonds that were successfully added */ bond_free_all(); - bond_destroy_sysfs(); + rtnl_unlock(); -out: - return res; + return res; } static void __exit bonding_exit(void) @@ -4577,7 +4965,6 @@ static void __exit bonding_exit(void) rtnl_lock(); bond_free_all(); - bond_destroy_sysfs(); rtnl_unlock(); } diff --git a/trunk/drivers/net/bonding/bond_sysfs.c b/trunk/drivers/net/bonding/bond_sysfs.c deleted file mode 100644 index 32d13da43a0b..000000000000 --- a/trunk/drivers/net/bonding/bond_sysfs.c +++ /dev/null @@ -1,1358 +0,0 @@ - -/* - * Copyright(c) 2004-2005 Intel Corporation. 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 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The full GNU General Public License is included in this distribution in the - * file called LICENSE. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* #define BONDING_DEBUG 1 */ -#include "bonding.h" -#define to_class_dev(obj) container_of(obj,struct class_device,kobj) -#define to_net_dev(class) container_of(class, struct net_device, class_dev) -#define to_bond(cd) ((struct bonding *)(to_net_dev(cd)->priv)) - -/*---------------------------- Declarations -------------------------------*/ - - -extern struct list_head bond_dev_list; -extern struct bond_params bonding_defaults; -extern struct bond_parm_tbl bond_mode_tbl[]; -extern struct bond_parm_tbl bond_lacp_tbl[]; -extern struct bond_parm_tbl xmit_hashtype_tbl[]; - -static int expected_refcount = -1; -static struct class *netdev_class; -/*--------------------------- Data Structures -----------------------------*/ - -/* Bonding sysfs lock. Why can't we just use the subsytem lock? - * Because kobject_register tries to acquire the subsystem lock. If - * we already hold the lock (which we would if the user was creating - * a new bond through the sysfs interface), we deadlock. - * This lock is only needed when deleting a bond - we need to make sure - * that we don't collide with an ongoing ioctl. - */ - -struct rw_semaphore bonding_rwsem; - - - - -/*------------------------------ Functions --------------------------------*/ - -/* - * "show" function for the bond_masters attribute. - * The class parameter is ignored. - */ -static ssize_t bonding_show_bonds(struct class *cls, char *buffer) -{ - int res = 0; - struct bonding *bond; - - down_read(&(bonding_rwsem)); - - list_for_each_entry(bond, &bond_dev_list, bond_list) { - if (res > (PAGE_SIZE - IFNAMSIZ)) { - /* not enough space for another interface name */ - if ((PAGE_SIZE - res) > 10) - res = PAGE_SIZE - 10; - res += sprintf(buffer + res, "++more++"); - break; - } - res += sprintf(buffer + res, "%s ", - bond->dev->name); - } - res += sprintf(buffer + res, "\n"); - res++; - up_read(&(bonding_rwsem)); - return res; -} - -/* - * "store" function for the bond_masters attribute. This is what - * creates and deletes entire bonds. - * - * The class parameter is ignored. - * - */ - -static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t count) -{ - char command[IFNAMSIZ + 1] = {0, }; - char *ifname; - int res = count; - struct bonding *bond; - struct bonding *nxt; - - down_write(&(bonding_rwsem)); - sscanf(buffer, "%16s", command); /* IFNAMSIZ*/ - ifname = command + 1; - if ((strlen(command) <= 1) || - !dev_valid_name(ifname)) - goto err_no_cmd; - - if (command[0] == '+') { - - /* Check to see if the bond already exists. */ - list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) - if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) { - printk(KERN_ERR DRV_NAME - ": cannot add bond %s; it already exists\n", - ifname); - res = -EPERM; - goto out; - } - - printk(KERN_INFO DRV_NAME - ": %s is being created...\n", ifname); - if (bond_create(ifname, &bonding_defaults, &bond)) { - printk(KERN_INFO DRV_NAME - ": %s interface already exists. Bond creation failed.\n", - ifname); - res = -EPERM; - } - goto out; - } - - if (command[0] == '-') { - list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) - if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) { - rtnl_lock(); - /* check the ref count on the bond's kobject. - * If it's > expected, then there's a file open, - * and we have to fail. - */ - if (atomic_read(&bond->dev->class_dev.kobj.kref.refcount) - > expected_refcount){ - rtnl_unlock(); - printk(KERN_INFO DRV_NAME - ": Unable remove bond %s due to open references.\n", - ifname); - res = -EPERM; - goto out; - } - printk(KERN_INFO DRV_NAME - ": %s is being deleted...\n", - bond->dev->name); - unregister_netdevice(bond->dev); - bond_deinit(bond->dev); - bond_destroy_sysfs_entry(bond); - rtnl_unlock(); - goto out; - } - - printk(KERN_ERR DRV_NAME - ": unable to delete non-existent bond %s\n", ifname); - res = -ENODEV; - goto out; - } - -err_no_cmd: - printk(KERN_ERR DRV_NAME - ": no command found in bonding_masters. Use +ifname or -ifname.\n"); - res = -EPERM; - - /* Always return either count or an error. If you return 0, you'll - * get called forever, which is bad. - */ -out: - up_write(&(bonding_rwsem)); - return res; -} -/* class attribute for bond_masters file. This ends up in /sys/class/net */ -static CLASS_ATTR(bonding_masters, S_IWUSR | S_IRUGO, - bonding_show_bonds, bonding_store_bonds); - -int bond_create_slave_symlinks(struct net_device *master, struct net_device *slave) -{ - char linkname[IFNAMSIZ+7]; - int ret = 0; - - /* first, create a link from the slave back to the master */ - ret = sysfs_create_link(&(slave->class_dev.kobj), &(master->class_dev.kobj), - "master"); - if (ret) - return ret; - /* next, create a link from the master to the slave */ - sprintf(linkname,"slave_%s",slave->name); - ret = sysfs_create_link(&(master->class_dev.kobj), &(slave->class_dev.kobj), - linkname); - return ret; - -} - -void bond_destroy_slave_symlinks(struct net_device *master, struct net_device *slave) -{ - char linkname[IFNAMSIZ+7]; - - sysfs_remove_link(&(slave->class_dev.kobj), "master"); - sprintf(linkname,"slave_%s",slave->name); - sysfs_remove_link(&(master->class_dev.kobj), linkname); -} - - -/* - * Show the slaves in the current bond. - */ -static ssize_t bonding_show_slaves(struct class_device *cd, char *buf) -{ - struct slave *slave; - int i, res = 0; - struct bonding *bond = to_bond(cd); - - read_lock_bh(&bond->lock); - bond_for_each_slave(bond, slave, i) { - if (res > (PAGE_SIZE - IFNAMSIZ)) { - /* not enough space for another interface name */ - if ((PAGE_SIZE - res) > 10) - res = PAGE_SIZE - 10; - res += sprintf(buf + res, "++more++"); - break; - } - res += sprintf(buf + res, "%s ", slave->dev->name); - } - read_unlock_bh(&bond->lock); - res += sprintf(buf + res, "\n"); - res++; - return res; -} - -/* - * Set the slaves in the current bond. The bond interface must be - * up for this to succeed. - * This function is largely the same flow as bonding_update_bonds(). - */ -static ssize_t bonding_store_slaves(struct class_device *cd, const char *buffer, size_t count) -{ - char command[IFNAMSIZ + 1] = { 0, }; - char *ifname; - int i, res, found, ret = count; - struct slave *slave; - struct net_device *dev = 0; - struct bonding *bond = to_bond(cd); - - /* Quick sanity check -- is the bond interface up? */ - if (!(bond->dev->flags & IFF_UP)) { - printk(KERN_ERR DRV_NAME - ": %s: Unable to update slaves because interface is down.\n", - bond->dev->name); - ret = -EPERM; - goto out; - } - - /* Note: We can't hold bond->lock here, as bond_create grabs it. */ - - sscanf(buffer, "%16s", command); /* IFNAMSIZ*/ - ifname = command + 1; - if ((strlen(command) <= 1) || - !dev_valid_name(ifname)) - goto err_no_cmd; - - if (command[0] == '+') { - - /* Got a slave name in ifname. Is it already in the list? */ - found = 0; - read_lock_bh(&bond->lock); - bond_for_each_slave(bond, slave, i) - if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) { - printk(KERN_ERR DRV_NAME - ": %s: Interface %s is already enslaved!\n", - bond->dev->name, ifname); - ret = -EPERM; - read_unlock_bh(&bond->lock); - goto out; - } - - read_unlock_bh(&bond->lock); - printk(KERN_INFO DRV_NAME ": %s: Adding slave %s.\n", - bond->dev->name, ifname); - dev = dev_get_by_name(ifname); - if (!dev) { - printk(KERN_INFO DRV_NAME - ": %s: Interface %s does not exist!\n", - bond->dev->name, ifname); - ret = -EPERM; - goto out; - } - else - dev_put(dev); - - if (dev->flags & IFF_UP) { - printk(KERN_ERR DRV_NAME - ": %s: Error: Unable to enslave %s " - "because it is already up.\n", - bond->dev->name, dev->name); - ret = -EPERM; - goto out; - } - /* If this is the first slave, then we need to set - the master's hardware address to be the same as the - slave's. */ - if (!(*((u32 *) & (bond->dev->dev_addr[0])))) { - memcpy(bond->dev->dev_addr, dev->dev_addr, - dev->addr_len); - } - - /* Set the slave's MTU to match the bond */ - if (dev->mtu != bond->dev->mtu) { - if (dev->change_mtu) { - res = dev->change_mtu(dev, - bond->dev->mtu); - if (res) { - ret = res; - goto out; - } - } else { - dev->mtu = bond->dev->mtu; - } - } - rtnl_lock(); - res = bond_enslave(bond->dev, dev); - rtnl_unlock(); - if (res) { - ret = res; - } - goto out; - } - - if (command[0] == '-') { - dev = NULL; - bond_for_each_slave(bond, slave, i) - if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) { - dev = slave->dev; - break; - } - if (dev) { - printk(KERN_INFO DRV_NAME ": %s: Removing slave %s\n", - bond->dev->name, dev->name); - rtnl_lock(); - res = bond_release(bond->dev, dev); - rtnl_unlock(); - if (res) { - ret = res; - goto out; - } - /* set the slave MTU to the default */ - if (dev->change_mtu) { - dev->change_mtu(dev, 1500); - } else { - dev->mtu = 1500; - } - } - else { - printk(KERN_ERR DRV_NAME ": unable to remove non-existent slave %s for bond %s.\n", - ifname, bond->dev->name); - ret = -ENODEV; - } - goto out; - } - -err_no_cmd: - printk(KERN_ERR DRV_NAME ": no command found in slaves file for bond %s. Use +ifname or -ifname.\n", bond->dev->name); - ret = -EPERM; - -out: - return ret; -} - -static CLASS_DEVICE_ATTR(slaves, S_IRUGO | S_IWUSR, bonding_show_slaves, bonding_store_slaves); - -/* - * Show and set the bonding mode. The bond interface must be down to - * change the mode. - */ -static ssize_t bonding_show_mode(struct class_device *cd, char *buf) -{ - struct bonding *bond = to_bond(cd); - - return sprintf(buf, "%s %d\n", - bond_mode_tbl[bond->params.mode].modename, - bond->params.mode) + 1; -} - -static ssize_t bonding_store_mode(struct class_device *cd, const char *buf, size_t count) -{ - int new_value, ret = count; - struct bonding *bond = to_bond(cd); - - if (bond->dev->flags & IFF_UP) { - printk(KERN_ERR DRV_NAME - ": unable to update mode of %s because interface is up.\n", - bond->dev->name); - ret = -EPERM; - goto out; - } - - new_value = bond_parse_parm((char *)buf, bond_mode_tbl); - if (new_value < 0) { - printk(KERN_ERR DRV_NAME - ": %s: Ignoring invalid mode value %.*s.\n", - bond->dev->name, - (int)strlen(buf) - 1, buf); - ret = -EINVAL; - goto out; - } else { - bond->params.mode = new_value; - bond_set_mode_ops(bond, bond->params.mode); - printk(KERN_INFO DRV_NAME ": %s: setting mode to %s (%d).\n", - bond->dev->name, bond_mode_tbl[new_value].modename, new_value); - } -out: - return ret; -} -static CLASS_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, bonding_show_mode, bonding_store_mode); - -/* - * Show and set the bonding transmit hash method. The bond interface must be down to - * change the xmit hash policy. - */ -static ssize_t bonding_show_xmit_hash(struct class_device *cd, char *buf) -{ - int count; - struct bonding *bond = to_bond(cd); - - if ((bond->params.mode != BOND_MODE_XOR) && - (bond->params.mode != BOND_MODE_8023AD)) { - // Not Applicable - count = sprintf(buf, "NA\n") + 1; - } else { - count = sprintf(buf, "%s %d\n", - xmit_hashtype_tbl[bond->params.xmit_policy].modename, - bond->params.xmit_policy) + 1; - } - - return count; -} - -static ssize_t bonding_store_xmit_hash(struct class_device *cd, const char *buf, size_t count) -{ - int new_value, ret = count; - struct bonding *bond = to_bond(cd); - - if (bond->dev->flags & IFF_UP) { - printk(KERN_ERR DRV_NAME - "%s: Interface is up. Unable to update xmit policy.\n", - bond->dev->name); - ret = -EPERM; - goto out; - } - - if ((bond->params.mode != BOND_MODE_XOR) && - (bond->params.mode != BOND_MODE_8023AD)) { - printk(KERN_ERR DRV_NAME - "%s: Transmit hash policy is irrelevant in this mode.\n", - bond->dev->name); - ret = -EPERM; - goto out; - } - - new_value = bond_parse_parm((char *)buf, xmit_hashtype_tbl); - if (new_value < 0) { - printk(KERN_ERR DRV_NAME - ": %s: Ignoring invalid xmit hash policy value %.*s.\n", - bond->dev->name, - (int)strlen(buf) - 1, buf); - ret = -EINVAL; - goto out; - } else { - bond->params.xmit_policy = new_value; - bond_set_mode_ops(bond, bond->params.mode); - printk(KERN_INFO DRV_NAME ": %s: setting xmit hash policy to %s (%d).\n", - bond->dev->name, xmit_hashtype_tbl[new_value].modename, new_value); - } -out: - return ret; -} -static CLASS_DEVICE_ATTR(xmit_hash_policy, S_IRUGO | S_IWUSR, bonding_show_xmit_hash, bonding_store_xmit_hash); - -/* - * Show and set the arp timer interval. There are two tricky bits - * here. First, if ARP monitoring is activated, then we must disable - * MII monitoring. Second, if the ARP timer isn't running, we must - * start it. - */ -static ssize_t bonding_show_arp_interval(struct class_device *cd, char *buf) -{ - struct bonding *bond = to_bond(cd); - - return sprintf(buf, "%d\n", bond->params.arp_interval) + 1; -} - -static ssize_t bonding_store_arp_interval(struct class_device *cd, const char *buf, size_t count) -{ - int new_value, ret = count; - struct bonding *bond = to_bond(cd); - - if (sscanf(buf, "%d", &new_value) != 1) { - printk(KERN_ERR DRV_NAME - ": %s: no arp_interval value specified.\n", - bond->dev->name); - ret = -EINVAL; - goto out; - } - if (new_value < 0) { - printk(KERN_ERR DRV_NAME - ": %s: Invalid arp_interval value %d not in range 1-%d; rejected.\n", - bond->dev->name, new_value, INT_MAX); - ret = -EINVAL; - goto out; - } - - printk(KERN_INFO DRV_NAME - ": %s: Setting ARP monitoring interval to %d.\n", - bond->dev->name, new_value); - bond->params.arp_interval = new_value; - if (bond->params.miimon) { - printk(KERN_INFO DRV_NAME - ": %s: ARP monitoring cannot be used with MII monitoring. " - "%s Disabling MII monitoring.\n", - bond->dev->name, bond->dev->name); - bond->params.miimon = 0; - /* Kill MII timer, else it brings bond's link down */ - if (bond->arp_timer.function) { - printk(KERN_INFO DRV_NAME - ": %s: Kill MII timer, else it brings bond's link down...\n", - bond->dev->name); - del_timer_sync(&bond->mii_timer); - } - } - if (!bond->params.arp_targets[0]) { - printk(KERN_INFO DRV_NAME - ": %s: ARP monitoring has been set up, " - "but no ARP targets have been specified.\n", - bond->dev->name); - } - if (bond->dev->flags & IFF_UP) { - /* If the interface is up, we may need to fire off - * the ARP timer. If the interface is down, the - * timer will get fired off when the open function - * is called. - */ - if (bond->arp_timer.function) { - /* The timer's already set up, so fire it off */ - mod_timer(&bond->arp_timer, jiffies + 1); - } else { - /* Set up the timer. */ - init_timer(&bond->arp_timer); - bond->arp_timer.expires = jiffies + 1; - bond->arp_timer.data = - (unsigned long) bond->dev; - if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) { - bond->arp_timer.function = - (void *) - &bond_activebackup_arp_mon; - } else { - bond->arp_timer.function = - (void *) - &bond_loadbalance_arp_mon; - } - add_timer(&bond->arp_timer); - } - } - -out: - return ret; -} -static CLASS_DEVICE_ATTR(arp_interval, S_IRUGO | S_IWUSR , bonding_show_arp_interval, bonding_store_arp_interval); - -/* - * Show and set the arp targets. - */ -static ssize_t bonding_show_arp_targets(struct class_device *cd, char *buf) -{ - int i, res = 0; - struct bonding *bond = to_bond(cd); - - for (i = 0; i < BOND_MAX_ARP_TARGETS; i++) { - if (bond->params.arp_targets[i]) - res += sprintf(buf + res, "%u.%u.%u.%u ", - NIPQUAD(bond->params.arp_targets[i])); - } - if (res) - res--; /* eat the leftover space */ - res += sprintf(buf + res, "\n"); - res++; - return res; -} - -static ssize_t bonding_store_arp_targets(struct class_device *cd, const char *buf, size_t count) -{ - u32 newtarget; - int i = 0, done = 0, ret = count; - struct bonding *bond = to_bond(cd); - u32 *targets; - - targets = bond->params.arp_targets; - newtarget = in_aton(buf + 1); - /* look for adds */ - if (buf[0] == '+') { - if ((newtarget == 0) || (newtarget == INADDR_BROADCAST)) { - printk(KERN_ERR DRV_NAME - ": %s: invalid ARP target %u.%u.%u.%u specified for addition\n", - bond->dev->name, NIPQUAD(newtarget)); - ret = -EINVAL; - goto out; - } - /* look for an empty slot to put the target in, and check for dupes */ - for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { - if (targets[i] == newtarget) { /* duplicate */ - printk(KERN_ERR DRV_NAME - ": %s: ARP target %u.%u.%u.%u is already present\n", - bond->dev->name, NIPQUAD(newtarget)); - if (done) - targets[i] = 0; - ret = -EINVAL; - goto out; - } - if (targets[i] == 0 && !done) { - printk(KERN_INFO DRV_NAME - ": %s: adding ARP target %d.%d.%d.%d.\n", - bond->dev->name, NIPQUAD(newtarget)); - done = 1; - targets[i] = newtarget; - } - } - if (!done) { - printk(KERN_ERR DRV_NAME - ": %s: ARP target table is full!\n", - bond->dev->name); - ret = -EINVAL; - goto out; - } - - } - else if (buf[0] == '-') { - if ((newtarget == 0) || (newtarget == INADDR_BROADCAST)) { - printk(KERN_ERR DRV_NAME - ": %s: invalid ARP target %d.%d.%d.%d specified for removal\n", - bond->dev->name, NIPQUAD(newtarget)); - ret = -EINVAL; - goto out; - } - - for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { - if (targets[i] == newtarget) { - printk(KERN_INFO DRV_NAME - ": %s: removing ARP target %d.%d.%d.%d.\n", - bond->dev->name, NIPQUAD(newtarget)); - targets[i] = 0; - done = 1; - } - } - if (!done) { - printk(KERN_INFO DRV_NAME - ": %s: unable to remove nonexistent ARP target %d.%d.%d.%d.\n", - bond->dev->name, NIPQUAD(newtarget)); - ret = -EINVAL; - goto out; - } - } - else { - printk(KERN_ERR DRV_NAME ": no command found in arp_ip_targets file for bond %s. Use + or -.\n", - bond->dev->name); - ret = -EPERM; - goto out; - } - -out: - return ret; -} -static CLASS_DEVICE_ATTR(arp_ip_target, S_IRUGO | S_IWUSR , bonding_show_arp_targets, bonding_store_arp_targets); - -/* - * Show and set the up and down delays. These must be multiples of the - * MII monitoring value, and are stored internally as the multiplier. - * Thus, we must translate to MS for the real world. - */ -static ssize_t bonding_show_downdelay(struct class_device *cd, char *buf) -{ - struct bonding *bond = to_bond(cd); - - return sprintf(buf, "%d\n", bond->params.downdelay * bond->params.miimon) + 1; -} - -static ssize_t bonding_store_downdelay(struct class_device *cd, const char *buf, size_t count) -{ - int new_value, ret = count; - struct bonding *bond = to_bond(cd); - - if (!(bond->params.miimon)) { - printk(KERN_ERR DRV_NAME - ": %s: Unable to set down delay as MII monitoring is disabled\n", - bond->dev->name); - ret = -EPERM; - goto out; - } - - if (sscanf(buf, "%d", &new_value) != 1) { - printk(KERN_ERR DRV_NAME - ": %s: no down delay value specified.\n", - bond->dev->name); - ret = -EINVAL; - goto out; - } - if (new_value < 0) { - printk(KERN_ERR DRV_NAME - ": %s: Invalid down delay value %d not in range %d-%d; rejected.\n", - bond->dev->name, new_value, 1, INT_MAX); - ret = -EINVAL; - goto out; - } else { - if ((new_value % bond->params.miimon) != 0) { - printk(KERN_WARNING DRV_NAME - ": %s: Warning: down delay (%d) is not a multiple " - "of miimon (%d), delay rounded to %d ms\n", - bond->dev->name, new_value, bond->params.miimon, - (new_value / bond->params.miimon) * - bond->params.miimon); - } - bond->params.downdelay = new_value / bond->params.miimon; - printk(KERN_INFO DRV_NAME ": %s: Setting down delay to %d.\n", - bond->dev->name, bond->params.downdelay * bond->params.miimon); - - } - -out: - return ret; -} -static CLASS_DEVICE_ATTR(downdelay, S_IRUGO | S_IWUSR , bonding_show_downdelay, bonding_store_downdelay); - -static ssize_t bonding_show_updelay(struct class_device *cd, char *buf) -{ - struct bonding *bond = to_bond(cd); - - return sprintf(buf, "%d\n", bond->params.updelay * bond->params.miimon) + 1; - -} - -static ssize_t bonding_store_updelay(struct class_device *cd, const char *buf, size_t count) -{ - int new_value, ret = count; - struct bonding *bond = to_bond(cd); - - if (!(bond->params.miimon)) { - printk(KERN_ERR DRV_NAME - ": %s: Unable to set up delay as MII monitoring is disabled\n", - bond->dev->name); - ret = -EPERM; - goto out; - } - - if (sscanf(buf, "%d", &new_value) != 1) { - printk(KERN_ERR DRV_NAME - ": %s: no up delay value specified.\n", - bond->dev->name); - ret = -EINVAL; - goto out; - } - if (new_value < 0) { - printk(KERN_ERR DRV_NAME - ": %s: Invalid down delay value %d not in range %d-%d; rejected.\n", - bond->dev->name, new_value, 1, INT_MAX); - ret = -EINVAL; - goto out; - } else { - if ((new_value % bond->params.miimon) != 0) { - printk(KERN_WARNING DRV_NAME - ": %s: Warning: up delay (%d) is not a multiple " - "of miimon (%d), updelay rounded to %d ms\n", - bond->dev->name, new_value, bond->params.miimon, - (new_value / bond->params.miimon) * - bond->params.miimon); - } - bond->params.updelay = new_value / bond->params.miimon; - printk(KERN_INFO DRV_NAME ": %s: Setting up delay to %d.\n", - bond->dev->name, bond->params.updelay * bond->params.miimon); - - } - -out: - return ret; -} -static CLASS_DEVICE_ATTR(updelay, S_IRUGO | S_IWUSR , bonding_show_updelay, bonding_store_updelay); - -/* - * Show and set the LACP interval. Interface must be down, and the mode - * must be set to 802.3ad mode. - */ -static ssize_t bonding_show_lacp(struct class_device *cd, char *buf) -{ - struct bonding *bond = to_bond(cd); - - return sprintf(buf, "%s %d\n", - bond_lacp_tbl[bond->params.lacp_fast].modename, - bond->params.lacp_fast) + 1; -} - -static ssize_t bonding_store_lacp(struct class_device *cd, const char *buf, size_t count) -{ - int new_value, ret = count; - struct bonding *bond = to_bond(cd); - - if (bond->dev->flags & IFF_UP) { - printk(KERN_ERR DRV_NAME - ": %s: Unable to update LACP rate because interface is up.\n", - bond->dev->name); - ret = -EPERM; - goto out; - } - - if (bond->params.mode != BOND_MODE_8023AD) { - printk(KERN_ERR DRV_NAME - ": %s: Unable to update LACP rate because bond is not in 802.3ad mode.\n", - bond->dev->name); - ret = -EPERM; - goto out; - } - - new_value = bond_parse_parm((char *)buf, bond_lacp_tbl); - - if ((new_value == 1) || (new_value == 0)) { - bond->params.lacp_fast = new_value; - printk(KERN_INFO DRV_NAME - ": %s: Setting LACP rate to %s (%d).\n", - bond->dev->name, bond_lacp_tbl[new_value].modename, new_value); - } else { - printk(KERN_ERR DRV_NAME - ": %s: Ignoring invalid LACP rate value %.*s.\n", - bond->dev->name, (int)strlen(buf) - 1, buf); - ret = -EINVAL; - } -out: - return ret; -} -static CLASS_DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR, bonding_show_lacp, bonding_store_lacp); - -/* - * Show and set the MII monitor interval. There are two tricky bits - * here. First, if MII monitoring is activated, then we must disable - * ARP monitoring. Second, if the timer isn't running, we must - * start it. - */ -static ssize_t bonding_show_miimon(struct class_device *cd, char *buf) -{ - struct bonding *bond = to_bond(cd); - - return sprintf(buf, "%d\n", bond->params.miimon) + 1; -} - -static ssize_t bonding_store_miimon(struct class_device *cd, const char *buf, size_t count) -{ - int new_value, ret = count; - struct bonding *bond = to_bond(cd); - - if (sscanf(buf, "%d", &new_value) != 1) { - printk(KERN_ERR DRV_NAME - ": %s: no miimon value specified.\n", - bond->dev->name); - ret = -EINVAL; - goto out; - } - if (new_value < 0) { - printk(KERN_ERR DRV_NAME - ": %s: Invalid miimon value %d not in range %d-%d; rejected.\n", - bond->dev->name, new_value, 1, INT_MAX); - ret = -EINVAL; - goto out; - } else { - printk(KERN_INFO DRV_NAME - ": %s: Setting MII monitoring interval to %d.\n", - bond->dev->name, new_value); - bond->params.miimon = new_value; - if(bond->params.updelay) - printk(KERN_INFO DRV_NAME - ": %s: Note: Updating updelay (to %d) " - "since it is a multiple of the miimon value.\n", - bond->dev->name, - bond->params.updelay * bond->params.miimon); - if(bond->params.downdelay) - printk(KERN_INFO DRV_NAME - ": %s: Note: Updating downdelay (to %d) " - "since it is a multiple of the miimon value.\n", - bond->dev->name, - bond->params.downdelay * bond->params.miimon); - if (bond->params.arp_interval) { - printk(KERN_INFO DRV_NAME - ": %s: MII monitoring cannot be used with " - "ARP monitoring. Disabling ARP monitoring...\n", - bond->dev->name); - bond->params.arp_interval = 0; - /* Kill ARP timer, else it brings bond's link down */ - if (bond->mii_timer.function) { - printk(KERN_INFO DRV_NAME - ": %s: Kill ARP timer, else it brings bond's link down...\n", - bond->dev->name); - del_timer_sync(&bond->arp_timer); - } - } - - if (bond->dev->flags & IFF_UP) { - /* If the interface is up, we may need to fire off - * the MII timer. If the interface is down, the - * timer will get fired off when the open function - * is called. - */ - if (bond->mii_timer.function) { - /* The timer's already set up, so fire it off */ - mod_timer(&bond->mii_timer, jiffies + 1); - } else { - /* Set up the timer. */ - init_timer(&bond->mii_timer); - bond->mii_timer.expires = jiffies + 1; - bond->mii_timer.data = - (unsigned long) bond->dev; - bond->mii_timer.function = - (void *) &bond_mii_monitor; - add_timer(&bond->mii_timer); - } - } - } -out: - return ret; -} -static CLASS_DEVICE_ATTR(miimon, S_IRUGO | S_IWUSR, bonding_show_miimon, bonding_store_miimon); - -/* - * Show and set the primary slave. The store function is much - * simpler than bonding_store_slaves function because it only needs to - * handle one interface name. - * The bond must be a mode that supports a primary for this be - * set. - */ -static ssize_t bonding_show_primary(struct class_device *cd, char *buf) -{ - int count = 0; - struct bonding *bond = to_bond(cd); - - if (bond->primary_slave) - count = sprintf(buf, "%s\n", bond->primary_slave->dev->name) + 1; - else - count = sprintf(buf, "\n") + 1; - - return count; -} - -static ssize_t bonding_store_primary(struct class_device *cd, const char *buf, size_t count) -{ - int i; - struct slave *slave; - struct bonding *bond = to_bond(cd); - - write_lock_bh(&bond->lock); - if (!USES_PRIMARY(bond->params.mode)) { - printk(KERN_INFO DRV_NAME - ": %s: Unable to set primary slave; %s is in mode %d\n", - bond->dev->name, bond->dev->name, bond->params.mode); - } else { - bond_for_each_slave(bond, slave, i) { - if (strnicmp - (slave->dev->name, buf, - strlen(slave->dev->name)) == 0) { - printk(KERN_INFO DRV_NAME - ": %s: Setting %s as primary slave.\n", - bond->dev->name, slave->dev->name); - bond->primary_slave = slave; - bond_select_active_slave(bond); - goto out; - } - } - - /* if we got here, then we didn't match the name of any slave */ - - if (strlen(buf) == 0 || buf[0] == '\n') { - printk(KERN_INFO DRV_NAME - ": %s: Setting primary slave to None.\n", - bond->dev->name); - bond->primary_slave = 0; - bond_select_active_slave(bond); - } else { - printk(KERN_INFO DRV_NAME - ": %s: Unable to set %.*s as primary slave as it is not a slave.\n", - bond->dev->name, (int)strlen(buf) - 1, buf); - } - } -out: - write_unlock_bh(&bond->lock); - return count; -} -static CLASS_DEVICE_ATTR(primary, S_IRUGO | S_IWUSR, bonding_show_primary, bonding_store_primary); - -/* - * Show and set the use_carrier flag. - */ -static ssize_t bonding_show_carrier(struct class_device *cd, char *buf) -{ - struct bonding *bond = to_bond(cd); - - return sprintf(buf, "%d\n", bond->params.use_carrier) + 1; -} - -static ssize_t bonding_store_carrier(struct class_device *cd, const char *buf, size_t count) -{ - int new_value, ret = count; - struct bonding *bond = to_bond(cd); - - - if (sscanf(buf, "%d", &new_value) != 1) { - printk(KERN_ERR DRV_NAME - ": %s: no use_carrier value specified.\n", - bond->dev->name); - ret = -EINVAL; - goto out; - } - if ((new_value == 0) || (new_value == 1)) { - bond->params.use_carrier = new_value; - printk(KERN_INFO DRV_NAME ": %s: Setting use_carrier to %d.\n", - bond->dev->name, new_value); - } else { - printk(KERN_INFO DRV_NAME - ": %s: Ignoring invalid use_carrier value %d.\n", - bond->dev->name, new_value); - } -out: - return count; -} -static CLASS_DEVICE_ATTR(use_carrier, S_IRUGO | S_IWUSR, bonding_show_carrier, bonding_store_carrier); - - -/* - * Show and set currently active_slave. - */ -static ssize_t bonding_show_active_slave(struct class_device *cd, char *buf) -{ - struct slave *curr; - struct bonding *bond = to_bond(cd); - int count; - - - read_lock(&bond->curr_slave_lock); - curr = bond->curr_active_slave; - read_unlock(&bond->curr_slave_lock); - - if (USES_PRIMARY(bond->params.mode) && curr) - count = sprintf(buf, "%s\n", curr->dev->name) + 1; - else - count = sprintf(buf, "\n") + 1; - return count; -} - -static ssize_t bonding_store_active_slave(struct class_device *cd, const char *buf, size_t count) -{ - int i; - struct slave *slave; - struct slave *old_active = NULL; - struct slave *new_active = NULL; - struct bonding *bond = to_bond(cd); - - write_lock_bh(&bond->lock); - if (!USES_PRIMARY(bond->params.mode)) { - printk(KERN_INFO DRV_NAME - ": %s: Unable to change active slave; %s is in mode %d\n", - bond->dev->name, bond->dev->name, bond->params.mode); - } else { - bond_for_each_slave(bond, slave, i) { - if (strnicmp - (slave->dev->name, buf, - strlen(slave->dev->name)) == 0) { - old_active = bond->curr_active_slave; - new_active = slave; - if (new_active && (new_active == old_active)) { - /* do nothing */ - printk(KERN_INFO DRV_NAME - ": %s: %s is already the current active slave.\n", - bond->dev->name, slave->dev->name); - goto out; - } - else { - if ((new_active) && - (old_active) && - (new_active->link == BOND_LINK_UP) && - IS_UP(new_active->dev)) { - printk(KERN_INFO DRV_NAME - ": %s: Setting %s as active slave.\n", - bond->dev->name, slave->dev->name); - bond_change_active_slave(bond, new_active); - } - else { - printk(KERN_INFO DRV_NAME - ": %s: Could not set %s as active slave; " - "either %s is down or the link is down.\n", - bond->dev->name, slave->dev->name, - slave->dev->name); - } - goto out; - } - } - } - - /* if we got here, then we didn't match the name of any slave */ - - if (strlen(buf) == 0 || buf[0] == '\n') { - printk(KERN_INFO DRV_NAME - ": %s: Setting active slave to None.\n", - bond->dev->name); - bond->primary_slave = 0; - bond_select_active_slave(bond); - } else { - printk(KERN_INFO DRV_NAME - ": %s: Unable to set %.*s as active slave as it is not a slave.\n", - bond->dev->name, (int)strlen(buf) - 1, buf); - } - } -out: - write_unlock_bh(&bond->lock); - return count; - -} -static CLASS_DEVICE_ATTR(active_slave, S_IRUGO | S_IWUSR, bonding_show_active_slave, bonding_store_active_slave); - - -/* - * Show link status of the bond interface. - */ -static ssize_t bonding_show_mii_status(struct class_device *cd, char *buf) -{ - struct slave *curr; - struct bonding *bond = to_bond(cd); - - read_lock(&bond->curr_slave_lock); - curr = bond->curr_active_slave; - read_unlock(&bond->curr_slave_lock); - - return sprintf(buf, "%s\n", (curr) ? "up" : "down") + 1; -} -static CLASS_DEVICE_ATTR(mii_status, S_IRUGO, bonding_show_mii_status, NULL); - - -/* - * Show current 802.3ad aggregator ID. - */ -static ssize_t bonding_show_ad_aggregator(struct class_device *cd, char *buf) -{ - int count = 0; - struct bonding *bond = to_bond(cd); - - if (bond->params.mode == BOND_MODE_8023AD) { - struct ad_info ad_info; - count = sprintf(buf, "%d\n", (bond_3ad_get_active_agg_info(bond, &ad_info)) ? 0 : ad_info.aggregator_id) + 1; - } - else - count = sprintf(buf, "\n") + 1; - - return count; -} -static CLASS_DEVICE_ATTR(ad_aggregator, S_IRUGO, bonding_show_ad_aggregator, NULL); - - -/* - * Show number of active 802.3ad ports. - */ -static ssize_t bonding_show_ad_num_ports(struct class_device *cd, char *buf) -{ - int count = 0; - struct bonding *bond = to_bond(cd); - - if (bond->params.mode == BOND_MODE_8023AD) { - struct ad_info ad_info; - count = sprintf(buf, "%d\n", (bond_3ad_get_active_agg_info(bond, &ad_info)) ? 0: ad_info.ports) + 1; - } - else - count = sprintf(buf, "\n") + 1; - - return count; -} -static CLASS_DEVICE_ATTR(ad_num_ports, S_IRUGO, bonding_show_ad_num_ports, NULL); - - -/* - * Show current 802.3ad actor key. - */ -static ssize_t bonding_show_ad_actor_key(struct class_device *cd, char *buf) -{ - int count = 0; - struct bonding *bond = to_bond(cd); - - if (bond->params.mode == BOND_MODE_8023AD) { - struct ad_info ad_info; - count = sprintf(buf, "%d\n", (bond_3ad_get_active_agg_info(bond, &ad_info)) ? 0 : ad_info.actor_key) + 1; - } - else - count = sprintf(buf, "\n") + 1; - - return count; -} -static CLASS_DEVICE_ATTR(ad_actor_key, S_IRUGO, bonding_show_ad_actor_key, NULL); - - -/* - * Show current 802.3ad partner key. - */ -static ssize_t bonding_show_ad_partner_key(struct class_device *cd, char *buf) -{ - int count = 0; - struct bonding *bond = to_bond(cd); - - if (bond->params.mode == BOND_MODE_8023AD) { - struct ad_info ad_info; - count = sprintf(buf, "%d\n", (bond_3ad_get_active_agg_info(bond, &ad_info)) ? 0 : ad_info.partner_key) + 1; - } - else - count = sprintf(buf, "\n") + 1; - - return count; -} -static CLASS_DEVICE_ATTR(ad_partner_key, S_IRUGO, bonding_show_ad_partner_key, NULL); - - -/* - * Show current 802.3ad partner mac. - */ -static ssize_t bonding_show_ad_partner_mac(struct class_device *cd, char *buf) -{ - int count = 0; - struct bonding *bond = to_bond(cd); - - if (bond->params.mode == BOND_MODE_8023AD) { - struct ad_info ad_info; - if (!bond_3ad_get_active_agg_info(bond, &ad_info)) { - count = sprintf(buf,"%02x:%02x:%02x:%02x:%02x:%02x\n", - ad_info.partner_system[0], - ad_info.partner_system[1], - ad_info.partner_system[2], - ad_info.partner_system[3], - ad_info.partner_system[4], - ad_info.partner_system[5]) + 1; - } - } - else - count = sprintf(buf, "\n") + 1; - - return count; -} -static CLASS_DEVICE_ATTR(ad_partner_mac, S_IRUGO, bonding_show_ad_partner_mac, NULL); - - - -static struct attribute *per_bond_attrs[] = { - &class_device_attr_slaves.attr, - &class_device_attr_mode.attr, - &class_device_attr_arp_interval.attr, - &class_device_attr_arp_ip_target.attr, - &class_device_attr_downdelay.attr, - &class_device_attr_updelay.attr, - &class_device_attr_lacp_rate.attr, - &class_device_attr_xmit_hash_policy.attr, - &class_device_attr_miimon.attr, - &class_device_attr_primary.attr, - &class_device_attr_use_carrier.attr, - &class_device_attr_active_slave.attr, - &class_device_attr_mii_status.attr, - &class_device_attr_ad_aggregator.attr, - &class_device_attr_ad_num_ports.attr, - &class_device_attr_ad_actor_key.attr, - &class_device_attr_ad_partner_key.attr, - &class_device_attr_ad_partner_mac.attr, - NULL, -}; - -static struct attribute_group bonding_group = { - .name = "bonding", - .attrs = per_bond_attrs, -}; - -/* - * Initialize sysfs. This sets up the bonding_masters file in - * /sys/class/net. - */ -int bond_create_sysfs(void) -{ - int ret = 0; - struct bonding *firstbond; - - init_rwsem(&bonding_rwsem); - - /* get the netdev class pointer */ - firstbond = container_of(bond_dev_list.next, struct bonding, bond_list); - if (!firstbond) - return -ENODEV; - - netdev_class = firstbond->dev->class_dev.class; - if (!netdev_class) - return -ENODEV; - - ret = class_create_file(netdev_class, &class_attr_bonding_masters); - - return ret; - -} - -/* - * Remove /sys/class/net/bonding_masters. - */ -void bond_destroy_sysfs(void) -{ - if (netdev_class) - class_remove_file(netdev_class, &class_attr_bonding_masters); -} - -/* - * Initialize sysfs for each bond. This sets up and registers - * the 'bondctl' directory for each individual bond under /sys/class/net. - */ -int bond_create_sysfs_entry(struct bonding *bond) -{ - struct net_device *dev = bond->dev; - int err; - - err = sysfs_create_group(&(dev->class_dev.kobj), &bonding_group); - if (err) { - printk(KERN_EMERG "eek! didn't create group!\n"); - } - - if (expected_refcount < 1) - expected_refcount = atomic_read(&bond->dev->class_dev.kobj.kref.refcount); - - return err; -} -/* - * Remove sysfs entries for each bond. - */ -void bond_destroy_sysfs_entry(struct bonding *bond) -{ - struct net_device *dev = bond->dev; - - sysfs_remove_group(&(dev->class_dev.kobj), &bonding_group); -} - diff --git a/trunk/drivers/net/bonding/bonding.h b/trunk/drivers/net/bonding/bonding.h index 015c7f1d1bc0..1433e91db0f7 100644 --- a/trunk/drivers/net/bonding/bonding.h +++ b/trunk/drivers/net/bonding/bonding.h @@ -10,6 +10,25 @@ * This software may be used and distributed according to the terms * of the GNU Public License, incorporated herein by reference. * + * + * 2003/03/18 - Amir Noam , + * Tsippy Mendelson and + * Shmulik Hen + * - Added support for IEEE 802.3ad Dynamic link aggregation mode. + * + * 2003/05/01 - Tsippy Mendelson and + * Amir Noam + * - Code beautification and style changes (mainly in comments). + * + * 2003/05/01 - Shmulik Hen + * - Added support for Transmit load balancing mode. + * + * 2003/12/01 - Shmulik Hen + * - Code cleanup and style changes + * + * 2005/05/05 - Jason Gabler + * - added "xmit_policy" kernel parameter for alternate hashing policy + * support for mode 2 */ #ifndef _LINUX_BONDING_H @@ -18,12 +37,11 @@ #include #include #include -#include #include "bond_3ad.h" #include "bond_alb.h" -#define DRV_VERSION "3.0.0" -#define DRV_RELDATE "November 8, 2005" +#define DRV_VERSION "2.6.5" +#define DRV_RELDATE "November 4, 2005" #define DRV_NAME "bonding" #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" @@ -134,11 +152,6 @@ struct bond_params { u32 arp_targets[BOND_MAX_ARP_TARGETS]; }; -struct bond_parm_tbl { - char *modename; - int mode; -}; - struct vlan_entry { struct list_head vlan_list; u32 vlan_ip; @@ -146,7 +159,7 @@ struct vlan_entry { }; struct slave { - struct net_device *dev; /* first - useful for panic debug */ + struct net_device *dev; /* first - usefull for panic debug */ struct slave *next; struct slave *prev; s16 delay; @@ -172,7 +185,7 @@ struct slave { * beforehand. */ struct bonding { - struct net_device *dev; /* first - useful for panic debug */ + struct net_device *dev; /* first - usefull for panic debug */ struct slave *first_slave; struct slave *curr_active_slave; struct slave *current_arp_slave; @@ -242,25 +255,6 @@ extern inline void bond_set_slave_active_flags(struct slave *slave) struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr); int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); -int bond_create(char *name, struct bond_params *params, struct bonding **newbond); -void bond_deinit(struct net_device *bond_dev); -int bond_create_sysfs(void); -void bond_destroy_sysfs(void); -void bond_destroy_sysfs_entry(struct bonding *bond); -int bond_create_sysfs_entry(struct bonding *bond); -int bond_create_slave_symlinks(struct net_device *master, struct net_device *slave); -void bond_destroy_slave_symlinks(struct net_device *master, struct net_device *slave); -int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev); -int bond_release(struct net_device *bond_dev, struct net_device *slave_dev); -int bond_sethwaddr(struct net_device *bond_dev, struct net_device *slave_dev); -void bond_mii_monitor(struct net_device *bond_dev); -void bond_loadbalance_arp_mon(struct net_device *bond_dev); -void bond_activebackup_arp_mon(struct net_device *bond_dev); -void bond_set_mode_ops(struct bonding *bond, int mode); -int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl); -const char *bond_mode_name(int mode); -void bond_select_active_slave(struct bonding *bond); -void bond_change_active_slave(struct bonding *bond, struct slave *new_active); #endif /* _LINUX_BONDING_H */ diff --git a/trunk/drivers/net/chelsio/sge.c b/trunk/drivers/net/chelsio/sge.c index 2c5b849b7ba4..53b41d99b00b 100644 --- a/trunk/drivers/net/chelsio/sge.c +++ b/trunk/drivers/net/chelsio/sge.c @@ -1332,8 +1332,8 @@ intr_handler_t t1_select_intr_handler(adapter_t *adapter) * * This runs with softirqs disabled. */ -static int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter, - unsigned int qid, struct net_device *dev) +unsigned int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter, + unsigned int qid, struct net_device *dev) { struct sge *sge = adapter->sge; struct cmdQ *q = &sge->cmdQ[qid]; @@ -1352,10 +1352,9 @@ static int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter, set_bit(dev->if_port, &sge->stopped_tx_queues); sge->stats.cmdQ_full[3]++; spin_unlock(&q->lock); - if (!netif_queue_stopped(dev)) - CH_ERR("%s: Tx ring full while queue awake!\n", - adapter->name); - return NETDEV_TX_BUSY; + CH_ERR("%s: Tx ring full while queue awake!\n", + adapter->name); + return 1; } if (unlikely(credits - count < q->stop_thres)) { sge->stats.cmdQ_full[3]++; @@ -1390,7 +1389,7 @@ static int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter, writel(F_CMDQ0_ENABLE, adapter->regs + A_SG_DOORBELL); } } - return NETDEV_TX_OK; + return 0; } #define MK_ETH_TYPE_MSS(type, mss) (((mss) & 0x3FFF) | ((type) << 14)) @@ -1450,7 +1449,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) if (unlikely(skb->len < ETH_HLEN || skb->len > dev->mtu + eth_hdr_len(skb->data))) { dev_kfree_skb_any(skb); - return NETDEV_TX_OK; + return NET_XMIT_SUCCESS; } /* @@ -1468,7 +1467,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) skb = skb_realloc_headroom(skb, sizeof(*cpl)); dev_kfree_skb_any(orig_skb); if (!skb) - return NETDEV_TX_OK; + return -ENOMEM; } if (!(adapter->flags & UDP_CSUM_CAPABLE) && @@ -1476,7 +1475,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) skb->nh.iph->protocol == IPPROTO_UDP) if (unlikely(skb_checksum_help(skb, 0))) { dev_kfree_skb_any(skb); - return NETDEV_TX_OK; + return -ENOMEM; } /* Hmmm, assuming to catch the gratious arp... and we'll use diff --git a/trunk/drivers/net/chelsio/sge.h b/trunk/drivers/net/chelsio/sge.h index 6d0d24a6364f..434b25586851 100644 --- a/trunk/drivers/net/chelsio/sge.h +++ b/trunk/drivers/net/chelsio/sge.h @@ -89,6 +89,8 @@ int t1_sge_configure(struct sge *, struct sge_params *); int t1_sge_set_coalesce_params(struct sge *, struct sge_params *); void t1_sge_destroy(struct sge *); intr_handler_t t1_select_intr_handler(adapter_t *adapter); +unsigned int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter, + unsigned int qid, struct net_device *netdev); int t1_start_xmit(struct sk_buff *skb, struct net_device *dev); void t1_set_vlan_accel(struct adapter *adapter, int on_off); void t1_sge_start(struct sge *); diff --git a/trunk/drivers/net/dgrs.c b/trunk/drivers/net/dgrs.c index 70b47e4c4e9c..2a290cc397ad 100644 --- a/trunk/drivers/net/dgrs.c +++ b/trunk/drivers/net/dgrs.c @@ -1458,8 +1458,6 @@ static struct pci_driver dgrs_pci_driver = { .probe = dgrs_pci_probe, .remove = __devexit_p(dgrs_pci_remove), }; -#else -static struct pci_driver dgrs_pci_driver = {}; #endif diff --git a/trunk/drivers/net/e100.c b/trunk/drivers/net/e100.c index 22cd04556707..7a6aeae2c9fa 100644 --- a/trunk/drivers/net/e100.c +++ b/trunk/drivers/net/e100.c @@ -156,7 +156,7 @@ #define DRV_NAME "e100" #define DRV_EXT "-NAPI" -#define DRV_VERSION "3.4.14-k4"DRV_EXT +#define DRV_VERSION "3.4.14-k2"DRV_EXT #define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver" #define DRV_COPYRIGHT "Copyright(c) 1999-2005 Intel Corporation" #define PFX DRV_NAME ": " @@ -903,8 +903,8 @@ static void mdio_write(struct net_device *netdev, int addr, int reg, int data) static void e100_get_defaults(struct nic *nic) { - struct param_range rfds = { .min = 16, .max = 256, .count = 256 }; - struct param_range cbs = { .min = 64, .max = 256, .count = 128 }; + struct param_range rfds = { .min = 16, .max = 256, .count = 64 }; + struct param_range cbs = { .min = 64, .max = 256, .count = 64 }; pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id); /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ @@ -1007,264 +1007,25 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb) c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]); } -/********************************************************/ -/* Micro code for 8086:1229 Rev 8 */ -/********************************************************/ - -/* Parameter values for the D101M B-step */ -#define D101M_CPUSAVER_TIMER_DWORD 78 -#define D101M_CPUSAVER_BUNDLE_DWORD 65 -#define D101M_CPUSAVER_MIN_SIZE_DWORD 126 - -#define D101M_B_RCVBUNDLE_UCODE \ -{\ -0x00550215, 0xFFFF0437, 0xFFFFFFFF, 0x06A70789, 0xFFFFFFFF, 0x0558FFFF, \ -0x000C0001, 0x00101312, 0x000C0008, 0x00380216, \ -0x0010009C, 0x00204056, 0x002380CC, 0x00380056, \ -0x0010009C, 0x00244C0B, 0x00000800, 0x00124818, \ -0x00380438, 0x00000000, 0x00140000, 0x00380555, \ -0x00308000, 0x00100662, 0x00100561, 0x000E0408, \ -0x00134861, 0x000C0002, 0x00103093, 0x00308000, \ -0x00100624, 0x00100561, 0x000E0408, 0x00100861, \ -0x000C007E, 0x00222C21, 0x000C0002, 0x00103093, \ -0x00380C7A, 0x00080000, 0x00103090, 0x00380C7A, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x0010009C, 0x00244C2D, 0x00010004, 0x00041000, \ -0x003A0437, 0x00044010, 0x0038078A, 0x00000000, \ -0x00100099, 0x00206C7A, 0x0010009C, 0x00244C48, \ -0x00130824, 0x000C0001, 0x00101213, 0x00260C75, \ -0x00041000, 0x00010004, 0x00130826, 0x000C0006, \ -0x002206A8, 0x0013C926, 0x00101313, 0x003806A8, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00080600, 0x00101B10, 0x00050004, 0x00100826, \ -0x00101210, 0x00380C34, 0x00000000, 0x00000000, \ -0x0021155B, 0x00100099, 0x00206559, 0x0010009C, \ -0x00244559, 0x00130836, 0x000C0000, 0x00220C62, \ -0x000C0001, 0x00101B13, 0x00229C0E, 0x00210C0E, \ -0x00226C0E, 0x00216C0E, 0x0022FC0E, 0x00215C0E, \ -0x00214C0E, 0x00380555, 0x00010004, 0x00041000, \ -0x00278C67, 0x00040800, 0x00018100, 0x003A0437, \ -0x00130826, 0x000C0001, 0x00220559, 0x00101313, \ -0x00380559, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00130831, 0x0010090B, 0x00124813, \ -0x000CFF80, 0x002606AB, 0x00041000, 0x00010004, \ -0x003806A8, 0x00000000, 0x00000000, 0x00000000, \ -} - -/********************************************************/ -/* Micro code for 8086:1229 Rev 9 */ -/********************************************************/ - -/* Parameter values for the D101S */ -#define D101S_CPUSAVER_TIMER_DWORD 78 -#define D101S_CPUSAVER_BUNDLE_DWORD 67 -#define D101S_CPUSAVER_MIN_SIZE_DWORD 128 - -#define D101S_RCVBUNDLE_UCODE \ -{\ -0x00550242, 0xFFFF047E, 0xFFFFFFFF, 0x06FF0818, 0xFFFFFFFF, 0x05A6FFFF, \ -0x000C0001, 0x00101312, 0x000C0008, 0x00380243, \ -0x0010009C, 0x00204056, 0x002380D0, 0x00380056, \ -0x0010009C, 0x00244F8B, 0x00000800, 0x00124818, \ -0x0038047F, 0x00000000, 0x00140000, 0x003805A3, \ -0x00308000, 0x00100610, 0x00100561, 0x000E0408, \ -0x00134861, 0x000C0002, 0x00103093, 0x00308000, \ -0x00100624, 0x00100561, 0x000E0408, 0x00100861, \ -0x000C007E, 0x00222FA1, 0x000C0002, 0x00103093, \ -0x00380F90, 0x00080000, 0x00103090, 0x00380F90, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x0010009C, 0x00244FAD, 0x00010004, 0x00041000, \ -0x003A047E, 0x00044010, 0x00380819, 0x00000000, \ -0x00100099, 0x00206FFD, 0x0010009A, 0x0020AFFD, \ -0x0010009C, 0x00244FC8, 0x00130824, 0x000C0001, \ -0x00101213, 0x00260FF7, 0x00041000, 0x00010004, \ -0x00130826, 0x000C0006, 0x00220700, 0x0013C926, \ -0x00101313, 0x00380700, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00080600, 0x00101B10, 0x00050004, 0x00100826, \ -0x00101210, 0x00380FB6, 0x00000000, 0x00000000, \ -0x002115A9, 0x00100099, 0x002065A7, 0x0010009A, \ -0x0020A5A7, 0x0010009C, 0x002445A7, 0x00130836, \ -0x000C0000, 0x00220FE4, 0x000C0001, 0x00101B13, \ -0x00229F8E, 0x00210F8E, 0x00226F8E, 0x00216F8E, \ -0x0022FF8E, 0x00215F8E, 0x00214F8E, 0x003805A3, \ -0x00010004, 0x00041000, 0x00278FE9, 0x00040800, \ -0x00018100, 0x003A047E, 0x00130826, 0x000C0001, \ -0x002205A7, 0x00101313, 0x003805A7, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00130831, \ -0x0010090B, 0x00124813, 0x000CFF80, 0x00260703, \ -0x00041000, 0x00010004, 0x00380700 \ -} - -/********************************************************/ -/* Micro code for the 8086:1229 Rev F/10 */ -/********************************************************/ - -/* Parameter values for the D102 E-step */ -#define D102_E_CPUSAVER_TIMER_DWORD 42 -#define D102_E_CPUSAVER_BUNDLE_DWORD 54 -#define D102_E_CPUSAVER_MIN_SIZE_DWORD 46 - -#define D102_E_RCVBUNDLE_UCODE \ -{\ -0x007D028F, 0x0E4204F9, 0x14ED0C85, 0x14FA14E9, 0x0EF70E36, 0x1FFF1FFF, \ -0x00E014B9, 0x00000000, 0x00000000, 0x00000000, \ -0x00E014BD, 0x00000000, 0x00000000, 0x00000000, \ -0x00E014D5, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00E014C1, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00E014C8, 0x00000000, 0x00000000, 0x00000000, \ -0x00200600, 0x00E014EE, 0x00000000, 0x00000000, \ -0x0030FF80, 0x00940E46, 0x00038200, 0x00102000, \ -0x00E00E43, 0x00000000, 0x00000000, 0x00000000, \ -0x00300006, 0x00E014FB, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00906E41, 0x00800E3C, 0x00E00E39, 0x00000000, \ -0x00906EFD, 0x00900EFD, 0x00E00EF8, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -0x00000000, 0x00000000, 0x00000000, 0x00000000, \ -} - static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb) { -/* *INDENT-OFF* */ - static struct { - u32 ucode[UCODE_SIZE + 1]; - u8 mac; - u8 timer_dword; - u8 bundle_dword; - u8 min_size_dword; - } ucode_opts[] = { - { D101M_B_RCVBUNDLE_UCODE, - mac_82559_D101M, - D101M_CPUSAVER_TIMER_DWORD, - D101M_CPUSAVER_BUNDLE_DWORD, - D101M_CPUSAVER_MIN_SIZE_DWORD }, - { D101S_RCVBUNDLE_UCODE, - mac_82559_D101S, - D101S_CPUSAVER_TIMER_DWORD, - D101S_CPUSAVER_BUNDLE_DWORD, - D101S_CPUSAVER_MIN_SIZE_DWORD }, - { D102_E_RCVBUNDLE_UCODE, - mac_82551_F, - D102_E_CPUSAVER_TIMER_DWORD, - D102_E_CPUSAVER_BUNDLE_DWORD, - D102_E_CPUSAVER_MIN_SIZE_DWORD }, - { D102_E_RCVBUNDLE_UCODE, - mac_82551_10, - D102_E_CPUSAVER_TIMER_DWORD, - D102_E_CPUSAVER_BUNDLE_DWORD, - D102_E_CPUSAVER_MIN_SIZE_DWORD }, - { {0}, 0, 0, 0, 0} - }, *opts; -/* *INDENT-ON* */ - -/************************************************************************* -* CPUSaver parameters -* -* All CPUSaver parameters are 16-bit literals that are part of a -* "move immediate value" instruction. By changing the value of -* the literal in the instruction before the code is loaded, the -* driver can change the algorithm. -* -* INTDELAY - This loads the dead-man timer with its inital value. -* When this timer expires the interrupt is asserted, and the -* timer is reset each time a new packet is received. (see -* BUNDLEMAX below to set the limit on number of chained packets) -* The current default is 0x600 or 1536. Experiments show that -* the value should probably stay within the 0x200 - 0x1000. -* -* BUNDLEMAX - -* This sets the maximum number of frames that will be bundled. In -* some situations, such as the TCP windowing algorithm, it may be -* better to limit the growth of the bundle size than let it go as -* high as it can, because that could cause too much added latency. -* The default is six, because this is the number of packets in the -* default TCP window size. A value of 1 would make CPUSaver indicate -* an interrupt for every frame received. If you do not want to put -* a limit on the bundle size, set this value to xFFFF. -* -* BUNDLESMALL - -* This contains a bit-mask describing the minimum size frame that -* will be bundled. The default masks the lower 7 bits, which means -* that any frame less than 128 bytes in length will not be bundled, -* but will instead immediately generate an interrupt. This does -* not affect the current bundle in any way. Any frame that is 128 -* bytes or large will be bundled normally. This feature is meant -* to provide immediate indication of ACK frames in a TCP environment. -* Customers were seeing poor performance when a machine with CPUSaver -* enabled was sending but not receiving. The delay introduced when -* the ACKs were received was enough to reduce total throughput, because -* the sender would sit idle until the ACK was finally seen. -* -* The current default is 0xFF80, which masks out the lower 7 bits. -* This means that any frame which is x7F (127) bytes or smaller -* will cause an immediate interrupt. Because this value must be a -* bit mask, there are only a few valid values that can be used. To -* turn this feature off, the driver can write the value xFFFF to the -* lower word of this instruction (in the same way that the other -* parameters are used). Likewise, a value of 0xF800 (2047) would -* cause an interrupt to be generated for every frame, because all -* standard Ethernet frames are <= 2047 bytes in length. -*************************************************************************/ - -/* if you wish to disable the ucode functionality, while maintaining the - * workarounds it provides, set the following defines to: - * BUNDLESMALL 0 - * BUNDLEMAX 1 - * INTDELAY 1 - */ -#define BUNDLESMALL 1 -#define BUNDLEMAX (u16)6 -#define INTDELAY (u16)1536 /* 0x600 */ - - /* do not load u-code for ICH devices */ - if (nic->flags & ich) - goto noloaducode; - - /* Search for ucode match against h/w rev_id */ - for (opts = ucode_opts; opts->mac; opts++) { - int i; - u32 *ucode = opts->ucode; - if (nic->mac != opts->mac) - continue; - - /* Insert user-tunable settings */ - ucode[opts->timer_dword] &= 0xFFFF0000; - ucode[opts->timer_dword] |= INTDELAY; - ucode[opts->bundle_dword] &= 0xFFFF0000; - ucode[opts->bundle_dword] |= BUNDLEMAX; - ucode[opts->min_size_dword] &= 0xFFFF0000; - ucode[opts->min_size_dword] |= (BUNDLESMALL) ? 0xFFFF : 0xFF80; - - for (i = 0; i < UCODE_SIZE; i++) + int i; + static const u32 ucode[UCODE_SIZE] = { + /* NFS packets are misinterpreted as TCO packets and + * incorrectly routed to the BMC over SMBus. This + * microcode patch checks the fragmented IP bit in the + * NFS/UDP header to distinguish between NFS and TCO. */ + 0x0EF70E36, 0x1FFF1FFF, 0x1FFF1FFF, 0x1FFF1FFF, 0x1FFF1FFF, + 0x1FFF1FFF, 0x00906E41, 0x00800E3C, 0x00E00E39, 0x00000000, + 0x00906EFD, 0x00900EFD, 0x00E00EF8, + }; + + if(nic->mac == mac_82551_F || nic->mac == mac_82551_10) { + for(i = 0; i < UCODE_SIZE; i++) cb->u.ucode[i] = cpu_to_le32(ucode[i]); cb->command = cpu_to_le16(cb_ucode); - return; - } - -noloaducode: - cb->command = cpu_to_le16(cb_nop); + } else + cb->command = cpu_to_le16(cb_nop); } static void e100_setup_iaaddr(struct nic *nic, struct cb *cb, diff --git a/trunk/drivers/net/e1000/e1000.h b/trunk/drivers/net/e1000/e1000.h index e02e9ba2e18b..3f653a93e1bc 100644 --- a/trunk/drivers/net/e1000/e1000.h +++ b/trunk/drivers/net/e1000/e1000.h @@ -188,13 +188,11 @@ struct e1000_tx_ring { /* array of buffer information structs */ struct e1000_buffer *buffer_info; + struct e1000_buffer previous_buffer_info; spinlock_t tx_lock; uint16_t tdh; uint16_t tdt; uint64_t pkt; - - boolean_t last_tx_tso; - }; struct e1000_rx_ring { diff --git a/trunk/drivers/net/e1000/e1000_ethtool.c b/trunk/drivers/net/e1000/e1000_ethtool.c index c88f1a3c1b1d..8eae8ba27e84 100644 --- a/trunk/drivers/net/e1000/e1000_ethtool.c +++ b/trunk/drivers/net/e1000/e1000_ethtool.c @@ -562,29 +562,10 @@ e1000_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) { struct e1000_adapter *adapter = netdev_priv(netdev); - char firmware_version[32]; - uint16_t eeprom_data; strncpy(drvinfo->driver, e1000_driver_name, 32); strncpy(drvinfo->version, e1000_driver_version, 32); - - /* EEPROM image version # is reported as firware version # for - * 8257{1|2|3} controllers */ - e1000_read_eeprom(&adapter->hw, 5, 1, &eeprom_data); - switch (adapter->hw.mac_type) { - case e1000_82571: - case e1000_82572: - case e1000_82573: - sprintf(firmware_version, "%d.%d-%d", - (eeprom_data & 0xF000) >> 12, - (eeprom_data & 0x0FF0) >> 4, - eeprom_data & 0x000F); - break; - default: - sprintf(firmware_version, "n/a"); - } - - strncpy(drvinfo->fw_version, firmware_version, 32); + strncpy(drvinfo->fw_version, "N/A", 32); strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32); drvinfo->n_stats = E1000_STATS_LEN; drvinfo->testinfo_len = E1000_TEST_LEN; @@ -979,21 +960,13 @@ e1000_free_desc_rings(struct e1000_adapter *adapter) } } - if(txdr->desc) { + if(txdr->desc) pci_free_consistent(pdev, txdr->size, txdr->desc, txdr->dma); - txdr->desc = NULL; - } - if(rxdr->desc) { + if(rxdr->desc) pci_free_consistent(pdev, rxdr->size, rxdr->desc, rxdr->dma); - rxdr->desc = NULL; - } kfree(txdr->buffer_info); - txdr->buffer_info = NULL; - kfree(rxdr->buffer_info); - rxdr->buffer_info = NULL; - return; } @@ -1328,32 +1301,21 @@ static int e1000_setup_loopback_test(struct e1000_adapter *adapter) { uint32_t rctl; - struct e1000_hw *hw = &adapter->hw; - if (hw->media_type == e1000_media_type_fiber || - hw->media_type == e1000_media_type_internal_serdes) { - switch (hw->mac_type) { - case e1000_82545: - case e1000_82546: - case e1000_82545_rev_3: - case e1000_82546_rev_3: + if(adapter->hw.media_type == e1000_media_type_fiber || + adapter->hw.media_type == e1000_media_type_internal_serdes) { + if(adapter->hw.mac_type == e1000_82545 || + adapter->hw.mac_type == e1000_82546 || + adapter->hw.mac_type == e1000_82545_rev_3 || + adapter->hw.mac_type == e1000_82546_rev_3) return e1000_set_phy_loopback(adapter); - break; - case e1000_82571: - case e1000_82572: -#define E1000_SERDES_LB_ON 0x410 - e1000_set_phy_loopback(adapter); - E1000_WRITE_REG(hw, SCTL, E1000_SERDES_LB_ON); - msec_delay(10); - return 0; - break; - default: - rctl = E1000_READ_REG(hw, RCTL); + else { + rctl = E1000_READ_REG(&adapter->hw, RCTL); rctl |= E1000_RCTL_LBM_TCVR; - E1000_WRITE_REG(hw, RCTL, rctl); + E1000_WRITE_REG(&adapter->hw, RCTL, rctl); return 0; } - } else if (hw->media_type == e1000_media_type_copper) + } else if(adapter->hw.media_type == e1000_media_type_copper) return e1000_set_phy_loopback(adapter); return 7; @@ -1364,36 +1326,25 @@ e1000_loopback_cleanup(struct e1000_adapter *adapter) { uint32_t rctl; uint16_t phy_reg; - struct e1000_hw *hw = &adapter->hw; rctl = E1000_READ_REG(&adapter->hw, RCTL); rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC); E1000_WRITE_REG(&adapter->hw, RCTL, rctl); - switch (hw->mac_type) { - case e1000_82571: - case e1000_82572: - if (hw->media_type == e1000_media_type_fiber || - hw->media_type == e1000_media_type_internal_serdes){ -#define E1000_SERDES_LB_OFF 0x400 - E1000_WRITE_REG(hw, SCTL, E1000_SERDES_LB_OFF); - msec_delay(10); - break; - } - /* fall thru for Cu adapters */ - case e1000_82545: - case e1000_82546: - case e1000_82545_rev_3: - case e1000_82546_rev_3: - default: - hw->autoneg = TRUE; - e1000_read_phy_reg(hw, PHY_CTRL, &phy_reg); - if (phy_reg & MII_CR_LOOPBACK) { + if(adapter->hw.media_type == e1000_media_type_copper || + ((adapter->hw.media_type == e1000_media_type_fiber || + adapter->hw.media_type == e1000_media_type_internal_serdes) && + (adapter->hw.mac_type == e1000_82545 || + adapter->hw.mac_type == e1000_82546 || + adapter->hw.mac_type == e1000_82545_rev_3 || + adapter->hw.mac_type == e1000_82546_rev_3))) { + adapter->hw.autoneg = TRUE; + e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &phy_reg); + if(phy_reg & MII_CR_LOOPBACK) { phy_reg &= ~MII_CR_LOOPBACK; - e1000_write_phy_reg(hw, PHY_CTRL, phy_reg); - e1000_phy_reset(hw); + e1000_write_phy_reg(&adapter->hw, PHY_CTRL, phy_reg); + e1000_phy_reset(&adapter->hw); } - break; } } @@ -1489,11 +1440,9 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, uint64_t *data) { if((*data = e1000_setup_desc_rings(adapter))) goto err_loopback; - if((*data = e1000_setup_loopback_test(adapter))) - goto err_loopback_setup; + if((*data = e1000_setup_loopback_test(adapter))) goto err_loopback; *data = e1000_run_loopback_test(adapter); e1000_loopback_cleanup(adapter); -err_loopback_setup: e1000_free_desc_rings(adapter); err_loopback: return *data; @@ -1722,14 +1671,6 @@ e1000_phys_id(struct net_device *netdev, uint32_t data) msleep_interruptible(data * 1000); del_timer_sync(&adapter->blink_timer); } - else if(adapter->hw.mac_type < e1000_82573) { - E1000_WRITE_REG(&adapter->hw, LEDCTL, (E1000_LEDCTL_LED2_BLINK_RATE | - E1000_LEDCTL_LED0_BLINK | E1000_LEDCTL_LED2_BLINK | - (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) | - (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED0_MODE_SHIFT) | - (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED1_MODE_SHIFT))); - msleep_interruptible(data * 1000); - } else { E1000_WRITE_REG(&adapter->hw, LEDCTL, (E1000_LEDCTL_LED2_BLINK_RATE | E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK | diff --git a/trunk/drivers/net/e1000/e1000_hw.c b/trunk/drivers/net/e1000/e1000_hw.c index 136fc031e4ad..a267c5235fc0 100644 --- a/trunk/drivers/net/e1000/e1000_hw.c +++ b/trunk/drivers/net/e1000/e1000_hw.c @@ -563,13 +563,11 @@ e1000_reset_hw(struct e1000_hw *hw) msec_delay(20); break; case e1000_82573: - if (e1000_is_onboard_nvm_eeprom(hw) == FALSE) { - udelay(10); - ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); - ctrl_ext |= E1000_CTRL_EXT_EE_RST; - E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); - E1000_WRITE_FLUSH(hw); - } + udelay(10); + ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); + ctrl_ext |= E1000_CTRL_EXT_EE_RST; + E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); + E1000_WRITE_FLUSH(hw); /* fall through */ case e1000_82571: case e1000_82572: @@ -846,27 +844,19 @@ e1000_setup_link(struct e1000_hw *hw) * control setting, then the variable hw->fc will * be initialized based on a value in the EEPROM. */ - if (hw->fc == e1000_fc_default) { - switch (hw->mac_type) { - case e1000_82573: + if(e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, 1, &eeprom_data)) { + DEBUGOUT("EEPROM Read Error\n"); + return -E1000_ERR_EEPROM; + } + + if(hw->fc == e1000_fc_default) { + if((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) + hw->fc = e1000_fc_none; + else if((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == + EEPROM_WORD0F_ASM_DIR) + hw->fc = e1000_fc_tx_pause; + else hw->fc = e1000_fc_full; - break; - default: - ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, - 1, &eeprom_data); - if (ret_val) { - DEBUGOUT("EEPROM Read Error\n"); - return -E1000_ERR_EEPROM; - } - if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) - hw->fc = e1000_fc_none; - else if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == - EEPROM_WORD0F_ASM_DIR) - hw->fc = e1000_fc_tx_pause; - else - hw->fc = e1000_fc_full; - break; - } } /* We want to save off the original Flow Control configuration just @@ -2972,22 +2962,13 @@ e1000_phy_hw_reset(struct e1000_hw *hw) if(hw->mac_type > e1000_82543) { /* Read the device control register and assert the E1000_CTRL_PHY_RST * bit. Then, take it out of reset. - * For pre-e1000_82571 hardware, we delay for 10ms between the assert - * and deassert. For e1000_82571 hardware and later, we instead delay - * for 10ms after the deassertion. */ ctrl = E1000_READ_REG(hw, CTRL); E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PHY_RST); E1000_WRITE_FLUSH(hw); - - if (hw->mac_type < e1000_82571) - msec_delay(10); - + msec_delay(10); E1000_WRITE_REG(hw, CTRL, ctrl); E1000_WRITE_FLUSH(hw); - - if (hw->mac_type >= e1000_82571) - msec_delay(10); } else { /* Read the Extended Device Control Register, assert the PHY_RESET_DIR * bit to put the PHY into reset. Then, take it out of reset. @@ -5297,13 +5278,9 @@ e1000_get_bus_info(struct e1000_hw *hw) hw->bus_speed = e1000_bus_speed_unknown; hw->bus_width = e1000_bus_width_unknown; break; + case e1000_82571: case e1000_82572: case e1000_82573: - hw->bus_type = e1000_bus_type_pci_express; - hw->bus_speed = e1000_bus_speed_2500; - hw->bus_width = e1000_bus_width_pciex_1; - break; - case e1000_82571: hw->bus_type = e1000_bus_type_pci_express; hw->bus_speed = e1000_bus_speed_2500; hw->bus_width = e1000_bus_width_pciex_4; @@ -6673,12 +6650,6 @@ e1000_get_auto_rd_done(struct e1000_hw *hw) break; } - /* PHY configuration from NVM just starts after EECD_AUTO_RD sets to high. - * Need to wait for PHY configuration completion before accessing NVM - * and PHY. */ - if (hw->mac_type == e1000_82573) - msec_delay(25); - return E1000_SUCCESS; } diff --git a/trunk/drivers/net/e1000/e1000_hw.h b/trunk/drivers/net/e1000/e1000_hw.h index 7caa35748cea..76ce12809a11 100644 --- a/trunk/drivers/net/e1000/e1000_hw.h +++ b/trunk/drivers/net/e1000/e1000_hw.h @@ -123,7 +123,6 @@ typedef enum { e1000_bus_width_32, e1000_bus_width_64, e1000_bus_width_pciex_1, - e1000_bus_width_pciex_2, e1000_bus_width_pciex_4, e1000_bus_width_reserved } e1000_bus_width; @@ -150,7 +149,6 @@ typedef enum { e1000_igp_cable_length_90 = 90, e1000_igp_cable_length_100 = 100, e1000_igp_cable_length_110 = 110, - e1000_igp_cable_length_115 = 115, e1000_igp_cable_length_120 = 120, e1000_igp_cable_length_130 = 130, e1000_igp_cable_length_140 = 140, @@ -1459,7 +1457,6 @@ struct e1000_hw { #define E1000_EECD_AUPDEN 0x00100000 /* Enable Autonomous FLASH update */ #define E1000_EECD_SHADV 0x00200000 /* Shadow RAM Data Valid */ #define E1000_EECD_SEC1VAL 0x00400000 /* Sector One Valid */ -#define E1000_EECD_SECVAL_SHIFT 22 #define E1000_STM_OPCODE 0xDB00 #define E1000_HICR_FW_RESET 0xC0 @@ -1954,6 +1951,7 @@ struct e1000_host_command_info { #define E1000_MDALIGN 4096 +#define E1000_GCR_BEM32 0x00400000 #define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 /* Function Active and Power State to MNG */ #define E1000_FACTPS_FUNC0_POWER_STATE_MASK 0x00000003 diff --git a/trunk/drivers/net/e1000/e1000_main.c b/trunk/drivers/net/e1000/e1000_main.c index 438a931fd55d..8b207f0e139e 100644 --- a/trunk/drivers/net/e1000/e1000_main.c +++ b/trunk/drivers/net/e1000/e1000_main.c @@ -711,7 +711,6 @@ e1000_probe(struct pci_dev *pdev, break; case e1000_82546: case e1000_82546_rev_3: - case e1000_82571: if((E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_FUNC_1) && (adapter->hw.media_type == e1000_media_type_copper)) { e1000_read_eeprom(&adapter->hw, @@ -1159,6 +1158,7 @@ e1000_setup_tx_resources(struct e1000_adapter *adapter, return -ENOMEM; } memset(txdr->buffer_info, 0, size); + memset(&txdr->previous_buffer_info, 0, sizeof(struct e1000_buffer)); /* round up to nearest 4K */ @@ -1813,6 +1813,11 @@ e1000_clean_tx_ring(struct e1000_adapter *adapter, /* Free all the Tx ring sk_buffs */ + if (likely(tx_ring->previous_buffer_info.skb != NULL)) { + e1000_unmap_and_free_tx_resource(adapter, + &tx_ring->previous_buffer_info); + } + for(i = 0; i < tx_ring->count; i++) { buffer_info = &tx_ring->buffer_info[i]; e1000_unmap_and_free_tx_resource(adapter, buffer_info); @@ -1827,7 +1832,6 @@ e1000_clean_tx_ring(struct e1000_adapter *adapter, tx_ring->next_to_use = 0; tx_ring->next_to_clean = 0; - tx_ring->last_tx_tso = 0; writel(0, adapter->hw.hw_addr + tx_ring->tdh); writel(0, adapter->hw.hw_addr + tx_ring->tdt); @@ -2433,16 +2437,6 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, buffer_info = &tx_ring->buffer_info[i]; size = min(len, max_per_txd); #ifdef NETIF_F_TSO - /* Workaround for Controller erratum -- - * descriptor for non-tso packet in a linear SKB that follows a - * tso gets written back prematurely before the data is fully - * DMAd to the controller */ - if (!skb->data_len && tx_ring->last_tx_tso && - !skb_shinfo(skb)->tso_size) { - tx_ring->last_tx_tso = 0; - size -= 4; - } - /* Workaround for premature desc write-backs * in TSO mode. Append 4-byte sentinel desc */ if(unlikely(mss && !nr_frags && size == len && size > 8)) @@ -2627,7 +2621,19 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb) E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT)) ) return 0; } - if ((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) { + if(htons(ETH_P_IP) == skb->protocol) { + const struct iphdr *ip = skb->nh.iph; + if(IPPROTO_UDP == ip->protocol) { + struct udphdr *udp = (struct udphdr *)(skb->h.uh); + if(ntohs(udp->dest) == 67) { + offset = (uint8_t *)udp + 8 - skb->data; + length = skb->len - offset; + + return e1000_mng_write_dhcp_info(hw, + (uint8_t *)udp + 8, length); + } + } + } else if((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) { struct ethhdr *eth = (struct ethhdr *) skb->data; if((htons(ETH_P_IP) == eth->h_proto)) { const struct iphdr *ip = @@ -2699,14 +2705,6 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) if(skb->ip_summed == CHECKSUM_HW) count++; #endif - -#ifdef NETIF_F_TSO - /* Controller Erratum workaround */ - if (!skb->data_len && tx_ring->last_tx_tso && - !skb_shinfo(skb)->tso_size) - count++; -#endif - count += TXD_USE_COUNT(len, max_txd_pwr); if(adapter->pcix_82544) @@ -2788,10 +2786,9 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) return NETDEV_TX_OK; } - if (likely(tso)) { - tx_ring->last_tx_tso = 1; + if (likely(tso)) tx_flags |= E1000_TX_FLAGS_TSO; - } else if (likely(e1000_tx_csum(adapter, tx_ring, skb))) + else if (likely(e1000_tx_csum(adapter, tx_ring, skb))) tx_flags |= E1000_TX_FLAGS_CSUM; /* Old method was to assume IPv4 packet by default if TSO was enabled. @@ -3242,12 +3239,37 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter, eop_desc = E1000_TX_DESC(*tx_ring, eop); while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) { + /* Premature writeback of Tx descriptors clear (free buffers + * and unmap pci_mapping) previous_buffer_info */ + if (likely(tx_ring->previous_buffer_info.skb != NULL)) { + e1000_unmap_and_free_tx_resource(adapter, + &tx_ring->previous_buffer_info); + } + for(cleaned = FALSE; !cleaned; ) { tx_desc = E1000_TX_DESC(*tx_ring, i); buffer_info = &tx_ring->buffer_info[i]; cleaned = (i == eop); - e1000_unmap_and_free_tx_resource(adapter, buffer_info); +#ifdef NETIF_F_TSO + if (!(netdev->features & NETIF_F_TSO)) { +#endif + e1000_unmap_and_free_tx_resource(adapter, + buffer_info); +#ifdef NETIF_F_TSO + } else { + if (cleaned) { + memcpy(&tx_ring->previous_buffer_info, + buffer_info, + sizeof(struct e1000_buffer)); + memset(buffer_info, 0, + sizeof(struct e1000_buffer)); + } else { + e1000_unmap_and_free_tx_resource( + adapter, buffer_info); + } + } +#endif tx_desc->buffer_addr = 0; tx_desc->lower.data = 0; @@ -3308,6 +3330,12 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter, netif_stop_queue(netdev); } } +#ifdef NETIF_F_TSO + if (unlikely(!(eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) && + time_after(jiffies, tx_ring->previous_buffer_info.time_stamp + HZ))) + e1000_unmap_and_free_tx_resource( + adapter, &tx_ring->previous_buffer_info); +#endif return cleaned; } diff --git a/trunk/drivers/net/fec_8xx/Kconfig b/trunk/drivers/net/fec_8xx/Kconfig index a84c232395e3..94e7a9af8705 100644 --- a/trunk/drivers/net/fec_8xx/Kconfig +++ b/trunk/drivers/net/fec_8xx/Kconfig @@ -1,6 +1,6 @@ config FEC_8XX tristate "Motorola 8xx FEC driver" - depends on NET_ETHERNET && 8xx + depends on NET_ETHERNET && FEC select MII config FEC_8XX_GENERIC_PHY diff --git a/trunk/drivers/net/forcedeth.c b/trunk/drivers/net/forcedeth.c index c39344adecce..525624fc03b4 100644 --- a/trunk/drivers/net/forcedeth.c +++ b/trunk/drivers/net/forcedeth.c @@ -10,7 +10,7 @@ * trademarks of NVIDIA Corporation in the United States and other * countries. * - * Copyright (C) 2003,4,5 Manfred Spraul + * Copyright (C) 2003,4 Manfred Spraul * Copyright (C) 2004 Andrew de Quincey (wol support) * Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane * IRQ rate fixes, bigendian fixes, cleanups, verification) @@ -100,7 +100,6 @@ * 0.45: 18 Sep 2005: Remove nv_stop/start_rx from every link check * 0.46: 20 Oct 2005: Add irq optimization modes. * 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan. - * 0.48: 24 Dec 2005: Disable TSO, bugfix for pci_map_single * * Known bugs: * We suspect that on some hardware no TX done interrupts are generated. @@ -112,7 +111,7 @@ * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few * superfluous timer interrupts from the nic. */ -#define FORCEDETH_VERSION "0.48" +#define FORCEDETH_VERSION "0.47" #define DRV_NAME "forcedeth" #include @@ -872,8 +871,8 @@ static int nv_alloc_rx(struct net_device *dev) } else { skb = np->rx_skbuff[nr]; } - np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data, - skb->end-skb->data, PCI_DMA_FROMDEVICE); + np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data, skb->len, + PCI_DMA_FROMDEVICE); if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { np->rx_ring.orig[nr].PacketBuffer = cpu_to_le32(np->rx_dma[nr]); wmb(); @@ -1000,7 +999,7 @@ static void nv_drain_rx(struct net_device *dev) wmb(); if (np->rx_skbuff[i]) { pci_unmap_single(np->pci_dev, np->rx_dma[i], - np->rx_skbuff[i]->end-np->rx_skbuff[i]->data, + np->rx_skbuff[i]->len, PCI_DMA_FROMDEVICE); dev_kfree_skb(np->rx_skbuff[i]); np->rx_skbuff[i] = NULL; @@ -1335,7 +1334,7 @@ static void nv_rx_process(struct net_device *dev) * the performance. */ pci_unmap_single(np->pci_dev, np->rx_dma[i], - np->rx_skbuff[i]->end-np->rx_skbuff[i]->data, + np->rx_skbuff[i]->len, PCI_DMA_FROMDEVICE); { @@ -2456,7 +2455,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG; #ifdef NETIF_F_TSO - /* disabled dev->features |= NETIF_F_TSO; */ + dev->features |= NETIF_F_TSO; #endif } diff --git a/trunk/drivers/net/gianfar.c b/trunk/drivers/net/gianfar.c index 146f9513aea5..e3a329539f1c 100644 --- a/trunk/drivers/net/gianfar.c +++ b/trunk/drivers/net/gianfar.c @@ -2,12 +2,11 @@ * drivers/net/gianfar.c * * Gianfar Ethernet Driver - * This driver is designed for the non-CPM ethernet controllers - * on the 85xx and 83xx family of integrated processors + * Driver for FEC on MPC8540 and TSEC on MPC8540/MPC8560 * Based on 8260_io/fcc_enet.c * * Author: Andy Fleming - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala (kumar.gala@freescale.com) * * Copyright (c) 2002-2004 Freescale Semiconductor, Inc. * @@ -23,6 +22,8 @@ * B-V +1.62 * * Theory of operation + * This driver is designed for the non-CPM ethernet controllers + * on the 85xx and 83xx family of integrated processors * * The driver is initialized through platform_device. Structures which * define the configuration needed by the board are defined in a @@ -109,7 +110,7 @@ #endif const char gfar_driver_name[] = "Gianfar Ethernet"; -const char gfar_driver_version[] = "1.3"; +const char gfar_driver_version[] = "1.2"; static int gfar_enet_open(struct net_device *dev); static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev); @@ -138,10 +139,6 @@ static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, int l static void gfar_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp); static void gfar_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); -void gfar_halt(struct net_device *dev); -void gfar_start(struct net_device *dev); -static void gfar_clear_exact_match(struct net_device *dev); -static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr); extern struct ethtool_ops gfar_ethtool_ops; @@ -149,10 +146,12 @@ MODULE_AUTHOR("Freescale Semiconductor, Inc"); MODULE_DESCRIPTION("Gianfar Ethernet Driver"); MODULE_LICENSE("GPL"); -/* Returns 1 if incoming frames use an FCB */ -static inline int gfar_uses_fcb(struct gfar_private *priv) +int gfar_uses_fcb(struct gfar_private *priv) { - return (priv->vlan_enable || priv->rx_csum_enable); + if (priv->vlan_enable || priv->rx_csum_enable) + return 1; + else + return 0; } /* Set up the ethernet device structure, private data, @@ -321,10 +320,15 @@ static int gfar_probe(struct platform_device *pdev) else priv->padding = 0; + dev->hard_header_len += priv->padding; + if (dev->features & NETIF_F_IP_CSUM) dev->hard_header_len += GMAC_FCB_LEN; priv->rx_buffer_size = DEFAULT_RX_BUFFER_SIZE; +#ifdef CONFIG_GFAR_BUFSTASH + priv->rx_stash_size = STASH_LENGTH; +#endif priv->tx_ring_size = DEFAULT_TX_RING_SIZE; priv->rx_ring_size = DEFAULT_RX_RING_SIZE; @@ -346,9 +350,6 @@ static int gfar_probe(struct platform_device *pdev) goto register_fail; } - /* Create all the sysfs files */ - gfar_init_sysfs(dev); - /* Print out the device info */ printk(KERN_INFO DEVICE_NAME, dev->name); for (idx = 0; idx < 6; idx++) @@ -356,7 +357,8 @@ static int gfar_probe(struct platform_device *pdev) printk("\n"); /* Even more device info helps when determining which kernel */ - /* provided which set of benchmarks. */ + /* provided which set of benchmarks. Since this is global for all */ + /* devices, we only print it once */ #ifdef CONFIG_GFAR_NAPI printk(KERN_INFO "%s: Running with NAPI enabled\n", dev->name); #else @@ -461,9 +463,19 @@ static void init_registers(struct net_device *dev) /* Initialize the max receive buffer length */ gfar_write(&priv->regs->mrblr, priv->rx_buffer_size); +#ifdef CONFIG_GFAR_BUFSTASH + /* If we are stashing buffers, we need to set the + * extraction length to the size of the buffer */ + gfar_write(&priv->regs->attreli, priv->rx_stash_size << 16); +#endif + /* Initialize the Minimum Frame Length Register */ gfar_write(&priv->regs->minflr, MINFLR_INIT_SETTINGS); + /* Setup Attributes so that snooping is on for rx */ + gfar_write(&priv->regs->attr, ATTR_INIT_SETTINGS); + gfar_write(&priv->regs->attreli, ATTRELI_INIT_SETTINGS); + /* Assign the TBI an address which won't conflict with the PHYs */ gfar_write(&priv->regs->tbipa, TBIPA_VALUE); } @@ -565,7 +577,8 @@ static void free_skb_resources(struct gfar_private *priv) for (i = 0; i < priv->rx_ring_size; i++) { if (priv->rx_skbuff[i]) { dma_unmap_single(NULL, rxbdp->bufPtr, - priv->rx_buffer_size, + priv->rx_buffer_size + + RXBUF_ALIGNMENT, DMA_FROM_DEVICE); dev_kfree_skb_any(priv->rx_skbuff[i]); @@ -623,7 +636,6 @@ int startup_gfar(struct net_device *dev) struct gfar *regs = priv->regs; int err = 0; u32 rctrl = 0; - u32 attrs = 0; gfar_write(®s->imask, IMASK_INIT_CLEAR); @@ -783,50 +795,18 @@ int startup_gfar(struct net_device *dev) if (priv->rx_csum_enable) rctrl |= RCTRL_CHECKSUMMING; - if (priv->extended_hash) { + if (priv->extended_hash) rctrl |= RCTRL_EXTHASH; - gfar_clear_exact_match(dev); - rctrl |= RCTRL_EMEN; - } - if (priv->vlan_enable) rctrl |= RCTRL_VLAN; - if (priv->padding) { - rctrl &= ~RCTRL_PAL_MASK; - rctrl |= RCTRL_PADDING(priv->padding); - } - /* Init rctrl based on our settings */ gfar_write(&priv->regs->rctrl, rctrl); if (dev->features & NETIF_F_IP_CSUM) gfar_write(&priv->regs->tctrl, TCTRL_INIT_CSUM); - /* Set the extraction length and index */ - attrs = ATTRELI_EL(priv->rx_stash_size) | - ATTRELI_EI(priv->rx_stash_index); - - gfar_write(&priv->regs->attreli, attrs); - - /* Start with defaults, and add stashing or locking - * depending on the approprate variables */ - attrs = ATTR_INIT_SETTINGS; - - if (priv->bd_stash_en) - attrs |= ATTR_BDSTASH; - - if (priv->rx_stash_size != 0) - attrs |= ATTR_BUFSTASH; - - gfar_write(&priv->regs->attr, attrs); - - gfar_write(&priv->regs->fifo_tx_thr, priv->fifo_threshold); - gfar_write(&priv->regs->fifo_tx_starve, priv->fifo_starve); - gfar_write(&priv->regs->fifo_tx_starve_shutoff, priv->fifo_starve_off); - - /* Start the controller */ gfar_start(dev); return 0; @@ -871,32 +851,34 @@ static int gfar_enet_open(struct net_device *dev) return err; } -static inline struct txfcb *gfar_add_fcb(struct sk_buff *skb, struct txbd8 *bdp) +static struct txfcb *gfar_add_fcb(struct sk_buff *skb, struct txbd8 *bdp) { struct txfcb *fcb = (struct txfcb *)skb_push (skb, GMAC_FCB_LEN); memset(fcb, 0, GMAC_FCB_LEN); + /* Flag the bd so the controller looks for the FCB */ + bdp->status |= TXBD_TOE; + return fcb; } static inline void gfar_tx_checksum(struct sk_buff *skb, struct txfcb *fcb) { - u8 flags = 0; + int len; /* If we're here, it's a IP packet with a TCP or UDP * payload. We set it to checksum, using a pseudo-header * we provide */ - flags = TXFCB_DEFAULT; + fcb->ip = 1; + fcb->tup = 1; + fcb->ctu = 1; + fcb->nph = 1; - /* Tell the controller what the protocol is */ - /* And provide the already calculated phcs */ - if (skb->nh.iph->protocol == IPPROTO_UDP) { - flags |= TXFCB_UDP; - fcb->phcs = skb->h.uh->check; - } else - fcb->phcs = skb->h.th->check; + /* Notify the controller what the protocol is */ + if (skb->nh.iph->protocol == IPPROTO_UDP) + fcb->udp = 1; /* l3os is the distance between the start of the * frame (skb->data) and the start of the IP hdr. @@ -905,12 +887,17 @@ static inline void gfar_tx_checksum(struct sk_buff *skb, struct txfcb *fcb) fcb->l3os = (u16)(skb->nh.raw - skb->data - GMAC_FCB_LEN); fcb->l4os = (u16)(skb->h.raw - skb->nh.raw); - fcb->flags = flags; + len = skb->nh.iph->tot_len - fcb->l4os; + + /* Provide the pseudoheader csum */ + fcb->phcs = ~csum_tcpudp_magic(skb->nh.iph->saddr, + skb->nh.iph->daddr, len, + skb->nh.iph->protocol, 0); } -void inline gfar_tx_vlan(struct sk_buff *skb, struct txfcb *fcb) +void gfar_tx_vlan(struct sk_buff *skb, struct txfcb *fcb) { - fcb->flags |= TXFCB_VLN; + fcb->vln = 1; fcb->vlctl = vlan_tx_tag_get(skb); } @@ -921,7 +908,6 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) struct gfar_private *priv = netdev_priv(dev); struct txfcb *fcb = NULL; struct txbd8 *txbdp; - u16 status; /* Update transmit stats */ priv->stats.tx_bytes += skb->len; @@ -933,22 +919,19 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) txbdp = priv->cur_tx; /* Clear all but the WRAP status flags */ - status = txbdp->status & TXBD_WRAP; + txbdp->status &= TXBD_WRAP; /* Set up checksumming */ - if (likely((dev->features & NETIF_F_IP_CSUM) - && (CHECKSUM_HW == skb->ip_summed))) { + if ((dev->features & NETIF_F_IP_CSUM) + && (CHECKSUM_HW == skb->ip_summed)) { fcb = gfar_add_fcb(skb, txbdp); - status |= TXBD_TOE; gfar_tx_checksum(skb, fcb); } if (priv->vlan_enable && unlikely(priv->vlgrp && vlan_tx_tag_present(skb))) { - if (unlikely(NULL == fcb)) { + if (NULL == fcb) fcb = gfar_add_fcb(skb, txbdp); - status |= TXBD_TOE; - } gfar_tx_vlan(skb, fcb); } @@ -966,16 +949,14 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) (priv->skb_curtx + 1) & TX_RING_MOD_MASK(priv->tx_ring_size); /* Flag the BD as interrupt-causing */ - status |= TXBD_INTERRUPT; + txbdp->status |= TXBD_INTERRUPT; /* Flag the BD as ready to go, last in frame, and */ /* in need of CRC */ - status |= (TXBD_READY | TXBD_LAST | TXBD_CRC); + txbdp->status |= (TXBD_READY | TXBD_LAST | TXBD_CRC); dev->trans_start = jiffies; - txbdp->status = status; - /* If this was the last BD in the ring, the next one */ /* is at the beginning of the ring */ if (txbdp->status & TXBD_WRAP) @@ -1029,7 +1010,21 @@ static struct net_device_stats * gfar_get_stats(struct net_device *dev) /* Changes the mac address if the controller is not running. */ int gfar_set_mac_address(struct net_device *dev) { - gfar_set_mac_for_addr(dev, 0, dev->dev_addr); + struct gfar_private *priv = netdev_priv(dev); + int i; + char tmpbuf[MAC_ADDR_LEN]; + u32 tempval; + + /* Now copy it into the mac registers backwards, cuz */ + /* little endian is silly */ + for (i = 0; i < MAC_ADDR_LEN; i++) + tmpbuf[MAC_ADDR_LEN - 1 - i] = dev->dev_addr[i]; + + gfar_write(&priv->regs->macstnaddr1, *((u32 *) (tmpbuf))); + + tempval = *((u32 *) (tmpbuf + 4)); + + gfar_write(&priv->regs->macstnaddr2, tempval); return 0; } @@ -1115,7 +1110,7 @@ static int gfar_change_mtu(struct net_device *dev, int new_mtu) INCREMENTAL_BUFFER_SIZE; /* Only stop and start the controller if it isn't already - * stopped, and we changed something */ + * stopped */ if ((oldsize != tempsize) && (dev->flags & IFF_UP)) stop_gfar(dev); @@ -1225,7 +1220,6 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id, struct pt_regs *regs) struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp) { - unsigned int alignamount; struct gfar_private *priv = netdev_priv(dev); struct sk_buff *skb = NULL; unsigned int timeout = SKB_ALLOC_TIMEOUT; @@ -1237,18 +1231,18 @@ struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp) if (NULL == skb) return NULL; - alignamount = RXBUF_ALIGNMENT - - (((unsigned) skb->data) & (RXBUF_ALIGNMENT - 1)); - /* We need the data buffer to be aligned properly. We will reserve * as many bytes as needed to align the data properly */ - skb_reserve(skb, alignamount); + skb_reserve(skb, + RXBUF_ALIGNMENT - + (((unsigned) skb->data) & (RXBUF_ALIGNMENT - 1))); skb->dev = dev; bdp->bufPtr = dma_map_single(NULL, skb->data, - priv->rx_buffer_size, DMA_FROM_DEVICE); + priv->rx_buffer_size + RXBUF_ALIGNMENT, + DMA_FROM_DEVICE); bdp->length = 0; @@ -1356,7 +1350,7 @@ static inline void gfar_rx_checksum(struct sk_buff *skb, struct rxfcb *fcb) /* If valid headers were found, and valid sums * were verified, then we tell the kernel that no * checksumming is necessary. Otherwise, it is */ - if ((fcb->flags & RXFCB_CSUM_MASK) == (RXFCB_CIP | RXFCB_CTU)) + if (fcb->cip && !fcb->eip && fcb->ctu && !fcb->etu) skb->ip_summed = CHECKSUM_UNNECESSARY; else skb->ip_summed = CHECKSUM_NONE; @@ -1407,7 +1401,7 @@ static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, skb->protocol = eth_type_trans(skb, dev); /* Send the packet up the stack */ - if (unlikely(priv->vlgrp && (fcb->flags & RXFCB_VLN))) + if (unlikely(priv->vlgrp && fcb->vln)) ret = gfar_rx_vlan(skb, priv->vlgrp, fcb->vlctl); else ret = RECEIVE(skb); @@ -1626,7 +1620,6 @@ static void adjust_link(struct net_device *dev) spin_lock_irqsave(&priv->lock, flags); if (phydev->link) { u32 tempval = gfar_read(®s->maccfg2); - u32 ecntrl = gfar_read(®s->ecntrl); /* Now we make sure that we can be in full duplex mode. * If not, we operate in half-duplex mode. */ @@ -1651,13 +1644,6 @@ static void adjust_link(struct net_device *dev) case 10: tempval = ((tempval & ~(MACCFG2_IF)) | MACCFG2_MII); - - /* Reduced mode distinguishes - * between 10 and 100 */ - if (phydev->speed == SPEED_100) - ecntrl |= ECNTRL_R100; - else - ecntrl &= ~(ECNTRL_R100); break; default: if (netif_msg_link(priv)) @@ -1671,7 +1657,6 @@ static void adjust_link(struct net_device *dev) } gfar_write(®s->maccfg2, tempval); - gfar_write(®s->ecntrl, ecntrl); if (!priv->oldlink) { new_state = 1; @@ -1736,9 +1721,6 @@ static void gfar_set_multi(struct net_device *dev) gfar_write(®s->gaddr6, 0xffffffff); gfar_write(®s->gaddr7, 0xffffffff); } else { - int em_num; - int idx; - /* zero out the hash */ gfar_write(®s->igaddr0, 0x0); gfar_write(®s->igaddr1, 0x0); @@ -1757,47 +1739,18 @@ static void gfar_set_multi(struct net_device *dev) gfar_write(®s->gaddr6, 0x0); gfar_write(®s->gaddr7, 0x0); - /* If we have extended hash tables, we need to - * clear the exact match registers to prepare for - * setting them */ - if (priv->extended_hash) { - em_num = GFAR_EM_NUM + 1; - gfar_clear_exact_match(dev); - idx = 1; - } else { - idx = 0; - em_num = 0; - } - if(dev->mc_count == 0) return; /* Parse the list, and set the appropriate bits */ for(mc_ptr = dev->mc_list; mc_ptr; mc_ptr = mc_ptr->next) { - if (idx < em_num) { - gfar_set_mac_for_addr(dev, idx, - mc_ptr->dmi_addr); - idx++; - } else - gfar_set_hash_for_addr(dev, mc_ptr->dmi_addr); + gfar_set_hash_for_addr(dev, mc_ptr->dmi_addr); } } return; } - -/* Clears each of the exact match registers to zero, so they - * don't interfere with normal reception */ -static void gfar_clear_exact_match(struct net_device *dev) -{ - int idx; - u8 zero_arr[MAC_ADDR_LEN] = {0,0,0,0,0,0}; - - for(idx = 1;idx < GFAR_EM_NUM + 1;idx++) - gfar_set_mac_for_addr(dev, idx, (u8 *)zero_arr); -} - /* Set the appropriate hash bit for the given addr */ /* The algorithm works like so: * 1) Take the Destination Address (ie the multicast address), and @@ -1828,32 +1781,6 @@ static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr) return; } - -/* There are multiple MAC Address register pairs on some controllers - * This function sets the numth pair to a given address - */ -static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr) -{ - struct gfar_private *priv = netdev_priv(dev); - int idx; - char tmpbuf[MAC_ADDR_LEN]; - u32 tempval; - u32 *macptr = &priv->regs->macstnaddr1; - - macptr += num*2; - - /* Now copy it into the mac registers backwards, cuz */ - /* little endian is silly */ - for (idx = 0; idx < MAC_ADDR_LEN; idx++) - tmpbuf[MAC_ADDR_LEN - 1 - idx] = addr[idx]; - - gfar_write(macptr, *((u32 *) (tmpbuf))); - - tempval = *((u32 *) (tmpbuf + 4)); - - gfar_write(macptr+1, tempval); -} - /* GFAR error interrupt handler */ static irqreturn_t gfar_error(int irq, void *dev_id, struct pt_regs *regs) { diff --git a/trunk/drivers/net/gianfar.h b/trunk/drivers/net/gianfar.h index 94a91da84fbb..220084e53341 100644 --- a/trunk/drivers/net/gianfar.h +++ b/trunk/drivers/net/gianfar.h @@ -6,7 +6,7 @@ * Based on 8260_io/fcc_enet.c * * Author: Andy Fleming - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala (kumar.gala@freescale.com) * * Copyright (c) 2002-2004 Freescale Semiconductor, Inc. * @@ -90,26 +90,12 @@ extern const char gfar_driver_version[]; #define GFAR_RX_MAX_RING_SIZE 256 #define GFAR_TX_MAX_RING_SIZE 256 -#define GFAR_MAX_FIFO_THRESHOLD 511 -#define GFAR_MAX_FIFO_STARVE 511 -#define GFAR_MAX_FIFO_STARVE_OFF 511 - #define DEFAULT_RX_BUFFER_SIZE 1536 #define TX_RING_MOD_MASK(size) (size-1) #define RX_RING_MOD_MASK(size) (size-1) #define JUMBO_BUFFER_SIZE 9728 #define JUMBO_FRAME_SIZE 9600 -#define DEFAULT_FIFO_TX_THR 0x100 -#define DEFAULT_FIFO_TX_STARVE 0x40 -#define DEFAULT_FIFO_TX_STARVE_OFF 0x80 -#define DEFAULT_BD_STASH 1 -#define DEFAULT_STASH_LENGTH 64 -#define DEFAULT_STASH_INDEX 0 - -/* The number of Exact Match registers */ -#define GFAR_EM_NUM 15 - /* Latency of interface clock in nanoseconds */ /* Interface clock latency , in this case, means the * time described by a value of 1 in the interrupt @@ -126,11 +112,11 @@ extern const char gfar_driver_version[]; #define DEFAULT_TX_COALESCE 1 #define DEFAULT_TXCOUNT 16 -#define DEFAULT_TXTIME 4 +#define DEFAULT_TXTIME 400 #define DEFAULT_RX_COALESCE 1 #define DEFAULT_RXCOUNT 16 -#define DEFAULT_RXTIME 4 +#define DEFAULT_RXTIME 400 #define TBIPA_VALUE 0x1f #define MIIMCFG_INIT_VALUE 0x00000007 @@ -161,7 +147,6 @@ extern const char gfar_driver_version[]; #define ECNTRL_INIT_SETTINGS 0x00001000 #define ECNTRL_TBI_MODE 0x00000020 -#define ECNTRL_R100 0x00000008 #define MRBLR_INIT_SETTINGS DEFAULT_RX_BUFFER_SIZE @@ -196,12 +181,10 @@ extern const char gfar_driver_version[]; #define RCTRL_PRSDEP_MASK 0x000000c0 #define RCTRL_PRSDEP_INIT 0x000000c0 #define RCTRL_PROM 0x00000008 -#define RCTRL_EMEN 0x00000002 #define RCTRL_CHECKSUMMING (RCTRL_IPCSEN \ | RCTRL_TUCSEN | RCTRL_PRSDEP_INIT) #define RCTRL_EXTHASH (RCTRL_GHTX) #define RCTRL_VLAN (RCTRL_PRSDEP_INIT) -#define RCTRL_PADDING(x) ((x << 16) & RCTRL_PAL_MASK) #define RSTAT_CLEAR_RHALT 0x00800000 @@ -268,26 +251,28 @@ extern const char gfar_driver_version[]; IMASK_XFUN | IMASK_RXC | IMASK_BABT | IMASK_DPE \ | IMASK_PERR) -/* Fifo management */ -#define FIFO_TX_THR_MASK 0x01ff -#define FIFO_TX_STARVE_MASK 0x01ff -#define FIFO_TX_STARVE_OFF_MASK 0x01ff /* Attribute fields */ /* This enables rx snooping for buffers and descriptors */ +#ifdef CONFIG_GFAR_BDSTASH #define ATTR_BDSTASH 0x00000800 +#else +#define ATTR_BDSTASH 0x00000000 +#endif +#ifdef CONFIG_GFAR_BUFSTASH #define ATTR_BUFSTASH 0x00004000 +#define STASH_LENGTH 64 +#else +#define ATTR_BUFSTASH 0x00000000 +#endif #define ATTR_SNOOPING 0x000000c0 -#define ATTR_INIT_SETTINGS ATTR_SNOOPING +#define ATTR_INIT_SETTINGS (ATTR_SNOOPING \ + | ATTR_BDSTASH | ATTR_BUFSTASH) #define ATTRELI_INIT_SETTINGS 0x0 -#define ATTRELI_EL_MASK 0x3fff0000 -#define ATTRELI_EL(x) (x << 16) -#define ATTRELI_EI_MASK 0x00003fff -#define ATTRELI_EI(x) (x) /* TxBD status field bits */ @@ -343,7 +328,6 @@ extern const char gfar_driver_version[]; #define RXFCB_CTU 0x0400 #define RXFCB_EIP 0x0200 #define RXFCB_ETU 0x0100 -#define RXFCB_CSUM_MASK 0x0f00 #define RXFCB_PERR_MASK 0x000c #define RXFCB_PERR_BADL3 0x0008 @@ -355,7 +339,14 @@ struct txbd8 }; struct txfcb { - u8 flags; + u8 vln:1, + ip:1, + ip6:1, + tup:1, + udp:1, + cip:1, + ctu:1, + nph:1; u8 reserved; u8 l4os; /* Level 4 Header Offset */ u8 l3os; /* Level 3 Header Offset */ @@ -371,7 +362,14 @@ struct rxbd8 }; struct rxfcb { - u16 flags; + u16 vln:1, + ip:1, + ip6:1, + tup:1, + cip:1, + ctu:1, + eip:1, + etu:1; u8 rq; /* Receive Queue index */ u8 pro; /* Layer 4 Protocol */ u16 reserved; @@ -690,17 +688,12 @@ struct gfar_private { spinlock_t lock; unsigned int rx_buffer_size; unsigned int rx_stash_size; - unsigned int rx_stash_index; unsigned int tx_ring_size; unsigned int rx_ring_size; - unsigned int fifo_threshold; - unsigned int fifo_starve; - unsigned int fifo_starve_off; unsigned char vlan_enable:1, rx_csum_enable:1, - extended_hash:1, - bd_stash_en:1; + extended_hash:1; unsigned short padding; struct vlan_group *vlgrp; /* Info structure initialized by board setup code */ @@ -738,6 +731,6 @@ extern void stop_gfar(struct net_device *dev); extern void gfar_halt(struct net_device *dev); extern void gfar_phy_test(struct mii_bus *bus, struct phy_device *phydev, int enable, u32 regnum, u32 read); -void gfar_init_sysfs(struct net_device *dev); +void gfar_setup_stashing(struct net_device *dev); #endif /* __GIANFAR_H */ diff --git a/trunk/drivers/net/gianfar_ethtool.c b/trunk/drivers/net/gianfar_ethtool.c index 765e810620fe..5a2d810ce575 100644 --- a/trunk/drivers/net/gianfar_ethtool.c +++ b/trunk/drivers/net/gianfar_ethtool.c @@ -6,7 +6,7 @@ * Based on e1000 ethtool support * * Author: Andy Fleming - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala (kumar.gala@freescale.com) * * Copyright (c) 2003,2004 Freescale Semiconductor, Inc. * @@ -125,7 +125,7 @@ static char stat_gstrings[][ETH_GSTRING_LEN] = { static void gfar_gstrings(struct net_device *dev, u32 stringset, u8 * buf) { struct gfar_private *priv = netdev_priv(dev); - + if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_RMON) memcpy(buf, stat_gstrings, GFAR_STATS_LEN * ETH_GSTRING_LEN); else diff --git a/trunk/drivers/net/gianfar_mii.c b/trunk/drivers/net/gianfar_mii.c index 04a462c2a5b7..9544279e8bcd 100644 --- a/trunk/drivers/net/gianfar_mii.c +++ b/trunk/drivers/net/gianfar_mii.c @@ -5,7 +5,7 @@ * Provides Bus interface for MIIM regs * * Author: Andy Fleming - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala (kumar.gala@freescale.com) * * Copyright (c) 2002-2004 Freescale Semiconductor, Inc. * diff --git a/trunk/drivers/net/gianfar_mii.h b/trunk/drivers/net/gianfar_mii.h index d527cf2f9c1d..56e5665d5c9b 100644 --- a/trunk/drivers/net/gianfar_mii.h +++ b/trunk/drivers/net/gianfar_mii.h @@ -5,7 +5,7 @@ * Driver for the MDIO bus controller in the Gianfar register space * * Author: Andy Fleming - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala (kumar.gala@freescale.com) * * Copyright (c) 2002-2004 Freescale Semiconductor, Inc. * @@ -24,7 +24,6 @@ #define MII_READ_COMMAND 0x00000001 #define GFAR_SUPPORTED (SUPPORTED_10baseT_Half \ - | SUPPORTED_10baseT_Full \ | SUPPORTED_100baseT_Half \ | SUPPORTED_100baseT_Full \ | SUPPORTED_Autoneg \ diff --git a/trunk/drivers/net/gianfar_sysfs.c b/trunk/drivers/net/gianfar_sysfs.c deleted file mode 100644 index 10d34cb19192..000000000000 --- a/trunk/drivers/net/gianfar_sysfs.c +++ /dev/null @@ -1,311 +0,0 @@ -/* - * drivers/net/gianfar_sysfs.c - * - * Gianfar Ethernet Driver - * This driver is designed for the non-CPM ethernet controllers - * on the 85xx and 83xx family of integrated processors - * Based on 8260_io/fcc_enet.c - * - * Author: Andy Fleming - * Maintainer: Kumar Gala (kumar.gala@freescale.com) - * - * Copyright (c) 2002-2005 Freescale Semiconductor, 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. - * - * Sysfs file creation and management - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "gianfar.h" - -#define GFAR_ATTR(_name) \ -static ssize_t gfar_show_##_name(struct class_device *cdev, char *buf); \ -static ssize_t gfar_set_##_name(struct class_device *cdev, \ - const char *buf, size_t count); \ -static CLASS_DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name) - -#define GFAR_CREATE_FILE(_dev, _name) \ - class_device_create_file(&_dev->class_dev, &class_device_attr_##_name) - -GFAR_ATTR(bd_stash); -GFAR_ATTR(rx_stash_size); -GFAR_ATTR(rx_stash_index); -GFAR_ATTR(fifo_threshold); -GFAR_ATTR(fifo_starve); -GFAR_ATTR(fifo_starve_off); - -#define to_net_dev(cd) container_of(cd, struct net_device, class_dev) - -static ssize_t gfar_show_bd_stash(struct class_device *cdev, char *buf) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - - return sprintf(buf, "%s\n", priv->bd_stash_en? "on" : "off"); -} - -static ssize_t gfar_set_bd_stash(struct class_device *cdev, - const char *buf, size_t count) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - int new_setting = 0; - u32 temp; - unsigned long flags; - - /* Find out the new setting */ - if (!strncmp("on", buf, count-1) || !strncmp("1", buf, count-1)) - new_setting = 1; - else if (!strncmp("off", buf, count-1) || !strncmp("0", buf, count-1)) - new_setting = 0; - else - return count; - - spin_lock_irqsave(&priv->lock, flags); - - /* Set the new stashing value */ - priv->bd_stash_en = new_setting; - - temp = gfar_read(&priv->regs->attr); - - if (new_setting) - temp |= ATTR_BDSTASH; - else - temp &= ~(ATTR_BDSTASH); - - gfar_write(&priv->regs->attr, temp); - - spin_unlock_irqrestore(&priv->lock, flags); - - return count; -} - -static ssize_t gfar_show_rx_stash_size(struct class_device *cdev, char *buf) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - - return sprintf(buf, "%d\n", priv->rx_stash_size); -} - -static ssize_t gfar_set_rx_stash_size(struct class_device *cdev, - const char *buf, size_t count) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - unsigned int length = simple_strtoul(buf, NULL, 0); - u32 temp; - unsigned long flags; - - spin_lock_irqsave(&priv->lock, flags); - if (length > priv->rx_buffer_size) - return count; - - if (length == priv->rx_stash_size) - return count; - - priv->rx_stash_size = length; - - temp = gfar_read(&priv->regs->attreli); - temp &= ~ATTRELI_EL_MASK; - temp |= ATTRELI_EL(length); - gfar_write(&priv->regs->attreli, temp); - - /* Turn stashing on/off as appropriate */ - temp = gfar_read(&priv->regs->attr); - - if (length) - temp |= ATTR_BUFSTASH; - else - temp &= ~(ATTR_BUFSTASH); - - gfar_write(&priv->regs->attr, temp); - - spin_unlock_irqrestore(&priv->lock, flags); - - return count; -} - - -/* Stashing will only be enabled when rx_stash_size != 0 */ -static ssize_t gfar_show_rx_stash_index(struct class_device *cdev, char *buf) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - - return sprintf(buf, "%d\n", priv->rx_stash_index); -} - -static ssize_t gfar_set_rx_stash_index(struct class_device *cdev, - const char *buf, size_t count) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - unsigned short index = simple_strtoul(buf, NULL, 0); - u32 temp; - unsigned long flags; - - spin_lock_irqsave(&priv->lock, flags); - if (index > priv->rx_stash_size) - return count; - - if (index == priv->rx_stash_index) - return count; - - priv->rx_stash_index = index; - - temp = gfar_read(&priv->regs->attreli); - temp &= ~ATTRELI_EI_MASK; - temp |= ATTRELI_EI(index); - gfar_write(&priv->regs->attreli, flags); - - spin_unlock_irqrestore(&priv->lock, flags); - - return count; -} - -static ssize_t gfar_show_fifo_threshold(struct class_device *cdev, char *buf) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - - return sprintf(buf, "%d\n", priv->fifo_threshold); -} - -static ssize_t gfar_set_fifo_threshold(struct class_device *cdev, - const char *buf, size_t count) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - unsigned int length = simple_strtoul(buf, NULL, 0); - u32 temp; - unsigned long flags; - - if (length > GFAR_MAX_FIFO_THRESHOLD) - return count; - - spin_lock_irqsave(&priv->lock, flags); - - priv->fifo_threshold = length; - - temp = gfar_read(&priv->regs->fifo_tx_thr); - temp &= ~FIFO_TX_THR_MASK; - temp |= length; - gfar_write(&priv->regs->fifo_tx_thr, temp); - - spin_unlock_irqrestore(&priv->lock, flags); - - return count; -} - -static ssize_t gfar_show_fifo_starve(struct class_device *cdev, char *buf) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - - return sprintf(buf, "%d\n", priv->fifo_starve); -} - - -static ssize_t gfar_set_fifo_starve(struct class_device *cdev, - const char *buf, size_t count) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - unsigned int num = simple_strtoul(buf, NULL, 0); - u32 temp; - unsigned long flags; - - if (num > GFAR_MAX_FIFO_STARVE) - return count; - - spin_lock_irqsave(&priv->lock, flags); - - priv->fifo_starve = num; - - temp = gfar_read(&priv->regs->fifo_tx_starve); - temp &= ~FIFO_TX_STARVE_MASK; - temp |= num; - gfar_write(&priv->regs->fifo_tx_starve, temp); - - spin_unlock_irqrestore(&priv->lock, flags); - - return count; -} - -static ssize_t gfar_show_fifo_starve_off(struct class_device *cdev, char *buf) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - - return sprintf(buf, "%d\n", priv->fifo_starve_off); -} - -static ssize_t gfar_set_fifo_starve_off(struct class_device *cdev, - const char *buf, size_t count) -{ - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); - unsigned int num = simple_strtoul(buf, NULL, 0); - u32 temp; - unsigned long flags; - - if (num > GFAR_MAX_FIFO_STARVE_OFF) - return count; - - spin_lock_irqsave(&priv->lock, flags); - - priv->fifo_starve_off = num; - - temp = gfar_read(&priv->regs->fifo_tx_starve_shutoff); - temp &= ~FIFO_TX_STARVE_OFF_MASK; - temp |= num; - gfar_write(&priv->regs->fifo_tx_starve_shutoff, temp); - - spin_unlock_irqrestore(&priv->lock, flags); - - return count; -} - -void gfar_init_sysfs(struct net_device *dev) -{ - struct gfar_private *priv = netdev_priv(dev); - - /* Initialize the default values */ - priv->rx_stash_size = DEFAULT_STASH_LENGTH; - priv->rx_stash_index = DEFAULT_STASH_INDEX; - priv->fifo_threshold = DEFAULT_FIFO_TX_THR; - priv->fifo_starve = DEFAULT_FIFO_TX_STARVE; - priv->fifo_starve_off = DEFAULT_FIFO_TX_STARVE_OFF; - priv->bd_stash_en = DEFAULT_BD_STASH; - - /* Create our sysfs files */ - GFAR_CREATE_FILE(dev, bd_stash); - GFAR_CREATE_FILE(dev, rx_stash_size); - GFAR_CREATE_FILE(dev, rx_stash_index); - GFAR_CREATE_FILE(dev, fifo_threshold); - GFAR_CREATE_FILE(dev, fifo_starve); - GFAR_CREATE_FILE(dev, fifo_starve_off); - -} diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_core.c b/trunk/drivers/net/ibm_emac/ibm_emac_core.c index 1da8a66f91e1..eb7d69478715 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_core.c +++ b/trunk/drivers/net/ibm_emac/ibm_emac_core.c @@ -65,7 +65,7 @@ */ #define DRV_NAME "emac" -#define DRV_VERSION "3.54" +#define DRV_VERSION "3.53" #define DRV_DESC "PPC 4xx OCP EMAC driver" MODULE_DESCRIPTION(DRV_DESC); @@ -158,14 +158,6 @@ static inline void emac_report_timeout_error(struct ocp_enet_private *dev, #define PHY_POLL_LINK_ON HZ #define PHY_POLL_LINK_OFF (HZ / 5) -/* Graceful stop timeouts in us. - * We should allow up to 1 frame time (full-duplex, ignoring collisions) - */ -#define STOP_TIMEOUT_10 1230 -#define STOP_TIMEOUT_100 124 -#define STOP_TIMEOUT_1000 13 -#define STOP_TIMEOUT_1000_JUMBO 73 - /* Please, keep in sync with struct ibm_emac_stats/ibm_emac_error_stats */ static const char emac_stats_keys[EMAC_ETHTOOL_STATS_COUNT][ETH_GSTRING_LEN] = { "rx_packets", "rx_bytes", "tx_packets", "tx_bytes", "rx_packets_csum", @@ -230,12 +222,10 @@ static void emac_tx_disable(struct ocp_enet_private *dev) r = in_be32(&p->mr0); if (r & EMAC_MR0_TXE) { - int n = dev->stop_timeout; + int n = 300; out_be32(&p->mr0, r & ~EMAC_MR0_TXE); - while (!(in_be32(&p->mr0) & EMAC_MR0_TXI) && n) { - udelay(1); + while (!(in_be32(&p->mr0) & EMAC_MR0_TXI) && n) --n; - } if (unlikely(!n)) emac_report_timeout_error(dev, "TX disable timeout"); } @@ -258,11 +248,9 @@ static void emac_rx_enable(struct ocp_enet_private *dev) if (!(r & EMAC_MR0_RXE)) { if (unlikely(!(r & EMAC_MR0_RXI))) { /* Wait if previous async disable is still in progress */ - int n = dev->stop_timeout; - while (!(r = in_be32(&p->mr0) & EMAC_MR0_RXI) && n) { - udelay(1); + int n = 100; + while (!(r = in_be32(&p->mr0) & EMAC_MR0_RXI) && n) --n; - } if (unlikely(!n)) emac_report_timeout_error(dev, "RX disable timeout"); @@ -285,12 +273,10 @@ static void emac_rx_disable(struct ocp_enet_private *dev) r = in_be32(&p->mr0); if (r & EMAC_MR0_RXE) { - int n = dev->stop_timeout; + int n = 300; out_be32(&p->mr0, r & ~EMAC_MR0_RXE); - while (!(in_be32(&p->mr0) & EMAC_MR0_RXI) && n) { - udelay(1); + while (!(in_be32(&p->mr0) & EMAC_MR0_RXI) && n) --n; - } if (unlikely(!n)) emac_report_timeout_error(dev, "RX disable timeout"); } @@ -409,7 +395,6 @@ static int emac_configure(struct ocp_enet_private *dev) r = EMAC_MR1_BASE(emac_opb_mhz()) | EMAC_MR1_VLE | EMAC_MR1_IST; if (dev->phy.duplex == DUPLEX_FULL) r |= EMAC_MR1_FDE; - dev->stop_timeout = STOP_TIMEOUT_10; switch (dev->phy.speed) { case SPEED_1000: if (emac_phy_gpcs(dev->phy.mode)) { @@ -424,16 +409,12 @@ static int emac_configure(struct ocp_enet_private *dev) r |= EMAC_MR1_MF_1000; r |= EMAC_MR1_RFS_16K; gige = 1; - - if (dev->ndev->mtu > ETH_DATA_LEN) { + + if (dev->ndev->mtu > ETH_DATA_LEN) r |= EMAC_MR1_JPSM; - dev->stop_timeout = STOP_TIMEOUT_1000_JUMBO; - } else - dev->stop_timeout = STOP_TIMEOUT_1000; break; case SPEED_100: r |= EMAC_MR1_MF_100; - dev->stop_timeout = STOP_TIMEOUT_100; /* Fall through */ default: r |= EMAC_MR1_RFS_4K; @@ -2067,7 +2048,6 @@ static int __init emac_probe(struct ocp_device *ocpdev) dev->phy.duplex = DUPLEX_FULL; dev->phy.autoneg = AUTONEG_DISABLE; dev->phy.pause = dev->phy.asym_pause = 0; - dev->stop_timeout = STOP_TIMEOUT_100; init_timer(&dev->link_timer); dev->link_timer.function = emac_link_timer; dev->link_timer.data = (unsigned long)dev; diff --git a/trunk/drivers/net/ibm_emac/ibm_emac_core.h b/trunk/drivers/net/ibm_emac/ibm_emac_core.h index 911abbaf471b..e9b44d030ac3 100644 --- a/trunk/drivers/net/ibm_emac/ibm_emac_core.h +++ b/trunk/drivers/net/ibm_emac/ibm_emac_core.h @@ -189,8 +189,6 @@ struct ocp_enet_private { struct timer_list link_timer; int reset_failed; - int stop_timeout; /* in us */ - struct ibm_emac_error_stats estats; struct net_device_stats nstats; diff --git a/trunk/drivers/net/ioc3-eth.c b/trunk/drivers/net/ioc3-eth.c index 9b8295ee06ef..6a3129bc15a6 100644 --- a/trunk/drivers/net/ioc3-eth.c +++ b/trunk/drivers/net/ioc3-eth.c @@ -1360,7 +1360,7 @@ static struct pci_driver ioc3_driver = { static int __init ioc3_init_module(void) { - return pci_register_driver(&ioc3_driver); + return pci_module_init(&ioc3_driver); } static void __exit ioc3_cleanup_module(void) diff --git a/trunk/drivers/net/irda/ali-ircc.c b/trunk/drivers/net/irda/ali-ircc.c index 2e7882eb7d6f..9bf34681d3df 100644 --- a/trunk/drivers/net/irda/ali-ircc.c +++ b/trunk/drivers/net/irda/ali-ircc.c @@ -40,7 +40,6 @@ #include #include -#include #include #include diff --git a/trunk/drivers/net/irda/irda-usb.c b/trunk/drivers/net/irda/irda-usb.c index fa176ffb4ad5..c22c0517883c 100644 --- a/trunk/drivers/net/irda/irda-usb.c +++ b/trunk/drivers/net/irda/irda-usb.c @@ -1539,6 +1539,7 @@ static void irda_usb_disconnect(struct usb_interface *intf) * USB device callbacks */ static struct usb_driver irda_driver = { + .owner = THIS_MODULE, .name = "irda-usb", .probe = irda_usb_probe, .disconnect = irda_usb_disconnect, diff --git a/trunk/drivers/net/irda/nsc-ircc.c b/trunk/drivers/net/irda/nsc-ircc.c index ee717d0e939e..805714ec9a8a 100644 --- a/trunk/drivers/net/irda/nsc-ircc.c +++ b/trunk/drivers/net/irda/nsc-ircc.c @@ -59,7 +59,6 @@ #include #include -#include #include #include diff --git a/trunk/drivers/net/irda/stir4200.c b/trunk/drivers/net/irda/stir4200.c index 31867e4b891b..3961a754e920 100644 --- a/trunk/drivers/net/irda/stir4200.c +++ b/trunk/drivers/net/irda/stir4200.c @@ -1152,6 +1152,7 @@ static int stir_resume(struct usb_interface *intf) * USB device callbacks */ static struct usb_driver irda_driver = { + .owner = THIS_MODULE, .name = "stir4200", .probe = stir_probe, .disconnect = stir_disconnect, diff --git a/trunk/drivers/net/ixp2000/Kconfig b/trunk/drivers/net/ixp2000/Kconfig deleted file mode 100644 index 2fec2415651f..000000000000 --- a/trunk/drivers/net/ixp2000/Kconfig +++ /dev/null @@ -1,6 +0,0 @@ -config ENP2611_MSF_NET - tristate "Radisys ENP2611 MSF network interface support" - depends on ARCH_ENP2611 - help - This is a driver for the MSF network interface unit in - the IXP2400 on the Radisys ENP2611 platform. diff --git a/trunk/drivers/net/ixp2000/Makefile b/trunk/drivers/net/ixp2000/Makefile deleted file mode 100644 index fd38351ceaa7..000000000000 --- a/trunk/drivers/net/ixp2000/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -obj-$(CONFIG_ENP2611_MSF_NET) += enp2611_mod.o - -enp2611_mod-objs := caleb.o enp2611.o ixp2400-msf.o ixpdev.o pm3386.o diff --git a/trunk/drivers/net/ixp2000/caleb.c b/trunk/drivers/net/ixp2000/caleb.c deleted file mode 100644 index 3595e107df22..000000000000 --- a/trunk/drivers/net/ixp2000/caleb.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Helper functions for the SPI-3 bridge FPGA on the Radisys ENP2611 - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * 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 -#include -#include -#include -#include "caleb.h" - -#define CALEB_IDLO 0x00 -#define CALEB_IDHI 0x01 -#define CALEB_RID 0x02 -#define CALEB_RESET 0x03 -#define CALEB_INTREN0 0x04 -#define CALEB_INTREN1 0x05 -#define CALEB_INTRSTAT0 0x06 -#define CALEB_INTRSTAT1 0x07 -#define CALEB_PORTEN 0x08 -#define CALEB_BURST 0x09 -#define CALEB_PORTPAUS 0x0A -#define CALEB_PORTPAUSD 0x0B -#define CALEB_PHY0RX 0x10 -#define CALEB_PHY1RX 0x11 -#define CALEB_PHY0TX 0x12 -#define CALEB_PHY1TX 0x13 -#define CALEB_IXPRX_HI_CNTR 0x15 -#define CALEB_PHY0RX_HI_CNTR 0x16 -#define CALEB_PHY1RX_HI_CNTR 0x17 -#define CALEB_IXPRX_CNTR 0x18 -#define CALEB_PHY0RX_CNTR 0x19 -#define CALEB_PHY1RX_CNTR 0x1A -#define CALEB_IXPTX_CNTR 0x1B -#define CALEB_PHY0TX_CNTR 0x1C -#define CALEB_PHY1TX_CNTR 0x1D -#define CALEB_DEBUG0 0x1E -#define CALEB_DEBUG1 0x1F - - -static u8 caleb_reg_read(int reg) -{ - u8 value; - - value = *((volatile u8 *)(ENP2611_CALEB_VIRT_BASE + reg)); - -// printk(KERN_INFO "caleb_reg_read(%d) = %.2x\n", reg, value); - - return value; -} - -static void caleb_reg_write(int reg, u8 value) -{ - u8 dummy; - -// printk(KERN_INFO "caleb_reg_write(%d, %.2x)\n", reg, value); - - *((volatile u8 *)(ENP2611_CALEB_VIRT_BASE + reg)) = value; - - dummy = *((volatile u8 *)ENP2611_CALEB_VIRT_BASE); - __asm__ __volatile__("mov %0, %0" : "+r" (dummy)); -} - - -void caleb_reset(void) -{ - /* - * Perform a chip reset. - */ - caleb_reg_write(CALEB_RESET, 0x02); - udelay(1); - - /* - * Enable all interrupt sources. This is needed to get - * meaningful results out of the status bits (register 6 - * and 7.) - */ - caleb_reg_write(CALEB_INTREN0, 0xff); - caleb_reg_write(CALEB_INTREN1, 0x07); - - /* - * Set RX and TX FIFO thresholds to 1.5kb. - */ - caleb_reg_write(CALEB_PHY0RX, 0x11); - caleb_reg_write(CALEB_PHY1RX, 0x11); - caleb_reg_write(CALEB_PHY0TX, 0x11); - caleb_reg_write(CALEB_PHY1TX, 0x11); - - /* - * Program SPI-3 burst size. - */ - caleb_reg_write(CALEB_BURST, 0); // 64-byte RBUF mpackets -// caleb_reg_write(CALEB_BURST, 1); // 128-byte RBUF mpackets -// caleb_reg_write(CALEB_BURST, 2); // 256-byte RBUF mpackets -} - -void caleb_enable_rx(int port) -{ - u8 temp; - - temp = caleb_reg_read(CALEB_PORTEN); - temp |= 1 << port; - caleb_reg_write(CALEB_PORTEN, temp); -} - -void caleb_disable_rx(int port) -{ - u8 temp; - - temp = caleb_reg_read(CALEB_PORTEN); - temp &= ~(1 << port); - caleb_reg_write(CALEB_PORTEN, temp); -} - -void caleb_enable_tx(int port) -{ - u8 temp; - - temp = caleb_reg_read(CALEB_PORTEN); - temp |= 1 << (port + 4); - caleb_reg_write(CALEB_PORTEN, temp); -} - -void caleb_disable_tx(int port) -{ - u8 temp; - - temp = caleb_reg_read(CALEB_PORTEN); - temp &= ~(1 << (port + 4)); - caleb_reg_write(CALEB_PORTEN, temp); -} diff --git a/trunk/drivers/net/ixp2000/caleb.h b/trunk/drivers/net/ixp2000/caleb.h deleted file mode 100644 index e93a1ef5b8a3..000000000000 --- a/trunk/drivers/net/ixp2000/caleb.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Helper functions for the SPI-3 bridge FPGA on the Radisys ENP2611 - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef __CALEB_H -#define __CALEB_H - -void caleb_reset(void); -void caleb_enable_rx(int port); -void caleb_disable_rx(int port); -void caleb_enable_tx(int port); -void caleb_disable_tx(int port); - - -#endif diff --git a/trunk/drivers/net/ixp2000/enp2611.c b/trunk/drivers/net/ixp2000/enp2611.c deleted file mode 100644 index d82651a97bae..000000000000 --- a/trunk/drivers/net/ixp2000/enp2611.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - * IXP2400 MSF network device driver for the Radisys ENP2611 - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ixpdev.h" -#include "caleb.h" -#include "ixp2400-msf.h" -#include "pm3386.h" - -/*********************************************************************** - * The Radisys ENP2611 is a PCI form factor board with three SFP GBIC - * slots, connected via two PMC/Sierra 3386s and an SPI-3 bridge FPGA - * to the IXP2400. - * - * +-------------+ - * SFP GBIC #0 ---+ | +---------+ - * | PM3386 #0 +-------+ | - * SFP GBIC #1 ---+ | | "Caleb" | +---------+ - * +-------------+ | | | | - * | SPI-3 +---------+ IXP2400 | - * +-------------+ | bridge | | | - * SFP GBIC #2 ---+ | | FPGA | +---------+ - * | PM3386 #1 +-------+ | - * | | +---------+ - * +-------------+ - * ^ ^ ^ - * | 1.25Gbaud | 104MHz | 104MHz - * | SERDES ea. | SPI-3 ea. | SPI-3 - * - ***********************************************************************/ -static struct ixp2400_msf_parameters enp2611_msf_parameters = -{ - .rx_mode = IXP2400_RX_MODE_UTOPIA_POS | - IXP2400_RX_MODE_1x32 | - IXP2400_RX_MODE_MPHY | - IXP2400_RX_MODE_MPHY_32 | - IXP2400_RX_MODE_MPHY_POLLED_STATUS | - IXP2400_RX_MODE_MPHY_LEVEL3 | - IXP2400_RX_MODE_RBUF_SIZE_64, - - .rxclk01_multiplier = IXP2400_PLL_MULTIPLIER_16, - - .rx_poll_ports = 3, - - .rx_channel_mode = { - IXP2400_PORT_RX_MODE_MASTER | - IXP2400_PORT_RX_MODE_POS_PHY | - IXP2400_PORT_RX_MODE_POS_PHY_L3 | - IXP2400_PORT_RX_MODE_ODD_PARITY | - IXP2400_PORT_RX_MODE_2_CYCLE_DECODE, - - IXP2400_PORT_RX_MODE_MASTER | - IXP2400_PORT_RX_MODE_POS_PHY | - IXP2400_PORT_RX_MODE_POS_PHY_L3 | - IXP2400_PORT_RX_MODE_ODD_PARITY | - IXP2400_PORT_RX_MODE_2_CYCLE_DECODE, - - IXP2400_PORT_RX_MODE_MASTER | - IXP2400_PORT_RX_MODE_POS_PHY | - IXP2400_PORT_RX_MODE_POS_PHY_L3 | - IXP2400_PORT_RX_MODE_ODD_PARITY | - IXP2400_PORT_RX_MODE_2_CYCLE_DECODE, - - IXP2400_PORT_RX_MODE_MASTER | - IXP2400_PORT_RX_MODE_POS_PHY | - IXP2400_PORT_RX_MODE_POS_PHY_L3 | - IXP2400_PORT_RX_MODE_ODD_PARITY | - IXP2400_PORT_RX_MODE_2_CYCLE_DECODE - }, - - .tx_mode = IXP2400_TX_MODE_UTOPIA_POS | - IXP2400_TX_MODE_1x32 | - IXP2400_TX_MODE_MPHY | - IXP2400_TX_MODE_MPHY_32 | - IXP2400_TX_MODE_MPHY_POLLED_STATUS | - IXP2400_TX_MODE_MPHY_LEVEL3 | - IXP2400_TX_MODE_TBUF_SIZE_64, - - .txclk01_multiplier = IXP2400_PLL_MULTIPLIER_16, - - .tx_poll_ports = 3, - - .tx_channel_mode = { - IXP2400_PORT_TX_MODE_MASTER | - IXP2400_PORT_TX_MODE_POS_PHY | - IXP2400_PORT_TX_MODE_ODD_PARITY | - IXP2400_PORT_TX_MODE_2_CYCLE_DECODE, - - IXP2400_PORT_TX_MODE_MASTER | - IXP2400_PORT_TX_MODE_POS_PHY | - IXP2400_PORT_TX_MODE_ODD_PARITY | - IXP2400_PORT_TX_MODE_2_CYCLE_DECODE, - - IXP2400_PORT_TX_MODE_MASTER | - IXP2400_PORT_TX_MODE_POS_PHY | - IXP2400_PORT_TX_MODE_ODD_PARITY | - IXP2400_PORT_TX_MODE_2_CYCLE_DECODE, - - IXP2400_PORT_TX_MODE_MASTER | - IXP2400_PORT_TX_MODE_POS_PHY | - IXP2400_PORT_TX_MODE_ODD_PARITY | - IXP2400_PORT_TX_MODE_2_CYCLE_DECODE - } -}; - -struct enp2611_ixpdev_priv -{ - struct ixpdev_priv ixpdev_priv; - struct net_device_stats stats; -}; - -static struct net_device *nds[3]; -static struct timer_list link_check_timer; - -static struct net_device_stats *enp2611_get_stats(struct net_device *dev) -{ - struct enp2611_ixpdev_priv *ip = netdev_priv(dev); - - pm3386_get_stats(ip->ixpdev_priv.channel, &(ip->stats)); - - return &(ip->stats); -} - -/* @@@ Poll the SFP moddef0 line too. */ -/* @@@ Try to use the pm3386 DOOL interrupt as well. */ -static void enp2611_check_link_status(unsigned long __dummy) -{ - int i; - - for (i = 0; i < 3; i++) { - struct net_device *dev; - int status; - - dev = nds[i]; - - status = pm3386_is_link_up(i); - if (status && !netif_carrier_ok(dev)) { - /* @@@ Should report autonegotiation status. */ - printk(KERN_INFO "%s: NIC Link is Up\n", dev->name); - - pm3386_enable_tx(i); - caleb_enable_tx(i); - netif_carrier_on(dev); - } else if (!status && netif_carrier_ok(dev)) { - printk(KERN_INFO "%s: NIC Link is Down\n", dev->name); - - netif_carrier_off(dev); - caleb_disable_tx(i); - pm3386_disable_tx(i); - } - } - - link_check_timer.expires = jiffies + HZ / 10; - add_timer(&link_check_timer); -} - -static void enp2611_set_port_admin_status(int port, int up) -{ - if (up) { - caleb_enable_rx(port); - - pm3386_set_carrier(port, 1); - pm3386_enable_rx(port); - } else { - caleb_disable_tx(port); - pm3386_disable_tx(port); - /* @@@ Flush out pending packets. */ - pm3386_set_carrier(port, 0); - - pm3386_disable_rx(port); - caleb_disable_rx(port); - } -} - -static int __init enp2611_init_module(void) -{ - int i; - - if (!machine_is_enp2611()) - return -ENODEV; - - caleb_reset(); - pm3386_reset(); - - for (i = 0; i < 3; i++) { - nds[i] = ixpdev_alloc(i, sizeof(struct enp2611_ixpdev_priv)); - if (nds[i] == NULL) { - while (--i >= 0) - free_netdev(nds[i]); - return -ENOMEM; - } - - SET_MODULE_OWNER(nds[i]); - nds[i]->get_stats = enp2611_get_stats; - pm3386_init_port(i); - pm3386_get_mac(i, nds[i]->dev_addr); - } - - ixp2400_msf_init(&enp2611_msf_parameters); - - if (ixpdev_init(3, nds, enp2611_set_port_admin_status)) { - for (i = 0; i < 3; i++) - free_netdev(nds[i]); - return -EINVAL; - } - - init_timer(&link_check_timer); - link_check_timer.function = enp2611_check_link_status; - link_check_timer.expires = jiffies; - add_timer(&link_check_timer); - - return 0; -} - -static void __exit enp2611_cleanup_module(void) -{ - int i; - - del_timer_sync(&link_check_timer); - - ixpdev_deinit(); - for (i = 0; i < 3; i++) - free_netdev(nds[i]); -} - -module_init(enp2611_init_module); -module_exit(enp2611_cleanup_module); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/net/ixp2000/ixp2400-msf.c b/trunk/drivers/net/ixp2000/ixp2400-msf.c deleted file mode 100644 index 48a3a891d3a4..000000000000 --- a/trunk/drivers/net/ixp2000/ixp2400-msf.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Generic library functions for the MSF (Media and Switch Fabric) unit - * found on the Intel IXP2400 network processor. - * - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of the - * License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include "ixp2400-msf.h" - -/* - * This is the Intel recommended PLL init procedure as described on - * page 340 of the IXP2400/IXP2800 Programmer's Reference Manual. - */ -static void ixp2400_pll_init(struct ixp2400_msf_parameters *mp) -{ - int rx_dual_clock; - int tx_dual_clock; - u32 value; - - /* - * If the RX mode is not 1x32, we have to enable both RX PLLs - * (#0 and #1.) The same thing for the TX direction. - */ - rx_dual_clock = !!(mp->rx_mode & IXP2400_RX_MODE_WIDTH_MASK); - tx_dual_clock = !!(mp->tx_mode & IXP2400_TX_MODE_WIDTH_MASK); - - /* - * Read initial value. - */ - value = ixp2000_reg_read(IXP2000_MSF_CLK_CNTRL); - - /* - * Put PLLs in powerdown and bypass mode. - */ - value |= 0x0000f0f0; - ixp2000_reg_write(IXP2000_MSF_CLK_CNTRL, value); - - /* - * Set single or dual clock mode bits. - */ - value &= ~0x03000000; - value |= (rx_dual_clock << 24) | (tx_dual_clock << 25); - - /* - * Set multipliers. - */ - value &= ~0x00ff0000; - value |= mp->rxclk01_multiplier << 16; - value |= mp->rxclk23_multiplier << 18; - value |= mp->txclk01_multiplier << 20; - value |= mp->txclk23_multiplier << 22; - - /* - * And write value. - */ - ixp2000_reg_write(IXP2000_MSF_CLK_CNTRL, value); - - /* - * Disable PLL bypass mode. - */ - value &= ~(0x00005000 | rx_dual_clock << 13 | tx_dual_clock << 15); - ixp2000_reg_write(IXP2000_MSF_CLK_CNTRL, value); - - /* - * Turn on PLLs. - */ - value &= ~(0x00000050 | rx_dual_clock << 5 | tx_dual_clock << 7); - ixp2000_reg_write(IXP2000_MSF_CLK_CNTRL, value); - - /* - * Wait for PLLs to lock. There are lock status bits, but IXP2400 - * erratum #65 says that these lock bits should not be relied upon - * as they might not accurately reflect the true state of the PLLs. - */ - udelay(100); -} - -/* - * Needed according to p480 of Programmer's Reference Manual. - */ -static void ixp2400_msf_free_rbuf_entries(struct ixp2400_msf_parameters *mp) -{ - int size_bits; - int i; - - /* - * Work around IXP2400 erratum #69 (silent RBUF-to-DRAM transfer - * corruption) in the Intel-recommended way: do not add the RBUF - * elements susceptible to corruption to the freelist. - */ - size_bits = mp->rx_mode & IXP2400_RX_MODE_RBUF_SIZE_MASK; - if (size_bits == IXP2400_RX_MODE_RBUF_SIZE_64) { - for (i = 1; i < 128; i++) { - if (i == 9 || i == 18 || i == 27) - continue; - ixp2000_reg_write(IXP2000_MSF_RBUF_ELEMENT_DONE, i); - } - } else if (size_bits == IXP2400_RX_MODE_RBUF_SIZE_128) { - for (i = 1; i < 64; i++) { - if (i == 4 || i == 9 || i == 13) - continue; - ixp2000_reg_write(IXP2000_MSF_RBUF_ELEMENT_DONE, i); - } - } else if (size_bits == IXP2400_RX_MODE_RBUF_SIZE_256) { - for (i = 1; i < 32; i++) { - if (i == 2 || i == 4 || i == 6) - continue; - ixp2000_reg_write(IXP2000_MSF_RBUF_ELEMENT_DONE, i); - } - } -} - -static u32 ixp2400_msf_valid_channels(u32 reg) -{ - u32 channels; - - channels = 0; - switch (reg & IXP2400_RX_MODE_WIDTH_MASK) { - case IXP2400_RX_MODE_1x32: - channels = 0x1; - if (reg & IXP2400_RX_MODE_MPHY && - !(reg & IXP2400_RX_MODE_MPHY_32)) - channels = 0xf; - break; - - case IXP2400_RX_MODE_2x16: - channels = 0x5; - break; - - case IXP2400_RX_MODE_4x8: - channels = 0xf; - break; - - case IXP2400_RX_MODE_1x16_2x8: - channels = 0xd; - break; - } - - return channels; -} - -static void ixp2400_msf_enable_rx(struct ixp2400_msf_parameters *mp) -{ - u32 value; - - value = ixp2000_reg_read(IXP2000_MSF_RX_CONTROL) & 0x0fffffff; - value |= ixp2400_msf_valid_channels(mp->rx_mode) << 28; - ixp2000_reg_write(IXP2000_MSF_RX_CONTROL, value); -} - -static void ixp2400_msf_enable_tx(struct ixp2400_msf_parameters *mp) -{ - u32 value; - - value = ixp2000_reg_read(IXP2000_MSF_TX_CONTROL) & 0x0fffffff; - value |= ixp2400_msf_valid_channels(mp->tx_mode) << 28; - ixp2000_reg_write(IXP2000_MSF_TX_CONTROL, value); -} - - -void ixp2400_msf_init(struct ixp2400_msf_parameters *mp) -{ - u32 value; - int i; - - /* - * Init the RX/TX PLLs based on the passed parameter block. - */ - ixp2400_pll_init(mp); - - /* - * Reset MSF. Bit 7 in IXP_RESET_0 resets the MSF. - */ - value = ixp2000_reg_read(IXP2000_RESET0); - ixp2000_reg_write(IXP2000_RESET0, value | 0x80); - ixp2000_reg_write(IXP2000_RESET0, value & ~0x80); - - /* - * Initialise the RX section. - */ - ixp2000_reg_write(IXP2000_MSF_RX_MPHY_POLL_LIMIT, mp->rx_poll_ports - 1); - ixp2000_reg_write(IXP2000_MSF_RX_CONTROL, mp->rx_mode); - for (i = 0; i < 4; i++) { - ixp2000_reg_write(IXP2000_MSF_RX_UP_CONTROL_0 + i, - mp->rx_channel_mode[i]); - } - ixp2400_msf_free_rbuf_entries(mp); - ixp2400_msf_enable_rx(mp); - - /* - * Initialise the TX section. - */ - ixp2000_reg_write(IXP2000_MSF_TX_MPHY_POLL_LIMIT, mp->tx_poll_ports - 1); - ixp2000_reg_write(IXP2000_MSF_TX_CONTROL, mp->tx_mode); - for (i = 0; i < 4; i++) { - ixp2000_reg_write(IXP2000_MSF_TX_UP_CONTROL_0 + i, - mp->tx_channel_mode[i]); - } - ixp2400_msf_enable_tx(mp); -} diff --git a/trunk/drivers/net/ixp2000/ixp2400-msf.h b/trunk/drivers/net/ixp2000/ixp2400-msf.h deleted file mode 100644 index 3ac1af2771da..000000000000 --- a/trunk/drivers/net/ixp2000/ixp2400-msf.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Generic library functions for the MSF (Media and Switch Fabric) unit - * found on the Intel IXP2400 network processor. - * - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of the - * License, or (at your option) any later version. - */ - -#ifndef __IXP2400_MSF_H -#define __IXP2400_MSF_H - -struct ixp2400_msf_parameters -{ - u32 rx_mode; - unsigned rxclk01_multiplier:2; - unsigned rxclk23_multiplier:2; - unsigned rx_poll_ports:6; - u32 rx_channel_mode[4]; - - u32 tx_mode; - unsigned txclk01_multiplier:2; - unsigned txclk23_multiplier:2; - unsigned tx_poll_ports:6; - u32 tx_channel_mode[4]; -}; - -void ixp2400_msf_init(struct ixp2400_msf_parameters *mp); - -#define IXP2400_PLL_MULTIPLIER_48 0x00 -#define IXP2400_PLL_MULTIPLIER_24 0x01 -#define IXP2400_PLL_MULTIPLIER_16 0x02 -#define IXP2400_PLL_MULTIPLIER_12 0x03 - -#define IXP2400_RX_MODE_CSIX 0x00400000 -#define IXP2400_RX_MODE_UTOPIA_POS 0x00000000 -#define IXP2400_RX_MODE_WIDTH_MASK 0x00300000 -#define IXP2400_RX_MODE_1x16_2x8 0x00300000 -#define IXP2400_RX_MODE_4x8 0x00200000 -#define IXP2400_RX_MODE_2x16 0x00100000 -#define IXP2400_RX_MODE_1x32 0x00000000 -#define IXP2400_RX_MODE_MPHY 0x00080000 -#define IXP2400_RX_MODE_SPHY 0x00000000 -#define IXP2400_RX_MODE_MPHY_32 0x00040000 -#define IXP2400_RX_MODE_MPHY_4 0x00000000 -#define IXP2400_RX_MODE_MPHY_POLLED_STATUS 0x00020000 -#define IXP2400_RX_MODE_MPHY_DIRECT_STATUS 0x00000000 -#define IXP2400_RX_MODE_CBUS_FULL_DUPLEX 0x00010000 -#define IXP2400_RX_MODE_CBUS_SIMPLEX 0x00000000 -#define IXP2400_RX_MODE_MPHY_LEVEL2 0x00004000 -#define IXP2400_RX_MODE_MPHY_LEVEL3 0x00000000 -#define IXP2400_RX_MODE_CBUS_8BIT 0x00002000 -#define IXP2400_RX_MODE_CBUS_4BIT 0x00000000 -#define IXP2400_RX_MODE_CSIX_SINGLE_FREELIST 0x00000200 -#define IXP2400_RX_MODE_CSIX_SPLIT_FREELISTS 0x00000000 -#define IXP2400_RX_MODE_RBUF_SIZE_MASK 0x0000000c -#define IXP2400_RX_MODE_RBUF_SIZE_256 0x00000008 -#define IXP2400_RX_MODE_RBUF_SIZE_128 0x00000004 -#define IXP2400_RX_MODE_RBUF_SIZE_64 0x00000000 - -#define IXP2400_PORT_RX_MODE_SLAVE 0x00000040 -#define IXP2400_PORT_RX_MODE_MASTER 0x00000000 -#define IXP2400_PORT_RX_MODE_POS_PHY_L3 0x00000020 -#define IXP2400_PORT_RX_MODE_POS_PHY_L2 0x00000000 -#define IXP2400_PORT_RX_MODE_POS_PHY 0x00000010 -#define IXP2400_PORT_RX_MODE_UTOPIA 0x00000000 -#define IXP2400_PORT_RX_MODE_EVEN_PARITY 0x0000000c -#define IXP2400_PORT_RX_MODE_ODD_PARITY 0x00000008 -#define IXP2400_PORT_RX_MODE_NO_PARITY 0x00000000 -#define IXP2400_PORT_RX_MODE_UTOPIA_BIG_CELLS 0x00000002 -#define IXP2400_PORT_RX_MODE_UTOPIA_NORMAL_CELLS 0x00000000 -#define IXP2400_PORT_RX_MODE_2_CYCLE_DECODE 0x00000001 -#define IXP2400_PORT_RX_MODE_1_CYCLE_DECODE 0x00000000 - -#define IXP2400_TX_MODE_CSIX 0x00400000 -#define IXP2400_TX_MODE_UTOPIA_POS 0x00000000 -#define IXP2400_TX_MODE_WIDTH_MASK 0x00300000 -#define IXP2400_TX_MODE_1x16_2x8 0x00300000 -#define IXP2400_TX_MODE_4x8 0x00200000 -#define IXP2400_TX_MODE_2x16 0x00100000 -#define IXP2400_TX_MODE_1x32 0x00000000 -#define IXP2400_TX_MODE_MPHY 0x00080000 -#define IXP2400_TX_MODE_SPHY 0x00000000 -#define IXP2400_TX_MODE_MPHY_32 0x00040000 -#define IXP2400_TX_MODE_MPHY_4 0x00000000 -#define IXP2400_TX_MODE_MPHY_POLLED_STATUS 0x00020000 -#define IXP2400_TX_MODE_MPHY_DIRECT_STATUS 0x00000000 -#define IXP2400_TX_MODE_CBUS_FULL_DUPLEX 0x00010000 -#define IXP2400_TX_MODE_CBUS_SIMPLEX 0x00000000 -#define IXP2400_TX_MODE_MPHY_LEVEL2 0x00004000 -#define IXP2400_TX_MODE_MPHY_LEVEL3 0x00000000 -#define IXP2400_TX_MODE_CBUS_8BIT 0x00002000 -#define IXP2400_TX_MODE_CBUS_4BIT 0x00000000 -#define IXP2400_TX_MODE_TBUF_SIZE_MASK 0x0000000c -#define IXP2400_TX_MODE_TBUF_SIZE_256 0x00000008 -#define IXP2400_TX_MODE_TBUF_SIZE_128 0x00000004 -#define IXP2400_TX_MODE_TBUF_SIZE_64 0x00000000 - -#define IXP2400_PORT_TX_MODE_SLAVE 0x00000040 -#define IXP2400_PORT_TX_MODE_MASTER 0x00000000 -#define IXP2400_PORT_TX_MODE_POS_PHY 0x00000010 -#define IXP2400_PORT_TX_MODE_UTOPIA 0x00000000 -#define IXP2400_PORT_TX_MODE_EVEN_PARITY 0x0000000c -#define IXP2400_PORT_TX_MODE_ODD_PARITY 0x00000008 -#define IXP2400_PORT_TX_MODE_NO_PARITY 0x00000000 -#define IXP2400_PORT_TX_MODE_UTOPIA_BIG_CELLS 0x00000002 -#define IXP2400_PORT_TX_MODE_2_CYCLE_DECODE 0x00000001 -#define IXP2400_PORT_TX_MODE_1_CYCLE_DECODE 0x00000000 - - -#endif diff --git a/trunk/drivers/net/ixp2000/ixp2400_rx.uc b/trunk/drivers/net/ixp2000/ixp2400_rx.uc deleted file mode 100644 index 42a73e357afa..000000000000 --- a/trunk/drivers/net/ixp2000/ixp2400_rx.uc +++ /dev/null @@ -1,408 +0,0 @@ -/* - * RX ucode for the Intel IXP2400 in POS-PHY mode. - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * 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. - * - * Assumptions made in this code: - * - The IXP2400 MSF is configured for POS-PHY mode, in a mode where - * only one full element list is used. This includes, for example, - * 1x32 SPHY and 1x32 MPHY32, but not 4x8 SPHY or 1x32 MPHY4. (This - * is not an exhaustive list.) - * - The RBUF uses 64-byte mpackets. - * - RX descriptors reside in SRAM, and have the following format: - * struct rx_desc - * { - * // to uengine - * u32 buf_phys_addr; - * u32 buf_length; - * - * // from uengine - * u32 channel; - * u32 pkt_length; - * }; - * - Packet data resides in DRAM. - * - Packet buffer addresses are 8-byte aligned. - * - Scratch ring 0 is rx_pending. - * - Scratch ring 1 is rx_done, and has status condition 'full'. - * - The host triggers rx_done flush and rx_pending refill on seeing INTA. - * - This code is run on all eight threads of the microengine it runs on. - * - * Local memory is used for per-channel RX state. - */ - -#define RX_THREAD_FREELIST_0 0x0030 -#define RBUF_ELEMENT_DONE 0x0044 - -#define CHANNEL_FLAGS *l$index0[0] -#define CHANNEL_FLAG_RECEIVING 1 -#define PACKET_LENGTH *l$index0[1] -#define PACKET_CHECKSUM *l$index0[2] -#define BUFFER_HANDLE *l$index0[3] -#define BUFFER_START *l$index0[4] -#define BUFFER_LENGTH *l$index0[5] - -#define CHANNEL_STATE_SIZE 24 // in bytes -#define CHANNEL_STATE_SHIFT 5 // ceil(log2(state size)) - - - .sig volatile sig1 - .sig volatile sig2 - .sig volatile sig3 - - .sig mpacket_arrived - .reg add_to_rx_freelist - .reg read $rsw0, $rsw1 - .xfer_order $rsw0 $rsw1 - - .reg zero - - /* - * Initialise add_to_rx_freelist. - */ - .begin - .reg temp - .reg temp2 - - immed[add_to_rx_freelist, RX_THREAD_FREELIST_0] - immed_w1[add_to_rx_freelist, (&$rsw0 | (&mpacket_arrived << 12))] - - local_csr_rd[ACTIVE_CTX_STS] - immed[temp, 0] - alu[temp2, temp, and, 0x1f] - alu_shf[add_to_rx_freelist, add_to_rx_freelist, or, temp2, <<20] - alu[temp2, temp, and, 0x80] - alu_shf[add_to_rx_freelist, add_to_rx_freelist, or, temp2, <<18] - .end - - immed[zero, 0] - - /* - * Skip context 0 initialisation? - */ - .begin - br!=ctx[0, mpacket_receive_loop#] - .end - - /* - * Initialise local memory. - */ - .begin - .reg addr - .reg temp - - immed[temp, 0] - init_local_mem_loop#: - alu_shf[addr, --, b, temp, <>8] - bne[abort_rswerr#] - .end - - /* - * Point local memory pointer to this channel's state area. - */ - .begin - .reg chanaddr - - alu[chanaddr, $rsw0, and, 0x1f] - alu_shf[chanaddr, --, b, chanaddr, < abort) If everything's - * okay, update the RECEIVING flag to reflect our new state. - */ - .begin - .reg temp - .reg eop - - #if CHANNEL_FLAG_RECEIVING != 1 - #error CHANNEL_FLAG_RECEIVING is not 1 - #endif - - alu_shf[temp, 1, and, $rsw0, >>15] - alu[temp, temp, xor, CHANNEL_FLAGS] - alu[--, temp, and, CHANNEL_FLAG_RECEIVING] - beq[abort_proterr#] - - alu_shf[eop, 1, and, $rsw0, >>14] - alu[CHANNEL_FLAGS, temp, xor, eop] - .end - - /* - * Copy the mpacket into the right spot, and in case of EOP, - * write back the descriptor and pass the packet on. - */ - .begin - .reg buffer_offset - .reg _packet_length - .reg _packet_checksum - .reg _buffer_handle - .reg _buffer_start - .reg _buffer_length - - /* - * Determine buffer_offset, _packet_length and - * _packet_checksum. - */ - .begin - .reg temp - - alu[--, 1, and, $rsw0, >>15] - beq[not_sop#] - - immed[PACKET_LENGTH, 0] - immed[PACKET_CHECKSUM, 0] - - not_sop#: - alu[buffer_offset, --, b, PACKET_LENGTH] - alu_shf[temp, 0xff, and, $rsw0, >>16] - alu[_packet_length, buffer_offset, +, temp] - alu[PACKET_LENGTH, --, b, _packet_length] - - immed[temp, 0xffff] - alu[temp, $rsw1, and, temp] - alu[_packet_checksum, PACKET_CHECKSUM, +, temp] - alu[PACKET_CHECKSUM, --, b, _packet_checksum] - .end - - /* - * Allocate buffer in case of SOP. - */ - .begin - .reg temp - - alu[temp, 1, and, $rsw0, >>15] - beq[skip_buffer_alloc#] - - .begin - .sig zzz - .reg read $stemp $stemp2 - .xfer_order $stemp $stemp2 - - rx_nobufs#: - scratch[get, $stemp, zero, 0, 1], ctx_swap[zzz] - alu[_buffer_handle, --, b, $stemp] - beq[rx_nobufs#] - - sram[read, $stemp, _buffer_handle, 0, 2], - ctx_swap[zzz] - alu[_buffer_start, --, b, $stemp] - alu[_buffer_length, --, b, $stemp2] - .end - - skip_buffer_alloc#: - .end - - /* - * Resynchronise. - */ - .begin - ctx_arb[sig2] - local_csr_wr[SAME_ME_SIGNAL, (0x80 | (&sig2 << 3))] - .end - - /* - * Synchronise buffer state. - */ - .begin - .reg temp - - alu[temp, 1, and, $rsw0, >>15] - beq[copy_from_local_mem#] - - alu[BUFFER_HANDLE, --, b, _buffer_handle] - alu[BUFFER_START, --, b, _buffer_start] - alu[BUFFER_LENGTH, --, b, _buffer_length] - br[sync_state_done#] - - copy_from_local_mem#: - alu[_buffer_handle, --, b, BUFFER_HANDLE] - alu[_buffer_start, --, b, BUFFER_START] - alu[_buffer_length, --, b, BUFFER_LENGTH] - - sync_state_done#: - .end - -#if 0 - /* - * Debug buffer state management. - */ - .begin - .reg temp - - alu[temp, 1, and, $rsw0, >>14] - beq[no_poison#] - immed[BUFFER_HANDLE, 0xdead] - immed[BUFFER_START, 0xdead] - immed[BUFFER_LENGTH, 0xdead] - no_poison#: - - immed[temp, 0xdead] - alu[--, _buffer_handle, -, temp] - beq[state_corrupted#] - alu[--, _buffer_start, -, temp] - beq[state_corrupted#] - alu[--, _buffer_length, -, temp] - beq[state_corrupted#] - .end -#endif - - /* - * Check buffer length. - */ - .begin - alu[--, _buffer_length, -, _packet_length] - blo[buffer_overflow#] - .end - - /* - * Copy the mpacket and give back the RBUF element. - */ - .begin - .reg element - .reg xfer_size - .reg temp - .sig copy_sig - - alu_shf[element, 0x7f, and, $rsw0, >>24] - alu_shf[xfer_size, 0xff, and, $rsw0, >>16] - - alu[xfer_size, xfer_size, -, 1] - alu_shf[xfer_size, 0x10, or, xfer_size, >>3] - alu_shf[temp, 0x10, or, xfer_size, <<21] - alu_shf[temp, temp, or, element, <<11] - alu_shf[--, temp, or, 1, <<18] - - dram[rbuf_rd, --, _buffer_start, buffer_offset, max_8], - indirect_ref, sig_done[copy_sig] - ctx_arb[copy_sig] - - alu[temp, RBUF_ELEMENT_DONE, or, element, <<16] - msf[fast_wr, --, temp, 0] - .end - - /* - * If EOP, write back the packet descriptor. - */ - .begin - .reg write $stemp $stemp2 - .xfer_order $stemp $stemp2 - .sig zzz - - alu_shf[--, 1, and, $rsw0, >>14] - beq[no_writeback#] - - alu[$stemp, $rsw0, and, 0x1f] - alu[$stemp2, --, b, _packet_length] - sram[write, $stemp, _buffer_handle, 8, 2], ctx_swap[zzz] - - no_writeback#: - .end - - /* - * Resynchronise. - */ - .begin - ctx_arb[sig3] - local_csr_wr[SAME_ME_SIGNAL, (0x80 | (&sig3 << 3))] - .end - - /* - * If EOP, put the buffer back onto the scratch ring. - */ - .begin - .reg write $stemp - .sig zzz - - br_inp_state[SCR_Ring1_Status, rx_done_ring_overflow#] - - alu_shf[--, 1, and, $rsw0, >>14] - beq[mpacket_receive_loop#] - - alu[--, 1, and, $rsw0, >>10] - bne[rxerr#] - - alu[$stemp, --, b, _buffer_handle] - scratch[put, $stemp, zero, 4, 1], ctx_swap[zzz] - cap[fast_wr, 0, XSCALE_INT_A] - br[mpacket_receive_loop#] - - rxerr#: - alu[$stemp, --, b, _buffer_handle] - scratch[put, $stemp, zero, 0, 1], ctx_swap[zzz] - br[mpacket_receive_loop#] - .end - .end - - -abort_rswerr#: - halt - -abort_proterr#: - halt - -state_corrupted#: - halt - -buffer_overflow#: - halt - -rx_done_ring_overflow#: - halt - - diff --git a/trunk/drivers/net/ixp2000/ixp2400_rx.ucode b/trunk/drivers/net/ixp2000/ixp2400_rx.ucode deleted file mode 100644 index e8aee2f81aad..000000000000 --- a/trunk/drivers/net/ixp2000/ixp2400_rx.ucode +++ /dev/null @@ -1,130 +0,0 @@ -static struct ixp2000_uengine_code ixp2400_rx = -{ - .cpu_model_bitmask = 0x000003fe, - .cpu_min_revision = 0, - .cpu_max_revision = 255, - - .uengine_parameters = IXP2000_UENGINE_8_CONTEXTS | - IXP2000_UENGINE_PRN_UPDATE_EVERY | - IXP2000_UENGINE_NN_FROM_PREVIOUS | - IXP2000_UENGINE_ASSERT_EMPTY_AT_0 | - IXP2000_UENGINE_LM_ADDR1_PER_CONTEXT | - IXP2000_UENGINE_LM_ADDR0_PER_CONTEXT, - - .initial_reg_values = (struct ixp2000_reg_value []) { - { -1, -1 } - }, - - .num_insns = 109, - .insns = (u8 []) { - 0xf0, 0x00, 0x0c, 0xc0, 0x05, - 0xf4, 0x44, 0x0c, 0x00, 0x05, - 0xfc, 0x04, 0x4c, 0x00, 0x00, - 0xf0, 0x00, 0x00, 0x3b, 0x00, - 0xb4, 0x40, 0xf0, 0x3b, 0x1f, - 0x8a, 0xc0, 0x50, 0x3e, 0x05, - 0xb4, 0x40, 0xf0, 0x3b, 0x80, - 0x9a, 0xe0, 0x00, 0x3e, 0x05, - 0xf0, 0x00, 0x00, 0x07, 0x00, - 0xd8, 0x05, 0xc0, 0x00, 0x11, - 0xf0, 0x00, 0x00, 0x0f, 0x00, - 0x91, 0xb0, 0x20, 0x0e, 0x00, - 0xfc, 0x06, 0x60, 0x0b, 0x00, - 0xf0, 0x00, 0x0c, 0x03, 0x00, - 0xf0, 0x00, 0x0c, 0x03, 0x00, - 0xf0, 0x00, 0x0c, 0x03, 0x00, - 0xf0, 0x00, 0x0c, 0x02, 0x00, - 0xb0, 0xc0, 0x30, 0x0f, 0x01, - 0xa4, 0x70, 0x00, 0x0f, 0x20, - 0xd8, 0x02, 0xc0, 0x01, 0x00, - 0xfc, 0x10, 0xac, 0x23, 0x08, - 0xfc, 0x10, 0xac, 0x43, 0x10, - 0xfc, 0x10, 0xac, 0x63, 0x18, - 0xe0, 0x00, 0x00, 0x00, 0x02, - 0xfc, 0x10, 0xae, 0x23, 0x88, - 0x3d, 0x00, 0x04, 0x03, 0x20, - 0xe0, 0x00, 0x00, 0x00, 0x10, - 0x84, 0x82, 0x02, 0x01, 0x3b, - 0xd8, 0x1a, 0x00, 0x01, 0x01, - 0xb4, 0x00, 0x8c, 0x7d, 0x80, - 0x91, 0xb0, 0x80, 0x22, 0x00, - 0xfc, 0x06, 0x60, 0x23, 0x00, - 0xf0, 0x00, 0x0c, 0x03, 0x00, - 0xf0, 0x00, 0x0c, 0x03, 0x00, - 0xf0, 0x00, 0x0c, 0x03, 0x00, - 0x94, 0xf0, 0x92, 0x01, 0x21, - 0xac, 0x40, 0x60, 0x26, 0x00, - 0xa4, 0x30, 0x0c, 0x04, 0x06, - 0xd8, 0x1a, 0x40, 0x01, 0x00, - 0x94, 0xe0, 0xa2, 0x01, 0x21, - 0xac, 0x20, 0x00, 0x28, 0x06, - 0x84, 0xf2, 0x02, 0x01, 0x21, - 0xd8, 0x0b, 0x40, 0x01, 0x00, - 0xf0, 0x00, 0x0c, 0x02, 0x01, - 0xf0, 0x00, 0x0c, 0x02, 0x02, - 0xa0, 0x00, 0x08, 0x04, 0x00, - 0x95, 0x00, 0xc6, 0x01, 0xff, - 0xa0, 0x80, 0x10, 0x30, 0x00, - 0xa0, 0x60, 0x1c, 0x00, 0x01, - 0xf0, 0x0f, 0xf0, 0x33, 0xff, - 0xb4, 0x00, 0xc0, 0x31, 0x81, - 0xb0, 0x80, 0xb0, 0x32, 0x02, - 0xa0, 0x20, 0x20, 0x2c, 0x00, - 0x94, 0xf0, 0xd2, 0x01, 0x21, - 0xd8, 0x0f, 0x40, 0x01, 0x00, - 0x19, 0x40, 0x10, 0x04, 0x20, - 0xa0, 0x00, 0x26, 0x04, 0x00, - 0xd8, 0x0d, 0xc0, 0x01, 0x00, - 0x00, 0x42, 0x10, 0x80, 0x02, - 0xb0, 0x00, 0x46, 0x04, 0x00, - 0xb0, 0x00, 0x56, 0x08, 0x00, - 0xe0, 0x00, 0x00, 0x00, 0x04, - 0xfc, 0x10, 0xae, 0x43, 0x90, - 0x84, 0xf0, 0x32, 0x01, 0x21, - 0xd8, 0x11, 0x40, 0x01, 0x00, - 0xa0, 0x60, 0x3c, 0x00, 0x02, - 0xa0, 0x20, 0x40, 0x10, 0x00, - 0xa0, 0x20, 0x50, 0x14, 0x00, - 0xd8, 0x12, 0x00, 0x00, 0x18, - 0xa0, 0x00, 0x28, 0x0c, 0x00, - 0xb0, 0x00, 0x48, 0x10, 0x00, - 0xb0, 0x00, 0x58, 0x14, 0x00, - 0xaa, 0xf0, 0x00, 0x14, 0x01, - 0xd8, 0x1a, 0xc0, 0x01, 0x05, - 0x85, 0x80, 0x42, 0x01, 0xff, - 0x95, 0x00, 0x66, 0x01, 0xff, - 0xba, 0xc0, 0x60, 0x1b, 0x01, - 0x9a, 0x30, 0x60, 0x19, 0x30, - 0x9a, 0xb0, 0x70, 0x1a, 0x30, - 0x9b, 0x50, 0x78, 0x1e, 0x04, - 0x8a, 0xe2, 0x08, 0x1e, 0x21, - 0x6a, 0x4e, 0x00, 0x13, 0x00, - 0xe0, 0x00, 0x00, 0x00, 0x30, - 0x9b, 0x00, 0x7a, 0x92, 0x04, - 0x3d, 0x00, 0x04, 0x1f, 0x20, - 0x84, 0xe2, 0x02, 0x01, 0x21, - 0xd8, 0x16, 0x80, 0x01, 0x00, - 0xa4, 0x18, 0x0c, 0x7d, 0x80, - 0xa0, 0x58, 0x1c, 0x00, 0x01, - 0x01, 0x42, 0x00, 0xa0, 0x02, - 0xe0, 0x00, 0x00, 0x00, 0x08, - 0xfc, 0x10, 0xae, 0x63, 0x98, - 0xd8, 0x1b, 0x00, 0xc2, 0x14, - 0x84, 0xe2, 0x02, 0x01, 0x21, - 0xd8, 0x05, 0xc0, 0x01, 0x00, - 0x84, 0xa2, 0x02, 0x01, 0x21, - 0xd8, 0x19, 0x40, 0x01, 0x01, - 0xa0, 0x58, 0x0c, 0x00, 0x02, - 0x1a, 0x40, 0x00, 0x04, 0x24, - 0x33, 0x00, 0x01, 0x2f, 0x20, - 0xd8, 0x05, 0xc0, 0x00, 0x18, - 0xa0, 0x58, 0x0c, 0x00, 0x02, - 0x1a, 0x40, 0x00, 0x04, 0x20, - 0xd8, 0x05, 0xc0, 0x00, 0x18, - 0xe0, 0x00, 0x02, 0x00, 0x00, - 0xe0, 0x00, 0x02, 0x00, 0x00, - 0xe0, 0x00, 0x02, 0x00, 0x00, - 0xe0, 0x00, 0x02, 0x00, 0x00, - 0xe0, 0x00, 0x02, 0x00, 0x00, - } -}; diff --git a/trunk/drivers/net/ixp2000/ixp2400_tx.uc b/trunk/drivers/net/ixp2000/ixp2400_tx.uc deleted file mode 100644 index d090d1884fb7..000000000000 --- a/trunk/drivers/net/ixp2000/ixp2400_tx.uc +++ /dev/null @@ -1,272 +0,0 @@ -/* - * TX ucode for the Intel IXP2400 in POS-PHY mode. - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * 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. - * - * Assumptions made in this code: - * - The IXP2400 MSF is configured for POS-PHY mode, in a mode where - * only one TBUF partition is used. This includes, for example, - * 1x32 SPHY and 1x32 MPHY32, but not 4x8 SPHY or 1x32 MPHY4. (This - * is not an exhaustive list.) - * - The TBUF uses 64-byte mpackets. - * - TX descriptors reside in SRAM, and have the following format: - * struct tx_desc - * { - * // to uengine - * u32 buf_phys_addr; - * u32 pkt_length; - * u32 channel; - * }; - * - Packet data resides in DRAM. - * - Packet buffer addresses are 8-byte aligned. - * - Scratch ring 2 is tx_pending. - * - Scratch ring 3 is tx_done, and has status condition 'full'. - * - This code is run on all eight threads of the microengine it runs on. - */ - -#define TX_SEQUENCE_0 0x0060 -#define TBUF_CTRL 0x1800 - -#define PARTITION_SIZE 128 -#define PARTITION_THRESH 96 - - - .sig volatile sig1 - .sig volatile sig2 - .sig volatile sig3 - - .reg @old_tx_seq_0 - .reg @mpkts_in_flight - .reg @next_tbuf_mpacket - - .reg @buffer_handle - .reg @buffer_start - .reg @packet_length - .reg @channel - .reg @packet_offset - - .reg zero - - immed[zero, 0] - - /* - * Skip context 0 initialisation? - */ - .begin - br!=ctx[0, mpacket_tx_loop#] - .end - - /* - * Wait until all pending TBUF elements have been transmitted. - */ - .begin - .reg read $tx - .sig zzz - - loop_empty#: - msf[read, $tx, zero, TX_SEQUENCE_0, 1], ctx_swap[zzz] - alu_shf[--, --, b, $tx, >>31] - beq[loop_empty#] - - alu[@old_tx_seq_0, --, b, $tx] - .end - - immed[@mpkts_in_flight, 0] - alu[@next_tbuf_mpacket, @old_tx_seq_0, and, (PARTITION_SIZE - 1)] - - immed[@buffer_handle, 0] - - /* - * Initialise signal pipeline. - */ - .begin - local_csr_wr[SAME_ME_SIGNAL, (&sig1 << 3)] - .set_sig sig1 - - local_csr_wr[SAME_ME_SIGNAL, (&sig2 << 3)] - .set_sig sig2 - - local_csr_wr[SAME_ME_SIGNAL, (&sig3 << 3)] - .set_sig sig3 - .end - -mpacket_tx_loop#: - .begin - .reg tbuf_element_index - .reg buffer_handle - .reg sop_eop - .reg packet_data - .reg channel - .reg mpacket_size - - /* - * If there is no packet currently being transmitted, - * dequeue the next TX descriptor, and fetch the buffer - * address, packet length and destination channel number. - */ - .begin - .reg read $stemp $stemp2 $stemp3 - .xfer_order $stemp $stemp2 $stemp3 - .sig zzz - - ctx_arb[sig1] - - alu[--, --, b, @buffer_handle] - bne[already_got_packet#] - - tx_nobufs#: - scratch[get, $stemp, zero, 8, 1], ctx_swap[zzz] - alu[@buffer_handle, --, b, $stemp] - beq[tx_nobufs#] - - sram[read, $stemp, $stemp, 0, 3], ctx_swap[zzz] - alu[@buffer_start, --, b, $stemp] - alu[@packet_length, --, b, $stemp2] - beq[zero_byte_packet#] - alu[@channel, --, b, $stemp3] - immed[@packet_offset, 0] - - already_got_packet#: - local_csr_wr[SAME_ME_SIGNAL, (0x80 | (&sig1 << 3))] - .end - - /* - * Determine tbuf element index, SOP/EOP flags, mpacket - * offset and mpacket size and cache buffer_handle and - * channel number. - */ - .begin - alu[tbuf_element_index, --, b, @next_tbuf_mpacket] - alu[@next_tbuf_mpacket, @next_tbuf_mpacket, +, 1] - alu[@next_tbuf_mpacket, @next_tbuf_mpacket, and, - (PARTITION_SIZE - 1)] - - alu[buffer_handle, --, b, @buffer_handle] - immed[@buffer_handle, 0] - - immed[sop_eop, 1] - - alu[packet_data, --, b, @packet_offset] - bne[no_sop#] - alu[sop_eop, sop_eop, or, 2] - no_sop#: - alu[packet_data, packet_data, +, @buffer_start] - - alu[channel, --, b, @channel] - - alu[mpacket_size, @packet_length, -, @packet_offset] - alu[--, 64, -, mpacket_size] - bhs[eop#] - alu[@buffer_handle, --, b, buffer_handle] - immed[mpacket_size, 64] - alu[sop_eop, sop_eop, and, 2] - eop#: - - alu[@packet_offset, @packet_offset, +, mpacket_size] - .end - - /* - * Wait until there's enough space in the TBUF. - */ - .begin - .reg read $tx - .reg temp - .sig zzz - - ctx_arb[sig2] - - br[test_space#] - - loop_space#: - msf[read, $tx, zero, TX_SEQUENCE_0, 1], ctx_swap[zzz] - - alu[temp, $tx, -, @old_tx_seq_0] - alu[temp, temp, and, 0xff] - alu[@mpkts_in_flight, @mpkts_in_flight, -, temp] - - alu[@old_tx_seq_0, --, b, $tx] - - test_space#: - alu[--, PARTITION_THRESH, -, @mpkts_in_flight] - blo[loop_space#] - - alu[@mpkts_in_flight, @mpkts_in_flight, +, 1] - - local_csr_wr[SAME_ME_SIGNAL, (0x80 | (&sig2 << 3))] - .end - - /* - * Copy the packet data to the TBUF. - */ - .begin - .reg temp - .sig copy_sig - - alu[temp, mpacket_size, -, 1] - alu_shf[temp, 0x10, or, temp, >>3] - alu_shf[temp, 0x10, or, temp, <<21] - alu_shf[temp, temp, or, tbuf_element_index, <<11] - alu_shf[--, temp, or, 1, <<18] - - dram[tbuf_wr, --, packet_data, 0, max_8], - indirect_ref, sig_done[copy_sig] - ctx_arb[copy_sig] - .end - - /* - * Mark TBUF element as ready-to-be-transmitted. - */ - .begin - .reg write $tsw $tsw2 - .xfer_order $tsw $tsw2 - .reg temp - .sig zzz - - alu_shf[temp, channel, or, mpacket_size, <<24] - alu_shf[$tsw, temp, or, sop_eop, <<8] - immed[$tsw2, 0] - - immed[temp, TBUF_CTRL] - alu_shf[temp, temp, or, tbuf_element_index, <<3] - msf[write, $tsw, temp, 0, 2], ctx_swap[zzz] - .end - - /* - * Resynchronise. - */ - .begin - ctx_arb[sig3] - local_csr_wr[SAME_ME_SIGNAL, (0x80 | (&sig3 << 3))] - .end - - /* - * If this was an EOP mpacket, recycle the TX buffer - * and signal the host. - */ - .begin - .reg write $stemp - .sig zzz - - alu[--, sop_eop, and, 1] - beq[mpacket_tx_loop#] - - tx_done_ring_full#: - br_inp_state[SCR_Ring3_Status, tx_done_ring_full#] - - alu[$stemp, --, b, buffer_handle] - scratch[put, $stemp, zero, 12, 1], ctx_swap[zzz] - cap[fast_wr, 0, XSCALE_INT_A] - br[mpacket_tx_loop#] - .end - .end - - -zero_byte_packet#: - halt - - diff --git a/trunk/drivers/net/ixp2000/ixp2400_tx.ucode b/trunk/drivers/net/ixp2000/ixp2400_tx.ucode deleted file mode 100644 index a433e24b0a51..000000000000 --- a/trunk/drivers/net/ixp2000/ixp2400_tx.ucode +++ /dev/null @@ -1,98 +0,0 @@ -static struct ixp2000_uengine_code ixp2400_tx = -{ - .cpu_model_bitmask = 0x000003fe, - .cpu_min_revision = 0, - .cpu_max_revision = 255, - - .uengine_parameters = IXP2000_UENGINE_8_CONTEXTS | - IXP2000_UENGINE_PRN_UPDATE_EVERY | - IXP2000_UENGINE_NN_FROM_PREVIOUS | - IXP2000_UENGINE_ASSERT_EMPTY_AT_0 | - IXP2000_UENGINE_LM_ADDR1_PER_CONTEXT | - IXP2000_UENGINE_LM_ADDR0_PER_CONTEXT, - - .initial_reg_values = (struct ixp2000_reg_value []) { - { -1, -1 } - }, - - .num_insns = 77, - .insns = (u8 []) { - 0xf0, 0x00, 0x00, 0x07, 0x00, - 0xd8, 0x03, 0x00, 0x00, 0x11, - 0x3c, 0x40, 0x00, 0x04, 0xe0, - 0x81, 0xf2, 0x02, 0x01, 0x00, - 0xd8, 0x00, 0x80, 0x01, 0x00, - 0xb0, 0x08, 0x06, 0x00, 0x00, - 0xf0, 0x00, 0x0c, 0x00, 0x80, - 0xb4, 0x49, 0x02, 0x03, 0x7f, - 0xf0, 0x00, 0x02, 0x83, 0x00, - 0xfc, 0x10, 0xac, 0x23, 0x08, - 0xfc, 0x10, 0xac, 0x43, 0x10, - 0xfc, 0x10, 0xac, 0x63, 0x18, - 0xe0, 0x00, 0x00, 0x00, 0x02, - 0xa0, 0x30, 0x02, 0x80, 0x00, - 0xd8, 0x06, 0x00, 0x01, 0x01, - 0x19, 0x40, 0x00, 0x04, 0x28, - 0xb0, 0x0a, 0x06, 0x00, 0x00, - 0xd8, 0x03, 0xc0, 0x01, 0x00, - 0x00, 0x44, 0x00, 0x80, 0x80, - 0xa0, 0x09, 0x06, 0x00, 0x00, - 0xb0, 0x0b, 0x06, 0x04, 0x00, - 0xd8, 0x13, 0x00, 0x01, 0x00, - 0xb0, 0x0c, 0x06, 0x08, 0x00, - 0xf0, 0x00, 0x0c, 0x00, 0xa0, - 0xfc, 0x10, 0xae, 0x23, 0x88, - 0xa0, 0x00, 0x12, 0x40, 0x00, - 0xb0, 0xc9, 0x02, 0x43, 0x01, - 0xb4, 0x49, 0x02, 0x43, 0x7f, - 0xb0, 0x00, 0x22, 0x80, 0x00, - 0xf0, 0x00, 0x02, 0x83, 0x00, - 0xf0, 0x00, 0x0c, 0x04, 0x02, - 0xb0, 0x40, 0x6c, 0x00, 0xa0, - 0xd8, 0x08, 0x80, 0x01, 0x01, - 0xaa, 0x00, 0x2c, 0x08, 0x02, - 0xa0, 0xc0, 0x30, 0x18, 0x90, - 0xa0, 0x00, 0x43, 0x00, 0x00, - 0xba, 0xc0, 0x32, 0xc0, 0xa0, - 0xaa, 0xb0, 0x00, 0x0f, 0x40, - 0xd8, 0x0a, 0x80, 0x01, 0x04, - 0xb0, 0x0a, 0x00, 0x08, 0x00, - 0xf0, 0x00, 0x00, 0x0f, 0x40, - 0xa4, 0x00, 0x2c, 0x08, 0x02, - 0xa0, 0x8a, 0x00, 0x0c, 0xa0, - 0xe0, 0x00, 0x00, 0x00, 0x04, - 0xd8, 0x0c, 0x80, 0x00, 0x18, - 0x3c, 0x40, 0x00, 0x04, 0xe0, - 0xba, 0x80, 0x42, 0x01, 0x80, - 0xb4, 0x40, 0x40, 0x13, 0xff, - 0xaa, 0x88, 0x00, 0x10, 0x80, - 0xb0, 0x08, 0x06, 0x00, 0x00, - 0xaa, 0xf0, 0x0d, 0x80, 0x80, - 0xd8, 0x0b, 0x40, 0x01, 0x05, - 0xa0, 0x88, 0x0c, 0x04, 0x80, - 0xfc, 0x10, 0xae, 0x43, 0x90, - 0xba, 0xc0, 0x50, 0x0f, 0x01, - 0x9a, 0x30, 0x50, 0x15, 0x30, - 0x9a, 0xb0, 0x50, 0x16, 0x30, - 0x9b, 0x50, 0x58, 0x16, 0x01, - 0x8a, 0xe2, 0x08, 0x16, 0x21, - 0x6b, 0x4e, 0x00, 0x83, 0x03, - 0xe0, 0x00, 0x00, 0x00, 0x30, - 0x9a, 0x80, 0x70, 0x0e, 0x04, - 0x8b, 0x88, 0x08, 0x1e, 0x02, - 0xf0, 0x00, 0x0c, 0x01, 0x81, - 0xf0, 0x01, 0x80, 0x1f, 0x00, - 0x9b, 0xd0, 0x78, 0x1e, 0x01, - 0x3d, 0x42, 0x00, 0x1c, 0x20, - 0xe0, 0x00, 0x00, 0x00, 0x08, - 0xfc, 0x10, 0xae, 0x63, 0x98, - 0xa4, 0x30, 0x0c, 0x04, 0x02, - 0xd8, 0x03, 0x00, 0x01, 0x00, - 0xd8, 0x11, 0xc1, 0x42, 0x14, - 0xa0, 0x18, 0x00, 0x08, 0x00, - 0x1a, 0x40, 0x00, 0x04, 0x2c, - 0x33, 0x00, 0x01, 0x2f, 0x20, - 0xd8, 0x03, 0x00, 0x00, 0x18, - 0xe0, 0x00, 0x02, 0x00, 0x00, - } -}; diff --git a/trunk/drivers/net/ixp2000/ixpdev.c b/trunk/drivers/net/ixp2000/ixpdev.c deleted file mode 100644 index 09f03f493bea..000000000000 --- a/trunk/drivers/net/ixp2000/ixpdev.c +++ /dev/null @@ -1,421 +0,0 @@ -/* - * IXP2000 MSF network device driver - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ixp2400_rx.ucode" -#include "ixp2400_tx.ucode" -#include "ixpdev_priv.h" -#include "ixpdev.h" - -#define DRV_MODULE_VERSION "0.2" - -static int nds_count; -static struct net_device **nds; -static int nds_open; -static void (*set_port_admin_status)(int port, int up); - -static struct ixpdev_rx_desc * const rx_desc = - (struct ixpdev_rx_desc *)(IXP2000_SRAM0_VIRT_BASE + RX_BUF_DESC_BASE); -static struct ixpdev_tx_desc * const tx_desc = - (struct ixpdev_tx_desc *)(IXP2000_SRAM0_VIRT_BASE + TX_BUF_DESC_BASE); -static int tx_pointer; - - -static int ixpdev_xmit(struct sk_buff *skb, struct net_device *dev) -{ - struct ixpdev_priv *ip = netdev_priv(dev); - struct ixpdev_tx_desc *desc; - int entry; - - if (unlikely(skb->len > PAGE_SIZE)) { - /* @@@ Count drops. */ - dev_kfree_skb(skb); - return 0; - } - - entry = tx_pointer; - tx_pointer = (tx_pointer + 1) % TX_BUF_COUNT; - - desc = tx_desc + entry; - desc->pkt_length = skb->len; - desc->channel = ip->channel; - - skb_copy_and_csum_dev(skb, phys_to_virt(desc->buf_addr)); - dev_kfree_skb(skb); - - ixp2000_reg_write(RING_TX_PENDING, - TX_BUF_DESC_BASE + (entry * sizeof(struct ixpdev_tx_desc))); - - dev->trans_start = jiffies; - - local_irq_disable(); - ip->tx_queue_entries++; - if (ip->tx_queue_entries == TX_BUF_COUNT_PER_CHAN) - netif_stop_queue(dev); - local_irq_enable(); - - return 0; -} - - -static int ixpdev_rx(struct net_device *dev, int *budget) -{ - while (*budget > 0) { - struct ixpdev_rx_desc *desc; - struct sk_buff *skb; - void *buf; - u32 _desc; - - _desc = ixp2000_reg_read(RING_RX_DONE); - if (_desc == 0) - return 0; - - desc = rx_desc + - ((_desc - RX_BUF_DESC_BASE) / sizeof(struct ixpdev_rx_desc)); - buf = phys_to_virt(desc->buf_addr); - - if (desc->pkt_length < 4 || desc->pkt_length > PAGE_SIZE) { - printk(KERN_ERR "ixp2000: rx err, length %d\n", - desc->pkt_length); - goto err; - } - - if (desc->channel < 0 || desc->channel >= nds_count) { - printk(KERN_ERR "ixp2000: rx err, channel %d\n", - desc->channel); - goto err; - } - - /* @@@ Make FCS stripping configurable. */ - desc->pkt_length -= 4; - - if (unlikely(!netif_running(nds[desc->channel]))) - goto err; - - skb = dev_alloc_skb(desc->pkt_length + 2); - if (likely(skb != NULL)) { - skb->dev = nds[desc->channel]; - skb_reserve(skb, 2); - eth_copy_and_sum(skb, buf, desc->pkt_length, 0); - skb_put(skb, desc->pkt_length); - skb->protocol = eth_type_trans(skb, skb->dev); - - skb->dev->last_rx = jiffies; - - netif_receive_skb(skb); - } - -err: - ixp2000_reg_write(RING_RX_PENDING, _desc); - dev->quota--; - (*budget)--; - } - - return 1; -} - -/* dev always points to nds[0]. */ -static int ixpdev_poll(struct net_device *dev, int *budget) -{ - /* @@@ Have to stop polling when nds[0] is administratively - * downed while we are polling. */ - do { - ixp2000_reg_write(IXP2000_IRQ_THD_RAW_STATUS_A_0, 0x00ff); - - if (ixpdev_rx(dev, budget)) - return 1; - } while (ixp2000_reg_read(IXP2000_IRQ_THD_RAW_STATUS_A_0) & 0x00ff); - - netif_rx_complete(dev); - ixp2000_reg_write(IXP2000_IRQ_THD_ENABLE_SET_A_0, 0x00ff); - - return 0; -} - -static void ixpdev_tx_complete(void) -{ - int channel; - u32 wake; - - wake = 0; - while (1) { - struct ixpdev_priv *ip; - u32 desc; - int entry; - - desc = ixp2000_reg_read(RING_TX_DONE); - if (desc == 0) - break; - - /* @@@ Check whether entries come back in order. */ - entry = (desc - TX_BUF_DESC_BASE) / sizeof(struct ixpdev_tx_desc); - channel = tx_desc[entry].channel; - - if (channel < 0 || channel >= nds_count) { - printk(KERN_ERR "ixp2000: txcomp channel index " - "out of bounds (%d, %.8i, %d)\n", - channel, (unsigned int)desc, entry); - continue; - } - - ip = netdev_priv(nds[channel]); - if (ip->tx_queue_entries == TX_BUF_COUNT_PER_CHAN) - wake |= 1 << channel; - ip->tx_queue_entries--; - } - - for (channel = 0; wake != 0; channel++) { - if (wake & (1 << channel)) { - netif_wake_queue(nds[channel]); - wake &= ~(1 << channel); - } - } -} - -static irqreturn_t ixpdev_interrupt(int irq, void *dev_id, struct pt_regs *regs) -{ - u32 status; - - status = ixp2000_reg_read(IXP2000_IRQ_THD_STATUS_A_0); - if (status == 0) - return IRQ_NONE; - - /* - * Any of the eight receive units signaled RX? - */ - if (status & 0x00ff) { - ixp2000_reg_wrb(IXP2000_IRQ_THD_ENABLE_CLEAR_A_0, 0x00ff); - if (likely(__netif_rx_schedule_prep(nds[0]))) { - __netif_rx_schedule(nds[0]); - } else { - printk(KERN_CRIT "ixp2000: irq while polling!!\n"); - } - } - - /* - * Any of the eight transmit units signaled TXdone? - */ - if (status & 0xff00) { - ixp2000_reg_wrb(IXP2000_IRQ_THD_RAW_STATUS_A_0, 0xff00); - ixpdev_tx_complete(); - } - - return IRQ_HANDLED; -} - -#ifdef CONFIG_NET_POLL_CONTROLLER -static void ixpdev_poll_controller(struct net_device *dev) -{ - disable_irq(IRQ_IXP2000_THDA0); - ixpdev_interrupt(IRQ_IXP2000_THDA0, dev, NULL); - enable_irq(IRQ_IXP2000_THDA0); -} -#endif - -static int ixpdev_open(struct net_device *dev) -{ - struct ixpdev_priv *ip = netdev_priv(dev); - int err; - - if (!nds_open++) { - err = request_irq(IRQ_IXP2000_THDA0, ixpdev_interrupt, - SA_SHIRQ, "ixp2000_eth", nds); - if (err) { - nds_open--; - return err; - } - - ixp2000_reg_write(IXP2000_IRQ_THD_ENABLE_SET_A_0, 0xffff); - } - - set_port_admin_status(ip->channel, 1); - netif_start_queue(dev); - - return 0; -} - -static int ixpdev_close(struct net_device *dev) -{ - struct ixpdev_priv *ip = netdev_priv(dev); - - netif_stop_queue(dev); - set_port_admin_status(ip->channel, 0); - - if (!--nds_open) { - ixp2000_reg_write(IXP2000_IRQ_THD_ENABLE_CLEAR_A_0, 0xffff); - free_irq(IRQ_IXP2000_THDA0, nds); - } - - return 0; -} - -struct net_device *ixpdev_alloc(int channel, int sizeof_priv) -{ - struct net_device *dev; - struct ixpdev_priv *ip; - - dev = alloc_etherdev(sizeof_priv); - if (dev == NULL) - return NULL; - - dev->hard_start_xmit = ixpdev_xmit; - dev->poll = ixpdev_poll; - dev->open = ixpdev_open; - dev->stop = ixpdev_close; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = ixpdev_poll_controller; -#endif - - dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; - dev->weight = 64; - - ip = netdev_priv(dev); - ip->channel = channel; - ip->tx_queue_entries = 0; - - return dev; -} - -int ixpdev_init(int __nds_count, struct net_device **__nds, - void (*__set_port_admin_status)(int port, int up)) -{ - int i; - int err; - - if (RX_BUF_COUNT > 192 || TX_BUF_COUNT > 192) { - static void __too_many_rx_or_tx_buffers(void); - __too_many_rx_or_tx_buffers(); - } - - printk(KERN_INFO "IXP2000 MSF ethernet driver %s\n", DRV_MODULE_VERSION); - - nds_count = __nds_count; - nds = __nds; - set_port_admin_status = __set_port_admin_status; - - for (i = 0; i < RX_BUF_COUNT; i++) { - void *buf; - - buf = (void *)get_zeroed_page(GFP_KERNEL); - if (buf == NULL) { - err = -ENOMEM; - while (--i >= 0) - free_page((unsigned long)phys_to_virt(rx_desc[i].buf_addr)); - goto err_out; - } - rx_desc[i].buf_addr = virt_to_phys(buf); - rx_desc[i].buf_length = PAGE_SIZE; - } - - /* @@@ Maybe we shouldn't be preallocating TX buffers. */ - for (i = 0; i < TX_BUF_COUNT; i++) { - void *buf; - - buf = (void *)get_zeroed_page(GFP_KERNEL); - if (buf == NULL) { - err = -ENOMEM; - while (--i >= 0) - free_page((unsigned long)phys_to_virt(tx_desc[i].buf_addr)); - goto err_free_rx; - } - tx_desc[i].buf_addr = virt_to_phys(buf); - } - - /* 256 entries, ring status set means 'empty', base address 0x0000. */ - ixp2000_reg_write(RING_RX_PENDING_BASE, 0x44000000); - ixp2000_reg_write(RING_RX_PENDING_HEAD, 0x00000000); - ixp2000_reg_write(RING_RX_PENDING_TAIL, 0x00000000); - - /* 256 entries, ring status set means 'full', base address 0x0400. */ - ixp2000_reg_write(RING_RX_DONE_BASE, 0x40000400); - ixp2000_reg_write(RING_RX_DONE_HEAD, 0x00000000); - ixp2000_reg_write(RING_RX_DONE_TAIL, 0x00000000); - - for (i = 0; i < RX_BUF_COUNT; i++) { - ixp2000_reg_write(RING_RX_PENDING, - RX_BUF_DESC_BASE + (i * sizeof(struct ixpdev_rx_desc))); - } - - ixp2000_uengine_load(0, &ixp2400_rx); - ixp2000_uengine_start_contexts(0, 0xff); - - /* 256 entries, ring status set means 'empty', base address 0x0800. */ - ixp2000_reg_write(RING_TX_PENDING_BASE, 0x44000800); - ixp2000_reg_write(RING_TX_PENDING_HEAD, 0x00000000); - ixp2000_reg_write(RING_TX_PENDING_TAIL, 0x00000000); - - /* 256 entries, ring status set means 'full', base address 0x0c00. */ - ixp2000_reg_write(RING_TX_DONE_BASE, 0x40000c00); - ixp2000_reg_write(RING_TX_DONE_HEAD, 0x00000000); - ixp2000_reg_write(RING_TX_DONE_TAIL, 0x00000000); - - ixp2000_uengine_load(1, &ixp2400_tx); - ixp2000_uengine_start_contexts(1, 0xff); - - for (i = 0; i < nds_count; i++) { - err = register_netdev(nds[i]); - if (err) { - while (--i >= 0) - unregister_netdev(nds[i]); - goto err_free_tx; - } - } - - for (i = 0; i < nds_count; i++) { - printk(KERN_INFO "%s: IXP2000 MSF ethernet (port %d), " - "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x.\n", nds[i]->name, i, - nds[i]->dev_addr[0], nds[i]->dev_addr[1], - nds[i]->dev_addr[2], nds[i]->dev_addr[3], - nds[i]->dev_addr[4], nds[i]->dev_addr[5]); - } - - return 0; - -err_free_tx: - for (i = 0; i < TX_BUF_COUNT; i++) - free_page((unsigned long)phys_to_virt(tx_desc[i].buf_addr)); - -err_free_rx: - for (i = 0; i < RX_BUF_COUNT; i++) - free_page((unsigned long)phys_to_virt(rx_desc[i].buf_addr)); - -err_out: - return err; -} - -void ixpdev_deinit(void) -{ - int i; - - /* @@@ Flush out pending packets. */ - - for (i = 0; i < nds_count; i++) - unregister_netdev(nds[i]); - - ixp2000_uengine_stop_contexts(1, 0xff); - ixp2000_uengine_stop_contexts(0, 0xff); - ixp2000_uengine_reset(0x3); - - for (i = 0; i < TX_BUF_COUNT; i++) - free_page((unsigned long)phys_to_virt(tx_desc[i].buf_addr)); - - for (i = 0; i < RX_BUF_COUNT; i++) - free_page((unsigned long)phys_to_virt(rx_desc[i].buf_addr)); -} diff --git a/trunk/drivers/net/ixp2000/ixpdev.h b/trunk/drivers/net/ixp2000/ixpdev.h deleted file mode 100644 index bd686cb63058..000000000000 --- a/trunk/drivers/net/ixp2000/ixpdev.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * IXP2000 MSF network device driver - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef __IXPDEV_H -#define __IXPDEV_H - -struct ixpdev_priv -{ - int channel; - int tx_queue_entries; -}; - -struct net_device *ixpdev_alloc(int channel, int sizeof_priv); -int ixpdev_init(int num_ports, struct net_device **nds, - void (*set_port_admin_status)(int port, int up)); -void ixpdev_deinit(void); - - -#endif diff --git a/trunk/drivers/net/ixp2000/ixpdev_priv.h b/trunk/drivers/net/ixp2000/ixpdev_priv.h deleted file mode 100644 index 86aa08ea0c33..000000000000 --- a/trunk/drivers/net/ixp2000/ixpdev_priv.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * IXP2000 MSF network device driver - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef __IXPDEV_PRIV_H -#define __IXPDEV_PRIV_H - -#define RX_BUF_DESC_BASE 0x00001000 -#define RX_BUF_COUNT ((3 * PAGE_SIZE) / (4 * sizeof(struct ixpdev_rx_desc))) -#define TX_BUF_DESC_BASE 0x00002000 -#define TX_BUF_COUNT ((3 * PAGE_SIZE) / (4 * sizeof(struct ixpdev_tx_desc))) -#define TX_BUF_COUNT_PER_CHAN (TX_BUF_COUNT / 4) - -#define RING_RX_PENDING ((u32 *)IXP2000_SCRATCH_RING_VIRT_BASE) -#define RING_RX_DONE ((u32 *)(IXP2000_SCRATCH_RING_VIRT_BASE + 4)) -#define RING_TX_PENDING ((u32 *)(IXP2000_SCRATCH_RING_VIRT_BASE + 8)) -#define RING_TX_DONE ((u32 *)(IXP2000_SCRATCH_RING_VIRT_BASE + 12)) - -#define SCRATCH_REG(x) ((u32 *)(IXP2000_GLOBAL_REG_VIRT_BASE | 0x0800 | (x))) -#define RING_RX_PENDING_BASE SCRATCH_REG(0x00) -#define RING_RX_PENDING_HEAD SCRATCH_REG(0x04) -#define RING_RX_PENDING_TAIL SCRATCH_REG(0x08) -#define RING_RX_DONE_BASE SCRATCH_REG(0x10) -#define RING_RX_DONE_HEAD SCRATCH_REG(0x14) -#define RING_RX_DONE_TAIL SCRATCH_REG(0x18) -#define RING_TX_PENDING_BASE SCRATCH_REG(0x20) -#define RING_TX_PENDING_HEAD SCRATCH_REG(0x24) -#define RING_TX_PENDING_TAIL SCRATCH_REG(0x28) -#define RING_TX_DONE_BASE SCRATCH_REG(0x30) -#define RING_TX_DONE_HEAD SCRATCH_REG(0x34) -#define RING_TX_DONE_TAIL SCRATCH_REG(0x38) - -struct ixpdev_rx_desc -{ - u32 buf_addr; - u32 buf_length; - u32 channel; - u32 pkt_length; -}; - -struct ixpdev_tx_desc -{ - u32 buf_addr; - u32 pkt_length; - u32 channel; - u32 unused; -}; - - -#endif diff --git a/trunk/drivers/net/ixp2000/pm3386.c b/trunk/drivers/net/ixp2000/pm3386.c deleted file mode 100644 index 5c7ab7564053..000000000000 --- a/trunk/drivers/net/ixp2000/pm3386.c +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Helper functions for the PM3386s on the Radisys ENP2611 - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * 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 -#include -#include -#include -#include -#include "pm3386.h" - -/* - * Read from register 'reg' of PM3386 device 'pm'. - */ -static u16 pm3386_reg_read(int pm, int reg) -{ - void *_reg; - u16 value; - - _reg = (void *)ENP2611_PM3386_0_VIRT_BASE; - if (pm == 1) - _reg = (void *)ENP2611_PM3386_1_VIRT_BASE; - - value = *((volatile u16 *)(_reg + (reg << 1))); - -// printk(KERN_INFO "pm3386_reg_read(%d, %.3x) = %.8x\n", pm, reg, value); - - return value; -} - -/* - * Write to register 'reg' of PM3386 device 'pm', and perform - * a readback from the identification register. - */ -static void pm3386_reg_write(int pm, int reg, u16 value) -{ - void *_reg; - u16 dummy; - -// printk(KERN_INFO "pm3386_reg_write(%d, %.3x, %.8x)\n", pm, reg, value); - - _reg = (void *)ENP2611_PM3386_0_VIRT_BASE; - if (pm == 1) - _reg = (void *)ENP2611_PM3386_1_VIRT_BASE; - - *((volatile u16 *)(_reg + (reg << 1))) = value; - - dummy = *((volatile u16 *)_reg); - __asm__ __volatile__("mov %0, %0" : "+r" (dummy)); -} - -/* - * Read from port 'port' register 'reg', where the registers - * for the different ports are 'spacing' registers apart. - */ -static u16 pm3386_port_reg_read(int port, int _reg, int spacing) -{ - int reg; - - reg = _reg; - if (port & 1) - reg += spacing; - - return pm3386_reg_read(port >> 1, reg); -} - -/* - * Write to port 'port' register 'reg', where the registers - * for the different ports are 'spacing' registers apart. - */ -static void pm3386_port_reg_write(int port, int _reg, int spacing, u16 value) -{ - int reg; - - reg = _reg; - if (port & 1) - reg += spacing; - - pm3386_reg_write(port >> 1, reg, value); -} - - -void pm3386_reset(void) -{ - u8 mac[3][6]; - - /* Save programmed MAC addresses. */ - pm3386_get_mac(0, mac[0]); - pm3386_get_mac(1, mac[1]); - pm3386_get_mac(2, mac[2]); - - /* Assert analog and digital reset. */ - pm3386_reg_write(0, 0x002, 0x0060); - pm3386_reg_write(1, 0x002, 0x0060); - mdelay(1); - - /* Deassert analog reset. */ - pm3386_reg_write(0, 0x002, 0x0062); - pm3386_reg_write(1, 0x002, 0x0062); - mdelay(10); - - /* Deassert digital reset. */ - pm3386_reg_write(0, 0x002, 0x0063); - pm3386_reg_write(1, 0x002, 0x0063); - mdelay(10); - - /* Restore programmed MAC addresses. */ - pm3386_set_mac(0, mac[0]); - pm3386_set_mac(1, mac[1]); - pm3386_set_mac(2, mac[2]); - - /* Disable carrier on all ports. */ - pm3386_set_carrier(0, 0); - pm3386_set_carrier(1, 0); - pm3386_set_carrier(2, 0); -} - -static u16 swaph(u16 x) -{ - return ((x << 8) | (x >> 8)) & 0xffff; -} - -void pm3386_init_port(int port) -{ - int pm = port >> 1; - - /* - * Work around ENP2611 bootloader programming MAC address - * in reverse. - */ - if (pm3386_port_reg_read(port, 0x30a, 0x100) == 0x0000 && - (pm3386_port_reg_read(port, 0x309, 0x100) & 0xff00) == 0x5000) { - u16 temp[3]; - - temp[0] = pm3386_port_reg_read(port, 0x308, 0x100); - temp[1] = pm3386_port_reg_read(port, 0x309, 0x100); - temp[2] = pm3386_port_reg_read(port, 0x30a, 0x100); - pm3386_port_reg_write(port, 0x308, 0x100, swaph(temp[2])); - pm3386_port_reg_write(port, 0x309, 0x100, swaph(temp[1])); - pm3386_port_reg_write(port, 0x30a, 0x100, swaph(temp[0])); - } - - /* - * Initialise narrowbanding mode. See application note 2010486 - * for more information. (@@@ We also need to issue a reset - * when ROOL or DOOL are detected.) - */ - pm3386_port_reg_write(port, 0x708, 0x10, 0xd055); - udelay(500); - pm3386_port_reg_write(port, 0x708, 0x10, 0x5055); - - /* - * SPI-3 ingress block. Set 64 bytes SPI-3 burst size - * towards SPI-3 bridge. - */ - pm3386_port_reg_write(port, 0x122, 0x20, 0x0002); - - /* - * Enable ingress protocol checking, and soft reset the - * SPI-3 ingress block. - */ - pm3386_reg_write(pm, 0x103, 0x0003); - while (!(pm3386_reg_read(pm, 0x103) & 0x80)) - ; - - /* - * SPI-3 egress block. Gather 12288 bytes of the current - * packet in the TX fifo before initiating transmit on the - * SERDES interface. (Prevents TX underflows.) - */ - pm3386_port_reg_write(port, 0x221, 0x20, 0x0007); - - /* - * Enforce odd parity from the SPI-3 bridge, and soft reset - * the SPI-3 egress block. - */ - pm3386_reg_write(pm, 0x203, 0x000d & ~(4 << (port & 1))); - while ((pm3386_reg_read(pm, 0x203) & 0x000c) != 0x000c) - ; - - /* - * EGMAC block. Set this channels to reject long preambles, - * not send or transmit PAUSE frames, enable preamble checking, - * disable frame length checking, enable FCS appending, enable - * TX frame padding. - */ - pm3386_port_reg_write(port, 0x302, 0x100, 0x0113); - - /* - * Soft reset the EGMAC block. - */ - pm3386_port_reg_write(port, 0x301, 0x100, 0x8000); - pm3386_port_reg_write(port, 0x301, 0x100, 0x0000); - - /* - * Auto-sense autonegotiation status. - */ - pm3386_port_reg_write(port, 0x306, 0x100, 0x0100); - - /* - * Allow reception of jumbo frames. - */ - pm3386_port_reg_write(port, 0x310, 0x100, 9018); - - /* - * Allow transmission of jumbo frames. - */ - pm3386_port_reg_write(port, 0x336, 0x100, 9018); - - /* @@@ Should set 0x337/0x437 (RX forwarding threshold.) */ - - /* - * Set autonegotiation parameters to 'no PAUSE, full duplex.' - */ - pm3386_port_reg_write(port, 0x31c, 0x100, 0x0020); - - /* - * Enable and restart autonegotiation. - */ - pm3386_port_reg_write(port, 0x318, 0x100, 0x0003); - pm3386_port_reg_write(port, 0x318, 0x100, 0x0002); -} - -void pm3386_get_mac(int port, u8 *mac) -{ - u16 temp; - - temp = pm3386_port_reg_read(port, 0x308, 0x100); - mac[0] = temp & 0xff; - mac[1] = (temp >> 8) & 0xff; - - temp = pm3386_port_reg_read(port, 0x309, 0x100); - mac[2] = temp & 0xff; - mac[3] = (temp >> 8) & 0xff; - - temp = pm3386_port_reg_read(port, 0x30a, 0x100); - mac[4] = temp & 0xff; - mac[5] = (temp >> 8) & 0xff; -} - -void pm3386_set_mac(int port, u8 *mac) -{ - pm3386_port_reg_write(port, 0x308, 0x100, (mac[1] << 8) | mac[0]); - pm3386_port_reg_write(port, 0x309, 0x100, (mac[3] << 8) | mac[2]); - pm3386_port_reg_write(port, 0x30a, 0x100, (mac[5] << 8) | mac[4]); -} - -static u32 pm3386_get_stat(int port, u16 base) -{ - u32 value; - - value = pm3386_port_reg_read(port, base, 0x100); - value |= pm3386_port_reg_read(port, base + 1, 0x100) << 16; - - return value; -} - -void pm3386_get_stats(int port, struct net_device_stats *stats) -{ - /* - * Snapshot statistics counters. - */ - pm3386_port_reg_write(port, 0x500, 0x100, 0x0001); - while (pm3386_port_reg_read(port, 0x500, 0x100) & 0x0001) - ; - - memset(stats, 0, sizeof(*stats)); - - stats->rx_packets = pm3386_get_stat(port, 0x510); - stats->tx_packets = pm3386_get_stat(port, 0x590); - stats->rx_bytes = pm3386_get_stat(port, 0x514); - stats->tx_bytes = pm3386_get_stat(port, 0x594); - /* @@@ Add other stats. */ -} - -void pm3386_set_carrier(int port, int state) -{ - pm3386_port_reg_write(port, 0x703, 0x10, state ? 0x1001 : 0x0000); -} - -int pm3386_is_link_up(int port) -{ - u16 temp; - - temp = pm3386_port_reg_read(port, 0x31a, 0x100); - temp = pm3386_port_reg_read(port, 0x31a, 0x100); - - return !!(temp & 0x0002); -} - -void pm3386_enable_rx(int port) -{ - u16 temp; - - temp = pm3386_port_reg_read(port, 0x303, 0x100); - temp |= 0x1000; - pm3386_port_reg_write(port, 0x303, 0x100, temp); -} - -void pm3386_disable_rx(int port) -{ - u16 temp; - - temp = pm3386_port_reg_read(port, 0x303, 0x100); - temp &= 0xefff; - pm3386_port_reg_write(port, 0x303, 0x100, temp); -} - -void pm3386_enable_tx(int port) -{ - u16 temp; - - temp = pm3386_port_reg_read(port, 0x303, 0x100); - temp |= 0x4000; - pm3386_port_reg_write(port, 0x303, 0x100, temp); -} - -void pm3386_disable_tx(int port) -{ - u16 temp; - - temp = pm3386_port_reg_read(port, 0x303, 0x100); - temp &= 0xbfff; - pm3386_port_reg_write(port, 0x303, 0x100, temp); -} - -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/net/ixp2000/pm3386.h b/trunk/drivers/net/ixp2000/pm3386.h deleted file mode 100644 index fe92bb056ac4..000000000000 --- a/trunk/drivers/net/ixp2000/pm3386.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Helper functions for the PM3386s on the Radisys ENP2611 - * Copyright (C) 2004, 2005 Lennert Buytenhek - * Dedicated to Marija Kulikova. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef __PM3386_H -#define __PM3386_H - -void pm3386_reset(void); -void pm3386_init_port(int port); -void pm3386_get_mac(int port, u8 *mac); -void pm3386_set_mac(int port, u8 *mac); -void pm3386_get_stats(int port, struct net_device_stats *stats); -void pm3386_set_carrier(int port, int state); -int pm3386_is_link_up(int port); -void pm3386_enable_rx(int port); -void pm3386_disable_rx(int port); -void pm3386_enable_tx(int port); -void pm3386_disable_tx(int port); - - -#endif diff --git a/trunk/drivers/net/jazzsonic.c b/trunk/drivers/net/jazzsonic.c index 272d331d29cd..b039bd89ceb9 100644 --- a/trunk/drivers/net/jazzsonic.c +++ b/trunk/drivers/net/jazzsonic.c @@ -296,7 +296,7 @@ static int __init jazz_sonic_init_module(void) } jazz_sonic_device = platform_device_alloc(jazz_sonic_string, 0); - if (!jazz_sonic_device) + if (!jazz_sonnic_device) goto out_unregister; if (platform_device_add(jazz_sonic_device)) { @@ -307,7 +307,7 @@ static int __init jazz_sonic_init_module(void) return 0; out_unregister: - platform_driver_unregister(&jazz_sonic_driver); + driver_unregister(&jazz_sonic_driver); return -ENOMEM; } diff --git a/trunk/drivers/net/mipsnet.h b/trunk/drivers/net/mipsnet.h index 026c732024c9..878535953cb1 100644 --- a/trunk/drivers/net/mipsnet.h +++ b/trunk/drivers/net/mipsnet.h @@ -1,8 +1,28 @@ -/* - * 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. - */ +// +// +// Unpublished work (c) MIPS Technologies, Inc. All rights reserved. +// Unpublished rights reserved under the copyright laws of the U.S.A. and +// other countries. +// +// PROPRIETARY / SECRET CONFIDENTIAL INFORMATION OF MIPS TECHNOLOGIES, INC. +// FOR INTERNAL USE ONLY. +// +// Under no circumstances (contract or otherwise) may this information be +// disclosed to, or copied, modified or used by anyone other than employees +// or contractors of MIPS Technologies having a need to know. +// +// +//++ +// File: MIPS_Net.h +// +// Description: +// The definition of the emulated MIPSNET device's interface. +// +// Notes: This include file needs to work from a Linux device drivers. +// +//-- +// + #ifndef __MIPSNET_H #define __MIPSNET_H diff --git a/trunk/drivers/net/ns83820.c b/trunk/drivers/net/ns83820.c index b0c3b6ab6263..f857ae94d261 100644 --- a/trunk/drivers/net/ns83820.c +++ b/trunk/drivers/net/ns83820.c @@ -115,7 +115,6 @@ #include #include #include -#include #include #include diff --git a/trunk/drivers/net/pcmcia/fmvj18x_cs.c b/trunk/drivers/net/pcmcia/fmvj18x_cs.c index 356f50909222..384a736a0d2f 100644 --- a/trunk/drivers/net/pcmcia/fmvj18x_cs.c +++ b/trunk/drivers/net/pcmcia/fmvj18x_cs.c @@ -131,9 +131,10 @@ typedef struct local_info_t { u_short tx_queue_len; cardtype_t cardtype; u_short sent; + u_char mc_filter[8]; } local_info_t; -#define MC_FILTERBREAK 64 +#define MC_FILTERBREAK 8 /*====================================================================*/ /* @@ -1004,8 +1005,15 @@ static void fjn_reset(struct net_device *dev) for (i = 0; i < 6; i++) outb(dev->dev_addr[i], ioaddr + NODE_ID + i); - /* (re)initialize the multicast table */ - set_rx_mode(dev); + /* Switch to bank 1 */ + if (lp->cardtype == MBH10302) + outb(BANK_1, ioaddr + CONFIG_1); + else + outb(BANK_1U, ioaddr + CONFIG_1); + + /* set the multicast table to accept none. */ + for (i = 0; i < 8; i++) + outb(0x00, ioaddr + MAR_ADR + i); /* Switch to bank 2 (runtime mode) */ if (lp->cardtype == MBH10302) @@ -1256,11 +1264,11 @@ static struct net_device_stats *fjn_get_stats(struct net_device *dev) static void set_rx_mode(struct net_device *dev) { kio_addr_t ioaddr = dev->base_addr; + struct local_info_t *lp = netdev_priv(dev); u_char mc_filter[8]; /* Multicast hash filter */ u_long flags; int i; - int saved_bank; int saved_config_0 = inb(ioaddr + CONFIG_0); local_irq_save(flags); @@ -1298,13 +1306,15 @@ static void set_rx_mode(struct net_device *dev) outb(2, ioaddr + RX_MODE); /* Use normal mode. */ } - /* Switch to bank 1 and set the multicast table. */ - saved_bank = inb(ioaddr + CONFIG_1); - outb(0xe4, ioaddr + CONFIG_1); - - for (i = 0; i < 8; i++) - outb(mc_filter[i], ioaddr + MAR_ADR + i); - outb(saved_bank, ioaddr + CONFIG_1); + if (memcmp(mc_filter, lp->mc_filter, sizeof(mc_filter))) { + int saved_bank = inb(ioaddr + CONFIG_1); + /* Switch to bank 1 and set the multicast table. */ + outb(0xe4, ioaddr + CONFIG_1); + for (i = 0; i < 8; i++) + outb(mc_filter[i], ioaddr + MAR_ADR + i); + memcpy(lp->mc_filter, mc_filter, sizeof(mc_filter)); + outb(saved_bank, ioaddr + CONFIG_1); + } outb(saved_config_0, ioaddr + CONFIG_0); diff --git a/trunk/drivers/net/pcnet32.c b/trunk/drivers/net/pcnet32.c index 8f6cf8c896a4..be319229f543 100644 --- a/trunk/drivers/net/pcnet32.c +++ b/trunk/drivers/net/pcnet32.c @@ -1251,7 +1251,12 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) if (memcmp(promaddr, dev->dev_addr, 6) || !is_valid_ether_addr(dev->dev_addr)) { +#ifndef __powerpc__ if (is_valid_ether_addr(promaddr)) { +#else + if (!is_valid_ether_addr(dev->dev_addr) + && is_valid_ether_addr(promaddr)) { +#endif if (pcnet32_debug & NETIF_MSG_PROBE) { printk(" warning: CSR address invalid,\n"); printk(KERN_INFO " using instead PROM address of"); diff --git a/trunk/drivers/net/phy/phy_device.c b/trunk/drivers/net/phy/phy_device.c index 7da0e3dd5fe3..16bebe7a7ce1 100644 --- a/trunk/drivers/net/phy/phy_device.c +++ b/trunk/drivers/net/phy/phy_device.c @@ -38,10 +38,6 @@ #include #include -MODULE_DESCRIPTION("PHY library"); -MODULE_AUTHOR("Andy Fleming"); -MODULE_LICENSE("GPL"); - static struct phy_driver genphy_driver; extern int mdio_bus_init(void); extern void mdio_bus_exit(void); diff --git a/trunk/drivers/net/ppp_generic.c b/trunk/drivers/net/ppp_generic.c index 1c6d328165bb..50430f79f8cf 100644 --- a/trunk/drivers/net/ppp_generic.c +++ b/trunk/drivers/net/ppp_generic.c @@ -524,6 +524,9 @@ static int get_filter(void __user *arg, struct sock_filter **p) if (copy_from_user(&uprog, arg, sizeof(uprog))) return -EFAULT; + if (uprog.len > BPF_MAXINSNS) + return -EINVAL; + if (!uprog.len) { *p = NULL; return 0; diff --git a/trunk/drivers/net/pppoe.c b/trunk/drivers/net/pppoe.c index 9369f811075d..a842ecc60a34 100644 --- a/trunk/drivers/net/pppoe.c +++ b/trunk/drivers/net/pppoe.c @@ -85,7 +85,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) static int pppoe_xmit(struct ppp_channel *chan, struct sk_buff *skb); static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb); -static const struct proto_ops pppoe_ops; +static struct proto_ops pppoe_ops; static DEFINE_RWLOCK(pppoe_hash_lock); static struct ppp_channel_ops pppoe_chan_ops; @@ -383,6 +383,8 @@ static int pppoe_rcv(struct sk_buff *skb, { struct pppoe_hdr *ph; struct pppox_sock *po; + struct sock *sk; + int ret; if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr))) goto drop; @@ -393,8 +395,24 @@ static int pppoe_rcv(struct sk_buff *skb, ph = (struct pppoe_hdr *) skb->nh.raw; po = get_item((unsigned long) ph->sid, eth_hdr(skb)->h_source); - if (po != NULL) - return sk_receive_skb(sk_pppox(po), skb); + if (!po) + goto drop; + + sk = sk_pppox(po); + bh_lock_sock(sk); + + /* Socket state is unknown, must put skb into backlog. */ + if (sock_owned_by_user(sk) != 0) { + sk_add_backlog(sk, skb); + ret = NET_RX_SUCCESS; + } else { + ret = pppoe_rcv_core(sk, skb); + } + + bh_unlock_sock(sk); + sock_put(sk); + + return ret; drop: kfree_skb(skb); out: @@ -1063,7 +1081,9 @@ static int __init pppoe_proc_init(void) static inline int pppoe_proc_init(void) { return 0; } #endif /* CONFIG_PROC_FS */ -static const struct proto_ops pppoe_ops = { +/* ->ioctl are set at pppox_create */ + +static struct proto_ops pppoe_ops = { .family = AF_PPPOX, .owner = THIS_MODULE, .release = pppoe_release, @@ -1079,8 +1099,7 @@ static const struct proto_ops pppoe_ops = { .getsockopt = sock_no_getsockopt, .sendmsg = pppoe_sendmsg, .recvmsg = pppoe_recvmsg, - .mmap = sock_no_mmap, - .ioctl = pppox_ioctl, + .mmap = sock_no_mmap }; static struct pppox_proto pppoe_proto = { diff --git a/trunk/drivers/net/pppox.c b/trunk/drivers/net/pppox.c index 9315046b3f55..0c1e114527fb 100644 --- a/trunk/drivers/net/pppox.c +++ b/trunk/drivers/net/pppox.c @@ -68,7 +68,8 @@ EXPORT_SYMBOL(register_pppox_proto); EXPORT_SYMBOL(unregister_pppox_proto); EXPORT_SYMBOL(pppox_unbind_sock); -int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) +static int pppox_ioctl(struct socket* sock, unsigned int cmd, + unsigned long arg) { struct sock *sk = sock->sk; struct pppox_sock *po = pppox_sk(sk); @@ -104,7 +105,6 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) return rc; } -EXPORT_SYMBOL(pppox_ioctl); static int pppox_create(struct socket *sock, int protocol) { @@ -119,7 +119,11 @@ static int pppox_create(struct socket *sock, int protocol) goto out; rc = pppox_protos[protocol]->create(sock); - + if (!rc) { + /* We get to set the ioctl handler. */ + /* For everything else, pppox is just a shell. */ + sock->ops->ioctl = pppox_ioctl; + } module_put(pppox_protos[protocol]->owner); out: return rc; diff --git a/trunk/drivers/net/r8169.c b/trunk/drivers/net/r8169.c index 14a76f7cf900..159b56a56ef4 100644 --- a/trunk/drivers/net/r8169.c +++ b/trunk/drivers/net/r8169.c @@ -1346,8 +1346,10 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, } else { if (netif_msg_probe(tp)) { printk(KERN_ERR PFX - "PowerManagement capability not found.\n"); + "Cannot find PowerManagement capability. " + "Aborting.\n"); } + goto err_out_mwi; } /* make sure PCI base addr 1 is MMIO */ @@ -2514,7 +2516,7 @@ rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs) } while (boguscnt > 0); if (boguscnt <= 0) { - if (netif_msg_intr(tp) && net_ratelimit() ) { + if (net_ratelimit() && netif_msg_intr(tp)) { printk(KERN_WARNING "%s: Too much work at interrupt!\n", dev->name); } diff --git a/trunk/drivers/net/s2io.c b/trunk/drivers/net/s2io.c index 89c46787676c..e57df8dfe6b4 100644 --- a/trunk/drivers/net/s2io.c +++ b/trunk/drivers/net/s2io.c @@ -66,7 +66,7 @@ #include "s2io.h" #include "s2io-regs.h" -#define DRV_VERSION "Version 2.0.9.4" +#define DRV_VERSION "Version 2.0.9.3" /* S2io Driver name & version. */ static char s2io_driver_name[] = "Neterion"; @@ -412,7 +412,7 @@ static int init_shared_mem(struct s2io_nic *nic) config->tx_cfg[i].fifo_len - 1; mac_control->fifos[i].fifo_no = i; mac_control->fifos[i].nic = nic; - mac_control->fifos[i].max_txds = MAX_SKB_FRAGS + 2; + mac_control->fifos[i].max_txds = MAX_SKB_FRAGS + 1; for (j = 0; j < page_num; j++) { int k = 0; @@ -459,10 +459,6 @@ static int init_shared_mem(struct s2io_nic *nic) } } - nic->ufo_in_band_v = kmalloc((sizeof(u64) * size), GFP_KERNEL); - if (!nic->ufo_in_band_v) - return -ENOMEM; - /* Allocation and initialization of RXDs in Rings */ size = 0; for (i = 0; i < config->rx_ring_num; i++) { @@ -735,8 +731,6 @@ static void free_shared_mem(struct s2io_nic *nic) mac_control->stats_mem, mac_control->stats_mem_phy); } - if (nic->ufo_in_band_v) - kfree(nic->ufo_in_band_v); } /** @@ -2009,49 +2003,6 @@ static int start_nic(struct s2io_nic *nic) return SUCCESS; } -/** - * s2io_txdl_getskb - Get the skb from txdl, unmap and return skb - */ -static struct sk_buff *s2io_txdl_getskb(fifo_info_t *fifo_data, TxD_t *txdlp, int get_off) -{ - nic_t *nic = fifo_data->nic; - struct sk_buff *skb; - TxD_t *txds; - u16 j, frg_cnt; - - txds = txdlp; - if (txds->Host_Control == (u64)(long)nic->ufo_in_band_v) { - pci_unmap_single(nic->pdev, (dma_addr_t) - txds->Buffer_Pointer, sizeof(u64), - PCI_DMA_TODEVICE); - txds++; - } - - skb = (struct sk_buff *) ((unsigned long) - txds->Host_Control); - if (!skb) { - memset(txdlp, 0, (sizeof(TxD_t) * fifo_data->max_txds)); - return NULL; - } - pci_unmap_single(nic->pdev, (dma_addr_t) - txds->Buffer_Pointer, - skb->len - skb->data_len, - PCI_DMA_TODEVICE); - frg_cnt = skb_shinfo(skb)->nr_frags; - if (frg_cnt) { - txds++; - for (j = 0; j < frg_cnt; j++, txds++) { - skb_frag_t *frag = &skb_shinfo(skb)->frags[j]; - if (!txds->Buffer_Pointer) - break; - pci_unmap_page(nic->pdev, (dma_addr_t) - txds->Buffer_Pointer, - frag->size, PCI_DMA_TODEVICE); - } - } - txdlp->Host_Control = 0; - return(skb); -} /** * free_tx_buffers - Free all queued Tx buffers @@ -2069,7 +2020,7 @@ static void free_tx_buffers(struct s2io_nic *nic) int i, j; mac_info_t *mac_control; struct config_param *config; - int cnt = 0; + int cnt = 0, frg_cnt; mac_control = &nic->mac_control; config = &nic->config; @@ -2078,11 +2029,38 @@ static void free_tx_buffers(struct s2io_nic *nic) for (j = 0; j < config->tx_cfg[i].fifo_len - 1; j++) { txdp = (TxD_t *) mac_control->fifos[i].list_info[j]. list_virt_addr; - skb = s2io_txdl_getskb(&mac_control->fifos[i], txdp, j); - if (skb) { - dev_kfree_skb(skb); - cnt++; + skb = + (struct sk_buff *) ((unsigned long) txdp-> + Host_Control); + if (skb == NULL) { + memset(txdp, 0, sizeof(TxD_t) * + config->max_txds); + continue; } + frg_cnt = skb_shinfo(skb)->nr_frags; + pci_unmap_single(nic->pdev, (dma_addr_t) + txdp->Buffer_Pointer, + skb->len - skb->data_len, + PCI_DMA_TODEVICE); + if (frg_cnt) { + TxD_t *temp; + temp = txdp; + txdp++; + for (j = 0; j < frg_cnt; j++, txdp++) { + skb_frag_t *frag = + &skb_shinfo(skb)->frags[j]; + pci_unmap_page(nic->pdev, + (dma_addr_t) + txdp-> + Buffer_Pointer, + frag->size, + PCI_DMA_TODEVICE); + } + txdp = temp; + } + dev_kfree_skb(skb); + memset(txdp, 0, sizeof(TxD_t) * config->max_txds); + cnt++; } DBG_PRINT(INTR_DBG, "%s:forcibly freeing %d skbs on FIFO%d\n", @@ -2683,6 +2661,7 @@ static void tx_intr_handler(fifo_info_t *fifo_data) tx_curr_get_info_t get_info, put_info; struct sk_buff *skb; TxD_t *txdlp; + u16 j, frg_cnt; get_info = fifo_data->tx_curr_get_info; put_info = fifo_data->tx_curr_put_info; @@ -2705,7 +2684,8 @@ to loss of link\n"); } } - skb = s2io_txdl_getskb(fifo_data, txdlp, get_info.offset); + skb = (struct sk_buff *) ((unsigned long) + txdlp->Host_Control); if (skb == NULL) { DBG_PRINT(ERR_DBG, "%s: Null skb ", __FUNCTION__); @@ -2713,6 +2693,34 @@ to loss of link\n"); return; } + frg_cnt = skb_shinfo(skb)->nr_frags; + nic->tx_pkt_count++; + + pci_unmap_single(nic->pdev, (dma_addr_t) + txdlp->Buffer_Pointer, + skb->len - skb->data_len, + PCI_DMA_TODEVICE); + if (frg_cnt) { + TxD_t *temp; + temp = txdlp; + txdlp++; + for (j = 0; j < frg_cnt; j++, txdlp++) { + skb_frag_t *frag = + &skb_shinfo(skb)->frags[j]; + if (!txdlp->Buffer_Pointer) + break; + pci_unmap_page(nic->pdev, + (dma_addr_t) + txdlp-> + Buffer_Pointer, + frag->size, + PCI_DMA_TODEVICE); + } + txdlp = temp; + } + memset(txdlp, 0, + (sizeof(TxD_t) * fifo_data->max_txds)); + /* Updating the statistics block */ nic->stats.tx_bytes += skb->len; dev_kfree_skb_irq(skb); @@ -3070,7 +3078,7 @@ int s2io_set_swapper(nic_t * sp) static int wait_for_msix_trans(nic_t *nic, int i) { - XENA_dev_config_t __iomem *bar0 = nic->bar0; + XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; u64 val64; int ret = 0, cnt = 0; @@ -3091,7 +3099,7 @@ static int wait_for_msix_trans(nic_t *nic, int i) void restore_xmsi_data(nic_t *nic) { - XENA_dev_config_t __iomem *bar0 = nic->bar0; + XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; u64 val64; int i; @@ -3109,7 +3117,7 @@ void restore_xmsi_data(nic_t *nic) static void store_xmsi_data(nic_t *nic) { - XENA_dev_config_t __iomem *bar0 = nic->bar0; + XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; u64 val64, addr, data; int i; @@ -3132,7 +3140,7 @@ static void store_xmsi_data(nic_t *nic) int s2io_enable_msi(nic_t *nic) { - XENA_dev_config_t __iomem *bar0 = nic->bar0; + XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; u16 msi_ctrl, msg_val; struct config_param *config = &nic->config; struct net_device *dev = nic->dev; @@ -3182,7 +3190,7 @@ int s2io_enable_msi(nic_t *nic) int s2io_enable_msi_x(nic_t *nic) { - XENA_dev_config_t __iomem *bar0 = nic->bar0; + XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; u64 tx_mat, rx_mat; u16 msi_control; /* Temp variable */ int ret, i, j, msix_indx = 1; @@ -3323,7 +3331,7 @@ failed\n", dev->name); s2io_msix_fifo_handle, 0, sp->desc1, sp->s2io_entries[i].arg); DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc1, - (unsigned long long)sp->msix_info[i].addr); + sp->msix_info[i].addr); } else { sprintf(sp->desc2, "%s:MSI-X-%d-RX", dev->name, i); @@ -3331,7 +3339,7 @@ failed\n", dev->name); s2io_msix_ring_handle, 0, sp->desc2, sp->s2io_entries[i].arg); DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc2, - (unsigned long long)sp->msix_info[i].addr); + sp->msix_info[i].addr); } if (err) { DBG_PRINT(ERR_DBG, "%s: MSI-X-%d registration \ @@ -3519,8 +3527,6 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) return 0; } - txdp->Control_1 = 0; - txdp->Control_2 = 0; #ifdef NETIF_F_TSO mss = skb_shinfo(skb)->tso_size; if (mss) { @@ -3528,13 +3534,19 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) txdp->Control_1 |= TXD_TCP_LSO_MSS(mss); } #endif + + frg_cnt = skb_shinfo(skb)->nr_frags; + frg_len = skb->len - skb->data_len; + + txdp->Buffer_Pointer = pci_map_single + (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE); + txdp->Host_Control = (unsigned long) skb; if (skb->ip_summed == CHECKSUM_HW) { txdp->Control_2 |= (TXD_TX_CKO_IPV4_EN | TXD_TX_CKO_TCP_EN | TXD_TX_CKO_UDP_EN); } - txdp->Control_1 |= TXD_GATHER_CODE_FIRST; - txdp->Control_1 |= TXD_LIST_OWN_XENA; + txdp->Control_2 |= config->tx_intr_type; if (sp->vlgrp && vlan_tx_tag_present(skb)) { @@ -3542,40 +3554,10 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) txdp->Control_2 |= TXD_VLAN_TAG(vlan_tag); } - frg_len = skb->len - skb->data_len; - if (skb_shinfo(skb)->ufo_size) { - int ufo_size; - - ufo_size = skb_shinfo(skb)->ufo_size; - ufo_size &= ~7; - txdp->Control_1 |= TXD_UFO_EN; - txdp->Control_1 |= TXD_UFO_MSS(ufo_size); - txdp->Control_1 |= TXD_BUFFER0_SIZE(8); -#ifdef __BIG_ENDIAN - sp->ufo_in_band_v[put_off] = - (u64)skb_shinfo(skb)->ip6_frag_id; -#else - sp->ufo_in_band_v[put_off] = - (u64)skb_shinfo(skb)->ip6_frag_id << 32; -#endif - txdp->Host_Control = (unsigned long)sp->ufo_in_band_v; - txdp->Buffer_Pointer = pci_map_single(sp->pdev, - sp->ufo_in_band_v, - sizeof(u64), PCI_DMA_TODEVICE); - txdp++; - txdp->Control_1 = 0; - txdp->Control_2 = 0; - } - - txdp->Buffer_Pointer = pci_map_single - (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE); - txdp->Host_Control = (unsigned long) skb; - txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len); - - if (skb_shinfo(skb)->ufo_size) - txdp->Control_1 |= TXD_UFO_EN; + txdp->Control_1 |= (TXD_BUFFER0_SIZE(frg_len) | + TXD_GATHER_CODE_FIRST); + txdp->Control_1 |= TXD_LIST_OWN_XENA; - frg_cnt = skb_shinfo(skb)->nr_frags; /* For fragmented SKB. */ for (i = 0; i < frg_cnt; i++) { skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; @@ -3587,14 +3569,9 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) (sp->pdev, frag->page, frag->page_offset, frag->size, PCI_DMA_TODEVICE); txdp->Control_1 |= TXD_BUFFER0_SIZE(frag->size); - if (skb_shinfo(skb)->ufo_size) - txdp->Control_1 |= TXD_UFO_EN; } txdp->Control_1 |= TXD_GATHER_CODE_LAST; - if (skb_shinfo(skb)->ufo_size) - frg_cnt++; /* as Txd0 was used for inband header */ - tx_fifo = mac_control->tx_FIFO_start[queue]; val64 = mac_control->fifos[queue].list_info[put_off].list_phy_addr; writeq(val64, &tx_fifo->TxDL_Pointer); @@ -3606,8 +3583,6 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) if (mss) val64 |= TX_FIFO_SPECIAL_FUNC; #endif - if (skb_shinfo(skb)->ufo_size) - val64 |= TX_FIFO_SPECIAL_FUNC; writeq(val64, &tx_fifo->List_Control); mmiowb(); @@ -4746,10 +4721,7 @@ static int s2io_eeprom_test(nic_t * sp, uint64_t * data) fail = 1; if (ret_data != 0x012345) { - DBG_PRINT(ERR_DBG, "%s: eeprom test error at offset 0x4F0. " - "Data written %llx Data read %llx\n", - dev->name, (unsigned long long)0x12345, - (unsigned long long)ret_data); + DBG_PRINT(ERR_DBG, "%s: eeprom test error at offset 0x4F0. Data written %llx Data read %llx\n", dev->name, (u64)0x12345, ret_data); fail = 1; } @@ -4768,10 +4740,7 @@ static int s2io_eeprom_test(nic_t * sp, uint64_t * data) fail = 1; if (ret_data != 0x012345) { - DBG_PRINT(ERR_DBG, "%s: eeprom test error at offset 0x7F0. " - "Data written %llx Data read %llx\n", - dev->name, (unsigned long long)0x12345, - (unsigned long long)ret_data); + DBG_PRINT(ERR_DBG, "%s: eeprom test error at offset 0x7F0. Data written %llx Data read %llx\n", dev->name, (u64)0x12345, ret_data); fail = 1; } @@ -5221,8 +5190,6 @@ static struct ethtool_ops netdev_ethtool_ops = { .get_tso = ethtool_op_get_tso, .set_tso = ethtool_op_set_tso, #endif - .get_ufo = ethtool_op_get_ufo, - .set_ufo = ethtool_op_set_ufo, .self_test_count = s2io_ethtool_self_test_count, .self_test = s2io_ethtool_test, .get_strings = s2io_ethtool_get_strings, @@ -5974,8 +5941,7 @@ Defaulting to INTA\n"); break; } } - /* + 2 because one Txd for skb->data and one Txd for UFO */ - config->max_txds = MAX_SKB_FRAGS + 2; + config->max_txds = MAX_SKB_FRAGS + 1; /* Rx side parameters. */ if (rx_ring_sz[0] == 0) @@ -6069,10 +6035,6 @@ Defaulting to INTA\n"); #ifdef NETIF_F_TSO dev->features |= NETIF_F_TSO; #endif - if (sp->device_type & XFRAME_II_DEVICE) { - dev->features |= NETIF_F_UFO; - dev->features |= NETIF_F_HW_CSUM; - } dev->tx_timeout = &s2io_tx_watchdog; dev->watchdog_timeo = WATCH_DOG_TIMEOUT; diff --git a/trunk/drivers/net/s2io.h b/trunk/drivers/net/s2io.h index 852a6a899d07..419aad7f10e7 100644 --- a/trunk/drivers/net/s2io.h +++ b/trunk/drivers/net/s2io.h @@ -393,9 +393,7 @@ typedef struct _TxD { #define TXD_GATHER_CODE_LAST BIT(23) #define TXD_TCP_LSO_EN BIT(30) #define TXD_UDP_COF_EN BIT(31) -#define TXD_UFO_EN BIT(31) | BIT(30) #define TXD_TCP_LSO_MSS(val) vBIT(val,34,14) -#define TXD_UFO_MSS(val) vBIT(val,34,14) #define TXD_BUFFER0_SIZE(val) vBIT(val,48,16) u64 Control_2; @@ -791,7 +789,6 @@ struct s2io_nic { spinlock_t rx_lock; atomic_t isr_cnt; - u64 *ufo_in_band_v; }; #define RESET_ERROR 1; diff --git a/trunk/drivers/net/saa9730.h b/trunk/drivers/net/saa9730.h index a7e9d29a86a7..9e9da6b4080f 100644 --- a/trunk/drivers/net/saa9730.h +++ b/trunk/drivers/net/saa9730.h @@ -1,7 +1,6 @@ /* - * Copyright (C) 2000, 2005 MIPS Technologies, Inc. All rights reserved. - * Authors: Carsten Langgaard - * Maciej W. Rozycki + * Carsten Langgaard, carstenl@mips.com + * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. * * ######################################################################## * @@ -266,7 +265,6 @@ /* The SAA9730 (LAN) controller register map, as seen via the PCI-bus. */ #define SAA9730_LAN_REGS_ADDR 0x20400 -#define SAA9730_LAN_REGS_SIZE 0x00400 struct lan_saa9730_regmap { volatile unsigned int TxBuffA; /* 0x20400 */ @@ -311,7 +309,6 @@ typedef volatile struct lan_saa9730_regmap t_lan_saa9730_regmap; /* The SAA9730 (EVM) controller register map, as seen via the PCI-bus. */ #define SAA9730_EVM_REGS_ADDR 0x02000 -#define SAA9730_EVM_REGS_SIZE 0x00400 struct evm_saa9730_regmap { volatile unsigned int InterruptStatus1; /* 0x2000 */ @@ -332,32 +329,16 @@ typedef volatile struct evm_saa9730_regmap t_evm_saa9730_regmap; struct lan_saa9730_private { - /* - * Rx/Tx packet buffers. - * The Rx and Tx packets must be PACKET_SIZE aligned. - */ - void *buffer_start; - unsigned int buffer_size; - - /* - * DMA address of beginning of this object, returned - * by pci_alloc_consistent(). - */ - dma_addr_t dma_addr; - - /* Pointer to the associated pci device structure */ - struct pci_dev *pci_dev; - /* Pointer for the SAA9730 LAN controller register set. */ t_lan_saa9730_regmap *lan_saa9730_regs; /* Pointer to the SAA9730 EVM register. */ t_evm_saa9730_regmap *evm_saa9730_regs; + /* TRUE if the next buffer to write is RxBuffA, FALSE if RxBuffB. */ + unsigned char NextRcvToUseIsA; /* Rcv buffer Index. */ unsigned char NextRcvPacketIndex; - /* Next buffer index. */ - unsigned char NextRcvBufferIndex; /* Index of next packet to use in that buffer. */ unsigned char NextTxmPacketIndex; @@ -372,8 +353,13 @@ struct lan_saa9730_private { unsigned char DmaRcvPackets; unsigned char DmaTxmPackets; - void *TxmBuffer[LAN_SAA9730_BUFFERS][LAN_SAA9730_TXM_Q_SIZE]; - void *RcvBuffer[LAN_SAA9730_BUFFERS][LAN_SAA9730_RCV_Q_SIZE]; + unsigned char RcvAIndex; /* index into RcvBufferSpace[] for Blk A */ + unsigned char RcvBIndex; /* index into RcvBufferSpace[] for Blk B */ + + unsigned int + TxmBuffer[LAN_SAA9730_BUFFERS][LAN_SAA9730_TXM_Q_SIZE]; + unsigned int + RcvBuffer[LAN_SAA9730_BUFFERS][LAN_SAA9730_RCV_Q_SIZE]; unsigned int TxBufferFree[LAN_SAA9730_BUFFERS]; unsigned char PhysicalAddress[LAN_SAA9730_CAM_ENTRIES][6]; diff --git a/trunk/drivers/net/sis900.c b/trunk/drivers/net/sis900.c index 3d95fa20cd88..1d4d88680db1 100644 --- a/trunk/drivers/net/sis900.c +++ b/trunk/drivers/net/sis900.c @@ -1,6 +1,6 @@ /* sis900.c: A SiS 900/7016 PCI Fast Ethernet driver for Linux. Copyright 1999 Silicon Integrated System Corporation - Revision: 1.08.09 Sep. 19 2005 + Revision: 1.08.08 Jan. 22 2005 Modified from the driver which is originally written by Donald Becker. @@ -17,7 +17,6 @@ SiS 7014 Single Chip 100BASE-TX/10BASE-T Physical Layer Solution, preliminary Rev. 1.0 Jan. 18, 1998 - Rev 1.08.09 Sep. 19 2005 Daniele Venzano add Wake on LAN support Rev 1.08.08 Jan. 22 2005 Daniele Venzano use netif_msg for debugging messages Rev 1.08.07 Nov. 2 2003 Daniele Venzano add suspend/resume support Rev 1.08.06 Sep. 24 2002 Mufasa Yang bug fix for Tx timeout & add SiS963 support @@ -77,7 +76,7 @@ #include "sis900.h" #define SIS900_MODULE_NAME "sis900" -#define SIS900_DRV_VERSION "v1.08.09 Sep. 19 2005" +#define SIS900_DRV_VERSION "v1.08.08 Jan. 22 2005" static char version[] __devinitdata = KERN_INFO "sis900.c: " SIS900_DRV_VERSION "\n"; @@ -539,11 +538,6 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev, printk("%2.2x:", (u8)net_dev->dev_addr[i]); printk("%2.2x.\n", net_dev->dev_addr[i]); - /* Detect Wake on Lan support */ - ret = inl(CFGPMC & PMESP); - if (netif_msg_probe(sis_priv) && (ret & PME_D3C) == 0) - printk(KERN_INFO "%s: Wake on LAN only available from suspend to RAM.", net_dev->name); - return 0; err_unmap_rx: @@ -2021,67 +2015,6 @@ static int sis900_nway_reset(struct net_device *net_dev) return mii_nway_restart(&sis_priv->mii_info); } -/** - * sis900_set_wol - Set up Wake on Lan registers - * @net_dev: the net device to probe - * @wol: container for info passed to the driver - * - * Process ethtool command "wol" to setup wake on lan features. - * SiS900 supports sending WoL events if a correct packet is received, - * but there is no simple way to filter them to only a subset (broadcast, - * multicast, unicast or arp). - */ - -static int sis900_set_wol(struct net_device *net_dev, struct ethtool_wolinfo *wol) -{ - struct sis900_private *sis_priv = net_dev->priv; - long pmctrl_addr = net_dev->base_addr + pmctrl; - u32 cfgpmcsr = 0, pmctrl_bits = 0; - - if (wol->wolopts == 0) { - pci_read_config_dword(sis_priv->pci_dev, CFGPMCSR, &cfgpmcsr); - cfgpmcsr |= ~PME_EN; - pci_write_config_dword(sis_priv->pci_dev, CFGPMCSR, cfgpmcsr); - outl(pmctrl_bits, pmctrl_addr); - if (netif_msg_wol(sis_priv)) - printk(KERN_DEBUG "%s: Wake on LAN disabled\n", net_dev->name); - return 0; - } - - if (wol->wolopts & (WAKE_MAGICSECURE | WAKE_UCAST | WAKE_MCAST - | WAKE_BCAST | WAKE_ARP)) - return -EINVAL; - - if (wol->wolopts & WAKE_MAGIC) - pmctrl_bits |= MAGICPKT; - if (wol->wolopts & WAKE_PHY) - pmctrl_bits |= LINKON; - - outl(pmctrl_bits, pmctrl_addr); - - pci_read_config_dword(sis_priv->pci_dev, CFGPMCSR, &cfgpmcsr); - cfgpmcsr |= PME_EN; - pci_write_config_dword(sis_priv->pci_dev, CFGPMCSR, cfgpmcsr); - if (netif_msg_wol(sis_priv)) - printk(KERN_DEBUG "%s: Wake on LAN enabled\n", net_dev->name); - - return 0; -} - -static void sis900_get_wol(struct net_device *net_dev, struct ethtool_wolinfo *wol) -{ - long pmctrl_addr = net_dev->base_addr + pmctrl; - u32 pmctrl_bits; - - pmctrl_bits = inl(pmctrl_addr); - if (pmctrl_bits & MAGICPKT) - wol->wolopts |= WAKE_MAGIC; - if (pmctrl_bits & LINKON) - wol->wolopts |= WAKE_PHY; - - wol->supported = (WAKE_PHY | WAKE_MAGIC); -} - static struct ethtool_ops sis900_ethtool_ops = { .get_drvinfo = sis900_get_drvinfo, .get_msglevel = sis900_get_msglevel, @@ -2090,8 +2023,6 @@ static struct ethtool_ops sis900_ethtool_ops = { .get_settings = sis900_get_settings, .set_settings = sis900_set_settings, .nway_reset = sis900_nway_reset, - .get_wol = sis900_get_wol, - .set_wol = sis900_set_wol }; /** diff --git a/trunk/drivers/net/sis900.h b/trunk/drivers/net/sis900.h index 4233ea55670f..de3c06735d15 100644 --- a/trunk/drivers/net/sis900.h +++ b/trunk/drivers/net/sis900.h @@ -33,7 +33,6 @@ enum sis900_registers { rxcfg=0x34, //Receive Configuration Register flctrl=0x38, //Flow Control Register rxlen=0x3c, //Receive Packet Length Register - cfgpmcsr=0x44, //Configuration Power Management Control/Status Register rfcr=0x48, //Receive Filter Control Register rfdr=0x4C, //Receive Filter Data Register pmctrl=0xB0, //Power Management Control Register @@ -141,50 +140,6 @@ enum sis96x_eeprom_command { EEREQ = 0x00000400, EEDONE = 0x00000200, EEGNT = 0x00000100 }; -/* PCI Registers */ -enum sis900_pci_registers { - CFGPMC = 0x40, - CFGPMCSR = 0x44 -}; - -/* Power management capabilities bits */ -enum sis900_cfgpmc_register_bits { - PMVER = 0x00070000, - DSI = 0x00100000, - PMESP = 0xf8000000 -}; - -enum sis900_pmesp_bits { - PME_D0 = 0x1, - PME_D1 = 0x2, - PME_D2 = 0x4, - PME_D3H = 0x8, - PME_D3C = 0x10 -}; - -/* Power management control/status bits */ -enum sis900_cfgpmcsr_register_bits { - PMESTS = 0x00004000, - PME_EN = 0x00000100, // Power management enable - PWR_STA = 0x00000003 // Current power state -}; - -/* Wake-on-LAN support. */ -enum sis900_power_management_control_register_bits { - LINKLOSS = 0x00000001, - LINKON = 0x00000002, - MAGICPKT = 0x00000400, - ALGORITHM = 0x00000800, - FRM1EN = 0x00100000, - FRM2EN = 0x00200000, - FRM3EN = 0x00400000, - FRM1ACS = 0x01000000, - FRM2ACS = 0x02000000, - FRM3ACS = 0x04000000, - WAKEALL = 0x40000000, - GATECLK = 0x80000000 -}; - /* Management Data I/O (mdio) frame */ #define MIIread 0x6000 #define MIIwrite 0x5002 diff --git a/trunk/drivers/net/sk98lin/Makefile b/trunk/drivers/net/sk98lin/Makefile index afd900d5d730..6783039ffb75 100644 --- a/trunk/drivers/net/sk98lin/Makefile +++ b/trunk/drivers/net/sk98lin/Makefile @@ -26,7 +26,9 @@ sk98lin-objs := \ skrlmt.o \ sktimer.o \ skvpd.o \ - skxmac2.o + skxmac2.o \ + skproc.o \ + skcsum.o # DBGDEF = \ # -DDEBUG @@ -75,7 +77,7 @@ endif # SK_DBGCAT_DRV_INT_SRC 0x04000000 interrupts sources # SK_DBGCAT_DRV_EVENT 0x08000000 driver events -EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_DIAG_SUPPORT -DGENESIS -DYUKON $(DBGDEF) $(SKPARAM) +EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_DIAG_SUPPORT -DSK_USE_CSUM -DGENESIS -DYUKON $(DBGDEF) $(SKPARAM) clean: rm -f core *.o *.a *.s diff --git a/trunk/drivers/net/sk98lin/h/skdrv2nd.h b/trunk/drivers/net/sk98lin/h/skdrv2nd.h index 778d9e618ebd..542cec57f86a 100644 --- a/trunk/drivers/net/sk98lin/h/skdrv2nd.h +++ b/trunk/drivers/net/sk98lin/h/skdrv2nd.h @@ -60,6 +60,7 @@ extern SK_U64 SkOsGetTime(SK_AC*); extern int SkPciReadCfgDWord(SK_AC*, int, SK_U32*); extern int SkPciReadCfgWord(SK_AC*, int, SK_U16*); extern int SkPciReadCfgByte(SK_AC*, int, SK_U8*); +extern int SkPciWriteCfgDWord(SK_AC*, int, SK_U32); extern int SkPciWriteCfgWord(SK_AC*, int, SK_U16); extern int SkPciWriteCfgByte(SK_AC*, int, SK_U8); extern int SkDrvEvent(SK_AC*, SK_IOC IoC, SK_U32, SK_EVPARA); @@ -267,6 +268,8 @@ typedef struct s_DevNet DEV_NET; struct s_DevNet { int PortNr; int NetNr; + int Mtu; + int Up; SK_AC *pAC; }; @@ -295,7 +298,6 @@ struct s_RxPort { RXD *pRxdRingTail; /* Tail of Rx rings */ RXD *pRxdRingPrev; /* descriptor given to BMU previously */ int RxdRingFree; /* # of free entrys */ - int RxCsum; /* use receive checksum hardware */ spinlock_t RxDesRingLock; /* serialize descriptor accesses */ int RxFillLimit; /* limit for buffers in ring */ SK_IOC HwAddr; /* bmu registers address */ @@ -388,10 +390,12 @@ struct s_AC { SK_IOC IoBase; /* register set of adapter */ int BoardLevel; /* level of active hw init (0-2) */ - + char DeviceStr[80]; /* adapter string from vpd */ SK_U32 AllocFlag; /* flag allocation of resources */ struct pci_dev *PciDev; /* for access to pci config space */ + SK_U32 PciDevId; /* pci device id */ struct SK_NET_DEVICE *dev[2]; /* pointer to device struct */ + char Name[30]; /* driver name */ int RxBufSize; /* length of receive buffers */ struct net_device_stats stats; /* linux 'netstat -i' statistics */ @@ -421,11 +425,16 @@ struct s_AC { TX_PORT TxPort[SK_MAX_MACS][2]; RX_PORT RxPort[SK_MAX_MACS]; + unsigned int CsOfs1; /* for checksum calculation */ + unsigned int CsOfs2; /* for checksum calculation */ + SK_U32 CsOfs; /* for checksum calculation */ + SK_BOOL CheckQueue; /* check event queue soon */ SK_TIMER DrvCleanupTimer;/* to check for pending descriptors */ DIM_INFO DynIrqModInfo; /* all data related to DIM */ /* Only for tests */ + int PortUp; int PortDown; int ChipsetType; /* Chipset family type * 0 == Genesis family support diff --git a/trunk/drivers/net/sk98lin/h/skvpd.h b/trunk/drivers/net/sk98lin/h/skvpd.h index daa9a8d154fc..bdc1a5eaaae9 100644 --- a/trunk/drivers/net/sk98lin/h/skvpd.h +++ b/trunk/drivers/net/sk98lin/h/skvpd.h @@ -130,12 +130,14 @@ typedef struct s_vpd_key { #ifndef VPD_DO_IO #define VPD_OUT8(pAC,IoC,Addr,Val) (void)SkPciWriteCfgByte(pAC,Addr,Val) #define VPD_OUT16(pAC,IoC,Addr,Val) (void)SkPciWriteCfgWord(pAC,Addr,Val) +#define VPD_OUT32(pAC,IoC,Addr,Val) (void)SkPciWriteCfgDWord(pAC,Addr,Val) #define VPD_IN8(pAC,IoC,Addr,pVal) (void)SkPciReadCfgByte(pAC,Addr,pVal) #define VPD_IN16(pAC,IoC,Addr,pVal) (void)SkPciReadCfgWord(pAC,Addr,pVal) #define VPD_IN32(pAC,IoC,Addr,pVal) (void)SkPciReadCfgDWord(pAC,Addr,pVal) #else /* VPD_DO_IO */ #define VPD_OUT8(pAC,IoC,Addr,Val) SK_OUT8(IoC,PCI_C(Addr),Val) #define VPD_OUT16(pAC,IoC,Addr,Val) SK_OUT16(IoC,PCI_C(Addr),Val) +#define VPD_OUT32(pAC,IoC,Addr,Val) SK_OUT32(IoC,PCI_C(Addr),Val) #define VPD_IN8(pAC,IoC,Addr,pVal) SK_IN8(IoC,PCI_C(Addr),pVal) #define VPD_IN16(pAC,IoC,Addr,pVal) SK_IN16(IoC,PCI_C(Addr),pVal) #define VPD_IN32(pAC,IoC,Addr,pVal) SK_IN32(IoC,PCI_C(Addr),pVal) @@ -153,6 +155,12 @@ typedef struct s_vpd_key { else \ SK_OUT16(pAC,PCI_C(Addr),Val); \ } +#define VPD_OUT32(pAC,Ioc,Addr,Val) { \ + if ((pAC)->DgT.DgUseCfgCycle) \ + SkPciWriteCfgDWord(pAC,Addr,Val); \ + else \ + SK_OUT32(pAC,PCI_C(Addr),Val); \ + } #define VPD_IN8(pAC,Ioc,Addr,pVal) { \ if ((pAC)->DgT.DgUseCfgCycle) \ SkPciReadCfgByte(pAC,Addr,pVal); \ diff --git a/trunk/drivers/net/sk98lin/skcsum.c b/trunk/drivers/net/sk98lin/skcsum.c new file mode 100644 index 000000000000..38a6e7a631f3 --- /dev/null +++ b/trunk/drivers/net/sk98lin/skcsum.c @@ -0,0 +1,871 @@ +/****************************************************************************** + * + * Name: skcsum.c + * Project: GEnesis, PCI Gigabit Ethernet Adapter + * Version: $Revision: 1.12 $ + * Date: $Date: 2003/08/20 13:55:53 $ + * Purpose: Store/verify Internet checksum in send/receive packets. + * + ******************************************************************************/ + +/****************************************************************************** + * + * (C)Copyright 1998-2003 SysKonnect GmbH. + * + * 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. + * + * The information in this file is provided "AS IS" without warranty. + * + ******************************************************************************/ + +#ifdef SK_USE_CSUM /* Check if CSUM is to be used. */ + +#ifndef lint +static const char SysKonnectFileId[] = + "@(#) $Id: skcsum.c,v 1.12 2003/08/20 13:55:53 mschmid Exp $ (C) SysKonnect."; +#endif /* !lint */ + +/****************************************************************************** + * + * Description: + * + * This is the "GEnesis" common module "CSUM". + * + * This module contains the code necessary to calculate, store, and verify the + * Internet Checksum of IP, TCP, and UDP frames. + * + * "GEnesis" is an abbreviation of "Gigabit Ethernet Network System in Silicon" + * and is the code name of this SysKonnect project. + * + * Compilation Options: + * + * SK_USE_CSUM - Define if CSUM is to be used. Otherwise, CSUM will be an + * empty module. + * + * SKCS_OVERWRITE_PROTO - Define to overwrite the default protocol id + * definitions. In this case, all SKCS_PROTO_xxx definitions must be made + * external. + * + * SKCS_OVERWRITE_STATUS - Define to overwrite the default return status + * definitions. In this case, all SKCS_STATUS_xxx definitions must be made + * external. + * + * Include File Hierarchy: + * + * "h/skdrv1st.h" + * "h/skcsum.h" + * "h/sktypes.h" + * "h/skqueue.h" + * "h/skdrv2nd.h" + * + ******************************************************************************/ + +#include "h/skdrv1st.h" +#include "h/skcsum.h" +#include "h/skdrv2nd.h" + +/* defines ********************************************************************/ + +/* The size of an Ethernet MAC header. */ +#define SKCS_ETHERNET_MAC_HEADER_SIZE (6+6+2) + +/* The size of the used topology's MAC header. */ +#define SKCS_MAC_HEADER_SIZE SKCS_ETHERNET_MAC_HEADER_SIZE + +/* The size of the IP header without any option fields. */ +#define SKCS_IP_HEADER_SIZE 20 + +/* + * Field offsets within the IP header. + */ + +/* "Internet Header Version" and "Length". */ +#define SKCS_OFS_IP_HEADER_VERSION_AND_LENGTH 0 + +/* "Total Length". */ +#define SKCS_OFS_IP_TOTAL_LENGTH 2 + +/* "Flags" "Fragment Offset". */ +#define SKCS_OFS_IP_FLAGS_AND_FRAGMENT_OFFSET 6 + +/* "Next Level Protocol" identifier. */ +#define SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL 9 + +/* Source IP address. */ +#define SKCS_OFS_IP_SOURCE_ADDRESS 12 + +/* Destination IP address. */ +#define SKCS_OFS_IP_DESTINATION_ADDRESS 16 + + +/* + * Field offsets within the UDP header. + */ + +/* UDP checksum. */ +#define SKCS_OFS_UDP_CHECKSUM 6 + +/* IP "Next Level Protocol" identifiers (see RFC 790). */ +#define SKCS_PROTO_ID_TCP 6 /* Transport Control Protocol */ +#define SKCS_PROTO_ID_UDP 17 /* User Datagram Protocol */ + +/* IP "Don't Fragment" bit. */ +#define SKCS_IP_DONT_FRAGMENT SKCS_HTON16(0x4000) + +/* Add a byte offset to a pointer. */ +#define SKCS_IDX(pPtr, Ofs) ((void *) ((char *) (pPtr) + (Ofs))) + +/* + * Macros that convert host to network representation and vice versa, i.e. + * little/big endian conversion on little endian machines only. + */ +#ifdef SK_LITTLE_ENDIAN +#define SKCS_HTON16(Val16) (((unsigned) (Val16) >> 8) | (((Val16) & 0xff) << 8)) +#endif /* SK_LITTLE_ENDIAN */ +#ifdef SK_BIG_ENDIAN +#define SKCS_HTON16(Val16) (Val16) +#endif /* SK_BIG_ENDIAN */ +#define SKCS_NTOH16(Val16) SKCS_HTON16(Val16) + +/* typedefs *******************************************************************/ + +/* function prototypes ********************************************************/ + +/****************************************************************************** + * + * SkCsGetSendInfo - get checksum information for a send packet + * + * Description: + * Get all checksum information necessary to send a TCP or UDP packet. The + * function checks the IP header passed to it. If the high-level protocol + * is either TCP or UDP the pseudo header checksum is calculated and + * returned. + * + * The function returns the total length of the IP header (including any + * IP option fields), which is the same as the start offset of the IP data + * which in turn is the start offset of the TCP or UDP header. + * + * The function also returns the TCP or UDP pseudo header checksum, which + * should be used as the start value for the hardware checksum calculation. + * (Note that any actual pseudo header checksum can never calculate to + * zero.) + * + * Note: + * There is a bug in the GENESIS ASIC which may lead to wrong checksums. + * + * Arguments: + * pAc - A pointer to the adapter context struct. + * + * pIpHeader - Pointer to IP header. Must be at least the IP header *not* + * including any option fields, i.e. at least 20 bytes. + * + * Note: This pointer will be used to address 8-, 16-, and 32-bit + * variables with the respective alignment offsets relative to the pointer. + * Thus, the pointer should point to a 32-bit aligned address. If the + * target system cannot address 32-bit variables on non 32-bit aligned + * addresses, then the pointer *must* point to a 32-bit aligned address. + * + * pPacketInfo - A pointer to the packet information structure for this + * packet. Before calling this SkCsGetSendInfo(), the following field must + * be initialized: + * + * ProtocolFlags - Initialize with any combination of + * SKCS_PROTO_XXX bit flags. SkCsGetSendInfo() will only work on + * the protocols specified here. Any protocol(s) not specified + * here will be ignored. + * + * Note: Only one checksum can be calculated in hardware. Thus, if + * SKCS_PROTO_IP is specified in the 'ProtocolFlags', + * SkCsGetSendInfo() must calculate the IP header checksum in + * software. It might be a better idea to have the calling + * protocol stack calculate the IP header checksum. + * + * Returns: N/A + * On return, the following fields in 'pPacketInfo' may or may not have + * been filled with information, depending on the protocol(s) found in the + * packet: + * + * ProtocolFlags - Returns the SKCS_PROTO_XXX bit flags of the protocol(s) + * that were both requested by the caller and actually found in the packet. + * Protocol(s) not specified by the caller and/or not found in the packet + * will have their respective SKCS_PROTO_XXX bit flags reset. + * + * Note: For IP fragments, TCP and UDP packet information is ignored. + * + * IpHeaderLength - The total length in bytes of the complete IP header + * including any option fields is returned here. This is the start offset + * of the IP data, i.e. the TCP or UDP header if present. + * + * IpHeaderChecksum - If IP has been specified in the 'ProtocolFlags', the + * 16-bit Internet Checksum of the IP header is returned here. This value + * is to be stored into the packet's 'IP Header Checksum' field. + * + * PseudoHeaderChecksum - If this is a TCP or UDP packet and if TCP or UDP + * has been specified in the 'ProtocolFlags', the 16-bit Internet Checksum + * of the TCP or UDP pseudo header is returned here. + */ +void SkCsGetSendInfo( +SK_AC *pAc, /* Adapter context struct. */ +void *pIpHeader, /* IP header. */ +SKCS_PACKET_INFO *pPacketInfo, /* Packet information struct. */ +int NetNumber) /* Net number */ +{ + /* Internet Header Version found in IP header. */ + unsigned InternetHeaderVersion; + + /* Length of the IP header as found in IP header. */ + unsigned IpHeaderLength; + + /* Bit field specifiying the desired/found protocols. */ + unsigned ProtocolFlags; + + /* Next level protocol identifier found in IP header. */ + unsigned NextLevelProtocol; + + /* Length of IP data portion. */ + unsigned IpDataLength; + + /* TCP/UDP pseudo header checksum. */ + unsigned long PseudoHeaderChecksum; + + /* Pointer to next level protocol statistics structure. */ + SKCS_PROTO_STATS *NextLevelProtoStats; + + /* Temporary variable. */ + unsigned Tmp; + + Tmp = *(SK_U8 *) + SKCS_IDX(pIpHeader, SKCS_OFS_IP_HEADER_VERSION_AND_LENGTH); + + /* Get the Internet Header Version (IHV). */ + /* Note: The IHV is stored in the upper four bits. */ + + InternetHeaderVersion = Tmp >> 4; + + /* Check the Internet Header Version. */ + /* Note: We currently only support IP version 4. */ + + if (InternetHeaderVersion != 4) { /* IPv4? */ + SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_TX, + ("Tx: Unknown Internet Header Version %u.\n", + InternetHeaderVersion)); + pPacketInfo->ProtocolFlags = 0; + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxUnableCts++; + return; + } + + /* Get the IP header length (IHL). */ + /* + * Note: The IHL is stored in the lower four bits as the number of + * 4-byte words. + */ + + IpHeaderLength = (Tmp & 0xf) * 4; + pPacketInfo->IpHeaderLength = IpHeaderLength; + + /* Check the IP header length. */ + + /* 04-Aug-1998 sw - Really check the IHL? Necessary? */ + + if (IpHeaderLength < 5*4) { + SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_TX, + ("Tx: Invalid IP Header Length %u.\n", IpHeaderLength)); + pPacketInfo->ProtocolFlags = 0; + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxUnableCts++; + return; + } + + /* This is an IPv4 frame with a header of valid length. */ + + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].TxOkCts++; + + /* Check if we should calculate the IP header checksum. */ + + ProtocolFlags = pPacketInfo->ProtocolFlags; + + if (ProtocolFlags & SKCS_PROTO_IP) { + pPacketInfo->IpHeaderChecksum = + SkCsCalculateChecksum(pIpHeader, IpHeaderLength); + } + + /* Get the next level protocol identifier. */ + + NextLevelProtocol = + *(SK_U8 *) SKCS_IDX(pIpHeader, SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL); + + /* + * Check if this is a TCP or UDP frame and if we should calculate the + * TCP/UDP pseudo header checksum. + * + * Also clear all protocol bit flags of protocols not present in the + * frame. + */ + + if ((ProtocolFlags & SKCS_PROTO_TCP) != 0 && + NextLevelProtocol == SKCS_PROTO_ID_TCP) { + /* TCP/IP frame. */ + ProtocolFlags &= SKCS_PROTO_TCP | SKCS_PROTO_IP; + NextLevelProtoStats = + &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_TCP]; + } + else if ((ProtocolFlags & SKCS_PROTO_UDP) != 0 && + NextLevelProtocol == SKCS_PROTO_ID_UDP) { + /* UDP/IP frame. */ + ProtocolFlags &= SKCS_PROTO_UDP | SKCS_PROTO_IP; + NextLevelProtoStats = + &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_UDP]; + } + else { + /* + * Either not a TCP or UDP frame and/or TCP/UDP processing not + * specified. + */ + pPacketInfo->ProtocolFlags = ProtocolFlags & SKCS_PROTO_IP; + return; + } + + /* Check if this is an IP fragment. */ + + /* + * Note: An IP fragment has a non-zero "Fragment Offset" field and/or + * the "More Fragments" bit set. Thus, if both the "Fragment Offset" + * and the "More Fragments" are zero, it is *not* a fragment. We can + * easily check both at the same time since they are in the same 16-bit + * word. + */ + + if ((*(SK_U16 *) + SKCS_IDX(pIpHeader, SKCS_OFS_IP_FLAGS_AND_FRAGMENT_OFFSET) & + ~SKCS_IP_DONT_FRAGMENT) != 0) { + /* IP fragment; ignore all other protocols. */ + pPacketInfo->ProtocolFlags = ProtocolFlags & SKCS_PROTO_IP; + NextLevelProtoStats->TxUnableCts++; + return; + } + + /* + * Calculate the TCP/UDP pseudo header checksum. + */ + + /* Get total length of IP header and data. */ + + IpDataLength = + *(SK_U16 *) SKCS_IDX(pIpHeader, SKCS_OFS_IP_TOTAL_LENGTH); + + /* Get length of IP data portion. */ + + IpDataLength = SKCS_NTOH16(IpDataLength) - IpHeaderLength; + + /* Calculate the sum of all pseudo header fields (16-bit). */ + + PseudoHeaderChecksum = + (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader, + SKCS_OFS_IP_SOURCE_ADDRESS + 0) + + (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader, + SKCS_OFS_IP_SOURCE_ADDRESS + 2) + + (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader, + SKCS_OFS_IP_DESTINATION_ADDRESS + 0) + + (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader, + SKCS_OFS_IP_DESTINATION_ADDRESS + 2) + + (unsigned long) SKCS_HTON16(NextLevelProtocol) + + (unsigned long) SKCS_HTON16(IpDataLength); + + /* Add-in any carries. */ + + SKCS_OC_ADD(PseudoHeaderChecksum, PseudoHeaderChecksum, 0); + + /* Add-in any new carry. */ + + SKCS_OC_ADD(pPacketInfo->PseudoHeaderChecksum, PseudoHeaderChecksum, 0); + + pPacketInfo->ProtocolFlags = ProtocolFlags; + NextLevelProtoStats->TxOkCts++; /* Success. */ +} /* SkCsGetSendInfo */ + + +/****************************************************************************** + * + * SkCsGetReceiveInfo - verify checksum information for a received packet + * + * Description: + * Verify a received frame's checksum. The function returns a status code + * reflecting the result of the verification. + * + * Note: + * Before calling this function you have to verify that the frame is + * not padded and Checksum1 and Checksum2 are bigger than 1. + * + * Arguments: + * pAc - Pointer to adapter context struct. + * + * pIpHeader - Pointer to IP header. Must be at least the length in bytes + * of the received IP header including any option fields. For UDP packets, + * 8 additional bytes are needed to access the UDP checksum. + * + * Note: The actual length of the IP header is stored in the lower four + * bits of the first octet of the IP header as the number of 4-byte words, + * so it must be multiplied by four to get the length in bytes. Thus, the + * maximum IP header length is 15 * 4 = 60 bytes. + * + * Checksum1 - The first 16-bit Internet Checksum calculated by the + * hardware starting at the offset returned by SkCsSetReceiveFlags(). + * + * Checksum2 - The second 16-bit Internet Checksum calculated by the + * hardware starting at the offset returned by SkCsSetReceiveFlags(). + * + * Returns: + * SKCS_STATUS_UNKNOWN_IP_VERSION - Not an IP v4 frame. + * SKCS_STATUS_IP_CSUM_ERROR - IP checksum error. + * SKCS_STATUS_IP_CSUM_ERROR_TCP - IP checksum error in TCP frame. + * SKCS_STATUS_IP_CSUM_ERROR_UDP - IP checksum error in UDP frame + * SKCS_STATUS_IP_FRAGMENT - IP fragment (IP checksum ok). + * SKCS_STATUS_IP_CSUM_OK - IP checksum ok (not a TCP or UDP frame). + * SKCS_STATUS_TCP_CSUM_ERROR - TCP checksum error (IP checksum ok). + * SKCS_STATUS_UDP_CSUM_ERROR - UDP checksum error (IP checksum ok). + * SKCS_STATUS_TCP_CSUM_OK - IP and TCP checksum ok. + * SKCS_STATUS_UDP_CSUM_OK - IP and UDP checksum ok. + * SKCS_STATUS_IP_CSUM_OK_NO_UDP - IP checksum OK and no UDP checksum. + * + * Note: If SKCS_OVERWRITE_STATUS is defined, the SKCS_STATUS_XXX values + * returned here can be defined in some header file by the module using CSUM. + * In this way, the calling module can assign return values for its own needs, + * e.g. by assigning bit flags to the individual protocols. + */ +SKCS_STATUS SkCsGetReceiveInfo( +SK_AC *pAc, /* Adapter context struct. */ +void *pIpHeader, /* IP header. */ +unsigned Checksum1, /* Hardware checksum 1. */ +unsigned Checksum2, /* Hardware checksum 2. */ +int NetNumber) /* Net number */ +{ + /* Internet Header Version found in IP header. */ + unsigned InternetHeaderVersion; + + /* Length of the IP header as found in IP header. */ + unsigned IpHeaderLength; + + /* Length of IP data portion. */ + unsigned IpDataLength; + + /* IP header checksum. */ + unsigned IpHeaderChecksum; + + /* IP header options checksum, if any. */ + unsigned IpOptionsChecksum; + + /* IP data checksum, i.e. TCP/UDP checksum. */ + unsigned IpDataChecksum; + + /* Next level protocol identifier found in IP header. */ + unsigned NextLevelProtocol; + + /* The checksum of the "next level protocol", i.e. TCP or UDP. */ + unsigned long NextLevelProtocolChecksum; + + /* Pointer to next level protocol statistics structure. */ + SKCS_PROTO_STATS *NextLevelProtoStats; + + /* Temporary variable. */ + unsigned Tmp; + + Tmp = *(SK_U8 *) + SKCS_IDX(pIpHeader, SKCS_OFS_IP_HEADER_VERSION_AND_LENGTH); + + /* Get the Internet Header Version (IHV). */ + /* Note: The IHV is stored in the upper four bits. */ + + InternetHeaderVersion = Tmp >> 4; + + /* Check the Internet Header Version. */ + /* Note: We currently only support IP version 4. */ + + if (InternetHeaderVersion != 4) { /* IPv4? */ + SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_RX, + ("Rx: Unknown Internet Header Version %u.\n", + InternetHeaderVersion)); + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxUnableCts++; + return (SKCS_STATUS_UNKNOWN_IP_VERSION); + } + + /* Get the IP header length (IHL). */ + /* + * Note: The IHL is stored in the lower four bits as the number of + * 4-byte words. + */ + + IpHeaderLength = (Tmp & 0xf) * 4; + + /* Check the IP header length. */ + + /* 04-Aug-1998 sw - Really check the IHL? Necessary? */ + + if (IpHeaderLength < 5*4) { + SK_DBG_MSG(pAc, SK_DBGMOD_CSUM, SK_DBGCAT_ERR | SK_DBGCAT_RX, + ("Rx: Invalid IP Header Length %u.\n", IpHeaderLength)); + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++; + return (SKCS_STATUS_IP_CSUM_ERROR); + } + + /* This is an IPv4 frame with a header of valid length. */ + + /* Get the IP header and data checksum. */ + + IpDataChecksum = Checksum2; + + /* + * The IP header checksum is calculated as follows: + * + * IpHeaderChecksum = Checksum1 - Checksum2 + */ + + SKCS_OC_SUB(IpHeaderChecksum, Checksum1, Checksum2); + + /* Check if any IP header options. */ + + if (IpHeaderLength > SKCS_IP_HEADER_SIZE) { + + /* Get the IP options checksum. */ + + IpOptionsChecksum = SkCsCalculateChecksum( + SKCS_IDX(pIpHeader, SKCS_IP_HEADER_SIZE), + IpHeaderLength - SKCS_IP_HEADER_SIZE); + + /* Adjust the IP header and IP data checksums. */ + + SKCS_OC_ADD(IpHeaderChecksum, IpHeaderChecksum, IpOptionsChecksum); + + SKCS_OC_SUB(IpDataChecksum, IpDataChecksum, IpOptionsChecksum); + } + + /* + * Check if the IP header checksum is ok. + * + * NOTE: We must check the IP header checksum even if the caller just wants + * us to check upper-layer checksums, because we cannot do any further + * processing of the packet without a valid IP checksum. + */ + + /* Get the next level protocol identifier. */ + + NextLevelProtocol = *(SK_U8 *) + SKCS_IDX(pIpHeader, SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL); + + if (IpHeaderChecksum != 0xffff) { + pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++; + /* the NDIS tester wants to know the upper level protocol too */ + if (NextLevelProtocol == SKCS_PROTO_ID_TCP) { + return(SKCS_STATUS_IP_CSUM_ERROR_TCP); + } + else if (NextLevelProtocol == SKCS_PROTO_ID_UDP) { + return(SKCS_STATUS_IP_CSUM_ERROR_UDP); + } + return (SKCS_STATUS_IP_CSUM_ERROR); + } + + /* + * Check if this is a TCP or UDP frame and if we should calculate the + * TCP/UDP pseudo header checksum. + * + * Also clear all protocol bit flags of protocols not present in the + * frame. + */ + + if ((pAc->Csum.ReceiveFlags[NetNumber] & SKCS_PROTO_TCP) != 0 && + NextLevelProtocol == SKCS_PROTO_ID_TCP) { + /* TCP/IP frame. */ + NextLevelProtoStats = + &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_TCP]; + } + else if ((pAc->Csum.ReceiveFlags[NetNumber] & SKCS_PROTO_UDP) != 0 && + NextLevelProtocol == SKCS_PROTO_ID_UDP) { + /* UDP/IP frame. */ + NextLevelProtoStats = + &pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_UDP]; + } + else { + /* + * Either not a TCP or UDP frame and/or TCP/UDP processing not + * specified. + */ + return (SKCS_STATUS_IP_CSUM_OK); + } + + /* Check if this is an IP fragment. */ + + /* + * Note: An IP fragment has a non-zero "Fragment Offset" field and/or + * the "More Fragments" bit set. Thus, if both the "Fragment Offset" + * and the "More Fragments" are zero, it is *not* a fragment. We can + * easily check both at the same time since they are in the same 16-bit + * word. + */ + + if ((*(SK_U16 *) + SKCS_IDX(pIpHeader, SKCS_OFS_IP_FLAGS_AND_FRAGMENT_OFFSET) & + ~SKCS_IP_DONT_FRAGMENT) != 0) { + /* IP fragment; ignore all other protocols. */ + NextLevelProtoStats->RxUnableCts++; + return (SKCS_STATUS_IP_FRAGMENT); + } + + /* + * 08-May-2000 ra + * + * From RFC 768 (UDP) + * If the computed checksum is zero, it is transmitted as all ones (the + * equivalent in one's complement arithmetic). An all zero transmitted + * checksum value means that the transmitter generated no checksum (for + * debugging or for higher level protocols that don't care). + */ + + if (NextLevelProtocol == SKCS_PROTO_ID_UDP && + *(SK_U16*)SKCS_IDX(pIpHeader, IpHeaderLength + 6) == 0x0000) { + + NextLevelProtoStats->RxOkCts++; + + return (SKCS_STATUS_IP_CSUM_OK_NO_UDP); + } + + /* + * Calculate the TCP/UDP checksum. + */ + + /* Get total length of IP header and data. */ + + IpDataLength = + *(SK_U16 *) SKCS_IDX(pIpHeader, SKCS_OFS_IP_TOTAL_LENGTH); + + /* Get length of IP data portion. */ + + IpDataLength = SKCS_NTOH16(IpDataLength) - IpHeaderLength; + + NextLevelProtocolChecksum = + + /* Calculate the pseudo header checksum. */ + + (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader, + SKCS_OFS_IP_SOURCE_ADDRESS + 0) + + (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader, + SKCS_OFS_IP_SOURCE_ADDRESS + 2) + + (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader, + SKCS_OFS_IP_DESTINATION_ADDRESS + 0) + + (unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader, + SKCS_OFS_IP_DESTINATION_ADDRESS + 2) + + (unsigned long) SKCS_HTON16(NextLevelProtocol) + + (unsigned long) SKCS_HTON16(IpDataLength) + + + /* Add the TCP/UDP header checksum. */ + + (unsigned long) IpDataChecksum; + + /* Add-in any carries. */ + + SKCS_OC_ADD(NextLevelProtocolChecksum, NextLevelProtocolChecksum, 0); + + /* Add-in any new carry. */ + + SKCS_OC_ADD(NextLevelProtocolChecksum, NextLevelProtocolChecksum, 0); + + /* Check if the TCP/UDP checksum is ok. */ + + if ((unsigned) NextLevelProtocolChecksum == 0xffff) { + + /* TCP/UDP checksum ok. */ + + NextLevelProtoStats->RxOkCts++; + + return (NextLevelProtocol == SKCS_PROTO_ID_TCP ? + SKCS_STATUS_TCP_CSUM_OK : SKCS_STATUS_UDP_CSUM_OK); + } + + /* TCP/UDP checksum error. */ + + NextLevelProtoStats->RxErrCts++; + + return (NextLevelProtocol == SKCS_PROTO_ID_TCP ? + SKCS_STATUS_TCP_CSUM_ERROR : SKCS_STATUS_UDP_CSUM_ERROR); +} /* SkCsGetReceiveInfo */ + + +/****************************************************************************** + * + * SkCsSetReceiveFlags - set checksum receive flags + * + * Description: + * Use this function to set the various receive flags. According to the + * protocol flags set by the caller, the start offsets within received + * packets of the two hardware checksums are returned. These offsets must + * be stored in all receive descriptors. + * + * Arguments: + * pAc - Pointer to adapter context struct. + * + * ReceiveFlags - Any combination of SK_PROTO_XXX flags of the protocols + * for which the caller wants checksum information on received frames. + * + * pChecksum1Offset - The start offset of the first receive descriptor + * hardware checksum to be calculated for received frames is returned + * here. + * + * pChecksum2Offset - The start offset of the second receive descriptor + * hardware checksum to be calculated for received frames is returned + * here. + * + * Returns: N/A + * Returns the two hardware checksum start offsets. + */ +void SkCsSetReceiveFlags( +SK_AC *pAc, /* Adapter context struct. */ +unsigned ReceiveFlags, /* New receive flags. */ +unsigned *pChecksum1Offset, /* Offset for hardware checksum 1. */ +unsigned *pChecksum2Offset, /* Offset for hardware checksum 2. */ +int NetNumber) +{ + /* Save the receive flags. */ + + pAc->Csum.ReceiveFlags[NetNumber] = ReceiveFlags; + + /* First checksum start offset is the IP header. */ + *pChecksum1Offset = SKCS_MAC_HEADER_SIZE; + + /* + * Second checksum start offset is the IP data. Note that this may vary + * if there are any IP header options in the actual packet. + */ + *pChecksum2Offset = SKCS_MAC_HEADER_SIZE + SKCS_IP_HEADER_SIZE; +} /* SkCsSetReceiveFlags */ + +#ifndef SK_CS_CALCULATE_CHECKSUM + +/****************************************************************************** + * + * SkCsCalculateChecksum - calculate checksum for specified data + * + * Description: + * Calculate and return the 16-bit Internet Checksum for the specified + * data. + * + * Arguments: + * pData - Pointer to data for which the checksum shall be calculated. + * Note: The pointer should be aligned on a 16-bit boundary. + * + * Length - Length in bytes of data to checksum. + * + * Returns: + * The 16-bit Internet Checksum for the specified data. + * + * Note: The checksum is calculated in the machine's natural byte order, + * i.e. little vs. big endian. Thus, the resulting checksum is different + * for the same input data on little and big endian machines. + * + * However, when written back to the network packet, the byte order is + * always in correct network order. + */ +unsigned SkCsCalculateChecksum( +void *pData, /* Data to checksum. */ +unsigned Length) /* Length of data. */ +{ + SK_U16 *pU16; /* Pointer to the data as 16-bit words. */ + unsigned long Checksum; /* Checksum; must be at least 32 bits. */ + + /* Sum up all 16-bit words. */ + + pU16 = (SK_U16 *) pData; + for (Checksum = 0; Length > 1; Length -= 2) { + Checksum += *pU16++; + } + + /* If this is an odd number of bytes, add-in the last byte. */ + + if (Length > 0) { +#ifdef SK_BIG_ENDIAN + /* Add the last byte as the high byte. */ + Checksum += ((unsigned) *(SK_U8 *) pU16) << 8; +#else /* !SK_BIG_ENDIAN */ + /* Add the last byte as the low byte. */ + Checksum += *(SK_U8 *) pU16; +#endif /* !SK_BIG_ENDIAN */ + } + + /* Add-in any carries. */ + + SKCS_OC_ADD(Checksum, Checksum, 0); + + /* Add-in any new carry. */ + + SKCS_OC_ADD(Checksum, Checksum, 0); + + /* Note: All bits beyond the 16-bit limit are now zero. */ + + return ((unsigned) Checksum); +} /* SkCsCalculateChecksum */ + +#endif /* SK_CS_CALCULATE_CHECKSUM */ + +/****************************************************************************** + * + * SkCsEvent - the CSUM event dispatcher + * + * Description: + * This is the event handler for the CSUM module. + * + * Arguments: + * pAc - Pointer to adapter context. + * + * Ioc - I/O context. + * + * Event - Event id. + * + * Param - Event dependent parameter. + * + * Returns: + * The 16-bit Internet Checksum for the specified data. + * + * Note: The checksum is calculated in the machine's natural byte order, + * i.e. little vs. big endian. Thus, the resulting checksum is different + * for the same input data on little and big endian machines. + * + * However, when written back to the network packet, the byte order is + * always in correct network order. + */ +int SkCsEvent( +SK_AC *pAc, /* Pointer to adapter context. */ +SK_IOC Ioc, /* I/O context. */ +SK_U32 Event, /* Event id. */ +SK_EVPARA Param) /* Event dependent parameter. */ +{ + int ProtoIndex; + int NetNumber; + + switch (Event) { + /* + * Clear protocol statistics. + * + * Param - Protocol index, or -1 for all protocols. + * - Net number. + */ + case SK_CSUM_EVENT_CLEAR_PROTO_STATS: + + ProtoIndex = (int)Param.Para32[1]; + NetNumber = (int)Param.Para32[0]; + if (ProtoIndex < 0) { /* Clear for all protocols. */ + if (NetNumber >= 0) { + SK_MEMSET(&pAc->Csum.ProtoStats[NetNumber][0], 0, + sizeof(pAc->Csum.ProtoStats[NetNumber])); + } + } + else { /* Clear for individual protocol. */ + SK_MEMSET(&pAc->Csum.ProtoStats[NetNumber][ProtoIndex], 0, + sizeof(pAc->Csum.ProtoStats[NetNumber][ProtoIndex])); + } + break; + default: + break; + } + return (0); /* Success. */ +} /* SkCsEvent */ + +#endif /* SK_USE_CSUM */ diff --git a/trunk/drivers/net/sk98lin/skethtool.c b/trunk/drivers/net/sk98lin/skethtool.c index 4265ed91a9c4..fb639959292b 100644 --- a/trunk/drivers/net/sk98lin/skethtool.c +++ b/trunk/drivers/net/sk98lin/skethtool.c @@ -539,48 +539,6 @@ static int setPauseParams(struct net_device *dev , struct ethtool_pauseparam *ep return ret ? -EIO : 0; } -/* Only Yukon supports checksum offload. */ -static int setScatterGather(struct net_device *dev, u32 data) -{ - DEV_NET *pNet = netdev_priv(dev); - SK_AC *pAC = pNet->pAC; - - if (pAC->GIni.GIChipId == CHIP_ID_GENESIS) - return -EOPNOTSUPP; - return ethtool_op_set_sg(dev, data); -} - -static int setTxCsum(struct net_device *dev, u32 data) -{ - DEV_NET *pNet = netdev_priv(dev); - SK_AC *pAC = pNet->pAC; - - if (pAC->GIni.GIChipId == CHIP_ID_GENESIS) - return -EOPNOTSUPP; - - return ethtool_op_set_tx_csum(dev, data); -} - -static u32 getRxCsum(struct net_device *dev) -{ - DEV_NET *pNet = netdev_priv(dev); - SK_AC *pAC = pNet->pAC; - - return pAC->RxPort[pNet->PortNr].RxCsum; -} - -static int setRxCsum(struct net_device *dev, u32 data) -{ - DEV_NET *pNet = netdev_priv(dev); - SK_AC *pAC = pNet->pAC; - - if (pAC->GIni.GIChipId == CHIP_ID_GENESIS) - return -EOPNOTSUPP; - - pAC->RxPort[pNet->PortNr].RxCsum = data != 0; - return 0; -} - struct ethtool_ops SkGeEthtoolOps = { .get_settings = getSettings, .set_settings = setSettings, @@ -591,12 +549,4 @@ struct ethtool_ops SkGeEthtoolOps = { .phys_id = locateDevice, .get_pauseparam = getPauseParams, .set_pauseparam = setPauseParams, - .get_link = ethtool_op_get_link, - .get_perm_addr = ethtool_op_get_perm_addr, - .get_sg = ethtool_op_get_sg, - .set_sg = setScatterGather, - .get_tx_csum = ethtool_op_get_tx_csum, - .set_tx_csum = setTxCsum, - .get_rx_csum = getRxCsum, - .set_rx_csum = setRxCsum, }; diff --git a/trunk/drivers/net/sk98lin/skge.c b/trunk/drivers/net/sk98lin/skge.c index 9a76ac180b11..b18c92cb629e 100644 --- a/trunk/drivers/net/sk98lin/skge.c +++ b/trunk/drivers/net/sk98lin/skge.c @@ -101,18 +101,18 @@ * "h/skgeinit.h" * "h/skaddr.h" * "h/skgesirq.h" + * "h/skcsum.h" * "h/skrlmt.h" * ******************************************************************************/ #include "h/skversion.h" -#include #include #include #include +#include #include -#include #include "h/skdrv1st.h" #include "h/skdrv2nd.h" @@ -206,6 +206,7 @@ static void SkGeSetRxMode(struct SK_NET_DEVICE *dev); static struct net_device_stats *SkGeStats(struct SK_NET_DEVICE *dev); static int SkGeIoctl(struct SK_NET_DEVICE *dev, struct ifreq *rq, int cmd); static void GetConfiguration(SK_AC*); +static void ProductStr(SK_AC*); static int XmitFrame(SK_AC*, TX_PORT*, struct sk_buff*); static void FreeTxDescriptors(SK_AC*pAC, TX_PORT*); static void FillRxRing(SK_AC*, RX_PORT*); @@ -234,6 +235,28 @@ static int SkDrvDeInitAdapter(SK_AC *pAC, int devNbr); * Extern Function Prototypes * ******************************************************************************/ +static const char SKRootName[] = "net/sk98lin"; +static struct proc_dir_entry *pSkRootDir; +extern struct file_operations sk_proc_fops; + +static inline void SkGeProcCreate(struct net_device *dev) +{ + struct proc_dir_entry *pe; + + if (pSkRootDir && + (pe = create_proc_entry(dev->name, S_IRUGO, pSkRootDir))) { + pe->proc_fops = &sk_proc_fops; + pe->data = dev; + pe->owner = THIS_MODULE; + } +} + +static inline void SkGeProcRemove(struct net_device *dev) +{ + if (pSkRootDir) + remove_proc_entry(dev->name, pSkRootDir); +} + extern void SkDimEnableModerationIfNeeded(SK_AC *pAC); extern void SkDimDisplayModerationSettings(SK_AC *pAC); extern void SkDimStartModerationTimer(SK_AC *pAC); @@ -254,27 +277,6 @@ extern struct ethtool_ops SkGeEthtoolOps; static uintptr_t TxQueueAddr[SK_MAX_MACS][2] = {{0x680, 0x600},{0x780, 0x700}}; static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480}; -/***************************************************************************** - * - * SkPciWriteCfgDWord - write a 32 bit value to pci config space - * - * Description: - * This routine writes a 32 bit value to the pci configuration - * space. - * - * Returns: - * 0 - indicate everything worked ok. - * != 0 - error indication - */ -static inline int SkPciWriteCfgDWord( -SK_AC *pAC, /* Adapter Control structure pointer */ -int PciAddr, /* PCI register address */ -SK_U32 Val) /* pointer to store the read value */ -{ - pci_write_config_dword(pAC->PciDev, PciAddr, Val); - return(0); -} /* SkPciWriteCfgDWord */ - /***************************************************************************** * * SkGeInitPCI - Init the PCI resources @@ -298,7 +300,7 @@ int SkGeInitPCI(SK_AC *pAC) dev->mem_start = pci_resource_start (pdev, 0); pci_set_master(pdev); - if (pci_request_regions(pdev, "sk98lin") != 0) { + if (pci_request_regions(pdev, pAC->Name) != 0) { retval = 2; goto out_disable; } @@ -576,10 +578,10 @@ SK_BOOL DualNet; spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); if (pAC->GIni.GIMacsFound == 2) { - Ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, "sk98lin", dev); + Ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev); } else if (pAC->GIni.GIMacsFound == 1) { Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, - "sk98lin", dev); + pAC->Name, dev); } else { printk(KERN_WARNING "sk98lin: Illegal number of ports: %d\n", pAC->GIni.GIMacsFound); @@ -599,6 +601,11 @@ SK_BOOL DualNet; return(-EAGAIN); } + SkCsSetReceiveFlags(pAC, + SKCS_PROTO_IP | SKCS_PROTO_TCP | SKCS_PROTO_UDP, + &pAC->CsOfs1, &pAC->CsOfs2, 0); + pAC->CsOfs = (pAC->CsOfs2 << 16) | pAC->CsOfs1; + BoardInitMem(pAC); /* tschilling: New common function with minimum size check. */ DualNet = SK_FALSE; @@ -816,7 +823,7 @@ uintptr_t VNextDescr; /* the virtual bus address of the next descriptor */ /* set the pointers right */ pDescr->VNextRxd = VNextDescr & 0xffffffffULL; pDescr->pNextRxd = pNextDescr; - if (!IsTx) pDescr->TcpSumStarts = ETH_HLEN << 16 | ETH_HLEN; + pDescr->TcpSumStarts = pAC->CsOfs; /* advance one step */ pPrevDescr = pDescr; @@ -1263,6 +1270,7 @@ struct SK_NET_DEVICE *dev) spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); pAC->MaxPorts++; + pNet->Up = 1; SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, @@ -1392,6 +1400,7 @@ struct SK_NET_DEVICE *dev) sizeof(SK_PNMI_STRUCT_DATA)); pAC->MaxPorts--; + pNet->Up = 0; return (0); } /* SkGeClose */ @@ -1496,6 +1505,8 @@ struct sk_buff *pMessage) /* pointer to send-message */ TXD *pOldTxd; unsigned long Flags; SK_U64 PhysAddr; + int Protocol; + int IpHeaderLength; int BytesSend = pMessage->len; SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_TX_PROGRESS, ("X")); @@ -1568,10 +1579,8 @@ struct sk_buff *pMessage) /* pointer to send-message */ pTxd->pMBuf = pMessage; if (pMessage->ip_summed == CHECKSUM_HW) { - u16 hdrlen = pMessage->h.raw - pMessage->data; - u16 offset = hdrlen + pMessage->csum; - - if ((pMessage->h.ipiph->protocol == IPPROTO_UDP ) && + Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff); + if ((Protocol == C_PROTO_ID_UDP) && (pAC->GIni.GIChipRev == 0) && (pAC->GIni.GIChipId == CHIP_ID_YUKON)) { pTxd->TBControl = BMU_TCP_CHECK; @@ -1579,9 +1588,14 @@ struct sk_buff *pMessage) /* pointer to send-message */ pTxd->TBControl = BMU_UDP_CHECK; } - pTxd->TcpSumOfs = 0; - pTxd->TcpSumSt = hdrlen; - pTxd->TcpSumWr = offset; + IpHeaderLength = (SK_U8)pMessage->data[C_OFFSET_IPHEADER]; + IpHeaderLength = (IpHeaderLength & 0xf) * 4; + pTxd->TcpSumOfs = 0; /* PH-Checksum already calculated */ + pTxd->TcpSumSt = C_LEN_ETHERMAC_HEADER + IpHeaderLength + + (Protocol == C_PROTO_ID_UDP ? + C_OFFSET_UDPHEADER_UDPCS : + C_OFFSET_TCPHEADER_TCPCS); + pTxd->TcpSumWr = C_LEN_ETHERMAC_HEADER + IpHeaderLength; pTxd->TBControl |= BMU_OWN | BMU_STF | BMU_SW | BMU_EOF | @@ -1644,10 +1658,11 @@ struct sk_buff *pMessage) /* pointer to send-message */ TXD *pTxdLst; int CurrFrag; int BytesSend; + int IpHeaderLength; + int Protocol; skb_frag_t *sk_frag; SK_U64 PhysAddr; unsigned long Flags; - SK_U32 Control; spin_lock_irqsave(&pTxPort->TxDesRingLock, Flags); #ifndef USE_TX_COMPLETE @@ -1670,6 +1685,7 @@ struct sk_buff *pMessage) /* pointer to send-message */ pTxdFst = pTxd; pTxdLst = pTxd; BytesSend = 0; + Protocol = 0; /* ** Map the first fragment (header) into the DMA-space @@ -1687,31 +1703,32 @@ struct sk_buff *pMessage) /* pointer to send-message */ ** Does the HW need to evaluate checksum for TCP or UDP packets? */ if (pMessage->ip_summed == CHECKSUM_HW) { - u16 hdrlen = pMessage->h.raw - pMessage->data; - u16 offset = hdrlen + pMessage->csum; - - Control = BMU_STFWD; - + pTxd->TBControl = BMU_STF | BMU_STFWD | skb_headlen(pMessage); /* ** We have to use the opcode for tcp here, because the ** opcode for udp is not working in the hardware yet ** (Revision 2.0) */ - if ((pMessage->h.ipiph->protocol == IPPROTO_UDP ) && + Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff); + if ((Protocol == C_PROTO_ID_UDP) && (pAC->GIni.GIChipRev == 0) && (pAC->GIni.GIChipId == CHIP_ID_YUKON)) { - Control |= BMU_TCP_CHECK; + pTxd->TBControl |= BMU_TCP_CHECK; } else { - Control |= BMU_UDP_CHECK; + pTxd->TBControl |= BMU_UDP_CHECK; } - pTxd->TcpSumOfs = 0; - pTxd->TcpSumSt = hdrlen; - pTxd->TcpSumWr = offset; - } else - Control = BMU_CHECK | BMU_SW; - - pTxd->TBControl = BMU_STF | Control | skb_headlen(pMessage); + IpHeaderLength = ((SK_U8)pMessage->data[C_OFFSET_IPHEADER] & 0xf)*4; + pTxd->TcpSumOfs = 0; /* PH-Checksum already claculated */ + pTxd->TcpSumSt = C_LEN_ETHERMAC_HEADER + IpHeaderLength + + (Protocol == C_PROTO_ID_UDP ? + C_OFFSET_UDPHEADER_UDPCS : + C_OFFSET_TCPHEADER_TCPCS); + pTxd->TcpSumWr = C_LEN_ETHERMAC_HEADER + IpHeaderLength; + } else { + pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_STF | + skb_headlen(pMessage); + } pTxd = pTxd->pNextTxd; pTxPort->TxdRingFree--; @@ -1735,18 +1752,40 @@ struct sk_buff *pMessage) /* pointer to send-message */ pTxd->VDataHigh = (SK_U32) (PhysAddr >> 32); pTxd->pMBuf = pMessage; - pTxd->TBControl = Control | BMU_OWN | sk_frag->size;; + /* + ** Does the HW need to evaluate checksum for TCP or UDP packets? + */ + if (pMessage->ip_summed == CHECKSUM_HW) { + pTxd->TBControl = BMU_OWN | BMU_SW | BMU_STFWD; + /* + ** We have to use the opcode for tcp here because the + ** opcode for udp is not working in the hardware yet + ** (revision 2.0) + */ + if ((Protocol == C_PROTO_ID_UDP) && + (pAC->GIni.GIChipRev == 0) && + (pAC->GIni.GIChipId == CHIP_ID_YUKON)) { + pTxd->TBControl |= BMU_TCP_CHECK; + } else { + pTxd->TBControl |= BMU_UDP_CHECK; + } + } else { + pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_OWN; + } /* ** Do we have the last fragment? */ if( (CurrFrag+1) == skb_shinfo(pMessage)->nr_frags ) { #ifdef USE_TX_COMPLETE - pTxd->TBControl |= BMU_EOF | BMU_IRQ_EOF; + pTxd->TBControl |= BMU_EOF | BMU_IRQ_EOF | sk_frag->size; #else - pTxd->TBControl |= BMU_EOF; + pTxd->TBControl |= BMU_EOF | sk_frag->size; #endif pTxdFst->TBControl |= BMU_OWN | BMU_SW; + + } else { + pTxd->TBControl |= sk_frag->size; } pTxdLst = pTxd; pTxd = pTxd->pNextTxd; @@ -1993,6 +2032,7 @@ SK_U32 Control; /* control field of descriptor */ struct sk_buff *pMsg; /* pointer to message holding frame */ struct sk_buff *pNewMsg; /* pointer to a new message for copying frame */ int FrameLength; /* total length of received frame */ +int IpFrameLength; SK_MBUF *pRlmtMbuf; /* ptr to a buffer for giving a frame to rlmt */ SK_EVPARA EvPara; /* an event parameter union */ unsigned long Flags; /* for spin lock */ @@ -2005,6 +2045,10 @@ SK_BOOL IsMc; SK_BOOL IsBadFrame; /* Bad frame */ SK_U32 FrameStat; +unsigned short Csum1; +unsigned short Csum2; +unsigned short Type; +int Result; SK_U64 PhysAddr; rx_start: @@ -2133,8 +2177,8 @@ SK_U64 PhysAddr; (dma_addr_t) PhysAddr, FrameLength, PCI_DMA_FROMDEVICE); - memcpy(pNewMsg->data, pMsg, FrameLength); - + eth_copy_and_sum(pNewMsg, pMsg->data, + FrameLength, 0); pci_dma_sync_single_for_device(pAC->PciDev, (dma_addr_t) PhysAddr, FrameLength, @@ -2162,15 +2206,69 @@ SK_U64 PhysAddr; /* set length in message */ skb_put(pMsg, FrameLength); - } /* frame > SK_COPY_TRESHOLD */ + /* hardware checksum */ + Type = ntohs(*((short*)&pMsg->data[12])); #ifdef USE_SK_RX_CHECKSUM - pMsg->csum = pRxd->TcpSums & 0xffff; - pMsg->ip_summed = CHECKSUM_HW; + if (Type == 0x800) { + Csum1=le16_to_cpu(pRxd->TcpSums & 0xffff); + Csum2=le16_to_cpu((pRxd->TcpSums >> 16) & 0xffff); + IpFrameLength = (int) ntohs((unsigned short) + ((unsigned short *) pMsg->data)[8]); + + /* + * Test: If frame is padded, a check is not possible! + * Frame not padded? Length difference must be 14 (0xe)! + */ + if ((FrameLength - IpFrameLength) != 0xe) { + /* Frame padded => TCP offload not possible! */ + pMsg->ip_summed = CHECKSUM_NONE; + } else { + /* Frame not padded => TCP offload! */ + if ((((Csum1 & 0xfffe) && (Csum2 & 0xfffe)) && + (pAC->GIni.GIChipId == CHIP_ID_GENESIS)) || + (pAC->ChipsetType)) { + Result = SkCsGetReceiveInfo(pAC, + &pMsg->data[14], + Csum1, Csum2, pRxPort->PortIndex); + if (Result == + SKCS_STATUS_IP_FRAGMENT || + Result == + SKCS_STATUS_IP_CSUM_OK || + Result == + SKCS_STATUS_TCP_CSUM_OK || + Result == + SKCS_STATUS_UDP_CSUM_OK) { + pMsg->ip_summed = + CHECKSUM_UNNECESSARY; + } + else if (Result == + SKCS_STATUS_TCP_CSUM_ERROR || + Result == + SKCS_STATUS_UDP_CSUM_ERROR || + Result == + SKCS_STATUS_IP_CSUM_ERROR_UDP || + Result == + SKCS_STATUS_IP_CSUM_ERROR_TCP || + Result == + SKCS_STATUS_IP_CSUM_ERROR ) { + /* HW Checksum error */ + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, + SK_DBGCAT_DRV_RX_PROGRESS, + ("skge: CRC error. Frame dropped!\n")); + goto rx_failed; + } else { + pMsg->ip_summed = + CHECKSUM_NONE; + } + }/* checksumControl calculation valid */ + } /* Frame length check */ + } /* IP frame */ #else - pMsg->ip_summed = CHECKSUM_NONE; + pMsg->ip_summed = CHECKSUM_NONE; #endif - + } /* frame > SK_COPY_TRESHOLD */ + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("V")); ForRlmt = SK_RLMT_RX_PROTOCOL; #if 0 @@ -2545,7 +2643,7 @@ unsigned long Flags; static int SkGeChangeMtu(struct SK_NET_DEVICE *dev, int NewMtu) { DEV_NET *pNet; -struct net_device *pOtherDev; +DEV_NET *pOtherNet; SK_AC *pAC; unsigned long Flags; int i; @@ -2575,11 +2673,11 @@ SK_EVPARA EvPara; } #endif - pOtherDev = pAC->dev[1 - pNet->NetNr]; - - if ( netif_running(pOtherDev) && (pOtherDev->mtu > 1500) - && (NewMtu <= 1500)) - return 0; + pNet->Mtu = NewMtu; + pOtherNet = netdev_priv(pAC->dev[1 - pNet->NetNr]); + if ((pOtherNet->Mtu>1500) && (NewMtu<=1500) && (pOtherNet->Up==1)) { + return(0); + } pAC->RxBufSize = NewMtu + 32; dev->mtu = NewMtu; @@ -2741,8 +2839,7 @@ SK_EVPARA EvPara; EvPara.Para32[1] = -1; SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara); - if (netif_running(pOtherDev)) { - DEV_NET *pOtherNet = netdev_priv(pOtherDev); + if (pOtherNet->Up) { EvPara.Para32[0] = pOtherNet->PortNr; SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara); } @@ -2816,7 +2913,7 @@ unsigned long Flags; /* for spin lock */ pAC->stats.rx_bytes = (SK_U32) pPnmiStruct->RxOctetsDeliveredCts; pAC->stats.tx_bytes = (SK_U32) pPnmiStat->StatTxOctetsOkCts; - if (dev->mtu <= 1500) { + if (pNet->Mtu <= 1500) { pAC->stats.rx_errors = (SK_U32) pPnmiStruct->InErrorsCts & 0xFFFFFFFF; } else { pAC->stats.rx_errors = (SK_U32) ((pPnmiStruct->InErrorsCts - @@ -3767,21 +3864,25 @@ int Capabilities[3][3] = * * Returns: N/A */ -static inline int ProductStr( - SK_AC *pAC, /* pointer to adapter context */ - char *DeviceStr, /* result string */ - int StrLen /* length of the string */ +static void ProductStr( +SK_AC *pAC /* pointer to adapter context */ ) { +int StrLen = 80; /* length of the string, defined in SK_AC */ char Keyword[] = VPD_NAME; /* vpd productname identifier */ int ReturnCode; /* return code from vpd_read */ unsigned long Flags; spin_lock_irqsave(&pAC->SlowPathLock, Flags); - ReturnCode = VpdRead(pAC, pAC->IoBase, Keyword, DeviceStr, &StrLen); + ReturnCode = VpdRead(pAC, pAC->IoBase, Keyword, pAC->DeviceStr, + &StrLen); spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); - - return ReturnCode; + if (ReturnCode != 0) { + /* there was an error reading the vpd data */ + SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ERROR, + ("Error reading VPD data: %d\n", ReturnCode)); + pAC->DeviceStr[0] = '\0'; + } } /* ProductStr */ /***************************************************************************** @@ -3982,6 +4083,28 @@ SK_U8 *pVal) /* pointer to store the read value */ } /* SkPciReadCfgByte */ +/***************************************************************************** + * + * SkPciWriteCfgDWord - write a 32 bit value to pci config space + * + * Description: + * This routine writes a 32 bit value to the pci configuration + * space. + * + * Returns: + * 0 - indicate everything worked ok. + * != 0 - error indication + */ +int SkPciWriteCfgDWord( +SK_AC *pAC, /* Adapter Control structure pointer */ +int PciAddr, /* PCI register address */ +SK_U32 Val) /* pointer to store the read value */ +{ + pci_write_config_dword(pAC->PciDev, PciAddr, Val); + return(0); +} /* SkPciWriteCfgDWord */ + + /***************************************************************************** * * SkPciWriteCfgWord - write a 16 bit value to pci config space @@ -4120,7 +4243,6 @@ SK_BOOL DualNet; Flags); break; case SK_DRV_NET_UP: /* SK_U32 PortIdx */ - { struct net_device *dev = pAC->dev[Param.Para32[0]]; /* action list 5 */ FromPort = Param.Para32[0]; SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, @@ -4204,12 +4326,22 @@ SK_BOOL DualNet; printk(" irq moderation: disabled\n"); - printk(" scatter-gather: %s\n", - (dev->features & NETIF_F_SG) ? "enabled" : "disabled"); - printk(" tx-checksum: %s\n", - (dev->features & NETIF_F_IP_CSUM) ? "enabled" : "disabled"); - printk(" rx-checksum: %s\n", - pAC->RxPort[Param.Para32[0]].RxCsum ? "enabled" : "disabled"); +#ifdef SK_ZEROCOPY + if (pAC->ChipsetType) +#ifdef USE_SK_TX_CHECKSUM + printk(" scatter-gather: enabled\n"); +#else + printk(" tx-checksum: disabled\n"); +#endif + else + printk(" scatter-gather: disabled\n"); +#else + printk(" scatter-gather: disabled\n"); +#endif + +#ifndef USE_SK_RX_CHECKSUM + printk(" rx-checksum: disabled\n"); +#endif } else { DoPrintInterfaceChange = SK_TRUE; @@ -4224,9 +4356,9 @@ SK_BOOL DualNet; } /* Inform the world that link protocol is up. */ - netif_carrier_on(dev); + netif_carrier_on(pAC->dev[Param.Para32[0]]); + break; - } case SK_DRV_NET_DOWN: /* SK_U32 Reason */ /* action list 7 */ SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, @@ -4440,7 +4572,7 @@ SK_AC *pAc) /* pointer to adapter context */ pAC->DiagModeActive = DIAG_ACTIVE; if (pAC->BoardLevel > SK_INIT_DATA) { - if (netif_running(pAC->dev[0])) { + if (pNet->Up) { pAC->WasIfUp[0] = SK_TRUE; pAC->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */ DoPrintInterfaceChange = SK_FALSE; @@ -4450,7 +4582,7 @@ SK_AC *pAc) /* pointer to adapter context */ } if (pNet != netdev_priv(pAC->dev[1])) { pNet = netdev_priv(pAC->dev[1]); - if (netif_running(pAC->dev[1])) { + if (pNet->Up) { pAC->WasIfUp[1] = SK_TRUE; pAC->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */ DoPrintInterfaceChange = SK_FALSE; @@ -4776,7 +4908,6 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, struct net_device *dev = NULL; static int boards_found = 0; int error = -ENODEV; - char DeviceStr[80]; if (pci_enable_device(pdev)) goto out; @@ -4804,15 +4935,18 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, memset(pNet->pAC, 0, sizeof(SK_AC)); pAC = pNet->pAC; pAC->PciDev = pdev; - + pAC->PciDevId = pdev->device; pAC->dev[0] = dev; pAC->dev[1] = dev; + sprintf(pAC->Name, "SysKonnect SK-98xx"); pAC->CheckQueue = SK_FALSE; + pNet->Mtu = 1500; + pNet->Up = 0; dev->irq = pdev->irq; error = SkGeInitPCI(pAC); if (error) { - printk(KERN_ERR "sk98lin: PCI setup failed: %i\n", error); + printk("SKGE: PCI setup failed: %i\n", error); goto out_free_netdev; } @@ -4831,38 +4965,30 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, SET_NETDEV_DEV(dev, &pdev->dev); SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps); - /* Use only if yukon hardware */ - if (pAC->ChipsetType) { -#ifdef USE_SK_TX_CHECKSUM - dev->features |= NETIF_F_IP_CSUM; -#endif #ifdef SK_ZEROCOPY - dev->features |= NETIF_F_SG; +#ifdef USE_SK_TX_CHECKSUM + if (pAC->ChipsetType) { + /* Use only if yukon hardware */ + /* SK and ZEROCOPY - fly baby... */ + dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; + } #endif -#ifdef USE_SK_RX_CHECKSUM - pAC->RxPort[0].RxCsum = 1; #endif - } pAC->Index = boards_found++; if (SkGeBoardInit(dev, pAC)) goto out_free_netdev; - /* Read Adapter name from VPD */ - if (ProductStr(pAC, DeviceStr, sizeof(DeviceStr)) != 0) { - printk(KERN_ERR "sk98lin: Could not read VPD data.\n"); - goto out_free_resources; - } - /* Register net device */ if (register_netdev(dev)) { - printk(KERN_ERR "sk98lin: Could not register device.\n"); + printk(KERN_ERR "SKGE: Could not register device.\n"); goto out_free_resources; } /* Print adapter specific string from vpd */ - printk("%s: %s\n", dev->name, DeviceStr); + ProductStr(pAC); + printk("%s: %s\n", dev->name, pAC->DeviceStr); /* Print configuration settings */ printk(" PrefPort:%c RlmtMode:%s\n", @@ -4875,8 +5001,10 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, SkGeYellowLED(pAC, pAC->IoBase, 1); + memcpy(&dev->dev_addr, &pAC->Addr.Net[0].CurrentMacAddress, 6); - memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); + + SkGeProcCreate(dev); pNet->PortNr = 0; pNet->NetNr = 0; @@ -4896,6 +5024,8 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, pNet->PortNr = 1; pNet->NetNr = 1; pNet->pAC = pAC; + pNet->Mtu = 1500; + pNet->Up = 0; dev->open = &SkGeOpen; dev->stop = &SkGeClose; @@ -4908,28 +5038,25 @@ static int __devinit skge_probe_one(struct pci_dev *pdev, SET_NETDEV_DEV(dev, &pdev->dev); SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps); - if (pAC->ChipsetType) { -#ifdef USE_SK_TX_CHECKSUM - dev->features |= NETIF_F_IP_CSUM; -#endif #ifdef SK_ZEROCOPY - dev->features |= NETIF_F_SG; +#ifdef USE_SK_TX_CHECKSUM + if (pAC->ChipsetType) { + /* SG and ZEROCOPY - fly baby... */ + dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; + } #endif -#ifdef USE_SK_RX_CHECKSUM - pAC->RxPort[1].RxCsum = 1; #endif - } if (register_netdev(dev)) { - printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n"); + printk(KERN_ERR "SKGE: Could not register device.\n"); free_netdev(dev); pAC->dev[1] = pAC->dev[0]; } else { + SkGeProcCreate(dev); memcpy(&dev->dev_addr, &pAC->Addr.Net[1].CurrentMacAddress, 6); - memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); - printk("%s: %s\n", dev->name, DeviceStr); + printk("%s: %s\n", dev->name, pAC->DeviceStr); printk(" PrefPort:B RlmtMode:Dual Check Link State\n"); } } @@ -4965,7 +5092,10 @@ static void __devexit skge_remove_one(struct pci_dev *pdev) SK_AC *pAC = pNet->pAC; struct net_device *otherdev = pAC->dev[1]; + SkGeProcRemove(dev); unregister_netdev(dev); + if (otherdev != dev) + SkGeProcRemove(otherdev); SkGeYellowLED(pAC, pAC->IoBase, 0); @@ -5050,9 +5180,9 @@ static int skge_resume(struct pci_dev *pdev) pci_enable_device(pdev); pci_set_master(pdev); if (pAC->GIni.GIMacsFound == 2) - ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, "sk98lin", dev); + ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev); else - ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, "sk98lin", dev); + ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, pAC->Name, dev); if (ret) { printk(KERN_WARNING "sk98lin: unable to acquire IRQ %d\n", dev->irq); pAC->AllocFlag &= ~SK_ALLOC_IRQ; @@ -5110,12 +5240,23 @@ static struct pci_driver skge_driver = { static int __init skge_init(void) { - return pci_module_init(&skge_driver); + int error; + + pSkRootDir = proc_mkdir(SKRootName, NULL); + if (pSkRootDir) + pSkRootDir->owner = THIS_MODULE; + + error = pci_register_driver(&skge_driver); + if (error) + remove_proc_entry(SKRootName, NULL); + return error; } static void __exit skge_exit(void) { pci_unregister_driver(&skge_driver); + remove_proc_entry(SKRootName, NULL); + } module_init(skge_init); diff --git a/trunk/drivers/net/sk98lin/skproc.c b/trunk/drivers/net/sk98lin/skproc.c new file mode 100644 index 000000000000..5cece25c034e --- /dev/null +++ b/trunk/drivers/net/sk98lin/skproc.c @@ -0,0 +1,265 @@ +/****************************************************************************** + * + * Name: skproc.c + * Project: GEnesis, PCI Gigabit Ethernet Adapter + * Version: $Revision: 1.11 $ + * Date: $Date: 2003/12/11 16:03:57 $ + * Purpose: Funktions to display statictic data + * + ******************************************************************************/ + +/****************************************************************************** + * + * (C)Copyright 1998-2002 SysKonnect GmbH. + * (C)Copyright 2002-2003 Marvell. + * + * 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. + * + * Created 22-Nov-2000 + * Author: Mirko Lindner (mlindner@syskonnect.de) + * + * The information in this file is provided "AS IS" without warranty. + * + ******************************************************************************/ +#include +#include + +#include "h/skdrv1st.h" +#include "h/skdrv2nd.h" +#include "h/skversion.h" + +static int sk_seq_show(struct seq_file *seq, void *v); +static int sk_proc_open(struct inode *inode, struct file *file); + +struct file_operations sk_proc_fops = { + .owner = THIS_MODULE, + .open = sk_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + + +/***************************************************************************** + * + * sk_seq_show - show proc information of a particular adapter + * + * Description: + * This function fills the proc entry with statistic data about + * the ethernet device. It invokes the generic sk_gen_browse() to + * print out all items one per one. + * + * Returns: 0 + * + */ +static int sk_seq_show(struct seq_file *seq, void *v) +{ + struct net_device *dev = seq->private; + DEV_NET *pNet = netdev_priv(dev); + SK_AC *pAC = pNet->pAC; + SK_PNMI_STRUCT_DATA *pPnmiStruct = &pAC->PnmiStruct; + unsigned long Flags; + unsigned int Size; + char sens_msg[50]; + int t; + int i; + + /* NetIndex in GetStruct is now required, zero is only dummy */ + for (t=pAC->GIni.GIMacsFound; t > 0; t--) { + if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 1) + t--; + + spin_lock_irqsave(&pAC->SlowPathLock, Flags); + Size = SK_PNMI_STRUCT_SIZE; +#ifdef SK_DIAG_SUPPORT + if (pAC->BoardLevel == SK_INIT_DATA) { + SK_MEMCPY(&(pAC->PnmiStruct), &(pAC->PnmiBackup), sizeof(SK_PNMI_STRUCT_DATA)); + if (pAC->DiagModeActive == DIAG_NOTACTIVE) { + pAC->Pnmi.DiagAttached = SK_DIAG_IDLE; + } + } else { + SkPnmiGetStruct(pAC, pAC->IoBase, pPnmiStruct, &Size, t-1); + } +#else + SkPnmiGetStruct(pAC, pAC->IoBase, + pPnmiStruct, &Size, t-1); +#endif + spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); + + if (pAC->dev[t-1] == dev) { + SK_PNMI_STAT *pPnmiStat = &pPnmiStruct->Stat[0]; + + seq_printf(seq, "\nDetailed statistic for device %s\n", + pAC->dev[t-1]->name); + seq_printf(seq, "=======================================\n"); + + /* Board statistics */ + seq_printf(seq, "\nBoard statistics\n\n"); + seq_printf(seq, "Active Port %c\n", + 'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt. + Net[t-1].PrefPort]->PortNumber); + seq_printf(seq, "Preferred Port %c\n", + 'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt. + Net[t-1].PrefPort]->PortNumber); + + seq_printf(seq, "Bus speed (MHz) %d\n", + pPnmiStruct->BusSpeed); + + seq_printf(seq, "Bus width (Bit) %d\n", + pPnmiStruct->BusWidth); + seq_printf(seq, "Driver version %s\n", + VER_STRING); + seq_printf(seq, "Hardware revision v%d.%d\n", + (pAC->GIni.GIPciHwRev >> 4) & 0x0F, + pAC->GIni.GIPciHwRev & 0x0F); + + /* Print sensor informations */ + for (i=0; i < pAC->I2c.MaxSens; i ++) { + /* Check type */ + switch (pAC->I2c.SenTable[i].SenType) { + case 1: + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (C)"); + seq_printf(seq, "%-25s %d.%02d\n", + sens_msg, + pAC->I2c.SenTable[i].SenValue / 10, + pAC->I2c.SenTable[i].SenValue % 10); + + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (F)"); + seq_printf(seq, "%-25s %d.%02d\n", + sens_msg, + ((((pAC->I2c.SenTable[i].SenValue) + *10)*9)/5 + 3200)/100, + ((((pAC->I2c.SenTable[i].SenValue) + *10)*9)/5 + 3200) % 10); + break; + case 2: + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (V)"); + seq_printf(seq, "%-25s %d.%03d\n", + sens_msg, + pAC->I2c.SenTable[i].SenValue / 1000, + pAC->I2c.SenTable[i].SenValue % 1000); + break; + case 3: + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (rpm)"); + seq_printf(seq, "%-25s %d\n", + sens_msg, + pAC->I2c.SenTable[i].SenValue); + break; + default: + break; + } + } + + /*Receive statistics */ + seq_printf(seq, "\nReceive statistics\n\n"); + + seq_printf(seq, "Received bytes %Lu\n", + (unsigned long long) pPnmiStat->StatRxOctetsOkCts); + seq_printf(seq, "Received packets %Lu\n", + (unsigned long long) pPnmiStat->StatRxOkCts); +#if 0 + if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC && + pAC->HWRevision < 12) { + pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - + pPnmiStat->StatRxShortsCts; + pPnmiStat->StatRxShortsCts = 0; + } +#endif + if (dev->mtu > 1500) + pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - + pPnmiStat->StatRxTooLongCts; + + seq_printf(seq, "Receive errors %Lu\n", + (unsigned long long) pPnmiStruct->InErrorsCts); + seq_printf(seq, "Receive dropped %Lu\n", + (unsigned long long) pPnmiStruct->RxNoBufCts); + seq_printf(seq, "Received multicast %Lu\n", + (unsigned long long) pPnmiStat->StatRxMulticastOkCts); + seq_printf(seq, "Receive error types\n"); + seq_printf(seq, " length %Lu\n", + (unsigned long long) pPnmiStat->StatRxRuntCts); + seq_printf(seq, " buffer overflow %Lu\n", + (unsigned long long) pPnmiStat->StatRxFifoOverflowCts); + seq_printf(seq, " bad crc %Lu\n", + (unsigned long long) pPnmiStat->StatRxFcsCts); + seq_printf(seq, " framing %Lu\n", + (unsigned long long) pPnmiStat->StatRxFramingCts); + seq_printf(seq, " missed frames %Lu\n", + (unsigned long long) pPnmiStat->StatRxMissedCts); + + if (dev->mtu > 1500) + pPnmiStat->StatRxTooLongCts = 0; + + seq_printf(seq, " too long %Lu\n", + (unsigned long long) pPnmiStat->StatRxTooLongCts); + seq_printf(seq, " carrier extension %Lu\n", + (unsigned long long) pPnmiStat->StatRxCextCts); + seq_printf(seq, " too short %Lu\n", + (unsigned long long) pPnmiStat->StatRxShortsCts); + seq_printf(seq, " symbol %Lu\n", + (unsigned long long) pPnmiStat->StatRxSymbolCts); + seq_printf(seq, " LLC MAC size %Lu\n", + (unsigned long long) pPnmiStat->StatRxIRLengthCts); + seq_printf(seq, " carrier event %Lu\n", + (unsigned long long) pPnmiStat->StatRxCarrierCts); + seq_printf(seq, " jabber %Lu\n", + (unsigned long long) pPnmiStat->StatRxJabberCts); + + + /*Transmit statistics */ + seq_printf(seq, "\nTransmit statistics\n\n"); + + seq_printf(seq, "Transmited bytes %Lu\n", + (unsigned long long) pPnmiStat->StatTxOctetsOkCts); + seq_printf(seq, "Transmited packets %Lu\n", + (unsigned long long) pPnmiStat->StatTxOkCts); + seq_printf(seq, "Transmit errors %Lu\n", + (unsigned long long) pPnmiStat->StatTxSingleCollisionCts); + seq_printf(seq, "Transmit dropped %Lu\n", + (unsigned long long) pPnmiStruct->TxNoBufCts); + seq_printf(seq, "Transmit collisions %Lu\n", + (unsigned long long) pPnmiStat->StatTxSingleCollisionCts); + seq_printf(seq, "Transmit error types\n"); + seq_printf(seq, " excessive collision %ld\n", + pAC->stats.tx_aborted_errors); + seq_printf(seq, " carrier %Lu\n", + (unsigned long long) pPnmiStat->StatTxCarrierCts); + seq_printf(seq, " fifo underrun %Lu\n", + (unsigned long long) pPnmiStat->StatTxFifoUnderrunCts); + seq_printf(seq, " heartbeat %Lu\n", + (unsigned long long) pPnmiStat->StatTxCarrierCts); + seq_printf(seq, " window %ld\n", + pAC->stats.tx_window_errors); + + } + } + return 0; +} + +/***************************************************************************** + * + * sk_proc_open - register the show function when proc is open'ed + * + * Description: + * This function is called whenever a sk98lin proc file is queried. + * + * Returns: the return value of single_open() + * + */ +static int sk_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, sk_seq_show, PDE(inode)->data); +} + +/******************************************************************************* + * + * End of file + * + ******************************************************************************/ diff --git a/trunk/drivers/net/skge.c b/trunk/drivers/net/skge.c index b538e3038058..596c93b12daa 100644 --- a/trunk/drivers/net/skge.c +++ b/trunk/drivers/net/skge.c @@ -25,7 +25,6 @@ */ #include -#include #include #include #include @@ -44,7 +43,7 @@ #include "skge.h" #define DRV_NAME "skge" -#define DRV_VERSION "1.3" +#define DRV_VERSION "1.2" #define PFX DRV_NAME " " #define DEFAULT_TX_RING_SIZE 128 @@ -89,14 +88,15 @@ MODULE_DEVICE_TABLE(pci, skge_id_table); static int skge_up(struct net_device *dev); static int skge_down(struct net_device *dev); -static void skge_phy_reset(struct skge_port *skge); static void skge_tx_clean(struct skge_port *skge); static int xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); static int gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); static void genesis_get_stats(struct skge_port *skge, u64 *data); static void yukon_get_stats(struct skge_port *skge, u64 *data); static void yukon_init(struct skge_hw *hw, int port); +static void yukon_reset(struct skge_hw *hw, int port); static void genesis_mac_init(struct skge_hw *hw, int port); +static void genesis_reset(struct skge_hw *hw, int port); static void genesis_link_up(struct skge_port *skge); /* Avoid conditionals by using array */ @@ -276,9 +276,10 @@ static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) skge->autoneg = ecmd->autoneg; skge->advertising = ecmd->advertising; - if (netif_running(dev)) - skge_phy_reset(skge); - + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } return (0); } @@ -398,7 +399,6 @@ static int skge_set_ring_param(struct net_device *dev, struct ethtool_ringparam *p) { struct skge_port *skge = netdev_priv(dev); - int err; if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE) @@ -409,9 +409,7 @@ static int skge_set_ring_param(struct net_device *dev, if (netif_running(dev)) { skge_down(dev); - err = skge_up(dev); - if (err) - dev_close(dev); + skge_up(dev); } return 0; @@ -432,11 +430,21 @@ static void skge_set_msglevel(struct net_device *netdev, u32 value) static int skge_nway_reset(struct net_device *dev) { struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; if (skge->autoneg != AUTONEG_ENABLE || !netif_running(dev)) return -EINVAL; - skge_phy_reset(skge); + spin_lock_bh(&hw->phy_lock); + if (hw->chip_id == CHIP_ID_GENESIS) { + genesis_reset(hw, port); + genesis_mac_init(hw, port); + } else { + yukon_reset(hw, port); + yukon_init(hw, port); + } + spin_unlock_bh(&hw->phy_lock); return 0; } @@ -508,8 +516,10 @@ static int skge_set_pauseparam(struct net_device *dev, else skge->flow_control = FLOW_MODE_NONE; - if (netif_running(dev)) - skge_phy_reset(skge); + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } return 0; } @@ -2009,25 +2019,6 @@ static void yukon_phy_intr(struct skge_port *skge) /* XXX restart autonegotiation? */ } -static void skge_phy_reset(struct skge_port *skge) -{ - struct skge_hw *hw = skge->hw; - int port = skge->port; - - netif_stop_queue(skge->netdev); - netif_carrier_off(skge->netdev); - - spin_lock_bh(&hw->phy_lock); - if (hw->chip_id == CHIP_ID_GENESIS) { - genesis_reset(hw, port); - genesis_mac_init(hw, port); - } else { - yukon_reset(hw, port); - yukon_init(hw, port); - } - spin_unlock_bh(&hw->phy_lock); -} - /* Basic MII support */ static int skge_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { @@ -2196,7 +2187,6 @@ static int skge_up(struct net_device *dev) kfree(skge->rx_ring.start); free_pci_mem: pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); - skge->mem = NULL; return err; } @@ -2207,9 +2197,6 @@ static int skge_down(struct net_device *dev) struct skge_hw *hw = skge->hw; int port = skge->port; - if (skge->mem == NULL) - return 0; - if (netif_msg_ifdown(skge)) printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); @@ -2266,7 +2253,6 @@ static int skge_down(struct net_device *dev) kfree(skge->rx_ring.start); kfree(skge->tx_ring.start); pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); - skge->mem = NULL; return 0; } @@ -2294,13 +2280,11 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) } if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) { - if (!netif_queue_stopped(dev)) { - netif_stop_queue(dev); - - printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", - dev->name); - } + netif_stop_queue(dev); spin_unlock_irqrestore(&skge->tx_lock, flags); + + printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", + dev->name); return NETDEV_TX_BUSY; } @@ -2316,12 +2300,14 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) td->dma_hi = map >> 32; if (skb->ip_summed == CHECKSUM_HW) { + const struct iphdr *ip + = (const struct iphdr *) (skb->data + ETH_HLEN); int offset = skb->h.raw - skb->data; /* This seems backwards, but it is what the sk98lin * does. Looks like hardware is wrong? */ - if (skb->h.ipiph->protocol == IPPROTO_UDP + if (ip->protocol == IPPROTO_UDP && hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON) control = BMU_TCP_CHECK; else @@ -2427,23 +2413,18 @@ static void skge_tx_timeout(struct net_device *dev) static int skge_change_mtu(struct net_device *dev, int new_mtu) { - int err; + int err = 0; + int running = netif_running(dev); if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) return -EINVAL; - if (!netif_running(dev)) { - dev->mtu = new_mtu; - return 0; - } - - skge_down(dev); + if (running) + skge_down(dev); dev->mtu = new_mtu; - - err = skge_up(dev); - if (err) - dev_close(dev); + if (running) + skge_up(dev); return err; } @@ -3417,8 +3398,8 @@ static int skge_resume(struct pci_dev *pdev) struct net_device *dev = hw->dev[i]; if (dev) { netif_device_attach(dev); - if (netif_running(dev) && skge_up(dev)) - dev_close(dev); + if (netif_running(dev)) + skge_up(dev); } } return 0; diff --git a/trunk/drivers/net/skge.h b/trunk/drivers/net/skge.h index 2efdacc290e5..ee123c15f545 100644 --- a/trunk/drivers/net/skge.h +++ b/trunk/drivers/net/skge.h @@ -475,6 +475,18 @@ enum { Q_T2 = 0x40, /* 32 bit Test Register 2 */ Q_T3 = 0x44, /* 32 bit Test Register 3 */ +/* Yukon-2 */ + Q_DONE = 0x24, /* 16 bit Done Index (Yukon-2 only) */ + Q_WM = 0x40, /* 16 bit FIFO Watermark */ + Q_AL = 0x42, /* 8 bit FIFO Alignment */ + Q_RSP = 0x44, /* 16 bit FIFO Read Shadow Pointer */ + Q_RSL = 0x46, /* 8 bit FIFO Read Shadow Level */ + Q_RP = 0x48, /* 8 bit FIFO Read Pointer */ + Q_RL = 0x4a, /* 8 bit FIFO Read Level */ + Q_WP = 0x4c, /* 8 bit FIFO Write Pointer */ + Q_WSP = 0x4d, /* 8 bit FIFO Write Shadow Pointer */ + Q_WL = 0x4e, /* 8 bit FIFO Write Level */ + Q_WSL = 0x4f, /* 8 bit FIFO Write Shadow Level */ }; #define Q_ADDR(reg, offs) (B8_Q_REGS + (reg) + (offs)) @@ -663,16 +675,22 @@ enum { LED_OFF = 1<<0, /* switch LED off */ }; -/* Receive GMAC FIFO (YUKON) */ +/* Receive GMAC FIFO (YUKON and Yukon-2) */ enum { RX_GMF_EA = 0x0c40,/* 32 bit Rx GMAC FIFO End Address */ RX_GMF_AF_THR = 0x0c44,/* 32 bit Rx GMAC FIFO Almost Full Thresh. */ RX_GMF_CTRL_T = 0x0c48,/* 32 bit Rx GMAC FIFO Control/Test */ RX_GMF_FL_MSK = 0x0c4c,/* 32 bit Rx GMAC FIFO Flush Mask */ RX_GMF_FL_THR = 0x0c50,/* 32 bit Rx GMAC FIFO Flush Threshold */ + RX_GMF_TR_THR = 0x0c54,/* 32 bit Rx Truncation Threshold (Yukon-2) */ + + RX_GMF_VLAN = 0x0c5c,/* 32 bit Rx VLAN Type Register (Yukon-2) */ RX_GMF_WP = 0x0c60,/* 32 bit Rx GMAC FIFO Write Pointer */ + RX_GMF_WLEV = 0x0c68,/* 32 bit Rx GMAC FIFO Write Level */ + RX_GMF_RP = 0x0c70,/* 32 bit Rx GMAC FIFO Read Pointer */ + RX_GMF_RLEV = 0x0c78,/* 32 bit Rx GMAC FIFO Read Level */ }; @@ -837,6 +855,48 @@ enum { GMAC_TI_ST_TST = 0x0e1a,/* 8 bit Time Stamp Timer Test Reg */ }; +/* Status BMU Registers (Yukon-2 only)*/ +enum { + STAT_CTRL = 0x0e80,/* 32 bit Status BMU Control Reg */ + STAT_LAST_IDX = 0x0e84,/* 16 bit Status BMU Last Index */ + /* 0x0e85 - 0x0e86: reserved */ + STAT_LIST_ADDR_LO = 0x0e88,/* 32 bit Status List Start Addr (low) */ + STAT_LIST_ADDR_HI = 0x0e8c,/* 32 bit Status List Start Addr (high) */ + STAT_TXA1_RIDX = 0x0e90,/* 16 bit Status TxA1 Report Index Reg */ + STAT_TXS1_RIDX = 0x0e92,/* 16 bit Status TxS1 Report Index Reg */ + STAT_TXA2_RIDX = 0x0e94,/* 16 bit Status TxA2 Report Index Reg */ + STAT_TXS2_RIDX = 0x0e96,/* 16 bit Status TxS2 Report Index Reg */ + STAT_TX_IDX_TH = 0x0e98,/* 16 bit Status Tx Index Threshold Reg */ + STAT_PUT_IDX = 0x0e9c,/* 16 bit Status Put Index Reg */ + +/* FIFO Control/Status Registers (Yukon-2 only)*/ + STAT_FIFO_WP = 0x0ea0,/* 8 bit Status FIFO Write Pointer Reg */ + STAT_FIFO_RP = 0x0ea4,/* 8 bit Status FIFO Read Pointer Reg */ + STAT_FIFO_RSP = 0x0ea6,/* 8 bit Status FIFO Read Shadow Ptr */ + STAT_FIFO_LEVEL = 0x0ea8,/* 8 bit Status FIFO Level Reg */ + STAT_FIFO_SHLVL = 0x0eaa,/* 8 bit Status FIFO Shadow Level Reg */ + STAT_FIFO_WM = 0x0eac,/* 8 bit Status FIFO Watermark Reg */ + STAT_FIFO_ISR_WM = 0x0ead,/* 8 bit Status FIFO ISR Watermark Reg */ + +/* Level and ISR Timer Registers (Yukon-2 only)*/ + STAT_LEV_TIMER_INI = 0x0eb0,/* 32 bit Level Timer Init. Value Reg */ + STAT_LEV_TIMER_CNT = 0x0eb4,/* 32 bit Level Timer Counter Reg */ + STAT_LEV_TIMER_CTRL = 0x0eb8,/* 8 bit Level Timer Control Reg */ + STAT_LEV_TIMER_TEST = 0x0eb9,/* 8 bit Level Timer Test Reg */ + STAT_TX_TIMER_INI = 0x0ec0,/* 32 bit Tx Timer Init. Value Reg */ + STAT_TX_TIMER_CNT = 0x0ec4,/* 32 bit Tx Timer Counter Reg */ + STAT_TX_TIMER_CTRL = 0x0ec8,/* 8 bit Tx Timer Control Reg */ + STAT_TX_TIMER_TEST = 0x0ec9,/* 8 bit Tx Timer Test Reg */ + STAT_ISR_TIMER_INI = 0x0ed0,/* 32 bit ISR Timer Init. Value Reg */ + STAT_ISR_TIMER_CNT = 0x0ed4,/* 32 bit ISR Timer Counter Reg */ + STAT_ISR_TIMER_CTRL = 0x0ed8,/* 8 bit ISR Timer Control Reg */ + STAT_ISR_TIMER_TEST = 0x0ed9,/* 8 bit ISR Timer Test Reg */ + + ST_LAST_IDX_MASK = 0x007f,/* Last Index Mask */ + ST_TXRP_IDX_MASK = 0x0fff,/* Tx Report Index Mask */ + ST_TXTH_IDX_MASK = 0x0fff,/* Tx Threshold Index Mask */ + ST_WM_IDX_MASK = 0x3f,/* FIFO Watermark Index Mask */ +}; enum { LINKLED_OFF = 0x01, @@ -863,6 +923,8 @@ enum { WOL_MATCH_CTL = 0x0f22,/* 8 bit WOL Match Control Reg */ WOL_MATCH_RES = 0x0f23,/* 8 bit WOL Match Result Reg */ WOL_MAC_ADDR = 0x0f24,/* 32 bit WOL MAC Address */ + WOL_PATT_PME = 0x0f2a,/* 8 bit WOL PME Match Enable (Yukon-2) */ + WOL_PATT_ASFM = 0x0f2b,/* 8 bit WOL ASF Match Enable (Yukon-2) */ WOL_PATT_RPTR = 0x0f2c,/* 8 bit WOL Pattern Read Pointer */ /* WOL Pattern Length Registers (YUKON only) */ @@ -1579,6 +1641,15 @@ enum { PHY_M_FESC_SEL_CL_A = 1<<0, /* Select Class A driver (100B-TX) */ }; +/* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */ +/***** PHY_MARV_PHY_CTRL (page 2) 16 bit r/w MAC Specific Ctrl *****/ +enum { + PHY_M_MAC_MD_MSK = 7<<7, /* Bit 9.. 7: Mode Select Mask */ + PHY_M_MAC_MD_AUTO = 3,/* Auto Copper/1000Base-X */ + PHY_M_MAC_MD_COPPER = 5,/* Copper only */ + PHY_M_MAC_MD_1000BX = 7,/* 1000Base-X only */ +}; +#define PHY_M_MAC_MODE_SEL(x) (((x)<<7) & PHY_M_MAC_MD_MSK) /***** PHY_MARV_PHY_CTRL (page 3) 16 bit r/w LED Control Reg. *****/ enum { diff --git a/trunk/drivers/net/sky2.c b/trunk/drivers/net/sky2.c deleted file mode 100644 index f5d697c0c031..000000000000 --- a/trunk/drivers/net/sky2.c +++ /dev/null @@ -1,3262 +0,0 @@ -/* - * New driver for Marvell Yukon 2 chipset. - * Based on earlier sk98lin, and skge driver. - * - * This driver intentionally does not support all the features - * of the original driver such as link fail-over and link management because - * those should be done at higher levels. - * - * Copyright (C) 2005 Stephen Hemminger - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * TOTEST - * - speed setting - * - suspend/resume - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) -#define SKY2_VLAN_TAG_USED 1 -#endif - -#include "sky2.h" - -#define DRV_NAME "sky2" -#define DRV_VERSION "0.11" -#define PFX DRV_NAME " " - -/* - * The Yukon II chipset takes 64 bit command blocks (called list elements) - * that are organized into three (receive, transmit, status) different rings - * similar to Tigon3. A transmit can require several elements; - * a receive requires one (or two if using 64 bit dma). - */ - -#define is_ec_a1(hw) \ - unlikely((hw)->chip_id == CHIP_ID_YUKON_EC && \ - (hw)->chip_rev == CHIP_REV_YU_EC_A1) - -#define RX_LE_SIZE 512 -#define RX_LE_BYTES (RX_LE_SIZE*sizeof(struct sky2_rx_le)) -#define RX_MAX_PENDING (RX_LE_SIZE/2 - 2) -#define RX_DEF_PENDING RX_MAX_PENDING - -#define TX_RING_SIZE 512 -#define TX_DEF_PENDING (TX_RING_SIZE - 1) -#define TX_MIN_PENDING 64 -#define MAX_SKB_TX_LE (4 + 2*MAX_SKB_FRAGS) - -#define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */ -#define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) -#define ETH_JUMBO_MTU 9000 -#define TX_WATCHDOG (5 * HZ) -#define NAPI_WEIGHT 64 -#define PHY_RETRIES 1000 - -static const u32 default_msg = - NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK - | NETIF_MSG_TIMER | NETIF_MSG_TX_ERR | NETIF_MSG_RX_ERR - | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN | NETIF_MSG_INTR; - -static int debug = -1; /* defaults above */ -module_param(debug, int, 0); -MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); - -static int copybreak __read_mostly = 256; -module_param(copybreak, int, 0); -MODULE_PARM_DESC(copybreak, "Receive copy threshold"); - -static const struct pci_device_id sky2_id_table[] = { - { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, - { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, - { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) }, - { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4343) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4344) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4345) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4346) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4347) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4350) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4351) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4362) }, - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4363) }, - { 0 } -}; - -MODULE_DEVICE_TABLE(pci, sky2_id_table); - -/* Avoid conditionals by using array */ -static const unsigned txqaddr[] = { Q_XA1, Q_XA2 }; -static const unsigned rxqaddr[] = { Q_R1, Q_R2 }; - -/* This driver supports yukon2 chipset only */ -static const char *yukon2_name[] = { - "XL", /* 0xb3 */ - "EC Ultra", /* 0xb4 */ - "UNKNOWN", /* 0xb5 */ - "EC", /* 0xb6 */ - "FE", /* 0xb7 */ -}; - -/* Access to external PHY */ -static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) -{ - int i; - - gma_write16(hw, port, GM_SMI_DATA, val); - gma_write16(hw, port, GM_SMI_CTRL, - GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg)); - - for (i = 0; i < PHY_RETRIES; i++) { - if (!(gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY)) - return 0; - udelay(1); - } - - printk(KERN_WARNING PFX "%s: phy write timeout\n", hw->dev[port]->name); - return -ETIMEDOUT; -} - -static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) -{ - int i; - - gma_write16(hw, port, GM_SMI_CTRL, GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) - | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); - - for (i = 0; i < PHY_RETRIES; i++) { - if (gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) { - *val = gma_read16(hw, port, GM_SMI_DATA); - return 0; - } - - udelay(1); - } - - return -ETIMEDOUT; -} - -static u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg) -{ - u16 v; - - if (__gm_phy_read(hw, port, reg, &v) != 0) - printk(KERN_WARNING PFX "%s: phy read timeout\n", hw->dev[port]->name); - return v; -} - -static int sky2_set_power_state(struct sky2_hw *hw, pci_power_t state) -{ - u16 power_control; - u32 reg1; - int vaux; - int ret = 0; - - pr_debug("sky2_set_power_state %d\n", state); - sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); - - pci_read_config_word(hw->pdev, hw->pm_cap + PCI_PM_PMC, &power_control); - vaux = (sky2_read8(hw, B0_CTST) & Y2_VAUX_AVAIL) && - (power_control & PCI_PM_CAP_PME_D3cold); - - pci_read_config_word(hw->pdev, hw->pm_cap + PCI_PM_CTRL, &power_control); - - power_control |= PCI_PM_CTRL_PME_STATUS; - power_control &= ~(PCI_PM_CTRL_STATE_MASK); - - switch (state) { - case PCI_D0: - /* switch power to VCC (WA for VAUX problem) */ - sky2_write8(hw, B0_POWER_CTRL, - PC_VAUX_ENA | PC_VCC_ENA | PC_VAUX_OFF | PC_VCC_ON); - - /* disable Core Clock Division, */ - sky2_write32(hw, B2_Y2_CLK_CTRL, Y2_CLK_DIV_DIS); - - if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1) - /* enable bits are inverted */ - sky2_write8(hw, B2_Y2_CLK_GATE, - Y2_PCI_CLK_LNK1_DIS | Y2_COR_CLK_LNK1_DIS | - Y2_CLK_GAT_LNK1_DIS | Y2_PCI_CLK_LNK2_DIS | - Y2_COR_CLK_LNK2_DIS | Y2_CLK_GAT_LNK2_DIS); - else - sky2_write8(hw, B2_Y2_CLK_GATE, 0); - - /* Turn off phy power saving */ - pci_read_config_dword(hw->pdev, PCI_DEV_REG1, ®1); - reg1 &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); - - /* looks like this XL is back asswards .. */ - if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1) { - reg1 |= PCI_Y2_PHY1_COMA; - if (hw->ports > 1) - reg1 |= PCI_Y2_PHY2_COMA; - } - pci_write_config_dword(hw->pdev, PCI_DEV_REG1, reg1); - break; - - case PCI_D3hot: - case PCI_D3cold: - /* Turn on phy power saving */ - pci_read_config_dword(hw->pdev, PCI_DEV_REG1, ®1); - if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1) - reg1 &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); - else - reg1 |= (PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); - pci_write_config_dword(hw->pdev, PCI_DEV_REG1, reg1); - - if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1) - sky2_write8(hw, B2_Y2_CLK_GATE, 0); - else - /* enable bits are inverted */ - sky2_write8(hw, B2_Y2_CLK_GATE, - Y2_PCI_CLK_LNK1_DIS | Y2_COR_CLK_LNK1_DIS | - Y2_CLK_GAT_LNK1_DIS | Y2_PCI_CLK_LNK2_DIS | - Y2_COR_CLK_LNK2_DIS | Y2_CLK_GAT_LNK2_DIS); - - /* switch power to VAUX */ - if (vaux && state != PCI_D3cold) - sky2_write8(hw, B0_POWER_CTRL, - (PC_VAUX_ENA | PC_VCC_ENA | - PC_VAUX_ON | PC_VCC_OFF)); - break; - default: - printk(KERN_ERR PFX "Unknown power state %d\n", state); - ret = -1; - } - - pci_write_config_byte(hw->pdev, hw->pm_cap + PCI_PM_CTRL, power_control); - sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); - return ret; -} - -static void sky2_phy_reset(struct sky2_hw *hw, unsigned port) -{ - u16 reg; - - /* disable all GMAC IRQ's */ - sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0); - /* disable PHY IRQs */ - gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); - - gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ - gma_write16(hw, port, GM_MC_ADDR_H2, 0); - gma_write16(hw, port, GM_MC_ADDR_H3, 0); - gma_write16(hw, port, GM_MC_ADDR_H4, 0); - - reg = gma_read16(hw, port, GM_RX_CTRL); - reg |= GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA; - gma_write16(hw, port, GM_RX_CTRL, reg); -} - -static void sky2_phy_init(struct sky2_hw *hw, unsigned port) -{ - struct sky2_port *sky2 = netdev_priv(hw->dev[port]); - u16 ctrl, ct1000, adv, pg, ledctrl, ledover; - - if (sky2->autoneg == AUTONEG_ENABLE && hw->chip_id != CHIP_ID_YUKON_XL) { - u16 ectrl = gm_phy_read(hw, port, PHY_MARV_EXT_CTRL); - - ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK | - PHY_M_EC_MAC_S_MSK); - ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ); - - if (hw->chip_id == CHIP_ID_YUKON_EC) - ectrl |= PHY_M_EC_DSC_2(2) | PHY_M_EC_DOWN_S_ENA; - else - ectrl |= PHY_M_EC_M_DSC(2) | PHY_M_EC_S_DSC(3); - - gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl); - } - - ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL); - if (hw->copper) { - if (hw->chip_id == CHIP_ID_YUKON_FE) { - /* enable automatic crossover */ - ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO) >> 1; - } else { - /* disable energy detect */ - ctrl &= ~PHY_M_PC_EN_DET_MSK; - - /* enable automatic crossover */ - ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO); - - if (sky2->autoneg == AUTONEG_ENABLE && - hw->chip_id == CHIP_ID_YUKON_XL) { - ctrl &= ~PHY_M_PC_DSC_MSK; - ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA; - } - } - gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ctrl); - } else { - /* workaround for deviation #4.88 (CRC errors) */ - /* disable Automatic Crossover */ - - ctrl &= ~PHY_M_PC_MDIX_MSK; - gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ctrl); - - if (hw->chip_id == CHIP_ID_YUKON_XL) { - /* Fiber: select 1000BASE-X only mode MAC Specific Ctrl Reg. */ - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 2); - ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL); - ctrl &= ~PHY_M_MAC_MD_MSK; - ctrl |= PHY_M_MAC_MODE_SEL(PHY_M_MAC_MD_1000BX); - gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ctrl); - - /* select page 1 to access Fiber registers */ - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 1); - } - } - - ctrl = gm_phy_read(hw, port, PHY_MARV_CTRL); - if (sky2->autoneg == AUTONEG_DISABLE) - ctrl &= ~PHY_CT_ANE; - else - ctrl |= PHY_CT_ANE; - - ctrl |= PHY_CT_RESET; - gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); - - ctrl = 0; - ct1000 = 0; - adv = PHY_AN_CSMA; - - if (sky2->autoneg == AUTONEG_ENABLE) { - if (hw->copper) { - if (sky2->advertising & ADVERTISED_1000baseT_Full) - ct1000 |= PHY_M_1000C_AFD; - if (sky2->advertising & ADVERTISED_1000baseT_Half) - ct1000 |= PHY_M_1000C_AHD; - if (sky2->advertising & ADVERTISED_100baseT_Full) - adv |= PHY_M_AN_100_FD; - if (sky2->advertising & ADVERTISED_100baseT_Half) - adv |= PHY_M_AN_100_HD; - if (sky2->advertising & ADVERTISED_10baseT_Full) - adv |= PHY_M_AN_10_FD; - if (sky2->advertising & ADVERTISED_10baseT_Half) - adv |= PHY_M_AN_10_HD; - } else /* special defines for FIBER (88E1011S only) */ - adv |= PHY_M_AN_1000X_AHD | PHY_M_AN_1000X_AFD; - - /* Set Flow-control capabilities */ - if (sky2->tx_pause && sky2->rx_pause) - adv |= PHY_AN_PAUSE_CAP; /* symmetric */ - else if (sky2->rx_pause && !sky2->tx_pause) - adv |= PHY_AN_PAUSE_ASYM | PHY_AN_PAUSE_CAP; - else if (!sky2->rx_pause && sky2->tx_pause) - adv |= PHY_AN_PAUSE_ASYM; /* local */ - - /* Restart Auto-negotiation */ - ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG; - } else { - /* forced speed/duplex settings */ - ct1000 = PHY_M_1000C_MSE; - - if (sky2->duplex == DUPLEX_FULL) - ctrl |= PHY_CT_DUP_MD; - - switch (sky2->speed) { - case SPEED_1000: - ctrl |= PHY_CT_SP1000; - break; - case SPEED_100: - ctrl |= PHY_CT_SP100; - break; - } - - ctrl |= PHY_CT_RESET; - } - - if (hw->chip_id != CHIP_ID_YUKON_FE) - gm_phy_write(hw, port, PHY_MARV_1000T_CTRL, ct1000); - - gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, adv); - gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); - - /* Setup Phy LED's */ - ledctrl = PHY_M_LED_PULS_DUR(PULS_170MS); - ledover = 0; - - switch (hw->chip_id) { - case CHIP_ID_YUKON_FE: - /* on 88E3082 these bits are at 11..9 (shifted left) */ - ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) << 1; - - ctrl = gm_phy_read(hw, port, PHY_MARV_FE_LED_PAR); - - /* delete ACT LED control bits */ - ctrl &= ~PHY_M_FELP_LED1_MSK; - /* change ACT LED control to blink mode */ - ctrl |= PHY_M_FELP_LED1_CTRL(LED_PAR_CTRL_ACT_BL); - gm_phy_write(hw, port, PHY_MARV_FE_LED_PAR, ctrl); - break; - - case CHIP_ID_YUKON_XL: - pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); - - /* select page 3 to access LED control register */ - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); - - /* set LED Function Control register */ - gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, (PHY_M_LEDC_LOS_CTRL(1) | /* LINK/ACT */ - PHY_M_LEDC_INIT_CTRL(7) | /* 10 Mbps */ - PHY_M_LEDC_STA1_CTRL(7) | /* 100 Mbps */ - PHY_M_LEDC_STA0_CTRL(7))); /* 1000 Mbps */ - - /* set Polarity Control register */ - gm_phy_write(hw, port, PHY_MARV_PHY_STAT, - (PHY_M_POLC_LS1_P_MIX(4) | - PHY_M_POLC_IS0_P_MIX(4) | - PHY_M_POLC_LOS_CTRL(2) | - PHY_M_POLC_INIT_CTRL(2) | - PHY_M_POLC_STA1_CTRL(2) | - PHY_M_POLC_STA0_CTRL(2))); - - /* restore page register */ - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); - break; - - default: - /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */ - ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL; - /* turn off the Rx LED (LED_RX) */ - ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); - } - - gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); - - if (sky2->autoneg == AUTONEG_DISABLE || sky2->speed == SPEED_100) { - /* turn on 100 Mbps LED (LED_LINK100) */ - ledover |= PHY_M_LED_MO_100(MO_LED_ON); - } - - if (ledover) - gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); - - /* Enable phy interrupt on auto-negotiation complete (or link up) */ - if (sky2->autoneg == AUTONEG_ENABLE) - gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL); - else - gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); -} - -/* Force a renegotiation */ -static void sky2_phy_reinit(struct sky2_port *sky2) -{ - down(&sky2->phy_sema); - sky2_phy_init(sky2->hw, sky2->port); - up(&sky2->phy_sema); -} - -static void sky2_mac_init(struct sky2_hw *hw, unsigned port) -{ - struct sky2_port *sky2 = netdev_priv(hw->dev[port]); - u16 reg; - int i; - const u8 *addr = hw->dev[port]->dev_addr; - - sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); - sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR|GPC_ENA_PAUSE); - - sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR); - - if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev == 0 && port == 1) { - /* WA DEV_472 -- looks like crossed wires on port 2 */ - /* clear GMAC 1 Control reset */ - sky2_write8(hw, SK_REG(0, GMAC_CTRL), GMC_RST_CLR); - do { - sky2_write8(hw, SK_REG(1, GMAC_CTRL), GMC_RST_SET); - sky2_write8(hw, SK_REG(1, GMAC_CTRL), GMC_RST_CLR); - } while (gm_phy_read(hw, 1, PHY_MARV_ID0) != PHY_MARV_ID0_VAL || - gm_phy_read(hw, 1, PHY_MARV_ID1) != PHY_MARV_ID1_Y2 || - gm_phy_read(hw, 1, PHY_MARV_INT_MASK) != 0); - } - - if (sky2->autoneg == AUTONEG_DISABLE) { - reg = gma_read16(hw, port, GM_GP_CTRL); - reg |= GM_GPCR_AU_ALL_DIS; - gma_write16(hw, port, GM_GP_CTRL, reg); - gma_read16(hw, port, GM_GP_CTRL); - - switch (sky2->speed) { - case SPEED_1000: - reg |= GM_GPCR_SPEED_1000; - /* fallthru */ - case SPEED_100: - reg |= GM_GPCR_SPEED_100; - } - - if (sky2->duplex == DUPLEX_FULL) - reg |= GM_GPCR_DUP_FULL; - } else - reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL; - - if (!sky2->tx_pause && !sky2->rx_pause) { - sky2_write32(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); - reg |= - GM_GPCR_FC_TX_DIS | GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; - } else if (sky2->tx_pause && !sky2->rx_pause) { - /* disable Rx flow-control */ - reg |= GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; - } - - gma_write16(hw, port, GM_GP_CTRL, reg); - - sky2_read16(hw, SK_REG(port, GMAC_IRQ_SRC)); - - down(&sky2->phy_sema); - sky2_phy_init(hw, port); - up(&sky2->phy_sema); - - /* MIB clear */ - reg = gma_read16(hw, port, GM_PHY_ADDR); - gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR); - - for (i = 0; i < GM_MIB_CNT_SIZE; i++) - gma_read16(hw, port, GM_MIB_CNT_BASE + 8 * i); - gma_write16(hw, port, GM_PHY_ADDR, reg); - - /* transmit control */ - gma_write16(hw, port, GM_TX_CTRL, TX_COL_THR(TX_COL_DEF)); - - /* receive control reg: unicast + multicast + no FCS */ - gma_write16(hw, port, GM_RX_CTRL, - GM_RXCR_UCF_ENA | GM_RXCR_CRC_DIS | GM_RXCR_MCF_ENA); - - /* transmit flow control */ - gma_write16(hw, port, GM_TX_FLOW_CTRL, 0xffff); - - /* transmit parameter */ - gma_write16(hw, port, GM_TX_PARAM, - TX_JAM_LEN_VAL(TX_JAM_LEN_DEF) | - TX_JAM_IPG_VAL(TX_JAM_IPG_DEF) | - TX_IPG_JAM_DATA(TX_IPG_JAM_DEF) | - TX_BACK_OFF_LIM(TX_BOF_LIM_DEF)); - - /* serial mode register */ - reg = DATA_BLIND_VAL(DATA_BLIND_DEF) | - GM_SMOD_VLAN_ENA | IPG_DATA_VAL(IPG_DATA_DEF); - - if (hw->dev[port]->mtu > ETH_DATA_LEN) - reg |= GM_SMOD_JUMBO_ENA; - - gma_write16(hw, port, GM_SERIAL_MODE, reg); - - /* virtual address for data */ - gma_set_addr(hw, port, GM_SRC_ADDR_2L, addr); - - /* physical address: used for pause frames */ - gma_set_addr(hw, port, GM_SRC_ADDR_1L, addr); - - /* ignore counter overflows */ - gma_write16(hw, port, GM_TX_IRQ_MSK, 0); - gma_write16(hw, port, GM_RX_IRQ_MSK, 0); - gma_write16(hw, port, GM_TR_IRQ_MSK, 0); - - /* Configure Rx MAC FIFO */ - sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); - sky2_write16(hw, SK_REG(port, RX_GMF_CTRL_T), - GMF_RX_CTRL_DEF); - - /* Flush Rx MAC FIFO on any flow control or error */ - sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR); - - /* Set threshold to 0xa (64 bytes) - * ASF disabled so no need to do WA dev #4.30 - */ - sky2_write16(hw, SK_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF); - - /* Configure Tx MAC FIFO */ - sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); - sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); - - if (hw->chip_id == CHIP_ID_YUKON_EC_U) { - sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8); - sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8); - if (hw->dev[port]->mtu > ETH_DATA_LEN) { - /* set Tx GMAC FIFO Almost Empty Threshold */ - sky2_write32(hw, SK_REG(port, TX_GMF_AE_THR), 0x180); - /* Disable Store & Forward mode for TX */ - sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_DIS); - } - } - -} - -static void sky2_ramset(struct sky2_hw *hw, u16 q, u32 start, size_t len) -{ - u32 end; - - start /= 8; - len /= 8; - end = start + len - 1; - - sky2_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR); - sky2_write32(hw, RB_ADDR(q, RB_START), start); - sky2_write32(hw, RB_ADDR(q, RB_END), end); - sky2_write32(hw, RB_ADDR(q, RB_WP), start); - sky2_write32(hw, RB_ADDR(q, RB_RP), start); - - if (q == Q_R1 || q == Q_R2) { - u32 rxup, rxlo; - - rxlo = len/2; - rxup = rxlo + len/4; - - /* Set thresholds on receive queue's */ - sky2_write32(hw, RB_ADDR(q, RB_RX_UTPP), rxup); - sky2_write32(hw, RB_ADDR(q, RB_RX_LTPP), rxlo); - } else { - /* Enable store & forward on Tx queue's because - * Tx FIFO is only 1K on Yukon - */ - sky2_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_STFWD); - } - - sky2_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_OP_MD); - sky2_read8(hw, RB_ADDR(q, RB_CTRL)); -} - -/* Setup Bus Memory Interface */ -static void sky2_qset(struct sky2_hw *hw, u16 q) -{ - sky2_write32(hw, Q_ADDR(q, Q_CSR), BMU_CLR_RESET); - sky2_write32(hw, Q_ADDR(q, Q_CSR), BMU_OPER_INIT); - sky2_write32(hw, Q_ADDR(q, Q_CSR), BMU_FIFO_OP_ON); - sky2_write32(hw, Q_ADDR(q, Q_WM), BMU_WM_DEFAULT); -} - -/* Setup prefetch unit registers. This is the interface between - * hardware and driver list elements - */ -static void sky2_prefetch_init(struct sky2_hw *hw, u32 qaddr, - u64 addr, u32 last) -{ - sky2_write32(hw, Y2_QADDR(qaddr, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); - sky2_write32(hw, Y2_QADDR(qaddr, PREF_UNIT_CTRL), PREF_UNIT_RST_CLR); - sky2_write32(hw, Y2_QADDR(qaddr, PREF_UNIT_ADDR_HI), addr >> 32); - sky2_write32(hw, Y2_QADDR(qaddr, PREF_UNIT_ADDR_LO), (u32) addr); - sky2_write16(hw, Y2_QADDR(qaddr, PREF_UNIT_LAST_IDX), last); - sky2_write32(hw, Y2_QADDR(qaddr, PREF_UNIT_CTRL), PREF_UNIT_OP_ON); - - sky2_read32(hw, Y2_QADDR(qaddr, PREF_UNIT_CTRL)); -} - -static inline struct sky2_tx_le *get_tx_le(struct sky2_port *sky2) -{ - struct sky2_tx_le *le = sky2->tx_le + sky2->tx_prod; - - sky2->tx_prod = (sky2->tx_prod + 1) % TX_RING_SIZE; - return le; -} - -/* - * This is a workaround code taken from SysKonnect sk98lin driver - * to deal with chip bug on Yukon EC rev 0 in the wraparound case. - */ -static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q, - u16 idx, u16 *last, u16 size) -{ - if (is_ec_a1(hw) && idx < *last) { - u16 hwget = sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_GET_IDX)); - - if (hwget == 0) { - /* Start prefetching again */ - sky2_write8(hw, Y2_QADDR(q, PREF_UNIT_FIFO_WM), 0xe0); - goto setnew; - } - - if (hwget == size - 1) { - /* set watermark to one list element */ - sky2_write8(hw, Y2_QADDR(q, PREF_UNIT_FIFO_WM), 8); - - /* set put index to first list element */ - sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), 0); - } else /* have hardware go to end of list */ - sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), - size - 1); - } else { -setnew: - sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), idx); - } - *last = idx; -} - - -static inline struct sky2_rx_le *sky2_next_rx(struct sky2_port *sky2) -{ - struct sky2_rx_le *le = sky2->rx_le + sky2->rx_put; - sky2->rx_put = (sky2->rx_put + 1) % RX_LE_SIZE; - return le; -} - -/* Return high part of DMA address (could be 32 or 64 bit) */ -static inline u32 high32(dma_addr_t a) -{ - return (a >> 16) >> 16; -} - -/* Build description to hardware about buffer */ -static inline void sky2_rx_add(struct sky2_port *sky2, dma_addr_t map) -{ - struct sky2_rx_le *le; - u32 hi = high32(map); - u16 len = sky2->rx_bufsize; - - if (sky2->rx_addr64 != hi) { - le = sky2_next_rx(sky2); - le->addr = cpu_to_le32(hi); - le->ctrl = 0; - le->opcode = OP_ADDR64 | HW_OWNER; - sky2->rx_addr64 = high32(map + len); - } - - le = sky2_next_rx(sky2); - le->addr = cpu_to_le32((u32) map); - le->length = cpu_to_le16(len); - le->ctrl = 0; - le->opcode = OP_PACKET | HW_OWNER; -} - - -/* Tell chip where to start receive checksum. - * Actually has two checksums, but set both same to avoid possible byte - * order problems. - */ -static void rx_set_checksum(struct sky2_port *sky2) -{ - struct sky2_rx_le *le; - - le = sky2_next_rx(sky2); - le->addr = (ETH_HLEN << 16) | ETH_HLEN; - le->ctrl = 0; - le->opcode = OP_TCPSTART | HW_OWNER; - - sky2_write32(sky2->hw, - Q_ADDR(rxqaddr[sky2->port], Q_CSR), - sky2->rx_csum ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM); - -} - -/* - * The RX Stop command will not work for Yukon-2 if the BMU does not - * reach the end of packet and since we can't make sure that we have - * incoming data, we must reset the BMU while it is not doing a DMA - * transfer. Since it is possible that the RX path is still active, - * the RX RAM buffer will be stopped first, so any possible incoming - * data will not trigger a DMA. After the RAM buffer is stopped, the - * BMU is polled until any DMA in progress is ended and only then it - * will be reset. - */ -static void sky2_rx_stop(struct sky2_port *sky2) -{ - struct sky2_hw *hw = sky2->hw; - unsigned rxq = rxqaddr[sky2->port]; - int i; - - /* disable the RAM Buffer receive queue */ - sky2_write8(hw, RB_ADDR(rxq, RB_CTRL), RB_DIS_OP_MD); - - for (i = 0; i < 0xffff; i++) - if (sky2_read8(hw, RB_ADDR(rxq, Q_RSL)) - == sky2_read8(hw, RB_ADDR(rxq, Q_RL))) - goto stopped; - - printk(KERN_WARNING PFX "%s: receiver stop failed\n", - sky2->netdev->name); -stopped: - sky2_write32(hw, Q_ADDR(rxq, Q_CSR), BMU_RST_SET | BMU_FIFO_RST); - - /* reset the Rx prefetch unit */ - sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); -} - -/* Clean out receive buffer area, assumes receiver hardware stopped */ -static void sky2_rx_clean(struct sky2_port *sky2) -{ - unsigned i; - - memset(sky2->rx_le, 0, RX_LE_BYTES); - for (i = 0; i < sky2->rx_pending; i++) { - struct ring_info *re = sky2->rx_ring + i; - - if (re->skb) { - pci_unmap_single(sky2->hw->pdev, - re->mapaddr, sky2->rx_bufsize, - PCI_DMA_FROMDEVICE); - kfree_skb(re->skb); - re->skb = NULL; - } - } -} - -/* Basic MII support */ -static int sky2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) -{ - struct mii_ioctl_data *data = if_mii(ifr); - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - int err = -EOPNOTSUPP; - - if (!netif_running(dev)) - return -ENODEV; /* Phy still in reset */ - - switch(cmd) { - case SIOCGMIIPHY: - data->phy_id = PHY_ADDR_MARV; - - /* fallthru */ - case SIOCGMIIREG: { - u16 val = 0; - - down(&sky2->phy_sema); - err = __gm_phy_read(hw, sky2->port, data->reg_num & 0x1f, &val); - up(&sky2->phy_sema); - - data->val_out = val; - break; - } - - case SIOCSMIIREG: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - - down(&sky2->phy_sema); - err = gm_phy_write(hw, sky2->port, data->reg_num & 0x1f, - data->val_in); - up(&sky2->phy_sema); - break; - } - return err; -} - -#ifdef SKY2_VLAN_TAG_USED -static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - u16 port = sky2->port; - - spin_lock(&sky2->tx_lock); - - sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_ON); - sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_ON); - sky2->vlgrp = grp; - - spin_unlock(&sky2->tx_lock); -} - -static void sky2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - u16 port = sky2->port; - - spin_lock(&sky2->tx_lock); - - sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_OFF); - sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_OFF); - if (sky2->vlgrp) - sky2->vlgrp->vlan_devices[vid] = NULL; - - spin_unlock(&sky2->tx_lock); -} -#endif - -/* - * Allocate and setup receiver buffer pool. - * In case of 64 bit dma, there are 2X as many list elements - * available as ring entries - * and need to reserve one list element so we don't wrap around. - * - * It appears the hardware has a bug in the FIFO logic that - * cause it to hang if the FIFO gets overrun and the receive buffer - * is not aligned. This means we can't use skb_reserve to align - * the IP header. - */ -static int sky2_rx_start(struct sky2_port *sky2) -{ - struct sky2_hw *hw = sky2->hw; - unsigned rxq = rxqaddr[sky2->port]; - int i; - - sky2->rx_put = sky2->rx_next = 0; - sky2_qset(hw, rxq); - sky2_prefetch_init(hw, rxq, sky2->rx_le_map, RX_LE_SIZE - 1); - - rx_set_checksum(sky2); - for (i = 0; i < sky2->rx_pending; i++) { - struct ring_info *re = sky2->rx_ring + i; - - re->skb = dev_alloc_skb(sky2->rx_bufsize); - if (!re->skb) - goto nomem; - - re->mapaddr = pci_map_single(hw->pdev, re->skb->data, - sky2->rx_bufsize, PCI_DMA_FROMDEVICE); - sky2_rx_add(sky2, re->mapaddr); - } - - /* Tell chip about available buffers */ - sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); - sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX)); - return 0; -nomem: - sky2_rx_clean(sky2); - return -ENOMEM; -} - -/* Bring up network interface. */ -static int sky2_up(struct net_device *dev) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - unsigned port = sky2->port; - u32 ramsize, rxspace; - int err = -ENOMEM; - - if (netif_msg_ifup(sky2)) - printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); - - /* must be power of 2 */ - sky2->tx_le = pci_alloc_consistent(hw->pdev, - TX_RING_SIZE * - sizeof(struct sky2_tx_le), - &sky2->tx_le_map); - if (!sky2->tx_le) - goto err_out; - - sky2->tx_ring = kcalloc(TX_RING_SIZE, sizeof(struct tx_ring_info), - GFP_KERNEL); - if (!sky2->tx_ring) - goto err_out; - sky2->tx_prod = sky2->tx_cons = 0; - - sky2->rx_le = pci_alloc_consistent(hw->pdev, RX_LE_BYTES, - &sky2->rx_le_map); - if (!sky2->rx_le) - goto err_out; - memset(sky2->rx_le, 0, RX_LE_BYTES); - - sky2->rx_ring = kcalloc(sky2->rx_pending, sizeof(struct ring_info), - GFP_KERNEL); - if (!sky2->rx_ring) - goto err_out; - - sky2_mac_init(hw, port); - - /* Configure RAM buffers */ - if (hw->chip_id == CHIP_ID_YUKON_FE || - (hw->chip_id == CHIP_ID_YUKON_EC && hw->chip_rev == 2)) - ramsize = 4096; - else { - u8 e0 = sky2_read8(hw, B2_E_0); - ramsize = (e0 == 0) ? (128 * 1024) : (e0 * 4096); - } - - /* 2/3 for Rx */ - rxspace = (2 * ramsize) / 3; - sky2_ramset(hw, rxqaddr[port], 0, rxspace); - sky2_ramset(hw, txqaddr[port], rxspace, ramsize - rxspace); - - /* Make sure SyncQ is disabled */ - sky2_write8(hw, RB_ADDR(port == 0 ? Q_XS1 : Q_XS2, RB_CTRL), - RB_RST_SET); - - sky2_qset(hw, txqaddr[port]); - if (hw->chip_id == CHIP_ID_YUKON_EC_U) - sky2_write16(hw, Q_ADDR(txqaddr[port], Q_AL), 0x1a0); - - - sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, - TX_RING_SIZE - 1); - - err = sky2_rx_start(sky2); - if (err) - goto err_out; - - /* Enable interrupts from phy/mac for port */ - hw->intr_mask |= (port == 0) ? Y2_IS_PORT_1 : Y2_IS_PORT_2; - sky2_write32(hw, B0_IMSK, hw->intr_mask); - return 0; - -err_out: - if (sky2->rx_le) { - pci_free_consistent(hw->pdev, RX_LE_BYTES, - sky2->rx_le, sky2->rx_le_map); - sky2->rx_le = NULL; - } - if (sky2->tx_le) { - pci_free_consistent(hw->pdev, - TX_RING_SIZE * sizeof(struct sky2_tx_le), - sky2->tx_le, sky2->tx_le_map); - sky2->tx_le = NULL; - } - kfree(sky2->tx_ring); - kfree(sky2->rx_ring); - - sky2->tx_ring = NULL; - sky2->rx_ring = NULL; - return err; -} - -/* Modular subtraction in ring */ -static inline int tx_dist(unsigned tail, unsigned head) -{ - return (head - tail) % TX_RING_SIZE; -} - -/* Number of list elements available for next tx */ -static inline int tx_avail(const struct sky2_port *sky2) -{ - return sky2->tx_pending - tx_dist(sky2->tx_cons, sky2->tx_prod); -} - -/* Estimate of number of transmit list elements required */ -static inline unsigned tx_le_req(const struct sk_buff *skb) -{ - unsigned count; - - count = sizeof(dma_addr_t) / sizeof(u32); - count += skb_shinfo(skb)->nr_frags * count; - - if (skb_shinfo(skb)->tso_size) - ++count; - - if (skb->ip_summed == CHECKSUM_HW) - ++count; - - return count; -} - -/* - * Put one packet in ring for transmit. - * A single packet can generate multiple list elements, and - * the number of ring elements will probably be less than the number - * of list elements used. - * - * No BH disabling for tx_lock here (like tg3) - */ -static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - struct sky2_tx_le *le = NULL; - struct tx_ring_info *re; - unsigned i, len; - dma_addr_t mapping; - u32 addr64; - u16 mss; - u8 ctrl; - - if (!spin_trylock(&sky2->tx_lock)) - return NETDEV_TX_LOCKED; - - if (unlikely(tx_avail(sky2) < tx_le_req(skb))) { - /* There is a known but harmless race with lockless tx - * and netif_stop_queue. - */ - if (!netif_queue_stopped(dev)) { - netif_stop_queue(dev); - printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", - dev->name); - } - spin_unlock(&sky2->tx_lock); - - return NETDEV_TX_BUSY; - } - - if (unlikely(netif_msg_tx_queued(sky2))) - printk(KERN_DEBUG "%s: tx queued, slot %u, len %d\n", - dev->name, sky2->tx_prod, skb->len); - - len = skb_headlen(skb); - mapping = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); - addr64 = high32(mapping); - - re = sky2->tx_ring + sky2->tx_prod; - - /* Send high bits if changed or crosses boundary */ - if (addr64 != sky2->tx_addr64 || high32(mapping + len) != sky2->tx_addr64) { - le = get_tx_le(sky2); - le->tx.addr = cpu_to_le32(addr64); - le->ctrl = 0; - le->opcode = OP_ADDR64 | HW_OWNER; - sky2->tx_addr64 = high32(mapping + len); - } - - /* Check for TCP Segmentation Offload */ - mss = skb_shinfo(skb)->tso_size; - if (mss != 0) { - /* just drop the packet if non-linear expansion fails */ - if (skb_header_cloned(skb) && - pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { - dev_kfree_skb_any(skb); - goto out_unlock; - } - - mss += ((skb->h.th->doff - 5) * 4); /* TCP options */ - mss += (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr); - mss += ETH_HLEN; - } - - if (mss != sky2->tx_last_mss) { - le = get_tx_le(sky2); - le->tx.tso.size = cpu_to_le16(mss); - le->tx.tso.rsvd = 0; - le->opcode = OP_LRGLEN | HW_OWNER; - le->ctrl = 0; - sky2->tx_last_mss = mss; - } - - ctrl = 0; -#ifdef SKY2_VLAN_TAG_USED - /* Add VLAN tag, can piggyback on LRGLEN or ADDR64 */ - if (sky2->vlgrp && vlan_tx_tag_present(skb)) { - if (!le) { - le = get_tx_le(sky2); - le->tx.addr = 0; - le->opcode = OP_VLAN|HW_OWNER; - le->ctrl = 0; - } else - le->opcode |= OP_VLAN; - le->length = cpu_to_be16(vlan_tx_tag_get(skb)); - ctrl |= INS_VLAN; - } -#endif - - /* Handle TCP checksum offload */ - if (skb->ip_summed == CHECKSUM_HW) { - u16 hdr = skb->h.raw - skb->data; - u16 offset = hdr + skb->csum; - - ctrl = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM; - if (skb->nh.iph->protocol == IPPROTO_UDP) - ctrl |= UDPTCP; - - le = get_tx_le(sky2); - le->tx.csum.start = cpu_to_le16(hdr); - le->tx.csum.offset = cpu_to_le16(offset); - le->length = 0; /* initial checksum value */ - le->ctrl = 1; /* one packet */ - le->opcode = OP_TCPLISW | HW_OWNER; - } - - le = get_tx_le(sky2); - le->tx.addr = cpu_to_le32((u32) mapping); - le->length = cpu_to_le16(len); - le->ctrl = ctrl; - le->opcode = mss ? (OP_LARGESEND | HW_OWNER) : (OP_PACKET | HW_OWNER); - - /* Record the transmit mapping info */ - re->skb = skb; - pci_unmap_addr_set(re, mapaddr, mapping); - - for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { - skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; - struct tx_ring_info *fre; - - mapping = pci_map_page(hw->pdev, frag->page, frag->page_offset, - frag->size, PCI_DMA_TODEVICE); - addr64 = (mapping >> 16) >> 16; - if (addr64 != sky2->tx_addr64) { - le = get_tx_le(sky2); - le->tx.addr = cpu_to_le32(addr64); - le->ctrl = 0; - le->opcode = OP_ADDR64 | HW_OWNER; - sky2->tx_addr64 = addr64; - } - - le = get_tx_le(sky2); - le->tx.addr = cpu_to_le32((u32) mapping); - le->length = cpu_to_le16(frag->size); - le->ctrl = ctrl; - le->opcode = OP_BUFFER | HW_OWNER; - - fre = sky2->tx_ring - + ((re - sky2->tx_ring) + i + 1) % TX_RING_SIZE; - pci_unmap_addr_set(fre, mapaddr, mapping); - } - - re->idx = sky2->tx_prod; - le->ctrl |= EOP; - - sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod, - &sky2->tx_last_put, TX_RING_SIZE); - - if (tx_avail(sky2) <= MAX_SKB_TX_LE) - netif_stop_queue(dev); - -out_unlock: - mmiowb(); - spin_unlock(&sky2->tx_lock); - - dev->trans_start = jiffies; - return NETDEV_TX_OK; -} - -/* - * Free ring elements from starting at tx_cons until "done" - * - * NB: the hardware will tell us about partial completion of multi-part - * buffers; these are deferred until completion. - */ -static void sky2_tx_complete(struct sky2_port *sky2, u16 done) -{ - struct net_device *dev = sky2->netdev; - struct pci_dev *pdev = sky2->hw->pdev; - u16 nxt, put; - unsigned i; - - BUG_ON(done >= TX_RING_SIZE); - - if (unlikely(netif_msg_tx_done(sky2))) - printk(KERN_DEBUG "%s: tx done, up to %u\n", - dev->name, done); - - for (put = sky2->tx_cons; put != done; put = nxt) { - struct tx_ring_info *re = sky2->tx_ring + put; - struct sk_buff *skb = re->skb; - - nxt = re->idx; - BUG_ON(nxt >= TX_RING_SIZE); - prefetch(sky2->tx_ring + nxt); - - /* Check for partial status */ - if (tx_dist(put, done) < tx_dist(put, nxt)) - break; - - skb = re->skb; - pci_unmap_single(pdev, pci_unmap_addr(re, mapaddr), - skb_headlen(skb), PCI_DMA_TODEVICE); - - for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { - struct tx_ring_info *fre; - fre = sky2->tx_ring + (put + i + 1) % TX_RING_SIZE; - pci_unmap_page(pdev, pci_unmap_addr(fre, mapaddr), - skb_shinfo(skb)->frags[i].size, - PCI_DMA_TODEVICE); - } - - dev_kfree_skb_any(skb); - } - - spin_lock(&sky2->tx_lock); - sky2->tx_cons = put; - if (netif_queue_stopped(dev) && tx_avail(sky2) > MAX_SKB_TX_LE) - netif_wake_queue(dev); - spin_unlock(&sky2->tx_lock); -} - -/* Cleanup all untransmitted buffers, assume transmitter not running */ -static void sky2_tx_clean(struct sky2_port *sky2) -{ - sky2_tx_complete(sky2, sky2->tx_prod); -} - -/* Network shutdown */ -static int sky2_down(struct net_device *dev) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - unsigned port = sky2->port; - u16 ctrl; - - /* Never really got started! */ - if (!sky2->tx_le) - return 0; - - if (netif_msg_ifdown(sky2)) - printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); - - /* Stop more packets from being queued */ - netif_stop_queue(dev); - - /* Disable port IRQ */ - local_irq_disable(); - hw->intr_mask &= ~((sky2->port == 0) ? Y2_IS_IRQ_PHY1 : Y2_IS_IRQ_PHY2); - sky2_write32(hw, B0_IMSK, hw->intr_mask); - local_irq_enable(); - - flush_scheduled_work(); - - sky2_phy_reset(hw, port); - - /* Stop transmitter */ - sky2_write32(hw, Q_ADDR(txqaddr[port], Q_CSR), BMU_STOP); - sky2_read32(hw, Q_ADDR(txqaddr[port], Q_CSR)); - - sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), - RB_RST_SET | RB_DIS_OP_MD); - - ctrl = gma_read16(hw, port, GM_GP_CTRL); - ctrl &= ~(GM_GPCR_TX_ENA | GM_GPCR_RX_ENA); - gma_write16(hw, port, GM_GP_CTRL, ctrl); - - sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); - - /* Workaround shared GMAC reset */ - if (!(hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev == 0 - && port == 0 && hw->dev[1] && netif_running(hw->dev[1]))) - sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_SET); - - /* Disable Force Sync bit and Enable Alloc bit */ - sky2_write8(hw, SK_REG(port, TXA_CTRL), - TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC); - - /* Stop Interval Timer and Limit Counter of Tx Arbiter */ - sky2_write32(hw, SK_REG(port, TXA_ITI_INI), 0L); - sky2_write32(hw, SK_REG(port, TXA_LIM_INI), 0L); - - /* Reset the PCI FIFO of the async Tx queue */ - sky2_write32(hw, Q_ADDR(txqaddr[port], Q_CSR), - BMU_RST_SET | BMU_FIFO_RST); - - /* Reset the Tx prefetch units */ - sky2_write32(hw, Y2_QADDR(txqaddr[port], PREF_UNIT_CTRL), - PREF_UNIT_RST_SET); - - sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET); - - sky2_rx_stop(sky2); - - sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); - sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); - - /* turn off LED's */ - sky2_write16(hw, B0_Y2LED, LED_STAT_OFF); - - synchronize_irq(hw->pdev->irq); - - sky2_tx_clean(sky2); - sky2_rx_clean(sky2); - - pci_free_consistent(hw->pdev, RX_LE_BYTES, - sky2->rx_le, sky2->rx_le_map); - kfree(sky2->rx_ring); - - pci_free_consistent(hw->pdev, - TX_RING_SIZE * sizeof(struct sky2_tx_le), - sky2->tx_le, sky2->tx_le_map); - kfree(sky2->tx_ring); - - sky2->tx_le = NULL; - sky2->rx_le = NULL; - - sky2->rx_ring = NULL; - sky2->tx_ring = NULL; - - return 0; -} - -static u16 sky2_phy_speed(const struct sky2_hw *hw, u16 aux) -{ - if (!hw->copper) - return SPEED_1000; - - if (hw->chip_id == CHIP_ID_YUKON_FE) - return (aux & PHY_M_PS_SPEED_100) ? SPEED_100 : SPEED_10; - - switch (aux & PHY_M_PS_SPEED_MSK) { - case PHY_M_PS_SPEED_1000: - return SPEED_1000; - case PHY_M_PS_SPEED_100: - return SPEED_100; - default: - return SPEED_10; - } -} - -static void sky2_link_up(struct sky2_port *sky2) -{ - struct sky2_hw *hw = sky2->hw; - unsigned port = sky2->port; - u16 reg; - - /* Enable Transmit FIFO Underrun */ - sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), GMAC_DEF_MSK); - - reg = gma_read16(hw, port, GM_GP_CTRL); - if (sky2->duplex == DUPLEX_FULL || sky2->autoneg == AUTONEG_ENABLE) - reg |= GM_GPCR_DUP_FULL; - - /* enable Rx/Tx */ - reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA; - gma_write16(hw, port, GM_GP_CTRL, reg); - gma_read16(hw, port, GM_GP_CTRL); - - gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); - - netif_carrier_on(sky2->netdev); - netif_wake_queue(sky2->netdev); - - /* Turn on link LED */ - sky2_write8(hw, SK_REG(port, LNK_LED_REG), - LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); - - if (hw->chip_id == CHIP_ID_YUKON_XL) { - u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); - - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); - gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, PHY_M_LEDC_LOS_CTRL(1) | /* LINK/ACT */ - PHY_M_LEDC_INIT_CTRL(sky2->speed == - SPEED_10 ? 7 : 0) | - PHY_M_LEDC_STA1_CTRL(sky2->speed == - SPEED_100 ? 7 : 0) | - PHY_M_LEDC_STA0_CTRL(sky2->speed == - SPEED_1000 ? 7 : 0)); - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); - } - - if (netif_msg_link(sky2)) - printk(KERN_INFO PFX - "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", - sky2->netdev->name, sky2->speed, - sky2->duplex == DUPLEX_FULL ? "full" : "half", - (sky2->tx_pause && sky2->rx_pause) ? "both" : - sky2->tx_pause ? "tx" : sky2->rx_pause ? "rx" : "none"); -} - -static void sky2_link_down(struct sky2_port *sky2) -{ - struct sky2_hw *hw = sky2->hw; - unsigned port = sky2->port; - u16 reg; - - gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); - - reg = gma_read16(hw, port, GM_GP_CTRL); - reg &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA); - gma_write16(hw, port, GM_GP_CTRL, reg); - gma_read16(hw, port, GM_GP_CTRL); /* PCI post */ - - if (sky2->rx_pause && !sky2->tx_pause) { - /* restore Asymmetric Pause bit */ - gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, - gm_phy_read(hw, port, PHY_MARV_AUNE_ADV) - | PHY_M_AN_ASP); - } - - netif_carrier_off(sky2->netdev); - netif_stop_queue(sky2->netdev); - - /* Turn on link LED */ - sky2_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF); - - if (netif_msg_link(sky2)) - printk(KERN_INFO PFX "%s: Link is down.\n", sky2->netdev->name); - sky2_phy_init(hw, port); -} - -static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux) -{ - struct sky2_hw *hw = sky2->hw; - unsigned port = sky2->port; - u16 lpa; - - lpa = gm_phy_read(hw, port, PHY_MARV_AUNE_LP); - - if (lpa & PHY_M_AN_RF) { - printk(KERN_ERR PFX "%s: remote fault", sky2->netdev->name); - return -1; - } - - if (hw->chip_id != CHIP_ID_YUKON_FE && - gm_phy_read(hw, port, PHY_MARV_1000T_STAT) & PHY_B_1000S_MSF) { - printk(KERN_ERR PFX "%s: master/slave fault", - sky2->netdev->name); - return -1; - } - - if (!(aux & PHY_M_PS_SPDUP_RES)) { - printk(KERN_ERR PFX "%s: speed/duplex mismatch", - sky2->netdev->name); - return -1; - } - - sky2->duplex = (aux & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF; - - sky2->speed = sky2_phy_speed(hw, aux); - - /* Pause bits are offset (9..8) */ - if (hw->chip_id == CHIP_ID_YUKON_XL) - aux >>= 6; - - sky2->rx_pause = (aux & PHY_M_PS_RX_P_EN) != 0; - sky2->tx_pause = (aux & PHY_M_PS_TX_P_EN) != 0; - - if ((sky2->tx_pause || sky2->rx_pause) - && !(sky2->speed < SPEED_1000 && sky2->duplex == DUPLEX_HALF)) - sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_ON); - else - sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); - - return 0; -} - -/* - * Interrupt from PHY are handled outside of interrupt context - * because accessing phy registers requires spin wait which might - * cause excess interrupt latency. - */ -static void sky2_phy_task(void *arg) -{ - struct sky2_port *sky2 = arg; - struct sky2_hw *hw = sky2->hw; - u16 istatus, phystat; - - down(&sky2->phy_sema); - istatus = gm_phy_read(hw, sky2->port, PHY_MARV_INT_STAT); - phystat = gm_phy_read(hw, sky2->port, PHY_MARV_PHY_STAT); - - if (netif_msg_intr(sky2)) - printk(KERN_INFO PFX "%s: phy interrupt status 0x%x 0x%x\n", - sky2->netdev->name, istatus, phystat); - - if (istatus & PHY_M_IS_AN_COMPL) { - if (sky2_autoneg_done(sky2, phystat) == 0) - sky2_link_up(sky2); - goto out; - } - - if (istatus & PHY_M_IS_LSP_CHANGE) - sky2->speed = sky2_phy_speed(hw, phystat); - - if (istatus & PHY_M_IS_DUP_CHANGE) - sky2->duplex = - (phystat & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF; - - if (istatus & PHY_M_IS_LST_CHANGE) { - if (phystat & PHY_M_PS_LINK_UP) - sky2_link_up(sky2); - else - sky2_link_down(sky2); - } -out: - up(&sky2->phy_sema); - - local_irq_disable(); - hw->intr_mask |= (sky2->port == 0) ? Y2_IS_IRQ_PHY1 : Y2_IS_IRQ_PHY2; - sky2_write32(hw, B0_IMSK, hw->intr_mask); - local_irq_enable(); -} - -static void sky2_tx_timeout(struct net_device *dev) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - unsigned txq = txqaddr[sky2->port]; - - if (netif_msg_timer(sky2)) - printk(KERN_ERR PFX "%s: tx timeout\n", dev->name); - - netif_stop_queue(dev); - - sky2_write32(hw, Q_ADDR(txq, Q_CSR), BMU_STOP); - sky2_read32(hw, Q_ADDR(txq, Q_CSR)); - - sky2_write32(hw, Y2_QADDR(txq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); - - sky2_tx_clean(sky2); - - sky2_qset(hw, txq); - sky2_prefetch_init(hw, txq, sky2->tx_le_map, TX_RING_SIZE - 1); - - netif_wake_queue(dev); -} - - -#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) -/* Want receive buffer size to be multiple of 64 bits, and incl room for vlan */ -static inline unsigned sky2_buf_size(int mtu) -{ - return roundup(mtu + ETH_HLEN + 4, 8); -} - -static int sky2_change_mtu(struct net_device *dev, int new_mtu) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - int err; - u16 ctl, mode; - - if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) - return -EINVAL; - - if (hw->chip_id == CHIP_ID_YUKON_EC_U && new_mtu > ETH_DATA_LEN) - return -EINVAL; - - if (!netif_running(dev)) { - dev->mtu = new_mtu; - return 0; - } - - sky2_write32(hw, B0_IMSK, 0); - - dev->trans_start = jiffies; /* prevent tx timeout */ - netif_stop_queue(dev); - netif_poll_disable(hw->dev[0]); - - ctl = gma_read16(hw, sky2->port, GM_GP_CTRL); - gma_write16(hw, sky2->port, GM_GP_CTRL, ctl & ~GM_GPCR_RX_ENA); - sky2_rx_stop(sky2); - sky2_rx_clean(sky2); - - dev->mtu = new_mtu; - sky2->rx_bufsize = sky2_buf_size(new_mtu); - mode = DATA_BLIND_VAL(DATA_BLIND_DEF) | - GM_SMOD_VLAN_ENA | IPG_DATA_VAL(IPG_DATA_DEF); - - if (dev->mtu > ETH_DATA_LEN) - mode |= GM_SMOD_JUMBO_ENA; - - gma_write16(hw, sky2->port, GM_SERIAL_MODE, mode); - - sky2_write8(hw, RB_ADDR(rxqaddr[sky2->port], RB_CTRL), RB_ENA_OP_MD); - - err = sky2_rx_start(sky2); - sky2_write32(hw, B0_IMSK, hw->intr_mask); - - if (err) - dev_close(dev); - else { - gma_write16(hw, sky2->port, GM_GP_CTRL, ctl); - - netif_poll_enable(hw->dev[0]); - netif_wake_queue(dev); - } - - return err; -} - -/* - * Receive one packet. - * For small packets or errors, just reuse existing skb. - * For larger packets, get new buffer. - */ -static struct sk_buff *sky2_receive(struct sky2_port *sky2, - u16 length, u32 status) -{ - struct ring_info *re = sky2->rx_ring + sky2->rx_next; - struct sk_buff *skb = NULL; - - if (unlikely(netif_msg_rx_status(sky2))) - printk(KERN_DEBUG PFX "%s: rx slot %u status 0x%x len %d\n", - sky2->netdev->name, sky2->rx_next, status, length); - - sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; - prefetch(sky2->rx_ring + sky2->rx_next); - - if (status & GMR_FS_ANY_ERR) - goto error; - - if (!(status & GMR_FS_RX_OK)) - goto resubmit; - - if ((status >> 16) != length || length > sky2->rx_bufsize) - goto oversize; - - if (length < copybreak) { - skb = alloc_skb(length + 2, GFP_ATOMIC); - if (!skb) - goto resubmit; - - skb_reserve(skb, 2); - pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->mapaddr, - length, PCI_DMA_FROMDEVICE); - memcpy(skb->data, re->skb->data, length); - skb->ip_summed = re->skb->ip_summed; - skb->csum = re->skb->csum; - pci_dma_sync_single_for_device(sky2->hw->pdev, re->mapaddr, - length, PCI_DMA_FROMDEVICE); - } else { - struct sk_buff *nskb; - - nskb = dev_alloc_skb(sky2->rx_bufsize); - if (!nskb) - goto resubmit; - - skb = re->skb; - re->skb = nskb; - pci_unmap_single(sky2->hw->pdev, re->mapaddr, - sky2->rx_bufsize, PCI_DMA_FROMDEVICE); - prefetch(skb->data); - - re->mapaddr = pci_map_single(sky2->hw->pdev, nskb->data, - sky2->rx_bufsize, PCI_DMA_FROMDEVICE); - } - - skb_put(skb, length); -resubmit: - re->skb->ip_summed = CHECKSUM_NONE; - sky2_rx_add(sky2, re->mapaddr); - - /* Tell receiver about new buffers. */ - sky2_put_idx(sky2->hw, rxqaddr[sky2->port], sky2->rx_put, - &sky2->rx_last_put, RX_LE_SIZE); - - return skb; - -oversize: - ++sky2->net_stats.rx_over_errors; - goto resubmit; - -error: - ++sky2->net_stats.rx_errors; - - if (netif_msg_rx_err(sky2)) - printk(KERN_INFO PFX "%s: rx error, status 0x%x length %d\n", - sky2->netdev->name, status, length); - - if (status & (GMR_FS_LONG_ERR | GMR_FS_UN_SIZE)) - sky2->net_stats.rx_length_errors++; - if (status & GMR_FS_FRAGMENT) - sky2->net_stats.rx_frame_errors++; - if (status & GMR_FS_CRC_ERR) - sky2->net_stats.rx_crc_errors++; - if (status & GMR_FS_RX_FF_OV) - sky2->net_stats.rx_fifo_errors++; - - goto resubmit; -} - -/* - * Check for transmit complete - */ -#define TX_NO_STATUS 0xffff - -static inline void sky2_tx_check(struct sky2_hw *hw, int port, u16 last) -{ - if (last != TX_NO_STATUS) { - struct net_device *dev = hw->dev[port]; - if (dev && netif_running(dev)) { - struct sky2_port *sky2 = netdev_priv(dev); - sky2_tx_complete(sky2, last); - } - } -} - -/* - * Both ports share the same status interrupt, therefore there is only - * one poll routine. - */ -static int sky2_poll(struct net_device *dev0, int *budget) -{ - struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw; - unsigned int to_do = min(dev0->quota, *budget); - unsigned int work_done = 0; - u16 hwidx; - u16 tx_done[2] = { TX_NO_STATUS, TX_NO_STATUS }; - - hwidx = sky2_read16(hw, STAT_PUT_IDX); - BUG_ON(hwidx >= STATUS_RING_SIZE); - rmb(); - - while (hwidx != hw->st_idx) { - struct sky2_status_le *le = hw->st_le + hw->st_idx; - struct net_device *dev; - struct sky2_port *sky2; - struct sk_buff *skb; - u32 status; - u16 length; - u8 op; - - le = hw->st_le + hw->st_idx; - hw->st_idx = (hw->st_idx + 1) % STATUS_RING_SIZE; - prefetch(hw->st_le + hw->st_idx); - - BUG_ON(le->link >= 2); - dev = hw->dev[le->link]; - if (dev == NULL || !netif_running(dev)) - continue; - - sky2 = netdev_priv(dev); - status = le32_to_cpu(le->status); - length = le16_to_cpu(le->length); - op = le->opcode & ~HW_OWNER; - le->opcode = 0; - - switch (op) { - case OP_RXSTAT: - skb = sky2_receive(sky2, length, status); - if (!skb) - break; - - skb->dev = dev; - skb->protocol = eth_type_trans(skb, dev); - dev->last_rx = jiffies; - -#ifdef SKY2_VLAN_TAG_USED - if (sky2->vlgrp && (status & GMR_FS_VLAN)) { - vlan_hwaccel_receive_skb(skb, - sky2->vlgrp, - be16_to_cpu(sky2->rx_tag)); - } else -#endif - netif_receive_skb(skb); - - if (++work_done >= to_do) - goto exit_loop; - break; - -#ifdef SKY2_VLAN_TAG_USED - case OP_RXVLAN: - sky2->rx_tag = length; - break; - - case OP_RXCHKSVLAN: - sky2->rx_tag = length; - /* fall through */ -#endif - case OP_RXCHKS: - skb = sky2->rx_ring[sky2->rx_next].skb; - skb->ip_summed = CHECKSUM_HW; - skb->csum = le16_to_cpu(status); - break; - - case OP_TXINDEXLE: - /* TX index reports status for both ports */ - tx_done[0] = status & 0xffff; - tx_done[1] = ((status >> 24) & 0xff) - | (u16)(length & 0xf) << 8; - break; - - default: - if (net_ratelimit()) - printk(KERN_WARNING PFX - "unknown status opcode 0x%x\n", op); - break; - } - } - -exit_loop: - sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); - mmiowb(); - - sky2_tx_check(hw, 0, tx_done[0]); - sky2_tx_check(hw, 1, tx_done[1]); - - if (sky2_read16(hw, STAT_PUT_IDX) == hw->st_idx) { - /* need to restart TX timer */ - if (is_ec_a1(hw)) { - sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP); - sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START); - } - - netif_rx_complete(dev0); - hw->intr_mask |= Y2_IS_STAT_BMU; - sky2_write32(hw, B0_IMSK, hw->intr_mask); - mmiowb(); - return 0; - } else { - *budget -= work_done; - dev0->quota -= work_done; - return 1; - } -} - -static void sky2_hw_error(struct sky2_hw *hw, unsigned port, u32 status) -{ - struct net_device *dev = hw->dev[port]; - - printk(KERN_INFO PFX "%s: hw error interrupt status 0x%x\n", - dev->name, status); - - if (status & Y2_IS_PAR_RD1) { - printk(KERN_ERR PFX "%s: ram data read parity error\n", - dev->name); - /* Clear IRQ */ - sky2_write16(hw, RAM_BUFFER(port, B3_RI_CTRL), RI_CLR_RD_PERR); - } - - if (status & Y2_IS_PAR_WR1) { - printk(KERN_ERR PFX "%s: ram data write parity error\n", - dev->name); - - sky2_write16(hw, RAM_BUFFER(port, B3_RI_CTRL), RI_CLR_WR_PERR); - } - - if (status & Y2_IS_PAR_MAC1) { - printk(KERN_ERR PFX "%s: MAC parity error\n", dev->name); - sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_CLI_TX_PE); - } - - if (status & Y2_IS_PAR_RX1) { - printk(KERN_ERR PFX "%s: RX parity error\n", dev->name); - sky2_write32(hw, Q_ADDR(rxqaddr[port], Q_CSR), BMU_CLR_IRQ_PAR); - } - - if (status & Y2_IS_TCP_TXA1) { - printk(KERN_ERR PFX "%s: TCP segmentation error\n", dev->name); - sky2_write32(hw, Q_ADDR(txqaddr[port], Q_CSR), BMU_CLR_IRQ_TCP); - } -} - -static void sky2_hw_intr(struct sky2_hw *hw) -{ - u32 status = sky2_read32(hw, B0_HWE_ISRC); - - if (status & Y2_IS_TIST_OV) - sky2_write8(hw, GMAC_TI_ST_CTRL, GMT_ST_CLR_IRQ); - - if (status & (Y2_IS_MST_ERR | Y2_IS_IRQ_STAT)) { - u16 pci_err; - - pci_read_config_word(hw->pdev, PCI_STATUS, &pci_err); - printk(KERN_ERR PFX "%s: pci hw error (0x%x)\n", - pci_name(hw->pdev), pci_err); - - sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); - pci_write_config_word(hw->pdev, PCI_STATUS, - pci_err | PCI_STATUS_ERROR_BITS); - sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); - } - - if (status & Y2_IS_PCI_EXP) { - /* PCI-Express uncorrectable Error occurred */ - u32 pex_err; - - pci_read_config_dword(hw->pdev, PEX_UNC_ERR_STAT, &pex_err); - - printk(KERN_ERR PFX "%s: pci express error (0x%x)\n", - pci_name(hw->pdev), pex_err); - - /* clear the interrupt */ - sky2_write32(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); - pci_write_config_dword(hw->pdev, PEX_UNC_ERR_STAT, - 0xffffffffUL); - sky2_write32(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); - - if (pex_err & PEX_FATAL_ERRORS) { - u32 hwmsk = sky2_read32(hw, B0_HWE_IMSK); - hwmsk &= ~Y2_IS_PCI_EXP; - sky2_write32(hw, B0_HWE_IMSK, hwmsk); - } - } - - if (status & Y2_HWE_L1_MASK) - sky2_hw_error(hw, 0, status); - status >>= 8; - if (status & Y2_HWE_L1_MASK) - sky2_hw_error(hw, 1, status); -} - -static void sky2_mac_intr(struct sky2_hw *hw, unsigned port) -{ - struct net_device *dev = hw->dev[port]; - struct sky2_port *sky2 = netdev_priv(dev); - u8 status = sky2_read8(hw, SK_REG(port, GMAC_IRQ_SRC)); - - if (netif_msg_intr(sky2)) - printk(KERN_INFO PFX "%s: mac interrupt status 0x%x\n", - dev->name, status); - - if (status & GM_IS_RX_FF_OR) { - ++sky2->net_stats.rx_fifo_errors; - sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO); - } - - if (status & GM_IS_TX_FF_UR) { - ++sky2->net_stats.tx_fifo_errors; - sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_CLI_TX_FU); - } -} - -static void sky2_phy_intr(struct sky2_hw *hw, unsigned port) -{ - struct net_device *dev = hw->dev[port]; - struct sky2_port *sky2 = netdev_priv(dev); - - hw->intr_mask &= ~(port == 0 ? Y2_IS_IRQ_PHY1 : Y2_IS_IRQ_PHY2); - sky2_write32(hw, B0_IMSK, hw->intr_mask); - schedule_work(&sky2->phy_task); -} - -static irqreturn_t sky2_intr(int irq, void *dev_id, struct pt_regs *regs) -{ - struct sky2_hw *hw = dev_id; - struct net_device *dev0 = hw->dev[0]; - u32 status; - - status = sky2_read32(hw, B0_Y2_SP_ISRC2); - if (status == 0 || status == ~0) - return IRQ_NONE; - - if (status & Y2_IS_HW_ERR) - sky2_hw_intr(hw); - - /* Do NAPI for Rx and Tx status */ - if (status & Y2_IS_STAT_BMU) { - hw->intr_mask &= ~Y2_IS_STAT_BMU; - sky2_write32(hw, B0_IMSK, hw->intr_mask); - - if (likely(__netif_rx_schedule_prep(dev0))) { - prefetch(&hw->st_le[hw->st_idx]); - __netif_rx_schedule(dev0); - } - } - - if (status & Y2_IS_IRQ_PHY1) - sky2_phy_intr(hw, 0); - - if (status & Y2_IS_IRQ_PHY2) - sky2_phy_intr(hw, 1); - - if (status & Y2_IS_IRQ_MAC1) - sky2_mac_intr(hw, 0); - - if (status & Y2_IS_IRQ_MAC2) - sky2_mac_intr(hw, 1); - - sky2_write32(hw, B0_Y2_SP_ICR, 2); - - sky2_read32(hw, B0_IMSK); - - return IRQ_HANDLED; -} - -#ifdef CONFIG_NET_POLL_CONTROLLER -static void sky2_netpoll(struct net_device *dev) -{ - struct sky2_port *sky2 = netdev_priv(dev); - - sky2_intr(sky2->hw->pdev->irq, sky2->hw, NULL); -} -#endif - -/* Chip internal frequency for clock calculations */ -static inline u32 sky2_mhz(const struct sky2_hw *hw) -{ - switch (hw->chip_id) { - case CHIP_ID_YUKON_EC: - case CHIP_ID_YUKON_EC_U: - return 125; /* 125 Mhz */ - case CHIP_ID_YUKON_FE: - return 100; /* 100 Mhz */ - default: /* YUKON_XL */ - return 156; /* 156 Mhz */ - } -} - -static inline u32 sky2_us2clk(const struct sky2_hw *hw, u32 us) -{ - return sky2_mhz(hw) * us; -} - -static inline u32 sky2_clk2us(const struct sky2_hw *hw, u32 clk) -{ - return clk / sky2_mhz(hw); -} - - -static int sky2_reset(struct sky2_hw *hw) -{ - u32 ctst; - u16 status; - u8 t8, pmd_type; - int i; - - ctst = sky2_read32(hw, B0_CTST); - - sky2_write8(hw, B0_CTST, CS_RST_CLR); - hw->chip_id = sky2_read8(hw, B2_CHIP_ID); - if (hw->chip_id < CHIP_ID_YUKON_XL || hw->chip_id > CHIP_ID_YUKON_FE) { - printk(KERN_ERR PFX "%s: unsupported chip type 0x%x\n", - pci_name(hw->pdev), hw->chip_id); - return -EOPNOTSUPP; - } - - /* ring for status responses */ - hw->st_le = pci_alloc_consistent(hw->pdev, STATUS_LE_BYTES, - &hw->st_dma); - if (!hw->st_le) - return -ENOMEM; - - /* disable ASF */ - if (hw->chip_id <= CHIP_ID_YUKON_EC) { - sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); - sky2_write16(hw, B0_CTST, Y2_ASF_DISABLE); - } - - /* do a SW reset */ - sky2_write8(hw, B0_CTST, CS_RST_SET); - sky2_write8(hw, B0_CTST, CS_RST_CLR); - - /* clear PCI errors, if any */ - pci_read_config_word(hw->pdev, PCI_STATUS, &status); - sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); - pci_write_config_word(hw->pdev, PCI_STATUS, - status | PCI_STATUS_ERROR_BITS); - - sky2_write8(hw, B0_CTST, CS_MRST_CLR); - - /* clear any PEX errors */ - if (is_pciex(hw)) { - u16 lstat; - pci_write_config_dword(hw->pdev, PEX_UNC_ERR_STAT, - 0xffffffffUL); - pci_read_config_word(hw->pdev, PEX_LNK_STAT, &lstat); - } - - pmd_type = sky2_read8(hw, B2_PMD_TYP); - hw->copper = !(pmd_type == 'L' || pmd_type == 'S'); - - hw->ports = 1; - t8 = sky2_read8(hw, B2_Y2_HW_RES); - if ((t8 & CFG_DUAL_MAC_MSK) == CFG_DUAL_MAC_MSK) { - if (!(sky2_read8(hw, B2_Y2_CLK_GATE) & Y2_STATUS_LNK2_INAC)) - ++hw->ports; - } - hw->chip_rev = (sky2_read8(hw, B2_MAC_CFG) & CFG_CHIP_R_MSK) >> 4; - - sky2_set_power_state(hw, PCI_D0); - - for (i = 0; i < hw->ports; i++) { - sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); - sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_CLR); - } - - sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); - - /* Clear I2C IRQ noise */ - sky2_write32(hw, B2_I2C_IRQ, 1); - - /* turn off hardware timer (unused) */ - sky2_write8(hw, B2_TI_CTRL, TIM_STOP); - sky2_write8(hw, B2_TI_CTRL, TIM_CLR_IRQ); - - sky2_write8(hw, B0_Y2LED, LED_STAT_ON); - - /* Turn off descriptor polling */ - sky2_write32(hw, B28_DPT_CTRL, DPT_STOP); - - /* Turn off receive timestamp */ - sky2_write8(hw, GMAC_TI_ST_CTRL, GMT_ST_STOP); - sky2_write8(hw, GMAC_TI_ST_CTRL, GMT_ST_CLR_IRQ); - - /* enable the Tx Arbiters */ - for (i = 0; i < hw->ports; i++) - sky2_write8(hw, SK_REG(i, TXA_CTRL), TXA_ENA_ARB); - - /* Initialize ram interface */ - for (i = 0; i < hw->ports; i++) { - sky2_write8(hw, RAM_BUFFER(i, B3_RI_CTRL), RI_RST_CLR); - - sky2_write8(hw, RAM_BUFFER(i, B3_RI_WTO_R1), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_WTO_XA1), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_WTO_XS1), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_RTO_R1), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_RTO_XA1), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_RTO_XS1), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_WTO_R2), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_WTO_XA2), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_WTO_XS2), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_RTO_R2), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_RTO_XA2), SK_RI_TO_53); - sky2_write8(hw, RAM_BUFFER(i, B3_RI_RTO_XS2), SK_RI_TO_53); - } - - sky2_write32(hw, B0_HWE_IMSK, Y2_HWE_ALL_MASK); - - for (i = 0; i < hw->ports; i++) - sky2_phy_reset(hw, i); - - memset(hw->st_le, 0, STATUS_LE_BYTES); - hw->st_idx = 0; - - sky2_write32(hw, STAT_CTRL, SC_STAT_RST_SET); - sky2_write32(hw, STAT_CTRL, SC_STAT_RST_CLR); - - sky2_write32(hw, STAT_LIST_ADDR_LO, hw->st_dma); - sky2_write32(hw, STAT_LIST_ADDR_HI, (u64) hw->st_dma >> 32); - - /* Set the list last index */ - sky2_write16(hw, STAT_LAST_IDX, STATUS_RING_SIZE - 1); - - /* These status setup values are copied from SysKonnect's driver */ - if (is_ec_a1(hw)) { - /* WA for dev. #4.3 */ - sky2_write16(hw, STAT_TX_IDX_TH, 0xfff); /* Tx Threshold */ - - /* set Status-FIFO watermark */ - sky2_write8(hw, STAT_FIFO_WM, 0x21); /* WA for dev. #4.18 */ - - /* set Status-FIFO ISR watermark */ - sky2_write8(hw, STAT_FIFO_ISR_WM, 0x07); /* WA for dev. #4.18 */ - sky2_write32(hw, STAT_TX_TIMER_INI, sky2_us2clk(hw, 10000)); - } else { - sky2_write16(hw, STAT_TX_IDX_TH, 10); - sky2_write8(hw, STAT_FIFO_WM, 16); - - /* set Status-FIFO ISR watermark */ - if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev == 0) - sky2_write8(hw, STAT_FIFO_ISR_WM, 4); - else - sky2_write8(hw, STAT_FIFO_ISR_WM, 16); - - sky2_write32(hw, STAT_TX_TIMER_INI, sky2_us2clk(hw, 1000)); - sky2_write32(hw, STAT_LEV_TIMER_INI, sky2_us2clk(hw, 100)); - sky2_write32(hw, STAT_ISR_TIMER_INI, sky2_us2clk(hw, 20)); - } - - /* enable status unit */ - sky2_write32(hw, STAT_CTRL, SC_STAT_OP_ON); - - sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START); - sky2_write8(hw, STAT_LEV_TIMER_CTRL, TIM_START); - sky2_write8(hw, STAT_ISR_TIMER_CTRL, TIM_START); - - return 0; -} - -static inline u32 sky2_supported_modes(const struct sky2_hw *hw) -{ - u32 modes; - if (hw->copper) { - modes = SUPPORTED_10baseT_Half - | SUPPORTED_10baseT_Full - | SUPPORTED_100baseT_Half - | SUPPORTED_100baseT_Full - | SUPPORTED_Autoneg | SUPPORTED_TP; - - if (hw->chip_id != CHIP_ID_YUKON_FE) - modes |= SUPPORTED_1000baseT_Half - | SUPPORTED_1000baseT_Full; - } else - modes = SUPPORTED_1000baseT_Full | SUPPORTED_FIBRE - | SUPPORTED_Autoneg; - return modes; -} - -static int sky2_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - - ecmd->transceiver = XCVR_INTERNAL; - ecmd->supported = sky2_supported_modes(hw); - ecmd->phy_address = PHY_ADDR_MARV; - if (hw->copper) { - ecmd->supported = SUPPORTED_10baseT_Half - | SUPPORTED_10baseT_Full - | SUPPORTED_100baseT_Half - | SUPPORTED_100baseT_Full - | SUPPORTED_1000baseT_Half - | SUPPORTED_1000baseT_Full - | SUPPORTED_Autoneg | SUPPORTED_TP; - ecmd->port = PORT_TP; - } else - ecmd->port = PORT_FIBRE; - - ecmd->advertising = sky2->advertising; - ecmd->autoneg = sky2->autoneg; - ecmd->speed = sky2->speed; - ecmd->duplex = sky2->duplex; - return 0; -} - -static int sky2_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) -{ - struct sky2_port *sky2 = netdev_priv(dev); - const struct sky2_hw *hw = sky2->hw; - u32 supported = sky2_supported_modes(hw); - - if (ecmd->autoneg == AUTONEG_ENABLE) { - ecmd->advertising = supported; - sky2->duplex = -1; - sky2->speed = -1; - } else { - u32 setting; - - switch (ecmd->speed) { - case SPEED_1000: - if (ecmd->duplex == DUPLEX_FULL) - setting = SUPPORTED_1000baseT_Full; - else if (ecmd->duplex == DUPLEX_HALF) - setting = SUPPORTED_1000baseT_Half; - else - return -EINVAL; - break; - case SPEED_100: - if (ecmd->duplex == DUPLEX_FULL) - setting = SUPPORTED_100baseT_Full; - else if (ecmd->duplex == DUPLEX_HALF) - setting = SUPPORTED_100baseT_Half; - else - return -EINVAL; - break; - - case SPEED_10: - if (ecmd->duplex == DUPLEX_FULL) - setting = SUPPORTED_10baseT_Full; - else if (ecmd->duplex == DUPLEX_HALF) - setting = SUPPORTED_10baseT_Half; - else - return -EINVAL; - break; - default: - return -EINVAL; - } - - if ((setting & supported) == 0) - return -EINVAL; - - sky2->speed = ecmd->speed; - sky2->duplex = ecmd->duplex; - } - - sky2->autoneg = ecmd->autoneg; - sky2->advertising = ecmd->advertising; - - if (netif_running(dev)) - sky2_phy_reinit(sky2); - - return 0; -} - -static void sky2_get_drvinfo(struct net_device *dev, - struct ethtool_drvinfo *info) -{ - struct sky2_port *sky2 = netdev_priv(dev); - - strcpy(info->driver, DRV_NAME); - strcpy(info->version, DRV_VERSION); - strcpy(info->fw_version, "N/A"); - strcpy(info->bus_info, pci_name(sky2->hw->pdev)); -} - -static const struct sky2_stat { - char name[ETH_GSTRING_LEN]; - u16 offset; -} sky2_stats[] = { - { "tx_bytes", GM_TXO_OK_HI }, - { "rx_bytes", GM_RXO_OK_HI }, - { "tx_broadcast", GM_TXF_BC_OK }, - { "rx_broadcast", GM_RXF_BC_OK }, - { "tx_multicast", GM_TXF_MC_OK }, - { "rx_multicast", GM_RXF_MC_OK }, - { "tx_unicast", GM_TXF_UC_OK }, - { "rx_unicast", GM_RXF_UC_OK }, - { "tx_mac_pause", GM_TXF_MPAUSE }, - { "rx_mac_pause", GM_RXF_MPAUSE }, - { "collisions", GM_TXF_SNG_COL }, - { "late_collision",GM_TXF_LAT_COL }, - { "aborted", GM_TXF_ABO_COL }, - { "multi_collisions", GM_TXF_MUL_COL }, - { "fifo_underrun", GM_TXE_FIFO_UR }, - { "fifo_overflow", GM_RXE_FIFO_OV }, - { "rx_toolong", GM_RXF_LNG_ERR }, - { "rx_jabber", GM_RXF_JAB_PKT }, - { "rx_runt", GM_RXE_FRAG }, - { "rx_too_long", GM_RXF_LNG_ERR }, - { "rx_fcs_error", GM_RXF_FCS_ERR }, -}; - -static u32 sky2_get_rx_csum(struct net_device *dev) -{ - struct sky2_port *sky2 = netdev_priv(dev); - - return sky2->rx_csum; -} - -static int sky2_set_rx_csum(struct net_device *dev, u32 data) -{ - struct sky2_port *sky2 = netdev_priv(dev); - - sky2->rx_csum = data; - - sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR), - data ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM); - - return 0; -} - -static u32 sky2_get_msglevel(struct net_device *netdev) -{ - struct sky2_port *sky2 = netdev_priv(netdev); - return sky2->msg_enable; -} - -static int sky2_nway_reset(struct net_device *dev) -{ - struct sky2_port *sky2 = netdev_priv(dev); - - if (sky2->autoneg != AUTONEG_ENABLE) - return -EINVAL; - - sky2_phy_reinit(sky2); - - return 0; -} - -static void sky2_phy_stats(struct sky2_port *sky2, u64 * data, unsigned count) -{ - struct sky2_hw *hw = sky2->hw; - unsigned port = sky2->port; - int i; - - data[0] = (u64) gma_read32(hw, port, GM_TXO_OK_HI) << 32 - | (u64) gma_read32(hw, port, GM_TXO_OK_LO); - data[1] = (u64) gma_read32(hw, port, GM_RXO_OK_HI) << 32 - | (u64) gma_read32(hw, port, GM_RXO_OK_LO); - - for (i = 2; i < count; i++) - data[i] = (u64) gma_read32(hw, port, sky2_stats[i].offset); -} - -static void sky2_set_msglevel(struct net_device *netdev, u32 value) -{ - struct sky2_port *sky2 = netdev_priv(netdev); - sky2->msg_enable = value; -} - -static int sky2_get_stats_count(struct net_device *dev) -{ - return ARRAY_SIZE(sky2_stats); -} - -static void sky2_get_ethtool_stats(struct net_device *dev, - struct ethtool_stats *stats, u64 * data) -{ - struct sky2_port *sky2 = netdev_priv(dev); - - sky2_phy_stats(sky2, data, ARRAY_SIZE(sky2_stats)); -} - -static void sky2_get_strings(struct net_device *dev, u32 stringset, u8 * data) -{ - int i; - - switch (stringset) { - case ETH_SS_STATS: - for (i = 0; i < ARRAY_SIZE(sky2_stats); i++) - memcpy(data + i * ETH_GSTRING_LEN, - sky2_stats[i].name, ETH_GSTRING_LEN); - break; - } -} - -/* Use hardware MIB variables for critical path statistics and - * transmit feedback not reported at interrupt. - * Other errors are accounted for in interrupt handler. - */ -static struct net_device_stats *sky2_get_stats(struct net_device *dev) -{ - struct sky2_port *sky2 = netdev_priv(dev); - u64 data[13]; - - sky2_phy_stats(sky2, data, ARRAY_SIZE(data)); - - sky2->net_stats.tx_bytes = data[0]; - sky2->net_stats.rx_bytes = data[1]; - sky2->net_stats.tx_packets = data[2] + data[4] + data[6]; - sky2->net_stats.rx_packets = data[3] + data[5] + data[7]; - sky2->net_stats.multicast = data[5] + data[7]; - sky2->net_stats.collisions = data[10]; - sky2->net_stats.tx_aborted_errors = data[12]; - - return &sky2->net_stats; -} - -static int sky2_set_mac_address(struct net_device *dev, void *p) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sockaddr *addr = p; - - if (!is_valid_ether_addr(addr->sa_data)) - return -EADDRNOTAVAIL; - - memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); - memcpy_toio(sky2->hw->regs + B2_MAC_1 + sky2->port * 8, - dev->dev_addr, ETH_ALEN); - memcpy_toio(sky2->hw->regs + B2_MAC_2 + sky2->port * 8, - dev->dev_addr, ETH_ALEN); - - if (netif_running(dev)) - sky2_phy_reinit(sky2); - - return 0; -} - -static void sky2_set_multicast(struct net_device *dev) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - unsigned port = sky2->port; - struct dev_mc_list *list = dev->mc_list; - u16 reg; - u8 filter[8]; - - memset(filter, 0, sizeof(filter)); - - reg = gma_read16(hw, port, GM_RX_CTRL); - reg |= GM_RXCR_UCF_ENA; - - if (dev->flags & IFF_PROMISC) /* promiscuous */ - reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); - else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > 16) /* all multicast */ - memset(filter, 0xff, sizeof(filter)); - else if (dev->mc_count == 0) /* no multicast */ - reg &= ~GM_RXCR_MCF_ENA; - else { - int i; - reg |= GM_RXCR_MCF_ENA; - - for (i = 0; list && i < dev->mc_count; i++, list = list->next) { - u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f; - filter[bit / 8] |= 1 << (bit % 8); - } - } - - gma_write16(hw, port, GM_MC_ADDR_H1, - (u16) filter[0] | ((u16) filter[1] << 8)); - gma_write16(hw, port, GM_MC_ADDR_H2, - (u16) filter[2] | ((u16) filter[3] << 8)); - gma_write16(hw, port, GM_MC_ADDR_H3, - (u16) filter[4] | ((u16) filter[5] << 8)); - gma_write16(hw, port, GM_MC_ADDR_H4, - (u16) filter[6] | ((u16) filter[7] << 8)); - - gma_write16(hw, port, GM_RX_CTRL, reg); -} - -/* Can have one global because blinking is controlled by - * ethtool and that is always under RTNL mutex - */ -static void sky2_led(struct sky2_hw *hw, unsigned port, int on) -{ - u16 pg; - - switch (hw->chip_id) { - case CHIP_ID_YUKON_XL: - pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); - gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, - on ? (PHY_M_LEDC_LOS_CTRL(1) | - PHY_M_LEDC_INIT_CTRL(7) | - PHY_M_LEDC_STA1_CTRL(7) | - PHY_M_LEDC_STA0_CTRL(7)) - : 0); - - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); - break; - - default: - gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); - gm_phy_write(hw, port, PHY_MARV_LED_OVER, - on ? PHY_M_LED_MO_DUP(MO_LED_ON) | - PHY_M_LED_MO_10(MO_LED_ON) | - PHY_M_LED_MO_100(MO_LED_ON) | - PHY_M_LED_MO_1000(MO_LED_ON) | - PHY_M_LED_MO_RX(MO_LED_ON) - : PHY_M_LED_MO_DUP(MO_LED_OFF) | - PHY_M_LED_MO_10(MO_LED_OFF) | - PHY_M_LED_MO_100(MO_LED_OFF) | - PHY_M_LED_MO_1000(MO_LED_OFF) | - PHY_M_LED_MO_RX(MO_LED_OFF)); - - } -} - -/* blink LED's for finding board */ -static int sky2_phys_id(struct net_device *dev, u32 data) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - unsigned port = sky2->port; - u16 ledctrl, ledover = 0; - long ms; - int interrupted; - int onoff = 1; - - if (!data || data > (u32) (MAX_SCHEDULE_TIMEOUT / HZ)) - ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT); - else - ms = data * 1000; - - /* save initial values */ - down(&sky2->phy_sema); - if (hw->chip_id == CHIP_ID_YUKON_XL) { - u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); - ledctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL); - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); - } else { - ledctrl = gm_phy_read(hw, port, PHY_MARV_LED_CTRL); - ledover = gm_phy_read(hw, port, PHY_MARV_LED_OVER); - } - - interrupted = 0; - while (!interrupted && ms > 0) { - sky2_led(hw, port, onoff); - onoff = !onoff; - - up(&sky2->phy_sema); - interrupted = msleep_interruptible(250); - down(&sky2->phy_sema); - - ms -= 250; - } - - /* resume regularly scheduled programming */ - if (hw->chip_id == CHIP_ID_YUKON_XL) { - u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); - gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ledctrl); - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); - } else { - gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); - gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); - } - up(&sky2->phy_sema); - - return 0; -} - -static void sky2_get_pauseparam(struct net_device *dev, - struct ethtool_pauseparam *ecmd) -{ - struct sky2_port *sky2 = netdev_priv(dev); - - ecmd->tx_pause = sky2->tx_pause; - ecmd->rx_pause = sky2->rx_pause; - ecmd->autoneg = sky2->autoneg; -} - -static int sky2_set_pauseparam(struct net_device *dev, - struct ethtool_pauseparam *ecmd) -{ - struct sky2_port *sky2 = netdev_priv(dev); - int err = 0; - - sky2->autoneg = ecmd->autoneg; - sky2->tx_pause = ecmd->tx_pause != 0; - sky2->rx_pause = ecmd->rx_pause != 0; - - sky2_phy_reinit(sky2); - - return err; -} - -#ifdef CONFIG_PM -static void sky2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) -{ - struct sky2_port *sky2 = netdev_priv(dev); - - wol->supported = WAKE_MAGIC; - wol->wolopts = sky2->wol ? WAKE_MAGIC : 0; -} - -static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - - if (wol->wolopts != WAKE_MAGIC && wol->wolopts != 0) - return -EOPNOTSUPP; - - sky2->wol = wol->wolopts == WAKE_MAGIC; - - if (sky2->wol) { - memcpy_toio(hw->regs + WOL_MAC_ADDR, dev->dev_addr, ETH_ALEN); - - sky2_write16(hw, WOL_CTRL_STAT, - WOL_CTL_ENA_PME_ON_MAGIC_PKT | - WOL_CTL_ENA_MAGIC_PKT_UNIT); - } else - sky2_write16(hw, WOL_CTRL_STAT, WOL_CTL_DEFAULT); - - return 0; -} -#endif - -static int sky2_get_coalesce(struct net_device *dev, - struct ethtool_coalesce *ecmd) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - - if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_STOP) - ecmd->tx_coalesce_usecs = 0; - else { - u32 clks = sky2_read32(hw, STAT_TX_TIMER_INI); - ecmd->tx_coalesce_usecs = sky2_clk2us(hw, clks); - } - ecmd->tx_max_coalesced_frames = sky2_read16(hw, STAT_TX_IDX_TH); - - if (sky2_read8(hw, STAT_LEV_TIMER_CTRL) == TIM_STOP) - ecmd->rx_coalesce_usecs = 0; - else { - u32 clks = sky2_read32(hw, STAT_LEV_TIMER_INI); - ecmd->rx_coalesce_usecs = sky2_clk2us(hw, clks); - } - ecmd->rx_max_coalesced_frames = sky2_read8(hw, STAT_FIFO_WM); - - if (sky2_read8(hw, STAT_ISR_TIMER_CTRL) == TIM_STOP) - ecmd->rx_coalesce_usecs_irq = 0; - else { - u32 clks = sky2_read32(hw, STAT_ISR_TIMER_INI); - ecmd->rx_coalesce_usecs_irq = sky2_clk2us(hw, clks); - } - - ecmd->rx_max_coalesced_frames_irq = sky2_read8(hw, STAT_FIFO_ISR_WM); - - return 0; -} - -/* Note: this affect both ports */ -static int sky2_set_coalesce(struct net_device *dev, - struct ethtool_coalesce *ecmd) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - const u32 tmin = sky2_clk2us(hw, 1); - const u32 tmax = 5000; - - if (ecmd->tx_coalesce_usecs != 0 && - (ecmd->tx_coalesce_usecs < tmin || ecmd->tx_coalesce_usecs > tmax)) - return -EINVAL; - - if (ecmd->rx_coalesce_usecs != 0 && - (ecmd->rx_coalesce_usecs < tmin || ecmd->rx_coalesce_usecs > tmax)) - return -EINVAL; - - if (ecmd->rx_coalesce_usecs_irq != 0 && - (ecmd->rx_coalesce_usecs_irq < tmin || ecmd->rx_coalesce_usecs_irq > tmax)) - return -EINVAL; - - if (ecmd->tx_max_coalesced_frames > 0xffff) - return -EINVAL; - if (ecmd->rx_max_coalesced_frames > 0xff) - return -EINVAL; - if (ecmd->rx_max_coalesced_frames_irq > 0xff) - return -EINVAL; - - if (ecmd->tx_coalesce_usecs == 0) - sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP); - else { - sky2_write32(hw, STAT_TX_TIMER_INI, - sky2_us2clk(hw, ecmd->tx_coalesce_usecs)); - sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START); - } - sky2_write16(hw, STAT_TX_IDX_TH, ecmd->tx_max_coalesced_frames); - - if (ecmd->rx_coalesce_usecs == 0) - sky2_write8(hw, STAT_LEV_TIMER_CTRL, TIM_STOP); - else { - sky2_write32(hw, STAT_LEV_TIMER_INI, - sky2_us2clk(hw, ecmd->rx_coalesce_usecs)); - sky2_write8(hw, STAT_LEV_TIMER_CTRL, TIM_START); - } - sky2_write8(hw, STAT_FIFO_WM, ecmd->rx_max_coalesced_frames); - - if (ecmd->rx_coalesce_usecs_irq == 0) - sky2_write8(hw, STAT_ISR_TIMER_CTRL, TIM_STOP); - else { - sky2_write32(hw, STAT_TX_TIMER_INI, - sky2_us2clk(hw, ecmd->rx_coalesce_usecs_irq)); - sky2_write8(hw, STAT_ISR_TIMER_CTRL, TIM_START); - } - sky2_write8(hw, STAT_FIFO_ISR_WM, ecmd->rx_max_coalesced_frames_irq); - return 0; -} - -static void sky2_get_ringparam(struct net_device *dev, - struct ethtool_ringparam *ering) -{ - struct sky2_port *sky2 = netdev_priv(dev); - - ering->rx_max_pending = RX_MAX_PENDING; - ering->rx_mini_max_pending = 0; - ering->rx_jumbo_max_pending = 0; - ering->tx_max_pending = TX_RING_SIZE - 1; - - ering->rx_pending = sky2->rx_pending; - ering->rx_mini_pending = 0; - ering->rx_jumbo_pending = 0; - ering->tx_pending = sky2->tx_pending; -} - -static int sky2_set_ringparam(struct net_device *dev, - struct ethtool_ringparam *ering) -{ - struct sky2_port *sky2 = netdev_priv(dev); - int err = 0; - - if (ering->rx_pending > RX_MAX_PENDING || - ering->rx_pending < 8 || - ering->tx_pending < MAX_SKB_TX_LE || - ering->tx_pending > TX_RING_SIZE - 1) - return -EINVAL; - - if (netif_running(dev)) - sky2_down(dev); - - sky2->rx_pending = ering->rx_pending; - sky2->tx_pending = ering->tx_pending; - - if (netif_running(dev)) { - err = sky2_up(dev); - if (err) - dev_close(dev); - else - sky2_set_multicast(dev); - } - - return err; -} - -static int sky2_get_regs_len(struct net_device *dev) -{ - return 0x4000; -} - -/* - * Returns copy of control register region - * Note: access to the RAM address register set will cause timeouts. - */ -static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs, - void *p) -{ - const struct sky2_port *sky2 = netdev_priv(dev); - const void __iomem *io = sky2->hw->regs; - - BUG_ON(regs->len < B3_RI_WTO_R1); - regs->version = 1; - memset(p, 0, regs->len); - - memcpy_fromio(p, io, B3_RAM_ADDR); - - memcpy_fromio(p + B3_RI_WTO_R1, - io + B3_RI_WTO_R1, - regs->len - B3_RI_WTO_R1); -} - -static struct ethtool_ops sky2_ethtool_ops = { - .get_settings = sky2_get_settings, - .set_settings = sky2_set_settings, - .get_drvinfo = sky2_get_drvinfo, - .get_msglevel = sky2_get_msglevel, - .set_msglevel = sky2_set_msglevel, - .nway_reset = sky2_nway_reset, - .get_regs_len = sky2_get_regs_len, - .get_regs = sky2_get_regs, - .get_link = ethtool_op_get_link, - .get_sg = ethtool_op_get_sg, - .set_sg = ethtool_op_set_sg, - .get_tx_csum = ethtool_op_get_tx_csum, - .set_tx_csum = ethtool_op_set_tx_csum, - .get_tso = ethtool_op_get_tso, - .set_tso = ethtool_op_set_tso, - .get_rx_csum = sky2_get_rx_csum, - .set_rx_csum = sky2_set_rx_csum, - .get_strings = sky2_get_strings, - .get_coalesce = sky2_get_coalesce, - .set_coalesce = sky2_set_coalesce, - .get_ringparam = sky2_get_ringparam, - .set_ringparam = sky2_set_ringparam, - .get_pauseparam = sky2_get_pauseparam, - .set_pauseparam = sky2_set_pauseparam, -#ifdef CONFIG_PM - .get_wol = sky2_get_wol, - .set_wol = sky2_set_wol, -#endif - .phys_id = sky2_phys_id, - .get_stats_count = sky2_get_stats_count, - .get_ethtool_stats = sky2_get_ethtool_stats, - .get_perm_addr = ethtool_op_get_perm_addr, -}; - -/* Initialize network device */ -static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, - unsigned port, int highmem) -{ - struct sky2_port *sky2; - struct net_device *dev = alloc_etherdev(sizeof(*sky2)); - - if (!dev) { - printk(KERN_ERR "sky2 etherdev alloc failed"); - return NULL; - } - - SET_MODULE_OWNER(dev); - SET_NETDEV_DEV(dev, &hw->pdev->dev); - dev->irq = hw->pdev->irq; - dev->open = sky2_up; - dev->stop = sky2_down; - dev->do_ioctl = sky2_ioctl; - dev->hard_start_xmit = sky2_xmit_frame; - dev->get_stats = sky2_get_stats; - dev->set_multicast_list = sky2_set_multicast; - dev->set_mac_address = sky2_set_mac_address; - dev->change_mtu = sky2_change_mtu; - SET_ETHTOOL_OPS(dev, &sky2_ethtool_ops); - dev->tx_timeout = sky2_tx_timeout; - dev->watchdog_timeo = TX_WATCHDOG; - if (port == 0) - dev->poll = sky2_poll; - dev->weight = NAPI_WEIGHT; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = sky2_netpoll; -#endif - - sky2 = netdev_priv(dev); - sky2->netdev = dev; - sky2->hw = hw; - sky2->msg_enable = netif_msg_init(debug, default_msg); - - spin_lock_init(&sky2->tx_lock); - /* Auto speed and flow control */ - sky2->autoneg = AUTONEG_ENABLE; - sky2->tx_pause = 1; - sky2->rx_pause = 1; - sky2->duplex = -1; - sky2->speed = -1; - sky2->advertising = sky2_supported_modes(hw); - - /* Receive checksum disabled for Yukon XL - * because of observed problems with incorrect - * values when multiple packets are received in one interrupt - */ - sky2->rx_csum = (hw->chip_id != CHIP_ID_YUKON_XL); - - INIT_WORK(&sky2->phy_task, sky2_phy_task, sky2); - init_MUTEX(&sky2->phy_sema); - sky2->tx_pending = TX_DEF_PENDING; - sky2->rx_pending = is_ec_a1(hw) ? 8 : RX_DEF_PENDING; - sky2->rx_bufsize = sky2_buf_size(ETH_DATA_LEN); - - hw->dev[port] = dev; - - sky2->port = port; - - dev->features |= NETIF_F_LLTX; - if (hw->chip_id != CHIP_ID_YUKON_EC_U) - dev->features |= NETIF_F_TSO; - if (highmem) - dev->features |= NETIF_F_HIGHDMA; - dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; - -#ifdef SKY2_VLAN_TAG_USED - dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; - dev->vlan_rx_register = sky2_vlan_rx_register; - dev->vlan_rx_kill_vid = sky2_vlan_rx_kill_vid; -#endif - - /* read the mac address */ - memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port * 8, ETH_ALEN); - memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); - - /* device is off until link detection */ - netif_carrier_off(dev); - netif_stop_queue(dev); - - return dev; -} - -static inline void sky2_show_addr(struct net_device *dev) -{ - const struct sky2_port *sky2 = netdev_priv(dev); - - if (netif_msg_probe(sky2)) - printk(KERN_INFO PFX "%s: addr %02x:%02x:%02x:%02x:%02x:%02x\n", - dev->name, - dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], - dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); -} - -static int __devinit sky2_probe(struct pci_dev *pdev, - const struct pci_device_id *ent) -{ - struct net_device *dev, *dev1 = NULL; - struct sky2_hw *hw; - int err, pm_cap, using_dac = 0; - - err = pci_enable_device(pdev); - if (err) { - printk(KERN_ERR PFX "%s cannot enable PCI device\n", - pci_name(pdev)); - goto err_out; - } - - err = pci_request_regions(pdev, DRV_NAME); - if (err) { - printk(KERN_ERR PFX "%s cannot obtain PCI resources\n", - pci_name(pdev)); - goto err_out; - } - - pci_set_master(pdev); - - /* Find power-management capability. */ - pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM); - if (pm_cap == 0) { - printk(KERN_ERR PFX "Cannot find PowerManagement capability, " - "aborting.\n"); - err = -EIO; - goto err_out_free_regions; - } - - if (sizeof(dma_addr_t) > sizeof(u32)) { - err = pci_set_dma_mask(pdev, DMA_64BIT_MASK); - if (!err) - using_dac = 1; - } - - if (!using_dac) { - err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); - if (err) { - printk(KERN_ERR PFX "%s no usable DMA configuration\n", - pci_name(pdev)); - goto err_out_free_regions; - } - } -#ifdef __BIG_ENDIAN - /* byte swap descriptors in hardware */ - { - u32 reg; - - pci_read_config_dword(pdev, PCI_DEV_REG2, ®); - reg |= PCI_REV_DESC; - pci_write_config_dword(pdev, PCI_DEV_REG2, reg); - } -#endif - - err = -ENOMEM; - hw = kmalloc(sizeof(*hw), GFP_KERNEL); - if (!hw) { - printk(KERN_ERR PFX "%s: cannot allocate hardware struct\n", - pci_name(pdev)); - goto err_out_free_regions; - } - - memset(hw, 0, sizeof(*hw)); - hw->pdev = pdev; - - hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); - if (!hw->regs) { - printk(KERN_ERR PFX "%s: cannot map device registers\n", - pci_name(pdev)); - goto err_out_free_hw; - } - hw->pm_cap = pm_cap; - - err = sky2_reset(hw); - if (err) - goto err_out_iounmap; - - printk(KERN_INFO PFX "v%s addr 0x%lx irq %d Yukon-%s (0x%x) rev %d\n", - DRV_VERSION, pci_resource_start(pdev, 0), pdev->irq, - yukon2_name[hw->chip_id - CHIP_ID_YUKON_XL], - hw->chip_id, hw->chip_rev); - - dev = sky2_init_netdev(hw, 0, using_dac); - if (!dev) - goto err_out_free_pci; - - err = register_netdev(dev); - if (err) { - printk(KERN_ERR PFX "%s: cannot register net device\n", - pci_name(pdev)); - goto err_out_free_netdev; - } - - sky2_show_addr(dev); - - if (hw->ports > 1 && (dev1 = sky2_init_netdev(hw, 1, using_dac))) { - if (register_netdev(dev1) == 0) - sky2_show_addr(dev1); - else { - /* Failure to register second port need not be fatal */ - printk(KERN_WARNING PFX - "register of second port failed\n"); - hw->dev[1] = NULL; - free_netdev(dev1); - } - } - - err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ, DRV_NAME, hw); - if (err) { - printk(KERN_ERR PFX "%s: cannot assign irq %d\n", - pci_name(pdev), pdev->irq); - goto err_out_unregister; - } - - hw->intr_mask = Y2_IS_BASE; - sky2_write32(hw, B0_IMSK, hw->intr_mask); - - pci_set_drvdata(pdev, hw); - - return 0; - -err_out_unregister: - if (dev1) { - unregister_netdev(dev1); - free_netdev(dev1); - } - unregister_netdev(dev); -err_out_free_netdev: - free_netdev(dev); -err_out_free_pci: - sky2_write8(hw, B0_CTST, CS_RST_SET); - pci_free_consistent(hw->pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma); -err_out_iounmap: - iounmap(hw->regs); -err_out_free_hw: - kfree(hw); -err_out_free_regions: - pci_release_regions(pdev); - pci_disable_device(pdev); -err_out: - return err; -} - -static void __devexit sky2_remove(struct pci_dev *pdev) -{ - struct sky2_hw *hw = pci_get_drvdata(pdev); - struct net_device *dev0, *dev1; - - if (!hw) - return; - - dev0 = hw->dev[0]; - dev1 = hw->dev[1]; - if (dev1) - unregister_netdev(dev1); - unregister_netdev(dev0); - - sky2_write32(hw, B0_IMSK, 0); - sky2_set_power_state(hw, PCI_D3hot); - sky2_write16(hw, B0_Y2LED, LED_STAT_OFF); - sky2_write8(hw, B0_CTST, CS_RST_SET); - sky2_read8(hw, B0_CTST); - - free_irq(pdev->irq, hw); - pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma); - pci_release_regions(pdev); - pci_disable_device(pdev); - - if (dev1) - free_netdev(dev1); - free_netdev(dev0); - iounmap(hw->regs); - kfree(hw); - - pci_set_drvdata(pdev, NULL); -} - -#ifdef CONFIG_PM -static int sky2_suspend(struct pci_dev *pdev, pm_message_t state) -{ - struct sky2_hw *hw = pci_get_drvdata(pdev); - int i; - - for (i = 0; i < 2; i++) { - struct net_device *dev = hw->dev[i]; - - if (dev) { - if (!netif_running(dev)) - continue; - - sky2_down(dev); - netif_device_detach(dev); - } - } - - return sky2_set_power_state(hw, pci_choose_state(pdev, state)); -} - -static int sky2_resume(struct pci_dev *pdev) -{ - struct sky2_hw *hw = pci_get_drvdata(pdev); - int i; - - pci_restore_state(pdev); - pci_enable_wake(pdev, PCI_D0, 0); - sky2_set_power_state(hw, PCI_D0); - - sky2_reset(hw); - - for (i = 0; i < 2; i++) { - struct net_device *dev = hw->dev[i]; - if (dev) { - if (netif_running(dev)) { - netif_device_attach(dev); - if (sky2_up(dev)) - dev_close(dev); - } - } - } - return 0; -} -#endif - -static struct pci_driver sky2_driver = { - .name = DRV_NAME, - .id_table = sky2_id_table, - .probe = sky2_probe, - .remove = __devexit_p(sky2_remove), -#ifdef CONFIG_PM - .suspend = sky2_suspend, - .resume = sky2_resume, -#endif -}; - -static int __init sky2_init_module(void) -{ - return pci_register_driver(&sky2_driver); -} - -static void __exit sky2_cleanup_module(void) -{ - pci_unregister_driver(&sky2_driver); -} - -module_init(sky2_init_module); -module_exit(sky2_cleanup_module); - -MODULE_DESCRIPTION("Marvell Yukon 2 Gigabit Ethernet driver"); -MODULE_AUTHOR("Stephen Hemminger "); -MODULE_LICENSE("GPL"); -MODULE_VERSION(DRV_VERSION); diff --git a/trunk/drivers/net/sky2.h b/trunk/drivers/net/sky2.h deleted file mode 100644 index 95518921001c..000000000000 --- a/trunk/drivers/net/sky2.h +++ /dev/null @@ -1,1922 +0,0 @@ -/* - * Definitions for the new Marvell Yukon 2 driver. - */ -#ifndef _SKY2_H -#define _SKY2_H - -/* PCI config registers */ -#define PCI_DEV_REG1 0x40 -#define PCI_DEV_REG2 0x44 -#define PCI_DEV_STATUS 0x7c -#define PCI_OS_PCI_X (1<<26) - -#define PEX_LNK_STAT 0xf2 -#define PEX_UNC_ERR_STAT 0x104 -#define PEX_DEV_CTRL 0xe8 - -/* Yukon-2 */ -enum pci_dev_reg_1 { - PCI_Y2_PIG_ENA = 1<<31, /* Enable Plug-in-Go (YUKON-2) */ - PCI_Y2_DLL_DIS = 1<<30, /* Disable PCI DLL (YUKON-2) */ - PCI_Y2_PHY2_COMA = 1<<29, /* Set PHY 2 to Coma Mode (YUKON-2) */ - PCI_Y2_PHY1_COMA = 1<<28, /* Set PHY 1 to Coma Mode (YUKON-2) */ - PCI_Y2_PHY2_POWD = 1<<27, /* Set PHY 2 to Power Down (YUKON-2) */ - PCI_Y2_PHY1_POWD = 1<<26, /* Set PHY 1 to Power Down (YUKON-2) */ -}; - -enum pci_dev_reg_2 { - PCI_VPD_WR_THR = 0xffL<<24, /* Bit 31..24: VPD Write Threshold */ - PCI_DEV_SEL = 0x7fL<<17, /* Bit 23..17: EEPROM Device Select */ - PCI_VPD_ROM_SZ = 7L<<14, /* Bit 16..14: VPD ROM Size */ - - PCI_PATCH_DIR = 0xfL<<8, /* Bit 11.. 8: Ext Patches dir 3..0 */ - PCI_EXT_PATCHS = 0xfL<<4, /* Bit 7.. 4: Extended Patches 3..0 */ - PCI_EN_DUMMY_RD = 1<<3, /* Enable Dummy Read */ - PCI_REV_DESC = 1<<2, /* Reverse Desc. Bytes */ - - PCI_USEDATA64 = 1<<0, /* Use 64Bit Data bus ext */ -}; - - -#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \ - PCI_STATUS_SIG_SYSTEM_ERROR | \ - PCI_STATUS_REC_MASTER_ABORT | \ - PCI_STATUS_REC_TARGET_ABORT | \ - PCI_STATUS_PARITY) - -enum pex_dev_ctrl { - PEX_DC_MAX_RRS_MSK = 7<<12, /* Bit 14..12: Max. Read Request Size */ - PEX_DC_EN_NO_SNOOP = 1<<11,/* Enable No Snoop */ - PEX_DC_EN_AUX_POW = 1<<10,/* Enable AUX Power */ - PEX_DC_EN_PHANTOM = 1<<9, /* Enable Phantom Functions */ - PEX_DC_EN_EXT_TAG = 1<<8, /* Enable Extended Tag Field */ - PEX_DC_MAX_PLS_MSK = 7<<5, /* Bit 7.. 5: Max. Payload Size Mask */ - PEX_DC_EN_REL_ORD = 1<<4, /* Enable Relaxed Ordering */ - PEX_DC_EN_UNS_RQ_RP = 1<<3, /* Enable Unsupported Request Reporting */ - PEX_DC_EN_FAT_ER_RP = 1<<2, /* Enable Fatal Error Reporting */ - PEX_DC_EN_NFA_ER_RP = 1<<1, /* Enable Non-Fatal Error Reporting */ - PEX_DC_EN_COR_ER_RP = 1<<0, /* Enable Correctable Error Reporting */ -}; -#define PEX_DC_MAX_RD_RQ_SIZE(x) (((x)<<12) & PEX_DC_MAX_RRS_MSK) - -/* PEX_UNC_ERR_STAT PEX Uncorrectable Errors Status Register (Yukon-2) */ -enum pex_err { - PEX_UNSUP_REQ = 1<<20, /* Unsupported Request Error */ - - PEX_MALFOR_TLP = 1<<18, /* Malformed TLP */ - - PEX_UNEXP_COMP = 1<<16, /* Unexpected Completion */ - - PEX_COMP_TO = 1<<14, /* Completion Timeout */ - PEX_FLOW_CTRL_P = 1<<13, /* Flow Control Protocol Error */ - PEX_POIS_TLP = 1<<12, /* Poisoned TLP */ - - PEX_DATA_LINK_P = 1<<4, /* Data Link Protocol Error */ - PEX_FATAL_ERRORS= (PEX_MALFOR_TLP | PEX_FLOW_CTRL_P | PEX_DATA_LINK_P), -}; - - -enum csr_regs { - B0_RAP = 0x0000, - B0_CTST = 0x0004, - B0_Y2LED = 0x0005, - B0_POWER_CTRL = 0x0007, - B0_ISRC = 0x0008, - B0_IMSK = 0x000c, - B0_HWE_ISRC = 0x0010, - B0_HWE_IMSK = 0x0014, - - /* Special ISR registers (Yukon-2 only) */ - B0_Y2_SP_ISRC2 = 0x001c, - B0_Y2_SP_ISRC3 = 0x0020, - B0_Y2_SP_EISR = 0x0024, - B0_Y2_SP_LISR = 0x0028, - B0_Y2_SP_ICR = 0x002c, - - B2_MAC_1 = 0x0100, - B2_MAC_2 = 0x0108, - B2_MAC_3 = 0x0110, - B2_CONN_TYP = 0x0118, - B2_PMD_TYP = 0x0119, - B2_MAC_CFG = 0x011a, - B2_CHIP_ID = 0x011b, - B2_E_0 = 0x011c, - - B2_Y2_CLK_GATE = 0x011d, - B2_Y2_HW_RES = 0x011e, - B2_E_3 = 0x011f, - B2_Y2_CLK_CTRL = 0x0120, - - B2_TI_INI = 0x0130, - B2_TI_VAL = 0x0134, - B2_TI_CTRL = 0x0138, - B2_TI_TEST = 0x0139, - - B2_TST_CTRL1 = 0x0158, - B2_TST_CTRL2 = 0x0159, - B2_GP_IO = 0x015c, - - B2_I2C_CTRL = 0x0160, - B2_I2C_DATA = 0x0164, - B2_I2C_IRQ = 0x0168, - B2_I2C_SW = 0x016c, - - B3_RAM_ADDR = 0x0180, - B3_RAM_DATA_LO = 0x0184, - B3_RAM_DATA_HI = 0x0188, - -/* RAM Interface Registers */ -/* Yukon-2: use RAM_BUFFER() to access the RAM buffer */ -/* - * The HW-Spec. calls this registers Timeout Value 0..11. But this names are - * not usable in SW. Please notice these are NOT real timeouts, these are - * the number of qWords transferred continuously. - */ -#define RAM_BUFFER(port, reg) (reg | (port <<6)) - - B3_RI_WTO_R1 = 0x0190, - B3_RI_WTO_XA1 = 0x0191, - B3_RI_WTO_XS1 = 0x0192, - B3_RI_RTO_R1 = 0x0193, - B3_RI_RTO_XA1 = 0x0194, - B3_RI_RTO_XS1 = 0x0195, - B3_RI_WTO_R2 = 0x0196, - B3_RI_WTO_XA2 = 0x0197, - B3_RI_WTO_XS2 = 0x0198, - B3_RI_RTO_R2 = 0x0199, - B3_RI_RTO_XA2 = 0x019a, - B3_RI_RTO_XS2 = 0x019b, - B3_RI_TO_VAL = 0x019c, - B3_RI_CTRL = 0x01a0, - B3_RI_TEST = 0x01a2, - B3_MA_TOINI_RX1 = 0x01b0, - B3_MA_TOINI_RX2 = 0x01b1, - B3_MA_TOINI_TX1 = 0x01b2, - B3_MA_TOINI_TX2 = 0x01b3, - B3_MA_TOVAL_RX1 = 0x01b4, - B3_MA_TOVAL_RX2 = 0x01b5, - B3_MA_TOVAL_TX1 = 0x01b6, - B3_MA_TOVAL_TX2 = 0x01b7, - B3_MA_TO_CTRL = 0x01b8, - B3_MA_TO_TEST = 0x01ba, - B3_MA_RCINI_RX1 = 0x01c0, - B3_MA_RCINI_RX2 = 0x01c1, - B3_MA_RCINI_TX1 = 0x01c2, - B3_MA_RCINI_TX2 = 0x01c3, - B3_MA_RCVAL_RX1 = 0x01c4, - B3_MA_RCVAL_RX2 = 0x01c5, - B3_MA_RCVAL_TX1 = 0x01c6, - B3_MA_RCVAL_TX2 = 0x01c7, - B3_MA_RC_CTRL = 0x01c8, - B3_MA_RC_TEST = 0x01ca, - B3_PA_TOINI_RX1 = 0x01d0, - B3_PA_TOINI_RX2 = 0x01d4, - B3_PA_TOINI_TX1 = 0x01d8, - B3_PA_TOINI_TX2 = 0x01dc, - B3_PA_TOVAL_RX1 = 0x01e0, - B3_PA_TOVAL_RX2 = 0x01e4, - B3_PA_TOVAL_TX1 = 0x01e8, - B3_PA_TOVAL_TX2 = 0x01ec, - B3_PA_CTRL = 0x01f0, - B3_PA_TEST = 0x01f2, - - Y2_CFG_SPC = 0x1c00, -}; - -/* B0_CTST 16 bit Control/Status register */ -enum { - Y2_VMAIN_AVAIL = 1<<17,/* VMAIN available (YUKON-2 only) */ - Y2_VAUX_AVAIL = 1<<16,/* VAUX available (YUKON-2 only) */ - Y2_ASF_ENABLE = 1<<13,/* ASF Unit Enable (YUKON-2 only) */ - Y2_ASF_DISABLE = 1<<12,/* ASF Unit Disable (YUKON-2 only) */ - Y2_CLK_RUN_ENA = 1<<11,/* CLK_RUN Enable (YUKON-2 only) */ - Y2_CLK_RUN_DIS = 1<<10,/* CLK_RUN Disable (YUKON-2 only) */ - Y2_LED_STAT_ON = 1<<9, /* Status LED On (YUKON-2 only) */ - Y2_LED_STAT_OFF = 1<<8, /* Status LED Off (YUKON-2 only) */ - - CS_ST_SW_IRQ = 1<<7, /* Set IRQ SW Request */ - CS_CL_SW_IRQ = 1<<6, /* Clear IRQ SW Request */ - CS_STOP_DONE = 1<<5, /* Stop Master is finished */ - CS_STOP_MAST = 1<<4, /* Command Bit to stop the master */ - CS_MRST_CLR = 1<<3, /* Clear Master reset */ - CS_MRST_SET = 1<<2, /* Set Master reset */ - CS_RST_CLR = 1<<1, /* Clear Software reset */ - CS_RST_SET = 1, /* Set Software reset */ -}; - -/* B0_LED 8 Bit LED register */ -enum { -/* Bit 7.. 2: reserved */ - LED_STAT_ON = 1<<1, /* Status LED on */ - LED_STAT_OFF = 1, /* Status LED off */ -}; - -/* B0_POWER_CTRL 8 Bit Power Control reg (YUKON only) */ -enum { - PC_VAUX_ENA = 1<<7, /* Switch VAUX Enable */ - PC_VAUX_DIS = 1<<6, /* Switch VAUX Disable */ - PC_VCC_ENA = 1<<5, /* Switch VCC Enable */ - PC_VCC_DIS = 1<<4, /* Switch VCC Disable */ - PC_VAUX_ON = 1<<3, /* Switch VAUX On */ - PC_VAUX_OFF = 1<<2, /* Switch VAUX Off */ - PC_VCC_ON = 1<<1, /* Switch VCC On */ - PC_VCC_OFF = 1<<0, /* Switch VCC Off */ -}; - -/* B2_IRQM_MSK 32 bit IRQ Moderation Mask */ - -/* B0_Y2_SP_ISRC2 32 bit Special Interrupt Source Reg 2 */ -/* B0_Y2_SP_ISRC3 32 bit Special Interrupt Source Reg 3 */ -/* B0_Y2_SP_EISR 32 bit Enter ISR Reg */ -/* B0_Y2_SP_LISR 32 bit Leave ISR Reg */ -enum { - Y2_IS_HW_ERR = 1<<31, /* Interrupt HW Error */ - Y2_IS_STAT_BMU = 1<<30, /* Status BMU Interrupt */ - Y2_IS_ASF = 1<<29, /* ASF subsystem Interrupt */ - - Y2_IS_POLL_CHK = 1<<27, /* Check IRQ from polling unit */ - Y2_IS_TWSI_RDY = 1<<26, /* IRQ on end of TWSI Tx */ - Y2_IS_IRQ_SW = 1<<25, /* SW forced IRQ */ - Y2_IS_TIMINT = 1<<24, /* IRQ from Timer */ - - Y2_IS_IRQ_PHY2 = 1<<12, /* Interrupt from PHY 2 */ - Y2_IS_IRQ_MAC2 = 1<<11, /* Interrupt from MAC 2 */ - Y2_IS_CHK_RX2 = 1<<10, /* Descriptor error Rx 2 */ - Y2_IS_CHK_TXS2 = 1<<9, /* Descriptor error TXS 2 */ - Y2_IS_CHK_TXA2 = 1<<8, /* Descriptor error TXA 2 */ - - Y2_IS_IRQ_PHY1 = 1<<4, /* Interrupt from PHY 1 */ - Y2_IS_IRQ_MAC1 = 1<<3, /* Interrupt from MAC 1 */ - Y2_IS_CHK_RX1 = 1<<2, /* Descriptor error Rx 1 */ - Y2_IS_CHK_TXS1 = 1<<1, /* Descriptor error TXS 1 */ - Y2_IS_CHK_TXA1 = 1<<0, /* Descriptor error TXA 1 */ - - Y2_IS_BASE = Y2_IS_HW_ERR | Y2_IS_STAT_BMU | - Y2_IS_POLL_CHK | Y2_IS_TWSI_RDY | - Y2_IS_IRQ_SW | Y2_IS_TIMINT, - Y2_IS_PORT_1 = Y2_IS_IRQ_PHY1 | Y2_IS_IRQ_MAC1 | - Y2_IS_CHK_RX1 | Y2_IS_CHK_TXA1 | Y2_IS_CHK_TXS1, - Y2_IS_PORT_2 = Y2_IS_IRQ_PHY2 | Y2_IS_IRQ_MAC2 | - Y2_IS_CHK_RX2 | Y2_IS_CHK_TXA2 | Y2_IS_CHK_TXS2, -}; - -/* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */ -enum { - IS_ERR_MSK = 0x00003fff,/* All Error bits */ - - IS_IRQ_TIST_OV = 1<<13, /* Time Stamp Timer Overflow (YUKON only) */ - IS_IRQ_SENSOR = 1<<12, /* IRQ from Sensor (YUKON only) */ - IS_IRQ_MST_ERR = 1<<11, /* IRQ master error detected */ - IS_IRQ_STAT = 1<<10, /* IRQ status exception */ - IS_NO_STAT_M1 = 1<<9, /* No Rx Status from MAC 1 */ - IS_NO_STAT_M2 = 1<<8, /* No Rx Status from MAC 2 */ - IS_NO_TIST_M1 = 1<<7, /* No Time Stamp from MAC 1 */ - IS_NO_TIST_M2 = 1<<6, /* No Time Stamp from MAC 2 */ - IS_RAM_RD_PAR = 1<<5, /* RAM Read Parity Error */ - IS_RAM_WR_PAR = 1<<4, /* RAM Write Parity Error */ - IS_M1_PAR_ERR = 1<<3, /* MAC 1 Parity Error */ - IS_M2_PAR_ERR = 1<<2, /* MAC 2 Parity Error */ - IS_R1_PAR_ERR = 1<<1, /* Queue R1 Parity Error */ - IS_R2_PAR_ERR = 1<<0, /* Queue R2 Parity Error */ -}; - -/* Hardware error interrupt mask for Yukon 2 */ -enum { - Y2_IS_TIST_OV = 1<<29,/* Time Stamp Timer overflow interrupt */ - Y2_IS_SENSOR = 1<<28, /* Sensor interrupt */ - Y2_IS_MST_ERR = 1<<27, /* Master error interrupt */ - Y2_IS_IRQ_STAT = 1<<26, /* Status exception interrupt */ - Y2_IS_PCI_EXP = 1<<25, /* PCI-Express interrupt */ - Y2_IS_PCI_NEXP = 1<<24, /* PCI-Express error similar to PCI error */ - /* Link 2 */ - Y2_IS_PAR_RD2 = 1<<13, /* Read RAM parity error interrupt */ - Y2_IS_PAR_WR2 = 1<<12, /* Write RAM parity error interrupt */ - Y2_IS_PAR_MAC2 = 1<<11, /* MAC hardware fault interrupt */ - Y2_IS_PAR_RX2 = 1<<10, /* Parity Error Rx Queue 2 */ - Y2_IS_TCP_TXS2 = 1<<9, /* TCP length mismatch sync Tx queue IRQ */ - Y2_IS_TCP_TXA2 = 1<<8, /* TCP length mismatch async Tx queue IRQ */ - /* Link 1 */ - Y2_IS_PAR_RD1 = 1<<5, /* Read RAM parity error interrupt */ - Y2_IS_PAR_WR1 = 1<<4, /* Write RAM parity error interrupt */ - Y2_IS_PAR_MAC1 = 1<<3, /* MAC hardware fault interrupt */ - Y2_IS_PAR_RX1 = 1<<2, /* Parity Error Rx Queue 1 */ - Y2_IS_TCP_TXS1 = 1<<1, /* TCP length mismatch sync Tx queue IRQ */ - Y2_IS_TCP_TXA1 = 1<<0, /* TCP length mismatch async Tx queue IRQ */ - - Y2_HWE_L1_MASK = Y2_IS_PAR_RD1 | Y2_IS_PAR_WR1 | Y2_IS_PAR_MAC1 | - Y2_IS_PAR_RX1 | Y2_IS_TCP_TXS1| Y2_IS_TCP_TXA1, - Y2_HWE_L2_MASK = Y2_IS_PAR_RD2 | Y2_IS_PAR_WR2 | Y2_IS_PAR_MAC2 | - Y2_IS_PAR_RX2 | Y2_IS_TCP_TXS2| Y2_IS_TCP_TXA2, - - Y2_HWE_ALL_MASK = Y2_IS_TIST_OV | Y2_IS_MST_ERR | Y2_IS_IRQ_STAT | - Y2_IS_PCI_EXP | - Y2_HWE_L1_MASK | Y2_HWE_L2_MASK, -}; - -/* B28_DPT_CTRL 8 bit Descriptor Poll Timer Ctrl Reg */ -enum { - DPT_START = 1<<1, - DPT_STOP = 1<<0, -}; - -/* B2_TST_CTRL1 8 bit Test Control Register 1 */ -enum { - TST_FRC_DPERR_MR = 1<<7, /* force DATAPERR on MST RD */ - TST_FRC_DPERR_MW = 1<<6, /* force DATAPERR on MST WR */ - TST_FRC_DPERR_TR = 1<<5, /* force DATAPERR on TRG RD */ - TST_FRC_DPERR_TW = 1<<4, /* force DATAPERR on TRG WR */ - TST_FRC_APERR_M = 1<<3, /* force ADDRPERR on MST */ - TST_FRC_APERR_T = 1<<2, /* force ADDRPERR on TRG */ - TST_CFG_WRITE_ON = 1<<1, /* Enable Config Reg WR */ - TST_CFG_WRITE_OFF= 1<<0, /* Disable Config Reg WR */ -}; - -/* B2_MAC_CFG 8 bit MAC Configuration / Chip Revision */ -enum { - CFG_CHIP_R_MSK = 0xf<<4, /* Bit 7.. 4: Chip Revision */ - /* Bit 3.. 2: reserved */ - CFG_DIS_M2_CLK = 1<<1, /* Disable Clock for 2nd MAC */ - CFG_SNG_MAC = 1<<0, /* MAC Config: 0=2 MACs / 1=1 MAC*/ -}; - -/* B2_CHIP_ID 8 bit Chip Identification Number */ -enum { - CHIP_ID_GENESIS = 0x0a, /* Chip ID for GENESIS */ - CHIP_ID_YUKON = 0xb0, /* Chip ID for YUKON */ - CHIP_ID_YUKON_LITE = 0xb1, /* Chip ID for YUKON-Lite (Rev. A1-A3) */ - CHIP_ID_YUKON_LP = 0xb2, /* Chip ID for YUKON-LP */ - CHIP_ID_YUKON_XL = 0xb3, /* Chip ID for YUKON-2 XL */ - CHIP_ID_YUKON_EC_U = 0xb4, /* Chip ID for YUKON-2 EC Ultra */ - CHIP_ID_YUKON_EC = 0xb6, /* Chip ID for YUKON-2 EC */ - CHIP_ID_YUKON_FE = 0xb7, /* Chip ID for YUKON-2 FE */ - - CHIP_REV_YU_EC_A1 = 0, /* Chip Rev. for Yukon-EC A1/A0 */ - CHIP_REV_YU_EC_A2 = 1, /* Chip Rev. for Yukon-EC A2 */ - CHIP_REV_YU_EC_A3 = 2, /* Chip Rev. for Yukon-EC A3 */ -}; - -/* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ -enum { - Y2_STATUS_LNK2_INAC = 1<<7, /* Status Link 2 inactive (0 = active) */ - Y2_CLK_GAT_LNK2_DIS = 1<<6, /* Disable clock gating Link 2 */ - Y2_COR_CLK_LNK2_DIS = 1<<5, /* Disable Core clock Link 2 */ - Y2_PCI_CLK_LNK2_DIS = 1<<4, /* Disable PCI clock Link 2 */ - Y2_STATUS_LNK1_INAC = 1<<3, /* Status Link 1 inactive (0 = active) */ - Y2_CLK_GAT_LNK1_DIS = 1<<2, /* Disable clock gating Link 1 */ - Y2_COR_CLK_LNK1_DIS = 1<<1, /* Disable Core clock Link 1 */ - Y2_PCI_CLK_LNK1_DIS = 1<<0, /* Disable PCI clock Link 1 */ -}; - -/* B2_Y2_HW_RES 8 bit HW Resources (Yukon-2 only) */ -enum { - CFG_LED_MODE_MSK = 7<<2, /* Bit 4.. 2: LED Mode Mask */ - CFG_LINK_2_AVAIL = 1<<1, /* Link 2 available */ - CFG_LINK_1_AVAIL = 1<<0, /* Link 1 available */ -}; -#define CFG_LED_MODE(x) (((x) & CFG_LED_MODE_MSK) >> 2) -#define CFG_DUAL_MAC_MSK (CFG_LINK_2_AVAIL | CFG_LINK_1_AVAIL) - - -/* B2_Y2_CLK_CTRL 32 bit Clock Frequency Control Register (Yukon-2/EC) */ -enum { - Y2_CLK_DIV_VAL_MSK = 0xff<<16,/* Bit 23..16: Clock Divisor Value */ -#define Y2_CLK_DIV_VAL(x) (((x)<<16) & Y2_CLK_DIV_VAL_MSK) - Y2_CLK_DIV_VAL2_MSK = 7<<21, /* Bit 23..21: Clock Divisor Value */ - Y2_CLK_SELECT2_MSK = 0x1f<<16,/* Bit 20..16: Clock Select */ -#define Y2_CLK_DIV_VAL_2(x) (((x)<<21) & Y2_CLK_DIV_VAL2_MSK) -#define Y2_CLK_SEL_VAL_2(x) (((x)<<16) & Y2_CLK_SELECT2_MSK) - Y2_CLK_DIV_ENA = 1<<1, /* Enable Core Clock Division */ - Y2_CLK_DIV_DIS = 1<<0, /* Disable Core Clock Division */ -}; - -/* B2_TI_CTRL 8 bit Timer control */ -/* B2_IRQM_CTRL 8 bit IRQ Moderation Timer Control */ -enum { - TIM_START = 1<<2, /* Start Timer */ - TIM_STOP = 1<<1, /* Stop Timer */ - TIM_CLR_IRQ = 1<<0, /* Clear Timer IRQ (!IRQM) */ -}; - -/* B2_TI_TEST 8 Bit Timer Test */ -/* B2_IRQM_TEST 8 bit IRQ Moderation Timer Test */ -/* B28_DPT_TST 8 bit Descriptor Poll Timer Test Reg */ -enum { - TIM_T_ON = 1<<2, /* Test mode on */ - TIM_T_OFF = 1<<1, /* Test mode off */ - TIM_T_STEP = 1<<0, /* Test step */ -}; - -/* B3_RAM_ADDR 32 bit RAM Address, to read or write */ - /* Bit 31..19: reserved */ -#define RAM_ADR_RAN 0x0007ffffL /* Bit 18.. 0: RAM Address Range */ -/* RAM Interface Registers */ - -/* B3_RI_CTRL 16 bit RAM Interface Control Register */ -enum { - RI_CLR_RD_PERR = 1<<9, /* Clear IRQ RAM Read Parity Err */ - RI_CLR_WR_PERR = 1<<8, /* Clear IRQ RAM Write Parity Err*/ - - RI_RST_CLR = 1<<1, /* Clear RAM Interface Reset */ - RI_RST_SET = 1<<0, /* Set RAM Interface Reset */ -}; - -#define SK_RI_TO_53 36 /* RAM interface timeout */ - - -/* Port related registers FIFO, and Arbiter */ -#define SK_REG(port,reg) (((port)<<7)+(reg)) - -/* Transmit Arbiter Registers MAC 1 and 2, use SK_REG() to access */ -/* TXA_ITI_INI 32 bit Tx Arb Interval Timer Init Val */ -/* TXA_ITI_VAL 32 bit Tx Arb Interval Timer Value */ -/* TXA_LIM_INI 32 bit Tx Arb Limit Counter Init Val */ -/* TXA_LIM_VAL 32 bit Tx Arb Limit Counter Value */ - -#define TXA_MAX_VAL 0x00ffffffUL /* Bit 23.. 0: Max TXA Timer/Cnt Val */ - -/* TXA_CTRL 8 bit Tx Arbiter Control Register */ -enum { - TXA_ENA_FSYNC = 1<<7, /* Enable force of sync Tx queue */ - TXA_DIS_FSYNC = 1<<6, /* Disable force of sync Tx queue */ - TXA_ENA_ALLOC = 1<<5, /* Enable alloc of free bandwidth */ - TXA_DIS_ALLOC = 1<<4, /* Disable alloc of free bandwidth */ - TXA_START_RC = 1<<3, /* Start sync Rate Control */ - TXA_STOP_RC = 1<<2, /* Stop sync Rate Control */ - TXA_ENA_ARB = 1<<1, /* Enable Tx Arbiter */ - TXA_DIS_ARB = 1<<0, /* Disable Tx Arbiter */ -}; - -/* - * Bank 4 - 5 - */ -/* Transmit Arbiter Registers MAC 1 and 2, use SK_REG() to access */ -enum { - TXA_ITI_INI = 0x0200,/* 32 bit Tx Arb Interval Timer Init Val*/ - TXA_ITI_VAL = 0x0204,/* 32 bit Tx Arb Interval Timer Value */ - TXA_LIM_INI = 0x0208,/* 32 bit Tx Arb Limit Counter Init Val */ - TXA_LIM_VAL = 0x020c,/* 32 bit Tx Arb Limit Counter Value */ - TXA_CTRL = 0x0210,/* 8 bit Tx Arbiter Control Register */ - TXA_TEST = 0x0211,/* 8 bit Tx Arbiter Test Register */ - TXA_STAT = 0x0212,/* 8 bit Tx Arbiter Status Register */ -}; - - -enum { - B6_EXT_REG = 0x0300,/* External registers (GENESIS only) */ - B7_CFG_SPC = 0x0380,/* copy of the Configuration register */ - B8_RQ1_REGS = 0x0400,/* Receive Queue 1 */ - B8_RQ2_REGS = 0x0480,/* Receive Queue 2 */ - B8_TS1_REGS = 0x0600,/* Transmit sync queue 1 */ - B8_TA1_REGS = 0x0680,/* Transmit async queue 1 */ - B8_TS2_REGS = 0x0700,/* Transmit sync queue 2 */ - B8_TA2_REGS = 0x0780,/* Transmit sync queue 2 */ - B16_RAM_REGS = 0x0800,/* RAM Buffer Registers */ -}; - -/* Queue Register Offsets, use Q_ADDR() to access */ -enum { - B8_Q_REGS = 0x0400, /* base of Queue registers */ - Q_D = 0x00, /* 8*32 bit Current Descriptor */ - Q_DA_L = 0x20, /* 32 bit Current Descriptor Address Low dWord */ - Q_DA_H = 0x24, /* 32 bit Current Descriptor Address High dWord */ - Q_AC_L = 0x28, /* 32 bit Current Address Counter Low dWord */ - Q_AC_H = 0x2c, /* 32 bit Current Address Counter High dWord */ - Q_BC = 0x30, /* 32 bit Current Byte Counter */ - Q_CSR = 0x34, /* 32 bit BMU Control/Status Register */ - Q_F = 0x38, /* 32 bit Flag Register */ - Q_T1 = 0x3c, /* 32 bit Test Register 1 */ - Q_T1_TR = 0x3c, /* 8 bit Test Register 1 Transfer SM */ - Q_T1_WR = 0x3d, /* 8 bit Test Register 1 Write Descriptor SM */ - Q_T1_RD = 0x3e, /* 8 bit Test Register 1 Read Descriptor SM */ - Q_T1_SV = 0x3f, /* 8 bit Test Register 1 Supervisor SM */ - Q_T2 = 0x40, /* 32 bit Test Register 2 */ - Q_T3 = 0x44, /* 32 bit Test Register 3 */ - -/* Yukon-2 */ - Q_DONE = 0x24, /* 16 bit Done Index (Yukon-2 only) */ - Q_WM = 0x40, /* 16 bit FIFO Watermark */ - Q_AL = 0x42, /* 8 bit FIFO Alignment */ - Q_RSP = 0x44, /* 16 bit FIFO Read Shadow Pointer */ - Q_RSL = 0x46, /* 8 bit FIFO Read Shadow Level */ - Q_RP = 0x48, /* 8 bit FIFO Read Pointer */ - Q_RL = 0x4a, /* 8 bit FIFO Read Level */ - Q_WP = 0x4c, /* 8 bit FIFO Write Pointer */ - Q_WSP = 0x4d, /* 8 bit FIFO Write Shadow Pointer */ - Q_WL = 0x4e, /* 8 bit FIFO Write Level */ - Q_WSL = 0x4f, /* 8 bit FIFO Write Shadow Level */ -}; -#define Q_ADDR(reg, offs) (B8_Q_REGS + (reg) + (offs)) - - -/* Queue Prefetch Unit Offsets, use Y2_QADDR() to address (Yukon-2 only)*/ -enum { - Y2_B8_PREF_REGS = 0x0450, - - PREF_UNIT_CTRL = 0x00, /* 32 bit Control register */ - PREF_UNIT_LAST_IDX = 0x04, /* 16 bit Last Index */ - PREF_UNIT_ADDR_LO = 0x08, /* 32 bit List start addr, low part */ - PREF_UNIT_ADDR_HI = 0x0c, /* 32 bit List start addr, high part*/ - PREF_UNIT_GET_IDX = 0x10, /* 16 bit Get Index */ - PREF_UNIT_PUT_IDX = 0x14, /* 16 bit Put Index */ - PREF_UNIT_FIFO_WP = 0x20, /* 8 bit FIFO write pointer */ - PREF_UNIT_FIFO_RP = 0x24, /* 8 bit FIFO read pointer */ - PREF_UNIT_FIFO_WM = 0x28, /* 8 bit FIFO watermark */ - PREF_UNIT_FIFO_LEV = 0x2c, /* 8 bit FIFO level */ - - PREF_UNIT_MASK_IDX = 0x0fff, -}; -#define Y2_QADDR(q,reg) (Y2_B8_PREF_REGS + (q) + (reg)) - -/* RAM Buffer Register Offsets */ -enum { - - RB_START = 0x00,/* 32 bit RAM Buffer Start Address */ - RB_END = 0x04,/* 32 bit RAM Buffer End Address */ - RB_WP = 0x08,/* 32 bit RAM Buffer Write Pointer */ - RB_RP = 0x0c,/* 32 bit RAM Buffer Read Pointer */ - RB_RX_UTPP = 0x10,/* 32 bit Rx Upper Threshold, Pause Packet */ - RB_RX_LTPP = 0x14,/* 32 bit Rx Lower Threshold, Pause Packet */ - RB_RX_UTHP = 0x18,/* 32 bit Rx Upper Threshold, High Prio */ - RB_RX_LTHP = 0x1c,/* 32 bit Rx Lower Threshold, High Prio */ - /* 0x10 - 0x1f: reserved at Tx RAM Buffer Registers */ - RB_PC = 0x20,/* 32 bit RAM Buffer Packet Counter */ - RB_LEV = 0x24,/* 32 bit RAM Buffer Level Register */ - RB_CTRL = 0x28,/* 32 bit RAM Buffer Control Register */ - RB_TST1 = 0x29,/* 8 bit RAM Buffer Test Register 1 */ - RB_TST2 = 0x2a,/* 8 bit RAM Buffer Test Register 2 */ -}; - -/* Receive and Transmit Queues */ -enum { - Q_R1 = 0x0000, /* Receive Queue 1 */ - Q_R2 = 0x0080, /* Receive Queue 2 */ - Q_XS1 = 0x0200, /* Synchronous Transmit Queue 1 */ - Q_XA1 = 0x0280, /* Asynchronous Transmit Queue 1 */ - Q_XS2 = 0x0300, /* Synchronous Transmit Queue 2 */ - Q_XA2 = 0x0380, /* Asynchronous Transmit Queue 2 */ -}; - -/* Different PHY Types */ -enum { - PHY_ADDR_MARV = 0, -}; - -#define RB_ADDR(offs, queue) (B16_RAM_REGS + (queue) + (offs)) - - -enum { - LNK_SYNC_INI = 0x0c30,/* 32 bit Link Sync Cnt Init Value */ - LNK_SYNC_VAL = 0x0c34,/* 32 bit Link Sync Cnt Current Value */ - LNK_SYNC_CTRL = 0x0c38,/* 8 bit Link Sync Cnt Control Register */ - LNK_SYNC_TST = 0x0c39,/* 8 bit Link Sync Cnt Test Register */ - - LNK_LED_REG = 0x0c3c,/* 8 bit Link LED Register */ - -/* Receive GMAC FIFO (YUKON and Yukon-2) */ - - RX_GMF_EA = 0x0c40,/* 32 bit Rx GMAC FIFO End Address */ - RX_GMF_AF_THR = 0x0c44,/* 32 bit Rx GMAC FIFO Almost Full Thresh. */ - RX_GMF_CTRL_T = 0x0c48,/* 32 bit Rx GMAC FIFO Control/Test */ - RX_GMF_FL_MSK = 0x0c4c,/* 32 bit Rx GMAC FIFO Flush Mask */ - RX_GMF_FL_THR = 0x0c50,/* 32 bit Rx GMAC FIFO Flush Threshold */ - RX_GMF_TR_THR = 0x0c54,/* 32 bit Rx Truncation Threshold (Yukon-2) */ - RX_GMF_UP_THR = 0x0c58,/* 8 bit Rx Upper Pause Thr (Yukon-EC_U) */ - RX_GMF_LP_THR = 0x0c5a,/* 8 bit Rx Lower Pause Thr (Yukon-EC_U) */ - RX_GMF_VLAN = 0x0c5c,/* 32 bit Rx VLAN Type Register (Yukon-2) */ - RX_GMF_WP = 0x0c60,/* 32 bit Rx GMAC FIFO Write Pointer */ - - RX_GMF_WLEV = 0x0c68,/* 32 bit Rx GMAC FIFO Write Level */ - - RX_GMF_RP = 0x0c70,/* 32 bit Rx GMAC FIFO Read Pointer */ - - RX_GMF_RLEV = 0x0c78,/* 32 bit Rx GMAC FIFO Read Level */ -}; - - -/* Q_BC 32 bit Current Byte Counter */ - -/* BMU Control Status Registers */ -/* B0_R1_CSR 32 bit BMU Ctrl/Stat Rx Queue 1 */ -/* B0_R2_CSR 32 bit BMU Ctrl/Stat Rx Queue 2 */ -/* B0_XA1_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */ -/* B0_XS1_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 1 */ -/* B0_XA2_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */ -/* B0_XS2_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 2 */ -/* Q_CSR 32 bit BMU Control/Status Register */ - -/* Rx BMU Control / Status Registers (Yukon-2) */ -enum { - BMU_IDLE = 1<<31, /* BMU Idle State */ - BMU_RX_TCP_PKT = 1<<30, /* Rx TCP Packet (when RSS Hash enabled) */ - BMU_RX_IP_PKT = 1<<29, /* Rx IP Packet (when RSS Hash enabled) */ - - BMU_ENA_RX_RSS_HASH = 1<<15, /* Enable Rx RSS Hash */ - BMU_DIS_RX_RSS_HASH = 1<<14, /* Disable Rx RSS Hash */ - BMU_ENA_RX_CHKSUM = 1<<13, /* Enable Rx TCP/IP Checksum Check */ - BMU_DIS_RX_CHKSUM = 1<<12, /* Disable Rx TCP/IP Checksum Check */ - BMU_CLR_IRQ_PAR = 1<<11, /* Clear IRQ on Parity errors (Rx) */ - BMU_CLR_IRQ_TCP = 1<<11, /* Clear IRQ on TCP segment. error (Tx) */ - BMU_CLR_IRQ_CHK = 1<<10, /* Clear IRQ Check */ - BMU_STOP = 1<<9, /* Stop Rx/Tx Queue */ - BMU_START = 1<<8, /* Start Rx/Tx Queue */ - BMU_FIFO_OP_ON = 1<<7, /* FIFO Operational On */ - BMU_FIFO_OP_OFF = 1<<6, /* FIFO Operational Off */ - BMU_FIFO_ENA = 1<<5, /* Enable FIFO */ - BMU_FIFO_RST = 1<<4, /* Reset FIFO */ - BMU_OP_ON = 1<<3, /* BMU Operational On */ - BMU_OP_OFF = 1<<2, /* BMU Operational Off */ - BMU_RST_CLR = 1<<1, /* Clear BMU Reset (Enable) */ - BMU_RST_SET = 1<<0, /* Set BMU Reset */ - - BMU_CLR_RESET = BMU_FIFO_RST | BMU_OP_OFF | BMU_RST_CLR, - BMU_OPER_INIT = BMU_CLR_IRQ_PAR | BMU_CLR_IRQ_CHK | BMU_START | - BMU_FIFO_ENA | BMU_OP_ON, - - BMU_WM_DEFAULT = 0x600, -}; - -/* Tx BMU Control / Status Registers (Yukon-2) */ - /* Bit 31: same as for Rx */ -enum { - BMU_TX_IPIDINCR_ON = 1<<13, /* Enable IP ID Increment */ - BMU_TX_IPIDINCR_OFF = 1<<12, /* Disable IP ID Increment */ - BMU_TX_CLR_IRQ_TCP = 1<<11, /* Clear IRQ on TCP segment length mismatch */ -}; - -/* Queue Prefetch Unit Offsets, use Y2_QADDR() to address (Yukon-2 only)*/ -/* PREF_UNIT_CTRL 32 bit Prefetch Control register */ -enum { - PREF_UNIT_OP_ON = 1<<3, /* prefetch unit operational */ - PREF_UNIT_OP_OFF = 1<<2, /* prefetch unit not operational */ - PREF_UNIT_RST_CLR = 1<<1, /* Clear Prefetch Unit Reset */ - PREF_UNIT_RST_SET = 1<<0, /* Set Prefetch Unit Reset */ -}; - -/* RAM Buffer Register Offsets, use RB_ADDR(Queue, Offs) to access */ -/* RB_START 32 bit RAM Buffer Start Address */ -/* RB_END 32 bit RAM Buffer End Address */ -/* RB_WP 32 bit RAM Buffer Write Pointer */ -/* RB_RP 32 bit RAM Buffer Read Pointer */ -/* RB_RX_UTPP 32 bit Rx Upper Threshold, Pause Pack */ -/* RB_RX_LTPP 32 bit Rx Lower Threshold, Pause Pack */ -/* RB_RX_UTHP 32 bit Rx Upper Threshold, High Prio */ -/* RB_RX_LTHP 32 bit Rx Lower Threshold, High Prio */ -/* RB_PC 32 bit RAM Buffer Packet Counter */ -/* RB_LEV 32 bit RAM Buffer Level Register */ - -#define RB_MSK 0x0007ffff /* Bit 18.. 0: RAM Buffer Pointer Bits */ -/* RB_TST2 8 bit RAM Buffer Test Register 2 */ -/* RB_TST1 8 bit RAM Buffer Test Register 1 */ - -/* RB_CTRL 8 bit RAM Buffer Control Register */ -enum { - RB_ENA_STFWD = 1<<5, /* Enable Store & Forward */ - RB_DIS_STFWD = 1<<4, /* Disable Store & Forward */ - RB_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ - RB_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ - RB_RST_CLR = 1<<1, /* Clear RAM Buf STM Reset */ - RB_RST_SET = 1<<0, /* Set RAM Buf STM Reset */ -}; - - -/* Transmit GMAC FIFO (YUKON only) */ -enum { - TX_GMF_EA = 0x0d40,/* 32 bit Tx GMAC FIFO End Address */ - TX_GMF_AE_THR = 0x0d44,/* 32 bit Tx GMAC FIFO Almost Empty Thresh.*/ - TX_GMF_CTRL_T = 0x0d48,/* 32 bit Tx GMAC FIFO Control/Test */ - - TX_GMF_WP = 0x0d60,/* 32 bit Tx GMAC FIFO Write Pointer */ - TX_GMF_WSP = 0x0d64,/* 32 bit Tx GMAC FIFO Write Shadow Ptr. */ - TX_GMF_WLEV = 0x0d68,/* 32 bit Tx GMAC FIFO Write Level */ - - TX_GMF_RP = 0x0d70,/* 32 bit Tx GMAC FIFO Read Pointer */ - TX_GMF_RSTP = 0x0d74,/* 32 bit Tx GMAC FIFO Restart Pointer */ - TX_GMF_RLEV = 0x0d78,/* 32 bit Tx GMAC FIFO Read Level */ -}; - -/* Descriptor Poll Timer Registers */ -enum { - B28_DPT_INI = 0x0e00,/* 24 bit Descriptor Poll Timer Init Val */ - B28_DPT_VAL = 0x0e04,/* 24 bit Descriptor Poll Timer Curr Val */ - B28_DPT_CTRL = 0x0e08,/* 8 bit Descriptor Poll Timer Ctrl Reg */ - - B28_DPT_TST = 0x0e0a,/* 8 bit Descriptor Poll Timer Test Reg */ -}; - -/* Time Stamp Timer Registers (YUKON only) */ -enum { - GMAC_TI_ST_VAL = 0x0e14,/* 32 bit Time Stamp Timer Curr Val */ - GMAC_TI_ST_CTRL = 0x0e18,/* 8 bit Time Stamp Timer Ctrl Reg */ - GMAC_TI_ST_TST = 0x0e1a,/* 8 bit Time Stamp Timer Test Reg */ -}; - -/* Polling Unit Registers (Yukon-2 only) */ -enum { - POLL_CTRL = 0x0e20, /* 32 bit Polling Unit Control Reg */ - POLL_LAST_IDX = 0x0e24,/* 16 bit Polling Unit List Last Index */ - - POLL_LIST_ADDR_LO= 0x0e28,/* 32 bit Poll. List Start Addr (low) */ - POLL_LIST_ADDR_HI= 0x0e2c,/* 32 bit Poll. List Start Addr (high) */ -}; - -/* ASF Subsystem Registers (Yukon-2 only) */ -enum { - B28_Y2_SMB_CONFIG = 0x0e40,/* 32 bit ASF SMBus Config Register */ - B28_Y2_SMB_CSD_REG = 0x0e44,/* 32 bit ASF SMB Control/Status/Data */ - B28_Y2_ASF_IRQ_V_BASE=0x0e60,/* 32 bit ASF IRQ Vector Base */ - - B28_Y2_ASF_STAT_CMD= 0x0e68,/* 32 bit ASF Status and Command Reg */ - B28_Y2_ASF_HOST_COM= 0x0e6c,/* 32 bit ASF Host Communication Reg */ - B28_Y2_DATA_REG_1 = 0x0e70,/* 32 bit ASF/Host Data Register 1 */ - B28_Y2_DATA_REG_2 = 0x0e74,/* 32 bit ASF/Host Data Register 2 */ - B28_Y2_DATA_REG_3 = 0x0e78,/* 32 bit ASF/Host Data Register 3 */ - B28_Y2_DATA_REG_4 = 0x0e7c,/* 32 bit ASF/Host Data Register 4 */ -}; - -/* Status BMU Registers (Yukon-2 only)*/ -enum { - STAT_CTRL = 0x0e80,/* 32 bit Status BMU Control Reg */ - STAT_LAST_IDX = 0x0e84,/* 16 bit Status BMU Last Index */ - - STAT_LIST_ADDR_LO= 0x0e88,/* 32 bit Status List Start Addr (low) */ - STAT_LIST_ADDR_HI= 0x0e8c,/* 32 bit Status List Start Addr (high) */ - STAT_TXA1_RIDX = 0x0e90,/* 16 bit Status TxA1 Report Index Reg */ - STAT_TXS1_RIDX = 0x0e92,/* 16 bit Status TxS1 Report Index Reg */ - STAT_TXA2_RIDX = 0x0e94,/* 16 bit Status TxA2 Report Index Reg */ - STAT_TXS2_RIDX = 0x0e96,/* 16 bit Status TxS2 Report Index Reg */ - STAT_TX_IDX_TH = 0x0e98,/* 16 bit Status Tx Index Threshold Reg */ - STAT_PUT_IDX = 0x0e9c,/* 16 bit Status Put Index Reg */ - -/* FIFO Control/Status Registers (Yukon-2 only)*/ - STAT_FIFO_WP = 0x0ea0,/* 8 bit Status FIFO Write Pointer Reg */ - STAT_FIFO_RP = 0x0ea4,/* 8 bit Status FIFO Read Pointer Reg */ - STAT_FIFO_RSP = 0x0ea6,/* 8 bit Status FIFO Read Shadow Ptr */ - STAT_FIFO_LEVEL = 0x0ea8,/* 8 bit Status FIFO Level Reg */ - STAT_FIFO_SHLVL = 0x0eaa,/* 8 bit Status FIFO Shadow Level Reg */ - STAT_FIFO_WM = 0x0eac,/* 8 bit Status FIFO Watermark Reg */ - STAT_FIFO_ISR_WM= 0x0ead,/* 8 bit Status FIFO ISR Watermark Reg */ - -/* Level and ISR Timer Registers (Yukon-2 only)*/ - STAT_LEV_TIMER_INI= 0x0eb0,/* 32 bit Level Timer Init. Value Reg */ - STAT_LEV_TIMER_CNT= 0x0eb4,/* 32 bit Level Timer Counter Reg */ - STAT_LEV_TIMER_CTRL= 0x0eb8,/* 8 bit Level Timer Control Reg */ - STAT_LEV_TIMER_TEST= 0x0eb9,/* 8 bit Level Timer Test Reg */ - STAT_TX_TIMER_INI = 0x0ec0,/* 32 bit Tx Timer Init. Value Reg */ - STAT_TX_TIMER_CNT = 0x0ec4,/* 32 bit Tx Timer Counter Reg */ - STAT_TX_TIMER_CTRL = 0x0ec8,/* 8 bit Tx Timer Control Reg */ - STAT_TX_TIMER_TEST = 0x0ec9,/* 8 bit Tx Timer Test Reg */ - STAT_ISR_TIMER_INI = 0x0ed0,/* 32 bit ISR Timer Init. Value Reg */ - STAT_ISR_TIMER_CNT = 0x0ed4,/* 32 bit ISR Timer Counter Reg */ - STAT_ISR_TIMER_CTRL= 0x0ed8,/* 8 bit ISR Timer Control Reg */ - STAT_ISR_TIMER_TEST= 0x0ed9,/* 8 bit ISR Timer Test Reg */ -}; - -enum { - LINKLED_OFF = 0x01, - LINKLED_ON = 0x02, - LINKLED_LINKSYNC_OFF = 0x04, - LINKLED_LINKSYNC_ON = 0x08, - LINKLED_BLINK_OFF = 0x10, - LINKLED_BLINK_ON = 0x20, -}; - -/* GMAC and GPHY Control Registers (YUKON only) */ -enum { - GMAC_CTRL = 0x0f00,/* 32 bit GMAC Control Reg */ - GPHY_CTRL = 0x0f04,/* 32 bit GPHY Control Reg */ - GMAC_IRQ_SRC = 0x0f08,/* 8 bit GMAC Interrupt Source Reg */ - GMAC_IRQ_MSK = 0x0f0c,/* 8 bit GMAC Interrupt Mask Reg */ - GMAC_LINK_CTRL = 0x0f10,/* 16 bit Link Control Reg */ - -/* Wake-up Frame Pattern Match Control Registers (YUKON only) */ - - WOL_REG_OFFS = 0x20,/* HW-Bug: Address is + 0x20 against spec. */ - - WOL_CTRL_STAT = 0x0f20,/* 16 bit WOL Control/Status Reg */ - WOL_MATCH_CTL = 0x0f22,/* 8 bit WOL Match Control Reg */ - WOL_MATCH_RES = 0x0f23,/* 8 bit WOL Match Result Reg */ - WOL_MAC_ADDR = 0x0f24,/* 32 bit WOL MAC Address */ - WOL_PATT_PME = 0x0f2a,/* 8 bit WOL PME Match Enable (Yukon-2) */ - WOL_PATT_ASFM = 0x0f2b,/* 8 bit WOL ASF Match Enable (Yukon-2) */ - WOL_PATT_RPTR = 0x0f2c,/* 8 bit WOL Pattern Read Pointer */ - -/* WOL Pattern Length Registers (YUKON only) */ - - WOL_PATT_LEN_LO = 0x0f30,/* 32 bit WOL Pattern Length 3..0 */ - WOL_PATT_LEN_HI = 0x0f34,/* 24 bit WOL Pattern Length 6..4 */ - -/* WOL Pattern Counter Registers (YUKON only) */ - - - WOL_PATT_CNT_0 = 0x0f38,/* 32 bit WOL Pattern Counter 3..0 */ - WOL_PATT_CNT_4 = 0x0f3c,/* 24 bit WOL Pattern Counter 6..4 */ -}; - -enum { - WOL_PATT_RAM_1 = 0x1000,/* WOL Pattern RAM Link 1 */ - WOL_PATT_RAM_2 = 0x1400,/* WOL Pattern RAM Link 2 */ -}; - -enum { - BASE_GMAC_1 = 0x2800,/* GMAC 1 registers */ - BASE_GMAC_2 = 0x3800,/* GMAC 2 registers */ -}; - -/* - * Marvel-PHY Registers, indirect addressed over GMAC - */ -enum { - PHY_MARV_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ - PHY_MARV_STAT = 0x01,/* 16 bit r/o PHY Status Register */ - PHY_MARV_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ - PHY_MARV_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ - PHY_MARV_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ - PHY_MARV_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ - PHY_MARV_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ - PHY_MARV_NEPG = 0x07,/* 16 bit r/w Next Page Register */ - PHY_MARV_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ - /* Marvel-specific registers */ - PHY_MARV_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ - PHY_MARV_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ - PHY_MARV_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ - PHY_MARV_PHY_CTRL = 0x10,/* 16 bit r/w PHY Specific Ctrl Reg */ - PHY_MARV_PHY_STAT = 0x11,/* 16 bit r/o PHY Specific Stat Reg */ - PHY_MARV_INT_MASK = 0x12,/* 16 bit r/w Interrupt Mask Reg */ - PHY_MARV_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */ - PHY_MARV_EXT_CTRL = 0x14,/* 16 bit r/w Ext. PHY Specific Ctrl */ - PHY_MARV_RXE_CNT = 0x15,/* 16 bit r/w Receive Error Counter */ - PHY_MARV_EXT_ADR = 0x16,/* 16 bit r/w Ext. Ad. for Cable Diag. */ - PHY_MARV_PORT_IRQ = 0x17,/* 16 bit r/o Port 0 IRQ (88E1111 only) */ - PHY_MARV_LED_CTRL = 0x18,/* 16 bit r/w LED Control Reg */ - PHY_MARV_LED_OVER = 0x19,/* 16 bit r/w Manual LED Override Reg */ - PHY_MARV_EXT_CTRL_2 = 0x1a,/* 16 bit r/w Ext. PHY Specific Ctrl 2 */ - PHY_MARV_EXT_P_STAT = 0x1b,/* 16 bit r/w Ext. PHY Spec. Stat Reg */ - PHY_MARV_CABLE_DIAG = 0x1c,/* 16 bit r/o Cable Diagnostic Reg */ - PHY_MARV_PAGE_ADDR = 0x1d,/* 16 bit r/w Extended Page Address Reg */ - PHY_MARV_PAGE_DATA = 0x1e,/* 16 bit r/w Extended Page Data Reg */ - -/* for 10/100 Fast Ethernet PHY (88E3082 only) */ - PHY_MARV_FE_LED_PAR = 0x16,/* 16 bit r/w LED Parallel Select Reg. */ - PHY_MARV_FE_LED_SER = 0x17,/* 16 bit r/w LED Stream Select S. LED */ - PHY_MARV_FE_VCT_TX = 0x1a,/* 16 bit r/w VCT Reg. for TXP/N Pins */ - PHY_MARV_FE_VCT_RX = 0x1b,/* 16 bit r/o VCT Reg. for RXP/N Pins */ - PHY_MARV_FE_SPEC_2 = 0x1c,/* 16 bit r/w Specific Control Reg. 2 */ -}; - -enum { - PHY_CT_RESET = 1<<15, /* Bit 15: (sc) clear all PHY related regs */ - PHY_CT_LOOP = 1<<14, /* Bit 14: enable Loopback over PHY */ - PHY_CT_SPS_LSB = 1<<13, /* Bit 13: Speed select, lower bit */ - PHY_CT_ANE = 1<<12, /* Bit 12: Auto-Negotiation Enabled */ - PHY_CT_PDOWN = 1<<11, /* Bit 11: Power Down Mode */ - PHY_CT_ISOL = 1<<10, /* Bit 10: Isolate Mode */ - PHY_CT_RE_CFG = 1<<9, /* Bit 9: (sc) Restart Auto-Negotiation */ - PHY_CT_DUP_MD = 1<<8, /* Bit 8: Duplex Mode */ - PHY_CT_COL_TST = 1<<7, /* Bit 7: Collision Test enabled */ - PHY_CT_SPS_MSB = 1<<6, /* Bit 6: Speed select, upper bit */ -}; - -enum { - PHY_CT_SP1000 = PHY_CT_SPS_MSB, /* enable speed of 1000 Mbps */ - PHY_CT_SP100 = PHY_CT_SPS_LSB, /* enable speed of 100 Mbps */ - PHY_CT_SP10 = 0, /* enable speed of 10 Mbps */ -}; - -enum { - PHY_ST_EXT_ST = 1<<8, /* Bit 8: Extended Status Present */ - - PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */ - PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */ - PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occured */ - PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */ - PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */ - PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */ - PHY_ST_EXT_REG = 1<<0, /* Bit 0: Extended Register available */ -}; - -enum { - PHY_I1_OUI_MSK = 0x3f<<10, /* Bit 15..10: Organization Unique ID */ - PHY_I1_MOD_NUM = 0x3f<<4, /* Bit 9.. 4: Model Number */ - PHY_I1_REV_MSK = 0xf, /* Bit 3.. 0: Revision Number */ -}; - -/* different Marvell PHY Ids */ -enum { - PHY_MARV_ID0_VAL= 0x0141, /* Marvell Unique Identifier */ - - PHY_BCOM_ID1_A1 = 0x6041, - PHY_BCOM_ID1_B2 = 0x6043, - PHY_BCOM_ID1_C0 = 0x6044, - PHY_BCOM_ID1_C5 = 0x6047, - - PHY_MARV_ID1_B0 = 0x0C23, /* Yukon (PHY 88E1011) */ - PHY_MARV_ID1_B2 = 0x0C25, /* Yukon-Plus (PHY 88E1011) */ - PHY_MARV_ID1_C2 = 0x0CC2, /* Yukon-EC (PHY 88E1111) */ - PHY_MARV_ID1_Y2 = 0x0C91, /* Yukon-2 (PHY 88E1112) */ -}; - -/* Advertisement register bits */ -enum { - PHY_AN_NXT_PG = 1<<15, /* Bit 15: Request Next Page */ - PHY_AN_ACK = 1<<14, /* Bit 14: (ro) Acknowledge Received */ - PHY_AN_RF = 1<<13, /* Bit 13: Remote Fault Bits */ - - PHY_AN_PAUSE_ASYM = 1<<11,/* Bit 11: Try for asymmetric */ - PHY_AN_PAUSE_CAP = 1<<10, /* Bit 10: Try for pause */ - PHY_AN_100BASE4 = 1<<9, /* Bit 9: Try for 100mbps 4k packets */ - PHY_AN_100FULL = 1<<8, /* Bit 8: Try for 100mbps full-duplex */ - PHY_AN_100HALF = 1<<7, /* Bit 7: Try for 100mbps half-duplex */ - PHY_AN_10FULL = 1<<6, /* Bit 6: Try for 10mbps full-duplex */ - PHY_AN_10HALF = 1<<5, /* Bit 5: Try for 10mbps half-duplex */ - PHY_AN_CSMA = 1<<0, /* Bit 0: Only selector supported */ - PHY_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ - PHY_AN_FULL = PHY_AN_100FULL | PHY_AN_10FULL | PHY_AN_CSMA, - PHY_AN_ALL = PHY_AN_10HALF | PHY_AN_10FULL | - PHY_AN_100HALF | PHY_AN_100FULL, -}; - -/***** PHY_BCOM_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ -/***** PHY_MARV_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ -enum { - PHY_B_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ - PHY_B_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ - PHY_B_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ - PHY_B_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */ - PHY_B_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */ - PHY_B_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */ - /* Bit 9..8: reserved */ - PHY_B_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ -}; - -/** Marvell-Specific */ -enum { - PHY_M_AN_NXT_PG = 1<<15, /* Request Next Page */ - PHY_M_AN_ACK = 1<<14, /* (ro) Acknowledge Received */ - PHY_M_AN_RF = 1<<13, /* Remote Fault */ - - PHY_M_AN_ASP = 1<<11, /* Asymmetric Pause */ - PHY_M_AN_PC = 1<<10, /* MAC Pause implemented */ - PHY_M_AN_100_T4 = 1<<9, /* Not cap. 100Base-T4 (always 0) */ - PHY_M_AN_100_FD = 1<<8, /* Advertise 100Base-TX Full Duplex */ - PHY_M_AN_100_HD = 1<<7, /* Advertise 100Base-TX Half Duplex */ - PHY_M_AN_10_FD = 1<<6, /* Advertise 10Base-TX Full Duplex */ - PHY_M_AN_10_HD = 1<<5, /* Advertise 10Base-TX Half Duplex */ - PHY_M_AN_SEL_MSK =0x1f<<4, /* Bit 4.. 0: Selector Field Mask */ -}; - -/* special defines for FIBER (88E1011S only) */ -enum { - PHY_M_AN_ASP_X = 1<<8, /* Asymmetric Pause */ - PHY_M_AN_PC_X = 1<<7, /* MAC Pause implemented */ - PHY_M_AN_1000X_AHD = 1<<6, /* Advertise 10000Base-X Half Duplex */ - PHY_M_AN_1000X_AFD = 1<<5, /* Advertise 10000Base-X Full Duplex */ -}; - -/* Pause Bits (PHY_M_AN_ASP_X and PHY_M_AN_PC_X) encoding */ -enum { - PHY_M_P_NO_PAUSE_X = 0<<7,/* Bit 8.. 7: no Pause Mode */ - PHY_M_P_SYM_MD_X = 1<<7, /* Bit 8.. 7: symmetric Pause Mode */ - PHY_M_P_ASYM_MD_X = 2<<7,/* Bit 8.. 7: asymmetric Pause Mode */ - PHY_M_P_BOTH_MD_X = 3<<7,/* Bit 8.. 7: both Pause Mode */ -}; - -/***** PHY_MARV_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ -enum { - PHY_M_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ - PHY_M_1000C_MSE = 1<<12, /* Manual Master/Slave Enable */ - PHY_M_1000C_MSC = 1<<11, /* M/S Configuration (1=Master) */ - PHY_M_1000C_MPD = 1<<10, /* Multi-Port Device */ - PHY_M_1000C_AFD = 1<<9, /* Advertise Full Duplex */ - PHY_M_1000C_AHD = 1<<8, /* Advertise Half Duplex */ -}; - -/***** PHY_MARV_PHY_CTRL 16 bit r/w PHY Specific Ctrl Reg *****/ -enum { - PHY_M_PC_TX_FFD_MSK = 3<<14,/* Bit 15..14: Tx FIFO Depth Mask */ - PHY_M_PC_RX_FFD_MSK = 3<<12,/* Bit 13..12: Rx FIFO Depth Mask */ - PHY_M_PC_ASS_CRS_TX = 1<<11, /* Assert CRS on Transmit */ - PHY_M_PC_FL_GOOD = 1<<10, /* Force Link Good */ - PHY_M_PC_EN_DET_MSK = 3<<8,/* Bit 9.. 8: Energy Detect Mask */ - PHY_M_PC_ENA_EXT_D = 1<<7, /* Enable Ext. Distance (10BT) */ - PHY_M_PC_MDIX_MSK = 3<<5,/* Bit 6.. 5: MDI/MDIX Config. Mask */ - PHY_M_PC_DIS_125CLK = 1<<4, /* Disable 125 CLK */ - PHY_M_PC_MAC_POW_UP = 1<<3, /* MAC Power up */ - PHY_M_PC_SQE_T_ENA = 1<<2, /* SQE Test Enabled */ - PHY_M_PC_POL_R_DIS = 1<<1, /* Polarity Reversal Disabled */ - PHY_M_PC_DIS_JABBER = 1<<0, /* Disable Jabber */ -}; - -enum { - PHY_M_PC_EN_DET = 2<<8, /* Energy Detect (Mode 1) */ - PHY_M_PC_EN_DET_PLUS = 3<<8, /* Energy Detect Plus (Mode 2) */ -}; - -#define PHY_M_PC_MDI_XMODE(x) (((x)<<5) & PHY_M_PC_MDIX_MSK) - -enum { - PHY_M_PC_MAN_MDI = 0, /* 00 = Manual MDI configuration */ - PHY_M_PC_MAN_MDIX = 1, /* 01 = Manual MDIX configuration */ - PHY_M_PC_ENA_AUTO = 3, /* 11 = Enable Automatic Crossover */ -}; - -/* for 10/100 Fast Ethernet PHY (88E3082 only) */ -enum { - PHY_M_PC_ENA_DTE_DT = 1<<15, /* Enable Data Terminal Equ. (DTE) Detect */ - PHY_M_PC_ENA_ENE_DT = 1<<14, /* Enable Energy Detect (sense & pulse) */ - PHY_M_PC_DIS_NLP_CK = 1<<13, /* Disable Normal Link Puls (NLP) Check */ - PHY_M_PC_ENA_LIP_NP = 1<<12, /* Enable Link Partner Next Page Reg. */ - PHY_M_PC_DIS_NLP_GN = 1<<11, /* Disable Normal Link Puls Generation */ - - PHY_M_PC_DIS_SCRAMB = 1<<9, /* Disable Scrambler */ - PHY_M_PC_DIS_FEFI = 1<<8, /* Disable Far End Fault Indic. (FEFI) */ - - PHY_M_PC_SH_TP_SEL = 1<<6, /* Shielded Twisted Pair Select */ - PHY_M_PC_RX_FD_MSK = 3<<2,/* Bit 3.. 2: Rx FIFO Depth Mask */ -}; - -/***** PHY_MARV_PHY_STAT 16 bit r/o PHY Specific Status Reg *****/ -enum { - PHY_M_PS_SPEED_MSK = 3<<14, /* Bit 15..14: Speed Mask */ - PHY_M_PS_SPEED_1000 = 1<<15, /* 10 = 1000 Mbps */ - PHY_M_PS_SPEED_100 = 1<<14, /* 01 = 100 Mbps */ - PHY_M_PS_SPEED_10 = 0, /* 00 = 10 Mbps */ - PHY_M_PS_FULL_DUP = 1<<13, /* Full Duplex */ - PHY_M_PS_PAGE_REC = 1<<12, /* Page Received */ - PHY_M_PS_SPDUP_RES = 1<<11, /* Speed & Duplex Resolved */ - PHY_M_PS_LINK_UP = 1<<10, /* Link Up */ - PHY_M_PS_CABLE_MSK = 7<<7, /* Bit 9.. 7: Cable Length Mask */ - PHY_M_PS_MDI_X_STAT = 1<<6, /* MDI Crossover Stat (1=MDIX) */ - PHY_M_PS_DOWNS_STAT = 1<<5, /* Downshift Status (1=downsh.) */ - PHY_M_PS_ENDET_STAT = 1<<4, /* Energy Detect Status (1=act) */ - PHY_M_PS_TX_P_EN = 1<<3, /* Tx Pause Enabled */ - PHY_M_PS_RX_P_EN = 1<<2, /* Rx Pause Enabled */ - PHY_M_PS_POL_REV = 1<<1, /* Polarity Reversed */ - PHY_M_PS_JABBER = 1<<0, /* Jabber */ -}; - -#define PHY_M_PS_PAUSE_MSK (PHY_M_PS_TX_P_EN | PHY_M_PS_RX_P_EN) - -/* for 10/100 Fast Ethernet PHY (88E3082 only) */ -enum { - PHY_M_PS_DTE_DETECT = 1<<15, /* Data Terminal Equipment (DTE) Detected */ - PHY_M_PS_RES_SPEED = 1<<14, /* Resolved Speed (1=100 Mbps, 0=10 Mbps */ -}; - -enum { - PHY_M_IS_AN_ERROR = 1<<15, /* Auto-Negotiation Error */ - PHY_M_IS_LSP_CHANGE = 1<<14, /* Link Speed Changed */ - PHY_M_IS_DUP_CHANGE = 1<<13, /* Duplex Mode Changed */ - PHY_M_IS_AN_PR = 1<<12, /* Page Received */ - PHY_M_IS_AN_COMPL = 1<<11, /* Auto-Negotiation Completed */ - PHY_M_IS_LST_CHANGE = 1<<10, /* Link Status Changed */ - PHY_M_IS_SYMB_ERROR = 1<<9, /* Symbol Error */ - PHY_M_IS_FALSE_CARR = 1<<8, /* False Carrier */ - PHY_M_IS_FIFO_ERROR = 1<<7, /* FIFO Overflow/Underrun Error */ - PHY_M_IS_MDI_CHANGE = 1<<6, /* MDI Crossover Changed */ - PHY_M_IS_DOWNSH_DET = 1<<5, /* Downshift Detected */ - PHY_M_IS_END_CHANGE = 1<<4, /* Energy Detect Changed */ - - PHY_M_IS_DTE_CHANGE = 1<<2, /* DTE Power Det. Status Changed */ - PHY_M_IS_POL_CHANGE = 1<<1, /* Polarity Changed */ - PHY_M_IS_JABBER = 1<<0, /* Jabber */ - - PHY_M_DEF_MSK = PHY_M_IS_LSP_CHANGE | PHY_M_IS_LST_CHANGE - | PHY_M_IS_FIFO_ERROR, - PHY_M_AN_MSK = PHY_M_IS_AN_ERROR | PHY_M_IS_AN_COMPL, -}; - - -/***** PHY_MARV_EXT_CTRL 16 bit r/w Ext. PHY Specific Ctrl *****/ -enum { - PHY_M_EC_ENA_BC_EXT = 1<<15, /* Enable Block Carr. Ext. (88E1111 only) */ - PHY_M_EC_ENA_LIN_LB = 1<<14, /* Enable Line Loopback (88E1111 only) */ - - PHY_M_EC_DIS_LINK_P = 1<<12, /* Disable Link Pulses (88E1111 only) */ - PHY_M_EC_M_DSC_MSK = 3<<10, /* Bit 11..10: Master Downshift Counter */ - /* (88E1011 only) */ - PHY_M_EC_S_DSC_MSK = 3<<8,/* Bit 9.. 8: Slave Downshift Counter */ - /* (88E1011 only) */ - PHY_M_EC_M_DSC_MSK2 = 7<<9,/* Bit 11.. 9: Master Downshift Counter */ - /* (88E1111 only) */ - PHY_M_EC_DOWN_S_ENA = 1<<8, /* Downshift Enable (88E1111 only) */ - /* !!! Errata in spec. (1 = disable) */ - PHY_M_EC_RX_TIM_CT = 1<<7, /* RGMII Rx Timing Control*/ - PHY_M_EC_MAC_S_MSK = 7<<4,/* Bit 6.. 4: Def. MAC interface speed */ - PHY_M_EC_FIB_AN_ENA = 1<<3, /* Fiber Auto-Neg. Enable (88E1011S only) */ - PHY_M_EC_DTE_D_ENA = 1<<2, /* DTE Detect Enable (88E1111 only) */ - PHY_M_EC_TX_TIM_CT = 1<<1, /* RGMII Tx Timing Control */ - PHY_M_EC_TRANS_DIS = 1<<0, /* Transmitter Disable (88E1111 only) */}; - -#define PHY_M_EC_M_DSC(x) ((x)<<10 & PHY_M_EC_M_DSC_MSK) - /* 00=1x; 01=2x; 10=3x; 11=4x */ -#define PHY_M_EC_S_DSC(x) ((x)<<8 & PHY_M_EC_S_DSC_MSK) - /* 00=dis; 01=1x; 10=2x; 11=3x */ -#define PHY_M_EC_DSC_2(x) ((x)<<9 & PHY_M_EC_M_DSC_MSK2) - /* 000=1x; 001=2x; 010=3x; 011=4x */ -#define PHY_M_EC_MAC_S(x) ((x)<<4 & PHY_M_EC_MAC_S_MSK) - /* 01X=0; 110=2.5; 111=25 (MHz) */ - -/* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */ -enum { - PHY_M_PC_DIS_LINK_Pa = 1<<15,/* Disable Link Pulses */ - PHY_M_PC_DSC_MSK = 7<<12,/* Bit 14..12: Downshift Counter */ - PHY_M_PC_DOWN_S_ENA = 1<<11,/* Downshift Enable */ -}; -/* !!! Errata in spec. (1 = disable) */ - -#define PHY_M_PC_DSC(x) (((x)<<12) & PHY_M_PC_DSC_MSK) - /* 100=5x; 101=6x; 110=7x; 111=8x */ -enum { - MAC_TX_CLK_0_MHZ = 2, - MAC_TX_CLK_2_5_MHZ = 6, - MAC_TX_CLK_25_MHZ = 7, -}; - -/***** PHY_MARV_LED_CTRL 16 bit r/w LED Control Reg *****/ -enum { - PHY_M_LEDC_DIS_LED = 1<<15, /* Disable LED */ - PHY_M_LEDC_PULS_MSK = 7<<12,/* Bit 14..12: Pulse Stretch Mask */ - PHY_M_LEDC_F_INT = 1<<11, /* Force Interrupt */ - PHY_M_LEDC_BL_R_MSK = 7<<8,/* Bit 10.. 8: Blink Rate Mask */ - PHY_M_LEDC_DP_C_LSB = 1<<7, /* Duplex Control (LSB, 88E1111 only) */ - PHY_M_LEDC_TX_C_LSB = 1<<6, /* Tx Control (LSB, 88E1111 only) */ - PHY_M_LEDC_LK_C_MSK = 7<<3,/* Bit 5.. 3: Link Control Mask */ - /* (88E1111 only) */ -}; - -enum { - PHY_M_LEDC_LINK_MSK = 3<<3,/* Bit 4.. 3: Link Control Mask */ - /* (88E1011 only) */ - PHY_M_LEDC_DP_CTRL = 1<<2, /* Duplex Control */ - PHY_M_LEDC_DP_C_MSB = 1<<2, /* Duplex Control (MSB, 88E1111 only) */ - PHY_M_LEDC_RX_CTRL = 1<<1, /* Rx Activity / Link */ - PHY_M_LEDC_TX_CTRL = 1<<0, /* Tx Activity / Link */ - PHY_M_LEDC_TX_C_MSB = 1<<0, /* Tx Control (MSB, 88E1111 only) */ -}; - -#define PHY_M_LED_PULS_DUR(x) (((x)<<12) & PHY_M_LEDC_PULS_MSK) - -/***** PHY_MARV_PHY_STAT (page 3)16 bit r/w Polarity Control Reg. *****/ -enum { - PHY_M_POLC_LS1M_MSK = 0xf<<12, /* Bit 15..12: LOS,STAT1 Mix % Mask */ - PHY_M_POLC_IS0M_MSK = 0xf<<8, /* Bit 11.. 8: INIT,STAT0 Mix % Mask */ - PHY_M_POLC_LOS_MSK = 0x3<<6, /* Bit 7.. 6: LOS Pol. Ctrl. Mask */ - PHY_M_POLC_INIT_MSK = 0x3<<4, /* Bit 5.. 4: INIT Pol. Ctrl. Mask */ - PHY_M_POLC_STA1_MSK = 0x3<<2, /* Bit 3.. 2: STAT1 Pol. Ctrl. Mask */ - PHY_M_POLC_STA0_MSK = 0x3, /* Bit 1.. 0: STAT0 Pol. Ctrl. Mask */ -}; - -#define PHY_M_POLC_LS1_P_MIX(x) (((x)<<12) & PHY_M_POLC_LS1M_MSK) -#define PHY_M_POLC_IS0_P_MIX(x) (((x)<<8) & PHY_M_POLC_IS0M_MSK) -#define PHY_M_POLC_LOS_CTRL(x) (((x)<<6) & PHY_M_POLC_LOS_MSK) -#define PHY_M_POLC_INIT_CTRL(x) (((x)<<4) & PHY_M_POLC_INIT_MSK) -#define PHY_M_POLC_STA1_CTRL(x) (((x)<<2) & PHY_M_POLC_STA1_MSK) -#define PHY_M_POLC_STA0_CTRL(x) (((x)<<0) & PHY_M_POLC_STA0_MSK) - -enum { - PULS_NO_STR = 0,/* no pulse stretching */ - PULS_21MS = 1,/* 21 ms to 42 ms */ - PULS_42MS = 2,/* 42 ms to 84 ms */ - PULS_84MS = 3,/* 84 ms to 170 ms */ - PULS_170MS = 4,/* 170 ms to 340 ms */ - PULS_340MS = 5,/* 340 ms to 670 ms */ - PULS_670MS = 6,/* 670 ms to 1.3 s */ - PULS_1300MS = 7,/* 1.3 s to 2.7 s */ -}; - -#define PHY_M_LED_BLINK_RT(x) (((x)<<8) & PHY_M_LEDC_BL_R_MSK) - -enum { - BLINK_42MS = 0,/* 42 ms */ - BLINK_84MS = 1,/* 84 ms */ - BLINK_170MS = 2,/* 170 ms */ - BLINK_340MS = 3,/* 340 ms */ - BLINK_670MS = 4,/* 670 ms */ -}; - -/***** PHY_MARV_LED_OVER 16 bit r/w Manual LED Override Reg *****/ -#define PHY_M_LED_MO_SGMII(x) ((x)<<14) /* Bit 15..14: SGMII AN Timer */ - /* Bit 13..12: reserved */ -#define PHY_M_LED_MO_DUP(x) ((x)<<10) /* Bit 11..10: Duplex */ -#define PHY_M_LED_MO_10(x) ((x)<<8) /* Bit 9.. 8: Link 10 */ -#define PHY_M_LED_MO_100(x) ((x)<<6) /* Bit 7.. 6: Link 100 */ -#define PHY_M_LED_MO_1000(x) ((x)<<4) /* Bit 5.. 4: Link 1000 */ -#define PHY_M_LED_MO_RX(x) ((x)<<2) /* Bit 3.. 2: Rx */ -#define PHY_M_LED_MO_TX(x) ((x)<<0) /* Bit 1.. 0: Tx */ - -enum { - MO_LED_NORM = 0, - MO_LED_BLINK = 1, - MO_LED_OFF = 2, - MO_LED_ON = 3, -}; - -/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/ -enum { - PHY_M_EC2_FI_IMPED = 1<<6, /* Fiber Input Impedance */ - PHY_M_EC2_FO_IMPED = 1<<5, /* Fiber Output Impedance */ - PHY_M_EC2_FO_M_CLK = 1<<4, /* Fiber Mode Clock Enable */ - PHY_M_EC2_FO_BOOST = 1<<3, /* Fiber Output Boost */ - PHY_M_EC2_FO_AM_MSK = 7,/* Bit 2.. 0: Fiber Output Amplitude */ -}; - -/***** PHY_MARV_EXT_P_STAT 16 bit r/w Ext. PHY Specific Status *****/ -enum { - PHY_M_FC_AUTO_SEL = 1<<15, /* Fiber/Copper Auto Sel. Dis. */ - PHY_M_FC_AN_REG_ACC = 1<<14, /* Fiber/Copper AN Reg. Access */ - PHY_M_FC_RESOLUTION = 1<<13, /* Fiber/Copper Resolution */ - PHY_M_SER_IF_AN_BP = 1<<12, /* Ser. IF AN Bypass Enable */ - PHY_M_SER_IF_BP_ST = 1<<11, /* Ser. IF AN Bypass Status */ - PHY_M_IRQ_POLARITY = 1<<10, /* IRQ polarity */ - PHY_M_DIS_AUT_MED = 1<<9, /* Disable Aut. Medium Reg. Selection */ - /* (88E1111 only) */ - - PHY_M_UNDOC1 = 1<<7, /* undocumented bit !! */ - PHY_M_DTE_POW_STAT = 1<<4, /* DTE Power Status (88E1111 only) */ - PHY_M_MODE_MASK = 0xf, /* Bit 3.. 0: copy of HWCFG MODE[3:0] */ -}; - -/* for 10/100 Fast Ethernet PHY (88E3082 only) */ -/***** PHY_MARV_FE_LED_PAR 16 bit r/w LED Parallel Select Reg. *****/ - /* Bit 15..12: reserved (used internally) */ -enum { - PHY_M_FELP_LED2_MSK = 0xf<<8, /* Bit 11.. 8: LED2 Mask (LINK) */ - PHY_M_FELP_LED1_MSK = 0xf<<4, /* Bit 7.. 4: LED1 Mask (ACT) */ - PHY_M_FELP_LED0_MSK = 0xf, /* Bit 3.. 0: LED0 Mask (SPEED) */ -}; - -#define PHY_M_FELP_LED2_CTRL(x) (((x)<<8) & PHY_M_FELP_LED2_MSK) -#define PHY_M_FELP_LED1_CTRL(x) (((x)<<4) & PHY_M_FELP_LED1_MSK) -#define PHY_M_FELP_LED0_CTRL(x) (((x)<<0) & PHY_M_FELP_LED0_MSK) - -enum { - LED_PAR_CTRL_COLX = 0x00, - LED_PAR_CTRL_ERROR = 0x01, - LED_PAR_CTRL_DUPLEX = 0x02, - LED_PAR_CTRL_DP_COL = 0x03, - LED_PAR_CTRL_SPEED = 0x04, - LED_PAR_CTRL_LINK = 0x05, - LED_PAR_CTRL_TX = 0x06, - LED_PAR_CTRL_RX = 0x07, - LED_PAR_CTRL_ACT = 0x08, - LED_PAR_CTRL_LNK_RX = 0x09, - LED_PAR_CTRL_LNK_AC = 0x0a, - LED_PAR_CTRL_ACT_BL = 0x0b, - LED_PAR_CTRL_TX_BL = 0x0c, - LED_PAR_CTRL_RX_BL = 0x0d, - LED_PAR_CTRL_COL_BL = 0x0e, - LED_PAR_CTRL_INACT = 0x0f -}; - -/*****,PHY_MARV_FE_SPEC_2 16 bit r/w Specific Control Reg. 2 *****/ -enum { - PHY_M_FESC_DIS_WAIT = 1<<2, /* Disable TDR Waiting Period */ - PHY_M_FESC_ENA_MCLK = 1<<1, /* Enable MAC Rx Clock in sleep mode */ - PHY_M_FESC_SEL_CL_A = 1<<0, /* Select Class A driver (100B-TX) */ -}; - -/* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */ -/***** PHY_MARV_PHY_CTRL (page 2) 16 bit r/w MAC Specific Ctrl *****/ -enum { - PHY_M_MAC_MD_MSK = 7<<7, /* Bit 9.. 7: Mode Select Mask */ - PHY_M_MAC_MD_AUTO = 3,/* Auto Copper/1000Base-X */ - PHY_M_MAC_MD_COPPER = 5,/* Copper only */ - PHY_M_MAC_MD_1000BX = 7,/* 1000Base-X only */ -}; -#define PHY_M_MAC_MODE_SEL(x) (((x)<<7) & PHY_M_MAC_MD_MSK) - -/***** PHY_MARV_PHY_CTRL (page 3) 16 bit r/w LED Control Reg. *****/ -enum { - PHY_M_LEDC_LOS_MSK = 0xf<<12,/* Bit 15..12: LOS LED Ctrl. Mask */ - PHY_M_LEDC_INIT_MSK = 0xf<<8, /* Bit 11.. 8: INIT LED Ctrl. Mask */ - PHY_M_LEDC_STA1_MSK = 0xf<<4,/* Bit 7.. 4: STAT1 LED Ctrl. Mask */ - PHY_M_LEDC_STA0_MSK = 0xf, /* Bit 3.. 0: STAT0 LED Ctrl. Mask */ -}; - -#define PHY_M_LEDC_LOS_CTRL(x) (((x)<<12) & PHY_M_LEDC_LOS_MSK) -#define PHY_M_LEDC_INIT_CTRL(x) (((x)<<8) & PHY_M_LEDC_INIT_MSK) -#define PHY_M_LEDC_STA1_CTRL(x) (((x)<<4) & PHY_M_LEDC_STA1_MSK) -#define PHY_M_LEDC_STA0_CTRL(x) (((x)<<0) & PHY_M_LEDC_STA0_MSK) - -/* GMAC registers */ -/* Port Registers */ -enum { - GM_GP_STAT = 0x0000, /* 16 bit r/o General Purpose Status */ - GM_GP_CTRL = 0x0004, /* 16 bit r/w General Purpose Control */ - GM_TX_CTRL = 0x0008, /* 16 bit r/w Transmit Control Reg. */ - GM_RX_CTRL = 0x000c, /* 16 bit r/w Receive Control Reg. */ - GM_TX_FLOW_CTRL = 0x0010, /* 16 bit r/w Transmit Flow-Control */ - GM_TX_PARAM = 0x0014, /* 16 bit r/w Transmit Parameter Reg. */ - GM_SERIAL_MODE = 0x0018, /* 16 bit r/w Serial Mode Register */ -/* Source Address Registers */ - GM_SRC_ADDR_1L = 0x001c, /* 16 bit r/w Source Address 1 (low) */ - GM_SRC_ADDR_1M = 0x0020, /* 16 bit r/w Source Address 1 (middle) */ - GM_SRC_ADDR_1H = 0x0024, /* 16 bit r/w Source Address 1 (high) */ - GM_SRC_ADDR_2L = 0x0028, /* 16 bit r/w Source Address 2 (low) */ - GM_SRC_ADDR_2M = 0x002c, /* 16 bit r/w Source Address 2 (middle) */ - GM_SRC_ADDR_2H = 0x0030, /* 16 bit r/w Source Address 2 (high) */ - -/* Multicast Address Hash Registers */ - GM_MC_ADDR_H1 = 0x0034, /* 16 bit r/w Multicast Address Hash 1 */ - GM_MC_ADDR_H2 = 0x0038, /* 16 bit r/w Multicast Address Hash 2 */ - GM_MC_ADDR_H3 = 0x003c, /* 16 bit r/w Multicast Address Hash 3 */ - GM_MC_ADDR_H4 = 0x0040, /* 16 bit r/w Multicast Address Hash 4 */ - -/* Interrupt Source Registers */ - GM_TX_IRQ_SRC = 0x0044, /* 16 bit r/o Tx Overflow IRQ Source */ - GM_RX_IRQ_SRC = 0x0048, /* 16 bit r/o Rx Overflow IRQ Source */ - GM_TR_IRQ_SRC = 0x004c, /* 16 bit r/o Tx/Rx Over. IRQ Source */ - -/* Interrupt Mask Registers */ - GM_TX_IRQ_MSK = 0x0050, /* 16 bit r/w Tx Overflow IRQ Mask */ - GM_RX_IRQ_MSK = 0x0054, /* 16 bit r/w Rx Overflow IRQ Mask */ - GM_TR_IRQ_MSK = 0x0058, /* 16 bit r/w Tx/Rx Over. IRQ Mask */ - -/* Serial Management Interface (SMI) Registers */ - GM_SMI_CTRL = 0x0080, /* 16 bit r/w SMI Control Register */ - GM_SMI_DATA = 0x0084, /* 16 bit r/w SMI Data Register */ - GM_PHY_ADDR = 0x0088, /* 16 bit r/w GPHY Address Register */ -}; - -/* MIB Counters */ -#define GM_MIB_CNT_BASE 0x0100 /* Base Address of MIB Counters */ -#define GM_MIB_CNT_SIZE 44 /* Number of MIB Counters */ - -/* - * MIB Counters base address definitions (low word) - - * use offset 4 for access to high word (32 bit r/o) - */ -enum { - GM_RXF_UC_OK = GM_MIB_CNT_BASE + 0, /* Unicast Frames Received OK */ - GM_RXF_BC_OK = GM_MIB_CNT_BASE + 8, /* Broadcast Frames Received OK */ - GM_RXF_MPAUSE = GM_MIB_CNT_BASE + 16, /* Pause MAC Ctrl Frames Received */ - GM_RXF_MC_OK = GM_MIB_CNT_BASE + 24, /* Multicast Frames Received OK */ - GM_RXF_FCS_ERR = GM_MIB_CNT_BASE + 32, /* Rx Frame Check Seq. Error */ - /* GM_MIB_CNT_BASE + 40: reserved */ - GM_RXO_OK_LO = GM_MIB_CNT_BASE + 48, /* Octets Received OK Low */ - GM_RXO_OK_HI = GM_MIB_CNT_BASE + 56, /* Octets Received OK High */ - GM_RXO_ERR_LO = GM_MIB_CNT_BASE + 64, /* Octets Received Invalid Low */ - GM_RXO_ERR_HI = GM_MIB_CNT_BASE + 72, /* Octets Received Invalid High */ - GM_RXF_SHT = GM_MIB_CNT_BASE + 80, /* Frames <64 Byte Received OK */ - GM_RXE_FRAG = GM_MIB_CNT_BASE + 88, /* Frames <64 Byte Received with FCS Err */ - GM_RXF_64B = GM_MIB_CNT_BASE + 96, /* 64 Byte Rx Frame */ - GM_RXF_127B = GM_MIB_CNT_BASE + 104, /* 65-127 Byte Rx Frame */ - GM_RXF_255B = GM_MIB_CNT_BASE + 112, /* 128-255 Byte Rx Frame */ - GM_RXF_511B = GM_MIB_CNT_BASE + 120, /* 256-511 Byte Rx Frame */ - GM_RXF_1023B = GM_MIB_CNT_BASE + 128, /* 512-1023 Byte Rx Frame */ - GM_RXF_1518B = GM_MIB_CNT_BASE + 136, /* 1024-1518 Byte Rx Frame */ - GM_RXF_MAX_SZ = GM_MIB_CNT_BASE + 144, /* 1519-MaxSize Byte Rx Frame */ - GM_RXF_LNG_ERR = GM_MIB_CNT_BASE + 152, /* Rx Frame too Long Error */ - GM_RXF_JAB_PKT = GM_MIB_CNT_BASE + 160, /* Rx Jabber Packet Frame */ - /* GM_MIB_CNT_BASE + 168: reserved */ - GM_RXE_FIFO_OV = GM_MIB_CNT_BASE + 176, /* Rx FIFO overflow Event */ - /* GM_MIB_CNT_BASE + 184: reserved */ - GM_TXF_UC_OK = GM_MIB_CNT_BASE + 192, /* Unicast Frames Xmitted OK */ - GM_TXF_BC_OK = GM_MIB_CNT_BASE + 200, /* Broadcast Frames Xmitted OK */ - GM_TXF_MPAUSE = GM_MIB_CNT_BASE + 208, /* Pause MAC Ctrl Frames Xmitted */ - GM_TXF_MC_OK = GM_MIB_CNT_BASE + 216, /* Multicast Frames Xmitted OK */ - GM_TXO_OK_LO = GM_MIB_CNT_BASE + 224, /* Octets Transmitted OK Low */ - GM_TXO_OK_HI = GM_MIB_CNT_BASE + 232, /* Octets Transmitted OK High */ - GM_TXF_64B = GM_MIB_CNT_BASE + 240, /* 64 Byte Tx Frame */ - GM_TXF_127B = GM_MIB_CNT_BASE + 248, /* 65-127 Byte Tx Frame */ - GM_TXF_255B = GM_MIB_CNT_BASE + 256, /* 128-255 Byte Tx Frame */ - GM_TXF_511B = GM_MIB_CNT_BASE + 264, /* 256-511 Byte Tx Frame */ - GM_TXF_1023B = GM_MIB_CNT_BASE + 272, /* 512-1023 Byte Tx Frame */ - GM_TXF_1518B = GM_MIB_CNT_BASE + 280, /* 1024-1518 Byte Tx Frame */ - GM_TXF_MAX_SZ = GM_MIB_CNT_BASE + 288, /* 1519-MaxSize Byte Tx Frame */ - - GM_TXF_COL = GM_MIB_CNT_BASE + 304, /* Tx Collision */ - GM_TXF_LAT_COL = GM_MIB_CNT_BASE + 312, /* Tx Late Collision */ - GM_TXF_ABO_COL = GM_MIB_CNT_BASE + 320, /* Tx aborted due to Exces. Col. */ - GM_TXF_MUL_COL = GM_MIB_CNT_BASE + 328, /* Tx Multiple Collision */ - GM_TXF_SNG_COL = GM_MIB_CNT_BASE + 336, /* Tx Single Collision */ - GM_TXE_FIFO_UR = GM_MIB_CNT_BASE + 344, /* Tx FIFO Underrun Event */ -}; - -/* GMAC Bit Definitions */ -/* GM_GP_STAT 16 bit r/o General Purpose Status Register */ -enum { - GM_GPSR_SPEED = 1<<15, /* Bit 15: Port Speed (1 = 100 Mbps) */ - GM_GPSR_DUPLEX = 1<<14, /* Bit 14: Duplex Mode (1 = Full) */ - GM_GPSR_FC_TX_DIS = 1<<13, /* Bit 13: Tx Flow-Control Mode Disabled */ - GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */ - GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */ - GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */ - GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occured */ - GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occured */ - - GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */ - GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */ - GM_GPSR_PART_MODE = 1<<3, /* Bit 3: Partition mode */ - GM_GPSR_FC_RX_DIS = 1<<2, /* Bit 2: Rx Flow-Control Mode Disabled */ - GM_GPSR_PROM_EN = 1<<1, /* Bit 1: Promiscuous Mode Enabled */ -}; - -/* GM_GP_CTRL 16 bit r/w General Purpose Control Register */ -enum { - GM_GPCR_PROM_ENA = 1<<14, /* Bit 14: Enable Promiscuous Mode */ - GM_GPCR_FC_TX_DIS = 1<<13, /* Bit 13: Disable Tx Flow-Control Mode */ - GM_GPCR_TX_ENA = 1<<12, /* Bit 12: Enable Transmit */ - GM_GPCR_RX_ENA = 1<<11, /* Bit 11: Enable Receive */ - GM_GPCR_BURST_ENA = 1<<10, /* Bit 10: Enable Burst Mode */ - GM_GPCR_LOOP_ENA = 1<<9, /* Bit 9: Enable MAC Loopback Mode */ - GM_GPCR_PART_ENA = 1<<8, /* Bit 8: Enable Partition Mode */ - GM_GPCR_GIGS_ENA = 1<<7, /* Bit 7: Gigabit Speed (1000 Mbps) */ - GM_GPCR_FL_PASS = 1<<6, /* Bit 6: Force Link Pass */ - GM_GPCR_DUP_FULL = 1<<5, /* Bit 5: Full Duplex Mode */ - GM_GPCR_FC_RX_DIS = 1<<4, /* Bit 4: Disable Rx Flow-Control Mode */ - GM_GPCR_SPEED_100 = 1<<3, /* Bit 3: Port Speed 100 Mbps */ - GM_GPCR_AU_DUP_DIS = 1<<2, /* Bit 2: Disable Auto-Update Duplex */ - GM_GPCR_AU_FCT_DIS = 1<<1, /* Bit 1: Disable Auto-Update Flow-C. */ - GM_GPCR_AU_SPD_DIS = 1<<0, /* Bit 0: Disable Auto-Update Speed */ -}; - -#define GM_GPCR_SPEED_1000 (GM_GPCR_GIGS_ENA | GM_GPCR_SPEED_100) -#define GM_GPCR_AU_ALL_DIS (GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_FCT_DIS|GM_GPCR_AU_SPD_DIS) - -/* GM_TX_CTRL 16 bit r/w Transmit Control Register */ -enum { - GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */ - GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */ - GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */ - GM_TXCR_COL_THR_MSK = 1<<10, /* Bit 12..10: Collision Threshold */ -}; - -#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK) -#define TX_COL_DEF 0x04 - -/* GM_RX_CTRL 16 bit r/w Receive Control Register */ -enum { - GM_RXCR_UCF_ENA = 1<<15, /* Bit 15: Enable Unicast filtering */ - GM_RXCR_MCF_ENA = 1<<14, /* Bit 14: Enable Multicast filtering */ - GM_RXCR_CRC_DIS = 1<<13, /* Bit 13: Remove 4-byte CRC */ - GM_RXCR_PASS_FC = 1<<12, /* Bit 12: Pass FC packets to FIFO */ -}; - -/* GM_TX_PARAM 16 bit r/w Transmit Parameter Register */ -enum { - GM_TXPA_JAMLEN_MSK = 0x03<<14, /* Bit 15..14: Jam Length */ - GM_TXPA_JAMIPG_MSK = 0x1f<<9, /* Bit 13..9: Jam IPG */ - GM_TXPA_JAMDAT_MSK = 0x1f<<4, /* Bit 8..4: IPG Jam to Data */ - GM_TXPA_BO_LIM_MSK = 0x0f, /* Bit 3.. 0: Backoff Limit Mask */ - - TX_JAM_LEN_DEF = 0x03, - TX_JAM_IPG_DEF = 0x0b, - TX_IPG_JAM_DEF = 0x1c, - TX_BOF_LIM_DEF = 0x04, -}; - -#define TX_JAM_LEN_VAL(x) (((x)<<14) & GM_TXPA_JAMLEN_MSK) -#define TX_JAM_IPG_VAL(x) (((x)<<9) & GM_TXPA_JAMIPG_MSK) -#define TX_IPG_JAM_DATA(x) (((x)<<4) & GM_TXPA_JAMDAT_MSK) -#define TX_BACK_OFF_LIM(x) ((x) & GM_TXPA_BO_LIM_MSK) - - -/* GM_SERIAL_MODE 16 bit r/w Serial Mode Register */ -enum { - GM_SMOD_DATABL_MSK = 0x1f<<11, /* Bit 15..11: Data Blinder (r/o) */ - GM_SMOD_LIMIT_4 = 1<<10, /* Bit 10: 4 consecutive Tx trials */ - GM_SMOD_VLAN_ENA = 1<<9, /* Bit 9: Enable VLAN (Max. Frame Len) */ - GM_SMOD_JUMBO_ENA = 1<<8, /* Bit 8: Enable Jumbo (Max. Frame Len) */ - GM_SMOD_IPG_MSK = 0x1f /* Bit 4..0: Inter-Packet Gap (IPG) */ -}; - -#define DATA_BLIND_VAL(x) (((x)<<11) & GM_SMOD_DATABL_MSK) -#define DATA_BLIND_DEF 0x04 - -#define IPG_DATA_VAL(x) (x & GM_SMOD_IPG_MSK) -#define IPG_DATA_DEF 0x1e - -/* GM_SMI_CTRL 16 bit r/w SMI Control Register */ -enum { - GM_SMI_CT_PHY_A_MSK = 0x1f<<11,/* Bit 15..11: PHY Device Address */ - GM_SMI_CT_REG_A_MSK = 0x1f<<6,/* Bit 10.. 6: PHY Register Address */ - GM_SMI_CT_OP_RD = 1<<5, /* Bit 5: OpCode Read (0=Write)*/ - GM_SMI_CT_RD_VAL = 1<<4, /* Bit 4: Read Valid (Read completed) */ - GM_SMI_CT_BUSY = 1<<3, /* Bit 3: Busy (Operation in progress) */ -}; - -#define GM_SMI_CT_PHY_AD(x) (((x)<<11) & GM_SMI_CT_PHY_A_MSK) -#define GM_SMI_CT_REG_AD(x) (((x)<<6) & GM_SMI_CT_REG_A_MSK) - -/* GM_PHY_ADDR 16 bit r/w GPHY Address Register */ -enum { - GM_PAR_MIB_CLR = 1<<5, /* Bit 5: Set MIB Clear Counter Mode */ - GM_PAR_MIB_TST = 1<<4, /* Bit 4: MIB Load Counter (Test Mode) */ -}; - -/* Receive Frame Status Encoding */ -enum { - GMR_FS_LEN = 0xffff<<16, /* Bit 31..16: Rx Frame Length */ - GMR_FS_VLAN = 1<<13, /* VLAN Packet */ - GMR_FS_JABBER = 1<<12, /* Jabber Packet */ - GMR_FS_UN_SIZE = 1<<11, /* Undersize Packet */ - GMR_FS_MC = 1<<10, /* Multicast Packet */ - GMR_FS_BC = 1<<9, /* Broadcast Packet */ - GMR_FS_RX_OK = 1<<8, /* Receive OK (Good Packet) */ - GMR_FS_GOOD_FC = 1<<7, /* Good Flow-Control Packet */ - GMR_FS_BAD_FC = 1<<6, /* Bad Flow-Control Packet */ - GMR_FS_MII_ERR = 1<<5, /* MII Error */ - GMR_FS_LONG_ERR = 1<<4, /* Too Long Packet */ - GMR_FS_FRAGMENT = 1<<3, /* Fragment */ - - GMR_FS_CRC_ERR = 1<<1, /* CRC Error */ - GMR_FS_RX_FF_OV = 1<<0, /* Rx FIFO Overflow */ - - GMR_FS_ANY_ERR = GMR_FS_RX_FF_OV | GMR_FS_CRC_ERR | - GMR_FS_FRAGMENT | GMR_FS_LONG_ERR | - GMR_FS_MII_ERR | GMR_FS_BAD_FC | GMR_FS_GOOD_FC | - GMR_FS_UN_SIZE | GMR_FS_JABBER, -}; - -/* RX_GMF_CTRL_T 32 bit Rx GMAC FIFO Control/Test */ -enum { - RX_TRUNC_ON = 1<<27, /* enable packet truncation */ - RX_TRUNC_OFF = 1<<26, /* disable packet truncation */ - RX_VLAN_STRIP_ON = 1<<25, /* enable VLAN stripping */ - RX_VLAN_STRIP_OFF = 1<<24, /* disable VLAN stripping */ - - GMF_WP_TST_ON = 1<<14, /* Write Pointer Test On */ - GMF_WP_TST_OFF = 1<<13, /* Write Pointer Test Off */ - GMF_WP_STEP = 1<<12, /* Write Pointer Step/Increment */ - - GMF_RP_TST_ON = 1<<10, /* Read Pointer Test On */ - GMF_RP_TST_OFF = 1<<9, /* Read Pointer Test Off */ - GMF_RP_STEP = 1<<8, /* Read Pointer Step/Increment */ - GMF_RX_F_FL_ON = 1<<7, /* Rx FIFO Flush Mode On */ - GMF_RX_F_FL_OFF = 1<<6, /* Rx FIFO Flush Mode Off */ - GMF_CLI_RX_FO = 1<<5, /* Clear IRQ Rx FIFO Overrun */ - GMF_CLI_RX_C = 1<<4, /* Clear IRQ Rx Frame Complete */ - - GMF_OPER_ON = 1<<3, /* Operational Mode On */ - GMF_OPER_OFF = 1<<2, /* Operational Mode Off */ - GMF_RST_CLR = 1<<1, /* Clear GMAC FIFO Reset */ - GMF_RST_SET = 1<<0, /* Set GMAC FIFO Reset */ - - RX_GMF_FL_THR_DEF = 0xa, /* flush threshold (default) */ - - GMF_RX_CTRL_DEF = GMF_OPER_ON | GMF_RX_F_FL_ON, -}; - - -/* TX_GMF_CTRL_T 32 bit Tx GMAC FIFO Control/Test */ -enum { - TX_STFW_DIS = 1<<31,/* Disable Store & Forward (Yukon-EC Ultra) */ - TX_STFW_ENA = 1<<30,/* Enable Store & Forward (Yukon-EC Ultra) */ - - TX_VLAN_TAG_ON = 1<<25,/* enable VLAN tagging */ - TX_VLAN_TAG_OFF = 1<<24,/* disable VLAN tagging */ - - GMF_WSP_TST_ON = 1<<18,/* Write Shadow Pointer Test On */ - GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */ - GMF_WSP_STEP = 1<<16,/* Write Shadow Pointer Step/Increment */ - - GMF_CLI_TX_FU = 1<<6, /* Clear IRQ Tx FIFO Underrun */ - GMF_CLI_TX_FC = 1<<5, /* Clear IRQ Tx Frame Complete */ - GMF_CLI_TX_PE = 1<<4, /* Clear IRQ Tx Parity Error */ -}; - -/* GMAC_TI_ST_CTRL 8 bit Time Stamp Timer Ctrl Reg (YUKON only) */ -enum { - GMT_ST_START = 1<<2, /* Start Time Stamp Timer */ - GMT_ST_STOP = 1<<1, /* Stop Time Stamp Timer */ - GMT_ST_CLR_IRQ = 1<<0, /* Clear Time Stamp Timer IRQ */ -}; - -/* B28_Y2_ASF_STAT_CMD 32 bit ASF Status and Command Reg */ -enum { - Y2_ASF_OS_PRES = 1<<4, /* ASF operation system present */ - Y2_ASF_RESET = 1<<3, /* ASF system in reset state */ - Y2_ASF_RUNNING = 1<<2, /* ASF system operational */ - Y2_ASF_CLR_HSTI = 1<<1, /* Clear ASF IRQ */ - Y2_ASF_IRQ = 1<<0, /* Issue an IRQ to ASF system */ - - Y2_ASF_UC_STATE = 3<<2, /* ASF uC State */ - Y2_ASF_CLK_HALT = 0, /* ASF system clock stopped */ -}; - -/* B28_Y2_ASF_HOST_COM 32 bit ASF Host Communication Reg */ -enum { - Y2_ASF_CLR_ASFI = 1<<1, /* Clear host IRQ */ - Y2_ASF_HOST_IRQ = 1<<0, /* Issue an IRQ to HOST system */ -}; - -/* STAT_CTRL 32 bit Status BMU control register (Yukon-2 only) */ -enum { - SC_STAT_CLR_IRQ = 1<<4, /* Status Burst IRQ clear */ - SC_STAT_OP_ON = 1<<3, /* Operational Mode On */ - SC_STAT_OP_OFF = 1<<2, /* Operational Mode Off */ - SC_STAT_RST_CLR = 1<<1, /* Clear Status Unit Reset (Enable) */ - SC_STAT_RST_SET = 1<<0, /* Set Status Unit Reset */ -}; - -/* GMAC_CTRL 32 bit GMAC Control Reg (YUKON only) */ -enum { - GMC_H_BURST_ON = 1<<7, /* Half Duplex Burst Mode On */ - GMC_H_BURST_OFF = 1<<6, /* Half Duplex Burst Mode Off */ - GMC_F_LOOPB_ON = 1<<5, /* FIFO Loopback On */ - GMC_F_LOOPB_OFF = 1<<4, /* FIFO Loopback Off */ - GMC_PAUSE_ON = 1<<3, /* Pause On */ - GMC_PAUSE_OFF = 1<<2, /* Pause Off */ - GMC_RST_CLR = 1<<1, /* Clear GMAC Reset */ - GMC_RST_SET = 1<<0, /* Set GMAC Reset */ -}; - -/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */ -enum { - GPC_SEL_BDT = 1<<28, /* Select Bi-Dir. Transfer for MDC/MDIO */ - GPC_INT_POL_HI = 1<<27, /* IRQ Polarity is Active HIGH */ - GPC_75_OHM = 1<<26, /* Use 75 Ohm Termination instead of 50 */ - GPC_DIS_FC = 1<<25, /* Disable Automatic Fiber/Copper Detection */ - GPC_DIS_SLEEP = 1<<24, /* Disable Energy Detect */ - GPC_HWCFG_M_3 = 1<<23, /* HWCFG_MODE[3] */ - GPC_HWCFG_M_2 = 1<<22, /* HWCFG_MODE[2] */ - GPC_HWCFG_M_1 = 1<<21, /* HWCFG_MODE[1] */ - GPC_HWCFG_M_0 = 1<<20, /* HWCFG_MODE[0] */ - GPC_ANEG_0 = 1<<19, /* ANEG[0] */ - GPC_ENA_XC = 1<<18, /* Enable MDI crossover */ - GPC_DIS_125 = 1<<17, /* Disable 125 MHz clock */ - GPC_ANEG_3 = 1<<16, /* ANEG[3] */ - GPC_ANEG_2 = 1<<15, /* ANEG[2] */ - GPC_ANEG_1 = 1<<14, /* ANEG[1] */ - GPC_ENA_PAUSE = 1<<13, /* Enable Pause (SYM_OR_REM) */ - GPC_PHYADDR_4 = 1<<12, /* Bit 4 of Phy Addr */ - GPC_PHYADDR_3 = 1<<11, /* Bit 3 of Phy Addr */ - GPC_PHYADDR_2 = 1<<10, /* Bit 2 of Phy Addr */ - GPC_PHYADDR_1 = 1<<9, /* Bit 1 of Phy Addr */ - GPC_PHYADDR_0 = 1<<8, /* Bit 0 of Phy Addr */ - /* Bits 7..2: reserved */ - GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */ - GPC_RST_SET = 1<<0, /* Set GPHY Reset */ -}; - -/* GMAC_IRQ_SRC 8 bit GMAC Interrupt Source Reg (YUKON only) */ -/* GMAC_IRQ_MSK 8 bit GMAC Interrupt Mask Reg (YUKON only) */ -enum { - GM_IS_TX_CO_OV = 1<<5, /* Transmit Counter Overflow IRQ */ - GM_IS_RX_CO_OV = 1<<4, /* Receive Counter Overflow IRQ */ - GM_IS_TX_FF_UR = 1<<3, /* Transmit FIFO Underrun */ - GM_IS_TX_COMPL = 1<<2, /* Frame Transmission Complete */ - GM_IS_RX_FF_OR = 1<<1, /* Receive FIFO Overrun */ - GM_IS_RX_COMPL = 1<<0, /* Frame Reception Complete */ - -#define GMAC_DEF_MSK GM_IS_TX_FF_UR - -/* GMAC_LINK_CTRL 16 bit GMAC Link Control Reg (YUKON only) */ - /* Bits 15.. 2: reserved */ - GMLC_RST_CLR = 1<<1, /* Clear GMAC Link Reset */ - GMLC_RST_SET = 1<<0, /* Set GMAC Link Reset */ - - -/* WOL_CTRL_STAT 16 bit WOL Control/Status Reg */ - WOL_CTL_LINK_CHG_OCC = 1<<15, - WOL_CTL_MAGIC_PKT_OCC = 1<<14, - WOL_CTL_PATTERN_OCC = 1<<13, - WOL_CTL_CLEAR_RESULT = 1<<12, - WOL_CTL_ENA_PME_ON_LINK_CHG = 1<<11, - WOL_CTL_DIS_PME_ON_LINK_CHG = 1<<10, - WOL_CTL_ENA_PME_ON_MAGIC_PKT = 1<<9, - WOL_CTL_DIS_PME_ON_MAGIC_PKT = 1<<8, - WOL_CTL_ENA_PME_ON_PATTERN = 1<<7, - WOL_CTL_DIS_PME_ON_PATTERN = 1<<6, - WOL_CTL_ENA_LINK_CHG_UNIT = 1<<5, - WOL_CTL_DIS_LINK_CHG_UNIT = 1<<4, - WOL_CTL_ENA_MAGIC_PKT_UNIT = 1<<3, - WOL_CTL_DIS_MAGIC_PKT_UNIT = 1<<2, - WOL_CTL_ENA_PATTERN_UNIT = 1<<1, - WOL_CTL_DIS_PATTERN_UNIT = 1<<0, -}; - -#define WOL_CTL_DEFAULT \ - (WOL_CTL_DIS_PME_ON_LINK_CHG | \ - WOL_CTL_DIS_PME_ON_PATTERN | \ - WOL_CTL_DIS_PME_ON_MAGIC_PKT | \ - WOL_CTL_DIS_LINK_CHG_UNIT | \ - WOL_CTL_DIS_PATTERN_UNIT | \ - WOL_CTL_DIS_MAGIC_PKT_UNIT) - -/* WOL_MATCH_CTL 8 bit WOL Match Control Reg */ -#define WOL_CTL_PATT_ENA(x) (1 << (x)) - - -/* Control flags */ -enum { - UDPTCP = 1<<0, - CALSUM = 1<<1, - WR_SUM = 1<<2, - INIT_SUM= 1<<3, - LOCK_SUM= 1<<4, - INS_VLAN= 1<<5, - FRC_STAT= 1<<6, - EOP = 1<<7, -}; - -enum { - HW_OWNER = 1<<7, - OP_TCPWRITE = 0x11, - OP_TCPSTART = 0x12, - OP_TCPINIT = 0x14, - OP_TCPLCK = 0x18, - OP_TCPCHKSUM = OP_TCPSTART, - OP_TCPIS = OP_TCPINIT | OP_TCPSTART, - OP_TCPLW = OP_TCPLCK | OP_TCPWRITE, - OP_TCPLSW = OP_TCPLCK | OP_TCPSTART | OP_TCPWRITE, - OP_TCPLISW = OP_TCPLCK | OP_TCPINIT | OP_TCPSTART | OP_TCPWRITE, - - OP_ADDR64 = 0x21, - OP_VLAN = 0x22, - OP_ADDR64VLAN = OP_ADDR64 | OP_VLAN, - OP_LRGLEN = 0x24, - OP_LRGLENVLAN = OP_LRGLEN | OP_VLAN, - OP_BUFFER = 0x40, - OP_PACKET = 0x41, - OP_LARGESEND = 0x43, - -/* YUKON-2 STATUS opcodes defines */ - OP_RXSTAT = 0x60, - OP_RXTIMESTAMP = 0x61, - OP_RXVLAN = 0x62, - OP_RXCHKS = 0x64, - OP_RXCHKSVLAN = OP_RXCHKS | OP_RXVLAN, - OP_RXTIMEVLAN = OP_RXTIMESTAMP | OP_RXVLAN, - OP_RSS_HASH = 0x65, - OP_TXINDEXLE = 0x68, -}; - -/* Yukon 2 hardware interface - * Not tested on big endian - */ -struct sky2_tx_le { - union { - __le32 addr; - struct { - __le16 offset; - __le16 start; - } csum __attribute((packed)); - struct { - __le16 size; - __le16 rsvd; - } tso __attribute((packed)); - } tx; - __le16 length; /* also vlan tag or checksum start */ - u8 ctrl; - u8 opcode; -} __attribute((packed)); - -struct sky2_rx_le { - __le32 addr; - __le16 length; - u8 ctrl; - u8 opcode; -} __attribute((packed));; - -struct sky2_status_le { - __le32 status; /* also checksum */ - __le16 length; /* also vlan tag */ - u8 link; - u8 opcode; -} __attribute((packed)); - -struct tx_ring_info { - struct sk_buff *skb; - DECLARE_PCI_UNMAP_ADDR(mapaddr); - u16 idx; -}; - -struct ring_info { - struct sk_buff *skb; - dma_addr_t mapaddr; -}; - -struct sky2_port { - struct sky2_hw *hw; - struct net_device *netdev; - unsigned port; - u32 msg_enable; - - spinlock_t tx_lock ____cacheline_aligned_in_smp; - struct tx_ring_info *tx_ring; - struct sky2_tx_le *tx_le; - u16 tx_cons; /* next le to check */ - u16 tx_prod; /* next le to use */ - u32 tx_addr64; - u16 tx_pending; - u16 tx_last_put; - u16 tx_last_mss; - - struct ring_info *rx_ring ____cacheline_aligned_in_smp; - struct sky2_rx_le *rx_le; - u32 rx_addr64; - u16 rx_next; /* next re to check */ - u16 rx_put; /* next le index to use */ - u16 rx_pending; - u16 rx_last_put; - u16 rx_bufsize; -#ifdef SKY2_VLAN_TAG_USED - u16 rx_tag; - struct vlan_group *vlgrp; -#endif - - dma_addr_t rx_le_map; - dma_addr_t tx_le_map; - u32 advertising; /* ADVERTISED_ bits */ - u16 speed; /* SPEED_1000, SPEED_100, ... */ - u8 autoneg; /* AUTONEG_ENABLE, AUTONEG_DISABLE */ - u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */ - u8 rx_pause; - u8 tx_pause; - u8 rx_csum; - u8 wol; - - struct net_device_stats net_stats; - - struct work_struct phy_task; - struct semaphore phy_sema; -}; - -struct sky2_hw { - void __iomem *regs; - struct pci_dev *pdev; - u32 intr_mask; - struct net_device *dev[2]; - - int pm_cap; - u8 chip_id; - u8 chip_rev; - u8 copper; - u8 ports; - - struct sky2_status_le *st_le; - u32 st_idx; - dma_addr_t st_dma; -}; - -/* Register accessor for memory mapped device */ -static inline u32 sky2_read32(const struct sky2_hw *hw, unsigned reg) -{ - return readl(hw->regs + reg); -} - -static inline u16 sky2_read16(const struct sky2_hw *hw, unsigned reg) -{ - return readw(hw->regs + reg); -} - -static inline u8 sky2_read8(const struct sky2_hw *hw, unsigned reg) -{ - return readb(hw->regs + reg); -} - -/* This should probably go away, bus based tweeks suck */ -static inline int is_pciex(const struct sky2_hw *hw) -{ - u32 status; - pci_read_config_dword(hw->pdev, PCI_DEV_STATUS, &status); - return (status & PCI_OS_PCI_X) == 0; -} - -static inline void sky2_write32(const struct sky2_hw *hw, unsigned reg, u32 val) -{ - writel(val, hw->regs + reg); -} - -static inline void sky2_write16(const struct sky2_hw *hw, unsigned reg, u16 val) -{ - writew(val, hw->regs + reg); -} - -static inline void sky2_write8(const struct sky2_hw *hw, unsigned reg, u8 val) -{ - writeb(val, hw->regs + reg); -} - -/* Yukon PHY related registers */ -#define SK_GMAC_REG(port,reg) \ - (BASE_GMAC_1 + (port) * (BASE_GMAC_2-BASE_GMAC_1) + (reg)) -#define GM_PHY_RETRIES 100 - -static inline u16 gma_read16(const struct sky2_hw *hw, unsigned port, unsigned reg) -{ - return sky2_read16(hw, SK_GMAC_REG(port,reg)); -} - -static inline u32 gma_read32(struct sky2_hw *hw, unsigned port, unsigned reg) -{ - unsigned base = SK_GMAC_REG(port, reg); - return (u32) sky2_read16(hw, base) - | (u32) sky2_read16(hw, base+4) << 16; -} - -static inline void gma_write16(const struct sky2_hw *hw, unsigned port, int r, u16 v) -{ - sky2_write16(hw, SK_GMAC_REG(port,r), v); -} - -static inline void gma_set_addr(struct sky2_hw *hw, unsigned port, unsigned reg, - const u8 *addr) -{ - gma_write16(hw, port, reg, (u16) addr[0] | ((u16) addr[1] << 8)); - gma_write16(hw, port, reg+4,(u16) addr[2] | ((u16) addr[3] << 8)); - gma_write16(hw, port, reg+8,(u16) addr[4] | ((u16) addr[5] << 8)); -} -#endif diff --git a/trunk/drivers/net/smc91x.c b/trunk/drivers/net/smc91x.c index 28bf2e69eb5e..c91e2e81f131 100644 --- a/trunk/drivers/net/smc91x.c +++ b/trunk/drivers/net/smc91x.c @@ -154,12 +154,6 @@ MODULE_LICENSE("GPL"); */ #define MEMORY_WAIT_TIME 16 -/* - * The maximum number of processing loops allowed for each call to the - * IRQ handler. - */ -#define MAX_IRQ_LOOPS 8 - /* * This selects whether TX packets are sent one by one to the SMC91x internal * memory and throttled until transmission completes. This may prevent @@ -690,6 +684,7 @@ static void smc_hardware_send_pkt(unsigned long data) /* queue the packet for TX */ SMC_SET_MMU_CMD(MC_ENQUEUE); + SMC_ACK_INT(IM_TX_EMPTY_INT); smc_special_unlock(&lp->lock); dev->trans_start = jiffies; @@ -1212,7 +1207,6 @@ static void smc_phy_configure(void *data) smc_phy_check_media(dev, 1); smc_phy_configure_exit: - SMC_SELECT_BANK(2); spin_unlock_irq(&lp->lock); lp->work_pending = 0; } @@ -1311,7 +1305,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id, struct pt_regs *regs) SMC_SET_INT_MASK(0); /* set a timeout value, so I don't stay here forever */ - timeout = MAX_IRQ_LOOPS; + timeout = 8; do { status = SMC_GET_INT(); @@ -1378,13 +1372,10 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* restore register states */ SMC_SET_PTR(saved_pointer); SMC_SET_INT_MASK(mask); + spin_unlock(&lp->lock); - if (timeout == MAX_IRQ_LOOPS) - PRINTK("%s: spurious interrupt (mask = 0x%02x)\n", - dev->name, mask); - DBG(3, "%s: Interrupt done (%d loops)\n", - dev->name, MAX_IRQ_LOOPS - timeout); + DBG(3, "%s: Interrupt done (%d loops)\n", dev->name, 8-timeout); /* * We return IRQ_HANDLED unconditionally here even if there was diff --git a/trunk/drivers/net/smc91x.h b/trunk/drivers/net/smc91x.h index 5c2824be4ee6..a10cd184d597 100644 --- a/trunk/drivers/net/smc91x.h +++ b/trunk/drivers/net/smc91x.h @@ -100,14 +100,14 @@ #define SMC_IO_SHIFT 0 #define SMC_NOWAIT 1 -#define SMC_inb(a, r) readb((a) + (r)) -#define SMC_insb(a, r, p, l) readsb((a) + (r), p, (l)) -#define SMC_inw(a, r) readw((a) + (r)) -#define SMC_insw(a, r, p, l) readsw((a) + (r), p, l) -#define SMC_outb(v, a, r) writeb(v, (a) + (r)) -#define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) -#define SMC_outw(v, a, r) writew(v, (a) + (r)) -#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l) +#define SMC_inb(a, r) inb((a) + (r)) +#define SMC_insb(a, r, p, l) insb((a) + (r), p, (l)) +#define SMC_inw(a, r) inw((a) + (r)) +#define SMC_insw(a, r, p, l) insw((a) + (r), p, l) +#define SMC_outb(v, a, r) outb(v, (a) + (r)) +#define SMC_outsb(a, r, p, l) outsb((a) + (r), p, (l)) +#define SMC_outw(v, a, r) outw(v, (a) + (r)) +#define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) #define set_irq_type(irq, type) do {} while (0) diff --git a/trunk/drivers/net/sungem.c b/trunk/drivers/net/sungem.c index 28ce47a02408..de399563a9db 100644 --- a/trunk/drivers/net/sungem.c +++ b/trunk/drivers/net/sungem.c @@ -128,8 +128,6 @@ static struct pci_device_id gem_pci_tbl[] = { PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_SH_SUNGEM, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID2_GMAC, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, {0, } }; @@ -2907,7 +2905,7 @@ static int __devinit gem_get_device_address(struct gem *gp) return 0; } -static void gem_remove_one(struct pci_dev *pdev) +static void __devexit gem_remove_one(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); @@ -3181,7 +3179,7 @@ static struct pci_driver gem_driver = { .name = GEM_MODULE_NAME, .id_table = gem_pci_tbl, .probe = gem_init_one, - .remove = gem_remove_one, + .remove = __devexit_p(gem_remove_one), #ifdef CONFIG_PM .suspend = gem_suspend, .resume = gem_resume, diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c index eb86b059809b..1828a6bf8458 100644 --- a/trunk/drivers/net/tg3.c +++ b/trunk/drivers/net/tg3.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -69,8 +68,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "3.47" -#define DRV_MODULE_RELDATE "Dec 28, 2005" +#define DRV_MODULE_VERSION "3.43" +#define DRV_MODULE_RELDATE "Oct 24, 2005" #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE 0 @@ -342,16 +341,6 @@ static struct { { "interrupt test (offline)" }, }; -static void tg3_write32(struct tg3 *tp, u32 off, u32 val) -{ - writel(val, tp->regs + off); -} - -static u32 tg3_read32(struct tg3 *tp, u32 off) -{ - return (readl(tp->regs + off)); -} - static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val) { unsigned long flags; @@ -422,29 +411,13 @@ static u32 tg3_read_indirect_mbox(struct tg3 *tp, u32 off) return val; } -/* usec_wait specifies the wait time in usec when writing to certain registers - * where it is unsafe to read back the register without some delay. - * GRC_LOCAL_CTRL is one example if the GPIOs are toggled to switch power. - * TG3PCI_CLOCK_CTRL is another example if the clock frequencies are changed. - */ -static void _tw32_flush(struct tg3 *tp, u32 off, u32 val, u32 usec_wait) +static void _tw32_flush(struct tg3 *tp, u32 off, u32 val) { - if ((tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) || - (tp->tg3_flags2 & TG3_FLG2_ICH_WORKAROUND)) - /* Non-posted methods */ - tp->write32(tp, off, val); - else { - /* Posted method */ - tg3_write32(tp, off, val); - if (usec_wait) - udelay(usec_wait); - tp->read32(tp, off); - } - /* Wait again after the read for the posted method to guarantee that - * the wait time is met. - */ - if (usec_wait) - udelay(usec_wait); + tp->write32(tp, off, val); + if (!(tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) && + !(tp->tg3_flags & TG3_FLAG_5701_REG_WRITE_BUG) && + !(tp->tg3_flags2 & TG3_FLG2_ICH_WORKAROUND)) + tp->read32(tp, off); /* flush */ } static inline void tw32_mailbox_flush(struct tg3 *tp, u32 off, u32 val) @@ -465,6 +438,16 @@ static void tg3_write32_tx_mbox(struct tg3 *tp, u32 off, u32 val) readl(mbox); } +static void tg3_write32(struct tg3 *tp, u32 off, u32 val) +{ + writel(val, tp->regs + off); +} + +static u32 tg3_read32(struct tg3 *tp, u32 off) +{ + return (readl(tp->regs + off)); +} + #define tw32_mailbox(reg, val) tp->write32_mbox(tp, reg, val) #define tw32_mailbox_f(reg, val) tw32_mailbox_flush(tp, (reg), (val)) #define tw32_rx_mbox(reg, val) tp->write32_rx_mbox(tp, reg, val) @@ -472,8 +455,7 @@ static void tg3_write32_tx_mbox(struct tg3 *tp, u32 off, u32 val) #define tr32_mailbox(reg) tp->read32_mbox(tp, reg) #define tw32(reg,val) tp->write32(tp, reg, val) -#define tw32_f(reg,val) _tw32_flush(tp,(reg),(val), 0) -#define tw32_wait_f(reg,val,us) _tw32_flush(tp,(reg),(val), (us)) +#define tw32_f(reg,val) _tw32_flush(tp,(reg),(val)) #define tr32(reg) tp->read32(tp, reg) static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val) @@ -613,19 +595,21 @@ static void tg3_switch_clocks(struct tg3 *tp) if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { if (orig_clock_ctrl & CLOCK_CTRL_625_CORE) { - tw32_wait_f(TG3PCI_CLOCK_CTRL, - clock_ctrl | CLOCK_CTRL_625_CORE, 40); + tw32_f(TG3PCI_CLOCK_CTRL, + clock_ctrl | CLOCK_CTRL_625_CORE); + udelay(40); } } else if ((orig_clock_ctrl & CLOCK_CTRL_44MHZ_CORE) != 0) { - tw32_wait_f(TG3PCI_CLOCK_CTRL, - clock_ctrl | - (CLOCK_CTRL_44MHZ_CORE | CLOCK_CTRL_ALTCLK), - 40); - tw32_wait_f(TG3PCI_CLOCK_CTRL, - clock_ctrl | (CLOCK_CTRL_ALTCLK), - 40); + tw32_f(TG3PCI_CLOCK_CTRL, + clock_ctrl | + (CLOCK_CTRL_44MHZ_CORE | CLOCK_CTRL_ALTCLK)); + udelay(40); + tw32_f(TG3PCI_CLOCK_CTRL, + clock_ctrl | (CLOCK_CTRL_ALTCLK)); + udelay(40); } - tw32_wait_f(TG3PCI_CLOCK_CTRL, clock_ctrl, 40); + tw32_f(TG3PCI_CLOCK_CTRL, clock_ctrl); + udelay(40); } #define PHY_BUSY_LOOPS 5000 @@ -1033,50 +1017,37 @@ static void tg3_frob_aux_power(struct tg3 *tp) if ((tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) != 0) return; - if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) || - (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) { - struct net_device *dev_peer; - - dev_peer = pci_get_drvdata(tp->pdev_peer); - if (!dev_peer) + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { + tp_peer = pci_get_drvdata(tp->pdev_peer); + if (!tp_peer) BUG(); - tp_peer = netdev_priv(dev_peer); } + if ((tp->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 || - (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 || - (tp_peer->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 || - (tp_peer->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) { + (tp_peer->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0) { if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701) { - tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | - (GRC_LCLCTRL_GPIO_OE0 | - GRC_LCLCTRL_GPIO_OE1 | - GRC_LCLCTRL_GPIO_OE2 | - GRC_LCLCTRL_GPIO_OUTPUT0 | - GRC_LCLCTRL_GPIO_OUTPUT1), - 100); + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | + (GRC_LCLCTRL_GPIO_OE0 | + GRC_LCLCTRL_GPIO_OE1 | + GRC_LCLCTRL_GPIO_OE2 | + GRC_LCLCTRL_GPIO_OUTPUT0 | + GRC_LCLCTRL_GPIO_OUTPUT1)); + udelay(100); } else { u32 no_gpio2; - u32 grc_local_ctrl = 0; + u32 grc_local_ctrl; if (tp_peer != tp && (tp_peer->tg3_flags & TG3_FLAG_INIT_COMPLETE) != 0) return; - /* Workaround to prevent overdrawing Amps. */ - if (GET_ASIC_REV(tp->pci_chip_rev_id) == - ASIC_REV_5714) { - grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE3; - tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | - grc_local_ctrl, 100); - } - /* On 5753 and variants, GPIO2 cannot be used. */ no_gpio2 = tp->nic_sram_data_cfg & NIC_SRAM_DATA_CFG_NO_GPIO2; - grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE0 | + grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 | GRC_LCLCTRL_GPIO_OE1 | GRC_LCLCTRL_GPIO_OE2 | GRC_LCLCTRL_GPIO_OUTPUT1 | @@ -1085,18 +1056,21 @@ static void tg3_frob_aux_power(struct tg3 *tp) grc_local_ctrl &= ~(GRC_LCLCTRL_GPIO_OE2 | GRC_LCLCTRL_GPIO_OUTPUT2); } - tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | - grc_local_ctrl, 100); + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | + grc_local_ctrl); + udelay(100); grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT0; - tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | - grc_local_ctrl, 100); + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | + grc_local_ctrl); + udelay(100); if (!no_gpio2) { grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT2; - tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | - grc_local_ctrl, 100); + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | + grc_local_ctrl); + udelay(100); } } } else { @@ -1106,16 +1080,19 @@ static void tg3_frob_aux_power(struct tg3 *tp) (tp_peer->tg3_flags & TG3_FLAG_INIT_COMPLETE) != 0) return; - tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | - (GRC_LCLCTRL_GPIO_OE1 | - GRC_LCLCTRL_GPIO_OUTPUT1), 100); + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | + (GRC_LCLCTRL_GPIO_OE1 | + GRC_LCLCTRL_GPIO_OUTPUT1)); + udelay(100); - tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | - GRC_LCLCTRL_GPIO_OE1, 100); + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | + (GRC_LCLCTRL_GPIO_OE1)); + udelay(100); - tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | - (GRC_LCLCTRL_GPIO_OE1 | - GRC_LCLCTRL_GPIO_OUTPUT1), 100); + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | + (GRC_LCLCTRL_GPIO_OE1 | + GRC_LCLCTRL_GPIO_OUTPUT1)); + udelay(100); } } } @@ -1128,8 +1105,6 @@ static int tg3_setup_phy(struct tg3 *, int); static void tg3_write_sig_post_reset(struct tg3 *, int); static int tg3_halt_cpu(struct tg3 *, u32); -static int tg3_nvram_lock(struct tg3 *); -static void tg3_nvram_unlock(struct tg3 *); static int tg3_set_power_state(struct tg3 *tp, int state) { @@ -1158,8 +1133,10 @@ static int tg3_set_power_state(struct tg3 *tp, int state) udelay(100); /* Delay after power state change */ /* Switch out of Vaux if it is not a LOM */ - if (!(tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT)) - tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl, 100); + if (!(tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT)) { + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl); + udelay(100); + } return 0; @@ -1202,21 +1179,6 @@ static int tg3_set_power_state(struct tg3 *tp, int state) tg3_setup_phy(tp, 0); } - if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) { - int i; - u32 val; - - for (i = 0; i < 200; i++) { - tg3_read_mem(tp, NIC_SRAM_FW_ASF_STATUS_MBOX, &val); - if (val == ~NIC_SRAM_FIRMWARE_MBOX_MAGIC1) - break; - msleep(1); - } - } - tg3_write_mem(tp, NIC_SRAM_WOL_MBOX, WOL_SIGNATURE | - WOL_DRV_STATE_SHUTDOWN | - WOL_DRV_WOL | WOL_SET_MAGIC_PKT); - pci_read_config_word(tp->pdev, pm + PCI_PM_PMC, &power_caps); if (tp->tg3_flags & TG3_FLAG_WOL_ENABLE) { @@ -1258,8 +1220,10 @@ static int tg3_set_power_state(struct tg3 *tp, int state) base_val |= (CLOCK_CTRL_RXCLK_DISABLE | CLOCK_CTRL_TXCLK_DISABLE); - tw32_wait_f(TG3PCI_CLOCK_CTRL, base_val | CLOCK_CTRL_ALTCLK | - CLOCK_CTRL_PWRDOWN_PLL133, 40); + tw32_f(TG3PCI_CLOCK_CTRL, base_val | + CLOCK_CTRL_ALTCLK | + CLOCK_CTRL_PWRDOWN_PLL133); + udelay(40); } else if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) { /* do nothing */ } else if (!((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) && @@ -1280,11 +1244,11 @@ static int tg3_set_power_state(struct tg3 *tp, int state) newbits2 = newbits1 | CLOCK_CTRL_44MHZ_CORE; } - tw32_wait_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits1, - 40); + tw32_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits1); + udelay(40); - tw32_wait_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits2, - 40); + tw32_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits2); + udelay(40); if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { u32 newbits3; @@ -1298,20 +1262,9 @@ static int tg3_set_power_state(struct tg3 *tp, int state) newbits3 = CLOCK_CTRL_44MHZ_CORE; } - tw32_wait_f(TG3PCI_CLOCK_CTRL, - tp->pci_clock_ctrl | newbits3, 40); - } - } - - if (!(tp->tg3_flags & TG3_FLAG_WOL_ENABLE) && - !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) { - /* Turn off the PHY */ - if (!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) { - tg3_writephy(tp, MII_TG3_EXT_CTRL, - MII_TG3_EXT_CTRL_FORCE_LED_OFF); - tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x01b2); - if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700) - tg3_writephy(tp, MII_BMCR, BMCR_PDOWN); + tw32_f(TG3PCI_CLOCK_CTRL, + tp->pci_clock_ctrl | newbits3); + udelay(40); } } @@ -1324,12 +1277,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state) val &= ~((1 << 16) | (1 << 4) | (1 << 2) | (1 << 1) | 1); tw32(0x7d00, val); - if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) { - tg3_nvram_lock(tp); + if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) tg3_halt_cpu(tp, RX_CPU_BASE); - tw32_f(NVRAM_SWARB, SWARB_REQ_CLR0); - tg3_nvram_unlock(tp); - } } /* Finally, set the new power state. */ @@ -1863,7 +1812,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset) } } relink: - if (current_link_up == 0 || tp->link_config.phy_is_low_power) { + if (current_link_up == 0) { u32 tmp; tg3_phy_copper_begin(tp); @@ -3616,15 +3565,12 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) if (!spin_trylock(&tp->tx_lock)) return NETDEV_TX_LOCKED; + /* This is a hard error, log it. */ if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) { - if (!netif_queue_stopped(dev)) { - netif_stop_queue(dev); - - /* This is a hard error, log it. */ - printk(KERN_ERR PFX "%s: BUG! Tx Ring full when " - "queue awake!\n", dev->name); - } + netif_stop_queue(dev); spin_unlock(&tp->tx_lock); + printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", + dev->name); return NETDEV_TX_BUSY; } @@ -3651,7 +3597,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) TXD_FLAG_CPU_POST_DMA); skb->nh.iph->check = 0; - skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); + skb->nh.iph->tot_len = ntohs(mss + ip_tcp_len + tcp_opt_len); if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { skb->h.th->check = 0; base_flags &= ~TXD_FLAG_TCPUDP_CSUM; @@ -7152,13 +7098,8 @@ do { p = (u32 *)(orig_p + (reg)); \ GET_REG32_LOOP(BUFMGR_MODE, 0x58); GET_REG32_LOOP(RDMAC_MODE, 0x08); GET_REG32_LOOP(WDMAC_MODE, 0x08); - GET_REG32_1(RX_CPU_MODE); - GET_REG32_1(RX_CPU_STATE); - GET_REG32_1(RX_CPU_PGMCTR); - GET_REG32_1(RX_CPU_HWBKPT); - GET_REG32_1(TX_CPU_MODE); - GET_REG32_1(TX_CPU_STATE); - GET_REG32_1(TX_CPU_PGMCTR); + GET_REG32_LOOP(RX_CPU_BASE, 0x280); + GET_REG32_LOOP(TX_CPU_BASE, 0x280); GET_REG32_LOOP(GRCMBOX_INTERRUPT_0, 0x110); GET_REG32_LOOP(FTQ_RESET, 0x120); GET_REG32_LOOP(MSGINT_MODE, 0x0c); @@ -7981,12 +7922,13 @@ static int tg3_test_memory(struct tg3 *tp) u32 offset; u32 len; } mem_tbl_570x[] = { - { 0x00000000, 0x00b50}, + { 0x00000000, 0x01000}, { 0x00002000, 0x1c000}, { 0xffffffff, 0x00000} }, mem_tbl_5705[] = { { 0x00000100, 0x0000c}, { 0x00000200, 0x00008}, + { 0x00000b50, 0x00400}, { 0x00004000, 0x00800}, { 0x00006000, 0x01000}, { 0x00008000, 0x02000}, @@ -8588,7 +8530,6 @@ static void __devinit tg3_nvram_init(struct tg3 *tp) GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) { tp->tg3_flags |= TG3_FLAG_NVRAM; - tg3_nvram_lock(tp); tg3_enable_nvram_access(tp); if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752) @@ -8599,7 +8540,6 @@ static void __devinit tg3_nvram_init(struct tg3 *tp) tg3_get_nvram_size(tp); tg3_disable_nvram_access(tp); - tg3_nvram_unlock(tp); } else { tp->tg3_flags &= ~(TG3_FLAG_NVRAM | TG3_FLAG_NVRAM_BUFFERED); @@ -8697,10 +8637,10 @@ static int tg3_nvram_read(struct tg3 *tp, u32 offset, u32 *val) if (ret == 0) *val = swab32(tr32(NVRAM_RDDATA)); - tg3_disable_nvram_access(tp); - tg3_nvram_unlock(tp); + tg3_disable_nvram_access(tp); + return ret; } @@ -8785,10 +8725,6 @@ static int tg3_nvram_write_block_unbuffered(struct tg3 *tp, u32 offset, u32 len, offset = offset + (pagesize - page_off); - /* Nvram lock released by tg3_nvram_read() above, - * so need to get it again. - */ - tg3_nvram_lock(tp); tg3_enable_nvram_access(tp); /* @@ -10487,7 +10423,7 @@ static char * __devinit tg3_bus_string(struct tg3 *tp, char *str) return str; } -static struct pci_dev * __devinit tg3_find_peer(struct tg3 *tp) +static struct pci_dev * __devinit tg3_find_5704_peer(struct tg3 *tp) { struct pci_dev *peer; unsigned int func, devnr = tp->pdev->devfn & ~7; @@ -10498,13 +10434,8 @@ static struct pci_dev * __devinit tg3_find_peer(struct tg3 *tp) break; pci_dev_put(peer); } - /* 5704 can be configured in single-port mode, set peer to - * tp->pdev in that case. - */ - if (!peer) { - peer = tp->pdev; - return peer; - } + if (!peer || peer == tp->pdev) + BUG(); /* * We don't need to keep the refcount elevated; there's no way @@ -10740,9 +10671,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, tp->rx_pending = 63; } - if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) || - (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) - tp->pdev_peer = tg3_find_peer(tp); + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) + tp->pdev_peer = tg3_find_5704_peer(tp); err = tg3_get_device_address(tp); if (err) { @@ -10887,14 +10817,12 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state) tg3_full_lock(tp, 0); tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); - tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; tg3_full_unlock(tp); err = tg3_set_power_state(tp, pci_choose_state(pdev, state)); if (err) { tg3_full_lock(tp, 0); - tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; tg3_init_hw(tp); tp->timer.expires = jiffies + tp->timer_offset; @@ -10928,7 +10856,6 @@ static int tg3_resume(struct pci_dev *pdev) tg3_full_lock(tp, 0); - tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; tg3_init_hw(tp); tp->timer.expires = jiffies + tp->timer_offset; diff --git a/trunk/drivers/net/tg3.h b/trunk/drivers/net/tg3.h index 890e1635996b..fb7e2a5f4a08 100644 --- a/trunk/drivers/net/tg3.h +++ b/trunk/drivers/net/tg3.h @@ -1124,14 +1124,7 @@ /* 0x280 --> 0x400 unused */ #define RX_CPU_BASE 0x00005000 -#define RX_CPU_MODE 0x00005000 -#define RX_CPU_STATE 0x00005004 -#define RX_CPU_PGMCTR 0x0000501c -#define RX_CPU_HWBKPT 0x00005034 #define TX_CPU_BASE 0x00005400 -#define TX_CPU_MODE 0x00005400 -#define TX_CPU_STATE 0x00005404 -#define TX_CPU_PGMCTR 0x0000541c /* Mailboxes */ #define GRCMBOX_INTERRUPT_0 0x00005800 /* 64-bit */ @@ -1536,12 +1529,6 @@ #define NIC_SRAM_MAC_ADDR_HIGH_MBOX 0x00000c14 #define NIC_SRAM_MAC_ADDR_LOW_MBOX 0x00000c18 -#define NIC_SRAM_WOL_MBOX 0x00000d30 -#define WOL_SIGNATURE 0x474c0000 -#define WOL_DRV_STATE_SHUTDOWN 0x00000001 -#define WOL_DRV_WOL 0x00000002 -#define WOL_SET_MAGIC_PKT 0x00000004 - #define NIC_SRAM_DATA_CFG_2 0x00000d38 #define SHASTA_EXT_LED_MODE_MASK 0x00018000 @@ -1578,7 +1565,6 @@ #define MII_TG3_EXT_CTRL 0x10 /* Extended control register */ #define MII_TG3_EXT_CTRL_FIFO_ELASTIC 0x0001 #define MII_TG3_EXT_CTRL_LNK3_LED_MODE 0x0002 -#define MII_TG3_EXT_CTRL_FORCE_LED_OFF 0x0008 #define MII_TG3_EXT_CTRL_TBI 0x8000 #define MII_TG3_EXT_STAT 0x11 /* Extended status register */ diff --git a/trunk/drivers/net/wan/hdlc_cisco.c b/trunk/drivers/net/wan/hdlc_cisco.c index 1fd04662c4fc..a01efa6d5c62 100644 --- a/trunk/drivers/net/wan/hdlc_cisco.c +++ b/trunk/drivers/net/wan/hdlc_cisco.c @@ -192,9 +192,7 @@ static int cisco_rx(struct sk_buff *skb) "uptime %ud%uh%um%us)\n", dev->name, days, hrs, min, sec); -#if 0 netif_carrier_on(dev); -#endif hdlc->state.cisco.up = 1; } } @@ -227,9 +225,7 @@ static void cisco_timer(unsigned long arg) hdlc->state.cisco.settings.timeout * HZ)) { hdlc->state.cisco.up = 0; printk(KERN_INFO "%s: Link down\n", dev->name); -#if 0 netif_carrier_off(dev); -#endif } cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ, @@ -265,10 +261,8 @@ static void cisco_stop(struct net_device *dev) { hdlc_device *hdlc = dev_to_hdlc(dev); del_timer_sync(&hdlc->state.cisco.timer); -#if 0 if (netif_carrier_ok(dev)) netif_carrier_off(dev); -#endif hdlc->state.cisco.up = 0; hdlc->state.cisco.request_sent = 0; } diff --git a/trunk/drivers/net/wan/hdlc_fr.c b/trunk/drivers/net/wan/hdlc_fr.c index 523afe17564e..e1601d35dced 100644 --- a/trunk/drivers/net/wan/hdlc_fr.c +++ b/trunk/drivers/net/wan/hdlc_fr.c @@ -545,10 +545,8 @@ static void fr_set_link_state(int reliable, struct net_device *dev) hdlc->state.fr.reliable = reliable; if (reliable) { -#if 0 if (!netif_carrier_ok(dev)) netif_carrier_on(dev); -#endif hdlc->state.fr.n391cnt = 0; /* Request full status */ hdlc->state.fr.dce_changed = 1; @@ -562,10 +560,8 @@ static void fr_set_link_state(int reliable, struct net_device *dev) } } } else { -#if 0 if (netif_carrier_ok(dev)) netif_carrier_off(dev); -#endif while (pvc) { /* Deactivate all PVCs */ pvc_carrier(0, pvc); diff --git a/trunk/drivers/net/wan/hdlc_generic.c b/trunk/drivers/net/wan/hdlc_generic.c index 46cef8f92133..cdd4c09c2d90 100644 --- a/trunk/drivers/net/wan/hdlc_generic.c +++ b/trunk/drivers/net/wan/hdlc_generic.c @@ -79,13 +79,11 @@ static void __hdlc_set_carrier_on(struct net_device *dev) hdlc_device *hdlc = dev_to_hdlc(dev); if (hdlc->proto.start) return hdlc->proto.start(dev); -#if 0 #ifdef DEBUG_LINK if (netif_carrier_ok(dev)) printk(KERN_ERR "hdlc_set_carrier_on(): already on\n"); #endif netif_carrier_on(dev); -#endif } @@ -96,13 +94,11 @@ static void __hdlc_set_carrier_off(struct net_device *dev) if (hdlc->proto.stop) return hdlc->proto.stop(dev); -#if 0 #ifdef DEBUG_LINK if (!netif_carrier_ok(dev)) printk(KERN_ERR "hdlc_set_carrier_off(): already off\n"); #endif netif_carrier_off(dev); -#endif } @@ -298,10 +294,8 @@ int register_hdlc_device(struct net_device *dev) if (result != 0) return -EIO; -#if 0 if (netif_carrier_ok(dev)) netif_carrier_off(dev); /* no carrier until DCD goes up */ -#endif return 0; } diff --git a/trunk/drivers/net/wan/lmc/lmc_prot.h b/trunk/drivers/net/wan/lmc/lmc_prot.h new file mode 100644 index 000000000000..f3b1df9e2cdb --- /dev/null +++ b/trunk/drivers/net/wan/lmc/lmc_prot.h @@ -0,0 +1,15 @@ +#ifndef _LMC_PROTO_H_ +#define _LMC_PROTO_H_ + +void lmc_proto_init(lmc_softc_t * const) +void lmc_proto_attach(lmc_softc_t *sc const) +void lmc_proto_detach(lmc_softc *sc const) +void lmc_proto_reopen(lmc_softc_t *sc const) +int lmc_proto_ioctl(lmc_softc_t *sc const, struct ifreq *ifr, int cmd) +void lmc_proto_open(lmc_softc_t *sc const) +void lmc_proto_close(lmc_softc_t *sc const) +unsigned short lmc_proto_type(lmc_softc_t *sc const, struct skbuff *skb) + + +#endif + diff --git a/trunk/drivers/net/wan/sdladrv.c b/trunk/drivers/net/wan/sdladrv.c index 032c0f81928e..7c2cf2e76300 100644 --- a/trunk/drivers/net/wan/sdladrv.c +++ b/trunk/drivers/net/wan/sdladrv.c @@ -1994,7 +1994,7 @@ static int detect_s514 (sdlahw_t* hw) modname, hw->irq); /* map the physical PCI memory to virtual memory */ - hw->dpmbase = ioremap((unsigned long)S514_mem_base_addr, + (void *)hw->dpmbase = ioremap((unsigned long)S514_mem_base_addr, (unsigned long)MAX_SIZEOF_S514_MEMORY); /* map the physical control register memory to virtual memory */ hw->vector = (unsigned long)ioremap( diff --git a/trunk/drivers/net/wireless/Kconfig b/trunk/drivers/net/wireless/Kconfig index 24f7967aab67..00e55165b760 100644 --- a/trunk/drivers/net/wireless/Kconfig +++ b/trunk/drivers/net/wireless/Kconfig @@ -173,7 +173,7 @@ config IPW2100_MONITOR promiscuous mode via the Wireless Tool's Monitor mode. While in this mode, no packets can be sent. -config IPW2100_DEBUG +config IPW_DEBUG bool "Enable full debugging output in IPW2100 module." depends on IPW2100 ---help--- @@ -192,7 +192,7 @@ config IPW2100_DEBUG config IPW2200 tristate "Intel PRO/Wireless 2200BG and 2915ABG Network Connection" - depends on NET_RADIO && IEEE80211 && PCI + depends on IEEE80211 && PCI select FW_LOADER ---help--- A driver for the Intel PRO/Wireless 2200BG and 2915ABG Network @@ -217,7 +217,7 @@ config IPW2200 say M here and read . The module will be called ipw2200.ko. -config IPW2200_DEBUG +config IPW_DEBUG bool "Enable full debugging output in IPW2200 module." depends on IPW2200 ---help--- diff --git a/trunk/drivers/net/wireless/airo.c b/trunk/drivers/net/wireless/airo.c index ee866fd6957d..340ab4ee4b67 100644 --- a/trunk/drivers/net/wireless/airo.c +++ b/trunk/drivers/net/wireless/airo.c @@ -2755,8 +2755,8 @@ static struct net_device *_init_airo_card( unsigned short irq, int port, SET_NETDEV_DEV(dev, dmdev); - reset_card (dev, 1); - msleep(400); + if (test_bit(FLAG_MPI,&ai->flags)) + reset_card (dev, 1); rc = request_irq( dev->irq, airo_interrupt, SA_SHIRQ, dev->name, dev ); if (rc) { @@ -4037,7 +4037,7 @@ static int PC4500_writerid(struct airo_info *ai, u16 rid, Cmd cmd; Resp rsp; - if (test_bit(FLAG_ENABLED, &ai->flags) && (RID_WEP_TEMP != rid)) + if (test_bit(FLAG_ENABLED, &ai->flags)) printk(KERN_ERR "%s: MAC should be disabled (rid=%04x)\n", __FUNCTION__, rid); @@ -5093,9 +5093,9 @@ static int set_wep_key(struct airo_info *ai, u16 index, printk(KERN_INFO "Setting key %d\n", index); } - if (perm) disable_MAC(ai, lock); + disable_MAC(ai, lock); writeWepKeyRid(ai, &wkr, perm, lock); - if (perm) enable_MAC(ai, &rsp, lock); + enable_MAC(ai, &rsp, lock); return 0; } @@ -6170,8 +6170,6 @@ static int airo_set_encode(struct net_device *dev, { struct airo_info *local = dev->priv; CapabilityRid cap_rid; /* Card capability info */ - int perm = ( dwrq->flags & IW_ENCODE_TEMP ? 0 : 1 ); - u16 currentAuthType = local->config.authType; /* Is WEP supported ? */ readCapabilityRid(local, &cap_rid, 1); @@ -6214,7 +6212,7 @@ static int airo_set_encode(struct net_device *dev, /* Copy the key in the driver */ memcpy(key.key, extra, dwrq->length); /* Send the key to the card */ - set_wep_key(local, index, key.key, key.len, perm, 1); + set_wep_key(local, index, key.key, key.len, 1, 1); } /* WE specify that if a valid key is set, encryption * should be enabled (user may turn it off later) @@ -6222,12 +6220,13 @@ static int airo_set_encode(struct net_device *dev, if((index == current_index) && (key.len > 0) && (local->config.authType == AUTH_OPEN)) { local->config.authType = AUTH_ENCRYPT; + set_bit (FLAG_COMMIT, &local->flags); } } else { /* Do we want to just set the transmit key index ? */ int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; if ((index >= 0) && (index < ((cap_rid.softCap & 0x80)?4:1))) { - set_wep_key(local, index, NULL, 0, perm, 1); + set_wep_key(local, index, NULL, 0, 1, 1); } else /* Don't complain if only change the mode */ if(!dwrq->flags & IW_ENCODE_MODE) { @@ -6242,7 +6241,7 @@ static int airo_set_encode(struct net_device *dev, if(dwrq->flags & IW_ENCODE_OPEN) local->config.authType = AUTH_ENCRYPT; // Only Wep /* Commit the changes to flags if needed */ - if (local->config.authType != currentAuthType) + if(dwrq->flags & IW_ENCODE_MODE) set_bit (FLAG_COMMIT, &local->flags); return -EINPROGRESS; /* Call commit handler */ } diff --git a/trunk/drivers/net/wireless/atmel.c b/trunk/drivers/net/wireless/atmel.c index e4729ddf29fd..5e53c5258a33 100644 --- a/trunk/drivers/net/wireless/atmel.c +++ b/trunk/drivers/net/wireless/atmel.c @@ -5,9 +5,9 @@ Copyright 2000-2001 ATMEL Corporation. Copyright 2003-2004 Simon Kelley. - This code was developed from version 2.1.1 of the Atmel drivers, - released by Atmel corp. under the GPL in December 2002. It also - includes code from the Linux aironet drivers (C) Benjamin Reed, + This code was developed from version 2.1.1 of the Atmel drivers, + released by Atmel corp. under the GPL in December 2002. It also + includes code from the Linux aironet drivers (C) Benjamin Reed, and the Linux PCMCIA package, (C) David Hinds and the Linux wireless extensions, (C) Jean Tourrilhes. @@ -31,7 +31,7 @@ along with Atmel wireless lan drivers; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - For all queries about this code, please contact the current author, + For all queries about this code, please contact the current author, Simon Kelley and not Atmel Corporation. Credit is due to HP UK and Cambridge Online Systems Ltd for supplying @@ -79,13 +79,13 @@ MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.") MODULE_LICENSE("GPL"); MODULE_SUPPORTED_DEVICE("Atmel at76c50x wireless cards"); -/* The name of the firmware file to be loaded +/* The name of the firmware file to be loaded over-rides any automatic selection */ static char *firmware = NULL; module_param(firmware, charp, 0); /* table of firmware file names */ -static struct { +static struct { AtmelFWType fw_type; const char *fw_file; const char *fw_file_ext; @@ -104,17 +104,17 @@ static struct { #define MAX_SSID_LENGTH 32 #define MGMT_JIFFIES (256 * HZ / 100) -#define MAX_BSS_ENTRIES 64 +#define MAX_BSS_ENTRIES 64 /* registers */ -#define GCR 0x00 // (SIR0) General Configuration Register -#define BSR 0x02 // (SIR1) Bank Switching Select Register +#define GCR 0x00 // (SIR0) General Configuration Register +#define BSR 0x02 // (SIR1) Bank Switching Select Register #define AR 0x04 #define DR 0x08 -#define MR1 0x12 // Mirror Register 1 -#define MR2 0x14 // Mirror Register 2 -#define MR3 0x16 // Mirror Register 3 -#define MR4 0x18 // Mirror Register 4 +#define MR1 0x12 // Mirror Register 1 +#define MR2 0x14 // Mirror Register 2 +#define MR3 0x16 // Mirror Register 3 +#define MR4 0x18 // Mirror Register 4 #define GPR1 0x0c #define GPR2 0x0e @@ -123,9 +123,9 @@ static struct { // Constants for the GCR register. // #define GCR_REMAP 0x0400 // Remap internal SRAM to 0 -#define GCR_SWRES 0x0080 // BIU reset (ARM and PAI are NOT reset) +#define GCR_SWRES 0x0080 // BIU reset (ARM and PAI are NOT reset) #define GCR_CORES 0x0060 // Core Reset (ARM and PAI are reset) -#define GCR_ENINT 0x0002 // Enable Interrupts +#define GCR_ENINT 0x0002 // Enable Interrupts #define GCR_ACKINT 0x0008 // Acknowledge Interrupts #define BSS_SRAM 0x0200 // AMBA module selection --> SRAM @@ -190,7 +190,7 @@ struct rx_desc { u32 Next; u16 MsduPos; u16 MsduSize; - + u8 State; u8 Status; u8 Rate; @@ -199,6 +199,7 @@ struct rx_desc { u8 PreambleType; u16 Duration; u32 RxTime; + }; #define RX_DESC_FLAG_VALID 0x80 @@ -217,15 +218,16 @@ struct rx_desc { #define RX_DESC_DURATION_OFFSET 14 #define RX_DESC_RX_TIME_OFFSET 16 + struct tx_desc { u32 NextDescriptor; u16 TxStartOfFrame; u16 TxLength; - + u8 TxState; u8 TxStatus; u8 RetryCount; - + u8 TxRate; u8 KeyIndex; @@ -236,8 +238,10 @@ struct tx_desc { u8 Reserved; u8 PacketType; u16 HostTxLength; + }; + #define TX_DESC_NEXT_OFFSET 0 #define TX_DESC_POS_OFFSET 4 #define TX_DESC_SIZE_OFFSET 6 @@ -251,6 +255,8 @@ struct tx_desc { #define TX_DESC_PACKET_TYPE_OFFSET 17 #define TX_DESC_HOST_LENGTH_OFFSET 18 + + /////////////////////////////////////////////////////// // Host-MAC interface /////////////////////////////////////////////////////// @@ -260,6 +266,7 @@ struct tx_desc { #define TX_FIRM_OWN 0x80 #define TX_DONE 0x40 + #define TX_ERROR 0x01 #define TX_PACKET_TYPE_DATA 0x01 @@ -273,7 +280,8 @@ struct tx_desc { #define ISR_COMMAND_COMPLETE 0x10 // command completed #define ISR_OUT_OF_RANGE 0x20 // command completed #define ISR_IBSS_MERGE 0x40 // (4.1.2.30): IBSS merge -#define ISR_GENERIC_IRQ 0x80 +#define ISR_GENERIC_IRQ 0x80 + #define Local_Mib_Type 0x01 #define Mac_Address_Mib_Type 0x02 @@ -309,6 +317,7 @@ struct tx_desc { #define LOCAL_MIB_PREAMBLE_TYPE 9 #define MAC_ADDR_MIB_MAC_ADDR_POS 0 + #define CMD_Set_MIB_Vars 0x01 #define CMD_Get_MIB_Vars 0x02 #define CMD_Scan 0x03 @@ -329,6 +338,7 @@ struct tx_desc { #define CMD_STATUS_HOST_ERROR 0xFF #define CMD_STATUS_BUSY 0xFE + #define CMD_BLOCK_COMMAND_OFFSET 0 #define CMD_BLOCK_STATUS_OFFSET 1 #define CMD_BLOCK_PARAMETERS_OFFSET 4 @@ -337,15 +347,15 @@ struct tx_desc { #define MGMT_FRAME_BODY_OFFSET 24 #define MAX_AUTHENTICATION_RETRIES 3 -#define MAX_ASSOCIATION_RETRIES 3 +#define MAX_ASSOCIATION_RETRIES 3 #define AUTHENTICATION_RESPONSE_TIME_OUT 1000 #define MAX_WIRELESS_BODY 2316 /* mtu is 2312, CRC is 4 */ #define LOOP_RETRY_LIMIT 500000 -#define ACTIVE_MODE 1 -#define PS_MODE 2 +#define ACTIVE_MODE 1 +#define PS_MODE 2 #define MAX_ENCRYPTION_KEYS 4 #define MAX_ENCRYPTION_KEY_SIZE 40 @@ -367,7 +377,7 @@ struct tx_desc { #define REG_DOMAIN_MKK1 0x41 //Channel 1-14 Japan(MKK1) #define REG_DOMAIN_ISRAEL 0x50 //Channel 3-9 ISRAEL -#define BSS_TYPE_AD_HOC 1 +#define BSS_TYPE_AD_HOC 1 #define BSS_TYPE_INFRASTRUCTURE 2 #define SCAN_TYPE_ACTIVE 0 @@ -379,7 +389,7 @@ struct tx_desc { #define DATA_FRAME_WS_HEADER_SIZE 30 -/* promiscuous mode control */ +/* promiscuous mode control */ #define PROM_MODE_OFF 0x0 #define PROM_MODE_UNKNOWN 0x1 #define PROM_MODE_CRC_FAILED 0x2 @@ -388,7 +398,8 @@ struct tx_desc { #define PROM_MODE_CTRL 0x10 #define PROM_MODE_BAD_PROTOCOL 0x20 -#define IFACE_INT_STATUS_OFFSET 0 + +#define IFACE_INT_STATUS_OFFSET 0 #define IFACE_INT_MASK_OFFSET 1 #define IFACE_LOCKOUT_HOST_OFFSET 2 #define IFACE_LOCKOUT_MAC_OFFSET 3 @@ -396,7 +407,7 @@ struct tx_desc { #define IFACE_MAC_STAT_OFFSET 30 #define IFACE_GENERIC_INT_TYPE_OFFSET 32 -#define CIPHER_SUITE_NONE 0 +#define CIPHER_SUITE_NONE 0 #define CIPHER_SUITE_WEP_64 1 #define CIPHER_SUITE_TKIP 2 #define CIPHER_SUITE_AES 3 @@ -408,11 +419,11 @@ struct tx_desc { // // -// FuncCtrl field: +// FuncCtrl field: // #define FUNC_CTRL_TxENABLE 0x10 #define FUNC_CTRL_RxENABLE 0x20 -#define FUNC_CTRL_INIT_COMPLETE 0x01 +#define FUNC_CTRL_INIT_COMPLETE 0x01 /* A stub firmware image which reads the MAC address from NVRAM on the card. For copyright information and source see the end of this file. */ @@ -475,10 +486,10 @@ struct atmel_private { struct net_device_stats stats; // device stats spinlock_t irqlock, timerlock; // spinlocks enum { BUS_TYPE_PCCARD, BUS_TYPE_PCI } bus_type; - enum { - CARD_TYPE_PARALLEL_FLASH, + enum { + CARD_TYPE_PARALLEL_FLASH, CARD_TYPE_SPI_FLASH, - CARD_TYPE_EEPROM + CARD_TYPE_EEPROM } card_type; int do_rx_crc; /* If we need to CRC incoming packets */ int probe_crc; /* set if we don't yet know */ @@ -486,18 +497,18 @@ struct atmel_private { u16 rx_desc_head; u16 tx_desc_free, tx_desc_head, tx_desc_tail, tx_desc_previous; u16 tx_free_mem, tx_buff_head, tx_buff_tail; - + u16 frag_seq, frag_len, frag_no; - u8 frag_source[6]; - + u8 frag_source[6]; + u8 wep_is_on, default_key, exclude_unencrypted, encryption_level; u8 group_cipher_suite, pairwise_cipher_suite; u8 wep_keys[MAX_ENCRYPTION_KEYS][MAX_ENCRYPTION_KEY_SIZE]; - int wep_key_len[MAX_ENCRYPTION_KEYS]; + int wep_key_len[MAX_ENCRYPTION_KEYS]; int use_wpa, radio_on_broken; /* firmware dependent stuff. */ u16 host_info_base; - struct host_info_struct { + struct host_info_struct { /* NB this is matched to the hardware, don't change. */ u8 volatile int_status; u8 volatile int_mask; @@ -513,20 +524,20 @@ struct atmel_private { u16 rx_buff_size; u16 rx_desc_pos; u16 rx_desc_count; - + u16 build_version; - u16 command_pos; - + u16 command_pos; + u16 major_version; u16 minor_version; - + u16 func_ctrl; u16 mac_status; u16 generic_IRQ_type; u8 reserved[2]; } host_info; - enum { + enum { STATION_STATE_SCANNING, STATION_STATE_JOINNING, STATION_STATE_AUTHENTICATING, @@ -536,7 +547,7 @@ struct atmel_private { STATION_STATE_DOWN, STATION_STATE_MGMT_ERROR } station_state; - + int operating_mode, power_mode; time_t last_qual; int beacons_this_sec; @@ -549,18 +560,18 @@ struct atmel_private { int long_retry, short_retry; int preamble; int default_beacon_period, beacon_period, listen_interval; - int CurrentAuthentTransactionSeqNum, ExpectedAuthentTransactionSeqNum; + int CurrentAuthentTransactionSeqNum, ExpectedAuthentTransactionSeqNum; int AuthenticationRequestRetryCnt, AssociationRequestRetryCnt, ReAssociationRequestRetryCnt; enum { SITE_SURVEY_IDLE, SITE_SURVEY_IN_PROGRESS, - SITE_SURVEY_COMPLETED + SITE_SURVEY_COMPLETED } site_survey_state; time_t last_survey; int station_was_associated, station_is_associated; int fast_scan; - + struct bss_info { int channel; int SSIDsize; @@ -573,12 +584,13 @@ struct atmel_private { u8 SSID[MAX_SSID_LENGTH]; } BSSinfo[MAX_BSS_ENTRIES]; int BSS_list_entries, current_BSS; - int connect_to_any_BSS; + int connect_to_any_BSS; int SSID_size, new_SSID_size; u8 CurrentBSSID[6], BSSID[6]; u8 SSID[MAX_SSID_LENGTH], new_SSID[MAX_SSID_LENGTH]; u64 last_beacon_timestamp; u8 rx_buf[MAX_WIRELESS_BODY]; + }; static u8 atmel_basic_rates[4] = {0x82,0x84,0x0b,0x16}; @@ -586,49 +598,39 @@ static u8 atmel_basic_rates[4] = {0x82,0x84,0x0b,0x16}; static const struct { int reg_domain; int min, max; - char *name; + char *name; } channel_table[] = { { REG_DOMAIN_FCC, 1, 11, "USA" }, { REG_DOMAIN_DOC, 1, 11, "Canada" }, { REG_DOMAIN_ETSI, 1, 13, "Europe" }, { REG_DOMAIN_SPAIN, 10, 11, "Spain" }, - { REG_DOMAIN_FRANCE, 10, 13, "France" }, + { REG_DOMAIN_FRANCE, 10, 13, "France" }, { REG_DOMAIN_MKK, 14, 14, "MKK" }, { REG_DOMAIN_MKK1, 1, 14, "MKK1" }, { REG_DOMAIN_ISRAEL, 3, 9, "Israel"} }; static void build_wpa_mib(struct atmel_private *priv); static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); -static void atmel_copy_to_card(struct net_device *dev, u16 dest, - unsigned char *src, u16 len); -static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest, - u16 src, u16 len); +static void atmel_copy_to_card(struct net_device *dev, u16 dest, unsigned char *src, u16 len); +static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest, u16 src, u16 len); static void atmel_set_gcr(struct net_device *dev, u16 mask); static void atmel_clear_gcr(struct net_device *dev, u16 mask); static int atmel_lock_mac(struct atmel_private *priv); static void atmel_wmem32(struct atmel_private *priv, u16 pos, u32 data); static void atmel_command_irq(struct atmel_private *priv); static int atmel_validate_channel(struct atmel_private *priv, int channel); -static void atmel_management_frame(struct atmel_private *priv, - struct ieee80211_hdr_4addr *header, +static void atmel_management_frame(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, u16 frame_len, u8 rssi); static void atmel_management_timer(u_long a); -static void atmel_send_command(struct atmel_private *priv, int command, - void *cmd, int cmd_size); -static int atmel_send_command_wait(struct atmel_private *priv, int command, - void *cmd, int cmd_size); -static void atmel_transmit_management_frame(struct atmel_private *priv, - struct ieee80211_hdr_4addr *header, +static void atmel_send_command(struct atmel_private *priv, int command, void *cmd, int cmd_size); +static int atmel_send_command_wait(struct atmel_private *priv, int command, void *cmd, int cmd_size); +static void atmel_transmit_management_frame(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, u8 *body, int body_len); static u8 atmel_get_mib8(struct atmel_private *priv, u8 type, u8 index); -static void atmel_set_mib8(struct atmel_private *priv, u8 type, u8 index, - u8 data); -static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, - u16 data); -static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, - u8 *data, int data_len); -static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index, - u8 *data, int data_len); +static void atmel_set_mib8(struct atmel_private *priv, u8 type, u8 index, u8 data); +static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, u16 data); +static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len); +static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len); static void atmel_scan(struct atmel_private *priv, int specific_ssid); static void atmel_join_bss(struct atmel_private *priv, int bss_index); static void atmel_smooth_qual(struct atmel_private *priv); @@ -648,12 +650,12 @@ static inline u16 atmel_co(struct atmel_private *priv, u16 offset) return priv->host_info.command_pos + offset; } -static inline u16 atmel_rx(struct atmel_private *priv, u16 offset, u16 desc) +static inline u16 atmel_rx(struct atmel_private *priv, u16 offset, u16 desc) { return priv->host_info.rx_desc_pos + (sizeof(struct rx_desc) * desc) + offset; } -static inline u16 atmel_tx(struct atmel_private *priv, u16 offset, u16 desc) +static inline u16 atmel_tx(struct atmel_private *priv, u16 offset, u16 desc) { return priv->host_info.tx_desc_pos + (sizeof(struct tx_desc) * desc) + offset; } @@ -680,25 +682,25 @@ static inline void atmel_write16(struct net_device *dev, u16 offset, u16 data) static inline u8 atmel_rmem8(struct atmel_private *priv, u16 pos) { - atmel_writeAR(priv->dev, pos); + atmel_writeAR(priv->dev, pos); return atmel_read8(priv->dev, DR); } static inline void atmel_wmem8(struct atmel_private *priv, u16 pos, u16 data) { - atmel_writeAR(priv->dev, pos); + atmel_writeAR(priv->dev, pos); atmel_write8(priv->dev, DR, data); } static inline u16 atmel_rmem16(struct atmel_private *priv, u16 pos) { - atmel_writeAR(priv->dev, pos); + atmel_writeAR(priv->dev, pos); return atmel_read16(priv->dev, DR); } static inline void atmel_wmem16(struct atmel_private *priv, u16 pos, u16 data) { - atmel_writeAR(priv->dev, pos); + atmel_writeAR(priv->dev, pos); atmel_write16(priv->dev, DR, data); } @@ -708,10 +710,11 @@ static void tx_done_irq(struct atmel_private *priv) { int i; - for (i = 0; + for (i = 0; atmel_rmem8(priv, atmel_tx(priv, TX_DESC_FLAGS_OFFSET, priv->tx_desc_head)) == TX_DONE && i < priv->host_info.tx_desc_count; i++) { + u8 status = atmel_rmem8(priv, atmel_tx(priv, TX_DESC_STATUS_OFFSET, priv->tx_desc_head)); u16 msdu_size = atmel_rmem16(priv, atmel_tx(priv, TX_DESC_SIZE_OFFSET, priv->tx_desc_head)); u8 type = atmel_rmem8(priv, atmel_tx(priv, TX_DESC_PACKET_TYPE_OFFSET, priv->tx_desc_head)); @@ -725,16 +728,16 @@ static void tx_done_irq(struct atmel_private *priv) priv->tx_buff_head = 0; else priv->tx_buff_head += msdu_size; - + if (priv->tx_desc_head < (priv->host_info.tx_desc_count - 1)) - priv->tx_desc_head++ ; + priv->tx_desc_head++ ; else priv->tx_desc_head = 0; - + if (type == TX_PACKET_TYPE_DATA) { if (status == TX_STATUS_SUCCESS) priv->stats.tx_packets++; - else + else priv->stats.tx_errors++; netif_wake_queue(priv->dev); } @@ -745,22 +748,21 @@ static u16 find_tx_buff(struct atmel_private *priv, u16 len) { u16 bottom_free = priv->host_info.tx_buff_size - priv->tx_buff_tail; - if (priv->tx_desc_free == 3 || priv->tx_free_mem < len) + if (priv->tx_desc_free == 3 || priv->tx_free_mem < len) return 0; - + if (bottom_free >= len) return priv->host_info.tx_buff_pos + priv->tx_buff_tail; - + if (priv->tx_free_mem - bottom_free >= len) { priv->tx_buff_tail = 0; return priv->host_info.tx_buff_pos; } - + return 0; } -static void tx_update_descriptor(struct atmel_private *priv, int is_bcast, - u16 len, u16 buff, u8 type) +static void tx_update_descriptor(struct atmel_private *priv, int is_bcast, u16 len, u16 buff, u8 type) { atmel_wmem16(priv, atmel_tx(priv, TX_DESC_POS_OFFSET, priv->tx_desc_tail), buff); atmel_wmem16(priv, atmel_tx(priv, TX_DESC_SIZE_OFFSET, priv->tx_desc_tail), len); @@ -773,8 +775,8 @@ static void tx_update_descriptor(struct atmel_private *priv, int is_bcast, int cipher_type, cipher_length; if (is_bcast) { cipher_type = priv->group_cipher_suite; - if (cipher_type == CIPHER_SUITE_WEP_64 || - cipher_type == CIPHER_SUITE_WEP_128) + if (cipher_type == CIPHER_SUITE_WEP_64 || + cipher_type == CIPHER_SUITE_WEP_128 ) cipher_length = 8; else if (cipher_type == CIPHER_SUITE_TKIP) cipher_length = 12; @@ -788,8 +790,8 @@ static void tx_update_descriptor(struct atmel_private *priv, int is_bcast, } } else { cipher_type = priv->pairwise_cipher_suite; - if (cipher_type == CIPHER_SUITE_WEP_64 || - cipher_type == CIPHER_SUITE_WEP_128) + if (cipher_type == CIPHER_SUITE_WEP_64 || + cipher_type == CIPHER_SUITE_WEP_128 ) cipher_length = 8; else if (cipher_type == CIPHER_SUITE_TKIP) cipher_length = 12; @@ -802,9 +804,9 @@ static void tx_update_descriptor(struct atmel_private *priv, int is_bcast, cipher_length = 0; } } - + atmel_wmem8(priv, atmel_tx(priv, TX_DESC_CIPHER_TYPE_OFFSET, priv->tx_desc_tail), - cipher_type); + cipher_type); atmel_wmem8(priv, atmel_tx(priv, TX_DESC_CIPHER_LENGTH_OFFSET, priv->tx_desc_tail), cipher_length); } @@ -813,46 +815,46 @@ static void tx_update_descriptor(struct atmel_private *priv, int is_bcast, if (priv->tx_desc_previous != priv->tx_desc_tail) atmel_wmem32(priv, atmel_tx(priv, TX_DESC_NEXT_OFFSET, priv->tx_desc_previous), 0); priv->tx_desc_previous = priv->tx_desc_tail; - if (priv->tx_desc_tail < (priv->host_info.tx_desc_count - 1)) + if (priv->tx_desc_tail < (priv->host_info.tx_desc_count -1 )) priv->tx_desc_tail++; else priv->tx_desc_tail = 0; priv->tx_desc_free--; priv->tx_free_mem -= len; + } -static int start_tx(struct sk_buff *skb, struct net_device *dev) +static int start_tx (struct sk_buff *skb, struct net_device *dev) { struct atmel_private *priv = netdev_priv(dev); struct ieee80211_hdr_4addr header; unsigned long flags; u16 buff, frame_ctl, len = (ETH_ZLEN < skb->len) ? skb->len : ETH_ZLEN; u8 SNAP_RFC1024[6] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00}; - - if (priv->card && priv->present_callback && + + if (priv->card && priv->present_callback && !(*priv->present_callback)(priv->card)) { priv->stats.tx_errors++; dev_kfree_skb(skb); return 0; } - + if (priv->station_state != STATION_STATE_READY) { priv->stats.tx_errors++; dev_kfree_skb(skb); return 0; } - + /* first ensure the timer func cannot run */ - spin_lock_bh(&priv->timerlock); + spin_lock_bh(&priv->timerlock); /* then stop the hardware ISR */ - spin_lock_irqsave(&priv->irqlock, flags); + spin_lock_irqsave(&priv->irqlock, flags); /* nb doing the above in the opposite order will deadlock */ - + /* The Wireless Header is 30 bytes. In the Ethernet packet we "cut" the - 12 first bytes (containing DA/SA) and put them in the appropriate - fields of the Wireless Header. Thus the packet length is then the - initial + 18 (+30-12) */ - + 12 first bytes (containing DA/SA) and put them in the appropriate fields of + the Wireless Header. Thus the packet length is then the initial + 18 (+30-12) */ + if (!(buff = find_tx_buff(priv, len + 18))) { priv->stats.tx_dropped++; spin_unlock_irqrestore(&priv->irqlock, flags); @@ -860,7 +862,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) netif_stop_queue(dev); return 1; } - + frame_ctl = IEEE80211_FTYPE_DATA; header.duration_id = 0; header.seq_ctl = 0; @@ -876,7 +878,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) memcpy(&header.addr2, dev->dev_addr, 6); memcpy(&header.addr3, skb->data, 6); } - + if (priv->use_wpa) memcpy(&header.addr4, SNAP_RFC1024, 6); @@ -886,27 +888,27 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) /* Copy the packet sans its 802.3 header addresses which have been replaced */ atmel_copy_to_card(dev, buff + DATA_FRAME_WS_HEADER_SIZE, skb->data + 12, len - 12); priv->tx_buff_tail += len - 12 + DATA_FRAME_WS_HEADER_SIZE; - + /* low bit of first byte of destination tells us if broadcast */ tx_update_descriptor(priv, *(skb->data) & 0x01, len + 18, buff, TX_PACKET_TYPE_DATA); dev->trans_start = jiffies; priv->stats.tx_bytes += len; - + spin_unlock_irqrestore(&priv->irqlock, flags); spin_unlock_bh(&priv->timerlock); dev_kfree_skb(skb); - - return 0; + + return 0; } -static void atmel_transmit_management_frame(struct atmel_private *priv, +static void atmel_transmit_management_frame(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, u8 *body, int body_len) { u16 buff; - int len = MGMT_FRAME_BODY_OFFSET + body_len; - - if (!(buff = find_tx_buff(priv, len))) + int len = MGMT_FRAME_BODY_OFFSET + body_len; + + if (!(buff = find_tx_buff(priv, len))) return; atmel_copy_to_card(priv->dev, buff, (u8 *)header, MGMT_FRAME_BODY_OFFSET); @@ -914,25 +916,24 @@ static void atmel_transmit_management_frame(struct atmel_private *priv, priv->tx_buff_tail += len; tx_update_descriptor(priv, header->addr1[0] & 0x01, len, buff, TX_PACKET_TYPE_MGMT); } - -static void fast_rx_path(struct atmel_private *priv, - struct ieee80211_hdr_4addr *header, + +static void fast_rx_path(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, u16 msdu_size, u16 rx_packet_loc, u32 crc) { /* fast path: unfragmented packet copy directly into skbuf */ - u8 mac4[6]; - struct sk_buff *skb; + u8 mac4[6]; + struct sk_buff *skb; unsigned char *skbp; - + /* get the final, mac 4 header field, this tells us encapsulation */ atmel_copy_to_host(priv->dev, mac4, rx_packet_loc + 24, 6); msdu_size -= 6; - + if (priv->do_rx_crc) { crc = crc32_le(crc, mac4, 6); msdu_size -= 4; } - + if (!(skb = dev_alloc_skb(msdu_size + 14))) { priv->stats.rx_dropped++; return; @@ -941,7 +942,7 @@ static void fast_rx_path(struct atmel_private *priv, skb_reserve(skb, 2); skbp = skb_put(skb, msdu_size + 12); atmel_copy_to_host(priv->dev, skbp + 12, rx_packet_loc + 30, msdu_size); - + if (priv->do_rx_crc) { u32 netcrc; crc = crc32_le(crc, skbp + 12, msdu_size); @@ -952,25 +953,24 @@ static void fast_rx_path(struct atmel_private *priv, return; } } - + memcpy(skbp, header->addr1, 6); /* destination address */ - if (le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_FROMDS) + if (le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_FROMDS) memcpy(&skbp[6], header->addr3, 6); else memcpy(&skbp[6], header->addr2, 6); /* source address */ - - priv->dev->last_rx = jiffies; + + priv->dev->last_rx=jiffies; skb->dev = priv->dev; skb->protocol = eth_type_trans(skb, priv->dev); - skb->ip_summed = CHECKSUM_NONE; + skb->ip_summed = CHECKSUM_NONE; netif_rx(skb); priv->stats.rx_bytes += 12 + msdu_size; priv->stats.rx_packets++; } /* Test to see if the packet in card memory at packet_loc has a valid CRC - It doesn't matter that this is slow: it is only used to proble the first few - packets. */ + It doesn't matter that this is slow: it is only used to proble the first few packets. */ static int probe_crc(struct atmel_private *priv, u16 packet_loc, u16 msdu_size) { int i = msdu_size - 4; @@ -980,7 +980,7 @@ static int probe_crc(struct atmel_private *priv, u16 packet_loc, u16 msdu_size) return 0; atmel_copy_to_host(priv->dev, (void *)&netcrc, packet_loc + i, 4); - + atmel_writeAR(priv->dev, packet_loc); while (i--) { u8 octet = atmel_read8(priv->dev, DR); @@ -990,22 +990,20 @@ static int probe_crc(struct atmel_private *priv, u16 packet_loc, u16 msdu_size) return (crc ^ 0xffffffff) == netcrc; } -static void frag_rx_path(struct atmel_private *priv, - struct ieee80211_hdr_4addr *header, - u16 msdu_size, u16 rx_packet_loc, u32 crc, u16 seq_no, - u8 frag_no, int more_frags) +static void frag_rx_path(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, + u16 msdu_size, u16 rx_packet_loc, u32 crc, u16 seq_no, u8 frag_no, int more_frags) { - u8 mac4[6]; + u8 mac4[6]; u8 source[6]; struct sk_buff *skb; - if (le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_FROMDS) + if (le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_FROMDS) memcpy(source, header->addr3, 6); else - memcpy(source, header->addr2, 6); - + memcpy(source, header->addr2, 6); + rx_packet_loc += 24; /* skip header */ - + if (priv->do_rx_crc) msdu_size -= 4; @@ -1014,16 +1012,16 @@ static void frag_rx_path(struct atmel_private *priv, msdu_size -= 6; rx_packet_loc += 6; - if (priv->do_rx_crc) + if (priv->do_rx_crc) crc = crc32_le(crc, mac4, 6); - + priv->frag_seq = seq_no; priv->frag_no = 1; priv->frag_len = msdu_size; - memcpy(priv->frag_source, source, 6); + memcpy(priv->frag_source, source, 6); memcpy(&priv->rx_buf[6], source, 6); memcpy(priv->rx_buf, header->addr1, 6); - + atmel_copy_to_host(priv->dev, &priv->rx_buf[12], rx_packet_loc, msdu_size); if (priv->do_rx_crc) { @@ -1035,17 +1033,17 @@ static void frag_rx_path(struct atmel_private *priv, memset(priv->frag_source, 0xff, 6); } } - + } else if (priv->frag_no == frag_no && priv->frag_seq == seq_no && memcmp(priv->frag_source, source, 6) == 0) { - - atmel_copy_to_host(priv->dev, &priv->rx_buf[12 + priv->frag_len], + + atmel_copy_to_host(priv->dev, &priv->rx_buf[12 + priv->frag_len], rx_packet_loc, msdu_size); if (priv->do_rx_crc) { u32 netcrc; - crc = crc32_le(crc, - &priv->rx_buf[12 + priv->frag_len], + crc = crc32_le(crc, + &priv->rx_buf[12 + priv->frag_len], msdu_size); atmel_copy_to_host(priv->dev, (void *)&netcrc, rx_packet_loc + msdu_size, 4); if ((crc ^ 0xffffffff) != netcrc) { @@ -1054,7 +1052,7 @@ static void frag_rx_path(struct atmel_private *priv, more_frags = 1; /* don't send broken assembly */ } } - + priv->frag_len += msdu_size; priv->frag_no++; @@ -1064,60 +1062,60 @@ static void frag_rx_path(struct atmel_private *priv, priv->stats.rx_dropped++; } else { skb_reserve(skb, 2); - memcpy(skb_put(skb, priv->frag_len + 12), + memcpy(skb_put(skb, priv->frag_len + 12), priv->rx_buf, priv->frag_len + 12); priv->dev->last_rx = jiffies; skb->dev = priv->dev; skb->protocol = eth_type_trans(skb, priv->dev); - skb->ip_summed = CHECKSUM_NONE; + skb->ip_summed = CHECKSUM_NONE; netif_rx(skb); priv->stats.rx_bytes += priv->frag_len + 12; priv->stats.rx_packets++; } } + } else priv->wstats.discard.fragment++; } - + static void rx_done_irq(struct atmel_private *priv) { int i; struct ieee80211_hdr_4addr header; - - for (i = 0; + + for (i = 0; atmel_rmem8(priv, atmel_rx(priv, RX_DESC_FLAGS_OFFSET, priv->rx_desc_head)) == RX_DESC_FLAG_VALID && i < priv->host_info.rx_desc_count; i++) { - + u16 msdu_size, rx_packet_loc, frame_ctl, seq_control; u8 status = atmel_rmem8(priv, atmel_rx(priv, RX_DESC_STATUS_OFFSET, priv->rx_desc_head)); u32 crc = 0xffffffff; - + if (status != RX_STATUS_SUCCESS) { if (status == 0xc1) /* determined by experiment */ priv->wstats.discard.nwid++; else - priv->stats.rx_errors++; + priv->stats.rx_errors++; goto next; } msdu_size = atmel_rmem16(priv, atmel_rx(priv, RX_DESC_MSDU_SIZE_OFFSET, priv->rx_desc_head)); rx_packet_loc = atmel_rmem16(priv, atmel_rx(priv, RX_DESC_MSDU_POS_OFFSET, priv->rx_desc_head)); - + if (msdu_size < 30) { - priv->stats.rx_errors++; + priv->stats.rx_errors++; goto next; } - + /* Get header as far as end of seq_ctl */ atmel_copy_to_host(priv->dev, (char *)&header, rx_packet_loc, 24); frame_ctl = le16_to_cpu(header.frame_ctl); seq_control = le16_to_cpu(header.seq_ctl); - /* probe for CRC use here if needed once five packets have - arrived with the same crc status, we assume we know what's - happening and stop probing */ + /* probe for CRC use here if needed once five packets have arrived with + the same crc status, we assume we know what's happening and stop probing */ if (priv->probe_crc) { if (!priv->wep_is_on || !(frame_ctl & IEEE80211_FCTL_PROTECTED)) { priv->do_rx_crc = probe_crc(priv, rx_packet_loc, msdu_size); @@ -1132,33 +1130,34 @@ static void rx_done_irq(struct atmel_private *priv) priv->probe_crc = 0; } } - + /* don't CRC header when WEP in use */ if (priv->do_rx_crc && (!priv->wep_is_on || !(frame_ctl & IEEE80211_FCTL_PROTECTED))) { crc = crc32_le(0xffffffff, (unsigned char *)&header, 24); } msdu_size -= 24; /* header */ - if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { + if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { + int more_fragments = frame_ctl & IEEE80211_FCTL_MOREFRAGS; u8 packet_fragment_no = seq_control & IEEE80211_SCTL_FRAG; u16 packet_sequence_no = (seq_control & IEEE80211_SCTL_SEQ) >> 4; - - if (!more_fragments && packet_fragment_no == 0) { + + if (!more_fragments && packet_fragment_no == 0 ) { fast_rx_path(priv, &header, msdu_size, rx_packet_loc, crc); } else { frag_rx_path(priv, &header, msdu_size, rx_packet_loc, crc, packet_sequence_no, packet_fragment_no, more_fragments); } } - + if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) { /* copy rest of packet into buffer */ atmel_copy_to_host(priv->dev, (unsigned char *)&priv->rx_buf, rx_packet_loc + 24, msdu_size); - + /* we use the same buffer for frag reassembly and control packets */ memset(priv->frag_source, 0xff, 6); - + if (priv->do_rx_crc) { /* last 4 octets is crc */ msdu_size -= 4; @@ -1171,18 +1170,18 @@ static void rx_done_irq(struct atmel_private *priv) atmel_management_frame(priv, &header, msdu_size, atmel_rmem8(priv, atmel_rx(priv, RX_DESC_RSSI_OFFSET, priv->rx_desc_head))); - } + } -next: + next: /* release descriptor */ - atmel_wmem8(priv, atmel_rx(priv, RX_DESC_FLAGS_OFFSET, priv->rx_desc_head), RX_DESC_FLAG_CONSUMED); - + atmel_wmem8(priv, atmel_rx(priv, RX_DESC_FLAGS_OFFSET, priv->rx_desc_head), RX_DESC_FLAG_CONSUMED); + if (priv->rx_desc_head < (priv->host_info.rx_desc_count - 1)) - priv->rx_desc_head++; + priv->rx_desc_head++; else priv->rx_desc_head = 0; } -} +} static irqreturn_t service_interrupt(int irq, void *dev_id, struct pt_regs *regs) { @@ -1190,7 +1189,7 @@ static irqreturn_t service_interrupt(int irq, void *dev_id, struct pt_regs *regs struct atmel_private *priv = netdev_priv(dev); u8 isr; int i = -1; - static u8 irq_order[] = { + static u8 irq_order[] = { ISR_OUT_OF_RANGE, ISR_RxCOMPLETE, ISR_TxCOMPLETE, @@ -1200,19 +1199,20 @@ static irqreturn_t service_interrupt(int irq, void *dev_id, struct pt_regs *regs ISR_IBSS_MERGE, ISR_GENERIC_IRQ }; + - if (priv->card && priv->present_callback && + if (priv->card && priv->present_callback && !(*priv->present_callback)(priv->card)) return IRQ_HANDLED; /* In this state upper-level code assumes it can mess with the card unhampered by interrupts which may change register state. Note that even though the card shouldn't generate interrupts - the inturrupt line may be shared. This allows card setup + the inturrupt line may be shared. This allows card setup to go on without disabling interrupts for a long time. */ if (priv->station_state == STATION_STATE_DOWN) return IRQ_NONE; - + atmel_clear_gcr(dev, GCR_ENINT); /* disable interrupts */ while (1) { @@ -1221,36 +1221,36 @@ static irqreturn_t service_interrupt(int irq, void *dev_id, struct pt_regs *regs printk(KERN_ALERT "%s: failed to contact MAC.\n", dev->name); return IRQ_HANDLED; } - + isr = atmel_rmem8(priv, atmel_hi(priv, IFACE_INT_STATUS_OFFSET)); atmel_wmem8(priv, atmel_hi(priv, IFACE_LOCKOUT_MAC_OFFSET), 0); - + if (!isr) { atmel_set_gcr(dev, GCR_ENINT); /* enable interrupts */ return i == -1 ? IRQ_NONE : IRQ_HANDLED; } - + atmel_set_gcr(dev, GCR_ACKINT); /* acknowledge interrupt */ - + for (i = 0; i < sizeof(irq_order)/sizeof(u8); i++) if (isr & irq_order[i]) break; - + if (!atmel_lock_mac(priv)) { /* failed to contact card */ printk(KERN_ALERT "%s: failed to contact MAC.\n", dev->name); return IRQ_HANDLED; } - + isr = atmel_rmem8(priv, atmel_hi(priv, IFACE_INT_STATUS_OFFSET)); isr ^= irq_order[i]; atmel_wmem8(priv, atmel_hi(priv, IFACE_INT_STATUS_OFFSET), isr); atmel_wmem8(priv, atmel_hi(priv, IFACE_LOCKOUT_MAC_OFFSET), 0); - + switch (irq_order[i]) { - - case ISR_OUT_OF_RANGE: - if (priv->operating_mode == IW_MODE_INFRA && + + case ISR_OUT_OF_RANGE: + if (priv->operating_mode == IW_MODE_INFRA && priv->station_state == STATION_STATE_READY) { priv->station_is_associated = 0; atmel_scan(priv, 1); @@ -1261,24 +1261,24 @@ static irqreturn_t service_interrupt(int irq, void *dev_id, struct pt_regs *regs priv->wstats.discard.misc++; /* fall through */ case ISR_RxCOMPLETE: - rx_done_irq(priv); + rx_done_irq(priv); break; - + case ISR_TxCOMPLETE: - tx_done_irq(priv); + tx_done_irq(priv); break; - + case ISR_FATAL_ERROR: printk(KERN_ALERT "%s: *** FATAL error interrupt ***\n", dev->name); atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); break; - - case ISR_COMMAND_COMPLETE: + + case ISR_COMMAND_COMPLETE: atmel_command_irq(priv); break; case ISR_IBSS_MERGE: - atmel_get_mib(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_CUR_BSSID_POS, + atmel_get_mib(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_CUR_BSSID_POS, priv->CurrentBSSID, 6); /* The WPA stuff cares about the current AP address */ if (priv->use_wpa) @@ -1288,23 +1288,24 @@ static irqreturn_t service_interrupt(int irq, void *dev_id, struct pt_regs *regs printk(KERN_INFO "%s: Generic_irq received.\n", dev->name); break; } - } + } } -static struct net_device_stats *atmel_get_stats(struct net_device *dev) + +static struct net_device_stats *atmel_get_stats (struct net_device *dev) { struct atmel_private *priv = netdev_priv(dev); return &priv->stats; } -static struct iw_statistics *atmel_get_wireless_stats(struct net_device *dev) +static struct iw_statistics *atmel_get_wireless_stats (struct net_device *dev) { struct atmel_private *priv = netdev_priv(dev); - /* update the link quality here in case we are seeing no beacons + /* update the link quality here in case we are seeing no beacons at all to drive the process */ atmel_smooth_qual(priv); - + priv->wstats.status = priv->station_state; if (priv->operating_mode == IW_MODE_INFRA) { @@ -1327,8 +1328,8 @@ static struct iw_statistics *atmel_get_wireless_stats(struct net_device *dev) | IW_QUAL_NOISE_INVALID; priv->wstats.miss.beacon = 0; } - - return &priv->wstats; + + return (&priv->wstats); } static int atmel_change_mtu(struct net_device *dev, int new_mtu) @@ -1342,21 +1343,21 @@ static int atmel_change_mtu(struct net_device *dev, int new_mtu) static int atmel_set_mac_address(struct net_device *dev, void *p) { struct sockaddr *addr = p; - + memcpy (dev->dev_addr, addr->sa_data, dev->addr_len); return atmel_open(dev); } EXPORT_SYMBOL(atmel_open); -int atmel_open(struct net_device *dev) +int atmel_open (struct net_device *dev) { struct atmel_private *priv = netdev_priv(dev); int i, channel; /* any scheduled timer is no longer needed and might screw things up.. */ del_timer_sync(&priv->management_timer); - + /* Interrupts will not touch the card once in this state... */ priv->station_state = STATION_STATE_DOWN; @@ -1376,7 +1377,7 @@ int atmel_open(struct net_device *dev) priv->site_survey_state = SITE_SURVEY_IDLE; priv->station_is_associated = 0; - if (!reset_atmel_card(dev)) + if (!reset_atmel_card(dev)) return -EAGAIN; if (priv->config_reg_domain) { @@ -1390,26 +1391,26 @@ int atmel_open(struct net_device *dev) if (i == sizeof(channel_table)/sizeof(channel_table[0])) { priv->reg_domain = REG_DOMAIN_MKK1; printk(KERN_ALERT "%s: failed to get regulatory domain: assuming MKK1.\n", dev->name); - } + } } - + if ((channel = atmel_validate_channel(priv, priv->channel))) priv->channel = channel; - /* this moves station_state on.... */ - atmel_scan(priv, 1); + /* this moves station_state on.... */ + atmel_scan(priv, 1); atmel_set_gcr(priv->dev, GCR_ENINT); /* enable interrupts */ return 0; } -static int atmel_close(struct net_device *dev) +static int atmel_close (struct net_device *dev) { struct atmel_private *priv = netdev_priv(dev); - + atmel_enter_state(priv, STATION_STATE_DOWN); - - if (priv->bus_type == BUS_TYPE_PCCARD) + + if (priv->bus_type == BUS_TYPE_PCCARD) atmel_write16(dev, GCR, 0x0060); atmel_write16(dev, GCR, 0x0040); return 0; @@ -1437,46 +1438,43 @@ static int atmel_proc_output (char *buf, struct atmel_private *priv) int i; char *p = buf; char *s, *r, *c; - - p += sprintf(p, "Driver version:\t\t%d.%d\n", - DRIVER_MAJOR, DRIVER_MINOR); - + + p += sprintf(p, "Driver version:\t\t%d.%d\n", DRIVER_MAJOR, DRIVER_MINOR); + if (priv->station_state != STATION_STATE_DOWN) { - p += sprintf(p, "Firmware version:\t%d.%d build %d\n" - "Firmware location:\t", + p += sprintf(p, "Firmware version:\t%d.%d build %d\nFirmware location:\t", priv->host_info.major_version, priv->host_info.minor_version, priv->host_info.build_version); - - if (priv->card_type != CARD_TYPE_EEPROM) + + if (priv->card_type != CARD_TYPE_EEPROM) p += sprintf(p, "on card\n"); - else if (priv->firmware) - p += sprintf(p, "%s loaded by host\n", - priv->firmware_id); + else if (priv->firmware) + p += sprintf(p, "%s loaded by host\n", priv->firmware_id); else - p += sprintf(p, "%s loaded by hotplug\n", - priv->firmware_id); - - switch (priv->card_type) { + p += sprintf(p, "%s loaded by hotplug\n", priv->firmware_id); + + switch(priv->card_type) { case CARD_TYPE_PARALLEL_FLASH: c = "Parallel flash"; break; case CARD_TYPE_SPI_FLASH: c = "SPI flash\n"; break; case CARD_TYPE_EEPROM: c = "EEPROM"; break; default: c = ""; } + r = ""; for (i = 0; i < sizeof(channel_table)/sizeof(channel_table[0]); i++) if (priv->reg_domain == channel_table[i].reg_domain) r = channel_table[i].name; - + p += sprintf(p, "MAC memory type:\t%s\n", c); p += sprintf(p, "Regulatory domain:\t%s\n", r); - p += sprintf(p, "Host CRC checking:\t%s\n", + p += sprintf(p, "Host CRC checking:\t%s\n", priv->do_rx_crc ? "On" : "Off"); p += sprintf(p, "WPA-capable firmware:\t%s\n", priv->use_wpa ? "Yes" : "No"); } - + switch(priv->station_state) { case STATION_STATE_SCANNING: s = "Scanning"; break; case STATION_STATE_JOINNING: s = "Joining"; break; @@ -1488,9 +1486,9 @@ static int atmel_proc_output (char *buf, struct atmel_private *priv) case STATION_STATE_DOWN: s = "Down"; break; default: s = ""; } - + p += sprintf(p, "Current state:\t\t%s\n", s); - return p - buf; + return p - buf; } static int atmel_read_proc(char *page, char **start, off_t off, @@ -1506,12 +1504,9 @@ static int atmel_read_proc(char *page, char **start, off_t off, return len; } -struct net_device *init_atmel_card(unsigned short irq, unsigned long port, - const AtmelFWType fw_type, - struct device *sys_dev, - int (*card_present)(void *), void *card) +struct net_device *init_atmel_card( unsigned short irq, unsigned long port, const AtmelFWType fw_type, + struct device *sys_dev, int (*card_present)(void *), void *card) { - struct proc_dir_entry *ent; struct net_device *dev; struct atmel_private *priv; int rc; @@ -1519,11 +1514,11 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port, /* Create the network device object. */ dev = alloc_etherdev(sizeof(*priv)); if (!dev) { - printk(KERN_ERR "atmel: Couldn't alloc_etherdev\n"); + printk(KERN_ERR "atmel: Couldn't alloc_etherdev\n"); return NULL; } if (dev_alloc_name(dev, dev->name) < 0) { - printk(KERN_ERR "atmel: Couldn't get name!\n"); + printk(KERN_ERR "atmel: Couldn't get name!\n"); goto err_out_free; } @@ -1555,7 +1550,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port, memset(priv->BSSID, 0, 6); priv->CurrentBSSID[0] = 0xFF; /* Initialize to something invalid.... */ priv->station_was_associated = 0; - + priv->last_survey = jiffies; priv->preamble = LONG_PREAMBLE; priv->operating_mode = IW_MODE_INFRA; @@ -1591,7 +1586,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port, spin_lock_init(&priv->timerlock); priv->management_timer.function = atmel_management_timer; priv->management_timer.data = (unsigned long) dev; - + dev->open = atmel_open; dev->stop = atmel_close; dev->change_mtu = atmel_change_mtu; @@ -1602,46 +1597,44 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port, dev->do_ioctl = atmel_ioctl; dev->irq = irq; dev->base_addr = port; - + SET_NETDEV_DEV(dev, sys_dev); - + if ((rc = request_irq(dev->irq, service_interrupt, SA_SHIRQ, dev->name, dev))) { - printk(KERN_ERR "%s: register interrupt %d failed, rc %d\n", dev->name, irq, rc); + printk(KERN_ERR "%s: register interrupt %d failed, rc %d\n", dev->name, irq, rc ); goto err_out_free; } - if (!request_region(dev->base_addr, 32, + if (!request_region(dev->base_addr, 32, priv->bus_type == BUS_TYPE_PCCARD ? "atmel_cs" : "atmel_pci")) { goto err_out_irq; } - + if (register_netdev(dev)) goto err_out_res; - + if (!probe_atmel_card(dev)){ unregister_netdev(dev); goto err_out_res; } - + netif_carrier_off(dev); - - ent = create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv); - if (!ent) - printk(KERN_WARNING "atmel: unable to create /proc entry.\n"); - + + create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv); + printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", dev->name, DRIVER_MAJOR, DRIVER_MINOR, dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5] ); - + SET_MODULE_OWNER(dev); return dev; - -err_out_res: + + err_out_res: release_region( dev->base_addr, 32); -err_out_irq: + err_out_irq: free_irq(dev->irq, dev); -err_out_free: + err_out_free: free_netdev(dev); return NULL; } @@ -1651,12 +1644,12 @@ EXPORT_SYMBOL(init_atmel_card); void stop_atmel_card(struct net_device *dev) { struct atmel_private *priv = netdev_priv(dev); - + /* put a brick on it... */ - if (priv->bus_type == BUS_TYPE_PCCARD) + if (priv->bus_type == BUS_TYPE_PCCARD) atmel_write16(dev, GCR, 0x0060); atmel_write16(dev, GCR, 0x0040); - + del_timer_sync(&priv->management_timer); unregister_netdev(dev); remove_proc_entry("driver/atmel", NULL); @@ -1682,13 +1675,13 @@ static int atmel_set_essid(struct net_device *dev, int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; priv->connect_to_any_BSS = 0; - + /* Check the size of the string */ if (dwrq->length > MAX_SSID_LENGTH + 1) - return -E2BIG; + return -E2BIG ; if (index != 0) return -EINVAL; - + memcpy(priv->new_SSID, extra, dwrq->length - 1); priv->new_SSID_size = dwrq->length - 1; } @@ -1713,7 +1706,7 @@ static int atmel_get_essid(struct net_device *dev, extra[priv->SSID_size] = '\0'; dwrq->length = priv->SSID_size + 1; } - + dwrq->flags = !priv->connect_to_any_BSS; /* active */ return 0; @@ -1775,7 +1768,7 @@ static int atmel_set_encode(struct net_device *dev, /* WE specify that if a valid key is set, encryption * should be enabled (user may turn it off later) * This is also how "iwconfig ethX key on" works */ - if (index == current_index && + if (index == current_index && priv->wep_key_len[index] > 0) { priv->wep_is_on = 1; priv->exclude_unencrypted = 1; @@ -1790,18 +1783,18 @@ static int atmel_set_encode(struct net_device *dev, } else { /* Do we want to just set the transmit key index ? */ int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; - if (index >= 0 && index < 4) { + if ( index>=0 && index < 4 ) { priv->default_key = index; } else /* Don't complain if only change the mode */ - if (!dwrq->flags & IW_ENCODE_MODE) { + if(!dwrq->flags & IW_ENCODE_MODE) { return -EINVAL; } } /* Read the flags */ - if (dwrq->flags & IW_ENCODE_DISABLED) { + if(dwrq->flags & IW_ENCODE_DISABLED) { priv->wep_is_on = 0; - priv->encryption_level = 0; + priv->encryption_level = 0; priv->pairwise_cipher_suite = CIPHER_SUITE_NONE; } else { priv->wep_is_on = 1; @@ -1813,14 +1806,15 @@ static int atmel_set_encode(struct net_device *dev, priv->encryption_level = 1; } } - if (dwrq->flags & IW_ENCODE_RESTRICTED) + if(dwrq->flags & IW_ENCODE_RESTRICTED) priv->exclude_unencrypted = 1; - if(dwrq->flags & IW_ENCODE_OPEN) + if(dwrq->flags & IW_ENCODE_OPEN) priv->exclude_unencrypted = 0; - + return -EINPROGRESS; /* Call commit handler */ } + static int atmel_get_encode(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, @@ -1828,7 +1822,7 @@ static int atmel_get_encode(struct net_device *dev, { struct atmel_private *priv = netdev_priv(dev); int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; - + if (!priv->wep_is_on) dwrq->flags = IW_ENCODE_DISABLED; else { @@ -1849,7 +1843,7 @@ static int atmel_get_encode(struct net_device *dev, memset(extra, 0, 16); memcpy(extra, priv->wep_keys[index], dwrq->length); } - + return 0; } @@ -1868,17 +1862,17 @@ static int atmel_set_rate(struct net_device *dev, char *extra) { struct atmel_private *priv = netdev_priv(dev); - + if (vwrq->fixed == 0) { priv->tx_rate = 3; priv->auto_tx_rate = 1; } else { priv->auto_tx_rate = 0; - + /* Which type of value ? */ - if ((vwrq->value < 4) && (vwrq->value >= 0)) { + if((vwrq->value < 4) && (vwrq->value >= 0)) { /* Setting by rate index */ - priv->tx_rate = vwrq->value; + priv->tx_rate = vwrq->value; } else { /* Setting by frequency value */ switch (vwrq->value) { @@ -1905,7 +1899,7 @@ static int atmel_set_mode(struct net_device *dev, return -EINVAL; priv->operating_mode = *uwrq; - return -EINPROGRESS; + return -EINPROGRESS; } static int atmel_get_mode(struct net_device *dev, @@ -1914,7 +1908,7 @@ static int atmel_get_mode(struct net_device *dev, char *extra) { struct atmel_private *priv = netdev_priv(dev); - + *uwrq = priv->operating_mode; return 0; } @@ -1968,9 +1962,9 @@ static int atmel_set_retry(struct net_device *dev, char *extra) { struct atmel_private *priv = netdev_priv(dev); - - if (!vwrq->disabled && (vwrq->flags & IW_RETRY_LIMIT)) { - if (vwrq->flags & IW_RETRY_MAX) + + if(!vwrq->disabled && (vwrq->flags & IW_RETRY_LIMIT)) { + if(vwrq->flags & IW_RETRY_MAX) priv->long_retry = vwrq->value; else if (vwrq->flags & IW_RETRY_MIN) priv->short_retry = vwrq->value; @@ -1979,9 +1973,9 @@ static int atmel_set_retry(struct net_device *dev, priv->long_retry = vwrq->value; priv->short_retry = vwrq->value; } - return -EINPROGRESS; + return -EINPROGRESS; } - + return -EINVAL; } @@ -1995,13 +1989,13 @@ static int atmel_get_retry(struct net_device *dev, vwrq->disabled = 0; /* Can't be disabled */ /* Note : by default, display the min retry number */ - if (vwrq->flags & IW_RETRY_MAX) { + if((vwrq->flags & IW_RETRY_MAX)) { vwrq->flags = IW_RETRY_LIMIT | IW_RETRY_MAX; vwrq->value = priv->long_retry; } else { vwrq->flags = IW_RETRY_LIMIT; vwrq->value = priv->short_retry; - if (priv->long_retry != priv->short_retry) + if(priv->long_retry != priv->short_retry) vwrq->flags |= IW_RETRY_MIN; } @@ -2016,13 +2010,13 @@ static int atmel_set_rts(struct net_device *dev, struct atmel_private *priv = netdev_priv(dev); int rthr = vwrq->value; - if (vwrq->disabled) + if(vwrq->disabled) rthr = 2347; - if ((rthr < 0) || (rthr > 2347)) { + if((rthr < 0) || (rthr > 2347)) { return -EINVAL; } priv->rts_threshold = rthr; - + return -EINPROGRESS; /* Call commit handler */ } @@ -2032,7 +2026,7 @@ static int atmel_get_rts(struct net_device *dev, char *extra) { struct atmel_private *priv = netdev_priv(dev); - + vwrq->value = priv->rts_threshold; vwrq->disabled = (vwrq->value >= 2347); vwrq->fixed = 1; @@ -2048,14 +2042,14 @@ static int atmel_set_frag(struct net_device *dev, struct atmel_private *priv = netdev_priv(dev); int fthr = vwrq->value; - if (vwrq->disabled) + if(vwrq->disabled) fthr = 2346; - if ((fthr < 256) || (fthr > 2346)) { + if((fthr < 256) || (fthr > 2346)) { return -EINVAL; } fthr &= ~0x1; /* Get an even value - is it really needed ??? */ priv->frag_threshold = fthr; - + return -EINPROGRESS; /* Call commit handler */ } @@ -2083,21 +2077,21 @@ static int atmel_set_freq(struct net_device *dev, { struct atmel_private *priv = netdev_priv(dev); int rc = -EINPROGRESS; /* Call commit handler */ - + /* If setting by frequency, convert to a channel */ - if ((fwrq->e == 1) && - (fwrq->m >= (int) 241200000) && - (fwrq->m <= (int) 248700000)) { + if((fwrq->e == 1) && + (fwrq->m >= (int) 241200000) && + (fwrq->m <= (int) 248700000)) { int f = fwrq->m / 100000; int c = 0; - while ((c < 14) && (f != frequency_list[c])) + while((c < 14) && (f != frequency_list[c])) c++; /* Hack to fall through... */ fwrq->e = 0; fwrq->m = c + 1; } /* Setting by channel number */ - if ((fwrq->m > 1000) || (fwrq->e > 0)) + if((fwrq->m > 1000) || (fwrq->e > 0)) rc = -EOPNOTSUPP; else { int channel = fwrq->m; @@ -2105,7 +2099,7 @@ static int atmel_set_freq(struct net_device *dev, priv->channel = channel; } else { rc = -EINVAL; - } + } } return rc; } @@ -2136,7 +2130,7 @@ static int atmel_set_scan(struct net_device *dev, * This is not an error, while the device perform scanning, * traffic doesn't flow, so it's a perfect DoS... * Jean II */ - + if (priv->station_state == STATION_STATE_DOWN) return -EAGAIN; @@ -2148,15 +2142,15 @@ static int atmel_set_scan(struct net_device *dev, /* Initiate a scan command */ if (priv->site_survey_state == SITE_SURVEY_IN_PROGRESS) return -EBUSY; - + del_timer_sync(&priv->management_timer); spin_lock_irqsave(&priv->irqlock, flags); - + priv->site_survey_state = SITE_SURVEY_IN_PROGRESS; priv->fast_scan = 0; atmel_scan(priv, 0); spin_unlock_irqrestore(&priv->irqlock, flags); - + return 0; } @@ -2169,11 +2163,11 @@ static int atmel_get_scan(struct net_device *dev, int i; char *current_ev = extra; struct iw_event iwe; - + if (priv->site_survey_state != SITE_SURVEY_COMPLETED) return -EAGAIN; - - for (i = 0; i < priv->BSS_list_entries; i++) { + + for(i=0; iBSS_list_entries; i++) { iwe.cmd = SIOCGIWAP; iwe.u.ap_addr.sa_family = ARPHRD_ETHER; memcpy(iwe.u.ap_addr.sa_data, priv->BSSinfo[i].BSSID, 6); @@ -2185,16 +2179,16 @@ static int atmel_get_scan(struct net_device *dev, iwe.cmd = SIOCGIWESSID; iwe.u.data.flags = 1; current_ev = iwe_stream_add_point(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, priv->BSSinfo[i].SSID); - + iwe.cmd = SIOCGIWMODE; iwe.u.mode = priv->BSSinfo[i].BSStype; current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, IW_EV_UINT_LEN); - + iwe.cmd = SIOCGIWFREQ; iwe.u.freq.m = priv->BSSinfo[i].channel; iwe.u.freq.e = 0; current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, IW_EV_FREQ_LEN); - + iwe.cmd = SIOCGIWENCODE; if (priv->BSSinfo[i].UsingWEP) iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; @@ -2202,12 +2196,13 @@ static int atmel_get_scan(struct net_device *dev, iwe.u.data.flags = IW_ENCODE_DISABLED; iwe.u.data.length = 0; current_ev = iwe_stream_add_point(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, NULL); + } /* Length of data */ dwrq->length = (current_ev - extra); - dwrq->flags = 0; - + dwrq->flags = 0; + return 0; } @@ -2218,7 +2213,7 @@ static int atmel_get_range(struct net_device *dev, { struct atmel_private *priv = netdev_priv(dev); struct iw_range *range = (struct iw_range *) extra; - int k, i, j; + int k,i,j; dwrq->length = sizeof(struct iw_range); memset(range, 0, sizeof(struct iw_range)); @@ -2231,14 +2226,14 @@ static int atmel_get_range(struct net_device *dev, break; } if (range->num_channels != 0) { - for (k = 0, i = channel_table[j].min; i <= channel_table[j].max; i++) { + for(k = 0, i = channel_table[j].min; i <= channel_table[j].max; i++) { range->freq[k].i = i; /* List index */ - range->freq[k].m = frequency_list[i - 1] * 100000; + range->freq[k].m = frequency_list[i-1] * 100000; range->freq[k++].e = 1; /* Values in table in MHz -> * 10^5 * 10 */ } range->num_frequency = k; } - + range->max_qual.qual = 100; range->max_qual.level = 100; range->max_qual.noise = 0; @@ -2266,11 +2261,11 @@ static int atmel_get_range(struct net_device *dev, range->encoding_size[1] = 13; range->num_encoding_sizes = 2; range->max_encoding_tokens = 4; - + range->pmp_flags = IW_POWER_ON; range->pmt_flags = IW_POWER_ON; range->pm_capa = 0; - + range->we_version_source = WIRELESS_EXT; range->we_version_compiled = WIRELESS_EXT; range->retry_capa = IW_RETRY_LIMIT ; @@ -2294,7 +2289,7 @@ static int atmel_set_wap(struct net_device *dev, if (awrq->sa_family != ARPHRD_ETHER) return -EINVAL; - + if (memcmp(bcast, awrq->sa_data, 6) == 0) { del_timer_sync(&priv->management_timer); spin_lock_irqsave(&priv->irqlock, flags); @@ -2302,8 +2297,8 @@ static int atmel_set_wap(struct net_device *dev, spin_unlock_irqrestore(&priv->irqlock, flags); return 0; } - - for (i = 0; i < priv->BSS_list_entries; i++) { + + for(i=0; iBSS_list_entries; i++) { if (memcmp(priv->BSSinfo[i].BSSID, awrq->sa_data, 6) == 0) { if (!priv->wep_is_on && priv->BSSinfo[i].UsingWEP) { return -EINVAL; @@ -2318,10 +2313,10 @@ static int atmel_set_wap(struct net_device *dev, } } } - + return -EINVAL; } - + static int atmel_config_commit(struct net_device *dev, struct iw_request_info *info, /* NULL */ void *zwrq, /* NULL */ @@ -2330,18 +2325,18 @@ static int atmel_config_commit(struct net_device *dev, return atmel_open(dev); } -static const iw_handler atmel_handler[] = +static const iw_handler atmel_handler[] = { (iw_handler) atmel_config_commit, /* SIOCSIWCOMMIT */ - (iw_handler) atmel_get_name, /* SIOCGIWNAME */ + (iw_handler) atmel_get_name, /* SIOCGIWNAME */ (iw_handler) NULL, /* SIOCSIWNWID */ (iw_handler) NULL, /* SIOCGIWNWID */ (iw_handler) atmel_set_freq, /* SIOCSIWFREQ */ (iw_handler) atmel_get_freq, /* SIOCGIWFREQ */ (iw_handler) atmel_set_mode, /* SIOCSIWMODE */ (iw_handler) atmel_get_mode, /* SIOCGIWMODE */ - (iw_handler) NULL, /* SIOCSIWSENS */ - (iw_handler) NULL, /* SIOCGIWSENS */ + (iw_handler) NULL, /* SIOCSIWSENS */ + (iw_handler) NULL, /* SIOCGIWSENS */ (iw_handler) NULL, /* SIOCSIWRANGE */ (iw_handler) atmel_get_range, /* SIOCGIWRANGE */ (iw_handler) NULL, /* SIOCSIWPRIV */ @@ -2355,13 +2350,13 @@ static const iw_handler atmel_handler[] = (iw_handler) atmel_set_wap, /* SIOCSIWAP */ (iw_handler) atmel_get_wap, /* SIOCGIWAP */ (iw_handler) NULL, /* -- hole -- */ - (iw_handler) NULL, /* SIOCGIWAPLIST */ + (iw_handler) NULL, /* SIOCGIWAPLIST */ (iw_handler) atmel_set_scan, /* SIOCSIWSCAN */ (iw_handler) atmel_get_scan, /* SIOCGIWSCAN */ (iw_handler) atmel_set_essid, /* SIOCSIWESSID */ (iw_handler) atmel_get_essid, /* SIOCGIWESSID */ - (iw_handler) NULL, /* SIOCSIWNICKN */ - (iw_handler) NULL, /* SIOCGIWNICKN */ + (iw_handler) NULL, /* SIOCSIWNICKN */ + (iw_handler) NULL, /* SIOCGIWNICKN */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) NULL, /* -- hole -- */ (iw_handler) atmel_set_rate, /* SIOCSIWRATE */ @@ -2370,8 +2365,8 @@ static const iw_handler atmel_handler[] = (iw_handler) atmel_get_rts, /* SIOCGIWRTS */ (iw_handler) atmel_set_frag, /* SIOCSIWFRAG */ (iw_handler) atmel_get_frag, /* SIOCGIWFRAG */ - (iw_handler) NULL, /* SIOCSIWTXPOW */ - (iw_handler) NULL, /* SIOCGIWTXPOW */ + (iw_handler) NULL, /* SIOCSIWTXPOW */ + (iw_handler) NULL, /* SIOCGIWTXPOW */ (iw_handler) atmel_set_retry, /* SIOCSIWRETRY */ (iw_handler) atmel_get_retry, /* SIOCGIWRETRY */ (iw_handler) atmel_set_encode, /* SIOCSIWENCODE */ @@ -2380,51 +2375,39 @@ static const iw_handler atmel_handler[] = (iw_handler) atmel_get_power, /* SIOCGIWPOWER */ }; -static const iw_handler atmel_private_handler[] = + +static const iw_handler atmel_private_handler[] = { NULL, /* SIOCIWFIRSTPRIV */ }; typedef struct atmel_priv_ioctl { char id[32]; - unsigned char __user *data; - unsigned short len; + unsigned char __user *data; + unsigned short len; } atmel_priv_ioctl; -#define ATMELFWL SIOCIWFIRSTPRIV -#define ATMELIDIFC ATMELFWL + 1 -#define ATMELRD ATMELFWL + 2 -#define ATMELMAGIC 0x51807 + +#define ATMELFWL SIOCIWFIRSTPRIV +#define ATMELIDIFC ATMELFWL + 1 +#define ATMELRD ATMELFWL + 2 +#define ATMELMAGIC 0x51807 #define REGDOMAINSZ 20 static const struct iw_priv_args atmel_private_args[] = { - { - .cmd = ATMELFWL, - .set_args = IW_PRIV_TYPE_BYTE - | IW_PRIV_SIZE_FIXED - | sizeof (atmel_priv_ioctl), - .get_args = IW_PRIV_TYPE_NONE, - .name = "atmelfwl" - }, { - .cmd = ATMELIDIFC, - .set_args = IW_PRIV_TYPE_NONE, - .get_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, - .name = "atmelidifc" - }, { - .cmd = ATMELRD, - .set_args = IW_PRIV_TYPE_CHAR | REGDOMAINSZ, - .get_args = IW_PRIV_TYPE_NONE, - .name = "regdomain" - }, +/*{ cmd, set_args, get_args, name } */ + { ATMELFWL, IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | sizeof (atmel_priv_ioctl), IW_PRIV_TYPE_NONE, "atmelfwl" }, + { ATMELIDIFC, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "atmelidifc" }, + { ATMELRD, IW_PRIV_TYPE_CHAR | REGDOMAINSZ, IW_PRIV_TYPE_NONE, "regdomain" }, }; -static const struct iw_handler_def atmel_handler_def = +static const struct iw_handler_def atmel_handler_def = { .num_standard = sizeof(atmel_handler)/sizeof(iw_handler), - .num_private = sizeof(atmel_private_handler)/sizeof(iw_handler), - .num_private_args = sizeof(atmel_private_args)/sizeof(struct iw_priv_args), + .num_private = sizeof(atmel_private_handler)/sizeof(iw_handler), + .num_private_args = sizeof(atmel_private_args)/sizeof(struct iw_priv_args), .standard = (iw_handler *) atmel_handler, - .private = (iw_handler *) atmel_private_handler, + .private = (iw_handler *) atmel_private_handler, .private_args = (struct iw_priv_args *) atmel_private_args, .get_wireless_stats = atmel_get_wireless_stats }; @@ -2436,13 +2419,13 @@ static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) atmel_priv_ioctl com; struct iwreq *wrq = (struct iwreq *) rq; unsigned char *new_firmware; - char domain[REGDOMAINSZ + 1]; + char domain[REGDOMAINSZ+1]; switch (cmd) { case ATMELIDIFC: - wrq->u.param.value = ATMELMAGIC; + wrq->u.param.value = ATMELMAGIC; break; - + case ATMELFWL: if (copy_from_user(&com, rq->ifr_data, sizeof(com))) { rc = -EFAULT; @@ -2466,7 +2449,7 @@ static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) } kfree(priv->firmware); - + priv->firmware = new_firmware; priv->firmware_length = com.len; strncpy(priv->firmware_id, com.id, 31); @@ -2478,7 +2461,7 @@ static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) rc = -EFAULT; break; } - + if (!capable(CAP_NET_ADMIN)) { rc = -EPERM; break; @@ -2501,15 +2484,15 @@ static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) rc = 0; } } - + if (rc == 0 && priv->station_state != STATION_STATE_DOWN) rc = atmel_open(dev); break; - + default: rc = -EOPNOTSUPP; } - + return rc; } @@ -2520,17 +2503,17 @@ struct auth_body { u8 el_id; u8 chall_text_len; u8 chall_text[253]; -}; +}; static void atmel_enter_state(struct atmel_private *priv, int new_state) { int old_state = priv->station_state; - + if (new_state == old_state) return; - + priv->station_state = new_state; - + if (new_state == STATION_STATE_READY) { netif_start_queue(priv->dev); netif_carrier_on(priv->dev); @@ -2557,7 +2540,7 @@ static void atmel_scan(struct atmel_private *priv, int specific_ssid) u8 options; u8 SSID_size; } cmd; - + memset(cmd.BSSID, 0xff, 6); if (priv->fast_scan) { @@ -2571,17 +2554,17 @@ static void atmel_scan(struct atmel_private *priv, int specific_ssid) cmd.min_channel_time = cpu_to_le16(10); cmd.max_channel_time = cpu_to_le16(120); } - + cmd.options = 0; - + if (!specific_ssid) cmd.options |= SCAN_OPTIONS_SITE_SURVEY; - - cmd.channel = (priv->channel & 0x7f); + + cmd.channel = (priv->channel & 0x7f); cmd.scan_type = SCAN_TYPE_ACTIVE; - cmd.BSS_type = cpu_to_le16(priv->operating_mode == IW_MODE_ADHOC ? + cmd.BSS_type = cpu_to_le16(priv->operating_mode == IW_MODE_ADHOC ? BSS_TYPE_AD_HOC : BSS_TYPE_INFRASTRUCTURE); - + atmel_send_command(priv, CMD_Scan, &cmd, sizeof(cmd)); /* This must come after all hardware access to avoid being messed up @@ -2608,15 +2591,16 @@ static void join(struct atmel_private *priv, int type) cmd.BSS_type = type; cmd.timeout = cpu_to_le16(2000); - atmel_send_command(priv, CMD_Join, &cmd, sizeof(cmd)); + atmel_send_command(priv, CMD_Join, &cmd, sizeof(cmd)); } + static void start(struct atmel_private *priv, int type) { struct { u8 BSSID[6]; u8 SSID[MAX_SSID_LENGTH]; - u8 BSS_type; + u8 BSS_type; u8 channel; u8 SSID_size; u8 reserved[3]; @@ -2628,14 +2612,13 @@ static void start(struct atmel_private *priv, int type) cmd.BSS_type = type; cmd.channel = (priv->channel & 0x7f); - atmel_send_command(priv, CMD_Start, &cmd, sizeof(cmd)); + atmel_send_command(priv, CMD_Start, &cmd, sizeof(cmd)); } -static void handle_beacon_probe(struct atmel_private *priv, u16 capability, - u8 channel) +static void handle_beacon_probe(struct atmel_private *priv, u16 capability, u8 channel) { int rejoin = 0; - int new = capability & C80211_MGMT_CAPABILITY_ShortPreamble ? + int new = capability & C80211_MGMT_CAPABILITY_ShortPreamble ? SHORT_PREAMBLE : LONG_PREAMBLE; if (priv->preamble != new) { @@ -2643,48 +2626,48 @@ static void handle_beacon_probe(struct atmel_private *priv, u16 capability, rejoin = 1; atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_PREAMBLE_TYPE, new); } - + if (priv->channel != channel) { priv->channel = channel; rejoin = 1; atmel_set_mib8(priv, Phy_Mib_Type, PHY_MIB_CHANNEL_POS, channel); } - + if (rejoin) { priv->station_is_associated = 0; atmel_enter_state(priv, STATION_STATE_JOINNING); - + if (priv->operating_mode == IW_MODE_INFRA) join(priv, BSS_TYPE_INFRASTRUCTURE); - else + else join(priv, BSS_TYPE_AD_HOC); - } + } } -static void send_authentication_request(struct atmel_private *priv, u16 system, - u8 *challenge, int challenge_len) + +static void send_authentication_request(struct atmel_private *priv, u16 system, u8 *challenge, int challenge_len) { struct ieee80211_hdr_4addr header; struct auth_body auth; - - header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); - header.duration_id = cpu_to_le16(0x8000); + + header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); + header.duration_id = cpu_to_le16(0x8000); header.seq_ctl = 0; memcpy(header.addr1, priv->CurrentBSSID, 6); memcpy(header.addr2, priv->dev->dev_addr, 6); memcpy(header.addr3, priv->CurrentBSSID, 6); - - if (priv->wep_is_on && priv->CurrentAuthentTransactionSeqNum != 1) + + if (priv->wep_is_on && priv->CurrentAuthentTransactionSeqNum != 1) /* no WEP for authentication frames with TrSeqNo 1 */ header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); - - auth.alg = cpu_to_le16(system); + + auth.alg = cpu_to_le16(system); auth.status = 0; auth.trans_seq = cpu_to_le16(priv->CurrentAuthentTransactionSeqNum); - priv->ExpectedAuthentTransactionSeqNum = priv->CurrentAuthentTransactionSeqNum+1; + priv->ExpectedAuthentTransactionSeqNum = priv->CurrentAuthentTransactionSeqNum+1; priv->CurrentAuthentTransactionSeqNum += 2; - + if (challenge_len != 0) { auth.el_id = 16; /* challenge_text */ auth.chall_text_len = challenge_len; @@ -2702,7 +2685,7 @@ static void send_association_request(struct atmel_private *priv, int is_reassoc) struct ieee80211_hdr_4addr header; struct ass_req_format { u16 capability; - u16 listen_interval; + u16 listen_interval; u8 ap[6]; /* nothing after here directly accessible */ u8 ssid_el_id; u8 ssid_len; @@ -2711,15 +2694,15 @@ static void send_association_request(struct atmel_private *priv, int is_reassoc) u8 sup_rates_len; u8 rates[4]; } body; - - header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT | + + header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT | (is_reassoc ? IEEE80211_STYPE_REASSOC_REQ : IEEE80211_STYPE_ASSOC_REQ)); header.duration_id = cpu_to_le16(0x8000); header.seq_ctl = 0; - memcpy(header.addr1, priv->CurrentBSSID, 6); + memcpy(header.addr1, priv->CurrentBSSID, 6); memcpy(header.addr2, priv->dev->dev_addr, 6); - memcpy(header.addr3, priv->CurrentBSSID, 6); + memcpy(header.addr3, priv->CurrentBSSID, 6); body.capability = cpu_to_le16(C80211_MGMT_CAPABILITY_ESS); if (priv->wep_is_on) @@ -2728,18 +2711,18 @@ static void send_association_request(struct atmel_private *priv, int is_reassoc) body.capability |= cpu_to_le16(C80211_MGMT_CAPABILITY_ShortPreamble); body.listen_interval = cpu_to_le16(priv->listen_interval * priv->beacon_period); - + /* current AP address - only in reassoc frame */ if (is_reassoc) { - memcpy(body.ap, priv->CurrentBSSID, 6); + memcpy(body.ap, priv->CurrentBSSID, 6); ssid_el_p = (u8 *)&body.ssid_el_id; bodysize = 18 + priv->SSID_size; } else { ssid_el_p = (u8 *)&body.ap[0]; bodysize = 12 + priv->SSID_size; } - - ssid_el_p[0] = C80211_MGMT_ElementID_SSID; + + ssid_el_p[0]= C80211_MGMT_ElementID_SSID; ssid_el_p[1] = priv->SSID_size; memcpy(ssid_el_p + 2, priv->SSID, priv->SSID_size); ssid_el_p[2 + priv->SSID_size] = C80211_MGMT_ElementID_SupportedRates; @@ -2749,8 +2732,7 @@ static void send_association_request(struct atmel_private *priv, int is_reassoc) atmel_transmit_management_frame(priv, &header, (void *)&body, bodysize); } -static int is_frame_from_current_bss(struct atmel_private *priv, - struct ieee80211_hdr_4addr *header) +static int is_frame_from_current_bss(struct atmel_private *priv, struct ieee80211_hdr_4addr *header) { if (le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_FROMDS) return memcmp(header->addr3, priv->CurrentBSSID, 6) == 0; @@ -2763,29 +2745,29 @@ static int retrieve_bss(struct atmel_private *priv) int i; int max_rssi = -128; int max_index = -1; - + if (priv->BSS_list_entries == 0) return -1; - + if (priv->connect_to_any_BSS) { - /* Select a BSS with the max-RSSI but of the same type and of - the same WEP mode and that it is not marked as 'bad' (i.e. - we had previously failed to connect to this BSS with the - settings that we currently use) */ + /* Select a BSS with the max-RSSI but of the same type and of the same WEP mode + and that it is not marked as 'bad' (i.e. we had previously failed to connect to + this BSS with the settings that we currently use) */ priv->current_BSS = 0; - for (i = 0; i < priv->BSS_list_entries; i++) { + for(i=0; iBSS_list_entries; i++) { if (priv->operating_mode == priv->BSSinfo[i].BSStype && - ((!priv->wep_is_on && !priv->BSSinfo[i].UsingWEP) || + ((!priv->wep_is_on && !priv->BSSinfo[i].UsingWEP) || (priv->wep_is_on && priv->BSSinfo[i].UsingWEP)) && !(priv->BSSinfo[i].channel & 0x80)) { max_rssi = priv->BSSinfo[i].RSSI; priv->current_BSS = max_index = i; } + } return max_index; } - - for (i = 0; i < priv->BSS_list_entries; i++) { + + for(i=0; iBSS_list_entries; i++) { if (priv->SSID_size == priv->BSSinfo[i].SSIDsize && memcmp(priv->SSID, priv->BSSinfo[i].SSID, priv->SSID_size) == 0 && priv->operating_mode == priv->BSSinfo[i].BSStype && @@ -2799,19 +2781,19 @@ static int retrieve_bss(struct atmel_private *priv) return max_index; } -static void store_bss_info(struct atmel_private *priv, - struct ieee80211_hdr_4addr *header, u16 capability, - u16 beacon_period, u8 channel, u8 rssi, u8 ssid_len, - u8 *ssid, int is_beacon) + +static void store_bss_info(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, + u16 capability, u16 beacon_period, u8 channel, u8 rssi, + u8 ssid_len, u8 *ssid, int is_beacon) { u8 *bss = capability & C80211_MGMT_CAPABILITY_ESS ? header->addr2 : header->addr3; int i, index; - - for (index = -1, i = 0; i < priv->BSS_list_entries; i++) - if (memcmp(bss, priv->BSSinfo[i].BSSID, 6) == 0) + + for (index = -1, i = 0; i < priv->BSS_list_entries; i++) + if (memcmp(bss, priv->BSSinfo[i].BSSID, 6) == 0) index = i; - /* If we process a probe and an entry from this BSS exists + /* If we process a probe and an entry from this BSS exists we will update the BSS entry with the info from this BSS. If we process a beacon we will only update RSSI */ @@ -2838,8 +2820,8 @@ static void store_bss_info(struct atmel_private *priv, priv->BSSinfo[index].BSStype = IW_MODE_ADHOC; else if (capability & C80211_MGMT_CAPABILITY_ESS) priv->BSSinfo[index].BSStype =IW_MODE_INFRA; - - priv->BSSinfo[index].preamble = capability & C80211_MGMT_CAPABILITY_ShortPreamble ? + + priv->BSSinfo[index].preamble = capability & C80211_MGMT_CAPABILITY_ShortPreamble ? SHORT_PREAMBLE : LONG_PREAMBLE; } @@ -2849,8 +2831,8 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) u16 status = le16_to_cpu(auth->status); u16 trans_seq_no = le16_to_cpu(auth->trans_seq); u16 system = le16_to_cpu(auth->alg); - - if (status == C80211_MGMT_SC_Success && !priv->wep_is_on) { + + if (status == C80211_MGMT_SC_Success && !priv->wep_is_on) { /* no WEP */ if (priv->station_was_associated) { atmel_enter_state(priv, STATION_STATE_REASSOCIATING); @@ -2860,20 +2842,20 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) atmel_enter_state(priv, STATION_STATE_ASSOCIATING); send_association_request(priv, 0); return; - } + } } - - if (status == C80211_MGMT_SC_Success && priv->wep_is_on) { + + if (status == C80211_MGMT_SC_Success && priv->wep_is_on) { /* WEP */ if (trans_seq_no != priv->ExpectedAuthentTransactionSeqNum) return; - + if (trans_seq_no == 0x0002 && auth->el_id == C80211_MGMT_ElementID_ChallengeText) { send_authentication_request(priv, system, auth->chall_text, auth->chall_text_len); return; } - + if (trans_seq_no == 0x0004) { if(priv->station_was_associated) { atmel_enter_state(priv, STATION_STATE_REASSOCIATING); @@ -2883,10 +2865,10 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) atmel_enter_state(priv, STATION_STATE_ASSOCIATING); send_association_request(priv, 0); return; - } + } } - } - + } + if (status == C80211_MGMT_SC_AuthAlgNotSupported) { /* Do opensystem first, then try sharedkey */ if (system == C80211_MGMT_AAN_OPENSYSTEM) { @@ -2894,16 +2876,17 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0); } else if (priv->connect_to_any_BSS) { int bss_index; - + priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80; - + if ((bss_index = retrieve_bss(priv)) != -1) { atmel_join_bss(priv, bss_index); return; } } } - + + priv->AuthenticationRequestRetryCnt = 0; atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); priv->station_is_associated = 0; @@ -2919,44 +2902,38 @@ static void associate(struct atmel_private *priv, u16 frame_len, u16 subtype) u8 length; u8 rates[4]; } *ass_resp = (struct ass_resp_format *)priv->rx_buf; - - u16 status = le16_to_cpu(ass_resp->status); + + u16 status = le16_to_cpu(ass_resp->status); u16 ass_id = le16_to_cpu(ass_resp->ass_id); - u16 rates_len = ass_resp->length > 4 ? 4 : ass_resp->length; - + u16 rates_len = ass_resp->length > 4 ? 4 : ass_resp->length; + if (frame_len < 8 + rates_len) return; - + if (status == C80211_MGMT_SC_Success) { if (subtype == C80211_SUBTYPE_MGMT_ASS_RESPONSE) priv->AssociationRequestRetryCnt = 0; else priv->ReAssociationRequestRetryCnt = 0; - - atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, - MAC_MGMT_MIB_STATION_ID_POS, ass_id & 0x3fff); - atmel_set_mib(priv, Phy_Mib_Type, - PHY_MIB_RATE_SET_POS, ass_resp->rates, rates_len); + + atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_STATION_ID_POS, ass_id & 0x3fff); + atmel_set_mib(priv, Phy_Mib_Type, PHY_MIB_RATE_SET_POS, ass_resp->rates, rates_len); if (priv->power_mode == 0) { priv->listen_interval = 1; - atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, - MAC_MGMT_MIB_PS_MODE_POS, ACTIVE_MODE); - atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, - MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1); + atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_PS_MODE_POS, ACTIVE_MODE); + atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1); } else { priv->listen_interval = 2; - atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, - MAC_MGMT_MIB_PS_MODE_POS, PS_MODE); - atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, - MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 2); + atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_PS_MODE_POS, PS_MODE); + atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 2); } - + priv->station_is_associated = 1; priv->station_was_associated = 1; atmel_enter_state(priv, STATION_STATE_READY); return; } - + if (subtype == C80211_SUBTYPE_MGMT_ASS_RESPONSE && status != C80211_MGMT_SC_AssDeniedBSSRate && status != C80211_MGMT_SC_SupportCapabilities && @@ -2966,7 +2943,7 @@ static void associate(struct atmel_private *priv, u16 frame_len, u16 subtype) send_association_request(priv, 0); return; } - + if (subtype == C80211_SUBTYPE_MGMT_REASS_RESPONSE && status != C80211_MGMT_SC_AssDeniedBSSRate && status != C80211_MGMT_SC_SupportCapabilities && @@ -2976,16 +2953,17 @@ static void associate(struct atmel_private *priv, u16 frame_len, u16 subtype) send_association_request(priv, 1); return; } - + atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); priv->station_is_associated = 0; - - if (priv->connect_to_any_BSS) { + + if(priv->connect_to_any_BSS) { int bss_index; priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80; - - if ((bss_index = retrieve_bss(priv)) != -1) + + if ((bss_index = retrieve_bss(priv)) != -1) atmel_join_bss(priv, bss_index); + } } @@ -2999,7 +2977,7 @@ void atmel_join_bss(struct atmel_private *priv, int bss_index) /* The WPA stuff cares about the current AP address */ if (priv->use_wpa) build_wpa_mib(priv); - + /* When switching to AdHoc turn OFF Power Save if needed */ if (bss->BSStype == IW_MODE_ADHOC && @@ -3007,28 +2985,25 @@ void atmel_join_bss(struct atmel_private *priv, int bss_index) priv->power_mode) { priv->power_mode = 0; priv->listen_interval = 1; - atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, - MAC_MGMT_MIB_PS_MODE_POS, ACTIVE_MODE); - atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, - MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1); + atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_PS_MODE_POS, ACTIVE_MODE); + atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1); } - + priv->operating_mode = bss->BSStype; - priv->channel = bss->channel & 0x7f; + priv->channel = bss->channel & 0x7f; priv->beacon_period = bss->beacon_period; - + if (priv->preamble != bss->preamble) { priv->preamble = bss->preamble; - atmel_set_mib8(priv, Local_Mib_Type, - LOCAL_MIB_PREAMBLE_TYPE, bss->preamble); + atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_PREAMBLE_TYPE, bss->preamble); } - + if (!priv->wep_is_on && bss->UsingWEP) { atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); priv->station_is_associated = 0; return; } - + if (priv->wep_is_on && !bss->UsingWEP) { atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); priv->station_is_associated = 0; @@ -3036,28 +3011,30 @@ void atmel_join_bss(struct atmel_private *priv, int bss_index) } atmel_enter_state(priv, STATION_STATE_JOINNING); - + if (priv->operating_mode == IW_MODE_INFRA) join(priv, BSS_TYPE_INFRASTRUCTURE); - else + else join(priv, BSS_TYPE_AD_HOC); } + static void restart_search(struct atmel_private *priv) { int bss_index; - + if (!priv->connect_to_any_BSS) { atmel_scan(priv, 1); } else { priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80; - - if ((bss_index = retrieve_bss(priv)) != -1) + + if ((bss_index = retrieve_bss(priv)) != -1) atmel_join_bss(priv, bss_index); else atmel_scan(priv, 0); - } -} + + } +} static void smooth_rssi(struct atmel_private *priv, u8 rssi) { @@ -3073,21 +3050,21 @@ static void smooth_rssi(struct atmel_private *priv, u8 rssi) } rssi = rssi * 100 / max_rssi; - if ((rssi + old) % 2) - priv->wstats.qual.level = (rssi + old) / 2 + 1; + if((rssi + old) % 2) + priv->wstats.qual.level = ((rssi + old)/2) + 1; else - priv->wstats.qual.level = (rssi + old) / 2; + priv->wstats.qual.level = ((rssi + old)/2); priv->wstats.qual.updated |= IW_QUAL_LEVEL_UPDATED; priv->wstats.qual.updated &= ~IW_QUAL_LEVEL_INVALID; } static void atmel_smooth_qual(struct atmel_private *priv) { - unsigned long time_diff = (jiffies - priv->last_qual) / HZ; + unsigned long time_diff = (jiffies - priv->last_qual)/HZ; while (time_diff--) { priv->last_qual += HZ; - priv->wstats.qual.qual = priv->wstats.qual.qual / 2; - priv->wstats.qual.qual += + priv->wstats.qual.qual = priv->wstats.qual.qual/2; + priv->wstats.qual.qual += priv->beacons_this_sec * priv->beacon_period * (priv->wstats.qual.level + 100) / 4000; priv->beacons_this_sec = 0; } @@ -3096,17 +3073,15 @@ static void atmel_smooth_qual(struct atmel_private *priv) } /* deals with incoming managment frames. */ -static void atmel_management_frame(struct atmel_private *priv, - struct ieee80211_hdr_4addr *header, - u16 frame_len, u8 rssi) +static void atmel_management_frame(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, + u16 frame_len, u8 rssi) { u16 subtype; - - subtype = le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_STYPE; - switch (subtype) { - case C80211_SUBTYPE_MGMT_BEACON: + + switch (subtype = le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_STYPE) { + case C80211_SUBTYPE_MGMT_BEACON : case C80211_SUBTYPE_MGMT_ProbeResponse: - + /* beacon frame has multiple variable-length fields - never let an engineer loose with a data structure design. */ { @@ -3124,7 +3099,7 @@ static void atmel_management_frame(struct atmel_private *priv, u8 ds_length; /* ds here */ } *beacon = (struct beacon_format *)priv->rx_buf; - + u8 channel, rates_length, ssid_length; u64 timestamp = le64_to_cpu(beacon->timestamp); u16 beacon_interval = le16_to_cpu(beacon->interval); @@ -3132,7 +3107,7 @@ static void atmel_management_frame(struct atmel_private *priv, u8 *beaconp = priv->rx_buf; ssid_length = beacon->ssid_length; /* this blows chunks. */ - if (frame_len < 14 || frame_len < ssid_length + 15) + if (frame_len < 14 || frame_len < ssid_length + 15) return; rates_length = beaconp[beacon->ssid_length + 15]; if (frame_len < ssid_length + rates_length + 18) @@ -3140,10 +3115,10 @@ static void atmel_management_frame(struct atmel_private *priv, if (ssid_length > MAX_SSID_LENGTH) return; channel = beaconp[ssid_length + rates_length + 18]; - + if (priv->station_state == STATION_STATE_READY) { smooth_rssi(priv, rssi); - if (is_frame_from_current_bss(priv, header)) { + if (is_frame_from_current_bss(priv, header)) { priv->beacons_this_sec++; atmel_smooth_qual(priv); if (priv->last_beacon_timestamp) { @@ -3157,43 +3132,41 @@ static void atmel_management_frame(struct atmel_private *priv, handle_beacon_probe(priv, capability, channel); } } - - if (priv->station_state == STATION_STATE_SCANNING) - store_bss_info(priv, header, capability, - beacon_interval, channel, rssi, - ssid_length, - &beacon->rates_el_id, - subtype == C80211_SUBTYPE_MGMT_BEACON); + + if (priv->station_state == STATION_STATE_SCANNING ) + store_bss_info(priv, header, capability, beacon_interval, channel, + rssi, ssid_length, &beacon->rates_el_id, + subtype == C80211_SUBTYPE_MGMT_BEACON) ; } break; - + case C80211_SUBTYPE_MGMT_Authentication: if (priv->station_state == STATION_STATE_AUTHENTICATING) authenticate(priv, frame_len); - + break; - + case C80211_SUBTYPE_MGMT_ASS_RESPONSE: case C80211_SUBTYPE_MGMT_REASS_RESPONSE: - - if (priv->station_state == STATION_STATE_ASSOCIATING || + + if (priv->station_state == STATION_STATE_ASSOCIATING || priv->station_state == STATION_STATE_REASSOCIATING) associate(priv, frame_len, subtype); - + break; case C80211_SUBTYPE_MGMT_DISASSOSIATION: - if (priv->station_is_associated && - priv->operating_mode == IW_MODE_INFRA && + if (priv->station_is_associated && + priv->operating_mode == IW_MODE_INFRA && is_frame_from_current_bss(priv, header)) { priv->station_was_associated = 0; priv->station_is_associated = 0; - + atmel_enter_state(priv, STATION_STATE_JOINNING); join(priv, BSS_TYPE_INFRASTRUCTURE); } - + break; case C80211_SUBTYPE_MGMT_Deauthentication: @@ -3204,7 +3177,7 @@ static void atmel_management_frame(struct atmel_private *priv, atmel_enter_state(priv, STATION_STATE_JOINNING); join(priv, BSS_TYPE_INFRASTRUCTURE); } - + break; } } @@ -3212,73 +3185,76 @@ static void atmel_management_frame(struct atmel_private *priv, /* run when timer expires */ static void atmel_management_timer(u_long a) { - struct net_device *dev = (struct net_device *) a; - struct atmel_private *priv = netdev_priv(dev); - unsigned long flags; - - /* Check if the card has been yanked. */ - if (priv->card && priv->present_callback && - !(*priv->present_callback)(priv->card)) - return; - - spin_lock_irqsave(&priv->irqlock, flags); - - switch (priv->station_state) { - - case STATION_STATE_AUTHENTICATING: - if (priv->AuthenticationRequestRetryCnt >= MAX_AUTHENTICATION_RETRIES) { - atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); - priv->station_is_associated = 0; - priv->AuthenticationRequestRetryCnt = 0; - restart_search(priv); - } else { - priv->AuthenticationRequestRetryCnt++; - priv->CurrentAuthentTransactionSeqNum = 0x0001; - mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); - send_authentication_request(priv, C80211_MGMT_AAN_OPENSYSTEM, NULL, 0); + struct net_device *dev = (struct net_device *) a; + struct atmel_private *priv = netdev_priv(dev); + unsigned long flags; + + /* Check if the card has been yanked. */ + if (priv->card && priv->present_callback && + !(*priv->present_callback)(priv->card)) + return; + + spin_lock_irqsave(&priv->irqlock, flags); + + switch (priv->station_state) { + + case STATION_STATE_AUTHENTICATING: + if (priv->AuthenticationRequestRetryCnt >= MAX_AUTHENTICATION_RETRIES) { + atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); + priv->station_is_associated = 0; + priv->AuthenticationRequestRetryCnt = 0; + restart_search(priv); + } else { + priv->AuthenticationRequestRetryCnt++; + priv->CurrentAuthentTransactionSeqNum = 0x0001; + mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); + send_authentication_request(priv, C80211_MGMT_AAN_OPENSYSTEM, NULL, 0); } + break; - case STATION_STATE_ASSOCIATING: - if (priv->AssociationRequestRetryCnt == MAX_ASSOCIATION_RETRIES) { - atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); - priv->station_is_associated = 0; - priv->AssociationRequestRetryCnt = 0; - restart_search(priv); - } else { - priv->AssociationRequestRetryCnt++; - mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); - send_association_request(priv, 0); - } - break; - - case STATION_STATE_REASSOCIATING: - if (priv->ReAssociationRequestRetryCnt == MAX_ASSOCIATION_RETRIES) { - atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); - priv->station_is_associated = 0; - priv->ReAssociationRequestRetryCnt = 0; - restart_search(priv); - } else { - priv->ReAssociationRequestRetryCnt++; - mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); - send_association_request(priv, 1); - } - break; + case STATION_STATE_ASSOCIATING: + if (priv->AssociationRequestRetryCnt == MAX_ASSOCIATION_RETRIES) { + atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); + priv->station_is_associated = 0; + priv->AssociationRequestRetryCnt = 0; + restart_search(priv); + } else { + priv->AssociationRequestRetryCnt++; + mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); + send_association_request(priv, 0); + } - default: - break; - } + break; + + case STATION_STATE_REASSOCIATING: + if (priv->ReAssociationRequestRetryCnt == MAX_ASSOCIATION_RETRIES) { + atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); + priv->station_is_associated = 0; + priv->ReAssociationRequestRetryCnt = 0; + restart_search(priv); + } else { + priv->ReAssociationRequestRetryCnt++; + mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); + send_association_request(priv, 1); + } - spin_unlock_irqrestore(&priv->irqlock, flags); + break; + + default: + break; + } + + spin_unlock_irqrestore(&priv->irqlock, flags); } - + static void atmel_command_irq(struct atmel_private *priv) { u8 status = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET)); u8 command = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_COMMAND_OFFSET)); int fast_scan; - - if (status == CMD_STATUS_IDLE || + + if (status == CMD_STATUS_IDLE || status == CMD_STATUS_IN_PROGRESS) return; @@ -3290,20 +3266,20 @@ static void atmel_command_irq(struct atmel_private *priv) atmel_get_mib(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_CUR_BSSID_POS, (u8 *)priv->CurrentBSSID, 6); atmel_enter_state(priv, STATION_STATE_READY); - } + } break; - + case CMD_Scan: fast_scan = priv->fast_scan; priv->fast_scan = 0; - + if (status != CMD_STATUS_COMPLETE) { atmel_scan(priv, 1); } else { int bss_index = retrieve_bss(priv); if (bss_index != -1) { atmel_join_bss(priv, bss_index); - } else if (priv->operating_mode == IW_MODE_ADHOC && + } else if (priv->operating_mode == IW_MODE_ADHOC && priv->SSID_size != 0) { start(priv, BSS_TYPE_AD_HOC); } else { @@ -3313,16 +3289,16 @@ static void atmel_command_irq(struct atmel_private *priv) priv->site_survey_state = SITE_SURVEY_COMPLETED; } break; - + case CMD_SiteSurvey: priv->fast_scan = 0; - + if (status != CMD_STATUS_COMPLETE) return; - + priv->site_survey_state = SITE_SURVEY_COMPLETED; if (priv->station_is_associated) { - atmel_enter_state(priv, STATION_STATE_READY); + atmel_enter_state(priv, STATION_STATE_READY); } else { atmel_scan(priv, 1); } @@ -3336,15 +3312,16 @@ static void atmel_command_irq(struct atmel_private *priv) } else { priv->AuthenticationRequestRetryCnt = 0; atmel_enter_state(priv, STATION_STATE_AUTHENTICATING); - + mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); priv->CurrentAuthentTransactionSeqNum = 0x0001; send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0); } return; } - + atmel_scan(priv, 1); + } } @@ -3356,20 +3333,20 @@ static int atmel_wakeup_firmware(struct atmel_private *priv) if (priv->card_type == CARD_TYPE_SPI_FLASH) atmel_set_gcr(priv->dev, GCR_REMAP); - + /* wake up on-board processor */ atmel_clear_gcr(priv->dev, 0x0040); atmel_write16(priv->dev, BSR, BSS_SRAM); - + if (priv->card_type == CARD_TYPE_SPI_FLASH) mdelay(100); /* and wait for it */ - for (i = LOOP_RETRY_LIMIT; i; i--) { + for (i = LOOP_RETRY_LIMIT; i; i--) { mr1 = atmel_read16(priv->dev, MR1); mr3 = atmel_read16(priv->dev, MR3); - - if (mr3 & MAC_BOOT_COMPLETE) + + if (mr3 & MAC_BOOT_COMPLETE) break; if (mr1 & MAC_BOOT_COMPLETE && priv->bus_type == BUS_TYPE_PCCARD) @@ -3380,36 +3357,35 @@ static int atmel_wakeup_firmware(struct atmel_private *priv) printk(KERN_ALERT "%s: MAC failed to boot.\n", priv->dev->name); return 0; } - + if ((priv->host_info_base = atmel_read16(priv->dev, MR2)) == 0xffff) { printk(KERN_ALERT "%s: card missing.\n", priv->dev->name); return 0; } - - /* now check for completion of MAC initialization through - the FunCtrl field of the IFACE, poll MR1 to detect completion of - MAC initialization, check completion status, set interrupt mask, - enables interrupts and calls Tx and Rx initialization functions */ - + + /* now check for completion of MAC initialization through + the FunCtrl field of the IFACE, poll MR1 to detect completion of + MAC initialization, check completion status, set interrupt mask, + enables interrupts and calls Tx and Rx initialization functions */ + atmel_wmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET), FUNC_CTRL_INIT_COMPLETE); - - for (i = LOOP_RETRY_LIMIT; i; i--) { + + for (i = LOOP_RETRY_LIMIT; i; i--) { mr1 = atmel_read16(priv->dev, MR1); mr3 = atmel_read16(priv->dev, MR3); - - if (mr3 & MAC_INIT_COMPLETE) + + if (mr3 & MAC_INIT_COMPLETE) break; if (mr1 & MAC_INIT_COMPLETE && priv->bus_type == BUS_TYPE_PCCARD) break; } - + if (i == 0) { - printk(KERN_ALERT "%s: MAC failed to initialise.\n", - priv->dev->name); + printk(KERN_ALERT "%s: MAC failed to initialise.\n", priv->dev->name); return 0; } - + /* Check for MAC_INIT_OK only on the register that the MAC_INIT_OK was set */ if ((mr3 & MAC_INIT_COMPLETE) && !(atmel_read16(priv->dev, MR3) & MAC_INIT_OK)) { @@ -3422,9 +3398,9 @@ static int atmel_wakeup_firmware(struct atmel_private *priv) return 0; } - atmel_copy_to_host(priv->dev, (unsigned char *)iface, + atmel_copy_to_host(priv->dev, (unsigned char *)iface, priv->host_info_base, sizeof(*iface)); - + iface->tx_buff_pos = le16_to_cpu(iface->tx_buff_pos); iface->tx_buff_size = le16_to_cpu(iface->tx_buff_size); iface->tx_desc_pos = le16_to_cpu(iface->tx_desc_pos); @@ -3448,16 +3424,16 @@ static int probe_atmel_card(struct net_device *dev) { int rc = 0; struct atmel_private *priv = netdev_priv(dev); - + /* reset pccard */ - if (priv->bus_type == BUS_TYPE_PCCARD) + if (priv->bus_type == BUS_TYPE_PCCARD) atmel_write16(dev, GCR, 0x0060); - + atmel_write16(dev, GCR, 0x0040); mdelay(500); - + if (atmel_read16(dev, MR2) == 0) { - /* No stored firmware so load a small stub which just + /* No stored firmware so load a small stub which just tells us the MAC address */ int i; priv->card_type = CARD_TYPE_EEPROM; @@ -3466,7 +3442,7 @@ static int probe_atmel_card(struct net_device *dev) atmel_set_gcr(dev, GCR_REMAP); atmel_clear_gcr(priv->dev, 0x0040); atmel_write16(dev, BSR, BSS_SRAM); - for (i = LOOP_RETRY_LIMIT; i; i--) + for (i = LOOP_RETRY_LIMIT; i; i--) if (atmel_read16(dev, MR3) & MAC_BOOT_COMPLETE) break; if (i == 0) { @@ -3475,7 +3451,7 @@ static int probe_atmel_card(struct net_device *dev) atmel_copy_to_host(dev, dev->dev_addr, atmel_read16(dev, MR2), 6); /* got address, now squash it again until the network interface is opened */ - if (priv->bus_type == BUS_TYPE_PCCARD) + if (priv->bus_type == BUS_TYPE_PCCARD) atmel_write16(dev, GCR, 0x0060); atmel_write16(dev, GCR, 0x0040); rc = 1; @@ -3483,7 +3459,7 @@ static int probe_atmel_card(struct net_device *dev) } else if (atmel_read16(dev, MR4) == 0) { /* Mac address easy in this case. */ priv->card_type = CARD_TYPE_PARALLEL_FLASH; - atmel_write16(dev, BSR, 1); + atmel_write16(dev, BSR, 1); atmel_copy_to_host(dev, dev->dev_addr, 0xc000, 6); atmel_write16(dev, BSR, 0x200); rc = 1; @@ -3493,16 +3469,16 @@ static int probe_atmel_card(struct net_device *dev) priv->card_type = CARD_TYPE_SPI_FLASH; if (atmel_wakeup_firmware(priv)) { atmel_get_mib(priv, Mac_Address_Mib_Type, 0, dev->dev_addr, 6); - + /* got address, now squash it again until the network interface is opened */ - if (priv->bus_type == BUS_TYPE_PCCARD) + if (priv->bus_type == BUS_TYPE_PCCARD) atmel_write16(dev, GCR, 0x0060); atmel_write16(dev, GCR, 0x0040); rc = 1; } } - + if (rc) { if (dev->dev_addr[0] == 0xFF) { u8 default_mac[] = {0x00,0x04, 0x25, 0x00, 0x00, 0x00}; @@ -3510,27 +3486,27 @@ static int probe_atmel_card(struct net_device *dev) memcpy(dev->dev_addr, default_mac, 6); } } - + return rc; } +static void build_wep_mib(struct atmel_private *priv) /* Move the encyption information on the MIB structure. This routine is for the pre-WPA firmware: later firmware has a different format MIB and a different routine. */ -static void build_wep_mib(struct atmel_private *priv) { struct { /* NB this is matched to the hardware, don't change. */ - u8 wep_is_on; + u8 wep_is_on; u8 default_key; /* 0..3 */ u8 reserved; u8 exclude_unencrypted; - + u32 WEPICV_error_count; u32 WEP_excluded_count; - + u8 wep_keys[MAX_ENCRYPTION_KEYS][13]; - u8 encryption_level; /* 0, 1, 2 */ - u8 reserved2[3]; + u8 encryption_level; /* 0, 1, 2 */ + u8 reserved2[3]; } mib; int i; @@ -3539,55 +3515,54 @@ static void build_wep_mib(struct atmel_private *priv) if (priv->wep_key_len[priv->default_key] > 5) mib.encryption_level = 2; else - mib.encryption_level = 1; + mib.encryption_level = 1; } else { mib.encryption_level = 0; } mib.default_key = priv->default_key; mib.exclude_unencrypted = priv->exclude_unencrypted; - - for (i = 0; i < MAX_ENCRYPTION_KEYS; i++) + + for(i = 0; i < MAX_ENCRYPTION_KEYS; i++) memcpy(mib.wep_keys[i], priv->wep_keys[i], 13); - + atmel_set_mib(priv, Mac_Wep_Mib_Type, 0, (u8 *)&mib, sizeof(mib)); } static void build_wpa_mib(struct atmel_private *priv) { - /* This is for the later (WPA enabled) firmware. */ + /* This is for the later (WPA enabled) firmware. */ struct { /* NB this is matched to the hardware, don't change. */ u8 cipher_default_key_value[MAX_ENCRYPTION_KEYS][MAX_ENCRYPTION_KEY_SIZE]; u8 receiver_address[6]; - u8 wep_is_on; + u8 wep_is_on; u8 default_key; /* 0..3 */ u8 group_key; u8 exclude_unencrypted; u8 encryption_type; u8 reserved; - + u32 WEPICV_error_count; u32 WEP_excluded_count; - + u8 key_RSC[4][8]; } mib; - + int i; mib.wep_is_on = priv->wep_is_on; mib.exclude_unencrypted = priv->exclude_unencrypted; memcpy(mib.receiver_address, priv->CurrentBSSID, 6); - + /* zero all the keys before adding in valid ones. */ memset(mib.cipher_default_key_value, 0, sizeof(mib.cipher_default_key_value)); - + if (priv->wep_is_on) { - /* There's a comment in the Atmel code to the effect that this - is only valid when still using WEP, it may need to be set to - something to use WPA */ + /* There's a comment in the Atmel code to the effect that this is only valid + when still using WEP, it may need to be set to something to use WPA */ memset(mib.key_RSC, 0, sizeof(mib.key_RSC)); - + mib.default_key = mib.group_key = 255; for (i = 0; i < MAX_ENCRYPTION_KEYS; i++) { if (priv->wep_key_len[i] > 0) { @@ -3595,12 +3570,12 @@ static void build_wpa_mib(struct atmel_private *priv) if (i == priv->default_key) { mib.default_key = i; mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-1] = 7; - mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->pairwise_cipher_suite; + mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->pairwise_cipher_suite; } else { mib.group_key = i; priv->group_cipher_suite = priv->pairwise_cipher_suite; mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-1] = 1; - mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->group_cipher_suite; + mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->group_cipher_suite; } } } @@ -3608,47 +3583,47 @@ static void build_wpa_mib(struct atmel_private *priv) mib.default_key = mib.group_key != 255 ? mib.group_key : 0; if (mib.group_key == 255) mib.group_key = mib.default_key; - + } - + atmel_set_mib(priv, Mac_Wep_Mib_Type, 0, (u8 *)&mib, sizeof(mib)); } - -static int reset_atmel_card(struct net_device *dev) + +static int reset_atmel_card(struct net_device *dev) { /* do everything necessary to wake up the hardware, including waiting for the lightning strike and throwing the knife switch.... - set all the Mib values which matter in the card to match + set all the Mib values which matter in the card to match their settings in the atmel_private structure. Some of these can be altered on the fly, but many (WEP, infrastucture or ad-hoc) can only be changed by tearing down the world and coming back through here. - This routine is also responsible for initialising some - hardware-specific fields in the atmel_private structure, + This routine is also responsible for initialising some + hardware-specific fields in the atmel_private structure, including a copy of the firmware's hostinfo stucture which is the route into the rest of the firmare datastructures. */ struct atmel_private *priv = netdev_priv(dev); u8 configuration; - + /* data to add to the firmware names, in priority order this implemenents firmware versioning */ - + static char *firmware_modifier[] = { "-wpa", "", NULL }; - + /* reset pccard */ - if (priv->bus_type == BUS_TYPE_PCCARD) + if (priv->bus_type == BUS_TYPE_PCCARD) atmel_write16(priv->dev, GCR, 0x0060); - + /* stop card , disable interrupts */ atmel_write16(priv->dev, GCR, 0x0040); - + if (priv->card_type == CARD_TYPE_EEPROM) { /* copy in firmware if needed */ const struct firmware *fw_entry = NULL; @@ -3661,13 +3636,13 @@ static int reset_atmel_card(struct net_device *dev) "%s: card type is unknown: assuming at76c502 firmware is OK.\n", dev->name); printk(KERN_INFO - "%s: if not, use the firmware= module parameter.\n", + "%s: if not, use the firmware= module parameter.\n", dev->name); strcpy(priv->firmware_id, "atmel_at76c502.bin"); } if (request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev) != 0) { - printk(KERN_ALERT - "%s: firmware %s is missing, cannot continue.\n", + printk(KERN_ALERT + "%s: firmware %s is missing, cannot continue.\n", dev->name, priv->firmware_id); return 0; } @@ -3679,7 +3654,7 @@ static int reset_atmel_card(struct net_device *dev) while (fw_table[fw_index].fw_type != priv->firmware_type && fw_table[fw_index].fw_type != ATMEL_FW_TYPE_NONE) fw_index++; - + /* construct the actual firmware file name */ if (fw_table[fw_index].fw_type != ATMEL_FW_TYPE_NONE) { int i; @@ -3694,24 +3669,24 @@ static int reset_atmel_card(struct net_device *dev) } } if (!success) { - printk(KERN_ALERT - "%s: firmware %s is missing, cannot start.\n", + printk(KERN_ALERT + "%s: firmware %s is missing, cannot start.\n", dev->name, priv->firmware_id); priv->firmware_id[0] = '\0'; - return 0; + return 0; } } - + fw = fw_entry->data; len = fw_entry->size; } - + if (len <= 0x6000) { atmel_write16(priv->dev, BSR, BSS_IRAM); atmel_copy_to_card(priv->dev, 0, fw, len); atmel_set_gcr(priv->dev, GCR_REMAP); } else { - /* Remap */ + /* Remap */ atmel_set_gcr(priv->dev, GCR_REMAP); atmel_write16(priv->dev, BSR, BSS_IRAM); atmel_copy_to_card(priv->dev, 0, fw, 0x6000); @@ -3733,45 +3708,45 @@ static int reset_atmel_card(struct net_device *dev) the 3com broken-ness filter. */ priv->use_wpa = (priv->host_info.major_version == 4); priv->radio_on_broken = (priv->host_info.major_version == 5); - + /* unmask all irq sources */ atmel_wmem8(priv, atmel_hi(priv, IFACE_INT_MASK_OFFSET), 0xff); - + /* int Tx system and enable Tx */ atmel_wmem8(priv, atmel_tx(priv, TX_DESC_FLAGS_OFFSET, 0), 0); atmel_wmem32(priv, atmel_tx(priv, TX_DESC_NEXT_OFFSET, 0), 0x80000000L); atmel_wmem16(priv, atmel_tx(priv, TX_DESC_POS_OFFSET, 0), 0); atmel_wmem16(priv, atmel_tx(priv, TX_DESC_SIZE_OFFSET, 0), 0); - priv->tx_desc_free = priv->host_info.tx_desc_count; - priv->tx_desc_head = 0; - priv->tx_desc_tail = 0; + priv->tx_desc_free = priv->host_info.tx_desc_count; + priv->tx_desc_head = 0; + priv->tx_desc_tail = 0; priv->tx_desc_previous = 0; priv->tx_free_mem = priv->host_info.tx_buff_size; - priv->tx_buff_head = 0; - priv->tx_buff_tail = 0; - - configuration = atmel_rmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET)); - atmel_wmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET), + priv->tx_buff_head = 0; + priv->tx_buff_tail = 0; + + configuration = atmel_rmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET)); + atmel_wmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET), configuration | FUNC_CTRL_TxENABLE); /* init Rx system and enable */ priv->rx_desc_head = 0; - - configuration = atmel_rmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET)); - atmel_wmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET), + + configuration = atmel_rmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET)); + atmel_wmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET), configuration | FUNC_CTRL_RxENABLE); - + if (!priv->radio_on_broken) { - if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) == + if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) == CMD_STATUS_REJECTED_RADIO_OFF) { - printk(KERN_INFO + printk(KERN_INFO "%s: cannot turn the radio on. (Hey radio, you're beautiful!)\n", dev->name); return 0; } } - + /* set up enough MIB values to run. */ atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_AUTO_TX_RATE_POS, priv->auto_tx_rate); atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_TX_PROMISCUOUS_POS, PROM_MODE_OFF); @@ -3780,7 +3755,7 @@ static int reset_atmel_card(struct net_device *dev) atmel_set_mib8(priv, Mac_Mib_Type, MAC_MIB_SHORT_RETRY_POS, priv->short_retry); atmel_set_mib8(priv, Mac_Mib_Type, MAC_MIB_LONG_RETRY_POS, priv->long_retry); atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_PREAMBLE_TYPE, priv->preamble); - atmel_set_mib(priv, Mac_Address_Mib_Type, MAC_ADDR_MIB_MAC_ADDR_POS, + atmel_set_mib(priv, Mac_Address_Mib_Type, MAC_ADDR_MIB_MAC_ADDR_POS, priv->dev->dev_addr, 6); atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_PS_MODE_POS, ACTIVE_MODE); atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1); @@ -3791,44 +3766,42 @@ static int reset_atmel_card(struct net_device *dev) build_wpa_mib(priv); else build_wep_mib(priv); - + return 1; } -static void atmel_send_command(struct atmel_private *priv, int command, - void *cmd, int cmd_size) +static void atmel_send_command(struct atmel_private *priv, int command, void *cmd, int cmd_size) { if (cmd) - atmel_copy_to_card(priv->dev, atmel_co(priv, CMD_BLOCK_PARAMETERS_OFFSET), + atmel_copy_to_card(priv->dev, atmel_co(priv, CMD_BLOCK_PARAMETERS_OFFSET), cmd, cmd_size); - + atmel_wmem8(priv, atmel_co(priv, CMD_BLOCK_COMMAND_OFFSET), command); atmel_wmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET), 0); } - -static int atmel_send_command_wait(struct atmel_private *priv, int command, - void *cmd, int cmd_size) + +static int atmel_send_command_wait(struct atmel_private *priv, int command, void *cmd, int cmd_size) { int i, status; - + atmel_send_command(priv, command, cmd, cmd_size); - + for (i = 5000; i; i--) { status = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET)); - if (status != CMD_STATUS_IDLE && + if (status != CMD_STATUS_IDLE && status != CMD_STATUS_IN_PROGRESS) break; udelay(20); } - + if (i == 0) { printk(KERN_ALERT "%s: failed to contact MAC.\n", priv->dev->name); status = CMD_STATUS_HOST_ERROR; - } else { + } else { if (command != CMD_EnableRadio) status = CMD_STATUS_COMPLETE; } - + return status; } @@ -3854,8 +3827,7 @@ static void atmel_set_mib8(struct atmel_private *priv, u8 type, u8 index, u8 dat atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, MIB_HEADER_SIZE + 1); } -static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, - u16 data) +static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, u16 data) { struct get_set_mib m; m.type = type; @@ -3867,8 +3839,7 @@ static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, MIB_HEADER_SIZE + 2); } -static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, - u8 *data, int data_len) +static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len) { struct get_set_mib m; m.type = type; @@ -3877,24 +3848,23 @@ static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, if (data_len > MIB_MAX_DATA_BYTES) printk(KERN_ALERT "%s: MIB buffer too small.\n", priv->dev->name); - + memcpy(m.data, data, data_len); atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, MIB_HEADER_SIZE + data_len); } -static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index, - u8 *data, int data_len) +static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len) { struct get_set_mib m; m.type = type; m.size = data_len; m.index = index; - + if (data_len > MIB_MAX_DATA_BYTES) printk(KERN_ALERT "%s: MIB buffer too small.\n", priv->dev->name); - + atmel_send_command_wait(priv, CMD_Get_MIB_Vars, &m, MIB_HEADER_SIZE + data_len); - atmel_copy_to_host(priv->dev, data, + atmel_copy_to_host(priv->dev, data, atmel_co(priv, CMD_BLOCK_PARAMETERS_OFFSET + MIB_HEADER_SIZE), data_len); } @@ -3903,12 +3873,11 @@ static void atmel_writeAR(struct net_device *dev, u16 data) int i; outw(data, dev->base_addr + AR); /* Address register appears to need some convincing..... */ - for (i = 0; data != inw(dev->base_addr + AR) && i < 10; i++) + for (i = 0; data != inw(dev->base_addr + AR) && i<10; i++) outw(data, dev->base_addr + AR); } -static void atmel_copy_to_card(struct net_device *dev, u16 dest, - unsigned char *src, u16 len) +static void atmel_copy_to_card(struct net_device *dev, u16 dest, unsigned char *src, u16 len) { int i; atmel_writeAR(dev, dest); @@ -3925,8 +3894,7 @@ static void atmel_copy_to_card(struct net_device *dev, u16 dest, atmel_write8(dev, DR, *src); } -static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest, - u16 src, u16 len) +static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest, u16 src, u16 len) { int i; atmel_writeAR(dev, src); @@ -3962,24 +3930,22 @@ static int atmel_lock_mac(struct atmel_private *priv) break; udelay(20); } - - if (!i) - return 0; /* timed out */ - + + if (!i) return 0; /* timed out */ + atmel_wmem8(priv, atmel_hi(priv, IFACE_LOCKOUT_MAC_OFFSET), 1); if (atmel_rmem8(priv, atmel_hi(priv, IFACE_LOCKOUT_HOST_OFFSET))) { atmel_wmem8(priv, atmel_hi(priv, IFACE_LOCKOUT_MAC_OFFSET), 0); - if (!j--) - return 0; /* timed out */ + if (!j--) return 0; /* timed out */ goto retry; } - + return 1; } static void atmel_wmem32(struct atmel_private *priv, u16 pos, u32 data) { - atmel_writeAR(priv->dev, pos); + atmel_writeAR(priv->dev, pos); atmel_write16(priv->dev, DR, data); /* card is little-endian */ atmel_write16(priv->dev, DR, data >> 16); } @@ -4051,9 +4017,9 @@ static void atmel_wmem32(struct atmel_private *priv, u16 pos, u32 data) serial output, since SO is normally high. But it does cause 8 clock cycles and thus 8 bits to be clocked in to the chip. See Atmel's SPI - controller (e.g. AT91M55800) timing and 4K + controller (e.g. AT91M55800) timing and 4K SPI EEPROM manuals */ - + .set NVRAM_SCRATCH, 0x02000100 /* arbitrary area for scratchpad memory */ .set NVRAM_IMAGE, 0x02000200 .set NVRAM_LENGTH, 0x0200 @@ -4066,24 +4032,24 @@ static void atmel_wmem32(struct atmel_private *priv, u16 pos, u32 data) .set MR4, 0xC RESET_VECTOR: b RESET_HANDLER -UNDEF_VECTOR: +UNDEF_VECTOR: b HALT1 -SWI_VECTOR: +SWI_VECTOR: b HALT1 -IABORT_VECTOR: +IABORT_VECTOR: b HALT1 -DABORT_VECTOR: -RESERVED_VECTOR: +DABORT_VECTOR: +RESERVED_VECTOR: b HALT1 -IRQ_VECTOR: +IRQ_VECTOR: b HALT1 -FIQ_VECTOR: +FIQ_VECTOR: b HALT1 HALT1: b HALT1 RESET_HANDLER: mov r0, #CPSR_INITIAL msr CPSR_c, r0 /* This is probably unnecessary */ - + /* I'm guessing this is initializing clock generator electronics for SPI */ ldr r0, =SPI_CGEN_BASE mov r1, #0 @@ -4095,7 +4061,7 @@ HALT1: b HALT1 str r1, [r0, #28] mov r1, #1 str r1, [r0, #8] - + ldr r0, =MRBASE mov r1, #0 strh r1, [r0, #MR1] @@ -4128,7 +4094,7 @@ HALT2: b HALT2 ldmia sp!, {lr} bx lr .endfunc - + .func Get_MAC_Addr, GET_MAC_ADDR GET_MAC_ADDR: stmdb sp!, {lr} @@ -4144,13 +4110,13 @@ HALT2: b HALT2 .func Delay9, DELAY9 DELAY9: adds r0, r0, r0, LSL #3 /* r0 = r0 * 9 */ -DELAYLOOP: +DELAYLOOP: beq DELAY9_done subs r0, r0, #1 b DELAYLOOP -DELAY9_done: +DELAY9_done: bx lr -.endfunc +.endfunc .func SP_Init, SP_INIT SP_INIT: @@ -4179,26 +4145,26 @@ HALT2: b HALT2 ldr r0, [r0, #SP_RDR] bx lr .endfunc -.func NVRAM_Init, NVRAM_INIT +.func NVRAM_Init, NVRAM_INIT NVRAM_INIT: ldr r1, =SP_BASE ldr r0, [r1, #SP_RDR] mov r0, #NVRAM_CMD_RDSR str r0, [r1, #SP_TDR] -SP_loop1: +SP_loop1: ldr r0, [r1, #SP_SR] tst r0, #SP_TDRE beq SP_loop1 mov r0, #SPI_8CLOCKS - str r0, [r1, #SP_TDR] -SP_loop2: + str r0, [r1, #SP_TDR] +SP_loop2: ldr r0, [r1, #SP_SR] tst r0, #SP_TDRE beq SP_loop2 ldr r0, [r1, #SP_RDR] -SP_loop3: +SP_loop3: ldr r0, [r1, #SP_SR] tst r0, #SP_RDRF beq SP_loop3 @@ -4207,7 +4173,7 @@ HALT2: b HALT2 and r0, r0, #255 bx lr .endfunc - + .func NVRAM_Xfer, NVRAM_XFER /* r0 = dest address */ /* r1 = not used */ @@ -4219,11 +4185,11 @@ HALT2: b HALT2 mov r4, r3 /* save r3 (length) */ mov r0, r2, LSR #5 /* SPI memories put A8 in the command field */ and r0, r0, #8 - add r0, r0, #NVRAM_CMD_READ + add r0, r0, #NVRAM_CMD_READ ldr r1, =NVRAM_SCRATCH strb r0, [r1, #0] /* save command in NVRAM_SCRATCH[0] */ strb r2, [r1, #1] /* save low byte of source address in NVRAM_SCRATCH[1] */ -_local1: +_local1: bl NVRAM_INIT tst r0, #NVRAM_SR_RDY bne _local1 @@ -4245,7 +4211,7 @@ HALT2: b HALT2 cmp r0, #0 bls _local2 ldr r5, =NVRAM_SCRATCH -_local4: +_local4: ldrb r6, [r5, r3] str r6, [r4, #SP_TDR] _local3: @@ -4259,7 +4225,7 @@ HALT2: b HALT2 mov r3, #SPI_8CLOCKS str r3, [r4, #SP_TDR] ldr r0, [r4, #SP_RDR] -_local5: +_local5: ldr r0, [r4, #SP_SR] tst r0, #SP_RDRF beq _local5 @@ -4267,12 +4233,12 @@ HALT2: b HALT2 mov r0, #0 cmp r2, #0 /* r2 is # of bytes to copy in */ bls _local6 -_local7: +_local7: ldr r5, [r4, #SP_SR] tst r5, #SP_TDRE beq _local7 str r3, [r4, #SP_TDR] /* r3 has SPI_8CLOCKS */ -_local8: +_local8: ldr r5, [r4, #SP_SR] tst r5, #SP_RDRF beq _local8 diff --git a/trunk/drivers/net/wireless/hermes.c b/trunk/drivers/net/wireless/hermes.c index 346c6febb033..579480dad374 100644 --- a/trunk/drivers/net/wireless/hermes.c +++ b/trunk/drivers/net/wireless/hermes.c @@ -398,7 +398,7 @@ static int hermes_bap_seek(hermes_t *hw, int bap, u16 id, u16 offset) * * Returns: < 0 on internal failure (errno), 0 on success, > 0 on error from firmware */ -int hermes_bap_pread(hermes_t *hw, int bap, void *buf, int len, +int hermes_bap_pread(hermes_t *hw, int bap, void *buf, unsigned len, u16 id, u16 offset) { int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; @@ -424,7 +424,7 @@ int hermes_bap_pread(hermes_t *hw, int bap, void *buf, int len, * * Returns: < 0 on internal failure (errno), 0 on success, > 0 on error from firmware */ -int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, int len, +int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, unsigned len, u16 id, u16 offset) { int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; @@ -450,7 +450,7 @@ int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, int len, * * Returns: < 0 on internal failure (errno), 0 on success, > 0 on error from firmware */ -int hermes_bap_pwrite_pad(hermes_t *hw, int bap, const void *buf, unsigned data_len, int len, +int hermes_bap_pwrite_pad(hermes_t *hw, int bap, const void *buf, unsigned data_len, unsigned len, u16 id, u16 offset) { int dreg = bap ? HERMES_DATA1 : HERMES_DATA0; diff --git a/trunk/drivers/net/wireless/hermes.h b/trunk/drivers/net/wireless/hermes.h index 7644f72a9f4e..a6bd472d75d4 100644 --- a/trunk/drivers/net/wireless/hermes.h +++ b/trunk/drivers/net/wireless/hermes.h @@ -372,12 +372,12 @@ int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0, struct hermes_response *resp); int hermes_allocate(hermes_t *hw, u16 size, u16 *fid); -int hermes_bap_pread(hermes_t *hw, int bap, void *buf, int len, +int hermes_bap_pread(hermes_t *hw, int bap, void *buf, unsigned len, u16 id, u16 offset); -int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, int len, +int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, unsigned len, u16 id, u16 offset); int hermes_bap_pwrite_pad(hermes_t *hw, int bap, const void *buf, - unsigned data_len, int len, u16 id, u16 offset); + unsigned data_len, unsigned len, u16 id, u16 offset); int hermes_read_ltv(hermes_t *hw, int bap, u16 rid, unsigned buflen, u16 *length, void *buf); int hermes_write_ltv(hermes_t *hw, int bap, u16 rid, diff --git a/trunk/drivers/net/wireless/hostap/Makefile b/trunk/drivers/net/wireless/hostap/Makefile index 353ccb93134b..fc62235bfc24 100644 --- a/trunk/drivers/net/wireless/hostap/Makefile +++ b/trunk/drivers/net/wireless/hostap/Makefile @@ -1,4 +1,3 @@ -hostap-y := hostap_main.o obj-$(CONFIG_HOSTAP) += hostap.o obj-$(CONFIG_HOSTAP_CS) += hostap_cs.o diff --git a/trunk/drivers/net/wireless/hostap/hostap_main.c b/trunk/drivers/net/wireless/hostap/hostap.c similarity index 100% rename from trunk/drivers/net/wireless/hostap/hostap_main.c rename to trunk/drivers/net/wireless/hostap/hostap.c diff --git a/trunk/drivers/net/wireless/i82593.h b/trunk/drivers/net/wireless/i82593.h index afac5c7a323d..33acb8add4d6 100644 --- a/trunk/drivers/net/wireless/i82593.h +++ b/trunk/drivers/net/wireless/i82593.h @@ -7,16 +7,11 @@ * * Copyright 1994, Anders Klemets * + * This software may be freely distributed for noncommercial purposes + * as long as this notice is retained. + * * HISTORY * i82593.h,v - * Revision 1.4 2005/11/4 09:15:00 baroniunas - * Modified copyright with permission of author as follows: - * - * "If I82539.H is the only file with my copyright statement - * that is included in the Source Forge project, then you have - * my approval to change the copyright statement to be a GPL - * license, in the way you proposed on October 10." - * * Revision 1.1 1996/07/17 15:23:12 root * Initial revision * diff --git a/trunk/drivers/net/wireless/ipw2100.c b/trunk/drivers/net/wireless/ipw2100.c index 44cd3fcd1572..a2e6214169e9 100644 --- a/trunk/drivers/net/wireless/ipw2100.c +++ b/trunk/drivers/net/wireless/ipw2100.c @@ -175,7 +175,7 @@ that only one external action is invoked at a time. #define DRV_COPYRIGHT "Copyright(c) 2003-2005 Intel Corporation" /* Debugging stuff */ -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG #define CONFIG_IPW2100_RX_DEBUG /* Reception debugging */ #endif @@ -208,7 +208,7 @@ MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])"); static u32 ipw2100_debug_level = IPW_DL_NONE; -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG #define IPW_DEBUG(level, message...) \ do { \ if (ipw2100_debug_level & (level)) { \ @@ -219,9 +219,9 @@ do { \ } while (0) #else #define IPW_DEBUG(level, message...) do {} while (0) -#endif /* CONFIG_IPW2100_DEBUG */ +#endif /* CONFIG_IPW_DEBUG */ -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG static const char *command_types[] = { "undefined", "unused", /* HOST_ATTENTION */ @@ -2081,7 +2081,7 @@ static void isr_scan_complete(struct ipw2100_priv *priv, u32 status) priv->status &= ~STATUS_SCANNING; } -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG #define IPW2100_HANDLER(v, f) { v, f, # v } struct ipw2100_status_indicator { int status; @@ -2094,7 +2094,7 @@ struct ipw2100_status_indicator { int status; void (*cb) (struct ipw2100_priv * priv, u32 status); }; -#endif /* CONFIG_IPW2100_DEBUG */ +#endif /* CONFIG_IPW_DEBUG */ static void isr_indicate_scanning(struct ipw2100_priv *priv, u32 status) { @@ -2149,7 +2149,7 @@ static void isr_status_change(struct ipw2100_priv *priv, int status) static void isr_rx_complete_command(struct ipw2100_priv *priv, struct ipw2100_cmd_header *cmd) { -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG if (cmd->host_command_reg < ARRAY_SIZE(command_types)) { IPW_DEBUG_HC("Command completed '%s (%d)'\n", command_types[cmd->host_command_reg], @@ -2167,7 +2167,7 @@ static void isr_rx_complete_command(struct ipw2100_priv *priv, wake_up_interruptible(&priv->wait_command_queue); } -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG static const char *frame_types[] = { "COMMAND_STATUS_VAL", "STATUS_CHANGE_VAL", @@ -2290,7 +2290,7 @@ static u8 packet_data[IPW_RX_NIC_BUFFER_LENGTH]; static inline void ipw2100_corruption_detected(struct ipw2100_priv *priv, int i) { -#ifdef CONFIG_IPW2100_DEBUG_C3 +#ifdef CONFIG_IPW_DEBUG_C3 struct ipw2100_status *status = &priv->status_queue.drv[i]; u32 match, reg; int j; @@ -2312,7 +2312,7 @@ static inline void ipw2100_corruption_detected(struct ipw2100_priv *priv, int i) } #endif -#ifdef CONFIG_IPW2100_DEBUG_C3 +#ifdef CONFIG_IPW_DEBUG_C3 /* Halt the fimrware so we can get a good image */ write_register(priv->net_dev, IPW_REG_RESET_REG, IPW_AUX_HOST_RESET_REG_STOP_MASTER); @@ -2716,7 +2716,7 @@ static inline int __ipw2100_tx_process(struct ipw2100_priv *priv) list_del(element); DEC_STAT(&priv->fw_pend_stat); -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG { int i = txq->oldest; IPW_DEBUG_TX("TX%d V=%p P=%04X T=%04X L=%d\n", i, @@ -2782,7 +2782,7 @@ static inline int __ipw2100_tx_process(struct ipw2100_priv *priv) "something else: ids %d=%d.\n", priv->net_dev->name, txq->oldest, packet->index); -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG if (packet->info.c_struct.cmd->host_command_reg < sizeof(command_types) / sizeof(*command_types)) IPW_DEBUG_TX("Command '%s (%d)' processed: %d.\n", @@ -2975,7 +2975,7 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv) IPW_DEBUG_TX("data header tbd TX%d P=%08x L=%d\n", packet->index, tbd->host_addr, tbd->buf_length); -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG if (packet->info.d_struct.txb->nr_frags > 1) IPW_DEBUG_FRAG("fragment Tx: %d frames\n", packet->info.d_struct.txb->nr_frags); @@ -3827,7 +3827,7 @@ static ssize_t show_stats(struct device *d, struct device_attribute *attr, priv->rx_interrupts, priv->inta_other); out += sprintf(out, "firmware resets: %d\n", priv->resets); out += sprintf(out, "firmware hangs: %d\n", priv->hangs); -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG out += sprintf(out, "packet mismatch image: %s\n", priv->snapshot[0] ? "YES" : "NO"); #endif @@ -3982,7 +3982,7 @@ static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr, static DEVICE_ATTR(bssinfo, S_IRUGO, show_bssinfo, NULL); -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG static ssize_t show_debug_level(struct device_driver *d, char *buf) { return sprintf(buf, "0x%08X\n", ipw2100_debug_level); @@ -4011,7 +4011,7 @@ static ssize_t store_debug_level(struct device_driver *d, static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, show_debug_level, store_debug_level); -#endif /* CONFIG_IPW2100_DEBUG */ +#endif /* CONFIG_IPW_DEBUG */ static ssize_t show_fatal_error(struct device *d, struct device_attribute *attr, char *buf) @@ -4937,7 +4937,7 @@ static int ipw2100_set_mandatory_bssid(struct ipw2100_priv *priv, u8 * bssid, }; int err; -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG if (bssid != NULL) IPW_DEBUG_HC("MANDATORY_BSSID: %02X:%02X:%02X:%02X:%02X:%02X\n", bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], @@ -6344,8 +6344,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev, dev->ethtool_ops = &ipw2100_ethtool_ops; dev->tx_timeout = ipw2100_tx_timeout; dev->wireless_handlers = &ipw2100_wx_handler_def; - priv->wireless_data.ieee80211 = priv->ieee; - dev->wireless_data = &priv->wireless_data; + dev->get_wireless_stats = ipw2100_wx_wireless_stats; dev->set_mac_address = ipw2100_set_address; dev->watchdog_timeo = 3 * HZ; dev->irq = 0; @@ -6858,7 +6857,7 @@ static int __init ipw2100_init(void) ret = pci_module_init(&ipw2100_pci_driver); -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG ipw2100_debug_level = debug; driver_create_file(&ipw2100_pci_driver.driver, &driver_attr_debug_level); @@ -6873,7 +6872,7 @@ static int __init ipw2100_init(void) static void __exit ipw2100_exit(void) { /* FIXME: IPG: check that we have no instances of the devices open */ -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG driver_remove_file(&ipw2100_pci_driver.driver, &driver_attr_debug_level); #endif @@ -7179,11 +7178,6 @@ static int ipw2100_wx_get_range(struct net_device *dev, } range->num_frequency = val; - /* Event capability (kernel + driver) */ - range->event_capa[0] = (IW_EVENT_CAPA_K_0 | - IW_EVENT_CAPA_MASK(SIOCGIWAP)); - range->event_capa[1] = IW_EVENT_CAPA_K_1; - IPW_DEBUG_WX("GET Range\n"); return 0; @@ -8452,6 +8446,16 @@ static iw_handler ipw2100_private_handler[] = { #endif /* CONFIG_IPW2100_MONITOR */ }; +static struct iw_handler_def ipw2100_wx_handler_def = { + .standard = ipw2100_wx_handlers, + .num_standard = sizeof(ipw2100_wx_handlers) / sizeof(iw_handler), + .num_private = sizeof(ipw2100_private_handler) / sizeof(iw_handler), + .num_private_args = sizeof(ipw2100_private_args) / + sizeof(struct iw_priv_args), + .private = (iw_handler *) ipw2100_private_handler, + .private_args = (struct iw_priv_args *)ipw2100_private_args, +}; + /* * Get wireless statistics. * Called by /proc/net/wireless @@ -8558,7 +8562,7 @@ static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device *dev) quality = min(beacon_qual, min(tx_qual, rssi_qual)); -#ifdef CONFIG_IPW2100_DEBUG +#ifdef CONFIG_IPW_DEBUG if (beacon_qual == quality) IPW_DEBUG_WX("Quality clamped by Missed Beacons\n"); else if (tx_qual == quality) @@ -8593,17 +8597,6 @@ static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device *dev) return (struct iw_statistics *)NULL; } -static struct iw_handler_def ipw2100_wx_handler_def = { - .standard = ipw2100_wx_handlers, - .num_standard = sizeof(ipw2100_wx_handlers) / sizeof(iw_handler), - .num_private = sizeof(ipw2100_private_handler) / sizeof(iw_handler), - .num_private_args = sizeof(ipw2100_private_args) / - sizeof(struct iw_priv_args), - .private = (iw_handler *) ipw2100_private_handler, - .private_args = (struct iw_priv_args *)ipw2100_private_args, - .get_wireless_stats = ipw2100_wx_wireless_stats, -}; - static void ipw2100_wx_event_work(struct ipw2100_priv *priv) { union iwreq_data wrqu; diff --git a/trunk/drivers/net/wireless/ipw2100.h b/trunk/drivers/net/wireless/ipw2100.h index f6c51441fa87..140fdf2a0a09 100644 --- a/trunk/drivers/net/wireless/ipw2100.h +++ b/trunk/drivers/net/wireless/ipw2100.h @@ -73,7 +73,7 @@ struct ipw2100_rx_packet; * you simply need to add your entry to the ipw2100_debug_levels array. * * If you do not see debug_level in /proc/net/ipw2100 then you do not have - * CONFIG_IPW2100_DEBUG defined in your kernel configuration + * CONFIG_IPW_DEBUG defined in your kernel configuration * */ @@ -571,8 +571,6 @@ struct ipw2100_priv { struct net_device *net_dev; struct iw_statistics wstats; - struct iw_public_data wireless_data; - struct tasklet_struct irq_tasklet; struct workqueue_struct *workqueue; diff --git a/trunk/drivers/net/wireless/ipw2200.c b/trunk/drivers/net/wireless/ipw2200.c index cdfe50207757..b0d195d1721a 100644 --- a/trunk/drivers/net/wireless/ipw2200.c +++ b/trunk/drivers/net/wireless/ipw2200.c @@ -462,7 +462,7 @@ static inline void ipw_disable_interrupts(struct ipw_priv *priv) ipw_write32(priv, IPW_INTA_MASK_R, ~IPW_INTA_MASK_ALL); } -#ifdef CONFIG_IPW2200_DEBUG +#ifdef CONFIG_IPW_DEBUG static char *ipw_error_desc(u32 val) { switch (val) { @@ -1110,7 +1110,8 @@ static struct ipw_fw_error *ipw_alloc_error_log(struct ipw_priv *priv) error->elem_len = elem_len; error->log_len = log_len; error->elem = (struct ipw_error_elem *)error->payload; - error->log = (struct ipw_event *)(error->elem + elem_len); + error->log = (struct ipw_event *)(error->elem + + (sizeof(*error->elem) * elem_len)); ipw_capture_event_log(priv, log_len, error->log); @@ -1235,7 +1236,7 @@ static ssize_t store_scan_age(struct device *d, struct device_attribute *attr, const char *buf, size_t count) { struct ipw_priv *priv = dev_get_drvdata(d); -#ifdef CONFIG_IPW2200_DEBUG +#ifdef CONFIG_IPW_DEBUG struct net_device *dev = priv->net_dev; #endif char buffer[] = "00000000"; @@ -1754,7 +1755,7 @@ static void ipw_irq_tasklet(struct ipw_priv *priv) IPW_ERROR("Firmware error detected. Restarting.\n"); if (priv->error) { IPW_ERROR("Sysfs 'error' log already exists.\n"); -#ifdef CONFIG_IPW2200_DEBUG +#ifdef CONFIG_IPW_DEBUG if (ipw_debug_level & IPW_DL_FW_ERRORS) { struct ipw_fw_error *error = ipw_alloc_error_log(priv); @@ -1770,7 +1771,7 @@ static void ipw_irq_tasklet(struct ipw_priv *priv) else IPW_ERROR("Error allocating sysfs 'error' " "log.\n"); -#ifdef CONFIG_IPW2200_DEBUG +#ifdef CONFIG_IPW_DEBUG if (ipw_debug_level & IPW_DL_FW_ERRORS) ipw_dump_error_log(priv, priv->error); #endif @@ -3778,7 +3779,7 @@ static const struct ipw_status_code ipw_status_codes[] = { {0x2E, "Cipher suite is rejected per security policy"}, }; -#ifdef CONFIG_IPW2200_DEBUG +#ifdef CONFIG_IPW_DEBUG static const char *ipw_get_status_code(u16 status) { int i; @@ -4250,7 +4251,7 @@ static inline void ipw_rx_notification(struct ipw_priv *priv, if (priv-> status & (STATUS_ASSOCIATED | STATUS_AUTH)) { -#ifdef CONFIG_IPW2200_DEBUG +#ifdef CONFIG_IPW_DEBUG struct notif_authenticate *auth = ¬if->u.auth; IPW_DEBUG(IPW_DL_NOTIF | @@ -4944,11 +4945,12 @@ static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *priv) struct ipw_rx_queue *rxq; int i; - rxq = kzalloc(sizeof(*rxq), GFP_KERNEL); + rxq = (struct ipw_rx_queue *)kmalloc(sizeof(*rxq), GFP_KERNEL); if (unlikely(!rxq)) { IPW_ERROR("memory allocation failed\n"); return NULL; } + memset(rxq, 0, sizeof(*rxq)); spin_lock_init(&rxq->lock); INIT_LIST_HEAD(&rxq->rx_free); INIT_LIST_HEAD(&rxq->rx_used); @@ -5827,7 +5829,7 @@ static void ipw_bg_adhoc_check(void *data) up(&priv->sem); } -#ifdef CONFIG_IPW2200_DEBUG +#ifdef CONFIG_IPW_DEBUG static void ipw_debug_config(struct ipw_priv *priv) { IPW_DEBUG_INFO("Scan completed, no valid APs matched " @@ -7455,7 +7457,8 @@ static void ipw_handle_data_packet(struct ipw_priv *priv, /* HW decrypt will not clear the WEP bit, MIC, PN, etc. */ hdr = (struct ieee80211_hdr_4addr *)rxb->skb->data; if (priv->ieee->iw_mode != IW_MODE_MONITOR && - (is_multicast_ether_addr(hdr->addr1) ? + ((is_multicast_ether_addr(hdr->addr1) || + is_broadcast_ether_addr(hdr->addr1)) ? !priv->ieee->host_mc_decrypt : !priv->ieee->host_decrypt)) ipw_rebuild_decrypted_skb(priv, rxb->skb); @@ -7646,7 +7649,8 @@ static inline int is_network_packet(struct ipw_priv *priv, return 0; /* {broad,multi}cast packets to our BSSID go through */ - if (is_multicast_ether_addr(header->addr1)) + if (is_multicast_ether_addr(header->addr1) || + is_broadcast_ether_addr(header->addr1)) return !memcmp(header->addr3, priv->bssid, ETH_ALEN); /* packets to our adapter go through */ @@ -7659,7 +7663,8 @@ static inline int is_network_packet(struct ipw_priv *priv, return 0; /* {broad,multi}cast packets to our BSS go through */ - if (is_multicast_ether_addr(header->addr1)) + if (is_multicast_ether_addr(header->addr1) || + is_broadcast_ether_addr(header->addr1)) return !memcmp(header->addr2, priv->bssid, ETH_ALEN); /* packets to our adapter go through */ @@ -7811,7 +7816,7 @@ static void ipw_rx(struct ipw_priv *priv) while (i != r) { rxb = priv->rxq->queue[i]; -#ifdef CONFIG_IPW2200_DEBUG +#ifdef CONFIG_IPW_DEBUG if (unlikely(rxb == NULL)) { printk(KERN_CRIT "Queue not allocated!\n"); break; @@ -8921,10 +8926,6 @@ static int ipw_request_direct_scan(struct ipw_priv *priv, char *essid, struct ipw_scan_request_ext scan; int err = 0, scan_type; - if (!(priv->status & STATUS_INIT) || - (priv->status & STATUS_EXIT_PENDING)) - return 0; - down(&priv->sem); if (priv->status & STATUS_RF_KILL_MASK) { @@ -9653,7 +9654,8 @@ static inline int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, switch (priv->ieee->iw_mode) { case IW_MODE_ADHOC: hdr_len = IEEE80211_3ADDR_LEN; - unicast = !is_multicast_ether_addr(hdr->addr1); + unicast = !(is_multicast_ether_addr(hdr->addr1) || + is_broadcast_ether_addr(hdr->addr1)); id = ipw_find_station(priv, hdr->addr1); if (id == IPW_INVALID_STATION) { id = ipw_add_station(priv, hdr->addr1); @@ -9668,7 +9670,8 @@ static inline int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, case IW_MODE_INFRA: default: - unicast = !is_multicast_ether_addr(hdr->addr3); + unicast = !(is_multicast_ether_addr(hdr->addr3) || + is_broadcast_ether_addr(hdr->addr3)); hdr_len = IEEE80211_3ADDR_LEN; id = 0; break; @@ -10950,7 +10953,7 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) priv->net_dev = net_dev; priv->pci_dev = pdev; -#ifdef CONFIG_IPW2200_DEBUG +#ifdef CONFIG_IPW_DEBUG ipw_debug_level = debug; #endif spin_lock_init(&priv->lock); diff --git a/trunk/drivers/net/wireless/ipw2200.h b/trunk/drivers/net/wireless/ipw2200.h index e65620a4d79e..1c98db0652c9 100644 --- a/trunk/drivers/net/wireless/ipw2200.h +++ b/trunk/drivers/net/wireless/ipw2200.h @@ -1301,14 +1301,14 @@ struct ipw_priv { /* debug macros */ -#ifdef CONFIG_IPW2200_DEBUG +#ifdef CONFIG_IPW_DEBUG #define IPW_DEBUG(level, fmt, args...) \ do { if (ipw_debug_level & (level)) \ printk(KERN_DEBUG DRV_NAME": %c %s " fmt, \ in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) #else #define IPW_DEBUG(level, fmt, args...) do {} while (0) -#endif /* CONFIG_IPW2200_DEBUG */ +#endif /* CONFIG_IPW_DEBUG */ /* * To use the debug system; @@ -1332,7 +1332,7 @@ do { if (ipw_debug_level & (level)) \ * you simply need to add your entry to the ipw_debug_levels array. * * If you do not see debug_level in /proc/net/ipw then you do not have - * CONFIG_IPW2200_DEBUG defined in your kernel configuration + * CONFIG_IPW_DEBUG defined in your kernel configuration * */ diff --git a/trunk/drivers/net/wireless/orinoco.c b/trunk/drivers/net/wireless/orinoco.c index 6fd0bf736830..488ab06fb79f 100644 --- a/trunk/drivers/net/wireless/orinoco.c +++ b/trunk/drivers/net/wireless/orinoco.c @@ -3512,8 +3512,9 @@ static int orinoco_ioctl_setpower(struct net_device *dev, break; default: err = -EINVAL; - goto out; } + if (err) + goto out; if (prq->flags & IW_POWER_TIMEOUT) { priv->pm_on = 1; diff --git a/trunk/drivers/net/wireless/orinoco_nortel.c b/trunk/drivers/net/wireless/orinoco_nortel.c index d1a670b35338..d8afd51ff8a5 100644 --- a/trunk/drivers/net/wireless/orinoco_nortel.c +++ b/trunk/drivers/net/wireless/orinoco_nortel.c @@ -1,8 +1,6 @@ /* orinoco_nortel.c * * Driver for Prism II devices which would usually be driven by orinoco_cs, - * but are connected to the PCI bus by a PCI-to-PCMCIA adapter used in - * Nortel emobility, Symbol LA-4113 and Symbol LA-4123. * but are connected to the PCI bus by a Nortel PCI-PCMCIA-Adapter. * * Copyright (C) 2002 Tobias Hoffmann @@ -167,7 +165,7 @@ static int nortel_pci_init_one(struct pci_dev *pdev, goto fail_resources; } - iomem = pci_iomap(pdev, 2, 0); + iomem = pci_iomap(pdev, 3, 0); if (!iomem) { err = -ENOMEM; goto fail_map_io; @@ -267,8 +265,6 @@ static void __devexit nortel_pci_remove_one(struct pci_dev *pdev) static struct pci_device_id nortel_pci_id_table[] = { /* Nortel emobility PCI */ {0x126c, 0x8030, PCI_ANY_ID, PCI_ANY_ID,}, - /* Symbol LA-4123 PCI */ - {0x1562, 0x0001, PCI_ANY_ID, PCI_ANY_ID,}, {0,}, }; diff --git a/trunk/drivers/net/wireless/prism54/isl_38xx.c b/trunk/drivers/net/wireless/prism54/isl_38xx.c index 23deee69974b..109a96d90007 100644 --- a/trunk/drivers/net/wireless/prism54/isl_38xx.c +++ b/trunk/drivers/net/wireless/prism54/isl_38xx.c @@ -164,12 +164,12 @@ isl38xx_trigger_device(int asleep, void __iomem *device_base) /* assert the Wakeup interrupt in the Device Interrupt Register */ isl38xx_w32_flush(device_base, ISL38XX_DEV_INT_WAKEUP, ISL38XX_DEV_INT_REG); - -#if VERBOSE > SHOW_ERROR_MESSAGES udelay(ISL38XX_WRITEIO_DELAY); /* perform another read on the Device Status Register */ reg = readl(device_base + ISL38XX_CTRL_STAT_REG); + +#if VERBOSE > SHOW_ERROR_MESSAGES do_gettimeofday(¤t_time); DEBUG(SHOW_TRACING, "%08li.%08li Device register read %08x\n", current_time.tv_sec, (long)current_time.tv_usec, reg); diff --git a/trunk/drivers/parisc/iosapic.c b/trunk/drivers/parisc/iosapic.c index 19657efa8dc3..a39fbfef789a 100644 --- a/trunk/drivers/parisc/iosapic.c +++ b/trunk/drivers/parisc/iosapic.c @@ -700,28 +700,6 @@ static unsigned int iosapic_startup_irq(unsigned int irq) return 0; } -#ifdef CONFIG_SMP -static void iosapic_set_affinity_irq(unsigned int irq, cpumask_t dest) -{ - struct vector_info *vi = iosapic_get_vector(irq); - u32 d0, d1, dummy_d0; - unsigned long flags; - - if (cpu_check_affinity(irq, &dest)) - return; - - vi->txn_addr = txn_affinity_addr(irq, first_cpu(dest)); - - spin_lock_irqsave(&iosapic_lock, flags); - /* d1 contains the destination CPU, so only want to set that - * entry */ - iosapic_rd_irt_entry(vi, &d0, &d1); - iosapic_set_irt_data(vi, &dummy_d0, &d1); - iosapic_wr_irt_entry(vi, d0, d1); - spin_unlock_irqrestore(&iosapic_lock, flags); -} -#endif - static struct hw_interrupt_type iosapic_interrupt_type = { .typename = "IO-SAPIC-level", .startup = iosapic_startup_irq, @@ -730,9 +708,7 @@ static struct hw_interrupt_type iosapic_interrupt_type = { .disable = iosapic_disable_irq, .ack = no_ack_irq, .end = iosapic_end_irq, -#ifdef CONFIG_SMP - .set_affinity = iosapic_set_affinity_irq, -#endif +// .set_affinity = iosapic_set_affinity_irq, }; int iosapic_fixup_irq(void *isi_obj, struct pci_dev *pcidev) diff --git a/trunk/drivers/parisc/superio.c b/trunk/drivers/parisc/superio.c index d14888e149bb..bab3bcabcb6e 100644 --- a/trunk/drivers/parisc/superio.c +++ b/trunk/drivers/parisc/superio.c @@ -24,9 +24,6 @@ * Major changes to get basic interrupt infrastructure working to * hopefully be able to support all SuperIO devices. Currently * works with serial. -- John Marvin - * - * Converted superio_init() to be a PCI_FIXUP_FINAL callee. - * -- Kyle McMartin */ @@ -144,10 +141,10 @@ superio_interrupt(int parent_irq, void *devp, struct pt_regs *regs) } /* Initialize Super I/O device */ -static void -superio_init(struct pci_dev *pcidev) + +static void __devinit +superio_init(struct superio_device *sio) { - struct superio_device *sio = &sio_dev; struct pci_dev *pdev = sio->lio_pdev; u16 word; @@ -163,8 +160,8 @@ superio_init(struct pci_dev *pcidev) /* ...then properly fixup the USB to point at suckyio PIC */ sio->usb_pdev->irq = superio_fixup_irq(sio->usb_pdev); - printk(KERN_INFO "SuperIO: Found NS87560 Legacy I/O device at %s (IRQ %i) \n", - pci_name(pdev), pdev->irq); + printk (KERN_INFO "SuperIO: Found NS87560 Legacy I/O device at %s (IRQ %i) \n", + pci_name(pdev),pdev->irq); pci_read_config_dword (pdev, SIO_SP1BAR, &sio->sp1_base); sio->sp1_base &= ~1; @@ -277,7 +274,7 @@ superio_init(struct pci_dev *pcidev) sio->suckyio_irq_enabled = 1; } -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_LIO, superio_init); + static void superio_disable_irq(unsigned int irq) { @@ -455,10 +452,8 @@ static void superio_fixup_pci(struct pci_dev *pdev) DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415, superio_fixup_pci); -static int __devinit -superio_probe(struct pci_dev *dev, const struct pci_device_id *id) +static int __devinit superio_probe(struct pci_dev *dev, const struct pci_device_id *id) { - struct superio_device *sio = &sio_dev; /* ** superio_probe(00:0e.0) ven 0x100b dev 0x2 sv 0x0 sd 0x0 class 0x1018a @@ -471,8 +466,7 @@ superio_probe(struct pci_dev *dev, const struct pci_device_id *id) dev->subsystem_vendor, dev->subsystem_device, dev->class); - if (!sio->suckyio_irq_enabled) - BUG(); /* Enabled by PCI_FIXUP_FINAL */ + superio_init(&sio_dev); if (dev->device == PCI_DEVICE_ID_NS_87560_LIO) { /* Function 1 */ superio_parport_init(); @@ -487,21 +481,19 @@ superio_probe(struct pci_dev *dev, const struct pci_device_id *id) DBG_INIT("superio_probe: WTF? Fire Extinguisher?\n"); } - /* Let appropriate other driver claim this device. */ + /* Let appropriate other driver claim this device. */ return -ENODEV; } static struct pci_device_id superio_tbl[] = { - { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_LIO) }, - { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_USB) }, - { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415) }, + { PCI_VENDOR_ID_NS, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { 0, } }; static struct pci_driver superio_driver = { - .name = "SuperIO", - .id_table = superio_tbl, - .probe = superio_probe, + .name = "SuperIO", + .id_table = superio_tbl, + .probe = superio_probe, }; static int __init superio_modinit(void) @@ -514,5 +506,6 @@ static void __exit superio_exit(void) pci_unregister_driver(&superio_driver); } + module_init(superio_modinit); module_exit(superio_exit); diff --git a/trunk/drivers/pci/Makefile b/trunk/drivers/pci/Makefile index 6707df968934..716df015f8d0 100644 --- a/trunk/drivers/pci/Makefile +++ b/trunk/drivers/pci/Makefile @@ -6,9 +6,6 @@ obj-y += access.o bus.o probe.o remove.o pci.o quirks.o \ pci-driver.o search.o pci-sysfs.o rom.o setup-res.o obj-$(CONFIG_PROC_FS) += proc.o -# Build PCI Express stuff if needed -obj-$(CONFIG_PCIEPORTBUS) += pcie/ - obj-$(CONFIG_HOTPLUG) += hotplug.o # Build the PCI Hotplug drivers if we were asked to @@ -43,3 +40,7 @@ endif ifeq ($(CONFIG_PCI_DEBUG),y) EXTRA_CFLAGS += -DDEBUG endif + +# Build PCI Express stuff if needed +obj-$(CONFIG_PCIEPORTBUS) += pcie/ + diff --git a/trunk/drivers/pci/hotplug/pciehp.h b/trunk/drivers/pci/hotplug/pciehp.h index 6a61b9f286e1..c42b68d3aa24 100644 --- a/trunk/drivers/pci/hotplug/pciehp.h +++ b/trunk/drivers/pci/hotplug/pciehp.h @@ -59,6 +59,7 @@ struct slot { struct slot *next; u8 bus; u8 device; + u16 status; u32 number; u8 state; struct timer_list task_event; diff --git a/trunk/drivers/pci/hotplug/pciehp_ctrl.c b/trunk/drivers/pci/hotplug/pciehp_ctrl.c index 83c4b865718a..5e582eca21d8 100644 --- a/trunk/drivers/pci/hotplug/pciehp_ctrl.c +++ b/trunk/drivers/pci/hotplug/pciehp_ctrl.c @@ -207,6 +207,7 @@ u8 pciehp_handle_power_fault(u8 hp_slot, void *inst_id) * power fault Cleared */ info("Power fault cleared on Slot(%d)\n", ctrl->first_slot + hp_slot); + p_slot->status = 0x00; taskInfo->event_type = INT_POWER_FAULT_CLEAR; } else { /* @@ -214,6 +215,8 @@ u8 pciehp_handle_power_fault(u8 hp_slot, void *inst_id) */ info("Power fault on Slot(%d)\n", ctrl->first_slot + hp_slot); taskInfo->event_type = INT_POWER_FAULT; + /* set power fault status for this board */ + p_slot->status = 0xFF; info("power fault bit %x set\n", hp_slot); } if (rc) @@ -314,10 +317,13 @@ static int board_added(struct slot *p_slot) return rc; } + dbg("%s: slot status = %x\n", __FUNCTION__, p_slot->status); + /* Check for a power fault */ - if (p_slot->hpc_ops->query_power_fault(p_slot)) { - dbg("%s: power fault detected\n", __FUNCTION__); + if (p_slot->status == 0xFF) { + /* power fault occurred, but it was benign */ rc = POWER_FAILURE; + p_slot->status = 0; goto err_exit; } @@ -328,6 +334,8 @@ static int board_added(struct slot *p_slot) goto err_exit; } + p_slot->status = 0; + /* * Some PCI Express root ports require fixup after hot-plug operation. */ @@ -374,6 +382,9 @@ static int remove_board(struct slot *p_slot) dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot); + /* Change status to shutdown */ + p_slot->status = 0x01; + /* Wait for exclusive access to hardware */ down(&ctrl->crit_sect); diff --git a/trunk/drivers/pci/hotplug/pciehp_hpc.c b/trunk/drivers/pci/hotplug/pciehp_hpc.c index 0b8b26beb163..4a3cecca012c 100644 --- a/trunk/drivers/pci/hotplug/pciehp_hpc.c +++ b/trunk/drivers/pci/hotplug/pciehp_hpc.c @@ -31,8 +31,6 @@ #include #include #include -#include - #include "../pci.h" #include "pciehp.h" @@ -750,7 +748,7 @@ static int hpc_power_on_slot(struct slot * slot) { struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_cmd; - u16 slot_ctrl, slot_status; + u16 slot_ctrl; int retval = 0; @@ -767,14 +765,6 @@ static int hpc_power_on_slot(struct slot * slot) return -1; } - /* Clear sticky power-fault bit from previous power failures */ - hp_register_read_word(php_ctlr->pci_dev, - SLOT_STATUS(slot->ctrl->cap_base), slot_status); - slot_status &= PWR_FAULT_DETECTED; - if (slot_status) - hp_register_write_word(php_ctlr->pci_dev, - SLOT_STATUS(slot->ctrl->cap_base), slot_status); - retval = hp_register_read_word(php_ctlr->pci_dev, SLOT_CTRL(slot->ctrl->cap_base), slot_ctrl); if (retval) { diff --git a/trunk/drivers/pci/hotplug/rpaphp_pci.c b/trunk/drivers/pci/hotplug/rpaphp_pci.c index 4b35097b3d9f..a7859a84d1ae 100644 --- a/trunk/drivers/pci/hotplug/rpaphp_pci.c +++ b/trunk/drivers/pci/hotplug/rpaphp_pci.c @@ -253,7 +253,7 @@ rpaphp_pci_config_slot(struct pci_bus *bus) if (!dn || !dn->child) return NULL; - if (_machine == PLATFORM_PSERIES_LPAR) { + if (systemcfg->platform == PLATFORM_PSERIES_LPAR) { of_scan_bus(dn, bus); if (list_empty(&bus->devices)) { err("%s: No new device found\n", __FUNCTION__); diff --git a/trunk/drivers/pci/hotplug/shpchp_hpc.c b/trunk/drivers/pci/hotplug/shpchp_hpc.c index 9987a6fd65b8..40905a6c8094 100644 --- a/trunk/drivers/pci/hotplug/shpchp_hpc.c +++ b/trunk/drivers/pci/hotplug/shpchp_hpc.c @@ -31,8 +31,6 @@ #include #include #include -#include - #include "shpchp.h" #ifdef DEBUG diff --git a/trunk/drivers/pci/pci-acpi.c b/trunk/drivers/pci/pci-acpi.c index 6917c6cb0912..a9b00cc2d885 100644 --- a/trunk/drivers/pci/pci-acpi.c +++ b/trunk/drivers/pci/pci-acpi.c @@ -178,7 +178,6 @@ EXPORT_SYMBOL(pci_osc_support_set); /** * pci_osc_control_set - commit requested control to Firmware - * @handle: acpi_handle for the target ACPI object * @flags: driver's requested control bits * * Attempt to take control from Firmware on requested control bits. diff --git a/trunk/drivers/pcmcia/cs.c b/trunk/drivers/pcmcia/cs.c index a30aa74304a2..234cdca6fe13 100644 --- a/trunk/drivers/pcmcia/cs.c +++ b/trunk/drivers/pcmcia/cs.c @@ -513,11 +513,6 @@ static int socket_insert(struct pcmcia_socket *skt) ret = socket_setup(skt, setup_delay); if (ret == CS_SUCCESS) { skt->state |= SOCKET_PRESENT; - - printk(KERN_NOTICE "pccard: %s card inserted into slot %d\n", - (skt->state & SOCKET_CARDBUS) ? "CardBus" : "PCMCIA", - skt->sock); - #ifdef CONFIG_CARDBUS if (skt->state & SOCKET_CARDBUS) { cb_alloc(skt); @@ -603,7 +598,6 @@ static int socket_resume(struct pcmcia_socket *skt) static void socket_remove(struct pcmcia_socket *skt) { - printk(KERN_NOTICE "pccard: card ejected from slot %d\n", skt->sock); socket_shutdown(skt); cs_socket_put(skt); } diff --git a/trunk/drivers/pcmcia/ds.c b/trunk/drivers/pcmcia/ds.c index 7f8219f3fd9e..39d096b52926 100644 --- a/trunk/drivers/pcmcia/ds.c +++ b/trunk/drivers/pcmcia/ds.c @@ -544,9 +544,6 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f list_add_tail(&p_dev->socket_device_list, &s->devices_list); spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); - printk(KERN_NOTICE "pcmcia: registering new device %s\n", - p_dev->devname); - pcmcia_device_query(p_dev); if (device_register(&p_dev->dev)) { diff --git a/trunk/drivers/pcmcia/i82365.c b/trunk/drivers/pcmcia/i82365.c index 4d56bc9926d6..4ddd76239b34 100644 --- a/trunk/drivers/pcmcia/i82365.c +++ b/trunk/drivers/pcmcia/i82365.c @@ -1339,7 +1339,10 @@ static struct device_driver i82365_driver = { .resume = pcmcia_socket_dev_resume, }; -static struct platform_device *i82365_device; +static struct platform_device i82365_device = { + .name = "i82365", + .id = 0, +}; static int __init init_i82365(void) { @@ -1349,14 +1352,7 @@ static int __init init_i82365(void) if (ret) return ret; - i82365_device = platform_device_alloc("i82365", 0); - if (i82365_device) { - ret = platform_device_add(i82365_device); - if (ret) - platform_device_put(i82365_device); - } else - ret = -ENOMEM; - + ret = platform_device_register(&i82365_device); if (ret) { driver_unregister(&i82365_driver); return ret; @@ -1369,7 +1365,7 @@ static int __init init_i82365(void) if (sockets == 0) { printk("not found.\n"); - platform_device_unregister(i82365_device); + platform_device_unregister(&i82365_device); release_region(i365_base, 2); driver_unregister(&i82365_driver); return -ENODEV; @@ -1381,7 +1377,7 @@ static int __init init_i82365(void) /* register sockets with the pcmcia core */ for (i = 0; i < sockets; i++) { - socket[i].socket.dev.dev = &i82365_device->dev; + socket[i].socket.dev.dev = &i82365_device.dev; socket[i].socket.ops = &pcic_operations; socket[i].socket.resource_ops = &pccard_nonstatic_ops; socket[i].socket.owner = THIS_MODULE; @@ -1419,7 +1415,7 @@ static void __exit exit_i82365(void) if (socket[i].flags & IS_REGISTERED) pcmcia_unregister_socket(&socket[i].socket); } - platform_device_unregister(i82365_device); + platform_device_unregister(&i82365_device); if (poll_interval != 0) del_timer_sync(&poll_timer); if (grab_irq != 0) diff --git a/trunk/drivers/pcmcia/m32r_cfc.c b/trunk/drivers/pcmcia/m32r_cfc.c index 078579ae6359..2c22b4b3619d 100644 --- a/trunk/drivers/pcmcia/m32r_cfc.c +++ b/trunk/drivers/pcmcia/m32r_cfc.c @@ -355,10 +355,9 @@ static void add_pcc_socket(ulong base, int irq, ulong mapaddr, kio_addr_t ioaddr #ifndef CONFIG_PLAT_USRV /* insert interrupt */ request_irq(irq, pcc_interrupt, 0, "m32r_cfc", pcc_interrupt); -#ifndef CONFIG_PLAT_MAPPI3 /* eject interrupt */ request_irq(irq+1, pcc_interrupt, 0, "m32r_cfc", pcc_interrupt); -#endif + debug(3, "m32r_cfc: enable CFMSK, RDYSEL\n"); pcc_set(pcc_sockets, (unsigned int)PLD_CFIMASK, 0x01); #endif /* CONFIG_PLAT_USRV */ diff --git a/trunk/drivers/s390/char/raw3270.c b/trunk/drivers/s390/char/raw3270.c index 1026f2bc3185..f5b7d360fc10 100644 --- a/trunk/drivers/s390/char/raw3270.c +++ b/trunk/drivers/s390/char/raw3270.c @@ -1179,12 +1179,12 @@ raw3270_create_attributes(struct raw3270 *rp) //FIXME: check return code sysfs_create_group(&rp->cdev->dev.kobj, &raw3270_attr_group); rp->clttydev = - class_device_create(class3270, NULL, + class_device_create(class3270, MKDEV(IBM_TTY3270_MAJOR, rp->minor), &rp->cdev->dev, "tty%s", rp->cdev->dev.bus_id); rp->cltubdev = - class_device_create(class3270, NULL, + class_device_create(class3270, MKDEV(IBM_FS3270_MAJOR, rp->minor), &rp->cdev->dev, "tub%s", rp->cdev->dev.bus_id); diff --git a/trunk/drivers/s390/net/qeth_eddp.c b/trunk/drivers/s390/net/qeth_eddp.c index f94f1f25eec6..011915d5e243 100644 --- a/trunk/drivers/s390/net/qeth_eddp.c +++ b/trunk/drivers/s390/net/qeth_eddp.c @@ -62,8 +62,7 @@ qeth_eddp_free_context(struct qeth_eddp_context *ctx) for (i = 0; i < ctx->num_pages; ++i) free_page((unsigned long)ctx->pages[i]); kfree(ctx->pages); - if (ctx->elements != NULL) - kfree(ctx->elements); + kfree(ctx->elements); kfree(ctx); } diff --git a/trunk/drivers/s390/net/qeth_main.c b/trunk/drivers/s390/net/qeth_main.c index f8f55cc468ba..99cceb242ec4 100644 --- a/trunk/drivers/s390/net/qeth_main.c +++ b/trunk/drivers/s390/net/qeth_main.c @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_main.c ($Revision: 1.251 $) + * linux/drivers/s390/net/qeth_main.c ($Revision: 1.242 $) * * Linux on zSeries OSA Express and HiperSockets support * @@ -12,7 +12,7 @@ * Frank Pavlic (fpavlic@de.ibm.com) and * Thomas Spatzier * - * $Revision: 1.251 $ $Date: 2005/05/04 20:19:18 $ + * $Revision: 1.242 $ $Date: 2005/05/04 20:19:18 $ * * 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 @@ -72,7 +72,7 @@ #include "qeth_eddp.h" #include "qeth_tso.h" -#define VERSION_QETH_C "$Revision: 1.251 $" +#define VERSION_QETH_C "$Revision: 1.242 $" static const char *version = "qeth S/390 OSA-Express driver"; /** @@ -518,8 +518,7 @@ __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode) QETH_DBF_TEXT(setup, 3, "setoffl"); QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); - - netif_carrier_off(card->dev); + recover_flag = card->state; if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){ PRINT_WARN("Stopping card %s interrupted by user!\n", @@ -1021,6 +1020,7 @@ void qeth_schedule_recovery(struct qeth_card *card) { QETH_DBF_TEXT(trace,2,"startrec"); + if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0) schedule_work(&card->kernel_thread_starter); } @@ -1710,6 +1710,7 @@ qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) "IP address reset.\n", QETH_CARD_IFNAME(card), card->info.chpid); + netif_carrier_on(card->dev); qeth_schedule_recovery(card); return NULL; case IPA_CMD_MODCCID: @@ -1958,7 +1959,7 @@ qeth_osn_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, { u16 s1, s2; - QETH_DBF_TEXT(trace,4,"osndipa"); +QETH_DBF_TEXT(trace,4,"osndipa"); qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2); s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len); @@ -2202,21 +2203,24 @@ qeth_ulp_setup(struct qeth_card *card) } static inline int -qeth_check_qdio_errors(struct qdio_buffer *buf, unsigned int qdio_error, - unsigned int siga_error, const char *dbftext) +qeth_check_for_inbound_error(struct qeth_qdio_buffer *buf, + unsigned int qdio_error, + unsigned int siga_error) { + int rc = 0; + if (qdio_error || siga_error) { - QETH_DBF_TEXT(trace, 2, dbftext); - QETH_DBF_TEXT(qerr, 2, dbftext); + QETH_DBF_TEXT(trace, 2, "qdinerr"); + QETH_DBF_TEXT(qerr, 2, "qdinerr"); QETH_DBF_TEXT_(qerr, 2, " F15=%02X", - buf->element[15].flags & 0xff); + buf->buffer->element[15].flags & 0xff); QETH_DBF_TEXT_(qerr, 2, " F14=%02X", - buf->element[14].flags & 0xff); + buf->buffer->element[14].flags & 0xff); QETH_DBF_TEXT_(qerr, 2, " qerr=%X", qdio_error); QETH_DBF_TEXT_(qerr, 2, " serr=%X", siga_error); - return 1; + rc = 1; } - return 0; + return rc; } static inline struct sk_buff * @@ -2765,9 +2769,8 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, for (i = first_element; i < (first_element + count); ++i) { index = i % QDIO_MAX_BUFFERS_PER_Q; buffer = &card->qdio.in_q->bufs[index]; - if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && - qeth_check_qdio_errors(buffer->buffer, - qdio_err, siga_err,"qinerr"))) + if (!((status == QDIO_STATUS_LOOK_FOR_ERROR) && + qeth_check_for_inbound_error(buffer, qdio_err, siga_err))) qeth_process_inbound_buffer(card, buffer, index); /* clear buffer and give back to hardware */ qeth_put_buffer_pool_entry(card, buffer->pool_entry); @@ -2782,13 +2785,12 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, static inline int qeth_handle_send_error(struct qeth_card *card, struct qeth_qdio_out_buffer *buffer, - unsigned int qdio_err, unsigned int siga_err) + int qdio_err, int siga_err) { int sbalf15 = buffer->buffer->element[15].flags & 0xff; int cc = siga_err & 3; QETH_DBF_TEXT(trace, 6, "hdsnderr"); - qeth_check_qdio_errors(buffer->buffer, qdio_err, siga_err, "qouterr"); switch (cc) { case 0: if (qdio_err){ @@ -3045,8 +3047,7 @@ qeth_qdio_output_handler(struct ccw_device * ccwdev, unsigned int status, for(i = first_element; i < (first_element + count); ++i){ buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q]; /*we only handle the KICK_IT error by doing a recovery */ - if (qeth_handle_send_error(card, buffer, - qdio_error, siga_error) + if (qeth_handle_send_error(card, buffer, qdio_error, siga_error) == QETH_SEND_ERROR_KICK_IT){ netif_stop_queue(card->dev); qeth_schedule_recovery(card); @@ -3288,6 +3289,7 @@ qeth_init_qdio_info(struct qeth_card *card) card->qdio.in_buf_pool.buf_count = card->qdio.init_pool.buf_count; INIT_LIST_HEAD(&card->qdio.in_buf_pool.entry_list); INIT_LIST_HEAD(&card->qdio.init_pool.entry_list); + /* outbound */ } static int @@ -3729,9 +3731,6 @@ qeth_verify_vlan_dev(struct net_device *dev, struct qeth_card *card) break; } } - if (rc && !(VLAN_DEV_INFO(dev)->real_dev->priv == (void *)card)) - return 0; - #endif return rc; } @@ -3808,8 +3807,10 @@ qeth_open(struct net_device *dev) card->data.state = CH_STATE_UP; card->state = CARD_STATE_UP; - if (!card->lan_online && netif_carrier_ok(dev)) - netif_carrier_off(dev); + if (!card->lan_online){ + if (netif_carrier_ok(dev)) + netif_carrier_off(dev); + } return 0; } @@ -5869,8 +5870,10 @@ qeth_add_multicast_ipv6(struct qeth_card *card) struct inet6_dev *in6_dev; QETH_DBF_TEXT(trace,4,"chkmcv6"); - if (!qeth_is_supported(card, IPA_IPV6)) + if ((card->options.layer2 == 0) && + (!qeth_is_supported(card, IPA_IPV6)) ) return ; + in6_dev = in6_dev_get(card->dev); if (in6_dev == NULL) return; @@ -7933,8 +7936,8 @@ __qeth_set_online(struct ccwgroup_device *gdev, int recovery_mode) QETH_DBF_TEXT_(setup, 2, "6err%d", rc); goto out_remove; } - netif_carrier_on(card->dev); - +/*maybe it was set offline without ifconfig down + * we can also use this state for recovery purposes*/ qeth_set_allowed_threads(card, 0xffffffff, 0); if (recover_flag == CARD_STATE_RECOVER) qeth_start_again(card, recovery_mode); diff --git a/trunk/drivers/s390/net/qeth_mpc.c b/trunk/drivers/s390/net/qeth_mpc.c index 5f8754addc14..f0a080a9e515 100644 --- a/trunk/drivers/s390/net/qeth_mpc.c +++ b/trunk/drivers/s390/net/qeth_mpc.c @@ -11,7 +11,7 @@ #include #include "qeth_mpc.h" -const char *VERSION_QETH_MPC_C = "$Revision: 1.13 $"; +const char *VERSION_QETH_MPC_C = "$Revision: 1.12 $"; unsigned char IDX_ACTIVATE_READ[]={ 0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00, diff --git a/trunk/drivers/s390/net/qeth_mpc.h b/trunk/drivers/s390/net/qeth_mpc.h index 864cec5f6c62..5f71486e708c 100644 --- a/trunk/drivers/s390/net/qeth_mpc.h +++ b/trunk/drivers/s390/net/qeth_mpc.h @@ -14,14 +14,14 @@ #include -#define VERSION_QETH_MPC_H "$Revision: 1.46 $" +#define VERSION_QETH_MPC_H "$Revision: 1.44 $" extern const char *VERSION_QETH_MPC_C; #define IPA_PDU_HEADER_SIZE 0x40 #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer+0x0e) #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer+0x26) -#define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x29) +#define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x2a) #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer+0x3a) extern unsigned char IPA_PDU_HEADER[]; diff --git a/trunk/drivers/s390/net/qeth_proc.c b/trunk/drivers/s390/net/qeth_proc.c index 7bf35098831e..f2ccfea8fdb8 100644 --- a/trunk/drivers/s390/net/qeth_proc.c +++ b/trunk/drivers/s390/net/qeth_proc.c @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.16 $) + * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.13 $) * * Linux on zSeries OSA Express and HiperSockets support * This file contains code related to procfs. @@ -21,7 +21,7 @@ #include "qeth_mpc.h" #include "qeth_fs.h" -const char *VERSION_QETH_PROC_C = "$Revision: 1.16 $"; +const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $"; /***** /proc/qeth *****/ #define QETH_PROCFILE_NAME "qeth" @@ -30,26 +30,30 @@ static struct proc_dir_entry *qeth_procfile; static int qeth_procfile_seq_match(struct device *dev, void *data) { - return(dev ? 1 : 0); + return 1; } static void * qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) { - struct device *dev = NULL; - loff_t nr = 0; - + struct device *dev; + loff_t nr; + down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); - if (*offset == 0) + + nr = *offset; + if (nr == 0) return SEQ_START_TOKEN; - while (1) { + + dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, + NULL, qeth_procfile_seq_match); + + /* get card at pos *offset */ + nr = *offset; + while (nr-- > 1 && dev) dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, NULL, qeth_procfile_seq_match); - if (++nr == *offset) - break; - put_device(dev); - } - return dev; + return (void *) dev; } static void @@ -62,14 +66,19 @@ static void * qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) { struct device *prev, *next; - - if (it == SEQ_START_TOKEN) - prev = NULL; - else - prev = (struct device *) it; + + if (it == SEQ_START_TOKEN) { + next = driver_find_device(&qeth_ccwgroup_driver.driver, + NULL, NULL, qeth_procfile_seq_match); + if (next) + (*offset)++; + return (void *) next; + } + prev = (struct device *) it; next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, NULL, qeth_procfile_seq_match); - (*offset)++; + if (next) + (*offset)++; return (void *) next; } @@ -78,7 +87,7 @@ qeth_get_router_str(struct qeth_card *card, int ipv) { int routing_type = 0; - if (ipv == 4) { + if (ipv == 4){ routing_type = card->options.route4.type; } else { #ifdef CONFIG_QETH_IPV6 @@ -145,7 +154,6 @@ qeth_procfile_seq_show(struct seq_file *s, void *it) card->qdio.in_buf_pool.buf_count); else seq_printf(s, " +++ LAN OFFLINE +++\n"); - put_device(device); } return 0; } @@ -176,16 +184,51 @@ static struct file_operations qeth_procfile_fops = { static struct proc_dir_entry *qeth_perf_procfile; #ifdef CONFIG_QETH_PERF_STATS + +static void * +qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) +{ + struct device *dev = NULL; + int nr; + + down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); + /* get card at pos *offset */ + dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, + qeth_procfile_seq_match); + + /* get card at pos *offset */ + nr = *offset; + while (nr-- > 1 && dev) + dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, + NULL, qeth_procfile_seq_match); + return (void *) dev; +} + +static void +qeth_perf_procfile_seq_stop(struct seq_file *s, void* it) +{ + up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); +} + +static void * +qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) +{ + struct device *prev, *next; + + prev = (struct device *) it; + next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, + NULL, qeth_procfile_seq_match); + if (next) + (*offset)++; + return (void *) next; +} + static int qeth_perf_procfile_seq_show(struct seq_file *s, void *it) { struct device *device; struct qeth_card *card; - - if (it == SEQ_START_TOKEN) - return 0; - device = (struct device *) it; card = device->driver_data; seq_printf(s, "For card with devnos %s/%s/%s (%s):\n", @@ -252,14 +295,13 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) card->perf_stats.outbound_do_qdio_time, card->perf_stats.outbound_do_qdio_cnt ); - put_device(device); return 0; } static struct seq_operations qeth_perf_procfile_seq_ops = { - .start = qeth_procfile_seq_start, - .stop = qeth_procfile_seq_stop, - .next = qeth_procfile_seq_next, + .start = qeth_perf_procfile_seq_start, + .stop = qeth_perf_procfile_seq_stop, + .next = qeth_perf_procfile_seq_next, .show = qeth_perf_procfile_seq_show, }; @@ -282,6 +324,93 @@ static struct file_operations qeth_perf_procfile_fops = { #define qeth_perf_procfile_created 1 #endif /* CONFIG_QETH_PERF_STATS */ +/***** /proc/qeth_ipa_takeover *****/ +#define QETH_IPATO_PROCFILE_NAME "qeth_ipa_takeover" +static struct proc_dir_entry *qeth_ipato_procfile; + +static void * +qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) +{ + struct device *dev; + loff_t nr; + + down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); + /* TODO: finish this */ + /* + * maybe SEQ_SATRT_TOKEN can be returned for offset 0 + * output driver settings then; + * else output setting for respective card + */ + + dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, + qeth_procfile_seq_match); + + /* get card at pos *offset */ + nr = *offset; + while (nr-- > 1 && dev) + dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, + NULL, qeth_procfile_seq_match); + return (void *) dev; +} + +static void +qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it) +{ + up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); +} + +static void * +qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) +{ + struct device *prev, *next; + + prev = (struct device *) it; + next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, + NULL, qeth_procfile_seq_match); + if (next) + (*offset)++; + return (void *) next; +} + +static int +qeth_ipato_procfile_seq_show(struct seq_file *s, void *it) +{ + struct device *device; + struct qeth_card *card; + + /* TODO: finish this */ + /* + * maybe SEQ_SATRT_TOKEN can be returned for offset 0 + * output driver settings then; + * else output setting for respective card + */ + device = (struct device *) it; + card = device->driver_data; + + return 0; +} + +static struct seq_operations qeth_ipato_procfile_seq_ops = { + .start = qeth_ipato_procfile_seq_start, + .stop = qeth_ipato_procfile_seq_stop, + .next = qeth_ipato_procfile_seq_next, + .show = qeth_ipato_procfile_seq_show, +}; + +static int +qeth_ipato_procfile_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &qeth_ipato_procfile_seq_ops); +} + +static struct file_operations qeth_ipato_procfile_fops = { + .owner = THIS_MODULE, + .open = qeth_ipato_procfile_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + int __init qeth_create_procfs_entries(void) { @@ -297,7 +426,13 @@ qeth_create_procfs_entries(void) qeth_perf_procfile->proc_fops = &qeth_perf_procfile_fops; #endif /* CONFIG_QETH_PERF_STATS */ + qeth_ipato_procfile = create_proc_entry(QETH_IPATO_PROCFILE_NAME, + S_IFREG | 0444, NULL); + if (qeth_ipato_procfile) + qeth_ipato_procfile->proc_fops = &qeth_ipato_procfile_fops; + if (qeth_procfile && + qeth_ipato_procfile && qeth_perf_procfile_created) return 0; else @@ -311,5 +446,62 @@ qeth_remove_procfs_entries(void) remove_proc_entry(QETH_PROCFILE_NAME, NULL); if (qeth_perf_procfile) remove_proc_entry(QETH_PERF_PROCFILE_NAME, NULL); + if (qeth_ipato_procfile) + remove_proc_entry(QETH_IPATO_PROCFILE_NAME, NULL); } + +/* ONLY FOR DEVELOPMENT! -> make it as module */ +/* +static void +qeth_create_sysfs_entries(void) +{ + struct device *dev; + + down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); + + list_for_each_entry(dev, &qeth_ccwgroup_driver.driver.devices, + driver_list) + qeth_create_device_attributes(dev); + + up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); +} + +static void +qeth_remove_sysfs_entries(void) +{ + struct device *dev; + + down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); + + list_for_each_entry(dev, &qeth_ccwgroup_driver.driver.devices, + driver_list) + qeth_remove_device_attributes(dev); + + up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); +} + +static int __init +qeth_fs_init(void) +{ + printk(KERN_INFO "qeth_fs_init\n"); + qeth_create_procfs_entries(); + qeth_create_sysfs_entries(); + + return 0; +} + +static void __exit +qeth_fs_exit(void) +{ + printk(KERN_INFO "qeth_fs_exit\n"); + qeth_remove_procfs_entries(); + qeth_remove_sysfs_entries(); +} + + +module_init(qeth_fs_init); +module_exit(qeth_fs_exit); + +MODULE_LICENSE("GPL"); +*/ diff --git a/trunk/drivers/s390/net/qeth_sys.c b/trunk/drivers/s390/net/qeth_sys.c index 0ea185f70f75..ddd6019ba092 100644 --- a/trunk/drivers/s390/net/qeth_sys.c +++ b/trunk/drivers/s390/net/qeth_sys.c @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.60 $) + * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.58 $) * * Linux on zSeries OSA Express and HiperSockets support * This file contains code related to sysfs. @@ -20,7 +20,7 @@ #include "qeth_mpc.h" #include "qeth_fs.h" -const char *VERSION_QETH_SYS_C = "$Revision: 1.60 $"; +const char *VERSION_QETH_SYS_C = "$Revision: 1.58 $"; /*****************************************************************************/ /* */ @@ -160,7 +160,7 @@ qeth_dev_portname_store(struct device *dev, struct device_attribute *attr, const return -EPERM; tmp = strsep((char **) &buf, "\n"); - if ((strlen(tmp) > 8) || (strlen(tmp) == 0)) + if ((strlen(tmp) > 8) || (strlen(tmp) < 2)) return -EINVAL; card->info.portname[0] = strlen(tmp); diff --git a/trunk/drivers/s390/net/qeth_tso.h b/trunk/drivers/s390/net/qeth_tso.h index 3c50b6f24f51..e245af3c4cbd 100644 --- a/trunk/drivers/s390/net/qeth_tso.h +++ b/trunk/drivers/s390/net/qeth_tso.h @@ -1,5 +1,5 @@ /* - * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.8 $) + * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.7 $) * * Header file for qeth TCP Segmentation Offload support. * @@ -7,7 +7,7 @@ * * Author(s): Frank Pavlic * - * $Revision: 1.8 $ $Date: 2005/05/04 20:19:18 $ + * $Revision: 1.7 $ $Date: 2005/05/04 20:19:18 $ * */ #ifndef __QETH_TSO_H__ diff --git a/trunk/drivers/s390/scsi/zfcp_aux.c b/trunk/drivers/s390/scsi/zfcp_aux.c index 5e84c5aa7779..c218b5c944a6 100644 --- a/trunk/drivers/s390/scsi/zfcp_aux.c +++ b/trunk/drivers/s390/scsi/zfcp_aux.c @@ -996,20 +996,6 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) spin_lock_init(&adapter->fsf_req_list_lock); INIT_LIST_HEAD(&adapter->fsf_req_list_head); - /* initialize debug locks */ - - spin_lock_init(&adapter->erp_dbf_lock); - spin_lock_init(&adapter->hba_dbf_lock); - spin_lock_init(&adapter->san_dbf_lock); - spin_lock_init(&adapter->scsi_dbf_lock); - - /* initialize error recovery stuff */ - - rwlock_init(&adapter->erp_lock); - sema_init(&adapter->erp_ready_sem, 0); - INIT_LIST_HEAD(&adapter->erp_ready_head); - INIT_LIST_HEAD(&adapter->erp_running_head); - /* initialize abort lock */ rwlock_init(&adapter->abort_lock); diff --git a/trunk/drivers/s390/scsi/zfcp_dbf.c b/trunk/drivers/s390/scsi/zfcp_dbf.c index 95599719f8ab..826fb3b00605 100644 --- a/trunk/drivers/s390/scsi/zfcp_dbf.c +++ b/trunk/drivers/s390/scsi/zfcp_dbf.c @@ -926,6 +926,7 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter) char dbf_name[DEBUG_MAX_NAME_LEN]; /* debug feature area which records recovery activity */ + spin_lock_init(&adapter->erp_dbf_lock); sprintf(dbf_name, "zfcp_%s_erp", zfcp_get_busid_by_adapter(adapter)); adapter->erp_dbf = debug_register(dbf_name, dbfsize, 2, sizeof(struct zfcp_erp_dbf_record)); @@ -935,6 +936,7 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter) debug_set_level(adapter->erp_dbf, 3); /* debug feature area which records HBA (FSF and QDIO) conditions */ + spin_lock_init(&adapter->hba_dbf_lock); sprintf(dbf_name, "zfcp_%s_hba", zfcp_get_busid_by_adapter(adapter)); adapter->hba_dbf = debug_register(dbf_name, dbfsize, 1, sizeof(struct zfcp_hba_dbf_record)); @@ -945,6 +947,7 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter) debug_set_level(adapter->hba_dbf, 3); /* debug feature area which records SAN command failures and recovery */ + spin_lock_init(&adapter->san_dbf_lock); sprintf(dbf_name, "zfcp_%s_san", zfcp_get_busid_by_adapter(adapter)); adapter->san_dbf = debug_register(dbf_name, dbfsize, 1, sizeof(struct zfcp_san_dbf_record)); @@ -955,6 +958,7 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter) debug_set_level(adapter->san_dbf, 6); /* debug feature area which records SCSI command failures and recovery */ + spin_lock_init(&adapter->scsi_dbf_lock); sprintf(dbf_name, "zfcp_%s_scsi", zfcp_get_busid_by_adapter(adapter)); adapter->scsi_dbf = debug_register(dbf_name, dbfsize, 1, sizeof(struct zfcp_scsi_dbf_record)); diff --git a/trunk/drivers/s390/scsi/zfcp_erp.c b/trunk/drivers/s390/scsi/zfcp_erp.c index ee7314d8c2da..023f4e558ae4 100644 --- a/trunk/drivers/s390/scsi/zfcp_erp.c +++ b/trunk/drivers/s390/scsi/zfcp_erp.c @@ -1071,6 +1071,11 @@ zfcp_erp_thread_setup(struct zfcp_adapter *adapter) atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); + rwlock_init(&adapter->erp_lock); + INIT_LIST_HEAD(&adapter->erp_ready_head); + INIT_LIST_HEAD(&adapter->erp_running_head); + sema_init(&adapter->erp_ready_sem, 0); + retval = kernel_thread(zfcp_erp_thread, adapter, SIGCHLD); if (retval < 0) { ZFCP_LOG_NORMAL("error: creation of erp thread failed for " @@ -2243,26 +2248,29 @@ zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *erp_action) return retval; } +/* + * function: zfcp_fsf_init + * + * purpose: initializes FSF operation for the specified adapter + * + * returns: 0 - succesful initialization of FSF operation + * !0 - failed to initialize FSF operation + */ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action) { - int retval; + int xconfig, xport; - if ((atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, - &erp_action->adapter->status)) && - (erp_action->adapter->adapter_features & - FSF_FEATURE_HBAAPI_MANAGEMENT)) { + if (atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, + &erp_action->adapter->status)) { zfcp_erp_adapter_strategy_open_fsf_xport(erp_action); atomic_set(&erp_action->adapter->erp_counter, 0); return ZFCP_ERP_FAILED; } - retval = zfcp_erp_adapter_strategy_open_fsf_xconfig(erp_action); - if (retval == ZFCP_ERP_FAILED) - return ZFCP_ERP_FAILED; - - retval = zfcp_erp_adapter_strategy_open_fsf_xport(erp_action); - if (retval == ZFCP_ERP_FAILED) + xconfig = zfcp_erp_adapter_strategy_open_fsf_xconfig(erp_action); + xport = zfcp_erp_adapter_strategy_open_fsf_xport(erp_action); + if ((xconfig == ZFCP_ERP_FAILED) || (xport == ZFCP_ERP_FAILED)) return ZFCP_ERP_FAILED; return zfcp_erp_adapter_strategy_open_fsf_statusread(erp_action); @@ -2351,29 +2359,41 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) static int zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action) { - int ret; + int retval = ZFCP_ERP_SUCCEEDED; int retries; int sleep; struct zfcp_adapter *adapter = erp_action->adapter; atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); - retries = 0; - do { - write_lock(&adapter->erp_lock); + for (retries = 0; ; retries++) { + ZFCP_LOG_DEBUG("Doing exchange port data\n"); zfcp_erp_action_to_running(erp_action); - write_unlock(&adapter->erp_lock); zfcp_erp_timeout_init(erp_action); - ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL); - if (ret == -EOPNOTSUPP) { - debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp"); - return ZFCP_ERP_SUCCEEDED; - } else if (ret) { - debug_text_event(adapter->erp_dbf, 3, "a_xport_failed"); - return ZFCP_ERP_FAILED; + if (zfcp_fsf_exchange_port_data(erp_action, adapter, NULL)) { + retval = ZFCP_ERP_FAILED; + debug_text_event(adapter->erp_dbf, 5, "a_fstx_xf"); + ZFCP_LOG_INFO("error: initiation of exchange of " + "port data failed for adapter %s\n", + zfcp_get_busid_by_adapter(adapter)); + break; } - debug_text_event(adapter->erp_dbf, 6, "a_xport_ok"); + debug_text_event(adapter->erp_dbf, 6, "a_fstx_xok"); + ZFCP_LOG_DEBUG("Xchange underway\n"); + /* + * Why this works: + * Both the normal completion handler as well as the timeout + * handler will do an 'up' when the 'exchange port data' + * request completes or times out. Thus, the signal to go on + * won't be lost utilizing this semaphore. + * Furthermore, this 'adapter_reopen' action is + * guaranteed to be the only action being there (highest action + * which prevents other actions from being created). + * Resulting from that, the wake signal recognized here + * _must_ be the one belonging to the 'exchange port + * data' request. + */ down(&adapter->erp_ready_sem); if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { ZFCP_LOG_INFO("error: exchange of port data " @@ -2381,19 +2401,29 @@ zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action) zfcp_get_busid_by_adapter(adapter)); break; } + if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status)) break; - if (retries < ZFCP_EXCHANGE_PORT_DATA_SHORT_RETRIES) { - sleep = ZFCP_EXCHANGE_PORT_DATA_SHORT_SLEEP; - retries++; - } else - sleep = ZFCP_EXCHANGE_PORT_DATA_LONG_SLEEP; - schedule_timeout(sleep); - } while (1); + ZFCP_LOG_DEBUG("host connection still initialising... " + "waiting and retrying...\n"); + /* sleep a little bit before retry */ + sleep = retries < ZFCP_EXCHANGE_PORT_DATA_SHORT_RETRIES ? + ZFCP_EXCHANGE_PORT_DATA_SHORT_SLEEP : + ZFCP_EXCHANGE_PORT_DATA_LONG_SLEEP; + msleep(jiffies_to_msecs(sleep)); + } + + if (atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, + &adapter->status)) { + ZFCP_LOG_INFO("error: exchange of port data for " + "adapter %s failed\n", + zfcp_get_busid_by_adapter(adapter)); + retval = ZFCP_ERP_FAILED; + } - return ZFCP_ERP_SUCCEEDED; + return retval; } /* diff --git a/trunk/drivers/s390/scsi/zfcp_fsf.c b/trunk/drivers/s390/scsi/zfcp_fsf.c index 59587951c847..3b0fc1163f5f 100644 --- a/trunk/drivers/s390/scsi/zfcp_fsf.c +++ b/trunk/drivers/s390/scsi/zfcp_fsf.c @@ -554,17 +554,6 @@ static void zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter, struct fsf_link_down_info *link_down) { - if (atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, - &adapter->status)) - return; - - atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status); - - if (link_down == NULL) { - zfcp_erp_adapter_reopen(adapter, 0); - return; - } - switch (link_down->error_code) { case FSF_PSQ_LINK_NO_LIGHT: ZFCP_LOG_NORMAL("The local link to adapter %s is down " @@ -645,15 +634,20 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter, link_down->explanation_code, link_down->vendor_specific_code); - switch (link_down->error_code) { - case FSF_PSQ_LINK_NO_LIGHT: - case FSF_PSQ_LINK_WRAP_PLUG: - case FSF_PSQ_LINK_NO_FCP: - case FSF_PSQ_LINK_FIRMWARE_UPDATE: - zfcp_erp_adapter_reopen(adapter, 0); - break; - default: - zfcp_erp_adapter_failed(adapter); + if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, + &adapter->status)) { + atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, + &adapter->status); + switch (link_down->error_code) { + case FSF_PSQ_LINK_NO_LIGHT: + case FSF_PSQ_LINK_WRAP_PLUG: + case FSF_PSQ_LINK_NO_FCP: + case FSF_PSQ_LINK_FIRMWARE_UPDATE: + zfcp_erp_adapter_reopen(adapter, 0); + break; + default: + zfcp_erp_adapter_failed(adapter); + } } } @@ -925,36 +919,30 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK: ZFCP_LOG_INFO("Physical link to adapter %s is down\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_fsf_link_down_info_eval(adapter, - (struct fsf_link_down_info *) - &status_buffer->payload); break; case FSF_STATUS_READ_SUB_FDISC_FAILED: ZFCP_LOG_INFO("Local link to adapter %s is down " "due to failed FDISC login\n", - zfcp_get_busid_by_adapter(adapter)); - zfcp_fsf_link_down_info_eval(adapter, - (struct fsf_link_down_info *) - &status_buffer->payload); + zfcp_get_busid_by_adapter(adapter)); break; case FSF_STATUS_READ_SUB_FIRMWARE_UPDATE: ZFCP_LOG_INFO("Local link to adapter %s is down " "due to firmware update on adapter\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_fsf_link_down_info_eval(adapter, NULL); break; default: ZFCP_LOG_INFO("Local link to adapter %s is down " "due to unknown reason\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_fsf_link_down_info_eval(adapter, NULL); }; + zfcp_fsf_link_down_info_eval(adapter, + (struct fsf_link_down_info *) &status_buffer->payload); break; case FSF_STATUS_READ_LINK_UP: ZFCP_LOG_NORMAL("Local link to adapter %s was replugged. " - "Restarting operations on this adapter\n", - zfcp_get_busid_by_adapter(adapter)); + "Restarting operations on this adapter\n", + zfcp_get_busid_by_adapter(adapter)); /* All ports should be marked as ready to run again */ zfcp_erp_modify_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING, @@ -2203,10 +2191,13 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action, return -EOPNOTSUPP; } + timer = kmalloc(sizeof(struct timer_list), GFP_KERNEL); + if (!timer) + return -ENOMEM; + /* setup new FSF request */ retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, - erp_action ? ZFCP_REQ_AUTO_CLEANUP : 0, - 0, &lock_flags, &fsf_req); + 0, 0, &lock_flags, &fsf_req); if (retval < 0) { ZFCP_LOG_INFO("error: Out of resources. Could not create an " "exchange port data request for" @@ -2214,33 +2205,25 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action, zfcp_get_busid_by_adapter(adapter)); write_unlock_irqrestore(&adapter->request_queue.queue_lock, lock_flags); - return retval; + goto out; + } + + if (erp_action) { + erp_action->fsf_req = fsf_req; + fsf_req->erp_action = erp_action; } if (data) - fsf_req->data = (unsigned long) data; + fsf_req->data = (unsigned long) data; sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; - if (erp_action) { - erp_action->fsf_req = fsf_req; - fsf_req->erp_action = erp_action; - timer = &erp_action->timer; - } else { - timer = kmalloc(sizeof(struct timer_list), GFP_ATOMIC); - if (!timer) { - write_unlock_irqrestore(&adapter->request_queue.queue_lock, - lock_flags); - zfcp_fsf_req_free(fsf_req); - return -ENOMEM; - } - init_timer(timer); - timer->function = zfcp_fsf_request_timeout_handler; - timer->data = (unsigned long) adapter; - timer->expires = ZFCP_FSF_REQUEST_TIMEOUT; - } + init_timer(timer); + timer->function = zfcp_fsf_request_timeout_handler; + timer->data = (unsigned long) adapter; + timer->expires = ZFCP_FSF_REQUEST_TIMEOUT; retval = zfcp_fsf_req_send(fsf_req, timer); if (retval) { @@ -2250,22 +2233,23 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action, zfcp_fsf_req_free(fsf_req); if (erp_action) erp_action->fsf_req = NULL; - else - kfree(timer); write_unlock_irqrestore(&adapter->request_queue.queue_lock, lock_flags); - return retval; + goto out; } - write_unlock_irqrestore(&adapter->request_queue.queue_lock, lock_flags); + ZFCP_LOG_DEBUG("Exchange Port Data request initiated (adapter %s)\n", + zfcp_get_busid_by_adapter(adapter)); - if (!erp_action) { - wait_event(fsf_req->completion_wq, - fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); - del_timer_sync(timer); - zfcp_fsf_req_free(fsf_req); - kfree(timer); - } + write_unlock_irqrestore(&adapter->request_queue.queue_lock, + lock_flags); + + wait_event(fsf_req->completion_wq, + fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); + del_timer_sync(timer); + zfcp_fsf_req_free(fsf_req); + out: + kfree(timer); return retval; } diff --git a/trunk/drivers/s390/scsi/zfcp_scsi.c b/trunk/drivers/s390/scsi/zfcp_scsi.c index 66608d13a634..3dcd1bfba3b4 100644 --- a/trunk/drivers/s390/scsi/zfcp_scsi.c +++ b/trunk/drivers/s390/scsi/zfcp_scsi.c @@ -179,7 +179,7 @@ zfcp_scsi_slave_alloc(struct scsi_device *sdp) struct zfcp_adapter *adapter; struct zfcp_unit *unit; unsigned long flags; - int retval = -ENXIO; + int retval = -ENODEV; adapter = (struct zfcp_adapter *) sdp->host->hostdata[0]; if (!adapter) diff --git a/trunk/drivers/sbus/char/aurora.c b/trunk/drivers/sbus/char/aurora.c index 92e6c5639dd3..672f9f2b2163 100644 --- a/trunk/drivers/sbus/char/aurora.c +++ b/trunk/drivers/sbus/char/aurora.c @@ -124,25 +124,25 @@ static inline int aurora_paranoia_check(struct Aurora_port const * port, */ /* Get board number from pointer */ -static inline int board_No (struct Aurora_board const * bp) +extern inline int board_No (struct Aurora_board const * bp) { return bp - aurora_board; } /* Get port number from pointer */ -static inline int port_No (struct Aurora_port const * port) +extern inline int port_No (struct Aurora_port const * port) { return AURORA_PORT(port - aurora_port); } /* Get pointer to board from pointer to port */ -static inline struct Aurora_board * port_Board(struct Aurora_port const * port) +extern inline struct Aurora_board * port_Board(struct Aurora_port const * port) { return &aurora_board[AURORA_BOARD(port - aurora_port)]; } /* Wait for Channel Command Register ready */ -static inline void aurora_wait_CCR(struct aurora_reg128 * r) +extern inline void aurora_wait_CCR(struct aurora_reg128 * r) { unsigned long delay; @@ -161,7 +161,7 @@ printk("aurora_wait_CCR\n"); */ /* Must be called with enabled interrupts */ -static inline void aurora_long_delay(unsigned long delay) +extern inline void aurora_long_delay(unsigned long delay) { unsigned long i; @@ -420,7 +420,7 @@ static void aurora_release_io_range(struct Aurora_board *bp) sbus_iounmap((unsigned long)bp->r3, 4); } -static inline void aurora_mark_event(struct Aurora_port * port, int event) +extern inline void aurora_mark_event(struct Aurora_port * port, int event) { #ifdef AURORA_DEBUG printk("aurora_mark_event: start\n"); diff --git a/trunk/drivers/sbus/char/jsflash.c b/trunk/drivers/sbus/char/jsflash.c index 14631ac11bc7..c12c5046e2fa 100644 --- a/trunk/drivers/sbus/char/jsflash.c +++ b/trunk/drivers/sbus/char/jsflash.c @@ -249,11 +249,11 @@ static loff_t jsf_lseek(struct file * file, loff_t offset, int orig) /* * OS SIMM Cannot be read in other size but a 32bits word. */ -static ssize_t jsf_read(struct file * file, char __user * buf, +static ssize_t jsf_read(struct file * file, char * buf, size_t togo, loff_t *ppos) { unsigned long p = *ppos; - char __user *tmp = buf; + char *tmp = buf; union byte4 { char s[4]; @@ -305,7 +305,7 @@ static ssize_t jsf_read(struct file * file, char __user * buf, return tmp-buf; } -static ssize_t jsf_write(struct file * file, const char __user * buf, +static ssize_t jsf_write(struct file * file, const char * buf, size_t count, loff_t *ppos) { return -ENOSPC; @@ -356,10 +356,10 @@ static int jsf_ioctl_erase(unsigned long arg) * Program a block of flash. * Very simple because we can do it byte by byte anyway. */ -static int jsf_ioctl_program(void __user *arg) +static int jsf_ioctl_program(unsigned long arg) { struct jsflash_program_arg abuf; - char __user *uptr; + char *uptr; unsigned long p; unsigned int togo; union { @@ -367,13 +367,13 @@ static int jsf_ioctl_program(void __user *arg) char s[4]; } b; - if (copy_from_user(&abuf, arg, JSFPRGSZ)) + if (copy_from_user(&abuf, (char *)arg, JSFPRGSZ)) return -EFAULT; p = abuf.off; togo = abuf.size; if ((togo & 3) || (p & 3)) return -EINVAL; - uptr = (char __user *) (unsigned long) abuf.data; + uptr = (char *) (unsigned long) abuf.data; while (togo != 0) { togo -= 4; if (copy_from_user(&b.s[0], uptr, 4)) @@ -390,20 +390,19 @@ static int jsf_ioctl(struct inode *inode, struct file *f, unsigned int cmd, unsigned long arg) { int error = -ENOTTY; - void __user *argp = (void __user *)arg; if (!capable(CAP_SYS_ADMIN)) return -EPERM; switch (cmd) { case JSFLASH_IDENT: - if (copy_to_user(argp, &jsf0.id, JSFIDSZ)) + if (copy_to_user((void *)arg, &jsf0.id, JSFIDSZ)) return -EFAULT; break; case JSFLASH_ERASE: error = jsf_ioctl_erase(arg); break; case JSFLASH_PROGRAM: - error = jsf_ioctl_program(argp); + error = jsf_ioctl_program(arg); break; } diff --git a/trunk/drivers/sbus/char/uctrl.c b/trunk/drivers/sbus/char/uctrl.c index e2d9a7c85427..858cc683f85c 100644 --- a/trunk/drivers/sbus/char/uctrl.c +++ b/trunk/drivers/sbus/char/uctrl.c @@ -309,7 +309,7 @@ static void uctrl_do_txn(struct uctrl_txn *txn) } } -void uctrl_get_event_status(void) +void uctrl_get_event_status() { struct uctrl_driver *driver = &drv; struct uctrl_txn txn; @@ -318,7 +318,7 @@ void uctrl_get_event_status(void) txn.opcode = READ_EVENT_STATUS; txn.inbits = 0; txn.outbits = 2; - txn.inbuf = NULL; + txn.inbuf = 0; txn.outbuf = outbits; uctrl_do_txn(&txn); @@ -329,7 +329,7 @@ void uctrl_get_event_status(void) dprintk(("ev is %x\n", driver->status.event_status)); } -void uctrl_get_external_status(void) +void uctrl_get_external_status() { struct uctrl_driver *driver = &drv; struct uctrl_txn txn; @@ -339,7 +339,7 @@ void uctrl_get_external_status(void) txn.opcode = READ_EXTERNAL_STATUS; txn.inbits = 0; txn.outbits = 2; - txn.inbuf = NULL; + txn.inbuf = 0; txn.outbuf = outbits; uctrl_do_txn(&txn); @@ -414,7 +414,7 @@ static void __exit ts102_uctrl_cleanup(void) if (driver->irq) free_irq(driver->irq, driver); if (driver->regs) - driver->regs = NULL; + driver->regs = 0; } module_init(ts102_uctrl_init); diff --git a/trunk/drivers/sbus/char/vfc.h b/trunk/drivers/sbus/char/vfc.h index 8045cd5e7cb3..a7782e7da42e 100644 --- a/trunk/drivers/sbus/char/vfc.h +++ b/trunk/drivers/sbus/char/vfc.h @@ -125,7 +125,7 @@ struct vfc_regs { struct vfc_dev { - volatile struct vfc_regs __iomem *regs; + volatile struct vfc_regs *regs; struct vfc_regs *phys_regs; unsigned int control_reg; struct semaphore device_lock_sem; diff --git a/trunk/drivers/sbus/char/vfc_dev.c b/trunk/drivers/sbus/char/vfc_dev.c index dfdd6be551f3..7a103698fa3c 100644 --- a/trunk/drivers/sbus/char/vfc_dev.c +++ b/trunk/drivers/sbus/char/vfc_dev.c @@ -149,7 +149,7 @@ int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance) } printk("Initializing vfc%d\n",instance); dev->regs = NULL; - dev->regs = (volatile struct vfc_regs __iomem *) + dev->regs = (volatile struct vfc_regs *) sbus_ioremap(&sdev->resource[0], 0, sizeof(struct vfc_regs), vfcstr); dev->which_io = sdev->reg_addrs[0].which_io; @@ -319,7 +319,7 @@ int vfc_capture_poll(struct vfc_dev *dev) int timeout = 1000; while (!timeout--) { - if (sbus_readl(&dev->regs->control) & VFC_STATUS_CAPTURE) + if (dev->regs->control & VFC_STATUS_CAPTURE) break; vfc_i2c_delay_no_busy(dev, 100); } @@ -718,7 +718,7 @@ static void deinit_vfc_device(struct vfc_dev *dev) if(dev == NULL) return; devfs_remove("vfc/%d", dev->instance); - sbus_iounmap(dev->regs, sizeof(struct vfc_regs)); + sbus_iounmap((unsigned long)dev->regs, sizeof(struct vfc_regs)); kfree(dev); } diff --git a/trunk/drivers/scsi/53c700.c b/trunk/drivers/scsi/53c700.c index 4ce7438608ec..e7ad269041a4 100644 --- a/trunk/drivers/scsi/53c700.c +++ b/trunk/drivers/scsi/53c700.c @@ -857,7 +857,7 @@ process_extended_message(struct Scsi_Host *host, printk(KERN_INFO "scsi%d (%d:%d): Unexpected message %s: ", host->host_no, pun, lun, NCR_700_phase[(dsps & 0xf00) >> 8]); - spi_print_msg(hostdata->msgin); + scsi_print_msg(hostdata->msgin); printk("\n"); /* just reject it */ hostdata->msgout[0] = A_REJECT_MSG; @@ -887,7 +887,7 @@ process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata #ifdef NCR_700_DEBUG printk("scsi%d (%d:%d): message %s: ", host->host_no, pun, lun, NCR_700_phase[(dsps & 0xf00) >> 8]); - spi_print_msg(hostdata->msgin); + scsi_print_msg(hostdata->msgin); printk("\n"); #endif @@ -939,7 +939,7 @@ process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata host->host_no, pun, lun, NCR_700_phase[(dsps & 0xf00) >> 8]); - spi_print_msg(hostdata->msgin); + scsi_print_msg(hostdata->msgin); printk("\n"); /* just reject it */ hostdata->msgout[0] = A_REJECT_MSG; diff --git a/trunk/drivers/scsi/53c700.h b/trunk/drivers/scsi/53c700.h index a8c83bb03630..362d78483d09 100644 --- a/trunk/drivers/scsi/53c700.h +++ b/trunk/drivers/scsi/53c700.h @@ -238,23 +238,21 @@ struct NCR_700_Host_Parameters { #ifdef CONFIG_53C700_LE_ON_BE #define bE (hostdata->force_le_on_be ? 0 : 3) #define bSWAP (hostdata->force_le_on_be) -#define bEBus (!hostdata->force_le_on_be) +/* This is terrible, but there's no raw version of ioread32. That means + * that on a be board we swap twice (once in ioread32 and once again to + * get the value correct) */ +#define bS_to_io(x) ((hostdata->force_le_on_be) ? (x) : cpu_to_le32(x)) #elif defined(__BIG_ENDIAN) #define bE 3 #define bSWAP 0 +#define bS_to_io(x) (x) #elif defined(__LITTLE_ENDIAN) #define bE 0 #define bSWAP 0 +#define bS_to_io(x) (x) #else #error "__BIG_ENDIAN or __LITTLE_ENDIAN must be defined, did you include byteorder.h?" #endif -#ifndef bEBus -#ifdef CONFIG_53C700_BE_BUS -#define bEBus 1 -#else -#define bEBus 0 -#endif -#endif #define bS_to_cpu(x) (bSWAP ? le32_to_cpu(x) : (x)) #define bS_to_host(x) (bSWAP ? cpu_to_le32(x) : (x)) @@ -468,15 +466,14 @@ NCR_700_readl(struct Scsi_Host *host, __u32 reg) { const struct NCR_700_Host_Parameters *hostdata = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - __u32 value = bEBus ? ioread32be(hostdata->base + reg) : - ioread32(hostdata->base + reg); + __u32 value = ioread32(hostdata->base + reg); #if 1 /* sanity check the register */ if((reg & 0x3) != 0) BUG(); #endif - return value; + return bS_to_io(value); } static inline void @@ -500,8 +497,7 @@ NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg) BUG(); #endif - bEBus ? iowrite32be(value, hostdata->base + reg): - iowrite32(value, hostdata->base + reg); + iowrite32(bS_to_io(value), hostdata->base + reg); } #endif diff --git a/trunk/drivers/scsi/53c7xx.c b/trunk/drivers/scsi/53c7xx.c index 7894b8ea84bd..9cb5dd48383f 100644 --- a/trunk/drivers/scsi/53c7xx.c +++ b/trunk/drivers/scsi/53c7xx.c @@ -282,7 +282,6 @@ #include "scsi.h" #include #include -#include #include "53c7xx.h" #include #include @@ -1725,7 +1724,7 @@ NCR53c7xx_run_tests (struct Scsi_Host *host) { printk ("scsi%d : status ", host->host_no); scsi_print_status (status); printk ("\nscsi%d : message ", host->host_no); - spi_print_msg(&msg); + scsi_print_msg (&msg); printk ("\n"); } else if (hostdata->test_completed == 3) { printk("scsi%d : test 2 no connection with target %d\n", @@ -2314,7 +2313,7 @@ NCR53c7x0_dstat_sir_intr (struct Scsi_Host *host, struct printk ("scsi%d : received message", host->host_no); if (c) printk (" from target %d lun %d ", c->device->id, c->device->lun); - spi_print_msg((unsigned char *) hostdata->msg_buf); + scsi_print_msg ((unsigned char *) hostdata->msg_buf); printk("\n"); } @@ -5541,7 +5540,7 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) { i > 0 && !check_address ((unsigned long) ptr, 1); ptr += len, i -= len) { printk(" "); - len = spi_print_msg(ptr); + len = scsi_print_msg (ptr); printk("\n"); if (!len) break; diff --git a/trunk/drivers/scsi/Kconfig b/trunk/drivers/scsi/Kconfig index 4c42065dea88..84c42c44e04d 100644 --- a/trunk/drivers/scsi/Kconfig +++ b/trunk/drivers/scsi/Kconfig @@ -336,7 +336,6 @@ config SCSI_ACARD config SCSI_AHA152X tristate "Adaptec AHA152X/2825 support" depends on ISA && SCSI && !64BIT - select SCSI_SPI_ATTRS ---help--- This is a driver for the AHA-1510, AHA-1520, AHA-1522, and AHA-2825 SCSI host adapters. It also works for the AVA-1505, but the IRQ etc. @@ -498,7 +497,7 @@ config SCSI_ATA_PIIX If unsure, say N. config SCSI_SATA_MV - tristate "Marvell SATA support (HIGHLY EXPERIMENTAL)" + tristate "Marvell SATA support" depends on SCSI_SATA && PCI && EXPERIMENTAL help This option enables support for the Marvell Serial ATA family. @@ -624,7 +623,6 @@ config SCSI_OMIT_FLASHPOINT config SCSI_DMX3191D tristate "DMX3191D SCSI support" depends on PCI && SCSI - select SCSI_SPI_ATTRS help This is support for Domex DMX3191D SCSI Host Adapters. @@ -634,7 +632,6 @@ config SCSI_DMX3191D config SCSI_DTC3280 tristate "DTC3180/3280 SCSI support" depends on ISA && SCSI - select SCSI_SPI_ATTRS help This is support for DTC 3180/3280 SCSI Host Adapters. Please read the SCSI-HOWTO, available from @@ -755,7 +752,6 @@ config SCSI_GDTH config SCSI_GENERIC_NCR5380 tristate "Generic NCR5380/53c400 SCSI PIO support" depends on ISA && SCSI - select SCSI_SPI_ATTRS ---help--- This is a driver for the old NCR 53c80 series of SCSI controllers on boards using PIO. Most boards such as the Trantor T130 fit this @@ -775,7 +771,6 @@ config SCSI_GENERIC_NCR5380 config SCSI_GENERIC_NCR5380_MMIO tristate "Generic NCR5380/53c400 SCSI MMIO support" depends on ISA && SCSI - select SCSI_SPI_ATTRS ---help--- This is a driver for the old NCR 53c80 series of SCSI controllers on boards using memory mapped I/O. @@ -1259,7 +1254,6 @@ config SCSI_MCA_53C9X config SCSI_PAS16 tristate "PAS16 SCSI support" depends on ISA && SCSI - select SCSI_SPI_ATTRS ---help--- This is support for a SCSI host adapter. It is explained in section 3.10 of the SCSI-HOWTO, available from @@ -1429,7 +1423,6 @@ config SCSI_DC390T config SCSI_T128 tristate "Trantor T128/T128F/T228 SCSI support" depends on ISA && SCSI - select SCSI_SPI_ATTRS ---help--- This is support for a SCSI host adapter. It is explained in section 3.11 of the SCSI-HOWTO, available from @@ -1688,7 +1681,6 @@ config OKTAGON_SCSI config ATARI_SCSI tristate "Atari native SCSI support" depends on ATARI && SCSI && BROKEN - select SCSI_SPI_ATTRS ---help--- If you have an Atari with built-in NCR5380 SCSI controller (TT, Falcon, ...) say Y to get it supported. Of course also, if you have @@ -1730,7 +1722,6 @@ config TT_DMA_EMUL config MAC_SCSI bool "Macintosh NCR5380 SCSI" depends on MAC && SCSI=y - select SCSI_SPI_ATTRS help This is the NCR 5380 SCSI controller included on most of the 68030 based Macintoshes. If you have one of these say Y and read the @@ -1752,7 +1743,6 @@ config SCSI_MAC_ESP config MVME147_SCSI bool "WD33C93 SCSI driver for MVME147" depends on MVME147 && SCSI=y - select SCSI_SPI_ATTRS help Support for the on-board SCSI controller on the Motorola MVME147 single-board computer. @@ -1760,7 +1750,6 @@ config MVME147_SCSI config MVME16x_SCSI bool "NCR53C710 SCSI driver for MVME16x" depends on MVME16x && SCSI && BROKEN - select SCSI_SPI_ATTRS help The Motorola MVME162, 166, 167, 172 and 177 boards use the NCR53C710 SCSI controller chip. Almost everyone using one of these boards @@ -1769,7 +1758,6 @@ config MVME16x_SCSI config BVME6000_SCSI bool "NCR53C710 SCSI driver for BVME6000" depends on BVME6000 && SCSI && BROKEN - select SCSI_SPI_ATTRS help The BVME4000 and BVME6000 boards from BVM Ltd use the NCR53C710 SCSI controller chip. Almost everyone using one of these boards @@ -1786,7 +1774,6 @@ config SCSI_NCR53C7xx_FAST config SUN3_SCSI tristate "Sun3 NCR5380 SCSI" depends on SUN3 && SCSI && BROKEN - select SCSI_SPI_ATTRS help This option will enable support for the OBIO (onboard io) NCR5380 SCSI controller found in the Sun 3/50 and 3/60, as well as for diff --git a/trunk/drivers/scsi/NCR5380.c b/trunk/drivers/scsi/NCR5380.c index 9f0ddbe6dc76..cba9655d0f14 100644 --- a/trunk/drivers/scsi/NCR5380.c +++ b/trunk/drivers/scsi/NCR5380.c @@ -87,7 +87,6 @@ * the high level code. */ #include -#include #ifndef NDEBUG #define NDEBUG 0 @@ -2378,7 +2377,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { * 3..length+1 arguments * * Start the extended message buffer with the EXTENDED_MESSAGE - * byte, since spi_print_msg() wants the whole thing. + * byte, since scsi_print_msg() wants the whole thing. */ extended_msg[0] = EXTENDED_MESSAGE; /* Accept first byte by clearing ACK */ @@ -2425,7 +2424,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { default: if (!tmp) { printk("scsi%d: rejecting message ", instance->host_no); - spi_print_msg(extended_msg); + scsi_print_msg(extended_msg); printk("\n"); } else if (tmp != EXTENDED_MESSAGE) scmd_printk(KERN_INFO, cmd, @@ -2561,7 +2560,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) { if (!(msg[0] & 0x80)) { printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no); - spi_print_msg(msg); + scsi_print_msg(msg); abort = 1; } else { /* Accept message by clearing ACK */ diff --git a/trunk/drivers/scsi/aacraid/linit.c b/trunk/drivers/scsi/aacraid/linit.c index 3cb68af90456..ab383d1f59e2 100644 --- a/trunk/drivers/scsi/aacraid/linit.c +++ b/trunk/drivers/scsi/aacraid/linit.c @@ -325,8 +325,6 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev, * translations ( 64/32, 128/32, 255/63 ). */ buf = scsi_bios_ptable(bdev); - if (!buf) - return 0; if(*(__le16 *)(buf + 0x40) == cpu_to_le16(0xaa55)) { struct partition *first = (struct partition * )buf; struct partition *entry = first; diff --git a/trunk/drivers/scsi/aha152x.c b/trunk/drivers/scsi/aha152x.c index cb2ee25f213f..9df23b654cec 100644 --- a/trunk/drivers/scsi/aha152x.c +++ b/trunk/drivers/scsi/aha152x.c @@ -259,7 +259,6 @@ #include "scsi.h" #include #include -#include #include "aha152x.h" @@ -1846,7 +1845,7 @@ static void msgi_run(struct Scsi_Host *shpnt) #if defined(AHA152X_DEBUG) if (HOSTDATA(shpnt)->debug & debug_msgi) { printk(INFO_LEAD "inbound message %02x ", CMDINFO(CURRENT_SC), MSGI(0)); - spi_print_msg(&MSGI(0)); + scsi_print_msg(&MSGI(0)); printk("\n"); } #endif @@ -1934,7 +1933,7 @@ static void msgi_run(struct Scsi_Host *shpnt) break; printk(INFO_LEAD, CMDINFO(CURRENT_SC)); - spi_print_msg(&MSGI(0)); + scsi_print_msg(&MSGI(0)); printk("\n"); ticks = (MSGI(3) * 4 + 49) / 50; @@ -2032,7 +2031,7 @@ static void msgo_init(struct Scsi_Host *shpnt) int i; printk(DEBUG_LEAD "messages( ", CMDINFO(CURRENT_SC)); - for (i=0; i #define DRV_NAME "ahci" -#define DRV_VERSION "1.2" +#define DRV_VERSION "1.01" enum { @@ -558,26 +558,13 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc) pp->cmd_slot[0].opts |= cpu_to_le32(n_elem << 16); } -static void ahci_restart_port(struct ata_port *ap, u32 irq_stat) +static void ahci_intr_error(struct ata_port *ap, u32 irq_stat) { void __iomem *mmio = ap->host_set->mmio_base; void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no); u32 tmp; int work; - if ((ap->device[0].class != ATA_DEV_ATAPI) || - ((irq_stat & PORT_IRQ_TF_ERR) == 0)) - printk(KERN_WARNING "ata%u: port reset, " - "p_is %x is %x pis %x cmd %x tf %x ss %x se %x\n", - ap->id, - irq_stat, - readl(mmio + HOST_IRQ_STAT), - readl(port_mmio + PORT_IRQ_STAT), - readl(port_mmio + PORT_CMD), - readl(port_mmio + PORT_TFDATA), - readl(port_mmio + PORT_SCR_STAT), - readl(port_mmio + PORT_SCR_ERR)); - /* stop DMA */ tmp = readl(port_mmio + PORT_CMD); tmp &= ~PORT_CMD_START; @@ -615,6 +602,13 @@ static void ahci_restart_port(struct ata_port *ap, u32 irq_stat) tmp |= PORT_CMD_START; writel(tmp, port_mmio + PORT_CMD); readl(port_mmio + PORT_CMD); /* flush */ + + printk(KERN_WARNING "ata%u: error occurred, port reset (%s%s%s%s)\n", + ap->id, + irq_stat & PORT_IRQ_TF_ERR ? "taskf " : "", + irq_stat & PORT_IRQ_HBUS_ERR ? "hbus " : "", + irq_stat & PORT_IRQ_HBUS_DATA_ERR ? "hbus_data " : "", + irq_stat & PORT_IRQ_IF_ERR ? "if " : ""); } static void ahci_eng_timeout(struct ata_port *ap) @@ -625,7 +619,7 @@ static void ahci_eng_timeout(struct ata_port *ap) struct ata_queued_cmd *qc; unsigned long flags; - printk(KERN_WARNING "ata%u: handling error/timeout\n", ap->id); + DPRINTK("ENTER\n"); spin_lock_irqsave(&host_set->lock, flags); @@ -634,7 +628,7 @@ static void ahci_eng_timeout(struct ata_port *ap) printk(KERN_ERR "ata%u: BUG: timeout without command\n", ap->id); } else { - ahci_restart_port(ap, readl(port_mmio + PORT_IRQ_STAT)); + ahci_intr_error(ap, readl(port_mmio + PORT_IRQ_STAT)); /* hack alert! We cannot use the supplied completion * function from inside the ->eh_strategy_handler() thread. @@ -678,9 +672,8 @@ static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc) else err_mask = AC_ERR_HOST_BUS; - /* command processing has stopped due to error; restart */ - ahci_restart_port(ap, status); - + if (err_mask != AC_ERR_DEV) + ahci_intr_error(ap, status); if (qc) ata_qc_complete(qc, err_mask); } diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c index 1c8f872e2dd4..31e9f40e79a2 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -1064,7 +1064,6 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa struct Scsi_Host *host; char *new_name; u_long s; - int retval; template->name = ahd->description; host = scsi_host_alloc(template, sizeof(struct ahd_softc *)); @@ -1097,15 +1096,9 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa host->transportt = ahd_linux_transport_template; - retval = scsi_add_host(host, &ahd->dev_softc->dev); - if (retval) { - printk(KERN_WARNING "aic79xx: scsi_add_host failed\n"); - scsi_host_put(host); - return retval; - } - + scsi_add_host(host, &ahd->dev_softc->dev); /* XXX handle failure */ scsi_scan_host(host); - return 0; + return (0); } uint64_t @@ -2112,7 +2105,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) scmd_id(cmd), scmd_channel(cmd) + 'A', CAM_LUN_WILDCARD, - SCB_LIST_NULL, ROLE_INITIATOR)) + SCB_LIST_NULL, ROLE_INITIATOR) == 0) break; } } diff --git a/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c b/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c index fd389e9f9460..7fc6454068e4 100644 --- a/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -1061,11 +1061,10 @@ uint32_t aic7xxx_verbose; int ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *template) { - char buf[80]; - struct Scsi_Host *host; + char buf[80]; + struct Scsi_Host *host; char *new_name; - u_long s; - int retval; + u_long s; template->name = ahc->description; host = scsi_host_alloc(template, sizeof(struct ahc_softc *)); @@ -1098,16 +1097,9 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa host->transportt = ahc_linux_transport_template; - retval = scsi_add_host(host, - (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); - if (retval) { - printk(KERN_WARNING "aic7xxx: scsi_add_host failed\n"); - scsi_host_put(host); - return retval; - } - + scsi_add_host(host, (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); /* XXX handle failure */ scsi_scan_host(host); - return 0; + return (0); } /* @@ -2177,7 +2169,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) if (ahc_match_scb(ahc, pending_scb, scmd_id(cmd), scmd_channel(cmd) + 'A', CAM_LUN_WILDCARD, - SCB_LIST_NULL, ROLE_INITIATOR)) + SCB_LIST_NULL, ROLE_INITIATOR) == 0) break; } } diff --git a/trunk/drivers/scsi/arm/Kconfig b/trunk/drivers/scsi/arm/Kconfig index 06d7601cdf56..13f23043c8a3 100644 --- a/trunk/drivers/scsi/arm/Kconfig +++ b/trunk/drivers/scsi/arm/Kconfig @@ -4,7 +4,6 @@ config SCSI_ACORNSCSI_3 tristate "Acorn SCSI card (aka30) support" depends on ARCH_ACORN && SCSI && BROKEN - select SCSI_SPI_ATTRS help This enables support for the Acorn SCSI card (aka30). If you have an Acorn system with one of these, say Y. If unsure, say N. diff --git a/trunk/drivers/scsi/arm/acornscsi.c b/trunk/drivers/scsi/arm/acornscsi.c index 09ed05727bcb..b7b20c689c24 100644 --- a/trunk/drivers/scsi/arm/acornscsi.c +++ b/trunk/drivers/scsi/arm/acornscsi.c @@ -152,7 +152,6 @@ #include "../scsi.h" #include #include -#include #include "acornscsi.h" #include "msgqueue.h" #include "scsi.h" @@ -1371,7 +1370,7 @@ void acornscsi_sendmessage(AS_Host *host) host->scsi.last_message = msg->msg[0]; #if (DEBUG & DEBUG_MESSAGES) - spi_print_msg(msg->msg); + scsi_print_msg(msg->msg); #endif break; @@ -1393,7 +1392,7 @@ void acornscsi_sendmessage(AS_Host *host) while ((msg = msgqueue_getmsg(&host->scsi.msgs, msgnr++)) != NULL) { unsigned int i; #if (DEBUG & DEBUG_MESSAGES) - spi_print_msg(msg); + scsi_print_msg(msg); #endif i = 0; if (acornscsi_write_pio(host, msg->msg, &i, msg->length, 1000000)) @@ -1489,7 +1488,7 @@ void acornscsi_message(AS_Host *host) #if (DEBUG & DEBUG_MESSAGES) printk("scsi%d.%c: message in: ", host->host->host_no, acornscsi_target(host)); - spi_print_msg(message); + scsi_print_msg(message); printk("\n"); #endif diff --git a/trunk/drivers/scsi/ata_piix.c b/trunk/drivers/scsi/ata_piix.c index 333d69dd84ef..855428ff37e9 100644 --- a/trunk/drivers/scsi/ata_piix.c +++ b/trunk/drivers/scsi/ata_piix.c @@ -50,7 +50,7 @@ #include #define DRV_NAME "ata_piix" -#define DRV_VERSION "1.05" +#define DRV_VERSION "1.04" enum { PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ diff --git a/trunk/drivers/scsi/atari_NCR5380.c b/trunk/drivers/scsi/atari_NCR5380.c index 57295bcea3e7..2ae31ceb32a8 100644 --- a/trunk/drivers/scsi/atari_NCR5380.c +++ b/trunk/drivers/scsi/atari_NCR5380.c @@ -74,7 +74,6 @@ * the high level code. */ #include -#include #if (NDEBUG & NDEBUG_LISTS) #define LIST(x,y) \ @@ -2356,7 +2355,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) * 3..length+1 arguments * * Start the extended message buffer with the EXTENDED_MESSAGE - * byte, since spi_print_msg() wants the whole thing. + * byte, since scsi_print_msg() wants the whole thing. */ extended_msg[0] = EXTENDED_MESSAGE; /* Accept first byte by clearing ACK */ @@ -2409,7 +2408,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) default: if (!tmp) { printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); - spi_print_msg(extended_msg); + scsi_print_msg (extended_msg); printk("\n"); } else if (tmp != EXTENDED_MESSAGE) printk(KERN_DEBUG "scsi%d: rejecting unknown " @@ -2542,7 +2541,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance) if (!(msg[0] & 0x80)) { printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); - spi_print_msg(msg); + scsi_print_msg(msg); do_abort(instance); return; } diff --git a/trunk/drivers/scsi/ch.c b/trunk/drivers/scsi/ch.c index 0920220f3313..ccbbae2bf478 100644 --- a/trunk/drivers/scsi/ch.c +++ b/trunk/drivers/scsi/ch.c @@ -75,7 +75,7 @@ static int vendor_counts[CH_TYPES-4]; module_param_array(vendor_firsts, int, NULL, 0444); module_param_array(vendor_counts, int, NULL, 0444); -static const char * vendor_labels[CH_TYPES-4] = { +static char *vendor_labels[CH_TYPES-4] = { "v0", "v1", "v2", "v3" }; // module_param_string_array(vendor_labels, NULL, 0444); @@ -140,7 +140,7 @@ static struct file_operations changer_fops = #endif }; -static const struct { +static struct { unsigned char sense; unsigned char asc; unsigned char ascq; diff --git a/trunk/drivers/scsi/constants.c b/trunk/drivers/scsi/constants.c index 30a335349cee..09bc81557b6e 100644 --- a/trunk/drivers/scsi/constants.c +++ b/trunk/drivers/scsi/constants.c @@ -1065,7 +1065,7 @@ struct error_info2 { const char * fmt; }; -static const struct error_info2 additional2[] = +static struct error_info2 additional2[] = { {0x40,0x00,0x7f,"Ram failure (%x)"}, {0x40,0x80,0xff,"Diagnostic failure on component (%x)"}, @@ -1077,7 +1077,7 @@ static const struct error_info2 additional2[] = }; /* description of the sense key values */ -static const char * const snstext[] = { +static const char *snstext[] = { "No Sense", /* 0: There is no sense information */ "Recovered Error", /* 1: The last command completed successfully but used error correction */ @@ -1278,6 +1278,114 @@ void scsi_print_req_sense(const char *devclass, struct scsi_request *sreq) } EXPORT_SYMBOL(scsi_print_req_sense); +#ifdef CONFIG_SCSI_CONSTANTS +static const char *one_byte_msgs[] = { +/* 0x00 */ "Command Complete", NULL, "Save Pointers", +/* 0x03 */ "Restore Pointers", "Disconnect", "Initiator Error", +/* 0x06 */ "Abort", "Message Reject", "Nop", "Message Parity Error", +/* 0x0a */ "Linked Command Complete", "Linked Command Complete w/flag", +/* 0x0c */ "Bus device reset", "Abort Tag", "Clear Queue", +/* 0x0f */ "Initiate Recovery", "Release Recovery" +}; +#define NO_ONE_BYTE_MSGS (sizeof(one_byte_msgs) / sizeof (const char *)) + +static const char *two_byte_msgs[] = { +/* 0x20 */ "Simple Queue Tag", "Head of Queue Tag", "Ordered Queue Tag" +/* 0x23 */ "Ignore Wide Residue" +}; +#define NO_TWO_BYTE_MSGS (sizeof(two_byte_msgs) / sizeof (const char *)) + +static const char *extended_msgs[] = { +/* 0x00 */ "Modify Data Pointer", "Synchronous Data Transfer Request", +/* 0x02 */ "SCSI-I Extended Identify", "Wide Data Transfer Request" +}; +#define NO_EXTENDED_MSGS (sizeof(two_byte_msgs) / sizeof (const char *)) + + +int scsi_print_msg (const unsigned char *msg) +{ + int len = 0, i; + if (msg[0] == EXTENDED_MESSAGE) { + len = 3 + msg[1]; + if (msg[2] < NO_EXTENDED_MSGS) + printk ("%s ", extended_msgs[msg[2]]); + else + printk ("Extended Message, reserved code (0x%02x) ", + (int) msg[2]); + switch (msg[2]) { + case EXTENDED_MODIFY_DATA_POINTER: + printk("pointer = %d", (int) (msg[3] << 24) | + (msg[4] << 16) | (msg[5] << 8) | msg[6]); + break; + case EXTENDED_SDTR: + printk("period = %d ns, offset = %d", + (int) msg[3] * 4, (int) msg[4]); + break; + case EXTENDED_WDTR: + printk("width = 2^%d bytes", msg[3]); + break; + default: + for (i = 2; i < len; ++i) + printk("%02x ", msg[i]); + } + /* Identify */ + } else if (msg[0] & 0x80) { + printk("Identify disconnect %sallowed %s %d ", + (msg[0] & 0x40) ? "" : "not ", + (msg[0] & 0x20) ? "target routine" : "lun", + msg[0] & 0x7); + len = 1; + /* Normal One byte */ + } else if (msg[0] < 0x1f) { + if (msg[0] < NO_ONE_BYTE_MSGS) + printk(one_byte_msgs[msg[0]]); + else + printk("reserved (%02x) ", msg[0]); + len = 1; + /* Two byte */ + } else if (msg[0] <= 0x2f) { + if ((msg[0] - 0x20) < NO_TWO_BYTE_MSGS) + printk("%s %02x ", two_byte_msgs[msg[0] - 0x20], + msg[1]); + else + printk("reserved two byte (%02x %02x) ", + msg[0], msg[1]); + len = 2; + } else + printk("reserved"); + return len; +} +EXPORT_SYMBOL(scsi_print_msg); + +#else /* ifndef CONFIG_SCSI_CONSTANTS */ + +int scsi_print_msg (const unsigned char *msg) +{ + int len = 0, i; + + if (msg[0] == EXTENDED_MESSAGE) { + len = 3 + msg[1]; + for (i = 0; i < len; ++i) + printk("%02x ", msg[i]); + /* Identify */ + } else if (msg[0] & 0x80) { + printk("%02x ", msg[0]); + len = 1; + /* Normal One byte */ + } else if (msg[0] < 0x1f) { + printk("%02x ", msg[0]); + len = 1; + /* Two byte */ + } else if (msg[0] <= 0x2f) { + printk("%02x %02x", msg[0], msg[1]); + len = 2; + } else + printk("%02x ", msg[0]); + return len; +} +EXPORT_SYMBOL(scsi_print_msg); +#endif /* ! CONFIG_SCSI_CONSTANTS */ + void scsi_print_command(struct scsi_cmnd *cmd) { /* Assume appended output (i.e. not at start of line) */ @@ -1289,7 +1397,7 @@ EXPORT_SYMBOL(scsi_print_command); #ifdef CONFIG_SCSI_CONSTANTS -static const char * const hostbyte_table[]={ +static const char * hostbyte_table[]={ "DID_OK", "DID_NO_CONNECT", "DID_BUS_BUSY", "DID_TIME_OUT", "DID_BAD_TARGET", "DID_ABORT", "DID_PARITY", "DID_ERROR", "DID_RESET", "DID_BAD_INTR", "DID_PASSTHROUGH", "DID_SOFT_ERROR", "DID_IMM_RETRY"}; @@ -1314,12 +1422,12 @@ void scsi_print_hostbyte(int scsiresult) #ifdef CONFIG_SCSI_CONSTANTS -static const char * const driverbyte_table[]={ +static const char * driverbyte_table[]={ "DRIVER_OK", "DRIVER_BUSY", "DRIVER_SOFT", "DRIVER_MEDIA", "DRIVER_ERROR", "DRIVER_INVALID", "DRIVER_TIMEOUT", "DRIVER_HARD", "DRIVER_SENSE"}; #define NUM_DRIVERBYTE_STRS (sizeof(driverbyte_table) / sizeof(const char *)) -static const char * const driversuggest_table[]={"SUGGEST_OK", +static const char * driversuggest_table[]={"SUGGEST_OK", "SUGGEST_RETRY", "SUGGEST_ABORT", "SUGGEST_REMAP", "SUGGEST_DIE", "SUGGEST_5", "SUGGEST_6", "SUGGEST_7", "SUGGEST_SENSE"}; #define NUM_SUGGEST_STRS (sizeof(driversuggest_table) / sizeof(const char *)) diff --git a/trunk/drivers/scsi/dpt_i2o.c b/trunk/drivers/scsi/dpt_i2o.c index 6252b9ddc01e..c28e3aea1c3c 100644 --- a/trunk/drivers/scsi/dpt_i2o.c +++ b/trunk/drivers/scsi/dpt_i2o.c @@ -660,12 +660,7 @@ static int adpt_abort(struct scsi_cmnd * cmd) msg[2] = 0; msg[3]= 0; msg[4] = (u32)cmd; - if (pHba->host) - spin_lock_irq(pHba->host->host_lock); - rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER); - if (pHba->host) - spin_unlock_irq(pHba->host->host_lock); - if (rcode != 0) { + if( (rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER)) != 0){ if(rcode == -EOPNOTSUPP ){ printk(KERN_INFO"%s: Abort cmd not supported\n",pHba->name); return FAILED; @@ -702,15 +697,10 @@ static int adpt_device_reset(struct scsi_cmnd* cmd) msg[2] = 0; msg[3] = 0; - if (pHba->host) - spin_lock_irq(pHba->host->host_lock); old_state = d->state; d->state |= DPTI_DEV_RESET; - rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER); - d->state = old_state; - if (pHba->host) - spin_unlock_irq(pHba->host->host_lock); - if (rcode != 0) { + if( (rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER)) ){ + d->state = old_state; if(rcode == -EOPNOTSUPP ){ printk(KERN_INFO"%s: Device reset not supported\n",pHba->name); return FAILED; @@ -718,6 +708,7 @@ static int adpt_device_reset(struct scsi_cmnd* cmd) printk(KERN_INFO"%s: Device reset failed\n",pHba->name); return FAILED; } else { + d->state = old_state; printk(KERN_INFO"%s: Device reset successful\n",pHba->name); return SUCCESS; } @@ -730,7 +721,6 @@ static int adpt_bus_reset(struct scsi_cmnd* cmd) { adpt_hba* pHba; u32 msg[4]; - u32 rcode; pHba = (adpt_hba*)cmd->device->host->hostdata[0]; memset(msg, 0, sizeof(msg)); @@ -739,12 +729,7 @@ static int adpt_bus_reset(struct scsi_cmnd* cmd) msg[1] = (I2O_HBA_BUS_RESET<<24|HOST_TID<<12|pHba->channel[cmd->device->channel].tid); msg[2] = 0; msg[3] = 0; - if (pHba->host) - spin_lock_irq(pHba->host->host_lock); - rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER); - if (pHba->host) - spin_unlock_irq(pHba->host->host_lock); - if (rcode != 0) { + if(adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER) ){ printk(KERN_WARNING"%s: Bus reset failed.\n",pHba->name); return FAILED; } else { @@ -831,7 +816,7 @@ static int adpt_hba_reset(adpt_hba* pHba) static void adpt_i2o_sys_shutdown(void) { adpt_hba *pHba, *pNext; - struct adpt_i2o_post_wait_data *p1, *old; + struct adpt_i2o_post_wait_data *p1, *p2; printk(KERN_INFO"Shutting down Adaptec I2O controllers.\n"); printk(KERN_INFO" This could take a few minutes if there are many devices attached\n"); @@ -845,14 +830,13 @@ static void adpt_i2o_sys_shutdown(void) } /* Remove any timedout entries from the wait queue. */ + p2 = NULL; // spin_lock_irqsave(&adpt_post_wait_lock, flags); /* Nothing should be outstanding at this point so just * free them */ - for(p1 = adpt_post_wait_queue; p1;) { - old = p1; - p1 = p1->next; - kfree(old); + for(p1 = adpt_post_wait_queue; p1; p2 = p1, p1 = p2->next) { + kfree(p1); } // spin_unlock_irqrestore(&adpt_post_wait_lock, flags); adpt_post_wait_queue = NULL; diff --git a/trunk/drivers/scsi/ibmvscsi/ibmvscsi.h b/trunk/drivers/scsi/ibmvscsi/ibmvscsi.h index 5b0edd1f1921..8bec0438dc8a 100644 --- a/trunk/drivers/scsi/ibmvscsi/ibmvscsi.h +++ b/trunk/drivers/scsi/ibmvscsi/ibmvscsi.h @@ -100,7 +100,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, void ibmvscsi_release_crq_queue(struct crq_queue *queue, struct ibmvscsi_host_data *hostdata, int max_requests); -int ibmvscsi_reset_crq_queue(struct crq_queue *queue, +void ibmvscsi_reset_crq_queue(struct crq_queue *queue, struct ibmvscsi_host_data *hostdata); void ibmvscsi_handle_crq(struct viosrp_crq *crq, diff --git a/trunk/drivers/scsi/ibmvscsi/iseries_vscsi.c b/trunk/drivers/scsi/ibmvscsi/iseries_vscsi.c index ce15d9e39621..1045872b0175 100644 --- a/trunk/drivers/scsi/ibmvscsi/iseries_vscsi.c +++ b/trunk/drivers/scsi/ibmvscsi/iseries_vscsi.c @@ -117,10 +117,9 @@ void ibmvscsi_release_crq_queue(struct crq_queue *queue, * * no-op for iSeries */ -int ibmvscsi_reset_crq_queue(struct crq_queue *queue, +void ibmvscsi_reset_crq_queue(struct crq_queue *queue, struct ibmvscsi_host_data *hostdata) { - return 0; } /** diff --git a/trunk/drivers/scsi/ibmvscsi/rpa_vscsi.c b/trunk/drivers/scsi/ibmvscsi/rpa_vscsi.c index 75db2f5c545e..8bf5652f1060 100644 --- a/trunk/drivers/scsi/ibmvscsi/rpa_vscsi.c +++ b/trunk/drivers/scsi/ibmvscsi/rpa_vscsi.c @@ -230,11 +230,6 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, rc = plpar_hcall_norets(H_REG_CRQ, vdev->unit_address, queue->msg_token, PAGE_SIZE); - if (rc == H_Resource) - /* maybe kexecing and resource is busy. try a reset */ - rc = ibmvscsi_reset_crq_queue(queue, - hostdata); - if (rc == 2) { /* Adapter is good, but other end is not ready */ printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n"); @@ -286,7 +281,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, * @hostdata: ibmvscsi_host_data of host * */ -int ibmvscsi_reset_crq_queue(struct crq_queue *queue, +void ibmvscsi_reset_crq_queue(struct crq_queue *queue, struct ibmvscsi_host_data *hostdata) { int rc; @@ -314,5 +309,4 @@ int ibmvscsi_reset_crq_queue(struct crq_queue *queue, printk(KERN_WARNING "ibmvscsi: couldn't register crq--rc 0x%x\n", rc); } - return rc; } diff --git a/trunk/drivers/scsi/ide-scsi.c b/trunk/drivers/scsi/ide-scsi.c index 4cb1f3ed9100..e1960d69fb90 100644 --- a/trunk/drivers/scsi/ide-scsi.c +++ b/trunk/drivers/scsi/ide-scsi.c @@ -784,8 +784,8 @@ static ide_proc_entry_t idescsi_proc[] = { #endif static ide_driver_t idescsi_driver = { + .owner = THIS_MODULE, .gen_driver = { - .owner = THIS_MODULE, .name = "ide-scsi", .bus = &ide_bus_type, .probe = ide_scsi_probe, diff --git a/trunk/drivers/scsi/ipr.c b/trunk/drivers/scsi/ipr.c index b6714da4d6e2..fa2cb3582cfa 100644 --- a/trunk/drivers/scsi/ipr.c +++ b/trunk/drivers/scsi/ipr.c @@ -5887,12 +5887,7 @@ static int __devinit ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg) ENTER; spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags); dev_dbg(&ioa_cfg->pdev->dev, "ioa_cfg adx: 0x%p\n", ioa_cfg); - if (ioa_cfg->needs_hard_reset) { - ioa_cfg->needs_hard_reset = 0; - ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE); - } else - _ipr_initiate_ioa_reset(ioa_cfg, ipr_reset_enable_ioa, - IPR_SHUTDOWN_NONE); + _ipr_initiate_ioa_reset(ioa_cfg, ipr_reset_enable_ioa, IPR_SHUTDOWN_NONE); spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags); wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload); @@ -6269,7 +6264,6 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev, unsigned long ipr_regs_pci; void __iomem *ipr_regs; u32 rc = PCIBIOS_SUCCESSFUL; - volatile u32 mask, uproc; ENTER; @@ -6362,15 +6356,6 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev, goto cleanup_nomem; } - /* - * If HRRQ updated interrupt is not masked, or reset alert is set, - * the card is in an unknown state and needs a hard reset - */ - mask = readl(ioa_cfg->regs.sense_interrupt_mask_reg); - uproc = readl(ioa_cfg->regs.sense_uproc_interrupt_reg); - if ((mask & IPR_PCII_HRRQ_UPDATED) == 0 || (uproc & IPR_UPROCI_RESET_ALERT)) - ioa_cfg->needs_hard_reset = 1; - ipr_mask_and_clear_interrupts(ioa_cfg, ~IPR_PCII_IOA_TRANS_TO_OPER); rc = request_irq(pdev->irq, ipr_isr, SA_SHIRQ, IPR_NAME, ioa_cfg); diff --git a/trunk/drivers/scsi/ipr.h b/trunk/drivers/scsi/ipr.h index b639332131f1..6bec673c925c 100644 --- a/trunk/drivers/scsi/ipr.h +++ b/trunk/drivers/scsi/ipr.h @@ -36,8 +36,8 @@ /* * Literals */ -#define IPR_DRIVER_VERSION "2.1.1" -#define IPR_DRIVER_DATE "(November 15, 2005)" +#define IPR_DRIVER_VERSION "2.1.0" +#define IPR_DRIVER_DATE "(October 31, 2005)" /* * IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding @@ -922,7 +922,6 @@ struct ipr_ioa_cfg { u8 dump_taken:1; u8 allow_cmds:1; u8 allow_ml_add_del:1; - u8 needs_hard_reset:1; enum ipr_cache_state cache_state; u16 type; /* CCIN of the card */ diff --git a/trunk/drivers/scsi/iscsi_tcp.c b/trunk/drivers/scsi/iscsi_tcp.c index 10bcf42cb65c..4fea3e4edaa7 100644 --- a/trunk/drivers/scsi/iscsi_tcp.c +++ b/trunk/drivers/scsi/iscsi_tcp.c @@ -49,7 +49,7 @@ MODULE_AUTHOR("Dmitry Yusupov , " "Alex Aizman "); MODULE_DESCRIPTION("iSCSI/TCP data-path"); MODULE_LICENSE("GPL"); -MODULE_VERSION("0:4.445"); +MODULE_VERSION("0:4.409"); /* #define DEBUG_TCP */ /* #define DEBUG_SCSI */ #define DEBUG_ASSERT @@ -581,16 +581,10 @@ iscsi_hdr_recv(struct iscsi_conn *conn) crypto_digest_digest(conn->rx_tfm, &sg, 1, (u8 *)&cdgst); rdgst = *(uint32_t*)((char*)hdr + sizeof(struct iscsi_hdr) + conn->in.ahslen); - if (cdgst != rdgst) { - printk(KERN_ERR "iscsi_tcp: itt %x: hdrdgst error " - "recv 0x%x calc 0x%x\n", conn->in.itt, rdgst, - cdgst); - return ISCSI_ERR_HDR_DGST; - } } /* save opcode for later */ - conn->in.opcode = hdr->opcode & ISCSI_OPCODE_MASK; + conn->in.opcode = hdr->opcode; /* verify itt (itt encoding: age+cid+itt) */ if (hdr->itt != cpu_to_be32(ISCSI_RESERVED_TAG)) { @@ -616,6 +610,13 @@ iscsi_hdr_recv(struct iscsi_conn *conn) conn->in.ahslen, conn->in.datalen); if (conn->in.itt < session->cmds_max) { + if (conn->hdrdgst_en && cdgst != rdgst) { + printk(KERN_ERR "iscsi_tcp: itt %x: hdrdgst error " + "recv 0x%x calc 0x%x\n", conn->in.itt, rdgst, + cdgst); + return ISCSI_ERR_HDR_DGST; + } + ctask = (struct iscsi_cmd_task *)session->cmds[conn->in.itt]; if (!ctask->sc) { @@ -641,7 +642,9 @@ iscsi_hdr_recv(struct iscsi_conn *conn) switch(conn->in.opcode) { case ISCSI_OP_SCSI_CMD_RSP: BUG_ON((void*)ctask != ctask->sc->SCp.ptr); - if (!conn->in.datalen) + if (ctask->hdr.flags & ISCSI_FLAG_CMD_WRITE) + rc = iscsi_cmd_rsp(conn, ctask); + else if (!conn->in.datalen) rc = iscsi_cmd_rsp(conn, ctask); else /* @@ -663,7 +666,8 @@ iscsi_hdr_recv(struct iscsi_conn *conn) break; case ISCSI_OP_R2T: BUG_ON((void*)ctask != ctask->sc->SCp.ptr); - if (ctask->sc->sc_data_direction == DMA_TO_DEVICE) + if (ctask->hdr.flags & ISCSI_FLAG_CMD_WRITE && + ctask->sc->sc_data_direction == DMA_TO_DEVICE) rc = iscsi_r2t_rsp(conn, ctask); else rc = ISCSI_ERR_PROTO; @@ -902,20 +906,11 @@ partial_sg_digest_update(struct iscsi_conn *conn, struct scatterlist *sg, crypto_digest_update(conn->data_rx_tfm, &temp, 1); } -static void -iscsi_recv_digest_update(struct iscsi_conn *conn, char* buf, int len) -{ - struct scatterlist tmp; - - sg_init_one(&tmp, buf, len); - crypto_digest_update(conn->data_rx_tfm, &tmp, 1); -} - static int iscsi_scsi_data_in(struct iscsi_conn *conn) { struct iscsi_cmd_task *ctask = conn->in.ctask; struct scsi_cmnd *sc = ctask->sc; - struct scatterlist *sg; + struct scatterlist tmp, *sg; int i, offset, rc = 0; BUG_ON((void*)ctask != sc->SCp.ptr); @@ -929,8 +924,10 @@ static int iscsi_scsi_data_in(struct iscsi_conn *conn) sc->request_bufflen, ctask->data_offset); if (rc == -EAGAIN) return rc; - if (conn->datadgst_en) - iscsi_recv_digest_update(conn, sc->request_buffer, i); + if (conn->datadgst_en) { + sg_init_one(&tmp, sc->request_buffer, i); + crypto_digest_update(conn->data_rx_tfm, &tmp, 1); + } rc = 0; goto done; } @@ -1024,9 +1021,6 @@ iscsi_data_recv(struct iscsi_conn *conn) conn->in.hdr = &conn->hdr; conn->senselen = (conn->data[0] << 8) | conn->data[1]; rc = iscsi_cmd_rsp(conn, conn->in.ctask); - if (!rc && conn->datadgst_en) - iscsi_recv_digest_update(conn, conn->data, - conn->in.datalen); } break; case ISCSI_OP_TEXT_RSP: @@ -1051,11 +1045,6 @@ iscsi_data_recv(struct iscsi_conn *conn) rc = iscsi_recv_pdu(iscsi_handle(conn), conn->in.hdr, conn->data, conn->in.datalen); - if (!rc && conn->datadgst_en && - conn->in.opcode != ISCSI_OP_LOGIN_RSP) - iscsi_recv_digest_update(conn, conn->data, - conn->in.datalen); - if (mtask && conn->login_mtask != mtask) { spin_lock(&session->lock); __kfifo_put(session->mgmtpool.queue, (void*)&mtask, @@ -1064,8 +1053,6 @@ iscsi_data_recv(struct iscsi_conn *conn) } } break; - case ISCSI_OP_ASYNC_EVENT: - case ISCSI_OP_REJECT: default: BUG_ON(1); } @@ -1127,7 +1114,8 @@ iscsi_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, */ rc = iscsi_hdr_recv(conn); if (!rc && conn->in.datalen) { - if (conn->datadgst_en) { + if (conn->datadgst_en && + conn->in.opcode == ISCSI_OP_SCSI_DATA_IN) { BUG_ON(!conn->data_rx_tfm); crypto_digest_init(conn->data_rx_tfm); } @@ -1139,24 +1127,26 @@ iscsi_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, } if (conn->in_progress == IN_PROGRESS_DDIGEST_RECV) { - uint32_t recv_digest; debug_tcp("extra data_recv offset %d copy %d\n", conn->in.offset, conn->in.copy); - skb_copy_bits(conn->in.skb, conn->in.offset, - &recv_digest, 4); - conn->in.offset += 4; - conn->in.copy -= 4; - if (recv_digest != conn->in.datadgst) { - debug_tcp("iscsi_tcp: data digest error!" - "0x%x != 0x%x\n", recv_digest, - conn->in.datadgst); - iscsi_conn_failure(conn, ISCSI_ERR_DATA_DGST); - return 0; - } else { - debug_tcp("iscsi_tcp: data digest match!" - "0x%x == 0x%x\n", recv_digest, - conn->in.datadgst); - conn->in_progress = IN_PROGRESS_WAIT_HEADER; + if (conn->in.opcode == ISCSI_OP_SCSI_DATA_IN) { + uint32_t recv_digest; + skb_copy_bits(conn->in.skb, conn->in.offset, + &recv_digest, 4); + conn->in.offset += 4; + conn->in.copy -= 4; + if (recv_digest != conn->in.datadgst) { + debug_tcp("iscsi_tcp: data digest error!" + "0x%x != 0x%x\n", recv_digest, + conn->in.datadgst); + iscsi_conn_failure(conn, ISCSI_ERR_DATA_DGST); + return 0; + } else { + debug_tcp("iscsi_tcp: data digest match!" + "0x%x == 0x%x\n", recv_digest, + conn->in.datadgst); + conn->in_progress = IN_PROGRESS_WAIT_HEADER; + } } } @@ -1177,7 +1167,8 @@ iscsi_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, } conn->in.copy -= conn->in.padding; conn->in.offset += conn->in.padding; - if (conn->datadgst_en) { + if (conn->datadgst_en && + conn->in.opcode == ISCSI_OP_SCSI_DATA_IN) { if (conn->in.padding) { debug_tcp("padding -> %d\n", conn->in.padding); memset(pad, 0, conn->in.padding); @@ -1246,9 +1237,8 @@ iscsi_tcp_state_change(struct sock *sk) conn = (struct iscsi_conn*)sk->sk_user_data; session = conn->session; - if ((sk->sk_state == TCP_CLOSE_WAIT || - sk->sk_state == TCP_CLOSE) && - !atomic_read(&sk->sk_rmem_alloc)) { + if (sk->sk_state == TCP_CLOSE_WAIT || + sk->sk_state == TCP_CLOSE) { debug_tcp("iscsi_tcp_state_change: TCP_CLOSE|TCP_CLOSE_WAIT\n"); iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); } @@ -2398,15 +2388,6 @@ iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) return 0; } -static int -iscsi_change_queue_depth(struct scsi_device *sdev, int depth) -{ - if (depth > ISCSI_MAX_CMD_PER_LUN) - depth = ISCSI_MAX_CMD_PER_LUN; - scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); - return sdev->queue_depth; -} - static int iscsi_pool_init(struct iscsi_queue *q, int max, void ***items, int item_size) { @@ -2872,11 +2853,8 @@ iscsi_conn_stop(iscsi_connh_t connh, int flag) * in hdr_extract() and will be re-negotiated at * set_param() time. */ - if (flag == STOP_CONN_RECOVER) { + if (flag == STOP_CONN_RECOVER) conn->hdr_size = sizeof(struct iscsi_hdr); - conn->hdrdgst_en = 0; - conn->datadgst_en = 0; - } } up(&conn->xmitsema); } @@ -3269,14 +3247,13 @@ iscsi_r2tpool_free(struct iscsi_session *session) static struct scsi_host_template iscsi_sht = { .name = "iSCSI Initiator over TCP/IP, v." ISCSI_VERSION_STR, - .queuecommand = iscsi_queuecommand, - .change_queue_depth = iscsi_change_queue_depth, + .queuecommand = iscsi_queuecommand, .can_queue = ISCSI_XMIT_CMDS_MAX - 1, .sg_tablesize = ISCSI_SG_TABLESIZE, - .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN, - .eh_abort_handler = iscsi_eh_abort, - .eh_host_reset_handler = iscsi_eh_host_reset, - .use_clustering = DISABLE_CLUSTERING, + .cmd_per_lun = ISCSI_CMD_PER_LUN, + .eh_abort_handler = iscsi_eh_abort, + .eh_host_reset_handler = iscsi_eh_host_reset, + .use_clustering = DISABLE_CLUSTERING, .proc_name = "iscsi_tcp", .this_id = -1, }; @@ -3391,7 +3368,7 @@ iscsi_conn_set_param(iscsi_connh_t connh, enum iscsi_param param, switch(param) { case ISCSI_PARAM_MAX_RECV_DLENGTH: { char *saveptr = conn->data; - gfp_t flags = GFP_KERNEL; + int flags = GFP_KERNEL; if (conn->data_size >= value) { conn->max_recv_dlength = value; diff --git a/trunk/drivers/scsi/iscsi_tcp.h b/trunk/drivers/scsi/iscsi_tcp.h index 855f2dfd18af..d23ae68fae0d 100644 --- a/trunk/drivers/scsi/iscsi_tcp.h +++ b/trunk/drivers/scsi/iscsi_tcp.h @@ -71,8 +71,7 @@ #define ISCSI_MGMT_CMDS_MAX 32 /* must be power of 2 */ #define ISCSI_MGMT_ITT_OFFSET 0xa00 #define ISCSI_SG_TABLESIZE SG_ALL -#define ISCSI_DEF_CMD_PER_LUN 32 -#define ISCSI_MAX_CMD_PER_LUN 128 +#define ISCSI_CMD_PER_LUN 128 #define ISCSI_TCP_MAX_CMD_LEN 16 #define ITT_MASK (0xfff) diff --git a/trunk/drivers/scsi/libata-core.c b/trunk/drivers/scsi/libata-core.c index d0a0fdbd0fc4..ba1eb8b38e00 100644 --- a/trunk/drivers/scsi/libata-core.c +++ b/trunk/drivers/scsi/libata-core.c @@ -1046,30 +1046,6 @@ static unsigned int ata_pio_modes(const struct ata_device *adev) return modes; } -static int ata_qc_wait_err(struct ata_queued_cmd *qc, - struct completion *wait) -{ - int rc = 0; - - if (wait_for_completion_timeout(wait, 30 * HZ) < 1) { - /* timeout handling */ - unsigned int err_mask = ac_err_mask(ata_chk_status(qc->ap)); - - if (!err_mask) { - printk(KERN_WARNING "ata%u: slow completion (cmd %x)\n", - qc->ap->id, qc->tf.command); - } else { - printk(KERN_WARNING "ata%u: qc timeout (cmd %x)\n", - qc->ap->id, qc->tf.command); - rc = -EIO; - } - - ata_qc_complete(qc, err_mask); - } - - return rc; -} - /** * ata_dev_identify - obtain IDENTIFY x DEVICE page * @ap: port on which device we wish to probe resides @@ -1149,7 +1125,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device) if (rc) goto err_out; else - ata_qc_wait_err(qc, &wait); + wait_for_completion(&wait); spin_lock_irqsave(&ap->host_set->lock, flags); ap->ops->tf_read(ap, &qc->tf); @@ -1594,13 +1570,11 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed, /* * Find the mode. - */ + */ if (!(s = ata_timing_find_mode(speed))) return -EINVAL; - memcpy(t, s, sizeof(*s)); - /* * If the drive is an EIDE drive, it can tell us it needs extended * PIO/MW_DMA cycle timing. @@ -1621,7 +1595,7 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed, * Convert the timing to bus clock counts. */ - ata_timing_quantize(t, t, T, UT); + ata_timing_quantize(s, t, T, UT); /* * Even in DMA/UDMA modes we still use PIO access for IDENTIFY, S.M.A.R.T @@ -2293,7 +2267,7 @@ static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev) if (rc) ata_port_disable(ap); else - ata_qc_wait_err(qc, &wait); + wait_for_completion(&wait); DPRINTK("EXIT\n"); } @@ -2341,7 +2315,7 @@ static void ata_dev_reread_id(struct ata_port *ap, struct ata_device *dev) if (rc) goto err_out; - ata_qc_wait_err(qc, &wait); + wait_for_completion(&wait); swap_buf_le16(dev->id, ATA_ID_WORDS); @@ -2397,7 +2371,7 @@ static void ata_dev_init_params(struct ata_port *ap, struct ata_device *dev) if (rc) ata_port_disable(ap); else - ata_qc_wait_err(qc, &wait); + wait_for_completion(&wait); DPRINTK("EXIT\n"); } @@ -2443,7 +2417,7 @@ static void ata_sg_clean(struct ata_queued_cmd *qc) struct scatterlist *psg = &qc->pad_sgent; void *addr = kmap_atomic(psg->page, KM_IRQ0); memcpy(addr + psg->offset, pad_buf, qc->pad_len); - kunmap_atomic(addr, KM_IRQ0); + kunmap_atomic(psg->page, KM_IRQ0); } } else { if (sg_dma_len(&sg[0]) > 0) @@ -2717,7 +2691,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc) if (qc->tf.flags & ATA_TFLAG_WRITE) { void *addr = kmap_atomic(psg->page, KM_IRQ0); memcpy(pad_buf, addr + psg->offset, qc->pad_len); - kunmap_atomic(addr, KM_IRQ0); + kunmap_atomic(psg->page, KM_IRQ0); } sg_dma_address(psg) = ap->pad_dma + (qc->tag * ATA_DMA_PAD_SZ); diff --git a/trunk/drivers/scsi/libata-scsi.c b/trunk/drivers/scsi/libata-scsi.c index 2282c04fee46..3b4ca55a3332 100644 --- a/trunk/drivers/scsi/libata-scsi.c +++ b/trunk/drivers/scsi/libata-scsi.c @@ -2044,7 +2044,7 @@ static int atapi_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask) else { u8 *scsicmd = cmd->cmnd; - if ((scsicmd[0] == INQUIRY) && ((scsicmd[1] & 0x03) == 0)) { + if (scsicmd[0] == INQUIRY) { u8 *buf = NULL; unsigned int buflen; @@ -2057,6 +2057,9 @@ static int atapi_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask) * to indicate to the Linux scsi midlayer this is a modern * device. 2) Ensure response data format / ATAPI information * are always correct. + */ + /* FIXME: do we ever override EVPD pages and the like, with + * this code? */ if (buf[2] == 0) { buf[2] = 0x5; @@ -2170,12 +2173,9 @@ ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev) if (unlikely(!ata_dev_present(dev))) return NULL; - if (!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) { - if (unlikely(dev->class == ATA_DEV_ATAPI)) { - printk(KERN_WARNING "ata%u(%u): WARNING: ATAPI is %s, device ignored.\n", - ap->id, dev->devno, atapi_enabled ? "not supported with this driver" : "disabled"); + if (!atapi_enabled) { + if (unlikely(dev->class == ATA_DEV_ATAPI)) return NULL; - } } return dev; @@ -2239,7 +2239,7 @@ ata_scsi_pass_thru(struct ata_queued_cmd *qc, const u8 *scsicmd) struct scsi_cmnd *cmd = qc->scsicmd; if ((tf->protocol = ata_scsi_map_proto(scsicmd[1])) == ATA_PROT_UNKNOWN) - goto invalid_fld; + return 1; /* * 12 and 16 byte CDBs use different offsets to @@ -2301,7 +2301,7 @@ ata_scsi_pass_thru(struct ata_queued_cmd *qc, const u8 *scsicmd) */ if ((tf->command == ATA_CMD_SET_FEATURES) && (tf->feature == SETFEATURES_XFER)) - goto invalid_fld; + return 1; /* * Set flags so that all registers will be written, @@ -2322,11 +2322,6 @@ ata_scsi_pass_thru(struct ata_queued_cmd *qc, const u8 *scsicmd) qc->nsect = cmd->bufflen / ATA_SECT_SIZE; return 0; - - invalid_fld: - ata_scsi_set_sense(qc->scsicmd, ILLEGAL_REQUEST, 0x24, 0x00); - /* "Invalid field in cdb" */ - return 1; } /** diff --git a/trunk/drivers/scsi/libata.h b/trunk/drivers/scsi/libata.h index 8ebaa694d18e..74a84e0ec0a4 100644 --- a/trunk/drivers/scsi/libata.h +++ b/trunk/drivers/scsi/libata.h @@ -29,7 +29,7 @@ #define __LIBATA_H__ #define DRV_NAME "libata" -#define DRV_VERSION "1.20" /* must be exactly four chars */ +#define DRV_VERSION "1.12" /* must be exactly four chars */ struct ata_scsi_args { u16 *id; diff --git a/trunk/drivers/scsi/lpfc/lpfc.h b/trunk/drivers/scsi/lpfc/lpfc.h index 38ffa8d6e629..3062b39fbdb9 100644 --- a/trunk/drivers/scsi/lpfc/lpfc.h +++ b/trunk/drivers/scsi/lpfc/lpfc.h @@ -29,10 +29,9 @@ struct lpfc_sli2_slim; #define LPFC_LC_HBA_Q_DEPTH 1024 /* max cmds per low cost hba */ #define LPFC_LP101_HBA_Q_DEPTH 128 /* max cmds per low cost hba */ -#define LPFC_CMD_PER_LUN 3 /* max outstanding cmds per lun */ +#define LPFC_CMD_PER_LUN 30 /* max outstanding cmds per lun */ #define LPFC_SG_SEG_CNT 64 /* sg element count per scsi cmnd */ #define LPFC_IOCB_LIST_CNT 2250 /* list of IOCBs for fast-path usage. */ -#define LPFC_Q_RAMP_UP_INTERVAL 120 /* lun q_depth ramp up interval */ /* Define macros for 64 bit support */ #define putPaddrLow(addr) ((uint32_t) (0xffffffff & (u64)(addr))) @@ -46,11 +45,6 @@ struct lpfc_sli2_slim; #define MAX_HBAEVT 32 -enum lpfc_polling_flags { - ENABLE_FCP_RING_POLLING = 0x1, - DISABLE_FCP_RING_INT = 0x2 -}; - /* Provide DMA memory definitions the driver uses per port instance. */ struct lpfc_dmabuf { struct list_head list; @@ -173,7 +167,6 @@ struct lpfc_hba { dma_addr_t slim2p_mapping; uint16_t pci_cfg_value; - struct semaphore hba_can_block; uint32_t hba_state; #define LPFC_INIT_START 1 /* Initial state after board reset */ @@ -293,8 +286,6 @@ struct lpfc_hba { uint32_t cfg_fcp_bind_method; uint32_t cfg_discovery_threads; uint32_t cfg_max_luns; - uint32_t cfg_poll; - uint32_t cfg_poll_tmo; uint32_t cfg_sg_seg_cnt; uint32_t cfg_sg_dma_buf_size; @@ -346,9 +337,7 @@ struct lpfc_hba { #define VPD_PORT 0x8 /* valid vpd port data */ #define VPD_MASK 0xf /* mask for any vpd data */ - struct timer_list fcp_poll_timer; struct timer_list els_tmofunc; - /* * stat counters */ @@ -359,7 +348,6 @@ struct lpfc_hba { struct lpfc_sysfs_mbox sysfs_mbox; /* fastpath list. */ - spinlock_t scsi_buf_list_lock; struct list_head lpfc_scsi_buf_list; uint32_t total_scsi_bufs; struct list_head lpfc_iocb_list; diff --git a/trunk/drivers/scsi/lpfc/lpfc_attr.c b/trunk/drivers/scsi/lpfc/lpfc_attr.c index 5625a8c2a8fd..89e8222bc7cc 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_attr.c +++ b/trunk/drivers/scsi/lpfc/lpfc_attr.c @@ -278,71 +278,6 @@ lpfc_board_online_store(struct class_device *cdev, const char *buf, return -EIO; } -static ssize_t -lpfc_poll_show(struct class_device *cdev, char *buf) -{ - struct Scsi_Host *host = class_to_shost(cdev); - struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; - - return snprintf(buf, PAGE_SIZE, "%#x\n", phba->cfg_poll); -} - -static ssize_t -lpfc_poll_store(struct class_device *cdev, const char *buf, - size_t count) -{ - struct Scsi_Host *host = class_to_shost(cdev); - struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; - uint32_t creg_val; - uint32_t old_val; - int val=0; - - if (!isdigit(buf[0])) - return -EINVAL; - - if (sscanf(buf, "%i", &val) != 1) - return -EINVAL; - - if ((val & 0x3) != val) - return -EINVAL; - - spin_lock_irq(phba->host->host_lock); - - old_val = phba->cfg_poll; - - if (val & ENABLE_FCP_RING_POLLING) { - if ((val & DISABLE_FCP_RING_INT) && - !(old_val & DISABLE_FCP_RING_INT)) { - creg_val = readl(phba->HCregaddr); - creg_val &= ~(HC_R0INT_ENA << LPFC_FCP_RING); - writel(creg_val, phba->HCregaddr); - readl(phba->HCregaddr); /* flush */ - - lpfc_poll_start_timer(phba); - } - } else if (val != 0x0) { - spin_unlock_irq(phba->host->host_lock); - return -EINVAL; - } - - if (!(val & DISABLE_FCP_RING_INT) && - (old_val & DISABLE_FCP_RING_INT)) - { - spin_unlock_irq(phba->host->host_lock); - del_timer(&phba->fcp_poll_timer); - spin_lock_irq(phba->host->host_lock); - creg_val = readl(phba->HCregaddr); - creg_val |= (HC_R0INT_ENA << LPFC_FCP_RING); - writel(creg_val, phba->HCregaddr); - readl(phba->HCregaddr); /* flush */ - } - - phba->cfg_poll = val; - - spin_unlock_irq(phba->host->host_lock); - - return strlen(buf); -} #define lpfc_param_show(attr) \ static ssize_t \ @@ -481,15 +416,6 @@ static CLASS_DEVICE_ATTR(management_version, S_IRUGO, management_version_show, static CLASS_DEVICE_ATTR(board_online, S_IRUGO | S_IWUSR, lpfc_board_online_show, lpfc_board_online_store); -static int lpfc_poll = 0; -module_param(lpfc_poll, int, 0); -MODULE_PARM_DESC(lpfc_poll, "FCP ring polling mode control:" - " 0 - none," - " 1 - poll with interrupts enabled" - " 3 - poll and disable FCP ring interrupts"); - -static CLASS_DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR, - lpfc_poll_show, lpfc_poll_store); /* # lpfc_log_verbose: Only turn this flag on if you are willing to risk being @@ -597,10 +523,10 @@ LPFC_ATTR_R(ack0, 0, 0, 1, "Enable ACK0 support"); # is 0. Default value of cr_count is 1. The cr_count feature is disabled if # cr_delay is set to 0. */ -LPFC_ATTR_RW(cr_delay, 0, 0, 63, "A count of milliseconds after which an" +LPFC_ATTR(cr_delay, 0, 0, 63, "A count of milliseconds after which an" "interrupt response is generated"); -LPFC_ATTR_RW(cr_count, 1, 1, 255, "A count of I/O completions after which an" +LPFC_ATTR(cr_count, 1, 1, 255, "A count of I/O completions after which an" "interrupt response is generated"); /* @@ -627,13 +553,6 @@ LPFC_ATTR(discovery_threads, 32, 1, 64, "Maximum number of ELS commands" LPFC_ATTR_R(max_luns, 256, 1, 32768, "Maximum number of LUNs per target driver will support"); -/* -# lpfc_poll_tmo: .Milliseconds driver will wait between polling FCP ring. -# Value range is [1,255], default value is 10. -*/ -LPFC_ATTR_RW(poll_tmo, 10, 1, 255, - "Milliseconds driver will wait between polling FCP ring"); - struct class_device_attribute *lpfc_host_attrs[] = { &class_device_attr_info, &class_device_attr_serialnum, @@ -656,15 +575,11 @@ struct class_device_attribute *lpfc_host_attrs[] = { &class_device_attr_lpfc_topology, &class_device_attr_lpfc_scan_down, &class_device_attr_lpfc_link_speed, - &class_device_attr_lpfc_cr_delay, - &class_device_attr_lpfc_cr_count, &class_device_attr_lpfc_fdmi_on, &class_device_attr_lpfc_max_luns, &class_device_attr_nport_evt_cnt, &class_device_attr_management_version, &class_device_attr_board_online, - &class_device_attr_lpfc_poll, - &class_device_attr_lpfc_poll_tmo, NULL, }; @@ -1377,9 +1292,6 @@ lpfc_get_cfgparam(struct lpfc_hba *phba) lpfc_fdmi_on_init(phba, lpfc_fdmi_on); lpfc_discovery_threads_init(phba, lpfc_discovery_threads); lpfc_max_luns_init(phba, lpfc_max_luns); - lpfc_poll_tmo_init(phba, lpfc_poll_tmo); - - phba->cfg_poll = lpfc_poll; /* * The total number of segments is the configuration value plus 2 diff --git a/trunk/drivers/scsi/lpfc/lpfc_crtn.h b/trunk/drivers/scsi/lpfc/lpfc_crtn.h index f1e708946e66..d527d05a607f 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_crtn.h +++ b/trunk/drivers/scsi/lpfc/lpfc_crtn.h @@ -143,9 +143,6 @@ LPFC_MBOXQ_t *lpfc_mbox_get(struct lpfc_hba *); int lpfc_mem_alloc(struct lpfc_hba *); void lpfc_mem_free(struct lpfc_hba *); -void lpfc_poll_timeout(unsigned long ptr); -void lpfc_poll_start_timer(struct lpfc_hba * phba); -void lpfc_sli_poll_fcp_ring(struct lpfc_hba * hba); struct lpfc_iocbq * lpfc_sli_get_iocbq(struct lpfc_hba *); void lpfc_sli_release_iocbq(struct lpfc_hba * phba, struct lpfc_iocbq * iocb); uint16_t lpfc_sli_next_iotag(struct lpfc_hba * phba, struct lpfc_iocbq * iocb); diff --git a/trunk/drivers/scsi/lpfc/lpfc_disc.h b/trunk/drivers/scsi/lpfc/lpfc_disc.h index ed6c81660e03..084e7628ce17 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_disc.h +++ b/trunk/drivers/scsi/lpfc/lpfc_disc.h @@ -73,8 +73,6 @@ struct lpfc_nodelist { struct lpfc_hba *nlp_phba; struct lpfc_work_evt nodev_timeout_evt; struct lpfc_work_evt els_retry_evt; - unsigned long last_ramp_up_time; /* jiffy of last ramp up */ - unsigned long last_q_full_time; /* jiffy of last queue full */ }; /* Defines for nlp_flag (uint32) */ diff --git a/trunk/drivers/scsi/lpfc/lpfc_els.c b/trunk/drivers/scsi/lpfc/lpfc_els.c index 20f1a0713db2..bcc29ec126dc 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_els.c +++ b/trunk/drivers/scsi/lpfc/lpfc_els.c @@ -720,7 +720,6 @@ lpfc_cmpl_els_plogi(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && ((irsp->un.ulpWord[4] == IOERR_SLI_ABORTED) || - (irsp->un.ulpWord[4] == IOERR_LINK_DOWN) || (irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) { disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC); } @@ -870,7 +869,6 @@ lpfc_cmpl_els_prli(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && ((irsp->un.ulpWord[4] == IOERR_SLI_ABORTED) || - (irsp->un.ulpWord[4] == IOERR_LINK_DOWN) || (irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) { goto out; } @@ -1056,7 +1054,6 @@ lpfc_cmpl_els_adisc(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && ((irsp->un.ulpWord[4] == IOERR_SLI_ABORTED) || - (irsp->un.ulpWord[4] == IOERR_LINK_DOWN) || (irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) { disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC); } @@ -1208,7 +1205,6 @@ lpfc_cmpl_els_logo(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && ((irsp->un.ulpWord[4] == IOERR_SLI_ABORTED) || - (irsp->un.ulpWord[4] == IOERR_LINK_DOWN) || (irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) { goto out; } diff --git a/trunk/drivers/scsi/lpfc/lpfc_hbadisc.c b/trunk/drivers/scsi/lpfc/lpfc_hbadisc.c index a1f751e79405..259eeb161b82 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/trunk/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -1017,7 +1017,12 @@ lpfc_register_remote_port(struct lpfc_hba * phba, rport_ids.port_name = wwn_to_u64(ndlp->nlp_portname.u.wwn); rport_ids.port_id = ndlp->nlp_DID; rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; + if (ndlp->nlp_type & NLP_FCP_TARGET) + rport_ids.roles |= FC_RPORT_ROLE_FCP_TARGET; + if (ndlp->nlp_type & NLP_FCP_INITIATOR) + rport_ids.roles |= FC_RPORT_ROLE_FCP_INITIATOR; + scsi_block_requests(phba->host); ndlp->rport = rport = fc_remote_port_add(phba->host, 0, &rport_ids); if (!rport) { dev_printk(KERN_WARNING, &phba->pcidev->dev, @@ -1034,16 +1039,7 @@ lpfc_register_remote_port(struct lpfc_hba * phba, } rdata = rport->dd_data; rdata->pnode = ndlp; - - if (ndlp->nlp_type & NLP_FCP_TARGET) - rport_ids.roles |= FC_RPORT_ROLE_FCP_TARGET; - if (ndlp->nlp_type & NLP_FCP_INITIATOR) - rport_ids.roles |= FC_RPORT_ROLE_FCP_INITIATOR; - - - if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN) - fc_remote_port_rolechg(rport, rport_ids.roles); - + scsi_unblock_requests(phba->host); return; } @@ -1057,7 +1053,9 @@ lpfc_unregister_remote_port(struct lpfc_hba * phba, ndlp->rport = NULL; rdata->pnode = NULL; + scsi_block_requests(phba->host); fc_remote_port_delete(rport); + scsi_unblock_requests(phba->host); return; } diff --git a/trunk/drivers/scsi/lpfc/lpfc_hw.h b/trunk/drivers/scsi/lpfc/lpfc_hw.h index 1ea565e0561f..86c41981188b 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_hw.h +++ b/trunk/drivers/scsi/lpfc/lpfc_hw.h @@ -266,11 +266,9 @@ struct lpfc_name { struct { #ifdef __BIG_ENDIAN_BITFIELD uint8_t nameType:4; /* FC Word 0, bit 28:31 */ - uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit - 8:11 of IEEE ext */ + uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit 8:11 of IEEE ext */ #else /* __LITTLE_ENDIAN_BITFIELD */ - uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit - 8:11 of IEEE ext */ + uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit 8:11 of IEEE ext */ uint8_t nameType:4; /* FC Word 0, bit 28:31 */ #endif @@ -280,8 +278,7 @@ struct lpfc_name { #define NAME_IP_TYPE 0x4 /* IP address */ #define NAME_CCITT_TYPE 0xC #define NAME_CCITT_GR_TYPE 0xE - uint8_t IEEEextLsb; /* FC Word 0, bit 16:23, IEEE - extended Lsb */ + uint8_t IEEEextLsb; /* FC Word 0, bit 16:23, IEEE extended Lsb */ uint8_t IEEE[6]; /* FC IEEE address */ } s; uint8_t wwn[8]; @@ -1027,38 +1024,23 @@ typedef struct { /* Start FireFly Register definitions */ #define PCI_VENDOR_ID_EMULEX 0x10df #define PCI_DEVICE_ID_FIREFLY 0x1ae5 +#define PCI_DEVICE_ID_SUPERFLY 0xf700 +#define PCI_DEVICE_ID_DRAGONFLY 0xf800 #define PCI_DEVICE_ID_RFLY 0xf095 #define PCI_DEVICE_ID_PFLY 0xf098 -#define PCI_DEVICE_ID_LP101 0xf0a1 #define PCI_DEVICE_ID_TFLY 0xf0a5 -#define PCI_DEVICE_ID_BSMB 0xf0d1 -#define PCI_DEVICE_ID_BMID 0xf0d5 -#define PCI_DEVICE_ID_ZSMB 0xf0e1 -#define PCI_DEVICE_ID_ZMID 0xf0e5 -#define PCI_DEVICE_ID_NEPTUNE 0xf0f5 -#define PCI_DEVICE_ID_NEPTUNE_SCSP 0xf0f6 -#define PCI_DEVICE_ID_NEPTUNE_DCSP 0xf0f7 -#define PCI_DEVICE_ID_SUPERFLY 0xf700 -#define PCI_DEVICE_ID_DRAGONFLY 0xf800 #define PCI_DEVICE_ID_CENTAUR 0xf900 #define PCI_DEVICE_ID_PEGASUS 0xf980 #define PCI_DEVICE_ID_THOR 0xfa00 #define PCI_DEVICE_ID_VIPER 0xfb00 -#define PCI_DEVICE_ID_LP10000S 0xfc00 -#define PCI_DEVICE_ID_LP11000S 0xfc10 -#define PCI_DEVICE_ID_LPE11000S 0xfc20 #define PCI_DEVICE_ID_HELIOS 0xfd00 -#define PCI_DEVICE_ID_HELIOS_SCSP 0xfd11 -#define PCI_DEVICE_ID_HELIOS_DCSP 0xfd12 +#define PCI_DEVICE_ID_BMID 0xf0d5 +#define PCI_DEVICE_ID_BSMB 0xf0d1 #define PCI_DEVICE_ID_ZEPHYR 0xfe00 -#define PCI_DEVICE_ID_ZEPHYR_SCSP 0xfe11 -#define PCI_DEVICE_ID_ZEPHYR_DCSP 0xfe12 - -#define PCI_SUBSYSTEM_ID_LP11000S 0xfc11 -#define PCI_SUBSYSTEM_ID_LP11002S 0xfc12 -#define PCI_SUBSYSTEM_ID_LPE11000S 0xfc21 -#define PCI_SUBSYSTEM_ID_LPE11002S 0xfc22 -#define PCI_SUBSYSTEM_ID_LPE11010S 0xfc2A +#define PCI_DEVICE_ID_ZMID 0xf0e5 +#define PCI_DEVICE_ID_ZSMB 0xf0e1 +#define PCI_DEVICE_ID_LP101 0xf0a1 +#define PCI_DEVICE_ID_LP10000S 0xfc00 #define JEDEC_ID_ADDRESS 0x0080001c #define FIREFLY_JEDEC_ID 0x1ACC diff --git a/trunk/drivers/scsi/lpfc/lpfc_init.c b/trunk/drivers/scsi/lpfc/lpfc_init.c index b7a603a45328..07498118359d 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_init.c +++ b/trunk/drivers/scsi/lpfc/lpfc_init.c @@ -126,26 +126,34 @@ lpfc_config_port_prep(struct lpfc_hba * phba) return -ERESTART; } - /* - * The value of rr must be 1 since the driver set the cv field to 1. - * This setting requires the FW to set all revision fields. + /* The HBA's current state is provided by the ProgType and rr fields. + * Read and check the value of these fields before continuing to config + * this port. */ - if (mb->un.varRdRev.rr == 0) { + if (mb->un.varRdRev.rr == 0 || mb->un.varRdRev.un.b.ProgType != 2) { + /* Old firmware */ vp->rev.rBit = 0; - lpfc_printf_log(phba, KERN_ERR, LOG_INIT, - "%d:0440 Adapter failed to init, READ_REV has " - "missing revision information.\n", - phba->brd_no); + lpfc_printf_log(phba, + KERN_ERR, + LOG_INIT, + "%d:0440 Adapter failed to init, mbxCmd x%x " + "READ_REV detected outdated firmware" + "Data: x%x\n", + phba->brd_no, + mb->mbxCommand, 0); mempool_free(pmb, phba->mbox_mem_pool); return -ERESTART; + } else { + vp->rev.rBit = 1; + vp->rev.sli1FwRev = mb->un.varRdRev.sli1FwRev; + memcpy(vp->rev.sli1FwName, + (char*)mb->un.varRdRev.sli1FwName, 16); + vp->rev.sli2FwRev = mb->un.varRdRev.sli2FwRev; + memcpy(vp->rev.sli2FwName, + (char *)mb->un.varRdRev.sli2FwName, 16); } /* Save information as VPD data */ - vp->rev.rBit = 1; - vp->rev.sli1FwRev = mb->un.varRdRev.sli1FwRev; - memcpy(vp->rev.sli1FwName, (char*) mb->un.varRdRev.sli1FwName, 16); - vp->rev.sli2FwRev = mb->un.varRdRev.sli2FwRev; - memcpy(vp->rev.sli2FwName, (char *) mb->un.varRdRev.sli2FwName, 16); vp->rev.biuRev = mb->un.varRdRev.biuRev; vp->rev.smRev = mb->un.varRdRev.smRev; vp->rev.smFwRev = mb->un.varRdRev.un.smFwRev; @@ -370,10 +378,6 @@ lpfc_config_port_post(struct lpfc_hba * phba) if (psli->num_rings > 3) status |= HC_R3INT_ENA; - if ((phba->cfg_poll & ENABLE_FCP_RING_POLLING) && - (phba->cfg_poll & DISABLE_FCP_RING_INT)) - status &= ~(HC_R0INT_ENA << LPFC_FCP_RING); - writel(status, phba->HCregaddr); readl(phba->HCregaddr); /* flush */ spin_unlock_irq(phba->host->host_lock); @@ -567,8 +571,6 @@ lpfc_handle_latt(struct lpfc_hba * phba) rc = -EIO; - /* Cleanup any outstanding ELS commands */ - lpfc_els_flush_cmd(phba); psli->slistat.link_event++; lpfc_read_la(phba, pmb, mp); @@ -763,139 +765,96 @@ static void lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) { lpfc_vpd_t *vp; - uint16_t dev_id = phba->pcidev->device; - uint16_t dev_subid = phba->pcidev->subsystem_device; - uint8_t hdrtype = phba->pcidev->hdr_type; - char *model_str = ""; + uint32_t id; + uint8_t hdrtype; + char str[16]; vp = &phba->vpd; + pci_read_config_dword(phba->pcidev, PCI_VENDOR_ID, &id); + pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype); - switch (dev_id) { + switch ((id >> 16) & 0xffff) { case PCI_DEVICE_ID_FIREFLY: - model_str = "LP6000 1Gb PCI"; + strcpy(str, "LP6000 1"); break; case PCI_DEVICE_ID_SUPERFLY: if (vp->rev.biuRev >= 1 && vp->rev.biuRev <= 3) - model_str = "LP7000 1Gb PCI"; + strcpy(str, "LP7000 1"); else - model_str = "LP7000E 1Gb PCI"; + strcpy(str, "LP7000E 1"); break; case PCI_DEVICE_ID_DRAGONFLY: - model_str = "LP8000 1Gb PCI"; + strcpy(str, "LP8000 1"); break; case PCI_DEVICE_ID_CENTAUR: if (FC_JEDEC_ID(vp->rev.biuRev) == CENTAUR_2G_JEDEC_ID) - model_str = "LP9002 2Gb PCI"; + strcpy(str, "LP9002 2"); else - model_str = "LP9000 1Gb PCI"; + strcpy(str, "LP9000 1"); break; case PCI_DEVICE_ID_RFLY: - model_str = "LP952 2Gb PCI"; + strcpy(str, "LP952 2"); break; case PCI_DEVICE_ID_PEGASUS: - model_str = "LP9802 2Gb PCI-X"; + strcpy(str, "LP9802 2"); break; case PCI_DEVICE_ID_THOR: if (hdrtype == 0x80) - model_str = "LP10000DC 2Gb 2-port PCI-X"; + strcpy(str, "LP10000DC 2"); else - model_str = "LP10000 2Gb PCI-X"; + strcpy(str, "LP10000 2"); break; case PCI_DEVICE_ID_VIPER: - model_str = "LPX1000 10Gb PCI-X"; + strcpy(str, "LPX1000 10"); break; case PCI_DEVICE_ID_PFLY: - model_str = "LP982 2Gb PCI-X"; + strcpy(str, "LP982 2"); break; case PCI_DEVICE_ID_TFLY: if (hdrtype == 0x80) - model_str = "LP1050DC 2Gb 2-port PCI-X"; + strcpy(str, "LP1050DC 2"); else - model_str = "LP1050 2Gb PCI-X"; + strcpy(str, "LP1050 2"); break; case PCI_DEVICE_ID_HELIOS: if (hdrtype == 0x80) - model_str = "LP11002 4Gb 2-port PCI-X2"; - else - model_str = "LP11000 4Gb PCI-X2"; - break; - case PCI_DEVICE_ID_HELIOS_SCSP: - model_str = "LP11000-SP 4Gb PCI-X2"; - break; - case PCI_DEVICE_ID_HELIOS_DCSP: - model_str = "LP11002-SP 4Gb 2-port PCI-X2"; - break; - case PCI_DEVICE_ID_NEPTUNE: - if (hdrtype == 0x80) - model_str = "LPe1002 4Gb 2-port"; + strcpy(str, "LP11002 4"); else - model_str = "LPe1000 4Gb PCIe"; - break; - case PCI_DEVICE_ID_NEPTUNE_SCSP: - model_str = "LPe1000-SP 4Gb PCIe"; - break; - case PCI_DEVICE_ID_NEPTUNE_DCSP: - model_str = "LPe1002-SP 4Gb 2-port PCIe"; + strcpy(str, "LP11000 4"); break; case PCI_DEVICE_ID_BMID: - model_str = "LP1150 4Gb PCI-X2"; + strcpy(str, "LP1150 4"); break; case PCI_DEVICE_ID_BSMB: - model_str = "LP111 4Gb PCI-X2"; + strcpy(str, "LP111 4"); break; case PCI_DEVICE_ID_ZEPHYR: if (hdrtype == 0x80) - model_str = "LPe11002 4Gb 2-port PCIe"; + strcpy(str, "LPe11002 4"); else - model_str = "LPe11000 4Gb PCIe"; - break; - case PCI_DEVICE_ID_ZEPHYR_SCSP: - model_str = "LPe11000-SP 4Gb PCIe"; - break; - case PCI_DEVICE_ID_ZEPHYR_DCSP: - model_str = "LPe11002-SP 4Gb 2-port PCIe"; + strcpy(str, "LPe11000 4"); break; case PCI_DEVICE_ID_ZMID: - model_str = "LPe1150 4Gb PCIe"; + strcpy(str, "LPe1150 4"); break; case PCI_DEVICE_ID_ZSMB: - model_str = "LPe111 4Gb PCIe"; + strcpy(str, "LPe111 4"); break; case PCI_DEVICE_ID_LP101: - model_str = "LP101 2Gb PCI-X"; + strcpy(str, "LP101 2"); break; case PCI_DEVICE_ID_LP10000S: - model_str = "LP10000-S 2Gb PCI"; - break; - case PCI_DEVICE_ID_LP11000S: - case PCI_DEVICE_ID_LPE11000S: - switch (dev_subid) { - case PCI_SUBSYSTEM_ID_LP11000S: - model_str = "LP11002-S 4Gb PCI-X2"; - break; - case PCI_SUBSYSTEM_ID_LP11002S: - model_str = "LP11000-S 4Gb 2-port PCI-X2"; - break; - case PCI_SUBSYSTEM_ID_LPE11000S: - model_str = "LPe11002-S 4Gb PCIe"; - break; - case PCI_SUBSYSTEM_ID_LPE11002S: - model_str = "LPe11002-S 4Gb 2-port PCIe"; - break; - case PCI_SUBSYSTEM_ID_LPE11010S: - model_str = "LPe11010-S 4Gb 10-port PCIe"; - break; - default: - break; - } + strcpy(str, "LP10000-S 2"); break; default: + memset(str, 0, 16); break; } if (mdp) - sscanf(model_str, "%s", mdp); + sscanf(str, "%s", mdp); if (descp) - sprintf(descp, "Emulex %s Fibre Channel Adapter", model_str); + sprintf(descp, "Emulex LightPulse %s Gigabit PCI Fibre " + "Channel Adapter", str); } /**************************************************/ @@ -1237,7 +1196,6 @@ lpfc_stop_timer(struct lpfc_hba * phba) } } - del_timer_sync(&phba->fcp_poll_timer); del_timer_sync(&phba->fc_estabtmo); del_timer_sync(&phba->fc_disctmo); del_timer_sync(&phba->fc_fdmitmo); @@ -1393,7 +1351,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) goto out_put_host; host->unique_id = phba->brd_no; - init_MUTEX(&phba->hba_can_block); + INIT_LIST_HEAD(&phba->ctrspbuflist); INIT_LIST_HEAD(&phba->rnidrspbuflist); INIT_LIST_HEAD(&phba->freebufList); @@ -1417,10 +1375,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) psli->mbox_tmo.function = lpfc_mbox_timeout; psli->mbox_tmo.data = (unsigned long)phba; - init_timer(&phba->fcp_poll_timer); - phba->fcp_poll_timer.function = lpfc_poll_timeout; - phba->fcp_poll_timer.data = (unsigned long)phba; - /* * Get all the module params for configuring this host and then * establish the host parameters. @@ -1535,7 +1489,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) host->max_cmd_len = 16; /* Initialize the list of scsi buffers used by driver for scsi IO. */ - spin_lock_init(&phba->scsi_buf_list_lock); INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list); host->transportt = lpfc_transport_template; @@ -1567,12 +1520,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) if (error) goto out_free_irq; - if (phba->cfg_poll & DISABLE_FCP_RING_INT) { - spin_lock_irq(phba->host->host_lock); - lpfc_poll_start_timer(phba); - spin_unlock_irq(phba->host->host_lock); - } - /* * set fixed host attributes * Must done after lpfc_sli_hba_setup() @@ -1732,28 +1679,14 @@ static struct pci_device_id lpfc_id_table[] = { PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_PFLY, PCI_ANY_ID, PCI_ANY_ID, }, - {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_NEPTUNE, - PCI_ANY_ID, PCI_ANY_ID, }, - {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_NEPTUNE_SCSP, - PCI_ANY_ID, PCI_ANY_ID, }, - {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_NEPTUNE_DCSP, - PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_HELIOS, PCI_ANY_ID, PCI_ANY_ID, }, - {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_HELIOS_SCSP, - PCI_ANY_ID, PCI_ANY_ID, }, - {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_HELIOS_DCSP, - PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_BMID, PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_BSMB, PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR, PCI_ANY_ID, PCI_ANY_ID, }, - {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR_SCSP, - PCI_ANY_ID, PCI_ANY_ID, }, - {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR_DCSP, - PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZMID, PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZSMB, @@ -1764,10 +1697,6 @@ static struct pci_device_id lpfc_id_table[] = { PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LP10000S, PCI_ANY_ID, PCI_ANY_ID, }, - {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LP11000S, - PCI_ANY_ID, PCI_ANY_ID, }, - {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LPE11000S, - PCI_ANY_ID, PCI_ANY_ID, }, { 0 } }; diff --git a/trunk/drivers/scsi/lpfc/lpfc_nportdisc.c b/trunk/drivers/scsi/lpfc/lpfc_nportdisc.c index fbead786031f..507a6af56f42 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/trunk/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -55,76 +55,55 @@ lpfc_check_adisc(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, return (1); } + int lpfc_check_sparm(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, struct serv_parm * sp, uint32_t class) { volatile struct serv_parm *hsp = &phba->fc_sparam; - uint16_t hsp_value, ssp_value = 0; - - /* - * The receive data field size and buffer-to-buffer receive data field - * size entries are 16 bits but are represented as two 8-bit fields in - * the driver data structure to account for rsvd bits and other control - * bits. Reconstruct and compare the fields as a 16-bit values before - * correcting the byte values. - */ + /* First check for supported version */ + + /* Next check for class validity */ if (sp->cls1.classValid) { - hsp_value = (hsp->cls1.rcvDataSizeMsb << 8) | - hsp->cls1.rcvDataSizeLsb; - ssp_value = (sp->cls1.rcvDataSizeMsb << 8) | - sp->cls1.rcvDataSizeLsb; - if (ssp_value > hsp_value) { - sp->cls1.rcvDataSizeLsb = hsp->cls1.rcvDataSizeLsb; + + if (sp->cls1.rcvDataSizeMsb > hsp->cls1.rcvDataSizeMsb) sp->cls1.rcvDataSizeMsb = hsp->cls1.rcvDataSizeMsb; - } + if (sp->cls1.rcvDataSizeLsb > hsp->cls1.rcvDataSizeLsb) + sp->cls1.rcvDataSizeLsb = hsp->cls1.rcvDataSizeLsb; } else if (class == CLASS1) { - return 0; + return (0); } if (sp->cls2.classValid) { - hsp_value = (hsp->cls2.rcvDataSizeMsb << 8) | - hsp->cls2.rcvDataSizeLsb; - ssp_value = (sp->cls2.rcvDataSizeMsb << 8) | - sp->cls2.rcvDataSizeLsb; - if (ssp_value > hsp_value) { - sp->cls2.rcvDataSizeLsb = hsp->cls2.rcvDataSizeLsb; + + if (sp->cls2.rcvDataSizeMsb > hsp->cls2.rcvDataSizeMsb) sp->cls2.rcvDataSizeMsb = hsp->cls2.rcvDataSizeMsb; - } + if (sp->cls2.rcvDataSizeLsb > hsp->cls2.rcvDataSizeLsb) + sp->cls2.rcvDataSizeLsb = hsp->cls2.rcvDataSizeLsb; } else if (class == CLASS2) { - return 0; + return (0); } if (sp->cls3.classValid) { - hsp_value = (hsp->cls3.rcvDataSizeMsb << 8) | - hsp->cls3.rcvDataSizeLsb; - ssp_value = (sp->cls3.rcvDataSizeMsb << 8) | - sp->cls3.rcvDataSizeLsb; - if (ssp_value > hsp_value) { - sp->cls3.rcvDataSizeLsb = hsp->cls3.rcvDataSizeLsb; + + if (sp->cls3.rcvDataSizeMsb > hsp->cls3.rcvDataSizeMsb) sp->cls3.rcvDataSizeMsb = hsp->cls3.rcvDataSizeMsb; - } + if (sp->cls3.rcvDataSizeLsb > hsp->cls3.rcvDataSizeLsb) + sp->cls3.rcvDataSizeLsb = hsp->cls3.rcvDataSizeLsb; } else if (class == CLASS3) { - return 0; + return (0); } - /* - * Preserve the upper four bits of the MSB from the PLOGI response. - * These bits contain the Buffer-to-Buffer State Change Number - * from the target and need to be passed to the FW. - */ - hsp_value = (hsp->cmn.bbRcvSizeMsb << 8) | hsp->cmn.bbRcvSizeLsb; - ssp_value = (sp->cmn.bbRcvSizeMsb << 8) | sp->cmn.bbRcvSizeLsb; - if (ssp_value > hsp_value) { + if (sp->cmn.bbRcvSizeMsb > hsp->cmn.bbRcvSizeMsb) + sp->cmn.bbRcvSizeMsb = hsp->cmn.bbRcvSizeMsb; + if (sp->cmn.bbRcvSizeLsb > hsp->cmn.bbRcvSizeLsb) sp->cmn.bbRcvSizeLsb = hsp->cmn.bbRcvSizeLsb; - sp->cmn.bbRcvSizeMsb = (sp->cmn.bbRcvSizeMsb & 0xF0) | - (hsp->cmn.bbRcvSizeMsb & 0x0F); - } + /* If check is good, copy wwpn wwnn into ndlp */ memcpy(&ndlp->nlp_nodename, &sp->nodeName, sizeof (struct lpfc_name)); memcpy(&ndlp->nlp_portname, &sp->portName, sizeof (struct lpfc_name)); - return 1; + return (1); } static void * diff --git a/trunk/drivers/scsi/lpfc/lpfc_scsi.c b/trunk/drivers/scsi/lpfc/lpfc_scsi.c index 9ee8218404c0..c63275e66e2e 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_scsi.c +++ b/trunk/drivers/scsi/lpfc/lpfc_scsi.c @@ -41,20 +41,6 @@ #define LPFC_ABORT_WAIT 2 -static inline void -lpfc_block_requests(struct lpfc_hba * phba) -{ - down(&phba->hba_can_block); - scsi_block_requests(phba->host); -} - -static inline void -lpfc_unblock_requests(struct lpfc_hba * phba) -{ - scsi_unblock_requests(phba->host); - up(&phba->hba_can_block); -} - /* * This routine allocates a scsi buffer, which contains all the necessary * information needed to initiate a SCSI I/O. The non-DMAable buffer region @@ -151,22 +137,18 @@ lpfc_new_scsi_buf(struct lpfc_hba * phba) } struct lpfc_scsi_buf* -lpfc_get_scsi_buf(struct lpfc_hba * phba) +lpfc_sli_get_scsi_buf(struct lpfc_hba * phba) { struct lpfc_scsi_buf * lpfc_cmd = NULL; struct list_head *scsi_buf_list = &phba->lpfc_scsi_buf_list; - unsigned long iflag = 0; - spin_lock_irqsave(&phba->scsi_buf_list_lock, iflag); list_remove_head(scsi_buf_list, lpfc_cmd, struct lpfc_scsi_buf, list); - spin_unlock_irqrestore(&phba->scsi_buf_list_lock, iflag); return lpfc_cmd; } static void lpfc_release_scsi_buf(struct lpfc_hba * phba, struct lpfc_scsi_buf * psb) { - unsigned long iflag = 0; /* * There are only two special cases to consider. (1) the scsi command * requested scatter-gather usage or (2) the scsi command allocated @@ -184,10 +166,8 @@ lpfc_release_scsi_buf(struct lpfc_hba * phba, struct lpfc_scsi_buf * psb) } } - spin_lock_irqsave(&phba->scsi_buf_list_lock, iflag); psb->pCmd = NULL; list_add_tail(&psb->list, &phba->lpfc_scsi_buf_list); - spin_unlock_irqrestore(&phba->scsi_buf_list_lock, iflag); } static int @@ -409,9 +389,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, struct lpfc_rport_data *rdata = lpfc_cmd->rdata; struct lpfc_nodelist *pnode = rdata->pnode; struct scsi_cmnd *cmd = lpfc_cmd->pCmd; - int result; - struct scsi_device *sdev, *tmp_sdev; - int depth = 0; + unsigned long iflag; lpfc_cmd->result = pIocbOut->iocb.un.ulpWord[4]; lpfc_cmd->status = pIocbOut->iocb.ulpStatus; @@ -463,64 +441,11 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, *lp, *(lp + 3), cmd->retries, cmd->resid); } - result = cmd->result; - sdev = cmd->device; cmd->scsi_done(cmd); - if (!result && - ((jiffies - pnode->last_ramp_up_time) > - LPFC_Q_RAMP_UP_INTERVAL * HZ) && - ((jiffies - pnode->last_q_full_time) > - LPFC_Q_RAMP_UP_INTERVAL * HZ) && - (phba->cfg_lun_queue_depth > sdev->queue_depth)) { - shost_for_each_device(tmp_sdev, sdev->host) { - if (phba->cfg_lun_queue_depth > tmp_sdev->queue_depth) { - if (tmp_sdev->id != sdev->id) - continue; - if (tmp_sdev->ordered_tags) - scsi_adjust_queue_depth(tmp_sdev, - MSG_ORDERED_TAG, - tmp_sdev->queue_depth+1); - else - scsi_adjust_queue_depth(tmp_sdev, - MSG_SIMPLE_TAG, - tmp_sdev->queue_depth+1); - - pnode->last_ramp_up_time = jiffies; - } - } - } - - /* - * Check for queue full. If the lun is reporting queue full, then - * back off the lun queue depth to prevent target overloads. - */ - if (result == SAM_STAT_TASK_SET_FULL) { - pnode->last_q_full_time = jiffies; - - shost_for_each_device(tmp_sdev, sdev->host) { - if (tmp_sdev->id != sdev->id) - continue; - depth = scsi_track_queue_full(tmp_sdev, - tmp_sdev->queue_depth - 1); - } - /* - * The queue depth cannot be lowered any more. - * Modify the returned error code to store - * the final depth value set by - * scsi_track_queue_full. - */ - if (depth == -1) - depth = sdev->host->cmd_per_lun; - - if (depth) { - lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, - "%d:0711 detected queue full - lun queue depth " - " adjusted to %d.\n", phba->brd_no, depth); - } - } - + spin_lock_irqsave(phba->host->host_lock, iflag); lpfc_release_scsi_buf(phba, lpfc_cmd); + spin_unlock_irqrestore(phba->host->host_lock, iflag); } static void @@ -768,37 +693,6 @@ lpfc_info(struct Scsi_Host *host) return lpfcinfobuf; } -static __inline__ void lpfc_poll_rearm_timer(struct lpfc_hba * phba) -{ - unsigned long poll_tmo_expires = - (jiffies + msecs_to_jiffies(phba->cfg_poll_tmo)); - - if (phba->sli.ring[LPFC_FCP_RING].txcmplq_cnt) - mod_timer(&phba->fcp_poll_timer, - poll_tmo_expires); -} - -void lpfc_poll_start_timer(struct lpfc_hba * phba) -{ - lpfc_poll_rearm_timer(phba); -} - -void lpfc_poll_timeout(unsigned long ptr) -{ - struct lpfc_hba *phba = (struct lpfc_hba *)ptr; - unsigned long iflag; - - spin_lock_irqsave(phba->host->host_lock, iflag); - - if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { - lpfc_sli_poll_fcp_ring (phba); - if (phba->cfg_poll & DISABLE_FCP_RING_INT) - lpfc_poll_rearm_timer(phba); - } - - spin_unlock_irqrestore(phba->host->host_lock, iflag); -} - static int lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) { @@ -825,11 +719,10 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) cmnd->result = ScsiResult(DID_BUS_BUSY, 0); goto out_fail_command; } - lpfc_cmd = lpfc_get_scsi_buf (phba); + lpfc_cmd = lpfc_sli_get_scsi_buf (phba); if (lpfc_cmd == NULL) { - lpfc_printf_log(phba, KERN_INFO, LOG_FCP, - "%d:0707 driver's buffer pool is empty, " - "IO busied\n", phba->brd_no); + printk(KERN_WARNING "%s: No buffer available - list empty, " + "total count %d\n", __FUNCTION__, phba->total_scsi_bufs); goto out_host_busy; } @@ -853,17 +746,11 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) &lpfc_cmd->cur_iocbq, SLI_IOCB_RET_IOCB); if (err) goto out_host_busy_free_buf; - - if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { - lpfc_sli_poll_fcp_ring(phba); - if (phba->cfg_poll & DISABLE_FCP_RING_INT) - lpfc_poll_rearm_timer(phba); - } - return 0; out_host_busy_free_buf: lpfc_release_scsi_buf(phba, lpfc_cmd); + cmnd->host_scribble = NULL; out_host_busy: return SCSI_MLQUEUE_HOST_BUSY; @@ -872,12 +759,11 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) return 0; } - static int -lpfc_abort_handler(struct scsi_cmnd *cmnd) +__lpfc_abort_handler(struct scsi_cmnd *cmnd) { - struct Scsi_Host *shost = cmnd->device->host; - struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; + struct lpfc_hba *phba = + (struct lpfc_hba *)cmnd->device->host->hostdata[0]; struct lpfc_sli_ring *pring = &phba->sli.ring[phba->sli.fcp_ring]; struct lpfc_iocbq *iocb; struct lpfc_iocbq *abtsiocb; @@ -886,8 +772,6 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) unsigned int loop_count = 0; int ret = SUCCESS; - lpfc_block_requests(phba); - spin_lock_irq(shost->host_lock); lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble; BUG_ON(!lpfc_cmd); @@ -937,15 +821,9 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) goto out; } - if (phba->cfg_poll & DISABLE_FCP_RING_INT) - lpfc_sli_poll_fcp_ring (phba); - /* Wait for abort to complete */ while (lpfc_cmd->pCmd == cmnd) { - if (phba->cfg_poll & DISABLE_FCP_RING_INT) - lpfc_sli_poll_fcp_ring (phba); - spin_unlock_irq(phba->host->host_lock); schedule_timeout_uninterruptible(LPFC_ABORT_WAIT*HZ); spin_lock_irq(phba->host->host_lock); @@ -966,19 +844,26 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) out: lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, - "%d:0749 SCSI Layer I/O Abort Request " - "Status x%x ID %d LUN %d snum %#lx\n", + "%d:0749 SCSI layer issued abort device: ret %#x, " + "ID %d, LUN %d, snum %#lx\n", phba->brd_no, ret, cmnd->device->id, cmnd->device->lun, cmnd->serial_number); - spin_unlock_irq(shost->host_lock); - lpfc_unblock_requests(phba); - return ret; } static int -lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) +lpfc_abort_handler(struct scsi_cmnd *cmnd) +{ + int rc; + spin_lock_irq(cmnd->device->host->host_lock); + rc = __lpfc_abort_handler(cmnd); + spin_unlock_irq(cmnd->device->host->host_lock); + return rc; +} + +static int +__lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) { struct Scsi_Host *shost = cmnd->device->host; struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; @@ -986,12 +871,9 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) struct lpfc_iocbq *iocbq, *iocbqrsp; struct lpfc_rport_data *rdata = cmnd->device->hostdata; struct lpfc_nodelist *pnode = rdata->pnode; - uint32_t cmd_result = 0, cmd_status = 0; int ret = FAILED; int cnt, loopcnt; - lpfc_block_requests(phba); - spin_lock_irq(shost->host_lock); /* * If target is not in a MAPPED state, delay the reset until * target is rediscovered or nodev timeout expires. @@ -1009,7 +891,7 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) break; } - lpfc_cmd = lpfc_get_scsi_buf (phba); + lpfc_cmd = lpfc_sli_get_scsi_buf (phba); if (lpfc_cmd == NULL) goto out; @@ -1034,28 +916,26 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) if (ret == IOCB_SUCCESS) ret = SUCCESS; - - cmd_result = iocbqrsp->iocb.un.ulpWord[4]; - cmd_status = iocbqrsp->iocb.ulpStatus; - - lpfc_sli_release_iocbq(phba, iocbqrsp); - lpfc_release_scsi_buf(phba, lpfc_cmd); + lpfc_cmd->result = iocbqrsp->iocb.un.ulpWord[4]; + lpfc_cmd->status = iocbqrsp->iocb.ulpStatus; + if (lpfc_cmd->status == IOSTAT_LOCAL_REJECT) + if (lpfc_cmd->result & IOERR_DRVR_MASK) + lpfc_cmd->status = IOSTAT_DRIVER_REJECT; /* - * All outstanding txcmplq I/Os should have been aborted by the device. + * All outstanding txcmplq I/Os should have been aborted by the target. * Unfortunately, some targets do not abide by this forcing the driver * to double check. */ - cnt = lpfc_sli_sum_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], - cmnd->device->id, cmnd->device->lun, - LPFC_CTX_LUN); - if (cnt) - lpfc_sli_abort_iocb(phba, - &phba->sli.ring[phba->sli.fcp_ring], - cmnd->device->id, cmnd->device->lun, - 0, LPFC_CTX_LUN); + lpfc_sli_abort_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], + cmnd->device->id, cmnd->device->lun, 0, + LPFC_CTX_LUN); + loopcnt = 0; - while(cnt) { + while((cnt = lpfc_sli_sum_iocb(phba, + &phba->sli.ring[phba->sli.fcp_ring], + cmnd->device->id, cmnd->device->lun, + LPFC_CTX_LUN))) { spin_unlock_irq(phba->host->host_lock); schedule_timeout_uninterruptible(LPFC_RESET_WAIT*HZ); spin_lock_irq(phba->host->host_lock); @@ -1063,11 +943,6 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) if (++loopcnt > (2 * phba->cfg_nodev_tmo)/LPFC_RESET_WAIT) break; - - cnt = lpfc_sli_sum_iocb(phba, - &phba->sli.ring[phba->sli.fcp_ring], - cmnd->device->id, cmnd->device->lun, - LPFC_CTX_LUN); } if (cnt) { @@ -1077,21 +952,35 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) ret = FAILED; } + lpfc_sli_release_iocbq(phba, iocbqrsp); + out_free_scsi_buf: lpfc_printf_log(phba, KERN_ERR, LOG_FCP, "%d:0713 SCSI layer issued LUN reset (%d, %d) " "Data: x%x x%x x%x\n", - phba->brd_no, cmnd->device->id,cmnd->device->lun, - ret, cmd_status, cmd_result); - + phba->brd_no, lpfc_cmd->pCmd->device->id, + lpfc_cmd->pCmd->device->lun, ret, lpfc_cmd->status, + lpfc_cmd->result); + lpfc_release_scsi_buf(phba, lpfc_cmd); out: - spin_unlock_irq(shost->host_lock); - lpfc_unblock_requests(phba); return ret; } static int -lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) +lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) +{ + int rc; + spin_lock_irq(cmnd->device->host->host_lock); + rc = __lpfc_reset_lun_handler(cmnd); + spin_unlock_irq(cmnd->device->host->host_lock); + return rc; +} + +/* + * Note: midlayer calls this function with the host_lock held + */ +static int +__lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) { struct Scsi_Host *shost = cmnd->device->host; struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; @@ -1102,10 +991,7 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) unsigned int midlayer_id = 0; struct lpfc_scsi_buf * lpfc_cmd; - lpfc_block_requests(phba); - spin_lock_irq(shost->host_lock); - - lpfc_cmd = lpfc_get_scsi_buf(phba); + lpfc_cmd = lpfc_sli_get_scsi_buf (phba); if (lpfc_cmd == NULL) goto out; @@ -1136,31 +1022,18 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) lpfc_cmd->pCmd->device->hostdata = ndlp->rport->dd_data; ret = lpfc_scsi_tgt_reset(lpfc_cmd, phba); if (ret != SUCCESS) { - lpfc_printf_log(phba, KERN_ERR, LOG_FCP, + lpfc_printf_log(phba, KERN_INFO, LOG_FCP, "%d:0713 Bus Reset on target %d failed\n", phba->brd_no, i); err_count++; } } - if (err_count == 0) - ret = SUCCESS; - - lpfc_release_scsi_buf(phba, lpfc_cmd); - - /* - * All outstanding txcmplq I/Os should have been aborted by - * the targets. Unfortunately, some targets do not abide by - * this forcing the driver to double check. - */ cmnd->device->id = midlayer_id; - cnt = lpfc_sli_sum_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], - 0, 0, LPFC_CTX_HOST); - if (cnt) - lpfc_sli_abort_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], - 0, 0, 0, LPFC_CTX_HOST); loopcnt = 0; - while(cnt) { + while((cnt = lpfc_sli_sum_iocb(phba, + &phba->sli.ring[phba->sli.fcp_ring], + 0, 0, LPFC_CTX_HOST))) { spin_unlock_irq(phba->host->host_lock); schedule_timeout_uninterruptible(LPFC_RESET_WAIT*HZ); spin_lock_irq(phba->host->host_lock); @@ -1168,30 +1041,44 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) if (++loopcnt > (2 * phba->cfg_nodev_tmo)/LPFC_RESET_WAIT) break; - - cnt = lpfc_sli_sum_iocb(phba, - &phba->sli.ring[phba->sli.fcp_ring], - 0, 0, LPFC_CTX_HOST); } if (cnt) { - lpfc_printf_log(phba, KERN_ERR, LOG_FCP, + /* flush all outstanding commands on the host */ + i = lpfc_sli_abort_iocb(phba, + &phba->sli.ring[phba->sli.fcp_ring], 0, 0, 0, + LPFC_CTX_HOST); + + lpfc_printf_log(phba, KERN_INFO, LOG_FCP, "%d:0715 Bus Reset I/O flush failure: cnt x%x left x%x\n", phba->brd_no, cnt, i); - ret = FAILED; } + if (cnt == 0) + ret = SUCCESS; + else + ret = FAILED; + + lpfc_release_scsi_buf(phba, lpfc_cmd); lpfc_printf_log(phba, KERN_ERR, LOG_FCP, "%d:0714 SCSI layer issued Bus Reset Data: x%x\n", phba->brd_no, ret); out: - spin_unlock_irq(shost->host_lock); - lpfc_unblock_requests(phba); return ret; } +static int +lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) +{ + int rc; + spin_lock_irq(cmnd->device->host->host_lock); + rc = __lpfc_reset_bus_handler(cmnd); + spin_unlock_irq(cmnd->device->host->host_lock); + return rc; +} + static int lpfc_slave_alloc(struct scsi_device *sdev) { @@ -1240,10 +1127,10 @@ lpfc_slave_alloc(struct scsi_device *sdev) break; } - spin_lock_irqsave(&phba->scsi_buf_list_lock, flags); + spin_lock_irqsave(phba->host->host_lock, flags); phba->total_scsi_bufs++; list_add_tail(&scsi_buf->list, &phba->lpfc_scsi_buf_list); - spin_unlock_irqrestore(&phba->scsi_buf_list_lock, flags); + spin_unlock_irqrestore(phba->host->host_lock, flags); } return 0; } @@ -1267,12 +1154,6 @@ lpfc_slave_configure(struct scsi_device *sdev) */ rport->dev_loss_tmo = phba->cfg_nodev_tmo + 5; - if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { - lpfc_sli_poll_fcp_ring(phba); - if (phba->cfg_poll & DISABLE_FCP_RING_INT) - lpfc_poll_rearm_timer(phba); - } - return 0; } diff --git a/trunk/drivers/scsi/lpfc/lpfc_sli.c b/trunk/drivers/scsi/lpfc/lpfc_sli.c index 7b785ade8b07..e2c08c5d83fb 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_sli.c +++ b/trunk/drivers/scsi/lpfc/lpfc_sli.c @@ -886,182 +886,6 @@ lpfc_sli_process_sol_iocb(struct lpfc_hba * phba, struct lpfc_sli_ring * pring, return rc; } -static void lpfc_sli_rsp_pointers_error(struct lpfc_hba * phba, - struct lpfc_sli_ring * pring) -{ - struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; - /* - * Ring handler: portRspPut is bigger then - * rsp ring - */ - lpfc_printf_log(phba, KERN_ERR, LOG_SLI, - "%d:0312 Ring %d handler: portRspPut %d " - "is bigger then rsp ring %d\n", - phba->brd_no, pring->ringno, - le32_to_cpu(pgp->rspPutInx), - pring->numRiocb); - - phba->hba_state = LPFC_HBA_ERROR; - - /* - * All error attention handlers are posted to - * worker thread - */ - phba->work_ha |= HA_ERATT; - phba->work_hs = HS_FFER3; - if (phba->work_wait) - wake_up(phba->work_wait); - - return; -} - -void lpfc_sli_poll_fcp_ring(struct lpfc_hba * phba) -{ - struct lpfc_sli * psli = &phba->sli; - struct lpfc_sli_ring * pring = &psli->ring[LPFC_FCP_RING]; - IOCB_t *irsp = NULL; - IOCB_t *entry = NULL; - struct lpfc_iocbq *cmdiocbq = NULL; - struct lpfc_iocbq rspiocbq; - struct lpfc_pgp *pgp; - uint32_t status; - uint32_t portRspPut, portRspMax; - int type; - uint32_t rsp_cmpl = 0; - void __iomem *to_slim; - uint32_t ha_copy; - - pring->stats.iocb_event++; - - /* The driver assumes SLI-2 mode */ - pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; - - /* - * The next available response entry should never exceed the maximum - * entries. If it does, treat it as an adapter hardware error. - */ - portRspMax = pring->numRiocb; - portRspPut = le32_to_cpu(pgp->rspPutInx); - if (unlikely(portRspPut >= portRspMax)) { - lpfc_sli_rsp_pointers_error(phba, pring); - return; - } - - rmb(); - while (pring->rspidx != portRspPut) { - - entry = IOCB_ENTRY(pring->rspringaddr, pring->rspidx); - - if (++pring->rspidx >= portRspMax) - pring->rspidx = 0; - - lpfc_sli_pcimem_bcopy((uint32_t *) entry, - (uint32_t *) &rspiocbq.iocb, - sizeof (IOCB_t)); - irsp = &rspiocbq.iocb; - type = lpfc_sli_iocb_cmd_type(irsp->ulpCommand & CMD_IOCB_MASK); - pring->stats.iocb_rsp++; - rsp_cmpl++; - - if (unlikely(irsp->ulpStatus)) { - /* Rsp ring error: IOCB */ - lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, - "%d:0326 Rsp Ring %d error: IOCB Data: " - "x%x x%x x%x x%x x%x x%x x%x x%x\n", - phba->brd_no, pring->ringno, - irsp->un.ulpWord[0], - irsp->un.ulpWord[1], - irsp->un.ulpWord[2], - irsp->un.ulpWord[3], - irsp->un.ulpWord[4], - irsp->un.ulpWord[5], - *(((uint32_t *) irsp) + 6), - *(((uint32_t *) irsp) + 7)); - } - - switch (type) { - case LPFC_ABORT_IOCB: - case LPFC_SOL_IOCB: - /* - * Idle exchange closed via ABTS from port. No iocb - * resources need to be recovered. - */ - if (unlikely(irsp->ulpCommand == CMD_XRI_ABORTED_CX)) { - printk(KERN_INFO "%s: IOCB cmd 0x%x processed." - " Skipping completion\n", __FUNCTION__, - irsp->ulpCommand); - break; - } - - cmdiocbq = lpfc_sli_iocbq_lookup(phba, pring, - &rspiocbq); - if ((cmdiocbq) && (cmdiocbq->iocb_cmpl)) { - (cmdiocbq->iocb_cmpl)(phba, cmdiocbq, - &rspiocbq); - } - break; - default: - if (irsp->ulpCommand == CMD_ADAPTER_MSG) { - char adaptermsg[LPFC_MAX_ADPTMSG]; - memset(adaptermsg, 0, LPFC_MAX_ADPTMSG); - memcpy(&adaptermsg[0], (uint8_t *) irsp, - MAX_MSG_DATA); - dev_warn(&((phba->pcidev)->dev), "lpfc%d: %s", - phba->brd_no, adaptermsg); - } else { - /* Unknown IOCB command */ - lpfc_printf_log(phba, KERN_ERR, LOG_SLI, - "%d:0321 Unknown IOCB command " - "Data: x%x, x%x x%x x%x x%x\n", - phba->brd_no, type, - irsp->ulpCommand, - irsp->ulpStatus, - irsp->ulpIoTag, - irsp->ulpContext); - } - break; - } - - /* - * The response IOCB has been processed. Update the ring - * pointer in SLIM. If the port response put pointer has not - * been updated, sync the pgp->rspPutInx and fetch the new port - * response put pointer. - */ - to_slim = phba->MBslimaddr + - (SLIMOFF + (pring->ringno * 2) + 1) * 4; - writeb(pring->rspidx, to_slim); - - if (pring->rspidx == portRspPut) - portRspPut = le32_to_cpu(pgp->rspPutInx); - } - - ha_copy = readl(phba->HAregaddr); - ha_copy >>= (LPFC_FCP_RING * 4); - - if ((rsp_cmpl > 0) && (ha_copy & HA_R0RE_REQ)) { - pring->stats.iocb_rsp_full++; - status = ((CA_R0ATT | CA_R0RE_RSP) << (LPFC_FCP_RING * 4)); - writel(status, phba->CAregaddr); - readl(phba->CAregaddr); - } - if ((ha_copy & HA_R0CE_RSP) && - (pring->flag & LPFC_CALL_RING_AVAILABLE)) { - pring->flag &= ~LPFC_CALL_RING_AVAILABLE; - pring->stats.iocb_cmd_empty++; - - /* Force update of the local copy of cmdGetInx */ - pring->local_getidx = le32_to_cpu(pgp->cmdGetInx); - lpfc_sli_resume_iocb(phba, pring); - - if ((pring->lpfc_sli_cmd_available)) - (pring->lpfc_sli_cmd_available) (phba, pring); - - } - - return; -} - /* * This routine presumes LPFC_FCP_RING handling and doesn't bother * to check it explicitly. @@ -1093,7 +917,24 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, portRspMax = pring->numRiocb; portRspPut = le32_to_cpu(pgp->rspPutInx); if (unlikely(portRspPut >= portRspMax)) { - lpfc_sli_rsp_pointers_error(phba, pring); + /* + * Ring handler: portRspPut is bigger then + * rsp ring + */ + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, + "%d:0312 Ring %d handler: portRspPut %d " + "is bigger then rsp ring %d\n", + phba->brd_no, pring->ringno, portRspPut, + portRspMax); + + phba->hba_state = LPFC_HBA_ERROR; + + /* All error attention handlers are posted to worker thread */ + phba->work_ha |= HA_ERATT; + phba->work_hs = HS_FFER3; + if (phba->work_wait) + wake_up(phba->work_wait); + spin_unlock_irqrestore(phba->host->host_lock, iflag); return 1; } @@ -1106,10 +947,6 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, * network byte order and pci byte orders are different. */ entry = IOCB_ENTRY(pring->rspringaddr, pring->rspidx); - - if (++pring->rspidx >= portRspMax) - pring->rspidx = 0; - lpfc_sli_pcimem_bcopy((uint32_t *) entry, (uint32_t *) &rspiocbq.iocb, sizeof (IOCB_t)); @@ -1183,6 +1020,9 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, * been updated, sync the pgp->rspPutInx and fetch the new port * response put pointer. */ + if (++pring->rspidx >= portRspMax) + pring->rspidx = 0; + to_slim = phba->MBslimaddr + (SLIMOFF + (pring->ringno * 2) + 1) * 4; writel(pring->rspidx, to_slim); @@ -2775,7 +2615,6 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba * phba, DECLARE_WAIT_QUEUE_HEAD(done_q); long timeleft, timeout_req = 0; int retval = IOCB_SUCCESS; - uint32_t creg_val; /* * If the caller has provided a response iocbq buffer, then context2 @@ -2791,13 +2630,6 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba * phba, piocb->context_un.wait_queue = &done_q; piocb->iocb_flag &= ~LPFC_IO_WAKE; - if (phba->cfg_poll & DISABLE_FCP_RING_INT) { - creg_val = readl(phba->HCregaddr); - creg_val |= (HC_R0INT_ENA << LPFC_FCP_RING); - writel(creg_val, phba->HCregaddr); - readl(phba->HCregaddr); /* flush */ - } - retval = lpfc_sli_issue_iocb(phba, pring, piocb, 0); if (retval == IOCB_SUCCESS) { timeout_req = timeout * HZ; @@ -2831,13 +2663,6 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba * phba, retval = IOCB_ERROR; } - if (phba->cfg_poll & DISABLE_FCP_RING_INT) { - creg_val = readl(phba->HCregaddr); - creg_val &= ~(HC_R0INT_ENA << LPFC_FCP_RING); - writel(creg_val, phba->HCregaddr); - readl(phba->HCregaddr); /* flush */ - } - if (prspiocbq) piocb->context2 = NULL; diff --git a/trunk/drivers/scsi/lpfc/lpfc_version.h b/trunk/drivers/scsi/lpfc/lpfc_version.h index fa681a934ffe..4f0466fbd5f2 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_version.h +++ b/trunk/drivers/scsi/lpfc/lpfc_version.h @@ -18,7 +18,7 @@ * included with this package. * *******************************************************************/ -#define LPFC_DRIVER_VERSION "8.1.1" +#define LPFC_DRIVER_VERSION "8.1.0" #define LPFC_DRIVER_NAME "lpfc" diff --git a/trunk/drivers/scsi/megaraid.c b/trunk/drivers/scsi/megaraid.c index 4a6feb1e5e3d..dfea346b00a5 100644 --- a/trunk/drivers/scsi/megaraid.c +++ b/trunk/drivers/scsi/megaraid.c @@ -2,7 +2,7 @@ * * Linux MegaRAID device driver * - * Copyright (c) 2002 LSI Logic Corporation. + * Copyright © 2002 LSI Logic Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -17,8 +17,7 @@ * Copyright (c) 2003 Christoph Hellwig * - new-style, hotplug-aware pci probing and scsi registration * - * Version : v2.00.4 Mon Nov 14 14:02:43 EST 2005 - Seokmann Ju - * + * Version : v2.00.3 (Feb 19, 2003) - Atul Mukker * * Description: Linux device driver for LSI Logic MegaRAID controller * @@ -52,10 +51,10 @@ #include "megaraid.h" -#define MEGARAID_MODULE_VERSION "2.00.4" +#define MEGARAID_MODULE_VERSION "2.00.3" -MODULE_AUTHOR ("sju@lsil.com"); -MODULE_DESCRIPTION ("LSI Logic MegaRAID legacy driver"); +MODULE_AUTHOR ("LSI Logic Corporation"); +MODULE_DESCRIPTION ("LSI Logic MegaRAID driver"); MODULE_LICENSE ("GPL"); MODULE_VERSION(MEGARAID_MODULE_VERSION); @@ -381,23 +380,23 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) spin_lock_irqsave(&adapter->lock, flags); scb = mega_build_cmd(adapter, scmd, &busy); - if (!scb) - goto out; - - scb->state |= SCB_PENDQ; - list_add_tail(&scb->list, &adapter->pending_list); - /* - * Check if the HBA is in quiescent state, e.g., during a - * delete logical drive opertion. If it is, don't run - * the pending_list. - */ - if (atomic_read(&adapter->quiescent) == 0) - mega_runpendq(adapter); + if(scb) { + scb->state |= SCB_PENDQ; + list_add_tail(&scb->list, &adapter->pending_list); - busy = 0; - out: + /* + * Check if the HBA is in quiescent state, e.g., during a + * delete logical drive opertion. If it is, don't run + * the pending_list. + */ + if(atomic_read(&adapter->quiescent) == 0) { + mega_runpendq(adapter); + } + return 0; + } spin_unlock_irqrestore(&adapter->lock, flags); + return busy; } @@ -665,7 +664,7 @@ mega_build_cmd(adapter_t *adapter, Scsi_Cmnd *cmd, int *busy) sg->offset; } else buf = cmd->request_buffer; - memset(buf, 0, cmd->cmnd[4]); + memset(cmd->request_buffer, 0, cmd->cmnd[4]); if (cmd->use_sg) { struct scatterlist *sg; @@ -4554,7 +4553,7 @@ mega_internal_done(Scsi_Cmnd *scmd) static struct scsi_host_template megaraid_template = { .module = THIS_MODULE, .name = "MegaRAID", - .proc_name = "megaraid_legacy", + .proc_name = "megaraid", .info = megaraid_info, .queuecommand = megaraid_queue, .bios_param = megaraid_biosparam, @@ -4678,6 +4677,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) adapter->flag = flag; spin_lock_init(&adapter->lock); + scsi_assign_lock(host, &adapter->lock); host->cmd_per_lun = max_cmd_per_lun; host->max_sectors = max_sectors_per_io; @@ -5038,12 +5038,22 @@ megaraid_shutdown(struct pci_dev *pdev) } static struct pci_device_id megaraid_pci_tbl[] = { + {PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DISCOVERY, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_PERC4_DI, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, BOARD_64BIT}, + {PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_PERC4_QC_VERDE, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, BOARD_64BIT}, {PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID3, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_AMI_MEGARAID3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_AMI_MEGARAID3, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0,} }; MODULE_DEVICE_TABLE(pci, megaraid_pci_tbl); @@ -5086,7 +5096,7 @@ static int __init megaraid_init(void) * First argument (major) to register_chrdev implies a dynamic * major number allocation. */ - major = register_chrdev(0, "megadev_legacy", &megadev_fops); + major = register_chrdev(0, "megadev", &megadev_fops); if (!major) { printk(KERN_WARNING "megaraid: failed to register char device\n"); @@ -5100,7 +5110,7 @@ static void __exit megaraid_exit(void) /* * Unregister the character device interface to the driver. */ - unregister_chrdev(major, "megadev_legacy"); + unregister_chrdev(major, "megadev"); pci_unregister_driver(&megaraid_pci_driver); diff --git a/trunk/drivers/scsi/megaraid/Kconfig.megaraid b/trunk/drivers/scsi/megaraid/Kconfig.megaraid index 17419e30ffc8..7363e12663ac 100644 --- a/trunk/drivers/scsi/megaraid/Kconfig.megaraid +++ b/trunk/drivers/scsi/megaraid/Kconfig.megaraid @@ -64,6 +64,7 @@ config MEGARAID_MAILBOX To compile this driver as a module, choose M here: the module will be called megaraid_mbox +if MEGARAID_NEWGEN=n config MEGARAID_LEGACY tristate "LSI Logic Legacy MegaRAID Driver" depends on PCI && SCSI @@ -74,6 +75,7 @@ config MEGARAID_LEGACY To compile this driver as a module, choose M here: the module will be called megaraid +endif config MEGARAID_SAS tristate "LSI Logic MegaRAID SAS RAID Module" diff --git a/trunk/drivers/scsi/megaraid/megaraid_mbox.c b/trunk/drivers/scsi/megaraid/megaraid_mbox.c index d18a4bc2498c..4b5d420d2f4d 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_mbox.c +++ b/trunk/drivers/scsi/megaraid/megaraid_mbox.c @@ -10,13 +10,12 @@ * 2 of the License, or (at your option) any later version. * * FILE : megaraid_mbox.c - * Version : v2.20.4.7 (Nov 14 2005) + * Version : v2.20.4.6 (Mar 07 2005) * * Authors: * Atul Mukker * Sreenivas Bagalkote * Manoj Jose - * Seokmann Ju * * List of supported controllers * @@ -137,7 +136,7 @@ static int wait_till_fw_empty(adapter_t *); -MODULE_AUTHOR("sju@lsil.com"); +MODULE_AUTHOR("LSI Logic Corporation"); MODULE_DESCRIPTION("LSI Logic MegaRAID Mailbox Driver"); MODULE_LICENSE("GPL"); MODULE_VERSION(MEGARAID_VERSION); @@ -279,14 +278,68 @@ static struct pci_device_id pci_id_table_g[] = { { PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID3, - PCI_ANY_ID, - PCI_ANY_ID, + PCI_VENDOR_ID_DELL, + PCI_SUBSYS_ID_PERC3_QC, }, { - PCI_VENDOR_ID_LSI_LOGIC, + PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID3, - PCI_ANY_ID, - PCI_ANY_ID, + PCI_VENDOR_ID_DELL, + PCI_SUBSYS_ID_PERC3_DC, + }, + { + PCI_VENDOR_ID_AMI, + PCI_DEVICE_ID_AMI_MEGARAID3, + PCI_VENDOR_ID_DELL, + PCI_SUBSYS_ID_PERC3_SC, + }, + { + PCI_VENDOR_ID_AMI, + PCI_DEVICE_ID_AMI_MEGARAID3, + PCI_VENDOR_ID_AMI, + PCI_SUBSYS_ID_PERC3_SC, + }, + { + PCI_VENDOR_ID_AMI, + PCI_DEVICE_ID_AMI_MEGARAID3, + PCI_VENDOR_ID_AMI, + PCI_SUBSYS_ID_PERC3_DC, + }, + { + PCI_VENDOR_ID_LSI_LOGIC, + PCI_DEVICE_ID_MEGARAID_SCSI_320_0, + PCI_VENDOR_ID_LSI_LOGIC, + PCI_SUBSYS_ID_MEGARAID_SCSI_320_0, + }, + { + PCI_VENDOR_ID_LSI_LOGIC, + PCI_DEVICE_ID_MEGARAID_SCSI_320_1, + PCI_VENDOR_ID_LSI_LOGIC, + PCI_SUBSYS_ID_MEGARAID_SCSI_320_1, + }, + { + PCI_VENDOR_ID_LSI_LOGIC, + PCI_DEVICE_ID_MEGARAID_SCSI_320_2, + PCI_VENDOR_ID_LSI_LOGIC, + PCI_SUBSYS_ID_MEGARAID_SCSI_320_2, + }, + { + PCI_VENDOR_ID_LSI_LOGIC, + PCI_DEVICE_ID_MEGARAID_I4_133_RAID, + PCI_VENDOR_ID_LSI_LOGIC, + PCI_SUBSYS_ID_MEGARAID_I4_133_RAID, + }, + { + PCI_VENDOR_ID_LSI_LOGIC, + PCI_DEVICE_ID_MEGARAID_SATA_150_4, + PCI_VENDOR_ID_LSI_LOGIC, + PCI_SUBSYS_ID_MEGARAID_SATA_150_4, + }, + { + PCI_VENDOR_ID_LSI_LOGIC, + PCI_DEVICE_ID_MEGARAID_SATA_150_6, + PCI_VENDOR_ID_LSI_LOGIC, + PCI_SUBSYS_ID_MEGARAID_SATA_150_6, }, { PCI_VENDOR_ID_LSI_LOGIC, @@ -294,6 +347,18 @@ static struct pci_device_id pci_id_table_g[] = { PCI_ANY_ID, PCI_ANY_ID, }, + { + PCI_VENDOR_ID_LSI_LOGIC, + PCI_DEVICE_ID_INTEL_RAID_SRCS16, + PCI_VENDOR_ID_INTEL, + PCI_SUBSYS_ID_INTEL_RAID_SRCS16, + }, + { + PCI_VENDOR_ID_LSI_LOGIC, + PCI_DEVICE_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK, + PCI_VENDOR_ID_INTEL, + PCI_SUBSYS_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK, + }, {0} /* Terminating entry */ }; MODULE_DEVICE_TABLE(pci, pci_id_table_g); @@ -2920,7 +2985,6 @@ mbox_post_sync_cmd_fast(adapter_t *adapter, uint8_t raw_mbox[]) for (i = 0; i < 0xFFFFF; i++) { if (mbox->numstatus != 0xFF) break; - rmb(); } if (i == 0xFFFFF) { diff --git a/trunk/drivers/scsi/megaraid/megaraid_mbox.h b/trunk/drivers/scsi/megaraid/megaraid_mbox.h index 882fb1a0b575..644b91bdb028 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_mbox.h +++ b/trunk/drivers/scsi/megaraid/megaraid_mbox.h @@ -21,8 +21,8 @@ #include "megaraid_ioctl.h" -#define MEGARAID_VERSION "2.20.4.7" -#define MEGARAID_EXT_VERSION "(Release Date: Mon Nov 14 12:27:22 EST 2005)" +#define MEGARAID_VERSION "2.20.4.6" +#define MEGARAID_EXT_VERSION "(Release Date: Mon Mar 07 12:27:22 EST 2005)" /* diff --git a/trunk/drivers/scsi/ncr53c8xx.c b/trunk/drivers/scsi/ncr53c8xx.c index 32350707b940..243470936fab 100644 --- a/trunk/drivers/scsi/ncr53c8xx.c +++ b/trunk/drivers/scsi/ncr53c8xx.c @@ -131,739 +131,7 @@ #define NAME53C "ncr53c" #define NAME53C8XX "ncr53c8xx" - -/*========================================================== -** -** Debugging tags -** -**========================================================== -*/ - -#define DEBUG_ALLOC (0x0001) -#define DEBUG_PHASE (0x0002) -#define DEBUG_QUEUE (0x0008) -#define DEBUG_RESULT (0x0010) -#define DEBUG_POINTER (0x0020) -#define DEBUG_SCRIPT (0x0040) -#define DEBUG_TINY (0x0080) -#define DEBUG_TIMING (0x0100) -#define DEBUG_NEGO (0x0200) -#define DEBUG_TAGS (0x0400) -#define DEBUG_SCATTER (0x0800) -#define DEBUG_IC (0x1000) - -/* -** Enable/Disable debug messages. -** Can be changed at runtime too. -*/ - -#ifdef SCSI_NCR_DEBUG_INFO_SUPPORT -static int ncr_debug = SCSI_NCR_DEBUG_FLAGS; - #define DEBUG_FLAGS ncr_debug -#else - #define DEBUG_FLAGS SCSI_NCR_DEBUG_FLAGS -#endif - -static inline struct list_head *ncr_list_pop(struct list_head *head) -{ - if (!list_empty(head)) { - struct list_head *elem = head->next; - - list_del(elem); - return elem; - } - - return NULL; -} - -/*========================================================== -** -** Simple power of two buddy-like allocator. -** -** This simple code is not intended to be fast, but to -** provide power of 2 aligned memory allocations. -** Since the SCRIPTS processor only supplies 8 bit -** arithmetic, this allocator allows simple and fast -** address calculations from the SCRIPTS code. -** In addition, cache line alignment is guaranteed for -** power of 2 cache line size. -** Enhanced in linux-2.3.44 to provide a memory pool -** per pcidev to support dynamic dma mapping. (I would -** have preferred a real bus astraction, btw). -** -**========================================================== -*/ - -#define MEMO_SHIFT 4 /* 16 bytes minimum memory chunk */ -#if PAGE_SIZE >= 8192 -#define MEMO_PAGE_ORDER 0 /* 1 PAGE maximum */ -#else -#define MEMO_PAGE_ORDER 1 /* 2 PAGES maximum */ -#endif -#define MEMO_FREE_UNUSED /* Free unused pages immediately */ -#define MEMO_WARN 1 -#define MEMO_GFP_FLAGS GFP_ATOMIC -#define MEMO_CLUSTER_SHIFT (PAGE_SHIFT+MEMO_PAGE_ORDER) -#define MEMO_CLUSTER_SIZE (1UL << MEMO_CLUSTER_SHIFT) -#define MEMO_CLUSTER_MASK (MEMO_CLUSTER_SIZE-1) - -typedef u_long m_addr_t; /* Enough bits to bit-hack addresses */ -typedef struct device *m_bush_t; /* Something that addresses DMAable */ - -typedef struct m_link { /* Link between free memory chunks */ - struct m_link *next; -} m_link_s; - -typedef struct m_vtob { /* Virtual to Bus address translation */ - struct m_vtob *next; - m_addr_t vaddr; - m_addr_t baddr; -} m_vtob_s; -#define VTOB_HASH_SHIFT 5 -#define VTOB_HASH_SIZE (1UL << VTOB_HASH_SHIFT) -#define VTOB_HASH_MASK (VTOB_HASH_SIZE-1) -#define VTOB_HASH_CODE(m) \ - ((((m_addr_t) (m)) >> MEMO_CLUSTER_SHIFT) & VTOB_HASH_MASK) - -typedef struct m_pool { /* Memory pool of a given kind */ - m_bush_t bush; - m_addr_t (*getp)(struct m_pool *); - void (*freep)(struct m_pool *, m_addr_t); - int nump; - m_vtob_s *(vtob[VTOB_HASH_SIZE]); - struct m_pool *next; - struct m_link h[PAGE_SHIFT-MEMO_SHIFT+MEMO_PAGE_ORDER+1]; -} m_pool_s; - -static void *___m_alloc(m_pool_s *mp, int size) -{ - int i = 0; - int s = (1 << MEMO_SHIFT); - int j; - m_addr_t a; - m_link_s *h = mp->h; - - if (size > (PAGE_SIZE << MEMO_PAGE_ORDER)) - return NULL; - - while (size > s) { - s <<= 1; - ++i; - } - - j = i; - while (!h[j].next) { - if (s == (PAGE_SIZE << MEMO_PAGE_ORDER)) { - h[j].next = (m_link_s *)mp->getp(mp); - if (h[j].next) - h[j].next->next = NULL; - break; - } - ++j; - s <<= 1; - } - a = (m_addr_t) h[j].next; - if (a) { - h[j].next = h[j].next->next; - while (j > i) { - j -= 1; - s >>= 1; - h[j].next = (m_link_s *) (a+s); - h[j].next->next = NULL; - } - } -#ifdef DEBUG - printk("___m_alloc(%d) = %p\n", size, (void *) a); -#endif - return (void *) a; -} - -static void ___m_free(m_pool_s *mp, void *ptr, int size) -{ - int i = 0; - int s = (1 << MEMO_SHIFT); - m_link_s *q; - m_addr_t a, b; - m_link_s *h = mp->h; - -#ifdef DEBUG - printk("___m_free(%p, %d)\n", ptr, size); -#endif - - if (size > (PAGE_SIZE << MEMO_PAGE_ORDER)) - return; - - while (size > s) { - s <<= 1; - ++i; - } - - a = (m_addr_t) ptr; - - while (1) { -#ifdef MEMO_FREE_UNUSED - if (s == (PAGE_SIZE << MEMO_PAGE_ORDER)) { - mp->freep(mp, a); - break; - } -#endif - b = a ^ s; - q = &h[i]; - while (q->next && q->next != (m_link_s *) b) { - q = q->next; - } - if (!q->next) { - ((m_link_s *) a)->next = h[i].next; - h[i].next = (m_link_s *) a; - break; - } - q->next = q->next->next; - a = a & b; - s <<= 1; - ++i; - } -} - -static DEFINE_SPINLOCK(ncr53c8xx_lock); - -static void *__m_calloc2(m_pool_s *mp, int size, char *name, int uflags) -{ - void *p; - - p = ___m_alloc(mp, size); - - if (DEBUG_FLAGS & DEBUG_ALLOC) - printk ("new %-10s[%4d] @%p.\n", name, size, p); - - if (p) - memset(p, 0, size); - else if (uflags & MEMO_WARN) - printk (NAME53C8XX ": failed to allocate %s[%d]\n", name, size); - - return p; -} - -#define __m_calloc(mp, s, n) __m_calloc2(mp, s, n, MEMO_WARN) - -static void __m_free(m_pool_s *mp, void *ptr, int size, char *name) -{ - if (DEBUG_FLAGS & DEBUG_ALLOC) - printk ("freeing %-10s[%4d] @%p.\n", name, size, ptr); - - ___m_free(mp, ptr, size); - -} - -/* - * With pci bus iommu support, we use a default pool of unmapped memory - * for memory we donnot need to DMA from/to and one pool per pcidev for - * memory accessed by the PCI chip. `mp0' is the default not DMAable pool. - */ - -static m_addr_t ___mp0_getp(m_pool_s *mp) -{ - m_addr_t m = __get_free_pages(MEMO_GFP_FLAGS, MEMO_PAGE_ORDER); - if (m) - ++mp->nump; - return m; -} - -static void ___mp0_freep(m_pool_s *mp, m_addr_t m) -{ - free_pages(m, MEMO_PAGE_ORDER); - --mp->nump; -} - -static m_pool_s mp0 = {NULL, ___mp0_getp, ___mp0_freep}; - -/* - * DMAable pools. - */ - -/* - * With pci bus iommu support, we maintain one pool per pcidev and a - * hashed reverse table for virtual to bus physical address translations. - */ -static m_addr_t ___dma_getp(m_pool_s *mp) -{ - m_addr_t vp; - m_vtob_s *vbp; - - vbp = __m_calloc(&mp0, sizeof(*vbp), "VTOB"); - if (vbp) { - dma_addr_t daddr; - vp = (m_addr_t) dma_alloc_coherent(mp->bush, - PAGE_SIZE<vaddr = vp; - vbp->baddr = daddr; - vbp->next = mp->vtob[hc]; - mp->vtob[hc] = vbp; - ++mp->nump; - return vp; - } - } - if (vbp) - __m_free(&mp0, vbp, sizeof(*vbp), "VTOB"); - return 0; -} - -static void ___dma_freep(m_pool_s *mp, m_addr_t m) -{ - m_vtob_s **vbpp, *vbp; - int hc = VTOB_HASH_CODE(m); - - vbpp = &mp->vtob[hc]; - while (*vbpp && (*vbpp)->vaddr != m) - vbpp = &(*vbpp)->next; - if (*vbpp) { - vbp = *vbpp; - *vbpp = (*vbpp)->next; - dma_free_coherent(mp->bush, PAGE_SIZE<vaddr, (dma_addr_t)vbp->baddr); - __m_free(&mp0, vbp, sizeof(*vbp), "VTOB"); - --mp->nump; - } -} - -static inline m_pool_s *___get_dma_pool(m_bush_t bush) -{ - m_pool_s *mp; - for (mp = mp0.next; mp && mp->bush != bush; mp = mp->next); - return mp; -} - -static m_pool_s *___cre_dma_pool(m_bush_t bush) -{ - m_pool_s *mp; - mp = __m_calloc(&mp0, sizeof(*mp), "MPOOL"); - if (mp) { - memset(mp, 0, sizeof(*mp)); - mp->bush = bush; - mp->getp = ___dma_getp; - mp->freep = ___dma_freep; - mp->next = mp0.next; - mp0.next = mp; - } - return mp; -} - -static void ___del_dma_pool(m_pool_s *p) -{ - struct m_pool **pp = &mp0.next; - - while (*pp && *pp != p) - pp = &(*pp)->next; - if (*pp) { - *pp = (*pp)->next; - __m_free(&mp0, p, sizeof(*p), "MPOOL"); - } -} - -static void *__m_calloc_dma(m_bush_t bush, int size, char *name) -{ - u_long flags; - struct m_pool *mp; - void *m = NULL; - - spin_lock_irqsave(&ncr53c8xx_lock, flags); - mp = ___get_dma_pool(bush); - if (!mp) - mp = ___cre_dma_pool(bush); - if (mp) - m = __m_calloc(mp, size, name); - if (mp && !mp->nump) - ___del_dma_pool(mp); - spin_unlock_irqrestore(&ncr53c8xx_lock, flags); - - return m; -} - -static void __m_free_dma(m_bush_t bush, void *m, int size, char *name) -{ - u_long flags; - struct m_pool *mp; - - spin_lock_irqsave(&ncr53c8xx_lock, flags); - mp = ___get_dma_pool(bush); - if (mp) - __m_free(mp, m, size, name); - if (mp && !mp->nump) - ___del_dma_pool(mp); - spin_unlock_irqrestore(&ncr53c8xx_lock, flags); -} - -static m_addr_t __vtobus(m_bush_t bush, void *m) -{ - u_long flags; - m_pool_s *mp; - int hc = VTOB_HASH_CODE(m); - m_vtob_s *vp = NULL; - m_addr_t a = ((m_addr_t) m) & ~MEMO_CLUSTER_MASK; - - spin_lock_irqsave(&ncr53c8xx_lock, flags); - mp = ___get_dma_pool(bush); - if (mp) { - vp = mp->vtob[hc]; - while (vp && (m_addr_t) vp->vaddr != a) - vp = vp->next; - } - spin_unlock_irqrestore(&ncr53c8xx_lock, flags); - return vp ? vp->baddr + (((m_addr_t) m) - a) : 0; -} - -#define _m_calloc_dma(np, s, n) __m_calloc_dma(np->dev, s, n) -#define _m_free_dma(np, p, s, n) __m_free_dma(np->dev, p, s, n) -#define m_calloc_dma(s, n) _m_calloc_dma(np, s, n) -#define m_free_dma(p, s, n) _m_free_dma(np, p, s, n) -#define _vtobus(np, p) __vtobus(np->dev, p) -#define vtobus(p) _vtobus(np, p) - -/* - * Deal with DMA mapping/unmapping. - */ - -/* To keep track of the dma mapping (sg/single) that has been set */ -#define __data_mapped SCp.phase -#define __data_mapping SCp.have_data_in - -static void __unmap_scsi_data(struct device *dev, struct scsi_cmnd *cmd) -{ - switch(cmd->__data_mapped) { - case 2: - dma_unmap_sg(dev, cmd->buffer, cmd->use_sg, - cmd->sc_data_direction); - break; - case 1: - dma_unmap_single(dev, cmd->__data_mapping, - cmd->request_bufflen, - cmd->sc_data_direction); - break; - } - cmd->__data_mapped = 0; -} - -static u_long __map_scsi_single_data(struct device *dev, struct scsi_cmnd *cmd) -{ - dma_addr_t mapping; - - if (cmd->request_bufflen == 0) - return 0; - - mapping = dma_map_single(dev, cmd->request_buffer, - cmd->request_bufflen, - cmd->sc_data_direction); - cmd->__data_mapped = 1; - cmd->__data_mapping = mapping; - - return mapping; -} - -static int __map_scsi_sg_data(struct device *dev, struct scsi_cmnd *cmd) -{ - int use_sg; - - if (cmd->use_sg == 0) - return 0; - - use_sg = dma_map_sg(dev, cmd->buffer, cmd->use_sg, - cmd->sc_data_direction); - cmd->__data_mapped = 2; - cmd->__data_mapping = use_sg; - - return use_sg; -} - -#define unmap_scsi_data(np, cmd) __unmap_scsi_data(np->dev, cmd) -#define map_scsi_single_data(np, cmd) __map_scsi_single_data(np->dev, cmd) -#define map_scsi_sg_data(np, cmd) __map_scsi_sg_data(np->dev, cmd) - -/*========================================================== -** -** Driver setup. -** -** This structure is initialized from linux config -** options. It can be overridden at boot-up by the boot -** command line. -** -**========================================================== -*/ -static struct ncr_driver_setup - driver_setup = SCSI_NCR_DRIVER_SETUP; - -#ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT -static struct ncr_driver_setup - driver_safe_setup __initdata = SCSI_NCR_DRIVER_SAFE_SETUP; -#endif - -#define initverbose (driver_setup.verbose) -#define bootverbose (np->verbose) - - -/*=================================================================== -** -** Driver setup from the boot command line -** -**=================================================================== -*/ - -#ifdef MODULE -#define ARG_SEP ' ' -#else -#define ARG_SEP ',' -#endif - -#define OPT_TAGS 1 -#define OPT_MASTER_PARITY 2 -#define OPT_SCSI_PARITY 3 -#define OPT_DISCONNECTION 4 -#define OPT_SPECIAL_FEATURES 5 -#define OPT_UNUSED_1 6 -#define OPT_FORCE_SYNC_NEGO 7 -#define OPT_REVERSE_PROBE 8 -#define OPT_DEFAULT_SYNC 9 -#define OPT_VERBOSE 10 -#define OPT_DEBUG 11 -#define OPT_BURST_MAX 12 -#define OPT_LED_PIN 13 -#define OPT_MAX_WIDE 14 -#define OPT_SETTLE_DELAY 15 -#define OPT_DIFF_SUPPORT 16 -#define OPT_IRQM 17 -#define OPT_PCI_FIX_UP 18 -#define OPT_BUS_CHECK 19 -#define OPT_OPTIMIZE 20 -#define OPT_RECOVERY 21 -#define OPT_SAFE_SETUP 22 -#define OPT_USE_NVRAM 23 -#define OPT_EXCLUDE 24 -#define OPT_HOST_ID 25 - -#ifdef SCSI_NCR_IARB_SUPPORT -#define OPT_IARB 26 -#endif - -static char setup_token[] __initdata = - "tags:" "mpar:" - "spar:" "disc:" - "specf:" "ultra:" - "fsn:" "revprob:" - "sync:" "verb:" - "debug:" "burst:" - "led:" "wide:" - "settle:" "diff:" - "irqm:" "pcifix:" - "buschk:" "optim:" - "recovery:" - "safe:" "nvram:" - "excl:" "hostid:" -#ifdef SCSI_NCR_IARB_SUPPORT - "iarb:" -#endif - ; /* DONNOT REMOVE THIS ';' */ - -#ifdef MODULE -#define ARG_SEP ' ' -#else -#define ARG_SEP ',' -#endif - -static int __init get_setup_token(char *p) -{ - char *cur = setup_token; - char *pc; - int i = 0; - - while (cur != NULL && (pc = strchr(cur, ':')) != NULL) { - ++pc; - ++i; - if (!strncmp(p, cur, pc - cur)) - return i; - cur = pc; - } - return 0; -} - - -static int __init sym53c8xx__setup(char *str) -{ -#ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT - char *cur = str; - char *pc, *pv; - int i, val, c; - int xi = 0; - - while (cur != NULL && (pc = strchr(cur, ':')) != NULL) { - char *pe; - - val = 0; - pv = pc; - c = *++pv; - - if (c == 'n') - val = 0; - else if (c == 'y') - val = 1; - else - val = (int) simple_strtoul(pv, &pe, 0); - - switch (get_setup_token(cur)) { - case OPT_TAGS: - driver_setup.default_tags = val; - if (pe && *pe == '/') { - i = 0; - while (*pe && *pe != ARG_SEP && - i < sizeof(driver_setup.tag_ctrl)-1) { - driver_setup.tag_ctrl[i++] = *pe++; - } - driver_setup.tag_ctrl[i] = '\0'; - } - break; - case OPT_MASTER_PARITY: - driver_setup.master_parity = val; - break; - case OPT_SCSI_PARITY: - driver_setup.scsi_parity = val; - break; - case OPT_DISCONNECTION: - driver_setup.disconnection = val; - break; - case OPT_SPECIAL_FEATURES: - driver_setup.special_features = val; - break; - case OPT_FORCE_SYNC_NEGO: - driver_setup.force_sync_nego = val; - break; - case OPT_REVERSE_PROBE: - driver_setup.reverse_probe = val; - break; - case OPT_DEFAULT_SYNC: - driver_setup.default_sync = val; - break; - case OPT_VERBOSE: - driver_setup.verbose = val; - break; - case OPT_DEBUG: - driver_setup.debug = val; - break; - case OPT_BURST_MAX: - driver_setup.burst_max = val; - break; - case OPT_LED_PIN: - driver_setup.led_pin = val; - break; - case OPT_MAX_WIDE: - driver_setup.max_wide = val? 1:0; - break; - case OPT_SETTLE_DELAY: - driver_setup.settle_delay = val; - break; - case OPT_DIFF_SUPPORT: - driver_setup.diff_support = val; - break; - case OPT_IRQM: - driver_setup.irqm = val; - break; - case OPT_PCI_FIX_UP: - driver_setup.pci_fix_up = val; - break; - case OPT_BUS_CHECK: - driver_setup.bus_check = val; - break; - case OPT_OPTIMIZE: - driver_setup.optimize = val; - break; - case OPT_RECOVERY: - driver_setup.recovery = val; - break; - case OPT_USE_NVRAM: - driver_setup.use_nvram = val; - break; - case OPT_SAFE_SETUP: - memcpy(&driver_setup, &driver_safe_setup, - sizeof(driver_setup)); - break; - case OPT_EXCLUDE: - if (xi < SCSI_NCR_MAX_EXCLUDES) - driver_setup.excludes[xi++] = val; - break; - case OPT_HOST_ID: - driver_setup.host_id = val; - break; -#ifdef SCSI_NCR_IARB_SUPPORT - case OPT_IARB: - driver_setup.iarb = val; - break; -#endif - default: - printk("sym53c8xx_setup: unexpected boot option '%.*s' ignored\n", (int)(pc-cur+1), cur); - break; - } - - if ((cur = strchr(cur, ARG_SEP)) != NULL) - ++cur; - } -#endif /* SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT */ - return 1; -} - -/*=================================================================== -** -** Get device queue depth from boot command line. -** -**=================================================================== -*/ -#define DEF_DEPTH (driver_setup.default_tags) -#define ALL_TARGETS -2 -#define NO_TARGET -1 -#define ALL_LUNS -2 -#define NO_LUN -1 - -static int device_queue_depth(int unit, int target, int lun) -{ - int c, h, t, u, v; - char *p = driver_setup.tag_ctrl; - char *ep; - - h = -1; - t = NO_TARGET; - u = NO_LUN; - while ((c = *p++) != 0) { - v = simple_strtoul(p, &ep, 0); - switch(c) { - case '/': - ++h; - t = ALL_TARGETS; - u = ALL_LUNS; - break; - case 't': - if (t != target) - t = (target == v) ? v : NO_TARGET; - u = ALL_LUNS; - break; - case 'u': - if (u != lun) - u = (lun == v) ? v : NO_LUN; - break; - case 'q': - if (h == unit && - (t == ALL_TARGETS || t == target) && - (u == ALL_LUNS || u == lun)) - return v; - break; - case '-': - t = ALL_TARGETS; - u = ALL_LUNS; - break; - default: - break; - } - p = ep; - } - return DEF_DEPTH; -} +#include "sym53c8xx_comm.h" /*========================================================== @@ -3703,10 +2971,21 @@ struct host_data { static void ncr_print_msg(struct ccb *cp, char *label, u_char *msg) { + int i; PRINT_ADDR(cp->cmd, "%s: ", label); - spi_print_msg(msg); - printk("\n"); + printk ("%x",*msg); + if (*msg == M_EXTENDED) { + for (i = 1; i < 8; i++) { + if (i - 1 > msg[1]) + break; + printk ("-%x",msg[i]); + } + } else if ((*msg & 0xf0) == 0x20) { + printk ("-%x",msg[1]); + } + + printk(".\n"); } /*========================================================== diff --git a/trunk/drivers/scsi/ncr53c8xx.h b/trunk/drivers/scsi/ncr53c8xx.h index 6a7bef2e6118..05c7b83cef09 100644 --- a/trunk/drivers/scsi/ncr53c8xx.h +++ b/trunk/drivers/scsi/ncr53c8xx.h @@ -2,7 +2,6 @@ ** Device driver for the PCI-SCSI NCR538XX controller family. ** ** Copyright (C) 1994 Wolfgang Stanglmeier -** Copyright (C) 1998-2001 Gerard Roudier ** ** 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 @@ -37,1275 +36,15 @@ ** And has been ported to NetBSD by ** Charles M. Hannum ** -** NVRAM detection and reading. -** Copyright (C) 1997 Richard Waltham -** -** Added support for MIPS big endian systems. -** Carsten Langgaard, carstenl@mips.com -** Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. -** -** Added support for HP PARISC big endian systems. -** Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. -** ******************************************************************************* */ #ifndef NCR53C8XX_H #define NCR53C8XX_H -#include #include -/* -** If you want a driver as small as possible, do not define the -** following options. -*/ -#define SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT -#define SCSI_NCR_DEBUG_INFO_SUPPORT - -/* -** To disable integrity checking, do not define the -** following option. -*/ -#ifdef CONFIG_SCSI_NCR53C8XX_INTEGRITY_CHECK -# define SCSI_NCR_ENABLE_INTEGRITY_CHECK -#endif - -/* --------------------------------------------------------------------- -** Take into account kernel configured parameters. -** Most of these options can be overridden at startup by a command line. -** --------------------------------------------------------------------- -*/ - -/* - * For Ultra2 and Ultra3 SCSI support option, use special features. - * - * Value (default) means: - * bit 0 : all features enabled, except: - * bit 1 : PCI Write And Invalidate. - * bit 2 : Data Phase Mismatch handling from SCRIPTS. - * - * Use boot options ncr53c8xx=specf:1 if you want all chip features to be - * enabled by the driver. - */ -#define SCSI_NCR_SETUP_SPECIAL_FEATURES (3) - -#define SCSI_NCR_MAX_SYNC (80) - -/* - * Allow tags from 2 to 256, default 8 - */ -#ifdef CONFIG_SCSI_NCR53C8XX_MAX_TAGS -#if CONFIG_SCSI_NCR53C8XX_MAX_TAGS < 2 -#define SCSI_NCR_MAX_TAGS (2) -#elif CONFIG_SCSI_NCR53C8XX_MAX_TAGS > 256 -#define SCSI_NCR_MAX_TAGS (256) -#else -#define SCSI_NCR_MAX_TAGS CONFIG_SCSI_NCR53C8XX_MAX_TAGS -#endif -#else -#define SCSI_NCR_MAX_TAGS (8) -#endif - -/* - * Allow tagged command queuing support if configured with default number - * of tags set to max (see above). - */ -#ifdef CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS -#define SCSI_NCR_SETUP_DEFAULT_TAGS CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS -#elif defined CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE -#define SCSI_NCR_SETUP_DEFAULT_TAGS SCSI_NCR_MAX_TAGS -#else -#define SCSI_NCR_SETUP_DEFAULT_TAGS (0) -#endif - -/* - * Immediate arbitration - */ -#if defined(CONFIG_SCSI_NCR53C8XX_IARB) -#define SCSI_NCR_IARB_SUPPORT -#endif - -/* - * Sync transfer frequency at startup. - * Allow from 5Mhz to 80Mhz default 20 Mhz. - */ -#ifndef CONFIG_SCSI_NCR53C8XX_SYNC -#define CONFIG_SCSI_NCR53C8XX_SYNC (20) -#elif CONFIG_SCSI_NCR53C8XX_SYNC > SCSI_NCR_MAX_SYNC -#undef CONFIG_SCSI_NCR53C8XX_SYNC -#define CONFIG_SCSI_NCR53C8XX_SYNC SCSI_NCR_MAX_SYNC -#endif - -#if CONFIG_SCSI_NCR53C8XX_SYNC == 0 -#define SCSI_NCR_SETUP_DEFAULT_SYNC (255) -#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 5 -#define SCSI_NCR_SETUP_DEFAULT_SYNC (50) -#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 20 -#define SCSI_NCR_SETUP_DEFAULT_SYNC (250/(CONFIG_SCSI_NCR53C8XX_SYNC)) -#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 33 -#define SCSI_NCR_SETUP_DEFAULT_SYNC (11) -#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 40 -#define SCSI_NCR_SETUP_DEFAULT_SYNC (10) -#else -#define SCSI_NCR_SETUP_DEFAULT_SYNC (9) -#endif - -/* - * Disallow disconnections at boot-up - */ -#ifdef CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT -#define SCSI_NCR_SETUP_DISCONNECTION (0) -#else -#define SCSI_NCR_SETUP_DISCONNECTION (1) -#endif - -/* - * Force synchronous negotiation for all targets - */ -#ifdef CONFIG_SCSI_NCR53C8XX_FORCE_SYNC_NEGO -#define SCSI_NCR_SETUP_FORCE_SYNC_NEGO (1) -#else -#define SCSI_NCR_SETUP_FORCE_SYNC_NEGO (0) -#endif - -/* - * Disable master parity checking (flawed hardwares need that) - */ -#ifdef CONFIG_SCSI_NCR53C8XX_DISABLE_MPARITY_CHECK -#define SCSI_NCR_SETUP_MASTER_PARITY (0) -#else -#define SCSI_NCR_SETUP_MASTER_PARITY (1) -#endif - -/* - * Disable scsi parity checking (flawed devices may need that) - */ -#ifdef CONFIG_SCSI_NCR53C8XX_DISABLE_PARITY_CHECK -#define SCSI_NCR_SETUP_SCSI_PARITY (0) -#else -#define SCSI_NCR_SETUP_SCSI_PARITY (1) -#endif - -/* - * Settle time after reset at boot-up - */ -#define SCSI_NCR_SETUP_SETTLE_TIME (2) - -/* -** Bridge quirks work-around option defaulted to 1. -*/ -#ifndef SCSI_NCR_PCIQ_WORK_AROUND_OPT -#define SCSI_NCR_PCIQ_WORK_AROUND_OPT 1 -#endif - -/* -** Work-around common bridge misbehaviour. -** -** - Do not flush posted writes in the opposite -** direction on read. -** - May reorder DMA writes to memory. -** -** This option should not affect performances -** significantly, so it is the default. -*/ -#if SCSI_NCR_PCIQ_WORK_AROUND_OPT == 1 -#define SCSI_NCR_PCIQ_MAY_NOT_FLUSH_PW_UPSTREAM -#define SCSI_NCR_PCIQ_MAY_REORDER_WRITES -#define SCSI_NCR_PCIQ_MAY_MISS_COMPLETIONS - -/* -** Same as option 1, but also deal with -** misconfigured interrupts. -** -** - Edge triggerred instead of level sensitive. -** - No interrupt line connected. -** - IRQ number misconfigured. -** -** If no interrupt is delivered, the driver will -** catch the interrupt conditions 10 times per -** second. No need to say that this option is -** not recommended. -*/ -#elif SCSI_NCR_PCIQ_WORK_AROUND_OPT == 2 -#define SCSI_NCR_PCIQ_MAY_NOT_FLUSH_PW_UPSTREAM -#define SCSI_NCR_PCIQ_MAY_REORDER_WRITES -#define SCSI_NCR_PCIQ_MAY_MISS_COMPLETIONS -#define SCSI_NCR_PCIQ_BROKEN_INTR - -/* -** Some bridge designers decided to flush -** everything prior to deliver the interrupt. -** This option tries to deal with such a -** behaviour. -*/ -#elif SCSI_NCR_PCIQ_WORK_AROUND_OPT == 3 -#define SCSI_NCR_PCIQ_SYNC_ON_INTR -#endif - -/* -** Other parameters not configurable with "make config" -** Avoid to change these constants, unless you know what you are doing. -*/ - -#define SCSI_NCR_ALWAYS_SIMPLE_TAG -#define SCSI_NCR_MAX_SCATTER (127) -#define SCSI_NCR_MAX_TARGET (16) - -/* -** Compute some desirable value for CAN_QUEUE -** and CMD_PER_LUN. -** The driver will use lower values if these -** ones appear to be too large. -*/ -#define SCSI_NCR_CAN_QUEUE (8*SCSI_NCR_MAX_TAGS + 2*SCSI_NCR_MAX_TARGET) -#define SCSI_NCR_CMD_PER_LUN (SCSI_NCR_MAX_TAGS) - -#define SCSI_NCR_SG_TABLESIZE (SCSI_NCR_MAX_SCATTER) -#define SCSI_NCR_TIMER_INTERVAL (HZ) - -#if 1 /* defined CONFIG_SCSI_MULTI_LUN */ -#define SCSI_NCR_MAX_LUN (16) -#else -#define SCSI_NCR_MAX_LUN (1) -#endif - -/* - * IO functions definition for big/little endian CPU support. - * For now, the NCR is only supported in little endian addressing mode, - */ - -#ifdef __BIG_ENDIAN - -#define inw_l2b inw -#define inl_l2b inl -#define outw_b2l outw -#define outl_b2l outl - -#define readb_raw readb -#define writeb_raw writeb - -#if defined(SCSI_NCR_BIG_ENDIAN) -#define readw_l2b __raw_readw -#define readl_l2b __raw_readl -#define writew_b2l __raw_writew -#define writel_b2l __raw_writel -#define readw_raw __raw_readw -#define readl_raw __raw_readl -#define writew_raw __raw_writew -#define writel_raw __raw_writel -#else /* Other big-endian */ -#define readw_l2b readw -#define readl_l2b readl -#define writew_b2l writew -#define writel_b2l writel -#define readw_raw readw -#define readl_raw readl -#define writew_raw writew -#define writel_raw writel -#endif - -#else /* little endian */ - -#define inw_raw inw -#define inl_raw inl -#define outw_raw outw -#define outl_raw outl - -#define readb_raw readb -#define readw_raw readw -#define readl_raw readl -#define writeb_raw writeb -#define writew_raw writew -#define writel_raw writel - -#endif - -#if !defined(__hppa__) && !defined(__mips__) -#ifdef SCSI_NCR_BIG_ENDIAN -#error "The NCR in BIG ENDIAN addressing mode is not (yet) supported" -#endif -#endif - -#define MEMORY_BARRIER() mb() - - -/* - * If the NCR uses big endian addressing mode over the - * PCI, actual io register addresses for byte and word - * accesses must be changed according to lane routing. - * Btw, ncr_offb() and ncr_offw() macros only apply to - * constants and so donnot generate bloated code. - */ - -#if defined(SCSI_NCR_BIG_ENDIAN) - -#define ncr_offb(o) (((o)&~3)+((~((o)&3))&3)) -#define ncr_offw(o) (((o)&~3)+((~((o)&3))&2)) - -#else - -#define ncr_offb(o) (o) -#define ncr_offw(o) (o) - -#endif - -/* - * If the CPU and the NCR use same endian-ness addressing, - * no byte reordering is needed for script patching. - * Macro cpu_to_scr() is to be used for script patching. - * Macro scr_to_cpu() is to be used for getting a DWORD - * from the script. - */ - -#if defined(__BIG_ENDIAN) && !defined(SCSI_NCR_BIG_ENDIAN) - -#define cpu_to_scr(dw) cpu_to_le32(dw) -#define scr_to_cpu(dw) le32_to_cpu(dw) - -#elif defined(__LITTLE_ENDIAN) && defined(SCSI_NCR_BIG_ENDIAN) - -#define cpu_to_scr(dw) cpu_to_be32(dw) -#define scr_to_cpu(dw) be32_to_cpu(dw) - -#else - -#define cpu_to_scr(dw) (dw) -#define scr_to_cpu(dw) (dw) - -#endif - -/* - * Access to the controller chip. - * - * If the CPU and the NCR use same endian-ness addressing, - * no byte reordering is needed for accessing chip io - * registers. Functions suffixed by '_raw' are assumed - * to access the chip over the PCI without doing byte - * reordering. Functions suffixed by '_l2b' are - * assumed to perform little-endian to big-endian byte - * reordering, those suffixed by '_b2l' blah, blah, - * blah, ... - */ - -/* - * MEMORY mapped IO input / output - */ - -#define INB_OFF(o) readb_raw((char __iomem *)np->reg + ncr_offb(o)) -#define OUTB_OFF(o, val) writeb_raw((val), (char __iomem *)np->reg + ncr_offb(o)) - -#if defined(__BIG_ENDIAN) && !defined(SCSI_NCR_BIG_ENDIAN) - -#define INW_OFF(o) readw_l2b((char __iomem *)np->reg + ncr_offw(o)) -#define INL_OFF(o) readl_l2b((char __iomem *)np->reg + (o)) - -#define OUTW_OFF(o, val) writew_b2l((val), (char __iomem *)np->reg + ncr_offw(o)) -#define OUTL_OFF(o, val) writel_b2l((val), (char __iomem *)np->reg + (o)) - -#elif defined(__LITTLE_ENDIAN) && defined(SCSI_NCR_BIG_ENDIAN) - -#define INW_OFF(o) readw_b2l((char __iomem *)np->reg + ncr_offw(o)) -#define INL_OFF(o) readl_b2l((char __iomem *)np->reg + (o)) - -#define OUTW_OFF(o, val) writew_l2b((val), (char __iomem *)np->reg + ncr_offw(o)) -#define OUTL_OFF(o, val) writel_l2b((val), (char __iomem *)np->reg + (o)) - -#else - -#ifdef CONFIG_SCSI_NCR53C8XX_NO_WORD_TRANSFERS -/* Only 8 or 32 bit transfers allowed */ -#define INW_OFF(o) (readb((char __iomem *)np->reg + ncr_offw(o)) << 8 | readb((char __iomem *)np->reg + ncr_offw(o) + 1)) -#else -#define INW_OFF(o) readw_raw((char __iomem *)np->reg + ncr_offw(o)) -#endif -#define INL_OFF(o) readl_raw((char __iomem *)np->reg + (o)) - -#ifdef CONFIG_SCSI_NCR53C8XX_NO_WORD_TRANSFERS -/* Only 8 or 32 bit transfers allowed */ -#define OUTW_OFF(o, val) do { writeb((char)((val) >> 8), (char __iomem *)np->reg + ncr_offw(o)); writeb((char)(val), (char __iomem *)np->reg + ncr_offw(o) + 1); } while (0) -#else -#define OUTW_OFF(o, val) writew_raw((val), (char __iomem *)np->reg + ncr_offw(o)) -#endif -#define OUTL_OFF(o, val) writel_raw((val), (char __iomem *)np->reg + (o)) - -#endif - -#define INB(r) INB_OFF (offsetof(struct ncr_reg,r)) -#define INW(r) INW_OFF (offsetof(struct ncr_reg,r)) -#define INL(r) INL_OFF (offsetof(struct ncr_reg,r)) - -#define OUTB(r, val) OUTB_OFF (offsetof(struct ncr_reg,r), (val)) -#define OUTW(r, val) OUTW_OFF (offsetof(struct ncr_reg,r), (val)) -#define OUTL(r, val) OUTL_OFF (offsetof(struct ncr_reg,r), (val)) - -/* - * Set bit field ON, OFF - */ - -#define OUTONB(r, m) OUTB(r, INB(r) | (m)) -#define OUTOFFB(r, m) OUTB(r, INB(r) & ~(m)) -#define OUTONW(r, m) OUTW(r, INW(r) | (m)) -#define OUTOFFW(r, m) OUTW(r, INW(r) & ~(m)) -#define OUTONL(r, m) OUTL(r, INL(r) | (m)) -#define OUTOFFL(r, m) OUTL(r, INL(r) & ~(m)) - -/* - * We normally want the chip to have a consistent view - * of driver internal data structures when we restart it. - * Thus these macros. - */ -#define OUTL_DSP(v) \ - do { \ - MEMORY_BARRIER(); \ - OUTL (nc_dsp, (v)); \ - } while (0) - -#define OUTONB_STD() \ - do { \ - MEMORY_BARRIER(); \ - OUTONB (nc_dcntl, (STD|NOCOM)); \ - } while (0) - - -/* -** NCR53C8XX devices features table. -*/ -struct ncr_chip { - unsigned short revision_id; - unsigned char burst_max; /* log-base-2 of max burst */ - unsigned char offset_max; - unsigned char nr_divisor; - unsigned int features; -#define FE_LED0 (1<<0) -#define FE_WIDE (1<<1) /* Wide data transfers */ -#define FE_ULTRA (1<<2) /* Ultra speed 20Mtrans/sec */ -#define FE_DBLR (1<<4) /* Clock doubler present */ -#define FE_QUAD (1<<5) /* Clock quadrupler present */ -#define FE_ERL (1<<6) /* Enable read line */ -#define FE_CLSE (1<<7) /* Cache line size enable */ -#define FE_WRIE (1<<8) /* Write & Invalidate enable */ -#define FE_ERMP (1<<9) /* Enable read multiple */ -#define FE_BOF (1<<10) /* Burst opcode fetch */ -#define FE_DFS (1<<11) /* DMA fifo size */ -#define FE_PFEN (1<<12) /* Prefetch enable */ -#define FE_LDSTR (1<<13) /* Load/Store supported */ -#define FE_RAM (1<<14) /* On chip RAM present */ -#define FE_VARCLK (1<<15) /* SCSI clock may vary */ -#define FE_RAM8K (1<<16) /* On chip RAM sized 8Kb */ -#define FE_64BIT (1<<17) /* Have a 64-bit PCI interface */ -#define FE_IO256 (1<<18) /* Requires full 256 bytes in PCI space */ -#define FE_NOPM (1<<19) /* Scripts handles phase mismatch */ -#define FE_LEDC (1<<20) /* Hardware control of LED */ -#define FE_DIFF (1<<21) /* Support Differential SCSI */ -#define FE_66MHZ (1<<23) /* 66MHz PCI Support */ -#define FE_DAC (1<<24) /* Support DAC cycles (64 bit addressing) */ -#define FE_ISTAT1 (1<<25) /* Have ISTAT1, MBOX0, MBOX1 registers */ -#define FE_DAC_IN_USE (1<<26) /* Platform does DAC cycles */ -#define FE_EHP (1<<27) /* 720: Even host parity */ -#define FE_MUX (1<<28) /* 720: Multiplexed bus */ -#define FE_EA (1<<29) /* 720: Enable Ack */ - -#define FE_CACHE_SET (FE_ERL|FE_CLSE|FE_WRIE|FE_ERMP) -#define FE_SCSI_SET (FE_WIDE|FE_ULTRA|FE_DBLR|FE_QUAD|F_CLK80) -#define FE_SPECIAL_SET (FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM) -}; - - -/* -** Driver setup structure. -** -** This structure is initialized from linux config options. -** It can be overridden at boot-up by the boot command line. -*/ -#define SCSI_NCR_MAX_EXCLUDES 8 -struct ncr_driver_setup { - u8 master_parity; - u8 scsi_parity; - u8 disconnection; - u8 special_features; - u8 force_sync_nego; - u8 reverse_probe; - u8 pci_fix_up; - u8 use_nvram; - u8 verbose; - u8 default_tags; - u16 default_sync; - u16 debug; - u8 burst_max; - u8 led_pin; - u8 max_wide; - u8 settle_delay; - u8 diff_support; - u8 irqm; - u8 bus_check; - u8 optimize; - u8 recovery; - u8 host_id; - u16 iarb; - u32 excludes[SCSI_NCR_MAX_EXCLUDES]; - char tag_ctrl[100]; -}; - -/* -** Initial setup. -** Can be overriden at startup by a command line. -*/ -#define SCSI_NCR_DRIVER_SETUP \ -{ \ - SCSI_NCR_SETUP_MASTER_PARITY, \ - SCSI_NCR_SETUP_SCSI_PARITY, \ - SCSI_NCR_SETUP_DISCONNECTION, \ - SCSI_NCR_SETUP_SPECIAL_FEATURES, \ - SCSI_NCR_SETUP_FORCE_SYNC_NEGO, \ - 0, \ - 0, \ - 1, \ - 0, \ - SCSI_NCR_SETUP_DEFAULT_TAGS, \ - SCSI_NCR_SETUP_DEFAULT_SYNC, \ - 0x00, \ - 7, \ - 0, \ - 1, \ - SCSI_NCR_SETUP_SETTLE_TIME, \ - 0, \ - 0, \ - 1, \ - 0, \ - 0, \ - 255, \ - 0x00 \ -} - -/* -** Boot fail safe setup. -** Override initial setup from boot command line: -** ncr53c8xx=safe:y -*/ -#define SCSI_NCR_DRIVER_SAFE_SETUP \ -{ \ - 0, \ - 1, \ - 0, \ - 0, \ - 0, \ - 0, \ - 0, \ - 1, \ - 2, \ - 0, \ - 255, \ - 0x00, \ - 255, \ - 0, \ - 0, \ - 10, \ - 1, \ - 1, \ - 1, \ - 0, \ - 0, \ - 255 \ -} - -/**************** ORIGINAL CONTENT of ncrreg.h from FreeBSD ******************/ - -/*----------------------------------------------------------------- -** -** The ncr 53c810 register structure. -** -**----------------------------------------------------------------- -*/ - -struct ncr_reg { -/*00*/ u8 nc_scntl0; /* full arb., ena parity, par->ATN */ - -/*01*/ u8 nc_scntl1; /* no reset */ - #define ISCON 0x10 /* connected to scsi */ - #define CRST 0x08 /* force reset */ - #define IARB 0x02 /* immediate arbitration */ - -/*02*/ u8 nc_scntl2; /* no disconnect expected */ - #define SDU 0x80 /* cmd: disconnect will raise error */ - #define CHM 0x40 /* sta: chained mode */ - #define WSS 0x08 /* sta: wide scsi send [W]*/ - #define WSR 0x01 /* sta: wide scsi received [W]*/ - -/*03*/ u8 nc_scntl3; /* cnf system clock dependent */ - #define EWS 0x08 /* cmd: enable wide scsi [W]*/ - #define ULTRA 0x80 /* cmd: ULTRA enable */ - /* bits 0-2, 7 rsvd for C1010 */ - -/*04*/ u8 nc_scid; /* cnf host adapter scsi address */ - #define RRE 0x40 /* r/w:e enable response to resel. */ - #define SRE 0x20 /* r/w:e enable response to select */ - -/*05*/ u8 nc_sxfer; /* ### Sync speed and count */ - /* bits 6-7 rsvd for C1010 */ - -/*06*/ u8 nc_sdid; /* ### Destination-ID */ - -/*07*/ u8 nc_gpreg; /* ??? IO-Pins */ - -/*08*/ u8 nc_sfbr; /* ### First byte in phase */ - -/*09*/ u8 nc_socl; - #define CREQ 0x80 /* r/w: SCSI-REQ */ - #define CACK 0x40 /* r/w: SCSI-ACK */ - #define CBSY 0x20 /* r/w: SCSI-BSY */ - #define CSEL 0x10 /* r/w: SCSI-SEL */ - #define CATN 0x08 /* r/w: SCSI-ATN */ - #define CMSG 0x04 /* r/w: SCSI-MSG */ - #define CC_D 0x02 /* r/w: SCSI-C_D */ - #define CI_O 0x01 /* r/w: SCSI-I_O */ - -/*0a*/ u8 nc_ssid; - -/*0b*/ u8 nc_sbcl; - -/*0c*/ u8 nc_dstat; - #define DFE 0x80 /* sta: dma fifo empty */ - #define MDPE 0x40 /* int: master data parity error */ - #define BF 0x20 /* int: script: bus fault */ - #define ABRT 0x10 /* int: script: command aborted */ - #define SSI 0x08 /* int: script: single step */ - #define SIR 0x04 /* int: script: interrupt instruct. */ - #define IID 0x01 /* int: script: illegal instruct. */ - -/*0d*/ u8 nc_sstat0; - #define ILF 0x80 /* sta: data in SIDL register lsb */ - #define ORF 0x40 /* sta: data in SODR register lsb */ - #define OLF 0x20 /* sta: data in SODL register lsb */ - #define AIP 0x10 /* sta: arbitration in progress */ - #define LOA 0x08 /* sta: arbitration lost */ - #define WOA 0x04 /* sta: arbitration won */ - #define IRST 0x02 /* sta: scsi reset signal */ - #define SDP 0x01 /* sta: scsi parity signal */ - -/*0e*/ u8 nc_sstat1; - #define FF3210 0xf0 /* sta: bytes in the scsi fifo */ - -/*0f*/ u8 nc_sstat2; - #define ILF1 0x80 /* sta: data in SIDL register msb[W]*/ - #define ORF1 0x40 /* sta: data in SODR register msb[W]*/ - #define OLF1 0x20 /* sta: data in SODL register msb[W]*/ - #define DM 0x04 /* sta: DIFFSENS mismatch (895/6 only) */ - #define LDSC 0x02 /* sta: disconnect & reconnect */ - -/*10*/ u8 nc_dsa; /* --> Base page */ -/*11*/ u8 nc_dsa1; -/*12*/ u8 nc_dsa2; -/*13*/ u8 nc_dsa3; - -/*14*/ u8 nc_istat; /* --> Main Command and status */ - #define CABRT 0x80 /* cmd: abort current operation */ - #define SRST 0x40 /* mod: reset chip */ - #define SIGP 0x20 /* r/w: message from host to ncr */ - #define SEM 0x10 /* r/w: message between host + ncr */ - #define CON 0x08 /* sta: connected to scsi */ - #define INTF 0x04 /* sta: int on the fly (reset by wr)*/ - #define SIP 0x02 /* sta: scsi-interrupt */ - #define DIP 0x01 /* sta: host/script interrupt */ - -/*15*/ u8 nc_istat1; /* 896 and later cores only */ - #define FLSH 0x04 /* sta: chip is flushing */ - #define SRUN 0x02 /* sta: scripts are running */ - #define SIRQD 0x01 /* r/w: disable INT pin */ - -/*16*/ u8 nc_mbox0; /* 896 and later cores only */ -/*17*/ u8 nc_mbox1; /* 896 and later cores only */ - -/*18*/ u8 nc_ctest0; - #define EHP 0x04 /* 720 even host parity */ -/*19*/ u8 nc_ctest1; - -/*1a*/ u8 nc_ctest2; - #define CSIGP 0x40 - /* bits 0-2,7 rsvd for C1010 */ - -/*1b*/ u8 nc_ctest3; - #define FLF 0x08 /* cmd: flush dma fifo */ - #define CLF 0x04 /* cmd: clear dma fifo */ - #define FM 0x02 /* mod: fetch pin mode */ - #define WRIE 0x01 /* mod: write and invalidate enable */ - /* bits 4-7 rsvd for C1010 */ - -/*1c*/ u32 nc_temp; /* ### Temporary stack */ - -/*20*/ u8 nc_dfifo; -/*21*/ u8 nc_ctest4; - #define MUX 0x80 /* 720 host bus multiplex mode */ - #define BDIS 0x80 /* mod: burst disable */ - #define MPEE 0x08 /* mod: master parity error enable */ - -/*22*/ u8 nc_ctest5; - #define DFS 0x20 /* mod: dma fifo size */ - /* bits 0-1, 3-7 rsvd for C1010 */ -/*23*/ u8 nc_ctest6; - -/*24*/ u32 nc_dbc; /* ### Byte count and command */ -/*28*/ u32 nc_dnad; /* ### Next command register */ -/*2c*/ u32 nc_dsp; /* --> Script Pointer */ -/*30*/ u32 nc_dsps; /* --> Script pointer save/opcode#2 */ - -/*34*/ u8 nc_scratcha; /* Temporary register a */ -/*35*/ u8 nc_scratcha1; -/*36*/ u8 nc_scratcha2; -/*37*/ u8 nc_scratcha3; - -/*38*/ u8 nc_dmode; - #define BL_2 0x80 /* mod: burst length shift value +2 */ - #define BL_1 0x40 /* mod: burst length shift value +1 */ - #define ERL 0x08 /* mod: enable read line */ - #define ERMP 0x04 /* mod: enable read multiple */ - #define BOF 0x02 /* mod: burst op code fetch */ - -/*39*/ u8 nc_dien; -/*3a*/ u8 nc_sbr; - -/*3b*/ u8 nc_dcntl; /* --> Script execution control */ - #define CLSE 0x80 /* mod: cache line size enable */ - #define PFF 0x40 /* cmd: pre-fetch flush */ - #define PFEN 0x20 /* mod: pre-fetch enable */ - #define EA 0x20 /* mod: 720 enable-ack */ - #define SSM 0x10 /* mod: single step mode */ - #define IRQM 0x08 /* mod: irq mode (1 = totem pole !) */ - #define STD 0x04 /* cmd: start dma mode */ - #define IRQD 0x02 /* mod: irq disable */ - #define NOCOM 0x01 /* cmd: protect sfbr while reselect */ - /* bits 0-1 rsvd for C1010 */ - -/*3c*/ u32 nc_adder; - -/*40*/ u16 nc_sien; /* -->: interrupt enable */ -/*42*/ u16 nc_sist; /* <--: interrupt status */ - #define SBMC 0x1000/* sta: SCSI Bus Mode Change (895/6 only) */ - #define STO 0x0400/* sta: timeout (select) */ - #define GEN 0x0200/* sta: timeout (general) */ - #define HTH 0x0100/* sta: timeout (handshake) */ - #define MA 0x80 /* sta: phase mismatch */ - #define CMP 0x40 /* sta: arbitration complete */ - #define SEL 0x20 /* sta: selected by another device */ - #define RSL 0x10 /* sta: reselected by another device*/ - #define SGE 0x08 /* sta: gross error (over/underflow)*/ - #define UDC 0x04 /* sta: unexpected disconnect */ - #define RST 0x02 /* sta: scsi bus reset detected */ - #define PAR 0x01 /* sta: scsi parity error */ - -/*44*/ u8 nc_slpar; -/*45*/ u8 nc_swide; -/*46*/ u8 nc_macntl; -/*47*/ u8 nc_gpcntl; -/*48*/ u8 nc_stime0; /* cmd: timeout for select&handshake*/ -/*49*/ u8 nc_stime1; /* cmd: timeout user defined */ -/*4a*/ u16 nc_respid; /* sta: Reselect-IDs */ - -/*4c*/ u8 nc_stest0; - -/*4d*/ u8 nc_stest1; - #define SCLK 0x80 /* Use the PCI clock as SCSI clock */ - #define DBLEN 0x08 /* clock doubler running */ - #define DBLSEL 0x04 /* clock doubler selected */ - - -/*4e*/ u8 nc_stest2; - #define ROF 0x40 /* reset scsi offset (after gross error!) */ - #define DIF 0x20 /* 720 SCSI differential mode */ - #define EXT 0x02 /* extended filtering */ - -/*4f*/ u8 nc_stest3; - #define TE 0x80 /* c: tolerAnt enable */ - #define HSC 0x20 /* c: Halt SCSI Clock */ - #define CSF 0x02 /* c: clear scsi fifo */ - -/*50*/ u16 nc_sidl; /* Lowlevel: latched from scsi data */ -/*52*/ u8 nc_stest4; - #define SMODE 0xc0 /* SCSI bus mode (895/6 only) */ - #define SMODE_HVD 0x40 /* High Voltage Differential */ - #define SMODE_SE 0x80 /* Single Ended */ - #define SMODE_LVD 0xc0 /* Low Voltage Differential */ - #define LCKFRQ 0x20 /* Frequency Lock (895/6 only) */ - /* bits 0-5 rsvd for C1010 */ - -/*53*/ u8 nc_53_; -/*54*/ u16 nc_sodl; /* Lowlevel: data out to scsi data */ -/*56*/ u8 nc_ccntl0; /* Chip Control 0 (896) */ - #define ENPMJ 0x80 /* Enable Phase Mismatch Jump */ - #define PMJCTL 0x40 /* Phase Mismatch Jump Control */ - #define ENNDJ 0x20 /* Enable Non Data PM Jump */ - #define DISFC 0x10 /* Disable Auto FIFO Clear */ - #define DILS 0x02 /* Disable Internal Load/Store */ - #define DPR 0x01 /* Disable Pipe Req */ - -/*57*/ u8 nc_ccntl1; /* Chip Control 1 (896) */ - #define ZMOD 0x80 /* High Impedance Mode */ - #define DIC 0x10 /* Disable Internal Cycles */ - #define DDAC 0x08 /* Disable Dual Address Cycle */ - #define XTIMOD 0x04 /* 64-bit Table Ind. Indexing Mode */ - #define EXTIBMV 0x02 /* Enable 64-bit Table Ind. BMOV */ - #define EXDBMV 0x01 /* Enable 64-bit Direct BMOV */ - -/*58*/ u16 nc_sbdl; /* Lowlevel: data from scsi data */ -/*5a*/ u16 nc_5a_; - -/*5c*/ u8 nc_scr0; /* Working register B */ -/*5d*/ u8 nc_scr1; /* */ -/*5e*/ u8 nc_scr2; /* */ -/*5f*/ u8 nc_scr3; /* */ - -/*60*/ u8 nc_scrx[64]; /* Working register C-R */ -/*a0*/ u32 nc_mmrs; /* Memory Move Read Selector */ -/*a4*/ u32 nc_mmws; /* Memory Move Write Selector */ -/*a8*/ u32 nc_sfs; /* Script Fetch Selector */ -/*ac*/ u32 nc_drs; /* DSA Relative Selector */ -/*b0*/ u32 nc_sbms; /* Static Block Move Selector */ -/*b4*/ u32 nc_dbms; /* Dynamic Block Move Selector */ -/*b8*/ u32 nc_dnad64; /* DMA Next Address 64 */ -/*bc*/ u16 nc_scntl4; /* C1010 only */ - #define U3EN 0x80 /* Enable Ultra 3 */ - #define AIPEN 0x40 /* Allow check upper byte lanes */ - #define XCLKH_DT 0x08 /* Extra clock of data hold on DT - transfer edge */ - #define XCLKH_ST 0x04 /* Extra clock of data hold on ST - transfer edge */ - -/*be*/ u8 nc_aipcntl0; /* Epat Control 1 C1010 only */ -/*bf*/ u8 nc_aipcntl1; /* AIP Control C1010_66 Only */ - -/*c0*/ u32 nc_pmjad1; /* Phase Mismatch Jump Address 1 */ -/*c4*/ u32 nc_pmjad2; /* Phase Mismatch Jump Address 2 */ -/*c8*/ u8 nc_rbc; /* Remaining Byte Count */ -/*c9*/ u8 nc_rbc1; /* */ -/*ca*/ u8 nc_rbc2; /* */ -/*cb*/ u8 nc_rbc3; /* */ - -/*cc*/ u8 nc_ua; /* Updated Address */ -/*cd*/ u8 nc_ua1; /* */ -/*ce*/ u8 nc_ua2; /* */ -/*cf*/ u8 nc_ua3; /* */ -/*d0*/ u32 nc_esa; /* Entry Storage Address */ -/*d4*/ u8 nc_ia; /* Instruction Address */ -/*d5*/ u8 nc_ia1; -/*d6*/ u8 nc_ia2; -/*d7*/ u8 nc_ia3; -/*d8*/ u32 nc_sbc; /* SCSI Byte Count (3 bytes only) */ -/*dc*/ u32 nc_csbc; /* Cumulative SCSI Byte Count */ - - /* Following for C1010 only */ -/*e0*/ u16 nc_crcpad; /* CRC Value */ -/*e2*/ u8 nc_crccntl0; /* CRC control register */ - #define SNDCRC 0x10 /* Send CRC Request */ -/*e3*/ u8 nc_crccntl1; /* CRC control register */ -/*e4*/ u32 nc_crcdata; /* CRC data register */ -/*e8*/ u32 nc_e8_; /* rsvd */ -/*ec*/ u32 nc_ec_; /* rsvd */ -/*f0*/ u16 nc_dfbc; /* DMA FIFO byte count */ - -}; - -/*----------------------------------------------------------- -** -** Utility macros for the script. -** -**----------------------------------------------------------- -*/ - -#define REGJ(p,r) (offsetof(struct ncr_reg, p ## r)) -#define REG(r) REGJ (nc_, r) - -typedef u32 ncrcmd; - -/*----------------------------------------------------------- -** -** SCSI phases -** -** DT phases illegal for ncr driver. -** -**----------------------------------------------------------- -*/ - -#define SCR_DATA_OUT 0x00000000 -#define SCR_DATA_IN 0x01000000 -#define SCR_COMMAND 0x02000000 -#define SCR_STATUS 0x03000000 -#define SCR_DT_DATA_OUT 0x04000000 -#define SCR_DT_DATA_IN 0x05000000 -#define SCR_MSG_OUT 0x06000000 -#define SCR_MSG_IN 0x07000000 - -#define SCR_ILG_OUT 0x04000000 -#define SCR_ILG_IN 0x05000000 - -/*----------------------------------------------------------- -** -** Data transfer via SCSI. -** -**----------------------------------------------------------- -** -** MOVE_ABS (LEN) -** <> -** -** MOVE_IND (LEN) -** <> -** -** MOVE_TBL -** <> -** -**----------------------------------------------------------- -*/ - -#define OPC_MOVE 0x08000000 - -#define SCR_MOVE_ABS(l) ((0x00000000 | OPC_MOVE) | (l)) -#define SCR_MOVE_IND(l) ((0x20000000 | OPC_MOVE) | (l)) -#define SCR_MOVE_TBL (0x10000000 | OPC_MOVE) - -#define SCR_CHMOV_ABS(l) ((0x00000000) | (l)) -#define SCR_CHMOV_IND(l) ((0x20000000) | (l)) -#define SCR_CHMOV_TBL (0x10000000) - -struct scr_tblmove { - u32 size; - u32 addr; -}; - -/*----------------------------------------------------------- -** -** Selection -** -**----------------------------------------------------------- -** -** SEL_ABS | SCR_ID (0..15) [ | REL_JMP] -** <> -** -** SEL_TBL | << dnad_offset>> [ | REL_JMP] -** <> -** -**----------------------------------------------------------- -*/ - -#define SCR_SEL_ABS 0x40000000 -#define SCR_SEL_ABS_ATN 0x41000000 -#define SCR_SEL_TBL 0x42000000 -#define SCR_SEL_TBL_ATN 0x43000000 - - -#ifdef SCSI_NCR_BIG_ENDIAN -struct scr_tblsel { - u8 sel_scntl3; - u8 sel_id; - u8 sel_sxfer; - u8 sel_scntl4; -}; -#else -struct scr_tblsel { - u8 sel_scntl4; - u8 sel_sxfer; - u8 sel_id; - u8 sel_scntl3; -}; -#endif - -#define SCR_JMP_REL 0x04000000 -#define SCR_ID(id) (((u32)(id)) << 16) - -/*----------------------------------------------------------- -** -** Waiting for Disconnect or Reselect -** -**----------------------------------------------------------- -** -** WAIT_DISC -** dummy: <> -** -** WAIT_RESEL -** <> -** -**----------------------------------------------------------- -*/ - -#define SCR_WAIT_DISC 0x48000000 -#define SCR_WAIT_RESEL 0x50000000 - -/*----------------------------------------------------------- -** -** Bit Set / Reset -** -**----------------------------------------------------------- -** -** SET (flags {|.. }) -** -** CLR (flags {|.. }) -** -**----------------------------------------------------------- -*/ - -#define SCR_SET(f) (0x58000000 | (f)) -#define SCR_CLR(f) (0x60000000 | (f)) - -#define SCR_CARRY 0x00000400 -#define SCR_TRG 0x00000200 -#define SCR_ACK 0x00000040 -#define SCR_ATN 0x00000008 - - - - -/*----------------------------------------------------------- -** -** Memory to memory move -** -**----------------------------------------------------------- -** -** COPY (bytecount) -** << source_address >> -** << destination_address >> -** -** SCR_COPY sets the NO FLUSH option by default. -** SCR_COPY_F does not set this option. -** -** For chips which do not support this option, -** ncr_copy_and_bind() will remove this bit. -**----------------------------------------------------------- -*/ - -#define SCR_NO_FLUSH 0x01000000 - -#define SCR_COPY(n) (0xc0000000 | SCR_NO_FLUSH | (n)) -#define SCR_COPY_F(n) (0xc0000000 | (n)) - -/*----------------------------------------------------------- -** -** Register move and binary operations -** -**----------------------------------------------------------- -** -** SFBR_REG (reg, op, data) reg = SFBR op data -** << 0 >> -** -** REG_SFBR (reg, op, data) SFBR = reg op data -** << 0 >> -** -** REG_REG (reg, op, data) reg = reg op data -** << 0 >> -** -**----------------------------------------------------------- -** On 810A, 860, 825A, 875, 895 and 896 chips the content -** of SFBR register can be used as data (SCR_SFBR_DATA). -** The 896 has additionnal IO registers starting at -** offset 0x80. Bit 7 of register offset is stored in -** bit 7 of the SCRIPTS instruction first DWORD. -**----------------------------------------------------------- -*/ - -#define SCR_REG_OFS(ofs) ((((ofs) & 0x7f) << 16ul) + ((ofs) & 0x80)) - -#define SCR_SFBR_REG(reg,op,data) \ - (0x68000000 | (SCR_REG_OFS(REG(reg))) | (op) | (((data)&0xff)<<8ul)) - -#define SCR_REG_SFBR(reg,op,data) \ - (0x70000000 | (SCR_REG_OFS(REG(reg))) | (op) | (((data)&0xff)<<8ul)) - -#define SCR_REG_REG(reg,op,data) \ - (0x78000000 | (SCR_REG_OFS(REG(reg))) | (op) | (((data)&0xff)<<8ul)) - - -#define SCR_LOAD 0x00000000 -#define SCR_SHL 0x01000000 -#define SCR_OR 0x02000000 -#define SCR_XOR 0x03000000 -#define SCR_AND 0x04000000 -#define SCR_SHR 0x05000000 -#define SCR_ADD 0x06000000 -#define SCR_ADDC 0x07000000 - -#define SCR_SFBR_DATA (0x00800000>>8ul) /* Use SFBR as data */ - -/*----------------------------------------------------------- -** -** FROM_REG (reg) SFBR = reg -** << 0 >> -** -** TO_REG (reg) reg = SFBR -** << 0 >> -** -** LOAD_REG (reg, data) reg = -** << 0 >> -** -** LOAD_SFBR(data) SFBR = -** << 0 >> -** -**----------------------------------------------------------- -*/ - -#define SCR_FROM_REG(reg) \ - SCR_REG_SFBR(reg,SCR_OR,0) - -#define SCR_TO_REG(reg) \ - SCR_SFBR_REG(reg,SCR_OR,0) - -#define SCR_LOAD_REG(reg,data) \ - SCR_REG_REG(reg,SCR_LOAD,data) - -#define SCR_LOAD_SFBR(data) \ - (SCR_REG_SFBR (gpreg, SCR_LOAD, data)) - -/*----------------------------------------------------------- -** -** LOAD from memory to register. -** STORE from register to memory. -** -** Only supported by 810A, 860, 825A, 875, 895 and 896. -** -**----------------------------------------------------------- -** -** LOAD_ABS (LEN) -** <> -** -** LOAD_REL (LEN) (DSA relative) -** <> -** -**----------------------------------------------------------- -*/ - -#define SCR_REG_OFS2(ofs) (((ofs) & 0xff) << 16ul) -#define SCR_NO_FLUSH2 0x02000000 -#define SCR_DSA_REL2 0x10000000 - -#define SCR_LOAD_R(reg, how, n) \ - (0xe1000000 | how | (SCR_REG_OFS2(REG(reg))) | (n)) - -#define SCR_STORE_R(reg, how, n) \ - (0xe0000000 | how | (SCR_REG_OFS2(REG(reg))) | (n)) - -#define SCR_LOAD_ABS(reg, n) SCR_LOAD_R(reg, SCR_NO_FLUSH2, n) -#define SCR_LOAD_REL(reg, n) SCR_LOAD_R(reg, SCR_NO_FLUSH2|SCR_DSA_REL2, n) -#define SCR_LOAD_ABS_F(reg, n) SCR_LOAD_R(reg, 0, n) -#define SCR_LOAD_REL_F(reg, n) SCR_LOAD_R(reg, SCR_DSA_REL2, n) - -#define SCR_STORE_ABS(reg, n) SCR_STORE_R(reg, SCR_NO_FLUSH2, n) -#define SCR_STORE_REL(reg, n) SCR_STORE_R(reg, SCR_NO_FLUSH2|SCR_DSA_REL2,n) -#define SCR_STORE_ABS_F(reg, n) SCR_STORE_R(reg, 0, n) -#define SCR_STORE_REL_F(reg, n) SCR_STORE_R(reg, SCR_DSA_REL2, n) - - -/*----------------------------------------------------------- -** -** Waiting for Disconnect or Reselect -** -**----------------------------------------------------------- -** -** JUMP [ | IFTRUE/IFFALSE ( ... ) ] -** <

> -** -** JUMPR [ | IFTRUE/IFFALSE ( ... ) ] -** <> -** -** CALL [ | IFTRUE/IFFALSE ( ... ) ] -** <
> -** -** CALLR [ | IFTRUE/IFFALSE ( ... ) ] -** <> -** -** RETURN [ | IFTRUE/IFFALSE ( ... ) ] -** <> -** -** INT [ | IFTRUE/IFFALSE ( ... ) ] -** <> -** -** INT_FLY [ | IFTRUE/IFFALSE ( ... ) ] -** <> -** -** Conditions: -** WHEN (phase) -** IF (phase) -** CARRYSET -** DATA (data, mask) -** -**----------------------------------------------------------- -*/ - -#define SCR_NO_OP 0x80000000 -#define SCR_JUMP 0x80080000 -#define SCR_JUMP64 0x80480000 -#define SCR_JUMPR 0x80880000 -#define SCR_CALL 0x88080000 -#define SCR_CALLR 0x88880000 -#define SCR_RETURN 0x90080000 -#define SCR_INT 0x98080000 -#define SCR_INT_FLY 0x98180000 - -#define IFFALSE(arg) (0x00080000 | (arg)) -#define IFTRUE(arg) (0x00000000 | (arg)) - -#define WHEN(phase) (0x00030000 | (phase)) -#define IF(phase) (0x00020000 | (phase)) - -#define DATA(D) (0x00040000 | ((D) & 0xff)) -#define MASK(D,M) (0x00040000 | (((M ^ 0xff) & 0xff) << 8ul)|((D) & 0xff)) - -#define CARRYSET (0x00200000) - -/*----------------------------------------------------------- -** -** SCSI constants. -** -**----------------------------------------------------------- -*/ - -/* -** Messages -*/ - -#define M_COMPLETE COMMAND_COMPLETE -#define M_EXTENDED EXTENDED_MESSAGE -#define M_SAVE_DP SAVE_POINTERS -#define M_RESTORE_DP RESTORE_POINTERS -#define M_DISCONNECT DISCONNECT -#define M_ID_ERROR INITIATOR_ERROR -#define M_ABORT ABORT_TASK_SET -#define M_REJECT MESSAGE_REJECT -#define M_NOOP NOP -#define M_PARITY MSG_PARITY_ERROR -#define M_LCOMPLETE LINKED_CMD_COMPLETE -#define M_FCOMPLETE LINKED_FLG_CMD_COMPLETE -#define M_RESET TARGET_RESET -#define M_ABORT_TAG ABORT_TASK -#define M_CLEAR_QUEUE CLEAR_TASK_SET -#define M_INIT_REC INITIATE_RECOVERY -#define M_REL_REC RELEASE_RECOVERY -#define M_TERMINATE (0x11) -#define M_SIMPLE_TAG SIMPLE_QUEUE_TAG -#define M_HEAD_TAG HEAD_OF_QUEUE_TAG -#define M_ORDERED_TAG ORDERED_QUEUE_TAG -#define M_IGN_RESIDUE IGNORE_WIDE_RESIDUE -#define M_IDENTIFY (0x80) - -#define M_X_MODIFY_DP EXTENDED_MODIFY_DATA_POINTER -#define M_X_SYNC_REQ EXTENDED_SDTR -#define M_X_WIDE_REQ EXTENDED_WDTR -#define M_X_PPR_REQ EXTENDED_PPR - -/* -** Status -*/ - -#define S_GOOD (0x00) -#define S_CHECK_COND (0x02) -#define S_COND_MET (0x04) -#define S_BUSY (0x08) -#define S_INT (0x10) -#define S_INT_COND_MET (0x14) -#define S_CONFLICT (0x18) -#define S_TERMINATED (0x20) -#define S_QUEUE_FULL (0x28) -#define S_ILLEGAL (0xff) -#define S_SENSE (0x80) - -/* - * End of ncrreg from FreeBSD - */ +#include "sym53c8xx_defs.h" /* Build a scatter/gather entry. diff --git a/trunk/drivers/scsi/qla2xxx/Kconfig b/trunk/drivers/scsi/qla2xxx/Kconfig index 5205c4e7d6ff..c1c1c687bcbd 100644 --- a/trunk/drivers/scsi/qla2xxx/Kconfig +++ b/trunk/drivers/scsi/qla2xxx/Kconfig @@ -1,70 +1,55 @@ config SCSI_QLA2XXX - tristate "QLogic QLA2XXX Fibre Channel Support" - depends on PCI && SCSI - select SCSI_FC_ATTRS - select FW_LOADER - ---help--- - This qla2xxx driver supports all QLogic Fibre Channel - PCI and PCIe host adapters. - - By default, firmware for the ISP parts will be loaded - via the Firmware Loader interface. - - ISP Firmware Filename - ---------- ----------------- - 21xx ql2100_fw.bin - 22xx ql2200_fw.bin - 2300, 2312 ql2300_fw.bin - 2322 ql2322_fw.bin - 6312, 6322 ql6312_fw.bin - 24xx ql2400_fw.bin - - Upon request, the driver caches the firmware image until - the driver is unloaded. - - NOTE: The original method of building firmware-loader - modules has been deprecated as the firmware-images will - be removed from the kernel sources. - -config SCSI_QLA2XXX_EMBEDDED_FIRMWARE - bool " Use firmware-loader modules (DEPRECATED)" - depends on SCSI_QLA2XXX + tristate + default (SCSI && PCI) + depends on SCSI && PCI config SCSI_QLA21XX - tristate " Build QLogic ISP2100 firmware-module" - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE + tristate "QLogic ISP2100 host adapter family support" + depends on SCSI_QLA2XXX + select SCSI_FC_ATTRS + select FW_LOADER ---help--- This driver supports the QLogic 21xx (ISP2100) host adapter family. config SCSI_QLA22XX - tristate " Build QLogic ISP2200 firmware-module" - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE + tristate "QLogic ISP2200 host adapter family support" + depends on SCSI_QLA2XXX + select SCSI_FC_ATTRS + select FW_LOADER ---help--- This driver supports the QLogic 22xx (ISP2200) host adapter family. config SCSI_QLA2300 - tristate " Build QLogic ISP2300 firmware-module" - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE + tristate "QLogic ISP2300 host adapter family support" + depends on SCSI_QLA2XXX + select SCSI_FC_ATTRS + select FW_LOADER ---help--- This driver supports the QLogic 2300 (ISP2300 and ISP2312) host adapter family. config SCSI_QLA2322 - tristate " Build QLogic ISP2322 firmware-module" - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE + tristate "QLogic ISP2322 host adapter family support" + depends on SCSI_QLA2XXX + select SCSI_FC_ATTRS + select FW_LOADER ---help--- This driver supports the QLogic 2322 (ISP2322) host adapter family. config SCSI_QLA6312 - tristate " Build QLogic ISP63xx firmware-module" - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE + tristate "QLogic ISP63xx host adapter family support" + depends on SCSI_QLA2XXX + select SCSI_FC_ATTRS + select FW_LOADER ---help--- This driver supports the QLogic 63xx (ISP6312 and ISP6322) host adapter family. config SCSI_QLA24XX - tristate " Build QLogic ISP24xx firmware-module" - depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE + tristate "QLogic ISP24xx host adapter family support" + depends on SCSI_QLA2XXX + select SCSI_FC_ATTRS + select FW_LOADER ---help--- This driver supports the QLogic 24xx (ISP2422 and ISP2432) host adapter family. diff --git a/trunk/drivers/scsi/qla2xxx/Makefile b/trunk/drivers/scsi/qla2xxx/Makefile index 40c0de125889..b169687d08ff 100644 --- a/trunk/drivers/scsi/qla2xxx/Makefile +++ b/trunk/drivers/scsi/qla2xxx/Makefile @@ -3,18 +3,15 @@ EXTRA_CFLAGS += -DUNIQUE_FW_NAME qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ qla_dbg.o qla_sup.o qla_rscn.o qla_attr.o -obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx.o - qla2100-y := ql2100.o ql2100_fw.o qla2200-y := ql2200.o ql2200_fw.o qla2300-y := ql2300.o ql2300_fw.o qla2322-y := ql2322.o ql2322_fw.o qla6312-y := ql6312.o ql6312_fw.o -qla2400-y := ql2400.o ql2400_fw.o obj-$(CONFIG_SCSI_QLA21XX) += qla2xxx.o qla2100.o obj-$(CONFIG_SCSI_QLA22XX) += qla2xxx.o qla2200.o obj-$(CONFIG_SCSI_QLA2300) += qla2xxx.o qla2300.o obj-$(CONFIG_SCSI_QLA2322) += qla2xxx.o qla2322.o obj-$(CONFIG_SCSI_QLA6312) += qla2xxx.o qla6312.o -obj-$(CONFIG_SCSI_QLA24XX) += qla2xxx.o qla2400.o +obj-$(CONFIG_SCSI_QLA24XX) += qla2xxx.o diff --git a/trunk/drivers/scsi/qla2xxx/ql2400.c b/trunk/drivers/scsi/qla2xxx/ql2400.c deleted file mode 100644 index 6c7165f47e29..000000000000 --- a/trunk/drivers/scsi/qla2xxx/ql2400.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * QLogic Fibre Channel HBA Driver - * Copyright (c) 2003-2005 QLogic Corporation - * - * See LICENSE.qla2xxx for copyright and licensing details. - */ -#include -#include -#include - -#include "qla_def.h" - -static char qla_driver_name[] = "qla2400"; - -extern uint32_t fw2400_version_str[]; -extern uint32_t fw2400_addr01; -extern uint32_t fw2400_code01[]; -extern uint32_t fw2400_length01; -extern uint32_t fw2400_addr02; -extern uint32_t fw2400_code02[]; -extern uint32_t fw2400_length02; - -static struct qla_fw_info qla_fw_tbl[] = { - { - .addressing = FW_INFO_ADDR_EXTENDED, - .fwcode = (unsigned short *)&fw2400_code01[0], - .fwlen = (unsigned short *)&fw2400_length01, - .lfwstart = (unsigned long *)&fw2400_addr01, - }, - { - .addressing = FW_INFO_ADDR_EXTENDED, - .fwcode = (unsigned short *)&fw2400_code02[0], - .fwlen = (unsigned short *)&fw2400_length02, - .lfwstart = (unsigned long *)&fw2400_addr02, - }, - { FW_INFO_ADDR_NOMORE, }, -}; - -static struct qla_board_info qla_board_tbl[] = { - { - .drv_name = qla_driver_name, - .isp_name = "ISP2422", - .fw_info = qla_fw_tbl, - .fw_fname = "ql2400_fw.bin", - }, - { - .drv_name = qla_driver_name, - .isp_name = "ISP2432", - .fw_info = qla_fw_tbl, - .fw_fname = "ql2400_fw.bin", - }, -}; - -static struct pci_device_id qla24xx_pci_tbl[] = { - { - .vendor = PCI_VENDOR_ID_QLOGIC, - .device = PCI_DEVICE_ID_QLOGIC_ISP2422, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, - .driver_data = (unsigned long)&qla_board_tbl[0], - }, - { - .vendor = PCI_VENDOR_ID_QLOGIC, - .device = PCI_DEVICE_ID_QLOGIC_ISP2432, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, - .driver_data = (unsigned long)&qla_board_tbl[1], - }, - {0, 0}, -}; -MODULE_DEVICE_TABLE(pci, qla24xx_pci_tbl); - -static int __devinit -qla24xx_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) -{ - return qla2x00_probe_one(pdev, - (struct qla_board_info *)id->driver_data); -} - -static void __devexit -qla24xx_remove_one(struct pci_dev *pdev) -{ - qla2x00_remove_one(pdev); -} - -static struct pci_driver qla24xx_pci_driver = { - .name = "qla2400", - .id_table = qla24xx_pci_tbl, - .probe = qla24xx_probe_one, - .remove = __devexit_p(qla24xx_remove_one), -}; - -static int __init -qla24xx_init(void) -{ - return pci_module_init(&qla24xx_pci_driver); -} - -static void __exit -qla24xx_exit(void) -{ - pci_unregister_driver(&qla24xx_pci_driver); -} - -module_init(qla24xx_init); -module_exit(qla24xx_exit); - -MODULE_AUTHOR("QLogic Corporation"); -MODULE_DESCRIPTION("QLogic ISP24xx FC-SCSI Host Bus Adapter driver"); -MODULE_LICENSE("GPL"); -MODULE_VERSION(QLA2XXX_VERSION); diff --git a/trunk/drivers/scsi/qla2xxx/ql2400_fw.c b/trunk/drivers/scsi/qla2xxx/ql2400_fw.c deleted file mode 100644 index 5977795854f8..000000000000 --- a/trunk/drivers/scsi/qla2xxx/ql2400_fw.c +++ /dev/null @@ -1,12376 +0,0 @@ -/* - * QLogic Fibre Channel HBA Driver - * Copyright (c) 2003-2005 QLogic Corporation - * - * See LICENSE.qla2xxx for copyright and licensing details. - */ -#include - -/* - * Firmware Version 4.00.16 (08:09 Oct 26, 2005) - */ - -#ifdef UNIQUE_FW_NAME -uint32_t fw2400_version = 4*1024+0; -#else -uint32_t risc_code_version = 4*1024+0; -#endif - -#ifdef UNIQUE_FW_NAME -uint32_t fw2400_version_str[] = {4, 0,16}; -#else -uint32_t firmware_version[] = {4, 0,16}; -#endif - -#ifdef UNIQUE_FW_NAME -#define fw2400_VERSION_STRING "4.00.16" -#else -#define FW_VERSION_STRING "4.00.16" -#endif - -#ifdef UNIQUE_FW_NAME -uint32_t fw2400_addr01 = 0x00100000 ; -#else -uint32_t risc_code_addr01 = 0x00100000 ; -#endif - -#ifdef UNIQUE_FW_NAME -uint32_t fw2400_code01[] = { -#else -uint32_t risc_code01[] = { -#endif - 0x0401f17c, 0x0010e000, 0x00100000, 0x0000ab4a, - 0x00000004, 0x00000000, 0x00000010, 0x00000002, - 0x00000003, 0x00000000, 0x20434f50, 0x59524947, - 0x48542032, 0x30303520, 0x514c4f47, 0x49432043, - 0x4f52504f, 0x52415449, 0x4f4e2020, 0x20495350, - 0x32347878, 0x20466972, 0x6d776172, 0x65202020, - 0x56657273, 0x696f6e20, 0x342e302e, 0x31362020, - 0x20202024, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x42001800, 0x0010014f, 0x42002000, 0x0010b8fe, - 0x500c0800, 0x800c1800, 0x500c1000, 0x800c1800, - 0x54042000, 0x80102000, 0x80040800, 0x80081040, - 0x040207fc, 0x500c0800, 0x800409c0, 0x040207f6, - 0x44002000, 0x80102000, 0x40100000, 0x44040000, - 0x80000000, 0x44080000, 0x80000000, 0x440c0000, - 0x80000000, 0x44100000, 0x80000000, 0x44140000, - 0x80000000, 0x44180000, 0x80000000, 0x441c0000, - 0x80000000, 0x44200000, 0x80000000, 0x44240000, - 0x80000000, 0x44280000, 0x80000000, 0x442c0000, - 0x80000000, 0x44300000, 0x80000000, 0x44340000, - 0x80000000, 0x44380000, 0x80000000, 0x443c0000, - 0x80000000, 0x44400000, 0x80000000, 0x44440000, - 0x80000000, 0x44480000, 0x80000000, 0x444c0000, - 0x80000000, 0x44500000, 0x80000000, 0x44540000, - 0x80000000, 0x44580000, 0x80000000, 0x445c0000, - 0x80000000, 0x44600000, 0x80000000, 0x44640000, - 0x80000000, 0x44680000, 0x80000000, 0x446c0000, - 0x80000000, 0x44700000, 0x80000000, 0x44740000, - 0x80000000, 0x44780000, 0x80000000, 0x447c0000, - 0x80000000, 0x44800000, 0x80000000, 0x44840000, - 0x80000000, 0x44880000, 0x80000000, 0x448c0000, - 0x80000000, 0x44900000, 0x80000000, 0x44940000, - 0x80000000, 0x44980000, 0x80000000, 0x449c0000, - 0x80000000, 0x44a00000, 0x80000000, 0x44a40000, - 0x80000000, 0x44a80000, 0x80000000, 0x44ac0000, - 0x80000000, 0x44b00000, 0x80000000, 0x44b40000, - 0x80000000, 0x44b80000, 0x80000000, 0x44bc0000, - 0x80000000, 0x44c00000, 0x80000000, 0x44c40000, - 0x80000000, 0x44c80000, 0x80000000, 0x44cc0000, - 0x80000000, 0x44d00000, 0x80000000, 0x44d80000, - 0x80000000, 0x44d40000, 0x80000000, 0x44dc0000, - 0x80000000, 0x44e00000, 0x80000000, 0x44e40000, - 0x80000000, 0x44e80000, 0x80000000, 0x44ec0000, - 0x80000000, 0x44f00000, 0x80000000, 0x44f40000, - 0x80000000, 0x44f80000, 0x80000000, 0x44fc0000, - 0x80000000, 0x45000000, 0x80000000, 0x45040000, - 0x80000000, 0x45080000, 0x80000000, 0x450c0000, - 0x80000000, 0x45100000, 0x80000000, 0x45140000, - 0x80000000, 0x45180000, 0x80000000, 0x451c0000, - 0x80000000, 0x45200000, 0x80000000, 0x45240000, - 0x80000000, 0x45280000, 0x80000000, 0x452c0000, - 0x80000000, 0x45300000, 0x80000000, 0x45340000, - 0x80000000, 0x45380000, 0x80000000, 0x453c0000, - 0x80000000, 0x45400000, 0x80000000, 0x45440000, - 0x80000000, 0x45480000, 0x80000000, 0x454c0000, - 0x80000000, 0x45500000, 0x80000000, 0x45540000, - 0x80000000, 0x45580000, 0x80000000, 0x455c0000, - 0x80000000, 0x45600000, 0x80000000, 0x45640000, - 0x80000000, 0x45680000, 0x80000000, 0x456c0000, - 0x80000000, 0x45700000, 0x80000000, 0x45740000, - 0x80000000, 0x45780000, 0x80000000, 0x457c0000, - 0x80000000, 0x45800000, 0x80000000, 0x45840000, - 0x80000000, 0x45880000, 0x80000000, 0x458c0000, - 0x80000000, 0x45900000, 0x80000000, 0x45940000, - 0x80000000, 0x45980000, 0x80000000, 0x459c0000, - 0x80000000, 0x45a00000, 0x80000000, 0x45a40000, - 0x80000000, 0x45a80000, 0x80000000, 0x45ac0000, - 0x80000000, 0x45b00000, 0x80000000, 0x45b40000, - 0x80000000, 0x45b80000, 0x80000000, 0x45bc0000, - 0x80000000, 0x45c00000, 0x80000000, 0x45c40000, - 0x80000000, 0x45c80000, 0x80000000, 0x45cc0000, - 0x80000000, 0x45d00000, 0x80000000, 0x45d40000, - 0x80000000, 0x45d80000, 0x80000000, 0x45dc0000, - 0x80000000, 0x45e00000, 0x80000000, 0x45e40000, - 0x80000000, 0x45e80000, 0x80000000, 0x45ec0000, - 0x80000000, 0x45f00000, 0x80000000, 0x45f40000, - 0x80000000, 0x45f80000, 0x80000000, 0x45fc0000, - 0x4a03c020, 0x00004000, 0x4a03c011, 0x40000010, - 0x04006000, 0x4203e000, 0x40000000, 0x59e00017, - 0x8c000508, 0x04000003, 0x4a03c017, 0x00000000, - 0x4203e000, 0x30000001, 0x0401f000, 0x0000bf00, - 0x00000080, 0x0000bfe0, 0x00000020, 0x0000ff00, - 0x00000080, 0x0000ffd0, 0x00000030, 0x00007100, - 0x00000010, 0x00007200, 0x00000008, 0x00007209, - 0x00000007, 0x00007300, 0x00000008, 0x00007309, - 0x00000007, 0x00007400, 0x00000008, 0x00007409, - 0x00000007, 0x00007600, 0x000000b0, 0x00007700, - 0x00000040, 0x00003000, 0x00000070, 0x00004000, - 0x000000c0, 0x00006000, 0x00000050, 0x00006100, - 0x00000010, 0x00006130, 0x00000010, 0x00006150, - 0x00000010, 0x00006170, 0x00000010, 0x00006190, - 0x00000010, 0x000061b0, 0x00000010, 0x00000000, - 0x42000000, 0x00000100, 0x4202f000, 0x00000000, - 0x42000800, 0x00021f00, 0x45780800, 0x80040800, - 0x80000040, 0x040207fd, 0x4203f000, 0x00021fff, - 0x40000000, 0x4203e000, 0x90000100, 0x40000000, - 0x0201f800, 0x001006fd, 0x42000000, 0x00001000, - 0x50000000, 0x82000480, 0x24320002, 0x04020015, - 0x42000800, 0x00000064, 0x80040840, 0x04000007, - 0x4a030000, 0x00000001, 0x40000000, 0x59800000, - 0x8c000500, 0x040007f9, 0x04000008, 0x42000800, - 0x00007a17, 0x50040000, 0x8c00050e, 0x04020003, - 0x8400054e, 0x44000800, 0x4a030000, 0x00000000, - 0x4a03c020, 0x00000004, 0x4203e000, 0x6000000f, - 0x59e00023, 0x8c000500, 0x04020039, 0x42000000, - 0x00100001, 0x50000800, 0x82040c00, 0x00000004, - 0x58042003, 0x42001000, 0xffffffff, 0x0201f800, - 0x001006f4, 0x0402004e, 0x58042003, 0x42001000, - 0xffffffff, 0x0201f800, 0x001006f4, 0x04020048, - 0x58042003, 0x42001000, 0x00ffffff, 0x0201f800, - 0x001006f4, 0x04020042, 0x58042003, 0x42001000, - 0x00ffffff, 0x0201f800, 0x001006f4, 0x0402003c, - 0x42000000, 0x00100001, 0x5000a000, 0x8250a400, - 0x00000004, 0x4200a800, 0x00020000, 0x5850b003, - 0x0201f800, 0x0010ab17, 0x8250a400, 0x00000005, - 0x4a0370e8, 0x00000003, 0x4200a800, 0x0000c000, - 0x5850b003, 0x0201f800, 0x0010ab17, 0x4a0378e8, - 0x00000003, 0x4200a800, 0x00008000, 0x5850b003, - 0x0201f800, 0x0010ab17, 0x0401f02b, 0x42000800, - 0x00020000, 0x58042003, 0x42001000, 0xffffffff, - 0x0201f800, 0x001006f4, 0x04020019, 0x4a0370e8, - 0x00000003, 0x42000800, 0x0000c000, 0x58042003, - 0x82102500, 0x00ffffff, 0x42001000, 0x00ffffff, - 0x0201f800, 0x001006f4, 0x0402000d, 0x4a0378e8, - 0x00000003, 0x42000800, 0x00008000, 0x58042003, - 0x82102500, 0x00ffffff, 0x42001000, 0x00ffffff, - 0x0201f800, 0x001006f4, 0x0400000b, 0x4a03c020, - 0x00004010, 0x4a03c011, 0x40100011, 0x04006000, - 0x4203e000, 0x40000000, 0x4203e000, 0x30000001, - 0x0401f000, 0x0201f800, 0x00100791, 0x42001000, - 0x0010ab4a, 0x40080000, 0x80140480, 0x82001d00, - 0xffffff00, 0x04020003, 0x40001800, 0x0401f003, - 0x42001800, 0x000000ff, 0x480bc840, 0x480fc842, - 0x04011000, 0x400c0000, 0x80081400, 0x40140000, - 0x80080580, 0x040207f0, 0x4817500d, 0x45782800, - 0x59c40000, 0x82000500, 0xffff0000, 0x80000120, - 0x82000580, 0x00002422, 0x04020005, 0x59a80005, - 0x8400054e, 0x48035005, 0x0401f008, 0x59e00003, - 0x82000500, 0x00030000, 0x04000004, 0x59a80005, - 0x84000554, 0x48035005, 0x42000800, 0x00000040, - 0x59a80005, 0x8c000514, 0x0402000e, 0x42000800, - 0x00001000, 0x82141480, 0x0017ffff, 0x04021009, - 0x80040902, 0x82141480, 0x0013ffff, 0x04021005, - 0x80040902, 0x82141480, 0x0011ffff, 0x04001b8d, - 0x4807500e, 0x42001000, 0x00000024, 0x0201f800, - 0x00106681, 0x82040c00, 0x0010d1c0, 0x4807500b, - 0x4a03c810, 0x00100000, 0x4a03c811, 0x0010ab4a, - 0x4a03c829, 0x00000004, 0x59e40001, 0x82000540, - 0x0003001d, 0x4803c801, 0x4a03c014, 0x001c001c, - 0x42001000, 0x0000001c, 0x0201f800, 0x001006e2, - 0x4202c000, 0x0010d1c0, 0x59aab00b, 0x59aaa00b, - 0x59aaa80b, 0x59aac80e, 0x49675069, 0x59a8000b, - 0x4803500c, 0x0401fbf5, 0x0201f800, 0x00107903, - 0x0201f800, 0x001007be, 0x0201f800, 0x00100807, - 0x0201f800, 0x00101a05, 0x0201f800, 0x00101354, - 0x0201f800, 0x00100969, 0x0201f800, 0x00101354, - 0x0201f800, 0x00100f4c, 0x0201f800, 0x001066c1, - 0x0401fb1a, 0x0201f800, 0x0010220e, 0x0201f800, - 0x001053bb, 0x0201f800, 0x00104c90, 0x0201f800, - 0x00106194, 0x0201f800, 0x00105f28, 0x0201f800, - 0x001013ed, 0x0201f800, 0x0010126f, 0x4203e000, - 0xf0000001, 0x42000000, 0x00001000, 0x50000000, - 0x82000480, 0x24220001, 0x04000016, 0x59e00002, - 0x8c00051e, 0x42000000, 0x7ffe00fe, 0x04020003, - 0x42000000, 0x7ffe01fe, 0x50000800, 0x48075058, - 0x80040920, 0x82040580, 0x0000013a, 0x04000004, - 0x82040580, 0x0000013b, 0x04020006, 0x59a80005, - 0x84000552, 0x48035005, 0x4a0378e4, 0x000c0000, - 0x4a03c018, 0x0000000f, 0x4203e000, 0x20000511, - 0x4203e000, 0x50010000, 0x4a03c020, 0x00000000, - 0x04027013, 0x59e00020, 0x82000580, 0x00000002, - 0x0402000f, 0x4a03c020, 0x00004000, 0x4a03c011, - 0x40000010, 0x04006000, 0x4203e000, 0x40000000, - 0x59e00017, 0x8c000508, 0x04000003, 0x4a03c017, - 0x00000000, 0x4203e000, 0x30000001, 0x4202d800, - 0x00000000, 0x4203e000, 0xb0600000, 0x59a80005, - 0x42000800, 0x00000002, 0x8c000512, 0x04020007, - 0x42000800, 0x0000000f, 0x8c000514, 0x04020003, - 0x42000800, 0x00000001, 0x4007f800, 0x59a80005, - 0x8c000514, 0x02020000, 0x00020004, 0x59e00003, - 0x82000500, 0x00030000, 0x82000580, 0x00000000, - 0x04020af8, 0x0201f000, 0x00020004, 0x4df00000, - 0x4203e000, 0x50000000, 0x416c0000, 0x82000c80, - 0x00000008, 0x04021aef, 0x0c01f804, 0x5c03e000, - 0x0201f000, 0x00020008, 0x001002f7, 0x0010030a, - 0x001003d7, 0x001002f6, 0x00100452, 0x001002f6, - 0x001002f6, 0x00100593, 0x0401fae2, 0x42000800, - 0x0010b4a4, 0x5804001d, 0x4803c857, 0x8c000500, - 0x0400000d, 0x84000500, 0x4800081d, 0x4202d800, - 0x00000004, 0x0401fbd3, 0x49f3c857, 0x5c000800, - 0x5c000000, 0x82000540, 0x00003e00, 0x4c000000, - 0x4c040000, 0x1c01f000, 0x0401fbbd, 0x0201f800, - 0x0010513b, 0x04000009, 0x0201f800, 0x00105151, - 0x0402002e, 0x59c40006, 0x82000540, 0x000000c0, - 0x48038806, 0x0401f029, 0x0201f800, 0x001050a2, - 0x836c0580, 0x00000001, 0x040200bc, 0x59a80017, - 0x82000580, 0x00000009, 0x040200b8, 0x497b5010, - 0x4a038893, 0x00000001, 0x42001000, 0x000000f0, - 0x0201f800, 0x0010193d, 0x0201f800, 0x00105149, - 0x59c41006, 0x04020006, 0x82081540, 0x000000f1, - 0x82081500, 0xbbffffff, 0x0401f003, 0x82081540, - 0x440000f1, 0x480b8806, 0x0201f800, 0x0010609e, - 0x4a0378e4, 0x00002000, 0x42000000, 0x0010b83a, - 0x0201f800, 0x0010aa47, 0x42001000, 0x00008030, - 0x497b5013, 0x0401f035, 0x0201f800, 0x00103b38, - 0x59c400a4, 0x82000500, 0x0000000f, 0x82000480, - 0x00000007, 0x04021091, 0x0201f800, 0x0010609e, - 0x59c400a3, 0x82000500, 0xffefffff, 0x480388a3, - 0x59a8004b, 0x800001c0, 0x04020004, 0x0201f800, - 0x00104139, 0x0401f085, 0x59a80015, 0x84000546, - 0x48035015, 0x0201f800, 0x00105141, 0x59c41006, - 0x04020006, 0x82081540, 0x44000001, 0x82081500, - 0xffffff0f, 0x0401f003, 0x82081540, 0x440000f1, - 0x480b8806, 0x497b9005, 0x4a038802, 0x0000ffff, - 0x4a0378e4, 0x00003000, 0x42000000, 0x0010b80c, - 0x0201f800, 0x0010aa47, 0x59a81010, 0x42000800, - 0x00000003, 0x0201f800, 0x00106c78, 0x42001000, - 0x00008010, 0x59a8180a, 0x0201f800, 0x00103a3e, - 0x0201f800, 0x00101815, 0x59a80805, 0x82040d00, - 0xffffffdf, 0x48075005, 0x0201f800, 0x0010483d, - 0x0201f800, 0x0010513b, 0x0400000a, 0x0201f800, - 0x0010413e, 0x04000007, 0x4a035013, 0x00000001, - 0x497b5021, 0x0201f800, 0x00103c80, 0x0401f04f, - 0x0201f800, 0x001048ec, 0x04000005, 0x59c41002, - 0x8408150c, 0x480b8802, 0x0401f012, 0x0201f800, - 0x0010513b, 0x04020006, 0x59a8001d, 0x80000540, - 0x02000800, 0x0010930f, 0x0401f00a, 0x0201f800, - 0x0010930f, 0x59a80026, 0x8c000506, 0x04020005, - 0x59a8001d, 0x80000540, 0x02020800, 0x00104245, - 0x497b5028, 0x497b5027, 0x497b5018, 0x0201f800, - 0x0010513b, 0x59a81026, 0x0402000a, 0x0201f800, - 0x0010162a, 0x80001580, 0x59a8002a, 0x82000500, - 0xffff0000, 0x80040d40, 0x4807502a, 0x0401f005, - 0x59a8002a, 0x82000500, 0xffff0000, 0x4803502a, - 0x599c0017, 0x8c00050a, 0x04000002, 0x84081544, - 0x480b5026, 0x0201f800, 0x0010513b, 0x04000004, - 0x0201f800, 0x0010162a, 0x48078880, 0x42001000, - 0x00000005, 0x0201f800, 0x001070b0, 0x497b5028, - 0x497b501b, 0x4a03501c, 0x0000ffff, 0x4a0378e4, - 0x000000c0, 0x4202d800, 0x00000002, 0x0201f800, - 0x0010513b, 0x04000007, 0x59a80026, 0x82000500, - 0x0000000c, 0x82000580, 0x00000004, 0x04000003, - 0x0201f800, 0x00101e45, 0x1c01f000, 0x59a8001c, - 0x82000580, 0x0000ffff, 0x04000004, 0x0201f800, - 0x00101e45, 0x0401f074, 0x59a80026, 0x8c00050a, - 0x04020003, 0x8c000506, 0x0400001c, 0x8c000500, - 0x0400001a, 0x4a038802, 0x0000ffbf, 0x8c000502, - 0x04000016, 0x599c0018, 0x8c000516, 0x04020010, - 0x59a80027, 0x82000580, 0x0000ffff, 0x0400000c, - 0x0201f800, 0x00101f9a, 0x59a80026, 0x8c000504, - 0x0402005d, 0x42001000, 0x00000003, 0x417a5800, - 0x0201f800, 0x00101fbf, 0x0401f057, 0x59a80028, - 0x80000540, 0x04020054, 0x59a80026, 0x8c000508, - 0x04020005, 0x59a8001b, 0x80000540, 0x0402004e, - 0x0401f003, 0x8c000516, 0x0400004b, 0x0201f800, - 0x001048ec, 0x04020048, 0x599c0018, 0x8c000516, - 0x04020004, 0x0201f800, 0x00104c51, 0x04020042, - 0x599c0017, 0x8c00050a, 0x0400000d, 0x4200b000, - 0x000007f0, 0x417a8800, 0x0201f800, 0x00020245, - 0x04020004, 0x59340200, 0x8c00051a, 0x04020036, - 0x81468800, 0x8058b040, 0x040207f8, 0x4a038802, - 0x0000ffff, 0x42001800, 0x0010b4eb, 0x0401fb8c, - 0x42001800, 0x0010b4f8, 0x0401fb89, 0x59a80005, - 0x84000502, 0x48035005, 0x4a0378e4, 0x00000080, - 0x4202d800, 0x00000003, 0x4a03501c, 0x0000ffff, - 0x0401fa7f, 0x80000580, 0x0201f800, 0x00101590, - 0x599c0018, 0x8c000516, 0x04000004, 0x0201f800, - 0x00103b10, 0x0401f009, 0x42001800, 0x0000ffff, - 0x42002000, 0x00000006, 0x42003000, 0x00000000, - 0x0201f800, 0x00103aae, 0x0201f800, 0x00105151, - 0x0400000b, 0x59c40006, 0x0201f800, 0x0010513b, - 0x04000004, 0x82000500, 0xffffff0f, 0x0401f003, - 0x82000500, 0xfbffffff, 0x48038806, 0x0201f800, - 0x00106f36, 0x1c01f000, 0x4c040000, 0x4c080000, - 0x4c100000, 0x59a8003e, 0x82000c80, 0x00000004, - 0x04021980, 0x0c01f805, 0x5c002000, 0x5c001000, - 0x5c000800, 0x1c01f000, 0x00100462, 0x001004ea, - 0x00100516, 0x00100577, 0x42000000, 0x00000001, - 0x0201f800, 0x00101590, 0x0201f800, 0x0010609e, - 0x59c408a3, 0x82040d00, 0xfffffff7, 0x480788a3, - 0x0201f800, 0x00105141, 0x0400000e, 0x0201f800, - 0x00105151, 0x0400000b, 0x0201f800, 0x00105149, - 0x04020964, 0x59c400a3, 0x84000532, 0x84000570, - 0x480388a3, 0x4a038808, 0x00000008, 0x0401f010, - 0x59c400a3, 0x84000530, 0x82000500, 0xbf7fffff, - 0x480388a3, 0x42000800, 0x000000f8, 0x0201f800, - 0x00104200, 0x59c400a3, 0x82000540, 0x00018000, - 0x8400051c, 0x480388a3, 0x497b8808, 0x59c40006, - 0x82000500, 0xfbffff0e, 0x48038806, 0x497b2822, - 0x497b2823, 0x42000800, 0x000001f4, 0x42001000, - 0x00100591, 0x0201f800, 0x00105f83, 0x59c40805, - 0x42001000, 0x00000001, 0x0201f800, 0x0010193d, - 0x0201f800, 0x0010163b, 0x0402000a, 0x42000000, - 0x00000001, 0x0201f800, 0x0010188c, 0x42000000, - 0x00000001, 0x0201f800, 0x00101821, 0x0401f022, - 0x0201f800, 0x00101642, 0x04020008, 0x41780000, - 0x0201f800, 0x0010188c, 0x41780000, 0x0201f800, - 0x00101821, 0x0401f018, 0x0201f800, 0x00101649, - 0x0402000a, 0x42000000, 0x00000002, 0x0201f800, - 0x0010188c, 0x42000000, 0x00000002, 0x0201f800, - 0x00101821, 0x0401f00c, 0x0201f800, 0x00101650, - 0x04020918, 0x59a80049, 0x800001c0, 0x04000006, - 0x0201f800, 0x00101656, 0x4a03503e, 0x00000001, - 0x0401f021, 0x0201f800, 0x00101927, 0x4a03503e, - 0x00000001, 0x0201f800, 0x00105141, 0x0400000c, - 0x0201f800, 0x00105151, 0x04000009, 0x0201f800, - 0x00105149, 0x04020903, 0x4a035033, 0x00000001, - 0x0201f800, 0x001050a2, 0x0401f00f, 0x59c400a4, - 0x82000500, 0x0000000f, 0x82000580, 0x00000008, - 0x04000003, 0x4a038805, 0x04000000, 0x59c400a3, - 0x82000540, 0x0001c000, 0x480388a3, 0x84000520, - 0x480388a3, 0x1c01f000, 0x0401f8a3, 0x04020004, - 0x4a03503e, 0x00000003, 0x0401f027, 0x0201f800, - 0x00101650, 0x04020011, 0x59a80049, 0x800001c0, - 0x0400000e, 0x0201f800, 0x00101656, 0x59a80048, - 0x8c00051e, 0x0400001c, 0x0201f800, 0x00105149, - 0x04020009, 0x4a035033, 0x00000001, 0x0201f800, - 0x001050a2, 0x0401f004, 0x0201f800, 0x001018d3, - 0x04020011, 0x0201f800, 0x00101815, 0x4a03503e, - 0x00000002, 0x497b5049, 0x59c400a3, 0x84000520, - 0x480388a3, 0x497b2822, 0x497b2823, 0x42000800, - 0x0000002d, 0x42001000, 0x00100591, 0x0201f800, - 0x00105f83, 0x1c01f000, 0x0401f877, 0x04020004, - 0x4a03503e, 0x00000003, 0x0401f05b, 0x4a038805, - 0x000000f0, 0x0201f800, 0x001018d3, 0x04020050, - 0x0201f800, 0x00105149, 0x04000044, 0x59c400a4, - 0x82000500, 0x0000000f, 0x82000580, 0x00000008, - 0x04000020, 0x59c40005, 0x8c000534, 0x0402001d, - 0x59940022, 0x82000580, 0x00000001, 0x04020046, - 0x0201f800, 0x00105151, 0x04020043, 0x4a038805, - 0x000000f0, 0x0201f800, 0x00105196, 0x4a035032, - 0x0000aaaa, 0x4a035033, 0x00000000, 0x59c408a3, - 0x82040d40, 0x00000008, 0x480788a3, 0x4202d800, - 0x00000001, 0x4a03503e, 0x00000000, 0x4a038805, - 0x00000001, 0x497b2822, 0x497b2823, 0x0401f01f, - 0x0201f800, 0x00105151, 0x04020007, 0x59a80032, - 0x82000580, 0x0000aaaa, 0x04020003, 0x4a035010, - 0x00ffffff, 0x497b5032, 0x59c40006, 0x82000540, - 0x04000001, 0x48038806, 0x59a80805, 0x8c040d06, - 0x04020005, 0x59c408a3, 0x82040d40, 0x00000008, - 0x480788a3, 0x4202d800, 0x00000001, 0x4a03503e, - 0x00000000, 0x4a038805, 0x00000001, 0x497b2822, - 0x497b2823, 0x0401f010, 0x59c40005, 0x82000500, - 0x000000c0, 0x0400000c, 0x59c40006, 0x82000540, - 0x000000f1, 0x48038806, 0x0401f7ef, 0x0201f800, - 0x00101650, 0x04020004, 0x59a80049, 0x800001c0, - 0x040207a4, 0x497b8885, 0x1c01f000, 0x4803c856, - 0x42000000, 0x00000001, 0x0201f800, 0x00101590, - 0x4a03503e, 0x00000000, 0x0201f800, 0x00101650, - 0x0402000b, 0x59a80052, 0x800001c0, 0x04000004, - 0x80000040, 0x48035052, 0x04020005, 0x4a035052, - 0x0000000a, 0x4a035049, 0x00000001, 0x497b8885, - 0x0401f0ed, 0x59940022, 0x59940823, 0x80040540, - 0x1c01f000, 0x497b2823, 0x1c01f000, 0x4c080000, - 0x42001000, 0x000000f0, 0x0201f800, 0x0010193d, - 0x5c001000, 0x1c01f000, 0x4a03505c, 0x00000004, - 0x4a03505d, 0x00000000, 0x4a03505e, 0x00000010, - 0x4a03505f, 0x00000002, 0x4a035010, 0x00ffffff, - 0x0201f800, 0x0010930f, 0x4a03502a, 0x20200000, - 0x4a03502b, 0x88000200, 0x4a03502c, 0x00ff001f, - 0x4a03502d, 0x000007d0, 0x4a03502e, 0x80000000, - 0x4a03502f, 0x00000200, 0x4a035030, 0x00ff0000, - 0x4a035031, 0x00010000, 0x4a03503a, 0x514c4f47, - 0x4a03503b, 0x49432020, 0x1c01f000, 0x4d440000, - 0x417a8800, 0x41780800, 0x0201f800, 0x00020245, - 0x04020005, 0x0201f800, 0x001049e7, 0x04020002, - 0x80040800, 0x81468800, 0x83440580, 0x000007f0, - 0x040207f6, 0x5c028800, 0x1c01f000, 0x4803c857, - 0x5c000000, 0x4c000000, 0x4803c857, 0x0401f809, - 0x485fc857, 0x4203e000, 0x50000000, 0x5c000000, - 0x4d780000, 0x4200b800, 0x00008002, 0x0401f006, - 0x485fc857, 0x4203e000, 0x50000000, 0x4200b800, - 0x00008002, 0x04006000, 0x4c000000, 0x4c040000, - 0x59bc00ea, 0x82000500, 0x00000007, 0x82000580, - 0x00000001, 0x04020005, 0x42000800, 0x00000000, - 0x0201f800, 0x00106c6c, 0x5c000800, 0x4807c025, - 0x80040920, 0x4807c026, 0x5c000000, 0x4803c023, - 0x80000120, 0x4803c024, 0x5c000000, 0x4803c857, - 0x4803c021, 0x80000120, 0x4803c022, 0x41f80000, - 0x4803c027, 0x80000120, 0x4803c028, 0x42000000, - 0x00001000, 0x50000000, 0x82000480, 0x24320001, - 0x4803c857, 0x0400104f, 0x42000800, 0x00000064, - 0x80040840, 0x04000007, 0x4a030000, 0x00000001, - 0x40000000, 0x59800000, 0x8c000500, 0x040007f9, - 0x04000042, 0x42000800, 0x0010c1a3, 0x46000800, - 0xfaceface, 0x80040800, 0x42001000, 0x00007a00, - 0x58080013, 0x44000800, 0x80040800, 0x58080019, - 0x44000800, 0x80040800, 0x5808001a, 0x44000800, - 0x80040800, 0x5808001b, 0x44000800, 0x80040800, - 0x5808001c, 0x44000800, 0x80040800, 0x5808001f, - 0x44000800, 0x80040800, 0x42001000, 0x00007a40, - 0x42001800, 0x0000000b, 0x50080000, 0x44000800, - 0x80081000, 0x80040800, 0x800c1840, 0x040207fb, - 0x42001800, 0x00000003, 0x42001000, 0x00007b00, - 0x480c1003, 0x58080005, 0x44000800, 0x80040800, - 0x800c1840, 0x040217fb, 0x42001000, 0x00007c00, - 0x58080002, 0x44000800, 0x80040800, 0x58080003, - 0x44000800, 0x80040800, 0x58080020, 0x44000800, - 0x80040800, 0x58080021, 0x44000800, 0x80040800, - 0x58080022, 0x44000800, 0x80040800, 0x58080023, - 0x44000800, 0x80040800, 0x4a030000, 0x00000000, - 0x485fc020, 0x905cb9c0, 0x825cbd40, 0x00000012, - 0x485fc011, 0x4203e000, 0x40000000, 0x4202d800, - 0x00000005, 0x59e00017, 0x8c000508, 0x04000003, - 0x4a03c017, 0x00000002, 0x4203e000, 0x30000001, - 0x0401f81a, 0x0401f7ff, 0x4a03c850, 0x0010c1bf, - 0x4a03c851, 0x0010d1be, 0x4a03c853, 0x00000800, - 0x4a03c855, 0x0001eb5a, 0x59e40001, 0x82000540, - 0x00003f00, 0x4803c801, 0x4a03b104, 0x70000002, - 0x4a03a804, 0x70000002, 0x4a03b004, 0x70000002, - 0x42000000, 0x0010b8ec, 0x49780001, 0x49780002, - 0x1c01f000, 0x1c01f000, 0x59a8006b, 0x8c000530, - 0x040207fe, 0x4c080000, 0x42001000, 0x00000004, - 0x0401f862, 0x5c001000, 0x4201d000, 0x00028b0a, - 0x0201f800, 0x0010608e, 0x4c080000, 0x42001000, - 0x00000008, 0x0401f859, 0x5c001000, 0x4201d000, - 0x00028b0a, 0x0201f800, 0x0010608e, 0x4c080000, - 0x42001000, 0x00000010, 0x0401f850, 0x5c001000, - 0x4201d000, 0x00028b0a, 0x0201f800, 0x0010608e, - 0x0401f7e2, 0x8c00050c, 0x59a8086b, 0x04020003, - 0x84040d30, 0x0401f006, 0x84040d70, 0x4807506b, - 0x42001000, 0x00000000, 0x0401f040, 0x4807506b, - 0x836c0500, 0x00000007, 0x0c01f001, 0x001006e1, - 0x001006c7, 0x001006c7, 0x001006af, 0x001006d4, - 0x001006c7, 0x001006c7, 0x001006d4, 0x59a80005, - 0x8c000514, 0x04020013, 0x59c40801, 0x82040d00, - 0x00018000, 0x82040580, 0x00010000, 0x0400000a, - 0x82040580, 0x00008000, 0x04000004, 0x42001000, - 0x42004000, 0x0401f006, 0x42001000, 0x22002000, - 0x0401f003, 0x42001000, 0x12001000, 0x0401f025, - 0x42001000, 0x00001004, 0x0401f022, 0x59a80005, - 0x8c000514, 0x04020008, 0x59a8006b, 0x8c000534, - 0x04020004, 0x42001000, 0x74057005, 0x0401f819, - 0x1c01f000, 0x42001000, 0x00002008, 0x0401f7fc, - 0x59a8006b, 0x8c000534, 0x0402000a, 0x59a80005, - 0x8c000514, 0x04000004, 0x42001000, 0x24052005, - 0x0401f00c, 0x42001000, 0x74057005, 0x0401f009, - 0x1c01f000, 0x1c01f000, 0x82081500, 0x0000001c, - 0x82081540, 0x001c0000, 0x480bc013, 0x1c01f000, - 0x59a8006b, 0x8c000530, 0x04000002, 0x84081570, - 0x480b506b, 0x8c000530, 0x04020005, 0x82081500, - 0x00007000, 0x80081114, 0x0401fff0, 0x1c01f000, - 0x41780000, 0x50041800, 0x800c0400, 0x80040800, - 0x80102040, 0x040207fc, 0x80080500, 0x80000540, - 0x1c01f000, 0x4202f000, 0x00000000, 0x41780000, - 0x41780800, 0x41781000, 0x41781800, 0x41782000, - 0x41782800, 0x41783000, 0x41783800, 0x41784000, - 0x41784800, 0x41785000, 0x41785800, 0x41786000, - 0x41786800, 0x41787000, 0x41787800, 0x41788000, - 0x41788800, 0x41789000, 0x41789800, 0x4178a000, - 0x4178a800, 0x4178b000, 0x4178b800, 0x4178c000, - 0x4178c800, 0x4178d000, 0x4178d800, 0x4178e000, - 0x4178e800, 0x4178f000, 0x4178f800, 0x41790000, - 0x41790800, 0x41791000, 0x41791800, 0x41792000, - 0x41792800, 0x41793000, 0x41793800, 0x41794000, - 0x41794800, 0x41795000, 0x41795800, 0x41796000, - 0x41796800, 0x41797000, 0x41797800, 0x41798000, - 0x41798800, 0x42019000, 0x0010b537, 0x42019800, - 0x0010b50e, 0x4179a000, 0x4179b000, 0x4179a800, - 0x4179b800, 0x4179c800, 0x4179c000, 0x4179d000, - 0x4179d800, 0x4179e000, 0x4179e800, 0x4179f000, - 0x4179f800, 0x417a0000, 0x417a0800, 0x417a1000, - 0x417a1800, 0x417a2000, 0x42022800, 0x00006100, - 0x417a3000, 0x417a3800, 0x417a4000, 0x417a4800, - 0x417a5000, 0x417a5800, 0x417a6000, 0x417a6800, - 0x417a7000, 0x417a7800, 0x417a8000, 0x417a8800, - 0x417a9000, 0x417a9800, 0x417ae800, 0x417af800, - 0x42030000, 0x00007c00, 0x42031000, 0x0010b806, - 0x42031800, 0x0000bf1d, 0x42032000, 0x0000bf32, - 0x42032800, 0x0010b7ce, 0x42033000, 0x0010b46e, - 0x42034000, 0x0010b4a4, 0x42033800, 0x0010b4c3, - 0x42034800, 0x0010b544, 0x42035000, 0x0010b400, - 0x42035800, 0x0010ac00, 0x42030800, 0x0010b505, - 0x417b6000, 0x42036800, 0x00006f00, 0x4203c800, - 0x00003000, 0x42037000, 0x0000ff00, 0x42037800, - 0x0000bf00, 0x42038000, 0x00007700, 0x42038800, - 0x00004000, 0x42039000, 0x00006000, 0x42039800, - 0x0010bedb, 0x4203a000, 0x00007600, 0x4203a800, - 0x00007400, 0x4203b000, 0x00007200, 0x4203b800, - 0x00007100, 0x4203c000, 0x00007000, 0x4203d000, - 0x00000000, 0x4203e800, 0x00101b95, 0x417bd800, - 0x1c01f000, 0x42000800, 0x00100000, 0x50040000, - 0x4c000000, 0x42000000, 0x0000aaaa, 0x44000800, - 0x42001800, 0x00005555, 0x41782000, 0x82102400, - 0x00010000, 0x40100000, 0x80042c00, 0x440c2800, - 0x42003000, 0x0000000a, 0x80183040, 0x040207ff, - 0x50140000, 0x800c0580, 0x04020004, 0x50040000, - 0x800c0580, 0x040207f2, 0x5c000000, 0x44000800, - 0x80142840, 0x4817c861, 0x1c01f000, 0x59a8081f, - 0x800409c0, 0x04020009, 0x49781c0c, 0x4a001a0c, - 0x00000200, 0x4a001804, 0x07000000, 0x59a80010, - 0x9c0001c0, 0x48001805, 0x0401fe01, 0x9c0409c0, - 0x48041806, 0x1c01f000, 0x59a8080c, 0x4006d000, - 0x4202b800, 0x00000001, 0x59a8180d, 0x480fc857, - 0x82041400, 0x00000014, 0x82082400, 0x00000014, - 0x40100000, 0x800c0480, 0x04001006, 0x44080800, - 0x40080800, 0x40101000, 0x815eb800, 0x0401f7f7, - 0x45780800, 0x495f5020, 0x1c01f000, 0x835c0480, - 0x00000020, 0x04001009, 0x496bc857, 0x815eb840, - 0x416a5800, 0x592ed000, 0x497a5800, 0x497a5801, - 0x812e59c0, 0x1c01f000, 0x42000000, 0x0010b853, - 0x0201f800, 0x0010aa47, 0x417a5800, 0x0401f7f9, - 0x815eb840, 0x04001008, 0x416a5800, 0x492fc857, - 0x592ed000, 0x497a5800, 0x497a5801, 0x812e59c0, - 0x1c01f000, 0x42000000, 0x0010b853, 0x0201f800, - 0x0010aa47, 0x417ab800, 0x417a5800, 0x0401f7f8, - 0x492fc857, 0x496a5800, 0x412ed000, 0x815eb800, - 0x59c80000, 0x82000540, 0x00001200, 0x48039000, - 0x1c01f000, 0x492fc857, 0x812e59c0, 0x04000007, - 0x592c0001, 0x497a5801, 0x4c000000, 0x0401fff1, - 0x5c025800, 0x0401f7f9, 0x1c01f000, 0x4807c856, - 0x42007000, 0x0010b7f8, 0x4a007001, 0x00000000, - 0x59e00003, 0x82000540, 0x00008080, 0x4803c003, - 0x4a03b805, 0x90000001, 0x59dc0006, 0x4a03b805, - 0x70000000, 0x59dc0006, 0x4a03b805, 0x30000000, - 0x4200b000, 0x00000020, 0x497bb807, 0x8058b040, - 0x040207fe, 0x4a03b805, 0x30000000, 0x59dc0006, - 0x4a03b805, 0x60000001, 0x59dc0006, 0x4a03b805, - 0x70000001, 0x59dc0006, 0x4a03b805, 0x30000002, - 0x4200b000, 0x00000020, 0x497bb807, 0x8058b040, - 0x040207fe, 0x4a03b805, 0x30000000, 0x59dc0006, - 0x4a03b805, 0x60000001, 0x0401ffa1, 0x04000da5, - 0x42001000, 0x0010b7f6, 0x452c1000, 0x4a025801, - 0x00000001, 0x4a025802, 0x00000100, 0x4a025809, - 0x00107149, 0x497a580a, 0x497a580b, 0x497a580c, - 0x0401ff93, 0x04000d97, 0x42001000, 0x0010b7f7, - 0x452c1000, 0x4a025801, 0x00000000, 0x4a025802, - 0x00000100, 0x4a025809, 0x001011bc, 0x497a5803, - 0x497a5807, 0x497a5808, 0x497a580a, 0x59a80005, - 0x8c00050e, 0x04000006, 0x4a03b805, 0xe0000001, - 0x59dc0006, 0x8c000522, 0x040007fc, 0x1c01f000, - 0x4df00000, 0x4203e000, 0x50000000, 0x4c380000, - 0x40087000, 0x480bc857, 0x4a007002, 0x00000000, - 0x42007000, 0x0010b7f8, 0x82080400, 0x00000000, - 0x45780000, 0x58380005, 0x48087005, 0x80000540, - 0x04000005, 0x82000400, 0x00000000, 0x44080000, - 0x0401f003, 0x480bc857, 0x48087006, 0x58380001, - 0x80000540, 0x0400080c, 0x5c007000, 0x5c03e000, - 0x1c01f000, 0x4c380000, 0x42007000, 0x0010b7f8, - 0x58380001, 0x80000540, 0x04000803, 0x5c007000, - 0x1c01f000, 0x42007000, 0x0010b7f8, 0x58380001, - 0x82000580, 0x00000000, 0x04020012, 0x58380000, - 0x0c01f001, 0x0010088e, 0x0010088d, 0x0010088d, - 0x0010088d, 0x0010088d, 0x0010088d, 0x0010088d, - 0x0010088d, 0x0401fd4b, 0x58380808, 0x800409c0, - 0x04020024, 0x58380006, 0x80000540, 0x04020002, - 0x1c01f000, 0x4803c857, 0x48007002, 0x40006800, - 0x58340000, 0x80000540, 0x04020002, 0x48007005, - 0x48007006, 0x4a03b805, 0x20000000, 0x59dc0006, - 0x4a03b805, 0x30000000, 0x58340007, 0x4803b800, - 0x58340008, 0x4803b801, 0x58340004, 0x48007003, - 0x58340003, 0x48007004, 0x4803b803, 0x58340001, - 0x8c000500, 0x04000004, 0x4a007001, 0x00000001, - 0x0401f028, 0x4a007001, 0x00000002, 0x0401f03d, - 0x0201f800, 0x001093ea, 0x0201f800, 0x0010a69d, - 0x04000017, 0x4a03b805, 0x20000000, 0x59dc0006, - 0x4a03b805, 0x30000000, 0x4807b800, 0x480bb801, - 0x4a007003, 0x00000010, 0x480c7009, 0x42001000, - 0x00100875, 0x0201f800, 0x00105f9a, 0x58380008, - 0x82000400, 0x00000004, 0x48007004, 0x4803b803, - 0x4a007001, 0x00000007, 0x0401f022, 0x0201f800, - 0x00109402, 0x42000800, 0x00000001, 0x42001000, - 0x00100875, 0x0201f800, 0x00105f76, 0x0401f7ba, - 0x4c040000, 0x4c080000, 0x58380803, 0x42001000, - 0x00003fff, 0x82040480, 0x00003fff, 0x04021003, - 0x40041000, 0x80000580, 0x48007003, 0x800800c4, - 0x4803b802, 0x4a03b805, 0x30000002, 0x59dc0006, - 0x4a03b805, 0x70000001, 0x59dc0006, 0x4a03b805, - 0x10000000, 0x5c001000, 0x5c000800, 0x1c01f000, - 0x483bc857, 0x4c040000, 0x4c080000, 0x58380803, - 0x42001000, 0x00003fff, 0x82040480, 0x00003fff, - 0x04021003, 0x40041000, 0x80000580, 0x48007003, - 0x800800c4, 0x4803b802, 0x4a03b805, 0x10000002, - 0x5c001000, 0x5c000800, 0x1c01f000, 0x4c040000, - 0x4c380000, 0x42007000, 0x0010b7f8, 0x59dc0806, - 0x4807c857, 0x4a03b805, 0x20000000, 0x8c040d3e, - 0x04000007, 0x8c040d08, 0x04020cca, 0x58380001, - 0x82000500, 0x00000007, 0x0c01f804, 0x5c007000, - 0x5c000800, 0x1c01f000, 0x0010087d, 0x0010091e, - 0x0010092e, 0x001005d8, 0x001005d8, 0x001005d8, - 0x001005d8, 0x001011ea, 0x4807c856, 0x82040d00, - 0x43000f80, 0x04020009, 0x58380003, 0x80000540, - 0x0400001c, 0x59dc0000, 0x4803b800, 0x59dc0001, - 0x4803b801, 0x0401f7af, 0x58380802, 0x4a000802, - 0x00000200, 0x0401f01e, 0x4807c856, 0x82040d00, - 0x43000f80, 0x04020009, 0x58380003, 0x80000540, - 0x0400000c, 0x59dc0000, 0x4803b800, 0x59dc0001, - 0x4803b801, 0x0401f7b7, 0x58380002, 0x82000400, - 0x00000002, 0x46000000, 0x00000200, 0x0401f00c, - 0x4c340000, 0x58386802, 0x59dc0000, 0x4803c857, - 0x48006807, 0x59dc0001, 0x4803c857, 0x48006808, - 0x4a006802, 0x00000100, 0x5c006800, 0x4a007001, - 0x00000000, 0x4c300000, 0x58386002, 0x0401f80c, - 0x04000009, 0x58300009, 0x82000c80, 0x0010ab4a, - 0x04021c84, 0x82000c80, 0x00020000, 0x04001c81, - 0x0801f800, 0x5c006000, 0x0401f723, 0x4833c857, - 0x803061c0, 0x04000009, 0x59a8000c, 0x80300480, - 0x04001007, 0x59a8000d, 0x80300480, 0x04021004, - 0x82000540, 0x00000001, 0x1c01f000, 0x80000580, - 0x1c01f000, 0x4803c856, 0x4dc00000, 0x42007000, - 0x0010b803, 0x4a007400, 0x00000000, 0x49787001, - 0x42038000, 0x00007720, 0x4a038006, 0x60000001, - 0x4a038009, 0xf4f60000, 0x42038000, 0x00007700, - 0x4a038006, 0x60000001, 0x4a038009, 0xf4f60000, - 0x4a03c822, 0x00000010, 0x4a0370e8, 0x00000000, - 0x0401f809, 0x4a0370e9, 0x00003a0f, 0x4a0370e8, - 0x00000000, 0x4a0370e8, 0x00000001, 0x5c038000, - 0x1c01f000, 0x4c5c0000, 0x4178b800, 0x0401f80a, - 0x5c00b800, 0x1c01f000, 0x4803c856, 0x4c5c0000, - 0x825cbd40, 0x00000001, 0x0401f803, 0x5c00b800, - 0x1c01f000, 0x4803c856, 0x4dc00000, 0x4c500000, - 0x4c580000, 0x4c540000, 0x4a0370e8, 0x00000000, - 0x805cb9c0, 0x04000009, 0x4a038807, 0x00000004, - 0x59b800ea, 0x8c000510, 0x04000004, 0x59b800e0, - 0x0401f87b, 0x0401f7fb, 0x42038000, 0x00007720, - 0x0201f800, 0x00100ec1, 0x59c00007, 0x4a038006, - 0x20000000, 0x59c00007, 0x4a038006, 0x8000000a, - 0x59c00007, 0x4a038006, 0x8000000b, 0x59c00007, - 0x4a038006, 0x40000001, 0x83c00580, 0x00007700, - 0x04000004, 0x42038000, 0x00007700, 0x0401f7ed, - 0x42038000, 0x00007720, 0x42000800, 0x00000800, - 0x59c00007, 0x8c00051e, 0x04000006, 0x4a038006, - 0x90000001, 0x80040840, 0x040207fa, 0x0401fc11, - 0x83c00580, 0x00007700, 0x04000004, 0x42038000, - 0x00007700, 0x0401f7f1, 0x805cb9c0, 0x0402001d, - 0x4200b000, 0x00000020, 0x83b8ac00, 0x00000020, - 0x0201f800, 0x0010ab20, 0x4a0370fb, 0x00000001, - 0x4a037020, 0x001010bd, 0x59a80039, 0x82000500, - 0x0000ffff, 0x48037021, 0x4a037035, 0x0010bddb, - 0x4a037030, 0x0010b410, 0x4a037031, 0x0010ac00, - 0x4a037032, 0x0010b519, 0x4a037036, 0x0010b524, - 0x59840002, 0x48037034, 0x4a037038, 0x001010b4, - 0x4a0370fb, 0x00000001, 0x4178a000, 0x4200b000, - 0x00000020, 0x83b8ac00, 0x00000000, 0x0201f800, - 0x0010ab20, 0x4200b000, 0x00000040, 0x83b8ac00, - 0x00000040, 0x0201f800, 0x0010ab20, 0x805cb9c0, - 0x04020004, 0x4a0370e4, 0xaaaaaaaa, 0x0401f003, - 0x4a0370e4, 0xa2aaaa82, 0x4a0370e5, 0xaaaaaaaa, - 0x4a0370e6, 0xaaaaaaaa, 0x4a0370fb, 0x00000000, - 0x4a0370e6, 0xaaaaaaaa, 0x42038000, 0x00007720, - 0x4a038006, 0x90000000, 0x59c00007, 0x8c00051e, - 0x02020800, 0x001005d8, 0x42038000, 0x00007700, - 0x4a038006, 0x90000000, 0x59c00007, 0x8c00051e, - 0x02020800, 0x001005d8, 0x5c00a800, 0x5c00b000, - 0x5c00a000, 0x5c038000, 0x1c01f000, 0x4d300000, - 0x4d380000, 0x40026000, 0x82000500, 0x7f000000, - 0x82000580, 0x00000003, 0x0402000f, 0x83326500, - 0x00ffffff, 0x59300203, 0x82000580, 0x00000004, - 0x04020009, 0x59300c06, 0x82040580, 0x00000009, - 0x04020005, 0x42027000, 0x00000047, 0x0201f800, - 0x000207a1, 0x5c027000, 0x5c026000, 0x1c01f000, - 0x4d300000, 0x4d2c0000, 0x4d340000, 0x4d400000, - 0x4cfc0000, 0x4d380000, 0x4d3c0000, 0x4d440000, - 0x4d4c0000, 0x4d480000, 0x4c5c0000, 0x4c600000, - 0x4c640000, 0x4cc80000, 0x4ccc0000, 0x4cf00000, - 0x4cf40000, 0x4cf80000, 0x4cfc0000, 0x4d000000, - 0x4d040000, 0x0201f800, 0x00020015, 0x5c020800, - 0x5c020000, 0x5c01f800, 0x5c01f000, 0x5c01e800, - 0x5c01e000, 0x5c019800, 0x5c019000, 0x5c00c800, - 0x5c00c000, 0x5c00b800, 0x5c029000, 0x5c029800, - 0x5c028800, 0x5c027800, 0x5c027000, 0x5c01f800, - 0x5c028000, 0x5c026800, 0x5c025800, 0x5c026000, - 0x1c01f000, 0x493bc857, 0x0201f000, 0x00020044, - 0x83300500, 0x1f000000, 0x04000008, 0x81326580, - 0x80000130, 0x82000c80, 0x00000014, 0x02021800, - 0x001005d8, 0x0c01f013, 0x83300500, 0x000000ff, - 0x82000c80, 0x00000007, 0x02021800, 0x001005d8, - 0x0c01f025, 0x1c01f000, 0x82000d00, 0xc0000038, - 0x02020800, 0x001005d0, 0x0201f800, 0x001005d8, - 0x00000000, 0x00000048, 0x00000054, 0x00000053, - 0x00100a9b, 0x00100abf, 0x00100aba, 0x00100adf, - 0x00100aa6, 0x00100ab2, 0x00100a9b, 0x00100ada, - 0x00100b1a, 0x00100a9b, 0x00100a9b, 0x00100a9b, - 0x00100a9b, 0x00100b1d, 0x00100b23, 0x00100b34, - 0x00100b45, 0x00100a9b, 0x00100b4e, 0x00100b5a, - 0x00100a9b, 0x00100a9b, 0x00100a9b, 0x0201f800, - 0x001005d8, 0x00100aa4, 0x00100bff, 0x00100aec, - 0x00100b0f, 0x00100aa4, 0x00100aa4, 0x00100aa4, - 0x0201f800, 0x001005d8, 0x4803c856, 0x59300004, - 0x8c00053e, 0x04020005, 0x42027000, 0x00000055, - 0x0201f000, 0x000207a1, 0x0201f800, 0x00106f60, - 0x040007fa, 0x1c01f000, 0x4803c856, 0x0401f8a9, - 0x40002800, 0x41782000, 0x42027000, 0x00000056, - 0x0201f000, 0x000207a1, 0x4803c856, 0x42027000, - 0x00000057, 0x0201f000, 0x000207a1, 0x4803c856, - 0x59300007, 0x8c00051a, 0x04020010, 0x59325808, - 0x812e59c0, 0x04000014, 0x592c0408, 0x8c00051c, - 0x04020003, 0x4a026011, 0xffffffff, 0x59300004, - 0x8c00053e, 0x04020009, 0x42027000, 0x00000048, - 0x0201f000, 0x000207a1, 0x59325808, 0x4a025a06, - 0x00000007, 0x0401f7f4, 0x0201f800, 0x00106f60, - 0x040007f6, 0x1c01f000, 0x4803c856, 0x83300500, - 0x00ffffff, 0x0201f000, 0x001064d7, 0x1c01f000, - 0x4c040000, 0x59b808ea, 0x82040d00, 0x00000007, - 0x82040580, 0x00000003, 0x04000004, 0x42000000, - 0x60000000, 0x0401f8ab, 0x5c000800, 0x1c01f000, - 0x0401f8f9, 0x59325808, 0x812e59c0, 0x04000018, - 0x592c0204, 0x82000500, 0x000000ff, 0x82000d80, - 0x00000029, 0x04020012, 0x59300203, 0x82000580, - 0x00000003, 0x0400000b, 0x59300807, 0x84040d26, - 0x48066007, 0x0201f800, 0x00020086, 0x4a03900d, - 0x00000040, 0x4a0370e5, 0x00000008, 0x1c01f000, - 0x0201f800, 0x00106f60, 0x040007f4, 0x59880052, - 0x80000000, 0x48031052, 0x4a03900d, 0x00000040, - 0x42000000, 0xc0000000, 0x0401f05a, 0x42007800, - 0x0010bde2, 0x42002000, 0x00003000, 0x42003000, - 0x00000105, 0x0201f800, 0x00105e04, 0x4a0370e4, - 0x02000000, 0x1c01f000, 0x4933c857, 0x0201f000, - 0x0002077d, 0x41300800, 0x800409c0, 0x02020800, - 0x001005d8, 0x0201f800, 0x001005d0, 0x4933c857, - 0x813261c0, 0x02000800, 0x001005d8, 0x0401f835, - 0x40002800, 0x0201f800, 0x0010a99c, 0x0401f8ae, - 0x04000007, 0x59326809, 0x59340200, 0x8c00050e, - 0x59300414, 0x02020800, 0x001092ce, 0x1c01f000, - 0x4933c857, 0x813261c0, 0x02000800, 0x001005d8, - 0x0401f8a1, 0x0400000b, 0x59325808, 0x0201f800, - 0x00109037, 0x04000007, 0x592c0208, 0x8400054e, - 0x48025a08, 0x417a7800, 0x0201f800, 0x00108be3, - 0x1c01f000, 0x485fc857, 0x5c000000, 0x4d780000, - 0x4203e000, 0x50000000, 0x4200b800, 0x00008005, - 0x0201f000, 0x001005dd, 0x4933c857, 0x83300480, - 0x00000020, 0x02021800, 0x001005d8, 0x83300c00, - 0x0010b8cc, 0x50040000, 0x80000000, 0x04001002, - 0x44000800, 0x1c01f000, 0x4933c857, 0x0401f7f4, - 0x4807c856, 0x59b800ea, 0x8c000510, 0x040007fd, - 0x59b800e0, 0x4803c857, 0x1c01f000, 0x4803c856, - 0x42000000, 0x10000000, 0x41300800, 0x0401f02d, - 0x82000500, 0xf0000000, 0x82040d00, 0x0fffffff, - 0x80040d40, 0x4807c857, 0x59b800ea, 0x8c000516, - 0x04020003, 0x480770e1, 0x1c01f000, 0x8c000510, - 0x040007fa, 0x4c040000, 0x0401f809, 0x5c000800, - 0x82100480, 0x00000008, 0x040017f4, 0x4c040000, - 0x0401febc, 0x5c000800, 0x0401f7f0, 0x59b800e2, - 0x59b820e2, 0x80100580, 0x040207fd, 0x80102114, - 0x0401f006, 0x59b800e2, 0x59b820e2, 0x80100580, - 0x040207fd, 0x0401f001, 0x40101800, 0x800c190a, - 0x82100500, 0x0000001f, 0x820c1d00, 0x0000001f, - 0x800c2480, 0x82102500, 0x0000001f, 0x1c01f000, - 0x82000500, 0xf0000000, 0x82040d00, 0x0fffffff, - 0x80040d40, 0x4807c857, 0x42001000, 0x0010b804, - 0x50080000, 0x80000540, 0x04020005, 0x4a0370e5, - 0x00000003, 0x4a0370e4, 0x00000300, 0x80000000, - 0x44001000, 0x42001000, 0x00000400, 0x59b800ea, - 0x8c000510, 0x0400000c, 0x0401ffd5, 0x82100480, - 0x00000008, 0x04001007, 0x4c040000, 0x4c080000, - 0x0401fe88, 0x5c001000, 0x5c000800, 0x0401f020, - 0x59b800ea, 0x8c000516, 0x0402001d, 0x4a0370e4, - 0x00300000, 0x480770e1, 0x42001000, 0x0000ff00, - 0x80081040, 0x04000012, 0x59b808e4, 0x8c040d28, - 0x040207fc, 0x42001000, 0x0010b804, 0x50080000, - 0x80000040, 0x04020005, 0x4a0370e5, 0x00000002, - 0x4a0370e4, 0x00000200, 0x02001800, 0x001005d8, - 0x44001000, 0x8c040d2c, 0x1c01f000, 0x41f80000, - 0x50000000, 0x0201f800, 0x001005d8, 0x80081040, - 0x040207d3, 0x41f80000, 0x50000000, 0x0201f800, - 0x001005d8, 0x4d380000, 0x59300c06, 0x82040580, - 0x00000009, 0x04020006, 0x42027000, 0x00000047, - 0x0201f800, 0x000207a1, 0x80000580, 0x5c027000, - 0x1c01f000, 0x4c500000, 0x4a03900d, 0x00000001, - 0x59c8a020, 0x4a03900d, 0x00000002, 0x59c80820, - 0x8c50a52e, 0x04000002, 0x900409c0, 0x82040d00, - 0x0000ffff, 0x0201f800, 0x00105dd7, 0x02000800, - 0x001005d8, 0x4933c857, 0x8250a500, 0xff000000, - 0x82500580, 0x05000000, 0x04000003, 0x82000540, - 0x00000001, 0x5c00a000, 0x1c01f000, 0x0401ffe6, - 0x4933c857, 0x59300406, 0x82000580, 0x00000000, - 0x04000040, 0x59c82021, 0x4a03900d, 0x00000001, - 0x59c82821, 0x82142d00, 0x0000ffff, 0x59325808, - 0x812e59c0, 0x04000037, 0x59326809, 0x0201f800, - 0x001048d9, 0x02020800, 0x001092b6, 0x599c0019, - 0x8c00050c, 0x04020018, 0x0201f800, 0x001048d9, - 0x04020015, 0x59300811, 0x4807c857, 0x592c0408, - 0x8c00051c, 0x0402000e, 0x8400055c, 0x48025c08, - 0x592c0a04, 0x82040d00, 0x000000ff, 0x82040580, - 0x00000048, 0x04000004, 0x82040580, 0x00000018, - 0x04020003, 0x59300811, 0x48065803, 0x4a026011, - 0x7fffffff, 0x48166013, 0x0201f800, 0x001010dd, - 0x04020014, 0x0401f9fd, 0x40280000, 0x4802600d, - 0x04000005, 0x4832600b, 0x50200000, 0x4802600a, - 0x4822600c, 0x59300414, 0x8c00051c, 0x04020004, - 0x599c0019, 0x8c00050c, 0x0402086e, 0x4a03900d, - 0x00000040, 0x4a0370e5, 0x00000008, 0x1c01f000, - 0x59880052, 0x80000000, 0x48031052, 0x4a03900d, - 0x00000040, 0x42000000, 0xc0000000, 0x0401f71d, - 0x4cf80000, 0x58f40000, 0x8001f540, 0x0401f820, - 0x41781800, 0x0401f8e4, 0x04020014, 0x44140800, - 0x0401f82a, 0x04000011, 0x40043800, 0x42001800, - 0x00000001, 0x40142000, 0x0401f8db, 0x0402000b, - 0x801c3800, 0x501c0000, 0x44000800, 0x0401f810, - 0x801c0580, 0x04000004, 0x44103800, 0x801c3840, - 0x44143800, 0x0401f819, 0x5c01f000, 0x1c01f000, - 0x80f9f1c0, 0x04020003, 0x58f41202, 0x0401f003, - 0x42001000, 0x00000007, 0x1c01f000, 0x80f9f1c0, - 0x04020006, 0x58f40401, 0x82000480, 0x00000002, - 0x80f40400, 0x0401f005, 0x58f80401, 0x82000480, - 0x00000002, 0x80f80400, 0x50002800, 0x80000000, - 0x50002000, 0x1c01f000, 0x80f9f1c0, 0x04020008, - 0x58f40401, 0x82000480, 0x00000002, 0x02001800, - 0x001005d8, 0x4801ec01, 0x0401f00b, 0x58f80401, - 0x82000480, 0x00000002, 0x02001800, 0x001005d8, - 0x4801f401, 0x82000580, 0x00000002, 0x04020002, - 0x0401f809, 0x58f40202, 0x80000040, 0x4801ea02, - 0x02000800, 0x001005d8, 0x82000580, 0x00000001, - 0x1c01f000, 0x4d2c0000, 0x40fa5800, 0x0201f800, - 0x001007f4, 0x4979e800, 0x4179f000, 0x5c025800, - 0x1c01f000, 0x80f5e9c0, 0x04000009, 0x80f9f1c0, - 0x04020ff5, 0x4d2c0000, 0x40f65800, 0x0201f800, - 0x001007f4, 0x4179e800, 0x5c025800, 0x1c01f000, - 0x4cf40000, 0x59300807, 0x82040500, 0x00003100, - 0x04020032, 0x8c040d22, 0x04000032, 0x5930001f, - 0x8001ed40, 0x02000800, 0x001005d8, 0x82000580, - 0xffffffff, 0x04000029, 0x58f40201, 0x82000580, - 0x0000dcb3, 0x02020800, 0x001005d8, 0x58f40a02, - 0x82040500, 0x0000fffe, 0x04000003, 0x0401ff89, - 0x58f40a02, 0x82040480, 0x0000000f, 0x04021059, - 0x80040800, 0x4805ea02, 0x82040580, 0x00000008, - 0x0400005d, 0x82040480, 0x00000008, 0x0400100a, - 0x58f40000, 0x8001ed40, 0x02000800, 0x001005d8, - 0x58f40201, 0x82000580, 0x0000ddb9, 0x02020800, - 0x001005d8, 0x58f40401, 0x82000c00, 0x00000002, - 0x4805ec01, 0x80f40400, 0x59300812, 0x44040000, - 0x80000000, 0x45780000, 0x5c01e800, 0x1c01f000, - 0x42001000, 0x00000400, 0x59b800e4, 0x8c000524, - 0x04020023, 0x4a0370e4, 0x00030000, 0x40000000, - 0x59b800e4, 0x8c000524, 0x0402001b, 0x59300807, - 0x84040d62, 0x48066007, 0x4a0370e4, 0x00020000, - 0x4d2c0000, 0x0201f800, 0x001007d3, 0x04000025, - 0x492e601f, 0x4a025a01, 0x0000dcb3, 0x59300008, - 0x80001d40, 0x02000800, 0x001005d8, 0x580c080f, - 0x48065803, 0x59301811, 0x40040000, 0x800c0580, - 0x0402000d, 0x497a5a02, 0x4a025c01, 0x00000004, - 0x0401f011, 0x4a0370e4, 0x00020000, 0x40000000, - 0x40000000, 0x80081040, 0x02000800, 0x001005d8, - 0x0401f7d6, 0x4a025a02, 0x00000001, 0x4a025c01, - 0x00000006, 0x497a5804, 0x400c0000, 0x80040480, - 0x48025805, 0x412de800, 0x5c025800, 0x0401f7a9, - 0x5c025800, 0x4a02601f, 0xffffffff, 0x0401f7c3, - 0x4d2c0000, 0x58f65800, 0x0201f800, 0x001007f4, - 0x40f65800, 0x0201f800, 0x001007f4, 0x5c025800, - 0x0401f7f5, 0x4d2c0000, 0x0201f800, 0x001007d3, - 0x040007f8, 0x4a025a01, 0x0000ddb9, 0x4a025c01, - 0x00000002, 0x492de800, 0x412de800, 0x5c025800, - 0x0401f7a5, 0x0401ff33, 0x82f40400, 0x00000004, - 0x800c0400, 0x40000800, 0x50040000, 0x80100580, - 0x04000016, 0x82040c00, 0x00000002, 0x80081040, - 0x040207fa, 0x80f9f1c0, 0x04000011, 0x58f41202, - 0x82081480, 0x00000007, 0x82f80400, 0x00000002, - 0x800c0400, 0x40000800, 0x50040000, 0x80100580, - 0x04000006, 0x82040c00, 0x00000002, 0x80081040, - 0x040207fa, 0x0401f002, 0x1c01f000, 0x82000540, - 0x00000001, 0x0401f7fd, 0x4cf40000, 0x4cf80000, - 0x4001e800, 0x592c0a06, 0x800409c0, 0x0402001d, - 0x82f40580, 0xffffffff, 0x04000017, 0x58f40201, - 0x82000580, 0x0000dcb3, 0x02020800, 0x001005d8, - 0x58f40000, 0x8001f540, 0x04000006, 0x58f80201, - 0x82000580, 0x0000ddb9, 0x02020800, 0x001005d8, - 0x41783800, 0x0401f839, 0x04020006, 0x0401ff32, - 0x497a601f, 0x5c01f000, 0x5c01e800, 0x1c01f000, - 0x0401ff2d, 0x4a025a06, 0x00000011, 0x0401f7f9, - 0x82f40580, 0xffffffff, 0x04020f27, 0x0401f7f5, - 0x4cf40000, 0x4cf80000, 0x4001e800, 0x82040580, - 0x00000001, 0x0402001f, 0x82f40580, 0xffffffff, - 0x04000019, 0x58f40201, 0x82000580, 0x0000dcb3, - 0x02020800, 0x001005d8, 0x58f40000, 0x8001f540, - 0x04000006, 0x58f80201, 0x82000580, 0x0000ddb9, - 0x02020800, 0x001005d8, 0x41783800, 0x0401f813, - 0x04020008, 0x0401ff0c, 0x42000800, 0x00000001, - 0x497a601f, 0x5c01f000, 0x5c01e800, 0x1c01f000, - 0x0401ff05, 0x42000800, 0x00000011, 0x0401f7f9, - 0x4c040000, 0x82f40580, 0xffffffff, 0x04020efe, - 0x5c000800, 0x0401f7f3, 0x4803c856, 0x401c2000, - 0x41781800, 0x0401ff8c, 0x0402002c, 0x58f42003, - 0x42001800, 0x00000001, 0x0401ff87, 0x04020027, - 0x0401feb8, 0x40082800, 0x82f40400, 0x00000004, - 0x40003000, 0x50182000, 0x40100000, 0x801c0580, - 0x04000005, 0x42001800, 0x00000001, 0x0401ff7a, - 0x0402001a, 0x82183400, 0x00000002, 0x80142840, - 0x040207f5, 0x80f9f1c0, 0x04000013, 0x58f42a02, - 0x82142c80, 0x00000007, 0x82f80400, 0x00000003, - 0x40003000, 0x50182000, 0x40100000, 0x801c0580, - 0x04000005, 0x42001800, 0x00000001, 0x0401ff66, - 0x04020006, 0x82183400, 0x00000002, 0x80142840, - 0x040207f5, 0x1c01f000, 0x82000540, 0x00000001, - 0x0401f7fd, 0x0201f800, 0x001005d8, 0x58380207, - 0x8c000502, 0x040007fc, 0x50200000, 0x80387c00, - 0x583c2800, 0x583c2001, 0x58380404, 0x80001540, - 0x04020002, 0x58381407, 0x58c83401, 0x58380c08, - 0x59303807, 0x497a6012, 0x497a6013, 0x0201f000, - 0x000200be, 0x592c0408, 0x8c000502, 0x040007ea, - 0x592c0409, 0x80000540, 0x040007e7, 0x82000c80, - 0x00000002, 0x04001011, 0x58380001, 0x80007540, - 0x02000800, 0x001005d8, 0x58380204, 0x82000500, - 0x0000000f, 0x82000400, 0x001010bd, 0x50004000, - 0x40040000, 0x800409c0, 0x04000005, 0x82040c80, - 0x00000005, 0x040217f1, 0x80204400, 0x50200000, - 0x80387c00, 0x583c2800, 0x583c2001, 0x583c1002, - 0x592c0a07, 0x592c4c08, 0x592c300d, 0x59303807, - 0x497a6012, 0x497a6013, 0x4816600e, 0x4812600f, - 0x480a6010, 0x481a6011, 0x80040840, 0x4806600d, - 0x02000000, 0x000200c6, 0x80204000, 0x50201800, - 0x800c19c0, 0x0402000c, 0x58380001, 0x80007540, - 0x02000800, 0x001005d8, 0x58380204, 0x82000500, - 0x0000000f, 0x82000400, 0x001010bd, 0x50004000, - 0x50201800, 0x483a600b, 0x480e600a, 0x4822600c, - 0x0201f000, 0x000200c6, 0x4803c856, 0x592c0208, - 0x8c00051e, 0x04020017, 0x50200000, 0x80306c00, - 0x40240000, 0x0c01f001, 0x00100e46, 0x00100e46, - 0x00100e4f, 0x00100e46, 0x00100e46, 0x00100e46, - 0x00100e46, 0x00100e46, 0x00100e4f, 0x00100e46, - 0x00100e4f, 0x00100e46, 0x00100e46, 0x00100e4f, - 0x00100e46, 0x00100e46, 0x0201f800, 0x001005d8, - 0x8400051e, 0x48025a08, 0x50200000, 0x80306c00, - 0x58343801, 0x481e600f, 0x0401f007, 0x58341802, - 0x58342800, 0x58343801, 0x480e6010, 0x4816600e, - 0x481e600f, 0x0401f246, 0x4933c857, 0x5931f808, - 0x59300a06, 0x800409c0, 0x04000005, 0x80040906, - 0x04020002, 0x80040800, 0x4805fc06, 0x4a026206, - 0x00000002, 0x592c0409, 0x82000500, 0x00000008, - 0x0400000b, 0x0401f834, 0x59300203, 0x82000580, - 0x00000004, 0x04020005, 0x42027000, 0x00000048, - 0x0201f800, 0x000207a1, 0x1c01f000, 0x4cfc0000, - 0x58fc0204, 0x82000500, 0x000000ff, 0x82000580, - 0x00000048, 0x0402000c, 0x58fc000b, 0x800001c0, - 0x04000009, 0x58fc0407, 0x800001c0, 0x04000006, - 0x58fc080b, 0x8c040d16, 0x04000017, 0x58fc0007, - 0x0401f00a, 0x58fc0408, 0x8c000512, 0x04020014, - 0x58fc0c09, 0x8c040d16, 0x04020003, 0x5c01f800, - 0x1c01f000, 0x58fc000a, 0x59300811, 0x80040580, - 0x04020009, 0x59300007, 0x84000500, 0x48026007, - 0x42027000, 0x00000048, 0x5c01f800, 0x0201f000, - 0x000207a1, 0x5c01f800, 0x1c01f000, 0x58fdf809, - 0x0401f7ec, 0x4933c857, 0x59b808ea, 0x82040d00, - 0x00000007, 0x82040580, 0x00000000, 0x0400001e, - 0x82040580, 0x00000003, 0x0400001b, 0x59300406, - 0x4c000000, 0x4a026406, 0x00000000, 0x42003000, - 0x00000041, 0x42000000, 0x50000000, 0x41300800, - 0x4c180000, 0x0401fce7, 0x5c003000, 0x0400000b, - 0x42000000, 0x0000001e, 0x80000040, 0x040207ff, - 0x80183040, 0x040207f4, 0x42000000, 0x40000000, - 0x41300800, 0x0401fcdb, 0x5c000000, 0x48026406, - 0x1c01f000, 0x59300007, 0x84000500, 0x48026007, - 0x0401f7fc, 0x59c00007, 0x4a038006, 0x30000000, - 0x40000000, 0x59c00007, 0x8c00050a, 0x040207fe, - 0x1c01f000, 0x5c000000, 0x4c000000, 0x4803c857, - 0x4dc00000, 0x4a0370e8, 0x00000000, 0x42038000, - 0x00007720, 0x0401fff0, 0x42038000, 0x00007700, - 0x0401ffed, 0x0201f800, 0x0010513b, 0x04020013, - 0x4a038891, 0x0000ffff, 0x497b8880, 0x497b8892, - 0x42001000, 0x00000190, 0x40000000, 0x40000000, - 0x80081040, 0x040207fd, 0x42000000, 0x0010b8a6, - 0x0201f800, 0x0010aa47, 0x0401f80e, 0x5c038000, - 0x0201f000, 0x00105258, 0x0401f82d, 0x42000000, - 0x0010b8a7, 0x0201f800, 0x0010aa47, 0x0401f805, - 0x48178892, 0x480b8880, 0x5c038000, 0x1c01f000, - 0x496fc857, 0x836c0580, 0x00000003, 0x0402000b, - 0x4c080000, 0x4c0c0000, 0x42001000, 0x00008048, - 0x42001800, 0x0000ffff, 0x0201f800, 0x00103a3e, - 0x5c001800, 0x5c001000, 0x42000800, 0x0000003c, - 0x0201f800, 0x00101345, 0x59a8006c, 0x80000540, - 0x04000006, 0x59a8106d, 0x800811c0, 0x04000003, - 0x0201f800, 0x00101aaf, 0x4a038891, 0x0000ffff, - 0x4a03900d, 0x00000040, 0x0201f800, 0x0010098e, - 0x4a0370e8, 0x00000001, 0x1c01f000, 0x5c000000, - 0x4c000000, 0x4803c857, 0x59c41080, 0x497b8880, - 0x59c42892, 0x497b8892, 0x0201f800, 0x0010513b, - 0x04020002, 0x1c01f000, 0x42002000, 0x00000260, - 0x59c418a4, 0x820c1d00, 0x0000000f, 0x820c0580, - 0x00000000, 0x04000010, 0x59c41805, 0x820c1d00, - 0x00000001, 0x0402000e, 0x59c418a4, 0x820c1d00, - 0x0000000f, 0x820c0480, 0x00000007, 0x04001004, - 0x820c0480, 0x0000000c, 0x04001003, 0x80102040, - 0x040207ec, 0x497b8891, 0x1c01f000, 0x4c100000, - 0x42002000, 0x00000019, 0x46000000, 0x00000001, - 0x0201f800, 0x00101937, 0x50001800, 0x820c1d00, - 0x00000001, 0x04000005, 0x80102040, 0x040207f7, - 0x5c002000, 0x0401f7f0, 0x5c002000, 0x0401f7ec, - 0x4803c856, 0x1c01f000, 0x4d2c0000, 0x59325808, - 0x592c0a04, 0x4807c857, 0x82040d00, 0x000000ff, - 0x82040500, 0x0000000f, 0x0c01f001, 0x00100f67, - 0x00100f67, 0x00100f67, 0x00100f7f, 0x00100f67, - 0x00100f67, 0x00100f67, 0x00100f67, 0x00100f67, - 0x00100f7f, 0x00100f67, 0x00100f69, 0x00100f67, - 0x00100f67, 0x00100f67, 0x00100f67, 0x0201f800, - 0x001005d8, 0x82040580, 0x0000003b, 0x02020800, - 0x001005d8, 0x592c020a, 0x8c000500, 0x0400005f, - 0x592c1a07, 0x82040500, 0x0000000f, 0x82000400, - 0x001010bd, 0x50001000, 0x50080000, 0x59302013, - 0x4802600a, 0x492e600b, 0x480a600c, 0x480e600d, - 0x48126012, 0x5c025800, 0x1c01f000, 0x82040500, - 0x0000000f, 0x82000400, 0x001010bd, 0x50001000, - 0x50080000, 0x592c1a07, 0x4802600a, 0x492e600b, - 0x480a600c, 0x480e600d, 0x497a6012, 0x0401f7f2, - 0x8c040d00, 0x04020041, 0x82040d00, 0x00000080, - 0x0400003e, 0x0201f000, 0x000200cf, 0x59300013, - 0x59301012, 0x80080580, 0x0402000c, 0x42007800, - 0x80000005, 0x592c1208, 0x82080500, 0xffff7fff, - 0x48025a08, 0x8c08151e, 0x0402002d, 0x823c7d40, - 0x00000020, 0x0401f02a, 0x480bc857, 0x42000000, - 0x0010b851, 0x0201f800, 0x0010aa47, 0x59300414, - 0x4803c857, 0x8c000514, 0x04020007, 0x599c1819, - 0x8c0c1d12, 0x04020004, 0x820c1d40, 0x00000001, - 0x0401f01d, 0x59302013, 0x0401f92b, 0x0402001a, - 0x42007800, 0x80000005, 0x5930500d, 0x592c0208, - 0x4803c857, 0x8c00051e, 0x04020005, 0x823c7d40, - 0x00000020, 0x5930400c, 0x0401f004, 0x8400051e, - 0x48025a08, 0x0401f8da, 0x50201800, 0x480e600a, - 0x4832600b, 0x4822600c, 0x482a600d, 0x480fc857, - 0x4833c857, 0x4823c857, 0x482bc857, 0x80000580, - 0x483e6004, 0x1c01f000, 0x0201f800, 0x001005d8, - 0x4933c857, 0x4d2c0000, 0x59900004, 0x81300580, - 0x02020800, 0x001005d8, 0x0201f800, 0x00109037, - 0x02000800, 0x001005d8, 0x59325808, 0x4d3c0000, - 0x4d400000, 0x59300004, 0x4803c857, 0x4c000000, - 0x0201f800, 0x00106dc3, 0x0201f800, 0x00106b8a, - 0x5c000000, 0x8c000516, 0x04000010, 0x592c000f, - 0x4803c857, 0x48025807, 0x41780800, 0x42028000, - 0x00000002, 0x0201f800, 0x00104e70, 0x4a025c06, - 0x0000ffff, 0x0201f800, 0x000202da, 0x0201f800, - 0x00107911, 0x0401f015, 0x4a026203, 0x00000002, - 0x592c0208, 0x8400054e, 0x48025a08, 0x59300406, - 0x82000580, 0x00000006, 0x04020009, 0x811800ca, - 0x81c80c00, 0x58040939, 0x592c000d, 0x80040480, - 0x592c080f, 0x80040480, 0x4802580b, 0x417a7800, - 0x0201f800, 0x00108be3, 0x5c028000, 0x5c027800, - 0x5c025800, 0x1c01f000, 0x4933c857, 0x4d2c0000, - 0x59900004, 0x81300580, 0x02020800, 0x001005d8, - 0x0201f800, 0x00109037, 0x02000800, 0x001005d8, - 0x59325808, 0x592c0208, 0x84000540, 0x48025a08, - 0x0401f7bf, 0x491bc857, 0x49d3c857, 0x4dd00000, - 0x41780800, 0x8007a0ca, 0x83d3a400, 0x00007600, - 0x4a03a005, 0x80000002, 0x42000000, 0x00001000, - 0x50000000, 0x82000480, 0x24220001, 0x04020029, - 0x59d01006, 0x82080500, 0x00006000, 0x82000580, - 0x00006000, 0x0400002f, 0x82080500, 0x40008000, - 0x040007f8, 0x800409c0, 0x0402002a, 0x811a31c0, - 0x04000028, 0x42000000, 0x00001002, 0x50001000, - 0x46000000, 0x00000512, 0x42001800, 0x0000000a, - 0x59e00000, 0x8c00051a, 0x040207fc, 0x800c1840, - 0x040207fc, 0x42000000, 0x00001002, 0x46000000, - 0x00000514, 0x42001800, 0x0000000a, 0x59e00000, - 0x8c00053a, 0x040207fc, 0x800c1840, 0x040207fc, - 0x42000000, 0x00001002, 0x44080000, 0x0401f00d, - 0x59d01006, 0x82080500, 0x00006000, 0x82000580, - 0x00006000, 0x04000007, 0x8c08151e, 0x040007f9, - 0x59d01006, 0x82080500, 0x00006000, 0x040207f5, - 0x83d3a400, 0x00000020, 0x80040800, 0x82040480, - 0x00000005, 0x040017bf, 0x5c03a000, 0x1c01f000, - 0x491bc857, 0x49d3c857, 0x4dd00000, 0x41780800, - 0x8007a0ca, 0x83d3a400, 0x00007600, 0x4a03a005, - 0x80000001, 0x59d00006, 0x83d3a400, 0x00000020, - 0x80040800, 0x82040480, 0x00000005, 0x040017f8, - 0x5c03a000, 0x1c01f000, 0x59d00006, 0x8c00053e, - 0x0400001e, 0x59902804, 0x4817c857, 0x801429c0, - 0x04000013, 0x5990000a, 0x5990080b, 0x5990100c, - 0x5990180d, 0x4800280a, 0x4804280b, 0x4808280c, - 0x480c280d, 0x59d00000, 0x59d00801, 0x59d01002, - 0x59d01803, 0x59d02004, 0x4800280e, 0x4804280f, - 0x48082810, 0x480c2811, 0x48102812, 0x59900006, - 0x82000500, 0xffff0000, 0x48032006, 0x4a03a005, - 0x30000000, 0x59d00006, 0x1c01f000, 0x4803c856, - 0x80204000, 0x50200000, 0x80000540, 0x04000003, - 0x80285040, 0x1c01f000, 0x58300001, 0x80000540, - 0x0400000e, 0x4802600b, 0x40006000, 0x58300204, - 0x82000500, 0x0000000f, 0x82000400, 0x001010bd, - 0x50004000, 0x802041c0, 0x02000800, 0x001005d8, - 0x80285040, 0x1c01f000, 0x40005000, 0x1c01f000, - 0x00000005, 0x00000008, 0x0000000b, 0x0000000e, - 0x00000011, 0x00000000, 0x00000000, 0x0000000b, - 0x00000000, 0x00000000, 0x00000000, 0x001010b8, - 0x001010b7, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x001010b8, 0x001010b7, 0x001010b4, - 0x001010b8, 0x001010b7, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x001010b8, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x001010b8, 0x001010b8, 0x001010b8, - 0x00000000, 0x001010b8, 0x00000000, 0x00000000, - 0x00000000, 0x4813c857, 0x492fc857, 0x4933c857, - 0x48126012, 0x592c5207, 0x802851c0, 0x0400004a, - 0x412c6000, 0x0401f84b, 0x04000009, 0x82240580, - 0x00000002, 0x04020003, 0x5830000d, 0x80102480, - 0x50200000, 0x80004540, 0x0400003f, 0x50200000, - 0x80000540, 0x0400000b, 0x80301400, 0x58080002, - 0x80102480, 0x0400101e, 0x801021c0, 0x04000009, - 0x80285040, 0x04000034, 0x80204000, 0x0401f7f4, - 0x58300001, 0x80006540, 0x0400002f, 0x0401f7e6, - 0x80285040, 0x0400002c, 0x80204000, 0x50200000, - 0x80000540, 0x0402000a, 0x58300001, 0x80006540, - 0x04000025, 0x58300204, 0x82004d00, 0x0000000f, - 0x82244400, 0x001010bd, 0x50204000, 0x592c0208, - 0x8400051e, 0x48025a08, 0x0401f013, 0x80102080, - 0x80102000, 0x48126010, 0x4813c857, 0x58080802, - 0x40100000, 0x80042480, 0x02001800, 0x001005d8, - 0x58080000, 0x58081801, 0x80102400, 0x4812600e, - 0x480e600f, 0x4813c857, 0x592c0208, 0x8400055e, - 0x48025a08, 0x4833c857, 0x4823c857, 0x482bc857, - 0x4832600b, 0x4822600c, 0x482a600d, 0x80000580, - 0x0401f003, 0x82000540, 0x00000001, 0x1c01f000, - 0x58300204, 0x82004d00, 0x0000000f, 0x82244400, - 0x001010bd, 0x82000500, 0x000000ff, 0x82000580, - 0x00000029, 0x0402001b, 0x50204000, 0x592c0409, - 0x80000540, 0x02000800, 0x001005d8, 0x82000c80, - 0x00000002, 0x04001011, 0x58300001, 0x80006540, - 0x02000800, 0x001005d8, 0x58300204, 0x82000500, - 0x0000000f, 0x82000400, 0x001010bd, 0x50004000, - 0x40040000, 0x800409c0, 0x04000006, 0x82040c80, - 0x00000005, 0x040217f1, 0x80204400, 0x80000580, - 0x1c01f000, 0x59e00004, 0x8c00050e, 0x02020000, - 0x00100903, 0x1c01f000, 0x4c5c0000, 0x59e4b800, - 0x485fc857, 0x825c0500, 0x0000001f, 0x04000004, - 0x59e40862, 0x0201f800, 0x001005d8, 0x825c0500, - 0x000000e0, 0x02000800, 0x001005d8, 0x8c5cbd0e, - 0x04020807, 0x8c5cbd0c, 0x04020809, 0x8c5cbd0a, - 0x04020878, 0x5c00b800, 0x1c01f000, 0x4803c856, - 0x4a03c800, 0x00000080, 0x1c01f000, 0x4d2c0000, - 0x42007800, 0x0010b8ec, 0x583c0001, 0x583c0802, - 0x80040540, 0x0400003f, 0x42000800, 0x0010b7f7, - 0x50065800, 0x592c0002, 0x82000580, 0x00000000, - 0x0400000e, 0x59e40850, 0x59e41853, 0x400c0000, - 0x80040400, 0x59e40852, 0x4807c857, 0x80041480, - 0x04021008, 0x40001000, 0x480bc857, 0x4a007800, - 0x00000001, 0x0401f006, 0x4803c857, 0x0401f029, - 0x59e41050, 0x480bc857, 0x49787800, 0x480bc857, - 0x480fc857, 0x592c0003, 0x80000540, 0x04000006, - 0x80080580, 0x04020004, 0x592c0003, 0x4803c857, - 0x480bc857, 0x480a5803, 0x592c0007, 0x800001c0, - 0x04000007, 0x592c1007, 0x480bc857, 0x583c0003, - 0x4803c857, 0x80080480, 0x04001003, 0x583c1001, - 0x480bc857, 0x583c0802, 0x480bc857, 0x4807c857, - 0x4a025801, 0x00000000, 0x4a025809, 0x001011bc, - 0x480a5807, 0x48065808, 0x59e40053, 0x48025804, - 0x412c1000, 0x492fc857, 0x0201f800, 0x00100858, - 0x5c025800, 0x4a03c800, 0x00000040, 0x1c01f000, - 0x42007800, 0x0010b7f7, 0x503c7800, 0x4a007802, - 0x00000100, 0x42007800, 0x0010b8ec, 0x583c0000, - 0x4803c857, 0x82000d80, 0x00000001, 0x04000004, - 0x80000000, 0x48007800, 0x0401f019, 0x49787800, - 0x583c1806, 0x583c0005, 0x800c1800, 0x480c7806, - 0x800c0580, 0x04020002, 0x49787806, 0x583c0807, - 0x800409c0, 0x0400000e, 0x583c0008, 0x80000000, - 0x48007808, 0x80040580, 0x04020009, 0x49787808, - 0x583c2006, 0x42001800, 0x00000001, 0x42001000, - 0x00008028, 0x0201f800, 0x00103a3e, 0x1c01f000, - 0x4a03c800, 0x00000020, 0x0201f800, 0x0010aa40, - 0x59e40000, 0x1c01f000, 0x4d2c0000, 0x4a007001, - 0x00000000, 0x82040d00, 0x43000f80, 0x02020800, - 0x001005d8, 0x58380009, 0x4803c00f, 0x0201f800, - 0x00109402, 0x583a5808, 0x592c0000, 0x48007008, - 0x800001c0, 0x04020002, 0x49787007, 0x0201f800, - 0x001007f4, 0x5c025800, 0x0201f000, 0x0010087d, - 0x4803c856, 0x4c3c0000, 0x4d2c0000, 0x4d300000, - 0x5830000a, 0x80025d40, 0x02000800, 0x001005d8, - 0x592e6008, 0x4c300000, 0x0201f800, 0x0010941a, - 0x5c006000, 0x02000800, 0x001005d8, 0x58300002, - 0x82000580, 0x00000100, 0x04020010, 0x5930780b, - 0x583c0001, 0x80000540, 0x0400000e, 0x4802600b, - 0x40007800, 0x82000400, 0x00000002, 0x48006003, - 0x583c0000, 0x48006004, 0x40301000, 0x0201f800, - 0x00100858, 0x0401f00c, 0x4a025a06, 0x00000002, - 0x4c300000, 0x0201f800, 0x000202da, 0x5c006000, - 0x40325800, 0x0201f800, 0x001007f4, 0x0201f800, - 0x0002077d, 0x5c026000, 0x5c025800, 0x5c007800, - 0x1c01f000, 0x4803c856, 0x4d2c0000, 0x4d300000, - 0x42007000, 0x0010b7f8, 0x58380801, 0x82040580, - 0x00000002, 0x04020011, 0x58386002, 0x5830000a, - 0x812c0580, 0x0402000d, 0x59e00004, 0x8c00050e, - 0x040007fe, 0x59dc0006, 0x4803c857, 0x4a03b805, - 0x20000000, 0x8c00053e, 0x040007f8, 0x4a007001, - 0x00000000, 0x0401f019, 0x58386006, 0x40305000, - 0x803061c0, 0x02000800, 0x001005d8, 0x5830000a, - 0x812c0580, 0x04000004, 0x40305000, 0x58306000, - 0x0401f7f8, 0x40280000, 0x80300580, 0x58300000, - 0x04000006, 0x48005000, 0x800001c0, 0x04020007, - 0x48287005, 0x0401f005, 0x800001c0, 0x04020002, - 0x48007005, 0x48007006, 0x40325800, 0x0201f800, - 0x001007f4, 0x42007000, 0x0010b7f8, 0x58380001, - 0x82000580, 0x00000000, 0x02000800, 0x0010087d, - 0x5c026000, 0x5c025800, 0x1c01f000, 0x4803c856, - 0x42000800, 0x0000003c, 0x48079000, 0x59c80000, - 0x80040500, 0x040207fe, 0x497b9005, 0x4a039035, - 0x00880200, 0x59a8000e, 0x800000e0, 0x4803900e, - 0x4a039011, 0x00000024, 0x4a03900f, 0x0010d1c0, - 0x4a039010, 0x0010d1c0, 0x4a039015, 0x0000007f, - 0x4a03900d, 0x00000040, 0x4a039000, 0x00001600, - 0x1c01f000, 0x59c80007, 0x8c000508, 0x040208b7, - 0x59c80800, 0x8c040d16, 0x04020004, 0x82000500, - 0x00000006, 0x0c01f005, 0x4807c857, 0x82000500, - 0x0000000e, 0x0c01f001, 0x001012a8, 0x001012a6, - 0x00105999, 0x001012a6, 0x001012aa, 0x001012a6, - 0x001012aa, 0x001012aa, 0x001012a6, 0x001012a6, - 0x001012a6, 0x001012a6, 0x001012aa, 0x001012a6, - 0x001012aa, 0x001012a6, 0x0201f800, 0x001005d8, - 0x4803c857, 0x1c01f000, 0x59c8080c, 0x4807c857, - 0x82040500, 0x00006000, 0x04000004, 0x0201f800, - 0x0010aa03, 0x0401f006, 0x82040500, 0x007f0000, - 0x04000006, 0x0201f800, 0x0010a9d5, 0x0201f800, - 0x00106eb3, 0x0401f02b, 0x82040500, 0x00000014, - 0x04000014, 0x0201f800, 0x0010aa32, 0x836c0580, - 0x00000003, 0x0400000d, 0x0201f800, 0x0010513b, - 0x04000004, 0x0201f800, 0x0010411d, 0x0401f007, - 0x4a035033, 0x00000001, 0x4202d800, 0x00000001, - 0x0201f800, 0x001050a2, 0x0401f817, 0x0401f015, - 0x82040500, 0x00001c00, 0x04000005, 0x0201f800, - 0x0010aa11, 0x0401f810, 0x0401f00e, 0x82040500, - 0x00000140, 0x04000005, 0x0201f800, 0x0010aa24, - 0x0401f809, 0x0401f007, 0x82040500, 0x00008000, - 0x04000004, 0x0201f800, 0x0010a9fc, 0x0401f802, - 0x1c01f000, 0x4c0c0000, 0x4c100000, 0x4c140000, - 0x0201f800, 0x00100ec9, 0x5c002800, 0x5c002000, - 0x5c001800, 0x1c01f000, 0x4803c856, 0x59a80804, - 0x59a8002b, 0x82000500, 0xfffff000, 0x80040540, - 0x4803502b, 0x59a8002f, 0x82000500, 0xfffff000, - 0x80040540, 0x4803502f, 0x48078882, 0x82041c00, - 0x0000000f, 0x800c1908, 0x820c1c00, 0x00000004, - 0x400c2000, 0x901029c0, 0x82040480, 0x000001e4, - 0x04021005, 0x42001000, 0x00000008, 0x801020c6, - 0x0401f031, 0x82040480, 0x00000230, 0x04021009, - 0x42001000, 0x00000007, 0x801000c2, 0x800000c2, - 0x80100400, 0x80100400, 0x80102400, 0x0401f026, - 0x82040480, 0x00000298, 0x04021008, 0x42001000, - 0x00000006, 0x801000c2, 0x800000c2, 0x80100400, - 0x80102400, 0x0401f01c, 0x82040480, 0x00000328, - 0x04021007, 0x42001000, 0x00000005, 0x801000c2, - 0x800000c2, 0x80102400, 0x0401f013, 0x82040480, - 0x00000404, 0x04021005, 0x42001000, 0x00000004, - 0x801020c4, 0x0401f00c, 0x82040480, 0x0000056c, - 0x04021006, 0x42001000, 0x00000003, 0x801000c2, - 0x80102400, 0x0401f004, 0x42001000, 0x00000002, - 0x801020c2, 0x82100480, 0x00000110, 0x80000080, - 0x80002000, 0x800800d0, 0x80140540, 0x80100540, - 0x48039035, 0x1c01f000, 0x59c80815, 0x0201f800, - 0x001005d0, 0x82040d00, 0x0000007c, 0x48079000, - 0x59c80000, 0x80040500, 0x040207fe, 0x8c040d04, - 0x04000003, 0x59c80035, 0x48039035, 0x59c80000, - 0x82000540, 0x00001200, 0x48039000, 0x1c01f000, - 0x4803c856, 0x497b88a9, 0x4a038807, 0x00000001, - 0x497b8807, 0x59c40005, 0x48038805, 0x0201f800, - 0x00101815, 0x4201d000, 0x000001f4, 0x0201f800, - 0x0010608e, 0x497b880e, 0x4200b000, 0x000001f4, - 0x42000000, 0x00000001, 0x42000800, 0x00000014, - 0x0201f800, 0x00101944, 0x42000800, 0x00000014, - 0x0201f800, 0x0010193f, 0x8c040d00, 0x04000005, - 0x8058b040, 0x040207f3, 0x0201f800, 0x001005d8, - 0x4200b000, 0x00000032, 0x42000000, 0x00000001, - 0x42000800, 0x000000b4, 0x0201f800, 0x00101944, - 0x42000800, 0x000000b4, 0x0201f800, 0x0010193f, - 0x8c040d00, 0x04000005, 0x8058b040, 0x040207f3, - 0x0201f800, 0x001005d8, 0x59c40005, 0x48038805, - 0x42000000, 0x00000089, 0x800008d0, 0x48075054, - 0x48075055, 0x48075056, 0x42000800, 0x000000e0, - 0x0201f800, 0x00101944, 0x42000800, 0x000000f4, - 0x0201f800, 0x0010193f, 0x82040500, 0xffffffd1, - 0x82000540, 0x00000002, 0x42000800, 0x000000f4, - 0x0201f800, 0x00101944, 0x42000800, 0x000000a0, - 0x0201f800, 0x0010193f, 0x82040540, 0x00000001, - 0x42000800, 0x000000a0, 0x0201f800, 0x00101944, - 0x42000800, 0x00000000, 0x0201f800, 0x0010193f, - 0x82040540, 0x00000001, 0x42000800, 0x00000000, - 0x0201f800, 0x00101944, 0x4201d000, 0x0001d4c0, - 0x0201f800, 0x0010608e, 0x0401fa2b, 0x4a0388a7, - 0x0000f7f7, 0x4a0388a3, 0x8000403c, 0x4a0388ae, - 0x000061a8, 0x4a038801, 0x00032063, 0x4a038810, - 0x00410108, 0x4a038811, 0x00520608, 0x4a038812, - 0x00450320, 0x4a038813, 0x00440405, 0x4a03881c, - 0x004132e1, 0x4a038850, 0x80000108, 0x4a038860, - 0x00000008, 0x4a038870, 0x00000008, 0x4a038851, - 0x80000508, 0x4a038861, 0x00800000, 0x4a038871, - 0x00800000, 0x4a038852, 0x80000708, 0x4a038862, - 0x00800000, 0x4a038872, 0x00800000, 0x4a038853, - 0x80000608, 0x497b8863, 0x4a038873, 0x00800000, - 0x4a038882, 0x00000840, 0x4a0388a5, 0x0000001e, - 0x4a0388a6, 0x0000001e, 0x4a0388b0, 0x00007530, - 0x4a038802, 0x0000ffff, 0x4a038806, 0xc0e00800, - 0x1c01f000, 0x497b5022, 0x4a035021, 0x00000001, - 0x42000800, 0x00000040, 0x0201f800, 0x0010193f, - 0x82040500, 0xffffffaf, 0x82000540, 0x00000000, - 0x42000800, 0x00000040, 0x0201f800, 0x00101944, - 0x42000800, 0x000000f4, 0x0201f800, 0x0010193f, - 0x4c040000, 0x40040000, 0x84000548, 0x42000800, - 0x000000f4, 0x0201f800, 0x00101944, 0x42000800, - 0x00000000, 0x0201f800, 0x0010193f, 0x82040500, - 0xffffffc1, 0x82000540, 0x00000038, 0x42000800, - 0x00000000, 0x0201f800, 0x00101944, 0x5c000000, - 0x42000800, 0x000000f4, 0x0201f000, 0x00101944, - 0x59c40805, 0x4807c857, 0x59c40006, 0x80040d00, - 0x02000800, 0x001005d8, 0x82040500, 0x00e00800, - 0x04020004, 0x8c040d3e, 0x040208c4, 0x0401f007, - 0x82040500, 0x00800800, 0x02020800, 0x001005d0, - 0x0201f800, 0x001005d8, 0x4c5c0000, 0x4c600000, - 0x59c4b805, 0x485fc857, 0x59c40006, 0x8c000500, - 0x04000003, 0x8c5cbd00, 0x04020079, 0x0201f800, - 0x0010513b, 0x04000014, 0x59c40005, 0x82000500, - 0x000000c0, 0x04000036, 0x0201f800, 0x00105151, - 0x04020033, 0x4a038805, 0x04000000, 0x59c400a3, - 0x82000500, 0xbf203fff, 0x480388a3, 0x497b5049, - 0x4a038805, 0x000000c0, 0x0201f800, 0x00105065, - 0x0401f063, 0x8c5cbd34, 0x04020025, 0x59c40005, - 0x8c00050c, 0x04020012, 0x8c00050e, 0x04020013, - 0x8c00050a, 0x04020014, 0x8c000508, 0x0400000b, - 0x59a80017, 0x82000580, 0x00000009, 0x04020007, - 0x42000000, 0x0010b844, 0x0201f800, 0x0010aa47, - 0x0201f800, 0x00105318, 0x0401f04b, 0x4a035033, - 0x00000000, 0x0401f00b, 0x4a035033, 0x00000002, - 0x0401f008, 0x42000000, 0x0010b846, 0x0201f800, - 0x0010aa47, 0x0201f800, 0x001052c2, 0x0401f03e, - 0x0201f800, 0x00105378, 0x0401f03b, 0x8c5cbd34, - 0x04000037, 0x59c40005, 0x8c00053a, 0x04020005, - 0x42000000, 0x0010b818, 0x0201f800, 0x0010aa47, - 0x4a038805, 0x02000000, 0x0201f800, 0x0010513b, - 0x04020010, 0x4a038805, 0x04000000, 0x0201f800, - 0x00105149, 0x04020008, 0x4a035033, 0x00000001, - 0x4202d800, 0x00000001, 0x0201f800, 0x001050a2, - 0x0401f05b, 0x41780000, 0x0201f800, 0x00105113, - 0x0201f800, 0x001019fe, 0x4000c000, 0x0201f800, - 0x00101963, 0x836c1580, 0x00000004, 0x0402000d, - 0x8c5cbd00, 0x04020012, 0x59a81005, 0x8c081506, - 0x04020005, 0x59c410a3, 0x82081540, 0x00000008, - 0x480b88a3, 0x59c41006, 0x84081540, 0x480b8806, - 0x4a038805, 0x04000000, 0x4202d800, 0x00000001, - 0x497b5014, 0x0201f800, 0x00103b38, 0x8c5cbd3c, - 0x04020858, 0x8c5cbd00, 0x04000036, 0x42000000, - 0x0010b8ca, 0x0201f800, 0x0010aa47, 0x4a038805, - 0x00000001, 0x4200b000, 0x000003e8, 0x4201d000, - 0x00000064, 0x4c580000, 0x0201f800, 0x0010608e, - 0x0201f800, 0x001018d3, 0x5c00b000, 0x04000004, - 0x8058b040, 0x040207f6, 0x0401f004, 0x4a038805, - 0x00000001, 0x0401f01f, 0x59c40006, 0x84000500, - 0x48038806, 0x0201f800, 0x00106ede, 0x497b8880, - 0x0201f800, 0x0010a9c0, 0x59c4000d, 0x8c000500, - 0x02020800, 0x0010a9ce, 0x59c400a3, 0x82000500, - 0xfcf8ffff, 0x480388a3, 0x4a03504c, 0x00000002, - 0x4202d800, 0x00000004, 0x4a038805, 0x00000001, - 0x0201f800, 0x001006d4, 0x0401fb3b, 0x497b5052, - 0x4a035049, 0x00000001, 0x0201f800, 0x00100452, - 0x825cbd00, 0xbbfffffe, 0x485f8805, 0x5c00c000, - 0x5c00b800, 0x1c01f000, 0x59c41004, 0x480bc857, - 0x8c081500, 0x04000006, 0x4803c856, 0x497b2807, - 0x0201f800, 0x00106fa4, 0x0401f00a, 0x82080500, - 0x000001f0, 0x04000007, 0x4803c856, 0x417a3000, - 0x0201f800, 0x00106062, 0x0201f800, 0x00106fc6, - 0x4a038805, 0x80000000, 0x1c01f000, 0x59c408a3, - 0x4807c857, 0x84040d40, 0x480788a3, 0x1c01f000, - 0x4d900000, 0x4dd00000, 0x4da40000, 0x4d140000, - 0x4a038805, 0x40000000, 0x42000000, 0x0010b8c6, - 0x0201f800, 0x0010aa47, 0x0201f800, 0x00106c55, - 0x59c41004, 0x8c081500, 0x04000054, 0x598e600d, - 0x497b2807, 0x813261c0, 0x04000032, 0x59300403, - 0x82000580, 0x00000032, 0x0402002e, 0x5930001c, - 0x48038833, 0x4a038807, 0x00018000, 0x4201d000, - 0x00000002, 0x0201f800, 0x0010608e, 0x497b8807, - 0x4201d000, 0x00000002, 0x0201f800, 0x0010608e, - 0x0201f800, 0x00106e21, 0x4201d000, 0x00007530, - 0x0201f800, 0x0010608e, 0x59c408a4, 0x82040d00, - 0x0000000f, 0x82040d80, 0x00000000, 0x04000005, - 0x42000000, 0x00200000, 0x0201f800, 0x00101949, - 0x0201f800, 0x00106bbf, 0x59300008, 0x80000540, - 0x02000800, 0x001005d8, 0x40025800, 0x4a025a04, - 0x00000103, 0x5931d821, 0x58ef400b, 0x58ec0009, - 0x0801f800, 0x0201f800, 0x0002077d, 0x0401f047, - 0x598c000f, 0x82001c80, 0x000000c8, 0x0402100f, - 0x80000000, 0x4803180f, 0x59c400a4, 0x82000500, - 0x0000000f, 0x82000580, 0x00000002, 0x04020004, - 0x42000000, 0x00200000, 0x0401fbf7, 0x0201f800, - 0x0010604d, 0x0401f035, 0x4933c857, 0x0201f800, - 0x00106e21, 0x813261c0, 0x04000030, 0x4a026203, - 0x00000001, 0x42027000, 0x00000027, 0x0201f800, - 0x000207a1, 0x0401f029, 0x8c081508, 0x04000027, - 0x417a3000, 0x0201f800, 0x001070d8, 0x42032000, - 0x0000bf32, 0x0201f800, 0x00106062, 0x59926004, - 0x813261c0, 0x04000012, 0x42001800, 0x000000c8, - 0x0201f800, 0x001070a4, 0x0402000d, 0x59c400a4, - 0x82000500, 0x0000000f, 0x82000580, 0x00000002, - 0x04020004, 0x42000000, 0x00200000, 0x0401fbce, - 0x0201f800, 0x00106052, 0x0401f00c, 0x4933c857, - 0x0201f800, 0x00106dc3, 0x813261c0, 0x04000007, - 0x42027000, 0x0000004f, 0x4a026203, 0x00000003, - 0x0201f800, 0x000207a1, 0x5c022800, 0x5c034800, - 0x5c03a000, 0x5c032000, 0x0201f000, 0x00106c4b, - 0x4803c857, 0x59a80821, 0x48035021, 0x80041580, - 0x04000045, 0x800409c0, 0x04000023, 0x497b504c, - 0x42000000, 0x0010b80d, 0x0201f800, 0x0010aa47, - 0x0201f800, 0x0010aaf9, 0x42001000, 0x00008011, - 0x59c40001, 0x82000500, 0x00018000, 0x82001d80, - 0x00000000, 0x04000009, 0x82001d80, 0x00008000, - 0x04000009, 0x82001d80, 0x00010000, 0x04000009, - 0x0201f800, 0x001005d8, 0x42001800, 0x00000000, - 0x0401f006, 0x42001800, 0x00000001, 0x0401f003, - 0x42001800, 0x00000003, 0x0201f800, 0x00103a3e, - 0x0401f021, 0x59a8084c, 0x800409c0, 0x04020007, - 0x59c4000d, 0x8c000520, 0x04000004, 0x42001800, - 0x00000003, 0x0401f002, 0x40041800, 0x0201f800, - 0x0010aadd, 0x42001000, 0x00008012, 0x0201f800, - 0x00103a3e, 0x0201f800, 0x001006d4, 0x0201f800, - 0x0010ab33, 0x0402000c, 0x0401f853, 0x4d400000, - 0x4d3c0000, 0x42028000, 0x00000028, 0x42027800, - 0x00000408, 0x0201f800, 0x00101fe5, 0x5c027800, - 0x5c028000, 0x1c01f000, 0x4803c857, 0x82000400, - 0x0010210e, 0x50000800, 0x82040d00, 0x000000ff, - 0x1c01f000, 0x4803c856, 0x4c580000, 0x4200b000, - 0x00000010, 0x497b88ac, 0x497b88ad, 0x8058b040, - 0x040207fe, 0x5c00b000, 0x1c01f000, 0x4807c857, - 0x48075010, 0x80041108, 0x4200b000, 0x00000010, - 0x497b88ac, 0x80000580, 0x800811c0, 0x04020006, - 0x82040500, 0x0000000f, 0x82000400, 0x0010ab38, - 0x50000000, 0x480388ad, 0x80081040, 0x8058b040, - 0x040207f5, 0x1c01f000, 0x59a80005, 0x04000003, - 0x84000546, 0x0401f002, 0x84000506, 0x48035005, - 0x4803c857, 0x1c01f000, 0x4803c857, 0x4c080000, - 0x4c040000, 0x4c000000, 0x59c40892, 0x4807c857, - 0x80041580, 0x04000010, 0x80041480, 0x04021007, - 0x80081080, 0x80081000, 0x4008b000, 0x42000000, - 0x00000201, 0x0401f004, 0x4008b000, 0x42000000, - 0x00000210, 0x48038886, 0x8058b040, 0x040207fe, - 0x497b8886, 0x5c000000, 0x5c000800, 0x5c001000, - 0x1c01f000, 0x4803c856, 0x0201f800, 0x00103b25, - 0x04000005, 0x42028000, 0x0000002e, 0x0201f000, - 0x0010a449, 0x1c01f000, 0x42000800, 0x00000002, - 0x59a80005, 0x8c000514, 0x0402000b, 0x59c80835, - 0x82040d00, 0x00001f00, 0x80040910, 0x80040800, - 0x59a8006c, 0x80000540, 0x04000003, 0x42000800, - 0x0000025a, 0x4807c857, 0x1c01f000, 0x4c000000, - 0x59a80053, 0x4803c857, 0x82000580, 0x00000000, - 0x5c000000, 0x1c01f000, 0x4c000000, 0x59a80053, - 0x4803c857, 0x82000580, 0x00000001, 0x5c000000, - 0x1c01f000, 0x4c000000, 0x59a80053, 0x4803c857, - 0x82000580, 0x00000003, 0x5c000000, 0x1c01f000, - 0x4c000000, 0x59a80053, 0x82000580, 0x00000002, - 0x5c000000, 0x1c01f000, 0x4c000000, 0x4c040000, - 0x4c080000, 0x4c380000, 0x59a80040, 0x82000c80, - 0x00000007, 0x02021800, 0x001005d8, 0x0c01f806, - 0x5c007000, 0x5c001000, 0x5c000800, 0x5c000000, - 0x1c01f000, 0x0010166c, 0x0010167f, 0x00101693, - 0x00101695, 0x001016bc, 0x001016be, 0x001016c0, - 0x4803c856, 0x4a035042, 0x00000000, 0x42000000, - 0x00000002, 0x0401fa1b, 0x42000000, 0x00000002, - 0x0401f9ad, 0x0401fab2, 0x4803c856, 0x4a035040, - 0x00000006, 0x42000800, 0x0000001e, 0x42001000, - 0x001016c1, 0x0201f000, 0x0010606e, 0x497b5045, - 0x4a035050, 0x00000036, 0x4a03504f, 0x0000002a, - 0x4803c856, 0x4a035042, 0x00000001, 0x42000000, - 0x00000002, 0x0401f998, 0x4803c856, 0x4a035040, - 0x00000006, 0x42000800, 0x0000001e, 0x42001000, - 0x001016c1, 0x0201f000, 0x0010606e, 0x0201f800, - 0x001005d8, 0x4a035050, 0x00000036, 0x4803c856, - 0x4a035042, 0x00000003, 0x42000800, 0x00000000, - 0x0401faa3, 0x82040d00, 0x00000090, 0x82040580, - 0x00000090, 0x04000009, 0x82040580, 0x00000010, - 0x04000009, 0x82040580, 0x00000000, 0x04000008, - 0x0201f800, 0x001005d8, 0x42000000, 0x00000001, - 0x0401f005, 0x41780000, 0x0401f003, 0x42000000, - 0x00000002, 0x0401f970, 0x497b5046, 0x4803c856, - 0x4a035040, 0x00000006, 0x42000800, 0x0000001e, - 0x42001000, 0x001016c1, 0x0201f000, 0x0010606e, - 0x0201f800, 0x001005d8, 0x0201f800, 0x001005d8, - 0x1c01f000, 0x4c000000, 0x4c040000, 0x4c080000, - 0x4c380000, 0x59a80042, 0x82000c80, 0x00000007, - 0x02021800, 0x001005d8, 0x0c01f806, 0x5c007000, - 0x5c001000, 0x5c000800, 0x5c000000, 0x1c01f000, - 0x001016d7, 0x001016f6, 0x0010174a, 0x00101761, - 0x00101778, 0x00101781, 0x00101783, 0x0401f9fc, - 0x0402001b, 0x59a81048, 0x42000800, 0x00000000, - 0x0401fa63, 0x82040d00, 0x00000090, 0x82040580, - 0x00000090, 0x04000009, 0x82040580, 0x00000010, - 0x04000008, 0x82040580, 0x00000000, 0x04000007, - 0x0201f800, 0x001005d8, 0x84081540, 0x0401f004, - 0x84081542, 0x0401f002, 0x84081544, 0x480b5048, - 0x4a035040, 0x00000001, 0x0401f003, 0x0401f8cb, - 0x0401ff82, 0x1c01f000, 0x0401f88f, 0x04000052, - 0x0401f9db, 0x0402002a, 0x42000800, 0x00000000, - 0x0401fa43, 0x82040d00, 0x00000090, 0x82040580, - 0x00000000, 0x04000044, 0x82040580, 0x00000010, - 0x04000006, 0x82040580, 0x00000090, 0x04000009, - 0x0201f800, 0x001005d8, 0x59c40801, 0x82040d00, - 0x00018000, 0x82040580, 0x00000000, 0x04000036, - 0x42000800, 0x00000000, 0x0401fa2d, 0x82040d00, - 0x00000090, 0x82040580, 0x00000010, 0x04000006, - 0x82040580, 0x00000090, 0x04000006, 0x02020800, - 0x001005d8, 0x59a80048, 0x84000542, 0x0401f003, - 0x59a80048, 0x84000540, 0x48035048, 0x59a80045, - 0x80000000, 0x48035045, 0x82000580, 0x00000005, - 0x04000003, 0x0401f861, 0x0401f01e, 0x497b5045, - 0x59c40801, 0x82040d00, 0x00018000, 0x82040580, - 0x00000000, 0x04000009, 0x82040580, 0x00008000, - 0x04000009, 0x82040580, 0x00010000, 0x04000008, - 0x0201f800, 0x001005d8, 0x42000000, 0x00000001, - 0x0401f005, 0x41780000, 0x0401f003, 0x42000000, - 0x00000002, 0x0401f94b, 0x4a035042, 0x00000002, - 0x0401f004, 0x4a035040, 0x00000003, 0x0401f002, - 0x0401ff42, 0x1c01f000, 0x0401f83b, 0x04000015, - 0x59a8004f, 0x80000040, 0x4803504f, 0x0401f984, - 0x04020005, 0x4a035040, 0x00000003, 0x497b5041, - 0x0401f00c, 0x59a8004f, 0x80000540, 0x04020003, - 0x0401f89e, 0x0401f002, 0x0401f84b, 0x0401f82f, - 0x497b5045, 0x4a035042, 0x00000001, 0x0401ff2b, - 0x1c01f000, 0x0401f824, 0x04000015, 0x0401f970, - 0x0402000f, 0x59a80046, 0x80000000, 0x48035046, - 0x82000580, 0x00000007, 0x0402000c, 0x4a035052, - 0x0000000a, 0x497b5049, 0x59a80048, 0x8400055e, - 0x48035048, 0x4803c857, 0x0401f005, 0x0401f817, - 0x4a035042, 0x00000004, 0x0401ff3d, 0x1c01f000, - 0x0401f80d, 0x04000007, 0x0401f959, 0x04020003, - 0x0401ff1b, 0x0401f003, 0x0401f80c, 0x0401ff34, - 0x1c01f000, 0x0201f800, 0x001005d8, 0x0201f800, - 0x001005d8, 0x59a80050, 0x80000040, 0x48035050, - 0x0400088d, 0x1c01f000, 0x4c040000, 0x42000800, - 0x00000000, 0x0401f9b2, 0x82040d00, 0x00000090, - 0x82040580, 0x00000090, 0x04000009, 0x82040580, - 0x00000010, 0x04000009, 0x82040580, 0x00000000, - 0x04000009, 0x0201f800, 0x001005d8, 0x42000000, - 0x00000002, 0x0401f005, 0x42000000, 0x00000001, - 0x0401f002, 0x41780000, 0x0401f8ea, 0x5c000800, - 0x1c01f000, 0x4c040000, 0x59c40801, 0x82040d00, - 0x00018000, 0x82040580, 0x00000000, 0x04000009, - 0x82040580, 0x00008000, 0x04000009, 0x82040580, - 0x00010000, 0x04000009, 0x0201f800, 0x001005d8, - 0x42000000, 0x00000002, 0x0401f005, 0x42000000, - 0x00000001, 0x0401f002, 0x41780000, 0x0401f866, - 0x5c000800, 0x1c01f000, 0x4c040000, 0x59a80045, - 0x80000000, 0x48035045, 0x82000580, 0x00000005, - 0x04020018, 0x497b5045, 0x59c40801, 0x82040d00, - 0x00018000, 0x82040580, 0x00000000, 0x04000009, - 0x82040580, 0x00008000, 0x04000009, 0x82040580, - 0x00010000, 0x04000009, 0x0201f800, 0x001005d8, - 0x42000000, 0x00000002, 0x0401f005, 0x42000000, - 0x00000001, 0x0401f002, 0x41780000, 0x0401f846, - 0x42000800, 0x00000000, 0x0401f961, 0x82040d00, - 0x00000090, 0x82040580, 0x00000090, 0x04000009, - 0x82040580, 0x00000010, 0x04000009, 0x82040580, - 0x00000000, 0x04000009, 0x0201f800, 0x001005d8, - 0x42000000, 0x00000002, 0x0401f005, 0x42000000, - 0x00000001, 0x0401f002, 0x41780000, 0x0401f899, - 0x5c000800, 0x1c01f000, 0x4c200000, 0x59a80048, - 0x82000500, 0x00007fff, 0x02000800, 0x001005d8, - 0x59a84047, 0x80204102, 0x02001800, 0x001005d8, - 0x48235047, 0x80204500, 0x040007fa, 0x8c000504, - 0x04020007, 0x8c000502, 0x04020008, 0x8c000500, - 0x04020008, 0x0201f800, 0x001005d8, 0x42000000, - 0x00000002, 0x0401f005, 0x41780000, 0x0401f003, - 0x42000000, 0x00000001, 0x0401f80f, 0x5c004000, - 0x1c01f000, 0x04011000, 0x4a03c840, 0x0010b440, - 0x4a03c842, 0x00000009, 0x40000000, 0x040117ff, - 0x4a035047, 0x00000004, 0x4a03503e, 0x00000000, - 0x1c01f000, 0x59a80858, 0x82040d80, 0x01391077, - 0x04020008, 0x59e00813, 0x8c040d00, 0x04000005, - 0x82000d80, 0x00000002, 0x04020002, 0x41780000, - 0x4c000000, 0x0401f9b1, 0x5c000000, 0x800001c0, - 0x04000040, 0x82000d80, 0x00000001, 0x0402001d, - 0x42000800, 0x000000a0, 0x0401f909, 0x82040540, - 0x00000004, 0x42000800, 0x000000a0, 0x0401f909, - 0x42000800, 0x000000c0, 0x0401f901, 0x82040540, - 0x00000020, 0x42000800, 0x000000c0, 0x0401f901, - 0x59c40001, 0x82000500, 0xfffe7fff, 0x82000540, - 0x00000000, 0x48038801, 0x59a80054, 0x80000110, - 0x42000800, 0x000000e0, 0x0401f8f6, 0x0401f03c, - 0x82000d80, 0x00000002, 0x02020800, 0x001005d8, - 0x42000800, 0x000000a0, 0x0401f8e9, 0x82040500, - 0xfffffffb, 0x42000800, 0x000000a0, 0x0401f8e9, - 0x42000800, 0x000000c0, 0x0401f8e1, 0x82040500, - 0xffffffdf, 0x42000800, 0x000000c0, 0x0401f8e1, - 0x59c40001, 0x82000500, 0xfffe7fff, 0x82000540, - 0x00010000, 0x48038801, 0x59a80056, 0x80000110, - 0x42000800, 0x000000e0, 0x0401f8d6, 0x0401f01c, - 0x42000800, 0x000000a0, 0x0401f8cd, 0x82040540, - 0x00000004, 0x42000800, 0x000000a0, 0x0401f8cd, - 0x42000800, 0x000000c0, 0x0401f8c5, 0x82040500, - 0xffffffdf, 0x42000800, 0x000000c0, 0x0401f8c5, - 0x59c40001, 0x82000500, 0xfffe7fff, 0x82000540, - 0x00008000, 0x48038801, 0x59a80055, 0x80000110, - 0x42000800, 0x000000e0, 0x0401f8ba, 0x0401f163, - 0x4803c857, 0x59a80858, 0x82040d80, 0x01391077, - 0x04020008, 0x59e00813, 0x8c040d00, 0x04000005, - 0x82000d80, 0x00000002, 0x04020002, 0x41780000, - 0x4c000000, 0x0401f94d, 0x5c000000, 0x800001c0, - 0x04000026, 0x82000d80, 0x00000001, 0x04020010, - 0x59a8006c, 0x80000540, 0x04000004, 0x42001000, - 0x00000000, 0x0401fa0a, 0x42000800, 0x00000000, - 0x0401f897, 0x82040540, 0x00000090, 0x42000800, - 0x00000000, 0x0401f897, 0x0401f024, 0x82000d80, - 0x00000002, 0x02020800, 0x001005d8, 0x59a8006c, - 0x80000540, 0x04000004, 0x42001000, 0x00010000, - 0x0401f9f7, 0x42000800, 0x00000000, 0x0401f884, - 0x82040500, 0xffffff6f, 0x42000800, 0x00000000, - 0x0401f884, 0x0401f011, 0x59a8006c, 0x80000540, - 0x04000004, 0x42001000, 0x00008000, 0x0401f9e8, - 0x42000800, 0x00000000, 0x0401f875, 0x82040500, - 0xffffff6f, 0x82000540, 0x00000010, 0x42000800, - 0x00000000, 0x0401f873, 0x0401f124, 0x4c580000, - 0x4200b000, 0x00000014, 0x8058b040, 0x04000043, - 0x59c4000d, 0x8c000520, 0x040207fc, 0x0401f85c, - 0x59c4000d, 0x8c000520, 0x040207f8, 0x59c40808, - 0x84040d50, 0x48078808, 0x4200b000, 0x000000c8, - 0x8058b040, 0x040207ff, 0x4200b000, 0x00000014, - 0x8058b040, 0x04000031, 0x59c4000d, 0x8c000520, - 0x0402002e, 0x42000800, 0x00001000, 0x50040800, - 0x82040c80, 0x24220001, 0x04020003, 0x8c000504, - 0x040007f4, 0x0401f842, 0x59c4000d, 0x8c000520, - 0x04020022, 0x42000800, 0x00001000, 0x50040800, - 0x82040c80, 0x24220001, 0x04020003, 0x8c000504, - 0x040007e8, 0x4200b000, 0x0000000a, 0x8058b040, - 0x04000003, 0x0401f832, 0x0401f7fd, 0x4200b000, - 0x00000064, 0x59c4000d, 0x8c00051e, 0x0400000f, - 0x8058b040, 0x040207fc, 0x42000000, 0x00001000, - 0x50000000, 0x82000480, 0x24220001, 0x04020004, - 0x59c40808, 0x84040d10, 0x48078808, 0x80000580, - 0x4803c857, 0x0401f00c, 0x42000000, 0x00001000, - 0x50000000, 0x82000480, 0x24220001, 0x04020004, - 0x59c40808, 0x84040d10, 0x48078808, 0x82000540, - 0x00000001, 0x5c00b000, 0x1c01f000, 0x42000800, - 0x000000a0, 0x0401f816, 0x82040500, 0xfffffffe, - 0x42000800, 0x000000a0, 0x0401f816, 0x42000800, - 0x00000000, 0x0401f80e, 0x82040500, 0xfffffffe, - 0x42000800, 0x00000000, 0x0401f00e, 0x40000000, - 0x40000000, 0x40000000, 0x40000000, 0x40000000, - 0x1c01f000, 0x480b8805, 0x1c01f000, 0x4807880e, - 0x59c4080f, 0x82040d00, 0x000000ff, 0x1c01f000, - 0x900001c0, 0x80040d40, 0x84040d40, 0x4807880e, - 0x1c01f000, 0x82000d80, 0x00200000, 0x04000009, - 0x82000d80, 0x02000000, 0x04000006, 0x82000d80, - 0x01000000, 0x04000006, 0x59c408a3, 0x0401f006, - 0x59c408a3, 0x84040d30, 0x0401f003, 0x59c408a3, - 0x84040d32, 0x80040540, 0x480388a3, 0x480788a3, - 0x1c01f000, 0x59c400a3, 0x84000556, 0x480388a3, - 0x84000516, 0x480388a3, 0x1c01f000, 0x485fc857, - 0x4863c857, 0x4c640000, 0x4d3c0000, 0x4d400000, - 0x0201f800, 0x00106ede, 0x4863500a, 0x0201f800, - 0x0010ab33, 0x0402006c, 0x82600d00, 0x0000ff00, - 0x800409c0, 0x0400000c, 0x4200c800, 0x00000001, - 0x59a80010, 0x82000500, 0x000000ff, 0x80041110, - 0x80081580, 0x04000021, 0x82041580, 0x0000ff00, - 0x0400000a, 0x59c410a3, 0x82081500, 0x00008000, - 0x04000009, 0x59c410a7, 0x82081500, 0x0000ff00, - 0x82081580, 0x0000ff00, 0x4200c800, 0x00000000, - 0x04000012, 0x59a80005, 0x8c000502, 0x04020008, - 0x8c000500, 0x0402000d, 0x599c1017, 0x8c08151a, - 0x0400003e, 0x84000542, 0x48035005, 0x4200c800, - 0x00000002, 0x42028000, 0x00000004, 0x42027800, - 0x00000008, 0x0401f008, 0x59a80805, 0x84040d40, - 0x48075005, 0x42028000, 0x00000004, 0x42027800, - 0x00000400, 0x59a80006, 0x8c000502, 0x04020006, - 0x59a80805, 0x8c040d0a, 0x04020033, 0x84040d4a, - 0x48075005, 0x42000000, 0x0010b812, 0x0201f800, - 0x0010aa47, 0x59a8180a, 0x42001000, 0x00008013, - 0x0201f800, 0x00103a3e, 0x0201f800, 0x00103b25, - 0x04000015, 0x4d400000, 0x82600500, 0x000000ff, - 0x42028800, 0x0000ffff, 0x40643000, 0x42028000, - 0x0000000e, 0x0201f800, 0x0010a446, 0x42000800, - 0x00000001, 0x42001000, 0x00000100, 0x0201f800, - 0x0010618b, 0x5c028000, 0x599c0817, 0x8c040d0a, - 0x04020011, 0x493fc857, 0x4943c857, 0x0201f800, - 0x00101fe5, 0x0401f00c, 0x0201f800, 0x00103b25, - 0x04000009, 0x42028000, 0x0000000f, 0x42028800, - 0x0000ffff, 0x42003000, 0x00000000, 0x0201f800, - 0x0010a449, 0x497b8880, 0x5c028000, 0x5c027800, - 0x5c00c800, 0x1c01f000, 0x42000800, 0x000000a0, - 0x0401ff5f, 0x82040540, 0x00000002, 0x42000800, - 0x000000a0, 0x0401f75f, 0x42000800, 0x00000000, - 0x0401ff57, 0x82040540, 0x00000002, 0x42000800, - 0x00000000, 0x0401f757, 0x42000800, 0x000000a0, - 0x0401ff4f, 0x82040500, 0xfffffffd, 0x42000800, - 0x000000a0, 0x0401f74f, 0x42000800, 0x00000000, - 0x0401ff47, 0x82040500, 0xfffffffd, 0x42000800, - 0x00000000, 0x0401f747, 0x59c408a8, 0x0401ff38, - 0x0401ff37, 0x59c400a8, 0x80040d80, 0x040207fb, - 0x1c01f000, 0x4803c856, 0x4a038807, 0x00000001, - 0x497b8807, 0x59c40005, 0x48038805, 0x497b506c, - 0x497b506d, 0x41785800, 0x42006000, 0x00000001, - 0x42006800, 0x00000003, 0x0401f824, 0x0401f82f, - 0x40400000, 0x4803c857, 0x82408580, 0x00000000, - 0x0402001d, 0x41785800, 0x42006000, 0x0000001e, - 0x42006800, 0x00000014, 0x0401f818, 0x0401f823, - 0x40400000, 0x4803c857, 0x82408580, 0x00000800, - 0x04020011, 0x42005800, 0x00000001, 0x42006000, - 0x0000001e, 0x42006800, 0x00000014, 0x0401f80b, - 0x0401f816, 0x40400000, 0x4803c857, 0x82408580, - 0x0000ffff, 0x04020004, 0x4a03506c, 0x00000001, - 0x4803c856, 0x1c01f000, 0x41785000, 0x0401f812, - 0x0401f838, 0x40347000, 0x40340800, 0x0401f03d, - 0x42005000, 0x00000001, 0x0401f80b, 0x0401f831, - 0x40340800, 0x0401f037, 0x42005000, 0x00000002, - 0x0401f805, 0x0401f81d, 0x0401f835, 0x40048000, - 0x1c01f000, 0x0401f808, 0x0401f814, 0x40280800, - 0x0401f826, 0x402c0800, 0x0401f827, 0x40300800, - 0x0401f025, 0x42000800, 0x0000ffff, 0x42001000, - 0x00000001, 0x0401f829, 0x42001000, 0x00000010, - 0x0401f826, 0x42000800, 0x0000ffff, 0x42001000, - 0x00000010, 0x0401f021, 0x41780800, 0x42001000, - 0x00000002, 0x0401f01d, 0x0401f92e, 0x4a03d000, - 0x00050004, 0x0401f92b, 0x4a03d000, 0x00050005, - 0x0401f928, 0x4a03d000, 0x00050004, 0x42000800, - 0x00000001, 0x42001000, 0x00000001, 0x0401f00f, - 0x42000800, 0x00000002, 0x42001000, 0x00000002, - 0x0401f00a, 0x42001000, 0x00000005, 0x0401f007, - 0x42001000, 0x00000010, 0x0401f004, 0x42001000, - 0x00000010, 0x0401f01b, 0x0401f912, 0x82082c00, - 0x0010ab38, 0x50142800, 0x82081500, 0xffffffff, - 0x04000013, 0x0401f90b, 0x80081040, 0x80142902, - 0x40040000, 0x80140500, 0x04000007, 0x4a03d000, - 0x00070006, 0x0401f903, 0x4a03d000, 0x00070007, - 0x0401f006, 0x4a03d000, 0x00070004, 0x0401f8fd, - 0x4a03d000, 0x00070005, 0x0401f7ec, 0x1c01f000, - 0x41780800, 0x82082c00, 0x0010ab38, 0x50142800, - 0x82081500, 0xffffffff, 0x04000010, 0x0401f8f1, - 0x4a03d000, 0x00050001, 0x0401f8ee, 0x59e81800, - 0x80081040, 0x80142902, 0x8c0c1d06, 0x04000004, - 0x40140000, 0x80040d40, 0x0401f8e6, 0x4a03d000, - 0x00070000, 0x0401f7ef, 0x1c01f000, 0x480bc857, - 0x480b506d, 0x59c40001, 0x82000500, 0xffffefff, - 0x48038801, 0x41781800, 0x0401f8c4, 0x41785800, - 0x42006000, 0x0000001e, 0x42006800, 0x00000004, - 0x0401ff7a, 0x42006800, 0x0000003c, 0x0401ff7d, - 0x41785800, 0x42006000, 0x0000001e, 0x42006800, - 0x00000004, 0x0401ff71, 0x41786800, 0x0401ff75, - 0x41785800, 0x42006000, 0x0000001e, 0x41786800, - 0x0401ff6a, 0x42006800, 0x00000002, 0x0401ff6d, - 0x42006800, 0x00000001, 0x0401ff64, 0x42006800, - 0x000000f5, 0x0401ff67, 0x41785800, 0x42006000, - 0x0000001e, 0x42006800, 0x00000004, 0x0401ff5b, - 0x42006800, 0x00000020, 0x0401ff5e, 0x59a8106d, - 0x0401f865, 0x42001800, 0x000200f5, 0x0401f897, - 0x59a8106d, 0x0401f879, 0x41785800, 0x42006000, - 0x0000001e, 0x42006800, 0x00000004, 0x0401ff4b, - 0x41786800, 0x0401ff4f, 0x59c40001, 0x82000540, - 0x00001000, 0x48038801, 0x41785800, 0x42006000, - 0x0000001e, 0x42006800, 0x00000015, 0x0401ff3f, - 0x0401ff4a, 0x40400000, 0x82000540, 0x00000002, - 0x4c000000, 0x41785800, 0x42006000, 0x0000001e, - 0x42006800, 0x00000015, 0x0401ff34, 0x5c000000, - 0x40006800, 0x0401ff37, 0x41785800, 0x42006000, - 0x0000001e, 0x42006800, 0x00000015, 0x0401ff2b, - 0x0401ff36, 0x40400000, 0x82000500, 0x0000fffd, - 0x4c000000, 0x41785800, 0x42006000, 0x0000001e, - 0x42006800, 0x00000015, 0x0401ff20, 0x5c000000, - 0x40006800, 0x0401ff23, 0x41785800, 0x42006000, - 0x0000001e, 0x42006800, 0x00000014, 0x0401ff17, - 0x0401ff22, 0x40400000, 0x82000540, 0x00000040, - 0x4c000000, 0x41785800, 0x42006000, 0x0000001e, - 0x42006800, 0x00000014, 0x0401ff0c, 0x5c000000, - 0x40006800, 0x0401ff0f, 0x41785800, 0x42006000, - 0x0000001e, 0x42006800, 0x00000014, 0x0401ff03, - 0x0401ff0e, 0x40400000, 0x82000500, 0x0000ffbf, - 0x4c000000, 0x41785800, 0x42006000, 0x0000001e, - 0x42006800, 0x00000014, 0x0401fef8, 0x5c000000, - 0x40006800, 0x0401fefb, 0x4a038886, 0x00002020, - 0x0401f04c, 0x480bc857, 0x82080580, 0x00010000, - 0x04020007, 0x82040d40, 0x00010000, 0x42001800, - 0x00000001, 0x0401f82d, 0x0401f00f, 0x82080580, - 0x00008000, 0x04000007, 0x82040d40, 0x00000000, - 0x42001800, 0x00900001, 0x0401f824, 0x0401f006, - 0x82040d40, 0x00008000, 0x42001800, 0x00100001, - 0x0401f81e, 0x1c01f000, 0x480bc857, 0x82080580, - 0x00010000, 0x04020008, 0x42001800, 0x000000a1, - 0x0401f816, 0x42001800, 0x000000c1, 0x0401f813, - 0x0401f011, 0x82080580, 0x00008000, 0x04000008, - 0x42001800, 0x000400a1, 0x0401f80c, 0x42001800, - 0x002000c1, 0x0401f809, 0x0401f007, 0x42001800, - 0x000400a1, 0x0401f805, 0x42001800, 0x000000c1, - 0x0401f802, 0x1c01f000, 0x480fc857, 0x41785800, - 0x42006000, 0x0000001e, 0x41786800, 0x0401feb7, - 0x400c6800, 0x80346960, 0x0401feba, 0x42006800, - 0x00000001, 0x0401feb1, 0x400c6800, 0x0401feb5, - 0x42006800, 0x00000003, 0x0401feac, 0x0401feb7, - 0x40400000, 0x8c000504, 0x040207fc, 0x1c01f000, - 0x42000000, 0x00000064, 0x80000040, 0x040207ff, - 0x1c01f000, 0x00020103, 0x00101bd5, 0x00101bdb, - 0x00101be1, 0x00101be9, 0x00101bef, 0x00101bf7, - 0x00101bff, 0x00101c09, 0x00101c0f, 0x00101c17, - 0x00101c1f, 0x00101c29, 0x00101c31, 0x00101c3b, - 0x00101c45, 0x000200f8, 0x00101c51, 0x00101c59, - 0x00101c61, 0x00101c6b, 0x00101c73, 0x00101c7d, - 0x00101c87, 0x00101c93, 0x00101c9b, 0x00101ca5, - 0x00101caf, 0x00101cbb, 0x00101cc5, 0x00101cd1, - 0x00101cdd, 0x000200fd, 0x00101ceb, 0x00101cf3, - 0x00101cfb, 0x00101d05, 0x00101d0d, 0x00101d17, - 0x00101d21, 0x00101d2d, 0x00101d35, 0x00101d3f, - 0x00101d49, 0x00101d55, 0x00101d5f, 0x00101d6b, - 0x00101d77, 0x00101d85, 0x00101d8d, 0x00101d97, - 0x00101da1, 0x00101dad, 0x00101db7, 0x00101dc3, - 0x00101dcf, 0x00101ddd, 0x00101de7, 0x00101df3, - 0x00101dff, 0x00101e0d, 0x00101e19, 0x00101e27, - 0x00101e35, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101418, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101155, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101155, 0x0201f800, - 0x00101418, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101155, 0x0201f800, - 0x00101418, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101289, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101289, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00101289, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00101289, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00101289, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00101289, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101155, 0x0201f800, - 0x00101418, 0x0201f800, 0x00101289, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00101418, 0x0201f800, - 0x00101289, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101418, 0x0201f800, 0x00020729, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101418, 0x0201f800, 0x00020729, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101155, 0x0201f800, - 0x00020729, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101155, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020729, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101155, 0x0201f800, - 0x00101418, 0x0201f800, 0x00020729, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00020729, 0x0201f800, - 0x00101289, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00020729, 0x0201f800, - 0x00101289, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101418, 0x0201f800, 0x00020729, 0x0201f800, - 0x00101289, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020729, 0x0201f800, 0x00101289, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101155, 0x0201f800, - 0x00020729, 0x0201f800, 0x00101289, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00020729, 0x0201f800, - 0x00101289, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020729, 0x0201f800, 0x00101289, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020729, 0x0201f800, 0x00101289, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00020015, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020015, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020015, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00020015, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00020015, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00101155, 0x0201f800, 0x00020015, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101418, 0x0201f800, 0x00101155, 0x0201f800, - 0x00020015, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101289, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101289, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101289, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101418, 0x0201f800, 0x00020015, 0x0201f800, - 0x00101289, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101289, 0x0201f800, - 0x00101155, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00020015, 0x0201f800, - 0x00101289, 0x0201f800, 0x00101155, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101289, 0x0201f800, - 0x00101155, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101289, 0x0201f800, - 0x00101155, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020015, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020015, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020015, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101418, 0x0201f800, 0x00020729, 0x0201f800, - 0x00020015, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020015, 0x0201f800, - 0x00101155, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00020729, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101155, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020015, 0x0201f800, - 0x00101155, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020015, 0x0201f800, - 0x00101155, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020015, 0x0201f800, - 0x00101289, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00020729, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101289, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020015, 0x0201f800, - 0x00101289, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020015, 0x0201f800, - 0x00101289, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00020729, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101289, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00020729, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101289, 0x0201f800, - 0x00020104, 0x0201f000, 0x00020101, 0x4c000000, - 0x4df00000, 0x0201f800, 0x00101155, 0x0201f800, - 0x00101418, 0x0201f800, 0x00020729, 0x0201f800, - 0x00020015, 0x0201f800, 0x00101289, 0x0201f000, - 0x00020101, 0x4c000000, 0x4df00000, 0x0201f800, - 0x00101155, 0x0201f800, 0x00101418, 0x0201f800, - 0x00020729, 0x0201f800, 0x00020015, 0x0201f800, - 0x00101289, 0x0201f800, 0x00020104, 0x0201f000, - 0x00020101, 0x4c5c0000, 0x4c600000, 0x4178b800, - 0x0201f800, 0x001048ec, 0x040200fd, 0x59a8c026, - 0x0201f800, 0x0010513b, 0x04000003, 0x8c60c506, - 0x0400000e, 0x8c60c500, 0x04020004, 0x8c60c50e, - 0x040008f6, 0x0401f0f2, 0x0401fab4, 0x040200f0, - 0x0201f800, 0x0010513b, 0x04020004, 0x4a03501c, - 0x0000ffff, 0x0401f0ea, 0x8c60c504, 0x04000004, - 0x4a03501c, 0x0000ffff, 0x0401f0e5, 0x59a8c010, - 0x8260c500, 0x000000ff, 0x59a81013, 0x8c081500, - 0x0400005d, 0x8c081502, 0x0402005b, 0x59a8b81c, - 0x825c0d80, 0x0000ffff, 0x04020003, 0x4200b800, - 0x00000001, 0x805c1104, 0x82086400, 0x0010be21, - 0x50300800, 0x825c0500, 0x00000003, 0x0c01f001, - 0x00101e81, 0x00101e7c, 0x00101e80, 0x00101e7e, - 0x80040910, 0x0401f004, 0x80040930, 0x0401f002, - 0x80040920, 0x82040500, 0x000000ff, 0x82000d80, - 0x000000ff, 0x0400000f, 0x4c000000, 0x82000400, - 0x0010210e, 0x50000800, 0x80040910, 0x82040580, - 0x00000080, 0x5c000000, 0x04000030, 0x80600d80, - 0x0400002e, 0x80000540, 0x0400002c, 0x0401f00b, - 0x59a81005, 0x82081500, 0x00000003, 0x0402002b, - 0x59a81013, 0x84081542, 0x480b5013, 0x4a03501c, - 0x0000ffff, 0x0401f028, 0x4c000000, 0x59a80005, - 0x8c000514, 0x42001000, 0x00000010, 0x02020800, - 0x00104c6d, 0x5c000000, 0x0402001c, 0x417a8800, - 0x0201f800, 0x00105c9a, 0x04020016, 0x0201f800, - 0x001045e5, 0x04000006, 0x0201f800, 0x00104c62, - 0x0401f8b1, 0x0400000f, 0x0401f00c, 0x599c0019, - 0x8c00050e, 0x04020009, 0x0201f800, 0x001045a6, - 0x04020008, 0x0201f800, 0x00104c62, 0x0401f9e1, - 0x0401f8be, 0x04000003, 0x805cb800, 0x0401f7b2, - 0x485f501c, 0x0401f086, 0x4a03501c, 0x0000ffff, - 0x0401f083, 0x42003000, 0x0000007e, 0x59a8001c, - 0x82001580, 0x0000ffff, 0x04020005, 0x80000d80, - 0x4018b000, 0x4803c856, 0x0401f009, 0x8018b480, - 0x04001004, 0x40000800, 0x4803c856, 0x0401f004, - 0x4a03501c, 0x0000ffff, 0x0401f071, 0x4c040000, - 0x4c580000, 0x82040400, 0x0010210e, 0x50000000, - 0x82000500, 0x000000ff, 0x80604580, 0x0400005c, - 0x0201f800, 0x00105c9b, 0x04020061, 0x59a80005, - 0x8c000514, 0x42001000, 0x00000010, 0x02020800, - 0x00104c6d, 0x5c00b000, 0x5c000800, 0x040207d7, - 0x4c040000, 0x4c580000, 0x845cbd00, 0x0201f800, - 0x00020245, 0x04000008, 0x599c0019, 0x8c00050e, - 0x04020047, 0x0201f800, 0x001045ab, 0x0402004c, - 0x0401f002, 0x845cbd40, 0x0201f800, 0x00104c62, - 0x0201f800, 0x001049e7, 0x04020007, 0x59a80005, - 0x8c000502, 0x04000033, 0x59340200, 0x8c00050e, - 0x04020030, 0x59a81013, 0x8c081502, 0x04000025, - 0x0201f800, 0x00104a09, 0x04000031, 0x8c5cbd00, - 0x04020004, 0x0201f800, 0x001045ff, 0x0401f02c, - 0x0401f9cd, 0x0400002a, 0x42026000, 0x0010bde9, - 0x49366009, 0x497a6008, 0x417a7800, 0x0401f925, - 0x42000000, 0x0010b864, 0x0201f800, 0x0010aa47, - 0x0201f800, 0x00103b25, 0x0400001d, 0x41782800, - 0x42003000, 0x00000008, 0x4d400000, 0x4d440000, - 0x59368c03, 0x42028000, 0x00000029, 0x0201f800, - 0x0010a446, 0x5c028800, 0x5c028000, 0x0401f010, - 0x4937c857, 0x599c0019, 0x8c00050e, 0x0402000c, - 0x0401f96c, 0x0401f849, 0x04000011, 0x0401f008, - 0x59a80013, 0x8c000500, 0x04000003, 0x0401f9a6, - 0x04000003, 0x0401f828, 0x04000009, 0x5c00b000, - 0x5c000800, 0x80040800, 0x8058b040, 0x04020798, - 0x4a03501c, 0x0000ffff, 0x0401f005, 0x4937c857, - 0x5c00b000, 0x5c000800, 0x4807501c, 0x5c00c000, - 0x5c00b800, 0x1c01f000, 0x4803c856, 0x4a03501c, - 0x00000001, 0x42028800, 0x000007fe, 0x42003000, - 0x00fffffe, 0x0201f800, 0x001045a6, 0x0402000c, - 0x0401f948, 0x0401f825, 0x04000009, 0x59a80026, - 0x8400054e, 0x48035026, 0x0201f800, 0x0010930f, - 0x82000540, 0x00000001, 0x1c01f000, 0x80000580, - 0x0401f7fe, 0x4937c857, 0x0201f800, 0x00107942, - 0x04000015, 0x49366009, 0x4a026406, 0x00000001, - 0x417a7800, 0x0201f800, 0x00104567, 0x59a8001b, - 0x80000000, 0x4803501b, 0x42027000, 0x00000004, - 0x599c0019, 0x8c00050e, 0x04000003, 0x42027000, - 0x00000000, 0x0201f800, 0x000207a1, 0x82000540, - 0x00000001, 0x1c01f000, 0x4937c857, 0x0201f800, - 0x00107942, 0x0400001c, 0x49366009, 0x59340403, - 0x82000580, 0x000007fe, 0x04000005, 0x4d3c0000, - 0x417a7800, 0x0401f8b7, 0x5c027800, 0x4a026406, - 0x00000001, 0x417a7800, 0x0201f800, 0x00104567, - 0x42000800, 0x00000003, 0x0201f800, 0x00104571, - 0x59a8001b, 0x80000000, 0x4803501b, 0x42027000, - 0x00000002, 0x0201f800, 0x000207a1, 0x82000540, - 0x00000001, 0x1c01f000, 0x4803c856, 0x42028800, - 0x000007fc, 0x42003000, 0x00fffffc, 0x0201f800, - 0x001045a6, 0x04020005, 0x0401f805, 0x04000003, - 0x4a035027, 0x0000ffff, 0x1c01f000, 0x4937c857, - 0x0201f800, 0x00107942, 0x04000014, 0x49366009, - 0x4a026406, 0x00000001, 0x417a7800, 0x0201f800, - 0x00104567, 0x42000800, 0x00000003, 0x0201f800, - 0x00104571, 0x59a80028, 0x80000000, 0x48035028, - 0x42027000, 0x00000002, 0x0201f800, 0x000207a1, - 0x82000540, 0x00000001, 0x1c01f000, 0x480bc857, - 0x492fc857, 0x4c5c0000, 0x4008b800, 0x42028800, - 0x000007fd, 0x42003000, 0x00fffffd, 0x0201f800, - 0x001045a6, 0x0402001a, 0x0201f800, 0x0002075a, - 0x04000017, 0x49366009, 0x5934000a, 0x84000544, - 0x4802680a, 0x812e59c0, 0x04000005, 0x592c0404, - 0x8c00051e, 0x04000002, 0x48ee6021, 0x492e6008, - 0x4a026406, 0x00000001, 0x485e601c, 0x42027000, - 0x00000022, 0x0201f800, 0x000207a1, 0x82000540, - 0x00000001, 0x5c00b800, 0x1c01f000, 0x80000580, - 0x0401f7fd, 0x5c000000, 0x4c000000, 0x4803c857, - 0x4943c857, 0x493fc857, 0x4d340000, 0x4d440000, - 0x4c580000, 0x4d2c0000, 0x4c5c0000, 0x0201f800, - 0x00106c55, 0x4df00000, 0x0201f800, 0x001069f1, - 0x0201f800, 0x00106aac, 0x0201f800, 0x00106737, - 0x0201f800, 0x0010848a, 0x5c03e000, 0x02000800, - 0x00106c4b, 0x4200b000, 0x000007f0, 0x417a8800, - 0x0201f800, 0x00020245, 0x0402001f, 0x8d3e7d14, - 0x04000005, 0x59340212, 0x82000500, 0x0000ff00, - 0x04000019, 0x8d3e7d06, 0x04000004, 0x59340200, - 0x8c00050e, 0x04020014, 0x8d3e7d18, 0x0400000f, - 0x5934b80f, 0x805cb9c0, 0x04000009, 0x49425a06, - 0x592cb800, 0x0201f800, 0x000202ce, 0x805cb9c0, - 0x040207fb, 0x497a680f, 0x497a6810, 0x4a026c00, - 0x00000707, 0x0401f004, 0x4937c857, 0x0201f800, - 0x001042b4, 0x81468800, 0x8058b040, 0x040207dd, - 0x8d3e7d02, 0x04000011, 0x497b501d, 0x42028800, - 0x000007f0, 0x4200b000, 0x00000010, 0x0201f800, - 0x00020245, 0x04020006, 0x4937c857, 0x4a026c00, - 0x00000707, 0x0201f800, 0x001042b4, 0x81468800, - 0x8058b040, 0x040207f6, 0x5c00b800, 0x5c025800, - 0x5c00b000, 0x5c028800, 0x5c026800, 0x1c01f000, - 0x5c000000, 0x4c000000, 0x4803c857, 0x4933c857, - 0x493fc857, 0x4d340000, 0x4d400000, 0x4d440000, - 0x4d2c0000, 0x4c5c0000, 0x0201f800, 0x00106c55, - 0x4df00000, 0x59326809, 0x813669c0, 0x04000020, - 0x59368c03, 0x42028000, 0x00000029, 0x0201f800, - 0x00106a50, 0x0201f800, 0x00106ab4, 0x0201f800, - 0x001067fd, 0x0201f800, 0x0010a2ff, 0x4937c857, - 0x8d3e7d18, 0x04000010, 0x5934b80f, 0x805cb9c0, - 0x0400000a, 0x405e5800, 0x49425a06, 0x592cb800, - 0x0201f800, 0x000202ce, 0x805cb9c0, 0x040207fa, - 0x497a680f, 0x497a6810, 0x4a026c00, 0x00000707, - 0x0401f003, 0x0201f800, 0x001042b4, 0x5c03e000, - 0x02000800, 0x00106c4b, 0x5c00b800, 0x5c025800, - 0x5c028800, 0x5c028000, 0x5c026800, 0x1c01f000, - 0x4933c857, 0x59a80026, 0x8c000508, 0x04020012, - 0x59305009, 0x482bc857, 0x836c0580, 0x00000002, - 0x0402000d, 0x0401f813, 0x0402000b, 0x58280403, - 0x82000580, 0x000007fc, 0x04000008, 0x59a8001b, - 0x80000040, 0x4803c857, 0x02001800, 0x001005d8, - 0x4803501b, 0x1c01f000, 0x59a80028, 0x80000040, - 0x4803c857, 0x040017fc, 0x48035028, 0x1c01f000, - 0x59300008, 0x800001c0, 0x04020009, 0x59300403, - 0x82000580, 0x00000001, 0x04020004, 0x82000540, - 0x00000001, 0x0401f002, 0x80000580, 0x1c01f000, - 0x4937c857, 0x59340200, 0x84000502, 0x48026a00, - 0x1c01f000, 0x4933c857, 0x493fc857, 0x4947c857, - 0x4d3c0000, 0x4d400000, 0x4d340000, 0x4d440000, - 0x4c580000, 0x0201f800, 0x00106c55, 0x4df00000, - 0x813e79c0, 0x04020004, 0x4200b000, 0x00000001, - 0x0401f004, 0x4200b000, 0x000007f0, 0x417a8800, - 0x41440000, 0x81ac0400, 0x50000000, 0x80026d40, - 0x04000019, 0x42027800, 0x00000001, 0x0201f800, - 0x001048f6, 0x42028000, 0x00000029, 0x417a7800, - 0x0201f800, 0x00106a50, 0x0201f800, 0x00106ab4, - 0x0201f800, 0x001067fd, 0x0201f800, 0x001049e7, - 0x04020005, 0x4937c857, 0x4a026c00, 0x00000404, - 0x0401f003, 0x0201f800, 0x00104a14, 0x0201f800, - 0x0010a2ff, 0x81468800, 0x8058b040, 0x040207e1, - 0x5c03e000, 0x02000800, 0x00106c4b, 0x5c00b000, - 0x5c028800, 0x5c026800, 0x5c028000, 0x5c027800, - 0x1c01f000, 0x4937c857, 0x4947c857, 0x4c5c0000, - 0x4c600000, 0x4c640000, 0x59a80013, 0x8c000500, - 0x0400001f, 0x599c0017, 0x8c00050a, 0x0402001c, - 0x5934ba02, 0x825cbd00, 0x000000ff, 0x485fc857, - 0x4178c000, 0x4178c800, 0x82600400, 0x0010be21, - 0x50002000, 0x8060c1c0, 0x04000008, 0x82100500, - 0x000000ff, 0x82002d80, 0x000000ff, 0x0400000c, - 0x805c0580, 0x0400000d, 0x80102110, 0x8064c800, - 0x82640580, 0x00000004, 0x040207f5, 0x8060c000, - 0x82600580, 0x00000020, 0x040207eb, 0x4813c857, - 0x82000540, 0x00000001, 0x5c00c800, 0x5c00c000, - 0x5c00b800, 0x1c01f000, 0x59a80026, 0x4803c857, - 0x8c000512, 0x1c01f000, 0x00007eef, 0x00007de8, - 0x00007ce4, 0x000080e2, 0x00007be1, 0x000080e0, - 0x000080dc, 0x000080da, 0x00007ad9, 0x000080d6, - 0x000080d5, 0x000080d4, 0x000080d3, 0x000080d2, - 0x000080d1, 0x000079ce, 0x000078cd, 0x000080cc, - 0x000080cb, 0x000080ca, 0x000080c9, 0x000080c7, - 0x000080c6, 0x000077c5, 0x000076c3, 0x000080bc, - 0x000080ba, 0x000075b9, 0x000080b6, 0x000074b5, - 0x000073b4, 0x000072b3, 0x000080b2, 0x000080b1, - 0x000080ae, 0x000071ad, 0x000080ac, 0x000070ab, - 0x00006faa, 0x00006ea9, 0x000080a7, 0x00006da6, - 0x00006ca5, 0x00006ba3, 0x00006a9f, 0x0000699e, - 0x0000689d, 0x0000809b, 0x00008098, 0x00006797, - 0x00006690, 0x0000658f, 0x00006488, 0x00006384, - 0x00006282, 0x00008081, 0x00008080, 0x0000617c, - 0x0000607a, 0x00008079, 0x00005f76, 0x00008075, - 0x00008074, 0x00008073, 0x00008072, 0x00008071, - 0x0000806e, 0x00005e6d, 0x0000806c, 0x00005d6b, - 0x00005c6a, 0x00005b69, 0x00008067, 0x00005a66, - 0x00005965, 0x00005863, 0x0000575c, 0x0000565a, - 0x00005559, 0x00008056, 0x00008055, 0x00005454, - 0x00005353, 0x00005252, 0x00005151, 0x0000504e, - 0x00004f4d, 0x0000804c, 0x0000804b, 0x00004e4a, - 0x00004d49, 0x00008047, 0x00004c46, 0x00008045, - 0x00008043, 0x0000803c, 0x0000803a, 0x00008039, - 0x00008036, 0x00004b35, 0x00008034, 0x00004a33, - 0x00004932, 0x00004831, 0x0000802e, 0x0000472d, - 0x0000462c, 0x0000452b, 0x0000442a, 0x00004329, - 0x00004227, 0x00008026, 0x00008025, 0x00004123, - 0x0000401f, 0x00003f1e, 0x00003e1d, 0x00003d1b, - 0x00003c18, 0x00008017, 0x00008010, 0x00003b0f, - 0x00003a08, 0x00008004, 0x00003902, 0x00008001, - 0x00008000, 0x00008000, 0x00003800, 0x00003700, - 0x00003600, 0x00008000, 0x00003500, 0x00008000, - 0x00008000, 0x00008000, 0x00003400, 0x00008000, - 0x00008000, 0x00008000, 0x00008000, 0x00008000, - 0x00008000, 0x00003300, 0x00003200, 0x00008000, - 0x00008000, 0x00008000, 0x00008000, 0x00008000, - 0x00008000, 0x00003100, 0x00003000, 0x00008000, - 0x00008000, 0x00002f00, 0x00008000, 0x00002e00, - 0x00002d00, 0x00002c00, 0x00008000, 0x00008000, - 0x00008000, 0x00002b00, 0x00008000, 0x00002a00, - 0x00002900, 0x00002800, 0x00008000, 0x00002700, - 0x00002600, 0x00002500, 0x00002400, 0x00002300, - 0x00002200, 0x00008000, 0x00008000, 0x00002100, - 0x00002000, 0x00001f00, 0x00001e00, 0x00001d00, - 0x00001c00, 0x00008000, 0x00008000, 0x00001b00, - 0x00001a00, 0x00008000, 0x00001900, 0x00008000, - 0x00008000, 0x00008000, 0x00008000, 0x00008000, - 0x00008000, 0x00001800, 0x00008000, 0x00001700, - 0x00001600, 0x00001500, 0x00008000, 0x00001400, - 0x00001300, 0x00001200, 0x00001100, 0x00001000, - 0x00000f00, 0x00008000, 0x00008000, 0x00000e00, - 0x00000d00, 0x00000c00, 0x00000b00, 0x00000a00, - 0x00000900, 0x00008000, 0x00008000, 0x00000800, - 0x00000700, 0x00008000, 0x00000600, 0x00008000, - 0x00008000, 0x00008000, 0x00000500, 0x00000400, - 0x00000300, 0x00008000, 0x00000200, 0x00008000, - 0x00008000, 0x00008000, 0x00000100, 0x00008000, - 0x00008000, 0x00008000, 0x00008000, 0x00008000, - 0x00008000, 0x00000000, 0x00008000, 0x00008000, - 0x00008000, 0x00008000, 0x00008000, 0x00008000, - 0x00008000, 0x00008000, 0x00008000, 0x00008000, - 0x00008000, 0x00008000, 0x00008000, 0x00008000, - 0x00008000, 0x00008000, 0x0201f800, 0x001007d3, - 0x02000800, 0x001005d8, 0x492f4016, 0x1c01f000, - 0x83a0ac00, 0x00000006, 0x83a00580, 0x0010b4a4, - 0x0400000c, 0x492fc857, 0x812e59c0, 0x02000800, - 0x001005d8, 0x832ca400, 0x00000006, 0x4200b000, - 0x0000000d, 0x0201f800, 0x0010ab17, 0x0401f00f, - 0x4200b000, 0x00000010, 0x83e0a400, 0x00000020, - 0x50500000, 0x8050a000, 0x50500800, 0x900409c0, - 0x80040540, 0x4400a800, 0x8050a000, 0x8054a800, - 0x8058b040, 0x040207f7, 0x1c01f000, 0x59a00206, - 0x4803c857, 0x82000c80, 0x0000007f, 0x040210c9, - 0x59a80821, 0x0c01f001, 0x001022c0, 0x00102300, - 0x00102300, 0x0010234b, 0x0010236d, 0x00102300, - 0x001022c0, 0x0010238f, 0x001023a0, 0x00102300, - 0x00102300, 0x001023ad, 0x001023c5, 0x001023dd, - 0x00102300, 0x001023e7, 0x001023f4, 0x00102300, - 0x0010241d, 0x00102300, 0x0010247a, 0x00102300, - 0x00102300, 0x00102300, 0x00102300, 0x00102300, - 0x00102300, 0x00102300, 0x00102300, 0x00102300, - 0x00102300, 0x00102300, 0x00102491, 0x00102300, - 0x001024e3, 0x00102300, 0x00102300, 0x00102300, - 0x00102300, 0x001024e8, 0x00102560, 0x00102300, - 0x00102567, 0x00102300, 0x00102300, 0x00102300, - 0x00102300, 0x00102300, 0x00102569, 0x001025ea, - 0x00102727, 0x00102300, 0x00102300, 0x00102300, - 0x00102300, 0x00102300, 0x00102736, 0x00102300, - 0x00102300, 0x00102300, 0x00102300, 0x00102300, - 0x00102300, 0x00102300, 0x00102753, 0x001027a6, - 0x00102802, 0x00102816, 0x00102835, 0x00102a70, - 0x00102dff, 0x00102300, 0x00102300, 0x00102300, - 0x00102300, 0x00102300, 0x00102300, 0x00102300, - 0x00102300, 0x00102300, 0x00102300, 0x00102300, - 0x00102300, 0x00102fb4, 0x00103028, 0x00102300, - 0x00102300, 0x00103094, 0x00102300, 0x00103126, - 0x001031d8, 0x00102300, 0x00102300, 0x0010320f, - 0x0010326b, 0x00102300, 0x001032bd, 0x00103419, - 0x00102300, 0x0010342d, 0x001034b8, 0x00102300, - 0x00102300, 0x00102300, 0x00102300, 0x00103522, - 0x00103526, 0x00103545, 0x00102300, 0x001035e7, - 0x00102300, 0x00102300, 0x00103615, 0x00102300, - 0x00103643, 0x00102300, 0x00102300, 0x001036aa, - 0x001037b7, 0x00103814, 0x00102300, 0x0010387a, - 0x00102300, 0x00102300, 0x001038d3, 0x00103936, - 0x00102300, 0x48efc857, 0x4031d800, 0x58ef400b, - 0x58ec0002, 0x82000580, 0x00000200, 0x04000045, - 0x48efc857, 0x4a034206, 0x00004000, 0x0201f800, - 0x00103a15, 0x83a00580, 0x0010b4a4, 0x0400000d, - 0x58ee580a, 0x4d2c0000, 0x0401f856, 0x41a25800, - 0x0201f800, 0x001007f4, 0x40ee5800, 0x0201f800, - 0x001007f4, 0x5c025800, 0x0201f000, 0x000202da, - 0x04026007, 0x59a0001d, 0x84000542, 0x4803401d, - 0x4a01d809, 0x001022d4, 0x1c01f000, 0x59a00206, - 0x82000d80, 0x00004000, 0x04000006, 0x900001c0, - 0x82000540, 0x00000011, 0x4803c011, 0x0401f005, - 0x900001c0, 0x82000540, 0x00000010, 0x4803c011, - 0x0401f845, 0x59e00017, 0x8c000508, 0x0402000c, - 0x4203e000, 0x30000001, 0x4203e000, 0x40000000, - 0x40ee5800, 0x0201f800, 0x001007f4, 0x59a0001d, - 0x84000504, 0x4803401d, 0x1c01f000, 0x4a03c017, - 0x00000000, 0x59a00206, 0x82000d80, 0x00004000, - 0x040007f0, 0x4a03c017, 0x00000001, 0x0401f7ed, - 0x4803c856, 0x4a034206, 0x00004001, 0x0401f7c0, - 0x4803c856, 0x4a034206, 0x00004002, 0x0401f7bc, - 0x4803c856, 0x4a034206, 0x00004003, 0x0401f7b8, - 0x4803c856, 0x4a034206, 0x00004005, 0x0401f7b4, - 0x4803c856, 0x4a034206, 0x00004006, 0x0401f7b0, - 0x4803c856, 0x4a034206, 0x0000400b, 0x0401f7ac, - 0x4803c856, 0x4a034206, 0x0000400c, 0x0401f7a8, - 0x4803c856, 0x4a034206, 0x0000400c, 0x0401f7a4, - 0x48efc857, 0x58eca80a, 0x8054a9c0, 0x02000800, - 0x001005d8, 0x83a0a400, 0x00000006, 0x8254ac00, - 0x00000006, 0x4200b000, 0x0000000d, 0x0201f000, - 0x0010ab17, 0x59a00206, 0x4803c857, 0x59a00406, - 0x4803c857, 0x59a00207, 0x4803c857, 0x59a00407, - 0x4803c857, 0x59a00208, 0x4803c857, 0x59a00408, - 0x4803c857, 0x59a00209, 0x4803c857, 0x83e0ac00, - 0x00000020, 0x83a0a400, 0x00000006, 0x4200b000, - 0x00000010, 0x50500000, 0x4400a800, 0x8054a800, - 0x900001c0, 0x4400a800, 0x8054a800, 0x8050a000, - 0x8058b040, 0x040207f8, 0x1c01f000, 0x59a00406, - 0x800000c2, 0x59a00a07, 0x900409c0, 0x80040540, - 0x84000540, 0x59a00c07, 0x8c040d00, 0x04000018, - 0x59a80805, 0x8c040d0e, 0x040207ba, 0x42000800, - 0x00000064, 0x80040840, 0x04000007, 0x4a030000, - 0x00000001, 0x40000000, 0x59801000, 0x8c081500, - 0x040007f9, 0x04000005, 0x48030004, 0x4a030000, - 0x00000000, 0x0401f75b, 0x4a030000, 0x00000000, - 0x4a034406, 0x00000004, 0x040007a2, 0x4803880e, - 0x0401f754, 0x59a00406, 0x800000c2, 0x59a00c07, - 0x8c040d00, 0x0400001a, 0x59a80805, 0x8c040d0e, - 0x0402079c, 0x42000800, 0x00000064, 0x80040840, - 0x04000007, 0x4a030000, 0x00000001, 0x40000000, - 0x59801000, 0x8c081500, 0x040007f9, 0x04000007, - 0x48030004, 0x59800805, 0x48074406, 0x4a030000, - 0x00000000, 0x0401f73b, 0x4a030000, 0x00000000, - 0x4a034406, 0x00000004, 0x04000782, 0x4803880e, - 0x59c4080f, 0x48074406, 0x0401f732, 0x59a01c06, - 0x59a00207, 0x900c19c0, 0x800c1d40, 0x580c0803, - 0x80000580, 0x500c1000, 0x80080400, 0x800c1800, - 0x80040840, 0x040207fc, 0x48034406, 0x900001c0, - 0x48034207, 0x800001c0, 0x04000722, 0x0401f769, - 0x4a034406, 0x00000004, 0x4a034207, 0x00000000, - 0x4a034407, 0x00000010, 0x59a8000d, 0x48034208, - 0x900001c0, 0x48034408, 0x4a034209, 0x00000002, - 0x0401f714, 0x59a00407, 0x59a01207, 0x900811c0, - 0x80081540, 0x59a00409, 0x59a01a09, 0x900c19c0, - 0x800c1d40, 0x59a00a08, 0x59a00408, 0x900409c0, - 0x80040d40, 0x59a0020a, 0x82002480, 0x00000010, - 0x04001754, 0x59a02406, 0x900001c0, 0x80100540, - 0x59a8280d, 0x80142480, 0x0400174e, 0x0201f000, - 0x00103a25, 0x59a00407, 0x59a01207, 0x900811c0, - 0x80081540, 0x59a00409, 0x59a01a09, 0x900c19c0, - 0x800c1d40, 0x59a00a08, 0x59a00408, 0x900409c0, - 0x80040d40, 0x59a0020a, 0x82002480, 0x00000010, - 0x0400173c, 0x59a02406, 0x900001c0, 0x80100540, - 0x59a8280d, 0x80142480, 0x04001736, 0x0201f000, - 0x00103a28, 0x59a00a0a, 0x59a00406, 0x900409c0, - 0x80040d40, 0x59a01407, 0x59a00207, 0x900811c0, - 0x80081540, 0x44080800, 0x0401f6da, 0x59a00a0a, - 0x59a00406, 0x900409c0, 0x80040d40, 0x50040000, - 0x82000d00, 0x0000ffff, 0x48074207, 0x82000d00, - 0xffff0000, 0x900409c0, 0x48074407, 0x0401f6cd, - 0x59a00406, 0x8c000500, 0x04000020, 0x59a01207, - 0x59a01c07, 0x59a02208, 0x480b5054, 0x480f5055, - 0x48135056, 0x59c40801, 0x82040d00, 0x00018000, - 0x82040580, 0x00000000, 0x04000009, 0x82040580, - 0x00008000, 0x04000008, 0x82040580, 0x00010000, - 0x04000007, 0x0201f800, 0x001005d8, 0x40080000, - 0x0401f004, 0x400c0000, 0x0401f002, 0x40100000, - 0x80000110, 0x42000800, 0x000000e0, 0x0201f800, - 0x00101944, 0x0401f007, 0x59a81054, 0x59a81855, - 0x59a82056, 0x480b4207, 0x480f4407, 0x48134208, - 0x0401f6a4, 0x4d2c0000, 0x4d340000, 0x4d300000, - 0x4d440000, 0x59a28c06, 0x0201f800, 0x00020245, - 0x04000006, 0x5c028800, 0x5c026000, 0x5c026800, - 0x5c025800, 0x0401f6e7, 0x59a04407, 0x59a00207, - 0x900001c0, 0x80204540, 0x0401f81e, 0x04000009, - 0x4a034208, 0x00000001, 0x4a034406, 0x0000ffff, - 0x4a034207, 0x0000ffff, 0x497b4407, 0x0401f00b, - 0x0401f822, 0x0400000e, 0x4a034208, 0x00000002, - 0x59300402, 0x48034406, 0x59300202, 0x48034207, - 0x59300206, 0x48034407, 0x5c028800, 0x5c026000, - 0x5c026800, 0x5c025800, 0x0401f67a, 0x5c028800, - 0x5c026000, 0x5c026800, 0x5c025800, 0x0401f6c1, - 0x4937c856, 0x4823c856, 0x4d2c0000, 0x5934000f, - 0x80025d40, 0x04000007, 0x592c0005, 0x80200580, - 0x592c0000, 0x040207fb, 0x82000540, 0x00000001, - 0x5c025800, 0x1c01f000, 0x4823c857, 0x4d2c0000, - 0x4d300000, 0x42026000, 0x0010d1c0, 0x59300406, - 0x82000d80, 0x00000003, 0x04000004, 0x82000d80, - 0x00000006, 0x04020007, 0x59325808, 0x812e59c0, - 0x04000004, 0x592c0005, 0x80200580, 0x0400000a, - 0x83326400, 0x00000024, 0x41580000, 0x81300480, - 0x040017ef, 0x80000580, 0x5c026000, 0x5c025800, - 0x1c01f000, 0x82000540, 0x00000001, 0x5c026000, - 0x5c025800, 0x1c01f000, 0x83a00580, 0x0010b4a4, - 0x04020684, 0x59a80005, 0x8c00050e, 0x04020003, - 0x4a030000, 0x00000000, 0x4a034206, 0x00004000, - 0x4a03c011, 0x40000010, 0x0401fea7, 0x59e00017, - 0x8c000508, 0x04000003, 0x4a03c017, 0x00000000, - 0x4203e000, 0x30000001, 0x4203e000, 0x40000000, - 0x0401f000, 0x800409c0, 0x04000004, 0x4a034406, - 0x00000001, 0x0401f677, 0x836c0580, 0x00000003, - 0x04020010, 0x59a80010, 0x497b4406, 0x0201f800, - 0x0010513b, 0x0400000f, 0x82000d00, 0x00ffff00, - 0x0402000c, 0x82000c00, 0x0010210e, 0x50040800, - 0x80040910, 0x82041580, 0x00000080, 0x04020004, - 0x4a034406, 0x00000007, 0x0401f662, 0x48074406, - 0x82000d00, 0x0000ffff, 0x48074207, 0x80000120, - 0x48034407, 0x59a80026, 0x82001500, 0x00000100, - 0x480b4409, 0x8c000502, 0x0400001f, 0x8c000506, - 0x04000009, 0x82000d00, 0x0000000a, 0x82040d80, - 0x0000000a, 0x04020004, 0x4a034209, 0x00000001, - 0x0401f022, 0x8c00050a, 0x04000009, 0x82000d00, - 0x00000022, 0x82040d80, 0x00000022, 0x04020004, - 0x4a034209, 0x00000003, 0x0401f018, 0x8c000508, - 0x04000009, 0x82000d00, 0x00000012, 0x82040d80, - 0x00000012, 0x04020004, 0x4a034209, 0x00000002, - 0x0401f00e, 0x0201f800, 0x0010513b, 0x04020004, - 0x4a034209, 0x00000004, 0x0401f5e6, 0x8c000506, - 0x04000004, 0x4a034406, 0x00000005, 0x0401f62d, - 0x4a034209, 0x00000000, 0x0401f5de, 0x59a80037, - 0x48034407, 0x59a80038, 0x48034209, 0x0401f5d9, - 0x42007800, 0x0010b8ec, 0x59a00406, 0x4803c857, - 0x82000c80, 0x00000006, 0x04021622, 0x0c01f001, - 0x001024f6, 0x001024f7, 0x00102505, 0x00102518, - 0x00102539, 0x001024f6, 0x0401f61a, 0x836c0580, - 0x00000000, 0x04000613, 0x59a00a07, 0x59a00407, - 0x900001c0, 0x80040d40, 0x4807c857, 0x59a00a08, - 0x59a00408, 0x900001c0, 0x80040d40, 0x4807c857, - 0x0401f056, 0x836c0580, 0x00000000, 0x04000605, - 0x59a00407, 0x59a01207, 0x900001c0, 0x80081540, - 0x59a00408, 0x59a01a08, 0x900001c0, 0x800c1d40, - 0x42000000, 0x0010c1bf, 0x480fc857, 0x480bc857, - 0x42000800, 0x00001000, 0x0201f000, 0x00103a28, - 0x59a00a07, 0x59a00407, 0x900001c0, 0x80041d40, - 0x820c0c80, 0x0010ab4a, 0x040215f2, 0x820c0c80, - 0x00100000, 0x040015ef, 0x480fc857, 0x823c7c00, - 0x00000009, 0x503c0800, 0x800409c0, 0x04000006, - 0x823c0580, 0x0000000d, 0x040005e6, 0x803c7800, - 0x0401f7f9, 0x59e41001, 0x82080d00, 0xfffeffcf, - 0x4807c801, 0x440c7800, 0x46001800, 0x0201f800, - 0x800c1800, 0x46001800, 0x001005cb, 0x480bc801, - 0x0401f022, 0x59a01a07, 0x59a00407, 0x900001c0, - 0x800c1d40, 0x480c7801, 0x59a02208, 0x59a00408, - 0x900001c0, 0x80102540, 0x48107802, 0x59a00209, - 0x80000040, 0x040015cb, 0x48007806, 0x80000000, - 0x48007805, 0x42000800, 0x00004000, 0x40001000, - 0x0201f800, 0x00106681, 0x80000540, 0x04000003, - 0x49787801, 0x0401f5bf, 0x40040000, 0x800c1c00, - 0x040015bc, 0x480c7803, 0x48107804, 0x49787808, - 0x59a00409, 0x48007807, 0x59e40001, 0x4803c857, - 0x82000540, 0x00040000, 0x4803c801, 0x0401f561, - 0x59a80006, 0x48034406, 0x59a80007, 0x48034207, - 0x59a80008, 0x48034407, 0x0401f55a, 0x0201f800, - 0x001005d8, 0x4803c856, 0x4a03c013, 0x03800300, - 0x4a03c014, 0x03800380, 0x59a00c06, 0x82040580, - 0x000000a0, 0x04000004, 0x82040580, 0x000000a2, - 0x0402002b, 0x59a0140a, 0x82080480, 0x00000100, - 0x04021027, 0x59a0020b, 0x8c000500, 0x0402002e, - 0x59a00a0a, 0x800409c0, 0x04000021, 0x82040480, - 0x00000041, 0x0402101e, 0x82040c00, 0x00000003, - 0x82040d00, 0x000000fc, 0x80040904, 0x59a00407, - 0x59a01207, 0x900811c0, 0x80081540, 0x59a00409, - 0x59a01a09, 0x900c19c0, 0x800c1d40, 0x0201f800, - 0x00103a00, 0x04020006, 0x4a034406, 0x00000002, - 0x4a03c014, 0x03800000, 0x0401f576, 0x832e5c00, - 0x00000004, 0x412c0000, 0x0201f800, 0x00103a25, - 0x4a01d809, 0x001025a2, 0x1c01f000, 0x4a03c014, - 0x03800000, 0x0401f56f, 0x4031d800, 0x58ef400b, - 0x58ee580d, 0x58ec0002, 0x82000580, 0x00000200, - 0x0400055c, 0x59a00c06, 0x59a0140a, 0x59a0020b, - 0x8c000500, 0x04020031, 0x832e5c00, 0x00000004, - 0x41783800, 0x59a04a0a, 0x401c0000, 0x812c0400, - 0x50004000, 0x82201d00, 0x000000ff, 0x4c040000, - 0x0401f8ac, 0x5c000800, 0x0400002d, 0x80244840, - 0x04000028, 0x80081000, 0x82201d00, 0x0000ff00, - 0x800c1910, 0x4c040000, 0x0401f8a2, 0x5c000800, - 0x04000023, 0x80244840, 0x0400001e, 0x80081000, - 0x82201d00, 0x00ff0000, 0x800c1920, 0x4c040000, - 0x0401f898, 0x5c000800, 0x04000019, 0x80244840, - 0x04000014, 0x80081000, 0x82201d00, 0xff000000, - 0x800c1930, 0x4c040000, 0x0401f88e, 0x5c000800, - 0x0400000f, 0x80244840, 0x0400000a, 0x80081000, - 0x801c3800, 0x0401f7d5, 0x59a0020a, 0x82000500, - 0x000000ff, 0x40001800, 0x0401f882, 0x04000004, - 0x4a03c014, 0x03800000, 0x0401f4da, 0x4a03c014, - 0x03800000, 0x0401f523, 0x4803c856, 0x4a03c013, - 0x03800300, 0x4a03c014, 0x03800380, 0x59a00c06, - 0x82040580, 0x000000a0, 0x04000004, 0x82040580, - 0x000000a2, 0x0402006c, 0x59a0140a, 0x82080480, - 0x00000100, 0x04021068, 0x59a0020b, 0x8c000500, - 0x0402005c, 0x59a01a0a, 0x800c19c0, 0x04000062, - 0x820c0480, 0x00000041, 0x0402105f, 0x0201f800, - 0x00103a00, 0x04020006, 0x4a034406, 0x00000002, - 0x4a03c014, 0x03800000, 0x0401f502, 0x832e5c00, - 0x00000004, 0x41783800, 0x59a04a0a, 0x401c0000, - 0x812c0400, 0x40004000, 0x4c040000, 0x4c080000, - 0x0401f874, 0x5c001000, 0x5c000800, 0x04000047, - 0x44144000, 0x80244840, 0x0400002b, 0x80081000, - 0x4c040000, 0x4c080000, 0x0401f86a, 0x5c001000, - 0x5c000800, 0x0400003d, 0x50200000, 0x801428d0, - 0x80140540, 0x44004000, 0x80244840, 0x0400001e, - 0x80081000, 0x4c040000, 0x4c080000, 0x0401f85d, - 0x5c001000, 0x5c000800, 0x04000030, 0x50200000, - 0x801428e0, 0x80140540, 0x44004000, 0x80244840, - 0x04000011, 0x80081000, 0x4c040000, 0x4c080000, - 0x0401f850, 0x5c001000, 0x5c000800, 0x04000023, - 0x50200000, 0x801428f0, 0x80140540, 0x44004000, - 0x80244840, 0x04000004, 0x80081000, 0x801c3800, - 0x0401f7cb, 0x59a00a0a, 0x82040c00, 0x00000003, - 0x82040d00, 0x000000fc, 0x80040904, 0x59a00407, - 0x59a01207, 0x900811c0, 0x80081540, 0x59a00409, - 0x59a01a09, 0x900c19c0, 0x800c1d40, 0x4a03c014, - 0x03800000, 0x412c0000, 0x0201f000, 0x00103a28, - 0x0401f830, 0x04000005, 0x48174406, 0x4a03c014, - 0x03800000, 0x0401f463, 0x4a03c014, 0x03800000, - 0x0401f4ac, 0x4a03c014, 0x03800000, 0x0401f4ad, - 0x0401f836, 0x04000010, 0x0401f862, 0x0402000f, - 0x40080800, 0x0401f85f, 0x0402000c, 0x400c0800, - 0x0401f85c, 0x04020009, 0x0401f84b, 0x42000000, - 0x00030d40, 0x80000040, 0x040207ff, 0x82000540, - 0x00000001, 0x1c01f000, 0x0401f843, 0x80000580, - 0x0401f7fd, 0x0401f821, 0x0400000a, 0x82040d40, - 0x00000001, 0x0401f84b, 0x04020007, 0x0401f87e, - 0x0401f898, 0x0401f838, 0x82000540, 0x00000001, - 0x1c01f000, 0x0401f834, 0x80000580, 0x0401f7fd, - 0x40041800, 0x0401f811, 0x0400000c, 0x0401f83d, - 0x0402000b, 0x40080800, 0x0401f83a, 0x04020008, - 0x400c0800, 0x0401ffe8, 0x04000004, 0x0401f826, - 0x82000540, 0x00000001, 0x1c01f000, 0x0401f822, - 0x80000580, 0x0401f7fd, 0x4c040000, 0x42000800, - 0x00000064, 0x4a03c013, 0x03800300, 0x80040840, - 0x04000016, 0x59e00013, 0x82000500, 0x00000300, - 0x82000580, 0x00000300, 0x040207f7, 0x42000000, - 0x00000064, 0x80000040, 0x040207ff, 0x4a03c013, - 0x01000000, 0x42000000, 0x00000064, 0x80000040, - 0x040207ff, 0x4a03c013, 0x02000000, 0x82000540, - 0x00000001, 0x0401f002, 0x80000580, 0x5c000800, - 0x1c01f000, 0x4a03c013, 0x01000000, 0x42000000, - 0x00000064, 0x80000040, 0x040207ff, 0x4a03c013, - 0x02000200, 0x42000000, 0x00000064, 0x80000040, - 0x040207ff, 0x4a03c013, 0x01000100, 0x1c01f000, - 0x42002000, 0x00000008, 0x82040500, 0x00000080, - 0x800000c2, 0x82000540, 0x01000000, 0x4803c013, - 0x42000000, 0x00000064, 0x80000040, 0x040207ff, - 0x4a03c013, 0x02000200, 0x42000000, 0x00000064, - 0x80000040, 0x040207ff, 0x4a03c013, 0x02000000, - 0x800408c2, 0x80102040, 0x040207ec, 0x4a03c013, - 0x01000100, 0x42000000, 0x00000064, 0x80000040, - 0x040207ff, 0x4a03c013, 0x02000200, 0x42000000, - 0x00000064, 0x80000040, 0x040207ff, 0x59e00013, - 0x82000500, 0x00000100, 0x4a03c013, 0x02000000, - 0x4c040000, 0x42000800, 0x00000064, 0x59e00013, - 0x82000500, 0x00000100, 0x80040840, 0x04000003, - 0x80000540, 0x040207fa, 0x80000540, 0x5c000800, - 0x1c01f000, 0x4a03c013, 0x01000100, 0x42001000, - 0x00000008, 0x80000d80, 0x42000000, 0x00000064, - 0x80000040, 0x040207ff, 0x4a03c013, 0x02000200, - 0x42000000, 0x00000064, 0x80000040, 0x040207ff, - 0x59e00013, 0x82000500, 0x00000100, 0x80000110, - 0x800408c2, 0x80040d40, 0x4a03c013, 0x02000000, - 0x80081040, 0x040207ed, 0x40042800, 0x1c01f000, - 0x4a03c013, 0x01000100, 0x42000000, 0x00000064, - 0x80000040, 0x040207ff, 0x4a03c013, 0x02000200, - 0x42000000, 0x00000064, 0x80000040, 0x040207ff, - 0x4a03c013, 0x02000000, 0x1c01f000, 0x59a00407, - 0x59a80837, 0x48035037, 0x48074407, 0x59a00a09, - 0x82040480, 0x00000014, 0x04021003, 0x42000800, - 0x000007d0, 0x59a80038, 0x48075038, 0x48034209, - 0x0201f000, 0x001022c0, 0x836c0580, 0x00000000, - 0x0400000e, 0x59a80006, 0x59a00c06, 0x80041580, - 0x82081500, 0x00000040, 0x02000000, 0x001022c0, - 0x80080580, 0x48035006, 0x0201f800, 0x00100699, - 0x0201f000, 0x001022c0, 0x59a00406, 0x59a80806, - 0x48035006, 0x80040d80, 0x8c040d0c, 0x02020800, - 0x00100699, 0x59a00207, 0x48035007, 0x59a00407, - 0x48035008, 0x0201f000, 0x001022c0, 0x800409c0, - 0x04000005, 0x4a034406, 0x00000001, 0x0201f000, - 0x0010230c, 0x0201f800, 0x0010513b, 0x04020005, - 0x4a034406, 0x00000016, 0x0201f000, 0x0010230c, - 0x836c0580, 0x00000003, 0x04000005, 0x4a034406, - 0x00000007, 0x0201f000, 0x0010230c, 0x59a00c06, - 0x82040500, 0xffffff00, 0x02020000, 0x00102310, - 0x82041580, 0x000000ff, 0x04020007, 0x59a80010, - 0x82000500, 0x000000ff, 0x82001540, 0x0000ff00, - 0x0401f011, 0x82040400, 0x0010210e, 0x50000000, - 0x80000110, 0x82000580, 0x00000080, 0x02000000, - 0x00102310, 0x59a80010, 0x82000500, 0x000000ff, - 0x80041580, 0x02000000, 0x00102310, 0x840409c0, - 0x80041540, 0x0201f800, 0x0002075a, 0x04020005, - 0x4a034406, 0x00000003, 0x0201f000, 0x0010230c, - 0x48ee6021, 0x480a621c, 0x4a02641c, 0x0000bc09, - 0x4a026406, 0x00000001, 0x0201f800, 0x00103a00, - 0x04020007, 0x0201f800, 0x0002077d, 0x4a034406, - 0x00000002, 0x0201f000, 0x0010230c, 0x497a5a04, - 0x497a5805, 0x4a025c04, 0x00008000, 0x4a01d809, - 0x001027f9, 0x492e6008, 0x42027000, 0x00000032, - 0x0201f000, 0x000207a1, 0x800409c0, 0x04000005, - 0x4a034406, 0x00000001, 0x0201f000, 0x0010230c, - 0x0201f800, 0x0010513b, 0x04020005, 0x4a034406, - 0x00000016, 0x0201f000, 0x0010230c, 0x836c0580, - 0x00000003, 0x04000005, 0x4a034406, 0x00000007, - 0x0201f000, 0x0010230c, 0x59a00c06, 0x82040500, - 0xffffff00, 0x02020000, 0x00102310, 0x82041580, - 0x000000ff, 0x04020007, 0x59a80010, 0x82000500, - 0x000000ff, 0x82001540, 0x0000ff00, 0x0401f011, - 0x82040400, 0x0010210e, 0x50000000, 0x80000110, - 0x82000580, 0x00000080, 0x02000000, 0x00102310, - 0x59a80010, 0x82000500, 0x000000ff, 0x80041580, - 0x02000000, 0x00102310, 0x840409c0, 0x80041540, - 0x0201f800, 0x0002075a, 0x04020005, 0x4a034406, - 0x00000003, 0x0201f000, 0x0010230c, 0x48ee6021, - 0x480a621c, 0x4a02641c, 0x0000bc05, 0x4a026406, - 0x00000001, 0x0201f800, 0x00103a00, 0x04020007, - 0x0201f800, 0x0002077d, 0x4a034406, 0x00000002, - 0x0201f000, 0x0010230c, 0x497a5a04, 0x497a5805, - 0x4a025c04, 0x00008000, 0x4a01d809, 0x001027f9, - 0x492e6008, 0x42027000, 0x00000032, 0x0201f000, - 0x000207a1, 0x592c0005, 0x82000580, 0x01000000, - 0x02020000, 0x001022c0, 0x4a034406, 0x00000004, - 0x0201f000, 0x0010230c, 0x497b4406, 0x497b4207, - 0x0201f800, 0x00103b25, 0x04000008, 0x59a80066, - 0x59a8086a, 0x80040480, 0x59a80867, 0x48074406, - 0x80041480, 0x480b4207, 0x49674407, 0x59a8000e, - 0x48034209, 0x495f4409, 0x59a80020, 0x4803420b, - 0x0201f000, 0x001022c0, 0x800409c0, 0x04000005, - 0x4a034406, 0x00000001, 0x0201f000, 0x0010230c, - 0x59a00406, 0x8c000500, 0x0402000f, 0x59a80069, - 0x81640480, 0x04001008, 0x59a8000b, 0x81500580, - 0x04000009, 0x59a8006a, 0x59a81066, 0x80080580, - 0x04000005, 0x4a034406, 0x00000018, 0x0201f000, - 0x0010230c, 0x82000540, 0x00000001, 0x0201f800, - 0x001015fe, 0x0201f800, 0x00103c80, 0x0201f000, - 0x001022c0, 0x4803c856, 0x800409c0, 0x02020000, - 0x00102314, 0x59a00406, 0x8c00051e, 0x04000008, - 0x4803c856, 0x59a0020b, 0x82000480, 0x00000800, - 0x04001015, 0x0201f000, 0x00102310, 0x4803c856, - 0x59a0020b, 0x599c0a01, 0x80040480, 0x04021003, - 0x0201f000, 0x00102310, 0x59a8000e, 0x81640580, - 0x04000009, 0x4a034406, 0x00000018, 0x0201f000, - 0x0010230c, 0x4a034406, 0x00000005, 0x0201f000, - 0x0010230c, 0x59a80026, 0x8c00050a, 0x040007fa, - 0x59a00406, 0x8c00051e, 0x04000036, 0x0201f800, - 0x0002075a, 0x040007f4, 0x0201f800, 0x00103a00, - 0x040007f1, 0x497a5a04, 0x59a00406, 0x4802620a, - 0x59a00209, 0x4802640a, 0x59a00409, 0x4802620b, - 0x59a0020d, 0x4802620c, 0x59a0040d, 0x4802640c, - 0x59a0020e, 0x4802620d, 0x59a0040e, 0x4802640d, - 0x59a00210, 0x4802620e, 0x59a00410, 0x4802640e, - 0x59a0020b, 0x82000500, 0x0000fffc, 0x80000104, - 0x4802640b, 0x0401f9d9, 0x040007d7, 0x48ee6021, - 0x58ee580d, 0x5930020e, 0x59301c0e, 0x900c19c0, - 0x800c1d40, 0x5930020c, 0x5930140c, 0x900811c0, - 0x80081540, 0x592c0a05, 0x832c0400, 0x00000006, - 0x0201f800, 0x00103a25, 0x4a01d809, 0x001029e5, - 0x4a034000, 0x00000001, 0x49334001, 0x1c01f000, - 0x0201f800, 0x00106c55, 0x0201f800, 0x00100ae0, - 0x0401f86d, 0x497b5057, 0x4201d000, 0x00002710, - 0x0201f800, 0x001060c6, 0x59c40880, 0x4c040000, - 0x59c408a3, 0x4c040000, 0x497b4002, 0x0401f876, - 0x0401f893, 0x4a03a005, 0x10000000, 0x0401f8b4, - 0x0401f901, 0x04000048, 0x59c80001, 0x800001c0, - 0x040007fc, 0x59c80018, 0x82000500, 0xf0000000, - 0x59c00808, 0x82040d00, 0x0fffffff, 0x80040540, - 0x48038008, 0x0201f800, 0x00100ec1, 0x59c00006, - 0x4a038006, 0x10000000, 0x59c00009, 0x82000d00, - 0x00e00000, 0x04020024, 0x4a03900d, 0x00000000, - 0x59c80020, 0x82000500, 0xff000000, 0x82000580, - 0x32000000, 0x0402001c, 0x4a03900d, 0x00000001, - 0x59c80020, 0x82000500, 0xff000000, 0x82000580, - 0xe1000000, 0x04020014, 0x4a03900d, 0x00000000, - 0x59c80020, 0x82000500, 0x00ffffff, 0x4a03900d, - 0x00000000, 0x59c80821, 0x82040d00, 0x00ffffff, - 0x80040580, 0x04020008, 0x59a80010, 0x80040580, - 0x04020005, 0x59c40005, 0x82000500, 0x000000f0, - 0x04000006, 0x4803c856, 0x0401f8d7, 0x4a035057, - 0x00000001, 0x0401f002, 0x0401f8e1, 0x42000000, - 0x00000064, 0x80000040, 0x02000800, 0x001005d8, - 0x59c00807, 0x82040d00, 0x0000000c, 0x040007fa, - 0x0401f003, 0x4a035057, 0x00000001, 0x0401f8da, - 0x0201f800, 0x00106f36, 0x0401f818, 0x4201d000, - 0x000186a0, 0x0201f800, 0x001060c6, 0x5c000800, - 0x480788a3, 0x5c000800, 0x48078880, 0x59a80057, - 0x800001c0, 0x02000000, 0x001022c0, 0x0201f000, - 0x00102318, 0x599c0201, 0x48035059, 0x41780800, - 0x42001000, 0x00003b10, 0x0201f800, 0x001066a0, - 0x480b505a, 0x1c01f000, 0x0201f800, 0x00106c4b, - 0x59b800ea, 0x82000500, 0x00000007, 0x82000580, - 0x00000003, 0x04020003, 0x4a0370e8, 0x00000001, - 0x1c01f000, 0x42038000, 0x00007700, 0x4a038006, - 0x30000000, 0x59c00007, 0x8c00050a, 0x040207fe, - 0x59c00006, 0x59a00209, 0x59a00c09, 0x900409c0, - 0x80040d40, 0x48078001, 0x59a0020e, 0x59a00c0e, - 0x900409c0, 0x80040d40, 0x48078000, 0x59a0020b, - 0x82000500, 0x0000fffc, 0x48038002, 0x48038003, - 0x48038005, 0x497b9009, 0x59e00003, 0x82000540, - 0x00008060, 0x4803c003, 0x1c01f000, 0x41780800, - 0x8007a0ca, 0x83d3a400, 0x00007600, 0x42000800, - 0x00000040, 0x0201f800, 0x00101345, 0x4a03a00a, - 0x00000001, 0x4a03a005, 0x20000000, 0x59d00006, - 0x4a03a005, 0x30000000, 0x59d00006, 0x8c00050a, - 0x040207fe, 0x59d00005, 0x59a00210, 0x59a00c10, - 0x900409c0, 0x80040d40, 0x4807a001, 0x59a0020d, - 0x59a00c0d, 0x900409c0, 0x80040d40, 0x4807a000, - 0x59a0020b, 0x82000500, 0x0000fffc, 0x4803a003, - 0x4803a002, 0x4803a008, 0x1c01f000, 0x59a00002, - 0x4803c857, 0x800001c0, 0x0402004a, 0x59a8005a, - 0x48038880, 0x59c400a3, 0x82000540, 0x00002008, - 0x8400053a, 0x480388a3, 0x59c40008, 0x8400054e, - 0x82000500, 0xffffffe1, 0x48038808, 0x59c80040, - 0x84000534, 0x48039040, 0x0401f902, 0x04020013, - 0x59a80010, 0x800000d0, 0x82000540, 0x00000011, - 0x48039120, 0x59a80010, 0x82000500, 0x00ffffff, - 0x82000540, 0x32000000, 0x48039121, 0x4a039123, - 0xe1290008, 0x59a80010, 0x82000500, 0x00ffffff, - 0x48039122, 0x0401f016, 0x59a80010, 0x82000500, - 0x000000ff, 0x900009c0, 0x840001c0, 0x80040540, - 0x82000540, 0x00000000, 0x48039120, 0x59a80010, - 0x82000500, 0x000000ff, 0x82000540, 0x01000000, - 0x48039121, 0x4a039123, 0x08210008, 0x59a80010, - 0x82000500, 0x000000ff, 0x48039122, 0x497b9124, - 0x59a80c5b, 0x80040800, 0x4807545b, 0x900409c0, - 0x82040540, 0x0000aaaa, 0x48039125, 0x497b9126, - 0x497b9127, 0x0401f8cf, 0x04020004, 0x4a039100, - 0x0000e980, 0x0401f003, 0x4a039100, 0x0000e9a0, - 0x1c01f000, 0x82000540, 0x00000001, 0x0402500d, - 0x4203e000, 0x80000000, 0x40e81000, 0x41780800, - 0x42000000, 0x00000064, 0x0201f800, 0x001066a0, - 0x59940024, 0x80080400, 0x48032824, 0x80000580, - 0x1c01f000, 0x4d900000, 0x4dd00000, 0x4da40000, - 0x4d140000, 0x417a3000, 0x0201f800, 0x001070d8, - 0x0201f800, 0x00106dc3, 0x5c022800, 0x5c034800, - 0x5c03a000, 0x5c032000, 0x1c01f000, 0x59c80007, - 0x8c000500, 0x04000003, 0x4a03900d, 0x00000030, - 0x1c01f000, 0x4a038805, 0x00020000, 0x42000800, - 0x0000003c, 0x0201f800, 0x00101345, 0x4a038891, - 0x0000ffff, 0x59c80035, 0x48039035, 0x4a03900d, - 0x00000040, 0x42038000, 0x00007700, 0x0201f800, - 0x00100ec1, 0x42038000, 0x00007720, 0x0201f800, - 0x00100ec1, 0x4a03a005, 0x20000000, 0x4a03a005, - 0x30000000, 0x59d00806, 0x8c040d0a, 0x040207fe, - 0x1c01f000, 0x4d300000, 0x4031d800, 0x58ef400b, - 0x58ee580d, 0x58ec0002, 0x82000580, 0x00000200, - 0x5c026000, 0x02000000, 0x00102304, 0x4d300000, - 0x59a26001, 0x59a00000, 0x4000b000, 0x80000000, - 0x48034000, 0x592c0001, 0x80000540, 0x0400001e, - 0x40025800, 0x8058b040, 0x040207fb, 0x58ec1007, - 0x58ec1808, 0x592c0a05, 0x4d2c0000, 0x58ec000d, - 0x40025800, 0x592c0204, 0x5c025800, 0x82000580, - 0x00000103, 0x04000008, 0x832c0400, 0x00000006, - 0x0201f800, 0x00103a25, 0x4a01d809, 0x001029e5, - 0x0401f007, 0x832c0400, 0x00000006, 0x0201f800, - 0x00103a28, 0x4a01d809, 0x001029e5, 0x5c026000, - 0x1c01f000, 0x58ec000d, 0x40025800, 0x592c0204, - 0x82000580, 0x00000103, 0x04020006, 0x0201f800, - 0x0002077d, 0x5c026000, 0x0201f000, 0x001022c0, - 0x58ec000d, 0x40025800, 0x592c0404, 0x8400055e, - 0x48025c04, 0x42028800, 0x000007fd, 0x42003000, - 0x00fffffd, 0x0201f800, 0x001045a6, 0x04000003, - 0x80000580, 0x0401f004, 0x59a26001, 0x0201f800, - 0x0010937d, 0x5c026000, 0x02000000, 0x0010230c, - 0x4d300000, 0x4a01d809, 0x00102a38, 0x0401f7dc, - 0x592c0005, 0x82000580, 0x01000000, 0x02000000, - 0x00102318, 0x4d300000, 0x59a26001, 0x5930020b, - 0x59301c0a, 0x900001c0, 0x800c1d40, 0x5930040d, - 0x5930120d, 0x900001c0, 0x80081540, 0x592c0a05, - 0x832c0400, 0x00000006, 0x0201f800, 0x00103a28, - 0x4a01d809, 0x001029e5, 0x4a034000, 0x00000001, - 0x5c026000, 0x1c01f000, 0x4933c857, 0x4c300000, - 0x5930040b, 0x82000c80, 0x0000000e, 0x04001004, - 0x4a025a05, 0x0000000e, 0x0401f003, 0x48025a05, - 0x0401f00c, 0x800409c0, 0x0400000a, 0x4c040000, - 0x0201f800, 0x00103a00, 0x5c000800, 0x04000003, - 0x40040000, 0x0401f7f0, 0x80000580, 0x0401f003, - 0x82000540, 0x00000001, 0x5c006000, 0x1c01f000, - 0x59a00206, 0x82000580, 0x00000044, 0x1c01f000, - 0x4807c857, 0x800409c0, 0x0400000c, 0x0201f800, - 0x00101650, 0x04020009, 0x42000000, 0x00000002, - 0x0201f800, 0x0010188c, 0x42000000, 0x00000002, - 0x0201f800, 0x00101821, 0x59a00406, 0x82000500, - 0x00000007, 0x0c01f001, 0x00102a8c, 0x00102aa1, - 0x00102ab7, 0x00102a8a, 0x00102a8a, 0x00102a8a, - 0x00102a8a, 0x00102a8a, 0x0201f000, 0x00102310, - 0x42000800, 0x000000c0, 0x0201f800, 0x0010193f, - 0x82040540, 0x00000002, 0x42000800, 0x000000c0, - 0x0201f800, 0x00101944, 0x42000800, 0x00000000, - 0x0201f800, 0x0010193f, 0x82040540, 0x00000008, - 0x42000800, 0x00000000, 0x0201f800, 0x00101944, - 0x0401f00b, 0x42000800, 0x000000c0, 0x0201f800, - 0x0010193f, 0x82040540, 0x00000001, 0x42000800, - 0x000000c0, 0x0201f800, 0x00101944, 0x59c80040, - 0x4c000000, 0x59a80010, 0x4c000000, 0x59c400a3, - 0x4c000000, 0x59c40008, 0x4c000000, 0x0401f911, - 0x04000021, 0x0201f800, 0x001005d8, 0x59a80821, - 0x800409c0, 0x02020000, 0x00102314, 0x0201f800, - 0x0010513b, 0x04020005, 0x4a034406, 0x00000016, - 0x0201f000, 0x0010230c, 0x836c0580, 0x00000003, - 0x02020000, 0x00102314, 0x59c408a4, 0x82040d00, - 0x0000000f, 0x82040580, 0x00000000, 0x02020000, - 0x00102314, 0x59c80040, 0x4c000000, 0x59a80010, - 0x4c000000, 0x59c400a3, 0x4c000000, 0x59c40008, - 0x4c000000, 0x59c40080, 0x4c000000, 0x59a0020f, - 0x59a0bc0f, 0x905cb9c0, 0x805cbd40, 0x41784800, - 0x41785000, 0x41785800, 0x41789000, 0x41789800, - 0x0401fe21, 0x0201f800, 0x00106c55, 0x0201f800, - 0x00100ae0, 0x4178c000, 0x497b4002, 0x0401f95c, - 0x0401f9aa, 0x59a0020c, 0x59a00c0c, 0x80040d40, - 0x04000002, 0x0401f9fb, 0x0401f9fa, 0x0401fe68, - 0x8060c1c0, 0x04020014, 0x0401fa98, 0x0401feb2, - 0x0402000e, 0x0201f800, 0x001018d3, 0x04020008, - 0x4a034406, 0x00000017, 0x0201f800, 0x0010230c, - 0x4203e000, 0x50000000, 0x0401f000, 0x42005800, - 0x0000aaaa, 0x0401f058, 0x59c80001, 0x800001c0, - 0x040007ee, 0x59c80801, 0x800409c0, 0x04000006, - 0x0401fa70, 0x40240000, 0x80280540, 0x802c0540, - 0x0402004d, 0x59a00002, 0x82000580, 0xfeedbeef, - 0x04000004, 0x42008800, 0x10000000, 0x0401f003, - 0x42008800, 0x10000004, 0x0401fa19, 0x4a034002, - 0xfeedbeef, 0x0401fa71, 0x0401fa97, 0x0401fea8, - 0x59c40005, 0x8c000534, 0x04000004, 0x42005800, - 0x0000bbbb, 0x0401f038, 0x0401fe83, 0x04020007, - 0x42005800, 0x0000cccc, 0x485f420f, 0x905cb9c0, - 0x485f440f, 0x0401f030, 0x59a0040c, 0x800001c0, - 0x0400000e, 0x59a26000, 0x5930000d, 0x800001c0, - 0x040207be, 0x59a26001, 0x5930080d, 0x800409c0, - 0x040207ba, 0x804891c0, 0x040207b8, 0x804c99c0, - 0x040207b6, 0x0401f87a, 0x805cb840, 0x04000005, - 0x40240000, 0x80280540, 0x802c0540, 0x0402001a, - 0x42000000, 0x00030d40, 0x80000040, 0x04020012, - 0x59c00007, 0x82000500, 0x000501c0, 0x0402000b, - 0x0201f800, 0x001018d3, 0x04020008, 0x4a034406, - 0x00000017, 0x0201f800, 0x0010230c, 0x4203e000, - 0x50000000, 0x0401f000, 0x42005800, 0x0000dddd, - 0x0401f005, 0x59c00807, 0x82040d00, 0x0000000c, - 0x040007ea, 0x0401fe5c, 0x59a0040c, 0x800001c0, - 0x04000002, 0x0401f856, 0x0401fe6b, 0x40240000, - 0x80280540, 0x802c0540, 0x04020003, 0x805cb9c0, - 0x04020781, 0x0201f800, 0x00106f36, 0x0401fda3, - 0x4201d000, 0x000186a0, 0x0201f800, 0x001060c6, - 0x5c000800, 0x48078880, 0x5c000800, 0x48078808, - 0x5c000800, 0x480788a3, 0x5c000800, 0x48075010, - 0x5c000800, 0x48079040, 0x0201f800, 0x00100969, - 0x59a00406, 0x82000500, 0x00000003, 0x82000580, - 0x00000002, 0x0400002c, 0x42000800, 0x000000c0, - 0x0201f800, 0x0010193f, 0x82040500, 0xfffffffc, - 0x42000800, 0x000000c0, 0x0201f800, 0x00101944, - 0x42000800, 0x00000000, 0x0201f800, 0x0010193f, - 0x82040500, 0xfffffff7, 0x42000800, 0x00000000, - 0x0201f800, 0x00101944, 0x42000800, 0x00000000, - 0x0201f800, 0x0010193f, 0x82040500, 0xfffffffb, - 0x42000800, 0x00000000, 0x0201f800, 0x00101944, - 0x4a0388a7, 0x0000f7f7, 0x42006000, 0xbeffffff, - 0x42006800, 0x80018000, 0x0201f800, 0x0010427d, - 0x42006000, 0xfffeffff, 0x41786800, 0x0201f800, - 0x0010427d, 0x402c0000, 0x80280540, 0x80240540, - 0x02000000, 0x001022c0, 0x48274406, 0x482b4207, - 0x482f4407, 0x0201f000, 0x0010231c, 0x59a26000, - 0x813261c0, 0x0400000e, 0x59325808, 0x812e59c0, - 0x0400000b, 0x0201f800, 0x0002077d, 0x0201f800, - 0x001007fd, 0x59a26001, 0x59325808, 0x0201f800, - 0x0002077d, 0x0201f800, 0x001007fd, 0x1c01f000, - 0x42000800, 0x000000ef, 0x0201f800, 0x001015eb, - 0x59c400a3, 0x8400055a, 0x8400053a, 0x480388a3, - 0x0201f800, 0x0010163b, 0x0402000a, 0x42000000, - 0x00000001, 0x0201f800, 0x0010188c, 0x42000000, - 0x00000001, 0x0201f800, 0x00101821, 0x0401f013, - 0x0201f800, 0x00101642, 0x04020008, 0x41780000, - 0x0201f800, 0x0010188c, 0x41780000, 0x0201f800, - 0x00101821, 0x0401f009, 0x42000000, 0x00000002, - 0x0201f800, 0x0010188c, 0x42000000, 0x00000002, - 0x0201f800, 0x00101821, 0x42000800, 0x00000000, - 0x0201f800, 0x0010193f, 0x82040540, 0x00000004, - 0x42000800, 0x00000000, 0x0201f800, 0x00101944, - 0x4201d000, 0x00000014, 0x0201f800, 0x0010608e, - 0x59c40008, 0x8400054e, 0x82000500, 0xffffffe1, - 0x48038808, 0x4a0388a7, 0x0000f7f7, 0x42001000, - 0x04000001, 0x0201f800, 0x0010193d, 0x42006000, - 0xbe20bfff, 0x42006800, 0x80018000, 0x0201f800, - 0x0010427d, 0x42006000, 0xfffeffff, 0x41786800, - 0x0201f800, 0x0010427d, 0x4200b000, 0x00001388, - 0x4201d000, 0x00000014, 0x4c580000, 0x0201f800, - 0x0010608e, 0x0201f800, 0x001018d3, 0x5c00b000, - 0x04000004, 0x8058b040, 0x040207f6, 0x0401f025, - 0x59c40005, 0x8c000534, 0x04020007, 0x59c400a4, - 0x82000500, 0x0000000f, 0x82000580, 0x00000008, - 0x0402001c, 0x42006000, 0x00020000, 0x0201f800, - 0x00104282, 0x4201d000, 0x00000064, 0x0201f800, - 0x0010608e, 0x42006000, 0xfeffffff, 0x42006800, - 0x02000000, 0x0201f800, 0x0010427d, 0x42006000, - 0xfdffffff, 0x41786800, 0x0201f800, 0x0010427d, - 0x4a038805, 0x04000001, 0x59c400a4, 0x82000500, - 0x0000000f, 0x82000580, 0x00000000, 0x04000003, - 0x82000540, 0x00000001, 0x1c01f000, 0x4803c856, - 0x42038000, 0x00007700, 0x0201f800, 0x00100ec1, - 0x59c00006, 0x59a0040c, 0x800001c0, 0x0400003f, - 0x59a03c0c, 0x59a00209, 0x59a01c09, 0x900c19c0, - 0x800c1d40, 0x59a0020e, 0x59a0240e, 0x901021c0, - 0x80102540, 0x59a0020b, 0x82000500, 0x0000fffc, - 0x59a0140b, 0x900811c0, 0x80081540, 0x480b8003, - 0x0201f800, 0x0002075a, 0x02000800, 0x001005d8, - 0x49334000, 0x0201f800, 0x001007e4, 0x4a025a04, - 0x00000018, 0x4a025805, 0x00abcdef, 0x492e6008, - 0x492e600b, 0x481e600d, 0x4a02600c, 0x00000004, - 0x832c0400, 0x00000011, 0x4802600a, 0x42001000, - 0x0000000c, 0x821c0d80, 0x00000001, 0x04000004, - 0x801c3840, 0x0401f963, 0x0401f004, 0x41783800, - 0x0401f960, 0x0401f011, 0x821c0c80, 0x00000005, - 0x04001005, 0x40043800, 0x42001000, 0x0000003c, - 0x0401f006, 0x80001580, 0x82081400, 0x0000000c, - 0x801c3840, 0x040207fd, 0x832c0400, 0x00000005, - 0x0401f950, 0x040207f1, 0x497b9009, 0x59e00003, - 0x82000540, 0x00008060, 0x4803c003, 0x4a038009, - 0x00e00000, 0x1c01f000, 0x4803c856, 0x41780800, - 0x8007a0ca, 0x83d3a400, 0x00007600, 0x42000800, - 0x00000040, 0x0201f800, 0x00101345, 0x4a03a00a, - 0x00000001, 0x4a03a005, 0x20000000, 0x59d00006, - 0x4a03a005, 0x30000000, 0x59d00006, 0x8c00050a, - 0x040207fe, 0x59d00005, 0x59a0020c, 0x800001c0, - 0x0400003f, 0x59a03a0c, 0x59a00210, 0x59a01c10, - 0x900c19c0, 0x800c1d40, 0x59a0020d, 0x59a0240d, - 0x901021c0, 0x80102540, 0x59a0120b, 0x82081500, - 0x0000fffc, 0x59a0040b, 0x900001c0, 0x80081540, - 0x480ba003, 0x0201f800, 0x0002075a, 0x02000800, - 0x001005d8, 0x49334001, 0x0201f800, 0x001007e4, - 0x4a025a04, 0x00000018, 0x4a025805, 0x00abcdef, - 0x492e6008, 0x492e600b, 0x481e600d, 0x4a02600c, - 0x00000004, 0x832c0400, 0x00000011, 0x4802600a, - 0x42001000, 0x0000000c, 0x821c0d80, 0x00000001, - 0x04000004, 0x801c3840, 0x0401f906, 0x0401f004, - 0x41783800, 0x0401f903, 0x0401f011, 0x821c0c80, - 0x00000005, 0x04001005, 0x40043800, 0x42001000, - 0x0000003c, 0x0401f006, 0x80001580, 0x82081400, - 0x0000000c, 0x801c3840, 0x040207fd, 0x832c0400, - 0x00000005, 0x0401f8f3, 0x040207f1, 0x1c01f000, - 0x4803c856, 0x59a0020c, 0x800001c0, 0x04000024, - 0x824c0580, 0x00000002, 0x04000040, 0x59a26001, - 0x5930380d, 0x801c39c0, 0x0400003c, 0x801c3840, - 0x481e600d, 0x5932580b, 0x5930080a, 0x50042000, - 0x58041801, 0x58041002, 0x82081500, 0xfffffffc, - 0x5930000c, 0x80000000, 0x82000d80, 0x00000005, - 0x04020009, 0x497a600c, 0x592e5801, 0x812e59c0, - 0x0400001a, 0x492e600b, 0x832c0c00, 0x00000005, - 0x0401f005, 0x4802600c, 0x5930080a, 0x82040c00, - 0x00000003, 0x4806600a, 0x0401f010, 0x59a0120b, - 0x82081500, 0x0000fffc, 0x59a0040b, 0x900001c0, - 0x80081540, 0x480ba003, 0x59a0020d, 0x59a0240d, - 0x901021c0, 0x80102540, 0x59a00210, 0x59a01c10, - 0x900c19c0, 0x800c1d40, 0x4201d000, 0x00003a98, - 0x0201f800, 0x001060c6, 0x480ba002, 0x59a80059, - 0x4803a008, 0x4813a000, 0x480fa001, 0x4a03a005, - 0x10000000, 0x02005800, 0x001005d8, 0x804c9800, - 0x82000540, 0x00000001, 0x1c01f000, 0x4847c857, - 0x59a0040c, 0x800001c0, 0x04000024, 0x82480580, - 0x00000002, 0x04000042, 0x59a26000, 0x5930380d, - 0x801c39c0, 0x0400003e, 0x801c3840, 0x481e600d, - 0x5932580b, 0x5930080a, 0x50042000, 0x58041801, - 0x58041002, 0x82081500, 0xfffffffc, 0x5930000c, - 0x80000000, 0x82000d80, 0x00000005, 0x04020009, - 0x497a600c, 0x592e5801, 0x812e59c0, 0x0400001d, - 0x492e600b, 0x832c0c00, 0x00000005, 0x0401f005, - 0x4802600c, 0x5930080a, 0x82040c00, 0x00000003, - 0x4806600a, 0x0401f013, 0x82440580, 0x10000000, - 0x0402001f, 0x59a0020e, 0x59a0240e, 0x901021c0, - 0x80102540, 0x59a00209, 0x59a01c09, 0x900c19c0, - 0x800c1d40, 0x59a0020b, 0x82000500, 0x0000fffc, - 0x59a0140b, 0x900811c0, 0x80081540, 0x480b8003, - 0x48138000, 0x480f8001, 0x480b8002, 0x59c80018, - 0x82000500, 0xf0000000, 0x59c02008, 0x82102500, - 0x0fffffff, 0x80100540, 0x48038008, 0x48478006, - 0x80489000, 0x8260c540, 0x00000001, 0x1c01f000, - 0x59c00009, 0x4803c857, 0x82000d00, 0x00e00000, - 0x0400000d, 0x485f420f, 0x905cb9c0, 0x485f440f, - 0x8c00052e, 0x04000002, 0x80285000, 0x8c00052c, - 0x04000002, 0x80244800, 0x8c00052a, 0x04000002, - 0x802c5800, 0x1c01f000, 0x59a0020c, 0x800001c0, - 0x04000024, 0x59d00806, 0x4807c857, 0x8c040d3e, - 0x04000020, 0x4a03a005, 0x20000000, 0x4a03a005, - 0x30000000, 0x59d00806, 0x8c040d0a, 0x040207fe, - 0x824c0480, 0x00000003, 0x02021800, 0x001005d8, - 0x404c0000, 0x0c01f001, 0x00102da1, 0x00102da3, - 0x00102da9, 0x0201f800, 0x001005d8, 0x80000040, - 0x40009800, 0x0401ff43, 0x0400000a, 0x0401ff41, - 0x0401f008, 0x80000040, 0x40009800, 0x59d00806, - 0x4807c857, 0x8c040d3e, 0x040207e3, 0x0401ff39, - 0x1c01f000, 0x59a0040c, 0x800001c0, 0x04000024, - 0x59c00807, 0x4807c857, 0x8c040d3e, 0x04000020, - 0x59c00807, 0x4a038006, 0x20000000, 0x82480480, - 0x00000003, 0x02021800, 0x001005d8, 0x40480000, - 0x0c01f001, 0x00102dc4, 0x00102dc6, 0x00102dce, - 0x0201f800, 0x001005d8, 0x80000040, 0x40009000, - 0x42008800, 0x10000004, 0x0401ff65, 0x0400000c, - 0x0401ff63, 0x0401f00a, 0x80000040, 0x40009000, - 0x59c00807, 0x4807c857, 0x8c040d3e, 0x040207e5, - 0x42008800, 0x10000004, 0x0401ff59, 0x1c01f000, - 0x492fc857, 0x4000a800, 0x4a03b805, 0x20000000, - 0x59dc0006, 0x4a03b805, 0x30000000, 0x4813b800, - 0x480fb801, 0x480bb802, 0x4857b803, 0x4a03b805, - 0x30000002, 0x59dc0006, 0x4a03b805, 0x70000001, - 0x59dc0006, 0x4a03b805, 0x10000000, 0x59dc0006, - 0x8c00053e, 0x040007fe, 0x4a03b805, 0x20000000, - 0x59dc0006, 0x59dc2000, 0x59dc1801, 0x801c39c0, - 0x0400000a, 0x4d2c0000, 0x0201f800, 0x001007e4, - 0x5c000800, 0x02000800, 0x001005d8, 0x4a025a04, - 0x0000000a, 0x492c0801, 0x1c01f000, 0x42006000, - 0x00102fb2, 0x0201f800, 0x00101345, 0x4a03902c, - 0x00200000, 0x4200b000, 0x000001f4, 0x59c8002c, - 0x8c00052c, 0x04000007, 0x8058b040, 0x040207fc, - 0x42000000, 0x00004003, 0x41781000, 0x0401f196, - 0x50301000, 0x41784800, 0x4a03902d, 0x00008000, - 0x4200b000, 0x000001f4, 0x59c8002c, 0x8c000534, - 0x04000007, 0x8058b040, 0x040207fc, 0x42000000, - 0x00004003, 0x41781000, 0x0401f187, 0x0401f8f8, - 0x80244800, 0x40240000, 0x82000580, 0x000003b1, - 0x040207fb, 0x0401f988, 0x41784800, 0x0401f920, - 0x80244800, 0x40240000, 0x82000580, 0x000003b1, - 0x040207fb, 0x80306000, 0x82300580, 0x00102fb4, - 0x040207e0, 0x59a80863, 0x800409c0, 0x04000007, - 0x42000000, 0x00004004, 0x42001000, 0x00000002, - 0x59a81862, 0x0401f16c, 0x42006000, 0x00102fb2, - 0x4a035064, 0x00000004, 0x50301000, 0x41784800, - 0x4a03902d, 0x00004000, 0x4200b000, 0x000001f4, - 0x59c8002c, 0x8c000532, 0x04000007, 0x8058b040, - 0x040207fc, 0x42000000, 0x00004003, 0x41781000, - 0x0401f159, 0x0401f8ca, 0x80244800, 0x40240000, - 0x82000580, 0x00000154, 0x040207fb, 0x0401f95a, - 0x41784800, 0x0401f8f2, 0x80244800, 0x40240000, - 0x82000580, 0x00000154, 0x040207fb, 0x80306000, - 0x82300580, 0x00102fb4, 0x040207e0, 0x59a80863, - 0x800409c0, 0x04000007, 0x42000000, 0x00004004, - 0x42001000, 0x00000004, 0x59a81862, 0x0401f13e, - 0x42006000, 0x00102fb2, 0x497b5064, 0x50301000, - 0x41784800, 0x4a03902d, 0x00001000, 0x4200b000, - 0x000001f4, 0x59c8002c, 0x8c00052e, 0x04000007, - 0x8058b040, 0x040207fc, 0x42000000, 0x00004003, - 0x41781000, 0x0401f12c, 0x0401f89d, 0x80244800, - 0x40240000, 0x82000580, 0x00000088, 0x040207fb, - 0x0401f92d, 0x41784800, 0x0401f8c5, 0x80244800, - 0x40240000, 0x82000580, 0x00000088, 0x040207fb, - 0x80306000, 0x82300580, 0x00102fb4, 0x040207e0, - 0x59a80863, 0x800409c0, 0x04000007, 0x42000000, - 0x00004004, 0x42001000, 0x00000001, 0x59a81862, - 0x0401f111, 0x42006000, 0x00102fb2, 0x50301000, - 0x41784800, 0x4a03902d, 0x00000800, 0x0401f87c, - 0x80244800, 0x40240000, 0x82000580, 0x00000018, - 0x040207fb, 0x0401f90c, 0x41784800, 0x0401f8a4, - 0x80244800, 0x40240000, 0x82000580, 0x00000018, - 0x040207fb, 0x80306000, 0x82300580, 0x00102fb4, - 0x040207eb, 0x59a80863, 0x800409c0, 0x04000007, - 0x42000000, 0x00004004, 0x42001000, 0x00000010, - 0x59a81862, 0x0401f0f0, 0x42006000, 0x00102fb2, - 0x50301000, 0x41784800, 0x4a03902d, 0x00000400, - 0x0401f85b, 0x80244800, 0x40240000, 0x82000580, - 0x00000088, 0x040207fb, 0x0401f8eb, 0x41784800, - 0x0401f883, 0x80244800, 0x40240000, 0x82000580, - 0x00000088, 0x040207fb, 0x80306000, 0x82300580, - 0x00102fb4, 0x040207eb, 0x59a80863, 0x800409c0, - 0x04000007, 0x42000000, 0x00004004, 0x42001000, - 0x00000008, 0x59a81862, 0x0401f0cf, 0x42006000, - 0x00102fb2, 0x50301000, 0x41784800, 0x4a03902d, - 0x00002000, 0x4200b000, 0x000001f4, 0x59c8002c, - 0x8c000530, 0x04000007, 0x8058b040, 0x040207fc, - 0x42000000, 0x00004003, 0x41781000, 0x0401f0be, - 0x59c8002c, 0x82000500, 0xffe0ffff, 0x82080d00, - 0x001f0000, 0x80040540, 0x4803902c, 0x0401f828, - 0x80244800, 0x40240000, 0x82000580, 0x00000110, - 0x040207fb, 0x0401f8b8, 0x41784800, 0x0401f850, - 0x59c80034, 0x82080d00, 0x001f0000, 0x82000500, - 0x001f0000, 0x80040580, 0x04000006, 0x59a80063, - 0x80000000, 0x48035063, 0x40240000, 0x48035062, - 0x80244800, 0x40240000, 0x82000580, 0x00000110, - 0x040207ef, 0x80306000, 0x82300580, 0x00102fb4, - 0x040207cd, 0x59a80863, 0x800409c0, 0x04000006, - 0x42000000, 0x00004004, 0x42001000, 0x00000020, - 0x59a81862, 0x0201f000, 0x001022c0, 0x59c8002c, - 0x82000500, 0xffff0000, 0x82080d00, 0x0000ffff, - 0x80040540, 0x4803902c, 0x40080000, 0x48039028, - 0x48039029, 0x59a80064, 0x82000580, 0x00000004, - 0x04000004, 0x40080000, 0x4803902a, 0x4803902b, - 0x59c8082d, 0x82040d00, 0xfffffc00, 0x40240000, - 0x80040d40, 0x4807902d, 0x4200b000, 0x000001f4, - 0x59c8002c, 0x82000500, 0x18000000, 0x04000007, - 0x8058b040, 0x040207fb, 0x42000000, 0x00004003, - 0x41781000, 0x0401f06c, 0x4a03902e, 0x00000001, - 0x4200b000, 0x000001f4, 0x59c8002e, 0x8c000500, - 0x04000006, 0x8058b040, 0x040207fc, 0x42000000, - 0x00004003, 0x0401f060, 0x1c01f000, 0x41783800, - 0x59c8082d, 0x82040d00, 0xfffffc00, 0x40240000, - 0x80040d40, 0x4807902d, 0x4200b000, 0x000001f4, - 0x59c8002c, 0x82000500, 0x18000000, 0x04000007, - 0x8058b040, 0x040207fb, 0x42000000, 0x00004003, - 0x41781000, 0x0401f04c, 0x59c80030, 0x59c80830, - 0x80040580, 0x040207fd, 0x40041800, 0x59c80031, - 0x59c80831, 0x80040580, 0x040207fd, 0x40042000, - 0x59c80032, 0x59c80832, 0x80040580, 0x040207fd, - 0x40042800, 0x59c80033, 0x59c80833, 0x80040580, - 0x040207fd, 0x40043000, 0x400c0000, 0x80080580, - 0x04000002, 0x801c3800, 0x40100000, 0x80080580, - 0x04000002, 0x801c3800, 0x59a80064, 0x82000580, - 0x00000004, 0x04000009, 0x40140000, 0x80080580, - 0x04000002, 0x801c3800, 0x40180000, 0x80080580, - 0x04000002, 0x801c3800, 0x59a80064, 0x82000580, - 0x00000004, 0x0400000d, 0x59c80034, 0x59c80834, - 0x80040580, 0x040207fd, 0x82040500, 0x0000ffff, - 0x82080d00, 0x0000ffff, 0x80040580, 0x0400000e, - 0x801c3800, 0x0401f00c, 0x59c80034, 0x59c80834, - 0x80040580, 0x040207fd, 0x82040500, 0x000000ff, - 0x82080d00, 0x000000ff, 0x80040580, 0x04000002, - 0x801c3800, 0x801c39c0, 0x04000006, 0x59a80063, - 0x801c0400, 0x48035063, 0x40240000, 0x48035062, - 0x1c01f000, 0x48034206, 0x48074406, 0x480b4207, - 0x480f4407, 0x48134208, 0x48174408, 0x0201f000, - 0x001022c3, 0x42000000, 0x00600000, 0x80000040, - 0x040207ff, 0x1c01f000, 0x5a5a5a5a, 0xa5a5a5a5, - 0x59a00c0a, 0x800409c0, 0x02000000, 0x00102310, - 0x82040480, 0x00000021, 0x02021000, 0x00102310, - 0x82040480, 0x00000011, 0x04001003, 0x42000800, - 0x00000010, 0x59a00208, 0x59a01407, 0x900811c0, - 0x80081540, 0x59a00207, 0x59a01c06, 0x900c19c0, - 0x800c1d40, 0x0201f800, 0x00103a00, 0x04000006, - 0x0201f800, 0x00103a25, 0x4a01d809, 0x00102fd5, - 0x1c01f000, 0x4a034406, 0x00000002, 0x0201f000, - 0x0010230c, 0x4031d800, 0x58ef400b, 0x58ec0002, - 0x82000580, 0x00000200, 0x02000000, 0x00102304, - 0x59a00c0a, 0x82040480, 0x00000011, 0x04001003, - 0x42000800, 0x00000010, 0x59a0040b, 0x59a0120b, - 0x900811c0, 0x80081540, 0x59a00209, 0x59a01c08, - 0x900c19c0, 0x800c1d40, 0x58ec0003, 0x0201f800, - 0x00103a28, 0x4a01d809, 0x00102ff0, 0x1c01f000, - 0x4031d800, 0x58ef400b, 0x58ec0002, 0x82000580, - 0x00000200, 0x02000000, 0x00102304, 0x59a00c0a, - 0x82040480, 0x00000011, 0x02001000, 0x001022c0, - 0x82040c80, 0x00000010, 0x59a00208, 0x59a01407, - 0x900811c0, 0x80081540, 0x59a00207, 0x59a01c06, - 0x900c19c0, 0x800c1d40, 0x82081400, 0x00000040, - 0x58ec0003, 0x0201f800, 0x00103a25, 0x4a01d809, - 0x0010300e, 0x1c01f000, 0x4031d800, 0x58ef400b, - 0x58ec0002, 0x82000580, 0x00000200, 0x02000000, - 0x00102304, 0x59a0040a, 0x82000c80, 0x00000010, - 0x59a0040b, 0x59a0120b, 0x900811c0, 0x80081540, - 0x59a00209, 0x59a01c08, 0x900c19c0, 0x800c1d40, - 0x82081400, 0x00000040, 0x58ec0003, 0x0201f800, - 0x00103a28, 0x4a01d809, 0x001022b9, 0x1c01f000, - 0x48efc857, 0x59a00207, 0x59a01407, 0x900001c0, - 0x80081540, 0x59a00209, 0x59a01c09, 0x900001c0, - 0x800c1d40, 0x59a00406, 0x48034000, 0x480b4001, - 0x480f4002, 0x0201f800, 0x00103a00, 0x04020005, - 0x4a034406, 0x00000002, 0x0201f000, 0x0010230c, - 0x42000800, 0x00000010, 0x0201f800, 0x00103a25, - 0x4a01d809, 0x00103043, 0x1c01f000, 0x4031d800, - 0x58ef400b, 0x58ee580d, 0x58ec0002, 0x82000580, - 0x00000200, 0x02000000, 0x00102304, 0x48efc857, - 0x49a3c857, 0x492fc857, 0x592c0a04, 0x80040910, - 0x04020005, 0x4a034406, 0x00000019, 0x0201f000, - 0x0010230c, 0x4805d80c, 0x0401f00a, 0x4031d800, - 0x58ef400b, 0x58ec0002, 0x82000580, 0x00000200, - 0x02000000, 0x00102304, 0x48efc857, 0x49a3c857, - 0x48efc857, 0x49a3c857, 0x58ec000c, 0x80000040, - 0x04000012, 0x4801d80c, 0x0201f800, 0x00103a00, - 0x04020005, 0x4a034406, 0x00000002, 0x0201f000, - 0x0010230c, 0x42000800, 0x00000010, 0x58ec1007, - 0x58ec1808, 0x0201f800, 0x00103a25, 0x4a01d809, - 0x00103057, 0x1c01f000, 0x58ee580d, 0x48efc857, - 0x49a3c857, 0x492fc857, 0x492f3006, 0x592c0404, - 0x8400055e, 0x48025c04, 0x4a01d809, 0x00103081, - 0x1c01f000, 0x58ee580d, 0x48efc857, 0x49a3c857, - 0x492fc857, 0x592c0404, 0x8400051e, 0x48025c04, - 0x59a00000, 0x59a01001, 0x59a01802, 0x80081400, - 0x820c1c40, 0x00000000, 0x832c0400, 0x00000004, - 0x42000800, 0x00000010, 0x0201f000, 0x00103a28, - 0x800409c0, 0x04000005, 0x4a034406, 0x00000001, - 0x0201f000, 0x0010230c, 0x836c0580, 0x00000003, - 0x04000005, 0x4a034406, 0x00000007, 0x0201f000, - 0x0010230c, 0x59a0320b, 0x82183500, 0x000000ff, - 0x59a28c06, 0x0201f800, 0x00020245, 0x02020000, - 0x00102310, 0x83440580, 0x000007fd, 0x04000008, - 0x0201f800, 0x001049e7, 0x04000005, 0x4a034406, - 0x00000009, 0x0201f000, 0x0010230c, 0x0201f800, - 0x00103a00, 0x04020005, 0x4a034406, 0x00000002, - 0x0201f000, 0x0010230c, 0x801831c0, 0x0400000a, - 0x412c0800, 0x0201f800, 0x00103a00, 0x04020005, - 0x4a034406, 0x00000002, 0x0201f000, 0x0010230c, - 0x40065800, 0x4a025c04, 0x00008000, 0x497a5a04, - 0x0201f800, 0x00109100, 0x04020005, 0x4a034406, - 0x00000003, 0x0201f000, 0x0010230c, 0x4a01d809, - 0x001030d2, 0x1c01f000, 0x592c0005, 0x82000580, - 0x01000000, 0x04020005, 0x4a034406, 0x00000004, - 0x0201f000, 0x0010230c, 0x592c0406, 0x82002d00, - 0x0000ff00, 0x82000500, 0x000000ff, 0x80000904, - 0x80040800, 0x82040480, 0x00000006, 0x04001003, - 0x42000800, 0x00000005, 0x832ca400, 0x00000006, - 0x4050a800, 0x4004b000, 0x0201f800, 0x0010ab28, - 0x59a00407, 0x59a01207, 0x900811c0, 0x80081540, - 0x59a00409, 0x59a01a09, 0x900c19c0, 0x800c1d40, - 0x832c0400, 0x00000006, 0x4c140000, 0x0201f800, - 0x00103a28, 0x5c002800, 0x801429c0, 0x04000003, - 0x4a01d809, 0x001030ff, 0x1c01f000, 0x4031d800, - 0x58ef400b, 0x58ee580d, 0x58ec0002, 0x82000580, - 0x00000200, 0x02000000, 0x00102304, 0x812e59c0, - 0x02000800, 0x001005d8, 0x592c0006, 0x82000500, - 0xff000000, 0x80000904, 0x800409c0, 0x02000000, - 0x00102304, 0x82040480, 0x0000000e, 0x04001003, - 0x42000800, 0x0000000d, 0x592e5801, 0x812e59c0, - 0x02000800, 0x001005d8, 0x832ca400, 0x00000005, - 0x4050a800, 0x4004b000, 0x0201f800, 0x0010ab28, - 0x58ec1007, 0x58ec1808, 0x832c0400, 0x00000005, - 0x0201f000, 0x00103a28, 0x0201f800, 0x00103a00, - 0x04020005, 0x4a034406, 0x00000002, 0x0201f000, - 0x0010230c, 0x59a00c06, 0x82040500, 0x0000ff00, - 0x840001c0, 0x82001480, 0x00000007, 0x02021000, - 0x00102310, 0x0c01f001, 0x0010313d, 0x00103144, - 0x0010314b, 0x0010314b, 0x0010314b, 0x0010314d, - 0x00103152, 0x42000800, 0x0000000d, 0x42003800, - 0x00103166, 0x4a034000, 0x0010b4eb, 0x0401f013, - 0x42000800, 0x0000000d, 0x42003800, 0x00103166, - 0x4a034000, 0x0010b4f8, 0x0401f00c, 0x0201f000, - 0x00102310, 0x42000800, 0x00000008, 0x42003800, - 0x00103179, 0x0401f005, 0x42000800, 0x00000004, - 0x42003800, 0x001031c3, 0x59a00207, 0x59a01407, - 0x900001c0, 0x80081540, 0x59a00209, 0x59a01c09, - 0x900001c0, 0x800c1d40, 0x832c0400, 0x00000005, - 0x4c1c0000, 0x0201f800, 0x00103a25, 0x5c003800, - 0x481dd809, 0x1c01f000, 0x4031d800, 0x58ef400b, - 0x58ee580d, 0x58ec0002, 0x82000580, 0x00000200, - 0x02000000, 0x00102304, 0x4a03501f, 0x00000001, - 0x4200b000, 0x0000000d, 0x59a0a800, 0x832ca400, - 0x00000005, 0x0201f800, 0x0010ab17, 0x0201f000, - 0x001022c0, 0x4031d800, 0x58ef400b, 0x58ee580d, - 0x58ec0002, 0x82000580, 0x00000200, 0x02000000, - 0x00102304, 0x832ca400, 0x00000005, 0x50500000, - 0x82001500, 0x000c0016, 0x02020000, 0x00102310, - 0x82500c00, 0x00000003, 0x50040000, 0x82001500, - 0x00000001, 0x02020000, 0x00102310, 0x50500000, - 0x82001500, 0x00000028, 0x0400001d, 0x82081580, - 0x00000028, 0x02020000, 0x00102310, 0x80500800, - 0x50040000, 0x82001500, 0x00000013, 0x82081580, - 0x00000013, 0x02020000, 0x00102310, 0x80040800, - 0x50040000, 0x82001500, 0x00010000, 0x82081580, - 0x00010000, 0x02020000, 0x00102310, 0x836c0580, - 0x00000000, 0x04000012, 0x599c0019, 0x8c00050e, - 0x0402000f, 0x0201f000, 0x00102310, 0x80500800, - 0x50040000, 0x82001500, 0x00000013, 0x02020000, - 0x00102310, 0x80040800, 0x50040000, 0x82001500, - 0x00010000, 0x02020000, 0x00102310, 0x4200b000, - 0x00000008, 0x4200a800, 0x0010b4e3, 0x0201f800, - 0x0010ab17, 0x0201f000, 0x001022c0, 0x4031d800, - 0x58ef400b, 0x58ee580d, 0x58ec0002, 0x82000580, - 0x00000200, 0x02000000, 0x00102304, 0x4200b000, - 0x00000004, 0x4200a800, 0x0010b8fa, 0x832ca400, - 0x00000005, 0x0201f800, 0x0010ab17, 0x59a80005, - 0x84000550, 0x48035005, 0x0201f000, 0x001022c0, - 0x0201f800, 0x00103a00, 0x04020005, 0x4a034406, - 0x00000002, 0x0201f000, 0x0010230c, 0x59a00c06, - 0x82040500, 0x0000ff00, 0x840001c0, 0x82001480, - 0x00000006, 0x02021000, 0x00102310, 0x0c01f001, - 0x001031ee, 0x001031f3, 0x001031f8, 0x001031f8, - 0x001031f8, 0x001031fa, 0x42000800, 0x0000000d, - 0x4200a000, 0x0010b4eb, 0x0401f00c, 0x42000800, - 0x0000000d, 0x4200a000, 0x0010b4f8, 0x0401f007, - 0x0201f000, 0x00102310, 0x42000800, 0x00000008, - 0x4200a000, 0x0010b4e3, 0x4004b000, 0x832cac00, - 0x00000005, 0x0201f800, 0x0010ab17, 0x59a00207, - 0x59a01407, 0x900001c0, 0x80081540, 0x59a00209, - 0x59a01c09, 0x900001c0, 0x800c1d40, 0x832c0400, - 0x00000005, 0x0201f000, 0x00103a28, 0x836c0580, - 0x00000000, 0x04020005, 0x4a034406, 0x00000007, - 0x0201f000, 0x0010230c, 0x59a00406, 0x800001c0, - 0x0400001a, 0x59a80005, 0x8c000514, 0x04000005, - 0x42000000, 0x00000001, 0x40000800, 0x0401f003, - 0x59a00207, 0x59a80853, 0x48035053, 0x0201f800, - 0x0010163b, 0x04000022, 0x0201f800, 0x00101642, - 0x0400001f, 0x0201f800, 0x00101649, 0x0400001c, - 0x0201f800, 0x00101650, 0x04000019, 0x48075053, - 0x0201f000, 0x00102310, 0x59c40801, 0x82040d00, - 0x00018000, 0x82040580, 0x00000000, 0x04020004, - 0x4a034406, 0x00000000, 0x0401f00d, 0x82040580, - 0x00008000, 0x04020004, 0x4a034406, 0x00000001, - 0x0401f007, 0x82040580, 0x00010000, 0x02020800, - 0x001005d8, 0x4a034406, 0x00000003, 0x59a00406, - 0x82000580, 0x00000002, 0x0402001f, 0x59c40006, - 0x84000500, 0x48038806, 0x0201f800, 0x00106ede, - 0x497b8880, 0x0201f800, 0x0010a9c0, 0x0201f800, - 0x0010a9ce, 0x42000000, 0x0010b8ca, 0x0201f800, - 0x0010aa47, 0x82000540, 0x00000001, 0x0201f800, - 0x0010518c, 0x4a038808, 0x00000000, 0x4202d800, - 0x00000004, 0x42001000, 0x00000001, 0x0201f800, - 0x0010193d, 0x4a035049, 0x00000001, 0x0201f800, - 0x001006d4, 0x0201f000, 0x001022c0, 0x800409c0, - 0x04000005, 0x4a034406, 0x00000001, 0x0201f000, - 0x0010230c, 0x836c0580, 0x00000003, 0x04000005, - 0x4a034406, 0x00000007, 0x0201f000, 0x0010230c, - 0x59a28c06, 0x59a0320b, 0x82183500, 0x000000ff, - 0x0201f800, 0x00020245, 0x02020000, 0x00102310, - 0x83440580, 0x000007fd, 0x04000008, 0x0201f800, - 0x001049e7, 0x04000005, 0x42000800, 0x00000009, - 0x0201f000, 0x0010230c, 0x0201f800, 0x00103a00, - 0x04020005, 0x4a034406, 0x00000002, 0x0201f000, - 0x0010230c, 0x497a5a04, 0x4a025c04, 0x00008000, - 0x0201f800, 0x00109115, 0x04020005, 0x4a034406, - 0x00000003, 0x0201f000, 0x0010230c, 0x4a01d809, - 0x0010329e, 0x1c01f000, 0x592c0005, 0x82000d00, - 0x0000ffff, 0x82000500, 0xffff0000, 0x82000580, - 0x01000000, 0x04020005, 0x4a034406, 0x00000004, - 0x0201f000, 0x0010230c, 0x80040904, 0x832ca400, - 0x00000005, 0x4050a800, 0x4004b000, 0x0201f800, - 0x0010ab28, 0x59a00207, 0x59a01407, 0x900001c0, - 0x80081540, 0x59a00209, 0x59a01c09, 0x900001c0, - 0x800c1d40, 0x832c0400, 0x00000005, 0x0201f000, - 0x00103a28, 0x496fc857, 0x836c0580, 0x00000000, - 0x04000005, 0x4a034406, 0x0000001a, 0x0201f000, - 0x0010230c, 0x0201f800, 0x0010513b, 0x02020800, - 0x00104142, 0x42000800, 0x00000020, 0x59a00407, - 0x59a01207, 0x900811c0, 0x80081540, 0x59a00409, - 0x59a01a09, 0x900c19c0, 0x800c1d40, 0x419c0000, - 0x49a3c857, 0x0201f800, 0x00103a25, 0x4a01d809, - 0x001032da, 0x1c01f000, 0x4833c857, 0x4031d800, - 0x58ef400b, 0x58ec0002, 0x82000580, 0x00000200, - 0x02000000, 0x00102304, 0x599c0200, 0x800001c0, - 0x02000000, 0x00102310, 0x59a80005, 0x8c000512, - 0x04000004, 0x599c0019, 0x8400050c, 0x48033819, - 0x0201f800, 0x001097d7, 0x59a80005, 0x8c000514, - 0x04000004, 0x599c0017, 0x84000508, 0x48033817, - 0x0201f800, 0x00103b25, 0x04020004, 0x8c00050a, - 0x02020000, 0x00102310, 0x4803c857, 0x8c000504, - 0x04020004, 0x59c408a3, 0x84040d7a, 0x480788a3, - 0x8c000502, 0x04020004, 0x59c408a3, 0x84040d08, - 0x480788a3, 0x599c0c02, 0x8c000500, 0x04020004, - 0x8c000516, 0x04000012, 0x0401f001, 0x82041480, - 0x0000007f, 0x02021000, 0x00102310, 0x82041400, - 0x0010210e, 0x50081000, 0x82081500, 0x000000ff, - 0x8c000500, 0x04020006, 0x480b5010, 0x42000800, - 0x00000003, 0x0201f800, 0x00106c78, 0x599c0019, - 0x8c00050e, 0x0402000b, 0x59a80806, 0x8c040d14, - 0x04000008, 0x42000800, 0x0010b4e3, 0x50040800, - 0x82040d00, 0x00000028, 0x02020000, 0x00102310, - 0x82000500, 0x00000030, 0x04000003, 0x80000108, - 0x0401f003, 0x42000000, 0x00000002, 0x48039040, - 0x42000800, 0x00000002, 0x82000400, 0x00103415, - 0x50001000, 0x0201f800, 0x00106c78, 0x599c0201, - 0x82000c80, 0x00000100, 0x02001000, 0x00102310, - 0x82000c80, 0x00000841, 0x02021000, 0x00102310, - 0x82000500, 0x00000007, 0x02020000, 0x00102310, - 0x599c0401, 0x80000540, 0x02000000, 0x00102310, - 0x599c0409, 0x599c0c07, 0x80040c80, 0x02021000, - 0x00102310, 0x80000040, 0x02000000, 0x00102310, - 0x599c0209, 0x599c0a07, 0x80040c80, 0x02021000, - 0x00102310, 0x80000040, 0x02000000, 0x00102310, - 0x0201f800, 0x001053cd, 0x0201f800, 0x00104cb6, - 0x599c0201, 0x48035004, 0x0201f800, 0x001012ee, - 0x599c020a, 0x800001c0, 0x04000003, 0x4803504d, - 0x0401f003, 0x4a03504d, 0x000000c8, 0x0201f800, - 0x00103b25, 0x04000004, 0x0201f800, 0x001060df, - 0x417a5000, 0x836c0580, 0x00000000, 0x04020098, - 0x599c0003, 0x599c0804, 0x9c0001c0, 0x9c0409c0, - 0x48035002, 0x48075003, 0x599c1017, 0x8c08151c, - 0x04000006, 0x599c0005, 0x599c0806, 0x9c0001c0, - 0x9c0409c0, 0x0401f003, 0x82000500, 0xf0ffffff, - 0x48035000, 0x48075001, 0x42001000, 0x0010b4eb, - 0x48001000, 0x48041001, 0x42001000, 0x0010b4f8, - 0x48001000, 0x48041001, 0x59a80005, 0x8c000514, - 0x04020015, 0x599c1019, 0x82081500, 0x0000e000, - 0x82080580, 0x00000000, 0x0402000c, 0x4a035053, - 0x00000000, 0x42000000, 0x00000001, 0x0201f800, - 0x0010188c, 0x42000000, 0x00000001, 0x0201f800, - 0x00101821, 0x0401f02b, 0x82080580, 0x00002000, - 0x0402000a, 0x4a035053, 0x00000001, 0x41780000, - 0x0201f800, 0x0010188c, 0x41780000, 0x0201f800, - 0x00101821, 0x0401f01f, 0x82080580, 0x00004000, - 0x04020006, 0x4a035053, 0x00000002, 0x4a035049, - 0x00000001, 0x0401f017, 0x82080580, 0x00006000, - 0x02020000, 0x00102310, 0x59a80858, 0x82040d80, - 0x01391077, 0x04020005, 0x59e00813, 0x8c040d00, - 0x02020000, 0x00102310, 0x4a035053, 0x00000003, - 0x42000000, 0x00000002, 0x0201f800, 0x0010188c, - 0x42000000, 0x00000002, 0x0201f800, 0x00101821, - 0x599c0019, 0x8c000520, 0x0400000d, 0x42000000, - 0x00000004, 0x42000800, 0x00000040, 0x0201f800, - 0x00101944, 0x42000000, 0x00000010, 0x42000800, - 0x000000c0, 0x0201f800, 0x00101944, 0x4a035032, - 0x0000aaaa, 0x599c1018, 0x82081500, 0x00000030, - 0x59a8006c, 0x80000540, 0x0400000c, 0x82080580, - 0x00000000, 0x02000000, 0x00102310, 0x599c1018, - 0x82081500, 0xffffffcf, 0x82081540, 0x00000010, - 0x480b3818, 0x0401f010, 0x82080d80, 0x00000000, - 0x04000007, 0x82080d80, 0x00000010, 0x0400000a, - 0x82080d80, 0x00000020, 0x04020002, 0x48075032, - 0x0201f800, 0x00103aba, 0x04000008, 0x0201f800, - 0x001015fe, 0x0201f800, 0x0010162a, 0x59a8002a, - 0x80040540, 0x4803502a, 0x49f3c857, 0x42001000, - 0x00105065, 0x0201f800, 0x00105f90, 0x42001000, - 0x00105058, 0x0201f800, 0x00106084, 0x4a038805, - 0xffffffff, 0x4a03c014, 0x00400040, 0x4a03c013, - 0x00400000, 0x0201f800, 0x001048c7, 0x59a0001d, - 0x84000540, 0x4803401d, 0x49f3c857, 0x0201f000, - 0x001022c0, 0x00000018, 0x0000000c, 0x00000018, - 0x00000020, 0x836c0580, 0x00000000, 0x04020005, - 0x42000800, 0x00000007, 0x0201f000, 0x0010230c, - 0x42000800, 0x00000020, 0x59a00407, 0x59a01207, - 0x900811c0, 0x80081540, 0x59a00409, 0x59a01a09, - 0x900c19c0, 0x800c1d40, 0x419c0000, 0x0201f000, - 0x00103a28, 0x800409c0, 0x04000005, 0x4a034406, - 0x00000001, 0x0201f000, 0x0010230c, 0x0201f800, - 0x0010513b, 0x04020005, 0x4a034406, 0x00000016, - 0x0201f000, 0x0010230c, 0x59a80013, 0x8c000500, - 0x04000011, 0x4a034406, 0x00000000, 0x42000800, - 0x00000020, 0x59a00407, 0x59a01207, 0x900811c0, - 0x80081540, 0x59a00409, 0x59a01a09, 0x900c19c0, - 0x800c1d40, 0x42000000, 0x0010be21, 0x0201f000, - 0x00103a28, 0x4a034406, 0x00000001, 0x4200b000, - 0x00000020, 0x4200a800, 0x0010be21, 0x4200a000, - 0xffffffff, 0x4450a800, 0x8054a800, 0x8058b040, - 0x040207fd, 0x4d440000, 0x4d340000, 0x42028800, - 0xffffffff, 0x42002000, 0xffffffff, 0x42003000, - 0x00000001, 0x42003800, 0x00000001, 0x42001800, - 0x0010be21, 0x59a81010, 0x82081500, 0x000000ff, - 0x40180000, 0x0c01f001, 0x0010346e, 0x00103471, - 0x00103475, 0x00103479, 0x82102500, 0xffffff00, - 0x0401f014, 0x82102500, 0xffff00ff, 0x840811c0, - 0x0401f010, 0x82102500, 0xff00ffff, 0x900811c0, - 0x0401f00c, 0x82102500, 0x00ffffff, 0x9c0801c0, - 0x80102540, 0x44101800, 0x42003000, 0xffffffff, - 0x42002000, 0xffffffff, 0x800c1800, 0x0401f003, - 0x40080000, 0x80102540, 0x81468800, 0x83442c80, - 0x0000007f, 0x04021014, 0x4c080000, 0x4c0c0000, - 0x4c180000, 0x4c1c0000, 0x0201f800, 0x00020245, - 0x5c003800, 0x5c003000, 0x5c001800, 0x5c001000, - 0x040207f2, 0x0201f800, 0x001049f3, 0x040207ef, - 0x80183000, 0x801c3800, 0x59341202, 0x40180000, - 0x0c01f7ce, 0x82100580, 0xffffffff, 0x04000002, - 0x44101800, 0x42001800, 0x0010be21, 0x500c0000, - 0x82000500, 0xffffff00, 0x801c0540, 0x44001800, - 0x5c026800, 0x5c028800, 0x42000800, 0x00000020, - 0x59a00407, 0x59a01207, 0x900811c0, 0x80081540, - 0x59a00409, 0x59a01a09, 0x900c19c0, 0x800c1d40, - 0x42000000, 0x0010be21, 0x0201f000, 0x00103a28, - 0x59a28c06, 0x59a0020b, 0x8c000500, 0x0400000e, - 0x59a01208, 0x59a00408, 0x82000500, 0x000000ff, - 0x900001c0, 0x80081540, 0x41784000, 0x0201f800, - 0x00104919, 0x04000008, 0x48034406, 0x0201f000, - 0x00102310, 0x0201f800, 0x00020245, 0x02020000, - 0x00102310, 0x0201f800, 0x00103a00, 0x04020005, - 0x4a034406, 0x00000002, 0x0201f000, 0x0010230c, - 0x59a0020b, 0x8c000500, 0x04000005, 0x0201f800, - 0x001049f3, 0x02020000, 0x00103ac4, 0x59a0020b, - 0x8c000502, 0x04000019, 0x83440480, 0x000007f0, - 0x04021016, 0x0201f800, 0x001049fc, 0x04020013, - 0x497a5a04, 0x4a025c04, 0x00008000, 0x0201f800, - 0x001090e6, 0x04020005, 0x4a034406, 0x00000003, - 0x0201f000, 0x0010230c, 0x4a01d809, 0x001034f1, - 0x1c01f000, 0x59a28c06, 0x0201f800, 0x00020245, - 0x02020000, 0x00102310, 0x4200b000, 0x0000000a, - 0x4134a000, 0x832e5c00, 0x00000002, 0x412ca800, - 0x0201f800, 0x0010ab17, 0x832cac00, 0x00000006, - 0x4054a000, 0x4200b000, 0x00000004, 0x0201f800, - 0x0010ab28, 0x592c0802, 0x82040500, 0x00ff00ff, - 0x900001c0, 0x82041500, 0xff00ff00, 0x80080540, - 0x48025802, 0x592c0801, 0x82040500, 0x00ff00ff, - 0x900001c0, 0x82041500, 0xff00ff00, 0x80080540, - 0x48025801, 0x42000800, 0x0000000a, 0x59a00407, - 0x59a01207, 0x900811c0, 0x80081540, 0x59a00409, - 0x59a01a09, 0x900c19c0, 0x800c1d40, 0x412c0000, - 0x0201f000, 0x00103a28, 0x496fc857, 0x496f4406, - 0x0201f000, 0x001022c0, 0x59a28c06, 0x0201f800, - 0x00020245, 0x02020000, 0x00102310, 0x836c0580, - 0x00000003, 0x04000005, 0x4a034406, 0x00000007, - 0x0201f000, 0x0010230c, 0x83340c00, 0x00000006, - 0x59a0020b, 0x8c000500, 0x04000003, 0x83340c00, - 0x00000008, 0x58040001, 0x48034409, 0x900001c0, - 0x48034209, 0x50040000, 0x48034407, 0x900001c0, - 0x48034207, 0x59340200, 0x48034406, 0x0201f000, - 0x001022c0, 0x800409c0, 0x04000005, 0x4a034406, - 0x00000001, 0x0201f000, 0x0010230c, 0x59a0220b, - 0x8c102500, 0x0402002e, 0x8c102506, 0x04020006, - 0x59a03208, 0x82180480, 0x00000003, 0x02021000, - 0x00102310, 0x59a28c06, 0x0201f800, 0x00020245, - 0x02020000, 0x00102310, 0x0201f800, 0x001049e7, - 0x04000005, 0x4a034406, 0x00000009, 0x0201f000, - 0x0010230c, 0x0201f800, 0x00103a00, 0x04020005, - 0x4a034406, 0x00000002, 0x0201f000, 0x0010230c, - 0x59a0220b, 0x8c102506, 0x04000004, 0x59343002, - 0x82183500, 0x00ffffff, 0x497a5a04, 0x4a025c04, - 0x00008000, 0x0201f800, 0x001090a8, 0x04020005, - 0x4a034406, 0x00000003, 0x0201f000, 0x0010230c, - 0x4a01d809, 0x001035d1, 0x1c01f000, 0x59a28c06, - 0x0201f800, 0x00020245, 0x02020000, 0x00102310, - 0x0201f800, 0x001049e7, 0x04000005, 0x4a034406, - 0x00000009, 0x0201f000, 0x0010230c, 0x0201f800, - 0x00103a00, 0x04020005, 0x4a034406, 0x00000002, - 0x0201f000, 0x0010230c, 0x497a5a04, 0x4a025c04, - 0x00008000, 0x0201f800, 0x00103a00, 0x04020005, - 0x4a034406, 0x00000002, 0x0201f000, 0x0010230c, - 0x592e5800, 0x0201f800, 0x001090bd, 0x04020005, - 0x4a034406, 0x00000003, 0x0201f000, 0x0010230c, - 0x4a01d809, 0x001035a3, 0x1c01f000, 0x592c2805, - 0x82140d80, 0x01000000, 0x04020005, 0x4a034406, - 0x00000004, 0x0201f000, 0x0010230c, 0x42000800, - 0x00000008, 0x59a00207, 0x59a01407, 0x900001c0, - 0x80081540, 0x59a00209, 0x59a01c09, 0x900001c0, - 0x800c1d40, 0x832c0400, 0x00000005, 0x0201f800, - 0x00103a28, 0x8c142d00, 0x04000003, 0x4a01d809, - 0x001035be, 0x1c01f000, 0x4031d800, 0x58ef400b, - 0x58ee580e, 0x58ec0002, 0x82000580, 0x00000200, - 0x02000000, 0x00102304, 0x812e59c0, 0x02000800, - 0x001005d8, 0x42000800, 0x00000008, 0x832c0400, - 0x00000005, 0x58ec1007, 0x58ec1808, 0x0201f000, - 0x00103a28, 0x592c0005, 0x82000580, 0x01000000, - 0x04020005, 0x4a034406, 0x00000004, 0x0201f000, - 0x0010230c, 0x59a00207, 0x59a01407, 0x900001c0, - 0x80081540, 0x59a00209, 0x59a01c09, 0x900001c0, - 0x800c1d40, 0x42000800, 0x00000006, 0x832c0400, - 0x00000006, 0x0201f000, 0x00103a28, 0x59a00a0a, - 0x800409c0, 0x02000000, 0x00102310, 0x82040480, - 0x000000e7, 0x04001003, 0x42000800, 0x000000e6, - 0x59a00207, 0x59a01407, 0x900001c0, 0x80081540, - 0x59a00209, 0x59a01c09, 0x900001c0, 0x800c1d40, - 0x83880400, 0x00000000, 0x0201f800, 0x00103a28, - 0x4a01d809, 0x001035ff, 0x1c01f000, 0x4031d800, - 0x58ef400b, 0x58ec0002, 0x82000580, 0x00000200, - 0x02000000, 0x00102304, 0x58ef400b, 0x59a0020b, - 0x8c000500, 0x04000008, 0x83880400, 0x00000000, - 0x4803c840, 0x4a03c842, 0x00000006, 0x04011000, - 0x497b8885, 0x4a034207, 0x000000e6, 0x0201f000, - 0x001022c0, 0x800409c0, 0x04000005, 0x4a034406, - 0x00000001, 0x0201f000, 0x0010230c, 0x0401fbe5, - 0x04020005, 0x4a034406, 0x00000002, 0x0201f000, - 0x0010230c, 0x497a5a04, 0x4a025c04, 0x00008000, - 0x59a00406, 0x800001c0, 0x02000000, 0x00102310, - 0x82001580, 0x000000ff, 0x04000005, 0x82001480, - 0x00000004, 0x02021000, 0x00102310, 0x40001000, - 0x0201f800, 0x00101fbf, 0x04020005, 0x4a034406, - 0x00000003, 0x0201f000, 0x0010230c, 0x4a01d809, - 0x0010363a, 0x1c01f000, 0x592c0005, 0x82000580, - 0x01000000, 0x02020000, 0x001022c0, 0x4a034406, - 0x00000004, 0x0201f000, 0x0010230c, 0x59a01406, - 0x8c081508, 0x04020007, 0x800409c0, 0x04000005, - 0x4a034406, 0x00000001, 0x0201f000, 0x0010230c, - 0x59a01c07, 0x820c0480, 0x00001000, 0x02021000, - 0x00102310, 0x497b2804, 0x497b2805, 0x497b281c, - 0x497b281d, 0x497b281f, 0x497b2820, 0x497b2822, - 0x497b2823, 0x80000580, 0x0201f800, 0x001015fe, - 0x59a80805, 0x8c081500, 0x04000004, 0x82040d40, - 0x00000011, 0x0401f004, 0x8c081506, 0x04000002, - 0x84040d42, 0x84040d0a, 0x48075005, 0x4202d800, - 0x00000001, 0x82081500, 0x000000e0, 0x8008010a, - 0x0c020036, 0x0201f800, 0x0010513b, 0x04020009, - 0x4a035033, 0x00000001, 0x0201f800, 0x001050a2, - 0x0401f01f, 0x4a035033, 0x00000000, 0x0401f7fb, - 0x497b5032, 0x0201f800, 0x00104142, 0x0201f800, - 0x00106c55, 0x0201f800, 0x00106ede, 0x0201f800, - 0x00106c4b, 0x59a00a07, 0x480788a7, 0x59c400a3, - 0x82000500, 0xfeffffff, 0x82000540, 0x80018000, - 0x40000800, 0x84040d20, 0x480388a3, 0x480788a3, - 0x497b504e, 0x42000800, 0x0000002d, 0x42001000, - 0x001041bc, 0x0201f800, 0x00105f69, 0x59a00407, - 0x800000c2, 0x800008c4, 0x8005d400, 0x42000000, - 0x0000ffff, 0x0201f800, 0x0010513b, 0x04000003, - 0x59a00207, 0x80000110, 0x0201f800, 0x00103afc, - 0x0201f000, 0x001022c0, 0x0010366d, 0x00103670, - 0x00103678, 0x00102310, 0x00103675, 0x00102310, - 0x00102310, 0x00102310, 0x836c0580, 0x00000003, - 0x04000005, 0x4a034406, 0x00000007, 0x0201f000, - 0x0010230c, 0x59a03c06, 0x59a00407, 0x59a04a07, - 0x902449c0, 0x80244d40, 0x59a00409, 0x59a05209, - 0x902851c0, 0x80285540, 0x0401fb46, 0x04020005, - 0x4a034406, 0x00000002, 0x0201f000, 0x0010230c, - 0x417a8800, 0x41783000, 0x497b4001, 0x497b4004, - 0x832c4400, 0x00000005, 0x48234002, 0x8c1c3d04, - 0x04020078, 0x0201f800, 0x00020245, 0x0402002a, - 0x0201f800, 0x001049e7, 0x04000004, 0x0201f800, - 0x001048e3, 0x04020024, 0x8c1c3d00, 0x04000008, - 0x59340009, 0x44004000, 0x59340008, 0x80204000, - 0x44004000, 0x80204000, 0x0401f007, 0x59340007, - 0x44004000, 0x59340006, 0x80204000, 0x44004000, - 0x80204000, 0x83440580, 0x000007fe, 0x0400000d, - 0x83440580, 0x000007fc, 0x0400000a, 0x0201f800, - 0x001049f3, 0x04000003, 0x85468d5e, 0x0401f005, - 0x0201f800, 0x00104838, 0x04020002, 0x85468d5e, - 0x45444000, 0x85468d1e, 0x80204000, 0x82183400, - 0x00000003, 0x81468800, 0x83440480, 0x000007f0, - 0x0400100e, 0x8c1c3d06, 0x04000010, 0x83440580, - 0x000007f0, 0x04020004, 0x42028800, 0x000007fe, - 0x0401f006, 0x83440580, 0x000007ff, 0x04020007, - 0x42028800, 0x000007fc, 0x82180580, 0x0000000f, - 0x0400000b, 0x0401f7c0, 0x801831c0, 0x04020006, - 0x59a00801, 0x800408c4, 0x48074406, 0x0201f000, - 0x001022c0, 0x4a034004, 0x00000001, 0x49474000, - 0x59a00001, 0x80180400, 0x48034001, 0x481f4003, - 0x4a01d801, 0x00000000, 0x4819d804, 0x59a00002, - 0x4801d803, 0x4825d807, 0x4829d808, 0x4000a800, - 0x4000a000, 0x4018b000, 0x0201f800, 0x0010ab17, - 0x40ec1000, 0x0201f800, 0x00100858, 0x4a01d809, - 0x0010372a, 0x1c01f000, 0x4031d800, 0x58ef400b, - 0x58ec0002, 0x82000580, 0x00000200, 0x02000000, - 0x00102304, 0x59a00004, 0x80000540, 0x04020008, - 0x59a28800, 0x59a04002, 0x59a03803, 0x41783000, - 0x58ec4807, 0x58ec5008, 0x0401f78f, 0x59a00801, - 0x800408c4, 0x48074406, 0x0201f000, 0x001022c0, - 0x0201f800, 0x00020245, 0x0402002f, 0x0201f800, - 0x001049e7, 0x04000004, 0x0201f800, 0x001048e3, - 0x04020029, 0x83440580, 0x000007fe, 0x04000011, - 0x83440580, 0x000007fc, 0x0400000e, 0x0201f800, - 0x001049f3, 0x04000005, 0x59340403, 0x8400055e, - 0x48026c03, 0x0401f007, 0x0201f800, 0x00104838, - 0x04020004, 0x59340403, 0x8400055e, 0x48026c03, - 0x4134a000, 0x4020a800, 0x4200b000, 0x00000006, - 0x0201f800, 0x0010ab17, 0x59340007, 0x4400a800, - 0x59340006, 0x4800a801, 0x59340009, 0x4800a802, - 0x59340008, 0x4800a803, 0x59340403, 0x8400051e, - 0x48026c03, 0x82204400, 0x0000000a, 0x82183400, - 0x0000000a, 0x81468800, 0x83440480, 0x000007f0, - 0x0400100e, 0x8c1c3d06, 0x04000010, 0x83440580, - 0x000007f0, 0x04020004, 0x42028800, 0x000007fe, - 0x0401f006, 0x83440580, 0x000007ff, 0x04020007, - 0x42028800, 0x000007fc, 0x82180580, 0x0000000a, - 0x0400000b, 0x0401f7bb, 0x801831c0, 0x04020006, - 0x59a00801, 0x800408c4, 0x48074406, 0x0201f000, - 0x001022c0, 0x4a034004, 0x00000001, 0x49474000, - 0x59a00001, 0x80180400, 0x48034001, 0x481f4003, - 0x4a01d801, 0x00000000, 0x4819d804, 0x59a00002, - 0x4801d803, 0x4825d807, 0x4829d808, 0x40ec1000, - 0x0201f800, 0x00100858, 0x4a01d809, 0x001037a1, - 0x1c01f000, 0x4031d800, 0x58ef400b, 0x58ec0002, - 0x82000580, 0x00000200, 0x02000000, 0x00102304, - 0x59a00004, 0x80000540, 0x04020008, 0x59a28800, - 0x59a04002, 0x59a03803, 0x41783000, 0x58ec4807, - 0x58ec5008, 0x0401f78f, 0x59a00801, 0x800408c4, - 0x48074406, 0x0201f000, 0x001022c0, 0x42002800, - 0x0000007e, 0x59a00c06, 0x59a01207, 0x59a01c07, - 0x59a02209, 0x82040500, 0x0000ff00, 0x840001c0, - 0x82003480, 0x00000020, 0x02001000, 0x00102310, - 0x80140480, 0x02001000, 0x00102310, 0x82040500, - 0x000000ff, 0x82003480, 0x00000020, 0x02001000, - 0x00102310, 0x80140480, 0x02001000, 0x00102310, - 0x82080500, 0x0000ff00, 0x840001c0, 0x82003480, - 0x00000020, 0x02001000, 0x00102310, 0x80140480, - 0x02001000, 0x00102310, 0x82080500, 0x000000ff, - 0x82003480, 0x00000020, 0x02001000, 0x00102310, - 0x80140480, 0x02001000, 0x00102310, 0x820c0500, - 0x0000ff00, 0x840001c0, 0x82003480, 0x00000020, - 0x02001000, 0x00102310, 0x80140480, 0x02001000, - 0x00102310, 0x820c0500, 0x000000ff, 0x82003480, - 0x00000020, 0x02001000, 0x00102310, 0x80140480, - 0x02001000, 0x00102310, 0x82100500, 0x0000ff00, - 0x840001c0, 0x82003480, 0x00000020, 0x02001000, - 0x00102310, 0x80140480, 0x02001000, 0x00102310, - 0x82100500, 0x000000ff, 0x82003480, 0x00000020, - 0x02001000, 0x00102310, 0x80140480, 0x02001000, - 0x00102310, 0x900401c0, 0x80080d40, 0x900c01c0, - 0x80101d40, 0x83a83400, 0x0000003a, 0x44043000, - 0x80183000, 0x440c3000, 0x0201f000, 0x001022c0, - 0x0401f9ec, 0x04020005, 0x4a034406, 0x00000002, - 0x0201f000, 0x0010230c, 0x42000800, 0x0000000c, - 0x0401f853, 0x4a01d809, 0x00103820, 0x1c01f000, - 0x4031d800, 0x58ee580d, 0x58ef400b, 0x58ec0002, - 0x82000580, 0x00000200, 0x02000000, 0x00102304, - 0x832ca400, 0x00000004, 0x4200b000, 0x0000000c, - 0x40c8a800, 0x0201f800, 0x0010ab17, 0x58c80200, - 0x80000540, 0x04000034, 0x58c80400, 0x82000500, - 0xfffffffb, 0x04020030, 0x58c80401, 0x80000540, - 0x0400002d, 0x82000480, 0x0000ff01, 0x0402102a, - 0x58c80202, 0x82000480, 0x0000005c, 0x04001026, - 0x0201f800, 0x001063a3, 0x58c80c08, 0x58c80204, - 0x80040480, 0x04001020, 0x58c80204, 0x82000480, - 0x00000005, 0x0402101c, 0x58c80205, 0x58c80c08, - 0x80040902, 0x80040480, 0x04001017, 0x58c80c08, - 0x0201f800, 0x001062f1, 0x0400001b, 0x0201f800, - 0x001061b9, 0x04020012, 0x4979940b, 0x59c408a3, - 0x82040d40, 0x00000002, 0x480788a3, 0x4a038830, - 0x00000001, 0x4a038832, 0x01ffffff, 0x58c80202, - 0x48030804, 0x0201f800, 0x0010619b, 0x0201f000, - 0x001022c0, 0x0201f000, 0x00102310, 0x0201f800, - 0x001063f5, 0x0201f800, 0x00106402, 0x0201f800, - 0x001062e4, 0x0201f000, 0x0010230c, 0x4c000000, - 0x59a01207, 0x59a00407, 0x900811c0, 0x80081540, - 0x59a01a09, 0x59a00409, 0x900c19c0, 0x800c1d40, - 0x5c000000, 0x0401f1ac, 0x59840000, 0x82000580, - 0x00000000, 0x04000054, 0x59840002, 0x8c000504, - 0x04000051, 0x84000546, 0x48030802, 0x0201f800, - 0x001062e4, 0x59c408a3, 0x82040d00, 0xfffffffd, - 0x480788a3, 0x4c5c0000, 0x4200b800, 0x0010ac00, - 0x505e6800, 0x813669c0, 0x04000008, 0x5936600e, - 0x813261c0, 0x04000005, 0x0201f800, 0x001062d5, - 0x02000800, 0x001064ad, 0x805cb800, 0x825c0580, - 0x0010b3f0, 0x040207f3, 0x59866003, 0x813261c0, - 0x0400000b, 0x59300406, 0x82000580, 0x00000009, - 0x02020800, 0x001005d8, 0x5930b800, 0x0201f800, - 0x001062c1, 0x405e6000, 0x0401f7f5, 0x497b0803, - 0x4200b800, 0x0010b51b, 0x505e6000, 0x813261c0, - 0x04000011, 0x59300406, 0x82000580, 0x00000009, - 0x0402000d, 0x59300203, 0x82000580, 0x00000004, - 0x04020009, 0x59326809, 0x813669c0, 0x02020800, - 0x001005d8, 0x0201f800, 0x00100e99, 0x0201f800, - 0x001062c1, 0x4578b800, 0x805cb800, 0x825c0580, - 0x0010b523, 0x040207e9, 0x42000800, 0x0010b519, - 0x49780801, 0x49780800, 0x59a80069, 0x82000400, - 0x00000007, 0x48035069, 0x0201f800, 0x001063f5, - 0x0201f800, 0x00106402, 0x5c00b800, 0x0201f800, - 0x001061b4, 0x0201f000, 0x001022c0, 0x836c0580, - 0x00000003, 0x04000005, 0x4a034406, 0x00000007, - 0x0201f000, 0x0010230c, 0x59a00407, 0x59a02207, - 0x901021c0, 0x80102540, 0x59a00409, 0x59a02a09, - 0x901429c0, 0x80142d40, 0x0401f91e, 0x04020005, - 0x4a034406, 0x00000002, 0x0201f000, 0x0010230c, - 0x417a8800, 0x41781800, 0x497b4001, 0x497b4003, - 0x832c3400, 0x00000004, 0x481b4002, 0x41440000, - 0x81ac0400, 0x50026800, 0x813669c0, 0x0400000b, - 0x0201f800, 0x001049e7, 0x04020008, 0x59340002, - 0x48003000, 0x49443001, 0x82183400, 0x00000002, - 0x820c1c00, 0x00000002, 0x81468800, 0x83440480, - 0x00000800, 0x04000005, 0x820c0480, 0x00000010, - 0x0402100b, 0x0401f7ea, 0x800c19c0, 0x04020006, - 0x59a00801, 0x80040902, 0x48074406, 0x0201f000, - 0x001022c0, 0x4a034003, 0x00000001, 0x49474000, - 0x59a00001, 0x800c0400, 0x48034001, 0x40ec1000, - 0x4a001001, 0x00000000, 0x480c1004, 0x59a00002, - 0x48001003, 0x48101007, 0x48141008, 0x0201f800, - 0x00100858, 0x4a01d809, 0x00103920, 0x1c01f000, - 0x4031d800, 0x58ef400b, 0x58ec0002, 0x82000580, - 0x00000200, 0x02000000, 0x00102304, 0x59a00003, - 0x80000540, 0x04020008, 0x59a28800, 0x59a03002, - 0x41781800, 0x40ec1000, 0x58082007, 0x58082808, - 0x0401f7bf, 0x59a00801, 0x80040902, 0x48074406, - 0x0201f000, 0x001022c0, 0x800409c0, 0x04000005, - 0x4a034406, 0x00000001, 0x0201f000, 0x0010230c, - 0x59a80026, 0x8c00050a, 0x04020007, 0x8c000506, - 0x04020005, 0x4a034406, 0x00000016, 0x0201f000, - 0x0010230c, 0x0401f8bb, 0x04020005, 0x4a034406, - 0x00000002, 0x0201f000, 0x0010230c, 0x59a00c06, - 0x80040902, 0x59a00407, 0x59a01207, 0x900811c0, - 0x80081540, 0x59a00409, 0x59a01a09, 0x900c19c0, - 0x800c1d40, 0x832c0400, 0x00000005, 0x0401f8ce, - 0x4a01d809, 0x0010395b, 0x1c01f000, 0x4031d800, - 0x58ef400b, 0x58ee580d, 0x58ec0002, 0x82000580, - 0x00000200, 0x02000000, 0x00102304, 0x592c0009, - 0x0201f800, 0x00105c9a, 0x02000800, 0x001045a6, - 0x02020000, 0x00102310, 0x49474001, 0x481a6802, - 0x592c000a, 0x82001d80, 0x70000000, 0x04020007, - 0x0401f890, 0x04020011, 0x4a034406, 0x00000002, - 0x0201f000, 0x0010230c, 0x82001d80, 0x72000000, - 0x02020000, 0x00102310, 0x0401f886, 0x04020885, - 0x04020884, 0x04020005, 0x4a034406, 0x00000002, - 0x0201f000, 0x0010230c, 0x58ee580d, 0x4a025c04, - 0x00008000, 0x497a5a04, 0x592c3208, 0x80183102, - 0x592c1801, 0x4a001805, 0x01000000, 0x0201f800, - 0x001090d1, 0x04020005, 0x4a034406, 0x00000003, - 0x0201f000, 0x0010230c, 0x4a01d809, 0x00103995, - 0x1c01f000, 0x592c4000, 0x592c0005, 0x82000580, - 0x01000000, 0x04020005, 0x4a034406, 0x00000004, - 0x0201f000, 0x0010230c, 0x832c3c00, 0x00000005, - 0x401ca000, 0x401ca800, 0x5820280a, 0x4200b000, - 0x00000002, 0x82143580, 0x70000000, 0x04000003, - 0x4200b000, 0x0000000f, 0x0201f800, 0x0010ab28, - 0x401c0000, 0x58201006, 0x58201807, 0x58202205, - 0x80102102, 0x82143580, 0x70000000, 0x04020008, - 0x82103480, 0x00000002, 0x02001000, 0x00102310, - 0x42000800, 0x00000002, 0x0401f06e, 0x82143580, - 0x72000000, 0x02020000, 0x00102310, 0x82103480, - 0x0000002a, 0x02001000, 0x00102310, 0x42000800, - 0x0000000f, 0x0401f863, 0x4a01d809, 0x001039c9, - 0x1c01f000, 0x4031d800, 0x58ef400b, 0x58ee580e, - 0x58ec0002, 0x82000580, 0x00000200, 0x02000000, - 0x00102304, 0x592e5800, 0x832c0c00, 0x00000005, - 0x4004a000, 0x4004a800, 0x4200b000, 0x0000000f, - 0x0201f800, 0x0010ab28, 0x40ec1000, 0x4a001001, - 0x00000000, 0x4a001004, 0x0000000f, 0x48041003, - 0x0201f800, 0x00100858, 0x4a01d809, 0x001039e5, - 0x1c01f000, 0x4031d800, 0x58ef400b, 0x58ee580e, - 0x58ec0002, 0x82000580, 0x00000200, 0x02000000, - 0x00102304, 0x832c0c00, 0x00000005, 0x4004a000, - 0x4004a800, 0x4200b000, 0x0000000c, 0x0201f800, - 0x0010ab28, 0x40ec1000, 0x4a001001, 0x00000000, - 0x4a001004, 0x0000000c, 0x48041003, 0x0201f800, - 0x00100858, 0x4a01d809, 0x001022b9, 0x1c01f000, - 0x0201f800, 0x001007e4, 0x04000010, 0x497a5800, - 0x58ec000d, 0x80000540, 0x04020004, 0x492dd80d, - 0x492dd80e, 0x0401f007, 0x58ec000e, 0x48025800, - 0x82000400, 0x00000001, 0x452c0000, 0x492dd80e, - 0x832c0400, 0x00000004, 0x492fc857, 0x4803c857, - 0x1c01f000, 0x4d2c0000, 0x48efc857, 0x58ec400d, - 0x4823c857, 0x802041c0, 0x04000007, 0x40225800, - 0x592c4001, 0x497a5801, 0x0201f800, 0x001007f4, - 0x0401f7f8, 0x4979d80d, 0x4979d80e, 0x5c025800, - 0x1c01f000, 0x42003000, 0x00000001, 0x0401f003, - 0x42003000, 0x00000000, 0x4803c857, 0x4807c857, - 0x480bc857, 0x480fc857, 0x481bc857, 0x48efc857, - 0x4819d801, 0x800409c0, 0x02000800, 0x001005d8, - 0x4805d804, 0x4801d803, 0x4809d807, 0x480dd808, - 0x40ec1000, 0x0201f800, 0x00100858, 0x4a01d809, - 0x001022b9, 0x1c01f000, 0x80002d80, 0x480bc857, - 0x480fc857, 0x4813c857, 0x4817c857, 0x4d2c0000, - 0x4da00000, 0x42034000, 0x0010b4a4, 0x59a00017, - 0x800001c0, 0x04020013, 0x04006012, 0x480bc020, - 0x480fc021, 0x4813c022, 0x4817c023, 0x900811c0, - 0x82081540, 0x00000012, 0x480bc011, 0x59e00017, - 0x8c000508, 0x04020004, 0x4203e000, 0x30000001, - 0x0401f053, 0x4a03c017, 0x00000002, 0x0401f7fb, - 0x4c040000, 0x4c1c0000, 0x80000800, 0x48074017, - 0x59a0381a, 0x481fc857, 0x801c39c0, 0x04020027, - 0x82000480, 0x0000000a, 0x04021010, 0x59a00018, - 0x80000000, 0x48034018, 0x59a00219, 0x82000400, - 0x00000002, 0x82000c80, 0x00000013, 0x48034219, - 0x04001003, 0x497b4219, 0x41780000, 0x59a03816, - 0x801c3c00, 0x0401f030, 0x4803c856, 0x0201f800, - 0x001007e4, 0x04000007, 0x492f401a, 0x492f401b, - 0x412c3800, 0x497b421c, 0x497a5813, 0x0401f026, - 0x59880051, 0x80000000, 0x48031051, 0x59a00017, - 0x80000040, 0x48034017, 0x59a00219, 0x59a03816, - 0x801c3c00, 0x0401f01c, 0x59a0021c, 0x82000400, - 0x00000002, 0x82000c80, 0x00000012, 0x04021004, - 0x4803421c, 0x801c3c00, 0x0401f013, 0x0201f800, - 0x001007e4, 0x0402000b, 0x59880051, 0x80000000, - 0x48031051, 0x59a00017, 0x80000040, 0x48034017, - 0x4803c856, 0x59a0021c, 0x801c3c00, 0x0401f006, - 0x492f401a, 0x492c3813, 0x412c3800, 0x497b421c, - 0x497a5813, 0x48083c00, 0x480c3a00, 0x48103c01, - 0x48143a01, 0x5c003800, 0x5c000800, 0x5c034000, - 0x5c025800, 0x1c01f000, 0x480fc857, 0x4813c857, - 0x481bc857, 0x42000000, 0x0010b813, 0x0201f800, - 0x0010aa47, 0x801800d0, 0x40002800, 0x42001000, - 0x00008014, 0x0401f786, 0x4c000000, 0x599c0017, - 0x8c000512, 0x5c000000, 0x1c01f000, 0x4c000000, - 0x599c0018, 0x8c00050e, 0x5c000000, 0x1c01f000, - 0x59a80821, 0x800409c0, 0x04000005, 0x4a034406, - 0x00000001, 0x0201f000, 0x0010230c, 0x836c0580, - 0x00000003, 0x04000005, 0x4a034406, 0x00000007, - 0x0201f000, 0x0010230c, 0x599c0017, 0x8c00050a, - 0x04000005, 0x4a034406, 0x00000008, 0x0201f000, - 0x0010230c, 0x59340405, 0x8c000508, 0x04020004, - 0x8c00050a, 0x02020000, 0x001034db, 0x497a5a04, - 0x497a5805, 0x4a025c04, 0x00008000, 0x0201f800, - 0x00109176, 0x04020005, 0x4a034406, 0x00000003, - 0x0201f000, 0x0010230c, 0x4a01d809, 0x00103aed, - 0x1c01f000, 0x592c0005, 0x82000580, 0x01000000, - 0x04020005, 0x4a034406, 0x00000004, 0x0201f000, - 0x0010230c, 0x59a28c06, 0x0201f800, 0x00020245, - 0x02020000, 0x00102310, 0x0201f000, 0x001034db, - 0x82001580, 0x0000ffff, 0x04000009, 0x0201f800, - 0x00105c9a, 0x02000800, 0x00020245, 0x0402000c, - 0x0201f800, 0x00105fae, 0x0401f009, 0x42028800, - 0x000007ef, 0x0201f800, 0x00020245, 0x02000800, - 0x00105fae, 0x81468840, 0x040217fb, 0x1c01f000, - 0x4803c856, 0x4c0c0000, 0x4d340000, 0x4d440000, - 0x42028800, 0x000007fe, 0x0201f800, 0x00020245, - 0x04020009, 0x5934180a, 0x820c1d00, 0x00000001, - 0x820c1d80, 0x00000001, 0x42001000, 0x0000801b, - 0x0401ff1e, 0x5c028800, 0x5c026800, 0x5c001800, - 0x1c01f000, 0x599c0017, 0x8c000508, 0x1c01f000, - 0x48efc857, 0x04011000, 0x48efc840, 0x4a03c842, - 0x00000011, 0x40000000, 0x040117ff, 0x4a01d80f, - 0xbeefbeef, 0x1c01f000, 0x497b4000, 0x497b4001, - 0x497b4002, 0x497b4003, 0x497b4004, 0x1c01f000, - 0x59c400a4, 0x4c580000, 0x4c500000, 0x4c540000, - 0x82000500, 0x0000000f, 0x82000480, 0x00000007, - 0x0400100a, 0x82006c80, 0x00000006, 0x02021800, - 0x001005d8, 0x0c01f807, 0x5c00a800, 0x5c00a000, - 0x5c00b000, 0x1c01f000, 0x0401f906, 0x0401f7fb, - 0x00103b51, 0x00103b57, 0x00103b7c, 0x00103b9e, - 0x00103c59, 0x59c40806, 0x8c040d00, 0x04020003, - 0x84040d40, 0x48078806, 0x1c01f000, 0x59c40005, - 0x8c000534, 0x02020000, 0x0010429e, 0x4a038805, - 0xffffffff, 0x42006000, 0x00020000, 0x0201f800, - 0x00104282, 0x59a80015, 0x82000500, 0xfffffffa, - 0x84000542, 0x48035015, 0x497b5026, 0x42000800, - 0x0010be21, 0x45780800, 0x497b5013, 0x42006000, - 0xffefffff, 0x42006800, 0x40000000, 0x0201f800, - 0x0010427d, 0x59c40006, 0x82000500, 0xffffff0f, - 0x48038806, 0x42000800, 0x00000010, 0x42001000, - 0x001041f3, 0x0201f800, 0x00105f83, 0x0401f001, - 0x42006000, 0xffffffff, 0x42006800, 0x00800000, - 0x0201f800, 0x0010427d, 0x4200b000, 0x000000c8, - 0x59c400a4, 0x82000500, 0x0000000f, 0x82000580, - 0x0000000a, 0x0400000f, 0x8058b040, 0x040207f9, - 0x497b5014, 0x42006000, 0xbf7fffff, 0x42006800, - 0x00018000, 0x0201f800, 0x0010427d, 0x42006000, - 0xfffeffff, 0x41786800, 0x0201f000, 0x0010427d, - 0x497b5014, 0x4a035012, 0x00000000, 0x80000580, - 0x0201f000, 0x00104289, 0x4a038805, 0xffffffff, - 0x59a80012, 0x82000c80, 0x00000004, 0x02021800, - 0x001005d8, 0x0c01f001, 0x00103ba9, 0x00103bd6, - 0x00103c4f, 0x4803c856, 0x59c400a3, 0x8400051e, - 0x480388a3, 0x4a035012, 0x00000001, 0x59c40008, - 0x8400054e, 0x48038808, 0x0201f800, 0x00104263, - 0x42007800, 0x0010b54c, 0x4a007806, 0x11010000, - 0x4200a000, 0x0010b402, 0x4200a800, 0x0010b553, - 0x4200b000, 0x00000002, 0x0201f800, 0x0010ab17, - 0x497b8802, 0x42000800, 0x00000003, 0x497b504a, - 0x0201f800, 0x0010416e, 0x4a03504a, 0x00000001, - 0x497b5016, 0x0201f800, 0x00104290, 0x42006000, - 0xffffffff, 0x42006800, 0x00080000, 0x0201f800, - 0x0010427d, 0x42006000, 0xfff7ffff, 0x41786800, - 0x0201f000, 0x0010427d, 0x59a80016, 0x497b5016, - 0x80002540, 0x04000066, 0x59c40004, 0x82000500, - 0x00000003, 0x04020071, 0x59a80815, 0x8c040d02, - 0x0400004b, 0x82100580, 0x0000000c, 0x0402004f, - 0x82100400, 0x00000018, 0x8000b104, 0x41cc1000, - 0x42001800, 0x0010b54c, 0x50080800, 0x500c0000, - 0x80040580, 0x0402001a, 0x80081000, 0x800c1800, - 0x8058b040, 0x040207f9, 0x0201f800, 0x00104290, - 0x42006000, 0xffffffff, 0x42006800, 0x00500000, - 0x0201f800, 0x0010427d, 0x4a035012, 0x00000002, - 0x4a035014, 0x00000002, 0x42000800, 0x000007d0, - 0x42001000, 0x00104148, 0x0201f800, 0x0010606e, - 0x0201f800, 0x00104263, 0x0401f048, 0x59cc0806, - 0x82040d80, 0x11010000, 0x04020028, 0x59cc0800, - 0x82040500, 0x00ffffff, 0x0400001a, 0x82000580, - 0x000000ef, 0x04020017, 0x59cc0801, 0x82040500, - 0x00ffffff, 0x82000580, 0x000000ef, 0x04020011, - 0x83cca400, 0x00000007, 0x4200a800, 0x0010b402, - 0x4200b000, 0x00000002, 0x50500800, 0x50540000, - 0x80040480, 0x04001007, 0x04020010, 0x8050a000, - 0x8054a800, 0x8058b040, 0x040207f8, 0x0401f00b, - 0x59a80015, 0x84000502, 0x48035015, 0x41cca000, - 0x4200a800, 0x0010b54c, 0x4200b000, 0x00000009, - 0x0201f800, 0x0010ab17, 0x0201f800, 0x00104290, - 0x42006000, 0xffffffff, 0x42006800, 0x00080000, - 0x0201f800, 0x0010427d, 0x42006000, 0xfff7ffff, - 0x41786800, 0x0201f800, 0x0010427d, 0x42006000, - 0xffffffff, 0x42006800, 0x00004000, 0x0201f800, - 0x0010427d, 0x59c40004, 0x82000500, 0x00000003, - 0x04020006, 0x497b5016, 0x42000800, 0x00000003, - 0x0201f000, 0x0010416e, 0x1c01f000, 0x1c01f000, - 0x59a80014, 0x82006d80, 0x0000000f, 0x04000005, - 0x82000580, 0x0000001b, 0x02020800, 0x00104139, - 0x1c01f000, 0x59a80015, 0x84000506, 0x48035015, - 0x497b504a, 0x59a80014, 0x82000c80, 0x0000001e, - 0x02021800, 0x001005d8, 0x0c01f001, 0x00103c97, - 0x00103cac, 0x00103cd5, 0x00103cf0, 0x00103d14, - 0x00103d45, 0x00103d68, 0x00103d9b, 0x00103dbe, - 0x00103de4, 0x00103e21, 0x00103e48, 0x00103e5f, - 0x00103e71, 0x00103e8a, 0x00103ea0, 0x00103ea5, - 0x00103ecd, 0x00103ef0, 0x00103f16, 0x00103f39, - 0x00103f6c, 0x00103fae, 0x00103fd8, 0x00103ff0, - 0x00104030, 0x00104049, 0x0010405c, 0x0010405d, - 0x4803c856, 0x4202d800, 0x00000007, 0x0201f800, - 0x0010513b, 0x04000007, 0x42006000, 0xffffffd7, - 0x41786800, 0x0201f800, 0x0010427d, 0x0401f00b, - 0x59c40006, 0x82000500, 0xffffff0f, 0x48038806, - 0x42001000, 0x000000f0, 0x0201f800, 0x0010193d, - 0x0201f800, 0x00105098, 0x1c01f000, 0x4803c856, - 0x42006000, 0xbf7fffff, 0x42006800, 0x00400000, - 0x0201f800, 0x0010427d, 0x4a035014, 0x00000001, - 0x42001000, 0x001041f3, 0x0201f800, 0x00105fa4, - 0x0201f800, 0x001041f8, 0x42000800, 0x000007d0, - 0x42001000, 0x00104148, 0x0201f000, 0x0010606e, - 0x59a80016, 0x82000580, 0x00000014, 0x04020025, - 0x4803c857, 0x42006000, 0xffbfffff, 0x41786800, - 0x0201f800, 0x0010427d, 0x59c40004, 0x82000500, - 0x00000003, 0x0402001b, 0x59cc1006, 0x82081580, - 0x11020000, 0x04020016, 0x59cc1007, 0x8c08153e, - 0x0400000b, 0x59a80015, 0x8c000504, 0x04020008, - 0x42000000, 0x0010b83f, 0x0201f800, 0x0010aa47, - 0x59a80015, 0x84000544, 0x48035015, 0x42001000, - 0x00104148, 0x0201f800, 0x00105f90, 0x4a035014, - 0x00000010, 0x0401f9d4, 0x0401f002, 0x497b5016, - 0x1c01f000, 0x4803c856, 0x4a035014, 0x00000003, - 0x42006000, 0xbf3fffff, 0x42006800, 0x00100000, - 0x0201f800, 0x0010427d, 0x42001000, 0x001041f3, - 0x0201f800, 0x00105fa4, 0x0201f800, 0x001041f8, - 0x42001000, 0x00104148, 0x0201f800, 0x00105f90, - 0x42007800, 0x0010b552, 0x46007800, 0x11020000, - 0x42000800, 0x00000005, 0x0201f000, 0x0010416e, - 0x59a80016, 0x80000540, 0x04000021, 0x4803c857, - 0x42001000, 0x00104148, 0x0201f800, 0x00105f90, - 0x59a80016, 0x82000580, 0x00000014, 0x04020016, - 0x59cc1006, 0x82081580, 0x11020000, 0x04020012, - 0x59cc1007, 0x8c08153e, 0x0400000b, 0x59a80015, - 0x8c000504, 0x04020008, 0x42000000, 0x0010b83f, - 0x0201f800, 0x0010aa47, 0x59a80015, 0x84000544, - 0x48035015, 0x4a035014, 0x00000004, 0x0401f805, - 0x0401f003, 0x0201f800, 0x00104139, 0x1c01f000, - 0x4803c856, 0x4a035014, 0x00000005, 0x83cca400, - 0x00000006, 0x4200a800, 0x0010b552, 0x4200b000, - 0x00000005, 0x0201f800, 0x0010ab17, 0x42007800, - 0x0010b552, 0x46007800, 0x11030000, 0x0201f800, - 0x0010413e, 0x04020014, 0x59a80015, 0x8c000500, - 0x04020011, 0x59a80810, 0x82040580, 0x00ffffff, - 0x0400000d, 0x82040d00, 0x000000ff, 0x82040400, - 0x0010210e, 0x50000800, 0x80040910, 0x42001000, - 0x00000004, 0x0401fb9b, 0x0400000b, 0x0201f800, - 0x0010420d, 0x4200b000, 0x00000004, 0x83cca400, - 0x00000007, 0x4200a800, 0x0010b553, 0x0201f800, - 0x0010ab17, 0x42000800, 0x00000005, 0x0201f000, - 0x0010416e, 0x59a80016, 0x80000540, 0x04000020, - 0x4803c857, 0x42001000, 0x00104148, 0x0201f800, - 0x00105f90, 0x59a80016, 0x82000580, 0x00000014, - 0x04020016, 0x59cc1006, 0x82081580, 0x11030000, - 0x04020012, 0x59cc1007, 0x8c08153e, 0x0400000b, - 0x59a80015, 0x8c000504, 0x04020008, 0x42000000, - 0x0010b83f, 0x0201f800, 0x0010aa47, 0x59a80015, - 0x84000544, 0x48035015, 0x4a035014, 0x00000006, - 0x0401f804, 0x0401f002, 0x0401fbd3, 0x1c01f000, - 0x4803c856, 0x4a035014, 0x00000007, 0x83cca400, - 0x00000006, 0x4200a800, 0x0010b552, 0x4200b000, - 0x00000005, 0x0201f800, 0x0010ab17, 0x42007800, - 0x0010b552, 0x46007800, 0x11040000, 0x0401fbc7, - 0x04020020, 0x59a80015, 0x8c000500, 0x0402001d, - 0x599c0017, 0x8c000500, 0x0400001a, 0x599c1402, - 0x82080480, 0x0000007f, 0x02021800, 0x001005d8, - 0x4c080000, 0x82081400, 0x0010210e, 0x50081000, - 0x82081500, 0x000000ff, 0x480b5010, 0x42000800, - 0x00000003, 0x0201f800, 0x00106c78, 0x5c000800, - 0x42001000, 0x00000004, 0x0401fb3e, 0x04000005, - 0x0401fd2b, 0x04000003, 0x0201f800, 0x001015fe, - 0x42000800, 0x00000005, 0x0401f3d4, 0x59a80016, - 0x80000540, 0x04000020, 0x4803c857, 0x42001000, - 0x00104148, 0x0201f800, 0x00105f90, 0x59a80016, - 0x82000580, 0x00000014, 0x04020016, 0x59cc1006, - 0x82081580, 0x11040000, 0x04020012, 0x59cc1007, - 0x8c08153e, 0x0400000b, 0x59a80015, 0x8c000504, - 0x04020008, 0x42000000, 0x0010b83f, 0x0201f800, - 0x0010aa47, 0x59a80015, 0x84000544, 0x48035015, - 0x4a035014, 0x00000008, 0x0401f804, 0x0401f002, - 0x0401fb7d, 0x1c01f000, 0x4803c856, 0x4a035014, - 0x00000009, 0x83cca400, 0x00000006, 0x4200a800, - 0x0010b552, 0x4200b000, 0x00000005, 0x0201f800, - 0x0010ab17, 0x42007800, 0x0010b552, 0x46007800, - 0x11050100, 0x0401fb71, 0x0402000a, 0x59a80015, - 0x8c000500, 0x04020007, 0x0401fa8c, 0x04020005, - 0x82000540, 0x00000001, 0x0201f800, 0x001015fe, - 0x42000800, 0x00000005, 0x0401fb94, 0x0401fb63, - 0x04020ea4, 0x4d3c0000, 0x42027800, 0x00000001, - 0x0201f800, 0x00109874, 0x5c027800, 0x1c01f000, - 0x59a80016, 0x80000540, 0x0400003a, 0x4803c857, - 0x42001000, 0x00104148, 0x0201f800, 0x00105f90, - 0x59a80016, 0x82000580, 0x00000014, 0x04020030, - 0x59cc1006, 0x82080500, 0x11050000, 0x82000580, - 0x11050000, 0x0402002a, 0x8c081510, 0x04000014, - 0x59cc1007, 0x8c08153e, 0x0400000b, 0x59a80015, - 0x8c000504, 0x04020008, 0x42000000, 0x0010b83f, - 0x0201f800, 0x0010aa47, 0x59a80015, 0x84000544, - 0x48035015, 0x4a035013, 0x00000001, 0x4a035014, - 0x0000000a, 0x0401f818, 0x0401f016, 0x80000540, - 0x04020013, 0x59cc1007, 0x8c08153e, 0x0400000b, - 0x59a80015, 0x8c000504, 0x04020008, 0x42000000, - 0x0010b83f, 0x0201f800, 0x0010aa47, 0x59a80015, - 0x84000544, 0x48035015, 0x497b5013, 0x4a035014, - 0x0000000e, 0x0401f86d, 0x0401f002, 0x0401fb1a, - 0x1c01f000, 0x4803c856, 0x4a035014, 0x0000000b, - 0x42001000, 0x0010b553, 0x4008a800, 0x4200b000, - 0x00000020, 0x4600a800, 0xffffffff, 0x8054a800, - 0x8058b040, 0x040207fc, 0x42007800, 0x0010b552, - 0x46007800, 0x11060000, 0x42001000, 0x0010b553, - 0x0401fb0a, 0x04000005, 0x50080000, 0x46001000, - 0x00ffffff, 0x0401f00c, 0x50080800, 0x82040d00, - 0x0000ffff, 0x59a80010, 0x82000500, 0x000000ff, - 0x82000540, 0x00000100, 0x800000e0, 0x80040d40, - 0x44041000, 0x42000800, 0x00000021, 0x0401f327, - 0x59a80016, 0x80000540, 0x04000014, 0x4803c857, - 0x59a80016, 0x42001000, 0x00104148, 0x0201f800, - 0x00105f90, 0x59a80016, 0x82000580, 0x00000084, - 0x04020009, 0x59cc1006, 0x82081580, 0x11060000, - 0x04020005, 0x4a035014, 0x0000000c, 0x0401f804, - 0x0401f002, 0x0401fadc, 0x1c01f000, 0x4803c856, - 0x4a035014, 0x0000000d, 0x83cca400, 0x00000006, - 0x4200a800, 0x0010b552, 0x4200b000, 0x00000021, - 0x0201f800, 0x0010ab17, 0x42007800, 0x0010b552, - 0x46007800, 0x11070000, 0x42000800, 0x00000021, - 0x0401f2fe, 0x59a80016, 0x80000540, 0x04000016, - 0x4803c857, 0x59a80016, 0x42001000, 0x00104148, - 0x0201f800, 0x00105f90, 0x82000580, 0x00000084, - 0x0402000c, 0x59cc1006, 0x82081580, 0x11070000, - 0x04020008, 0x4a035013, 0x00000001, 0x0401fa91, - 0x4a035014, 0x0000000e, 0x0401f804, 0x0401f002, - 0x0401fab1, 0x1c01f000, 0x4803c856, 0x82040d40, - 0x00000001, 0x0401fbfc, 0x4a035014, 0x0000000f, - 0x497b5016, 0x42006000, 0xffffffff, 0x42006800, - 0x00300000, 0x0401fbe8, 0x42006000, 0xffdfffff, - 0x41786800, 0x0401fbe4, 0x42000800, 0x000007d0, - 0x42001000, 0x00104148, 0x0201f000, 0x00105f69, - 0x4803c856, 0x59a80016, 0x80000540, 0x04020296, - 0x1c01f000, 0x4803c856, 0x4a035014, 0x00000011, - 0x83cca400, 0x00000006, 0x4200a800, 0x0010b552, - 0x4200b000, 0x00000005, 0x0201f800, 0x0010ab17, - 0x4200a800, 0x0010b552, 0x4600a800, 0x11020000, - 0x0401fa8a, 0x04020015, 0x59a80010, 0x82000d00, - 0xffff0000, 0x04000011, 0x82000500, 0x000000ff, - 0x0400000e, 0x82000c00, 0x0010210e, 0x50040800, - 0x80040910, 0x82040580, 0x0000007e, 0x04000007, - 0x82040580, 0x00000080, 0x04000004, 0x42001000, - 0x00000004, 0x0401fa07, 0x42000800, 0x00000005, - 0x0401f2a2, 0x59a80016, 0x80000540, 0x04000020, - 0x4803c857, 0x42001000, 0x00104148, 0x0201f800, - 0x00105f90, 0x59a80016, 0x82000580, 0x00000014, - 0x04020016, 0x59cc1006, 0x82081580, 0x11030000, - 0x04020012, 0x59cc1007, 0x8c08153e, 0x0400000b, - 0x59a80015, 0x8c000504, 0x04020008, 0x42000000, - 0x0010b83f, 0x0201f800, 0x0010aa47, 0x59a80015, - 0x84000544, 0x48035015, 0x4a035014, 0x00000012, - 0x0401f804, 0x0401f002, 0x0401fa4b, 0x1c01f000, - 0x4803c856, 0x4a035014, 0x00000013, 0x83cca400, - 0x00000006, 0x4200a800, 0x0010b552, 0x4200b000, - 0x00000005, 0x0201f800, 0x0010ab17, 0x4200a800, - 0x0010b552, 0x4600a800, 0x11030000, 0x0401fa3f, - 0x04020013, 0x59a80015, 0x8c000500, 0x04020010, - 0x59a80810, 0x82040580, 0x00ffffff, 0x0400000c, - 0x82040d00, 0x000000ff, 0x82040400, 0x0010210e, - 0x50000800, 0x80040910, 0x42001000, 0x00000004, - 0x0401f9c0, 0x04000002, 0x0401fafb, 0x42000800, - 0x00000005, 0x0401f259, 0x59a80016, 0x80000540, - 0x04000020, 0x4803c857, 0x42001000, 0x00104148, - 0x0201f800, 0x00105f90, 0x59a80016, 0x82000580, - 0x00000014, 0x04020016, 0x59cc1006, 0x82081580, - 0x11040000, 0x04020012, 0x59cc1007, 0x8c08153e, - 0x0400000b, 0x59a80015, 0x8c000504, 0x04020008, - 0x42000000, 0x0010b83f, 0x0201f800, 0x0010aa47, - 0x59a80015, 0x84000544, 0x48035015, 0x4a035014, - 0x00000014, 0x0401f804, 0x0401f002, 0x0401fa02, - 0x1c01f000, 0x4803c856, 0x4a035014, 0x00000015, - 0x83cca400, 0x00000006, 0x4200a800, 0x0010b552, - 0x4200b000, 0x00000005, 0x0201f800, 0x0010ab17, - 0x4200a800, 0x0010b552, 0x4600a800, 0x11040000, - 0x0401f9f6, 0x04020020, 0x59a80015, 0x8c000500, - 0x0402001d, 0x599c0017, 0x8c000500, 0x0400001a, - 0x599c1402, 0x82080480, 0x0000007f, 0x02021800, - 0x001005d8, 0x4c080000, 0x82081400, 0x0010210e, - 0x50081000, 0x82081500, 0x000000ff, 0x480b5010, - 0x42000800, 0x00000003, 0x0201f800, 0x00106c78, - 0x5c000800, 0x42001000, 0x00000004, 0x0401f96d, - 0x04000005, 0x0201f800, 0x00103abf, 0x02020800, - 0x001015fe, 0x42000800, 0x00000005, 0x0401f203, - 0x59a80016, 0x80000540, 0x0400003f, 0x4803c857, - 0x42001000, 0x00104148, 0x0201f800, 0x00105f90, - 0x59a80016, 0x82000580, 0x00000014, 0x04020035, - 0x59cc1006, 0x82080500, 0x11050000, 0x82000580, - 0x11050000, 0x0402002f, 0x8c081510, 0x04000010, - 0x0401fb09, 0x59cc1007, 0x8c08153e, 0x0400000b, - 0x59a80015, 0x8c000504, 0x04020008, 0x42000000, - 0x0010b83f, 0x0201f800, 0x0010aa47, 0x59a80015, - 0x84000544, 0x48035015, 0x0401f013, 0x59cc1007, - 0x8c08153e, 0x0400000b, 0x59a80015, 0x8c000504, - 0x04020008, 0x42000000, 0x0010b83f, 0x0201f800, - 0x0010aa47, 0x59a80015, 0x84000544, 0x48035015, - 0x82000540, 0x00000001, 0x0401faeb, 0x497b5013, - 0x0401f003, 0x4a035013, 0x00000001, 0x59cc1007, - 0x8c08153c, 0x04000003, 0x4a035026, 0x00000008, - 0x4a035014, 0x00000016, 0x0401f804, 0x0401f002, - 0x0401f98d, 0x1c01f000, 0x4803c856, 0x83cca400, - 0x00000006, 0x4200a800, 0x0010b552, 0x4200b000, - 0x00000005, 0x0201f800, 0x0010ab17, 0x4a035014, - 0x00000017, 0x59a80013, 0x8c000500, 0x04000006, - 0x42001000, 0x0010b552, 0x46001000, 0x11050100, - 0x0401f003, 0x4a035014, 0x0000001b, 0x0401f97b, - 0x0402000a, 0x59a80015, 0x8c000500, 0x04020007, - 0x0401f896, 0x04020005, 0x82000540, 0x00000001, - 0x0201f800, 0x001015fe, 0x42000800, 0x00000005, - 0x0401f99e, 0x4d3c0000, 0x42027800, 0x00000001, - 0x0201f800, 0x00109874, 0x5c027800, 0x1c01f000, - 0x59a80016, 0x80000540, 0x04000015, 0x4803c857, - 0x42001000, 0x00104148, 0x0201f800, 0x00105f90, - 0x59a80016, 0x82000580, 0x00000084, 0x0402000b, - 0x59cc1006, 0x82081580, 0x11060000, 0x04020007, - 0x80000580, 0x0401faa0, 0x4a035014, 0x00000018, - 0x0401f804, 0x0401f002, 0x0401f94b, 0x1c01f000, - 0x4803c856, 0x4a035014, 0x00000019, 0x83cca400, - 0x00000006, 0x4200a800, 0x0010b552, 0x4200b000, - 0x00000021, 0x0201f800, 0x0010ab17, 0x42003800, - 0x0010b553, 0x0401f941, 0x04020018, 0x401c2800, - 0x50141000, 0x80080130, 0x80000000, 0x40001800, - 0x82081500, 0x00ffffff, 0x800000f0, 0x80080540, - 0x44002800, 0x59a80810, 0x82040d00, 0x000000ff, - 0x400c1000, 0x80081104, 0x82082400, 0x0010b553, - 0x50101000, 0x820c0500, 0x00000003, 0x0c01f806, - 0x80081540, 0x44082000, 0x42000800, 0x00000021, - 0x0401f156, 0x0010401d, 0x00104022, 0x00104027, - 0x0010402c, 0x800408f0, 0x40040000, 0x82081500, - 0x00ffffff, 0x1c01f000, 0x800408e0, 0x40040000, - 0x82081500, 0xff00ffff, 0x1c01f000, 0x800408d0, - 0x40040000, 0x82081500, 0xffff00ff, 0x1c01f000, - 0x40040000, 0x82081500, 0xffffff00, 0x1c01f000, - 0x59a80016, 0x80000540, 0x04000016, 0x4803c857, - 0x42001000, 0x00104148, 0x0201f800, 0x00105f90, - 0x59a80016, 0x82000580, 0x00000084, 0x0402000c, - 0x59cc1006, 0x82081580, 0x11070000, 0x04020008, - 0x4a035013, 0x00000001, 0x0401f8d2, 0x4a035014, - 0x0000001a, 0x0401f804, 0x0401f002, 0x0401f8f2, - 0x1c01f000, 0x82000540, 0x00000001, 0x0401fa3e, - 0x4a035014, 0x0000001b, 0x83cca400, 0x00000006, - 0x4200a800, 0x0010b552, 0x59a82016, 0x40100000, - 0x8000b104, 0x40580800, 0x5450a800, 0x8050a000, - 0x8054a800, 0x8058b040, 0x040207fc, 0x0401f113, - 0x1c01f000, 0x1c01f000, 0x4803c856, 0x42003000, - 0x00000004, 0x42004000, 0x0010b553, 0x599c2817, - 0x8c142d14, 0x0402001f, 0x42001000, 0x00000003, - 0x40200000, 0x80080400, 0x50000800, 0x82042580, - 0xffffffff, 0x04020005, 0x80081040, 0x80183040, - 0x040207f8, 0x0401f05e, 0x800811c0, 0x04020006, - 0x82042580, 0x3fffffff, 0x04000058, 0x82040d40, - 0xc0000000, 0x4200b000, 0x00000020, 0x42001800, - 0x00000001, 0x40042000, 0x80102102, 0x04021021, - 0x800c18c2, 0x8058b040, 0x040207fc, 0x0401f04b, - 0x41781000, 0x40200000, 0x80080400, 0x50000800, - 0x82042580, 0xffffffff, 0x04020005, 0x80081000, - 0x80183040, 0x040207f8, 0x0401f040, 0x800811c0, - 0x04020003, 0x82040d40, 0xc0000000, 0x4200b000, - 0x00000001, 0x42001800, 0x80000000, 0x40042000, - 0x801020c2, 0x04021007, 0x800c1902, 0x8058b000, - 0x82580480, 0x00000021, 0x040017fa, 0x0401f02f, - 0x40200000, 0x80082400, 0x50100000, 0x800c0540, - 0x44002000, 0x59a80015, 0x84000540, 0x48035015, - 0x40580000, 0x42002800, 0x00000020, 0x80142c80, - 0x40080000, 0x42003800, 0x00000003, 0x801c0480, - 0x800000ca, 0x80142d40, 0x82144c00, 0x0010210e, - 0x50242800, 0x82142d00, 0x000000ff, 0x48175010, - 0x4c040000, 0x40140800, 0x0201f800, 0x001015eb, - 0x5c000800, 0x40001800, 0x500c0000, 0x80100540, - 0x44001800, 0x59a80015, 0x84000540, 0x48035015, - 0x4200a800, 0x0010b553, 0x4020a000, 0x4200b000, - 0x00000004, 0x0201f800, 0x0010ab17, 0x82000540, - 0x00000001, 0x0401f002, 0x80000580, 0x1c01f000, - 0x4807c857, 0x480bc857, 0x4008b000, 0x83cca400, - 0x00000007, 0x4200a800, 0x0010b553, 0x40541000, - 0x0201f800, 0x0010ab17, 0x40041800, 0x41782000, - 0x42000000, 0x00000003, 0x820c1c80, 0x00000020, - 0x04001004, 0x80102000, 0x80000040, 0x0401f7fb, - 0x40041800, 0x801021c0, 0x04000005, 0x820c1c80, - 0x00000020, 0x80102040, 0x040207fd, 0x42002000, - 0x00000001, 0x800c19c0, 0x04000004, 0x801020c2, - 0x800c1840, 0x040207fe, 0x80083c00, 0x83cc2c00, - 0x00000007, 0x80142c00, 0x50140000, 0x80102d00, - 0x04020012, 0x80100540, 0x44003800, 0x82042400, - 0x0010210e, 0x50102800, 0x82142d00, 0x000000ff, - 0x48175010, 0x4c040000, 0x40140800, 0x0201f800, - 0x001015eb, 0x5c000800, 0x59a80015, 0x84000540, - 0x48035015, 0x80000580, 0x1c01f000, 0x4807c856, - 0x42001000, 0x00008017, 0x59a8184e, 0x0201f800, - 0x0010aa4f, 0x0201f800, 0x00103a3e, 0x1c01f000, - 0x4807c856, 0x4200b000, 0x00000020, 0x83cca400, - 0x00000007, 0x4200a800, 0x0010be21, 0x0201f000, - 0x0010ab28, 0x4807c856, 0x0201f800, 0x00106ede, - 0x42000800, 0x000000f7, 0x0401f8de, 0x497b2804, - 0x497b2805, 0x497b281c, 0x497b281d, 0x4202d800, - 0x00000001, 0x42006000, 0xbf7fffff, 0x42006800, - 0x00018000, 0x0401f950, 0x42006000, 0xfffeffff, - 0x41786800, 0x0401f94c, 0x497b504e, 0x42000800, - 0x0000002d, 0x42001000, 0x001041bc, 0x0201f000, - 0x00105f69, 0x4807c856, 0x0401ffe3, 0x497b5014, - 0x497b5016, 0x1c01f000, 0x4807c856, 0x59a80005, - 0x8c000506, 0x1c01f000, 0x4807c856, 0x42006000, - 0xffffffff, 0x42006800, 0x00000028, 0x0401f136, - 0x4807c856, 0x0401ffc2, 0x0201f800, 0x00106c55, - 0x4df00000, 0x0201f800, 0x00106e21, 0x5c03e000, - 0x02000800, 0x00106c4b, 0x59c400a4, 0x82000500, - 0x0000000f, 0x82000580, 0x00000002, 0x0402000a, - 0x42006000, 0xffffffff, 0x42006800, 0x00200000, - 0x0401f921, 0x42006000, 0xffdfffff, 0x41786800, - 0x0401f91d, 0x497b5014, 0x42000800, 0x000000f7, - 0x0401f89c, 0x59c400a3, 0x82000500, 0xbf20bfff, - 0x82000540, 0x0001c000, 0x480388a3, 0x84000520, - 0x480388a3, 0x1c01f000, 0x497b5016, 0x59b400f5, - 0x8c000500, 0x04020004, 0x82000540, 0x00000001, - 0x480368f5, 0x800400c4, 0x82000400, 0x00002000, - 0x4803910a, 0x59b400f6, 0x82000500, 0x00000018, - 0x040207fd, 0x4a0368f0, 0x0010b54b, 0x42000000, - 0x0010b552, 0x480368f1, 0x82040400, 0x0000dc00, - 0x480368f3, 0x59c400a4, 0x82000500, 0x0000000f, - 0x82000580, 0x00000008, 0x04020017, 0x4c5c0000, - 0x4c600000, 0x59c4b805, 0x8c5cbd3a, 0x04020005, - 0x42000000, 0x0010b818, 0x0201f800, 0x0010aa47, - 0x4a038805, 0x02000000, 0x0201f800, 0x001019fe, - 0x4000c000, 0x0201f800, 0x00101963, 0x4202d800, - 0x00000001, 0x497b5014, 0x5c00c000, 0x5c00b800, - 0x1c01f000, 0x59c8010b, 0x8c000502, 0x040007e2, - 0x59c408a4, 0x82040d00, 0x0000000f, 0x82040d80, - 0x0000000b, 0x04020005, 0x59a80814, 0x82040d40, - 0x00002000, 0x0401f004, 0x59a80812, 0x82040d40, - 0x00001000, 0x4807504e, 0x59a8084a, 0x800409c0, - 0x04020007, 0x42000800, 0x000007d0, 0x42001000, - 0x00104148, 0x0201f800, 0x0010606e, 0x1c01f000, - 0x4807c856, 0x0401ff4e, 0x0201f800, 0x00106c55, - 0x4df00000, 0x0201f800, 0x00106e21, 0x5c03e000, - 0x02000800, 0x00106c4b, 0x59c400a4, 0x82000500, - 0x0000000f, 0x82000580, 0x00000002, 0x0402000a, - 0x42006000, 0xffffffff, 0x42006800, 0x00200000, - 0x0401f8ad, 0x42006000, 0xffdfffff, 0x41786800, - 0x0401f8a9, 0x0201f800, 0x00105141, 0x04000014, - 0x0201f800, 0x00105151, 0x04020011, 0x4a035032, - 0x0000aaaa, 0x4c040000, 0x0201f800, 0x0010162a, - 0x59a8002a, 0x82000500, 0xffff0000, 0x80040540, - 0x4803502a, 0x5c000800, 0x4a035033, 0x00000000, - 0x0201f800, 0x001050a2, 0x0401f008, 0x4a03504c, - 0x00000005, 0x42000000, 0x00000001, 0x0201f800, - 0x00101590, 0x0401ff2c, 0x1c01f000, 0x0401f805, - 0x42006000, 0xbf7f7fff, 0x41786800, 0x0401f086, - 0x0201f800, 0x00105151, 0x04020005, 0x59c40006, - 0x82000540, 0x000000f0, 0x48038806, 0x1c01f000, - 0x800408d0, 0x59a80015, 0x8c000506, 0x04000006, - 0x59a80010, 0x82000500, 0x000000ff, 0x80040540, - 0x0401f003, 0x82040540, 0x000000f7, 0x480388a7, - 0x1c01f000, 0x4807c856, 0x42000000, 0x0010b83b, - 0x0201f800, 0x0010aa47, 0x42003000, 0x00000005, - 0x4d3c0000, 0x4c180000, 0x42003000, 0x0000000d, - 0x42027800, 0x00000002, 0x0401f038, 0x4807c856, - 0x42000000, 0x0010b86b, 0x0201f800, 0x0010aa47, - 0x42003000, 0x00000000, 0x4d3c0000, 0x4c180000, - 0x42003000, 0x0000000f, 0x42027800, 0x00000002, - 0x0401f02a, 0x4807c856, 0x42000000, 0x0010b86a, - 0x0201f800, 0x0010aa47, 0x42003000, 0x00000003, - 0x4d3c0000, 0x4c180000, 0x42003000, 0x0000000e, - 0x42027800, 0x00000202, 0x0401f01c, 0x4807c856, - 0x42000000, 0x0010b869, 0x0201f800, 0x0010aa47, - 0x42003000, 0x00000004, 0x4d3c0000, 0x4c180000, - 0x42003000, 0x00000010, 0x42027800, 0x00000202, - 0x0401f00e, 0x4807c856, 0x42000000, 0x0010b83e, - 0x0201f800, 0x0010aa47, 0x42003000, 0x00000001, - 0x4d3c0000, 0x4c180000, 0x42003000, 0x0000000c, - 0x42027800, 0x00000202, 0x42001800, 0x0000ffff, - 0x42002000, 0x00000007, 0x0201f800, 0x00103aae, - 0x5c003000, 0x4d400000, 0x0201f800, 0x0010a95d, - 0x42028000, 0x0000002a, 0x0201f800, 0x00101fe5, - 0x5c028000, 0x5c027800, 0x1c01f000, 0x4807c856, - 0x04011000, 0x4a03c840, 0x0010b54b, 0x4a03c842, - 0x00000040, 0x40000000, 0x040117ff, 0x42007800, - 0x0010b54b, 0x46007800, 0x00000011, 0x803c7800, - 0x4a007800, 0x220000ef, 0x4a007801, 0x000000ef, - 0x4a007802, 0x01380000, 0x4a007803, 0x00000000, - 0x4a007804, 0xffffffff, 0x4a007805, 0x00000000, - 0x1c01f000, 0x59c400a3, 0x80300500, 0x80340540, - 0x480388a3, 0x1c01f000, 0x4833c857, 0x59c400a3, - 0x80300540, 0x480388a3, 0x80300580, 0x480388a3, - 0x1c01f000, 0x4803c856, 0x04000004, 0x4a03504b, - 0x00000001, 0x0401f002, 0x497b504b, 0x1c01f000, - 0x4803c856, 0x59c80002, 0x80000540, 0x0400000a, - 0x80000040, 0x04000008, 0x4a039005, 0x00000140, - 0x42000000, 0x00000006, 0x80000040, 0x040207ff, - 0x0401f7f4, 0x1c01f000, 0x4c5c0000, 0x4c600000, - 0x59c4b805, 0x485fc856, 0x8c5cbd3a, 0x04020005, - 0x42000000, 0x0010b818, 0x0201f800, 0x0010aa47, - 0x4a038805, 0x02000000, 0x0201f800, 0x001019fe, - 0x4000c000, 0x0201f800, 0x00101963, 0x4a038805, - 0x04000000, 0x5c00c000, 0x5c00b800, 0x1c01f000, - 0x497a6a00, 0x4937c857, 0x4a026c00, 0x00000707, - 0x497a6801, 0x497a6808, 0x497a6809, 0x497a6806, - 0x497a6807, 0x497a6c0b, 0x497a680c, 0x0201f800, - 0x00103b25, 0x04020006, 0x5934080f, 0x59340010, - 0x80040540, 0x02020800, 0x001005d8, 0x4a026a04, - 0x00000100, 0x497a6a03, 0x59340402, 0x82000500, - 0x000000ff, 0x48026c02, 0x497a6c04, 0x497a6a05, - 0x497a6c05, 0x497a6811, 0x4d2c0000, 0x5934000d, - 0x49466c03, 0x80025d40, 0x04000004, 0x0201f800, - 0x001007fd, 0x497a680d, 0x5c025800, 0x599c0401, - 0x48026a0b, 0x599c0208, 0x48026c12, 0x497a680a, - 0x0201f000, 0x00104c62, 0x42000000, 0x00000005, - 0x80000d80, 0x0401f02d, 0x0201f800, 0x00104a09, - 0x04020017, 0x59a80026, 0x8c00050a, 0x04020010, - 0x59340212, 0x82000500, 0x0000ff00, 0x4803c857, - 0x0400000b, 0x59340a00, 0x8c040d1e, 0x02000000, - 0x000201c4, 0x42000000, 0x00000029, 0x42000800, - 0x00001000, 0x492fc857, 0x0401f018, 0x492fc857, - 0x42000000, 0x00000028, 0x0401f012, 0x59a80805, - 0x8c040d02, 0x04020003, 0x8c040d00, 0x04000004, - 0x42000000, 0x00000004, 0x0401f00a, 0x42000000, - 0x00000029, 0x59340a00, 0x8c040d1e, 0x04000005, - 0x492fc857, 0x42000800, 0x00001000, 0x0401f003, - 0x492fc857, 0x80000d80, 0x4803c857, 0x80028540, - 0x1c01f000, 0x4803c857, 0x59a80005, 0x8c000500, - 0x040207ec, 0x0201f800, 0x001049e7, 0x040207e4, - 0x59340200, 0x8c00050e, 0x040007e1, 0x0201f000, - 0x000201c4, 0x0201f800, 0x001047eb, 0x040007bf, - 0x0201f000, 0x000201c8, 0x592c0206, 0x492fc857, - 0x82000d80, 0x000007ff, 0x04020006, 0x4a025c0a, - 0x00000030, 0x42026800, 0x0010b524, 0x0401f021, - 0x82000c80, 0x000007f0, 0x04021046, 0x81ac0400, - 0x50000000, 0x80026d40, 0x04000038, 0x0201f800, - 0x001048e3, 0x04020038, 0x592c040a, 0x8c00050a, - 0x04020014, 0x592e6009, 0x83300480, 0x0010d1c0, - 0x0400103b, 0x41580000, 0x81300480, 0x04021038, - 0x59300c06, 0x82040580, 0x00000009, 0x04020037, - 0x4a025a06, 0x00000000, 0x497a5800, 0x59300008, - 0x80000540, 0x04020018, 0x492e6008, 0x0401f010, - 0x0201f800, 0x0002075a, 0x04000019, 0x592c0206, - 0x49366009, 0x492e6008, 0x4a026406, 0x00000009, - 0x497a6015, 0x49325809, 0x82000d80, 0x000007ff, - 0x04020003, 0x4a026015, 0x00008000, 0x42027000, - 0x00000043, 0x0201f800, 0x000207a1, 0x80000580, - 0x0401f020, 0x40000800, 0x58040000, 0x80000d40, - 0x040207fd, 0x492c0800, 0x0401f01a, 0x42000000, - 0x0000002c, 0x0401f016, 0x42000000, 0x00000028, - 0x0401f013, 0x59a80805, 0x82040500, 0x00000003, - 0x04000004, 0x42000000, 0x00000004, 0x0401f00c, - 0x42000000, 0x00000029, 0x0401f009, 0x42000000, - 0x00000008, 0x0401f006, 0x82040580, 0x00000007, - 0x040207fb, 0x42000000, 0x00000005, 0x80000540, - 0x1c01f000, 0x492fc857, 0x592e8c06, 0x83440d80, - 0x000007fc, 0x04000004, 0x83440480, 0x000007f0, - 0x04021014, 0x0201f800, 0x00020245, 0x04020011, - 0x0201f800, 0x001049f3, 0x04020011, 0x0201f800, - 0x0002075a, 0x0400001c, 0x49366009, 0x492e6008, - 0x4a026406, 0x0000000a, 0x42027000, 0x00000040, - 0x0201f800, 0x000207a1, 0x80000580, 0x0401f011, - 0x42000000, 0x00000028, 0x0401f00d, 0x0201f800, - 0x00104a09, 0x040007fb, 0x59a80805, 0x82040d00, - 0x00000003, 0x04000004, 0x42000000, 0x00000004, - 0x0401f003, 0x42000000, 0x00000029, 0x80000540, - 0x1c01f000, 0x42000000, 0x0000002c, 0x0401f7fc, - 0x492fc857, 0x592e8c06, 0x4947c857, 0x83440c80, - 0x00000800, 0x42000000, 0x0000000a, 0x04021176, - 0x592c4207, 0x4823c857, 0x82200500, 0x0000000f, - 0x0c01f001, 0x001043d5, 0x0010445d, 0x001044a9, - 0x001044b4, 0x001044bf, 0x001043d1, 0x001043d1, - 0x001043d1, 0x001044cf, 0x00104513, 0x00104530, - 0x001043d1, 0x001043d1, 0x001043d1, 0x001043d1, - 0x001043d1, 0x4803c857, 0x42000000, 0x0000000c, - 0x0401f15d, 0x592c1008, 0x82081500, 0x00ffffff, - 0x59a80010, 0x80084d80, 0x42000000, 0x00000010, - 0x04000155, 0x0201f800, 0x00104919, 0x04000036, - 0x4803c857, 0x82004d80, 0x0000001d, 0x0402001a, - 0x0201f800, 0x00105755, 0x59340405, 0x4c000000, - 0x0201f800, 0x001049e7, 0x5c000000, 0x04000004, - 0x8c20450a, 0x04000028, 0x80000580, 0x44002800, - 0x59340008, 0x48002802, 0x59340009, 0x48002801, - 0x59340006, 0x48002804, 0x59340007, 0x48002803, - 0x4200b000, 0x00000005, 0x0201f800, 0x0010955f, - 0x0401f166, 0x4803c857, 0x82004d80, 0x0000001a, - 0x04020003, 0x40101000, 0x0401f136, 0x4803c857, - 0x82004d80, 0x0000001b, 0x04020003, 0x40181000, - 0x0401f130, 0x4803c857, 0x82004d80, 0x0000001c, - 0x04000131, 0x82004d80, 0x00000019, 0x42000000, - 0x0000000a, 0x04000120, 0x42000000, 0x0000000a, - 0x04020137, 0x59a80005, 0x8c000514, 0x0400001b, - 0x0201f800, 0x001049e7, 0x04000018, 0x59340212, - 0x82000500, 0x0000ff00, 0x42001000, 0x00000010, - 0x0402000c, 0x42001000, 0x00000008, 0x59a80026, - 0x8c000506, 0x04020009, 0x59340002, 0x82000500, - 0x00ff0000, 0x82000580, 0x00ff0000, 0x04000007, - 0x0201f800, 0x00104c6d, 0x42000000, 0x0000001c, - 0x40181000, 0x04020107, 0x0201f800, 0x0002075a, - 0x04000111, 0x49366009, 0x492e6008, 0x4a026406, - 0x00000001, 0x8c20450a, 0x04000004, 0x592c0404, - 0x8400055c, 0x48025c04, 0x4c200000, 0x4d3c0000, - 0x42027800, 0x00001000, 0x0201f800, 0x0010203c, - 0x5c027800, 0x5c004000, 0x8c204512, 0x0400000b, - 0x599c0018, 0x8c000518, 0x04000008, 0x592c0009, - 0x82000500, 0x00000380, 0x5934080a, 0x80040d40, - 0x84040d54, 0x4806680a, 0x417a7800, 0x0401f914, - 0x42000800, 0x00000003, 0x0401f91b, 0x42027000, - 0x00000002, 0x0201f800, 0x000207a1, 0x80000580, - 0x0401f10a, 0x0201f800, 0x00020245, 0x040200ec, - 0x0201f800, 0x001049ed, 0x04000008, 0x0201f800, - 0x001049e7, 0x040200ec, 0x417a7800, 0x417a6000, - 0x0201f800, 0x001020a1, 0x59a80005, 0x8c000514, - 0x0400001b, 0x0201f800, 0x001049e7, 0x04000018, - 0x59340212, 0x82000500, 0x0000ff00, 0x42001000, - 0x00000010, 0x0402000c, 0x42001000, 0x00000008, - 0x59a80026, 0x8c000506, 0x04020009, 0x59340002, - 0x82000500, 0x00ff0000, 0x82000580, 0x00ff0000, - 0x04000007, 0x0201f800, 0x00104c6d, 0x42000000, - 0x0000001c, 0x40181000, 0x040200b2, 0x0201f800, - 0x0002075a, 0x040000bc, 0x5934080a, 0x8c204512, - 0x0400000c, 0x599c0018, 0x8c000518, 0x04000009, - 0x592c0009, 0x82000500, 0x00000380, 0x82041500, - 0xfffffc7f, 0x80080d40, 0x84040d54, 0x0401f002, - 0x84040d14, 0x4806680a, 0x49366009, 0x492e6008, - 0x4a026406, 0x00000001, 0x417a7800, 0x0401f8c8, - 0x42000800, 0x00000005, 0x0401f8cf, 0x42027000, - 0x00000003, 0x0201f800, 0x000207a1, 0x80000580, - 0x0401f0be, 0x0201f800, 0x00020245, 0x040200a0, - 0x0201f800, 0x001049fc, 0x040200a3, 0x0201f800, - 0x00109517, 0x04000094, 0x80000580, 0x0401f0b3, - 0x0201f800, 0x00020245, 0x04020095, 0x0201f800, - 0x001049fc, 0x04020098, 0x0201f800, 0x001090e6, - 0x04000089, 0x80000580, 0x0401f0a8, 0x0201f800, - 0x00020245, 0x0402008a, 0x83444d80, 0x000007fe, - 0x42000000, 0x0000000a, 0x0402006b, 0x0201f800, - 0x001049e7, 0x04020088, 0x0201f800, 0x0010952f, - 0x04000079, 0x80000580, 0x0401f098, 0x82200500, - 0x00000070, 0x04020005, 0x8c20450e, 0x42000000, - 0x0000000c, 0x0402005c, 0x8c20450a, 0x0400000d, - 0x4d3c0000, 0x42027800, 0x00001000, 0x8c20450e, - 0x04020002, 0x853e7d56, 0x82200500, 0x000000a0, - 0x0201f800, 0x001049d3, 0x5c027800, 0x0401f07f, - 0x0201f800, 0x00020245, 0x04020065, 0x8c204508, - 0x04000010, 0x4d3c0000, 0x42027800, 0x00001000, - 0x8c20450e, 0x04020002, 0x853e7d56, 0x82200500, - 0x00000090, 0x0201f800, 0x001049bb, 0x5c027800, - 0x42000000, 0x0000000a, 0x0402003b, 0x0401f06b, - 0x836c0580, 0x00000003, 0x42000800, 0x00000007, - 0x0402000f, 0x0201f800, 0x001049f3, 0x04000007, - 0x4c000000, 0x0201f800, 0x00104a1f, 0x5c000000, - 0x0400004d, 0x0401f05d, 0x0201f800, 0x001094c5, - 0x04000007, 0x80000580, 0x0401f05c, 0x0201f800, - 0x00104a1f, 0x04000051, 0x0401f054, 0x0201f800, - 0x00104a1f, 0x04000034, 0x0401f050, 0x0201f800, - 0x00020245, 0x04020036, 0x836c0580, 0x00000003, - 0x04020040, 0x8c204508, 0x04000006, 0x417a7800, - 0x417a6000, 0x0201f800, 0x001020a1, 0x0401f043, - 0x0201f800, 0x001049ed, 0x04000008, 0x0201f800, - 0x001049e7, 0x0402002c, 0x417a7800, 0x417a6000, - 0x0201f800, 0x001020a1, 0x480bc856, 0x0201f800, - 0x00109332, 0x04000018, 0x80000580, 0x0401f037, - 0x0401f7e3, 0x480bc857, 0x42000800, 0x00000019, - 0x40001000, 0x4200b000, 0x00000002, 0x0401f00a, - 0x480bc857, 0x40000800, 0x4200b000, 0x00000002, - 0x0401f005, 0x480bc857, 0x40000800, 0x4200b000, - 0x00000001, 0x480bc857, 0x42028000, 0x00000031, - 0x0401f020, 0x480bc857, 0x42000800, 0x00000003, - 0x4200b000, 0x00000001, 0x0401f7f7, 0x480bc857, - 0x42000800, 0x0000000a, 0x4200b000, 0x00000001, - 0x0401f7f1, 0x480bc857, 0x42000800, 0x00000009, - 0x40001000, 0x4200b000, 0x00000002, 0x0401f7ea, - 0x480bc857, 0x42000800, 0x00000007, 0x4200b000, - 0x00000001, 0x0401f7e4, 0x480bc857, 0x4200b000, - 0x00000001, 0x0401f7e0, 0x80028580, 0x4178b000, - 0x82000540, 0x00000001, 0x1c01f000, 0x4937c857, - 0x59326809, 0x59341200, 0x813e79c0, 0x04000003, - 0x84081540, 0x0401f002, 0x84081500, 0x480a6a00, - 0x1c01f000, 0x59326809, 0x5c000000, 0x4c000000, - 0x4803c857, 0x4937c857, 0x82040580, 0x00000006, - 0x04020004, 0x42000000, 0x00000606, 0x0401f021, - 0x82040580, 0x00000004, 0x04020004, 0x42000000, - 0x00000404, 0x0401f01b, 0x82040580, 0x00000007, - 0x42000000, 0x00000707, 0x04000016, 0x82040580, - 0x00000003, 0x42000000, 0x00000703, 0x04000011, - 0x82040580, 0x00000005, 0x42000000, 0x00000405, - 0x0400000c, 0x82040580, 0x00000009, 0x42000000, - 0x00000409, 0x04000007, 0x82040580, 0x0000000b, - 0x42000000, 0x0000070b, 0x02020800, 0x001005d8, - 0x4803c857, 0x48026c00, 0x82040d80, 0x00000006, - 0x04020005, 0x59341404, 0x800811c0, 0x02000800, - 0x001005d8, 0x1c01f000, 0x5c000000, 0x4c000000, - 0x4803c857, 0x4947c857, 0x481bc857, 0x83440480, - 0x00000800, 0x04021034, 0x83441400, 0x0010ac00, - 0x50080000, 0x80026d40, 0x04020011, 0x4c180000, - 0x4d2c0000, 0x0201f800, 0x001007d3, 0x412e6800, - 0x5c025800, 0x5c003000, 0x04000027, 0x45341000, - 0x497a680d, 0x497a6810, 0x497a680f, 0x497a680e, - 0x4c180000, 0x0401fcf3, 0x5c003000, 0x59340a12, - 0x4c040000, 0x0201f800, 0x0010513b, 0x5c000800, - 0x04000009, 0x82180500, 0x00ffff00, 0x04000008, - 0x59a81010, 0x82081500, 0x00ffff00, 0x80080580, - 0x04000003, 0x80000580, 0x0401f004, 0x82180500, - 0x000000ff, 0x800000d0, 0x80040d80, 0x04000003, - 0x4803c857, 0x48026a12, 0x59340002, 0x80180580, - 0x04000003, 0x481bc857, 0x481a6802, 0x80000580, - 0x1c01f000, 0x4803c856, 0x82000540, 0x00000001, - 0x0401f7fc, 0x4947c857, 0x83440480, 0x00000800, - 0x04021011, 0x83441400, 0x0010ac00, 0x50080000, - 0x80026d40, 0x0400000b, 0x0401fbf9, 0x0402000a, - 0x59a80005, 0x8c000502, 0x04000004, 0x59340200, - 0x8c00050e, 0x04000004, 0x82000540, 0x00000001, - 0x1c01f000, 0x80000580, 0x0401f7fe, 0x5c000000, - 0x4c000000, 0x4803c857, 0x4947c857, 0x4d2c0000, - 0x4d300000, 0x83440480, 0x00000800, 0x04021024, - 0x83441400, 0x0010ac00, 0x50080000, 0x80026d40, - 0x0400001b, 0x45781000, 0x5934000d, 0x80025d40, - 0x02020800, 0x001007fd, 0x59366011, 0x813261c0, - 0x0400000e, 0x4c640000, 0x5930c800, 0x59325808, - 0x0201f800, 0x00109037, 0x02020800, 0x001007fd, - 0x0201f800, 0x0002077d, 0x82666540, 0x00000000, - 0x040207f6, 0x5c00c800, 0x0201f800, 0x00104c62, - 0x41365800, 0x0201f800, 0x001007f5, 0x80000580, - 0x5c026000, 0x5c025800, 0x1c01f000, 0x82000540, - 0x00000001, 0x0401f7fb, 0x4937c857, 0x4c580000, - 0x59cc0001, 0x82000500, 0x00ffffff, 0x48026802, - 0x497a6c01, 0x497a6a01, 0x59340200, 0x84000502, - 0x48026a00, 0x0201f800, 0x0010513b, 0x04020017, - 0x59340403, 0x82000580, 0x000007fe, 0x04000005, - 0x59a80026, 0x8c00050a, 0x04020010, 0x0401f008, - 0x59cc0408, 0x8c000518, 0x0400000c, 0x59cc0009, - 0x48035035, 0x59cc000a, 0x48035036, 0x59cc0207, - 0x80000540, 0x04020003, 0x42000000, 0x00000001, - 0x48038893, 0x4803501e, 0x59cc0a09, 0x82040d00, - 0x00000010, 0x59cc0408, 0x82000500, 0x00000020, - 0x04000002, 0x84040d40, 0x5934000a, 0x82000500, - 0xffffffee, 0x80040540, 0x4802680a, 0x83cca400, - 0x0000000b, 0x8334ac00, 0x00000006, 0x4200b000, - 0x00000002, 0x0201f800, 0x0010ab17, 0x83cca400, - 0x0000000d, 0x8334ac00, 0x00000008, 0x4200b000, - 0x00000002, 0x0201f800, 0x0010ab17, 0x59cc0a18, - 0x82040480, 0x00000800, 0x0402100c, 0x82040480, - 0x00000400, 0x04001004, 0x42000800, 0x00000400, - 0x0401f006, 0x82040480, 0x00000200, 0x04001003, - 0x42000800, 0x00000200, 0x48066a04, 0x59340403, - 0x82000580, 0x000007fe, 0x04020003, 0x59cc0a08, - 0x48066a04, 0x42000800, 0x00000004, 0x59cc1207, - 0x800811c0, 0x04000005, 0x82080480, 0x00000004, - 0x04021002, 0x40080800, 0x48066c04, 0x5c00b000, - 0x1c01f000, 0x4937c857, 0x59a80026, 0x8c000508, - 0x04000004, 0x84000556, 0x4803c857, 0x48035026, - 0x59cc0207, 0x4803c857, 0x48026a05, 0x59cc020a, - 0x4803c857, 0x48026c05, 0x59341200, 0x599c0818, - 0x5934180a, 0x4807c857, 0x480bc857, 0x480fc857, - 0x59cc2006, 0x82102500, 0xff000000, 0x82102580, - 0x02000000, 0x04000007, 0x8c00050e, 0x04000009, - 0x8c0c1d14, 0x04000003, 0x8c0c1d0e, 0x04000005, - 0x8c040d18, 0x04000003, 0x8408154a, 0x0401f002, - 0x8408150a, 0x8c000510, 0x04000009, 0x8c0c1d14, - 0x04000003, 0x8c0c1d10, 0x04000005, 0x8c040d18, - 0x04000003, 0x8408154e, 0x0401f002, 0x8408150e, - 0x8c000512, 0x04000009, 0x8c0c1d14, 0x04000003, - 0x8c0c1d12, 0x04000005, 0x8c040d18, 0x04000003, - 0x8408155c, 0x0401f002, 0x8408151c, 0x480a6a00, - 0x1c01f000, 0x4803c856, 0x4c5c0000, 0x4d2c0000, - 0x4c580000, 0x5934000d, 0x80025d40, 0x04000029, - 0x592c0003, 0x82000480, 0x00000008, 0x0400100b, - 0x412cb800, 0x592c0001, 0x80025d40, 0x040207f9, - 0x0201f800, 0x001007e4, 0x04000037, 0x492fc857, - 0x492cb801, 0x0401f020, 0x832c0c00, 0x00000004, - 0x4200b000, 0x00000008, 0x50040000, 0x82000580, - 0xffffffff, 0x04020006, 0x80041000, 0x50080000, - 0x82000580, 0xffffffff, 0x04000007, 0x82040c00, - 0x00000002, 0x8058b040, 0x040207f4, 0x0201f800, - 0x001005d8, 0x45480800, 0x454c1000, 0x592c1803, - 0x800c1800, 0x480e5803, 0x480fc857, 0x0401f014, - 0x0201f800, 0x001007e4, 0x04000017, 0x492fc857, - 0x492e680d, 0x497a5802, 0x4a025803, 0x00000001, - 0x494a5804, 0x494e5805, 0x832c0c00, 0x00000006, - 0x4200b000, 0x0000000e, 0x46000800, 0xffffffff, - 0x80040800, 0x8058b040, 0x040207fc, 0x82000540, - 0x00000001, 0x5c00b000, 0x5c025800, 0x5c00b800, - 0x1c01f000, 0x80000580, 0x0401f7fb, 0x4803c856, - 0x4d3c0000, 0x4d2c0000, 0x5934000d, 0x80025d40, - 0x0400001f, 0x592c0002, 0x80000540, 0x0402001f, - 0x412e7800, 0x0401f8ce, 0x0402001c, 0x46000800, - 0xffffffff, 0x46001000, 0xffffffff, 0x4813c857, - 0x480fc857, 0x580c0003, 0x82000c80, 0x00000002, - 0x04021014, 0x480fc857, 0x400c0000, 0x812c0580, - 0x04020004, 0x580c0001, 0x4802680d, 0x0401f003, - 0x580c0001, 0x48002001, 0x400e5800, 0x0201f800, - 0x001007f4, 0x82000540, 0x00000001, 0x5c025800, - 0x5c027800, 0x1c01f000, 0x80000580, 0x0401f7fc, - 0x80000040, 0x48001803, 0x4803c857, 0x0401f7f6, - 0x0201f800, 0x00020086, 0x59300007, 0x8400054e, - 0x48026007, 0x592c1a04, 0x820c1d00, 0x000000ff, - 0x820c0580, 0x00000048, 0x04000013, 0x0201f000, - 0x0002028e, 0x8c000500, 0x02020800, 0x000200e5, - 0x4a026203, 0x00000002, 0x592c1a04, 0x820c1d00, - 0x000000ff, 0x820c0580, 0x00000018, 0x02000000, - 0x0002028e, 0x820c0580, 0x00000048, 0x02020000, - 0x0002028e, 0x42000800, 0x80000804, 0x0201f800, - 0x00106721, 0x0201f000, 0x00020297, 0x4a025a06, - 0x00000008, 0x0201f000, 0x000202da, 0x4a025a06, - 0x00000029, 0x0201f000, 0x000202da, 0x4a025a06, - 0x0000002a, 0x0201f000, 0x000202da, 0x4a025a06, - 0x00000028, 0x0201f000, 0x000202da, 0x4943c857, - 0x4d440000, 0x4d340000, 0x4d2c0000, 0x4c580000, - 0x4200b000, 0x000007f0, 0x417a8800, 0x0201f800, - 0x00020245, 0x0402000d, 0x8d3e7d14, 0x04000005, - 0x59340212, 0x82000500, 0x0000ff00, 0x04000007, - 0x8d3e7d06, 0x04000004, 0x59340200, 0x8c00050e, - 0x04020002, 0x0401f813, 0x81468800, 0x8058b040, - 0x040207ef, 0x83440480, 0x00000800, 0x04021008, - 0x8d3e7d02, 0x04000006, 0x42028800, 0x000007f0, - 0x4200b000, 0x00000010, 0x0401f7e5, 0x5c00b000, - 0x5c025800, 0x5c026800, 0x5c028800, 0x1c01f000, - 0x4d2c0000, 0x41783000, 0x5936580f, 0x812e59c0, - 0x04000029, 0x592c0204, 0x82000500, 0x000000ff, - 0x82000580, 0x00000012, 0x04000020, 0x8d3e7d00, - 0x04000003, 0x0401f83c, 0x0402001c, 0x592c2000, - 0x497a5800, 0x801831c0, 0x04020009, 0x59340010, - 0x812c0580, 0x04020004, 0x497a680f, 0x497a6810, - 0x0401f008, 0x4812680f, 0x0401f006, 0x48103000, - 0x59340010, 0x812c0580, 0x04020002, 0x481a6810, - 0x4a025a04, 0x00000103, 0x49425a06, 0x497a5c09, - 0x0201f800, 0x001091c6, 0x0201f800, 0x000202da, - 0x40125800, 0x0401f7da, 0x412c3000, 0x592e5800, - 0x0401f7d7, 0x5c025800, 0x1c01f000, 0x4803c856, - 0x41781800, 0x5934000f, 0x80025d40, 0x04000010, - 0x592c0005, 0x80200580, 0x592c0000, 0x04000003, - 0x412c1800, 0x0401f7f9, 0x497a5800, 0x800c19c0, - 0x04000008, 0x48001800, 0x80000540, 0x04020004, - 0x480e6810, 0x82000540, 0x00000001, 0x1c01f000, - 0x4802680f, 0x80000540, 0x040207fd, 0x497a6810, - 0x0401f7f9, 0x592c0008, 0x81480580, 0x04020003, - 0x592c0009, 0x814c0580, 0x1c01f000, 0x4803c856, - 0x4c580000, 0x413c1800, 0x400c2000, 0x593c0002, - 0x80000540, 0x04020018, 0x4200b000, 0x00000008, - 0x820c0c00, 0x00000004, 0x50040000, 0x81480580, - 0x04020005, 0x80041000, 0x50080000, 0x814c0580, - 0x0400000d, 0x82040c00, 0x00000002, 0x8058b040, - 0x040207f6, 0x400c2000, 0x580c0001, 0x80001d40, - 0x040207ee, 0x82000540, 0x00000001, 0x5c00b000, - 0x1c01f000, 0x80000580, 0x0401f7fd, 0x4937c857, - 0x4c580000, 0x4d2c0000, 0x5934000d, 0x80025d40, - 0x04020016, 0x0201f800, 0x001007e4, 0x04000010, - 0x492e680d, 0x4a025802, 0x00000001, 0x497a5803, - 0x832c0c00, 0x00000004, 0x4200b000, 0x00000010, - 0x46000800, 0xffffffff, 0x80040800, 0x8058b040, - 0x040207fc, 0x82000540, 0x00000001, 0x5c025800, - 0x5c00b000, 0x1c01f000, 0x4d2c0000, 0x592e5801, - 0x0201f800, 0x001007fd, 0x5c025800, 0x0401f7ea, - 0x4d2c0000, 0x5936580d, 0x812e59c0, 0x04000007, - 0x4937c857, 0x497a680d, 0x0201f800, 0x001007fd, - 0x82000540, 0x00000001, 0x5c025800, 0x1c01f000, - 0x59340405, 0x4937c857, 0x4803c857, 0x8c000508, - 0x1c01f000, 0x4803c856, 0x0201f800, 0x0010513b, - 0x04000011, 0x59a80815, 0x8c040d04, 0x0402000e, - 0x59a80826, 0x8c040d06, 0x0400000b, 0x83ac0400, - 0x000007fe, 0x50000000, 0x80026d40, 0x04000006, - 0x0401f9a7, 0x04020004, 0x59340200, 0x8400055a, - 0x48026a00, 0x599c0017, 0x8c000508, 0x04000015, - 0x4200b000, 0x000007f0, 0x417a8800, 0x0201f800, - 0x00020245, 0x0402000c, 0x0401f999, 0x0402000a, - 0x59a80010, 0x59340802, 0x80040580, 0x82000500, - 0x00ffff00, 0x04020004, 0x59340200, 0x8400055a, - 0x48026a00, 0x81468800, 0x8058b040, 0x040207f0, - 0x0401f884, 0x04000003, 0x59a80836, 0x0401f006, - 0x599c0017, 0x8c000508, 0x04000007, 0x42000800, - 0x000007d0, 0x42001000, 0x00104876, 0x0201f800, - 0x0010606e, 0x1c01f000, 0x4803c856, 0x4d340000, - 0x4d440000, 0x4d3c0000, 0x4c580000, 0x42001000, - 0x00104876, 0x0201f800, 0x00105f90, 0x59a80826, - 0x8c040d06, 0x04000015, 0x0401f86a, 0x04000013, - 0x83ae6c00, 0x000007fe, 0x51366800, 0x59340200, - 0x8400051a, 0x48026a00, 0x599c0017, 0x8c000508, - 0x04000007, 0x42000800, 0x000007d0, 0x42001000, - 0x00104876, 0x0201f800, 0x0010606e, 0x0201f800, - 0x00101e45, 0x0401f027, 0x4200b000, 0x000007f0, - 0x80028d80, 0x0201f800, 0x00020245, 0x0402001e, - 0x59340200, 0x8c00051a, 0x0400001b, 0x59368c03, - 0x417a7800, 0x42028000, 0x00000029, 0x41783000, - 0x0201f800, 0x0010a446, 0x59340200, 0x84000558, - 0x8400051a, 0x48026a00, 0x4937c857, 0x4a026c00, - 0x00000707, 0x42028000, 0x00000029, 0x0201f800, - 0x00106ab4, 0x417a7800, 0x0201f800, 0x001067fd, - 0x80000d80, 0x0201f800, 0x0010a2ff, 0x0201f800, - 0x00106c4b, 0x81468800, 0x8058b040, 0x040207de, - 0x5c00b000, 0x5c027800, 0x5c028800, 0x5c026800, - 0x1c01f000, 0x4933c857, 0x59303809, 0x581c0200, - 0x8400051a, 0x48003a00, 0x1c01f000, 0x4803c856, - 0x42026800, 0x0010b524, 0x497a680e, 0x42028800, - 0x000007ff, 0x0201f800, 0x001042b4, 0x4937c857, - 0x4a026c00, 0x00000606, 0x4a026802, 0x00ffffff, - 0x4a026a04, 0x00000200, 0x4a026c04, 0x00000002, - 0x1c01f000, 0x59300009, 0x50000000, 0x4933c857, - 0x4803c857, 0x8c00050e, 0x1c01f000, 0x59300009, - 0x50000000, 0x8c00050a, 0x1c01f000, 0x4933c856, - 0x0401f90f, 0x04000006, 0x59340400, 0x82000d00, - 0x000000ff, 0x82041580, 0x00000005, 0x1c01f000, - 0x4d340000, 0x83ac0400, 0x000007fe, 0x50000000, - 0x80026d40, 0x04000003, 0x59340200, 0x8c00051a, - 0x5c026800, 0x1c01f000, 0x4937c857, 0x493fc857, - 0x59340403, 0x81ac0400, 0x50000000, 0x81340580, - 0x02020800, 0x001005d8, 0x59341200, 0x813e79c0, - 0x04000003, 0x8408155e, 0x0401f002, 0x8408151e, - 0x480a6a00, 0x1c01f000, 0x4937c857, 0x0201f800, - 0x0010210a, 0x04000006, 0x59a80835, 0x42001000, - 0x00104910, 0x0201f800, 0x0010606e, 0x1c01f000, - 0x4937c857, 0x42001000, 0x00104910, 0x0201f800, - 0x00105f90, 0x59a81026, 0x84081512, 0x480b5026, - 0x1c01f000, 0x4c380000, 0x4c340000, 0x4c240000, - 0x4c600000, 0x4008c000, 0x83440480, 0x00000800, - 0x04021045, 0x80002d80, 0x41442000, 0x83447400, - 0x0010ac00, 0x4200b000, 0x000007f0, 0x83444c80, - 0x000007f0, 0x04001003, 0x4200b000, 0x00000010, - 0x50380000, 0x80000540, 0x0402001e, 0x41440000, - 0x80100580, 0x04020043, 0x40102800, 0x82104c80, - 0x000007f0, 0x04001015, 0x82104d80, 0x000007fc, - 0x04020005, 0x82604d80, 0x00fffffc, 0x0402002a, - 0x0401f00e, 0x82104d80, 0x000007fd, 0x04020005, - 0x82604d80, 0x00fffffd, 0x04020023, 0x0401f007, - 0x82104d80, 0x000007ff, 0x0402001f, 0x82604d80, - 0x00ffffff, 0x0402001c, 0x84142d5e, 0x0401f029, - 0x40006800, 0x58343002, 0x82183500, 0x00ffffff, - 0x40180000, 0x80600580, 0x04020019, 0x40100000, - 0x81440580, 0x0402000a, 0x40366800, 0x8c204508, - 0x04000053, 0x0401ff8a, 0x04020051, 0x4947c857, - 0x42000000, 0x0000001d, 0x0401f04e, 0x4947c857, - 0x480bc857, 0x4823c857, 0x42000000, 0x0000001a, - 0x0401f048, 0x4947c857, 0x4863c857, 0x4813c857, - 0x42000000, 0x00000019, 0x0401f042, 0x40100000, - 0x81440580, 0x04020007, 0x58343002, 0x4947c857, - 0x481bc857, 0x42000000, 0x0000001b, 0x0401f039, - 0x80102000, 0x80387000, 0x83444c80, 0x000007f0, - 0x04001009, 0x82104d80, 0x00000800, 0x0402000c, - 0x42002000, 0x000007f0, 0x42007000, 0x0010b3f0, - 0x0401f007, 0x82104d80, 0x000007f0, 0x04020004, - 0x41782000, 0x42007000, 0x0010ac00, 0x8058b040, - 0x040207a4, 0x801429c0, 0x04020007, 0x0201f800, - 0x001005d8, 0x4947c857, 0x42000000, 0x0000000a, - 0x0401f01c, 0x4d2c0000, 0x4c180000, 0x40603000, - 0x0401fc12, 0x4947c857, 0x4937c857, 0x5c003000, - 0x5c025800, 0x040207f4, 0x497a6a12, 0x59a80026, - 0x8c00050a, 0x0402000d, 0x82600500, 0x00ffff00, - 0x04000006, 0x59a84810, 0x82244d00, 0x00ffff00, - 0x80240580, 0x04020005, 0x82600500, 0x000000ff, - 0x800000d0, 0x48026a12, 0x48626802, 0x80000580, - 0x80000540, 0x5c00c000, 0x5c004800, 0x5c006800, - 0x5c007000, 0x1c01f000, 0x5934000f, 0x5934140b, - 0x80081040, 0x04001002, 0x480a6c0b, 0x80000540, - 0x02020800, 0x00020253, 0x1c01f000, 0x4803c857, - 0x4947c857, 0x4c300000, 0x82006500, 0x00000030, - 0x04000006, 0x4c000000, 0x0201f800, 0x0010942a, - 0x5c000000, 0x0402000b, 0x8c00050e, 0x04000006, - 0x0201f800, 0x00020245, 0x04020006, 0x4937c857, - 0x0401fc2f, 0x80000580, 0x5c006000, 0x1c01f000, - 0x82000540, 0x00000001, 0x0401f7fc, 0x4803c857, - 0x4c580000, 0x4d440000, 0x40001000, 0x80000d80, - 0x4200b000, 0x000007f0, 0x4c040000, 0x40068800, - 0x4c080000, 0x40080000, 0x0401ffdd, 0x5c001000, - 0x5c000800, 0x80040800, 0x8058b040, 0x040207f7, - 0x5c028800, 0x5c00b000, 0x1c01f000, 0x4c5c0000, - 0x59340400, 0x8200bd80, 0x00000606, 0x5c00b800, - 0x1c01f000, 0x4c5c0000, 0x59340400, 0x8200bd80, - 0x00000404, 0x5c00b800, 0x1c01f000, 0x4c5c0000, - 0x59340400, 0x8200bd80, 0x00000404, 0x04000003, - 0x8200bd80, 0x00000606, 0x5c00b800, 0x1c01f000, - 0x4c5c0000, 0x4c600000, 0x59340400, 0x8200bd00, - 0x0000ff00, 0x825cc580, 0x00000400, 0x04000003, - 0x825cc580, 0x00000600, 0x5c00c000, 0x5c00b800, - 0x1c01f000, 0x4c5c0000, 0x59340400, 0x82000500, - 0x000000ff, 0x8200bd80, 0x00000003, 0x04000003, - 0x8200bd80, 0x00000005, 0x5c00b800, 0x1c01f000, - 0x4c5c0000, 0x59340400, 0x82000500, 0x0000ff00, - 0x8400b9c0, 0x805c0580, 0x4937c857, 0x4803c857, - 0x48026c00, 0x5c00b800, 0x1c01f000, 0x4c040000, - 0x4c080000, 0x592c0207, 0x8c00050c, 0x0400000f, - 0x592e8c06, 0x82000500, 0x00000080, 0x84000548, - 0x4d3c0000, 0x42027800, 0x00001000, 0x0401ff90, - 0x5c027800, 0x82000540, 0x00000001, 0x5c001000, - 0x5c000800, 0x1c01f000, 0x80000580, 0x0401f7fc, - 0x592c040b, 0x82000500, 0x0000e000, 0x82000580, - 0x00006000, 0x04000019, 0x836c0580, 0x00000003, - 0x04000016, 0x836c0580, 0x00000002, 0x040200ff, - 0x59a80026, 0x82000d00, 0x00000038, 0x04020005, - 0x59a80832, 0x800409c0, 0x0400000c, 0x0401f0f7, - 0x82000d00, 0x00000003, 0x82040d80, 0x00000003, - 0x040200f2, 0x82000d00, 0x00000028, 0x04020003, - 0x8c00050c, 0x040000ed, 0x592c100a, 0x82080500, - 0xff000000, 0x040200ce, 0x59a80010, 0x80080580, - 0x040000c8, 0x592c0c0b, 0x82040d00, 0x0000e000, - 0x82040480, 0x00008000, 0x040210c8, 0x592e8c06, - 0x83440480, 0x00000800, 0x04001007, 0x83440580, - 0x0000ffff, 0x040200af, 0x800409c0, 0x040200f7, - 0x0401f0ac, 0x800409c0, 0x040200f4, 0x41784000, - 0x0401fead, 0x040200db, 0x42027000, 0x00000053, - 0x592c2409, 0x82100500, 0xffffff00, 0x040200aa, - 0x4813c857, 0x592c000c, 0x800001c0, 0x04000083, - 0x82100580, 0x00000004, 0x040000a0, 0x82100580, - 0x00000051, 0x0400009d, 0x82100580, 0x00000003, - 0x04000016, 0x82100580, 0x00000020, 0x0400004b, - 0x82100580, 0x00000024, 0x04000042, 0x82100580, - 0x00000021, 0x04000042, 0x82100580, 0x00000050, - 0x04000037, 0x82100580, 0x00000052, 0x04000031, - 0x82100580, 0x00000005, 0x0402006b, 0x42027000, - 0x00000001, 0x0401f01b, 0x42027000, 0x00000002, - 0x59a80005, 0x8c000514, 0x04000016, 0x0401ff4c, - 0x04000014, 0x59340212, 0x82000500, 0x0000ff00, - 0x42001000, 0x00000010, 0x0402000c, 0x59a80026, - 0x8c000506, 0x0402006f, 0x42001000, 0x00000008, - 0x59340002, 0x82000500, 0x00ff0000, 0x82000580, - 0x00ff0000, 0x04000003, 0x0401f9bf, 0x04020065, - 0x0201f800, 0x0002075a, 0x0400007e, 0x4a026406, - 0x00000010, 0x49366009, 0x42000800, 0x00000003, - 0x83380580, 0x00000002, 0x04000003, 0x42000800, - 0x0000000b, 0x0201f800, 0x00104571, 0x0401f044, - 0x42027000, 0x00000000, 0x0401f003, 0x42027000, - 0x00000004, 0x0401ff37, 0x04020071, 0x0401f036, - 0x42027000, 0x00000033, 0x0401f006, 0x42027000, - 0x00000005, 0x0401f003, 0x42027000, 0x00000003, - 0x0401ff23, 0x04020066, 0x59a80005, 0x8c000514, - 0x04000016, 0x0401ff12, 0x04000014, 0x59340212, - 0x82000500, 0x0000ff00, 0x42001000, 0x00000010, - 0x0402000c, 0x59a80026, 0x8c000506, 0x04020035, - 0x42001000, 0x00000008, 0x59340002, 0x82000500, - 0x00ff0000, 0x82000580, 0x00ff0000, 0x04000003, - 0x0401f985, 0x0402002b, 0x0201f800, 0x0002075a, - 0x04000044, 0x4a026406, 0x00000010, 0x49366009, - 0x42000800, 0x00000005, 0x83380580, 0x00000003, - 0x04000003, 0x42000800, 0x00000009, 0x0201f800, - 0x00104571, 0x0401f00a, 0x82102580, 0x00000011, - 0x0402002d, 0x0201f800, 0x0002075a, 0x04000031, - 0x4a026406, 0x00000010, 0x49366009, 0x492e6008, - 0x49325808, 0x813669c0, 0x04000007, 0x592c0c0b, - 0x8c040d18, 0x04000004, 0x59340200, 0x84000514, - 0x48026a00, 0x0201f800, 0x000207a1, 0x80000580, - 0x1c01f000, 0x82000540, 0x00000001, 0x0401f7fd, - 0x42001000, 0x0000000a, 0x0401f015, 0x42001000, - 0x00000010, 0x0401f012, 0x42001000, 0x00000016, - 0x0401f00f, 0x42001000, 0x00000017, 0x0401f00c, - 0x42001000, 0x00000018, 0x0401f009, 0x42001000, - 0x0000001b, 0x0401f006, 0x42001000, 0x0000001e, - 0x0401f003, 0x42001000, 0x00000020, 0x42000800, - 0x00000019, 0x42028000, 0x00000031, 0x0401f7e2, - 0x42000800, 0x00000003, 0x0401f003, 0x42000800, - 0x0000000a, 0x41781000, 0x0401f7f7, 0x42000800, - 0x00000009, 0x59341400, 0x0401f7f3, 0x42028000, - 0x00000008, 0x0401f005, 0x42000800, 0x00000007, - 0x416c1000, 0x0401f7ec, 0x41780800, 0x41781000, - 0x0401f7cd, 0x42028000, 0x00000000, 0x0401f7fb, - 0x82004d80, 0x0000001d, 0x02000800, 0x001005d8, - 0x82004d80, 0x0000001a, 0x04020004, 0x40101000, - 0x40000800, 0x0401f7dc, 0x82004d80, 0x0000001b, - 0x04020003, 0x40181000, 0x0401f7fa, 0x82004d80, - 0x0000001c, 0x040007f7, 0x82004d80, 0x00000019, - 0x040007b8, 0x0401f7d6, 0x592e6008, 0x0201f800, - 0x0010941a, 0x040007b6, 0x59300c06, 0x82040580, - 0x00000011, 0x040207d6, 0x83440580, 0x0000ffff, - 0x04020005, 0x59326809, 0x813669c0, 0x0400000e, - 0x0401f7cf, 0x592c100a, 0x82081500, 0x00ffffff, - 0x41784000, 0x0401fda8, 0x040207d6, 0x59300009, - 0x800001c0, 0x04000003, 0x81340580, 0x040207c4, - 0x49366009, 0x592c0c0b, 0x82041500, 0x0000e000, - 0x82080580, 0x00006000, 0x04000009, 0x59300a03, - 0x82040580, 0x00000007, 0x040207b9, 0x492e6008, - 0x42027000, 0x00000054, 0x0401f77f, 0x0201f800, - 0x0010a8d4, 0x040007bc, 0x0401f7b1, 0x492fc857, - 0x59a80021, 0x800001c0, 0x04020073, 0x592e6008, - 0x4933c857, 0x0201f800, 0x0010941a, 0x04000041, - 0x59301406, 0x82080580, 0x00000005, 0x0402005b, - 0x59301203, 0x82080580, 0x00000007, 0x04020057, - 0x592e8c06, 0x83440480, 0x00000800, 0x04021032, - 0x41784000, 0x592c1009, 0x82081500, 0x00ffffff, - 0x0401fd75, 0x0402005f, 0x59300009, 0x800001c0, - 0x04000003, 0x81340580, 0x04020048, 0x4d300000, - 0x592e6013, 0x4933c857, 0x83300580, 0xffffffff, - 0x0400000d, 0x0201f800, 0x0010941a, 0x5c026000, - 0x04000029, 0x591c1406, 0x82080580, 0x00000006, - 0x04000046, 0x82080580, 0x00000011, 0x04000043, - 0x0401f002, 0x5c026000, 0x59a80010, 0x592c100a, - 0x82081500, 0x00ffffff, 0x80081580, 0x04020017, - 0x592c1009, 0x82081500, 0x00ffffff, 0x80081580, - 0x0400000f, 0x49366009, 0x492e6008, 0x42027000, - 0x00000092, 0x0201f800, 0x000207a1, 0x80000580, - 0x1c01f000, 0x42001000, 0x0000000a, 0x0401f00c, - 0x42001000, 0x00000010, 0x0401f009, 0x42001000, - 0x00000014, 0x0401f006, 0x42001000, 0x00000018, - 0x0401f003, 0x42001000, 0x0000003c, 0x492fc857, - 0x480bc857, 0x42000800, 0x00000019, 0x42028000, - 0x00000031, 0x82000540, 0x00000001, 0x0401f7e9, - 0x492fc857, 0x4803c857, 0x480bc857, 0x40000800, - 0x0401f7f7, 0x492fc857, 0x42000800, 0x0000000a, - 0x41781000, 0x0401f7f2, 0x4933c857, 0x59300406, - 0x4803c857, 0x59300203, 0x4803c857, 0x59300009, - 0x4803c857, 0x42028000, 0x00000008, 0x41780800, - 0x41781000, 0x0401f7e8, 0x42000800, 0x0000001e, - 0x0401f7f0, 0x42000800, 0x00000001, 0x0401f7ed, - 0x82004d80, 0x0000001d, 0x02000800, 0x001005d8, - 0x82004d80, 0x0000001a, 0x04020003, 0x40101000, - 0x0401f7dc, 0x82004d80, 0x0000001b, 0x04020003, - 0x40181000, 0x0401f7d7, 0x82004d80, 0x0000001c, - 0x040007d4, 0x82004d80, 0x00000019, 0x040007d1, - 0x0401f7d5, 0x59302009, 0x801021c0, 0x04000035, - 0x58101400, 0x82081d00, 0x000000ff, 0x59300c03, - 0x82040580, 0x00000008, 0x04000022, 0x82040580, - 0x0000000a, 0x04000017, 0x82040580, 0x0000000c, - 0x04000010, 0x82040580, 0x00000002, 0x04000019, - 0x82040580, 0x00000001, 0x04000012, 0x82040580, - 0x00000003, 0x0400000b, 0x82040580, 0x00000005, - 0x04000004, 0x82040580, 0x00000033, 0x04020019, - 0x820c0580, 0x00000009, 0x0400000d, 0x0401f015, - 0x820c0580, 0x00000005, 0x04000009, 0x0401f011, - 0x820c0580, 0x0000000b, 0x04000005, 0x0401f00d, - 0x820c0580, 0x00000003, 0x0402000a, 0x82081d00, - 0xffffff00, 0x840c01c0, 0x800c0540, 0x4813c857, - 0x480bc857, 0x4807c857, 0x4803c857, 0x48002400, - 0x1c01f000, 0x599c0017, 0x8c00050a, 0x04000003, - 0x80000580, 0x1c01f000, 0x59a80026, 0x82000500, - 0x00000028, 0x04000008, 0x42028800, 0x000007fd, - 0x0201f800, 0x00020245, 0x04020003, 0x5934000a, - 0x8c000504, 0x1c01f000, 0x4d300000, 0x5934000e, - 0x80026540, 0x04000006, 0x0201f800, 0x001062d5, - 0x02000800, 0x001064ad, 0x497a680e, 0x5c026000, - 0x1c01f000, 0x4d440000, 0x4d340000, 0x80000580, - 0x40001800, 0x40028800, 0x82080580, 0x00000008, - 0x04020003, 0x42001800, 0x00000001, 0x0201f800, - 0x00020245, 0x0402000a, 0x0401fd6d, 0x04020008, - 0x800c19c0, 0x04000004, 0x59340405, 0x8c000508, - 0x04000003, 0x80081040, 0x04000009, 0x81468800, - 0x83440480, 0x00000800, 0x040017f1, 0x80000580, - 0x5c026800, 0x5c028800, 0x1c01f000, 0x82000540, - 0x00000001, 0x5c026800, 0x5c028800, 0x1c01f000, - 0x4a033020, 0x00000000, 0x497b3026, 0x497b3027, - 0x497b3028, 0x497b3029, 0x497b302b, 0x497b3021, - 0x4a03b104, 0x60000001, 0x1c01f000, 0x4803c856, - 0x599c0018, 0x497b3024, 0x497b3025, 0x82000500, - 0x0000000f, 0x82000d80, 0x00000005, 0x04000006, - 0x82000580, 0x00000006, 0x0400000d, 0x497b3022, - 0x1c01f000, 0x4a033022, 0x00000005, 0x599c0216, - 0x82000500, 0x0000ffff, 0x04020003, 0x42000000, - 0x00000002, 0x48033023, 0x1c01f000, 0x4a033022, - 0x00000006, 0x0401f7f6, 0x0401ffe5, 0x4a03c826, - 0x00000004, 0x599c0209, 0x80000540, 0x0400001f, - 0x599c0207, 0x80000540, 0x04000007, 0x800000cc, - 0x599c080d, 0x80040400, 0x4803b100, 0x497bb102, - 0x59d80101, 0x599c000d, 0x4803b100, 0x599c000e, - 0x4803b101, 0x599c0207, 0x80000540, 0x04020002, - 0x497bb102, 0x599c0a09, 0x82040540, 0x00400000, - 0x59980822, 0x4803b103, 0x4a03b109, 0x00000004, - 0x4a03b104, 0x10000001, 0x800409c0, 0x04020004, - 0x4a033020, 0x00000001, 0x1c01f000, 0x4a033020, - 0x00000002, 0x0401f7fd, 0x59980022, 0x4803c856, - 0x80000540, 0x02000000, 0x000202de, 0x0401f017, - 0x42034000, 0x0010b4a4, 0x59a1d81e, 0x80edd9c0, - 0x02000800, 0x001005d8, 0x58ec0009, 0x48efc857, - 0x49a3c857, 0x492fc857, 0x4803c857, 0x800001c0, - 0x08020000, 0x0201f800, 0x001005d8, 0x5931d821, - 0x58ef400b, 0x58ec0009, 0x800001c0, 0x08020000, - 0x0201f800, 0x001005d8, 0x497a5800, 0x59980026, - 0x80000540, 0x0402008c, 0x59d80105, 0x82000d00, - 0x00018780, 0x040201da, 0x80000106, 0x82000500, - 0x00000003, 0x0c01f001, 0x00104d0a, 0x00104d89, - 0x00104d22, 0x00104d50, 0x592c0001, 0x492fc857, - 0x492fb107, 0x80000d40, 0x04020007, 0x59940019, - 0x80000540, 0x04022003, 0x59980023, 0x48032819, - 0x1c01f000, 0x497a5801, 0x40065800, 0x592c0001, - 0x496a5800, 0x815eb800, 0x412ed000, 0x80000d40, - 0x040207f9, 0x59c80000, 0x82000540, 0x00001200, - 0x48039000, 0x0401f7ee, 0x492fc857, 0x492fb107, - 0x592c0001, 0x80000d40, 0x04020012, 0x59da5908, - 0x835c0480, 0x00000020, 0x0400101c, 0x0402b01a, - 0x492fb007, 0x0400e7fa, 0x59d80105, 0x82000500, - 0x00018780, 0x040201aa, 0x59940019, 0x80000540, - 0x04022003, 0x59980023, 0x48032819, 0x1c01f000, - 0x497a5801, 0x40065800, 0x592c0001, 0x496a5800, - 0x815eb800, 0x412ed000, 0x80000d40, 0x040207f9, - 0x59c80000, 0x82000540, 0x00001200, 0x48039000, - 0x0401f7e3, 0x0400f009, 0x496a5800, 0x412ed000, - 0x815eb800, 0x59c80000, 0x82000540, 0x00001200, - 0x48039000, 0x0401f7e0, 0x492fa807, 0x0401f7de, - 0x492fc857, 0x59d81108, 0x45681000, 0x400ad000, - 0x815eb800, 0x0400e7fc, 0x59c80000, 0x82000540, - 0x00001200, 0x48039000, 0x0402d00c, 0x592c0001, - 0x492fc857, 0x492fb107, 0x80000d40, 0x0402001d, - 0x59940019, 0x80000540, 0x04022003, 0x59980023, - 0x48032819, 0x1c01f000, 0x59d80105, 0x82000500, - 0x00018780, 0x04020172, 0x42000000, 0x0010b855, - 0x0201f800, 0x0010aa47, 0x59980026, 0x59980828, - 0x80000000, 0x48033026, 0x492fc857, 0x800409c0, - 0x492f3028, 0x04000003, 0x492c0800, 0x0401f002, - 0x492f3029, 0x592c0001, 0x80000d40, 0x040007e5, - 0x497a5801, 0x40065800, 0x592c0001, 0x496a5800, - 0x815eb800, 0x412ed000, 0x80000d40, 0x040207f9, - 0x59c80000, 0x82000540, 0x00001200, 0x48039000, - 0x0401f7d8, 0x59980026, 0x59980828, 0x80000000, - 0x48033026, 0x492fc857, 0x800409c0, 0x492f3028, - 0x04000003, 0x492c0800, 0x0401f002, 0x492f3029, - 0x592c0001, 0x80000d40, 0x04020027, 0x0402d00e, - 0x59980029, 0x80025d40, 0x0400000f, 0x59980026, - 0x80000040, 0x48033026, 0x04020002, 0x48033028, - 0x592c0000, 0x48033029, 0x492fc857, 0x492fb107, - 0x0400d7f4, 0x42000000, 0x0010b855, 0x0201f800, - 0x0010aa47, 0x0402e00a, 0x59da5908, 0x496a5800, - 0x412ed000, 0x815eb800, 0x0400e7fc, 0x59c80000, - 0x82000540, 0x00001200, 0x48039000, 0x59d80105, - 0x82000500, 0x00018780, 0x04020125, 0x59940019, - 0x80000540, 0x04022003, 0x59980023, 0x48032819, - 0x1c01f000, 0x497a5801, 0x40065800, 0x592c0001, - 0x496a5800, 0x815eb800, 0x412ed000, 0x80000d40, - 0x040207f9, 0x59c80000, 0x82000540, 0x00001200, - 0x48039000, 0x0401f7ce, 0x592c0204, 0x4803c856, - 0x04000008, 0x42034000, 0x0010b4a4, 0x59a1d81e, - 0x80edd9c0, 0x02000800, 0x001005d8, 0x0401f003, - 0x5931d821, 0x58ef400b, 0x58ec0009, 0x800001c0, - 0x08020000, 0x0201f800, 0x001005d8, 0x497a5801, - 0x40065800, 0x592c0001, 0x496a5800, 0x412ed000, - 0x815eb800, 0x80000d40, 0x040207f9, 0x59c80000, - 0x82000540, 0x00001200, 0x48039000, 0x1c01f000, - 0x497a5801, 0x40065800, 0x592c0001, 0x496a5800, - 0x412ed000, 0x815eb800, 0x80000d40, 0x040207f9, - 0x59c80000, 0x82000540, 0x00001200, 0x48039000, - 0x0200e000, 0x000202fb, 0x0201f000, 0x00020302, - 0x5998002b, 0x84000540, 0x4803302b, 0x0201f000, - 0x0002035e, 0x42000000, 0x0010b855, 0x0201f800, - 0x0010aa47, 0x492fc857, 0x59980026, 0x59980828, - 0x80000000, 0x48033026, 0x800409c0, 0x492f3028, - 0x04000003, 0x492c0800, 0x0401f002, 0x492f3029, - 0x592c0001, 0x80000d40, 0x04020002, 0x1c01f000, - 0x497a5801, 0x40065800, 0x592c0001, 0x496a5800, - 0x412ed000, 0x815eb800, 0x80000d40, 0x040207f9, - 0x59c80000, 0x82000540, 0x00001200, 0x48039000, - 0x1c01f000, 0x59980026, 0x59980828, 0x80000000, - 0x48033026, 0x492fc857, 0x800409c0, 0x492f3028, - 0x04000003, 0x492c0800, 0x0401f002, 0x492f3029, - 0x592c0001, 0x80000d40, 0x04020039, 0x0402d00e, - 0x59980029, 0x80025d40, 0x0400000f, 0x59980026, - 0x80000040, 0x48033026, 0x04020002, 0x48033028, - 0x592c0000, 0x48033029, 0x492fc857, 0x492fb107, - 0x0400d7f4, 0x42000000, 0x0010b855, 0x0201f800, - 0x0010aa47, 0x0402e01d, 0x59da5908, 0x496a5800, - 0x412ed000, 0x815eb800, 0x0400e7fc, 0x59c80000, - 0x82000540, 0x00001200, 0x48039000, 0x04006018, - 0x59d8010a, 0x59d8090a, 0x80040d80, 0x040207fd, - 0x900001c0, 0x82000540, 0x00000013, 0x4803c011, - 0x5998002b, 0x84000500, 0x4803302b, 0x59e00017, - 0x8c000508, 0x04000003, 0x4a03c017, 0x00000003, - 0x4203e000, 0x30000001, 0x59d80105, 0x82000500, - 0x00018780, 0x0402007e, 0x1c01f000, 0x5998002b, - 0x84000540, 0x4803302b, 0x0401f7f8, 0x497a5801, - 0x40065800, 0x592c0001, 0x496a5800, 0x412ed000, - 0x815eb800, 0x80000d40, 0x040207f9, 0x59c80000, - 0x82000540, 0x00001200, 0x48039000, 0x0401f7bc, - 0x5c000000, 0x4c000000, 0x4803c857, 0x492fc857, - 0x4943c857, 0x4807c857, 0x4a025a04, 0x00000103, - 0x49425a06, 0x48065a08, 0x4a025c06, 0x0000ffff, - 0x813261c0, 0x04000003, 0x59300402, 0x48025c06, - 0x832c0400, 0x00000009, 0x04011000, 0x4803c840, - 0x4a03c842, 0x0000000b, 0x04011000, 0x1c01f000, - 0x4df00000, 0x4203e000, 0x50000000, 0x599cb817, - 0x59940019, 0x80000540, 0x04002023, 0x0400000e, - 0x59980022, 0x82000580, 0x00000005, 0x0400001e, - 0x59a80069, 0x81640580, 0x0402001b, 0x8c5cbd08, - 0x04000005, 0x59a8006a, 0x59a80866, 0x80040580, - 0x04020015, 0x8c5cbd08, 0x04020030, 0x59d8090b, - 0x59d8010a, 0x80040580, 0x0400000d, 0x0400600e, - 0x4a03c011, 0x80400012, 0x4a03c020, 0x00008040, - 0x59e00017, 0x8c000508, 0x04000003, 0x4a03c017, - 0x00000002, 0x4203e000, 0x30000001, 0x4a032819, - 0xffff0000, 0x04026835, 0x04006003, 0x8c5cbd08, - 0x04020860, 0x59980029, 0x80025d40, 0x04000010, - 0x59d80105, 0x82000500, 0x00018780, 0x04020020, - 0x0402d00d, 0x59980026, 0x492fc857, 0x80000040, - 0x48033026, 0x592c0000, 0x492fb107, 0x48033029, - 0x04020003, 0x4803c856, 0x48033028, 0x5c03e000, - 0x1c01f000, 0x42000000, 0x0010b855, 0x0201f800, - 0x0010aa47, 0x0401f7fa, 0x59e0000f, 0x59e0080f, - 0x80040580, 0x040207fd, 0x59e00010, 0x59e01010, - 0x80081580, 0x040207fd, 0x40065000, 0x80041580, - 0x040007c7, 0x040067dc, 0x0401f7ca, 0x4803c857, - 0x485fc857, 0x8c00050e, 0x02020800, 0x001005d0, - 0x4203e000, 0x50000000, 0x4200b800, 0x00008004, - 0x0201f000, 0x001005dd, 0x5998002b, 0x8c000500, - 0x04000013, 0x84000500, 0x4803302b, 0x59d8010a, - 0x59d8090a, 0x80040580, 0x040207fd, 0x800408e0, - 0x82040d40, 0x00000013, 0x4807c011, 0x59e00017, - 0x8c000508, 0x04000003, 0x4a03c017, 0x00000003, - 0x4203e000, 0x30000001, 0x1c01f000, 0x0402e014, - 0x59da5908, 0x496a5800, 0x412ed000, 0x815eb800, - 0x0400e7fc, 0x59c80000, 0x82000540, 0x00001200, - 0x48039000, 0x59d8090b, 0x59980024, 0x48073024, - 0x80040480, 0x04020004, 0x59940019, 0x80000540, - 0x04022003, 0x59980823, 0x48072819, 0x59d80105, - 0x82000500, 0x00018780, 0x040207c9, 0x1c01f000, - 0x59981025, 0x59e00010, 0x59e00810, 0x80041d80, - 0x040207fd, 0x80080580, 0x04000013, 0x48073025, - 0x59e0000f, 0x59e0100f, 0x80081d80, 0x040207fd, - 0x81280580, 0x04000008, 0x400a5000, 0x40080000, - 0x80040580, 0x04000003, 0x59980823, 0x48072819, - 0x1c01f000, 0x59940019, 0x80000540, 0x040227f8, - 0x0401f7fc, 0x59e0000f, 0x59e0100f, 0x80081d80, - 0x040207fd, 0x81280580, 0x040007f6, 0x400a5000, - 0x59940019, 0x80000540, 0x040027ed, 0x0401f7f1, - 0x59a80017, 0x82000c80, 0x0000000a, 0x02021800, - 0x001005d8, 0x0c01f809, 0x4a038805, 0x000000f0, - 0x59c400a3, 0x82000500, 0x02870000, 0x02020800, - 0x001005d8, 0x1c01f000, 0x00104fc5, 0x00104f51, - 0x00104f6c, 0x00104f95, 0x00104fb8, 0x00104ff2, - 0x00105004, 0x00104f6c, 0x00104fd6, 0x00104f50, - 0x1c01f000, 0x4a038808, 0x00000004, 0x0401f8f9, - 0x0201f800, 0x001053ab, 0x59c40805, 0x8c040d0e, - 0x04020013, 0x8c040d0a, 0x0402000b, 0x8c040d0c, - 0x04020006, 0x8c040d08, 0x0400000d, 0x4a035017, - 0x00000003, 0x0401f00a, 0x4a035017, 0x00000000, - 0x0401f007, 0x42000000, 0x0010b844, 0x0201f800, - 0x0010aa47, 0x4a035017, 0x00000002, 0x1c01f000, - 0x4a038808, 0x00000002, 0x0401f8de, 0x59c40805, - 0x8c040d08, 0x04020021, 0x8c040d0c, 0x0402001c, - 0x8c040d0e, 0x04020017, 0x82040500, 0x000000f0, - 0x0402001c, 0x0201f800, 0x001053ab, 0x4a038808, - 0x00000080, 0x59c40002, 0x8400050c, 0x48038802, - 0x0401f9d9, 0x4d3c0000, 0x42027800, 0x00000001, - 0x0201f800, 0x00109874, 0x5c027800, 0x4a038808, - 0x00000080, 0x4a035017, 0x00000009, 0x0401f009, - 0x4a035017, 0x00000001, 0x0401f006, 0x4a035017, - 0x00000000, 0x0401f003, 0x4a035017, 0x00000003, - 0x1c01f000, 0x0401f8b7, 0x4a038808, 0x00000080, - 0x59c40805, 0x8c040d0a, 0x0402001b, 0x8c040d0c, - 0x04020016, 0x8c040d0e, 0x04020011, 0x82040500, - 0x000000f0, 0x04020016, 0x59c40002, 0x8400050c, - 0x48038802, 0x0401f9b4, 0x4d3c0000, 0x42027800, - 0x00000001, 0x0201f800, 0x00109874, 0x5c027800, - 0x4a035017, 0x00000009, 0x0401f009, 0x4a035017, - 0x00000001, 0x0401f006, 0x4a035017, 0x00000000, - 0x0401f003, 0x4a035017, 0x00000002, 0x1c01f000, - 0x4a038808, 0x00000008, 0x59c40805, 0x8c040d0c, - 0x04020006, 0x8c040d0e, 0x04000006, 0x4a035017, - 0x00000001, 0x0401f003, 0x4a035017, 0x00000000, - 0x1c01f000, 0x0401f8d3, 0x59c40805, 0x8c040d0c, - 0x0402000d, 0x4c040000, 0x0401f882, 0x5c000800, - 0x8c040d0a, 0x04020006, 0x8c040d0e, 0x04000006, - 0x4a035017, 0x00000001, 0x0401f003, 0x4a035017, - 0x00000002, 0x1c01f000, 0x4a038808, 0x00000008, - 0x42001000, 0x00105058, 0x0201f800, 0x00106084, - 0x59c40805, 0x8c040d0a, 0x0402000d, 0x8c040d08, - 0x0402000b, 0x8c040d0c, 0x04020006, 0x8c040d0e, - 0x0400000d, 0x4a035017, 0x00000001, 0x0401f00a, - 0x4a035017, 0x00000000, 0x0401f007, 0x42000000, - 0x0010b844, 0x0201f800, 0x0010aa47, 0x4a035017, - 0x00000004, 0x1c01f000, 0x0401f8a6, 0x0401f859, - 0x59c40805, 0x8c040d0a, 0x0402000b, 0x8c040d0c, - 0x04020006, 0x8c040d0e, 0x04000009, 0x4a035017, - 0x00000001, 0x0401f006, 0x4a035017, 0x00000000, - 0x0401f003, 0x4a035017, 0x00000002, 0x1c01f000, - 0x4a038808, 0x00000004, 0x0401f846, 0x59c40805, - 0x8c040d0a, 0x04020010, 0x8c040d08, 0x0402000b, - 0x8c040d0c, 0x04020006, 0x8c040d0e, 0x0400000c, - 0x4a035017, 0x00000001, 0x0401f009, 0x4a035017, - 0x00000000, 0x0401f006, 0x4a035017, 0x00000003, - 0x0401f003, 0x4a035017, 0x00000002, 0x1c01f000, - 0x0401f91f, 0x02020800, 0x001005d8, 0x59a80805, - 0x8c040d0c, 0x04000015, 0x84040d0c, 0x48075005, - 0x4a038805, 0x00000010, 0x0201f800, 0x00101937, - 0x59c40005, 0x8c000508, 0x04000008, 0x4a038808, - 0x00000008, 0x4a035033, 0x00000001, 0x4202d800, - 0x00000001, 0x0401f01a, 0x59c40006, 0x84000548, - 0x48038806, 0x0401f016, 0x59a80017, 0x82000580, - 0x00000001, 0x0400000c, 0x59a80017, 0x82000580, - 0x00000005, 0x0402000c, 0x42000000, 0x0010b844, - 0x0201f800, 0x0010aa47, 0x4a035017, 0x00000008, - 0x0401f007, 0x42000000, 0x0010b844, 0x0201f800, - 0x0010aa47, 0x4a035017, 0x00000004, 0x1c01f000, - 0x4803c856, 0x4c040000, 0x4c080000, 0x42000800, - 0x00000064, 0x42001000, 0x00105058, 0x0201f800, - 0x00106079, 0x5c001000, 0x5c000800, 0x1c01f000, - 0x4803c856, 0x4c040000, 0x0201f800, 0x00106c55, - 0x4df00000, 0x0201f800, 0x00106e21, 0x5c03e000, - 0x02000800, 0x00106c4b, 0x0401ffba, 0x5c000800, - 0x1c01f000, 0x4803c856, 0x4c040000, 0x4c080000, - 0x0201f800, 0x00106c55, 0x4df00000, 0x0201f800, - 0x00106e21, 0x5c03e000, 0x02000800, 0x00106c4b, - 0x59c40006, 0x84000500, 0x48038806, 0x0201f800, - 0x00106ede, 0x497b8880, 0x0201f800, 0x0010a9c0, - 0x0201f800, 0x0010a9ce, 0x0201f800, 0x00101815, - 0x4a03504c, 0x00000004, 0x4202d800, 0x00000004, - 0x4a038805, 0x00000001, 0x42001000, 0x00105058, - 0x0201f800, 0x00106084, 0x0201f800, 0x001006d4, - 0x0401f8c1, 0x04000006, 0x42006000, 0xfeffffff, - 0x41786800, 0x0201f800, 0x0010427d, 0x0201f800, - 0x00100452, 0x42000000, 0x00000001, 0x0201f800, - 0x00101590, 0x5c001000, 0x5c000800, 0x1c01f000, - 0x59c40008, 0x8c000508, 0x04020007, 0x4a038808, - 0x00000010, 0x4201d000, 0x00001388, 0x0201f800, - 0x0010608e, 0x1c01f000, 0x4c040000, 0x59a80833, - 0x82040580, 0x00000000, 0x0400000b, 0x82040580, - 0x00000001, 0x0400000b, 0x82040580, 0x00000002, - 0x0400000b, 0x82040580, 0x00000003, 0x0400000b, - 0x0401f057, 0x4a035017, 0x00000000, 0x0401f009, - 0x4a035017, 0x00000004, 0x0401f006, 0x4a035017, - 0x00000001, 0x0401f003, 0x4a035017, 0x00000007, - 0x497b8880, 0x4a038893, 0x00000001, 0x41780000, - 0x0201f800, 0x00101606, 0x0201f800, 0x00106ede, - 0x836c0d80, 0x00000004, 0x04000008, 0x59c40006, - 0x82000500, 0xffffff0f, 0x82000540, 0x04000001, - 0x48038806, 0x0401f007, 0x59c40006, 0x82000500, - 0xffffff0f, 0x82000540, 0x04000000, 0x48038806, - 0x0401f875, 0x04020005, 0x59c40806, 0x82040d00, - 0xfbffff0f, 0x48078806, 0x4200b000, 0x00000005, - 0x59c40005, 0x8c000534, 0x04020033, 0x42006000, - 0xfc18ffff, 0x42006800, 0x01000000, 0x0201f800, - 0x0010427d, 0x0201f800, 0x00101937, 0x59c408a4, - 0x82040d00, 0x0000000f, 0x82040d80, 0x0000000c, - 0x0400000a, 0x42006000, 0xfeffffff, 0x42006800, - 0x02000000, 0x0201f800, 0x0010427d, 0x8058b040, - 0x040207e8, 0x0401f8a1, 0x0401f853, 0x04000006, - 0x42006000, 0xfeffffff, 0x41786800, 0x0201f800, - 0x0010427d, 0x836c0d80, 0x00000004, 0x04000006, - 0x59a8084d, 0x42001000, 0x00105065, 0x0201f800, - 0x0010606e, 0x4a035033, 0x00000004, 0x0401fe31, - 0x0401f841, 0x04020008, 0x59c408a4, 0x82040d00, - 0x0000000f, 0x82040580, 0x0000000c, 0x02020800, - 0x001005d8, 0x5c000800, 0x1c01f000, 0x4803c856, - 0x4c000000, 0x0201f800, 0x0010609e, 0x4a035010, - 0x00ffffff, 0x497b5032, 0x59a8002a, 0x82000500, - 0xffff0000, 0x4803502a, 0x497b8880, 0x497b8893, - 0x41780000, 0x0201f800, 0x00101606, 0x59c40001, - 0x82000500, 0xfffffcff, 0x48038801, 0x42006000, - 0xfc18ffff, 0x41786800, 0x0201f800, 0x0010427d, - 0x4a038808, 0x00000000, 0x5c000000, 0x800001c0, - 0x02020800, 0x0010411d, 0x4a038805, 0x040000f0, - 0x59c40006, 0x82000500, 0xffffffcf, 0x82000540, - 0x440000c1, 0x48038806, 0x1c01f000, 0x4c5c0000, - 0x59a8b832, 0x825cbd80, 0x0000aaaa, 0x5c00b800, - 0x1c01f000, 0x4c5c0000, 0x599cb818, 0x825cbd00, - 0x00000030, 0x825cbd80, 0x00000000, 0x5c00b800, - 0x1c01f000, 0x4c5c0000, 0x599cb818, 0x825cbd00, - 0x00000030, 0x825cbd80, 0x00000010, 0x5c00b800, - 0x1c01f000, 0x4c5c0000, 0x599cb818, 0x825cbd00, - 0x00000030, 0x825cbd80, 0x00000020, 0x5c00b800, - 0x1c01f000, 0x59a80005, 0x4803c857, 0x82000d00, - 0x00000013, 0x04000025, 0x599c1017, 0x4d3c0000, - 0x82000500, 0x00000011, 0x04000007, 0x42027800, - 0x00000400, 0x0201f800, 0x00103b25, 0x0402000a, - 0x0401f012, 0x42027800, 0x00000408, 0x0201f800, - 0x00103b25, 0x0400000d, 0x42003000, 0x00000003, - 0x0401f003, 0x42003000, 0x00000004, 0x42028000, - 0x0000000e, 0x0201f800, 0x0010a449, 0x599c1017, - 0x8c08150a, 0x04020007, 0x42028000, 0x00000004, - 0x0201f800, 0x00101fe5, 0x80000580, 0x0401f80d, - 0x5c027800, 0x0401f00a, 0x0201f800, 0x00103b25, - 0x04000007, 0x42028000, 0x0000000f, 0x42003000, - 0x00000001, 0x0201f800, 0x0010a449, 0x1c01f000, - 0x59a80005, 0x04000004, 0x82000540, 0x00000010, - 0x0401f003, 0x82000500, 0xffffffef, 0x48035005, - 0x4803c857, 0x1c01f000, 0x4803c856, 0x4c580000, - 0x42000000, 0x0010b8cb, 0x0201f800, 0x0010aa47, - 0x42000800, 0x0010c0f1, 0x59c40003, 0x44000800, - 0x59c40004, 0x48000801, 0x59c4000b, 0x48000802, - 0x59c4008e, 0x48000803, 0x59c4008f, 0x48000804, - 0x59c40090, 0x48000805, 0x59c40091, 0x48000806, - 0x59c40092, 0x48000807, 0x59c40093, 0x48000808, - 0x59c40099, 0x48000809, 0x59c4009e, 0x4800080a, - 0x59c400aa, 0x4800080b, 0x59c400af, 0x4800080c, - 0x59c400b2, 0x4800080d, 0x59c400b1, 0x4800080e, - 0x82040c00, 0x0000000f, 0x41c41800, 0x4200b000, - 0x00000030, 0x580c0050, 0x44000800, 0x80040800, - 0x800c1800, 0x8058b040, 0x040207fb, 0x41c41800, - 0x4200b000, 0x00000020, 0x580c0010, 0x44000800, - 0x80040800, 0x800c1800, 0x8058b040, 0x040207fb, - 0x497b8830, 0x4200b000, 0x00000040, 0x59c40031, - 0x44000800, 0x80040800, 0x8058b040, 0x040207fc, - 0x497b88ac, 0x4200b000, 0x00000010, 0x59c400ad, - 0x44000800, 0x80040800, 0x8058b040, 0x040207fc, - 0x59c41001, 0x4c080000, 0x8408150c, 0x480b8801, - 0x4a0370e4, 0x00000300, 0x4a0370e5, 0xb0000000, - 0x42000800, 0x00000800, 0x80040840, 0x02000800, - 0x001005d8, 0x59b800e5, 0x8c000538, 0x040207fb, - 0x4a0370e4, 0x00000200, 0x42006000, 0xffffffff, - 0x42006800, 0x80000000, 0x0201f800, 0x0010427d, - 0x4a038807, 0x00000001, 0x497b8807, 0x4a038808, - 0x00000010, 0x42006000, 0xfcf8ffff, 0x42006800, - 0x01000000, 0x0201f800, 0x0010427d, 0x5c001000, - 0x480b8801, 0x42000800, 0x0010c0f1, 0x50040000, - 0x48038803, 0x58040001, 0x48038804, 0x58040002, - 0x4803880b, 0x58040003, 0x4803888e, 0x58040004, - 0x4803888f, 0x58040005, 0x48038890, 0x58040006, - 0x48038891, 0x58040007, 0x48038892, 0x58040008, - 0x48038893, 0x58040009, 0x48038899, 0x5804000a, - 0x4803889e, 0x5804000b, 0x480388aa, 0x5804000c, - 0x480388af, 0x5804000d, 0x480388b2, 0x5804000e, - 0x480388b1, 0x82040c00, 0x0000000f, 0x41c41800, - 0x4200b000, 0x00000030, 0x50040000, 0x48001850, - 0x80040800, 0x800c1800, 0x8058b040, 0x040207fb, - 0x41c41800, 0x4200b000, 0x00000020, 0x50040000, - 0x48001810, 0x80040800, 0x800c1800, 0x8058b040, - 0x040207fb, 0x497b8830, 0x4200b000, 0x00000040, - 0x50040000, 0x48038831, 0x80040800, 0x8058b040, - 0x040207fc, 0x497b88ac, 0x4200b000, 0x00000010, - 0x50040000, 0x480388ad, 0x80040800, 0x8058b040, - 0x040207fc, 0x497b8880, 0x41780000, 0x0201f800, - 0x00101606, 0x59c408a4, 0x82040d00, 0x0000000f, - 0x82040580, 0x0000000c, 0x02020800, 0x001005d8, - 0x4a038805, 0x04000000, 0x5c00b000, 0x1c01f000, - 0x4803c856, 0x4c580000, 0x4ce80000, 0x42000000, - 0x0010b845, 0x0201f800, 0x0010aa47, 0x59c41008, - 0x4c080000, 0x82080500, 0xffffff7f, 0x48038808, - 0x59c40004, 0x82000500, 0x00003e02, 0x04000005, - 0x4201d000, 0x00000014, 0x0201f800, 0x0010608e, - 0x59c40006, 0x82000500, 0xffffff0f, 0x48038806, - 0x4a038805, 0x00000010, 0x4a038808, 0x00000004, - 0x4200b000, 0x00000065, 0x59c40005, 0x8c000508, - 0x04020012, 0x4201d000, 0x000003e8, 0x0201f800, - 0x0010608e, 0x8058b040, 0x040207f8, 0x0201f800, - 0x00106ede, 0x4a038808, 0x00000008, 0x4a035033, - 0x00000001, 0x4202d800, 0x00000001, 0x82000540, - 0x00000001, 0x0401f030, 0x0201f800, 0x00100ae0, - 0x42000000, 0x0010b8a8, 0x0201f800, 0x0010aa47, - 0x0201f800, 0x00100ef4, 0x497b8880, 0x59a8002a, - 0x82000500, 0x0000ffff, 0x4c000000, 0x0201f800, - 0x00101606, 0x5c000000, 0x48038880, 0x4a038808, - 0x00000000, 0x4200b000, 0x00000065, 0x4a038805, - 0x000000f0, 0x0201f800, 0x00101937, 0x42000800, - 0x000000f0, 0x59c40005, 0x80040d00, 0x04000008, - 0x4201d000, 0x000003e8, 0x0201f800, 0x0010608e, - 0x8058b040, 0x040207f2, 0x0401f7d1, 0x59c40006, - 0x82000540, 0x000000f0, 0x48038806, 0x59a8001e, - 0x80000540, 0x04020002, 0x80000000, 0x48038893, - 0x80000580, 0x5c001000, 0x4df00000, 0x0201f800, - 0x0010195d, 0x5c03e000, 0x480b8808, 0x5c01d000, - 0x5c00b000, 0x1c01f000, 0x4803c856, 0x4c580000, - 0x4ce80000, 0x59c41008, 0x82080500, 0xffffff7f, - 0x48038808, 0x4c080000, 0x59c40004, 0x82000500, - 0x00003e02, 0x04000005, 0x4201d000, 0x00000014, - 0x0201f800, 0x0010608e, 0x0201f800, 0x00100ae0, - 0x42000000, 0x0010b8a9, 0x0201f800, 0x0010aa47, - 0x0201f800, 0x00100ef4, 0x4a038808, 0x00000002, - 0x80000580, 0x48038880, 0x48038893, 0x0201f800, - 0x00101606, 0x4200b000, 0x00000384, 0x4a038805, - 0x000000f0, 0x0201f800, 0x00101937, 0x42000800, - 0x000000f0, 0x59c40005, 0x80040d00, 0x04000015, - 0x82000500, 0x000000d0, 0x04020012, 0x4201d000, - 0x00000067, 0x0201f800, 0x0010608e, 0x8058b040, - 0x040207ef, 0x0201f800, 0x00106ede, 0x4a038808, - 0x00000008, 0x4a035033, 0x00000001, 0x4202d800, - 0x00000001, 0x82000540, 0x00000001, 0x0401f010, - 0x497b8880, 0x59a8001e, 0x80000540, 0x04020002, - 0x80000000, 0x48038893, 0x59a8002a, 0x82000500, - 0x0000ffff, 0x4c000000, 0x0201f800, 0x00101606, - 0x5c000000, 0x48038880, 0x80000580, 0x5c001000, - 0x4df00000, 0x0201f800, 0x0010195d, 0x5c03e000, - 0x480b8808, 0x5c01d000, 0x5c00b000, 0x1c01f000, - 0x4803c856, 0x59c40004, 0x82000500, 0x00003e02, - 0x0400000a, 0x0201f800, 0x00106ede, 0x4a038808, - 0x00000008, 0x4a035033, 0x00000001, 0x4202d800, - 0x00000001, 0x0401f052, 0x0201f800, 0x00100ae0, - 0x42000000, 0x0010b8aa, 0x0201f800, 0x0010aa47, - 0x0201f800, 0x00100ef4, 0x59c40006, 0x84000508, - 0x48038806, 0x4a038805, 0x00000010, 0x59a80805, - 0x84040d4c, 0x48075005, 0x42000800, 0x00000064, - 0x42001000, 0x00105058, 0x0201f800, 0x0010606e, - 0x4a038808, 0x00000000, 0x497b8880, 0x4a038805, - 0x000000f0, 0x0201f800, 0x00101937, 0x42000800, - 0x000000f0, 0x59c40005, 0x80040d00, 0x0400000e, - 0x82000500, 0x000000e0, 0x0402000b, 0x4201d000, - 0x000003e8, 0x0201f800, 0x0010608e, 0x0201f800, - 0x00105f48, 0x59940004, 0x80000540, 0x040207ec, - 0x0401f023, 0x4c080000, 0x42001000, 0x00105065, - 0x0201f800, 0x00105f90, 0x42001000, 0x00105058, - 0x0201f800, 0x00106084, 0x5c001000, 0x497b8880, - 0x59a8001e, 0x80000540, 0x04020002, 0x80000000, - 0x48038893, 0x59a8002a, 0x82000500, 0x0000ffff, - 0x4c000000, 0x0201f800, 0x00101606, 0x5c000000, - 0x48038880, 0x59a80805, 0x84040d0c, 0x48075005, - 0x59c40006, 0x84000548, 0x48038806, 0x0201f800, - 0x0010195d, 0x4a038808, 0x00000080, 0x1c01f000, - 0x4803c856, 0x4d400000, 0x4d3c0000, 0x0201f800, - 0x00106ede, 0x0201f800, 0x0010ab33, 0x04020025, - 0x599c1017, 0x59a80805, 0x8c040d00, 0x0402000c, - 0x8c08151a, 0x0400001f, 0x84040d42, 0x48075005, - 0x42028000, 0x00000004, 0x42027800, 0x0000000c, - 0x8c081508, 0x04020008, 0x0401f012, 0x42028000, - 0x00000004, 0x42027800, 0x00000004, 0x8c081508, - 0x0400000c, 0x4d400000, 0x42028000, 0x0000000e, - 0x42028800, 0x0000ffff, 0x0201f800, 0x0010a446, - 0x5c028000, 0x599c0817, 0x8c040d0a, 0x04020005, - 0x4943c857, 0x493fc857, 0x0201f800, 0x00101fe5, - 0x497b8880, 0x4202d800, 0x00000001, 0x0401fcfb, - 0x5c027800, 0x5c028000, 0x1c01f000, 0x0201f800, - 0x00100ae0, 0x42000000, 0x0010b8ab, 0x0201f800, - 0x0010aa47, 0x0201f800, 0x00100ef4, 0x42000000, - 0x00000001, 0x0201f800, 0x00101606, 0x4a038880, - 0x00000001, 0x0201f000, 0x0010195d, 0x4202e000, - 0x00000000, 0x4a033015, 0x00000001, 0x497b301d, - 0x497b3006, 0x4a03b004, 0x60000001, 0x59d80005, - 0x4a03b004, 0x90000001, 0x4a03a804, 0x60000001, - 0x59d40005, 0x4a03a804, 0x90000001, 0x0201f000, - 0x00105983, 0x4a03c825, 0x00000004, 0x4a03c827, - 0x00000004, 0x599c0409, 0x80000d40, 0x04000020, - 0x599c0407, 0x80000540, 0x04000007, 0x800000cc, - 0x599c100b, 0x80080400, 0x4803b000, 0x497bb002, - 0x59d80001, 0x599c000b, 0x4803b000, 0x599c000c, - 0x4803b001, 0x599c0407, 0x80000540, 0x04020002, - 0x497bb002, 0x599c0c09, 0x82040540, 0x00400000, - 0x4803b003, 0x4a03b009, 0x00000004, 0x4a03b004, - 0x10000001, 0x59e00803, 0x82040d00, 0xfffffeff, - 0x82040d40, 0x00008000, 0x4807c003, 0x599c040a, - 0x80000540, 0x04000020, 0x599c0408, 0x80000540, - 0x04000007, 0x800000cc, 0x599c100f, 0x80080400, - 0x4803a800, 0x497ba802, 0x59d40001, 0x599c000f, - 0x4803a800, 0x599c0010, 0x4803a801, 0x599c0408, - 0x80000540, 0x04020002, 0x497ba802, 0x599c0c0a, - 0x82040540, 0x00400000, 0x4803a803, 0x4a03a809, - 0x00000004, 0x4a03a804, 0x10000001, 0x59e00803, - 0x82040d00, 0xfffffbff, 0x82040d40, 0x00008000, - 0x4807c003, 0x800409c0, 0x04000007, 0x4202e000, - 0x00000001, 0x0200b800, 0x00020551, 0x0200f000, - 0x00020566, 0x1c01f000, 0x0201f800, 0x001005d8, - 0x1c01f000, 0x4df00000, 0x4203e000, 0x50000000, - 0x59981005, 0x800811c0, 0x0400001e, 0x58080005, - 0x82000d00, 0x43018780, 0x02020000, 0x00105846, - 0x8c000508, 0x04000015, 0x580a5808, 0x592c0204, - 0x497a5800, 0x497a5801, 0x82000500, 0x000000ff, - 0x82000c80, 0x0000004b, 0x0402100b, 0x0c01f80f, - 0x5c03e000, 0x83700580, 0x00000003, 0x040007e6, - 0x0200f800, 0x00020566, 0x0200b000, 0x00020551, - 0x1c01f000, 0x0401f850, 0x5c03e000, 0x0401f7f9, - 0x0401f8de, 0x0401f7fd, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x001054a1, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105519, 0x00105491, 0x00105491, 0x001054a1, - 0x001054a1, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x492fc857, 0x42000000, 0x0010b85e, - 0x0201f800, 0x0010aa47, 0x42000000, 0x00000400, - 0x0401f019, 0x492fc857, 0x42000000, 0x0010b85d, - 0x0201f800, 0x0010aa47, 0x42000000, 0x00001000, - 0x0401f011, 0x492fc857, 0x42000000, 0x0010b85c, - 0x0201f800, 0x0010aa47, 0x42000000, 0x00002000, - 0x0401f009, 0x492fc857, 0x42000000, 0x0010b85f, - 0x0201f800, 0x0010aa47, 0x42000000, 0x00000800, - 0x0401f001, 0x4803c857, 0x4202e000, 0x00000001, - 0x592c0c04, 0x82040d00, 0xffff80ff, 0x80040540, - 0x48025c04, 0x0201f000, 0x000202da, 0x592c0204, - 0x492fc857, 0x80000110, 0x040007db, 0x80000040, - 0x04000025, 0x48033002, 0x492f3003, 0x492f3004, - 0x4a033008, 0x001054e5, 0x4202e000, 0x00000003, - 0x1c01f000, 0x592c0204, 0x492fc857, 0x80000110, - 0x040007cd, 0x80000040, 0x04000033, 0x48033002, - 0x492f3003, 0x492f3004, 0x4a033008, 0x00105501, - 0x4202e000, 0x00000003, 0x1c01f000, 0x0201f800, - 0x0010ab33, 0x02020000, 0x000204d9, 0x42028000, - 0x00000028, 0x41780800, 0x417a6000, 0x0201f800, - 0x00104e70, 0x0201f800, 0x001091c6, 0x0201f000, - 0x000202da, 0x592c0a0a, 0x8c040d02, 0x04020016, - 0x59a80021, 0x492fc857, 0x80000540, 0x0402000f, - 0x592c0207, 0x80000540, 0x04000005, 0x0201f800, - 0x00104326, 0x04020004, 0x1c01f000, 0x42000000, - 0x00000000, 0x592c0a06, 0x48065c06, 0x48025a06, - 0x0201f000, 0x000202da, 0x42000000, 0x00000028, - 0x0401f7f9, 0x42000800, 0x00000009, 0x0201f000, - 0x0010665b, 0x592c0208, 0x492fc857, 0x82000c80, - 0x0000199a, 0x040217a4, 0x592c0408, 0x80000540, - 0x040207a1, 0x59a80821, 0x800409c0, 0x04020009, - 0x592c0207, 0x80000540, 0x0400079b, 0x497a5a06, - 0x0201f800, 0x00104385, 0x04020004, 0x1c01f000, - 0x42000000, 0x00000028, 0x48025a06, 0x0201f000, - 0x000202da, 0x59980804, 0x59980002, 0x48065800, - 0x492c0801, 0x492f3004, 0x80000040, 0x48033002, - 0x04000002, 0x1c01f000, 0x599a5803, 0x59980008, - 0x4202e000, 0x00000001, 0x0801f000, 0x592e8a06, - 0x592c0406, 0x4803c856, 0x82000500, 0x000000ff, - 0x4200b800, 0x00000001, 0x82000d80, 0x00000001, - 0x04000015, 0x417a8800, 0x4200b800, 0x000007f0, - 0x82000d80, 0x00000002, 0x0400000f, 0x80000540, - 0x02020000, 0x000202da, 0x592e8a06, 0x0201f800, - 0x00020245, 0x02020000, 0x000202da, 0x592e9008, - 0x592e9809, 0x0201f800, 0x00104713, 0x0201f000, - 0x000202da, 0x59a80805, 0x84040d00, 0x48075005, - 0x0201f800, 0x00020245, 0x02000800, 0x0010482c, - 0x81468800, 0x805cb840, 0x040207fa, 0x0201f000, - 0x000202da, 0x592c0a08, 0x4807c857, 0x82040580, - 0x0000000e, 0x04000045, 0x82040580, 0x00000046, - 0x04000046, 0x82040580, 0x00000045, 0x04000020, - 0x82040580, 0x00000029, 0x04000010, 0x82040580, - 0x0000002a, 0x04000009, 0x82040580, 0x0000000f, - 0x040001fc, 0x82040580, 0x0000002e, 0x040001f9, - 0x4807c856, 0x0401f1f2, 0x59a80805, 0x84040d04, - 0x48075005, 0x0401f1f3, 0x592e8a06, 0x0201f800, - 0x00020245, 0x040201ef, 0x59340200, 0x84000518, - 0x48026a00, 0x592e6009, 0x4933c857, 0x83300580, - 0xffffffff, 0x0402002a, 0x0401f1e6, 0x592c1407, - 0x480bc857, 0x0201f800, 0x00109410, 0x411e6000, - 0x04020003, 0x4803c856, 0x0401f1d9, 0x592e3809, - 0x591c1414, 0x84081516, 0x84081554, 0x480a3c14, - 0x4a026403, 0x0000003a, 0x592c040b, 0x80000540, - 0x04000007, 0x4a026403, 0x0000003b, 0x592c020c, - 0x4802641a, 0x592c040c, 0x4802621a, 0x4a026203, - 0x00000001, 0x42000800, 0x80000040, 0x0201f800, - 0x00020721, 0x0401f1c7, 0x59a80068, 0x84000510, - 0x48035068, 0x0401f1c3, 0x592c1207, 0x8c081500, - 0x040201c0, 0x592e8a06, 0x592e6009, 0x0201f800, - 0x0010941a, 0x04020003, 0x4803c856, 0x0401f1b4, - 0x59300c06, 0x82040580, 0x00000004, 0x04000003, - 0x4803c856, 0x0401f1ae, 0x59300a03, 0x82040580, - 0x00000007, 0x04000003, 0x4803c856, 0x0401f1a8, - 0x59300c03, 0x82040580, 0x00000001, 0x04000021, - 0x82040580, 0x00000003, 0x04000016, 0x82040580, - 0x00000006, 0x04000020, 0x82040580, 0x00000008, - 0x04000015, 0x82040580, 0x0000000a, 0x0400000a, - 0x82040580, 0x0000000c, 0x04000004, 0x82040580, - 0x0000002e, 0x04020018, 0x42000800, 0x00000009, - 0x0401f013, 0x42000800, 0x00000005, 0x0401f010, - 0x417a7800, 0x0201f800, 0x0010203c, 0x4a026406, - 0x00000001, 0x42000800, 0x00000003, 0x0401f008, - 0x417a7800, 0x0201f800, 0x0010203c, 0x4a026406, - 0x00000001, 0x42000800, 0x0000000b, 0x0201f800, - 0x00104571, 0x4a026203, 0x00000001, 0x0201f800, - 0x0010672b, 0x0401f17b, 0x40000800, 0x58040000, - 0x80000540, 0x040207fd, 0x492c0800, 0x1c01f000, - 0x492fc857, 0x59300c06, 0x82040580, 0x00000006, - 0x04020094, 0x0201f800, 0x001049e7, 0x04020005, - 0x59340200, 0x8c00051a, 0x02000000, 0x00020533, - 0x59340200, 0x8c00050e, 0x0400008a, 0x59300203, - 0x42027800, 0x00000001, 0x82000580, 0x00000007, - 0x02020000, 0x00020533, 0x4a026203, 0x00000002, - 0x0201f000, 0x00020533, 0x42028000, 0x00000002, - 0x4a026206, 0x00000014, 0x4d2c0000, 0x0201f800, - 0x0010a1d1, 0x5c025800, 0x59300c06, 0x4807c857, - 0x82040580, 0x00000007, 0x04020063, 0x492fc857, - 0x4a025a06, 0x00000001, 0x0201f000, 0x000202da, - 0x592c240a, 0x492fc857, 0x4813c857, 0x8c10251c, - 0x04020016, 0x8c10251a, 0x04000003, 0x8c10250a, - 0x04000069, 0x59340a00, 0x8c040d0e, 0x04000003, - 0x8c10251e, 0x04000064, 0x0201f800, 0x0002075a, - 0x0400006b, 0x592c240a, 0x49366009, 0x49325809, - 0x4a026406, 0x00000006, 0x4a026203, 0x00000007, - 0x0201f000, 0x0002052f, 0x592c0a0c, 0x5934000f, - 0x41784000, 0x80001540, 0x0400006d, 0x58080204, - 0x82000500, 0x000000ff, 0x82000580, 0x00000012, - 0x04020004, 0x5808020c, 0x80040580, 0x04000004, - 0x58080000, 0x40084000, 0x0401f7f3, 0x58080000, - 0x49781000, 0x802041c0, 0x04000006, 0x48004000, - 0x80000540, 0x04020007, 0x48226810, 0x0401f005, - 0x4802680f, 0x80000540, 0x04020002, 0x497a6810, - 0x4d2c0000, 0x400a5800, 0x4a025a06, 0x00000002, - 0x0201f800, 0x000202da, 0x5c025800, 0x0401f7bc, - 0x592c040a, 0x8c00051c, 0x04000016, 0x592c0206, - 0x82000580, 0x0000ffff, 0x04020012, 0x592e6009, - 0x83300580, 0xffffffff, 0x040007b1, 0x83300480, - 0x0010d1c0, 0x04001010, 0x59a8000b, 0x81300480, - 0x0402100d, 0x59300008, 0x800001c0, 0x04020005, - 0x59300203, 0x82000580, 0x00000007, 0x04000797, - 0x492fc857, 0x4a025a06, 0x00000029, 0x0201f000, - 0x000202da, 0x492fc857, 0x4a025a06, 0x00000008, - 0x0201f000, 0x000202da, 0x492fc857, 0x4a025a06, - 0x00000045, 0x0201f000, 0x000202da, 0x492fc857, - 0x4a025a06, 0x0000002a, 0x0201f000, 0x000202da, - 0x492fc857, 0x4a025a06, 0x00000028, 0x0201f000, - 0x000202da, 0x492fc857, 0x4a025a06, 0x00000006, - 0x0201f000, 0x000202da, 0x492fc857, 0x4a025a06, - 0x0000000e, 0x0201f000, 0x000202da, 0x59340010, - 0x492e6810, 0x492fc857, 0x80000d40, 0x04000003, - 0x492c0800, 0x1c01f000, 0x5934040b, 0x492e680f, - 0x492fc857, 0x4803c857, 0x80000540, 0x04020003, - 0x4a026a03, 0x00000001, 0x1c01f000, 0x59a8000e, - 0x81640480, 0x0402176e, 0x42026000, 0x0010d1c0, - 0x59300009, 0x81340580, 0x04020004, 0x59300202, - 0x80040580, 0x04000759, 0x83326400, 0x00000024, - 0x41580000, 0x81300480, 0x040017f6, 0x0401f760, - 0x492fc857, 0x592c0407, 0x82000c80, 0x0000199a, - 0x040215f1, 0x592c0204, 0x80000112, 0x040205de, - 0x592e8a06, 0x0201f800, 0x00020245, 0x04020059, - 0x0201f800, 0x001049e7, 0x04020059, 0x592e780a, - 0x493fc857, 0x8d3e7d3e, 0x04020007, 0x59a80021, - 0x80000540, 0x0402004f, 0x0201f800, 0x00104838, - 0x040005dd, 0x833c1d00, 0x0000001f, 0x040005da, - 0x592c0207, 0x82000c80, 0x00001000, 0x040215d6, - 0x800000c2, 0x800008c4, 0x8005d400, 0x592e9008, - 0x592e9809, 0x5934080d, 0x800409c0, 0x0402002e, - 0x833c1d00, 0x0000001f, 0x81780040, 0x80000000, - 0x800c1902, 0x040217fe, 0x040205c7, 0x0c01f001, - 0x001056e9, 0x001056ec, 0x001056f9, 0x001056fc, - 0x001056ff, 0x0201f800, 0x0010903e, 0x0401f01a, - 0x0201f800, 0x0010480b, 0x04000027, 0x80e9d1c0, - 0x02020800, 0x00105fae, 0x42028000, 0x00000005, - 0x417a9000, 0x417a9800, 0x0201f800, 0x0010904e, - 0x0401f00d, 0x42027000, 0x0000004d, 0x0401f006, - 0x42027000, 0x0000004e, 0x0401f003, 0x42027000, - 0x00000052, 0x0201f800, 0x001046c9, 0x02020800, - 0x0010907e, 0x04000010, 0x8d3e7d3e, 0x04020017, - 0x1c01f000, 0x58040002, 0x80000540, 0x04020007, - 0x4d3c0000, 0x40067800, 0x0201f800, 0x001047eb, - 0x5c027800, 0x040207cb, 0x4a025a06, 0x00000030, - 0x0401f00d, 0x4a025a06, 0x0000002c, 0x0401f00a, - 0x4a025a06, 0x00000028, 0x0401f007, 0x4a025a06, - 0x00000029, 0x0401f004, 0x497a5c09, 0x4a025a06, - 0x00000000, 0x4a025a04, 0x00000103, 0x0201f000, - 0x000202da, 0x492fc857, 0x592c0204, 0x80000110, - 0x80000040, 0x04000002, 0x0401f56f, 0x592c0207, - 0x82000500, 0x000003ff, 0x48025a07, 0x8c000506, - 0x04000004, 0x82000500, 0x00000070, 0x04020004, - 0x59a80821, 0x800409c0, 0x04020018, 0x4a025a06, - 0x0000dead, 0x592c0408, 0x82000500, 0x0000f0ff, - 0x48025c08, 0x0201f800, 0x001043b4, 0x04020002, - 0x1c01f000, 0x49425a06, 0x8058b1c0, 0x04000009, - 0x0201f800, 0x0010955f, 0x0401f80f, 0x44042800, - 0x82580580, 0x00000002, 0x04020002, 0x48082801, - 0x0201f000, 0x000202da, 0x42028000, 0x00000031, - 0x42000800, 0x00000001, 0x4200b000, 0x00000001, - 0x0401f7ed, 0x592c0408, 0x80000118, 0x832c2c00, - 0x00000009, 0x80142c00, 0x1c01f000, 0x492fc857, - 0x4a025a08, 0x00000006, 0x0201f000, 0x000202da, - 0x492fc857, 0x4a025a08, 0x00000001, 0x0201f000, - 0x000202da, 0x492fc857, 0x592c040a, 0x82000500, - 0x00000003, 0x04000020, 0x0201f800, 0x0002075a, - 0x04000021, 0x592c0204, 0x492e6008, 0x82000500, - 0x000000ff, 0x82000580, 0x00000045, 0x0400000e, - 0x592c000b, 0x0201f800, 0x00105c9a, 0x02000800, - 0x00020245, 0x04020018, 0x42027000, 0x00000041, - 0x49366009, 0x4a026406, 0x00000001, 0x0201f000, - 0x000207a1, 0x59300015, 0x8400055e, 0x48026015, - 0x42026800, 0x0010b524, 0x42027000, 0x00000040, - 0x0401f7f4, 0x4a025a06, 0x00000101, 0x0201f000, - 0x000202da, 0x4a025a06, 0x0000002c, 0x0201f000, - 0x000202da, 0x4a025a06, 0x00000028, 0x0201f800, - 0x000202da, 0x0201f000, 0x0002077d, 0x492fc857, - 0x0201f800, 0x001062e1, 0x0400000b, 0x592c0204, - 0x80000110, 0x80000040, 0x040204fb, 0x592c0c06, - 0x800409c0, 0x04000009, 0x42000000, 0x00000102, - 0x0401f003, 0x42000000, 0x00000104, 0x48025a06, - 0x0201f000, 0x000202da, 0x592c0c07, 0x800409c0, - 0x04000024, 0x82040480, 0x00000005, 0x04021021, - 0x4c040000, 0x80040800, 0x0201f800, 0x00106306, - 0x5c001000, 0x04020018, 0x832c0400, 0x00000008, - 0x4000a000, 0x0201f800, 0x0010632f, 0x04020012, - 0x592c1207, 0x82cc0580, 0x0010b50e, 0x04020009, - 0x58c80c0b, 0x84040d00, 0x84040d02, 0x8c081500, - 0x04000002, 0x84040d5e, 0x4805940b, 0x0401f001, - 0x42000000, 0x00000000, 0x48025a06, 0x0201f000, - 0x000202da, 0x42000000, 0x00000103, 0x0401f7fb, - 0x42000000, 0x00000102, 0x0401f7f8, 0x492fc857, - 0x592e7c06, 0x833c0500, 0xfffffffe, 0x04020043, - 0x592c4007, 0x42026000, 0x0010d1c0, 0x41581800, - 0x400c0000, 0x81300480, 0x04021023, 0x59300203, - 0x82000580, 0x00000000, 0x04000007, 0x59300008, - 0x80000d40, 0x04000004, 0x58040005, 0x80200580, - 0x04000004, 0x83326400, 0x00000024, 0x0401f7f1, - 0x58040204, 0x82000500, 0x000000ff, 0x82000d80, - 0x00000053, 0x04000007, 0x82000d80, 0x00000048, - 0x04000004, 0x82000580, 0x00000018, 0x04020023, - 0x4d2c0000, 0x0201f800, 0x00108be3, 0x5c025800, - 0x0400001e, 0x4a025a06, 0x00000000, 0x0201f000, - 0x000202da, 0x592e8a06, 0x83440480, 0x000007f0, - 0x04021016, 0x83440400, 0x0010ac00, 0x50000000, - 0x80026d40, 0x04000011, 0x4d2c0000, 0x0201f800, - 0x001047cb, 0x0400000c, 0x42028000, 0x00000005, - 0x592c0a08, 0x0201f800, 0x00104e70, 0x0201f800, - 0x001091cc, 0x0201f800, 0x000202da, 0x5c025800, - 0x0401f7e5, 0x5c025800, 0x4a025a06, 0x00000031, - 0x0201f000, 0x000202da, 0x492fc857, 0x4d2c0000, - 0x0201f800, 0x001007e4, 0x04000016, 0x492fc857, - 0x412f4000, 0x0201f800, 0x001007e4, 0x0400000e, - 0x492fc857, 0x412dd800, 0x0201f800, 0x00103b28, - 0x0201f800, 0x00103b32, 0x49a1d80b, 0x5c025800, - 0x492dd80a, 0x0201f800, 0x00102214, 0x0201f000, - 0x00102233, 0x41a25800, 0x0201f800, 0x001007f4, - 0x5c025800, 0x4a025a06, 0x00004005, 0x4a025c06, - 0x00000002, 0x0201f000, 0x000202da, 0x4807c857, - 0x485fc857, 0x4200b800, 0x00000001, 0x5c000800, - 0x4c5c0000, 0x0401f005, 0x4807c857, 0x485fc857, - 0x5c000800, 0x4d780000, 0x4803c857, 0x492fc857, - 0x8c00050e, 0x02020800, 0x001005d0, 0x4203e000, - 0x50000000, 0x4200b800, 0x00008003, 0x0201f000, - 0x001005dd, 0x592c0204, 0x80000110, 0x80000040, - 0x04020441, 0x0201f800, 0x00104a34, 0x04020002, - 0x1c01f000, 0x49425a06, 0x4806580d, 0x480a580e, - 0x4943c857, 0x4807c857, 0x480bc857, 0x0201f000, - 0x000202da, 0x592c0204, 0x80000110, 0x80000040, - 0x04020431, 0x0201f800, 0x00104b8b, 0x04020002, - 0x1c01f000, 0x49425a06, 0x48065811, 0x480a5812, - 0x0201f000, 0x000202da, 0x592c0204, 0x80000110, - 0x04000425, 0x80000040, 0x0402000c, 0x4202e000, - 0x00000001, 0x592c020a, 0x8c000504, 0x02000000, - 0x000204d0, 0x592c0207, 0x82000c80, 0x00001001, - 0x04021429, 0x0401f009, 0x4202e000, 0x00000003, - 0x48033002, 0x492f3003, 0x492f3004, 0x4a033008, - 0x000204d0, 0x1c01f000, 0x4202e000, 0x00000002, - 0x42000000, 0x0010beda, 0x50007000, 0x492c700b, - 0x4978700e, 0x4978700c, 0x592c0011, 0x592c0812, - 0x48007007, 0x48047008, 0x592c1013, 0x82080500, - 0xffff0000, 0x04000003, 0x0201f800, 0x001005d8, - 0x4978700d, 0x82080480, 0x00000180, 0x4803c857, - 0x04001007, 0x4800700f, 0x4a007005, 0x00000180, - 0x4a007004, 0x00000060, 0x0401f005, 0x4978700f, - 0x48087005, 0x80081104, 0x48087004, 0x5838000a, - 0x48007003, 0x40381000, 0x0201f000, 0x00100858, - 0x0201f800, 0x001007d3, 0x04000003, 0x59980007, - 0x0801f000, 0x1c01f000, 0x40307000, 0x5838000b, - 0x80025d40, 0x0400001b, 0x58380002, 0x82000580, - 0x00000100, 0x0400001d, 0x4c380000, 0x592c0204, - 0x82000500, 0x000000ff, 0x82000580, 0x00000012, - 0x0400000b, 0x592c0208, 0x8400054e, 0x48025a08, - 0x4a025a06, 0x00000002, 0x4a025a04, 0x00000103, - 0x0201f800, 0x000202c1, 0x0401f005, 0x4a025a06, - 0x00000010, 0x0201f800, 0x000202da, 0x5c007000, - 0x4202e000, 0x00000001, 0x4a007002, 0x00000100, - 0x49787010, 0x1c01f000, 0x58380004, 0x82000480, - 0x00000003, 0x04000087, 0x58380010, 0x8c000500, - 0x04020019, 0x4200b000, 0x00000003, 0x832cac00, - 0x00000011, 0x5838000a, 0x5838100d, 0x8008a400, - 0x4c380000, 0x0201f800, 0x0010ab17, 0x5c007000, - 0x5838000d, 0x82000400, 0x00000003, 0x4800700d, - 0x4a007010, 0x00000001, 0x58380004, 0x82000480, - 0x00000003, 0x48007004, 0x82000580, 0x00000003, - 0x0400006c, 0x5838000e, 0x80001d40, 0x04020020, - 0x4c380000, 0x0201f800, 0x001007d3, 0x5c007000, - 0x04000010, 0x4a025a04, 0x0000010a, 0x42001800, - 0x00000005, 0x480c700e, 0x5838000c, 0x80000540, - 0x04020002, 0x5838000b, 0x40000800, 0x492c0801, - 0x492c700c, 0x42000800, 0x0000000f, 0x0401f011, - 0x4202e000, 0x00000008, 0x4a033007, 0x00105915, - 0x1c01f000, 0x4202e000, 0x00000002, 0x42000000, - 0x0010beda, 0x50007000, 0x0401f7e7, 0x583a580c, - 0x400c0000, 0x42000800, 0x00000014, 0x80040c80, - 0x58381004, 0x5838000f, 0x41783000, 0x80000540, - 0x04020005, 0x84183540, 0x82081480, 0x00000003, - 0x0400003c, 0x40080000, 0x80040480, 0x04001002, - 0x40080800, 0x4004b000, 0x412c0000, 0x800c0400, - 0x4000a800, 0x5838000a, 0x5838100d, 0x8008a400, - 0x4c080000, 0x4c040000, 0x4c0c0000, 0x4c380000, - 0x0201f800, 0x0010ab17, 0x5c007000, 0x5c001800, - 0x5c000800, 0x40040000, 0x58381004, 0x80080480, - 0x48007004, 0x82000580, 0x00000003, 0x04000002, - 0x84183500, 0x5c000000, 0x80041400, 0x82080480, - 0x00000060, 0x04020003, 0x84183542, 0x41781000, - 0x400c0000, 0x80041c00, 0x820c0480, 0x00000014, - 0x04020003, 0x84183544, 0x40001800, 0x40080800, - 0x4804700d, 0x480c700e, 0x40180000, 0x0c01f001, - 0x00105960, 0x00105964, 0x00105962, 0x00105960, - 0x001058fc, 0x00105964, 0x00105962, 0x00105960, - 0x0201f800, 0x001005d8, 0x5838100f, 0x0401f739, - 0x5838080d, 0x82040400, 0x00000002, 0x5838100a, - 0x80080400, 0x50001000, 0x800811c0, 0x0402000f, - 0x4202e000, 0x00000001, 0x583a580b, 0x4978700b, - 0x49787010, 0x592c0204, 0x82000500, 0x000000ff, - 0x82000580, 0x00000012, 0x02000000, 0x00020507, - 0x0201f000, 0x000204d0, 0x5838000a, 0x80040c00, - 0x82381c00, 0x00000007, 0x54041800, 0x80040800, - 0x800c1800, 0x54041800, 0x0401f71a, 0x0201f800, - 0x001007d3, 0x02000800, 0x001005d8, 0x4a02580a, - 0x0010be79, 0x42000800, 0x0010beda, 0x452c0800, - 0x497a580b, 0x497a580c, 0x497a580d, 0x497a580e, - 0x497a580f, 0x4a025809, 0x001058b6, 0x497a5810, - 0x4a025802, 0x00000100, 0x4a025801, 0x00000001, - 0x1c01f000, 0x59c80007, 0x8c000502, 0x04000070, - 0x835c2c80, 0x00000005, 0x02001000, 0x00105f23, - 0x59c82817, 0x497b9005, 0x82140500, 0x00e00000, - 0x0402004f, 0x82140500, 0x000003ff, 0x82001c00, - 0x00000006, 0x41cc2000, 0x42003000, 0x00006080, - 0x820c0480, 0x00000040, 0x04001006, 0x42001000, - 0x00000040, 0x820c1c80, 0x00000040, 0x0401f003, - 0x400c1000, 0x41781800, 0x54182000, 0x80102000, - 0x80183000, 0x80081040, 0x040207fc, 0x800c19c0, - 0x04000005, 0x59c80005, 0x80000000, 0x48039005, - 0x0401f7ea, 0x82140500, 0x01f60000, 0x04020029, - 0x82140500, 0x0000f000, 0x0400000b, 0x82000c80, - 0x00002000, 0x0402100f, 0x82140500, 0x0e000000, - 0x80000132, 0x0c01f840, 0x4a039005, 0x00000140, - 0x1c01f000, 0x59cc0400, 0x82000500, 0x0000ff00, - 0x82000580, 0x00008100, 0x040007f4, 0x0401f01c, - 0x4817c857, 0x82140500, 0x000003ff, 0x04020007, - 0x59cc0400, 0x82000500, 0x0000ff00, 0x82000580, - 0x00008100, 0x04020012, 0x42000000, 0x0010b8bd, - 0x0201f800, 0x0010aa47, 0x0201f800, 0x00105dfa, - 0x4803c856, 0x4a039005, 0x00000140, 0x0401f020, - 0x4817c857, 0x82140500, 0x00f60000, 0x04020004, - 0x0201f800, 0x00105e35, 0x040207d2, 0x0201f800, - 0x0010513b, 0x04000010, 0x59c400a4, 0x4803c857, - 0x82000500, 0x0000000f, 0x82000580, 0x0000000a, - 0x04020009, 0x497b5016, 0x59c400a3, 0x82000540, - 0x00080000, 0x480388a3, 0x82000500, 0xfff7ffff, - 0x480388a3, 0x4817c856, 0x0201f800, 0x0010a978, - 0x4a039005, 0x00000140, 0x0401f842, 0x4803c856, - 0x1c01f000, 0x00105a1d, 0x00105cf4, 0x00105a15, - 0x00105a15, 0x00105a15, 0x00105a15, 0x00105a15, - 0x00105a15, 0x4803c857, 0x42000000, 0x0010b85a, - 0x0201f800, 0x0010aa47, 0x4a039005, 0x00000140, - 0x1c01f000, 0x4817c857, 0x59cc0400, 0x4803c857, - 0x82000d00, 0x0000ff00, 0x82041500, 0x0000f000, - 0x840409c0, 0x82140500, 0x000003ff, 0x800018c4, - 0x8c142d14, 0x04000005, 0x59cc0002, 0x82000500, - 0x00000003, 0x800c1c80, 0x480f5016, 0x82080580, - 0x00002000, 0x04020011, 0x836c0580, 0x00000001, - 0x0402000c, 0x59cc0006, 0x82000500, 0xff000000, - 0x82000580, 0x11000000, 0x04020011, 0x0201f800, - 0x00103b38, 0x0201f800, 0x00105f48, 0x0401f00c, - 0x0401f81f, 0x0401f00a, 0x82080580, 0x00003000, - 0x04020003, 0x0401fa06, 0x0401f005, 0x82080580, - 0x00008000, 0x04020002, 0x0401fafc, 0x1c01f000, - 0x4817c857, 0x42000000, 0x0010b859, 0x0201f800, - 0x0010aa47, 0x836c0580, 0x00000003, 0x0402000b, - 0x4c080000, 0x4c0c0000, 0x42001000, 0x00008048, - 0x40141800, 0x80142120, 0x0201f800, 0x00103a3e, - 0x5c001800, 0x5c001000, 0x1c01f000, 0x4807c857, - 0x59cc0002, 0x82000500, 0xff000000, 0x82001580, - 0x01000000, 0x04000004, 0x82001580, 0x23000000, - 0x04020192, 0x82040580, 0x00000023, 0x0402003f, - 0x0401fb6a, 0x0400018d, 0x59300c06, 0x82040580, - 0x00000010, 0x04000013, 0x82040580, 0x00000011, - 0x04000010, 0x82040580, 0x00000001, 0x0400000d, - 0x82040580, 0x00000004, 0x0400000a, 0x82040580, - 0x00000008, 0x04000007, 0x82040580, 0x0000000a, - 0x04000004, 0x4933c857, 0x4807c857, 0x0401f177, - 0x59300004, 0x82000500, 0x80010000, 0x04000004, - 0x0201f800, 0x00106f60, 0x04020170, 0x59cc0a04, - 0x48066202, 0x59cc0006, 0x82000500, 0xffff0000, - 0x82000d80, 0x02000000, 0x04020005, 0x42027000, - 0x00000015, 0x0201f000, 0x000207a1, 0x82000d80, - 0x02140000, 0x040007fa, 0x82000d80, 0x02100000, - 0x040007f7, 0x82000d80, 0x02100000, 0x040007f4, - 0x82000d80, 0x01000000, 0x04020158, 0x59cc0006, - 0x82000500, 0x0000ffff, 0x04020154, 0x42027000, - 0x00000016, 0x0401f7ec, 0x82040580, 0x00000022, - 0x0402014e, 0x59a80806, 0x8c040d14, 0x04000011, - 0x0401f967, 0x0402000f, 0x0401f97d, 0x0400000d, - 0x42027000, 0x0000004c, 0x59cc0001, 0x82000500, - 0x00ffffff, 0x0201f800, 0x00105eec, 0x0400012a, - 0x42028800, 0x0000ffff, 0x417a6800, 0x0401f126, - 0x59cc0006, 0x82000500, 0xffff0000, 0x82000d80, - 0x03000000, 0x04020021, 0x59a80026, 0x8c000508, - 0x04000017, 0x8400054c, 0x48035026, 0x59cc0800, - 0x82040d00, 0x00ffffff, 0x48075010, 0x497b8830, - 0x84040d70, 0x48078832, 0x59c40802, 0x84040d4c, - 0x48078802, 0x59cc0007, 0x82000500, 0x0000ffff, - 0x48038893, 0x4803501e, 0x42000800, 0x00000003, - 0x59a81010, 0x0201f800, 0x00106c78, 0x59cc0006, - 0x82000500, 0x0000ffff, 0x04020118, 0x42027000, - 0x00000017, 0x0401f0d9, 0x82000d80, 0x04000000, - 0x04020011, 0x59cc0006, 0x82000500, 0x0000ffff, - 0x0402010e, 0x0201f800, 0x0010513b, 0x04000004, - 0x42027000, 0x0000001d, 0x0401f0cc, 0x59a80026, - 0x84000548, 0x48035026, 0x42027000, 0x00000030, - 0x0401f0c6, 0x82000d80, 0x05000000, 0x04020008, - 0x59cc0006, 0x82000500, 0x0000ffff, 0x040200fb, - 0x42027000, 0x00000018, 0x0401f0bc, 0x82000d80, - 0x20100000, 0x04020004, 0x42027000, 0x00000019, - 0x0401f0b6, 0x82000d80, 0x21100000, 0x04020004, - 0x42027000, 0x0000001a, 0x0401f0b0, 0x82000d80, - 0x52000000, 0x04020008, 0x59cc0006, 0x82000500, - 0x0000ffff, 0x040200e5, 0x42027000, 0x0000001b, - 0x0401f0a6, 0x82000d80, 0x50000000, 0x04020008, - 0x59cc0006, 0x82000500, 0x0000ffff, 0x040200db, - 0x42027000, 0x0000001c, 0x0401f09c, 0x82000d80, - 0x13000000, 0x04020004, 0x42027000, 0x00000034, - 0x0401f096, 0x82000d80, 0x12000000, 0x04020008, - 0x59cc0006, 0x82000500, 0x0000ffff, 0x040200cb, - 0x42027000, 0x00000024, 0x0401f08c, 0x82000d00, - 0xff000000, 0x82040d80, 0x24000000, 0x04020004, - 0x42027000, 0x0000002d, 0x0401f084, 0x82000d00, - 0xff000000, 0x82040d80, 0x53000000, 0x04020004, - 0x42027000, 0x0000002a, 0x0401f07c, 0x82000d80, - 0x0f000000, 0x04020004, 0x42027000, 0x00000020, - 0x0401f076, 0x82000d80, 0x61040000, 0x04020036, - 0x83cc1400, 0x00000006, 0x80080800, 0x50080000, - 0x82000500, 0x0000ffff, 0x82000480, 0x00000004, - 0x4c580000, 0x8000b104, 0x8058b1c0, 0x04000026, - 0x4c100000, 0x50041800, 0x820c1500, 0x03000000, - 0x80081130, 0x42000000, 0x0010b817, 0x82082580, - 0x00000000, 0x04020004, 0x42000000, 0x0010b814, - 0x0401f00c, 0x82082580, 0x00000001, 0x04020004, - 0x42000000, 0x0010b815, 0x0401f006, 0x82082580, - 0x00000002, 0x04020003, 0x42000000, 0x0010b816, - 0x0201f800, 0x0010aa47, 0x42001000, 0x00008015, - 0x820c2500, 0x0000ffff, 0x800c1920, 0x0201f800, - 0x00103a3e, 0x5c002000, 0x80040800, 0x8058b040, - 0x040207da, 0x5c00b000, 0x42027000, 0x00000023, - 0x0401f03e, 0x82000d80, 0x60000000, 0x04020004, - 0x42027000, 0x0000003f, 0x0401f038, 0x82000d80, - 0x54000000, 0x04020006, 0x0401fb12, 0x0402006f, - 0x42027000, 0x00000046, 0x0401f030, 0x82000d80, - 0x55000000, 0x04020009, 0x0401fb32, 0x04020004, - 0x42027000, 0x00000041, 0x0401f028, 0x42027000, - 0x00000042, 0x0401f025, 0x82000d80, 0x78000000, - 0x04020004, 0x42027000, 0x00000045, 0x0401f01f, - 0x82000d80, 0x10000000, 0x04020004, 0x42027000, - 0x0000004e, 0x0401f019, 0x82000d80, 0x63000000, - 0x04020004, 0x42027000, 0x0000004a, 0x0401f013, - 0x82000d00, 0xff000000, 0x82040d80, 0x56000000, - 0x04020004, 0x42027000, 0x0000004f, 0x0401f00b, - 0x82000d00, 0xff000000, 0x82040d80, 0x57000000, - 0x04020004, 0x42027000, 0x00000050, 0x0401f003, - 0x42027000, 0x0000001d, 0x59cc3800, 0x821c3d00, - 0x00ffffff, 0x821c0580, 0x00fffffe, 0x59cc0001, - 0x04020005, 0x40003000, 0x42028800, 0x000007fe, - 0x0401f003, 0x0401f8d1, 0x04020030, 0x0201f800, - 0x001045a6, 0x0402002d, 0x83380580, 0x00000046, - 0x04020004, 0x59a80010, 0x80180580, 0x04000027, - 0x59340200, 0x8c000514, 0x0400000f, 0x83380580, - 0x00000030, 0x0400000c, 0x83380580, 0x0000003f, - 0x04000009, 0x83380580, 0x00000034, 0x04000006, - 0x83380580, 0x00000024, 0x04000003, 0x42027000, - 0x0000004c, 0x0201f800, 0x0002075a, 0x04000018, - 0x49366009, 0x4a026406, 0x00000004, 0x59cc0c04, - 0x48066202, 0x83380580, 0x0000004c, 0x04020009, - 0x4a026406, 0x00000011, 0x813669c0, 0x04020005, - 0x59cc0001, 0x82000500, 0x00ffffff, 0x4802601e, - 0x0201f000, 0x000207a1, 0x59880052, 0x4803c857, - 0x80000000, 0x48031052, 0x1c01f000, 0x42001000, - 0x00008049, 0x59cc1806, 0x800c1930, 0x0201f800, - 0x00103a3e, 0x0201f800, 0x00107942, 0x040007f3, - 0x49366009, 0x4a026406, 0x00000004, 0x59cc0c04, - 0x48066202, 0x4a026403, 0x00000009, 0x4a02641a, - 0x00000009, 0x4a02621a, 0x00002900, 0x4a026203, - 0x00000001, 0x0201f000, 0x0010672b, 0x59a80026, - 0x4803c857, 0x8c000508, 0x04000010, 0x59cc0006, - 0x82000500, 0xff000000, 0x82000d80, 0x03000000, - 0x0400000c, 0x82000d80, 0x20000000, 0x04000009, - 0x82000d80, 0x05000000, 0x04000006, 0x82000d80, - 0x21000000, 0x04000003, 0x80000580, 0x1c01f000, - 0x82000540, 0x00000001, 0x0401f7fd, 0x59cc2006, - 0x82102500, 0xff000000, 0x9c1021c0, 0x0401f807, - 0x820c1c00, 0x0010b4e3, 0x500c1800, 0x800c0500, - 0x4803c857, 0x1c01f000, 0x40100800, 0x41781800, - 0x82040480, 0x00000020, 0x04001004, 0x800c1800, - 0x40000800, 0x0401f7fb, 0x82040500, 0x0000000f, - 0x82000400, 0x0010ab38, 0x50000000, 0x8c040d08, - 0x04000002, 0x900001c0, 0x1c01f000, 0x4803c856, - 0x0401fac3, 0x0402000a, 0x0201f800, 0x0010210a, - 0x04020007, 0x59cc0002, 0x82000500, 0xff000000, - 0x82000d80, 0x08000000, 0x04000802, 0x1c01f000, - 0x4803c856, 0x59cc0400, 0x82000d00, 0x0000ff00, - 0x840409c0, 0x82040580, 0x00000033, 0x0402001f, - 0x0401f976, 0x04000038, 0x59cc0a04, 0x48066202, - 0x59cc0006, 0x4803c857, 0x82000500, 0xffff0000, - 0x82000d80, 0x02000000, 0x04020009, 0x59cc0006, - 0x82000500, 0x0000ffff, 0x0402002b, 0x42027000, - 0x00000015, 0x0201f000, 0x000207a1, 0x82000d80, - 0x01000000, 0x04020024, 0x59cc0006, 0x82000500, - 0x0000ffff, 0x04020020, 0x42027000, 0x00000016, - 0x0201f000, 0x000207a1, 0x82040580, 0x00000032, - 0x04020019, 0x59cc0006, 0x82000500, 0xffff0000, - 0x82000d80, 0x14000000, 0x04020013, 0x42027000, - 0x00000038, 0x59cc0001, 0x0401f810, 0x0402000e, - 0x0201f800, 0x001045a6, 0x0402000b, 0x0201f800, - 0x0002075a, 0x04000008, 0x49366009, 0x4a026406, - 0x00000004, 0x59cc0c04, 0x48066202, 0x0201f000, - 0x000207a1, 0x1c01f000, 0x4803c857, 0x4c580000, - 0x4c100000, 0x4c380000, 0x4c340000, 0x82003500, - 0x00ffffff, 0x82181500, 0x00ff0000, 0x82081580, - 0x00ff0000, 0x04020016, 0x82181480, 0x00fffffc, - 0x04001013, 0x82181580, 0x00fffffd, 0x04020004, - 0x42028800, 0x000007fd, 0x0401f040, 0x82181580, - 0x00fffffe, 0x04020004, 0x42028800, 0x000007fe, - 0x0401f03a, 0x82181580, 0x00fffffc, 0x04020004, - 0x42028800, 0x000007fc, 0x0401f034, 0x41781000, - 0x42002000, 0x00000000, 0x4200b000, 0x000007f0, - 0x41ac7000, 0x50380000, 0x80006d40, 0x04020005, - 0x800811c0, 0x0402001e, 0x8410155e, 0x0401f01c, - 0x58340212, 0x82000500, 0x0000ff00, 0x04000011, - 0x59a84010, 0x82204500, 0x00ffff00, 0x82180500, - 0x00ffff00, 0x04000002, 0x80200580, 0x58340002, - 0x0402000f, 0x82000500, 0x000000ff, 0x82184500, - 0x000000ff, 0x80204580, 0x04020009, 0x0401f006, - 0x58340002, 0x82000500, 0x00ffffff, 0x80184580, - 0x04020003, 0x40128800, 0x0401f00c, 0x80102000, - 0x80387000, 0x8058b040, 0x040207db, 0x800811c0, - 0x04020005, 0x481bc857, 0x82000540, 0x00000001, - 0x0401f003, 0x840a8d1e, 0x80000580, 0x5c006800, - 0x5c007000, 0x5c002000, 0x5c00b000, 0x1c01f000, - 0x59a80026, 0x8c00050e, 0x04000003, 0x8c000502, - 0x04000006, 0x59cc0c00, 0x80040910, 0x82040500, - 0x0000000f, 0x0c01f002, 0x1c01f000, 0x00105d0f, - 0x00105d0f, 0x00105d0f, 0x00105de5, 0x00105d0f, - 0x00105d11, 0x00105d29, 0x00105d2c, 0x00105d0f, - 0x00105d0f, 0x00105d0f, 0x00105d0f, 0x00105d0f, - 0x00105d0f, 0x00105d0f, 0x00105d0f, 0x4803c856, - 0x1c01f000, 0x0401f8c5, 0x04000014, 0x82140500, - 0x000003ff, 0x800000c4, 0x82000480, 0x00000008, - 0x0400100e, 0x59cc0001, 0x59326809, 0x59340802, - 0x80040580, 0x82000500, 0x00ffffff, 0x04020007, - 0x59cc0a04, 0x48066202, 0x42027000, 0x00000046, - 0x0201f000, 0x000207a1, 0x59cc0004, 0x4803c857, - 0x1c01f000, 0x59cc0004, 0x4803c857, 0x1c01f000, - 0x0401f8aa, 0x04000016, 0x82140500, 0x000003ff, - 0x800000c4, 0x82000480, 0x0000000c, 0x04001010, - 0x59cc0001, 0x82000500, 0x00ffffff, 0x59326809, - 0x59340802, 0x82040d00, 0x00ffffff, 0x80040580, - 0x04020007, 0x59cc0a04, 0x48066202, 0x42027000, - 0x00000045, 0x0201f000, 0x000207a1, 0x59cc0004, - 0x4803c857, 0x1c01f000, 0x4817c857, 0x0401f9c8, - 0x04020011, 0x0201f800, 0x0010210a, 0x0402000e, - 0x59cc0002, 0x82000500, 0xff000000, 0x82000580, - 0x00000000, 0x04020008, 0x82040500, 0x0000000f, - 0x82000c80, 0x00000006, 0x04021003, 0x4803c857, - 0x0c01f002, 0x1c01f000, 0x00105d60, 0x00105d64, - 0x00105d60, 0x00105d60, 0x00105db2, 0x00105dc3, - 0x4803c857, 0x59cc0004, 0x4803c857, 0x1c01f000, - 0x59cc0004, 0x4803c857, 0x59a80016, 0x800001c0, - 0x040207f8, 0x59cc0802, 0x8c040d2e, 0x0402001d, - 0x0201f800, 0x00107942, 0x02000800, 0x001005d8, - 0x59cc0001, 0x4803c857, 0x0401ff28, 0x0402000d, - 0x0201f800, 0x00020245, 0x0402000a, 0x4a026406, - 0x00000005, 0x49366009, 0x59cc0c04, 0x48066202, - 0x42027000, 0x00000088, 0x0201f000, 0x000207a1, - 0x42028800, 0x0000ffff, 0x417a6800, 0x59cc0001, - 0x82000500, 0x00ffffff, 0x4802601e, 0x0401f7f0, - 0x59cc0001, 0x4803c857, 0x0401ff10, 0x040207d5, - 0x0201f800, 0x001045a6, 0x040207d2, 0x59cc0005, - 0x8c000500, 0x04020004, 0x59340200, 0x8c00050e, - 0x040207cc, 0x0201f800, 0x001049f3, 0x0402000f, - 0x0401f83e, 0x040007c7, 0x0201f800, 0x0002075a, - 0x040007c4, 0x49366009, 0x4a026406, 0x00000002, - 0x59cc0c04, 0x48066202, 0x42027000, 0x00000088, - 0x0201f000, 0x000207a1, 0x0201f800, 0x0002075a, - 0x040007b8, 0x49366009, 0x4a026406, 0x00000004, - 0x59cc0c04, 0x48066202, 0x42027000, 0x00000001, - 0x0201f000, 0x000207a1, 0x59cc0004, 0x4803c857, - 0x59cc0802, 0x8c040d2e, 0x0400000b, 0x0401f81f, - 0x04000009, 0x0401f960, 0x04020007, 0x59cc0a04, - 0x48066202, 0x42027000, 0x00000089, 0x0201f000, - 0x000207a1, 0x4933c857, 0x1c01f000, 0x59cc0004, - 0x4803c857, 0x59cc0802, 0x8c040d2e, 0x0400000b, - 0x0401f80e, 0x04000009, 0x0401f94f, 0x04020007, - 0x59cc0a04, 0x48066202, 0x42027000, 0x0000008a, - 0x0201f000, 0x000207a1, 0x4933c857, 0x1c01f000, - 0x59cc0a04, 0x0401f002, 0x59cc0c04, 0x59a8000e, - 0x59a81067, 0x80080400, 0x80040480, 0x04021008, - 0x40040000, 0x800000c4, 0x800408ca, 0x80040c00, - 0x82066400, 0x0010d1c0, 0x1c01f000, 0x80000580, - 0x0401f7fe, 0x59cc0802, 0x8c040d2e, 0x04020010, - 0x0401ffec, 0x0400000e, 0x59cc0001, 0x82000500, - 0x00ffffff, 0x59326809, 0x59340802, 0x82040d00, - 0x00ffffff, 0x80040580, 0x04020005, 0x42027000, - 0x00000051, 0x0201f000, 0x000207a1, 0x59cc0004, - 0x4803c857, 0x1c01f000, 0x4803c856, 0x42003000, - 0x00000105, 0x0401f001, 0x4803c856, 0x4c3c0000, - 0x41cc7800, 0x0401f803, 0x5c007800, 0x1c01f000, - 0x4803c856, 0x4c580000, 0x583c0400, 0x82000500, - 0x0000f000, 0x82000580, 0x0000c000, 0x04000024, - 0x0201f800, 0x0002075a, 0x04000021, 0x4c180000, - 0x583c0001, 0x0401fe89, 0x0402001f, 0x0201f800, - 0x001045a6, 0x0402001c, 0x49366009, 0x0201f800, - 0x001007e4, 0x04000018, 0x492e6017, 0x497a5800, - 0x497a5a04, 0x48125c04, 0x832cac00, 0x00000005, - 0x4200b000, 0x00000007, 0x403ca000, 0x0201f800, - 0x0010ab17, 0x5c003000, 0x481a641a, 0x4a026403, - 0x0000003e, 0x4a026406, 0x00000001, 0x4a026203, - 0x00000001, 0x0201f800, 0x0010672b, 0x5c00b000, - 0x1c01f000, 0x0201f800, 0x0002077d, 0x5c003000, - 0x0401f7fb, 0x4803c856, 0x59cc0400, 0x82000d00, - 0x0000ff00, 0x82040500, 0x0000f000, 0x840409c0, - 0x82000580, 0x00002000, 0x04020049, 0x82040580, - 0x00000022, 0x0402003a, 0x59c400a4, 0x82000500, - 0x0000000f, 0x82000c80, 0x00000007, 0x04001004, - 0x82000480, 0x0000000c, 0x0400103f, 0x59cc0006, - 0x82000500, 0xffff0000, 0x82000d80, 0x04000000, - 0x04000039, 0x82000d80, 0x60000000, 0x04000036, - 0x82000d80, 0x54000000, 0x04000033, 0x82000d80, - 0x03000000, 0x04020015, 0x59a80826, 0x8c040d02, - 0x0402002d, 0x8c040d08, 0x0402002b, 0x0201f800, - 0x001048ec, 0x0400002b, 0x59a8001d, 0x800000d0, - 0x59a80810, 0x82040d00, 0x000000ff, 0x80040540, - 0x59cc0800, 0x82040d00, 0x00ffffff, 0x80040580, - 0x0402001b, 0x0401f01c, 0x59c40802, 0x8c040d0c, - 0x04020017, 0x82000d80, 0x52000000, 0x040007ec, - 0x82000d80, 0x05000000, 0x040007e9, 0x82000d80, - 0x50000000, 0x040007e6, 0x0401f00d, 0x82040580, - 0x00000023, 0x0402000a, 0x0401ff58, 0x04000008, - 0x59300c03, 0x82040580, 0x00000002, 0x04000006, - 0x82040580, 0x00000051, 0x04000003, 0x80000580, - 0x0401f003, 0x82000540, 0x00000001, 0x1c01f000, - 0x59cc0006, 0x82000500, 0xffff0000, 0x82000d80, - 0x03000000, 0x04000004, 0x82000d80, 0x52000000, - 0x040207f3, 0x59a80026, 0x82000500, 0x00000009, - 0x82000580, 0x00000008, 0x040007ef, 0x0401f7ec, - 0x4803c856, 0x4c5c0000, 0x4c580000, 0x59a80016, - 0x82000580, 0x0000004c, 0x0402001f, 0x59ccb807, - 0x9c5cb9c0, 0x825cbd00, 0x00000007, 0x8c5cbd00, - 0x0400000a, 0x4200b000, 0x00000002, 0x83a81c00, - 0x00000002, 0x83cc1400, 0x0000000d, 0x0201f800, - 0x0010855a, 0x04020010, 0x8c5cbd02, 0x0400000a, - 0x4200b000, 0x00000002, 0x83a81c00, 0x00000000, - 0x83cc1400, 0x0000000f, 0x0201f800, 0x0010855a, - 0x04020005, 0x8c5cbd04, 0x04000003, 0x82000540, - 0x00000001, 0x5c00b000, 0x5c00b800, 0x1c01f000, - 0x4803c856, 0x4c5c0000, 0x4c580000, 0x59a80016, - 0x82000580, 0x0000004c, 0x0402001f, 0x59ccb807, - 0x9c5cb9c0, 0x825cbd00, 0x00000007, 0x8c5cbd00, - 0x0400000a, 0x4200b000, 0x00000002, 0x83a81c00, - 0x00000002, 0x83cc1400, 0x00000009, 0x0201f800, - 0x0010855a, 0x04020010, 0x8c5cbd02, 0x0400000a, - 0x4200b000, 0x00000002, 0x83a81c00, 0x00000000, - 0x83cc1400, 0x0000000b, 0x0201f800, 0x0010855a, - 0x04020005, 0x8c5cbd04, 0x04000003, 0x82000540, - 0x00000001, 0x5c00b000, 0x5c00b800, 0x1c01f000, - 0x4803c857, 0x4c580000, 0x40003000, 0x42002000, - 0x000007f0, 0x4200b000, 0x00000010, 0x83ac7400, - 0x000007f0, 0x50380000, 0x80026d40, 0x04000006, - 0x59340002, 0x82000500, 0x00ffffff, 0x80180580, - 0x04000010, 0x80102000, 0x80387000, 0x8058b040, - 0x040207f5, 0x82100480, 0x00000800, 0x42002000, - 0x00000000, 0x4200b000, 0x000007f0, 0x41ac7000, - 0x040217ed, 0x82000540, 0x00000001, 0x0401f002, - 0x40128800, 0x5c00b000, 0x1c01f000, 0x59a80026, - 0x8c00050e, 0x04000004, 0x8c000502, 0x04000003, - 0x80000580, 0x1c01f000, 0x82000540, 0x00000001, - 0x0401f7fd, 0x59300c06, 0x82040580, 0x00000002, - 0x04000006, 0x82040580, 0x00000005, 0x04000003, - 0x82000540, 0x00000001, 0x1c01f000, 0x59c80000, - 0x84000558, 0x84000512, 0x48039000, 0x1c01f000, - 0x4a03281a, 0x000003e8, 0x4a032802, 0x0010d1c0, - 0x4a032800, 0x00000000, 0x4a032808, 0x00107049, - 0x42000000, 0x00000005, 0x83947c00, 0x00000009, - 0x49787801, 0x4a007802, 0x00106fff, 0x823c7c00, - 0x00000003, 0x80000040, 0x040207fa, 0x4a032819, - 0xffff0000, 0x4201d000, 0x00000064, 0x0401f96e, - 0x4201d000, 0x000186a0, 0x0401f184, 0x00000000, - 0x00000003, 0x00000006, 0x00000009, 0x0000000c, - 0x4d300000, 0x4d2c0000, 0x4d340000, 0x4d400000, - 0x4cfc0000, 0x4d380000, 0x4d3c0000, 0x4d440000, - 0x4d4c0000, 0x4d480000, 0x4c5c0000, 0x4c600000, - 0x4c640000, 0x4cc80000, 0x4ccc0000, 0x0201f800, - 0x0002057b, 0x5c019800, 0x5c019000, 0x5c00c800, - 0x5c00c000, 0x5c00b800, 0x5c029000, 0x5c029800, - 0x5c028800, 0x5c027800, 0x5c027000, 0x5c01f800, - 0x5c028000, 0x5c026800, 0x5c025800, 0x5c026000, - 0x1c01f000, 0x59940004, 0x80000540, 0x0402000a, - 0x59940025, 0x80040400, 0x02001800, 0x001005d8, - 0x48032804, 0x480b2805, 0x4a032803, 0x0000000a, - 0x80000580, 0x1c01f000, 0x5994001f, 0x80000540, - 0x0402000a, 0x59940025, 0x80040400, 0x02001800, - 0x001005d8, 0x4803281f, 0x480b2820, 0x4a03281e, - 0x00000001, 0x80000580, 0x1c01f000, 0x59940022, - 0x80000540, 0x0402000a, 0x59940025, 0x80040400, - 0x02001800, 0x001005d8, 0x48032822, 0x480b2823, - 0x4a032821, 0x0000000a, 0x80000580, 0x1c01f000, - 0x4c000000, 0x59940005, 0x4803c857, 0x480bc857, - 0x80080580, 0x04020003, 0x497b2804, 0x497b2805, - 0x5c000000, 0x1c01f000, 0x4c000000, 0x59940020, - 0x4803c857, 0x480bc857, 0x80080580, 0x04020003, - 0x497b281f, 0x497b2820, 0x5c000000, 0x1c01f000, - 0x4c000000, 0x59940023, 0x4803c857, 0x480bc857, - 0x80080580, 0x04020003, 0x497b2822, 0x497b2823, - 0x5c000000, 0x1c01f000, 0x4937c857, 0x48ebc857, - 0x59340203, 0x80e80480, 0x04001002, 0x48ea6a03, - 0x1c01f000, 0x5c03e000, 0x1c01f000, 0x4d440000, - 0x42007800, 0x00000010, 0x59968801, 0x0201f800, - 0x00020245, 0x04020012, 0x59341a03, 0x800c1840, - 0x0400100f, 0x59940027, 0x800c0480, 0x04000003, - 0x48026a03, 0x0402100a, 0x5934000f, 0x497a6a03, - 0x80000540, 0x04000006, 0x4c3c0000, 0x5934140b, - 0x0201f800, 0x00020253, 0x5c007800, 0x81468800, - 0x83440480, 0x00000800, 0x04021007, 0x803c7840, - 0x040207e7, 0x49472801, 0x5c028800, 0x5c03e000, - 0x1c01f000, 0x4a032800, 0x00000002, 0x497b2801, - 0x0401f7fa, 0x42007800, 0x00000010, 0x59966002, - 0x59300205, 0x80000d40, 0x04000006, 0x59940027, - 0x80040480, 0x48026205, 0x0400102d, 0x0400002c, - 0x59300206, 0x80000d40, 0x04000014, 0x59b800e4, - 0x8c000524, 0x04020011, 0x4a0370e4, 0x00030000, - 0x40000000, 0x59b800e4, 0x8c000524, 0x04000004, - 0x4a0370e4, 0x00020000, 0x0401f008, 0x59940027, - 0x80040480, 0x48026206, 0x4a0370e4, 0x00020000, - 0x0400101c, 0x0400001b, 0x83326400, 0x00000024, - 0x49332802, 0x41540000, 0x81300480, 0x04021005, - 0x803c7840, 0x040207db, 0x5c03e000, 0x1c01f000, - 0x59940026, 0x48032827, 0x4a032802, 0x0010d1c0, - 0x497b2826, 0x80000540, 0x0400000f, 0x4a032800, - 0x00000001, 0x5c03e000, 0x1c01f000, 0x4c3c0000, - 0x0201f800, 0x001091db, 0x5c007800, 0x0401f7d1, - 0x4c3c0000, 0x0201f800, 0x00108d5d, 0x5c007800, - 0x0401f7e2, 0x4a032800, 0x00000000, 0x5c03e000, - 0x1c01f000, 0x59a8086b, 0x8c040d30, 0x04020029, - 0x8c040d32, 0x0400000f, 0x59a80069, 0x81640480, - 0x04001019, 0x59a8000b, 0x81500580, 0x04000005, - 0x59a8006a, 0x59a81066, 0x80080580, 0x04020012, - 0x900411c0, 0x82081500, 0x00007000, 0x0401f012, - 0x82040500, 0x0000001f, 0x04000016, 0x80040840, - 0x82040500, 0x0000001f, 0x04000003, 0x4807506b, - 0x0401f010, 0x900401c0, 0x82000500, 0x0000001f, - 0x80040d40, 0x900401c0, 0x80040580, 0x82001500, - 0x00007000, 0x82040500, 0xffff8fff, 0x80080540, - 0x4803506b, 0x80081114, 0x0201f800, 0x001006e2, - 0x1c01f000, 0x4a032807, 0x000007d0, 0x4a032806, - 0x0000000a, 0x1c01f000, 0x42000800, 0x000007d0, - 0x83180480, 0x00000005, 0x02021800, 0x001005d8, - 0x83947c00, 0x00000009, 0x83180400, 0x00105f43, - 0x50000000, 0x803c7c00, 0x48047801, 0x4a007800, - 0x0000000a, 0x1c01f000, 0x83180480, 0x00000005, - 0x02021800, 0x001005d8, 0x83947c00, 0x00000009, - 0x83180400, 0x00105f43, 0x50000000, 0x803c7c00, - 0x49787801, 0x1c01f000, 0x4807c857, 0x480bc857, - 0x59940025, 0x80040400, 0x02001800, 0x001005d8, - 0x48032804, 0x480b2805, 0x4a032803, 0x0000000a, - 0x1c01f000, 0x4807c857, 0x480bc857, 0x59940025, - 0x80040400, 0x02001800, 0x001005d8, 0x4803281c, - 0x480b281d, 0x4a03281b, 0x0000000a, 0x1c01f000, - 0x4c000000, 0x5994001d, 0x4803c857, 0x480bc857, - 0x80080580, 0x04020003, 0x4803281c, 0x4803281d, - 0x5c000000, 0x1c01f000, 0x80e9d1c0, 0x0400000e, - 0x0401f836, 0x04025000, 0x4203e000, 0x80000000, - 0x40e81000, 0x41780800, 0x42000000, 0x00000064, - 0x0201f800, 0x001066a0, 0x59940024, 0x80080400, - 0x48032824, 0x1c01f000, 0x42001000, 0x00105065, - 0x0401fef0, 0x42001000, 0x00105058, 0x0401ffe1, - 0x42001000, 0x00104148, 0x0401feea, 0x42001000, - 0x001041bc, 0x0401fee7, 0x42001000, 0x001041f3, - 0x0401f6f8, 0x4203e000, 0x70000000, 0x4203e000, - 0xb0300000, 0x41fc0000, 0x40ebf800, 0x80e80480, - 0x04001011, 0x04000004, 0x82000480, 0x00000003, - 0x0402100d, 0x42000000, 0x0000000f, 0x04004004, - 0x80000040, 0x040207fe, 0x0401f007, 0x4203e000, - 0x70000000, 0x42000000, 0x0010b87e, 0x0201f800, - 0x0010aa47, 0x1c01f000, 0x4203e000, 0x80000000, - 0x4203e000, 0xb0400000, 0x41fc0000, 0x40ebf800, - 0x80e80480, 0x04001011, 0x04000004, 0x82000480, - 0x00000003, 0x0402100d, 0x42000000, 0x0000000f, - 0x04005004, 0x80000040, 0x040207fe, 0x0401f007, - 0x4203e000, 0x80000000, 0x42000000, 0x0010b87f, - 0x0201f800, 0x0010aa47, 0x1c01f000, 0x59a8000e, - 0x82000480, 0x00000100, 0x599c0a02, 0x800409c0, - 0x04020002, 0x80040800, 0x80041480, 0x04001002, - 0x40000800, 0x48075067, 0x59a8100e, 0x40040000, - 0x800acc80, 0x4967500e, 0x49675069, 0x59aaa80b, - 0x41640800, 0x42001000, 0x00000024, 0x0201f800, - 0x00106681, 0x8206a400, 0x0010d1c0, 0x49535065, - 0x4152b000, 0x42006000, 0x0010be65, 0x4a006004, - 0x0000012c, 0x4a006005, 0xda10da10, 0x4a006008, - 0x00000011, 0x4a006009, 0x0010be65, 0x4a00600a, - 0x001010b8, 0x599c0014, 0x48006011, 0x599c0015, - 0x48006012, 0x42006000, 0x0010be41, 0x4a006203, - 0x00000008, 0x4a006406, 0x00000006, 0x4a006002, - 0xffff0000, 0x4a006008, 0x0010be65, 0x4a006014, - 0x0010be65, 0x599c0014, 0x48006015, 0x599c0015, - 0x48006016, 0x599c0413, 0x48006017, 0x49506018, - 0x49546019, 0x59a80067, 0x4800601a, 0x4a00601b, - 0x0010b465, 0x4a00601c, 0x0010b466, 0x4a00601d, - 0x0010b46a, 0x42000000, 0xb0000000, 0x42000800, - 0x0010be41, 0x0201f800, 0x00100b68, 0x1c01f000, - 0x82000d00, 0x000000c0, 0x04000004, 0x82040d80, - 0x000000c0, 0x04020055, 0x82000d00, 0x00002020, - 0x59300414, 0x84000512, 0x82040d80, 0x00002020, - 0x0400000b, 0x8c000514, 0x0402000f, 0x48026414, - 0x813e79c0, 0x02020000, 0x000206d0, 0x42027000, - 0x00000043, 0x0201f000, 0x000207a1, 0x59326809, - 0x59340a00, 0x8c040d0a, 0x040007f3, 0x84000552, - 0x0401f7f1, 0x84000514, 0x592c080d, 0x48066015, - 0x0401f7ef, 0x59326809, 0x59340a00, 0x8c040d0a, - 0x02000000, 0x000206e3, 0x59300c14, 0x84040d52, - 0x48066414, 0x0201f000, 0x000206e3, 0x0201f800, - 0x00020086, 0x813e79c0, 0x02020000, 0x000206d0, - 0x0201f000, 0x000206f1, 0x8c00051e, 0x02000000, - 0x000206fd, 0x82000d00, 0x00002020, 0x82040d80, - 0x00002020, 0x04000014, 0x82000500, 0x000000c0, - 0x82000d80, 0x00000080, 0x04000008, 0x813e79c0, - 0x02020000, 0x000206d0, 0x42027000, 0x00000041, - 0x0201f000, 0x000207a1, 0x813e79c0, 0x02020000, - 0x000206d0, 0x42027000, 0x00000043, 0x0201f000, - 0x000207a1, 0x59326809, 0x59340a00, 0x8c040d0a, - 0x040007ea, 0x59300c14, 0x84040d52, 0x48066414, - 0x0401f7e6, 0x492fc857, 0x42000800, 0x00000006, - 0x0201f000, 0x000206f8, 0x492fc857, 0x42000800, - 0x00000004, 0x0201f000, 0x000206f8, 0x4807c856, - 0x59a80068, 0x800409c0, 0x04000003, 0x80080540, - 0x0401f002, 0x80080500, 0x48035068, 0x1c01f000, - 0x4a030800, 0x00000000, 0x4a030802, 0x00000001, - 0x497b0803, 0x497b0804, 0x1c01f000, 0x59840002, - 0x8c000500, 0x04000004, 0x84000500, 0x4a030800, - 0x00000001, 0x84000544, 0x84000506, 0x48030802, - 0x82000d00, 0x0fffffff, 0x42000000, 0x90000000, - 0x0201f800, 0x00100b94, 0x59a80069, 0x82000480, - 0x00000007, 0x48035069, 0x80000580, 0x42000800, - 0x0010b519, 0x48000800, 0x48000801, 0x1c01f000, - 0x59a80069, 0x82000480, 0x00000007, 0x48035069, - 0x1c01f000, 0x83640480, 0x00000008, 0x0400101b, - 0x58c80a03, 0x80000580, 0x82000400, 0x00000008, - 0x80040840, 0x040207fd, 0x815c0480, 0x04001013, - 0x4200b000, 0x00000007, 0x0201f800, 0x0002075a, - 0x4a026203, 0x00000004, 0x4a026406, 0x00000009, - 0x4a026203, 0x00000004, 0x4a026007, 0x00000101, - 0x0401f809, 0x0401f880, 0x8058b040, 0x040207f3, - 0x80000580, 0x1c01f000, 0x82000540, 0x00000001, - 0x0401f7fd, 0x0201f800, 0x001007e4, 0x492e6008, - 0x58c80a03, 0x4a025a04, 0x0000002c, 0x497a5800, - 0x497a5801, 0x497a5c04, 0x497a5c06, 0x497a5805, - 0x4a025a08, 0x00000005, 0x4a025a07, 0x00000002, - 0x58c80201, 0x48025c04, 0x58c80202, 0x48025c07, - 0x58c80204, 0x48025c08, 0x4a02580d, 0x0000ffff, - 0x80040840, 0x0400000c, 0x412c2000, 0x0201f800, - 0x001007e4, 0x4a025a04, 0x0000000a, 0x497a5c04, - 0x48125800, 0x492c2001, 0x412c2000, 0x80040840, - 0x040207f7, 0x1c01f000, 0x4d7c0000, 0x4202f800, - 0x00000010, 0x4df00000, 0x4203e000, 0x50000000, - 0x59847803, 0x803c79c0, 0x0400001e, 0x4c5c0000, - 0x583cb808, 0x585c3408, 0x801831c0, 0x0400000b, - 0x0401f84a, 0x04000016, 0x42001000, 0x0010b519, - 0x0401f87f, 0x04000012, 0x0201f800, 0x001007d3, - 0x0400000f, 0x492cb805, 0x585c0005, 0x80000540, - 0x02000800, 0x001005d8, 0x0401f830, 0x585c5408, - 0x0401f80b, 0x5c00b800, 0x5c03e000, 0x817ef840, - 0x040207e1, 0x5c02f800, 0x1c01f000, 0x5c00b800, - 0x5c03e000, 0x5c02f800, 0x1c01f000, 0x4803c856, - 0x405c6000, 0x802851c0, 0x04000018, 0x585c0204, - 0x82000d00, 0x0000000f, 0x82040c00, 0x001010bd, - 0x50044000, 0x4cf00000, 0x4d000000, 0x4d040000, - 0x4021e000, 0x40320800, 0x59860004, 0x4c280000, - 0x0401f934, 0x5c005000, 0x40f04000, 0x41046000, - 0x0201f800, 0x0010109b, 0x040207f6, 0x5c020800, - 0x5c020000, 0x5c01e000, 0x58c80204, 0x4800bc08, - 0x0201f800, 0x00020086, 0x4a026007, 0x00000101, - 0x497a6009, 0x0401f055, 0x4803c856, 0x59840003, - 0x80026540, 0x04000003, 0x59300000, 0x48030803, - 0x1c01f000, 0x4803c856, 0x59840003, 0x48026000, - 0x49330803, 0x1c01f000, 0x58cc0805, 0x40180000, - 0x80040480, 0x0400100d, 0x82cc0580, 0x0010b50e, - 0x02020800, 0x001005d8, 0x58c80205, 0x80040480, - 0x0400101d, 0x82000540, 0x00000001, 0x1c01f000, - 0x80003580, 0x0401f7fe, 0x82cc0580, 0x0010b50e, - 0x02020800, 0x001005d8, 0x58c80400, 0x8c000504, - 0x040007f8, 0x58c8040b, 0x8c00051e, 0x040007f5, - 0x8c000500, 0x040207f3, 0x84000540, 0x4801940b, - 0x42000000, 0x0010b839, 0x0201f800, 0x0010aa47, - 0x42001000, 0x00008026, 0x0201f800, 0x00103a3e, - 0x0401f7e8, 0x58c8040b, 0x8c00051e, 0x040007e2, - 0x8c000502, 0x040207e0, 0x84000542, 0x4801940b, - 0x42000000, 0x0010b838, 0x0201f800, 0x0010aa47, - 0x42001000, 0x00008025, 0x42001800, 0x00000000, - 0x0201f800, 0x00103a3e, 0x0401f7d3, 0x4803c856, - 0x58080000, 0x42001800, 0x00000007, 0x58080801, - 0x80040480, 0x04020004, 0x400c0000, 0x80000540, - 0x0401f005, 0x04001003, 0x800c0480, 0x0401f002, - 0x80000080, 0x1c01f000, 0x4803c856, 0x59300008, - 0x80000d40, 0x02000800, 0x001005d8, 0x58040005, - 0x80000540, 0x02000800, 0x001005d8, 0x59300007, - 0x82000500, 0x00000101, 0x82000580, 0x00000101, - 0x02020800, 0x001005d8, 0x42001000, 0x0010b519, - 0x58080801, 0x82040400, 0x0010b51b, 0x497a6414, - 0x4a026015, 0x0000ffff, 0x45300000, 0x80040800, - 0x82040480, 0x00000008, 0x04001002, 0x80000d80, - 0x48041001, 0x82040400, 0x0010b51b, 0x45780000, - 0x1c01f000, 0x4933c857, 0x59300808, 0x800409c0, - 0x02000800, 0x001005d8, 0x4d2c0000, 0x58065805, - 0x812e59c0, 0x02020800, 0x001007f4, 0x49780805, - 0x40065800, 0x0201f800, 0x001007fd, 0x5c025800, - 0x4d300000, 0x0201f800, 0x0002077d, 0x5c026000, - 0x1c01f000, 0x59300406, 0x82000580, 0x00000009, - 0x04020006, 0x59300007, 0x8c000510, 0x04000003, - 0x80000580, 0x1c01f000, 0x82000540, 0x00000001, - 0x1c01f000, 0x59840802, 0x8c040d04, 0x1c01f000, - 0x4803c856, 0x59840802, 0x84040d04, 0x84040d40, - 0x4a030800, 0x00000000, 0x48070802, 0x82040d00, - 0x0fffffff, 0x42000000, 0x90000000, 0x0201f000, - 0x00100b94, 0x4807c857, 0x4805980a, 0x49799801, - 0x49799803, 0x49799806, 0x49799807, 0x49799808, - 0x49799805, 0x49799809, 0x0401f8c9, 0x0400000a, - 0x0401f8eb, 0x04000008, 0x48359800, 0x48359802, - 0x48359806, 0x4a019804, 0x00000001, 0x4a019807, - 0x00000005, 0x1c01f000, 0x4807c857, 0x58cc1007, - 0x40040000, 0x80080480, 0x04021020, 0x4c040000, - 0x4c080000, 0x0401f8da, 0x5c001000, 0x5c000800, - 0x0400001c, 0x58cc0006, 0x80006540, 0x0402000b, - 0x48359800, 0x48359802, 0x48359806, 0x49799801, - 0x49799803, 0x49786801, 0x49786800, 0x49799804, - 0x49799807, 0x0401f005, 0x48306801, 0x48346000, - 0x48359806, 0x49786800, 0x58cc0004, 0x58cc1007, - 0x80000000, 0x82081400, 0x00000005, 0x48019804, - 0x48099807, 0x0401f7df, 0x80000580, 0x1c01f000, - 0x82000540, 0x00000001, 0x1c01f000, 0x480bc857, - 0x4c500000, 0x4c540000, 0x4c580000, 0x40083000, - 0x58cc0801, 0x82040480, 0x00000005, 0x02021800, - 0x001005d8, 0x82040400, 0x00106418, 0x50000000, - 0x58cca800, 0x8054ac00, 0x42001800, 0x00000005, - 0x40040000, 0x800c0480, 0x80082480, 0x04021002, - 0x40080000, 0x8000b0c2, 0x8058b400, 0x5450a800, - 0x8050a000, 0x8054a800, 0x8058b040, 0x040207fc, - 0x40001000, 0x58cc2805, 0x58cc0807, 0x58cc2001, - 0x80142c00, 0x80040c80, 0x80102400, 0x48159805, - 0x48059807, 0x48119801, 0x82100580, 0x00000005, - 0x0400000c, 0x48119801, 0x40080000, 0x80181480, - 0x40083000, 0x04000003, 0x040217d6, 0x80000580, - 0x5c00b000, 0x5c00a800, 0x5c00a000, 0x1c01f000, - 0x58cc0800, 0x800409c0, 0x02000800, 0x001005d8, - 0x58040800, 0x48059800, 0x41782000, 0x0401f7ee, - 0x0401f813, 0x50f00000, 0x81040400, 0x40001800, - 0x585c0204, 0x4803c857, 0x82000580, 0x0000002c, - 0x02020800, 0x001005d8, 0x58040202, 0x800000e0, - 0x81000540, 0x48001802, 0x58040000, 0x48001800, - 0x58040001, 0x48001801, 0x1c01f000, 0x4807c856, - 0x58cc0005, 0x80000040, 0x02001800, 0x001005d8, - 0x48019805, 0x58cc1003, 0x82080480, 0x00000005, - 0x02021800, 0x001005d8, 0x82080400, 0x00106418, - 0x50000000, 0x58cc0802, 0x80040c00, 0x80081000, - 0x82080480, 0x00000005, 0x0402000f, 0x58cc2002, - 0x58100000, 0x80006d40, 0x04000009, 0x4c340000, - 0x0401f858, 0x5c006800, 0x49786801, 0x48359802, - 0x58cc0004, 0x80000040, 0x48019804, 0x49799803, - 0x0401f002, 0x48099803, 0x1c01f000, 0x4807c856, - 0x41781800, 0x58c80201, 0x80000540, 0x04000002, - 0x800c1800, 0x58c80c01, 0x80040c80, 0x0400100a, - 0x04000009, 0x800c1800, 0x58c80202, 0x80041480, - 0x04001005, 0x04000004, 0x800c1800, 0x40080800, - 0x0401f7fb, 0x480d9204, 0x400c0000, 0x42002000, - 0x00000001, 0x80000040, 0x04000007, 0x04001006, - 0x80102000, 0x82000480, 0x00000005, 0x04000002, - 0x040217fc, 0x48119203, 0x1c01f000, 0x4807c856, - 0x4d2c0000, 0x58cc000a, 0x80000540, 0x02000800, - 0x001005d8, 0x82002400, 0x00000005, 0x0201f800, - 0x001007d3, 0x04000012, 0x492d9809, 0x497a5800, - 0x497a5801, 0x0201f800, 0x001007d3, 0x0400000c, - 0x58cc0009, 0x48025800, 0x497a5801, 0x492d9809, - 0x82102480, 0x00000005, 0x040217f7, 0x82000540, - 0x00000001, 0x5c025800, 0x1c01f000, 0x58cc0009, - 0x80025d40, 0x040007fc, 0x592c2000, 0x0201f800, - 0x001007f4, 0x40100000, 0x0401f7fa, 0x58cc0009, - 0x48cfc857, 0x80006d40, 0x04000005, 0x50340000, - 0x48019809, 0x49786800, 0x49786801, 0x1c01f000, - 0x4813c857, 0x58cc0009, 0x48002000, 0x48119809, - 0x1c01f000, 0x4807c856, 0x4d2c0000, 0x58cc0009, - 0x80025d40, 0x04000007, 0x592c0000, 0x4c000000, - 0x0201f800, 0x001007f4, 0x5c000000, 0x0401f7f9, - 0x5c025800, 0x1c01f000, 0x4807c856, 0x4d2c0000, - 0x58cc0002, 0x80025d40, 0x04000007, 0x592c0000, - 0x4c000000, 0x0201f800, 0x001007f4, 0x5c000000, - 0x0401f7f9, 0x49799800, 0x49799802, 0x49799801, - 0x49799803, 0x49799806, 0x49799807, 0x49799808, - 0x49799809, 0x4979980a, 0x5c025800, 0x1c01f000, - 0x00000003, 0x00000006, 0x00000009, 0x0000000c, - 0x0000000f, 0x00000012, 0x4803c856, 0x0401f857, - 0x4a00c204, 0x0000003c, 0x59301009, 0x82080580, - 0x0010b524, 0x04000013, 0x58080802, 0x82040d00, - 0x00ffffff, 0x58080403, 0x4804c005, 0x4800c406, - 0x4a00c207, 0x00000003, 0x59300811, 0x585c0404, - 0x4978c206, 0x4804c407, 0x80000540, 0x0400000d, - 0x58600206, 0x84000540, 0x4800c206, 0x0401f009, - 0x585c080a, 0x82040d00, 0x00ffffff, 0x4804c005, - 0x4a00c406, 0x000007ff, 0x4978c207, 0x0401f7ef, - 0x82603c00, 0x00000008, 0x58605404, 0x40282000, - 0x405c6000, 0x585c0a04, 0x82040d00, 0x0000000f, - 0x82040c00, 0x001010bd, 0x50044000, 0x80004d80, - 0x50200000, 0x80307400, 0x58380402, 0x8c244d00, - 0x04020003, 0x48003a00, 0x0401f003, 0x48003c00, - 0x801c3800, 0x80244800, 0x80102040, 0x04000006, - 0x0201f800, 0x0010109b, 0x02000800, 0x001005d8, - 0x0401f7f0, 0x1c01f000, 0x4803c856, 0x4d340000, - 0x59300009, 0x80026d40, 0x02000800, 0x001005d8, - 0x59340401, 0x80000540, 0x0400000e, 0x59840000, - 0x80000540, 0x0400000b, 0x836c0580, 0x00000003, - 0x04020008, 0x59341c03, 0x42002000, 0x00000004, - 0x42003000, 0x00000004, 0x0201f800, 0x00103aae, - 0x5c026800, 0x1c01f000, 0x4803c856, 0x80001580, - 0x58c80c01, 0x59300011, 0x80040c80, 0x48066011, - 0x58c80201, 0x80000540, 0x04000005, 0x80081000, - 0x80040c80, 0x04001007, 0x04000006, 0x58c80202, - 0x80081000, 0x80040c80, 0x04001002, 0x040207fd, - 0x4808bc08, 0x4808c404, 0x1c01f000, 0x4803c856, - 0x4a0370e5, 0x00020000, 0x59b800e5, 0x8c000524, - 0x040207fc, 0x4a0370e5, 0x00030000, 0x40000000, - 0x40000000, 0x59b800e5, 0x8c000524, 0x040207f5, - 0x5934000e, 0x80006d40, 0x04000010, 0x81300580, - 0x04020004, 0x58340000, 0x4802680e, 0x0401f00a, - 0x40347800, 0x58340000, 0x80006d40, 0x02000800, - 0x001005d8, 0x81300580, 0x040207fa, 0x58340000, - 0x48007800, 0x497a6000, 0x4a0370e5, 0x00020000, - 0x1c01f000, 0x4803c856, 0x4d300000, 0x4d2c0000, - 0x42000800, 0x000003ff, 0x4a0370e5, 0x00020000, - 0x59b800e5, 0x8c000524, 0x04000005, 0x80040840, - 0x040207fa, 0x0201f800, 0x001005d8, 0x4a0370e5, - 0x00030000, 0x40000000, 0x40000000, 0x59b800e5, - 0x8c000524, 0x040207f1, 0x5934000e, 0x80026540, - 0x0400000e, 0x4933c857, 0x59300000, 0x4802680e, - 0x4a026203, 0x00000004, 0x497a6206, 0x497a6009, - 0x4a026007, 0x00000101, 0x59325808, 0x497a5c08, - 0x0401fd81, 0x0401f7f1, 0x4a0370e5, 0x00020000, - 0x5c025800, 0x5c026000, 0x1c01f000, 0x4803c856, - 0x4c000000, 0x0201f800, 0x00105c9a, 0x04020011, - 0x0201f800, 0x001045a6, 0x02020800, 0x001005d8, - 0x5c000000, 0x48026802, 0x0201f800, 0x0002075a, - 0x04000009, 0x49366009, 0x4a026406, 0x00000001, - 0x42027000, 0x00000001, 0x0201f000, 0x000207a1, - 0x5c000000, 0x1c01f000, 0x59300203, 0x82000c80, - 0x0000000e, 0x02021800, 0x001005d8, 0x4803c857, - 0x0c01f001, 0x00106503, 0x00106503, 0x00106503, - 0x00106505, 0x00106565, 0x00106503, 0x00106503, - 0x001065b7, 0x001065b8, 0x00106503, 0x00106503, - 0x00106503, 0x00106503, 0x00106503, 0x0201f800, - 0x001005d8, 0x493bc857, 0x83380480, 0x00000050, - 0x02021800, 0x001005d8, 0x83380480, 0x00000049, - 0x02001800, 0x001005d8, 0x0c01f001, 0x00106518, - 0x0010653a, 0x00106516, 0x00106516, 0x00106516, - 0x00106516, 0x00106549, 0x0201f800, 0x001005d8, - 0x4d2c0000, 0x59325808, 0x592c0206, 0x48025c06, - 0x4a025a06, 0x00000000, 0x4c5c0000, 0x592cbc0a, - 0x592c0000, 0x48026008, 0x0201f800, 0x00104cde, - 0x59300008, 0x80000540, 0x04000008, 0x4a026203, - 0x00000007, 0x42027000, 0x00000043, 0x5c00b800, - 0x5c025800, 0x0401f08a, 0x8c5cbd08, 0x04020006, - 0x4a026203, 0x00000007, 0x497a6206, 0x497a6008, - 0x0401f003, 0x0201f800, 0x0002077d, 0x5c00b800, - 0x5c025800, 0x1c01f000, 0x0201f800, 0x00106b8a, - 0x4d2c0000, 0x59325808, 0x0201f800, 0x00109037, - 0x04000006, 0x4d400000, 0x42028000, 0x00000001, - 0x0401f8f8, 0x5c028000, 0x5c025800, 0x0201f000, - 0x0002077d, 0x0201f800, 0x00106b8a, 0x4d3c0000, - 0x417a7800, 0x0201f800, 0x0010203c, 0x5c027800, - 0x42003000, 0x00000014, 0x0201f800, 0x0010a942, - 0x42000000, 0x0010b864, 0x0201f800, 0x0010aa47, - 0x4d2c0000, 0x59325808, 0x0201f800, 0x00109037, - 0x04000006, 0x4d400000, 0x42028000, 0x00000029, - 0x0401f8dc, 0x5c028000, 0x5c025800, 0x0201f000, - 0x0002077d, 0x493bc857, 0x497a6206, 0x83380480, - 0x00000054, 0x02021800, 0x001005d8, 0x83380480, - 0x00000047, 0x02001800, 0x001005d8, 0x0c01f001, - 0x001065b6, 0x0010657f, 0x0010657d, 0x0010657d, - 0x0010657d, 0x0010657d, 0x0010657d, 0x0010657d, - 0x0010657d, 0x0010657d, 0x0010657d, 0x0010657d, - 0x00106583, 0x0201f800, 0x001005d8, 0x59300011, - 0x82000500, 0xffff0000, 0x04020034, 0x59840802, - 0x8c040d04, 0x04000025, 0x59300009, 0x80026d40, - 0x0400001f, 0x4c5c0000, 0x4c600000, 0x497a6206, - 0x5930b808, 0x585c0005, 0x8000c540, 0x02000800, - 0x001005d8, 0x0401fe8d, 0x40625800, 0x0201f800, - 0x00104cde, 0x4978b805, 0x0401fef5, 0x497a6009, - 0x585c3408, 0x0401fcbd, 0x0400000e, 0x42001000, - 0x0010b519, 0x0401fcf2, 0x0400000a, 0x0201f800, - 0x001007e4, 0x04000007, 0x492cb805, 0x585c5408, - 0x0401fc83, 0x5c00c000, 0x5c00b800, 0x1c01f000, - 0x0401fca9, 0x0401f7fc, 0x8c040d06, 0x040207fc, - 0x59300009, 0x80026d40, 0x04000006, 0x5934000e, - 0x80000540, 0x02020800, 0x001005d8, 0x497a6009, - 0x0401fd0d, 0x0401f7f2, 0x0401f06f, 0x4803c856, - 0x4803c856, 0x83380580, 0x00000043, 0x02020800, - 0x001005d8, 0x4a026203, 0x00000003, 0x493a6403, - 0x59325808, 0x592c000f, 0x48026011, 0x497a6013, - 0x592c0406, 0x800000c2, 0x800010c4, 0x80081400, - 0x480a6206, 0x0201f800, 0x00100f4e, 0x42000800, - 0x80000060, 0x0401f154, 0x42000000, 0x0010b875, - 0x0201f800, 0x0010aa47, 0x59300203, 0x82000c80, - 0x0000000e, 0x02021800, 0x001005d8, 0x4803c857, - 0x82000d80, 0x00000003, 0x04000006, 0x82000d80, - 0x00000004, 0x04000045, 0x0201f800, 0x001005d8, - 0x0201f800, 0x00106c55, 0x59300004, 0x8c00053e, - 0x04020007, 0x0201f800, 0x00106b6c, 0x02020800, - 0x001005d8, 0x0201f000, 0x00106c4b, 0x0401f9c3, - 0x0201f800, 0x00106c4b, 0x59325808, 0x42028000, - 0x00000006, 0x0401f84b, 0x0201f000, 0x0002077d, - 0x4803c856, 0x59300203, 0x82000c80, 0x0000000e, - 0x02021800, 0x001005d8, 0x82000d80, 0x00000003, - 0x04000006, 0x82000d80, 0x00000004, 0x04000023, - 0x0201f800, 0x001005d8, 0x4803c856, 0x0201f800, - 0x00106c55, 0x4df00000, 0x59300004, 0x8c00053e, - 0x04020006, 0x0201f800, 0x00106f60, 0x02020800, - 0x001005d8, 0x0401f010, 0x0201f800, 0x00108cd6, - 0x04020004, 0x0201f800, 0x00106e62, 0x0402000a, - 0x0401f99a, 0x02020800, 0x001005d8, 0x5c03e000, - 0x02000800, 0x00106c4b, 0x82000540, 0x00000001, - 0x1c01f000, 0x5c03e000, 0x02000800, 0x00106c4b, - 0x80000580, 0x1c01f000, 0x4933c857, 0x0201f800, - 0x00100e99, 0x4933c857, 0x4c5c0000, 0x4d340000, - 0x497a6206, 0x5930b808, 0x59300009, 0x80026d40, - 0x04020e5f, 0x42001000, 0x0010b519, 0x0401fc60, - 0x04000009, 0x58c80204, 0x4800bc08, 0x41785000, - 0x0201f800, 0x00106227, 0x5c026800, 0x5c00b800, - 0x1c01f000, 0x4978bc08, 0x0401fc17, 0x0401f7fb, - 0x4803c856, 0x0201f800, 0x00109037, 0x0400000f, - 0x592c0000, 0x80000d40, 0x04000009, 0x497a5800, - 0x49425a06, 0x4c040000, 0x0201f800, 0x000202da, - 0x5c000800, 0x40065800, 0x0401f7f6, 0x49425a06, - 0x0201f800, 0x000202da, 0x1c01f000, 0x4933c857, - 0x59300c06, 0x82040580, 0x0000000e, 0x04000004, - 0x82040580, 0x00000009, 0x04020004, 0x0401ffe5, - 0x497a6008, 0x80000580, 0x1c01f000, 0x592e6009, - 0x83300480, 0x0010d1c0, 0x04001016, 0x41580000, - 0x81300480, 0x04021013, 0x40040000, 0x59300c06, - 0x80040580, 0x04020012, 0x59300a03, 0x82040580, - 0x00000007, 0x02020800, 0x001005d8, 0x59300008, - 0x80000540, 0x02020800, 0x001005d8, 0x0201f800, - 0x0002077d, 0x42000000, 0x00000000, 0x0401f009, - 0x42000000, 0x00000008, 0x0401f006, 0x82040580, - 0x00000007, 0x040207fb, 0x42000000, 0x00000005, - 0x592c0a06, 0x48065c06, 0x48025a06, 0x0201f000, - 0x000202da, 0x4c0c0000, 0x4c100000, 0x4c140000, - 0x4c180000, 0x80001d80, 0x80002580, 0x42003000, - 0x00000020, 0x82040500, 0x00000001, 0x04000003, - 0x40080000, 0x800c1c00, 0x400c2800, 0x800c1902, - 0x80102102, 0x82140500, 0x00000001, 0x04000003, - 0x82102540, 0x80000000, 0x80040902, 0x80183040, - 0x040207f1, 0x40100800, 0x400c0000, 0x5c003000, - 0x5c002800, 0x5c002000, 0x5c001800, 0x1c01f000, - 0x4c580000, 0x4200b000, 0x00000020, 0x80000540, - 0x04000018, 0x80041c80, 0x04021016, 0x800810c2, - 0x80040982, 0x04001006, 0x80041c80, 0x04021005, - 0x8058b040, 0x040207fa, 0x0401f006, 0x80041c80, - 0x400c0800, 0x80081000, 0x8058b040, 0x040207f4, - 0x4c000000, 0x41f00000, 0x82000500, 0xf7ffffff, - 0x4003e000, 0x5c000000, 0x5c00b000, 0x1c01f000, - 0x4c000000, 0x41f00000, 0x82000540, 0x08000000, - 0x0401f7f8, 0x4a0378e8, 0x00000000, 0x4a03c821, - 0x00000010, 0x4a03c823, 0x00000004, 0x0401f82c, - 0x4a0378e9, 0x00003a0d, 0x4a0378e8, 0x00000001, - 0x42000000, 0x00001000, 0x50000000, 0x82000480, - 0x24220001, 0x04000004, 0x59e00002, 0x84000548, - 0x4803c002, 0x42000800, 0x00000005, 0x4203a000, - 0x00007600, 0x42000000, 0x00001000, 0x50000000, - 0x82000480, 0x24320001, 0x04021003, 0x4a03a005, - 0xd0000001, 0x59d00006, 0x4a03a005, 0x90000001, - 0x83d3a400, 0x00000020, 0x80040840, 0x040207fa, - 0x59e00003, 0x82000500, 0xffffffe0, 0x82000540, - 0x00008000, 0x4803c003, 0x59c40006, 0x82000500, - 0xfffcffff, 0x48038806, 0x1c01f000, 0x4d900000, - 0x4d180000, 0x4a0378e7, 0xaaaaaaaa, 0x4a0378e6, - 0xaaaaaaaa, 0x4a0378e5, 0xaaaaaaaa, 0x4a0378e4, - 0xaaaaaaaa, 0x42000800, 0x0000bf00, 0x4a00081a, - 0x0010b7d4, 0x4a00081b, 0x001010bd, 0x4a00081c, - 0x001010cd, 0x4a031800, 0x00000000, 0x4a031801, - 0x0010b544, 0x4a031802, 0x0010b54b, 0x42000800, - 0x0010b7d7, 0x417a3000, 0x811b20c8, 0x83932400, - 0x0000bf32, 0x48072000, 0x4a032001, 0x00000000, - 0x83180400, 0x001070ea, 0x50000000, 0x48032002, - 0x82040c00, 0x00000003, 0x811a3000, 0x83180480, - 0x00000005, 0x040017f1, 0x5c023000, 0x5c032000, - 0x1c01f000, 0x48066004, 0x497a6000, 0x497a6001, - 0x59bc00ea, 0x8c000516, 0x040207fe, 0x83300400, - 0xa0000000, 0x480378e1, 0x1c01f000, 0x4933c857, - 0x42000800, 0x80000040, 0x48066004, 0x497a6000, - 0x59bc00ea, 0x8c000516, 0x040207fe, 0x83300400, - 0x60000000, 0x480378e1, 0x1c01f000, 0x0201f800, - 0x00106c55, 0x4df00000, 0x4d300000, 0x4d340000, - 0x4d2c0000, 0x4d180000, 0x4c5c0000, 0x4c600000, - 0x4d900000, 0x4dd00000, 0x4da40000, 0x4d140000, - 0x42003000, 0x0000bf2e, 0x581a6001, 0x813261c0, - 0x0400002c, 0x41302800, 0x4178c000, 0x59300000, - 0x4c000000, 0x59326809, 0x5930b801, 0x59300406, - 0x82000d80, 0x00000006, 0x04020003, 0x8d3e7d18, - 0x04000010, 0x8d3e7d06, 0x04000007, 0x82000580, - 0x00000003, 0x04020004, 0x59340200, 0x8c00050e, - 0x04020008, 0x0401f92f, 0x4c0c0000, 0x4c140000, - 0x0401fb5f, 0x5c002800, 0x5c001800, 0x0401f005, - 0x41301800, 0x8060c1c0, 0x04020002, 0x400cc000, - 0x805cb9c0, 0x04000003, 0x405e6000, 0x0401f7e3, - 0x5c026000, 0x813261c0, 0x04000006, 0x8060c1c0, - 0x04000002, 0x40602800, 0x4178c000, 0x0401f7d8, - 0x417a3000, 0x0201f800, 0x001070d8, 0x59926004, - 0x813261c0, 0x04000023, 0x59326809, 0x4130c000, - 0x59300001, 0x8000bd40, 0x04000016, 0x40026000, - 0x40602800, 0x5930b801, 0x59300406, 0x82000d80, - 0x00000006, 0x0400000e, 0x8d3e7d06, 0x04000007, - 0x82000580, 0x00000003, 0x04020004, 0x59340200, - 0x8c00050e, 0x04020006, 0x0401f8dc, 0x4c140000, - 0x0401fb2f, 0x5c002800, 0x0401f002, 0x41302800, - 0x405e6000, 0x813261c0, 0x040207eb, 0x8060c1c0, - 0x04000004, 0x40626000, 0x4178c000, 0x0401f7e7, - 0x811a3000, 0x83180480, 0x00000005, 0x040017d6, - 0x5c022800, 0x5c034800, 0x5c03a000, 0x5c032000, - 0x5c00c000, 0x5c00b800, 0x5c023000, 0x5c025800, - 0x5c026800, 0x5c026000, 0x5c03e000, 0x02000800, - 0x00106c4b, 0x1c01f000, 0x4933c857, 0x0201f800, - 0x00106c55, 0x4df00000, 0x4d340000, 0x4d180000, - 0x4d900000, 0x42003000, 0x0000bf2e, 0x59326809, - 0x58182001, 0x40102800, 0x801021c0, 0x04000016, - 0x41300000, 0x80100580, 0x04000011, 0x58100009, - 0x81340580, 0x0402000b, 0x40101800, 0x58102001, - 0x41300000, 0x801021c0, 0x0400000b, 0x80100d80, - 0x04000007, 0x40101800, 0x58102001, 0x0401f7fa, - 0x40102800, 0x58102000, 0x0401f7ec, 0x0401f8bd, - 0x0401f01a, 0x42032000, 0x0000bf32, 0x417a3000, - 0x59902004, 0x40102800, 0x801021c0, 0x0400000b, - 0x58100009, 0x81340580, 0x04020008, 0x41300000, - 0x80100580, 0x0400000c, 0x40102800, 0x58102001, - 0x801021c0, 0x040207fa, 0x811a3000, 0x83180480, - 0x00000005, 0x0402100d, 0x83932400, 0x00000010, - 0x0401f7ec, 0x0401f881, 0x5c032000, 0x5c023000, - 0x5c026800, 0x5c03e000, 0x02000800, 0x00106c4b, - 0x80000580, 0x1c01f000, 0x0401fb6f, 0x040007f7, - 0x5c032000, 0x5c023000, 0x5c026800, 0x5c03e000, - 0x02000800, 0x00106c4b, 0x82000540, 0x00000001, - 0x1c01f000, 0x0201f800, 0x00106c55, 0x4df00000, - 0x4d300000, 0x4d340000, 0x4d180000, 0x4d2c0000, - 0x4c5c0000, 0x4c600000, 0x4d900000, 0x4dd00000, - 0x4da40000, 0x4d140000, 0x42003000, 0x0000bf2e, - 0x581a6001, 0x813261c0, 0x04000023, 0x41302800, - 0x5930b800, 0x59326809, 0x59340403, 0x81440580, - 0x04000006, 0x805cb9c0, 0x0400001b, 0x41302800, - 0x405e6000, 0x0401f7f7, 0x5930b801, 0x8d3e7d00, - 0x04000003, 0x0401fb67, 0x0402000e, 0x59300406, - 0x82000580, 0x00000006, 0x04020003, 0x8d3e7d18, - 0x04000008, 0x0401f867, 0x4c0c0000, 0x4c140000, - 0x0401fa97, 0x5c002800, 0x5c001800, 0x0401f002, - 0x41301800, 0x405e6000, 0x813261c0, 0x040207eb, - 0x0401f02d, 0x417a3000, 0x0201f800, 0x001070d8, - 0x59926004, 0x813261c0, 0x04000005, 0x59326809, - 0x59340403, 0x81440580, 0x04000006, 0x811a3000, - 0x83180480, 0x00000005, 0x040017f4, 0x0401f01e, - 0x4130c000, 0x59300001, 0x8000bd40, 0x04000012, - 0x40026000, 0x40602800, 0x5930b801, 0x8d3e7d00, - 0x04000003, 0x0401fb3b, 0x0402000a, 0x59300406, - 0x82000580, 0x00000006, 0x04000006, 0x0401f81b, - 0x4c140000, 0x0401fa6e, 0x5c002800, 0x0401f002, - 0x41302800, 0x405e6000, 0x813261c0, 0x040207ef, - 0x8060c1c0, 0x04000004, 0x40626000, 0x4178c000, - 0x0401f7eb, 0x5c022800, 0x5c034800, 0x5c03a000, - 0x5c032000, 0x5c00c000, 0x5c00b800, 0x5c025800, - 0x5c023000, 0x5c026800, 0x5c026000, 0x5c03e000, - 0x04000be3, 0x1c01f000, 0x0401fbc8, 0x59900004, - 0x81300580, 0x04020018, 0x4c140000, 0x0201f800, - 0x00106dc3, 0x0401fbb8, 0x5c002800, 0x59300001, - 0x800001c0, 0x04020003, 0x497a680c, 0x1c01f000, - 0x42003000, 0x0000bf2e, 0x497a6001, 0x58180801, - 0x800409c0, 0x04020004, 0x48003000, 0x48003001, - 0x1c01f000, 0x58180800, 0x48000800, 0x48003000, - 0x1c01f000, 0x59300001, 0x48002801, 0x800001c0, - 0x04020002, 0x4816680c, 0x497a6001, 0x1c01f000, - 0x0401fba6, 0x42003000, 0x0000bf2e, 0x58180001, - 0x81300580, 0x0402001c, 0x59300801, 0x800409c0, - 0x0400000e, 0x59300000, 0x800001c0, 0x04020005, - 0x48043001, 0x48043000, 0x497a6001, 0x1c01f000, - 0x59300000, 0x48000800, 0x48043001, 0x497a6000, - 0x497a6001, 0x1c01f000, 0x59300800, 0x800409c0, - 0x04020005, 0x49783001, 0x49783000, 0x497a680c, - 0x1c01f000, 0x48043001, 0x497a6000, 0x497a680c, - 0x1c01f000, 0x58180000, 0x81300580, 0x0402000c, - 0x59300001, 0x800001c0, 0x04020005, 0x48143000, - 0x49782800, 0x497a680c, 0x1c01f000, 0x48003000, - 0x48002800, 0x497a6001, 0x1c01f000, 0x59300000, - 0x800001c0, 0x04020008, 0x59300001, 0x48001801, - 0x800001c0, 0x04020002, 0x480e680c, 0x497a6001, - 0x1c01f000, 0x59300801, 0x800409c0, 0x04020006, - 0x59300800, 0x48042800, 0x497a6000, 0x497a680c, - 0x1c01f000, 0x59300000, 0x48000800, 0x48042800, - 0x497a6000, 0x497a6001, 0x1c01f000, 0x0401fb82, - 0x4df00000, 0x0401f839, 0x040208c4, 0x04020945, - 0x04020a89, 0x04020005, 0x5c03e000, 0x04000b70, - 0x80000580, 0x1c01f000, 0x5c03e000, 0x04000b6c, - 0x82000540, 0x00000001, 0x1c01f000, 0x4d2c0000, - 0x4d340000, 0x4d300000, 0x41783000, 0x598e6009, - 0x813261c0, 0x04000021, 0x59300406, 0x82000580, - 0x00000006, 0x04020004, 0x8d3e7d18, 0x0402000a, - 0x0401f017, 0x82040580, 0x00000005, 0x04020006, - 0x8d3e7d16, 0x04000004, 0x59300420, 0x8c000500, - 0x0402000f, 0x0401fa4e, 0x59300000, 0x4c000000, - 0x8d3e7d06, 0x04000004, 0x0201f800, 0x001092d7, - 0x04000005, 0x0401f867, 0x4c180000, 0x0401f9bc, - 0x5c003000, 0x5c026000, 0x0401f7e2, 0x41303000, - 0x59326000, 0x0401f7df, 0x5c026000, 0x5c026800, - 0x5c025800, 0x1c01f000, 0x4933c857, 0x4c5c0000, - 0x813261c0, 0x02000800, 0x001005d8, 0x41300000, - 0x598cb809, 0x41783000, 0x805cb9c0, 0x04000013, - 0x805c0d80, 0x04000004, 0x405c3000, 0x5818b800, - 0x0401f7fa, 0x0401f84b, 0x598c000d, 0x81300580, - 0x02000800, 0x001070b9, 0x59300403, 0x82000580, - 0x00000042, 0x04020002, 0x497a6007, 0x80000580, - 0x5c00b800, 0x1c01f000, 0x82000540, 0x00000001, - 0x5c00b800, 0x1c01f000, 0x0401fb27, 0x4df00000, - 0x4d2c0000, 0x4d340000, 0x4d300000, 0x41783000, - 0x598e6009, 0x813261c0, 0x0400002c, 0x59300c06, - 0x82040580, 0x00000006, 0x04020004, 0x8d3e7d18, - 0x0402000a, 0x0401f022, 0x82040580, 0x00000005, - 0x04020006, 0x8d3e7d18, 0x04000004, 0x59300420, - 0x8c000500, 0x0402001a, 0x59326809, 0x59340403, - 0x81440580, 0x04020016, 0x8d3e7d00, 0x04000006, - 0x82040580, 0x00000003, 0x04020011, 0x0401fa35, - 0x0402000f, 0x0401f9f6, 0x59300000, 0x4c000000, - 0x8d3e7d06, 0x04000004, 0x0201f800, 0x001092d7, - 0x04000005, 0x0401f80f, 0x4c180000, 0x0401f964, - 0x5c003000, 0x5c026000, 0x0401f7d7, 0x41303000, - 0x59326000, 0x0401f7d4, 0x5c026000, 0x5c026800, - 0x5c025800, 0x5c03e000, 0x04000ae5, 0x1c01f000, - 0x59300800, 0x497a6000, 0x0401fac8, 0x801831c0, - 0x04020009, 0x598c0008, 0x81300580, 0x04020004, - 0x48031808, 0x48031809, 0x0401f008, 0x48071809, - 0x0401f006, 0x48043000, 0x598c0008, 0x81300580, - 0x04020002, 0x481b1808, 0x0401f2ca, 0x4d2c0000, - 0x4d300000, 0x4d340000, 0x41783000, 0x598e600b, - 0x813261c0, 0x04000013, 0x8d3e7d06, 0x04000005, - 0x59326809, 0x59340200, 0x8c00050e, 0x0402000a, - 0x0401f9bf, 0x59300000, 0x4c000000, 0x0401f853, - 0x4c180000, 0x0401f932, 0x5c003000, 0x5c026000, - 0x0401f7f0, 0x41303000, 0x59326000, 0x0401f7ed, - 0x0201f800, 0x00104773, 0x5c026800, 0x5c026000, - 0x5c025800, 0x1c01f000, 0x4933c857, 0x4c5c0000, - 0x813261c0, 0x02000800, 0x001005d8, 0x41300000, - 0x598cb80b, 0x41783000, 0x805cb9c0, 0x0400000f, - 0x805c0d80, 0x04000004, 0x405c3000, 0x5818b800, - 0x0401f7fa, 0x0401f835, 0x598c000d, 0x81300580, - 0x02000800, 0x001070b9, 0x497a6007, 0x80000580, - 0x5c00b800, 0x1c01f000, 0x82000540, 0x00000001, - 0x5c00b800, 0x1c01f000, 0x0401fa9f, 0x4df00000, - 0x4d340000, 0x4d300000, 0x4d2c0000, 0x0201f800, - 0x00020245, 0x02020800, 0x001005d8, 0x41783000, - 0x598e600b, 0x813261c0, 0x04000014, 0x59300009, - 0x81340580, 0x0402000e, 0x8d3e7d00, 0x04000003, - 0x0401f9bc, 0x0402000a, 0x0401f97d, 0x59300000, - 0x4c000000, 0x0401f811, 0x4c180000, 0x0401f8f0, - 0x5c003000, 0x5c026000, 0x0401f7ef, 0x41303000, - 0x59326000, 0x0401f7ec, 0x0201f800, 0x0010479c, - 0x5c025800, 0x5c026000, 0x5c026800, 0x5c03e000, - 0x04000a6f, 0x1c01f000, 0x59300800, 0x497a6000, - 0x0401fa52, 0x801831c0, 0x04020009, 0x598c000a, - 0x81300580, 0x04020004, 0x4803180a, 0x4803180b, - 0x0401f008, 0x4807180b, 0x0401f006, 0x48043000, - 0x598c000a, 0x81300580, 0x04020002, 0x481b180a, - 0x0401f254, 0x0401fa64, 0x4df00000, 0x4d300000, - 0x598e6005, 0x813261c0, 0x04000020, 0x59300000, - 0x4c000000, 0x59300c06, 0x82040580, 0x00000011, - 0x04020007, 0x833c0500, 0x00001800, 0x04000015, - 0x8d3e7d16, 0x04020013, 0x0401f009, 0x82040580, - 0x00000004, 0x04020006, 0x8d3e7d16, 0x04000004, - 0x59300420, 0x8c000500, 0x0402000a, 0x0201f800, - 0x0010914e, 0x02000800, 0x0010801c, 0x0201f800, - 0x00109326, 0x0201f800, 0x0002077d, 0x0401fa31, - 0x5c026000, 0x0401f7e0, 0x497b1805, 0x497b1804, - 0x5c026000, 0x5c03e000, 0x04000a31, 0x1c01f000, - 0x4933c857, 0x4c5c0000, 0x4c600000, 0x813261c0, - 0x02000800, 0x001005d8, 0x41300000, 0x598cb805, - 0x405cc000, 0x805cb9c0, 0x04000025, 0x805c0d80, - 0x04000004, 0x405cc000, 0x5860b800, 0x0401f7fa, - 0x598c000d, 0x81300580, 0x02000800, 0x001070b9, - 0x0401fa02, 0x598c0005, 0x805c0580, 0x04020009, - 0x585c0000, 0x48031805, 0x4978b800, 0x598c0004, - 0x805c0580, 0x0402000d, 0x497b1804, 0x0401f00b, - 0x598c0004, 0x805c0580, 0x04020005, 0x48631804, - 0x4978b800, 0x4978c000, 0x0401f004, 0x585c0000, - 0x4800c000, 0x4978b800, 0x0401f9fe, 0x80000580, - 0x5c00c000, 0x5c00b800, 0x1c01f000, 0x82000540, - 0x00000001, 0x5c00c000, 0x5c00b800, 0x1c01f000, - 0x4933c857, 0x0401fa04, 0x4df00000, 0x4d2c0000, - 0x4d340000, 0x4d300000, 0x4c5c0000, 0x4178b800, - 0x8d3e7d18, 0x0400000d, 0x8d3e7d16, 0x0402000b, - 0x0201f800, 0x00109037, 0x04000008, 0x0201f800, - 0x00109597, 0x04020005, 0x592c0207, 0x492fc857, - 0x8200bd00, 0x0000000f, 0x41783000, 0x598e6005, - 0x813261c0, 0x04000029, 0x59326809, 0x813669c0, - 0x04000023, 0x59340403, 0x81440580, 0x04020020, - 0x59300c06, 0x82040580, 0x00000011, 0x0400001a, - 0x82040580, 0x00000004, 0x04020004, 0x59300420, - 0x8c000500, 0x04020016, 0x0201f800, 0x00109037, - 0x04000008, 0x0201f800, 0x00109597, 0x04020005, - 0x59300403, 0x82000580, 0x00000043, 0x0400000c, - 0x0401f8c3, 0x59300000, 0x4c000000, 0x0401f812, - 0x4c180000, 0x0401f836, 0x5c003000, 0x5c026000, - 0x0401f7dc, 0x805cb9c0, 0x040207ec, 0x41303000, - 0x59326000, 0x0401f7d7, 0x5c00b800, 0x5c026000, - 0x5c026800, 0x5c025800, 0x5c03e000, 0x040009b4, - 0x1c01f000, 0x59300800, 0x497a6000, 0x0401f997, - 0x801831c0, 0x04020009, 0x598c0004, 0x81300580, - 0x04020004, 0x48031804, 0x48031805, 0x0401f008, - 0x48071805, 0x0401f006, 0x48043000, 0x598c0004, - 0x81300580, 0x04020002, 0x481b1804, 0x0401f199, - 0x4943c857, 0x0401f9a8, 0x4df00000, 0x0401fe34, - 0x0401fecb, 0x5c03e000, 0x04000999, 0x1c01f000, - 0x4947c857, 0x0401f9a0, 0x4df00000, 0x4d3c0000, - 0x853e7d00, 0x0401fe75, 0x0401fefc, 0x5c027800, - 0x5c03e000, 0x0400098e, 0x1c01f000, 0x5c000000, - 0x4c000000, 0x4803c857, 0x4d340000, 0x4d2c0000, - 0x59326809, 0x59325808, 0x59300406, 0x82000c80, - 0x00000012, 0x02021800, 0x001005d8, 0x4933c857, - 0x4943c857, 0x493fc857, 0x4803c857, 0x0c01f804, - 0x5c025800, 0x5c026800, 0x1c01f000, 0x00106ae5, - 0x00106ae7, 0x00106af1, 0x00106b0b, 0x00106ae7, - 0x00106afb, 0x00106b23, 0x00106ae5, 0x00106ae5, - 0x00106b36, 0x00106b2d, 0x00106ae5, 0x00106ae5, - 0x00106ae5, 0x00106ae5, 0x00106ae5, 0x00106b3c, - 0x00106b3c, 0x0201f800, 0x001005d8, 0x0201f800, - 0x00109134, 0x02000800, 0x00102074, 0x0201f800, - 0x00109326, 0x0201f800, 0x0010801c, 0x0201f000, - 0x00107911, 0x812e59c0, 0x02020800, 0x001005d8, - 0x5930021d, 0x82000580, 0x00000003, 0x02000800, - 0x0010912a, 0x0201f000, 0x00107911, 0x0201f800, - 0x00109037, 0x02000000, 0x00107911, 0x592c1204, - 0x82081500, 0x000000ff, 0x82080580, 0x00000055, - 0x02020800, 0x001005d8, 0x49425a06, 0x0201f800, - 0x000202da, 0x0201f000, 0x00107911, 0x59300004, - 0x8400055c, 0x48026004, 0x59300007, 0x8c000500, - 0x02020800, 0x00100e99, 0x0201f800, 0x00109037, - 0x0400000d, 0x4a025a04, 0x00000103, 0x49425a06, - 0x497a5c09, 0x0201f800, 0x001091c6, 0x0201f800, - 0x0010a693, 0x0201f800, 0x000202da, 0x0201f800, - 0x0010912a, 0x0201f000, 0x00107911, 0x59300007, - 0x8c000500, 0x02020800, 0x00100e99, 0x0201f800, - 0x00109037, 0x02020800, 0x0010a3ef, 0x0201f000, - 0x00107911, 0x0201f800, 0x00109037, 0x04000005, - 0x49425a06, 0x497a5c09, 0x0201f800, 0x000202da, - 0x0201f000, 0x00107911, 0x0201f800, 0x00109037, - 0x02020800, 0x0010664f, 0x0201f000, 0x00107911, - 0x0201f800, 0x00109037, 0x04000004, 0x49425a06, - 0x0201f800, 0x000202da, 0x59325817, 0x0201f800, - 0x001007fd, 0x0201f000, 0x00107911, 0x598c000d, - 0x81300580, 0x04000003, 0x497a6007, 0x1c01f000, - 0x59c40004, 0x82000500, 0x0000000c, 0x04000005, - 0x4a038804, 0x0000000c, 0x497b2807, 0x0401f00a, - 0x0401facd, 0x59300403, 0x82000d80, 0x00000040, - 0x04000004, 0x82000580, 0x00000042, 0x04020002, - 0x497a6007, 0x0201f800, 0x001070b9, 0x80000580, - 0x1c01f000, 0x59300804, 0x8c040d3e, 0x04020004, - 0x82000540, 0x00000001, 0x0401f005, 0x4933c857, - 0x84040d3e, 0x48066004, 0x80000580, 0x1c01f000, - 0x59300804, 0x8c040d20, 0x04020004, 0x82000540, - 0x00000001, 0x1c01f000, 0x4933c857, 0x4d380000, - 0x59300804, 0x84040d20, 0x48066004, 0x42027000, - 0x00000049, 0x59300203, 0x82000580, 0x00000003, - 0x04000003, 0x42027000, 0x00000013, 0x0201f800, - 0x000207a1, 0x80000580, 0x5c027000, 0x1c01f000, - 0x59300017, 0x81480580, 0x04020003, 0x59300018, - 0x814c0580, 0x1c01f000, 0x4d2c0000, 0x4d300000, - 0x0401f8c9, 0x4df00000, 0x0201f800, 0x00106062, - 0x59900001, 0x82000500, 0x00000003, 0x0c01f001, - 0x00106bba, 0x00106b9a, 0x00106b98, 0x00106b98, - 0x0201f800, 0x001005d8, 0x59926004, 0x0401f88e, - 0x813261c0, 0x0400001d, 0x59300004, 0x8c000516, - 0x04000004, 0x59325808, 0x497a5808, 0x497a5809, - 0x0401f88e, 0x59300001, 0x800001c0, 0x0400000e, - 0x497a6001, 0x42003000, 0x0000bf2e, 0x58180801, - 0x800409c0, 0x04020004, 0x48003001, 0x48003000, - 0x0401f00a, 0x58180800, 0x48000800, 0x48003000, - 0x0401f006, 0x59300809, 0x800409c0, 0x02000800, - 0x001005d8, 0x4978080c, 0x5c03e000, 0x04000890, - 0x5c026000, 0x5c025800, 0x1c01f000, 0x4d300000, - 0x497b2807, 0x0401f894, 0x4df00000, 0x598c0000, - 0x82000500, 0x00000007, 0x4803c857, 0x0c01f001, - 0x00106bef, 0x00106bd2, 0x00106bdb, 0x00106bdf, - 0x00106bea, 0x00106bef, 0x00106bd0, 0x00106bd0, - 0x0201f800, 0x001005d8, 0x598c000d, 0x80026540, - 0x04000004, 0x0401f81e, 0x02020800, 0x001005d8, - 0x0201f800, 0x001070b9, 0x0401f015, 0x0401f827, - 0x0201f800, 0x001070b9, 0x0401f011, 0x598c000d, - 0x80026540, 0x0400000e, 0x0401f838, 0x04000004, - 0x0401f80f, 0x04000002, 0x0401f81c, 0x0201f800, - 0x001070b9, 0x0401f006, 0x0401f830, 0x02020800, - 0x001005d8, 0x0201f800, 0x001070b9, 0x5c03e000, - 0x0400085b, 0x5c026000, 0x1c01f000, 0x598c0009, - 0x81300580, 0x0402000c, 0x0401f84e, 0x0401f83b, - 0x59300000, 0x800001c0, 0x04000004, 0x48031809, - 0x497a6000, 0x0401f003, 0x497b1809, 0x497b1808, - 0x80000580, 0x1c01f000, 0x4d2c0000, 0x59300406, - 0x82000580, 0x00000003, 0x04020012, 0x598c000b, - 0x81300580, 0x0402000f, 0x0401f83a, 0x59325808, - 0x497a5808, 0x497a5809, 0x0401f824, 0x59300000, - 0x800001c0, 0x04000004, 0x4803180b, 0x497a6000, - 0x0401f003, 0x497b180a, 0x497b180b, 0x80000580, - 0x5c025800, 0x1c01f000, 0x598c0005, 0x81300580, - 0x0402000c, 0x0401f827, 0x0401f814, 0x59300000, - 0x800001c0, 0x04000004, 0x48031805, 0x497a6000, - 0x0401f003, 0x497b1805, 0x497b1804, 0x80000580, - 0x1c01f000, 0x4a032001, 0x00000000, 0x497b2004, - 0x497b2005, 0x59900006, 0x82000500, 0x0000ffff, - 0x48032006, 0x1c01f000, 0x4c040000, 0x59300004, - 0x82000500, 0x7ffeffff, 0x48026004, 0x59bc00e4, - 0x8c000514, 0x04000009, 0x42000800, 0x0000bf00, - 0x58040012, 0x81300580, 0x04020004, 0x49780812, - 0x4a0378e4, 0x00000800, 0x5c000800, 0x1c01f000, - 0x4803c856, 0x598c000c, 0x80000540, 0x04000003, - 0x80000040, 0x4803180c, 0x1c01f000, 0x59bc00ea, - 0x82000500, 0x00000007, 0x82000580, 0x00000003, - 0x04020004, 0x4803c856, 0x4a0378e8, 0x00000001, - 0x1c01f000, 0x59bc00ea, 0x82000500, 0x00000007, - 0x82000580, 0x00000001, 0x04020011, 0x4803c856, - 0x42000800, 0x00000000, 0x0401f80e, 0x42000800, - 0x00001000, 0x59bc00ea, 0x82000500, 0x00000007, - 0x82000580, 0x00000003, 0x04000005, 0x80040840, - 0x040207f9, 0x0201f800, 0x001005d8, 0x1c01f000, - 0x59bc00ea, 0x82000500, 0x00000007, 0x82000580, - 0x00000001, 0x02020800, 0x001005d8, 0x59bc00ea, - 0x8c000516, 0x040207fe, 0x480778e1, 0x1c01f000, - 0x59bc00ea, 0x8c000516, 0x040207fe, 0x480778e1, - 0x59bc00ea, 0x8c000516, 0x040207fe, 0x480b78e1, - 0x1c01f000, 0x82000d00, 0x80000018, 0x02020800, - 0x001005d0, 0x0201f800, 0x001005d8, 0x00106c97, - 0x00106d3b, 0x00106d55, 0x00106c97, 0x00106c99, - 0x00106cba, 0x00106cd9, 0x00106d0d, 0x00106c97, - 0x00106d39, 0x00106c97, 0x00106c97, 0x00106c97, - 0x00106c97, 0x00106c97, 0x00106c97, 0x0201f800, - 0x001005d8, 0x4d300000, 0x4d900000, 0x4dd00000, - 0x4da40000, 0x4d140000, 0x0201f800, 0x001070d8, - 0x59bc00ea, 0x8c000510, 0x040007fe, 0x59be60e0, - 0x59300004, 0x8c000520, 0x04000011, 0x82000500, - 0xfffefeff, 0x48026004, 0x4a026203, 0x00000003, - 0x0401ffa9, 0x0201f800, 0x00100fd0, 0x5c022800, - 0x5c034800, 0x5c03a000, 0x5c032000, 0x5c026000, - 0x4a0378e4, 0x00000008, 0x0401f795, 0x84000510, - 0x48026004, 0x0401f7f6, 0x4d300000, 0x4d900000, - 0x4dd00000, 0x4da40000, 0x4d140000, 0x0201f800, - 0x001070d8, 0x59bc00ea, 0x8c000510, 0x040007fe, - 0x59be60e0, 0x59300004, 0x8c000520, 0x0400000f, - 0x82000500, 0xfffefeff, 0x48026004, 0x0401ff8a, - 0x0201f800, 0x0010100e, 0x5c022800, 0x5c034800, - 0x5c03a000, 0x5c032000, 0x5c026000, 0x4a0378e4, - 0x00000008, 0x0401f776, 0x84000510, 0x48026004, - 0x0401f7f6, 0x4d300000, 0x4d2c0000, 0x4d340000, - 0x4da40000, 0x4cd00000, 0x59bc00ea, 0x8c000510, - 0x040007fe, 0x59be60e0, 0x813261c0, 0x02000800, - 0x001005d8, 0x59300004, 0x8c000520, 0x0400001d, - 0x82000500, 0xfffefeff, 0x48026004, 0x59326809, - 0x42034800, 0x0010b544, 0x04011000, 0x4a03c840, - 0x0010b54b, 0x4a03c842, 0x00000012, 0x04011000, - 0x4a03c840, 0x0010b55d, 0x4a03c842, 0x000000ff, - 0x04011000, 0x4a03c840, 0x0010b65c, 0x4a03c842, - 0x000000ff, 0x0401fbf2, 0x5c01a000, 0x5c034800, - 0x5c026800, 0x5c025800, 0x5c026000, 0x1c01f000, - 0x84000510, 0x48026004, 0x5c01a000, 0x5c034800, - 0x5c026800, 0x5c025800, 0x5c026000, 0x1c01f000, - 0x1c01f000, 0x4d300000, 0x4d2c0000, 0x4d340000, - 0x4cd00000, 0x4d900000, 0x4dd00000, 0x4da40000, - 0x4d140000, 0x0401fbc3, 0x59bc00ea, 0x8c000510, - 0x040007fe, 0x59be60e0, 0x813261c0, 0x02000800, - 0x001005d8, 0x59300004, 0x8c000520, 0x0400000f, - 0x82000500, 0xfffefeff, 0x48026004, 0x0201f800, - 0x0010783a, 0x5c022800, 0x5c034800, 0x5c03a000, - 0x5c032000, 0x5c01a000, 0x5c026800, 0x5c025800, - 0x5c026000, 0x1c01f000, 0x84000510, 0x48026004, - 0x5c022800, 0x5c034800, 0x5c03a000, 0x5c032000, - 0x5c01a000, 0x5c026800, 0x5c025800, 0x5c026000, - 0x1c01f000, 0x0201f800, 0x001005d8, 0x4d300000, - 0x4d380000, 0x42000000, 0x0010b8c4, 0x0201f800, - 0x0010aa47, 0x0401ff14, 0x598e600d, 0x59c40004, - 0x8c000506, 0x04000004, 0x0401f8db, 0x4a038804, - 0x00000008, 0x813261c0, 0x04000006, 0x0401fb87, - 0x42027000, 0x00000014, 0x0201f800, 0x000207a1, - 0x4a0378e4, 0x00000002, 0x5c027000, 0x5c026000, - 0x0401f6f7, 0x4d180000, 0x4d300000, 0x4d380000, - 0x4d900000, 0x4dd00000, 0x4da40000, 0x4d140000, - 0x0401fef9, 0x417a3000, 0x59c40804, 0x83180400, - 0x0010709f, 0x50000000, 0x80040500, 0x0400001b, - 0x42000000, 0x0010b8c5, 0x0201f800, 0x0010aa47, - 0x0401fb70, 0x59926004, 0x0401f859, 0x83180400, - 0x0010709f, 0x50000000, 0x48038804, 0x813261c0, - 0x0400000a, 0x59300004, 0x8c00050c, 0x04020003, - 0x4a026203, 0x00000003, 0x42027000, 0x0000004a, - 0x0201f800, 0x000207a1, 0x59c40004, 0x82000500, - 0x00f80000, 0x04000005, 0x811a3000, 0x83180480, - 0x00000005, 0x040017dd, 0x4a0378e4, 0x00000008, - 0x5c022800, 0x5c034800, 0x5c03a000, 0x5c032000, - 0x5c027000, 0x5c026000, 0x5c023000, 0x0401f6c0, - 0x4d2c0000, 0x4d340000, 0x59326809, 0x598c0800, - 0x82040580, 0x00000004, 0x04020004, 0x838c1400, - 0x00000005, 0x0401f00c, 0x82040580, 0x00000001, - 0x04020004, 0x838c1400, 0x00000009, 0x0401f006, - 0x82040580, 0x00000002, 0x04020022, 0x838c1400, - 0x0000000b, 0x41306800, 0x58340000, 0x80007d40, - 0x0400001c, 0x583c0009, 0x81340580, 0x04020006, - 0x403c6800, 0x583c0000, 0x80007d40, 0x040207fa, - 0x0401f014, 0x4933c857, 0x483fc857, 0x583c0000, - 0x48006800, 0x49307800, 0x443c1000, 0x80000580, - 0x4803180d, 0x4803180f, 0x598c0000, 0x82000580, - 0x00000003, 0x04000003, 0x4a031800, 0x00000000, - 0x80000580, 0x5c026800, 0x5c025800, 0x1c01f000, - 0x82000540, 0x00000001, 0x0401f7fb, 0x491bc857, - 0x59c80840, 0x82040540, 0x00000010, 0x48039040, - 0x59c41008, 0x82080500, 0xffffff7f, 0x48038808, - 0x4c040000, 0x4c080000, 0x0401fabb, 0x04020007, - 0x0401fabf, 0x04000022, 0x48038804, 0x0201f800, - 0x0010107a, 0x0401f042, 0x4a038803, 0x00000008, - 0x59c40003, 0x82000500, 0x00000003, 0x040007fd, - 0x8c000502, 0x04020007, 0x0401fab1, 0x04000014, - 0x48038804, 0x0201f800, 0x0010107a, 0x0401f034, - 0x59c80040, 0x8400056a, 0x48039040, 0x59c80040, - 0x8c00052a, 0x040207fe, 0x59c40005, 0x82000500, - 0xc0000000, 0x04000006, 0x59c400a3, 0x84000540, - 0x480388a3, 0x4a038805, 0xc0000000, 0x0201f800, - 0x0010101d, 0x4a03a005, 0x30000000, 0x59d00006, - 0x4a03a005, 0x30000000, 0x59900006, 0x82000500, - 0xffff0000, 0x48032006, 0x59d00005, 0x8c000504, - 0x040207fe, 0x42000800, 0x00007600, 0x83180540, - 0x60000000, 0x480008a1, 0x811800dc, 0x59c80840, - 0x80040540, 0x48039040, 0x82000540, 0x00003000, - 0x48039040, 0x59c80040, 0x82000500, 0x00003000, - 0x040207fd, 0x0201f800, 0x00101068, 0x83180400, - 0x0010709f, 0x50000000, 0x48038804, 0x80000580, - 0x4df00000, 0x0201f800, 0x00106062, 0x5c03e000, - 0x5c001000, 0x5c000800, 0x480b8808, 0x48079040, - 0x1c01f000, 0x4803c856, 0x59c80840, 0x82040540, - 0x00000010, 0x48039040, 0x59c41008, 0x82080500, - 0xffffff7f, 0x48038808, 0x4c040000, 0x4c080000, - 0x59c40004, 0x82000500, 0x00000003, 0x04020010, - 0x59c40004, 0x82000500, 0x0000000c, 0x04000005, - 0x4a038804, 0x0000000c, 0x8c000504, 0x0401f025, - 0x59c80040, 0x8400056e, 0x48039040, 0x59c80040, - 0x8c00052e, 0x040207fe, 0x0401f01e, 0x4a038803, - 0x00000008, 0x59c40003, 0x82000500, 0x00000003, - 0x040007fd, 0x8c000502, 0x04020006, 0x59c40004, - 0x4a038804, 0x0000000c, 0x8c000504, 0x0401f011, - 0x59c80040, 0x8400056a, 0x48039040, 0x59c80040, - 0x8c00052a, 0x040207fe, 0x59c40005, 0x82000500, - 0xc0000000, 0x04000007, 0x59c400a3, 0x84000540, - 0x480388a3, 0x4a038805, 0xc0000000, 0x80000580, - 0x497b2807, 0x5c001000, 0x5c000800, 0x480b8808, - 0x48079040, 0x1c01f000, 0x4933c857, 0x4d900000, - 0x4dd00000, 0x4da40000, 0x4d140000, 0x0401fdee, - 0x4df00000, 0x0401fa6f, 0x59900004, 0x800001c0, - 0x04000011, 0x81300580, 0x0402000f, 0x59300004, - 0x84000520, 0x48026004, 0x0401ff51, 0x04020009, - 0x5c03e000, 0x04000dd6, 0x80000580, 0x5c022800, - 0x5c034800, 0x5c03a000, 0x5c032000, 0x1c01f000, - 0x0401fd0e, 0x42027000, 0x00000049, 0x59300004, - 0x84000520, 0x48026004, 0x8c00050c, 0x02020800, - 0x000207a1, 0x5c03e000, 0x04000dc5, 0x82000540, - 0x00000001, 0x5c022800, 0x5c034800, 0x5c03a000, - 0x5c032000, 0x1c01f000, 0x4933c857, 0x0401fdc6, - 0x4df00000, 0x598c000d, 0x80026540, 0x04000012, - 0x59300004, 0x84000520, 0x48026004, 0x0401ff8a, - 0x04000017, 0x0401fd26, 0x42027000, 0x00000013, - 0x59300004, 0x8c00050c, 0x02020800, 0x000207a1, - 0x5c03e000, 0x04000daa, 0x82000540, 0x00000001, - 0x1c01f000, 0x836c1580, 0x00000001, 0x040007f9, - 0x836c1580, 0x00000004, 0x040007f6, 0x42001000, - 0x00104148, 0x0201f800, 0x00105f90, 0x5c03e000, - 0x04000d9b, 0x80000580, 0x1c01f000, 0x4d300000, - 0x4d180000, 0x4d3c0000, 0x0401fd9f, 0x4df00000, - 0x4a0378e4, 0x0000000f, 0x0401f9ff, 0x417a3000, - 0x59926004, 0x813261c0, 0x04000010, 0x417a7800, - 0x0201f800, 0x001048d9, 0x0400000a, 0x59300c06, - 0x82040580, 0x00000003, 0x04000004, 0x82040580, - 0x00000006, 0x04020003, 0x42027800, 0x00000002, - 0x0201f800, 0x00108be3, 0x811a3000, 0x83180480, - 0x00000005, 0x040017eb, 0x42000800, 0x00000040, - 0x0201f800, 0x00101345, 0x4a0378e4, 0x0000000a, - 0x5c03e000, 0x04000d72, 0x5c027800, 0x5c023000, - 0x5c026000, 0x1c01f000, 0x4803c856, 0x4d300000, - 0x0401fd75, 0x4df00000, 0x59c80840, 0x82040540, - 0x00000010, 0x48039040, 0x59c41008, 0x82080500, - 0xffffff7f, 0x48038808, 0x4c040000, 0x4c080000, - 0x42001000, 0x00000003, 0x0401f9c2, 0x598e600d, - 0x813261c0, 0x04020f9d, 0x040009c7, 0x497b2807, - 0x0401f80a, 0x5c001000, 0x5c000800, 0x480b8808, - 0x84040d74, 0x48079040, 0x5c03e000, 0x04000d50, - 0x5c026000, 0x1c01f000, 0x4d380000, 0x4d180000, - 0x4d300000, 0x4d900000, 0x4dd00000, 0x4da40000, - 0x4d140000, 0x59c41004, 0x480bc857, 0x82080500, - 0x00003ff0, 0x04000025, 0x417a3000, 0x4c080000, - 0x0201f800, 0x00106062, 0x5c001000, 0x82080500, - 0x00000210, 0x04020004, 0x811a3000, 0x80081102, - 0x0401f7f7, 0x0401f9c3, 0x59926004, 0x4933c857, - 0x813261c0, 0x04020005, 0x59c400a3, 0x8c00051a, - 0x02000800, 0x001005d8, 0x0401fea5, 0x04000009, - 0x0401fc6a, 0x42027000, 0x00000049, 0x59300004, - 0x8c00050c, 0x02020800, 0x000207a1, 0x0401f007, - 0x42027000, 0x0000004a, 0x4a026203, 0x00000003, - 0x0201f800, 0x000207a1, 0x5c022800, 0x5c034800, - 0x5c03a000, 0x5c032000, 0x5c026000, 0x5c023000, - 0x5c027000, 0x1c01f000, 0x4d300000, 0x4d180000, - 0x4d900000, 0x0401fd1c, 0x42001000, 0x00000000, - 0x598c0000, 0x82000580, 0x00000005, 0x04000971, - 0x417a3000, 0x811b20c8, 0x83932400, 0x0000bf32, - 0x59900001, 0x82000580, 0x00000001, 0x0402000d, - 0x42000800, 0x000007d0, 0x59926004, 0x59300011, - 0x82000500, 0xfff00000, 0x80000540, 0x04000003, - 0x42000800, 0x00001b58, 0x0201f800, 0x00106054, - 0x811a3000, 0x83180480, 0x00000005, 0x040017ea, - 0x59c81040, 0x84081534, 0x480b9040, 0x0401fcf0, - 0x5c032000, 0x5c023000, 0x5c026000, 0x1c01f000, - 0x4933c857, 0x4d900000, 0x4dd00000, 0x4da40000, - 0x4d140000, 0x4d380000, 0x0401fcef, 0x4df00000, - 0x59300004, 0x8c00053e, 0x04020007, 0x8c000520, - 0x04000025, 0x0201f800, 0x00106b6c, 0x04000022, - 0x0401f02a, 0x598c000d, 0x81300580, 0x04000011, - 0x0201f800, 0x00108cd6, 0x04020024, 0x0401f918, - 0x04000022, 0x48038804, 0x0401f95e, 0x0201f800, - 0x0010107a, 0x0401fc0d, 0x42027000, 0x00000049, - 0x59300004, 0x8c00050c, 0x0402000d, 0x0401f00e, - 0x59c40004, 0x8c000504, 0x04000014, 0x4a038804, - 0x00000004, 0x0401fc36, 0x42027000, 0x00000013, - 0x59300004, 0x8c00050c, 0x04000003, 0x0201f800, - 0x000207a1, 0x5c03e000, 0x04000cb9, 0x5c027000, - 0x5c022800, 0x5c034800, 0x5c03a000, 0x5c032000, - 0x80000580, 0x1c01f000, 0x5c03e000, 0x04000cb0, - 0x5c027000, 0x5c022800, 0x5c034800, 0x5c03a000, - 0x5c032000, 0x82000540, 0x00000001, 0x1c01f000, - 0x497b2807, 0x0401fcb0, 0x59c400af, 0x800001c0, - 0x04020004, 0x0401fca2, 0x0201f000, 0x001014fb, - 0x598c000f, 0x82001480, 0x00000002, 0x04021007, - 0x80000000, 0x4803180f, 0x80000580, 0x0201f800, - 0x0010604d, 0x0400000e, 0x0401fed8, 0x0402000c, - 0x0401fdd4, 0x0400000a, 0x0201f800, 0x0010a9c7, - 0x0401f916, 0x4d380000, 0x42027000, 0x00000014, - 0x0201f800, 0x000207a1, 0x5c027000, 0x0401fc88, - 0x0201f000, 0x001014fb, 0x4d900000, 0x4dd00000, - 0x4da40000, 0x4d140000, 0x4d300000, 0x0201f800, - 0x00106062, 0x0401fc88, 0x59c400af, 0x800001c0, - 0x04000027, 0x0401f907, 0x59926004, 0x4933c857, - 0x59300004, 0x8c000516, 0x0400000b, 0x0401fe8b, - 0x0402001f, 0x0201f800, 0x00106b8a, 0x0401fc70, - 0x42000800, 0x80000804, 0x0201f800, 0x00106721, - 0x0401f017, 0x42001800, 0x00007530, 0x0401f8c1, - 0x04020004, 0x0201f800, 0x00106052, 0x0401f010, - 0x0401fe7a, 0x0402000e, 0x0201f800, 0x0010a9c7, - 0x59300004, 0x8c00050c, 0x04020003, 0x4a026203, - 0x00000003, 0x4d380000, 0x42027000, 0x0000004a, - 0x0201f800, 0x000207a1, 0x5c027000, 0x0401fc54, - 0x5c026000, 0x5c022800, 0x5c034800, 0x5c03a000, - 0x5c032000, 0x0201f000, 0x001014fb, 0x4d900000, - 0x4dd00000, 0x4da40000, 0x4d140000, 0x4d300000, - 0x4d2c0000, 0x0401fc50, 0x0401f8d2, 0x59926004, - 0x4933c857, 0x0401f880, 0x04000016, 0x0201f800, - 0x00106062, 0x813261c0, 0x04000034, 0x59325808, - 0x812e59c0, 0x02000800, 0x001005d8, 0x0201f800, - 0x0010513b, 0x0402001d, 0x592c0208, 0x84000550, - 0x48025a08, 0x0201f800, 0x00105258, 0x04020027, - 0x592c0208, 0x84000510, 0x48025a08, 0x0401f023, - 0x0201f800, 0x00106052, 0x0401f020, 0x0201f800, - 0x0010a9c7, 0x0401fd9e, 0x592c0208, 0x84000550, - 0x48025a08, 0x4d380000, 0x42027000, 0x0000004a, - 0x4a026203, 0x00000003, 0x0201f800, 0x000207a1, - 0x5c027000, 0x0401f011, 0x59900006, 0x82000500, - 0xffff0000, 0x040207ee, 0x59c408af, 0x82040480, - 0x000003e8, 0x040217ea, 0x59900006, 0x82000400, - 0x00010000, 0x48032006, 0x0201f800, 0x00106052, - 0x0201f800, 0x0010411d, 0x5c025800, 0x5c026000, - 0x5c022800, 0x5c034800, 0x5c03a000, 0x5c032000, - 0x0401f403, 0x4d300000, 0x4d2c0000, 0x0401fc0a, - 0x598e600d, 0x4933c857, 0x59c41004, 0x8c081500, - 0x04000007, 0x0201f800, 0x0010513b, 0x04020007, - 0x0201f800, 0x00105258, 0x0402002f, 0x0201f800, - 0x0010604d, 0x0401f02c, 0x598c000f, 0x80000540, - 0x04020011, 0x59c408af, 0x82040480, 0x000003e8, - 0x0402100d, 0x598c080f, 0x80040800, 0x4807180f, - 0x0201f800, 0x0010604d, 0x42000000, 0x0010b852, - 0x0201f800, 0x0010aa47, 0x0201f800, 0x0010411d, - 0x0401f019, 0x0401fdb4, 0x813261c0, 0x04020003, - 0x0401f849, 0x0401f014, 0x0201f800, 0x0010a9c7, - 0x59300406, 0x82000580, 0x00000003, 0x04020007, - 0x59325808, 0x812e59c0, 0x04000004, 0x592c0208, - 0x84000550, 0x48025a08, 0x0401f854, 0x4d380000, - 0x42027000, 0x00000014, 0x0201f800, 0x000207a1, - 0x5c027000, 0x5c025800, 0x5c026000, 0x0201f000, - 0x00106c4b, 0x59c40804, 0x83180400, 0x00107095, - 0x50000000, 0x80040500, 0x1c01f000, 0x59c40804, - 0x83180400, 0x0010709a, 0x50000000, 0x80040500, - 0x1c01f000, 0x00000210, 0x00000420, 0x00000840, - 0x00001080, 0x00002100, 0x00004000, 0x00008000, - 0x00010000, 0x00020000, 0x00040000, 0x00080000, - 0x00100000, 0x00200000, 0x00400000, 0x00800000, - 0x59900806, 0x80040120, 0x800c0480, 0x04021004, - 0x82000540, 0x00000001, 0x0401f005, 0x82040c00, - 0x00010000, 0x48072006, 0x80000580, 0x1c01f000, - 0x480bc857, 0x0201f800, 0x00106c55, 0x4df00000, - 0x480b1800, 0x5c03e000, 0x02000800, 0x00106c4b, - 0x1c01f000, 0x4803c856, 0x0201f800, 0x00106c55, - 0x4df00000, 0x497b180d, 0x497b1803, 0x497b180e, - 0x497b180f, 0x497b1810, 0x598c0000, 0x82000580, - 0x00000003, 0x04000009, 0x836c0580, 0x00000002, - 0x04020004, 0x4a031800, 0x00000005, 0x0401f003, - 0x4a031800, 0x00000000, 0x5c03e000, 0x02000800, - 0x00106c4b, 0x1c01f000, 0x59300004, 0x8c00050c, - 0x04020003, 0x4a026203, 0x00000001, 0x1c01f000, - 0x83180480, 0x00000005, 0x02021800, 0x001005d8, - 0x491bc857, 0x811b20c8, 0x83932400, 0x0000bf32, - 0x811ba0ca, 0x83d3a400, 0x00007600, 0x83180400, - 0x001070ea, 0x50034800, 0x811a28c2, 0x83162c00, - 0x00006100, 0x1c01f000, 0x0010b75b, 0x0010b772, - 0x0010b789, 0x0010b7a0, 0x0010b7b7, 0x4933c857, - 0x59300406, 0x82000c80, 0x00000012, 0x04021016, - 0x4803c857, 0x04011000, 0x0c01f001, 0x00107109, - 0x00107198, 0x001074d1, 0x00107556, 0x00107198, - 0x001074d1, 0x00107556, 0x00107109, 0x00107198, - 0x00107109, 0x00107109, 0x00107109, 0x00107109, - 0x00107109, 0x00107109, 0x00107109, 0x0010710f, - 0x0010710f, 0x0201f800, 0x00106c55, 0x0201f800, - 0x00106bbf, 0x0201f000, 0x00106c4b, 0x42001000, - 0x0010b7f6, 0x50081000, 0x4930100c, 0x58080002, - 0x82000580, 0x00000100, 0x04020032, 0x59325808, - 0x812e59c0, 0x02000800, 0x001005d8, 0x59326809, - 0x813669c0, 0x04000019, 0x592c040b, 0x82000500, - 0x0000e000, 0x04000003, 0x0401fba8, 0x0401f002, - 0x0401fb98, 0x42001000, 0x0010b7f6, 0x50081000, - 0x4930100b, 0x492c100a, 0x82d00400, 0x00000006, - 0x48001003, 0x592c000d, 0x80000104, 0x48001004, - 0x592c000e, 0x48001007, 0x592c000f, 0x48001008, - 0x0201f000, 0x00100858, 0x42026800, 0x0010be0d, - 0x592c080a, 0x48066802, 0x82040500, 0x00ffff00, - 0x04000007, 0x497a6a12, 0x59a81010, 0x82081500, - 0x00ffff00, 0x80080580, 0x040207dc, 0x82040d00, - 0x000000ff, 0x800408d0, 0x48066a12, 0x0401f7d7, - 0x1c01f000, 0x4d2c0000, 0x4d300000, 0x4c580000, - 0x4c540000, 0x4c500000, 0x5832580a, 0x812e59c0, - 0x02000800, 0x001005d8, 0x58300002, 0x4a006002, - 0x00000100, 0x82000580, 0x00000100, 0x0402001c, - 0x5830000b, 0x5832600c, 0x81300580, 0x04020010, - 0x0401f828, 0x04020010, 0x592c080d, 0x80040904, - 0x4004b000, 0x4200a000, 0x0010b54b, 0x4050a800, - 0x0201f800, 0x0010ab28, 0x42001000, 0x0000dc00, - 0x0201f800, 0x001078bc, 0x0401f003, 0x0401f819, - 0x04000fa3, 0x5c00a000, 0x5c00a800, 0x5c00b000, - 0x5c026000, 0x5c025800, 0x1c01f000, 0x5830000b, - 0x5832600c, 0x81300580, 0x040207f5, 0x0401f80d, - 0x040207f5, 0x0201f800, 0x001068d3, 0x02020800, - 0x001005d8, 0x4a025a06, 0x00000002, 0x0201f800, - 0x000202da, 0x0201f800, 0x00107911, 0x0401f7ea, - 0x0201f800, 0x00106c55, 0x4df00000, 0x598c000d, - 0x81300580, 0x04020009, 0x598c0005, 0x81300580, - 0x04020006, 0x5c03e000, 0x02000800, 0x00106c4b, - 0x80000580, 0x1c01f000, 0x5c03e000, 0x02000800, - 0x00106c4b, 0x82000540, 0x00000001, 0x1c01f000, - 0x59300403, 0x82000c80, 0x00000056, 0x02021800, - 0x001005d8, 0x4803c857, 0x0c01f001, 0x00107302, - 0x0010731d, 0x0010732e, 0x00107431, 0x001073f1, - 0x001073f5, 0x00107406, 0x0010741a, 0x0010740f, - 0x0010741a, 0x00107455, 0x0010741a, 0x00107497, - 0x0010741a, 0x001074a5, 0x0010741a, 0x0010740f, - 0x0010741a, 0x001074a9, 0x001071f5, 0x001071f5, - 0x001071f5, 0x001071f5, 0x001071f5, 0x001071f5, - 0x001071f5, 0x001071f5, 0x001071f5, 0x001071f5, - 0x001071f5, 0x00107574, 0x00107593, 0x0010759d, - 0x001071f5, 0x001075b3, 0x00107406, 0x001071f5, - 0x00107406, 0x0010741a, 0x001071f5, 0x0010732e, - 0x00107431, 0x001071f5, 0x00107603, 0x0010741a, - 0x001071f5, 0x00107613, 0x0010741a, 0x001071f5, - 0x0010740f, 0x001072f3, 0x001071f7, 0x001071f5, - 0x0010762a, 0x0010765d, 0x001076d7, 0x001071f5, - 0x001076e7, 0x00107404, 0x001076da, 0x001071f5, - 0x001075bf, 0x00107700, 0x001071f5, 0x00107735, - 0x00107788, 0x001071f5, 0x0010720c, 0x00107265, - 0x00107272, 0x001071f5, 0x00107406, 0x001071f5, - 0x001072b9, 0x001072c4, 0x001071f5, 0x001071f5, - 0x00107220, 0x00107245, 0x001077c7, 0x00107808, - 0x0010782e, 0x001071f5, 0x001071f5, 0x001071f5, - 0x001077fc, 0x0201f800, 0x001005d8, 0x0401fac5, - 0x59325808, 0x592c0009, 0x4801a006, 0x592c000a, - 0x4801a007, 0x592c000b, 0x4801a008, 0x592c000c, - 0x4801a009, 0x592c000d, 0x4801a00a, 0x4979a00b, - 0x592c0809, 0x82040d00, 0x00000fff, 0x80040904, - 0x42001000, 0x0000dc00, 0x0201f000, 0x001078bc, - 0x4a026202, 0x0000ffff, 0x0401faae, 0x4d2c0000, - 0x4a01a006, 0x05000000, 0x59325808, 0x592c0009, - 0x4801a007, 0x592c000a, 0x4801a008, 0x592c000b, - 0x4801a009, 0x42000800, 0x00000004, 0x42001000, - 0x0000dc00, 0x5c025800, 0x0201f000, 0x001078bc, - 0x4c580000, 0x4c500000, 0x4c540000, 0x4d2c0000, - 0x0401fa98, 0x59325808, 0x5930040b, 0x800000c2, - 0x4200a800, 0x0010b54b, 0x592cb205, 0x832ca400, - 0x00000006, 0x0201f800, 0x0010ab17, 0x40580000, - 0x8054ac00, 0x592c0001, 0x80000540, 0x04000003, - 0x40025800, 0x0401f7f5, 0x4200a000, 0x0010b54b, - 0x4050a800, 0x5930b40b, 0x0201f800, 0x0010ab28, - 0x59300c0b, 0x42001000, 0x0000dc00, 0x5c025800, - 0x5c00a800, 0x5c00b000, 0x5c00a000, 0x0201f000, - 0x001078bc, 0x4c580000, 0x4c500000, 0x4c540000, - 0x4d2c0000, 0x42034800, 0x0010b544, 0x0401fa7f, - 0x59325808, 0x4a025805, 0x02000000, 0x592c0802, - 0x82d0ac00, 0x00000006, 0x592cb011, 0x832ca400, - 0x00000005, 0x0201f800, 0x0010ab17, 0x40580000, - 0x8054ac00, 0x592e5801, 0x41780000, 0x812e5d40, - 0x040207f6, 0x42001000, 0x0000dc00, 0x5c025800, - 0x5c00a800, 0x5c00b000, 0x5c00a000, 0x0201f000, - 0x001078bc, 0x0401fa57, 0x4a01a006, 0x78000000, - 0x5930001c, 0x840001c0, 0x4801a407, 0x4979a207, - 0x42000800, 0x00000002, 0x42001000, 0x0000dc00, - 0x0201f000, 0x001078bc, 0x4c580000, 0x4c540000, - 0x4c500000, 0x0401fa55, 0x4a01a006, 0x02000000, - 0x59a80002, 0x4801a008, 0x59a80003, 0x4801a009, - 0x59a80000, 0x4801a00a, 0x59a80001, 0x4801a00b, - 0x5930001c, 0x82000d80, 0x0000e000, 0x04000016, - 0x82000d80, 0x0000df00, 0x04000006, 0x4a01a407, - 0x00000010, 0x42000800, 0x00000006, 0x0401f027, - 0x4a03c840, 0x0010b4eb, 0x4a03c842, 0x0000000d, - 0x42001800, 0x0010b4eb, 0x0201f800, 0x001007af, - 0x42000000, 0x0000df00, 0x4200a000, 0x0010b4eb, - 0x0401f00d, 0x4a03c840, 0x0010b4f8, 0x4a03c842, - 0x0000000d, 0x42001800, 0x0010b4f8, 0x0201f800, - 0x001007af, 0x42000000, 0x0000e000, 0x4200a000, - 0x0010b4f8, 0x82000540, 0x00000010, 0x4801a407, - 0x4a01a207, 0x00000034, 0x4200b000, 0x0000000d, - 0x82d0ac00, 0x0000000c, 0x0201f800, 0x0010ab17, - 0x42000800, 0x00000013, 0x42001000, 0x0000dc00, - 0x5c00a000, 0x5c00a800, 0x5c00b000, 0x0201f000, - 0x001078bc, 0x0401fa03, 0x4a01a006, 0x63000028, - 0x5930001c, 0x4801a007, 0x42000800, 0x00000002, - 0x42001000, 0x0000dc00, 0x0201f000, 0x001078bc, - 0x0401fa06, 0x41780000, 0x41780800, 0x42002000, - 0x00080000, 0x0c01f81b, 0x80000000, 0x80040800, - 0x42001000, 0x0000000c, 0x59841802, 0x8c0c1d00, - 0x04020008, 0x42002000, 0x00050000, 0x0c01f811, - 0x80000000, 0x80040800, 0x82081400, 0x00000004, - 0x82080540, 0x02000000, 0x4801a006, 0x800408e0, - 0x5930001c, 0x80040540, 0x4801a007, 0x80080904, - 0x42001000, 0x0000dc00, 0x0201f000, 0x001078bc, - 0x001072e9, 0x001072eb, 0x001072ed, 0x001072ef, - 0x001072f1, 0x4811a008, 0x1c01f000, 0x4811a009, - 0x1c01f000, 0x4811a00a, 0x1c01f000, 0x4811a00b, - 0x1c01f000, 0x4811a00c, 0x1c01f000, 0x4a026009, - 0x0010be0d, 0x59a80010, 0x82000500, 0x000000ff, - 0x800000d0, 0x42026800, 0x0010be0d, 0x48026a12, - 0x0401fa3b, 0x41780800, 0x42001000, 0x00005c00, - 0x0201f000, 0x001078bc, 0x0401f9ba, 0x4a01a006, - 0x52000000, 0x4979a007, 0x599c0017, 0x8c000500, - 0x04000005, 0x599c0402, 0x0201f800, 0x001015da, - 0x4805a007, 0x59a80002, 0x4801a008, 0x59a80003, - 0x4801a009, 0x59a80000, 0x4801a00a, 0x59a80001, - 0x4801a00b, 0x59a80010, 0x4801a00c, 0x42000800, - 0x00000007, 0x42001000, 0x0000dc00, 0x0201f000, - 0x001078bc, 0x4a026202, 0x0000ffff, 0x0401f99d, - 0x4a01a006, 0x05000000, 0x59a80010, 0x4801a007, - 0x59a80002, 0x59a80803, 0x4801a008, 0x4805a009, - 0x42000800, 0x00000004, 0x42001000, 0x0000dc00, - 0x0201f000, 0x001078bc, 0x4a026202, 0x0000ffff, - 0x0401f98c, 0x4d3c0000, 0x417a7800, 0x0201f800, - 0x001048f6, 0x5c027800, 0x4a01a006, 0x03000000, - 0x59340403, 0x82000580, 0x000007fe, 0x0402006e, - 0x4a01a006, 0x04000000, 0x81a40800, 0x4a000800, - 0x22fffffe, 0x5934000a, 0x84000500, 0x4802680a, - 0x59c41002, 0x8408150c, 0x480b8802, 0x59a80026, - 0x8c000508, 0x04000010, 0x59a8002a, 0x4801a007, - 0x59a8002b, 0x82000500, 0xffff2000, 0x599c0818, - 0x8c040d16, 0x04000002, 0x8400056a, 0x4801a008, - 0x4a01a009, 0x00002710, 0x59a8002d, 0x4801a00a, - 0x0401f039, 0x59a8002a, 0x4801a007, 0x0201f800, - 0x0010513b, 0x04020009, 0x497b8880, 0x82000500, - 0x0000ffff, 0x4c000000, 0x0201f800, 0x00101606, - 0x5c000000, 0x48038880, 0x59a8002b, 0x0201f800, - 0x0010513b, 0x04020004, 0x82000500, 0x37ffffff, - 0x0401f003, 0x82000500, 0x3fffffff, 0x599c0818, - 0x8c040d16, 0x04000002, 0x8400056a, 0x59a80805, - 0x8c040d10, 0x04000019, 0x59300c03, 0x82041580, - 0x00000051, 0x04000015, 0x82041580, 0x00000031, - 0x04000012, 0x4c580000, 0x4c500000, 0x4c540000, - 0x4200b000, 0x00000004, 0x4200a000, 0x0010b8fa, - 0x82d0ac00, 0x0000001f, 0x4c000000, 0x0201f800, - 0x0010ab17, 0x5c000000, 0x5c00a800, 0x5c00a000, - 0x5c00b000, 0x8400057a, 0x4801a008, 0x4979a009, - 0x4979a00a, 0x59a80002, 0x59a80803, 0x4801a00b, - 0x4805a00c, 0x59a80000, 0x59a80801, 0x4801a00d, - 0x4805a00e, 0x4979a00f, 0x4979a010, 0x4979a011, - 0x4979a012, 0x4979a013, 0x4979a014, 0x4979a015, - 0x4979a016, 0x59a8002e, 0x84000576, 0x4801a017, - 0x59a8002f, 0x4801a018, 0x4979a019, 0x4979a01a, - 0x0401f043, 0x59a80026, 0x8c000508, 0x0400000d, - 0x59a8002a, 0x82000500, 0x0000ffff, 0x59c40880, - 0x80040d80, 0x04000007, 0x497b8880, 0x4c000000, - 0x0201f800, 0x00101606, 0x5c000000, 0x48038880, - 0x59a8002a, 0x4801a007, 0x4c640000, 0x4d2c0000, - 0x59a8c82b, 0x0201f800, 0x00109037, 0x0400000d, - 0x0201f800, 0x00109597, 0x0402000a, 0x592c0207, - 0x8c00050e, 0x04000007, 0x8264cd00, 0x0000ffff, - 0x592c0009, 0x82000500, 0xffff0000, 0x8064cd40, - 0x4865a008, 0x5c025800, 0x5c00c800, 0x59a8002c, - 0x4801a009, 0x59a8002d, 0x4801a00a, 0x59a80002, - 0x59a80803, 0x4801a00b, 0x4805a00c, 0x59a80000, - 0x59a80801, 0x4801a00d, 0x4805a00e, 0x4979a00f, - 0x4979a010, 0x4979a011, 0x4979a012, 0x4979a013, - 0x4979a014, 0x4979a015, 0x4979a016, 0x59a8002e, - 0x4801a017, 0x59a8002f, 0x4801a018, 0x59a80030, - 0x4801a019, 0x59a80031, 0x4801a01a, 0x42000800, - 0x0000001d, 0x42001000, 0x0000dc00, 0x0201f000, - 0x001078bc, 0x0401f8cb, 0x4a01a006, 0x50000000, - 0x0401f7b5, 0x0401f8c7, 0x4a01a406, 0x21000010, - 0x4a01a206, 0x00000014, 0x4979a007, 0x4979a008, - 0x4979a009, 0x4979a00a, 0x42000800, 0x00000005, - 0x42001000, 0x0000dc00, 0x0201f000, 0x001078bc, - 0x0401f8bf, 0x0401f002, 0x0401f8c4, 0x4a01a006, - 0x02000000, 0x42000800, 0x00000001, 0x42001000, - 0x0000dc00, 0x0201f000, 0x001078bc, 0x0401f8bb, - 0x4a01a006, 0x02000000, 0x59300403, 0x82000580, - 0x00000031, 0x04020794, 0x81a40800, 0x4a000801, - 0x00fffffe, 0x0401f72b, 0x0401f8b0, 0x4a01a006, - 0x01000000, 0x5930041a, 0x80000540, 0x04000003, - 0x4801a407, 0x0401f003, 0x4a01a407, 0x00000003, - 0x5930021a, 0x80000540, 0x04000003, 0x4801a207, - 0x0401f003, 0x4a01a207, 0x00002a00, 0x42000800, - 0x00000002, 0x42001000, 0x0000dc00, 0x0201f000, - 0x001078bc, 0x4a026202, 0x0000ffff, 0x0401f889, - 0x4a01a406, 0x00002010, 0x4a01a206, 0x00000014, - 0x4a01a407, 0x00000800, 0x4a01a207, 0x00002000, - 0x80000580, 0x599c0817, 0x8c040d0a, 0x04020003, - 0x82000540, 0x00000020, 0x8c040d08, 0x04000003, - 0x82000540, 0x00000010, 0x82000540, 0x00000002, - 0x5934080a, 0x8c040d14, 0x04000005, 0x82040d00, - 0x00000380, 0x80040540, 0x0401f006, 0x599c0818, - 0x8c040d18, 0x04000003, 0x82000540, 0x00000380, - 0x0401f03c, 0x0401f875, 0x4a01a406, 0x00000210, - 0x4a01a206, 0x00000014, 0x4a01a407, 0x00000800, - 0x5934000a, 0x8c000516, 0x04000014, 0x59340c05, - 0x82040500, 0x00000030, 0x04000013, 0x59340a05, - 0x82040500, 0x0000c000, 0x04020009, 0x8c040d1a, - 0x04000004, 0x4a01a207, 0x00002100, 0x0401f00c, - 0x4a01a207, 0x00000100, 0x0401f009, 0x4a01a207, - 0x00000400, 0x0401f006, 0x4a01a207, 0x00000700, - 0x0401f003, 0x4a01a207, 0x00000800, 0x80000580, - 0x599c0817, 0x8c040d0a, 0x04020003, 0x82000540, - 0x00000020, 0x8c040d08, 0x04000003, 0x82000540, - 0x00000010, 0x82000540, 0x00000002, 0x59340a00, - 0x8c040d0e, 0x0400000b, 0x84000550, 0x599c1017, - 0x8c08150a, 0x04020004, 0x8c040d0a, 0x04000002, - 0x8400054e, 0x8c040d1c, 0x04000002, 0x84000552, - 0x4801a20a, 0x42000800, 0x00000005, 0x42001000, - 0x0000dc00, 0x0201f000, 0x001078bc, 0x0401f833, - 0x4a01a006, 0x02100014, 0x4a01a007, 0x01000000, - 0x4979a008, 0x4979a009, 0x4979a00a, 0x42000800, - 0x00000005, 0x42001000, 0x0000dc00, 0x0201f000, - 0x001078bc, 0x0401f825, 0x4a01a006, 0x02000000, - 0x0401f65d, 0x4933c857, 0x0401f820, 0x4a01a006, - 0x01000000, 0x4a01a407, 0x0000000b, 0x42000800, - 0x00000002, 0x42001000, 0x0000dc00, 0x0201f000, - 0x001078bc, 0x42005000, 0x32000000, 0x42006000, - 0x08290000, 0x41786800, 0x41787800, 0x0401f3df, - 0x42005000, 0x22000000, 0x42006000, 0x01290000, - 0x41786800, 0x41787800, 0x0401f3d8, 0x42005000, - 0x33000000, 0x42006000, 0x08980000, 0x41786800, - 0x41787800, 0x0401f3d1, 0x42005000, 0x23000000, - 0x42006000, 0x01980000, 0x41786800, 0x41787800, - 0x0401f3ca, 0x59300403, 0x82000c80, 0x00000085, - 0x02001800, 0x001005d8, 0x82000c80, 0x00000093, - 0x02021800, 0x001005d8, 0x82000480, 0x00000085, - 0x0c01f001, 0x001074eb, 0x001074ed, 0x001074fb, - 0x001074eb, 0x001074eb, 0x001074eb, 0x001074eb, - 0x001074eb, 0x001074eb, 0x001074eb, 0x001074eb, - 0x001074eb, 0x001074eb, 0x00107506, 0x0201f800, - 0x001005d8, 0x4933c857, 0x0401f850, 0x59300402, - 0x4801a407, 0x5930001c, 0x4801a207, 0x4979a408, - 0x4a01a208, 0x0000ffff, 0x42000800, 0x00000003, - 0x42001000, 0x0000dc00, 0x0401f3c2, 0x4933c857, - 0x0401f84e, 0x4a01a406, 0x00000003, 0x4a01a206, - 0x00000300, 0x42000800, 0x00000001, 0x42001000, - 0x0000dc00, 0x0401f3b7, 0x4d2c0000, 0x59325808, - 0x4933c857, 0x492fc857, 0x812e59c0, 0x02000800, - 0x001005d8, 0x59340a12, 0x82040d00, 0x0000ff00, - 0x592c000a, 0x82000500, 0x000000ff, 0x900001c0, - 0x80040540, 0x82000540, 0x00000011, 0x44034800, - 0x81a5a000, 0x42001000, 0x00000009, 0x42000800, - 0x00000003, 0x592c0009, 0x82000500, 0xff000000, - 0x82001d80, 0x84000000, 0x04000009, 0x82001d80, - 0x85000000, 0x02020800, 0x001005d8, 0x42001000, - 0x00000007, 0x42000800, 0x00000001, 0x832c1c00, - 0x00000009, 0x500c0000, 0x4401a000, 0x800c1800, - 0x80d1a000, 0x80081040, 0x040207fb, 0x42001000, - 0x0000dc00, 0x5c025800, 0x0401f386, 0x42005000, - 0x81000000, 0x42006000, 0x00090000, 0x41786800, - 0x41787800, 0x0401f35d, 0x42005000, 0x84000000, - 0x42006000, 0x00990000, 0x59300406, 0x82000580, - 0x00000005, 0x04000002, 0x8430652e, 0x41786800, - 0x41787800, 0x0401f351, 0x42005000, 0x85000000, - 0x42006000, 0x00990000, 0x59300406, 0x82000580, - 0x00000005, 0x04000002, 0x8430652e, 0x41786800, - 0x41787800, 0x0401f345, 0x59300403, 0x82000c80, - 0x00000053, 0x02021800, 0x001005d8, 0x82000480, - 0x0000004b, 0x02001800, 0x001005d8, 0x59326809, - 0x59368c03, 0x4803c857, 0x0c01f001, 0x001075da, - 0x001075e2, 0x001075ea, 0x001075f2, 0x0010756b, - 0x0010756b, 0x0010756b, 0x001075d2, 0x0201f800, - 0x001005d8, 0x42005000, 0x06000000, 0x42006000, - 0x08290000, 0x41786800, 0x41787800, 0x0401f327, - 0x4933c857, 0x0401ff47, 0x4a01a006, 0x12000000, - 0x59300406, 0x82000580, 0x00000004, 0x04020003, - 0x59340002, 0x0401f002, 0x59a80010, 0x82000500, - 0x00ffffff, 0x4801a007, 0x59300419, 0x4801a408, - 0x59300219, 0x4801a208, 0x4979a009, 0x4979a00a, - 0x4979a00b, 0x4979a00c, 0x4979a00d, 0x4979a00e, - 0x4979a00f, 0x4979a010, 0x42000800, 0x0000000b, - 0x42001000, 0x0000dc00, 0x0401f32a, 0x0401ff29, - 0x4a01a006, 0x0f000000, 0x5930001c, 0x4801a007, - 0x42000800, 0x00000002, 0x42001000, 0x0000dc00, - 0x0401f320, 0x0401ff2d, 0x4a01a006, 0x02000000, - 0x59c40085, 0x48031004, 0x59880000, 0x4801a007, - 0x59880001, 0x4801a008, 0x59880002, 0x4801a009, - 0x59880003, 0x4801a00a, 0x59880004, 0x4801a00b, - 0x59880005, 0x4801a00c, 0x42000800, 0x00000007, - 0x42001000, 0x0000dc00, 0x0401f30a, 0x4a026202, - 0x0000ffff, 0x0401ff07, 0x4a01a006, 0x62000000, - 0x5930001c, 0x4801a007, 0x42000800, 0x00000002, - 0x42001000, 0x0000dc00, 0x0401f2fe, 0x0401fefd, - 0x59300808, 0x4c500000, 0x4c540000, 0x4c580000, - 0x8204a400, 0x0000000a, 0x5930b01c, 0x82d0ac00, - 0x00000006, 0x0201f800, 0x0010ab17, 0x5930081c, - 0x42001000, 0x0000dc00, 0x5c00b000, 0x5c00a800, - 0x5c00a000, 0x0401f2eb, 0x0401ff9b, 0x59300017, - 0x4801a006, 0x59300018, 0x4801a007, 0x4a01a008, - 0x00001000, 0x0401f020, 0x0401ff93, 0x59300017, - 0x4801a006, 0x59300018, 0x4801a007, 0x4a01a008, - 0x00004000, 0x0401f018, 0x0401ff8b, 0x59300017, - 0x4801a006, 0x59300018, 0x4801a007, 0x4a01a008, - 0x00002000, 0x0401f010, 0x0401ff83, 0x59300017, - 0x4801a006, 0x59300018, 0x4801a007, 0x4a01a008, - 0x00000400, 0x0401f008, 0x0401ff7b, 0x59300017, - 0x4801a006, 0x59300018, 0x4801a007, 0x4a01a008, - 0x00000200, 0x4979a009, 0x4979a00a, 0x4979a00b, - 0x4979a00c, 0x4979a00d, 0x42000800, 0x00000008, - 0x42001000, 0x0000dc00, 0x0401f2ba, 0x0401fec7, - 0x4a01a006, 0x02000014, 0x4979a407, 0x4979a207, - 0x59a8003a, 0x4801a008, 0x59a8003b, 0x4801a009, - 0x4a01a00a, 0x00047878, 0x42000800, 0x00000005, - 0x42001000, 0x0000dc00, 0x0401f2aa, 0x0401feb7, - 0x4a01a006, 0x02140018, 0x4a01a407, 0x00000800, - 0x5930001c, 0x82000d00, 0xff000000, 0x900409c0, - 0x4805a207, 0x82000500, 0x00ffffff, 0x4801a00a, - 0x4979a408, 0x4979a208, 0x4979a409, 0x4979a209, - 0x4979a00b, 0x42000800, 0x00000006, 0x42001000, - 0x0000dc00, 0x0401f293, 0x4803c856, 0x4d380000, - 0x4d1c0000, 0x42027000, 0x00000035, 0x0201f800, - 0x001093ba, 0x0402001e, 0x0401fe8a, 0x4a01a006, - 0x13000000, 0x5932381e, 0x591c0019, 0x4801a005, - 0x591c0406, 0x82000580, 0x00000003, 0x04000007, - 0x59300809, 0x58040002, 0x82000500, 0x00ffffff, - 0x4801a007, 0x0401f003, 0x59a80010, 0x4801a007, - 0x59300419, 0x4801a408, 0x59300219, 0x4801a208, - 0x42000800, 0x00000003, 0x42001000, 0x0000dc00, - 0x5c023800, 0x5c027000, 0x0401f26e, 0x0201f800, - 0x00106c55, 0x598c000d, 0x81300580, 0x02020800, - 0x001005d8, 0x0201f800, 0x00106bbf, 0x0201f800, - 0x0002077d, 0x5c023800, 0x5c027000, 0x0201f000, - 0x00106c4b, 0x4803c856, 0x4d2c0000, 0x4d1c0000, - 0x5932381e, 0x811e39c0, 0x02000800, 0x001005d8, - 0x591c0c06, 0x82040580, 0x00000006, 0x0400000d, - 0x82040580, 0x00000003, 0x04000036, 0x4a026403, - 0x00000037, 0x4a02641a, 0x00000003, 0x4a02621a, - 0x00001700, 0x5c023800, 0x5c025800, 0x0401f064, - 0x0401f84b, 0x42001000, 0x40000000, 0x591c0203, - 0x591c0804, 0x8c040d3e, 0x04020023, 0x82000c80, - 0x0000000e, 0x0c001003, 0x0201f800, 0x001005d8, - 0x00107691, 0x0010769d, 0x00107693, 0x0010769d, - 0x00107699, 0x00107691, 0x00107691, 0x0010769d, - 0x0010769d, 0x00107691, 0x00107691, 0x00107691, - 0x00107691, 0x00107691, 0x0010769d, 0x00107691, - 0x0010769d, 0x0201f800, 0x001005d8, 0x591c0414, - 0x4803c857, 0x8c000518, 0x04000003, 0x8c000512, - 0x04000003, 0x80001580, 0x0401f003, 0x42001000, - 0x20000000, 0x591c0015, 0x4801a00a, 0x0401f018, - 0x0401f81f, 0x591e5808, 0x812e59c0, 0x02000800, - 0x001005d8, 0x592c100f, 0x591c0011, 0x80080480, - 0x4801a00a, 0x591c0203, 0x591c0804, 0x8c040d3e, - 0x04020007, 0x82000d80, 0x00000002, 0x04000007, - 0x82000d80, 0x00000004, 0x04000004, 0x42001000, - 0x40000000, 0x0401f002, 0x80001580, 0x4809a00b, - 0x42000800, 0x00000006, 0x42001000, 0x0000dc00, - 0x5c023800, 0x5c025800, 0x0401f1fe, 0x4803c856, - 0x0401fe0a, 0x4a01a006, 0x02000000, 0x59300c19, - 0x4805a407, 0x59300a19, 0x4805a207, 0x59a81010, - 0x59300809, 0x58041802, 0x820c1d00, 0x00ffffff, - 0x5930081e, 0x58040406, 0x82000580, 0x00000003, - 0x04020004, 0x4809a008, 0x480da009, 0x0401f003, - 0x480da008, 0x4809a009, 0x1c01f000, 0x4803c856, - 0x0401fdf2, 0x0401f003, 0x4803c856, 0x0401fde8, - 0x4a01a006, 0x01000000, 0x5930041a, 0x4801a407, - 0x5930021a, 0x4801a207, 0x42000800, 0x00000002, - 0x42001000, 0x0000dc00, 0x0401f1d6, 0x4803c856, - 0x4d1c0000, 0x0401fdcc, 0x4a01a006, 0x14000000, - 0x5932381e, 0x591c0019, 0x4801a005, 0x59300419, - 0x4801a407, 0x59300219, 0x4801a207, 0x59300015, - 0x4801a008, 0x59300216, 0x82000500, 0x000000ff, - 0x840001c0, 0x4801a409, 0x42000800, 0x00000004, - 0x42001000, 0x0000dc00, 0x5c023800, 0x0401f1bd, - 0x4803c856, 0x0401f80b, 0x5930041a, 0x900001c0, - 0x4801a005, 0x0401f9ec, 0x41780800, 0x42001000, - 0x00005c00, 0x0401f9b3, 0x0201f000, 0x0010604d, - 0x4803c856, 0x59300817, 0x82041c00, 0x00000005, - 0x46034800, 0x00000021, 0x58040404, 0x82000500, - 0x0000f000, 0x82000580, 0x00003000, 0x04000003, - 0x46034800, 0x00000041, 0x81a5a000, 0x580c0001, - 0x82000d00, 0x00ffffff, 0x82040d40, 0xc2000000, - 0x4805a000, 0x580c0800, 0x82041500, 0x00ffffff, - 0x82000500, 0xff000000, 0x80080540, 0x4801a001, - 0x580c0002, 0x82000580, 0x00c00000, 0x82000500, - 0x00fd0300, 0x4801a002, 0x580c0003, 0x4801a003, - 0x580c0404, 0x4801a404, 0x580c0204, 0x4801a204, - 0x1c01f000, 0x4803c856, 0x59a80026, 0x82000500, - 0x00000028, 0x04020009, 0x59a80026, 0x82000500, - 0x00000028, 0x04000003, 0x497a6a12, 0x0401f003, - 0x4a026a12, 0x0000ff00, 0x42005000, 0x22000000, - 0x42006000, 0x01380000, 0x41786800, 0x41787800, - 0x0401f952, 0x59301008, 0x4a01a006, 0x54000000, - 0x59a80010, 0x82000500, 0x00ffffff, 0x58080c0a, - 0x800408f0, 0x80040540, 0x4801a007, 0x5808000a, - 0x82000500, 0xff000000, 0x4801a008, 0x59a80002, - 0x4801a009, 0x59a80003, 0x4801a00a, 0x59a80000, - 0x4801a00b, 0x59a80001, 0x4801a00c, 0x5808000c, - 0x9c0001c0, 0x4801a00d, 0x5808000d, 0x9c0001c0, - 0x4801a00e, 0x5808000e, 0x9c0001c0, 0x4801a00f, - 0x5808000f, 0x9c0001c0, 0x4801a010, 0x58080010, - 0x9c0001c0, 0x4801a011, 0x58080011, 0x9c0001c0, - 0x4801a012, 0x58080012, 0x9c0001c0, 0x4801a013, - 0x58080013, 0x9c0001c0, 0x4801a014, 0x58080010, - 0x9c0001c0, 0x4801a015, 0x58080011, 0x9c0001c0, - 0x4801a016, 0x58080012, 0x9c0001c0, 0x4801a017, - 0x58080013, 0x9c0001c0, 0x4801a018, 0x42000800, - 0x00000013, 0x42001000, 0x0000dc00, 0x0401f135, - 0x4803c856, 0x42005000, 0x22000000, 0x42006000, - 0x01290000, 0x41786800, 0x41787800, 0x0401f90b, - 0x59301008, 0x4a01a006, 0x55000000, 0x5808000b, - 0x82000500, 0x00ffffff, 0x58080c0a, 0x800408f0, - 0x80040540, 0x4801a007, 0x5808080a, 0x82040d00, - 0xff000000, 0x59a80010, 0x82000500, 0x00ffffff, - 0x80040540, 0x4801a008, 0x5808000c, 0x9c0001c0, - 0x4801a009, 0x5808000d, 0x9c0001c0, 0x4801a00a, - 0x5808000e, 0x9c0001c0, 0x4801a00b, 0x5808000f, - 0x9c0001c0, 0x4801a00c, 0x59a80002, 0x4801a00d, - 0x59a80003, 0x4801a00e, 0x59a80000, 0x4801a00f, - 0x59a80001, 0x4801a010, 0x58080010, 0x4801a011, - 0x58080011, 0x4801a012, 0x58080012, 0x4801a013, - 0x58080013, 0x4801a014, 0x4979a015, 0x4979a016, - 0x4979a017, 0x4979a018, 0x42000800, 0x00000013, - 0x42001000, 0x0000dc00, 0x0401f0f6, 0x0401fd03, - 0x5930001c, 0x800001c0, 0x04000008, 0x4a01a006, - 0x01000000, 0x4a01a407, 0x00000003, 0x42000800, - 0x00000002, 0x0401f028, 0x4a01a006, 0x02000000, - 0x41780800, 0x836c0580, 0x00000004, 0x04020003, - 0x84040d42, 0x0401f00d, 0x0201f800, 0x0010513b, - 0x04020003, 0x84040d4a, 0x0401f002, 0x84040d48, - 0x59a80026, 0x8c000506, 0x04020003, 0x8c00050a, - 0x04000002, 0x84040d46, 0x4805a207, 0x59c40085, - 0x48031004, 0x4c580000, 0x4c500000, 0x4c540000, - 0x4200b000, 0x00000006, 0x8388a400, 0x00000000, - 0x82d0ac00, 0x00000008, 0x0201f800, 0x0010ab17, - 0x5c00a800, 0x5c00a000, 0x5c00b000, 0x42000800, - 0x00000008, 0x42001000, 0x0000dc00, 0x0401f0c1, - 0x0401fcc0, 0x4a01a006, 0x56000000, 0x59340006, - 0x4801a007, 0x59340007, 0x4801a008, 0x42000800, - 0x00000003, 0x42001000, 0x0000dc00, 0x0401f0b5, - 0x4803c856, 0x0401fcc1, 0x5930081c, 0x800409c0, - 0x0400000e, 0x82040580, 0x0000ffff, 0x04000004, - 0x82040480, 0x00000007, 0x04021008, 0x4a01a006, - 0x01000000, 0x4a01a407, 0x00000003, 0x42000800, - 0x00000002, 0x0401f012, 0x4a01a006, 0x0200001c, - 0x4a01a007, 0x00000001, 0x42001000, 0x0010b4f0, - 0x50080000, 0x9c0001c0, 0x4801a009, 0x59a80010, - 0x4801a00a, 0x59a80002, 0x59a80803, 0x4801a00b, - 0x4805a00c, 0x42000800, 0x00000007, 0x42001000, - 0x0000dc00, 0x0401f08f, 0x4d2c0000, 0x0401fc8d, - 0x59325808, 0x592c0008, 0x82000500, 0x00ffffff, - 0x4801a001, 0x4a01a006, 0x51000000, 0x5c025800, - 0x0201f000, 0x00107344, 0x4803c856, 0x59a80810, - 0x82040d00, 0x000000ff, 0x59325808, 0x59326809, - 0x59a83026, 0x8c18350a, 0x04020008, 0x8c00050e, - 0x04020006, 0x80001d80, 0x59a82010, 0x82102500, - 0x000000ff, 0x0401f001, 0x59300406, 0x4803c857, - 0x82000d80, 0x00000009, 0x04000006, 0x82000d80, - 0x0000000a, 0x0400002e, 0x0201f800, 0x001005d8, - 0x59300015, 0x8c00051e, 0x04020020, 0x42005000, - 0x04000000, 0x42006000, 0x05000000, 0x592c040a, - 0x82000500, 0x00000030, 0x800000e0, 0x80306540, - 0x5934000a, 0x8c000508, 0x04000002, 0x84306546, - 0x41786800, 0x41787800, 0x0401f831, 0x59300c14, - 0x80040000, 0x48026414, 0x40040000, 0x800000d0, - 0x82000540, 0x00000020, 0x4801a403, 0x83180d40, - 0x00000038, 0x42001000, 0x0000c920, 0x0401f860, - 0x0201f000, 0x00106052, 0x59a80026, 0x82000500, - 0x00000028, 0x04000003, 0x497a6a12, 0x0401f7dc, - 0x4a026a12, 0x0000ff00, 0x0401f7d9, 0x42005000, - 0x02000000, 0x42006000, 0x20290000, 0x41786800, - 0x41787800, 0x0401f812, 0x83180d40, 0x00000038, - 0x42001000, 0x0000c9a0, 0x0401f849, 0x42000800, - 0x000007d0, 0x59300011, 0x82000500, 0xfff00000, - 0x80000540, 0x04000003, 0x42000800, 0x00001b58, - 0x41781000, 0x0201f000, 0x00106054, 0x4201a000, - 0x00000000, 0x0401f003, 0x4201a000, 0x00000011, - 0x59340a12, 0x82040d00, 0x0000ff00, 0x59a80010, - 0x82000500, 0x000000ff, 0x900001c0, 0x80040540, - 0x80d00540, 0x44034800, 0x81a5a000, 0x59340002, - 0x82000500, 0x00ffffff, 0x80280540, 0x4801a000, - 0x59a80010, 0x4801a001, 0x4831a002, 0x82340540, - 0x00000000, 0x4801a003, 0x59300402, 0x4801a404, - 0x59300a02, 0x4805a204, 0x8c30652e, 0x04000003, - 0x4805a404, 0x4801a204, 0x483da005, 0x1c01f000, - 0x4803c856, 0x4c040000, 0x0401f822, 0x5c000800, - 0x40040000, 0x80081540, 0x800000c4, 0x82000540, - 0x00002000, 0x4803910a, 0x59b400f6, 0x82000500, - 0x00000018, 0x040207fd, 0x4a0368f0, 0x0010b544, - 0x4a0368f1, 0x0010b54b, 0x480b68f3, 0x4a0378e4, - 0x00008000, 0x0201f000, 0x0010604d, 0x4807c857, - 0x480a2800, 0x4c040000, 0x0401f80a, 0x5c000800, - 0x59b400f6, 0x8c00050a, 0x040207fe, 0x49a768f2, - 0x480768f4, 0x4a0378e4, 0x00008000, 0x1c01f000, - 0x4a0378e4, 0x0000c000, 0x59bc00e4, 0x8c000520, - 0x0400000c, 0x4a0378e4, 0x00008000, 0x42007000, - 0x000003e8, 0x59bc00e4, 0x8c000520, 0x040007f5, - 0x80387040, 0x02000800, 0x001005d8, 0x0401f7fa, - 0x1c01f000, 0x82000500, 0xffff0000, 0x82000580, - 0x01050000, 0x0402000d, 0x599c0818, 0x8c040d10, - 0x0400000a, 0x59a80807, 0x8c040d0a, 0x04000007, - 0x42001000, 0x0000804f, 0x41781800, 0x41782000, - 0x0201f800, 0x00103a3e, 0x1c01f000, 0x41781000, - 0x42026000, 0x0010d1c0, 0x59a8180e, 0x480a6402, - 0x4a026202, 0x0000ffff, 0x80081000, 0x800c1840, - 0x04000004, 0x83326400, 0x00000024, 0x0401f7f8, - 0x1c01f000, 0x4933c857, 0x59300203, 0x82000580, - 0x00000000, 0x0400002c, 0x59300406, 0x4803c857, - 0x82000d80, 0x00000004, 0x04000011, 0x82000d80, - 0x00000001, 0x0400000e, 0x82000d80, 0x00000003, - 0x04000006, 0x82000d80, 0x00000006, 0x04020011, - 0x0201f800, 0x0010a5df, 0x5930001c, 0x800001c0, - 0x02020800, 0x0010984e, 0x0401f00a, 0x5930081e, - 0x4807c857, 0x800409c0, 0x04000006, 0x5804001c, - 0x4803c857, 0x81300580, 0x04020002, 0x4978081c, - 0x497a6008, 0x4a026004, 0x00004000, 0x59a80037, - 0x82000c80, 0x00000051, 0x04001002, 0x80000102, - 0x48026206, 0x497a6205, 0x497a6009, 0x4a026406, - 0x00000007, 0x1c01f000, 0x8166c9c0, 0x0400001c, - 0x41626000, 0x41580000, 0x59300a03, 0x82040d80, - 0x00000000, 0x04000008, 0x83326400, 0x00000024, - 0x81300c80, 0x040017f9, 0x42026000, 0x0010d1c0, - 0x0401f7f6, 0x4933c857, 0x8166c840, 0x83300c00, - 0x00000024, 0x80040480, 0x04021006, 0x4006c000, - 0x4a026203, 0x00000008, 0x813261c0, 0x1c01f000, - 0x4202c000, 0x0010d1c0, 0x0401f7fa, 0x42000000, - 0x0010b854, 0x0201f800, 0x0010aa47, 0x4933c856, - 0x417a6000, 0x0401f7f5, 0x4933c857, 0x83380580, - 0x00000013, 0x0402000b, 0x59300004, 0x8c00053e, - 0x04000007, 0x0201f800, 0x00106c55, 0x0201f800, - 0x00106bbf, 0x0201f800, 0x00106c4b, 0x1c01f000, - 0x4933c857, 0x59880052, 0x80000000, 0x48031052, - 0x1c01f000, 0x4933c857, 0x59300203, 0x82003480, - 0x0000000e, 0x02021800, 0x001005d8, 0x4d2c0000, - 0x0c01f803, 0x5c025800, 0x1c01f000, 0x00107991, - 0x00107efd, 0x0010804a, 0x00107991, 0x001080b0, - 0x00107af5, 0x00107991, 0x00107991, 0x00107e93, - 0x00107991, 0x00107991, 0x00107991, 0x00107991, - 0x00107991, 0x0201f800, 0x001005d8, 0x4933c857, - 0x59300203, 0x82003480, 0x0000000e, 0x02021800, - 0x001005d8, 0x0c01f001, 0x001079a8, 0x00108a3d, - 0x001079a8, 0x001079a8, 0x001079a8, 0x001079a8, - 0x001079a8, 0x001079a8, 0x001089e5, 0x00108a58, - 0x00108ac6, 0x00108a58, 0x00108ac6, 0x001079a8, - 0x0201f800, 0x001005d8, 0x0201f800, 0x001005d8, - 0x4933c857, 0x4d2c0000, 0x59325808, 0x59300203, - 0x82003480, 0x0000000e, 0x02021800, 0x001005d8, - 0x0c01f803, 0x5c025800, 0x1c01f000, 0x001079c5, - 0x001079c5, 0x001079c5, 0x001079e1, 0x00107a2d, - 0x001079c5, 0x001079c5, 0x001079c5, 0x001079c7, - 0x001079c5, 0x001079c5, 0x001079c5, 0x001079c5, - 0x001079c5, 0x0201f800, 0x001005d8, 0x4933c857, - 0x83380580, 0x00000040, 0x02020800, 0x001005d8, - 0x4a026007, 0x00082000, 0x4a026203, 0x00000003, - 0x493a6403, 0x4a025c08, 0x00000001, 0x592c000d, - 0x48026011, 0x497a6013, 0x592c0208, 0x800000c2, - 0x800010c4, 0x80081400, 0x480a6206, 0x0201f800, - 0x00100f4e, 0x42000800, 0x80000060, 0x0201f000, - 0x00106721, 0x4933c857, 0x83380480, 0x00000050, - 0x02021800, 0x001005d8, 0x83380480, 0x00000049, - 0x02001800, 0x001005d8, 0x0c01f001, 0x001079f4, - 0x001079ff, 0x001079f2, 0x001079f2, 0x001079f2, - 0x001079f2, 0x00107a0a, 0x0201f800, 0x001005d8, - 0x4a026203, 0x00000004, 0x4a025c08, 0x00000002, - 0x592c0207, 0x48025c09, 0x592c0209, 0x48025a07, - 0x592c000c, 0x4802580d, 0x1c01f000, 0x0201f800, - 0x00106b8a, 0x0201f800, 0x00109037, 0x04000005, - 0x4a025a06, 0x00000006, 0x0201f800, 0x000202da, - 0x0201f000, 0x0002077d, 0x0201f800, 0x00106b8a, - 0x4d3c0000, 0x417a7800, 0x0201f800, 0x0010203c, - 0x5c027800, 0x42003000, 0x00000014, 0x41782800, - 0x42002000, 0x00000002, 0x4d400000, 0x4d440000, - 0x59368c03, 0x42028000, 0x00000029, 0x0201f800, - 0x0010985e, 0x5c028800, 0x5c028000, 0x42000000, - 0x0010b864, 0x0201f800, 0x0010aa47, 0x0201f800, - 0x00109037, 0x02000000, 0x0002077d, 0x4a025a06, - 0x00000029, 0x0201f800, 0x000202da, 0x0201f000, - 0x0002077d, 0x4933c857, 0x83380580, 0x00000048, - 0x04000005, 0x83380580, 0x00000053, 0x02020800, - 0x001005d8, 0x592c0206, 0x82000580, 0x00000007, - 0x04000009, 0x59300011, 0x80000540, 0x04000006, - 0x592c080c, 0x80040480, 0x4802580c, 0x4a025a06, - 0x00000015, 0x592c0206, 0x80000540, 0x04020003, - 0x4a025a06, 0x00000000, 0x0201f800, 0x000202da, - 0x0201f000, 0x0002077d, 0x4933c857, 0x4d2c0000, - 0x4c500000, 0x4c540000, 0x4c580000, 0x0201f800, - 0x001007e4, 0x02000800, 0x001005d8, 0x497a5a06, - 0x59c80017, 0x82000500, 0x0000f000, 0x48025c07, - 0x59a80816, 0x82040c00, 0x00000018, 0x48065a07, - 0x412c7800, 0x4d2c0000, 0x41cca000, 0x42002800, - 0x00000001, 0x42001000, 0x0000002c, 0x82040480, - 0x0000002d, 0x04021006, 0x832cac00, 0x00000009, - 0x0201f800, 0x00108b96, 0x0401f02e, 0x40043000, - 0x42000800, 0x0000002c, 0x832cac00, 0x00000009, - 0x0201f800, 0x00108b96, 0x82183480, 0x0000002c, - 0x0201f800, 0x001007e4, 0x0400001a, 0x80142800, - 0x4a025804, 0x00000110, 0x492c7801, 0x82180c80, - 0x0000003d, 0x04021007, 0x40180800, 0x832cac00, - 0x00000005, 0x0201f800, 0x00108b96, 0x0401f015, - 0x82081400, 0x0000003c, 0x82183480, 0x0000003c, - 0x42000800, 0x0000003c, 0x412c7800, 0x832cac00, - 0x00000005, 0x0201f800, 0x00108b96, 0x0401f7e5, - 0x5c025800, 0x592c0206, 0x8400055e, 0x48025a06, - 0x592c0407, 0x80080540, 0x48025c07, 0x0401f002, - 0x5c025800, 0x813669c0, 0x04000003, 0x59343403, - 0x0401f003, 0x42003000, 0x0000ffff, 0x49325808, - 0x481a5c06, 0x82100580, 0x00000054, 0x04020002, - 0x491e5813, 0x841401c0, 0x80100540, 0x48025804, - 0x592c0001, 0x497a5801, 0x4c000000, 0x0201f800, - 0x000202da, 0x5c025800, 0x812e59c0, 0x040207f9, - 0x5c00b000, 0x5c00a800, 0x5c00a000, 0x5c025800, - 0x1c01f000, 0x4803c856, 0x4c5c0000, 0x4d2c0000, - 0x4c500000, 0x4c540000, 0x4c580000, 0x412cb800, - 0x592c040b, 0x8c000516, 0x04000003, 0x41cca000, - 0x0401f003, 0x83cca400, 0x00000006, 0x4008b000, - 0x41781000, 0x82580480, 0x00000012, 0x04001004, - 0x4200b000, 0x00000012, 0x40001000, 0x4c080000, - 0x4d2c0000, 0x0201f800, 0x001007e4, 0x04000023, - 0x5c001800, 0x492c1801, 0x485a5800, 0x832cac00, - 0x00000002, 0x0201f800, 0x0010ab28, 0x585c040b, - 0x8c000500, 0x0400000e, 0x832c1400, 0x00000002, - 0x8c000516, 0x04000003, 0x82081400, 0x00000006, - 0x46001000, 0x00000001, 0x80081000, 0x46001000, - 0x00000900, 0x84000500, 0x4800bc0b, 0x5c001000, - 0x800811c0, 0x040207da, 0x82000540, 0x00000001, - 0x5c00b000, 0x5c00a800, 0x5c00a000, 0x5c025800, - 0x5c00b800, 0x1c01f000, 0x5c025800, 0x5c001000, - 0x0401f7f8, 0x4933c857, 0x83380d80, 0x00000015, - 0x04020003, 0x0201f000, 0x0002077d, 0x83380d80, - 0x00000016, 0x02020800, 0x001005d8, 0x0201f000, - 0x0002077d, 0x4933c857, 0x4d2c0000, 0x4c500000, - 0x4c540000, 0x4c580000, 0x59325808, 0x83cca400, - 0x00000006, 0x59cc1806, 0x820c0580, 0x01000000, - 0x04020004, 0x4200b000, 0x00000002, 0x0401f00f, - 0x4200b000, 0x00000008, 0x832cac00, 0x00000005, - 0x0201f800, 0x0010ab17, 0x8c0c1d00, 0x0400000b, - 0x4200b000, 0x00000008, 0x592e5801, 0x812e59c0, - 0x02000800, 0x001005d8, 0x832cac00, 0x00000005, - 0x0201f800, 0x0010ab17, 0x0401f816, 0x5c00b000, - 0x5c00a800, 0x5c00a000, 0x5c025800, 0x1c01f000, - 0x4933c857, 0x4c500000, 0x4c540000, 0x4c580000, - 0x83cca400, 0x00000006, 0x5930a808, 0x8254ac00, - 0x00000005, 0x4200b000, 0x00000007, 0x0201f800, - 0x0010ab17, 0x5c00b000, 0x5c00a800, 0x5c00a000, - 0x4933c857, 0x0201f800, 0x00109037, 0x02000000, - 0x0002077d, 0x4d2c0000, 0x0201f800, 0x00109597, - 0x0402000b, 0x41780800, 0x4d400000, 0x42028000, - 0x00000000, 0x0201f800, 0x0010943b, 0x5c028000, - 0x5c025800, 0x0201f000, 0x0002077d, 0x5931d821, - 0x58ef400b, 0x58ee580d, 0x4a025a04, 0x00000103, - 0x58ec0009, 0x0801f800, 0x5c025800, 0x0201f000, - 0x0002077d, 0x4933c857, 0x59cc1806, 0x820c0580, - 0x02000000, 0x04020014, 0x4a026802, 0x00fffffd, - 0x5934000a, 0x84000504, 0x4802680a, 0x59300808, - 0x800409c0, 0x02000000, 0x0002077d, 0x4a000a04, - 0x00000103, 0x480c0805, 0x5931d821, 0x58ef400b, - 0x58ee580d, 0x58ec0009, 0x0801f800, 0x0201f000, - 0x0002077d, 0x42000000, 0x0010b86c, 0x0201f800, - 0x0010aa47, 0x4c0c0000, 0x0401f804, 0x5c001800, - 0x040207eb, 0x1c01f000, 0x4933c857, 0x4d2c0000, - 0x59325808, 0x812e59c0, 0x04020009, 0x497a6206, - 0x497a6205, 0x4d380000, 0x42027000, 0x00000022, - 0x0401fb77, 0x5c027000, 0x80000580, 0x5c025800, - 0x1c01f000, 0x4933c857, 0x4d2c0000, 0x4c500000, - 0x4c540000, 0x4c580000, 0x59325808, 0x592e5801, - 0x832cac00, 0x00000005, 0x83cca400, 0x00000006, - 0x59c80817, 0x82040d00, 0x000003ff, 0x82041480, - 0x0000000f, 0x0400101b, 0x4200b000, 0x0000000f, - 0x0201f800, 0x0010ab17, 0x592e5801, 0x832cac00, - 0x00000005, 0x82080c80, 0x0000000f, 0x0400100d, - 0x4200b000, 0x0000000f, 0x0201f800, 0x0010ab17, - 0x592e5801, 0x832cac00, 0x00000005, 0x82041480, - 0x0000000f, 0x04001007, 0x42001000, 0x0000000f, - 0x4008b000, 0x0201f800, 0x0010ab17, 0x0401f004, - 0x4004b000, 0x0201f800, 0x0010ab17, 0x5931d821, - 0x58ef400b, 0x58ee580d, 0x4a025a04, 0x00000103, - 0x592e5801, 0x58ec0009, 0x0801f800, 0x0201f800, - 0x0002077d, 0x5c00b000, 0x5c00a800, 0x5c00a000, - 0x5c025800, 0x1c01f000, 0x4933c857, 0x4d2c0000, - 0x4c500000, 0x4c540000, 0x4c580000, 0x59cc0006, - 0x82000d80, 0x01000000, 0x0400002c, 0x59cc0007, - 0x9000b1c0, 0x8258b500, 0x000000ff, 0x8058b104, - 0x8258b400, 0x00000002, 0x82580c80, 0x00000007, - 0x04001003, 0x4200b000, 0x00000006, 0x83cca400, - 0x00000006, 0x59301008, 0x800811c0, 0x02000800, - 0x001005d8, 0x8208ac00, 0x00000005, 0x0201f800, - 0x0010ab17, 0x82000d00, 0xff000000, 0x800409c0, - 0x04000019, 0x8200b500, 0x000000ff, 0x8058b104, - 0x82580c80, 0x0000000e, 0x04001003, 0x4200b000, - 0x0000000d, 0x58081001, 0x800811c0, 0x02000800, - 0x001005d8, 0x8208ac00, 0x00000005, 0x0201f800, - 0x0010ab17, 0x0401f008, 0x59301008, 0x800811c0, - 0x02000800, 0x001005d8, 0x48001005, 0x59cc0007, - 0x48001006, 0x0401ff3b, 0x5c00b000, 0x5c00a800, - 0x5c00a000, 0x5c025800, 0x1c01f000, 0x4933c857, - 0x42000800, 0x00000000, 0x59cc0006, 0x82000580, - 0x02000000, 0x04000003, 0x42000800, 0x00000001, - 0x4d2c0000, 0x59325808, 0x812e59c0, 0x02000800, - 0x001005d8, 0x48065a06, 0x0201f800, 0x000202da, - 0x5c025800, 0x0201f000, 0x0002077d, 0x4933c857, - 0x4d2c0000, 0x4c500000, 0x4c540000, 0x4c580000, - 0x4200b000, 0x00000002, 0x59cc0806, 0x82040580, - 0x01000000, 0x04000004, 0x8204b500, 0x0000ffff, - 0x8058b104, 0x83cca400, 0x00000006, 0x59300008, - 0x8200ac00, 0x00000005, 0x0201f800, 0x0010ab17, - 0x0401ff0c, 0x5c00b000, 0x5c00a800, 0x5c00a000, - 0x5c025800, 0x1c01f000, 0x4933c857, 0x4803c857, - 0x4807c857, 0x480bc857, 0x480fc857, 0x4813c857, - 0x481bc857, 0x492fc857, 0x4d2c0000, 0x4c000000, - 0x0201f800, 0x001007d3, 0x5c000000, 0x0400000f, - 0x48025803, 0x5c000000, 0x4802580a, 0x4c000000, - 0x481a5801, 0x48125809, 0x48065804, 0x480a5807, - 0x480e5808, 0x412c1000, 0x0201f800, 0x00100858, - 0x82000540, 0x00000001, 0x5c025800, 0x1c01f000, - 0x4933c857, 0x4d1c0000, 0x59cc0001, 0x82000500, - 0x00ffffff, 0x59341002, 0x82081500, 0x00ffffff, - 0x80080580, 0x0402001f, 0x497a6205, 0x4d380000, - 0x42027000, 0x00000035, 0x0201f800, 0x001093ba, - 0x5c027000, 0x04020012, 0x591c001c, 0x800001c0, - 0x0400000f, 0x497a381c, 0x591c0414, 0x8c000502, - 0x02000800, 0x001005d8, 0x84000502, 0x48023c14, - 0x591c1406, 0x82080580, 0x00000003, 0x04000006, - 0x82080580, 0x00000006, 0x04000005, 0x0401fc9e, - 0x0401f004, 0x0401f805, 0x0401f002, 0x0401f8c0, - 0x5c023800, 0x1c01f000, 0x4d2c0000, 0x591e5808, - 0x4933c857, 0x491fc857, 0x493bc857, 0x492fc857, - 0x83380580, 0x00000015, 0x040000b3, 0x83380580, - 0x00000016, 0x040200ae, 0x4d300000, 0x411e6000, - 0x59cc0207, 0x4803c857, 0x82000d00, 0x0000ff00, - 0x82040580, 0x00001700, 0x04000004, 0x82040580, - 0x00000300, 0x0402005b, 0x591c0203, 0x4803c857, - 0x82000580, 0x0000000d, 0x0400003f, 0x812e59c0, - 0x0400009a, 0x591c0202, 0x4803c857, 0x82000580, - 0x0000ffff, 0x0402007e, 0x592c020a, 0x4803c857, - 0x82000500, 0x00000003, 0x82000580, 0x00000002, - 0x04020007, 0x592c080f, 0x591c0011, 0x4803c857, - 0x4807c857, 0x80040580, 0x04020071, 0x591c0414, - 0x4803c857, 0x8c000500, 0x0402006d, 0x41780800, - 0x591c1206, 0x42000000, 0x0000000a, 0x0201f800, - 0x001066a0, 0x592c0406, 0x4803c857, 0x800001c0, - 0x0400000c, 0x80080c80, 0x04001004, 0x02020800, - 0x001005d8, 0x80001040, 0x480a5c06, 0x800811c0, - 0x04020004, 0x0201f800, 0x00108d88, 0x0401f06b, - 0x0201f800, 0x0010912a, 0x591c0817, 0x591c0018, - 0x48065808, 0x48025809, 0x59300007, 0x8c000500, - 0x02020800, 0x00100e99, 0x497a3808, 0x0201f800, - 0x000201ba, 0x0402004a, 0x411e6000, 0x0401fc3e, - 0x0401f05a, 0x0401fc6d, 0x04000013, 0x49366009, - 0x4a026406, 0x00000003, 0x492e6008, 0x591c0817, - 0x591c1018, 0x48066017, 0x480a6018, 0x4d380000, - 0x591e7403, 0x4d300000, 0x411e6000, 0x0401fc2e, - 0x5c026000, 0x0201f800, 0x000207a1, 0x5c027000, - 0x0401f046, 0x59a80039, 0x48023a05, 0x0401f043, - 0x59cc0407, 0x82000580, 0x0000000b, 0x04020025, - 0x59340a00, 0x84040d0e, 0x48066a00, 0x592c0a04, - 0x82040d00, 0x000000ff, 0x82040d80, 0x00000014, - 0x04000003, 0x4a02621d, 0x00000003, 0x59300007, - 0x8c000500, 0x02020800, 0x00100e99, 0x4d400000, - 0x42028000, 0x00000003, 0x592c0a08, 0x0201f800, - 0x00104e70, 0x0201f800, 0x000202da, 0x5c028000, - 0x497a6008, 0x4a026403, 0x00000085, 0x4a026203, - 0x00000009, 0x4a026406, 0x00000002, 0x42000800, - 0x8000404b, 0x0201f800, 0x00020721, 0x0401f01b, - 0x59cc0207, 0x82000580, 0x00002a00, 0x04020004, - 0x59a80039, 0x48023a05, 0x0401f014, 0x812e59c0, - 0x02000800, 0x001005d8, 0x4a025a04, 0x00000103, - 0x591c0007, 0x8c000500, 0x02020800, 0x00100e99, - 0x591c0402, 0x48025c06, 0x4a025a06, 0x00000003, - 0x0201f800, 0x000202c1, 0x0201f800, 0x00107911, - 0x0201f800, 0x001049b2, 0x5c026000, 0x0201f800, - 0x0002077d, 0x0401f002, 0x5c026000, 0x5c025800, - 0x1c01f000, 0x0401f819, 0x0401f7fd, 0x4933c857, - 0x83380580, 0x00000015, 0x04020004, 0x59a80039, - 0x48023a05, 0x0401f00d, 0x83380580, 0x00000016, - 0x0402000d, 0x4d300000, 0x411e6000, 0x0201f800, - 0x0010a5df, 0x0201f800, 0x000206fd, 0x0201f800, - 0x0002077d, 0x5c026000, 0x497a381c, 0x0201f800, - 0x0002077d, 0x1c01f000, 0x591c0414, 0x84000540, - 0x48023c14, 0x59cc100b, 0x4933c857, 0x491fc857, - 0x492fc857, 0x4803c857, 0x480bc857, 0x8c08153c, - 0x04000006, 0x59a80039, 0x48023a05, 0x497a381c, - 0x0201f000, 0x0002077d, 0x4d300000, 0x411e6000, - 0x0201f800, 0x00108bd7, 0x5c026000, 0x591c0406, - 0x82000580, 0x00000000, 0x02000000, 0x0002077d, - 0x591c0403, 0x82000580, 0x00000050, 0x0402000d, - 0x4d300000, 0x411e6000, 0x4a026203, 0x00000001, - 0x42000800, 0x80000043, 0x0201f800, 0x00020721, - 0x5c026000, 0x497a381c, 0x0201f000, 0x0002077d, - 0x591c0203, 0x82000580, 0x0000000d, 0x04000014, - 0x812e59c0, 0x02000800, 0x001005d8, 0x591c0203, - 0x82000580, 0x00000004, 0x04020011, 0x592c020a, - 0x8c000502, 0x0400000e, 0x4a023812, 0x0fffffff, - 0x592c0208, 0x8400051e, 0x48025a08, 0x42000000, - 0x00000001, 0x48023a14, 0x0401f021, 0x42000000, - 0x00000007, 0x48023a14, 0x0401f01d, 0x592c020a, - 0x4803c857, 0x8c000500, 0x0402000b, 0x8c000502, - 0x040007f7, 0x591c0414, 0x8c00051c, 0x040207eb, - 0x591c0011, 0x4803c857, 0x800001c0, 0x040007f0, - 0x0401f7e6, 0x8c08153a, 0x040207ed, 0x59cc000a, - 0x592c180f, 0x4803c857, 0x480fc857, 0x800c0580, - 0x040007e7, 0x59cc000a, 0x4803c857, 0x48023816, - 0x42000000, 0x00000005, 0x48023a14, 0x0201f000, - 0x00109259, 0x4933c857, 0x4d1c0000, 0x59cc0001, - 0x59341002, 0x80080580, 0x82000500, 0x00ffffff, - 0x04020041, 0x59301419, 0x0201f800, 0x00109410, - 0x02000800, 0x001005d8, 0x591c1406, 0x82080580, - 0x00000007, 0x04000038, 0x82080580, 0x00000002, - 0x04000035, 0x82080580, 0x00000000, 0x04000032, - 0x591c0202, 0x82000d80, 0x0000ffff, 0x04000004, - 0x59301a19, 0x800c0580, 0x0402002b, 0x83380580, - 0x00000015, 0x04000026, 0x4d300000, 0x4d2c0000, - 0x411e6000, 0x59325808, 0x0201f800, 0x00109037, - 0x02000800, 0x001005d8, 0x592c0204, 0x82000500, - 0x000000ff, 0x82000580, 0x00000014, 0x04000003, - 0x4a02621d, 0x00000003, 0x42028000, 0x00000003, - 0x592c0a08, 0x0201f800, 0x00104e70, 0x0201f800, - 0x000202da, 0x5c025800, 0x497a6008, 0x4a026403, - 0x00000085, 0x4a026203, 0x00000009, 0x4a026406, - 0x00000002, 0x42000800, 0x8000404b, 0x0201f800, - 0x00020721, 0x5c026000, 0x0401f003, 0x59a80039, - 0x48023a05, 0x497a381c, 0x0201f800, 0x0002077d, - 0x5c023800, 0x1c01f000, 0x4933c857, 0x4c580000, - 0x4d2c0000, 0x59325808, 0x83383580, 0x00000015, - 0x04000010, 0x59342200, 0x84102502, 0x48126a00, - 0x0201f800, 0x00109037, 0x04000066, 0x0201f800, - 0x00109597, 0x04020005, 0x4200b000, 0x00000002, - 0x0201f800, 0x0010957d, 0x0401fa0a, 0x0401f079, - 0x83cc1400, 0x00000008, 0x4200b000, 0x00000002, - 0x83341c00, 0x00000006, 0x0201f800, 0x0010855a, - 0x04020015, 0x83cc1400, 0x0000000a, 0x4200b000, - 0x00000002, 0x83341c00, 0x00000008, 0x0201f800, - 0x0010855a, 0x0402000c, 0x0201f800, 0x00102074, - 0x59342200, 0x59cc1007, 0x800811c0, 0x04000003, - 0x480a6801, 0x84102542, 0x8410251a, 0x48126a00, - 0x0401f05f, 0x4d3c0000, 0x417a7800, 0x0201f800, - 0x0010203c, 0x5c027800, 0x42000000, 0x0010b864, - 0x0201f800, 0x0010aa47, 0x59340200, 0x84000558, - 0x48026a00, 0x4d300000, 0x0201f800, 0x0002075a, - 0x02000800, 0x001005d8, 0x49366009, 0x497a6008, - 0x4a026406, 0x00000001, 0x4a026403, 0x00000001, - 0x42003000, 0x00000003, 0x0201f800, 0x0010a942, - 0x0201f800, 0x00103b25, 0x04000011, 0x41782800, - 0x42003000, 0x00000001, 0x4d400000, 0x42028000, - 0x00000029, 0x0201f800, 0x0010a43e, 0x5c028000, - 0x4a026406, 0x00000004, 0x4a026203, 0x00000007, - 0x4a026420, 0x00000001, 0x0401f009, 0x4a026203, - 0x00000001, 0x42000800, 0x0000000b, 0x0201f800, - 0x00104571, 0x0201f800, 0x0010672b, 0x5c026000, - 0x0201f800, 0x00109037, 0x04000022, 0x0201f800, - 0x00109597, 0x04020022, 0x0401f9ae, 0x0401f01d, - 0x4d3c0000, 0x417a7800, 0x0201f800, 0x0010203c, - 0x42000000, 0x0010b864, 0x0201f800, 0x0010aa47, - 0x59340200, 0x84000558, 0x48026a00, 0x42003000, - 0x00000003, 0x41782800, 0x42002000, 0x00000005, - 0x4d400000, 0x4d440000, 0x59368c03, 0x42028000, - 0x00000029, 0x0201f800, 0x0010985e, 0x5c028800, - 0x5c028000, 0x5c027800, 0x0201f800, 0x00102074, - 0x0201f800, 0x0002077d, 0x0401f002, 0x0401fca9, - 0x5c025800, 0x5c00b000, 0x1c01f000, 0x4933c857, - 0x41380000, 0x83383480, 0x00000056, 0x02021800, - 0x001005d8, 0x0c01f001, 0x00107ef7, 0x00107ef2, - 0x00107ef7, 0x00107ef7, 0x00107ef7, 0x00107ef7, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef0, - 0x00107ef0, 0x00107ef7, 0x00107ef0, 0x00107ef7, - 0x00107ef7, 0x00107ef0, 0x00107ef0, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef7, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef0, - 0x00107ef7, 0x00107ef7, 0x00107ef0, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef7, - 0x00107ef0, 0x00107ef0, 0x00107ef7, 0x00107ef7, - 0x00107ef0, 0x00107ef7, 0x00107ef7, 0x00107ef0, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef7, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef7, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef7, - 0x00107ef0, 0x00107ef0, 0x00107ef0, 0x00107ef7, - 0x0201f800, 0x001005d8, 0x4a026203, 0x00000001, - 0x493a6403, 0x0201f000, 0x0010672b, 0x4933c857, - 0x4a026203, 0x00000001, 0x493a6403, 0x0201f000, - 0x0010672b, 0x4933c857, 0x59300403, 0x82003480, - 0x00000056, 0x02021800, 0x001005d8, 0x83383580, - 0x00000013, 0x04000093, 0x83383580, 0x00000027, - 0x0402004b, 0x0201f800, 0x00106bbf, 0x0201f800, - 0x00109134, 0x0400000b, 0x0201f800, 0x0010914e, - 0x04000041, 0x59300403, 0x82000d80, 0x00000022, - 0x04020038, 0x0401fc61, 0x0400003a, 0x0401f03a, - 0x0201f800, 0x00102074, 0x42000800, 0x00000007, - 0x0201f800, 0x00104571, 0x0401f8fe, 0x4d440000, - 0x59368c03, 0x83440580, 0x000007fe, 0x04020008, - 0x59a81026, 0x84081540, 0x0201f800, 0x0010513b, - 0x04020002, 0x8408154a, 0x480b5026, 0x42028000, - 0x00000029, 0x4d3c0000, 0x417a7800, 0x0201f800, - 0x0010203c, 0x5c027800, 0x836c0580, 0x00000003, - 0x0400000c, 0x59326809, 0x59340008, 0x800001c0, - 0x04020008, 0x59368c03, 0x4933c857, 0x4937c857, - 0x4947c857, 0x0201f800, 0x001045fb, 0x0401f00c, - 0x42000000, 0x0010b864, 0x0201f800, 0x0010aa47, - 0x42003000, 0x00000015, 0x41782800, 0x42002000, - 0x00000003, 0x0201f800, 0x0010985e, 0x5c028800, - 0x0201f800, 0x00109326, 0x0201f000, 0x0002077d, - 0x1c01f000, 0x0401f8cb, 0x0401f7fa, 0x83380580, - 0x00000014, 0x0400000b, 0x0201f800, 0x00106f60, - 0x02020000, 0x00107974, 0x59300203, 0x82000580, - 0x00000002, 0x040000ed, 0x0201f800, 0x001005d8, - 0x0201f800, 0x00106bbf, 0x4d3c0000, 0x417a7800, - 0x0201f800, 0x0010203c, 0x5c027800, 0x42003000, - 0x00000016, 0x41782800, 0x4d400000, 0x4d440000, - 0x59368c03, 0x42002000, 0x00000009, 0x42028000, - 0x00000029, 0x0201f800, 0x0010985e, 0x5c028800, - 0x5c028000, 0x42000000, 0x0010b864, 0x0201f800, - 0x0010aa47, 0x0201f800, 0x00109134, 0x0402000c, - 0x0201f800, 0x00102074, 0x0401f89e, 0x59340c03, - 0x82040580, 0x000007fe, 0x040207ca, 0x59a80826, - 0x84040d40, 0x48075026, 0x0401f7c6, 0x0201f800, - 0x0010914e, 0x04020003, 0x0401f892, 0x0401f7c1, - 0x59300403, 0x82000d80, 0x00000032, 0x04020004, - 0x0201f800, 0x0010230c, 0x0401f7ba, 0x59300403, - 0x82000d80, 0x00000022, 0x04000886, 0x0401f7b5, - 0x4803c857, 0x0c01f001, 0x00108016, 0x00108016, - 0x00108016, 0x00108016, 0x00108016, 0x00108016, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00107ff0, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00107ff0, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00107ff0, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00107ff0, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00107ff0, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00107ff0, - 0x00107ff9, 0x00108016, 0x00107ff0, 0x00108016, - 0x00108016, 0x00107ff0, 0x00107ff0, 0x00107ff0, - 0x00107ff0, 0x00107ff0, 0x00108016, 0x00108016, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00107ff0, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00107ff0, - 0x00108007, 0x00108016, 0x00107ff0, 0x00108000, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00108000, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00108016, - 0x00108003, 0x00107ff0, 0x00107ff2, 0x00108016, - 0x00107ff0, 0x00108016, 0x00108016, 0x00107ff0, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00108016, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00108016, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00108016, - 0x00107ff0, 0x00107ff0, 0x00107ff0, 0x00108016, - 0x0201f800, 0x001005d8, 0x4d2c0000, 0x59325808, - 0x0201f800, 0x000202da, 0x5c025800, 0x0201f000, - 0x0002077d, 0x4a026203, 0x00000005, 0x59a80039, - 0x48026205, 0x59a80037, 0x48026206, 0x1c01f000, - 0x5930081e, 0x49780a05, 0x0401f014, 0x0201f800, - 0x00109326, 0x0201f000, 0x0002077d, 0x0201f800, - 0x0010230c, 0x0201f800, 0x00106c55, 0x04000005, - 0x0201f800, 0x00106bbf, 0x0201f000, 0x0002077d, - 0x0201f800, 0x00106bbf, 0x0201f800, 0x0002077d, - 0x0201f000, 0x00106c4b, 0x4933c857, 0x4a026203, - 0x00000002, 0x59a80037, 0x48026206, 0x1c01f000, - 0x4933c857, 0x0201f800, 0x00109037, 0x0400002a, - 0x4d2c0000, 0x0201f800, 0x00109597, 0x0402000a, - 0x4d400000, 0x42028000, 0x00000031, 0x42000800, - 0x00000004, 0x0201f800, 0x0010943b, 0x5c028000, - 0x0401f01c, 0x59300c06, 0x82040580, 0x00000010, - 0x04000004, 0x82040580, 0x00000011, 0x0402000a, - 0x4a025a06, 0x00000031, 0x4a02580d, 0x00000004, - 0x4a02580e, 0x000000ff, 0x0201f800, 0x000202da, - 0x0401f00c, 0x592c0404, 0x8c00051e, 0x04000009, - 0x4a025a04, 0x00000103, 0x4a025805, 0x01000000, - 0x5931d821, 0x58ef400b, 0x58ec0009, 0x0801f800, - 0x5c025800, 0x1c01f000, 0x4933c857, 0x59340400, - 0x82000500, 0x000000ff, 0x82003480, 0x0000000c, - 0x02021800, 0x001005d8, 0x59303403, 0x82180d80, - 0x0000004d, 0x02000000, 0x0010938b, 0x82180d80, - 0x00000033, 0x02000000, 0x00109349, 0x82180d80, - 0x00000028, 0x02000000, 0x0010918f, 0x82180d80, - 0x00000029, 0x02000000, 0x001091a3, 0x82180d80, - 0x0000001f, 0x02000000, 0x00107b28, 0x82180d80, - 0x00000055, 0x02000000, 0x00107b01, 0x82180d80, - 0x00000000, 0x04000591, 0x82180d80, 0x00000022, - 0x02000000, 0x00107b55, 0x82180d80, 0x00000035, - 0x02000000, 0x00107c50, 0x82180d80, 0x00000039, - 0x04000539, 0x82180d80, 0x0000003d, 0x02000000, - 0x00107b85, 0x82180d80, 0x00000044, 0x02000000, - 0x00107bc2, 0x82180d80, 0x00000049, 0x02000000, - 0x00107c17, 0x82180d80, 0x00000041, 0x02000000, - 0x00107c03, 0x82180d80, 0x00000043, 0x02000000, - 0x001094dc, 0x82180d80, 0x00000051, 0x02000000, - 0x00109542, 0x82180d80, 0x00000004, 0x04020003, - 0x42000000, 0x00000001, 0x83380d80, 0x00000015, - 0x04000006, 0x83380d80, 0x00000016, 0x02020000, - 0x00107974, 0x0401f20f, 0x4d2c0000, 0x4d3c0000, - 0x0c01f804, 0x5c027800, 0x5c025800, 0x1c01f000, - 0x001080b8, 0x001080bc, 0x001080b8, 0x00108131, - 0x001080b8, 0x00108226, 0x001082bf, 0x001080b8, - 0x001080b8, 0x00108288, 0x001080b8, 0x0010829a, - 0x4933c857, 0x497a6007, 0x59300808, 0x58040000, - 0x4a000a04, 0x00000103, 0x0201f000, 0x0002077d, - 0x4933c857, 0x40000000, 0x40000000, 0x1c01f000, - 0x4933c857, 0x59a80016, 0x82000580, 0x00000074, - 0x0402005c, 0x0201f800, 0x0010a2c8, 0x04020016, - 0x0401f85c, 0x0201f800, 0x00109037, 0x0400000c, - 0x0201f800, 0x00109597, 0x04020009, 0x41780800, - 0x4d400000, 0x42028000, 0x00000000, 0x0201f800, - 0x0010943b, 0x5c028000, 0x0401f003, 0x0201f800, - 0x00102074, 0x0201f800, 0x001048c1, 0x0201f000, - 0x0002077d, 0x0201f800, 0x00109037, 0x04000007, - 0x0201f800, 0x00109597, 0x04020004, 0x0401ff3d, - 0x0201f000, 0x0002077d, 0x417a7800, 0x0201f800, - 0x0010203c, 0x42000000, 0x0010b864, 0x0201f800, - 0x0010aa47, 0x59340200, 0x84000558, 0x48026a00, - 0x42003000, 0x00000003, 0x0201f800, 0x0010a942, - 0x4d300000, 0x0201f800, 0x0002075a, 0x02000800, - 0x001005d8, 0x49366009, 0x497a6008, 0x4a026406, - 0x00000001, 0x4a026403, 0x00000001, 0x0201f800, - 0x00103b25, 0x04000011, 0x4a026406, 0x00000004, - 0x4a026203, 0x00000007, 0x4a026420, 0x00000001, - 0x42003000, 0x00000001, 0x4d400000, 0x42028000, - 0x00000029, 0x41782800, 0x0201f800, 0x0010a43e, - 0x5c028000, 0x0401f009, 0x42000800, 0x0000000b, - 0x0201f800, 0x00104571, 0x4a026203, 0x00000001, - 0x0201f800, 0x0010672b, 0x5c026000, 0x0401ff05, - 0x0201f800, 0x00102074, 0x0201f000, 0x0002077d, - 0x0401ff00, 0x42000000, 0x00000001, 0x0401f0c7, - 0x4933c857, 0x59340200, 0x8c000500, 0x0400000d, - 0x4d3c0000, 0x417a7800, 0x0201f800, 0x00104567, - 0x5c027800, 0x0201f800, 0x00103b25, 0x04000005, - 0x42000800, 0x00000006, 0x0201f800, 0x00104571, - 0x1c01f000, 0x4933c857, 0x59a80816, 0x82040580, - 0x00000074, 0x0400000e, 0x4807c857, 0x82040580, - 0x00000100, 0x040200a0, 0x59cc0408, 0x4803c857, - 0x8c000500, 0x0400009c, 0x59341403, 0x82080580, - 0x000007fe, 0x04000006, 0x0401f097, 0x59341403, - 0x82080580, 0x000007fe, 0x04020003, 0x0401fa9c, - 0x0401f04c, 0x0201f800, 0x0010462a, 0x59341403, - 0x82080580, 0x000007fc, 0x0402001f, 0x4a026802, - 0x00fffffc, 0x0201f800, 0x00109037, 0x04000012, - 0x0201f800, 0x00109597, 0x0402000f, 0x0401f8a9, - 0x41780800, 0x4d400000, 0x42028000, 0x00000000, - 0x0201f800, 0x0010943b, 0x5c028000, 0x42000800, - 0x00000004, 0x0201f800, 0x00104571, 0x0201f000, - 0x0002077d, 0x42000800, 0x00000004, 0x0201f800, - 0x00104571, 0x0201f800, 0x00102074, 0x0201f000, - 0x0002077d, 0x59a80005, 0x8c000514, 0x04000011, - 0x0201f800, 0x0010513b, 0x42001000, 0x00000010, - 0x04020009, 0x59340002, 0x82000500, 0x00ff0000, - 0x82000580, 0x00ff0000, 0x04000006, 0x42001000, - 0x00000008, 0x0201f800, 0x00104c6d, 0x0402005a, - 0x0201f800, 0x00109037, 0x0400005b, 0x0201f800, - 0x00109597, 0x04020005, 0x592c0404, 0x8c00051c, - 0x040207c9, 0x0401f877, 0x42000800, 0x00000005, - 0x0201f800, 0x00104571, 0x4a026203, 0x00000001, - 0x4a026403, 0x00000003, 0x0201f000, 0x0010672b, - 0x59cc0408, 0x8c000518, 0x04000010, 0x0201f800, - 0x001092e5, 0x0201f800, 0x0010513b, 0x04000004, - 0x59cc0408, 0x8c000516, 0x040207b3, 0x59a80026, - 0x8400054a, 0x48035026, 0x59a80010, 0x84000570, - 0x48038832, 0x0401f7ac, 0x42001000, 0x000000ef, - 0x480b5010, 0x497b8830, 0x84081570, 0x480b8832, - 0x59c40802, 0x84040d4c, 0x48078802, 0x0201f800, - 0x0010930f, 0x59a80026, 0x84000548, 0x48035026, - 0x0201f800, 0x0010a3da, 0x0402079b, 0x59a80026, - 0x8400054c, 0x48035026, 0x42000800, 0x00000006, - 0x0201f800, 0x00104571, 0x417a7800, 0x0201f800, - 0x00104567, 0x42000000, 0x000000e8, 0x0201f800, - 0x00105c9a, 0x02000800, 0x001045a6, 0x02020800, - 0x001005d8, 0x49366009, 0x59340200, 0x8400051a, - 0x48026a00, 0x42000800, 0x00000003, 0x0201f800, - 0x00104571, 0x4a026406, 0x00000001, 0x4a026203, - 0x00000001, 0x4a026403, 0x00000002, 0x0201f000, - 0x0010672b, 0x0401fe43, 0x42000000, 0x00000001, - 0x0401f00a, 0x599c0017, 0x8c00050a, 0x040007ab, - 0x42000800, 0x00000004, 0x0201f800, 0x00104571, - 0x0201f000, 0x0002077d, 0x4933c857, 0x80003540, - 0x04000005, 0x42000800, 0x00000007, 0x0201f800, - 0x00104571, 0x801831c0, 0x0402000e, 0x59302008, - 0x801021c0, 0x04000004, 0x58100404, 0x8c00051e, - 0x04020008, 0x59341c03, 0x42002000, 0x00000004, - 0x42003000, 0x00000012, 0x0201f800, 0x00103aae, - 0x0201f800, 0x00102074, 0x0201f000, 0x0002077d, - 0x4c5c0000, 0x4d2c0000, 0x59325808, 0x0201f800, - 0x00105755, 0x5c025800, 0x59cc0008, 0x48002805, - 0x59cc0009, 0x48002806, 0x49782807, 0x49782808, - 0x49782809, 0x4978280a, 0x59cc0013, 0x8c00053e, - 0x04000009, 0x59cc0414, 0x900001c0, 0x59ccbc15, - 0x805c0540, 0x48002807, 0x59cc0416, 0x900001c0, - 0x48002808, 0x59cc0017, 0x8c00053e, 0x04000009, - 0x59cc0418, 0x900001c0, 0x59ccbc19, 0x805c0540, - 0x48002809, 0x59cc041a, 0x900001c0, 0x4800280a, - 0x5c00b800, 0x1c01f000, 0x4933c857, 0x59a80016, - 0x82000580, 0x00000014, 0x04020048, 0x59a80005, - 0x8c000514, 0x04000015, 0x0201f800, 0x0010513b, - 0x42001000, 0x00000010, 0x04020009, 0x59340002, - 0x82000500, 0x00ff0000, 0x82000580, 0x00ff0000, - 0x0400000a, 0x42001000, 0x00000008, 0x0201f800, - 0x00104c6d, 0x04000005, 0x59a80005, 0x84000556, - 0x48035005, 0x0401f031, 0x836c0580, 0x00000003, - 0x0402000b, 0x59300008, 0x80000540, 0x04020008, - 0x59341c03, 0x42002000, 0x00000006, 0x42003000, - 0x00000013, 0x0201f800, 0x00103aae, 0x0201f800, - 0x0010468d, 0x0401fecf, 0x0401fa1d, 0x0402001f, - 0x59340404, 0x80000540, 0x0400001c, 0x42000800, - 0x00000006, 0x0201f800, 0x00104571, 0x0201f800, - 0x00109037, 0x04000011, 0x0201f800, 0x00109597, - 0x0402000a, 0x41780800, 0x4d400000, 0x42028000, - 0x00000000, 0x0201f800, 0x0010943b, 0x5c028000, - 0x0201f000, 0x0002077d, 0x4a025a04, 0x00000103, - 0x4a025805, 0x02000000, 0x0201f800, 0x00102074, - 0x0201f000, 0x0002077d, 0x0201f800, 0x00104c19, - 0x0201f800, 0x00109037, 0x04000007, 0x0201f800, - 0x00109597, 0x04020004, 0x0401fda2, 0x0201f000, - 0x0002077d, 0x0401fd9f, 0x80000580, 0x59a80005, - 0x8c000516, 0x04000005, 0x84000516, 0x48035005, - 0x82000540, 0x00000001, 0x0401ff60, 0x1c01f000, - 0x4933c857, 0x59a80016, 0x82000580, 0x00000014, - 0x0402000b, 0x42000800, 0x0000000b, 0x0201f800, - 0x00104571, 0x4a026203, 0x00000001, 0x4a026403, - 0x00000001, 0x0201f000, 0x0010672b, 0x42000000, - 0x00000001, 0x0401f74d, 0x4933c857, 0x40003000, - 0x59a80016, 0x82000580, 0x00000004, 0x0402000a, - 0x82183580, 0x0000000b, 0x04020005, 0x42000800, - 0x00000007, 0x0201f800, 0x00104571, 0x0201f000, - 0x0002077d, 0x42000000, 0x00000001, 0x0401f73b, - 0x4803c857, 0x4d2c0000, 0x4d3c0000, 0x0c01f804, - 0x5c027800, 0x5c025800, 0x1c01f000, 0x001080b8, - 0x001082ce, 0x001080b8, 0x00108323, 0x001080b8, - 0x00108391, 0x001082bf, 0x001080b8, 0x001080b8, - 0x001083b1, 0x001080b8, 0x001083c1, 0x4933c857, - 0x4d1c0000, 0x59301403, 0x82080580, 0x00000003, - 0x04000008, 0x82081580, 0x0000001e, 0x04020003, - 0x0201f800, 0x0002077d, 0x5c023800, 0x1c01f000, - 0x0401ff5a, 0x0401f7fd, 0x4933c857, 0x0201f800, - 0x00109037, 0x0400000b, 0x0201f800, 0x00109597, - 0x04020008, 0x4200b000, 0x00000002, 0x0201f800, - 0x0010957d, 0x0401fd43, 0x0201f000, 0x0002077d, - 0x0401f8f5, 0x04020030, 0x417a7800, 0x0201f800, - 0x00104567, 0x417a7800, 0x0201f800, 0x0010203c, - 0x42000000, 0x0010b864, 0x0201f800, 0x0010aa47, - 0x59340200, 0x84000558, 0x48026a00, 0x4a026403, - 0x00000002, 0x42003000, 0x00000003, 0x0201f800, - 0x0010a942, 0x0201f800, 0x00103b25, 0x04000011, - 0x4d400000, 0x41782800, 0x42003000, 0x00000005, - 0x42028000, 0x00000029, 0x0201f800, 0x0010a43e, - 0x5c028000, 0x4a026203, 0x00000007, 0x4a026406, - 0x00000004, 0x4a026420, 0x00000001, 0x1c01f000, - 0x42000800, 0x00000003, 0x0201f800, 0x00104571, - 0x4a026203, 0x00000001, 0x0201f800, 0x0010672b, - 0x0401f7f7, 0x59cc0407, 0x82000580, 0x00000009, - 0x0402000a, 0x59340412, 0x82000500, 0x000000ff, - 0x0400000c, 0x80000040, 0x48026c12, 0x4a026206, - 0x0000000a, 0x0401f7ea, 0x59cc0207, 0x82000500, - 0x0000ff00, 0x82000580, 0x00001900, 0x040007c2, - 0x0401fcfc, 0x80000580, 0x0401f6c4, 0x4933c857, - 0x59a80032, 0x80000540, 0x04000015, 0x59340403, - 0x82000580, 0x000007fe, 0x04020011, 0x59a80010, - 0x80000000, 0x48035010, 0x417a7800, 0x0201f800, - 0x00104567, 0x42000800, 0x00000003, 0x0201f800, - 0x00104571, 0x4a026203, 0x00000001, 0x4a026403, - 0x00000002, 0x0201f000, 0x0010672b, 0x0201f800, - 0x00109037, 0x04000011, 0x0201f800, 0x00109597, - 0x0402000e, 0x4c580000, 0x4200b000, 0x00000002, - 0x0201f800, 0x0010957d, 0x5c00b000, 0x0401fcd5, - 0x42000800, 0x00000007, 0x0201f800, 0x00104571, - 0x0201f000, 0x0002077d, 0x0401fcce, 0x59cc3407, - 0x82183500, 0x000000ff, 0x82180580, 0x00000005, - 0x0400001c, 0x82180580, 0x0000000b, 0x04000016, - 0x59cc0207, 0x82000500, 0x0000ff00, 0x04020004, - 0x82180580, 0x00000009, 0x04000012, 0x82000580, - 0x00001900, 0x0402000c, 0x82180580, 0x00000009, - 0x0400000c, 0x42000800, 0x00000004, 0x0201f800, - 0x00104571, 0x0201f800, 0x00102074, 0x0201f000, - 0x0002077d, 0x42000000, 0x00000001, 0x0401f677, - 0x0201f800, 0x00109037, 0x59325808, 0x04000008, - 0x592c0204, 0x82000580, 0x00000139, 0x040007f6, - 0x592c0404, 0x8c00051e, 0x040207f3, 0x59340403, - 0x82000580, 0x000007fe, 0x04020007, 0x59a80026, - 0x84000540, 0x48035026, 0x0201f800, 0x00104229, - 0x0401f7e9, 0x417a7800, 0x0201f800, 0x0010203c, - 0x42003000, 0x00000005, 0x0201f800, 0x0010a942, - 0x42000000, 0x0010b864, 0x0201f800, 0x0010aa47, - 0x0401f7dd, 0x4933c857, 0x0401f84d, 0x0402000b, - 0x42000800, 0x00000005, 0x0201f800, 0x00104571, - 0x4a026203, 0x00000001, 0x4a026403, 0x00000003, - 0x0201f000, 0x0010672b, 0x42000800, 0x00000004, - 0x0201f800, 0x00104571, 0x0201f800, 0x00109597, - 0x0402000a, 0x4c580000, 0x4200b000, 0x00000002, - 0x0201f800, 0x0010957d, 0x5c00b000, 0x0401fc71, - 0x0201f000, 0x0002077d, 0x0401fc6e, 0x80000580, - 0x0401f636, 0x4933c857, 0x0401f82d, 0x0402000b, - 0x42000800, 0x00000009, 0x0201f800, 0x00104571, - 0x4a026203, 0x00000001, 0x4a026403, 0x00000005, - 0x0201f000, 0x0010672b, 0x42000000, 0x00000001, - 0x0401f626, 0x4933c857, 0x0401f81d, 0x0402000b, - 0x42000800, 0x0000000b, 0x0201f800, 0x00104571, - 0x4a026203, 0x00000001, 0x4a026403, 0x00000001, - 0x0201f000, 0x0010672b, 0x42000000, 0x00000001, - 0x0401f616, 0x4933c857, 0x59cc0407, 0x82000580, - 0x00000003, 0x04020009, 0x59cc0207, 0x82000500, - 0x0000ff00, 0x82000d80, 0x00002a00, 0x04000003, - 0x82000d80, 0x00001e00, 0x1c01f000, 0x4933c857, - 0x82000540, 0x00000001, 0x1c01f000, 0x4933c857, - 0x4d400000, 0x4c580000, 0x59a80026, 0x82000540, - 0x00000003, 0x48035026, 0x0401f85c, 0x04000038, - 0x4d340000, 0x4d440000, 0x59a80026, 0x84000552, - 0x48035026, 0x0201f800, 0x00103b25, 0x0400000c, - 0x42028000, 0x0000002a, 0x42028800, 0x0000ffff, - 0x42003000, 0x00000002, 0x0201f800, 0x0010a446, - 0x59a80805, 0x84040d44, 0x48075005, 0x42028000, - 0x0000002a, 0x4d3c0000, 0x42027800, 0x00000204, - 0x0201f800, 0x00101fe5, 0x5c027800, 0x42000000, - 0x0010b864, 0x0201f800, 0x0010aa47, 0x0201f800, - 0x00101e45, 0x4200b000, 0x00000010, 0x42028800, - 0x000007f0, 0x4d2c0000, 0x83440580, 0x000007fe, - 0x04000003, 0x0201f800, 0x001045fb, 0x81468800, - 0x8058b040, 0x040207f9, 0x5c025800, 0x59cc0408, - 0x8c00051e, 0x04000004, 0x59a80026, 0x84000512, - 0x48035026, 0x5c028800, 0x5c026800, 0x0201f800, - 0x0010462a, 0x4a026802, 0x00fffffe, 0x59a80826, - 0x84040d50, 0x59cc0013, 0x8c00053e, 0x04000003, - 0x8c000536, 0x04000004, 0x59cc0017, 0x8c000536, - 0x04020002, 0x84040d10, 0x48075026, 0x59cc0800, - 0x82040d00, 0x00ffffff, 0x48075010, 0x80040110, - 0x4803501d, 0x48038881, 0x0201f800, 0x0010513b, - 0x04000007, 0x59cc0009, 0x48035035, 0x59cc000a, - 0x48035036, 0x0201f800, 0x001092e5, 0x5c00b000, - 0x5c028000, 0x1c01f000, 0x4933c857, 0x4c580000, - 0x59a80010, 0x82000500, 0x00ffff00, 0x04000022, - 0x59cc1000, 0x82081500, 0x00ffff00, 0x80080580, - 0x04000004, 0x42000000, 0x0010b83b, 0x0401f016, - 0x83cc1400, 0x0000000b, 0x4200b000, 0x00000002, - 0x83341c00, 0x00000006, 0x0401f900, 0x04000004, - 0x42000000, 0x0010b83c, 0x0401f00b, 0x83cc1400, - 0x0000000d, 0x4200b000, 0x00000002, 0x83341c00, - 0x00000008, 0x0401f8f5, 0x04000007, 0x42000000, - 0x0010b83d, 0x0201f800, 0x0010aa47, 0x82000540, - 0x00000001, 0x5c00b000, 0x1c01f000, 0x4933c857, - 0x59cc0206, 0x82000580, 0x00000014, 0x04020016, - 0x59cc0407, 0x82000580, 0x00000800, 0x04020012, - 0x59cc0207, 0x8c00051a, 0x0400000d, 0x82000500, - 0x00000f00, 0x82000580, 0x00000100, 0x04020008, - 0x59cc020a, 0x8c000508, 0x04020003, 0x8c00050a, - 0x04000003, 0x80000580, 0x1c01f000, 0x82000540, - 0x00000001, 0x1c01f000, 0x4933c857, 0x4943c857, - 0x493fc857, 0x4c5c0000, 0x4d300000, 0x4d340000, - 0x4d2c0000, 0x4d380000, 0x4130b800, 0x42026000, - 0x0010d1c0, 0x59a8000e, 0x81640480, 0x040210bd, - 0x8d3e7d12, 0x04000004, 0x405c0000, 0x81300580, - 0x040000b3, 0x59300406, 0x82000c80, 0x00000012, - 0x04021015, 0x59326809, 0x0c01f001, 0x0010854f, - 0x001084bc, 0x001084d3, 0x001084de, 0x001084b7, - 0x001084ce, 0x00108507, 0x0010854f, 0x001084b5, - 0x0010851b, 0x0010852a, 0x001084b5, 0x001084b5, - 0x001084b5, 0x001084b5, 0x0010854f, 0x00108540, - 0x00108538, 0x0201f800, 0x001005d8, 0x8d3e7d18, - 0x04000004, 0x59300420, 0x8c000500, 0x04020094, - 0x59300403, 0x82000580, 0x00000043, 0x04000090, - 0x0201f800, 0x00109134, 0x02000800, 0x00102074, - 0x0201f800, 0x0010914e, 0x02000800, 0x0010801c, - 0x8d3e7d06, 0x04000084, 0x0201f800, 0x001092d7, - 0x04000083, 0x0401f080, 0x8d3e7d16, 0x04000004, - 0x59300420, 0x8c000500, 0x0402007d, 0x59325808, - 0x0201f800, 0x00109037, 0x04000077, 0x49425a06, - 0x497a5c09, 0x0201f800, 0x000202da, 0x0201f800, - 0x0010912a, 0x0401f070, 0x813669c0, 0x02000800, - 0x001005d8, 0x8d3e7d06, 0x04000004, 0x59340200, - 0x8c00050e, 0x0402006a, 0x59300004, 0x8400055c, - 0x48026004, 0x59300203, 0x82000580, 0x00000004, - 0x02000800, 0x00100e99, 0x59325808, 0x0201f800, - 0x00109037, 0x0400005c, 0x4a025a04, 0x00000103, - 0x59300402, 0x48025c06, 0x592c0408, 0x8c000512, - 0x04000006, 0x4d2c0000, 0x592e5809, 0x0201f800, - 0x001007fd, 0x5c025800, 0x49425a06, 0x497a5c09, - 0x0201f800, 0x0010959c, 0x0201f800, 0x000202da, - 0x0201f800, 0x0010912a, 0x0401f047, 0x8c000518, - 0x04000047, 0x59300203, 0x82000580, 0x00000004, - 0x02000800, 0x00100e99, 0x59325808, 0x0201f800, - 0x00109037, 0x0400003c, 0x49425a06, 0x497a5c09, - 0x0201f800, 0x0010a693, 0x0201f800, 0x0010959c, - 0x0201f800, 0x000202da, 0x0401f033, 0x0201f800, - 0x001062d5, 0x04000032, 0x59300203, 0x82000580, - 0x00000004, 0x04020004, 0x0201f800, 0x00100e99, - 0x0401f02b, 0x42027000, 0x00000047, 0x0201f800, - 0x000207a1, 0x0401f026, 0x59300203, 0x82000580, - 0x00000004, 0x02000800, 0x00100e99, 0x59325808, - 0x0201f800, 0x00109037, 0x0400001b, 0x49425a06, - 0x497a5c09, 0x0201f800, 0x000202da, 0x0401f016, - 0x833c0500, 0x00001800, 0x04000015, 0x8d3e7d16, - 0x04020013, 0x59325817, 0x0201f800, 0x001007fd, - 0x59300203, 0x82000580, 0x00000004, 0x02000800, - 0x00100e99, 0x59325808, 0x0201f800, 0x00109037, - 0x04000005, 0x49425a06, 0x497a5c09, 0x0201f800, - 0x000202da, 0x0201f800, 0x00107911, 0x83326400, - 0x00000024, 0x41580000, 0x81300480, 0x04001742, - 0x5c027000, 0x5c025800, 0x5c026800, 0x5c026000, - 0x5c00b800, 0x1c01f000, 0x5c000000, 0x4c000000, - 0x4803c857, 0x480bc857, 0x480fc857, 0x485bc857, - 0x50080800, 0x500c0000, 0x80042580, 0x04020007, - 0x80081000, 0x800c1800, 0x8058b040, 0x040207f9, - 0x80000580, 0x1c01f000, 0x4803c857, 0x4807c857, - 0x480bc857, 0x480fc857, 0x80040480, 0x04001006, - 0x42000000, 0x00000001, 0x82040d40, 0x00000001, - 0x1c01f000, 0x41780000, 0x0401f7fc, 0x83380480, - 0x00000053, 0x02021800, 0x001005d8, 0x83380480, - 0x0000004b, 0x02001800, 0x001005d8, 0x0c01f001, - 0x0010858a, 0x0010858a, 0x0010858a, 0x0010858a, - 0x00108588, 0x00108588, 0x00108588, 0x0010858a, - 0x0201f800, 0x001005d8, 0x493bc857, 0x4a026203, - 0x0000000d, 0x493a6403, 0x42000800, 0x80000000, - 0x0201f000, 0x00020721, 0x83380580, 0x00000013, - 0x04020008, 0x59300403, 0x82000580, 0x00000050, - 0x02020800, 0x001005d8, 0x0201f000, 0x0002077d, - 0x4933c857, 0x83380580, 0x00000027, 0x04020030, - 0x4933c857, 0x0201f800, 0x00106bbf, 0x4d3c0000, - 0x417a7800, 0x0201f800, 0x0010203c, 0x5c027800, - 0x42000000, 0x0010b864, 0x0201f800, 0x0010aa47, - 0x4d2c0000, 0x59325808, 0x0201f800, 0x00109037, - 0x492fc857, 0x0400000d, 0x4a025a04, 0x00000103, - 0x59300c02, 0x48065c06, 0x4a025a06, 0x00000029, - 0x497a5c09, 0x592c0c08, 0x84040d50, 0x48065c08, - 0x0201f800, 0x000202da, 0x5c025800, 0x42003000, - 0x00000015, 0x41782800, 0x42002000, 0x00000003, - 0x4d400000, 0x4d440000, 0x59368c03, 0x42028000, - 0x00000029, 0x0201f800, 0x0010985e, 0x5c028800, - 0x5c028000, 0x0201f000, 0x0002077d, 0x83380580, - 0x00000014, 0x0402000c, 0x59300403, 0x82000c80, - 0x00000053, 0x02021800, 0x001005d8, 0x82000480, - 0x00000040, 0x02001800, 0x001005d8, 0x4803c857, - 0x0c01f00e, 0x83380580, 0x00000053, 0x0400000a, - 0x83380580, 0x00000048, 0x02020800, 0x001005d8, - 0x59300403, 0x82000580, 0x00000050, 0x02020800, - 0x001005d8, 0x1c01f000, 0x001085ff, 0x001085fd, - 0x001085fd, 0x001085fd, 0x001085fd, 0x001085fd, - 0x001085fd, 0x001085fd, 0x001085fd, 0x001085fd, - 0x001085fd, 0x00108616, 0x00108616, 0x00108616, - 0x00108616, 0x001085fd, 0x00108616, 0x001085fd, - 0x00108616, 0x0201f800, 0x001005d8, 0x4933c857, - 0x0201f800, 0x00106bbf, 0x0201f800, 0x00109037, - 0x02000000, 0x0002077d, 0x4d2c0000, 0x59325808, - 0x4a025a04, 0x00000103, 0x59300402, 0x48025c06, - 0x4a025a06, 0x00000006, 0x497a5c09, 0x0201f800, - 0x000202da, 0x5c025800, 0x0201f800, 0x0010912a, - 0x0201f000, 0x0002077d, 0x4933c857, 0x0201f800, - 0x00106bbf, 0x0201f000, 0x0002077d, 0x0201f800, - 0x001005d8, 0x5930001c, 0x800001c0, 0x02020800, - 0x0010984e, 0x59300004, 0x8c00053e, 0x04020029, - 0x59325808, 0x592c0c08, 0x59cc2a08, 0x82141d00, - 0x00000c00, 0x04000002, 0x59cc1809, 0x84040d58, - 0x48065c08, 0x82143500, 0x00000fff, 0x04020027, - 0x59340200, 0x8c00050e, 0x04020080, 0x0201f800, - 0x0002082b, 0x04020006, 0x4a025a06, 0x00000000, - 0x59300811, 0x800409c0, 0x0402094b, 0x4a025a04, - 0x00000103, 0x48065807, 0x480e580a, 0x48165c09, - 0x59300c02, 0x48065c06, 0x0201f800, 0x000202c1, - 0x0201f800, 0x001049b2, 0x59cc0208, 0x8c000518, - 0x02020000, 0x001091d1, 0x0201f000, 0x0002077d, - 0x0201f800, 0x00106f60, 0x040007d6, 0x4d3c0000, - 0x42027800, 0x00000002, 0x0201f800, 0x00108be3, - 0x5c027800, 0x0401f7cf, 0x4817c857, 0x480fc857, - 0x82180500, 0x000000ff, 0x0400000e, 0x592c0204, - 0x82000500, 0x000000ff, 0x82000580, 0x00000048, - 0x04020008, 0x592c0407, 0x800001c0, 0x04000005, - 0x0201f800, 0x0010973f, 0x0201f000, 0x00109787, - 0x82180d00, 0x00000c00, 0x04000004, 0x59340200, - 0x8c00050e, 0x04020032, 0x4a025a06, 0x00000000, - 0x41782000, 0x8c183510, 0x04000007, 0x59cc000c, - 0x82000500, 0x000000ff, 0x04000002, 0x4803c857, - 0x59cc200b, 0x4812580c, 0x41780000, 0x8c183512, - 0x04000002, 0x59cc000a, 0x4802580b, 0x80100c00, - 0x040007b8, 0x82041480, 0x0000001d, 0x04001006, - 0x592c0404, 0x8c00051e, 0x0400000e, 0x42000800, - 0x0000001c, 0x4c500000, 0x4c540000, 0x83cca400, - 0x0000000c, 0x832cac00, 0x0000000d, 0x0201f800, - 0x00108b9f, 0x5c00a800, 0x5c00a000, 0x0401f7a5, - 0x59300011, 0x59301402, 0x480a5c06, 0x48025807, - 0x480e580a, 0x48165c09, 0x0201f800, 0x00108b48, - 0x0201f800, 0x00108b84, 0x0401f7a6, 0x592c020a, - 0x8c000502, 0x040007cd, 0x592c0208, 0x8c00050e, - 0x040207ca, 0x59300011, 0x800c0d80, 0x040007c7, - 0x4803c857, 0x480fc857, 0x8c183514, 0x02000000, - 0x0010920f, 0x80000540, 0x040007c0, 0x4807c856, - 0x0201f000, 0x0010920f, 0x592c020a, 0x8c000502, - 0x04000782, 0x59300011, 0x800001c0, 0x0400077f, - 0x592c0208, 0x8c00050e, 0x0402077c, 0x0201f000, - 0x0010920f, 0x59cc2006, 0x59cc2807, 0x0401f035, - 0x0401f034, 0x1c01f000, 0x4933c857, 0x5930001c, - 0x800001c0, 0x02020800, 0x0010984e, 0x59325808, - 0x592c0c08, 0x41782800, 0x41781800, 0x84040d58, - 0x48065c08, 0x41783000, 0x59340200, 0x8c00050e, - 0x04020018, 0x0201f800, 0x0002082b, 0x04020007, - 0x4a025a06, 0x00000000, 0x59300811, 0x4807c857, - 0x800409c0, 0x040208ac, 0x4a025a04, 0x00000103, - 0x48065807, 0x480e580a, 0x48165c09, 0x4933c857, - 0x59300c02, 0x48065c06, 0x0201f800, 0x000202c1, - 0x0201f800, 0x001049b2, 0x0201f000, 0x0002077d, - 0x592c020a, 0x8c000502, 0x040007ea, 0x59300011, - 0x4803c857, 0x800001c0, 0x040007e6, 0x592c0208, - 0x8c00050e, 0x040207e3, 0x0201f000, 0x0010920f, - 0x5930001c, 0x800001c0, 0x4c100000, 0x4c140000, - 0x02020800, 0x0010984e, 0x5c002800, 0x5c002000, - 0x4a026203, 0x00000002, 0x4a026403, 0x00000043, - 0x59325808, 0x592c020a, 0x8c000502, 0x04020018, - 0x40100000, 0x592c080f, 0x80040c80, 0x40140000, - 0x80040480, 0x04001014, 0x48126013, 0x48166011, - 0x59300004, 0x8c00053e, 0x04020008, 0x497a6205, - 0x0201f800, 0x00100f93, 0x04020009, 0x59300804, - 0x0201f000, 0x00106721, 0x0201f800, 0x00106f60, - 0x040007f7, 0x0201f000, 0x00107974, 0x4933c857, - 0x1c01f000, 0x4807c857, 0x40042800, 0x0401f7eb, - 0x83380480, 0x00000058, 0x04021005, 0x83380480, - 0x00000040, 0x04001002, 0x0c01f002, 0x1c01f000, - 0x00108740, 0x00108740, 0x00108740, 0x00108740, - 0x00108740, 0x00108740, 0x00108740, 0x00108740, - 0x00108740, 0x00108740, 0x00108742, 0x00108740, - 0x00108740, 0x00108740, 0x00108740, 0x0010874f, - 0x00108740, 0x00108740, 0x00108740, 0x00108740, - 0x0010877d, 0x00108740, 0x00108740, 0x00108740, - 0x0201f800, 0x001005d8, 0x4933c857, 0x0201f800, - 0x00106dc3, 0x4a026203, 0x00000002, 0x59a80039, - 0x48026205, 0x59300011, 0x59300815, 0x80040c80, - 0x48066015, 0x0201f000, 0x00106b8a, 0x4933c857, - 0x0201f800, 0x00106b8a, 0x4d3c0000, 0x417a7800, - 0x0201f800, 0x0010203c, 0x5c027800, 0x42000000, - 0x0010b864, 0x0201f800, 0x0010aa47, 0x0201f800, - 0x00109037, 0x04000010, 0x4d2c0000, 0x59325808, - 0x4a025a04, 0x00000103, 0x59300402, 0x48025c06, - 0x4a025a06, 0x00000029, 0x497a5c09, 0x592c0c08, - 0x84040d50, 0x48065c08, 0x0201f800, 0x000202da, - 0x5c025800, 0x42003000, 0x00000014, 0x41782800, - 0x4d400000, 0x4d440000, 0x59368c03, 0x42002000, - 0x00000002, 0x42028000, 0x00000029, 0x0201f800, - 0x0010985e, 0x5c028800, 0x5c028000, 0x0201f000, - 0x0002077d, 0x4933c857, 0x59300808, 0x49780c09, - 0x4978080a, 0x58041408, 0x84081558, 0x48080c08, - 0x1c01f000, 0x4807c857, 0x8c040d3e, 0x04020023, - 0x497a5a06, 0x5930001f, 0x80000540, 0x04000017, - 0x497a5a06, 0x4c040000, 0x4c080000, 0x4c0c0000, - 0x4c100000, 0x4c140000, 0x58f41003, 0x40040000, - 0x80081480, 0x5930001f, 0x4809e803, 0x0201f800, - 0x00100d56, 0x5c002800, 0x5c002000, 0x5c001800, - 0x5c001000, 0x5c000800, 0x592c0206, 0x80000540, - 0x04020009, 0x0401f005, 0x592c0408, 0x8c00051c, - 0x04000002, 0x592c0803, 0x4807c857, 0x4a025a06, - 0x00000015, 0x1c01f000, 0x5930001f, 0x80000540, - 0x04000009, 0x4a025a06, 0x00000011, 0x5930001f, - 0x4c040000, 0x0201f800, 0x00100d56, 0x5c000800, - 0x0401f7f5, 0x4807c856, 0x4a025a06, 0x00000007, - 0x1c01f000, 0x83380480, 0x00000058, 0x04021007, - 0x83380480, 0x00000040, 0x04001004, 0x4d2c0000, - 0x0c01f803, 0x5c025800, 0x1c01f000, 0x001087db, - 0x001087db, 0x001087db, 0x001087db, 0x001087db, - 0x001087dd, 0x001087db, 0x001087db, 0x00108860, - 0x001087db, 0x001087db, 0x001087db, 0x001087db, - 0x001087db, 0x001087db, 0x001087db, 0x001087db, - 0x001087db, 0x001087db, 0x00108910, 0x00108939, - 0x00108918, 0x001087db, 0x00108945, 0x0201f800, - 0x001005d8, 0x5930001c, 0x800001c0, 0x02020800, - 0x0010984e, 0x59300007, 0x8c00050e, 0x0400007c, - 0x8c000500, 0x0400006e, 0x8c00051c, 0x04000009, - 0x84000500, 0x48026007, 0x59325808, 0x592c3c08, - 0x841c3d58, 0x481e5c08, 0x0201f000, 0x000207dd, - 0x59325808, 0x592c3c08, 0x841c3d58, 0x59300007, - 0x8c00051c, 0x040207f3, 0x481e5c08, 0x42000000, - 0x00000005, 0x40000000, 0x80000040, 0x040207fe, - 0x59300007, 0x8c00051c, 0x040207ea, 0x59cc0a08, - 0x592c0204, 0x82000500, 0x000000ff, 0x82000580, - 0x00000048, 0x0402000c, 0x497a580b, 0x82040500, - 0x000000ff, 0x04000008, 0x592c0407, 0x800001c0, - 0x04000005, 0x0201f800, 0x0010973f, 0x0201f000, - 0x00100e56, 0x48065c09, 0x41782000, 0x82040500, - 0x00000c00, 0x04000002, 0x59cc2009, 0x82043500, - 0x00000fff, 0x04020027, 0x481e5c08, 0x4a025a06, - 0x00000000, 0x801831c0, 0x02000000, 0x00100e56, - 0x41782000, 0x8c183510, 0x04000002, 0x59cc200b, - 0x4812580c, 0x41780000, 0x8c183512, 0x04000002, - 0x59cc000a, 0x4802580b, 0x80100c00, 0x02001800, - 0x001005d8, 0x02000000, 0x00100e56, 0x82041480, - 0x0000001d, 0x0402100c, 0x4c500000, 0x4c540000, - 0x83cca400, 0x0000000c, 0x832cac00, 0x0000000d, - 0x0401fb67, 0x5c00a800, 0x5c00a000, 0x0201f000, - 0x00100e56, 0x0401fb0b, 0x0201f000, 0x00100e56, - 0x412c7800, 0x0201f800, 0x001007e4, 0x02000800, - 0x001005d8, 0x492c7809, 0x841c3d52, 0x481c7c08, - 0x4a025a04, 0x00000103, 0x4812580a, 0x48065c09, - 0x583c0404, 0x583c1005, 0x583c2208, 0x48025c04, - 0x480a5805, 0x48125a08, 0x0401f7c8, 0x8c000524, - 0x04000794, 0x59325808, 0x4c000000, 0x592c0408, - 0x8c00051c, 0x5c000000, 0x04020003, 0x4a026011, - 0xffffffff, 0x84000524, 0x0401f78a, 0x1c01f000, - 0x59a80039, 0x48026205, 0x59325808, 0x4a026203, - 0x00000002, 0x592c2408, 0x59300807, 0x4933c857, - 0x4807c857, 0x592c0204, 0x82000500, 0x000000ff, - 0x82000580, 0x00000048, 0x04020004, 0x8c102500, - 0x02020000, 0x00109787, 0x4a025a06, 0x00000000, - 0x8c040d1e, 0x04000027, 0x41780800, 0x497a5c09, - 0x592c1c09, 0x59300011, 0x59341200, 0x497a6205, - 0x8c08150e, 0x0402006e, 0x4807c857, 0x4806580a, - 0x80000d40, 0x04020f04, 0x59300402, 0x48025c06, - 0x48065807, 0x4a025a04, 0x00000103, 0x4c040000, - 0x4c0c0000, 0x4c100000, 0x0201f800, 0x0010959c, - 0x5c002000, 0x5c001800, 0x5c000800, 0x8c102512, - 0x0402001a, 0x4c0c0000, 0x0201f800, 0x000202c1, - 0x0201f800, 0x001049b2, 0x5c001800, 0x8c0c1d18, - 0x02000000, 0x0002077d, 0x0201f000, 0x001091d1, - 0x4813c857, 0x8c102518, 0x0400004b, 0x41780800, - 0x592c1c09, 0x820c0580, 0x00001000, 0x040007d6, - 0x8c102512, 0x040007d4, 0x592c7809, 0x583c080a, - 0x583c1c09, 0x0401f7d0, 0x4807c857, 0x592c7809, - 0x59300402, 0x592c1404, 0x8c08151e, 0x0402000d, - 0x592c1206, 0x48007c06, 0x48047807, 0x48087a06, - 0x84102512, 0x48107c08, 0x4c0c0000, 0x0201f800, - 0x001007fd, 0x403e5800, 0x0401faca, 0x0401f7d9, - 0x48025c06, 0x48065807, 0x583c080c, 0x583c000b, - 0x80040c00, 0x82041480, 0x0000001d, 0x04001006, - 0x583c1001, 0x480a5801, 0x49787801, 0x42000800, - 0x0000001c, 0x82040c00, 0x00000014, 0x4c0c0000, - 0x4c500000, 0x4c540000, 0x823ca400, 0x00000008, - 0x832cac00, 0x00000008, 0x4c100000, 0x4c3c0000, - 0x0401facb, 0x5c007800, 0x5c002000, 0x5c00a800, - 0x5c00a000, 0x84102512, 0x48125c08, 0x403e5800, - 0x0201f800, 0x001007fd, 0x42034000, 0x0010b4a4, - 0x59a1d81e, 0x80edd9c0, 0x02000800, 0x001005d8, - 0x48efc857, 0x58ec0009, 0x4803c857, 0x0801f800, - 0x0401f7ac, 0x4933c857, 0x1c01f000, 0x59301414, - 0x480bc857, 0x8c08151c, 0x0402000e, 0x80000540, - 0x4803c857, 0x0400078d, 0x80042c80, 0x0402178b, - 0x8c081514, 0x04020005, 0x592c080f, 0x4807c857, - 0x80040480, 0x48026016, 0x8408155c, 0x480a6414, - 0x59301007, 0x8408151e, 0x480a6007, 0x4a025c09, - 0x00000001, 0x0201f800, 0x0010959c, 0x497a5c09, - 0x8c102512, 0x04000006, 0x4d2c0000, 0x403e5800, - 0x0201f800, 0x001007fd, 0x5c025800, 0x82102500, - 0xffffedff, 0x48125c08, 0x0201f000, 0x0010920f, - 0x59325808, 0x592c0408, 0x8c000518, 0x04000004, - 0x412df800, 0x0201f000, 0x00100e6f, 0x1c01f000, - 0x4933c857, 0x59325808, 0x497a5c09, 0x4a025a06, - 0x00000000, 0x4a025a04, 0x00000103, 0x59300811, - 0x4807c857, 0x800409c0, 0x0402000a, 0x48065807, - 0x59300c02, 0x48065c06, 0x0201f800, 0x000202c1, - 0x0201f800, 0x001049b2, 0x0201f000, 0x0002077d, - 0x59340200, 0x8c00050e, 0x04020005, 0x59300811, - 0x0401fe55, 0x48065807, 0x0401f7f2, 0x592c0208, - 0x8c00050e, 0x040207fa, 0x4933c857, 0x0201f000, - 0x0010920f, 0x4933c857, 0x59325808, 0x812e59c0, - 0x02000800, 0x001005d8, 0x592c020a, 0x8c000502, - 0x02000800, 0x001005d8, 0x4a026206, 0x00000002, - 0x1c01f000, 0x5930001c, 0x800001c0, 0x02020800, - 0x0010984e, 0x59300007, 0x4933c857, 0x4803c857, - 0x8c00050e, 0x04000037, 0x8c000500, 0x04000029, - 0x8c00051c, 0x0400000a, 0x84000500, 0x48026007, - 0x59325808, 0x592c3c08, 0x481fc857, 0x841c3d58, - 0x481e5c08, 0x0201f000, 0x000207dd, 0x59325808, - 0x592c3c08, 0x841c3d58, 0x59300007, 0x8c00051c, - 0x040207f2, 0x481e5c08, 0x42000000, 0x00000005, - 0x40000000, 0x80000040, 0x040207fe, 0x59300007, - 0x8c00051c, 0x040207e9, 0x592c0204, 0x82000500, - 0x000000ff, 0x82000580, 0x00000048, 0x04020003, - 0x497a580b, 0x0401f002, 0x497a5c09, 0x481e5c08, - 0x4a025a06, 0x00000000, 0x0201f000, 0x00100e56, - 0x8c000524, 0x040007d9, 0x59325808, 0x4c000000, - 0x592c0408, 0x8c00051c, 0x5c000000, 0x04020003, - 0x4a026011, 0xffffffff, 0x84000524, 0x0401f7cf, - 0x1c01f000, 0x4933c857, 0x41780800, 0x83380480, - 0x00000058, 0x0402100b, 0x83380480, 0x00000040, - 0x04001008, 0x4d2c0000, 0x59325808, 0x812e59c0, - 0x0c020806, 0x5c025800, 0x0201f000, 0x0002077d, - 0x493bc857, 0x1c01f000, 0x001089ae, 0x001089ae, - 0x001089ae, 0x001089ae, 0x001089ae, 0x001089b0, - 0x001089ae, 0x001089ae, 0x001089ae, 0x001089ae, - 0x001089ae, 0x001089ae, 0x001089ae, 0x001089ae, - 0x001089ae, 0x001089ae, 0x001089ae, 0x001089ae, - 0x001089ae, 0x001089ae, 0x001089b5, 0x001089ae, - 0x001089ae, 0x001089ae, 0x0201f800, 0x001005d8, - 0x59cc0a08, 0x497a5807, 0x4807c857, 0x82040d00, - 0x00000fff, 0x59300402, 0x48025c06, 0x4a025a04, - 0x00000103, 0x48065c09, 0x4a025a06, 0x00000000, - 0x800409c0, 0x02000000, 0x000202c1, 0x59cc0009, - 0x4802580a, 0x82042500, 0x00000100, 0x04000002, - 0x59cc200b, 0x4812580c, 0x82040500, 0x00000200, - 0x04000002, 0x59cc000a, 0x4802580b, 0x80100c00, - 0x02001800, 0x001005d8, 0x02000000, 0x000202da, - 0x82041480, 0x0000001d, 0x04001006, 0x592c0404, - 0x8c00051e, 0x0400000e, 0x42000800, 0x0000001c, - 0x4c500000, 0x4c540000, 0x83cca400, 0x0000000c, - 0x832cac00, 0x0000000d, 0x0401f9c1, 0x5c00a800, - 0x5c00a000, 0x0201f000, 0x000202da, 0x0401f965, - 0x0401f1a0, 0x83380480, 0x00000093, 0x02021800, - 0x001005d8, 0x83380480, 0x00000085, 0x02001800, - 0x001005d8, 0x0c01f001, 0x001089fd, 0x001089fb, - 0x001089fb, 0x00108a04, 0x001089fb, 0x001089fb, - 0x001089fb, 0x001089fb, 0x001089fb, 0x001089fb, - 0x001089fb, 0x001089fb, 0x001089fb, 0x0201f800, - 0x001005d8, 0x4a026203, 0x00000001, 0x493a6403, - 0x42000800, 0x80000040, 0x0201f000, 0x00020721, - 0x4933c857, 0x59cc1204, 0x480a601c, 0x59cc1404, - 0x0201f800, 0x00109410, 0x0400001b, 0x591c0203, - 0x82000580, 0x00000000, 0x04000017, 0x591c0009, - 0x81340580, 0x04020014, 0x4d300000, 0x4d1c0000, - 0x411e6000, 0x0401f9c2, 0x5c023800, 0x5c026000, - 0x0400000b, 0x59cc0005, 0x8c000500, 0x04020003, - 0x0401f98c, 0x0401f003, 0x4a023a03, 0x00000002, - 0x4a026403, 0x00000086, 0x0401f005, 0x0401f9a6, - 0x040007f5, 0x4a026403, 0x00000087, 0x4a026203, - 0x00000001, 0x42000800, 0x80000040, 0x0201f800, - 0x00020721, 0x59340200, 0x8c00050e, 0x0400000d, - 0x59cc1404, 0x0201f800, 0x00109410, 0x04000009, - 0x591c0414, 0x8c00051a, 0x04000006, 0x4d300000, - 0x411e6000, 0x0201f800, 0x0010921e, 0x5c026000, - 0x1c01f000, 0x83380580, 0x00000013, 0x0402000a, - 0x59300403, 0x82000d80, 0x00000086, 0x04000012, - 0x82000d80, 0x00000087, 0x02020800, 0x001005d8, - 0x0401f00d, 0x83380580, 0x00000027, 0x04000005, - 0x83380580, 0x00000014, 0x02020800, 0x001005d8, - 0x493bc857, 0x0201f800, 0x00106bbf, 0x0201f000, - 0x00107911, 0x4933c857, 0x0201f000, 0x00107911, - 0x83380580, 0x00000013, 0x04020005, 0x59300403, - 0x82000480, 0x00000085, 0x0c01f04d, 0x83380580, - 0x00000027, 0x04020041, 0x4933c857, 0x0201f800, - 0x00106bbf, 0x4d3c0000, 0x417a7800, 0x0201f800, - 0x0010203c, 0x5c027800, 0x42003000, 0x00000015, - 0x41782800, 0x42002000, 0x00000003, 0x42028000, - 0x00000029, 0x4d400000, 0x4d440000, 0x59368c03, - 0x0201f800, 0x0010985e, 0x5c028800, 0x5c028000, - 0x42000000, 0x0010b864, 0x0201f800, 0x0010aa47, - 0x0201f800, 0x00109037, 0x0400000c, 0x4d2c0000, - 0x59325808, 0x4a025a04, 0x00000103, 0x59300402, - 0x48025c06, 0x497a5c09, 0x49425a06, 0x0201f800, - 0x000202da, 0x5c025800, 0x0201f800, 0x0010912a, - 0x0201f000, 0x0002077d, 0x83380580, 0x00000089, - 0x04000005, 0x83380580, 0x0000008a, 0x02020000, - 0x00107974, 0x0201f800, 0x00106f60, 0x02020000, - 0x00107974, 0x59300a03, 0x82040580, 0x0000000a, - 0x0400002a, 0x82040580, 0x0000000c, 0x04000027, - 0x0201f800, 0x001005d8, 0x83380580, 0x00000014, - 0x040207ea, 0x4933c857, 0x0201f800, 0x00106bbf, - 0x42028000, 0x00000006, 0x0401f7d2, 0x00108aba, - 0x00108ab8, 0x00108ab8, 0x00108ab8, 0x00108ab8, - 0x00108ab8, 0x00108ac0, 0x00108ab8, 0x00108ab8, - 0x00108ab8, 0x00108ab8, 0x00108ab8, 0x00108ab8, - 0x0201f800, 0x001005d8, 0x4933c857, 0x59a80037, - 0x48026206, 0x4a026203, 0x0000000a, 0x1c01f000, - 0x4933c857, 0x59a80037, 0x48026206, 0x4a026203, - 0x0000000c, 0x1c01f000, 0x83380580, 0x00000089, - 0x04000008, 0x83380580, 0x0000008a, 0x04000032, - 0x4933c857, 0x493bc857, 0x0201f000, 0x00107974, - 0x4933c857, 0x59325808, 0x59300a1d, 0x82040580, - 0x00000003, 0x04020004, 0x0201f800, 0x001049b2, - 0x0401f00c, 0x5930021d, 0x82000580, 0x00000001, - 0x04020008, 0x59300c16, 0x82040580, 0x00000039, - 0x0400002c, 0x82040580, 0x00000035, 0x04000029, - 0x4c340000, 0x41306800, 0x0201f800, 0x0002075a, - 0x04000010, 0x4a026203, 0x00000001, 0x4a026403, - 0x0000001e, 0x59cc0c07, 0x48066419, 0x59cc0a07, - 0x48066219, 0x49366009, 0x4a026406, 0x00000001, - 0x42000800, 0x80000040, 0x0201f800, 0x00020721, - 0x40366000, 0x0201f800, 0x0002077d, 0x5c006800, - 0x1c01f000, 0x4933c857, 0x5930021d, 0x82000580, - 0x00000001, 0x04020040, 0x59300c16, 0x82040580, - 0x00000035, 0x04000007, 0x82040580, 0x0000001e, - 0x04000004, 0x82040580, 0x00000039, 0x04020036, - 0x4933c857, 0x4c500000, 0x4d1c0000, 0x4130a000, - 0x40067000, 0x0201f800, 0x001093ba, 0x04020029, - 0x0201f800, 0x0002075a, 0x04000026, 0x491fc857, - 0x4933c857, 0x83380580, 0x00000035, 0x04000004, - 0x83380580, 0x00000039, 0x04020002, 0x4932381c, - 0x493a6403, 0x4a026203, 0x00000001, 0x4a026406, - 0x00000001, 0x58500809, 0x4807c857, 0x48066009, - 0x58500c15, 0x4807c857, 0x48066415, 0x58500a15, - 0x4807c857, 0x48066215, 0x58500a16, 0x4807c857, - 0x48066216, 0x58500c19, 0x4807c857, 0x48066419, - 0x58500a19, 0x4807c857, 0x48066219, 0x491e601e, - 0x42000800, 0x80000040, 0x0201f800, 0x00020721, - 0x40526000, 0x5c023800, 0x5c00a000, 0x0201f000, - 0x0002077d, 0x5930021d, 0x82000580, 0x00000003, - 0x02000800, 0x001049b2, 0x0201f000, 0x0002077d, - 0x4803c856, 0x4c500000, 0x4c540000, 0x412c7800, - 0x4c3c0000, 0x42002800, 0x00000001, 0x82040480, - 0x00000101, 0x04001003, 0x42000800, 0x00000100, - 0x40043000, 0x42000800, 0x0000001c, 0x83cca400, - 0x0000000c, 0x832cac00, 0x0000000d, 0x0401f844, - 0x82183480, 0x0000001c, 0x592e5801, 0x812e59c0, - 0x02020800, 0x001007fd, 0x0201f800, 0x001007e4, - 0x04000017, 0x80142800, 0x4a025a04, 0x00000110, - 0x497a5c04, 0x492c7801, 0x82180c80, 0x0000003d, - 0x04021006, 0x40180800, 0x832cac00, 0x00000005, - 0x0401f82f, 0x0401f00a, 0x82183480, 0x0000003c, - 0x42000800, 0x0000003c, 0x412c7800, 0x832cac00, - 0x00000005, 0x0401f826, 0x0401f7e8, 0x5c007800, - 0x841429c0, 0x82142d40, 0x00000003, 0x48147a04, - 0x403e5800, 0x5c00a800, 0x5c00a000, 0x1c01f000, - 0x492fc857, 0x812e59c0, 0x0400000f, 0x4d2c0000, - 0x4c3c0000, 0x592c7801, 0x803c79c0, 0x04000006, - 0x497a5801, 0x0201f800, 0x000202da, 0x403e5800, - 0x0401f7f9, 0x5c007800, 0x0201f800, 0x000202da, - 0x5c025800, 0x1c01f000, 0x4803c856, 0x4c580000, - 0x82040c00, 0x00000003, 0x8004b104, 0x0201f800, - 0x0010ab17, 0x5c00b000, 0x1c01f000, 0x4803c856, - 0x4c580000, 0x82040c00, 0x00000003, 0x8004b104, - 0x0201f800, 0x0010ab17, 0x5c00b000, 0x1c01f000, - 0x591c0c06, 0x82040580, 0x00000003, 0x04000004, - 0x82040580, 0x00000002, 0x0402001a, 0x4d300000, - 0x4d2c0000, 0x411e6000, 0x59325808, 0x0201f800, - 0x00109037, 0x0400000f, 0x4d400000, 0x42028000, - 0x00000013, 0x592c0a08, 0x84040d54, 0x0201f800, - 0x00104e70, 0x5c028000, 0x0201f800, 0x0010959c, - 0x0201f800, 0x000202da, 0x0201f800, 0x0010912a, - 0x0201f800, 0x00107911, 0x5c025800, 0x5c026000, - 0x1c01f000, 0x59cc0005, 0x8c000500, 0x0402000b, - 0x591c0406, 0x82000580, 0x00000002, 0x04020007, - 0x591c0c03, 0x82040580, 0x00000085, 0x04000003, - 0x82040580, 0x0000008b, 0x1c01f000, 0x4933c857, - 0x4d3c0000, 0x42027800, 0x00000002, 0x59300406, - 0x82000c80, 0x00000012, 0x02021800, 0x001005d8, - 0x0c01f80a, 0x5c027800, 0x1c01f000, 0x4933c857, - 0x59300406, 0x82000c80, 0x00000012, 0x02021800, - 0x001005d8, 0x0c01f001, 0x00108c01, 0x00108bfe, - 0x00108bfe, 0x00108c29, 0x00108bfc, 0x00108bfe, - 0x00108c1a, 0x00108bfe, 0x00108bfc, 0x001065f4, - 0x00108bfe, 0x00108bfe, 0x00108bfe, 0x00108bfc, - 0x00108bfc, 0x00108bfc, 0x00108cf9, 0x00108bfe, - 0x0201f800, 0x001005d8, 0x4803c856, 0x80000580, - 0x1c01f000, 0x4803c856, 0x8d3e7d02, 0x04020016, - 0x0201f800, 0x00109037, 0x0400000f, 0x59325808, - 0x41780800, 0x4d400000, 0x42028000, 0x00000005, - 0x0201f800, 0x00104e70, 0x5c028000, 0x0201f800, - 0x0010959c, 0x0201f800, 0x001091cc, 0x0201f800, - 0x000202da, 0x0201f800, 0x00107911, 0x82000540, - 0x00000001, 0x1c01f000, 0x4933c857, 0x0201f800, - 0x001048d9, 0x0402000c, 0x4d400000, 0x42028000, - 0x00000010, 0x0201f800, 0x0010a1d1, 0x4a026406, - 0x00000006, 0x4a026203, 0x00000007, 0x5c028000, - 0x1c01f000, 0x4933c857, 0x0201f800, 0x00106c55, - 0x4df00000, 0x0401f8b8, 0x82000c80, 0x0000000e, - 0x02021800, 0x001005d8, 0x0c01f001, 0x00108c43, - 0x00108cb0, 0x00108c5a, 0x00108cc3, 0x00108cab, - 0x00108c41, 0x00108c43, 0x00108c43, 0x00108c47, - 0x00108c43, 0x00108c43, 0x00108c43, 0x00108c43, - 0x00108c5a, 0x0201f800, 0x001005d8, 0x5c03e000, - 0x02000800, 0x00106c4b, 0x0401f7b8, 0x5c03e000, - 0x02000800, 0x00106c4b, 0x59300406, 0x82000580, - 0x00000003, 0x040207b4, 0x59300203, 0x82000580, - 0x0000000d, 0x040007b0, 0x8d3e7d02, 0x040207ae, - 0x4d340000, 0x59326809, 0x0201f800, 0x001049b2, - 0x5c026800, 0x0401f7a8, 0x59300004, 0x8400055c, - 0x48026004, 0x0201f800, 0x00106c4b, 0x59300406, - 0x82000580, 0x00000006, 0x04000043, 0x8d3e7d02, - 0x04020041, 0x497a621d, 0x59300203, 0x82000580, - 0x0000000d, 0x04000003, 0x4a02621d, 0x00000003, - 0x0401fbcb, 0x04000024, 0x4d2c0000, 0x4d400000, - 0x59325808, 0x0201f800, 0x001091cc, 0x592c0408, - 0x8c000512, 0x04000009, 0x4d2c0000, 0x84000512, - 0x48025c08, 0x592c0809, 0x40065800, 0x0201f800, - 0x001007fd, 0x5c025800, 0x4d400000, 0x42028000, - 0x00000005, 0x592c0a08, 0x8c040d0e, 0x04000004, - 0x42028000, 0x00000002, 0x0401f001, 0x0201f800, - 0x00104e70, 0x5c028000, 0x0201f800, 0x0010959c, - 0x0201f800, 0x000202da, 0x497a6008, 0x5c028000, - 0x5c025800, 0x8d3e7d00, 0x04000009, 0x4d340000, - 0x59326809, 0x0201f800, 0x001049b2, 0x5c026800, - 0x0201f800, 0x00107911, 0x0401f00b, 0x4a026403, - 0x00000085, 0x4a026203, 0x00000009, 0x4a026406, - 0x00000002, 0x42000800, 0x8000404b, 0x0201f800, - 0x00020721, 0x5c03e000, 0x02020800, 0x00106c55, - 0x82000540, 0x00000001, 0x1c01f000, 0x0201f800, - 0x00106c4b, 0x0201f800, 0x00100e99, 0x0401f7ab, - 0x598c000d, 0x81300580, 0x04020004, 0x0201f800, - 0x00106e8e, 0x0402001b, 0x0201f800, 0x001068d3, - 0x04020006, 0x59300c03, 0x82040580, 0x00000040, - 0x0400078b, 0x0401f79d, 0x0201f800, 0x00106b6c, - 0x04000010, 0x0201f800, 0x001005d8, 0x0401f813, - 0x04020004, 0x0201f800, 0x00106e62, 0x04020009, - 0x0201f800, 0x001067ae, 0x040207f4, 0x59300c03, - 0x82040580, 0x00000040, 0x04000779, 0x0401f78b, - 0x59300203, 0x82000c80, 0x0000000e, 0x02021800, - 0x001005d8, 0x0c01f75e, 0x417a3000, 0x42032000, - 0x0000bf32, 0x59900004, 0x81300580, 0x04000009, - 0x83932400, 0x00000010, 0x811a3000, 0x83180480, - 0x00000005, 0x040017f8, 0x82000540, 0x00000001, - 0x1c01f000, 0x59300004, 0x8c00053e, 0x04000010, - 0x8c00050c, 0x0402000e, 0x8c000516, 0x04020006, - 0x82000d00, 0x0000001f, 0x82040580, 0x00000005, - 0x04020004, 0x42000000, 0x00000003, 0x0401f005, - 0x42000000, 0x00000001, 0x0401f002, 0x59300203, - 0x1c01f000, 0x4933c857, 0x0201f800, 0x00106c55, - 0x4df00000, 0x59300203, 0x82000c80, 0x0000000e, - 0x02021800, 0x001005d8, 0x0c01f001, 0x00108d13, - 0x00108d30, 0x00108d17, 0x00108d11, 0x00108d11, - 0x00108d11, 0x00108d11, 0x00108d11, 0x00108d11, - 0x00108d11, 0x00108d11, 0x00108d11, 0x00108d11, - 0x00108d11, 0x0201f800, 0x001005d8, 0x5c03e000, - 0x02000800, 0x00106c4b, 0x0401f6e8, 0x5c03e000, - 0x02000800, 0x00106c4b, 0x4d2c0000, 0x59325808, - 0x59300403, 0x82000580, 0x00000052, 0x02000800, - 0x00101231, 0x0401fb16, 0x02000800, 0x001005d8, - 0x4a025a06, 0x00000005, 0x0201f800, 0x000202da, - 0x0201f800, 0x00104c19, 0x0201f800, 0x00107911, - 0x5c025800, 0x82000540, 0x00000001, 0x1c01f000, - 0x598c000d, 0x81300580, 0x0402001a, 0x59300004, - 0x8c000520, 0x04000004, 0x84000520, 0x48026004, - 0x0401f01a, 0x42001000, 0x0010b7f6, 0x50081000, - 0x58080002, 0x82000580, 0x00000100, 0x0400000a, - 0x5808000c, 0x81300580, 0x02020800, 0x001005d8, - 0x0201f800, 0x001068d3, 0x02020800, 0x001005d8, - 0x0401f7cf, 0x0201f800, 0x00106e8e, 0x0402000c, - 0x59300004, 0x8c000520, 0x04000004, 0x84000520, - 0x48026004, 0x0401f7c6, 0x0201f800, 0x001068d3, - 0x040007c3, 0x0201f800, 0x001005d8, 0x59300203, - 0x82000c80, 0x0000000e, 0x02021800, 0x001005d8, - 0x0c01f7a7, 0x59300406, 0x4933c857, 0x4803c857, - 0x82000c80, 0x00000012, 0x02021800, 0x001005d8, - 0x0c01f001, 0x00108d7c, 0x00108e41, 0x00108f79, - 0x00108d88, 0x00107911, 0x00108d7c, 0x0010a1c0, - 0x0002077d, 0x00108e41, 0x001065ce, 0x00108fda, - 0x00108d77, 0x00108d77, 0x00108d77, 0x00108d77, - 0x00108d77, 0x001096eb, 0x001096eb, 0x0201f800, - 0x001005d8, 0x0401fbd5, 0x02000000, 0x0010801c, - 0x1c01f000, 0x0201f800, 0x00106c55, 0x0201f800, - 0x00106bbf, 0x0201f800, 0x00106c4b, 0x0201f000, - 0x0002077d, 0x4a026206, 0x00000001, 0x1c01f000, - 0x42000000, 0x0010b872, 0x0201f800, 0x0010aa47, - 0x4d2c0000, 0x4d400000, 0x417a5800, 0x0401faa8, - 0x04000007, 0x59325808, 0x592c0208, 0x8400054c, - 0x48025a08, 0x42028000, 0x00000006, 0x0201f800, - 0x00106c55, 0x0401ff4c, 0x4803c857, 0x82000c80, - 0x0000000e, 0x02021800, 0x001005d8, 0x0c01f806, - 0x0201f800, 0x00106c4b, 0x5c028000, 0x5c025800, - 0x1c01f000, 0x00108e40, 0x00108db5, 0x00108dc3, - 0x00108de5, 0x00108e11, 0x00108db3, 0x00108d7c, - 0x00108d7c, 0x00108d7c, 0x00108db3, 0x00108db3, - 0x00108db3, 0x00108db3, 0x00108dc3, 0x0201f800, - 0x001005d8, 0x598c000d, 0x81300580, 0x04020004, - 0x0201f800, 0x00106e8e, 0x04020038, 0x0201f800, - 0x001068d3, 0x0400003b, 0x0201f800, 0x00106b6c, - 0x04000032, 0x0201f800, 0x001005d8, 0x497a621d, - 0x812e59c0, 0x02000800, 0x001005d8, 0x592c0204, - 0x82000500, 0x000000ff, 0x82000580, 0x00000014, - 0x04000003, 0x4a02621d, 0x00000003, 0x592c0a08, - 0x0201f800, 0x00104e70, 0x0201f800, 0x0010959c, - 0x0201f800, 0x000202da, 0x497a6008, 0x4a026403, - 0x00000085, 0x4a026203, 0x00000009, 0x4a026406, - 0x00000002, 0x4a026004, 0x8000404b, 0x0201f800, - 0x00106c4b, 0x42000800, 0x8000404b, 0x0201f000, - 0x00020721, 0x0401fef1, 0x04020004, 0x0201f800, - 0x00106e62, 0x04020009, 0x0201f800, 0x001067ae, - 0x040207d2, 0x59300c03, 0x82040580, 0x00000040, - 0x04000008, 0x0401f7d2, 0x59300203, 0x82000c80, - 0x0000000e, 0x02021800, 0x001005d8, 0x0c01f7ae, - 0x0201f800, 0x00106c4b, 0x812e59c0, 0x04000013, - 0x592c0a08, 0x0201f800, 0x00104e70, 0x0201f800, - 0x0010959c, 0x0201f800, 0x000202da, 0x59300203, - 0x82000580, 0x0000000d, 0x04000008, 0x0201f800, - 0x00106c4b, 0x4d340000, 0x59326809, 0x0201f800, - 0x001049b2, 0x5c026800, 0x0201f800, 0x00107911, - 0x0401f030, 0x812e59c0, 0x02000800, 0x001005d8, - 0x0201f800, 0x0010940a, 0x04020004, 0x0201f800, - 0x00100e99, 0x0401f7aa, 0x0201f800, 0x00106c4b, - 0x592c0208, 0x8400050c, 0x48025a08, 0x592c0406, - 0x800000c2, 0x800008c4, 0x80040c00, 0x48066206, - 0x42000000, 0x10000000, 0x41300800, 0x0201f800, - 0x00100b94, 0x0400000d, 0x592c0208, 0x8c00051c, - 0x04020006, 0x8400055c, 0x48025a08, 0x4a026206, - 0x00000002, 0x0401f00f, 0x4d300000, 0x0201f800, - 0x001012e5, 0x5c026000, 0x59300203, 0x82000580, - 0x00000004, 0x04020007, 0x4d380000, 0x42027000, - 0x00000048, 0x0201f800, 0x000207a1, 0x5c027000, - 0x1c01f000, 0x42000000, 0x0010b86e, 0x0201f800, - 0x0010aa47, 0x59300203, 0x82000c80, 0x0000000e, - 0x02021800, 0x001005d8, 0x4803c857, 0x0c01f001, - 0x00108e5a, 0x00108d85, 0x00108e5c, 0x00108e5a, - 0x00108e5c, 0x00108e5c, 0x00108d7d, 0x00108e5a, - 0x00108d79, 0x00108e5a, 0x00108e5a, 0x00108e5a, - 0x00108e5a, 0x00108e5a, 0x0201f800, 0x001005d8, - 0x4d340000, 0x4d2c0000, 0x59326809, 0x59340400, - 0x82000500, 0x000000ff, 0x82000c80, 0x0000000c, - 0x02021800, 0x001005d8, 0x59303403, 0x82180d80, - 0x00000004, 0x04020004, 0x42000000, 0x00000001, - 0x0401f006, 0x82180d80, 0x00000000, 0x04020003, - 0x42000000, 0x00000001, 0x4803c857, 0x0c01f804, - 0x5c025800, 0x5c026800, 0x1c01f000, 0x00108e83, - 0x00108f22, 0x00108e85, 0x00108eba, 0x00108e85, - 0x00108f3f, 0x00108e85, 0x00108e8f, 0x00108e83, - 0x00108f3f, 0x00108e83, 0x00108e9e, 0x0201f800, - 0x001005d8, 0x59300403, 0x82000d80, 0x00000016, - 0x0400002e, 0x82000d80, 0x00000004, 0x0400002b, - 0x82000d80, 0x00000002, 0x04000028, 0x0401fabf, - 0x04000079, 0x59300403, 0x82000d80, 0x00000022, - 0x040000ae, 0x82000d80, 0x00000039, 0x040000b3, - 0x82000d80, 0x00000035, 0x040000b0, 0x82000d80, - 0x0000001e, 0x0400001b, 0x0401f999, 0x04000007, - 0x0201f800, 0x00109597, 0x04020004, 0x0201f800, - 0x00104a14, 0x0401f011, 0x59300403, 0x82000d80, - 0x00000001, 0x04020004, 0x0201f800, 0x001049e7, - 0x0400000a, 0x4d3c0000, 0x417a7800, 0x0201f800, - 0x0010203c, 0x5c027800, 0x42000000, 0x0010b864, - 0x0201f800, 0x0010aa47, 0x0201f800, 0x0010801c, - 0x0201f000, 0x00107911, 0x0401f97d, 0x04000004, - 0x0201f800, 0x00109597, 0x040000a9, 0x59300c03, - 0x82040580, 0x00000016, 0x04000056, 0x82040580, - 0x00000002, 0x04020034, 0x59a80026, 0x8c000502, - 0x04020013, 0x0201f800, 0x0010513b, 0x04020010, - 0x0201f800, 0x00105151, 0x04020006, 0x42000000, - 0x00000001, 0x0201f800, 0x00105113, 0x0401f094, - 0x4a035033, 0x00000001, 0x4202d800, 0x00000001, - 0x0201f800, 0x001050a2, 0x0401f08d, 0x59340403, - 0x82000580, 0x000007fc, 0x04000008, 0x59a80026, - 0x8c00050a, 0x04020084, 0x59340212, 0x82000500, - 0x0000ff00, 0x04000082, 0x59340412, 0x82000500, - 0x000000ff, 0x04000010, 0x80000040, 0x48026c12, - 0x497a6008, 0x4a026406, 0x00000007, 0x4a026206, - 0x00000398, 0x497a6205, 0x0201f800, 0x0002075a, - 0x04000005, 0x49366009, 0x4a026406, 0x00000001, - 0x0401f020, 0x59300403, 0x82000d80, 0x00000002, - 0x0402000d, 0x59340403, 0x82000580, 0x000007fe, - 0x04020009, 0x59a80026, 0x84000540, 0x48035026, - 0x0201f800, 0x00104237, 0x0201f800, 0x0010801c, - 0x0401f00c, 0x0201f800, 0x0010801c, 0x4d3c0000, - 0x417a7800, 0x0201f800, 0x0010203c, 0x5c027800, - 0x42000000, 0x0010b864, 0x0201f800, 0x0010aa47, - 0x0201f800, 0x00102074, 0x0201f000, 0x00107911, - 0x42000800, 0x00000003, 0x0201f800, 0x00104571, - 0x4a026203, 0x00000001, 0x4a026403, 0x00000002, - 0x0201f000, 0x0010672b, 0x0401f915, 0x04020793, - 0x0201f800, 0x00102074, 0x4d3c0000, 0x417a7800, - 0x0201f800, 0x0010203c, 0x5c027800, 0x42000000, - 0x0010b864, 0x0201f800, 0x0010aa47, 0x42003000, - 0x00000018, 0x41782800, 0x42002000, 0x00000000, - 0x4d400000, 0x4d440000, 0x59368c03, 0x42028000, - 0x00000029, 0x0201f800, 0x0010985e, 0x5c028800, - 0x5c028000, 0x0201f000, 0x00107911, 0x0201f800, - 0x00104a14, 0x0401f7c8, 0x42000000, 0x0010b86d, - 0x0201f800, 0x0010aa47, 0x0201f800, 0x00107b76, - 0x040207c1, 0x1c01f000, 0x4d380000, 0x59327403, - 0x0201f800, 0x001093ba, 0x5c027000, 0x02020000, - 0x0002077d, 0x836c0580, 0x00000003, 0x04000004, - 0x4a026206, 0x00000002, 0x1c01f000, 0x59300403, - 0x48026416, 0x4a02621d, 0x00000001, 0x4a026403, - 0x00000085, 0x4a026203, 0x00000009, 0x4a026406, - 0x00000002, 0x42000800, 0x8000004b, 0x0201f000, - 0x00020721, 0x0201f800, 0x00102074, 0x0201f800, - 0x0010801c, 0x4d3c0000, 0x417a7800, 0x0201f800, - 0x0010203c, 0x5c027800, 0x42000000, 0x0010b864, - 0x0201f800, 0x0010aa47, 0x497a6008, 0x4a026406, - 0x00000007, 0x4a026206, 0x00000398, 0x497a6205, - 0x1c01f000, 0x42000000, 0x0010b870, 0x0201f800, - 0x0010aa47, 0x4d340000, 0x59326809, 0x59300203, - 0x82000c80, 0x0000000e, 0x02021800, 0x001005d8, - 0x4803c857, 0x0c01f803, 0x5c026800, 0x1c01f000, - 0x00108f96, 0x00108d85, 0x00108f96, 0x00108f96, - 0x00108f96, 0x00108f96, 0x00108f96, 0x00108f96, - 0x00108f96, 0x00108d85, 0x00108f98, 0x00108d85, - 0x00108fa0, 0x00108f96, 0x0201f800, 0x001005d8, - 0x4a026403, 0x0000008b, 0x4a026203, 0x0000000b, - 0x42000800, 0x8000404b, 0x0201f000, 0x00020721, - 0x59300a1d, 0x4d3c0000, 0x417a7800, 0x0201f800, - 0x0010203c, 0x5c027800, 0x42003000, 0x00000011, - 0x0201f800, 0x0010a942, 0x42000000, 0x0010b864, - 0x0201f800, 0x0010aa47, 0x41306800, 0x0201f800, - 0x0002075a, 0x04000008, 0x49366009, 0x4d300000, - 0x40366000, 0x0201f800, 0x00107911, 0x5c026000, - 0x0401f002, 0x40366000, 0x497a6008, 0x4a026406, - 0x00000001, 0x4a026403, 0x00000001, 0x0201f800, - 0x00103b25, 0x04000011, 0x4a026406, 0x00000004, - 0x4a026203, 0x00000007, 0x4a026420, 0x00000001, - 0x42003000, 0x00000004, 0x4d400000, 0x42028000, - 0x00000029, 0x41782800, 0x0201f800, 0x0010a43e, - 0x5c028000, 0x1c01f000, 0x42000800, 0x0000000b, - 0x0201f800, 0x00104571, 0x4a026203, 0x00000001, - 0x0201f000, 0x0010672b, 0x42000000, 0x0010b876, - 0x0201f800, 0x0010aa47, 0x59300203, 0x82000c80, - 0x0000000e, 0x02021800, 0x001005d8, 0x4803c857, - 0x0c01f001, 0x0010900b, 0x00108ff3, 0x00108ff7, - 0x0010900c, 0x00108ff5, 0x00108ff3, 0x00108ff3, - 0x00108ff3, 0x00108ff3, 0x00108ff3, 0x00108ff3, - 0x00108ff3, 0x00108ff3, 0x00108ff3, 0x0201f800, - 0x001005d8, 0x0201f800, 0x00100e99, 0x4d2c0000, - 0x59325808, 0x4a025a06, 0x00000006, 0x0201f800, - 0x000202da, 0x5c025800, 0x497a6008, 0x4a02621d, - 0x0000000a, 0x4a026403, 0x00000085, 0x4a026203, - 0x00000009, 0x4a026406, 0x00000002, 0x42000800, - 0x8000404b, 0x0201f000, 0x00020721, 0x1c01f000, - 0x0201f800, 0x00106c55, 0x4df00000, 0x0401fcc7, - 0x04020004, 0x0201f800, 0x00106e62, 0x0402000c, - 0x0201f800, 0x001067ae, 0x04020005, 0x5c03e000, - 0x0201f800, 0x00106c4b, 0x0401f7dd, 0x0201f800, - 0x00106b6c, 0x02020800, 0x001005d8, 0x5c03e000, - 0x0201f800, 0x00106c4b, 0x59300203, 0x82000d80, - 0x00000003, 0x02000800, 0x001005d8, 0x82000c80, - 0x0000000e, 0x02021800, 0x001005d8, 0x0c01f7ba, - 0x4803c856, 0x59a8000e, 0x59a80867, 0x80040400, - 0x80080480, 0x04021004, 0x82000540, 0x00000001, - 0x1c01f000, 0x80000580, 0x1c01f000, 0x4803c856, - 0x4c080000, 0x59301008, 0x82081500, 0xfff00000, - 0x5c001000, 0x1c01f000, 0x4803c856, 0x4d300000, - 0x0201f800, 0x0002075a, 0x0400000a, 0x0401f82f, - 0x4d380000, 0x42027000, 0x0000004b, 0x0201f800, - 0x000207a1, 0x5c027000, 0x82000540, 0x00000001, - 0x5c026000, 0x1c01f000, 0x4803c856, 0x4d300000, - 0x0201f800, 0x00107942, 0x0400001b, 0x0401f81f, - 0x4d300000, 0x0201f800, 0x00106c55, 0x4d3c0000, - 0x417a7800, 0x0201f800, 0x00106ab4, 0x0201f800, - 0x001067fd, 0x5c027800, 0x0201f800, 0x0010a2ff, - 0x0201f800, 0x00106c4b, 0x5c026000, 0x8d3e7d3e, - 0x0402000b, 0x4d380000, 0x42027000, 0x0000004c, - 0x0201f800, 0x000207a1, 0x5c027000, 0x82000540, - 0x00000001, 0x5c026000, 0x1c01f000, 0x0201f800, - 0x0002077d, 0x0401f7fa, 0x592c0407, 0x494a6017, - 0x494e6018, 0x49366009, 0x492e6008, 0x4a026406, - 0x00000003, 0x800000c2, 0x800008c4, 0x80040400, - 0x48026206, 0x1c01f000, 0x493bc857, 0x4d300000, - 0x0201f800, 0x0002075a, 0x0400000d, 0x0401ffef, - 0x4d400000, 0x42028000, 0x00000005, 0x0401f80d, - 0x5c028000, 0x8d3e7d3e, 0x04020007, 0x0201f800, - 0x000207a1, 0x82000540, 0x00000001, 0x5c026000, - 0x1c01f000, 0x0201f800, 0x0002077d, 0x0401f7fa, - 0x4803c856, 0x0201f800, 0x00106c55, 0x4d3c0000, - 0x4d440000, 0x59368c03, 0x42027800, 0x00000001, - 0x0201f800, 0x001069b6, 0x0201f800, 0x0010692e, - 0x0201f800, 0x001067fd, 0x0201f800, 0x0010a2ff, - 0x5c028800, 0x5c027800, 0x0201f000, 0x00106c4b, - 0x4803c856, 0x4d300000, 0x0201f800, 0x0002075a, - 0x0400000f, 0x481a601c, 0x48ee6021, 0x49366009, - 0x4a026406, 0x00000001, 0x492e6008, 0x4d380000, - 0x42027000, 0x0000001f, 0x0201f800, 0x000207a1, - 0x5c027000, 0x82000540, 0x00000001, 0x5c026000, - 0x1c01f000, 0x4803c856, 0x4d300000, 0x0201f800, - 0x0002075a, 0x0400000e, 0x48ee6021, 0x49366009, - 0x4a026406, 0x00000001, 0x492e6008, 0x4d380000, - 0x42027000, 0x00000055, 0x0201f800, 0x000207a1, - 0x5c027000, 0x82000540, 0x00000001, 0x5c026000, - 0x1c01f000, 0x4803c856, 0x4d300000, 0x0201f800, - 0x0002075a, 0x0400000f, 0x481a601c, 0x48ee6021, - 0x49366009, 0x4a026406, 0x00000001, 0x492e6008, - 0x4d380000, 0x42027000, 0x0000003d, 0x0201f800, - 0x000207a1, 0x5c027000, 0x82000540, 0x00000001, - 0x5c026000, 0x1c01f000, 0x4803c856, 0x4d300000, - 0x0201f800, 0x00107942, 0x04000014, 0x49366009, - 0x492fc857, 0x4933c857, 0x592c0404, 0x8c00051e, - 0x04000003, 0x48efc857, 0x48ee6021, 0x4a026406, - 0x00000001, 0x492e6008, 0x4d380000, 0x42027000, - 0x00000000, 0x0201f800, 0x000207a1, 0x5c027000, - 0x82000540, 0x00000001, 0x5c026000, 0x1c01f000, - 0x4803c856, 0x4d300000, 0x0201f800, 0x0002075a, - 0x0400000f, 0x48ee6021, 0x481a601c, 0x49366009, - 0x4a026406, 0x00000001, 0x492e6008, 0x4d380000, - 0x42027000, 0x00000044, 0x0201f800, 0x000207a1, - 0x5c027000, 0x82000540, 0x00000001, 0x5c026000, - 0x1c01f000, 0x4803c856, 0x4d300000, 0x0201f800, - 0x0002075a, 0x0400000f, 0x481a601c, 0x48ee6021, - 0x49366009, 0x4a026406, 0x00000001, 0x492e6008, - 0x4d380000, 0x42027000, 0x00000049, 0x0201f800, - 0x000207a1, 0x5c027000, 0x82000540, 0x00000001, - 0x5c026000, 0x1c01f000, 0x59300009, 0x80001540, - 0x02000800, 0x001005d8, 0x5808040b, 0x4803c856, - 0x80000040, 0x04001002, 0x4800140b, 0x1c01f000, - 0x4803c856, 0x59300403, 0x82000d80, 0x00000002, - 0x04000015, 0x82000d80, 0x00000003, 0x04000012, - 0x82000d80, 0x00000004, 0x0400000f, 0x82000d80, - 0x00000008, 0x0400000c, 0x82000d80, 0x0000000a, - 0x04000009, 0x599c0819, 0x8c040d0e, 0x04000004, - 0x82000d80, 0x00000000, 0x04000003, 0x82000540, - 0x00000001, 0x1c01f000, 0x4803c856, 0x4c000000, - 0x4d2c0000, 0x59300406, 0x82000580, 0x00000004, - 0x0400001d, 0x59300008, 0x80025d40, 0x800001c0, - 0x04000019, 0x0201f800, 0x00109597, 0x04000014, - 0x59300406, 0x82004580, 0x00000010, 0x04000010, - 0x82004580, 0x00000011, 0x0400000d, 0x82004580, - 0x00000003, 0x0400000c, 0x82004580, 0x00000002, - 0x04000009, 0x82004580, 0x0000000a, 0x04000006, - 0x592c0404, 0x8c00051e, 0x04000003, 0x80000580, - 0x0401f003, 0x82000540, 0x00000001, 0x5c025800, - 0x5c000000, 0x1c01f000, 0x4803c856, 0x4d300000, - 0x0201f800, 0x00107942, 0x04000013, 0x49366009, - 0x48ee6021, 0x4a026406, 0x00000001, 0x492e6008, - 0x4d3c0000, 0x417a7800, 0x0201f800, 0x0010203c, - 0x5c027800, 0x4d380000, 0x42027000, 0x00000028, - 0x0201f800, 0x000207a1, 0x5c027000, 0x82000540, - 0x00000001, 0x5c026000, 0x1c01f000, 0x4803c856, - 0x83380580, 0x00000015, 0x0402000d, 0x59a80016, - 0x82000580, 0x00000074, 0x04020009, 0x0201f800, - 0x0010462a, 0x4a026203, 0x00000001, 0x4a026403, - 0x00000029, 0x0201f000, 0x0010672b, 0x0201f800, - 0x0010801c, 0x0201f000, 0x0002077d, 0x4803c856, - 0x83380580, 0x00000016, 0x04020007, 0x42000800, - 0x00000004, 0x0201f800, 0x00104571, 0x0201f000, - 0x00107b38, 0x83380580, 0x00000015, 0x04020013, - 0x59a80016, 0x82000580, 0x00000014, 0x0402000f, - 0x0201f800, 0x0010468d, 0x0201f800, 0x0010846f, - 0x0402000a, 0x59340404, 0x80000540, 0x04000007, - 0x42000800, 0x00000006, 0x0201f800, 0x00104571, - 0x0201f000, 0x00107b38, 0x0201f800, 0x0010801c, - 0x0201f000, 0x0002077d, 0x4803c856, 0x592c0206, - 0x82000580, 0x00000005, 0x04000002, 0x1c01f000, - 0x4803c856, 0x592c0208, 0x8400054a, 0x48025a08, - 0x1c01f000, 0x497a6205, 0x497a6008, 0x4a026203, - 0x00000001, 0x4a026403, 0x00000050, 0x42000800, - 0x80000043, 0x0201f000, 0x00020721, 0x4933c857, - 0x4d340000, 0x59326809, 0x59340200, 0x8c00050e, - 0x04000006, 0x59300406, 0x82000c80, 0x00000012, - 0x04021004, 0x0c01f806, 0x5c026800, 0x1c01f000, - 0x0201f800, 0x00108d7c, 0x0401f7fc, 0x00108d7c, - 0x001091fd, 0x00109201, 0x00109204, 0x0010a49b, - 0x0010a4b8, 0x0010a4bc, 0x00108d7c, 0x00108d7c, - 0x00108d7c, 0x00108d7c, 0x00108d7c, 0x00108d7c, - 0x00108d7c, 0x00108d7c, 0x00108d7c, 0x00108d7c, - 0x00108d7c, 0x4803c856, 0x40000000, 0x40000000, - 0x1c01f000, 0x40000000, 0x40000000, 0x1c01f000, - 0x5930001c, 0x4803c857, 0x59300414, 0x4933c857, - 0x4803c857, 0x8c000502, 0x04000005, 0x84000502, - 0x84000540, 0x48026414, 0x1c01f000, 0x42000000, - 0xd0000000, 0x41300800, 0x0201f800, 0x00100b94, - 0x0401f80a, 0x04020008, 0x59a80037, 0x82000400, - 0x0000000a, 0x48026205, 0x59300414, 0x84000542, - 0x48026414, 0x1c01f000, 0x4933c857, 0x4d340000, - 0x59326809, 0x59340200, 0x8c00050e, 0x02000800, - 0x001005d8, 0x5930001c, 0x80000540, 0x0402002f, - 0x59a80021, 0x80000540, 0x0402002a, 0x4d1c0000, - 0x41323800, 0x0201f800, 0x0002075a, 0x04000023, - 0x4932381c, 0x591c0414, 0x84000542, 0x48023c14, - 0x49366009, 0x591c0406, 0x82000580, 0x00000003, - 0x04000006, 0x591c0202, 0x48026419, 0x591c0402, - 0x48026219, 0x0401f005, 0x591c0202, 0x48026219, - 0x591c0402, 0x48026419, 0x491e601e, 0x4a026406, - 0x00000001, 0x4a026403, 0x00000035, 0x4a026203, - 0x00000001, 0x42000800, 0x80000040, 0x0201f800, - 0x00020721, 0x411e6000, 0x5c023800, 0x80000580, - 0x5c026800, 0x1c01f000, 0x411e6000, 0x5c023800, - 0x59a80039, 0x48026205, 0x82000540, 0x00000001, - 0x0401f7f8, 0x4933c857, 0x4d2c0000, 0x4932381c, - 0x4a026202, 0x0000ffff, 0x591e5808, 0x591c0007, - 0x8c00051e, 0x04000005, 0x8400051e, 0x48023807, - 0x497a5c09, 0x0401f014, 0x592c0408, 0x8c000518, - 0x04000011, 0x84000518, 0x48025c08, 0x4a025c09, - 0x00000001, 0x0401fb2f, 0x497a5c09, 0x592c0408, - 0x8c000512, 0x04000008, 0x4d2c0000, 0x84000512, - 0x48025c08, 0x592e5809, 0x0201f800, 0x001007fd, - 0x5c025800, 0x59a80039, 0x48026205, 0x591c0214, - 0x48026216, 0x82000d80, 0x00000001, 0x04000008, - 0x4a023a03, 0x00000002, 0x82000580, 0x00000005, - 0x04000008, 0x497a6015, 0x0401f01e, 0x591c0007, - 0x84000540, 0x48023807, 0x4a023a03, 0x00000004, - 0x591c0414, 0x4803c857, 0x8400051c, 0x84000554, - 0x48023c14, 0x592c000f, 0x40001000, 0x591c0816, - 0x80040480, 0x040217f0, 0x591c0016, 0x82000500, - 0xfffffffc, 0x48026015, 0x48023816, 0x591c0a14, - 0x4807c857, 0x82040d80, 0x00000005, 0x04020005, - 0x480bc857, 0x4803c857, 0x4a023812, 0xffffffff, - 0x591c0402, 0x48026419, 0x591c0202, 0x48026219, - 0x591e6809, 0x49366009, 0x4a026406, 0x00000001, - 0x4a026403, 0x00000039, 0x4a026203, 0x00000001, - 0x42000800, 0x80000040, 0x0201f800, 0x00020721, - 0x5c025800, 0x1c01f000, 0x4933c857, 0x59300414, - 0x8c000514, 0x04000015, 0x8c00051c, 0x04020012, - 0x59300016, 0x80100480, 0x04001006, 0x04000005, - 0x59300414, 0x84000514, 0x8400055c, 0x0401f009, - 0x48126016, 0x48126012, 0x40100000, 0x592c180f, - 0x800c0480, 0x48026011, 0x59300414, 0x84000514, - 0x48026414, 0x1c01f000, 0x4933c857, 0x8c00051c, - 0x04020006, 0x59300012, 0x48026016, 0x59300414, - 0x8400055c, 0x48026414, 0x1c01f000, 0x59300c03, - 0x4933c857, 0x4807c857, 0x82040480, 0x00000034, - 0x04001006, 0x82040480, 0x0000003c, 0x04021003, - 0x80000580, 0x1c01f000, 0x82000540, 0x00000001, - 0x0401f7fd, 0x41780800, 0x59a81035, 0x42000000, - 0x00000032, 0x0201f800, 0x001066a0, 0x800811c0, - 0x04020003, 0x42001000, 0x00000014, 0x480b5037, - 0x59a81036, 0x480b502d, 0x41780800, 0x42000000, - 0x00000064, 0x0201f800, 0x001066a0, 0x800811c0, - 0x04020003, 0x42001000, 0x00000014, 0x480b5038, - 0x82081400, 0x0000000a, 0x480b5039, 0x42000800, - 0x00000001, 0x0201f800, 0x00106c78, 0x42000000, - 0x30000000, 0x40080800, 0x0201f800, 0x00100b68, - 0x42000800, 0x00000003, 0x59a81010, 0x0201f800, - 0x00106c78, 0x0201f000, 0x00104906, 0x4a035037, - 0x00000028, 0x4a035038, 0x00000014, 0x4a03502d, - 0x000007d0, 0x42001000, 0x0000001e, 0x480b5039, - 0x42000800, 0x00000001, 0x0201f800, 0x00106c78, - 0x42000000, 0x30000000, 0x40080800, 0x0201f800, - 0x00100b68, 0x42000800, 0x00000003, 0x59a81010, - 0x0201f000, 0x00106c78, 0x4933c857, 0x4d2c0000, - 0x59300403, 0x82000580, 0x0000003e, 0x04020005, - 0x59325817, 0x812e59c0, 0x02020800, 0x001007f4, - 0x5c025800, 0x1c01f000, 0x4937c857, 0x4d300000, - 0x0201f800, 0x0002075a, 0x04000011, 0x49366009, - 0x4a026406, 0x00000001, 0x492e6008, 0x42000800, - 0x00000009, 0x0201f800, 0x00104571, 0x4d380000, - 0x42027000, 0x00000033, 0x0201f800, 0x000207a1, - 0x5c027000, 0x82000540, 0x00000001, 0x5c026000, - 0x1c01f000, 0x4933c857, 0x4d2c0000, 0x4c580000, - 0x4d3c0000, 0x59325808, 0x83380580, 0x00000015, - 0x04020022, 0x59a8b016, 0x82580c80, 0x00000019, - 0x04001003, 0x4200b000, 0x00000018, 0x8058b104, - 0x0401fa07, 0x80000580, 0x0401fa17, 0x832cac00, - 0x00000009, 0x83cca400, 0x00000006, 0x0201f800, - 0x0010ab17, 0x42027800, 0x00000001, 0x592c100a, - 0x8c081518, 0x04020006, 0x59a80010, 0x592c100d, - 0x80080580, 0x04020006, 0x417a7800, 0x59301009, - 0x58081403, 0x0201f800, 0x001020a1, 0x0201f800, - 0x00107b38, 0x0401f008, 0x4200b000, 0x00000002, - 0x0401fa09, 0x0201f800, 0x0010801c, 0x0201f800, - 0x0002077d, 0x5c027800, 0x5c00b000, 0x5c025800, - 0x1c01f000, 0x4933c856, 0x49366009, 0x4a026406, - 0x00000001, 0x492e6008, 0x4d380000, 0x42027000, - 0x0000004d, 0x0201f800, 0x000207a1, 0x5c027000, - 0x82000540, 0x00000001, 0x1c01f000, 0x4803c856, - 0x4d2c0000, 0x83380580, 0x00000015, 0x04020027, - 0x59a80816, 0x59325808, 0x5930040b, 0x800000c4, - 0x80040580, 0x04020021, 0x4c500000, 0x4c540000, - 0x4c580000, 0x83cca400, 0x00000006, 0x4050a800, - 0x5930b40b, 0x0201f800, 0x0010ab28, 0x83cca400, - 0x00000006, 0x592cb205, 0x832cac00, 0x00000006, - 0x0201f800, 0x0010ab17, 0x592e5801, 0x812e59c0, - 0x040207f9, 0x5931d821, 0x58ef400b, 0x58ee580d, - 0x4a025a04, 0x00000103, 0x58ec0009, 0x0801f800, - 0x59300402, 0x5c00b000, 0x5c00a800, 0x5c00a000, - 0x5c025800, 0x1c01f000, 0x0201f800, 0x0010801c, - 0x5c025800, 0x1c01f000, 0x4933c857, 0x83380580, - 0x00000035, 0x04000005, 0x59301419, 0x0401f851, - 0x04000027, 0x0401f006, 0x4d300000, 0x5932601e, - 0x0401f856, 0x5c026000, 0x04000020, 0x591c0c06, - 0x82040580, 0x00000003, 0x04000004, 0x82040580, - 0x00000006, 0x0402001c, 0x591c0c02, 0x59300419, - 0x80040580, 0x04000009, 0x59300219, 0x80040580, - 0x04020015, 0x591c0a02, 0x59300419, 0x80040580, - 0x04020011, 0x0401f009, 0x59300a19, 0x82040580, - 0x0000ffff, 0x04000005, 0x591c0202, 0x59300a19, - 0x80040580, 0x04020008, 0x591c0009, 0x59300809, - 0x80040580, 0x1c01f000, 0x417a3800, 0x82000540, - 0x00000001, 0x1c01f000, 0x4803c856, 0x59b800e4, - 0x8c000538, 0x02020800, 0x001005d8, 0x42000800, - 0x0000012c, 0x4a0370e4, 0x20000000, 0x59b800e4, - 0x80040840, 0x02000800, 0x001005d8, 0x8c00053c, - 0x040207f9, 0x4a0370e4, 0x30000000, 0x40000000, - 0x40000000, 0x40000000, 0x59b800e4, 0x8c00053c, - 0x040207f1, 0x1c01f000, 0x4803c856, 0x4a0370e4, - 0x20000000, 0x40000000, 0x59b800e4, 0x8c000538, - 0x040207fb, 0x1c01f000, 0x59300807, 0x8c040d1e, - 0x592c0c08, 0x04020002, 0x8c040d18, 0x1c01f000, - 0x0401fc1c, 0x04000008, 0x42000800, 0x00000024, - 0x0201f800, 0x00106681, 0x82063c00, 0x0010d1c0, - 0x491fc857, 0x1c01f000, 0x83300480, 0x0010d1c0, - 0x0400100a, 0x59a8000b, 0x81300480, 0x04021007, - 0x59301402, 0x0401ffef, 0x04000007, 0x411c0000, - 0x81300580, 0x04000003, 0x81780500, 0x0401f002, - 0x81300540, 0x1c01f000, 0x4947c857, 0x4d300000, - 0x0201f800, 0x00020245, 0x0402000a, 0x42026000, - 0x0010bde9, 0x49366009, 0x492e6008, 0x0201f800, - 0x0010203c, 0x80000580, 0x5c026000, 0x1c01f000, - 0x82000540, 0x00000001, 0x0401f7fc, 0x4933c857, - 0x0201f800, 0x00109037, 0x02000800, 0x001005d8, - 0x4d2c0000, 0x4d340000, 0x4d440000, 0x4c580000, - 0x59325808, 0x59326809, 0x49425a06, 0x0201f800, - 0x00105755, 0x592e8c06, 0x592c4207, 0x82200500, - 0x0000000f, 0x0c01f806, 0x5c00b000, 0x5c028800, - 0x5c026800, 0x5c025800, 0x1c01f000, 0x00109466, - 0x00109488, 0x0010948f, 0x00109493, 0x0010949c, - 0x00109463, 0x00109463, 0x00109463, 0x001094a0, - 0x001094ac, 0x001094ac, 0x00109463, 0x00109463, - 0x00109463, 0x00109463, 0x00109463, 0x4803c857, - 0x0201f800, 0x001005d8, 0x814281c0, 0x04020012, - 0x41785800, 0x592c0404, 0x8c00051c, 0x04020002, - 0x59345c05, 0x442c2800, 0x59340008, 0x48002802, - 0x59340009, 0x48002801, 0x59340006, 0x48002804, - 0x59340007, 0x48002803, 0x4200b000, 0x0000000b, - 0x0401f037, 0x592c0207, 0x8c00051e, 0x4200b000, - 0x00000002, 0x04020032, 0x8204b540, 0x00000000, - 0x0400002f, 0x44042800, 0x59326809, 0x59340400, - 0x48002801, 0x4200b000, 0x00000002, 0x0401f028, - 0x814281c0, 0x04020030, 0x59345c05, 0x442c2800, - 0x4200b000, 0x00000001, 0x0401f021, 0x8340b540, - 0x00000000, 0x0400001e, 0x0401f027, 0x814281c0, - 0x04020025, 0x59340200, 0x44002800, 0x59340001, - 0x48002801, 0x4200b000, 0x00000002, 0x0401f014, - 0x8340b540, 0x00000000, 0x0402001b, 0x0401f010, - 0x8340b540, 0x00000000, 0x0400000d, 0x0201f800, - 0x00104a1f, 0x04000014, 0x8c20450e, 0x04000002, - 0x497a6009, 0x4178b000, 0x497a5a06, 0x0401f004, - 0x8340b540, 0x00000000, 0x0402000b, 0x592c0404, - 0x8400051c, 0x48025c04, 0x592c0207, 0x8400051e, - 0x48025a07, 0x0401f8aa, 0x497a6008, 0x0201f000, - 0x000202da, 0x592c0207, 0x8c00051e, 0x4200b000, - 0x00000002, 0x040207f2, 0x8204b540, 0x00000000, - 0x040007ef, 0x44042800, 0x4200b000, 0x00000001, - 0x0401f7eb, 0x4937c857, 0x4d300000, 0x0201f800, - 0x0002075a, 0x04000011, 0x49366009, 0x4a026406, - 0x00000001, 0x492e6008, 0x42000800, 0x0000000b, - 0x0201f800, 0x00104571, 0x4d380000, 0x42027000, - 0x00000043, 0x0201f800, 0x000207a1, 0x5c027000, - 0x82000540, 0x00000001, 0x5c026000, 0x1c01f000, - 0x4937c857, 0x4d2c0000, 0x59325808, 0x83380580, - 0x00000015, 0x04020025, 0x59a80016, 0x82000580, - 0x00000004, 0x04020021, 0x59a80010, 0x592c1009, - 0x80080580, 0x04020010, 0x4d440000, 0x592e8c06, - 0x592c0207, 0x4803c856, 0x82000500, 0x00000080, - 0x84000548, 0x4d3c0000, 0x42027800, 0x00001000, - 0x0201f800, 0x001049bb, 0x5c027800, 0x5c028800, - 0x0401f004, 0x4803c856, 0x0201f800, 0x00104a1f, - 0x0201f800, 0x00109037, 0x04000017, 0x4d400000, - 0x42028000, 0x00000000, 0x41780800, 0x0401ff38, - 0x5c028000, 0x0401f00e, 0x0201f800, 0x00104a1f, - 0x040207f4, 0x0201f800, 0x00109037, 0x0400000a, - 0x4c580000, 0x4200b000, 0x00000002, 0x0401f86e, - 0x5c00b000, 0x0201f800, 0x0010801c, 0x0201f800, - 0x0002077d, 0x5c025800, 0x1c01f000, 0x4937c857, - 0x4d300000, 0x0201f800, 0x0002075a, 0x04000012, - 0x49366009, 0x4a026406, 0x00000001, 0x4d3c0000, - 0x4d380000, 0x417a7800, 0x0201f800, 0x00104567, - 0x492e6008, 0x42027000, 0x00000004, 0x0201f800, - 0x000207a1, 0x5c027000, 0x5c027800, 0x82000540, - 0x00000001, 0x5c026000, 0x1c01f000, 0x4937c857, - 0x4d300000, 0x0201f800, 0x00107942, 0x0400000d, - 0x49366009, 0x4a026406, 0x00000001, 0x492e6008, - 0x4d380000, 0x42027000, 0x00000051, 0x0201f800, - 0x000207a1, 0x5c027000, 0x82000540, 0x00000001, - 0x5c026000, 0x1c01f000, 0x4933c857, 0x4c580000, - 0x59325808, 0x83383580, 0x00000015, 0x04020011, - 0x592c0008, 0x82000500, 0x00ffffff, 0x0402000a, - 0x0201f800, 0x00105755, 0x59cc0000, 0x82000500, - 0x00ffffff, 0x44002800, 0x4200b000, 0x00000001, - 0x0401f80b, 0x0201f800, 0x00107b38, 0x0401f006, - 0x4200b000, 0x00000002, 0x0401f823, 0x0201f800, - 0x0010801c, 0x5c00b000, 0x1c01f000, 0x492fc857, - 0x4c580000, 0x4c000000, 0x8058b1c0, 0x0400000b, - 0x82580500, 0xfffffff0, 0x02020800, 0x001005d8, - 0x8058b0d0, 0x592c0408, 0x82000500, 0xfffff0ff, - 0x80580540, 0x48025c08, 0x5c000000, 0x5c00b000, - 0x1c01f000, 0x492fc857, 0x4c000000, 0x4c040000, - 0x800000d8, 0x592c0c08, 0x82040d00, 0xffff0fff, - 0x80040540, 0x48025c08, 0x5c000800, 0x5c000000, - 0x1c01f000, 0x4933c857, 0x4d2c0000, 0x59325808, - 0x592c0207, 0x8400055e, 0x48025a07, 0x4c500000, - 0x4c540000, 0x4c580000, 0x0401ffd9, 0x0201f800, - 0x00105755, 0x46002800, 0x00000018, 0x80142800, - 0x8058b040, 0x83cca400, 0x00000007, 0x4014a800, - 0x0201f800, 0x0010ab17, 0x5c00b000, 0x5c00a800, - 0x5c00a000, 0x5c025800, 0x1c01f000, 0x59325808, - 0x592c0204, 0x82000580, 0x00000152, 0x1c01f000, - 0x5930001f, 0x80000540, 0x02020800, 0x00100d56, - 0x1c01f000, 0x4d2c0000, 0x59325808, 0x59300203, - 0x4933c857, 0x492fc857, 0x493bc857, 0x4803c857, - 0x82003480, 0x0000000e, 0x02021800, 0x001005d8, - 0x0c01f803, 0x5c025800, 0x1c01f000, 0x001095bd, - 0x001095c8, 0x00109603, 0x001095bd, 0x001095bd, - 0x001095bd, 0x001095bd, 0x001095bd, 0x001095bf, - 0x001095bd, 0x001095bd, 0x001095bd, 0x001095bd, - 0x001095bd, 0x0201f800, 0x001005d8, 0x83383480, - 0x00000056, 0x02021800, 0x001005d8, 0x493a6403, - 0x4a026203, 0x00000001, 0x0201f000, 0x0010672b, - 0x83380580, 0x00000013, 0x0402000f, 0x592c000c, - 0x800001c0, 0x04000006, 0x4a026203, 0x00000002, - 0x59a80037, 0x48026206, 0x1c01f000, 0x4a025a06, - 0x00000000, 0x0201f800, 0x000202da, 0x0201f000, - 0x0002077d, 0x83380580, 0x00000027, 0x0400001a, - 0x83380580, 0x00000014, 0x04000012, 0x83380580, - 0x00000015, 0x04000005, 0x83380580, 0x00000016, - 0x02020800, 0x001005d8, 0x0201f800, 0x00106f60, - 0x02020000, 0x00107974, 0x59300203, 0x82000580, - 0x00000002, 0x02020800, 0x001005d8, 0x0401f014, - 0x0201f800, 0x00106bbf, 0x4a02580e, 0x00000011, - 0x0401f005, 0x0201f800, 0x00106bbf, 0x4a02580e, - 0x00000010, 0x4a025a06, 0x00000031, 0x4a02580d, - 0x00000004, 0x0201f800, 0x000202da, 0x0201f800, - 0x00104c19, 0x0201f000, 0x00107911, 0x59341400, - 0x82081d00, 0x000000ff, 0x59300c03, 0x480bc857, - 0x4807c857, 0x82040580, 0x00000053, 0x0400002e, - 0x82040580, 0x00000002, 0x04000016, 0x82040580, - 0x00000001, 0x04000017, 0x82040580, 0x00000003, - 0x0400001c, 0x82040580, 0x00000005, 0x0400001d, - 0x82040580, 0x00000033, 0x0400001a, 0x82040580, - 0x00000000, 0x0400001b, 0x82040580, 0x00000004, - 0x02020800, 0x001005d8, 0x0401f8a1, 0x0401f016, - 0x820c0580, 0x00000003, 0x0400084c, 0x0401f012, - 0x820c0580, 0x0000000b, 0x0402000f, 0x42000800, - 0x00000007, 0x0201f800, 0x00104571, 0x0401f00a, - 0x820c0580, 0x00000005, 0x04000864, 0x0401f006, - 0x820c0580, 0x00000009, 0x04000889, 0x0401f002, - 0x0401f893, 0x4a026403, 0x00000052, 0x59a81016, - 0x592c040b, 0x8c000500, 0x04000003, 0x42001000, - 0x00000008, 0x592c040b, 0x8c000516, 0x04000003, - 0x82081400, 0x00000018, 0x592c000c, 0x497a580d, - 0x497a580e, 0x80080c80, 0x04000009, 0x04001005, - 0x4a025a06, 0x00000007, 0x40001000, 0x0401f006, - 0x4a025a06, 0x00000015, 0x0401f003, 0x4a025a06, - 0x00000000, 0x480a580c, 0x82081400, 0x00000003, - 0x80081104, 0x0201f800, 0x00107ab5, 0x04000010, - 0x592c1001, 0x480a600b, 0x58080800, 0x82080400, - 0x00000002, 0x592c1011, 0x592c1812, 0x42003000, - 0x00000000, 0x42002000, 0x00101200, 0x0201f800, - 0x00107c32, 0x04000002, 0x1c01f000, 0x4a025a06, - 0x0000002c, 0x497a580c, 0x0201f800, 0x000202da, - 0x0201f000, 0x0002077d, 0x83380580, 0x00000015, - 0x0402000a, 0x59a80005, 0x8c000514, 0x0402000b, - 0x0201f800, 0x0010462a, 0x42000800, 0x00000004, - 0x0201f000, 0x00104571, 0x42000800, 0x00000007, - 0x0201f000, 0x00104571, 0x0201f800, 0x0010513b, - 0x42001000, 0x00000010, 0x04020009, 0x59340002, - 0x82000500, 0x00ff0000, 0x82000580, 0x00ff0000, - 0x040007ec, 0x42001000, 0x00000008, 0x0201f800, - 0x00104c6d, 0x040007e7, 0x592c040b, 0x84000540, - 0x48025c0b, 0x0401f7e9, 0x83380580, 0x00000015, - 0x0402000f, 0x59a80005, 0x8c000514, 0x04020010, - 0x0201f800, 0x0010468d, 0x4d3c0000, 0x417a7800, - 0x0201f800, 0x00104567, 0x5c027800, 0x42000800, - 0x00000006, 0x0201f000, 0x00104571, 0x42000800, - 0x00000004, 0x0201f000, 0x00104571, 0x0201f800, - 0x0010513b, 0x42001000, 0x00000010, 0x04020009, - 0x59340002, 0x82000500, 0x00ff0000, 0x82000580, - 0x00ff0000, 0x040007e7, 0x42001000, 0x00000008, - 0x0201f800, 0x00104c6d, 0x040007e2, 0x592c040b, - 0x84000540, 0x48025c0b, 0x0401f7e9, 0x42000800, - 0x00000004, 0x0201f000, 0x00104571, 0x83380580, - 0x00000015, 0x04020005, 0x0201f800, 0x0010a2c8, - 0x02000800, 0x001048c1, 0x1c01f000, 0x83380580, - 0x00000015, 0x0402001d, 0x4c580000, 0x83cc1400, - 0x00000008, 0x4200b000, 0x00000002, 0x83341c00, - 0x00000006, 0x0201f800, 0x0010855a, 0x04020012, - 0x83cc1400, 0x0000000a, 0x4200b000, 0x00000002, - 0x83341c00, 0x00000008, 0x0201f800, 0x0010855a, - 0x04020009, 0x59342200, 0x59cc1007, 0x800811c0, - 0x04000003, 0x480a6801, 0x84102542, 0x8410251a, - 0x48126a00, 0x5c00b000, 0x1c01f000, 0x42000000, - 0x0010b87b, 0x0201f800, 0x0010aa47, 0x0201f800, - 0x00106c55, 0x59300203, 0x4933c857, 0x4803c857, - 0x82000c80, 0x0000000e, 0x02021800, 0x001005d8, - 0x0c01f803, 0x0201f000, 0x00106c4b, 0x0010970b, - 0x0010971a, 0x0010970c, 0x00109709, 0x00109709, - 0x00109709, 0x00109709, 0x00109709, 0x00109709, - 0x00109709, 0x00109709, 0x00109709, 0x00109709, - 0x00109709, 0x0201f800, 0x001005d8, 0x1c01f000, - 0x59300403, 0x82000580, 0x00000052, 0x02000000, - 0x00108d85, 0x0201f800, 0x00104c19, 0x59325808, - 0x4a025a06, 0x00000006, 0x0201f800, 0x000202da, - 0x0201f000, 0x00107911, 0x59301804, 0x840c0520, - 0x48026004, 0x598c000d, 0x81300580, 0x04020010, - 0x8c0c1d20, 0x04020010, 0x42001000, 0x0010b7f6, - 0x50081000, 0x58080002, 0x82000580, 0x00000100, - 0x0400000e, 0x5808000c, 0x81300580, 0x02020800, - 0x001005d8, 0x4978100c, 0x0401f003, 0x8c0c1d20, - 0x040207dc, 0x0201f800, 0x001068d3, 0x040007d9, - 0x0201f800, 0x001005d8, 0x0201f800, 0x00106e8e, - 0x040007f9, 0x59300203, 0x82000c80, 0x0000000e, - 0x02021800, 0x001005d8, 0x0c01f7bd, 0x4933c857, - 0x4c500000, 0x4c540000, 0x4c580000, 0x592c0c07, - 0x4806580a, 0x59cc0809, 0x48065807, 0x59cc0a08, - 0x4806580b, 0x59c80817, 0x82040500, 0x000003ff, - 0x800010c4, 0x8c040d14, 0x04000005, 0x59cc0002, - 0x82000500, 0x00000003, 0x80081480, 0x82080480, - 0x000000f1, 0x02021800, 0x001005d8, 0x480a621a, - 0x412c0800, 0x0201f800, 0x001007d3, 0x02000800, - 0x001005d8, 0x492c0809, 0x58040408, 0x84000552, - 0x84000540, 0x48000c08, 0x82081400, 0x00000003, - 0x80081104, 0x83cca400, 0x00000006, 0x832cac00, - 0x00000004, 0x42000800, 0x00000010, 0x82080480, - 0x00000010, 0x04021003, 0x40080800, 0x80000580, - 0x4004b000, 0x4c000000, 0x0201f800, 0x0010ab28, - 0x5c000000, 0x800001c0, 0x0400000d, 0x412c1000, - 0x4c000000, 0x0201f800, 0x001007d3, 0x02000800, - 0x001005d8, 0x492c1001, 0x832cac00, 0x00000004, - 0x5c000000, 0x40001000, 0x0401f7e9, 0x5c00b000, - 0x5c00a800, 0x5c00a000, 0x1c01f000, 0x4933c857, - 0x4d2c0000, 0x4c380000, 0x59325808, 0x5930021a, - 0x48025a08, 0x59301011, 0x800811c0, 0x04020008, - 0x4a025a06, 0x00000000, 0x592c000b, 0x82000500, - 0x00000c00, 0x0400000b, 0x0401f00b, 0x8c08153e, - 0x04000006, 0x4a025a06, 0x00000007, 0x80081080, - 0x80081000, 0x0401f003, 0x4a025a06, 0x00000015, - 0x480a5807, 0x42000000, 0x0010bed9, 0x50007000, - 0x5838000b, 0x80000540, 0x04020008, 0x4930700c, - 0x4930700b, 0x58380002, 0x82000580, 0x00000000, - 0x04020809, 0x0401f005, 0x82001400, 0x00000000, - 0x45301000, 0x4930700b, 0x5c007000, 0x5c025800, - 0x1c01f000, 0x4933c857, 0x592c0009, 0x40001000, - 0x4800700a, 0x82080400, 0x00000004, 0x48007003, - 0x592c000d, 0x592c100e, 0x48007007, 0x48087008, - 0x592c000a, 0x592c1208, 0x80080c80, 0x04001002, - 0x40001000, 0x82081400, 0x00000003, 0x80081104, - 0x82080480, 0x00000010, 0x04021003, 0x80000580, - 0x0401f003, 0x42001000, 0x00000010, 0x4800700d, - 0x48087004, 0x800810c4, 0x48087005, 0x40381000, - 0x0201f800, 0x00100858, 0x1c01f000, 0x4d2c0000, - 0x0201f800, 0x001007d3, 0x02000800, 0x001005d8, - 0x42000800, 0x0010bed9, 0x452c0800, 0x497a580b, - 0x497a580c, 0x497a580d, 0x4a025809, 0x001097ea, - 0x4a025802, 0x00000100, 0x4a025801, 0x00000000, - 0x5c025800, 0x1c01f000, 0x4833c857, 0x4d300000, - 0x4d2c0000, 0x4c5c0000, 0x4030b800, 0x585c000a, - 0x80025d40, 0x04020004, 0x585c000c, 0x4c000000, - 0x0401f044, 0x585c0002, 0x82000580, 0x00000100, - 0x04020022, 0x592c0801, 0x4c040000, 0x0201f800, - 0x001007f4, 0x5c000800, 0x800409c0, 0x0400001c, - 0x4804b80a, 0x585c100d, 0x800811c0, 0x04020005, - 0x40065800, 0x0201f800, 0x001007fd, 0x0401f014, - 0x82080480, 0x00000010, 0x04021003, 0x80000580, - 0x0401f003, 0x42001000, 0x00000010, 0x4800b80d, - 0x4808b804, 0x800810c4, 0x4808b805, 0x82040400, - 0x00000004, 0x4800b803, 0x405c1000, 0x0201f800, - 0x00100858, 0x0401f025, 0x0401f828, 0x585c000c, - 0x80026540, 0x59300000, 0x80000d40, 0x04020002, - 0x4800b80b, 0x4800b80c, 0x497a6000, 0x4c000000, - 0x4978b80a, 0x59325808, 0x4a025a04, 0x00000103, - 0x59300402, 0x48025c06, 0x592c100b, 0x4c080000, - 0x0201f800, 0x000202c1, 0x0201f800, 0x0010912a, - 0x5c001000, 0x8c081518, 0x04000004, 0x0201f800, - 0x001091d1, 0x0401f003, 0x0201f800, 0x0002077d, - 0x405c7000, 0x5c000000, 0x80026540, 0x04000003, - 0x59325808, 0x0401ff78, 0x5c00b800, 0x5c025800, - 0x5c026000, 0x1c01f000, 0x483bc857, 0x5838000a, - 0x40025800, 0x0201f800, 0x001007fd, 0x5838000c, - 0x80026540, 0x59300008, 0x80025d40, 0x4a025a06, - 0x00000002, 0x1c01f000, 0x4803c857, 0x4d1c0000, - 0x497a601c, 0x41323800, 0x40026000, 0x4d3c0000, - 0x42027800, 0x00000005, 0x0401f83c, 0x5c027800, - 0x411e6000, 0x59300414, 0x84000502, 0x48026414, - 0x5c023800, 0x1c01f000, 0x481bc857, 0x4933c857, - 0x4c5c0000, 0x4c600000, 0x4010b800, 0x4014c000, - 0x0201f800, 0x0010a942, 0x0201f800, 0x00103b25, - 0x04000008, 0x40602800, 0x405c3000, 0x0201f800, - 0x0010a446, 0x82000540, 0x00000001, 0x0401f002, - 0x80000580, 0x5c00c000, 0x5c00b800, 0x1c01f000, - 0x4803c856, 0x4d300000, 0x42026000, 0x0010d1c0, - 0x59a8000e, 0x81640580, 0x04000016, 0x59300c06, - 0x82040580, 0x00000001, 0x04000009, 0x82040580, - 0x00000004, 0x04000006, 0x82040580, 0x00000010, - 0x02000800, 0x00108cf9, 0x0401f005, 0x4807c857, - 0x0201f800, 0x001092d7, 0x04020808, 0x83326400, - 0x00000024, 0x41580000, 0x81300480, 0x040017e9, - 0x5c026000, 0x1c01f000, 0x4933c857, 0x59300403, - 0x4803c857, 0x0201f800, 0x00106c55, 0x4df00000, - 0x59300406, 0x4803c857, 0x82000d80, 0x00000002, - 0x04000018, 0x82000d80, 0x00000001, 0x04000009, - 0x82000d80, 0x00000004, 0x04000006, 0x4933c856, - 0x5c03e000, 0x02000800, 0x00106c4b, 0x0401f03c, - 0x59300203, 0x82000d80, 0x00000001, 0x04000018, - 0x82000d80, 0x00000002, 0x04000026, 0x82000d80, - 0x00000005, 0x04000023, 0x0201f800, 0x001005d8, - 0x59300203, 0x82000d80, 0x00000009, 0x0400000c, - 0x82000d80, 0x0000000b, 0x04000009, 0x82000d80, - 0x0000000a, 0x04000017, 0x82000d80, 0x0000000c, - 0x04000014, 0x0201f800, 0x001005d8, 0x598c000d, - 0x81300580, 0x04020004, 0x0201f800, 0x00106e8e, - 0x0402000c, 0x59300004, 0x4803c857, 0x8c000520, - 0x04000004, 0x84000520, 0x48026004, 0x0401f005, - 0x0201f800, 0x001068d3, 0x02020800, 0x001005d8, - 0x5c03e000, 0x02000800, 0x00106c4b, 0x59300406, - 0x82000d80, 0x00000002, 0x04000009, 0x0201f800, - 0x00104c19, 0x0201f800, 0x0010914e, 0x02000800, - 0x0010801c, 0x8d3e7d00, 0x04000003, 0x0201f000, - 0x00107911, 0x4a02621d, 0x00000001, 0x4a026403, - 0x00000085, 0x4a026203, 0x00000009, 0x4a026406, - 0x00000002, 0x42000800, 0x8000004b, 0x0201f000, - 0x00020721, 0x4933c857, 0x59368c03, 0x4c180000, - 0x59300203, 0x82003480, 0x0000000e, 0x02021800, - 0x001005d8, 0x0c01f803, 0x5c003000, 0x1c01f000, - 0x0010990a, 0x00109dcf, 0x00109edb, 0x0010990a, - 0x0010990a, 0x0010990a, 0x0010990a, 0x0010990a, - 0x0010992d, 0x0010990a, 0x0010990a, 0x0010990a, - 0x0010990a, 0x0010990a, 0x0201f800, 0x001005d8, - 0x4933c857, 0x42028800, 0x0000ffff, 0x813669c0, - 0x04000002, 0x59368c03, 0x4c180000, 0x59300203, - 0x82003480, 0x0000000e, 0x02021800, 0x001005d8, - 0x0c01f803, 0x5c003000, 0x1c01f000, 0x00109929, - 0x0010a180, 0x00109929, 0x00109929, 0x00109929, - 0x00109929, 0x00109929, 0x0010a952, 0x0010a0ed, - 0x0010a52c, 0x0010a562, 0x0010a52c, 0x0010a562, - 0x00109929, 0x0201f800, 0x001005d8, 0x0201f800, - 0x001005d8, 0x83383480, 0x00000051, 0x02021800, - 0x001005d8, 0x41380000, 0x493bc857, 0x4d1c0000, - 0x4d400000, 0x0c01f804, 0x5c028000, 0x5c023800, - 0x1c01f000, 0x0010998a, 0x00109b69, 0x0010998a, - 0x0010998a, 0x0010998a, 0x00109b74, 0x0010998a, - 0x0010998a, 0x0010998a, 0x0010998a, 0x0010998a, - 0x0010998a, 0x0010998a, 0x0010998a, 0x0010998a, - 0x0010998a, 0x0010998a, 0x0010998a, 0x0010998a, - 0x0010998a, 0x0010998a, 0x0010998a, 0x0010998a, - 0x001099ac, 0x001099f5, 0x00109a0c, 0x00109a62, - 0x00109ac6, 0x00109b04, 0x00109b34, 0x0010998a, - 0x0010998a, 0x00109b7c, 0x0010998a, 0x0010998a, - 0x00109b8a, 0x00109b93, 0x0010998a, 0x0010998a, - 0x0010998a, 0x0010998a, 0x0010998a, 0x00109c15, - 0x0010998a, 0x0010998a, 0x00109a9a, 0x0010998a, - 0x0010998a, 0x00109bec, 0x0010998a, 0x0010998a, - 0x0010998a, 0x00109c23, 0x0010998a, 0x0010998a, - 0x0010998a, 0x00109c6c, 0x0010998a, 0x0010998a, - 0x0010998a, 0x0010998a, 0x0010998a, 0x0010998a, - 0x00109cb9, 0x0010998a, 0x00109ce5, 0x00109cf0, - 0x0010998a, 0x0010998a, 0x0010998c, 0x00109cfb, - 0x0010998a, 0x0010998a, 0x0010998a, 0x0010999b, - 0x0010998a, 0x0010998a, 0x0010998a, 0x00109d02, - 0x00109d0a, 0x00109d28, 0x0201f800, 0x001005d8, - 0x4933c857, 0x0201f800, 0x0010a592, 0x040203a4, - 0x0201f800, 0x0010210a, 0x040203a1, 0x59cc0407, - 0x4802601c, 0x4a026403, 0x00000045, 0x4a026203, - 0x00000001, 0x0201f000, 0x0010672b, 0x4933c857, - 0x0201f800, 0x0010a592, 0x04020395, 0x0201f800, - 0x0010210a, 0x04020392, 0x0401fbce, 0x040201a0, - 0x59cc0007, 0x4802601c, 0x4a026403, 0x0000004a, - 0x4a026203, 0x00000001, 0x0201f000, 0x0010672b, - 0x4933c857, 0x0201f800, 0x0010210a, 0x04020009, - 0x0201f800, 0x001048ec, 0x04020006, 0x82000500, - 0x00000009, 0x82000580, 0x00000008, 0x04020008, - 0x4a026403, 0x00000009, 0x4a02641a, 0x00000009, - 0x4a02621a, 0x00000000, 0x0401f1b2, 0x0201f800, - 0x001048c1, 0x0201f800, 0x00104a09, 0x04000021, - 0x0201f800, 0x001049ed, 0x0400001e, 0x0201f800, - 0x0010a252, 0x04020025, 0x42028000, 0x00000029, - 0x4d3c0000, 0x417a7800, 0x0201f800, 0x0010203c, - 0x5c027800, 0x0201f800, 0x0010462a, 0x836c0580, - 0x00000002, 0x04020004, 0x59a8001b, 0x80000000, - 0x4803501b, 0x4a026403, 0x00000008, 0x42003000, - 0x00000003, 0x0201f800, 0x00103b25, 0x04000191, - 0x4a026203, 0x00000007, 0x41782800, 0x0401f180, - 0x0201f800, 0x0010a3da, 0x040207e1, 0x4a026403, - 0x00000009, 0x4a02641a, 0x0000000e, 0x4a02621a, - 0x00001900, 0x0401f183, 0x4a026403, 0x00000009, - 0x4a02641a, 0x00000003, 0x4a02621a, 0x00000f00, - 0x0401f17c, 0x4933c857, 0x0201f800, 0x0010210a, - 0x0402033b, 0x0201f800, 0x001048ec, 0x04020338, - 0x493a6403, 0x0201f800, 0x0010a22d, 0x04020006, - 0x42003000, 0x00000005, 0x4a026403, 0x00000006, - 0x0401f7d9, 0x4a026403, 0x00000007, 0x4a02641a, - 0x00000009, 0x4a02621a, 0x00000000, 0x0401f165, - 0x4933c857, 0x0201f800, 0x001048ec, 0x04020324, - 0x0201f800, 0x0010a592, 0x02000800, 0x0010210a, - 0x0402031f, 0x0201f800, 0x00104a09, 0x04020005, - 0x42027800, 0x00000001, 0x0201f800, 0x00104567, - 0x0201f800, 0x001049fc, 0x0402002b, 0x59cc0206, - 0x82003500, 0x00000003, 0x0402002e, 0x82003480, - 0x00000014, 0x0400102b, 0x5934300a, 0x84183516, - 0x82000580, 0x00000014, 0x04020002, 0x84183556, - 0x481a680a, 0x59cc0406, 0x82000500, 0x00000003, - 0x04020020, 0x0201f800, 0x0010a29f, 0x04020028, - 0x0201f800, 0x001049e7, 0x0402000c, 0x417a7800, - 0x0201f800, 0x001020a1, 0x42003000, 0x00000006, - 0x0201f800, 0x0010a93a, 0x42000000, 0x0010b865, - 0x0201f800, 0x0010aa47, 0x0201f800, 0x0010468d, - 0x4a026403, 0x0000000a, 0x42003000, 0x00000020, - 0x0401f795, 0x4a026403, 0x0000000b, 0x4a02641a, - 0x00000009, 0x4a02621a, 0x00001e00, 0x0401f121, - 0x42000000, 0x0010b860, 0x0201f800, 0x0010aa47, - 0x4a026403, 0x0000000b, 0x4a02641a, 0x00000007, - 0x4a02621a, 0x00000000, 0x0401f116, 0x4a026403, - 0x0000000b, 0x4a02641a, 0x00000003, 0x4a02621a, - 0x00000000, 0x0401f10f, 0x4933c857, 0x0201f800, - 0x001048ec, 0x040202ce, 0x0201f800, 0x0010a592, - 0x040202cb, 0x0201f800, 0x0010210a, 0x040202c8, - 0x59cc0206, 0x82003500, 0x00000003, 0x0402001d, - 0x82003480, 0x00000014, 0x0400101a, 0x59cc0406, - 0x82000500, 0x00000003, 0x04020016, 0x59340400, - 0x82000580, 0x00000707, 0x04000019, 0x417a7800, - 0x0201f800, 0x001020a1, 0x42003000, 0x0000000a, - 0x0201f800, 0x0010a93a, 0x42000000, 0x0010b862, - 0x0201f800, 0x0010aa47, 0x4a026403, 0x0000000c, - 0x41782800, 0x42003000, 0x00000021, 0x0401f752, - 0x4a026403, 0x0000000d, 0x4a02641a, 0x00000007, - 0x4a02621a, 0x00000000, 0x0401f0de, 0x4a026403, - 0x0000000d, 0x4a02641a, 0x00000009, 0x4a02621a, - 0x00001e00, 0x0401f0d7, 0x4933c857, 0x0201f800, - 0x001048ec, 0x04020296, 0x0201f800, 0x0010a592, - 0x04020293, 0x0201f800, 0x0010210a, 0x04020290, - 0x0401facc, 0x0402001a, 0x493a6403, 0x4c5c0000, - 0x0401fad2, 0x0402000e, 0x4a026403, 0x0000002e, - 0x405c2800, 0x42003000, 0x00000024, 0x0201f800, - 0x00103b25, 0x0400000c, 0x4a026203, 0x00000007, - 0x405c2800, 0x5c00b800, 0x0401f0ad, 0x4a026403, - 0x0000000d, 0x4a02641a, 0x00000007, 0x4a02621a, - 0x00000000, 0x5c00b800, 0x0401f0b2, 0x4a026403, - 0x0000000d, 0x4a02641a, 0x00000009, 0x4a02621a, - 0x00001e00, 0x0401f0ab, 0x4933c857, 0x0201f800, - 0x001048ec, 0x040206ef, 0x59a80026, 0x82000500, - 0x00000009, 0x82000580, 0x00000008, 0x040006e9, - 0x0201f800, 0x001049fc, 0x0402002d, 0x0201f800, - 0x0010a2a7, 0x04020007, 0x4a026403, 0x0000000e, - 0x41782800, 0x42003000, 0x00000052, 0x0401f702, - 0x4933c857, 0x42003000, 0x00000003, 0x0201f800, - 0x0010a942, 0x4d3c0000, 0x417a7800, 0x0201f800, - 0x0010203c, 0x5c027800, 0x42000000, 0x0010b864, - 0x0201f800, 0x0010aa47, 0x59340200, 0x84000558, - 0x48026a00, 0x42000800, 0x0000000b, 0x0201f800, - 0x00104571, 0x0201f800, 0x00103b25, 0x04000076, - 0x42003000, 0x00000007, 0x0401f062, 0x4933c857, - 0x4a026403, 0x0000000f, 0x4a02641a, 0x00000003, - 0x4a02621a, 0x00001e00, 0x0401f072, 0x59340400, - 0x82000580, 0x00000703, 0x040007f5, 0x0401f040, - 0x4933c857, 0x0201f800, 0x001048ec, 0x0402022c, - 0x59a80026, 0x82000500, 0x00000009, 0x82000580, - 0x00000008, 0x04000226, 0x0201f800, 0x001049f3, - 0x0402002f, 0x0201f800, 0x0010a2c8, 0x02000800, - 0x0010a252, 0x04020007, 0x4a026403, 0x00000010, - 0x41782800, 0x42003000, 0x00000050, 0x0401f6c2, - 0x4d3c0000, 0x417a7800, 0x0201f800, 0x0010203c, - 0x5c027800, 0x42003000, 0x00000003, 0x0201f800, - 0x0010a942, 0x42000000, 0x0010b864, 0x0201f800, - 0x0010aa47, 0x59340200, 0x84000558, 0x48026a00, - 0x0401f7c5, 0x4a026403, 0x00000011, 0x4a02641a, - 0x00000003, 0x4a02621a, 0x00001e00, 0x0401f03d, - 0x4933c857, 0x0201f800, 0x0010210a, 0x02000800, - 0x0010a592, 0x040201fa, 0x0401fa36, 0x04020008, - 0x4a026403, 0x00000012, 0x0401f032, 0x59340400, - 0x82000580, 0x00000703, 0x040007eb, 0x4d3c0000, - 0x417a7800, 0x42028000, 0x00000029, 0x0201f800, - 0x0010203c, 0x5c027800, 0x42003000, 0x00000017, - 0x0201f800, 0x0010a942, 0x42000000, 0x0010b864, - 0x0201f800, 0x0010aa47, 0x0201f800, 0x00103b25, - 0x04000015, 0x42003000, 0x00000006, 0x41782800, - 0x42028000, 0x00000029, 0x4933c857, 0x4a026403, - 0x00000001, 0x4a026203, 0x00000007, 0x0201f800, - 0x0010a974, 0x0201f000, 0x0010a43e, 0x42028000, - 0x00000046, 0x0201f800, 0x0010a974, 0x0201f000, - 0x0010a43e, 0x4933c857, 0x4a026403, 0x00000001, - 0x42000800, 0x0000000b, 0x0201f800, 0x00104571, - 0x4a026203, 0x00000001, 0x0201f000, 0x0010672b, - 0x4933c857, 0x42000800, 0x00000009, 0x0201f800, - 0x00104571, 0x4a026403, 0x00000005, 0x0401f7f5, - 0x0201f800, 0x0010a592, 0x040201b5, 0x0201f800, - 0x0010210a, 0x040201b2, 0x0401f9ee, 0x040207c0, - 0x4a026403, 0x00000020, 0x4a026203, 0x00000001, - 0x0201f000, 0x0010672b, 0x0201f800, 0x0010210a, - 0x040201a7, 0x4a026403, 0x00000023, 0x4a026203, - 0x00000001, 0x0201f000, 0x0010672b, 0x0201f800, - 0x0010a592, 0x02000800, 0x0010210a, 0x0402019c, - 0x0401f9d8, 0x040207aa, 0x40300800, 0x59a81010, - 0x59cc0007, 0x82000500, 0x00ffffff, 0x80080580, - 0x04000019, 0x59cc1408, 0x0201f800, 0x0010902c, - 0x0400002d, 0x59cc0c08, 0x4d300000, 0x0201f800, - 0x00105dd7, 0x41323800, 0x5c026000, 0x04000026, - 0x591c0202, 0x82000580, 0x0000ffff, 0x04000005, - 0x59cc1208, 0x591c0202, 0x80080580, 0x0402001e, - 0x591c0406, 0x82000580, 0x00000007, 0x0402001a, - 0x0401f02c, 0x59cc1208, 0x82080580, 0x0000ffff, - 0x0400000c, 0x0201f800, 0x00109410, 0x04000012, - 0x59cc1408, 0x591c0202, 0x80080580, 0x0402000e, - 0x591c0009, 0x81340580, 0x04000016, 0x0401f00a, - 0x59cc1408, 0x417a7800, 0x0201f800, 0x0010a405, - 0x04020010, 0x59cc1208, 0x82080580, 0x0000ffff, - 0x04000019, 0x4a026403, 0x00000026, 0x4a02621a, - 0x00001700, 0x59cc1204, 0x82081580, 0x0000ffff, - 0x04020798, 0x4a026403, 0x00000025, 0x0401f795, - 0x591c0406, 0x82000580, 0x00000007, 0x040207f2, - 0x591c0403, 0x82000580, 0x00000024, 0x04020006, - 0x4d300000, 0x411e6000, 0x0201f800, 0x0002077d, - 0x5c026000, 0x4a026403, 0x00000025, 0x0401f785, - 0x4933c857, 0x4d3c0000, 0x42027800, 0x00000001, - 0x0201f800, 0x00104567, 0x5c027800, 0x4c580000, - 0x4200b000, 0x00000002, 0x83a81c00, 0x00000002, - 0x83cc1400, 0x0000000b, 0x0201f800, 0x0010855a, - 0x5c00b000, 0x04000004, 0x4a026403, 0x00000031, - 0x0401f770, 0x0201f800, 0x00107911, 0x0201f800, - 0x0010513b, 0x0402000f, 0x0201f800, 0x00105149, - 0x04020008, 0x4a035033, 0x00000001, 0x4202d800, - 0x00000001, 0x0201f800, 0x001050a2, 0x0401f005, - 0x42000000, 0x00000001, 0x0201f800, 0x00105113, - 0x1c01f000, 0x0201f800, 0x0010210a, 0x0402011c, - 0x0401f958, 0x0402072a, 0x493a6403, 0x0401f996, - 0x04020004, 0x4a026403, 0x0000002b, 0x0401f751, - 0x4a026403, 0x0000002c, 0x0401f74e, 0x4933c857, - 0x0201f800, 0x0010210a, 0x0402010d, 0x0201f800, - 0x001049e7, 0x04020740, 0x0201f800, 0x001048d9, - 0x0400003c, 0x59cc0408, 0x48026419, 0x59cc0208, - 0x48026219, 0x59cc0807, 0x59340002, 0x82000500, - 0x00ffffff, 0x80040580, 0x04000012, 0x59a80010, - 0x80040580, 0x04020021, 0x59cc1408, 0x0201f800, - 0x00109410, 0x04000023, 0x0201f800, 0x0010a4ca, - 0x04000020, 0x0201f800, 0x0010a921, 0x0400001d, - 0x491e601e, 0x4a026403, 0x00000036, 0x0401f0e6, - 0x59cc1208, 0x82080580, 0x0000ffff, 0x04000009, - 0x0201f800, 0x00109410, 0x04000012, 0x591c0202, - 0x59cc0c08, 0x80040580, 0x0402000e, 0x0401f7eb, - 0x59cc1408, 0x41327800, 0x0201f800, 0x0010a405, - 0x04000008, 0x0401f7e5, 0x4803c856, 0x4a02641a, - 0x00000009, 0x4a02621a, 0x00001500, 0x0401f006, - 0x4803c856, 0x4a02641a, 0x00000003, 0x4a02621a, - 0x00001700, 0x4a026403, 0x00000037, 0x0401f0c6, - 0x4803c856, 0x4a026403, 0x00000012, 0x0401f0c2, - 0x4933c857, 0x0201f800, 0x0010210a, 0x040200c4, - 0x0201f800, 0x001049e7, 0x040206f7, 0x0201f800, - 0x001048d9, 0x0400003e, 0x59cc0407, 0x48026419, - 0x59cc1207, 0x480a6219, 0x82080580, 0x0000ffff, - 0x04000005, 0x0201f800, 0x00109410, 0x0400002c, - 0x0401f006, 0x59cc1407, 0x41327800, 0x0201f800, - 0x0010a405, 0x04000026, 0x59cc0c07, 0x591c0202, - 0x80040580, 0x04020022, 0x4d300000, 0x411e6000, - 0x0201f800, 0x00108bd7, 0x5c026000, 0x59cc0c09, - 0x82040d00, 0x0000ff00, 0x840409c0, 0x0201f800, - 0x0010a921, 0x04000016, 0x82040580, 0x00000001, - 0x0400000a, 0x82040580, 0x00000005, 0x04000004, - 0x82040580, 0x00000007, 0x04020007, 0x591c0008, - 0x80000540, 0x04000004, 0x59cc2808, 0x0201f000, - 0x0010a4de, 0x4803c856, 0x4a02641a, 0x00000009, - 0x4a02621a, 0x00002a00, 0x0401f006, 0x4803c856, - 0x4a02641a, 0x00000003, 0x4a02621a, 0x00000300, - 0x4a026403, 0x0000003b, 0x0401f07b, 0x4803c856, - 0x4a02641a, 0x0000000b, 0x4a02621a, 0x00000000, - 0x0401f7f8, 0x4c080000, 0x0201f800, 0x001048ec, - 0x04000026, 0x0201f800, 0x001048c1, 0x0201f800, - 0x0010a601, 0x0402001e, 0x59a80026, 0x82000540, - 0x00000003, 0x48035026, 0x59a8001d, 0x800000d0, - 0x59a80810, 0x82040d00, 0x000000ff, 0x80041540, - 0x480b5010, 0x42000800, 0x00000003, 0x0201f800, - 0x00106c78, 0x497b5028, 0x0201f800, 0x00103b25, - 0x04000003, 0x4a032804, 0x000007d0, 0x8c00050a, - 0x0402000a, 0x0201f800, 0x0002077d, 0x0201f800, - 0x00101e45, 0x5c001000, 0x1c01f000, 0x0201f800, - 0x0010a623, 0x0401f7fc, 0x5c001000, 0x0201f000, - 0x0002077d, 0x0201f800, 0x0010210a, 0x0402004c, - 0x0201f800, 0x0010a628, 0x4a026403, 0x00000047, - 0x4a026203, 0x00000001, 0x0201f000, 0x0010672b, - 0x0201f800, 0x0010210a, 0x04020041, 0x0201f800, - 0x0010a628, 0x4a026403, 0x00000047, 0x4a026203, - 0x00000001, 0x0201f000, 0x0010672b, 0x0201f800, - 0x0010210a, 0x04020036, 0x0201f800, 0x0010a628, - 0x0201f000, 0x0002077d, 0x0401f834, 0x04000030, - 0x4a026403, 0x0000004e, 0x4a026203, 0x00000001, - 0x0201f000, 0x0010672b, 0x4a026403, 0x0000004f, - 0x497a601c, 0x59cc0a06, 0x82040d00, 0x000000ff, - 0x800409c0, 0x0400065f, 0x82040580, 0x00000001, - 0x04020005, 0x59cc0808, 0x59a80005, 0x80040580, - 0x04000658, 0x82040580, 0x00000002, 0x0402000a, - 0x83cc1400, 0x0000000b, 0x4200b000, 0x00000002, - 0x83341c00, 0x00000006, 0x0201f800, 0x0010855a, - 0x0400064c, 0x4a02601c, 0x00000001, 0x0401f649, - 0x4a026403, 0x00000050, 0x59cc0207, 0x4802601c, - 0x0401f644, 0x4a026203, 0x00000001, 0x42000800, - 0x80000040, 0x0201f000, 0x00020721, 0x4803c857, - 0x0201f000, 0x0002077d, 0x4d2c0000, 0x4c500000, - 0x4c580000, 0x4c540000, 0x59a80016, 0x82000c80, - 0x00000829, 0x04021029, 0x0201f800, 0x001007d3, - 0x04000026, 0x492e6008, 0x59a80016, 0x80000104, - 0x48025802, 0x83cca400, 0x00000006, 0x82000c80, - 0x0000000b, 0x04001013, 0x4a025811, 0x0000000b, - 0x4200b000, 0x0000000b, 0x832c0400, 0x00000005, - 0x4000a800, 0x0201f800, 0x0010ab17, 0x412c7000, - 0x0201f800, 0x001007d3, 0x04000010, 0x492c7001, - 0x40040000, 0x800409c0, 0x04000009, 0x0401f7ec, - 0x48025811, 0x4000b000, 0x832c0400, 0x00000005, - 0x4000a800, 0x0201f800, 0x0010ab17, 0x82000540, - 0x00000001, 0x0401f006, 0x497b5016, 0x59325808, - 0x0201f800, 0x001007fd, 0x80000580, 0x5c00a800, - 0x5c00b000, 0x5c00a000, 0x5c025800, 0x1c01f000, - 0x4d340000, 0x59326809, 0x59343400, 0x4933c857, - 0x4937c857, 0x481bc857, 0x0201f800, 0x001049f3, - 0x5c026800, 0x1c01f000, 0x4933c857, 0x4c5c0000, - 0x4d3c0000, 0x0401f840, 0x0402002c, 0x59cc0207, - 0x82000d00, 0x0000ff00, 0x900411c0, 0x59cc000a, - 0x82000500, 0x00ffffff, 0x80081540, 0x480a601c, - 0x8c040d18, 0x0400000e, 0x42003000, 0x00000008, - 0x0201f800, 0x0010a932, 0x42000000, 0x0010b863, - 0x0201f800, 0x0010aa47, 0x4200b800, 0x00000002, - 0x42027800, 0x00000001, 0x0401f011, 0x4178b800, - 0x8c040d1a, 0x04000011, 0x59cc000a, 0x0201f800, - 0x00105c9a, 0x0402000d, 0x42003000, 0x00000009, - 0x0201f800, 0x0010a93a, 0x42000000, 0x0010b863, - 0x0201f800, 0x0010aa47, 0x417a7800, 0x0201f800, - 0x001020a1, 0x0401f004, 0x82000540, 0x00000001, - 0x0401f002, 0x80000580, 0x5c027800, 0x5c00b800, - 0x1c01f000, 0x4933c857, 0x59cc0206, 0x82000480, - 0x00000010, 0x04021006, 0x4a02621a, 0x00000000, - 0x82000540, 0x00000001, 0x0401f002, 0x80000580, - 0x1c01f000, 0x4933c857, 0x4a02621a, 0x00000000, - 0x59cc0407, 0x82000500, 0x0000ff00, 0x82000580, - 0x00000800, 0x04020009, 0x59cc0006, 0x82000500, - 0x00ff0000, 0x82000d80, 0x00140000, 0x04000003, - 0x82000d80, 0x00100000, 0x1c01f000, 0x4933c857, - 0x59300403, 0x82003480, 0x00000051, 0x02021800, - 0x001005d8, 0x83383580, 0x00000013, 0x04020003, - 0x4803c857, 0x0c01f012, 0x83383580, 0x00000027, - 0x04000005, 0x83383580, 0x00000014, 0x02020800, - 0x001005d8, 0x0201f800, 0x001048c1, 0x42000800, - 0x00000007, 0x0201f800, 0x00104571, 0x0201f800, - 0x00106bbf, 0x0201f000, 0x00107911, 0x00109e3c, - 0x00109e45, 0x00109e3c, 0x00109e3c, 0x00109e3c, - 0x00109e45, 0x00109e50, 0x00109ecd, 0x00109e95, - 0x00109ecd, 0x00109ead, 0x00109ecd, 0x00109ebe, - 0x00109ecd, 0x00109ec6, 0x00109ecd, 0x00109ec6, - 0x00109ecd, 0x00109ecd, 0x00109e3c, 0x00109e3c, - 0x00109e3c, 0x00109e3c, 0x00109e3c, 0x00109e3c, - 0x00109e3c, 0x00109e3c, 0x00109e3c, 0x00109e3c, - 0x00109e3c, 0x00109e45, 0x00109e3c, 0x00109ecd, - 0x00109e3c, 0x00109e3c, 0x00109ecd, 0x00109e3c, - 0x00109eca, 0x00109ecd, 0x00109e3c, 0x00109e3c, - 0x00109e3c, 0x00109e3c, 0x00109ecd, 0x00109ecd, - 0x00109e3c, 0x00109ec3, 0x00109ecd, 0x00109e3c, - 0x00109e4a, 0x00109e3c, 0x00109e3c, 0x00109e3c, - 0x00109e3c, 0x00109ec9, 0x00109ecd, 0x00109e3c, - 0x00109e3c, 0x00109ecd, 0x00109ecd, 0x00109e3c, - 0x00109e3c, 0x00109e3c, 0x00109e3c, 0x00109e3c, - 0x00109e3c, 0x00109e3c, 0x00109e3c, 0x00109e3c, - 0x00109e3e, 0x00109e3c, 0x00109e3e, 0x00109e3c, - 0x00109e3c, 0x00109e3e, 0x00109e3c, 0x00109e3c, - 0x00109e3c, 0x00109e3e, 0x00109e3e, 0x00109e3e, - 0x0201f800, 0x001005d8, 0x4d2c0000, 0x59325808, - 0x0201f800, 0x001007fd, 0x5c025800, 0x0201f000, - 0x0002077d, 0x59a80037, 0x48026206, 0x4a026203, - 0x00000002, 0x1c01f000, 0x4d3c0000, 0x417a7800, - 0x0201f800, 0x00104567, 0x5c027800, 0x0401f07e, - 0x42000800, 0x00000007, 0x0201f800, 0x00104571, - 0x59a80026, 0x8c000508, 0x04000012, 0x59326809, - 0x4c580000, 0x4200b000, 0x00000002, 0x83a81c00, - 0x00000002, 0x83341400, 0x00000006, 0x0201f800, - 0x0010855a, 0x80000540, 0x5c00b000, 0x0402006a, - 0x59340200, 0x8400051a, 0x48026a00, 0x0401f01b, - 0x599c0017, 0x8c00050a, 0x04020063, 0x4d3c0000, - 0x417a7800, 0x0201f800, 0x00104567, 0x5c027800, - 0x42000800, 0x00000007, 0x0201f800, 0x00104571, - 0x59340212, 0x82000500, 0x0000ff00, 0x04000056, - 0x599c0019, 0x8c00050e, 0x04020053, 0x416c0000, - 0x82000580, 0x00000002, 0x04020004, 0x59a8001b, - 0x80000000, 0x4803501b, 0x42000800, 0x00000003, - 0x0201f800, 0x00104571, 0x4a026406, 0x00000001, - 0x4a026203, 0x00000001, 0x4a026403, 0x00000002, - 0x0201f800, 0x0010672b, 0x4ce80000, 0x4201d000, - 0x00000001, 0x0201f800, 0x00105fae, 0x5c01d000, - 0x1c01f000, 0x0201f800, 0x001049f3, 0x04000036, - 0x0201f800, 0x0010645e, 0x42000800, 0x00000004, - 0x0201f800, 0x00104571, 0x0201f800, 0x0010a96a, - 0x0402002d, 0x42000800, 0x00000005, 0x0201f800, - 0x00104571, 0x4a026406, 0x00000001, 0x4a026203, - 0x00000001, 0x4a026403, 0x00000003, 0x0201f000, - 0x0010672b, 0x42000800, 0x00000006, 0x0401f820, - 0x59303009, 0x599c0017, 0x8c00050a, 0x0402001a, - 0x59a80026, 0x8c000508, 0x04000017, 0x0201f800, - 0x001049e7, 0x04000014, 0x59a8001b, 0x80000000, - 0x4803501b, 0x0401f7c5, 0x42000800, 0x00000004, - 0x0201f800, 0x00104571, 0x0401f792, 0x42000800, - 0x00000004, 0x0401f006, 0x0201f800, 0x001048c1, - 0x0401f005, 0x0401f004, 0x0401f003, 0x0201f800, - 0x00104571, 0x0201f000, 0x0002077d, 0x4933c857, - 0x4807c857, 0x0201f800, 0x00104571, 0x4d3c0000, - 0x417a7800, 0x0201f800, 0x00104567, 0x5c027800, - 0x0201f800, 0x00102074, 0x1c01f000, 0x4933c857, - 0x59340400, 0x80000110, 0x82003480, 0x0000000c, - 0x02021800, 0x001005d8, 0x83383580, 0x00000015, - 0x04020002, 0x0c01f006, 0x83383580, 0x00000016, - 0x02020800, 0x001005d8, 0x0c01f00d, 0x001080b8, - 0x001080b8, 0x001080b8, 0x001080b8, 0x001080b8, - 0x001080b8, 0x00109f30, 0x00109f03, 0x001080b8, - 0x001080b8, 0x001080b8, 0x001080b8, 0x001080b8, - 0x001080b8, 0x001080b8, 0x001080b8, 0x001080b8, - 0x001080b8, 0x00109f30, 0x00109f37, 0x001080b8, - 0x001080b8, 0x001080b8, 0x001080b8, 0x4933c857, - 0x599c0017, 0x8c00050a, 0x0402001b, 0x813669c0, - 0x04000019, 0x59340212, 0x82000500, 0x0000ff00, - 0x04000015, 0x599c0019, 0x8c00050e, 0x04020012, - 0x4d3c0000, 0x417a7800, 0x0201f800, 0x00104567, - 0x5c027800, 0x42000800, 0x00000003, 0x0201f800, - 0x00104571, 0x4a026406, 0x00000001, 0x4a026203, - 0x00000001, 0x4a026403, 0x00000002, 0x0201f000, - 0x0010672b, 0x59cc0001, 0x0201f800, 0x00105c9a, - 0x0402000b, 0x0201f800, 0x00020245, 0x02020000, - 0x0002077d, 0x59345002, 0x0201f800, 0x001042b4, - 0x482a6802, 0x0201f000, 0x0002077d, 0x1c01f000, - 0x4933c857, 0x59303403, 0x82183580, 0x0000001e, - 0x02000000, 0x0002077d, 0x1c01f000, 0x4933c857, - 0x0201f800, 0x001083df, 0x02020000, 0x0002077d, - 0x4a026203, 0x00000001, 0x4a026403, 0x00000001, - 0x0201f000, 0x0010672b, 0x493bc857, 0x83380580, - 0x00000051, 0x0402000b, 0x0201f800, 0x00106f60, - 0x02020000, 0x00107974, 0x59300203, 0x82000580, - 0x00000002, 0x0400006d, 0x0201f800, 0x001005d8, - 0x83380580, 0x00000027, 0x04000014, 0x83380580, - 0x00000048, 0x04000006, 0x83380580, 0x00000014, - 0x0400000e, 0x02020800, 0x001005d8, 0x0201f800, - 0x00106f60, 0x02020000, 0x00107974, 0x59300203, - 0x82000580, 0x00000004, 0x02000000, 0x0002086e, - 0x0201f800, 0x001005d8, 0x59300403, 0x82000c80, - 0x00000044, 0x02021800, 0x001005d8, 0x82000480, - 0x00000040, 0x02001800, 0x001005d8, 0x40027000, - 0x4803c857, 0x0c01f001, 0x00109f76, 0x00109f78, - 0x00109f78, 0x00109f93, 0x0201f800, 0x001005d8, - 0x0201f800, 0x00106bbf, 0x59325808, 0x812e59c0, - 0x04000016, 0x832c0500, 0x00ff0000, 0x04000013, - 0x4a026203, 0x00000002, 0x59326809, 0x59340200, - 0x8c00050e, 0x0402000d, 0x42028000, 0x00000004, - 0x0201f800, 0x0010a3ef, 0x497a6008, 0x59300206, - 0x80000540, 0x04020003, 0x59a80038, 0x48026206, - 0x4a026203, 0x00000007, 0x1c01f000, 0x0201f800, - 0x00106bbf, 0x0201f800, 0x00109037, 0x02000000, - 0x00107911, 0x59325808, 0x0201f800, 0x001007f4, - 0x0201f000, 0x00107911, 0x0201f800, 0x001005d8, - 0x59325808, 0x592c040a, 0x8c000502, 0x04000007, - 0x4a026203, 0x00000007, 0x42027000, 0x00000043, - 0x0201f000, 0x000207a1, 0x4a026203, 0x00000004, - 0x1c01f000, 0x0201f800, 0x0010a597, 0x02000000, - 0x0002086c, 0x1c01f000, 0x4a026203, 0x00000001, - 0x4a026403, 0x00000041, 0x42027800, 0x80002042, - 0x0201f000, 0x00020721, 0x83380580, 0x00000051, - 0x04000006, 0x83380580, 0x00000041, 0x02020800, - 0x001005d8, 0x1c01f000, 0x0201f800, 0x000206fd, - 0x0201f800, 0x0010a5df, 0x0201f000, 0x0002077d, - 0x83380480, 0x00000050, 0x02021800, 0x001005d8, - 0x83380480, 0x00000049, 0x02001800, 0x001005d8, - 0x0c01f001, 0x00109fda, 0x00109ffb, 0x00109fd8, - 0x00109fd8, 0x00109fd8, 0x00109fd8, 0x00109ffb, - 0x0201f800, 0x001005d8, 0x59325808, 0x592c040a, - 0x8c00051e, 0x0400000d, 0x82000d00, 0x000000c0, - 0x82040d80, 0x00000080, 0x0400000d, 0x59300804, - 0x8c040d18, 0x0402000a, 0x42027000, 0x00000041, - 0x0201f000, 0x0002088d, 0x4a026203, 0x00000007, - 0x497a6206, 0x0201f000, 0x000206fd, 0x59325808, - 0x592c0c0a, 0x8c040d1a, 0x04020005, 0x0201f800, - 0x000206fd, 0x0201f000, 0x0002077d, 0x0201f800, - 0x0010a597, 0x040007fa, 0x1c01f000, 0x0201f800, - 0x00106b8a, 0x59325808, 0x59326809, 0x59340200, - 0x8c00050e, 0x0400000e, 0x592c040a, 0x82000500, - 0x000000c0, 0x82000580, 0x00000080, 0x04000005, - 0x592c000f, 0x59301815, 0x800c1c80, 0x480e6015, - 0x4a026203, 0x00000002, 0x0401f00d, 0x42028000, - 0x00000004, 0x0401fbde, 0x59300206, 0x80000540, - 0x04020004, 0x59a80038, 0x800000c2, 0x48026206, - 0x497a6008, 0x4a026203, 0x00000007, 0x1c01f000, - 0x4a026203, 0x00000007, 0x497a6206, 0x0201f000, - 0x000206fd, 0x4a026203, 0x00000007, 0x497a6206, - 0x0201f000, 0x000206f8, 0x59300414, 0x8c00051c, - 0x02020000, 0x0002087e, 0x59325808, 0x592c200f, - 0x40080000, 0x80102480, 0x59300015, 0x80102400, - 0x48126015, 0x0201f000, 0x0002087e, 0x8c040d0e, - 0x0402000a, 0x4a026203, 0x00000006, 0x0401f823, - 0x5930001f, 0x80000540, 0x02020800, 0x00100d7c, - 0x0201f000, 0x000206f8, 0x4a026203, 0x00000002, - 0x1c01f000, 0x42000800, 0x00000001, 0x0201f800, - 0x00100d7c, 0x82040580, 0x00000001, 0x02000000, - 0x00020885, 0x0401f7d8, 0x59300414, 0x8c00051c, - 0x04000006, 0x0201f800, 0x00100b63, 0x02000000, - 0x00020877, 0x1c01f000, 0x59300011, 0x80000540, - 0x04020005, 0x0201f800, 0x00100b63, 0x02000000, - 0x00020877, 0x1c01f000, 0x492fc857, 0x480bc857, - 0x8c08153e, 0x04000006, 0x80081080, 0x80081000, - 0x42000800, 0x00000009, 0x0401f003, 0x42000800, - 0x00000015, 0x480a580b, 0x1c01f000, 0x83380580, - 0x00000013, 0x04000005, 0x83380580, 0x00000014, - 0x02020800, 0x001005d8, 0x59300414, 0x8c000516, - 0x02000800, 0x001005d8, 0x1c01f000, 0x0201f800, - 0x001005d8, 0x59300008, 0x80000540, 0x02020800, - 0x001005d8, 0x1c01f000, 0x59300414, 0x8c000516, - 0x02000800, 0x001005d8, 0x1c01f000, 0x4a026203, - 0x00000004, 0x493a6403, 0x42000800, 0x80002001, - 0x0201f000, 0x00020721, 0x4a026203, 0x00000003, - 0x493a6403, 0x0201f800, 0x000200c9, 0x59325808, - 0x592c040a, 0x8c00051e, 0x04000012, 0x82000500, - 0x000000c0, 0x82000580, 0x00000080, 0x04000011, - 0x59300414, 0x8c000512, 0x0402000a, 0x8c000510, - 0x04020008, 0x592c040c, 0x80000540, 0x04020005, - 0x82080d40, 0x80003065, 0x0201f000, 0x00106721, - 0x82080d40, 0x80002065, 0x0201f000, 0x00106721, - 0x82080d40, 0x80002042, 0x0201f000, 0x00106721, - 0x4933c857, 0x493bc857, 0x83380480, 0x00000044, - 0x02021800, 0x001005d8, 0x83380480, 0x00000041, - 0x02001800, 0x001005d8, 0x0c01f001, 0x0010a0b6, - 0x0010a0c6, 0x0010a0db, 0x59325808, 0x592c040a, - 0x8c00051e, 0x0400001d, 0x82001d00, 0x000000c0, - 0x820c1d80, 0x000000c0, 0x04000018, 0x4a026203, - 0x00000001, 0x493a6403, 0x42000800, 0x80002042, - 0x0201f000, 0x00020721, 0x59325808, 0x592c040a, - 0x8c00051e, 0x0400000d, 0x82001d00, 0x000000c0, - 0x820c1d80, 0x000000c0, 0x04000008, 0x4a026203, - 0x00000001, 0x493a6403, 0x42000800, 0x80002001, - 0x0201f000, 0x00020721, 0x497a6008, 0x497a6206, - 0x42028000, 0x00000004, 0x0401f315, 0x59325808, - 0x592c040a, 0x8c00051e, 0x040007f8, 0x82001d00, - 0x000000c0, 0x820c1d80, 0x000000c0, 0x040007f3, - 0x4a026203, 0x00000003, 0x493a6403, 0x0201f800, - 0x000200c9, 0x82080d40, 0x80002065, 0x0201f000, - 0x00106721, 0x4933c857, 0x493bc857, 0x83380580, - 0x00000085, 0x04000006, 0x83380580, 0x00000088, - 0x0400000a, 0x0201f800, 0x001005d8, 0x4a026203, - 0x00000009, 0x493a6403, 0x42000800, 0x8000004b, - 0x0201f000, 0x00020721, 0x4d1c0000, 0x813669c0, - 0x04000004, 0x0201f800, 0x0010a592, 0x04020044, - 0x59cc1404, 0x0401f846, 0x04000018, 0x591c0406, - 0x82000500, 0x0000001f, 0x82002580, 0x00000006, - 0x04000007, 0x82002580, 0x00000004, 0x0400002e, - 0x82002580, 0x00000011, 0x0402000c, 0x497a3a05, - 0x42002000, 0x00000054, 0x0201f800, 0x00107a4a, - 0x4a026203, 0x00000007, 0x493a6403, 0x0201f800, - 0x0010a974, 0x0401f02c, 0x0201f800, 0x00103b25, - 0x04000004, 0x42023800, 0xffffffff, 0x0401f7f1, - 0x813669c0, 0x04020009, 0x59cc0001, 0x0201f800, - 0x00105c9a, 0x0402001e, 0x0201f800, 0x001045a6, - 0x0402001b, 0x49366009, 0x4a026403, 0x00000087, - 0x59cc1204, 0x82081580, 0x0000ffff, 0x04020003, - 0x4a026403, 0x00000086, 0x4a026203, 0x00000001, - 0x42000800, 0x80000040, 0x0201f800, 0x00020721, - 0x0401f00d, 0x591c0203, 0x82000580, 0x00000007, - 0x040207de, 0x4d300000, 0x411e6000, 0x0201f800, - 0x00107911, 0x5c026000, 0x0401f7d8, 0x0201f800, - 0x00107911, 0x5c023800, 0x1c01f000, 0x4933c857, - 0x480bc857, 0x42002800, 0x0010d1c0, 0x41300000, - 0x80140580, 0x04000017, 0x58140203, 0x82000580, - 0x00000000, 0x04000013, 0x58140202, 0x80080580, - 0x04020010, 0x58141c06, 0x820c0580, 0x00000005, - 0x0400000c, 0x820c0580, 0x00000009, 0x0400001d, - 0x59302009, 0x58140009, 0x800001c0, 0x0400000b, - 0x801021c0, 0x04000003, 0x80100580, 0x04000010, - 0x82142c00, 0x00000024, 0x41540000, 0x80140480, - 0x0402100e, 0x0401f7e2, 0x5814001e, 0x801021c0, - 0x04000005, 0x58102002, 0x82102500, 0x00ffffff, - 0x0401f7f2, 0x5810201e, 0x0401f7f0, 0x40163800, - 0x81300540, 0x0401f002, 0x80000580, 0x1c01f000, - 0x58141807, 0x8c0c1d10, 0x040207ea, 0x0401f7e1, - 0x4933c857, 0x493bc857, 0x83380580, 0x00000013, - 0x0402000e, 0x59300403, 0x82000c80, 0x00000085, - 0x02001800, 0x001005d8, 0x82000c80, 0x00000093, - 0x02021800, 0x001005d8, 0x82000480, 0x00000085, - 0x4803c857, 0x0c01f018, 0x83380580, 0x00000027, - 0x04000005, 0x83380580, 0x00000014, 0x02020000, - 0x00107974, 0x0201f800, 0x00106bbf, 0x59325808, - 0x812e59c0, 0x02000000, 0x00107911, 0x4a025a06, - 0x00000031, 0x4a025811, 0x00000004, 0x4a025812, - 0x000000ff, 0x0201f800, 0x000202da, 0x0201f000, - 0x00107911, 0x0010a1b7, 0x0010a1be, 0x0010a1be, - 0x0010a1b7, 0x0010a1b7, 0x0010a1b7, 0x0010a1b7, - 0x0010a1b7, 0x0010a1b7, 0x0010a1b7, 0x0010a1b7, - 0x0010a1b7, 0x0010a1b7, 0x0010a1b9, 0x0201f800, - 0x001005d8, 0x59325808, 0x4a025a06, 0x00000000, - 0x0201f800, 0x000202da, 0x0201f000, 0x00107911, - 0x4933c857, 0x42000000, 0x0010b873, 0x0201f800, - 0x0010aa47, 0x0201f800, 0x0010a5df, 0x497a6205, - 0x42028000, 0x0000000b, 0x0401f807, 0x4a026406, - 0x00000006, 0x4a026203, 0x00000007, 0x497a6206, - 0x1c01f000, 0x4933c857, 0x4943c857, 0x59300406, - 0x82000580, 0x00000007, 0x04020002, 0x1c01f000, - 0x0201f800, 0x00106c55, 0x4df00000, 0x0201f800, - 0x00108ce5, 0x82000c80, 0x0000000e, 0x02021800, - 0x001005d8, 0x0c01f001, 0x0010a205, 0x0010a209, - 0x0010a1f0, 0x0010a217, 0x0010a22a, 0x0010a1f0, - 0x0010a1f0, 0x0010a1f0, 0x0010a1f0, 0x0010a1f0, - 0x0010a1f0, 0x0010a1f0, 0x0010a1f0, 0x0010a1f0, - 0x4d400000, 0x5930001f, 0x80000540, 0x04000005, - 0x41400800, 0x0201f800, 0x00100d7c, 0x40068000, - 0x4d2c0000, 0x59325808, 0x0201f800, 0x00109037, - 0x040209f3, 0x4c5c0000, 0x5930b809, 0x0201f800, - 0x00107911, 0x485e6009, 0x5c00b800, 0x5c025800, - 0x5c028000, 0x5c03e000, 0x02000000, 0x00106c4b, - 0x1c01f000, 0x598c000d, 0x81300580, 0x04020004, - 0x0201f800, 0x00106e8e, 0x04020016, 0x0201f800, - 0x001068d3, 0x040007df, 0x0201f800, 0x00106b6c, - 0x04000010, 0x0201f800, 0x001005d8, 0x0201f800, - 0x00108cd6, 0x04020004, 0x0201f800, 0x00106e62, - 0x04020008, 0x0201f800, 0x001067ae, 0x040007d1, - 0x0201f800, 0x00106b6c, 0x02020800, 0x001005d8, - 0x59300203, 0x82000c80, 0x0000000e, 0x02021800, - 0x001005d8, 0x0c01f7b9, 0x0201f800, 0x00100e99, - 0x0401f7c4, 0x4933c857, 0x4d440000, 0x4d340000, - 0x59cc0007, 0x0201f800, 0x00105c9a, 0x02000800, - 0x00020245, 0x0402001a, 0x59300009, 0x4c000000, - 0x49366009, 0x42003000, 0x0000000b, 0x0201f800, - 0x0010a942, 0x42000000, 0x0010b861, 0x0201f800, - 0x0010aa47, 0x4d3c0000, 0x4d400000, 0x42028000, - 0x00000029, 0x417a7800, 0x0201f800, 0x0010203c, - 0x5c028000, 0x5c027800, 0x5c000000, 0x48026009, - 0x59cc0007, 0x48026802, 0x80000580, 0x5c026800, - 0x5c028800, 0x1c01f000, 0x4933c857, 0x4c040000, - 0x59a80016, 0x82000580, 0x00000074, 0x04020040, - 0x59cc0a08, 0x82040480, 0x00000100, 0x04001033, - 0x59cc0c08, 0x82040500, 0x00008000, 0x04000035, - 0x59a80032, 0x80000540, 0x04020009, 0x59301009, - 0x58080212, 0x82000500, 0x0000ff00, 0x04000004, - 0x82040500, 0x00000800, 0x0400002a, 0x59cc0c09, - 0x80040840, 0x04001024, 0x59a80826, 0x8c040d06, - 0x04000004, 0x59cc0c0f, 0x8c040d1e, 0x04020012, - 0x59cc0a17, 0x800409c0, 0x04020012, 0x59cc0a18, - 0x82040480, 0x00000100, 0x04001014, 0x59cc0c18, - 0x800409c0, 0x0402000e, 0x59cc0c19, 0x80040840, - 0x04001011, 0x59cc0c1a, 0x80040840, 0x04001011, - 0x0401f018, 0x4a02621a, 0x00000100, 0x0401f012, - 0x4a02621a, 0x00000300, 0x0401f00f, 0x4a02621a, - 0x00000500, 0x0401f00c, 0x4a02621a, 0x00000700, - 0x0401f009, 0x4a02621a, 0x00000900, 0x0401f006, - 0x4a02621a, 0x00000f00, 0x0401f003, 0x4a02621a, - 0x00002d00, 0x82000540, 0x00000001, 0x0401f002, - 0x80000580, 0x5c000800, 0x1c01f000, 0x59cc0407, - 0x4803c857, 0x82000580, 0x00000800, 0x04000003, - 0x4a02621a, 0x00000000, 0x1c01f000, 0x4933c857, - 0x4c040000, 0x4c080000, 0x4c0c0000, 0x4c580000, - 0x59cc000c, 0x0201f800, 0x00105c9a, 0x02000800, - 0x00020245, 0x04020012, 0x83cc1400, 0x00000008, - 0x4200b000, 0x00000002, 0x83341c00, 0x00000006, - 0x0201f800, 0x0010855a, 0x04020009, 0x83cc1400, - 0x0000000a, 0x4200b000, 0x00000002, 0x83341c00, - 0x00000008, 0x0201f800, 0x0010855a, 0x5c00b000, - 0x5c001800, 0x5c001000, 0x5c000800, 0x1c01f000, - 0x4933c857, 0x4c000000, 0x4c040000, 0x4c080000, - 0x4c0c0000, 0x4c580000, 0x59cc0001, 0x0201f800, - 0x00105c9a, 0x02000800, 0x00020245, 0x04020014, - 0x83cc1400, 0x0000000b, 0x4200b000, 0x00000002, - 0x83341c00, 0x00000006, 0x0201f800, 0x0010855a, - 0x0402000c, 0x83cc1400, 0x0000000d, 0x4200b000, - 0x00000002, 0x83341c00, 0x00000008, 0x0201f800, - 0x0010855a, 0x04000014, 0x4933c856, 0x4933c856, - 0x4933c857, 0x59340009, 0x4803c857, 0x5934000e, - 0x4803c857, 0x59340008, 0x4803c857, 0x5934000d, - 0x4803c857, 0x59340007, 0x4803c857, 0x5934000c, - 0x4803c857, 0x59340006, 0x4803c857, 0x5934000b, - 0x4803c857, 0x5c00b000, 0x5c001800, 0x5c001000, - 0x5c000800, 0x5c000000, 0x1c01f000, 0x4933c857, - 0x4947c857, 0x4943c857, 0x4c600000, 0x0201f800, - 0x00106c55, 0x4df00000, 0x4d2c0000, 0x4d300000, - 0x4d340000, 0x4130c000, 0x42026000, 0x0010d1c0, - 0x59a8000e, 0x8060c1c0, 0x04000005, 0x82601580, - 0x0010bde9, 0x04000002, 0x80000040, 0x81640480, - 0x040210be, 0x40600000, 0x81300580, 0x040000b6, - 0x0401f97a, 0x040200b4, 0x59326809, 0x59300406, - 0x82000c80, 0x00000012, 0x02021800, 0x001005d8, - 0x0c01f001, 0x0010a3cd, 0x0010a338, 0x0010a351, - 0x0010a35c, 0x0010a335, 0x0010a34c, 0x0010a387, - 0x0010a3cd, 0x0010a333, 0x0010a39a, 0x0010a3ae, - 0x0010a333, 0x0010a333, 0x0010a333, 0x0010a333, - 0x0010a3cd, 0x0010a3c4, 0x0010a3bc, 0x0201f800, - 0x001005d8, 0x59300420, 0x8c000500, 0x04020096, - 0x59300403, 0x82000580, 0x00000043, 0x04000092, - 0x0201f800, 0x00109134, 0x04000007, 0x0201f800, - 0x0010914e, 0x0402008a, 0x0201f800, 0x0010801c, - 0x0401f087, 0x0201f800, 0x00102074, 0x0201f800, - 0x0010914e, 0x02000800, 0x0010801c, 0x0401f080, - 0x8d3e7d18, 0x04000004, 0x59300420, 0x8c000500, - 0x0402007d, 0x59325808, 0x0201f800, 0x00109037, - 0x04000077, 0x49425a06, 0x497a5c09, 0x0201f800, - 0x000202da, 0x0201f800, 0x0010912a, 0x0401f070, - 0x8d3e7d00, 0x04000007, 0x59300017, 0x81480580, - 0x0402006d, 0x59300018, 0x814c0580, 0x0402006a, - 0x59300203, 0x82000580, 0x00000004, 0x02000800, - 0x00100e99, 0x59325808, 0x0201f800, 0x00109037, - 0x0400005f, 0x4a025a04, 0x00000103, 0x59300004, - 0x8400055c, 0x48026004, 0x592c0408, 0x8c000512, - 0x04000007, 0x4d2c0000, 0x592c0009, 0x40025800, - 0x0201f800, 0x001007fd, 0x5c025800, 0x49425a06, - 0x497a5c09, 0x0401fb16, 0x0201f800, 0x0010959c, - 0x0201f800, 0x001091c6, 0x0201f800, 0x000202da, - 0x0201f800, 0x0010912a, 0x0401f045, 0x8d3e7d18, - 0x04000045, 0x59300203, 0x82000580, 0x00000004, - 0x02000800, 0x00100e99, 0x59325808, 0x0201f800, - 0x00109037, 0x0400003a, 0x49425a06, 0x497a5c09, - 0x0401faff, 0x0201f800, 0x0010959c, 0x0201f800, - 0x000202da, 0x0401f032, 0x0201f800, 0x001062d5, - 0x04000031, 0x59300203, 0x82000580, 0x00000004, - 0x0400002d, 0x59300203, 0x82000580, 0x00000003, - 0x04020029, 0x0201f800, 0x00106b8a, 0x59325808, - 0x0201f800, 0x00109037, 0x04000021, 0x0201f800, - 0x000202da, 0x0401f01e, 0x59300203, 0x82000580, - 0x00000004, 0x02000800, 0x00100e99, 0x59325808, - 0x0201f800, 0x00109037, 0x04000015, 0x49425a06, - 0x497a5c09, 0x0201f800, 0x000202da, 0x0401f010, - 0x833c0500, 0x00001800, 0x0400000f, 0x8d3e7d16, - 0x0402000d, 0x59325817, 0x0201f800, 0x001007fd, - 0x59325808, 0x0201f800, 0x00109037, 0x04000004, - 0x49425a06, 0x0201f800, 0x000202da, 0x0201f800, - 0x00107911, 0x83326400, 0x00000024, 0x41580000, - 0x81300480, 0x0400173b, 0x5c026800, 0x5c026000, - 0x5c025800, 0x5c03e000, 0x02000800, 0x00106c4b, - 0x5c00c000, 0x1c01f000, 0x5c000000, 0x4c000000, - 0x4803c857, 0x4d3c0000, 0x42027800, 0x00000001, - 0x0201f800, 0x00104567, 0x5c027800, 0x4c580000, - 0x4200b000, 0x00000002, 0x83a81c00, 0x00000002, - 0x83cc1400, 0x0000000b, 0x0201f800, 0x0010855a, - 0x5c00b000, 0x80000540, 0x1c01f000, 0x492fc857, - 0x4943c857, 0x59a8000c, 0x812c0480, 0x04001011, - 0x59a8000d, 0x812c0480, 0x0402100e, 0x592c0000, - 0x80005d40, 0x04000008, 0x497a5800, 0x49425a06, - 0x4c2c0000, 0x0201f800, 0x000202da, 0x5c025800, - 0x0401f7f7, 0x49425a06, 0x0201f000, 0x000202da, - 0x1c01f000, 0x493fc857, 0x4933c857, 0x480bc857, - 0x0201f800, 0x00103b25, 0x0400002e, 0x41502800, - 0x813e79c0, 0x04020006, 0x59a80066, 0x80000000, - 0x59a8086a, 0x80040580, 0x04000026, 0x41300000, - 0x80140580, 0x0400001a, 0x58140203, 0x82000580, - 0x00000000, 0x04000016, 0x58140202, 0x80080580, - 0x04020013, 0x58141c06, 0x820c0580, 0x00000005, - 0x0400000f, 0x820c0580, 0x00000009, 0x04000017, - 0x59300009, 0x58142009, 0x801021c0, 0x04020006, - 0x5814201e, 0x59301809, 0x580c0002, 0x82000500, - 0x00ffffff, 0x80100580, 0x04000007, 0x82142c00, - 0x00000024, 0x41540000, 0x80140480, 0x04021005, - 0x0401f7df, 0x40163800, 0x81300540, 0x0401f002, - 0x80000580, 0x1c01f000, 0x58141807, 0x8c0c1d10, - 0x040207f3, 0x0401f7e7, 0x42002000, 0x0000ffff, - 0x59301009, 0x800811c0, 0x04000002, 0x58082403, - 0x41301000, 0x0401f007, 0x41781000, 0x41442000, - 0x0401f004, 0x41781000, 0x42002000, 0x0000ffff, - 0x5c000000, 0x4c000000, 0x4803c857, 0x480bc857, - 0x4813c857, 0x492fc857, 0x4943c857, 0x4d2c0000, - 0x0201f800, 0x001007e4, 0x02000800, 0x001005d8, - 0x4a025a04, 0x0000010d, 0x800811c0, 0x04000017, - 0x83400580, 0x00000029, 0x04020010, 0x82180580, - 0x00000002, 0x0400000a, 0x82180580, 0x00000003, - 0x04000007, 0x82180580, 0x00000008, 0x04000004, - 0x82180580, 0x00000009, 0x04020004, 0x4a025809, - 0xffffffff, 0x0401f002, 0x480a5809, 0x58080202, - 0x48025c13, 0x0401f005, 0x4a025809, 0xffffffff, - 0x4a025c13, 0x0000ffff, 0x49425a08, 0x48125a06, - 0x82100580, 0x0000ffff, 0x0400000e, 0x4d440000, - 0x4d340000, 0x40128800, 0x0201f800, 0x00020245, - 0x02020800, 0x001005d8, 0x59340002, 0x82000500, - 0x00ffffff, 0x48025812, 0x5c026800, 0x5c028800, - 0x497a5800, 0x497a5c04, 0x83400580, 0x00000046, - 0x04020002, 0x48165a07, 0x481a5c08, 0x0401fbed, - 0x5c025800, 0x1c01f000, 0x59300809, 0x800409c0, - 0x04000004, 0x58040403, 0x81440580, 0x1c01f000, - 0x82000540, 0x00000001, 0x0401f7fd, 0x4933c857, - 0x4c040000, 0x59300403, 0x82000d80, 0x0000001e, - 0x04020016, 0x800000d0, 0x59300a16, 0x82040d00, - 0x000000ff, 0x80040540, 0x4803c857, 0x48026416, - 0x4a026403, 0x00000085, 0x4a026203, 0x00000009, - 0x4a026406, 0x00000005, 0x4a02621d, 0x00000004, - 0x59a80038, 0x48026206, 0x42000800, 0x8000004b, - 0x0201f800, 0x00020721, 0x5c000800, 0x1c01f000, - 0x4933c857, 0x40000000, 0x40000000, 0x1c01f000, - 0x59300414, 0x4933c857, 0x4803c857, 0x8c000518, - 0x04000009, 0x8c000512, 0x02020000, 0x0010921e, - 0x0401f91b, 0x0201f800, 0x000206fd, 0x0201f800, - 0x0002077d, 0x1c01f000, 0x591c0406, 0x4803c857, - 0x82000c80, 0x00000009, 0x0402100b, 0x0c01f001, - 0x0010a4d9, 0x0010a4d9, 0x0010a4d9, 0x0010a4db, - 0x0010a4d9, 0x0010a4db, 0x0010a4db, 0x0010a4d9, - 0x0010a4db, 0x80000580, 0x1c01f000, 0x82000540, - 0x00000001, 0x1c01f000, 0x591c0406, 0x82000500, - 0x0000001f, 0x82000580, 0x00000006, 0x0400000e, - 0x4803c857, 0x4a026403, 0x0000003b, 0x4a02641a, - 0x00000009, 0x4a02621a, 0x00002a00, 0x4a026203, - 0x00000001, 0x42000800, 0x80000040, 0x0201f000, - 0x00020721, 0x4803c856, 0x4c040000, 0x4c140000, - 0x4d300000, 0x411e6000, 0x0401f8e9, 0x497a6205, - 0x59300414, 0x4803c857, 0x82000500, 0xffffadff, - 0x48026414, 0x497a6405, 0x5c026000, 0x0201f800, - 0x001007e4, 0x02000800, 0x001005d8, 0x5c002800, - 0x5c000800, 0x4a025a04, 0x0000010d, 0x497a5800, - 0x497a5c04, 0x4a025a08, 0x00000045, 0x491e5809, - 0x59300402, 0x48025c07, 0x59300419, 0x48025c0b, - 0x591c0414, 0x84000556, 0x48023c14, 0x591c1809, - 0x580c0403, 0x48025a06, 0x4816580a, 0x48065a0b, - 0x0401f99d, 0x4d400000, 0x42028000, 0x00000045, - 0x591c0202, 0x4c000000, 0x4d300000, 0x411e6000, - 0x0401fcb1, 0x5c026000, 0x5c000000, 0x48023a02, - 0x5c028000, 0x4a023c06, 0x00000006, 0x4a023a03, - 0x00000007, 0x497a3a06, 0x497a3a05, 0x1c01f000, - 0x4933c857, 0x83380580, 0x00000013, 0x0402000b, - 0x59300403, 0x4803c857, 0x82000d80, 0x00000085, - 0x0400002b, 0x82000d80, 0x0000008b, 0x04000028, - 0x0201f800, 0x001005d8, 0x83380580, 0x00000027, - 0x0402000c, 0x0201f800, 0x00106bbf, 0x4d2c0000, - 0x4d400000, 0x59325808, 0x42028000, 0x00000004, - 0x0401feab, 0x5c028000, 0x5c025800, 0x1c01f000, - 0x83380580, 0x00000014, 0x040007f3, 0x83380580, - 0x00000089, 0x04000005, 0x83380580, 0x0000008a, - 0x02020000, 0x00107974, 0x0201f800, 0x00106f60, - 0x02020000, 0x00107974, 0x59300a03, 0x82040580, - 0x0000000a, 0x04000009, 0x82040580, 0x0000000c, - 0x04000006, 0x0201f800, 0x001005d8, 0x4a026203, - 0x0000000a, 0x1c01f000, 0x83380480, 0x00000093, - 0x0402100c, 0x83380480, 0x00000085, 0x04001009, - 0x83380580, 0x00000089, 0x0400000a, 0x83380580, - 0x0000008a, 0x04000022, 0x0201f800, 0x001005d8, - 0x493bc857, 0x4933c857, 0x0201f000, 0x00107974, - 0x4933c857, 0x4c340000, 0x41306800, 0x0201f800, - 0x0002075a, 0x04000011, 0x4a026203, 0x00000001, - 0x4a026403, 0x0000001e, 0x59cc0c07, 0x48066419, - 0x59cc0a07, 0x48066219, 0x58340809, 0x48066009, - 0x4a026406, 0x00000004, 0x42000800, 0x80000040, - 0x0201f800, 0x00020721, 0x40366000, 0x0201f800, - 0x0002077d, 0x5c006800, 0x1c01f000, 0x4933c857, - 0x0201f000, 0x0002077d, 0x4933c857, 0x59300809, - 0x58040200, 0x8c00051a, 0x1c01f000, 0x0201f800, - 0x001048df, 0x0400001e, 0x4a026203, 0x00000002, - 0x59300414, 0x84000558, 0x48026414, 0x8c000512, - 0x04000004, 0x59a80039, 0x48026205, 0x0401f007, - 0x59a80839, 0x59a80037, 0x80040400, 0x82000400, - 0x0000000a, 0x48026205, 0x59300009, 0x82000c00, - 0x00000011, 0x50040000, 0x80000540, 0x04000004, - 0x82000c00, 0x00000000, 0x0401f7fb, 0x45300800, - 0x497a6000, 0x82000540, 0x00000001, 0x1c01f000, - 0x82100500, 0xfffffeef, 0x04020020, 0x4d2c0000, - 0x4937c857, 0x59340811, 0x83341400, 0x00000011, - 0x800409c0, 0x0400000e, 0x40040000, 0x81300580, - 0x04000005, 0x58040800, 0x82041400, 0x00000000, - 0x0401f7f8, 0x59300800, 0x497a6000, 0x44041000, - 0x0201f800, 0x000206fd, 0x0401f002, 0x4933c857, - 0x592c0000, 0x80000540, 0x02020800, 0x001005d8, - 0x5c025800, 0x492e6008, 0x0201f800, 0x000206fd, - 0x0201f000, 0x0002077d, 0x492fc857, 0x4a025a06, - 0x00000006, 0x0201f000, 0x000202da, 0x4c340000, - 0x59300009, 0x800001c0, 0x04000010, 0x82006c00, - 0x00000011, 0x50340000, 0x80000540, 0x04000009, - 0x81300580, 0x04000005, 0x50340000, 0x82006c00, - 0x00000000, 0x0401f7f8, 0x59300000, 0x44006800, - 0x5c006800, 0x1c01f000, 0x59300c06, 0x82040580, - 0x00000005, 0x040007fb, 0x82040580, 0x00000011, - 0x040007f8, 0x82040580, 0x00000006, 0x040007f5, - 0x82040580, 0x00000001, 0x040007f2, 0x0201f800, - 0x001005d8, 0x4933c857, 0x4c080000, 0x4c0c0000, - 0x4c580000, 0x59a8101d, 0x59cc1807, 0x820c1d00, - 0x00ffffff, 0x800c0110, 0x80083580, 0x04020014, - 0x83cc1400, 0x00000008, 0x4200b000, 0x00000002, - 0x59300009, 0x82001c00, 0x00000006, 0x0201f800, - 0x0010855a, 0x0402000a, 0x83cc1400, 0x0000000a, - 0x4200b000, 0x00000002, 0x59300009, 0x82001c00, - 0x00000008, 0x0201f800, 0x0010855a, 0x5c00b000, - 0x5c001800, 0x5c001000, 0x1c01f000, 0x4933c856, - 0x0201f800, 0x0010421b, 0x0201f000, 0x00101e45, - 0x493bc857, 0x4d2c0000, 0x0201f800, 0x001007e4, - 0x02000800, 0x001005d8, 0x832cac00, 0x00000005, - 0x4c580000, 0x4c540000, 0x4200b000, 0x00000006, - 0x4578a800, 0x8054a800, 0x8058b040, 0x040207fd, - 0x83380580, 0x00000046, 0x04020004, 0x4a025a04, - 0x00000144, 0x0401f008, 0x4a025a04, 0x00000146, - 0x83380580, 0x00000041, 0x04000003, 0x4a025a06, - 0x00000001, 0x59cc0007, 0x82000500, 0xff000000, - 0x80000110, 0x59cc1008, 0x82081500, 0xff000000, - 0x80081540, 0x480a580a, 0x83380580, 0x00000046, - 0x04020006, 0x59cc0007, 0x82000500, 0x00ffffff, - 0x4802580b, 0x0401f005, 0x59cc0008, 0x82000500, - 0x00ffffff, 0x4802580b, 0x83380580, 0x00000046, - 0x04020004, 0x83cc1400, 0x00000009, 0x0401f003, - 0x83cc1400, 0x0000000d, 0x50080000, 0x9c0001c0, - 0x4802580c, 0x80081000, 0x50080000, 0x9c0001c0, - 0x4802580d, 0x83380580, 0x00000046, 0x04020008, - 0x59cc000b, 0x9c0001c0, 0x4802580e, 0x59cc000c, - 0x9c0001c0, 0x4802580f, 0x0401f007, 0x59cc000f, - 0x9c0001c0, 0x4802580e, 0x59cc0010, 0x9c0001c0, - 0x4802580f, 0x83380580, 0x00000046, 0x04020004, - 0x83cc1400, 0x00000011, 0x0401f003, 0x83cc1400, - 0x00000015, 0x412c3000, 0x82183400, 0x00000010, - 0x4200b000, 0x00000004, 0x50080000, 0x9c0001c0, - 0x44003000, 0x80081000, 0x80183000, 0x8058b040, - 0x040207fa, 0x5c00a800, 0x5c00b000, 0x0201f800, - 0x000202da, 0x5c025800, 0x1c01f000, 0x4933c857, - 0x492fc857, 0x59300809, 0x58040200, 0x8c00051e, - 0x04000004, 0x592c0208, 0x84000558, 0x48025a08, - 0x1c01f000, 0x59e0180f, 0x599c0413, 0x800c1000, - 0x80080580, 0x04020002, 0x41781000, 0x59e00010, - 0x59e00810, 0x80040d80, 0x040207fd, 0x80080580, - 0x0400000b, 0x4c080000, 0x599c0814, 0x599c1015, - 0x800c00cc, 0x80040c00, 0x82081440, 0x00000000, - 0x5c001800, 0x82000540, 0x00000001, 0x4803c857, - 0x1c01f000, 0x492fc857, 0x42007000, 0x0010b7f8, - 0x58380807, 0x800409c0, 0x04020005, 0x492c7008, - 0x492c7007, 0x0201f000, 0x00100875, 0x492c0800, - 0x492c7007, 0x1c01f000, 0x59300203, 0x4933c857, - 0x4937c857, 0x493bc857, 0x4803c857, 0x82003480, - 0x0000000e, 0x02021800, 0x001005d8, 0x0c01f001, - 0x0010a6da, 0x0010a82c, 0x0010a6da, 0x0010a6da, - 0x0010a6da, 0x0010a6da, 0x0010a6da, 0x0010a791, - 0x0010a6dc, 0x0010a6da, 0x0010a6da, 0x0010a6da, - 0x0010a6da, 0x0010a6da, 0x0201f800, 0x001005d8, - 0x83380580, 0x0000004c, 0x02020800, 0x001005d8, - 0x0201f800, 0x001048ec, 0x04020020, 0x59a80826, - 0x82040500, 0x00000009, 0x82000580, 0x00000008, - 0x0400001a, 0x8c040d12, 0x0400003d, 0x59cc0806, - 0x82040d00, 0xff000000, 0x82040580, 0x03000000, - 0x0400001f, 0x82040580, 0x50000000, 0x04000005, - 0x82040580, 0x52000000, 0x02020000, 0x0002077d, - 0x813669c0, 0x04000006, 0x4d3c0000, 0x417a7800, - 0x0201f800, 0x0010203c, 0x5c027800, 0x4a026403, - 0x00000001, 0x0401f014, 0x59cc0806, 0x82040d00, - 0xff000000, 0x82040580, 0x03000000, 0x04000008, - 0x82040580, 0x50000000, 0x04000005, 0x82040580, - 0x52000000, 0x02020000, 0x0002077d, 0x4a026403, - 0x00000009, 0x4a02641a, 0x00000009, 0x4a02621a, - 0x00000000, 0x813669c0, 0x0402000b, 0x59cc0001, - 0x0201f800, 0x00105c9a, 0x02020000, 0x0002077d, - 0x0201f800, 0x001045a6, 0x02020000, 0x0002077d, - 0x49366009, 0x4a026406, 0x00000004, 0x4a026203, - 0x00000001, 0x0201f000, 0x0010672b, 0x0201f800, - 0x00103b25, 0x04000023, 0x59cc0806, 0x4807c857, - 0x82040d00, 0xff000000, 0x82040580, 0x03000000, - 0x04000033, 0x82040580, 0x20000000, 0x04000041, - 0x82040580, 0x21000000, 0x04000052, 0x82040580, - 0x24000000, 0x0400004f, 0x82040580, 0x50000000, - 0x0400004c, 0x82040580, 0x52000000, 0x04000049, - 0x82040580, 0x05000000, 0x0402000d, 0x59cc0806, - 0x82040d00, 0xff000000, 0x9c0431c0, 0x42028000, - 0x00000046, 0x42002800, 0x00000001, 0x0401fcf3, - 0x0401f93c, 0x02000800, 0x001005d8, 0x42002000, - 0x00000051, 0x0201f800, 0x00107a4a, 0x59cc0000, - 0x82000500, 0x00ffffff, 0x82000580, 0x00ffffff, - 0x04000005, 0x4a026203, 0x00000007, 0x493a6403, - 0x1c01f000, 0x59325817, 0x812e59c0, 0x02020800, - 0x001007fd, 0x0201f000, 0x0002077d, 0x813669c0, - 0x040007df, 0x59340400, 0x82000500, 0x000000ff, - 0x82000580, 0x00000003, 0x040207d9, 0x0401fc6f, - 0x040207d7, 0x4a026403, 0x00000009, 0x4a02641a, - 0x0000000e, 0x4a02621a, 0x00001900, 0x0401f7a2, - 0x813669c0, 0x0400000c, 0x59340c00, 0x82040500, - 0x000000ff, 0x82000580, 0x00000009, 0x04000794, - 0x82040500, 0x0000ff00, 0x82000580, 0x00000700, - 0x040207c3, 0x4a026403, 0x00000009, 0x4a02641a, - 0x00000009, 0x4a02621a, 0x00001e00, 0x0401f78e, - 0x813669c0, 0x040007f8, 0x59340c00, 0x82040500, - 0x0000ff00, 0x82000580, 0x00000700, 0x040007f2, - 0x0401f7b3, 0x4d2c0000, 0x4c580000, 0x4c500000, - 0x4c540000, 0x41385000, 0x83380580, 0x00000054, - 0x02020800, 0x001005d8, 0x59325808, 0x592c0c0b, - 0x82040d00, 0x0000e000, 0x82040580, 0x00002000, - 0x04020076, 0x59300817, 0x800409c0, 0x04000014, - 0x58041404, 0x41cca800, 0x8204a400, 0x00000005, - 0x82080480, 0x00000010, 0x04021004, 0x4008b000, - 0x0401fb6b, 0x0401f00a, 0x40001000, 0x4200b000, - 0x0000000f, 0x0401fb66, 0x58040801, 0x800409c0, - 0x040207f2, 0x0201f800, 0x001005d8, 0x813669c0, - 0x0400005e, 0x59344c00, 0x592c0c09, 0x4807c857, - 0x4827c857, 0x82040d00, 0x000000ff, 0x82040580, - 0x00000003, 0x0400002a, 0x82040580, 0x00000005, - 0x04000032, 0x82040580, 0x00000020, 0x04000036, - 0x82040580, 0x00000052, 0x04000042, 0x82040580, - 0x00000050, 0x04000042, 0x82040580, 0x00000021, - 0x04000004, 0x82040580, 0x00000024, 0x04020043, - 0x82240500, 0x0000ff00, 0x82000580, 0x00000007, - 0x04000008, 0x42000800, 0x00000009, 0x0201f800, - 0x00104571, 0x42005000, 0x0000000c, 0x0401f037, - 0x4a025a06, 0x00000031, 0x4a02580d, 0x00000009, - 0x59340400, 0x4802580e, 0x0201f800, 0x000202da, - 0x0201f800, 0x00107911, 0x0401f03d, 0x0201f800, - 0x001042b4, 0x0201f800, 0x0010462a, 0x42000800, - 0x00000003, 0x0201f800, 0x00104571, 0x42005000, - 0x00000008, 0x0401f021, 0x59cc0007, 0x0201f800, - 0x00105eec, 0x0402001d, 0x0201f800, 0x001042b4, - 0x0401f01a, 0x82240500, 0x0000ff00, 0x82000580, - 0x00000007, 0x040007df, 0x82240500, 0x000000ff, - 0x82000580, 0x00000009, 0x040007da, 0x0201f800, - 0x0010468d, 0x42005000, 0x0000000a, 0x0401f00b, - 0x42005000, 0x0000000e, 0x0401f003, 0x42005000, - 0x00000010, 0x82240500, 0x0000ff00, 0x82000580, - 0x00000007, 0x040007cb, 0x482a6403, 0x4a026203, - 0x00000001, 0x592c000d, 0x48026011, 0x497a6013, - 0x59a80038, 0x48026206, 0x417a7800, 0x0201f800, - 0x0010672b, 0x59325817, 0x812e59c0, 0x04000004, - 0x0201f800, 0x001007fd, 0x497a6017, 0x5c00a800, - 0x5c00a000, 0x5c00b000, 0x5c025800, 0x1c01f000, - 0x4d2c0000, 0x59325808, 0x83380580, 0x00000013, - 0x04020029, 0x59300c03, 0x82040580, 0x00000054, - 0x0400001e, 0x82040580, 0x00000010, 0x04000018, - 0x82040580, 0x0000000e, 0x04000015, 0x82040580, - 0x00000008, 0x0400000d, 0x82040580, 0x0000000c, - 0x0400000a, 0x82040580, 0x0000000a, 0x02020800, - 0x001005d8, 0x42000800, 0x00000006, 0x0201f800, - 0x00104571, 0x0401f009, 0x42000800, 0x00000004, - 0x0201f800, 0x00104571, 0x0401f004, 0x59340200, - 0x8400051a, 0x48026a00, 0x4a025a06, 0x00000000, - 0x0201f800, 0x000202da, 0x0201f800, 0x0002077d, - 0x0401f022, 0x83380580, 0x00000027, 0x0400000e, - 0x83380580, 0x00000014, 0x02020800, 0x001005d8, - 0x0201f800, 0x00106bbf, 0x42028000, 0x00000031, - 0x42000800, 0x00000004, 0x42001000, 0x000000ff, - 0x0401f009, 0x0201f800, 0x00106bbf, 0x42028000, - 0x00000031, 0x42000800, 0x00000004, 0x42001000, - 0x00000010, 0x49425a06, 0x4806580d, 0x480a580e, - 0x0201f800, 0x000202da, 0x0201f800, 0x00104c19, - 0x0201f800, 0x00107911, 0x5c025800, 0x1c01f000, - 0x42007000, 0x0010b7f8, 0x58380807, 0x800409c0, - 0x04020005, 0x492c7008, 0x492c7007, 0x0201f000, - 0x00100875, 0x492c0800, 0x492c7007, 0x1c01f000, - 0x4d2c0000, 0x4c580000, 0x4c500000, 0x4c540000, - 0x4933c857, 0x4937c857, 0x59cc0806, 0x4807c857, - 0x82040d00, 0xff000000, 0x82040580, 0x03000000, - 0x0400000d, 0x82040580, 0x05000000, 0x0400000a, - 0x82040580, 0x21000000, 0x04000030, 0x82040580, - 0x24000000, 0x0400002d, 0x82040580, 0x20000000, - 0x0402002f, 0x0201f800, 0x001007e4, 0x0400002c, - 0x492fc857, 0x492e6017, 0x59a8b016, 0x8258b400, - 0x0000001b, 0x8258b500, 0xfffffffc, 0x8058b104, - 0x485a5c04, 0x412c7800, 0x41cca000, 0x82580480, - 0x00000010, 0x04021005, 0x832cac00, 0x00000005, - 0x0401fa63, 0x0401f015, 0x40580800, 0x4200b000, - 0x0000000f, 0x832cac00, 0x00000005, 0x0401fa5c, - 0x8204b480, 0x0000000f, 0x0201f800, 0x001007e4, - 0x04000004, 0x492c7801, 0x412c7800, 0x0401f7ec, - 0x59325817, 0x0201f800, 0x001007fd, 0x497a6017, - 0x80000580, 0x0401f006, 0x59340200, 0x84000554, - 0x48026a00, 0x82000540, 0x00000001, 0x5c00a800, - 0x5c00a000, 0x5c00b000, 0x5c025800, 0x1c01f000, - 0x4933c857, 0x492fc857, 0x4d2c0000, 0x59300a03, - 0x82040580, 0x00000007, 0x04000036, 0x82040580, - 0x00000001, 0x02020800, 0x001005d8, 0x0201f800, - 0x00106c55, 0x4df00000, 0x598c000d, 0x81300580, - 0x04020016, 0x59300004, 0x8c000520, 0x04000004, - 0x84000520, 0x48026004, 0x0401f016, 0x42001000, - 0x0010b7f6, 0x50081000, 0x58080002, 0x82000580, - 0x00000100, 0x04000006, 0x5808000c, 0x81300580, - 0x02020800, 0x001005d8, 0x0401f00a, 0x0201f800, - 0x00106e8e, 0x04020020, 0x59300004, 0x8c000520, - 0x04000004, 0x84000520, 0x48026004, 0x0401f003, - 0x0201f800, 0x001068d3, 0x5c03e000, 0x02000800, - 0x00106c4b, 0x0201f800, 0x00109037, 0x02000800, - 0x001005d8, 0x59325808, 0x4a025a06, 0x00000005, - 0x0201f800, 0x000202da, 0x0201f800, 0x00104c19, - 0x59325817, 0x812e59c0, 0x02020800, 0x001007fd, - 0x0201f800, 0x00107911, 0x80000580, 0x5c025800, - 0x1c01f000, 0x5c03e000, 0x02000800, 0x00106c4b, - 0x59300406, 0x82000580, 0x00000011, 0x040007b8, - 0x0401f7f7, 0x4c040000, 0x59340200, 0x4803c857, - 0x8c00051c, 0x04000009, 0x59cc0805, 0x591c0019, - 0x4803c857, 0x80040580, 0x04000004, 0x80000580, - 0x4803c856, 0x0401f003, 0x82000540, 0x00000001, - 0x5c000800, 0x1c01f000, 0x4c000000, 0x4c0c0000, - 0x4c100000, 0x42001800, 0x0000ffff, 0x42002000, - 0x00000004, 0x0401f010, 0x4c000000, 0x4c0c0000, - 0x4c100000, 0x59302009, 0x58101c03, 0x42002000, - 0x00000004, 0x0401f008, 0x4c000000, 0x4c0c0000, - 0x4c100000, 0x59302009, 0x58101c03, 0x42002000, - 0x00000007, 0x480fc857, 0x4813c857, 0x481bc857, - 0x0201f800, 0x00103aae, 0x5c002000, 0x5c001800, - 0x5c000000, 0x1c01f000, 0x83380580, 0x00000092, - 0x02020800, 0x001005d8, 0x42000800, 0x80000040, - 0x4a026203, 0x00000001, 0x493a6403, 0x0201f000, - 0x00020721, 0x4d400000, 0x0201f800, 0x00103b25, - 0x04000008, 0x59a80005, 0x84000544, 0x48035005, - 0x42028000, 0x0000002a, 0x0201f800, 0x0010a449, - 0x5c028000, 0x1c01f000, 0x59a80026, 0x8c000508, - 0x04000005, 0x599c0017, 0x8c00050a, 0x04020002, - 0x1c01f000, 0x82000540, 0x00000001, 0x1c01f000, - 0x59300420, 0x84000540, 0x48026420, 0x1c01f000, - 0x4817c857, 0x4c000000, 0x4c040000, 0x8c142d2a, - 0x04000004, 0x598800b8, 0x80000000, 0x480310b8, - 0x8c142d2e, 0x04000004, 0x598800b9, 0x80000000, - 0x480310b9, 0x8c142d2c, 0x04000013, 0x40140000, - 0x82000500, 0x00070000, 0x82000d80, 0x00030000, - 0x0400000d, 0x82000d80, 0x00040000, 0x0400000a, - 0x82000d80, 0x00050000, 0x04000007, 0x59880005, - 0x80000000, 0x48031005, 0x598800ba, 0x80000000, - 0x480310ba, 0x5c000800, 0x5c000000, 0x1c01f000, - 0x4817c857, 0x4c000000, 0x4c040000, 0x8c142d2a, - 0x04000004, 0x598800bb, 0x80000000, 0x480310bb, - 0x8c142d2e, 0x04000004, 0x598800bc, 0x80000000, - 0x480310bc, 0x8c142d2c, 0x04000013, 0x40140000, - 0x82000500, 0x00070000, 0x82000d80, 0x00030000, - 0x0400000d, 0x82000d80, 0x00040000, 0x0400000a, - 0x82000d80, 0x00050000, 0x04000007, 0x59880005, - 0x80000000, 0x48031005, 0x598800bd, 0x80000000, - 0x480310bd, 0x5c000800, 0x5c000000, 0x1c01f000, - 0x4c000000, 0x59880001, 0x80000000, 0x4803c857, - 0x48031001, 0x5c000000, 0x1c01f000, 0x4c000000, - 0x59880000, 0x80000000, 0x4803c857, 0x48031000, - 0x5c000000, 0x1c01f000, 0x4c000000, 0x59880002, - 0x80000000, 0x4803c857, 0x48031002, 0x5c000000, - 0x1c01f000, 0x4807c857, 0x4c000000, 0x8c040d2c, - 0x04000004, 0x598800a6, 0x80000000, 0x480310a6, - 0x8c040d2a, 0x04000004, 0x598800a7, 0x80000000, - 0x480310a7, 0x8c040d28, 0x04000004, 0x598800a8, - 0x80000000, 0x480310a8, 0x8c040d26, 0x04000004, - 0x598800a9, 0x80000000, 0x480310a9, 0x8c040d24, - 0x04000004, 0x598800aa, 0x80000000, 0x480310aa, - 0x8c040d22, 0x04000004, 0x598800ab, 0x80000000, - 0x480310ab, 0x8c040d20, 0x04000004, 0x598800ac, - 0x80000000, 0x480310ac, 0x5c000000, 0x1c01f000, - 0x4807c857, 0x4c000000, 0x598800ad, 0x80000000, - 0x480310ad, 0x5c000000, 0x1c01f000, 0x4807c857, - 0x4c000000, 0x8c040d1c, 0x04000004, 0x598800ae, - 0x80000000, 0x480310ae, 0x8c040d1a, 0x04000004, - 0x598800af, 0x80000000, 0x480310af, 0x5c000000, - 0x1c01f000, 0x4807c857, 0x4c000000, 0x8c040d18, - 0x04000004, 0x598800b0, 0x80000000, 0x480310b0, - 0x8c040d16, 0x04000004, 0x598800b1, 0x80000000, - 0x480310b1, 0x8c040d14, 0x04000004, 0x598800b2, - 0x80000000, 0x480310b2, 0x5c000000, 0x1c01f000, - 0x4807c857, 0x4c000000, 0x8c040d10, 0x04000004, - 0x598800b3, 0x80000000, 0x480310b3, 0x8c040d0c, - 0x04000004, 0x598800b4, 0x80000000, 0x480310b4, - 0x5c000000, 0x1c01f000, 0x4807c857, 0x4c000000, - 0x8c040d08, 0x04000004, 0x598800b5, 0x80000000, - 0x480310b5, 0x8c040d04, 0x04000004, 0x598800b6, - 0x80000000, 0x480310b6, 0x5c000000, 0x1c01f000, - 0x4807c856, 0x4c000000, 0x5988007f, 0x80000000, - 0x4803107f, 0x5c000000, 0x1c01f000, 0x4803c857, - 0x4c040000, 0x50000800, 0x80040800, 0x4807c857, - 0x44040000, 0x5c000800, 0x1c01f000, 0x480fc857, - 0x4c000000, 0x820c0580, 0x00000000, 0x04020004, - 0x42000000, 0x0010b819, 0x0401f014, 0x820c0580, - 0x00001001, 0x04020004, 0x42000000, 0x0010b81a, - 0x0401f00e, 0x820c0580, 0x00001002, 0x04020004, - 0x42000000, 0x0010b81b, 0x0401f008, 0x820c0c80, - 0x0000201c, 0x02021800, 0x001005d8, 0x820c0500, - 0x0000001f, 0x0c01f804, 0x0401ffdd, 0x5c000000, - 0x1c01f000, 0x0010aa89, 0x0010aa8c, 0x0010aa8f, - 0x0010aa92, 0x0010aa95, 0x0010aa98, 0x0010aa9b, - 0x0010aa9e, 0x0010aaa1, 0x0010aaa4, 0x0010aaa7, - 0x0010aaaa, 0x0010aaad, 0x0010aab0, 0x0010aab3, - 0x0010aab6, 0x0010aab9, 0x0010aabc, 0x0010aabf, - 0x0010aac2, 0x0010aac5, 0x0010aac8, 0x0010aacb, - 0x0010aace, 0x0010aad1, 0x0010aad4, 0x0010aad7, - 0x0010aada, 0x42000000, 0x0010b81c, 0x1c01f000, - 0x42000000, 0x0010b81d, 0x1c01f000, 0x42000000, - 0x0010b81e, 0x1c01f000, 0x42000000, 0x0010b81f, - 0x1c01f000, 0x42000000, 0x0010b820, 0x1c01f000, - 0x42000000, 0x0010b821, 0x1c01f000, 0x42000000, - 0x0010b822, 0x1c01f000, 0x42000000, 0x0010b823, - 0x1c01f000, 0x42000000, 0x0010b824, 0x1c01f000, - 0x42000000, 0x0010b825, 0x1c01f000, 0x42000000, - 0x0010b826, 0x1c01f000, 0x42000000, 0x0010b827, - 0x1c01f000, 0x42000000, 0x0010b828, 0x1c01f000, - 0x42000000, 0x0010b829, 0x1c01f000, 0x42000000, - 0x0010b82a, 0x1c01f000, 0x42000000, 0x0010b82b, - 0x1c01f000, 0x42000000, 0x0010b82c, 0x1c01f000, - 0x42000000, 0x0010b82d, 0x1c01f000, 0x42000000, - 0x0010b82e, 0x1c01f000, 0x42000000, 0x0010b82f, - 0x1c01f000, 0x42000000, 0x0010b830, 0x1c01f000, - 0x42000000, 0x0010b831, 0x1c01f000, 0x42000000, - 0x0010b832, 0x1c01f000, 0x42000000, 0x0010b833, - 0x1c01f000, 0x42000000, 0x0010b834, 0x1c01f000, - 0x42000000, 0x0010b835, 0x1c01f000, 0x42000000, - 0x0010b836, 0x1c01f000, 0x42000000, 0x0010b837, - 0x1c01f000, 0x480fc857, 0x4c000000, 0x820c0580, - 0x00000001, 0x04020004, 0x42000000, 0x0010b80e, - 0x0401f012, 0x820c0580, 0x00000002, 0x04020004, - 0x42000000, 0x0010b80f, 0x0401f00c, 0x820c0580, - 0x00000003, 0x04020004, 0x42000000, 0x0010b810, - 0x0401f006, 0x820c0580, 0x00000004, 0x04020004, - 0x42000000, 0x0010b811, 0x0401ff51, 0x5c000000, - 0x1c01f000, 0x4c000000, 0x59a80026, 0x4803c857, - 0x8c000502, 0x04000010, 0x8c000506, 0x04000004, - 0x42000000, 0x0010b841, 0x0401f012, 0x8c00050a, - 0x04000004, 0x42000000, 0x0010b840, 0x0401f00d, - 0x8c000508, 0x04000004, 0x42000000, 0x0010b843, - 0x0401f008, 0x0201f800, 0x0010513b, 0x04000006, - 0x8c000506, 0x04020004, 0x42000000, 0x0010b842, - 0x0401ff33, 0x5c000000, 0x1c01f000, 0x8058b1c0, - 0x02000800, 0x001005d8, 0x5450a800, 0x8050a000, - 0x8054a800, 0x8058b040, 0x040207fc, 0x1c01f000, - 0x8058b1c0, 0x02000800, 0x001005d8, 0x4450a800, - 0x8054a800, 0x8058b040, 0x040207fd, 0x1c01f000, - 0x8058b1c0, 0x02000800, 0x001005d8, 0x50500000, - 0x9c0001c0, 0x4400a800, 0x8050a000, 0x8054a800, - 0x8058b040, 0x040207fa, 0x1c01f000, 0x4c000000, - 0x59a80008, 0x8c00051c, 0x5c000000, 0x1c01f000, - 0x00000001, 0x00000002, 0x00000004, 0x00000008, - 0x00000010, 0x00000020, 0x00000040, 0x00000080, - 0x00000100, 0x00000200, 0x00000400, 0x00000800, - 0x00001000, 0x00002000, 0x00004000, 0x00008000, - 0x00010000, 0xa5f2b3ac -}; - -#ifdef UNIQUE_FW_NAME -uint32_t fw2400_length01 = 0x0000ab4a ; -#else -uint32_t risc_code_length01 = 0x0000ab4a ; -#endif - - -#ifdef UNIQUE_FW_NAME -uint32_t fw2400_addr02 = 0x0010e000 ; -#else -uint32_t risc_code_addr02 = 0x0010e000 ; -#endif - -#ifdef UNIQUE_FW_NAME -uint32_t fw2400_code02[] = { -#else -uint32_t risc_code02[] = { -#endif - 0x00000000, 0x00000000, 0x0010e000, 0x000014ff, - 0x00000000, 0x00000000, 0x00020000, 0x000008c0, - 0x836c0580, 0x00000003, 0x02020000, 0x001002e3, - 0x42000000, 0x0010b4bb, 0x50000000, 0x800001c0, - 0x04020956, 0x0401f923, 0x0401fbe3, 0x0401fb5c, - 0x0201f800, 0x00020718, 0x0201f800, 0x0002057b, - 0x0401f7f0, 0x59b800ea, 0x82000d00, 0xf0000038, - 0x02020000, 0x00100a7a, 0x8c000510, 0x02000000, - 0x00100a79, 0x59ba60e0, 0x81300182, 0x0402104e, - 0x04002030, 0x8532653e, 0x59300406, 0x82000580, - 0x00000003, 0x04020028, 0x59300203, 0x82000580, - 0x00000004, 0x04020024, 0x59325808, 0x59300402, - 0x4a025a04, 0x00000103, 0x900001c0, 0x48025806, - 0x497a5807, 0x497a5c09, 0x5930001f, 0x80000540, - 0x02020800, 0x00100d56, 0x59300004, 0x8c00053e, - 0x04020010, 0x0401fa88, 0x59326809, 0x0201f800, - 0x0002077d, 0x5934000f, 0x5934140b, 0x80081040, - 0x04001002, 0x480a6c0b, 0x80000540, 0x04020a10, - 0x59b800ea, 0x8c000510, 0x040207d7, 0x1c01f000, - 0x0201f800, 0x00106f60, 0x040007ef, 0x0201f000, - 0x00100a65, 0x42027000, 0x00000055, 0x0401f027, - 0x83326500, 0x3fffffff, 0x59300406, 0x82000580, - 0x00000003, 0x04020015, 0x59325808, 0x59326809, - 0x59301402, 0x4a025a04, 0x00000103, 0x900811c0, - 0x480a5806, 0x497a5c09, 0x497a5807, 0x0401fa62, - 0x0201f800, 0x0002077d, 0x5934000f, 0x5934140b, - 0x80081040, 0x04001002, 0x480a6c0b, 0x80000540, - 0x040209eb, 0x0401f7db, 0x42027000, 0x00000054, - 0x0401f00a, 0x83300500, 0x60000000, 0x02000000, - 0x00100a68, 0x81326580, 0x8000013a, 0x82000400, - 0x00100a80, 0x50027000, 0x59300c06, 0x82040580, - 0x00000002, 0x02000000, 0x00100a65, 0x59300004, - 0x8c00053e, 0x04020004, 0x0201f800, 0x000207a1, - 0x0401f7c4, 0x0201f800, 0x00106f60, 0x040007fb, - 0x0201f000, 0x00100a65, 0x59325808, 0x412c7000, - 0x58380a04, 0x82040500, 0x0000000f, 0x82000c00, - 0x001010bd, 0x50044000, 0x0c01f001, 0x00100dd9, - 0x00100dd9, 0x0002009f, 0x00100dd9, 0x00100dd9, - 0x00100dd9, 0x00100dd9, 0x00100dd9, 0x000200af, - 0x00100ded, 0x00100dd9, 0x00100dd9, 0x00100ddb, - 0x00100dd9, 0x00100dd9, 0x00100dd9, 0x5838040a, - 0x8c000500, 0x02000800, 0x001005d8, 0x50200000, - 0x80387c00, 0x583c1002, 0x583c2800, 0x583c2001, - 0x58380a07, 0x5838300f, 0x59303807, 0x58384c08, - 0x5838000d, 0x48026012, 0x0401f010, 0x5838020a, - 0x8c000502, 0x02000000, 0x00100dd9, 0x50200000, - 0x80387c00, 0x583c2800, 0x583c2001, 0x583c1002, - 0x592c0a07, 0x592c4c08, 0x592c300f, 0x59303807, - 0x497a6012, 0x497a6013, 0x4816600e, 0x4812600f, - 0x480a6010, 0x481a6011, 0x80040840, 0x4806600d, - 0x02020000, 0x00100e1a, 0x841c3d40, 0x481e6007, - 0x1c01f000, 0x41787800, 0x59325808, 0x592c0c0a, - 0x8c040d02, 0x02000000, 0x00100f8c, 0x592c000d, - 0x592c100f, 0x592c0a04, 0x480a6011, 0x48026012, - 0x48026013, 0x412c3000, 0x82040500, 0x0000000f, - 0x82000400, 0x001010bd, 0x50003800, 0x501c0000, - 0x401c1000, 0x592c1a07, 0x4802600a, 0x481a600b, - 0x480a600c, 0x480e600d, 0x843c7d4a, 0x403c1000, - 0x1c01f000, 0x41787800, 0x497a6012, 0x592c0a04, - 0x412c3000, 0x592c1a07, 0x82040500, 0x0000000f, - 0x82000400, 0x001010bd, 0x50004000, 0x50200000, - 0x40201000, 0x4802600a, 0x481a600b, 0x480a600c, - 0x480e600d, 0x80000580, 0x483e6004, 0x1c01f000, - 0x4c000000, 0x4df00000, 0x0201f800, 0x00020729, - 0x0401f005, 0x4c000000, 0x4df00000, 0x0401ff16, - 0x0401f001, 0x5c03e000, 0x5c000000, 0x1801f000, - 0x4203e000, 0xb0100000, 0x41fc0000, 0x82000500, - 0x00000011, 0x0c01f001, 0x0002012a, 0x00020697, - 0x0002012a, 0x0002012a, 0x0002012a, 0x0002012a, - 0x0002012a, 0x0002012a, 0x0002012a, 0x0002012a, - 0x0002012a, 0x0002012a, 0x0002012a, 0x0002012a, - 0x0002012a, 0x0002012a, 0x0010115a, 0x0002012c, - 0x0002012a, 0x0002012a, 0x0002012a, 0x0002012a, - 0x0002012a, 0x0002012a, 0x0002012a, 0x0002012a, - 0x0002012a, 0x0002012a, 0x0002012a, 0x0002012a, - 0x0002012a, 0x0002012a, 0x0201f800, 0x001005d8, - 0x0201f800, 0x00020697, 0x0201f000, 0x0010115a, - 0x42000000, 0x0010b4c1, 0x50000000, 0x8c000504, - 0x04000014, 0x42000000, 0x0010b4c1, 0x50000000, - 0x8c000502, 0x04020002, 0x1c01f000, 0x4df00000, - 0x4203e000, 0x50000000, 0x42034000, 0x0010b4a4, - 0x59a0001d, 0x59a1d81e, 0x84000502, 0x4803401d, - 0x58ec0009, 0x0801f800, 0x5c03e000, 0x1c01f000, - 0x04027002, 0x04026002, 0x1c01f000, 0x4df00000, - 0x4203e000, 0x50000000, 0x0201f800, 0x001007e4, - 0x04000010, 0x412dd800, 0x48efc857, 0x0201f800, - 0x00103b28, 0x42034000, 0x0010b4a4, 0x49a1d80b, - 0x48ef401e, 0x59a0001d, 0x84000544, 0x4803401d, - 0x0201f800, 0x00102214, 0x0201f800, 0x00102233, - 0x5c03e000, 0x1c01f000, 0x4da00000, 0x4df00000, - 0x4203e000, 0x50000000, 0x04006051, 0x40001000, - 0x42034000, 0x0010b4a4, 0x59a01818, 0x800c19c0, - 0x04020008, 0x59a0381b, 0x801c39c0, 0x02000800, - 0x001005d8, 0x59a0041c, 0x801c3c00, 0x0401f00c, - 0x59a00419, 0x82000400, 0x00000002, 0x48034419, - 0x82000c80, 0x00000013, 0x04001003, 0x497b4419, - 0x41780000, 0x59a03816, 0x801c3c00, 0x80081040, - 0x480b4017, 0x581c0200, 0x4803c021, 0x581c0401, - 0x4803c022, 0x581c0201, 0x4803c023, 0x581c0400, - 0x4803c020, 0x900001c0, 0x82000540, 0x00000012, - 0x4803c011, 0x59e00017, 0x8c000508, 0x04000003, - 0x4a03c017, 0x00000002, 0x4203e000, 0x30000001, - 0x800c19c0, 0x04000007, 0x800c1840, 0x480f4018, - 0x0402001f, 0x497b4419, 0x497b4219, 0x0401f01c, - 0x800811c0, 0x0402000b, 0x4d2c0000, 0x59a2581b, - 0x0201f800, 0x001007f4, 0x5c025800, 0x497b401b, - 0x497b401a, 0x497b441c, 0x497b421c, 0x0401f010, - 0x59a0041c, 0x82000400, 0x00000002, 0x82000c80, - 0x00000012, 0x4803441c, 0x04001009, 0x4d2c0000, - 0x59a2581b, 0x592c3813, 0x481f401b, 0x497b441c, - 0x0201f800, 0x001007f4, 0x5c025800, 0x5c03e000, - 0x5c034000, 0x1c01f000, 0x59a80005, 0x82000500, - 0x00000003, 0x02020000, 0x00104315, 0x59340400, - 0x82000580, 0x00000606, 0x02020000, 0x001042e6, - 0x5934000d, 0x80027d40, 0x02020000, 0x00104321, - 0x0401f803, 0x80000580, 0x1c01f000, 0x5934000f, - 0x59341203, 0x80080540, 0x0402006f, 0x5934020b, - 0x5934140b, 0x80080480, 0x0402106b, 0x0201f800, - 0x0002075a, 0x04000064, 0x80081000, 0x592c0406, - 0x480a6c0b, 0x49366009, 0x492e6008, 0x4a026406, - 0x00000003, 0x4a026403, 0x00000040, 0x800000c2, - 0x800018c4, 0x800c0400, 0x48026206, 0x592c0808, - 0x592c1809, 0x592c020a, 0x48066017, 0x480e6018, - 0x8c000502, 0x04000030, 0x4a026203, 0x00000004, - 0x592c0207, 0x80000040, 0x04020020, 0x59a80005, - 0x8c000514, 0x42000000, 0x00000055, 0x04020003, - 0x42000000, 0x00000033, 0x80000040, 0x040207ff, - 0x592c0204, 0x82000500, 0x000000ff, 0x82000580, - 0x00000018, 0x04020011, 0x592c180f, 0x59300007, - 0x82000540, 0x00000091, 0x480e6011, 0x48026007, - 0x42000000, 0x80000004, 0x48026004, 0x59bc00ea, - 0x8c000516, 0x040207fe, 0x83300400, 0x20000000, - 0x480378e1, 0x1c01f000, 0x0401fe78, 0x59300007, - 0x8400054e, 0x48026007, 0x592c1a04, 0x820c1d00, - 0x000000ff, 0x820c0580, 0x00000048, 0x04000017, - 0x0401f7ec, 0x8c000500, 0x04020ecb, 0x4a026203, - 0x00000002, 0x59a80805, 0x82040500, 0x00000600, - 0x04020012, 0x42000000, 0x00000030, 0x80000040, - 0x040207ff, 0x592c1a04, 0x820c1d00, 0x000000ff, - 0x820c0580, 0x00000018, 0x040007da, 0x820c0580, - 0x00000048, 0x040207d7, 0x42000800, 0x80000804, - 0x0201f000, 0x00106721, 0x8c040d12, 0x42000000, - 0x00000010, 0x040207ee, 0x42000000, 0x00000051, - 0x0401f7eb, 0x800811c0, 0x04020003, 0x4a026a03, - 0x00000001, 0x59340010, 0x492e6810, 0x80000d40, - 0x04020003, 0x492e680f, 0x1c01f000, 0x492c0800, - 0x1c01f000, 0x83440c80, 0x00000800, 0x04021009, - 0x83440400, 0x0010ac00, 0x50000000, 0x80000540, - 0x04000004, 0x40026800, 0x80000580, 0x1c01f000, - 0x82000540, 0x00000001, 0x1c01f000, 0x59340203, - 0x80000540, 0x0402004b, 0x4d300000, 0x4d2c0000, - 0x5934000f, 0x80025d40, 0x04000044, 0x0201f800, - 0x0002075a, 0x0400003f, 0x592c0000, 0x4802680f, - 0x80000540, 0x04020002, 0x48026810, 0x592c2a04, - 0x80081000, 0x480a6c0b, 0x49366009, 0x492e6008, - 0x82142d00, 0x000000ff, 0x82140580, 0x00000012, - 0x04000035, 0x4a026406, 0x00000003, 0x4a026403, - 0x00000040, 0x592c0406, 0x800000c2, 0x800018c4, - 0x800c0400, 0x48026206, 0x592c0808, 0x592c1809, - 0x592c020a, 0x48066017, 0x480e6018, 0x8c000502, - 0x02000000, 0x0010474d, 0x4a026203, 0x00000004, - 0x592c0207, 0x80000040, 0x02020000, 0x00104740, - 0x82140580, 0x00000018, 0x02020000, 0x00104740, - 0x592c180f, 0x59300007, 0x82000540, 0x00000091, - 0x480e6011, 0x48026007, 0x42000000, 0x80000004, - 0x48026004, 0x59bc00ea, 0x8c000516, 0x040207fe, - 0x83300400, 0x20000000, 0x480378e1, 0x5934020b, - 0x5934140b, 0x80080480, 0x040017be, 0x0401f003, - 0x4a026a03, 0x00000001, 0x5c025800, 0x5c026000, - 0x1c01f000, 0x497a5800, 0x49325809, 0x4a026406, - 0x00000006, 0x4a026203, 0x00000007, 0x0401f802, - 0x0401f7ef, 0x59a80021, 0x800001c0, 0x02020000, - 0x0010476f, 0x59a80005, 0x8c000504, 0x02020000, - 0x0010476b, 0x59340200, 0x8c000518, 0x02020000, - 0x00104767, 0x592c0a0c, 0x48066202, 0x4a025a06, - 0x00000000, 0x8c000508, 0x02020000, 0x00104763, - 0x4d3c0000, 0x417a7800, 0x0401fbdf, 0x5c027800, - 0x1c01f000, 0x592c0404, 0x8c00051e, 0x02020000, - 0x00104ce4, 0x59980022, 0x80000540, 0x04000017, - 0x592c0a06, 0x592c0409, 0x80040540, 0x04020013, - 0x0201f000, 0x00104cfa, 0x592c0404, 0x8c00051e, - 0x02020000, 0x00104cf3, 0x59980022, 0x80000540, - 0x0400000a, 0x82040580, 0x00000001, 0x04020007, - 0x0201f000, 0x00104cfa, 0x592c0404, 0x8c00051e, - 0x02020000, 0x00104dca, 0x59980026, 0x497a5800, - 0x80000540, 0x02020000, 0x00104e1d, 0x59d80105, - 0x82000d00, 0x00018780, 0x02020000, 0x00104edb, - 0x80000106, 0x82000500, 0x00000003, 0x0c01f001, - 0x000202f0, 0x00104e1d, 0x000202f6, 0x00020341, - 0x592c0001, 0x492fb107, 0x80000d40, 0x02020000, - 0x00104ddb, 0x1c01f000, 0x592c0001, 0x492fb107, - 0x80000d40, 0x02020000, 0x00104de8, 0x59da5908, - 0x835c0480, 0x00000020, 0x0400102c, 0x0402b034, - 0x492fb007, 0x0400e7fa, 0x59d80105, 0x82000500, - 0x00018780, 0x02020000, 0x00104edb, 0x0400601f, - 0x59d8010a, 0x59d8090a, 0x80040580, 0x040207fd, - 0x800408e0, 0x599c1017, 0x8c081508, 0x04020028, - 0x82040d40, 0x00000013, 0x5998002b, 0x4807c011, - 0x84000500, 0x4803302b, 0x59e00017, 0x8c000508, - 0x04020004, 0x4203e000, 0x30000001, 0x1c01f000, - 0x4a03c017, 0x00000003, 0x82040500, 0x000000ff, - 0x82000580, 0x0000001d, 0x040207f7, 0x4a03c017, - 0x0000000d, 0x0401f7f4, 0x5998082b, 0x84040d40, - 0x4807302b, 0x1c01f000, 0x496a5800, 0x412ed000, - 0x815eb800, 0x59c80000, 0x82000540, 0x00001200, - 0x48039000, 0x0400e7ca, 0x0401f7d0, 0x0402f7f7, - 0x492fa807, 0x0400e7c6, 0x0401f7cc, 0x59e0000f, - 0x59e0100f, 0x80081580, 0x040207fd, 0x81281580, - 0x040007d4, 0x40025000, 0x82040d40, 0x0000001d, - 0x0401f7d2, 0x59d80908, 0x45680800, 0x4006d000, - 0x815eb800, 0x0400e7fc, 0x59c80000, 0x82000540, - 0x00001200, 0x48039000, 0x02006000, 0x00104df8, - 0x59d8010a, 0x59d8090a, 0x80040d80, 0x040207fd, - 0x900001c0, 0x82000540, 0x00000013, 0x4803c011, - 0x5998002b, 0x84000500, 0x4803302b, 0x59e00017, - 0x8c000508, 0x04000003, 0x4a03c017, 0x00000003, - 0x4203e000, 0x30000001, 0x59d80105, 0x82000500, - 0x00018780, 0x02020000, 0x00104edb, 0x0202d000, - 0x00104dfd, 0x592c0001, 0x492fb107, 0x80000d40, - 0x02020000, 0x00104e10, 0x1c01f000, 0x59980020, - 0x0c01f001, 0x00020370, 0x00020371, 0x00104e88, - 0x1c01f000, 0x4df00000, 0x4203e000, 0x50000000, - 0x0402681e, 0x04006004, 0x599c0017, 0x8c000508, - 0x04020865, 0x59980029, 0x80025d40, 0x0400000a, - 0x0402d00b, 0x59980026, 0x80000040, 0x48033026, - 0x592c0000, 0x492fb107, 0x48033029, 0x04020002, - 0x48033028, 0x5c03e000, 0x1c01f000, 0x59d80105, - 0x82000500, 0x00018780, 0x02020000, 0x00104edb, - 0x42000000, 0x0010b855, 0x0201f800, 0x0010aa47, - 0x5c03e000, 0x1c01f000, 0x5998002b, 0x8c000500, - 0x0402003b, 0x0400e007, 0x59d80105, 0x82000500, - 0x00018780, 0x02020000, 0x00104edb, 0x1c01f000, - 0x59da5908, 0x835c0c80, 0x00000020, 0x04001003, - 0x0400b029, 0x0400f02b, 0x496a5800, 0x412ed000, - 0x815eb800, 0x59c80000, 0x82000540, 0x00001200, - 0x48039000, 0x0400e7f3, 0x59d8010a, 0x59d8090a, - 0x80040580, 0x040207fd, 0x800408e0, 0x599c1017, - 0x8c081508, 0x04020022, 0x82040d40, 0x00000013, - 0x4807c011, 0x59e00017, 0x8c000508, 0x0400000a, - 0x4a03c017, 0x00000003, 0x82040500, 0x000000ff, - 0x82000580, 0x0000001d, 0x04020003, 0x4a03c017, - 0x0000000d, 0x4203e000, 0x30000001, 0x59d80105, - 0x82000500, 0x00018780, 0x02020000, 0x00104edb, - 0x1c01f000, 0x492fb007, 0x0400e7d2, 0x0401f7df, - 0x492fa807, 0x0400e7cf, 0x0401f7dc, 0x84000500, - 0x4803302b, 0x0400e7cb, 0x0401f7d8, 0x59e0000f, - 0x59e0100f, 0x80081580, 0x040207fd, 0x81281580, - 0x040007da, 0x40025000, 0x82040d40, 0x0000001d, - 0x0401f7d8, 0x59e0000f, 0x59e0100f, 0x80080d80, - 0x040207fd, 0x81280580, 0x04020002, 0x1c01f000, - 0x400a5000, 0x900811c0, 0x82081540, 0x0000001c, - 0x480bc011, 0x59e00017, 0x8c000508, 0x04000003, - 0x4a03c017, 0x0000000c, 0x4203e000, 0x30000001, - 0x1c01f000, 0x41700000, 0x0c01f001, 0x00105420, - 0x000203fc, 0x00105420, 0x00105421, 0x0010541e, - 0x0010541e, 0x0010541e, 0x0010541e, 0x001058b0, - 0x04010037, 0x59980006, 0x80000540, 0x0402003c, - 0x0402c01c, 0x4202f800, 0x00000010, 0x4df00000, - 0x4203e000, 0x50000000, 0x49db3005, 0x59da5808, - 0x592c0204, 0x497a5800, 0x497a5801, 0x82000500, - 0x000000ff, 0x82000c80, 0x00000079, 0x04021036, - 0x0c01f839, 0x5c03e000, 0x817ef840, 0x04000009, - 0x836c0580, 0x00000003, 0x04020006, 0x83700580, - 0x00000001, 0x04020010, 0x0401001b, 0x0400c7e8, - 0x0400f94a, 0x0400b134, 0x59d40005, 0x82000500, - 0x43018780, 0x02020000, 0x0010583f, 0x59d80005, - 0x82000500, 0x43018780, 0x02020000, 0x00105846, - 0x1c01f000, 0x83700580, 0x00000003, 0x02000800, - 0x00105421, 0x83700580, 0x00000001, 0x040207ed, - 0x04010005, 0x0400c7d2, 0x0401f7ea, 0x4202f800, - 0x00000010, 0x4df00000, 0x4203e000, 0x50000000, - 0x49d73005, 0x59d65808, 0x0401f7ce, 0x4df00000, - 0x4203e000, 0x50000000, 0x40025800, 0x592c0204, - 0x497b3005, 0x497b3006, 0x4202f800, 0x00000010, - 0x0401f7c7, 0x0201f800, 0x00105491, 0x5c03e000, - 0x0401f7d4, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105527, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x001054a1, - 0x00105491, 0x00105491, 0x00105491, 0x00105551, - 0x00105491, 0x00105491, 0x00105491, 0x000204ef, - 0x00105491, 0x001056b4, 0x00105491, 0x00105491, - 0x00105491, 0x000204c2, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x001054c9, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x001057d3, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x0010581e, 0x00105491, - 0x001054bb, 0x00105491, 0x00105797, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105765, 0x00105491, - 0x00105765, 0x00105872, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105725, - 0x00105855, 0x00105491, 0x00105865, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x00105491, 0x00105491, - 0x00105491, 0x00105491, 0x592c0204, 0x80000110, - 0x02000000, 0x00105499, 0x80000040, 0x04000009, - 0x48033002, 0x492f3003, 0x492f3004, 0x4a033008, - 0x000204d0, 0x4202e000, 0x00000003, 0x1c01f000, - 0x592c0406, 0x82000c80, 0x0000199a, 0x02021000, - 0x001054a9, 0x59a80021, 0x80000540, 0x02020000, - 0x001054d7, 0x592e8a06, 0x83440c80, 0x000007f0, - 0x02021000, 0x001054a9, 0x83440400, 0x0010ac00, - 0x50000000, 0x80026d40, 0x02000000, 0x001054db, - 0x59340002, 0x592c0810, 0x80040580, 0x82000500, - 0x00ffffff, 0x02020000, 0x001054a9, 0x0401fccf, - 0x02020000, 0x001054de, 0x1c01f000, 0x592c0204, - 0x80000110, 0x02000000, 0x00105499, 0x80000040, - 0x0402000b, 0x592c040a, 0x8c000504, 0x04000010, - 0x592c0207, 0x82000c80, 0x00001001, 0x02021000, - 0x001054a9, 0x0201f000, 0x0010588a, 0x48033002, - 0x492f3003, 0x492f3004, 0x4a033008, 0x00020507, - 0x4202e000, 0x00000003, 0x1c01f000, 0x592c0406, - 0x82000c80, 0x0000199a, 0x02021000, 0x001054a9, - 0x592e8a06, 0x417a7800, 0x0401fd37, 0x02020000, - 0x00105658, 0x59340002, 0x592c0808, 0x80040580, - 0x82000500, 0x00ffffff, 0x02020000, 0x001054a9, - 0x497a5808, 0x592e6009, 0x83300580, 0xffffffff, - 0x02000000, 0x00105618, 0x83300480, 0x0010d1c0, - 0x02001000, 0x00105675, 0x59a8000b, 0x81300480, - 0x02021000, 0x00105675, 0x592c240a, 0x49366009, - 0x8c10251c, 0x02020000, 0x00105606, 0x59a80068, - 0x8c000510, 0x02020000, 0x0010568e, 0x59a80821, - 0x800409c0, 0x02020000, 0x001055ec, 0x59a80805, - 0x8c040d04, 0x02020000, 0x0010567f, 0x59340200, - 0x8c000518, 0x02020000, 0x00105670, 0x59300c06, - 0x82040580, 0x00000006, 0x02020000, 0x00105610, - 0x59300414, 0x8c000516, 0x02020000, 0x0010567a, - 0x8c102508, 0x02020000, 0x0010a5b8, 0x59300808, - 0x4a025a06, 0x00000000, 0x800409c0, 0x02020000, - 0x001055e7, 0x592c0a0c, 0x48066202, 0x492e6008, - 0x0401f14d, 0x4df00000, 0x4203e000, 0x50000000, - 0x0402b00b, 0x835c0480, 0x00000020, 0x0400100d, - 0x815eb840, 0x416a5800, 0x592ed000, 0x492fb007, - 0x497a5800, 0x497a5801, 0x0400b7f7, 0x59d80005, - 0x82000500, 0x43018780, 0x02020000, 0x00105846, - 0x5c03e000, 0x1c01f000, 0x4df00000, 0x4203e000, - 0x50000000, 0x0402f00b, 0x835c0480, 0x00000020, - 0x0400100d, 0x815eb840, 0x416a5800, 0x592ed000, - 0x492fa807, 0x497a5800, 0x497a5801, 0x0400f7f7, - 0x59d40005, 0x82000500, 0x43018780, 0x02020000, - 0x0010583f, 0x5c03e000, 0x1c01f000, 0x4df00000, - 0x4203e000, 0x50000000, 0x59940024, 0x80000540, - 0x04000112, 0x4c000000, 0x42000000, 0x00001000, - 0x50000000, 0x82000480, 0x24320001, 0x04020015, - 0x42000800, 0x00000064, 0x80040840, 0x04000007, - 0x4a030000, 0x00000001, 0x40000000, 0x59800000, - 0x8c000500, 0x040007f9, 0x04000008, 0x42000800, - 0x00007a01, 0x50040000, 0x8c000510, 0x04000003, - 0x84000510, 0x44000800, 0x4a030000, 0x00000000, - 0x59e00002, 0x8c00051e, 0x0402001b, 0x42000000, - 0x00001000, 0x50000000, 0x82000480, 0x24320002, - 0x04020015, 0x42000800, 0x00000064, 0x80040840, - 0x04000007, 0x4a030000, 0x00000001, 0x40000000, - 0x59800000, 0x8c000500, 0x040007f9, 0x04000008, - 0x42000800, 0x00007a17, 0x50040000, 0x8c00050e, - 0x04020003, 0x8400054e, 0x44000800, 0x4a030000, - 0x00000000, 0x5c000000, 0x5994781a, 0x48032825, - 0x803c0480, 0x04001004, 0x04000003, 0x4803281a, - 0x0401f022, 0x41787800, 0x803c7800, 0x82000400, - 0x000003e8, 0x040027fd, 0x4803281a, 0x59a80024, - 0x803c1400, 0x480b5024, 0x803c0040, 0x04000002, - 0x483fc857, 0x59e40852, 0x59a80025, 0x80040580, - 0x04000004, 0x480bc857, 0x59e40052, 0x48035025, - 0x59940026, 0x803c0400, 0x48032826, 0x0201f800, - 0x00106021, 0x59940000, 0x82000580, 0x00000000, - 0x04020006, 0x59940026, 0x48032827, 0x497b2826, - 0x4a032800, 0x00000001, 0x4c0c0000, 0x59940007, - 0x80000d40, 0x0400001d, 0x59941006, 0x59940025, - 0x80081c80, 0x04001004, 0x04000003, 0x480f2806, - 0x0401f016, 0x80040840, 0x48072807, 0x82040580, - 0x000003e8, 0x04020007, 0x4c040000, 0x4c0c0000, - 0x59940008, 0x0801f800, 0x5c001800, 0x5c000800, - 0x800409c0, 0x04020004, 0x59940008, 0x0801f800, - 0x0401f006, 0x400c0000, 0x820c1c00, 0x0000000a, - 0x040027ed, 0x480f2806, 0x5c001800, 0x4d180000, - 0x59c40008, 0x8c000534, 0x04020025, 0x417a3000, - 0x83947c00, 0x00000009, 0x583c0001, 0x80000d40, - 0x04020008, 0x823c7c00, 0x00000003, 0x811a3000, - 0x83180580, 0x00000005, 0x040207f8, 0x0401f018, - 0x583c1000, 0x59940025, 0x80080480, 0x04001005, - 0x04000004, 0x48007800, 0x80000040, 0x04021010, - 0x80040840, 0x48047801, 0x04000008, 0x82000400, - 0x0000000a, 0x48007800, 0x040027fa, 0x82040500, - 0x0000007f, 0x0401f7e8, 0x583c0002, 0x4c3c0000, - 0x0801f800, 0x5c007800, 0x0401f7e3, 0x5c023000, - 0x59940019, 0x80001540, 0x04000008, 0x04002007, - 0x59940025, 0x80080480, 0x497b2819, 0x04001003, - 0x04000002, 0x48032819, 0x59940004, 0x80000d40, - 0x0400002a, 0x4c040000, 0x5994001c, 0x80000d40, - 0x04000013, 0x5994101b, 0x59940025, 0x80080480, - 0x04001005, 0x04000004, 0x4803281b, 0x80000040, - 0x0402100b, 0x80040840, 0x4807281c, 0x04020004, - 0x5994001d, 0x0801f800, 0x0401f005, 0x82000400, - 0x0000000a, 0x4803281b, 0x040027f7, 0x5c000800, - 0x59941003, 0x59940025, 0x80080480, 0x04001005, - 0x04000004, 0x48032803, 0x80000040, 0x0402100b, - 0x80040840, 0x48072804, 0x04020004, 0x59940005, - 0x0801f800, 0x0401f005, 0x82000400, 0x0000000a, - 0x48032803, 0x040027f7, 0x5994001f, 0x80000d40, - 0x04000013, 0x5994101e, 0x59940025, 0x80080480, - 0x04001005, 0x04000004, 0x4803281e, 0x80000040, - 0x0402100b, 0x80040840, 0x4807281f, 0x04020004, - 0x59940020, 0x0801f800, 0x0401f005, 0x82000400, - 0x00000001, 0x4803281e, 0x040027f7, 0x59940022, - 0x80000d40, 0x04000013, 0x59941021, 0x59940025, - 0x80080480, 0x04001005, 0x04000004, 0x48032821, - 0x80000040, 0x0402100b, 0x80040840, 0x48072822, - 0x04020004, 0x59940023, 0x0801f800, 0x0401f005, - 0x82000400, 0x0000000a, 0x48032821, 0x040027f7, - 0x59940824, 0x59940025, 0x80040480, 0x02001800, - 0x001005d8, 0x48032824, 0x59940000, 0x0c01f001, - 0x00105fb5, 0x00105fb7, 0x00105fdd, 0x59940024, - 0x80000000, 0x48032824, 0x4203e000, 0x70000000, - 0x1c01f000, 0x592c0406, 0x800000c2, 0x800008c4, - 0x80040c00, 0x592c040a, 0x48066206, 0x82000d00, - 0x00000003, 0x02000000, 0x0010615e, 0x8c000500, - 0x04020029, 0x8c00051e, 0x02000000, 0x00106139, - 0x82000d00, 0x000000c0, 0x02020000, 0x0010612f, - 0x82000d00, 0x00002020, 0x02020000, 0x0010612c, - 0x813e79c0, 0x02020000, 0x0010612c, 0x592c0c0c, - 0x800409c0, 0x02020000, 0x0010612c, 0x59300a03, - 0x82040d80, 0x00000007, 0x02020000, 0x0010612c, - 0x4a026203, 0x00000003, 0x4a026403, 0x00000043, - 0x0201f800, 0x000200c9, 0x82080d40, 0x80003465, - 0x48066004, 0x497a6000, 0x59bc00ea, 0x8c000516, - 0x040207fe, 0x83300400, 0xa0000000, 0x480378e1, - 0x1c01f000, 0x8c000502, 0x02020000, 0x00106181, - 0x8c00051e, 0x0400000e, 0x82000d00, 0x000000c0, - 0x04000005, 0x82040d80, 0x000000c0, 0x02020000, - 0x00106186, 0x82000d00, 0x00002020, 0x82040d80, - 0x00002020, 0x02000000, 0x0010614d, 0x592c0207, - 0x80000040, 0x02020000, 0x00106157, 0x592c180d, - 0x800c19c0, 0x02020000, 0x00106157, 0x592c180f, - 0x59300007, 0x82000540, 0x00000011, 0x480e6011, - 0x48026007, 0x4a026203, 0x00000004, 0x4a026403, - 0x00000042, 0x42000800, 0x80002001, 0x0401f02a, - 0x5c000000, 0x4c000000, 0x4803c857, 0x4807c857, - 0x0401f003, 0x42000800, 0x00000001, 0x59325808, - 0x832c0500, 0x00ff0000, 0x0400000d, 0x592c0000, - 0x48065a06, 0x48026008, 0x592c040a, 0x8c000510, - 0x04020008, 0x0201f800, 0x000202ce, 0x417a7800, - 0x59300008, 0x80025d40, 0x0402078f, 0x1c01f000, - 0x456a5800, 0x412ed000, 0x815eb800, 0x59c80000, - 0x82000540, 0x00001200, 0x48039000, 0x0401f7f4, - 0x59840000, 0x80000540, 0x04020002, 0x1c01f000, - 0x59840003, 0x80000540, 0x02020000, 0x001061fe, - 0x1c01f000, 0x48066004, 0x59bc00ea, 0x8c000516, - 0x040207fe, 0x83300400, 0x40000000, 0x480378e1, - 0x1c01f000, 0x59bc00ea, 0x82001500, 0xb0000018, - 0x02020000, 0x00106c81, 0x8c000510, 0x0400002a, - 0x59bc10e0, 0x82080500, 0xfffff000, 0x0402000a, - 0x80080108, 0x820a3500, 0x0000000f, 0x4803c857, - 0x1201f000, 0x00106c87, 0x84000510, 0x48026004, - 0x0401f016, 0x840a653e, 0x59300004, 0x8c000520, - 0x040007fa, 0x82000500, 0xfffefeff, 0x48026004, - 0x8c08153e, 0x04020005, 0x42027000, 0x00000013, - 0x0401f859, 0x0401f009, 0x59300004, 0x8c000514, - 0x04000003, 0x0401ffb0, 0x0401f02f, 0x42027000, - 0x00000049, 0x0401f850, 0x59bc00ea, 0x82001500, - 0xb0000018, 0x02020000, 0x00106c81, 0x8c000510, - 0x040207d8, 0x1c01f000, 0x83640480, 0x00000010, - 0x0400101a, 0x41626000, 0x41580000, 0x59300a03, - 0x82040d80, 0x00000000, 0x04000008, 0x83326400, - 0x00000024, 0x81300c80, 0x040017f9, 0x42026000, - 0x0010d1c0, 0x0401f7f6, 0x8166c840, 0x83300c00, - 0x00000024, 0x80040480, 0x04021005, 0x4006c000, - 0x4a026203, 0x00000008, 0x1c01f000, 0x837ac540, - 0x0010d1c0, 0x0401f7fb, 0x42000000, 0x0010b854, - 0x0201f800, 0x0010aa47, 0x4967c857, 0x80026580, - 0x1c01f000, 0x83300480, 0x0010d1c0, 0x02001800, - 0x001005d8, 0x41580000, 0x81300480, 0x0402100c, - 0x04011000, 0x457a6000, 0x4a026202, 0x0000ffff, - 0x83300400, 0x00000003, 0x4803c840, 0x4a03c842, - 0x00000021, 0x8166c800, 0x1c01f000, 0x41540000, - 0x81300480, 0x02021800, 0x001005d8, 0x04011000, - 0x457a6000, 0x4a026202, 0x0000ffff, 0x83300400, - 0x00000003, 0x4803c840, 0x4a03c842, 0x00000021, - 0x59a80066, 0x49335065, 0x80000000, 0x48035066, - 0x1c01f000, 0x4d340000, 0x59326809, 0x59300406, - 0x82000500, 0x0000001f, 0x0c01f803, 0x5c026800, - 0x1c01f000, 0x00107966, 0x00107979, 0x00107993, - 0x000207c9, 0x001098f1, 0x0010990c, 0x0002083e, - 0x00107966, 0x00107979, 0x001064ee, 0x001079ac, - 0x00107966, 0x00107966, 0x00107966, 0x00107966, - 0x00107966, 0x001095a1, 0x0010a6c2, 0x00107966, - 0x00107966, 0x00107966, 0x00107966, 0x00107966, - 0x00107966, 0x00107966, 0x00107966, 0x00107966, - 0x00107966, 0x00107966, 0x00107966, 0x00107966, - 0x00107966, 0x59300203, 0x82000c80, 0x0000000e, - 0x02021800, 0x001005d8, 0x0c01f001, 0x001079aa, - 0x00108592, 0x000207dd, 0x00108720, 0x001087b9, - 0x001079aa, 0x001079aa, 0x001079aa, 0x00108577, - 0x001079aa, 0x001079aa, 0x001079aa, 0x001079aa, - 0x00108985, 0x83380480, 0x00000058, 0x04021007, - 0x83380480, 0x00000040, 0x04001004, 0x4d2c0000, - 0x0c01f803, 0x5c025800, 0x1c01f000, 0x0010861b, - 0x0010861b, 0x0010861b, 0x0010861b, 0x0010861b, - 0x0010861d, 0x001086bd, 0x0010861b, 0x0010861b, - 0x0010861b, 0x0010861b, 0x0010861b, 0x0010861b, - 0x0010861b, 0x0010861b, 0x0010861b, 0x0010861b, - 0x0010861b, 0x0010861b, 0x001086c1, 0x000207ff, - 0x0010861b, 0x001086c0, 0x001086c2, 0x59325808, - 0x59300811, 0x59301402, 0x59340200, 0x8c00050e, - 0x0402001c, 0x0401f826, 0x04000005, 0x4a025a04, - 0x00000103, 0x497a5c09, 0x0401f009, 0x4a025a04, - 0x00000103, 0x4a025a06, 0x00000000, 0x497a5c09, - 0x800409c0, 0x02020800, 0x00108785, 0x48065807, - 0x480a5c06, 0x0201f800, 0x000202c1, 0x5934000f, - 0x5934140b, 0x80081040, 0x04001002, 0x480a6c0b, - 0x80000540, 0x02020800, 0x00020253, 0x0401f75e, - 0x592c020a, 0x8c000502, 0x040007e9, 0x800409c0, - 0x040007e7, 0x592c0208, 0x8c00050e, 0x040207e4, - 0x4933c857, 0x0201f000, 0x0010920f, 0x592c020a, - 0x8c000500, 0x04000010, 0x59300015, 0x592c380f, - 0x801c3c80, 0x0400000c, 0x4a025a06, 0x00000015, - 0x8c1c3d3e, 0x04000005, 0x4a025a06, 0x00000007, - 0x801c3880, 0x801c3800, 0x481fc857, 0x821c0d40, - 0x00000000, 0x1c01f000, 0x59300203, 0x82003480, - 0x0000000e, 0x02021800, 0x001005d8, 0x0c01f001, - 0x0010992b, 0x00020852, 0x00109fba, 0x00109fc8, - 0x0002086e, 0x0010992b, 0x0010a0a8, 0x0002088d, - 0x0010992b, 0x0010992b, 0x0010992b, 0x0010992b, - 0x0010992b, 0x0010992b, 0x83380580, 0x00000013, - 0x02020000, 0x00109f42, 0x59300403, 0x82027480, - 0x00000044, 0x02021800, 0x001005d8, 0x82000480, - 0x00000040, 0x02001800, 0x001005d8, 0x0c01f001, - 0x00109f9e, 0x00020864, 0x00109fa0, 0x00109fb2, - 0x59325808, 0x832c0500, 0x00ff0000, 0x04000005, - 0x592c0c0a, 0x8c040d1a, 0x02020000, 0x00109fad, - 0x0401fe91, 0x0401f710, 0x83380580, 0x00000048, - 0x04000007, 0x83380580, 0x00000053, 0x02000000, - 0x0010a04a, 0x0201f800, 0x001005d8, 0x5930001f, - 0x59301011, 0x59300809, 0x58040a00, 0x8c040d0e, - 0x02020000, 0x0010a026, 0x800811c0, 0x02020000, - 0x0010a033, 0x5930001f, 0x80000540, 0x02020000, - 0x0010a041, 0x59325808, 0x592c040a, 0x8c00051e, - 0x02000000, 0x0010a01c, 0x42027000, 0x00000041, - 0x0401f001, 0x83380480, 0x00000054, 0x02021800, - 0x001005d8, 0x83380480, 0x00000040, 0x02001000, - 0x0010a067, 0x0c01f001, 0x0010a073, 0x000208aa, - 0x0010a07f, 0x0010a086, 0x0010a073, 0x0010a073, - 0x0010a073, 0x0010a073, 0x0010a075, 0x0010a07a, - 0x0010a07a, 0x0010a073, 0x0010a073, 0x0010a073, - 0x0010a073, 0x0010a07a, 0x0010a073, 0x0010a07a, - 0x0010a073, 0x0010a075, 0x4a026203, 0x00000001, - 0x493a6403, 0x42000800, 0x80002042, 0x0401f672, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x14aa62b1, - 0x00000000, 0x00000000, 0x00000000, 0x00000005, - 0xfffffffb, 0x02800004, 0x00000000, 0x0000c000, - 0x0000071d, 0x073fca5a, 0x0705a5a5, 0x01928009, - 0x070ff0e1, 0x03800006, 0x04958010, 0x05308000, - 0x05008000, 0x0600902f, 0x04a004dc, 0x0202f051, - 0x042e4020, 0x018f021b, 0x033e5000, 0x03020000, - 0x078d0018, 0x0493041a, 0x0092041c, 0x038a0305, - 0x078b0303, 0x048e8010, 0x0678aae5, 0x06000001, - 0x07818174, 0x040010e6, 0x0448e0e6, 0x04818010, - 0x002fb008, 0x0448e0e6, 0x04818010, 0x060ff0e6, - 0x00580401, 0x054880ff, 0x04818010, 0x022a5001, - 0x030430d4, 0x06780043, 0x030e0000, 0x030450ff, - 0x06780043, 0x03019000, 0x058185c6, 0x027c0045, - 0x03020000, 0x06810037, 0x027c0045, 0x03040000, - 0x068100c7, 0x027c0045, 0x03080000, 0x0781061e, - 0x04908037, 0x029105c4, 0x010410a6, 0x0379ff41, - 0x037fffff, 0x072d6000, 0x07601241, 0x050f80ff, - 0x032fa009, 0x05600400, 0x050f80ff, 0x056c04ff, - 0x068105dc, 0x073fa009, 0x06000001, 0x0279ff02, - 0x0700ffff, 0x070ff0d1, 0x0179feff, 0x0700ffff, - 0x045c0402, 0x048185dc, 0x060ff0d0, 0x0179feff, - 0x0700ffff, 0x057dfeff, 0x0700ffff, 0x078105be, - 0x05600e41, 0x050f80ff, 0x032fa069, 0x07480000, - 0x068105d0, 0x06780043, 0x070000f0, 0x0781005f, - 0x037c00ff, 0x06000010, 0x0781005f, 0x038005cc, - 0x0379ff00, 0x070fffff, 0x06780043, 0x07f00000, - 0x075a0000, 0x020ef001, 0x028605ce, 0x05484000, - 0x02a1819e, 0x062d6001, 0x002fb001, 0x070ff069, - 0x01868072, 0x060ff079, 0x055c0441, 0x06810010, - 0x012fb000, 0x060560fb, 0x03800078, 0x060ff079, - 0x02868198, 0x070ff069, 0x055c0441, 0x06810010, - 0x060560fb, 0x0400d0d0, 0x062d6002, 0x0648300d, - 0x06810086, 0x070ff0d1, 0x062d6001, 0x045c040b, - 0x06810089, 0x05488000, 0x04818086, 0x072e500c, - 0x00208001, 0x05a004e1, 0x02800010, 0x062d6001, - 0x07f00000, 0x07f00000, 0x070ff0d1, 0x0179feff, - 0x070000ff, 0x055c040c, 0x058180bb, 0x0007b001, - 0x03079041, 0x0307a000, 0x06600a79, 0x050f80ff, - 0x053fa80a, 0x06000010, 0x072d5003, 0x078d0096, - 0x0307c003, 0x0007d004, 0x0107e005, 0x0307f006, - 0x02080007, 0x00081008, 0x01082009, 0x0308300a, - 0x0008400b, 0x0308500c, 0x068d00a1, 0x0678007a, - 0x07f00000, 0x010880ff, 0x03386000, 0x03010000, - 0x072e6300, 0x020ef07f, 0x02860010, 0x070ff07d, - 0x0450047c, 0x050f80ff, 0x002fa819, 0x068d00ae, - 0x02080001, 0x00081002, 0x0448807a, 0x068100b5, - 0x0379ff03, 0x070000ff, 0x01082003, 0x068d00b6, - 0x02386004, 0x03010000, 0x072e6c00, 0x02800010, - 0x06780043, 0x070000f0, 0x078105d7, 0x050020ff, - 0x027c0002, 0x06000010, 0x078100c3, 0x038005d7, - 0x0700c0d1, 0x0379ff0c, 0x070000ff, 0x0380008e, - 0x0204a051, 0x06780043, 0x070000f0, 0x037c00ff, - 0x06000010, 0x0781816a, 0x072d6000, 0x019485c0, - 0x050fb056, 0x044880e6, 0x04818010, 0x060ff0d0, - 0x0179feff, 0x0700ffff, 0x057dfeff, 0x0700ffff, - 0x078105be, 0x05a00212, 0x0349c0e4, 0x0781811d, - 0x070ff093, 0x050010ff, 0x070ff093, 0x045c0401, - 0x058180db, 0x02046092, 0x04002046, 0x04600202, - 0x00540401, 0x048280e6, 0x04500425, 0x070060ff, - 0x0730ffff, 0x0700000f, 0x0742000f, 0x05810190, - 0x07a005a6, 0x0648a002, 0x048180e9, 0x00047089, - 0x070ff047, 0x045c0443, 0x077800ff, 0x07f00000, - 0x0781818e, 0x07780047, 0x0500e000, 0x048185ad, - 0x070ff006, 0x01860117, 0x0179fe47, 0x0700000f, - 0x010480ff, 0x056c7048, 0x06818102, 0x007a0d4a, - 0x04003801, 0x0220f001, 0x0180010f, 0x07608e48, - 0x034a60ff, 0x0700f0ff, 0x074b88ff, 0x037000ff, - 0x07000600, 0x05500448, 0x074d00ff, 0x045a044a, - 0x0304a0ff, 0x070ff00f, 0x01540406, 0x05820117, - 0x04950120, 0x05a001bd, 0x02868123, 0x0134bfff, - 0x070fffff, 0x0104102e, 0x050fd041, 0x00800126, - 0x0595011d, 0x05a001bd, 0x0186011d, 0x0202f00e, - 0x052e4030, 0x040fd02f, 0x070fc0ff, 0x05a00218, - 0x02800010, 0x0400e02f, 0x042e4020, 0x0202f051, - 0x0004100e, 0x0004b00e, 0x050fd041, 0x024a6c46, - 0x04500423, 0x050070ff, 0x03620024, 0x050080ff, - 0x04004046, 0x0700500f, 0x03206000, 0x05601048, - 0x0700a0ff, 0x0700900a, 0x070ff005, 0x04500446, - 0x00540425, 0x04820157, 0x05601622, 0x050f80ff, - 0x063fa032, 0x06000002, 0x03203000, 0x01204000, - 0x03205000, 0x0120b000, 0x0320c000, 0x07601441, - 0x050f80ff, 0x043fa852, 0x06000001, 0x070ff056, - 0x056c02ff, 0x050fb0ff, 0x070560ff, 0x03079041, - 0x05600e41, 0x050f80ff, 0x073fa011, 0x0600003d, - 0x06780043, 0x07f00000, 0x065a007a, 0x010880ff, - 0x04a001b6, 0x058d0150, 0x0208a04a, 0x0108b04b, - 0x02386001, 0x03010000, 0x072e6300, 0x028000a8, - 0x0500d00a, 0x05500405, 0x014a68ff, 0x070090ff, - 0x0154040a, 0x0700c0ff, 0x0600a023, 0x0500b024, - 0x02206001, 0x05601622, 0x050f80ff, 0x063fa04a, - 0x06000002, 0x05601022, 0x050f80ff, 0x043fa819, - 0x06000001, 0x0600a00d, 0x0180013c, 0x06780043, - 0x070000f0, 0x050010ff, 0x027c0001, 0x07000030, - 0x078105b4, 0x027c0001, 0x06000020, 0x078105b4, - 0x038005cc, 0x054880ff, 0x06810010, 0x070ff056, - 0x050fb0ff, 0x044880e5, 0x0581017d, 0x044880e6, - 0x04818010, 0x00800183, 0x056c02ff, 0x050fb0ff, - 0x070560ff, 0x072e5300, 0x044880e6, 0x04818010, - 0x072d5003, 0x06780043, 0x07f00000, 0x010880ff, - 0x058d0187, 0x03386005, 0x03010000, 0x033e6000, - 0x0700000c, 0x052e5200, 0x02800010, 0x0120918e, - 0x018004e4, 0x01209190, 0x018004e4, 0x00209192, - 0x018004e4, 0x03209000, 0x018004e4, 0x01209196, - 0x018004e4, 0x00209198, 0x018004e4, 0x02493075, - 0x06810510, 0x0120919a, 0x018004e4, 0x06601e01, - 0x050f80ff, 0x063fa029, 0x06000008, 0x02015010, - 0x02016051, 0x00017051, 0x00011051, 0x05601a41, - 0x050f80ff, 0x053fa83a, 0x06000008, 0x05600e41, - 0x050f80ff, 0x01464000, 0x032fa00a, 0x07006011, - 0x05007012, 0x04008013, 0x07009014, 0x0600a015, - 0x0400b016, 0x0700c017, 0x07c00000, 0x072d5003, - 0x06601479, 0x050f80ff, 0x048d01b9, 0x063fa051, - 0x0600003e, 0x07c00000, 0x06005051, 0x0400e02c, - 0x0660060e, 0x050f80ff, 0x032fa009, 0x0379ff00, - 0x070000ff, 0x076c0000, 0x058101dd, 0x0660480e, - 0x0500e0ff, 0x034000ff, 0x01540427, 0x0582020a, - 0x03400005, 0x070ff005, 0x055c0428, 0x0481020e, - 0x01680e05, 0x056c0405, 0x068181bf, 0x040f8029, - 0x053fa809, 0x07000024, 0x06600649, 0x050f80ff, - 0x032fa009, 0x0379ff00, 0x070000ff, 0x076c0000, - 0x068181bf, 0x0400e049, 0x0340002d, 0x050f802b, - 0x053fa80a, 0x06000016, 0x0660480e, 0x0302c0ff, - 0x034000ff, 0x01540427, 0x0582020c, 0x072d6000, - 0x0460040e, 0x050f80ff, 0x0104e0d1, 0x0379ff4e, - 0x0700ffff, 0x062d6002, 0x032fa009, 0x0004d0d0, - 0x074b004d, 0x07780000, 0x07ffff00, 0x055a044d, - 0x070000ff, 0x00201008, 0x04002051, 0x06003051, - 0x05304000, 0x07000060, 0x03205009, 0x07006022, - 0x0460040e, 0x050f80ff, 0x032fa03a, 0x06603c0e, - 0x050f80ff, 0x073fa00a, 0x07000027, 0x050010d1, - 0x0460320e, 0x050f80ff, 0x012fa80a, 0x060ff00e, - 0x055c042e, 0x04810210, 0x07c00000, 0x0400e026, - 0x008001cb, 0x0202c026, 0x008001e6, 0x0500e02e, - 0x008001e6, 0x0400e051, 0x01800209, 0x0349c0e4, - 0x04810215, 0x07c00000, 0x013e4000, 0x070c0000, - 0x07c00000, 0x013e4000, 0x03080000, 0x07c00000, - 0x009702f4, 0x022a5002, 0x0790821d, 0x00910291, - 0x030400a6, 0x0678aae5, 0x06000001, 0x00a1860e, - 0x06600c40, 0x050f80ff, 0x032fa021, 0x074b0000, - 0x076c0600, 0x07818293, 0x05600403, 0x050f80ff, - 0x073fa009, 0x06000002, 0x0279ff04, 0x0700ffff, - 0x010440d7, 0x0179fe44, 0x0700ffff, 0x045c0404, - 0x07818295, 0x0349f044, 0x0681829e, 0x02495001, - 0x06818297, 0x060ff079, 0x045c0440, 0x0781823c, - 0x0644f07a, 0x002fb008, 0x060ff079, 0x045c0440, - 0x07818241, 0x0644f07a, 0x002fb008, 0x0648f001, - 0x07818288, 0x04600e40, 0x050f80ff, 0x06480001, - 0x04810257, 0x0448e001, 0x04810273, 0x02460001, - 0x0644f001, 0x012fa80a, 0x04008040, 0x05a004ee, - 0x0286828c, 0x05a004d8, 0x062da001, 0x013e4000, - 0x06000080, 0x06930013, 0x02920013, 0x02800010, - 0x0644f001, 0x012fa80a, 0x020ef002, 0x00860275, - 0x04600840, 0x050f80ff, 0x053fa809, 0x06000002, - 0x05780105, 0x00800440, 0x017c0105, 0x05000400, - 0x06818275, 0x06601e02, 0x050f80ff, 0x053fa809, - 0x06000002, 0x04602a40, 0x050f80ff, 0x070ff005, - 0x053fa809, 0x06000002, 0x055c0405, 0x06818275, - 0x04008040, 0x0045e008, 0x05a004d8, 0x00800251, - 0x0644f001, 0x012fa80a, 0x050020d8, 0x04600440, - 0x050f80ff, 0x073fa00a, 0x06000001, 0x06480001, - 0x07818281, 0x05308000, 0x03040000, 0x06009040, - 0x04a004dc, 0x00800251, 0x06a0060e, 0x054b0800, - 0x056a0700, 0x06600c40, 0x050f80ff, 0x032fa00a, - 0x00800251, 0x013e4000, 0x06000080, 0x01209288, - 0x018004e4, 0x06009008, 0x05308000, 0x05004000, - 0x04a004dc, 0x00800251, 0x02209002, 0x008002e5, - 0x03209000, 0x008002e5, 0x02209004, 0x008002e5, - 0x04a002fd, 0x062da001, 0x05308000, 0x05002000, - 0x06009040, 0x04a004dc, 0x02800013, 0x013e4000, - 0x06000080, 0x02495001, 0x078182db, 0x04600840, - 0x050f80ff, 0x053fa809, 0x06000001, 0x0721f000, - 0x0349f003, 0x058102aa, 0x0245f01f, 0x06000002, - 0x018602db, 0x07601400, 0x050f80ff, 0x012fa809, - 0x06480001, 0x058102db, 0x06602440, 0x050f80ff, - 0x012fa809, 0x020ef001, 0x038682db, 0x019b02db, - 0x050020d8, 0x062da001, 0x06303002, 0x05000430, - 0x04600440, 0x050f80ff, 0x073fa012, 0x06000001, - 0x028f82bf, 0x050040d8, 0x062da001, 0x07601e00, - 0x050f80ff, 0x073fa009, 0x06000001, 0x060ff004, - 0x00540402, 0x048202d9, 0x06005051, 0x06006051, - 0x06602240, 0x050f80ff, 0x063fa01a, 0x06000002, - 0x06600a40, 0x050f80ff, 0x073fa00a, 0x07000003, - 0x060ff040, 0x045a041f, 0x010eb0ff, 0x06930013, - 0x02920013, 0x02800010, 0x04004002, 0x018002c9, - 0x04a002fd, 0x062da001, 0x05308000, 0x07005000, - 0x06009040, 0x04a004dc, 0x050080d8, 0x05a004e1, - 0x062da001, 0x02800013, 0x050fd009, 0x050fd041, - 0x013e4000, 0x06000080, 0x05308000, 0x03013000, - 0x04a004dc, 0x010440d7, 0x0349f044, 0x048102f2, - 0x062da001, 0x008f02f2, 0x03e00000, 0x062da001, - 0x02800013, 0x0249c0e5, 0x06810013, 0x062da001, - 0x07f00000, 0x07f00000, 0x033e5000, 0x070c0000, - 0x018f02f6, 0x03800011, 0x050020d8, 0x04600440, - 0x050f80ff, 0x073fa00a, 0x06000001, 0x07c00000, - 0x002fb001, 0x03800306, 0x012fb000, 0x03075087, - 0x068d0307, 0x03386000, 0x03020000, 0x04482075, - 0x06810352, 0x0648a0e6, 0x07810347, 0x0642007f, - 0x06810345, 0x0340007e, 0x060ff038, 0x0154047e, - 0x02d00334, 0x0560027d, 0x050f80ff, 0x032fa009, - 0x030ef000, 0x02860504, 0x0107d000, 0x05600800, - 0x050f80ff, 0x032fa009, 0x03681e00, 0x04500420, - 0x050f80ff, 0x073fa009, 0x0700003f, 0x03800311, - 0x070ff07d, 0x0450047c, 0x050f80ff, 0x002fa819, - 0x078d0327, 0x02080001, 0x00081002, 0x0448807a, - 0x0781032e, 0x0379ff03, 0x070000ff, 0x01082003, - 0x068d032f, 0x02386004, 0x03010000, 0x072e6c00, - 0x02800352, 0x0380033a, 0x0380033c, 0x0280033e, - 0x02800340, 0x03800342, 0x03800344, 0x0727c005, - 0x02800323, 0x0627c008, 0x02800323, 0x0627c00b, - 0x02800323, 0x0627c00e, 0x02800323, 0x0727c011, - 0x02800323, 0x03800314, 0x052e6800, 0x02800352, - 0x044880e6, 0x07810533, 0x052e6200, 0x070ff088, - 0x0179feff, 0x070fffff, 0x04818501, 0x060ff083, - 0x0086836d, 0x033e6000, 0x07000003, 0x068d0352, - 0x07286000, 0x07f00000, 0x078d0355, 0x038c0306, - 0x0648c0e6, 0x05818372, 0x0448e0e6, 0x0781036a, - 0x004920e6, 0x07810365, 0x07a0056f, 0x05001088, - 0x00700101, 0x03100000, 0x00088001, 0x033e6000, - 0x07000088, 0x03800560, 0x02386001, 0x07030000, - 0x033e6000, 0x06000008, 0x028003f1, 0x02799075, - 0x0500040f, 0x06810010, 0x06601479, 0x050080ff, - 0x06309052, 0x0600003e, 0x02800376, 0x06602279, - 0x050080ff, 0x05309812, 0x07000041, 0x0648007a, - 0x0781037e, 0x04488075, 0x0581837e, 0x040f8008, - 0x070fa009, 0x0049107a, 0x01a183f3, 0x00798075, - 0x06000507, 0x05818521, 0x0448b075, 0x06810385, - 0x02493075, 0x0681050e, 0x0249c0e6, 0x048183e0, - 0x0648c0e6, 0x0581839a, 0x068d0389, 0x02386001, - 0x07030000, 0x0049107a, 0x07810390, 0x020ef083, - 0x0386039a, 0x06483075, 0x068103ef, 0x0678007a, - 0x07000035, 0x03a184cf, 0x05308000, 0x07060000, - 0x06009079, 0x04a004dc, 0x028003ef, 0x0448807a, - 0x0681039e, 0x06483075, 0x058104f9, 0x0448d07a, - 0x068103a2, 0x06483075, 0x058104f9, 0x068d03a2, - 0x02386001, 0x07030000, 0x0444e07a, 0x0648307a, - 0x048183c7, 0x0448707a, 0x068103ea, 0x0648f07a, - 0x078103b2, 0x05a004cf, 0x04008079, 0x05a004ee, - 0x008683c2, 0x05a004d8, 0x028003ef, 0x0560107b, - 0x050f80ff, 0x032fa009, 0x0349c000, 0x058183c0, - 0x04600e79, 0x050f80ff, 0x073fa00a, 0x0600003d, - 0x06600a79, 0x050f80ff, 0x053fa80a, 0x06000010, - 0x028003ef, 0x0046e07a, 0x028003ea, 0x06009008, - 0x05308000, 0x05004000, 0x04a004dc, 0x028003ef, - 0x0560167b, 0x050f80ff, 0x032fa011, 0x070ff000, - 0x04500401, 0x030460ff, 0x060ff025, 0x00540446, - 0x078203d1, 0x030460ff, 0x04092046, 0x05a00218, - 0x06600679, 0x050f80ff, 0x00201007, 0x012fa80a, - 0x0046047a, 0x034630ff, 0x050020ff, 0x06003051, - 0x04600e79, 0x050f80ff, 0x073fa012, 0x06000001, - 0x028003ef, 0x033e6a00, 0x0202000e, 0x02079051, - 0x07000088, 0x078d03e4, 0x0744c000, 0x01088000, - 0x03386006, 0x03010000, 0x02800010, 0x05a004cf, - 0x05308000, 0x03020000, 0x06009079, 0x04a004dc, - 0x033e6a00, 0x0302000a, 0x02079051, 0x02800010, - 0x04603e79, 0x050f80ff, 0x032fa009, 0x070ff000, - 0x0186040c, 0x057dfeff, 0x07ffffff, 0x0581040c, - 0x050f8000, 0x012fa811, 0x0079fe02, 0x070000ff, - 0x077d66ff, 0x060000dc, 0x0781840c, 0x060ff001, - 0x0286840d, 0x064b0002, 0x06420002, 0x060ff002, - 0x05500400, 0x050f80ff, 0x05004084, 0x073fa00a, - 0x06000002, 0x07c00000, 0x04600201, 0x050f80ff, - 0x073fa009, 0x06000001, 0x0079fe02, 0x070000ff, - 0x077d72ff, 0x070000dd, 0x0781840c, 0x064b0002, - 0x06420002, 0x06000001, 0x01800406, 0x0605004c, - 0x0180041e, 0x0493041a, 0x04a004d5, 0x054bc450, - 0x05810421, 0x01d00422, 0x01800421, 0x00800432, - 0x00800434, 0x00800432, 0x008004a7, 0x0180043f, - 0x00800434, 0x01800471, 0x00800432, 0x00800432, - 0x008004ab, 0x00800432, 0x018004af, 0x008004c4, - 0x01800488, 0x00800432, 0x00800432, 0x00209432, - 0x018004e4, 0x0379ff50, 0x070fffff, 0x060ff079, - 0x055c0450, 0x048104a4, 0x002fb008, 0x060ff079, - 0x055c0450, 0x058104a3, 0x04a004c7, 0x0180049c, - 0x0179fe50, 0x070fffff, 0x070050ff, 0x060ff079, - 0x055c0405, 0x04810449, 0x002fb008, 0x060ff079, - 0x055c0405, 0x078184a0, 0x070ff087, 0x017980ff, - 0x06000507, 0x06818451, 0x02203040, 0x05002087, - 0x0049d002, 0x0481046b, 0x04930458, 0x01257000, - 0x073c3fff, 0x0700000f, 0x052e4003, 0x072e5030, - 0x0304c050, 0x02400057, 0x06740057, 0x06000002, - 0x06820016, 0x04002083, 0x07003084, 0x04004085, - 0x06602279, 0x050f80ff, 0x063fa01a, 0x06000001, - 0x05a004cf, 0x07a00578, 0x033e6a00, 0x0302000a, - 0x062e5020, 0x003e4002, 0x07000a00, 0x028003f1, - 0x07420003, 0x0781844e, 0x00798002, 0x06000507, - 0x06818451, 0x0180045c, 0x05930478, 0x01257000, - 0x073c3fff, 0x0700000f, 0x052e4003, 0x072e5030, - 0x0304c050, 0x067800e6, 0x07000041, 0x0581047d, - 0x07a00581, 0x04818016, 0x002fb008, 0x067800e6, - 0x07000041, 0x04810483, 0x07a00581, 0x04818016, - 0x062e5020, 0x003e4002, 0x07000a00, 0x03e00000, - 0x02800010, 0x0379ff50, 0x070fffff, 0x060ff079, - 0x055c0450, 0x0781848e, 0x0245507a, 0x002fb008, - 0x060ff079, 0x055c0450, 0x07818493, 0x0245507a, - 0x002fb008, 0x05600e50, 0x050f80ff, 0x012fa809, - 0x02455001, 0x05600e50, 0x050f80ff, 0x012fa80a, - 0x0080049d, 0x002fb008, 0x003e4002, 0x07000a00, - 0x02800016, 0x079384a3, 0x062e5020, 0x042e4002, - 0x002fb008, 0x013e4000, 0x05000e00, 0x02800016, - 0x0179fe50, 0x070fffff, 0x010210ff, 0x02800016, - 0x0179fe50, 0x070fffff, 0x050340ff, 0x0080049d, - 0x0179fe50, 0x070fffff, 0x0102e0ff, 0x0760282e, - 0x050f80ff, 0x05222000, 0x07223000, 0x05224000, - 0x07225000, 0x07226000, 0x05227000, 0x05228000, - 0x07229000, 0x0722a000, 0x0522b000, 0x063fa051, - 0x07000011, 0x0202c026, 0x0522d000, 0x052e400c, - 0x02800016, 0x030430d4, 0x062e5008, 0x00800176, - 0x05600e50, 0x050f80ff, 0x032fa009, 0x03460000, - 0x018004d2, 0x0246007a, 0x0045207a, 0x008004d0, - 0x0246007a, 0x0600007a, 0x04600e79, 0x050f80ff, - 0x032fa00a, 0x07c00000, 0x029284d5, 0x070500e1, - 0x07c00000, 0x0245f008, 0x048404d9, 0x020e0008, - 0x07c00000, 0x070ff009, 0x065a0008, 0x058404de, - 0x020e0008, 0x07c00000, 0x058404e1, 0x020e0008, - 0x07c00000, 0x05308000, 0x0500d000, 0x04a004dc, - 0x04a004e9, 0x02800010, 0x052e4300, 0x072e500c, - 0x073c3fff, 0x0700000f, 0x07c00000, 0x06602208, - 0x050f80ff, 0x032fa011, 0x076a0000, 0x068184f7, - 0x066a0001, 0x048104f7, 0x04002051, 0x07c00000, - 0x00202001, 0x07c00000, 0x0648307a, 0x00a18608, - 0x05a004cc, 0x05308000, 0x05001000, 0x06009079, - 0x04a004dc, 0x03800560, 0x0249c0e6, 0x058104f9, - 0x0280036d, 0x0648307a, 0x07818196, 0x05a004cf, - 0x05308000, 0x03013000, 0x03209006, 0x04a004dc, - 0x033e6000, 0x07030000, 0x02800345, 0x02490075, - 0x0781051e, 0x04002089, 0x04780102, 0x07f00000, - 0x05001088, 0x07a0056f, 0x04740101, 0x03100000, - 0x060ff002, 0x045c0401, 0x0481851f, 0x00088001, - 0x033e6000, 0x070000c0, 0x0380055c, 0x07f00000, - 0x0220951f, 0x018004e4, 0x0648307a, 0x07810527, - 0x06780075, 0x06000007, 0x0581852e, 0x06a00608, - 0x06486075, 0x06818194, 0x02490075, 0x0781819a, - 0x04487075, 0x05818536, 0x0280053d, 0x05308000, - 0x03010000, 0x06009079, 0x04a004dc, 0x02800010, - 0x0448e0e6, 0x04818352, 0x00800192, 0x05308000, - 0x0500e000, 0x06009079, 0x04a004dc, 0x04008089, - 0x05a004e1, 0x0380055c, 0x05a004cc, 0x05308000, - 0x0700f000, 0x06009079, 0x07000088, 0x06a00545, - 0x04a004dc, 0x02800010, 0x03386000, 0x07030000, - 0x07f00000, 0x078d0548, 0x033e6a00, 0x0202000e, - 0x02079051, 0x0448b075, 0x07810553, 0x02493075, - 0x07810553, 0x05301005, 0x03010000, 0x03800555, - 0x05301006, 0x03010000, 0x05002087, 0x06485002, - 0x05818555, 0x0744c000, 0x01088000, 0x02086001, - 0x07c00000, 0x05001088, 0x07a0056f, 0x0644c001, - 0x00088001, 0x033e6a00, 0x0202000e, 0x004920e6, - 0x05818565, 0x02079051, 0x078d0565, 0x060ff089, - 0x034990ff, 0x0781056c, 0x03386005, 0x03010000, - 0x02800010, 0x03386006, 0x03010000, 0x02800010, - 0x078d056f, 0x03386000, 0x07030000, 0x07f00000, - 0x068d0573, 0x070ff087, 0x074850ff, 0x05818574, - 0x07c00000, 0x078d0578, 0x02386001, 0x07030000, - 0x07f00000, 0x068d057c, 0x070ff087, 0x074850ff, - 0x0581857d, 0x07c00000, 0x05002087, 0x0049d002, - 0x05818590, 0x002fb008, 0x067800e6, 0x07000041, - 0x002fb008, 0x05818590, 0x07a005a6, 0x0448e002, - 0x07810593, 0x0648a002, 0x0481859d, 0x06486002, - 0x06810597, 0x02400057, 0x056a02ff, 0x07c00000, - 0x07a005a6, 0x06788102, 0x06000004, 0x05818590, - 0x04002089, 0x070ff0d4, 0x045c0402, 0x077800ff, - 0x07f00000, 0x05818590, 0x00202010, 0x038c0590, - 0x07f00000, 0x06420002, 0x0481859e, 0x07a00578, - 0x033e6a00, 0x0302000a, 0x07c00000, 0x07f00000, - 0x060ff0a2, 0x050020ff, 0x060ff0a2, 0x045c0402, - 0x048185a7, 0x07c00000, 0x05a00218, 0x03495047, - 0x078105b2, 0x0320901d, 0x02800604, 0x0220901f, - 0x02800604, 0x014980e4, 0x04818010, 0x013e4000, - 0x07003000, 0x05600e35, 0x050f80ff, 0x07a006fc, - 0x01208003, 0x05a004e1, 0x038005cc, 0x03209009, - 0x02800604, 0x03209011, 0x02800604, 0x02209007, - 0x02800604, 0x03209003, 0x02800604, 0x00498043, - 0x058185be, 0x00497043, 0x048185c2, 0x02209001, - 0x02800604, 0x0220900d, 0x02800604, 0x0320900f, - 0x02800604, 0x03493000, 0x068105d5, 0x027c0045, - 0x070a0000, 0x078105de, 0x0220900b, 0x02800604, - 0x02209013, 0x05308000, 0x01012000, 0x04a004dc, - 0x00800183, 0x03209005, 0x02800604, 0x072e500c, - 0x00208002, 0x05a004e1, 0x02800010, 0x02209015, - 0x02800604, 0x072d6000, 0x05308000, 0x05007000, - 0x07f00000, 0x070090d1, 0x0379ff09, 0x0700ffff, - 0x04a004dc, 0x03209017, 0x02800604, 0x033e5000, - 0x06000080, 0x02209019, 0x02800604, 0x072d6000, - 0x033e5000, 0x06000080, 0x07f00000, 0x060ff0d0, - 0x0179feff, 0x0700ffff, 0x057dfeff, 0x0700ffff, - 0x04818010, 0x02400058, 0x00642058, 0x06820010, - 0x033e5000, 0x06000080, 0x04058051, 0x0320901b, - 0x02800604, 0x05308000, 0x01012000, 0x04a004dc, - 0x00800176, 0x05a00218, 0x05308000, 0x05008000, - 0x06009079, 0x04a004dc, 0x07c00000, 0x034900e4, - 0x05818618, 0x013e4000, 0x070000c0, 0x07f00000, - 0x034900e4, 0x04818616, 0x07c00000, 0x013e4000, - 0x06000080, 0x07f00000, 0x07f00000, 0x07f00000, - 0x034900e4, 0x06810610, 0x03800618, 0x072d6000, - 0x00498043, 0x06810632, 0x060ff0d0, 0x0179feff, - 0x0700ffff, 0x057dfeff, 0x0700ffff, 0x058185e2, - 0x050f8030, 0x032fa009, 0x0379ff00, 0x0700ffff, - 0x070ff0d1, 0x0179feff, 0x0700ffff, 0x055c0400, - 0x078105e2, 0x04004051, 0x0280067a, 0x06a006dc, - 0x062d6001, 0x020ef004, 0x038605e4, 0x06600004, - 0x050f80ff, 0x032fa009, 0x074b0000, 0x05002000, - 0x0769ff00, 0x01640800, 0x078205e4, 0x01640e00, - 0x058285e4, 0x070ff036, 0x045c0404, 0x0581864d, - 0x072d6000, 0x050f8030, 0x032fa009, 0x0379ff00, - 0x0700ffff, 0x070ff0d1, 0x0179feff, 0x0700ffff, - 0x055c0400, 0x078105e2, 0x04482034, 0x078105ff, - 0x06483034, 0x058185ff, 0x070ff0d4, 0x077800ff, - 0x070000f0, 0x037c00ff, 0x06000010, 0x0681067a, - 0x06a006d6, 0x024900e5, 0x0681065d, 0x033e5000, - 0x06000080, 0x02800010, 0x04601c04, 0x050f80ff, - 0x053fa809, 0x06000020, 0x030ef041, 0x038605ee, - 0x062d6002, 0x05602a41, 0x050f80ff, 0x012fa809, - 0x060ff0d0, 0x074b00ff, 0x045c0401, 0x05818678, - 0x062d6001, 0x07602841, 0x050f80ff, 0x053fa809, - 0x06000001, 0x070ff0d1, 0x054b80ff, 0x074b0003, - 0x055c0403, 0x05818678, 0x033e5000, 0x06000080, - 0x0080070e, 0x07600041, 0x0280065e, 0x06a006d6, - 0x024900e5, 0x06810680, 0x033e5000, 0x06000080, - 0x02800010, 0x06a006c2, 0x030ef041, 0x028605f2, - 0x04058051, 0x072d6000, 0x05601041, 0x050f80ff, - 0x012fa809, 0x0600a0d0, 0x0500b0d1, 0x062d6001, - 0x07f00000, 0x07f00000, 0x0600c0d0, 0x0500d0d1, - 0x062d6002, 0x0279ff0d, 0x07ff0000, 0x044d800d, - 0x060ff0d0, 0x074b00ff, 0x065a000d, 0x06601201, - 0x050f80ff, 0x073fa022, 0x07000005, 0x0079fe0d, - 0x070000ff, 0x050020ff, 0x05602a41, 0x050f80ff, - 0x073fa00a, 0x06000001, 0x020ef004, 0x028606bf, - 0x04601c04, 0x050f80ff, 0x053fa809, 0x06000001, - 0x050f80ff, 0x053fa80a, 0x06000020, 0x07602841, - 0x050f80ff, 0x073fa009, 0x06000001, 0x0279ff02, - 0x070000ff, 0x0678000d, 0x0700ff00, 0x065a0002, - 0x07602841, 0x050f80ff, 0x073fa00a, 0x06000001, - 0x07600041, 0x050f80ff, 0x053fa80a, 0x06000001, - 0x07601241, 0x050f80ff, 0x073fa00a, 0x06000002, - 0x033e5000, 0x06000080, 0x0080070e, 0x040f8032, - 0x073fa011, 0x06000001, 0x060ff002, 0x055c0403, - 0x058186ca, 0x00041051, 0x07c00000, 0x04600402, - 0x04500432, 0x050f80ff, 0x053fa809, 0x06000020, - 0x00400402, 0x01680eff, 0x070030ff, 0x040f8032, - 0x053fa80a, 0x06000001, 0x07c00000, 0x024900e5, - 0x068106d9, 0x07c00000, 0x033e5000, 0x070000c0, - 0x07c00000, 0x05004036, 0x060000d0, 0x0179fe00, - 0x0700ffff, 0x057dfeff, 0x0700ffff, 0x068106fb, - 0x070000d1, 0x0379ff00, 0x0700ffff, 0x06005051, - 0x060ff031, 0x05500405, 0x050f80ff, 0x073fa009, - 0x06000002, 0x020ef004, 0x038606f5, 0x04600404, - 0x050f80ff, 0x012fa809, 0x0079fe01, 0x0700ffff, - 0x055c0400, 0x068106fb, 0x01400405, 0x070050ff, - 0x057de0ff, 0x06000007, 0x058186e7, 0x04004051, - 0x07c00000, 0x072d6000, 0x07f00000, 0x07f00000, - 0x000110d0, 0x010120d1, 0x062d6001, 0x07f00000, - 0x07f00000, 0x020130d0, 0x010140d1, 0x062d6002, - 0x010170d4, 0x07f00000, 0x020150d0, 0x030160d1, - 0x053fa83a, 0x06000008, 0x07c00000, 0x07600c41, - 0x050f80ff, 0x073fa009, 0x06000001, 0x04780102, - 0x07ffff00, 0x046a0702, 0x050f80ff, 0x073fa00a, - 0x06000001, 0x05600e41, 0x050f80ff, 0x032fa069, - 0x03800053, 0xba6b4e34, 0x02800004, 0x00000000, - 0x00008000, 0x00000518, 0x040f801f, 0x012fa8c9, - 0x040f801f, 0x073fa081, 0x06000010, 0x03200005, - 0x07420000, 0x050fb000, 0x040f801f, 0x073fa011, - 0x06000038, 0x040f801f, 0x053fa859, 0x0700003a, - 0x050fe000, 0x0581800a, 0x0684003d, 0x04958019, - 0x030e0011, 0x072e4200, 0x03800014, 0x0291001f, - 0x050010c0, 0x04482001, 0x058180e8, 0x06483001, - 0x0781814b, 0x02920029, 0x068b0029, 0x018a0150, - 0x050010c0, 0x06780001, 0x050007c0, 0x06818223, - 0x06780001, 0x0500f800, 0x07818263, 0x03910030, - 0x040fe029, 0x03860030, 0x076c001d, 0x04810294, - 0x076c0a1d, 0x048102b9, 0x0292003d, 0x040fe02f, - 0x0286003d, 0x06000013, 0x050fb000, 0x066c0073, - 0x068103c2, 0x0297003d, 0x014920e4, 0x0481803d, - 0x03400000, 0x076c0a00, 0x04818034, 0x0796003f, - 0x03b900b8, 0x05908014, 0x010170e1, 0x07780017, - 0x03e00000, 0x06810092, 0x050010ff, 0x0179fe17, - 0x031fffff, 0x070000ff, 0x05600800, 0x050f80ff, - 0x073fa009, 0x06000001, 0x06780002, 0x02800040, - 0x037c00ff, 0x03800000, 0x0681005e, 0x0249f002, - 0x068100ab, 0x0448e002, 0x0681005e, 0x07600c00, - 0x050f80ff, 0x073fa009, 0x06000001, 0x06780002, - 0x07ffff00, 0x037c00ff, 0x05000200, 0x048180ab, - 0x064bd401, 0x03d00060, 0x038000a9, 0x02800068, - 0x03800072, 0x0280007c, 0x02800086, 0x03800090, - 0x038000a9, 0x038000a9, 0x050fe027, 0x0186806c, - 0x01028000, 0x0380006f, 0x07600027, 0x050f80ff, - 0x032fa00a, 0x01027000, 0x02400029, 0x028000ab, - 0x040fe025, 0x00868076, 0x03026000, 0x02800079, - 0x06600025, 0x050f80ff, 0x032fa00a, 0x03025000, - 0x02400029, 0x028000ab, 0x050fe021, 0x00868080, - 0x01022000, 0x02800083, 0x07600021, 0x050f80ff, - 0x032fa00a, 0x01021000, 0x02400029, 0x028000ab, - 0x040fe023, 0x0086808a, 0x01024000, 0x0380008d, - 0x06600023, 0x050f80ff, 0x032fa00a, 0x03023000, - 0x02400029, 0x028000ab, 0x06a000c8, 0x028000ab, - 0x01640817, 0x058280a9, 0x070ff017, 0x03d00096, - 0x0280009e, 0x038000a0, 0x038000a3, 0x038000a6, - 0x038000a9, 0x038000a9, 0x038000a9, 0x038000a9, - 0x03e00000, 0x03800014, 0x059080a0, 0x030160e1, - 0x028000ab, 0x059080a3, 0x030150e1, 0x028000ab, - 0x059080a6, 0x010140e1, 0x028000ab, 0x060fc013, - 0x06a00510, 0x03800014, 0x072e4800, 0x07000012, - 0x038000bb, 0x0747f000, 0x05600800, 0x050f80ff, - 0x012fa809, 0x0249f001, 0x078100bb, 0x01012000, - 0x052e4c00, 0x07c00000, 0x070000eb, 0x0349f000, - 0x058180af, 0x05600800, 0x050f80ff, 0x012fa809, - 0x0448e001, 0x068100c1, 0x07c00000, 0x0079c101, - 0x07ffffff, 0x027a4b01, 0x03800000, 0x05600800, - 0x050f80ff, 0x012fa80a, 0x07600c00, 0x050f80ff, - 0x012fa821, 0x06780001, 0x07ffff00, 0x037c00ff, - 0x05000700, 0x078100dd, 0x06601804, 0x070030ff, - 0x050f80ff, 0x012fa809, 0x05002000, 0x050f8003, - 0x073fa00a, 0x06000001, 0x040fe001, 0x038600de, - 0x04600201, 0x050f80ff, 0x032fa00a, 0x07c00000, - 0x050fe02e, 0x008680e3, 0x0102e000, 0x0302f000, - 0x038000e7, 0x0760002e, 0x050f80ff, 0x032fa00a, - 0x0102e000, 0x07c00000, 0x022c0004, 0x056c041d, - 0x078100fc, 0x056c021d, 0x04810113, 0x056c081d, - 0x04810125, 0x076c061d, 0x0581013f, 0x0521d000, - 0x0202c013, 0x0202a013, 0x02020013, 0x0460021a, - 0x050f80ff, 0x053fa80a, 0x07000009, 0x03b600ac, - 0x0484801f, 0x0280003d, 0x040fe02a, 0x028600f2, - 0x06000013, 0x04001013, 0x0560102b, 0x050f80ff, - 0x032fa012, 0x06420029, 0x0660002a, 0x050f80ff, - 0x053fa809, 0x06000001, 0x050fe003, 0x00860110, - 0x01028003, 0x0660002a, 0x050f80ff, 0x053fa80a, - 0x07000009, 0x00800140, 0x00028013, 0x00027013, - 0x00800140, 0x040fe02a, 0x028600f1, 0x06420029, - 0x0660002a, 0x050f80ff, 0x053fa809, 0x06000001, - 0x050fe003, 0x01860122, 0x03026003, 0x0660002a, - 0x050f80ff, 0x053fa80a, 0x07000009, 0x00800140, - 0x02026013, 0x02025013, 0x00800140, 0x040fe02a, - 0x028600f1, 0x06420029, 0x0660002a, 0x050f80ff, - 0x053fa809, 0x06000001, 0x050fe003, 0x00860134, - 0x01022003, 0x0660002a, 0x050f80ff, 0x053fa80a, - 0x07000009, 0x01800136, 0x00022013, 0x00021013, - 0x0647f020, 0x007a0120, 0x04000101, 0x04a00285, - 0x0400802a, 0x05a004f5, 0x009480f1, 0x0521d005, - 0x028000f2, 0x038000fa, 0x0647f020, 0x06486020, - 0x06818145, 0x04a00285, 0x028000f1, 0x007a0120, - 0x04000101, 0x04a00285, 0x0400802a, 0x05a004f5, - 0x028000f1, 0x040fd02a, 0x052e4003, 0x00208010, - 0x05a004f5, 0x038000fa, 0x00018098, 0x07480018, - 0x06818161, 0x05481018, 0x0781815f, 0x05482018, - 0x0681815d, 0x07483018, 0x0681815b, 0x002fb004, - 0x00800162, 0x012fb003, 0x00800162, 0x002fb002, - 0x00800162, 0x002fb001, 0x00800162, 0x012fb000, - 0x0179fe78, 0x070000ff, 0x030190ff, 0x00017086, - 0x058b0166, 0x03385000, 0x03020000, 0x07780017, - 0x00430407, 0x078181ee, 0x046c0419, 0x048101a2, - 0x046c0219, 0x05810172, 0x07219000, 0x00800186, - 0x07219000, 0x07483017, 0x0481018c, 0x05482017, - 0x05810193, 0x0448b075, 0x06818186, 0x06601476, - 0x050f80ff, 0x073fa022, 0x0600003e, 0x06000080, - 0x05001081, 0x05002082, 0x06003083, 0x05004084, - 0x04601c76, 0x050f80ff, 0x022fa02a, 0x07219000, - 0x07780078, 0x07ffff00, 0x045a0419, 0x010780ff, - 0x0484801f, 0x0280003d, 0x040fe07f, 0x0086019b, - 0x05a001bb, 0x00920186, 0x040fe07f, 0x07a681bb, - 0x00800186, 0x0560107b, 0x050f80ff, 0x032fa009, - 0x0744f000, 0x0560107b, 0x050f80ff, 0x032fa00a, - 0x00800179, 0x052e400c, 0x040080fb, 0x046aa108, - 0x06009076, 0x04002075, 0x05a004fc, 0x00800186, - 0x06219001, 0x05482017, 0x058101af, 0x058b01a5, - 0x060ff086, 0x0349f0ff, 0x07818165, 0x07483017, - 0x058101ac, 0x050fd0ff, 0x040fe07f, 0x07a681bb, - 0x00800186, 0x05004084, 0x05a00205, 0x00920186, - 0x070ff07d, 0x0450047c, 0x056004ff, 0x050f80ff, - 0x032fa009, 0x070ff000, 0x00540479, 0x030790ff, - 0x01800193, 0x060ff079, 0x0054047a, 0x058201e7, - 0x058101e7, 0x070ff07d, 0x0450047c, 0x050f80ff, - 0x002fa819, 0x058b01c3, 0x02080001, 0x00081002, - 0x01082003, 0x048b01c7, 0x03385000, 0x03010000, - 0x02400019, 0x070ff003, 0x04500479, 0x030790ff, - 0x0340007e, 0x0642007f, 0x058101e7, 0x070ff07e, - 0x050f80ff, 0x032fa009, 0x050fe000, 0x028681e6, - 0x070ff07d, 0x056002ff, 0x050f80ff, 0x032fa009, - 0x0107d000, 0x018601e8, 0x0560087d, 0x050f80ff, - 0x032fa009, 0x0569fe00, 0x0550041b, 0x050f80ff, - 0x032fa009, 0x0107e000, 0x070ff07e, 0x018001d2, - 0x0307c000, 0x07c00000, 0x052e400c, 0x040080fb, - 0x046aa108, 0x06009076, 0x04002075, 0x018004fc, - 0x040fd076, 0x050fd017, 0x060ff086, 0x077800ff, - 0x07000060, 0x037c00ff, 0x07000060, 0x078181f0, - 0x07780078, 0x07ffff00, 0x045a0419, 0x010780ff, - 0x06601476, 0x050f80ff, 0x073fa022, 0x0600003e, - 0x052e400c, 0x040080fb, 0x066a8108, 0x06009076, - 0x04002075, 0x05a004fc, 0x02800029, 0x0240007f, - 0x0742007e, 0x050f807e, 0x032fa009, 0x050fe000, - 0x0286821f, 0x070ff07d, 0x055c047b, 0x05810214, - 0x0760007d, 0x050f80ff, 0x032fa009, 0x050fe000, - 0x03868214, 0x070ff07b, 0x0107d0ff, 0x0560087d, - 0x050f80ff, 0x032fa009, 0x03681e00, 0x0450041c, - 0x0107e0ff, 0x050f80ff, 0x032fa009, 0x050fe000, - 0x01860221, 0x0307c000, 0x07c00000, 0x040fd076, - 0x02800510, 0x010180c0, 0x0548e018, 0x0781823c, - 0x0748f018, 0x06818238, 0x03490018, 0x06818234, - 0x01491018, 0x07818230, 0x073c0000, 0x06000040, - 0x02200004, 0x0180023f, 0x073c0000, 0x06000020, - 0x03200003, 0x0180023f, 0x073c0000, 0x06000010, - 0x02200002, 0x0180023f, 0x073c0000, 0x06000008, - 0x02200001, 0x0180023f, 0x073c0000, 0x06000004, - 0x06000013, 0x050fb000, 0x040fe076, 0x00860258, - 0x046c0273, 0x04810268, 0x066c0073, 0x04810249, - 0x040fd076, 0x06a00510, 0x03800014, 0x040fd076, - 0x0080024c, 0x00452075, 0x00077013, 0x0647f075, - 0x06486075, 0x06818252, 0x05a0028b, 0x00800258, - 0x007a0175, 0x04000101, 0x05a0028b, 0x04008076, - 0x0245f008, 0x05a004f5, 0x07273000, 0x05600272, - 0x050f80ff, 0x053fa80a, 0x07000009, 0x0379ff78, - 0x070000ff, 0x02076013, 0x02075013, 0x0484801f, - 0x0280003d, 0x070fc0ff, 0x052e400c, 0x00208020, - 0x05a004f5, 0x00800261, 0x04600276, 0x050010ff, - 0x040f8001, 0x032fa009, 0x040f8001, 0x053fa80a, - 0x07000009, 0x070ff000, 0x0286827a, 0x06601276, - 0x050f80ff, 0x073fa009, 0x0700000c, 0x07601818, - 0x050f80ff, 0x053fa80a, 0x07000009, 0x0180027b, - 0x07a000de, 0x0448b075, 0x0581024b, 0x06000013, - 0x04001013, 0x0560107b, 0x050f80ff, 0x032fa012, - 0x0046b075, 0x03b600ac, 0x0080024c, 0x06000020, - 0x04001016, 0x0460082a, 0x050f80ff, 0x032fa012, - 0x07c00000, 0x06000075, 0x040010a2, 0x044b0801, - 0x060ff016, 0x065a0001, 0x04600876, 0x050f80ff, - 0x032fa012, 0x07c00000, 0x050fe022, 0x0186029a, - 0x0421d004, 0x0302a022, 0x04a002c1, 0x018002b1, - 0x040fe026, 0x008602b3, 0x0421d001, 0x0202a026, - 0x04a002c1, 0x0202c013, 0x00683e20, 0x070060ff, - 0x056c0206, 0x048102f4, 0x056c0406, 0x0781030a, - 0x076c0606, 0x06810379, 0x056c1606, 0x078182b1, - 0x04488020, 0x07810387, 0x040fd02a, 0x0521d000, - 0x0202a013, 0x02020013, 0x008002b3, 0x04a004ec, - 0x008002bf, 0x050fe028, 0x008602bf, 0x0302a028, - 0x0421d002, 0x04a002c1, 0x008002c8, 0x050fe022, - 0x008602bf, 0x0421d004, 0x0302a022, 0x04a002c1, - 0x04a004ec, 0x05848030, 0x0280003d, 0x0460082a, - 0x050f80ff, 0x022fa031, 0x03020000, 0x0002b004, - 0x01018005, 0x07c00000, 0x0400702a, 0x06a003ba, - 0x007a0101, 0x07060000, 0x07303000, 0x07008290, - 0x07600018, 0x050f80ff, 0x053fa809, 0x07000003, - 0x0448e007, 0x068182d6, 0x06006013, 0x018002dd, - 0x02400010, 0x048102d6, 0x06006010, 0x0460322a, - 0x050f80ff, 0x073fa00a, 0x07000003, 0x050f801e, - 0x032fa03a, 0x063aa020, 0x06000002, 0x013e4000, - 0x07000030, 0x009802e3, 0x070ff0f6, 0x036830ff, - 0x078182e4, 0x070f001e, 0x0560102b, 0x050f10ff, - 0x063f3c08, 0x0600000d, 0x013e4000, 0x06000020, - 0x040f801a, 0x0320000a, 0x022017d0, 0x032fa012, - 0x0202c013, 0x008002bf, 0x04007013, 0x06a003ba, - 0x007a0101, 0x07050000, 0x07303000, 0x07008890, - 0x074d0005, 0x06006013, 0x050f801e, 0x032fa03a, - 0x05601a2b, 0x050f80ff, 0x022fa019, 0x04001002, - 0x04002013, 0x040f801f, 0x022fa01a, 0x073aa00c, - 0x06000002, 0x07300c03, 0x0600000d, 0x028003a7, - 0x04007013, 0x06a003ba, 0x007a0101, 0x03070000, - 0x0660282a, 0x050f80ff, 0x073fa009, 0x06000004, - 0x02499008, 0x07810317, 0x07303000, 0x07008890, - 0x02800319, 0x07303000, 0x04008980, 0x05007003, - 0x074d0005, 0x06006013, 0x050f801e, 0x032fa03a, - 0x0760142b, 0x050f80ff, 0x032fa021, 0x064b0002, - 0x02499008, 0x06810325, 0x0644c002, 0x054b0400, - 0x050040ff, 0x06698104, 0x0581833a, 0x06000013, - 0x04001013, 0x04780102, 0x06000010, 0x06003013, - 0x04004013, 0x06005013, 0x06006013, 0x04007013, - 0x00644015, 0x07820336, 0x04448002, 0x02205008, - 0x040f801f, 0x032fa042, 0x04008015, 0x03800371, - 0x046c8004, 0x05818348, 0x01208018, 0x06780002, - 0x07000003, 0x0581834b, 0x06003001, 0x06000013, - 0x04001013, 0x04004013, 0x06005013, 0x040f801f, - 0x022fa032, 0x03800371, 0x040fd02a, 0x06a00510, - 0x03800014, 0x04488002, 0x07810350, 0x070ff003, - 0x04500408, 0x050080ff, 0x06489002, 0x06810357, - 0x0379ff00, 0x070000ff, 0x070ff000, 0x04500408, - 0x050080ff, 0x07005003, 0x05004000, 0x06003001, - 0x06000013, 0x04001013, 0x040f801f, 0x022fa032, - 0x05601c2b, 0x050f80ff, 0x022fa031, 0x06600c1f, - 0x050f80ff, 0x022fa032, 0x02680608, 0x07810371, - 0x016408ff, 0x057dfeff, 0x07ffffff, 0x034000ff, - 0x045a0407, 0x070000ff, 0x0760061e, 0x050f80ff, - 0x032fa00a, 0x06600908, 0x0669f908, 0x027a0008, - 0x06000020, 0x070aa0ff, 0x014a20ff, 0x037a00ff, - 0x060000dc, 0x070000ff, 0x028003a7, 0x04007013, - 0x06a003ba, 0x007a0101, 0x07030000, 0x07303000, - 0x07008190, 0x06006013, 0x050f801e, 0x032fa03a, - 0x073aa000, 0x06000002, 0x07300c00, 0x07000005, - 0x028003a7, 0x04007013, 0x06a003ba, 0x007a0101, - 0x07810000, 0x07303000, 0x07000090, 0x06006013, - 0x06600c2a, 0x050f80ff, 0x053fa809, 0x07000003, - 0x04780107, 0x07ffff00, 0x007c0107, 0x07000500, - 0x0581839a, 0x07303000, 0x05000890, 0x074d0005, - 0x0660282a, 0x050f80ff, 0x053fa809, 0x07000003, - 0x0049d007, 0x068103a1, 0x02206001, 0x050f801e, - 0x032fa03a, 0x073aa000, 0x06000002, 0x07300c00, - 0x07000005, 0x013e4000, 0x07000030, 0x039803a9, - 0x070ff0f6, 0x036830ff, 0x058183aa, 0x070f001e, - 0x040f101f, 0x070f3000, 0x013e4000, 0x06000020, - 0x040f801a, 0x0320000a, 0x022017d0, 0x032fa012, - 0x008002bf, 0x03200000, 0x06006076, 0x028003bc, - 0x03200011, 0x0600602a, 0x05a00441, 0x05600406, - 0x050f80ff, 0x053fa809, 0x06000002, 0x07c00000, - 0x0207602f, 0x04600876, 0x050f80ff, 0x022fa031, - 0x03075000, 0x0007b004, 0x01018005, 0x06600076, - 0x050020ff, 0x050f80ff, 0x012fa809, 0x0202f001, - 0x008683d0, 0x0002e013, 0x040f8002, 0x053fa80a, - 0x07000009, 0x06273001, 0x0448b075, 0x048183da, - 0x04602076, 0x050f80ff, 0x053fa811, 0x0700003c, - 0x0179fe78, 0x070000ff, 0x030190ff, 0x018683e2, - 0x07a003f6, 0x00078019, 0x039203f5, 0x0180043a, - 0x040fd076, 0x040fd019, 0x04600276, 0x050020ff, - 0x050f80ff, 0x032fa009, 0x040f8002, 0x053fa80a, - 0x07000009, 0x050fe000, 0x008683f2, 0x07601818, - 0x050f80ff, 0x053fa80a, 0x07000009, 0x038003f3, - 0x07a000de, 0x07273000, 0x02076013, 0x0280003d, - 0x078b03f6, 0x03385000, 0x07030000, 0x05600818, - 0x050f80ff, 0x032fa009, 0x054b0400, 0x0308a0ff, - 0x0179fe00, 0x070000ff, 0x010880ff, 0x0448b075, - 0x04810410, 0x0760147b, 0x050f80ff, 0x002fa819, - 0x064b0001, 0x02080002, 0x01081003, 0x00082001, - 0x02083001, 0x02079001, 0x0207a001, 0x00084013, - 0x0207f013, 0x00800432, 0x06485075, 0x05810428, - 0x02465075, 0x06601476, 0x050f80ff, 0x073fa021, - 0x0600003e, 0x070ff07d, 0x0450047c, 0x050f80ff, - 0x002fa819, 0x058b041b, 0x02080001, 0x00081002, - 0x01082003, 0x03079003, 0x0208307a, 0x0340007e, - 0x0642007f, 0x0581042d, 0x070ff07e, 0x05a001d2, - 0x0392842d, 0x01800439, 0x058b0428, 0x06601476, - 0x050f80ff, 0x073fa041, 0x0600003e, 0x06602476, - 0x050f80ff, 0x073fa009, 0x06000007, 0x0008400e, - 0x048b0432, 0x03385000, 0x03010000, 0x06219001, - 0x040fe07f, 0x01860439, 0x018001bb, 0x07c00000, - 0x00683e75, 0x0581043f, 0x0448d075, 0x05810465, - 0x01800493, 0x05a004f0, 0x038003f5, 0x0297844c, - 0x07602418, 0x050f80ff, 0x012fa809, 0x06780001, - 0x070000ff, 0x075a0000, 0x070ff014, 0x0569feff, - 0x054b08ff, 0x075a0000, 0x05600418, 0x050f80ff, - 0x012fa809, 0x040fe007, 0x03868453, 0x01204000, - 0x00800461, 0x00700101, 0x03010000, 0x06780001, - 0x07ff0000, 0x076c00ff, 0x0681845b, 0x00700101, - 0x03010000, 0x05600418, 0x050f80ff, 0x012fa80a, - 0x06780001, 0x07ff0000, 0x050040ff, 0x0279ff01, - 0x0700ffff, 0x05002014, 0x07c00000, 0x04007076, - 0x0448b075, 0x0481047f, 0x03200011, 0x06006076, - 0x06a003bc, 0x007a0101, 0x07060000, 0x07303000, - 0x07008290, 0x07600018, 0x050f80ff, 0x053fa809, - 0x07000003, 0x0448e007, 0x07818477, 0x06006013, - 0x0180048e, 0x02400010, 0x05810477, 0x06006010, - 0x04603276, 0x050f80ff, 0x073fa00a, 0x07000003, - 0x0180048e, 0x04602a76, 0x050f80ff, 0x032fa009, - 0x060ff07a, 0x05500400, 0x070000ff, 0x04602a76, - 0x050f80ff, 0x032fa00a, 0x07a003b7, 0x007a0101, - 0x03010000, 0x06303008, 0x05008000, 0x0600600e, - 0x050f8074, 0x032fa03a, 0x053079a0, 0x0700000c, - 0x008004d3, 0x00683e75, 0x076c0aff, 0x058104b2, - 0x04007013, 0x03200011, 0x06006076, 0x06a003bc, - 0x007a0101, 0x03070000, 0x06602876, 0x050f80ff, - 0x053fa809, 0x06000001, 0x03499003, 0x048104a7, - 0x07303000, 0x07008890, 0x053079a0, 0x0700000c, - 0x008004ab, 0x07303000, 0x04008980, 0x04307920, - 0x0700000c, 0x074d0005, 0x06006013, 0x050f8074, - 0x032fa03a, 0x04307920, 0x0700000c, 0x008004d3, - 0x04602a76, 0x050f80ff, 0x032fa009, 0x060ff07a, - 0x05500400, 0x070000ff, 0x04602a76, 0x050f80ff, - 0x032fa00a, 0x04007076, 0x07a003b7, 0x007a0101, - 0x03010000, 0x06303008, 0x07008800, 0x074d0005, - 0x06600a76, 0x050f80ff, 0x073fa009, 0x07000003, - 0x054b0406, 0x045a0404, 0x050040ff, 0x0600600e, - 0x050f8074, 0x032fa03a, 0x0648c075, 0x058104d1, - 0x06307d20, 0x0700000c, 0x008004d3, 0x04307920, - 0x0700000c, 0x013e4000, 0x07000030, 0x009804d5, - 0x070ff0f6, 0x074850ff, 0x068184d6, 0x050f2074, - 0x060a0007, 0x040070fb, 0x046a7007, 0x050f40ff, - 0x013e4000, 0x06000020, 0x0678007a, 0x07fff000, - 0x068184e6, 0x0320000a, 0x022017d0, 0x008004e9, - 0x0320000a, 0x06301b58, 0x06000001, 0x050f8072, - 0x032fa012, 0x038003f5, 0x01208060, 0x0600902a, - 0x04002020, 0x018004fc, 0x040080fb, 0x066ae108, - 0x06009076, 0x04002075, 0x018004fc, 0x03201100, - 0x078484fa, 0x06420001, 0x078184f6, 0x02800513, - 0x020e0008, 0x07c00000, 0x050fd009, 0x040fd008, - 0x03201100, 0x05848503, 0x06420001, 0x078184ff, - 0x02800513, 0x007a0102, 0x04000101, 0x05600809, - 0x050f80ff, 0x073fa00a, 0x06000001, 0x020e0008, - 0x0684050d, 0x030e0009, 0x07c00000, 0x01011009, - 0x052e4300, 0x07c00000, 0x052e400f, 0x01208090, - 0x018004f5, 0x070fc0ff, 0x040f8013, 0x032fa009, - 0x02800516, 0x15416ea9, 0xffef0b01 -}; - -#ifdef UNIQUE_FW_NAME -uint32_t fw2400_length02 = 0x000014ff ; -#else -uint32_t risc_code_length02 = 0x000014ff ; -#endif - diff --git a/trunk/drivers/scsi/qla2xxx/qla_attr.c b/trunk/drivers/scsi/qla2xxx/qla_attr.c index 2efca52dff50..48e460eef05a 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_attr.c +++ b/trunk/drivers/scsi/qla2xxx/qla_attr.c @@ -232,7 +232,7 @@ static ssize_t qla2x00_isp_name_show(struct class_device *cdev, char *buf) { scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); - return snprintf(buf, PAGE_SIZE, "ISP%04X\n", ha->pdev->device); + return snprintf(buf, PAGE_SIZE, "%s\n", ha->brd_info->isp_name); } static ssize_t diff --git a/trunk/drivers/scsi/qla2xxx/qla_def.h b/trunk/drivers/scsi/qla2xxx/qla_def.h index 79d8a914f9d0..7096945ea234 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_def.h +++ b/trunk/drivers/scsi/qla2xxx/qla_def.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -30,7 +29,6 @@ #include #include -#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) #if defined(CONFIG_SCSI_QLA21XX) || defined(CONFIG_SCSI_QLA21XX_MODULE) #define IS_QLA2100(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2100) #else @@ -81,23 +79,9 @@ #define IS_QLA2522(ha) 0 #endif -#else /* !defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) */ - -#define IS_QLA2100(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2100) -#define IS_QLA2200(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2200) -#define IS_QLA2300(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2300) -#define IS_QLA2312(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2312) -#define IS_QLA2322(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2322) -#define IS_QLA6312(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP6312) -#define IS_QLA6322(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP6322) -#define IS_QLA2422(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422) -#define IS_QLA2432(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432) -#define IS_QLA2512(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2512) -#define IS_QLA2522(ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2522) -#endif - #define IS_QLA23XX(ha) (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \ IS_QLA6312(ha) || IS_QLA6322(ha)) + #define IS_QLA24XX(ha) (IS_QLA2422(ha) || IS_QLA2432(ha)) #define IS_QLA25XX(ha) (IS_QLA2512(ha) || IS_QLA2522(ha)) @@ -2140,12 +2124,6 @@ struct qla_board_info { struct scsi_host_template *sht; }; -struct fw_blob { - char *name; - uint32_t segs[4]; - const struct firmware *fw; -}; - /* Return data from MBC_GET_ID_LIST call. */ struct gid_list_info { uint8_t al_pa; @@ -2498,9 +2476,17 @@ typedef struct scsi_qla_host { */ #define LOOP_TRANSITION(ha) \ (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \ - test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ + test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) + +#define LOOP_NOT_READY(ha) \ + ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \ + test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) || \ + test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ + test_bit(LOOP_RESYNC_ACTIVE, &ha->dpc_flags)) || \ atomic_read(&ha->loop_state) == LOOP_DOWN) +#define LOOP_RDY(ha) (!LOOP_NOT_READY(ha)) + #define TGT_Q(ha, t) (ha->otgt[t]) #define to_qla_host(x) ((scsi_qla_host_t *) (x)->hostdata) diff --git a/trunk/drivers/scsi/qla2xxx/qla_gbl.h b/trunk/drivers/scsi/qla2xxx/qla_gbl.h index bec81adcf4fd..fedcb0d3fc72 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_gbl.h +++ b/trunk/drivers/scsi/qla2xxx/qla_gbl.h @@ -33,8 +33,8 @@ extern int qla24xx_nvram_config(struct scsi_qla_host *); extern void qla2x00_update_fw_options(struct scsi_qla_host *); extern void qla24xx_update_fw_options(scsi_qla_host_t *); extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *); -extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *); extern int qla24xx_load_risc_flash(scsi_qla_host_t *, uint32_t *); +extern int qla24xx_load_risc_hotplug(scsi_qla_host_t *, uint32_t *); extern fc_port_t *qla2x00_alloc_fcport(scsi_qla_host_t *, gfp_t); @@ -76,8 +76,6 @@ extern void qla2x00_blink_led(scsi_qla_host_t *); extern int qla2x00_down_timeout(struct semaphore *, unsigned long); -extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *); - /* * Global Function Prototypes in qla_iocb.c source file. */ diff --git a/trunk/drivers/scsi/qla2xxx/qla_init.c b/trunk/drivers/scsi/qla2xxx/qla_init.c index 7d973bd9022b..2d720121a0d3 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_init.c +++ b/trunk/drivers/scsi/qla2xxx/qla_init.c @@ -8,6 +8,7 @@ #include #include +#include #include #include "qla_devtbl.h" @@ -1258,7 +1259,7 @@ qla2x00_configure_hba(scsi_qla_host_t *ha) rval = qla2x00_get_adapter_id(ha, &loop_id, &al_pa, &area, &domain, &topo); if (rval != QLA_SUCCESS) { - if (LOOP_TRANSITION(ha) || atomic_read(&ha->loop_down_timer) || + if (LOOP_NOT_READY(ha) || atomic_read(&ha->loop_down_timer) || (rval == QLA_COMMAND_ERROR && loop_id == 0x7)) { DEBUG2(printk("%s(%ld) Loop is in a transition state\n", __func__, ha->host_no)); @@ -1795,7 +1796,7 @@ qla2x00_configure_loop(scsi_qla_host_t *ha) } if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) { - if (LOOP_TRANSITION(ha)) { + if (LOOP_NOT_READY(ha)) { rval = QLA_FUNCTION_FAILED; } else { rval = qla2x00_configure_fabric(ha); @@ -2368,7 +2369,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports) if (qla2x00_is_reserved_id(ha, loop_id)) continue; - if (atomic_read(&ha->loop_down_timer) || LOOP_TRANSITION(ha)) + if (atomic_read(&ha->loop_down_timer) || LOOP_NOT_READY(ha)) break; if (swl != NULL) { @@ -3483,16 +3484,17 @@ qla24xx_nvram_config(scsi_qla_host_t *ha) return (rval); } -#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) - int qla2x00_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) { - int rval, num, i; - uint32_t cnt; - uint16_t *risc_code; - uint32_t risc_addr, risc_size; - uint16_t *req_ring; + int rval; + uint16_t cnt; + uint16_t *risc_code; + unsigned long risc_address; + unsigned long risc_code_size; + int num; + int i; + uint16_t *req_ring; struct qla_fw_info *fw_iter; rval = QLA_SUCCESS; @@ -3502,90 +3504,37 @@ qla2x00_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) *srisc_addr = *ha->brd_info->fw_info->fwstart; while (fw_iter->addressing != FW_INFO_ADDR_NOMORE) { risc_code = fw_iter->fwcode; - risc_size = *fw_iter->fwlen; - if (fw_iter->addressing == FW_INFO_ADDR_NORMAL) - risc_addr = *fw_iter->fwstart; - else - risc_addr = *fw_iter->lfwstart; + risc_code_size = *fw_iter->fwlen; + + if (fw_iter->addressing == FW_INFO_ADDR_NORMAL) { + risc_address = *fw_iter->fwstart; + } else { + /* Extended address */ + risc_address = *fw_iter->lfwstart; + } num = 0; rval = 0; - while (risc_size > 0 && !rval) { + while (risc_code_size > 0 && !rval) { cnt = (uint16_t)(ha->fw_transfer_size >> 1); - if (cnt > risc_size) - cnt = risc_size; + if (cnt > risc_code_size) + cnt = risc_code_size; DEBUG7(printk("scsi(%ld): Loading risc segment@ " "addr %p, number of bytes 0x%x, offset 0x%lx.\n", - ha->host_no, risc_code, cnt, risc_addr)); + ha->host_no, risc_code, cnt, risc_address)); req_ring = (uint16_t *)ha->request_ring; for (i = 0; i < cnt; i++) req_ring[i] = cpu_to_le16(risc_code[i]); - rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr, - cnt); - if (rval) { - DEBUG(printk("scsi(%ld): [ERROR] Failed to " - "load segment %d of firmware\n", - ha->host_no, num)); - qla_printk(KERN_WARNING, ha, - "[ERROR] Failed to load segment %d of " - "firmware\n", num); - - qla2x00_dump_regs(ha); - break; + if (fw_iter->addressing == FW_INFO_ADDR_NORMAL) { + rval = qla2x00_load_ram(ha, ha->request_dma, + risc_address, cnt); + } else { + rval = qla2x00_load_ram_ext(ha, + ha->request_dma, risc_address, cnt); } - - risc_code += cnt; - risc_addr += cnt; - risc_size -= cnt; - num++; - } - - /* Next firmware sequence */ - fw_iter++; - } - return rval; -} - -int -qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) -{ - int rval, num, i; - uint32_t cnt; - uint32_t *risc_code; - uint32_t risc_addr, risc_size; - uint32_t *req_ring; - struct qla_fw_info *fw_iter; - - rval = QLA_SUCCESS; - - /* Load firmware sequences */ - fw_iter = ha->brd_info->fw_info; - *srisc_addr = *((uint32_t *)fw_iter->lfwstart); - while (fw_iter->addressing != FW_INFO_ADDR_NOMORE) { - risc_code = (uint32_t *)fw_iter->fwcode; - risc_size = *((uint32_t *)fw_iter->fwlen); - risc_addr = *((uint32_t *)fw_iter->lfwstart); - - num = 0; - rval = 0; - while (risc_size > 0 && !rval) { - cnt = (uint32_t)(ha->fw_transfer_size >> 2); - if (cnt > risc_size) - cnt = risc_size; - - DEBUG7(printk("scsi(%ld): Loading risc segment@ " - "addr %p, number of bytes 0x%x, offset 0x%lx.\n", - ha->host_no, risc_code, cnt, risc_addr)); - - req_ring = (uint32_t *)ha->request_ring; - for (i = 0; i < cnt; i++) - req_ring[i] = cpu_to_le32(risc_code[i]); - - rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr, - cnt); if (rval) { DEBUG(printk("scsi(%ld): [ERROR] Failed to " "load segment %d of firmware\n", @@ -3599,15 +3548,16 @@ qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) } risc_code += cnt; - risc_addr += cnt; - risc_size -= cnt; + risc_address += cnt; + risc_code_size -= cnt; num++; } /* Next firmware sequence */ fw_iter++; } - return rval; + + return (rval); } int @@ -3692,108 +3642,8 @@ qla24xx_load_risc_flash(scsi_qla_host_t *ha, uint32_t *srisc_addr) return rval; } -#else /* !defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) */ - int -qla2x00_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) -{ - int rval; - int i, fragment; - uint16_t *wcode, *fwcode; - uint32_t risc_addr, risc_size, fwclen, wlen, *seg; - struct fw_blob *blob; - - /* Load firmware blob. */ - blob = qla2x00_request_firmware(ha); - if (!blob) { - qla_printk(KERN_ERR, ha, "Firmware image unavailable.\n"); - return QLA_FUNCTION_FAILED; - } - - rval = QLA_SUCCESS; - - wcode = (uint16_t *)ha->request_ring; - *srisc_addr = 0; - fwcode = (uint16_t *)blob->fw->data; - fwclen = 0; - - /* Validate firmware image by checking version. */ - if (blob->fw->size < 8 * sizeof(uint16_t)) { - qla_printk(KERN_WARNING, ha, - "Unable to verify integrity of firmware image (%Zd)!\n", - blob->fw->size); - goto fail_fw_integrity; - } - for (i = 0; i < 4; i++) - wcode[i] = be16_to_cpu(fwcode[i + 4]); - if ((wcode[0] == 0xffff && wcode[1] == 0xffff && wcode[2] == 0xffff && - wcode[3] == 0xffff) || (wcode[0] == 0 && wcode[1] == 0 && - wcode[2] == 0 && wcode[3] == 0)) { - qla_printk(KERN_WARNING, ha, - "Unable to verify integrity of firmware image!\n"); - qla_printk(KERN_WARNING, ha, - "Firmware data: %04x %04x %04x %04x!\n", wcode[0], - wcode[1], wcode[2], wcode[3]); - goto fail_fw_integrity; - } - - seg = blob->segs; - while (*seg && rval == QLA_SUCCESS) { - risc_addr = *seg; - *srisc_addr = *srisc_addr == 0 ? *seg : *srisc_addr; - risc_size = be16_to_cpu(fwcode[3]); - - /* Validate firmware image size. */ - fwclen += risc_size * sizeof(uint16_t); - if (blob->fw->size < fwclen) { - qla_printk(KERN_WARNING, ha, - "Unable to verify integrity of firmware image " - "(%Zd)!\n", blob->fw->size); - goto fail_fw_integrity; - } - - fragment = 0; - while (risc_size > 0 && rval == QLA_SUCCESS) { - wlen = (uint16_t)(ha->fw_transfer_size >> 1); - if (wlen > risc_size) - wlen = risc_size; - - DEBUG7(printk("scsi(%ld): Loading risc segment@ risc " - "addr %x, number of words 0x%x.\n", ha->host_no, - risc_addr, wlen)); - - for (i = 0; i < wlen; i++) - wcode[i] = swab16(fwcode[i]); - - rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr, - wlen); - if (rval) { - DEBUG(printk("scsi(%ld):[ERROR] Failed to load " - "segment %d of firmware\n", ha->host_no, - fragment)); - qla_printk(KERN_WARNING, ha, - "[ERROR] Failed to load segment %d of " - "firmware\n", fragment); - break; - } - - fwcode += wlen; - risc_addr += wlen; - risc_size -= wlen; - fragment++; - } - - /* Next segment. */ - seg++; - } - return rval; - -fail_fw_integrity: - return QLA_FUNCTION_FAILED; -} - -int -qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) +qla24xx_load_risc_hotplug(scsi_qla_host_t *ha, uint32_t *srisc_addr) { int rval; int segments, fragment; @@ -3801,13 +3651,14 @@ qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) uint32_t risc_addr; uint32_t risc_size; uint32_t i; - struct fw_blob *blob; + const struct firmware *fw_entry; uint32_t *fwcode, fwclen; - /* Load firmware blob. */ - blob = qla2x00_request_firmware(ha); - if (!blob) { - qla_printk(KERN_ERR, ha, "Firmware image unavailable.\n"); + if (request_firmware(&fw_entry, ha->brd_info->fw_fname, + &ha->pdev->dev)) { + qla_printk(KERN_ERR, ha, + "Firmware image file not available: '%s'\n", + ha->brd_info->fw_fname); return QLA_FUNCTION_FAILED; } @@ -3816,14 +3667,14 @@ qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) segments = FA_RISC_CODE_SEGMENTS; dcode = (uint32_t *)ha->request_ring; *srisc_addr = 0; - fwcode = (uint32_t *)blob->fw->data; + fwcode = (uint32_t *)fw_entry->data; fwclen = 0; /* Validate firmware image by checking version. */ - if (blob->fw->size < 8 * sizeof(uint32_t)) { + if (fw_entry->size < 8 * sizeof(uint32_t)) { qla_printk(KERN_WARNING, ha, - "Unable to verify integrity of firmware image (%Zd)!\n", - blob->fw->size); + "Unable to verify integrity of flash firmware image " + "(%Zd)!\n", fw_entry->size); goto fail_fw_integrity; } for (i = 0; i < 4; i++) @@ -3833,7 +3684,7 @@ qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) (dcode[0] == 0 && dcode[1] == 0 && dcode[2] == 0 && dcode[3] == 0)) { qla_printk(KERN_WARNING, ha, - "Unable to verify integrity of firmware image!\n"); + "Unable to verify integrity of flash firmware image!\n"); qla_printk(KERN_WARNING, ha, "Firmware data: %08x %08x %08x %08x!\n", dcode[0], dcode[1], dcode[2], dcode[3]); @@ -3847,11 +3698,10 @@ qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) /* Validate firmware image size. */ fwclen += risc_size * sizeof(uint32_t); - if (blob->fw->size < fwclen) { + if (fw_entry->size < fwclen) { qla_printk(KERN_WARNING, ha, - "Unable to verify integrity of firmware image " - "(%Zd)!\n", blob->fw->size); - + "Unable to verify integrity of flash firmware " + "image (%Zd)!\n", fw_entry->size); goto fail_fw_integrity; } @@ -3889,9 +3739,13 @@ qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) /* Next segment. */ segments--; } + + release_firmware(fw_entry); return rval; fail_fw_integrity: + + release_firmware(fw_entry); return QLA_FUNCTION_FAILED; + } -#endif diff --git a/trunk/drivers/scsi/qla2xxx/qla_isr.c b/trunk/drivers/scsi/qla2xxx/qla_isr.c index 5181d966fecb..09afc0f06bd4 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_isr.c +++ b/trunk/drivers/scsi/qla2xxx/qla_isr.c @@ -909,21 +909,6 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) resid = resid_len; cp->resid = resid; CMD_RESID_LEN(cp) = resid; - - if (!lscsi_status && - ((unsigned)(cp->request_bufflen - resid) < - cp->underflow)) { - qla_printk(KERN_INFO, ha, - "scsi(%ld:%d:%d:%d): Mid-layer underflow " - "detected (%x of %x bytes)...returning " - "error status.\n", ha->host_no, - cp->device->channel, cp->device->id, - cp->device->lun, resid, - cp->request_bufflen); - - cp->result = DID_ERROR << 16; - break; - } } cp->result = DID_OK << 16 | lscsi_status; diff --git a/trunk/drivers/scsi/qla2xxx/qla_os.c b/trunk/drivers/scsi/qla2xxx/qla_os.c index 24304300d7b5..c58c9d97b041 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_os.c +++ b/trunk/drivers/scsi/qla2xxx/qla_os.c @@ -54,12 +54,10 @@ module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR); MODULE_PARM_DESC(ql2xloginretrycount, "Specify an alternate value for the NVRAM login retry count."); -#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) -int ql2xfwloadflash; -module_param(ql2xfwloadflash, int, S_IRUGO|S_IRUSR); -MODULE_PARM_DESC(ql2xfwloadflash, - "Load ISP24xx firmware image from FLASH (onboard memory)."); -#endif +int ql2xfwloadbin=1; +module_param(ql2xfwloadbin, int, S_IRUGO|S_IRUSR); +MODULE_PARM_DESC(ql2xfwloadbin, + "Load ISP2xxx firmware image via hotplug."); static void qla2x00_free_device(scsi_qla_host_t *); @@ -1263,16 +1261,12 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) char pci_info[20]; char fw_str[30]; fc_port_t *fcport; - struct scsi_host_template *sht; if (pci_enable_device(pdev)) goto probe_out; - sht = &qla2x00_driver_template; - if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422 || - pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432) - sht = &qla24xx_driver_template; - host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); + host = scsi_host_alloc(brd_info->sht ? brd_info->sht: + &qla2x00_driver_template, sizeof(scsi_qla_host_t)); if (host == NULL) { printk(KERN_WARNING "qla2xxx: Couldn't allocate host from scsi layer!\n"); @@ -1297,8 +1291,8 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) goto probe_failed; qla_printk(KERN_INFO, ha, - "Found an ISP%04X, irq %d, iobase 0x%p\n", pdev->device, pdev->irq, - ha->iobase); + "Found an %s, irq %d, iobase 0x%p\n", ha->brd_info->isp_name, + pdev->irq, ha->iobase); spin_lock_init(&ha->hardware_lock); @@ -1374,11 +1368,9 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) ha->isp_ops.reset_adapter = qla24xx_reset_adapter; ha->isp_ops.nvram_config = qla24xx_nvram_config; ha->isp_ops.update_fw_options = qla24xx_update_fw_options; - ha->isp_ops.load_risc = qla24xx_load_risc; -#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) - if (ql2xfwloadflash) - ha->isp_ops.load_risc = qla24xx_load_risc_flash; -#endif + ha->isp_ops.load_risc = qla24xx_load_risc_flash; + if (ql2xfwloadbin) + ha->isp_ops.load_risc = qla24xx_load_risc_hotplug; ha->isp_ops.pci_info_str = qla24xx_pci_info_str; ha->isp_ops.fw_version_str = qla24xx_fw_version_str; ha->isp_ops.intr_handler = qla24xx_intr_handler; @@ -1539,12 +1531,11 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) qla_printk(KERN_INFO, ha, "\n" " QLogic Fibre Channel HBA Driver: %s\n" " QLogic %s - %s\n" - " ISP%04X: %s @ %s hdma%c, host#=%ld, fw=%s\n", - qla2x00_version_str, ha->model_number, - ha->model_desc ? ha->model_desc: "", pdev->device, - ha->isp_ops.pci_info_str(ha, pci_info), pci_name(pdev), - ha->flags.enable_64bit_addressing ? '+': '-', ha->host_no, - ha->isp_ops.fw_version_str(ha, fw_str)); + " %s: %s @ %s hdma%c, host#=%ld, fw=%s\n", qla2x00_version_str, + ha->model_number, ha->model_desc ? ha->model_desc: "", + ha->brd_info->isp_name, ha->isp_ops.pci_info_str(ha, pci_info), + pci_name(pdev), ha->flags.enable_64bit_addressing ? '+': '-', + ha->host_no, ha->isp_ops.fw_version_str(ha, fw_str)); /* Go with fc_rport registration. */ list_for_each_entry(fcport, &ha->fcports, list) @@ -2492,115 +2483,45 @@ qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout) return -ETIMEDOUT; } -#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) - -#define qla2x00_release_firmware() do { } while (0) -#define qla2x00_pci_module_init() (0) -#define qla2x00_pci_module_exit() do { } while (0) - -#else /* !defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) */ - -/* Firmware interface routines. */ - -#define FW_BLOBS 6 -#define FW_ISP21XX 0 -#define FW_ISP22XX 1 -#define FW_ISP2300 2 -#define FW_ISP2322 3 -#define FW_ISP63XX 4 -#define FW_ISP24XX 5 - -static DECLARE_MUTEX(qla_fw_lock); - -static struct fw_blob qla_fw_blobs[FW_BLOBS] = { - { .name = "ql2100_fw.bin", .segs = { 0x1000, 0 }, }, - { .name = "ql2200_fw.bin", .segs = { 0x1000, 0 }, }, - { .name = "ql2300_fw.bin", .segs = { 0x800, 0 }, }, - { .name = "ql2322_fw.bin", .segs = { 0x800, 0x1c000, 0x1e000, 0 }, }, - { .name = "ql6312_fw.bin", .segs = { 0x800, 0 }, }, - { .name = "ql2400_fw.bin", }, -}; - -struct fw_blob * -qla2x00_request_firmware(scsi_qla_host_t *ha) -{ - struct fw_blob *blob; - - blob = NULL; - if (IS_QLA2100(ha)) { - blob = &qla_fw_blobs[FW_ISP21XX]; - } else if (IS_QLA2200(ha)) { - blob = &qla_fw_blobs[FW_ISP22XX]; - } else if (IS_QLA2300(ha) || IS_QLA2312(ha)) { - blob = &qla_fw_blobs[FW_ISP2300]; - } else if (IS_QLA2322(ha)) { - blob = &qla_fw_blobs[FW_ISP2322]; - } else if (IS_QLA6312(ha) || IS_QLA6322(ha)) { - blob = &qla_fw_blobs[FW_ISP63XX]; - } else if (IS_QLA24XX(ha)) { - blob = &qla_fw_blobs[FW_ISP24XX]; - } - - down(&qla_fw_lock); - if (blob->fw) - goto out; - - if (request_firmware(&blob->fw, blob->name, &ha->pdev->dev)) { - DEBUG2(printk("scsi(%ld): Failed to load firmware image " - "(%s).\n", ha->host_no, blob->name)); - blob->fw = NULL; - blob = NULL; - goto out; - } - -out: - up(&qla_fw_lock); - return blob; -} - -static void -qla2x00_release_firmware(void) -{ - int idx; - - down(&qla_fw_lock); - for (idx = 0; idx < FW_BLOBS; idx++) - if (qla_fw_blobs[idx].fw) - release_firmware(qla_fw_blobs[idx].fw); - up(&qla_fw_lock); -} - -static struct qla_board_info qla_board_tbl = { - .drv_name = "qla2xxx", +static struct qla_board_info qla_board_tbl[] = { + { + .drv_name = "qla2400", + .isp_name = "ISP2422", + .fw_fname = "ql2400_fw.bin", + .sht = &qla24xx_driver_template, + }, + { + .drv_name = "qla2400", + .isp_name = "ISP2432", + .fw_fname = "ql2400_fw.bin", + .sht = &qla24xx_driver_template, + }, }; static struct pci_device_id qla2xxx_pci_tbl[] = { - { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2100, - PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2200, - PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2300, - PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2312, - PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2322, - PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6312, - PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6322, - PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2422, - PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432, - PCI_ANY_ID, PCI_ANY_ID, }, - { 0 }, + { + .vendor = PCI_VENDOR_ID_QLOGIC, + .device = PCI_DEVICE_ID_QLOGIC_ISP2422, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = (unsigned long)&qla_board_tbl[0], + }, + { + .vendor = PCI_VENDOR_ID_QLOGIC, + .device = PCI_DEVICE_ID_QLOGIC_ISP2432, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = (unsigned long)&qla_board_tbl[1], + }, + {0, 0}, }; MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl); static int __devinit qla2xxx_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) { - return qla2x00_probe_one(pdev, &qla_board_tbl); + return qla2x00_probe_one(pdev, + (struct qla_board_info *)id->driver_data); } static void __devexit @@ -2611,28 +2532,11 @@ qla2xxx_remove_one(struct pci_dev *pdev) static struct pci_driver qla2xxx_pci_driver = { .name = "qla2xxx", - .driver = { - .owner = THIS_MODULE, - }, .id_table = qla2xxx_pci_tbl, .probe = qla2xxx_probe_one, .remove = __devexit_p(qla2xxx_remove_one), }; -static inline int -qla2x00_pci_module_init(void) -{ - return pci_module_init(&qla2xxx_pci_driver); -} - -static inline void -qla2x00_pci_module_exit(void) -{ - pci_unregister_driver(&qla2xxx_pci_driver); -} - -#endif - /** * qla2x00_module_init - Module initialization. **/ @@ -2652,9 +2556,6 @@ qla2x00_module_init(void) /* Derive version string. */ strcpy(qla2x00_version_str, QLA2XXX_VERSION); -#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) - strcat(qla2x00_version_str, "-fw"); -#endif #if DEBUG_QLA2100 strcat(qla2x00_version_str, "-debug"); #endif @@ -2664,7 +2565,7 @@ qla2x00_module_init(void) return -ENODEV; printk(KERN_INFO "QLogic Fibre Channel HBA Driver\n"); - ret = qla2x00_pci_module_init(); + ret = pci_module_init(&qla2xxx_pci_driver); if (ret) { kmem_cache_destroy(srb_cachep); fc_release_transport(qla2xxx_transport_template); @@ -2678,8 +2579,7 @@ qla2x00_module_init(void) static void __exit qla2x00_module_exit(void) { - qla2x00_pci_module_exit(); - qla2x00_release_firmware(); + pci_unregister_driver(&qla2xxx_pci_driver); kmem_cache_destroy(srb_cachep); fc_release_transport(qla2xxx_transport_template); } diff --git a/trunk/drivers/scsi/raid_class.c b/trunk/drivers/scsi/raid_class.c index 5ec5f44602ac..5b1c12041a4f 100644 --- a/trunk/drivers/scsi/raid_class.c +++ b/trunk/drivers/scsi/raid_class.c @@ -115,7 +115,7 @@ static DECLARE_TRANSPORT_CLASS(raid_class, raid_remove, NULL); -static const struct { +static struct { enum raid_state value; char *name; } raid_states[] = { diff --git a/trunk/drivers/scsi/sata_mv.c b/trunk/drivers/scsi/sata_mv.c index 9321cdf45680..257c128f4aaa 100644 --- a/trunk/drivers/scsi/sata_mv.c +++ b/trunk/drivers/scsi/sata_mv.c @@ -1,8 +1,7 @@ /* * sata_mv.c - Marvell SATA support * - * Copyright 2005: EMC Corporation, all rights reserved. - * Copyright 2005 Red Hat, Inc. All rights reserved. + * Copyright 2005: EMC Corporation, all rights reserved. * * Please ALWAYS copy linux-ide@vger.kernel.org on emails. * @@ -37,7 +36,7 @@ #include #define DRV_NAME "sata_mv" -#define DRV_VERSION "0.5" +#define DRV_VERSION "0.25" enum { /* BAR's are enumerated in terms of pci_resource_start() terms */ @@ -51,9 +50,6 @@ enum { MV_PCI_REG_BASE = 0, MV_IRQ_COAL_REG_BASE = 0x18000, /* 6xxx part only */ MV_SATAHC0_REG_BASE = 0x20000, - MV_FLASH_CTL = 0x1046c, - MV_GPIO_PORT_CTL = 0x104f0, - MV_RESET_CFG = 0x180d8, MV_PCI_REG_SZ = MV_MAJOR_REG_AREA_SZ, MV_SATAHC_REG_SZ = MV_MAJOR_REG_AREA_SZ, @@ -76,6 +72,11 @@ enum { MV_SG_TBL_SZ = (16 * MV_MAX_SG_CT), MV_PORT_PRIV_DMA_SZ = (MV_CRQB_Q_SZ + MV_CRPB_Q_SZ + MV_SG_TBL_SZ), + /* Our DMA boundary is determined by an ePRD being unable to handle + * anything larger than 64KB + */ + MV_DMA_BOUNDARY = 0xffffU, + MV_PORTS_PER_HC = 4, /* == (port / MV_PORTS_PER_HC) to determine HC from 0-7 port */ MV_PORT_HC_SHIFT = 2, @@ -85,10 +86,16 @@ enum { /* Host Flags */ MV_FLAG_DUAL_HC = (1 << 30), /* two SATA Host Controllers */ MV_FLAG_IRQ_COALESCE = (1 << 29), /* IRQ coalescing capability */ + MV_FLAG_GLBL_SFT_RST = (1 << 28), /* Global Soft Reset support */ MV_COMMON_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | - ATA_FLAG_SATA_RESET | ATA_FLAG_MMIO | - ATA_FLAG_NO_ATAPI), - MV_6XXX_FLAGS = MV_FLAG_IRQ_COALESCE, + ATA_FLAG_SATA_RESET | ATA_FLAG_MMIO), + MV_6XXX_FLAGS = (MV_FLAG_IRQ_COALESCE | + MV_FLAG_GLBL_SFT_RST), + + chip_504x = 0, + chip_508x = 1, + chip_604x = 2, + chip_608x = 3, CRQB_FLAG_READ = (1 << 0), CRQB_TAG_SHIFT = 1, @@ -109,19 +116,8 @@ enum { PCI_MASTER_EMPTY = (1 << 3), GLOB_SFT_RST = (1 << 4), - MV_PCI_MODE = 0xd00, - MV_PCI_EXP_ROM_BAR_CTL = 0xd2c, - MV_PCI_DISC_TIMER = 0xd04, - MV_PCI_MSI_TRIGGER = 0xc38, - MV_PCI_SERR_MASK = 0xc28, - MV_PCI_XBAR_TMOUT = 0x1d04, - MV_PCI_ERR_LOW_ADDRESS = 0x1d40, - MV_PCI_ERR_HIGH_ADDRESS = 0x1d44, - MV_PCI_ERR_ATTRIBUTE = 0x1d48, - MV_PCI_ERR_COMMAND = 0x1d50, - - PCI_IRQ_CAUSE_OFS = 0x1d58, - PCI_IRQ_MASK_OFS = 0x1d5c, + PCI_IRQ_CAUSE_OFS = 0x1d58, + PCI_IRQ_MASK_OFS = 0x1d5c, PCI_UNMASK_ALL_IRQS = 0x7fffff, /* bits 22-0 */ HC_MAIN_IRQ_CAUSE_OFS = 0x1d60, @@ -138,7 +134,7 @@ enum { SELF_INT = (1 << 23), TWSI_INT = (1 << 24), HC_MAIN_RSVD = (0x7f << 25), /* bits 31-25 */ - HC_MAIN_MASKED_IRQS = (TRAN_LO_DONE | TRAN_HI_DONE | + HC_MAIN_MASKED_IRQS = (TRAN_LO_DONE | TRAN_HI_DONE | PORTS_0_7_COAL_DONE | GPIO_INT | TWSI_INT | HC_MAIN_RSVD), @@ -157,15 +153,6 @@ enum { /* SATA registers */ SATA_STATUS_OFS = 0x300, /* ctrl, err regs follow status */ SATA_ACTIVE_OFS = 0x350, - PHY_MODE3 = 0x310, - PHY_MODE4 = 0x314, - PHY_MODE2 = 0x330, - MV5_PHY_MODE = 0x74, - MV5_LT_MODE = 0x30, - MV5_PHY_CTL = 0x0C, - SATA_INTERFACE_CTL = 0x050, - - MV_M2_PREAMP_MASK = 0x7e0, /* Port registers */ EDMA_CFG_OFS = 0, @@ -195,16 +182,17 @@ enum { EDMA_ERR_LNK_CTRL_TX = (0x1f << 21), EDMA_ERR_LNK_DATA_TX = (0x1f << 26), EDMA_ERR_TRANS_PROTO = (1 << 31), - EDMA_ERR_FATAL = (EDMA_ERR_D_PAR | EDMA_ERR_PRD_PAR | + EDMA_ERR_FATAL = (EDMA_ERR_D_PAR | EDMA_ERR_PRD_PAR | EDMA_ERR_DEV_DCON | EDMA_ERR_CRBQ_PAR | EDMA_ERR_CRPB_PAR | EDMA_ERR_INTRL_PAR | - EDMA_ERR_IORDY | EDMA_ERR_LNK_CTRL_RX_2 | + EDMA_ERR_IORDY | EDMA_ERR_LNK_CTRL_RX_2 | EDMA_ERR_LNK_DATA_RX | - EDMA_ERR_LNK_DATA_TX | + EDMA_ERR_LNK_DATA_TX | EDMA_ERR_TRANS_PROTO), EDMA_REQ_Q_BASE_HI_OFS = 0x10, EDMA_REQ_Q_IN_PTR_OFS = 0x14, /* also contains BASE_LO */ + EDMA_REQ_Q_BASE_LO_MASK = 0xfffffc00U, EDMA_REQ_Q_OUT_PTR_OFS = 0x18, EDMA_REQ_Q_PTR_SHIFT = 5, @@ -212,6 +200,7 @@ enum { EDMA_RSP_Q_BASE_HI_OFS = 0x1c, EDMA_RSP_Q_IN_PTR_OFS = 0x20, EDMA_RSP_Q_OUT_PTR_OFS = 0x24, /* also contains BASE_LO */ + EDMA_RSP_Q_BASE_LO_MASK = 0xffffff00U, EDMA_RSP_Q_PTR_SHIFT = 3, EDMA_CMD_OFS = 0x28, @@ -219,44 +208,14 @@ enum { EDMA_DS = (1 << 1), ATA_RST = (1 << 2), - EDMA_IORDY_TMOUT = 0x34, - EDMA_ARB_CFG = 0x38, - /* Host private flags (hp_flags) */ MV_HP_FLAG_MSI = (1 << 0), - MV_HP_ERRATA_50XXB0 = (1 << 1), - MV_HP_ERRATA_50XXB2 = (1 << 2), - MV_HP_ERRATA_60X1B2 = (1 << 3), - MV_HP_ERRATA_60X1C0 = (1 << 4), - MV_HP_50XX = (1 << 5), /* Port private flags (pp_flags) */ MV_PP_FLAG_EDMA_EN = (1 << 0), MV_PP_FLAG_EDMA_DS_ACT = (1 << 1), }; -#define IS_50XX(hpriv) ((hpriv)->hp_flags & MV_HP_50XX) -#define IS_60XX(hpriv) (((hpriv)->hp_flags & MV_HP_50XX) == 0) - -enum { - /* Our DMA boundary is determined by an ePRD being unable to handle - * anything larger than 64KB - */ - MV_DMA_BOUNDARY = 0xffffU, - - EDMA_REQ_Q_BASE_LO_MASK = 0xfffffc00U, - - EDMA_RSP_Q_BASE_LO_MASK = 0xffffff00U, -}; - -enum chip_type { - chip_504x, - chip_508x, - chip_5080, - chip_604x, - chip_608x, -}; - /* Command ReQuest Block: 32B */ struct mv_crqb { u32 sg_addr; @@ -293,37 +252,14 @@ struct mv_port_priv { u32 pp_flags; }; -struct mv_port_signal { - u32 amps; - u32 pre; -}; - -struct mv_host_priv; -struct mv_hw_ops { - void (*phy_errata)(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int port); - void (*enable_leds)(struct mv_host_priv *hpriv, void __iomem *mmio); - void (*read_preamp)(struct mv_host_priv *hpriv, int idx, - void __iomem *mmio); - int (*reset_hc)(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int n_hc); - void (*reset_flash)(struct mv_host_priv *hpriv, void __iomem *mmio); - void (*reset_bus)(struct pci_dev *pdev, void __iomem *mmio); -}; - struct mv_host_priv { u32 hp_flags; - struct mv_port_signal signal[8]; - const struct mv_hw_ops *ops; }; static void mv_irq_clear(struct ata_port *ap); static u32 mv_scr_read(struct ata_port *ap, unsigned int sc_reg_in); static void mv_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val); -static u32 mv5_scr_read(struct ata_port *ap, unsigned int sc_reg_in); -static void mv5_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val); static void mv_phy_reset(struct ata_port *ap); -static void __mv_phy_reset(struct ata_port *ap, int can_sleep); static void mv_host_stop(struct ata_host_set *host_set); static int mv_port_start(struct ata_port *ap); static void mv_port_stop(struct ata_port *ap); @@ -334,29 +270,6 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance, static void mv_eng_timeout(struct ata_port *ap); static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); -static void mv5_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int port); -static void mv5_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio); -static void mv5_read_preamp(struct mv_host_priv *hpriv, int idx, - void __iomem *mmio); -static int mv5_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int n_hc); -static void mv5_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio); -static void mv5_reset_bus(struct pci_dev *pdev, void __iomem *mmio); - -static void mv6_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int port); -static void mv6_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio); -static void mv6_read_preamp(struct mv_host_priv *hpriv, int idx, - void __iomem *mmio); -static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int n_hc); -static void mv6_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio); -static void mv_reset_pci_bus(struct pci_dev *pdev, void __iomem *mmio); -static void mv_channel_reset(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int port_no); -static void mv_stop_and_reset(struct ata_port *ap); - static struct scsi_host_template mv_sht = { .module = THIS_MODULE, .name = DRV_NAME, @@ -365,7 +278,7 @@ static struct scsi_host_template mv_sht = { .eh_strategy_handler = ata_scsi_error, .can_queue = MV_USE_Q_DEPTH, .this_id = ATA_SHT_THIS_ID, - .sg_tablesize = MV_MAX_SG_CT / 2, + .sg_tablesize = MV_MAX_SG_CT, .max_sectors = ATA_MAX_SECTORS, .cmd_per_lun = ATA_SHT_CMD_PER_LUN, .emulated = ATA_SHT_EMULATED, @@ -377,34 +290,7 @@ static struct scsi_host_template mv_sht = { .ordered_flush = 1, }; -static const struct ata_port_operations mv5_ops = { - .port_disable = ata_port_disable, - - .tf_load = ata_tf_load, - .tf_read = ata_tf_read, - .check_status = ata_check_status, - .exec_command = ata_exec_command, - .dev_select = ata_std_dev_select, - - .phy_reset = mv_phy_reset, - - .qc_prep = mv_qc_prep, - .qc_issue = mv_qc_issue, - - .eng_timeout = mv_eng_timeout, - - .irq_handler = mv_interrupt, - .irq_clear = mv_irq_clear, - - .scr_read = mv5_scr_read, - .scr_write = mv5_scr_write, - - .port_start = mv_port_start, - .port_stop = mv_port_stop, - .host_stop = mv_host_stop, -}; - -static const struct ata_port_operations mv6_ops = { +static const struct ata_port_operations mv_ops = { .port_disable = ata_port_disable, .tf_load = ata_tf_load, @@ -436,44 +322,37 @@ static struct ata_port_info mv_port_info[] = { .sht = &mv_sht, .host_flags = MV_COMMON_FLAGS, .pio_mask = 0x1f, /* pio0-4 */ - .udma_mask = 0x7f, /* udma0-6 */ - .port_ops = &mv5_ops, + .udma_mask = 0, /* 0x7f (udma0-6 disabled for now) */ + .port_ops = &mv_ops, }, { /* chip_508x */ .sht = &mv_sht, .host_flags = (MV_COMMON_FLAGS | MV_FLAG_DUAL_HC), .pio_mask = 0x1f, /* pio0-4 */ - .udma_mask = 0x7f, /* udma0-6 */ - .port_ops = &mv5_ops, - }, - { /* chip_5080 */ - .sht = &mv_sht, - .host_flags = (MV_COMMON_FLAGS | MV_FLAG_DUAL_HC), - .pio_mask = 0x1f, /* pio0-4 */ - .udma_mask = 0x7f, /* udma0-6 */ - .port_ops = &mv5_ops, + .udma_mask = 0, /* 0x7f (udma0-6 disabled for now) */ + .port_ops = &mv_ops, }, { /* chip_604x */ .sht = &mv_sht, .host_flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS), .pio_mask = 0x1f, /* pio0-4 */ .udma_mask = 0x7f, /* udma0-6 */ - .port_ops = &mv6_ops, + .port_ops = &mv_ops, }, { /* chip_608x */ .sht = &mv_sht, - .host_flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS | + .host_flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS | MV_FLAG_DUAL_HC), .pio_mask = 0x1f, /* pio0-4 */ .udma_mask = 0x7f, /* udma0-6 */ - .port_ops = &mv6_ops, + .port_ops = &mv_ops, }, }; static const struct pci_device_id mv_pci_tbl[] = { {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5040), 0, 0, chip_504x}, {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5041), 0, 0, chip_504x}, - {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5080), 0, 0, chip_5080}, + {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5080), 0, 0, chip_508x}, {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5081), 0, 0, chip_508x}, {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6040), 0, 0, chip_604x}, @@ -492,24 +371,6 @@ static struct pci_driver mv_pci_driver = { .remove = ata_pci_remove_one, }; -static const struct mv_hw_ops mv5xxx_ops = { - .phy_errata = mv5_phy_errata, - .enable_leds = mv5_enable_leds, - .read_preamp = mv5_read_preamp, - .reset_hc = mv5_reset_hc, - .reset_flash = mv5_reset_flash, - .reset_bus = mv5_reset_bus, -}; - -static const struct mv_hw_ops mv6xxx_ops = { - .phy_errata = mv6_phy_errata, - .enable_leds = mv6_enable_leds, - .read_preamp = mv6_read_preamp, - .reset_hc = mv6_reset_hc, - .reset_flash = mv6_reset_flash, - .reset_bus = mv_reset_pci_bus, -}; - /* * Functions */ @@ -525,27 +386,11 @@ static inline void __iomem *mv_hc_base(void __iomem *base, unsigned int hc) return (base + MV_SATAHC0_REG_BASE + (hc * MV_SATAHC_REG_SZ)); } -static inline unsigned int mv_hc_from_port(unsigned int port) -{ - return port >> MV_PORT_HC_SHIFT; -} - -static inline unsigned int mv_hardport_from_port(unsigned int port) -{ - return port & MV_PORT_MASK; -} - -static inline void __iomem *mv_hc_base_from_port(void __iomem *base, - unsigned int port) -{ - return mv_hc_base(base, mv_hc_from_port(port)); -} - static inline void __iomem *mv_port_base(void __iomem *base, unsigned int port) { - return mv_hc_base_from_port(base, port) + - MV_SATAHC_ARBTR_REG_SZ + - (mv_hardport_from_port(port) * MV_PORT_REG_SZ); + return (mv_hc_base(base, port >> MV_PORT_HC_SHIFT) + + MV_SATAHC_ARBTR_REG_SZ + + ((port & MV_PORT_MASK) * MV_PORT_REG_SZ)); } static inline void __iomem *mv_ap_base(struct ata_port *ap) @@ -553,9 +398,9 @@ static inline void __iomem *mv_ap_base(struct ata_port *ap) return mv_port_base(ap->host_set->mmio_base, ap->port_no); } -static inline int mv_get_hc_count(unsigned long host_flags) +static inline int mv_get_hc_count(unsigned long hp_flags) { - return ((host_flags & MV_FLAG_DUAL_HC) ? 2 : 1); + return ((hp_flags & MV_FLAG_DUAL_HC) ? 2 : 1); } static void mv_irq_clear(struct ata_port *ap) @@ -607,7 +452,7 @@ static void mv_stop_dma(struct ata_port *ap) } else { assert(!(EDMA_EN & readl(port_mmio + EDMA_CMD_OFS))); } - + /* now properly wait for the eDMA to stop */ for (i = 1000; i > 0; i--) { reg = readl(port_mmio + EDMA_CMD_OFS); @@ -658,7 +503,7 @@ static void mv_dump_all_regs(void __iomem *mmio_base, int port, struct pci_dev *pdev) { #ifdef ATA_DEBUG - void __iomem *hc_base = mv_hc_base(mmio_base, + void __iomem *hc_base = mv_hc_base(mmio_base, port >> MV_PORT_HC_SHIFT); void __iomem *port_base; int start_port, num_ports, p, start_hc, num_hcs, hc; @@ -672,7 +517,7 @@ static void mv_dump_all_regs(void __iomem *mmio_base, int port, start_port = port; num_ports = num_hcs = 1; } - DPRINTK("All registers for port(s) %u-%u:\n", start_port, + DPRINTK("All registers for port(s) %u-%u:\n", start_port, num_ports > 1 ? num_ports - 1 : start_port); if (NULL != pdev) { @@ -739,6 +584,70 @@ static void mv_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val) } } +/** + * mv_global_soft_reset - Perform the 6xxx global soft reset + * @mmio_base: base address of the HBA + * + * This routine only applies to 6xxx parts. + * + * LOCKING: + * Inherited from caller. + */ +static int mv_global_soft_reset(void __iomem *mmio_base) +{ + void __iomem *reg = mmio_base + PCI_MAIN_CMD_STS_OFS; + int i, rc = 0; + u32 t; + + /* Following procedure defined in PCI "main command and status + * register" table. + */ + t = readl(reg); + writel(t | STOP_PCI_MASTER, reg); + + for (i = 0; i < 1000; i++) { + udelay(1); + t = readl(reg); + if (PCI_MASTER_EMPTY & t) { + break; + } + } + if (!(PCI_MASTER_EMPTY & t)) { + printk(KERN_ERR DRV_NAME ": PCI master won't flush\n"); + rc = 1; + goto done; + } + + /* set reset */ + i = 5; + do { + writel(t | GLOB_SFT_RST, reg); + t = readl(reg); + udelay(1); + } while (!(GLOB_SFT_RST & t) && (i-- > 0)); + + if (!(GLOB_SFT_RST & t)) { + printk(KERN_ERR DRV_NAME ": can't set global reset\n"); + rc = 1; + goto done; + } + + /* clear reset and *reenable the PCI master* (not mentioned in spec) */ + i = 5; + do { + writel(t & ~(GLOB_SFT_RST | STOP_PCI_MASTER), reg); + t = readl(reg); + udelay(1); + } while ((GLOB_SFT_RST & t) && (i-- > 0)); + + if (GLOB_SFT_RST & t) { + printk(KERN_ERR DRV_NAME ": can't clear global reset\n"); + rc = 1; + } +done: + return rc; +} + /** * mv_host_stop - Host specific cleanup/stop routine. * @host_set: host data structure @@ -792,7 +701,7 @@ static int mv_port_start(struct ata_port *ap) goto err_out; memset(pp, 0, sizeof(*pp)); - mem = dma_alloc_coherent(dev, MV_PORT_PRIV_DMA_SZ, &mem_dma, + mem = dma_alloc_coherent(dev, MV_PORT_PRIV_DMA_SZ, &mem_dma, GFP_KERNEL); if (!mem) goto err_out_pp; @@ -802,7 +711,7 @@ static int mv_port_start(struct ata_port *ap) if (rc) goto err_out_priv; - /* First item in chunk of DMA memory: + /* First item in chunk of DMA memory: * 32-slot command request table (CRQB), 32 bytes each in size */ pp->crqb = mem; @@ -810,7 +719,7 @@ static int mv_port_start(struct ata_port *ap) mem += MV_CRQB_Q_SZ; mem_dma += MV_CRQB_Q_SZ; - /* Second item: + /* Second item: * 32-slot command response table (CRPB), 8 bytes each in size */ pp->crpb = mem; @@ -824,18 +733,18 @@ static int mv_port_start(struct ata_port *ap) pp->sg_tbl = mem; pp->sg_tbl_dma = mem_dma; - writelfl(EDMA_CFG_Q_DEPTH | EDMA_CFG_RD_BRST_EXT | + writelfl(EDMA_CFG_Q_DEPTH | EDMA_CFG_RD_BRST_EXT | EDMA_CFG_WR_BUFF_LEN, port_mmio + EDMA_CFG_OFS); writel((pp->crqb_dma >> 16) >> 16, port_mmio + EDMA_REQ_Q_BASE_HI_OFS); - writelfl(pp->crqb_dma & EDMA_REQ_Q_BASE_LO_MASK, + writelfl(pp->crqb_dma & EDMA_REQ_Q_BASE_LO_MASK, port_mmio + EDMA_REQ_Q_IN_PTR_OFS); writelfl(0, port_mmio + EDMA_REQ_Q_OUT_PTR_OFS); writelfl(0, port_mmio + EDMA_RSP_Q_IN_PTR_OFS); writel((pp->crpb_dma >> 16) >> 16, port_mmio + EDMA_RSP_Q_BASE_HI_OFS); - writelfl(pp->crpb_dma & EDMA_RSP_Q_BASE_LO_MASK, + writelfl(pp->crpb_dma & EDMA_RSP_Q_BASE_LO_MASK, port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); pp->req_producer = pp->rsp_consumer = 0; @@ -896,30 +805,20 @@ static void mv_fill_sg(struct ata_queued_cmd *qc) struct scatterlist *sg; ata_for_each_sg(sg, qc) { + u32 sg_len; dma_addr_t addr; - u32 sg_len, len, offset; addr = sg_dma_address(sg); sg_len = sg_dma_len(sg); - while (sg_len) { - offset = addr & MV_DMA_BOUNDARY; - len = sg_len; - if ((offset + sg_len) > 0x10000) - len = 0x10000 - offset; - - pp->sg_tbl[i].addr = cpu_to_le32(addr & 0xffffffff); - pp->sg_tbl[i].addr_hi = cpu_to_le32((addr >> 16) >> 16); - pp->sg_tbl[i].flags_size = cpu_to_le32(len); - - sg_len -= len; - addr += len; - - if (!sg_len && ata_sg_is_last(sg, qc)) - pp->sg_tbl[i].flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL); + pp->sg_tbl[i].addr = cpu_to_le32(addr & 0xffffffff); + pp->sg_tbl[i].addr_hi = cpu_to_le32((addr >> 16) >> 16); + assert(0 == (sg_len & ~MV_DMA_BOUNDARY)); + pp->sg_tbl[i].flags_size = cpu_to_le32(sg_len); + if (ata_sg_is_last(sg, qc)) + pp->sg_tbl[i].flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL); - i++; - } + i++; } } @@ -960,7 +859,7 @@ static void mv_qc_prep(struct ata_queued_cmd *qc) } /* the req producer index should be the same as we remember it */ - assert(((readl(mv_ap_base(qc->ap) + EDMA_REQ_Q_IN_PTR_OFS) >> + assert(((readl(mv_ap_base(qc->ap) + EDMA_REQ_Q_IN_PTR_OFS) >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == pp->req_producer); @@ -972,9 +871,9 @@ static void mv_qc_prep(struct ata_queued_cmd *qc) assert(MV_MAX_Q_DEPTH > qc->tag); flags |= qc->tag << CRQB_TAG_SHIFT; - pp->crqb[pp->req_producer].sg_addr = + pp->crqb[pp->req_producer].sg_addr = cpu_to_le32(pp->sg_tbl_dma & 0xffffffff); - pp->crqb[pp->req_producer].sg_addr_hi = + pp->crqb[pp->req_producer].sg_addr_hi = cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16); pp->crqb[pp->req_producer].ctrl_flags = cpu_to_le16(flags); @@ -997,7 +896,7 @@ static void mv_qc_prep(struct ata_queued_cmd *qc) #ifdef LIBATA_NCQ /* FIXME: remove this line when NCQ added */ case ATA_CMD_FPDMA_READ: case ATA_CMD_FPDMA_WRITE: - mv_crqb_pack_cmd(cw++, tf->hob_feature, ATA_REG_FEATURE, 0); + mv_crqb_pack_cmd(cw++, tf->hob_feature, ATA_REG_FEATURE, 0); mv_crqb_pack_cmd(cw++, tf->feature, ATA_REG_FEATURE, 0); break; #endif /* FIXME: remove this line when NCQ added */ @@ -1063,7 +962,7 @@ static int mv_qc_issue(struct ata_queued_cmd *qc) pp->req_producer); /* until we do queuing, the queue should be empty at this point */ assert(((in_ptr >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == - ((readl(port_mmio + EDMA_REQ_Q_OUT_PTR_OFS) >> + ((readl(port_mmio + EDMA_REQ_Q_OUT_PTR_OFS) >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK)); mv_inc_q_index(&pp->req_producer); /* now incr producer index */ @@ -1100,15 +999,15 @@ static u8 mv_get_crpb_status(struct ata_port *ap) out_ptr = readl(port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); /* the response consumer index should be the same as we remember it */ - assert(((out_ptr >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == + assert(((out_ptr >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == pp->rsp_consumer); /* increment our consumer index... */ pp->rsp_consumer = mv_inc_q_index(&pp->rsp_consumer); - + /* and, until we do NCQ, there should only be 1 CRPB waiting */ - assert(((readl(port_mmio + EDMA_RSP_Q_IN_PTR_OFS) >> - EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == + assert(((readl(port_mmio + EDMA_RSP_Q_IN_PTR_OFS) >> + EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == pp->rsp_consumer); /* write out our inc'd consumer index so EDMA knows we're caught up */ @@ -1156,7 +1055,7 @@ static void mv_err_intr(struct ata_port *ap) /* check for fatal here and recover if needed */ if (EDMA_ERR_FATAL & edma_err_cause) { - mv_stop_and_reset(ap); + mv_phy_reset(ap); } } @@ -1221,10 +1120,6 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant, handled++; } - if (ap && - (ap->flags & (ATA_FLAG_PORT_DISABLED | ATA_FLAG_NOINTR))) - continue; - err_mask = ac_err_mask(ata_status); shift = port << 1; /* (port * 2) */ @@ -1236,15 +1131,14 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant, err_mask |= AC_ERR_OTHER; handled++; } - + if (handled && ap) { qc = ata_qc_from_tag(ap, ap->active_tag); if (NULL != qc) { VPRINTK("port %u IRQ found for qc, " "ata_status 0x%x\n", port,ata_status); /* mark qc status appropriately */ - if (!(qc->tf.ctl & ATA_NIEN)) - ata_qc_complete(qc, err_mask); + ata_qc_complete(qc, err_mask); } } } @@ -1252,7 +1146,7 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant, } /** - * mv_interrupt - + * mv_interrupt - * @irq: unused * @dev_instance: private data; in this case the host structure * @regs: unused @@ -1262,7 +1156,7 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant, * routine to handle. Also check for PCI errors which are only * reported here. * - * LOCKING: + * LOCKING: * This routine holds the host_set lock while processing pending * interrupts. */ @@ -1308,422 +1202,8 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance, return IRQ_RETVAL(handled); } -static void __iomem *mv5_phy_base(void __iomem *mmio, unsigned int port) -{ - void __iomem *hc_mmio = mv_hc_base_from_port(mmio, port); - unsigned long ofs = (mv_hardport_from_port(port) + 1) * 0x100UL; - - return hc_mmio + ofs; -} - -static unsigned int mv5_scr_offset(unsigned int sc_reg_in) -{ - unsigned int ofs; - - switch (sc_reg_in) { - case SCR_STATUS: - case SCR_ERROR: - case SCR_CONTROL: - ofs = sc_reg_in * sizeof(u32); - break; - default: - ofs = 0xffffffffU; - break; - } - return ofs; -} - -static u32 mv5_scr_read(struct ata_port *ap, unsigned int sc_reg_in) -{ - void __iomem *mmio = mv5_phy_base(ap->host_set->mmio_base, ap->port_no); - unsigned int ofs = mv5_scr_offset(sc_reg_in); - - if (ofs != 0xffffffffU) - return readl(mmio + ofs); - else - return (u32) ofs; -} - -static void mv5_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val) -{ - void __iomem *mmio = mv5_phy_base(ap->host_set->mmio_base, ap->port_no); - unsigned int ofs = mv5_scr_offset(sc_reg_in); - - if (ofs != 0xffffffffU) - writelfl(val, mmio + ofs); -} - -static void mv5_reset_bus(struct pci_dev *pdev, void __iomem *mmio) -{ - u8 rev_id; - int early_5080; - - pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); - - early_5080 = (pdev->device == 0x5080) && (rev_id == 0); - - if (!early_5080) { - u32 tmp = readl(mmio + MV_PCI_EXP_ROM_BAR_CTL); - tmp |= (1 << 0); - writel(tmp, mmio + MV_PCI_EXP_ROM_BAR_CTL); - } - - mv_reset_pci_bus(pdev, mmio); -} - -static void mv5_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio) -{ - writel(0x0fcfffff, mmio + MV_FLASH_CTL); -} - -static void mv5_read_preamp(struct mv_host_priv *hpriv, int idx, - void __iomem *mmio) -{ - void __iomem *phy_mmio = mv5_phy_base(mmio, idx); - u32 tmp; - - tmp = readl(phy_mmio + MV5_PHY_MODE); - - hpriv->signal[idx].pre = tmp & 0x1800; /* bits 12:11 */ - hpriv->signal[idx].amps = tmp & 0xe0; /* bits 7:5 */ -} - -static void mv5_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio) -{ - u32 tmp; - - writel(0, mmio + MV_GPIO_PORT_CTL); - - /* FIXME: handle MV_HP_ERRATA_50XXB2 errata */ - - tmp = readl(mmio + MV_PCI_EXP_ROM_BAR_CTL); - tmp |= ~(1 << 0); - writel(tmp, mmio + MV_PCI_EXP_ROM_BAR_CTL); -} - -static void mv5_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int port) -{ - void __iomem *phy_mmio = mv5_phy_base(mmio, port); - const u32 mask = (1<<12) | (1<<11) | (1<<7) | (1<<6) | (1<<5); - u32 tmp; - int fix_apm_sq = (hpriv->hp_flags & MV_HP_ERRATA_50XXB0); - - if (fix_apm_sq) { - tmp = readl(phy_mmio + MV5_LT_MODE); - tmp |= (1 << 19); - writel(tmp, phy_mmio + MV5_LT_MODE); - - tmp = readl(phy_mmio + MV5_PHY_CTL); - tmp &= ~0x3; - tmp |= 0x1; - writel(tmp, phy_mmio + MV5_PHY_CTL); - } - - tmp = readl(phy_mmio + MV5_PHY_MODE); - tmp &= ~mask; - tmp |= hpriv->signal[port].pre; - tmp |= hpriv->signal[port].amps; - writel(tmp, phy_mmio + MV5_PHY_MODE); -} - - -#undef ZERO -#define ZERO(reg) writel(0, port_mmio + (reg)) -static void mv5_reset_hc_port(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int port) -{ - void __iomem *port_mmio = mv_port_base(mmio, port); - - writelfl(EDMA_DS, port_mmio + EDMA_CMD_OFS); - - mv_channel_reset(hpriv, mmio, port); - - ZERO(0x028); /* command */ - writel(0x11f, port_mmio + EDMA_CFG_OFS); - ZERO(0x004); /* timer */ - ZERO(0x008); /* irq err cause */ - ZERO(0x00c); /* irq err mask */ - ZERO(0x010); /* rq bah */ - ZERO(0x014); /* rq inp */ - ZERO(0x018); /* rq outp */ - ZERO(0x01c); /* respq bah */ - ZERO(0x024); /* respq outp */ - ZERO(0x020); /* respq inp */ - ZERO(0x02c); /* test control */ - writel(0xbc, port_mmio + EDMA_IORDY_TMOUT); -} -#undef ZERO - -#define ZERO(reg) writel(0, hc_mmio + (reg)) -static void mv5_reset_one_hc(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int hc) -{ - void __iomem *hc_mmio = mv_hc_base(mmio, hc); - u32 tmp; - - ZERO(0x00c); - ZERO(0x010); - ZERO(0x014); - ZERO(0x018); - - tmp = readl(hc_mmio + 0x20); - tmp &= 0x1c1c1c1c; - tmp |= 0x03030303; - writel(tmp, hc_mmio + 0x20); -} -#undef ZERO - -static int mv5_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int n_hc) -{ - unsigned int hc, port; - - for (hc = 0; hc < n_hc; hc++) { - for (port = 0; port < MV_PORTS_PER_HC; port++) - mv5_reset_hc_port(hpriv, mmio, - (hc * MV_PORTS_PER_HC) + port); - - mv5_reset_one_hc(hpriv, mmio, hc); - } - - return 0; -} - -#undef ZERO -#define ZERO(reg) writel(0, mmio + (reg)) -static void mv_reset_pci_bus(struct pci_dev *pdev, void __iomem *mmio) -{ - u32 tmp; - - tmp = readl(mmio + MV_PCI_MODE); - tmp &= 0xff00ffff; - writel(tmp, mmio + MV_PCI_MODE); - - ZERO(MV_PCI_DISC_TIMER); - ZERO(MV_PCI_MSI_TRIGGER); - writel(0x000100ff, mmio + MV_PCI_XBAR_TMOUT); - ZERO(HC_MAIN_IRQ_MASK_OFS); - ZERO(MV_PCI_SERR_MASK); - ZERO(PCI_IRQ_CAUSE_OFS); - ZERO(PCI_IRQ_MASK_OFS); - ZERO(MV_PCI_ERR_LOW_ADDRESS); - ZERO(MV_PCI_ERR_HIGH_ADDRESS); - ZERO(MV_PCI_ERR_ATTRIBUTE); - ZERO(MV_PCI_ERR_COMMAND); -} -#undef ZERO - -static void mv6_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio) -{ - u32 tmp; - - mv5_reset_flash(hpriv, mmio); - - tmp = readl(mmio + MV_GPIO_PORT_CTL); - tmp &= 0x3; - tmp |= (1 << 5) | (1 << 6); - writel(tmp, mmio + MV_GPIO_PORT_CTL); -} - -/** - * mv6_reset_hc - Perform the 6xxx global soft reset - * @mmio: base address of the HBA - * - * This routine only applies to 6xxx parts. - * - * LOCKING: - * Inherited from caller. - */ -static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int n_hc) -{ - void __iomem *reg = mmio + PCI_MAIN_CMD_STS_OFS; - int i, rc = 0; - u32 t; - - /* Following procedure defined in PCI "main command and status - * register" table. - */ - t = readl(reg); - writel(t | STOP_PCI_MASTER, reg); - - for (i = 0; i < 1000; i++) { - udelay(1); - t = readl(reg); - if (PCI_MASTER_EMPTY & t) { - break; - } - } - if (!(PCI_MASTER_EMPTY & t)) { - printk(KERN_ERR DRV_NAME ": PCI master won't flush\n"); - rc = 1; - goto done; - } - - /* set reset */ - i = 5; - do { - writel(t | GLOB_SFT_RST, reg); - t = readl(reg); - udelay(1); - } while (!(GLOB_SFT_RST & t) && (i-- > 0)); - - if (!(GLOB_SFT_RST & t)) { - printk(KERN_ERR DRV_NAME ": can't set global reset\n"); - rc = 1; - goto done; - } - - /* clear reset and *reenable the PCI master* (not mentioned in spec) */ - i = 5; - do { - writel(t & ~(GLOB_SFT_RST | STOP_PCI_MASTER), reg); - t = readl(reg); - udelay(1); - } while ((GLOB_SFT_RST & t) && (i-- > 0)); - - if (GLOB_SFT_RST & t) { - printk(KERN_ERR DRV_NAME ": can't clear global reset\n"); - rc = 1; - } -done: - return rc; -} - -static void mv6_read_preamp(struct mv_host_priv *hpriv, int idx, - void __iomem *mmio) -{ - void __iomem *port_mmio; - u32 tmp; - - tmp = readl(mmio + MV_RESET_CFG); - if ((tmp & (1 << 0)) == 0) { - hpriv->signal[idx].amps = 0x7 << 8; - hpriv->signal[idx].pre = 0x1 << 5; - return; - } - - port_mmio = mv_port_base(mmio, idx); - tmp = readl(port_mmio + PHY_MODE2); - - hpriv->signal[idx].amps = tmp & 0x700; /* bits 10:8 */ - hpriv->signal[idx].pre = tmp & 0xe0; /* bits 7:5 */ -} - -static void mv6_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio) -{ - writel(0x00000060, mmio + MV_GPIO_PORT_CTL); -} - -static void mv6_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int port) -{ - void __iomem *port_mmio = mv_port_base(mmio, port); - - u32 hp_flags = hpriv->hp_flags; - int fix_phy_mode2 = - hp_flags & (MV_HP_ERRATA_60X1B2 | MV_HP_ERRATA_60X1C0); - int fix_phy_mode4 = - hp_flags & (MV_HP_ERRATA_60X1B2 | MV_HP_ERRATA_60X1C0); - u32 m2, tmp; - - if (fix_phy_mode2) { - m2 = readl(port_mmio + PHY_MODE2); - m2 &= ~(1 << 16); - m2 |= (1 << 31); - writel(m2, port_mmio + PHY_MODE2); - - udelay(200); - - m2 = readl(port_mmio + PHY_MODE2); - m2 &= ~((1 << 16) | (1 << 31)); - writel(m2, port_mmio + PHY_MODE2); - - udelay(200); - } - - /* who knows what this magic does */ - tmp = readl(port_mmio + PHY_MODE3); - tmp &= ~0x7F800000; - tmp |= 0x2A800000; - writel(tmp, port_mmio + PHY_MODE3); - - if (fix_phy_mode4) { - u32 m4; - - m4 = readl(port_mmio + PHY_MODE4); - - if (hp_flags & MV_HP_ERRATA_60X1B2) - tmp = readl(port_mmio + 0x310); - - m4 = (m4 & ~(1 << 1)) | (1 << 0); - - writel(m4, port_mmio + PHY_MODE4); - - if (hp_flags & MV_HP_ERRATA_60X1B2) - writel(tmp, port_mmio + 0x310); - } - - /* Revert values of pre-emphasis and signal amps to the saved ones */ - m2 = readl(port_mmio + PHY_MODE2); - - m2 &= ~MV_M2_PREAMP_MASK; - m2 |= hpriv->signal[port].amps; - m2 |= hpriv->signal[port].pre; - m2 &= ~(1 << 16); - - writel(m2, port_mmio + PHY_MODE2); -} - -static void mv_channel_reset(struct mv_host_priv *hpriv, void __iomem *mmio, - unsigned int port_no) -{ - void __iomem *port_mmio = mv_port_base(mmio, port_no); - - writelfl(ATA_RST, port_mmio + EDMA_CMD_OFS); - - if (IS_60XX(hpriv)) { - u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL); - ifctl |= (1 << 12) | (1 << 7); - writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL); - } - - udelay(25); /* allow reset propagation */ - - /* Spec never mentions clearing the bit. Marvell's driver does - * clear the bit, however. - */ - writelfl(0, port_mmio + EDMA_CMD_OFS); - - hpriv->ops->phy_errata(hpriv, mmio, port_no); - - if (IS_50XX(hpriv)) - mdelay(1); -} - -static void mv_stop_and_reset(struct ata_port *ap) -{ - struct mv_host_priv *hpriv = ap->host_set->private_data; - void __iomem *mmio = ap->host_set->mmio_base; - - mv_stop_dma(ap); - - mv_channel_reset(hpriv, mmio, ap->port_no); - - __mv_phy_reset(ap, 0); -} - -static inline void __msleep(unsigned int msec, int can_sleep) -{ - if (can_sleep) - msleep(msec); - else - mdelay(msec); -} - /** - * __mv_phy_reset - Perform eDMA reset followed by COMRESET + * mv_phy_reset - Perform eDMA reset followed by COMRESET * @ap: ATA channel to manipulate * * Part of this is taken from __sata_phy_reset and modified to @@ -1733,47 +1213,41 @@ static inline void __msleep(unsigned int msec, int can_sleep) * Inherited from caller. This is coded to safe to call at * interrupt level, i.e. it does not sleep. */ -static void __mv_phy_reset(struct ata_port *ap, int can_sleep) +static void mv_phy_reset(struct ata_port *ap) { - struct mv_port_priv *pp = ap->private_data; - struct mv_host_priv *hpriv = ap->host_set->private_data; void __iomem *port_mmio = mv_ap_base(ap); struct ata_taskfile tf; struct ata_device *dev = &ap->device[0]; unsigned long timeout; - int retry = 5; - u32 sstatus; VPRINTK("ENTER, port %u, mmio 0x%p\n", ap->port_no, port_mmio); - DPRINTK("S-regs after ATA_RST: SStat 0x%08x SErr 0x%08x " + mv_stop_dma(ap); + + writelfl(ATA_RST, port_mmio + EDMA_CMD_OFS); + udelay(25); /* allow reset propagation */ + + /* Spec never mentions clearing the bit. Marvell's driver does + * clear the bit, however. + */ + writelfl(0, port_mmio + EDMA_CMD_OFS); + + VPRINTK("S-regs after ATA_RST: SStat 0x%08x SErr 0x%08x " "SCtrl 0x%08x\n", mv_scr_read(ap, SCR_STATUS), mv_scr_read(ap, SCR_ERROR), mv_scr_read(ap, SCR_CONTROL)); - /* Issue COMRESET via SControl */ -comreset_retry: + /* proceed to init communications via the scr_control reg */ scr_write_flush(ap, SCR_CONTROL, 0x301); - __msleep(1, can_sleep); - + mdelay(1); scr_write_flush(ap, SCR_CONTROL, 0x300); - __msleep(20, can_sleep); - - timeout = jiffies + msecs_to_jiffies(200); + timeout = jiffies + (HZ * 1); do { - sstatus = scr_read(ap, SCR_STATUS) & 0x3; - if ((sstatus == 3) || (sstatus == 0)) + mdelay(10); + if ((scr_read(ap, SCR_STATUS) & 0xf) != 1) break; - - __msleep(1, can_sleep); } while (time_before(jiffies, timeout)); - /* work around errata */ - if (IS_60XX(hpriv) && - (sstatus != 0x0) && (sstatus != 0x113) && (sstatus != 0x123) && - (retry-- > 0)) - goto comreset_retry; - - DPRINTK("S-regs after PHY wake: SStat 0x%08x SErr 0x%08x " + VPRINTK("S-regs after PHY wake: SStat 0x%08x SErr 0x%08x " "SCtrl 0x%08x\n", mv_scr_read(ap, SCR_STATUS), mv_scr_read(ap, SCR_ERROR), mv_scr_read(ap, SCR_CONTROL)); @@ -1787,21 +1261,6 @@ static void __mv_phy_reset(struct ata_port *ap, int can_sleep) } ap->cbl = ATA_CBL_SATA; - /* even after SStatus reflects that device is ready, - * it seems to take a while for link to be fully - * established (and thus Status no longer 0x80/0x7F), - * so we poll a bit for that, here. - */ - retry = 20; - while (1) { - u8 drv_stat = ata_check_status(ap); - if ((drv_stat != 0x80) && (drv_stat != 0x7f)) - break; - __msleep(500, can_sleep); - if (retry-- <= 0) - break; - } - tf.lbah = readb((void __iomem *) ap->ioaddr.lbah_addr); tf.lbam = readb((void __iomem *) ap->ioaddr.lbam_addr); tf.lbal = readb((void __iomem *) ap->ioaddr.lbal_addr); @@ -1812,19 +1271,9 @@ static void __mv_phy_reset(struct ata_port *ap, int can_sleep) VPRINTK("Port disabled post-sig: No device present.\n"); ata_port_disable(ap); } - - writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); - - pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN; - VPRINTK("EXIT\n"); } -static void mv_phy_reset(struct ata_port *ap) -{ - __mv_phy_reset(ap, 1); -} - /** * mv_eng_timeout - Routine called by libata when SCSI times out I/O * @ap: ATA channel to manipulate @@ -1842,16 +1291,16 @@ static void mv_eng_timeout(struct ata_port *ap) printk(KERN_ERR "ata%u: Entering mv_eng_timeout\n",ap->id); DPRINTK("All regs @ start of eng_timeout\n"); - mv_dump_all_regs(ap->host_set->mmio_base, ap->port_no, + mv_dump_all_regs(ap->host_set->mmio_base, ap->port_no, to_pci_dev(ap->host_set->dev)); qc = ata_qc_from_tag(ap, ap->active_tag); printk(KERN_ERR "mmio_base %p ap %p qc %p scsi_cmnd %p &cmnd %p\n", - ap->host_set->mmio_base, ap, qc, qc->scsicmd, + ap->host_set->mmio_base, ap, qc, qc->scsicmd, &qc->scsicmd->cmnd); mv_err_intr(ap); - mv_stop_and_reset(ap); + mv_phy_reset(ap); if (!qc) { printk(KERN_ERR "ata%u: BUG: timeout without command\n", @@ -1887,17 +1336,17 @@ static void mv_port_init(struct ata_ioports *port, void __iomem *port_mmio) unsigned long shd_base = (unsigned long) port_mmio + SHD_BLK_OFS; unsigned serr_ofs; - /* PIO related setup + /* PIO related setup */ port->data_addr = shd_base + (sizeof(u32) * ATA_REG_DATA); - port->error_addr = + port->error_addr = port->feature_addr = shd_base + (sizeof(u32) * ATA_REG_ERR); port->nsect_addr = shd_base + (sizeof(u32) * ATA_REG_NSECT); port->lbal_addr = shd_base + (sizeof(u32) * ATA_REG_LBAL); port->lbam_addr = shd_base + (sizeof(u32) * ATA_REG_LBAM); port->lbah_addr = shd_base + (sizeof(u32) * ATA_REG_LBAH); port->device_addr = shd_base + (sizeof(u32) * ATA_REG_DEVICE); - port->status_addr = + port->status_addr = port->command_addr = shd_base + (sizeof(u32) * ATA_REG_STATUS); /* special case: control/altstatus doesn't have ATA_REG_ address */ port->altstatus_addr = port->ctl_addr = shd_base + SHD_CTL_AST_OFS; @@ -1913,92 +1362,14 @@ static void mv_port_init(struct ata_ioports *port, void __iomem *port_mmio) /* unmask all EDMA error interrupts */ writelfl(~0, port_mmio + EDMA_ERR_IRQ_MASK_OFS); - VPRINTK("EDMA cfg=0x%08x EDMA IRQ err cause/mask=0x%08x/0x%08x\n", + VPRINTK("EDMA cfg=0x%08x EDMA IRQ err cause/mask=0x%08x/0x%08x\n", readl(port_mmio + EDMA_CFG_OFS), readl(port_mmio + EDMA_ERR_IRQ_CAUSE_OFS), readl(port_mmio + EDMA_ERR_IRQ_MASK_OFS)); } -static int mv_chip_id(struct pci_dev *pdev, struct mv_host_priv *hpriv, - unsigned int board_idx) -{ - u8 rev_id; - u32 hp_flags = hpriv->hp_flags; - - pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); - - switch(board_idx) { - case chip_5080: - hpriv->ops = &mv5xxx_ops; - hp_flags |= MV_HP_50XX; - - switch (rev_id) { - case 0x1: - hp_flags |= MV_HP_ERRATA_50XXB0; - break; - case 0x3: - hp_flags |= MV_HP_ERRATA_50XXB2; - break; - default: - dev_printk(KERN_WARNING, &pdev->dev, - "Applying 50XXB2 workarounds to unknown rev\n"); - hp_flags |= MV_HP_ERRATA_50XXB2; - break; - } - break; - - case chip_504x: - case chip_508x: - hpriv->ops = &mv5xxx_ops; - hp_flags |= MV_HP_50XX; - - switch (rev_id) { - case 0x0: - hp_flags |= MV_HP_ERRATA_50XXB0; - break; - case 0x3: - hp_flags |= MV_HP_ERRATA_50XXB2; - break; - default: - dev_printk(KERN_WARNING, &pdev->dev, - "Applying B2 workarounds to unknown rev\n"); - hp_flags |= MV_HP_ERRATA_50XXB2; - break; - } - break; - - case chip_604x: - case chip_608x: - hpriv->ops = &mv6xxx_ops; - - switch (rev_id) { - case 0x7: - hp_flags |= MV_HP_ERRATA_60X1B2; - break; - case 0x9: - hp_flags |= MV_HP_ERRATA_60X1C0; - break; - default: - dev_printk(KERN_WARNING, &pdev->dev, - "Applying B2 workarounds to unknown rev\n"); - hp_flags |= MV_HP_ERRATA_60X1B2; - break; - } - break; - - default: - printk(KERN_ERR DRV_NAME ": BUG: invalid board index %u\n", board_idx); - return 1; - } - - hpriv->hp_flags = hp_flags; - - return 0; -} - /** - * mv_init_host - Perform some early initialization of the host. - * @pdev: host PCI device + * mv_host_init - Perform some early initialization of the host. * @probe_ent: early data struct representing the host * * If possible, do an early global reset of the host. Then do @@ -2007,48 +1378,23 @@ static int mv_chip_id(struct pci_dev *pdev, struct mv_host_priv *hpriv, * LOCKING: * Inherited from caller. */ -static int mv_init_host(struct pci_dev *pdev, struct ata_probe_ent *probe_ent, - unsigned int board_idx) +static int mv_host_init(struct ata_probe_ent *probe_ent) { int rc = 0, n_hc, port, hc; void __iomem *mmio = probe_ent->mmio_base; - struct mv_host_priv *hpriv = probe_ent->private_data; - - /* global interrupt mask */ - writel(0, mmio + HC_MAIN_IRQ_MASK_OFS); + void __iomem *port_mmio; - rc = mv_chip_id(pdev, hpriv, board_idx); - if (rc) + if ((MV_FLAG_GLBL_SFT_RST & probe_ent->host_flags) && + mv_global_soft_reset(probe_ent->mmio_base)) { + rc = 1; goto done; + } n_hc = mv_get_hc_count(probe_ent->host_flags); probe_ent->n_ports = MV_PORTS_PER_HC * n_hc; - for (port = 0; port < probe_ent->n_ports; port++) - hpriv->ops->read_preamp(hpriv, port, mmio); - - rc = hpriv->ops->reset_hc(hpriv, mmio, n_hc); - if (rc) - goto done; - - hpriv->ops->reset_flash(hpriv, mmio); - hpriv->ops->reset_bus(pdev, mmio); - hpriv->ops->enable_leds(hpriv, mmio); - for (port = 0; port < probe_ent->n_ports; port++) { - if (IS_60XX(hpriv)) { - void __iomem *port_mmio = mv_port_base(mmio, port); - - u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL); - ifctl |= (1 << 12); - writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL); - } - - hpriv->ops->phy_errata(hpriv, mmio, port); - } - - for (port = 0; port < probe_ent->n_ports; port++) { - void __iomem *port_mmio = mv_port_base(mmio, port); + port_mmio = mv_port_base(mmio, port); mv_port_init(&probe_ent->port[port], port_mmio); } @@ -2072,12 +1418,11 @@ static int mv_init_host(struct pci_dev *pdev, struct ata_probe_ent *probe_ent, writelfl(~HC_MAIN_MASKED_IRQS, mmio + HC_MAIN_IRQ_MASK_OFS); VPRINTK("HC MAIN IRQ cause/mask=0x%08x/0x%08x " - "PCI int cause/mask=0x%08x/0x%08x\n", + "PCI int cause/mask=0x%08x/0x%08x\n", readl(mmio + HC_MAIN_IRQ_CAUSE_OFS), readl(mmio + HC_MAIN_IRQ_MASK_OFS), readl(mmio + PCI_IRQ_CAUSE_OFS), readl(mmio + PCI_IRQ_MASK_OFS)); - done: return rc; } @@ -2113,7 +1458,7 @@ static void mv_print_info(struct ata_probe_ent *probe_ent) dev_printk(KERN_INFO, &pdev->dev, "%u slots %u ports %s mode IRQ via %s\n", - (unsigned)MV_MAX_Q_DEPTH, probe_ent->n_ports, + (unsigned)MV_MAX_Q_DEPTH, probe_ent->n_ports, scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx"); } @@ -2183,7 +1528,7 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) probe_ent->private_data = hpriv; /* initialize adapter */ - rc = mv_init_host(pdev, probe_ent, board_idx); + rc = mv_host_init(probe_ent); if (rc) { goto err_out_hpriv; } diff --git a/trunk/drivers/scsi/sata_promise.c b/trunk/drivers/scsi/sata_promise.c index 2691625f9bce..242d906987ad 100644 --- a/trunk/drivers/scsi/sata_promise.c +++ b/trunk/drivers/scsi/sata_promise.c @@ -46,7 +46,7 @@ #include "sata_promise.h" #define DRV_NAME "sata_promise" -#define DRV_VERSION "1.03" +#define DRV_VERSION "1.02" enum { @@ -70,9 +70,6 @@ enum { PDC_HAS_PATA = (1 << 1), /* PDC20375 has PATA */ PDC_RESET = (1 << 11), /* HDMA reset */ - - PDC_COMMON_FLAGS = ATA_FLAG_NO_LEGACY | ATA_FLAG_SRST | - ATA_FLAG_MMIO | ATA_FLAG_NO_ATAPI, }; @@ -165,7 +162,8 @@ static struct ata_port_info pdc_port_info[] = { /* board_2037x */ { .sht = &pdc_ata_sht, - .host_flags = PDC_COMMON_FLAGS | ATA_FLAG_SATA, + .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | + ATA_FLAG_SRST | ATA_FLAG_MMIO, .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = 0x7f, /* udma0-6 ; FIXME */ @@ -175,7 +173,8 @@ static struct ata_port_info pdc_port_info[] = { /* board_20319 */ { .sht = &pdc_ata_sht, - .host_flags = PDC_COMMON_FLAGS | ATA_FLAG_SATA, + .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | + ATA_FLAG_SRST | ATA_FLAG_MMIO, .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = 0x7f, /* udma0-6 ; FIXME */ @@ -185,7 +184,8 @@ static struct ata_port_info pdc_port_info[] = { /* board_20619 */ { .sht = &pdc_ata_sht, - .host_flags = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS, + .host_flags = ATA_FLAG_NO_LEGACY | ATA_FLAG_SRST | + ATA_FLAG_MMIO | ATA_FLAG_SLAVE_POSS, .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = 0x7f, /* udma0-6 ; FIXME */ diff --git a/trunk/drivers/scsi/sata_qstor.c b/trunk/drivers/scsi/sata_qstor.c index a8987f5ff5cc..4a6d3067d23c 100644 --- a/trunk/drivers/scsi/sata_qstor.c +++ b/trunk/drivers/scsi/sata_qstor.c @@ -41,7 +41,7 @@ #include #define DRV_NAME "sata_qstor" -#define DRV_VERSION "0.05" +#define DRV_VERSION "0.04" enum { QS_PORTS = 4, diff --git a/trunk/drivers/scsi/sata_sil24.c b/trunk/drivers/scsi/sata_sil24.c index e0d6f194f54f..55e744d6db88 100644 --- a/trunk/drivers/scsi/sata_sil24.c +++ b/trunk/drivers/scsi/sata_sil24.c @@ -5,6 +5,17 @@ * * Based on preview driver from Silicon Image. * + * NOTE: No NCQ/ATAPI support yet. The preview driver didn't support + * NCQ nor ATAPI, and, unfortunately, I couldn't find out how to make + * those work. Enabling those shouldn't be difficult. Basic + * structure is all there (in libata-dev tree). If you have any + * information about this hardware, please contact me or linux-ide. + * Info is needed on... + * + * - How to issue tagged commands and turn on sactive on issue accordingly. + * - Where to put an ATAPI command and how to tell the device to send it. + * - How to enable/use 64bit. + * * 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 @@ -31,7 +42,7 @@ #include #define DRV_NAME "sata_sil24" -#define DRV_VERSION "0.23" +#define DRV_VERSION "0.22" /* Silicon Image's preview driver was 0.10 */ /* * Port request block (PRB) 32 bytes @@ -128,7 +139,6 @@ enum { PORT_CS_DEV_RST = (1 << 1), /* device reset */ PORT_CS_INIT = (1 << 2), /* port initialize */ PORT_CS_IRQ_WOC = (1 << 3), /* interrupt write one to clear */ - PORT_CS_CDB16 = (1 << 5), /* 0=12b cdb, 1=16b cdb */ PORT_CS_RESUME = (1 << 6), /* port resume */ PORT_CS_32BIT_ACTV = (1 << 10), /* 32-bit activation */ PORT_CS_PM_EN = (1 << 13), /* port multiplier enable */ @@ -178,29 +188,11 @@ enum { PORT_CERR_XFR_PCIPERR = 35, /* PSD ecode 11 - PCI prity err during transfer */ PORT_CERR_SENDSERVICE = 36, /* FIS received while sending service */ - /* bits of PRB control field */ - PRB_CTRL_PROTOCOL = (1 << 0), /* override def. ATA protocol */ - PRB_CTRL_PACKET_READ = (1 << 4), /* PACKET cmd read */ - PRB_CTRL_PACKET_WRITE = (1 << 5), /* PACKET cmd write */ - PRB_CTRL_NIEN = (1 << 6), /* Mask completion irq */ - PRB_CTRL_SRST = (1 << 7), /* Soft reset request (ign BSY?) */ - - /* PRB protocol field */ - PRB_PROT_PACKET = (1 << 0), - PRB_PROT_TCQ = (1 << 1), - PRB_PROT_NCQ = (1 << 2), - PRB_PROT_READ = (1 << 3), - PRB_PROT_WRITE = (1 << 4), - PRB_PROT_TRANSPARENT = (1 << 5), - /* * Other constants */ SGE_TRM = (1 << 31), /* Last SGE in chain */ - SGE_LNK = (1 << 30), /* linked list - Points to SGT, not SGE */ - SGE_DRD = (1 << 29), /* discard data read (/dev/null) - data address ignored */ + PRB_SOFT_RST = (1 << 7), /* Soft reset request (ign BSY?) */ /* board id */ BID_SIL3124 = 0, @@ -210,22 +202,11 @@ enum { IRQ_STAT_4PORTS = 0xf, }; -struct sil24_ata_block { +struct sil24_cmd_block { struct sil24_prb prb; struct sil24_sge sge[LIBATA_MAX_PRD]; }; -struct sil24_atapi_block { - struct sil24_prb prb; - u8 cdb[16]; - struct sil24_sge sge[LIBATA_MAX_PRD - 1]; -}; - -union sil24_cmd_block { - struct sil24_ata_block ata; - struct sil24_atapi_block atapi; -}; - /* * ap->private_data * @@ -233,7 +214,7 @@ union sil24_cmd_block { * here from the previous interrupt. */ struct sil24_port_priv { - union sil24_cmd_block *cmd_block; /* 32 cmd blocks */ + struct sil24_cmd_block *cmd_block; /* 32 cmd blocks */ dma_addr_t cmd_block_dma; /* DMA base addr for them */ struct ata_taskfile tf; /* Cached taskfile registers */ }; @@ -244,7 +225,6 @@ struct sil24_host_priv { void __iomem *port_base; /* port registers (4 * 8192 bytes @BAR2) */ }; -static void sil24_dev_config(struct ata_port *ap, struct ata_device *dev); static u8 sil24_check_status(struct ata_port *ap); static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg); static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val); @@ -298,8 +278,6 @@ static struct scsi_host_template sil24_sht = { static const struct ata_port_operations sil24_ops = { .port_disable = ata_port_disable, - .dev_config = sil24_dev_config, - .check_status = sil24_check_status, .check_altstatus = sil24_check_status, .dev_select = ata_noop_dev_select, @@ -336,7 +314,7 @@ static struct ata_port_info sil24_port_info[] = { { .sht = &sil24_sht, .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | - ATA_FLAG_SRST | ATA_FLAG_MMIO | + ATA_FLAG_SATA_RESET | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | SIL24_NPORTS2FLAG(4), .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ @@ -347,7 +325,7 @@ static struct ata_port_info sil24_port_info[] = { { .sht = &sil24_sht, .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | - ATA_FLAG_SRST | ATA_FLAG_MMIO | + ATA_FLAG_SATA_RESET | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | SIL24_NPORTS2FLAG(2), .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ @@ -358,7 +336,7 @@ static struct ata_port_info sil24_port_info[] = { { .sht = &sil24_sht, .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | - ATA_FLAG_SRST | ATA_FLAG_MMIO | + ATA_FLAG_SATA_RESET | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | SIL24_NPORTS2FLAG(1), .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ @@ -367,16 +345,6 @@ static struct ata_port_info sil24_port_info[] = { }, }; -static void sil24_dev_config(struct ata_port *ap, struct ata_device *dev) -{ - void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; - - if (ap->cdb_len == 16) - writel(PORT_CS_CDB16, port + PORT_CTRL_STAT); - else - writel(PORT_CS_CDB16, port + PORT_CTRL_CLR); -} - static inline void sil24_update_tf(struct ata_port *ap) { struct sil24_port_priv *pp = ap->private_data; @@ -428,73 +396,22 @@ static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf) *tf = pp->tf; } -static int sil24_issue_SRST(struct ata_port *ap) -{ - void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; - struct sil24_port_priv *pp = ap->private_data; - struct sil24_prb *prb = &pp->cmd_block[0].ata.prb; - dma_addr_t paddr = pp->cmd_block_dma; - u32 irq_enable, irq_stat; - int cnt; - - /* temporarily turn off IRQs during SRST */ - irq_enable = readl(port + PORT_IRQ_ENABLE_SET); - writel(irq_enable, port + PORT_IRQ_ENABLE_CLR); - - /* - * XXX: Not sure whether the following sleep is needed or not. - * The original driver had it. So.... - */ - msleep(10); - - prb->ctrl = PRB_CTRL_SRST; - prb->fis[1] = 0; /* no PM yet */ - - writel((u32)paddr, port + PORT_CMD_ACTIVATE); - - for (cnt = 0; cnt < 100; cnt++) { - irq_stat = readl(port + PORT_IRQ_STAT); - writel(irq_stat, port + PORT_IRQ_STAT); /* clear irq */ - - irq_stat >>= PORT_IRQ_RAW_SHIFT; - if (irq_stat & (PORT_IRQ_COMPLETE | PORT_IRQ_ERROR)) - break; - - msleep(1); - } - - /* restore IRQs */ - writel(irq_enable, port + PORT_IRQ_ENABLE_SET); - - if (!(irq_stat & PORT_IRQ_COMPLETE)) - return -1; - - /* update TF */ - sil24_update_tf(ap); - return 0; -} - static void sil24_phy_reset(struct ata_port *ap) { - struct sil24_port_priv *pp = ap->private_data; - __sata_phy_reset(ap); - if (ap->flags & ATA_FLAG_PORT_DISABLED) - return; - - if (sil24_issue_SRST(ap) < 0) { - printk(KERN_ERR DRV_NAME - " ata%u: SRST failed, disabling port\n", ap->id); - ap->ops->port_disable(ap); - return; - } - - ap->device->class = ata_dev_classify(&pp->tf); + /* + * No ATAPI yet. Just unconditionally indicate ATA device. + * If ATAPI device is attached, it will fail ATA_CMD_ID_ATA + * and libata core will ignore the device. + */ + if (!(ap->flags & ATA_FLAG_PORT_DISABLED)) + ap->device[0].class = ATA_DEV_ATA; } static inline void sil24_fill_sg(struct ata_queued_cmd *qc, - struct sil24_sge *sge) + struct sil24_cmd_block *cb) { + struct sil24_sge *sge = cb->sge; struct scatterlist *sg; unsigned int idx = 0; @@ -515,47 +432,23 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc) { struct ata_port *ap = qc->ap; struct sil24_port_priv *pp = ap->private_data; - union sil24_cmd_block *cb = pp->cmd_block + qc->tag; - struct sil24_prb *prb; - struct sil24_sge *sge; + struct sil24_cmd_block *cb = pp->cmd_block + qc->tag; + struct sil24_prb *prb = &cb->prb; switch (qc->tf.protocol) { case ATA_PROT_PIO: case ATA_PROT_DMA: case ATA_PROT_NODATA: - prb = &cb->ata.prb; - sge = cb->ata.sge; - prb->ctrl = 0; - break; - - case ATA_PROT_ATAPI: - case ATA_PROT_ATAPI_DMA: - case ATA_PROT_ATAPI_NODATA: - prb = &cb->atapi.prb; - sge = cb->atapi.sge; - memset(cb->atapi.cdb, 0, 32); - memcpy(cb->atapi.cdb, qc->cdb, ap->cdb_len); - - if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) { - if (qc->tf.flags & ATA_TFLAG_WRITE) - prb->ctrl = PRB_CTRL_PACKET_WRITE; - else - prb->ctrl = PRB_CTRL_PACKET_READ; - } else - prb->ctrl = 0; - break; - default: - prb = NULL; /* shut up, gcc */ - sge = NULL; + /* ATAPI isn't supported yet */ BUG(); } ata_tf_to_fis(&qc->tf, prb->fis, 0); if (qc->flags & ATA_QCFLAG_DMAMAP) - sil24_fill_sg(qc, sge); + sil24_fill_sg(qc, cb); } static int sil24_qc_issue(struct ata_queued_cmd *qc) @@ -574,31 +467,6 @@ static void sil24_irq_clear(struct ata_port *ap) /* unused */ } -static int __sil24_restart_controller(void __iomem *port) -{ - u32 tmp; - int cnt; - - writel(PORT_CS_INIT, port + PORT_CTRL_STAT); - - /* Max ~10ms */ - for (cnt = 0; cnt < 10000; cnt++) { - tmp = readl(port + PORT_CTRL_STAT); - if (tmp & PORT_CS_RDY) - return 0; - udelay(1); - } - - return -1; -} - -static void sil24_restart_controller(struct ata_port *ap) -{ - if (__sil24_restart_controller((void __iomem *)ap->ioaddr.cmd_addr)) - printk(KERN_ERR DRV_NAME - " ata%u: failed to restart controller\n", ap->id); -} - static int __sil24_reset_controller(void __iomem *port) { int cnt; @@ -618,11 +486,7 @@ static int __sil24_reset_controller(void __iomem *port) if (tmp & PORT_CS_DEV_RST) return -1; - - if (tmp & PORT_CS_RDY) - return 0; - - return __sil24_restart_controller(port); + return 0; } static void sil24_reset_controller(struct ata_port *ap) @@ -684,15 +548,9 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) if (serror) writel(serror, port + PORT_SERROR); - /* - * Don't log ATAPI device errors. They're supposed to happen - * and any serious errors will be logged using sense data by - * the SCSI layer. - */ - if (ap->device[0].class != ATA_DEV_ATAPI || cmd_err > PORT_CERR_SDB) - printk("ata%u: error interrupt on port%d\n" - " stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n", - ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus, serror); + printk(KERN_ERR DRV_NAME " ata%u: error interrupt on port%d\n" + " stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n", + ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus, serror); if (cmd_err == PORT_CERR_DEV || cmd_err == PORT_CERR_SDB) { /* @@ -700,7 +558,6 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) */ sil24_update_tf(ap); err_mask = ac_err_mask(pp->tf.command); - sil24_restart_controller(ap); } else { /* * Other errors. libata currently doesn't have any @@ -708,11 +565,12 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) * ATA_ERR. */ err_mask = AC_ERR_OTHER; - sil24_reset_controller(ap); } if (qc) ata_qc_complete(qc, err_mask); + + sil24_reset_controller(ap); } static inline void sil24_host_intr(struct ata_port *ap) @@ -788,7 +646,7 @@ static int sil24_port_start(struct ata_port *ap) { struct device *dev = ap->host_set->dev; struct sil24_port_priv *pp; - union sil24_cmd_block *cb; + struct sil24_cmd_block *cb; size_t cb_size = sizeof(*cb); dma_addr_t cb_dma; int rc = -ENOMEM; diff --git a/trunk/drivers/scsi/sata_svw.c b/trunk/drivers/scsi/sata_svw.c index 6e7f7c83a75a..57e5a9d964c3 100644 --- a/trunk/drivers/scsi/sata_svw.c +++ b/trunk/drivers/scsi/sata_svw.c @@ -54,7 +54,7 @@ #endif /* CONFIG_PPC_OF */ #define DRV_NAME "sata_svw" -#define DRV_VERSION "1.07" +#define DRV_VERSION "1.06" /* Taskfile registers offsets */ #define K2_SATA_TF_CMD_OFFSET 0x00 diff --git a/trunk/drivers/scsi/sata_sx4.c b/trunk/drivers/scsi/sata_sx4.c index ac7b0d819ebc..b4bbe48acab0 100644 --- a/trunk/drivers/scsi/sata_sx4.c +++ b/trunk/drivers/scsi/sata_sx4.c @@ -46,7 +46,7 @@ #include "sata_promise.h" #define DRV_NAME "sata_sx4" -#define DRV_VERSION "0.8" +#define DRV_VERSION "0.7" enum { @@ -220,8 +220,7 @@ static struct ata_port_info pdc_port_info[] = { { .sht = &pdc_sata_sht, .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | - ATA_FLAG_SRST | ATA_FLAG_MMIO | - ATA_FLAG_NO_ATAPI, + ATA_FLAG_SRST | ATA_FLAG_MMIO, .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = 0x7f, /* udma0-6 ; FIXME */ diff --git a/trunk/drivers/scsi/sata_vsc.c b/trunk/drivers/scsi/sata_vsc.c index fcfa486965b4..77a6e4b9262d 100644 --- a/trunk/drivers/scsi/sata_vsc.c +++ b/trunk/drivers/scsi/sata_vsc.c @@ -47,7 +47,7 @@ #include #define DRV_NAME "sata_vsc" -#define DRV_VERSION "1.1" +#define DRV_VERSION "1.0" /* Interrupt register offsets (from chip base address) */ #define VSC_SATA_INT_STAT_OFFSET 0x00 diff --git a/trunk/drivers/scsi/scsi.c b/trunk/drivers/scsi/scsi.c index 180676d7115a..0be60bba58d3 100644 --- a/trunk/drivers/scsi/scsi.c +++ b/trunk/drivers/scsi/scsi.c @@ -265,10 +265,10 @@ struct scsi_cmnd *scsi_get_command(struct scsi_device *dev, gfp_t gfp_mask) spin_lock_irqsave(&dev->list_lock, flags); list_add_tail(&cmd->list, &dev->cmd_list); spin_unlock_irqrestore(&dev->list_lock, flags); - cmd->jiffies_at_alloc = jiffies; } else put_device(&dev->sdev_gendev); + cmd->jiffies_at_alloc = jiffies; return cmd; } EXPORT_SYMBOL(scsi_get_command); diff --git a/trunk/drivers/scsi/scsi_devinfo.c b/trunk/drivers/scsi/scsi_devinfo.c index f01ec0a7c506..e69477d1889b 100644 --- a/trunk/drivers/scsi/scsi_devinfo.c +++ b/trunk/drivers/scsi/scsi_devinfo.c @@ -354,9 +354,8 @@ static int scsi_dev_info_list_add_str(char *dev_list) * @model, if found, return the matching flags value, else return * the host or global default settings. **/ -int scsi_get_device_flags(struct scsi_device *sdev, - const unsigned char *vendor, - const unsigned char *model) +int scsi_get_device_flags(struct scsi_device *sdev, unsigned char *vendor, + unsigned char *model) { struct scsi_dev_info_list *devinfo; unsigned int bflags; diff --git a/trunk/drivers/scsi/scsi_error.c b/trunk/drivers/scsi/scsi_error.c index a2333d2c7af0..18c5d2523014 100644 --- a/trunk/drivers/scsi/scsi_error.c +++ b/trunk/drivers/scsi/scsi_error.c @@ -422,15 +422,10 @@ static int scsi_eh_completed_normally(struct scsi_cmnd *scmd) **/ static void scsi_eh_done(struct scsi_cmnd *scmd) { - struct completion *eh_action; - SCSI_LOG_ERROR_RECOVERY(3, printk("%s scmd: %p result: %x\n", __FUNCTION__, scmd, scmd->result)); - - eh_action = scmd->device->host->eh_action; - if (eh_action) - complete(eh_action); + complete(scmd->device->host->eh_action); } /** @@ -1319,6 +1314,23 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) } } +/** + * scsi_eh_lock_done - done function for eh door lock request + * @scmd: SCSI command block for the door lock request + * + * Notes: + * We completed the asynchronous door lock request, and it has either + * locked the door or failed. We must free the command structures + * associated with this request. + **/ +static void scsi_eh_lock_done(struct scsi_cmnd *scmd) +{ + struct scsi_request *sreq = scmd->sc_request; + + scsi_release_request(sreq); +} + + /** * scsi_eh_lock_door - Prevent medium removal for the specified device * @sdev: SCSI device to prevent medium removal @@ -1341,17 +1353,29 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) **/ static void scsi_eh_lock_door(struct scsi_device *sdev) { - unsigned char cmnd[MAX_COMMAND_SIZE]; + struct scsi_request *sreq = scsi_allocate_request(sdev, GFP_KERNEL); - cmnd[0] = ALLOW_MEDIUM_REMOVAL; - cmnd[1] = 0; - cmnd[2] = 0; - cmnd[3] = 0; - cmnd[4] = SCSI_REMOVAL_PREVENT; - cmnd[5] = 0; + if (unlikely(!sreq)) { + printk(KERN_ERR "%s: request allocate failed," + "prevent media removal cmd not sent\n", __FUNCTION__); + return; + } - scsi_execute_async(sdev, cmnd, DMA_NONE, NULL, 0, 0, 10 * HZ, - 5, NULL, NULL, GFP_KERNEL); + sreq->sr_cmnd[0] = ALLOW_MEDIUM_REMOVAL; + sreq->sr_cmnd[1] = 0; + sreq->sr_cmnd[2] = 0; + sreq->sr_cmnd[3] = 0; + sreq->sr_cmnd[4] = SCSI_REMOVAL_PREVENT; + sreq->sr_cmnd[5] = 0; + sreq->sr_data_direction = DMA_NONE; + sreq->sr_bufflen = 0; + sreq->sr_buffer = NULL; + sreq->sr_allowed = 5; + sreq->sr_done = scsi_eh_lock_done; + sreq->sr_timeout_per_command = 10 * HZ; + sreq->sr_cmd_len = COMMAND_SIZE(sreq->sr_cmnd[0]); + + scsi_insert_special_req(sreq, 1); } diff --git a/trunk/drivers/scsi/scsi_lib.c b/trunk/drivers/scsi/scsi_lib.c index a7f3f0c84db7..ce9d73a292e2 100644 --- a/trunk/drivers/scsi/scsi_lib.c +++ b/trunk/drivers/scsi/scsi_lib.c @@ -63,6 +63,39 @@ static struct scsi_host_sg_pool scsi_sg_pools[] = { }; #undef SP + +/* + * Function: scsi_insert_special_req() + * + * Purpose: Insert pre-formed request into request queue. + * + * Arguments: sreq - request that is ready to be queued. + * at_head - boolean. True if we should insert at head + * of queue, false if we should insert at tail. + * + * Lock status: Assumed that lock is not held upon entry. + * + * Returns: Nothing + * + * Notes: This function is called from character device and from + * ioctl types of functions where the caller knows exactly + * what SCSI command needs to be issued. The idea is that + * we merely inject the command into the queue (at the head + * for now), and then call the queue request function to actually + * process it. + */ +int scsi_insert_special_req(struct scsi_request *sreq, int at_head) +{ + /* + * Because users of this function are apt to reuse requests with no + * modification, we have to sanitise the request flags here + */ + sreq->sr_request->flags &= ~REQ_DONTPREP; + blk_insert_request(sreq->sr_device->request_queue, sreq->sr_request, + at_head, sreq); + return 0; +} + static void scsi_run_queue(struct request_queue *q); /* @@ -216,13 +249,8 @@ void scsi_do_req(struct scsi_request *sreq, const void *cmnd, /* * head injection *required* here otherwise quiesce won't work - * - * Because users of this function are apt to reuse requests with no - * modification, we have to sanitise the request flags here */ - sreq->sr_request->flags &= ~REQ_DONTPREP; - blk_insert_request(sreq->sr_device->request_queue, sreq->sr_request, - 1, sreq); + scsi_insert_special_req(sreq, 1); } EXPORT_SYMBOL(scsi_do_req); @@ -259,7 +287,6 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, memcpy(req->cmd, cmd, req->cmd_len); req->sense = sense; req->sense_len = 0; - req->retries = retries; req->timeout = timeout; req->flags |= flags | REQ_BLOCK_PC | REQ_SPECIAL | REQ_QUIET; @@ -300,200 +327,6 @@ int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, } EXPORT_SYMBOL(scsi_execute_req); -struct scsi_io_context { - void *data; - void (*done)(void *data, char *sense, int result, int resid); - char sense[SCSI_SENSE_BUFFERSIZE]; -}; - -static kmem_cache_t *scsi_io_context_cache; - -static void scsi_end_async(struct request *req) -{ - struct scsi_io_context *sioc = req->end_io_data; - - if (sioc->done) - sioc->done(sioc->data, sioc->sense, req->errors, req->data_len); - - kmem_cache_free(scsi_io_context_cache, sioc); - __blk_put_request(req->q, req); -} - -static int scsi_merge_bio(struct request *rq, struct bio *bio) -{ - struct request_queue *q = rq->q; - - bio->bi_flags &= ~(1 << BIO_SEG_VALID); - if (rq_data_dir(rq) == WRITE) - bio->bi_rw |= (1 << BIO_RW); - blk_queue_bounce(q, &bio); - - if (!rq->bio) - blk_rq_bio_prep(q, rq, bio); - else if (!q->back_merge_fn(q, rq, bio)) - return -EINVAL; - else { - rq->biotail->bi_next = bio; - rq->biotail = bio; - rq->hard_nr_sectors += bio_sectors(bio); - rq->nr_sectors = rq->hard_nr_sectors; - } - - return 0; -} - -static int scsi_bi_endio(struct bio *bio, unsigned int bytes_done, int error) -{ - if (bio->bi_size) - return 1; - - bio_put(bio); - return 0; -} - -/** - * scsi_req_map_sg - map a scatterlist into a request - * @rq: request to fill - * @sg: scatterlist - * @nsegs: number of elements - * @bufflen: len of buffer - * @gfp: memory allocation flags - * - * scsi_req_map_sg maps a scatterlist into a request so that the - * request can be sent to the block layer. We do not trust the scatterlist - * sent to use, as some ULDs use that struct to only organize the pages. - */ -static int scsi_req_map_sg(struct request *rq, struct scatterlist *sgl, - int nsegs, unsigned bufflen, gfp_t gfp) -{ - struct request_queue *q = rq->q; - int nr_pages = (bufflen + PAGE_SIZE - 1) >> PAGE_SHIFT; - unsigned int data_len = 0, len, bytes, off; - struct page *page; - struct bio *bio = NULL; - int i, err, nr_vecs = 0; - - for (i = 0; i < nsegs; i++) { - page = sgl[i].page; - off = sgl[i].offset; - len = sgl[i].length; - data_len += len; - - while (len > 0) { - bytes = min_t(unsigned int, len, PAGE_SIZE - off); - - if (!bio) { - nr_vecs = min_t(int, BIO_MAX_PAGES, nr_pages); - nr_pages -= nr_vecs; - - bio = bio_alloc(gfp, nr_vecs); - if (!bio) { - err = -ENOMEM; - goto free_bios; - } - bio->bi_end_io = scsi_bi_endio; - } - - if (bio_add_pc_page(q, bio, page, bytes, off) != - bytes) { - bio_put(bio); - err = -EINVAL; - goto free_bios; - } - - if (bio->bi_vcnt >= nr_vecs) { - err = scsi_merge_bio(rq, bio); - if (err) { - bio_endio(bio, bio->bi_size, 0); - goto free_bios; - } - bio = NULL; - } - - page++; - len -= bytes; - off = 0; - } - } - - rq->buffer = rq->data = NULL; - rq->data_len = data_len; - return 0; - -free_bios: - while ((bio = rq->bio) != NULL) { - rq->bio = bio->bi_next; - /* - * call endio instead of bio_put incase it was bounced - */ - bio_endio(bio, bio->bi_size, 0); - } - - return err; -} - -/** - * scsi_execute_async - insert request - * @sdev: scsi device - * @cmd: scsi command - * @data_direction: data direction - * @buffer: data buffer (this can be a kernel buffer or scatterlist) - * @bufflen: len of buffer - * @use_sg: if buffer is a scatterlist this is the number of elements - * @timeout: request timeout in seconds - * @retries: number of times to retry request - * @flags: or into request flags - **/ -int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd, - int data_direction, void *buffer, unsigned bufflen, - int use_sg, int timeout, int retries, void *privdata, - void (*done)(void *, char *, int, int), gfp_t gfp) -{ - struct request *req; - struct scsi_io_context *sioc; - int err = 0; - int write = (data_direction == DMA_TO_DEVICE); - - sioc = kmem_cache_alloc(scsi_io_context_cache, gfp); - if (!sioc) - return DRIVER_ERROR << 24; - memset(sioc, 0, sizeof(*sioc)); - - req = blk_get_request(sdev->request_queue, write, gfp); - if (!req) - goto free_sense; - req->flags |= REQ_BLOCK_PC | REQ_QUIET; - - if (use_sg) - err = scsi_req_map_sg(req, buffer, use_sg, bufflen, gfp); - else if (bufflen) - err = blk_rq_map_kern(req->q, req, buffer, bufflen, gfp); - - if (err) - goto free_req; - - req->cmd_len = COMMAND_SIZE(cmd[0]); - memcpy(req->cmd, cmd, req->cmd_len); - req->sense = sioc->sense; - req->sense_len = 0; - req->timeout = timeout; - req->retries = retries; - req->end_io_data = sioc; - - sioc->data = privdata; - sioc->done = done; - - blk_execute_rq_nowait(req->q, NULL, req, 1, scsi_end_async); - return 0; - -free_req: - blk_put_request(req); -free_sense: - kfree(sioc); - return DRIVER_ERROR << 24; -} -EXPORT_SYMBOL_GPL(scsi_execute_async); - /* * Function: scsi_init_cmd_errh() * @@ -1051,8 +884,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes, * system where READ CAPACITY failed, we may have read * past the end of the disk. */ - if ((cmd->device->use_10_for_rw && - sshdr.asc == 0x20 && sshdr.ascq == 0x00) && + if (cmd->device->use_10_for_rw && (cmd->cmnd[0] == READ_10 || cmd->cmnd[0] == WRITE_10)) { cmd->device->use_10_for_rw = 0; @@ -1250,35 +1082,9 @@ static int scsi_issue_flush_fn(request_queue_t *q, struct gendisk *disk, static void scsi_generic_done(struct scsi_cmnd *cmd) { BUG_ON(!blk_pc_request(cmd->request)); - /* - * This will complete the whole command with uptodate=1 so - * as far as the block layer is concerned the command completed - * successfully. Since this is a REQ_BLOCK_PC command the - * caller should check the request's errors value - */ - scsi_io_completion(cmd, cmd->bufflen, 0); + scsi_io_completion(cmd, cmd->result == 0 ? cmd->bufflen : 0, 0); } -void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd) -{ - struct request *req = cmd->request; - - BUG_ON(sizeof(req->cmd) > sizeof(cmd->cmnd)); - memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); - cmd->cmd_len = req->cmd_len; - if (!req->data_len) - cmd->sc_data_direction = DMA_NONE; - else if (rq_data_dir(req) == WRITE) - cmd->sc_data_direction = DMA_TO_DEVICE; - else - cmd->sc_data_direction = DMA_FROM_DEVICE; - - cmd->transfersize = req->data_len; - cmd->allowed = req->retries; - cmd->timeout_per_command = req->timeout; -} -EXPORT_SYMBOL_GPL(scsi_setup_blk_pc_cmnd); - static int scsi_prep_fn(struct request_queue *q, struct request *req) { struct scsi_device *sdev = q->queuedata; @@ -1414,7 +1220,18 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) goto kill; } } else { - scsi_setup_blk_pc_cmnd(cmd); + memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); + cmd->cmd_len = req->cmd_len; + if (rq_data_dir(req) == WRITE) + cmd->sc_data_direction = DMA_TO_DEVICE; + else if (req->data_len) + cmd->sc_data_direction = DMA_FROM_DEVICE; + else + cmd->sc_data_direction = DMA_NONE; + + cmd->transfersize = req->data_len; + cmd->allowed = 3; + cmd->timeout_per_command = req->timeout; cmd->done = scsi_generic_done; } } @@ -1777,14 +1594,6 @@ int __init scsi_init_queue(void) { int i; - scsi_io_context_cache = kmem_cache_create("scsi_io_context", - sizeof(struct scsi_io_context), - 0, 0, NULL, NULL); - if (!scsi_io_context_cache) { - printk(KERN_ERR "SCSI: can't init scsi io context cache\n"); - return -ENOMEM; - } - for (i = 0; i < SG_MEMPOOL_NR; i++) { struct scsi_host_sg_pool *sgp = scsi_sg_pools + i; int size = sgp->size * sizeof(struct scatterlist); @@ -1812,8 +1621,6 @@ void scsi_exit_queue(void) { int i; - kmem_cache_destroy(scsi_io_context_cache); - for (i = 0; i < SG_MEMPOOL_NR; i++) { struct scsi_host_sg_pool *sgp = scsi_sg_pools + i; mempool_destroy(sgp->pool); diff --git a/trunk/drivers/scsi/scsi_priv.h b/trunk/drivers/scsi/scsi_priv.h index f04e7e11f57a..d632d9e1493c 100644 --- a/trunk/drivers/scsi/scsi_priv.h +++ b/trunk/drivers/scsi/scsi_priv.h @@ -40,6 +40,7 @@ extern void scsi_exit_hosts(void); extern int scsi_dispatch_cmd(struct scsi_cmnd *cmd); extern int scsi_setup_command_freelist(struct Scsi_Host *shost); extern void scsi_destroy_command_freelist(struct Scsi_Host *shost); +extern int scsi_insert_special_req(struct scsi_request *sreq, int); extern void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq); extern void __scsi_release_request(struct scsi_request *sreq); @@ -56,8 +57,7 @@ static inline void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) /* scsi_devinfo.c */ extern int scsi_get_device_flags(struct scsi_device *sdev, - const unsigned char *vendor, - const unsigned char *model); + unsigned char *vendor, unsigned char *model); extern int __init scsi_init_devinfo(void); extern void scsi_exit_devinfo(void); diff --git a/trunk/drivers/scsi/scsi_scan.c b/trunk/drivers/scsi/scsi_scan.c index 05ebb9cef961..374853df9cca 100644 --- a/trunk/drivers/scsi/scsi_scan.c +++ b/trunk/drivers/scsi/scsi_scan.c @@ -74,7 +74,7 @@ #define SCSI_SCAN_TARGET_PRESENT 1 #define SCSI_SCAN_LUN_PRESENT 2 -static const char *scsi_null_device_strs = "nullnullnullnull"; +static char *scsi_null_device_strs = "nullnullnullnull"; #define MAX_SCSI_LUNS 512 @@ -266,6 +266,8 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, /* * if LLDD reports slave not present, don't clutter * console with alloc failure messages + + */ if (ret == -ENXIO) display_failure_msg = 0; @@ -277,6 +279,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, out_device_destroy: transport_destroy_device(&sdev->sdev_gendev); + scsi_free_queue(sdev->request_queue); put_device(&sdev->sdev_gendev); out: if (display_failure_msg) @@ -400,36 +403,6 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, return found_target; } -struct work_queue_wrapper { - struct work_struct work; - struct scsi_target *starget; -}; - -static void scsi_target_reap_work(void *data) { - struct work_queue_wrapper *wqw = (struct work_queue_wrapper *)data; - struct scsi_target *starget = wqw->starget; - struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); - unsigned long flags; - - kfree(wqw); - - spin_lock_irqsave(shost->host_lock, flags); - - if (--starget->reap_ref == 0 && list_empty(&starget->devices)) { - list_del_init(&starget->siblings); - spin_unlock_irqrestore(shost->host_lock, flags); - transport_remove_device(&starget->dev); - device_del(&starget->dev); - transport_destroy_device(&starget->dev); - put_device(&starget->dev); - return; - - } - spin_unlock_irqrestore(shost->host_lock, flags); - - return; -} - /** * scsi_target_reap - check to see if target is in use and destroy if not * @@ -441,18 +414,19 @@ static void scsi_target_reap_work(void *data) { */ void scsi_target_reap(struct scsi_target *starget) { - struct work_queue_wrapper *wqw = - kzalloc(sizeof(struct work_queue_wrapper), GFP_ATOMIC); + struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); + unsigned long flags; + spin_lock_irqsave(shost->host_lock, flags); - if (!wqw) { - starget_printk(KERN_ERR, starget, - "Failed to allocate memory in scsi_reap_target()\n"); + if (--starget->reap_ref == 0 && list_empty(&starget->devices)) { + list_del_init(&starget->siblings); + spin_unlock_irqrestore(shost->host_lock, flags); + device_del(&starget->dev); + transport_unregister_device(&starget->dev); + put_device(&starget->dev); return; } - - INIT_WORK(&wqw->work, scsi_target_reap_work, wqw); - wqw->starget = starget; - schedule_work(&wqw->work); + spin_unlock_irqrestore(shost->host_lock, flags); } /** diff --git a/trunk/drivers/scsi/scsi_sysfs.c b/trunk/drivers/scsi/scsi_sysfs.c index 15842b1f0f4a..46349293de08 100644 --- a/trunk/drivers/scsi/scsi_sysfs.c +++ b/trunk/drivers/scsi/scsi_sysfs.c @@ -21,7 +21,7 @@ #include "scsi_priv.h" #include "scsi_logging.h" -static const struct { +static struct { enum scsi_device_state value; char *name; } sdev_states[] = { @@ -48,7 +48,7 @@ const char *scsi_device_state_name(enum scsi_device_state state) return name; } -static const struct { +static struct { enum scsi_host_state value; char *name; } shost_states[] = { diff --git a/trunk/drivers/scsi/scsi_transport_fc.c b/trunk/drivers/scsi/scsi_transport_fc.c index 685b997306cf..6cd5931d9a54 100644 --- a/trunk/drivers/scsi/scsi_transport_fc.c +++ b/trunk/drivers/scsi/scsi_transport_fc.c @@ -105,14 +105,13 @@ static struct { { FC_PORTSTATE_LINKDOWN, "Linkdown" }, { FC_PORTSTATE_ERROR, "Error" }, { FC_PORTSTATE_LOOPBACK, "Loopback" }, - { FC_PORTSTATE_DELETED, "Deleted" }, }; fc_enum_name_search(port_state, fc_port_state, fc_port_state_names) #define FC_PORTSTATE_MAX_NAMELEN 20 /* Convert fc_tgtid_binding_type values to ascii string name */ -static const struct { +static struct { enum fc_tgtid_binding_type value; char *name; int matchlen; @@ -150,7 +149,7 @@ get_fc_##title##_names(u32 table_key, char *buf) \ /* Convert FC_COS bit values to ascii string name */ -static const struct { +static struct { u32 value; char *name; } fc_cos_names[] = { @@ -164,7 +163,7 @@ fc_bitfield_name_search(cos, fc_cos_names) /* Convert FC_PORTSPEED bit values to ascii string name */ -static const struct { +static struct { u32 value; char *name; } fc_port_speed_names[] = { @@ -190,7 +189,7 @@ show_fc_fc4s (char *buf, u8 *fc4_list) /* Convert FC_RPORT_ROLE bit values to ascii string name */ -static const struct { +static struct { u32 value; char *name; } fc_remote_port_role_names[] = { @@ -212,7 +211,6 @@ fc_bitfield_name_search(remote_port_roles, fc_remote_port_role_names) #define FC_MGMTSRVR_PORTID 0x00000a -static void fc_shost_remove_rports(void *data); static void fc_timeout_deleted_rport(void *data); static void fc_scsi_scan_rport(void *data); static void fc_rport_terminate(struct fc_rport *rport); @@ -320,8 +318,6 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev, fc_host_next_rport_number(shost) = 0; fc_host_next_target_id(shost) = 0; - fc_host_flags(shost) = 0; - INIT_WORK(&fc_host_rport_del_work(shost), fc_shost_remove_rports, shost); return 0; } @@ -391,7 +387,6 @@ show_fc_rport_##field (struct class_device *cdev, char *buf) \ struct fc_internal *i = to_fc_internal(shost->transportt); \ if ((i->f->get_rport_##field) && \ !((rport->port_state == FC_PORTSTATE_BLOCKED) || \ - (rport->port_state == FC_PORTSTATE_DELETED) || \ (rport->port_state == FC_PORTSTATE_NOTPRESENT))) \ i->f->get_rport_##field(rport); \ return snprintf(buf, sz, format_string, cast rport->field); \ @@ -407,7 +402,6 @@ store_fc_rport_##field(struct class_device *cdev, const char *buf, \ struct Scsi_Host *shost = rport_to_shost(rport); \ struct fc_internal *i = to_fc_internal(shost->transportt); \ if ((rport->port_state == FC_PORTSTATE_BLOCKED) || \ - (rport->port_state == FC_PORTSTATE_DELETED) || \ (rport->port_state == FC_PORTSTATE_NOTPRESENT)) \ return -EBUSY; \ val = simple_strtoul(buf, NULL, 0); \ @@ -525,7 +519,6 @@ store_fc_rport_dev_loss_tmo(struct class_device *cdev, const char *buf, struct Scsi_Host *shost = rport_to_shost(rport); struct fc_internal *i = to_fc_internal(shost->transportt); if ((rport->port_state == FC_PORTSTATE_BLOCKED) || - (rport->port_state == FC_PORTSTATE_DELETED) || (rport->port_state == FC_PORTSTATE_NOTPRESENT)) return -EBUSY; val = simple_strtoul(buf, NULL, 0); @@ -1776,7 +1769,7 @@ fc_timeout_deleted_rport(void *data) rport->maxframe_size = -1; rport->supported_classes = FC_COS_UNSPECIFIED; rport->roles = FC_RPORT_ROLE_UNKNOWN; - rport->port_state = FC_PORTSTATE_DELETED; + rport->port_state = FC_PORTSTATE_NOTPRESENT; /* remove the identifiers that aren't used in the consisting binding */ switch (fc_host_tgtid_bind_type(shost)) { @@ -1796,23 +1789,14 @@ fc_timeout_deleted_rport(void *data) break; } + spin_unlock_irqrestore(shost->host_lock, flags); + /* * As this only occurs if the remote port (scsi target) * went away and didn't come back - we'll remove * all attached scsi devices. - * - * We'll schedule the shost work item to perform the actual removal - * to avoid recursion in the different flush calls if we perform - * the removal in each target - and there are lots of targets - * whose timeouts fire at the same time. */ - - if ( !(fc_host_flags(shost) & FC_SHOST_RPORT_DEL_SCHEDULED)) { - fc_host_flags(shost) |= FC_SHOST_RPORT_DEL_SCHEDULED; - scsi_queue_work(shost, &fc_host_rport_del_work(shost)); - } - - spin_unlock_irqrestore(shost->host_lock, flags); + fc_rport_tgt_remove(rport); } /** @@ -1834,41 +1818,6 @@ fc_scsi_scan_rport(void *data) } -/** - * fc_shost_remove_rports - called to remove all rports that are marked - * as in a deleted (not connected) state. - * - * @data: shost whose rports are to be looked at - **/ -static void -fc_shost_remove_rports(void *data) -{ - struct Scsi_Host *shost = (struct Scsi_Host *)data; - struct fc_rport *rport, *next_rport; - unsigned long flags; - - spin_lock_irqsave(shost->host_lock, flags); - while (fc_host_flags(shost) & FC_SHOST_RPORT_DEL_SCHEDULED) { - - fc_host_flags(shost) &= ~FC_SHOST_RPORT_DEL_SCHEDULED; - -restart_search: - list_for_each_entry_safe(rport, next_rport, - &fc_host_rport_bindings(shost), peers) { - if (rport->port_state == FC_PORTSTATE_DELETED) { - rport->port_state = FC_PORTSTATE_NOTPRESENT; - spin_unlock_irqrestore(shost->host_lock, flags); - fc_rport_tgt_remove(rport); - spin_lock_irqsave(shost->host_lock, flags); - goto restart_search; - } - } - - } - spin_unlock_irqrestore(shost->host_lock, flags); -} - - MODULE_AUTHOR("Martin Hicks"); MODULE_DESCRIPTION("FC Transport Attributes"); MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/scsi/scsi_transport_iscsi.c b/trunk/drivers/scsi/scsi_transport_iscsi.c index e08462d50c97..49fd18c1a9c6 100644 --- a/trunk/drivers/scsi/scsi_transport_iscsi.c +++ b/trunk/drivers/scsi/scsi_transport_iscsi.c @@ -249,7 +249,7 @@ static inline struct list_head *skb_to_lh(struct sk_buff *skb) } static void* -mempool_zone_alloc_skb(gfp_t gfp_mask, void *pool_data) +mempool_zone_alloc_skb(unsigned int gfp_mask, void *pool_data) { struct mempool_zone *zone = pool_data; diff --git a/trunk/drivers/scsi/scsi_transport_spi.c b/trunk/drivers/scsi/scsi_transport_spi.c index 46da6fe10ad5..718a2bc4ed5e 100644 --- a/trunk/drivers/scsi/scsi_transport_spi.c +++ b/trunk/drivers/scsi/scsi_transport_spi.c @@ -18,7 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include @@ -379,7 +378,9 @@ static CLASS_DEVICE_ATTR(revalidate, S_IWUSR, NULL, store_spi_revalidate); /* Translate the period into ns according to the current spec * for SDTR/PPR messages */ -static int period_to_str(char *buf, int period) +static ssize_t +show_spi_transport_period_helper(struct class_device *cdev, char *buf, + int period) { int len, picosec; @@ -397,14 +398,6 @@ static int period_to_str(char *buf, int period) len = sprint_frac(buf, picosec, 1000); } - return len; -} - -static ssize_t -show_spi_transport_period_helper(struct class_device *cdev, char *buf, - int period) -{ - int len = period_to_str(buf, period); buf[len++] = '\n'; buf[len] = '\0'; return len; @@ -819,10 +812,12 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer) if (!scsi_device_sync(sdev) && !scsi_device_dt(sdev)) return; - /* len == -1 is the signal that we need to ascertain the - * presence of an echo buffer before trying to use it. len == - * 0 means we don't have an echo buffer */ - len = -1; + /* see if the device has an echo buffer. If it does we can + * do the SPI pattern write tests */ + + len = 0; + if (scsi_device_dt(sdev)) + len = spi_dv_device_get_echo_buffer(sdev, buffer); retry: @@ -845,23 +840,11 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer) if (spi_min_period(starget) == 8) DV_SET(pcomp_en, 1); } - /* Do the read only INQUIRY tests */ - spi_dv_retrain(sdev, buffer, buffer + sdev->inquiry_len, - spi_dv_device_compare_inquiry); - /* See if we actually managed to negotiate and sustain DT */ - if (i->f->get_dt) - i->f->get_dt(starget); - - /* see if the device has an echo buffer. If it does we can do - * the SPI pattern write tests. Because of some broken - * devices, we *only* try this on a device that has actually - * negotiated DT */ - - if (len == -1 && spi_dt(starget)) - len = spi_dv_device_get_echo_buffer(sdev, buffer); - if (len <= 0) { + if (len == 0) { starget_printk(KERN_INFO, starget, "Domain Validation skipping write tests\n"); + spi_dv_retrain(sdev, buffer, buffer + len, + spi_dv_device_compare_inquiry); return; } @@ -1048,133 +1031,12 @@ void spi_display_xfer_agreement(struct scsi_target *starget) tp->hold_mcs ? " HMCS" : "", tmp, tp->offset); } else { - dev_info(&starget->dev, "%sasynchronous\n", + dev_info(&starget->dev, "%sasynchronous.\n", tp->width ? "wide " : ""); } } EXPORT_SYMBOL(spi_display_xfer_agreement); -#ifdef CONFIG_SCSI_CONSTANTS -static const char * const one_byte_msgs[] = { -/* 0x00 */ "Command Complete", NULL, "Save Pointers", -/* 0x03 */ "Restore Pointers", "Disconnect", "Initiator Error", -/* 0x06 */ "Abort", "Message Reject", "Nop", "Message Parity Error", -/* 0x0a */ "Linked Command Complete", "Linked Command Complete w/flag", -/* 0x0c */ "Bus device reset", "Abort Tag", "Clear Queue", -/* 0x0f */ "Initiate Recovery", "Release Recovery" -}; - -static const char * const two_byte_msgs[] = { -/* 0x20 */ "Simple Queue Tag", "Head of Queue Tag", "Ordered Queue Tag", -/* 0x23 */ "Ignore Wide Residue" -}; - -static const char * const extended_msgs[] = { -/* 0x00 */ "Modify Data Pointer", "Synchronous Data Transfer Request", -/* 0x02 */ "SCSI-I Extended Identify", "Wide Data Transfer Request", -/* 0x04 */ "Parallel Protocol Request" -}; - -void print_nego(const unsigned char *msg, int per, int off, int width) -{ - if (per) { - char buf[20]; - period_to_str(buf, msg[per]); - printk("period = %s ns ", buf); - } - - if (off) - printk("offset = %d ", msg[off]); - if (width) - printk("width = %d ", 8 << msg[width]); -} - -int spi_print_msg(const unsigned char *msg) -{ - int len = 0, i; - if (msg[0] == EXTENDED_MESSAGE) { - len = 3 + msg[1]; - if (msg[2] < ARRAY_SIZE(extended_msgs)) - printk ("%s ", extended_msgs[msg[2]]); - else - printk ("Extended Message, reserved code (0x%02x) ", - (int) msg[2]); - switch (msg[2]) { - case EXTENDED_MODIFY_DATA_POINTER: - printk("pointer = %d", (int) (msg[3] << 24) | - (msg[4] << 16) | (msg[5] << 8) | msg[6]); - break; - case EXTENDED_SDTR: - print_nego(msg, 3, 4, 0); - break; - case EXTENDED_WDTR: - print_nego(msg, 0, 0, 3); - break; - case EXTENDED_PPR: - print_nego(msg, 3, 5, 6); - break; - default: - for (i = 2; i < len; ++i) - printk("%02x ", msg[i]); - } - /* Identify */ - } else if (msg[0] & 0x80) { - printk("Identify disconnect %sallowed %s %d ", - (msg[0] & 0x40) ? "" : "not ", - (msg[0] & 0x20) ? "target routine" : "lun", - msg[0] & 0x7); - len = 1; - /* Normal One byte */ - } else if (msg[0] < 0x1f) { - if (msg[0] < ARRAY_SIZE(one_byte_msgs)) - printk(one_byte_msgs[msg[0]]); - else - printk("reserved (%02x) ", msg[0]); - len = 1; - /* Two byte */ - } else if (msg[0] <= 0x2f) { - if ((msg[0] - 0x20) < ARRAY_SIZE(two_byte_msgs)) - printk("%s %02x ", two_byte_msgs[msg[0] - 0x20], - msg[1]); - else - printk("reserved two byte (%02x %02x) ", - msg[0], msg[1]); - len = 2; - } else - printk("reserved"); - return len; -} -EXPORT_SYMBOL(spi_print_msg); - -#else /* ifndef CONFIG_SCSI_CONSTANTS */ - -int spi_print_msg(const unsigned char *msg) -{ - int len = 0, i; - - if (msg[0] == EXTENDED_MESSAGE) { - len = 3 + msg[1]; - for (i = 0; i < len; ++i) - printk("%02x ", msg[i]); - /* Identify */ - } else if (msg[0] & 0x80) { - printk("%02x ", msg[0]); - len = 1; - /* Normal One byte */ - } else if (msg[0] < 0x1f) { - printk("%02x ", msg[0]); - len = 1; - /* Two byte */ - } else if (msg[0] <= 0x2f) { - printk("%02x %02x", msg[0], msg[1]); - len = 2; - } else - printk("%02x ", msg[0]); - return len; -} -EXPORT_SYMBOL(spi_print_msg); -#endif /* ! CONFIG_SCSI_CONSTANTS */ - #define SETUP_ATTRIBUTE(field) \ i->private_attrs[count] = class_device_attr_##field; \ if (!i->f->set_##field) { \ diff --git a/trunk/drivers/scsi/sd.c b/trunk/drivers/scsi/sd.c index 3d3ad7d1b779..8613a1317712 100644 --- a/trunk/drivers/scsi/sd.c +++ b/trunk/drivers/scsi/sd.c @@ -245,10 +245,24 @@ static int sd_init_command(struct scsi_cmnd * SCpnt) * SG_IO from block layer already setup, just copy cdb basically */ if (blk_pc_request(rq)) { - scsi_setup_blk_pc_cmnd(SCpnt); + if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd)) + return 0; + + memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd)); + SCpnt->cmd_len = rq->cmd_len; + if (rq_data_dir(rq) == WRITE) + SCpnt->sc_data_direction = DMA_TO_DEVICE; + else if (rq->data_len) + SCpnt->sc_data_direction = DMA_FROM_DEVICE; + else + SCpnt->sc_data_direction = DMA_NONE; + + this_count = rq->data_len; if (rq->timeout) timeout = rq->timeout; + SCpnt->transfersize = rq->data_len; + SCpnt->allowed = SD_PASSTHROUGH_RETRIES; goto queue; } @@ -1495,7 +1509,9 @@ static int sd_revalidate_disk(struct gendisk *disk) */ if (sdkp->media_present) { sd_read_capacity(sdkp, disk->disk_name, buffer); - sd_read_write_protect_flag(sdkp, disk->disk_name, buffer); + if (sdp->removable) + sd_read_write_protect_flag(sdkp, disk->disk_name, + buffer); sd_read_cache_type(sdkp, disk->disk_name, buffer); } diff --git a/trunk/drivers/scsi/sg.c b/trunk/drivers/scsi/sg.c index 221e96e2620a..72ec59456e69 100644 --- a/trunk/drivers/scsi/sg.c +++ b/trunk/drivers/scsi/sg.c @@ -104,6 +104,8 @@ static int sg_allow_dio = SG_ALLOW_DIO_DEF; static int sg_add(struct class_device *, struct class_interface *); static void sg_remove(struct class_device *, struct class_interface *); +static Scsi_Request *dummy_cmdp; /* only used for sizeof */ + static DEFINE_RWLOCK(sg_dev_arr_lock); /* Also used to lock file descriptor list for device */ @@ -117,7 +119,7 @@ typedef struct sg_scatter_hold { /* holding area for scsi scatter gather info */ unsigned short sglist_len; /* size of malloc'd scatter-gather list ++ */ unsigned bufflen; /* Size of (aggregate) data buffer */ unsigned b_malloc_len; /* actual len malloc'ed in buffer */ - struct scatterlist *buffer;/* scatter list */ + void *buffer; /* Data buffer or scatter list (k_use_sg>0) */ char dio_in_use; /* 0->indirect IO (or mmap), 1->dio */ unsigned char cmd_opcode; /* first byte of command */ } Sg_scatter_hold; @@ -126,11 +128,12 @@ struct sg_device; /* forward declarations */ struct sg_fd; typedef struct sg_request { /* SG_MAX_QUEUE requests outstanding per file */ + Scsi_Request *my_cmdp; /* != 0 when request with lower levels */ struct sg_request *nextrp; /* NULL -> tail request (slist) */ struct sg_fd *parentfp; /* NULL -> not in use */ Sg_scatter_hold data; /* hold buffer, perhaps scatter list */ sg_io_hdr_t header; /* scsi command+info, see */ - unsigned char sense_b[SCSI_SENSE_BUFFERSIZE]; + unsigned char sense_b[sizeof (dummy_cmdp->sr_sense_buffer)]; char res_used; /* 1 -> using reserve buffer, 0 -> not ... */ char orphan; /* 1 -> drop on sight, 0 -> normal */ char sg_io_owned; /* 1 -> packet belongs to SG_IO */ @@ -171,8 +174,7 @@ typedef struct sg_device { /* holds the state of each scsi generic device */ } Sg_device; static int sg_fasync(int fd, struct file *filp, int mode); -/* tasklet or soft irq callback */ -static void sg_cmd_done(void *data, char *sense, int result, int resid); +static void sg_cmd_done(Scsi_Cmnd * SCpnt); /* tasklet or soft irq callback */ static int sg_start_req(Sg_request * srp); static void sg_finish_rem_req(Sg_request * srp); static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size); @@ -193,8 +195,8 @@ static void sg_remove_scat(Sg_scatter_hold * schp); static void sg_build_reserve(Sg_fd * sfp, int req_size); static void sg_link_reserve(Sg_fd * sfp, Sg_request * srp, int size); static void sg_unlink_reserve(Sg_fd * sfp, Sg_request * srp); -static struct page *sg_page_malloc(int rqSz, int lowDma, int *retSzp); -static void sg_page_free(struct page *page, int size); +static char *sg_page_malloc(int rqSz, int lowDma, int *retSzp); +static void sg_page_free(char *buff, int size); static Sg_fd *sg_add_sfp(Sg_device * sdp, int dev); static int sg_remove_sfp(Sg_device * sdp, Sg_fd * sfp); static void __sg_remove_sfp(Sg_device * sdp, Sg_fd * sfp); @@ -205,6 +207,7 @@ static int sg_res_in_use(Sg_fd * sfp); static int sg_allow_access(unsigned char opcode, char dev_type); static int sg_build_direct(Sg_request * srp, Sg_fd * sfp, int dxfer_len); static Sg_device *sg_get_dev(int dev); +static inline unsigned char *sg_scatg2virt(const struct scatterlist *sclp); #ifdef CONFIG_SCSI_PROC_FS static int sg_last_dev(void); #endif @@ -223,7 +226,6 @@ sg_open(struct inode *inode, struct file *filp) { int dev = iminor(inode); int flags = filp->f_flags; - struct request_queue *q; Sg_device *sdp; Sg_fd *sfp; int res; @@ -285,9 +287,7 @@ sg_open(struct inode *inode, struct file *filp) } if (!sdp->headfp) { /* no existing opens on this device */ sdp->sgdebug = 0; - q = sdp->device->request_queue; - sdp->sg_tablesize = min(q->max_hw_segments, - q->max_phys_segments); + sdp->sg_tablesize = sdp->device->host->sg_tablesize; } if ((sfp = sg_add_sfp(sdp, dev))) filp->private_data = sfp; @@ -340,7 +340,6 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) return -ENXIO; SCSI_LOG_TIMEOUT(3, printk("sg_read: %s, count=%d\n", sdp->disk->disk_name, (int) count)); - if (!access_ok(VERIFY_WRITE, buf, count)) return -EFAULT; if (sfp->force_packid && (count >= SZ_SG_HEADER)) { @@ -492,7 +491,7 @@ sg_new_read(Sg_fd * sfp, char __user *buf, size_t count, Sg_request * srp) if ((hp->mx_sb_len > 0) && hp->sbp) { if ((CHECK_CONDITION & hp->masked_status) || (DRIVER_SENSE & hp->driver_status)) { - int sb_len = SCSI_SENSE_BUFFERSIZE; + int sb_len = sizeof (dummy_cmdp->sr_sense_buffer); sb_len = (hp->mx_sb_len > sb_len) ? sb_len : hp->mx_sb_len; len = 8 + (int) srp->sense_b[7]; /* Additional sense length field */ len = (len > sb_len) ? sb_len : len; @@ -526,7 +525,7 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) Sg_request *srp; struct sg_header old_hdr; sg_io_hdr_t *hp; - unsigned char cmnd[MAX_COMMAND_SIZE]; + unsigned char cmnd[sizeof (dummy_cmdp->sr_cmnd)]; if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) return -ENXIO; @@ -625,7 +624,7 @@ sg_new_write(Sg_fd * sfp, const char __user *buf, size_t count, int k; Sg_request *srp; sg_io_hdr_t *hp; - unsigned char cmnd[MAX_COMMAND_SIZE]; + unsigned char cmnd[sizeof (dummy_cmdp->sr_cmnd)]; int timeout; unsigned long ul_timeout; @@ -693,9 +692,11 @@ static int sg_common_write(Sg_fd * sfp, Sg_request * srp, unsigned char *cmnd, int timeout, int blocking) { - int k, data_dir; + int k; + Scsi_Request *SRpnt; Sg_device *sdp = sfp->parentdp; sg_io_hdr_t *hp = &srp->header; + request_queue_t *q; srp->data.cmd_opcode = cmnd[0]; /* hold opcode of command */ hp->status = 0; @@ -722,36 +723,51 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp, sg_finish_rem_req(srp); return -ENODEV; } + SRpnt = scsi_allocate_request(sdp->device, GFP_ATOMIC); + if (SRpnt == NULL) { + SCSI_LOG_TIMEOUT(1, printk("sg_write: no mem\n")); + sg_finish_rem_req(srp); + return -ENOMEM; + } + srp->my_cmdp = SRpnt; + q = SRpnt->sr_device->request_queue; + SRpnt->sr_request->rq_disk = sdp->disk; + SRpnt->sr_sense_buffer[0] = 0; + SRpnt->sr_cmd_len = hp->cmd_len; + SRpnt->sr_use_sg = srp->data.k_use_sg; + SRpnt->sr_sglist_len = srp->data.sglist_len; + SRpnt->sr_bufflen = srp->data.bufflen; + SRpnt->sr_underflow = 0; + SRpnt->sr_buffer = srp->data.buffer; switch (hp->dxfer_direction) { case SG_DXFER_TO_FROM_DEV: case SG_DXFER_FROM_DEV: - data_dir = DMA_FROM_DEVICE; + SRpnt->sr_data_direction = DMA_FROM_DEVICE; break; case SG_DXFER_TO_DEV: - data_dir = DMA_TO_DEVICE; + SRpnt->sr_data_direction = DMA_TO_DEVICE; break; case SG_DXFER_UNKNOWN: - data_dir = DMA_BIDIRECTIONAL; + SRpnt->sr_data_direction = DMA_BIDIRECTIONAL; break; default: - data_dir = DMA_NONE; + SRpnt->sr_data_direction = DMA_NONE; break; } + SRpnt->upper_private_data = srp; + srp->data.k_use_sg = 0; + srp->data.sglist_len = 0; + srp->data.bufflen = 0; + srp->data.buffer = NULL; hp->duration = jiffies_to_msecs(jiffies); /* Now send everything of to mid-level. The next time we hear about this packet is when sg_cmd_done() is called (i.e. a callback). */ - if (scsi_execute_async(sdp->device, cmnd, data_dir, srp->data.buffer, - hp->dxfer_len, srp->data.k_use_sg, timeout, - SG_DEFAULT_RETRIES, srp, sg_cmd_done, - GFP_ATOMIC)) { - SCSI_LOG_TIMEOUT(1, printk("sg_write: scsi_execute_async failed\n")); - /* - * most likely out of mem, but could also be a bad map - */ - return -ENOMEM; - } else - return 0; + scsi_do_req(SRpnt, (void *) cmnd, + (void *) SRpnt->sr_buffer, hp->dxfer_len, + sg_cmd_done, timeout, SG_DEFAULT_RETRIES); + /* dxfer_len overwrites SRpnt->sr_bufflen, hence need for b_malloc_len */ + return 0; } static int @@ -1140,22 +1156,45 @@ sg_fasync(int fd, struct file *filp, int mode) return (retval < 0) ? retval : 0; } +static inline unsigned char * +sg_scatg2virt(const struct scatterlist *sclp) +{ + return (sclp && sclp->page) ? + (unsigned char *) page_address(sclp->page) + sclp->offset : NULL; +} + /* When startFinish==1 increments page counts for pages other than the - first of scatter gather elements obtained from alloc_pages(). + first of scatter gather elements obtained from __get_free_pages(). When startFinish==0 decrements ... */ static void sg_rb_correct4mmap(Sg_scatter_hold * rsv_schp, int startFinish) { - struct scatterlist *sg = rsv_schp->buffer; + void *page_ptr; struct page *page; int k, m; SCSI_LOG_TIMEOUT(3, printk("sg_rb_correct4mmap: startFinish=%d, scatg=%d\n", startFinish, rsv_schp->k_use_sg)); /* N.B. correction _not_ applied to base page of each allocation */ - for (k = 0; k < rsv_schp->k_use_sg; ++k, ++sg) { - for (m = PAGE_SIZE; m < sg->length; m += PAGE_SIZE) { - page = sg->page; + if (rsv_schp->k_use_sg) { /* reserve buffer is a scatter gather list */ + struct scatterlist *sclp = rsv_schp->buffer; + + for (k = 0; k < rsv_schp->k_use_sg; ++k, ++sclp) { + for (m = PAGE_SIZE; m < sclp->length; m += PAGE_SIZE) { + page_ptr = sg_scatg2virt(sclp) + m; + page = virt_to_page(page_ptr); + if (startFinish) + get_page(page); + else { + if (page_count(page) > 0) + __put_page(page); + } + } + } + } else { /* reserve buffer is just a single allocation */ + for (m = PAGE_SIZE; m < rsv_schp->bufflen; m += PAGE_SIZE) { + page_ptr = (unsigned char *) rsv_schp->buffer + m; + page = virt_to_page(page_ptr); if (startFinish) get_page(page); else { @@ -1171,10 +1210,9 @@ sg_vma_nopage(struct vm_area_struct *vma, unsigned long addr, int *type) { Sg_fd *sfp; struct page *page = NOPAGE_SIGBUS; - unsigned long offset, len, sa; + void *page_ptr = NULL; + unsigned long offset; Sg_scatter_hold *rsv_schp; - struct scatterlist *sg; - int k; if ((NULL == vma) || (!(sfp = (Sg_fd *) vma->vm_private_data))) return page; @@ -1184,21 +1222,30 @@ sg_vma_nopage(struct vm_area_struct *vma, unsigned long addr, int *type) return page; SCSI_LOG_TIMEOUT(3, printk("sg_vma_nopage: offset=%lu, scatg=%d\n", offset, rsv_schp->k_use_sg)); - sg = rsv_schp->buffer; - sa = vma->vm_start; - for (k = 0; (k < rsv_schp->k_use_sg) && (sa < vma->vm_end); - ++k, ++sg) { - len = vma->vm_end - sa; - len = (len < sg->length) ? len : sg->length; - if (offset < len) { - page = sg->page; - get_page(page); /* increment page count */ - break; + if (rsv_schp->k_use_sg) { /* reserve buffer is a scatter gather list */ + int k; + unsigned long sa = vma->vm_start; + unsigned long len; + struct scatterlist *sclp = rsv_schp->buffer; + + for (k = 0; (k < rsv_schp->k_use_sg) && (sa < vma->vm_end); + ++k, ++sclp) { + len = vma->vm_end - sa; + len = (len < sclp->length) ? len : sclp->length; + if (offset < len) { + page_ptr = sg_scatg2virt(sclp) + offset; + page = virt_to_page(page_ptr); + get_page(page); /* increment page count */ + break; + } + sa += len; + offset -= len; } - sa += len; - offset -= len; + } else { /* reserve buffer is just a single allocation */ + page_ptr = (unsigned char *) rsv_schp->buffer + offset; + page = virt_to_page(page_ptr); + get_page(page); /* increment page count */ } - if (type) *type = VM_FAULT_MINOR; return page; @@ -1212,10 +1259,8 @@ static int sg_mmap(struct file *filp, struct vm_area_struct *vma) { Sg_fd *sfp; - unsigned long req_sz, len, sa; + unsigned long req_sz; Sg_scatter_hold *rsv_schp; - int k; - struct scatterlist *sg; if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data))) return -ENXIO; @@ -1228,15 +1273,24 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) if (req_sz > rsv_schp->bufflen) return -ENOMEM; /* cannot map more than reserved buffer */ - sa = vma->vm_start; - sg = rsv_schp->buffer; - for (k = 0; (k < rsv_schp->k_use_sg) && (sa < vma->vm_end); - ++k, ++sg) { - len = vma->vm_end - sa; - len = (len < sg->length) ? len : sg->length; - sa += len; + if (rsv_schp->k_use_sg) { /* reserve buffer is a scatter gather list */ + int k; + unsigned long sa = vma->vm_start; + unsigned long len; + struct scatterlist *sclp = rsv_schp->buffer; + + for (k = 0; (k < rsv_schp->k_use_sg) && (sa < vma->vm_end); + ++k, ++sclp) { + if (0 != sclp->offset) + return -EFAULT; /* non page aligned memory ?? */ + len = vma->vm_end - sa; + len = (len < sclp->length) ? len : sclp->length; + sa += len; + } + } else { /* reserve buffer is just a single allocation */ + if ((unsigned long) rsv_schp->buffer & (PAGE_SIZE - 1)) + return -EFAULT; /* non page aligned memory ?? */ } - if (0 == sfp->mmap_called) { sg_rb_correct4mmap(rsv_schp, 1); /* do only once per fd lifetime */ sfp->mmap_called = 1; @@ -1250,16 +1304,21 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) /* This function is a "bottom half" handler that is called by the * mid level when a command is completed (or has failed). */ static void -sg_cmd_done(void *data, char *sense, int result, int resid) +sg_cmd_done(Scsi_Cmnd * SCpnt) { - Sg_request *srp = data; + Scsi_Request *SRpnt = NULL; Sg_device *sdp = NULL; Sg_fd *sfp; + Sg_request *srp = NULL; unsigned long iflags; unsigned int ms; + if (SCpnt && (SRpnt = SCpnt->sc_request)) + srp = (Sg_request *) SRpnt->upper_private_data; if (NULL == srp) { printk(KERN_ERR "sg_cmd_done: NULL request\n"); + if (SRpnt) + scsi_release_request(SRpnt); return; } sfp = srp->parentfp; @@ -1267,34 +1326,49 @@ sg_cmd_done(void *data, char *sense, int result, int resid) sdp = sfp->parentdp; if ((NULL == sdp) || sdp->detached) { printk(KERN_INFO "sg_cmd_done: device detached\n"); + scsi_release_request(SRpnt); return; } + /* First transfer ownership of data buffers to sg_device object. */ + srp->data.k_use_sg = SRpnt->sr_use_sg; + srp->data.sglist_len = SRpnt->sr_sglist_len; + srp->data.bufflen = SRpnt->sr_bufflen; + srp->data.buffer = SRpnt->sr_buffer; + /* now clear out request structure */ + SRpnt->sr_use_sg = 0; + SRpnt->sr_sglist_len = 0; + SRpnt->sr_bufflen = 0; + SRpnt->sr_buffer = NULL; + SRpnt->sr_underflow = 0; + SRpnt->sr_request->rq_disk = NULL; /* "sg" _disowns_ request blk */ + + srp->my_cmdp = NULL; SCSI_LOG_TIMEOUT(4, printk("sg_cmd_done: %s, pack_id=%d, res=0x%x\n", - sdp->disk->disk_name, srp->header.pack_id, result)); - srp->header.resid = resid; + sdp->disk->disk_name, srp->header.pack_id, (int) SRpnt->sr_result)); + srp->header.resid = SCpnt->resid; ms = jiffies_to_msecs(jiffies); srp->header.duration = (ms > srp->header.duration) ? (ms - srp->header.duration) : 0; - if (0 != result) { + if (0 != SRpnt->sr_result) { struct scsi_sense_hdr sshdr; - memcpy(srp->sense_b, sense, sizeof (srp->sense_b)); - srp->header.status = 0xff & result; - srp->header.masked_status = status_byte(result); - srp->header.msg_status = msg_byte(result); - srp->header.host_status = host_byte(result); - srp->header.driver_status = driver_byte(result); + memcpy(srp->sense_b, SRpnt->sr_sense_buffer, + sizeof (srp->sense_b)); + srp->header.status = 0xff & SRpnt->sr_result; + srp->header.masked_status = status_byte(SRpnt->sr_result); + srp->header.msg_status = msg_byte(SRpnt->sr_result); + srp->header.host_status = host_byte(SRpnt->sr_result); + srp->header.driver_status = driver_byte(SRpnt->sr_result); if ((sdp->sgdebug > 0) && ((CHECK_CONDITION == srp->header.masked_status) || (COMMAND_TERMINATED == srp->header.masked_status))) - __scsi_print_sense("sg_cmd_done", sense, - SCSI_SENSE_BUFFERSIZE); + scsi_print_req_sense("sg_cmd_done", SRpnt); /* Following if statement is a patch supplied by Eric Youngdale */ - if (driver_byte(result) != 0 - && scsi_normalize_sense(sense, SCSI_SENSE_BUFFERSIZE, &sshdr) + if (driver_byte(SRpnt->sr_result) != 0 + && scsi_command_normalize_sense(SCpnt, &sshdr) && !scsi_sense_is_deferred(&sshdr) && sshdr.sense_key == UNIT_ATTENTION && sdp->device->removable) { @@ -1305,6 +1379,8 @@ sg_cmd_done(void *data, char *sense, int result, int resid) } /* Rely on write phase to clean out srp status values, so no "else" */ + scsi_release_request(SRpnt); + SRpnt = NULL; if (sfp->closed) { /* whoops this fd already released, cleanup */ SCSI_LOG_TIMEOUT(1, printk("sg_cmd_done: already closed, freeing ...\n")); sg_finish_rem_req(srp); @@ -1355,7 +1431,6 @@ static int sg_sysfs_valid = 0; static int sg_alloc(struct gendisk *disk, struct scsi_device *scsidp) { - struct request_queue *q = scsidp->request_queue; Sg_device *sdp; unsigned long iflags; void *old_sg_dev_arr = NULL; @@ -1398,7 +1473,7 @@ static int sg_alloc(struct gendisk *disk, struct scsi_device *scsidp) sdp->disk = disk; sdp->device = scsidp; init_waitqueue_head(&sdp->o_excl_wait); - sdp->sg_tablesize = min(q->max_hw_segments, q->max_phys_segments); + sdp->sg_tablesize = scsidp->host ? scsidp->host->sg_tablesize : 0; sg_nr_dev++; sg_dev_arr[k] = sdp; @@ -1678,35 +1753,36 @@ sg_finish_rem_req(Sg_request * srp) static int sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp, int tablesize) { - int sg_bufflen = tablesize * sizeof(struct scatterlist); - unsigned int gfp_flags = GFP_ATOMIC | __GFP_NOWARN; + int ret_sz; + int elem_sz = sizeof (struct scatterlist); + int sg_bufflen = tablesize * elem_sz; + int mx_sc_elems = tablesize; - /* - * TODO: test without low_dma, we should not need it since - * the block layer will bounce the buffer for us - * - * XXX(hch): we shouldn't need GFP_DMA for the actual S/G list. - */ - if (sfp->low_dma) - gfp_flags |= GFP_DMA; - schp->buffer = kzalloc(sg_bufflen, gfp_flags); + schp->buffer = sg_page_malloc(sg_bufflen, sfp->low_dma, &ret_sz); if (!schp->buffer) return -ENOMEM; + else if (ret_sz != sg_bufflen) { + sg_bufflen = ret_sz; + mx_sc_elems = sg_bufflen / elem_sz; + } schp->sglist_len = sg_bufflen; - return tablesize; /* number of scat_gath elements allocated */ + memset(schp->buffer, 0, sg_bufflen); + return mx_sc_elems; /* number of scat_gath elements allocated */ } #ifdef SG_ALLOW_DIO_CODE /* vvvvvvvv following code borrowed from st driver's direct IO vvvvvvvvv */ - /* TODO: hopefully we can use the generic block layer code */ + /* hopefully this generic code will moved to a library */ /* Pin down user pages and put them into a scatter gather list. Returns <= 0 if - mapping of all pages not successful + - any page is above max_pfn (i.e., either completely successful or fails) */ static int st_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages, - unsigned long uaddr, size_t count, int rw) + unsigned long uaddr, size_t count, int rw, + unsigned long max_pfn) { unsigned long end = (uaddr + count + PAGE_SIZE - 1) >> PAGE_SHIFT; unsigned long start = uaddr >> PAGE_SHIFT; @@ -1752,17 +1828,21 @@ st_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages, * probably wrong function for rw==WRITE */ flush_dcache_page(pages[i]); + if (page_to_pfn(pages[i]) > max_pfn) + goto out_unlock; /* ?? Is locking needed? I don't think so */ /* if (TestSetPageLocked(pages[i])) goto out_unlock; */ } - sgl[0].page = pages[0]; + /* Populate the scatter/gather list */ + sgl[0].page = pages[0]; sgl[0].offset = uaddr & ~PAGE_MASK; if (nr_pages > 1) { sgl[0].length = PAGE_SIZE - sgl[0].offset; count -= sgl[0].length; for (i=1; i < nr_pages ; i++) { + sgl[i].offset = 0; sgl[i].page = pages[i]; sgl[i].length = count < PAGE_SIZE ? count : PAGE_SIZE; count -= PAGE_SIZE; @@ -1775,12 +1855,14 @@ st_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages, kfree(pages); return nr_pages; + out_unlock: + /* for (j=0; j < i; j++) + unlock_page(pages[j]); */ + res = 0; out_unmap: - if (res > 0) { + if (res > 0) for (j=0; j < res; j++) page_cache_release(pages[j]); - res = 0; - } kfree(pages); return res; } @@ -1796,6 +1878,8 @@ st_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_pages, for (i=0; i < nr_pages; i++) { struct page *page = sgl[i].page; + /* XXX: just for debug. Remove when PageReserved is removed */ + BUG_ON(PageReserved(page)); if (dirtied) SetPageDirty(page); /* unlock_page(page); */ @@ -1820,20 +1904,20 @@ sg_build_direct(Sg_request * srp, Sg_fd * sfp, int dxfer_len) sg_io_hdr_t *hp = &srp->header; Sg_scatter_hold *schp = &srp->data; int sg_tablesize = sfp->parentdp->sg_tablesize; + struct scatterlist *sgl; int mx_sc_elems, res; struct scsi_device *sdev = sfp->parentdp->device; if (((unsigned long)hp->dxferp & queue_dma_alignment(sdev->request_queue)) != 0) return 1; - mx_sc_elems = sg_build_sgat(schp, sfp, sg_tablesize); if (mx_sc_elems <= 0) { return 1; } - res = st_map_user_pages(schp->buffer, mx_sc_elems, - (unsigned long)hp->dxferp, dxfer_len, - (SG_DXFER_TO_DEV == hp->dxfer_direction) ? 1 : 0); + sgl = (struct scatterlist *)schp->buffer; + res = st_map_user_pages(sgl, mx_sc_elems, (unsigned long)hp->dxferp, dxfer_len, + (SG_DXFER_TO_DEV == hp->dxfer_direction) ? 1 : 0, ULONG_MAX); if (res <= 0) return 1; schp->k_use_sg = res; @@ -1848,11 +1932,9 @@ sg_build_direct(Sg_request * srp, Sg_fd * sfp, int dxfer_len) static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size) { - struct scatterlist *sg; - int ret_sz = 0, k, rem_sz, num, mx_sc_elems; - int sg_tablesize = sfp->parentdp->sg_tablesize; + int ret_sz; int blk_size = buff_size; - struct page *p = NULL; + unsigned char *p = NULL; if ((blk_size < 0) || (!sfp)) return -EFAULT; @@ -1862,35 +1944,59 @@ sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size) blk_size = (blk_size + SG_SECTOR_MSK) & (~SG_SECTOR_MSK); SCSI_LOG_TIMEOUT(4, printk("sg_build_indirect: buff_size=%d, blk_size=%d\n", buff_size, blk_size)); - - /* N.B. ret_sz carried into this block ... */ - mx_sc_elems = sg_build_sgat(schp, sfp, sg_tablesize); - if (mx_sc_elems < 0) - return mx_sc_elems; /* most likely -ENOMEM */ - - for (k = 0, sg = schp->buffer, rem_sz = blk_size; - (rem_sz > 0) && (k < mx_sc_elems); - ++k, rem_sz -= ret_sz, ++sg) { - - num = (rem_sz > SG_SCATTER_SZ) ? SG_SCATTER_SZ : rem_sz; - p = sg_page_malloc(num, sfp->low_dma, &ret_sz); + if (blk_size <= SG_SCATTER_SZ) { + p = sg_page_malloc(blk_size, sfp->low_dma, &ret_sz); if (!p) return -ENOMEM; - - sg->page = p; - sg->length = ret_sz; - - SCSI_LOG_TIMEOUT(5, printk("sg_build_build: k=%d, a=0x%p, len=%d\n", - k, p, ret_sz)); - } /* end of for loop */ - - schp->k_use_sg = k; - SCSI_LOG_TIMEOUT(5, printk("sg_build_indirect: k_use_sg=%d, rem_sz=%d\n", k, rem_sz)); - - schp->bufflen = blk_size; - if (rem_sz > 0) /* must have failed */ - return -ENOMEM; - + if (blk_size == ret_sz) { /* got it on the first attempt */ + schp->k_use_sg = 0; + schp->buffer = p; + schp->bufflen = blk_size; + schp->b_malloc_len = blk_size; + return 0; + } + } else { + p = sg_page_malloc(SG_SCATTER_SZ, sfp->low_dma, &ret_sz); + if (!p) + return -ENOMEM; + } +/* Want some local declarations, so start new block ... */ + { /* lets try and build a scatter gather list */ + struct scatterlist *sclp; + int k, rem_sz, num; + int mx_sc_elems; + int sg_tablesize = sfp->parentdp->sg_tablesize; + int first = 1; + + /* N.B. ret_sz carried into this block ... */ + mx_sc_elems = sg_build_sgat(schp, sfp, sg_tablesize); + if (mx_sc_elems < 0) + return mx_sc_elems; /* most likely -ENOMEM */ + + for (k = 0, sclp = schp->buffer, rem_sz = blk_size; + (rem_sz > 0) && (k < mx_sc_elems); + ++k, rem_sz -= ret_sz, ++sclp) { + if (first) + first = 0; + else { + num = + (rem_sz > + SG_SCATTER_SZ) ? SG_SCATTER_SZ : rem_sz; + p = sg_page_malloc(num, sfp->low_dma, &ret_sz); + if (!p) + break; + } + sg_set_buf(sclp, p, ret_sz); + + SCSI_LOG_TIMEOUT(5, printk("sg_build_build: k=%d, a=0x%p, len=%d\n", + k, sg_scatg2virt(sclp), ret_sz)); + } /* end of for loop */ + schp->k_use_sg = k; + SCSI_LOG_TIMEOUT(5, printk("sg_build_indirect: k_use_sg=%d, rem_sz=%d\n", k, rem_sz)); + schp->bufflen = blk_size; + if (rem_sz > 0) /* must have failed */ + return -ENOMEM; + } return 0; } @@ -1899,7 +2005,6 @@ sg_write_xfer(Sg_request * srp) { sg_io_hdr_t *hp = &srp->header; Sg_scatter_hold *schp = &srp->data; - struct scatterlist *sg = schp->buffer; int num_xfer = 0; int j, k, onum, usglen, ksglen, res; int iovec_count = (int) hp->iovec_count; @@ -1928,45 +2033,63 @@ sg_write_xfer(Sg_request * srp) } else onum = 1; - ksglen = sg->length; - p = page_address(sg->page); - for (j = 0, k = 0; j < onum; ++j) { - res = sg_u_iovec(hp, iovec_count, j, 1, &usglen, &up); - if (res) - return res; - - for (; p; ++sg, ksglen = sg->length, - p = page_address(sg->page)) { - if (usglen <= 0) - break; - if (ksglen > usglen) { - if (usglen >= num_xfer) { - if (__copy_from_user(p, up, num_xfer)) + if (0 == schp->k_use_sg) { /* kernel has single buffer */ + for (j = 0, p = schp->buffer; j < onum; ++j) { + res = sg_u_iovec(hp, iovec_count, j, 1, &usglen, &up); + if (res) + return res; + usglen = (num_xfer > usglen) ? usglen : num_xfer; + if (__copy_from_user(p, up, usglen)) + return -EFAULT; + p += usglen; + num_xfer -= usglen; + if (num_xfer <= 0) + return 0; + } + } else { /* kernel using scatter gather list */ + struct scatterlist *sclp = (struct scatterlist *) schp->buffer; + + ksglen = (int) sclp->length; + p = sg_scatg2virt(sclp); + for (j = 0, k = 0; j < onum; ++j) { + res = sg_u_iovec(hp, iovec_count, j, 1, &usglen, &up); + if (res) + return res; + + for (; p; ++sclp, ksglen = (int) sclp->length, + p = sg_scatg2virt(sclp)) { + if (usglen <= 0) + break; + if (ksglen > usglen) { + if (usglen >= num_xfer) { + if (__copy_from_user + (p, up, num_xfer)) + return -EFAULT; + return 0; + } + if (__copy_from_user(p, up, usglen)) return -EFAULT; - return 0; - } - if (__copy_from_user(p, up, usglen)) - return -EFAULT; - p += usglen; - ksglen -= usglen; - break; - } else { - if (ksglen >= num_xfer) { - if (__copy_from_user(p, up, num_xfer)) + p += usglen; + ksglen -= usglen; + break; + } else { + if (ksglen >= num_xfer) { + if (__copy_from_user + (p, up, num_xfer)) + return -EFAULT; + return 0; + } + if (__copy_from_user(p, up, ksglen)) return -EFAULT; - return 0; + up += ksglen; + usglen -= ksglen; } - if (__copy_from_user(p, up, ksglen)) - return -EFAULT; - up += ksglen; - usglen -= ksglen; + ++k; + if (k >= schp->k_use_sg) + return 0; } - ++k; - if (k >= schp->k_use_sg) - return 0; } } - return 0; } @@ -2004,25 +2127,29 @@ sg_remove_scat(Sg_scatter_hold * schp) { SCSI_LOG_TIMEOUT(4, printk("sg_remove_scat: k_use_sg=%d\n", schp->k_use_sg)); if (schp->buffer && (schp->sglist_len > 0)) { - struct scatterlist *sg = schp->buffer; + struct scatterlist *sclp = (struct scatterlist *) schp->buffer; if (schp->dio_in_use) { #ifdef SG_ALLOW_DIO_CODE - st_unmap_user_pages(sg, schp->k_use_sg, TRUE); + st_unmap_user_pages(sclp, schp->k_use_sg, TRUE); #endif } else { int k; - for (k = 0; (k < schp->k_use_sg) && sg->page; - ++k, ++sg) { + for (k = 0; (k < schp->k_use_sg) && sg_scatg2virt(sclp); + ++k, ++sclp) { SCSI_LOG_TIMEOUT(5, printk( "sg_remove_scat: k=%d, a=0x%p, len=%d\n", - k, sg->page, sg->length)); - sg_page_free(sg->page, sg->length); + k, sg_scatg2virt(sclp), sclp->length)); + sg_page_free(sg_scatg2virt(sclp), sclp->length); + sclp->page = NULL; + sclp->offset = 0; + sclp->length = 0; } } - kfree(schp->buffer); - } + sg_page_free(schp->buffer, schp->sglist_len); + } else if (schp->buffer) + sg_page_free(schp->buffer, schp->b_malloc_len); memset(schp, 0, sizeof (*schp)); } @@ -2031,7 +2158,6 @@ sg_read_xfer(Sg_request * srp) { sg_io_hdr_t *hp = &srp->header; Sg_scatter_hold *schp = &srp->data; - struct scatterlist *sg = schp->buffer; int num_xfer = 0; int j, k, onum, usglen, ksglen, res; int iovec_count = (int) hp->iovec_count; @@ -2060,45 +2186,63 @@ sg_read_xfer(Sg_request * srp) } else onum = 1; - p = page_address(sg->page); - ksglen = sg->length; - for (j = 0, k = 0; j < onum; ++j) { - res = sg_u_iovec(hp, iovec_count, j, 0, &usglen, &up); - if (res) - return res; - - for (; p; ++sg, ksglen = sg->length, - p = page_address(sg->page)) { - if (usglen <= 0) - break; - if (ksglen > usglen) { - if (usglen >= num_xfer) { - if (__copy_to_user(up, p, num_xfer)) + if (0 == schp->k_use_sg) { /* kernel has single buffer */ + for (j = 0, p = schp->buffer; j < onum; ++j) { + res = sg_u_iovec(hp, iovec_count, j, 0, &usglen, &up); + if (res) + return res; + usglen = (num_xfer > usglen) ? usglen : num_xfer; + if (__copy_to_user(up, p, usglen)) + return -EFAULT; + p += usglen; + num_xfer -= usglen; + if (num_xfer <= 0) + return 0; + } + } else { /* kernel using scatter gather list */ + struct scatterlist *sclp = (struct scatterlist *) schp->buffer; + + ksglen = (int) sclp->length; + p = sg_scatg2virt(sclp); + for (j = 0, k = 0; j < onum; ++j) { + res = sg_u_iovec(hp, iovec_count, j, 0, &usglen, &up); + if (res) + return res; + + for (; p; ++sclp, ksglen = (int) sclp->length, + p = sg_scatg2virt(sclp)) { + if (usglen <= 0) + break; + if (ksglen > usglen) { + if (usglen >= num_xfer) { + if (__copy_to_user + (up, p, num_xfer)) + return -EFAULT; + return 0; + } + if (__copy_to_user(up, p, usglen)) return -EFAULT; - return 0; - } - if (__copy_to_user(up, p, usglen)) - return -EFAULT; - p += usglen; - ksglen -= usglen; - break; - } else { - if (ksglen >= num_xfer) { - if (__copy_to_user(up, p, num_xfer)) + p += usglen; + ksglen -= usglen; + break; + } else { + if (ksglen >= num_xfer) { + if (__copy_to_user + (up, p, num_xfer)) + return -EFAULT; + return 0; + } + if (__copy_to_user(up, p, ksglen)) return -EFAULT; - return 0; + up += ksglen; + usglen -= ksglen; } - if (__copy_to_user(up, p, ksglen)) - return -EFAULT; - up += ksglen; - usglen -= ksglen; + ++k; + if (k >= schp->k_use_sg) + return 0; } - ++k; - if (k >= schp->k_use_sg) - return 0; } } - return 0; } @@ -2106,32 +2250,37 @@ static int sg_read_oxfer(Sg_request * srp, char __user *outp, int num_read_xfer) { Sg_scatter_hold *schp = &srp->data; - struct scatterlist *sg = schp->buffer; - int k, num; SCSI_LOG_TIMEOUT(4, printk("sg_read_oxfer: num_read_xfer=%d\n", num_read_xfer)); if ((!outp) || (num_read_xfer <= 0)) return 0; - - for (k = 0; (k < schp->k_use_sg) && sg->page; ++k, ++sg) { - num = sg->length; - if (num > num_read_xfer) { - if (__copy_to_user(outp, page_address(sg->page), - num_read_xfer)) - return -EFAULT; - break; - } else { - if (__copy_to_user(outp, page_address(sg->page), - num)) - return -EFAULT; - num_read_xfer -= num; - if (num_read_xfer <= 0) + if (schp->k_use_sg > 0) { + int k, num; + struct scatterlist *sclp = (struct scatterlist *) schp->buffer; + + for (k = 0; (k < schp->k_use_sg) && sg_scatg2virt(sclp); + ++k, ++sclp) { + num = (int) sclp->length; + if (num > num_read_xfer) { + if (__copy_to_user + (outp, sg_scatg2virt(sclp), num_read_xfer)) + return -EFAULT; break; - outp += num; + } else { + if (__copy_to_user + (outp, sg_scatg2virt(sclp), num)) + return -EFAULT; + num_read_xfer -= num; + if (num_read_xfer <= 0) + break; + outp += num; + } } + } else { + if (__copy_to_user(outp, schp->buffer, num_read_xfer)) + return -EFAULT; } - return 0; } @@ -2157,31 +2306,44 @@ sg_link_reserve(Sg_fd * sfp, Sg_request * srp, int size) { Sg_scatter_hold *req_schp = &srp->data; Sg_scatter_hold *rsv_schp = &sfp->reserve; - struct scatterlist *sg = rsv_schp->buffer; - int k, num, rem; srp->res_used = 1; SCSI_LOG_TIMEOUT(4, printk("sg_link_reserve: size=%d\n", size)); - rem = size = (size + 1) & (~1); /* round to even for aha1542 */ - - for (k = 0; k < rsv_schp->k_use_sg; ++k, ++sg) { - num = sg->length; - if (rem <= num) { - sfp->save_scat_len = num; - sg->length = rem; - req_schp->k_use_sg = k + 1; - req_schp->sglist_len = rsv_schp->sglist_len; - req_schp->buffer = rsv_schp->buffer; - - req_schp->bufflen = size; - req_schp->b_malloc_len = rsv_schp->b_malloc_len; - break; - } else - rem -= num; + size = (size + 1) & (~1); /* round to even for aha1542 */ + if (rsv_schp->k_use_sg > 0) { + int k, num; + int rem = size; + struct scatterlist *sclp = + (struct scatterlist *) rsv_schp->buffer; + + for (k = 0; k < rsv_schp->k_use_sg; ++k, ++sclp) { + num = (int) sclp->length; + if (rem <= num) { + if (0 == k) { + req_schp->k_use_sg = 0; + req_schp->buffer = sg_scatg2virt(sclp); + } else { + sfp->save_scat_len = num; + sclp->length = (unsigned) rem; + req_schp->k_use_sg = k + 1; + req_schp->sglist_len = + rsv_schp->sglist_len; + req_schp->buffer = rsv_schp->buffer; + } + req_schp->bufflen = size; + req_schp->b_malloc_len = rsv_schp->b_malloc_len; + break; + } else + rem -= num; + } + if (k >= rsv_schp->k_use_sg) + SCSI_LOG_TIMEOUT(1, printk("sg_link_reserve: BAD size\n")); + } else { + req_schp->k_use_sg = 0; + req_schp->bufflen = size; + req_schp->buffer = rsv_schp->buffer; + req_schp->b_malloc_len = rsv_schp->b_malloc_len; } - - if (k >= rsv_schp->k_use_sg) - SCSI_LOG_TIMEOUT(1, printk("sg_link_reserve: BAD size\n")); } static void @@ -2193,10 +2355,11 @@ sg_unlink_reserve(Sg_fd * sfp, Sg_request * srp) SCSI_LOG_TIMEOUT(4, printk("sg_unlink_reserve: req->k_use_sg=%d\n", (int) req_schp->k_use_sg)); if ((rsv_schp->k_use_sg > 0) && (req_schp->k_use_sg > 0)) { - struct scatterlist *sg = rsv_schp->buffer; + struct scatterlist *sclp = + (struct scatterlist *) rsv_schp->buffer; if (sfp->save_scat_len > 0) - (sg + (req_schp->k_use_sg - 1))->length = + (sclp + (req_schp->k_use_sg - 1))->length = (unsigned) sfp->save_scat_len; else SCSI_LOG_TIMEOUT(1, printk ("sg_unlink_reserve: BAD save_scat_len\n")); @@ -2282,6 +2445,7 @@ sg_add_request(Sg_fd * sfp) if (resp) { resp->nextrp = NULL; resp->header.duration = jiffies_to_msecs(jiffies); + resp->my_cmdp = NULL; } write_unlock_irqrestore(&sfp->rq_list_lock, iflags); return resp; @@ -2299,6 +2463,8 @@ sg_remove_request(Sg_fd * sfp, Sg_request * srp) if ((!sfp) || (!srp) || (!sfp->headrp)) return res; write_lock_irqsave(&sfp->rq_list_lock, iflags); + if (srp->my_cmdp) + srp->my_cmdp->upper_private_data = NULL; prev_rp = sfp->headrp; if (srp == prev_rp) { sfp->headrp = prev_rp->nextrp; @@ -2341,10 +2507,10 @@ sg_add_sfp(Sg_device * sdp, int dev) Sg_fd *sfp; unsigned long iflags; - sfp = kzalloc(sizeof(*sfp), GFP_ATOMIC | __GFP_NOWARN); + sfp = (Sg_fd *) sg_page_malloc(sizeof (Sg_fd), 0, NULL); if (!sfp) return NULL; - + memset(sfp, 0, sizeof (Sg_fd)); init_waitqueue_head(&sfp->read_wait); rwlock_init(&sfp->rq_list_lock); @@ -2401,7 +2567,7 @@ __sg_remove_sfp(Sg_device * sdp, Sg_fd * sfp) } sfp->parentdp = NULL; SCSI_LOG_TIMEOUT(6, printk("__sg_remove_sfp: sfp=0x%p\n", sfp)); - kfree(sfp); + sg_page_free((char *) sfp, sizeof (Sg_fd)); } /* Returns 0 in normal case, 1 when detached and sdp object removed */ @@ -2466,10 +2632,10 @@ sg_res_in_use(Sg_fd * sfp) } /* If retSzp==NULL want exact size or fail */ -static struct page * +static char * sg_page_malloc(int rqSz, int lowDma, int *retSzp) { - struct page *resp = NULL; + char *resp = NULL; gfp_t page_mask; int order, a_size; int resSz = rqSz; @@ -2484,11 +2650,11 @@ sg_page_malloc(int rqSz, int lowDma, int *retSzp) for (order = 0, a_size = PAGE_SIZE; a_size < rqSz; order++, a_size <<= 1) ; - resp = alloc_pages(page_mask, order); + resp = (char *) __get_free_pages(page_mask, order); while ((!resp) && order && retSzp) { --order; a_size >>= 1; /* divide by 2, until PAGE_SIZE */ - resp = alloc_pages(page_mask, order); /* try half */ + resp = (char *) __get_free_pages(page_mask, order); /* try half */ resSz = a_size; } if (resp) { @@ -2501,15 +2667,15 @@ sg_page_malloc(int rqSz, int lowDma, int *retSzp) } static void -sg_page_free(struct page *page, int size) +sg_page_free(char *buff, int size) { int order, a_size; - if (!page) + if (!buff) return; for (order = 0, a_size = PAGE_SIZE; a_size < size; order++, a_size <<= 1) ; - __free_pages(page, order); + free_pages((unsigned long) buff, order); } #ifndef MAINTENANCE_IN_CMD @@ -2901,11 +3067,13 @@ static void sg_proc_debug_helper(struct seq_file *s, Sg_device * sdp) cp = " "; } seq_printf(s, cp); - blen = srp->data.bufflen; - usg = srp->data.k_use_sg; + blen = srp->my_cmdp ? + srp->my_cmdp->sr_bufflen : srp->data.bufflen; + usg = srp->my_cmdp ? + srp->my_cmdp->sr_use_sg : srp->data.k_use_sg; seq_printf(s, srp->done ? ((1 == srp->done) ? "rcv:" : "fin:") - : "act:"); + : (srp->my_cmdp ? "act:" : "prior:")); seq_printf(s, " id=%d blen=%d", srp->header.pack_id, blen); if (srp->done) diff --git a/trunk/drivers/scsi/sr.c b/trunk/drivers/scsi/sr.c index a4d9be7c6874..d68cea753bb2 100644 --- a/trunk/drivers/scsi/sr.c +++ b/trunk/drivers/scsi/sr.c @@ -320,11 +320,25 @@ static int sr_init_command(struct scsi_cmnd * SCpnt) * these are already setup, just copy cdb basically */ if (SCpnt->request->flags & REQ_BLOCK_PC) { - scsi_setup_blk_pc_cmnd(SCpnt); + struct request *rq = SCpnt->request; - if (SCpnt->timeout_per_command) - timeout = SCpnt->timeout_per_command; + if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd)) + return 0; + + memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd)); + SCpnt->cmd_len = rq->cmd_len; + if (!rq->data_len) + SCpnt->sc_data_direction = DMA_NONE; + else if (rq_data_dir(rq) == WRITE) + SCpnt->sc_data_direction = DMA_TO_DEVICE; + else + SCpnt->sc_data_direction = DMA_FROM_DEVICE; + + this_count = rq->data_len; + if (rq->timeout) + timeout = rq->timeout; + SCpnt->transfersize = rq->data_len; goto queue; } @@ -716,7 +730,7 @@ static void get_capabilities(struct scsi_cd *cd) unsigned int the_result; int retries, rc, n; - static const char *loadmech[] = + static char *loadmech[] = { "caddy", "tray", diff --git a/trunk/drivers/scsi/sr_vendor.c b/trunk/drivers/scsi/sr_vendor.c index 9dde8df2f5c9..78274dc91f5c 100644 --- a/trunk/drivers/scsi/sr_vendor.c +++ b/trunk/drivers/scsi/sr_vendor.c @@ -68,8 +68,8 @@ void sr_vendor_init(Scsi_CD *cd) #ifndef CONFIG_BLK_DEV_SR_VENDOR cd->vendor = VENDOR_SCSI3; #else - const char *vendor = cd->device->vendor; - const char *model = cd->device->model; + char *vendor = cd->device->vendor; + char *model = cd->device->model; /* default */ cd->vendor = VENDOR_SCSI3; diff --git a/trunk/drivers/scsi/st.c b/trunk/drivers/scsi/st.c index c4aade8f5345..770c4324f3d5 100644 --- a/trunk/drivers/scsi/st.c +++ b/trunk/drivers/scsi/st.c @@ -17,7 +17,7 @@ Last modified: 18-JAN-1998 Richard Gooch Devfs support */ -static const char *verstr = "20050830"; +static char *verstr = "20050830"; #include @@ -50,6 +50,7 @@ static const char *verstr = "20050830"; #include #include #include +#include #include @@ -133,7 +134,7 @@ static struct st_dev_parm { #endif /* Bit reversed order to get same names for same minors with all mode counts */ -static const char *st_formats[] = { +static char *st_formats[] = { "", "r", "k", "s", "l", "t", "o", "u", "m", "v", "p", "x", "a", "y", "q", "z"}; @@ -187,6 +188,8 @@ static int from_buffer(struct st_buffer *, char __user *, int); static void move_buffer_data(struct st_buffer *, int); static void buf_to_sg(struct st_buffer *, unsigned int); +static int st_map_user_pages(struct scatterlist *, const unsigned int, + unsigned long, size_t, int, unsigned long); static int sgl_map_user_pages(struct scatterlist *, const unsigned int, unsigned long, size_t, int); static int sgl_unmap_user_pages(struct scatterlist *, const unsigned int, int); @@ -310,13 +313,12 @@ static inline char *tape_name(struct scsi_tape *tape) } -static void st_analyze_sense(struct st_request *SRpnt, struct st_cmdstatus *s) +static void st_analyze_sense(struct scsi_request *SRpnt, struct st_cmdstatus *s) { const u8 *ucp; - const u8 *sense = SRpnt->sense; + const u8 *sense = SRpnt->sr_sense_buffer; - s->have_sense = scsi_normalize_sense(SRpnt->sense, - SCSI_SENSE_BUFFERSIZE, &s->sense_hdr); + s->have_sense = scsi_request_normalize_sense(SRpnt, &s->sense_hdr); s->flags = 0; if (s->have_sense) { @@ -343,9 +345,9 @@ static void st_analyze_sense(struct st_request *SRpnt, struct st_cmdstatus *s) /* Convert the result to success code */ -static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) +static int st_chk_result(struct scsi_tape *STp, struct scsi_request * SRpnt) { - int result = SRpnt->result; + int result = SRpnt->sr_result; u8 scode; DEB(const char *stp;) char *name = tape_name(STp); @@ -364,12 +366,13 @@ static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) DEB( if (debugging) { - printk(ST_DEB_MSG "%s: Error: %x, cmd: %x %x %x %x %x %x\n", + printk(ST_DEB_MSG "%s: Error: %x, cmd: %x %x %x %x %x %x Len: %d\n", name, result, - SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2], - SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]); + SRpnt->sr_cmnd[0], SRpnt->sr_cmnd[1], SRpnt->sr_cmnd[2], + SRpnt->sr_cmnd[3], SRpnt->sr_cmnd[4], SRpnt->sr_cmnd[5], + SRpnt->sr_bufflen); if (cmdstatp->have_sense) - __scsi_print_sense("st", SRpnt->sense, SCSI_SENSE_BUFFERSIZE); + scsi_print_req_sense("st", SRpnt); } ) /* end DEB */ if (!debugging) { /* Abnormal conditions for tape */ if (!cmdstatp->have_sense) @@ -383,21 +386,20 @@ static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) /* scode != UNIT_ATTENTION && */ scode != BLANK_CHECK && scode != VOLUME_OVERFLOW && - SRpnt->cmd[0] != MODE_SENSE && - SRpnt->cmd[0] != TEST_UNIT_READY) { + SRpnt->sr_cmnd[0] != MODE_SENSE && + SRpnt->sr_cmnd[0] != TEST_UNIT_READY) { printk(KERN_WARNING "%s: Error with sense data: ", name); - __scsi_print_sense("st", SRpnt->sense, - SCSI_SENSE_BUFFERSIZE); + scsi_print_req_sense("st", SRpnt); } } if (cmdstatp->fixed_format && STp->cln_mode >= EXTENDED_SENSE_START) { /* Only fixed format sense */ if (STp->cln_sense_value) - STp->cleaning_req |= ((SRpnt->sense[STp->cln_mode] & + STp->cleaning_req |= ((SRpnt->sr_sense_buffer[STp->cln_mode] & STp->cln_sense_mask) == STp->cln_sense_value); else - STp->cleaning_req |= ((SRpnt->sense[STp->cln_mode] & + STp->cleaning_req |= ((SRpnt->sr_sense_buffer[STp->cln_mode] & STp->cln_sense_mask) != 0); } if (cmdstatp->have_sense && @@ -409,8 +411,8 @@ static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) if (cmdstatp->have_sense && scode == RECOVERED_ERROR #if ST_RECOVERED_WRITE_FATAL - && SRpnt->cmd[0] != WRITE_6 - && SRpnt->cmd[0] != WRITE_FILEMARKS + && SRpnt->sr_cmnd[0] != WRITE_6 + && SRpnt->sr_cmnd[0] != WRITE_FILEMARKS #endif ) { STp->recover_count++; @@ -418,9 +420,9 @@ static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) DEB( if (debugging) { - if (SRpnt->cmd[0] == READ_6) + if (SRpnt->sr_cmnd[0] == READ_6) stp = "read"; - else if (SRpnt->cmd[0] == WRITE_6) + else if (SRpnt->sr_cmnd[0] == WRITE_6) stp = "write"; else stp = "ioctl"; @@ -436,37 +438,28 @@ static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) /* Wakeup from interrupt */ -static void st_sleep_done(void *data, char *sense, int result, int resid) +static void st_sleep_done(struct scsi_cmnd * SCpnt) { - struct st_request *SRpnt = data; - struct scsi_tape *STp = SRpnt->stp; + struct scsi_tape *STp = container_of(SCpnt->request->rq_disk->private_data, + struct scsi_tape, driver); - memcpy(SRpnt->sense, sense, SCSI_SENSE_BUFFERSIZE); - (STp->buffer)->cmdstat.midlevel_result = SRpnt->result = result; + (STp->buffer)->cmdstat.midlevel_result = SCpnt->result; + SCpnt->request->rq_status = RQ_SCSI_DONE; DEB( STp->write_pending = 0; ) - if (SRpnt->waiting) - complete(SRpnt->waiting); -} - -static struct st_request *st_allocate_request(void) -{ - return kzalloc(sizeof(struct st_request), GFP_KERNEL); -} - -static void st_release_request(struct st_request *streq) -{ - kfree(streq); + if (SCpnt->request->waiting) + complete(SCpnt->request->waiting); } /* Do the scsi command. Waits until command performed if do_wait is true. Otherwise write_behind_check() is used to check that the command has finished. */ -static struct st_request * -st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd, +static struct scsi_request * +st_do_scsi(struct scsi_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd, int bytes, int direction, int timeout, int retries, int do_wait) { struct completion *waiting; + unsigned char *bp; /* if async, make sure there's no command outstanding */ if (!do_wait && ((STp->buffer)->last_SRpnt)) { @@ -480,7 +473,7 @@ st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd } if (SRpnt == NULL) { - SRpnt = st_allocate_request(); + SRpnt = scsi_allocate_request(STp->device, GFP_ATOMIC); if (SRpnt == NULL) { DEBC( printk(KERN_ERR "%s: Can't get SCSI request.\n", tape_name(STp)); ); @@ -490,7 +483,6 @@ st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd (STp->buffer)->syscall_result = (-EBUSY); return NULL; } - SRpnt->stp = STp; } /* If async IO, set last_SRpnt. This ptr tells write_behind_check @@ -500,28 +492,32 @@ st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd waiting = &STp->wait; init_completion(waiting); - SRpnt->waiting = waiting; + SRpnt->sr_use_sg = STp->buffer->do_dio || (bytes > (STp->buffer)->frp[0].length); + if (SRpnt->sr_use_sg) { + if (!STp->buffer->do_dio) + buf_to_sg(STp->buffer, bytes); + SRpnt->sr_use_sg = (STp->buffer)->sg_segs; + bp = (char *) &((STp->buffer)->sg[0]); + } else + bp = (STp->buffer)->b_data; + SRpnt->sr_data_direction = direction; + SRpnt->sr_cmd_len = 0; + SRpnt->sr_request->waiting = waiting; + SRpnt->sr_request->rq_status = RQ_SCSI_BUSY; + SRpnt->sr_request->rq_disk = STp->disk; + SRpnt->sr_request->end_io = blk_end_sync_rq; + STp->buffer->cmdstat.have_sense = 0; - if (!STp->buffer->do_dio) - buf_to_sg(STp->buffer, bytes); + scsi_do_req(SRpnt, (void *) cmd, bp, bytes, + st_sleep_done, timeout, retries); - memcpy(SRpnt->cmd, cmd, sizeof(SRpnt->cmd)); - STp->buffer->cmdstat.have_sense = 0; - STp->buffer->syscall_result = 0; - - if (scsi_execute_async(STp->device, cmd, direction, - &((STp->buffer)->sg[0]), bytes, (STp->buffer)->sg_segs, - timeout, retries, SRpnt, st_sleep_done, GFP_KERNEL)) { - /* could not allocate the buffer or request was too large */ - (STp->buffer)->syscall_result = (-EBUSY); - (STp->buffer)->last_SRpnt = NULL; - } - else if (do_wait) { + if (do_wait) { wait_for_completion(waiting); - SRpnt->waiting = NULL; + SRpnt->sr_request->waiting = NULL; + if (SRpnt->sr_request->rq_status != RQ_SCSI_DONE) + SRpnt->sr_result |= (DRIVER_ERROR << 24); (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); } - return SRpnt; } @@ -536,7 +532,7 @@ static int write_behind_check(struct scsi_tape * STp) struct st_buffer *STbuffer; struct st_partstat *STps; struct st_cmdstatus *cmdstatp; - struct st_request *SRpnt; + struct scsi_request *SRpnt; STbuffer = STp->buffer; if (!STbuffer->writing) @@ -552,10 +548,12 @@ static int write_behind_check(struct scsi_tape * STp) wait_for_completion(&(STp->wait)); SRpnt = STbuffer->last_SRpnt; STbuffer->last_SRpnt = NULL; - SRpnt->waiting = NULL; + SRpnt->sr_request->waiting = NULL; + if (SRpnt->sr_request->rq_status != RQ_SCSI_DONE) + SRpnt->sr_result |= (DRIVER_ERROR << 24); (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); - st_release_request(SRpnt); + scsi_release_request(SRpnt); STbuffer->buffer_bytes -= STbuffer->writing; STps = &(STp->ps[STp->partition]); @@ -595,7 +593,7 @@ static int write_behind_check(struct scsi_tape * STp) it messes up the block number). */ static int cross_eof(struct scsi_tape * STp, int forward) { - struct st_request *SRpnt; + struct scsi_request *SRpnt; unsigned char cmd[MAX_COMMAND_SIZE]; cmd[0] = SPACE; @@ -615,7 +613,7 @@ static int cross_eof(struct scsi_tape * STp, int forward) if (!SRpnt) return (STp->buffer)->syscall_result; - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; if ((STp->buffer)->cmdstat.midlevel_result != 0) @@ -632,7 +630,7 @@ static int flush_write_buffer(struct scsi_tape * STp) int offset, transfer, blks; int result; unsigned char cmd[MAX_COMMAND_SIZE]; - struct st_request *SRpnt; + struct scsi_request *SRpnt; struct st_partstat *STps; result = write_behind_check(STp); @@ -690,7 +688,7 @@ static int flush_write_buffer(struct scsi_tape * STp) STp->dirty = 0; (STp->buffer)->buffer_bytes = 0; } - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; } return result; @@ -787,7 +785,7 @@ static int set_mode_densblk(struct scsi_tape * STp, struct st_modedef * STm) } -/* Lock or unlock the drive door. Don't use when st_request allocated. */ +/* Lock or unlock the drive door. Don't use when scsi_request allocated. */ static int do_door_lock(struct scsi_tape * STp, int do_lock) { int retval, cmd; @@ -846,7 +844,7 @@ static int test_ready(struct scsi_tape *STp, int do_wait) int attentions, waits, max_wait, scode; int retval = CHKRES_READY, new_session = 0; unsigned char cmd[MAX_COMMAND_SIZE]; - struct st_request *SRpnt = NULL; + struct scsi_request *SRpnt = NULL; struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; max_wait = do_wait ? ST_BLOCK_SECONDS : 0; @@ -905,7 +903,7 @@ static int test_ready(struct scsi_tape *STp, int do_wait) } if (SRpnt != NULL) - st_release_request(SRpnt); + scsi_release_request(SRpnt); return retval; } @@ -920,7 +918,7 @@ static int check_tape(struct scsi_tape *STp, struct file *filp) int i, retval, new_session = 0, do_wait; unsigned char cmd[MAX_COMMAND_SIZE], saved_cleaning; unsigned short st_flags = filp->f_flags; - struct st_request *SRpnt = NULL; + struct scsi_request *SRpnt = NULL; struct st_modedef *STm; struct st_partstat *STps; char *name = tape_name(STp); @@ -995,7 +993,7 @@ static int check_tape(struct scsi_tape *STp, struct file *filp) goto err_out; } - if (!SRpnt->result && !STp->buffer->cmdstat.have_sense) { + if (!SRpnt->sr_result && !STp->buffer->cmdstat.have_sense) { STp->max_block = ((STp->buffer)->b_data[1] << 16) | ((STp->buffer)->b_data[2] << 8) | (STp->buffer)->b_data[3]; STp->min_block = ((STp->buffer)->b_data[4] << 8) | @@ -1047,7 +1045,7 @@ static int check_tape(struct scsi_tape *STp, struct file *filp) } STp->drv_write_prot = ((STp->buffer)->b_data[2] & 0x80) != 0; } - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; STp->inited = 1; @@ -1198,7 +1196,7 @@ static int st_flush(struct file *filp) { int result = 0, result2; unsigned char cmd[MAX_COMMAND_SIZE]; - struct st_request *SRpnt; + struct scsi_request *SRpnt; struct scsi_tape *STp = filp->private_data; struct st_modedef *STm = &(STp->modes[STp->current_mode]); struct st_partstat *STps = &(STp->ps[STp->partition]); @@ -1251,7 +1249,7 @@ static int st_flush(struct file *filp) cmdstatp->sense_hdr.sense_key == RECOVERED_ERROR) && (!cmdstatp->remainder_valid || cmdstatp->uremainder64 == 0))) { /* Write successful at EOM */ - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; if (STps->drv_file >= 0) STps->drv_file++; @@ -1261,7 +1259,7 @@ static int st_flush(struct file *filp) STps->eof = ST_FM; } else { /* Write error */ - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; printk(KERN_ERR "%s: Error on write filemark.\n", name); if (result == 0) @@ -1402,11 +1400,11 @@ static int setup_buffering(struct scsi_tape *STp, const char __user *buf, i = STp->try_dio && try_rdio; else i = STp->try_dio && try_wdio; - if (i && ((unsigned long)buf & queue_dma_alignment( STp->device->request_queue)) == 0) { - i = sgl_map_user_pages(&(STbp->sg[0]), STbp->use_sg, - (unsigned long)buf, count, (is_read ? READ : WRITE)); + i = st_map_user_pages(&(STbp->sg[0]), STbp->use_sg, + (unsigned long)buf, count, (is_read ? READ : WRITE), + STp->max_pfn); if (i > 0) { STbp->do_dio = i; STbp->buffer_bytes = 0; /* can be used as transfer counter */ @@ -1451,15 +1449,14 @@ static int setup_buffering(struct scsi_tape *STp, const char __user *buf, /* Can be called more than once after each setup_buffer() */ -static void release_buffering(struct scsi_tape *STp, int is_read) +static void release_buffering(struct scsi_tape *STp) { struct st_buffer *STbp; STbp = STp->buffer; if (STbp->do_dio) { - sgl_unmap_user_pages(&(STbp->sg[0]), STbp->do_dio, is_read); + sgl_unmap_user_pages(&(STbp->sg[0]), STbp->do_dio, 0); STbp->do_dio = 0; - STbp->sg_segs = 0; } } @@ -1475,7 +1472,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) int async_write; unsigned char cmd[MAX_COMMAND_SIZE]; const char __user *b_point; - struct st_request *SRpnt = NULL; + struct scsi_request *SRpnt = NULL; struct scsi_tape *STp = filp->private_data; struct st_modedef *STm; struct st_partstat *STps; @@ -1627,7 +1624,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) retval = STbp->syscall_result; goto out; } - if (async_write && !STbp->syscall_result) { + if (async_write) { STbp->writing = transfer; STp->dirty = !(STbp->writing == STbp->buffer_bytes); @@ -1701,7 +1698,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) } else { count += do_count; STps->drv_block = (-1); /* Too cautious? */ - retval = STbp->syscall_result; + retval = (-EIO); } } @@ -1731,8 +1728,8 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) out: if (SRpnt != NULL) - st_release_request(SRpnt); - release_buffering(STp, 0); + scsi_release_request(SRpnt); + release_buffering(STp); up(&STp->lock); return retval; @@ -1745,11 +1742,11 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) Does release user buffer mapping if it is set. */ static long read_tape(struct scsi_tape *STp, long count, - struct st_request ** aSRpnt) + struct scsi_request ** aSRpnt) { int transfer, blks, bytes; unsigned char cmd[MAX_COMMAND_SIZE]; - struct st_request *SRpnt; + struct scsi_request *SRpnt; struct st_modedef *STm; struct st_partstat *STps; struct st_buffer *STbp; @@ -1790,7 +1787,7 @@ static long read_tape(struct scsi_tape *STp, long count, SRpnt = *aSRpnt; SRpnt = st_do_scsi(SRpnt, STp, cmd, bytes, DMA_FROM_DEVICE, STp->device->timeout, MAX_RETRIES, 1); - release_buffering(STp, 1); + release_buffering(STp); *aSRpnt = SRpnt; if (!SRpnt) return STbp->syscall_result; @@ -1805,10 +1802,10 @@ static long read_tape(struct scsi_tape *STp, long count, retval = 1; DEBC(printk(ST_DEB_MSG "%s: Sense: %2x %2x %2x %2x %2x %2x %2x %2x\n", name, - SRpnt->sense[0], SRpnt->sense[1], - SRpnt->sense[2], SRpnt->sense[3], - SRpnt->sense[4], SRpnt->sense[5], - SRpnt->sense[6], SRpnt->sense[7])); + SRpnt->sr_sense_buffer[0], SRpnt->sr_sense_buffer[1], + SRpnt->sr_sense_buffer[2], SRpnt->sr_sense_buffer[3], + SRpnt->sr_sense_buffer[4], SRpnt->sr_sense_buffer[5], + SRpnt->sr_sense_buffer[6], SRpnt->sr_sense_buffer[7])); if (cmdstatp->have_sense) { if (cmdstatp->sense_hdr.sense_key == BLANK_CHECK) @@ -1838,7 +1835,7 @@ static long read_tape(struct scsi_tape *STp, long count, } STbp->buffer_bytes = bytes - transfer; } else { - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = *aSRpnt = NULL; if (transfer == blks) { /* We did not get anything, error */ printk(KERN_NOTICE "%s: Incorrect block size.\n", name); @@ -1932,7 +1929,7 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) ssize_t retval = 0; ssize_t i, transfer; int special, do_dio = 0; - struct st_request *SRpnt = NULL; + struct scsi_request *SRpnt = NULL; struct scsi_tape *STp = filp->private_data; struct st_modedef *STm; struct st_partstat *STps; @@ -2057,11 +2054,11 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) out: if (SRpnt != NULL) { - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; } if (do_dio) { - release_buffering(STp, 1); + release_buffering(STp); STbp->buffer_bytes = 0; } up(&STp->lock); @@ -2287,7 +2284,7 @@ static int st_set_options(struct scsi_tape *STp, long options) static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs) { unsigned char cmd[MAX_COMMAND_SIZE]; - struct st_request *SRpnt = NULL; + struct scsi_request *SRpnt = NULL; memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = MODE_SENSE; @@ -2301,7 +2298,7 @@ static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs) if (SRpnt == NULL) return (STp->buffer)->syscall_result; - st_release_request(SRpnt); + scsi_release_request(SRpnt); return (STp->buffer)->syscall_result; } @@ -2313,7 +2310,7 @@ static int write_mode_page(struct scsi_tape *STp, int page, int slow) { int pgo; unsigned char cmd[MAX_COMMAND_SIZE]; - struct st_request *SRpnt = NULL; + struct scsi_request *SRpnt = NULL; memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = MODE_SELECT; @@ -2332,7 +2329,7 @@ static int write_mode_page(struct scsi_tape *STp, int page, int slow) if (SRpnt == NULL) return (STp->buffer)->syscall_result; - st_release_request(SRpnt); + scsi_release_request(SRpnt); return (STp->buffer)->syscall_result; } @@ -2415,7 +2412,7 @@ static int do_load_unload(struct scsi_tape *STp, struct file *filp, int load_cod DEB( char *name = tape_name(STp); ) unsigned char cmd[MAX_COMMAND_SIZE]; struct st_partstat *STps; - struct st_request *SRpnt; + struct scsi_request *SRpnt; if (STp->ready != ST_READY && !load_code) { if (STp->ready == ST_NO_TAPE) @@ -2458,7 +2455,7 @@ static int do_load_unload(struct scsi_tape *STp, struct file *filp, int load_cod return (STp->buffer)->syscall_result; retval = (STp->buffer)->syscall_result; - st_release_request(SRpnt); + scsi_release_request(SRpnt); if (!retval) { /* SCSI command successful */ @@ -2506,7 +2503,7 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon int ioctl_result; int chg_eof = 1; unsigned char cmd[MAX_COMMAND_SIZE]; - struct st_request *SRpnt; + struct scsi_request *SRpnt; struct st_partstat *STps; int fileno, blkno, at_sm, undone; int datalen = 0, direction = DMA_NONE; @@ -2760,7 +2757,7 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon ioctl_result = (STp->buffer)->syscall_result; if (!ioctl_result) { /* SCSI command successful */ - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; STps->drv_block = blkno; STps->drv_file = fileno; @@ -2875,7 +2872,7 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon /* Try the other possible state of Page Format if not already tried */ STp->use_pf = !STp->use_pf | PF_TESTED; - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; return st_int_ioctl(STp, cmd_in, arg); } @@ -2885,7 +2882,7 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon if (cmdstatp->sense_hdr.sense_key == BLANK_CHECK) STps->eof = ST_EOD; - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; } @@ -2901,7 +2898,7 @@ static int get_location(struct scsi_tape *STp, unsigned int *block, int *partiti { int result; unsigned char scmd[MAX_COMMAND_SIZE]; - struct st_request *SRpnt; + struct scsi_request *SRpnt; DEB( char *name = tape_name(STp); ) if (STp->ready != ST_READY) @@ -2947,7 +2944,7 @@ static int get_location(struct scsi_tape *STp, unsigned int *block, int *partiti DEBC(printk(ST_DEB_MSG "%s: Got tape pos. blk %d part %d.\n", name, *block, *partition)); } - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; return result; @@ -2964,7 +2961,7 @@ static int set_location(struct scsi_tape *STp, unsigned int block, int partition unsigned int blk; int timeout; unsigned char scmd[MAX_COMMAND_SIZE]; - struct st_request *SRpnt; + struct scsi_request *SRpnt; DEB( char *name = tape_name(STp); ) if (STp->ready != ST_READY) @@ -3050,7 +3047,7 @@ static int set_location(struct scsi_tape *STp, unsigned int block, int partition result = 0; } - st_release_request(SRpnt); + scsi_release_request(SRpnt); SRpnt = NULL; return result; @@ -3580,7 +3577,7 @@ static long st_compat_ioctl(struct file *file, unsigned int cmd, unsigned long a static struct st_buffer * new_tape_buffer(int from_initialization, int need_dma, int max_sg) { - int i, got = 0; + int i, got = 0, segs = 0; gfp_t priority; struct st_buffer *tb; @@ -3597,8 +3594,10 @@ static struct st_buffer * return NULL; } memset(tb, 0, i); - tb->frp_segs = tb->orig_frp_segs = 0; + tb->frp_segs = tb->orig_frp_segs = segs; tb->use_sg = max_sg; + if (segs > 0) + tb->b_data = page_address(tb->sg[0].page); tb->frp = (struct st_buf_fragment *)(&(tb->sg[0]) + max_sg); tb->in_use = 1; @@ -3629,7 +3628,7 @@ static int enlarge_buffer(struct st_buffer * STbuffer, int new_size, int need_dm priority = GFP_KERNEL | __GFP_NOWARN; if (need_dma) priority |= GFP_DMA; - for (b_size = PAGE_SIZE, order=0; order <= 6 && + for (b_size = PAGE_SIZE, order=0; b_size < new_size - STbuffer->buffer_size; order++, b_size *= 2) ; /* empty */ @@ -3671,7 +3670,6 @@ static void normalize_buffer(struct st_buffer * STbuffer) } STbuffer->frp_segs = STbuffer->orig_frp_segs; STbuffer->frp_sg_current = 0; - STbuffer->sg_segs = 0; } @@ -3884,6 +3882,7 @@ static int st_probe(struct device *dev) struct st_buffer *buffer; int i, j, mode, dev_num, error; char *stp; + u64 bounce_limit; if (SDp->type != TYPE_TAPE) return -ENODEV; @@ -3893,8 +3892,7 @@ static int st_probe(struct device *dev) return -ENODEV; } - i = min(SDp->request_queue->max_hw_segments, - SDp->request_queue->max_phys_segments); + i = SDp->host->sg_tablesize; if (st_max_sg_segs < i) i = st_max_sg_segs; buffer = new_tape_buffer(1, (SDp->host)->unchecked_isa_dma, i); @@ -3996,6 +3994,11 @@ static int st_probe(struct device *dev) tpnt->long_timeout = ST_LONG_TIMEOUT; tpnt->try_dio = try_direct_io && !SDp->host->unchecked_isa_dma; + bounce_limit = scsi_calculate_bounce_limit(SDp->host) >> PAGE_SHIFT; + if (bounce_limit > ULONG_MAX) + bounce_limit = ULONG_MAX; + tpnt->max_pfn = bounce_limit; + for (i = 0; i < ST_NBR_MODES; i++) { STm = &(tpnt->modes[i]); STm->defined = 0; @@ -4074,9 +4077,9 @@ static int st_probe(struct device *dev) sdev_printk(KERN_WARNING, SDp, "Attached scsi tape %s", tape_name(tpnt)); - printk(KERN_WARNING "%s: try direct i/o: %s (alignment %d B)\n", + printk(KERN_WARNING "%s: try direct i/o: %s (alignment %d B), max page reachable by HBA %lu\n", tape_name(tpnt), tpnt->try_dio ? "yes" : "no", - queue_dma_alignment(SDp->request_queue) + 1); + queue_dma_alignment(SDp->request_queue) + 1, tpnt->max_pfn); return 0; @@ -4182,11 +4185,7 @@ static void scsi_tape_release(struct kref *kref) static void st_intr(struct scsi_cmnd *SCpnt) { - /* - * The caller should be checking the request's errors - * value. - */ - scsi_io_completion(SCpnt, SCpnt->bufflen, 0); + scsi_io_completion(SCpnt, (SCpnt->result ? 0: SCpnt->bufflen), 1); } /* @@ -4195,10 +4194,27 @@ static void st_intr(struct scsi_cmnd *SCpnt) */ static int st_init_command(struct scsi_cmnd *SCpnt) { + struct request *rq; + if (!(SCpnt->request->flags & REQ_BLOCK_PC)) return 0; - scsi_setup_blk_pc_cmnd(SCpnt); + rq = SCpnt->request; + if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd)) + return 0; + + memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd)); + SCpnt->cmd_len = rq->cmd_len; + + if (rq_data_dir(rq) == WRITE) + SCpnt->sc_data_direction = DMA_TO_DEVICE; + else if (rq->data_len) + SCpnt->sc_data_direction = DMA_FROM_DEVICE; + else + SCpnt->sc_data_direction = DMA_NONE; + + SCpnt->timeout_per_command = rq->timeout; + SCpnt->transfersize = rq->data_len; SCpnt->done = st_intr; return 1; } @@ -4391,6 +4407,34 @@ static void do_create_class_files(struct scsi_tape *STp, int dev_num, int mode) return; } + +/* Pin down user pages and put them into a scatter gather list. Returns <= 0 if + - mapping of all pages not successful + - any page is above max_pfn + (i.e., either completely successful or fails) +*/ +static int st_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages, + unsigned long uaddr, size_t count, int rw, + unsigned long max_pfn) +{ + int i, nr_pages; + + nr_pages = sgl_map_user_pages(sgl, max_pages, uaddr, count, rw); + if (nr_pages <= 0) + return nr_pages; + + for (i=0; i < nr_pages; i++) { + if (page_to_pfn(sgl[i].page) > max_pfn) + goto out_unmap; + } + return nr_pages; + + out_unmap: + sgl_unmap_user_pages(sgl, nr_pages, 0); + return 0; +} + + /* The following functions may be useful for a larger audience. */ static int sgl_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages, unsigned long uaddr, size_t count, int rw) @@ -4465,7 +4509,6 @@ static int sgl_map_user_pages(struct scatterlist *sgl, const unsigned int max_pa if (res > 0) { for (j=0; j < res; j++) page_cache_release(pages[j]); - res = 0; } kfree(pages); return res; @@ -4481,6 +4524,8 @@ static int sgl_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_p for (i=0; i < nr_pages; i++) { struct page *page = sgl[i].page; + /* XXX: just for debug. Remove when PageReserved is removed */ + BUG_ON(PageReserved(page)); if (dirtied) SetPageDirty(page); /* FIXME: cache flush missing for rw==READ diff --git a/trunk/drivers/scsi/st.h b/trunk/drivers/scsi/st.h index 411209048d74..790acac160bc 100644 --- a/trunk/drivers/scsi/st.h +++ b/trunk/drivers/scsi/st.h @@ -4,7 +4,6 @@ #include #include -#include /* Descriptor for analyzed sense data */ struct st_cmdstatus { @@ -18,17 +17,6 @@ struct st_cmdstatus { u8 deferred; }; -struct scsi_tape; - -/* scsi tape command */ -struct st_request { - unsigned char cmd[MAX_COMMAND_SIZE]; - unsigned char sense[SCSI_SENSE_BUFFERSIZE]; - int result; - struct scsi_tape *stp; - struct completion *waiting; -}; - /* The tape buffer descriptor. */ struct st_buffer { unsigned char in_use; @@ -40,7 +28,7 @@ struct st_buffer { int read_pointer; int writing; int syscall_result; - struct st_request *last_SRpnt; + struct scsi_request *last_SRpnt; struct st_cmdstatus cmdstat; unsigned char *b_data; unsigned short use_sg; /* zero or max number of s/g segments for this adapter */ diff --git a/trunk/drivers/scsi/sun3_NCR5380.c b/trunk/drivers/scsi/sun3_NCR5380.c index 25cced91c8a6..c041bfd56e12 100644 --- a/trunk/drivers/scsi/sun3_NCR5380.c +++ b/trunk/drivers/scsi/sun3_NCR5380.c @@ -70,7 +70,6 @@ * */ #include -#include /* * Further development / testing that should be done : @@ -2379,7 +2378,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) * 3..length+1 arguments * * Start the extended message buffer with the EXTENDED_MESSAGE - * byte, since spi_print_msg() wants the whole thing. + * byte, since scsi_print_msg() wants the whole thing. */ extended_msg[0] = EXTENDED_MESSAGE; /* Accept first byte by clearing ACK */ @@ -2432,7 +2431,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) default: if (!tmp) { printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); - spi_print_msg(extended_msg); + scsi_print_msg (extended_msg); printk("\n"); } else if (tmp != EXTENDED_MESSAGE) printk(KERN_DEBUG "scsi%d: rejecting unknown " @@ -2567,7 +2566,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance) if (!(msg[0] & 0x80)) { printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); - spi_print_msg(msg); + scsi_print_msg(msg); do_abort(instance); return; } diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_defs.h b/trunk/drivers/scsi/sym53c8xx_2/sym_defs.h index 3659dd7b9d76..2d9437d7242b 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_defs.h +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_defs.h @@ -40,7 +40,7 @@ #ifndef SYM_DEFS_H #define SYM_DEFS_H -#define SYM_VERSION "2.2.2" +#define SYM_VERSION "2.2.1" #define SYM_DRIVER_NAME "sym-" SYM_VERSION /* diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_fw.c b/trunk/drivers/scsi/sym53c8xx_2/sym_fw.c index 9916a2a22558..fd36cf9858cb 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_fw.c +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_fw.c @@ -37,7 +37,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef __FreeBSD__ +#include +#else #include "sym_glue.h" +#endif /* * Macros used for all firmwares. @@ -56,12 +60,19 @@ #define SYM_FWA_SCR sym_fw1a_scr #define SYM_FWB_SCR sym_fw1b_scr #define SYM_FWZ_SCR sym_fw1z_scr +#ifdef __FreeBSD__ +#include +#else #include "sym_fw1.h" +#endif static struct sym_fwa_ofs sym_fw1a_ofs = { SYM_GEN_FW_A(struct SYM_FWA_SCR) }; static struct sym_fwb_ofs sym_fw1b_ofs = { SYM_GEN_FW_B(struct SYM_FWB_SCR) +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + SYM_GEN_B(struct SYM_FWB_SCR, data_io) +#endif }; static struct sym_fwz_ofs sym_fw1z_ofs = { SYM_GEN_FW_Z(struct SYM_FWZ_SCR) @@ -77,12 +88,19 @@ static struct sym_fwz_ofs sym_fw1z_ofs = { #define SYM_FWA_SCR sym_fw2a_scr #define SYM_FWB_SCR sym_fw2b_scr #define SYM_FWZ_SCR sym_fw2z_scr +#ifdef __FreeBSD__ +#include +#else #include "sym_fw2.h" +#endif static struct sym_fwa_ofs sym_fw2a_ofs = { SYM_GEN_FW_A(struct SYM_FWA_SCR) }; static struct sym_fwb_ofs sym_fw2b_ofs = { SYM_GEN_FW_B(struct SYM_FWB_SCR) +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + SYM_GEN_B(struct SYM_FWB_SCR, data_io) +#endif SYM_GEN_B(struct SYM_FWB_SCR, start64) SYM_GEN_B(struct SYM_FWB_SCR, pm_handle) }; diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_fw.h b/trunk/drivers/scsi/sym53c8xx_2/sym_fw.h index 66ec35beab5b..43f6810a4045 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_fw.h +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_fw.h @@ -92,6 +92,9 @@ struct sym_fwa_ofs { }; struct sym_fwb_ofs { SYM_GEN_FW_B(u_short) +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + SYM_GEN_B(u_short, data_io) +#endif SYM_GEN_B(u_short, start64) SYM_GEN_B(u_short, pm_handle) }; @@ -108,6 +111,9 @@ struct sym_fwa_ba { }; struct sym_fwb_ba { SYM_GEN_FW_B(u32) +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + SYM_GEN_B(u32, data_io) +#endif SYM_GEN_B(u32, start64); SYM_GEN_B(u32, pm_handle); }; diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_fw1.h b/trunk/drivers/scsi/sym53c8xx_2/sym_fw1.h index 7b39f4a35e98..cdd92d82f4b2 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_fw1.h +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_fw1.h @@ -197,6 +197,12 @@ struct SYM_FWB_SCR { u32 bad_status [ 7]; u32 wsr_ma_helper [ 4]; +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + /* Unknown direction handling */ + u32 data_io [ 2]; + u32 data_io_com [ 8]; + u32 data_io_out [ 7]; +#endif /* Data area */ u32 zero [ 1]; u32 scratch [ 1]; @@ -1741,6 +1747,48 @@ static struct SYM_FWB_SCR SYM_FWB_SCR = { SCR_JUMP, PADDR_A (dispatch), +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN +}/*-------------------------< DATA_IO >--------------------------*/,{ + /* + * We jump here if the data direction was unknown at the + * time we had to queue the command to the scripts processor. + * Pointers had been set as follow in this situation: + * savep --> DATA_IO + * lastp --> start pointer when DATA_IN + * wlastp --> start pointer when DATA_OUT + * This script sets savep and lastp according to the + * direction chosen by the target. + */ + SCR_JUMP ^ IFTRUE (WHEN (SCR_DATA_OUT)), + PADDR_B (data_io_out), +}/*-------------------------< DATA_IO_COM >----------------------*/,{ + /* + * Direction is DATA IN. + */ + SCR_COPY (4), + HADDR_1 (ccb_head.lastp), + HADDR_1 (ccb_head.savep), + /* + * Jump to the SCRIPTS according to actual direction. + */ + SCR_COPY (4), + HADDR_1 (ccb_head.savep), + RADDR_1 (temp), + SCR_RETURN, + 0, +}/*-------------------------< DATA_IO_OUT >----------------------*/,{ + /* + * Direction is DATA OUT. + */ + SCR_REG_REG (HF_REG, SCR_AND, (~HF_DATA_IN)), + 0, + SCR_COPY (4), + HADDR_1 (ccb_head.wlastp), + HADDR_1 (ccb_head.lastp), + SCR_JUMP, + PADDR_B(data_io_com), +#endif /* SYM_OPT_HANDLE_DIR_UNKNOWN */ + }/*-------------------------< ZERO >-----------------------------*/,{ SCR_DATA_ZERO, }/*-------------------------< SCRATCH >--------------------------*/,{ diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_fw2.h b/trunk/drivers/scsi/sym53c8xx_2/sym_fw2.h index 851f2706f220..7ea7151f5d1d 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_fw2.h +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_fw2.h @@ -191,6 +191,13 @@ struct SYM_FWB_SCR { u32 pm_wsr_handle [ 38]; u32 wsr_ma_helper [ 4]; +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + /* Unknown direction handling */ + u32 data_io [ 2]; + u32 data_io_in [ 2]; + u32 data_io_com [ 6]; + u32 data_io_out [ 8]; +#endif /* Data area */ u32 zero [ 1]; u32 scratch [ 1]; @@ -1831,6 +1838,51 @@ static struct SYM_FWB_SCR SYM_FWB_SCR = { SCR_JUMP, PADDR_A (dispatch), +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN +}/*-------------------------< DATA_IO >--------------------------*/,{ + /* + * We jump here if the data direction was unknown at the + * time we had to queue the command to the scripts processor. + * Pointers had been set as follow in this situation: + * savep --> DATA_IO + * lastp --> start pointer when DATA_IN + * wlastp --> start pointer when DATA_OUT + * This script sets savep and lastp according to the + * direction chosen by the target. + */ + SCR_JUMP ^ IFTRUE (WHEN (SCR_DATA_OUT)), + PADDR_B (data_io_out), +}/*-------------------------< DATA_IO_IN >-----------------------*/,{ + /* + * Direction is DATA IN. + */ + SCR_LOAD_REL (scratcha, 4), + offsetof (struct sym_ccb, phys.head.lastp), +}/*-------------------------< DATA_IO_COM >----------------------*/,{ + SCR_STORE_REL (scratcha, 4), + offsetof (struct sym_ccb, phys.head.savep), + + /* + * Jump to the SCRIPTS according to actual direction. + */ + SCR_LOAD_REL (temp, 4), + offsetof (struct sym_ccb, phys.head.savep), + SCR_RETURN, + 0, +}/*-------------------------< DATA_IO_OUT >----------------------*/,{ + /* + * Direction is DATA OUT. + */ + SCR_REG_REG (HF_REG, SCR_AND, (~HF_DATA_IN)), + 0, + SCR_LOAD_REL (scratcha, 4), + offsetof (struct sym_ccb, phys.head.wlastp), + SCR_STORE_REL (scratcha, 4), + offsetof (struct sym_ccb, phys.head.lastp), + SCR_JUMP, + PADDR_B(data_io_com), +#endif /* SYM_OPT_HANDLE_DIR_UNKNOWN */ + }/*-------------------------< ZERO >-----------------------------*/,{ SCR_DATA_ZERO, }/*-------------------------< SCRATCH >--------------------------*/,{ diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c b/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c index 1fffd2b3c654..d76766c3ce16 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c @@ -514,10 +514,9 @@ static inline int sym_setup_cdb(struct sym_hcb *np, struct scsi_cmnd *cmd, struc */ int sym_setup_data_and_start(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp) { + int dir; struct sym_tcb *tp = &np->target[cp->target]; struct sym_lcb *lp = sym_lp(tp, cp->lun); - u32 lastp, goalp; - int dir; /* * Build the CDB. @@ -535,47 +534,15 @@ int sym_setup_data_and_start(struct sym_hcb *np, struct scsi_cmnd *cmd, struct s sym_set_cam_status(cmd, DID_ERROR); goto out_abort; } - - /* - * No segments means no data. - */ - if (!cp->segments) - dir = DMA_NONE; } else { cp->data_len = 0; cp->segments = 0; } /* - * Set the data pointer. + * Set data pointers. */ - switch (dir) { - case DMA_BIDIRECTIONAL: - printk("%s: got DMA_BIDIRECTIONAL command", sym_name(np)); - sym_set_cam_status(cmd, DID_ERROR); - goto out_abort; - case DMA_TO_DEVICE: - goalp = SCRIPTA_BA(np, data_out2) + 8; - lastp = goalp - 8 - (cp->segments * (2*4)); - break; - case DMA_FROM_DEVICE: - cp->host_flags |= HF_DATA_IN; - goalp = SCRIPTA_BA(np, data_in2) + 8; - lastp = goalp - 8 - (cp->segments * (2*4)); - break; - case DMA_NONE: - default: - lastp = goalp = SCRIPTB_BA(np, no_data); - break; - } - - /* - * Set all pointers values needed by SCRIPTS. - */ - cp->phys.head.lastp = cpu_to_scr(lastp); - cp->phys.head.savep = cpu_to_scr(lastp); - cp->startp = cp->phys.head.savep; - cp->goalp = cpu_to_scr(goalp); + sym_setup_data_pointers(np, cp, dir); /* * When `#ifed 1', the code below makes the driver @@ -596,7 +563,10 @@ int sym_setup_data_and_start(struct sym_hcb *np, struct scsi_cmnd *cmd, struct s /* * activate this job. */ - sym_start_next_ccbs(np, lp, 2); + if (lp) + sym_start_next_ccbs(np, lp, 2); + else + sym_put_start_queue(np, cp); return 0; out_abort: @@ -1011,14 +981,15 @@ static int device_queue_depth(struct sym_hcb *np, int target, int lun) static int sym53c8xx_slave_alloc(struct scsi_device *sdev) { - struct sym_hcb *np = sym_get_hcb(sdev->host); - struct sym_tcb *tp = &np->target[sdev->id]; - struct sym_lcb *lp; + struct sym_hcb *np; + struct sym_tcb *tp; if (sdev->id >= SYM_CONF_MAX_TARGET || sdev->lun >= SYM_CONF_MAX_LUN) return -ENXIO; - tp->starget = sdev->sdev_target; + np = sym_get_hcb(sdev->host); + tp = &np->target[sdev->id]; + /* * Fail the device init if the device is flagged NOSCAN at BOOT in * the NVRAM. This may speed up boot and maintain coherency with @@ -1028,40 +999,34 @@ static int sym53c8xx_slave_alloc(struct scsi_device *sdev) * lun devices behave badly when asked for a non zero LUN. */ - if (tp->usrflags & SYM_SCAN_BOOT_DISABLED) { + if ((tp->usrflags & SYM_SCAN_BOOT_DISABLED) || + ((tp->usrflags & SYM_SCAN_LUNS_DISABLED) && sdev->lun != 0)) { tp->usrflags &= ~SYM_SCAN_BOOT_DISABLED; - starget_printk(KERN_INFO, tp->starget, - "Scan at boot disabled in NVRAM\n"); return -ENXIO; } - if (tp->usrflags & SYM_SCAN_LUNS_DISABLED) { - if (sdev->lun != 0) - return -ENXIO; - starget_printk(KERN_INFO, tp->starget, - "Multiple LUNs disabled in NVRAM\n"); - } - - lp = sym_alloc_lcb(np, sdev->id, sdev->lun); - if (!lp) - return -ENOMEM; - - spi_min_period(tp->starget) = tp->usr_period; - spi_max_width(tp->starget) = tp->usr_width; - + tp->starget = sdev->sdev_target; return 0; } /* * Linux entry point for device queue sizing. */ -static int sym53c8xx_slave_configure(struct scsi_device *sdev) +static int sym53c8xx_slave_configure(struct scsi_device *device) { - struct sym_hcb *np = sym_get_hcb(sdev->host); - struct sym_tcb *tp = &np->target[sdev->id]; - struct sym_lcb *lp = sym_lp(tp, sdev->lun); + struct sym_hcb *np = sym_get_hcb(device->host); + struct sym_tcb *tp = &np->target[device->id]; + struct sym_lcb *lp; int reqtags, depth_to_use; + /* + * Allocate the LCB if not yet. + * If it fail, we may well be in the sh*t. :) + */ + lp = sym_alloc_lcb(np, device->id, device->lun); + if (!lp) + return -ENOMEM; + /* * Get user flags. */ @@ -1073,10 +1038,10 @@ static int sym53c8xx_slave_configure(struct scsi_device *sdev) * Use at least 2. * Donnot use more than our maximum. */ - reqtags = device_queue_depth(np, sdev->id, sdev->lun); + reqtags = device_queue_depth(np, device->id, device->lun); if (reqtags > tp->usrtags) reqtags = tp->usrtags; - if (!sdev->tagged_supported) + if (!device->tagged_supported) reqtags = 0; #if 1 /* Avoid to locally queue commands for no good reasons */ if (reqtags > SYM_CONF_MAX_TAG) @@ -1085,30 +1050,19 @@ static int sym53c8xx_slave_configure(struct scsi_device *sdev) #else depth_to_use = (reqtags ? SYM_CONF_MAX_TAG : 2); #endif - scsi_adjust_queue_depth(sdev, - (sdev->tagged_supported ? + scsi_adjust_queue_depth(device, + (device->tagged_supported ? MSG_SIMPLE_TAG : 0), depth_to_use); lp->s.scdev_depth = depth_to_use; - sym_tune_dev_queuing(tp, sdev->lun, reqtags); + sym_tune_dev_queuing(tp, device->lun, reqtags); - if (!spi_initial_dv(sdev->sdev_target)) - spi_dv_device(sdev); + if (!spi_initial_dv(device->sdev_target)) + spi_dv_device(device); return 0; } -static void sym53c8xx_slave_destroy(struct scsi_device *sdev) -{ - struct sym_hcb *np = sym_get_hcb(sdev->host); - struct sym_lcb *lp = sym_lp(&np->target[sdev->id], sdev->lun); - - if (lp->itlq_tbl) - sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK * 4, "ITLQ_TBL"); - kfree(lp->cb_tags); - sym_mfree_dma(lp, sizeof(*lp), "LCB"); -} - /* * Linux entry point for info() function */ @@ -1543,7 +1497,7 @@ static int sym_setup_bus_dma_mask(struct sym_hcb *np) { #if SYM_CONF_DMA_ADDRESSING_MODE > 0 #if SYM_CONF_DMA_ADDRESSING_MODE == 1 -#define DMA_DAC_MASK DMA_40BIT_MASK +#define DMA_DAC_MASK 0x000000ffffffffffULL /* 40-bit */ #elif SYM_CONF_DMA_ADDRESSING_MODE == 2 #define DMA_DAC_MASK DMA_64BIT_MASK #endif @@ -1972,7 +1926,6 @@ static struct scsi_host_template sym2_template = { .queuecommand = sym53c8xx_queue_command, .slave_alloc = sym53c8xx_slave_alloc, .slave_configure = sym53c8xx_slave_configure, - .slave_destroy = sym53c8xx_slave_destroy, .eh_abort_handler = sym53c8xx_eh_abort_handler, .eh_device_reset_handler = sym53c8xx_eh_device_reset_handler, .eh_bus_reset_handler = sym53c8xx_eh_bus_reset_handler, @@ -2133,7 +2086,6 @@ static void sym2_set_dt(struct scsi_target *starget, int dt) tp->tgoal.check_nego = 1; } -#if 0 static void sym2_set_iu(struct scsi_target *starget, int iu) { struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); @@ -2159,7 +2111,7 @@ static void sym2_set_qas(struct scsi_target *starget, int qas) tp->tgoal.qas = 0; tp->tgoal.check_nego = 1; } -#endif + static struct spi_function_template sym2_transport_functions = { .set_offset = sym2_set_offset, @@ -2170,12 +2122,10 @@ static struct spi_function_template sym2_transport_functions = { .show_width = 1, .set_dt = sym2_set_dt, .show_dt = 1, -#if 0 .set_iu = sym2_set_iu, .show_iu = 1, .set_qas = sym2_set_qas, .show_qas = 1, -#endif .get_signalling = sym2_get_signalling, }; diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_glue.h b/trunk/drivers/scsi/sym53c8xx_2/sym_glue.h index cc92d0c70cd7..d3d52f14d7c0 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_glue.h +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_glue.h @@ -68,6 +68,7 @@ */ #define SYM_CONF_TIMER_INTERVAL ((HZ+1)/2) +#define SYM_OPT_HANDLE_DIR_UNKNOWN #define SYM_OPT_HANDLE_DEVICE_QUEUEING #define SYM_OPT_LIMIT_COMMAND_REORDERING @@ -267,5 +268,6 @@ void sym_xpt_async_bus_reset(struct sym_hcb *np); void sym_xpt_async_sent_bdr(struct sym_hcb *np, int target); int sym_setup_data_and_start (struct sym_hcb *np, struct scsi_cmnd *csio, struct sym_ccb *cp); void sym_log_bus_error(struct sym_hcb *np); +void sym_sniff_inquiry(struct sym_hcb *np, struct scsi_cmnd *cmd, int resid); #endif /* SYM_GLUE_H */ diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_hipd.c b/trunk/drivers/scsi/sym53c8xx_2/sym_hipd.c index 8260f040d39c..a7420cad4547 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_hipd.c +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_hipd.c @@ -40,7 +40,6 @@ #include #include /* for timeouts in units of HZ */ -#include #include "sym_glue.h" #include "sym_nvram.h" @@ -71,12 +70,32 @@ static void sym_printl_hex(u_char *p, int n) printf (".\n"); } +/* + * Print out the content of a SCSI message. + */ +static int sym_show_msg (u_char * msg) +{ + u_char i; + printf ("%x",*msg); + if (*msg==M_EXTENDED) { + for (i=1;i<8;i++) { + if (i-1>msg[1]) break; + printf ("-%x",msg[i]); + } + return (i+1); + } else if ((*msg & 0xf0) == 0x20) { + printf ("-%x",msg[1]); + return (2); + } + return (1); +} + static void sym_print_msg(struct sym_ccb *cp, char *label, u_char *msg) { sym_print_addr(cp->cmd, "%s: ", label); - spi_print_msg(msg); - printf("\n"); + sym_show_msg(msg); + printf(".\n"); } static void sym_print_nego_msg(struct sym_hcb *np, int target, char *label, u_char *msg) @@ -84,8 +103,8 @@ static void sym_print_nego_msg(struct sym_hcb *np, int target, char *label, u_ch struct sym_tcb *tp = &np->target[target]; dev_info(&tp->starget->dev, "%s: ", label); - spi_print_msg(msg); - printf("\n"); + sym_show_msg(msg); + printf(".\n"); } /* @@ -616,6 +635,29 @@ static __inline void sym_init_burst(struct sym_hcb *np, u_char bc) } } + +/* + * Print out the list of targets that have some flag disabled by user. + */ +static void sym_print_targets_flag(struct sym_hcb *np, int mask, char *msg) +{ + int cnt; + int i; + + for (cnt = 0, i = 0 ; i < SYM_CONF_MAX_TARGET ; i++) { + if (i == np->myaddr) + continue; + if (np->target[i].usrflags & mask) { + if (!cnt++) + printf("%s: %s disabled for targets", + sym_name(np), msg); + printf(" %d", i); + } + } + if (cnt) + printf(".\n"); +} + /* * Save initial settings of some IO registers. * Assumed to have been set by BIOS. @@ -920,7 +962,7 @@ static int sym_prepare_setting(struct Scsi_Host *shost, struct sym_hcb *np, stru tp->usrflags |= (SYM_DISC_ENABLED | SYM_TAGS_ENABLED); tp->usrtags = SYM_SETUP_MAX_TAG; - sym_nvram_setup_target(tp, i, nvram); + sym_nvram_setup_target(np, i, nvram); if (!tp->usrtags) tp->usrflags &= ~SYM_TAGS_ENABLED; @@ -963,6 +1005,13 @@ static int sym_prepare_setting(struct Scsi_Host *shost, struct sym_hcb *np, stru sym_name(np), np->rv_scntl3, np->rv_dmode, np->rv_dcntl, np->rv_ctest3, np->rv_ctest4, np->rv_ctest5); } + /* + * Let user be aware of targets that have some disable flags set. + */ + sym_print_targets_flag(np, SYM_SCAN_BOOT_DISABLED, "SCAN AT BOOT"); + if (sym_verbose) + sym_print_targets_flag(np, SYM_SCAN_LUNS_DISABLED, + "SCAN FOR LUNS"); return 0; } @@ -1356,6 +1405,7 @@ static void sym_check_goals(struct sym_hcb *np, struct scsi_target *starget, goal->iu = 0; goal->dt = 0; goal->qas = 0; + goal->period = 0; goal->offset = 0; return; } @@ -1415,8 +1465,7 @@ static int sym_prepare_nego(struct sym_hcb *np, struct sym_ccb *cp, u_char *msgp * Many devices implement PPR in a buggy way, so only use it if we * really want to. */ - if (goal->offset && - (goal->iu || goal->dt || goal->qas || (goal->period < 0xa))) { + if (goal->iu || goal->dt || goal->qas || (goal->period < 0xa)) { nego = NS_PPR; } else if (spi_width(starget) != goal->width) { nego = NS_WIDE; @@ -1474,7 +1523,7 @@ static int sym_prepare_nego(struct sym_hcb *np, struct sym_ccb *cp, u_char *msgp /* * Insert a job into the start queue. */ -static void sym_put_start_queue(struct sym_hcb *np, struct sym_ccb *cp) +void sym_put_start_queue(struct sym_hcb *np, struct sym_ccb *cp) { u_short qidx; @@ -3605,7 +3654,7 @@ static int sym_evaluate_dp(struct sym_hcb *np, struct sym_ccb *cp, u32 scr, int * If result is dp_sg = SYM_CONF_MAX_SG, then we are at the * end of the data. */ - tmp = scr_to_cpu(cp->goalp); + tmp = scr_to_cpu(sym_goalp(cp)); dp_sg = SYM_CONF_MAX_SG; if (dp_scr != tmp) dp_sg -= (tmp - 8 - (int)dp_scr) / (2*4); @@ -3712,7 +3761,7 @@ static void sym_modify_dp(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb * And our alchemy:) allows to easily calculate the data * script address we want to return for the next data phase. */ - dp_ret = cpu_to_scr(cp->goalp); + dp_ret = cpu_to_scr(sym_goalp(cp)); dp_ret = dp_ret - 8 - (SYM_CONF_MAX_SG - dp_sg) * (2*4); /* @@ -3808,7 +3857,7 @@ int sym_compute_residual(struct sym_hcb *np, struct sym_ccb *cp) * If all data has been transferred, * there is no residual. */ - if (cp->phys.head.lastp == cp->goalp) + if (cp->phys.head.lastp == sym_goalp(cp)) return resid; /* @@ -4615,7 +4664,30 @@ struct sym_ccb *sym_get_ccb (struct sym_hcb *np, struct scsi_cmnd *cmd, u_char t goto out; cp = sym_que_entry(qp, struct sym_ccb, link_ccbq); - { +#ifndef SYM_OPT_HANDLE_DEVICE_QUEUEING + /* + * If the LCB is not yet available and the LUN + * has been probed ok, try to allocate the LCB. + */ + if (!lp && sym_is_bit(tp->lun_map, ln)) { + lp = sym_alloc_lcb(np, tn, ln); + if (!lp) + goto out_free; + } +#endif + + /* + * If the LCB is not available here, then the + * logical unit is not yet discovered. For those + * ones only accept 1 SCSI IO per logical unit, + * since we cannot allow disconnections. + */ + if (!lp) { + if (!sym_is_bit(tp->busy0_map, ln)) + sym_set_bit(tp->busy0_map, ln); + else + goto out_free; + } else { /* * If we have been asked for a tagged command. */ @@ -4768,6 +4840,12 @@ void sym_free_ccb (struct sym_hcb *np, struct sym_ccb *cp) lp->head.resel_sa = cpu_to_scr(SCRIPTB_BA(np, resel_bad_lun)); } + /* + * Otherwise, we only accept 1 IO per LUN. + * Clear the bit that keeps track of this IO. + */ + else + sym_clr_bit(tp->busy0_map, cp->lun); /* * We donnot queue more than 1 ccb per target @@ -4919,7 +4997,20 @@ static void sym_init_tcb (struct sym_hcb *np, u_char tn) struct sym_lcb *sym_alloc_lcb (struct sym_hcb *np, u_char tn, u_char ln) { struct sym_tcb *tp = &np->target[tn]; - struct sym_lcb *lp = NULL; + struct sym_lcb *lp = sym_lp(tp, ln); + + /* + * Already done, just return. + */ + if (lp) + return lp; + + /* + * Donnot allow LUN control block + * allocation for not probed LUNs. + */ + if (!sym_is_bit(tp->lun_map, ln)) + return NULL; /* * Initialize the target control block if not yet. @@ -4991,7 +5082,13 @@ struct sym_lcb *sym_alloc_lcb (struct sym_hcb *np, u_char tn, u_char ln) lp->started_max = SYM_CONF_MAX_TASK; lp->started_limit = SYM_CONF_MAX_TASK; #endif - + /* + * If we are busy, count the IO. + */ + if (sym_is_bit(tp->busy0_map, ln)) { + lp->busy_itl = 1; + sym_clr_bit(tp->busy0_map, ln); + } fail: return lp; } @@ -5005,6 +5102,12 @@ static void sym_alloc_lcb_tags (struct sym_hcb *np, u_char tn, u_char ln) struct sym_lcb *lp = sym_lp(tp, ln); int i; + /* + * If LCB not available, try to allocate it. + */ + if (!lp && !(lp = sym_alloc_lcb(np, tn, ln))) + goto fail; + /* * Allocate the task table and and the tag allocation * circular buffer. We want both or none. @@ -5378,7 +5481,8 @@ if (resid) /* * Donnot start more than 1 command after an error. */ - sym_start_next_ccbs(np, lp, 1); + if (lp) + sym_start_next_ccbs(np, lp, 1); #endif } @@ -5416,12 +5520,18 @@ void sym_complete_ok (struct sym_hcb *np, struct sym_ccb *cp) tp = &np->target[cp->target]; lp = sym_lp(tp, cp->lun); + /* + * Assume device discovered on first success. + */ + if (!lp) + sym_set_bit(tp->lun_map, cp->lun); + /* * If all data have been transferred, given than no * extended error did occur, there is no residual. */ resid = 0; - if (cp->phys.head.lastp != cp->goalp) + if (cp->phys.head.lastp != sym_goalp(cp)) resid = sym_compute_residual(np, cp); /* @@ -5441,6 +5551,15 @@ if (resid) */ sym_set_cam_result_ok(cp, cmd, resid); +#ifdef SYM_OPT_SNIFF_INQUIRY + /* + * On standard INQUIRY response (EVPD and CmDt + * not set), sniff out device capabilities. + */ + if (cp->cdb_buf[0] == INQUIRY && !(cp->cdb_buf[1] & 0x3)) + sym_sniff_inquiry(np, cmd, resid); +#endif + #ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING /* * If max number of started ccbs had been reduced, @@ -5468,7 +5587,7 @@ if (resid) /* * Requeue a couple of awaiting scsi commands. */ - if (!sym_que_empty(&lp->waiting_ccbq)) + if (lp && !sym_que_empty(&lp->waiting_ccbq)) sym_start_next_ccbs(np, lp, 2); #endif /* @@ -5711,7 +5830,8 @@ void sym_hcb_free(struct sym_hcb *np) SYM_QUEHEAD *qp; struct sym_ccb *cp; struct sym_tcb *tp; - int target; + struct sym_lcb *lp; + int target, lun; if (np->scriptz0) sym_mfree_dma(np->scriptz0, np->scriptz_sz, "SCRIPTZ0"); @@ -5737,6 +5857,16 @@ void sym_hcb_free(struct sym_hcb *np) for (target = 0; target < SYM_CONF_MAX_TARGET ; target++) { tp = &np->target[target]; + for (lun = 0 ; lun < SYM_CONF_MAX_LUN ; lun++) { + lp = sym_lp(tp, lun); + if (!lp) + continue; + if (lp->itlq_tbl) + sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK*4, + "ITLQ_TBL"); + kfree(lp->cb_tags); + sym_mfree_dma(lp, sizeof(*lp), "LCB"); + } #if SYM_CONF_MAX_LUN > 1 kfree(tp->lunmp); #endif diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_hipd.h b/trunk/drivers/scsi/sym53c8xx_2/sym_hipd.h index 2456090bb241..3a264a408216 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_hipd.h +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_hipd.h @@ -48,6 +48,12 @@ * They may be defined in platform specific headers, if they * are useful. * + * SYM_OPT_HANDLE_DIR_UNKNOWN + * When this option is set, the SCRIPTS used by the driver + * are able to handle SCSI transfers with direction not + * supplied by user. + * (set for Linux-2.0.X) + * * SYM_OPT_HANDLE_DEVICE_QUEUEING * When this option is set, the driver will use a queue per * device and handle QUEUE FULL status requeuing internally. @@ -58,6 +64,7 @@ * (set for Linux) */ #if 0 +#define SYM_OPT_HANDLE_DIR_UNKNOWN #define SYM_OPT_HANDLE_DEVICE_QUEUEING #define SYM_OPT_LIMIT_COMMAND_REORDERING #endif @@ -409,6 +416,19 @@ struct sym_tcb { struct sym_lcb **lunmp; /* Other LCBs [1..MAX_LUN] */ #endif + /* + * Bitmap that tells about LUNs that succeeded at least + * 1 IO and therefore assumed to be a real device. + * Avoid useless allocation of the LCB structure. + */ + u32 lun_map[(SYM_CONF_MAX_LUN+31)/32]; + + /* + * Bitmap that tells about LUNs that haven't yet an LCB + * allocated (not discovered or LCB allocation failed). + */ + u32 busy0_map[(SYM_CONF_MAX_LUN+31)/32]; + #ifdef SYM_HAVE_STCB /* * O/S specific data structure. @@ -434,10 +454,8 @@ struct sym_tcb { * Other user settable limits and options. * These limits are read from the NVRAM if present. */ - unsigned char usrflags; - unsigned char usr_period; - unsigned char usr_width; - unsigned short usrtags; + u_char usrflags; + u_short usrtags; struct scsi_target *starget; }; @@ -654,6 +672,9 @@ struct sym_ccbh { */ u32 savep; /* Jump address to saved data pointer */ u32 lastp; /* SCRIPTS address at end of data */ +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + u32 wlastp; +#endif /* * Status fields. @@ -783,6 +804,9 @@ struct sym_ccb { SYM_QUEHEAD link_ccbq; /* Link to free/busy CCB queue */ u32 startp; /* Initial data pointer */ u32 goalp; /* Expected last data pointer */ +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + u32 wgoalp; +#endif int ext_sg; /* Extreme data pointer, used */ int ext_ofs; /* to calculate the residual. */ #ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING @@ -797,6 +821,12 @@ struct sym_ccb { #define CCB_BA(cp,lbl) cpu_to_scr(cp->ccb_ba + offsetof(struct sym_ccb, lbl)) +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN +#define sym_goalp(cp) ((cp->host_flags & HF_DATA_IN) ? cp->goalp : cp->wgoalp) +#else +#define sym_goalp(cp) (cp->goalp) +#endif + typedef struct device *m_pool_ident_t; /* @@ -1047,6 +1077,7 @@ char *sym_driver_name(void); void sym_print_xerr(struct scsi_cmnd *cmd, int x_status); int sym_reset_scsi_bus(struct sym_hcb *np, int enab_int); struct sym_chip *sym_lookup_chip_table(u_short device_id, u_char revision); +void sym_put_start_queue(struct sym_hcb *np, struct sym_ccb *cp); #ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING void sym_start_next_ccbs(struct sym_hcb *np, struct sym_lcb *lp, int maxn); #endif @@ -1104,6 +1135,71 @@ sym_build_sge(struct sym_hcb *np, struct sym_tblmove *data, u64 badd, int len) #error "Unsupported DMA addressing mode" #endif +/* + * Set up data pointers used by SCRIPTS. + * Called from O/S specific code. + */ +static inline void sym_setup_data_pointers(struct sym_hcb *np, + struct sym_ccb *cp, int dir) +{ + u32 lastp, goalp; + + /* + * No segments means no data. + */ + if (!cp->segments) + dir = DMA_NONE; + + /* + * Set the data pointer. + */ + switch(dir) { +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + case DMA_BIDIRECTIONAL: +#endif + case DMA_TO_DEVICE: + goalp = SCRIPTA_BA(np, data_out2) + 8; + lastp = goalp - 8 - (cp->segments * (2*4)); +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + cp->wgoalp = cpu_to_scr(goalp); + if (dir != DMA_BIDIRECTIONAL) + break; + cp->phys.head.wlastp = cpu_to_scr(lastp); + /* fall through */ +#else + break; +#endif + case DMA_FROM_DEVICE: + cp->host_flags |= HF_DATA_IN; + goalp = SCRIPTA_BA(np, data_in2) + 8; + lastp = goalp - 8 - (cp->segments * (2*4)); + break; + case DMA_NONE: + default: +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + cp->host_flags |= HF_DATA_IN; +#endif + lastp = goalp = SCRIPTB_BA(np, no_data); + break; + } + + /* + * Set all pointers values needed by SCRIPTS. + */ + cp->phys.head.lastp = cpu_to_scr(lastp); + cp->phys.head.savep = cpu_to_scr(lastp); + cp->startp = cp->phys.head.savep; + cp->goalp = cpu_to_scr(goalp); + +#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN + /* + * If direction is unknown, start at data_io. + */ + if (dir == DMA_BIDIRECTIONAL) + cp->phys.head.savep = cpu_to_scr(SCRIPTB_BA(np, data_io)); +#endif +} + /* * MEMORY ALLOCATOR. */ diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_malloc.c b/trunk/drivers/scsi/sym53c8xx_2/sym_malloc.c index 92bf9b14a7a2..a34d403ccc6c 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_malloc.c +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_malloc.c @@ -37,7 +37,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef __FreeBSD__ +#include +#else #include "sym_glue.h" +#endif /* * Simple power of two buddy-like generic allocator. diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_nvram.c b/trunk/drivers/scsi/sym53c8xx_2/sym_nvram.c index 15d69298ab6e..994b7566bcac 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_nvram.c +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_nvram.c @@ -92,32 +92,29 @@ void sym_nvram_setup_host(struct Scsi_Host *shost, struct sym_hcb *np, struct sy * Get target set-up from Symbios format NVRAM. */ static void -sym_Symbios_setup_target(struct sym_tcb *tp, int target, Symbios_nvram *nvram) +sym_Symbios_setup_target(struct sym_hcb *np, int target, Symbios_nvram *nvram) { + struct sym_tcb *tp = &np->target[target]; Symbios_target *tn = &nvram->target[target]; - if (!(tn->flags & SYMBIOS_QUEUE_TAGS_ENABLED)) - tp->usrtags = 0; + tp->usrtags = + (tn->flags & SYMBIOS_QUEUE_TAGS_ENABLED)? SYM_SETUP_MAX_TAG : 0; + if (!(tn->flags & SYMBIOS_DISCONNECT_ENABLE)) tp->usrflags &= ~SYM_DISC_ENABLED; if (!(tn->flags & SYMBIOS_SCAN_AT_BOOT_TIME)) tp->usrflags |= SYM_SCAN_BOOT_DISABLED; if (!(tn->flags & SYMBIOS_SCAN_LUNS)) tp->usrflags |= SYM_SCAN_LUNS_DISABLED; - tp->usr_period = (tn->sync_period + 3) / 4; - tp->usr_width = (tn->bus_width == 0x8) ? 0 : 1; } -static const unsigned char Tekram_sync[16] = { - 25, 31, 37, 43, 50, 62, 75, 125, 12, 15, 18, 21, 6, 7, 9, 10 -}; - /* * Get target set-up from Tekram format NVRAM. */ static void -sym_Tekram_setup_target(struct sym_tcb *tp, int target, Tekram_nvram *nvram) +sym_Tekram_setup_target(struct sym_hcb *np, int target, Tekram_nvram *nvram) { + struct sym_tcb *tp = &np->target[target]; struct Tekram_target *tn = &nvram->target[target]; if (tn->flags & TEKRAM_TAGGED_COMMANDS) { @@ -127,22 +124,22 @@ sym_Tekram_setup_target(struct sym_tcb *tp, int target, Tekram_nvram *nvram) if (tn->flags & TEKRAM_DISCONNECT_ENABLE) tp->usrflags |= SYM_DISC_ENABLED; - if (tn->flags & TEKRAM_SYNC_NEGO) - tp->usr_period = Tekram_sync[tn->sync_index & 0xf]; - tp->usr_width = (tn->flags & TEKRAM_WIDE_NEGO) ? 1 : 0; + /* If any device does not support parity, we will not use this option */ + if (!(tn->flags & TEKRAM_PARITY_CHECK)) + np->rv_scntl0 &= ~0x0a; /* SCSI parity checking disabled */ } /* * Get target setup from NVRAM. */ -void sym_nvram_setup_target(struct sym_tcb *tp, int target, struct sym_nvram *nvp) +void sym_nvram_setup_target(struct sym_hcb *np, int target, struct sym_nvram *nvp) { switch (nvp->type) { case SYM_SYMBIOS_NVRAM: - sym_Symbios_setup_target(tp, target, &nvp->data.Symbios); + sym_Symbios_setup_target(np, target, &nvp->data.Symbios); break; case SYM_TEKRAM_NVRAM: - sym_Tekram_setup_target(tp, target, &nvp->data.Tekram); + sym_Tekram_setup_target(np, target, &nvp->data.Tekram); break; default: break; diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_nvram.h b/trunk/drivers/scsi/sym53c8xx_2/sym_nvram.h index bdfbbb083b69..1538bede5277 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_nvram.h +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_nvram.h @@ -194,12 +194,12 @@ struct sym_nvram { #if SYM_CONF_NVRAM_SUPPORT void sym_nvram_setup_host(struct Scsi_Host *shost, struct sym_hcb *np, struct sym_nvram *nvram); -void sym_nvram_setup_target (struct sym_tcb *tp, int target, struct sym_nvram *nvp); +void sym_nvram_setup_target (struct sym_hcb *np, int target, struct sym_nvram *nvp); int sym_read_nvram (struct sym_device *np, struct sym_nvram *nvp); char *sym_nvram_type(struct sym_nvram *nvp); #else static inline void sym_nvram_setup_host(struct Scsi_Host *shost, struct sym_hcb *np, struct sym_nvram *nvram) { } -static inline void sym_nvram_setup_target(struct sym_tcb *tp, struct sym_nvram *nvram) { } +static inline void sym_nvram_setup_target(struct sym_hcb *np, struct sym_nvram *nvram) { } static inline int sym_read_nvram(struct sym_device *np, struct sym_nvram *nvp) { nvp->type = 0; diff --git a/trunk/drivers/scsi/sym53c8xx_comm.h b/trunk/drivers/scsi/sym53c8xx_comm.h new file mode 100644 index 000000000000..20ae2b17df58 --- /dev/null +++ b/trunk/drivers/scsi/sym53c8xx_comm.h @@ -0,0 +1,792 @@ +/****************************************************************************** +** High Performance device driver for the Symbios 53C896 controller. +** +** Copyright (C) 1998-2001 Gerard Roudier +** +** This driver also supports all the Symbios 53C8XX controller family, +** except 53C810 revisions < 16, 53C825 revisions < 16 and all +** revisions of 53C815 controllers. +** +** This driver is based on the Linux port of the FreeBSD ncr driver. +** +** Copyright (C) 1994 Wolfgang Stanglmeier +** +**----------------------------------------------------------------------------- +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +** +**----------------------------------------------------------------------------- +** +** The Linux port of the FreeBSD ncr driver has been achieved in +** november 1995 by: +** +** Gerard Roudier +** +** Being given that this driver originates from the FreeBSD version, and +** in order to keep synergy on both, any suggested enhancements and corrections +** received on Linux are automatically a potential candidate for the FreeBSD +** version. +** +** The original driver has been written for 386bsd and FreeBSD by +** Wolfgang Stanglmeier +** Stefan Esser +** +**----------------------------------------------------------------------------- +** +** Major contributions: +** -------------------- +** +** NVRAM detection and reading. +** Copyright (C) 1997 Richard Waltham +** +******************************************************************************* +*/ + +/*========================================================== +** +** Debugging tags +** +**========================================================== +*/ + +#define DEBUG_ALLOC (0x0001) +#define DEBUG_PHASE (0x0002) +#define DEBUG_QUEUE (0x0008) +#define DEBUG_RESULT (0x0010) +#define DEBUG_POINTER (0x0020) +#define DEBUG_SCRIPT (0x0040) +#define DEBUG_TINY (0x0080) +#define DEBUG_TIMING (0x0100) +#define DEBUG_NEGO (0x0200) +#define DEBUG_TAGS (0x0400) +#define DEBUG_SCATTER (0x0800) +#define DEBUG_IC (0x1000) + +/* +** Enable/Disable debug messages. +** Can be changed at runtime too. +*/ + +#ifdef SCSI_NCR_DEBUG_INFO_SUPPORT +static int ncr_debug = SCSI_NCR_DEBUG_FLAGS; + #define DEBUG_FLAGS ncr_debug +#else + #define DEBUG_FLAGS SCSI_NCR_DEBUG_FLAGS +#endif + +static inline struct list_head *ncr_list_pop(struct list_head *head) +{ + if (!list_empty(head)) { + struct list_head *elem = head->next; + + list_del(elem); + return elem; + } + + return NULL; +} + +#ifdef __sparc__ +#include +#endif + +/*========================================================== +** +** Simple power of two buddy-like allocator. +** +** This simple code is not intended to be fast, but to +** provide power of 2 aligned memory allocations. +** Since the SCRIPTS processor only supplies 8 bit +** arithmetic, this allocator allows simple and fast +** address calculations from the SCRIPTS code. +** In addition, cache line alignment is guaranteed for +** power of 2 cache line size. +** Enhanced in linux-2.3.44 to provide a memory pool +** per pcidev to support dynamic dma mapping. (I would +** have preferred a real bus astraction, btw). +** +**========================================================== +*/ + +#define MEMO_SHIFT 4 /* 16 bytes minimum memory chunk */ +#if PAGE_SIZE >= 8192 +#define MEMO_PAGE_ORDER 0 /* 1 PAGE maximum */ +#else +#define MEMO_PAGE_ORDER 1 /* 2 PAGES maximum */ +#endif +#define MEMO_FREE_UNUSED /* Free unused pages immediately */ +#define MEMO_WARN 1 +#define MEMO_GFP_FLAGS GFP_ATOMIC +#define MEMO_CLUSTER_SHIFT (PAGE_SHIFT+MEMO_PAGE_ORDER) +#define MEMO_CLUSTER_SIZE (1UL << MEMO_CLUSTER_SHIFT) +#define MEMO_CLUSTER_MASK (MEMO_CLUSTER_SIZE-1) + +typedef u_long m_addr_t; /* Enough bits to bit-hack addresses */ +typedef struct device *m_bush_t; /* Something that addresses DMAable */ + +typedef struct m_link { /* Link between free memory chunks */ + struct m_link *next; +} m_link_s; + +typedef struct m_vtob { /* Virtual to Bus address translation */ + struct m_vtob *next; + m_addr_t vaddr; + m_addr_t baddr; +} m_vtob_s; +#define VTOB_HASH_SHIFT 5 +#define VTOB_HASH_SIZE (1UL << VTOB_HASH_SHIFT) +#define VTOB_HASH_MASK (VTOB_HASH_SIZE-1) +#define VTOB_HASH_CODE(m) \ + ((((m_addr_t) (m)) >> MEMO_CLUSTER_SHIFT) & VTOB_HASH_MASK) + +typedef struct m_pool { /* Memory pool of a given kind */ + m_bush_t bush; + m_addr_t (*getp)(struct m_pool *); + void (*freep)(struct m_pool *, m_addr_t); + int nump; + m_vtob_s *(vtob[VTOB_HASH_SIZE]); + struct m_pool *next; + struct m_link h[PAGE_SHIFT-MEMO_SHIFT+MEMO_PAGE_ORDER+1]; +} m_pool_s; + +static void *___m_alloc(m_pool_s *mp, int size) +{ + int i = 0; + int s = (1 << MEMO_SHIFT); + int j; + m_addr_t a; + m_link_s *h = mp->h; + + if (size > (PAGE_SIZE << MEMO_PAGE_ORDER)) + return NULL; + + while (size > s) { + s <<= 1; + ++i; + } + + j = i; + while (!h[j].next) { + if (s == (PAGE_SIZE << MEMO_PAGE_ORDER)) { + h[j].next = (m_link_s *)mp->getp(mp); + if (h[j].next) + h[j].next->next = NULL; + break; + } + ++j; + s <<= 1; + } + a = (m_addr_t) h[j].next; + if (a) { + h[j].next = h[j].next->next; + while (j > i) { + j -= 1; + s >>= 1; + h[j].next = (m_link_s *) (a+s); + h[j].next->next = NULL; + } + } +#ifdef DEBUG + printk("___m_alloc(%d) = %p\n", size, (void *) a); +#endif + return (void *) a; +} + +static void ___m_free(m_pool_s *mp, void *ptr, int size) +{ + int i = 0; + int s = (1 << MEMO_SHIFT); + m_link_s *q; + m_addr_t a, b; + m_link_s *h = mp->h; + +#ifdef DEBUG + printk("___m_free(%p, %d)\n", ptr, size); +#endif + + if (size > (PAGE_SIZE << MEMO_PAGE_ORDER)) + return; + + while (size > s) { + s <<= 1; + ++i; + } + + a = (m_addr_t) ptr; + + while (1) { +#ifdef MEMO_FREE_UNUSED + if (s == (PAGE_SIZE << MEMO_PAGE_ORDER)) { + mp->freep(mp, a); + break; + } +#endif + b = a ^ s; + q = &h[i]; + while (q->next && q->next != (m_link_s *) b) { + q = q->next; + } + if (!q->next) { + ((m_link_s *) a)->next = h[i].next; + h[i].next = (m_link_s *) a; + break; + } + q->next = q->next->next; + a = a & b; + s <<= 1; + ++i; + } +} + +static DEFINE_SPINLOCK(ncr53c8xx_lock); + +static void *__m_calloc2(m_pool_s *mp, int size, char *name, int uflags) +{ + void *p; + + p = ___m_alloc(mp, size); + + if (DEBUG_FLAGS & DEBUG_ALLOC) + printk ("new %-10s[%4d] @%p.\n", name, size, p); + + if (p) + memset(p, 0, size); + else if (uflags & MEMO_WARN) + printk (NAME53C8XX ": failed to allocate %s[%d]\n", name, size); + + return p; +} + +#define __m_calloc(mp, s, n) __m_calloc2(mp, s, n, MEMO_WARN) + +static void __m_free(m_pool_s *mp, void *ptr, int size, char *name) +{ + if (DEBUG_FLAGS & DEBUG_ALLOC) + printk ("freeing %-10s[%4d] @%p.\n", name, size, ptr); + + ___m_free(mp, ptr, size); + +} + +/* + * With pci bus iommu support, we use a default pool of unmapped memory + * for memory we donnot need to DMA from/to and one pool per pcidev for + * memory accessed by the PCI chip. `mp0' is the default not DMAable pool. + */ + +static m_addr_t ___mp0_getp(m_pool_s *mp) +{ + m_addr_t m = __get_free_pages(MEMO_GFP_FLAGS, MEMO_PAGE_ORDER); + if (m) + ++mp->nump; + return m; +} + +static void ___mp0_freep(m_pool_s *mp, m_addr_t m) +{ + free_pages(m, MEMO_PAGE_ORDER); + --mp->nump; +} + +static m_pool_s mp0 = {NULL, ___mp0_getp, ___mp0_freep}; + +/* + * DMAable pools. + */ + +/* + * With pci bus iommu support, we maintain one pool per pcidev and a + * hashed reverse table for virtual to bus physical address translations. + */ +static m_addr_t ___dma_getp(m_pool_s *mp) +{ + m_addr_t vp; + m_vtob_s *vbp; + + vbp = __m_calloc(&mp0, sizeof(*vbp), "VTOB"); + if (vbp) { + dma_addr_t daddr; + vp = (m_addr_t) dma_alloc_coherent(mp->bush, + PAGE_SIZE<vaddr = vp; + vbp->baddr = daddr; + vbp->next = mp->vtob[hc]; + mp->vtob[hc] = vbp; + ++mp->nump; + return vp; + } + } + if (vbp) + __m_free(&mp0, vbp, sizeof(*vbp), "VTOB"); + return 0; +} + +static void ___dma_freep(m_pool_s *mp, m_addr_t m) +{ + m_vtob_s **vbpp, *vbp; + int hc = VTOB_HASH_CODE(m); + + vbpp = &mp->vtob[hc]; + while (*vbpp && (*vbpp)->vaddr != m) + vbpp = &(*vbpp)->next; + if (*vbpp) { + vbp = *vbpp; + *vbpp = (*vbpp)->next; + dma_free_coherent(mp->bush, PAGE_SIZE<vaddr, (dma_addr_t)vbp->baddr); + __m_free(&mp0, vbp, sizeof(*vbp), "VTOB"); + --mp->nump; + } +} + +static inline m_pool_s *___get_dma_pool(m_bush_t bush) +{ + m_pool_s *mp; + for (mp = mp0.next; mp && mp->bush != bush; mp = mp->next); + return mp; +} + +static m_pool_s *___cre_dma_pool(m_bush_t bush) +{ + m_pool_s *mp; + mp = __m_calloc(&mp0, sizeof(*mp), "MPOOL"); + if (mp) { + memset(mp, 0, sizeof(*mp)); + mp->bush = bush; + mp->getp = ___dma_getp; + mp->freep = ___dma_freep; + mp->next = mp0.next; + mp0.next = mp; + } + return mp; +} + +static void ___del_dma_pool(m_pool_s *p) +{ + struct m_pool **pp = &mp0.next; + + while (*pp && *pp != p) + pp = &(*pp)->next; + if (*pp) { + *pp = (*pp)->next; + __m_free(&mp0, p, sizeof(*p), "MPOOL"); + } +} + +static void *__m_calloc_dma(m_bush_t bush, int size, char *name) +{ + u_long flags; + struct m_pool *mp; + void *m = NULL; + + spin_lock_irqsave(&ncr53c8xx_lock, flags); + mp = ___get_dma_pool(bush); + if (!mp) + mp = ___cre_dma_pool(bush); + if (mp) + m = __m_calloc(mp, size, name); + if (mp && !mp->nump) + ___del_dma_pool(mp); + spin_unlock_irqrestore(&ncr53c8xx_lock, flags); + + return m; +} + +static void __m_free_dma(m_bush_t bush, void *m, int size, char *name) +{ + u_long flags; + struct m_pool *mp; + + spin_lock_irqsave(&ncr53c8xx_lock, flags); + mp = ___get_dma_pool(bush); + if (mp) + __m_free(mp, m, size, name); + if (mp && !mp->nump) + ___del_dma_pool(mp); + spin_unlock_irqrestore(&ncr53c8xx_lock, flags); +} + +static m_addr_t __vtobus(m_bush_t bush, void *m) +{ + u_long flags; + m_pool_s *mp; + int hc = VTOB_HASH_CODE(m); + m_vtob_s *vp = NULL; + m_addr_t a = ((m_addr_t) m) & ~MEMO_CLUSTER_MASK; + + spin_lock_irqsave(&ncr53c8xx_lock, flags); + mp = ___get_dma_pool(bush); + if (mp) { + vp = mp->vtob[hc]; + while (vp && (m_addr_t) vp->vaddr != a) + vp = vp->next; + } + spin_unlock_irqrestore(&ncr53c8xx_lock, flags); + return vp ? vp->baddr + (((m_addr_t) m) - a) : 0; +} + +#define _m_calloc_dma(np, s, n) __m_calloc_dma(np->dev, s, n) +#define _m_free_dma(np, p, s, n) __m_free_dma(np->dev, p, s, n) +#define m_calloc_dma(s, n) _m_calloc_dma(np, s, n) +#define m_free_dma(p, s, n) _m_free_dma(np, p, s, n) +#define _vtobus(np, p) __vtobus(np->dev, p) +#define vtobus(p) _vtobus(np, p) + +/* + * Deal with DMA mapping/unmapping. + */ + +/* To keep track of the dma mapping (sg/single) that has been set */ +#define __data_mapped SCp.phase +#define __data_mapping SCp.have_data_in + +static void __unmap_scsi_data(struct device *dev, struct scsi_cmnd *cmd) +{ + switch(cmd->__data_mapped) { + case 2: + dma_unmap_sg(dev, cmd->buffer, cmd->use_sg, + cmd->sc_data_direction); + break; + case 1: + dma_unmap_single(dev, cmd->__data_mapping, + cmd->request_bufflen, + cmd->sc_data_direction); + break; + } + cmd->__data_mapped = 0; +} + +static u_long __map_scsi_single_data(struct device *dev, struct scsi_cmnd *cmd) +{ + dma_addr_t mapping; + + if (cmd->request_bufflen == 0) + return 0; + + mapping = dma_map_single(dev, cmd->request_buffer, + cmd->request_bufflen, + cmd->sc_data_direction); + cmd->__data_mapped = 1; + cmd->__data_mapping = mapping; + + return mapping; +} + +static int __map_scsi_sg_data(struct device *dev, struct scsi_cmnd *cmd) +{ + int use_sg; + + if (cmd->use_sg == 0) + return 0; + + use_sg = dma_map_sg(dev, cmd->buffer, cmd->use_sg, + cmd->sc_data_direction); + cmd->__data_mapped = 2; + cmd->__data_mapping = use_sg; + + return use_sg; +} + +#define unmap_scsi_data(np, cmd) __unmap_scsi_data(np->dev, cmd) +#define map_scsi_single_data(np, cmd) __map_scsi_single_data(np->dev, cmd) +#define map_scsi_sg_data(np, cmd) __map_scsi_sg_data(np->dev, cmd) + +/*========================================================== +** +** Driver setup. +** +** This structure is initialized from linux config +** options. It can be overridden at boot-up by the boot +** command line. +** +**========================================================== +*/ +static struct ncr_driver_setup + driver_setup = SCSI_NCR_DRIVER_SETUP; + +#ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT +static struct ncr_driver_setup + driver_safe_setup __initdata = SCSI_NCR_DRIVER_SAFE_SETUP; +#endif + +#define initverbose (driver_setup.verbose) +#define bootverbose (np->verbose) + + +/*=================================================================== +** +** Driver setup from the boot command line +** +**=================================================================== +*/ + +#ifdef MODULE +#define ARG_SEP ' ' +#else +#define ARG_SEP ',' +#endif + +#define OPT_TAGS 1 +#define OPT_MASTER_PARITY 2 +#define OPT_SCSI_PARITY 3 +#define OPT_DISCONNECTION 4 +#define OPT_SPECIAL_FEATURES 5 +#define OPT_UNUSED_1 6 +#define OPT_FORCE_SYNC_NEGO 7 +#define OPT_REVERSE_PROBE 8 +#define OPT_DEFAULT_SYNC 9 +#define OPT_VERBOSE 10 +#define OPT_DEBUG 11 +#define OPT_BURST_MAX 12 +#define OPT_LED_PIN 13 +#define OPT_MAX_WIDE 14 +#define OPT_SETTLE_DELAY 15 +#define OPT_DIFF_SUPPORT 16 +#define OPT_IRQM 17 +#define OPT_PCI_FIX_UP 18 +#define OPT_BUS_CHECK 19 +#define OPT_OPTIMIZE 20 +#define OPT_RECOVERY 21 +#define OPT_SAFE_SETUP 22 +#define OPT_USE_NVRAM 23 +#define OPT_EXCLUDE 24 +#define OPT_HOST_ID 25 + +#ifdef SCSI_NCR_IARB_SUPPORT +#define OPT_IARB 26 +#endif + +static char setup_token[] __initdata = + "tags:" "mpar:" + "spar:" "disc:" + "specf:" "ultra:" + "fsn:" "revprob:" + "sync:" "verb:" + "debug:" "burst:" + "led:" "wide:" + "settle:" "diff:" + "irqm:" "pcifix:" + "buschk:" "optim:" + "recovery:" + "safe:" "nvram:" + "excl:" "hostid:" +#ifdef SCSI_NCR_IARB_SUPPORT + "iarb:" +#endif + ; /* DONNOT REMOVE THIS ';' */ + +#ifdef MODULE +#define ARG_SEP ' ' +#else +#define ARG_SEP ',' +#endif + +static int __init get_setup_token(char *p) +{ + char *cur = setup_token; + char *pc; + int i = 0; + + while (cur != NULL && (pc = strchr(cur, ':')) != NULL) { + ++pc; + ++i; + if (!strncmp(p, cur, pc - cur)) + return i; + cur = pc; + } + return 0; +} + + +static int __init sym53c8xx__setup(char *str) +{ +#ifdef SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT + char *cur = str; + char *pc, *pv; + int i, val, c; + int xi = 0; + + while (cur != NULL && (pc = strchr(cur, ':')) != NULL) { + char *pe; + + val = 0; + pv = pc; + c = *++pv; + + if (c == 'n') + val = 0; + else if (c == 'y') + val = 1; + else + val = (int) simple_strtoul(pv, &pe, 0); + + switch (get_setup_token(cur)) { + case OPT_TAGS: + driver_setup.default_tags = val; + if (pe && *pe == '/') { + i = 0; + while (*pe && *pe != ARG_SEP && + i < sizeof(driver_setup.tag_ctrl)-1) { + driver_setup.tag_ctrl[i++] = *pe++; + } + driver_setup.tag_ctrl[i] = '\0'; + } + break; + case OPT_MASTER_PARITY: + driver_setup.master_parity = val; + break; + case OPT_SCSI_PARITY: + driver_setup.scsi_parity = val; + break; + case OPT_DISCONNECTION: + driver_setup.disconnection = val; + break; + case OPT_SPECIAL_FEATURES: + driver_setup.special_features = val; + break; + case OPT_FORCE_SYNC_NEGO: + driver_setup.force_sync_nego = val; + break; + case OPT_REVERSE_PROBE: + driver_setup.reverse_probe = val; + break; + case OPT_DEFAULT_SYNC: + driver_setup.default_sync = val; + break; + case OPT_VERBOSE: + driver_setup.verbose = val; + break; + case OPT_DEBUG: + driver_setup.debug = val; + break; + case OPT_BURST_MAX: + driver_setup.burst_max = val; + break; + case OPT_LED_PIN: + driver_setup.led_pin = val; + break; + case OPT_MAX_WIDE: + driver_setup.max_wide = val? 1:0; + break; + case OPT_SETTLE_DELAY: + driver_setup.settle_delay = val; + break; + case OPT_DIFF_SUPPORT: + driver_setup.diff_support = val; + break; + case OPT_IRQM: + driver_setup.irqm = val; + break; + case OPT_PCI_FIX_UP: + driver_setup.pci_fix_up = val; + break; + case OPT_BUS_CHECK: + driver_setup.bus_check = val; + break; + case OPT_OPTIMIZE: + driver_setup.optimize = val; + break; + case OPT_RECOVERY: + driver_setup.recovery = val; + break; + case OPT_USE_NVRAM: + driver_setup.use_nvram = val; + break; + case OPT_SAFE_SETUP: + memcpy(&driver_setup, &driver_safe_setup, + sizeof(driver_setup)); + break; + case OPT_EXCLUDE: + if (xi < SCSI_NCR_MAX_EXCLUDES) + driver_setup.excludes[xi++] = val; + break; + case OPT_HOST_ID: + driver_setup.host_id = val; + break; +#ifdef SCSI_NCR_IARB_SUPPORT + case OPT_IARB: + driver_setup.iarb = val; + break; +#endif + default: + printk("sym53c8xx_setup: unexpected boot option '%.*s' ignored\n", (int)(pc-cur+1), cur); + break; + } + + if ((cur = strchr(cur, ARG_SEP)) != NULL) + ++cur; + } +#endif /* SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT */ + return 1; +} + +/*=================================================================== +** +** Get device queue depth from boot command line. +** +**=================================================================== +*/ +#define DEF_DEPTH (driver_setup.default_tags) +#define ALL_TARGETS -2 +#define NO_TARGET -1 +#define ALL_LUNS -2 +#define NO_LUN -1 + +static int device_queue_depth(int unit, int target, int lun) +{ + int c, h, t, u, v; + char *p = driver_setup.tag_ctrl; + char *ep; + + h = -1; + t = NO_TARGET; + u = NO_LUN; + while ((c = *p++) != 0) { + v = simple_strtoul(p, &ep, 0); + switch(c) { + case '/': + ++h; + t = ALL_TARGETS; + u = ALL_LUNS; + break; + case 't': + if (t != target) + t = (target == v) ? v : NO_TARGET; + u = ALL_LUNS; + break; + case 'u': + if (u != lun) + u = (lun == v) ? v : NO_LUN; + break; + case 'q': + if (h == unit && + (t == ALL_TARGETS || t == target) && + (u == ALL_LUNS || u == lun)) + return v; + break; + case '-': + t = ALL_TARGETS; + u = ALL_LUNS; + break; + default: + break; + } + p = ep; + } + return DEF_DEPTH; +} diff --git a/trunk/drivers/scsi/sym53c8xx_defs.h b/trunk/drivers/scsi/sym53c8xx_defs.h new file mode 100644 index 000000000000..139cd0e12e62 --- /dev/null +++ b/trunk/drivers/scsi/sym53c8xx_defs.h @@ -0,0 +1,1320 @@ +/****************************************************************************** +** High Performance device driver for the Symbios 53C896 controller. +** +** Copyright (C) 1998-2001 Gerard Roudier +** +** This driver also supports all the Symbios 53C8XX controller family, +** except 53C810 revisions < 16, 53C825 revisions < 16 and all +** revisions of 53C815 controllers. +** +** This driver is based on the Linux port of the FreeBSD ncr driver. +** +** Copyright (C) 1994 Wolfgang Stanglmeier +** +**----------------------------------------------------------------------------- +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +** +**----------------------------------------------------------------------------- +** +** The Linux port of the FreeBSD ncr driver has been achieved in +** november 1995 by: +** +** Gerard Roudier +** +** Being given that this driver originates from the FreeBSD version, and +** in order to keep synergy on both, any suggested enhancements and corrections +** received on Linux are automatically a potential candidate for the FreeBSD +** version. +** +** The original driver has been written for 386bsd and FreeBSD by +** Wolfgang Stanglmeier +** Stefan Esser +** +**----------------------------------------------------------------------------- +** +** Major contributions: +** -------------------- +** +** NVRAM detection and reading. +** Copyright (C) 1997 Richard Waltham +** +** Added support for MIPS big endian systems. +** Carsten Langgaard, carstenl@mips.com +** Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. +** +** Added support for HP PARISC big endian systems. +** Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. +** +******************************************************************************* +*/ + +#ifndef SYM53C8XX_DEFS_H +#define SYM53C8XX_DEFS_H + +#include + +/* +** If you want a driver as small as possible, donnot define the +** following options. +*/ +#define SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT +#define SCSI_NCR_DEBUG_INFO_SUPPORT + +/* +** To disable integrity checking, do not define the +** following option. +*/ +#ifdef CONFIG_SCSI_NCR53C8XX_INTEGRITY_CHECK +# define SCSI_NCR_ENABLE_INTEGRITY_CHECK +#endif + +/* --------------------------------------------------------------------- +** Take into account kernel configured parameters. +** Most of these options can be overridden at startup by a command line. +** --------------------------------------------------------------------- +*/ + +/* + * For Ultra2 and Ultra3 SCSI support option, use special features. + * + * Value (default) means: + * bit 0 : all features enabled, except: + * bit 1 : PCI Write And Invalidate. + * bit 2 : Data Phase Mismatch handling from SCRIPTS. + * + * Use boot options ncr53c8xx=specf:1 if you want all chip features to be + * enabled by the driver. + */ +#define SCSI_NCR_SETUP_SPECIAL_FEATURES (3) + +#define SCSI_NCR_MAX_SYNC (80) + +/* + * Allow tags from 2 to 256, default 8 + */ +#ifdef CONFIG_SCSI_NCR53C8XX_MAX_TAGS +#if CONFIG_SCSI_NCR53C8XX_MAX_TAGS < 2 +#define SCSI_NCR_MAX_TAGS (2) +#elif CONFIG_SCSI_NCR53C8XX_MAX_TAGS > 256 +#define SCSI_NCR_MAX_TAGS (256) +#else +#define SCSI_NCR_MAX_TAGS CONFIG_SCSI_NCR53C8XX_MAX_TAGS +#endif +#else +#define SCSI_NCR_MAX_TAGS (8) +#endif + +/* + * Allow tagged command queuing support if configured with default number + * of tags set to max (see above). + */ +#ifdef CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS +#define SCSI_NCR_SETUP_DEFAULT_TAGS CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS +#elif defined CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE +#define SCSI_NCR_SETUP_DEFAULT_TAGS SCSI_NCR_MAX_TAGS +#else +#define SCSI_NCR_SETUP_DEFAULT_TAGS (0) +#endif + +/* + * Immediate arbitration + */ +#if defined(CONFIG_SCSI_NCR53C8XX_IARB) +#define SCSI_NCR_IARB_SUPPORT +#endif + +/* + * Sync transfer frequency at startup. + * Allow from 5Mhz to 80Mhz default 20 Mhz. + */ +#ifndef CONFIG_SCSI_NCR53C8XX_SYNC +#define CONFIG_SCSI_NCR53C8XX_SYNC (20) +#elif CONFIG_SCSI_NCR53C8XX_SYNC > SCSI_NCR_MAX_SYNC +#undef CONFIG_SCSI_NCR53C8XX_SYNC +#define CONFIG_SCSI_NCR53C8XX_SYNC SCSI_NCR_MAX_SYNC +#endif + +#if CONFIG_SCSI_NCR53C8XX_SYNC == 0 +#define SCSI_NCR_SETUP_DEFAULT_SYNC (255) +#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 5 +#define SCSI_NCR_SETUP_DEFAULT_SYNC (50) +#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 20 +#define SCSI_NCR_SETUP_DEFAULT_SYNC (250/(CONFIG_SCSI_NCR53C8XX_SYNC)) +#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 33 +#define SCSI_NCR_SETUP_DEFAULT_SYNC (11) +#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 40 +#define SCSI_NCR_SETUP_DEFAULT_SYNC (10) +#else +#define SCSI_NCR_SETUP_DEFAULT_SYNC (9) +#endif + +/* + * Disallow disconnections at boot-up + */ +#ifdef CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT +#define SCSI_NCR_SETUP_DISCONNECTION (0) +#else +#define SCSI_NCR_SETUP_DISCONNECTION (1) +#endif + +/* + * Force synchronous negotiation for all targets + */ +#ifdef CONFIG_SCSI_NCR53C8XX_FORCE_SYNC_NEGO +#define SCSI_NCR_SETUP_FORCE_SYNC_NEGO (1) +#else +#define SCSI_NCR_SETUP_FORCE_SYNC_NEGO (0) +#endif + +/* + * Disable master parity checking (flawed hardwares need that) + */ +#ifdef CONFIG_SCSI_NCR53C8XX_DISABLE_MPARITY_CHECK +#define SCSI_NCR_SETUP_MASTER_PARITY (0) +#else +#define SCSI_NCR_SETUP_MASTER_PARITY (1) +#endif + +/* + * Disable scsi parity checking (flawed devices may need that) + */ +#ifdef CONFIG_SCSI_NCR53C8XX_DISABLE_PARITY_CHECK +#define SCSI_NCR_SETUP_SCSI_PARITY (0) +#else +#define SCSI_NCR_SETUP_SCSI_PARITY (1) +#endif + +/* + * Settle time after reset at boot-up + */ +#define SCSI_NCR_SETUP_SETTLE_TIME (2) + +/* +** Bridge quirks work-around option defaulted to 1. +*/ +#ifndef SCSI_NCR_PCIQ_WORK_AROUND_OPT +#define SCSI_NCR_PCIQ_WORK_AROUND_OPT 1 +#endif + +/* +** Work-around common bridge misbehaviour. +** +** - Do not flush posted writes in the opposite +** direction on read. +** - May reorder DMA writes to memory. +** +** This option should not affect performances +** significantly, so it is the default. +*/ +#if SCSI_NCR_PCIQ_WORK_AROUND_OPT == 1 +#define SCSI_NCR_PCIQ_MAY_NOT_FLUSH_PW_UPSTREAM +#define SCSI_NCR_PCIQ_MAY_REORDER_WRITES +#define SCSI_NCR_PCIQ_MAY_MISS_COMPLETIONS + +/* +** Same as option 1, but also deal with +** misconfigured interrupts. +** +** - Edge triggerred instead of level sensitive. +** - No interrupt line connected. +** - IRQ number misconfigured. +** +** If no interrupt is delivered, the driver will +** catch the interrupt conditions 10 times per +** second. No need to say that this option is +** not recommended. +*/ +#elif SCSI_NCR_PCIQ_WORK_AROUND_OPT == 2 +#define SCSI_NCR_PCIQ_MAY_NOT_FLUSH_PW_UPSTREAM +#define SCSI_NCR_PCIQ_MAY_REORDER_WRITES +#define SCSI_NCR_PCIQ_MAY_MISS_COMPLETIONS +#define SCSI_NCR_PCIQ_BROKEN_INTR + +/* +** Some bridge designers decided to flush +** everything prior to deliver the interrupt. +** This option tries to deal with such a +** behaviour. +*/ +#elif SCSI_NCR_PCIQ_WORK_AROUND_OPT == 3 +#define SCSI_NCR_PCIQ_SYNC_ON_INTR +#endif + +/* +** Other parameters not configurable with "make config" +** Avoid to change these constants, unless you know what you are doing. +*/ + +#define SCSI_NCR_ALWAYS_SIMPLE_TAG +#define SCSI_NCR_MAX_SCATTER (127) +#define SCSI_NCR_MAX_TARGET (16) + +/* +** Compute some desirable value for CAN_QUEUE +** and CMD_PER_LUN. +** The driver will use lower values if these +** ones appear to be too large. +*/ +#define SCSI_NCR_CAN_QUEUE (8*SCSI_NCR_MAX_TAGS + 2*SCSI_NCR_MAX_TARGET) +#define SCSI_NCR_CMD_PER_LUN (SCSI_NCR_MAX_TAGS) + +#define SCSI_NCR_SG_TABLESIZE (SCSI_NCR_MAX_SCATTER) +#define SCSI_NCR_TIMER_INTERVAL (HZ) + +#if 1 /* defined CONFIG_SCSI_MULTI_LUN */ +#define SCSI_NCR_MAX_LUN (16) +#else +#define SCSI_NCR_MAX_LUN (1) +#endif + +/* + * IO functions definition for big/little endian CPU support. + * For now, the NCR is only supported in little endian addressing mode, + */ + +#ifdef __BIG_ENDIAN + +#define inw_l2b inw +#define inl_l2b inl +#define outw_b2l outw +#define outl_b2l outl + +#define readb_raw readb +#define writeb_raw writeb + +#if defined(SCSI_NCR_BIG_ENDIAN) +#define readw_l2b __raw_readw +#define readl_l2b __raw_readl +#define writew_b2l __raw_writew +#define writel_b2l __raw_writel +#define readw_raw __raw_readw +#define readl_raw __raw_readl +#define writew_raw __raw_writew +#define writel_raw __raw_writel +#else /* Other big-endian */ +#define readw_l2b readw +#define readl_l2b readl +#define writew_b2l writew +#define writel_b2l writel +#define readw_raw readw +#define readl_raw readl +#define writew_raw writew +#define writel_raw writel +#endif + +#else /* little endian */ + +#define inw_raw inw +#define inl_raw inl +#define outw_raw outw +#define outl_raw outl + +#define readb_raw readb +#define readw_raw readw +#define readl_raw readl +#define writeb_raw writeb +#define writew_raw writew +#define writel_raw writel + +#endif + +#if !defined(__hppa__) && !defined(__mips__) +#ifdef SCSI_NCR_BIG_ENDIAN +#error "The NCR in BIG ENDIAN addressing mode is not (yet) supported" +#endif +#endif + +#define MEMORY_BARRIER() mb() + + +/* + * If the NCR uses big endian addressing mode over the + * PCI, actual io register addresses for byte and word + * accesses must be changed according to lane routing. + * Btw, ncr_offb() and ncr_offw() macros only apply to + * constants and so donnot generate bloated code. + */ + +#if defined(SCSI_NCR_BIG_ENDIAN) + +#define ncr_offb(o) (((o)&~3)+((~((o)&3))&3)) +#define ncr_offw(o) (((o)&~3)+((~((o)&3))&2)) + +#else + +#define ncr_offb(o) (o) +#define ncr_offw(o) (o) + +#endif + +/* + * If the CPU and the NCR use same endian-ness addressing, + * no byte reordering is needed for script patching. + * Macro cpu_to_scr() is to be used for script patching. + * Macro scr_to_cpu() is to be used for getting a DWORD + * from the script. + */ + +#if defined(__BIG_ENDIAN) && !defined(SCSI_NCR_BIG_ENDIAN) + +#define cpu_to_scr(dw) cpu_to_le32(dw) +#define scr_to_cpu(dw) le32_to_cpu(dw) + +#elif defined(__LITTLE_ENDIAN) && defined(SCSI_NCR_BIG_ENDIAN) + +#define cpu_to_scr(dw) cpu_to_be32(dw) +#define scr_to_cpu(dw) be32_to_cpu(dw) + +#else + +#define cpu_to_scr(dw) (dw) +#define scr_to_cpu(dw) (dw) + +#endif + +/* + * Access to the controller chip. + * + * If the CPU and the NCR use same endian-ness addressing, + * no byte reordering is needed for accessing chip io + * registers. Functions suffixed by '_raw' are assumed + * to access the chip over the PCI without doing byte + * reordering. Functions suffixed by '_l2b' are + * assumed to perform little-endian to big-endian byte + * reordering, those suffixed by '_b2l' blah, blah, + * blah, ... + */ + +/* + * MEMORY mapped IO input / output + */ + +#define INB_OFF(o) readb_raw((char __iomem *)np->reg + ncr_offb(o)) +#define OUTB_OFF(o, val) writeb_raw((val), (char __iomem *)np->reg + ncr_offb(o)) + +#if defined(__BIG_ENDIAN) && !defined(SCSI_NCR_BIG_ENDIAN) + +#define INW_OFF(o) readw_l2b((char __iomem *)np->reg + ncr_offw(o)) +#define INL_OFF(o) readl_l2b((char __iomem *)np->reg + (o)) + +#define OUTW_OFF(o, val) writew_b2l((val), (char __iomem *)np->reg + ncr_offw(o)) +#define OUTL_OFF(o, val) writel_b2l((val), (char __iomem *)np->reg + (o)) + +#elif defined(__LITTLE_ENDIAN) && defined(SCSI_NCR_BIG_ENDIAN) + +#define INW_OFF(o) readw_b2l((char __iomem *)np->reg + ncr_offw(o)) +#define INL_OFF(o) readl_b2l((char __iomem *)np->reg + (o)) + +#define OUTW_OFF(o, val) writew_l2b((val), (char __iomem *)np->reg + ncr_offw(o)) +#define OUTL_OFF(o, val) writel_l2b((val), (char __iomem *)np->reg + (o)) + +#else + +#ifdef CONFIG_SCSI_NCR53C8XX_NO_WORD_TRANSFERS +/* Only 8 or 32 bit transfers allowed */ +#define INW_OFF(o) (readb((char __iomem *)np->reg + ncr_offw(o)) << 8 | readb((char __iomem *)np->reg + ncr_offw(o) + 1)) +#else +#define INW_OFF(o) readw_raw((char __iomem *)np->reg + ncr_offw(o)) +#endif +#define INL_OFF(o) readl_raw((char __iomem *)np->reg + (o)) + +#ifdef CONFIG_SCSI_NCR53C8XX_NO_WORD_TRANSFERS +/* Only 8 or 32 bit transfers allowed */ +#define OUTW_OFF(o, val) do { writeb((char)((val) >> 8), (char __iomem *)np->reg + ncr_offw(o)); writeb((char)(val), (char __iomem *)np->reg + ncr_offw(o) + 1); } while (0) +#else +#define OUTW_OFF(o, val) writew_raw((val), (char __iomem *)np->reg + ncr_offw(o)) +#endif +#define OUTL_OFF(o, val) writel_raw((val), (char __iomem *)np->reg + (o)) + +#endif + +#define INB(r) INB_OFF (offsetof(struct ncr_reg,r)) +#define INW(r) INW_OFF (offsetof(struct ncr_reg,r)) +#define INL(r) INL_OFF (offsetof(struct ncr_reg,r)) + +#define OUTB(r, val) OUTB_OFF (offsetof(struct ncr_reg,r), (val)) +#define OUTW(r, val) OUTW_OFF (offsetof(struct ncr_reg,r), (val)) +#define OUTL(r, val) OUTL_OFF (offsetof(struct ncr_reg,r), (val)) + +/* + * Set bit field ON, OFF + */ + +#define OUTONB(r, m) OUTB(r, INB(r) | (m)) +#define OUTOFFB(r, m) OUTB(r, INB(r) & ~(m)) +#define OUTONW(r, m) OUTW(r, INW(r) | (m)) +#define OUTOFFW(r, m) OUTW(r, INW(r) & ~(m)) +#define OUTONL(r, m) OUTL(r, INL(r) | (m)) +#define OUTOFFL(r, m) OUTL(r, INL(r) & ~(m)) + +/* + * We normally want the chip to have a consistent view + * of driver internal data structures when we restart it. + * Thus these macros. + */ +#define OUTL_DSP(v) \ + do { \ + MEMORY_BARRIER(); \ + OUTL (nc_dsp, (v)); \ + } while (0) + +#define OUTONB_STD() \ + do { \ + MEMORY_BARRIER(); \ + OUTONB (nc_dcntl, (STD|NOCOM)); \ + } while (0) + + +/* +** NCR53C8XX devices features table. +*/ +struct ncr_chip { + unsigned short revision_id; + unsigned char burst_max; /* log-base-2 of max burst */ + unsigned char offset_max; + unsigned char nr_divisor; + unsigned int features; +#define FE_LED0 (1<<0) +#define FE_WIDE (1<<1) /* Wide data transfers */ +#define FE_ULTRA (1<<2) /* Ultra speed 20Mtrans/sec */ +#define FE_DBLR (1<<4) /* Clock doubler present */ +#define FE_QUAD (1<<5) /* Clock quadrupler present */ +#define FE_ERL (1<<6) /* Enable read line */ +#define FE_CLSE (1<<7) /* Cache line size enable */ +#define FE_WRIE (1<<8) /* Write & Invalidate enable */ +#define FE_ERMP (1<<9) /* Enable read multiple */ +#define FE_BOF (1<<10) /* Burst opcode fetch */ +#define FE_DFS (1<<11) /* DMA fifo size */ +#define FE_PFEN (1<<12) /* Prefetch enable */ +#define FE_LDSTR (1<<13) /* Load/Store supported */ +#define FE_RAM (1<<14) /* On chip RAM present */ +#define FE_VARCLK (1<<15) /* SCSI clock may vary */ +#define FE_RAM8K (1<<16) /* On chip RAM sized 8Kb */ +#define FE_64BIT (1<<17) /* Have a 64-bit PCI interface */ +#define FE_IO256 (1<<18) /* Requires full 256 bytes in PCI space */ +#define FE_NOPM (1<<19) /* Scripts handles phase mismatch */ +#define FE_LEDC (1<<20) /* Hardware control of LED */ +#define FE_DIFF (1<<21) /* Support Differential SCSI */ +#define FE_66MHZ (1<<23) /* 66MHz PCI Support */ +#define FE_DAC (1<<24) /* Support DAC cycles (64 bit addressing) */ +#define FE_ISTAT1 (1<<25) /* Have ISTAT1, MBOX0, MBOX1 registers */ +#define FE_DAC_IN_USE (1<<26) /* Platform does DAC cycles */ +#define FE_EHP (1<<27) /* 720: Even host parity */ +#define FE_MUX (1<<28) /* 720: Multiplexed bus */ +#define FE_EA (1<<29) /* 720: Enable Ack */ + +#define FE_CACHE_SET (FE_ERL|FE_CLSE|FE_WRIE|FE_ERMP) +#define FE_SCSI_SET (FE_WIDE|FE_ULTRA|FE_DBLR|FE_QUAD|F_CLK80) +#define FE_SPECIAL_SET (FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM) +}; + + +/* +** Driver setup structure. +** +** This structure is initialized from linux config options. +** It can be overridden at boot-up by the boot command line. +*/ +#define SCSI_NCR_MAX_EXCLUDES 8 +struct ncr_driver_setup { + u8 master_parity; + u8 scsi_parity; + u8 disconnection; + u8 special_features; + u8 force_sync_nego; + u8 reverse_probe; + u8 pci_fix_up; + u8 use_nvram; + u8 verbose; + u8 default_tags; + u16 default_sync; + u16 debug; + u8 burst_max; + u8 led_pin; + u8 max_wide; + u8 settle_delay; + u8 diff_support; + u8 irqm; + u8 bus_check; + u8 optimize; + u8 recovery; + u8 host_id; + u16 iarb; + u32 excludes[SCSI_NCR_MAX_EXCLUDES]; + char tag_ctrl[100]; +}; + +/* +** Initial setup. +** Can be overriden at startup by a command line. +*/ +#define SCSI_NCR_DRIVER_SETUP \ +{ \ + SCSI_NCR_SETUP_MASTER_PARITY, \ + SCSI_NCR_SETUP_SCSI_PARITY, \ + SCSI_NCR_SETUP_DISCONNECTION, \ + SCSI_NCR_SETUP_SPECIAL_FEATURES, \ + SCSI_NCR_SETUP_FORCE_SYNC_NEGO, \ + 0, \ + 0, \ + 1, \ + 0, \ + SCSI_NCR_SETUP_DEFAULT_TAGS, \ + SCSI_NCR_SETUP_DEFAULT_SYNC, \ + 0x00, \ + 7, \ + 0, \ + 1, \ + SCSI_NCR_SETUP_SETTLE_TIME, \ + 0, \ + 0, \ + 1, \ + 0, \ + 0, \ + 255, \ + 0x00 \ +} + +/* +** Boot fail safe setup. +** Override initial setup from boot command line: +** ncr53c8xx=safe:y +*/ +#define SCSI_NCR_DRIVER_SAFE_SETUP \ +{ \ + 0, \ + 1, \ + 0, \ + 0, \ + 0, \ + 0, \ + 0, \ + 1, \ + 2, \ + 0, \ + 255, \ + 0x00, \ + 255, \ + 0, \ + 0, \ + 10, \ + 1, \ + 1, \ + 1, \ + 0, \ + 0, \ + 255 \ +} + +/**************** ORIGINAL CONTENT of ncrreg.h from FreeBSD ******************/ + +/*----------------------------------------------------------------- +** +** The ncr 53c810 register structure. +** +**----------------------------------------------------------------- +*/ + +struct ncr_reg { +/*00*/ u8 nc_scntl0; /* full arb., ena parity, par->ATN */ + +/*01*/ u8 nc_scntl1; /* no reset */ + #define ISCON 0x10 /* connected to scsi */ + #define CRST 0x08 /* force reset */ + #define IARB 0x02 /* immediate arbitration */ + +/*02*/ u8 nc_scntl2; /* no disconnect expected */ + #define SDU 0x80 /* cmd: disconnect will raise error */ + #define CHM 0x40 /* sta: chained mode */ + #define WSS 0x08 /* sta: wide scsi send [W]*/ + #define WSR 0x01 /* sta: wide scsi received [W]*/ + +/*03*/ u8 nc_scntl3; /* cnf system clock dependent */ + #define EWS 0x08 /* cmd: enable wide scsi [W]*/ + #define ULTRA 0x80 /* cmd: ULTRA enable */ + /* bits 0-2, 7 rsvd for C1010 */ + +/*04*/ u8 nc_scid; /* cnf host adapter scsi address */ + #define RRE 0x40 /* r/w:e enable response to resel. */ + #define SRE 0x20 /* r/w:e enable response to select */ + +/*05*/ u8 nc_sxfer; /* ### Sync speed and count */ + /* bits 6-7 rsvd for C1010 */ + +/*06*/ u8 nc_sdid; /* ### Destination-ID */ + +/*07*/ u8 nc_gpreg; /* ??? IO-Pins */ + +/*08*/ u8 nc_sfbr; /* ### First byte in phase */ + +/*09*/ u8 nc_socl; + #define CREQ 0x80 /* r/w: SCSI-REQ */ + #define CACK 0x40 /* r/w: SCSI-ACK */ + #define CBSY 0x20 /* r/w: SCSI-BSY */ + #define CSEL 0x10 /* r/w: SCSI-SEL */ + #define CATN 0x08 /* r/w: SCSI-ATN */ + #define CMSG 0x04 /* r/w: SCSI-MSG */ + #define CC_D 0x02 /* r/w: SCSI-C_D */ + #define CI_O 0x01 /* r/w: SCSI-I_O */ + +/*0a*/ u8 nc_ssid; + +/*0b*/ u8 nc_sbcl; + +/*0c*/ u8 nc_dstat; + #define DFE 0x80 /* sta: dma fifo empty */ + #define MDPE 0x40 /* int: master data parity error */ + #define BF 0x20 /* int: script: bus fault */ + #define ABRT 0x10 /* int: script: command aborted */ + #define SSI 0x08 /* int: script: single step */ + #define SIR 0x04 /* int: script: interrupt instruct. */ + #define IID 0x01 /* int: script: illegal instruct. */ + +/*0d*/ u8 nc_sstat0; + #define ILF 0x80 /* sta: data in SIDL register lsb */ + #define ORF 0x40 /* sta: data in SODR register lsb */ + #define OLF 0x20 /* sta: data in SODL register lsb */ + #define AIP 0x10 /* sta: arbitration in progress */ + #define LOA 0x08 /* sta: arbitration lost */ + #define WOA 0x04 /* sta: arbitration won */ + #define IRST 0x02 /* sta: scsi reset signal */ + #define SDP 0x01 /* sta: scsi parity signal */ + +/*0e*/ u8 nc_sstat1; + #define FF3210 0xf0 /* sta: bytes in the scsi fifo */ + +/*0f*/ u8 nc_sstat2; + #define ILF1 0x80 /* sta: data in SIDL register msb[W]*/ + #define ORF1 0x40 /* sta: data in SODR register msb[W]*/ + #define OLF1 0x20 /* sta: data in SODL register msb[W]*/ + #define DM 0x04 /* sta: DIFFSENS mismatch (895/6 only) */ + #define LDSC 0x02 /* sta: disconnect & reconnect */ + +/*10*/ u8 nc_dsa; /* --> Base page */ +/*11*/ u8 nc_dsa1; +/*12*/ u8 nc_dsa2; +/*13*/ u8 nc_dsa3; + +/*14*/ u8 nc_istat; /* --> Main Command and status */ + #define CABRT 0x80 /* cmd: abort current operation */ + #define SRST 0x40 /* mod: reset chip */ + #define SIGP 0x20 /* r/w: message from host to ncr */ + #define SEM 0x10 /* r/w: message between host + ncr */ + #define CON 0x08 /* sta: connected to scsi */ + #define INTF 0x04 /* sta: int on the fly (reset by wr)*/ + #define SIP 0x02 /* sta: scsi-interrupt */ + #define DIP 0x01 /* sta: host/script interrupt */ + +/*15*/ u8 nc_istat1; /* 896 and later cores only */ + #define FLSH 0x04 /* sta: chip is flushing */ + #define SRUN 0x02 /* sta: scripts are running */ + #define SIRQD 0x01 /* r/w: disable INT pin */ + +/*16*/ u8 nc_mbox0; /* 896 and later cores only */ +/*17*/ u8 nc_mbox1; /* 896 and later cores only */ + +/*18*/ u8 nc_ctest0; + #define EHP 0x04 /* 720 even host parity */ +/*19*/ u8 nc_ctest1; + +/*1a*/ u8 nc_ctest2; + #define CSIGP 0x40 + /* bits 0-2,7 rsvd for C1010 */ + +/*1b*/ u8 nc_ctest3; + #define FLF 0x08 /* cmd: flush dma fifo */ + #define CLF 0x04 /* cmd: clear dma fifo */ + #define FM 0x02 /* mod: fetch pin mode */ + #define WRIE 0x01 /* mod: write and invalidate enable */ + /* bits 4-7 rsvd for C1010 */ + +/*1c*/ u32 nc_temp; /* ### Temporary stack */ + +/*20*/ u8 nc_dfifo; +/*21*/ u8 nc_ctest4; + #define MUX 0x80 /* 720 host bus multiplex mode */ + #define BDIS 0x80 /* mod: burst disable */ + #define MPEE 0x08 /* mod: master parity error enable */ + +/*22*/ u8 nc_ctest5; + #define DFS 0x20 /* mod: dma fifo size */ + /* bits 0-1, 3-7 rsvd for C1010 */ +/*23*/ u8 nc_ctest6; + +/*24*/ u32 nc_dbc; /* ### Byte count and command */ +/*28*/ u32 nc_dnad; /* ### Next command register */ +/*2c*/ u32 nc_dsp; /* --> Script Pointer */ +/*30*/ u32 nc_dsps; /* --> Script pointer save/opcode#2 */ + +/*34*/ u8 nc_scratcha; /* Temporary register a */ +/*35*/ u8 nc_scratcha1; +/*36*/ u8 nc_scratcha2; +/*37*/ u8 nc_scratcha3; + +/*38*/ u8 nc_dmode; + #define BL_2 0x80 /* mod: burst length shift value +2 */ + #define BL_1 0x40 /* mod: burst length shift value +1 */ + #define ERL 0x08 /* mod: enable read line */ + #define ERMP 0x04 /* mod: enable read multiple */ + #define BOF 0x02 /* mod: burst op code fetch */ + +/*39*/ u8 nc_dien; +/*3a*/ u8 nc_sbr; + +/*3b*/ u8 nc_dcntl; /* --> Script execution control */ + #define CLSE 0x80 /* mod: cache line size enable */ + #define PFF 0x40 /* cmd: pre-fetch flush */ + #define PFEN 0x20 /* mod: pre-fetch enable */ + #define EA 0x20 /* mod: 720 enable-ack */ + #define SSM 0x10 /* mod: single step mode */ + #define IRQM 0x08 /* mod: irq mode (1 = totem pole !) */ + #define STD 0x04 /* cmd: start dma mode */ + #define IRQD 0x02 /* mod: irq disable */ + #define NOCOM 0x01 /* cmd: protect sfbr while reselect */ + /* bits 0-1 rsvd for C1010 */ + +/*3c*/ u32 nc_adder; + +/*40*/ u16 nc_sien; /* -->: interrupt enable */ +/*42*/ u16 nc_sist; /* <--: interrupt status */ + #define SBMC 0x1000/* sta: SCSI Bus Mode Change (895/6 only) */ + #define STO 0x0400/* sta: timeout (select) */ + #define GEN 0x0200/* sta: timeout (general) */ + #define HTH 0x0100/* sta: timeout (handshake) */ + #define MA 0x80 /* sta: phase mismatch */ + #define CMP 0x40 /* sta: arbitration complete */ + #define SEL 0x20 /* sta: selected by another device */ + #define RSL 0x10 /* sta: reselected by another device*/ + #define SGE 0x08 /* sta: gross error (over/underflow)*/ + #define UDC 0x04 /* sta: unexpected disconnect */ + #define RST 0x02 /* sta: scsi bus reset detected */ + #define PAR 0x01 /* sta: scsi parity error */ + +/*44*/ u8 nc_slpar; +/*45*/ u8 nc_swide; +/*46*/ u8 nc_macntl; +/*47*/ u8 nc_gpcntl; +/*48*/ u8 nc_stime0; /* cmd: timeout for select&handshake*/ +/*49*/ u8 nc_stime1; /* cmd: timeout user defined */ +/*4a*/ u16 nc_respid; /* sta: Reselect-IDs */ + +/*4c*/ u8 nc_stest0; + +/*4d*/ u8 nc_stest1; + #define SCLK 0x80 /* Use the PCI clock as SCSI clock */ + #define DBLEN 0x08 /* clock doubler running */ + #define DBLSEL 0x04 /* clock doubler selected */ + + +/*4e*/ u8 nc_stest2; + #define ROF 0x40 /* reset scsi offset (after gross error!) */ + #define DIF 0x20 /* 720 SCSI differential mode */ + #define EXT 0x02 /* extended filtering */ + +/*4f*/ u8 nc_stest3; + #define TE 0x80 /* c: tolerAnt enable */ + #define HSC 0x20 /* c: Halt SCSI Clock */ + #define CSF 0x02 /* c: clear scsi fifo */ + +/*50*/ u16 nc_sidl; /* Lowlevel: latched from scsi data */ +/*52*/ u8 nc_stest4; + #define SMODE 0xc0 /* SCSI bus mode (895/6 only) */ + #define SMODE_HVD 0x40 /* High Voltage Differential */ + #define SMODE_SE 0x80 /* Single Ended */ + #define SMODE_LVD 0xc0 /* Low Voltage Differential */ + #define LCKFRQ 0x20 /* Frequency Lock (895/6 only) */ + /* bits 0-5 rsvd for C1010 */ + +/*53*/ u8 nc_53_; +/*54*/ u16 nc_sodl; /* Lowlevel: data out to scsi data */ +/*56*/ u8 nc_ccntl0; /* Chip Control 0 (896) */ + #define ENPMJ 0x80 /* Enable Phase Mismatch Jump */ + #define PMJCTL 0x40 /* Phase Mismatch Jump Control */ + #define ENNDJ 0x20 /* Enable Non Data PM Jump */ + #define DISFC 0x10 /* Disable Auto FIFO Clear */ + #define DILS 0x02 /* Disable Internal Load/Store */ + #define DPR 0x01 /* Disable Pipe Req */ + +/*57*/ u8 nc_ccntl1; /* Chip Control 1 (896) */ + #define ZMOD 0x80 /* High Impedance Mode */ + #define DIC 0x10 /* Disable Internal Cycles */ + #define DDAC 0x08 /* Disable Dual Address Cycle */ + #define XTIMOD 0x04 /* 64-bit Table Ind. Indexing Mode */ + #define EXTIBMV 0x02 /* Enable 64-bit Table Ind. BMOV */ + #define EXDBMV 0x01 /* Enable 64-bit Direct BMOV */ + +/*58*/ u16 nc_sbdl; /* Lowlevel: data from scsi data */ +/*5a*/ u16 nc_5a_; + +/*5c*/ u8 nc_scr0; /* Working register B */ +/*5d*/ u8 nc_scr1; /* */ +/*5e*/ u8 nc_scr2; /* */ +/*5f*/ u8 nc_scr3; /* */ + +/*60*/ u8 nc_scrx[64]; /* Working register C-R */ +/*a0*/ u32 nc_mmrs; /* Memory Move Read Selector */ +/*a4*/ u32 nc_mmws; /* Memory Move Write Selector */ +/*a8*/ u32 nc_sfs; /* Script Fetch Selector */ +/*ac*/ u32 nc_drs; /* DSA Relative Selector */ +/*b0*/ u32 nc_sbms; /* Static Block Move Selector */ +/*b4*/ u32 nc_dbms; /* Dynamic Block Move Selector */ +/*b8*/ u32 nc_dnad64; /* DMA Next Address 64 */ +/*bc*/ u16 nc_scntl4; /* C1010 only */ + #define U3EN 0x80 /* Enable Ultra 3 */ + #define AIPEN 0x40 /* Allow check upper byte lanes */ + #define XCLKH_DT 0x08 /* Extra clock of data hold on DT + transfer edge */ + #define XCLKH_ST 0x04 /* Extra clock of data hold on ST + transfer edge */ + +/*be*/ u8 nc_aipcntl0; /* Epat Control 1 C1010 only */ +/*bf*/ u8 nc_aipcntl1; /* AIP Control C1010_66 Only */ + +/*c0*/ u32 nc_pmjad1; /* Phase Mismatch Jump Address 1 */ +/*c4*/ u32 nc_pmjad2; /* Phase Mismatch Jump Address 2 */ +/*c8*/ u8 nc_rbc; /* Remaining Byte Count */ +/*c9*/ u8 nc_rbc1; /* */ +/*ca*/ u8 nc_rbc2; /* */ +/*cb*/ u8 nc_rbc3; /* */ + +/*cc*/ u8 nc_ua; /* Updated Address */ +/*cd*/ u8 nc_ua1; /* */ +/*ce*/ u8 nc_ua2; /* */ +/*cf*/ u8 nc_ua3; /* */ +/*d0*/ u32 nc_esa; /* Entry Storage Address */ +/*d4*/ u8 nc_ia; /* Instruction Address */ +/*d5*/ u8 nc_ia1; +/*d6*/ u8 nc_ia2; +/*d7*/ u8 nc_ia3; +/*d8*/ u32 nc_sbc; /* SCSI Byte Count (3 bytes only) */ +/*dc*/ u32 nc_csbc; /* Cumulative SCSI Byte Count */ + + /* Following for C1010 only */ +/*e0*/ u16 nc_crcpad; /* CRC Value */ +/*e2*/ u8 nc_crccntl0; /* CRC control register */ + #define SNDCRC 0x10 /* Send CRC Request */ +/*e3*/ u8 nc_crccntl1; /* CRC control register */ +/*e4*/ u32 nc_crcdata; /* CRC data register */ +/*e8*/ u32 nc_e8_; /* rsvd */ +/*ec*/ u32 nc_ec_; /* rsvd */ +/*f0*/ u16 nc_dfbc; /* DMA FIFO byte count */ + +}; + +/*----------------------------------------------------------- +** +** Utility macros for the script. +** +**----------------------------------------------------------- +*/ + +#define REGJ(p,r) (offsetof(struct ncr_reg, p ## r)) +#define REG(r) REGJ (nc_, r) + +typedef u32 ncrcmd; + +/*----------------------------------------------------------- +** +** SCSI phases +** +** DT phases illegal for ncr driver. +** +**----------------------------------------------------------- +*/ + +#define SCR_DATA_OUT 0x00000000 +#define SCR_DATA_IN 0x01000000 +#define SCR_COMMAND 0x02000000 +#define SCR_STATUS 0x03000000 +#define SCR_DT_DATA_OUT 0x04000000 +#define SCR_DT_DATA_IN 0x05000000 +#define SCR_MSG_OUT 0x06000000 +#define SCR_MSG_IN 0x07000000 + +#define SCR_ILG_OUT 0x04000000 +#define SCR_ILG_IN 0x05000000 + +/*----------------------------------------------------------- +** +** Data transfer via SCSI. +** +**----------------------------------------------------------- +** +** MOVE_ABS (LEN) +** <> +** +** MOVE_IND (LEN) +** <> +** +** MOVE_TBL +** <> +** +**----------------------------------------------------------- +*/ + +#define OPC_MOVE 0x08000000 + +#define SCR_MOVE_ABS(l) ((0x00000000 | OPC_MOVE) | (l)) +#define SCR_MOVE_IND(l) ((0x20000000 | OPC_MOVE) | (l)) +#define SCR_MOVE_TBL (0x10000000 | OPC_MOVE) + +#define SCR_CHMOV_ABS(l) ((0x00000000) | (l)) +#define SCR_CHMOV_IND(l) ((0x20000000) | (l)) +#define SCR_CHMOV_TBL (0x10000000) + +struct scr_tblmove { + u32 size; + u32 addr; +}; + +/*----------------------------------------------------------- +** +** Selection +** +**----------------------------------------------------------- +** +** SEL_ABS | SCR_ID (0..15) [ | REL_JMP] +** <> +** +** SEL_TBL | << dnad_offset>> [ | REL_JMP] +** <> +** +**----------------------------------------------------------- +*/ + +#define SCR_SEL_ABS 0x40000000 +#define SCR_SEL_ABS_ATN 0x41000000 +#define SCR_SEL_TBL 0x42000000 +#define SCR_SEL_TBL_ATN 0x43000000 + + +#ifdef SCSI_NCR_BIG_ENDIAN +struct scr_tblsel { + u8 sel_scntl3; + u8 sel_id; + u8 sel_sxfer; + u8 sel_scntl4; +}; +#else +struct scr_tblsel { + u8 sel_scntl4; + u8 sel_sxfer; + u8 sel_id; + u8 sel_scntl3; +}; +#endif + +#define SCR_JMP_REL 0x04000000 +#define SCR_ID(id) (((u32)(id)) << 16) + +/*----------------------------------------------------------- +** +** Waiting for Disconnect or Reselect +** +**----------------------------------------------------------- +** +** WAIT_DISC +** dummy: <> +** +** WAIT_RESEL +** <> +** +**----------------------------------------------------------- +*/ + +#define SCR_WAIT_DISC 0x48000000 +#define SCR_WAIT_RESEL 0x50000000 + +/*----------------------------------------------------------- +** +** Bit Set / Reset +** +**----------------------------------------------------------- +** +** SET (flags {|.. }) +** +** CLR (flags {|.. }) +** +**----------------------------------------------------------- +*/ + +#define SCR_SET(f) (0x58000000 | (f)) +#define SCR_CLR(f) (0x60000000 | (f)) + +#define SCR_CARRY 0x00000400 +#define SCR_TRG 0x00000200 +#define SCR_ACK 0x00000040 +#define SCR_ATN 0x00000008 + + + + +/*----------------------------------------------------------- +** +** Memory to memory move +** +**----------------------------------------------------------- +** +** COPY (bytecount) +** << source_address >> +** << destination_address >> +** +** SCR_COPY sets the NO FLUSH option by default. +** SCR_COPY_F does not set this option. +** +** For chips which do not support this option, +** ncr_copy_and_bind() will remove this bit. +**----------------------------------------------------------- +*/ + +#define SCR_NO_FLUSH 0x01000000 + +#define SCR_COPY(n) (0xc0000000 | SCR_NO_FLUSH | (n)) +#define SCR_COPY_F(n) (0xc0000000 | (n)) + +/*----------------------------------------------------------- +** +** Register move and binary operations +** +**----------------------------------------------------------- +** +** SFBR_REG (reg, op, data) reg = SFBR op data +** << 0 >> +** +** REG_SFBR (reg, op, data) SFBR = reg op data +** << 0 >> +** +** REG_REG (reg, op, data) reg = reg op data +** << 0 >> +** +**----------------------------------------------------------- +** On 810A, 860, 825A, 875, 895 and 896 chips the content +** of SFBR register can be used as data (SCR_SFBR_DATA). +** The 896 has additionnal IO registers starting at +** offset 0x80. Bit 7 of register offset is stored in +** bit 7 of the SCRIPTS instruction first DWORD. +**----------------------------------------------------------- +*/ + +#define SCR_REG_OFS(ofs) ((((ofs) & 0x7f) << 16ul) + ((ofs) & 0x80)) + +#define SCR_SFBR_REG(reg,op,data) \ + (0x68000000 | (SCR_REG_OFS(REG(reg))) | (op) | (((data)&0xff)<<8ul)) + +#define SCR_REG_SFBR(reg,op,data) \ + (0x70000000 | (SCR_REG_OFS(REG(reg))) | (op) | (((data)&0xff)<<8ul)) + +#define SCR_REG_REG(reg,op,data) \ + (0x78000000 | (SCR_REG_OFS(REG(reg))) | (op) | (((data)&0xff)<<8ul)) + + +#define SCR_LOAD 0x00000000 +#define SCR_SHL 0x01000000 +#define SCR_OR 0x02000000 +#define SCR_XOR 0x03000000 +#define SCR_AND 0x04000000 +#define SCR_SHR 0x05000000 +#define SCR_ADD 0x06000000 +#define SCR_ADDC 0x07000000 + +#define SCR_SFBR_DATA (0x00800000>>8ul) /* Use SFBR as data */ + +/*----------------------------------------------------------- +** +** FROM_REG (reg) SFBR = reg +** << 0 >> +** +** TO_REG (reg) reg = SFBR +** << 0 >> +** +** LOAD_REG (reg, data) reg = +** << 0 >> +** +** LOAD_SFBR(data) SFBR = +** << 0 >> +** +**----------------------------------------------------------- +*/ + +#define SCR_FROM_REG(reg) \ + SCR_REG_SFBR(reg,SCR_OR,0) + +#define SCR_TO_REG(reg) \ + SCR_SFBR_REG(reg,SCR_OR,0) + +#define SCR_LOAD_REG(reg,data) \ + SCR_REG_REG(reg,SCR_LOAD,data) + +#define SCR_LOAD_SFBR(data) \ + (SCR_REG_SFBR (gpreg, SCR_LOAD, data)) + +/*----------------------------------------------------------- +** +** LOAD from memory to register. +** STORE from register to memory. +** +** Only supported by 810A, 860, 825A, 875, 895 and 896. +** +**----------------------------------------------------------- +** +** LOAD_ABS (LEN) +** <> +** +** LOAD_REL (LEN) (DSA relative) +** <> +** +**----------------------------------------------------------- +*/ + +#define SCR_REG_OFS2(ofs) (((ofs) & 0xff) << 16ul) +#define SCR_NO_FLUSH2 0x02000000 +#define SCR_DSA_REL2 0x10000000 + +#define SCR_LOAD_R(reg, how, n) \ + (0xe1000000 | how | (SCR_REG_OFS2(REG(reg))) | (n)) + +#define SCR_STORE_R(reg, how, n) \ + (0xe0000000 | how | (SCR_REG_OFS2(REG(reg))) | (n)) + +#define SCR_LOAD_ABS(reg, n) SCR_LOAD_R(reg, SCR_NO_FLUSH2, n) +#define SCR_LOAD_REL(reg, n) SCR_LOAD_R(reg, SCR_NO_FLUSH2|SCR_DSA_REL2, n) +#define SCR_LOAD_ABS_F(reg, n) SCR_LOAD_R(reg, 0, n) +#define SCR_LOAD_REL_F(reg, n) SCR_LOAD_R(reg, SCR_DSA_REL2, n) + +#define SCR_STORE_ABS(reg, n) SCR_STORE_R(reg, SCR_NO_FLUSH2, n) +#define SCR_STORE_REL(reg, n) SCR_STORE_R(reg, SCR_NO_FLUSH2|SCR_DSA_REL2,n) +#define SCR_STORE_ABS_F(reg, n) SCR_STORE_R(reg, 0, n) +#define SCR_STORE_REL_F(reg, n) SCR_STORE_R(reg, SCR_DSA_REL2, n) + + +/*----------------------------------------------------------- +** +** Waiting for Disconnect or Reselect +** +**----------------------------------------------------------- +** +** JUMP [ | IFTRUE/IFFALSE ( ... ) ] +** <
> +** +** JUMPR [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** CALL [ | IFTRUE/IFFALSE ( ... ) ] +** <
> +** +** CALLR [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** RETURN [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** INT [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** INT_FLY [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** Conditions: +** WHEN (phase) +** IF (phase) +** CARRYSET +** DATA (data, mask) +** +**----------------------------------------------------------- +*/ + +#define SCR_NO_OP 0x80000000 +#define SCR_JUMP 0x80080000 +#define SCR_JUMP64 0x80480000 +#define SCR_JUMPR 0x80880000 +#define SCR_CALL 0x88080000 +#define SCR_CALLR 0x88880000 +#define SCR_RETURN 0x90080000 +#define SCR_INT 0x98080000 +#define SCR_INT_FLY 0x98180000 + +#define IFFALSE(arg) (0x00080000 | (arg)) +#define IFTRUE(arg) (0x00000000 | (arg)) + +#define WHEN(phase) (0x00030000 | (phase)) +#define IF(phase) (0x00020000 | (phase)) + +#define DATA(D) (0x00040000 | ((D) & 0xff)) +#define MASK(D,M) (0x00040000 | (((M ^ 0xff) & 0xff) << 8ul)|((D) & 0xff)) + +#define CARRYSET (0x00200000) + +/*----------------------------------------------------------- +** +** SCSI constants. +** +**----------------------------------------------------------- +*/ + +/* +** Messages +*/ + +#define M_COMPLETE COMMAND_COMPLETE +#define M_EXTENDED EXTENDED_MESSAGE +#define M_SAVE_DP SAVE_POINTERS +#define M_RESTORE_DP RESTORE_POINTERS +#define M_DISCONNECT DISCONNECT +#define M_ID_ERROR INITIATOR_ERROR +#define M_ABORT ABORT_TASK_SET +#define M_REJECT MESSAGE_REJECT +#define M_NOOP NOP +#define M_PARITY MSG_PARITY_ERROR +#define M_LCOMPLETE LINKED_CMD_COMPLETE +#define M_FCOMPLETE LINKED_FLG_CMD_COMPLETE +#define M_RESET TARGET_RESET +#define M_ABORT_TAG ABORT_TASK +#define M_CLEAR_QUEUE CLEAR_TASK_SET +#define M_INIT_REC INITIATE_RECOVERY +#define M_REL_REC RELEASE_RECOVERY +#define M_TERMINATE (0x11) +#define M_SIMPLE_TAG SIMPLE_QUEUE_TAG +#define M_HEAD_TAG HEAD_OF_QUEUE_TAG +#define M_ORDERED_TAG ORDERED_QUEUE_TAG +#define M_IGN_RESIDUE IGNORE_WIDE_RESIDUE +#define M_IDENTIFY (0x80) + +#define M_X_MODIFY_DP EXTENDED_MODIFY_DATA_POINTER +#define M_X_SYNC_REQ EXTENDED_SDTR +#define M_X_WIDE_REQ EXTENDED_WDTR +#define M_X_PPR_REQ EXTENDED_PPR + +/* +** Status +*/ + +#define S_GOOD (0x00) +#define S_CHECK_COND (0x02) +#define S_COND_MET (0x04) +#define S_BUSY (0x08) +#define S_INT (0x10) +#define S_INT_COND_MET (0x14) +#define S_CONFLICT (0x18) +#define S_TERMINATED (0x20) +#define S_QUEUE_FULL (0x28) +#define S_ILLEGAL (0xff) +#define S_SENSE (0x80) + +/* + * End of ncrreg from FreeBSD + */ + +#endif /* defined SYM53C8XX_DEFS_H */ diff --git a/trunk/drivers/serial/68328serial.c b/trunk/drivers/serial/68328serial.c index 67e9afa000c1..2efb317153ce 100644 --- a/trunk/drivers/serial/68328serial.c +++ b/trunk/drivers/serial/68328serial.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -1344,7 +1343,7 @@ static void show_serial_version(void) printk("MC68328 serial driver version 1.00\n"); } -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM /* Serial Power management * The console (currently fixed at line 0) is a special case for power * management because the kernel is so chatty. The console will be @@ -1394,7 +1393,7 @@ void startup_console(void) struct m68k_serial *info = &m68k_soft[0]; startup(info); } -#endif /* CONFIG_PM_LEGACY */ +#endif static struct tty_operations rs_ops = { @@ -1487,7 +1486,7 @@ rs68328_init(void) IRQ_FLG_STD, "M68328_UART", NULL)) panic("Unable to attach 68328 serial interrupt\n"); -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM serial_pm[i] = pm_register(PM_SYS_DEV, PM_SYS_COM, serial_pm_callback); if (serial_pm[i]) serial_pm[i]->data = info; diff --git a/trunk/drivers/serial/8250.c b/trunk/drivers/serial/8250.c index d2bcd1f87cd6..3742753241ee 100644 --- a/trunk/drivers/serial/8250.c +++ b/trunk/drivers/serial/8250.c @@ -102,7 +102,7 @@ static unsigned int share_irqs = SERIAL8250_SHARE_IRQS; #define SERIAL_PORT_DFNS #endif -static const struct old_serial_port old_serial_port[] = { +static struct old_serial_port old_serial_port[] = { SERIAL_PORT_DFNS /* defined in asm/serial.h */ }; @@ -999,10 +999,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags) serial_outp(up, UART_MCR, save_mcr); serial8250_clear_fifos(up); (void)serial_in(up, UART_RX); - if (up->capabilities & UART_CAP_UUE) - serial_outp(up, UART_IER, UART_IER_UUE); - else - serial_outp(up, UART_IER, 0); + serial_outp(up, UART_IER, 0); out: spin_unlock_irqrestore(&up->port.lock, flags); diff --git a/trunk/drivers/serial/8250_pci.c b/trunk/drivers/serial/8250_pci.c index 8adca0ce267f..5c3c03932d6d 100644 --- a/trunk/drivers/serial/8250_pci.c +++ b/trunk/drivers/serial/8250_pci.c @@ -468,7 +468,7 @@ static unsigned short timedia_eight_port[] = { 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0 }; -static const struct timedia_struct { +static struct timedia_struct { int num; unsigned short *ids; } timedia_data[] = { @@ -516,7 +516,7 @@ pci_timedia_setup(struct serial_private *priv, struct pciserial_board *board, break; case 3: offset = board->uart_offset; - /* FALLTHROUGH */ + bar = 1; case 4: /* BAR 2 */ case 5: /* BAR 3 */ case 6: /* BAR 4 */ diff --git a/trunk/drivers/serial/8250_pnp.c b/trunk/drivers/serial/8250_pnp.c index b79ed0665d51..5d8660a42b77 100644 --- a/trunk/drivers/serial/8250_pnp.c +++ b/trunk/drivers/serial/8250_pnp.c @@ -323,8 +323,6 @@ static const struct pnp_device_id pnp_dev_table[] = { { "USR9180", 0 }, /* U.S. Robotics 56K Voice INT PnP*/ { "USR9190", 0 }, - /* HP Compaq Tablet PC tc1100 Wacom tablet */ - { "WACF005", 0 }, /* Rockwell's (PORALiNK) 33600 INT PNP */ { "WCI0003", 0 }, /* Unkown PnP modems */ diff --git a/trunk/drivers/serial/Kconfig b/trunk/drivers/serial/Kconfig index 812bae62c8ec..ff36f0c9fdad 100644 --- a/trunk/drivers/serial/Kconfig +++ b/trunk/drivers/serial/Kconfig @@ -10,7 +10,7 @@ menu "Serial drivers" # The new 8250/16550 serial drivers config SERIAL_8250 tristate "8250/16550 and compatible serial support" - depends on (BROKEN || !SPARC) + depends on (BROKEN || !(SPARC64 || SPARC32)) select SERIAL_CORE ---help--- This selects whether you want to include the driver for the standard @@ -469,14 +469,14 @@ config SERIAL_IMX_CONSOLE config SERIAL_SUNCORE bool - depends on SPARC + depends on SPARC32 || SPARC64 select SERIAL_CORE select SERIAL_CORE_CONSOLE default y config SERIAL_SUNZILOG tristate "Sun Zilog8530 serial support" - depends on SPARC + depends on SPARC32 || SPARC64 help This driver supports the Zilog8530 serial ports found on many Sparc systems. Say Y or M if you want to be able to these serial ports. @@ -491,7 +491,7 @@ config SERIAL_SUNZILOG_CONSOLE config SERIAL_SUNSU tristate "Sun SU serial support" - depends on SPARC && PCI + depends on (SPARC32 || SPARC64) && PCI help This driver supports the 8250 serial ports that run the keyboard and mouse on (PCI) UltraSPARC systems. Say Y or M if you want to be able @@ -507,7 +507,7 @@ config SERIAL_SUNSU_CONSOLE config SERIAL_MUX tristate "Serial MUX support" - depends on GSC + depends on PARISC select SERIAL_CORE default y ---help--- @@ -547,7 +547,7 @@ config PDC_CONSOLE config SERIAL_SUNSAB tristate "Sun Siemens SAB82532 serial support" - depends on SPARC && PCI + depends on (SPARC32 || SPARC64) && PCI help This driver supports the Siemens SAB82532 DUSCC serial ports on newer (PCI) UltraSPARC systems. Say Y or M if you want to be able to these diff --git a/trunk/drivers/serial/amba-pl011.c b/trunk/drivers/serial/amba-pl011.c index d84476ee6592..938d185841c9 100644 --- a/trunk/drivers/serial/amba-pl011.c +++ b/trunk/drivers/serial/amba-pl011.c @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -62,8 +63,7 @@ #define AMBA_ISR_PASS_LIMIT 256 -#define UART_DR_ERROR (UART011_DR_OE|UART011_DR_BE|UART011_DR_PE|UART011_DR_FE) -#define UART_DUMMY_DR_RX (1 << 16) +#define UART_DUMMY_RSR_RX 256 /* * We wrap our port structure around the generic uart_port. @@ -116,7 +116,7 @@ pl011_rx_chars(struct uart_amba_port *uap) #endif { struct tty_struct *tty = uap->port.info->tty; - unsigned int status, ch, flag, max_count = 256; + unsigned int status, ch, flag, rsr, max_count = 256; status = readw(uap->port.membase + UART01x_FR); while ((status & UART01x_FR_RXFE) == 0 && max_count--) { @@ -129,7 +129,7 @@ pl011_rx_chars(struct uart_amba_port *uap) */ } - ch = readw(uap->port.membase + UART01x_DR) | UART_DUMMY_DR_RX; + ch = readw(uap->port.membase + UART01x_DR); flag = TTY_NORMAL; uap->port.icount.rx++; @@ -137,33 +137,34 @@ pl011_rx_chars(struct uart_amba_port *uap) * Note that the error handling code is * out of the main execution path */ - if (unlikely(ch & UART_DR_ERROR)) { - if (ch & UART011_DR_BE) { - ch &= ~(UART011_DR_FE | UART011_DR_PE); + rsr = readw(uap->port.membase + UART01x_RSR) | UART_DUMMY_RSR_RX; + if (unlikely(rsr & UART01x_RSR_ANY)) { + if (rsr & UART01x_RSR_BE) { + rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE); uap->port.icount.brk++; if (uart_handle_break(&uap->port)) goto ignore_char; - } else if (ch & UART011_DR_PE) + } else if (rsr & UART01x_RSR_PE) uap->port.icount.parity++; - else if (ch & UART011_DR_FE) + else if (rsr & UART01x_RSR_FE) uap->port.icount.frame++; - if (ch & UART011_DR_OE) + if (rsr & UART01x_RSR_OE) uap->port.icount.overrun++; - ch &= uap->port.read_status_mask; + rsr &= uap->port.read_status_mask; - if (ch & UART011_DR_BE) + if (rsr & UART01x_RSR_BE) flag = TTY_BREAK; - else if (ch & UART011_DR_PE) + else if (rsr & UART01x_RSR_PE) flag = TTY_PARITY; - else if (ch & UART011_DR_FE) + else if (rsr & UART01x_RSR_FE) flag = TTY_FRAME; } - if (uart_handle_sysrq_char(&uap->port, ch & 255, regs)) + if (uart_handle_sysrq_char(&uap->port, ch, regs)) goto ignore_char; - uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag); + uart_insert_char(&uap->port, rsr, UART01x_RSR_OE, ch, flag); ignore_char: status = readw(uap->port.membase + UART01x_FR); @@ -475,33 +476,33 @@ pl011_set_termios(struct uart_port *port, struct termios *termios, */ uart_update_timeout(port, termios->c_cflag, baud); - port->read_status_mask = UART011_DR_OE | 255; + port->read_status_mask = UART01x_RSR_OE; if (termios->c_iflag & INPCK) - port->read_status_mask |= UART011_DR_FE | UART011_DR_PE; + port->read_status_mask |= UART01x_RSR_FE | UART01x_RSR_PE; if (termios->c_iflag & (BRKINT | PARMRK)) - port->read_status_mask |= UART011_DR_BE; + port->read_status_mask |= UART01x_RSR_BE; /* * Characters to ignore */ port->ignore_status_mask = 0; if (termios->c_iflag & IGNPAR) - port->ignore_status_mask |= UART011_DR_FE | UART011_DR_PE; + port->ignore_status_mask |= UART01x_RSR_FE | UART01x_RSR_PE; if (termios->c_iflag & IGNBRK) { - port->ignore_status_mask |= UART011_DR_BE; + port->ignore_status_mask |= UART01x_RSR_BE; /* * If we're ignoring parity and break indicators, * ignore overruns too (for real raw support). */ if (termios->c_iflag & IGNPAR) - port->ignore_status_mask |= UART011_DR_OE; + port->ignore_status_mask |= UART01x_RSR_OE; } /* * Ignore all characters if CREAD is not set. */ if ((termios->c_cflag & CREAD) == 0) - port->ignore_status_mask |= UART_DUMMY_DR_RX; + port->ignore_status_mask |= UART_DUMMY_RSR_RX; if (UART_ENABLE_MS(port, termios->c_cflag)) pl011_enable_ms(port); diff --git a/trunk/drivers/serial/cpm_uart/cpm_uart_core.c b/trunk/drivers/serial/cpm_uart/cpm_uart_core.c index 987d22b53c22..25825f2aba22 100644 --- a/trunk/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/trunk/drivers/serial/cpm_uart/cpm_uart_core.c @@ -7,7 +7,7 @@ * Based on ppc8xx.c by Thomas Gleixner * Based on drivers/serial/amba.c by Russell King * - * Maintainer: Kumar Gala (galak@kernel.crashing.org) (CPM2) + * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) * Pantelis Antoniou (panto@intracom.gr) (CPM1) * * Copyright (C) 2004 Freescale Semiconductor, Inc. diff --git a/trunk/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/trunk/drivers/serial/cpm_uart/cpm_uart_cpm1.c index d789ee55cbb7..4b0786e7eb7f 100644 --- a/trunk/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/trunk/drivers/serial/cpm_uart/cpm_uart_cpm1.c @@ -3,7 +3,7 @@ * * Driver for CPM (SCC/SMC) serial ports; CPM1 definitions * - * Maintainer: Kumar Gala (galak@kernel.crashing.org) (CPM2) + * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) * Pantelis Antoniou (panto@intracom.gr) (CPM1) * * Copyright (C) 2004 Freescale Semiconductor, Inc. diff --git a/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c index fd9e53ed3feb..15ad58d94889 100644 --- a/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c +++ b/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c @@ -3,7 +3,7 @@ * * Driver for CPM (SCC/SMC) serial ports; CPM2 definitions * - * Maintainer: Kumar Gala (galak@kernel.crashing.org) (CPM2) + * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) * Pantelis Antoniou (panto@intracom.gr) (CPM1) * * Copyright (C) 2004 Freescale Semiconductor, Inc. diff --git a/trunk/drivers/serial/dz.c b/trunk/drivers/serial/dz.c index 4d8516d1bb71..e63b9dffc8d7 100644 --- a/trunk/drivers/serial/dz.c +++ b/trunk/drivers/serial/dz.c @@ -1,9 +1,9 @@ /* - * dz.c: Serial port driver for DECStations equiped + * dz.c: Serial port driver for DECStations equiped * with the DZ chipset. * - * Copyright (C) 1998 Olivier A. D. Lebaillif - * + * Copyright (C) 1998 Olivier A. D. Lebaillif + * * Email: olivier.lebaillif@ifrsys.com * * [31-AUG-98] triemer @@ -11,14 +11,14 @@ * removed base_addr code - moving address assignment to setup.c * Changed name of dz_init to rs_init to be consistent with tc code * [13-NOV-98] triemer fixed code to receive characters - * after patches by harald to irq code. + * after patches by harald to irq code. * [09-JAN-99] triemer minor fix for schedule - due to removal of timeout * field from "current" - somewhere between 2.1.121 and 2.1.131 Qua Jun 27 15:02:26 BRT 2001 * [27-JUN-2001] Arnaldo Carvalho de Melo - cleanups - * - * Parts (C) 1999 David Airlie, airlied@linux.ie - * [07-SEP-99] Bugfixes + * + * Parts (C) 1999 David Airlie, airlied@linux.ie + * [07-SEP-99] Bugfixes * * [06-Jan-2002] Russell King * Converted to new serial core @@ -64,7 +64,7 @@ static struct dz_port dz_ports[DZ_NB_PORT]; #ifdef DEBUG_DZ /* - * debugging code to send out chars via prom + * debugging code to send out chars via prom */ static void debug_console(const char *s, int count) { @@ -82,7 +82,7 @@ static void debug_console(const char *s, int count) * ------------------------------------------------------------ * dz_in () and dz_out () * - * These routines are used to access the registers of the DZ + * These routines are used to access the registers of the DZ * chip, hiding relocation differences between implementation. * ------------------------------------------------------------ */ @@ -106,8 +106,8 @@ static inline void dz_out(struct dz_port *dport, unsigned offset, * ------------------------------------------------------------ * rs_stop () and rs_start () * - * These routines are called before setting or resetting - * tty->stopped. They enable or disable transmitter interrupts, + * These routines are called before setting or resetting + * tty->stopped. They enable or disable transmitter interrupts, * as necessary. * ------------------------------------------------------------ */ @@ -156,17 +156,17 @@ static void dz_enable_ms(struct uart_port *port) /* * ------------------------------------------------------------ - * Here starts the interrupt handling routines. All of the - * following subroutines are declared as inline and are folded - * into dz_interrupt. They were separated out for readability's - * sake. + * Here starts the interrupt handling routines. All of the + * following subroutines are declared as inline and are folded + * into dz_interrupt. They were separated out for readability's + * sake. * * Note: rs_interrupt() is a "fast" interrupt, which means that it * runs with interrupts turned off. People who may want to modify * rs_interrupt() should try to keep the interrupt handler as fast as * possible. After you are done making modifications, it is not a bad * idea to do: - * + * * make drivers/serial/dz.s * * and look at the resulting assemble code in dz.s. @@ -403,7 +403,7 @@ static void dz_set_mctrl(struct uart_port *uport, unsigned int mctrl) * startup () * * various initialization tasks - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static int dz_startup(struct uart_port *uport) { @@ -430,13 +430,13 @@ static int dz_startup(struct uart_port *uport) return 0; } -/* +/* * ------------------------------------------------------------------- * shutdown () * * This routine will shutdown a serial port; interrupts are disabled, and * DTR is dropped if the hangup on close termio flag is on. - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static void dz_shutdown(struct uart_port *uport) { @@ -451,7 +451,7 @@ static void dz_shutdown(struct uart_port *uport) * release the bus after transmitting. This must be done when * the transmit shift register is empty, not be done when the * transmit holding register is empty. This functionality - * allows an RS485 driver to be written in user space. + * allows an RS485 driver to be written in user space. */ static unsigned int dz_tx_empty(struct uart_port *uport) { @@ -645,9 +645,9 @@ static void __init dz_init_ports(void) if (mips_machtype == MACH_DS23100 || mips_machtype == MACH_DS5100) - base = CKSEG1ADDR(KN01_SLOT_BASE + KN01_DZ11); + base = (unsigned long) KN01_DZ11_BASE; else - base = CKSEG1ADDR(KN02_SLOT_BASE + KN02_DZ11); + base = (unsigned long) KN02_DZ11_BASE; for (i = 0, dport = dz_ports; i < DZ_NB_PORT; i++, dport++) { spin_lock_init(&dport->port.lock); @@ -695,13 +695,13 @@ static void dz_console_put_char(struct dz_port *dport, unsigned char ch) spin_unlock_irqrestore(&dport->port.lock, flags); } -/* +/* * ------------------------------------------------------------------- * dz_console_print () * * dz_console_print is registered for printk. * The console must be locked when we get here. - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static void dz_console_print(struct console *cons, const char *str, diff --git a/trunk/drivers/serial/imx.c b/trunk/drivers/serial/imx.c index 83c4c1216587..355cd93a8a87 100644 --- a/trunk/drivers/serial/imx.c +++ b/trunk/drivers/serial/imx.c @@ -994,7 +994,7 @@ static int __init imx_serial_init(void) static void __exit imx_serial_exit(void) { uart_unregister_driver(&imx_reg); - platform_driver_unregister(&serial_imx_driver); + driver_unregister(&serial_imx_driver); } module_init(imx_serial_init); diff --git a/trunk/drivers/serial/mpc52xx_uart.c b/trunk/drivers/serial/mpc52xx_uart.c index b8727d9bf690..5d3cb8486447 100644 --- a/trunk/drivers/serial/mpc52xx_uart.c +++ b/trunk/drivers/serial/mpc52xx_uart.c @@ -725,7 +725,7 @@ mpc52xx_uart_probe(struct platform_device *dev) int i, idx, ret; /* Check validity & presence */ - idx = dev->id; + idx = pdev->id; if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM) return -EINVAL; @@ -748,7 +748,7 @@ mpc52xx_uart_probe(struct platform_device *dev) port->ops = &mpc52xx_uart_ops; /* Search for IRQ and mapbase */ - for (i=0 ; inum_resources ; i++, res++) { + for (i=0 ; inum_resources ; i++, res++) { if (res->flags & IORESOURCE_MEM) port->mapbase = res->start; else if (res->flags & IORESOURCE_IRQ) diff --git a/trunk/drivers/serial/mux.c b/trunk/drivers/serial/mux.c index 7633132a10aa..660bae5ba179 100644 --- a/trunk/drivers/serial/mux.c +++ b/trunk/drivers/serial/mux.c @@ -65,8 +65,8 @@ static struct uart_driver mux_driver = { static struct timer_list mux_timer; -#define UART_PUT_CHAR(p, c) __raw_writel((c), (p)->membase + IO_DATA_REG_OFFSET) -#define UART_GET_FIFO_CNT(p) __raw_readl((p)->membase + IO_DCOUNT_REG_OFFSET) +#define UART_PUT_CHAR(p, c) __raw_writel((c), (unsigned long)(p)->membase + IO_DATA_REG_OFFSET) +#define UART_GET_FIFO_CNT(p) __raw_readl((unsigned long)(p)->membase + IO_DCOUNT_REG_OFFSET) #define GET_MUX_PORTS(iodc_data) ((((iodc_data)[4] & 0xf0) >> 4) * 8) + 8 /** @@ -79,7 +79,10 @@ static struct timer_list mux_timer; */ static unsigned int mux_tx_empty(struct uart_port *port) { - return UART_GET_FIFO_CNT(port) ? 0 : TIOCSER_TEMT; + unsigned int cnt = __raw_readl((unsigned long)port->membase + + IO_DCOUNT_REG_OFFSET); + + return cnt ? 0 : TIOCSER_TEMT; } /** @@ -215,7 +218,8 @@ static void mux_read(struct uart_port *port) __u32 start_count = port->icount.rx; while(1) { - data = __raw_readl(port->membase + IO_DATA_REG_OFFSET); + data = __raw_readl((unsigned long)port->membase + + IO_DATA_REG_OFFSET); if (MUX_STATUS(data)) continue; @@ -477,13 +481,6 @@ static int __init mux_probe(struct parisc_device *dev) port->ops = &mux_pops; port->flags = UPF_BOOT_AUTOCONF; port->line = port_cnt; - - /* The port->timeout needs to match what is present in - * uart_wait_until_sent in serial_core.c. Otherwise - * the time spent in msleep_interruptable will be very - * long, causing the appearance of a console hang. - */ - port->timeout = HZ / 50; spin_lock_init(&port->lock); status = uart_add_one_port(&mux_driver, port); BUG_ON(status); diff --git a/trunk/drivers/serial/pxa.c b/trunk/drivers/serial/pxa.c index cc998b99a19f..ff5e6309d682 100644 --- a/trunk/drivers/serial/pxa.c +++ b/trunk/drivers/serial/pxa.c @@ -361,7 +361,7 @@ static int serial_pxa_startup(struct uart_port *port) if (port->line == 3) /* HWUART */ up->mcr |= UART_MCR_AFE; else - up->mcr = 0; + up->mcr = 0; /* * Allocate the IRQ @@ -641,7 +641,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count) int i; /* - * First save the IER then disable the interrupts + * First save the UER then disable the interrupts */ ier = serial_in(up, UART_IER); serial_out(up, UART_IER, UART_IER_UUE); diff --git a/trunk/drivers/serial/sa1100.c b/trunk/drivers/serial/sa1100.c index 25a086458ab9..fd9deee20e05 100644 --- a/trunk/drivers/serial/sa1100.c +++ b/trunk/drivers/serial/sa1100.c @@ -156,16 +156,19 @@ static void sa1100_stop_tx(struct uart_port *port) } /* - * port locked and interrupts disabled + * interrupts may not be disabled on entry */ static void sa1100_start_tx(struct uart_port *port) { struct sa1100_port *sport = (struct sa1100_port *)port; + unsigned long flags; u32 utcr3; + spin_lock_irqsave(&sport->port.lock, flags); utcr3 = UART_GET_UTCR3(sport); sport->port.read_status_mask |= UTSR0_TO_SM(UTSR0_TFS); UART_PUT_UTCR3(sport, utcr3 | UTCR3_TIE); + spin_unlock_irqrestore(&sport->port.lock, flags); } /* diff --git a/trunk/drivers/serial/serial_core.c b/trunk/drivers/serial/serial_core.c index c17d680e3f04..427a23858076 100644 --- a/trunk/drivers/serial/serial_core.c +++ b/trunk/drivers/serial/serial_core.c @@ -209,45 +209,33 @@ static void uart_shutdown(struct uart_state *state) struct uart_info *info = state->info; struct uart_port *port = state->port; + if (!(info->flags & UIF_INITIALIZED)) + return; + /* - * Set the TTY IO error marker + * Turn off DTR and RTS early. */ - if (info->tty) - set_bit(TTY_IO_ERROR, &info->tty->flags); - - if (info->flags & UIF_INITIALIZED) { - info->flags &= ~UIF_INITIALIZED; - - /* - * Turn off DTR and RTS early. - */ - if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) - uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); - - /* - * clear delta_msr_wait queue to avoid mem leaks: we may free - * the irq here so the queue might never be woken up. Note - * that we won't end up waiting on delta_msr_wait again since - * any outstanding file descriptors should be pointing at - * hung_up_tty_fops now. - */ - wake_up_interruptible(&info->delta_msr_wait); + if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) + uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); - /* - * Free the IRQ and disable the port. - */ - port->ops->shutdown(port); + /* + * clear delta_msr_wait queue to avoid mem leaks: we may free + * the irq here so the queue might never be woken up. Note + * that we won't end up waiting on delta_msr_wait again since + * any outstanding file descriptors should be pointing at + * hung_up_tty_fops now. + */ + wake_up_interruptible(&info->delta_msr_wait); - /* - * Ensure that the IRQ handler isn't running on another CPU. - */ - synchronize_irq(port->irq); - } + /* + * Free the IRQ and disable the port. + */ + port->ops->shutdown(port); /* - * kill off our tasklet + * Ensure that the IRQ handler isn't running on another CPU. */ - tasklet_kill(&info->tlet); + synchronize_irq(port->irq); /* * Free the transmit buffer page. @@ -256,6 +244,15 @@ static void uart_shutdown(struct uart_state *state) free_page((unsigned long)info->xmit.buf); info->xmit.buf = NULL; } + + /* + * kill off our tasklet + */ + tasklet_kill(&info->tlet); + if (info->tty) + set_bit(TTY_IO_ERROR, &info->tty->flags); + + info->flags &= ~UIF_INITIALIZED; } /** @@ -1779,7 +1776,7 @@ struct baud_rates { unsigned int cflag; }; -static const struct baud_rates baud_rates[] = { +static struct baud_rates baud_rates[] = { { 921600, B921600 }, { 460800, B460800 }, { 230400, B230400 }, @@ -1931,25 +1928,14 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) if (state->info && state->info->flags & UIF_INITIALIZED) { struct uart_ops *ops = port->ops; - int ret; ops->set_mctrl(port, 0); - ret = ops->startup(port); - if (ret == 0) { - uart_change_speed(state, NULL); - spin_lock_irq(&port->lock); - ops->set_mctrl(port, port->mctrl); - ops->start_tx(port); - spin_unlock_irq(&port->lock); - } else { - /* - * Failed to resume - maybe hardware went away? - * Clear the "initialized" flag so we won't try - * to call the low level drivers shutdown method. - */ - state->info->flags &= ~UIF_INITIALIZED; - uart_shutdown(state); - } + ops->startup(port); + uart_change_speed(state, NULL); + spin_lock_irq(&port->lock); + ops->set_mctrl(port, port->mctrl); + ops->start_tx(port); + spin_unlock_irq(&port->lock); } up(&state->sem); diff --git a/trunk/drivers/serial/serial_cs.c b/trunk/drivers/serial/serial_cs.c index 7ce0c7e66d37..2c7d3ef76e8e 100644 --- a/trunk/drivers/serial/serial_cs.c +++ b/trunk/drivers/serial/serial_cs.c @@ -85,7 +85,7 @@ struct multi_id { int multi; /* 1 = multifunction, > 1 = # ports */ }; -static const struct multi_id multi_id[] = { +static struct multi_id multi_id[] = { { MANFID_OMEGA, PRODID_OMEGA_QSP_100, 4 }, { MANFID_QUATECH, PRODID_QUATECH_DUAL_RS232, 2 }, { MANFID_QUATECH, PRODID_QUATECH_DUAL_RS232_D1, 2 }, @@ -354,8 +354,8 @@ next_tuple(client_handle_t handle, tuple_t * tuple, cisparse_t * parse) static int simple_config(dev_link_t *link) { - static const kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; - static const int size_table[2] = { 8, 16 }; + static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; + static int size_table[2] = { 8, 16 }; client_handle_t handle = link->handle; struct serial_info *info = link->priv; struct serial_cfg_mem *cfg_mem; diff --git a/trunk/drivers/tc/zs.c b/trunk/drivers/tc/zs.c index 6756d0fab6fe..c52af73a251b 100644 --- a/trunk/drivers/tc/zs.c +++ b/trunk/drivers/tc/zs.c @@ -6,7 +6,7 @@ * * DECstation changes * Copyright (C) 1998-2000 Harald Koerfgen - * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Maciej W. Rozycki + * Copyright (C) 2000, 2001, 2002, 2003, 2004 Maciej W. Rozycki * * For the rest of the code the original Copyright applies: * Copyright (C) 1996 Paul Mackerras (Paul.Mackerras@cs.anu.edu.au) @@ -55,7 +55,6 @@ #include #include #include -#include #ifdef CONFIG_SERIAL_DEC_CONSOLE #include #endif @@ -64,6 +63,7 @@ #include #include #include +#include #include #include @@ -128,8 +128,6 @@ static struct zs_parms ds_parms = { #define BUS_PRESENT (DS_BUS_PRESENT) -DEFINE_SPINLOCK(zs_lock); - struct dec_zschannel zs_channels[NUM_CHANNELS]; struct dec_serial zs_soft[NUM_CHANNELS]; int zs_channels_found; @@ -161,6 +159,8 @@ static unsigned char zs_init_regs[16] __initdata = { 0 /* write 15 */ }; +DECLARE_TASK_QUEUE(tq_zs_serial); + static struct tty_driver *serial_driver; /* serial subtype definitions */ @@ -294,7 +294,8 @@ static inline void zs_rtsdtr(struct dec_serial *info, int which, int set) { unsigned long flags; - spin_lock_irqsave(&zs_lock, flags); + + save_flags(flags); cli(); if (info->zs_channel != info->zs_chan_a) { if (set) { info->zs_chan_a->curregs[5] |= (which & (RTS | DTR)); @@ -303,7 +304,7 @@ static inline void zs_rtsdtr(struct dec_serial *info, int which, int set) } write_zsreg(info->zs_chan_a, 5, info->zs_chan_a->curregs[5]); } - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); } /* Utility routines for the Zilog */ @@ -344,10 +345,12 @@ static inline void rs_recv_clear(struct dec_zschannel *zsc) * This routine is used by the interrupt handler to schedule * processing in the software interrupt portion of the driver. */ -static _INLINE_ void rs_sched_event(struct dec_serial *info, int event) +static _INLINE_ void rs_sched_event(struct dec_serial *info, + int event) { info->event |= 1 << event; - tasklet_schedule(&info->tlet); + queue_task(&info->tqueue, &tq_zs_serial); + mark_bh(SERIAL_BH); } static _INLINE_ void receive_chars(struct dec_serial *info, @@ -494,10 +497,9 @@ static _INLINE_ void status_handle(struct dec_serial *info) /* * This is the serial driver's generic interrupt routine */ -static irqreturn_t rs_interrupt(int irq, void *dev_id, struct pt_regs *regs) +void rs_interrupt(int irq, void *dev_id, struct pt_regs * regs) { struct dec_serial *info = (struct dec_serial *) dev_id; - irqreturn_t status = IRQ_NONE; unsigned char zs_intreg; int shift; @@ -519,8 +521,6 @@ static irqreturn_t rs_interrupt(int irq, void *dev_id, struct pt_regs *regs) if ((zs_intreg & CHAN_IRQMASK) == 0) break; - status = IRQ_HANDLED; - if (zs_intreg & CHBRxIP) { receive_chars(info, regs); } @@ -534,8 +534,6 @@ static irqreturn_t rs_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* Why do we need this ? */ write_zsreg(info->zs_channel, 0, RES_H_IUS); - - return status; } #ifdef ZS_DEBUG_REGS @@ -580,12 +578,12 @@ static void rs_stop(struct tty_struct *tty) return; #if 1 - spin_lock_irqsave(&zs_lock, flags); + save_flags(flags); cli(); if (info->zs_channel->curregs[5] & TxENAB) { info->zs_channel->curregs[5] &= ~TxENAB; write_zsreg(info->zs_channel, 5, info->zs_channel->curregs[5]); } - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); #endif } @@ -597,7 +595,7 @@ static void rs_start(struct tty_struct *tty) if (serial_paranoia_check(info, tty->name, "rs_start")) return; - spin_lock_irqsave(&zs_lock, flags); + save_flags(flags); cli(); #if 1 if (info->xmit_cnt && info->xmit_buf && !(info->zs_channel->curregs[5] & TxENAB)) { info->zs_channel->curregs[5] |= TxENAB; @@ -608,7 +606,7 @@ static void rs_start(struct tty_struct *tty) transmit_chars(info); } #endif - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); } /* @@ -620,8 +618,12 @@ static void rs_start(struct tty_struct *tty) * interrupt driver proper are done; the interrupt driver schedules * them using rs_sched_event(), and they get done here. */ +static void do_serial_bh(void) +{ + run_task_queue(&tq_zs_serial); +} -static void do_softint(unsigned long private_) +static void do_softint(void *private_) { struct dec_serial *info = (struct dec_serial *) private_; struct tty_struct *tty; @@ -632,11 +634,10 @@ static void do_softint(unsigned long private_) if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) { tty_wakeup(tty); - wake_up_interruptible(&tty->write_wait); } } -static int zs_startup(struct dec_serial * info) +int zs_startup(struct dec_serial * info) { unsigned long flags; @@ -649,7 +650,7 @@ static int zs_startup(struct dec_serial * info) return -ENOMEM; } - spin_lock_irqsave(&zs_lock, flags); + save_flags(flags); cli(); #ifdef SERIAL_DEBUG_OPEN printk("starting up ttyS%d (irq %d)...", info->line, info->irq); @@ -705,7 +706,7 @@ static int zs_startup(struct dec_serial * info) info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; info->flags |= ZILOG_INITIALIZED; - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); return 0; } @@ -725,7 +726,7 @@ static void shutdown(struct dec_serial * info) info->irq); #endif - spin_lock_irqsave(&zs_lock, flags); + save_flags(flags); cli(); /* Disable interrupts */ if (info->xmit_buf) { free_page((unsigned long) info->xmit_buf); @@ -748,7 +749,7 @@ static void shutdown(struct dec_serial * info) set_bit(TTY_IO_ERROR, &info->tty->flags); info->flags &= ~ZILOG_INITIALIZED; - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); } /* @@ -784,7 +785,7 @@ static void change_speed(struct dec_serial *info) i += 15; } - spin_lock_irqsave(&zs_lock, flags); + save_flags(flags); cli(); info->zs_baud = baud_table[i]; if (info->zs_baud) { brg = BPS_TO_BRG(info->zs_baud, zs_parms->clock/info->clk_divisor); @@ -857,7 +858,7 @@ static void change_speed(struct dec_serial *info) /* Load up the new values */ load_zsregs(info->zs_channel, info->zs_channel->curregs); - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); } static void rs_flush_chars(struct tty_struct *tty) @@ -873,9 +874,9 @@ static void rs_flush_chars(struct tty_struct *tty) return; /* Enable transmitter */ - spin_lock_irqsave(&zs_lock, flags); + save_flags(flags); cli(); transmit_chars(info); - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); } static int rs_write(struct tty_struct * tty, @@ -891,17 +892,26 @@ static int rs_write(struct tty_struct * tty, if (!tty || !info->xmit_buf) return 0; + save_flags(flags); while (1) { - spin_lock_irqsave(&zs_lock, flags); + cli(); c = min(count, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, SERIAL_XMIT_SIZE - info->xmit_head)); if (c <= 0) break; - memcpy(info->xmit_buf + info->xmit_head, buf, c); + if (from_user) { + down(&tmp_buf_sem); + copy_from_user(tmp_buf, buf, c); + c = min(c, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, + SERIAL_XMIT_SIZE - info->xmit_head)); + memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c); + up(&tmp_buf_sem); + } else + memcpy(info->xmit_buf + info->xmit_head, buf, c); info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE-1); info->xmit_cnt += c; - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); buf += c; count -= c; total += c; @@ -910,7 +920,7 @@ static int rs_write(struct tty_struct * tty, if (info->xmit_cnt && !tty->stopped && !info->tx_stopped && !info->tx_active) transmit_chars(info); - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); return total; } @@ -942,9 +952,9 @@ static void rs_flush_buffer(struct tty_struct *tty) if (serial_paranoia_check(info, tty->name, "rs_flush_buffer")) return; - spin_lock_irq(&zs_lock); + cli(); info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; - spin_unlock_irq(&zs_lock); + sti(); tty_wakeup(tty); } @@ -972,11 +982,11 @@ static void rs_throttle(struct tty_struct * tty) return; if (I_IXOFF(tty)) { - spin_lock_irqsave(&zs_lock, flags); + save_flags(flags); cli(); info->x_char = STOP_CHAR(tty); if (!info->tx_active) transmit_chars(info); - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); } if (C_CRTSCTS(tty)) { @@ -1000,7 +1010,7 @@ static void rs_unthrottle(struct tty_struct * tty) return; if (I_IXOFF(tty)) { - spin_lock_irqsave(&zs_lock, flags); + save_flags(flags); cli(); if (info->x_char) info->x_char = 0; else { @@ -1008,7 +1018,7 @@ static void rs_unthrottle(struct tty_struct * tty) if (!info->tx_active) transmit_chars(info); } - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); } if (C_CRTSCTS(tty)) { @@ -1101,9 +1111,9 @@ static int get_lsr_info(struct dec_serial * info, unsigned int *value) { unsigned char status; - spin_lock(&zs_lock); + cli(); status = read_zsreg(info->zs_channel, 0); - spin_unlock_irq(&zs_lock); + sti(); put_user(status,value); return 0; } @@ -1126,11 +1136,11 @@ static int rs_tiocmget(struct tty_struct *tty, struct file *file) if (info->zs_channel == info->zs_chan_a) result = 0; else { - spin_lock(&zs_lock); + cli(); control = info->zs_chan_a->curregs[5]; status_a = read_zsreg(info->zs_chan_a, 0); status_b = read_zsreg(info->zs_channel, 0); - spin_unlock_irq(&zs_lock); + sti(); result = ((control & RTS) ? TIOCM_RTS: 0) | ((control & DTR) ? TIOCM_DTR: 0) | ((status_b & DCD) ? TIOCM_CAR: 0) @@ -1145,6 +1155,8 @@ static int rs_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear) { struct dec_serial * info = (struct dec_serial *)tty->driver_data; + int error; + unsigned int arg, bits; if (info->hook) return -ENODEV; @@ -1158,7 +1170,8 @@ static int rs_tiocmset(struct tty_struct *tty, struct file *file, if (info->zs_channel == info->zs_chan_a) return 0; - spin_lock(&zs_lock); + get_user(arg, value); + cli(); if (set & TIOCM_RTS) info->zs_chan_a->curregs[5] |= RTS; if (set & TIOCM_DTR) @@ -1168,7 +1181,7 @@ static int rs_tiocmset(struct tty_struct *tty, struct file *file, if (clear & TIOCM_DTR) info->zs_chan_a->curregs[5] &= ~DTR; write_zsreg(info->zs_chan_a, 5, info->zs_chan_a->curregs[5]); - spin_unlock_irq(&zs_lock); + sti(); return 0; } @@ -1185,18 +1198,19 @@ static void rs_break(struct tty_struct *tty, int break_state) if (!info->port) return; - spin_lock_irqsave(&zs_lock, flags); + save_flags(flags); cli(); if (break_state == -1) info->zs_channel->curregs[5] |= SND_BRK; else info->zs_channel->curregs[5] &= ~SND_BRK; write_zsreg(info->zs_channel, 5, info->zs_channel->curregs[5]); - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); } static int rs_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) { + int error; struct dec_serial * info = (struct dec_serial *)tty->driver_data; if (info->hook) @@ -1273,10 +1287,10 @@ static void rs_close(struct tty_struct *tty, struct file * filp) if (!info || serial_paranoia_check(info, tty->name, "rs_close")) return; - spin_lock_irqsave(&zs_lock, flags); + save_flags(flags); cli(); if (tty_hung_up_p(filp)) { - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); return; } @@ -1301,7 +1315,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) info->count = 0; } if (info->count) { - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); return; } info->flags |= ZILOG_CLOSING; @@ -1344,7 +1358,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) } info->flags &= ~(ZILOG_NORMAL_ACTIVE|ZILOG_CLOSING); wake_up_interruptible(&info->close_wait); - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); } /* @@ -1384,7 +1398,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) /* * rs_hangup() --- called by tty_hangup() when a hangup is signaled. */ -static void rs_hangup(struct tty_struct *tty) +void rs_hangup(struct tty_struct *tty) { struct dec_serial * info = (struct dec_serial *)tty->driver_data; @@ -1452,16 +1466,16 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, printk("block_til_ready before block: ttyS%d, count = %d\n", info->line, info->count); #endif - spin_lock(&zs_lock); + cli(); if (!tty_hung_up_p(filp)) info->count--; - spin_unlock_irq(&zs_lock); + sti(); info->blocked_open++; while (1) { - spin_lock(&zs_lock); + cli(); if (tty->termios->c_cflag & CBAUD) zs_rtsdtr(info, RTS | DTR, 1); - spin_unlock_irq(&zs_lock); + sti(); set_current_state(TASK_INTERRUPTIBLE); if (tty_hung_up_p(filp) || !(info->flags & ZILOG_INITIALIZED)) { @@ -1509,7 +1523,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * the IRQ chain. It also performs the serial-specific * initialization for the tty structure. */ -static int rs_open(struct tty_struct *tty, struct file * filp) +int rs_open(struct tty_struct *tty, struct file * filp) { struct dec_serial *info; int retval, line; @@ -1692,7 +1706,7 @@ static void __init probe_sccs(void) } } - spin_lock_irqsave(&zs_lock, flags); + save_and_cli(flags); for (n = 0; n < zs_channels_found; n++) { if (n % 2 == 0) { write_zsreg(zs_soft[n].zs_chan_a, R9, FHWRES); @@ -1702,7 +1716,7 @@ static void __init probe_sccs(void) load_zsregs(zs_soft[n].zs_channel, zs_soft[n].zs_channel->curregs); } - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); } static struct tty_operations serial_ops = { @@ -1735,6 +1749,9 @@ int __init zs_init(void) if(!BUS_PRESENT) return -ENODEV; + /* Setup base handler, and timer table. */ + init_bh(SERIAL_BH, do_serial_bh); + /* Find out how many Z8530 SCCs we have */ if (zs_chain == 0) probe_sccs(); @@ -1783,7 +1800,8 @@ int __init zs_init(void) info->event = 0; info->count = 0; info->blocked_open = 0; - tasklet_init(&info->tlet, do_softint, (unsigned long)info); + info->tqueue.routine = do_softint; + info->tqueue.data = info; init_waitqueue_head(&info->open_wait); init_waitqueue_head(&info->close_wait); printk("ttyS%02d at 0x%08x (irq = %d) is a Z85C30 SCC\n", @@ -1815,7 +1833,8 @@ int __init zs_init(void) /* * polling I/O routines */ -static int zs_poll_tx_char(void *handle, unsigned char ch) +static int +zs_poll_tx_char(void *handle, unsigned char ch) { struct dec_serial *info = handle; struct dec_zschannel *chan = info->zs_channel; @@ -1838,7 +1857,8 @@ static int zs_poll_tx_char(void *handle, unsigned char ch) return -ENODEV; } -static int zs_poll_rx_char(void *handle) +static int +zs_poll_rx_char(void *handle) { struct dec_serial *info = handle; struct dec_zschannel *chan = info->zs_channel; @@ -2017,7 +2037,7 @@ static int __init serial_console_setup(struct console *co, char *options) } co->cflag = cflag; - spin_lock_irqsave(&zs_lock, flags); + save_and_cli(flags); /* * Set up the baud rate generator. @@ -2072,7 +2092,7 @@ static int __init serial_console_setup(struct console *co, char *options) zs_soft[co->index].clk_divisor = clk_divisor; zs_soft[co->index].zs_baud = get_zsbaud(&zs_soft[co->index]); - spin_unlock_irqrestore(&zs_lock, flags); + restore_flags(flags); return 0; } @@ -2209,3 +2229,5 @@ void __init zs_kgdb_hook(int tty_num) set_debug_traps(); /* init stub */ } #endif /* ifdef CONFIG_KGDB */ + + diff --git a/trunk/drivers/tc/zs.h b/trunk/drivers/tc/zs.h index 13512200ceba..c52edffa6049 100644 --- a/trunk/drivers/tc/zs.h +++ b/trunk/drivers/tc/zs.h @@ -6,14 +6,14 @@ * * Copyright (C) 1996 Paul Mackerras (Paul.Mackerras@cs.anu.edu.au) * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 2004, 2005 Maciej W. Rozycki + * Copyright (C) 2004 Maciej W. Rozycki */ #ifndef _DECSERIAL_H #define _DECSERIAL_H #include -#define NUM_ZSREGS 16 +#define NUM_ZSREGS 16 struct serial_struct { int type; @@ -139,7 +139,8 @@ struct dec_serial { int xmit_head; int xmit_tail; int xmit_cnt; - struct tasklet_struct tlet; + struct tq_struct tqueue; + struct tq_struct tqueue_hangup; wait_queue_head_t open_wait; wait_queue_head_t close_wait; }; @@ -281,7 +282,7 @@ struct dec_serial { #define DLC 4 /* Disable Lower Chain */ #define MIE 8 /* Master Interrupt Enable */ #define STATHI 0x10 /* Status high */ -#define SOFTACK 0x20 /* Software Interrupt Acknowledge */ +#define SOFTACK 0x20 /* Software Interrupt Acknowledge */ #define NORESET 0 /* No reset on write to R9 */ #define CHRB 0x40 /* Reset channel B */ #define CHRA 0x80 /* Reset channel A */ @@ -394,8 +395,8 @@ struct dec_serial { /* Read Register 15 (value of WR 15) */ /* Misc macros */ -#define ZS_CLEARERR(channel) (write_zsreg(channel, 0, ERR_RES)) -#define ZS_CLEARFIFO(channel) do { volatile unsigned char garbage; \ +#define ZS_CLEARERR(channel) (write_zsreg(channel, 0, ERR_RES)) +#define ZS_CLEARFIFO(channel) do { volatile unsigned char garbage; \ garbage = read_zsdata(channel); \ garbage = read_zsdata(channel); \ garbage = read_zsdata(channel); \ diff --git a/trunk/drivers/usb/Makefile b/trunk/drivers/usb/Makefile index 3639c3f8d357..a50c2bc506f2 100644 --- a/trunk/drivers/usb/Makefile +++ b/trunk/drivers/usb/Makefile @@ -22,7 +22,6 @@ obj-$(CONFIG_USB_MIDI) += class/ obj-$(CONFIG_USB_PRINTER) += class/ obj-$(CONFIG_USB_STORAGE) += storage/ -obj-$(CONFIG_USB) += storage/ obj-$(CONFIG_USB_AIPTEK) += input/ obj-$(CONFIG_USB_ATI_REMOTE) += input/ diff --git a/trunk/drivers/usb/atm/Kconfig b/trunk/drivers/usb/atm/Kconfig index 550ddfa71a43..f429862e0974 100644 --- a/trunk/drivers/usb/atm/Kconfig +++ b/trunk/drivers/usb/atm/Kconfig @@ -44,19 +44,6 @@ config USB_CXACRU To compile this driver as a module, choose M here: the module will be called cxacru. -config USB_UEAGLEATM - tristate "ADI 930 and eagle USB DSL modem" - depends on USB_ATM - select FW_LOADER - help - Say Y here if you have an ADSL USB modem based on the ADI 930 - or eagle chipset. In order to use your modem you will need to - install firmwares and CMV (Command Management Variables); see - for details. - - To compile this driver as a module, choose M here: the - module will be called ueagle-atm. - config USB_XUSBATM tristate "Other USB DSL modem support" depends on USB_ATM diff --git a/trunk/drivers/usb/atm/Makefile b/trunk/drivers/usb/atm/Makefile index 4c4a776ab1cd..751f297be2ef 100644 --- a/trunk/drivers/usb/atm/Makefile +++ b/trunk/drivers/usb/atm/Makefile @@ -4,10 +4,5 @@ obj-$(CONFIG_USB_CXACRU) += cxacru.o obj-$(CONFIG_USB_SPEEDTOUCH) += speedtch.o -obj-$(CONFIG_USB_UEAGLEATM) += ueagle-atm.o obj-$(CONFIG_USB_ATM) += usbatm.o obj-$(CONFIG_USB_XUSBATM) += xusbatm.o - -ifeq ($(CONFIG_USB_DEBUG),y) -EXTRA_CFLAGS += -DDEBUG -endif diff --git a/trunk/drivers/usb/atm/cxacru.c b/trunk/drivers/usb/atm/cxacru.c index af0a41e7870e..79861ee12a29 100644 --- a/trunk/drivers/usb/atm/cxacru.c +++ b/trunk/drivers/usb/atm/cxacru.c @@ -787,9 +787,6 @@ static const struct usb_device_id cxacru_usb_ids[] = { { /* V = Conexant P = ADSL modem (Hasbani project) */ USB_DEVICE(0x0572, 0xcb00), .driver_info = (unsigned long) &cxacru_cb00 }, - { /* V = Conexant P = ADSL modem (Well PTI-800 */ - USB_DEVICE(0x0572, 0xcb02), .driver_info = (unsigned long) &cxacru_cb00 - }, { /* V = Conexant P = ADSL modem */ USB_DEVICE(0x0572, 0xcb01), .driver_info = (unsigned long) &cxacru_cb00 }, @@ -853,6 +850,7 @@ static int cxacru_usb_probe(struct usb_interface *intf, const struct usb_device_ } static struct usb_driver cxacru_usb_driver = { + .owner = THIS_MODULE, .name = cxacru_driver_name, .probe = cxacru_usb_probe, .disconnect = usbatm_usb_disconnect, diff --git a/trunk/drivers/usb/atm/speedtch.c b/trunk/drivers/usb/atm/speedtch.c index b28336148658..d0cbbb7f0385 100644 --- a/trunk/drivers/usb/atm/speedtch.c +++ b/trunk/drivers/usb/atm/speedtch.c @@ -659,6 +659,7 @@ MODULE_DEVICE_TABLE(usb, speedtch_usb_ids); static int speedtch_usb_probe(struct usb_interface *, const struct usb_device_id *); static struct usb_driver speedtch_usb_driver = { + .owner = THIS_MODULE, .name = speedtch_driver_name, .probe = speedtch_usb_probe, .disconnect = usbatm_usb_disconnect, diff --git a/trunk/drivers/usb/atm/ueagle-atm.c b/trunk/drivers/usb/atm/ueagle-atm.c deleted file mode 100644 index 7d2a679989ed..000000000000 --- a/trunk/drivers/usb/atm/ueagle-atm.c +++ /dev/null @@ -1,1820 +0,0 @@ -/*- - * Copyright (c) 2003, 2004 - * Damien Bergamini . All rights reserved. - * - * Copyright (c) 2005 Matthieu Castet - * - * This software is available to you under a choice of one of two - * licenses. You may choose to be licensed under the terms of the GNU - * General Public License (GPL) Version 2, available from the file - * COPYING in the main directory of this source tree, or the - * BSD license below: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice unmodified, this list of conditions, and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * GPL license : - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * - * HISTORY : some part of the code was base on ueagle 1.3 BSD driver, - * Damien Bergamini agree to put his code under a DUAL GPL/BSD license. - * - * The rest of the code was was rewritten from scratch. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "usbatm.h" - -#define EAGLEUSBVERSION "ueagle 1.1" - - -/* - * Debug macros - */ -#define uea_dbg(usb_dev, format, args...) \ - do { \ - if (debug >= 1) \ - dev_dbg(&(usb_dev)->dev, \ - "[ueagle-atm dbg] %s: " format, \ - __FUNCTION__, ##args); \ - } while (0) - -#define uea_vdbg(usb_dev, format, args...) \ - do { \ - if (debug >= 2) \ - dev_dbg(&(usb_dev)->dev, \ - "[ueagle-atm vdbg] " format, ##args); \ - } while (0) - -#define uea_enters(usb_dev) \ - uea_vdbg(usb_dev, "entering %s\n", __FUNCTION__) - -#define uea_leaves(usb_dev) \ - uea_vdbg(usb_dev, "leaving %s\n", __FUNCTION__) - -#define uea_err(usb_dev, format,args...) \ - dev_err(&(usb_dev)->dev ,"[UEAGLE-ATM] " format , ##args) - -#define uea_warn(usb_dev, format,args...) \ - dev_warn(&(usb_dev)->dev ,"[Ueagle-atm] " format, ##args) - -#define uea_info(usb_dev, format,args...) \ - dev_info(&(usb_dev)->dev ,"[ueagle-atm] " format, ##args) - -struct uea_cmvs { - u32 address; - u16 offset; - u32 data; -} __attribute__ ((packed)); - -struct uea_softc { - struct usb_device *usb_dev; - struct usbatm_data *usbatm; - - int modem_index; - unsigned int driver_info; - - int booting; - int reset; - - wait_queue_head_t sync_q; - - struct task_struct *kthread; - u32 data; - wait_queue_head_t cmv_ack_wait; - int cmv_ack; - - struct work_struct task; - u16 pageno; - u16 ovl; - - const struct firmware *dsp_firm; - struct urb *urb_int; - - u8 cmv_function; - u16 cmv_idx; - u32 cmv_address; - u16 cmv_offset; - - /* keep in sync with eaglectl */ - struct uea_stats { - struct { - u32 state; - u32 flags; - u32 mflags; - u32 vidcpe; - u32 vidco; - u32 dsrate; - u32 usrate; - u32 dsunc; - u32 usunc; - u32 dscorr; - u32 uscorr; - u32 txflow; - u32 rxflow; - u32 usattenuation; - u32 dsattenuation; - u32 dsmargin; - u32 usmargin; - u32 firmid; - } phy; - } stats; -}; - -/* - * Elsa IDs - */ -#define ELSA_VID 0x05CC -#define ELSA_PID_PSTFIRM 0x3350 -#define ELSA_PID_PREFIRM 0x3351 - -/* - * Sagem USB IDs - */ -#define EAGLE_VID 0x1110 -#define EAGLE_I_PID_PREFIRM 0x9010 /* Eagle I */ -#define EAGLE_I_PID_PSTFIRM 0x900F /* Eagle I */ - -#define EAGLE_IIC_PID_PREFIRM 0x9024 /* Eagle IIC */ -#define EAGLE_IIC_PID_PSTFIRM 0x9023 /* Eagle IIC */ - -#define EAGLE_II_PID_PREFIRM 0x9022 /* Eagle II */ -#define EAGLE_II_PID_PSTFIRM 0x9021 /* Eagle II */ - -/* - * Eagle III Pid - */ -#define EAGLE_III_PID_PREFIRM 0x9032 /* Eagle III */ -#define EAGLE_III_PID_PSTFIRM 0x9031 /* Eagle III */ - -/* - * USR USB IDs - */ -#define USR_VID 0x0BAF -#define MILLER_A_PID_PREFIRM 0x00F2 -#define MILLER_A_PID_PSTFIRM 0x00F1 -#define MILLER_B_PID_PREFIRM 0x00FA -#define MILLER_B_PID_PSTFIRM 0x00F9 -#define HEINEKEN_A_PID_PREFIRM 0x00F6 -#define HEINEKEN_A_PID_PSTFIRM 0x00F5 -#define HEINEKEN_B_PID_PREFIRM 0x00F8 -#define HEINEKEN_B_PID_PSTFIRM 0x00F7 - -#define PREFIRM 0 -#define PSTFIRM (1<<7) -enum { - ADI930 = 0, - EAGLE_I, - EAGLE_II, - EAGLE_III -}; - -/* macros for both struct usb_device_id and struct uea_softc */ -#define UEA_IS_PREFIRM(x) \ - (!((x)->driver_info & PSTFIRM)) -#define UEA_CHIP_VERSION(x) \ - ((x)->driver_info & 0xf) - -#define IS_ISDN(sc) \ - (le16_to_cpu(sc->usb_dev->descriptor.bcdDevice) & 0x80) - -#define INS_TO_USBDEV(ins) ins->usb_dev - -#define GET_STATUS(data) \ - ((data >> 8) & 0xf) -#define IS_OPERATIONAL(sc) \ - (GET_STATUS(sc->stats.phy.state) == 2) - -/* - * Set of macros to handle unaligned data in the firmware blob. - * The FW_GET_BYTE() macro is provided only for consistency. - */ - -#define FW_GET_BYTE(p) *((__u8 *) (p)) -#define FW_GET_WORD(p) le16_to_cpu(get_unaligned((__le16 *) (p))) -#define FW_GET_LONG(p) le32_to_cpu(get_unaligned((__le32 *) (p))) - -#define FW_DIR "ueagle-atm/" -#define NB_MODEM 4 - -#define BULK_TIMEOUT 300 -#define CTRL_TIMEOUT 1000 - -#define ACK_TIMEOUT msecs_to_jiffies(1500) - -#define UEA_INTR_IFACE_NO 0 -#define UEA_US_IFACE_NO 1 -#define UEA_DS_IFACE_NO 2 - -#define FASTEST_ISO_INTF 8 - -#define UEA_BULK_DATA_PIPE 0x02 -#define UEA_IDMA_PIPE 0x04 -#define UEA_INTR_PIPE 0x04 -#define UEA_ISO_DATA_PIPE 0x08 - -#define UEA_SET_BLOCK 0x0001 -#define UEA_SET_MODE 0x0003 -#define UEA_SET_2183_DATA 0x0004 -#define UEA_SET_TIMEOUT 0x0011 - -#define UEA_LOOPBACK_OFF 0x0002 -#define UEA_LOOPBACK_ON 0x0003 -#define UEA_BOOT_IDMA 0x0006 -#define UEA_START_RESET 0x0007 -#define UEA_END_RESET 0x0008 - -#define UEA_SWAP_MAILBOX (0x3fcd | 0x4000) -#define UEA_MPTX_START (0x3fce | 0x4000) -#define UEA_MPTX_MAILBOX (0x3fd6 | 0x4000) -#define UEA_MPRX_MAILBOX (0x3fdf | 0x4000) - -/* structure describing a block within a DSP page */ -struct block_info { - __le16 wHdr; -#define UEA_BIHDR 0xabcd - __le16 wAddress; - __le16 wSize; - __le16 wOvlOffset; - __le16 wOvl; /* overlay */ - __le16 wLast; -} __attribute__ ((packed)); -#define BLOCK_INFO_SIZE 12 - -/* structure representing a CMV (Configuration and Management Variable) */ -struct cmv { - __le16 wPreamble; -#define PREAMBLE 0x535c - __u8 bDirection; -#define MODEMTOHOST 0x01 -#define HOSTTOMODEM 0x10 - __u8 bFunction; -#define FUNCTION_TYPE(f) ((f) >> 4) -#define MEMACCESS 0x1 -#define ADSLDIRECTIVE 0x7 - -#define FUNCTION_SUBTYPE(f) ((f) & 0x0f) -/* for MEMACCESS */ -#define REQUESTREAD 0x0 -#define REQUESTWRITE 0x1 -#define REPLYREAD 0x2 -#define REPLYWRITE 0x3 -/* for ADSLDIRECTIVE */ -#define KERNELREADY 0x0 -#define MODEMREADY 0x1 - -#define MAKEFUNCTION(t, s) (((t) & 0xf) << 4 | ((s) & 0xf)) - __le16 wIndex; - __le32 dwSymbolicAddress; -#define MAKESA(a, b, c, d) \ - (((c) & 0xff) << 24 | \ - ((d) & 0xff) << 16 | \ - ((a) & 0xff) << 8 | \ - ((b) & 0xff)) - -#define SA_CNTL MAKESA('C', 'N', 'T', 'L') -#define SA_DIAG MAKESA('D', 'I', 'A', 'G') -#define SA_INFO MAKESA('I', 'N', 'F', 'O') -#define SA_OPTN MAKESA('O', 'P', 'T', 'N') -#define SA_RATE MAKESA('R', 'A', 'T', 'E') -#define SA_STAT MAKESA('S', 'T', 'A', 'T') - __le16 wOffsetAddress; - __le32 dwData; -} __attribute__ ((packed)); -#define CMV_SIZE 16 - -/* structure representing swap information */ -struct swap_info { - __u8 bSwapPageNo; - __u8 bOvl; /* overlay */ -} __attribute__ ((packed)); - -/* structure representing interrupt data */ -struct intr_pkt { - __u8 bType; - __u8 bNotification; - __le16 wValue; - __le16 wIndex; - __le16 wLength; - __le16 wInterrupt; -#define INT_LOADSWAPPAGE 0x0001 -#define INT_INCOMINGCMV 0x0002 - union { - struct { - struct swap_info swapinfo; - __le16 wDataSize; - } __attribute__ ((packed)) s1; - - struct { - struct cmv cmv; - __le16 wDataSize; - } __attribute__ ((packed)) s2; - } __attribute__ ((packed)) u; -#define bSwapPageNo u.s1.swapinfo.bSwapPageNo -#define bOvl u.s1.swapinfo.bOvl -} __attribute__ ((packed)); -#define INTR_PKT_SIZE 28 - -static struct usb_driver uea_driver; -static DECLARE_MUTEX(uea_semaphore); -static const char *chip_name[] = {"ADI930", "Eagle I", "Eagle II", "Eagle III"}; - -static int modem_index; -static unsigned int debug; -static int sync_wait[NB_MODEM]; -static char *cmv_file[NB_MODEM]; - -module_param(debug, uint, 0644); -MODULE_PARM_DESC(debug, "module debug level (0=off,1=on,2=verbose)"); -module_param_array(sync_wait, bool, NULL, 0644); -MODULE_PARM_DESC(sync_wait, "wait the synchronisation before starting ATM"); -module_param_array(cmv_file, charp, NULL, 0644); -MODULE_PARM_DESC(cmv_file, - "file name with configuration and management variables"); - -#define UPDATE_ATM_STAT(type, val) \ - do { \ - if (sc->usbatm->atm_dev) \ - sc->usbatm->atm_dev->type = val; \ - } while (0) - -/* Firmware loading */ -#define LOAD_INTERNAL 0xA0 -#define F8051_USBCS 0x7f92 - -/** - * uea_send_modem_cmd - Send a command for pre-firmware devices. - */ -static int uea_send_modem_cmd(struct usb_device *usb, - u16 addr, u16 size, u8 * buff) -{ - int ret = -ENOMEM; - u8 *xfer_buff; - - xfer_buff = kmalloc(size, GFP_KERNEL); - if (xfer_buff) { - memcpy(xfer_buff, buff, size); - ret = usb_control_msg(usb, - usb_sndctrlpipe(usb, 0), - LOAD_INTERNAL, - USB_DIR_OUT | USB_TYPE_VENDOR | - USB_RECIP_DEVICE, addr, 0, xfer_buff, - size, CTRL_TIMEOUT); - kfree(xfer_buff); - } - - if (ret < 0) - return ret; - - return (ret == size) ? 0 : -EIO; -} - -static void uea_upload_pre_firmware(const struct firmware *fw_entry, void *context) -{ - struct usb_device *usb = context; - u8 *pfw, value; - u32 crc = 0; - int ret, size; - - uea_enters(usb); - if (!fw_entry) { - uea_err(usb, "firmware is not available\n"); - goto err; - } - - pfw = fw_entry->data; - size = fw_entry->size; - if (size < 4) - goto err_fw_corrupted; - - crc = FW_GET_LONG(pfw); - pfw += 4; - size -= 4; - if (crc32_be(0, pfw, size) != crc) - goto err_fw_corrupted; - - /* - * Start to upload formware : send reset - */ - value = 1; - ret = uea_send_modem_cmd(usb, F8051_USBCS, sizeof(value), &value); - - if (ret < 0) { - uea_err(usb, "modem reset failed with error %d\n", ret); - goto err; - } - - while (size > 3) { - u8 len = FW_GET_BYTE(pfw); - u16 add = FW_GET_WORD(pfw + 1); - - size -= len + 3; - if (size < 0) - goto err_fw_corrupted; - - ret = uea_send_modem_cmd(usb, add, len, pfw + 3); - if (ret < 0) { - uea_err(usb, "uploading firmware data failed " - "with error %d\n", ret); - goto err; - } - pfw += len + 3; - } - - if (size != 0) - goto err_fw_corrupted; - - /* - * Tell the modem we finish : de-assert reset - */ - value = 0; - ret = uea_send_modem_cmd(usb, F8051_USBCS, 1, &value); - if (ret < 0) - uea_err(usb, "modem de-assert failed with error %d\n", ret); - else - uea_info(usb, "firmware uploaded\n"); - - uea_leaves(usb); - return; - -err_fw_corrupted: - uea_err(usb, "firmware is corrupted\n"); -err: - uea_leaves(usb); -} - -/** - * uea_load_firmware - Load usb firmware for pre-firmware devices. - */ -static int uea_load_firmware(struct usb_device *usb, unsigned int ver) -{ - int ret; - char *fw_name = FW_DIR "eagle.fw"; - - uea_enters(usb); - uea_info(usb, "pre-firmware device, uploading firmware\n"); - - switch (ver) { - case ADI930: - fw_name = FW_DIR "adi930.fw"; - break; - case EAGLE_I: - fw_name = FW_DIR "eagleI.fw"; - break; - case EAGLE_II: - fw_name = FW_DIR "eagleII.fw"; - break; - case EAGLE_III: - fw_name = FW_DIR "eagleIII.fw"; - break; - } - - ret = request_firmware_nowait(THIS_MODULE, 1, fw_name, &usb->dev, usb, uea_upload_pre_firmware); - if (ret) - uea_err(usb, "firmware %s is not available\n", fw_name); - else - uea_info(usb, "loading firmware %s\n", fw_name); - - uea_leaves(usb); - return ret; -} - -/* modem management : dsp firmware, send/read CMV, monitoring statistic - */ - -/* - * Make sure that the DSP code provided is safe to use. - */ -static int check_dsp(u8 *dsp, unsigned int len) -{ - u8 pagecount, blockcount; - u16 blocksize; - u32 pageoffset; - unsigned int i, j, p, pp; - - pagecount = FW_GET_BYTE(dsp); - p = 1; - - /* enough space for page offsets? */ - if (p + 4 * pagecount > len) - return 1; - - for (i = 0; i < pagecount; i++) { - - pageoffset = FW_GET_LONG(dsp + p); - p += 4; - - if (pageoffset == 0) - continue; - - /* enough space for blockcount? */ - if (pageoffset >= len) - return 1; - - pp = pageoffset; - blockcount = FW_GET_BYTE(dsp + pp); - pp += 1; - - for (j = 0; j < blockcount; j++) { - - /* enough space for block header? */ - if (pp + 4 > len) - return 1; - - pp += 2; /* skip blockaddr */ - blocksize = FW_GET_WORD(dsp + pp); - pp += 2; - - /* enough space for block data? */ - if (pp + blocksize > len) - return 1; - - pp += blocksize; - } - } - - return 0; -} - -/* - * send data to the idma pipe - * */ -static int uea_idma_write(struct uea_softc *sc, void *data, u32 size) -{ - int ret = -ENOMEM; - u8 *xfer_buff; - int bytes_read; - - xfer_buff = kmalloc(size, GFP_KERNEL); - if (!xfer_buff) { - uea_err(INS_TO_USBDEV(sc), "can't allocate xfer_buff\n"); - return ret; - } - - memcpy(xfer_buff, data, size); - - ret = usb_bulk_msg(sc->usb_dev, - usb_sndbulkpipe(sc->usb_dev, UEA_IDMA_PIPE), - xfer_buff, size, &bytes_read, BULK_TIMEOUT); - - kfree(xfer_buff); - if (ret < 0) - return ret; - if (size != bytes_read) { - uea_err(INS_TO_USBDEV(sc), "size != bytes_read %d %d\n", size, - bytes_read); - return -EIO; - } - - return 0; -} - -static int request_dsp(struct uea_softc *sc) -{ - int ret; - char *dsp_name; - - if (UEA_CHIP_VERSION(sc) == ADI930) { - if (IS_ISDN(sc)) - dsp_name = FW_DIR "DSP9i.bin"; - else - dsp_name = FW_DIR "DSP9p.bin"; - } else { - if (IS_ISDN(sc)) - dsp_name = FW_DIR "DSPei.bin"; - else - dsp_name = FW_DIR "DSPep.bin"; - } - - ret = request_firmware(&sc->dsp_firm, - dsp_name, &sc->usb_dev->dev); - if (ret < 0) { - uea_err(INS_TO_USBDEV(sc), - "requesting firmware %s failed with error %d\n", - dsp_name, ret); - return ret; - } - - if (check_dsp(sc->dsp_firm->data, sc->dsp_firm->size)) { - uea_err(INS_TO_USBDEV(sc), "firmware %s is corrupted\n", - dsp_name); - release_firmware(sc->dsp_firm); - sc->dsp_firm = NULL; - return -EILSEQ; - } - - return 0; -} - -/* - * The uea_load_page() function must be called within a process context - */ -static void uea_load_page(void *xsc) -{ - struct uea_softc *sc = xsc; - u16 pageno = sc->pageno; - u16 ovl = sc->ovl; - struct block_info bi; - - u8 *p; - u8 pagecount, blockcount; - u16 blockaddr, blocksize; - u32 pageoffset; - int i; - - /* reload firmware when reboot start and it's loaded already */ - if (ovl == 0 && pageno == 0 && sc->dsp_firm) { - release_firmware(sc->dsp_firm); - sc->dsp_firm = NULL; - } - - if (sc->dsp_firm == NULL && request_dsp(sc) < 0) - return; - - p = sc->dsp_firm->data; - pagecount = FW_GET_BYTE(p); - p += 1; - - if (pageno >= pagecount) - goto bad1; - - p += 4 * pageno; - pageoffset = FW_GET_LONG(p); - - if (pageoffset == 0) - goto bad1; - - p = sc->dsp_firm->data + pageoffset; - blockcount = FW_GET_BYTE(p); - p += 1; - - uea_dbg(INS_TO_USBDEV(sc), - "sending %u blocks for DSP page %u\n", blockcount, pageno); - - bi.wHdr = cpu_to_le16(UEA_BIHDR); - bi.wOvl = cpu_to_le16(ovl); - bi.wOvlOffset = cpu_to_le16(ovl | 0x8000); - - for (i = 0; i < blockcount; i++) { - blockaddr = FW_GET_WORD(p); - p += 2; - - blocksize = FW_GET_WORD(p); - p += 2; - - bi.wSize = cpu_to_le16(blocksize); - bi.wAddress = cpu_to_le16(blockaddr); - bi.wLast = cpu_to_le16((i == blockcount - 1) ? 1 : 0); - - /* send block info through the IDMA pipe */ - if (uea_idma_write(sc, &bi, BLOCK_INFO_SIZE)) - goto bad2; - - /* send block data through the IDMA pipe */ - if (uea_idma_write(sc, p, blocksize)) - goto bad2; - - p += blocksize; - } - - return; - -bad2: - uea_err(INS_TO_USBDEV(sc), "sending DSP block %u failed\n", i); - return; -bad1: - uea_err(INS_TO_USBDEV(sc), "invalid DSP page %u requested\n",pageno); -} - -static inline void wake_up_cmv_ack(struct uea_softc *sc) -{ - sc->cmv_ack = 1; - wake_up(&sc->cmv_ack_wait); -} - -static inline int wait_cmv_ack(struct uea_softc *sc) -{ - int ret = wait_event_timeout(sc->cmv_ack_wait, - sc->cmv_ack, ACK_TIMEOUT); - sc->cmv_ack = 0; - - if (ret < 0) - return ret; - - return (ret == 0) ? -ETIMEDOUT : 0; - -} - -#define UCDC_SEND_ENCAPSULATED_COMMAND 0x00 - -static int uea_request(struct uea_softc *sc, - u16 value, u16 index, u16 size, void *data) -{ - u8 *xfer_buff; - int ret = -ENOMEM; - - xfer_buff = kmalloc(size, GFP_KERNEL); - if (!xfer_buff) { - uea_err(INS_TO_USBDEV(sc), "can't allocate xfer_buff\n"); - return ret; - } - memcpy(xfer_buff, data, size); - - ret = usb_control_msg(sc->usb_dev, usb_sndctrlpipe(sc->usb_dev, 0), - UCDC_SEND_ENCAPSULATED_COMMAND, - USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, - value, index, xfer_buff, size, CTRL_TIMEOUT); - - kfree(xfer_buff); - if (ret < 0) { - uea_err(INS_TO_USBDEV(sc), "usb_control_msg error %d\n", ret); - return ret; - } - - if (ret != size) { - uea_err(INS_TO_USBDEV(sc), - "usb_control_msg send only %d bytes (instead of %d)\n", - ret, size); - return -EIO; - } - - return 0; -} - -static int uea_cmv(struct uea_softc *sc, - u8 function, u32 address, u16 offset, u32 data) -{ - struct cmv cmv; - int ret; - - /* we send a request, but we expect a reply */ - sc->cmv_function = function | 0x2; - sc->cmv_idx++; - sc->cmv_address = address; - sc->cmv_offset = offset; - - cmv.wPreamble = cpu_to_le16(PREAMBLE); - cmv.bDirection = HOSTTOMODEM; - cmv.bFunction = function; - cmv.wIndex = cpu_to_le16(sc->cmv_idx); - put_unaligned(cpu_to_le32(address), &cmv.dwSymbolicAddress); - cmv.wOffsetAddress = cpu_to_le16(offset); - put_unaligned(cpu_to_le32(data >> 16 | data << 16), &cmv.dwData); - - ret = uea_request(sc, UEA_SET_BLOCK, UEA_MPTX_START, CMV_SIZE, &cmv); - if (ret < 0) - return ret; - return wait_cmv_ack(sc); -} - -static inline int uea_read_cmv(struct uea_softc *sc, - u32 address, u16 offset, u32 *data) -{ - int ret = uea_cmv(sc, MAKEFUNCTION(MEMACCESS, REQUESTREAD), - address, offset, 0); - if (ret < 0) - uea_err(INS_TO_USBDEV(sc), - "reading cmv failed with error %d\n", ret); - else - *data = sc->data; - - return ret; -} - -static inline int uea_write_cmv(struct uea_softc *sc, - u32 address, u16 offset, u32 data) -{ - int ret = uea_cmv(sc, MAKEFUNCTION(MEMACCESS, REQUESTWRITE), - address, offset, data); - if (ret < 0) - uea_err(INS_TO_USBDEV(sc), - "writing cmv failed with error %d\n", ret); - - return ret; -} - -/* - * Monitor the modem and update the stat - * return 0 if everything is ok - * return < 0 if an error occurs (-EAGAIN reboot needed) - */ -static int uea_stat(struct uea_softc *sc) -{ - u32 data; - int ret; - - uea_enters(INS_TO_USBDEV(sc)); - data = sc->stats.phy.state; - - ret = uea_read_cmv(sc, SA_STAT, 0, &sc->stats.phy.state); - if (ret < 0) - return ret; - - switch (GET_STATUS(sc->stats.phy.state)) { - case 0: /* not yet synchronized */ - uea_dbg(INS_TO_USBDEV(sc), - "modem not yet synchronized\n"); - return 0; - - case 1: /* initialization */ - uea_dbg(INS_TO_USBDEV(sc), "modem initializing\n"); - return 0; - - case 2: /* operational */ - uea_vdbg(INS_TO_USBDEV(sc), "modem operational\n"); - break; - - case 3: /* fail ... */ - uea_info(INS_TO_USBDEV(sc), "modem synchronization failed\n"); - return -EAGAIN; - - case 4 ... 6: /* test state */ - uea_warn(INS_TO_USBDEV(sc), - "modem in test mode - not supported\n"); - return -EAGAIN; - - case 7: /* fast-retain ... */ - uea_info(INS_TO_USBDEV(sc), "modem in fast-retain mode\n"); - return 0; - default: - uea_err(INS_TO_USBDEV(sc), "modem invalid SW mode %d\n", - GET_STATUS(sc->stats.phy.state)); - return -EAGAIN; - } - - if (GET_STATUS(data) != 2) { - uea_request(sc, UEA_SET_MODE, UEA_LOOPBACK_OFF, 0, NULL); - uea_info(INS_TO_USBDEV(sc), "modem operational\n"); - - /* release the dsp firmware as it is not needed until - * the next failure - */ - if (sc->dsp_firm) { - release_firmware(sc->dsp_firm); - sc->dsp_firm = NULL; - } - - ret = uea_read_cmv(sc, SA_INFO, 10, &sc->stats.phy.firmid); - if (ret < 0) - return ret; - uea_info(INS_TO_USBDEV(sc), "ATU-R firmware version : %x\n", - sc->stats.phy.firmid); - } - - /* always update it as atm layer could not be init when we switch to - * operational state - */ - UPDATE_ATM_STAT(signal, ATM_PHY_SIG_FOUND); - - /* wake up processes waiting for synchronization */ - wake_up(&sc->sync_q); - - ret = uea_read_cmv(sc, SA_DIAG, 2, &sc->stats.phy.flags); - if (ret < 0) - return ret; - sc->stats.phy.mflags |= sc->stats.phy.flags; - - /* in case of a flags ( for example delineation LOSS (& 0x10)), - * we check the status again in order to detect the failure earlier - */ - if (sc->stats.phy.flags) { - uea_dbg(INS_TO_USBDEV(sc), "Stat flag = %d\n", - sc->stats.phy.flags); - return 0; - } - - ret = uea_read_cmv(sc, SA_RATE, 0, &data); - if (ret < 0) - return ret; - - /* in bulk mode the modem have problem with high rate - * changing internal timing could improve things, but the - * value is misterious. - * ADI930 don't support it (-EPIPE error). - */ - if (UEA_CHIP_VERSION(sc) != ADI930 - && sc->stats.phy.dsrate != (data >> 16) * 32) { - /* Original timming from ADI(used in windows driver) - * 0x20ffff>>16 * 32 = 32 * 32 = 1Mbits - */ - u16 timeout = (data <= 0x20ffff) ? 0 : 1; - ret = uea_request(sc, UEA_SET_TIMEOUT, timeout, 0, NULL); - uea_info(INS_TO_USBDEV(sc), - "setting new timeout %d%s\n", timeout, - ret < 0?" failed":""); - } - sc->stats.phy.dsrate = (data >> 16) * 32; - sc->stats.phy.usrate = (data & 0xffff) * 32; - UPDATE_ATM_STAT(link_rate, sc->stats.phy.dsrate * 1000 / 424); - - ret = uea_read_cmv(sc, SA_DIAG, 23, &data); - if (ret < 0) - return ret; - sc->stats.phy.dsattenuation = (data & 0xff) / 2; - - ret = uea_read_cmv(sc, SA_DIAG, 47, &data); - if (ret < 0) - return ret; - sc->stats.phy.usattenuation = (data & 0xff) / 2; - - ret = uea_read_cmv(sc, SA_DIAG, 25, &sc->stats.phy.dsmargin); - if (ret < 0) - return ret; - - ret = uea_read_cmv(sc, SA_DIAG, 49, &sc->stats.phy.usmargin); - if (ret < 0) - return ret; - - ret = uea_read_cmv(sc, SA_DIAG, 51, &sc->stats.phy.rxflow); - if (ret < 0) - return ret; - - ret = uea_read_cmv(sc, SA_DIAG, 52, &sc->stats.phy.txflow); - if (ret < 0) - return ret; - - ret = uea_read_cmv(sc, SA_DIAG, 54, &sc->stats.phy.dsunc); - if (ret < 0) - return ret; - - /* only for atu-c */ - ret = uea_read_cmv(sc, SA_DIAG, 58, &sc->stats.phy.usunc); - if (ret < 0) - return ret; - - ret = uea_read_cmv(sc, SA_DIAG, 53, &sc->stats.phy.dscorr); - if (ret < 0) - return ret; - - /* only for atu-c */ - ret = uea_read_cmv(sc, SA_DIAG, 57, &sc->stats.phy.uscorr); - if (ret < 0) - return ret; - - ret = uea_read_cmv(sc, SA_INFO, 8, &sc->stats.phy.vidco); - if (ret < 0) - return ret; - - ret = uea_read_cmv(sc, SA_INFO, 13, &sc->stats.phy.vidcpe); - if (ret < 0) - return ret; - - return 0; -} - -static int request_cmvs(struct uea_softc *sc, - struct uea_cmvs **cmvs, const struct firmware **fw) -{ - int ret, size; - u8 *data; - char *file; - static char cmv_name[256] = FW_DIR; - - if (cmv_file[sc->modem_index] == NULL) { - if (UEA_CHIP_VERSION(sc) == ADI930) - file = (IS_ISDN(sc)) ? "CMV9i.bin" : "CMV9p.bin"; - else - file = (IS_ISDN(sc)) ? "CMVei.bin" : "CMVep.bin"; - } else - file = cmv_file[sc->modem_index]; - - strcpy(cmv_name, FW_DIR); - strlcat(cmv_name, file, sizeof(cmv_name)); - - ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); - if (ret < 0) { - uea_err(INS_TO_USBDEV(sc), - "requesting firmware %s failed with error %d\n", - cmv_name, ret); - return ret; - } - - data = (u8 *) (*fw)->data; - size = *data * sizeof(struct uea_cmvs) + 1; - if (size != (*fw)->size) { - uea_err(INS_TO_USBDEV(sc), "firmware %s is corrupted\n", - cmv_name); - release_firmware(*fw); - return -EILSEQ; - } - - *cmvs = (struct uea_cmvs *)(data + 1); - return *data; -} - -/* Start boot post firmware modem: - * - send reset commands through usb control pipe - * - start workqueue for DSP loading - * - send CMV options to modem - */ - -static int uea_start_reset(struct uea_softc *sc) -{ - u16 zero = 0; /* ;-) */ - int i, len, ret; - struct uea_cmvs *cmvs; - const struct firmware *cmvs_fw; - - uea_enters(INS_TO_USBDEV(sc)); - uea_info(INS_TO_USBDEV(sc), "(re)booting started\n"); - - sc->booting = 1; - UPDATE_ATM_STAT(signal, ATM_PHY_SIG_LOST); - - /* reset statistics */ - memset(&sc->stats, 0, sizeof(struct uea_stats)); - - /* tell the modem that we want to boot in IDMA mode */ - uea_request(sc, UEA_SET_MODE, UEA_LOOPBACK_ON, 0, NULL); - uea_request(sc, UEA_SET_MODE, UEA_BOOT_IDMA, 0, NULL); - - /* enter reset mode */ - uea_request(sc, UEA_SET_MODE, UEA_START_RESET, 0, NULL); - - /* original driver use 200ms, but windows driver use 100ms */ - msleep(100); - - /* leave reset mode */ - uea_request(sc, UEA_SET_MODE, UEA_END_RESET, 0, NULL); - - /* clear tx and rx mailboxes */ - uea_request(sc, UEA_SET_2183_DATA, UEA_MPTX_MAILBOX, 2, &zero); - uea_request(sc, UEA_SET_2183_DATA, UEA_MPRX_MAILBOX, 2, &zero); - uea_request(sc, UEA_SET_2183_DATA, UEA_SWAP_MAILBOX, 2, &zero); - - msleep(1000); - sc->cmv_function = MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY); - sc->booting = 0; - - /* start loading DSP */ - sc->pageno = 0; - sc->ovl = 0; - schedule_work(&sc->task); - - /* wait for modem ready CMV */ - ret = wait_cmv_ack(sc); - if (ret < 0) - return ret; - - /* Enter in R-IDLE (cmv) until instructed otherwise */ - ret = uea_write_cmv(sc, SA_CNTL, 0, 1); - if (ret < 0) - return ret; - - /* get options */ - ret = len = request_cmvs(sc, &cmvs, &cmvs_fw); - if (ret < 0) - return ret; - - /* send options */ - for (i = 0; i < len; i++) { - ret = uea_write_cmv(sc, FW_GET_LONG(&cmvs[i].address), - FW_GET_WORD(&cmvs[i].offset), - FW_GET_LONG(&cmvs[i].data)); - if (ret < 0) - goto out; - } - /* Enter in R-ACT-REQ */ - ret = uea_write_cmv(sc, SA_CNTL, 0, 2); -out: - release_firmware(cmvs_fw); - sc->reset = 0; - uea_leaves(INS_TO_USBDEV(sc)); - return ret; -} - -/* - * In case of an error wait 1s before rebooting the modem - * if the modem don't request reboot (-EAGAIN). - * Monitor the modem every 1s. - */ - -static int uea_kthread(void *data) -{ - struct uea_softc *sc = data; - int ret = -EAGAIN; - - uea_enters(INS_TO_USBDEV(sc)); - while (!kthread_should_stop()) { - if (ret < 0 || sc->reset) - ret = uea_start_reset(sc); - if (!ret) - ret = uea_stat(sc); - if (ret != -EAGAIN) - msleep(1000); - } - uea_leaves(INS_TO_USBDEV(sc)); - return ret; -} - -/* Load second usb firmware for ADI930 chip */ -static int load_XILINX_firmware(struct uea_softc *sc) -{ - const struct firmware *fw_entry; - int ret, size, u, ln; - u8 *pfw, value; - char *fw_name = FW_DIR "930-fpga.bin"; - - uea_enters(INS_TO_USBDEV(sc)); - - ret = request_firmware(&fw_entry, fw_name, &sc->usb_dev->dev); - if (ret) { - uea_err(INS_TO_USBDEV(sc), "firmware %s is not available\n", - fw_name); - goto err0; - } - - pfw = fw_entry->data; - size = fw_entry->size; - if (size != 0x577B) { - uea_err(INS_TO_USBDEV(sc), "firmware %s is corrupted\n", - fw_name); - ret = -EILSEQ; - goto err1; - } - for (u = 0; u < size; u += ln) { - ln = min(size - u, 64); - ret = uea_request(sc, 0xe, 0, ln, pfw + u); - if (ret < 0) { - uea_err(INS_TO_USBDEV(sc), - "elsa download data failed (%d)\n", ret); - goto err1; - } - } - - /* finish to send the fpga - */ - ret = uea_request(sc, 0xe, 1, 0, NULL); - if (ret < 0) { - uea_err(INS_TO_USBDEV(sc), - "elsa download data failed (%d)\n", ret); - goto err1; - } - - /* - * Tell the modem we finish : de-assert reset - */ - value = 0; - ret = uea_send_modem_cmd(sc->usb_dev, 0xe, 1, &value); - if (ret < 0) - uea_err(sc->usb_dev, "elsa de-assert failed with error %d\n", ret); - - -err1: - release_firmware(fw_entry); -err0: - uea_leaves(INS_TO_USBDEV(sc)); - return ret; -} - -static void uea_dispatch_cmv(struct uea_softc *sc, struct cmv* cmv) -{ - uea_enters(INS_TO_USBDEV(sc)); - if (le16_to_cpu(cmv->wPreamble) != PREAMBLE) - goto bad1; - - if (cmv->bDirection != MODEMTOHOST) - goto bad1; - - /* FIXME : ADI930 reply wrong preambule (func = 2, sub = 2) to - * the first MEMACESS cmv. Ignore it... - */ - if (cmv->bFunction != sc->cmv_function) { - if (UEA_CHIP_VERSION(sc) == ADI930 - && cmv->bFunction == MAKEFUNCTION(2, 2)) { - cmv->wIndex = cpu_to_le16(sc->cmv_idx); - put_unaligned(cpu_to_le32(sc->cmv_address), &cmv->dwSymbolicAddress); - cmv->wOffsetAddress = cpu_to_le16(sc->cmv_offset); - } - else - goto bad2; - } - - if (cmv->bFunction == MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY)) { - wake_up_cmv_ack(sc); - return; - } - - /* in case of MEMACCESS */ - if (le16_to_cpu(cmv->wIndex) != sc->cmv_idx || - le32_to_cpu(get_unaligned(&cmv->dwSymbolicAddress)) != - sc->cmv_address - || le16_to_cpu(cmv->wOffsetAddress) != sc->cmv_offset) - goto bad2; - - sc->data = le32_to_cpu(get_unaligned(&cmv->dwData)); - sc->data = sc->data << 16 | sc->data >> 16; - - wake_up_cmv_ack(sc); - return; - -bad2: - uea_err(INS_TO_USBDEV(sc), "unexpected cmv received," - "Function : %d, Subfunction : %d\n", - FUNCTION_TYPE(cmv->bFunction), - FUNCTION_SUBTYPE(cmv->bFunction)); - return; - -bad1: - uea_err(INS_TO_USBDEV(sc), "invalid cmv received, " - "wPreamble %d, bDirection %d\n", - le16_to_cpu(cmv->wPreamble), cmv->bDirection); -} - -/* - * interrupt handler - */ -static void uea_intr(struct urb *urb, struct pt_regs *regs) -{ - struct uea_softc *sc = (struct uea_softc *)urb->context; - struct intr_pkt *intr; - uea_enters(INS_TO_USBDEV(sc)); - - if (urb->status < 0) { - uea_err(INS_TO_USBDEV(sc), "uea_intr() failed with %d\n", - urb->status); - return; - } - - intr = (struct intr_pkt *) urb->transfer_buffer; - - /* device-to-host interrupt */ - if (intr->bType != 0x08 || sc->booting) { - uea_err(INS_TO_USBDEV(sc), "wrong intr\n"); - // rebooting ? - // sc->reset = 1; - goto resubmit; - } - - switch (le16_to_cpu(intr->wInterrupt)) { - case INT_LOADSWAPPAGE: - sc->pageno = intr->bSwapPageNo; - sc->ovl = intr->bOvl >> 4 | intr->bOvl << 4; - schedule_work(&sc->task); - break; - - case INT_INCOMINGCMV: - uea_dispatch_cmv(sc, &intr->u.s2.cmv); - break; - - default: - uea_err(INS_TO_USBDEV(sc), "unknown intr %u\n", - le16_to_cpu(intr->wInterrupt)); - } - -resubmit: - usb_submit_urb(sc->urb_int, GFP_ATOMIC); -} - -/* - * Start the modem : init the data and start kernel thread - */ -static int uea_boot(struct uea_softc *sc) -{ - int ret; - struct intr_pkt *intr; - - uea_enters(INS_TO_USBDEV(sc)); - - INIT_WORK(&sc->task, uea_load_page, sc); - init_waitqueue_head(&sc->sync_q); - init_waitqueue_head(&sc->cmv_ack_wait); - - if (UEA_CHIP_VERSION(sc) == ADI930) - load_XILINX_firmware(sc); - - intr = kmalloc(INTR_PKT_SIZE, GFP_KERNEL); - if (!intr) { - uea_err(INS_TO_USBDEV(sc), - "cannot allocate interrupt package\n"); - uea_leaves(INS_TO_USBDEV(sc)); - return -ENOMEM; - } - - sc->urb_int = usb_alloc_urb(0, GFP_KERNEL); - if (!sc->urb_int) { - uea_err(INS_TO_USBDEV(sc), "cannot allocate interrupt URB\n"); - goto err; - } - - usb_fill_int_urb(sc->urb_int, sc->usb_dev, - usb_rcvintpipe(sc->usb_dev, UEA_INTR_PIPE), - intr, INTR_PKT_SIZE, uea_intr, sc, - sc->usb_dev->actconfig->interface[0]->altsetting[0]. - endpoint[0].desc.bInterval); - - ret = usb_submit_urb(sc->urb_int, GFP_KERNEL); - if (ret < 0) { - uea_err(INS_TO_USBDEV(sc), - "urb submition failed with error %d\n", ret); - goto err1; - } - - sc->kthread = kthread_run(uea_kthread, sc, "ueagle-atm"); - if (sc->kthread == ERR_PTR(-ENOMEM)) { - uea_err(INS_TO_USBDEV(sc), "failed to create thread\n"); - goto err2; - } - - uea_leaves(INS_TO_USBDEV(sc)); - return 0; - -err2: - usb_kill_urb(sc->urb_int); -err1: - kfree(intr); -err: - usb_free_urb(sc->urb_int); - uea_leaves(INS_TO_USBDEV(sc)); - return -ENOMEM; -} - -/* - * Stop the modem : kill kernel thread and free data - */ -static void uea_stop(struct uea_softc *sc) -{ - int ret; - uea_enters(INS_TO_USBDEV(sc)); - ret = kthread_stop(sc->kthread); - uea_info(INS_TO_USBDEV(sc), "kthread finish with status %d\n", ret); - - /* stop any pending boot process */ - flush_scheduled_work(); - - uea_request(sc, UEA_SET_MODE, UEA_LOOPBACK_ON, 0, NULL); - - usb_kill_urb(sc->urb_int); - kfree(sc->urb_int->transfer_buffer); - usb_free_urb(sc->urb_int); - - if (sc->dsp_firm) - release_firmware(sc->dsp_firm); - uea_leaves(INS_TO_USBDEV(sc)); -} - -/* syfs interface */ -static struct uea_softc *dev_to_uea(struct device *dev) -{ - struct usb_interface *intf; - struct usbatm_data *usbatm; - - intf = to_usb_interface(dev); - if (!intf) - return NULL; - - usbatm = usb_get_intfdata(intf); - if (!usbatm) - return NULL; - - return usbatm->driver_data; -} - -static ssize_t read_status(struct device *dev, struct device_attribute *attr, - char *buf) -{ - int ret = -ENODEV; - struct uea_softc *sc; - - down(&uea_semaphore); - sc = dev_to_uea(dev); - if (!sc) - goto out; - ret = snprintf(buf, 10, "%08x\n", sc->stats.phy.state); -out: - up(&uea_semaphore); - return ret; -} - -static ssize_t reboot(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) -{ - int ret = -ENODEV; - struct uea_softc *sc; - - down(&uea_semaphore); - sc = dev_to_uea(dev); - if (!sc) - goto out; - sc->reset = 1; - ret = count; -out: - up(&uea_semaphore); - return ret; -} - -static DEVICE_ATTR(stat_status, S_IWUGO | S_IRUGO, read_status, reboot); - -static ssize_t read_human_status(struct device *dev, struct device_attribute *attr, - char *buf) -{ - int ret = -ENODEV; - struct uea_softc *sc; - - down(&uea_semaphore); - sc = dev_to_uea(dev); - if (!sc) - goto out; - - switch (GET_STATUS(sc->stats.phy.state)) { - case 0: - ret = sprintf(buf, "Modem is booting\n"); - break; - case 1: - ret = sprintf(buf, "Modem is initializing\n"); - break; - case 2: - ret = sprintf(buf, "Modem is operational\n"); - break; - default: - ret = sprintf(buf, "Modem synchronization failed\n"); - break; - } -out: - up(&uea_semaphore); - return ret; -} - -static DEVICE_ATTR(stat_human_status, S_IWUGO | S_IRUGO, read_human_status, NULL); - -static ssize_t read_delin(struct device *dev, struct device_attribute *attr, - char *buf) -{ - int ret = -ENODEV; - struct uea_softc *sc; - - down(&uea_semaphore); - sc = dev_to_uea(dev); - if (!sc) - goto out; - - if (sc->stats.phy.flags & 0x0C00) - ret = sprintf(buf, "ERROR\n"); - else if (sc->stats.phy.flags & 0x0030) - ret = sprintf(buf, "LOSS\n"); - else - ret = sprintf(buf, "GOOD\n"); -out: - up(&uea_semaphore); - return ret; -} - -static DEVICE_ATTR(stat_delin, S_IWUGO | S_IRUGO, read_delin, NULL); - -#define UEA_ATTR(name, reset) \ - \ -static ssize_t read_##name(struct device *dev, \ - struct device_attribute *attr, char *buf) \ -{ \ - int ret = -ENODEV; \ - struct uea_softc *sc; \ - \ - down(&uea_semaphore); \ - sc = dev_to_uea(dev); \ - if (!sc) \ - goto out; \ - ret = snprintf(buf, 10, "%08x\n", sc->stats.phy.name); \ - if (reset) \ - sc->stats.phy.name = 0; \ -out: \ - up(&uea_semaphore); \ - return ret; \ -} \ - \ -static DEVICE_ATTR(stat_##name, S_IRUGO, read_##name, NULL) - -UEA_ATTR(mflags, 1); -UEA_ATTR(vidcpe, 0); -UEA_ATTR(usrate, 0); -UEA_ATTR(dsrate, 0); -UEA_ATTR(usattenuation, 0); -UEA_ATTR(dsattenuation, 0); -UEA_ATTR(usmargin, 0); -UEA_ATTR(dsmargin, 0); -UEA_ATTR(txflow, 0); -UEA_ATTR(rxflow, 0); -UEA_ATTR(uscorr, 0); -UEA_ATTR(dscorr, 0); -UEA_ATTR(usunc, 0); -UEA_ATTR(dsunc, 0); - -/* Retrieve the device End System Identifier (MAC) */ - -#define htoi(x) (isdigit(x) ? x-'0' : toupper(x)-'A'+10) -static int uea_getesi(struct uea_softc *sc, u_char * esi) -{ - unsigned char mac_str[2 * ETH_ALEN + 1]; - int i; - if (usb_string - (sc->usb_dev, sc->usb_dev->descriptor.iSerialNumber, mac_str, - sizeof(mac_str)) != 2 * ETH_ALEN) - return 1; - - for (i = 0; i < ETH_ALEN; i++) - esi[i] = htoi(mac_str[2 * i]) * 16 + htoi(mac_str[2 * i + 1]); - - return 0; -} - -/* ATM stuff */ -static int uea_atm_open(struct usbatm_data *usbatm, struct atm_dev *atm_dev) -{ - struct uea_softc *sc = usbatm->driver_data; - - return uea_getesi(sc, atm_dev->esi); -} - -static int uea_heavy(struct usbatm_data *usbatm, struct usb_interface *intf) -{ - struct uea_softc *sc = usbatm->driver_data; - - wait_event(sc->sync_q, IS_OPERATIONAL(sc)); - - return 0; - -} - -static int claim_interface(struct usb_device *usb_dev, - struct usbatm_data *usbatm, int ifnum) -{ - int ret; - struct usb_interface *intf = usb_ifnum_to_if(usb_dev, ifnum); - - if (!intf) { - uea_err(usb_dev, "interface %d not found\n", ifnum); - return -ENODEV; - } - - ret = usb_driver_claim_interface(&uea_driver, intf, usbatm); - if (ret != 0) - uea_err(usb_dev, "can't claim interface %d, error %d\n", ifnum, - ret); - return ret; -} - -static void create_fs_entries(struct uea_softc *sc, struct usb_interface *intf) -{ - /* sysfs interface */ - device_create_file(&intf->dev, &dev_attr_stat_status); - device_create_file(&intf->dev, &dev_attr_stat_mflags); - device_create_file(&intf->dev, &dev_attr_stat_human_status); - device_create_file(&intf->dev, &dev_attr_stat_delin); - device_create_file(&intf->dev, &dev_attr_stat_vidcpe); - device_create_file(&intf->dev, &dev_attr_stat_usrate); - device_create_file(&intf->dev, &dev_attr_stat_dsrate); - device_create_file(&intf->dev, &dev_attr_stat_usattenuation); - device_create_file(&intf->dev, &dev_attr_stat_dsattenuation); - device_create_file(&intf->dev, &dev_attr_stat_usmargin); - device_create_file(&intf->dev, &dev_attr_stat_dsmargin); - device_create_file(&intf->dev, &dev_attr_stat_txflow); - device_create_file(&intf->dev, &dev_attr_stat_rxflow); - device_create_file(&intf->dev, &dev_attr_stat_uscorr); - device_create_file(&intf->dev, &dev_attr_stat_dscorr); - device_create_file(&intf->dev, &dev_attr_stat_usunc); - device_create_file(&intf->dev, &dev_attr_stat_dsunc); -} - -static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf, - const struct usb_device_id *id, int *heavy) -{ - struct usb_device *usb = interface_to_usbdev(intf); - struct uea_softc *sc; - int ret, ifnum = intf->altsetting->desc.bInterfaceNumber; - - uea_enters(usb); - - /* interface 0 is for firmware/monitoring */ - if (ifnum != UEA_INTR_IFACE_NO) - return -ENODEV; - - *heavy = sync_wait[modem_index]; - - /* interface 1 is for outbound traffic */ - ret = claim_interface(usb, usbatm, UEA_US_IFACE_NO); - if (ret < 0) - return ret; - - /* ADI930 has only 2 interfaces and inbound traffic - * is on interface 1 - */ - if (UEA_CHIP_VERSION(id) != ADI930) { - /* interface 2 is for inbound traffic */ - ret = claim_interface(usb, usbatm, UEA_DS_IFACE_NO); - if (ret < 0) - return ret; - } - - sc = kzalloc(sizeof(struct uea_softc), GFP_KERNEL); - if (!sc) { - uea_err(INS_TO_USBDEV(sc), "uea_init: not enough memory !\n"); - return -ENOMEM; - } - - sc->usb_dev = usb; - usbatm->driver_data = sc; - sc->usbatm = usbatm; - sc->modem_index = (modem_index < NB_MODEM) ? modem_index++ : 0; - sc->driver_info = id->driver_info; - - ret = uea_boot(sc); - if (ret < 0) { - kfree(sc); - return ret; - } - - create_fs_entries(sc, intf); - return 0; -} - -static void destroy_fs_entries(struct uea_softc *sc, struct usb_interface *intf) -{ - /* sysfs interface */ - device_remove_file(&intf->dev, &dev_attr_stat_status); - device_remove_file(&intf->dev, &dev_attr_stat_mflags); - device_remove_file(&intf->dev, &dev_attr_stat_human_status); - device_remove_file(&intf->dev, &dev_attr_stat_delin); - device_remove_file(&intf->dev, &dev_attr_stat_vidcpe); - device_remove_file(&intf->dev, &dev_attr_stat_usrate); - device_remove_file(&intf->dev, &dev_attr_stat_dsrate); - device_remove_file(&intf->dev, &dev_attr_stat_usattenuation); - device_remove_file(&intf->dev, &dev_attr_stat_dsattenuation); - device_remove_file(&intf->dev, &dev_attr_stat_usmargin); - device_remove_file(&intf->dev, &dev_attr_stat_dsmargin); - device_remove_file(&intf->dev, &dev_attr_stat_txflow); - device_remove_file(&intf->dev, &dev_attr_stat_rxflow); - device_remove_file(&intf->dev, &dev_attr_stat_uscorr); - device_remove_file(&intf->dev, &dev_attr_stat_dscorr); - device_remove_file(&intf->dev, &dev_attr_stat_usunc); - device_remove_file(&intf->dev, &dev_attr_stat_dsunc); -} - -static void uea_unbind(struct usbatm_data *usbatm, struct usb_interface *intf) -{ - struct uea_softc *sc = usbatm->driver_data; - - destroy_fs_entries(sc, intf); - uea_stop(sc); - kfree(sc); -} - -static struct usbatm_driver uea_usbatm_driver = { - .driver_name = "ueagle-atm", - .owner = THIS_MODULE, - .bind = uea_bind, - .atm_start = uea_atm_open, - .unbind = uea_unbind, - .heavy_init = uea_heavy, - .in = UEA_BULK_DATA_PIPE, - .out = UEA_BULK_DATA_PIPE, -}; - -static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id) -{ - struct usb_device *usb = interface_to_usbdev(intf); - - uea_enters(usb); - uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) : %s\n", - le16_to_cpu(usb->descriptor.idVendor), - le16_to_cpu(usb->descriptor.idProduct), - chip_name[UEA_CHIP_VERSION(id)]); - - usb_reset_device(usb); - - if (UEA_IS_PREFIRM(id)) - return uea_load_firmware(usb, UEA_CHIP_VERSION(id)); - - return usbatm_usb_probe(intf, id, &uea_usbatm_driver); -} - -static void uea_disconnect(struct usb_interface *intf) -{ - struct usb_device *usb = interface_to_usbdev(intf); - int ifnum = intf->altsetting->desc.bInterfaceNumber; - uea_enters(usb); - - /* ADI930 has 2 interfaces and eagle 3 interfaces. - * Pre-firmware device has one interface - */ - if (usb->config->desc.bNumInterfaces != 1 && ifnum == 0) { - down(&uea_semaphore); - usbatm_usb_disconnect(intf); - up(&uea_semaphore); - uea_info(usb, "ADSL device removed\n"); - } - - uea_leaves(usb); -} - -/* - * List of supported VID/PID - */ -static const struct usb_device_id uea_ids[] = { - {USB_DEVICE(ELSA_VID, ELSA_PID_PREFIRM), .driver_info = ADI930 | PREFIRM}, - {USB_DEVICE(ELSA_VID, ELSA_PID_PSTFIRM), .driver_info = ADI930 | PSTFIRM}, - {USB_DEVICE(EAGLE_VID, EAGLE_I_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM}, - {USB_DEVICE(EAGLE_VID, EAGLE_I_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM}, - {USB_DEVICE(EAGLE_VID, EAGLE_II_PID_PREFIRM), .driver_info = EAGLE_II | PREFIRM}, - {USB_DEVICE(EAGLE_VID, EAGLE_II_PID_PSTFIRM), .driver_info = EAGLE_II | PSTFIRM}, - {USB_DEVICE(EAGLE_VID, EAGLE_IIC_PID_PREFIRM), .driver_info = EAGLE_II | PREFIRM}, - {USB_DEVICE(EAGLE_VID, EAGLE_IIC_PID_PSTFIRM), .driver_info = EAGLE_II | PSTFIRM}, - {USB_DEVICE(EAGLE_VID, EAGLE_III_PID_PREFIRM), .driver_info = EAGLE_III | PREFIRM}, - {USB_DEVICE(EAGLE_VID, EAGLE_III_PID_PSTFIRM), .driver_info = EAGLE_III | PSTFIRM}, - {USB_DEVICE(USR_VID, MILLER_A_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM}, - {USB_DEVICE(USR_VID, MILLER_A_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM}, - {USB_DEVICE(USR_VID, MILLER_B_PID_PREFIRM), .driver_info = EAGLE_I | PREFIRM}, - {USB_DEVICE(USR_VID, MILLER_B_PID_PSTFIRM), .driver_info = EAGLE_I | PSTFIRM}, - {USB_DEVICE(USR_VID, HEINEKEN_A_PID_PREFIRM),.driver_info = EAGLE_I | PREFIRM}, - {USB_DEVICE(USR_VID, HEINEKEN_A_PID_PSTFIRM),.driver_info = EAGLE_I | PSTFIRM}, - {USB_DEVICE(USR_VID, HEINEKEN_B_PID_PREFIRM),.driver_info = EAGLE_I | PREFIRM}, - {USB_DEVICE(USR_VID, HEINEKEN_B_PID_PSTFIRM),.driver_info = EAGLE_I | PSTFIRM}, - {} -}; - -/* - * USB driver descriptor - */ -static struct usb_driver uea_driver = { - .name = "ueagle-atm", - .id_table = uea_ids, - .probe = uea_probe, - .disconnect = uea_disconnect, -}; - -MODULE_DEVICE_TABLE(usb, uea_ids); - -/** - * uea_init - Initialize the module. - * Register to USB subsystem - */ -static int __init uea_init(void) -{ - printk(KERN_INFO "[ueagle-atm] driver " EAGLEUSBVERSION " loaded\n"); - - usb_register(&uea_driver); - - return 0; -} - -module_init(uea_init); - -/** - * uea_exit - Destroy module - * Deregister with USB subsystem - */ -static void __exit uea_exit(void) -{ - /* - * This calls automatically the uea_disconnect method if necessary: - */ - usb_deregister(&uea_driver); - - printk(KERN_INFO "[ueagle-atm] driver unloaded\n"); -} - -module_exit(uea_exit); - -MODULE_AUTHOR("Damien Bergamini/Matthieu Castet/Stanislaw W. Gruszka"); -MODULE_DESCRIPTION("ADI 930/Eagle USB ADSL Modem driver"); -MODULE_LICENSE("Dual BSD/GPL"); diff --git a/trunk/drivers/usb/atm/usbatm.c b/trunk/drivers/usb/atm/usbatm.c index 9baa6296fc95..c466739428b2 100644 --- a/trunk/drivers/usb/atm/usbatm.c +++ b/trunk/drivers/usb/atm/usbatm.c @@ -646,14 +646,14 @@ static void usbatm_destroy_instance(struct kref *kref) kfree(instance); } -static void usbatm_get_instance(struct usbatm_data *instance) +void usbatm_get_instance(struct usbatm_data *instance) { dbg("%s", __func__); kref_get(&instance->refcount); } -static void usbatm_put_instance(struct usbatm_data *instance) +void usbatm_put_instance(struct usbatm_data *instance) { dbg("%s", __func__); @@ -879,7 +879,7 @@ static int usbatm_atm_init(struct usbatm_data *instance) fail: instance->atm_dev = NULL; - atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */ + shutdown_atm_dev(atm_dev); /* usbatm_atm_dev_close will eventually be called */ return ret; } @@ -1164,7 +1164,7 @@ void usbatm_usb_disconnect(struct usb_interface *intf) /* ATM finalize */ if (instance->atm_dev) - atm_dev_deregister(instance->atm_dev); + shutdown_atm_dev(instance->atm_dev); usbatm_put_instance(instance); /* taken in usbatm_usb_probe */ } diff --git a/trunk/drivers/usb/atm/usbatm.h b/trunk/drivers/usb/atm/usbatm.h index 1adacd60d713..936646457935 100644 --- a/trunk/drivers/usb/atm/usbatm.h +++ b/trunk/drivers/usb/atm/usbatm.h @@ -27,9 +27,14 @@ #include /* +#define DEBUG #define VERBOSE_DEBUG */ +#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG) +# define DEBUG +#endif + #include #include #include diff --git a/trunk/drivers/usb/atm/xusbatm.c b/trunk/drivers/usb/atm/xusbatm.c index 5c76e3aaaa5e..7fe7fb484d10 100644 --- a/trunk/drivers/usb/atm/xusbatm.c +++ b/trunk/drivers/usb/atm/xusbatm.c @@ -140,6 +140,7 @@ static int xusbatm_usb_probe(struct usb_interface *intf, } static struct usb_driver xusbatm_usb_driver = { + .owner = THIS_MODULE, .name = xusbatm_driver_name, .probe = xusbatm_usb_probe, .disconnect = usbatm_usb_disconnect, diff --git a/trunk/drivers/usb/class/audio.c b/trunk/drivers/usb/class/audio.c index 3ad9ee8b84a9..50858273f8d3 100644 --- a/trunk/drivers/usb/class/audio.c +++ b/trunk/drivers/usb/class/audio.c @@ -2732,6 +2732,7 @@ static struct usb_device_id usb_audio_ids [] = { MODULE_DEVICE_TABLE (usb, usb_audio_ids); static struct usb_driver usb_audio_driver = { + .owner = THIS_MODULE, .name = "audio", .probe = usb_audio_probe, .disconnect = usb_audio_disconnect, diff --git a/trunk/drivers/usb/class/cdc-acm.c b/trunk/drivers/usb/class/cdc-acm.c index 248279e44c99..1b4751412970 100644 --- a/trunk/drivers/usb/class/cdc-acm.c +++ b/trunk/drivers/usb/class/cdc-acm.c @@ -6,7 +6,6 @@ * Copyright (c) 1999 Johannes Erdfelt * Copyright (c) 2000 Vojtech Pavlik * Copyright (c) 2004 Oliver Neukum - * Copyright (c) 2005 David Kubicek * * USB Abstract Control Model driver for USB modems and ISDN adapters * @@ -30,7 +29,6 @@ * config we want, sysadmin changes bConfigurationValue in sysfs. * v0.23 - use softirq for rx processing, as needed by tty layer * v0.24 - change probe method to evaluate CDC union descriptor - * v0.25 - downstream tasks paralelized to maximize throughput */ /* @@ -65,15 +63,14 @@ #include #include #include -#include #include "cdc-acm.h" /* * Version Information */ -#define DRIVER_VERSION "v0.25" -#define DRIVER_AUTHOR "Armin Fuerst, Pavel Machek, Johannes Erdfelt, Vojtech Pavlik, David Kubicek" +#define DRIVER_VERSION "v0.23" +#define DRIVER_AUTHOR "Armin Fuerst, Pavel Machek, Johannes Erdfelt, Vojtech Pavlik" #define DRIVER_DESC "USB Abstract Control Model driver for USB modems and ISDN adapters" static struct usb_driver acm_driver; @@ -287,9 +284,7 @@ static void acm_ctrl_irq(struct urb *urb, struct pt_regs *regs) /* data interface returns incoming bytes, or we got unthrottled */ static void acm_read_bulk(struct urb *urb, struct pt_regs *regs) { - struct acm_rb *buf; - struct acm_ru *rcv = urb->context; - struct acm *acm = rcv->instance; + struct acm *acm = urb->context; dbg("Entering acm_read_bulk with status %d\n", urb->status); if (!ACM_READY(acm)) @@ -298,109 +293,49 @@ static void acm_read_bulk(struct urb *urb, struct pt_regs *regs) if (urb->status) dev_dbg(&acm->data->dev, "bulk rx status %d\n", urb->status); - buf = rcv->buffer; - buf->size = urb->actual_length; - - spin_lock(&acm->read_lock); - list_add_tail(&rcv->list, &acm->spare_read_urbs); - list_add_tail(&buf->list, &acm->filled_read_bufs); - spin_unlock(&acm->read_lock); - - tasklet_schedule(&acm->urb_task); + /* calling tty_flip_buffer_push() in_irq() isn't allowed */ + tasklet_schedule(&acm->bh); } static void acm_rx_tasklet(unsigned long _acm) { struct acm *acm = (void *)_acm; - struct acm_rb *buf; + struct urb *urb = acm->readurb; struct tty_struct *tty = acm->tty; - struct acm_ru *rcv; - //unsigned long flags; + unsigned char *data = urb->transfer_buffer; int i = 0; dbg("Entering acm_rx_tasklet"); - if (!ACM_READY(acm) || acm->throttle) - return; - -next_buffer: - spin_lock(&acm->read_lock); - if (list_empty(&acm->filled_read_bufs)) { - spin_unlock(&acm->read_lock); - goto urbs; + if (urb->actual_length > 0 && !acm->throttle) { + for (i = 0; i < urb->actual_length && !acm->throttle; i++) { + /* if we insert more than TTY_FLIPBUF_SIZE characters, + * we drop them. */ + if (tty->flip.count >= TTY_FLIPBUF_SIZE) { + tty_flip_buffer_push(tty); + } + tty_insert_flip_char(tty, data[i], 0); + } + dbg("Handed %d bytes to tty layer", i+1); + tty_flip_buffer_push(tty); } - buf = list_entry(acm->filled_read_bufs.next, - struct acm_rb, list); - list_del(&buf->list); - spin_unlock(&acm->read_lock); - - dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d\n", buf, buf->size); - - for (i = 0; i < buf->size && !acm->throttle; i++) { - /* if we insert more than TTY_FLIPBUF_SIZE characters, - we drop them. */ - if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - tty_flip_buffer_push(tty); - } - tty_insert_flip_char(tty, buf->base[i], 0); - } - tty_flip_buffer_push(tty); spin_lock(&acm->throttle_lock); if (acm->throttle) { dbg("Throtteling noticed"); - memmove(buf->base, buf->base + i, buf->size - i); - buf->size -= i; + memmove(data, data + i, urb->actual_length - i); + urb->actual_length -= i; + acm->resubmit_to_unthrottle = 1; spin_unlock(&acm->throttle_lock); - spin_lock(&acm->read_lock); - list_add(&buf->list, &acm->filled_read_bufs); - spin_unlock(&acm->read_lock); return; } spin_unlock(&acm->throttle_lock); - spin_lock(&acm->read_lock); - list_add(&buf->list, &acm->spare_read_bufs); - spin_unlock(&acm->read_lock); - goto next_buffer; - -urbs: - while (!list_empty(&acm->spare_read_bufs)) { - spin_lock(&acm->read_lock); - if (list_empty(&acm->spare_read_urbs)) { - spin_unlock(&acm->read_lock); - return; - } - rcv = list_entry(acm->spare_read_urbs.next, - struct acm_ru, list); - list_del(&rcv->list); - spin_unlock(&acm->read_lock); - - buf = list_entry(acm->spare_read_bufs.next, - struct acm_rb, list); - list_del(&buf->list); - - rcv->buffer = buf; - - usb_fill_bulk_urb(rcv->urb, acm->dev, - acm->rx_endpoint, - buf->base, - acm->readsize, - acm_read_bulk, rcv); - rcv->urb->transfer_dma = buf->dma; - rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - - dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p\n", rcv->urb, rcv, buf); - - /* This shouldn't kill the driver as unsuccessful URBs are returned to the - free-urbs-pool and resubmited ASAP */ - if (usb_submit_urb(rcv->urb, GFP_ATOMIC) < 0) { - list_add(&buf->list, &acm->spare_read_bufs); - spin_lock(&acm->read_lock); - list_add(&rcv->list, &acm->spare_read_urbs); - spin_unlock(&acm->read_lock); - return; - } - } + urb->actual_length = 0; + urb->dev = acm->dev; + + i = usb_submit_urb(urb, GFP_ATOMIC); + if (i) + dev_dbg(&acm->data->dev, "bulk rx resubmit %d\n", i); } /* data interface wrote those outgoing bytes */ @@ -434,7 +369,6 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) { struct acm *acm; int rv = -EINVAL; - int i; dbg("Entering acm_tty_open.\n"); down(&open_sem); @@ -448,9 +382,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) tty->driver_data = acm; acm->tty = tty; - /* force low_latency on so that our tty_push actually forces the data through, - otherwise it is scheduled, and with high data rates data can get lost. */ - tty->low_latency = 1; + if (acm->used++) { goto done; @@ -462,20 +394,18 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) goto bail_out; } + acm->readurb->dev = acm->dev; + if (usb_submit_urb(acm->readurb, GFP_KERNEL)) { + dbg("usb_submit_urb(read bulk) failed"); + goto bail_out_and_unlink; + } + if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS)) goto full_bailout; - INIT_LIST_HEAD(&acm->spare_read_urbs); - INIT_LIST_HEAD(&acm->spare_read_bufs); - INIT_LIST_HEAD(&acm->filled_read_bufs); - for (i = 0; i < ACM_NRU; i++) { - list_add(&(acm->ru[i].list), &acm->spare_read_urbs); - } - for (i = 0; i < ACM_NRB; i++) { - list_add(&(acm->rb[i].list), &acm->spare_read_bufs); - } - - tasklet_schedule(&acm->urb_task); + /* force low_latency on so that our tty_push actually forces the data through, + otherwise it is scheduled, and with high data rates data can get lost. */ + tty->low_latency = 1; done: err_out: @@ -483,6 +413,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) return rv; full_bailout: + usb_kill_urb(acm->readurb); +bail_out_and_unlink: usb_kill_urb(acm->ctrlurb); bail_out: acm->used--; @@ -492,22 +424,18 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) static void acm_tty_unregister(struct acm *acm) { - int i; - tty_unregister_device(acm_tty_driver, acm->minor); usb_put_intf(acm->control); acm_table[acm->minor] = NULL; usb_free_urb(acm->ctrlurb); + usb_free_urb(acm->readurb); usb_free_urb(acm->writeurb); - for (i = 0; i < ACM_NRU; i++) - usb_free_urb(acm->ru[i].urb); kfree(acm); } static void acm_tty_close(struct tty_struct *tty, struct file *filp) { struct acm *acm = tty->driver_data; - int i; if (!acm || !acm->used) return; @@ -518,8 +446,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp) acm_set_control(acm, acm->ctrlout = 0); usb_kill_urb(acm->ctrlurb); usb_kill_urb(acm->writeurb); - for (i = 0; i < ACM_NRU; i++) - usb_kill_urb(acm->ru[i].urb); + usb_kill_urb(acm->readurb); } else acm_tty_unregister(acm); } @@ -601,7 +528,10 @@ static void acm_tty_unthrottle(struct tty_struct *tty) spin_lock_bh(&acm->throttle_lock); acm->throttle = 0; spin_unlock_bh(&acm->throttle_lock); - tasklet_schedule(&acm->urb_task); + if (acm->resubmit_to_unthrottle) { + acm->resubmit_to_unthrottle = 0; + acm_read_bulk(acm->readurb, NULL); + } } static void acm_tty_break_ctl(struct tty_struct *tty, int state) @@ -658,7 +588,7 @@ static int acm_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int return -ENOIOCTLCMD; } -static const __u32 acm_tty_speed[] = { +static __u32 acm_tty_speed[] = { 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 500000, 576000, @@ -666,7 +596,7 @@ static const __u32 acm_tty_speed[] = { 2500000, 3000000, 3500000, 4000000 }; -static const __u8 acm_tty_size[] = { +static __u8 acm_tty_size[] = { 5, 6, 7, 8 }; @@ -764,7 +694,6 @@ static int acm_probe (struct usb_interface *intf, int call_interface_num = -1; int data_interface_num; unsigned long quirks; - int i; /* handle quirks deadly to normal probing*/ quirks = (unsigned long)id->driver_info; @@ -904,7 +833,7 @@ static int acm_probe (struct usb_interface *intf, } ctrlsize = le16_to_cpu(epctrl->wMaxPacketSize); - readsize = le16_to_cpu(epread->wMaxPacketSize)*2; + readsize = le16_to_cpu(epread->wMaxPacketSize); acm->writesize = le16_to_cpu(epwrite->wMaxPacketSize); acm->control = control_interface; acm->data = data_interface; @@ -913,14 +842,12 @@ static int acm_probe (struct usb_interface *intf, acm->ctrl_caps = ac_management_function; acm->ctrlsize = ctrlsize; acm->readsize = readsize; - acm->urb_task.func = acm_rx_tasklet; - acm->urb_task.data = (unsigned long) acm; + acm->bh.func = acm_rx_tasklet; + acm->bh.data = (unsigned long) acm; INIT_WORK(&acm->work, acm_softint, acm); spin_lock_init(&acm->throttle_lock); spin_lock_init(&acm->write_lock); - spin_lock_init(&acm->read_lock); acm->write_ready = 1; - acm->rx_endpoint = usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress); buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); if (!buf) { @@ -929,6 +856,13 @@ static int acm_probe (struct usb_interface *intf, } acm->ctrl_buffer = buf; + buf = usb_buffer_alloc(usb_dev, readsize, GFP_KERNEL, &acm->read_dma); + if (!buf) { + dev_dbg(&intf->dev, "out of memory (read buffer alloc)\n"); + goto alloc_fail3; + } + acm->read_buffer = buf; + if (acm_write_buffers_alloc(acm) < 0) { dev_dbg(&intf->dev, "out of memory (write buffer alloc)\n"); goto alloc_fail4; @@ -939,25 +873,10 @@ static int acm_probe (struct usb_interface *intf, dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)\n"); goto alloc_fail5; } - for (i = 0; i < ACM_NRU; i++) { - struct acm_ru *rcv = &(acm->ru[i]); - - if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) { - dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)\n"); - goto alloc_fail7; - } - - rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - rcv->instance = acm; - } - for (i = 0; i < ACM_NRB; i++) { - struct acm_rb *buf = &(acm->rb[i]); - - // Using usb_buffer_alloc instead of kmalloc as Oliver suggested - if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) { - dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)\n"); - goto alloc_fail7; - } + acm->readurb = usb_alloc_urb(0, GFP_KERNEL); + if (!acm->readurb) { + dev_dbg(&intf->dev, "out of memory (readurb kmalloc)\n"); + goto alloc_fail6; } acm->writeurb = usb_alloc_urb(0, GFP_KERNEL); if (!acm->writeurb) { @@ -970,9 +889,15 @@ static int acm_probe (struct usb_interface *intf, acm->ctrlurb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; acm->ctrlurb->transfer_dma = acm->ctrl_dma; + usb_fill_bulk_urb(acm->readurb, usb_dev, usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress), + acm->read_buffer, readsize, acm_read_bulk, acm); + acm->readurb->transfer_flags |= URB_NO_FSBR | URB_NO_TRANSFER_DMA_MAP; + acm->readurb->transfer_dma = acm->read_dma; + usb_fill_bulk_urb(acm->writeurb, usb_dev, usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), NULL, acm->writesize, acm_write_bulk, acm); acm->writeurb->transfer_flags |= URB_NO_FSBR | URB_NO_TRANSFER_DMA_MAP; + /* acm->writeurb->transfer_dma = 0; */ dev_info(&intf->dev, "ttyACM%d: USB ACM device\n", minor); @@ -992,14 +917,14 @@ static int acm_probe (struct usb_interface *intf, return 0; alloc_fail7: - for (i = 0; i < ACM_NRB; i++) - usb_buffer_free(usb_dev, acm->readsize, acm->rb[i].base, acm->rb[i].dma); - for (i = 0; i < ACM_NRU; i++) - usb_free_urb(acm->ru[i].urb); + usb_free_urb(acm->readurb); +alloc_fail6: usb_free_urb(acm->ctrlurb); alloc_fail5: acm_write_buffers_free(acm); alloc_fail4: + usb_buffer_free(usb_dev, readsize, acm->read_buffer, acm->read_dma); +alloc_fail3: usb_buffer_free(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma); alloc_fail2: kfree(acm); @@ -1011,7 +936,6 @@ static void acm_disconnect(struct usb_interface *intf) { struct acm *acm = usb_get_intfdata (intf); struct usb_device *usb_dev = interface_to_usbdev(intf); - int i; if (!acm || !acm->dev) { dbg("disconnect on nonexisting interface"); @@ -1022,24 +946,15 @@ static void acm_disconnect(struct usb_interface *intf) acm->dev = NULL; usb_set_intfdata (intf, NULL); - tasklet_disable(&acm->urb_task); - usb_kill_urb(acm->ctrlurb); + usb_kill_urb(acm->readurb); usb_kill_urb(acm->writeurb); - for (i = 0; i < ACM_NRU; i++) - usb_kill_urb(acm->ru[i].urb); - - INIT_LIST_HEAD(&acm->filled_read_bufs); - INIT_LIST_HEAD(&acm->spare_read_bufs); - - tasklet_enable(&acm->urb_task); flush_scheduled_work(); /* wait for acm_softint */ acm_write_buffers_free(acm); + usb_buffer_free(usb_dev, acm->readsize, acm->read_buffer, acm->read_dma); usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer, acm->ctrl_dma); - for (i = 0; i < ACM_NRB; i++) - usb_buffer_free(usb_dev, acm->readsize, acm->rb[i].base, acm->rb[i].dma); usb_driver_release_interface(&acm_driver, acm->data); @@ -1088,6 +1003,7 @@ static struct usb_device_id acm_ids[] = { MODULE_DEVICE_TABLE (usb, acm_ids); static struct usb_driver acm_driver = { + .owner = THIS_MODULE, .name = "cdc_acm", .probe = acm_probe, .disconnect = acm_disconnect, diff --git a/trunk/drivers/usb/class/cdc-acm.h b/trunk/drivers/usb/class/cdc-acm.h index fd2aaccdcbac..963a5dfd2096 100644 --- a/trunk/drivers/usb/class/cdc-acm.h +++ b/trunk/drivers/usb/class/cdc-acm.h @@ -59,9 +59,6 @@ * when processing onlcr, so we only need 2 buffers. */ #define ACM_NWB 2 -#define ACM_NRU 16 -#define ACM_NRB 16 - struct acm_wb { unsigned char *buf; dma_addr_t dmah; @@ -69,43 +66,22 @@ struct acm_wb { int use; }; -struct acm_rb { - struct list_head list; - int size; - unsigned char *base; - dma_addr_t dma; -}; - -struct acm_ru { - struct list_head list; - struct acm_rb *buffer; - struct urb *urb; - struct acm *instance; -}; - struct acm { struct usb_device *dev; /* the corresponding usb device */ struct usb_interface *control; /* control interface */ struct usb_interface *data; /* data interface */ struct tty_struct *tty; /* the corresponding tty */ - struct urb *ctrlurb, *writeurb; /* urbs */ - u8 *ctrl_buffer; /* buffers of urbs */ - dma_addr_t ctrl_dma; /* dma handles of buffers */ + struct urb *ctrlurb, *readurb, *writeurb; /* urbs */ + u8 *ctrl_buffer, *read_buffer; /* buffers of urbs */ + dma_addr_t ctrl_dma, read_dma; /* dma handles of buffers */ struct acm_wb wb[ACM_NWB]; - struct acm_ru ru[ACM_NRU]; - struct acm_rb rb[ACM_NRB]; - int rx_endpoint; - spinlock_t read_lock; - struct list_head spare_read_urbs; - struct list_head spare_read_bufs; - struct list_head filled_read_bufs; int write_current; /* current write buffer */ int write_used; /* number of non-empty write buffers */ int write_ready; /* write urb is not running */ spinlock_t write_lock; struct usb_cdc_line_coding line; /* bits, stop, parity */ struct work_struct work; /* work queue entry for line discipline waking up */ - struct tasklet_struct urb_task; /* rx processing */ + struct tasklet_struct bh; /* rx processing */ spinlock_t throttle_lock; /* synchronize throtteling and read callback */ unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */ unsigned int ctrlout; /* output control lines (DTR, RTS) */ @@ -115,6 +91,7 @@ struct acm { unsigned int minor; /* acm minor number */ unsigned char throttle; /* throttled by tty layer */ unsigned char clocal; /* termios CLOCAL */ + unsigned char resubmit_to_unthrottle; /* throtteling has disabled the read urb */ unsigned int ctrl_caps; /* control capabilities from the class specific header */ }; diff --git a/trunk/drivers/usb/class/usb-midi.c b/trunk/drivers/usb/class/usb-midi.c index f13f004d311f..5f8af35e7633 100644 --- a/trunk/drivers/usb/class/usb-midi.c +++ b/trunk/drivers/usb/class/usb-midi.c @@ -2027,6 +2027,7 @@ static struct usb_device_id id_table[] = { }; static struct usb_driver usb_midi_driver = { + .owner = THIS_MODULE, .name = "midi", .probe = usb_midi_probe, .disconnect = usb_midi_disconnect, diff --git a/trunk/drivers/usb/class/usblp.c b/trunk/drivers/usb/class/usblp.c index 27e9404547f3..357e75335f17 100644 --- a/trunk/drivers/usb/class/usblp.c +++ b/trunk/drivers/usb/class/usblp.c @@ -199,7 +199,7 @@ struct quirk_printer_struct { #define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires unidirectional mode (no INs/reads) */ #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */ -static const struct quirk_printer_struct quirk_printers[] = { +static struct quirk_printer_struct quirk_printers[] = { { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */ { 0x03f0, 0x0104, USBLP_QUIRK_BIDIR }, /* HP DeskJet 880C */ { 0x03f0, 0x0204, USBLP_QUIRK_BIDIR }, /* HP DeskJet 815C */ @@ -301,7 +301,7 @@ static void usblp_bulk_write(struct urb *urb, struct pt_regs *regs) * Get and print printer errors. */ -static const char *usblp_messages[] = { "ok", "out of paper", "off-line", "on fire" }; +static char *usblp_messages[] = { "ok", "out of paper", "off-line", "on fire" }; static int usblp_check_status(struct usblp *usblp, int err) { @@ -438,7 +438,7 @@ static unsigned int usblp_poll(struct file *file, struct poll_table_struct *wait | (!usblp->wcomplete ? 0 : POLLOUT | POLLWRNORM); } -static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { struct usblp *usblp = file->private_data; int length, err, i; @@ -838,8 +838,7 @@ static struct file_operations usblp_fops = { .read = usblp_read, .write = usblp_write, .poll = usblp_poll, - .unlocked_ioctl = usblp_ioctl, - .compat_ioctl = usblp_ioctl, + .ioctl = usblp_ioctl, .open = usblp_open, .release = usblp_release, }; @@ -850,20 +849,6 @@ static struct usb_class_driver usblp_class = { .minor_base = USBLP_MINOR_BASE, }; -static ssize_t usblp_show_ieee1284_id(struct device *dev, struct device_attribute *attr, char *buf) -{ - struct usb_interface *intf = to_usb_interface(dev); - struct usblp *usblp = usb_get_intfdata (intf); - - if (usblp->device_id_string[0] == 0 && - usblp->device_id_string[1] == 0) - return 0; - - return sprintf(buf, "%s", usblp->device_id_string+2); -} - -static DEVICE_ATTR(ieee1284_id, S_IRUGO, usblp_show_ieee1284_id, NULL); - static int usblp_probe(struct usb_interface *intf, const struct usb_device_id *id) { @@ -948,12 +933,20 @@ static int usblp_probe(struct usb_interface *intf, /* Retrieve and store the device ID string. */ usblp_cache_device_id_string(usblp); - device_create_file(&intf->dev, &dev_attr_ieee1284_id); #ifdef DEBUG usblp_check_status(usblp, 0); #endif + info("usblp%d: USB %sdirectional printer dev %d " + "if %d alt %d proto %d vid 0x%4.4X pid 0x%4.4X", + usblp->minor, usblp->bidir ? "Bi" : "Uni", dev->devnum, + usblp->ifnum, + usblp->protocol[usblp->current_protocol].alt_setting, + usblp->current_protocol, + le16_to_cpu(usblp->dev->descriptor.idVendor), + le16_to_cpu(usblp->dev->descriptor.idProduct)); + usb_set_intfdata (intf, usblp); usblp->present = 1; @@ -964,20 +957,11 @@ static int usblp_probe(struct usb_interface *intf, goto abort_intfdata; } usblp->minor = intf->minor; - info("usblp%d: USB %sdirectional printer dev %d " - "if %d alt %d proto %d vid 0x%4.4X pid 0x%4.4X", - usblp->minor, usblp->bidir ? "Bi" : "Uni", dev->devnum, - usblp->ifnum, - usblp->protocol[usblp->current_protocol].alt_setting, - usblp->current_protocol, - le16_to_cpu(usblp->dev->descriptor.idVendor), - le16_to_cpu(usblp->dev->descriptor.idProduct)); return 0; abort_intfdata: usb_set_intfdata (intf, NULL); - device_remove_file(&intf->dev, &dev_attr_ieee1284_id); abort: if (usblp) { if (usblp->writebuf) @@ -1172,8 +1156,6 @@ static void usblp_disconnect(struct usb_interface *intf) BUG (); } - device_remove_file(&intf->dev, &dev_attr_ieee1284_id); - down (&usblp_sem); down (&usblp->sem); usblp->present = 0; @@ -1204,6 +1186,7 @@ static struct usb_device_id usblp_ids [] = { MODULE_DEVICE_TABLE (usb, usblp_ids); static struct usb_driver usblp_driver = { + .owner = THIS_MODULE, .name = "usblp", .probe = usblp_probe, .disconnect = usblp_disconnect, diff --git a/trunk/drivers/usb/core/Makefile b/trunk/drivers/usb/core/Makefile index 28329ddf187c..dd1c4d2a0c31 100644 --- a/trunk/drivers/usb/core/Makefile +++ b/trunk/drivers/usb/core/Makefile @@ -2,7 +2,7 @@ # Makefile for USB Core files and filesystem # -usbcore-objs := usb.o hub.o hcd.o urb.o message.o driver.o \ +usbcore-objs := usb.o hub.o hcd.o urb.o message.o \ config.o file.o buffer.o sysfs.o devio.o notify.o ifeq ($(CONFIG_PCI),y) @@ -14,7 +14,3 @@ ifeq ($(CONFIG_USB_DEVICEFS),y) endif obj-$(CONFIG_USB) += usbcore.o - -ifeq ($(CONFIG_USB_DEBUG),y) -EXTRA_CFLAGS += -DDEBUG -endif diff --git a/trunk/drivers/usb/core/buffer.c b/trunk/drivers/usb/core/buffer.c index ad742cec94fa..57e800ac3cee 100644 --- a/trunk/drivers/usb/core/buffer.c +++ b/trunk/drivers/usb/core/buffer.c @@ -15,6 +15,14 @@ #include #include #include + + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include #include "hcd.h" @@ -55,9 +63,6 @@ int hcd_buffer_create (struct usb_hcd *hcd) char name [16]; int i, size; - if (!hcd->self.controller->dma_mask) - return 0; - for (i = 0; i < HCD_BUFFER_POOLS; i++) { if (!(size = pool_max [i])) continue; diff --git a/trunk/drivers/usb/core/config.c b/trunk/drivers/usb/core/config.c index a9d89c78cc20..993019500cc3 100644 --- a/trunk/drivers/usb/core/config.c +++ b/trunk/drivers/usb/core/config.c @@ -1,4 +1,9 @@ #include + +#ifdef CONFIG_USB_DEBUG +#define DEBUG +#endif + #include #include #include diff --git a/trunk/drivers/usb/core/devices.c b/trunk/drivers/usb/core/devices.c index 2684e15b813b..83e815d3cd52 100644 --- a/trunk/drivers/usb/core/devices.c +++ b/trunk/drivers/usb/core/devices.c @@ -67,45 +67,45 @@ /* Define ALLOW_SERIAL_NUMBER if you want to see the serial number of devices */ #define ALLOW_SERIAL_NUMBER -static const char *format_topo = +static char *format_topo = /* T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd */ "\nT: Bus=%2.2d Lev=%2.2d Prnt=%2.2d Port=%2.2d Cnt=%2.2d Dev#=%3d Spd=%3s MxCh=%2d\n"; -static const char *format_string_manufacturer = +static char *format_string_manufacturer = /* S: Manufacturer=xxxx */ "S: Manufacturer=%.100s\n"; -static const char *format_string_product = +static char *format_string_product = /* S: Product=xxxx */ "S: Product=%.100s\n"; #ifdef ALLOW_SERIAL_NUMBER -static const char *format_string_serialnumber = +static char *format_string_serialnumber = /* S: SerialNumber=xxxx */ "S: SerialNumber=%.100s\n"; #endif -static const char *format_bandwidth = +static char *format_bandwidth = /* B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd */ "B: Alloc=%3d/%3d us (%2d%%), #Int=%3d, #Iso=%3d\n"; -static const char *format_device1 = +static char *format_device1 = /* D: Ver=xx.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd */ "D: Ver=%2x.%02x Cls=%02x(%-5s) Sub=%02x Prot=%02x MxPS=%2d #Cfgs=%3d\n"; -static const char *format_device2 = +static char *format_device2 = /* P: Vendor=xxxx ProdID=xxxx Rev=xx.xx */ "P: Vendor=%04x ProdID=%04x Rev=%2x.%02x\n"; -static const char *format_config = +static char *format_config = /* C: #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA */ "C:%c #Ifs=%2d Cfg#=%2d Atr=%02x MxPwr=%3dmA\n"; -static const char *format_iface = +static char *format_iface = /* I: If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=xxxx*/ "I: If#=%2d Alt=%2d #EPs=%2d Cls=%02x(%-5s) Sub=%02x Prot=%02x Driver=%s\n"; -static const char *format_endpt = +static char *format_endpt = /* E: Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=D?s */ "E: Ad=%02x(%c) Atr=%02x(%-4s) MxPS=%4d Ivl=%d%cs\n"; @@ -545,10 +545,10 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes, loff_t *ski struct usb_device *childdev = usbdev->children[chix]; if (childdev) { - usb_lock_device(childdev); + down(&childdev->serialize); ret = usb_device_dump(buffer, nbytes, skip_bytes, file_offset, childdev, bus, level + 1, chix, ++cnt); - usb_unlock_device(childdev); + up(&childdev->serialize); if (ret == -EFAULT) return total_written; total_written += ret; diff --git a/trunk/drivers/usb/core/devio.c b/trunk/drivers/usb/core/devio.c index 2b68998fe4b3..942cd437dc48 100644 --- a/trunk/drivers/usb/core/devio.c +++ b/trunk/drivers/usb/core/devio.c @@ -402,6 +402,7 @@ static void driver_disconnect(struct usb_interface *intf) } struct usb_driver usbfs_driver = { + .owner = THIS_MODULE, .name = "usbfs", .probe = driver_probe, .disconnect = driver_disconnect, @@ -1349,7 +1350,9 @@ static int proc_ioctl(struct dev_state *ps, struct usbdevfs_ioctl *ctl) /* let kernel drivers try to (re)bind to the interface */ case USBDEVFS_CONNECT: usb_unlock_device(ps->dev); + usb_lock_all_devices(); bus_rescan_devices(intf->dev.bus); + usb_unlock_all_devices(); usb_lock_device(ps->dev); break; @@ -1389,13 +1392,13 @@ static int proc_ioctl_default(struct dev_state *ps, void __user *arg) } #ifdef CONFIG_COMPAT -static int proc_ioctl_compat(struct dev_state *ps, compat_uptr_t arg) +static int proc_ioctl_compat(struct dev_state *ps, void __user *arg) { struct usbdevfs_ioctl32 __user *uioc; struct usbdevfs_ioctl ctrl; u32 udata; - uioc = compat_ptr((long)arg); + uioc = compat_ptr(arg); if (get_user(ctrl.ifno, &uioc->ifno) || get_user(ctrl.ioctl_code, &uioc->ioctl_code) || __get_user(udata, &uioc->data)) @@ -1508,7 +1511,7 @@ static int usbdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd case USBDEVFS_IOCTL32: snoop(&dev->dev, "%s: IOCTL\n", __FUNCTION__); - ret = proc_ioctl_compat(ps, (compat_uptr_t)(long)p); + ret = proc_ioctl_compat(ps, p); break; #endif diff --git a/trunk/drivers/usb/core/driver.c b/trunk/drivers/usb/core/driver.c deleted file mode 100644 index 076462c8ba2a..000000000000 --- a/trunk/drivers/usb/core/driver.c +++ /dev/null @@ -1,472 +0,0 @@ -/* - * drivers/usb/driver.c - most of the driver model stuff for usb - * - * (C) Copyright 2005 Greg Kroah-Hartman - * - * based on drivers/usb/usb.c which had the following copyrights: - * (C) Copyright Linus Torvalds 1999 - * (C) Copyright Johannes Erdfelt 1999-2001 - * (C) Copyright Andreas Gal 1999 - * (C) Copyright Gregory P. Smith 1999 - * (C) Copyright Deti Fliegl 1999 (new USB architecture) - * (C) Copyright Randy Dunlap 2000 - * (C) Copyright David Brownell 2000-2004 - * (C) Copyright Yggdrasil Computing, Inc. 2000 - * (usb_device_id matching changes by Adam J. Richter) - * (C) Copyright Greg Kroah-Hartman 2002-2003 - * - * NOTE! This is not actually a driver at all, rather this is - * just a collection of helper routines that implement the - * generic USB things that the real drivers can use.. - * - */ - -#include -#include -#include -#include "hcd.h" -#include "usb.h" - -static int usb_match_one_id(struct usb_interface *interface, - const struct usb_device_id *id); - -struct usb_dynid { - struct list_head node; - struct usb_device_id id; -}; - - -static int generic_probe(struct device *dev) -{ - return 0; -} -static int generic_remove(struct device *dev) -{ - struct usb_device *udev = to_usb_device(dev); - - /* if this is only an unbind, not a physical disconnect, then - * unconfigure the device */ - if (udev->state == USB_STATE_CONFIGURED) - usb_set_configuration(udev, 0); - - /* in case the call failed or the device was suspended */ - if (udev->state >= USB_STATE_CONFIGURED) - usb_disable_device(udev, 0); - return 0; -} - -struct device_driver usb_generic_driver = { - .owner = THIS_MODULE, - .name = "usb", - .bus = &usb_bus_type, - .probe = generic_probe, - .remove = generic_remove, -}; - -/* Fun hack to determine if the struct device is a - * usb device or a usb interface. */ -int usb_generic_driver_data; - -#ifdef CONFIG_HOTPLUG - -/* - * Adds a new dynamic USBdevice ID to this driver, - * and cause the driver to probe for all devices again. - */ -static ssize_t store_new_id(struct device_driver *driver, - const char *buf, size_t count) -{ - struct usb_driver *usb_drv = to_usb_driver(driver); - struct usb_dynid *dynid; - u32 idVendor = 0; - u32 idProduct = 0; - int fields = 0; - - fields = sscanf(buf, "%x %x", &idVendor, &idProduct); - if (fields < 2) - return -EINVAL; - - dynid = kzalloc(sizeof(*dynid), GFP_KERNEL); - if (!dynid) - return -ENOMEM; - - INIT_LIST_HEAD(&dynid->node); - dynid->id.idVendor = idVendor; - dynid->id.idProduct = idProduct; - dynid->id.match_flags = USB_DEVICE_ID_MATCH_DEVICE; - - spin_lock(&usb_drv->dynids.lock); - list_add_tail(&usb_drv->dynids.list, &dynid->node); - spin_unlock(&usb_drv->dynids.lock); - - if (get_driver(driver)) { - driver_attach(driver); - put_driver(driver); - } - - return count; -} -static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id); - -static int usb_create_newid_file(struct usb_driver *usb_drv) -{ - int error = 0; - - if (usb_drv->no_dynamic_id) - goto exit; - - if (usb_drv->probe != NULL) - error = sysfs_create_file(&usb_drv->driver.kobj, - &driver_attr_new_id.attr); -exit: - return error; -} - -static void usb_remove_newid_file(struct usb_driver *usb_drv) -{ - if (usb_drv->no_dynamic_id) - return; - - if (usb_drv->probe != NULL) - sysfs_remove_file(&usb_drv->driver.kobj, - &driver_attr_new_id.attr); -} - -static void usb_free_dynids(struct usb_driver *usb_drv) -{ - struct usb_dynid *dynid, *n; - - spin_lock(&usb_drv->dynids.lock); - list_for_each_entry_safe(dynid, n, &usb_drv->dynids.list, node) { - list_del(&dynid->node); - kfree(dynid); - } - spin_unlock(&usb_drv->dynids.lock); -} -#else -static inline int usb_create_newid_file(struct usb_driver *usb_drv) -{ - return 0; -} - -static void usb_remove_newid_file(struct usb_driver *usb_drv) -{ -} - -static inline void usb_free_dynids(struct usb_driver *usb_drv) -{ -} -#endif - -static const struct usb_device_id *usb_match_dynamic_id(struct usb_interface *intf, - struct usb_driver *drv) -{ - struct usb_dynid *dynid; - - spin_lock(&drv->dynids.lock); - list_for_each_entry(dynid, &drv->dynids.list, node) { - if (usb_match_one_id(intf, &dynid->id)) { - spin_unlock(&drv->dynids.lock); - return &dynid->id; - } - } - spin_unlock(&drv->dynids.lock); - return NULL; -} - - -/* called from driver core with usb_bus_type.subsys writelock */ -static int usb_probe_interface(struct device *dev) -{ - struct usb_interface * intf = to_usb_interface(dev); - struct usb_driver * driver = to_usb_driver(dev->driver); - const struct usb_device_id *id; - int error = -ENODEV; - - dev_dbg(dev, "%s\n", __FUNCTION__); - - if (!driver->probe) - return error; - /* FIXME we'd much prefer to just resume it ... */ - if (interface_to_usbdev(intf)->state == USB_STATE_SUSPENDED) - return -EHOSTUNREACH; - - id = usb_match_id(intf, driver->id_table); - if (!id) - id = usb_match_dynamic_id(intf, driver); - if (id) { - dev_dbg(dev, "%s - got id\n", __FUNCTION__); - - /* Interface "power state" doesn't correspond to any hardware - * state whatsoever. We use it to record when it's bound to - * a driver that may start I/0: it's not frozen/quiesced. - */ - mark_active(intf); - intf->condition = USB_INTERFACE_BINDING; - error = driver->probe(intf, id); - if (error) { - mark_quiesced(intf); - intf->condition = USB_INTERFACE_UNBOUND; - } else - intf->condition = USB_INTERFACE_BOUND; - } - - return error; -} - -/* called from driver core with usb_bus_type.subsys writelock */ -static int usb_unbind_interface(struct device *dev) -{ - struct usb_interface *intf = to_usb_interface(dev); - struct usb_driver *driver = to_usb_driver(intf->dev.driver); - - intf->condition = USB_INTERFACE_UNBINDING; - - /* release all urbs for this interface */ - usb_disable_interface(interface_to_usbdev(intf), intf); - - if (driver && driver->disconnect) - driver->disconnect(intf); - - /* reset other interface state */ - usb_set_interface(interface_to_usbdev(intf), - intf->altsetting[0].desc.bInterfaceNumber, - 0); - usb_set_intfdata(intf, NULL); - intf->condition = USB_INTERFACE_UNBOUND; - mark_quiesced(intf); - - return 0; -} - -/* returns 0 if no match, 1 if match */ -static int usb_match_one_id(struct usb_interface *interface, - const struct usb_device_id *id) -{ - struct usb_host_interface *intf; - struct usb_device *dev; - - /* proc_connectinfo in devio.c may call us with id == NULL. */ - if (id == NULL) - return 0; - - intf = interface->cur_altsetting; - dev = interface_to_usbdev(interface); - - if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) && - id->idVendor != le16_to_cpu(dev->descriptor.idVendor)) - return 0; - - if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) && - id->idProduct != le16_to_cpu(dev->descriptor.idProduct)) - return 0; - - /* No need to test id->bcdDevice_lo != 0, since 0 is never - greater than any unsigned number. */ - if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) && - (id->bcdDevice_lo > le16_to_cpu(dev->descriptor.bcdDevice))) - return 0; - - if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) && - (id->bcdDevice_hi < le16_to_cpu(dev->descriptor.bcdDevice))) - return 0; - - if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) && - (id->bDeviceClass != dev->descriptor.bDeviceClass)) - return 0; - - if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) && - (id->bDeviceSubClass!= dev->descriptor.bDeviceSubClass)) - return 0; - - if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) && - (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol)) - return 0; - - if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) && - (id->bInterfaceClass != intf->desc.bInterfaceClass)) - return 0; - - if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) && - (id->bInterfaceSubClass != intf->desc.bInterfaceSubClass)) - return 0; - - if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) && - (id->bInterfaceProtocol != intf->desc.bInterfaceProtocol)) - return 0; - - return 1; -} -/** - * usb_match_id - find first usb_device_id matching device or interface - * @interface: the interface of interest - * @id: array of usb_device_id structures, terminated by zero entry - * - * usb_match_id searches an array of usb_device_id's and returns - * the first one matching the device or interface, or null. - * This is used when binding (or rebinding) a driver to an interface. - * Most USB device drivers will use this indirectly, through the usb core, - * but some layered driver frameworks use it directly. - * These device tables are exported with MODULE_DEVICE_TABLE, through - * modutils, to support the driver loading functionality of USB hotplugging. - * - * What Matches: - * - * The "match_flags" element in a usb_device_id controls which - * members are used. If the corresponding bit is set, the - * value in the device_id must match its corresponding member - * in the device or interface descriptor, or else the device_id - * does not match. - * - * "driver_info" is normally used only by device drivers, - * but you can create a wildcard "matches anything" usb_device_id - * as a driver's "modules.usbmap" entry if you provide an id with - * only a nonzero "driver_info" field. If you do this, the USB device - * driver's probe() routine should use additional intelligence to - * decide whether to bind to the specified interface. - * - * What Makes Good usb_device_id Tables: - * - * The match algorithm is very simple, so that intelligence in - * driver selection must come from smart driver id records. - * Unless you have good reasons to use another selection policy, - * provide match elements only in related groups, and order match - * specifiers from specific to general. Use the macros provided - * for that purpose if you can. - * - * The most specific match specifiers use device descriptor - * data. These are commonly used with product-specific matches; - * the USB_DEVICE macro lets you provide vendor and product IDs, - * and you can also match against ranges of product revisions. - * These are widely used for devices with application or vendor - * specific bDeviceClass values. - * - * Matches based on device class/subclass/protocol specifications - * are slightly more general; use the USB_DEVICE_INFO macro, or - * its siblings. These are used with single-function devices - * where bDeviceClass doesn't specify that each interface has - * its own class. - * - * Matches based on interface class/subclass/protocol are the - * most general; they let drivers bind to any interface on a - * multiple-function device. Use the USB_INTERFACE_INFO - * macro, or its siblings, to match class-per-interface style - * devices (as recorded in bDeviceClass). - * - * Within those groups, remember that not all combinations are - * meaningful. For example, don't give a product version range - * without vendor and product IDs; or specify a protocol without - * its associated class and subclass. - */ -const struct usb_device_id *usb_match_id(struct usb_interface *interface, - const struct usb_device_id *id) -{ - /* proc_connectinfo in devio.c may call us with id == NULL. */ - if (id == NULL) - return NULL; - - /* It is important to check that id->driver_info is nonzero, - since an entry that is all zeroes except for a nonzero - id->driver_info is the way to create an entry that - indicates that the driver want to examine every - device and interface. */ - for (; id->idVendor || id->bDeviceClass || id->bInterfaceClass || - id->driver_info; id++) { - if (usb_match_one_id(interface, id)) - return id; - } - - return NULL; -} -EXPORT_SYMBOL_GPL(usb_match_id); - -int usb_device_match(struct device *dev, struct device_driver *drv) -{ - struct usb_interface *intf; - struct usb_driver *usb_drv; - const struct usb_device_id *id; - - /* check for generic driver, which we don't match any device with */ - if (drv == &usb_generic_driver) - return 0; - - intf = to_usb_interface(dev); - usb_drv = to_usb_driver(drv); - - id = usb_match_id(intf, usb_drv->id_table); - if (id) - return 1; - - id = usb_match_dynamic_id(intf, usb_drv); - if (id) - return 1; - return 0; -} - -/** - * usb_register_driver - register a USB driver - * @new_driver: USB operations for the driver - * @owner: module owner of this driver. - * - * Registers a USB driver with the USB core. The list of unattached - * interfaces will be rescanned whenever a new driver is added, allowing - * the new driver to attach to any recognized devices. - * Returns a negative error code on failure and 0 on success. - * - * NOTE: if you want your driver to use the USB major number, you must call - * usb_register_dev() to enable that functionality. This function no longer - * takes care of that. - */ -int usb_register_driver(struct usb_driver *new_driver, struct module *owner) -{ - int retval = 0; - - if (usb_disabled()) - return -ENODEV; - - new_driver->driver.name = (char *)new_driver->name; - new_driver->driver.bus = &usb_bus_type; - new_driver->driver.probe = usb_probe_interface; - new_driver->driver.remove = usb_unbind_interface; - new_driver->driver.owner = owner; - spin_lock_init(&new_driver->dynids.lock); - INIT_LIST_HEAD(&new_driver->dynids.list); - - retval = driver_register(&new_driver->driver); - - if (!retval) { - pr_info("%s: registered new driver %s\n", - usbcore_name, new_driver->name); - usbfs_update_special(); - usb_create_newid_file(new_driver); - } else { - printk(KERN_ERR "%s: error %d registering driver %s\n", - usbcore_name, retval, new_driver->name); - } - - return retval; -} -EXPORT_SYMBOL_GPL(usb_register_driver); - -/** - * usb_deregister - unregister a USB driver - * @driver: USB operations of the driver to unregister - * Context: must be able to sleep - * - * Unlinks the specified driver from the internal USB driver list. - * - * NOTE: If you called usb_register_dev(), you still need to call - * usb_deregister_dev() to clean up your driver's allocated minor numbers, - * this * call will no longer do it for you. - */ -void usb_deregister(struct usb_driver *driver) -{ - pr_info("%s: deregistering driver %s\n", usbcore_name, driver->name); - - usb_remove_newid_file(driver); - usb_free_dynids(driver); - driver_unregister(&driver->driver); - - usbfs_update_special(); -} -EXPORT_SYMBOL_GPL(usb_deregister); diff --git a/trunk/drivers/usb/core/file.c b/trunk/drivers/usb/core/file.c index 37b13368c814..e695308095ae 100644 --- a/trunk/drivers/usb/core/file.c +++ b/trunk/drivers/usb/core/file.c @@ -19,6 +19,12 @@ #include #include #include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif #include #include "usb.h" diff --git a/trunk/drivers/usb/core/hcd-pci.c b/trunk/drivers/usb/core/hcd-pci.c index 29b5b2a6e183..84d9e69329bb 100644 --- a/trunk/drivers/usb/core/hcd-pci.c +++ b/trunk/drivers/usb/core/hcd-pci.c @@ -17,20 +17,19 @@ */ #include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include #include #include -#include - #include #include - -#ifdef CONFIG_PPC_PMAC -#include -#include -#include -#include -#endif +#include #include "usb.h" #include "hcd.h" @@ -219,7 +218,6 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message) goto done; } } - synchronize_irq(dev->irq); /* FIXME until the generic PM interfaces change a lot more, this * can't use PCI D1 and D2 states. For example, the confusion @@ -286,22 +284,8 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message) } done: - if (retval == 0) { + if (retval == 0) dev->dev.power.power_state = PMSG_SUSPEND; - -#ifdef CONFIG_PPC_PMAC - /* Disable ASIC clocks for USB */ - if (_machine == _MACH_Pmac) { - struct device_node *of_node; - - of_node = pci_device_to_OF_node (dev); - if (of_node) - pmac_call_feature(PMAC_FTR_USB_ENABLE, - of_node, 0, 0); - } -#endif - } - return retval; } EXPORT_SYMBOL (usb_hcd_pci_suspend); @@ -324,18 +308,6 @@ int usb_hcd_pci_resume (struct pci_dev *dev) return 0; } -#ifdef CONFIG_PPC_PMAC - /* Reenable ASIC clocks for USB */ - if (_machine == _MACH_Pmac) { - struct device_node *of_node; - - of_node = pci_device_to_OF_node (dev); - if (of_node) - pmac_call_feature (PMAC_FTR_USB_ENABLE, - of_node, 0, 1); - } -#endif - /* NOTE: chip docs cover clean "real suspend" cases (what Linux * calls "standby", "suspend to RAM", and so on). There are also * dirty cases when swsusp fakes a suspend in "shutdown" mode. @@ -393,7 +365,7 @@ int usb_hcd_pci_resume (struct pci_dev *dev) dev->dev.power.power_state = PMSG_ON; - clear_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); + hcd->saw_irq = 0; if (hcd->driver->resume) { retval = hcd->driver->resume(hcd); diff --git a/trunk/drivers/usb/core/hcd.c b/trunk/drivers/usb/core/hcd.c index 0018bbc4de34..6c7ca5b08cd6 100644 --- a/trunk/drivers/usb/core/hcd.c +++ b/trunk/drivers/usb/core/hcd.c @@ -23,6 +23,11 @@ */ #include + +#ifdef CONFIG_USB_DEBUG +#define DEBUG +#endif + #include #include #include @@ -857,7 +862,9 @@ static int register_root_hub (struct usb_device *usb_dev, return (retval < 0) ? retval : -EMSGSIZE; } + usb_lock_device (usb_dev); retval = usb_new_device (usb_dev); + usb_unlock_device (usb_dev); if (retval) { usb_dev->bus->root_hub = NULL; dev_err (parent_dev, "can't register root hub for %s, %d\n", @@ -1313,12 +1320,11 @@ static int hcd_unlink_urb (struct urb *urb, int status) * finish unlinking the initial failed usb_set_address() * or device descriptor fetch. */ - if (!test_bit(HCD_FLAG_SAW_IRQ, &hcd->flags) - && hcd->self.root_hub != urb->dev) { + if (!hcd->saw_irq && hcd->self.root_hub != urb->dev) { dev_warn (hcd->self.controller, "Unlink after no-IRQ? " "Controller is probably using the wrong IRQ." "\n"); - set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); + hcd->saw_irq = 1; } urb->status = status; @@ -1648,15 +1654,13 @@ irqreturn_t usb_hcd_irq (int irq, void *__hcd, struct pt_regs * r) struct usb_hcd *hcd = __hcd; int start = hcd->state; - if (unlikely(start == HC_STATE_HALT || - !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) + if (start == HC_STATE_HALT) return IRQ_NONE; if (hcd->driver->irq (hcd, r) == IRQ_NONE) return IRQ_NONE; - set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); - - if (unlikely(hcd->state == HC_STATE_HALT)) + hcd->saw_irq = 1; + if (hcd->state == HC_STATE_HALT) usb_hc_died (hcd); return IRQ_HANDLED; } @@ -1769,8 +1773,6 @@ int usb_add_hcd(struct usb_hcd *hcd, dev_info(hcd->self.controller, "%s\n", hcd->product_desc); - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); - /* till now HC has been in an indeterminate state ... */ if (hcd->driver->reset && (retval = hcd->driver->reset(hcd)) < 0) { dev_err(hcd->self.controller, "can't reset\n"); @@ -1825,6 +1827,8 @@ int usb_add_hcd(struct usb_hcd *hcd, retval = -ENOMEM; goto err_allocate_root_hub; } + rhdev->speed = (hcd->driver->flags & HCD_USB2) ? USB_SPEED_HIGH : + USB_SPEED_FULL; /* Although in principle hcd->driver->start() might need to use rhdev, * none of the current drivers do. @@ -1842,9 +1846,6 @@ int usb_add_hcd(struct usb_hcd *hcd, dev_dbg(hcd->self.controller, "supports USB remote wakeup\n"); hcd->remote_wakeup = hcd->can_wakeup; - rhdev->speed = (hcd->driver->flags & HCD_USB2) ? USB_SPEED_HIGH : - USB_SPEED_FULL; - rhdev->bus_mA = min(500u, hcd->power_budget); if ((retval = register_root_hub(rhdev, hcd)) != 0) goto err_register_root_hub; @@ -1890,10 +1891,7 @@ void usb_remove_hcd(struct usb_hcd *hcd) spin_lock_irq (&hcd_root_hub_lock); hcd->rh_registered = 0; spin_unlock_irq (&hcd_root_hub_lock); - - down(&usb_bus_list_lock); usb_disconnect(&hcd->self.root_hub); - up(&usb_bus_list_lock); hcd->poll_rh = 0; del_timer_sync(&hcd->rh_timer); diff --git a/trunk/drivers/usb/core/hcd.h b/trunk/drivers/usb/core/hcd.h index 591b5aad1a18..24a62a2ff86d 100644 --- a/trunk/drivers/usb/core/hcd.h +++ b/trunk/drivers/usb/core/hcd.h @@ -72,12 +72,7 @@ struct usb_hcd { /* usb_bus.hcpriv points to this */ * hardware info/state */ const struct hc_driver *driver; /* hw-specific hooks */ - - /* Flags that need to be manipulated atomically */ - unsigned long flags; -#define HCD_FLAG_HW_ACCESSIBLE 0x00000001 -#define HCD_FLAG_SAW_IRQ 0x00000002 - + unsigned saw_irq : 1; unsigned can_wakeup:1; /* hw supports wakeup? */ unsigned remote_wakeup:1;/* sw should use wakeup? */ unsigned rh_registered:1;/* is root hub registered? */ @@ -380,7 +375,6 @@ extern int usb_find_interface_driver (struct usb_device *dev, #ifdef CONFIG_PM extern void usb_hcd_suspend_root_hub (struct usb_hcd *hcd); extern void usb_hcd_resume_root_hub (struct usb_hcd *hcd); -extern void usb_root_hub_lost_power (struct usb_device *rhdev); extern int hcd_bus_suspend (struct usb_bus *bus); extern int hcd_bus_resume (struct usb_bus *bus); #else diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index 650d5ee5871b..256d9f698715 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -9,6 +9,11 @@ */ #include +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif #include #include #include @@ -32,7 +37,7 @@ #include "hub.h" /* Protect struct usb_device->state and ->children members - * Note: Both are also protected by ->dev.sem, except that ->state can + * Note: Both are also protected by ->serialize, except that ->state can * change to USB_STATE_NOTATTACHED even when the semaphore isn't held. */ static DEFINE_SPINLOCK(device_state_lock); @@ -515,31 +520,6 @@ static int hub_port_disable(struct usb_hub *hub, int port1, int set_state) return ret; } - -/* caller has locked the hub device */ -static void hub_pre_reset(struct usb_hub *hub, int disable_ports) -{ - struct usb_device *hdev = hub->hdev; - int port1; - - for (port1 = 1; port1 <= hdev->maxchild; ++port1) { - if (hdev->children[port1 - 1]) { - usb_disconnect(&hdev->children[port1 - 1]); - if (disable_ports) - hub_port_disable(hub, port1, 0); - } - } - hub_quiesce(hub); -} - -/* caller has locked the hub device */ -static void hub_post_reset(struct usb_hub *hub) -{ - hub_activate(hub); - hub_power_on(hub); -} - - static int hub_configure(struct usb_hub *hub, struct usb_endpoint_descriptor *endpoint) { @@ -702,40 +682,26 @@ static int hub_configure(struct usb_hub *hub, * and battery-powered root hubs (may provide just 8 mA). */ ret = usb_get_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus); - if (ret < 2) { + if (ret < 0) { message = "can't get hub status"; goto fail; } le16_to_cpus(&hubstatus); if (hdev == hdev->bus->root_hub) { - if (hdev->bus_mA == 0 || hdev->bus_mA >= 500) - hub->mA_per_port = 500; - else { - hub->mA_per_port = hdev->bus_mA; - hub->limited_power = 1; - } + struct usb_hcd *hcd = + container_of(hdev->bus, struct usb_hcd, self); + + hub->power_budget = min(500u, hcd->power_budget) / 2; } else if ((hubstatus & (1 << USB_DEVICE_SELF_POWERED)) == 0) { dev_dbg(hub_dev, "hub controller current requirement: %dmA\n", hub->descriptor->bHubContrCurrent); - hub->limited_power = 1; - if (hdev->maxchild > 0) { - int remaining = hdev->bus_mA - - hub->descriptor->bHubContrCurrent; - - if (remaining < hdev->maxchild * 100) - dev_warn(hub_dev, - "insufficient power available " - "to use all downstream ports\n"); - hub->mA_per_port = 100; /* 7.2.1.1 */ - } - } else { /* Self-powered external hub */ - /* FIXME: What about battery-powered external hubs that - * provide less current per port? */ - hub->mA_per_port = 500; + hub->power_budget = (501 - hub->descriptor->bHubContrCurrent) + / 2; } - if (hub->mA_per_port < 500) - dev_dbg(hub_dev, "%umA bus power budget for each child\n", - hub->mA_per_port); + if (hub->power_budget) + dev_dbg(hub_dev, "%dmA bus power budget for children\n", + hub->power_budget * 2); + ret = hub_hub_status(hub, &hubstatus, &hubchange); if (ret < 0) { @@ -789,10 +755,29 @@ static int hub_configure(struct usb_hub *hub, static unsigned highspeed_hubs; +/* Called after the hub driver is unbound from a hub with children */ +static void hub_remove_children_work(void *__hub) +{ + struct usb_hub *hub = __hub; + struct usb_device *hdev = hub->hdev; + int i; + + kfree(hub); + + usb_lock_device(hdev); + for (i = 0; i < hdev->maxchild; ++i) { + if (hdev->children[i]) + usb_disconnect(&hdev->children[i]); + } + usb_unlock_device(hdev); + usb_put_dev(hdev); +} + static void hub_disconnect(struct usb_interface *intf) { struct usb_hub *hub = usb_get_intfdata (intf); struct usb_device *hdev; + int n, port1; usb_set_intfdata (intf, NULL); hdev = hub->hdev; @@ -800,9 +785,7 @@ static void hub_disconnect(struct usb_interface *intf) if (hdev->speed == USB_SPEED_HIGH) highspeed_hubs--; - /* Disconnect all children and quiesce the hub */ - hub_pre_reset(hub, 1); - + hub_quiesce(hub); usb_free_urb(hub->urb); hub->urb = NULL; @@ -822,7 +805,27 @@ static void hub_disconnect(struct usb_interface *intf) hub->buffer = NULL; } - kfree(hub); + /* If there are any children then this is an unbind only, not a + * physical disconnection. The active ports must be disabled + * and later on we must call usb_disconnect(). We can't call + * it now because we may not hold the hub's device lock. + */ + n = 0; + for (port1 = 1; port1 <= hdev->maxchild; ++port1) { + if (hdev->children[port1 - 1]) { + ++n; + hub_port_disable(hub, port1, 1); + } + } + + if (n == 0) + kfree(hub); + else { + /* Reuse the hub->leds work_struct for our own purposes */ + INIT_WORK(&hub->leds, hub_remove_children_work, hub); + schedule_work(&hub->leds); + usb_get_dev(hdev); + } } static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) @@ -919,6 +922,26 @@ hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data) } } +/* caller has locked the hub device */ +static void hub_pre_reset(struct usb_hub *hub) +{ + struct usb_device *hdev = hub->hdev; + int i; + + for (i = 0; i < hdev->maxchild; ++i) { + if (hdev->children[i]) + usb_disconnect(&hdev->children[i]); + } + hub_quiesce(hub); +} + +/* caller has locked the hub device */ +static void hub_post_reset(struct usb_hub *hub) +{ + hub_activate(hub); + hub_power_on(hub); +} + /* grab device/port lock, returning index of that port (zero based). * protects the upstream link used by this device from concurrent @@ -946,21 +969,24 @@ static int locktree(struct usb_device *udev) t = locktree(hdev); if (t < 0) return t; + for (t = 0; t < hdev->maxchild; t++) { + if (hdev->children[t] == udev) { + /* everything is fail-fast once disconnect + * processing starts + */ + if (udev->state == USB_STATE_NOTATTACHED) + break; - /* everything is fail-fast once disconnect - * processing starts - */ - if (udev->state == USB_STATE_NOTATTACHED) { - usb_unlock_device(hdev); - return -ENODEV; + /* when everyone grabs locks top->bottom, + * non-overlapping work may be concurrent + */ + down(&udev->serialize); + up(&hdev->serialize); + return t + 1; + } } - - /* when everyone grabs locks top->bottom, - * non-overlapping work may be concurrent - */ - usb_lock_device(udev); usb_unlock_device(hdev); - return udev->portnum; + return -ENODEV; } static void recursively_mark_NOTATTACHED(struct usb_device *udev) @@ -1018,39 +1044,6 @@ void usb_set_device_state(struct usb_device *udev, EXPORT_SYMBOL(usb_set_device_state); -#ifdef CONFIG_PM - -/** - * usb_root_hub_lost_power - called by HCD if the root hub lost Vbus power - * @rhdev: struct usb_device for the root hub - * - * The USB host controller driver calls this function when its root hub - * is resumed and Vbus power has been interrupted or the controller - * has been reset. The routine marks all the children of the root hub - * as NOTATTACHED and marks logical connect-change events on their ports. - */ -void usb_root_hub_lost_power(struct usb_device *rhdev) -{ - struct usb_hub *hub; - int port1; - unsigned long flags; - - dev_warn(&rhdev->dev, "root hub lost power or was reset\n"); - spin_lock_irqsave(&device_state_lock, flags); - hub = hdev_to_hub(rhdev); - for (port1 = 1; port1 <= rhdev->maxchild; ++port1) { - if (rhdev->children[port1 - 1]) { - recursively_mark_NOTATTACHED( - rhdev->children[port1 - 1]); - set_bit(port1, hub->change_bits); - } - } - spin_unlock_irqrestore(&device_state_lock, flags); -} -EXPORT_SYMBOL_GPL(usb_root_hub_lost_power); - -#endif - static void choose_address(struct usb_device *udev) { int devnum; @@ -1111,9 +1104,15 @@ void usb_disconnect(struct usb_device **pdev) * this quiesces everyting except pending urbs. */ usb_set_device_state(udev, USB_STATE_NOTATTACHED); - dev_info (&udev->dev, "USB disconnect, address %d\n", udev->devnum); - usb_lock_device(udev); + /* lock the bus list on behalf of HCDs unregistering their root hubs */ + if (!udev->parent) { + down(&usb_bus_list_lock); + usb_lock_device(udev); + } else + down(&udev->serialize); + + dev_info (&udev->dev, "USB disconnect, address %d\n", udev->devnum); /* Free up all the children before we remove this device */ for (i = 0; i < USB_MAXCHILDREN; i++) { @@ -1142,112 +1141,54 @@ void usb_disconnect(struct usb_device **pdev) *pdev = NULL; spin_unlock_irq(&device_state_lock); - usb_unlock_device(udev); + if (!udev->parent) { + usb_unlock_device(udev); + up(&usb_bus_list_lock); + } else + up(&udev->serialize); device_unregister(&udev->dev); } -static inline const char *plural(int n) -{ - return (n == 1 ? "" : "s"); -} - static int choose_configuration(struct usb_device *udev) { - int i; - u16 devstatus; - int bus_powered; - int num_configs; - struct usb_host_config *c, *best; - - /* If this fails, assume the device is bus-powered */ - devstatus = 0; - usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); - le16_to_cpus(&devstatus); - bus_powered = ((devstatus & (1 << USB_DEVICE_SELF_POWERED)) == 0); - dev_dbg(&udev->dev, "device is %s-powered\n", - bus_powered ? "bus" : "self"); - - best = NULL; - c = udev->config; - num_configs = udev->descriptor.bNumConfigurations; - for (i = 0; i < num_configs; (i++, c++)) { - struct usb_interface_descriptor *desc = - &c->intf_cache[0]->altsetting->desc; - - /* - * HP's USB bus-powered keyboard has only one configuration - * and it claims to be self-powered; other devices may have - * similar errors in their descriptors. If the next test - * were allowed to execute, such configurations would always - * be rejected and the devices would not work as expected. - */ -#if 0 - /* Rule out self-powered configs for a bus-powered device */ - if (bus_powered && (c->desc.bmAttributes & - USB_CONFIG_ATT_SELFPOWER)) - continue; -#endif - - /* - * The next test may not be as effective as it should be. - * Some hubs have errors in their descriptor, claiming - * to be self-powered when they are really bus-powered. - * We will overestimate the amount of current such hubs - * make available for each port. - * - * This is a fairly benign sort of failure. It won't - * cause us to reject configurations that we should have - * accepted. - */ + int c, i; - /* Rule out configs that draw too much bus current */ - if (c->desc.bMaxPower * 2 > udev->bus_mA) - continue; + /* NOTE: this should interact with hub power budgeting */ - /* If the first config's first interface is COMM/2/0xff - * (MSFT RNDIS), rule it out unless Linux has host-side - * RNDIS support. */ - if (i == 0 && desc->bInterfaceClass == USB_CLASS_COMM - && desc->bInterfaceSubClass == 2 - && desc->bInterfaceProtocol == 0xff) { -#ifndef CONFIG_USB_NET_RNDIS - continue; -#else - best = c; -#endif - } + c = udev->config[0].desc.bConfigurationValue; + if (udev->descriptor.bNumConfigurations != 1) { + for (i = 0; i < udev->descriptor.bNumConfigurations; i++) { + struct usb_interface_descriptor *desc; - /* From the remaining configs, choose the first one whose - * first interface is for a non-vendor-specific class. - * Reason: Linux is more likely to have a class driver - * than a vendor-specific driver. */ - else if (udev->descriptor.bDeviceClass != - USB_CLASS_VENDOR_SPEC && - desc->bInterfaceClass != - USB_CLASS_VENDOR_SPEC) { - best = c; + /* heuristic: Linux is more likely to have class + * drivers, so avoid vendor-specific interfaces. + */ + desc = &udev->config[i].intf_cache[0] + ->altsetting->desc; + if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) + continue; + /* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS. + * MSFT needs this to be the first config; never use + * it as the default unless Linux has host-side RNDIS. + * A second config would ideally be CDC-Ethernet, but + * may instead be the "vendor specific" CDC subset + * long used by ARM Linux for sa1100 or pxa255. + */ + if (desc->bInterfaceClass == USB_CLASS_COMM + && desc->bInterfaceSubClass == 2 + && desc->bInterfaceProtocol == 0xff) { + c = udev->config[1].desc.bConfigurationValue; + continue; + } + c = udev->config[i].desc.bConfigurationValue; break; } - - /* If all the remaining configs are vendor-specific, - * choose the first one. */ - else if (!best) - best = c; - } - - if (best) { - i = best->desc.bConfigurationValue; dev_info(&udev->dev, - "configuration #%d chosen from %d choice%s\n", - i, num_configs, plural(num_configs)); - } else { - i = -1; - dev_warn(&udev->dev, - "no configuration chosen from %d choice%s\n", - num_configs, plural(num_configs)); + "configuration #%d chosen from %d choices\n", + c, udev->descriptor.bNumConfigurations); } - return i; + return c; } #ifdef DEBUG @@ -1274,8 +1215,8 @@ static inline void show_string(struct usb_device *udev, char *id, char *string) * * This is called with devices which have been enumerated, but not yet * configured. The device descriptor is available, but not descriptors - * for any device configuration. The caller must have locked either - * the parent hub (if udev is a normal device) or else the + * for any device configuration. The caller must have locked udev and + * either the parent hub (if udev is a normal device) or else the * usb_bus_list_lock (if udev is a root hub). The parent's pointer to * udev has already been installed, but udev is not yet visible through * sysfs or other filesystem code. @@ -1285,7 +1226,8 @@ static inline void show_string(struct usb_device *udev, char *id, char *string) * * This call is synchronous, and may not be used in an interrupt context. * - * Only the hub driver or root-hub registrar should ever call this. + * Only the hub driver should ever call this; root hub registration + * uses it indirectly. */ int usb_new_device(struct usb_device *udev) { @@ -1332,9 +1274,15 @@ int usb_new_device(struct usb_device *udev) le16_to_cpu(udev->config[0].desc.wTotalLength), USB_DT_OTG, (void **) &desc) == 0) { if (desc->bmAttributes & USB_OTG_HNP) { - unsigned port1 = udev->portnum; + unsigned port1; struct usb_device *root = udev->parent; + for (port1 = 1; port1 <= root->maxchild; + port1++) { + if (root->children[port1-1] == udev) + break; + } + dev_info(&udev->dev, "Dual-Role OTG device on %sHNP port\n", (port1 == bus->otg_port) @@ -1388,27 +1336,27 @@ int usb_new_device(struct usb_device *udev) } usb_create_sysfs_dev_files (udev); - usb_lock_device(udev); - /* choose and set the configuration. that registers the interfaces * with the driver core, and lets usb device drivers bind to them. */ c = choose_configuration(udev); - if (c >= 0) { + if (c < 0) + dev_warn(&udev->dev, + "can't choose an initial configuration\n"); + else { err = usb_set_configuration(udev, c); if (err) { dev_err(&udev->dev, "can't set config #%d, error %d\n", c, err); - /* This need not be fatal. The user can try to - * set other configurations. */ + usb_remove_sysfs_dev_files(udev); + device_del(&udev->dev); + goto fail; } } /* USB device state == configured ... usable */ usb_notify_add_device(udev); - usb_unlock_device(udev); - return 0; fail: @@ -1711,15 +1659,22 @@ static int __usb_suspend_device (struct usb_device *udev, int port1) int usb_suspend_device(struct usb_device *udev) { #ifdef CONFIG_USB_SUSPEND - if (udev->state == USB_STATE_NOTATTACHED) - return -ENODEV; - return __usb_suspend_device(udev, udev->portnum); + int port1, status; + + port1 = locktree(udev); + if (port1 < 0) + return port1; + + status = __usb_suspend_device(udev, port1); + usb_unlock_device(udev); + return status; #else /* NOTE: udev->state unchanged, it's not lying ... */ udev->dev.power.power_state = PMSG_SUSPEND; return 0; #endif } +EXPORT_SYMBOL_GPL(usb_suspend_device); /* * If the USB "suspend" state is in use (rather than "global suspend"), @@ -1745,14 +1700,13 @@ static int finish_device_resume(struct usb_device *udev) usb_set_device_state(udev, udev->actconfig ? USB_STATE_CONFIGURED : USB_STATE_ADDRESS); - udev->dev.power.power_state = PMSG_ON; /* 10.5.4.5 says be sure devices in the tree are still there. * For now let's assume the device didn't go crazy on resume, * and device drivers will know about any resume quirks. */ status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); - if (status < 2) + if (status < 0) dev_dbg(&udev->dev, "gone after usb resume? status %d\n", status); @@ -1761,7 +1715,7 @@ static int finish_device_resume(struct usb_device *udev) int (*resume)(struct device *); le16_to_cpus(&devstatus); - if ((devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) + if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP) && udev->parent) { status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), @@ -1781,14 +1735,8 @@ static int finish_device_resume(struct usb_device *udev) * may have a child resume event to deal with soon */ resume = udev->dev.bus->resume; - for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { - struct device *dev = - &udev->actconfig->interface[i]->dev; - - down(&dev->sem); - (void) resume(dev); - up(&dev->sem); - } + for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) + (void) resume(&udev->actconfig->interface[i]->dev); status = 0; } else if (udev->devnum <= 0) { @@ -1871,10 +1819,11 @@ hub_port_resume(struct usb_hub *hub, int port1, struct usb_device *udev) */ int usb_resume_device(struct usb_device *udev) { - int status; + int port1, status; - if (udev->state == USB_STATE_NOTATTACHED) - return -ENODEV; + port1 = locktree(udev); + if (port1 < 0) + return port1; #ifdef CONFIG_USB_SUSPEND /* selective resume of one downstream hub-to-device port */ @@ -1883,7 +1832,7 @@ int usb_resume_device(struct usb_device *udev) // NOTE swsusp may bork us, device state being wrong... // NOTE this fails if parent is also suspended... status = hub_port_resume(hdev_to_hub(udev->parent), - udev->portnum, udev); + port1, udev); } else status = 0; } else @@ -1893,11 +1842,13 @@ int usb_resume_device(struct usb_device *udev) dev_dbg(&udev->dev, "can't resume, status %d\n", status); + usb_unlock_device(udev); + /* rebind drivers that had no suspend() */ if (status == 0) { - usb_unlock_device(udev); + usb_lock_all_devices(); bus_rescan_devices(&usb_bus_type); - usb_lock_device(udev); + usb_unlock_all_devices(); } return status; } @@ -1911,14 +1862,14 @@ static int remote_wakeup(struct usb_device *udev) /* don't repeat RESUME sequence if this device * was already woken up by some other task */ - usb_lock_device(udev); + down(&udev->serialize); if (udev->state == USB_STATE_SUSPENDED) { dev_dbg(&udev->dev, "RESUME (wakeup)\n"); /* TRSMRCY = 10 msec */ msleep(10); status = finish_device_resume(udev); } - usb_unlock_device(udev); + up(&udev->serialize); #endif return status; } @@ -2019,7 +1970,7 @@ static int hub_resume(struct usb_interface *intf) if (!udev || status < 0) continue; - usb_lock_device(udev); + down (&udev->serialize); if (portstat & USB_PORT_STAT_SUSPEND) status = hub_port_resume(hub, port1, udev); else { @@ -2030,7 +1981,7 @@ static int hub_resume(struct usb_interface *intf) hub_port_logical_disconnect(hub, port1); } } - usb_unlock_device(udev); + up(&udev->serialize); } } #endif @@ -2414,36 +2365,39 @@ hub_power_remaining (struct usb_hub *hub) { struct usb_device *hdev = hub->hdev; int remaining; - int port1; + unsigned i; - if (!hub->limited_power) + remaining = hub->power_budget; + if (!remaining) /* self-powered */ return 0; - remaining = hdev->bus_mA - hub->descriptor->bHubContrCurrent; - for (port1 = 1; port1 <= hdev->maxchild; ++port1) { - struct usb_device *udev = hdev->children[port1 - 1]; - int delta; + for (i = 0; i < hdev->maxchild; i++) { + struct usb_device *udev = hdev->children[i]; + int delta, ceiling; if (!udev) continue; - /* Unconfigured devices may not use more than 100mA, - * or 8mA for OTG ports */ + /* 100mA per-port ceiling, or 8mA for OTG ports */ + if (i != (udev->bus->otg_port - 1) || hdev->parent) + ceiling = 50; + else + ceiling = 4; + if (udev->actconfig) - delta = udev->actconfig->desc.bMaxPower * 2; - else if (port1 != udev->bus->otg_port || hdev->parent) - delta = 100; + delta = udev->actconfig->desc.bMaxPower; else - delta = 8; - if (delta > hub->mA_per_port) - dev_warn(&udev->dev, "%dmA is over %umA budget " - "for port %d!\n", - delta, hub->mA_per_port, port1); + delta = ceiling; + // dev_dbg(&udev->dev, "budgeted %dmA\n", 2 * delta); + if (delta > ceiling) + dev_warn(&udev->dev, "%dmA over %dmA budget!\n", + 2 * (delta - ceiling), 2 * ceiling); remaining -= delta; } if (remaining < 0) { - dev_warn(hub->intfdev, "%dmA over power budget!\n", - - remaining); + dev_warn(hub->intfdev, + "%dmA over power budget!\n", + -2 * remaining); remaining = 0; } return remaining; @@ -2538,8 +2492,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, usb_set_device_state(udev, USB_STATE_POWERED); udev->speed = USB_SPEED_UNKNOWN; - udev->bus_mA = hub->mA_per_port; - + /* set the address */ choose_address(udev); if (udev->devnum <= 0) { @@ -2559,16 +2512,16 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, * on the parent. */ if (udev->descriptor.bDeviceClass == USB_CLASS_HUB - && udev->bus_mA <= 100) { + && hub->power_budget) { u16 devstat; status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstat); - if (status < 2) { + if (status < 0) { dev_dbg(&udev->dev, "get status %d ?\n", status); goto loop_disable; } - le16_to_cpus(&devstat); + cpu_to_le16s(&devstat); if ((devstat & (1 << USB_DEVICE_SELF_POWERED)) == 0) { dev_err(&udev->dev, "can't connect bus-powered hub " @@ -2593,6 +2546,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, * udev becomes globally accessible, although presumably * no one will look at it until hdev is unlocked. */ + down (&udev->serialize); status = 0; /* We mustn't add new devices if the parent hub has @@ -2616,12 +2570,15 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, } } + up (&udev->serialize); if (status) goto loop_disable; status = hub_power_remaining(hub); if (status) - dev_dbg(hub_dev, "%dmA power budget left\n", status); + dev_dbg(hub_dev, + "%dmA power budget left\n", + 2 * status); return; @@ -2697,8 +2654,6 @@ static void hub_events(void) if (i) { dpm_runtime_resume(&hdev->dev); dpm_runtime_resume(&intf->dev); - usb_put_intf(intf); - continue; } /* Lock the device, then check to see if we were @@ -2712,7 +2667,7 @@ static void hub_events(void) /* If the hub has died, clean up after it */ if (hdev->state == USB_STATE_NOTATTACHED) { - hub_pre_reset(hub, 0); + hub_pre_reset(hub); goto loop; } @@ -2835,11 +2790,6 @@ static void hub_events(void) if (hubchange & HUB_CHANGE_LOCAL_POWER) { dev_dbg (hub_dev, "power change\n"); clear_hub_feature(hdev, C_HUB_LOCAL_POWER); - if (hubstatus & HUB_STATUS_LOCAL_POWER) - /* FIXME: Is this always true? */ - hub->limited_power = 0; - else - hub->limited_power = 1; } if (hubchange & HUB_CHANGE_OVERCURRENT) { dev_dbg (hub_dev, "overcurrent change\n"); @@ -2888,6 +2838,7 @@ static struct usb_device_id hub_id_table [] = { MODULE_DEVICE_TABLE (usb, hub_id_table); static struct usb_driver hub_driver = { + .owner = THIS_MODULE, .name = "hub", .probe = hub_probe, .disconnect = hub_disconnect, @@ -2999,8 +2950,7 @@ int usb_reset_device(struct usb_device *udev) struct usb_hub *parent_hub; struct usb_device_descriptor descriptor = udev->descriptor; struct usb_hub *hub = NULL; - int i, ret = 0; - int port1 = udev->portnum; + int i, ret = 0, port1 = -1; if (udev->state == USB_STATE_NOTATTACHED || udev->state == USB_STATE_SUSPENDED) { @@ -3014,6 +2964,18 @@ int usb_reset_device(struct usb_device *udev) dev_dbg(&udev->dev, "%s for root hub!\n", __FUNCTION__); return -EISDIR; } + + for (i = 0; i < parent_hdev->maxchild; i++) + if (parent_hdev->children[i] == udev) { + port1 = i + 1; + break; + } + + if (port1 < 0) { + /* If this ever happens, it's very bad */ + dev_err(&udev->dev, "Can't locate device's port!\n"); + return -ENOENT; + } parent_hub = hdev_to_hub(parent_hdev); /* If we're resetting an active hub, take some special actions */ @@ -3021,7 +2983,7 @@ int usb_reset_device(struct usb_device *udev) udev->actconfig->interface[0]->dev.driver == &hub_driver.driver && (hub = hdev_to_hub(udev)) != NULL) { - hub_pre_reset(hub, 0); + hub_pre_reset(hub); } set_bit(port1, parent_hub->busy_bits); diff --git a/trunk/drivers/usb/core/hub.h b/trunk/drivers/usb/core/hub.h index 29d5f45a8456..bf23f8978024 100644 --- a/trunk/drivers/usb/core/hub.h +++ b/trunk/drivers/usb/core/hub.h @@ -220,9 +220,8 @@ struct usb_hub { struct usb_hub_descriptor *descriptor; /* class descriptor */ struct usb_tt tt; /* Transaction Translator */ - unsigned mA_per_port; /* current for each child */ + u8 power_budget; /* in 2mA units; or zero */ - unsigned limited_power:1; unsigned quiescing:1; unsigned activating:1; unsigned resume_root_hub:1; diff --git a/trunk/drivers/usb/core/inode.c b/trunk/drivers/usb/core/inode.c index c44bbedec817..12f490fdee8f 100644 --- a/trunk/drivers/usb/core/inode.c +++ b/trunk/drivers/usb/core/inode.c @@ -46,6 +46,7 @@ static struct super_operations usbfs_ops; static struct file_operations default_file_operations; +static struct inode_operations usbfs_dir_inode_operations; static struct vfsmount *usbfs_mount; static int usbfs_mount_count; /* = 0 */ static int ignore_mount = 0; @@ -261,7 +262,7 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t de inode->i_fop = &default_file_operations; break; case S_IFDIR: - inode->i_op = &simple_dir_inode_operations; + inode->i_op = &usbfs_dir_inode_operations; inode->i_fop = &simple_dir_operations; /* directory inodes start off with i_nlink == 2 (for "." entry) */ @@ -416,6 +417,10 @@ static struct file_operations default_file_operations = { .llseek = default_file_lseek, }; +static struct inode_operations usbfs_dir_inode_operations = { + .lookup = simple_lookup, +}; + static struct super_operations usbfs_ops = { .statfs = simple_statfs, .drop_inode = generic_delete_inode, diff --git a/trunk/drivers/usb/core/message.c b/trunk/drivers/usb/core/message.c index 319de03944e7..644a3d4f12aa 100644 --- a/trunk/drivers/usb/core/message.c +++ b/trunk/drivers/usb/core/message.c @@ -3,6 +3,13 @@ */ #include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include /* for scatterlist macros */ #include #include @@ -1387,12 +1394,6 @@ int usb_set_configuration(struct usb_device *dev, int configuration) if (dev->state != USB_STATE_ADDRESS) usb_disable_device (dev, 1); // Skip ep0 - i = dev->bus_mA - cp->desc.bMaxPower * 2; - if (i < 0) - dev_warn(&dev->dev, "new config #%d exceeds power " - "limit by %dmA\n", - configuration, -i); - if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_CONFIGURATION, 0, configuration, 0, NULL, 0, USB_CTRL_SET_TIMEOUT)) < 0) @@ -1456,11 +1457,12 @@ int usb_set_configuration(struct usb_device *dev, int configuration) */ for (i = 0; i < nintf; ++i) { struct usb_interface *intf = cp->interface[i]; + struct usb_host_interface *alt = intf->cur_altsetting; dev_dbg (&dev->dev, "adding %s (config #%d, interface %d)\n", intf->dev.bus_id, configuration, - intf->cur_altsetting->desc.bInterfaceNumber); + alt->desc.bInterfaceNumber); ret = device_add (&intf->dev); if (ret != 0) { dev_err(&dev->dev, diff --git a/trunk/drivers/usb/core/notify.c b/trunk/drivers/usb/core/notify.c index fbbebab52fbd..37da059eced7 100644 --- a/trunk/drivers/usb/core/notify.c +++ b/trunk/drivers/usb/core/notify.c @@ -12,7 +12,13 @@ #include #include #include +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif #include + #include "usb.h" diff --git a/trunk/drivers/usb/core/sysfs.c b/trunk/drivers/usb/core/sysfs.c index 71d881327e88..edd83e014452 100644 --- a/trunk/drivers/usb/core/sysfs.c +++ b/trunk/drivers/usb/core/sysfs.c @@ -12,7 +12,14 @@ #include #include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif #include + #include "usb.h" /* endpoint stuff */ diff --git a/trunk/drivers/usb/core/urb.c b/trunk/drivers/usb/core/urb.c index 081796726b95..f2a1fed2a802 100644 --- a/trunk/drivers/usb/core/urb.c +++ b/trunk/drivers/usb/core/urb.c @@ -4,6 +4,12 @@ #include #include #include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif #include #include "hcd.h" diff --git a/trunk/drivers/usb/core/usb.c b/trunk/drivers/usb/core/usb.c index 56a3520863a9..0eefff7bcb3c 100644 --- a/trunk/drivers/usb/core/usb.c +++ b/trunk/drivers/usb/core/usb.c @@ -22,6 +22,13 @@ */ #include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include #include #include @@ -32,6 +39,7 @@ #include #include #include +#include #include #include @@ -46,7 +54,165 @@ const char *usbcore_name = "usbcore"; static int nousb; /* Disable USB when built into kernel image */ + /* Not honored on modular build */ + +static DECLARE_RWSEM(usb_all_devices_rwsem); + + +static int generic_probe (struct device *dev) +{ + return 0; +} +static int generic_remove (struct device *dev) +{ + struct usb_device *udev = to_usb_device(dev); + + /* if this is only an unbind, not a physical disconnect, then + * unconfigure the device */ + if (udev->state == USB_STATE_CONFIGURED) + usb_set_configuration(udev, 0); + + /* in case the call failed or the device was suspended */ + if (udev->state >= USB_STATE_CONFIGURED) + usb_disable_device(udev, 0); + return 0; +} + +static struct device_driver usb_generic_driver = { + .owner = THIS_MODULE, + .name = "usb", + .bus = &usb_bus_type, + .probe = generic_probe, + .remove = generic_remove, +}; + +static int usb_generic_driver_data; + +/* called from driver core with usb_bus_type.subsys writelock */ +static int usb_probe_interface(struct device *dev) +{ + struct usb_interface * intf = to_usb_interface(dev); + struct usb_driver * driver = to_usb_driver(dev->driver); + const struct usb_device_id *id; + int error = -ENODEV; + + dev_dbg(dev, "%s\n", __FUNCTION__); + + if (!driver->probe) + return error; + /* FIXME we'd much prefer to just resume it ... */ + if (interface_to_usbdev(intf)->state == USB_STATE_SUSPENDED) + return -EHOSTUNREACH; + + id = usb_match_id (intf, driver->id_table); + if (id) { + dev_dbg (dev, "%s - got id\n", __FUNCTION__); + + /* Interface "power state" doesn't correspond to any hardware + * state whatsoever. We use it to record when it's bound to + * a driver that may start I/0: it's not frozen/quiesced. + */ + mark_active(intf); + intf->condition = USB_INTERFACE_BINDING; + error = driver->probe (intf, id); + if (error) { + mark_quiesced(intf); + intf->condition = USB_INTERFACE_UNBOUND; + } else + intf->condition = USB_INTERFACE_BOUND; + } + + return error; +} + +/* called from driver core with usb_bus_type.subsys writelock */ +static int usb_unbind_interface(struct device *dev) +{ + struct usb_interface *intf = to_usb_interface(dev); + struct usb_driver *driver = to_usb_driver(intf->dev.driver); + + intf->condition = USB_INTERFACE_UNBINDING; + + /* release all urbs for this interface */ + usb_disable_interface(interface_to_usbdev(intf), intf); + + if (driver && driver->disconnect) + driver->disconnect(intf); + + /* reset other interface state */ + usb_set_interface(interface_to_usbdev(intf), + intf->altsetting[0].desc.bInterfaceNumber, + 0); + usb_set_intfdata(intf, NULL); + intf->condition = USB_INTERFACE_UNBOUND; + mark_quiesced(intf); + + return 0; +} + +/** + * usb_register - register a USB driver + * @new_driver: USB operations for the driver + * + * Registers a USB driver with the USB core. The list of unattached + * interfaces will be rescanned whenever a new driver is added, allowing + * the new driver to attach to any recognized devices. + * Returns a negative error code on failure and 0 on success. + * + * NOTE: if you want your driver to use the USB major number, you must call + * usb_register_dev() to enable that functionality. This function no longer + * takes care of that. + */ +int usb_register(struct usb_driver *new_driver) +{ + int retval = 0; + if (nousb) + return -ENODEV; + + new_driver->driver.name = (char *)new_driver->name; + new_driver->driver.bus = &usb_bus_type; + new_driver->driver.probe = usb_probe_interface; + new_driver->driver.remove = usb_unbind_interface; + new_driver->driver.owner = new_driver->owner; + + usb_lock_all_devices(); + retval = driver_register(&new_driver->driver); + usb_unlock_all_devices(); + + if (!retval) { + pr_info("%s: registered new driver %s\n", + usbcore_name, new_driver->name); + usbfs_update_special(); + } else { + printk(KERN_ERR "%s: error %d registering driver %s\n", + usbcore_name, retval, new_driver->name); + } + + return retval; +} + +/** + * usb_deregister - unregister a USB driver + * @driver: USB operations of the driver to unregister + * Context: must be able to sleep + * + * Unlinks the specified driver from the internal USB driver list. + * + * NOTE: If you called usb_register_dev(), you still need to call + * usb_deregister_dev() to clean up your driver's allocated minor numbers, + * this * call will no longer do it for you. + */ +void usb_deregister(struct usb_driver *driver) +{ + pr_info("%s: deregistering driver %s\n", usbcore_name, driver->name); + + usb_lock_all_devices(); + driver_unregister (&driver->driver); + usb_unlock_all_devices(); + + usbfs_update_special(); +} /** * usb_ifnum_to_if - get the interface object with a given interface number @@ -192,23 +358,152 @@ void usb_driver_release_interface(struct usb_driver *driver, iface->condition = USB_INTERFACE_UNBOUND; mark_quiesced(iface); } -struct find_interface_arg { - int minor; - struct usb_interface *interface; -}; + +/** + * usb_match_id - find first usb_device_id matching device or interface + * @interface: the interface of interest + * @id: array of usb_device_id structures, terminated by zero entry + * + * usb_match_id searches an array of usb_device_id's and returns + * the first one matching the device or interface, or null. + * This is used when binding (or rebinding) a driver to an interface. + * Most USB device drivers will use this indirectly, through the usb core, + * but some layered driver frameworks use it directly. + * These device tables are exported with MODULE_DEVICE_TABLE, through + * modutils and "modules.usbmap", to support the driver loading + * functionality of USB hotplugging. + * + * What Matches: + * + * The "match_flags" element in a usb_device_id controls which + * members are used. If the corresponding bit is set, the + * value in the device_id must match its corresponding member + * in the device or interface descriptor, or else the device_id + * does not match. + * + * "driver_info" is normally used only by device drivers, + * but you can create a wildcard "matches anything" usb_device_id + * as a driver's "modules.usbmap" entry if you provide an id with + * only a nonzero "driver_info" field. If you do this, the USB device + * driver's probe() routine should use additional intelligence to + * decide whether to bind to the specified interface. + * + * What Makes Good usb_device_id Tables: + * + * The match algorithm is very simple, so that intelligence in + * driver selection must come from smart driver id records. + * Unless you have good reasons to use another selection policy, + * provide match elements only in related groups, and order match + * specifiers from specific to general. Use the macros provided + * for that purpose if you can. + * + * The most specific match specifiers use device descriptor + * data. These are commonly used with product-specific matches; + * the USB_DEVICE macro lets you provide vendor and product IDs, + * and you can also match against ranges of product revisions. + * These are widely used for devices with application or vendor + * specific bDeviceClass values. + * + * Matches based on device class/subclass/protocol specifications + * are slightly more general; use the USB_DEVICE_INFO macro, or + * its siblings. These are used with single-function devices + * where bDeviceClass doesn't specify that each interface has + * its own class. + * + * Matches based on interface class/subclass/protocol are the + * most general; they let drivers bind to any interface on a + * multiple-function device. Use the USB_INTERFACE_INFO + * macro, or its siblings, to match class-per-interface style + * devices (as recorded in bDeviceClass). + * + * Within those groups, remember that not all combinations are + * meaningful. For example, don't give a product version range + * without vendor and product IDs; or specify a protocol without + * its associated class and subclass. + */ +const struct usb_device_id * +usb_match_id(struct usb_interface *interface, const struct usb_device_id *id) +{ + struct usb_host_interface *intf; + struct usb_device *dev; + + /* proc_connectinfo in devio.c may call us with id == NULL. */ + if (id == NULL) + return NULL; + + intf = interface->cur_altsetting; + dev = interface_to_usbdev(interface); + + /* It is important to check that id->driver_info is nonzero, + since an entry that is all zeroes except for a nonzero + id->driver_info is the way to create an entry that + indicates that the driver want to examine every + device and interface. */ + for (; id->idVendor || id->bDeviceClass || id->bInterfaceClass || + id->driver_info; id++) { + + if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) && + id->idVendor != le16_to_cpu(dev->descriptor.idVendor)) + continue; + + if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) && + id->idProduct != le16_to_cpu(dev->descriptor.idProduct)) + continue; + + /* No need to test id->bcdDevice_lo != 0, since 0 is never + greater than any unsigned number. */ + if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) && + (id->bcdDevice_lo > le16_to_cpu(dev->descriptor.bcdDevice))) + continue; + + if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) && + (id->bcdDevice_hi < le16_to_cpu(dev->descriptor.bcdDevice))) + continue; + + if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) && + (id->bDeviceClass != dev->descriptor.bDeviceClass)) + continue; + + if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) && + (id->bDeviceSubClass!= dev->descriptor.bDeviceSubClass)) + continue; + + if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) && + (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol)) + continue; + + if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) && + (id->bInterfaceClass != intf->desc.bInterfaceClass)) + continue; + + if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) && + (id->bInterfaceSubClass != intf->desc.bInterfaceSubClass)) + continue; + + if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) && + (id->bInterfaceProtocol != intf->desc.bInterfaceProtocol)) + continue; + + return id; + } + + return NULL; +} + static int __find_interface(struct device * dev, void * data) { - struct find_interface_arg *arg = data; - struct usb_interface *intf; + struct usb_interface ** ret = (struct usb_interface **)data; + struct usb_interface * intf = *ret; + int *minor = (int *)data; /* can't look at usb devices, only interfaces */ if (dev->driver == &usb_generic_driver) return 0; intf = to_usb_interface(dev); - if (intf->minor != -1 && intf->minor == arg->minor) { - arg->interface = intf; + if (intf->minor != -1 && intf->minor == *minor) { + *ret = intf; return 1; } return 0; @@ -225,14 +520,35 @@ static int __find_interface(struct device * dev, void * data) */ struct usb_interface *usb_find_interface(struct usb_driver *drv, int minor) { - struct find_interface_arg argb; + struct usb_interface *intf = (struct usb_interface *)(long)minor; + int ret; + + ret = driver_for_each_device(&drv->driver, NULL, &intf, __find_interface); + + return ret ? intf : NULL; +} + +static int usb_device_match (struct device *dev, struct device_driver *drv) +{ + struct usb_interface *intf; + struct usb_driver *usb_drv; + const struct usb_device_id *id; + + /* check for generic driver, which we don't match any device with */ + if (drv == &usb_generic_driver) + return 0; + + intf = to_usb_interface(dev); + usb_drv = to_usb_driver(drv); + + id = usb_match_id (intf, usb_drv->id_table); + if (id) + return 1; - argb.minor = minor; - argb.interface = NULL; - driver_for_each_device(&drv->driver, NULL, &argb, __find_interface); - return argb.interface; + return 0; } + #ifdef CONFIG_HOTPLUG /* @@ -441,11 +757,12 @@ usb_alloc_dev(struct usb_device *parent, struct usb_bus *bus, unsigned port1) /* hub driver sets up TT records */ } - dev->portnum = port1; dev->bus = bus; dev->parent = parent; INIT_LIST_HEAD(&dev->filelist); + init_MUTEX(&dev->serialize); + return dev; } @@ -518,20 +835,75 @@ void usb_put_intf(struct usb_interface *intf) /* USB device locking * - * USB devices and interfaces are locked using the semaphore in their - * embedded struct device. The hub driver guarantees that whenever a - * device is connected or disconnected, drivers are called with the - * USB device locked as well as their particular interface. + * Although locking USB devices should be straightforward, it is + * complicated by the way the driver-model core works. When a new USB + * driver is registered or unregistered, the core will automatically + * probe or disconnect all matching interfaces on all USB devices while + * holding the USB subsystem writelock. There's no good way for us to + * tell which devices will be used or to lock them beforehand; our only + * option is to effectively lock all the USB devices. + * + * We do that by using a private rw-semaphore, usb_all_devices_rwsem. + * When locking an individual device you must first acquire the rwsem's + * readlock. When a driver is registered or unregistered the writelock + * must be held. These actions are encapsulated in the subroutines + * below, so all a driver needs to do is call usb_lock_device() and + * usb_unlock_device(). * * Complications arise when several devices are to be locked at the same * time. Only hub-aware drivers that are part of usbcore ever have to - * do this; nobody else needs to worry about it. The rule for locking - * is simple: + * do this; nobody else needs to worry about it. The problem is that + * usb_lock_device() must not be called to lock a second device since it + * would acquire the rwsem's readlock reentrantly, leading to deadlock if + * another thread was waiting for the writelock. The solution is simple: + * + * When locking more than one device, call usb_lock_device() + * to lock the first one. Lock the others by calling + * down(&udev->serialize) directly. + * + * When unlocking multiple devices, use up(&udev->serialize) + * to unlock all but the last one. Unlock the last one by + * calling usb_unlock_device(). * * When locking both a device and its parent, always lock the * the parent first. */ +/** + * usb_lock_device - acquire the lock for a usb device structure + * @udev: device that's being locked + * + * Use this routine when you don't hold any other device locks; + * to acquire nested inner locks call down(&udev->serialize) directly. + * This is necessary for proper interaction with usb_lock_all_devices(). + */ +void usb_lock_device(struct usb_device *udev) +{ + down_read(&usb_all_devices_rwsem); + down(&udev->serialize); +} + +/** + * usb_trylock_device - attempt to acquire the lock for a usb device structure + * @udev: device that's being locked + * + * Don't use this routine if you already hold a device lock; + * use down_trylock(&udev->serialize) instead. + * This is necessary for proper interaction with usb_lock_all_devices(). + * + * Returns 1 if successful, 0 if contention. + */ +int usb_trylock_device(struct usb_device *udev) +{ + if (!down_read_trylock(&usb_all_devices_rwsem)) + return 0; + if (down_trylock(&udev->serialize)) { + up_read(&usb_all_devices_rwsem); + return 0; + } + return 1; +} + /** * usb_lock_device_for_reset - cautiously acquire the lock for a * usb device structure @@ -570,7 +942,7 @@ int usb_lock_device_for_reset(struct usb_device *udev, } } - while (usb_trylock_device(udev) != 0) { + while (!usb_trylock_device(udev)) { /* If we can't acquire the lock after waiting one second, * we're probably deadlocked */ @@ -588,6 +960,39 @@ int usb_lock_device_for_reset(struct usb_device *udev, return 1; } +/** + * usb_unlock_device - release the lock for a usb device structure + * @udev: device that's being unlocked + * + * Use this routine when releasing the only device lock you hold; + * to release inner nested locks call up(&udev->serialize) directly. + * This is necessary for proper interaction with usb_lock_all_devices(). + */ +void usb_unlock_device(struct usb_device *udev) +{ + up(&udev->serialize); + up_read(&usb_all_devices_rwsem); +} + +/** + * usb_lock_all_devices - acquire the lock for all usb device structures + * + * This is necessary when registering a new driver or probing a bus, + * since the driver-model core may try to use any usb_device. + */ +void usb_lock_all_devices(void) +{ + down_write(&usb_all_devices_rwsem); +} + +/** + * usb_unlock_all_devices - release the lock for all usb device structures + */ +void usb_unlock_all_devices(void) +{ + up_write(&usb_all_devices_rwsem); +} + static struct usb_device *match_device(struct usb_device *dev, u16 vendor_id, u16 product_id) @@ -610,10 +1015,10 @@ static struct usb_device *match_device(struct usb_device *dev, /* look through all of the children of this device */ for (child = 0; child < dev->maxchild; ++child) { if (dev->children[child]) { - usb_lock_device(dev->children[child]); + down(&dev->children[child]->serialize); ret_dev = match_device(dev->children[child], vendor_id, product_id); - usb_unlock_device(dev->children[child]); + up(&dev->children[child]->serialize); if (ret_dev) goto exit; } @@ -1034,8 +1439,7 @@ static int usb_generic_suspend(struct device *dev, pm_message_t message) mark_quiesced(intf); } else { // FIXME else if there's no suspend method, disconnect... - dev_warn(dev, "no suspend for driver %s?\n", driver->name); - mark_quiesced(intf); + dev_warn(dev, "no %s?\n", "suspend"); status = 0; } return status; @@ -1063,10 +1467,8 @@ static int usb_generic_resume(struct device *dev) } if ((dev->driver == NULL) || - (dev->driver_data == &usb_generic_driver_data)) { - dev->power.power_state.event = PM_EVENT_FREEZE; + (dev->driver_data == &usb_generic_driver_data)) return 0; - } intf = to_usb_interface(dev); driver = to_usb_driver(dev->driver); @@ -1086,7 +1488,7 @@ static int usb_generic_resume(struct device *dev) mark_quiesced(intf); } } else - dev_warn(dev, "no resume for driver %s?\n", driver->name); + dev_warn(dev, "no %s?\n", "resume"); return 0; } @@ -1098,8 +1500,18 @@ struct bus_type usb_bus_type = { .resume = usb_generic_resume, }; +#ifndef MODULE + +static int __init usb_setup_disable(char *str) +{ + nousb = 1; + return 1; +} + /* format to disable USB on kernel command line is: nousb */ -__module_param_call("", nousb, param_set_bool, param_get_bool, &nousb, 0444); +__setup("nousb", usb_setup_disable); + +#endif /* * for external read access to @@ -1190,6 +1602,8 @@ module_exit(usb_exit); * driver modules to use. */ +EXPORT_SYMBOL(usb_register); +EXPORT_SYMBOL(usb_deregister); EXPORT_SYMBOL(usb_disabled); EXPORT_SYMBOL_GPL(usb_get_intf); @@ -1200,10 +1614,14 @@ EXPORT_SYMBOL(usb_put_dev); EXPORT_SYMBOL(usb_get_dev); EXPORT_SYMBOL(usb_hub_tt_clear_buffer); +EXPORT_SYMBOL(usb_lock_device); +EXPORT_SYMBOL(usb_trylock_device); EXPORT_SYMBOL(usb_lock_device_for_reset); +EXPORT_SYMBOL(usb_unlock_device); EXPORT_SYMBOL(usb_driver_claim_interface); EXPORT_SYMBOL(usb_driver_release_interface); +EXPORT_SYMBOL(usb_match_id); EXPORT_SYMBOL(usb_find_interface); EXPORT_SYMBOL(usb_ifnum_to_if); EXPORT_SYMBOL(usb_altnum_to_altsetting); diff --git a/trunk/drivers/usb/core/usb.h b/trunk/drivers/usb/core/usb.h index 4647e1ebc68d..1c4a68499dce 100644 --- a/trunk/drivers/usb/core/usb.h +++ b/trunk/drivers/usb/core/usb.h @@ -16,6 +16,9 @@ extern int usb_get_device_descriptor(struct usb_device *dev, extern char *usb_cache_string(struct usb_device *udev, int index); extern int usb_set_configuration(struct usb_device *dev, int configuration); +extern void usb_lock_all_devices(void); +extern void usb_unlock_all_devices(void); + extern void usb_kick_khubd(struct usb_device *dev); extern void usb_suspend_root_hub(struct usb_device *hdev); extern void usb_resume_root_hub(struct usb_device *dev); @@ -30,9 +33,6 @@ extern void usb_host_cleanup(void); extern int usb_suspend_device(struct usb_device *dev); extern int usb_resume_device(struct usb_device *dev); -extern struct device_driver usb_generic_driver; -extern int usb_generic_driver_data; -extern int usb_device_match(struct device *dev, struct device_driver *drv); /* Interfaces and their "power state" are owned by usbcore */ diff --git a/trunk/drivers/usb/gadget/dummy_hcd.c b/trunk/drivers/usb/gadget/dummy_hcd.c index 9734cb76dd6c..1e407745c115 100644 --- a/trunk/drivers/usb/gadget/dummy_hcd.c +++ b/trunk/drivers/usb/gadget/dummy_hcd.c @@ -138,7 +138,7 @@ static const char *const ep_name [] = { /* or like sa1100: two fixed function endpoints */ "ep1out-bulk", "ep2in-bulk", }; -#define DUMMY_ENDPOINTS ARRAY_SIZE(ep_name) +#define DUMMY_ENDPOINTS (sizeof(ep_name)/sizeof(char *)) /*-------------------------------------------------------------------------*/ @@ -896,7 +896,7 @@ dummy_gadget_release (struct device *dev) #endif } -static int dummy_udc_probe (struct platform_device *pdev) +static int dummy_udc_probe (struct platform_device *dev) { struct dummy *dum = the_controller; int rc; @@ -909,7 +909,7 @@ static int dummy_udc_probe (struct platform_device *pdev) dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0); strcpy (dum->gadget.dev.bus_id, "gadget"); - dum->gadget.dev.parent = &pdev->dev; + dum->gadget.dev.parent = &dev->dev; dum->gadget.dev.release = dummy_gadget_release; rc = device_register (&dum->gadget.dev); if (rc < 0) @@ -919,47 +919,47 @@ static int dummy_udc_probe (struct platform_device *pdev) usb_bus_get (&dummy_to_hcd (dum)->self); #endif - platform_set_drvdata (pdev, dum); + platform_set_drvdata (dev, dum); device_create_file (&dum->gadget.dev, &dev_attr_function); return rc; } -static int dummy_udc_remove (struct platform_device *pdev) +static int dummy_udc_remove (struct platform_device *dev) { - struct dummy *dum = platform_get_drvdata (pdev); + struct dummy *dum = platform_get_drvdata (dev); - platform_set_drvdata (pdev, NULL); + platform_set_drvdata (dev, NULL); device_remove_file (&dum->gadget.dev, &dev_attr_function); device_unregister (&dum->gadget.dev); return 0; } -static int dummy_udc_suspend (struct platform_device *pdev, pm_message_t state) +static int dummy_udc_suspend (struct platform_device *dev, pm_message_t state) { - struct dummy *dum = platform_get_drvdata(pdev); + struct dummy *dum = platform_get_drvdata(dev); - dev_dbg (&pdev->dev, "%s\n", __FUNCTION__); + dev_dbg (&dev->dev, "%s\n", __FUNCTION__); spin_lock_irq (&dum->lock); dum->udc_suspended = 1; set_link_state (dum); spin_unlock_irq (&dum->lock); - pdev->dev.power.power_state = state; + dev->power.power_state = state; usb_hcd_poll_rh_status (dummy_to_hcd (dum)); return 0; } -static int dummy_udc_resume (struct platform_device *pdev) +static int dummy_udc_resume (struct platform_device *dev) { - struct dummy *dum = platform_get_drvdata(pdev); + struct dummy *dum = platform_get_drvdata(dev); - dev_dbg (&pdev->dev, "%s\n", __FUNCTION__); + dev_dbg (&dev->dev, "%s\n", __FUNCTION__); spin_lock_irq (&dum->lock); dum->udc_suspended = 0; set_link_state (dum); spin_unlock_irq (&dum->lock); - pdev->dev.power.power_state = PMSG_ON; + dev->dev.power.power_state = PMSG_ON; usb_hcd_poll_rh_status (dummy_to_hcd (dum)); return 0; } @@ -1576,7 +1576,7 @@ static int dummy_hub_status (struct usb_hcd *hcd, char *buf) dum = hcd_to_dummy (hcd); spin_lock_irqsave (&dum->lock, flags); - if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) + if (hcd->state != HC_STATE_RUNNING) goto done; if (dum->resuming && time_after_eq (jiffies, dum->re_timeout)) { @@ -1623,7 +1623,7 @@ static int dummy_hub_control ( int retval = 0; unsigned long flags; - if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) + if (hcd->state != HC_STATE_RUNNING) return -ETIMEDOUT; dum = hcd_to_dummy (hcd); @@ -1756,12 +1756,9 @@ static int dummy_bus_suspend (struct usb_hcd *hcd) { struct dummy *dum = hcd_to_dummy (hcd); - dev_dbg (&hcd->self.root_hub->dev, "%s\n", __FUNCTION__); - spin_lock_irq (&dum->lock); dum->rh_state = DUMMY_RH_SUSPENDED; set_link_state (dum); - hcd->state = HC_STATE_SUSPENDED; spin_unlock_irq (&dum->lock); return 0; } @@ -1769,23 +1766,14 @@ static int dummy_bus_suspend (struct usb_hcd *hcd) static int dummy_bus_resume (struct usb_hcd *hcd) { struct dummy *dum = hcd_to_dummy (hcd); - int rc = 0; - - dev_dbg (&hcd->self.root_hub->dev, "%s\n", __FUNCTION__); spin_lock_irq (&dum->lock); - if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) { - dev_warn (&hcd->self.root_hub->dev, "HC isn't running!\n"); - rc = -ENODEV; - } else { - dum->rh_state = DUMMY_RH_RUNNING; - set_link_state (dum); - if (!list_empty(&dum->urbp_list)) - mod_timer (&dum->timer, jiffies); - hcd->state = HC_STATE_RUNNING; - } + dum->rh_state = DUMMY_RH_RUNNING; + set_link_state (dum); + if (!list_empty(&dum->urbp_list)) + mod_timer (&dum->timer, jiffies); spin_unlock_irq (&dum->lock); - return rc; + return 0; } /*-------------------------------------------------------------------------*/ @@ -1911,14 +1899,14 @@ static const struct hc_driver dummy_hcd = { .bus_resume = dummy_bus_resume, }; -static int dummy_hcd_probe(struct platform_device *pdev) +static int dummy_hcd_probe (struct platform_device *dev) { struct usb_hcd *hcd; int retval; - dev_info(&pdev->dev, "%s, driver " DRIVER_VERSION "\n", driver_desc); + dev_info (dev, "%s, driver " DRIVER_VERSION "\n", driver_desc); - hcd = usb_create_hcd(&dummy_hcd, &pdev->dev, pdev->dev.bus_id); + hcd = usb_create_hcd (&dummy_hcd, &dev->dev, dev->dev.bus_id); if (!hcd) return -ENOMEM; the_controller = hcd_to_dummy (hcd); @@ -1931,43 +1919,36 @@ static int dummy_hcd_probe(struct platform_device *pdev) return retval; } -static int dummy_hcd_remove (struct platform_device *pdev) +static int dummy_hcd_remove (struct platform_device *dev) { struct usb_hcd *hcd; - hcd = platform_get_drvdata (pdev); + hcd = platform_get_drvdata (dev); usb_remove_hcd (hcd); usb_put_hcd (hcd); the_controller = NULL; return 0; } -static int dummy_hcd_suspend (struct platform_device *pdev, pm_message_t state) +static int dummy_hcd_suspend (struct platform_device *dev, pm_message_t state) { struct usb_hcd *hcd; - struct dummy *dum; - int rc = 0; - dev_dbg (&pdev->dev, "%s\n", __FUNCTION__); + dev_dbg (&dev->dev, "%s\n", __FUNCTION__); + hcd = platform_get_drvdata (dev); - hcd = platform_get_drvdata (pdev); - dum = hcd_to_dummy (hcd); - if (dum->rh_state == DUMMY_RH_RUNNING) { - dev_warn(&pdev->dev, "Root hub isn't suspended!\n"); - rc = -EBUSY; - } else - clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); - return rc; + hcd->state = HC_STATE_SUSPENDED; + return 0; } -static int dummy_hcd_resume (struct platform_device *pdev) +static int dummy_hcd_resume (struct platform_device *dev) { struct usb_hcd *hcd; - dev_dbg (&pdev->dev, "%s\n", __FUNCTION__); + dev_dbg (&dev->dev, "%s\n", __FUNCTION__); + hcd = platform_get_drvdata (dev); + hcd->state = HC_STATE_RUNNING; - hcd = platform_get_drvdata (pdev); - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); usb_hcd_poll_rh_status (hcd); return 0; } diff --git a/trunk/drivers/usb/gadget/file_storage.c b/trunk/drivers/usb/gadget/file_storage.c index 0cea9782d7d4..ea09aaa3cab6 100644 --- a/trunk/drivers/usb/gadget/file_storage.c +++ b/trunk/drivers/usb/gadget/file_storage.c @@ -224,7 +224,6 @@ #include #include #include -#include #include #include #include @@ -239,6 +238,7 @@ #include #include #include +#include #include #include @@ -250,7 +250,7 @@ #define DRIVER_DESC "File-backed Storage Gadget" #define DRIVER_NAME "g_file_storage" -#define DRIVER_VERSION "28 November 2005" +#define DRIVER_VERSION "20 October 2004" static const char longname[] = DRIVER_DESC; static const char shortname[] = DRIVER_NAME; @@ -335,8 +335,8 @@ MODULE_LICENSE("Dual BSD/GPL"); #define MAX_LUNS 8 /* Arggh! There should be a module_param_array_named macro! */ -static char *file[MAX_LUNS]; -static int ro[MAX_LUNS]; +static char *file[MAX_LUNS] = {NULL, }; +static int ro[MAX_LUNS] = {0, }; static struct { int num_filenames; @@ -587,7 +587,7 @@ enum fsg_buffer_state { struct fsg_buffhd { void *buf; dma_addr_t dma; - enum fsg_buffer_state state; + volatile enum fsg_buffer_state state; struct fsg_buffhd *next; /* The NetChip 2280 is faster, and handles some protocol faults @@ -596,9 +596,9 @@ struct fsg_buffhd { unsigned int bulk_out_intended_length; struct usb_request *inreq; - int inreq_busy; + volatile int inreq_busy; struct usb_request *outreq; - int outreq_busy; + volatile int outreq_busy; }; enum fsg_state { @@ -631,16 +631,13 @@ struct fsg_dev { /* filesem protects: backing files in use */ struct rw_semaphore filesem; - /* reference counting: wait until all LUNs are released */ - struct kref ref; - struct usb_ep *ep0; // Handy copy of gadget->ep0 struct usb_request *ep0req; // For control responses - unsigned int ep0_req_tag; + volatile unsigned int ep0_req_tag; const char *ep0req_name; struct usb_request *intreq; // For interrupt responses - int intreq_busy; + volatile int intreq_busy; struct fsg_buffhd *intr_buffhd; unsigned int bulk_out_maxpacket; @@ -670,6 +667,7 @@ struct fsg_dev { struct fsg_buffhd *next_buffhd_to_drain; struct fsg_buffhd buffhds[NUM_BUFFERS]; + wait_queue_head_t thread_wqh; int thread_wakeup_needed; struct completion thread_notifier; struct task_struct *thread_task; @@ -696,6 +694,7 @@ struct fsg_dev { unsigned int nluns; struct lun *luns; struct lun *curlun; + struct completion lun_released; }; typedef void (*fsg_routine_t)(struct fsg_dev *); @@ -1074,13 +1073,11 @@ static int populate_config_buf(struct usb_gadget *gadget, /* These routines may be called in process context or in_irq */ -/* Caller must hold fsg->lock */ static void wakeup_thread(struct fsg_dev *fsg) { /* Tell the main thread that something has happened */ fsg->thread_wakeup_needed = 1; - if (fsg->thread_task) - wake_up_process(fsg->thread_task); + wake_up_all(&fsg->thread_wqh); } @@ -1167,12 +1164,11 @@ static void bulk_in_complete(struct usb_ep *ep, struct usb_request *req) usb_ep_fifo_flush(ep); /* Hold the lock while we update the request and buffer states */ - smp_wmb(); spin_lock(&fsg->lock); bh->inreq_busy = 0; bh->state = BUF_STATE_EMPTY; - wakeup_thread(fsg); spin_unlock(&fsg->lock); + wakeup_thread(fsg); } static void bulk_out_complete(struct usb_ep *ep, struct usb_request *req) @@ -1189,12 +1185,11 @@ static void bulk_out_complete(struct usb_ep *ep, struct usb_request *req) usb_ep_fifo_flush(ep); /* Hold the lock while we update the request and buffer states */ - smp_wmb(); spin_lock(&fsg->lock); bh->outreq_busy = 0; bh->state = BUF_STATE_FULL; - wakeup_thread(fsg); spin_unlock(&fsg->lock); + wakeup_thread(fsg); } @@ -1211,12 +1206,11 @@ static void intr_in_complete(struct usb_ep *ep, struct usb_request *req) usb_ep_fifo_flush(ep); /* Hold the lock while we update the request and buffer states */ - smp_wmb(); spin_lock(&fsg->lock); fsg->intreq_busy = 0; bh->state = BUF_STATE_EMPTY; - wakeup_thread(fsg); spin_unlock(&fsg->lock); + wakeup_thread(fsg); } #else @@ -1267,8 +1261,8 @@ static void received_cbi_adsc(struct fsg_dev *fsg, struct fsg_buffhd *bh) fsg->cbbuf_cmnd_size = req->actual; memcpy(fsg->cbbuf_cmnd, req->buf, fsg->cbbuf_cmnd_size); - wakeup_thread(fsg); spin_unlock(&fsg->lock); + wakeup_thread(fsg); } #else @@ -1520,8 +1514,8 @@ static int fsg_setup(struct usb_gadget *gadget, /* Use this for bulk or interrupt transfers, not ep0 */ static void start_transfer(struct fsg_dev *fsg, struct usb_ep *ep, - struct usb_request *req, int *pbusy, - enum fsg_buffer_state *state) + struct usb_request *req, volatile int *pbusy, + volatile enum fsg_buffer_state *state) { int rc; @@ -1529,11 +1523,8 @@ static void start_transfer(struct fsg_dev *fsg, struct usb_ep *ep, dump_msg(fsg, "bulk-in", req->buf, req->length); else if (ep == fsg->intr_in) dump_msg(fsg, "intr-in", req->buf, req->length); - - spin_lock_irq(&fsg->lock); *pbusy = 1; *state = BUF_STATE_BUSY; - spin_unlock_irq(&fsg->lock); rc = usb_ep_queue(ep, req, GFP_KERNEL); if (rc != 0) { *pbusy = 0; @@ -1553,23 +1544,14 @@ static void start_transfer(struct fsg_dev *fsg, struct usb_ep *ep, static int sleep_thread(struct fsg_dev *fsg) { - int rc = 0; + int rc; /* Wait until a signal arrives or we are woken up */ - for (;;) { - try_to_freeze(); - set_current_state(TASK_INTERRUPTIBLE); - if (signal_pending(current)) { - rc = -EINTR; - break; - } - if (fsg->thread_wakeup_needed) - break; - schedule(); - } - __set_current_state(TASK_RUNNING); + rc = wait_event_interruptible(fsg->thread_wqh, + fsg->thread_wakeup_needed); fsg->thread_wakeup_needed = 0; - return rc; + try_to_freeze(); + return (rc ? -EINTR : 0); } @@ -1806,7 +1788,6 @@ static int do_write(struct fsg_dev *fsg) if (bh->state == BUF_STATE_EMPTY && !get_some_more) break; // We stopped early if (bh->state == BUF_STATE_FULL) { - smp_rmb(); fsg->next_buffhd_to_drain = bh->next; bh->state = BUF_STATE_EMPTY; @@ -2375,7 +2356,6 @@ static int throw_away_data(struct fsg_dev *fsg) /* Throw away the data in a filled buffer */ if (bh->state == BUF_STATE_FULL) { - smp_rmb(); bh->state = BUF_STATE_EMPTY; fsg->next_buffhd_to_drain = bh->next; @@ -3041,7 +3021,6 @@ static int get_next_command(struct fsg_dev *fsg) if ((rc = sleep_thread(fsg)) != 0) return rc; } - smp_rmb(); rc = received_cbw(fsg, bh); bh->state = BUF_STATE_EMPTY; @@ -3663,19 +3642,11 @@ static DEVICE_ATTR(file, 0444, show_file, NULL); /*-------------------------------------------------------------------------*/ -static void fsg_release(struct kref *ref) -{ - struct fsg_dev *fsg = container_of(ref, struct fsg_dev, ref); - - kfree(fsg->luns); - kfree(fsg); -} - static void lun_release(struct device *dev) { struct fsg_dev *fsg = (struct fsg_dev *) dev_get_drvdata(dev); - kref_put(&fsg->ref, fsg_release); + complete(&fsg->lun_released); } static void fsg_unbind(struct usb_gadget *gadget) @@ -3689,12 +3660,14 @@ static void fsg_unbind(struct usb_gadget *gadget) clear_bit(REGISTERED, &fsg->atomic_bitflags); /* Unregister the sysfs attribute files and the LUNs */ + init_completion(&fsg->lun_released); for (i = 0; i < fsg->nluns; ++i) { curlun = &fsg->luns[i]; if (curlun->registered) { device_remove_file(&curlun->dev, &dev_attr_ro); device_remove_file(&curlun->dev, &dev_attr_file); device_unregister(&curlun->dev); + wait_for_completion(&fsg->lun_released); curlun->registered = 0; } } @@ -3873,7 +3846,6 @@ static int __init fsg_bind(struct usb_gadget *gadget) curlun->dev.release = lun_release; device_create_file(&curlun->dev, &dev_attr_ro); device_create_file(&curlun->dev, &dev_attr_file); - kref_get(&fsg->ref); } if (file[i] && *file[i]) { @@ -4089,7 +4061,7 @@ static int __init fsg_alloc(void) return -ENOMEM; spin_lock_init(&fsg->lock); init_rwsem(&fsg->filesem); - kref_init(&fsg->ref); + init_waitqueue_head(&fsg->thread_wqh); init_completion(&fsg->thread_notifier); the_fsg = fsg; @@ -4097,6 +4069,13 @@ static int __init fsg_alloc(void) } +static void fsg_free(struct fsg_dev *fsg) +{ + kfree(fsg->luns); + kfree(fsg); +} + + static int __init fsg_init(void) { int rc; @@ -4106,7 +4085,7 @@ static int __init fsg_init(void) return rc; fsg = the_fsg; if ((rc = usb_gadget_register_driver(&fsg_driver)) != 0) - kref_put(&fsg->ref, fsg_release); + fsg_free(fsg); return rc; } module_init(fsg_init); @@ -4124,6 +4103,6 @@ static void __exit fsg_cleanup(void) wait_for_completion(&fsg->thread_notifier); close_all_backing_files(fsg); - kref_put(&fsg->ref, fsg_release); + fsg_free(fsg); } module_exit(fsg_cleanup); diff --git a/trunk/drivers/usb/gadget/serial.c b/trunk/drivers/usb/gadget/serial.c index 65e084a2c87e..b35ac6d334f8 100644 --- a/trunk/drivers/usb/gadget/serial.c +++ b/trunk/drivers/usb/gadget/serial.c @@ -890,12 +890,10 @@ static void gs_close(struct tty_struct *tty, struct file *file) /* wait for write buffer to drain, or */ /* at most GS_CLOSE_TIMEOUT seconds */ if (gs_buf_data_avail(port->port_write_buf) > 0) { - spin_unlock_irqrestore(&port->port_lock, flags); wait_cond_interruptible_timeout(port->port_write_wait, port->port_dev == NULL || gs_buf_data_avail(port->port_write_buf) == 0, &port->port_lock, flags, GS_CLOSE_TIMEOUT * HZ); - spin_lock_irqsave(&port->port_lock, flags); } /* free disconnected port on final close */ diff --git a/trunk/drivers/usb/host/Makefile b/trunk/drivers/usb/host/Makefile index e3020f4b17be..58321d3f314c 100644 --- a/trunk/drivers/usb/host/Makefile +++ b/trunk/drivers/usb/host/Makefile @@ -2,10 +2,6 @@ # Makefile for USB Host Controller Drivers # -ifeq ($(CONFIG_USB_DEBUG),y) - EXTRA_CFLAGS += -DDEBUG -endif - obj-$(CONFIG_PCI) += pci-quirks.o obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o diff --git a/trunk/drivers/usb/host/ehci-hcd.c b/trunk/drivers/usb/host/ehci-hcd.c index 9dd3d14c64f3..af3c05eb86fc 100644 --- a/trunk/drivers/usb/host/ehci-hcd.c +++ b/trunk/drivers/usb/host/ehci-hcd.c @@ -17,6 +17,13 @@ */ #include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include #include #include @@ -404,39 +411,50 @@ static void ehci_stop (struct usb_hcd *hcd) dbg_status (ehci, "ehci_stop completed", readl (&ehci->regs->status)); } -/* one-time init, only for memory state */ -static int ehci_init(struct usb_hcd *hcd) +static int ehci_run (struct usb_hcd *hcd) { - struct ehci_hcd *ehci = hcd_to_ehci(hcd); + struct ehci_hcd *ehci = hcd_to_ehci (hcd); u32 temp; int retval; u32 hcc_params; - - spin_lock_init(&ehci->lock); - - init_timer(&ehci->watchdog); - ehci->watchdog.function = ehci_watchdog; - ehci->watchdog.data = (unsigned long) ehci; + int first; + + /* skip some things on restart paths */ + first = (ehci->watchdog.data == 0); + if (first) { + init_timer (&ehci->watchdog); + ehci->watchdog.function = ehci_watchdog; + ehci->watchdog.data = (unsigned long) ehci; + } /* * hw default: 1K periodic list heads, one per frame. * periodic_size can shrink by USBCMD update if hcc_params allows. */ ehci->periodic_size = DEFAULT_I_TDPS; - if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) + if (first && (retval = ehci_mem_init (ehci, GFP_KERNEL)) < 0) return retval; /* controllers may cache some of the periodic schedule ... */ - hcc_params = readl(&ehci->caps->hcc_params); - if (HCC_ISOC_CACHE(hcc_params)) // full frame cache + hcc_params = readl (&ehci->caps->hcc_params); + if (HCC_ISOC_CACHE (hcc_params)) // full frame cache ehci->i_thresh = 8; else // N microframes cached - ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params); + ehci->i_thresh = 2 + HCC_ISOC_THRES (hcc_params); ehci->reclaim = NULL; ehci->reclaim_ready = 0; ehci->next_uframe = -1; + /* controller state: unknown --> reset */ + + /* EHCI spec section 4.1 */ + if ((retval = ehci_reset (ehci)) != 0) { + ehci_mem_cleanup (ehci); + return retval; + } + writel (ehci->periodic_dma, &ehci->regs->frame_list); + /* * dedicate a qh for the async ring head, since we couldn't unlink * a 'real' qh without stopping the async schedule [4.8]. use it @@ -444,13 +462,37 @@ static int ehci_init(struct usb_hcd *hcd) * its dummy is used in hw_alt_next of many tds, to prevent the qh * from automatically advancing to the next td after short reads. */ - ehci->async->qh_next.qh = NULL; - ehci->async->hw_next = QH_NEXT(ehci->async->qh_dma); - ehci->async->hw_info1 = cpu_to_le32(QH_HEAD); - ehci->async->hw_token = cpu_to_le32(QTD_STS_HALT); - ehci->async->hw_qtd_next = EHCI_LIST_END; - ehci->async->qh_state = QH_STATE_LINKED; - ehci->async->hw_alt_next = QTD_NEXT(ehci->async->dummy->qtd_dma); + if (first) { + ehci->async->qh_next.qh = NULL; + ehci->async->hw_next = QH_NEXT (ehci->async->qh_dma); + ehci->async->hw_info1 = cpu_to_le32 (QH_HEAD); + ehci->async->hw_token = cpu_to_le32 (QTD_STS_HALT); + ehci->async->hw_qtd_next = EHCI_LIST_END; + ehci->async->qh_state = QH_STATE_LINKED; + ehci->async->hw_alt_next = QTD_NEXT (ehci->async->dummy->qtd_dma); + } + writel ((u32)ehci->async->qh_dma, &ehci->regs->async_next); + + /* + * hcc_params controls whether ehci->regs->segment must (!!!) + * be used; it constrains QH/ITD/SITD and QTD locations. + * pci_pool consistent memory always uses segment zero. + * streaming mappings for I/O buffers, like pci_map_single(), + * can return segments above 4GB, if the device allows. + * + * NOTE: the dma mask is visible through dma_supported(), so + * drivers can pass this info along ... like NETIF_F_HIGHDMA, + * Scsi_Host.highmem_io, and so forth. It's readonly to all + * host side drivers though. + */ + if (HCC_64BIT_ADDR (hcc_params)) { + writel (0, &ehci->regs->segment); +#if 0 +// this is deeply broken on almost all architectures + if (!dma_set_mask (hcd->self.controller, DMA_64BIT_MASK)) + ehci_info (ehci, "enabled 64bit DMA\n"); +#endif + } /* clear interrupt enables, set irq latency */ if (log2_irq_thresh < 0 || log2_irq_thresh > 6) @@ -465,13 +507,13 @@ static int ehci_init(struct usb_hcd *hcd) * make problems: throughput reduction (!), data errors... */ if (park) { - park = min(park, (unsigned) 3); + park = min (park, (unsigned) 3); temp |= CMD_PARK; temp |= park << 8; } - ehci_dbg(ehci, "park %d\n", park); + ehci_info (ehci, "park %d\n", park); } - if (HCC_PGM_FRAMELISTLEN(hcc_params)) { + if (HCC_PGM_FRAMELISTLEN (hcc_params)) { /* periodic schedule size can be smaller than default */ temp &= ~(3 << 2); temp |= (EHCI_TUNE_FLS << 2); @@ -479,63 +521,16 @@ static int ehci_init(struct usb_hcd *hcd) case 0: ehci->periodic_size = 1024; break; case 1: ehci->periodic_size = 512; break; case 2: ehci->periodic_size = 256; break; - default: BUG(); + default: BUG (); } } - ehci->command = temp; - - ehci->reboot_notifier.notifier_call = ehci_reboot; - register_reboot_notifier(&ehci->reboot_notifier); - - return 0; -} - -/* start HC running; it's halted, ehci_init() has been run (once) */ -static int ehci_run (struct usb_hcd *hcd) -{ - struct ehci_hcd *ehci = hcd_to_ehci (hcd); - int retval; - u32 temp; - u32 hcc_params; - - /* EHCI spec section 4.1 */ - if ((retval = ehci_reset(ehci)) != 0) { - unregister_reboot_notifier(&ehci->reboot_notifier); - ehci_mem_cleanup(ehci); - return retval; - } - writel(ehci->periodic_dma, &ehci->regs->frame_list); - writel((u32)ehci->async->qh_dma, &ehci->regs->async_next); - - /* - * hcc_params controls whether ehci->regs->segment must (!!!) - * be used; it constrains QH/ITD/SITD and QTD locations. - * pci_pool consistent memory always uses segment zero. - * streaming mappings for I/O buffers, like pci_map_single(), - * can return segments above 4GB, if the device allows. - * - * NOTE: the dma mask is visible through dma_supported(), so - * drivers can pass this info along ... like NETIF_F_HIGHDMA, - * Scsi_Host.highmem_io, and so forth. It's readonly to all - * host side drivers though. - */ - hcc_params = readl(&ehci->caps->hcc_params); - if (HCC_64BIT_ADDR(hcc_params)) { - writel(0, &ehci->regs->segment); -#if 0 -// this is deeply broken on almost all architectures - if (!dma_set_mask(hcd->self.controller, DMA_64BIT_MASK)) - ehci_info(ehci, "enabled 64bit DMA\n"); -#endif - } - - // Philips, Intel, and maybe others need CMD_RUN before the // root hub will detect new devices (why?); NEC doesn't - ehci->command &= ~(CMD_LRESET|CMD_IAAD|CMD_PSE|CMD_ASE|CMD_RESET); - ehci->command |= CMD_RUN; - writel (ehci->command, &ehci->regs->command); - dbg_cmd (ehci, "init", ehci->command); + temp |= CMD_RUN; + writel (temp, &ehci->regs->command); + dbg_cmd (ehci, "init", temp); + + /* set async sleep time = 10 us ... ? */ /* * Start, enabling full USB 2.0 functionality ... usb 1.1 devices @@ -543,23 +538,26 @@ static int ehci_run (struct usb_hcd *hcd) * involved with the root hub. (Except where one is integrated, * and there's no companion controller unless maybe for USB OTG.) */ + if (first) { + ehci->reboot_notifier.notifier_call = ehci_reboot; + register_reboot_notifier (&ehci->reboot_notifier); + } + hcd->state = HC_STATE_RUNNING; writel (FLAG_CF, &ehci->regs->configured_flag); - readl (&ehci->regs->command); /* unblock posted writes */ + readl (&ehci->regs->command); /* unblock posted write */ temp = HC_VERSION(readl (&ehci->caps->hc_capbase)); ehci_info (ehci, - "USB %x.%x started, EHCI %x.%02x, driver %s\n", + "USB %x.%x %s, EHCI %x.%02x, driver %s\n", ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f), + first ? "initialized" : "restarted", temp >> 8, temp & 0xff, DRIVER_VERSION); writel (INTR_MASK, &ehci->regs->intr_enable); /* Turn On Interrupts */ - /* GRR this is run-once init(), being done every time the HC starts. - * So long as they're part of class devices, we can't do it init() - * since the class device isn't created that early. - */ - create_debug_files(ehci); + if (first) + create_debug_files (ehci); return 0; } @@ -617,7 +615,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs) } /* remote wakeup [4.3.1] */ - if (status & STS_PCD) { + if ((status & STS_PCD) && hcd->remote_wakeup) { unsigned i = HCS_N_PORTS (ehci->hcs_params); /* resume root hub? */ @@ -638,8 +636,9 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs) * stop that signaling. */ ehci->reset_done [i] = jiffies + msecs_to_jiffies (20); + mod_timer (&hcd->rh_timer, + ehci->reset_done [i] + 1); ehci_dbg (ehci, "port %d remote wakeup\n", i + 1); - usb_hcd_resume_root_hub(hcd); } } diff --git a/trunk/drivers/usb/host/ehci-hub.c b/trunk/drivers/usb/host/ehci-hub.c index 69b0b9be7a64..88cb4ada686e 100644 --- a/trunk/drivers/usb/host/ehci-hub.c +++ b/trunk/drivers/usb/host/ehci-hub.c @@ -59,7 +59,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) if ((t1 & PORT_PE) && !(t1 & PORT_OWNER)) t2 |= PORT_SUSPEND; - if (device_may_wakeup(&hcd->self.root_hub->dev)) + if (hcd->remote_wakeup) t2 |= PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E; else t2 &= ~(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E); @@ -94,13 +94,6 @@ static int ehci_bus_resume (struct usb_hcd *hcd) msleep(5); spin_lock_irq (&ehci->lock); - /* Ideally and we've got a real resume here, and no port's power - * was lost. (For PCI, that means Vaux was maintained.) But we - * could instead be restoring a swsusp snapshot -- so that BIOS was - * the last user of the controller, not reset/pm hardware keeping - * state we gave to it. - */ - /* re-init operational registers in case we lost power */ if (readl (&ehci->regs->intr_enable) == 0) { /* at least some APM implementations will try to deliver @@ -517,7 +510,7 @@ static int ehci_hub_control ( if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) != 0) goto error; - if (device_may_wakeup(&hcd->self.root_hub->dev)) + if (hcd->remote_wakeup) temp |= PORT_WAKE_BITS; writel (temp | PORT_SUSPEND, &ehci->regs->port_status [wIndex]); diff --git a/trunk/drivers/usb/host/ehci-pci.c b/trunk/drivers/usb/host/ehci-pci.c index 08ca0f849dab..dfd9bd0b1828 100644 --- a/trunk/drivers/usb/host/ehci-pci.c +++ b/trunk/drivers/usb/host/ehci-pci.c @@ -27,7 +27,7 @@ /* EHCI 0.96 (and later) section 5.1 says how to kick BIOS/SMM/... * off the controller (maybe it can boot from highspeed USB disks). */ -static int bios_handoff(struct ehci_hcd *ehci, int where, u32 cap) +static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap) { struct pci_dev *pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller); @@ -48,7 +48,7 @@ static int bios_handoff(struct ehci_hcd *ehci, int where, u32 cap) where, cap); // some BIOS versions seem buggy... // return 1; - ehci_warn(ehci, "continuing after BIOS bug...\n"); + ehci_warn (ehci, "continuing after BIOS bug...\n"); /* disable all SMIs, and clear "BIOS owns" flag */ pci_write_config_dword(pdev, where + 4, 0); pci_write_config_byte(pdev, where + 2, 0); @@ -58,47 +58,96 @@ static int bios_handoff(struct ehci_hcd *ehci, int where, u32 cap) return 0; } -/* called after powerup, by probe or system-pm "wakeup" */ -static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) +/* called by khubd or root hub init threads */ +static int ehci_pci_reset (struct usb_hcd *hcd) { + struct ehci_hcd *ehci = hcd_to_ehci (hcd); u32 temp; - int retval; unsigned count = 256/4; - /* optional debug port, normally in the first BAR */ - temp = pci_find_capability(pdev, 0x0a); - if (temp) { - pci_read_config_dword(pdev, temp, &temp); - temp >>= 16; - if ((temp & (3 << 13)) == (1 << 13)) { - temp &= 0x1fff; - ehci->debug = ehci_to_hcd(ehci)->regs + temp; - temp = readl(&ehci->debug->control); - ehci_info(ehci, "debug port %d%s\n", - HCS_DEBUG_PORT(ehci->hcs_params), - (temp & DBGP_ENABLED) - ? " IN USE" - : ""); - if (!(temp & DBGP_ENABLED)) - ehci->debug = NULL; + spin_lock_init (&ehci->lock); + + ehci->caps = hcd->regs; + ehci->regs = hcd->regs + HC_LENGTH (readl (&ehci->caps->hc_capbase)); + dbg_hcs_params (ehci, "reset"); + dbg_hcc_params (ehci, "reset"); + + /* cache this readonly data; minimize chip reads */ + ehci->hcs_params = readl (&ehci->caps->hcs_params); + + if (hcd->self.controller->bus == &pci_bus_type) { + struct pci_dev *pdev = to_pci_dev(hcd->self.controller); + + switch (pdev->vendor) { + case PCI_VENDOR_ID_TDI: + if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { + ehci->is_tdi_rh_tt = 1; + tdi_reset (ehci); + } + break; + case PCI_VENDOR_ID_AMD: + /* AMD8111 EHCI doesn't work, according to AMD errata */ + if (pdev->device == 0x7463) { + ehci_info (ehci, "ignoring AMD8111 (errata)\n"); + return -EIO; + } + break; + case PCI_VENDOR_ID_NVIDIA: + /* NVidia reports that certain chips don't handle + * QH, ITD, or SITD addresses above 2GB. (But TD, + * data buffer, and periodic schedule are normal.) + */ + switch (pdev->device) { + case 0x003c: /* MCP04 */ + case 0x005b: /* CK804 */ + case 0x00d8: /* CK8 */ + case 0x00e8: /* CK8S */ + if (pci_set_consistent_dma_mask(pdev, + DMA_31BIT_MASK) < 0) + ehci_warn (ehci, "can't enable NVidia " + "workaround for >2GB RAM\n"); + break; + } + break; + } + + /* optional debug port, normally in the first BAR */ + temp = pci_find_capability (pdev, 0x0a); + if (temp) { + pci_read_config_dword(pdev, temp, &temp); + temp >>= 16; + if ((temp & (3 << 13)) == (1 << 13)) { + temp &= 0x1fff; + ehci->debug = hcd->regs + temp; + temp = readl (&ehci->debug->control); + ehci_info (ehci, "debug port %d%s\n", + HCS_DEBUG_PORT(ehci->hcs_params), + (temp & DBGP_ENABLED) + ? " IN USE" + : ""); + if (!(temp & DBGP_ENABLED)) + ehci->debug = NULL; + } } - } - temp = HCC_EXT_CAPS(readl(&ehci->caps->hcc_params)); + temp = HCC_EXT_CAPS (readl (&ehci->caps->hcc_params)); + } else + temp = 0; /* EHCI 0.96 and later may have "extended capabilities" */ while (temp && count--) { u32 cap; - pci_read_config_dword(pdev, temp, &cap); - ehci_dbg(ehci, "capability %04x at %02x\n", cap, temp); + pci_read_config_dword (to_pci_dev(hcd->self.controller), + temp, &cap); + ehci_dbg (ehci, "capability %04x at %02x\n", cap, temp); switch (cap & 0xff) { case 1: /* BIOS/SMM/... handoff */ - if (bios_handoff(ehci, temp, cap) != 0) + if (bios_handoff (ehci, temp, cap) != 0) return -EOPNOTSUPP; break; case 0: /* illegal reserved capability */ - ehci_dbg(ehci, "illegal capability!\n"); + ehci_warn (ehci, "illegal capability!\n"); cap = 0; /* FALLTHROUGH */ default: /* unknown */ @@ -107,123 +156,77 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) temp = (cap >> 8) & 0xff; } if (!count) { - ehci_err(ehci, "bogus capabilities ... PCI problems!\n"); + ehci_err (ehci, "bogus capabilities ... PCI problems!\n"); return -EIO; } - - /* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */ - retval = pci_set_mwi(pdev); - if (!retval) - ehci_dbg(ehci, "MWI active\n"); - - ehci_port_power(ehci, 0); - - return 0; -} - -/* called during probe() after chip reset completes */ -static int ehci_pci_setup(struct usb_hcd *hcd) -{ - struct ehci_hcd *ehci = hcd_to_ehci(hcd); - struct pci_dev *pdev = to_pci_dev(hcd->self.controller); - u32 temp; - int retval; - - ehci->caps = hcd->regs; - ehci->regs = hcd->regs + HC_LENGTH(readl(&ehci->caps->hc_capbase)); - dbg_hcs_params(ehci, "reset"); - dbg_hcc_params(ehci, "reset"); - - /* cache this readonly data; minimize chip reads */ - ehci->hcs_params = readl(&ehci->caps->hcs_params); - - retval = ehci_halt(ehci); - if (retval) - return retval; - - /* data structure init */ - retval = ehci_init(hcd); - if (retval) - return retval; - - /* NOTE: only the parts below this line are PCI-specific */ - - switch (pdev->vendor) { - case PCI_VENDOR_ID_TDI: - if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { - ehci->is_tdi_rh_tt = 1; - tdi_reset(ehci); - } - break; - case PCI_VENDOR_ID_AMD: - /* AMD8111 EHCI doesn't work, according to AMD errata */ - if (pdev->device == 0x7463) { - ehci_info(ehci, "ignoring AMD8111 (errata)\n"); - retval = -EIO; - goto done; - } - break; - case PCI_VENDOR_ID_NVIDIA: - /* NVidia reports that certain chips don't handle - * QH, ITD, or SITD addresses above 2GB. (But TD, - * data buffer, and periodic schedule are normal.) - */ - switch (pdev->device) { - case 0x003c: /* MCP04 */ - case 0x005b: /* CK804 */ - case 0x00d8: /* CK8 */ - case 0x00e8: /* CK8S */ - if (pci_set_consistent_dma_mask(pdev, - DMA_31BIT_MASK) < 0) - ehci_warn(ehci, "can't enable NVidia " - "workaround for >2GB RAM\n"); - break; - } - break; - } - if (ehci_is_TDI(ehci)) - ehci_reset(ehci); + ehci_reset (ehci); + + ehci_port_power (ehci, 0); /* at least the Genesys GL880S needs fixup here */ temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params); temp &= 0x0f; if (temp && HCS_N_PORTS(ehci->hcs_params) > temp) { - ehci_dbg(ehci, "bogus port configuration: " + ehci_dbg (ehci, "bogus port configuration: " "cc=%d x pcc=%d < ports=%d\n", HCS_N_CC(ehci->hcs_params), HCS_N_PCC(ehci->hcs_params), HCS_N_PORTS(ehci->hcs_params)); - switch (pdev->vendor) { - case 0x17a0: /* GENESYS */ - /* GL880S: should be PORTS=2 */ - temp |= (ehci->hcs_params & ~0xf); - ehci->hcs_params = temp; - break; - case PCI_VENDOR_ID_NVIDIA: - /* NF4: should be PCC=10 */ - break; + if (hcd->self.controller->bus == &pci_bus_type) { + struct pci_dev *pdev; + + pdev = to_pci_dev(hcd->self.controller); + switch (pdev->vendor) { + case 0x17a0: /* GENESYS */ + /* GL880S: should be PORTS=2 */ + temp |= (ehci->hcs_params & ~0xf); + ehci->hcs_params = temp; + break; + case PCI_VENDOR_ID_NVIDIA: + /* NF4: should be PCC=10 */ + break; + } } } - /* Serial Bus Release Number is at PCI 0x60 offset */ - pci_read_config_byte(pdev, 0x60, &ehci->sbrn); + /* force HC to halt state */ + return ehci_halt (ehci); +} - /* Workaround current PCI init glitch: wakeup bits aren't - * being set from PCI PM capability. - */ - if (!device_can_wakeup(&pdev->dev)) { - u16 port_wake; +static int ehci_pci_start (struct usb_hcd *hcd) +{ + struct ehci_hcd *ehci = hcd_to_ehci (hcd); + int result = 0; + + if (hcd->self.controller->bus == &pci_bus_type) { + struct pci_dev *pdev; + u16 port_wake; + + pdev = to_pci_dev(hcd->self.controller); + + /* Serial Bus Release Number is at PCI 0x60 offset */ + pci_read_config_byte(pdev, 0x60, &ehci->sbrn); + /* port wake capability, reported by boot firmware */ pci_read_config_word(pdev, 0x62, &port_wake); - if (port_wake & 0x0001) - device_init_wakeup(&pdev->dev, 1); + hcd->can_wakeup = (port_wake & 1) != 0; + + /* help hc dma work well with cachelines */ + result = pci_set_mwi(pdev); + if (result) + ehci_dbg(ehci, "unable to enable MWI - not fatal.\n"); } - retval = ehci_pci_reinit(ehci, pdev); -done: - return retval; + return ehci_run (hcd); +} + +/* always called by thread; normally rmmod */ + +static void ehci_pci_stop (struct usb_hcd *hcd) +{ + ehci_stop (hcd); } /*-------------------------------------------------------------------------*/ @@ -232,106 +235,90 @@ static int ehci_pci_setup(struct usb_hcd *hcd) /* suspend/resume, section 4.3 */ -/* These routines rely on the PCI bus glue +/* These routines rely on the bus (pci, platform, etc) * to handle powerdown and wakeup, and currently also on * transceivers that don't need any software attention to set up * the right sort of wakeup. - * Also they depend on separate root hub suspend/resume. */ -static int ehci_pci_suspend(struct usb_hcd *hcd, pm_message_t message) +static int ehci_pci_suspend (struct usb_hcd *hcd, pm_message_t message) { - struct ehci_hcd *ehci = hcd_to_ehci(hcd); - unsigned long flags; - int rc = 0; - - if (time_before(jiffies, ehci->next_statechange)) - msleep(10); - - /* Root hub was already suspended. Disable irq emission and - * mark HW unaccessible, bail out if RH has been resumed. Use - * the spinlock to properly synchronize with possible pending - * RH suspend or resume activity. - * - * This is still racy as hcd->state is manipulated outside of - * any locks =P But that will be a different fix. - */ - spin_lock_irqsave (&ehci->lock, flags); - if (hcd->state != HC_STATE_SUSPENDED) { - rc = -EINVAL; - goto bail; - } - writel (0, &ehci->regs->intr_enable); - (void)readl(&ehci->regs->intr_enable); + struct ehci_hcd *ehci = hcd_to_ehci (hcd); - clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); - bail: - spin_unlock_irqrestore (&ehci->lock, flags); + if (time_before (jiffies, ehci->next_statechange)) + msleep (100); - // could save FLADJ in case of Vaux power loss +#ifdef CONFIG_USB_SUSPEND + (void) usb_suspend_device (hcd->self.root_hub); +#else + usb_lock_device (hcd->self.root_hub); + (void) ehci_bus_suspend (hcd); + usb_unlock_device (hcd->self.root_hub); +#endif + + // save (PCI) FLADJ in case of Vaux power loss // ... we'd only use it to handle clock skew - return rc; + return 0; } -static int ehci_pci_resume(struct usb_hcd *hcd) +static int ehci_pci_resume (struct usb_hcd *hcd) { - struct ehci_hcd *ehci = hcd_to_ehci(hcd); + struct ehci_hcd *ehci = hcd_to_ehci (hcd); unsigned port; - struct pci_dev *pdev = to_pci_dev(hcd->self.controller); + struct usb_device *root = hcd->self.root_hub; int retval = -EINVAL; - // maybe restore FLADJ - - if (time_before(jiffies, ehci->next_statechange)) - msleep(100); - - /* Mark hardware accessible again as we are out of D3 state by now */ - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + // maybe restore (PCI) FLADJ - /* If CF is clear, we lost PCI Vaux power and need to restart. */ - if (readl(&ehci->regs->configured_flag) != FLAG_CF) - goto restart; + if (time_before (jiffies, ehci->next_statechange)) + msleep (100); /* If any port is suspended (or owned by the companion), * we know we can/must resume the HC (and mustn't reset it). - * We just defer that to the root hub code. */ - for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) { + for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) { u32 status; port--; - status = readl(&ehci->regs->port_status [port]); + status = readl (&ehci->regs->port_status [port]); if (!(status & PORT_POWER)) continue; - if (status & (PORT_SUSPEND | PORT_RESUME | PORT_OWNER)) { - usb_hcd_resume_root_hub(hcd); - return 0; + if (status & (PORT_SUSPEND | PORT_OWNER)) { + down (&hcd->self.root_hub->serialize); + retval = ehci_bus_resume (hcd); + up (&hcd->self.root_hub->serialize); + break; } + if (!root->children [port]) + continue; + dbg_port (ehci, __FUNCTION__, port + 1, status); + usb_set_device_state (root->children[port], + USB_STATE_NOTATTACHED); } -restart: - ehci_dbg(ehci, "lost power, restarting\n"); - usb_root_hub_lost_power(hcd->self.root_hub); - /* Else reset, to cope with power loss or flush-to-storage - * style "resume" having let BIOS kick in during reboot. + * style "resume" having activated BIOS during reboot. */ - (void) ehci_halt(ehci); - (void) ehci_reset(ehci); - (void) ehci_pci_reinit(ehci, pdev); - - /* emptying the schedule aborts any urbs */ - spin_lock_irq(&ehci->lock); - if (ehci->reclaim) - ehci->reclaim_ready = 1; - ehci_work(ehci, NULL); - spin_unlock_irq(&ehci->lock); - - /* restart; khubd will disconnect devices */ - retval = ehci_run(hcd); - - /* here we "know" root ports should always stay powered */ - ehci_port_power(ehci, 1); + if (port == 0) { + (void) ehci_halt (ehci); + (void) ehci_reset (ehci); + (void) ehci_pci_reset (hcd); + + /* emptying the schedule aborts any urbs */ + spin_lock_irq (&ehci->lock); + if (ehci->reclaim) + ehci->reclaim_ready = 1; + ehci_work (ehci, NULL); + spin_unlock_irq (&ehci->lock); + + /* restart; khubd will disconnect devices */ + retval = ehci_run (hcd); + + /* here we "know" root ports should always stay powered; + * but some controllers may lose all power. + */ + ehci_port_power (ehci, 1); + } return retval; } @@ -351,13 +338,13 @@ static const struct hc_driver ehci_pci_hc_driver = { /* * basic lifecycle operations */ - .reset = ehci_pci_setup, - .start = ehci_run, + .reset = ehci_pci_reset, + .start = ehci_pci_start, #ifdef CONFIG_PM .suspend = ehci_pci_suspend, .resume = ehci_pci_resume, #endif - .stop = ehci_stop, + .stop = ehci_pci_stop, /* * managing i/o requests and associated device resources @@ -390,7 +377,7 @@ static const struct pci_device_id pci_ids [] = { { }, { /* end: all zeroes */ } }; -MODULE_DEVICE_TABLE(pci, pci_ids); +MODULE_DEVICE_TABLE (pci, pci_ids); /* pci driver glue; this is a "new style" PCI driver module */ static struct pci_driver ehci_pci_driver = { @@ -406,22 +393,22 @@ static struct pci_driver ehci_pci_driver = { #endif }; -static int __init ehci_hcd_pci_init(void) +static int __init ehci_hcd_pci_init (void) { if (usb_disabled()) return -ENODEV; - pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n", + pr_debug ("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n", hcd_name, - sizeof(struct ehci_qh), sizeof(struct ehci_qtd), - sizeof(struct ehci_itd), sizeof(struct ehci_sitd)); + sizeof (struct ehci_qh), sizeof (struct ehci_qtd), + sizeof (struct ehci_itd), sizeof (struct ehci_sitd)); - return pci_register_driver(&ehci_pci_driver); + return pci_register_driver (&ehci_pci_driver); } -module_init(ehci_hcd_pci_init); +module_init (ehci_hcd_pci_init); -static void __exit ehci_hcd_pci_cleanup(void) +static void __exit ehci_hcd_pci_cleanup (void) { - pci_unregister_driver(&ehci_pci_driver); + pci_unregister_driver (&ehci_pci_driver); } -module_exit(ehci_hcd_pci_cleanup); +module_exit (ehci_hcd_pci_cleanup); diff --git a/trunk/drivers/usb/host/ehci-q.c b/trunk/drivers/usb/host/ehci-q.c index 9b13bf2fa98d..5bb872c3496d 100644 --- a/trunk/drivers/usb/host/ehci-q.c +++ b/trunk/drivers/usb/host/ehci-q.c @@ -514,18 +514,18 @@ qh_urb_transaction ( qtd->urb = urb; qtd_prev->hw_next = QTD_NEXT (qtd->qtd_dma); list_add_tail (&qtd->qtd_list, head); - - /* for zero length DATA stages, STATUS is always IN */ - if (len == 0) - token |= (1 /* "in" */ << 8); } /* * data transfer stage: buffer setup */ - buf = urb->transfer_dma; + if (likely (len > 0)) + buf = urb->transfer_dma; + else + buf = 0; - if (is_input) + /* for zero length DATA stages, STATUS is always IN */ + if (!buf || is_input) token |= (1 /* "in" */ << 8); /* else it's already initted to "out" pid (0 << 8) */ @@ -572,7 +572,7 @@ qh_urb_transaction ( * control requests may need a terminating data "status" ack; * bulk ones may need a terminating short packet (zero length). */ - if (likely (urb->transfer_buffer_length != 0)) { + if (likely (buf != 0)) { int one_more = 0; if (usb_pipecontrol (urb->pipe)) { @@ -912,7 +912,6 @@ submit_async ( int epnum; unsigned long flags; struct ehci_qh *qh = NULL; - int rc = 0; qtd = list_entry (qtd_list->next, struct ehci_qtd, qtd_list); epnum = ep->desc.bEndpointAddress; @@ -927,28 +926,21 @@ submit_async ( #endif spin_lock_irqsave (&ehci->lock, flags); - if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, - &ehci_to_hcd(ehci)->flags))) { - rc = -ESHUTDOWN; - goto done; - } - qh = qh_append_tds (ehci, urb, qtd_list, epnum, &ep->hcpriv); - if (unlikely(qh == NULL)) { - rc = -ENOMEM; - goto done; - } /* Control/bulk operations through TTs don't need scheduling, * the HC and TT handle it when the TT has a buffer ready. */ - if (likely (qh->qh_state == QH_STATE_IDLE)) - qh_link_async (ehci, qh_get (qh)); - done: + if (likely (qh != NULL)) { + if (likely (qh->qh_state == QH_STATE_IDLE)) + qh_link_async (ehci, qh_get (qh)); + } spin_unlock_irqrestore (&ehci->lock, flags); - if (unlikely (qh == NULL)) + if (unlikely (qh == NULL)) { qtd_list_free (ehci, urb, qtd_list); - return rc; + return -ENOMEM; + } + return 0; } /*-------------------------------------------------------------------------*/ diff --git a/trunk/drivers/usb/host/ehci-sched.c b/trunk/drivers/usb/host/ehci-sched.c index 57e77374d228..f0c8aa1ccd5d 100644 --- a/trunk/drivers/usb/host/ehci-sched.c +++ b/trunk/drivers/usb/host/ehci-sched.c @@ -602,12 +602,6 @@ static int intr_submit ( spin_lock_irqsave (&ehci->lock, flags); - if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, - &ehci_to_hcd(ehci)->flags))) { - status = -ESHUTDOWN; - goto done; - } - /* get qh and force any scheduling errors */ INIT_LIST_HEAD (&empty); qh = qh_append_tds (ehci, urb, &empty, epnum, &ep->hcpriv); @@ -1462,11 +1456,7 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb, /* schedule ... need to lock */ spin_lock_irqsave (&ehci->lock, flags); - if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, - &ehci_to_hcd(ehci)->flags))) - status = -ESHUTDOWN; - else - status = iso_stream_schedule (ehci, urb, stream); + status = iso_stream_schedule (ehci, urb, stream); if (likely (status == 0)) itd_link_urb (ehci, urb, ehci->periodic_size << 3, stream); spin_unlock_irqrestore (&ehci->lock, flags); @@ -1825,11 +1815,7 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb, /* schedule ... need to lock */ spin_lock_irqsave (&ehci->lock, flags); - if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, - &ehci_to_hcd(ehci)->flags))) - status = -ESHUTDOWN; - else - status = iso_stream_schedule (ehci, urb, stream); + status = iso_stream_schedule (ehci, urb, stream); if (status == 0) sitd_link_urb (ehci, urb, ehci->periodic_size << 3, stream); spin_unlock_irqrestore (&ehci->lock, flags); diff --git a/trunk/drivers/usb/host/isp116x-hcd.c b/trunk/drivers/usb/host/isp116x-hcd.c index 584b8dc65119..82f64986bc22 100644 --- a/trunk/drivers/usb/host/isp116x-hcd.c +++ b/trunk/drivers/usb/host/isp116x-hcd.c @@ -55,13 +55,19 @@ /* enqueuing/finishing log of urbs */ //#define URB_TRACE +#include #include +#include +#include #include -#include -#include +#include +#include +#include +#include #include #include #include +#include #include #include #include @@ -71,10 +77,14 @@ #include #include +#ifndef DEBUG +# define STUB_DEBUG_FILE +#endif + #include "../core/hcd.h" #include "isp116x.h" -#define DRIVER_VERSION "03 Nov 2005" +#define DRIVER_VERSION "05 Aug 2005" #define DRIVER_DESC "ISP116x USB Host Controller Driver" MODULE_DESCRIPTION(DRIVER_DESC); @@ -154,11 +164,13 @@ static void pack_fifo(struct isp116x *isp116x) struct ptd *ptd; int buflen = isp116x->atl_last_dir == PTD_DIR_IN ? isp116x->atl_bufshrt : isp116x->atl_buflen; + int ptd_count = 0; isp116x_write_reg16(isp116x, HCuPINT, HCuPINT_AIIEOT); isp116x_write_reg16(isp116x, HCXFERCTR, buflen); isp116x_write_addr(isp116x, HCATLPORT | ISP116x_WRITE_OFFSET); for (ep = isp116x->atl_active; ep; ep = ep->active) { + ++ptd_count; ptd = &ep->ptd; dump_ptd(ptd); dump_ptd_out_data(ptd, ep->data); @@ -293,8 +305,9 @@ static void postproc_atl_queue(struct isp116x *isp116x) udev = urb->dev; ptd = &ep->ptd; cc = PTD_GET_CC(ptd); - short_not_ok = 1; + spin_lock(&urb->lock); + short_not_ok = 1; /* Data underrun is special. For allowed underrun we clear the error and continue as normal. For @@ -407,7 +420,7 @@ static void postproc_atl_queue(struct isp116x *isp116x) ep->nextpid = 0; break; default: - BUG(); + BUG_ON(1); } spin_unlock(&urb->lock); } @@ -615,12 +628,8 @@ static irqreturn_t isp116x_irq(struct usb_hcd *hcd, struct pt_regs *regs) u32 intstat = isp116x_read_reg32(isp116x, HCINTSTAT); isp116x_write_reg32(isp116x, HCINTSTAT, intstat); if (intstat & HCINT_UE) { - ERR("Unrecoverable error, HC is dead!\n"); - /* IRQ's are off, we do no DMA, - perfectly ready to die ... */ - hcd->state = HC_STATE_HALT; - ret = IRQ_HANDLED; - goto done; + ERR("Unrecoverable error\n"); + /* What should we do here? Reset? */ } if (intstat & HCINT_RHSC) /* When root hub or any of its ports is going @@ -631,6 +640,7 @@ static irqreturn_t isp116x_irq(struct usb_hcd *hcd, struct pt_regs *regs) if (intstat & HCINT_RD) { DBG("---- remote wakeup\n"); usb_hcd_resume_root_hub(hcd); + ret = IRQ_HANDLED; } irqstat &= ~HCuPINT_OPR; ret = IRQ_HANDLED; @@ -641,7 +651,6 @@ static irqreturn_t isp116x_irq(struct usb_hcd *hcd, struct pt_regs *regs) } isp116x_write_reg16(isp116x, HCuPINTENB, isp116x->irqenb); - done: spin_unlock(&isp116x->lock); return ret; } @@ -715,7 +724,6 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd, spin_lock_irqsave(&isp116x->lock, flags); if (!HC_IS_RUNNING(hcd->state)) { - kfree(ep); ret = -ENODEV; goto fail; } @@ -880,7 +888,7 @@ static void isp116x_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep) { int i; - struct isp116x_ep *ep = hep->hcpriv; + struct isp116x_ep *ep = hep->hcpriv;; if (!ep) return; @@ -908,6 +916,8 @@ static int isp116x_get_frame(struct usb_hcd *hcd) return (int)fmnum; } +/*----------------------------------------------------------------*/ + /* Adapted from ohci-hub.c. Currently we don't support autosuspend. */ @@ -958,10 +968,11 @@ static void isp116x_hub_descriptor(struct isp116x *isp116x, desc->bHubContrCurrent = 0; desc->bNbrPorts = (u8) (reg & 0x3); /* Power switching, device type, overcurrent. */ - desc->wHubCharacteristics = cpu_to_le16((u16) ((reg >> 8) & 0x1f)); + desc->wHubCharacteristics = + (__force __u16) cpu_to_le16((u16) ((reg >> 8) & 0x1f)); desc->bPwrOn2PwrGood = (u8) ((reg >> 24) & 0xff); /* two bitmaps: ports removable, and legacy PortPwrCtrlMask */ - desc->bitmap[0] = 0; + desc->bitmap[0] = desc->bNbrPorts == 1 ? 1 << 1 : 3 << 1; desc->bitmap[1] = ~0; } @@ -1148,9 +1159,135 @@ static int isp116x_hub_control(struct usb_hcd *hcd, return ret; } +#ifdef CONFIG_PM + +static int isp116x_bus_suspend(struct usb_hcd *hcd) +{ + struct isp116x *isp116x = hcd_to_isp116x(hcd); + unsigned long flags; + u32 val; + int ret = 0; + + spin_lock_irqsave(&isp116x->lock, flags); + + val = isp116x_read_reg32(isp116x, HCCONTROL); + switch (val & HCCONTROL_HCFS) { + case HCCONTROL_USB_OPER: + hcd->state = HC_STATE_QUIESCING; + val &= (~HCCONTROL_HCFS & ~HCCONTROL_RWE); + val |= HCCONTROL_USB_SUSPEND; + if (hcd->remote_wakeup) + val |= HCCONTROL_RWE; + /* Wait for usb transfers to finish */ + mdelay(2); + isp116x_write_reg32(isp116x, HCCONTROL, val); + hcd->state = HC_STATE_SUSPENDED; + /* Wait for devices to suspend */ + mdelay(5); + case HCCONTROL_USB_SUSPEND: + break; + case HCCONTROL_USB_RESUME: + isp116x_write_reg32(isp116x, HCCONTROL, + (val & ~HCCONTROL_HCFS) | + HCCONTROL_USB_RESET); + case HCCONTROL_USB_RESET: + ret = -EBUSY; + break; + default: + ret = -EINVAL; + } + + spin_unlock_irqrestore(&isp116x->lock, flags); + return ret; +} + +static int isp116x_bus_resume(struct usb_hcd *hcd) +{ + struct isp116x *isp116x = hcd_to_isp116x(hcd); + u32 val; + int ret = -EINPROGRESS; + + msleep(5); + spin_lock_irq(&isp116x->lock); + + val = isp116x_read_reg32(isp116x, HCCONTROL); + switch (val & HCCONTROL_HCFS) { + case HCCONTROL_USB_SUSPEND: + val &= ~HCCONTROL_HCFS; + val |= HCCONTROL_USB_RESUME; + isp116x_write_reg32(isp116x, HCCONTROL, val); + case HCCONTROL_USB_RESUME: + break; + case HCCONTROL_USB_OPER: + /* Without setting power_state here the + SUSPENDED state won't be removed from + sysfs/usbN/power.state as a response to remote + wakeup. Maybe in the future. */ + hcd->self.root_hub->dev.power.power_state = PMSG_ON; + ret = 0; + break; + default: + ret = -EBUSY; + } + + if (ret != -EINPROGRESS) { + spin_unlock_irq(&isp116x->lock); + return ret; + } + + val = isp116x->rhdesca & RH_A_NDP; + while (val--) { + u32 stat = + isp116x_read_reg32(isp116x, val ? HCRHPORT2 : HCRHPORT1); + /* force global, not selective, resume */ + if (!(stat & RH_PS_PSS)) + continue; + DBG("%s: Resuming port %d\n", __func__, val); + isp116x_write_reg32(isp116x, RH_PS_POCI, val + ? HCRHPORT2 : HCRHPORT1); + } + spin_unlock_irq(&isp116x->lock); + + hcd->state = HC_STATE_RESUMING; + mdelay(20); + + /* Go operational */ + spin_lock_irq(&isp116x->lock); + val = isp116x_read_reg32(isp116x, HCCONTROL); + isp116x_write_reg32(isp116x, HCCONTROL, + (val & ~HCCONTROL_HCFS) | HCCONTROL_USB_OPER); + spin_unlock_irq(&isp116x->lock); + /* see analogous comment above */ + hcd->self.root_hub->dev.power.power_state = PMSG_ON; + hcd->state = HC_STATE_RUNNING; + + return 0; +} + + +#else + +#define isp116x_bus_suspend NULL +#define isp116x_bus_resume NULL + +#endif + /*-----------------------------------------------------------------*/ -#ifdef CONFIG_DEBUG_FS +#ifdef STUB_DEBUG_FILE + +static inline void create_debug_file(struct isp116x *isp116x) +{ +} + +static inline void remove_debug_file(struct isp116x *isp116x) +{ +} + +#else + +#include +#include static void dump_irq(struct seq_file *s, char *label, u16 mask) { @@ -1174,9 +1311,13 @@ static void dump_int(struct seq_file *s, char *label, u32 mask) mask & HCINT_SF ? " sof" : "", mask & HCINT_SO ? " so" : ""); } -static int isp116x_show_dbg(struct seq_file *s, void *unused) +static int proc_isp116x_show(struct seq_file *s, void *unused) { struct isp116x *isp116x = s->private; + struct isp116x_ep *ep; + struct urb *urb; + unsigned i; + char *str; seq_printf(s, "%s\n%s version %s\n", isp116x_to_hcd(isp116x)->product_desc, hcd_name, @@ -1192,50 +1333,105 @@ static int isp116x_show_dbg(struct seq_file *s, void *unused) } spin_lock_irq(&isp116x->lock); + dump_irq(s, "hc_irq_enable", isp116x_read_reg16(isp116x, HCuPINTENB)); dump_irq(s, "hc_irq_status", isp116x_read_reg16(isp116x, HCuPINT)); dump_int(s, "hc_int_enable", isp116x_read_reg32(isp116x, HCINTENB)); dump_int(s, "hc_int_status", isp116x_read_reg32(isp116x, HCINTSTAT)); - isp116x_show_regs_seq(isp116x, s); + + list_for_each_entry(ep, &isp116x->async, schedule) { + + switch (ep->nextpid) { + case USB_PID_IN: + str = "in"; + break; + case USB_PID_OUT: + str = "out"; + break; + case USB_PID_SETUP: + str = "setup"; + break; + case USB_PID_ACK: + str = "status"; + break; + default: + str = "?"; + break; + }; + seq_printf(s, "%p, ep%d%s, maxpacket %d:\n", ep, + ep->epnum, str, ep->maxpacket); + list_for_each_entry(urb, &ep->hep->urb_list, urb_list) { + seq_printf(s, " urb%p, %d/%d\n", urb, + urb->actual_length, + urb->transfer_buffer_length); + } + } + if (!list_empty(&isp116x->async)) + seq_printf(s, "\n"); + + seq_printf(s, "periodic size= %d\n", PERIODIC_SIZE); + + for (i = 0; i < PERIODIC_SIZE; i++) { + ep = isp116x->periodic[i]; + if (!ep) + continue; + seq_printf(s, "%2d [%3d]:\n", i, isp116x->load[i]); + + /* DUMB: prints shared entries multiple times */ + do { + seq_printf(s, " %d/%p (%sdev%d ep%d%s max %d)\n", + ep->period, ep, + (ep->udev->speed == + USB_SPEED_FULL) ? "" : "ls ", + ep->udev->devnum, ep->epnum, + (ep->epnum == + 0) ? "" : ((ep->nextpid == + USB_PID_IN) ? "in" : "out"), + ep->maxpacket); + ep = ep->next; + } while (ep); + } spin_unlock_irq(&isp116x->lock); seq_printf(s, "\n"); return 0; } -static int isp116x_open_seq(struct inode *inode, struct file *file) +static int proc_isp116x_open(struct inode *inode, struct file *file) { - return single_open(file, isp116x_show_dbg, inode->u.generic_ip); + return single_open(file, proc_isp116x_show, PDE(inode)->data); } -static struct file_operations isp116x_debug_fops = { - .open = isp116x_open_seq, +static struct file_operations proc_ops = { + .open = proc_isp116x_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static int create_debug_file(struct isp116x *isp116x) +/* expect just one isp116x per system */ +static const char proc_filename[] = "driver/isp116x"; + +static void create_debug_file(struct isp116x *isp116x) { - isp116x->dentry = debugfs_create_file(hcd_name, - S_IRUGO, NULL, isp116x, - &isp116x_debug_fops); - if (!isp116x->dentry) - return -ENOMEM; - return 0; + struct proc_dir_entry *pde; + + pde = create_proc_entry(proc_filename, 0, NULL); + if (pde == NULL) + return; + + pde->proc_fops = &proc_ops; + pde->data = isp116x; + isp116x->pde = pde; } static void remove_debug_file(struct isp116x *isp116x) { - debugfs_remove(isp116x->dentry); + if (isp116x->pde) + remove_proc_entry(proc_filename, NULL); } -#else - -#define create_debug_file(d) 0 -#define remove_debug_file(d) do{}while(0) - -#endif /* CONFIG_DEBUG_FS */ +#endif /*-----------------------------------------------------------------*/ @@ -1270,7 +1466,7 @@ static int isp116x_reset(struct usb_hcd *hcd) struct isp116x *isp116x = hcd_to_isp116x(hcd); unsigned long t; u16 clkrdy = 0; - int ret, timeout = 15 /* ms */ ; + int ret = 0, timeout = 15 /* ms */ ; ret = isp116x_sw_reset(isp116x); if (ret) @@ -1286,7 +1482,7 @@ static int isp116x_reset(struct usb_hcd *hcd) break; } if (!clkrdy) { - ERR("Clock not ready after %dms\n", timeout); + ERR("Clock not ready after 20ms\n"); /* After sw_reset the clock won't report to be ready, if H_WAKEUP pin is high. */ ERR("Please make sure that the H_WAKEUP pin is pulled low!\n"); @@ -1376,8 +1572,7 @@ static int isp116x_start(struct usb_hcd *hcd) val = 0; if (board->remote_wakeup_enable) { - if (!device_can_wakeup(hcd->self.controller)) - device_init_wakeup(hcd->self.controller, 1); + hcd->can_wakeup = 1; val |= RH_HS_DRWE; } isp116x_write_reg32(isp116x, HCRHSTATUS, val); @@ -1405,126 +1600,12 @@ static int isp116x_start(struct usb_hcd *hcd) isp116x_write_reg32(isp116x, HCRHPORT1, RH_PS_CCS); isp116x_write_reg32(isp116x, HCRHPORT2, RH_PS_CCS); - isp116x_show_regs_log(isp116x); + isp116x_show_regs(isp116x); spin_unlock_irqrestore(&isp116x->lock, flags); return 0; } -#ifdef CONFIG_PM - -static int isp116x_bus_suspend(struct usb_hcd *hcd) -{ - struct isp116x *isp116x = hcd_to_isp116x(hcd); - unsigned long flags; - u32 val; - int ret = 0; - - spin_lock_irqsave(&isp116x->lock, flags); - - val = isp116x_read_reg32(isp116x, HCCONTROL); - switch (val & HCCONTROL_HCFS) { - case HCCONTROL_USB_OPER: - val &= (~HCCONTROL_HCFS & ~HCCONTROL_RWE); - val |= HCCONTROL_USB_SUSPEND; - if (device_may_wakeup(&hcd->self.root_hub->dev)) - val |= HCCONTROL_RWE; - /* Wait for usb transfers to finish */ - mdelay(2); - isp116x_write_reg32(isp116x, HCCONTROL, val); - /* Wait for devices to suspend */ - mdelay(5); - case HCCONTROL_USB_SUSPEND: - break; - case HCCONTROL_USB_RESUME: - isp116x_write_reg32(isp116x, HCCONTROL, - (val & ~HCCONTROL_HCFS) | - HCCONTROL_USB_RESET); - case HCCONTROL_USB_RESET: - ret = -EBUSY; - break; - default: - ret = -EINVAL; - } - - spin_unlock_irqrestore(&isp116x->lock, flags); - return ret; -} - -static int isp116x_bus_resume(struct usb_hcd *hcd) -{ - struct isp116x *isp116x = hcd_to_isp116x(hcd); - u32 val; - - msleep(5); - spin_lock_irq(&isp116x->lock); - - val = isp116x_read_reg32(isp116x, HCCONTROL); - switch (val & HCCONTROL_HCFS) { - case HCCONTROL_USB_SUSPEND: - val &= ~HCCONTROL_HCFS; - val |= HCCONTROL_USB_RESUME; - isp116x_write_reg32(isp116x, HCCONTROL, val); - case HCCONTROL_USB_RESUME: - break; - case HCCONTROL_USB_OPER: - spin_unlock_irq(&isp116x->lock); - /* Without setting power_state here the - SUSPENDED state won't be removed from - sysfs/usbN/power.state as a response to remote - wakeup. Maybe in the future. */ - hcd->self.root_hub->dev.power.power_state = PMSG_ON; - return 0; - default: - /* HCCONTROL_USB_RESET: this may happen, when during - suspension the HC lost power. Reinitialize completely */ - spin_unlock_irq(&isp116x->lock); - DBG("Chip has been reset while suspended. Reinit from scratch.\n"); - isp116x_reset(hcd); - isp116x_start(hcd); - isp116x_hub_control(hcd, SetPortFeature, - USB_PORT_FEAT_POWER, 1, NULL, 0); - if ((isp116x->rhdesca & RH_A_NDP) == 2) - isp116x_hub_control(hcd, SetPortFeature, - USB_PORT_FEAT_POWER, 2, NULL, 0); - hcd->self.root_hub->dev.power.power_state = PMSG_ON; - return 0; - } - - val = isp116x->rhdesca & RH_A_NDP; - while (val--) { - u32 stat = - isp116x_read_reg32(isp116x, val ? HCRHPORT2 : HCRHPORT1); - /* force global, not selective, resume */ - if (!(stat & RH_PS_PSS)) - continue; - DBG("%s: Resuming port %d\n", __func__, val); - isp116x_write_reg32(isp116x, RH_PS_POCI, val - ? HCRHPORT2 : HCRHPORT1); - } - spin_unlock_irq(&isp116x->lock); - - hcd->state = HC_STATE_RESUMING; - msleep(20); - - /* Go operational */ - spin_lock_irq(&isp116x->lock); - val = isp116x_read_reg32(isp116x, HCCONTROL); - isp116x_write_reg32(isp116x, HCCONTROL, - (val & ~HCCONTROL_HCFS) | HCCONTROL_USB_OPER); - spin_unlock_irq(&isp116x->lock); - /* see analogous comment above */ - hcd->self.root_hub->dev.power.power_state = PMSG_ON; - hcd->state = HC_STATE_RUNNING; - - return 0; -} - -#else - -#define isp116x_bus_suspend NULL -#define isp116x_bus_resume NULL - -#endif +/*-----------------------------------------------------------------*/ static struct hc_driver isp116x_hc_driver = { .description = hcd_name, @@ -1654,19 +1735,12 @@ static int __init isp116x_probe(struct platform_device *pdev) } ret = usb_add_hcd(hcd, irq, SA_INTERRUPT); - if (ret) + if (ret != 0) goto err6; - ret = create_debug_file(isp116x); - if (ret) { - ERR("Couldn't create debugfs entry\n"); - goto err7; - } - + create_debug_file(isp116x); return 0; - err7: - usb_remove_hcd(hcd); err6: usb_put_hcd(hcd); err5: @@ -1688,9 +1762,13 @@ static int __init isp116x_probe(struct platform_device *pdev) */ static int isp116x_suspend(struct platform_device *dev, pm_message_t state) { - VDBG("%s: state %x\n", __func__, state.event); + int ret = 0; + + VDBG("%s: state %x\n", __func__, state); + dev->dev.power.power_state = state; - return 0; + + return ret; } /* @@ -1698,9 +1776,13 @@ static int isp116x_suspend(struct platform_device *dev, pm_message_t state) */ static int isp116x_resume(struct platform_device *dev) { - VDBG("%s: state %x\n", __func__, dev->power.power_state.event); + int ret = 0; + + VDBG("%s: state %x\n", __func__, dev->dev.power.power_state); + dev->dev.power.power_state = PMSG_ON; - return 0; + + return ret; } #else diff --git a/trunk/drivers/usb/host/isp116x.h b/trunk/drivers/usb/host/isp116x.h index a1b7c3813d3a..c6fec96785fe 100644 --- a/trunk/drivers/usb/host/isp116x.h +++ b/trunk/drivers/usb/host/isp116x.h @@ -259,7 +259,7 @@ struct isp116x { struct isp116x_platform_data *board; - struct dentry *dentry; + struct proc_dir_entry *pde; unsigned long stat1, stat2, stat4, stat8, stat16; /* HC registers */ @@ -450,7 +450,7 @@ static void isp116x_write_reg32(struct isp116x *isp116x, unsigned reg, isp116x_write_data32(isp116x, (u32) val); } -#define isp116x_show_reg_log(d,r,s) { \ +#define isp116x_show_reg(d,r) { \ if ((r) < 0x20) { \ DBG("%-12s[%02x]: %08x\n", #r, \ r, isp116x_read_reg32(d, r)); \ @@ -459,60 +459,35 @@ static void isp116x_write_reg32(struct isp116x *isp116x, unsigned reg, r, isp116x_read_reg16(d, r)); \ } \ } -#define isp116x_show_reg_seq(d,r,s) { \ - if ((r) < 0x20) { \ - seq_printf(s, "%-12s[%02x]: %08x\n", #r, \ - r, isp116x_read_reg32(d, r)); \ - } else { \ - seq_printf(s, "%-12s[%02x]: %04x\n", #r, \ - r, isp116x_read_reg16(d, r)); \ - } \ -} -#define isp116x_show_regs(d,type,s) { \ - isp116x_show_reg_##type(d, HCREVISION, s); \ - isp116x_show_reg_##type(d, HCCONTROL, s); \ - isp116x_show_reg_##type(d, HCCMDSTAT, s); \ - isp116x_show_reg_##type(d, HCINTSTAT, s); \ - isp116x_show_reg_##type(d, HCINTENB, s); \ - isp116x_show_reg_##type(d, HCFMINTVL, s); \ - isp116x_show_reg_##type(d, HCFMREM, s); \ - isp116x_show_reg_##type(d, HCFMNUM, s); \ - isp116x_show_reg_##type(d, HCLSTHRESH, s); \ - isp116x_show_reg_##type(d, HCRHDESCA, s); \ - isp116x_show_reg_##type(d, HCRHDESCB, s); \ - isp116x_show_reg_##type(d, HCRHSTATUS, s); \ - isp116x_show_reg_##type(d, HCRHPORT1, s); \ - isp116x_show_reg_##type(d, HCRHPORT2, s); \ - isp116x_show_reg_##type(d, HCHWCFG, s); \ - isp116x_show_reg_##type(d, HCDMACFG, s); \ - isp116x_show_reg_##type(d, HCXFERCTR, s); \ - isp116x_show_reg_##type(d, HCuPINT, s); \ - isp116x_show_reg_##type(d, HCuPINTENB, s); \ - isp116x_show_reg_##type(d, HCCHIPID, s); \ - isp116x_show_reg_##type(d, HCSCRATCH, s); \ - isp116x_show_reg_##type(d, HCITLBUFLEN, s); \ - isp116x_show_reg_##type(d, HCATLBUFLEN, s); \ - isp116x_show_reg_##type(d, HCBUFSTAT, s); \ - isp116x_show_reg_##type(d, HCRDITL0LEN, s); \ - isp116x_show_reg_##type(d, HCRDITL1LEN, s); \ -} - -/* - Dump registers for debugfs. -*/ -static inline void isp116x_show_regs_seq(struct isp116x *isp116x, - struct seq_file *s) -{ - isp116x_show_regs(isp116x, seq, s); -} - -/* - Dump registers to syslog. -*/ -static inline void isp116x_show_regs_log(struct isp116x *isp116x) +static inline void isp116x_show_regs(struct isp116x *isp116x) { - isp116x_show_regs(isp116x, log, NULL); + isp116x_show_reg(isp116x, HCREVISION); + isp116x_show_reg(isp116x, HCCONTROL); + isp116x_show_reg(isp116x, HCCMDSTAT); + isp116x_show_reg(isp116x, HCINTSTAT); + isp116x_show_reg(isp116x, HCINTENB); + isp116x_show_reg(isp116x, HCFMINTVL); + isp116x_show_reg(isp116x, HCFMREM); + isp116x_show_reg(isp116x, HCFMNUM); + isp116x_show_reg(isp116x, HCLSTHRESH); + isp116x_show_reg(isp116x, HCRHDESCA); + isp116x_show_reg(isp116x, HCRHDESCB); + isp116x_show_reg(isp116x, HCRHSTATUS); + isp116x_show_reg(isp116x, HCRHPORT1); + isp116x_show_reg(isp116x, HCRHPORT2); + isp116x_show_reg(isp116x, HCHWCFG); + isp116x_show_reg(isp116x, HCDMACFG); + isp116x_show_reg(isp116x, HCXFERCTR); + isp116x_show_reg(isp116x, HCuPINT); + isp116x_show_reg(isp116x, HCuPINTENB); + isp116x_show_reg(isp116x, HCCHIPID); + isp116x_show_reg(isp116x, HCSCRATCH); + isp116x_show_reg(isp116x, HCITLBUFLEN); + isp116x_show_reg(isp116x, HCATLBUFLEN); + isp116x_show_reg(isp116x, HCBUFSTAT); + isp116x_show_reg(isp116x, HCRDITL0LEN); + isp116x_show_reg(isp116x, HCRDITL1LEN); } #if defined(URB_TRACE) diff --git a/trunk/drivers/usb/host/ohci-hcd.c b/trunk/drivers/usb/host/ohci-hcd.c index a4b12404ae08..5c0c6c8a7a82 100644 --- a/trunk/drivers/usb/host/ohci-hcd.c +++ b/trunk/drivers/usb/host/ohci-hcd.c @@ -75,6 +75,13 @@ */ #include + +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#else +# undef DEBUG +#endif + #include #include #include @@ -108,7 +115,7 @@ /*-------------------------------------------------------------------------*/ -#undef OHCI_VERBOSE_DEBUG /* not always helpful */ +// #define OHCI_VERBOSE_DEBUG /* not always helpful */ /* For initializing controller (mask in an HCFS mode too) */ #define OHCI_CONTROL_INIT OHCI_CTRL_CBSR @@ -246,10 +253,6 @@ static int ohci_urb_enqueue ( spin_lock_irqsave (&ohci->lock, flags); /* don't submit to a dead HC */ - if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) { - retval = -ENODEV; - goto fail; - } if (!HC_IS_RUNNING(hcd->state)) { retval = -ENODEV; goto fail; @@ -795,6 +798,7 @@ static int ohci_restart (struct ohci_hcd *ohci) int temp; int i; struct urb_priv *priv; + struct usb_device *root = ohci_to_hcd(ohci)->self.root_hub; /* mark any devices gone, so they do nothing till khubd disconnects. * recycle any "live" eds/tds (and urbs) right away. @@ -803,7 +807,11 @@ static int ohci_restart (struct ohci_hcd *ohci) */ spin_lock_irq(&ohci->lock); disable (ohci); - usb_root_hub_lost_power(ohci_to_hcd(ohci)->self.root_hub); + for (i = 0; i < root->maxchild; i++) { + if (root->children [i]) + usb_set_device_state (root->children[i], + USB_STATE_NOTATTACHED); + } if (!list_empty (&ohci->pending)) ohci_dbg(ohci, "abort schedule...\n"); list_for_each_entry (priv, &ohci->pending, pending) { diff --git a/trunk/drivers/usb/host/ohci-hub.c b/trunk/drivers/usb/host/ohci-hub.c index 4b2226d77b34..e01e77bc324b 100644 --- a/trunk/drivers/usb/host/ohci-hub.c +++ b/trunk/drivers/usb/host/ohci-hub.c @@ -53,11 +53,6 @@ static int ohci_bus_suspend (struct usb_hcd *hcd) spin_lock_irqsave (&ohci->lock, flags); - if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) { - spin_unlock_irqrestore (&ohci->lock, flags); - return -ESHUTDOWN; - } - ohci->hc_control = ohci_readl (ohci, &ohci->regs->control); switch (ohci->hc_control & OHCI_CTRL_HCFS) { case OHCI_USB_RESUME: @@ -145,19 +140,11 @@ static int ohci_bus_resume (struct usb_hcd *hcd) struct ohci_hcd *ohci = hcd_to_ohci (hcd); u32 temp, enables; int status = -EINPROGRESS; - unsigned long flags; if (time_before (jiffies, ohci->next_statechange)) msleep(5); - spin_lock_irqsave (&ohci->lock, flags); - - if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) { - spin_unlock_irqrestore (&ohci->lock, flags); - return -ESHUTDOWN; - } - - + spin_lock_irq (&ohci->lock); ohci->hc_control = ohci_readl (ohci, &ohci->regs->control); if (ohci->hc_control & (OHCI_CTRL_IR | OHCI_SCHED_ENABLES)) { @@ -192,7 +179,7 @@ static int ohci_bus_resume (struct usb_hcd *hcd) ohci_dbg (ohci, "lost power\n"); status = -EBUSY; } - spin_unlock_irqrestore (&ohci->lock, flags); + spin_unlock_irq (&ohci->lock); if (status == -EBUSY) { (void) ohci_init (ohci); return ohci_restart (ohci); @@ -310,8 +297,8 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf) /* handle autosuspended root: finish resuming before * letting khubd or root hub timer see state changes. */ - if (unlikely((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER - || !HC_IS_RUNNING(hcd->state))) { + if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER + || !HC_IS_RUNNING(hcd->state)) { can_suspend = 0; goto done; } @@ -372,7 +359,7 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf) & ohci->hc_control) == OHCI_USB_OPER && time_after (jiffies, ohci->next_statechange) - && usb_trylock_device (hcd->self.root_hub) == 0 + && usb_trylock_device (hcd->self.root_hub) ) { ohci_vdbg (ohci, "autosuspend\n"); (void) ohci_bus_suspend (hcd); @@ -521,9 +508,6 @@ static int ohci_hub_control ( u32 temp; int retval = 0; - if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) - return -ESHUTDOWN; - switch (typeReq) { case ClearHubFeature: switch (wValue) { diff --git a/trunk/drivers/usb/host/ohci-lh7a404.c b/trunk/drivers/usb/host/ohci-lh7a404.c index 3959ccc88332..081ec3f5cff4 100644 --- a/trunk/drivers/usb/host/ohci-lh7a404.c +++ b/trunk/drivers/usb/host/ohci-lh7a404.c @@ -219,7 +219,7 @@ static int ohci_hcd_lh7a404_drv_probe(struct platform_device *pdev) static int ohci_hcd_lh7a404_drv_remove(struct platform_device *pdev) { - struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct usb_hcd *hcd = platform_get_drvdata(dev); usb_hcd_lh7a404_remove(hcd, pdev); return 0; diff --git a/trunk/drivers/usb/host/ohci-pci.c b/trunk/drivers/usb/host/ohci-pci.c index 1b09dde068e1..a59e536441e1 100644 --- a/trunk/drivers/usb/host/ohci-pci.c +++ b/trunk/drivers/usb/host/ohci-pci.c @@ -14,6 +14,15 @@ * This file is licenced under the GPL. */ +#include + +#ifdef CONFIG_PPC_PMAC +#include +#include +#include +#include +#endif + #ifndef CONFIG_PCI #error "This file is PCI bus glue. CONFIG_PCI must be defined." #endif @@ -105,36 +114,40 @@ ohci_pci_start (struct usb_hcd *hcd) static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message) { - struct ohci_hcd *ohci = hcd_to_ohci (hcd); - unsigned long flags; - int rc = 0; - - /* Root hub was already suspended. Disable irq emission and - * mark HW unaccessible, bail out if RH has been resumed. Use - * the spinlock to properly synchronize with possible pending - * RH suspend or resume activity. - * - * This is still racy as hcd->state is manipulated outside of - * any locks =P But that will be a different fix. + /* root hub was already suspended */ + + /* FIXME these PMAC things get called in the wrong places. ASIC + * clocks should be turned off AFTER entering D3, and on BEFORE + * trying to enter D0. Evidently the PCI layer doesn't currently + * provide the right sort of platform hooks for this ... */ - spin_lock_irqsave (&ohci->lock, flags); - if (hcd->state != HC_STATE_SUSPENDED) { - rc = -EINVAL; - goto bail; +#ifdef CONFIG_PPC_PMAC + if (_machine == _MACH_Pmac) { + struct device_node *of_node; + + /* Disable USB PAD & cell clock */ + of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller)); + if (of_node) + pmac_call_feature(PMAC_FTR_USB_ENABLE, of_node, 0, 0); } - ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); - (void)ohci_readl(ohci, &ohci->regs->intrdisable); - clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); - bail: - spin_unlock_irqrestore (&ohci->lock, flags); - - return rc; +#endif /* CONFIG_PPC_PMAC */ + return 0; } static int ohci_pci_resume (struct usb_hcd *hcd) { - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); +#ifdef CONFIG_PPC_PMAC + if (_machine == _MACH_Pmac) { + struct device_node *of_node; + + /* Re-enable USB PAD & cell clock */ + of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller)); + if (of_node) + pmac_call_feature (PMAC_FTR_USB_ENABLE, of_node, 0, 1); + } +#endif /* CONFIG_PPC_PMAC */ + usb_hcd_resume_root_hub(hcd); return 0; } diff --git a/trunk/drivers/usb/host/ohci-ppc-soc.c b/trunk/drivers/usb/host/ohci-ppc-soc.c index 2ec6a78bd65e..18755766e406 100644 --- a/trunk/drivers/usb/host/ohci-ppc-soc.c +++ b/trunk/drivers/usb/host/ohci-ppc-soc.c @@ -185,7 +185,7 @@ static int ohci_hcd_ppc_soc_drv_probe(struct platform_device *pdev) static int ohci_hcd_ppc_soc_drv_remove(struct platform_device *pdev) { - struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct usb_hcd *hcd = platform_get_drvdata(dev); usb_hcd_ppc_soc_remove(hcd, pdev); return 0; diff --git a/trunk/drivers/usb/host/ohci-pxa27x.c b/trunk/drivers/usb/host/ohci-pxa27x.c index acde8868da21..9d65ec307990 100644 --- a/trunk/drivers/usb/host/ohci-pxa27x.c +++ b/trunk/drivers/usb/host/ohci-pxa27x.c @@ -26,12 +26,18 @@ #include #include #include -#include + + +#define PMM_NPS_MODE 1 +#define PMM_GLOBAL_MODE 2 +#define PMM_PERPORT_MODE 3 #define PXA_UHC_MAX_PORTNUM 3 #define UHCRHPS(x) __REG2( 0x4C000050, (x)<<2 ) +static int pxa27x_ohci_pmm_state; + /* PMM_NPS_MODE -- PMM Non-power switching mode Ports are powered continuously. @@ -44,6 +50,8 @@ */ static int pxa27x_ohci_select_pmm( int mode ) { + pxa27x_ohci_pmm_state = mode; + switch ( mode ) { case PMM_NPS_MODE: UHCRHDA |= RH_A_NPS; @@ -63,6 +71,7 @@ static int pxa27x_ohci_select_pmm( int mode ) "Invalid mode %d, set to non-power switch mode.\n", mode ); + pxa27x_ohci_pmm_state = PMM_NPS_MODE; UHCRHDA |= RH_A_NPS; } @@ -73,13 +82,8 @@ extern int usb_disabled(void); /*-------------------------------------------------------------------------*/ -static int pxa27x_start_hc(struct device *dev) +static void pxa27x_start_hc(struct platform_device *dev) { - int retval = 0; - struct pxaohci_platform_data *inf; - - inf = dev->platform_data; - pxa_set_cken(CKEN10_USBHOST, 1); UHCHR |= UHCHR_FHR; @@ -90,11 +94,21 @@ static int pxa27x_start_hc(struct device *dev) while (UHCHR & UHCHR_FSBIR) cpu_relax(); - if (inf->init) - retval = inf->init(dev); + /* This could be properly abstracted away through the + device data the day more machines are supported and + their differences can be figured out correctly. */ + if (machine_is_mainstone()) { + /* setup Port1 GPIO pin. */ + pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */ + pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */ - if (retval < 0) - return retval; + /* Set the Power Control Polarity Low and Power Sense + Polarity Low to active low. Supply power to USB ports. */ + UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) & + ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE); + + pxa27x_ohci_pmm_state = PMM_PERPORT_MODE; + } UHCHR &= ~UHCHR_SSE; @@ -103,19 +117,10 @@ static int pxa27x_start_hc(struct device *dev) /* Clear any OTG Pin Hold */ if (PSSR & PSSR_OTGPH) PSSR |= PSSR_OTGPH; - - return 0; } -static void pxa27x_stop_hc(struct device *dev) +static void pxa27x_stop_hc(struct platform_device *dev) { - struct pxaohci_platform_data *inf; - - inf = dev->platform_data; - - if (inf->exit) - inf->exit(dev); - UHCHR |= UHCHR_FHR; udelay(11); UHCHR &= ~UHCHR_FHR; @@ -142,27 +147,22 @@ static void pxa27x_stop_hc(struct device *dev) * through the hotplug entry's driver_data. * */ -int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device *pdev) +int usb_hcd_pxa27x_probe (const struct hc_driver *driver, + struct platform_device *dev) { int retval; struct usb_hcd *hcd; - struct pxaohci_platform_data *inf; - inf = pdev->dev.platform_data; - - if (!inf) - return -ENODEV; - - if (pdev->resource[1].flags != IORESOURCE_IRQ) { + if (dev->resource[1].flags != IORESOURCE_IRQ) { pr_debug ("resource[1] is not IORESOURCE_IRQ"); return -ENOMEM; } - hcd = usb_create_hcd (driver, &pdev->dev, "pxa27x"); + hcd = usb_create_hcd (driver, &dev->dev, "pxa27x"); if (!hcd) return -ENOMEM; - hcd->rsrc_start = pdev->resource[0].start; - hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1; + hcd->rsrc_start = dev->resource[0].start; + hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1; if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { pr_debug("request_mem_region failed"); @@ -177,22 +177,18 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device goto err2; } - if ((retval = pxa27x_start_hc(&pdev->dev)) < 0) { - pr_debug("pxa27x_start_hc failed"); - goto err3; - } + pxa27x_start_hc(dev); /* Select Power Management Mode */ - pxa27x_ohci_select_pmm(inf->port_mode); + pxa27x_ohci_select_pmm(pxa27x_ohci_pmm_state); ohci_hcd_init(hcd_to_ohci(hcd)); - retval = usb_add_hcd(hcd, pdev->resource[1].start, SA_INTERRUPT); + retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT); if (retval == 0) return retval; - pxa27x_stop_hc(&pdev->dev); - err3: + pxa27x_stop_hc(dev); iounmap(hcd->regs); err2: release_mem_region(hcd->rsrc_start, hcd->rsrc_len); @@ -215,10 +211,10 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device * context, normally "rmmod", "apmd", or something similar. * */ -void usb_hcd_pxa27x_remove (struct usb_hcd *hcd, struct platform_device *pdev) +void usb_hcd_pxa27x_remove (struct usb_hcd *hcd, struct platform_device *dev) { usb_remove_hcd(hcd); - pxa27x_stop_hc(&pdev->dev); + pxa27x_stop_hc(dev); iounmap(hcd->regs); release_mem_region(hcd->rsrc_start, hcd->rsrc_len); usb_put_hcd(hcd); @@ -296,12 +292,15 @@ static const struct hc_driver ohci_pxa27x_hc_driver = { static int ohci_hcd_pxa27x_drv_probe(struct platform_device *pdev) { + int ret; + pr_debug ("In ohci_hcd_pxa27x_drv_probe"); if (usb_disabled()) return -ENODEV; - return usb_hcd_pxa27x_probe(&ohci_pxa27x_hc_driver, pdev); + ret = usb_hcd_pxa27x_probe(&ohci_pxa27x_hc_driver, pdev); + return ret; } static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev) @@ -309,55 +308,31 @@ static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev) struct usb_hcd *hcd = platform_get_drvdata(pdev); usb_hcd_pxa27x_remove(hcd, pdev); - platform_set_drvdata(pdev, NULL); return 0; } -#ifdef CONFIG_PM -static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_t state) +static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *dev, pm_message_t state) { - struct usb_hcd *hcd = platform_get_drvdata(pdev); - struct ohci_hcd *ohci = hcd_to_ohci(hcd); - - if (time_before(jiffies, ohci->next_statechange)) - msleep(5); - ohci->next_statechange = jiffies; - - pxa27x_stop_hc(&pdev->dev); - hcd->state = HC_STATE_SUSPENDED; - pdev->dev.power.power_state = PMSG_SUSPEND; +// struct usb_hcd *hcd = platform_get_drvdata(dev); + printk("%s: not implemented yet\n", __FUNCTION__); return 0; } -static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev) +static int ohci_hcd_pxa27x_drv_resume(struct platform_device *dev) { - struct usb_hcd *hcd = platform_get_drvdata(pdev); - struct ohci_hcd *ohci = hcd_to_ohci(hcd); - int status; - - if (time_before(jiffies, ohci->next_statechange)) - msleep(5); - ohci->next_statechange = jiffies; - - if ((status = pxa27x_start_hc(&pdev->dev)) < 0) - return status; - - pdev->dev.power.power_state = PMSG_ON; - usb_hcd_resume_root_hub(hcd); +// struct usb_hcd *hcd = platform_get_drvdata(dev); + printk("%s: not implemented yet\n", __FUNCTION__); return 0; } -#endif static struct platform_driver ohci_hcd_pxa27x_driver = { .probe = ohci_hcd_pxa27x_drv_probe, .remove = ohci_hcd_pxa27x_drv_remove, -#ifdef CONFIG_PM .suspend = ohci_hcd_pxa27x_drv_suspend, .resume = ohci_hcd_pxa27x_drv_resume, -#endif .driver = { .name = "pxa27x-ohci", }, diff --git a/trunk/drivers/usb/host/pci-quirks.c b/trunk/drivers/usb/host/pci-quirks.c index 3ef2c0cdf1db..e46528c825bf 100644 --- a/trunk/drivers/usb/host/pci-quirks.c +++ b/trunk/drivers/usb/host/pci-quirks.c @@ -9,6 +9,12 @@ */ #include +#ifdef CONFIG_USB_DEBUG +#define DEBUG +#else +#undef DEBUG +#endif + #include #include #include diff --git a/trunk/drivers/usb/host/sl811-hcd.c b/trunk/drivers/usb/host/sl811-hcd.c index 517360b77d8e..a7722a6a5a5b 100644 --- a/trunk/drivers/usb/host/sl811-hcd.c +++ b/trunk/drivers/usb/host/sl811-hcd.c @@ -32,6 +32,13 @@ #undef PACKET_TRACE #include + +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#else +# undef DEBUG +#endif + #include #include #include @@ -1574,9 +1581,7 @@ sl811h_start(struct usb_hcd *hcd) hcd->state = HC_STATE_RUNNING; if (sl811->board) { - if (!device_can_wakeup(hcd->self.controller)) - device_init_wakeup(hcd->self.controller, - sl811->board->can_wakeup); + hcd->can_wakeup = sl811->board->can_wakeup; hcd->power_budget = sl811->board->power * 2; } @@ -1800,10 +1805,9 @@ sl811h_resume(struct platform_device *dev) * let's assume it'd only be powered to enable remote wakeup. */ if (dev->dev.power.power_state.event == PM_EVENT_SUSPEND - || !device_can_wakeup(&hcd->self.root_hub->dev)) { + || !hcd->can_wakeup) { sl811->port1 = 0; port_power(sl811, 1); - usb_root_hub_lost_power(hcd->self.root_hub); return 0; } diff --git a/trunk/drivers/usb/host/sl811_cs.c b/trunk/drivers/usb/host/sl811_cs.c index 5056b7459994..e73faf831b24 100644 --- a/trunk/drivers/usb/host/sl811_cs.c +++ b/trunk/drivers/usb/host/sl811_cs.c @@ -38,7 +38,7 @@ MODULE_LICENSE("GPL"); /* MACROS */ /*====================================================================*/ -#if defined(DEBUG) || defined(PCMCIA_DEBUG) +#if defined(DEBUG) || defined(CONFIG_USB_DEBUG) || defined(PCMCIA_DEBUG) static int pc_debug = 0; module_param(pc_debug, int, 0644); @@ -129,8 +129,7 @@ static int sl811_hc_init(struct device *parent, ioaddr_t base_addr, int irq) resources[2].end = base_addr + 1; /* The driver core will probe for us. We know sl811-hcd has been - * initialized already because of the link order dependency created - * by referencing "sl811h_driver". + * initialized already because of the link order dependency. */ platform_dev.name = sl811h_driver.name; return platform_device_register(&platform_dev); diff --git a/trunk/drivers/usb/host/uhci-debug.c b/trunk/drivers/usb/host/uhci-debug.c index 5832953086f8..151154df37fa 100644 --- a/trunk/drivers/usb/host/uhci-debug.c +++ b/trunk/drivers/usb/host/uhci-debug.c @@ -2,8 +2,8 @@ * UHCI-specific debugging code. Invaluable when something * goes wrong, but don't get in my face. * - * Kernel visible pointers are surrounded in []s and bus - * visible pointers are surrounded in ()s + * Kernel visible pointers are surrounded in []'s and bus + * visible pointers are surrounded in ()'s * * (C) Copyright 1999 Linus Torvalds * (C) Copyright 1999-2001 Johannes Erdfelt @@ -19,7 +19,7 @@ static struct dentry *uhci_debugfs_root = NULL; -/* Handle REALLY large printks so we don't overflow buffers */ +/* Handle REALLY large printk's so we don't overflow buffers */ static inline void lprintk(char *buf) { char *p; @@ -160,7 +160,7 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space) } if (active && ni > i) { - out += sprintf(out, "%*s[skipped %d active TDs]\n", space, "", ni - i); + out += sprintf(out, "%*s[skipped %d active TD's]\n", space, "", ni - i); tmp = ntmp; td = ntd; i = ni; @@ -173,7 +173,7 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space) if (list_empty(&urbp->queue_list) || urbp->queued) goto out; - out += sprintf(out, "%*sQueued QHs:\n", -space, "--"); + out += sprintf(out, "%*sQueued QH's:\n", -space, "--"); head = &urbp->queue_list; tmp = head->next; @@ -197,7 +197,7 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space) } #ifdef CONFIG_PROC_FS -static const char * const qh_names[] = { +static const char *qh_names[] = { "skel_int128_qh", "skel_int64_qh", "skel_int32_qh", "skel_int16_qh", "skel_int8_qh", "skel_int4_qh", @@ -464,7 +464,7 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) } while (tmp != head); } - out += sprintf(out, "Skeleton QHs\n"); + out += sprintf(out, "Skeleton QH's\n"); for (i = 0; i < UHCI_NUM_SKELQH; ++i) { int shown = 0; diff --git a/trunk/drivers/usb/host/uhci-hcd.c b/trunk/drivers/usb/host/uhci-hcd.c index dfe121d35887..d33ce3982a5f 100644 --- a/trunk/drivers/usb/host/uhci-hcd.c +++ b/trunk/drivers/usb/host/uhci-hcd.c @@ -23,6 +23,11 @@ */ #include +#ifdef CONFIG_USB_DEBUG +#define DEBUG +#else +#undef DEBUG +#endif #include #include #include @@ -62,10 +67,10 @@ Alan Stern" /* * debug = 0, no debugging messages - * debug = 1, dump failed URBs except for stalls - * debug = 2, dump all failed URBs (including stalls) + * debug = 1, dump failed URB's except for stalls + * debug = 2, dump all failed URB's (including stalls) * show all queues in /debug/uhci/[pci_addr] - * debug = 3, show all TDs in URBs when dumping + * debug = 3, show all TD's in URB's when dumping */ #ifdef DEBUG static int debug = 1; @@ -88,7 +93,7 @@ static void uhci_get_current_frame_number(struct uhci_hcd *uhci); #define FSBR_DELAY msecs_to_jiffies(50) /* When we timeout an idle transfer for FSBR, we'll switch it over to */ -/* depth first traversal. We'll do it in groups of this number of TDs */ +/* depth first traversal. We'll do it in groups of this number of TD's */ /* to make sure it doesn't hog all of the bandwidth */ #define DEPTH_INTERVAL 5 @@ -473,6 +478,8 @@ static int uhci_start(struct usb_hcd *hcd) struct dentry *dentry; hcd->uses_new_polling = 1; + if (pci_find_capability(to_pci_dev(uhci_dev(uhci)), PCI_CAP_ID_PM)) + hcd->can_wakeup = 1; /* Assume it supports PME# */ dentry = debugfs_create_file(hcd->self.bus_name, S_IFREG|S_IRUGO|S_IWUSR, uhci_debugfs_root, uhci, @@ -566,7 +573,7 @@ static int uhci_start(struct usb_hcd *hcd) uhci->skel_bulk_qh->link = cpu_to_le32(uhci->skel_term_qh->dma_handle) | UHCI_PTR_QH; /* This dummy TD is to work around a bug in Intel PIIX controllers */ - uhci_fill_td(uhci->term_td, 0, uhci_explen(0) | + uhci_fill_td(uhci->term_td, 0, (UHCI_NULL_DATA_SIZE << 21) | (0x7f << TD_TOKEN_DEVADDR_SHIFT) | USB_PID_IN, 0); uhci->term_td->link = cpu_to_le32(uhci->term_td->dma_handle); @@ -710,8 +717,6 @@ static int uhci_suspend(struct usb_hcd *hcd, pm_message_t message) * at the source, so we must turn off PIRQ. */ pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP, 0); - mb(); - clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); uhci->hc_inaccessible = 1; hcd->poll_rh = 0; @@ -728,13 +733,6 @@ static int uhci_resume(struct usb_hcd *hcd) dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__); - /* Since we aren't in D3 any more, it's safe to set this flag - * even if the controller was dead. It might not even be dead - * any more, if the firmware or quirks code has reset it. - */ - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); - mb(); - if (uhci->rh_state == UHCI_RH_RESET) /* Dead */ return 0; spin_lock_irq(&uhci->lock); @@ -749,12 +747,8 @@ static int uhci_resume(struct usb_hcd *hcd) check_and_reset_hc(uhci); configure_hc(uhci); - if (uhci->rh_state == UHCI_RH_RESET) { - - /* The controller had to be reset */ - usb_root_hub_lost_power(hcd->self.root_hub); + if (uhci->rh_state == UHCI_RH_RESET) suspend_rh(uhci, UHCI_RH_SUSPENDED); - } spin_unlock_irq(&uhci->lock); @@ -880,7 +874,7 @@ static int __init uhci_hcd_init(void) init_failed: if (kmem_cache_destroy(uhci_up_cachep)) - warn("not all urb_privs were freed!"); + warn("not all urb_priv's were freed!"); up_failed: debugfs_remove(uhci_debugfs_root); @@ -898,7 +892,7 @@ static void __exit uhci_hcd_cleanup(void) pci_unregister_driver(&uhci_pci_driver); if (kmem_cache_destroy(uhci_up_cachep)) - warn("not all urb_privs were freed!"); + warn("not all urb_priv's were freed!"); debugfs_remove(uhci_debugfs_root); kfree(errbuf); diff --git a/trunk/drivers/usb/host/uhci-hcd.h b/trunk/drivers/usb/host/uhci-hcd.h index 8b4b887a7d41..e576db57a926 100644 --- a/trunk/drivers/usb/host/uhci-hcd.h +++ b/trunk/drivers/usb/host/uhci-hcd.h @@ -71,6 +71,8 @@ #define USBLEGSUP_RWC 0x8f00 /* the R/WC bits */ #define USBLEGSUP_RO 0x5040 /* R/O and reserved bits */ +#define UHCI_NULL_DATA_SIZE 0x7FF /* for UHCI controller TD */ + #define UHCI_PTR_BITS cpu_to_le32(0x000F) #define UHCI_PTR_TERM cpu_to_le32(0x0001) #define UHCI_PTR_QH cpu_to_le32(0x0002) @@ -166,11 +168,9 @@ static __le32 inline qh_element(struct uhci_qh *qh) { #define TD_TOKEN_EXPLEN_MASK 0x7FF /* expected length, encoded as n - 1 */ #define TD_TOKEN_PID_MASK 0xFF -#define uhci_explen(len) ((((len) - 1) & TD_TOKEN_EXPLEN_MASK) << \ - TD_TOKEN_EXPLEN_SHIFT) +#define uhci_explen(len) ((len) << TD_TOKEN_EXPLEN_SHIFT) -#define uhci_expected_length(token) ((((token) >> TD_TOKEN_EXPLEN_SHIFT) + \ - 1) & TD_TOKEN_EXPLEN_MASK) +#define uhci_expected_length(token) ((((token) >> 21) + 1) & TD_TOKEN_EXPLEN_MASK) #define uhci_toggle(token) (((token) >> TD_TOKEN_TOGGLE_SHIFT) & 1) #define uhci_endpoint(token) (((token) >> 15) & 0xf) #define uhci_devaddr(token) (((token) >> TD_TOKEN_DEVADDR_SHIFT) & 0x7f) @@ -223,10 +223,10 @@ static u32 inline td_status(struct uhci_td *td) { */ /* - * The UHCI driver places Interrupt, Control and Bulk into QHs both - * to group together TDs for one transfer, and also to facilitate queuing - * of URBs. To make it easy to insert entries into the schedule, we have - * a skeleton of QHs for each predefined Interrupt latency, low-speed + * The UHCI driver places Interrupt, Control and Bulk into QH's both + * to group together TD's for one transfer, and also to faciliate queuing + * of URB's. To make it easy to insert entries into the schedule, we have + * a skeleton of QH's for each predefined Interrupt latency, low-speed * control, full-speed control and terminating QH (see explanation for * the terminating QH below). * @@ -257,8 +257,8 @@ static u32 inline td_status(struct uhci_td *td) { * reclamation. * * Isochronous transfers are stored before the start of the skeleton - * schedule and don't use QHs. While the UHCI spec doesn't forbid the - * use of QHs for Isochronous, it doesn't use them either. And the spec + * schedule and don't use QH's. While the UHCI spec doesn't forbid the + * use of QH's for Isochronous, it doesn't use them either. And the spec * says that queues never advance on an error completion status, which * makes them totally unsuitable for Isochronous transfers. */ @@ -359,7 +359,7 @@ struct uhci_hcd { struct dma_pool *td_pool; struct uhci_td *term_td; /* Terminating TD, see UHCI bug */ - struct uhci_qh *skelqh[UHCI_NUM_SKELQH]; /* Skeleton QHs */ + struct uhci_qh *skelqh[UHCI_NUM_SKELQH]; /* Skeleton QH's */ spinlock_t lock; @@ -389,22 +389,22 @@ struct uhci_hcd { unsigned long resuming_ports; unsigned long ports_timeout; /* Time to stop signalling */ - /* Main list of URBs currently controlled by this HC */ + /* Main list of URB's currently controlled by this HC */ struct list_head urb_list; - /* List of QHs that are done, but waiting to be unlinked (race) */ + /* List of QH's that are done, but waiting to be unlinked (race) */ struct list_head qh_remove_list; unsigned int qh_remove_age; /* Age in frames */ - /* List of TDs that are done, but waiting to be freed (race) */ + /* List of TD's that are done, but waiting to be freed (race) */ struct list_head td_remove_list; unsigned int td_remove_age; /* Age in frames */ - /* List of asynchronously unlinked URBs */ + /* List of asynchronously unlinked URB's */ struct list_head urb_remove_list; unsigned int urb_remove_age; /* Age in frames */ - /* List of URBs awaiting completion callback */ + /* List of URB's awaiting completion callback */ struct list_head complete_list; int rh_numports; /* Number of root-hub ports */ diff --git a/trunk/drivers/usb/host/uhci-q.c b/trunk/drivers/usb/host/uhci-q.c index b6076004a437..7e46887d9e12 100644 --- a/trunk/drivers/usb/host/uhci-q.c +++ b/trunk/drivers/usb/host/uhci-q.c @@ -80,7 +80,7 @@ static inline void uhci_fill_td(struct uhci_td *td, u32 status, } /* - * We insert Isochronous URBs directly into the frame list at the beginning + * We insert Isochronous URB's directly into the frame list at the beginning */ static void uhci_insert_td_frame_list(struct uhci_hcd *uhci, struct uhci_td *td, unsigned framenum) { @@ -369,7 +369,7 @@ static void uhci_append_queued_urb(struct uhci_hcd *uhci, struct urb *eurb, stru uhci_fixup_toggle(urb, uhci_toggle(td_token(lltd)) ^ 1)); - /* All qhs in the queue need to link to the next queue */ + /* All qh's in the queue need to link to the next queue */ urbp->qh->link = eurbp->qh->link; wmb(); /* Make sure we flush everything */ @@ -502,7 +502,7 @@ static void uhci_destroy_urb_priv(struct uhci_hcd *uhci, struct urb *urb) } /* Check to see if the remove list is empty. Set the IOC bit */ - /* to force an interrupt so we can remove the TDs*/ + /* to force an interrupt so we can remove the TD's*/ if (list_empty(&uhci->td_remove_list)) uhci_set_next_interrupt(uhci); @@ -596,7 +596,7 @@ static int uhci_submit_control(struct uhci_hcd *uhci, struct urb *urb, struct ur return -ENOMEM; uhci_add_td_to_urb(urb, td); - uhci_fill_td(td, status, destination | uhci_explen(8), + uhci_fill_td(td, status, destination | uhci_explen(7), urb->setup_dma); /* @@ -612,7 +612,7 @@ static int uhci_submit_control(struct uhci_hcd *uhci, struct urb *urb, struct ur } /* - * Build the DATA TDs + * Build the DATA TD's */ while (len > 0) { int pktsze = len; @@ -628,7 +628,7 @@ static int uhci_submit_control(struct uhci_hcd *uhci, struct urb *urb, struct ur destination ^= TD_TOKEN_TOGGLE; uhci_add_td_to_urb(urb, td); - uhci_fill_td(td, status, destination | uhci_explen(pktsze), + uhci_fill_td(td, status, destination | uhci_explen(pktsze - 1), data); data += pktsze; @@ -658,7 +658,7 @@ static int uhci_submit_control(struct uhci_hcd *uhci, struct urb *urb, struct ur uhci_add_td_to_urb(urb, td); uhci_fill_td(td, status | TD_CTRL_IOC, - destination | uhci_explen(0), 0); + destination | uhci_explen(UHCI_NULL_DATA_SIZE), 0); qh = uhci_alloc_qh(uhci); if (!qh) @@ -744,7 +744,7 @@ static int uhci_result_control(struct uhci_hcd *uhci, struct urb *urb) urb->actual_length = 0; - /* The rest of the TDs (but the last) are data */ + /* The rest of the TD's (but the last) are data */ tmp = tmp->next; while (tmp != head && tmp->next != head) { unsigned int ctrlstat; @@ -848,7 +848,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb, struct urb status |= TD_CTRL_SPD; /* - * Build the DATA TDs + * Build the DATA TD's */ do { /* Allow zero length packets */ int pktsze = maxsze; @@ -864,7 +864,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb, struct urb return -ENOMEM; uhci_add_td_to_urb(urb, td); - uhci_fill_td(td, status, destination | uhci_explen(pktsze) | + uhci_fill_td(td, status, destination | uhci_explen(pktsze - 1) | (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE_SHIFT), data); @@ -890,7 +890,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb, struct urb return -ENOMEM; uhci_add_td_to_urb(urb, td); - uhci_fill_td(td, status, destination | uhci_explen(0) | + uhci_fill_td(td, status, destination | uhci_explen(UHCI_NULL_DATA_SIZE) | (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE_SHIFT), data); @@ -1025,7 +1025,7 @@ static int isochronous_find_limits(struct uhci_hcd *uhci, struct urb *urb, unsig list_for_each_entry(up, &uhci->urb_list, urb_list) { struct urb *u = up->urb; - /* look for pending URBs with identical pipe handle */ + /* look for pending URB's with identical pipe handle */ if ((urb->pipe == u->pipe) && (urb->dev == u->dev) && (u->status == -EINPROGRESS) && (u != urb)) { if (!last_urb) @@ -1092,7 +1092,7 @@ static int uhci_submit_isochronous(struct uhci_hcd *uhci, struct urb *urb) return -ENOMEM; uhci_add_td_to_urb(urb, td); - uhci_fill_td(td, status, destination | uhci_explen(urb->iso_frame_desc[i].length), + uhci_fill_td(td, status, destination | uhci_explen(urb->iso_frame_desc[i].length - 1), urb->transfer_dma + urb->iso_frame_desc[i].offset); if (i + 1 >= urb->number_of_packets) @@ -1355,7 +1355,7 @@ static void uhci_unlink_generic(struct uhci_hcd *uhci, struct urb *urb) uhci_delete_queued_urb(uhci, urb); - /* The interrupt loop will reclaim the QHs */ + /* The interrupt loop will reclaim the QH's */ uhci_remove_qh(uhci, urbp->qh); urbp->qh = NULL; } @@ -1413,7 +1413,7 @@ static int uhci_fsbr_timeout(struct uhci_hcd *uhci, struct urb *urb) list_for_each_entry(td, head, list) { /* * Make sure we don't do the last one (since it'll have the - * TERM bit set) as well as we skip every so many TDs to + * TERM bit set) as well as we skip every so many TD's to * make sure it doesn't hog the bandwidth */ if (td->list.next != head && (count % DEPTH_INTERVAL) == diff --git a/trunk/drivers/usb/image/mdc800.c b/trunk/drivers/usb/image/mdc800.c index 049871145d63..1d973bcf56aa 100644 --- a/trunk/drivers/usb/image/mdc800.c +++ b/trunk/drivers/usb/image/mdc800.c @@ -962,6 +962,7 @@ MODULE_DEVICE_TABLE (usb, mdc800_table); */ static struct usb_driver mdc800_usb_driver = { + .owner = THIS_MODULE, .name = "mdc800", .probe = mdc800_usb_probe, .disconnect = mdc800_usb_disconnect, diff --git a/trunk/drivers/usb/image/microtek.c b/trunk/drivers/usb/image/microtek.c index 458f2acdeb0a..61a2604cce4f 100644 --- a/trunk/drivers/usb/image/microtek.c +++ b/trunk/drivers/usb/image/microtek.c @@ -160,6 +160,7 @@ static void mts_usb_disconnect(struct usb_interface *intf); static struct usb_device_id mts_usb_ids []; static struct usb_driver mts_usb_driver = { + .owner = THIS_MODULE, .name = "microtekX6", .probe = mts_usb_probe, .disconnect = mts_usb_disconnect, @@ -326,18 +327,6 @@ static inline void mts_urb_abort(struct mts_desc* desc) { usb_kill_urb( desc->urb ); } -static int mts_slave_alloc (struct scsi_device *s) -{ - s->inquiry_len = 0x24; - return 0; -} - -static int mts_slave_configure (struct scsi_device *s) -{ - blk_queue_dma_alignment(s->request_queue, (512 - 1)); - return 0; -} - static int mts_scsi_abort (Scsi_Cmnd *srb) { struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); @@ -422,7 +411,7 @@ static void mts_transfer_done( struct urb *transfer, struct pt_regs *regs ) MTS_INT_INIT(); context->srb->result &= MTS_SCSI_ERR_MASK; - context->srb->result |= (unsigned)(*context->scsi_status)<<1; + context->srb->result |= (unsigned)context->status<<1; mts_transfer_cleanup(transfer); @@ -438,7 +427,7 @@ static void mts_get_status( struct urb *transfer ) mts_int_submit_urb(transfer, usb_rcvbulkpipe(context->instance->usb_dev, context->instance->ep_response), - context->scsi_status, + &context->status, 1, mts_transfer_done ); } @@ -492,7 +481,7 @@ static void mts_command_done( struct urb *transfer, struct pt_regs *regs ) context->data_pipe, context->data, context->data_length, - context->srb->use_sg > 1 ? mts_do_sg : mts_data_done); + context->srb->use_sg ? mts_do_sg : mts_data_done); } else { mts_get_status(transfer); } @@ -638,6 +627,7 @@ int mts_scsi_queuecommand( Scsi_Cmnd *srb, mts_scsi_cmnd_callback callback ) callback(srb); } + out: return err; } @@ -655,9 +645,6 @@ static struct scsi_host_template mts_scsi_host_template = { .cmd_per_lun = 1, .use_clustering = 1, .emulated = 1, - .slave_alloc = mts_slave_alloc, - .slave_configure = mts_slave_configure, - .max_sectors= 256, /* 128 K */ }; struct vendor_product @@ -784,8 +771,8 @@ static int mts_usb_probe(struct usb_interface *intf, MTS_WARNING( "couldn't find an output bulk endpoint. Bailing out.\n" ); return -ENODEV; } - - + + new_desc = kzalloc(sizeof(struct mts_desc), GFP_KERNEL); if (!new_desc) goto out; @@ -794,10 +781,6 @@ static int mts_usb_probe(struct usb_interface *intf, if (!new_desc->urb) goto out_kfree; - new_desc->context.scsi_status = kmalloc(1, GFP_KERNEL); - if (!new_desc->context.scsi_status) - goto out_kfree2; - new_desc->usb_dev = dev; new_desc->usb_intf = intf; init_MUTEX(&new_desc->lock); @@ -834,8 +817,6 @@ static int mts_usb_probe(struct usb_interface *intf, usb_set_intfdata(intf, new_desc); return 0; - out_kfree2: - kfree(new_desc->context.scsi_status); out_free_urb: usb_free_urb(new_desc->urb); out_kfree: @@ -855,7 +836,6 @@ static void mts_usb_disconnect (struct usb_interface *intf) scsi_host_put(desc->host); usb_free_urb(desc->urb); - kfree(desc->context.scsi_status); kfree(desc); } @@ -876,3 +856,5 @@ module_exit(microtek_drv_exit); MODULE_AUTHOR( DRIVER_AUTHOR ); MODULE_DESCRIPTION( DRIVER_DESC ); MODULE_LICENSE("GPL"); + + diff --git a/trunk/drivers/usb/image/microtek.h b/trunk/drivers/usb/image/microtek.h index 926d4bdc6746..3271deb8c001 100644 --- a/trunk/drivers/usb/image/microtek.h +++ b/trunk/drivers/usb/image/microtek.h @@ -22,7 +22,7 @@ struct mts_transfer_context int data_pipe; int fragment; - u8 *scsi_status; /* status returned from ep_response after command completion */ + u8 status; /* status returned from ep_response after command completion */ }; diff --git a/trunk/drivers/usb/input/Kconfig b/trunk/drivers/usb/input/Kconfig index 509dd0a04c54..1e53934907c0 100644 --- a/trunk/drivers/usb/input/Kconfig +++ b/trunk/drivers/usb/input/Kconfig @@ -273,20 +273,6 @@ config USB_ATI_REMOTE To compile this driver as a module, choose M here: the module will be called ati_remote. -config USB_ATI_REMOTE2 - tristate "ATI / Philips USB RF remote control" - depends on USB && INPUT - ---help--- - Say Y here if you want to use an ATI or Philips USB RF remote control. - These are RF remotes with USB receivers. - ATI Remote Wonder II comes with some ATI's All-In-Wonder video cards - and is also available as a separate product. - This driver provides mouse pointer, left and right mouse buttons, - and maps all the other remote buttons to keypress events. - - To compile this driver as a module, choose M here: the module will be - called ati_remote2. - config USB_KEYSPAN_REMOTE tristate "Keyspan DMR USB remote control (EXPERIMENTAL)" depends on USB && INPUT && EXPERIMENTAL diff --git a/trunk/drivers/usb/input/Makefile b/trunk/drivers/usb/input/Makefile index d512d9f488fe..5e03b93f29f6 100644 --- a/trunk/drivers/usb/input/Makefile +++ b/trunk/drivers/usb/input/Makefile @@ -28,7 +28,6 @@ endif obj-$(CONFIG_USB_AIPTEK) += aiptek.o obj-$(CONFIG_USB_ATI_REMOTE) += ati_remote.o -obj-$(CONFIG_USB_ATI_REMOTE2) += ati_remote2.o obj-$(CONFIG_USB_HID) += usbhid.o obj-$(CONFIG_USB_KBD) += usbkbd.o obj-$(CONFIG_USB_KBTAB) += kbtab.o @@ -43,7 +42,3 @@ obj-$(CONFIG_USB_ACECAD) += acecad.o obj-$(CONFIG_USB_YEALINK) += yealink.o obj-$(CONFIG_USB_XPAD) += xpad.o obj-$(CONFIG_USB_APPLETOUCH) += appletouch.o - -ifeq ($(CONFIG_USB_DEBUG),y) -EXTRA_CFLAGS += -DDEBUG -endif diff --git a/trunk/drivers/usb/input/acecad.c b/trunk/drivers/usb/input/acecad.c index df29b8078b54..a32558b4048e 100644 --- a/trunk/drivers/usb/input/acecad.c +++ b/trunk/drivers/usb/input/acecad.c @@ -261,6 +261,7 @@ static struct usb_device_id usb_acecad_id_table [] = { MODULE_DEVICE_TABLE(usb, usb_acecad_id_table); static struct usb_driver usb_acecad_driver = { + .owner = THIS_MODULE, .name = "usb_acecad", .probe = usb_acecad_probe, .disconnect = usb_acecad_disconnect, diff --git a/trunk/drivers/usb/input/aiptek.c b/trunk/drivers/usb/input/aiptek.c index a6693b0d1c4c..1c3b472a3bca 100644 --- a/trunk/drivers/usb/input/aiptek.c +++ b/trunk/drivers/usb/input/aiptek.c @@ -338,7 +338,7 @@ struct aiptek { * the bitmap which comes from the tablet. This hides the * issue that the F_keys are not sequentially numbered. */ -static const int macroKeyEvents[] = { +static int macroKeyEvents[] = { KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17, @@ -2093,7 +2093,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) /* Programming the tablet macro keys needs to be done with a for loop * as the keycodes are discontiguous. */ - for (i = 0; i < ARRAY_SIZE(macroKeyEvents); ++i) + for (i = 0; i < sizeof(macroKeyEvents) / sizeof(macroKeyEvents[0]); ++i) set_bit(macroKeyEvents[i], inputdev->keybit); /* @@ -2103,7 +2103,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) * values. */ input_set_abs_params(inputdev, ABS_X, 0, 2999, 0, 0); - input_set_abs_params(inputdev, ABS_Y, 0, 2249, 0, 0); + input_set_abs_params(inputdev, ABS_X, 0, 2249, 0, 0); input_set_abs_params(inputdev, ABS_PRESSURE, 0, 511, 0, 0); input_set_abs_params(inputdev, ABS_TILT_X, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0); input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0); @@ -2135,7 +2135,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) * not an error :-) */ - for (i = 0; i < ARRAY_SIZE(speeds); ++i) { + for (i = 0; i < sizeof(speeds) / sizeof(speeds[0]); ++i) { aiptek->curSetting.programmableDelay = speeds[i]; (void)aiptek_program_tablet(aiptek); if (aiptek->inputdev->absmax[ABS_X] > 0) { @@ -2190,6 +2190,7 @@ fail1: input_free_device(inputdev); static void aiptek_disconnect(struct usb_interface *intf); static struct usb_driver aiptek_driver = { + .owner = THIS_MODULE, .name = "aiptek", .probe = aiptek_probe, .disconnect = aiptek_disconnect, diff --git a/trunk/drivers/usb/input/appletouch.c b/trunk/drivers/usb/input/appletouch.c index 1949b54f41f2..15840db092a5 100644 --- a/trunk/drivers/usb/input/appletouch.c +++ b/trunk/drivers/usb/input/appletouch.c @@ -452,6 +452,7 @@ static int atp_resume(struct usb_interface *iface) } static struct usb_driver atp_driver = { + .owner = THIS_MODULE, .name = "appletouch", .probe = atp_probe, .disconnect = atp_disconnect, diff --git a/trunk/drivers/usb/input/ati_remote.c b/trunk/drivers/usb/input/ati_remote.c index f7bdc506e613..9a2a47db9494 100644 --- a/trunk/drivers/usb/input/ati_remote.c +++ b/trunk/drivers/usb/input/ati_remote.c @@ -96,7 +96,6 @@ #include #include #include -#include /* * Module and Version Information, Module Parameters @@ -147,7 +146,7 @@ static char init1[] = { 0x01, 0x00, 0x20, 0x14 }; static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 }; /* Acceleration curve for directional control pad */ -static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 }; +static char accel[] = { 1, 2, 4, 6, 9, 13, 20 }; /* Duplicate event filtering time. * Sequential, identical KIND_FILTERED inputs with less than @@ -198,7 +197,7 @@ struct ati_remote { #define KIND_ACCEL 7 /* Directional keypad - left, right, up, down.*/ /* Translation table from hardware messages to input events. */ -static const struct { +static struct { short kind; unsigned char data1, data2; int type; @@ -296,6 +295,7 @@ static void ati_remote_disconnect (struct usb_interface *interface); /* usb specific object to register with the usb subsystem */ static struct usb_driver ati_remote_driver = { + .owner = THIS_MODULE, .name = "ati_remote", .probe = ati_remote_probe, .disconnect = ati_remote_disconnect, @@ -472,7 +472,7 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs) /* Filter duplicate events which happen "too close" together. */ if ((ati_remote->old_data[0] == data[1]) && (ati_remote->old_data[1] == data[2]) && - time_before(jiffies, ati_remote->old_jiffies + FILTER_TIME)) { + ((ati_remote->old_jiffies + FILTER_TIME) > jiffies)) { ati_remote->repeat_count++; } else { ati_remote->repeat_count = 0; @@ -507,16 +507,16 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs) * pad down, so we increase acceleration, ramping up over two seconds to * a maximum speed. The acceleration curve is #defined above. */ - if (time_after(jiffies, ati_remote->old_jiffies + (HZ >> 2))) { + if ((jiffies - ati_remote->old_jiffies) > (HZ >> 2)) { acc = 1; ati_remote->acc_jiffies = jiffies; } - else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 3))) acc = accel[0]; - else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 2))) acc = accel[1]; - else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 1))) acc = accel[2]; - else if (time_before(jiffies, ati_remote->acc_jiffies + HZ)) acc = accel[3]; - else if (time_before(jiffies, ati_remote->acc_jiffies + HZ+(HZ>>1))) acc = accel[4]; - else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ << 1))) acc = accel[5]; + else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 3)) acc = accel[0]; + else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 2)) acc = accel[1]; + else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 1)) acc = accel[2]; + else if ((jiffies - ati_remote->acc_jiffies) < HZ ) acc = accel[3]; + else if ((jiffies - ati_remote->acc_jiffies) < HZ+(HZ>>1)) acc = accel[4]; + else if ((jiffies - ati_remote->acc_jiffies) < (HZ << 1)) acc = accel[5]; else acc = accel[6]; input_regs(dev, regs); diff --git a/trunk/drivers/usb/input/ati_remote2.c b/trunk/drivers/usb/input/ati_remote2.c deleted file mode 100644 index ab1a1ae24be9..000000000000 --- a/trunk/drivers/usb/input/ati_remote2.c +++ /dev/null @@ -1,477 +0,0 @@ -/* - * ati_remote2 - ATI/Philips USB RF remote driver - * - * Copyright (C) 2005 Ville Syrjala - * - * 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 - -#define DRIVER_DESC "ATI/Philips USB RF remote driver" -#define DRIVER_VERSION "0.1" - -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_VERSION(DRIVER_VERSION); -MODULE_AUTHOR("Ville Syrjala "); -MODULE_LICENSE("GPL"); - -static unsigned int mode_mask = 0x1F; -module_param(mode_mask, uint, 0644); -MODULE_PARM_DESC(mode_mask, "Bitmask of modes to accept <4:PC><3:AUX4><2:AUX3><1:AUX2><0:AUX1>"); - -static struct usb_device_id ati_remote2_id_table[] = { - { USB_DEVICE(0x0471, 0x0602) }, /* ATI Remote Wonder II */ - { } -}; -MODULE_DEVICE_TABLE(usb, ati_remote2_id_table); - -static struct { - int hw_code; - int key_code; -} ati_remote2_key_table[] = { - { 0x00, KEY_0 }, - { 0x01, KEY_1 }, - { 0x02, KEY_2 }, - { 0x03, KEY_3 }, - { 0x04, KEY_4 }, - { 0x05, KEY_5 }, - { 0x06, KEY_6 }, - { 0x07, KEY_7 }, - { 0x08, KEY_8 }, - { 0x09, KEY_9 }, - { 0x0c, KEY_POWER }, - { 0x0d, KEY_MUTE }, - { 0x10, KEY_VOLUMEUP }, - { 0x11, KEY_VOLUMEDOWN }, - { 0x20, KEY_CHANNELUP }, - { 0x21, KEY_CHANNELDOWN }, - { 0x28, KEY_FORWARD }, - { 0x29, KEY_REWIND }, - { 0x2c, KEY_PLAY }, - { 0x30, KEY_PAUSE }, - { 0x31, KEY_STOP }, - { 0x37, KEY_RECORD }, - { 0x38, KEY_DVD }, - { 0x39, KEY_TV }, - { 0x54, KEY_MENU }, - { 0x58, KEY_UP }, - { 0x59, KEY_DOWN }, - { 0x5a, KEY_LEFT }, - { 0x5b, KEY_RIGHT }, - { 0x5c, KEY_OK }, - { 0x78, KEY_A }, - { 0x79, KEY_B }, - { 0x7a, KEY_C }, - { 0x7b, KEY_D }, - { 0x7c, KEY_E }, - { 0x7d, KEY_F }, - { 0x82, KEY_ENTER }, - { 0x8e, KEY_VENDOR }, - { 0x96, KEY_COFFEE }, - { 0xa9, BTN_LEFT }, - { 0xaa, BTN_RIGHT }, - { 0xbe, KEY_QUESTION }, - { 0xd5, KEY_FRONT }, - { 0xd0, KEY_EDIT }, - { 0xf9, KEY_INFO }, - { (0x00 << 8) | 0x3f, KEY_PROG1 }, - { (0x01 << 8) | 0x3f, KEY_PROG2 }, - { (0x02 << 8) | 0x3f, KEY_PROG3 }, - { (0x03 << 8) | 0x3f, KEY_PROG4 }, - { (0x04 << 8) | 0x3f, KEY_PC }, - { 0, KEY_RESERVED } -}; - -struct ati_remote2 { - struct input_dev *idev; - struct usb_device *udev; - - struct usb_interface *intf[2]; - struct usb_endpoint_descriptor *ep[2]; - struct urb *urb[2]; - void *buf[2]; - dma_addr_t buf_dma[2]; - - unsigned long jiffies; - int mode; - - char name[64]; - char phys[64]; -}; - -static int ati_remote2_probe(struct usb_interface *interface, const struct usb_device_id *id); -static void ati_remote2_disconnect(struct usb_interface *interface); - -static struct usb_driver ati_remote2_driver = { - .name = "ati_remote2", - .probe = ati_remote2_probe, - .disconnect = ati_remote2_disconnect, - .id_table = ati_remote2_id_table, -}; - -static int ati_remote2_open(struct input_dev *idev) -{ - struct ati_remote2 *ar2 = idev->private; - int r; - - r = usb_submit_urb(ar2->urb[0], GFP_KERNEL); - if (r) { - dev_err(&ar2->intf[0]->dev, - "%s: usb_submit_urb() = %d\n", __FUNCTION__, r); - return r; - } - r = usb_submit_urb(ar2->urb[1], GFP_KERNEL); - if (r) { - usb_kill_urb(ar2->urb[0]); - dev_err(&ar2->intf[1]->dev, - "%s: usb_submit_urb() = %d\n", __FUNCTION__, r); - return r; - } - - return 0; -} - -static void ati_remote2_close(struct input_dev *idev) -{ - struct ati_remote2 *ar2 = idev->private; - - usb_kill_urb(ar2->urb[0]); - usb_kill_urb(ar2->urb[1]); -} - -static void ati_remote2_input_mouse(struct ati_remote2 *ar2, struct pt_regs *regs) -{ - struct input_dev *idev = ar2->idev; - u8 *data = ar2->buf[0]; - - if (data[0] > 4) { - dev_err(&ar2->intf[0]->dev, - "Unknown mode byte (%02x %02x %02x %02x)\n", - data[3], data[2], data[1], data[0]); - return; - } - - if (!((1 << data[0]) & mode_mask)) - return; - - input_regs(idev, regs); - input_event(idev, EV_REL, REL_X, (s8) data[1]); - input_event(idev, EV_REL, REL_Y, (s8) data[2]); - input_sync(idev); -} - -static int ati_remote2_lookup(unsigned int hw_code) -{ - int i; - - for (i = 0; ati_remote2_key_table[i].key_code != KEY_RESERVED; i++) - if (ati_remote2_key_table[i].hw_code == hw_code) - return i; - - return -1; -} - -static void ati_remote2_input_key(struct ati_remote2 *ar2, struct pt_regs *regs) -{ - struct input_dev *idev = ar2->idev; - u8 *data = ar2->buf[1]; - int hw_code, index; - - if (data[0] > 4) { - dev_err(&ar2->intf[1]->dev, - "Unknown mode byte (%02x %02x %02x %02x)\n", - data[3], data[2], data[1], data[0]); - return; - } - - hw_code = data[2]; - /* - * Mode keys (AUX1-AUX4, PC) all generate the same code byte. - * Use the mode byte to figure out which one was pressed. - */ - if (hw_code == 0x3f) { - /* - * For some incomprehensible reason the mouse pad generates - * events which look identical to the events from the last - * pressed mode key. Naturally we don't want to generate key - * events for the mouse pad so we filter out any subsequent - * events from the same mode key. - */ - if (ar2->mode == data[0]) - return; - - if (data[1] == 0) - ar2->mode = data[0]; - - hw_code |= data[0] << 8; - } - - if (!((1 << data[0]) & mode_mask)) - return; - - index = ati_remote2_lookup(hw_code); - if (index < 0) { - dev_err(&ar2->intf[1]->dev, - "Unknown code byte (%02x %02x %02x %02x)\n", - data[3], data[2], data[1], data[0]); - return; - } - - switch (data[1]) { - case 0: /* release */ - break; - case 1: /* press */ - ar2->jiffies = jiffies + msecs_to_jiffies(idev->rep[REP_DELAY]); - break; - case 2: /* repeat */ - - /* No repeat for mouse buttons. */ - if (ati_remote2_key_table[index].key_code == BTN_LEFT || - ati_remote2_key_table[index].key_code == BTN_RIGHT) - return; - - if (!time_after_eq(jiffies, ar2->jiffies)) - return; - - ar2->jiffies = jiffies + msecs_to_jiffies(idev->rep[REP_PERIOD]); - break; - default: - dev_err(&ar2->intf[1]->dev, - "Unknown state byte (%02x %02x %02x %02x)\n", - data[3], data[2], data[1], data[0]); - return; - } - - input_regs(idev, regs); - input_event(idev, EV_KEY, ati_remote2_key_table[index].key_code, data[1]); - input_sync(idev); -} - -static void ati_remote2_complete_mouse(struct urb *urb, struct pt_regs *regs) -{ - struct ati_remote2 *ar2 = urb->context; - int r; - - switch (urb->status) { - case 0: - ati_remote2_input_mouse(ar2, regs); - break; - case -ENOENT: - case -EILSEQ: - case -ECONNRESET: - case -ESHUTDOWN: - dev_dbg(&ar2->intf[0]->dev, - "%s(): urb status = %d\n", __FUNCTION__, urb->status); - return; - default: - dev_err(&ar2->intf[0]->dev, - "%s(): urb status = %d\n", __FUNCTION__, urb->status); - } - - r = usb_submit_urb(urb, GFP_ATOMIC); - if (r) - dev_err(&ar2->intf[0]->dev, - "%s(): usb_submit_urb() = %d\n", __FUNCTION__, r); -} - -static void ati_remote2_complete_key(struct urb *urb, struct pt_regs *regs) -{ - struct ati_remote2 *ar2 = urb->context; - int r; - - switch (urb->status) { - case 0: - ati_remote2_input_key(ar2, regs); - break; - case -ENOENT: - case -EILSEQ: - case -ECONNRESET: - case -ESHUTDOWN: - dev_dbg(&ar2->intf[1]->dev, - "%s(): urb status = %d\n", __FUNCTION__, urb->status); - return; - default: - dev_err(&ar2->intf[1]->dev, - "%s(): urb status = %d\n", __FUNCTION__, urb->status); - } - - r = usb_submit_urb(urb, GFP_ATOMIC); - if (r) - dev_err(&ar2->intf[1]->dev, - "%s(): usb_submit_urb() = %d\n", __FUNCTION__, r); -} - -static int ati_remote2_input_init(struct ati_remote2 *ar2) -{ - struct input_dev *idev; - int i; - - idev = input_allocate_device(); - if (!idev) - return -ENOMEM; - - ar2->idev = idev; - idev->private = ar2; - - idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_REL); - idev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT); - idev->relbit[0] = BIT(REL_X) | BIT(REL_Y); - for (i = 0; ati_remote2_key_table[i].key_code != KEY_RESERVED; i++) - set_bit(ati_remote2_key_table[i].key_code, idev->keybit); - - idev->rep[REP_DELAY] = 250; - idev->rep[REP_PERIOD] = 33; - - idev->open = ati_remote2_open; - idev->close = ati_remote2_close; - - idev->name = ar2->name; - idev->phys = ar2->phys; - - usb_to_input_id(ar2->udev, &idev->id); - idev->cdev.dev = &ar2->udev->dev; - - i = input_register_device(idev); - if (i) - input_free_device(idev); - - return i; -} - -static int ati_remote2_urb_init(struct ati_remote2 *ar2) -{ - struct usb_device *udev = ar2->udev; - int i, pipe, maxp; - - for (i = 0; i < 2; i++) { - ar2->buf[i] = usb_buffer_alloc(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]); - if (!ar2->buf[i]) - return -ENOMEM; - - ar2->urb[i] = usb_alloc_urb(0, GFP_KERNEL); - if (!ar2->urb[i]) - return -ENOMEM; - - pipe = usb_rcvintpipe(udev, ar2->ep[i]->bEndpointAddress); - maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); - maxp = maxp > 4 ? 4 : maxp; - - usb_fill_int_urb(ar2->urb[i], udev, pipe, ar2->buf[i], maxp, - i ? ati_remote2_complete_key : ati_remote2_complete_mouse, - ar2, ar2->ep[i]->bInterval); - ar2->urb[i]->transfer_dma = ar2->buf_dma[i]; - ar2->urb[i]->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - } - - return 0; -} - -static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2) -{ - int i; - - for (i = 0; i < 2; i++) { - if (ar2->urb[i]) - usb_free_urb(ar2->urb[i]); - - if (ar2->buf[i]) - usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]); - } -} - -static int ati_remote2_probe(struct usb_interface *interface, const struct usb_device_id *id) -{ - struct usb_device *udev = interface_to_usbdev(interface); - struct usb_host_interface *alt = interface->cur_altsetting; - struct ati_remote2 *ar2; - int r; - - if (alt->desc.bInterfaceNumber) - return -ENODEV; - - ar2 = kzalloc(sizeof (struct ati_remote2), GFP_KERNEL); - if (!ar2) - return -ENOMEM; - - ar2->udev = udev; - - ar2->intf[0] = interface; - ar2->ep[0] = &alt->endpoint[0].desc; - - ar2->intf[1] = usb_ifnum_to_if(udev, 1); - r = usb_driver_claim_interface(&ati_remote2_driver, ar2->intf[1], ar2); - if (r) - goto fail1; - alt = ar2->intf[1]->cur_altsetting; - ar2->ep[1] = &alt->endpoint[0].desc; - - r = ati_remote2_urb_init(ar2); - if (r) - goto fail2; - - usb_make_path(udev, ar2->phys, sizeof(ar2->phys)); - strlcat(ar2->phys, "/input0", sizeof(ar2->phys)); - - strlcat(ar2->name, "ATI Remote Wonder II", sizeof(ar2->name)); - - r = ati_remote2_input_init(ar2); - if (r) - goto fail2; - - usb_set_intfdata(interface, ar2); - - return 0; - - fail2: - ati_remote2_urb_cleanup(ar2); - - usb_driver_release_interface(&ati_remote2_driver, ar2->intf[1]); - fail1: - kfree(ar2); - - return r; -} - -static void ati_remote2_disconnect(struct usb_interface *interface) -{ - struct ati_remote2 *ar2; - struct usb_host_interface *alt = interface->cur_altsetting; - - if (alt->desc.bInterfaceNumber) - return; - - ar2 = usb_get_intfdata(interface); - usb_set_intfdata(interface, NULL); - - input_unregister_device(ar2->idev); - - ati_remote2_urb_cleanup(ar2); - - usb_driver_release_interface(&ati_remote2_driver, ar2->intf[1]); - - kfree(ar2); -} - -static int __init ati_remote2_init(void) -{ - int r; - - r = usb_register(&ati_remote2_driver); - if (r) - printk(KERN_ERR "ati_remote2: usb_register() = %d\n", r); - else - printk(KERN_INFO "ati_remote2: " DRIVER_DESC " " DRIVER_VERSION "\n"); - - return r; -} - -static void __exit ati_remote2_exit(void) -{ - usb_deregister(&ati_remote2_driver); -} - -module_init(ati_remote2_init); -module_exit(ati_remote2_exit); diff --git a/trunk/drivers/usb/input/fixp-arith.h b/trunk/drivers/usb/input/fixp-arith.h index b44d398de071..26ca5b890a61 100644 --- a/trunk/drivers/usb/input/fixp-arith.h +++ b/trunk/drivers/usb/input/fixp-arith.h @@ -38,7 +38,7 @@ typedef s16 fixp_t; #define FRAC_MASK ((1<size - 1) >> 3) + 1; - if (len < size) { + if (len < size) dbg("report %d is too short, (%d < %d)", report->id, len, size); - memset(data + len, 0, size - len); - } if (hid->claimed & HID_CLAIMED_HIDDEV) hiddev_report_event(hid, report); @@ -1320,7 +1318,6 @@ void hid_init_reports(struct hid_device *hid) #define USB_DEVICE_ID_WACOM_PTU 0x0003 #define USB_DEVICE_ID_WACOM_INTUOS3 0x00B0 #define USB_DEVICE_ID_WACOM_CINTIQ 0x003F -#define USB_DEVICE_ID_WACOM_DTF 0x00C0 #define USB_VENDOR_ID_ACECAD 0x0460 #define USB_DEVICE_ID_ACECAD_FLAIR 0x0004 @@ -1454,7 +1451,7 @@ void hid_init_reports(struct hid_device *hid) * Alphabetically sorted blacklist by quirk type. */ -static const struct hid_blacklist { +static struct hid_blacklist { __u16 idVendor; __u16 idProduct; unsigned quirks; @@ -1527,9 +1524,6 @@ static const struct hid_blacklist { { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 3, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 4, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 5, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 7, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 8, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 9, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 1, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 2, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 3, HID_QUIRK_IGNORE }, @@ -1537,19 +1531,11 @@ static const struct hid_blacklist { { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 5, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 7, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO + 1, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO + 2, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO + 3, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO + 4, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 5, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 6, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PTU, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 1, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 2, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 5, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_CINTIQ, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_DTF, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, @@ -1930,6 +1916,7 @@ static struct usb_device_id hid_usb_ids [] = { MODULE_DEVICE_TABLE (usb, hid_usb_ids); static struct usb_driver hid_driver = { + .owner = THIS_MODULE, .name = "usbhid", .probe = hid_probe, .disconnect = hid_disconnect, diff --git a/trunk/drivers/usb/input/hid-input.c b/trunk/drivers/usb/input/hid-input.c index 192a03b28971..9ff25eb520a6 100644 --- a/trunk/drivers/usb/input/hid-input.c +++ b/trunk/drivers/usb/input/hid-input.c @@ -39,7 +39,7 @@ #define unk KEY_UNKNOWN -static const unsigned char hid_keyboard[256] = { +static unsigned char hid_keyboard[256] = { 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57, 12, 13, 26, @@ -58,7 +58,7 @@ static const unsigned char hid_keyboard[256] = { 150,158,159,128,136,177,178,176,142,152,173,140,unk,unk,unk,unk }; -static const struct { +static struct { __s32 x; __s32 y; } hid_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}}; @@ -137,7 +137,6 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel switch (usage->hid & 0xffff) { case 0xba: map_abs(ABS_RUDDER); break; case 0xbb: map_abs(ABS_THROTTLE); break; - default: goto ignore; } break; diff --git a/trunk/drivers/usb/input/hiddev.c b/trunk/drivers/usb/input/hiddev.c index 4dff8473553d..440377c7a0da 100644 --- a/trunk/drivers/usb/input/hiddev.c +++ b/trunk/drivers/usb/input/hiddev.c @@ -826,6 +826,7 @@ static int hiddev_usbd_probe(struct usb_interface *intf, static /* const */ struct usb_driver hiddev_driver = { + .owner = THIS_MODULE, .name = "hiddev", .probe = hiddev_usbd_probe, }; diff --git a/trunk/drivers/usb/input/itmtouch.c b/trunk/drivers/usb/input/itmtouch.c index 7618ae5c104f..3b581853cf10 100644 --- a/trunk/drivers/usb/input/itmtouch.c +++ b/trunk/drivers/usb/input/itmtouch.c @@ -40,6 +40,13 @@ *****************************************************************************/ #include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include #include #include @@ -250,6 +257,7 @@ static void itmtouch_disconnect(struct usb_interface *intf) MODULE_DEVICE_TABLE(usb, itmtouch_ids); static struct usb_driver itmtouch_driver = { + .owner = THIS_MODULE, .name = "itmtouch", .probe = itmtouch_probe, .disconnect = itmtouch_disconnect, diff --git a/trunk/drivers/usb/input/kbtab.c b/trunk/drivers/usb/input/kbtab.c index f6d5cead542b..a248664b5d1d 100644 --- a/trunk/drivers/usb/input/kbtab.c +++ b/trunk/drivers/usb/input/kbtab.c @@ -159,7 +159,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH); input_dev->mscbit[0] |= BIT(MSC_SERIAL); input_set_abs_params(input_dev, ABS_X, 0, 0x2000, 4, 0); - input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0); + input_set_abs_params(input_dev, ABS_X, 0, 0x1750, 4, 0); input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0); endpoint = &intf->cur_altsetting->endpoint[0].desc; @@ -197,6 +197,7 @@ static void kbtab_disconnect(struct usb_interface *intf) } static struct usb_driver kbtab_driver = { + .owner = THIS_MODULE, .name = "kbtab", .probe = kbtab_probe, .disconnect = kbtab_disconnect, diff --git a/trunk/drivers/usb/input/keyspan_remote.c b/trunk/drivers/usb/input/keyspan_remote.c index b4a051b549d1..5b8d65f62abf 100644 --- a/trunk/drivers/usb/input/keyspan_remote.c +++ b/trunk/drivers/usb/input/keyspan_remote.c @@ -95,7 +95,7 @@ struct usb_keyspan { * Currently there are 15 and 17 button models so RESERVED codes * are blank areas in the mapping. */ -static const int keyspan_key_table[] = { +static int keyspan_key_table[] = { KEY_RESERVED, /* 0 is just a place holder. */ KEY_RESERVED, KEY_STOP, @@ -160,8 +160,7 @@ static int keyspan_load_tester(struct usb_keyspan* dev, int bits_needed) * though so it's not too big a deal */ if (dev->data.pos >= dev->data.len) { - dev_dbg(&dev->udev->dev, - "%s - Error ran out of data. pos: %d, len: %d\n", + dev_dbg(&dev->udev, "%s - Error ran out of data. pos: %d, len: %d\n", __FUNCTION__, dev->data.pos, dev->data.len); return -1; } @@ -307,7 +306,7 @@ static void keyspan_check_data(struct usb_keyspan *remote, struct pt_regs *regs) err("Bad message recieved, no stop bit found.\n"); } - dev_dbg(&remote->udev->dev, + dev_dbg(&remote->udev, "%s found valid message: system: %d, button: %d, toggle: %d\n", __FUNCTION__, message.system, message.button, message.toggle); @@ -559,6 +558,7 @@ static void keyspan_disconnect(struct usb_interface *interface) */ static struct usb_driver keyspan_driver = { + .owner = THIS_MODULE, .name = "keyspan_remote", .probe = keyspan_probe, .disconnect = keyspan_disconnect, diff --git a/trunk/drivers/usb/input/mtouchusb.c b/trunk/drivers/usb/input/mtouchusb.c index f018953a5485..7fce526560ca 100644 --- a/trunk/drivers/usb/input/mtouchusb.c +++ b/trunk/drivers/usb/input/mtouchusb.c @@ -40,6 +40,13 @@ *****************************************************************************/ #include + +#ifdef CONFIG_USB_DEBUG + #define DEBUG +#else + #undef DEBUG +#endif + #include #include #include @@ -310,6 +317,7 @@ static void mtouchusb_disconnect(struct usb_interface *intf) MODULE_DEVICE_TABLE(usb, mtouchusb_devices); static struct usb_driver mtouchusb_driver = { + .owner = THIS_MODULE, .name = "mtouchusb", .probe = mtouchusb_probe, .disconnect = mtouchusb_disconnect, diff --git a/trunk/drivers/usb/input/pid.c b/trunk/drivers/usb/input/pid.c index 19e015d171aa..dca5ee93a4ef 100644 --- a/trunk/drivers/usb/input/pid.c +++ b/trunk/drivers/usb/input/pid.c @@ -37,6 +37,8 @@ #include "hid.h" #include "pid.h" +#define DEBUG + #define CHECK_OWNERSHIP(i, hid_pid) \ ((i) < FF_EFFECTS_MAX && i >= 0 && \ test_bit(FF_PID_FLAGS_USED, &hid_pid->effects[(i)].flags) && \ diff --git a/trunk/drivers/usb/input/powermate.c b/trunk/drivers/usb/input/powermate.c index fdf0f788062c..b7476233ef5d 100644 --- a/trunk/drivers/usb/input/powermate.c +++ b/trunk/drivers/usb/input/powermate.c @@ -441,6 +441,7 @@ static struct usb_device_id powermate_devices [] = { MODULE_DEVICE_TABLE (usb, powermate_devices); static struct usb_driver powermate_driver = { + .owner = THIS_MODULE, .name = "powermate", .probe = powermate_probe, .disconnect = powermate_disconnect, diff --git a/trunk/drivers/usb/input/touchkitusb.c b/trunk/drivers/usb/input/touchkitusb.c index 3b3c7b4120a2..0043e6ebcd1f 100644 --- a/trunk/drivers/usb/input/touchkitusb.c +++ b/trunk/drivers/usb/input/touchkitusb.c @@ -1,7 +1,7 @@ /****************************************************************************** * touchkitusb.c -- Driver for eGalax TouchKit USB Touchscreens * - * Copyright (C) 2004-2005 by Daniel Ritz + * Copyright (C) 2004 by Daniel Ritz * Copyright (C) by Todd E. Johnson (mtouchusb.c) * * This program is free software; you can redistribute it and/or @@ -30,6 +30,10 @@ #include #include #include + +#if !defined(DEBUG) && defined(CONFIG_USB_DEBUG) +#define DEBUG +#endif #include #include @@ -41,13 +45,15 @@ #define TOUCHKIT_MAX_YC 0x07ff #define TOUCHKIT_YC_FUZZ 0x0 #define TOUCHKIT_YC_FLAT 0x0 -#define TOUCHKIT_REPORT_DATA_SIZE 16 +#define TOUCHKIT_REPORT_DATA_SIZE 8 #define TOUCHKIT_DOWN 0x01 +#define TOUCHKIT_POINT_TOUCH 0x81 +#define TOUCHKIT_POINT_NOTOUCH 0x80 -#define TOUCHKIT_PKT_TYPE_MASK 0xFE -#define TOUCHKIT_PKT_TYPE_REPT 0x80 -#define TOUCHKIT_PKT_TYPE_DIAG 0x0A +#define TOUCHKIT_GET_TOUCHED(dat) ((((dat)[0]) & TOUCHKIT_DOWN) ? 1 : 0) +#define TOUCHKIT_GET_X(dat) (((dat)[3] << 7) | (dat)[4]) +#define TOUCHKIT_GET_Y(dat) (((dat)[1] << 7) | (dat)[2]) #define DRIVER_VERSION "v0.1" #define DRIVER_AUTHOR "Daniel Ritz " @@ -60,8 +66,6 @@ MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped."); struct touchkit_usb { unsigned char *data; dma_addr_t data_dma; - char buffer[TOUCHKIT_REPORT_DATA_SIZE]; - int buf_len; struct urb *irq; struct usb_device *udev; struct input_dev *input; @@ -77,128 +81,11 @@ static struct usb_device_id touchkit_devices[] = { {} }; -/* helpers to read the data */ -static inline int touchkit_get_touched(char *data) -{ - return (data[0] & TOUCHKIT_DOWN) ? 1 : 0; -} - -static inline int touchkit_get_x(char *data) -{ - return ((data[3] & 0x0F) << 7) | (data[4] & 0x7F); -} - -static inline int touchkit_get_y(char *data) -{ - return ((data[1] & 0x0F) << 7) | (data[2] & 0x7F); -} - - -/* processes one input packet. */ -static void touchkit_process_pkt(struct touchkit_usb *touchkit, - struct pt_regs *regs, char *pkt) -{ - int x, y; - - /* only process report packets */ - if ((pkt[0] & TOUCHKIT_PKT_TYPE_MASK) != TOUCHKIT_PKT_TYPE_REPT) - return; - - if (swap_xy) { - y = touchkit_get_x(pkt); - x = touchkit_get_y(pkt); - } else { - x = touchkit_get_x(pkt); - y = touchkit_get_y(pkt); - } - - input_regs(touchkit->input, regs); - input_report_key(touchkit->input, BTN_TOUCH, touchkit_get_touched(pkt)); - input_report_abs(touchkit->input, ABS_X, x); - input_report_abs(touchkit->input, ABS_Y, y); - input_sync(touchkit->input); -} - - -static int touchkit_get_pkt_len(char *buf) -{ - switch (buf[0] & TOUCHKIT_PKT_TYPE_MASK) { - case TOUCHKIT_PKT_TYPE_REPT: - return 5; - - case TOUCHKIT_PKT_TYPE_DIAG: - return buf[1] + 2; - } - - return 0; -} - -static void touchkit_process(struct touchkit_usb *touchkit, int len, - struct pt_regs *regs) -{ - char *buffer; - int pkt_len, buf_len, pos; - - /* if the buffer contains data, append */ - if (unlikely(touchkit->buf_len)) { - int tmp; - - /* if only 1 byte in buffer, add another one to get length */ - if (touchkit->buf_len == 1) - touchkit->buffer[1] = touchkit->data[0]; - - pkt_len = touchkit_get_pkt_len(touchkit->buffer); - - /* unknown packet: drop everything */ - if (!pkt_len) - return; - - /* append, process */ - tmp = pkt_len - touchkit->buf_len; - memcpy(touchkit->buffer + touchkit->buf_len, touchkit->data, tmp); - touchkit_process_pkt(touchkit, regs, touchkit->buffer); - - buffer = touchkit->data + tmp; - buf_len = len - tmp; - } else { - buffer = touchkit->data; - buf_len = len; - } - - /* only one byte left in buffer */ - if (unlikely(buf_len == 1)) { - touchkit->buffer[0] = buffer[0]; - touchkit->buf_len = 1; - return; - } - - /* loop over the buffer */ - pos = 0; - while (pos < buf_len) { - /* get packet len */ - pkt_len = touchkit_get_pkt_len(buffer + pos); - - /* unknown packet: drop everything */ - if (unlikely(!pkt_len)) - return; - - /* full packet: process */ - if (likely(pkt_len <= buf_len)) { - touchkit_process_pkt(touchkit, regs, buffer + pos); - } else { - /* incomplete packet: save in buffer */ - memcpy(touchkit->buffer, buffer + pos, buf_len - pos); - touchkit->buf_len = buf_len - pos; - } - pos += pkt_len; - } -} - - static void touchkit_irq(struct urb *urb, struct pt_regs *regs) { struct touchkit_usb *touchkit = urb->context; int retval; + int x, y; switch (urb->status) { case 0: @@ -222,7 +109,20 @@ static void touchkit_irq(struct urb *urb, struct pt_regs *regs) goto exit; } - touchkit_process(touchkit, urb->actual_length, regs); + if (swap_xy) { + y = TOUCHKIT_GET_X(touchkit->data); + x = TOUCHKIT_GET_Y(touchkit->data); + } else { + x = TOUCHKIT_GET_X(touchkit->data); + y = TOUCHKIT_GET_Y(touchkit->data); + } + + input_regs(touchkit->input, regs); + input_report_key(touchkit->input, BTN_TOUCH, + TOUCHKIT_GET_TOUCHED(touchkit->data)); + input_report_abs(touchkit->input, ABS_X, x); + input_report_abs(touchkit->input, ABS_Y, y); + input_sync(touchkit->input); exit: retval = usb_submit_urb(urb, GFP_ATOMIC); @@ -371,6 +271,7 @@ static void touchkit_disconnect(struct usb_interface *intf) MODULE_DEVICE_TABLE(usb, touchkit_devices); static struct usb_driver touchkit_driver = { + .owner = THIS_MODULE, .name = "touchkitusb", .probe = touchkit_probe, .disconnect = touchkit_disconnect, diff --git a/trunk/drivers/usb/input/usbkbd.c b/trunk/drivers/usb/input/usbkbd.c index 2f3edc26cb50..226b6f90a907 100644 --- a/trunk/drivers/usb/input/usbkbd.c +++ b/trunk/drivers/usb/input/usbkbd.c @@ -345,6 +345,7 @@ static struct usb_device_id usb_kbd_id_table [] = { MODULE_DEVICE_TABLE (usb, usb_kbd_id_table); static struct usb_driver usb_kbd_driver = { + .owner = THIS_MODULE, .name = "usbkbd", .probe = usb_kbd_probe, .disconnect = usb_kbd_disconnect, diff --git a/trunk/drivers/usb/input/usbmouse.c b/trunk/drivers/usb/input/usbmouse.c index af526135d210..230f6b1b314a 100644 --- a/trunk/drivers/usb/input/usbmouse.c +++ b/trunk/drivers/usb/input/usbmouse.c @@ -226,6 +226,7 @@ static struct usb_device_id usb_mouse_id_table [] = { MODULE_DEVICE_TABLE (usb, usb_mouse_id_table); static struct usb_driver usb_mouse_driver = { + .owner = THIS_MODULE, .name = "usbmouse", .probe = usb_mouse_probe, .disconnect = usb_mouse_disconnect, diff --git a/trunk/drivers/usb/input/wacom.c b/trunk/drivers/usb/input/wacom.c index 48df4cfd5a42..ea0f75773ae1 100644 --- a/trunk/drivers/usb/input/wacom.c +++ b/trunk/drivers/usb/input/wacom.c @@ -52,10 +52,8 @@ * v1.30.1 (pi) - Added Graphire3 support * v1.40 (pc) - Add support for several new devices, fix eraser reporting, ... * v1.43 (pc) - Added support for Cintiq 21UX - * - Fixed a Graphire bug - * - Merged wacom_intuos3_irq into wacom_intuos_irq - * v1.44 (pc) - Added support for Graphire4, Cintiq 710, Intuos3 6x11, etc. - * - Report Device IDs + - Fixed a Graphire bug + - Merged wacom_intuos3_irq into wacom_intuos_irq */ /* @@ -78,7 +76,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v1.44" +#define DRIVER_VERSION "v1.43" #define DRIVER_AUTHOR "Vojtech Pavlik " #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" #define DRIVER_LICENSE "GPL" @@ -88,14 +86,10 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE(DRIVER_LICENSE); #define USB_VENDOR_ID_WACOM 0x056a -#define STYLUS_DEVICE_ID 0x02 -#define CURSOR_DEVICE_ID 0x06 -#define ERASER_DEVICE_ID 0x0A enum { PENPARTNER = 0, GRAPHIRE, - G4, PL, INTUOS, INTUOS3, @@ -122,7 +116,6 @@ struct wacom { struct urb *irq; struct wacom_features *features; int tool[2]; - int id[2]; __u32 serial[2]; char phys[32]; }; @@ -143,7 +136,7 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = wacom->dev; - int prox, pressure, id; + int prox, pressure; int retval; switch (urb->status) { @@ -170,7 +163,6 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) input_regs(dev, regs); - id = ERASER_DEVICE_ID; if (prox) { pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1)); @@ -185,15 +177,11 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) * an out of proximity for previous tool then a in for new tool. */ if (!wacom->tool[0]) { - /* Eraser bit set for DTF */ - if (data[1] & 0x10) - wacom->tool[1] = BTN_TOOL_RUBBER; - else - /* Going into proximity select tool */ - wacom->tool[1] = (data[4] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; + /* Going into proximity select tool */ + wacom->tool[1] = (data[4] & 0x20)? BTN_TOOL_RUBBER : BTN_TOOL_PEN; } else { /* was entered with stylus2 pressed */ - if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[4] & 0x20)) { + if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[4] & 0x20) ) { /* report out proximity for previous tool */ input_report_key(dev, wacom->tool[1], 0); input_sync(dev); @@ -204,9 +192,8 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) if (wacom->tool[1] != BTN_TOOL_RUBBER) { /* Unknown tool selected default to pen tool */ wacom->tool[1] = BTN_TOOL_PEN; - id = STYLUS_DEVICE_ID; } - input_report_key(dev, wacom->tool[1], id); /* report in proximity for tool */ + input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); input_report_abs(dev, ABS_PRESSURE, pressure); @@ -263,10 +250,10 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) input_regs(dev, regs); if (data[1] & 0x04) { - input_report_key(dev, BTN_TOOL_RUBBER, (data[1] & 0x20) ? ERASER_DEVICE_ID : 0); + input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x08); } else { - input_report_key(dev, BTN_TOOL_PEN, (data[1] & 0x20) ? STYLUS_DEVICE_ID : 0); + input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20); input_report_key(dev, BTN_TOUCH, data[1] & 0x01); } input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[2])); @@ -312,7 +299,7 @@ static void wacom_penpartner_irq(struct urb *urb, struct pt_regs *regs) } input_regs(dev, regs); - input_report_key(dev, BTN_TOOL_PEN, STYLUS_DEVICE_ID); + input_report_key(dev, BTN_TOOL_PEN, 1); input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[1])); input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[3])); input_report_abs(dev, ABS_PRESSURE, (signed char)data[6] + 127); @@ -332,7 +319,7 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = wacom->dev; - int x, y, id, rw; + int x, y; int retval; switch (urb->status) { @@ -357,7 +344,6 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_regs(dev, regs); - id = STYLUS_DEVICE_ID; if (data[1] & 0x10) { /* in prox */ switch ((data[1] >> 5) & 3) { @@ -368,27 +354,18 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) case 1: /* Rubber */ wacom->tool[0] = BTN_TOOL_RUBBER; - id = ERASER_DEVICE_ID; break; case 2: /* Mouse with wheel */ input_report_key(dev, BTN_MIDDLE, data[1] & 0x04); - if (wacom->features->type == G4) { - rw = data[7] & 0x04 ? -(data[7] & 0x03) : (data[7] & 0x03); - input_report_rel(dev, REL_WHEEL, rw); - } else - input_report_rel(dev, REL_WHEEL, (signed char) data[6]); + input_report_rel(dev, REL_WHEEL, (signed char) data[6]); /* fall through */ case 3: /* Mouse without wheel */ wacom->tool[0] = BTN_TOOL_MOUSE; - id = CURSOR_DEVICE_ID; input_report_key(dev, BTN_LEFT, data[1] & 0x01); input_report_key(dev, BTN_RIGHT, data[1] & 0x02); - if (wacom->features->type == G4) - input_report_abs(dev, ABS_DISTANCE, data[6]); - else - input_report_abs(dev, ABS_DISTANCE, data[7]); + input_report_abs(dev, ABS_DISTANCE, data[7]); break; } } @@ -399,50 +376,16 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) input_report_abs(dev, ABS_X, x); input_report_abs(dev, ABS_Y, y); if (wacom->tool[0] != BTN_TOOL_MOUSE) { - input_report_abs(dev, ABS_PRESSURE, data[6] | ((data[7] & 0x01) << 8)); + input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); input_report_key(dev, BTN_TOUCH, data[1] & 0x01); input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); } } - input_report_key(dev, wacom->tool[0], (data[1] & 0x10) ? id : 0); + input_report_key(dev, wacom->tool[0], data[1] & 0x10); input_sync(dev); - /* send pad data */ - if (wacom->features->type == G4) { - /* fist time sending pad data */ - if (wacom->tool[1] != BTN_TOOL_FINGER) { - wacom->id[1] = 0; - wacom->serial[1] = (data[7] & 0x38) >> 2; - } - if (data[7] & 0xf8) { - input_report_key(dev, BTN_0, (data[7] & 0x40)); - input_report_key(dev, BTN_4, (data[7] & 0x80)); - if (((data[7] & 0x38) >> 2) == (wacom->serial[1] & 0x0e)) - /* alter REL_WHEEL value so X apps can get it */ - wacom->serial[1] += (wacom->serial[1] & 0x01) ? -1 : 1; - else - wacom->serial[1] = (data[7] & 0x38 ) >> 2; - - /* don't alter the value when there is no wheel event */ - if (wacom->serial[1] == 1) - wacom->serial[1] = 0; - rw = wacom->serial[1]; - rw = (rw & 0x08) ? -(rw & 0x07) : (rw & 0x07); - input_report_rel(dev, REL_WHEEL, rw); - wacom->tool[1] = BTN_TOOL_FINGER; - wacom->id[1] = data[7] & 0xf8; - input_report_key(dev, wacom->tool[1], 0xf0); - input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); - } else if (wacom->id[1]) { - wacom->id[1] = 0; - wacom->serial[1] = 0; - input_report_key(dev, wacom->tool[1], 0); - input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); - } - input_sync(dev); - } exit: retval = usb_submit_urb (urb, GFP_ATOMIC); if (retval) @@ -467,8 +410,7 @@ static int wacom_intuos_inout(struct urb *urb) (data[4] << 20) + (data[5] << 12) + (data[6] << 4) + (data[7] >> 4); - wacom->id[idx] = (data[2] << 4) | (data[3] >> 4); - switch (wacom->id[idx]) { + switch ((data[2] << 4) | (data[3] >> 4)) { case 0x812: /* Inking pen */ case 0x801: /* Intuos3 Inking pen */ case 0x012: @@ -516,7 +458,7 @@ static int wacom_intuos_inout(struct urb *urb) default: /* Unknown tool */ wacom->tool[idx] = BTN_TOOL_PEN; } - input_report_key(dev, wacom->tool[idx], wacom->id[idx]); + input_report_key(dev, wacom->tool[idx], 1); input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); input_sync(dev); return 1; @@ -695,7 +637,7 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) } } - input_report_key(dev, wacom->tool[idx], wacom->id[idx]); + input_report_key(dev, wacom->tool[idx], 1); input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); input_sync(dev); @@ -713,13 +655,6 @@ static struct wacom_features wacom_features[] = { { "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 32, GRAPHIRE, wacom_graphire_irq }, { "Wacom Graphire3", 8, 10208, 7424, 511, 32, GRAPHIRE, wacom_graphire_irq }, { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 32, GRAPHIRE, wacom_graphire_irq }, - { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 32, G4, wacom_graphire_irq }, - { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 32, G4, wacom_graphire_irq }, - { "Wacom Volito", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_graphire_irq }, - { "Wacom PenStation2", 8, 3250, 2320, 255, 32, GRAPHIRE, wacom_graphire_irq }, - { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_graphire_irq }, - { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 32, GRAPHIRE, wacom_graphire_irq }, - { "Wacom PenPartner2", 8, 3250, 2320, 255, 32, GRAPHIRE, wacom_graphire_irq }, { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 15, INTUOS, wacom_intuos_irq }, @@ -731,20 +666,16 @@ static struct wacom_features wacom_features[] = { { "Wacom PL600SX", 8, 6260, 5016, 255, 32, PL, wacom_pl_irq }, { "Wacom PL550", 8, 6144, 4608, 511, 32, PL, wacom_pl_irq }, { "Wacom PL800", 8, 7220, 5780, 511, 32, PL, wacom_pl_irq }, - { "Wacom PL700", 8, 6758, 5406, 511, 32, PL, wacom_pl_irq }, - { "Wacom PL510", 8, 6282, 4762, 511, 32, PL, wacom_pl_irq }, - { "Wacom PL710", 8, 34080, 27660, 511, 32, PL, wacom_pl_irq }, - { "Wacom DTF720", 8, 6858, 5506, 511, 32, PL, wacom_pl_irq }, - { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PL, wacom_ptu_irq }, { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, { "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 15, INTUOS, wacom_intuos_irq }, { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 15, INTUOS, wacom_intuos_irq }, { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 15, INTUOS, wacom_intuos_irq }, + { "Wacom Volito", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_graphire_irq }, + { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PL, wacom_ptu_irq }, { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, INTUOS3, wacom_intuos_irq }, { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, INTUOS3, wacom_intuos_irq }, { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, INTUOS3, wacom_intuos_irq }, - { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 15, INTUOS3, wacom_intuos_irq }, { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 15, CINTIQ, wacom_intuos_irq }, { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, { } @@ -757,13 +688,6 @@ static struct usb_device_id wacom_ids[] = { { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x12) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x13) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x14) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x15) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x63) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x64) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) }, @@ -775,20 +699,16 @@ static struct usb_device_id wacom_ids[] = { { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x33) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x34) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x35) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x37) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x43) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x44) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x45) }, + { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, + { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) }, - { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, { } @@ -854,18 +774,11 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS); input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS); - input_set_abs_params(input_dev, ABS_X, 0, wacom->features->x_max, 4, 0); + input_set_abs_params(input_dev, ABS_X, 0, wacom->features->y_max, 4, 0); input_set_abs_params(input_dev, ABS_Y, 0, wacom->features->y_max, 4, 0); input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom->features->pressure_max, 0, 0); switch (wacom->features->type) { - case G4: - input_dev->evbit[0] |= BIT(EV_MSC); - input_dev->mscbit[0] |= BIT(MSC_SERIAL); - input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); - input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7); - /* fall through */ - case GRAPHIRE: input_dev->evbit[0] |= BIT(EV_REL); input_dev->relbit[0] |= BIT(REL_WHEEL); @@ -945,6 +858,7 @@ static void wacom_disconnect(struct usb_interface *intf) } static struct usb_driver wacom_driver = { + .owner = THIS_MODULE, .name = "wacom", .probe = wacom_probe, .disconnect = wacom_disconnect, diff --git a/trunk/drivers/usb/input/xpad.c b/trunk/drivers/usb/input/xpad.c index e278489a80c6..43112f040b6d 100644 --- a/trunk/drivers/usb/input/xpad.c +++ b/trunk/drivers/usb/input/xpad.c @@ -70,7 +70,7 @@ #define XPAD_PKT_LEN 32 -static const struct xpad_device { +static struct xpad_device { u16 idVendor; u16 idProduct; char *name; @@ -81,13 +81,13 @@ static const struct xpad_device { { 0x0000, 0x0000, "X-Box pad" } }; -static const signed short xpad_btn[] = { +static signed short xpad_btn[] = { BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, /* "analog" buttons */ BTN_START, BTN_BACK, BTN_THUMBL, BTN_THUMBR, /* start/back/sticks */ -1 /* terminating entry */ }; -static const signed short xpad_abs[] = { +static signed short xpad_abs[] = { ABS_X, ABS_Y, /* left stick */ ABS_RX, ABS_RY, /* right stick */ ABS_Z, ABS_RZ, /* triggers left/right */ @@ -316,6 +316,7 @@ static void xpad_disconnect(struct usb_interface *intf) } static struct usb_driver xpad_driver = { + .owner = THIS_MODULE, .name = "xpad", .probe = xpad_probe, .disconnect = xpad_disconnect, diff --git a/trunk/drivers/usb/input/yealink.c b/trunk/drivers/usb/input/yealink.c index 1bfc105ad4d6..f526aebea502 100644 --- a/trunk/drivers/usb/input/yealink.c +++ b/trunk/drivers/usb/input/yealink.c @@ -987,6 +987,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) } static struct usb_driver yealink_driver = { + .owner = THIS_MODULE, .name = "yealink", .probe = usb_probe, .disconnect = usb_disconnect, diff --git a/trunk/drivers/usb/media/dabusb.c b/trunk/drivers/usb/media/dabusb.c index 18d8eaf408d5..27b23c55bbc7 100644 --- a/trunk/drivers/usb/media/dabusb.c +++ b/trunk/drivers/usb/media/dabusb.c @@ -812,6 +812,7 @@ static struct usb_device_id dabusb_ids [] = { MODULE_DEVICE_TABLE (usb, dabusb_ids); static struct usb_driver dabusb_driver = { + .owner = THIS_MODULE, .name = "dabusb", .probe = dabusb_probe, .disconnect = dabusb_disconnect, diff --git a/trunk/drivers/usb/media/dsbr100.c b/trunk/drivers/usb/media/dsbr100.c index 6a5700e9d428..7503f5b96f59 100644 --- a/trunk/drivers/usb/media/dsbr100.c +++ b/trunk/drivers/usb/media/dsbr100.c @@ -150,6 +150,7 @@ MODULE_DEVICE_TABLE (usb, usb_dsbr100_device_table); /* USB subsystem interface */ static struct usb_driver usb_dsbr100_driver = { + .owner = THIS_MODULE, .name = "dsbr100", .probe = usb_dsbr100_probe, .disconnect = usb_dsbr100_disconnect, diff --git a/trunk/drivers/usb/media/ibmcam.c b/trunk/drivers/usb/media/ibmcam.c index a42c22294124..ba41fc7b95c2 100644 --- a/trunk/drivers/usb/media/ibmcam.c +++ b/trunk/drivers/usb/media/ibmcam.c @@ -3457,7 +3457,7 @@ static void ibmcam_model3_setup_after_video_if(struct uvd *uvd) if(init_model3_input) { if (debug > 0) info("Setting input to RCA."); - for (i=0; i < ARRAY_SIZE(initData); i++) { + for (i=0; i < (sizeof(initData)/sizeof(initData[0])); i++) { ibmcam_veio(uvd, initData[i].req, initData[i].value, initData[i].index); } } diff --git a/trunk/drivers/usb/media/konicawc.c b/trunk/drivers/usb/media/konicawc.c index e2ede583518f..9fe2c2710d13 100644 --- a/trunk/drivers/usb/media/konicawc.c +++ b/trunk/drivers/usb/media/konicawc.c @@ -77,14 +77,14 @@ static int saturation = MAX_SATURATION/2; static int sharpness = MAX_SHARPNESS/2; static int whitebal = 3*(MAX_WHITEBAL/4); -static const int spd_to_iface[] = { 1, 0, 3, 2, 4, 5, 6 }; +static int spd_to_iface[] = { 1, 0, 3, 2, 4, 5, 6 }; /* These FPS speeds are from the windows config box. They are * indexed on size (0-2) and speed (0-6). Divide by 3 to get the * real fps. */ -static const int spd_to_fps[][7] = { { 24, 40, 48, 60, 72, 80, 100 }, +static int spd_to_fps[][7] = { { 24, 40, 48, 60, 72, 80, 100 }, { 24, 40, 48, 60, 72, 80, 100 }, { 18, 30, 36, 45, 54, 60, 75 }, { 6, 10, 12, 15, 18, 21, 25 } }; @@ -95,7 +95,7 @@ struct cam_size { u8 cmd; }; -static const struct cam_size camera_sizes[] = { { 160, 120, 0x7 }, +static struct cam_size camera_sizes[] = { { 160, 120, 0x7 }, { 160, 136, 0xa }, { 176, 144, 0x4 }, { 320, 240, 0x5 } }; diff --git a/trunk/drivers/usb/media/ov511.c b/trunk/drivers/usb/media/ov511.c index 3a0e8ce67ebe..036c485d1d1e 100644 --- a/trunk/drivers/usb/media/ov511.c +++ b/trunk/drivers/usb/media/ov511.c @@ -211,7 +211,7 @@ static struct ov51x_decomp_ops *ov518_mmx_decomp_ops; /* Number of times to retry a failed I2C transaction. Increase this if you * are getting "Failed to read sensor ID..." */ -static const int i2c_detect_tries = 5; +static int i2c_detect_tries = 5; /* MMX support is present in kernel and CPU. Checked upon decomp module load. */ #if defined(__i386__) || defined(__x86_64__) @@ -6008,6 +6008,7 @@ ov51x_disconnect(struct usb_interface *intf) } static struct usb_driver ov511_driver = { + .owner = THIS_MODULE, .name = "ov511", .id_table = device_table, .probe = ov51x_probe, diff --git a/trunk/drivers/usb/media/pwc/pwc-ctrl.c b/trunk/drivers/usb/media/pwc/pwc-ctrl.c index 359c4b2df735..53099190952c 100644 --- a/trunk/drivers/usb/media/pwc/pwc-ctrl.c +++ b/trunk/drivers/usb/media/pwc/pwc-ctrl.c @@ -109,7 +109,7 @@ #define PT_RESET_CONTROL_FORMATTER 0x02 #define PT_STATUS_FORMATTER 0x03 -static const char *size2name[PSZ_MAX] = +static char *size2name[PSZ_MAX] = { "subQCIF", "QSIF", diff --git a/trunk/drivers/usb/media/pwc/pwc-if.c b/trunk/drivers/usb/media/pwc/pwc-if.c index 09ca6128ac20..5524fd70210b 100644 --- a/trunk/drivers/usb/media/pwc/pwc-if.c +++ b/trunk/drivers/usb/media/pwc/pwc-if.c @@ -111,6 +111,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id static void usb_pwc_disconnect(struct usb_interface *intf); static struct usb_driver pwc_driver = { + .owner = THIS_MODULE, .name = "Philips webcam", /* name */ .id_table = pwc_device_table, .probe = usb_pwc_probe, /* probe() */ diff --git a/trunk/drivers/usb/media/se401.c b/trunk/drivers/usb/media/se401.c index b2ae29af5940..f69e443cd1bc 100644 --- a/trunk/drivers/usb/media/se401.c +++ b/trunk/drivers/usb/media/se401.c @@ -1401,6 +1401,7 @@ static void se401_disconnect(struct usb_interface *intf) } static struct usb_driver se401_driver = { + .owner = THIS_MODULE, .name = "se401", .id_table = device_table, .probe = se401_probe, diff --git a/trunk/drivers/usb/media/sn9c102_core.c b/trunk/drivers/usb/media/sn9c102_core.c index 8d1a1c357d5a..cf8cfbabefde 100644 --- a/trunk/drivers/usb/media/sn9c102_core.c +++ b/trunk/drivers/usb/media/sn9c102_core.c @@ -199,7 +199,7 @@ static void sn9c102_release_buffers(struct sn9c102_device* cam) { if (cam->nbuffers) { rvfree(cam->frame[0].bufmem, - cam->nbuffers * PAGE_ALIGN(cam->frame[0].buf.length)); + cam->nbuffers * cam->frame[0].buf.length); cam->nbuffers = 0; } } @@ -1316,7 +1316,7 @@ static int sn9c102_init(struct sn9c102_device* cam) struct v4l2_control ctrl; struct v4l2_queryctrl *qctrl; struct v4l2_rect* rect; - u8 i = 0; + u8 i = 0, n = 0; int err = 0; if (!(cam->state & DEV_INITIALIZED)) { @@ -1352,7 +1352,7 @@ static int sn9c102_init(struct sn9c102_device* cam) return err; if (s->pix_format.pixelformat == V4L2_PIX_FMT_SN9C10X) - DBG(3, "Compressed video format is active, quality %d", + DBG(3, "Compressed video format is active, quality %d", cam->compression.quality) else DBG(3, "Uncompressed video format is active") @@ -1364,8 +1364,9 @@ static int sn9c102_init(struct sn9c102_device* cam) } if (s->set_ctrl) { - for (i = 0; i < ARRAY_SIZE(s->qctrl); i++) - if (s->qctrl[i].id != 0 && + n = sizeof(s->qctrl) / sizeof(s->qctrl[0]); + for (i = 0; i < n; i++) + if (s->qctrl[i].id != 0 && !(s->qctrl[i].flags & V4L2_CTRL_FLAG_DISABLED)) { ctrl.id = s->qctrl[i].id; ctrl.value = qctrl[i].default_value; @@ -1387,7 +1388,7 @@ static int sn9c102_init(struct sn9c102_device* cam) init_waitqueue_head(&cam->wait_stream); cam->nreadbuffers = 2; memcpy(s->_qctrl, s->qctrl, sizeof(s->qctrl)); - memcpy(&(s->_rect), &(s->cropcap.defrect), + memcpy(&(s->_rect), &(s->cropcap.defrect), sizeof(struct v4l2_rect)); cam->state |= DEV_INITIALIZED; } @@ -1809,12 +1810,13 @@ static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, { struct sn9c102_sensor* s = cam->sensor; struct v4l2_queryctrl qc; - u8 i; + u8 i, n; if (copy_from_user(&qc, arg, sizeof(qc))) return -EFAULT; - for (i = 0; i < ARRAY_SIZE(s->qctrl); i++) + n = sizeof(s->qctrl) / sizeof(s->qctrl[0]); + for (i = 0; i < n; i++) if (qc.id && qc.id == s->qctrl[i].id) { memcpy(&qc, &(s->qctrl[i]), sizeof(qc)); if (copy_to_user(arg, &qc, sizeof(qc))) @@ -1850,7 +1852,7 @@ static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, { struct sn9c102_sensor* s = cam->sensor; struct v4l2_control ctrl; - u8 i; + u8 i, n; int err = 0; if (!s->set_ctrl) @@ -1859,7 +1861,8 @@ static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, if (copy_from_user(&ctrl, arg, sizeof(ctrl))) return -EFAULT; - for (i = 0; i < ARRAY_SIZE(s->qctrl); i++) + n = sizeof(s->qctrl) / sizeof(s->qctrl[0]); + for (i = 0; i < n; i++) if (ctrl.id == s->qctrl[i].id) { if (ctrl.value < s->qctrl[i].minimum || ctrl.value > s->qctrl[i].maximum) @@ -2541,7 +2544,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) unsigned int i, n; int err = 0, r; - n = ARRAY_SIZE(sn9c102_id_table); + n = sizeof(sn9c102_id_table)/sizeof(sn9c102_id_table[0]); for (i = 0; i < n-1; i++) if (le16_to_cpu(udev->descriptor.idVendor) == sn9c102_id_table[i].idVendor && @@ -2708,6 +2711,7 @@ static void sn9c102_usb_disconnect(struct usb_interface* intf) static struct usb_driver sn9c102_usb_driver = { + .owner = THIS_MODULE, .name = "sn9c102", .id_table = sn9c102_id_table, .probe = sn9c102_usb_probe, diff --git a/trunk/drivers/usb/media/stv680.c b/trunk/drivers/usb/media/stv680.c index 774038b352cd..0fd0fa9fec21 100644 --- a/trunk/drivers/usb/media/stv680.c +++ b/trunk/drivers/usb/media/stv680.c @@ -1477,6 +1477,7 @@ static void stv680_disconnect (struct usb_interface *intf) } static struct usb_driver stv680_driver = { + .owner = THIS_MODULE, .name = "stv680", .probe = stv680_probe, .disconnect = stv680_disconnect, diff --git a/trunk/drivers/usb/media/stv680.h b/trunk/drivers/usb/media/stv680.h index b0551cdb280b..445940612603 100644 --- a/trunk/drivers/usb/media/stv680.h +++ b/trunk/drivers/usb/media/stv680.h @@ -151,7 +151,7 @@ struct usb_stv { }; -static const unsigned char red[256] = { +static unsigned char red[256] = { 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 25, 30, 35, 38, 42, 44, 47, 50, 53, 54, 57, 59, 61, 63, 65, 67, 69, @@ -176,7 +176,7 @@ static const unsigned char red[256] = { 220, 220, 221, 221 }; -static const unsigned char green[256] = { +static unsigned char green[256] = { 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 28, 34, 39, 43, 47, 50, 53, 56, 59, 61, 64, 66, 68, 71, 73, 75, 77, @@ -201,7 +201,7 @@ static const unsigned char green[256] = { 245, 245, 246, 246 }; -static const unsigned char blue[256] = { +static unsigned char blue[256] = { 0, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 30, 37, 42, 47, 51, 55, 58, 61, 64, 67, 70, 72, 74, 78, 80, 82, 84, diff --git a/trunk/drivers/usb/media/usbvideo.c b/trunk/drivers/usb/media/usbvideo.c index 4bd113325ef9..24efb21969c6 100644 --- a/trunk/drivers/usb/media/usbvideo.c +++ b/trunk/drivers/usb/media/usbvideo.c @@ -725,7 +725,7 @@ int usbvideo_register( /* Allocate user_data separately because of kmalloc's limits */ if (num_extra > 0) { up->user_size = num_cams * num_extra; - up->user_data = kmalloc(up->user_size, GFP_KERNEL); + up->user_data = (char *) kmalloc(up->user_size, GFP_KERNEL); if (up->user_data == NULL) { err("%s: Failed to allocate user_data (%d. bytes)", __FUNCTION__, up->user_size); @@ -955,7 +955,7 @@ static struct file_operations usbvideo_fops = { .ioctl = usbvideo_v4l_ioctl, .llseek = no_llseek, }; -static const struct video_device usbvideo_template = { +static struct video_device usbvideo_template = { .owner = THIS_MODULE, .type = VID_TYPE_CAPTURE, .hardware = VID_HARDWARE_CPIA, diff --git a/trunk/drivers/usb/media/vicam.c b/trunk/drivers/usb/media/vicam.c index 1c73155c8d77..0bc0b1247a6b 100644 --- a/trunk/drivers/usb/media/vicam.c +++ b/trunk/drivers/usb/media/vicam.c @@ -1257,6 +1257,7 @@ static struct usb_device_id vicam_table[] = { MODULE_DEVICE_TABLE(usb, vicam_table); static struct usb_driver vicam_driver = { + .owner = THIS_MODULE, .name = "vicam", .probe = vicam_probe, .disconnect = vicam_disconnect, diff --git a/trunk/drivers/usb/media/w9968cf.c b/trunk/drivers/usb/media/w9968cf.c index 04d69339c054..67612c81cb9f 100644 --- a/trunk/drivers/usb/media/w9968cf.c +++ b/trunk/drivers/usb/media/w9968cf.c @@ -2958,7 +2958,7 @@ static int w9968cf_v4l_ioctl(struct inode* inode, struct file* filp, }; #define V4L1_IOCTL(cmd) \ - ((_IOC_NR((cmd)) < ARRAY_SIZE(v4l1_ioctls)) ? \ + ((_IOC_NR((cmd)) < sizeof(v4l1_ioctls)/sizeof(char*)) ? \ v4l1_ioctls[_IOC_NR((cmd))] : "?") cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp)); @@ -3554,7 +3554,7 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) /* Allocate 2 bytes of memory for camera control USB transfers */ - if (!(cam->control_buffer = kmalloc(2, GFP_KERNEL))) { + if (!(cam->control_buffer = (u16*)kmalloc(2, GFP_KERNEL))) { DBG(1,"Couldn't allocate memory for camera control transfers") err = -ENOMEM; goto fail; @@ -3562,7 +3562,7 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) memset(cam->control_buffer, 0, 2); /* Allocate 8 bytes of memory for USB data transfers to the FSB */ - if (!(cam->data_buffer = kmalloc(8, GFP_KERNEL))) { + if (!(cam->data_buffer = (u16*)kmalloc(8, GFP_KERNEL))) { DBG(1, "Couldn't allocate memory for data " "transfers to the FSB") err = -ENOMEM; @@ -3668,6 +3668,7 @@ static void w9968cf_usb_disconnect(struct usb_interface* intf) static struct usb_driver w9968cf_usb_driver = { + .owner = THIS_MODULE, .name = "w9968cf", .id_table = winbond_id_table, .probe = w9968cf_usb_probe, diff --git a/trunk/drivers/usb/misc/Makefile b/trunk/drivers/usb/misc/Makefile index 6c693bc68e2e..862e40a83689 100644 --- a/trunk/drivers/usb/misc/Makefile +++ b/trunk/drivers/usb/misc/Makefile @@ -18,8 +18,4 @@ obj-$(CONFIG_USB_RIO500) += rio500.o obj-$(CONFIG_USB_TEST) += usbtest.o obj-$(CONFIG_USB_USS720) += uss720.o -obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga/ - -ifeq ($(CONFIG_USB_DEBUG),y) -EXTRA_CFLAGS += -DDEBUG -endif +obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga/ \ No newline at end of file diff --git a/trunk/drivers/usb/misc/auerswald.c b/trunk/drivers/usb/misc/auerswald.c index 449b2501acf3..5f33f7c64885 100644 --- a/trunk/drivers/usb/misc/auerswald.c +++ b/trunk/drivers/usb/misc/auerswald.c @@ -30,6 +30,7 @@ #include #include #include +#undef DEBUG /* include debug macros until it's done */ #include /*-------------------------------------------------------------------*/ @@ -767,7 +768,7 @@ static int auerbuf_setup (pauerbufctl_t bcp, unsigned int numElements, unsigned memset (bep, 0, sizeof (auerbuf_t)); bep->list = bcp; INIT_LIST_HEAD (&bep->buff_list); - bep->bufp = kmalloc (bufsize, GFP_KERNEL); + bep->bufp = (char *) kmalloc (bufsize, GFP_KERNEL); if (!bep->bufp) goto bl_fail; bep->dr = (struct usb_ctrlrequest *) kmalloc (sizeof (struct usb_ctrlrequest), GFP_KERNEL); @@ -1123,7 +1124,7 @@ static int auerswald_int_open (pauerswald_t cp) } } if (!cp->intbufp) { - cp->intbufp = kmalloc (irqsize, GFP_KERNEL); + cp->intbufp = (char *) kmalloc (irqsize, GFP_KERNEL); if (!cp->intbufp) { ret = -ENOMEM; goto intoend; @@ -1696,7 +1697,7 @@ static ssize_t auerchar_write (struct file *file, const char __user *buf, size_t int ret; wait_queue_t wait; - dbg ("auerchar_write %zd bytes", len); + dbg ("auerchar_write %d bytes", len); /* Error checking */ if (!ccp) @@ -2103,6 +2104,7 @@ MODULE_DEVICE_TABLE (usb, auerswald_ids); /* Standard usb driver struct */ static struct usb_driver auerswald_driver = { + .owner = THIS_MODULE, .name = "auerswald", .probe = auerswald_probe, .disconnect = auerswald_disconnect, diff --git a/trunk/drivers/usb/misc/cytherm.c b/trunk/drivers/usb/misc/cytherm.c index 6671317b495f..b33044d56a1e 100644 --- a/trunk/drivers/usb/misc/cytherm.c +++ b/trunk/drivers/usb/misc/cytherm.c @@ -50,6 +50,7 @@ static void cytherm_disconnect(struct usb_interface *interface); /* usb specific object needed to register this driver with the usb subsystem */ static struct usb_driver cytherm_driver = { + .owner = THIS_MODULE, .name = "cytherm", .probe = cytherm_probe, .disconnect = cytherm_disconnect, diff --git a/trunk/drivers/usb/misc/emi26.c b/trunk/drivers/usb/misc/emi26.c index 3824df33094e..c8155209bf4b 100644 --- a/trunk/drivers/usb/misc/emi26.c +++ b/trunk/drivers/usb/misc/emi26.c @@ -227,6 +227,7 @@ static void emi26_disconnect(struct usb_interface *intf) } static struct usb_driver emi26_driver = { + .owner = THIS_MODULE, .name = "emi26 - firmware loader", .probe = emi26_probe, .disconnect = emi26_disconnect, diff --git a/trunk/drivers/usb/misc/emi62.c b/trunk/drivers/usb/misc/emi62.c index 52fea2e08db8..189986af2ac7 100644 --- a/trunk/drivers/usb/misc/emi62.c +++ b/trunk/drivers/usb/misc/emi62.c @@ -266,6 +266,7 @@ static void emi62_disconnect(struct usb_interface *intf) } static struct usb_driver emi62_driver = { + .owner = THIS_MODULE, .name = "emi62 - firmware loader", .probe = emi62_probe, .disconnect = emi62_disconnect, diff --git a/trunk/drivers/usb/misc/idmouse.c b/trunk/drivers/usb/misc/idmouse.c index d8cde1017985..1dc3e0f73014 100644 --- a/trunk/drivers/usb/misc/idmouse.c +++ b/trunk/drivers/usb/misc/idmouse.c @@ -114,6 +114,7 @@ static struct usb_class_driver idmouse_class = { /* usb specific object needed to register this driver with the usb subsystem */ static struct usb_driver idmouse_driver = { + .owner = THIS_MODULE, .name = DRIVER_SHORT, .probe = idmouse_probe, .disconnect = idmouse_disconnect, diff --git a/trunk/drivers/usb/misc/ldusb.c b/trunk/drivers/usb/misc/ldusb.c index 981d8a5fbfd9..7e93ac96490f 100644 --- a/trunk/drivers/usb/misc/ldusb.c +++ b/trunk/drivers/usb/misc/ldusb.c @@ -763,6 +763,7 @@ static void ld_usb_disconnect(struct usb_interface *intf) /* usb specific object needed to register this driver with the usb subsystem */ static struct usb_driver ld_usb_driver = { + .owner = THIS_MODULE, .name = "ldusb", .probe = ld_usb_probe, .disconnect = ld_usb_disconnect, diff --git a/trunk/drivers/usb/misc/legousbtower.c b/trunk/drivers/usb/misc/legousbtower.c index 1336745b8f55..2703e205bc8f 100644 --- a/trunk/drivers/usb/misc/legousbtower.c +++ b/trunk/drivers/usb/misc/legousbtower.c @@ -282,6 +282,7 @@ static struct usb_class_driver tower_class = { /* usb specific object needed to register this driver with the usb subsystem */ static struct usb_driver tower_driver = { + .owner = THIS_MODULE, .name = "legousbtower", .probe = tower_probe, .disconnect = tower_disconnect, diff --git a/trunk/drivers/usb/misc/phidgetkit.c b/trunk/drivers/usb/misc/phidgetkit.c index 605a3c87e05c..067a81486921 100644 --- a/trunk/drivers/usb/misc/phidgetkit.c +++ b/trunk/drivers/usb/misc/phidgetkit.c @@ -555,6 +555,7 @@ static void interfacekit_disconnect(struct usb_interface *interface) } static struct usb_driver interfacekit_driver = { + .owner = THIS_MODULE, .name = "phidgetkit", .probe = interfacekit_probe, .disconnect = interfacekit_disconnect, diff --git a/trunk/drivers/usb/misc/phidgetservo.c b/trunk/drivers/usb/misc/phidgetservo.c index b3418d2bcc69..b84eda631ab5 100644 --- a/trunk/drivers/usb/misc/phidgetservo.c +++ b/trunk/drivers/usb/misc/phidgetservo.c @@ -26,6 +26,9 @@ */ #include +#ifdef CONFIG_USB_DEBUG +#define DEBUG 1 +#endif #include #include #include @@ -306,6 +309,7 @@ servo_disconnect(struct usb_interface *interface) } static struct usb_driver servo_driver = { + .owner = THIS_MODULE, .name = "phidgetservo", .probe = servo_probe, .disconnect = servo_disconnect, diff --git a/trunk/drivers/usb/misc/rio500.c b/trunk/drivers/usb/misc/rio500.c index 384fa3769805..7d02d8ec6b1a 100644 --- a/trunk/drivers/usb/misc/rio500.c +++ b/trunk/drivers/usb/misc/rio500.c @@ -393,7 +393,7 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) ibuf, this_read, &partial, 8000); - dbg("read stats: result:%d this_read:%u partial:%u", + dbg(KERN_DEBUG "read stats: result:%d this_read:%u partial:%u", result, this_read, partial); if (partial) { @@ -465,14 +465,14 @@ static int probe_rio(struct usb_interface *intf, rio->rio_dev = dev; - if (!(rio->obuf = kmalloc(OBUF_SIZE, GFP_KERNEL))) { + if (!(rio->obuf = (char *) kmalloc(OBUF_SIZE, GFP_KERNEL))) { err("probe_rio: Not enough memory for the output buffer"); usb_deregister_dev(intf, &usb_rio_class); return -ENOMEM; } dbg("probe_rio: obuf address:%p", rio->obuf); - if (!(rio->ibuf = kmalloc(IBUF_SIZE, GFP_KERNEL))) { + if (!(rio->ibuf = (char *) kmalloc(IBUF_SIZE, GFP_KERNEL))) { err("probe_rio: Not enough memory for the input buffer"); usb_deregister_dev(intf, &usb_rio_class); kfree(rio->obuf); @@ -522,6 +522,7 @@ static struct usb_device_id rio_table [] = { MODULE_DEVICE_TABLE (usb, rio_table); static struct usb_driver rio_driver = { + .owner = THIS_MODULE, .name = "rio500", .probe = probe_rio, .disconnect = disconnect_rio, diff --git a/trunk/drivers/usb/misc/sisusbvga/sisusb.c b/trunk/drivers/usb/misc/sisusbvga/sisusb.c index 3260d595441f..41ef2b606751 100644 --- a/trunk/drivers/usb/misc/sisusbvga/sisusb.c +++ b/trunk/drivers/usb/misc/sisusbvga/sisusb.c @@ -863,6 +863,9 @@ static int sisusb_write_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr, switch (length) { + case 0: + return ret; + case 1: if (userbuffer) { if (get_user(swap8, (u8 __user *)userbuffer)) @@ -1218,6 +1221,9 @@ static int sisusb_read_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr, switch (length) { + case 0: + return ret; + case 1: ret |= sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM, @@ -2437,8 +2443,8 @@ sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init) u8 *tempbuf; u16 *tempbufb; size_t written; - static const char bootstring[] = "SiSUSB VGA text console, (C) 2005 Thomas Winischhofer."; - static const char bootlogo[] = "(o_ //\\ V_/_"; + static char bootstring[] = "SiSUSB VGA text console, (C) 2005 Thomas Winischhofer."; + static char bootlogo[] = "(o_ //\\ V_/_"; /* sisusb->lock is down */ @@ -3483,6 +3489,7 @@ static struct usb_device_id sisusb_table [] = { MODULE_DEVICE_TABLE (usb, sisusb_table); static struct usb_driver sisusb_driver = { + .owner = THIS_MODULE, .name = "sisusb", .probe = sisusb_probe, .disconnect = sisusb_disconnect, diff --git a/trunk/drivers/usb/misc/usblcd.c b/trunk/drivers/usb/misc/usblcd.c index cc3dae3f34e0..85f3725334b0 100644 --- a/trunk/drivers/usb/misc/usblcd.c +++ b/trunk/drivers/usb/misc/usblcd.c @@ -371,6 +371,7 @@ static void lcd_disconnect(struct usb_interface *interface) } static struct usb_driver lcd_driver = { + .owner = THIS_MODULE, .name = "usblcd", .probe = lcd_probe, .disconnect = lcd_disconnect, diff --git a/trunk/drivers/usb/misc/usbled.c b/trunk/drivers/usb/misc/usbled.c index 877b081a3a6e..f6ba4c788dbc 100644 --- a/trunk/drivers/usb/misc/usbled.c +++ b/trunk/drivers/usb/misc/usbled.c @@ -10,6 +10,9 @@ */ #include +#ifdef CONFIG_USB_DEBUG + #define DEBUG 1 +#endif #include #include #include @@ -148,6 +151,7 @@ static void led_disconnect(struct usb_interface *interface) } static struct usb_driver led_driver = { + .owner = THIS_MODULE, .name = "usbled", .probe = led_probe, .disconnect = led_disconnect, diff --git a/trunk/drivers/usb/misc/usbtest.c b/trunk/drivers/usb/misc/usbtest.c index 84fa1728f052..2997f558159b 100644 --- a/trunk/drivers/usb/misc/usbtest.c +++ b/trunk/drivers/usb/misc/usbtest.c @@ -1,4 +1,7 @@ #include +#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG) +# define DEBUG +#endif #include #include #include @@ -2134,6 +2137,7 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver usbtest_driver = { + .owner = THIS_MODULE, .name = "usbtest", .id_table = id_table, .probe = usbtest_probe, diff --git a/trunk/drivers/usb/misc/uss720.c b/trunk/drivers/usb/misc/uss720.c index 4081990b7d1a..0592cb5e6c4d 100644 --- a/trunk/drivers/usb/misc/uss720.c +++ b/trunk/drivers/usb/misc/uss720.c @@ -41,6 +41,8 @@ /*****************************************************************************/ +#define DEBUG + #include #include #include @@ -780,6 +782,7 @@ MODULE_DEVICE_TABLE (usb, uss720_table); static struct usb_driver uss720_driver = { + .owner = THIS_MODULE, .name = "uss720", .probe = uss720_probe, .disconnect = uss720_disconnect, diff --git a/trunk/drivers/usb/mon/mon_text.c b/trunk/drivers/usb/mon/mon_text.c index 611612146ae9..17d0190ef64e 100644 --- a/trunk/drivers/usb/mon/mon_text.c +++ b/trunk/drivers/usb/mon/mon_text.c @@ -97,12 +97,19 @@ static inline char mon_text_get_data(struct mon_event_text *ep, struct urb *urb, if (len >= DATA_MAX) len = DATA_MAX; - if (usb_pipein(pipe)) { - if (ev_type == 'S') - return '<'; - } else { - if (ev_type == 'C') - return '>'; + /* + * Bulk is easy to shortcut reliably. + * XXX Other pipe types need consideration. Currently, we overdo it + * and collect garbage for them: better more than less. + */ + if (usb_pipebulk(pipe) || usb_pipecontrol(pipe)) { + if (usb_pipein(pipe)) { + if (ev_type == 'S') + return '<'; + } else { + if (ev_type == 'C') + return '>'; + } } /* diff --git a/trunk/drivers/usb/net/Makefile b/trunk/drivers/usb/net/Makefile index a21e6eaabaf6..222c0495f791 100644 --- a/trunk/drivers/usb/net/Makefile +++ b/trunk/drivers/usb/net/Makefile @@ -16,7 +16,3 @@ obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o obj-$(CONFIG_USB_USBNET) += usbnet.o obj-$(CONFIG_USB_ZD1201) += zd1201.o - -ifeq ($(CONFIG_USB_DEBUG),y) -EXTRA_CFLAGS += -DDEBUG -endif diff --git a/trunk/drivers/usb/net/asix.c b/trunk/drivers/usb/net/asix.c index 541181695040..252a34fbb42c 100644 --- a/trunk/drivers/usb/net/asix.c +++ b/trunk/drivers/usb/net/asix.c @@ -23,6 +23,9 @@ // #define VERBOSE // more; success messages #include +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include #include #include @@ -912,16 +915,13 @@ static const struct usb_device_id products [] = { // ASIX AX88772 10/100 USB_DEVICE (0x0b95, 0x7720), .driver_info = (unsigned long) &ax88772_info, -}, { - // Linksys USB200M Rev 2 - USB_DEVICE (0x13b1, 0x0018), - .driver_info = (unsigned long) &ax88772_info, }, { }, // END }; MODULE_DEVICE_TABLE(usb, products); static struct usb_driver asix_driver = { + .owner = THIS_MODULE, .name = "asix", .id_table = products, .probe = usbnet_probe, diff --git a/trunk/drivers/usb/net/catc.c b/trunk/drivers/usb/net/catc.c index be5f5e142dd0..37ef365a2472 100644 --- a/trunk/drivers/usb/net/catc.c +++ b/trunk/drivers/usb/net/catc.c @@ -934,6 +934,7 @@ static struct usb_device_id catc_id_table [] = { MODULE_DEVICE_TABLE(usb, catc_id_table); static struct usb_driver catc_driver = { + .owner = THIS_MODULE, .name = driver_name, .probe = catc_probe, .disconnect = catc_disconnect, diff --git a/trunk/drivers/usb/net/cdc_ether.c b/trunk/drivers/usb/net/cdc_ether.c index 63f1f3ba8e0b..652b04bbf6af 100644 --- a/trunk/drivers/usb/net/cdc_ether.c +++ b/trunk/drivers/usb/net/cdc_ether.c @@ -21,6 +21,9 @@ // #define VERBOSE // more; success messages #include +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include #include #include @@ -476,6 +479,7 @@ static const struct usb_device_id products [] = { MODULE_DEVICE_TABLE(usb, products); static struct usb_driver cdc_driver = { + .owner = THIS_MODULE, .name = "cdc_ether", .id_table = products, .probe = usbnet_probe, diff --git a/trunk/drivers/usb/net/cdc_subset.c b/trunk/drivers/usb/net/cdc_subset.c index ec801e8bb1bb..f1730b685fd2 100644 --- a/trunk/drivers/usb/net/cdc_subset.c +++ b/trunk/drivers/usb/net/cdc_subset.c @@ -18,6 +18,9 @@ */ #include +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include #include #include @@ -306,6 +309,7 @@ MODULE_DEVICE_TABLE(usb, products); /*-------------------------------------------------------------------------*/ static struct usb_driver cdc_subset_driver = { + .owner = THIS_MODULE, .name = "cdc_subset", .probe = usbnet_probe, .suspend = usbnet_suspend, diff --git a/trunk/drivers/usb/net/gl620a.c b/trunk/drivers/usb/net/gl620a.c index faf1e86be687..c0f263b202a6 100644 --- a/trunk/drivers/usb/net/gl620a.c +++ b/trunk/drivers/usb/net/gl620a.c @@ -22,6 +22,9 @@ // #define VERBOSE // more; success messages #include +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include #include #include @@ -377,6 +380,7 @@ static const struct usb_device_id products [] = { MODULE_DEVICE_TABLE(usb, products); static struct usb_driver gl620a_driver = { + .owner = THIS_MODULE, .name = "gl620a", .id_table = products, .probe = usbnet_probe, diff --git a/trunk/drivers/usb/net/kaweth.c b/trunk/drivers/usb/net/kaweth.c index def3bb8e2290..6bef1be6b36c 100644 --- a/trunk/drivers/usb/net/kaweth.c +++ b/trunk/drivers/usb/net/kaweth.c @@ -175,6 +175,7 @@ MODULE_DEVICE_TABLE (usb, usb_klsi_table); * kaweth_driver ****************************************************************/ static struct usb_driver kaweth_driver = { + .owner = THIS_MODULE, .name = driver_name, .probe = kaweth_probe, .disconnect = kaweth_disconnect, @@ -218,6 +219,7 @@ struct kaweth_device __u32 status; int end; + int removed; int suspend_lowmem_rx; int suspend_lowmem_ctrl; int linkstate; @@ -697,7 +699,6 @@ static int kaweth_close(struct net_device *net) usb_kill_urb(kaweth->irq_urb); usb_kill_urb(kaweth->rx_urb); - usb_kill_urb(kaweth->tx_urb); flush_scheduled_work(); @@ -749,6 +750,13 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net) spin_lock(&kaweth->device_lock); + if (kaweth->removed) { + /* our device is undergoing disconnection - we bail out */ + spin_unlock(&kaweth->device_lock); + dev_kfree_skb_irq(skb); + return 0; + } + kaweth_async_set_rx_mode(kaweth); netif_stop_queue(net); @@ -1128,6 +1136,10 @@ static void kaweth_disconnect(struct usb_interface *intf) return; } netdev = kaweth->net; + kaweth->removed = 1; + usb_kill_urb(kaweth->irq_urb); + usb_kill_urb(kaweth->rx_urb); + usb_kill_urb(kaweth->tx_urb); kaweth_dbg("Unregistering net device"); unregister_netdev(netdev); diff --git a/trunk/drivers/usb/net/net1080.c b/trunk/drivers/usb/net/net1080.c index 78e6a43b1087..cee55f8cf64f 100644 --- a/trunk/drivers/usb/net/net1080.c +++ b/trunk/drivers/usb/net/net1080.c @@ -21,6 +21,9 @@ // #define VERBOSE // more; success messages #include +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include #include #include @@ -593,6 +596,7 @@ static const struct usb_device_id products [] = { MODULE_DEVICE_TABLE(usb, products); static struct usb_driver net1080_driver = { + .owner = THIS_MODULE, .name = "net1080", .id_table = products, .probe = usbnet_probe, diff --git a/trunk/drivers/usb/net/pegasus.c b/trunk/drivers/usb/net/pegasus.c index 156a2f1cb39a..537eb181d985 100644 --- a/trunk/drivers/usb/net/pegasus.c +++ b/trunk/drivers/usb/net/pegasus.c @@ -28,6 +28,8 @@ * is out of the interrupt routine. */ +#undef DEBUG + #include #include #include @@ -45,7 +47,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v0.6.13 (2005/11/13)" +#define DRIVER_VERSION "v0.6.12 (2005/01/13)" #define DRIVER_AUTHOR "Petko Manolov " #define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver" @@ -57,14 +59,12 @@ static const char driver_name[] = "pegasus"; static int loopback = 0; static int mii_mode = 0; -static char *devid=NULL; static struct usb_eth_dev usb_dev_id[] = { #define PEGASUS_DEV(pn, vid, pid, flags) \ {.name = pn, .vendor = vid, .device = pid, .private = flags}, #include "pegasus.h" #undef PEGASUS_DEV - {NULL, 0, 0, 0}, {NULL, 0, 0, 0} }; @@ -73,7 +73,6 @@ static struct usb_device_id pegasus_ids[] = { {.match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = vid, .idProduct = pid}, #include "pegasus.h" #undef PEGASUS_DEV - {}, {} }; @@ -82,10 +81,8 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); module_param(loopback, bool, 0); module_param(mii_mode, bool, 0); -module_param(devid, charp, 0); MODULE_PARM_DESC(loopback, "Enable MAC loopback mode (bit 0)"); MODULE_PARM_DESC(mii_mode, "Enable HomePNA mode (bit 0),default=MII mode = 0"); -MODULE_PARM_DESC(devid, "The format is: 'DEV_name:VendorID:DeviceID:Flags'"); /* use ethtool to change the level for any given device */ static int msg_level = -1; @@ -118,7 +115,7 @@ static void ctrl_callback(struct urb *urb, struct pt_regs *regs) break; default: if (netif_msg_drv(pegasus)) - dev_dbg(&pegasus->intf->dev, "%s, status %d\n", + dev_err(&pegasus->intf->dev, "%s, status %d\n", __FUNCTION__, urb->status); } pegasus->flags &= ~ETH_REGS_CHANGED; @@ -313,9 +310,9 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd) __le16 regdi; int ret; - set_register(pegasus, PhyCtrl, 0); - set_registers(pegasus, PhyAddr, sizeof (data), data); - set_register(pegasus, PhyCtrl, (indx | PHY_READ)); + ret = set_register(pegasus, PhyCtrl, 0); + ret = set_registers(pegasus, PhyAddr, sizeof (data), data); + ret = set_register(pegasus, PhyCtrl, (indx | PHY_READ)); for (i = 0; i < REG_TIMEOUT; i++) { ret = get_registers(pegasus, PhyCtrl, 1, data); if (data[0] & PHY_DONE) @@ -324,12 +321,12 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd) if (i < REG_TIMEOUT) { ret = get_registers(pegasus, PhyData, 2, ®di); *regd = le16_to_cpu(regdi); - return ret; + return 1; } if (netif_msg_drv(pegasus)) dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); - return ret; + return 0; } static int mdio_read(struct net_device *dev, int phy_id, int loc) @@ -349,20 +346,20 @@ static int write_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 regd) data[1] = (u8) regd; data[2] = (u8) (regd >> 8); - set_register(pegasus, PhyCtrl, 0); - set_registers(pegasus, PhyAddr, sizeof(data), data); - set_register(pegasus, PhyCtrl, (indx | PHY_WRITE)); + ret = set_register(pegasus, PhyCtrl, 0); + ret = set_registers(pegasus, PhyAddr, sizeof(data), data); + ret = set_register(pegasus, PhyCtrl, (indx | PHY_WRITE)); for (i = 0; i < REG_TIMEOUT; i++) { ret = get_registers(pegasus, PhyCtrl, 1, data); if (data[0] & PHY_DONE) break; } if (i < REG_TIMEOUT) - return ret; + return 0; if (netif_msg_drv(pegasus)) dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); - return -ETIMEDOUT; + return 1; } static void mdio_write(struct net_device *dev, int phy_id, int loc, int val) @@ -379,9 +376,9 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata) __le16 retdatai; int ret; - set_register(pegasus, EpromCtrl, 0); - set_register(pegasus, EpromOffset, index); - set_register(pegasus, EpromCtrl, EPROM_READ); + ret = set_register(pegasus, EpromCtrl, 0); + ret = set_register(pegasus, EpromOffset, index); + ret = set_register(pegasus, EpromCtrl, EPROM_READ); for (i = 0; i < REG_TIMEOUT; i++) { ret = get_registers(pegasus, EpromCtrl, 1, &tmp); @@ -391,12 +388,12 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata) if (i < REG_TIMEOUT) { ret = get_registers(pegasus, EpromData, 2, &retdatai); *retdata = le16_to_cpu(retdatai); - return ret; + return 0; } if (netif_msg_drv(pegasus)) dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); - return -ETIMEDOUT; + return -1; } #ifdef PEGASUS_WRITE_EEPROM @@ -405,8 +402,8 @@ static inline void enable_eprom_write(pegasus_t * pegasus) __u8 tmp; int ret; - get_registers(pegasus, EthCtrl2, 1, &tmp); - set_register(pegasus, EthCtrl2, tmp | EPROM_WR_ENABLE); + ret = get_registers(pegasus, EthCtrl2, 1, &tmp); + ret = set_register(pegasus, EthCtrl2, tmp | EPROM_WR_ENABLE); } static inline void disable_eprom_write(pegasus_t * pegasus) @@ -414,9 +411,9 @@ static inline void disable_eprom_write(pegasus_t * pegasus) __u8 tmp; int ret; - get_registers(pegasus, EthCtrl2, 1, &tmp); - set_register(pegasus, EpromCtrl, 0); - set_register(pegasus, EthCtrl2, tmp & ~EPROM_WR_ENABLE); + ret = get_registers(pegasus, EthCtrl2, 1, &tmp); + ret = set_register(pegasus, EpromCtrl, 0); + ret = set_register(pegasus, EthCtrl2, tmp & ~EPROM_WR_ENABLE); } static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data) @@ -425,11 +422,11 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data) __u8 tmp, d[4] = { 0x3f, 0, 0, EPROM_WRITE }; int ret; - set_registers(pegasus, EpromOffset, 4, d); + ret = set_registers(pegasus, EpromOffset, 4, d); enable_eprom_write(pegasus); - set_register(pegasus, EpromOffset, index); - set_registers(pegasus, EpromData, 2, &data); - set_register(pegasus, EpromCtrl, EPROM_WRITE); + ret = set_register(pegasus, EpromOffset, index); + ret = set_registers(pegasus, EpromData, 2, &data); + ret = set_register(pegasus, EpromCtrl, EPROM_WRITE); for (i = 0; i < REG_TIMEOUT; i++) { ret = get_registers(pegasus, EpromCtrl, 1, &tmp); @@ -438,10 +435,10 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data) } disable_eprom_write(pegasus); if (i < REG_TIMEOUT) - return ret; + return 0; if (netif_msg_drv(pegasus)) dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); - return -ETIMEDOUT; + return -1; } #endif /* PEGASUS_WRITE_EEPROM */ @@ -459,9 +456,10 @@ static inline void get_node_id(pegasus_t * pegasus, __u8 * id) static void set_ethernet_addr(pegasus_t * pegasus) { __u8 node_id[6]; + int ret; get_node_id(pegasus, node_id); - set_registers(pegasus, EthID, sizeof (node_id), node_id); + ret = set_registers(pegasus, EthID, sizeof (node_id), node_id); memcpy(pegasus->net->dev_addr, node_id, sizeof (node_id)); } @@ -469,29 +467,30 @@ static inline int reset_mac(pegasus_t * pegasus) { __u8 data = 0x8; int i; + int ret; - set_register(pegasus, EthCtrl1, data); + ret = set_register(pegasus, EthCtrl1, data); for (i = 0; i < REG_TIMEOUT; i++) { - get_registers(pegasus, EthCtrl1, 1, &data); + ret = get_registers(pegasus, EthCtrl1, 1, &data); if (~data & 0x08) { if (loopback & 1) break; if (mii_mode && (pegasus->features & HAS_HOME_PNA)) - set_register(pegasus, Gpio1, 0x34); + ret = set_register(pegasus, Gpio1, 0x34); else - set_register(pegasus, Gpio1, 0x26); - set_register(pegasus, Gpio0, pegasus->features); - set_register(pegasus, Gpio0, DEFAULT_GPIO_SET); + ret = set_register(pegasus, Gpio1, 0x26); + ret = set_register(pegasus, Gpio0, pegasus->features); + ret = set_register(pegasus, Gpio0, DEFAULT_GPIO_SET); break; } } if (i == REG_TIMEOUT) - return -ETIMEDOUT; + return 1; if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_LINKSYS || usb_dev_id[pegasus->dev_index].vendor == VENDOR_DLINK) { - set_register(pegasus, Gpio0, 0x24); - set_register(pegasus, Gpio0, 0x26); + ret = set_register(pegasus, Gpio0, 0x24); + ret = set_register(pegasus, Gpio0, 0x26); } if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_ELCON) { __u16 auxmode; @@ -530,7 +529,7 @@ static int enable_net_traffic(struct net_device *dev, struct usb_device *usb) write_mii_word(pegasus, 0, 0x1b, auxmode | 4); } - return ret; + return 0; } static void fill_skb_pool(pegasus_t * pegasus) @@ -884,8 +883,9 @@ static struct net_device_stats *pegasus_netdev_stats(struct net_device *dev) static inline void disable_net_traffic(pegasus_t * pegasus) { int tmp = 0; + int ret; - set_registers(pegasus, EthCtrl0, 2, &tmp); + ret = set_registers(pegasus, EthCtrl0, 2, &tmp); } static inline void get_interrupt_interval(pegasus_t * pegasus) @@ -1208,17 +1208,18 @@ static __u8 mii_phy_probe(pegasus_t * pegasus) static inline void setup_pegasus_II(pegasus_t * pegasus) { __u8 data = 0xa5; + int ret; - set_register(pegasus, Reg1d, 0); - set_register(pegasus, Reg7b, 1); + ret = set_register(pegasus, Reg1d, 0); + ret = set_register(pegasus, Reg7b, 1); mdelay(100); if ((pegasus->features & HAS_HOME_PNA) && mii_mode) - set_register(pegasus, Reg7b, 0); + ret = set_register(pegasus, Reg7b, 0); else - set_register(pegasus, Reg7b, 2); + ret = set_register(pegasus, Reg7b, 2); - set_register(pegasus, 0x83, data); - get_registers(pegasus, 0x83, 1, &data); + ret = set_register(pegasus, 0x83, data); + ret = get_registers(pegasus, 0x83, 1, &data); if (data == 0xa5) { pegasus->chip = 0x8513; @@ -1226,14 +1227,14 @@ static inline void setup_pegasus_II(pegasus_t * pegasus) pegasus->chip = 0; } - set_register(pegasus, 0x80, 0xc0); - set_register(pegasus, 0x83, 0xff); - set_register(pegasus, 0x84, 0x01); + ret = set_register(pegasus, 0x80, 0xc0); + ret = set_register(pegasus, 0x83, 0xff); + ret = set_register(pegasus, 0x84, 0x01); if (pegasus->features & HAS_HOME_PNA && mii_mode) - set_register(pegasus, Reg81, 6); + ret = set_register(pegasus, Reg81, 6); else - set_register(pegasus, Reg81, 2); + ret = set_register(pegasus, Reg81, 2); } @@ -1415,42 +1416,9 @@ static struct usb_driver pegasus_driver = { .resume = pegasus_resume, }; -static void parse_id(char *id) -{ - unsigned int vendor_id=0, device_id=0, flags=0, i=0; - char *token, *name=NULL; - - if ((token = strsep(&id, ":")) != NULL) - name = token; - /* name now points to a null terminated string*/ - if ((token = strsep(&id, ":")) != NULL) - vendor_id = simple_strtoul(token, NULL, 16); - if ((token = strsep(&id, ":")) != NULL) - device_id = simple_strtoul(token, NULL, 16); - flags = simple_strtoul(id, NULL, 16); - pr_info("%s: new device %s, vendor ID 0x%04x, device ID 0x%04x, flags: 0x%x\n", - driver_name, name, vendor_id, device_id, flags); - - if (vendor_id > 0x10000 || vendor_id == 0) - return; - if (device_id > 0x10000 || device_id == 0) - return; - - for (i=0; usb_dev_id[i].name; i++); - usb_dev_id[i].name = name; - usb_dev_id[i].vendor = vendor_id; - usb_dev_id[i].device = device_id; - usb_dev_id[i].private = flags; - pegasus_ids[i].match_flags = USB_DEVICE_ID_MATCH_DEVICE; - pegasus_ids[i].idVendor = vendor_id; - pegasus_ids[i].idProduct = device_id; -} - static int __init pegasus_init(void) { pr_info("%s: %s, " DRIVER_DESC "\n", driver_name, DRIVER_VERSION); - if (devid) - parse_id(devid); pegasus_workqueue = create_singlethread_workqueue("pegasus"); if (!pegasus_workqueue) return -ENOMEM; diff --git a/trunk/drivers/usb/net/plusb.c b/trunk/drivers/usb/net/plusb.c index 4fe863389cb7..74c2b3581c76 100644 --- a/trunk/drivers/usb/net/plusb.c +++ b/trunk/drivers/usb/net/plusb.c @@ -21,6 +21,9 @@ // #define VERBOSE // more; success messages #include +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include #include #include @@ -127,6 +130,7 @@ static const struct usb_device_id products [] = { MODULE_DEVICE_TABLE(usb, products); static struct usb_driver plusb_driver = { + .owner = THIS_MODULE, .name = "plusb", .id_table = products, .probe = usbnet_probe, diff --git a/trunk/drivers/usb/net/rndis_host.c b/trunk/drivers/usb/net/rndis_host.c index 49991ac1bf3b..b5a925dc1beb 100644 --- a/trunk/drivers/usb/net/rndis_host.c +++ b/trunk/drivers/usb/net/rndis_host.c @@ -21,6 +21,9 @@ // #define VERBOSE // more; success messages #include +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include #include #include @@ -586,6 +589,7 @@ static const struct usb_device_id products [] = { MODULE_DEVICE_TABLE(usb, products); static struct usb_driver rndis_driver = { + .owner = THIS_MODULE, .name = "rndis_host", .id_table = products, .probe = usbnet_probe, diff --git a/trunk/drivers/usb/net/rtl8150.c b/trunk/drivers/usb/net/rtl8150.c index 8ca52be23976..787dd3591d6a 100644 --- a/trunk/drivers/usb/net/rtl8150.c +++ b/trunk/drivers/usb/net/rtl8150.c @@ -177,6 +177,7 @@ static int rtl8150_probe(struct usb_interface *intf, static const char driver_name [] = "rtl8150"; static struct usb_driver rtl8150_driver = { + .owner = THIS_MODULE, .name = driver_name, .probe = rtl8150_probe, .disconnect = rtl8150_disconnect, diff --git a/trunk/drivers/usb/net/usbnet.c b/trunk/drivers/usb/net/usbnet.c index 362d6907c9bb..74f05c9c84d5 100644 --- a/trunk/drivers/usb/net/usbnet.c +++ b/trunk/drivers/usb/net/usbnet.c @@ -34,6 +34,9 @@ // #define VERBOSE // more; success messages #include +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include #include #include diff --git a/trunk/drivers/usb/net/zaurus.c b/trunk/drivers/usb/net/zaurus.c index 9c5ab251370c..5d4b7d55b097 100644 --- a/trunk/drivers/usb/net/zaurus.c +++ b/trunk/drivers/usb/net/zaurus.c @@ -21,6 +21,9 @@ // #define VERBOSE // more; success messages #include +#ifdef CONFIG_USB_DEBUG +# define DEBUG +#endif #include #include #include @@ -357,6 +360,7 @@ static const struct usb_device_id products [] = { MODULE_DEVICE_TABLE(usb, products); static struct usb_driver zaurus_driver = { + .owner = THIS_MODULE, .name = "zaurus", .id_table = products, .probe = usbnet_probe, diff --git a/trunk/drivers/usb/net/zd1201.c b/trunk/drivers/usb/net/zd1201.c index f3a8e2807c3b..2f52261c7cc1 100644 --- a/trunk/drivers/usb/net/zd1201.c +++ b/trunk/drivers/usb/net/zd1201.c @@ -1722,7 +1722,7 @@ static const struct iw_priv_args zd1201_private_args[] = { IW_PRIV_TYPE_NONE, "sethostauth" }, { ZD1201GIWHOSTAUTH, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "gethostauth" }, - { ZD1201SIWAUTHSTA, IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, + { ZD1201SIWAUTHSTA, IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_NONE, "authstation" }, { ZD1201SIWMAXASSOC, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_NONE, "setmaxassoc" }, @@ -1731,9 +1731,9 @@ static const struct iw_priv_args zd1201_private_args[] = { }; static const struct iw_handler_def zd1201_iw_handlers = { - .num_standard = ARRAY_SIZE(zd1201_iw_handler), - .num_private = ARRAY_SIZE(zd1201_private_handler), - .num_private_args = ARRAY_SIZE(zd1201_private_args), + .num_standard = sizeof(zd1201_iw_handler)/sizeof(iw_handler), + .num_private = sizeof(zd1201_private_handler)/sizeof(iw_handler), + .num_private_args = sizeof(zd1201_private_args)/sizeof(struct iw_priv_args), .standard = (iw_handler *)zd1201_iw_handler, .private = (iw_handler *)zd1201_private_handler, .private_args = (struct iw_priv_args *) zd1201_private_args, @@ -1829,8 +1829,6 @@ static int zd1201_probe(struct usb_interface *interface, if (err) goto err_net; - SET_NETDEV_DEV(zd->dev, &usb->dev); - err = register_netdev(zd->dev); if (err) goto err_net; @@ -1925,6 +1923,7 @@ static int zd1201_resume(struct usb_interface *interface) #endif static struct usb_driver zd1201_usb = { + .owner = THIS_MODULE, .name = "zd1201", .probe = zd1201_probe, .disconnect = zd1201_disconnect, diff --git a/trunk/drivers/usb/serial/ChangeLog.history b/trunk/drivers/usb/serial/ChangeLog.old similarity index 99% rename from trunk/drivers/usb/serial/ChangeLog.history rename to trunk/drivers/usb/serial/ChangeLog.old index 52c4f7bd7a80..c1b279939bbf 100644 --- a/trunk/drivers/usb/serial/ChangeLog.history +++ b/trunk/drivers/usb/serial/ChangeLog.old @@ -400,7 +400,7 @@ visor.c Change Log comments: (11/11/2001) gkh Added support for the m125 devices, and added check to prevent oopses - for Clié devices that lie about the number of ports they have. + for Clié devices that lie about the number of ports they have. (08/30/2001) gkh Added support for the Clie devices, both the 3.5 and 4.0 os versions. diff --git a/trunk/drivers/usb/serial/Kconfig b/trunk/drivers/usb/serial/Kconfig index 14f55fd26a64..7b5e8e4ee2bb 100644 --- a/trunk/drivers/usb/serial/Kconfig +++ b/trunk/drivers/usb/serial/Kconfig @@ -62,15 +62,6 @@ config USB_SERIAL_AIRPRIME To compile this driver as a module, choose M here: the module will be called airprime. -config USB_SERIAL_ANYDATA - tristate "USB AnyData CDMA Wireless Driver" - depends on USB_SERIAL - help - Say Y here if you want to use a AnyData CDMA device. - - To compile this driver as a module, choose M here: the - module will be called anydata. - config USB_SERIAL_BELKIN tristate "USB Belkin and Peracom Single Port Serial Driver" depends on USB_SERIAL @@ -403,6 +394,15 @@ config USB_SERIAL_MCT_U232 To compile this driver as a module, choose M here: the module will be called mct_u232. +config USB_SERIAL_NOKIA_DKU2 + tristate "USB Nokia DKU2 Driver" + depends on USB_SERIAL + help + Say Y here if you want to use a Nokia DKU2 device. + + To compile this driver as a module, choose M here: the + module will be called nokia_dku2. + config USB_SERIAL_PL2303 tristate "USB Prolific 2303 Single Port Serial Driver" depends on USB_SERIAL diff --git a/trunk/drivers/usb/serial/Makefile b/trunk/drivers/usb/serial/Makefile index f0b04420cea1..55fd461793b7 100644 --- a/trunk/drivers/usb/serial/Makefile +++ b/trunk/drivers/usb/serial/Makefile @@ -12,7 +12,6 @@ usbserial-obj-$(CONFIG_USB_EZUSB) += ezusb.o usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y) obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o -obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o @@ -32,6 +31,7 @@ obj-$(CONFIG_USB_SERIAL_KEYSPAN_PDA) += keyspan_pda.o obj-$(CONFIG_USB_SERIAL_KLSI) += kl5kusb105.o obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += kobil_sct.o obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o +obj-$(CONFIG_USB_SERIAL_NOKIA_DKU2) += nokia_dku2.o obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o obj-$(CONFIG_USB_SERIAL_OPTION) += option.o obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o diff --git a/trunk/drivers/usb/serial/airprime.c b/trunk/drivers/usb/serial/airprime.c index dbf1f063098c..1f29d8837327 100644 --- a/trunk/drivers/usb/serial/airprime.c +++ b/trunk/drivers/usb/serial/airprime.c @@ -23,11 +23,11 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE(usb, id_table); static struct usb_driver airprime_driver = { + .owner = THIS_MODULE, .name = "airprime", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; static struct usb_serial_driver airprime_device = { diff --git a/trunk/drivers/usb/serial/anydata.c b/trunk/drivers/usb/serial/anydata.c deleted file mode 100644 index 343f6f228220..000000000000 --- a/trunk/drivers/usb/serial/anydata.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * AnyData CDMA Serial USB driver - * - * Copyright (C) 2005 Greg Kroah-Hartman - * - * 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 -#include -#include -#include -#include -#include "usb-serial.h" - -static struct usb_device_id id_table [] = { - { USB_DEVICE(0x16d5, 0x6501) }, /* AirData CDMA device */ - { }, -}; -MODULE_DEVICE_TABLE(usb, id_table); - -/* if overridden by the user, then use their value for the size of the - * read and write urbs */ -static int buffer_size; -static int debug; - -static struct usb_driver anydata_driver = { - .name = "anydata", - .probe = usb_serial_probe, - .disconnect = usb_serial_disconnect, - .id_table = id_table, - .no_dynamic_id = 1, -}; - -static int anydata_open(struct usb_serial_port *port, struct file *filp) -{ - char *buffer; - int result = 0; - - dbg("%s - port %d", __FUNCTION__, port->number); - - if (buffer_size) { - /* override the default buffer sizes */ - buffer = kmalloc(buffer_size, GFP_KERNEL); - if (!buffer) { - dev_err(&port->dev, "%s - out of memory.\n", - __FUNCTION__); - return -ENOMEM; - } - kfree (port->read_urb->transfer_buffer); - port->read_urb->transfer_buffer = buffer; - port->read_urb->transfer_buffer_length = buffer_size; - - buffer = kmalloc(buffer_size, GFP_KERNEL); - if (!buffer) { - dev_err(&port->dev, "%s - out of memory.\n", - __FUNCTION__); - return -ENOMEM; - } - kfree (port->write_urb->transfer_buffer); - port->write_urb->transfer_buffer = buffer; - port->write_urb->transfer_buffer_length = buffer_size; - port->bulk_out_size = buffer_size; - } - - /* Start reading from the device */ - usb_fill_bulk_urb(port->read_urb, port->serial->dev, - usb_rcvbulkpipe(port->serial->dev, - port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, - port->read_urb->transfer_buffer_length, - usb_serial_generic_write_bulk_callback, port); - result = usb_submit_urb(port->read_urb, GFP_KERNEL); - if (result) - dev_err(&port->dev, - "%s - failed submitting read urb, error %d\n", - __FUNCTION__, result); - - return result; -} - -static struct usb_serial_driver anydata_device = { - .driver = { - .owner = THIS_MODULE, - .name = "anydata", - }, - .id_table = id_table, - .num_interrupt_in = NUM_DONT_CARE, - .num_bulk_in = NUM_DONT_CARE, - .num_bulk_out = NUM_DONT_CARE, - .num_ports = 1, - .open = anydata_open, -}; - -static int __init anydata_init(void) -{ - int retval; - - retval = usb_serial_register(&anydata_device); - if (retval) - return retval; - retval = usb_register(&anydata_driver); - if (retval) - usb_serial_deregister(&anydata_device); - return retval; -} - -static void __exit anydata_exit(void) -{ - usb_deregister(&anydata_driver); - usb_serial_deregister(&anydata_device); -} - -module_init(anydata_init); -module_exit(anydata_exit); -MODULE_LICENSE("GPL"); - -module_param(debug, bool, S_IRUGO | S_IWUSR); -MODULE_PARM_DESC(debug, "Debug enabled or not"); -module_param(buffer_size, int, 0); -MODULE_PARM_DESC(buffer_size, "Size of the transfer buffers"); diff --git a/trunk/drivers/usb/serial/belkin_sa.c b/trunk/drivers/usb/serial/belkin_sa.c index 4144777ea18b..84bc0ee4f061 100644 --- a/trunk/drivers/usb/serial/belkin_sa.c +++ b/trunk/drivers/usb/serial/belkin_sa.c @@ -113,11 +113,11 @@ static struct usb_device_id id_table_combined [] = { MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_driver belkin_driver = { + .owner = THIS_MODULE, .name = "belkin", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; /* All of the device info needed for the serial converters */ diff --git a/trunk/drivers/usb/serial/cp2101.c b/trunk/drivers/usb/serial/cp2101.c index da46b351e188..c5334dd89b12 100644 --- a/trunk/drivers/usb/serial/cp2101.c +++ b/trunk/drivers/usb/serial/cp2101.c @@ -60,18 +60,17 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ { USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */ { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */ - { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ { } /* Terminating Entry */ }; MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver cp2101_driver = { + .owner = THIS_MODULE, .name = "cp2101", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; static struct usb_serial_driver cp2101_device = { diff --git a/trunk/drivers/usb/serial/cyberjack.c b/trunk/drivers/usb/serial/cyberjack.c index 6d18d4eaba35..e581e4ae8483 100644 --- a/trunk/drivers/usb/serial/cyberjack.c +++ b/trunk/drivers/usb/serial/cyberjack.c @@ -76,11 +76,11 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver cyberjack_driver = { + .owner = THIS_MODULE, .name = "cyberjack", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; static struct usb_serial_driver cyberjack_device = { diff --git a/trunk/drivers/usb/serial/cypress_m8.c b/trunk/drivers/usb/serial/cypress_m8.c index af18355e94cc..af9290ed257b 100644 --- a/trunk/drivers/usb/serial/cypress_m8.c +++ b/trunk/drivers/usb/serial/cypress_m8.c @@ -112,7 +112,6 @@ static struct usb_driver cypress_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; struct cypress_private { diff --git a/trunk/drivers/usb/serial/digi_acceleport.c b/trunk/drivers/usb/serial/digi_acceleport.c index 8fc414bd5b24..dc74644a603d 100644 --- a/trunk/drivers/usb/serial/digi_acceleport.c +++ b/trunk/drivers/usb/serial/digi_acceleport.c @@ -493,11 +493,11 @@ static struct usb_device_id id_table_4 [] = { MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_driver digi_driver = { + .owner = THIS_MODULE, .name = "digi_acceleport", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; diff --git a/trunk/drivers/usb/serial/empeg.c b/trunk/drivers/usb/serial/empeg.c index 79a766e9ca23..0b0546dcc7b9 100644 --- a/trunk/drivers/usb/serial/empeg.c +++ b/trunk/drivers/usb/serial/empeg.c @@ -105,11 +105,11 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver empeg_driver = { + .owner = THIS_MODULE, .name = "empeg", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; static struct usb_serial_driver empeg_device = { diff --git a/trunk/drivers/usb/serial/ftdi_sio.c b/trunk/drivers/usb/serial/ftdi_sio.c index eb863b3f2d79..61204bf7cd78 100644 --- a/trunk/drivers/usb/serial/ftdi_sio.c +++ b/trunk/drivers/usb/serial/ftdi_sio.c @@ -471,15 +471,10 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, - { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, - { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16HR_PID) }, - { USB_DEVICE(KOBIL_VID, KOBIL_CONV_B1_PID) }, - { USB_DEVICE(KOBIL_VID, KOBIL_CONV_KAAN_PID) }, - { USB_DEVICE(POSIFLEX_VID, POSIFLEX_PP7000_PID) }, { }, /* Optional parameter entry */ { } /* Terminating entry */ }; @@ -491,10 +486,9 @@ static struct usb_driver ftdi_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; -static const char *ftdi_chip_name[] = { +static char *ftdi_chip_name[] = { [SIO] = "SIO", /* the serial part of FT8U100AX */ [FT8U232AM] = "FT8U232AM", [FT232BM] = "FT232BM", diff --git a/trunk/drivers/usb/serial/ftdi_sio.h b/trunk/drivers/usb/serial/ftdi_sio.h index f380f9eaff71..ddb63df31ce6 100644 --- a/trunk/drivers/usb/serial/ftdi_sio.h +++ b/trunk/drivers/usb/serial/ftdi_sio.h @@ -127,13 +127,6 @@ #define SEALEVEL_2803_7_PID 0X2873 /* SeaLINK+8 (2803) Port 7 */ #define SEALEVEL_2803_8_PID 0X2883 /* SeaLINK+8 (2803) Port 8 */ -/* - * The following are the values for two KOBIL chipcard terminals. - */ -#define KOBIL_VID 0x0d46 /* KOBIL Vendor ID */ -#define KOBIL_CONV_B1_PID 0x2020 /* KOBIL Konverter for B1 */ -#define KOBIL_CONV_KAAN_PID 0x2021 /* KOBIL_Konverter for KAAN */ - /* * DSS-20 Sync Station for Sony Ericsson P800 */ @@ -342,13 +335,6 @@ #define XSENS_CONVERTER_6_PID 0xD38E #define XSENS_CONVERTER_7_PID 0xD38F -/* - * Teratronik product ids. - * Submitted by O. Wölfelschneider. - */ -#define FTDI_TERATRONIK_VCP_PID 0xEC88 /* Teratronik device (preferring VCP driver on windows) */ -#define FTDI_TERATRONIK_D2XX_PID 0xEC89 /* Teratronik device (preferring D2XX driver on windows) */ - /* * Evolution Robotics products (http://www.evolution.com/). * Submitted by Shawn M. Lavelle. @@ -359,12 +345,6 @@ /* Pyramid Computer GmbH */ #define FTDI_PYRAMID_PID 0xE6C8 /* Pyramid Appliance Display */ -/* - * Posiflex inc retail equipment (http://www.posiflex.com.tw) - */ -#define POSIFLEX_VID 0x0d3a /* Vendor ID */ -#define POSIFLEX_PP7000_PID 0x0300 /* PP-7000II thermal printer */ - /* Commands */ #define FTDI_SIO_RESET 0 /* Reset the port */ #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ diff --git a/trunk/drivers/usb/serial/garmin_gps.c b/trunk/drivers/usb/serial/garmin_gps.c index 452efce72714..35820bda7ae1 100644 --- a/trunk/drivers/usb/serial/garmin_gps.c +++ b/trunk/drivers/usb/serial/garmin_gps.c @@ -222,11 +222,11 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver garmin_driver = { + .owner = THIS_MODULE, .name = "garmin_gps", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; diff --git a/trunk/drivers/usb/serial/generic.c b/trunk/drivers/usb/serial/generic.c index 4ddac620fc0c..8909208f506a 100644 --- a/trunk/drivers/usb/serial/generic.c +++ b/trunk/drivers/usb/serial/generic.c @@ -68,11 +68,11 @@ static int generic_probe(struct usb_interface *interface, } static struct usb_driver generic_driver = { + .owner = THIS_MODULE, .name = "usbserial_generic", .probe = generic_probe, .disconnect = usb_serial_disconnect, .id_table = generic_serial_ids, - .no_dynamic_id = 1, }; #endif @@ -309,7 +309,6 @@ void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *re schedule_work(&port->work); } -EXPORT_SYMBOL_GPL(usb_serial_generic_write_bulk_callback); void usb_serial_generic_shutdown (struct usb_serial *serial) { diff --git a/trunk/drivers/usb/serial/hp4x.c b/trunk/drivers/usb/serial/hp4x.c index e9719da2aca1..8eadfb705601 100644 --- a/trunk/drivers/usb/serial/hp4x.c +++ b/trunk/drivers/usb/serial/hp4x.c @@ -37,11 +37,11 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE(usb, id_table); static struct usb_driver hp49gp_driver = { + .owner = THIS_MODULE, .name = "hp4X", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; static struct usb_serial_driver hp49gp_device = { diff --git a/trunk/drivers/usb/serial/io_edgeport.c b/trunk/drivers/usb/serial/io_edgeport.c index faedbeb6ba49..dc4c498bd1ed 100644 --- a/trunk/drivers/usb/serial/io_edgeport.c +++ b/trunk/drivers/usb/serial/io_edgeport.c @@ -184,7 +184,7 @@ struct divisor_table_entry { // These assume a 3.6864MHz crystal, the standard /16, and // MCR.7 = 0. // -static const struct divisor_table_entry divisor_table[] = { +static struct divisor_table_entry divisor_table[] = { { 50, 4608}, { 75, 3072}, { 110, 2095}, /* 2094.545455 => 230450 => .0217 % over */ @@ -242,11 +242,11 @@ static void edge_shutdown (struct usb_serial *serial); #include "io_tables.h" /* all of the devices that this driver supports */ static struct usb_driver io_driver = { + .owner = THIS_MODULE, .name = "io_edgeport", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; /* function prototypes for all of our local functions */ @@ -2353,7 +2353,7 @@ static int calc_baud_rate_divisor (int baudrate, int *divisor) dbg("%s - %d", __FUNCTION__, baudrate); - for (i = 0; i < ARRAY_SIZE(divisor_table); i++) { + for (i = 0; i < NUM_ENTRIES(divisor_table); i++) { if ( divisor_table[i].BaudRate == baudrate ) { *divisor = divisor_table[i].Divisor; return 0; diff --git a/trunk/drivers/usb/serial/io_edgeport.h b/trunk/drivers/usb/serial/io_edgeport.h index 123fa8a904e6..5112d7aac055 100644 --- a/trunk/drivers/usb/serial/io_edgeport.h +++ b/trunk/drivers/usb/serial/io_edgeport.h @@ -31,6 +31,9 @@ #ifndef HIGH8 #define HIGH8(a) ((unsigned char)((a & 0xff00) >> 8)) #endif +#ifndef NUM_ENTRIES + #define NUM_ENTRIES(x) (sizeof(x)/sizeof((x)[0])) +#endif #ifndef __KERNEL__ #define __KERNEL__ diff --git a/trunk/drivers/usb/serial/io_fw_boot2.h b/trunk/drivers/usb/serial/io_fw_boot2.h index e3463de99de4..c7c3a3c305fe 100644 --- a/trunk/drivers/usb/serial/io_fw_boot2.h +++ b/trunk/drivers/usb/serial/io_fw_boot2.h @@ -537,7 +537,7 @@ static unsigned char IMAGE_ARRAY_NAME[] = { }; -static const struct edge_firmware_version_info IMAGE_VERSION_NAME = { +static struct edge_firmware_version_info IMAGE_VERSION_NAME = { 2, 0, 3 }; // Major, Minor, Build #undef IMAGE_VERSION_NAME diff --git a/trunk/drivers/usb/serial/io_ti.c b/trunk/drivers/usb/serial/io_ti.c index 2edf9cabad20..832b6d6734c0 100644 --- a/trunk/drivers/usb/serial/io_ti.c +++ b/trunk/drivers/usb/serial/io_ti.c @@ -216,11 +216,11 @@ static struct usb_device_id id_table_combined [] = { MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_driver io_driver = { + .owner = THIS_MODULE, .name = "io_ti", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; @@ -2843,7 +2843,7 @@ static struct edge_buf *edge_buf_alloc(unsigned int size) * Free the buffer and all associated memory. */ -static void edge_buf_free(struct edge_buf *eb) +void edge_buf_free(struct edge_buf *eb) { if (eb) { kfree(eb->buf_buf); diff --git a/trunk/drivers/usb/serial/ipaq.c b/trunk/drivers/usb/serial/ipaq.c index 06d07cea0b70..d5d066488100 100644 --- a/trunk/drivers/usb/serial/ipaq.c +++ b/trunk/drivers/usb/serial/ipaq.c @@ -542,11 +542,11 @@ static struct usb_device_id ipaq_id_table [] = { MODULE_DEVICE_TABLE (usb, ipaq_id_table); static struct usb_driver ipaq_driver = { + .owner = THIS_MODULE, .name = "ipaq", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = ipaq_id_table, - .no_dynamic_id = 1, }; diff --git a/trunk/drivers/usb/serial/ipw.c b/trunk/drivers/usb/serial/ipw.c index 2dd191f5fe76..a02fada85362 100644 --- a/trunk/drivers/usb/serial/ipw.c +++ b/trunk/drivers/usb/serial/ipw.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include "usb-serial.h" @@ -152,11 +153,11 @@ static struct usb_device_id usb_ipw_ids[] = { MODULE_DEVICE_TABLE(usb, usb_ipw_ids); static struct usb_driver usb_ipw_driver = { + .owner = THIS_MODULE, .name = "ipwtty", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = usb_ipw_ids, - .no_dynamic_id = 1, }; static int debug; diff --git a/trunk/drivers/usb/serial/ir-usb.c b/trunk/drivers/usb/serial/ir-usb.c index a59010421444..19f329e9bdcf 100644 --- a/trunk/drivers/usb/serial/ir-usb.c +++ b/trunk/drivers/usb/serial/ir-usb.c @@ -125,11 +125,11 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver ir_driver = { + .owner = THIS_MODULE, .name = "ir-usb", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; diff --git a/trunk/drivers/usb/serial/keyspan.h b/trunk/drivers/usb/serial/keyspan.h index 7472ed6bf626..5cfc13b5e56f 100644 --- a/trunk/drivers/usb/serial/keyspan.h +++ b/trunk/drivers/usb/serial/keyspan.h @@ -520,11 +520,11 @@ static struct usb_device_id keyspan_ids_combined[] = { MODULE_DEVICE_TABLE(usb, keyspan_ids_combined); static struct usb_driver keyspan_driver = { + .owner = THIS_MODULE, .name = "keyspan", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = keyspan_ids_combined, - .no_dynamic_id = 1, }; /* usb_device_id table for the pre-firmware download keyspan devices */ diff --git a/trunk/drivers/usb/serial/keyspan_pda.c b/trunk/drivers/usb/serial/keyspan_pda.c index b0441c35f98f..cd4f48bd83b6 100644 --- a/trunk/drivers/usb/serial/keyspan_pda.c +++ b/trunk/drivers/usb/serial/keyspan_pda.c @@ -150,11 +150,11 @@ static struct usb_device_id id_table_combined [] = { MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_driver keyspan_pda_driver = { + .owner = THIS_MODULE, .name = "keyspan_pda", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; static struct usb_device_id id_table_std [] = { diff --git a/trunk/drivers/usb/serial/kl5kusb105.c b/trunk/drivers/usb/serial/kl5kusb105.c index 4e2f7dfb58b2..a8951c0fd020 100644 --- a/trunk/drivers/usb/serial/kl5kusb105.c +++ b/trunk/drivers/usb/serial/kl5kusb105.c @@ -116,11 +116,11 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver kl5kusb105d_driver = { + .owner = THIS_MODULE, .name = "kl5kusb105d", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; static struct usb_serial_driver kl5kusb105d_device = { diff --git a/trunk/drivers/usb/serial/kobil_sct.c b/trunk/drivers/usb/serial/kobil_sct.c index d9c21e275130..9456dd9dd136 100644 --- a/trunk/drivers/usb/serial/kobil_sct.c +++ b/trunk/drivers/usb/serial/kobil_sct.c @@ -97,11 +97,11 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver kobil_driver = { + .owner = THIS_MODULE, .name = "kobil", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; diff --git a/trunk/drivers/usb/serial/mct_u232.c b/trunk/drivers/usb/serial/mct_u232.c index b6d6cab9c859..ca5dbadb9b7e 100644 --- a/trunk/drivers/usb/serial/mct_u232.c +++ b/trunk/drivers/usb/serial/mct_u232.c @@ -125,11 +125,11 @@ static struct usb_device_id id_table_combined [] = { MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_driver mct_u232_driver = { + .owner = THIS_MODULE, .name = "mct_u232", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; static struct usb_serial_driver mct_u232_device = { diff --git a/trunk/drivers/usb/serial/nokia_dku2.c b/trunk/drivers/usb/serial/nokia_dku2.c new file mode 100644 index 000000000000..fad01bef3a64 --- /dev/null +++ b/trunk/drivers/usb/serial/nokia_dku2.c @@ -0,0 +1,142 @@ +/* + * Nokia DKU2 USB driver + * + * Copyright (C) 2004 + * Author: C Kemp + * + * This program is largely derived from work by the linux-usb group + * and associated source files. Please see the usb/serial files for + * individual credits and copyrights. + * + * 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. + * + * 20.09.2005 - Matthias Blaesing + * Added short name to device structure to make driver load into kernel 2.6.13 + * + * 20.09.2005 - Matthias Blaesing + * Added usb_deregister to exit code - to allow remove and reinsert of module + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "usb-serial.h" + + +#define NOKIA_VENDOR_ID 0x0421 +#define NOKIA7600_PRODUCT_ID 0x0400 +#define NOKIA6230_PRODUCT_ID 0x040f +#define NOKIA6170_PRODUCT_ID 0x0416 +#define NOKIA6670_PRODUCT_ID 0x041d +#define NOKIA6680_PRODUCT_ID 0x041e +#define NOKIA6230i_PRODUCT_ID 0x0428 + +#define NOKIA_AT_PORT 0x82 +#define NOKIA_FBUS_PORT 0x86 + +/* + * Version Information + */ +#define DRIVER_VERSION "v0.2" +#define DRIVER_AUTHOR "C Kemp" +#define DRIVER_DESC "Nokia DKU2 Driver" + +static struct usb_device_id id_table [] = { + { USB_DEVICE(NOKIA_VENDOR_ID, NOKIA7600_PRODUCT_ID) }, + { USB_DEVICE(NOKIA_VENDOR_ID, NOKIA6230_PRODUCT_ID) }, + { USB_DEVICE(NOKIA_VENDOR_ID, NOKIA6170_PRODUCT_ID) }, + { USB_DEVICE(NOKIA_VENDOR_ID, NOKIA6670_PRODUCT_ID) }, + { USB_DEVICE(NOKIA_VENDOR_ID, NOKIA6680_PRODUCT_ID) }, + { USB_DEVICE(NOKIA_VENDOR_ID, NOKIA6230i_PRODUCT_ID) }, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE(usb, id_table); + +/* The only thing which makes this device different from a generic + * device is that we have to set an alternative configuration to make + * the relevant endpoints available. In 2.6 this is really easy... */ +static int nokia_probe(struct usb_serial *serial, + const struct usb_device_id *id) +{ + int retval = -ENODEV; + + if (serial->interface->altsetting[0].endpoint[0].desc.bEndpointAddress == NOKIA_AT_PORT) { + /* the AT port */ + dev_info(&serial->dev->dev, "Nokia AT Port:\n"); + retval = 0; + } else if (serial->interface->num_altsetting == 2 && + serial->interface->altsetting[1].endpoint[0].desc.bEndpointAddress == NOKIA_FBUS_PORT) { + /* the FBUS port */ + dev_info(&serial->dev->dev, "Nokia FBUS Port:\n"); + usb_set_interface(serial->dev, 10, 1); + retval = 0; + } + + return retval; +} + +static struct usb_driver nokia_driver = { + .owner = THIS_MODULE, + .name = "nokia_dku2", + .probe = usb_serial_probe, + .disconnect = usb_serial_disconnect, + .id_table = id_table, +}; + +static struct usb_serial_driver nokia_serial_driver = { + .driver = { + .owner = THIS_MODULE, + .name = "nokia_dku2", + }, + .description = "Nokia 7600/6230(i)/6170/66x0 DKU2 driver", + .id_table = id_table, + .num_interrupt_in = 1, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .probe = nokia_probe, +}; + +static int __init nokia_init(void) +{ + int retval; + + retval = usb_serial_register(&nokia_serial_driver); + if (retval) + return retval; + + retval = usb_register(&nokia_driver); + if (retval) { + usb_serial_deregister(&nokia_serial_driver); + return retval; + } + + info(DRIVER_VERSION " " DRIVER_AUTHOR); + info(DRIVER_DESC); + + return retval; +} + +static void __exit nokia_exit(void) +{ + usb_deregister(&nokia_driver); + usb_serial_deregister(&nokia_serial_driver); +} + +module_init(nokia_init); +module_exit(nokia_exit); + +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/usb/serial/omninet.c b/trunk/drivers/usb/serial/omninet.c index 762d8ff9a1e4..3caf97072ac0 100644 --- a/trunk/drivers/usb/serial/omninet.c +++ b/trunk/drivers/usb/serial/omninet.c @@ -80,11 +80,11 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver omninet_driver = { + .owner = THIS_MODULE, .name = "omninet", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; diff --git a/trunk/drivers/usb/serial/option.c b/trunk/drivers/usb/serial/option.c index 3fd2405304fd..7716000045b7 100644 --- a/trunk/drivers/usb/serial/option.c +++ b/trunk/drivers/usb/serial/option.c @@ -95,11 +95,11 @@ static struct usb_device_id option_ids[] = { MODULE_DEVICE_TABLE(usb, option_ids); static struct usb_driver option_driver = { + .owner = THIS_MODULE, .name = "option", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = option_ids, - .no_dynamic_id = 1, }; /* The card has three separate interfaces, wich the serial driver diff --git a/trunk/drivers/usb/serial/pl2303.c b/trunk/drivers/usb/serial/pl2303.c index f03721056190..165c119bf10e 100644 --- a/trunk/drivers/usb/serial/pl2303.c +++ b/trunk/drivers/usb/serial/pl2303.c @@ -71,9 +71,7 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) }, { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_ID) }, { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_ID) }, - { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_SX1) }, { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X65) }, - { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X75) }, { USB_DEVICE(SYNTECH_VENDOR_ID, SYNTECH_PRODUCT_ID) }, { USB_DEVICE( NOKIA_CA42_VENDOR_ID, NOKIA_CA42_PRODUCT_ID ) }, { } /* Terminating entry */ @@ -82,11 +80,11 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver pl2303_driver = { + .owner = THIS_MODULE, .name = "pl2303", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; #define SET_LINE_REQUEST_TYPE 0x21 @@ -810,12 +808,10 @@ static void pl2303_update_line_status(struct usb_serial_port *port, struct pl2303_private *priv = usb_get_serial_port_data(port); unsigned long flags; u8 status_idx = UART_STATE; - u8 length = UART_STATE + 1; + u8 length = UART_STATE; if ((le16_to_cpu(port->serial->dev->descriptor.idVendor) == SIEMENS_VENDOR_ID) && - (le16_to_cpu(port->serial->dev->descriptor.idProduct) == SIEMENS_PRODUCT_ID_X65 || - le16_to_cpu(port->serial->dev->descriptor.idProduct) == SIEMENS_PRODUCT_ID_SX1 || - le16_to_cpu(port->serial->dev->descriptor.idProduct) == SIEMENS_PRODUCT_ID_X75)) { + (le16_to_cpu(port->serial->dev->descriptor.idProduct) == SIEMENS_PRODUCT_ID_X65)) { length = 1; status_idx = 0; } diff --git a/trunk/drivers/usb/serial/pl2303.h b/trunk/drivers/usb/serial/pl2303.h index 21d434d81813..7be9644f5a03 100644 --- a/trunk/drivers/usb/serial/pl2303.h +++ b/trunk/drivers/usb/serial/pl2303.h @@ -54,9 +54,7 @@ #define SAMSUNG_PRODUCT_ID 0x8001 #define SIEMENS_VENDOR_ID 0x11f5 -#define SIEMENS_PRODUCT_ID_SX1 0x0001 #define SIEMENS_PRODUCT_ID_X65 0x0003 -#define SIEMENS_PRODUCT_ID_X75 0x0004 #define SYNTECH_VENDOR_ID 0x0745 #define SYNTECH_PRODUCT_ID 0x0001 diff --git a/trunk/drivers/usb/serial/safe_serial.c b/trunk/drivers/usb/serial/safe_serial.c index f0215f850d2d..c22bdc0c4dfd 100644 --- a/trunk/drivers/usb/serial/safe_serial.c +++ b/trunk/drivers/usb/serial/safe_serial.c @@ -160,14 +160,14 @@ static struct usb_device_id id_table[] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver safe_driver = { + .owner = THIS_MODULE, .name = "safe_serial", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; -static const __u16 crc10_table[256] = { +static __u16 crc10_table[256] = { 0x000, 0x233, 0x255, 0x066, 0x299, 0x0aa, 0x0cc, 0x2ff, 0x301, 0x132, 0x154, 0x367, 0x198, 0x3ab, 0x3cd, 0x1fe, 0x031, 0x202, 0x264, 0x057, 0x2a8, 0x09b, 0x0fd, 0x2ce, 0x330, 0x103, 0x165, 0x356, 0x1a9, 0x39a, 0x3fc, 0x1cf, 0x062, 0x251, 0x237, 0x004, 0x2fb, 0x0c8, 0x0ae, 0x29d, 0x363, 0x150, 0x136, 0x305, 0x1fa, 0x3c9, 0x3af, 0x19c, @@ -425,7 +425,7 @@ static int __init safe_init (void) if (vendor || product) { info ("vendor: %x product: %x\n", vendor, product); - for (i = 0; i < ARRAY_SIZE(id_table); i++) { + for (i = 0; i < (sizeof (id_table) / sizeof (struct usb_device_id)); i++) { if (!id_table[i].idVendor && !id_table[i].idProduct) { id_table[i].idVendor = vendor; id_table[i].idProduct = product; diff --git a/trunk/drivers/usb/serial/ti_usb_3410_5052.c b/trunk/drivers/usb/serial/ti_usb_3410_5052.c index abb830cb77bd..205dbf7201da 100644 --- a/trunk/drivers/usb/serial/ti_usb_3410_5052.c +++ b/trunk/drivers/usb/serial/ti_usb_3410_5052.c @@ -248,11 +248,11 @@ static struct usb_device_id ti_id_table_combined[] = { }; static struct usb_driver ti_usb_driver = { + .owner = THIS_MODULE, .name = "ti_usb_3410_5052", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = ti_id_table_combined, - .no_dynamic_id = 1, }; static struct usb_serial_driver ti_1port_device = { @@ -351,14 +351,17 @@ static int __init ti_init(void) int i,j; int ret; + /* insert extra vendor and product ids */ - j = ARRAY_SIZE(ti_id_table_3410) - TI_EXTRA_VID_PID_COUNT - 1; + j = sizeof(ti_id_table_3410)/sizeof(struct usb_device_id) + - TI_EXTRA_VID_PID_COUNT - 1; for (i=0; i #include #include -#include #include #include "usb-serial.h" #include "pl2303.h" @@ -43,10 +42,10 @@ /* Driver structure we register with the USB core */ static struct usb_driver usb_serial_driver = { + .owner = THIS_MODULE, .name = "usbserial", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, - .no_dynamic_id = 1, }; /* There is no MODULE_DEVICE_TABLE for usbserial.c. Instead @@ -189,11 +188,6 @@ static int serial_open (struct tty_struct *tty, struct file * filp) portNumber = tty->index - serial->minor; port = serial->port[portNumber]; - if (!port) - return -ENODEV; - - if (down_interruptible(&port->sem)) - return -ERESTARTSYS; ++port->open_count; @@ -219,7 +213,6 @@ static int serial_open (struct tty_struct *tty, struct file * filp) goto bailout_module_put; } - up(&port->sem); return 0; bailout_module_put: @@ -227,7 +220,6 @@ static int serial_open (struct tty_struct *tty, struct file * filp) bailout_kref_put: kref_put(&serial->kref, destroy_serial); port->open_count = 0; - up(&port->sem); return retval; } @@ -240,10 +232,8 @@ static void serial_close(struct tty_struct *tty, struct file * filp) dbg("%s - port %d", __FUNCTION__, port->number); - down(&port->sem); - if (port->open_count == 0) - goto out; + return; --port->open_count; if (port->open_count == 0) { @@ -261,9 +251,6 @@ static void serial_close(struct tty_struct *tty, struct file * filp) } kref_put(&port->serial->kref, destroy_serial); - -out: - up(&port->sem); } static int serial_write (struct tty_struct * tty, const unsigned char *buf, int count) @@ -271,9 +258,6 @@ static int serial_write (struct tty_struct * tty, const unsigned char *buf, int struct usb_serial_port *port = tty->driver_data; int retval = -EINVAL; - if (!port) - goto exit; - dbg("%s - port %d, %d byte(s)", __FUNCTION__, port->number, count); if (!port->open_count) { @@ -293,9 +277,6 @@ static int serial_write_room (struct tty_struct *tty) struct usb_serial_port *port = tty->driver_data; int retval = -EINVAL; - if (!port) - goto exit; - dbg("%s - port %d", __FUNCTION__, port->number); if (!port->open_count) { @@ -315,9 +296,6 @@ static int serial_chars_in_buffer (struct tty_struct *tty) struct usb_serial_port *port = tty->driver_data; int retval = -EINVAL; - if (!port) - goto exit; - dbg("%s = port %d", __FUNCTION__, port->number); if (!port->open_count) { @@ -336,9 +314,6 @@ static void serial_throttle (struct tty_struct * tty) { struct usb_serial_port *port = tty->driver_data; - if (!port) - return; - dbg("%s - port %d", __FUNCTION__, port->number); if (!port->open_count) { @@ -355,9 +330,6 @@ static void serial_unthrottle (struct tty_struct * tty) { struct usb_serial_port *port = tty->driver_data; - if (!port) - return; - dbg("%s - port %d", __FUNCTION__, port->number); if (!port->open_count) { @@ -375,9 +347,6 @@ static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned in struct usb_serial_port *port = tty->driver_data; int retval = -ENODEV; - if (!port) - goto exit; - dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd); if (!port->open_count) { @@ -399,9 +368,6 @@ static void serial_set_termios (struct tty_struct *tty, struct termios * old) { struct usb_serial_port *port = tty->driver_data; - if (!port) - return; - dbg("%s - port %d", __FUNCTION__, port->number); if (!port->open_count) { @@ -418,9 +384,6 @@ static void serial_break (struct tty_struct *tty, int break_state) { struct usb_serial_port *port = tty->driver_data; - if (!port) - return; - dbg("%s - port %d", __FUNCTION__, port->number); if (!port->open_count) { @@ -482,9 +445,6 @@ static int serial_tiocmget (struct tty_struct *tty, struct file *file) { struct usb_serial_port *port = tty->driver_data; - if (!port) - goto exit; - dbg("%s - port %d", __FUNCTION__, port->number); if (!port->open_count) { @@ -504,9 +464,6 @@ static int serial_tiocmset (struct tty_struct *tty, struct file *file, { struct usb_serial_port *port = tty->driver_data; - if (!port) - goto exit; - dbg("%s - port %d", __FUNCTION__, port->number); if (!port->open_count) { @@ -785,7 +742,6 @@ int usb_serial_probe(struct usb_interface *interface, port->number = i + serial->minor; port->serial = serial; spin_lock_init(&port->lock); - sema_init(&port->sem, 1); INIT_WORK(&port->work, usb_serial_port_softint, port); serial->port[i] = port; } diff --git a/trunk/drivers/usb/serial/usb-serial.h b/trunk/drivers/usb/serial/usb-serial.h index d7d27c3385b3..238a5a871ed6 100644 --- a/trunk/drivers/usb/serial/usb-serial.h +++ b/trunk/drivers/usb/serial/usb-serial.h @@ -16,7 +16,6 @@ #include #include -#include #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ #define SERIAL_TTY_MINORS 255 /* loads of devices :) */ @@ -31,8 +30,6 @@ * @serial: pointer back to the struct usb_serial owner of this port. * @tty: pointer to the corresponding tty for this port. * @lock: spinlock to grab when updating portions of this structure. - * @sem: semaphore used to synchronize serial_open() and serial_close() - * access for this port. * @number: the number of the port (the minor number). * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. @@ -63,7 +60,6 @@ struct usb_serial_port { struct usb_serial * serial; struct tty_struct * tty; spinlock_t lock; - struct semaphore sem; unsigned char number; unsigned char * interrupt_in_buffer; diff --git a/trunk/drivers/usb/serial/visor.c b/trunk/drivers/usb/serial/visor.c index 49b1fbe61f25..a473c1c34559 100644 --- a/trunk/drivers/usb/serial/visor.c +++ b/trunk/drivers/usb/serial/visor.c @@ -173,11 +173,11 @@ static struct usb_device_id id_table_combined [] = { MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_driver visor_driver = { + .owner = THIS_MODULE, .name = "visor", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; /* All of the device info needed for the Handspring Visor, and Palm 4.0 devices */ diff --git a/trunk/drivers/usb/serial/whiteheat.c b/trunk/drivers/usb/serial/whiteheat.c index a7c3c4734d83..18c3183be769 100644 --- a/trunk/drivers/usb/serial/whiteheat.c +++ b/trunk/drivers/usb/serial/whiteheat.c @@ -127,11 +127,11 @@ static struct usb_device_id id_table_combined [] = { MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_driver whiteheat_driver = { + .owner = THIS_MODULE, .name = "whiteheat", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; /* function prototypes for the Connect Tech WhiteHEAT prerenumeration device */ diff --git a/trunk/drivers/usb/storage/Kconfig b/trunk/drivers/usb/storage/Kconfig index 92be101feba7..1a9679f76f5a 100644 --- a/trunk/drivers/usb/storage/Kconfig +++ b/trunk/drivers/usb/storage/Kconfig @@ -112,19 +112,10 @@ config USB_STORAGE_JUMPSHOT Say Y here to include additional code to support the Lexar Jumpshot USB CompactFlash reader. -config USB_STORAGE_ALAUDA - bool "Olympus MAUSB-10/Fuji DPC-R1 support (EXPERIMENTAL)" - depends on USB_STORAGE && EXPERIMENTAL - help - Say Y here to include additional code to support the Olympus MAUSB-10 - and Fujifilm DPC-R1 USB Card reader/writer devices. - - These devices are based on the Alauda chip and support support both - XD and SmartMedia cards. config USB_STORAGE_ONETOUCH bool "Support OneTouch Button on Maxtor Hard Drives (EXPERIMENTAL)" - depends on USB_STORAGE && INPUT_EVDEV && EXPERIMENTAL && !PM + depends on USB_STORAGE && INPUT_EVDEV && EXPERIMENTAL help Say Y here to include additional code to support the Maxtor OneTouch USB hard drive's onetouch button. @@ -133,17 +124,3 @@ config USB_STORAGE_ONETOUCH hard drive's as an input device. An action can be associated with this input in any keybinding software. (e.g. gnome's keyboard short- cuts) - -config USB_LIBUSUAL - bool "The shared table of common (or usual) storage devices" - depends on USB - help - This module contains a table of common (or usual) devices - for usb-storage and ub drivers, and allows to switch binding - of these devices without rebuilding modules. - - Typical syntax of /etc/modprobe.conf is: - - options libusual bias="ub" - - If unsure, say N. diff --git a/trunk/drivers/usb/storage/Makefile b/trunk/drivers/usb/storage/Makefile index 8cbba22508a4..44ab8f9978fe 100644 --- a/trunk/drivers/usb/storage/Makefile +++ b/trunk/drivers/usb/storage/Makefile @@ -18,12 +18,7 @@ usb-storage-obj-$(CONFIG_USB_STORAGE_DPCM) += dpcm.o usb-storage-obj-$(CONFIG_USB_STORAGE_ISD200) += isd200.o usb-storage-obj-$(CONFIG_USB_STORAGE_DATAFAB) += datafab.o usb-storage-obj-$(CONFIG_USB_STORAGE_JUMPSHOT) += jumpshot.o -usb-storage-obj-$(CONFIG_USB_STORAGE_ALAUDA) += alauda.o usb-storage-obj-$(CONFIG_USB_STORAGE_ONETOUCH) += onetouch.o usb-storage-objs := scsiglue.o protocol.o transport.o usb.o \ initializers.o $(usb-storage-obj-y) - -ifneq ($(CONFIG_USB_LIBUSUAL),) - obj-$(CONFIG_USB) += libusual.o -endif diff --git a/trunk/drivers/usb/storage/alauda.c b/trunk/drivers/usb/storage/alauda.c deleted file mode 100644 index 4d3cbb12b713..000000000000 --- a/trunk/drivers/usb/storage/alauda.c +++ /dev/null @@ -1,1119 +0,0 @@ -/* - * Driver for Alauda-based card readers - * - * Current development and maintenance by: - * (c) 2005 Daniel Drake - * - * The 'Alauda' is a chip manufacturered by RATOC for OEM use. - * - * Alauda implements a vendor-specific command set to access two media reader - * ports (XD, SmartMedia). This driver converts SCSI commands to the commands - * which are accepted by these devices. - * - * The driver was developed through reverse-engineering, with the help of the - * sddr09 driver which has many similarities, and with some help from the - * (very old) vendor-supplied GPL sma03 driver. - * - * For protocol info, see http://alauda.sourceforge.net - * - * 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 -#include -#include - -#include "usb.h" -#include "transport.h" -#include "protocol.h" -#include "debug.h" -#include "alauda.h" - -#define short_pack(lsb,msb) ( ((u16)(lsb)) | ( ((u16)(msb))<<8 ) ) -#define LSB_of(s) ((s)&0xFF) -#define MSB_of(s) ((s)>>8) - -#define MEDIA_PORT(us) us->srb->device->lun -#define MEDIA_INFO(us) ((struct alauda_info *)us->extra)->port[MEDIA_PORT(us)] - -#define PBA_LO(pba) ((pba & 0xF) << 5) -#define PBA_HI(pba) (pba >> 3) -#define PBA_ZONE(pba) (pba >> 11) - -/* - * Media handling - */ - -struct alauda_card_info { - unsigned char id; /* id byte */ - unsigned char chipshift; /* 1< LBA mappings for a particular port - */ -static void alauda_free_maps (struct alauda_media_info *media_info) -{ - unsigned int shift = media_info->zoneshift - + media_info->blockshift + media_info->pageshift; - unsigned int num_zones = media_info->capacity >> shift; - unsigned int i; - - if (media_info->lba_to_pba != NULL) - for (i = 0; i < num_zones; i++) { - kfree(media_info->lba_to_pba[i]); - media_info->lba_to_pba[i] = NULL; - } - - if (media_info->pba_to_lba != NULL) - for (i = 0; i < num_zones; i++) { - kfree(media_info->pba_to_lba[i]); - media_info->pba_to_lba[i] = NULL; - } -} - -/* - * Returns 2 bytes of status data - * The first byte describes media status, and second byte describes door status - */ -static int alauda_get_media_status(struct us_data *us, unsigned char *data) -{ - int rc; - unsigned char command; - - if (MEDIA_PORT(us) == ALAUDA_PORT_XD) - command = ALAUDA_GET_XD_MEDIA_STATUS; - else - command = ALAUDA_GET_SM_MEDIA_STATUS; - - rc = usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, - command, 0xc0, 0, 1, data, 2); - - US_DEBUGP("alauda_get_media_status: Media status %02X %02X\n", - data[0], data[1]); - - return rc; -} - -/* - * Clears the "media was changed" bit so that we know when it changes again - * in the future. - */ -static int alauda_ack_media(struct us_data *us) -{ - unsigned char command; - - if (MEDIA_PORT(us) == ALAUDA_PORT_XD) - command = ALAUDA_ACK_XD_MEDIA_CHANGE; - else - command = ALAUDA_ACK_SM_MEDIA_CHANGE; - - return usb_stor_ctrl_transfer(us, us->send_ctrl_pipe, - command, 0x40, 0, 1, NULL, 0); -} - -/* - * Retrieves a 4-byte media signature, which indicates manufacturer, capacity, - * and some other details. - */ -static int alauda_get_media_signature(struct us_data *us, unsigned char *data) -{ - unsigned char command; - - if (MEDIA_PORT(us) == ALAUDA_PORT_XD) - command = ALAUDA_GET_XD_MEDIA_SIG; - else - command = ALAUDA_GET_SM_MEDIA_SIG; - - return usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, - command, 0xc0, 0, 0, data, 4); -} - -/* - * Resets the media status (but not the whole device?) - */ -static int alauda_reset_media(struct us_data *us) -{ - unsigned char *command = us->iobuf; - - memset(command, 0, 9); - command[0] = ALAUDA_BULK_CMD; - command[1] = ALAUDA_BULK_RESET_MEDIA; - command[8] = MEDIA_PORT(us); - - return usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, - command, 9, NULL); -} - -/* - * Examines the media and deduces capacity, etc. - */ -static int alauda_init_media(struct us_data *us) -{ - unsigned char *data = us->iobuf; - int ready = 0; - struct alauda_card_info *media_info; - unsigned int num_zones; - - while (ready == 0) { - msleep(20); - - if (alauda_get_media_status(us, data) != USB_STOR_XFER_GOOD) - return USB_STOR_TRANSPORT_ERROR; - - if (data[0] & 0x10) - ready = 1; - } - - US_DEBUGP("alauda_init_media: We are ready for action!\n"); - - if (alauda_ack_media(us) != USB_STOR_XFER_GOOD) - return USB_STOR_TRANSPORT_ERROR; - - msleep(10); - - if (alauda_get_media_status(us, data) != USB_STOR_XFER_GOOD) - return USB_STOR_TRANSPORT_ERROR; - - if (data[0] != 0x14) { - US_DEBUGP("alauda_init_media: Media not ready after ack\n"); - return USB_STOR_TRANSPORT_ERROR; - } - - if (alauda_get_media_signature(us, data) != USB_STOR_XFER_GOOD) - return USB_STOR_TRANSPORT_ERROR; - - US_DEBUGP("alauda_init_media: Media signature: %02X %02X %02X %02X\n", - data[0], data[1], data[2], data[3]); - media_info = alauda_card_find_id(data[1]); - if (media_info == NULL) { - printk("alauda_init_media: Unrecognised media signature: " - "%02X %02X %02X %02X\n", - data[0], data[1], data[2], data[3]); - return USB_STOR_TRANSPORT_ERROR; - } - - MEDIA_INFO(us).capacity = 1 << media_info->chipshift; - US_DEBUGP("Found media with capacity: %ldMB\n", - MEDIA_INFO(us).capacity >> 20); - - MEDIA_INFO(us).pageshift = media_info->pageshift; - MEDIA_INFO(us).blockshift = media_info->blockshift; - MEDIA_INFO(us).zoneshift = media_info->zoneshift; - - MEDIA_INFO(us).pagesize = 1 << media_info->pageshift; - MEDIA_INFO(us).blocksize = 1 << media_info->blockshift; - MEDIA_INFO(us).zonesize = 1 << media_info->zoneshift; - - MEDIA_INFO(us).uzonesize = ((1 << media_info->zoneshift) / 128) * 125; - MEDIA_INFO(us).blockmask = MEDIA_INFO(us).blocksize - 1; - - num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift - + MEDIA_INFO(us).blockshift + MEDIA_INFO(us).pageshift); - MEDIA_INFO(us).pba_to_lba = kcalloc(num_zones, sizeof(u16*), GFP_NOIO); - MEDIA_INFO(us).lba_to_pba = kcalloc(num_zones, sizeof(u16*), GFP_NOIO); - - if (alauda_reset_media(us) != USB_STOR_XFER_GOOD) - return USB_STOR_TRANSPORT_ERROR; - - return USB_STOR_TRANSPORT_GOOD; -} - -/* - * Examines the media status and does the right thing when the media has gone, - * appeared, or changed. - */ -static int alauda_check_media(struct us_data *us) -{ - struct alauda_info *info = (struct alauda_info *) us->extra; - unsigned char status[2]; - int rc; - - rc = alauda_get_media_status(us, status); - - /* Check for no media or door open */ - if ((status[0] & 0x80) || ((status[0] & 0x1F) == 0x10) - || ((status[1] & 0x01) == 0)) { - US_DEBUGP("alauda_check_media: No media, or door open\n"); - alauda_free_maps(&MEDIA_INFO(us)); - info->sense_key = 0x02; - info->sense_asc = 0x3A; - info->sense_ascq = 0x00; - return USB_STOR_TRANSPORT_FAILED; - } - - /* Check for media change */ - if (status[0] & 0x08) { - US_DEBUGP("alauda_check_media: Media change detected\n"); - alauda_free_maps(&MEDIA_INFO(us)); - alauda_init_media(us); - - info->sense_key = UNIT_ATTENTION; - info->sense_asc = 0x28; - info->sense_ascq = 0x00; - return USB_STOR_TRANSPORT_FAILED; - } - - return USB_STOR_TRANSPORT_GOOD; -} - -/* - * Checks the status from the 2nd status register - * Returns 3 bytes of status data, only the first is known - */ -static int alauda_check_status2(struct us_data *us) -{ - int rc; - unsigned char command[] = { - ALAUDA_BULK_CMD, ALAUDA_BULK_GET_STATUS2, - 0, 0, 0, 0, 3, 0, MEDIA_PORT(us) - }; - unsigned char data[3]; - - rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, - command, 9, NULL); - if (rc != USB_STOR_XFER_GOOD) - return rc; - - rc = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, - data, 3, NULL); - if (rc != USB_STOR_XFER_GOOD) - return rc; - - US_DEBUGP("alauda_check_status2: %02X %02X %02X\n", data[0], data[1], data[2]); - if (data[0] & ALAUDA_STATUS_ERROR) - return USB_STOR_XFER_ERROR; - - return USB_STOR_XFER_GOOD; -} - -/* - * Gets the redundancy data for the first page of a PBA - * Returns 16 bytes. - */ -static int alauda_get_redu_data(struct us_data *us, u16 pba, unsigned char *data) -{ - int rc; - unsigned char command[] = { - ALAUDA_BULK_CMD, ALAUDA_BULK_GET_REDU_DATA, - PBA_HI(pba), PBA_ZONE(pba), 0, PBA_LO(pba), 0, 0, MEDIA_PORT(us) - }; - - rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, - command, 9, NULL); - if (rc != USB_STOR_XFER_GOOD) - return rc; - - return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, - data, 16, NULL); -} - -/* - * Finds the first unused PBA in a zone - * Returns the absolute PBA of an unused PBA, or 0 if none found. - */ -static u16 alauda_find_unused_pba(struct alauda_media_info *info, - unsigned int zone) -{ - u16 *pba_to_lba = info->pba_to_lba[zone]; - unsigned int i; - - for (i = 0; i < info->zonesize; i++) - if (pba_to_lba[i] == UNDEF) - return (zone << info->zoneshift) + i; - - return 0; -} - -/* - * Reads the redundancy data for all PBA's in a zone - * Produces lba <--> pba mappings - */ -static int alauda_read_map(struct us_data *us, unsigned int zone) -{ - unsigned char *data = us->iobuf; - int result; - int i, j; - unsigned int zonesize = MEDIA_INFO(us).zonesize; - unsigned int uzonesize = MEDIA_INFO(us).uzonesize; - unsigned int lba_offset, lba_real, blocknum; - unsigned int zone_base_lba = zone * uzonesize; - unsigned int zone_base_pba = zone * zonesize; - u16 *lba_to_pba = kcalloc(zonesize, sizeof(u16), GFP_NOIO); - u16 *pba_to_lba = kcalloc(zonesize, sizeof(u16), GFP_NOIO); - if (lba_to_pba == NULL || pba_to_lba == NULL) { - result = USB_STOR_TRANSPORT_ERROR; - goto error; - } - - US_DEBUGP("alauda_read_map: Mapping blocks for zone %d\n", zone); - - /* 1024 PBA's per zone */ - for (i = 0; i < zonesize; i++) - lba_to_pba[i] = pba_to_lba[i] = UNDEF; - - for (i = 0; i < zonesize; i++) { - blocknum = zone_base_pba + i; - - result = alauda_get_redu_data(us, blocknum, data); - if (result != USB_STOR_XFER_GOOD) { - result = USB_STOR_TRANSPORT_ERROR; - goto error; - } - - /* special PBAs have control field 0^16 */ - for (j = 0; j < 16; j++) - if (data[j] != 0) - goto nonz; - pba_to_lba[i] = UNUSABLE; - US_DEBUGP("alauda_read_map: PBA %d has no logical mapping\n", blocknum); - continue; - - nonz: - /* unwritten PBAs have control field FF^16 */ - for (j = 0; j < 16; j++) - if (data[j] != 0xff) - goto nonff; - continue; - - nonff: - /* normal PBAs start with six FFs */ - if (j < 6) { - US_DEBUGP("alauda_read_map: PBA %d has no logical mapping: " - "reserved area = %02X%02X%02X%02X " - "data status %02X block status %02X\n", - blocknum, data[0], data[1], data[2], data[3], - data[4], data[5]); - pba_to_lba[i] = UNUSABLE; - continue; - } - - if ((data[6] >> 4) != 0x01) { - US_DEBUGP("alauda_read_map: PBA %d has invalid address " - "field %02X%02X/%02X%02X\n", - blocknum, data[6], data[7], data[11], data[12]); - pba_to_lba[i] = UNUSABLE; - continue; - } - - /* check even parity */ - if (parity[data[6] ^ data[7]]) { - printk("alauda_read_map: Bad parity in LBA for block %d" - " (%02X %02X)\n", i, data[6], data[7]); - pba_to_lba[i] = UNUSABLE; - continue; - } - - lba_offset = short_pack(data[7], data[6]); - lba_offset = (lba_offset & 0x07FF) >> 1; - lba_real = lba_offset + zone_base_lba; - - /* - * Every 1024 physical blocks ("zone"), the LBA numbers - * go back to zero, but are within a higher block of LBA's. - * Also, there is a maximum of 1000 LBA's per zone. - * In other words, in PBA 1024-2047 you will find LBA 0-999 - * which are really LBA 1000-1999. This allows for 24 bad - * or special physical blocks per zone. - */ - - if (lba_offset >= uzonesize) { - printk("alauda_read_map: Bad low LBA %d for block %d\n", - lba_real, blocknum); - continue; - } - - if (lba_to_pba[lba_offset] != UNDEF) { - printk("alauda_read_map: LBA %d seen for PBA %d and %d\n", - lba_real, lba_to_pba[lba_offset], blocknum); - continue; - } - - pba_to_lba[i] = lba_real; - lba_to_pba[lba_offset] = blocknum; - continue; - } - - MEDIA_INFO(us).lba_to_pba[zone] = lba_to_pba; - MEDIA_INFO(us).pba_to_lba[zone] = pba_to_lba; - result = 0; - goto out; - -error: - kfree(lba_to_pba); - kfree(pba_to_lba); -out: - return result; -} - -/* - * Checks to see whether we have already mapped a certain zone - * If we haven't, the map is generated - */ -static void alauda_ensure_map_for_zone(struct us_data *us, unsigned int zone) -{ - if (MEDIA_INFO(us).lba_to_pba[zone] == NULL - || MEDIA_INFO(us).pba_to_lba[zone] == NULL) - alauda_read_map(us, zone); -} - -/* - * Erases an entire block - */ -static int alauda_erase_block(struct us_data *us, u16 pba) -{ - int rc; - unsigned char command[] = { - ALAUDA_BULK_CMD, ALAUDA_BULK_ERASE_BLOCK, PBA_HI(pba), - PBA_ZONE(pba), 0, PBA_LO(pba), 0x02, 0, MEDIA_PORT(us) - }; - unsigned char buf[2]; - - US_DEBUGP("alauda_erase_block: Erasing PBA %d\n", pba); - - rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, - command, 9, NULL); - if (rc != USB_STOR_XFER_GOOD) - return rc; - - rc = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, - buf, 2, NULL); - if (rc != USB_STOR_XFER_GOOD) - return rc; - - US_DEBUGP("alauda_erase_block: Erase result: %02X %02X\n", - buf[0], buf[1]); - return rc; -} - -/* - * Reads data from a certain offset page inside a PBA, including interleaved - * redundancy data. Returns (pagesize+64)*pages bytes in data. - */ -static int alauda_read_block_raw(struct us_data *us, u16 pba, - unsigned int page, unsigned int pages, unsigned char *data) -{ - int rc; - unsigned char command[] = { - ALAUDA_BULK_CMD, ALAUDA_BULK_READ_BLOCK, PBA_HI(pba), - PBA_ZONE(pba), 0, PBA_LO(pba) + page, pages, 0, MEDIA_PORT(us) - }; - - US_DEBUGP("alauda_read_block: pba %d page %d count %d\n", - pba, page, pages); - - rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, - command, 9, NULL); - if (rc != USB_STOR_XFER_GOOD) - return rc; - - return usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, - data, (MEDIA_INFO(us).pagesize + 64) * pages, NULL); -} - -/* - * Reads data from a certain offset page inside a PBA, excluding redundancy - * data. Returns pagesize*pages bytes in data. Note that data must be big enough - * to hold (pagesize+64)*pages bytes of data, but you can ignore those 'extra' - * trailing bytes outside this function. - */ -static int alauda_read_block(struct us_data *us, u16 pba, - unsigned int page, unsigned int pages, unsigned char *data) -{ - int i, rc; - unsigned int pagesize = MEDIA_INFO(us).pagesize; - - rc = alauda_read_block_raw(us, pba, page, pages, data); - if (rc != USB_STOR_XFER_GOOD) - return rc; - - /* Cut out the redundancy data */ - for (i = 0; i < pages; i++) { - int dest_offset = i * pagesize; - int src_offset = i * (pagesize + 64); - memmove(data + dest_offset, data + src_offset, pagesize); - } - - return rc; -} - -/* - * Writes an entire block of data and checks status after write. - * Redundancy data must be already included in data. Data should be - * (pagesize+64)*blocksize bytes in length. - */ -static int alauda_write_block(struct us_data *us, u16 pba, unsigned char *data) -{ - int rc; - struct alauda_info *info = (struct alauda_info *) us->extra; - unsigned char command[] = { - ALAUDA_BULK_CMD, ALAUDA_BULK_WRITE_BLOCK, PBA_HI(pba), - PBA_ZONE(pba), 0, PBA_LO(pba), 32, 0, MEDIA_PORT(us) - }; - - US_DEBUGP("alauda_write_block: pba %d\n", pba); - - rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, - command, 9, NULL); - if (rc != USB_STOR_XFER_GOOD) - return rc; - - rc = usb_stor_bulk_transfer_buf(us, info->wr_ep, data, - (MEDIA_INFO(us).pagesize + 64) * MEDIA_INFO(us).blocksize, - NULL); - if (rc != USB_STOR_XFER_GOOD) - return rc; - - return alauda_check_status2(us); -} - -/* - * Write some data to a specific LBA. - */ -static int alauda_write_lba(struct us_data *us, u16 lba, - unsigned int page, unsigned int pages, - unsigned char *ptr, unsigned char *blockbuffer) -{ - u16 pba, lbap, new_pba; - unsigned char *bptr, *cptr, *xptr; - unsigned char ecc[3]; - int i, result; - unsigned int uzonesize = MEDIA_INFO(us).uzonesize; - unsigned int zonesize = MEDIA_INFO(us).zonesize; - unsigned int pagesize = MEDIA_INFO(us).pagesize; - unsigned int blocksize = MEDIA_INFO(us).blocksize; - unsigned int lba_offset = lba % uzonesize; - unsigned int new_pba_offset; - unsigned int zone = lba / uzonesize; - - alauda_ensure_map_for_zone(us, zone); - - pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset]; - if (pba == 1) { - /* Maybe it is impossible to write to PBA 1. - Fake success, but don't do anything. */ - printk("alauda_write_lba: avoid writing to pba 1\n"); - return USB_STOR_TRANSPORT_GOOD; - } - - new_pba = alauda_find_unused_pba(&MEDIA_INFO(us), zone); - if (!new_pba) { - printk("alauda_write_lba: Out of unused blocks\n"); - return USB_STOR_TRANSPORT_ERROR; - } - - /* read old contents */ - if (pba != UNDEF) { - result = alauda_read_block_raw(us, pba, 0, - blocksize, blockbuffer); - if (result != USB_STOR_XFER_GOOD) - return result; - } else { - memset(blockbuffer, 0, blocksize * (pagesize + 64)); - } - - lbap = (lba_offset << 1) | 0x1000; - if (parity[MSB_of(lbap) ^ LSB_of(lbap)]) - lbap ^= 1; - - /* check old contents and fill lba */ - for (i = 0; i < blocksize; i++) { - bptr = blockbuffer + (i * (pagesize + 64)); - cptr = bptr + pagesize; - nand_compute_ecc(bptr, ecc); - if (!nand_compare_ecc(cptr+13, ecc)) { - US_DEBUGP("Warning: bad ecc in page %d- of pba %d\n", - i, pba); - nand_store_ecc(cptr+13, ecc); - } - nand_compute_ecc(bptr + (pagesize / 2), ecc); - if (!nand_compare_ecc(cptr+8, ecc)) { - US_DEBUGP("Warning: bad ecc in page %d+ of pba %d\n", - i, pba); - nand_store_ecc(cptr+8, ecc); - } - cptr[6] = cptr[11] = MSB_of(lbap); - cptr[7] = cptr[12] = LSB_of(lbap); - } - - /* copy in new stuff and compute ECC */ - xptr = ptr; - for (i = page; i < page+pages; i++) { - bptr = blockbuffer + (i * (pagesize + 64)); - cptr = bptr + pagesize; - memcpy(bptr, xptr, pagesize); - xptr += pagesize; - nand_compute_ecc(bptr, ecc); - nand_store_ecc(cptr+13, ecc); - nand_compute_ecc(bptr + (pagesize / 2), ecc); - nand_store_ecc(cptr+8, ecc); - } - - result = alauda_write_block(us, new_pba, blockbuffer); - if (result != USB_STOR_XFER_GOOD) - return result; - - new_pba_offset = new_pba - (zone * zonesize); - MEDIA_INFO(us).pba_to_lba[zone][new_pba_offset] = lba; - MEDIA_INFO(us).lba_to_pba[zone][lba_offset] = new_pba; - US_DEBUGP("alauda_write_lba: Remapped LBA %d to PBA %d\n", - lba, new_pba); - - if (pba != UNDEF) { - unsigned int pba_offset = pba - (zone * zonesize); - result = alauda_erase_block(us, pba); - if (result != USB_STOR_XFER_GOOD) - return result; - MEDIA_INFO(us).pba_to_lba[zone][pba_offset] = UNDEF; - } - - return USB_STOR_TRANSPORT_GOOD; -} - -/* - * Read data from a specific sector address - */ -static int alauda_read_data(struct us_data *us, unsigned long address, - unsigned int sectors) -{ - unsigned char *buffer; - u16 lba, max_lba; - unsigned int page, len, index, offset; - unsigned int blockshift = MEDIA_INFO(us).blockshift; - unsigned int pageshift = MEDIA_INFO(us).pageshift; - unsigned int blocksize = MEDIA_INFO(us).blocksize; - unsigned int pagesize = MEDIA_INFO(us).pagesize; - unsigned int uzonesize = MEDIA_INFO(us).uzonesize; - int result; - - /* - * Since we only read in one block at a time, we have to create - * a bounce buffer and move the data a piece at a time between the - * bounce buffer and the actual transfer buffer. - * We make this buffer big enough to hold temporary redundancy data, - * which we use when reading the data blocks. - */ - - len = min(sectors, blocksize) * (pagesize + 64); - buffer = kmalloc(len, GFP_NOIO); - if (buffer == NULL) { - printk("alauda_read_data: Out of memory\n"); - return USB_STOR_TRANSPORT_ERROR; - } - - /* Figure out the initial LBA and page */ - lba = address >> blockshift; - page = (address & MEDIA_INFO(us).blockmask); - max_lba = MEDIA_INFO(us).capacity >> (blockshift + pageshift); - - result = USB_STOR_TRANSPORT_GOOD; - index = offset = 0; - - while (sectors > 0) { - unsigned int zone = lba / uzonesize; /* integer division */ - unsigned int lba_offset = lba - (zone * uzonesize); - unsigned int pages; - u16 pba; - alauda_ensure_map_for_zone(us, zone); - - /* Not overflowing capacity? */ - if (lba >= max_lba) { - US_DEBUGP("Error: Requested lba %u exceeds " - "maximum %u\n", lba, max_lba); - result = USB_STOR_TRANSPORT_ERROR; - break; - } - - /* Find number of pages we can read in this block */ - pages = min(sectors, blocksize - page); - len = pages << pageshift; - - /* Find where this lba lives on disk */ - pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset]; - - if (pba == UNDEF) { /* this lba was never written */ - US_DEBUGP("Read %d zero pages (LBA %d) page %d\n", - pages, lba, page); - - /* This is not really an error. It just means - that the block has never been written. - Instead of returning USB_STOR_TRANSPORT_ERROR - it is better to return all zero data. */ - - memset(buffer, 0, len); - } else { - US_DEBUGP("Read %d pages, from PBA %d" - " (LBA %d) page %d\n", - pages, pba, lba, page); - - result = alauda_read_block(us, pba, page, pages, buffer); - if (result != USB_STOR_TRANSPORT_GOOD) - break; - } - - /* Store the data in the transfer buffer */ - usb_stor_access_xfer_buf(buffer, len, us->srb, - &index, &offset, TO_XFER_BUF); - - page = 0; - lba++; - sectors -= pages; - } - - kfree(buffer); - return result; -} - -/* - * Write data to a specific sector address - */ -static int alauda_write_data(struct us_data *us, unsigned long address, - unsigned int sectors) -{ - unsigned char *buffer, *blockbuffer; - unsigned int page, len, index, offset; - unsigned int blockshift = MEDIA_INFO(us).blockshift; - unsigned int pageshift = MEDIA_INFO(us).pageshift; - unsigned int blocksize = MEDIA_INFO(us).blocksize; - unsigned int pagesize = MEDIA_INFO(us).pagesize; - u16 lba, max_lba; - int result; - - /* - * Since we don't write the user data directly to the device, - * we have to create a bounce buffer and move the data a piece - * at a time between the bounce buffer and the actual transfer buffer. - */ - - len = min(sectors, blocksize) * pagesize; - buffer = kmalloc(len, GFP_NOIO); - if (buffer == NULL) { - printk("alauda_write_data: Out of memory\n"); - return USB_STOR_TRANSPORT_ERROR; - } - - /* - * We also need a temporary block buffer, where we read in the old data, - * overwrite parts with the new data, and manipulate the redundancy data - */ - blockbuffer = kmalloc((pagesize + 64) * blocksize, GFP_NOIO); - if (blockbuffer == NULL) { - printk("alauda_write_data: Out of memory\n"); - kfree(buffer); - return USB_STOR_TRANSPORT_ERROR; - } - - /* Figure out the initial LBA and page */ - lba = address >> blockshift; - page = (address & MEDIA_INFO(us).blockmask); - max_lba = MEDIA_INFO(us).capacity >> (pageshift + blockshift); - - result = USB_STOR_TRANSPORT_GOOD; - index = offset = 0; - - while (sectors > 0) { - /* Write as many sectors as possible in this block */ - unsigned int pages = min(sectors, blocksize - page); - len = pages << pageshift; - - /* Not overflowing capacity? */ - if (lba >= max_lba) { - US_DEBUGP("alauda_write_data: Requested lba %u exceeds " - "maximum %u\n", lba, max_lba); - result = USB_STOR_TRANSPORT_ERROR; - break; - } - - /* Get the data from the transfer buffer */ - usb_stor_access_xfer_buf(buffer, len, us->srb, - &index, &offset, FROM_XFER_BUF); - - result = alauda_write_lba(us, lba, page, pages, buffer, - blockbuffer); - if (result != USB_STOR_TRANSPORT_GOOD) - break; - - page = 0; - lba++; - sectors -= pages; - } - - kfree(buffer); - kfree(blockbuffer); - return result; -} - -/* - * Our interface with the rest of the world - */ - -static void alauda_info_destructor(void *extra) -{ - struct alauda_info *info = (struct alauda_info *) extra; - int port; - - if (!info) - return; - - for (port = 0; port < 2; port++) { - struct alauda_media_info *media_info = &info->port[port]; - - alauda_free_maps(media_info); - kfree(media_info->lba_to_pba); - kfree(media_info->pba_to_lba); - } -} - -/* - * Initialize alauda_info struct and find the data-write endpoint - */ -int init_alauda(struct us_data *us) -{ - struct alauda_info *info; - struct usb_host_interface *altsetting = us->pusb_intf->cur_altsetting; - nand_init_ecc(); - - us->extra = kzalloc(sizeof(struct alauda_info), GFP_NOIO); - if (!us->extra) { - US_DEBUGP("init_alauda: Gah! Can't allocate storage for" - "alauda info struct!\n"); - return USB_STOR_TRANSPORT_ERROR; - } - info = (struct alauda_info *) us->extra; - us->extra_destructor = alauda_info_destructor; - - info->wr_ep = usb_sndbulkpipe(us->pusb_dev, - altsetting->endpoint[0].desc.bEndpointAddress - & USB_ENDPOINT_NUMBER_MASK); - - return USB_STOR_TRANSPORT_GOOD; -} - -int alauda_transport(struct scsi_cmnd *srb, struct us_data *us) -{ - int rc; - struct alauda_info *info = (struct alauda_info *) us->extra; - unsigned char *ptr = us->iobuf; - static unsigned char inquiry_response[36] = { - 0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00 - }; - - if (srb->cmnd[0] == INQUIRY) { - US_DEBUGP("alauda_transport: INQUIRY. " - "Returning bogus response.\n"); - memcpy(ptr, inquiry_response, sizeof(inquiry_response)); - fill_inquiry_response(us, ptr, 36); - return USB_STOR_TRANSPORT_GOOD; - } - - if (srb->cmnd[0] == TEST_UNIT_READY) { - US_DEBUGP("alauda_transport: TEST_UNIT_READY.\n"); - return alauda_check_media(us); - } - - if (srb->cmnd[0] == READ_CAPACITY) { - unsigned int num_zones; - unsigned long capacity; - - rc = alauda_check_media(us); - if (rc != USB_STOR_TRANSPORT_GOOD) - return rc; - - num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift - + MEDIA_INFO(us).blockshift + MEDIA_INFO(us).pageshift); - - capacity = num_zones * MEDIA_INFO(us).uzonesize - * MEDIA_INFO(us).blocksize; - - /* Report capacity and page size */ - ((__be32 *) ptr)[0] = cpu_to_be32(capacity - 1); - ((__be32 *) ptr)[1] = cpu_to_be32(512); - - usb_stor_set_xfer_buf(ptr, 8, srb); - return USB_STOR_TRANSPORT_GOOD; - } - - if (srb->cmnd[0] == READ_10) { - unsigned int page, pages; - - rc = alauda_check_media(us); - if (rc != USB_STOR_TRANSPORT_GOOD) - return rc; - - page = short_pack(srb->cmnd[3], srb->cmnd[2]); - page <<= 16; - page |= short_pack(srb->cmnd[5], srb->cmnd[4]); - pages = short_pack(srb->cmnd[8], srb->cmnd[7]); - - US_DEBUGP("alauda_transport: READ_10: page %d pagect %d\n", - page, pages); - - return alauda_read_data(us, page, pages); - } - - if (srb->cmnd[0] == WRITE_10) { - unsigned int page, pages; - - rc = alauda_check_media(us); - if (rc != USB_STOR_TRANSPORT_GOOD) - return rc; - - page = short_pack(srb->cmnd[3], srb->cmnd[2]); - page <<= 16; - page |= short_pack(srb->cmnd[5], srb->cmnd[4]); - pages = short_pack(srb->cmnd[8], srb->cmnd[7]); - - US_DEBUGP("alauda_transport: WRITE_10: page %d pagect %d\n", - page, pages); - - return alauda_write_data(us, page, pages); - } - - if (srb->cmnd[0] == REQUEST_SENSE) { - US_DEBUGP("alauda_transport: REQUEST_SENSE.\n"); - - memset(ptr, 0, 18); - ptr[0] = 0xF0; - ptr[2] = info->sense_key; - ptr[7] = 11; - ptr[12] = info->sense_asc; - ptr[13] = info->sense_ascq; - usb_stor_set_xfer_buf(ptr, 18, srb); - - return USB_STOR_TRANSPORT_GOOD; - } - - if (srb->cmnd[0] == ALLOW_MEDIUM_REMOVAL) { - /* sure. whatever. not like we can stop the user from popping - the media out of the device (no locking doors, etc) */ - return USB_STOR_TRANSPORT_GOOD; - } - - US_DEBUGP("alauda_transport: Gah! Unknown command: %d (0x%x)\n", - srb->cmnd[0], srb->cmnd[0]); - info->sense_key = 0x05; - info->sense_asc = 0x20; - info->sense_ascq = 0x00; - return USB_STOR_TRANSPORT_FAILED; -} - diff --git a/trunk/drivers/usb/storage/alauda.h b/trunk/drivers/usb/storage/alauda.h deleted file mode 100644 index a700f87d0803..000000000000 --- a/trunk/drivers/usb/storage/alauda.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Driver for Alauda-based card readers - * - * Current development and maintenance by: - * (c) 2005 Daniel Drake - * - * See alauda.c for more explanation. - * - * 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. - */ - -#ifndef _USB_ALAUDA_H -#define _USB_ALAUDA_H - -/* - * Status bytes - */ -#define ALAUDA_STATUS_ERROR 0x01 -#define ALAUDA_STATUS_READY 0x40 - -/* - * Control opcodes (for request field) - */ -#define ALAUDA_GET_XD_MEDIA_STATUS 0x08 -#define ALAUDA_GET_SM_MEDIA_STATUS 0x98 -#define ALAUDA_ACK_XD_MEDIA_CHANGE 0x0a -#define ALAUDA_ACK_SM_MEDIA_CHANGE 0x9a -#define ALAUDA_GET_XD_MEDIA_SIG 0x86 -#define ALAUDA_GET_SM_MEDIA_SIG 0x96 - -/* - * Bulk command identity (byte 0) - */ -#define ALAUDA_BULK_CMD 0x40 - -/* - * Bulk opcodes (byte 1) - */ -#define ALAUDA_BULK_GET_REDU_DATA 0x85 -#define ALAUDA_BULK_READ_BLOCK 0x94 -#define ALAUDA_BULK_ERASE_BLOCK 0xa3 -#define ALAUDA_BULK_WRITE_BLOCK 0xb4 -#define ALAUDA_BULK_GET_STATUS2 0xb7 -#define ALAUDA_BULK_RESET_MEDIA 0xe0 - -/* - * Port to operate on (byte 8) - */ -#define ALAUDA_PORT_XD 0x00 -#define ALAUDA_PORT_SM 0x01 - -/* - * LBA and PBA are unsigned ints. Special values. - */ -#define UNDEF 0xffff -#define SPARE 0xfffe -#define UNUSABLE 0xfffd - -int init_alauda(struct us_data *us); -int alauda_transport(struct scsi_cmnd *srb, struct us_data *us); - -struct alauda_media_info { - unsigned long capacity; /* total media size in bytes */ - unsigned int pagesize; /* page size in bytes */ - unsigned int blocksize; /* number of pages per block */ - unsigned int uzonesize; /* number of usable blocks per zone */ - unsigned int zonesize; /* number of blocks per zone */ - unsigned int blockmask; /* mask to get page from address */ - - unsigned char pageshift; - unsigned char blockshift; - unsigned char zoneshift; - - u16 **lba_to_pba; /* logical to physical block map */ - u16 **pba_to_lba; /* physical to logical block map */ -}; - -struct alauda_info { - struct alauda_media_info port[2]; - int wr_ep; /* endpoint to write data out of */ - - unsigned char sense_key; - unsigned long sense_asc; /* additional sense code */ - unsigned long sense_ascq; /* additional sense code qualifier */ -}; - -#endif - diff --git a/trunk/drivers/usb/storage/debug.c b/trunk/drivers/usb/storage/debug.c index 01e430654a13..5a9321705a74 100644 --- a/trunk/drivers/usb/storage/debug.c +++ b/trunk/drivers/usb/storage/debug.c @@ -132,7 +132,6 @@ void usb_stor_show_command(struct scsi_cmnd *srb) case 0x5C: what = "READ BUFFER CAPACITY"; break; case 0x5D: what = "SEND CUE SHEET"; break; case GPCMD_BLANK: what = "BLANK"; break; - case REPORT_LUNS: what = "REPORT LUNS"; break; case MOVE_MEDIUM: what = "MOVE_MEDIUM or PLAY AUDIO (12)"; break; case READ_12: what = "READ_12"; break; case WRITE_12: what = "WRITE_12"; break; diff --git a/trunk/drivers/usb/storage/initializers.h b/trunk/drivers/usb/storage/initializers.h index 4c1b2bd2e2e4..7372386f33d5 100644 --- a/trunk/drivers/usb/storage/initializers.h +++ b/trunk/drivers/usb/storage/initializers.h @@ -45,6 +45,10 @@ * mode */ int usb_stor_euscsi_init(struct us_data *us); +#ifdef CONFIG_USB_STORAGE_SDDR09 +int sddr09_init(struct us_data *us); +#endif + /* This function is required to activate all four slots on the UCR-61S2B * flash reader */ int usb_stor_ucr61s2b_init(struct us_data *us); diff --git a/trunk/drivers/usb/storage/libusual.c b/trunk/drivers/usb/storage/libusual.c deleted file mode 100644 index b28151d1b609..000000000000 --- a/trunk/drivers/usb/storage/libusual.c +++ /dev/null @@ -1,266 +0,0 @@ -/* - * libusual - * - * The libusual contains the table of devices common for ub and usb-storage. - */ -#include -#include -#include -#include -#include - -/* - */ -#define USU_MOD_FL_THREAD 1 /* Thread is running */ -#define USU_MOD_FL_PRESENT 2 /* The module is loaded */ - -struct mod_status { - unsigned long fls; -}; - -static struct mod_status stat[3]; -static DEFINE_SPINLOCK(usu_lock); - -/* - */ -#define USB_US_DEFAULT_BIAS USB_US_TYPE_STOR -static atomic_t usu_bias = ATOMIC_INIT(USB_US_DEFAULT_BIAS); - -#define BIAS_NAME_SIZE (sizeof("usb-storage")) -static const char *bias_names[3] = { "none", "usb-storage", "ub" }; - -static DECLARE_MUTEX_LOCKED(usu_init_notify); -static DECLARE_COMPLETION(usu_end_notify); -static atomic_t total_threads = ATOMIC_INIT(0); - -static int usu_probe_thread(void *arg); - -/* - * The table. - */ -#define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \ - vendorName, productName,useProtocol, useTransport, \ - initFunction, flags) \ -{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin,bcdDeviceMax), \ - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } - -#define USUAL_DEV(useProto, useTrans, useType) \ -{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \ - .driver_info = ((useType)<<24) } - -struct usb_device_id storage_usb_ids [] = { -# include "unusual_devs.h" - { } /* Terminating entry */ -}; - -#undef USUAL_DEV -#undef UNUSUAL_DEV - -MODULE_DEVICE_TABLE(usb, storage_usb_ids); -EXPORT_SYMBOL_GPL(storage_usb_ids); - -/* - * @type: the module type as an integer - */ -void usb_usual_set_present(int type) -{ - struct mod_status *st; - unsigned long flags; - - if (type <= 0 || type >= 3) - return; - st = &stat[type]; - spin_lock_irqsave(&usu_lock, flags); - st->fls |= USU_MOD_FL_PRESENT; - spin_unlock_irqrestore(&usu_lock, flags); -} -EXPORT_SYMBOL_GPL(usb_usual_set_present); - -void usb_usual_clear_present(int type) -{ - struct mod_status *st; - unsigned long flags; - - if (type <= 0 || type >= 3) - return; - st = &stat[type]; - spin_lock_irqsave(&usu_lock, flags); - st->fls &= ~USU_MOD_FL_PRESENT; - spin_unlock_irqrestore(&usu_lock, flags); -} -EXPORT_SYMBOL_GPL(usb_usual_clear_present); - -/* - * Match the calling driver type against the table. - * Returns: 0 if the device matches. - */ -int usb_usual_check_type(const struct usb_device_id *id, int caller_type) -{ - int id_type = USB_US_TYPE(id->driver_info); - - if (caller_type <= 0 || caller_type >= 3) - return -EINVAL; - - /* Drivers grab fixed assignment devices */ - if (id_type == caller_type) - return 0; - /* Drivers grab devices biased to them */ - if (id_type == USB_US_TYPE_NONE && caller_type == atomic_read(&usu_bias)) - return 0; - return -ENODEV; -} -EXPORT_SYMBOL_GPL(usb_usual_check_type); - -/* - */ -static int usu_probe(struct usb_interface *intf, - const struct usb_device_id *id) -{ - int type; - int rc; - unsigned long flags; - - type = USB_US_TYPE(id->driver_info); - if (type == 0) - type = atomic_read(&usu_bias); - - spin_lock_irqsave(&usu_lock, flags); - if ((stat[type].fls & (USU_MOD_FL_THREAD|USU_MOD_FL_PRESENT)) != 0) { - spin_unlock_irqrestore(&usu_lock, flags); - return -ENXIO; - } - stat[type].fls |= USU_MOD_FL_THREAD; - spin_unlock_irqrestore(&usu_lock, flags); - - rc = kernel_thread(usu_probe_thread, (void*)type, CLONE_VM); - if (rc < 0) { - printk(KERN_WARNING "libusual: " - "Unable to start the thread for %s: %d\n", - bias_names[type], rc); - spin_lock_irqsave(&usu_lock, flags); - stat[type].fls &= ~USU_MOD_FL_THREAD; - spin_unlock_irqrestore(&usu_lock, flags); - return rc; /* Not being -ENXIO causes a message printed */ - } - atomic_inc(&total_threads); - - return -ENXIO; -} - -static void usu_disconnect(struct usb_interface *intf) -{ - ; /* We should not be here. */ -} - -static struct usb_driver usu_driver = { - .name = "libusual", - .probe = usu_probe, - .disconnect = usu_disconnect, - .id_table = storage_usb_ids, -}; - -/* - * A whole new thread for a purpose of request_module seems quite stupid. - * The request_module forks once inside again. However, if we attempt - * to load a storage module from our own modprobe thread, that module - * references our symbols, which cannot be resolved until our module is - * initialized. I wish there was a way to wait for the end of initialization. - * The module notifier reports MODULE_STATE_COMING only. - * So, we wait until module->init ends as the next best thing. - */ -static int usu_probe_thread(void *arg) -{ - int type = (unsigned long) arg; - struct mod_status *st = &stat[type]; - int rc; - unsigned long flags; - - daemonize("libusual_%d", type); /* "usb-storage" is kinda too long */ - - /* A completion does not work here because it's counted. */ - down(&usu_init_notify); - up(&usu_init_notify); - - rc = request_module(bias_names[type]); - spin_lock_irqsave(&usu_lock, flags); - if (rc == 0 && (st->fls & USU_MOD_FL_PRESENT) == 0) { - /* - * This should not happen, but let us keep tabs on it. - */ - printk(KERN_NOTICE "libusual: " - "modprobe for %s succeeded, but module is not present\n", - bias_names[type]); - } - st->fls &= ~USU_MOD_FL_THREAD; - spin_unlock_irqrestore(&usu_lock, flags); - - complete_and_exit(&usu_end_notify, 0); -} - -/* - */ -static int __init usb_usual_init(void) -{ - int rc; - - rc = usb_register(&usu_driver); - up(&usu_init_notify); - return rc; -} - -static void __exit usb_usual_exit(void) -{ - /* - * We do not check for any drivers present, because - * they keep us pinned with symbol references. - */ - - usb_deregister(&usu_driver); - - while (atomic_read(&total_threads) > 0) { - wait_for_completion(&usu_end_notify); - atomic_dec(&total_threads); - } -} - -/* - * Validate and accept the bias parameter. - */ -static int usu_set_bias(const char *bias_s, struct kernel_param *kp) -{ - int i; - int len; - int bias_n = 0; - - len = strlen(bias_s); - if (len == 0) - return -EDOM; - if (bias_s[len-1] == '\n') - --len; - - for (i = 1; i < 3; i++) { - if (strncmp(bias_s, bias_names[i], len) == 0) { - bias_n = i; - break; - } - } - if (bias_n == 0) - return -EINVAL; - - atomic_set(&usu_bias, bias_n); - return 0; -} - -static int usu_get_bias(char *buffer, struct kernel_param *kp) -{ - return strlen(strcpy(buffer, bias_names[atomic_read(&usu_bias)])); -} - -module_init(usb_usual_init); -module_exit(usb_usual_exit); - -module_param_call(bias, usu_set_bias, usu_get_bias, NULL, S_IRUGO|S_IWUSR); -__MODULE_PARM_TYPE(bias, "string"); -MODULE_PARM_DESC(bias, "Bias to usb-storage or ub"); - -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/usb/storage/onetouch.c b/trunk/drivers/usb/storage/onetouch.c index 55ee2d36d585..89401a59f952 100644 --- a/trunk/drivers/usb/storage/onetouch.c +++ b/trunk/drivers/usb/storage/onetouch.c @@ -52,7 +52,6 @@ struct usb_onetouch { struct urb *irq; /* urb for interrupt in report */ unsigned char *data; /* input data */ dma_addr_t data_dma; - unsigned int is_open:1; }; static void usb_onetouch_irq(struct urb *urb, struct pt_regs *regs) @@ -90,7 +89,6 @@ static int usb_onetouch_open(struct input_dev *dev) { struct usb_onetouch *onetouch = dev->private; - onetouch->is_open = 1; onetouch->irq->dev = onetouch->udev; if (usb_submit_urb(onetouch->irq, GFP_KERNEL)) { err("usb_submit_urb failed"); @@ -105,30 +103,8 @@ static void usb_onetouch_close(struct input_dev *dev) struct usb_onetouch *onetouch = dev->private; usb_kill_urb(onetouch->irq); - onetouch->is_open = 0; } -#ifdef CONFIG_PM -static void usb_onetouch_pm_hook(struct us_data *us, int action) -{ - struct usb_onetouch *onetouch = (struct usb_onetouch *) us->extra; - - if (onetouch->is_open) { - switch (action) { - case US_SUSPEND: - usb_kill_urb(onetouch->irq); - break; - case US_RESUME: - if (usb_submit_urb(onetouch->irq, GFP_KERNEL) != 0) - err("usb_submit_urb failed"); - break; - default: - break; - } - } -} -#endif /* CONFIG_PM */ - int onetouch_connect_input(struct us_data *ss) { struct usb_device *udev = ss->pusb_dev; @@ -209,9 +185,6 @@ int onetouch_connect_input(struct us_data *ss) ss->extra_destructor = onetouch_release_input; ss->extra = onetouch; -#ifdef CONFIG_PM - ss->suspend_resume_hook = usb_onetouch_pm_hook; -#endif input_register_device(onetouch->dev); diff --git a/trunk/drivers/usb/storage/protocol.h b/trunk/drivers/usb/storage/protocol.h index 845bed4b8031..02bff01ab09c 100644 --- a/trunk/drivers/usb/storage/protocol.h +++ b/trunk/drivers/usb/storage/protocol.h @@ -41,6 +41,20 @@ #ifndef _PROTOCOL_H_ #define _PROTOCOL_H_ +/* Sub Classes */ + +#define US_SC_RBC 0x01 /* Typically, flash devices */ +#define US_SC_8020 0x02 /* CD-ROM */ +#define US_SC_QIC 0x03 /* QIC-157 Tapes */ +#define US_SC_UFI 0x04 /* Floppy */ +#define US_SC_8070 0x05 /* Removable media */ +#define US_SC_SCSI 0x06 /* Transparent */ +#define US_SC_ISD200 0x07 /* ISD200 ATA */ +#define US_SC_MIN US_SC_RBC +#define US_SC_MAX US_SC_ISD200 + +#define US_SC_DEVICE 0xff /* Use device's value */ + /* Protocol handling routines */ extern void usb_stor_ATAPI_command(struct scsi_cmnd*, struct us_data*); extern void usb_stor_qic157_command(struct scsi_cmnd*, struct us_data*); diff --git a/trunk/drivers/usb/storage/scsiglue.c b/trunk/drivers/usb/storage/scsiglue.c index 4ef5527028c5..4837524eada7 100644 --- a/trunk/drivers/usb/storage/scsiglue.c +++ b/trunk/drivers/usb/storage/scsiglue.c @@ -109,7 +109,7 @@ static int slave_configure(struct scsi_device *sdev) * data comes from. */ if (sdev->scsi_level < SCSI_2) - sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; + sdev->scsi_level = SCSI_2; /* According to the technical support people at Genesys Logic, * devices using their chips have problems transferring more than @@ -162,7 +162,7 @@ static int slave_configure(struct scsi_device *sdev) * a Get-Max-LUN request, we won't lose much by setting the * revision level down to 2. The only devices that would be * affected are those with sparse LUNs. */ - sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; + sdev->scsi_level = SCSI_2; /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable * Hardware Error) when any low-level error occurs, diff --git a/trunk/drivers/usb/storage/sddr09.c b/trunk/drivers/usb/storage/sddr09.c index fb8bacaae27c..0ea2f5ab66ba 100644 --- a/trunk/drivers/usb/storage/sddr09.c +++ b/trunk/drivers/usb/storage/sddr09.c @@ -133,11 +133,13 @@ static struct nand_flash_dev nand_flash_ids[] = { { 0,} }; +#define SIZE(a) (sizeof(a)/sizeof((a)[0])) + static struct nand_flash_dev * nand_find_id(unsigned char id) { int i; - for (i = 0; i < ARRAY_SIZE(nand_flash_ids); i++) + for (i = 0; i < SIZE(nand_flash_ids); i++) if (nand_flash_ids[i].model_id == id) return &(nand_flash_ids[i]); return NULL; @@ -212,20 +214,6 @@ static void nand_store_ecc(unsigned char *data, unsigned char *ecc) { * The actual driver starts here. */ -struct sddr09_card_info { - unsigned long capacity; /* Size of card in bytes */ - int pagesize; /* Size of page in bytes */ - int pageshift; /* log2 of pagesize */ - int blocksize; /* Size of block in pages */ - int blockshift; /* log2 of blocksize */ - int blockmask; /* 2^blockshift - 1 */ - int *lba_to_pba; /* logical to physical map */ - int *pba_to_lba; /* physical to logical map */ - int lbact; /* number of available pages */ - int flags; -#define SDDR09_WP 1 /* write protected */ -}; - /* * On my 16MB card, control blocks have size 64 (16 real control bytes, * and 48 junk bytes). In reality of course the card uses 16 control bytes, @@ -249,7 +237,7 @@ struct sddr09_card_info { #define SPARE 0xfffffffe #define UNUSABLE 0xfffffffd -static const int erase_bad_lba_entries = 0; +static int erase_bad_lba_entries = 0; /* send vendor interface command (0x41) */ /* called for requests 0, 1, 8 */ @@ -272,11 +260,8 @@ sddr09_send_command(struct us_data *us, rc = usb_stor_ctrl_transfer(us, pipe, request, requesttype, 0, 0, xfer_data, xfer_len); - switch (rc) { - case USB_STOR_XFER_GOOD: return 0; - case USB_STOR_XFER_STALLED: return -EPIPE; - default: return -EIO; - } + return (rc == USB_STOR_XFER_GOOD ? USB_STOR_TRANSPORT_GOOD : + USB_STOR_TRANSPORT_ERROR); } static int @@ -323,12 +308,20 @@ sddr09_request_sense(struct us_data *us, unsigned char *sensebuf, int buflen) { command[4] = buflen; result = sddr09_send_scsi_command(us, command, 12); - if (result) + if (result != USB_STOR_TRANSPORT_GOOD) { + US_DEBUGP("request sense failed\n"); return result; + } result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, sensebuf, buflen, NULL); - return (result == USB_STOR_XFER_GOOD ? 0 : -EIO); + if (result != USB_STOR_XFER_GOOD) { + US_DEBUGP("request sense bulk in failed\n"); + return USB_STOR_TRANSPORT_ERROR; + } else { + US_DEBUGP("request sense worked\n"); + return USB_STOR_TRANSPORT_GOOD; + } } /* @@ -376,7 +369,7 @@ sddr09_readX(struct us_data *us, int x, unsigned long fromaddress, result = sddr09_send_scsi_command(us, command, 12); - if (result) { + if (result != USB_STOR_TRANSPORT_GOOD) { US_DEBUGP("Result for send_control in sddr09_read2%d %d\n", x, result); return result; @@ -388,9 +381,9 @@ sddr09_readX(struct us_data *us, int x, unsigned long fromaddress, if (result != USB_STOR_XFER_GOOD) { US_DEBUGP("Result for bulk_transfer in sddr09_read2%d %d\n", x, result); - return -EIO; + return USB_STOR_TRANSPORT_ERROR; } - return 0; + return USB_STOR_TRANSPORT_GOOD; } /* @@ -504,7 +497,7 @@ sddr09_erase(struct us_data *us, unsigned long Eaddress) { result = sddr09_send_scsi_command(us, command, 12); - if (result) + if (result != USB_STOR_TRANSPORT_GOOD) US_DEBUGP("Result for send_control in sddr09_erase %d\n", result); @@ -562,7 +555,7 @@ sddr09_writeX(struct us_data *us, result = sddr09_send_scsi_command(us, command, 12); - if (result) { + if (result != USB_STOR_TRANSPORT_GOOD) { US_DEBUGP("Result for send_control in sddr09_writeX %d\n", result); return result; @@ -574,9 +567,9 @@ sddr09_writeX(struct us_data *us, if (result != USB_STOR_XFER_GOOD) { US_DEBUGP("Result for bulk_transfer in sddr09_writeX %d\n", result); - return -EIO; + return USB_STOR_TRANSPORT_ERROR; } - return 0; + return USB_STOR_TRANSPORT_GOOD; } /* erase address, write same address */ @@ -640,7 +633,7 @@ sddr09_read_sg_test_only(struct us_data *us) { result = sddr09_send_scsi_command(us, command, 4*nsg+3); - if (result) { + if (result != USB_STOR_TRANSPORT_GOOD) { US_DEBUGP("Result for send_control in sddr09_read_sg %d\n", result); return result; @@ -648,7 +641,7 @@ sddr09_read_sg_test_only(struct us_data *us) { buf = (unsigned char *) kmalloc(bulklen, GFP_NOIO); if (!buf) - return -ENOMEM; + return USB_STOR_TRANSPORT_ERROR; result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, buf, bulklen, NULL); @@ -656,10 +649,10 @@ sddr09_read_sg_test_only(struct us_data *us) { if (result != USB_STOR_XFER_GOOD) { US_DEBUGP("Result for bulk_transfer in sddr09_read_sg %d\n", result); - return -EIO; + return USB_STOR_TRANSPORT_ERROR; } - return 0; + return USB_STOR_TRANSPORT_GOOD; } #endif @@ -688,13 +681,14 @@ sddr09_read_status(struct us_data *us, unsigned char *status) { command[1] = LUNBITS; result = sddr09_send_scsi_command(us, command, 12); - if (result) + if (result != USB_STOR_TRANSPORT_GOOD) return result; result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, data, 64, NULL); *status = data[0]; - return (result == USB_STOR_XFER_GOOD ? 0 : -EIO); + return (result == USB_STOR_XFER_GOOD ? + USB_STOR_TRANSPORT_GOOD : USB_STOR_TRANSPORT_ERROR); } static int @@ -709,13 +703,6 @@ sddr09_read_data(struct us_data *us, unsigned int len, index, offset; int result; - // Figure out the initial LBA and page - lba = address >> info->blockshift; - page = (address & info->blockmask); - maxlba = info->capacity >> (info->pageshift + info->blockshift); - if (lba >= maxlba) - return -EIO; - // Since we only read in one block at a time, we have to create // a bounce buffer and move the data a piece at a time between the // bounce buffer and the actual transfer buffer. @@ -724,13 +711,18 @@ sddr09_read_data(struct us_data *us, buffer = kmalloc(len, GFP_NOIO); if (buffer == NULL) { printk("sddr09_read_data: Out of memory\n"); - return -ENOMEM; + return USB_STOR_TRANSPORT_ERROR; } + // Figure out the initial LBA and page + lba = address >> info->blockshift; + page = (address & info->blockmask); + maxlba = info->capacity >> (info->pageshift + info->blockshift); + // This could be made much more efficient by checking for // contiguous LBA's. Another exercise left to the student. - result = 0; + result = USB_STOR_TRANSPORT_GOOD; index = offset = 0; while (sectors > 0) { @@ -743,7 +735,7 @@ sddr09_read_data(struct us_data *us, if (lba >= maxlba) { US_DEBUGP("Error: Requested lba %u exceeds " "maximum %u\n", lba, maxlba); - result = -EIO; + result = USB_STOR_TRANSPORT_ERROR; break; } @@ -757,7 +749,7 @@ sddr09_read_data(struct us_data *us, /* This is not really an error. It just means that the block has never been written. - Instead of returning an error + Instead of returning USB_STOR_TRANSPORT_ERROR it is better to return all zero data. */ memset(buffer, 0, len); @@ -772,7 +764,7 @@ sddr09_read_data(struct us_data *us, result = sddr09_read20(us, address>>1, pages, info->pageshift, buffer, 0); - if (result) + if (result != USB_STOR_TRANSPORT_GOOD) break; } @@ -838,7 +830,7 @@ sddr09_write_lba(struct us_data *us, unsigned int lba, pba = sddr09_find_unused_pba(info, lba); if (!pba) { printk("sddr09_write_lba: Out of unused blocks\n"); - return -ENOSPC; + return USB_STOR_TRANSPORT_ERROR; } info->pba_to_lba[pba] = lba; info->lba_to_pba[lba] = pba; @@ -849,7 +841,7 @@ sddr09_write_lba(struct us_data *us, unsigned int lba, /* Maybe it is impossible to write to PBA 1. Fake success, but don't do anything. */ printk("sddr09: avoid writing to pba 1\n"); - return 0; + return USB_STOR_TRANSPORT_GOOD; } pagelen = (1 << info->pageshift) + (1 << CONTROL_SHIFT); @@ -858,7 +850,7 @@ sddr09_write_lba(struct us_data *us, unsigned int lba, address = (pba << (info->pageshift + info->blockshift)); result = sddr09_read22(us, address>>1, info->blocksize, info->pageshift, blockbuffer, 0); - if (result) + if (result != USB_STOR_TRANSPORT_GOOD) return result; /* check old contents and fill lba */ @@ -905,7 +897,7 @@ sddr09_write_lba(struct us_data *us, unsigned int lba, { unsigned char status = 0; int result2 = sddr09_read_status(us, &status); - if (result2) + if (result2 != USB_STOR_TRANSPORT_GOOD) US_DEBUGP("sddr09_write_inplace: cannot read status\n"); else if (status != 0xc0) US_DEBUGP("sddr09_write_inplace: status after write: 0x%x\n", @@ -928,20 +920,13 @@ sddr09_write_data(struct us_data *us, unsigned int sectors) { struct sddr09_card_info *info = (struct sddr09_card_info *) us->extra; - unsigned int lba, maxlba, page, pages; + unsigned int lba, page, pages; unsigned int pagelen, blocklen; unsigned char *blockbuffer; unsigned char *buffer; unsigned int len, index, offset; int result; - // Figure out the initial LBA and page - lba = address >> info->blockshift; - page = (address & info->blockmask); - maxlba = info->capacity >> (info->pageshift + info->blockshift); - if (lba >= maxlba) - return -EIO; - // blockbuffer is used for reading in the old data, overwriting // with the new data, and performing ECC calculations @@ -953,7 +938,7 @@ sddr09_write_data(struct us_data *us, blockbuffer = kmalloc(blocklen, GFP_NOIO); if (!blockbuffer) { printk("sddr09_write_data: Out of memory\n"); - return -ENOMEM; + return USB_STOR_TRANSPORT_ERROR; } // Since we don't write the user data directly to the device, @@ -965,10 +950,14 @@ sddr09_write_data(struct us_data *us, if (buffer == NULL) { printk("sddr09_write_data: Out of memory\n"); kfree(blockbuffer); - return -ENOMEM; + return USB_STOR_TRANSPORT_ERROR; } - result = 0; + // Figure out the initial LBA and page + lba = address >> info->blockshift; + page = (address & info->blockmask); + + result = USB_STOR_TRANSPORT_GOOD; index = offset = 0; while (sectors > 0) { @@ -978,21 +967,13 @@ sddr09_write_data(struct us_data *us, pages = min(sectors, info->blocksize - page); len = (pages << info->pageshift); - /* Not overflowing capacity? */ - if (lba >= maxlba) { - US_DEBUGP("Error: Requested lba %u exceeds " - "maximum %u\n", lba, maxlba); - result = -EIO; - break; - } - // Get the data from the transfer buffer usb_stor_access_xfer_buf(buffer, len, us->srb, &index, &offset, FROM_XFER_BUF); result = sddr09_write_lba(us, lba, page, pages, buffer, blockbuffer); - if (result) + if (result != USB_STOR_TRANSPORT_GOOD) break; page = 0; @@ -1041,7 +1022,7 @@ sddr09_read_deviceID(struct us_data *us, unsigned char *deviceID) { command[1] = LUNBITS; result = sddr09_send_scsi_command(us, command, 12); - if (result) + if (result != USB_STOR_TRANSPORT_GOOD) return result; result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, @@ -1050,7 +1031,8 @@ sddr09_read_deviceID(struct us_data *us, unsigned char *deviceID) { for (i = 0; i < 4; i++) deviceID[i] = content[i]; - return (result == USB_STOR_XFER_GOOD ? 0 : -EIO); + return (result == USB_STOR_XFER_GOOD ? + USB_STOR_TRANSPORT_GOOD : USB_STOR_TRANSPORT_ERROR); } static int @@ -1059,7 +1041,7 @@ sddr09_get_wp(struct us_data *us, struct sddr09_card_info *info) { unsigned char status; result = sddr09_read_status(us, &status); - if (result) { + if (result != USB_STOR_TRANSPORT_GOOD) { US_DEBUGP("sddr09_get_wp: read_status fails\n"); return result; } @@ -1075,7 +1057,7 @@ sddr09_get_wp(struct us_data *us, struct sddr09_card_info *info) { if (status & 0x1) US_DEBUGP(" Error"); US_DEBUGP("\n"); - return 0; + return USB_STOR_TRANSPORT_GOOD; } #if 0 @@ -1107,7 +1089,7 @@ sddr09_get_cardinfo(struct us_data *us, unsigned char flags) { result = sddr09_read_deviceID(us, deviceID); - if (result) { + if (result != USB_STOR_TRANSPORT_GOOD) { US_DEBUGP("Result of read_deviceID is %d\n", result); printk("sddr09: could not read card info\n"); return NULL; @@ -1218,7 +1200,7 @@ sddr09_read_map(struct us_data *us) { us, address>>1, min(alloc_blocks, numblocks - i), buffer, 0); - if (result) { + if (result != USB_STOR_TRANSPORT_GOOD) { result = -1; goto done; } @@ -1360,53 +1342,29 @@ sddr09_card_info_destructor(void *extra) { kfree(info->pba_to_lba); } -static int -sddr09_common_init(struct us_data *us) { - int result; - - /* set the configuration -- STALL is an acceptable response here */ - if (us->pusb_dev->actconfig->desc.bConfigurationValue != 1) { - US_DEBUGP("active config #%d != 1 ??\n", us->pusb_dev - ->actconfig->desc.bConfigurationValue); - return -EINVAL; - } - - result = usb_reset_configuration(us->pusb_dev); - US_DEBUGP("Result of usb_reset_configuration is %d\n", result); - if (result == -EPIPE) { - US_DEBUGP("-- stall on control interface\n"); - } else if (result != 0) { - /* it's not a stall, but another error -- time to bail */ - US_DEBUGP("-- Unknown error. Rejecting device\n"); - return -EINVAL; +static void +sddr09_init_card_info(struct us_data *us) { + if (!us->extra) { + us->extra = kmalloc(sizeof(struct sddr09_card_info), GFP_NOIO); + if (us->extra) { + memset(us->extra, 0, sizeof(struct sddr09_card_info)); + us->extra_destructor = sddr09_card_info_destructor; + } } - - us->extra = kzalloc(sizeof(struct sddr09_card_info), GFP_NOIO); - if (!us->extra) - return -ENOMEM; - us->extra_destructor = sddr09_card_info_destructor; - - nand_init_ecc(); - return 0; } - /* * This is needed at a very early stage. If this is not listed in the * unusual devices list but called from here then LUN 0 of the combo reader * is not recognized. But I do not know what precisely these calls do. */ int -usb_stor_sddr09_dpcm_init(struct us_data *us) { +sddr09_init(struct us_data *us) { int result; unsigned char *data = us->iobuf; - result = sddr09_common_init(us); - if (result) - return result; - result = sddr09_send_command(us, 0x01, USB_DIR_IN, data, 2); - if (result) { + if (result != USB_STOR_TRANSPORT_GOOD) { US_DEBUGP("sddr09_init: send_command fails\n"); return result; } @@ -1415,7 +1373,7 @@ usb_stor_sddr09_dpcm_init(struct us_data *us) { // get 07 02 result = sddr09_send_command(us, 0x08, USB_DIR_IN, data, 2); - if (result) { + if (result != USB_STOR_TRANSPORT_GOOD) { US_DEBUGP("sddr09_init: 2nd send_command fails\n"); return result; } @@ -1424,7 +1382,7 @@ usb_stor_sddr09_dpcm_init(struct us_data *us) { // get 07 00 result = sddr09_request_sense(us, data, 18); - if (result == 0 && data[2] != 0) { + if (result == USB_STOR_TRANSPORT_GOOD && data[2] != 0) { int j; for (j=0; j<18; j++) printk(" %02X", data[j]); @@ -1440,7 +1398,7 @@ usb_stor_sddr09_dpcm_init(struct us_data *us) { // test unit ready - return 0; /* not result */ + return USB_STOR_TRANSPORT_GOOD; /* not result */ } /* @@ -1469,6 +1427,13 @@ int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us) }; info = (struct sddr09_card_info *)us->extra; + if (!info) { + nand_init_ecc(); + sddr09_init_card_info(us); + info = (struct sddr09_card_info *)us->extra; + if (!info) + return USB_STOR_TRANSPORT_ERROR; + } if (srb->cmnd[0] == REQUEST_SENSE && havefakesense) { /* for a faked command, we have to follow with a faked sense */ @@ -1571,9 +1536,7 @@ int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us) US_DEBUGP("READ_10: read page %d pagect %d\n", page, pages); - result = sddr09_read_data(us, page, pages); - return (result == 0 ? USB_STOR_TRANSPORT_GOOD : - USB_STOR_TRANSPORT_ERROR); + return sddr09_read_data(us, page, pages); } if (srb->cmnd[0] == WRITE_10) { @@ -1586,9 +1549,7 @@ int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us) US_DEBUGP("WRITE_10: write page %d pagect %d\n", page, pages); - result = sddr09_write_data(us, page, pages); - return (result == 0 ? USB_STOR_TRANSPORT_GOOD : - USB_STOR_TRANSPORT_ERROR); + return sddr09_write_data(us, page, pages); } /* catch-all for all other commands, except @@ -1614,10 +1575,10 @@ int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us) US_DEBUGP("SDDR09: Send control for command %s\n", ptr); result = sddr09_send_scsi_command(us, srb->cmnd, 12); - if (result) { + if (result != USB_STOR_TRANSPORT_GOOD) { US_DEBUGP("sddr09_transport: sddr09_send_scsi_command " "returns %d\n", result); - return USB_STOR_TRANSPORT_ERROR; + return result; } if (srb->request_bufflen == 0) @@ -1645,10 +1606,3 @@ int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us) return USB_STOR_TRANSPORT_GOOD; } -/* - * Initialization routine for the sddr09 subdriver - */ -int -usb_stor_sddr09_init(struct us_data *us) { - return sddr09_common_init(us); -} diff --git a/trunk/drivers/usb/storage/sddr09.h b/trunk/drivers/usb/storage/sddr09.h index c03089a9ec38..c9d78d6188b1 100644 --- a/trunk/drivers/usb/storage/sddr09.h +++ b/trunk/drivers/usb/storage/sddr09.h @@ -31,7 +31,18 @@ extern int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us); -extern int usb_stor_sddr09_dpcm_init(struct us_data *us); -extern int usb_stor_sddr09_init(struct us_data *us); +struct sddr09_card_info { + unsigned long capacity; /* Size of card in bytes */ + int pagesize; /* Size of page in bytes */ + int pageshift; /* log2 of pagesize */ + int blocksize; /* Size of block in pages */ + int blockshift; /* log2 of blocksize */ + int blockmask; /* 2^blockshift - 1 */ + int *lba_to_pba; /* logical to physical map */ + int *pba_to_lba; /* physical to logical map */ + int lbact; /* number of available pages */ + int flags; +#define SDDR09_WP 1 /* write protected */ +}; #endif diff --git a/trunk/drivers/usb/storage/shuttle_usbat.c b/trunk/drivers/usb/storage/shuttle_usbat.c index fea176d7e79a..33c55a6261bb 100644 --- a/trunk/drivers/usb/storage/shuttle_usbat.c +++ b/trunk/drivers/usb/storage/shuttle_usbat.c @@ -853,7 +853,7 @@ static int usbat_identify_device(struct us_data *us, rc = usbat_device_reset(us); if (rc != USB_STOR_TRANSPORT_GOOD) return rc; - msleep(500); + msleep(25); /* * In attempt to distinguish between HP CDRW's and Flash readers, we now diff --git a/trunk/drivers/usb/storage/transport.h b/trunk/drivers/usb/storage/transport.h index 633a715850a4..0a362cc781ad 100644 --- a/trunk/drivers/usb/storage/transport.h +++ b/trunk/drivers/usb/storage/transport.h @@ -41,8 +41,39 @@ #ifndef _TRANSPORT_H_ #define _TRANSPORT_H_ +#include #include +/* Protocols */ + +#define US_PR_CBI 0x00 /* Control/Bulk/Interrupt */ +#define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */ +#define US_PR_BULK 0x50 /* bulk only */ +#ifdef CONFIG_USB_STORAGE_USBAT +#define US_PR_USBAT 0x80 /* SCM-ATAPI bridge */ +#endif +#ifdef CONFIG_USB_STORAGE_SDDR09 +#define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */ +#endif +#ifdef CONFIG_USB_STORAGE_SDDR55 +#define US_PR_SDDR55 0x82 /* SDDR-55 (made up) */ +#endif +#define US_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */ + +#ifdef CONFIG_USB_STORAGE_FREECOM +#define US_PR_FREECOM 0xf1 /* Freecom */ +#endif + +#ifdef CONFIG_USB_STORAGE_DATAFAB +#define US_PR_DATAFAB 0xf2 /* Datafab chipsets */ +#endif + +#ifdef CONFIG_USB_STORAGE_JUMPSHOT +#define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */ +#endif + +#define US_PR_DEVICE 0xff /* Use device's value */ + /* * Bulk only data structures */ diff --git a/trunk/drivers/usb/storage/unusual_devs.h b/trunk/drivers/usb/storage/unusual_devs.h index dc301e567cfc..9e926a8f2116 100644 --- a/trunk/drivers/usb/storage/unusual_devs.h +++ b/trunk/drivers/usb/storage/unusual_devs.h @@ -79,6 +79,13 @@ UNUSUAL_DEV( 0x03f0, 0x0307, 0x0001, 0x0001, US_SC_8070, US_PR_USBAT, init_usbat, 0), #endif +/* Patch submitted by Mihnea-Costin Grigore */ +UNUSUAL_DEV( 0x040d, 0x6205, 0x0003, 0x0003, + "VIA Technologies Inc.", + "USB 2.0 Card Reader", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_IGNORE_RESIDUE ), + /* Reported by Sebastian Kapfer * and Olaf Hering (different bcd's, same vendor/product) * for USB floppies that need the SINGLE_LUN enforcement. @@ -89,13 +96,6 @@ UNUSUAL_DEV( 0x0409, 0x0040, 0x0000, 0x9999, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_SINGLE_LUN ), -/* Patch submitted by Mihnea-Costin Grigore */ -UNUSUAL_DEV( 0x040d, 0x6205, 0x0003, 0x0003, - "VIA Technologies Inc.", - "USB 2.0 Card Reader", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_IGNORE_RESIDUE ), - /* Deduced by Jonathan Woithe * Entry needed for flags: US_FL_FIX_INQUIRY because initial inquiry message * always fails and confuses drive. @@ -187,14 +187,6 @@ UNUSUAL_DEV( 0x04b0, 0x0405, 0x0100, 0x0100, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), -/* Patch for Nikon coolpix 2000 - * Submitted by Fabien Cosse */ -UNUSUAL_DEV( 0x04b0, 0x0301, 0x0010, 0x0010, - "NIKON", - "NIKON DSC E2000", - US_SC_DEVICE, US_PR_DEVICE,NULL, - US_FL_NOT_LOCKABLE ), - /* BENQ DC5330 * Reported by Manuel Fombuena and * Frank Copeland */ @@ -284,14 +276,14 @@ UNUSUAL_DEV( 0x04e6, 0x0002, 0x0100, 0x0100, UNUSUAL_DEV( 0x04e6, 0x0003, 0x0000, 0x9999, "Sandisk", "ImageMate SDDR09", - US_SC_SCSI, US_PR_EUSB_SDDR09, usb_stor_sddr09_init, - 0), + US_SC_SCSI, US_PR_EUSB_SDDR09, NULL, + US_FL_SINGLE_LUN ), /* This entry is from Andries.Brouwer@cwi.nl */ UNUSUAL_DEV( 0x04e6, 0x0005, 0x0100, 0x0208, "SCM Microsystems", "eUSB SmartMedia / CompactFlash Adapter", - US_SC_SCSI, US_PR_DPCM_USB, usb_stor_sddr09_dpcm_init, + US_SC_SCSI, US_PR_DPCM_USB, sddr09_init, 0), #endif @@ -535,13 +527,6 @@ UNUSUAL_DEV( 0x057b, 0x0022, 0x0000, 0x9999, "Silicon Media R/W", US_SC_DEVICE, US_PR_DEVICE, NULL, 0), -#ifdef CONFIG_USB_STORAGE_ALAUDA -UNUSUAL_DEV( 0x0584, 0x0008, 0x0102, 0x0102, - "Fujifilm", - "DPC-R1 (Alauda)", - US_SC_SCSI, US_PR_ALAUDA, init_alauda, 0 ), -#endif - /* Fabrizio Fellini */ UNUSUAL_DEV( 0x0595, 0x4343, 0x0000, 0x2210, "Fujifilm", @@ -688,8 +673,8 @@ UNUSUAL_DEV( 0x0644, 0x0000, 0x0100, 0x0100, UNUSUAL_DEV( 0x066b, 0x0105, 0x0100, 0x0100, "Olympus", "Camedia MAUSB-2", - US_SC_SCSI, US_PR_EUSB_SDDR09, usb_stor_sddr09_init, - 0), + US_SC_SCSI, US_PR_EUSB_SDDR09, NULL, + US_FL_SINGLE_LUN ), #endif /* Reported by Darsen Lu */ @@ -725,6 +710,11 @@ UNUSUAL_DEV( 0x0686, 0x4017, 0x0001, 0x0001, "DIMAGE E223", US_SC_SCSI, US_PR_DEVICE, NULL, 0 ), +UNUSUAL_DEV( 0x0693, 0x0002, 0x0100, 0x0100, + "Hagiwara", + "FlashGate SmartMedia", + US_SC_SCSI, US_PR_BULK, NULL, 0 ), + UNUSUAL_DEV( 0x0693, 0x0005, 0x0100, 0x0100, "Hagiwara", "Flashgate", @@ -754,8 +744,8 @@ UNUSUAL_DEV( 0x0781, 0x0100, 0x0100, 0x0100, UNUSUAL_DEV( 0x0781, 0x0200, 0x0000, 0x9999, "Sandisk", "ImageMate SDDR-09", - US_SC_SCSI, US_PR_EUSB_SDDR09, usb_stor_sddr09_init, - 0), + US_SC_SCSI, US_PR_EUSB_SDDR09, NULL, + US_FL_SINGLE_LUN ), #endif #ifdef CONFIG_USB_STORAGE_FREECOM @@ -791,13 +781,6 @@ UNUSUAL_DEV( 0x07af, 0x0006, 0x0100, 0x0100, US_SC_SCSI, US_PR_DPCM_USB, NULL, 0 ), #endif -#ifdef CONFIG_USB_STORAGE_ALAUDA -UNUSUAL_DEV( 0x07b4, 0x010a, 0x0102, 0x0102, - "Olympus", - "MAUSB-10 (Alauda)", - US_SC_SCSI, US_PR_ALAUDA, init_alauda, 0 ), -#endif - #ifdef CONFIG_USB_STORAGE_DATAFAB UNUSUAL_DEV( 0x07c4, 0xa000, 0x0000, 0x0015, "Datafab", @@ -1025,11 +1008,6 @@ UNUSUAL_DEV( 0x0c0b, 0xa109, 0x0000, 0xffff, * */ #ifdef CONFIG_USB_STORAGE_ONETOUCH - UNUSUAL_DEV( 0x0d49, 0x7000, 0x0000, 0x9999, - "Maxtor", - "OneTouch External Harddrive", - US_SC_DEVICE, US_PR_DEVICE, onetouch_connect_input, - 0), UNUSUAL_DEV( 0x0d49, 0x7010, 0x0000, 0x9999, "Maxtor", "OneTouch External Harddrive", @@ -1140,15 +1118,6 @@ UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_GO_SLOW ), -/* - * David Härdeman - * The key makes the SCSI stack print confusing (but harmless) messages - */ -UNUSUAL_DEV( 0x4146, 0xba01, 0x0100, 0x0100, - "Iomega", - "Micro Mini 1GB", - US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ), - #ifdef CONFIG_USB_STORAGE_SDDR55 UNUSUAL_DEV( 0x55aa, 0xa103, 0x0000, 0x9999, "Sandisk", @@ -1156,27 +1125,3 @@ UNUSUAL_DEV( 0x55aa, 0xa103, 0x0000, 0x9999, US_SC_SCSI, US_PR_SDDR55, NULL, US_FL_SINGLE_LUN), #endif - -/* Control/Bulk transport for all SubClass values */ -USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_8020, US_PR_CB, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_QIC, US_PR_CB, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_UFI, US_PR_CB, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_8070, US_PR_CB, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_SCSI, US_PR_CB, USB_US_TYPE_STOR), - -/* Control/Bulk/Interrupt transport for all SubClass values */ -USUAL_DEV(US_SC_RBC, US_PR_CBI, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_8020, US_PR_CBI, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_QIC, US_PR_CBI, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_UFI, US_PR_CBI, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_8070, US_PR_CBI, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_SCSI, US_PR_CBI, USB_US_TYPE_STOR), - -/* Bulk-only transport for all SubClass values */ -USUAL_DEV(US_SC_RBC, US_PR_BULK, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_8020, US_PR_BULK, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_QIC, US_PR_BULK, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_UFI, US_PR_BULK, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_8070, US_PR_BULK, USB_US_TYPE_STOR), -USUAL_DEV(US_SC_SCSI, US_PR_BULK, 0), diff --git a/trunk/drivers/usb/storage/usb.c b/trunk/drivers/usb/storage/usb.c index dbcf23980ff1..3847ebed2aa4 100644 --- a/trunk/drivers/usb/storage/usb.c +++ b/trunk/drivers/usb/storage/usb.c @@ -94,9 +94,6 @@ #ifdef CONFIG_USB_STORAGE_ONETOUCH #include "onetouch.h" #endif -#ifdef CONFIG_USB_STORAGE_ALAUDA -#include "alauda.h" -#endif /* Some informational data */ MODULE_AUTHOR("Matthew Dharm "); @@ -115,33 +112,49 @@ static atomic_t total_threads = ATOMIC_INIT(0); static DECLARE_COMPLETION(threads_gone); -/* - * The entries in this table correspond, line for line, - * with the entries of us_unusual_dev_list[]. +/* The entries in this table, except for final ones here + * (USB_MASS_STORAGE_CLASS and the empty entry), correspond, + * line for line with the entries of us_unsuaul_dev_list[]. */ -#ifndef CONFIG_USB_LIBUSUAL #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \ vendorName, productName,useProtocol, useTransport, \ initFunction, flags) \ -{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin,bcdDeviceMax), \ - .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } - -#define USUAL_DEV(useProto, useTrans, useType) \ -{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \ - .driver_info = (USB_US_TYPE_STOR<<24) } +{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin,bcdDeviceMax) } static struct usb_device_id storage_usb_ids [] = { # include "unusual_devs.h" #undef UNUSUAL_DEV -#undef USUAL_DEV + /* Control/Bulk transport for all SubClass values */ + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_RBC, US_PR_CB) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8020, US_PR_CB) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_QIC, US_PR_CB) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_UFI, US_PR_CB) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8070, US_PR_CB) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_CB) }, + + /* Control/Bulk/Interrupt transport for all SubClass values */ + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_RBC, US_PR_CBI) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8020, US_PR_CBI) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_QIC, US_PR_CBI) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_UFI, US_PR_CBI) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8070, US_PR_CBI) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_CBI) }, + + /* Bulk-only transport for all SubClass values */ + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_RBC, US_PR_BULK) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8020, US_PR_BULK) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_QIC, US_PR_BULK) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_UFI, US_PR_BULK) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8070, US_PR_BULK) }, + { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_BULK) }, + /* Terminating entry */ { } }; MODULE_DEVICE_TABLE (usb, storage_usb_ids); -#endif /* CONFIG_USB_LIBUSUAL */ /* This is the list of devices we recognize, along with their flag data */ @@ -154,6 +167,7 @@ MODULE_DEVICE_TABLE (usb, storage_usb_ids); * are free to use as many characters as you like. */ +#undef UNUSUAL_DEV #define UNUSUAL_DEV(idVendor, idProduct, bcdDeviceMin, bcdDeviceMax, \ vendor_name, product_name, use_protocol, use_transport, \ init_function, Flags) \ @@ -163,18 +177,53 @@ MODULE_DEVICE_TABLE (usb, storage_usb_ids); .useProtocol = use_protocol, \ .useTransport = use_transport, \ .initFunction = init_function, \ -} - -#define USUAL_DEV(use_protocol, use_transport, use_type) \ -{ \ - .useProtocol = use_protocol, \ - .useTransport = use_transport, \ + .flags = Flags, \ } static struct us_unusual_dev us_unusual_dev_list[] = { # include "unusual_devs.h" # undef UNUSUAL_DEV -# undef USUAL_DEV + /* Control/Bulk transport for all SubClass values */ + { .useProtocol = US_SC_RBC, + .useTransport = US_PR_CB}, + { .useProtocol = US_SC_8020, + .useTransport = US_PR_CB}, + { .useProtocol = US_SC_QIC, + .useTransport = US_PR_CB}, + { .useProtocol = US_SC_UFI, + .useTransport = US_PR_CB}, + { .useProtocol = US_SC_8070, + .useTransport = US_PR_CB}, + { .useProtocol = US_SC_SCSI, + .useTransport = US_PR_CB}, + + /* Control/Bulk/Interrupt transport for all SubClass values */ + { .useProtocol = US_SC_RBC, + .useTransport = US_PR_CBI}, + { .useProtocol = US_SC_8020, + .useTransport = US_PR_CBI}, + { .useProtocol = US_SC_QIC, + .useTransport = US_PR_CBI}, + { .useProtocol = US_SC_UFI, + .useTransport = US_PR_CBI}, + { .useProtocol = US_SC_8070, + .useTransport = US_PR_CBI}, + { .useProtocol = US_SC_SCSI, + .useTransport = US_PR_CBI}, + + /* Bulk-only transport for all SubClass values */ + { .useProtocol = US_SC_RBC, + .useTransport = US_PR_BULK}, + { .useProtocol = US_SC_8020, + .useTransport = US_PR_BULK}, + { .useProtocol = US_SC_QIC, + .useTransport = US_PR_BULK}, + { .useProtocol = US_SC_UFI, + .useTransport = US_PR_BULK}, + { .useProtocol = US_SC_8070, + .useTransport = US_PR_BULK}, + { .useProtocol = US_SC_SCSI, + .useTransport = US_PR_BULK}, /* Terminating entry */ { NULL } @@ -191,8 +240,6 @@ static int storage_suspend(struct usb_interface *iface, pm_message_t message) down(&us->dev_semaphore); US_DEBUGP("%s\n", __FUNCTION__); - if (us->suspend_resume_hook) - (us->suspend_resume_hook)(us, US_SUSPEND); iface->dev.power.power_state.event = message.event; /* When runtime PM is working, we'll set a flag to indicate @@ -209,8 +256,6 @@ static int storage_resume(struct usb_interface *iface) down(&us->dev_semaphore); US_DEBUGP("%s\n", __FUNCTION__); - if (us->suspend_resume_hook) - (us->suspend_resume_hook)(us, US_RESUME); iface->dev.power.power_state.event = PM_EVENT_ON; up(&us->dev_semaphore); @@ -439,20 +484,14 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf) return 0; } -/* Find an unusual_dev descriptor (always succeeds in the current code) */ -static struct us_unusual_dev *find_unusual(const struct usb_device_id *id) -{ - const int id_index = id - storage_usb_ids; - return &us_unusual_dev_list[id_index]; -} - /* Get the unusual_devs entries and the string descriptors */ -static void get_device_info(struct us_data *us, const struct usb_device_id *id) +static void get_device_info(struct us_data *us, int id_index) { struct usb_device *dev = us->pusb_dev; struct usb_interface_descriptor *idesc = &us->pusb_intf->cur_altsetting->desc; - struct us_unusual_dev *unusual_dev = find_unusual(id); + struct us_unusual_dev *unusual_dev = &us_unusual_dev_list[id_index]; + struct usb_device_id *id = &storage_usb_ids[id_index]; /* Store the entries */ us->unusual_dev = unusual_dev; @@ -462,7 +501,7 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id) us->protocol = (unusual_dev->useTransport == US_PR_DEVICE) ? idesc->bInterfaceProtocol : unusual_dev->useTransport; - us->flags = USB_US_ORIG_FLAGS(id->driver_info); + us->flags = unusual_dev->flags; /* * This flag is only needed when we're in high-speed, so let's @@ -477,7 +516,7 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id) * from the unusual_devs.h table. */ if (id->idVendor || id->idProduct) { - static const char *msgs[3] = { + static char *msgs[3] = { "an unneeded SubClass entry", "an unneeded Protocol entry", "unneeded SubClass and Protocol entries"}; @@ -490,7 +529,7 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id) if (unusual_dev->useTransport != US_PR_DEVICE && us->protocol == idesc->bInterfaceProtocol) msg += 2; - if (msg >= 0 && !(us->flags & US_FL_NEED_OVERRIDE)) + if (msg >= 0 && !(unusual_dev->flags & US_FL_NEED_OVERRIDE)) printk(KERN_NOTICE USB_STORAGE "This device " "(%04x,%04x,%04x S %02x P %02x)" " has %s in unusual_devs.h\n" @@ -647,15 +686,6 @@ static int get_protocol(struct us_data *us) break; #endif -#ifdef CONFIG_USB_STORAGE_ALAUDA - case US_PR_ALAUDA: - us->transport_name = "Alauda Control/Bulk"; - us->transport = alauda_transport; - us->transport_reset = usb_stor_Bulk_reset; - us->max_lun = 1; - break; -#endif - default: return -EIO; } @@ -891,12 +921,10 @@ static int storage_probe(struct usb_interface *intf, { struct Scsi_Host *host; struct us_data *us; + const int id_index = id - storage_usb_ids; int result; struct task_struct *th; - if (usb_usual_check_type(id, USB_US_TYPE_STOR)) - return -ENXIO; - US_DEBUGP("USB Mass Storage device detected\n"); /* @@ -929,7 +957,29 @@ static int storage_probe(struct usb_interface *intf, * of the match from the usb_device_id table, so we can find the * corresponding entry in the private table. */ - get_device_info(us, id); + get_device_info(us, id_index); + +#ifdef CONFIG_USB_STORAGE_SDDR09 + if (us->protocol == US_PR_EUSB_SDDR09 || + us->protocol == US_PR_DPCM_USB) { + /* set the configuration -- STALL is an acceptable response here */ + if (us->pusb_dev->actconfig->desc.bConfigurationValue != 1) { + US_DEBUGP("active config #%d != 1 ??\n", us->pusb_dev + ->actconfig->desc.bConfigurationValue); + goto BadDevice; + } + result = usb_reset_configuration(us->pusb_dev); + + US_DEBUGP("Result of usb_reset_configuration is %d\n", result); + if (result == -EPIPE) { + US_DEBUGP("-- stall on control interface\n"); + } else if (result != 0) { + /* it's not a stall, but another error -- time to bail */ + US_DEBUGP("-- Unknown error. Rejecting device\n"); + goto BadDevice; + } + } +#endif /* Get the transport, protocol, and pipe settings */ result = get_transport(us); @@ -994,6 +1044,7 @@ static void storage_disconnect(struct usb_interface *intf) ***********************************************************************/ static struct usb_driver usb_storage_driver = { + .owner = THIS_MODULE, .name = "usb-storage", .probe = storage_probe, .disconnect = storage_disconnect, @@ -1011,10 +1062,9 @@ static int __init usb_stor_init(void) /* register the driver, return usb_register return code if error */ retval = usb_register(&usb_storage_driver); - if (retval == 0) { + if (retval == 0) printk(KERN_INFO "USB Mass Storage support registered.\n"); - usb_usual_set_present(USB_US_TYPE_STOR); - } + return retval; } @@ -1038,8 +1088,6 @@ static void __exit usb_stor_exit(void) wait_for_completion(&threads_gone); atomic_dec(&total_threads); } - - usb_usual_clear_present(USB_US_TYPE_STOR); } module_init(usb_stor_init); diff --git a/trunk/drivers/usb/storage/usb.h b/trunk/drivers/usb/storage/usb.h index 7259fd1f6b0d..98b09711a739 100644 --- a/trunk/drivers/usb/storage/usb.h +++ b/trunk/drivers/usb/storage/usb.h @@ -45,7 +45,6 @@ #define _USB_H_ #include -#include #include #include #include @@ -64,8 +63,38 @@ struct us_unusual_dev { __u8 useProtocol; __u8 useTransport; int (*initFunction)(struct us_data *); + unsigned int flags; }; +/* + * Static flag definitions. We use this roundabout technique so that the + * proc_info() routine can automatically display a message for each flag. + */ +#define US_DO_ALL_FLAGS \ + US_FLAG(SINGLE_LUN, 0x00000001) \ + /* allow access to only LUN 0 */ \ + US_FLAG(NEED_OVERRIDE, 0x00000002) \ + /* unusual_devs entry is necessary */ \ + US_FLAG(SCM_MULT_TARG, 0x00000004) \ + /* supports multiple targets */ \ + US_FLAG(FIX_INQUIRY, 0x00000008) \ + /* INQUIRY response needs faking */ \ + US_FLAG(FIX_CAPACITY, 0x00000010) \ + /* READ CAPACITY response too big */ \ + US_FLAG(IGNORE_RESIDUE, 0x00000020) \ + /* reported residue is wrong */ \ + US_FLAG(BULK32, 0x00000040) \ + /* Uses 32-byte CBW length */ \ + US_FLAG(NOT_LOCKABLE, 0x00000080) \ + /* PREVENT/ALLOW not supported */ \ + US_FLAG(GO_SLOW, 0x00000100) \ + /* Need delay after Command phase */ \ + US_FLAG(NO_WP_DETECT, 0x00000200) \ + /* Don't check for write-protect */ \ + +#define US_FLAG(name, value) US_FL_##name = value , +enum { US_DO_ALL_FLAGS }; +#undef US_FLAG /* Dynamic flag definitions: used in set_bit() etc. */ #define US_FLIDX_URB_ACTIVE 18 /* 0x00040000 current_urb is in use */ @@ -93,11 +122,7 @@ struct us_unusual_dev { typedef int (*trans_cmnd)(struct scsi_cmnd *, struct us_data*); typedef int (*trans_reset)(struct us_data*); typedef void (*proto_cmnd)(struct scsi_cmnd*, struct us_data*); -typedef void (*extra_data_destructor)(void *); /* extra data destructor */ -typedef void (*pm_hook)(struct us_data *, int); /* power management hook */ - -#define US_SUSPEND 0 -#define US_RESUME 1 +typedef void (*extra_data_destructor)(void *); /* extra data destructor */ /* we allocate one of these for every device that we remember */ struct us_data { @@ -153,9 +178,6 @@ struct us_data { /* subdriver information */ void *extra; /* Any extra data */ extra_data_destructor extra_destructor;/* extra data destructor */ -#ifdef CONFIG_PM - pm_hook suspend_resume_hook; -#endif }; /* Convert between us_data and the corresponding Scsi_Host */ diff --git a/trunk/drivers/usb/usb-skeleton.c b/trunk/drivers/usb/usb-skeleton.c index 5d02f16b7d0e..6c3a53f8f26c 100644 --- a/trunk/drivers/usb/usb-skeleton.c +++ b/trunk/drivers/usb/usb-skeleton.c @@ -39,15 +39,10 @@ MODULE_DEVICE_TABLE (usb, skel_table); /* Get a minor range for your devices from the usb maintainer */ #define USB_SKEL_MINOR_BASE 192 -/* our private defines. if this grows any larger, use your own .h file */ -#define MAX_TRANSFER ( PAGE_SIZE - 512 ) -#define WRITES_IN_FLIGHT 8 - /* Structure to hold all of our device specific stuff */ struct usb_skel { struct usb_device * udev; /* the usb device for this device */ struct usb_interface * interface; /* the interface for this device */ - struct semaphore limit_sem; /* limiting the number of writes in progress */ unsigned char * bulk_in_buffer; /* the buffer to receive data */ size_t bulk_in_size; /* the size of the receive buffer */ __u8 bulk_in_endpointAddr; /* the address of the bulk in endpoint */ @@ -157,7 +152,6 @@ static void skel_write_bulk_callback(struct urb *urb, struct pt_regs *regs) /* free up our allocated buffer */ usb_buffer_free(urb->dev, urb->transfer_buffer_length, urb->transfer_buffer, urb->transfer_dma); - up(&dev->limit_sem); } static ssize_t skel_write(struct file *file, const char *user_buffer, size_t count, loff_t *ppos) @@ -166,7 +160,6 @@ static ssize_t skel_write(struct file *file, const char *user_buffer, size_t cou int retval = 0; struct urb *urb = NULL; char *buf = NULL; - size_t writesize = min(count, (size_t)MAX_TRANSFER); dev = (struct usb_skel *)file->private_data; @@ -174,12 +167,6 @@ static ssize_t skel_write(struct file *file, const char *user_buffer, size_t cou if (count == 0) goto exit; - /* limit the number of URBs in flight to stop a user from using up all RAM */ - if (down_interruptible(&dev->limit_sem)) { - retval = -ERESTARTSYS; - goto exit; - } - /* create a urb, and a buffer for it, and copy the data to the urb */ urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { @@ -187,13 +174,13 @@ static ssize_t skel_write(struct file *file, const char *user_buffer, size_t cou goto error; } - buf = usb_buffer_alloc(dev->udev, writesize, GFP_KERNEL, &urb->transfer_dma); + buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma); if (!buf) { retval = -ENOMEM; goto error; } - if (copy_from_user(buf, user_buffer, writesize)) { + if (copy_from_user(buf, user_buffer, count)) { retval = -EFAULT; goto error; } @@ -201,7 +188,7 @@ static ssize_t skel_write(struct file *file, const char *user_buffer, size_t cou /* initialize the urb properly */ usb_fill_bulk_urb(urb, dev->udev, usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr), - buf, writesize, skel_write_bulk_callback, dev); + buf, count, skel_write_bulk_callback, dev); urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; /* send the data out the bulk port */ @@ -215,12 +202,11 @@ static ssize_t skel_write(struct file *file, const char *user_buffer, size_t cou usb_free_urb(urb); exit: - return writesize; + return count; error: - usb_buffer_free(dev->udev, writesize, buf, urb->transfer_dma); + usb_buffer_free(dev->udev, count, buf, urb->transfer_dma); usb_free_urb(urb); - up(&dev->limit_sem); return retval; } @@ -252,13 +238,13 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i int retval = -ENOMEM; /* allocate memory for our device state and initialize it */ - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = kmalloc(sizeof(*dev), GFP_KERNEL); if (dev == NULL) { err("Out of memory"); goto error; } + memset(dev, 0x00, sizeof(*dev)); kref_init(&dev->kref); - sema_init(&dev->limit_sem, WRITES_IN_FLIGHT); dev->udev = usb_get_dev(interface_to_usbdev(interface)); dev->interface = interface; @@ -344,6 +330,7 @@ static void skel_disconnect(struct usb_interface *interface) } static struct usb_driver skel_driver = { + .owner = THIS_MODULE, .name = "skeleton", .probe = skel_probe, .disconnect = skel_disconnect, diff --git a/trunk/drivers/video/Kconfig b/trunk/drivers/video/Kconfig index cc8e3bf5001b..25b6ca6ad081 100644 --- a/trunk/drivers/video/Kconfig +++ b/trunk/drivers/video/Kconfig @@ -534,15 +534,9 @@ config FB_SUN3 bool "Sun3 framebuffer support" depends on (FB = y) && (SUN3 || SUN3X) && BROKEN -config FB_SBUS - bool "SBUS and UPA framebuffers" - depends on (FB = y) && SPARC - help - Say Y if you want support for SBUS or UPA based frame buffer device. - config FB_BW2 bool "BWtwo support" - depends on (FB = y) && (SPARC && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) + depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -551,8 +545,7 @@ config FB_BW2 config FB_CG3 bool "CGthree support" - depends on (FB = y) && (SPARC && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) - select FB_CFB_FILLRECT + depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help @@ -560,7 +553,7 @@ config FB_CG3 config FB_CG6 bool "CGsix (GX,TurboGX) support" - depends on (FB = y) && (SPARC && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) + depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help @@ -1217,6 +1210,12 @@ config FB_AU1100 source "drivers/video/geode/Kconfig" +config FB_SBUS + bool "SBUS and UPA framebuffers" + depends on (FB = y) && (SPARC32 || SPARC64) + help + Say Y if you want support for SBUS or UPA based frame buffer device. + config FB_FFB bool "Creator/Creator3D/Elite3D support" depends on FB_SBUS && SPARC64 @@ -1268,7 +1267,7 @@ config FB_LEO config FB_PCI bool "PCI framebuffers" - depends on (FB = y) && PCI && SPARC + depends on (FB = y) && PCI && (SPARC64 || SPARC32) config FB_IGA bool "IGA 168x display support" diff --git a/trunk/drivers/video/arcfb.c b/trunk/drivers/video/arcfb.c index 2784f0a9d693..080db812ca48 100644 --- a/trunk/drivers/video/arcfb.c +++ b/trunk/drivers/video/arcfb.c @@ -441,7 +441,7 @@ static int arcfb_ioctl(struct inode *inode, struct file *file, * the fb. it's inefficient for them to do anything less than 64*8 * writes since we update the lcd in each write() anyway. */ -static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t count, +static ssize_t arcfb_write(struct file *file, const char *buf, size_t count, loff_t *ppos) { /* modded from epson 1355 */ diff --git a/trunk/drivers/video/bw2.c b/trunk/drivers/video/bw2.c index 9248fe1fbb1a..d3728f60961e 100644 --- a/trunk/drivers/video/bw2.c +++ b/trunk/drivers/video/bw2.c @@ -121,6 +121,7 @@ struct bw2_par { unsigned long fbsize; struct sbus_dev *sdev; + struct list_head list; }; /** diff --git a/trunk/drivers/video/cfbcopyarea.c b/trunk/drivers/video/cfbcopyarea.c index 74415325b016..cdc71572cf35 100644 --- a/trunk/drivers/video/cfbcopyarea.c +++ b/trunk/drivers/video/cfbcopyarea.c @@ -64,8 +64,8 @@ bitcpy(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem *src int const shift = dst_idx-src_idx; int left, right; - first = FB_SHIFT_HIGH(~0UL, dst_idx); - last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits)); + first = ~0UL >> dst_idx; + last = ~(~0UL >> ((dst_idx+n) % bits)); if (!shift) { // Same alignment for source and dest @@ -216,8 +216,8 @@ bitcpy_rev(unsigned long __iomem *dst, int dst_idx, const unsigned long __iomem shift = dst_idx-src_idx; - first = FB_SHIFT_LOW(~0UL, bits - 1 - dst_idx); - last = ~(FB_SHIFT_LOW(~0UL, bits - 1 - ((dst_idx-n) % bits))); + first = ~0UL << (bits - 1 - dst_idx); + last = ~(~0UL << (bits - 1 - ((dst_idx-n) % bits))); if (!shift) { // Same alignment for source and dest diff --git a/trunk/drivers/video/cfbfillrect.c b/trunk/drivers/video/cfbfillrect.c index e5ff62e9cfb8..167d9314e6eb 100644 --- a/trunk/drivers/video/cfbfillrect.c +++ b/trunk/drivers/video/cfbfillrect.c @@ -110,8 +110,8 @@ bitfill_aligned(unsigned long __iomem *dst, int dst_idx, unsigned long pat, unsi if (!n) return; - first = FB_SHIFT_HIGH(~0UL, dst_idx); - last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits)); + first = ~0UL >> dst_idx; + last = ~(~0UL >> ((dst_idx+n) % bits)); if (dst_idx+n <= bits) { // Single word @@ -167,8 +167,8 @@ bitfill_unaligned(unsigned long __iomem *dst, int dst_idx, unsigned long pat, if (!n) return; - first = FB_SHIFT_HIGH(~0UL, dst_idx); - last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits)); + first = ~0UL >> dst_idx; + last = ~(~0UL >> ((dst_idx+n) % bits)); if (dst_idx+n <= bits) { // Single word @@ -221,8 +221,8 @@ bitfill_aligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat, if (!n) return; - first = FB_SHIFT_HIGH(~0UL, dst_idx); - last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits)); + first = ~0UL >> dst_idx; + last = ~(~0UL >> ((dst_idx+n) % bits)); if (dst_idx+n <= bits) { // Single word @@ -290,8 +290,8 @@ bitfill_unaligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat if (!n) return; - first = FB_SHIFT_HIGH(~0UL, dst_idx); - last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits)); + first = ~0UL >> dst_idx; + last = ~(~0UL >> ((dst_idx+n) % bits)); if (dst_idx+n <= bits) { // Single word diff --git a/trunk/drivers/video/cfbimgblt.c b/trunk/drivers/video/cfbimgblt.c index 910e2338a27e..a7770c4f17d0 100644 --- a/trunk/drivers/video/cfbimgblt.c +++ b/trunk/drivers/video/cfbimgblt.c @@ -76,6 +76,18 @@ static u32 cfb_tab32[] = { #define FB_WRITEL fb_writel #define FB_READL fb_readl +#if defined (__BIG_ENDIAN) +#define LEFT_POS(bpp) (32 - bpp) +#define SHIFT_HIGH(val, bits) ((val) >> (bits)) +#define SHIFT_LOW(val, bits) ((val) << (bits)) +#define BIT_NR(b) (7 - (b)) +#else +#define LEFT_POS(bpp) (0) +#define SHIFT_HIGH(val, bits) ((val) << (bits)) +#define SHIFT_LOW(val, bits) ((val) >> (bits)) +#define BIT_NR(b) (b) +#endif + static inline void color_imageblit(const struct fb_image *image, struct fb_info *p, u8 __iomem *dst1, u32 start_index, @@ -97,7 +109,7 @@ static inline void color_imageblit(const struct fb_image *image, val = 0; if (start_index) { - u32 start_mask = ~(FB_SHIFT_HIGH(~(u32)0, start_index)); + u32 start_mask = ~(SHIFT_HIGH(~(u32)0, start_index)); val = FB_READL(dst) & start_mask; shift = start_index; } @@ -107,20 +119,20 @@ static inline void color_imageblit(const struct fb_image *image, color = palette[*src]; else color = *src; - color <<= FB_LEFT_POS(bpp); - val |= FB_SHIFT_HIGH(color, shift); + color <<= LEFT_POS(bpp); + val |= SHIFT_HIGH(color, shift); if (shift >= null_bits) { FB_WRITEL(val, dst++); val = (shift == null_bits) ? 0 : - FB_SHIFT_LOW(color, 32 - shift); + SHIFT_LOW(color, 32 - shift); } shift += bpp; shift &= (32 - 1); src++; } if (shift) { - u32 end_mask = FB_SHIFT_HIGH(~(u32)0, shift); + u32 end_mask = SHIFT_HIGH(~(u32)0, shift); FB_WRITEL((FB_READL(dst) & end_mask) | val, dst); } @@ -150,8 +162,6 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info * u32 i, j, l; dst2 = (u32 __iomem *) dst1; - fgcolor <<= FB_LEFT_POS(bpp); - bgcolor <<= FB_LEFT_POS(bpp); for (i = image->height; i--; ) { shift = val = 0; @@ -162,21 +172,22 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info * /* write leading bits */ if (start_index) { - u32 start_mask = ~(FB_SHIFT_HIGH(~(u32)0,start_index)); + u32 start_mask = ~(SHIFT_HIGH(~(u32)0, start_index)); val = FB_READL(dst) & start_mask; shift = start_index; } while (j--) { l--; - color = (*s & 1 << (FB_BIT_NR(l))) ? fgcolor : bgcolor; - val |= FB_SHIFT_HIGH(color, shift); + color = (*s & 1 << (BIT_NR(l))) ? fgcolor : bgcolor; + color <<= LEFT_POS(bpp); + val |= SHIFT_HIGH(color, shift); /* Did the bitshift spill bits to the next long? */ if (shift >= null_bits) { FB_WRITEL(val, dst++); val = (shift == null_bits) ? 0 : - FB_SHIFT_LOW(color,32 - shift); + SHIFT_LOW(color,32 - shift); } shift += bpp; shift &= (32 - 1); @@ -185,7 +196,7 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info * /* write trailing bits */ if (shift) { - u32 end_mask = FB_SHIFT_HIGH(~(u32)0, shift); + u32 end_mask = SHIFT_HIGH(~(u32)0, shift); FB_WRITEL((FB_READL(dst) & end_mask) | val, dst); } diff --git a/trunk/drivers/video/cg14.c b/trunk/drivers/video/cg14.c index a56147102abb..1bed50f2a276 100644 --- a/trunk/drivers/video/cg14.c +++ b/trunk/drivers/video/cg14.c @@ -206,6 +206,7 @@ struct cg14_par { int mode; int ramsize; struct sbus_dev *sdev; + struct list_head list; }; static void __cg14_reset(struct cg14_par *par) diff --git a/trunk/drivers/video/cg3.c b/trunk/drivers/video/cg3.c index 9fcd89608ed7..a1354e7e0513 100644 --- a/trunk/drivers/video/cg3.c +++ b/trunk/drivers/video/cg3.c @@ -124,6 +124,7 @@ struct cg3_par { unsigned long fbsize; struct sbus_dev *sdev; + struct list_head list; }; /** diff --git a/trunk/drivers/video/cg6.c b/trunk/drivers/video/cg6.c index 050835e39aa3..9debe642fd2f 100644 --- a/trunk/drivers/video/cg6.c +++ b/trunk/drivers/video/cg6.c @@ -265,6 +265,7 @@ struct cg6_par { unsigned long fbsize; struct sbus_dev *sdev; + struct list_head list; }; static int cg6_sync(struct fb_info *info) @@ -611,7 +612,7 @@ static void cg6_chip_init(struct fb_info *info) struct cg6_par *par = (struct cg6_par *) info->par; struct cg6_tec __iomem *tec = par->tec; struct cg6_fbc __iomem *fbc = par->fbc; - u32 rev, conf, mode; + u32 rev, conf, mode, tmp; int i; /* Turn off stuff in the Transform Engine. */ diff --git a/trunk/drivers/video/cirrusfb.c b/trunk/drivers/video/cirrusfb.c index e0dbdfc0c8b4..2858c5c8ba3c 100644 --- a/trunk/drivers/video/cirrusfb.c +++ b/trunk/drivers/video/cirrusfb.c @@ -404,7 +404,7 @@ struct cirrusfb_info { struct cirrusfb_regs currentmode; int blank_mode; - u32 pseudo_palette[16]; + u32 pseudo_palette[17]; struct { u8 red, green, blue, pad; } palette[256]; #ifdef CONFIG_ZORRO @@ -1603,14 +1603,14 @@ static int cirrusfb_setcolreg (unsigned regno, unsigned red, unsigned green, switch (info->var.bits_per_pixel) { case 8: - cinfo->pseudo_palette[regno] = v; + ((u8*)(info->pseudo_palette))[regno] = v; break; case 16: - cinfo->pseudo_palette[regno] = v; + ((u16*)(info->pseudo_palette))[regno] = v; break; case 24: case 32: - cinfo->pseudo_palette[regno] = v; + ((u32*)(info->pseudo_palette))[regno] = v; break; } return 0; @@ -2020,21 +2020,18 @@ static void cirrusfb_prim_fillrect(struct cirrusfb_info *cinfo, const struct fb_fillrect *region) { int m; /* bytes per pixel */ - u32 color = (cinfo->info->fix.visual == FB_VISUAL_TRUECOLOR) ? - cinfo->pseudo_palette[region->color] : region->color; - if(cinfo->info->var.bits_per_pixel == 1) { cirrusfb_RectFill(cinfo->regbase, cinfo->info->var.bits_per_pixel, region->dx / 8, region->dy, region->width / 8, region->height, - color, + region->color, cinfo->currentmode.line_length); } else { m = ( cinfo->info->var.bits_per_pixel + 7 ) / 8; cirrusfb_RectFill(cinfo->regbase, cinfo->info->var.bits_per_pixel, region->dx * m, region->dy, region->width * m, region->height, - color, + region->color, cinfo->currentmode.line_length); } return; diff --git a/trunk/drivers/video/console/Kconfig b/trunk/drivers/video/console/Kconfig index a5d09e159cd1..5f74df993406 100644 --- a/trunk/drivers/video/console/Kconfig +++ b/trunk/drivers/video/console/Kconfig @@ -6,7 +6,7 @@ menu "Console display driver support" config VGA_CONSOLE bool "VGA text console" if EMBEDDED || !X86 - depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC && !M68K && !PARISC && !ARCH_VERSATILE + depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC && !ARCH_VERSATILE default y help Saying Y here will allow you to use Linux in text mode through a @@ -68,7 +68,7 @@ config SGI_NEWPORT_CONSOLE config PROM_CONSOLE bool "PROM console" - depends on SPARC + depends on SPARC32 || SPARC64 help Say Y to build a console driver for Sun machines that uses the terminal emulation built into their console PROMS. @@ -136,7 +136,7 @@ config FONTS config FONT_8x8 bool "VGA 8x8 font" if FONTS depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE - default y if !SPARC && !FONTS + default y if !SPARC32 && !SPARC64 && !FONTS help This is the "high resolution" font for the VGA frame buffer (the one provided by the text console 80x50 (and higher) modes). @@ -150,7 +150,7 @@ config FONT_8x8 config FONT_8x16 bool "VGA 8x16 font" if FONTS depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE=y || STI_CONSOLE || USB_SISUSBVGA_CON - default y if !SPARC && !FONTS + default y if !SPARC32 && !SPARC64 && !FONTS help This is the "high resolution" font for the VGA frame buffer (the one provided by the VGA text console 80x25 mode. @@ -160,7 +160,7 @@ config FONT_8x16 config FONT_6x11 bool "Mac console 6x11 font (not supported by all drivers)" if FONTS depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE - default y if !SPARC && !FONTS && MAC + default y if !SPARC32 && !SPARC64 && !FONTS && MAC help Small console font with Macintosh-style high-half glyphs. Some Mac framebuffer drivers don't support this one at all. @@ -176,7 +176,7 @@ config FONT_7x14 config FONT_PEARL_8x8 bool "Pearl (old m68k) console 8x8 font" if FONTS depends on FRAMEBUFFER_CONSOLE - default y if !SPARC && !FONTS && AMIGA + default y if !SPARC32 && !SPARC64 && !FONTS && AMIGA help Small console font with PC-style control-character and high-half glyphs. @@ -184,24 +184,24 @@ config FONT_PEARL_8x8 config FONT_ACORN_8x8 bool "Acorn console 8x8 font" if FONTS depends on FRAMEBUFFER_CONSOLE - default y if !SPARC && !FONTS && ARM && ARCH_ACORN + default y if !SPARC32 && !SPARC64 && !FONTS && ARM && ARCH_ACORN help Small console font with PC-style control characters and high-half glyphs. config FONT_MINI_4x6 bool "Mini 4x6 font" - depends on !SPARC && FONTS + depends on !SPARC32 && !SPARC64 && FONTS config FONT_SUN8x16 bool "Sparc console 8x16 font" - depends on FRAMEBUFFER_CONSOLE && (!SPARC && FONTS || SPARC) + depends on FRAMEBUFFER_CONSOLE && (!SPARC32 && !SPARC64 && FONTS || SPARC32 || SPARC64) help This is the high resolution console font for Sun machines. Say Y. config FONT_SUN12x22 bool "Sparc console 12x22 font (not supported by all drivers)" - depends on FRAMEBUFFER_CONSOLE && (!SPARC && FONTS || SPARC) + depends on FRAMEBUFFER_CONSOLE && (!SPARC32 && !SPARC64 && FONTS || SPARC32 || SPARC64) help This is the high resolution console font for Sun machines with very big letters (like the letters used in the SPARC PROM). If the diff --git a/trunk/drivers/video/console/fbcon.c b/trunk/drivers/video/console/fbcon.c index 3660e51b2612..e7802ffe549a 100644 --- a/trunk/drivers/video/console/fbcon.c +++ b/trunk/drivers/video/console/fbcon.c @@ -106,7 +106,8 @@ enum { FBCON_LOGO_DONTSHOW = -3 /* do not show the logo */ }; -static struct display fb_display[MAX_NR_CONSOLES]; +struct display fb_display[MAX_NR_CONSOLES]; +EXPORT_SYMBOL(fb_display); static signed char con2fb_map[MAX_NR_CONSOLES]; static signed char con2fb_map_boot[MAX_NR_CONSOLES]; @@ -652,12 +653,13 @@ static void set_blitting_type(struct vc_data *vc, struct fb_info *info, { struct fbcon_ops *ops = info->fbcon_par; - ops->p = (p) ? p : &fb_display[vc->vc_num]; - if ((info->flags & FBINFO_MISC_TILEBLITTING)) fbcon_set_tileops(vc, info, p, ops); else { - fbcon_set_rotation(info, ops->p); + struct display *disp; + + disp = (p) ? p : &fb_display[vc->vc_num]; + fbcon_set_rotation(info, disp); fbcon_set_bitops(ops); } } @@ -666,10 +668,11 @@ static void set_blitting_type(struct vc_data *vc, struct fb_info *info, struct display *p) { struct fbcon_ops *ops = info->fbcon_par; + struct display *disp; info->flags &= ~FBINFO_MISC_TILEBLITTING; - ops->p = (p) ? p : &fb_display[vc->vc_num]; - fbcon_set_rotation(info, ops->p); + disp = (p) ? p : &fb_display[vc->vc_num]; + fbcon_set_rotation(info, disp); fbcon_set_bitops(ops); } #endif /* CONFIG_MISC_TILEBLITTING */ @@ -2048,7 +2051,7 @@ static int fbcon_switch(struct vc_data *vc) struct fbcon_ops *ops; struct display *p = &fb_display[vc->vc_num]; struct fb_var_screeninfo var; - int i, prev_console, charcnt = 256; + int i, prev_console; info = registered_fb[con2fb_map[vc->vc_num]]; ops = info->fbcon_par; @@ -2103,8 +2106,7 @@ static int fbcon_switch(struct vc_data *vc) fb_set_var(info, &var); ops->var = info->var; - if (old_info != NULL && (old_info != info || - info->flags & FBINFO_MISC_ALWAYS_SETPAR)) { + if (old_info != NULL && old_info != info) { if (info->fbops->fb_set_par) info->fbops->fb_set_par(info); fbcon_del_cursor_timer(old_info); @@ -2121,13 +2123,6 @@ static int fbcon_switch(struct vc_data *vc) vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1); vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800; - - if (p->userfont) - charcnt = FNTCHARCNT(vc->vc_font.data); - - if (charcnt > 256) - vc->vc_complement_mask <<= 1; - updatescrollmode(p, info, vc); switch (p->scrollmode) { @@ -2147,12 +2142,8 @@ static int fbcon_switch(struct vc_data *vc) scrollback_max = 0; scrollback_current = 0; - - if (!fbcon_is_inactive(vc, info)) { - ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; - ops->update_start(info); - } - + ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; + ops->update_start(info); fbcon_set_palette(vc, color_table); fbcon_clear_margins(vc, 0); @@ -2196,14 +2187,11 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) ops->graphics = 1; if (!blank) { - if (info->fbops->fb_save_state) - info->fbops->fb_save_state(info); var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE; fb_set_var(info, &var); ops->graphics = 0; ops->var = info->var; - } else if (info->fbops->fb_restore_state) - info->fbops->fb_restore_state(info); + } } if (!fbcon_is_inactive(vc, info)) { @@ -2751,12 +2739,8 @@ static void fbcon_modechanged(struct fb_info *info) updatescrollmode(p, info, vc); scrollback_max = 0; scrollback_current = 0; - - if (!fbcon_is_inactive(vc, info)) { - ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; - ops->update_start(info); - } - + ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; + ops->update_start(info); fbcon_set_palette(vc, color_table); update_screen(vc); if (softback_buf) @@ -2793,13 +2777,8 @@ static void fbcon_set_all_vcs(struct fb_info *info) updatescrollmode(p, info, vc); scrollback_max = 0; scrollback_current = 0; - - if (!fbcon_is_inactive(vc, info)) { - ops->var.xoffset = ops->var.yoffset = - p->yscroll = 0; - ops->update_start(info); - } - + ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; + ops->update_start(info); fbcon_set_palette(vc, color_table); update_screen(vc); if (softback_buf) diff --git a/trunk/drivers/video/console/fbcon.h b/trunk/drivers/video/console/fbcon.h index 6892e7ff34de..accfd7bd8e93 100644 --- a/trunk/drivers/video/console/fbcon.h +++ b/trunk/drivers/video/console/fbcon.h @@ -52,6 +52,8 @@ struct display { struct fb_videomode *mode; }; +extern struct display fb_display[]; + struct fbcon_ops { void (*bmove)(struct vc_data *vc, struct fb_info *info, int sy, int sx, int dy, int dx, int height, int width); @@ -71,7 +73,6 @@ struct fbcon_ops { struct fb_var_screeninfo var; /* copy of the current fb_var_screeninfo */ struct timer_list cursor_timer; /* Cursor timer */ struct fb_cursor cursor_state; - struct display *p; int currcon; /* Current VC. */ int cursor_flash; int cursor_reset; diff --git a/trunk/drivers/video/console/fbcon_ccw.c b/trunk/drivers/video/console/fbcon_ccw.c index 4952b66ae206..680aabab73c5 100644 --- a/trunk/drivers/video/console/fbcon_ccw.c +++ b/trunk/drivers/video/console/fbcon_ccw.c @@ -34,7 +34,7 @@ static inline void ccw_update_attr(u8 *dst, u8 *src, int attribute, msk <<= (8 - mod); if (offset > mod) - msk1 |= 0x01; + set_bit(FBCON_BIT(7), (void *)&msk1); for (i = 0; i < vc->vc_font.width; i++) { for (j = 0; j < width; j++) { @@ -63,9 +63,9 @@ static inline void ccw_update_attr(u8 *dst, u8 *src, int attribute, static void ccw_bmove(struct vc_data *vc, struct fb_info *info, int sy, int sx, int dy, int dx, int height, int width) { - struct fbcon_ops *ops = info->fbcon_par; + struct display *p = &fb_display[vc->vc_num]; struct fb_copyarea area; - u32 vyres = GETVYRES(ops->p->scrollmode, info); + u32 vyres = GETVYRES(p->scrollmode, info); area.sx = sy * vc->vc_font.height; area.sy = vyres - ((sx + width) * vc->vc_font.width); @@ -80,10 +80,10 @@ static void ccw_bmove(struct vc_data *vc, struct fb_info *info, int sy, static void ccw_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width) { - struct fbcon_ops *ops = info->fbcon_par; + struct display *p = &fb_display[vc->vc_num]; struct fb_fillrect region; int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; - u32 vyres = GETVYRES(ops->p->scrollmode, info); + u32 vyres = GETVYRES(p->scrollmode, info); region.color = attr_bgcol_ec(bgshift,vc); region.dx = sy * vc->vc_font.height; @@ -131,6 +131,7 @@ static void ccw_putcs(struct vc_data *vc, struct fb_info *info, int fg, int bg) { struct fb_image image; + struct display *p = &fb_display[vc->vc_num]; struct fbcon_ops *ops = info->fbcon_par; u32 width = (vc->vc_font.height + 7)/8; u32 cellsize = width * vc->vc_font.width; @@ -140,7 +141,7 @@ static void ccw_putcs(struct vc_data *vc, struct fb_info *info, u32 cnt, pitch, size; u32 attribute = get_attribute(info, scr_readw(s)); u8 *dst, *buf = NULL; - u32 vyres = GETVYRES(ops->p->scrollmode, info); + u32 vyres = GETVYRES(p->scrollmode, info); if (!ops->fontbuffer) return; @@ -396,8 +397,9 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int ccw_update_start(struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; + struct display *p = &fb_display[ops->currcon]; u32 yoffset; - u32 vyres = GETVYRES(ops->p->scrollmode, info); + u32 vyres = GETVYRES(p->scrollmode, info); int err; yoffset = (vyres - info->var.yres) - ops->var.xoffset; diff --git a/trunk/drivers/video/console/fbcon_cw.c b/trunk/drivers/video/console/fbcon_cw.c index 6d92b8456206..6c6f3b6dd175 100644 --- a/trunk/drivers/video/console/fbcon_cw.c +++ b/trunk/drivers/video/console/fbcon_cw.c @@ -49,9 +49,9 @@ static inline void cw_update_attr(u8 *dst, u8 *src, int attribute, static void cw_bmove(struct vc_data *vc, struct fb_info *info, int sy, int sx, int dy, int dx, int height, int width) { - struct fbcon_ops *ops = info->fbcon_par; + struct display *p = &fb_display[vc->vc_num]; struct fb_copyarea area; - u32 vxres = GETVXRES(ops->p->scrollmode, info); + u32 vxres = GETVXRES(p->scrollmode, info); area.sx = vxres - ((sy + height) * vc->vc_font.height); area.sy = sx * vc->vc_font.width; @@ -66,10 +66,10 @@ static void cw_bmove(struct vc_data *vc, struct fb_info *info, int sy, static void cw_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width) { - struct fbcon_ops *ops = info->fbcon_par; + struct display *p = &fb_display[vc->vc_num]; struct fb_fillrect region; int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; - u32 vxres = GETVXRES(ops->p->scrollmode, info); + u32 vxres = GETVXRES(p->scrollmode, info); region.color = attr_bgcol_ec(bgshift,vc); region.dx = vxres - ((sy + height) * vc->vc_font.height); @@ -117,6 +117,7 @@ static void cw_putcs(struct vc_data *vc, struct fb_info *info, int fg, int bg) { struct fb_image image; + struct display *p = &fb_display[vc->vc_num]; struct fbcon_ops *ops = info->fbcon_par; u32 width = (vc->vc_font.height + 7)/8; u32 cellsize = width * vc->vc_font.width; @@ -126,7 +127,7 @@ static void cw_putcs(struct vc_data *vc, struct fb_info *info, u32 cnt, pitch, size; u32 attribute = get_attribute(info, scr_readw(s)); u8 *dst, *buf = NULL; - u32 vxres = GETVXRES(ops->p->scrollmode, info); + u32 vxres = GETVXRES(p->scrollmode, info); if (!ops->fontbuffer) return; @@ -380,7 +381,8 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int cw_update_start(struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; - u32 vxres = GETVXRES(ops->p->scrollmode, info); + struct display *p = &fb_display[ops->currcon]; + u32 vxres = GETVXRES(p->scrollmode, info); u32 xoffset; int err; diff --git a/trunk/drivers/video/console/fbcon_rotate.h b/trunk/drivers/video/console/fbcon_rotate.h index 1b8f92fdc6a8..90c672096c2e 100644 --- a/trunk/drivers/video/console/fbcon_rotate.h +++ b/trunk/drivers/video/console/fbcon_rotate.h @@ -21,13 +21,21 @@ (s == SCROLL_REDRAW || s == SCROLL_MOVE || !(i)->fix.xpanstep) ? \ (i)->var.xres : (i)->var.xres_virtual; }) +/* + * The bitmap is always big endian + */ +#if defined(__LITTLE_ENDIAN) +#define FBCON_BIT(b) (7 - (b)) +#else +#define FBCON_BIT(b) (b) +#endif static inline int pattern_test_bit(u32 x, u32 y, u32 pitch, const char *pat) { u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8; pat +=index; - return (*pat) & (0x80 >> bit); + return (test_bit(FBCON_BIT(bit), (void *)pat)); } static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat) @@ -35,14 +43,13 @@ static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat) u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8; pat += index; - - (*pat) |= 0x80 >> bit; + set_bit(FBCON_BIT(bit), (void *)pat); } static inline void rotate_ud(const char *in, char *out, u32 width, u32 height) { int i, j; - int shift = (8 - (width % 8)) & 7; + int shift = width % 8; width = (width + 7) & ~7; @@ -78,7 +85,7 @@ static inline void rotate_cw(const char *in, char *out, u32 width, u32 height) static inline void rotate_ccw(const char *in, char *out, u32 width, u32 height) { int i, j, h = height, w = width; - int shift = (8 - (width % 8)) & 7; + int shift = width % 8; width = (width + 7) & ~7; height = (height + 7) & ~7; diff --git a/trunk/drivers/video/console/fbcon_ud.c b/trunk/drivers/video/console/fbcon_ud.c index 9dd059e8b645..2e1d9d4249cd 100644 --- a/trunk/drivers/video/console/fbcon_ud.c +++ b/trunk/drivers/video/console/fbcon_ud.c @@ -48,10 +48,10 @@ static inline void ud_update_attr(u8 *dst, u8 *src, int attribute, static void ud_bmove(struct vc_data *vc, struct fb_info *info, int sy, int sx, int dy, int dx, int height, int width) { - struct fbcon_ops *ops = info->fbcon_par; + struct display *p = &fb_display[vc->vc_num]; struct fb_copyarea area; - u32 vyres = GETVYRES(ops->p->scrollmode, info); - u32 vxres = GETVXRES(ops->p->scrollmode, info); + u32 vyres = GETVYRES(p->scrollmode, info); + u32 vxres = GETVXRES(p->scrollmode, info); area.sy = vyres - ((sy + height) * vc->vc_font.height); area.sx = vxres - ((sx + width) * vc->vc_font.width); @@ -66,11 +66,11 @@ static void ud_bmove(struct vc_data *vc, struct fb_info *info, int sy, static void ud_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width) { - struct fbcon_ops *ops = info->fbcon_par; + struct display *p = &fb_display[vc->vc_num]; struct fb_fillrect region; int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; - u32 vyres = GETVYRES(ops->p->scrollmode, info); - u32 vxres = GETVXRES(ops->p->scrollmode, info); + u32 vyres = GETVYRES(p->scrollmode, info); + u32 vxres = GETVXRES(p->scrollmode, info); region.color = attr_bgcol_ec(bgshift,vc); region.dy = vyres - ((sy + height) * vc->vc_font.height); @@ -153,6 +153,7 @@ static void ud_putcs(struct vc_data *vc, struct fb_info *info, int fg, int bg) { struct fb_image image; + struct display *p = &fb_display[vc->vc_num]; struct fbcon_ops *ops = info->fbcon_par; u32 width = (vc->vc_font.width + 7)/8; u32 cellsize = width * vc->vc_font.height; @@ -162,8 +163,8 @@ static void ud_putcs(struct vc_data *vc, struct fb_info *info, u32 mod = vc->vc_font.width % 8, cnt, pitch, size; u32 attribute = get_attribute(info, scr_readw(s)); u8 *dst, *buf = NULL; - u32 vyres = GETVYRES(ops->p->scrollmode, info); - u32 vxres = GETVXRES(ops->p->scrollmode, info); + u32 vyres = GETVYRES(p->scrollmode, info); + u32 vxres = GETVXRES(p->scrollmode, info); if (!ops->fontbuffer) return; @@ -420,15 +421,14 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, int ud_update_start(struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; - int xoffset, yoffset; - u32 vyres = GETVYRES(ops->p->scrollmode, info); - u32 vxres = GETVXRES(ops->p->scrollmode, info); + struct display *p = &fb_display[ops->currcon]; + u32 xoffset, yoffset; + u32 vyres = GETVYRES(p->scrollmode, info); + u32 vxres = GETVXRES(p->scrollmode, info); int err; - xoffset = vxres - info->var.xres - ops->var.xoffset; - yoffset = vyres - info->var.yres - ops->var.yoffset; - if (yoffset < 0) - yoffset += vyres; + xoffset = (vxres - info->var.xres) - ops->var.xoffset; + yoffset = (vyres - info->var.yres) - ops->var.yoffset; ops->var.xoffset = xoffset; ops->var.yoffset = yoffset; err = fb_pan_display(info, &ops->var); diff --git a/trunk/drivers/video/console/vgacon.c b/trunk/drivers/video/console/vgacon.c index 167de397e4b4..274f90543e32 100644 --- a/trunk/drivers/video/console/vgacon.c +++ b/trunk/drivers/video/console/vgacon.c @@ -966,7 +966,6 @@ static int vgacon_adjust_height(struct vc_data *vc, unsigned fontheight) outb_p(0x12, vga_video_port_reg); /* Vertical display limit */ outb_p(vde, vga_video_port_val); spin_unlock_irq(&vga_lock); - vga_video_font_height = fontheight; for (i = 0; i < MAX_NR_CONSOLES; i++) { struct vc_data *c = vc_cons[i].d; diff --git a/trunk/drivers/video/cyber2000fb.c b/trunk/drivers/video/cyber2000fb.c index a9300f930ef2..c589d23e7f91 100644 --- a/trunk/drivers/video/cyber2000fb.c +++ b/trunk/drivers/video/cyber2000fb.c @@ -1512,7 +1512,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb) * I/O cycles storing into a reserved memory space at * physical address 0x3000000 */ - unsigned char __iomem *iop; + unsigned char *iop; iop = ioremap(0x3000000, 0x5000); if (iop == NULL) { @@ -1526,7 +1526,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb) writeb(EXT_BIU_MISC, iop + 0x3ce); writeb(EXT_BIU_MISC_LIN_ENABLE, iop + 0x3cf); - iounmap(iop); + iounmap((void *)iop); #else /* * Most other machine types are "normal", so diff --git a/trunk/drivers/video/fbmem.c b/trunk/drivers/video/fbmem.c index 10dfdf035264..9f180096c896 100644 --- a/trunk/drivers/video/fbmem.c +++ b/trunk/drivers/video/fbmem.c @@ -452,17 +452,13 @@ int fb_prepare_logo(struct fb_info *info, int rotate) /* Return if no suitable logo was found */ fb_logo.logo = fb_find_logo(depth); - - if (!fb_logo.logo) { - return 0; - } if (rotate == FB_ROTATE_UR || rotate == FB_ROTATE_UD) yres = info->var.yres; else yres = info->var.xres; - if (fb_logo.logo->height > yres) { + if (fb_logo.logo && fb_logo.logo->height > yres) { fb_logo.logo = NULL; return 0; } @@ -722,30 +718,14 @@ static void try_to_load(int fb) int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) { - struct fb_fix_screeninfo *fix = &info->fix; int xoffset = var->xoffset; int yoffset = var->yoffset; - int err = 0, yres = info->var.yres; - - if (var->yoffset > 0) { - if (var->vmode & FB_VMODE_YWRAP) { - if (!fix->ywrapstep || (var->yoffset % fix->ywrapstep)) - err = -EINVAL; - else - yres = 0; - } else if (!fix->ypanstep || (var->yoffset % fix->ypanstep)) - err = -EINVAL; - } - - if (var->xoffset > 0 && (!fix->xpanstep || - (var->xoffset % fix->xpanstep))) - err = -EINVAL; - - if (err || !info->fbops->fb_pan_display || xoffset < 0 || - yoffset < 0 || var->yoffset + yres > info->var.yres_virtual || - var->xoffset + info->var.xres > info->var.xres_virtual) - return -EINVAL; + int err; + if (xoffset < 0 || yoffset < 0 || !info->fbops->fb_pan_display || + xoffset + info->var.xres > info->var.xres_virtual || + yoffset + info->var.yres > info->var.yres_virtual) + return -EINVAL; if ((err = info->fbops->fb_pan_display(var, info))) return err; info->var.xoffset = var->xoffset; diff --git a/trunk/drivers/video/ffb.c b/trunk/drivers/video/ffb.c index c4870d559afc..2584daec7bbf 100644 --- a/trunk/drivers/video/ffb.c +++ b/trunk/drivers/video/ffb.c @@ -359,6 +359,7 @@ struct ffb_par { int prom_parent_node; int dac_rev; int board_type; + struct list_head list; }; static void FFBFifo(struct ffb_par *par, int n) diff --git a/trunk/drivers/video/intelfb/intelfb.h b/trunk/drivers/video/intelfb/intelfb.h index da29d007f215..f077ca34faba 100644 --- a/trunk/drivers/video/intelfb/intelfb.h +++ b/trunk/drivers/video/intelfb/intelfb.h @@ -41,10 +41,6 @@ /*** hw-related values ***/ -/* Resource Allocation */ -#define INTELFB_FB_ACQUIRED 1 -#define INTELFB_MMIO_ACQUIRED 2 - /* PCI ids for supported devices */ #define PCI_DEVICE_ID_INTEL_830M 0x3577 #define PCI_DEVICE_ID_INTEL_845G 0x2562 @@ -261,7 +257,6 @@ struct intelfb_info { int hwcursor; int fixed_mode; int ring_active; - int flag; /* hw cursor */ int cursor_on; diff --git a/trunk/drivers/video/intelfb/intelfbdrv.c b/trunk/drivers/video/intelfb/intelfbdrv.c index 0090544842f5..427689e584da 100644 --- a/trunk/drivers/video/intelfb/intelfbdrv.c +++ b/trunk/drivers/video/intelfb/intelfbdrv.c @@ -135,6 +135,9 @@ static void __devinit get_initial_mode(struct intelfb_info *dinfo); static void update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var); +static int intelfb_get_fix(struct fb_fix_screeninfo *fix, + struct fb_info *info); + static int intelfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info); static int intelfb_set_par(struct fb_info *info); @@ -470,9 +473,9 @@ cleanup(struct intelfb_info *dinfo) if (dinfo->aperture.virtual) iounmap((void __iomem *)dinfo->aperture.virtual); - if (dinfo->flag & INTELFB_MMIO_ACQUIRED) + if (dinfo->mmio_base_phys) release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE); - if (dinfo->flag & INTELFB_FB_ACQUIRED) + if (dinfo->aperture.physical) release_mem_region(dinfo->aperture.physical, dinfo->aperture.size); framebuffer_release(dinfo->info); @@ -569,9 +572,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) cleanup(dinfo); return -ENODEV; } - - dinfo->flag |= INTELFB_FB_ACQUIRED; - if (!request_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE, INTELFB_MODULE_NAME)) { @@ -580,8 +580,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) return -ENODEV; } - dinfo->flag |= INTELFB_MMIO_ACQUIRED; - /* Get the chipset info. */ dinfo->pci_chipset = pdev->device; @@ -1093,17 +1091,7 @@ intelfb_set_fbinfo(struct intelfb_info *dinfo) return 1; info->pixmap.scan_align = 1; - strcpy(info->fix.id, dinfo->name); - info->fix.smem_start = dinfo->fb.physical; - info->fix.smem_len = dinfo->fb.size; - info->fix.type = FB_TYPE_PACKED_PIXELS; - info->fix.type_aux = 0; - info->fix.xpanstep = 8; - info->fix.ypanstep = 1; - info->fix.ywrapstep = 0; - info->fix.mmio_start = dinfo->mmio_base_phys; - info->fix.mmio_len = INTEL_REG_SIZE; - info->fix.accel = FB_ACCEL_I830; + update_dinfo(dinfo, &info->var); return 0; @@ -1121,8 +1109,7 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var) dinfo->yres = var->xres; dinfo->pixclock = var->pixclock; - dinfo->info->fix.visual = dinfo->visual; - dinfo->info->fix.line_length = dinfo->pitch; + intelfb_get_fix(&dinfo->info->fix, dinfo->info); switch (dinfo->bpp) { case 8: @@ -1152,6 +1139,30 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var) /* fbops functions */ +static int +intelfb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) +{ + struct intelfb_info *dinfo = GET_DINFO(info); + + DBG_MSG("intelfb_get_fix\n"); + + memset(fix, 0, sizeof(*fix)); + strcpy(fix->id, dinfo->name); + fix->smem_start = dinfo->fb.physical; + fix->smem_len = dinfo->fb.size; + fix->type = FB_TYPE_PACKED_PIXELS; + fix->type_aux = 0; + fix->visual = dinfo->visual; + fix->xpanstep = 8; + fix->ypanstep = 1; + fix->ywrapstep = 0; + fix->line_length = dinfo->pitch; + fix->mmio_start = dinfo->mmio_base_phys; + fix->mmio_len = INTEL_REG_SIZE; + fix->accel = FB_ACCEL_I830; + return 0; +} + /*************************************************************** * fbdev interface * ***************************************************************/ diff --git a/trunk/drivers/video/leo.c b/trunk/drivers/video/leo.c index 494287f8f8bf..376d4a171ec7 100644 --- a/trunk/drivers/video/leo.c +++ b/trunk/drivers/video/leo.c @@ -197,6 +197,7 @@ struct leo_par { unsigned long fbsize; struct sbus_dev *sdev; + struct list_head list; }; static void leo_wait(struct leo_lx_krn __iomem *lx_krn) diff --git a/trunk/drivers/video/logo/Kconfig b/trunk/drivers/video/logo/Kconfig index f0e6512c87ff..8cb7fb4db441 100644 --- a/trunk/drivers/video/logo/Kconfig +++ b/trunk/drivers/video/logo/Kconfig @@ -47,7 +47,7 @@ config LOGO_SGI_CLUT224 config LOGO_SUN_CLUT224 bool "224-color Sun Linux logo" - depends on LOGO && SPARC + depends on LOGO && (SPARC32 || SPARC64) default y config LOGO_SUPERH_MONO diff --git a/trunk/drivers/video/nvidia/nv_proto.h b/trunk/drivers/video/nvidia/nv_proto.h index 3353103e8b0b..f60b1f432270 100644 --- a/trunk/drivers/video/nvidia/nv_proto.h +++ b/trunk/drivers/video/nvidia/nv_proto.h @@ -42,7 +42,7 @@ int nvidia_probe_i2c_connector(struct fb_info *info, int conn, #define nvidia_probe_i2c_connector(p, c, edid) (-1) #endif -#ifdef CONFIG_PPC_OF +#ifdef CONFIG_FB_OF int nvidia_probe_of_connector(struct fb_info *info, int conn, u8 ** out_edid); #else diff --git a/trunk/drivers/video/nvidia/nvidia.c b/trunk/drivers/video/nvidia/nvidia.c index bee09c6e48f6..0b40a2a721c1 100644 --- a/trunk/drivers/video/nvidia/nvidia.c +++ b/trunk/drivers/video/nvidia/nvidia.c @@ -1301,7 +1301,7 @@ static int nvidiafb_pan_display(struct fb_var_screeninfo *var, struct nvidia_par *par = info->par; u32 total; - total = var->yoffset * info->fix.line_length + var->xoffset; + total = info->var.yoffset * info->fix.line_length + info->var.xoffset; NVSetStartAddress(par, total); diff --git a/trunk/drivers/video/offb.c b/trunk/drivers/video/offb.c index 00d87f5bb7be..2c856838694e 100644 --- a/trunk/drivers/video/offb.c +++ b/trunk/drivers/video/offb.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -326,8 +325,8 @@ static void __init offb_init_nodriver(struct device_node *dp) int *pp, i; unsigned int len; int width = 640, height = 480, depth = 8, pitch; - unsigned int rsize, *up; - unsigned long address = 0; + unsigned *up; + unsigned long address; if ((pp = (int *) get_property(dp, "depth", &len)) != NULL && len == sizeof(int)) @@ -345,40 +344,10 @@ static void __init offb_init_nodriver(struct device_node *dp) pitch = 0x1000; } else pitch = width; - - rsize = (unsigned long)pitch * (unsigned long)height * - (unsigned long)(depth / 8); - - /* Try to match device to a PCI device in order to get a properly - * translated address rather then trying to decode the open firmware - * stuff in various incorrect ways - */ -#ifdef CONFIG_PCI - /* First try to locate the PCI device if any */ - { - struct pci_dev *pdev = NULL; - - for_each_pci_dev(pdev) { - if (dp == pci_device_to_OF_node(pdev)) - break; - } - if (pdev) { - for (i = 0; i < 6 && address == 0; i++) { - if ((pci_resource_flags(pdev, i) & - IORESOURCE_MEM) && - (pci_resource_len(pdev, i) >= rsize)) - address = pci_resource_start(pdev, i); - } - pci_dev_put(pdev); - } - } -#endif /* CONFIG_PCI */ - - if (address == 0 && - (up = (unsigned *) get_property(dp, "address", &len)) != NULL && - len == sizeof(unsigned)) + if ((up = (unsigned *) get_property(dp, "address", &len)) != NULL + && len == sizeof(unsigned)) address = (u_long) * up; - if (address == 0) { + else { for (i = 0; i < dp->n_addrs; ++i) if (dp->addrs[i].size >= pitch * height * depth / 8) diff --git a/trunk/drivers/video/p9100.c b/trunk/drivers/video/p9100.c index b251e754e16c..18bcda23d2cf 100644 --- a/trunk/drivers/video/p9100.c +++ b/trunk/drivers/video/p9100.c @@ -140,6 +140,7 @@ struct p9100_par { unsigned long fbsize; struct sbus_dev *sdev; + struct list_head list; }; /** diff --git a/trunk/drivers/video/pxafb.c b/trunk/drivers/video/pxafb.c index 9fc10b9e6f57..7b4cd250bec8 100644 --- a/trunk/drivers/video/pxafb.c +++ b/trunk/drivers/video/pxafb.c @@ -1396,8 +1396,7 @@ static struct platform_driver pxafb_driver = { int __devinit pxafb_setup(char *options) { # ifdef CONFIG_FB_PXA_PARAMETERS - if (options) - strlcpy(g_options, options, sizeof(g_options)); + strlcpy(g_options, options, sizeof(g_options)); # endif return 0; } diff --git a/trunk/drivers/video/sbuslib.c b/trunk/drivers/video/sbuslib.c index 3a74a63dd4f2..646c43f921c5 100644 --- a/trunk/drivers/video/sbuslib.c +++ b/trunk/drivers/video/sbuslib.c @@ -46,9 +46,6 @@ int sbusfb_mmap_helper(struct sbus_mmap_map *map, unsigned long off; int i; - if (!(vma->vm_flags & (VM_SHARED | VM_MAYSHARE))) - return -EINVAL; - size = vma->vm_end - vma->vm_start; if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) return -EINVAL; diff --git a/trunk/drivers/video/tcx.c b/trunk/drivers/video/tcx.c index 2b27b4474001..fe4f63f3849d 100644 --- a/trunk/drivers/video/tcx.c +++ b/trunk/drivers/video/tcx.c @@ -125,6 +125,7 @@ struct tcx_par { int lowdepth; struct sbus_dev *sdev; + struct list_head list; }; /* Reset control plane so that WID is 8-bit plane. */ @@ -443,7 +444,7 @@ static void tcx_init_one(struct sbus_dev *sdev) tcx_reset(&all->info); - tcx_blank(FB_BLANK_UNBLANK, &all->info); + tcx_blank(0, &all->info); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { printk(KERN_ERR "tcx: Could not allocate color map.\n"); diff --git a/trunk/drivers/video/vesafb.c b/trunk/drivers/video/vesafb.c index 3e58ddc2bc38..2c3aa2fcfd91 100644 --- a/trunk/drivers/video/vesafb.c +++ b/trunk/drivers/video/vesafb.c @@ -413,7 +413,6 @@ static int __init vesafb_probe(struct platform_device *dev) * region already (FIXME) */ request_region(0x3c0, 32, "vesafb"); -#ifdef CONFIG_MTRR if (mtrr) { unsigned int temp_size = size_total; unsigned int type = 0; @@ -451,7 +450,6 @@ static int __init vesafb_probe(struct platform_device *dev) } while (temp_size >= PAGE_SIZE && rc == -EINVAL); } } -#endif info->fbops = &vesafb_ops; info->var = vesafb_defined; diff --git a/trunk/drivers/video/w100fb.c b/trunk/drivers/video/w100fb.c index f6e24ee85f07..daa46051f55d 100644 --- a/trunk/drivers/video/w100fb.c +++ b/trunk/drivers/video/w100fb.c @@ -514,7 +514,7 @@ int __init w100fb_probe(struct platform_device *pdev) if (remapped_fbuf == NULL) goto out; - info=framebuffer_alloc(sizeof(struct w100fb_par), &pdev->dev); + info=framebuffer_alloc(sizeof(struct w100fb_par), dev); if (!info) { err = -ENOMEM; goto out; diff --git a/trunk/drivers/w1/dscore.c b/trunk/drivers/w1/dscore.c index b9146306df49..15fb250451e5 100644 --- a/trunk/drivers/w1/dscore.c +++ b/trunk/drivers/w1/dscore.c @@ -52,6 +52,7 @@ static int ds_send_control_cmd(struct ds_device *, u16, u16); static struct usb_driver ds_driver = { + .owner = THIS_MODULE, .name = "DS9490R", .probe = ds_probe, .disconnect = ds_disconnect, diff --git a/trunk/fs/9p/trans_sock.c b/trunk/fs/9p/trans_sock.c index 6a9a75d40f73..a93c2bf94c33 100644 --- a/trunk/fs/9p/trans_sock.c +++ b/trunk/fs/9p/trans_sock.c @@ -26,7 +26,6 @@ */ #include -#include #include #include #include diff --git a/trunk/fs/9p/vfs_inode.c b/trunk/fs/9p/vfs_inode.c index 0ea965c3bb7d..be7288184fa9 100644 --- a/trunk/fs/9p/vfs_inode.c +++ b/trunk/fs/9p/vfs_inode.c @@ -427,8 +427,6 @@ v9fs_create(struct inode *dir, v9fs_mistat2inode(fcall->params.rstat.stat, file_inode, sb); kfree(fcall); - fcall = NULL; - file_dentry->d_op = &v9fs_dentry_operations; d_instantiate(file_dentry, file_inode); if (perm & V9FS_DMDIR) { diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index 5a28b69ad223..20bb919eb195 100644 --- a/trunk/fs/aio.c +++ b/trunk/fs/aio.c @@ -457,8 +457,6 @@ static inline struct kiocb *aio_get_req(struct kioctx *ctx) static inline void really_put_req(struct kioctx *ctx, struct kiocb *req) { - assert_spin_locked(&ctx->ctx_lock); - if (req->ki_dtor) req->ki_dtor(req); kmem_cache_free(kiocb_cachep, req); @@ -500,8 +498,6 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req) dprintk(KERN_DEBUG "aio_put(%p): f_count=%d\n", req, atomic_read(&req->ki_filp->f_count)); - assert_spin_locked(&ctx->ctx_lock); - req->ki_users --; if (unlikely(req->ki_users < 0)) BUG(); @@ -623,13 +619,14 @@ static void unuse_mm(struct mm_struct *mm) * the kiocb (to tell the caller to activate the work * queue to process it), or 0, if it found that it was * already queued. + * + * Should be called with the spin lock iocb->ki_ctx->ctx_lock + * held */ static inline int __queue_kicked_iocb(struct kiocb *iocb) { struct kioctx *ctx = iocb->ki_ctx; - assert_spin_locked(&ctx->ctx_lock); - if (list_empty(&iocb->ki_run_list)) { list_add_tail(&iocb->ki_run_list, &ctx->run_list); @@ -774,15 +771,13 @@ static ssize_t aio_run_iocb(struct kiocb *iocb) * Process all pending retries queued on the ioctx * run list. * Assumes it is operating within the aio issuer's mm - * context. + * context. Expects to be called with ctx->ctx_lock held */ static int __aio_run_iocbs(struct kioctx *ctx) { struct kiocb *iocb; LIST_HEAD(run_list); - assert_spin_locked(&ctx->ctx_lock); - list_splice_init(&ctx->run_list, &run_list); while (!list_empty(&run_list)) { iocb = list_entry(run_list.next, struct kiocb, @@ -942,19 +937,28 @@ int fastcall aio_complete(struct kiocb *iocb, long res, long res2) unsigned long tail; int ret; - /* - * Special case handling for sync iocbs: - * - events go directly into the iocb for fast handling - * - the sync task with the iocb in its stack holds the single iocb - * ref, no other paths have a way to get another ref - * - the sync task helpfully left a reference to itself in the iocb + /* Special case handling for sync iocbs: events go directly + * into the iocb for fast handling. Note that this will not + * work if we allow sync kiocbs to be cancelled. in which + * case the usage count checks will have to move under ctx_lock + * for all cases. */ if (is_sync_kiocb(iocb)) { - BUG_ON(iocb->ki_users != 1); + int ret; + iocb->ki_user_data = res; - iocb->ki_users = 0; + if (iocb->ki_users == 1) { + iocb->ki_users = 0; + ret = 1; + } else { + spin_lock_irq(&ctx->ctx_lock); + iocb->ki_users--; + ret = (0 == iocb->ki_users); + spin_unlock_irq(&ctx->ctx_lock); + } + /* sync iocbs put the task here for us */ wake_up_process(iocb->ki_obj.tsk); - return 1; + return ret; } info = &ctx->ring_info; @@ -1609,14 +1613,12 @@ asmlinkage long sys_io_submit(aio_context_t ctx_id, long nr, /* lookup_kiocb * Finds a given iocb for cancellation. + * MUST be called with ctx->ctx_lock held. */ static struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, u32 key) { struct list_head *pos; - - assert_spin_locked(&ctx->ctx_lock); - /* TODO: use a hash or array, this sucks. */ list_for_each(pos, &ctx->active_reqs) { struct kiocb *kiocb = list_kiocb(pos); diff --git a/trunk/fs/bio.c b/trunk/fs/bio.c index 38d3e8023a07..460554b07ff9 100644 --- a/trunk/fs/bio.c +++ b/trunk/fs/bio.c @@ -313,8 +313,7 @@ int bio_get_nr_vecs(struct block_device *bdev) } static int __bio_add_page(request_queue_t *q, struct bio *bio, struct page - *page, unsigned int len, unsigned int offset, - unsigned short max_sectors) + *page, unsigned int len, unsigned int offset) { int retried_segments = 0; struct bio_vec *bvec; @@ -328,7 +327,7 @@ static int __bio_add_page(request_queue_t *q, struct bio *bio, struct page if (bio->bi_vcnt >= bio->bi_max_vecs) return 0; - if (((bio->bi_size + len) >> 9) > max_sectors) + if (((bio->bi_size + len) >> 9) > q->max_sectors) return 0; /* @@ -386,25 +385,6 @@ static int __bio_add_page(request_queue_t *q, struct bio *bio, struct page return len; } -/** - * bio_add_pc_page - attempt to add page to bio - * @bio: destination bio - * @page: page to add - * @len: vec entry length - * @offset: vec entry offset - * - * Attempt to add a page to the bio_vec maplist. This can fail for a - * number of reasons, such as the bio being full or target block - * device limitations. The target block device must allow bio's - * smaller than PAGE_SIZE, so it is always possible to add a single - * page to an empty bio. This should only be used by REQ_PC bios. - */ -int bio_add_pc_page(request_queue_t *q, struct bio *bio, struct page *page, - unsigned int len, unsigned int offset) -{ - return __bio_add_page(q, bio, page, len, offset, q->max_hw_sectors); -} - /** * bio_add_page - attempt to add page to bio * @bio: destination bio @@ -421,8 +401,8 @@ int bio_add_pc_page(request_queue_t *q, struct bio *bio, struct page *page, int bio_add_page(struct bio *bio, struct page *page, unsigned int len, unsigned int offset) { - struct request_queue *q = bdev_get_queue(bio->bi_bdev); - return __bio_add_page(q, bio, page, len, offset, q->max_sectors); + return __bio_add_page(bdev_get_queue(bio->bi_bdev), bio, page, + len, offset); } struct bio_map_data { @@ -534,7 +514,7 @@ struct bio *bio_copy_user(request_queue_t *q, unsigned long uaddr, break; } - if (bio_add_pc_page(q, bio, page, bytes, 0) < bytes) { + if (__bio_add_page(q, bio, page, bytes, 0) < bytes) { ret = -EINVAL; break; } @@ -648,8 +628,7 @@ static struct bio *__bio_map_user_iov(request_queue_t *q, /* * sorry... */ - if (bio_add_pc_page(q, bio, pages[j], bytes, offset) < - bytes) + if (__bio_add_page(q, bio, pages[j], bytes, offset) < bytes) break; len -= bytes; @@ -822,8 +801,8 @@ static struct bio *__bio_map_kern(request_queue_t *q, void *data, if (bytes > len) bytes = len; - if (bio_add_pc_page(q, bio, virt_to_page(data), bytes, - offset) < bytes) + if (__bio_add_page(q, bio, virt_to_page(data), bytes, + offset) < bytes) break; data += bytes; @@ -1249,7 +1228,6 @@ EXPORT_SYMBOL(bio_clone); EXPORT_SYMBOL(bio_phys_segments); EXPORT_SYMBOL(bio_hw_segments); EXPORT_SYMBOL(bio_add_page); -EXPORT_SYMBOL(bio_add_pc_page); EXPORT_SYMBOL(bio_get_nr_vecs); EXPORT_SYMBOL(bio_map_user); EXPORT_SYMBOL(bio_unmap_user); diff --git a/trunk/fs/cifs/CHANGES b/trunk/fs/cifs/CHANGES index 943ef9b82244..eab3750cf304 100644 --- a/trunk/fs/cifs/CHANGES +++ b/trunk/fs/cifs/CHANGES @@ -1,12 +1,8 @@ Version 1.39 ------------ -Defer close of a file handle slightly if pending writes depend on that handle +Defer close of a file handle slightly if pending writes depend on that file handle (this reduces the EBADF bad file handle errors that can be logged under heavy stress on writes). Modify cifs Kconfig options to expose CONFIG_CIFS_STATS2 -Fix SFU style symlinks and mknod needed for servers which do not support the -CIFS Unix Extensions. Fix setfacl/getfacl on bigendian. Timeout negative -dentries so files that the client sees as deleted but that later get created -on the server will be recognized. Add client side permission check on setattr. Version 1.38 ------------ diff --git a/trunk/fs/cifs/README b/trunk/fs/cifs/README index e5d09a2fc7a5..bb90941826ad 100644 --- a/trunk/fs/cifs/README +++ b/trunk/fs/cifs/README @@ -278,9 +278,7 @@ A partial list of the supported mount options follows: (such as Windows), permissions can also be checked at the client, and a crude form of client side permission checking can be enabled by specifying file_mode and dir_mode on - the client. Note that the mount.cifs helper must be - at version 1.10 or higher to support specifying the uid - (or gid) in non-numberic form. + the client gid If CIFS Unix extensions are not supported by the server this overrides the default gid for inodes. file_mode If CIFS Unix extensions are not supported by the server @@ -347,10 +345,7 @@ A partial list of the supported mount options follows: client system. It is typically only needed when the server supports the CIFS Unix Extensions but the UIDs/GIDs on the client and server system do not match closely enough to allow - access by the user doing the mount, but it may be useful with - non CIFS Unix Extension mounts for cases in which the default - mode is specified on the mount but is not to be enforced on the - client (e.g. perhaps when MultiUserMount is enabled) + access by the user doing the mount. Note that this does not affect the normal ACL check on the target machine done by the server software (of the server ACL against the user name provided at mount time). @@ -373,21 +368,15 @@ A partial list of the supported mount options follows: setuids If the CIFS Unix extensions are negotiated with the server the client will attempt to set the effective uid and gid of the local process on newly created files, directories, and - devices (create, mkdir, mknod). If the CIFS Unix Extensions - are not negotiated, for newly created files and directories - instead of using the default uid and gid specified on the - the mount, cache the new file's uid and gid locally which means - that the uid for the file can change when the inode is - reloaded (or the user remounts the share). + devices (create, mkdir, mknod). nosetuids The client will not attempt to set the uid and gid on on newly created files, directories, and devices (create, mkdir, mknod) which will result in the server setting the uid and gid to the default (usually the server uid of the user who mounted the share). Letting the server (rather than - the client) set the uid and gid is the default. If the CIFS - Unix Extensions are not negotiated then the uid and gid for - new files will appear to be the uid (gid) of the mounter or the - uid (gid) parameter specified on the mount. + the client) set the uid and gid is the default. This + parameter has no effect if the CIFS Unix Extensions are not + negotiated. netbiosname When mounting to servers via port 139, specifies the RFC1001 source name to use to represent the client netbios machine name when doing the RFC1001 netbios session initialize. @@ -429,13 +418,6 @@ A partial list of the supported mount options follows: byte range locks). remount remount the share (often used to change from ro to rw mounts or vice versa) - sfu When the CIFS Unix Extensions are not negotiated, attempt to - create device files and fifos in a format compatible with - Services for Unix (SFU). In addition retrieve bits 10-12 - of the mode via the SETFILEBITS extended attribute (as - SFU does). In the future the bottom 9 bits of the mode - mode also will be emulated using queries of the security - descriptor (ACL). The mount.cifs mount helper also accepts a few mount options before -o including: diff --git a/trunk/fs/cifs/TODO b/trunk/fs/cifs/TODO index fc34c74ec4be..c909298d11ed 100644 --- a/trunk/fs/cifs/TODO +++ b/trunk/fs/cifs/TODO @@ -1,4 +1,4 @@ -Version 1.39 November 30, 2005 +version 1.37 October 9, 2005 A Partial List of Missing Features ================================== @@ -58,7 +58,7 @@ o) Improve performance of readpages by sending more than one read at a time when 8 pages or more are requested. In conjuntion add support for async_cifs_readpages. -p) Add support for storing symlink info to Windows servers +p) Add support for storing symlink and fifo info to Windows servers in the Extended Attribute format their SFU clients would recognize. q) Finish fcntl D_NOTIFY support so kde and gnome file list windows diff --git a/trunk/fs/cifs/cifs_unicode.c b/trunk/fs/cifs/cifs_unicode.c index d2b128255944..4e12053f0806 100644 --- a/trunk/fs/cifs/cifs_unicode.c +++ b/trunk/fs/cifs/cifs_unicode.c @@ -1,7 +1,7 @@ /* * fs/cifs/cifs_unicode.c * - * Copyright (c) International Business Machines Corp., 2000,2005 + * Copyright (c) International Business Machines Corp., 2000,2002 * Modified by Steve French (sfrench@us.ibm.com) * * This program is free software; you can redistribute it and/or modify @@ -31,7 +31,7 @@ * */ int -cifs_strfromUCS_le(char *to, const __le16 * from, +cifs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */ int len, const struct nls_table *codepage) { int i; @@ -60,26 +60,25 @@ cifs_strfromUCS_le(char *to, const __le16 * from, * */ int -cifs_strtoUCS(__le16 * to, const char *from, int len, +cifs_strtoUCS(wchar_t * to, const char *from, int len, const struct nls_table *codepage) { int charlen; int i; - wchar_t * wchar_to = (wchar_t *)to; /* needed to quiet sparse */ for (i = 0; len && *from; i++, from += charlen, len -= charlen) { /* works for 2.4.0 kernel or later */ - charlen = codepage->char2uni(from, len, &wchar_to[i]); + charlen = codepage->char2uni(from, len, &to[i]); if (charlen < 1) { cERROR(1, ("cifs_strtoUCS: char2uni returned %d", charlen)); /* A question mark */ - to[i] = cpu_to_le16(0x003f); + to[i] = (wchar_t)cpu_to_le16(0x003f); charlen = 1; } else - to[i] = cpu_to_le16(wchar_to[i]); + to[i] = (wchar_t)cpu_to_le16(to[i]); } diff --git a/trunk/fs/cifs/cifs_unicode.h b/trunk/fs/cifs/cifs_unicode.h index 39e5b970325f..da8dde965275 100644 --- a/trunk/fs/cifs/cifs_unicode.h +++ b/trunk/fs/cifs/cifs_unicode.h @@ -5,7 +5,7 @@ * Convert a unicode character to upper or lower case using * compressed tables. * - * Copyright (c) International Business Machines Corp., 2000,2005555555555555555555555555555555555555555555555555555555 + * Copyright (c) International Business Machines Corp., 2000,2002 * * 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 @@ -59,8 +59,8 @@ extern struct UniCaseRange UniLowerRange[]; #endif /* UNIUPR_NOLOWER */ #ifdef __KERNEL__ -int cifs_strfromUCS_le(char *, const __le16 *, int, const struct nls_table *); -int cifs_strtoUCS(__le16 *, const char *, int, const struct nls_table *); +int cifs_strfromUCS_le(char *, const wchar_t *, int, const struct nls_table *); +int cifs_strtoUCS(wchar_t *, const char *, int, const struct nls_table *); #endif /* diff --git a/trunk/fs/cifs/cifsencrypt.c b/trunk/fs/cifs/cifsencrypt.c index fe2bb7c4c912..1959c7c4b185 100644 --- a/trunk/fs/cifs/cifsencrypt.c +++ b/trunk/fs/cifs/cifsencrypt.c @@ -149,7 +149,7 @@ int CalcNTLMv2_partial_mac_key(struct cifsSesInfo * ses, struct nls_table * nls_ char temp_hash[16]; struct HMACMD5Context ctx; char * ucase_buf; - __le16 * unicode_buf; + wchar_t * unicode_buf; unsigned int i,user_name_len,dom_name_len; if(ses == NULL) diff --git a/trunk/fs/cifs/cifsfs.c b/trunk/fs/cifs/cifsfs.c index 2a13a2bac8f1..682b0235ad9a 100644 --- a/trunk/fs/cifs/cifsfs.c +++ b/trunk/fs/cifs/cifsfs.c @@ -32,7 +32,6 @@ #include #include #include -#include #include "cifsfs.h" #include "cifspdu.h" #define DECLARE_GLOBALS_HERE @@ -430,11 +429,6 @@ static void cifs_umount_begin(struct super_block * sblock) { cFYI(1,("wake up tasks now - umount begin not complete")); wake_up_all(&tcon->ses->server->request_q); - wake_up_all(&tcon->ses->server->response_q); - msleep(1); /* yield */ - /* we have to kick the requests once more */ - wake_up_all(&tcon->ses->server->response_q); - msleep(1); } /* BB FIXME - finish add checks for tidStatus BB */ @@ -489,30 +483,57 @@ cifs_get_sb(struct file_system_type *fs_type, return sb; } -static ssize_t cifs_file_writev(struct file *file, const struct iovec *iov, - unsigned long nr_segs, loff_t *ppos) +static ssize_t +cifs_read_wrapper(struct file * file, char __user *read_data, size_t read_size, + loff_t * poffset) { - struct inode *inode = file->f_dentry->d_inode; - ssize_t written; + if(file->f_dentry == NULL) + return -EIO; + else if(file->f_dentry->d_inode == NULL) + return -EIO; - written = generic_file_writev(file, iov, nr_segs, ppos); - if (!CIFS_I(inode)->clientCanCacheAll) - filemap_fdatawrite(inode->i_mapping); - return written; + cFYI(1,("In read_wrapper size %zd at %lld",read_size,*poffset)); + + if(CIFS_I(file->f_dentry->d_inode)->clientCanCacheRead) { + return generic_file_read(file,read_data,read_size,poffset); + } else { + /* BB do we need to lock inode from here until after invalidate? */ +/* if(file->f_dentry->d_inode->i_mapping) { + filemap_fdatawrite(file->f_dentry->d_inode->i_mapping); + filemap_fdatawait(file->f_dentry->d_inode->i_mapping); + }*/ +/* cifs_revalidate(file->f_dentry);*/ /* BB fixme */ + + /* BB we should make timer configurable - perhaps + by simply calling cifs_revalidate here */ + /* invalidate_remote_inode(file->f_dentry->d_inode);*/ + return generic_file_read(file,read_data,read_size,poffset); + } } -static ssize_t cifs_file_aio_write(struct kiocb *iocb, const char __user *buf, - size_t count, loff_t pos) +static ssize_t +cifs_write_wrapper(struct file * file, const char __user *write_data, + size_t write_size, loff_t * poffset) { - struct inode *inode = iocb->ki_filp->f_dentry->d_inode; ssize_t written; - written = generic_file_aio_write(iocb, buf, count, pos); - if (!CIFS_I(inode)->clientCanCacheAll) - filemap_fdatawrite(inode->i_mapping); + if(file->f_dentry == NULL) + return -EIO; + else if(file->f_dentry->d_inode == NULL) + return -EIO; + + cFYI(1,("In write_wrapper size %zd at %lld",write_size,*poffset)); + + written = generic_file_write(file,write_data,write_size,poffset); + if(!CIFS_I(file->f_dentry->d_inode)->clientCanCacheAll) { + if(file->f_dentry->d_inode->i_mapping) { + filemap_fdatawrite(file->f_dentry->d_inode->i_mapping); + } + } return written; } + static struct file_system_type cifs_fs_type = { .owner = THIS_MODULE, .name = "cifs", @@ -573,12 +594,8 @@ struct inode_operations cifs_symlink_inode_ops = { }; struct file_operations cifs_file_ops = { - .read = do_sync_read, - .write = do_sync_write, - .readv = generic_file_readv, - .writev = cifs_file_writev, - .aio_read = generic_file_aio_read, - .aio_write = cifs_file_aio_write, + .read = cifs_read_wrapper, + .write = cifs_write_wrapper, .open = cifs_open, .release = cifs_close, .lock = cifs_lock, @@ -591,58 +608,22 @@ struct file_operations cifs_file_ops = { #endif /* CONFIG_CIFS_POSIX */ #ifdef CONFIG_CIFS_EXPERIMENTAL - .dir_notify = cifs_dir_notify, -#endif /* CONFIG_CIFS_EXPERIMENTAL */ -}; - -struct file_operations cifs_file_direct_ops = { - /* no mmap, no aio, no readv - - BB reevaluate whether they can be done with directio, no cache */ - .read = cifs_user_read, - .write = cifs_user_write, - .open = cifs_open, - .release = cifs_close, - .lock = cifs_lock, - .fsync = cifs_fsync, - .flush = cifs_flush, - .sendfile = generic_file_sendfile, /* BB removeme BB */ -#ifdef CONFIG_CIFS_POSIX - .ioctl = cifs_ioctl, -#endif /* CONFIG_CIFS_POSIX */ - -#ifdef CONFIG_CIFS_EXPERIMENTAL - .dir_notify = cifs_dir_notify, -#endif /* CONFIG_CIFS_EXPERIMENTAL */ -}; -struct file_operations cifs_file_nobrl_ops = { - .read = do_sync_read, - .write = do_sync_write, .readv = generic_file_readv, - .writev = cifs_file_writev, + .writev = generic_file_writev, .aio_read = generic_file_aio_read, - .aio_write = cifs_file_aio_write, - .open = cifs_open, - .release = cifs_close, - .fsync = cifs_fsync, - .flush = cifs_flush, - .mmap = cifs_file_mmap, - .sendfile = generic_file_sendfile, -#ifdef CONFIG_CIFS_POSIX - .ioctl = cifs_ioctl, -#endif /* CONFIG_CIFS_POSIX */ - -#ifdef CONFIG_CIFS_EXPERIMENTAL + .aio_write = generic_file_aio_write, .dir_notify = cifs_dir_notify, #endif /* CONFIG_CIFS_EXPERIMENTAL */ }; -struct file_operations cifs_file_direct_nobrl_ops = { +struct file_operations cifs_file_direct_ops = { /* no mmap, no aio, no readv - BB reevaluate whether they can be done with directio, no cache */ .read = cifs_user_read, .write = cifs_user_write, .open = cifs_open, .release = cifs_close, + .lock = cifs_lock, .fsync = cifs_fsync, .flush = cifs_flush, .sendfile = generic_file_sendfile, /* BB removeme BB */ @@ -901,9 +882,6 @@ static int cifs_oplock_thread(void * dummyarg) static int cifs_dnotify_thread(void * dummyarg) { - struct list_head *tmp; - struct cifsSesInfo *ses; - daemonize("cifsdnotifyd"); allow_signal(SIGTERM); @@ -912,19 +890,7 @@ static int cifs_dnotify_thread(void * dummyarg) if(try_to_freeze()) continue; set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(15*HZ); - read_lock(&GlobalSMBSeslock); - /* check if any stuck requests that need - to be woken up and wakeq so the - thread can wake up and error out */ - list_for_each(tmp, &GlobalSMBSessionList) { - ses = list_entry(tmp, struct cifsSesInfo, - cifsSessionList); - if(ses && ses->server && - atomic_read(&ses->server->inFlight)) - wake_up_all(&ses->server->response_q); - } - read_unlock(&GlobalSMBSeslock); + schedule_timeout(39*HZ); } while(!signal_pending(current)); complete_and_exit (&cifs_dnotify_exited, 0); } diff --git a/trunk/fs/cifs/cifsfs.h b/trunk/fs/cifs/cifsfs.h index 9ec40e0e54fc..1223fa81dbd2 100644 --- a/trunk/fs/cifs/cifsfs.h +++ b/trunk/fs/cifs/cifsfs.h @@ -63,8 +63,6 @@ extern struct inode_operations cifs_symlink_inode_ops; /* Functions related to files and directories */ extern struct file_operations cifs_file_ops; extern struct file_operations cifs_file_direct_ops; /* if directio mount */ -extern struct file_operations cifs_file_nobrl_ops; -extern struct file_operations cifs_file_direct_nobrl_ops; /* if directio mount */ extern int cifs_open(struct inode *inode, struct file *file); extern int cifs_close(struct inode *inode, struct file *file); extern int cifs_closedir(struct inode *inode, struct file *file); diff --git a/trunk/fs/cifs/cifspdu.h b/trunk/fs/cifs/cifspdu.h index 33e1859fd2f6..48a05b9df7eb 100644 --- a/trunk/fs/cifs/cifspdu.h +++ b/trunk/fs/cifs/cifspdu.h @@ -603,9 +603,7 @@ typedef struct smb_com_logoff_andx_rsp { __u16 ByteCount; } __attribute__((packed)) LOGOFF_ANDX_RSP; -typedef union smb_com_tree_disconnect { /* as an altetnative can use flag on - tree_connect PDU to effect disconnect */ - /* tdis is probably simplest SMB PDU */ +typedef union smb_com_tree_disconnect { /* as an altetnative can use flag on tree_connect PDU to effect disconnect *//* probably the simplest SMB PDU */ struct { struct smb_hdr hdr; /* wct = 0 */ __u16 ByteCount; /* bcc = 0 */ @@ -2027,12 +2025,6 @@ typedef struct { } __attribute__((packed)) FILE_BOTH_DIRECTORY_INFO; /* level 0x104 FF response data area */ -struct win_dev { - unsigned char type[8]; /* IntxCHR or IntxBLK */ - __le64 major; - __le64 minor; -} __attribute__((packed)); - struct gea { unsigned char name_len; char name[1]; diff --git a/trunk/fs/cifs/cifssmb.c b/trunk/fs/cifs/cifssmb.c index 6867e556d37e..a53c596e1082 100644 --- a/trunk/fs/cifs/cifssmb.c +++ b/trunk/fs/cifs/cifssmb.c @@ -90,18 +90,6 @@ small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, check for tcp and smb session status done differently for those three - in the calling routine */ if(tcon) { - if(tcon->tidStatus == CifsExiting) { - /* only tree disconnect, open, and write, - (and ulogoff which does not have tcon) - are allowed as we start force umount */ - if((smb_command != SMB_COM_WRITE_ANDX) && - (smb_command != SMB_COM_OPEN_ANDX) && - (smb_command != SMB_COM_TREE_DISCONNECT)) { - cFYI(1,("can not send cmd %d while umounting", - smb_command)); - return -ENODEV; - } - } if((tcon->ses) && (tcon->ses->status != CifsExiting) && (tcon->ses->server)){ struct nls_table *nls_codepage; @@ -199,19 +187,6 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, check for tcp and smb session status done differently for those three - in the calling routine */ if(tcon) { - if(tcon->tidStatus == CifsExiting) { - /* only tree disconnect, open, and write, - (and ulogoff which does not have tcon) - are allowed as we start force umount */ - if((smb_command != SMB_COM_WRITE_ANDX) && - (smb_command != SMB_COM_OPEN_ANDX) && - (smb_command != SMB_COM_TREE_DISCONNECT)) { - cFYI(1,("can not send cmd %d while umounting", - smb_command)); - return -ENODEV; - } - } - if((tcon->ses) && (tcon->ses->status != CifsExiting) && (tcon->ses->server)){ struct nls_table *nls_codepage; @@ -1167,9 +1142,7 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon, int bytes_returned, wct; int smb_hdr_len; - /* BB removeme BB */ - cFYI(1,("write2 at %lld %d bytes", (long long)offset, count)); - + cFYI(1,("write2 at %lld %d bytes",offset,count)); /* BB removeme BB */ if(tcon->ses->capabilities & CAP_LARGE_FILES) wct = 14; else @@ -1580,7 +1553,7 @@ CIFSUnixCreateSymLink(const int xid, struct cifsTconInfo *tcon, if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { name_len = - cifs_strtoUCS((__le16 *) pSMB->FileName, fromName, PATH_MAX + cifs_strtoUCS((wchar_t *) pSMB->FileName, fromName, PATH_MAX /* find define for this maxpathcomponent */ , nls_codepage); name_len++; /* trailing null */ @@ -1604,7 +1577,7 @@ CIFSUnixCreateSymLink(const int xid, struct cifsTconInfo *tcon, data_offset = (char *) (&pSMB->hdr.Protocol) + offset; if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { name_len_target = - cifs_strtoUCS((__le16 *) data_offset, toName, PATH_MAX + cifs_strtoUCS((wchar_t *) data_offset, toName, PATH_MAX /* find define for this maxpathcomponent */ , nls_codepage); name_len_target++; /* trailing null */ @@ -1830,7 +1803,7 @@ CIFSSMBUnixQuerySymLink(const int xid, struct cifsTconInfo *tcon, if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { name_len = - cifs_strtoUCS((__le16 *) pSMB->FileName, searchName, PATH_MAX + cifs_strtoUCS((wchar_t *) pSMB->FileName, searchName, PATH_MAX /* find define for this maxpathcomponent */ , nls_codepage); name_len++; /* trailing null */ @@ -1887,7 +1860,7 @@ CIFSSMBUnixQuerySymLink(const int xid, struct cifsTconInfo *tcon, min_t(const int, buflen,count) / 2); /* BB FIXME investigate remapping reserved chars here */ cifs_strfromUCS_le(symlinkinfo, - (__le16 *) ((char *)&pSMBr->hdr.Protocol + + (wchar_t *) ((char *)&pSMBr->hdr.Protocol + data_offset), name_len, nls_codepage); } else { @@ -1978,7 +1951,7 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon, reparse_buf->TargetNameOffset), min(buflen/2, reparse_buf->TargetNameLen / 2)); cifs_strfromUCS_le(symlinkinfo, - (__le16 *) (reparse_buf->LinkNamesBuf + + (wchar_t *) (reparse_buf->LinkNamesBuf + reparse_buf->TargetNameOffset), name_len, nls_codepage); } else { /* ASCII names */ @@ -2010,9 +1983,9 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon, static void cifs_convert_ace(posix_acl_xattr_entry * ace, struct cifs_posix_ace * cifs_ace) { /* u8 cifs fields do not need le conversion */ - ace->e_perm = cpu_to_le16(cifs_ace->cifs_e_perm); - ace->e_tag = cpu_to_le16(cifs_ace->cifs_e_tag); - ace->e_id = cpu_to_le32(le64_to_cpu(cifs_ace->cifs_uid)); + ace->e_perm = (__u16)cifs_ace->cifs_e_perm; + ace->e_tag = (__u16)cifs_ace->cifs_e_tag; + ace->e_id = (__u32)le64_to_cpu(cifs_ace->cifs_uid); /* cFYI(1,("perm %d tag %d id %d",ace->e_perm,ace->e_tag,ace->e_id)); */ return; @@ -2064,7 +2037,7 @@ static int cifs_copy_posix_acl(char * trgt,char * src, const int buflen, } else if(size > buflen) { return -ERANGE; } else /* buffer big enough */ { - local_acl->a_version = cpu_to_le32(POSIX_ACL_XATTR_VERSION); + local_acl->a_version = POSIX_ACL_XATTR_VERSION; for(i = 0;i < count ;i++) { cifs_convert_ace(&local_acl->a_entries[i],pACE); pACE ++; @@ -2078,14 +2051,14 @@ static __u16 convert_ace_to_cifs_ace(struct cifs_posix_ace * cifs_ace, { __u16 rc = 0; /* 0 = ACL converted ok */ - cifs_ace->cifs_e_perm = le16_to_cpu(local_ace->e_perm); - cifs_ace->cifs_e_tag = le16_to_cpu(local_ace->e_tag); + cifs_ace->cifs_e_perm = (__u8)cpu_to_le16(local_ace->e_perm); + cifs_ace->cifs_e_tag = (__u8)cpu_to_le16(local_ace->e_tag); /* BB is there a better way to handle the large uid? */ - if(local_ace->e_id == cpu_to_le32(-1)) { + if(local_ace->e_id == -1) { /* Probably no need to le convert -1 on any arch but can not hurt */ cifs_ace->cifs_uid = cpu_to_le64(-1); } else - cifs_ace->cifs_uid = cpu_to_le64(le32_to_cpu(local_ace->e_id)); + cifs_ace->cifs_uid = (__u64)cpu_to_le32(local_ace->e_id); /*cFYI(1,("perm %d tag %d id %d",ace->e_perm,ace->e_tag,ace->e_id));*/ return rc; } @@ -2105,17 +2078,16 @@ static __u16 ACL_to_cifs_posix(char * parm_data,const char * pACL,const int bufl count = posix_acl_xattr_count((size_t)buflen); cFYI(1,("setting acl with %d entries from buf of length %d and version of %d", - count, buflen, le32_to_cpu(local_acl->a_version))); - if(le32_to_cpu(local_acl->a_version) != 2) { - cFYI(1,("unknown POSIX ACL version %d", - le32_to_cpu(local_acl->a_version))); + count,buflen,local_acl->a_version)); + if(local_acl->a_version != 2) { + cFYI(1,("unknown POSIX ACL version %d",local_acl->a_version)); return 0; } cifs_acl->version = cpu_to_le16(1); if(acl_type == ACL_TYPE_ACCESS) - cifs_acl->access_entry_count = cpu_to_le16(count); + cifs_acl->access_entry_count = count; else if(acl_type == ACL_TYPE_DEFAULT) - cifs_acl->default_entry_count = cpu_to_le16(count); + cifs_acl->default_entry_count = count; else { cFYI(1,("unknown ACL type %d",acl_type)); return 0; @@ -3231,7 +3203,7 @@ CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses, temp = ((char *)referrals) + le16_to_cpu(referrals->DfsPathOffset); if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) { cifs_strfromUCS_le(*targetUNCs, - (__le16 *) temp, name_len, nls_codepage); + (wchar_t *) temp, name_len, nls_codepage); } else { strncpy(*targetUNCs,temp,name_len); } diff --git a/trunk/fs/cifs/connect.c b/trunk/fs/cifs/connect.c index c467de857610..2cb620716bc1 100644 --- a/trunk/fs/cifs/connect.c +++ b/trunk/fs/cifs/connect.c @@ -1986,32 +1986,32 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, bytes_returned = 0; /* skill null user */ else bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, user, 100, + cifs_strtoUCS((wchar_t *) bcc_ptr, user, 100, nls_codepage); /* convert number of 16 bit words to bytes */ bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; /* trailing null */ if (domain == NULL) bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, + cifs_strtoUCS((wchar_t *) bcc_ptr, "CIFS_LINUX_DOM", 32, nls_codepage); else bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, domain, 64, + cifs_strtoUCS((wchar_t *) bcc_ptr, domain, 64, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, "Linux version ", + cifs_strtoUCS((wchar_t *) bcc_ptr, "Linux version ", 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, system_utsname.release, + cifs_strtoUCS((wchar_t *) bcc_ptr, system_utsname.release, 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, CIFS_NETWORK_OPSYS, + cifs_strtoUCS((wchar_t *) bcc_ptr, CIFS_NETWORK_OPSYS, 64, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; @@ -2081,7 +2081,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, if(ses->serverOS == NULL) goto sesssetup_nomem; cifs_strfromUCS_le(ses->serverOS, - (__le16 *)bcc_ptr, len,nls_codepage); + (wchar_t *)bcc_ptr, len,nls_codepage); bcc_ptr += 2 * (len + 1); remaining_words -= len + 1; ses->serverOS[2 * len] = 0; @@ -2093,7 +2093,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, if(ses->serverNOS == NULL) goto sesssetup_nomem; cifs_strfromUCS_le(ses->serverNOS, - (__le16 *)bcc_ptr,len,nls_codepage); + (wchar_t *)bcc_ptr,len,nls_codepage); bcc_ptr += 2 * (len + 1); ses->serverNOS[2 * len] = 0; ses->serverNOS[1 + (2 * len)] = 0; @@ -2111,7 +2111,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, if(ses->serverDomain == NULL) goto sesssetup_nomem; cifs_strfromUCS_le(ses->serverDomain, - (__le16 *)bcc_ptr,len,nls_codepage); + (wchar_t *)bcc_ptr,len,nls_codepage); bcc_ptr += 2 * (len + 1); ses->serverDomain[2*len] = 0; ses->serverDomain[1+(2*len)] = 0; @@ -2255,30 +2255,30 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, bcc_ptr++; } bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, user, 100, nls_codepage); + cifs_strtoUCS((wchar_t *) bcc_ptr, user, 100, nls_codepage); bcc_ptr += 2 * bytes_returned; /* convert num of 16 bit words to bytes */ bcc_ptr += 2; /* trailing null */ if (domain == NULL) bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, + cifs_strtoUCS((wchar_t *) bcc_ptr, "CIFS_LINUX_DOM", 32, nls_codepage); else bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, domain, 64, + cifs_strtoUCS((wchar_t *) bcc_ptr, domain, 64, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, "Linux version ", + cifs_strtoUCS((wchar_t *) bcc_ptr, "Linux version ", 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, system_utsname.release, 32, + cifs_strtoUCS((wchar_t *) bcc_ptr, system_utsname.release, 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, CIFS_NETWORK_OPSYS, + cifs_strtoUCS((wchar_t *) bcc_ptr, CIFS_NETWORK_OPSYS, 64, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; @@ -2357,7 +2357,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); cifs_strfromUCS_le(ses->serverOS, - (__le16 *) + (wchar_t *) bcc_ptr, len, nls_codepage); bcc_ptr += 2 * (len + 1); @@ -2372,7 +2372,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, kzalloc(2 * (len + 1), GFP_KERNEL); cifs_strfromUCS_le(ses->serverNOS, - (__le16 *)bcc_ptr, + (wchar_t *)bcc_ptr, len, nls_codepage); bcc_ptr += 2 * (len + 1); @@ -2384,8 +2384,9 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ ses->serverDomain = kzalloc(2*(len+1),GFP_KERNEL); cifs_strfromUCS_le(ses->serverDomain, - (__le16 *)bcc_ptr, - len, nls_codepage); + (wchar_t *)bcc_ptr, + len, + nls_codepage); bcc_ptr += 2*(len+1); ses->serverDomain[2*len] = 0; ses->serverDomain[1+(2*len)] = 0; @@ -2559,16 +2560,16 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, } bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, "Linux version ", + cifs_strtoUCS((wchar_t *) bcc_ptr, "Linux version ", 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, system_utsname.release, 32, + cifs_strtoUCS((wchar_t *) bcc_ptr, system_utsname.release, 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; /* null terminate Linux version */ bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, CIFS_NETWORK_OPSYS, + cifs_strtoUCS((wchar_t *) bcc_ptr, CIFS_NETWORK_OPSYS, 64, nls_codepage); bcc_ptr += 2 * bytes_returned; *(bcc_ptr + 1) = 0; @@ -2672,7 +2673,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); cifs_strfromUCS_le(ses->serverOS, - (__le16 *) + (wchar_t *) bcc_ptr, len, nls_codepage); bcc_ptr += 2 * (len + 1); @@ -2689,7 +2690,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, GFP_KERNEL); cifs_strfromUCS_le(ses-> serverNOS, - (__le16 *) + (wchar_t *) bcc_ptr, len, nls_codepage); @@ -2707,15 +2708,23 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, 1), GFP_KERNEL); cifs_strfromUCS_le - (ses->serverDomain, - (__le16 *)bcc_ptr, - len, nls_codepage); + (ses-> + serverDomain, + (wchar_t *) + bcc_ptr, len, + nls_codepage); bcc_ptr += 2 * (len + 1); - ses->serverDomain[2*len] + ses-> + serverDomain[2 + * len] = 0; - ses->serverDomain - [1 + (2 * len)] + ses-> + serverDomain[1 + + + (2 + * + len)] = 0; } /* else no more room so create dummy domain string */ else @@ -2894,7 +2903,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, SecurityBlob->DomainName.MaximumLength = 0; } else { __u16 len = - cifs_strtoUCS((__le16 *) bcc_ptr, domain, 64, + cifs_strtoUCS((wchar_t *) bcc_ptr, domain, 64, nls_codepage); len *= 2; SecurityBlob->DomainName.MaximumLength = @@ -2912,7 +2921,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, SecurityBlob->UserName.MaximumLength = 0; } else { __u16 len = - cifs_strtoUCS((__le16 *) bcc_ptr, user, 64, + cifs_strtoUCS((wchar_t *) bcc_ptr, user, 64, nls_codepage); len *= 2; SecurityBlob->UserName.MaximumLength = @@ -2925,7 +2934,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, cpu_to_le16(len); } - /* SecurityBlob->WorkstationName.Length = cifs_strtoUCS((__le16 *) bcc_ptr, "AMACHINE",64, nls_codepage); + /* SecurityBlob->WorkstationName.Length = cifs_strtoUCS((wchar_t *) bcc_ptr, "AMACHINE",64, nls_codepage); SecurityBlob->WorkstationName.Length *= 2; SecurityBlob->WorkstationName.MaximumLength = cpu_to_le16(SecurityBlob->WorkstationName.Length); SecurityBlob->WorkstationName.Buffer = cpu_to_le32(SecurityBlobLength); @@ -2938,16 +2947,16 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, bcc_ptr++; } bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, "Linux version ", + cifs_strtoUCS((wchar_t *) bcc_ptr, "Linux version ", 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, system_utsname.release, 32, + cifs_strtoUCS((wchar_t *) bcc_ptr, system_utsname.release, 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; /* null term version string */ bytes_returned = - cifs_strtoUCS((__le16 *) bcc_ptr, CIFS_NETWORK_OPSYS, + cifs_strtoUCS((wchar_t *) bcc_ptr, CIFS_NETWORK_OPSYS, 64, nls_codepage); bcc_ptr += 2 * bytes_returned; *(bcc_ptr + 1) = 0; @@ -3060,7 +3069,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); cifs_strfromUCS_le(ses->serverOS, - (__le16 *) + (wchar_t *) bcc_ptr, len, nls_codepage); bcc_ptr += 2 * (len + 1); @@ -3077,7 +3086,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, GFP_KERNEL); cifs_strfromUCS_le(ses-> serverNOS, - (__le16 *) + (wchar_t *) bcc_ptr, len, nls_codepage); @@ -3096,7 +3105,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, cifs_strfromUCS_le (ses-> serverDomain, - (__le16 *) + (wchar_t *) bcc_ptr, len, nls_codepage); bcc_ptr += @@ -3218,7 +3227,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, if (ses->capabilities & CAP_UNICODE) { smb_buffer->Flags2 |= SMBFLG2_UNICODE; length = - cifs_strtoUCS((__le16 *) bcc_ptr, tree, 100, nls_codepage); + cifs_strtoUCS((wchar_t *) bcc_ptr, tree, 100, nls_codepage); bcc_ptr += 2 * length; /* convert num of 16 bit words to bytes */ bcc_ptr += 2; /* skip trailing null */ } else { /* ASCII */ @@ -3254,7 +3263,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, tcon->nativeFileSystem = kzalloc(length + 2, GFP_KERNEL); cifs_strfromUCS_le(tcon->nativeFileSystem, - (__le16 *) bcc_ptr, + (wchar_t *) bcc_ptr, length, nls_codepage); bcc_ptr += 2 * length; bcc_ptr[0] = 0; /* null terminate the string */ diff --git a/trunk/fs/cifs/dir.c b/trunk/fs/cifs/dir.c index 32cc96cafa3e..8dfe717a332a 100644 --- a/trunk/fs/cifs/dir.c +++ b/trunk/fs/cifs/dir.c @@ -228,15 +228,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, else { rc = cifs_get_inode_info(&newinode, full_path, buf, inode->i_sb,xid); - if(newinode) { + if(newinode) newinode->i_mode = mode; - if((oplock & CIFS_CREATE_ACTION) && - (cifs_sb->mnt_cifs_flags & - CIFS_MOUNT_SET_UID)) { - newinode->i_uid = current->fsuid; - newinode->i_gid = current->fsgid; - } - } } if (rc != 0) { @@ -299,8 +292,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, return rc; } -int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, - dev_t device_number) +int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t device_number) { int rc = -EPERM; int xid; @@ -376,34 +368,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, if(!rc) { /* BB Do not bother to decode buf since no - local inode yet to put timestamps in, - but we can reuse it safely */ - int bytes_written; - struct win_dev *pdev; - pdev = (struct win_dev *)buf; - if(S_ISCHR(mode)) { - memcpy(pdev->type, "IntxCHR", 8); - pdev->major = - cpu_to_le64(MAJOR(device_number)); - pdev->minor = - cpu_to_le64(MINOR(device_number)); - rc = CIFSSMBWrite(xid, pTcon, - fileHandle, - sizeof(struct win_dev), - 0, &bytes_written, (char *)pdev, - NULL, 0); - } else if(S_ISBLK(mode)) { - memcpy(pdev->type, "IntxBLK", 8); - pdev->major = - cpu_to_le64(MAJOR(device_number)); - pdev->minor = - cpu_to_le64(MINOR(device_number)); - rc = CIFSSMBWrite(xid, pTcon, - fileHandle, - sizeof(struct win_dev), - 0, &bytes_written, (char *)pdev, - NULL, 0); - } /* else if(S_ISFIFO */ + local inode yet to put timestamps in */ CIFSSMBClose(xid, pTcon, fileHandle); d_drop(direntry); } @@ -472,20 +437,12 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name direntry->d_op = &cifs_dentry_ops; d_add(direntry, newInode); - /* since paths are not looked up by component - the parent - directories are presumed to be good here */ + /* since paths are not looked up by component - the parent directories are presumed to be good here */ renew_parental_timestamps(direntry); } else if (rc == -ENOENT) { rc = 0; - direntry->d_time = jiffies; - if (pTcon->nocase) - direntry->d_op = &cifs_ci_dentry_ops; - else - direntry->d_op = &cifs_dentry_ops; d_add(direntry, NULL); - /* if it was once a directory (but how can we tell?) we could do - shrink_dcache_parent(direntry); */ } else { cERROR(1,("Error 0x%x on cifs_get_inode_info in lookup of %s", rc,full_path)); @@ -504,20 +461,21 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) { int isValid = 1; +/* lock_kernel(); *//* surely we do not want to lock the kernel for a whole network round trip which could take seconds */ + if (direntry->d_inode) { if (cifs_revalidate(direntry)) { + /* unlock_kernel(); */ return 0; } } else { - cFYI(1, ("neg dentry 0x%p name = %s", - direntry, direntry->d_name.name)); - if(time_after(jiffies, direntry->d_time + HZ) || - !lookupCacheEnabled) { - d_drop(direntry); - isValid = 0; - } + cFYI(1, + ("In cifs_d_revalidate with no inode but name = %s and dentry 0x%p", + direntry->d_name.name, direntry)); } +/* unlock_kernel(); */ + return isValid; } diff --git a/trunk/fs/cifs/file.c b/trunk/fs/cifs/file.c index 14a1c72ced92..da4f5e10b3cc 100644 --- a/trunk/fs/cifs/file.c +++ b/trunk/fs/cifs/file.c @@ -489,10 +489,8 @@ int cifs_close(struct inode *inode, struct file *file) the struct would be in each open file, but this should give enough time to clear the socket */ - write_unlock(&file->f_owner.lock); cERROR(1,("close with pending writes")); msleep(timeout); - write_lock(&file->f_owner.lock); timeout *= 4; } write_unlock(&file->f_owner.lock); diff --git a/trunk/fs/cifs/inode.c b/trunk/fs/cifs/inode.c index 411c1f7f84da..923d071163b2 100644 --- a/trunk/fs/cifs/inode.c +++ b/trunk/fs/cifs/inode.c @@ -41,7 +41,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, char *tmp_path; pTcon = cifs_sb->tcon; - cFYI(1, ("Getting info on %s ", search_path)); + cFYI(1, (" Getting info on %s ", search_path)); /* could have done a find first instead but this returns more info */ rc = CIFSSMBUnixQPathInfo(xid, pTcon, search_path, &findData, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & @@ -97,9 +97,9 @@ int cifs_get_inode_info_unix(struct inode **pinode, inode = *pinode; cifsInfo = CIFS_I(inode); - cFYI(1, ("Old time %ld ", cifsInfo->time)); + cFYI(1, (" Old time %ld ", cifsInfo->time)); cifsInfo->time = jiffies; - cFYI(1, ("New time %ld ", cifsInfo->time)); + cFYI(1, (" New time %ld ", cifsInfo->time)); /* this is ok to set on every inode revalidate */ atomic_set(&cifsInfo->inUse,1); @@ -111,9 +111,6 @@ int cifs_get_inode_info_unix(struct inode **pinode, inode->i_ctime = cifs_NTtimeToUnix(le64_to_cpu(findData.LastStatusChange)); inode->i_mode = le64_to_cpu(findData.Permissions); - /* since we set the inode type below we need to mask off - to avoid strange results if bits set above */ - inode->i_mode &= ~S_IFMT; if (type == UNIX_FILE) { inode->i_mode |= S_IFREG; } else if (type == UNIX_SYMLINK) { @@ -132,10 +129,6 @@ int cifs_get_inode_info_unix(struct inode **pinode, inode->i_mode |= S_IFIFO; } else if (type == UNIX_SOCKET) { inode->i_mode |= S_IFSOCK; - } else { - /* safest to call it a file if we do not know */ - inode->i_mode |= S_IFREG; - cFYI(1,("unknown type %d",type)); } inode->i_uid = le64_to_cpu(findData.Uid); inode->i_gid = le64_to_cpu(findData.Gid); @@ -162,39 +155,34 @@ int cifs_get_inode_info_unix(struct inode **pinode, } if (num_of_bytes < end_of_file) - cFYI(1, ("allocation size less than end of file")); + cFYI(1, ("allocation size less than end of file ")); cFYI(1, ("Size %ld and blocks %ld", (unsigned long) inode->i_size, inode->i_blocks)); if (S_ISREG(inode->i_mode)) { - cFYI(1, ("File inode")); + cFYI(1, (" File inode ")); inode->i_op = &cifs_file_inode_ops; - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) { - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) - inode->i_fop = - &cifs_file_direct_nobrl_ops; - else - inode->i_fop = &cifs_file_direct_ops; - } else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) - inode->i_fop = &cifs_file_nobrl_ops; - else /* not direct, send byte range locks */ + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) + inode->i_fop = &cifs_file_direct_ops; + else inode->i_fop = &cifs_file_ops; - + if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) + inode->i_fop->lock = NULL; inode->i_data.a_ops = &cifs_addr_ops; /* check if server can support readpages */ if(pTcon->ses->server->maxBuf < 4096 + MAX_CIFS_HDR_SIZE) inode->i_data.a_ops->readpages = NULL; } else if (S_ISDIR(inode->i_mode)) { - cFYI(1, ("Directory inode")); + cFYI(1, (" Directory inode")); inode->i_op = &cifs_dir_inode_ops; inode->i_fop = &cifs_dir_ops; } else if (S_ISLNK(inode->i_mode)) { - cFYI(1, ("Symbolic Link inode")); + cFYI(1, (" Symbolic Link inode ")); inode->i_op = &cifs_symlink_inode_ops; /* tmp_inode->i_fop = */ /* do not need to set to anything */ } else { - cFYI(1, ("Init special inode")); + cFYI(1, (" Init special inode ")); init_special_inode(inode, inode->i_mode, inode->i_rdev); } @@ -202,111 +190,6 @@ int cifs_get_inode_info_unix(struct inode **pinode, return rc; } -static int decode_sfu_inode(struct inode * inode, __u64 size, - const unsigned char *path, - struct cifs_sb_info *cifs_sb, int xid) -{ - int rc; - int oplock = FALSE; - __u16 netfid; - struct cifsTconInfo *pTcon = cifs_sb->tcon; - char buf[24]; - unsigned int bytes_read; - char * pbuf; - - pbuf = buf; - - if(size == 0) { - inode->i_mode |= S_IFIFO; - return 0; - } else if (size < 8) { - return -EINVAL; /* EOPNOTSUPP? */ - } - - rc = CIFSSMBOpen(xid, pTcon, path, FILE_OPEN, GENERIC_READ, - CREATE_NOT_DIR, &netfid, &oplock, NULL, - cifs_sb->local_nls, - cifs_sb->mnt_cifs_flags & - CIFS_MOUNT_MAP_SPECIAL_CHR); - if (rc==0) { - /* Read header */ - rc = CIFSSMBRead(xid, pTcon, - netfid, - 24 /* length */, 0 /* offset */, - &bytes_read, &pbuf); - if((rc == 0) && (bytes_read >= 8)) { - if(memcmp("IntxBLK", pbuf, 8) == 0) { - cFYI(1,("Block device")); - inode->i_mode |= S_IFBLK; - if(bytes_read == 24) { - /* we have enough to decode dev num */ - __u64 mjr; /* major */ - __u64 mnr; /* minor */ - mjr = le64_to_cpu(*(__le64 *)(pbuf+8)); - mnr = le64_to_cpu(*(__le64 *)(pbuf+16)); - inode->i_rdev = MKDEV(mjr, mnr); - } - } else if(memcmp("IntxCHR", pbuf, 8) == 0) { - cFYI(1,("Char device")); - inode->i_mode |= S_IFCHR; - if(bytes_read == 24) { - /* we have enough to decode dev num */ - __u64 mjr; /* major */ - __u64 mnr; /* minor */ - mjr = le64_to_cpu(*(__le64 *)(pbuf+8)); - mnr = le64_to_cpu(*(__le64 *)(pbuf+16)); - inode->i_rdev = MKDEV(mjr, mnr); - } - } else if(memcmp("IntxLNK", pbuf, 7) == 0) { - cFYI(1,("Symlink")); - inode->i_mode |= S_IFLNK; - } else { - inode->i_mode |= S_IFREG; /* file? */ - rc = -EOPNOTSUPP; - } - } else { - inode->i_mode |= S_IFREG; /* then it is a file */ - rc = -EOPNOTSUPP; /* or some unknown SFU type */ - } - CIFSSMBClose(xid, pTcon, netfid); - } - return rc; - -} - -#define SFBITS_MASK (S_ISVTX | S_ISGID | S_ISUID) /* SETFILEBITS valid bits */ - -static int get_sfu_uid_mode(struct inode * inode, - const unsigned char *path, - struct cifs_sb_info *cifs_sb, int xid) -{ -#ifdef CONFIG_CIFS_XATTR - ssize_t rc; - char ea_value[4]; - __u32 mode; - - rc = CIFSSMBQueryEA(xid, cifs_sb->tcon, path, "SETFILEBITS", - ea_value, 4 /* size of buf */, cifs_sb->local_nls, - cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); - if(rc < 0) - return (int)rc; - else if (rc > 3) { - mode = le32_to_cpu(*((__le32 *)ea_value)); - inode->i_mode &= ~SFBITS_MASK; - cFYI(1,("special bits 0%o org mode 0%o", mode, inode->i_mode)); - inode->i_mode = (mode & SFBITS_MASK) | inode->i_mode; - cFYI(1,("special mode bits 0%o", mode)); - return 0; - } else { - return 0; - } -#else - return -EOPNOTSUPP; -#endif - - -} - int cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path, FILE_ALL_INFO *pfindData, struct super_block *sb, int xid) @@ -319,7 +202,7 @@ int cifs_get_inode_info(struct inode **pinode, char *buf = NULL; pTcon = cifs_sb->tcon; - cFYI(1,("Getting info on %s", search_path)); + cFYI(1,("Getting info on %s ", search_path)); if ((pfindData == NULL) && (*pinode != NULL)) { if (CIFS_I(*pinode)->clientCanCacheRead) { @@ -420,9 +303,9 @@ int cifs_get_inode_info(struct inode **pinode, inode = *pinode; cifsInfo = CIFS_I(inode); cifsInfo->cifsAttrs = attr; - cFYI(1, ("Old time %ld ", cifsInfo->time)); + cFYI(1, (" Old time %ld ", cifsInfo->time)); cifsInfo->time = jiffies; - cFYI(1, ("New time %ld ", cifsInfo->time)); + cFYI(1, (" New time %ld ", cifsInfo->time)); /* blksize needs to be multiple of two. So safer to default to blksize and blkbits set in superblock so 2**blkbits and blksize @@ -436,15 +319,13 @@ int cifs_get_inode_info(struct inode **pinode, cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastWriteTime)); inode->i_ctime = cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime)); - cFYI(0, ("Attributes came in as 0x%x ", attr)); + cFYI(0, (" Attributes came in as 0x%x ", attr)); /* set default mode. will override for dirs below */ if (atomic_read(&cifsInfo->inUse) == 0) /* new inode, can safely set these fields */ inode->i_mode = cifs_sb->mnt_file_mode; - else /* since we set the inode type below we need to mask off - to avoid strange results if type changes and both get orred in */ - inode->i_mode &= ~S_IFMT; + /* if (attr & ATTR_REPARSE) */ /* We no longer handle these as symlinks because we could not follow them due to the absolute path with drive letter */ @@ -459,16 +340,10 @@ int cifs_get_inode_info(struct inode **pinode, (pfindData->EndOfFile == 0)) { inode->i_mode = cifs_sb->mnt_file_mode; inode->i_mode |= S_IFIFO; -/* BB Finish for SFU style symlinks and devices */ - } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) && - (cifsInfo->cifsAttrs & ATTR_SYSTEM)) { - if (decode_sfu_inode(inode, - le64_to_cpu(pfindData->EndOfFile), - search_path, - cifs_sb, xid)) { - cFYI(1,("Unrecognized sfu inode type")); - } - cFYI(1,("sfu mode 0%o",inode->i_mode)); +/* BB Finish for SFU style symlinks and devies */ +/* } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) && + (cifsInfo->cifsAttrs & ATTR_SYSTEM) && ) */ + } else { inode->i_mode |= S_IFREG; /* treat the dos attribute of read-only as read-only @@ -493,10 +368,7 @@ int cifs_get_inode_info(struct inode **pinode, /* BB fill in uid and gid here? with help from winbind? or retrieve from NTFS stream extended attribute */ - if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { - /* fill in uid, gid, mode from server ACL */ - get_sfu_uid_mode(inode, search_path, cifs_sb, xid); - } else if (atomic_read(&cifsInfo->inUse) == 0) { + if (atomic_read(&cifsInfo->inUse) == 0) { inode->i_uid = cifs_sb->mnt_uid; inode->i_gid = cifs_sb->mnt_gid; /* set so we do not keep refreshing these fields with @@ -505,29 +377,24 @@ int cifs_get_inode_info(struct inode **pinode, } if (S_ISREG(inode->i_mode)) { - cFYI(1, ("File inode")); + cFYI(1, (" File inode ")); inode->i_op = &cifs_file_inode_ops; - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) { - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) - inode->i_fop = - &cifs_file_direct_nobrl_ops; - else - inode->i_fop = &cifs_file_direct_ops; - } else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) - inode->i_fop = &cifs_file_nobrl_ops; - else /* not direct, send byte range locks */ + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) + inode->i_fop = &cifs_file_direct_ops; + else inode->i_fop = &cifs_file_ops; - + if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) + inode->i_fop->lock = NULL; inode->i_data.a_ops = &cifs_addr_ops; if(pTcon->ses->server->maxBuf < 4096 + MAX_CIFS_HDR_SIZE) inode->i_data.a_ops->readpages = NULL; } else if (S_ISDIR(inode->i_mode)) { - cFYI(1, ("Directory inode")); + cFYI(1, (" Directory inode ")); inode->i_op = &cifs_dir_inode_ops; inode->i_fop = &cifs_dir_ops; } else if (S_ISLNK(inode->i_mode)) { - cFYI(1, ("Symbolic Link inode")); + cFYI(1, (" Symbolic Link inode ")); inode->i_op = &cifs_symlink_inode_ops; } else { init_special_inode(inode, inode->i_mode, @@ -564,7 +431,7 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) struct cifsInodeInfo *cifsInode; FILE_BASIC_INFO *pinfo_buf; - cFYI(1, ("cifs_unlink, inode = 0x%p with ", inode)); + cFYI(1, (" cifs_unlink, inode = 0x%p with ", inode)); xid = GetXid(); @@ -710,7 +577,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) char *full_path = NULL; struct inode *newinode = NULL; - cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode)); + cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p ", mode, inode)); xid = GetXid(); @@ -768,17 +635,6 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) /* BB to be implemented via Windows secrty descriptors eg CIFSSMBWinSetPerms(xid, pTcon, full_path, mode, -1, -1, local_nls); */ - if(direntry->d_inode) { - direntry->d_inode->i_mode = mode; - direntry->d_inode->i_mode |= S_IFDIR; - if(cifs_sb->mnt_cifs_flags & - CIFS_MOUNT_SET_UID) { - direntry->d_inode->i_uid = - current->fsuid; - direntry->d_inode->i_gid = - current->fsgid; - } - } } } kfree(full_path); @@ -795,7 +651,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) char *full_path = NULL; struct cifsInodeInfo *cifsInode; - cFYI(1, ("cifs_rmdir, inode = 0x%p with ", inode)); + cFYI(1, (" cifs_rmdir, inode = 0x%p with ", inode)); xid = GetXid(); @@ -1050,20 +906,14 @@ int cifs_revalidate(struct dentry *direntry) filemap_fdatawrite(direntry->d_inode->i_mapping); } if (invalidate_inode) { - /* shrink_dcache not necessary now that cifs dentry ops - are exported for negative dentries */ -/* if(S_ISDIR(direntry->d_inode->i_mode)) - shrink_dcache_parent(direntry); */ - if (S_ISREG(direntry->d_inode->i_mode)) { - if (direntry->d_inode->i_mapping) - filemap_fdatawait(direntry->d_inode->i_mapping); - /* may eventually have to do this for open files too */ - if (list_empty(&(cifsInode->openFileList))) { - /* changed on server - flush read ahead pages */ - cFYI(1, ("Invalidating read ahead data on " - "closed file")); - invalidate_remote_inode(direntry->d_inode); - } + if (direntry->d_inode->i_mapping) + filemap_fdatawait(direntry->d_inode->i_mapping); + /* may eventually have to do this for open files too */ + if (list_empty(&(cifsInode->openFileList))) { + /* Has changed on server - flush read ahead pages */ + cFYI(1, ("Invalidating read ahead data on " + "closed file")); + invalidate_remote_inode(direntry->d_inode); } } /* up(&direntry->d_inode->i_sem); */ @@ -1120,22 +970,11 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) xid = GetXid(); - cFYI(1, ("In cifs_setattr, name = %s attrs->iavalid 0x%x ", + cFYI(1, (" In cifs_setattr, name = %s attrs->iavalid 0x%x ", direntry->d_name.name, attrs->ia_valid)); - cifs_sb = CIFS_SB(direntry->d_inode->i_sb); pTcon = cifs_sb->tcon; - if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) { - /* check if we have permission to change attrs */ - rc = inode_change_ok(direntry->d_inode, attrs); - if(rc < 0) { - FreeXid(xid); - return rc; - } else - rc = 0; - } - down(&direntry->d_sb->s_vfs_rename_sem); full_path = build_path_from_dentry(direntry); up(&direntry->d_sb->s_vfs_rename_sem); @@ -1175,9 +1014,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) 1 /* 45 seconds */); cFYI(1,("Wrt seteof rc %d", rc)); } - } else - rc = -EINVAL; - + } if (rc != 0) { /* Set file size by pathname rather than by handle either because no valid, writeable file handle for @@ -1249,7 +1086,6 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); else if (attrs->ia_valid & ATTR_MODE) { - rc = 0; if ((mode & S_IWUGO) == 0) /* not writeable */ { if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0) time_buf.Attributes = diff --git a/trunk/fs/cifs/misc.c b/trunk/fs/cifs/misc.c index 94baf6c8ecbd..34a06692e4fa 100644 --- a/trunk/fs/cifs/misc.c +++ b/trunk/fs/cifs/misc.c @@ -397,12 +397,12 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid) if(smb->Command == SMB_COM_LOCKING_ANDX) return 0; else - cERROR(1, ("Rcvd Request not response")); + cERROR(1, ("Rcvd Request not response ")); } } else { /* bad signature or mid */ if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) cERROR(1, - ("Bad protocol string signature header %x", + ("Bad protocol string signature header %x ", *(unsigned int *) smb->Protocol)); if (mid != smb->Mid) cERROR(1, ("Mids do not match")); @@ -417,7 +417,7 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length) __u32 len = smb->smb_buf_length; __u32 clc_len; /* calculated length */ cFYI(0, - ("Entering checkSMB with Length: %x, smb_buf_length: %x", + ("Entering checkSMB with Length: %x, smb_buf_length: %x ", length, len)); if (((unsigned int)length < 2 + sizeof (struct smb_hdr)) || (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4)) { @@ -451,16 +451,9 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length) cERROR(1, ("bad smb size detected for Mid=%d", smb->Mid)); /* Windows XP can return a few bytes too much, presumably an illegal pad, at the end of byte range lock responses - so we allow for that three byte pad, as long as actual + so we allow for up to eight byte pad, as long as actual received length is as long or longer than calculated length */ - /* We have now had to extend this more, since there is a - case in which it needs to be bigger still to handle a - malformed response to transact2 findfirst from WinXP when - access denied is returned and thus bcc and wct are zero - but server says length is 0x21 bytes too long as if the server - forget to reset the smb rfc1001 length when it reset the - wct and bcc to minimum size and drop the t2 parms and data */ - if((4+len > clc_len) && (len <= clc_len + 512)) + if((4+len > clc_len) && (len <= clc_len + 3)) return 0; else return 1; @@ -685,7 +678,7 @@ cifsConvertToUCS(__le16 * target, const char *source, int maxlen, __u16 temp; if(!mapChars) - return cifs_strtoUCS(target, source, PATH_MAX, cp); + return cifs_strtoUCS((wchar_t *) target, source, PATH_MAX, cp); for(i = 0, j = 0; i < maxlen; j++) { src_char = source[i]; diff --git a/trunk/fs/cifs/netmisc.c b/trunk/fs/cifs/netmisc.c index 5de74d216fdd..f7814689844b 100644 --- a/trunk/fs/cifs/netmisc.c +++ b/trunk/fs/cifs/netmisc.c @@ -330,7 +330,7 @@ static const struct { ERRHRD, ERRgeneral, NT_STATUS_ACCOUNT_RESTRICTION}, { ERRSRV, 2241, NT_STATUS_INVALID_LOGON_HOURS}, { ERRSRV, 2240, NT_STATUS_INVALID_WORKSTATION}, { - ERRSRV, ERRpasswordExpired, NT_STATUS_PASSWORD_EXPIRED}, { + ERRSRV, 2242, NT_STATUS_PASSWORD_EXPIRED}, { ERRSRV, 2239, NT_STATUS_ACCOUNT_DISABLED}, { ERRHRD, ERRgeneral, NT_STATUS_NONE_MAPPED}, { ERRHRD, ERRgeneral, NT_STATUS_TOO_MANY_LUIDS_REQUESTED}, { @@ -676,7 +676,7 @@ static const struct { ERRDOS, 193, NT_STATUS_IMAGE_CHECKSUM_MISMATCH}, { ERRHRD, ERRgeneral, NT_STATUS_LOST_WRITEBEHIND_DATA}, { ERRHRD, ERRgeneral, NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID}, { - ERRSRV, ERRpasswordExpired, NT_STATUS_PASSWORD_MUST_CHANGE}, { + ERRSRV, 2242, NT_STATUS_PASSWORD_MUST_CHANGE}, { ERRHRD, ERRgeneral, NT_STATUS_NOT_FOUND}, { ERRHRD, ERRgeneral, NT_STATUS_NOT_TINY_STREAM}, { ERRHRD, ERRgeneral, NT_STATUS_RECOVERY_FAILURE}, { diff --git a/trunk/fs/cifs/readdir.c b/trunk/fs/cifs/readdir.c index 9bdaaecae36f..a86bd1c07602 100644 --- a/trunk/fs/cifs/readdir.c +++ b/trunk/fs/cifs/readdir.c @@ -142,11 +142,6 @@ static void fill_in_inode(struct inode *tmp_inode, tmp_inode->i_gid = cifs_sb->mnt_gid; /* set default mode. will override for dirs below */ tmp_inode->i_mode = cifs_sb->mnt_file_mode; - } else { - /* mask off the type bits since it gets set - below and we do not want to get two type - bits set */ - tmp_inode->i_mode &= ~S_IFMT; } if (attr & ATTR_DIRECTORY) { @@ -157,18 +152,12 @@ static void fill_in_inode(struct inode *tmp_inode, } tmp_inode->i_mode |= S_IFDIR; } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) && - (attr & ATTR_SYSTEM)) { - if (end_of_file == 0) { - *pobject_type = DT_FIFO; - tmp_inode->i_mode |= S_IFIFO; - } else { - /* rather than get the type here, we mark the - inode as needing revalidate and get the real type - (blk vs chr vs. symlink) later ie in lookup */ - *pobject_type = DT_REG; - tmp_inode->i_mode |= S_IFREG; - cifsInfo->time = 0; - } + (attr & ATTR_SYSTEM) && (end_of_file == 0)) { + *pobject_type = DT_FIFO; + tmp_inode->i_mode |= S_IFIFO; +/* BB Finish for SFU style symlinks and devies */ +/* } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) && + (attr & ATTR_SYSTEM) && ) { */ /* we no longer mark these because we could not follow them */ /* } else if (attr & ATTR_REPARSE) { *pobject_type = DT_LNK; @@ -204,14 +193,8 @@ static void fill_in_inode(struct inode *tmp_inode, if (S_ISREG(tmp_inode->i_mode)) { cFYI(1, ("File inode")); tmp_inode->i_op = &cifs_file_inode_ops; - if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) { - if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) - tmp_inode->i_fop = &cifs_file_direct_nobrl_ops; - else - tmp_inode->i_fop = &cifs_file_direct_ops; - - } else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) - tmp_inode->i_fop = &cifs_file_nobrl_ops; + if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) + tmp_inode->i_fop = &cifs_file_direct_ops; else tmp_inode->i_fop = &cifs_file_ops; if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) @@ -275,9 +258,6 @@ static void unix_fill_in_inode(struct inode *tmp_inode, cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastStatusChange)); tmp_inode->i_mode = le64_to_cpu(pfindData->Permissions); - /* since we set the inode type below we need to mask off type - to avoid strange results if bits above were corrupt */ - tmp_inode->i_mode &= ~S_IFMT; if (type == UNIX_FILE) { *pobject_type = DT_REG; tmp_inode->i_mode |= S_IFREG; @@ -303,11 +283,6 @@ static void unix_fill_in_inode(struct inode *tmp_inode, } else if (type == UNIX_SOCKET) { *pobject_type = DT_SOCK; tmp_inode->i_mode |= S_IFSOCK; - } else { - /* safest to just call it a file */ - *pobject_type = DT_REG; - tmp_inode->i_mode |= S_IFREG; - cFYI(1,("unknown inode type %d",type)); } tmp_inode->i_uid = le64_to_cpu(pfindData->Uid); @@ -724,7 +699,7 @@ static int cifs_get_name_from_search_buf(struct qstr *pqst, (__le16 *)filename, len/2, nlt); else pqst->len = cifs_strfromUCS_le((char *)pqst->name, - (__le16 *)filename,len/2,nlt); + (wchar_t *)filename,len/2,nlt); } else { pqst->name = filename; pqst->len = len; diff --git a/trunk/fs/cifs/transport.c b/trunk/fs/cifs/transport.c index f8871196098c..981ea0d8b9cd 100644 --- a/trunk/fs/cifs/transport.c +++ b/trunk/fs/cifs/transport.c @@ -515,7 +515,6 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, *pbytes_returned = in_buf->smb_buf_length; /* BB special case reconnect tid and uid here? */ - /* BB special case Errbadpassword and pwdexpired here */ rc = map_smb_to_linux_error(in_buf); /* convert ByteCount if necessary */ @@ -523,7 +522,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, sizeof (struct smb_hdr) - 4 /* do not count RFC1001 header */ + (2 * in_buf->WordCount) + 2 /* bcc */ ) - BCC(in_buf) = le16_to_cpu(BCC_LE(in_buf)); + BCC(in_buf) = le16_to_cpu(BCC(in_buf)); } else { rc = -EIO; cFYI(1,("Bad MID state?")); @@ -787,7 +786,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, sizeof (struct smb_hdr) - 4 /* do not count RFC1001 header */ + (2 * out_buf->WordCount) + 2 /* bcc */ ) - BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf)); + BCC(out_buf) = le16_to_cpu(BCC(out_buf)); } else { rc = -EIO; cERROR(1,("Bad MID state? ")); diff --git a/trunk/fs/compat.c b/trunk/fs/compat.c index 55ac0324aaf1..8e71cdbecc7c 100644 --- a/trunk/fs/compat.c +++ b/trunk/fs/compat.c @@ -168,8 +168,8 @@ asmlinkage long compat_sys_statfs(const char __user *path, struct compat_statfs if (!error) { struct kstatfs tmp; error = vfs_statfs(nd.dentry->d_inode->i_sb, &tmp); - if (!error) - error = put_compat_statfs(buf, &tmp); + if (!error && put_compat_statfs(buf, &tmp)) + error = -EFAULT; path_release(&nd); } return error; @@ -186,8 +186,8 @@ asmlinkage long compat_sys_fstatfs(unsigned int fd, struct compat_statfs __user if (!file) goto out; error = vfs_statfs(file->f_dentry->d_inode->i_sb, &tmp); - if (!error) - error = put_compat_statfs(buf, &tmp); + if (!error && put_compat_statfs(buf, &tmp)) + error = -EFAULT; fput(file); out: return error; @@ -236,8 +236,8 @@ asmlinkage long compat_sys_statfs64(const char __user *path, compat_size_t sz, s if (!error) { struct kstatfs tmp; error = vfs_statfs(nd.dentry->d_inode->i_sb, &tmp); - if (!error) - error = put_compat_statfs64(buf, &tmp); + if (!error && put_compat_statfs64(buf, &tmp)) + error = -EFAULT; path_release(&nd); } return error; @@ -257,8 +257,8 @@ asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, struct c if (!file) goto out; error = vfs_statfs(file->f_dentry->d_inode->i_sb, &tmp); - if (!error) - error = put_compat_statfs64(buf, &tmp); + if (!error && put_compat_statfs64(buf, &tmp)) + error = -EFAULT; fput(file); out: return error; @@ -268,6 +268,7 @@ asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, struct c #define IOCTL_HASHSIZE 256 static struct ioctl_trans *ioctl32_hash_table[IOCTL_HASHSIZE]; +static DECLARE_RWSEM(ioctl32_sem); extern struct ioctl_trans ioctl_start[]; extern int ioctl_table_size; @@ -389,10 +390,14 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, break; } + /* When register_ioctl32_conversion is finally gone remove + this lock! -AK */ + down_read(&ioctl32_sem); for (t = ioctl32_hash_table[ioctl32_hash(cmd)]; t; t = t->next) { if (t->cmd == cmd) goto found_handler; } + up_read(&ioctl32_sem); if (S_ISSOCK(filp->f_dentry->d_inode->i_mode) && cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) { @@ -412,9 +417,11 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, lock_kernel(); error = t->handler(fd, cmd, arg, filp); unlock_kernel(); + up_read(&ioctl32_sem); goto out_fput; } + up_read(&ioctl32_sem); do_ioctl: error = vfs_ioctl(filp, fd, cmd, arg); out_fput: @@ -1170,7 +1177,7 @@ static ssize_t compat_do_readv_writev(int type, struct file *file, } ret = rw_verify_area(type, file, pos, tot_len); - if (ret < 0) + if (ret) goto out; fnv = NULL; diff --git a/trunk/fs/compat_ioctl.c b/trunk/fs/compat_ioctl.c index 43a2508ac696..26300fccb4fc 100644 --- a/trunk/fs/compat_ioctl.c +++ b/trunk/fs/compat_ioctl.c @@ -49,8 +49,6 @@ #include #include #include -#include -#include #include #include #include @@ -123,11 +121,6 @@ #include -#include -#include -#include -#include - #undef INCLUDES #endif @@ -136,15 +129,6 @@ /* Aiee. Someone does not find a difference between int and long */ #define EXT2_IOC32_GETFLAGS _IOR('f', 1, int) #define EXT2_IOC32_SETFLAGS _IOW('f', 2, int) -#define EXT3_IOC32_GETVERSION _IOR('f', 3, int) -#define EXT3_IOC32_SETVERSION _IOW('f', 4, int) -#define EXT3_IOC32_GETRSVSZ _IOR('f', 5, int) -#define EXT3_IOC32_SETRSVSZ _IOW('f', 6, int) -#define EXT3_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int) -#ifdef CONFIG_JBD_DEBUG -#define EXT3_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int) -#endif - #define EXT2_IOC32_GETVERSION _IOR('v', 1, int) #define EXT2_IOC32_SETVERSION _IOW('v', 2, int) @@ -191,22 +175,6 @@ static int do_ext2_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg)); } -static int do_ext3_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - /* These are just misnamed, they actually get/put from/to user an int */ - switch (cmd) { - case EXT3_IOC32_GETVERSION: cmd = EXT3_IOC_GETVERSION; break; - case EXT3_IOC32_SETVERSION: cmd = EXT3_IOC_SETVERSION; break; - case EXT3_IOC32_GETRSVSZ: cmd = EXT3_IOC_GETRSVSZ; break; - case EXT3_IOC32_SETRSVSZ: cmd = EXT3_IOC_SETRSVSZ; break; - case EXT3_IOC32_GROUP_EXTEND: cmd = EXT3_IOC_GROUP_EXTEND; break; -#ifdef CONFIG_JBD_DEBUG - case EXT3_IOC32_WAIT_FOR_READONLY: cmd = EXT3_IOC_WAIT_FOR_READONLY; break; -#endif - } - return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg)); -} - struct video_tuner32 { compat_int_t tuner; char name[32]; @@ -445,128 +413,6 @@ static int do_video_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) return err; } -struct compat_dmx_event { - dmx_event_t event; - compat_time_t timeStamp; - union - { - dmx_scrambling_status_t scrambling; - } u; -}; - -static int do_dmx_get_event(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - struct dmx_event kevent; - mm_segment_t old_fs = get_fs(); - int err; - - set_fs(KERNEL_DS); - err = sys_ioctl(fd, cmd, (unsigned long) &kevent); - set_fs(old_fs); - - if (!err) { - struct compat_dmx_event __user *up = compat_ptr(arg); - - err = put_user(kevent.event, &up->event); - err |= put_user(kevent.timeStamp, &up->timeStamp); - err |= put_user(kevent.u.scrambling, &up->u.scrambling); - if (err) - err = -EFAULT; - } - - return err; -} - -struct compat_video_event { - int32_t type; - compat_time_t timestamp; - union { - video_size_t size; - unsigned int frame_rate; - } u; -}; - -static int do_video_get_event(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - struct video_event kevent; - mm_segment_t old_fs = get_fs(); - int err; - - set_fs(KERNEL_DS); - err = sys_ioctl(fd, cmd, (unsigned long) &kevent); - set_fs(old_fs); - - if (!err) { - struct compat_video_event __user *up = compat_ptr(arg); - - err = put_user(kevent.type, &up->type); - err |= put_user(kevent.timestamp, &up->timestamp); - err |= put_user(kevent.u.size.w, &up->u.size.w); - err |= put_user(kevent.u.size.h, &up->u.size.h); - err |= put_user(kevent.u.size.aspect_ratio, - &up->u.size.aspect_ratio); - if (err) - err = -EFAULT; - } - - return err; -} - -struct compat_video_still_picture { - compat_uptr_t iFrame; - int32_t size; -}; - -static int do_video_stillpicture(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - struct compat_video_still_picture __user *up; - struct video_still_picture __user *up_native; - compat_uptr_t fp; - int32_t size; - int err; - - up = (struct compat_video_still_picture __user *) arg; - err = get_user(fp, &up->iFrame); - err |= get_user(size, &up->size); - if (err) - return -EFAULT; - - up_native = - compat_alloc_user_space(sizeof(struct video_still_picture)); - - put_user(compat_ptr(fp), &up_native->iFrame); - put_user(size, &up_native->size); - - err = sys_ioctl(fd, cmd, (unsigned long) up_native); - - return err; -} - -struct compat_video_spu_palette { - int length; - compat_uptr_t palette; -}; - -static int do_video_set_spu_palette(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - struct compat_video_spu_palette __user *up; - struct video_spu_palette __user *up_native; - compat_uptr_t palp; - int length, err; - - up = (struct compat_video_spu_palette __user *) arg; - err = get_user(palp, &up->palette); - err |= get_user(length, &up->length); - - up_native = compat_alloc_user_space(sizeof(struct video_spu_palette)); - put_user(compat_ptr(palp), &up_native->palette); - put_user(length, &up_native->length); - - err = sys_ioctl(fd, cmd, (unsigned long) up_native); - - return err; -} - #ifdef CONFIG_NET static int do_siocgstamp(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -686,8 +532,7 @@ static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg) ifr = ifc.ifc_req; ifr32 = compat_ptr(ifc32.ifcbuf); - for (i = 0, j = 0; - i + sizeof (struct ifreq32) < ifc32.ifc_len && j < ifc.ifc_len; + for (i = 0, j = 0; i < ifc32.ifc_len && j < ifc.ifc_len; i += sizeof (struct ifreq32), j += sizeof (struct ifreq)) { if (copy_in_user(ifr32, ifr, sizeof (struct ifreq32))) return -EFAULT; @@ -703,7 +548,10 @@ static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg) i = ((i / sizeof(struct ifreq)) * sizeof(struct ifreq32)); ifc32.ifc_len = i; } else { - ifc32.ifc_len = i; + if (i <= ifc32.ifc_len) + ifc32.ifc_len = i; + else + ifc32.ifc_len = i - sizeof (struct ifreq32); } if (copy_to_user(compat_ptr(arg), &ifc32, sizeof(struct ifconf32))) return -EFAULT; @@ -3006,15 +2854,6 @@ HANDLE_IOCTL(EXT2_IOC32_GETFLAGS, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl) HANDLE_IOCTL(EXT2_IOC32_SETVERSION, do_ext2_ioctl) -HANDLE_IOCTL(EXT3_IOC32_GETVERSION, do_ext3_ioctl) -HANDLE_IOCTL(EXT3_IOC32_SETVERSION, do_ext3_ioctl) -HANDLE_IOCTL(EXT3_IOC32_GETRSVSZ, do_ext3_ioctl) -HANDLE_IOCTL(EXT3_IOC32_SETRSVSZ, do_ext3_ioctl) -HANDLE_IOCTL(EXT3_IOC32_GROUP_EXTEND, do_ext3_ioctl) -COMPATIBLE_IOCTL(EXT3_IOC_GROUP_ADD) -#ifdef CONFIG_JBD_DEBUG -HANDLE_IOCTL(EXT3_IOC32_WAIT_FOR_READONLY, do_ext3_ioctl) -#endif HANDLE_IOCTL(VIDIOCGTUNER32, do_video_ioctl) HANDLE_IOCTL(VIDIOCSTUNER32, do_video_ioctl) HANDLE_IOCTL(VIDIOCGWIN32, do_video_ioctl) @@ -3115,11 +2954,5 @@ HANDLE_IOCTL(NCP_IOC_GETPRIVATEDATA_32, do_ncp_getprivatedata) HANDLE_IOCTL(NCP_IOC_SETPRIVATEDATA_32, do_ncp_setprivatedata) #endif -/* dvb */ -HANDLE_IOCTL(DMX_GET_EVENT, do_dmx_get_event) -HANDLE_IOCTL(VIDEO_GET_EVENT, do_video_get_event) -HANDLE_IOCTL(VIDEO_STILLPICTURE, do_video_stillpicture) -HANDLE_IOCTL(VIDEO_SET_SPU_PALETTE, do_video_set_spu_palette) - #undef DECLARES #endif diff --git a/trunk/fs/dquot.c b/trunk/fs/dquot.c index 2a62b3dc20ec..05b60283c9c2 100644 --- a/trunk/fs/dquot.c +++ b/trunk/fs/dquot.c @@ -1513,16 +1513,10 @@ int vfs_quota_on_mount(struct super_block *sb, char *qf_name, if (IS_ERR(dentry)) return PTR_ERR(dentry); - if (!dentry->d_inode) { - error = -ENOENT; - goto out; - } - error = security_quota_on(dentry); if (!error) error = vfs_quota_on_inode(dentry->d_inode, type, format_id); -out: dput(dentry); return error; } diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 22533cce0611..c466fec5de20 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -306,6 +306,9 @@ void install_arg_page(struct vm_area_struct *vma, struct page *page, unsigned long address) { struct mm_struct *mm = vma->vm_mm; + pgd_t * pgd; + pud_t * pud; + pmd_t * pmd; pte_t * pte; spinlock_t *ptl; @@ -313,7 +316,14 @@ void install_arg_page(struct vm_area_struct *vma, goto out; flush_dcache_page(page); - pte = get_locked_pte(mm, address, &ptl); + pgd = pgd_offset(mm, address); + pud = pud_alloc(mm, pgd, address); + if (!pud) + goto out; + pmd = pmd_alloc(mm, pud, address); + if (!pmd) + goto out; + pte = pte_alloc_map_lock(mm, pmd, address, &ptl); if (!pte) goto out; if (!pte_none(*pte)) { @@ -658,7 +668,7 @@ static inline int de_thread(struct task_struct *tsk) if (!thread_group_leader(current)) { struct task_struct *parent; struct dentry *proc_dentry1, *proc_dentry2; - unsigned long ptrace; + unsigned long exit_state, ptrace; /* * Wait for the thread group leader to be a zombie. @@ -716,15 +726,15 @@ static inline int de_thread(struct task_struct *tsk) list_del(¤t->tasks); list_add_tail(¤t->tasks, &init_task.tasks); current->exit_signal = SIGCHLD; - - BUG_ON(leader->exit_state != EXIT_ZOMBIE); - leader->exit_state = EXIT_DEAD; + exit_state = leader->exit_state; write_unlock_irq(&tasklist_lock); spin_unlock(&leader->proc_lock); spin_unlock(¤t->proc_lock); proc_pid_flush(proc_dentry1); proc_pid_flush(proc_dentry2); + + BUG_ON(exit_state != EXIT_ZOMBIE); } /* diff --git a/trunk/fs/ext2/super.c b/trunk/fs/ext2/super.c index 522fa70dd8ea..e4ed4b31a433 100644 --- a/trunk/fs/ext2/super.c +++ b/trunk/fs/ext2/super.c @@ -881,7 +881,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) } if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) ext2_warning(sb, __FUNCTION__, - "mounting ext3 filesystem as ext2"); + "mounting ext3 filesystem as ext2\n"); ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY); percpu_counter_mod(&sbi->s_freeblocks_counter, ext2_count_free_blocks(sb)); diff --git a/trunk/fs/ext3/inode.c b/trunk/fs/ext3/inode.c index 8824e84f8a56..5d9b00e28837 100644 --- a/trunk/fs/ext3/inode.c +++ b/trunk/fs/ext3/inode.c @@ -1384,10 +1384,8 @@ static int ext3_journalled_writepage(struct page *page, ClearPageChecked(page); ret = block_prepare_write(page, 0, PAGE_CACHE_SIZE, ext3_get_block); - if (ret != 0) { - ext3_journal_stop(handle); + if (ret != 0) goto out_unlock; - } ret = walk_page_buffers(handle, page_buffers(page), 0, PAGE_CACHE_SIZE, NULL, do_journal_get_write_access); diff --git a/trunk/fs/ext3/resize.c b/trunk/fs/ext3/resize.c index 6104ad310507..1be78b4b4de9 100644 --- a/trunk/fs/ext3/resize.c +++ b/trunk/fs/ext3/resize.c @@ -767,7 +767,6 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input) if (input->group != EXT3_SB(sb)->s_groups_count) { ext3_warning(sb, __FUNCTION__, "multiple resizers run on filesystem!\n"); - err = -EBUSY; goto exit_journal; } diff --git a/trunk/fs/fuse/dir.c b/trunk/fs/fuse/dir.c index 51f5da652771..c045cc70c749 100644 --- a/trunk/fs/fuse/dir.c +++ b/trunk/fs/fuse/dir.c @@ -74,24 +74,6 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd) return 1; } -static int dir_alias(struct inode *inode) -{ - if (S_ISDIR(inode->i_mode)) { - /* Don't allow creating an alias to a directory */ - struct dentry *alias = d_find_alias(inode); - if (alias) { - dput(alias); - return 1; - } - } - return 0; -} - -static inline int invalid_nodeid(u64 nodeid) -{ - return !nodeid || nodeid == FUSE_ROOT_ID; -} - static struct dentry_operations fuse_dentry_operations = { .d_revalidate = fuse_dentry_revalidate, }; @@ -115,7 +97,7 @@ static int fuse_lookup_iget(struct inode *dir, struct dentry *entry, fuse_lookup_init(req, dir, entry, &outarg); request_send(fc, req); err = req->out.h.error; - if (!err && invalid_nodeid(outarg.nodeid)) + if (!err && (!outarg.nodeid || outarg.nodeid == FUSE_ROOT_ID)) err = -EIO; if (!err) { inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation, @@ -211,7 +193,7 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode, } err = -EIO; - if (!S_ISREG(outentry.attr.mode) || invalid_nodeid(outentry.nodeid)) + if (!S_ISREG(outentry.attr.mode)) goto out_free_ff; inode = fuse_iget(dir->i_sb, outentry.nodeid, outentry.generation, @@ -268,7 +250,7 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req, fuse_put_request(fc, req); return err; } - if (invalid_nodeid(outarg.nodeid)) { + if (!outarg.nodeid || outarg.nodeid == FUSE_ROOT_ID) { fuse_put_request(fc, req); return -EIO; } @@ -281,7 +263,7 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req, fuse_put_request(fc, req); /* Don't allow userspace to do really stupid things... */ - if (((inode->i_mode ^ mode) & S_IFMT) || dir_alias(inode)) { + if ((inode->i_mode ^ mode) & S_IFMT) { iput(inode); return -EIO; } @@ -892,9 +874,14 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry, err = fuse_lookup_iget(dir, entry, &inode); if (err) return ERR_PTR(err); - if (inode && dir_alias(inode)) { - iput(inode); - return ERR_PTR(-EIO); + if (inode && S_ISDIR(inode->i_mode)) { + /* Don't allow creating an alias to a directory */ + struct dentry *alias = d_find_alias(inode); + if (alias) { + dput(alias); + iput(inode); + return ERR_PTR(-EIO); + } } d_add(entry, inode); return NULL; diff --git a/trunk/fs/hfsplus/hfsplus_fs.h b/trunk/fs/hfsplus/hfsplus_fs.h index df16fcbff3fb..c60e5635498d 100644 --- a/trunk/fs/hfsplus/hfsplus_fs.h +++ b/trunk/fs/hfsplus/hfsplus_fs.h @@ -151,7 +151,6 @@ struct hfsplus_sb_info { #define HFSPLUS_SB_WRITEBACKUP 0x0001 #define HFSPLUS_SB_NODECOMPOSE 0x0002 -#define HFSPLUS_SB_FORCE 0x0004 struct hfsplus_inode_info { diff --git a/trunk/fs/hfsplus/hfsplus_raw.h b/trunk/fs/hfsplus/hfsplus_raw.h index b4fbed633219..5bad37cfdb29 100644 --- a/trunk/fs/hfsplus/hfsplus_raw.h +++ b/trunk/fs/hfsplus/hfsplus_raw.h @@ -123,13 +123,11 @@ struct hfsplus_vh { } __packed; /* HFS+ volume attributes */ -#define HFSPLUS_VOL_UNMNT (1 << 8) -#define HFSPLUS_VOL_SPARE_BLK (1 << 9) -#define HFSPLUS_VOL_NOCACHE (1 << 10) -#define HFSPLUS_VOL_INCNSTNT (1 << 11) -#define HFSPLUS_VOL_NODEID_REUSED (1 << 12) -#define HFSPLUS_VOL_JOURNALED (1 << 13) -#define HFSPLUS_VOL_SOFTLOCK (1 << 15) +#define HFSPLUS_VOL_UNMNT (1 << 8) +#define HFSPLUS_VOL_SPARE_BLK (1 << 9) +#define HFSPLUS_VOL_NOCACHE (1 << 10) +#define HFSPLUS_VOL_INCNSTNT (1 << 11) +#define HFSPLUS_VOL_SOFTLOCK (1 << 15) /* HFS+ BTree node descriptor */ struct hfs_bnode_desc { diff --git a/trunk/fs/hfsplus/options.c b/trunk/fs/hfsplus/options.c index 935dafba0078..cca0818aa4ca 100644 --- a/trunk/fs/hfsplus/options.c +++ b/trunk/fs/hfsplus/options.c @@ -22,7 +22,7 @@ enum { opt_umask, opt_uid, opt_gid, opt_part, opt_session, opt_nls, opt_nodecompose, opt_decompose, - opt_force, opt_err + opt_err }; static match_table_t tokens = { @@ -36,7 +36,6 @@ static match_table_t tokens = { { opt_nls, "nls=%s" }, { opt_decompose, "decompose" }, { opt_nodecompose, "nodecompose" }, - { opt_force, "force" }, { opt_err, NULL } }; @@ -146,9 +145,6 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi) case opt_nodecompose: sbi->flags |= HFSPLUS_SB_NODECOMPOSE; break; - case opt_force: - sbi->flags |= HFSPLUS_SB_FORCE; - break; default: return 0; } diff --git a/trunk/fs/hfsplus/super.c b/trunk/fs/hfsplus/super.c index 8093351bd7c3..0ce1c455ae55 100644 --- a/trunk/fs/hfsplus/super.c +++ b/trunk/fs/hfsplus/super.c @@ -251,28 +251,16 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data) return 0; if (!(*flags & MS_RDONLY)) { struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; - struct hfsplus_sb_info sbi; - - memset(&sbi, 0, sizeof(struct hfsplus_sb_info)); - sbi.nls = HFSPLUS_SB(sb).nls; - if (!hfsplus_parse_options(data, &sbi)) - return -EINVAL; if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { printk("HFS+-fs warning: Filesystem was not cleanly unmounted, " "running fsck.hfsplus is recommended. leaving read-only.\n"); sb->s_flags |= MS_RDONLY; *flags |= MS_RDONLY; - } else if (sbi.flags & HFSPLUS_SB_FORCE) { - /* nothing */ } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { printk("HFS+-fs: Filesystem is marked locked, leaving read-only.\n"); sb->s_flags |= MS_RDONLY; *flags |= MS_RDONLY; - } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { - printk("HFS+-fs: Filesystem is marked journaled, leaving read-only.\n"); - sb->s_flags |= MS_RDONLY; - *flags |= MS_RDONLY; } } return 0; @@ -364,19 +352,11 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) printk("HFS+-fs warning: Filesystem was not cleanly unmounted, " "running fsck.hfsplus is recommended. mounting read-only.\n"); sb->s_flags |= MS_RDONLY; - } else if (sbi->flags & HFSPLUS_SB_FORCE) { - /* nothing */ } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { if (!silent) printk("HFS+-fs: Filesystem is marked locked, mounting read-only.\n"); sb->s_flags |= MS_RDONLY; - } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { - if (!silent) - printk("HFS+-fs: write access to a jounaled filesystem is not supported, " - "use the force option at your own risk, mounting read-only.\n"); - sb->s_flags |= MS_RDONLY; } - sbi->flags &= ~HFSPLUS_SB_FORCE; /* Load metadata objects (B*Trees) */ HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); diff --git a/trunk/fs/hostfs/hostfs_kern.c b/trunk/fs/hostfs/hostfs_kern.c index b3ad0bd0312f..4684eb7d48c6 100644 --- a/trunk/fs/hostfs/hostfs_kern.c +++ b/trunk/fs/hostfs/hostfs_kern.c @@ -501,16 +501,11 @@ int hostfs_commit_write(struct file *file, struct page *page, unsigned from, long long start; int err = 0; - start = (((long long) page->index) << PAGE_CACHE_SHIFT) + from; + start = (long long) (page->index << PAGE_CACHE_SHIFT) + from; buffer = kmap(page); err = write_file(FILE_HOSTFS_I(file)->fd, &start, buffer + from, to - from); if(err > 0) err = 0; - - /* Actually, if !err, write_file has added to-from to start, so, despite - * the appearance, we are comparing i_size against the _last_ written - * location, as we should. */ - if(!err && (start > inode->i_size)) inode->i_size = start; @@ -915,8 +910,10 @@ static struct inode_operations hostfs_dir_iops = { int hostfs_link_readpage(struct file *file, struct page *page) { char *buffer, *name; + long long start; int err; + start = page->index << PAGE_CACHE_SHIFT; buffer = kmap(page); name = inode_name(page->mapping->host, 0); if(name == NULL) return(-ENOMEM); diff --git a/trunk/fs/hugetlbfs/inode.c b/trunk/fs/hugetlbfs/inode.c index 8c1cef3bb677..64983ab55586 100644 --- a/trunk/fs/hugetlbfs/inode.c +++ b/trunk/fs/hugetlbfs/inode.c @@ -512,14 +512,10 @@ static int hugetlbfs_statfs(struct super_block *sb, struct kstatfs *buf) buf->f_bsize = HPAGE_SIZE; if (sbinfo) { spin_lock(&sbinfo->stat_lock); - /* If no limits set, just report 0 for max/free/used - * blocks, like simple_statfs() */ - if (sbinfo->max_blocks >= 0) { - buf->f_blocks = sbinfo->max_blocks; - buf->f_bavail = buf->f_bfree = sbinfo->free_blocks; - buf->f_files = sbinfo->max_inodes; - buf->f_ffree = sbinfo->free_inodes; - } + buf->f_blocks = sbinfo->max_blocks; + buf->f_bavail = buf->f_bfree = sbinfo->free_blocks; + buf->f_files = sbinfo->max_inodes; + buf->f_ffree = sbinfo->free_inodes; spin_unlock(&sbinfo->stat_lock); } buf->f_namelen = NAME_MAX; diff --git a/trunk/fs/inotify.c b/trunk/fs/inotify.c index 2fecb7af4a77..bf7ce1d2412b 100644 --- a/trunk/fs/inotify.c +++ b/trunk/fs/inotify.c @@ -364,12 +364,11 @@ static int inotify_dev_get_wd(struct inotify_device *dev, /* * find_inode - resolve a user-given path to a specific inode and return a nd */ -static int find_inode(const char __user *dirname, struct nameidata *nd, - unsigned flags) +static int find_inode(const char __user *dirname, struct nameidata *nd) { int error; - error = __user_walk(dirname, flags, nd); + error = __user_walk(dirname, LOOKUP_FOLLOW, nd); if (error) return error; /* you can only watch an inode if you have read permissions on it */ @@ -934,7 +933,6 @@ asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask) struct file *filp; int ret, fput_needed; int mask_add = 0; - unsigned flags = 0; filp = fget_light(fd, &fput_needed); if (unlikely(!filp)) @@ -946,12 +944,7 @@ asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask) goto fput_and_out; } - if (!(mask & IN_DONT_FOLLOW)) - flags |= LOOKUP_FOLLOW; - if (mask & IN_ONLYDIR) - flags |= LOOKUP_DIRECTORY; - - ret = find_inode(path, &nd, flags); + ret = find_inode(path, &nd); if (unlikely(ret)) goto fput_and_out; diff --git a/trunk/fs/jffs2/debug.h b/trunk/fs/jffs2/debug.h index 162af6dfe292..f193d43a8a59 100644 --- a/trunk/fs/jffs2/debug.h +++ b/trunk/fs/jffs2/debug.h @@ -82,28 +82,28 @@ do { \ printk(JFFS2_ERR_MSG_PREFIX \ " (%d) %s: " fmt, current->pid, \ - __FUNCTION__ , ##__VA_ARGS__); \ + __FUNCTION__, ##__VA_ARGS__); \ } while(0) #define JFFS2_WARNING(fmt, ...) \ do { \ printk(JFFS2_WARN_MSG_PREFIX \ " (%d) %s: " fmt, current->pid, \ - __FUNCTION__ , ##__VA_ARGS__); \ + __FUNCTION__, ##__VA_ARGS__); \ } while(0) #define JFFS2_NOTICE(fmt, ...) \ do { \ printk(JFFS2_NOTICE_MSG_PREFIX \ " (%d) %s: " fmt, current->pid, \ - __FUNCTION__ , ##__VA_ARGS__); \ + __FUNCTION__, ##__VA_ARGS__); \ } while(0) #define JFFS2_DEBUG(fmt, ...) \ do { \ printk(JFFS2_DBG_MSG_PREFIX \ " (%d) %s: " fmt, current->pid, \ - __FUNCTION__ , ##__VA_ARGS__); \ + __FUNCTION__, ##__VA_ARGS__); \ } while(0) /* diff --git a/trunk/fs/jffs2/fs.c b/trunk/fs/jffs2/fs.c index d0fcc5f3497e..543420665c5b 100644 --- a/trunk/fs/jffs2/fs.c +++ b/trunk/fs/jffs2/fs.c @@ -234,7 +234,6 @@ void jffs2_read_inode (struct inode *inode) c = JFFS2_SB_INFO(inode->i_sb); jffs2_init_inode_info(f); - down(&f->sem); ret = jffs2_do_read_inode(c, f, inode->i_ino, &latest_node); @@ -401,7 +400,6 @@ struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_i f = JFFS2_INODE_INFO(inode); jffs2_init_inode_info(f); - down(&f->sem); memset(ri, 0, sizeof(*ri)); /* Set OS-specific defaults for new inodes */ diff --git a/trunk/fs/jffs2/super.c b/trunk/fs/jffs2/super.c index 93883817cbd0..9e0b5458d9c0 100644 --- a/trunk/fs/jffs2/super.c +++ b/trunk/fs/jffs2/super.c @@ -51,7 +51,7 @@ static void jffs2_i_init_once(void * foo, kmem_cache_t * cachep, unsigned long f if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == SLAB_CTOR_CONSTRUCTOR) { - init_MUTEX(&ei->sem); + init_MUTEX_LOCKED(&ei->sem); inode_init_once(&ei->vfs_inode); } } diff --git a/trunk/fs/lockd/clntlock.c b/trunk/fs/lockd/clntlock.c index 3eaf6e701087..006bb9e14579 100644 --- a/trunk/fs/lockd/clntlock.c +++ b/trunk/fs/lockd/clntlock.c @@ -157,8 +157,6 @@ void nlmclnt_mark_reclaim(struct nlm_host *host) inode = fl->fl_file->f_dentry->d_inode; if (inode->i_sb->s_magic != NFS_SUPER_MAGIC) continue; - if (fl->fl_u.nfs_fl.owner == NULL) - continue; if (fl->fl_u.nfs_fl.owner->host != host) continue; if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_GRANTED)) @@ -228,8 +226,6 @@ reclaimer(void *ptr) inode = fl->fl_file->f_dentry->d_inode; if (inode->i_sb->s_magic != NFS_SUPER_MAGIC) continue; - if (fl->fl_u.nfs_fl.owner == NULL) - continue; if (fl->fl_u.nfs_fl.owner->host != host) continue; if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_RECLAIM)) diff --git a/trunk/fs/nfs/callback.c b/trunk/fs/nfs/callback.c index 30cae3602867..f2ca782aba33 100644 --- a/trunk/fs/nfs/callback.c +++ b/trunk/fs/nfs/callback.c @@ -14,9 +14,6 @@ #include #include #include - -#include - #include "nfs4_fs.h" #include "callback.h" diff --git a/trunk/fs/nfs/dir.c b/trunk/fs/nfs/dir.c index c0d1a214572c..7370583b61e5 100644 --- a/trunk/fs/nfs/dir.c +++ b/trunk/fs/nfs/dir.c @@ -1287,7 +1287,6 @@ dentry->d_parent->d_name.name, dentry->d_name.name); nfs_begin_data_update(dentry->d_inode); error = NFS_PROTO(dir)->rename(dir, &dentry->d_name, dir, &qsilly); - nfs_mark_for_revalidate(dentry->d_inode); nfs_end_data_update(dentry->d_inode); } else error = NFS_PROTO(dir)->rename(dir, &dentry->d_name, @@ -1335,7 +1334,6 @@ static int nfs_safe_remove(struct dentry *dentry) /* The VFS may want to delete this inode */ if (error == 0) inode->i_nlink--; - nfs_mark_for_revalidate(inode); nfs_end_data_update(inode); } else error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); @@ -1558,7 +1556,6 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, nfs_begin_data_update(old_inode); error = NFS_PROTO(old_dir)->rename(old_dir, &old_dentry->d_name, new_dir, &new_dentry->d_name); - nfs_mark_for_revalidate(old_inode); nfs_end_data_update(old_inode); nfs_end_data_update(new_dir); nfs_end_data_update(old_dir); diff --git a/trunk/fs/nfs/direct.c b/trunk/fs/nfs/direct.c index 079228817603..b497c71384e8 100644 --- a/trunk/fs/nfs/direct.c +++ b/trunk/fs/nfs/direct.c @@ -678,9 +678,15 @@ nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t if (!count) goto out; - retval = nfs_sync_mapping(mapping); - if (retval) - goto out; + if (mapping->nrpages) { + retval = filemap_fdatawrite(mapping); + if (retval == 0) + retval = nfs_wb_all(inode); + if (retval == 0) + retval = filemap_fdatawait(mapping); + if (retval) + goto out; + } retval = nfs_direct_read(inode, ctx, &iov, pos, 1); if (retval > 0) @@ -758,9 +764,15 @@ nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count, if (!count) goto out; - retval = nfs_sync_mapping(mapping); - if (retval) - goto out; + if (mapping->nrpages) { + retval = filemap_fdatawrite(mapping); + if (retval == 0) + retval = nfs_wb_all(inode); + if (retval == 0) + retval = filemap_fdatawait(mapping); + if (retval) + goto out; + } retval = nfs_direct_write(inode, ctx, &iov, pos, 1); if (mapping->nrpages) diff --git a/trunk/fs/nfs/file.c b/trunk/fs/nfs/file.c index 7a79fbe9f539..57d3e77d97ee 100644 --- a/trunk/fs/nfs/file.c +++ b/trunk/fs/nfs/file.c @@ -433,7 +433,11 @@ static int do_unlk(struct file *filp, int cmd, struct file_lock *fl) * Flush all pending writes before doing anything * with locks.. */ - nfs_sync_mapping(filp->f_mapping); + filemap_fdatawrite(filp->f_mapping); + down(&inode->i_sem); + nfs_wb_all(inode); + up(&inode->i_sem); + filemap_fdatawait(filp->f_mapping); /* NOTE: special case * If we're signalled while cleaning up locks on process exit, we @@ -461,8 +465,15 @@ static int do_setlk(struct file *filp, int cmd, struct file_lock *fl) * Flush all pending writes before doing anything * with locks.. */ - status = nfs_sync_mapping(filp->f_mapping); - if (status != 0) + status = filemap_fdatawrite(filp->f_mapping); + if (status == 0) { + down(&inode->i_sem); + status = nfs_wb_all(inode); + up(&inode->i_sem); + if (status == 0) + status = filemap_fdatawait(filp->f_mapping); + } + if (status < 0) goto out; lock_kernel(); @@ -486,7 +497,11 @@ static int do_setlk(struct file *filp, int cmd, struct file_lock *fl) * Make sure we clear the cache whenever we try to get the lock. * This makes locking act as a cache coherency point. */ - nfs_sync_mapping(filp->f_mapping); + filemap_fdatawrite(filp->f_mapping); + down(&inode->i_sem); + nfs_wb_all(inode); /* we may have slept */ + up(&inode->i_sem); + filemap_fdatawait(filp->f_mapping); nfs_zap_caches(inode); out: rpc_clnt_sigunmask(NFS_CLIENT(inode), &oldset); @@ -509,8 +524,7 @@ static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl) return -EINVAL; /* No mandatory locks over NFS */ - if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID && - fl->fl_type != F_UNLCK) + if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) return -ENOLCK; if (IS_GETLK(cmd)) diff --git a/trunk/fs/nfs/inode.c b/trunk/fs/nfs/inode.c index 432f41cd75e6..6391d8964214 100644 --- a/trunk/fs/nfs/inode.c +++ b/trunk/fs/nfs/inode.c @@ -54,7 +54,7 @@ #define NFS_MAX_READAHEAD (RPC_DEF_SLOT_TABLE - 1) static void nfs_invalidate_inode(struct inode *); -static int nfs_update_inode(struct inode *, struct nfs_fattr *); +static int nfs_update_inode(struct inode *, struct nfs_fattr *, unsigned long); static struct inode *nfs_alloc_inode(struct super_block *sb); static void nfs_destroy_inode(struct inode *); @@ -640,35 +640,17 @@ static int nfs_show_options(struct seq_file *m, struct vfsmount *mnt) return 0; } -/** - * nfs_sync_mapping - helper to flush all mmapped dirty data to disk - */ -int nfs_sync_mapping(struct address_space *mapping) -{ - int ret; - - if (mapping->nrpages == 0) - return 0; - unmap_mapping_range(mapping, 0, 0, 0); - ret = filemap_fdatawrite(mapping); - if (ret != 0) - goto out; - ret = filemap_fdatawait(mapping); - if (ret != 0) - goto out; - ret = nfs_wb_all(mapping->host); -out: - return ret; -} - /* * Invalidate the local caches */ -static void nfs_zap_caches_locked(struct inode *inode) +void +nfs_zap_caches(struct inode *inode) { struct nfs_inode *nfsi = NFS_I(inode); int mode = inode->i_mode; + spin_lock(&inode->i_lock); + NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode); NFS_ATTRTIMEO_UPDATE(inode) = jiffies; @@ -677,12 +659,7 @@ static void nfs_zap_caches_locked(struct inode *inode) nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; else nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; -} -void nfs_zap_caches(struct inode *inode) -{ - spin_lock(&inode->i_lock); - nfs_zap_caches_locked(inode); spin_unlock(&inode->i_lock); } @@ -699,13 +676,16 @@ static void nfs_zap_acl_cache(struct inode *inode) } /* - * Invalidate, but do not unhash, the inode. - * NB: must be called with inode->i_lock held! + * Invalidate, but do not unhash, the inode */ -static void nfs_invalidate_inode(struct inode *inode) +static void +nfs_invalidate_inode(struct inode *inode) { - set_bit(NFS_INO_STALE, &NFS_FLAGS(inode)); - nfs_zap_caches_locked(inode); + umode_t save_mode = inode->i_mode; + + make_bad_inode(inode); + inode->i_mode = save_mode; + nfs_zap_caches(inode); } struct nfs_find_desc { @@ -1101,6 +1081,8 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) int status = -ESTALE; struct nfs_fattr fattr; struct nfs_inode *nfsi = NFS_I(inode); + unsigned long verifier; + unsigned long cache_validity; dfprintk(PAGECACHE, "NFS: revalidating (%s/%Ld)\n", inode->i_sb->s_id, (long long)NFS_FILEID(inode)); @@ -1125,6 +1107,8 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) } } + /* Protect against RPC races by saving the change attribute */ + verifier = nfs_save_change_attribute(inode); status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), &fattr); if (status != 0) { dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n", @@ -1139,7 +1123,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) } spin_lock(&inode->i_lock); - status = nfs_update_inode(inode, &fattr); + status = nfs_update_inode(inode, &fattr, verifier); if (status) { spin_unlock(&inode->i_lock); dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) refresh failed, error=%d\n", @@ -1147,11 +1131,20 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) (long long)NFS_FILEID(inode), status); goto out; } + cache_validity = nfsi->cache_validity; + nfsi->cache_validity &= ~NFS_INO_REVAL_PAGECACHE; + + /* + * We may need to keep the attributes marked as invalid if + * we raced with nfs_end_attr_update(). + */ + if (time_after_eq(verifier, nfsi->cache_change_attribute)) + nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME); spin_unlock(&inode->i_lock); nfs_revalidate_mapping(inode, inode->i_mapping); - if (nfsi->cache_validity & NFS_INO_INVALID_ACL) + if (cache_validity & NFS_INO_INVALID_ACL) nfs_zap_acl_cache(inode); dfprintk(PAGECACHE, "NFS: (%s/%Ld) revalidation complete\n", @@ -1200,8 +1193,11 @@ void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) struct nfs_inode *nfsi = NFS_I(inode); if (nfsi->cache_validity & NFS_INO_INVALID_DATA) { - if (S_ISREG(inode->i_mode)) - nfs_sync_mapping(mapping); + if (S_ISREG(inode->i_mode)) { + if (filemap_fdatawrite(mapping) == 0) + filemap_fdatawait(mapping); + nfs_wb_all(inode); + } invalidate_inode_pages2(mapping); spin_lock(&inode->i_lock); @@ -1351,8 +1347,10 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) return 0; spin_lock(&inode->i_lock); nfsi->cache_validity &= ~NFS_INO_REVAL_PAGECACHE; + if (nfs_verify_change_attribute(inode, fattr->time_start)) + nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME); if (time_after(fattr->time_start, nfsi->last_updated)) - status = nfs_update_inode(inode, fattr); + status = nfs_update_inode(inode, fattr, fattr->time_start); else status = nfs_check_inode_attributes(inode, fattr); @@ -1378,7 +1376,10 @@ int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr) nfsi->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; goto out; } - status = nfs_update_inode(inode, fattr); + status = nfs_update_inode(inode, fattr, fattr->time_start); + if (time_after_eq(fattr->time_start, nfsi->cache_change_attribute)) + nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME|NFS_INO_REVAL_PAGECACHE); + nfsi->cache_change_attribute = jiffies; out: spin_unlock(&inode->i_lock); return status; @@ -1396,12 +1397,12 @@ int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr) * * A very similar scenario holds for the dir cache. */ -static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) +static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsigned long verifier) { struct nfs_inode *nfsi = NFS_I(inode); loff_t cur_isize, new_isize; unsigned int invalid = 0; - int data_stable; + int data_unstable; dfprintk(VFS, "NFS: %s(%s/%ld ct=%d info=0x%x)\n", __FUNCTION__, inode->i_sb->s_id, inode->i_ino, @@ -1432,9 +1433,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) nfsi->last_updated = jiffies; /* Are we racing with known updates of the metadata on the server? */ - data_stable = nfs_verify_change_attribute(inode, fattr->time_start); - if (data_stable) - nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME); + data_unstable = ! (nfs_verify_change_attribute(inode, verifier) || + (nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE)); /* Check if our cached file size is stale */ new_isize = nfs_size_to_loff_t(fattr->size); @@ -1443,7 +1443,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) /* Do we perhaps have any outstanding writes? */ if (nfsi->npages == 0) { /* No, but did we race with nfs_end_data_update()? */ - if (data_stable) { + if (time_after_eq(verifier, nfsi->cache_change_attribute)) { inode->i_size = new_isize; invalid |= NFS_INO_INVALID_DATA; } @@ -1452,7 +1452,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) inode->i_size = new_isize; invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA; } - nfsi->cache_change_attribute = jiffies; dprintk("NFS: isize change on server for file %s/%ld\n", inode->i_sb->s_id, inode->i_ino); } @@ -1462,8 +1461,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); dprintk("NFS: mtime change on server for file %s/%ld\n", inode->i_sb->s_id, inode->i_ino); - invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA; - nfsi->cache_change_attribute = jiffies; + if (!data_unstable) + invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA; } if ((fattr->valid & NFS_ATTR_FATTR_V4) @@ -1471,15 +1470,15 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) dprintk("NFS: change_attr change on server for file %s/%ld\n", inode->i_sb->s_id, inode->i_ino); nfsi->change_attr = fattr->change_attr; - invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; - nfsi->cache_change_attribute = jiffies; + if (!data_unstable) + invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; } /* If ctime has changed we should definitely clear access+acl caches */ if (!timespec_equal(&inode->i_ctime, &fattr->ctime)) { - invalid |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; + if (!data_unstable) + invalid |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime)); - nfsi->cache_change_attribute = jiffies; } memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime)); @@ -1517,8 +1516,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))) invalid &= ~NFS_INO_INVALID_DATA; - if (data_stable) - invalid &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME|NFS_INO_REVAL_PAGECACHE); if (!nfs_have_delegation(inode, FMODE_READ)) nfsi->cache_validity |= invalid; @@ -1531,13 +1528,14 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) printk(KERN_DEBUG "%s: inode %ld mode changed, %07o to %07o\n", __FUNCTION__, inode->i_ino, inode->i_mode, fattr->mode); #endif - out_err: /* * No need to worry about unhashing the dentry, as the * lookup validation will know that the inode is bad. * (But we fall through to invalidate the caches.) */ nfs_invalidate_inode(inode); + out_err: + set_bit(NFS_INO_STALE, &NFS_FLAGS(inode)); return -ESTALE; } @@ -2070,7 +2068,6 @@ static struct inode *nfs_alloc_inode(struct super_block *sb) return NULL; nfsi->flags = 0UL; nfsi->cache_validity = 0UL; - nfsi->cache_change_attribute = jiffies; #ifdef CONFIG_NFS_V3_ACL nfsi->acl_access = ERR_PTR(-EAGAIN); nfsi->acl_default = ERR_PTR(-EAGAIN); diff --git a/trunk/fs/nfs/nfs4proc.c b/trunk/fs/nfs/nfs4proc.c index f988a9417b13..21482b2518f6 100644 --- a/trunk/fs/nfs/nfs4proc.c +++ b/trunk/fs/nfs/nfs4proc.c @@ -1506,15 +1506,10 @@ static int _nfs4_proc_write(struct nfs_write_data *wdata) dprintk("NFS call write %d @ %Ld\n", wdata->args.count, (long long) wdata->args.offset); - wdata->args.bitmask = server->attr_bitmask; - wdata->res.server = server; nfs_fattr_init(fattr); status = rpc_call_sync(server->client, &msg, rpcflags); dprintk("NFS reply write: %d\n", status); - if (status < 0) - return status; - nfs_post_op_update_inode(inode, fattr); - return wdata->res.count; + return status; } static int nfs4_proc_write(struct nfs_write_data *wdata) @@ -1545,13 +1540,9 @@ static int _nfs4_proc_commit(struct nfs_write_data *cdata) dprintk("NFS call commit %d @ %Ld\n", cdata->args.count, (long long) cdata->args.offset); - cdata->args.bitmask = server->attr_bitmask; - cdata->res.server = server; nfs_fattr_init(fattr); status = rpc_call_sync(server->client, &msg, 0); dprintk("NFS reply commit: %d\n", status); - if (status >= 0) - nfs_post_op_update_inode(inode, fattr); return status; } @@ -3080,15 +3071,15 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock struct nfs4_client *clp = state->owner->so_client; int status; + down_read(&clp->cl_sem); /* Is this a delegated open? */ - if (NFS_I(state->inode)->delegation_state != 0) { + if (test_bit(NFS_DELEGATED_STATE, &state->flags)) { /* Yes: cache locks! */ status = do_vfs_lock(request->fl_file, request); /* ...but avoid races with delegation recall... */ if (status < 0 || test_bit(NFS_DELEGATED_STATE, &state->flags)) - return status; + goto out; } - down_read(&clp->cl_sem); status = nfs4_set_lock_state(state, request); if (status != 0) goto out; diff --git a/trunk/fs/nfs/nfs4state.c b/trunk/fs/nfs/nfs4state.c index 5ef4c57618fe..0675f3215e0a 100644 --- a/trunk/fs/nfs/nfs4state.c +++ b/trunk/fs/nfs/nfs4state.c @@ -644,15 +644,12 @@ void nfs4_copy_stateid(nfs4_stateid *dst, struct nfs4_state *state, fl_owner_t f struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter) { - struct rpc_sequence *sequence = counter->sequence; struct nfs_seqid *new; new = kmalloc(sizeof(*new), GFP_KERNEL); if (new != NULL) { new->sequence = counter; - spin_lock(&sequence->lock); - list_add_tail(&new->list, &sequence->list); - spin_unlock(&sequence->lock); + INIT_LIST_HEAD(&new->list); } return new; } @@ -661,10 +658,12 @@ void nfs_free_seqid(struct nfs_seqid *seqid) { struct rpc_sequence *sequence = seqid->sequence->sequence; - spin_lock(&sequence->lock); - list_del(&seqid->list); - spin_unlock(&sequence->lock); - rpc_wake_up(&sequence->wait); + if (!list_empty(&seqid->list)) { + spin_lock(&sequence->lock); + list_del(&seqid->list); + spin_unlock(&sequence->lock); + } + rpc_wake_up_next(&sequence->wait); kfree(seqid); } @@ -723,10 +722,11 @@ int nfs_wait_on_sequence(struct nfs_seqid *seqid, struct rpc_task *task) if (sequence->list.next == &seqid->list) goto out; spin_lock(&sequence->lock); - if (sequence->list.next != &seqid->list) { + if (!list_empty(&sequence->list)) { rpc_sleep_on(&sequence->wait, task, NULL, NULL); status = -EAGAIN; - } + } else + list_add(&seqid->list, &sequence->list); spin_unlock(&sequence->lock); out: return status; diff --git a/trunk/fs/nfs/proc.c b/trunk/fs/nfs/proc.c index e1e3ca5d746b..a48a003242c0 100644 --- a/trunk/fs/nfs/proc.c +++ b/trunk/fs/nfs/proc.c @@ -375,7 +375,6 @@ nfs_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) dprintk("NFS call link %s\n", name->name); status = rpc_call(NFS_CLIENT(inode), NFSPROC_LINK, &arg, NULL, 0); - nfs_mark_for_revalidate(inode); nfs_mark_for_revalidate(dir); dprintk("NFS reply link: %d\n", status); return status; diff --git a/trunk/fs/nfs/write.c b/trunk/fs/nfs/write.c index 3107908e5f3f..8f71e766cc5d 100644 --- a/trunk/fs/nfs/write.c +++ b/trunk/fs/nfs/write.c @@ -189,7 +189,6 @@ static int nfs_writepage_sync(struct nfs_open_context *ctx, struct inode *inode, (long long)NFS_FILEID(inode), count, (long long)(page_offset(page) + offset)); - set_page_writeback(page); nfs_begin_data_update(inode); do { if (count < wsize) @@ -222,7 +221,6 @@ static int nfs_writepage_sync(struct nfs_open_context *ctx, struct inode *inode, io_error: nfs_end_data_update(inode); - end_page_writeback(page); nfs_writedata_free(wdata); return written ? written : result; } @@ -931,7 +929,7 @@ static int nfs_flush_multi(struct list_head *head, struct inode *inode, int how) atomic_set(&req->wb_complete, requests); ClearPageError(page); - set_page_writeback(page); + SetPageWriteback(page); offset = 0; nbytes = req->wb_bytes; do { @@ -994,7 +992,7 @@ static int nfs_flush_one(struct list_head *head, struct inode *inode, int how) nfs_list_remove_request(req); nfs_list_add_request(req, &data->pages); ClearPageError(req->wb_page); - set_page_writeback(req->wb_page); + SetPageWriteback(req->wb_page); *pages++ = req->wb_page; count += req->wb_bytes; } diff --git a/trunk/fs/nfsd/nfs2acl.c b/trunk/fs/nfsd/nfs2acl.c index fc95c4df6693..7cbf0682b2f0 100644 --- a/trunk/fs/nfsd/nfs2acl.c +++ b/trunk/fs/nfsd/nfs2acl.c @@ -107,7 +107,7 @@ static int nfsacld_proc_setacl(struct svc_rqst * rqstp, dprintk("nfsd: SETACL(2acl) %s\n", SVCFH_fmt(&argp->fh)); fh = fh_copy(&resp->fh, &argp->fh); - nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_SATTR); + nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP); if (!nfserr) { nfserr = nfserrno( nfsd_set_posix_acl( diff --git a/trunk/fs/nfsd/nfs3acl.c b/trunk/fs/nfsd/nfs3acl.c index 16e10c170aed..64ba40572fea 100644 --- a/trunk/fs/nfsd/nfs3acl.c +++ b/trunk/fs/nfsd/nfs3acl.c @@ -101,7 +101,7 @@ static int nfsd3_proc_setacl(struct svc_rqst * rqstp, int nfserr = 0; fh = fh_copy(&resp->fh, &argp->fh); - nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_SATTR); + nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP); if (!nfserr) { nfserr = nfserrno( nfsd_set_posix_acl( diff --git a/trunk/fs/partitions/Kconfig b/trunk/fs/partitions/Kconfig index 656bc43431b9..deb25b661f04 100644 --- a/trunk/fs/partitions/Kconfig +++ b/trunk/fs/partitions/Kconfig @@ -203,7 +203,7 @@ config ULTRIX_PARTITION config SUN_PARTITION bool "Sun partition tables support" if PARTITION_ADVANCED - default y if (SPARC || SUN3 || SUN3X) + default y if (SPARC32 || SPARC64 || SUN3 || SUN3X) ---help--- Like most systems, SunOS uses its own hard disk partition table format, incompatible with all others. Saying Y here allows you to diff --git a/trunk/fs/proc/generic.c b/trunk/fs/proc/generic.c index 72b431d0a0a4..b638fb500743 100644 --- a/trunk/fs/proc/generic.c +++ b/trunk/fs/proc/generic.c @@ -54,18 +54,6 @@ proc_file_read(struct file *file, char __user *buf, size_t nbytes, ssize_t n, count; char *start; struct proc_dir_entry * dp; - unsigned long long pos; - - /* - * Gaah, please just use "seq_file" instead. The legacy /proc - * interfaces cut loff_t down to off_t for reads, and ignore - * the offset entirely for writes.. - */ - pos = *ppos; - if (pos > MAX_NON_LFS) - return 0; - if (nbytes > MAX_NON_LFS - pos) - nbytes = MAX_NON_LFS - pos; dp = PDE(inode); if (!(page = (char*) __get_free_page(GFP_KERNEL))) @@ -214,17 +202,30 @@ proc_file_write(struct file *file, const char __user *buffer, static loff_t proc_file_lseek(struct file *file, loff_t offset, int orig) { - loff_t retval = -EINVAL; - switch (orig) { - case 1: - offset += file->f_pos; - /* fallthrough */ - case 0: - if (offset < 0 || offset > MAX_NON_LFS) - break; - file->f_pos = retval = offset; - } - return retval; + lock_kernel(); + + switch (orig) { + case 0: + if (offset < 0) + goto out; + file->f_pos = offset; + unlock_kernel(); + return(file->f_pos); + case 1: + if (offset + file->f_pos < 0) + goto out; + file->f_pos += offset; + unlock_kernel(); + return(file->f_pos); + case 2: + goto out; + default: + goto out; + } + +out: + unlock_kernel(); + return -EINVAL; } static int proc_notify_change(struct dentry *dentry, struct iattr *iattr) diff --git a/trunk/fs/proc/task_mmu.c b/trunk/fs/proc/task_mmu.c index 50bd5a8f0446..d2fa42006d8f 100644 --- a/trunk/fs/proc/task_mmu.c +++ b/trunk/fs/proc/task_mmu.c @@ -195,7 +195,7 @@ static int show_map_internal(struct seq_file *m, void *v, struct mem_size_stats static int show_map(struct seq_file *m, void *v) { - return show_map_internal(m, v, NULL); + return show_map_internal(m, v, 0); } static void smaps_pte_range(struct vm_area_struct *vma, pmd_t *pmd, @@ -402,11 +402,12 @@ struct numa_maps { /* * Calculate numa node maps for a vma */ -static struct numa_maps *get_numa_maps(struct vm_area_struct *vma) +static struct numa_maps *get_numa_maps(const struct vm_area_struct *vma) { - int i; struct page *page; unsigned long vaddr; + struct mm_struct *mm = vma->vm_mm; + int i; struct numa_maps *md = kmalloc(sizeof(struct numa_maps), GFP_KERNEL); if (!md) @@ -419,7 +420,7 @@ static struct numa_maps *get_numa_maps(struct vm_area_struct *vma) md->node[i] =0; for (vaddr = vma->vm_start; vaddr < vma->vm_end; vaddr += PAGE_SIZE) { - page = follow_page(vma, vaddr, 0); + page = follow_page(mm, vaddr, 0); if (page) { int count = page_mapcount(page); diff --git a/trunk/fs/read_write.c b/trunk/fs/read_write.c index df3468a22fea..a091ee4f430d 100644 --- a/trunk/fs/read_write.c +++ b/trunk/fs/read_write.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -183,33 +182,22 @@ asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, } #endif -/* - * rw_verify_area doesn't like huge counts. We limit - * them to something that fits in "int" so that others - * won't have to do range checks all the time. - */ -#define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count) { struct inode *inode; loff_t pos; - if (unlikely((ssize_t) count < 0)) + if (unlikely(count > INT_MAX)) goto Einval; pos = *ppos; if (unlikely((pos < 0) || (loff_t) (pos + count) < 0)) goto Einval; inode = file->f_dentry->d_inode; - if (inode->i_flock && MANDATORY_LOCK(inode)) { - int retval = locks_mandatory_area( - read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, - inode, file, pos, count); - if (retval < 0) - return retval; - } - return count > MAX_RW_COUNT ? MAX_RW_COUNT : count; + if (inode->i_flock && MANDATORY_LOCK(inode)) + return locks_mandatory_area(read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, inode, file, pos, count); + return 0; Einval: return -EINVAL; @@ -256,8 +244,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) return -EFAULT; ret = rw_verify_area(READ, file, pos, count); - if (ret >= 0) { - count = ret; + if (!ret) { ret = security_file_permission (file, MAY_READ); if (!ret) { if (file->f_op->read) @@ -308,8 +295,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ return -EFAULT; ret = rw_verify_area(WRITE, file, pos, count); - if (ret >= 0) { - count = ret; + if (!ret) { ret = security_file_permission (file, MAY_WRITE); if (!ret) { if (file->f_op->write) @@ -511,7 +497,7 @@ static ssize_t do_readv_writev(int type, struct file *file, } ret = rw_verify_area(type, file, pos, tot_len); - if (ret < 0) + if (ret) goto out; ret = security_file_permission(file, type == READ ? MAY_READ : MAY_WRITE); if (ret) @@ -667,9 +653,8 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, if (!(in_file->f_mode & FMODE_PREAD)) goto fput_in; retval = rw_verify_area(READ, in_file, ppos, count); - if (retval < 0) + if (retval) goto fput_in; - count = retval; retval = security_file_permission (in_file, MAY_READ); if (retval) @@ -689,9 +674,8 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, goto fput_out; out_inode = out_file->f_dentry->d_inode; retval = rw_verify_area(WRITE, out_file, &out_file->f_pos, count); - if (retval < 0) + if (retval) goto fput_out; - count = retval; retval = security_file_permission (out_file, MAY_WRITE); if (retval) diff --git a/trunk/fs/reiserfs/inode.c b/trunk/fs/reiserfs/inode.c index a5e3a0ddbe53..5f82352b97e1 100644 --- a/trunk/fs/reiserfs/inode.c +++ b/trunk/fs/reiserfs/inode.c @@ -32,7 +32,6 @@ void reiserfs_delete_inode(struct inode *inode) JOURNAL_PER_BALANCE_CNT * 2 + 2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb); struct reiserfs_transaction_handle th; - int err; truncate_inode_pages(&inode->i_data, 0); @@ -50,13 +49,15 @@ void reiserfs_delete_inode(struct inode *inode) } reiserfs_update_inode_transaction(inode); - err = reiserfs_delete_object(&th, inode); + if (reiserfs_delete_object(&th, inode)) { + up(&inode->i_sem); + goto out; + } /* Do quota update inside a transaction for journaled quotas. We must do that * after delete_object so that quota updates go into the same transaction as * stat data deletion */ - if (!err) - DQUOT_FREE_INODE(inode); + DQUOT_FREE_INODE(inode); if (journal_end(&th, inode->i_sb, jbegin_count)) { up(&inode->i_sem); @@ -65,12 +66,6 @@ void reiserfs_delete_inode(struct inode *inode) up(&inode->i_sem); - /* check return value from reiserfs_delete_object after - * ending the transaction - */ - if (err) - goto out; - /* all items of file are deleted, so we can remove "save" link */ remove_save_link(inode, 0 /* not truncate */ ); /* we can't do anything * about an error here */ @@ -2104,7 +2099,6 @@ int reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) struct page *page = NULL; int error; struct buffer_head *bh = NULL; - int err2; reiserfs_write_lock(p_s_inode->i_sb); @@ -2142,18 +2136,14 @@ int reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) transaction of truncating gets committed - on reboot the file either appears truncated properly or not truncated at all */ add_save_link(&th, p_s_inode, 1); - err2 = reiserfs_do_truncate(&th, p_s_inode, page, update_timestamps); + error = reiserfs_do_truncate(&th, p_s_inode, page, update_timestamps); + if (error) + goto out; error = journal_end(&th, p_s_inode->i_sb, JOURNAL_PER_BALANCE_CNT * 2 + 1); if (error) goto out; - /* check reiserfs_do_truncate after ending the transaction */ - if (err2) { - error = err2; - goto out; - } - if (update_timestamps) { error = remove_save_link(p_s_inode, 1 /* truncate */ ); if (error) @@ -2204,7 +2194,7 @@ static int map_block_for_writepage(struct inode *inode, INITIALIZE_PATH(path); int pos_in_item; int jbegin_count = JOURNAL_PER_BALANCE_CNT; - loff_t byte_offset = ((loff_t)block << inode->i_sb->s_blocksize_bits)+1; + loff_t byte_offset = (block << inode->i_sb->s_blocksize_bits) + 1; int retval; int use_get_block = 0; int bytes_copied = 0; diff --git a/trunk/fs/reiserfs/journal.c b/trunk/fs/reiserfs/journal.c index 3f17ef844fb6..4b15761434bc 100644 --- a/trunk/fs/reiserfs/journal.c +++ b/trunk/fs/reiserfs/journal.c @@ -1039,10 +1039,6 @@ static int flush_commit_list(struct super_block *s, } atomic_dec(&journal->j_async_throttle); - /* We're skipping the commit if there's an error */ - if (retval || reiserfs_is_journal_aborted(journal)) - barrier = 0; - /* wait on everything written so far before writing the commit * if we are in barrier mode, send the commit down now */ @@ -1081,16 +1077,10 @@ static int flush_commit_list(struct super_block *s, BUG_ON(atomic_read(&(jl->j_commit_left)) != 1); if (!barrier) { - /* If there was a write error in the journal - we can't commit - * this transaction - it will be invalid and, if successful, - * will just end up propogating the write error out to - * the file system. */ - if (likely(!retval && !reiserfs_is_journal_aborted (journal))) { - if (buffer_dirty(jl->j_commit_bh)) - BUG(); - mark_buffer_dirty(jl->j_commit_bh) ; - sync_dirty_buffer(jl->j_commit_bh) ; - } + if (buffer_dirty(jl->j_commit_bh)) + BUG(); + mark_buffer_dirty(jl->j_commit_bh); + sync_dirty_buffer(jl->j_commit_bh); } else wait_on_buffer(jl->j_commit_bh); @@ -2767,15 +2757,6 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, journal->j_cnode_used = 0; journal->j_must_wait = 0; - if (journal->j_cnode_free == 0) { - reiserfs_warning(p_s_sb, "journal-2004: Journal cnode memory " - "allocation failed (%ld bytes). Journal is " - "too large for available memory. Usually " - "this is due to a journal that is too large.", - sizeof (struct reiserfs_journal_cnode) * num_cnodes); - goto free_and_return; - } - init_journal_hash(p_s_sb); jl = journal->j_current_jl; jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl); diff --git a/trunk/fs/relayfs/relay.c b/trunk/fs/relayfs/relay.c index 2a6f7f12b7f9..16446a15c96d 100644 --- a/trunk/fs/relayfs/relay.c +++ b/trunk/fs/relayfs/relay.c @@ -333,7 +333,8 @@ size_t relay_switch_subbuf(struct rchan_buf *buf, size_t length) return length; toobig: - buf->chan->last_toobig = length; + printk(KERN_WARNING "relayfs: event too large (%Zd)\n", length); + WARN_ON(1); return 0; } @@ -398,11 +399,6 @@ void relay_close(struct rchan *chan) relay_close_buf(chan->buf[i]); } - if (chan->last_toobig) - printk(KERN_WARNING "relayfs: one or more items not logged " - "[item size (%Zd) > sub-buffer size (%Zd)]\n", - chan->last_toobig, chan->subbuf_size); - kref_put(&chan->kref, relay_destroy_channel); } diff --git a/trunk/fs/xattr.c b/trunk/fs/xattr.c index bcc2156d4d28..a9db22557998 100644 --- a/trunk/fs/xattr.c +++ b/trunk/fs/xattr.c @@ -245,7 +245,7 @@ listxattr(struct dentry *d, char __user *list, size_t size) error = d->d_inode->i_op->listxattr(d, klist, size); } else { error = security_inode_listsecurity(d->d_inode, klist, size); - if (size && error > size) + if (size && error >= size) error = -ERANGE; } if (error > 0) { diff --git a/trunk/fs/xfs/linux-2.6/xfs_aops.c b/trunk/fs/xfs/linux-2.6/xfs_aops.c index 94d3cdfbf9b8..c6108971b4e6 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_aops.c +++ b/trunk/fs/xfs/linux-2.6/xfs_aops.c @@ -941,12 +941,13 @@ __linvfs_get_block( int retpbbm = 1; int error; - offset = (xfs_off_t)iblock << inode->i_blkbits; - if (blocks) - size = (ssize_t) min_t(xfs_off_t, LONG_MAX, - (xfs_off_t)blocks << inode->i_blkbits); - else + if (blocks) { + offset = blocks << inode->i_blkbits; /* 64 bit goodness */ + size = (ssize_t) min_t(xfs_off_t, offset, LONG_MAX); + } else { size = 1 << inode->i_blkbits; + } + offset = (xfs_off_t)iblock << inode->i_blkbits; VOP_BMAP(vp, offset, size, create ? flags : BMAPI_READ, &iomap, &retpbbm, error); @@ -1006,7 +1007,7 @@ __linvfs_get_block( ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); offset = min_t(xfs_off_t, iomap.iomap_bsize - iomap.iomap_delta, - (xfs_off_t)blocks << inode->i_blkbits); + blocks << inode->i_blkbits); bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset); } diff --git a/trunk/fs/xfs/quota/xfs_qm.c b/trunk/fs/xfs/quota/xfs_qm.c index 5328a2937127..1aea42d71a64 100644 --- a/trunk/fs/xfs/quota/xfs_qm.c +++ b/trunk/fs/xfs/quota/xfs_qm.c @@ -78,7 +78,7 @@ STATIC int xfs_qm_dqhashlock_nowait(xfs_dquot_t *); STATIC int xfs_qm_init_quotainos(xfs_mount_t *); STATIC int xfs_qm_init_quotainfo(xfs_mount_t *); -STATIC int xfs_qm_shake(int, gfp_t); +STATIC int xfs_qm_shake(int, unsigned int); #ifdef DEBUG extern mutex_t qcheck_lock; @@ -2197,7 +2197,7 @@ xfs_qm_shake_freelist( */ /* ARGSUSED */ STATIC int -xfs_qm_shake(int nr_to_scan, gfp_t gfp_mask) +xfs_qm_shake(int nr_to_scan, unsigned int gfp_mask) { int ndqused, nfree, n; diff --git a/trunk/fs/xfs/xfs_attr_leaf.c b/trunk/fs/xfs/xfs_attr_leaf.c index 1c7421840c18..35e557b00db2 100644 --- a/trunk/fs/xfs/xfs_attr_leaf.c +++ b/trunk/fs/xfs/xfs_attr_leaf.c @@ -310,8 +310,7 @@ xfs_attr_shortform_remove(xfs_da_args_t *args) * Fix up the start offset of the attribute fork */ totsize -= size; - if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname && - !(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) { + if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname) { /* * Last attribute now removed, revert to original * inode format making all literal area available @@ -329,8 +328,7 @@ xfs_attr_shortform_remove(xfs_da_args_t *args) xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); ASSERT(dp->i_d.di_forkoff); - ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname || - (mp->m_flags & XFS_MOUNT_COMPAT_ATTR)); + ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname); dp->i_afp->if_ext_max = XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); dp->i_df.if_ext_max = @@ -739,8 +737,7 @@ xfs_attr_shortform_allfit(xfs_dabuf_t *bp, xfs_inode_t *dp) + name_loc->namelen + INT_GET(name_loc->valuelen, ARCH_CONVERT); } - if (!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR) && - (bytes == sizeof(struct xfs_attr_sf_hdr))) + if (bytes == sizeof(struct xfs_attr_sf_hdr)) return(-1); return(xfs_attr_shortform_bytesfit(dp, bytes)); } @@ -778,8 +775,6 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff) goto out; if (forkoff == -1) { - ASSERT(!(dp->i_mount->m_flags & XFS_MOUNT_COMPAT_ATTR)); - /* * Last attribute was removed, revert to original * inode format making all literal area available diff --git a/trunk/fs/xfs/xfs_fsops.c b/trunk/fs/xfs/xfs_fsops.c index d1236d6f4045..7ceabd0e2d9d 100644 --- a/trunk/fs/xfs/xfs_fsops.c +++ b/trunk/fs/xfs/xfs_fsops.c @@ -550,7 +550,7 @@ xfs_fs_goingdown( struct vfs *vfsp = XFS_MTOVFS(mp); struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); - if (sb && !IS_ERR(sb)) { + if (sb) { xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); thaw_bdev(sb->s_bdev, sb); } diff --git a/trunk/fs/xfs/xfs_iomap.h b/trunk/fs/xfs/xfs_iomap.h index 3ce204a524b0..fcd6d63bb68b 100644 --- a/trunk/fs/xfs/xfs_iomap.h +++ b/trunk/fs/xfs/xfs_iomap.h @@ -69,7 +69,7 @@ typedef struct xfs_iomap { xfs_buftarg_t *iomap_target; xfs_off_t iomap_offset; /* offset of mapping, bytes */ xfs_off_t iomap_bsize; /* size of mapping, bytes */ - xfs_off_t iomap_delta; /* offset into mapping, bytes */ + size_t iomap_delta; /* offset into mapping, bytes */ iomap_flags_t iomap_flags; } xfs_iomap_t; diff --git a/trunk/fs/xfs/xfs_log_priv.h b/trunk/fs/xfs/xfs_log_priv.h index 4518b188ade6..8f285149681f 100644 --- a/trunk/fs/xfs/xfs_log_priv.h +++ b/trunk/fs/xfs/xfs_log_priv.h @@ -494,8 +494,10 @@ typedef struct log { #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) -#define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ - { \ +#define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ + xlog_grant_sub_space(log,bytes,type) +static inline void xlog_grant_sub_space(struct log *log, int bytes, int type) +{ if (type == 'w') { \ (log)->l_grant_write_bytes -= (bytes); \ if ((log)->l_grant_write_bytes < 0) { \ @@ -509,9 +511,13 @@ typedef struct log { (log)->l_grant_reserve_cycle--; \ } \ } \ - } -#define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ - { \ +} + +#define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ + xlog_grant_add_space(log,bytes,type) +static inline void +xlog_grant_add_space(struct log *log, int bytes, int type) +{ if (type == 'w') { \ (log)->l_grant_write_bytes += (bytes); \ if ((log)->l_grant_write_bytes > (log)->l_logsize) { \ @@ -525,9 +531,12 @@ typedef struct log { (log)->l_grant_reserve_cycle++; \ } \ } \ - } -#define XLOG_INS_TICKETQ(q, tic) \ - { \ +} + +#define XLOG_INS_TICKETQ(q, tic) xlog_ins_ticketq(q, tic) +static inline void +xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) +{ \ if (q) { \ (tic)->t_next = (q); \ (tic)->t_prev = (q)->t_prev; \ @@ -538,9 +547,12 @@ typedef struct log { (q) = (tic); \ } \ (tic)->t_flags |= XLOG_TIC_IN_Q; \ - } -#define XLOG_DEL_TICKETQ(q, tic) \ - { \ +} + +#define XLOG_DEL_TICKETQ(q, tic) xlog_del_ticketq(q, tic) +static inline void +xlog_del_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) +{ \ if ((tic) == (tic)->t_next) { \ (q) = NULL; \ } else { \ @@ -550,7 +562,7 @@ typedef struct log { } \ (tic)->t_next = (tic)->t_prev = NULL; \ (tic)->t_flags &= ~XLOG_TIC_IN_Q; \ - } +} /* common routines */ extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); diff --git a/trunk/fs/xfs/xfs_vnodeops.c b/trunk/fs/xfs/xfs_vnodeops.c index e03fa2a3d5ed..7c1f74531463 100644 --- a/trunk/fs/xfs/xfs_vnodeops.c +++ b/trunk/fs/xfs/xfs_vnodeops.c @@ -3958,9 +3958,8 @@ xfs_finish_reclaim_all(xfs_mount_t *mp, int noblock) } } XFS_MOUNT_IUNLOCK(mp); - if (xfs_finish_reclaim(ip, noblock, - XFS_IFLUSH_DELWRI_ELSE_ASYNC)) - delay(1); + xfs_finish_reclaim(ip, noblock, + XFS_IFLUSH_DELWRI_ELSE_ASYNC); purged = 1; break; } diff --git a/trunk/include/acpi/acglobal.h b/trunk/include/acpi/acglobal.h index 4ab2ca18b8df..e9c2790139ec 100644 --- a/trunk/include/acpi/acglobal.h +++ b/trunk/include/acpi/acglobal.h @@ -211,7 +211,7 @@ ACPI_EXTERN u32 acpi_gbl_original_mode; ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; ACPI_EXTERN u32 acpi_gbl_ps_find_count; -ACPI_EXTERN u64 acpi_gbl_owner_id_mask; +ACPI_EXTERN u32 acpi_gbl_owner_id_mask; ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; ACPI_EXTERN u16 acpi_gbl_global_lock_handle; ACPI_EXTERN u8 acpi_gbl_debugger_configuration; diff --git a/trunk/include/asm-alpha/atomic.h b/trunk/include/asm-alpha/atomic.h index 6183eab006d4..20ac3d95ecd9 100644 --- a/trunk/include/asm-alpha/atomic.h +++ b/trunk/include/asm-alpha/atomic.h @@ -118,6 +118,8 @@ static __inline__ long atomic_add_return(int i, atomic_t * v) return result; } +#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) + static __inline__ long atomic64_add_return(long i, atomic64_t * v) { long temp, result; @@ -175,21 +177,6 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) return result; } -#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) - -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - -#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) -#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0) - #define atomic_dec_return(v) atomic_sub_return(1,(v)) #define atomic64_dec_return(v) atomic64_sub_return(1,(v)) @@ -200,8 +187,6 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) #define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0) #define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) -#define atomic64_inc_and_test(v) (atomic64_add_return(1, (v)) == 0) - #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) #define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0) diff --git a/trunk/include/asm-alpha/bitops.h b/trunk/include/asm-alpha/bitops.h index 302201f1a097..578ed3f1a607 100644 --- a/trunk/include/asm-alpha/bitops.h +++ b/trunk/include/asm-alpha/bitops.h @@ -321,7 +321,6 @@ static inline int fls(int word) #else #define fls generic_fls #endif -#define fls64 generic_fls64 /* Compute powers of two for the given integer. */ static inline long floor_log2(unsigned long word) diff --git a/trunk/include/asm-arm/arch-clps711x/uncompress.h b/trunk/include/asm-arm/arch-clps711x/uncompress.h index 9fc4bcfa1681..7d0ab791b16c 100644 --- a/trunk/include/asm-arm/arch-clps711x/uncompress.h +++ b/trunk/include/asm-arm/arch-clps711x/uncompress.h @@ -19,7 +19,7 @@ */ #include #include -#include +#include #include #undef CLPS7111_BASE diff --git a/trunk/include/asm-arm/arch-ebsa110/io.h b/trunk/include/asm-arm/arch-ebsa110/io.h index ae048441c9ed..68e04c0bb3f7 100644 --- a/trunk/include/asm-arm/arch-ebsa110/io.h +++ b/trunk/include/asm-arm/arch-ebsa110/io.h @@ -64,7 +64,7 @@ void __writel(u32 val, void __iomem *addr); #define writew(v,b) __writew(v,b) #define writel(v,b) __writel(v,b) -#define __arch_ioremap(cookie,sz,c) ((void __iomem *)(cookie)) +#define __arch_ioremap(cookie,sz,c,a) ((void __iomem *)(cookie)) #define __arch_iounmap(cookie) do { } while (0) extern void insb(unsigned int port, void *buf, int sz); diff --git a/trunk/include/asm-arm/arch-epxa10db/uncompress.h b/trunk/include/asm-arm/arch-epxa10db/uncompress.h index fdfe0e6848f8..d33ad6a93749 100644 --- a/trunk/include/asm-arm/arch-epxa10db/uncompress.h +++ b/trunk/include/asm-arm/arch-epxa10db/uncompress.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "asm/arch/platform.h" -#include "asm/hardware.h" +#include "asm/arch/hardware.h" #define UART00_TYPE (volatile unsigned int*) #include "asm/arch/uart00.h" diff --git a/trunk/include/asm-arm/arch-h720x/uncompress.h b/trunk/include/asm-arm/arch-h720x/uncompress.h index 9535764bcc71..2fffacf85a01 100644 --- a/trunk/include/asm-arm/arch-h720x/uncompress.h +++ b/trunk/include/asm-arm/arch-h720x/uncompress.h @@ -7,7 +7,7 @@ #ifndef __ASM_ARCH_UNCOMPRESS_H #define __ASM_ARCH_UNCOMPRESS_H -#include +#include #define LSR 0x14 #define TEMPTY 0x40 diff --git a/trunk/include/asm-arm/arch-imx/irqs.h b/trunk/include/asm-arm/arch-imx/irqs.h index f195542898e0..238197cfb9d9 100644 --- a/trunk/include/asm-arm/arch-imx/irqs.h +++ b/trunk/include/asm-arm/arch-imx/irqs.h @@ -23,7 +23,7 @@ #define __ARM_IRQS_H__ /* Use the imx definitions */ -#include +#include /* * IMX Interrupt numbers diff --git a/trunk/include/asm-arm/arch-imx/timex.h b/trunk/include/asm-arm/arch-imx/timex.h index 8c91674706b1..d65ab3cd5d5d 100644 --- a/trunk/include/asm-arm/arch-imx/timex.h +++ b/trunk/include/asm-arm/arch-imx/timex.h @@ -21,7 +21,7 @@ #ifndef __ASM_ARCH_TIMEX_H #define __ASM_ARCH_TIMEX_H -#include +#include #define CLOCK_TICK_RATE (CLK32) #endif diff --git a/trunk/include/asm-arm/arch-integrator/smp.h b/trunk/include/asm-arm/arch-integrator/smp.h index da6981efdc39..0ec7093f7c37 100644 --- a/trunk/include/asm-arm/arch-integrator/smp.h +++ b/trunk/include/asm-arm/arch-integrator/smp.h @@ -3,7 +3,7 @@ #include -#include +#include #include #define hard_smp_processor_id() \ diff --git a/trunk/include/asm-arm/arch-iop3xx/timex.h b/trunk/include/asm-arm/arch-iop3xx/timex.h index 472badb451c4..d4187fe9a85a 100644 --- a/trunk/include/asm-arm/arch-iop3xx/timex.h +++ b/trunk/include/asm-arm/arch-iop3xx/timex.h @@ -4,7 +4,7 @@ * IOP3xx architecture timex specifications */ #include -#include + #if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) diff --git a/trunk/include/asm-arm/arch-ixp4xx/io.h b/trunk/include/asm-arm/arch-ixp4xx/io.h index 942b622455bc..688f7f90d93e 100644 --- a/trunk/include/asm-arm/arch-ixp4xx/io.h +++ b/trunk/include/asm-arm/arch-ixp4xx/io.h @@ -59,10 +59,11 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data); * fallback to the default. */ static inline void __iomem * -__ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags) +__ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags, unsigned long align) { + extern void __iomem * __ioremap(unsigned long, size_t, unsigned long, unsigned long); if((addr < 0x48000000) || (addr > 0x4fffffff)) - return __ioremap(addr, size, flags); + return __ioremap(addr, size, flags, align); return (void *)addr; } @@ -70,11 +71,13 @@ __ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags) static inline void __ixp4xx_iounmap(void __iomem *addr) { + extern void __iounmap(void __iomem *addr); + if ((u32)addr >= VMALLOC_START) __iounmap(addr); } -#define __arch_ioremap(a, s, f) __ixp4xx_ioremap(a, s, f) +#define __arch_ioremap(a, s, f, x) __ixp4xx_ioremap(a, s, f, x) #define __arch_iounmap(a) __ixp4xx_iounmap(a) #define writeb(v, p) __ixp4xx_writeb(v, p) diff --git a/trunk/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/trunk/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h index 9444958bec1e..2b149ed59149 100644 --- a/trunk/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h +++ b/trunk/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h @@ -47,7 +47,6 @@ * Queue Manager */ #define IXP4XX_QMGR_BASE_PHYS (0x60000000) -#define IXP4XX_QMGR_REGION_SIZE (0x00004000) /* * Expansion BUS Configuration registers diff --git a/trunk/include/asm-arm/arch-l7200/aux_reg.h b/trunk/include/asm-arm/arch-l7200/aux_reg.h index 5b4396de16a0..762cbc76c501 100644 --- a/trunk/include/asm-arm/arch-l7200/aux_reg.h +++ b/trunk/include/asm-arm/arch-l7200/aux_reg.h @@ -9,7 +9,7 @@ #ifndef _ASM_ARCH_AUXREG_H #define _ASM_ARCH_AUXREG_H -#include +#include #define l7200aux_reg *((volatile unsigned int *) (AUX_BASE)) diff --git a/trunk/include/asm-arm/arch-l7200/gp_timers.h b/trunk/include/asm-arm/arch-l7200/gp_timers.h index 9c4804d13578..6f20962df248 100644 --- a/trunk/include/asm-arm/arch-l7200/gp_timers.h +++ b/trunk/include/asm-arm/arch-l7200/gp_timers.h @@ -10,7 +10,7 @@ #ifndef _ASM_ARCH_GPTIMERS_H #define _ASM_ARCH_GPTIMERS_H -#include +#include /* * Layout of L7200 general purpose timer registers diff --git a/trunk/include/asm-arm/arch-omap/gpio.h b/trunk/include/asm-arm/arch-omap/gpio.h index f486b72070ea..1b3885741ac1 100644 --- a/trunk/include/asm-arm/arch-omap/gpio.h +++ b/trunk/include/asm-arm/arch-omap/gpio.h @@ -26,7 +26,7 @@ #ifndef __ASM_ARCH_OMAP_GPIO_H #define __ASM_ARCH_OMAP_GPIO_H -#include +#include #include #include diff --git a/trunk/include/asm-arm/arch-omap/irqs.h b/trunk/include/asm-arm/arch-omap/irqs.h index 4ffce1d77759..9779686bdceb 100644 --- a/trunk/include/asm-arm/arch-omap/irqs.h +++ b/trunk/include/asm-arm/arch-omap/irqs.h @@ -260,7 +260,7 @@ extern void omap_init_irq(void); * The definition of NR_IRQS is in board-specific header file, which is * included via hardware.h */ -#include +#include #ifndef NR_IRQS #define NR_IRQS IH_BOARD_BASE diff --git a/trunk/include/asm-arm/arch-omap/mcbsp.h b/trunk/include/asm-arm/arch-omap/mcbsp.h index e79d98ab2ab6..305bdeb16ab8 100644 --- a/trunk/include/asm-arm/arch-omap/mcbsp.h +++ b/trunk/include/asm-arm/arch-omap/mcbsp.h @@ -24,7 +24,7 @@ #ifndef __ASM_ARCH_OMAP_MCBSP_H #define __ASM_ARCH_OMAP_MCBSP_H -#include +#include #define OMAP730_MCBSP1_BASE 0xfffb1000 #define OMAP730_MCBSP2_BASE 0xfffb1800 diff --git a/trunk/include/asm-arm/arch-omap/system.h b/trunk/include/asm-arm/arch-omap/system.h index 9af415d2944a..b43cdd2a3874 100644 --- a/trunk/include/asm-arm/arch-omap/system.h +++ b/trunk/include/asm-arm/arch-omap/system.h @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #ifndef CONFIG_MACH_VOICEBLUE diff --git a/trunk/include/asm-arm/arch-pxa/akita.h b/trunk/include/asm-arm/arch-pxa/akita.h index 5d8cc1d9cb10..4a1fbcfccc39 100644 --- a/trunk/include/asm-arm/arch-pxa/akita.h +++ b/trunk/include/asm-arm/arch-pxa/akita.h @@ -25,8 +25,6 @@ /* Default Values */ #define AKITA_IOEXP_IO_OUT (AKITA_IOEXP_IR_ON | AKITA_IOEXP_AKIN_PULLUP) -extern struct platform_device akitaioexp_device; - void akita_set_ioexp(struct device *dev, unsigned char bitmask); void akita_reset_ioexp(struct device *dev, unsigned char bitmask); diff --git a/trunk/include/asm-arm/arch-pxa/irq.h b/trunk/include/asm-arm/arch-pxa/irq.h index 48c60f5eff6a..d770e4b37ae1 100644 --- a/trunk/include/asm-arm/arch-pxa/irq.h +++ b/trunk/include/asm-arm/arch-pxa/irq.h @@ -12,3 +12,8 @@ #define fixup_irq(x) (x) +/* + * This prototype is required for cascading of multiplexed interrupts. + * Since it doesn't exist elsewhere, we'll put it here for now. + */ +extern void do_IRQ(int irq, struct pt_regs *regs); diff --git a/trunk/include/asm-arm/arch-pxa/ohci.h b/trunk/include/asm-arm/arch-pxa/ohci.h deleted file mode 100644 index 7da89569061e..000000000000 --- a/trunk/include/asm-arm/arch-pxa/ohci.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASMARM_ARCH_OHCI_H -#define ASMARM_ARCH_OHCI_H - -struct device; - -struct pxaohci_platform_data { - int (*init)(struct device *); - void (*exit)(struct device *); - - int port_mode; -#define PMM_NPS_MODE 1 -#define PMM_GLOBAL_MODE 2 -#define PMM_PERPORT_MODE 3 -}; - -extern void pxa_set_ohci_info(struct pxaohci_platform_data *info); - -#endif diff --git a/trunk/include/asm-arm/arch-realview/hardware.h b/trunk/include/asm-arm/arch-realview/hardware.h index 9ca76dc3a7af..67879cdb6ef2 100644 --- a/trunk/include/asm-arm/arch-realview/hardware.h +++ b/trunk/include/asm-arm/arch-realview/hardware.h @@ -27,6 +27,5 @@ /* macro to get at IO space when running virtually */ #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) -#define __io_address(n) __io(IO_ADDRESS(n)) #endif diff --git a/trunk/include/asm-arm/arch-realview/system.h b/trunk/include/asm-arm/arch-realview/system.h index 6f3d0ce0ca1e..9f8fcbca0869 100644 --- a/trunk/include/asm-arm/arch-realview/system.h +++ b/trunk/include/asm-arm/arch-realview/system.h @@ -36,7 +36,7 @@ static inline void arch_idle(void) static inline void arch_reset(char mode) { - void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_RESETCTL_OFFSET; + unsigned int hdr_ctrl = (IO_ADDRESS(REALVIEW_SYS_BASE) + REALVIEW_SYS_RESETCTL_OFFSET); unsigned int val; /* diff --git a/trunk/include/asm-arm/arch-rpc/system.h b/trunk/include/asm-arm/arch-rpc/system.h index 729c2ae4b513..ca3277d1d5ea 100644 --- a/trunk/include/asm-arm/arch-rpc/system.h +++ b/trunk/include/asm-arm/arch-rpc/system.h @@ -7,7 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include +#include #include #include diff --git a/trunk/include/asm-arm/arch-s3c2410/regs-gpio.h b/trunk/include/asm-arm/arch-s3c2410/regs-gpio.h index 7f1be48ad67e..cb33d57c146c 100644 --- a/trunk/include/asm-arm/arch-s3c2410/regs-gpio.h +++ b/trunk/include/asm-arm/arch-s3c2410/regs-gpio.h @@ -21,7 +21,6 @@ * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA * 28-Mar-2005 LCVR Fixed definition of GPB10 * 26-Oct-2005 BJD Added generic configuration types - * 27-Nov-2005 LCVR Added definitions to S3C2400 registers */ @@ -55,16 +54,12 @@ #define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO) -/* port A - S3C2410: 22bits, zero in bit X makes pin X output - * S3C2400: 18bits, zero in bit X makes pin X output +/* port A - 22bits, zero in bit X makes pin X output * 1 makes port special function, this is default */ #define S3C2410_GPACON S3C2410_GPIOREG(0x00) #define S3C2410_GPADAT S3C2410_GPIOREG(0x04) -#define S3C2400_GPACON S3C2410_GPIOREG(0x00) -#define S3C2400_GPADAT S3C2410_GPIOREG(0x04) - #define S3C2410_GPA0 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 0) #define S3C2410_GPA0_OUT (0<<0) #define S3C2410_GPA0_ADDR0 (1<<0) @@ -108,42 +103,34 @@ #define S3C2410_GPA10 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 10) #define S3C2410_GPA10_OUT (0<<10) #define S3C2410_GPA10_ADDR25 (1<<10) -#define S3C2400_GPA10_SCKE (1<<10) #define S3C2410_GPA11 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 11) #define S3C2410_GPA11_OUT (0<<11) #define S3C2410_GPA11_ADDR26 (1<<11) -#define S3C2400_GPA11_nCAS0 (1<<11) #define S3C2410_GPA12 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 12) #define S3C2410_GPA12_OUT (0<<12) #define S3C2410_GPA12_nGCS1 (1<<12) -#define S3C2400_GPA12_nCAS1 (1<<12) #define S3C2410_GPA13 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 13) #define S3C2410_GPA13_OUT (0<<13) #define S3C2410_GPA13_nGCS2 (1<<13) -#define S3C2400_GPA13_nGCS1 (1<<13) #define S3C2410_GPA14 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 14) #define S3C2410_GPA14_OUT (0<<14) #define S3C2410_GPA14_nGCS3 (1<<14) -#define S3C2400_GPA14_nGCS2 (1<<14) #define S3C2410_GPA15 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 15) #define S3C2410_GPA15_OUT (0<<15) #define S3C2410_GPA15_nGCS4 (1<<15) -#define S3C2400_GPA15_nGCS3 (1<<15) #define S3C2410_GPA16 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 16) #define S3C2410_GPA16_OUT (0<<16) #define S3C2410_GPA16_nGCS5 (1<<16) -#define S3C2400_GPA16_nGCS4 (1<<16) #define S3C2410_GPA17 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 17) #define S3C2410_GPA17_OUT (0<<17) #define S3C2410_GPA17_CLE (1<<17) -#define S3C2400_GPA17_nGCS5 (1<<17) #define S3C2410_GPA18 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 18) #define S3C2410_GPA18_OUT (0<<18) @@ -165,16 +152,10 @@ #define S3C2410_GPA22_OUT (0<<22) #define S3C2410_GPA22_nFCE (1<<22) -/* 0x08 and 0x0c are reserved on S3C2410 */ +/* 0x08 and 0x0c are reserved */ -/* S3C2410: - * GPB is 10 IO pins, each configured by 2 bits each in GPBCON. +/* GPB is 10 IO pins, each configured by 2 bits each in GPBCON. * 00 = input, 01 = output, 10=special function, 11=reserved - - * S3C2400: - * GPB is 16 IO pins, each configured by 2 bits each in GPBCON. - * 00 = input, 01 = output, 10=data, 11=special function - * bit 0,1 = pin 0, 2,3= pin 1... * * CPBUP = pull up resistor control, 1=disabled, 0=enabled @@ -184,113 +165,63 @@ #define S3C2410_GPBDAT S3C2410_GPIOREG(0x14) #define S3C2410_GPBUP S3C2410_GPIOREG(0x18) -#define S3C2400_GPBCON S3C2410_GPIOREG(0x08) -#define S3C2400_GPBDAT S3C2410_GPIOREG(0x0C) -#define S3C2400_GPBUP S3C2410_GPIOREG(0x10) - /* no i/o pin in port b can have value 3! */ #define S3C2410_GPB0 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0) #define S3C2410_GPB0_INP (0x00 << 0) #define S3C2410_GPB0_OUTP (0x01 << 0) #define S3C2410_GPB0_TOUT0 (0x02 << 0) -#define S3C2400_GPB0_DATA16 (0x02 << 0) #define S3C2410_GPB1 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 1) #define S3C2410_GPB1_INP (0x00 << 2) #define S3C2410_GPB1_OUTP (0x01 << 2) #define S3C2410_GPB1_TOUT1 (0x02 << 2) -#define S3C2400_GPB1_DATA17 (0x02 << 2) #define S3C2410_GPB2 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 2) #define S3C2410_GPB2_INP (0x00 << 4) #define S3C2410_GPB2_OUTP (0x01 << 4) #define S3C2410_GPB2_TOUT2 (0x02 << 4) -#define S3C2400_GPB2_DATA18 (0x02 << 4) -#define S3C2400_GPB2_TCLK1 (0x03 << 4) #define S3C2410_GPB3 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 3) #define S3C2410_GPB3_INP (0x00 << 6) #define S3C2410_GPB3_OUTP (0x01 << 6) #define S3C2410_GPB3_TOUT3 (0x02 << 6) -#define S3C2400_GPB3_DATA19 (0x02 << 6) -#define S3C2400_GPB3_TXD1 (0x03 << 6) #define S3C2410_GPB4 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 4) #define S3C2410_GPB4_INP (0x00 << 8) #define S3C2410_GPB4_OUTP (0x01 << 8) #define S3C2410_GPB4_TCLK0 (0x02 << 8) -#define S3C2400_GPB4_DATA20 (0x02 << 8) #define S3C2410_GPB4_MASK (0x03 << 8) -#define S3C2400_GPB4_RXD1 (0x03 << 8) -#define S3C2400_GPB4_MASK (0x03 << 8) #define S3C2410_GPB5 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 5) #define S3C2410_GPB5_INP (0x00 << 10) #define S3C2410_GPB5_OUTP (0x01 << 10) #define S3C2410_GPB5_nXBACK (0x02 << 10) -#define S3C2400_GPB5_DATA21 (0x02 << 10) -#define S3C2400_GPB5_nCTS1 (0x03 << 10) #define S3C2410_GPB6 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 6) #define S3C2410_GPB6_INP (0x00 << 12) #define S3C2410_GPB6_OUTP (0x01 << 12) #define S3C2410_GPB6_nXBREQ (0x02 << 12) -#define S3C2400_GPB6_DATA22 (0x02 << 12) -#define S3C2400_GPB6_nRTS1 (0x03 << 12) #define S3C2410_GPB7 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 7) #define S3C2410_GPB7_INP (0x00 << 14) #define S3C2410_GPB7_OUTP (0x01 << 14) #define S3C2410_GPB7_nXDACK1 (0x02 << 14) -#define S3C2400_GPB7_DATA23 (0x02 << 14) #define S3C2410_GPB8 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8) #define S3C2410_GPB8_INP (0x00 << 16) #define S3C2410_GPB8_OUTP (0x01 << 16) #define S3C2410_GPB8_nXDREQ1 (0x02 << 16) -#define S3C2400_GPB8_DATA24 (0x02 << 16) #define S3C2410_GPB9 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 9) #define S3C2410_GPB9_INP (0x00 << 18) #define S3C2410_GPB9_OUTP (0x01 << 18) #define S3C2410_GPB9_nXDACK0 (0x02 << 18) -#define S3C2400_GPB9_DATA25 (0x02 << 18) -#define S3C2400_GPB9_I2SSDI (0x03 << 18) #define S3C2410_GPB10 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 10) #define S3C2410_GPB10_INP (0x00 << 20) #define S3C2410_GPB10_OUTP (0x01 << 20) #define S3C2410_GPB10_nXDRE0 (0x02 << 20) -#define S3C2400_GPB10_DATA26 (0x02 << 20) -#define S3C2400_GPB10_nSS (0x03 << 20) - -#define S3C2400_GPB11 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 11) -#define S3C2400_GPB11_INP (0x00 << 22) -#define S3C2400_GPB11_OUTP (0x01 << 22) -#define S3C2400_GPB11_DATA27 (0x02 << 22) - -#define S3C2400_GPB12 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 12) -#define S3C2400_GPB12_INP (0x00 << 24) -#define S3C2400_GPB12_OUTP (0x01 << 24) -#define S3C2400_GPB12_DATA28 (0x02 << 24) - -#define S3C2400_GPB13 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 13) -#define S3C2400_GPB13_INP (0x00 << 26) -#define S3C2400_GPB13_OUTP (0x01 << 26) -#define S3C2400_GPB13_DATA29 (0x02 << 26) - -#define S3C2400_GPB14 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 14) -#define S3C2400_GPB14_INP (0x00 << 28) -#define S3C2400_GPB14_OUTP (0x01 << 28) -#define S3C2400_GPB14_DATA30 (0x02 << 28) - -#define S3C2400_GPB15 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 15) -#define S3C2400_GPB15_INP (0x00 << 30) -#define S3C2400_GPB15_OUTP (0x01 << 30) -#define S3C2400_GPB15_DATA31 (0x02 << 30) - -#define S3C2410_GPB_PUPDIS(x) (1<<(x)) /* Port C consits of 16 GPIO/Special function * @@ -302,193 +233,150 @@ #define S3C2410_GPCDAT S3C2410_GPIOREG(0x24) #define S3C2410_GPCUP S3C2410_GPIOREG(0x28) -#define S3C2400_GPCCON S3C2410_GPIOREG(0x14) -#define S3C2400_GPCDAT S3C2410_GPIOREG(0x18) -#define S3C2400_GPCUP S3C2410_GPIOREG(0x1C) - #define S3C2410_GPC0 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 0) #define S3C2410_GPC0_INP (0x00 << 0) #define S3C2410_GPC0_OUTP (0x01 << 0) #define S3C2410_GPC0_LEND (0x02 << 0) -#define S3C2400_GPC0_VD0 (0x02 << 0) #define S3C2410_GPC1 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 1) #define S3C2410_GPC1_INP (0x00 << 2) #define S3C2410_GPC1_OUTP (0x01 << 2) #define S3C2410_GPC1_VCLK (0x02 << 2) -#define S3C2400_GPC1_VD1 (0x02 << 2) #define S3C2410_GPC2 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 2) #define S3C2410_GPC2_INP (0x00 << 4) #define S3C2410_GPC2_OUTP (0x01 << 4) #define S3C2410_GPC2_VLINE (0x02 << 4) -#define S3C2400_GPC2_VD2 (0x02 << 4) #define S3C2410_GPC3 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 3) #define S3C2410_GPC3_INP (0x00 << 6) #define S3C2410_GPC3_OUTP (0x01 << 6) #define S3C2410_GPC3_VFRAME (0x02 << 6) -#define S3C2400_GPC3_VD3 (0x02 << 6) #define S3C2410_GPC4 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 4) #define S3C2410_GPC4_INP (0x00 << 8) #define S3C2410_GPC4_OUTP (0x01 << 8) #define S3C2410_GPC4_VM (0x02 << 8) -#define S3C2400_GPC4_VD4 (0x02 << 8) #define S3C2410_GPC5 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 5) #define S3C2410_GPC5_INP (0x00 << 10) #define S3C2410_GPC5_OUTP (0x01 << 10) #define S3C2410_GPC5_LCDVF0 (0x02 << 10) -#define S3C2400_GPC5_VD5 (0x02 << 10) #define S3C2410_GPC6 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 6) #define S3C2410_GPC6_INP (0x00 << 12) #define S3C2410_GPC6_OUTP (0x01 << 12) #define S3C2410_GPC6_LCDVF1 (0x02 << 12) -#define S3C2400_GPC6_VD6 (0x02 << 12) #define S3C2410_GPC7 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 7) #define S3C2410_GPC7_INP (0x00 << 14) #define S3C2410_GPC7_OUTP (0x01 << 14) #define S3C2410_GPC7_LCDVF2 (0x02 << 14) -#define S3C2400_GPC7_VD7 (0x02 << 14) #define S3C2410_GPC8 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 8) #define S3C2410_GPC8_INP (0x00 << 16) #define S3C2410_GPC8_OUTP (0x01 << 16) #define S3C2410_GPC8_VD0 (0x02 << 16) -#define S3C2400_GPC8_VD8 (0x02 << 16) #define S3C2410_GPC9 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 9) #define S3C2410_GPC9_INP (0x00 << 18) #define S3C2410_GPC9_OUTP (0x01 << 18) #define S3C2410_GPC9_VD1 (0x02 << 18) -#define S3C2400_GPC9_VD9 (0x02 << 18) #define S3C2410_GPC10 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 10) #define S3C2410_GPC10_INP (0x00 << 20) #define S3C2410_GPC10_OUTP (0x01 << 20) #define S3C2410_GPC10_VD2 (0x02 << 20) -#define S3C2400_GPC10_VD10 (0x02 << 20) #define S3C2410_GPC11 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 11) #define S3C2410_GPC11_INP (0x00 << 22) #define S3C2410_GPC11_OUTP (0x01 << 22) #define S3C2410_GPC11_VD3 (0x02 << 22) -#define S3C2400_GPC11_VD11 (0x02 << 22) #define S3C2410_GPC12 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 12) #define S3C2410_GPC12_INP (0x00 << 24) #define S3C2410_GPC12_OUTP (0x01 << 24) #define S3C2410_GPC12_VD4 (0x02 << 24) -#define S3C2400_GPC12_VD12 (0x02 << 24) #define S3C2410_GPC13 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 13) #define S3C2410_GPC13_INP (0x00 << 26) #define S3C2410_GPC13_OUTP (0x01 << 26) #define S3C2410_GPC13_VD5 (0x02 << 26) -#define S3C2400_GPC13_VD13 (0x02 << 26) #define S3C2410_GPC14 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 14) #define S3C2410_GPC14_INP (0x00 << 28) #define S3C2410_GPC14_OUTP (0x01 << 28) #define S3C2410_GPC14_VD6 (0x02 << 28) -#define S3C2400_GPC14_VD14 (0x02 << 28) #define S3C2410_GPC15 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 15) #define S3C2410_GPC15_INP (0x00 << 30) #define S3C2410_GPC15_OUTP (0x01 << 30) #define S3C2410_GPC15_VD7 (0x02 << 30) -#define S3C2400_GPC15_VD15 (0x02 << 30) - -#define S3C2410_GPC_PUPDIS(x) (1<<(x)) -/* - * S3C2410: Port D consists of 16 GPIO/Special function +/* Port D consists of 16 GPIO/Special function * * almost identical setup to port b, but the special functions are mostly * to do with the video system's data. - * - * S3C2400: Port D consists of 11 GPIO/Special function - * - * almost identical setup to port c */ #define S3C2410_GPDCON S3C2410_GPIOREG(0x30) #define S3C2410_GPDDAT S3C2410_GPIOREG(0x34) #define S3C2410_GPDUP S3C2410_GPIOREG(0x38) -#define S3C2400_GPDCON S3C2410_GPIOREG(0x20) -#define S3C2400_GPDDAT S3C2410_GPIOREG(0x24) -#define S3C2400_GPDUP S3C2410_GPIOREG(0x28) - #define S3C2410_GPD0 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 0) #define S3C2410_GPD0_INP (0x00 << 0) #define S3C2410_GPD0_OUTP (0x01 << 0) #define S3C2410_GPD0_VD8 (0x02 << 0) -#define S3C2400_GPD0_VFRAME (0x02 << 0) #define S3C2410_GPD1 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1) #define S3C2410_GPD1_INP (0x00 << 2) #define S3C2410_GPD1_OUTP (0x01 << 2) #define S3C2410_GPD1_VD9 (0x02 << 2) -#define S3C2400_GPD1_VM (0x02 << 2) #define S3C2410_GPD2 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2) #define S3C2410_GPD2_INP (0x00 << 4) #define S3C2410_GPD2_OUTP (0x01 << 4) #define S3C2410_GPD2_VD10 (0x02 << 4) -#define S3C2400_GPD2_VLINE (0x02 << 4) #define S3C2410_GPD3 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 3) #define S3C2410_GPD3_INP (0x00 << 6) #define S3C2410_GPD3_OUTP (0x01 << 6) #define S3C2410_GPD3_VD11 (0x02 << 6) -#define S3C2400_GPD3_VCLK (0x02 << 6) #define S3C2410_GPD4 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 4) #define S3C2410_GPD4_INP (0x00 << 8) #define S3C2410_GPD4_OUTP (0x01 << 8) #define S3C2410_GPD4_VD12 (0x02 << 8) -#define S3C2400_GPD4_LEND (0x02 << 8) #define S3C2410_GPD5 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 5) #define S3C2410_GPD5_INP (0x00 << 10) #define S3C2410_GPD5_OUTP (0x01 << 10) #define S3C2410_GPD5_VD13 (0x02 << 10) -#define S3C2400_GPD5_TOUT0 (0x02 << 10) #define S3C2410_GPD6 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 6) #define S3C2410_GPD6_INP (0x00 << 12) #define S3C2410_GPD6_OUTP (0x01 << 12) #define S3C2410_GPD6_VD14 (0x02 << 12) -#define S3C2400_GPD6_TOUT1 (0x02 << 12) #define S3C2410_GPD7 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 7) #define S3C2410_GPD7_INP (0x00 << 14) #define S3C2410_GPD7_OUTP (0x01 << 14) #define S3C2410_GPD7_VD15 (0x02 << 14) -#define S3C2400_GPD7_TOUT2 (0x02 << 14) #define S3C2410_GPD8 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 8) #define S3C2410_GPD8_INP (0x00 << 16) #define S3C2410_GPD8_OUTP (0x01 << 16) #define S3C2410_GPD8_VD16 (0x02 << 16) -#define S3C2400_GPD8_TOUT3 (0x02 << 16) #define S3C2410_GPD9 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 9) #define S3C2410_GPD9_INP (0x00 << 18) #define S3C2410_GPD9_OUTP (0x01 << 18) #define S3C2410_GPD9_VD17 (0x02 << 18) -#define S3C2400_GPD9_TCLK0 (0x02 << 18) -#define S3C2410_GPD9_MASK (0x03 << 18) #define S3C2410_GPD10 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 10) #define S3C2410_GPD10_INP (0x00 << 20) #define S3C2410_GPD10_OUTP (0x01 << 20) #define S3C2410_GPD10_VD18 (0x02 << 20) -#define S3C2400_GPD10_nWAIT (0x02 << 20) #define S3C2410_GPD11 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 11) #define S3C2410_GPD11_INP (0x00 << 22) @@ -515,56 +403,37 @@ #define S3C2410_GPD15_OUTP (0x01 << 30) #define S3C2410_GPD15_VD23 (0x02 << 30) -#define S3C2410_GPD_PUPDIS(x) (1<<(x)) - -/* S3C2410: - * Port E consists of 16 GPIO/Special function +/* Port E consists of 16 GPIO/Special function * * again, the same as port B, but dealing with I2S, SDI, and * more miscellaneous functions - * - * S3C2400: - * Port E consists of 12 GPIO/Special function - * - * GPIO / interrupt inputs */ #define S3C2410_GPECON S3C2410_GPIOREG(0x40) #define S3C2410_GPEDAT S3C2410_GPIOREG(0x44) #define S3C2410_GPEUP S3C2410_GPIOREG(0x48) -#define S3C2400_GPECON S3C2410_GPIOREG(0x2C) -#define S3C2400_GPEDAT S3C2410_GPIOREG(0x30) -#define S3C2400_GPEUP S3C2410_GPIOREG(0x34) - #define S3C2410_GPE0 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 0) #define S3C2410_GPE0_INP (0x00 << 0) #define S3C2410_GPE0_OUTP (0x01 << 0) #define S3C2410_GPE0_I2SLRCK (0x02 << 0) -#define S3C2400_GPE0_EINT0 (0x02 << 0) #define S3C2410_GPE0_MASK (0x03 << 0) #define S3C2410_GPE1 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 1) #define S3C2410_GPE1_INP (0x00 << 2) #define S3C2410_GPE1_OUTP (0x01 << 2) #define S3C2410_GPE1_I2SSCLK (0x02 << 2) -#define S3C2400_GPE1_EINT1 (0x02 << 2) -#define S3C2400_GPE1_nSS (0x03 << 2) #define S3C2410_GPE1_MASK (0x03 << 2) #define S3C2410_GPE2 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 2) #define S3C2410_GPE2_INP (0x00 << 4) #define S3C2410_GPE2_OUTP (0x01 << 4) #define S3C2410_GPE2_CDCLK (0x02 << 4) -#define S3C2400_GPE2_EINT2 (0x02 << 4) -#define S3C2400_GPE2_I2SSDI (0x03 << 4) #define S3C2410_GPE3 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 3) #define S3C2410_GPE3_INP (0x00 << 6) #define S3C2410_GPE3_OUTP (0x01 << 6) #define S3C2410_GPE3_I2SSDI (0x02 << 6) -#define S3C2400_GPE3_EINT3 (0x02 << 6) -#define S3C2400_GPE3_nCTS1 (0x03 << 6) #define S3C2410_GPE3_nSS0 (0x03 << 6) #define S3C2410_GPE3_MASK (0x03 << 6) @@ -572,8 +441,6 @@ #define S3C2410_GPE4_INP (0x00 << 8) #define S3C2410_GPE4_OUTP (0x01 << 8) #define S3C2410_GPE4_I2SSDO (0x02 << 8) -#define S3C2400_GPE4_EINT4 (0x02 << 8) -#define S3C2400_GPE4_nRTS1 (0x03 << 8) #define S3C2410_GPE4_I2SSDI (0x03 << 8) #define S3C2410_GPE4_MASK (0x03 << 8) @@ -581,46 +448,36 @@ #define S3C2410_GPE5_INP (0x00 << 10) #define S3C2410_GPE5_OUTP (0x01 << 10) #define S3C2410_GPE5_SDCLK (0x02 << 10) -#define S3C2400_GPE5_EINT5 (0x02 << 10) -#define S3C2400_GPE5_TCLK1 (0x03 << 10) #define S3C2410_GPE6 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 6) #define S3C2410_GPE6_INP (0x00 << 12) #define S3C2410_GPE6_OUTP (0x01 << 12) #define S3C2410_GPE6_SDCMD (0x02 << 12) -#define S3C2400_GPE6_EINT6 (0x02 << 12) #define S3C2410_GPE7 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7) #define S3C2410_GPE7_INP (0x00 << 14) #define S3C2410_GPE7_OUTP (0x01 << 14) #define S3C2410_GPE7_SDDAT0 (0x02 << 14) -#define S3C2400_GPE7_EINT7 (0x02 << 14) #define S3C2410_GPE8 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8) #define S3C2410_GPE8_INP (0x00 << 16) #define S3C2410_GPE8_OUTP (0x01 << 16) #define S3C2410_GPE8_SDDAT1 (0x02 << 16) -#define S3C2400_GPE8_nXDACK0 (0x02 << 16) #define S3C2410_GPE9 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9) #define S3C2410_GPE9_INP (0x00 << 18) #define S3C2410_GPE9_OUTP (0x01 << 18) #define S3C2410_GPE9_SDDAT2 (0x02 << 18) -#define S3C2400_GPE9_nXDACK1 (0x02 << 18) -#define S3C2400_GPE9_nXBACK (0x03 << 18) #define S3C2410_GPE10 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 10) #define S3C2410_GPE10_INP (0x00 << 20) #define S3C2410_GPE10_OUTP (0x01 << 20) #define S3C2410_GPE10_SDDAT3 (0x02 << 20) -#define S3C2400_GPE10_nXDREQ0 (0x02 << 20) #define S3C2410_GPE11 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11) #define S3C2410_GPE11_INP (0x00 << 22) #define S3C2410_GPE11_OUTP (0x01 << 22) #define S3C2410_GPE11_SPIMISO0 (0x02 << 22) -#define S3C2400_GPE11_nXDREQ1 (0x02 << 22) -#define S3C2400_GPE11_nXBREQ (0x03 << 22) #define S3C2410_GPE12 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 12) #define S3C2410_GPE12_INP (0x00 << 24) @@ -652,8 +509,7 @@ #define S3C2410_GPE_PUPDIS(x) (1<<(x)) -/* S3C2410: - * Port F consists of 8 GPIO/Special function +/* Port F consists of 8 GPIO/Special function * * GPIO / interrupt inputs * @@ -661,141 +517,100 @@ * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 undefined * * pull up works like all other ports. - * - * S3C2400: - * Port F consists of 7 GPIO/Special function - * - * GPIO/serial/misc pins */ #define S3C2410_GPFCON S3C2410_GPIOREG(0x50) #define S3C2410_GPFDAT S3C2410_GPIOREG(0x54) #define S3C2410_GPFUP S3C2410_GPIOREG(0x58) -#define S3C2400_GPFCON S3C2410_GPIOREG(0x38) -#define S3C2400_GPFDAT S3C2410_GPIOREG(0x3C) -#define S3C2400_GPFUP S3C2410_GPIOREG(0x40) - #define S3C2410_GPF0 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 0) #define S3C2410_GPF0_INP (0x00 << 0) #define S3C2410_GPF0_OUTP (0x01 << 0) #define S3C2410_GPF0_EINT0 (0x02 << 0) -#define S3C2400_GPF0_RXD0 (0x02 << 0) #define S3C2410_GPF1 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 1) #define S3C2410_GPF1_INP (0x00 << 2) #define S3C2410_GPF1_OUTP (0x01 << 2) #define S3C2410_GPF1_EINT1 (0x02 << 2) -#define S3C2400_GPF1_RXD1 (0x02 << 2) -#define S3C2400_GPF1_IICSDA (0x03 << 2) #define S3C2410_GPF2 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 2) #define S3C2410_GPF2_INP (0x00 << 4) #define S3C2410_GPF2_OUTP (0x01 << 4) #define S3C2410_GPF2_EINT2 (0x02 << 4) -#define S3C2400_GPF2_TXD0 (0x02 << 4) #define S3C2410_GPF3 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 3) #define S3C2410_GPF3_INP (0x00 << 6) #define S3C2410_GPF3_OUTP (0x01 << 6) #define S3C2410_GPF3_EINT3 (0x02 << 6) -#define S3C2400_GPF3_TXD1 (0x02 << 6) -#define S3C2400_GPF3_IICSCL (0x03 << 6) #define S3C2410_GPF4 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 4) #define S3C2410_GPF4_INP (0x00 << 8) #define S3C2410_GPF4_OUTP (0x01 << 8) #define S3C2410_GPF4_EINT4 (0x02 << 8) -#define S3C2400_GPF4_nRTS0 (0x02 << 8) -#define S3C2400_GPF4_nXBACK (0x03 << 8) #define S3C2410_GPF5 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 5) #define S3C2410_GPF5_INP (0x00 << 10) #define S3C2410_GPF5_OUTP (0x01 << 10) #define S3C2410_GPF5_EINT5 (0x02 << 10) -#define S3C2400_GPF5_nCTS0 (0x02 << 10) -#define S3C2400_GPF5_nXBREQ (0x03 << 10) #define S3C2410_GPF6 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 6) #define S3C2410_GPF6_INP (0x00 << 12) #define S3C2410_GPF6_OUTP (0x01 << 12) #define S3C2410_GPF6_EINT6 (0x02 << 12) -#define S3C2400_GPF6_CLKOUT (0x02 << 12) #define S3C2410_GPF7 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 7) #define S3C2410_GPF7_INP (0x00 << 14) #define S3C2410_GPF7_OUTP (0x01 << 14) #define S3C2410_GPF7_EINT7 (0x02 << 14) -#define S3C2410_GPF_PUPDIS(x) (1<<(x)) - -/* S3C2410: - * Port G consists of 8 GPIO/IRQ/Special function +/* Port G consists of 8 GPIO/IRQ/Special function * * GPGCON has 2 bits for each of the input pins on port F * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 special func * * pull up works like all other ports. - * - * S3C2400: - * Port G consists of 10 GPIO/Special function */ #define S3C2410_GPGCON S3C2410_GPIOREG(0x60) #define S3C2410_GPGDAT S3C2410_GPIOREG(0x64) #define S3C2410_GPGUP S3C2410_GPIOREG(0x68) -#define S3C2400_GPGCON S3C2410_GPIOREG(0x44) -#define S3C2400_GPGDAT S3C2410_GPIOREG(0x48) -#define S3C2400_GPGUP S3C2410_GPIOREG(0x4C) - #define S3C2410_GPG0 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 0) #define S3C2410_GPG0_INP (0x00 << 0) #define S3C2410_GPG0_OUTP (0x01 << 0) #define S3C2410_GPG0_EINT8 (0x02 << 0) -#define S3C2400_GPG0_I2SLRCK (0x02 << 0) #define S3C2410_GPG1 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 1) #define S3C2410_GPG1_INP (0x00 << 2) #define S3C2410_GPG1_OUTP (0x01 << 2) #define S3C2410_GPG1_EINT9 (0x02 << 2) -#define S3C2400_GPG1_I2SSCLK (0x02 << 2) #define S3C2410_GPG2 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 2) #define S3C2410_GPG2_INP (0x00 << 4) #define S3C2410_GPG2_OUTP (0x01 << 4) #define S3C2410_GPG2_EINT10 (0x02 << 4) -#define S3C2400_GPG2_CDCLK (0x02 << 4) #define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3) #define S3C2410_GPG3_INP (0x00 << 6) #define S3C2410_GPG3_OUTP (0x01 << 6) #define S3C2410_GPG3_EINT11 (0x02 << 6) -#define S3C2400_GPG3_I2SSDO (0x02 << 6) -#define S3C2400_GPG3_I2SSDI (0x03 << 6) #define S3C2410_GPG4 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 4) #define S3C2410_GPG4_INP (0x00 << 8) #define S3C2410_GPG4_OUTP (0x01 << 8) #define S3C2410_GPG4_EINT12 (0x02 << 8) -#define S3C2400_GPG4_MMCCLK (0x02 << 8) -#define S3C2400_GPG4_I2SSDI (0x03 << 8) #define S3C2410_GPG4_LCDPWREN (0x03 << 8) #define S3C2410_GPG5 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5) #define S3C2410_GPG5_INP (0x00 << 10) #define S3C2410_GPG5_OUTP (0x01 << 10) #define S3C2410_GPG5_EINT13 (0x02 << 10) -#define S3C2400_GPG5_MMCCMD (0x02 << 10) -#define S3C2400_GPG5_IICSDA (0x03 << 10) #define S3C2410_GPG5_SPIMISO1 (0x03 << 10) #define S3C2410_GPG6 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6) #define S3C2410_GPG6_INP (0x00 << 12) #define S3C2410_GPG6_OUTP (0x01 << 12) #define S3C2410_GPG6_EINT14 (0x02 << 12) -#define S3C2400_GPG6_MMCDAT (0x02 << 12) -#define S3C2400_GPG6_IICSCL (0x03 << 12) #define S3C2410_GPG6_SPIMOSI1 (0x03 << 12) #define S3C2410_GPG7 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 7) @@ -803,22 +618,16 @@ #define S3C2410_GPG7_OUTP (0x01 << 14) #define S3C2410_GPG7_EINT15 (0x02 << 14) #define S3C2410_GPG7_SPICLK1 (0x03 << 14) -#define S3C2400_GPG7_SPIMISO (0x02 << 14) -#define S3C2400_GPG7_IICSDA (0x03 << 14) #define S3C2410_GPG8 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 8) #define S3C2410_GPG8_INP (0x00 << 16) #define S3C2410_GPG8_OUTP (0x01 << 16) #define S3C2410_GPG8_EINT16 (0x02 << 16) -#define S3C2400_GPG8_SPIMOSI (0x02 << 16) -#define S3C2400_GPG8_IICSCL (0x03 << 16) #define S3C2410_GPG9 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 9) #define S3C2410_GPG9_INP (0x00 << 18) #define S3C2410_GPG9_OUTP (0x01 << 18) #define S3C2410_GPG9_EINT17 (0x02 << 18) -#define S3C2400_GPG9_SPICLK (0x02 << 18) -#define S3C2400_GPG9_MMCCLK (0x03 << 18) #define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10) #define S3C2410_GPG10_INP (0x00 << 20) @@ -928,27 +737,19 @@ #define S3C2410_GPH10_CLKOUT1 (0x02 << 20) /* miscellaneous control */ -#define S3C2400_MISCCR S3C2410_GPIOREG(0x54) + #define S3C2410_MISCCR S3C2410_GPIOREG(0x80) #define S3C2410_DCLKCON S3C2410_GPIOREG(0x84) /* see clock.h for dclk definitions */ /* pullup control on databus */ -#define S3C2410_MISCCR_SPUCR_HEN (0<<0) +#define S3C2410_MISCCR_SPUCR_HEN (0) #define S3C2410_MISCCR_SPUCR_HDIS (1<<0) -#define S3C2410_MISCCR_SPUCR_LEN (0<<1) +#define S3C2410_MISCCR_SPUCR_LEN (0) #define S3C2410_MISCCR_SPUCR_LDIS (1<<1) -#define S3C2400_MISCCR_SPUCR_LEN (0<<0) -#define S3C2400_MISCCR_SPUCR_LDIS (1<<0) -#define S3C2400_MISCCR_SPUCR_HEN (0<<1) -#define S3C2400_MISCCR_SPUCR_HDIS (1<<1) - -#define S3C2400_MISCCR_HZ_STOPEN (0<<2) -#define S3C2400_MISCCR_HZ_STOPPREV (1<<2) - -#define S3C2410_MISCCR_USBDEV (0<<3) +#define S3C2410_MISCCR_USBDEV (0) #define S3C2410_MISCCR_USBHOST (1<<3) #define S3C2410_MISCCR_CLK0_MPLL (0<<4) @@ -984,7 +785,7 @@ * * Samsung datasheet p9-25 */ -#define S3C2400_EXTINT0 S3C2410_GPIOREG(0x58) + #define S3C2410_EXTINT0 S3C2410_GPIOREG(0x88) #define S3C2410_EXTINT1 S3C2410_GPIOREG(0x8C) #define S3C2410_EXTINT2 S3C2410_GPIOREG(0x90) @@ -1032,21 +833,5 @@ #define S3C2410_GSTATUS2_OFFRESET (1<<1) #define S3C2410_GSTATUS2_PONRESET (1<<0) -/* open drain control register */ -#define S3C2400_OPENCR S3C2410_GPIOREG(0x50) - -#define S3C2400_OPENCR_OPC_RXD1DIS (0<<0) -#define S3C2400_OPENCR_OPC_RXD1EN (1<<0) -#define S3C2400_OPENCR_OPC_TXD1DIS (0<<1) -#define S3C2400_OPENCR_OPC_TXD1EN (1<<1) -#define S3C2400_OPENCR_OPC_CMDDIS (0<<2) -#define S3C2400_OPENCR_OPC_CMDEN (1<<2) -#define S3C2400_OPENCR_OPC_DATDIS (0<<3) -#define S3C2400_OPENCR_OPC_DATEN (1<<3) -#define S3C2400_OPENCR_OPC_MISODIS (0<<4) -#define S3C2400_OPENCR_OPC_MISOEN (1<<4) -#define S3C2400_OPENCR_OPC_MOSIDIS (0<<5) -#define S3C2400_OPENCR_OPC_MOSIEN (1<<5) - #endif /* __ASM_ARCH_REGS_GPIO_H */ diff --git a/trunk/include/asm-arm/arch-sa1100/io.h b/trunk/include/asm-arm/arch-sa1100/io.h index 040ccde7a11e..9d4fe6cf205b 100644 --- a/trunk/include/asm-arm/arch-sa1100/io.h +++ b/trunk/include/asm-arm/arch-sa1100/io.h @@ -10,6 +10,8 @@ #ifndef __ASM_ARM_ARCH_IO_H #define __ASM_ARM_ARCH_IO_H +#include + #define IO_SPACE_LIMIT 0xffffffff /* diff --git a/trunk/include/asm-arm/arch-sa1100/memory.h b/trunk/include/asm-arm/arch-sa1100/memory.h index 018a9f0e3986..0fc555b4c912 100644 --- a/trunk/include/asm-arm/arch-sa1100/memory.h +++ b/trunk/include/asm-arm/arch-sa1100/memory.h @@ -18,10 +18,20 @@ #ifndef __ASSEMBLY__ #ifdef CONFIG_SA1111 -void sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes); +static inline void +__arch_adjust_zones(int node, unsigned long *size, unsigned long *holes) +{ + unsigned int sz = SZ_1M >> PAGE_SHIFT; + + if (node != 0) + sz = 0; + + size[1] = size[0] - sz; + size[0] = sz; +} #define arch_adjust_zones(node, size, holes) \ - sa1111_adjust_zones(node, size, holes) + __arch_adjust_zones(node, size, holes) #define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_1M - 1) diff --git a/trunk/include/asm-arm/atomic.h b/trunk/include/asm-arm/atomic.h index d586f65c8228..2885972b0855 100644 --- a/trunk/include/asm-arm/atomic.h +++ b/trunk/include/asm-arm/atomic.h @@ -12,7 +12,6 @@ #define __ASM_ARM_ATOMIC_H #include -#include typedef struct { volatile int counter; } atomic_t; @@ -81,24 +80,6 @@ static inline int atomic_sub_return(int i, atomic_t *v) return result; } -static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) -{ - unsigned long oldval, res; - - do { - __asm__ __volatile__("@ atomic_cmpxchg\n" - "ldrex %1, [%2]\n" - "mov %0, #0\n" - "teq %1, %3\n" - "strexeq %0, %4, [%2]\n" - : "=&r" (res), "=&r" (oldval) - : "r" (&ptr->counter), "Ir" (old), "r" (new) - : "cc"); - } while (res); - - return oldval; -} - static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) { unsigned long tmp, tmp2; @@ -150,20 +131,6 @@ static inline int atomic_sub_return(int i, atomic_t *v) return val; } -static inline int atomic_cmpxchg(atomic_t *v, int old, int new) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (likely(ret == old)) - v->counter = new; - local_irq_restore(flags); - - return ret; -} - static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) { unsigned long flags; @@ -175,17 +142,6 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) #endif /* __LINUX_ARM_ARCH__ */ -static inline int atomic_add_unless(atomic_t *v, int a, int u) -{ - int c, old; - - c = atomic_read(v); - while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c) - c = old; - return c != u; -} -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - #define atomic_add(i, v) (void) atomic_add_return(i, v) #define atomic_inc(v) (void) atomic_add_return(1, v) #define atomic_sub(i, v) (void) atomic_sub_return(i, v) diff --git a/trunk/include/asm-arm/bitops.h b/trunk/include/asm-arm/bitops.h index d02de721ecc1..e007dd990da5 100644 --- a/trunk/include/asm-arm/bitops.h +++ b/trunk/include/asm-arm/bitops.h @@ -19,7 +19,6 @@ #ifdef __KERNEL__ -#include #include #define smp_mb__before_clear_bit() mb() @@ -332,7 +331,6 @@ static inline unsigned long __ffs(unsigned long word) */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) /* * ffs: find first bit set. This is defined the same way as @@ -352,7 +350,6 @@ static inline unsigned long __ffs(unsigned long word) #define fls(x) \ ( __builtin_constant_p(x) ? generic_fls(x) : \ ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) ) -#define fls64(x) generic_fls64(x) #define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); }) #define __ffs(x) (ffs(x) - 1) #define ffz(x) __ffs( ~(x) ) diff --git a/trunk/include/asm-arm/elf.h b/trunk/include/asm-arm/elf.h index 2d44b42d1847..7da97a937548 100644 --- a/trunk/include/asm-arm/elf.h +++ b/trunk/include/asm-arm/elf.h @@ -22,8 +22,6 @@ typedef unsigned long elf_freg_t[3]; #define R_ARM_NONE 0 #define R_ARM_PC24 1 #define R_ARM_ABS32 2 -#define R_ARM_CALL 28 -#define R_ARM_JUMP24 29 #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; diff --git a/trunk/include/asm-arm/hardware/amba_serial.h b/trunk/include/asm-arm/hardware/amba_serial.h index dc726ffccebd..71770aa6389f 100644 --- a/trunk/include/asm-arm/hardware/amba_serial.h +++ b/trunk/include/asm-arm/hardware/amba_serial.h @@ -50,11 +50,6 @@ #define UART011_ICR 0x44 /* Interrupt clear register. */ #define UART011_DMACR 0x48 /* DMA control register. */ -#define UART011_DR_OE (1 << 11) -#define UART011_DR_BE (1 << 10) -#define UART011_DR_PE (1 << 9) -#define UART011_DR_FE (1 << 8) - #define UART01x_RSR_OE 0x08 #define UART01x_RSR_BE 0x04 #define UART01x_RSR_PE 0x02 diff --git a/trunk/include/asm-arm/hardware/dec21285.h b/trunk/include/asm-arm/hardware/dec21285.h index 6685e3fb97b1..9049f0ddaecf 100644 --- a/trunk/include/asm-arm/hardware/dec21285.h +++ b/trunk/include/asm-arm/hardware/dec21285.h @@ -20,7 +20,7 @@ #include #ifndef __ASSEMBLY__ -#include +#include #define DC21285_IO(x) ((volatile unsigned long *)(ARMCSR_BASE+(x))) #else #define DC21285_IO(x) (x) diff --git a/trunk/include/asm-arm/io.h b/trunk/include/asm-arm/io.h index 0cf4d4f99600..2e6799632f12 100644 --- a/trunk/include/asm-arm/io.h +++ b/trunk/include/asm-arm/io.h @@ -42,9 +42,9 @@ extern void __raw_writesb(void __iomem *addr, const void *data, int bytelen); extern void __raw_writesw(void __iomem *addr, const void *data, int wordlen); extern void __raw_writesl(void __iomem *addr, const void *data, int longlen); -extern void __raw_readsb(const void __iomem *addr, void *data, int bytelen); -extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen); -extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); +extern void __raw_readsb(void __iomem *addr, void *data, int bytelen); +extern void __raw_readsw(void __iomem *addr, void *data, int wordlen); +extern void __raw_readsl(void __iomem *addr, void *data, int longlen); #define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a) = (v)) #define __raw_writew(v,a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v)) @@ -54,12 +54,6 @@ extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); #define __raw_readw(a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a)) #define __raw_readl(a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a)) -/* - * Architecture ioremap implementation. - */ -extern void __iomem * __ioremap(unsigned long, size_t, unsigned long); -extern void __iounmap(void __iomem *addr); - /* * Bad read/write accesses... */ @@ -262,15 +256,18 @@ check_signature(void __iomem *io_addr, const unsigned char *signature, * ioremap takes a PCI memory address, as specified in * Documentation/IO-mapping.txt. */ +extern void __iomem * __ioremap(unsigned long, size_t, unsigned long, unsigned long); +extern void __iounmap(void __iomem *addr); + #ifndef __arch_ioremap -#define ioremap(cookie,size) __ioremap(cookie,size,0) -#define ioremap_nocache(cookie,size) __ioremap(cookie,size,0) -#define ioremap_cached(cookie,size) __ioremap(cookie,size,L_PTE_CACHEABLE) +#define ioremap(cookie,size) __ioremap(cookie,size,0,1) +#define ioremap_nocache(cookie,size) __ioremap(cookie,size,0,1) +#define ioremap_cached(cookie,size) __ioremap(cookie,size,L_PTE_CACHEABLE,1) #define iounmap(cookie) __iounmap(cookie) #else -#define ioremap(cookie,size) __arch_ioremap((cookie),(size),0) -#define ioremap_nocache(cookie,size) __arch_ioremap((cookie),(size),0) -#define ioremap_cached(cookie,size) __arch_ioremap((cookie),(size),L_PTE_CACHEABLE) +#define ioremap(cookie,size) __arch_ioremap((cookie),(size),0,1) +#define ioremap_nocache(cookie,size) __arch_ioremap((cookie),(size),0,1) +#define ioremap_cached(cookie,size) __arch_ioremap((cookie),(size),L_PTE_CACHEABLE,1) #define iounmap(cookie) __arch_iounmap(cookie) #endif diff --git a/trunk/include/asm-arm/memory.h b/trunk/include/asm-arm/memory.h index 3e572364ee73..a547ee598c6c 100644 --- a/trunk/include/asm-arm/memory.h +++ b/trunk/include/asm-arm/memory.h @@ -122,7 +122,6 @@ static inline void *phys_to_virt(unsigned long x) */ #define __pa(x) __virt_to_phys((unsigned long)(x)) #define __va(x) ((void *)__phys_to_virt((unsigned long)(x))) -#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) /* * Virtual <-> DMA view memory address translations diff --git a/trunk/include/asm-arm/mmu_context.h b/trunk/include/asm-arm/mmu_context.h index 81c59facea3b..3d4b810d8c38 100644 --- a/trunk/include/asm-arm/mmu_context.h +++ b/trunk/include/asm-arm/mmu_context.h @@ -13,7 +13,6 @@ #ifndef __ASM_ARM_MMU_CONTEXT_H #define __ASM_ARM_MMU_CONTEXT_H -#include #include #include diff --git a/trunk/include/asm-arm/numnodes.h b/trunk/include/asm-arm/numnodes.h index 8df36818ebc9..5d2a1034a02e 100644 --- a/trunk/include/asm-arm/numnodes.h +++ b/trunk/include/asm-arm/numnodes.h @@ -17,8 +17,6 @@ #ifndef __ASM_ARM_NUMNODES_H #define __ASM_ARM_NUMNODES_H -#include - #ifndef NODES_SHIFT # define NODES_SHIFT 2 /* Normally, Max 4 Nodes */ #endif diff --git a/trunk/include/asm-arm/semaphore.h b/trunk/include/asm-arm/semaphore.h index d5dc624f452a..71ca7d412687 100644 --- a/trunk/include/asm-arm/semaphore.h +++ b/trunk/include/asm-arm/semaphore.h @@ -47,6 +47,11 @@ static inline void init_MUTEX_LOCKED(struct semaphore *sem) sema_init(sem, 0); } +static inline int sema_count(struct semaphore *sem) +{ + return atomic_read(&sem->count); +} + /* * special register calling convention */ diff --git a/trunk/include/asm-arm/spinlock.h b/trunk/include/asm-arm/spinlock.h index 43ad4e55878c..6ed4f916b166 100644 --- a/trunk/include/asm-arm/spinlock.h +++ b/trunk/include/asm-arm/spinlock.h @@ -30,9 +30,6 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) __asm__ __volatile__( "1: ldrex %0, [%1]\n" " teq %0, #0\n" -#ifdef CONFIG_CPU_32v6K -" wfene\n" -#endif " strexeq %0, %2, [%1]\n" " teqeq %0, #0\n" " bne 1b" @@ -68,11 +65,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) smp_mb(); __asm__ __volatile__( -" str %1, [%0]\n" -#ifdef CONFIG_CPU_32v6K -" mcr p15, 0, %1, c7, c10, 4\n" /* DSB */ -" sev" -#endif +" str %1, [%0]" : : "r" (&lock->lock), "r" (0) : "cc"); @@ -94,9 +87,6 @@ static inline void __raw_write_lock(raw_rwlock_t *rw) __asm__ __volatile__( "1: ldrex %0, [%1]\n" " teq %0, #0\n" -#ifdef CONFIG_CPU_32v6K -" wfene\n" -#endif " strexeq %0, %2, [%1]\n" " teq %0, #0\n" " bne 1b" @@ -132,11 +122,7 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) smp_mb(); __asm__ __volatile__( - "str %1, [%0]\n" -#ifdef CONFIG_CPU_32v6K -" mcr p15, 0, %1, c7, c10, 4\n" /* DSB */ -" sev\n" -#endif + "str %1, [%0]" : : "r" (&rw->lock), "r" (0) : "cc"); @@ -162,9 +148,6 @@ static inline void __raw_read_lock(raw_rwlock_t *rw) "1: ldrex %0, [%2]\n" " adds %0, %0, #1\n" " strexpl %1, %0, [%2]\n" -#ifdef CONFIG_CPU_32v6K -" wfemi\n" -#endif " rsbpls %0, %1, #0\n" " bmi 1b" : "=&r" (tmp), "=&r" (tmp2) @@ -186,11 +169,6 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw) " strex %1, %0, [%2]\n" " teq %1, #0\n" " bne 1b" -#ifdef CONFIG_CPU_32v6K -"\n cmp %0, #0\n" -" mcreq p15, 0, %0, c7, c10, 4\n" -" seveq" -#endif : "=&r" (tmp), "=&r" (tmp2) : "r" (&rw->lock) : "cc"); diff --git a/trunk/include/asm-arm/system.h b/trunk/include/asm-arm/system.h index 5621d61ebc07..8efa4ebdcacb 100644 --- a/trunk/include/asm-arm/system.h +++ b/trunk/include/asm-arm/system.h @@ -93,6 +93,8 @@ void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *), int sig, const char *name); +#include + #define xchg(ptr,x) \ ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) @@ -100,8 +102,6 @@ void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, extern asmlinkage void __backtrace(void); extern asmlinkage void c_backtrace(unsigned long fp, int pmode); - -struct mm_struct; extern void show_pte(struct mm_struct *mm, unsigned long addr); extern void __show_regs(struct pt_regs *); diff --git a/trunk/include/asm-arm/thread_info.h b/trunk/include/asm-arm/thread_info.h index 7c98557b717f..8252a4cd860f 100644 --- a/trunk/include/asm-arm/thread_info.h +++ b/trunk/include/asm-arm/thread_info.h @@ -12,7 +12,6 @@ #ifdef __KERNEL__ -#include #include #define THREAD_SIZE_ORDER 1 diff --git a/trunk/include/asm-arm/uaccess.h b/trunk/include/asm-arm/uaccess.h index 064f0f5e8e2b..a2fdad0138b3 100644 --- a/trunk/include/asm-arm/uaccess.h +++ b/trunk/include/asm-arm/uaccess.h @@ -100,6 +100,7 @@ static inline void set_fs (mm_segment_t fs) extern int __get_user_1(void *); extern int __get_user_2(void *); extern int __get_user_4(void *); +extern int __get_user_8(void *); extern int __get_user_bad(void); #define __get_user_x(__r2,__p,__e,__s,__i...) \ @@ -113,7 +114,7 @@ extern int __get_user_bad(void); #define get_user(x,p) \ ({ \ const register typeof(*(p)) __user *__p asm("r0") = (p);\ - register unsigned int __r2 asm("r2"); \ + register typeof(*(p)) __r2 asm("r2"); \ register int __e asm("r0"); \ switch (sizeof(*(__p))) { \ case 1: \ @@ -125,9 +126,12 @@ extern int __get_user_bad(void); case 4: \ __get_user_x(__r2, __p, __e, 4, "lr"); \ break; \ + case 8: \ + __get_user_x(__r2, __p, __e, 8, "lr"); \ + break; \ default: __e = __get_user_bad(); break; \ } \ - x = (typeof(*(p))) __r2; \ + x = __r2; \ __e; \ }) diff --git a/trunk/include/asm-arm26/atomic.h b/trunk/include/asm-arm26/atomic.h index a47cadc59686..4a88235c0e76 100644 --- a/trunk/include/asm-arm26/atomic.h +++ b/trunk/include/asm-arm26/atomic.h @@ -62,35 +62,6 @@ static inline int atomic_sub_return(int i, atomic_t *v) return val; } -static inline int atomic_cmpxchg(atomic_t *v, int old, int new) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (likely(ret == old)) - v->counter = new; - local_irq_restore(flags); - - return ret; -} - -static inline int atomic_add_unless(atomic_t *v, int a, int u) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (ret != u) - v->counter += a; - local_irq_restore(flags); - - return ret != u; -} -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) { unsigned long flags; diff --git a/trunk/include/asm-arm26/bitops.h b/trunk/include/asm-arm26/bitops.h index 15cc6f2da792..7d062fb2e343 100644 --- a/trunk/include/asm-arm26/bitops.h +++ b/trunk/include/asm-arm26/bitops.h @@ -259,7 +259,6 @@ static inline unsigned long __ffs(unsigned long word) */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) /* * ffs: find first bit set. This is defined the same way as diff --git a/trunk/include/asm-cris/atomic.h b/trunk/include/asm-cris/atomic.h index 683b05a57d88..8c2e78304523 100644 --- a/trunk/include/asm-cris/atomic.h +++ b/trunk/include/asm-cris/atomic.h @@ -123,33 +123,6 @@ static inline int atomic_inc_and_test(volatile atomic_t *v) return retval; } -static inline int atomic_cmpxchg(atomic_t *v, int old, int new) -{ - int ret; - unsigned long flags; - - cris_atomic_save(v, flags); - ret = v->counter; - if (likely(ret == old)) - v->counter = new; - cris_atomic_restore(v, flags); - return ret; -} - -static inline int atomic_add_unless(atomic_t *v, int a, int u) -{ - int ret; - unsigned long flags; - - cris_atomic_save(v, flags); - ret = v->counter; - if (ret != u) - v->counter += a; - cris_atomic_restore(v, flags); - return ret != u; -} -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - /* Atomic operations are already serializing */ #define smp_mb__before_atomic_dec() barrier() #define smp_mb__after_atomic_dec() barrier() diff --git a/trunk/include/asm-cris/bitops.h b/trunk/include/asm-cris/bitops.h index d3eb0f1e4208..1bddb3f3a289 100644 --- a/trunk/include/asm-cris/bitops.h +++ b/trunk/include/asm-cris/bitops.h @@ -240,7 +240,6 @@ static inline int test_bit(int nr, const volatile unsigned long *addr) */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) /* * hweightN - returns the hamming weight of a N-bit word diff --git a/trunk/include/asm-frv/atomic.h b/trunk/include/asm-frv/atomic.h index f6539ff569c5..e75968463428 100644 --- a/trunk/include/asm-frv/atomic.h +++ b/trunk/include/asm-frv/atomic.h @@ -414,16 +414,4 @@ extern uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new); #endif -#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) - -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - #endif /* _ASM_ATOMIC_H */ diff --git a/trunk/include/asm-frv/bitops.h b/trunk/include/asm-frv/bitops.h index 02be7b3a8a83..b664bd5b6663 100644 --- a/trunk/include/asm-frv/bitops.h +++ b/trunk/include/asm-frv/bitops.h @@ -228,7 +228,6 @@ static inline int find_next_zero_bit(const void *addr, int size, int offset) \ bit ? 33 - bit : bit; \ }) -#define fls64(x) generic_fls64(x) /* * Every architecture must define this function. It's the fastest diff --git a/trunk/include/asm-frv/hardirq.h b/trunk/include/asm-frv/hardirq.h index 685123981e8b..5248ca054909 100644 --- a/trunk/include/asm-frv/hardirq.h +++ b/trunk/include/asm-frv/hardirq.h @@ -14,7 +14,6 @@ #include #include -#include typedef struct { unsigned int __softirq_pending; diff --git a/trunk/include/asm-frv/ide.h b/trunk/include/asm-frv/ide.h index ae031eaa3dd2..f9caecf7e3c0 100644 --- a/trunk/include/asm-frv/ide.h +++ b/trunk/include/asm-frv/ide.h @@ -33,10 +33,10 @@ /* * some bits needed for parts of the IDE subsystem to compile */ -#define __ide_mm_insw(port, addr, n) insw((unsigned long) (port), addr, n) -#define __ide_mm_insl(port, addr, n) insl((unsigned long) (port), addr, n) -#define __ide_mm_outsw(port, addr, n) outsw((unsigned long) (port), addr, n) -#define __ide_mm_outsl(port, addr, n) outsl((unsigned long) (port), addr, n) +#define __ide_mm_insw(port, addr, n) insw(port, addr, n) +#define __ide_mm_insl(port, addr, n) insl(port, addr, n) +#define __ide_mm_outsw(port, addr, n) outsw(port, addr, n) +#define __ide_mm_outsl(port, addr, n) outsl(port, addr, n) #endif /* __KERNEL__ */ diff --git a/trunk/include/asm-frv/page.h b/trunk/include/asm-frv/page.h index b8221b611b5c..4feba567e7fd 100644 --- a/trunk/include/asm-frv/page.h +++ b/trunk/include/asm-frv/page.h @@ -47,8 +47,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; #define devmem_is_allowed(pfn) 1 -#define __pa(vaddr) virt_to_phys((void *) (unsigned long) (vaddr)) -#define __va(paddr) phys_to_virt((unsigned long) (paddr)) +#define __pa(vaddr) virt_to_phys((void *) vaddr) +#define __va(paddr) phys_to_virt((unsigned long) paddr) #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) diff --git a/trunk/include/asm-frv/semaphore.h b/trunk/include/asm-frv/semaphore.h index 907c5c3643cc..b18396288df1 100644 --- a/trunk/include/asm-frv/semaphore.h +++ b/trunk/include/asm-frv/semaphore.h @@ -20,7 +20,7 @@ #include #include -#define SEMAPHORE_DEBUG 0 +#define SEMAPHORE_DEBUG WAITQUEUE_DEBUG /* * the semaphore definition diff --git a/trunk/include/asm-frv/thread_info.h b/trunk/include/asm-frv/thread_info.h index 60f6b2aee76d..c8cba7836f0d 100644 --- a/trunk/include/asm-frv/thread_info.h +++ b/trunk/include/asm-frv/thread_info.h @@ -58,7 +58,7 @@ struct thread_info { #endif -#define PREEMPT_ACTIVE 0x10000000 +#define PREEMPT_ACTIVE 0x4000000 /* * macros/functions for gaining access to the thread information structure diff --git a/trunk/include/asm-generic/bitops.h b/trunk/include/asm-generic/bitops.h index 0e6d9852008c..ce31b739fd80 100644 --- a/trunk/include/asm-generic/bitops.h +++ b/trunk/include/asm-generic/bitops.h @@ -56,7 +56,6 @@ extern __inline__ int test_bit(int nr, const unsigned long * addr) */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) #ifdef __KERNEL__ diff --git a/trunk/include/asm-generic/sections.h b/trunk/include/asm-generic/sections.h index 0b49f9e070f1..886dbd116899 100644 --- a/trunk/include/asm-generic/sections.h +++ b/trunk/include/asm-generic/sections.h @@ -13,6 +13,5 @@ extern char _eextratext[] __attribute__((weak)); extern char _end[]; extern char __per_cpu_start[], __per_cpu_end[]; extern char __kprobes_text_start[], __kprobes_text_end[]; -extern char __initdata_begin[], __initdata_end[]; #endif /* _ASM_GENERIC_SECTIONS_H_ */ diff --git a/trunk/include/asm-h8300/atomic.h b/trunk/include/asm-h8300/atomic.h index f23d86819ea8..7230f6507995 100644 --- a/trunk/include/asm-h8300/atomic.h +++ b/trunk/include/asm-h8300/atomic.h @@ -82,33 +82,6 @@ static __inline__ int atomic_dec_and_test(atomic_t *v) return ret == 0; } -static inline int atomic_cmpxchg(atomic_t *v, int old, int new) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (likely(ret == old)) - v->counter = new; - local_irq_restore(flags); - return ret; -} - -static inline int atomic_add_unless(atomic_t *v, int a, int u) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (ret != u) - v->counter += a; - local_irq_restore(flags); - return ret != u; -} -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *v) { __asm__ __volatile__("stc ccr,r1l\n\t" diff --git a/trunk/include/asm-h8300/bitops.h b/trunk/include/asm-h8300/bitops.h index c0411ec9d651..5036f595f8c9 100644 --- a/trunk/include/asm-h8300/bitops.h +++ b/trunk/include/asm-h8300/bitops.h @@ -406,6 +406,5 @@ static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned lon #endif /* __KERNEL__ */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) #endif /* _H8300_BITOPS_H */ diff --git a/trunk/include/asm-i386/atomic.h b/trunk/include/asm-i386/atomic.h index c68557aa04b2..509720be772a 100644 --- a/trunk/include/asm-i386/atomic.h +++ b/trunk/include/asm-i386/atomic.h @@ -215,27 +215,6 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v) return atomic_add_return(-i,v); } -#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) - -/** - * atomic_add_unless - add unless the number is a given value - * @v: pointer of type atomic_t - * @a: the amount to add to v... - * @u: ...unless v is equal to u. - * - * Atomically adds @a to @v, so long as it was not @u. - * Returns non-zero if @v was not @u, and zero otherwise. - */ -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - #define atomic_inc_return(v) (atomic_add_return(1,v)) #define atomic_dec_return(v) (atomic_sub_return(1,v)) diff --git a/trunk/include/asm-i386/bitops.h b/trunk/include/asm-i386/bitops.h index 4807aa1d2e3d..ddf1739dc7fd 100644 --- a/trunk/include/asm-i386/bitops.h +++ b/trunk/include/asm-i386/bitops.h @@ -372,7 +372,6 @@ static inline unsigned long ffz(unsigned long word) */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) #ifdef __KERNEL__ diff --git a/trunk/include/asm-i386/mach-default/mach_reboot.h b/trunk/include/asm-i386/mach-default/mach_reboot.h index a955e57ad016..06ae4d81ba6a 100644 --- a/trunk/include/asm-i386/mach-default/mach_reboot.h +++ b/trunk/include/asm-i386/mach-default/mach_reboot.h @@ -19,7 +19,7 @@ static inline void kb_wait(void) static inline void mach_reboot(void) { int i; - for (i = 0; i < 10; i++) { + for (i = 0; i < 100; i++) { kb_wait(); udelay(50); outb(0x60, 0x64); /* write Controller Command Byte */ diff --git a/trunk/include/asm-i386/param.h b/trunk/include/asm-i386/param.h index 095580f3a45c..fa02e67ea86b 100644 --- a/trunk/include/asm-i386/param.h +++ b/trunk/include/asm-i386/param.h @@ -1,8 +1,9 @@ +#include + #ifndef _ASMi386_PARAM_H #define _ASMi386_PARAM_H #ifdef __KERNEL__ -# include # define HZ CONFIG_HZ /* Internal kernel timer frequency */ # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ diff --git a/trunk/include/asm-i386/processor.h b/trunk/include/asm-i386/processor.h index 5c96cf6dcb39..8c02b0318703 100644 --- a/trunk/include/asm-i386/processor.h +++ b/trunk/include/asm-i386/processor.h @@ -65,9 +65,7 @@ struct cpuinfo_x86 { int f00f_bug; int coma_bug; unsigned long loops_per_jiffy; - unsigned char x86_max_cores; /* cpuid returned max cores value */ - unsigned char booted_cores; /* number of cores as seen by OS */ - unsigned char apicid; + unsigned char x86_num_cores; } __attribute__((__aligned__(SMP_CACHE_BYTES))); #define X86_VENDOR_INTEL 0 diff --git a/trunk/include/asm-i386/signal.h b/trunk/include/asm-i386/signal.h index 76524b4052ac..cbb47d34aa31 100644 --- a/trunk/include/asm-i386/signal.h +++ b/trunk/include/asm-i386/signal.h @@ -159,37 +159,14 @@ typedef struct sigaltstack { #define __HAVE_ARCH_SIG_BITOPS -#define sigaddset(set,sig) \ - (__builtin_constant_p(sig) ? \ - __const_sigaddset((set),(sig)) : \ - __gen_sigaddset((set),(sig))) - -static __inline__ void __gen_sigaddset(sigset_t *set, int _sig) +static __inline__ void sigaddset(sigset_t *set, int _sig) { - __asm__("btsl %1,%0" : "+m"(*set) : "Ir"(_sig - 1) : "cc"); + __asm__("btsl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc"); } -static __inline__ void __const_sigaddset(sigset_t *set, int _sig) +static __inline__ void sigdelset(sigset_t *set, int _sig) { - unsigned long sig = _sig - 1; - set->sig[sig / _NSIG_BPW] |= 1 << (sig % _NSIG_BPW); -} - -#define sigdelset(set,sig) \ - (__builtin_constant_p(sig) ? \ - __const_sigdelset((set),(sig)) : \ - __gen_sigdelset((set),(sig))) - - -static __inline__ void __gen_sigdelset(sigset_t *set, int _sig) -{ - __asm__("btrl %1,%0" : "+m"(*set) : "Ir"(_sig - 1) : "cc"); -} - -static __inline__ void __const_sigdelset(sigset_t *set, int _sig) -{ - unsigned long sig = _sig - 1; - set->sig[sig / _NSIG_BPW] &= ~(1 << (sig % _NSIG_BPW)); + __asm__("btrl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc"); } static __inline__ int __const_sigismember(sigset_t *set, int _sig) diff --git a/trunk/include/asm-i386/system.h b/trunk/include/asm-i386/system.h index 772f85da1206..97d52ac49e46 100644 --- a/trunk/include/asm-i386/system.h +++ b/trunk/include/asm-i386/system.h @@ -263,10 +263,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz #ifdef CONFIG_X86_CMPXCHG #define __HAVE_ARCH_CMPXCHG 1 -#define cmpxchg(ptr,o,n)\ - ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ - (unsigned long)(n),sizeof(*(ptr)))) -#endif static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) @@ -295,42 +291,10 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, return old; } -#ifndef CONFIG_X86_CMPXCHG -/* - * Building a kernel capable running on 80386. It may be necessary to - * simulate the cmpxchg on the 80386 CPU. For that purpose we define - * a function for each of the sizes we support. - */ - -extern unsigned long cmpxchg_386_u8(volatile void *, u8, u8); -extern unsigned long cmpxchg_386_u16(volatile void *, u16, u16); -extern unsigned long cmpxchg_386_u32(volatile void *, u32, u32); - -static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old, - unsigned long new, int size) -{ - switch (size) { - case 1: - return cmpxchg_386_u8(ptr, old, new); - case 2: - return cmpxchg_386_u16(ptr, old, new); - case 4: - return cmpxchg_386_u32(ptr, old, new); - } - return old; -} +#define cmpxchg(ptr,o,n)\ + ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ + (unsigned long)(n),sizeof(*(ptr)))) -#define cmpxchg(ptr,o,n) \ -({ \ - __typeof__(*(ptr)) __ret; \ - if (likely(boot_cpu_data.x86 > 3)) \ - __ret = __cmpxchg((ptr), (unsigned long)(o), \ - (unsigned long)(n), sizeof(*(ptr))); \ - else \ - __ret = cmpxchg_386((ptr), (unsigned long)(o), \ - (unsigned long)(n), sizeof(*(ptr))); \ - __ret; \ -}) #endif #ifdef CONFIG_X86_CMPXCHG64 diff --git a/trunk/include/asm-ia64/atomic.h b/trunk/include/asm-ia64/atomic.h index 2fbebf85c31d..874a6f890e75 100644 --- a/trunk/include/asm-ia64/atomic.h +++ b/trunk/include/asm-ia64/atomic.h @@ -88,18 +88,6 @@ ia64_atomic64_sub (__s64 i, atomic64_t *v) return new; } -#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) - -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - #define atomic_add_return(i,v) \ ({ \ int __ia64_aar_i = (i); \ diff --git a/trunk/include/asm-ia64/bitops.h b/trunk/include/asm-ia64/bitops.h index 36d0fb95ea89..7232528e2d0c 100644 --- a/trunk/include/asm-ia64/bitops.h +++ b/trunk/include/asm-ia64/bitops.h @@ -345,7 +345,6 @@ fls (int t) x |= x >> 16; return ia64_popcnt(x); } -#define fls64(x) generic_fls64(x) /* * ffs: find first bit set. This is defined the same way as the libc and compiler builtin diff --git a/trunk/include/asm-ia64/delay.h b/trunk/include/asm-ia64/delay.h index bba702076391..57182d6f2b9a 100644 --- a/trunk/include/asm-ia64/delay.h +++ b/trunk/include/asm-ia64/delay.h @@ -84,6 +84,14 @@ __delay (unsigned long loops) ia64_delay_loop (loops - 1); } -extern void udelay (unsigned long usecs); +static __inline__ void +udelay (unsigned long usecs) +{ + unsigned long start = ia64_get_itc(); + unsigned long cycles = usecs*local_cpu_data->cyc_per_usec; + + while (ia64_get_itc() - start < cycles) + cpu_relax(); +} #endif /* _ASM_IA64_DELAY_H */ diff --git a/trunk/include/asm-ia64/ia32.h b/trunk/include/asm-ia64/ia32.h index f8044a1169cd..8e746b2413a6 100644 --- a/trunk/include/asm-ia64/ia32.h +++ b/trunk/include/asm-ia64/ia32.h @@ -13,8 +13,6 @@ # ifdef CONFIG_IA32_SUPPORT -#define IA32_PAGE_OFFSET 0xc0000000 - extern void ia32_cpu_init (void); extern void ia32_mem_init (void); extern void ia32_gdt_init (void); diff --git a/trunk/include/asm-ia64/local.h b/trunk/include/asm-ia64/local.h index dc519092ef4d..1dbd584ad851 100644 --- a/trunk/include/asm-ia64/local.h +++ b/trunk/include/asm-ia64/local.h @@ -17,8 +17,8 @@ typedef struct { #define local_set(l, i) atomic64_set(&(l)->val, i) #define local_inc(l) atomic64_inc(&(l)->val) #define local_dec(l) atomic64_dec(&(l)->val) -#define local_add(i, l) atomic64_add((i), &(l)->val) -#define local_sub(i, l) atomic64_sub((i), &(l)->val) +#define local_add(l) atomic64_add(&(l)->val) +#define local_sub(l) atomic64_sub(&(l)->val) /* Non-atomic variants, i.e., preemption disabled and won't be touched in interrupt, etc. */ diff --git a/trunk/include/asm-ia64/page.h b/trunk/include/asm-ia64/page.h index 5e6362a786b7..9dd9da105278 100644 --- a/trunk/include/asm-ia64/page.h +++ b/trunk/include/asm-ia64/page.h @@ -110,9 +110,8 @@ extern int ia64_pfn_valid (unsigned long pfn); # define pfn_to_page(pfn) (mem_map + (pfn)) #elif defined(CONFIG_DISCONTIGMEM) extern struct page *vmem_map; -extern unsigned long min_low_pfn; extern unsigned long max_low_pfn; -# define pfn_valid(pfn) (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) +# define pfn_valid(pfn) (((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) # define page_to_pfn(page) ((unsigned long) (page - vmem_map)) # define pfn_to_page(pfn) (vmem_map + (pfn)) #endif diff --git a/trunk/include/asm-ia64/sal.h b/trunk/include/asm-ia64/sal.h index 313cad0628d0..29df88bdd2bc 100644 --- a/trunk/include/asm-ia64/sal.h +++ b/trunk/include/asm-ia64/sal.h @@ -320,8 +320,7 @@ typedef struct sal_log_timestamp { typedef struct sal_log_record_header { u64 id; /* Unique monotonically increasing ID */ sal_log_revision_t revision; /* Major and Minor revision of header */ - u8 severity; /* Error Severity */ - u8 validation_bits; /* 0: platform_guid, 1: !timestamp */ + u16 severity; /* Error Severity */ u32 len; /* Length of this error log in bytes */ sal_log_timestamp_t timestamp; /* Timestamp */ efi_guid_t platform_guid; /* Unique OEM Platform ID */ diff --git a/trunk/include/asm-ia64/sn/pcidev.h b/trunk/include/asm-ia64/sn/pcidev.h index f65d222ca5e8..49711d00ad04 100644 --- a/trunk/include/asm-ia64/sn/pcidev.h +++ b/trunk/include/asm-ia64/sn/pcidev.h @@ -3,27 +3,15 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_PCI_PCIDEV_H #define _ASM_IA64_SN_PCI_PCIDEV_H #include -/* - * In ia64, pci_dev->sysdata must be a *pci_controller. To provide access to - * the pcidev_info structs for all devices under a controller, we extend the - * definition of pci_controller, via sn_pci_controller, to include a list - * of pcidev_info. - */ -struct sn_pci_controller { - struct pci_controller pci_controller; - struct list_head pcidev_info; -}; - -#define SN_PCI_CONTROLLER(dev) ((struct sn_pci_controller *) dev->sysdata) - -#define SN_PCIDEV_INFO(dev) sn_pcidev_info_get(dev) +#define SN_PCIDEV_INFO(pci_dev) \ + ((struct pcidev_info *)(pci_dev)->sysdata) #define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \ (struct pcibus_info *)((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data)) @@ -65,13 +53,11 @@ struct pcidev_info { struct sn_irq_info *pdi_sn_irq_info; struct sn_pcibus_provider *pdi_provider; /* sn pci ops */ struct pci_dev *host_pci_dev; /* host bus link */ - struct list_head pdi_list; /* List of pcidev_info */ }; extern void sn_irq_fixup(struct pci_dev *pci_dev, struct sn_irq_info *sn_irq_info); extern void sn_irq_unfixup(struct pci_dev *pci_dev); -extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *); extern void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus); extern void sn_bus_store_sysdata(struct pci_dev *dev); diff --git a/trunk/include/asm-ia64/sn/sn_sal.h b/trunk/include/asm-ia64/sn/sn_sal.h index 2a8b0d92a5d6..3f7564dc0aa9 100644 --- a/trunk/include/asm-ia64/sn/sn_sal.h +++ b/trunk/include/asm-ia64/sn/sn_sal.h @@ -56,7 +56,6 @@ #define SN_SAL_BUS_CONFIG 0x02000037 #define SN_SAL_SYS_SERIAL_GET 0x02000038 #define SN_SAL_PARTITION_SERIAL_GET 0x02000039 -#define SN_SAL_SYSCTL_PARTITION_GET 0x0200003a #define SN_SAL_SYSTEM_POWER_DOWN 0x0200003b #define SN_SAL_GET_MASTER_BASEIO_NASID 0x0200003c #define SN_SAL_COHERENCE 0x0200003d @@ -581,21 +580,6 @@ sn_partition_serial_number_val(void) { return sn_partition_serial_number; } -/* - * Returns the partition id of the nasid passed in as an argument, - * or INVALID_PARTID if the partition id cannot be retrieved. - */ -static inline partid_t -ia64_sn_sysctl_partition_get(nasid_t nasid) -{ - struct ia64_sal_retval ret_stuff; - SAL_CALL(ret_stuff, SN_SAL_SYSCTL_PARTITION_GET, nasid, - 0, 0, 0, 0, 0, 0); - if (ret_stuff.status != 0) - return -1; - return ((partid_t)ret_stuff.v0); -} - /* * Returns the physical address of the partition's reserved page through * an iterative number of calls. @@ -1034,24 +1018,6 @@ ia64_sn_get_sn_info(int fc, u8 *shubtype, u16 *nasid_bitmask, u8 *nasid_shift, ret_stuff.v2 = 0; SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_SN_INFO, fc, 0, 0, 0, 0, 0, 0); -/***** BEGIN HACK - temp til old proms no longer supported ********/ - if (ret_stuff.status == SALRET_NOT_IMPLEMENTED) { - int nasid = get_sapicid() & 0xfff;; -#define SH_SHUB_ID_NODES_PER_BIT_MASK 0x001f000000000000UL -#define SH_SHUB_ID_NODES_PER_BIT_SHFT 48 - if (shubtype) *shubtype = 0; - if (nasid_bitmask) *nasid_bitmask = 0x7ff; - if (nasid_shift) *nasid_shift = 38; - if (systemsize) *systemsize = 10; - if (sharing_domain_size) *sharing_domain_size = 8; - if (partid) *partid = ia64_sn_sysctl_partition_get(nasid); - if (coher) *coher = nasid >> 9; - if (reg) *reg = (HUB_L((u64 *) LOCAL_MMR_ADDR(SH1_SHUB_ID)) & SH_SHUB_ID_NODES_PER_BIT_MASK) >> - SH_SHUB_ID_NODES_PER_BIT_SHFT; - return 0; - } -/***** END HACK *******/ - if (ret_stuff.status < 0) return ret_stuff.status; diff --git a/trunk/include/asm-ia64/sn/tioce.h b/trunk/include/asm-ia64/sn/tioce.h index ecaddf960086..22879853e46c 100644 --- a/trunk/include/asm-ia64/sn/tioce.h +++ b/trunk/include/asm-ia64/sn/tioce.h @@ -1,10 +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) 2003-2005 Silicon Graphics, Inc. All rights reserved. - */ +/************************************************************************** + * * + * Unpublished copyright (c) 2005, Silicon Graphics, Inc. * + * THIS IS UNPUBLISHED CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF SGI. * + * * + * The copyright notice above does not evidence any actual or intended * + * publication or disclosure of this source code, which includes * + * information that is confidential and/or proprietary, and is a trade * + * secret, of Silicon Graphics, Inc. ANY REPRODUCTION, MODIFICATION, * + * DISTRIBUTION, PUBLIC PERFORMANCE, OR PUBLIC DISPLAY OF OR THROUGH * + * USE OF THIS SOURCE CODE WITHOUT THE EXPRESS WRITTEN CONSENT OF * + * SILICON GRAPHICS, INC. IS STRICTLY PROHIBITED, AND IN VIOLATION OF * + * APPLICABLE LAWS AND INTERNATIONAL TREATIES. THE RECEIPT OR * + * POSSESSION OF THIS SOURCE CODE AND/OR RELATED INFORMATION DOES NOT * + * CONVEY OR IMPLY ANY RIGHTS TO REPRODUCE, DISCLOSE OR DISTRIBUTE ITS * + * CONTENTS, OR TO MANUFACTURE, USE, OR SELL ANYTHING THAT IT MAY * + * DESCRIBE, IN WHOLE OR IN PART. * + * * + **************************************************************************/ #ifndef __ASM_IA64_SN_TIOCE_H__ #define __ASM_IA64_SN_TIOCE_H__ diff --git a/trunk/include/asm-ia64/sn/tioce_provider.h b/trunk/include/asm-ia64/sn/tioce_provider.h index cb414908671d..7f63dec0a79a 100644 --- a/trunk/include/asm-ia64/sn/tioce_provider.h +++ b/trunk/include/asm-ia64/sn/tioce_provider.h @@ -1,10 +1,13 @@ -/* - * 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) 2003-2005 Silicon Graphics, Inc. All rights reserved. - */ +/************************************************************************** + * Copyright (C) 2005, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ #ifndef _ASM_IA64_SN_CE_PROVIDER_H #define _ASM_IA64_SN_CE_PROVIDER_H diff --git a/trunk/include/asm-ia64/spinlock.h b/trunk/include/asm-ia64/spinlock.h index 0c91a76c5ea3..5b78611411c3 100644 --- a/trunk/include/asm-ia64/spinlock.h +++ b/trunk/include/asm-ia64/spinlock.h @@ -201,16 +201,6 @@ static inline void __raw_write_unlock(raw_rwlock_t *x) #endif /* !ASM_SUPPORTED */ -static inline int __raw_read_trylock(raw_rwlock_t *x) -{ - union { - raw_rwlock_t lock; - __u32 word; - } old, new; - old.lock = new.lock = *x; - old.lock.write_lock = new.lock.write_lock = 0; - ++new.lock.read_counter; - return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word; -} +#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) #endif /* _ASM_IA64_SPINLOCK_H */ diff --git a/trunk/include/asm-ia64/topology.h b/trunk/include/asm-ia64/topology.h index f7c330467e7e..a9f738bf18a7 100644 --- a/trunk/include/asm-ia64/topology.h +++ b/trunk/include/asm-ia64/topology.h @@ -38,7 +38,7 @@ /* * Returns the number of the first CPU on Node 'node'. */ -#define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node))) +#define node_to_first_cpu(node) (__ffs(node_to_cpumask(node))) /* * Determines the node for a given pci bus diff --git a/trunk/include/asm-m32r/atomic.h b/trunk/include/asm-m32r/atomic.h index ef1fb8ea4726..bfff69a49936 100644 --- a/trunk/include/asm-m32r/atomic.h +++ b/trunk/include/asm-m32r/atomic.h @@ -242,27 +242,6 @@ static __inline__ int atomic_dec_return(atomic_t *v) */ #define atomic_add_negative(i,v) (atomic_add_return((i), (v)) < 0) -#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) - -/** - * atomic_add_unless - add unless the number is a given value - * @v: pointer of type atomic_t - * @a: the amount to add to v... - * @u: ...unless v is equal to u. - * - * Atomically adds @a to @v, so long as it was not @u. - * Returns non-zero if @v was not @u, and zero otherwise. - */ -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - static __inline__ void atomic_clear_mask(unsigned long mask, atomic_t *addr) { unsigned long flags; diff --git a/trunk/include/asm-m32r/bitops.h b/trunk/include/asm-m32r/bitops.h index abea2fdd8689..e78443981349 100644 --- a/trunk/include/asm-m32r/bitops.h +++ b/trunk/include/asm-m32r/bitops.h @@ -465,7 +465,6 @@ static __inline__ unsigned long __ffs(unsigned long word) * fls: find last bit set. */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) #ifdef __KERNEL__ diff --git a/trunk/include/asm-m32r/ide.h b/trunk/include/asm-m32r/ide.h index f7aa96970d18..194393bd8beb 100644 --- a/trunk/include/asm-m32r/ide.h +++ b/trunk/include/asm-m32r/ide.h @@ -25,21 +25,18 @@ # endif #endif -#include - +#if defined(CONFIG_PLAT_M32700UT) +#include +#include +#endif #define IDE_ARCH_OBSOLETE_DEFAULTS static __inline__ int ide_default_irq(unsigned long base) { switch (base) { -#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) - case 0x1f0: return PLD_IRQ_CFIREQ; - default: - return 0; -#elif defined(CONFIG_PLAT_MAPPI3) +#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3) case 0x1f0: return PLD_IRQ_CFIREQ; - case 0x170: return PLD_IRQ_IDEIREQ; default: return 0; #else diff --git a/trunk/include/asm-m32r/mappi3/mappi3_pld.h b/trunk/include/asm-m32r/mappi3/mappi3_pld.h index 1d3c25d61bcb..3f1551f7f01f 100644 --- a/trunk/include/asm-m32r/mappi3/mappi3_pld.h +++ b/trunk/include/asm-m32r/mappi3/mappi3_pld.h @@ -59,7 +59,7 @@ #define M32R_IRQ_I2C (28) /* I2C-BUS */ #define PLD_IRQ_CFIREQ (6) /* INT5 CFC Card Interrupt */ #define PLD_IRQ_CFC_INSERT (7) /* INT6 CFC Card Insert */ -#define PLD_IRQ_IDEIREQ (8) /* INT7 IDE Interrupt */ +#define PLD_IRQ_CFC_EJECT (8) /* INT7 CFC Card Eject */ #define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */ #define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */ diff --git a/trunk/include/asm-m32r/system.h b/trunk/include/asm-m32r/system.h index 5eee832b73a0..73348c3f858b 100644 --- a/trunk/include/asm-m32r/system.h +++ b/trunk/include/asm-m32r/system.h @@ -11,7 +11,6 @@ */ #include -#include #ifdef __KERNEL__ @@ -133,6 +132,8 @@ static inline void local_irq_disable(void) !(flags & 0x40); \ }) +#endif /* __KERNEL__ */ + #define nop() __asm__ __volatile__ ("nop" : : ) #define xchg(ptr,x) \ @@ -212,67 +213,6 @@ static __inline__ unsigned long __xchg(unsigned long x, volatile void * ptr, return (tmp); } -#define __HAVE_ARCH_CMPXCHG 1 - -static __inline__ unsigned long -__cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new) -{ - unsigned long flags; - unsigned int retval; - - local_irq_save(flags); - __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r4", "%1") - M32R_LOCK" %0, @%1; \n" - " bne %0, %2, 1f; \n" - M32R_UNLOCK" %3, @%1; \n" - " bra 2f; \n" - " .fillinsn \n" - "1:" - M32R_UNLOCK" %2, @%1; \n" - " .fillinsn \n" - "2:" - : "=&r" (retval) - : "r" (p), "r" (old), "r" (new) - : "cbit", "memory" -#ifdef CONFIG_CHIP_M32700_TS1 - , "r4" -#endif /* CONFIG_CHIP_M32700_TS1 */ - ); - local_irq_restore(flags); - - return retval; -} - -/* This function doesn't exist, so you'll get a linker error - if something tries to do an invalid cmpxchg(). */ -extern void __cmpxchg_called_with_bad_pointer(void); - -static __inline__ unsigned long -__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) -{ - switch (size) { - case 4: - return __cmpxchg_u32(ptr, old, new); -#if 0 /* we don't have __cmpxchg_u64 */ - case 8: - return __cmpxchg_u64(ptr, old, new); -#endif /* 0 */ - } - __cmpxchg_called_with_bad_pointer(); - return old; -} - -#define cmpxchg(ptr,o,n) \ - ({ \ - __typeof__(*(ptr)) _o_ = (o); \ - __typeof__(*(ptr)) _n_ = (n); \ - (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ - (unsigned long)_n_, sizeof(*(ptr))); \ - }) - -#endif /* __KERNEL__ */ - /* * Memory barrier. * diff --git a/trunk/include/asm-m68k/atomic.h b/trunk/include/asm-m68k/atomic.h index e3c962eeabf3..38f3043e7fe1 100644 --- a/trunk/include/asm-m68k/atomic.h +++ b/trunk/include/asm-m68k/atomic.h @@ -139,18 +139,6 @@ static inline void atomic_set_mask(unsigned long mask, unsigned long *v) __asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask)); } -#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) - -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - /* Atomic operations are already serializing */ #define smp_mb__before_atomic_dec() barrier() #define smp_mb__after_atomic_dec() barrier() diff --git a/trunk/include/asm-m68k/bitops.h b/trunk/include/asm-m68k/bitops.h index 13f4c0048463..b1bcf7c66516 100644 --- a/trunk/include/asm-m68k/bitops.h +++ b/trunk/include/asm-m68k/bitops.h @@ -310,7 +310,6 @@ static inline int fls(int x) return 32 - cnt; } -#define fls64(x) generic_fls64(x) /* * Every architecture must define this function. It's the fastest diff --git a/trunk/include/asm-m68k/processor.h b/trunk/include/asm-m68k/processor.h index 7982285e84ed..df1575db32af 100644 --- a/trunk/include/asm-m68k/processor.h +++ b/trunk/include/asm-m68k/processor.h @@ -14,7 +14,6 @@ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) #include -#include #include #include #include @@ -56,6 +55,17 @@ static inline void wrusp(unsigned long usp) #endif #define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr) +struct task_work { + unsigned char sigpending; + unsigned char notify_resume; /* request for notification on + userspace execution resumption */ + char need_resched; + unsigned char delayed_trace; /* single step a syscall */ + unsigned char syscall_trace; /* count of syscall interceptors */ + unsigned char memdie; /* task was selected to be killed */ + unsigned char pad[2]; +}; + struct thread_struct { unsigned long ksp; /* kernel stack pointer */ unsigned long usp; /* user stack pointer */ @@ -68,7 +78,7 @@ struct thread_struct { unsigned long fp[8*3]; unsigned long fpcntl[3]; /* fp control regs */ unsigned char fpstate[FPSTATESIZE]; /* floating point state */ - struct thread_info info; + struct task_work work; }; #define INIT_THREAD { \ diff --git a/trunk/include/asm-m68k/thread_info.h b/trunk/include/asm-m68k/thread_info.h index 9532ca3c45cb..2aed24f6fd2e 100644 --- a/trunk/include/asm-m68k/thread_info.h +++ b/trunk/include/asm-m68k/thread_info.h @@ -2,15 +2,17 @@ #define _ASM_M68K_THREAD_INFO_H #include +#include #include struct thread_info { struct task_struct *task; /* main task structure */ - unsigned long flags; struct exec_domain *exec_domain; /* execution domain */ int preempt_count; /* 0 => preemptable, <0 => BUG */ __u32 cpu; /* should always be 0 on m68k */ struct restart_block restart_block; + + __u8 supervisor_stack[0]; }; #define PREEMPT_ACTIVE 0x4000000 @@ -33,29 +35,84 @@ struct thread_info { #define free_thread_info(ti) free_pages((unsigned long)(ti),1) #endif /* PAGE_SHIFT == 13 */ -#define init_thread_info (init_task.thread.info) +//#define init_thread_info (init_task.thread.info) #define init_stack (init_thread_union.stack) -#define task_thread_info(tsk) (&(tsk)->thread.info) -#define current_thread_info() task_thread_info(current) +#define current_thread_info() (current->thread_info) + #define __HAVE_THREAD_FUNCTIONS -#define setup_thread_stack(p, org) ({ \ - *(struct task_struct **)(p)->thread_info = (p); \ - task_thread_info(p)->task = (p); \ -}) +#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ +#define TIF_DELAYED_TRACE 1 /* single step a syscall */ +#define TIF_NOTIFY_RESUME 2 /* resumption notification requested */ +#define TIF_SIGPENDING 3 /* signal pending */ +#define TIF_NEED_RESCHED 4 /* rescheduling necessary */ +#define TIF_MEMDIE 5 -#define end_of_stack(p) ((unsigned long *)(p)->thread_info + 1) +extern int thread_flag_fixme(void); -/* entry.S relies on these definitions! - * bits 0-7 are tested at every exception exit - * bits 8-15 are also tested at syscall exit +/* + * flag set/clear/test wrappers + * - pass TIF_xxxx constants to these functions */ -#define TIF_SIGPENDING 6 /* signal pending */ -#define TIF_NEED_RESCHED 7 /* rescheduling necessary */ -#define TIF_DELAYED_TRACE 14 /* single step a syscall */ -#define TIF_SYSCALL_TRACE 15 /* syscall trace active */ -#define TIF_MEMDIE 16 + +#define __set_tsk_thread_flag(tsk, flag, val) ({ \ + switch (flag) { \ + case TIF_SIGPENDING: \ + tsk->thread.work.sigpending = val; \ + break; \ + case TIF_NEED_RESCHED: \ + tsk->thread.work.need_resched = val; \ + break; \ + case TIF_SYSCALL_TRACE: \ + tsk->thread.work.syscall_trace = val; \ + break; \ + case TIF_MEMDIE: \ + tsk->thread.work.memdie = val; \ + break; \ + default: \ + thread_flag_fixme(); \ + } \ +}) + +#define __get_tsk_thread_flag(tsk, flag) ({ \ + int ___res; \ + switch (flag) { \ + case TIF_SIGPENDING: \ + ___res = tsk->thread.work.sigpending; \ + break; \ + case TIF_NEED_RESCHED: \ + ___res = tsk->thread.work.need_resched; \ + break; \ + case TIF_SYSCALL_TRACE: \ + ___res = tsk->thread.work.syscall_trace;\ + break; \ + case TIF_MEMDIE: \ + ___res = tsk->thread.work.memdie;\ + break; \ + default: \ + ___res = thread_flag_fixme(); \ + } \ + ___res; \ +}) + +#define __get_set_tsk_thread_flag(tsk, flag, val) ({ \ + int __res = __get_tsk_thread_flag(tsk, flag); \ + __set_tsk_thread_flag(tsk, flag, val); \ + __res; \ +}) + +#define set_tsk_thread_flag(tsk, flag) __set_tsk_thread_flag(tsk, flag, ~0) +#define clear_tsk_thread_flag(tsk, flag) __set_tsk_thread_flag(tsk, flag, 0) +#define test_and_set_tsk_thread_flag(tsk, flag) __get_set_tsk_thread_flag(tsk, flag, ~0) +#define test_tsk_thread_flag(tsk, flag) __get_tsk_thread_flag(tsk, flag) + +#define set_thread_flag(flag) set_tsk_thread_flag(current, flag) +#define clear_thread_flag(flag) clear_tsk_thread_flag(current, flag) +#define test_thread_flag(flag) test_tsk_thread_flag(current, flag) + +#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) +#define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED) #endif /* _ASM_M68K_THREAD_INFO_H */ diff --git a/trunk/include/asm-m68knommu/atomic.h b/trunk/include/asm-m68knommu/atomic.h index 3c1cc153c415..a83631ed8c8f 100644 --- a/trunk/include/asm-m68knommu/atomic.h +++ b/trunk/include/asm-m68knommu/atomic.h @@ -128,18 +128,6 @@ static inline int atomic_sub_return(int i, atomic_t * v) return temp; } -#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) - -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - #define atomic_dec_return(v) atomic_sub_return(1,(v)) #define atomic_inc_return(v) atomic_add_return(1,(v)) diff --git a/trunk/include/asm-m68knommu/bitops.h b/trunk/include/asm-m68knommu/bitops.h index 4058dd086a02..c42f88a9b9f9 100644 --- a/trunk/include/asm-m68knommu/bitops.h +++ b/trunk/include/asm-m68knommu/bitops.h @@ -499,6 +499,5 @@ static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned lon * fls: find last bit set. */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) #endif /* _M68KNOMMU_BITOPS_H */ diff --git a/trunk/include/asm-mips/atomic.h b/trunk/include/asm-mips/atomic.h index 55c37c106ef0..6202eb8a14b7 100644 --- a/trunk/include/asm-mips/atomic.h +++ b/trunk/include/asm-mips/atomic.h @@ -231,12 +231,11 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v) } /* - * atomic_sub_if_positive - conditionally subtract integer from atomic variable - * @i: integer value to subtract + * atomic_sub_if_positive - add integer to atomic variable * @v: pointer of type atomic_t * - * Atomically test @v and subtract @i if @v is greater or equal than @i. - * The function returns the old value of @v minus @i. + * Atomically test @v and decrement if it is greater than 0. + * The function returns the old value of @v minus 1. */ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) { @@ -288,27 +287,6 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) return result; } -#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) - -/** - * atomic_add_unless - add unless the number is a given value - * @v: pointer of type atomic_t - * @a: the amount to add to v... - * @u: ...unless v is equal to u. - * - * Atomically adds @a to @v, so long as it was not @u. - * Returns non-zero if @v was not @u, and zero otherwise. - */ -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - #define atomic_dec_return(v) atomic_sub_return(1,(v)) #define atomic_inc_return(v) atomic_add_return(1,(v)) @@ -578,12 +556,11 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) } /* - * atomic64_sub_if_positive - conditionally subtract integer from atomic variable - * @i: integer value to subtract + * atomic64_sub_if_positive - add integer to atomic variable * @v: pointer of type atomic64_t * - * Atomically test @v and subtract @i if @v is greater or equal than @i. - * The function returns the old value of @v minus @i. + * Atomically test @v and decrement if it is greater than 0. + * The function returns the old value of @v minus 1. */ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) { diff --git a/trunk/include/asm-mips/bitops.h b/trunk/include/asm-mips/bitops.h index 3b0c8aaf6e8b..5496f9064a6a 100644 --- a/trunk/include/asm-mips/bitops.h +++ b/trunk/include/asm-mips/bitops.h @@ -695,7 +695,7 @@ static inline unsigned long fls(unsigned long word) return flz(~word) + 1; } -#define fls64(x) generic_fls64(x) + /* * find_next_zero_bit - find the first zero bit in a memory region diff --git a/trunk/include/asm-mips/io.h b/trunk/include/asm-mips/io.h index d42685747e7d..3061870b7f6c 100644 --- a/trunk/include/asm-mips/io.h +++ b/trunk/include/asm-mips/io.h @@ -459,10 +459,10 @@ __BUILDIO(q, u64) #define __BUILD_MEMORY_STRING(bwlq, type) \ \ -static inline void writes##bwlq(volatile void __iomem *mem, \ - const void *addr, unsigned int count) \ +static inline void writes##bwlq(volatile void __iomem *mem, void *addr, \ + unsigned int count) \ { \ - const volatile type *__addr = addr; \ + volatile type *__addr = addr; \ \ while (count--) { \ mem_write##bwlq(*__addr, mem); \ diff --git a/trunk/include/asm-mips/ip32/crime.h b/trunk/include/asm-mips/ip32/crime.h index a13702fafa85..152879bae20f 100644 --- a/trunk/include/asm-mips/ip32/crime.h +++ b/trunk/include/asm-mips/ip32/crime.h @@ -154,7 +154,7 @@ struct sgi_crime { #define CRIME_MEM_ERROR_ECC_REPL_MASK 0xffffffff }; -extern struct sgi_crime __iomem *crime; +extern struct sgi_crime *crime; #define CRIME_HI_MEM_BASE 0x40000000 /* this is where whole 1G of RAM is mapped */ diff --git a/trunk/include/asm-mips/ip32/mace.h b/trunk/include/asm-mips/ip32/mace.h index 990082c81f39..5bdc51d85b6c 100644 --- a/trunk/include/asm-mips/ip32/mace.h +++ b/trunk/include/asm-mips/ip32/mace.h @@ -150,34 +150,24 @@ struct mace_audio { /* register definitions for parallel port DMA */ struct mace_parport { - /* 0 - do nothing, - * 1 - pulse terminal count to the device after buffer is drained */ -#define MACEPAR_CONTEXT_LASTFLAG BIT(63) - /* Should not cross 4K page boundary */ -#define MACEPAR_CONTEXT_DATA_BOUND 0x0000000000001000UL -#define MACEPAR_CONTEXT_DATALEN_MASK 0x00000fff00000000UL -#define MACEPAR_CONTEXT_DATALEN_SHIFT 32 - /* Can be arbitrarily aligned on any byte boundary on output, - * 64 byte aligned on input */ -#define MACEPAR_CONTEXT_BASEADDR_MASK 0x00000000ffffffffUL +/* 0 - do nothing, 1 - pulse terminal count to the device after buffer is drained */ +#define MACEPAR_CONTEXT_LASTFLAG BIT(63) +/* Should not cross 4K page boundary */ +#define MACEPAR_CONTEXT_DATALEN_MASK 0xfff00000000 +/* Can be arbitrarily aligned on any byte boundary on output, 64 byte aligned on input */ +#define MACEPAR_CONTEXT_BASEADDR_MASK 0xffffffff volatile u64 context_a; volatile u64 context_b; - /* 0 - mem->device, 1 - device->mem */ -#define MACEPAR_CTLSTAT_DIRECTION BIT(0) - /* 0 - channel frozen, 1 - channel enabled */ -#define MACEPAR_CTLSTAT_ENABLE BIT(1) - /* 0 - channel active, 1 - complete channel reset */ -#define MACEPAR_CTLSTAT_RESET BIT(2) -#define MACEPAR_CTLSTAT_CTXB_VALID BIT(3) -#define MACEPAR_CTLSTAT_CTXA_VALID BIT(4) - volatile u64 cntlstat; /* Control/Status register */ -#define MACEPAR_DIAG_CTXINUSE BIT(0) - /* 1 - Dma engine is enabled and processing something */ -#define MACEPAR_DIAG_DMACTIVE BIT(1) - /* Counter of bytes left */ -#define MACEPAR_DIAG_CTRMASK 0x0000000000003ffcUL -#define MACEPAR_DIAG_CTRSHIFT 2 - volatile u64 diagnostic; /* RO: diagnostic register */ +#define MACEPAR_CTLSTAT_DIRECTION BIT(0) /* 0 - mem->device, 1 - device->mem */ +#define MACEPAR_CTLSTAT_ENABLE BIT(1) /* 0 - channel frozen, 1 - channel enabled */ +#define MACEPAR_CTLSTAT_RESET BIT(2) /* 0 - channel active, 1 - complete channel reset */ +#define MACEPAR_CTLSTAT_CTXB_VALID BIT(3) +#define MACEPAR_CTLSTAT_CTXA_VALID BIT(4) + volatile u64 cntlstat; /* Control/Status register */ +#define MACEPAR_DIAG_CTXINUSE BIT(1) +#define MACEPAR_DIAG_DMACTIVE BIT(2) /* 1 - Dma engine is enabled and processing something */ +#define MACEPAR_DIAG_CTRMASK 0x3ffc /* Counter of bytes left */ + volatile u64 diagnostic; /* RO: diagnostic register */ }; /* ISA Control and DMA registers */ @@ -363,6 +353,6 @@ struct sgi_mace { char _pad6[0x80000 - sizeof(struct mace_isa)]; }; -extern struct sgi_mace __iomem *mace; +extern struct sgi_mace *mace; #endif /* __ASM_MACE_H__ */ diff --git a/trunk/include/asm-mips/mach-au1x00/au1xxx_ide.h b/trunk/include/asm-mips/mach-au1x00/au1xxx_ide.h index e867b4ef96d1..33d275c3b84c 100644 --- a/trunk/include/asm-mips/mach-au1x00/au1xxx_ide.h +++ b/trunk/include/asm-mips/mach-au1x00/au1xxx_ide.h @@ -74,6 +74,9 @@ typedef struct u8 white_list, black_list; struct dbdma_cmd *dma_table_cpu; dma_addr_t dma_table_dma; + struct scatterlist *sg_table; + int sg_nents; + int sg_dma_direction; #endif struct device *dev; int irq; @@ -84,6 +87,11 @@ typedef struct } _auide_hwif; #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA +struct drive_list_entry { + const char * id_model; + const char * id_firmware; +}; + /* HD white list */ static const struct drive_list_entry dma_white_list [] = { /* @@ -159,9 +167,13 @@ int __init auide_probe(void); * Multi-Word DMA + DbDMA functions */ #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA + + static int in_drive_list(struct hd_driveid *id, + const struct drive_list_entry *drive_table); static int auide_build_sglist(ide_drive_t *drive, struct request *rq); static int auide_build_dmatable(ide_drive_t *drive); static int auide_dma_end(ide_drive_t *drive); + static void auide_dma_start(ide_drive_t *drive ); ide_startstop_t auide_dma_intr (ide_drive_t *drive); static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command); static int auide_dma_setup(ide_drive_t *drive); @@ -176,6 +188,8 @@ int __init auide_probe(void); static void auide_ddma_rx_callback(int irq, void *param, struct pt_regs *regs); static int auide_dma_off_quietly(ide_drive_t *drive); + static int auide_dma_timeout(ide_drive_t *drive); + #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ /******************************************************************************* @@ -285,11 +299,3 @@ int __init auide_probe(void); #define SBC_IDE_MDMA2_TPM (0x00<<6) #define SBC_IDE_MDMA2_TA (0x12<<0) -#define SBC_IDE_TIMING(mode) \ - SBC_IDE_##mode##_TWCS | \ - SBC_IDE_##mode##_TCSH | \ - SBC_IDE_##mode##_TCSOFF | \ - SBC_IDE_##mode##_TWP | \ - SBC_IDE_##mode##_TCSW | \ - SBC_IDE_##mode##_TPM | \ - SBC_IDE_##mode##_TA diff --git a/trunk/include/asm-mips/mach-db1x00/db1200.h b/trunk/include/asm-mips/mach-db1x00/db1200.h index 647fdb54cc1d..5d894376fc1a 100644 --- a/trunk/include/asm-mips/mach-db1x00/db1200.h +++ b/trunk/include/asm-mips/mach-db1x00/db1200.h @@ -220,8 +220,5 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; #define BOARD_PC1_INT DB1200_PC1_INT #define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET))) -/* Nand chip select */ -#define NAND_CS 1 - #endif /* __ASM_DB1200_H */ diff --git a/trunk/include/asm-mips/mach-db1x00/db1x00.h b/trunk/include/asm-mips/mach-db1x00/db1x00.h index 7b28b23f91ce..efafe65258b6 100644 --- a/trunk/include/asm-mips/mach-db1x00/db1x00.h +++ b/trunk/include/asm-mips/mach-db1x00/db1x00.h @@ -200,12 +200,6 @@ typedef volatile struct ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \ ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \ ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT) -#define NAND_CS 1 - -/* should be done by yamon */ -#define NAND_STCFG 0x00400005 /* 8-bit NAND */ -#define NAND_STTIME 0x00007774 /* valid for 396MHz SD=2 only */ -#define NAND_STADDR 0x12000FFF /* physical address 0x20000000 */ #endif /* __ASM_DB1X00_H */ diff --git a/trunk/include/asm-mips/mach-ip32/mc146818rtc.h b/trunk/include/asm-mips/mach-ip32/mc146818rtc.h index c28ba8d84076..f5d780ff843f 100644 --- a/trunk/include/asm-mips/mach-ip32/mc146818rtc.h +++ b/trunk/include/asm-mips/mach-ip32/mc146818rtc.h @@ -11,6 +11,7 @@ #ifndef __ASM_MACH_IP32_MC146818RTC_H #define __ASM_MACH_IP32_MC146818RTC_H +#include #include #define RTC_PORT(x) (0x70 + (x)) @@ -25,10 +26,8 @@ static inline void CMOS_WRITE(unsigned char data, unsigned long addr) mace->isa.rtc[addr << 8] = data; } -/* - * FIXME: Do it right. For now just assume that noone lives in 20th century - * and no O2 user in 22th century ;-) - */ +/* FIXME: Do it right. For now just assume that noone lives in 20th century + * and no O2 user in 22th century ;-) */ #define mc146818_decode_year(year) ((year) + 2000) #define RTC_ALWAYS_BCD 0 diff --git a/trunk/include/asm-mips/mach-jmr3927/ds1742.h b/trunk/include/asm-mips/mach-jmr3927/asm/ds1742.h similarity index 74% rename from trunk/include/asm-mips/mach-jmr3927/ds1742.h rename to trunk/include/asm-mips/mach-jmr3927/asm/ds1742.h index cff6192d4bdb..134a4b6c334a 100644 --- a/trunk/include/asm-mips/mach-jmr3927/ds1742.h +++ b/trunk/include/asm-mips/mach-jmr3927/asm/ds1742.h @@ -5,12 +5,12 @@ * * Copyright (C) 2003 by Ralf Baechle */ -#ifndef __ASM_MACH_JMR3927_DS1742_H -#define __ASM_MACH_JMR3927_DS1742_H +#ifndef __ASM_MACH_JMR3927_ASM_DS1742_H +#define __ASM_MACH_JMR3927_ASM_DS1742_H #include #define rtc_read(reg) (jmr3927_nvram_in(addr)) #define rtc_write(data, reg) (jmr3927_nvram_out((data),(reg))) -#endif /* __ASM_MACH_JMR3927_DS1742_H */ +#endif /* __ASM_MACH_JMR3927_ASM_DS1742_H */ diff --git a/trunk/include/asm-mips/mach-pb1x00/pb1200.h b/trunk/include/asm-mips/mach-pb1x00/pb1200.h index 409d443322c1..9a3088b19bf3 100644 --- a/trunk/include/asm-mips/mach-pb1x00/pb1200.h +++ b/trunk/include/asm-mips/mach-pb1x00/pb1200.h @@ -248,8 +248,5 @@ static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; #define BOARD_PC1_INT PB1200_PC1_INT #define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET))) -/* Nand chip select */ -#define NAND_CS 1 - #endif /* __ASM_PB1200_H */ diff --git a/trunk/include/asm-mips/mach-pb1x00/pb1550.h b/trunk/include/asm-mips/mach-pb1x00/pb1550.h index 9578ead11e8a..431d6088ea96 100644 --- a/trunk/include/asm-mips/mach-pb1x00/pb1550.h +++ b/trunk/include/asm-mips/mach-pb1x00/pb1550.h @@ -166,11 +166,4 @@ static BCSR * const bcsr = (BCSR *)BCSR_PHYS_ADDR; ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \ ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT) -#define NAND_CS 1 - -/* should be done by yamon */ -#define NAND_STCFG 0x00400005 /* 8-bit NAND */ -#define NAND_STTIME 0x00007774 /* valid for 396MHz SD=2 only */ -#define NAND_STADDR 0x12000FFF /* physical address 0x20000000 */ - #endif /* __ASM_PB1550_H */ diff --git a/trunk/include/asm-mips/mach-qemu/timex.h b/trunk/include/asm-mips/mach-qemu/timex.h deleted file mode 100644 index cd543693fb0a..000000000000 --- a/trunk/include/asm-mips/mach-qemu/timex.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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) 2005 Daniel Jacobowitz - */ -#ifndef __ASM_MACH_QEMU_TIMEX_H -#define __ASM_MACH_QEMU_TIMEX_H - -/* - * We use a simulated i8254 PIC... - */ -#define CLOCK_TICK_RATE 1193182 - -#endif /* __ASM_MACH_QEMU_TIMEX_H */ diff --git a/trunk/include/asm-mips/mips-boards/seadint.h b/trunk/include/asm-mips/mips-boards/seadint.h index 365c2a3c64f5..c3dcfcb928b6 100644 --- a/trunk/include/asm-mips/mips-boards/seadint.h +++ b/trunk/include/asm-mips/mips-boards/seadint.h @@ -20,14 +20,9 @@ #ifndef _MIPS_SEADINT_H #define _MIPS_SEADINT_H -/* - * Interrupts 0..7 are used for SEAD CPU interrupts - */ -#define MIPSCPU_INT_BASE 0 - -#define MIPSCPU_INT_UART0 2 -#define MIPSCPU_INT_UART1 3 +#define SEADINT_UART0 2 +#define SEADINT_UART1 3 -#define MIPSCPU_INT_CPUCTR 7 +extern void seadint_init(void); #endif /* !(_MIPS_SEADINT_H) */ diff --git a/trunk/include/asm-mips/signal.h b/trunk/include/asm-mips/signal.h index 6fe903e09c62..8ca539e80d87 100644 --- a/trunk/include/asm-mips/signal.h +++ b/trunk/include/asm-mips/signal.h @@ -155,6 +155,27 @@ typedef struct sigaltstack { #ifdef __KERNEL__ #include +/* + * The following break codes are or were in use for specific purposes in + * other MIPS operating systems. Linux/MIPS doesn't use all of them. The + * unused ones are here as placeholders; we might encounter them in + * non-Linux/MIPS object files or make use of them in the future. + */ +#define BRK_USERBP 0 /* User bp (used by debuggers) */ +#define BRK_KERNELBP 1 /* Break in the kernel */ +#define BRK_ABORT 2 /* Sometimes used by abort(3) to SIGIOT */ +#define BRK_BD_TAKEN 3 /* For bd slot emulation - not implemented */ +#define BRK_BD_NOTTAKEN 4 /* For bd slot emulation - not implemented */ +#define BRK_SSTEPBP 5 /* User bp (used by debuggers) */ +#define BRK_OVERFLOW 6 /* Overflow check */ +#define BRK_DIVZERO 7 /* Divide by zero check */ +#define BRK_RANGE 8 /* Range error check */ +#define BRK_STACKOVERFLOW 9 /* For Ada stackchecking */ +#define BRK_NORLD 10 /* No rld found - not used by Linux/MIPS */ +#define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */ +#define BRK_MULOVF 1023 /* Multiply overflow */ +#define BRK_BUG 512 /* Used by BUG() */ + #define ptrace_signal_deliver(regs, cookie) do { } while (0) #endif /* __KERNEL__ */ diff --git a/trunk/include/asm-parisc/atomic.h b/trunk/include/asm-parisc/atomic.h index 983e9a2b6042..048a2c7fd0c0 100644 --- a/trunk/include/asm-parisc/atomic.h +++ b/trunk/include/asm-parisc/atomic.h @@ -164,26 +164,6 @@ static __inline__ int atomic_read(const atomic_t *v) } /* exported interface */ -#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) - -/** - * atomic_add_unless - add unless the number is a given value - * @v: pointer of type atomic_t - * @a: the amount to add to v... - * @u: ...unless v is equal to u. - * - * Atomically adds @a to @v, so long as it was not @u. - * Returns non-zero if @v was not @u, and zero otherwise. - */ -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) #define atomic_add(i,v) ((void)(__atomic_add_return( ((int)i),(v)))) #define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)i),(v)))) diff --git a/trunk/include/asm-parisc/bitops.h b/trunk/include/asm-parisc/bitops.h index 15d8c2b51584..55b98c67fd82 100644 --- a/trunk/include/asm-parisc/bitops.h +++ b/trunk/include/asm-parisc/bitops.h @@ -263,7 +263,6 @@ static __inline__ int fls(int x) return ret; } -#define fls64(x) generic_fls64(x) /* * hweightN: returns the hamming weight (i.e. the number diff --git a/trunk/include/asm-parisc/irq.h b/trunk/include/asm-parisc/irq.h index b0a30e2c9813..f876bdf22056 100644 --- a/trunk/include/asm-parisc/irq.h +++ b/trunk/include/asm-parisc/irq.h @@ -8,7 +8,6 @@ #define _ASM_PARISC_IRQ_H #include -#include #include #define NO_IRQ (-1) @@ -50,10 +49,10 @@ extern int txn_alloc_irq(unsigned int nbits); extern int txn_claim_irq(int); extern unsigned int txn_alloc_data(unsigned int); extern unsigned long txn_alloc_addr(unsigned int); -extern unsigned long txn_affinity_addr(unsigned int irq, int cpu); extern int cpu_claim_irq(unsigned int irq, struct hw_interrupt_type *, void *); -extern int cpu_check_affinity(unsigned int irq, cpumask_t *dest); + +extern int cpu_claim_irq(unsigned int irq, struct hw_interrupt_type *, void *); /* soft power switch support (power.c) */ extern struct tasklet_struct power_tasklet; diff --git a/trunk/include/asm-parisc/smp.h b/trunk/include/asm-parisc/smp.h index dbdbd2e9fdf9..9413f67a540b 100644 --- a/trunk/include/asm-parisc/smp.h +++ b/trunk/include/asm-parisc/smp.h @@ -29,7 +29,6 @@ extern cpumask_t cpu_online_map; #define cpu_logical_map(cpu) (cpu) extern void smp_send_reschedule(int cpu); -extern void smp_send_all_nop(void); #endif /* !ASSEMBLY */ @@ -54,11 +53,7 @@ extern unsigned long cpu_present_mask; #define raw_smp_processor_id() (current_thread_info()->cpu) -#else /* CONFIG_SMP */ - -static inline void smp_send_all_nop(void) { return; } - -#endif +#endif /* CONFIG_SMP */ #define NO_PROC_ID 0xFF /* No processor magic marker */ #define ANY_PROC_ID 0xFF /* Any processor magic marker */ diff --git a/trunk/include/asm-parisc/spinlock.h b/trunk/include/asm-parisc/spinlock.h index 16c2ac075fc5..7c3f406a746a 100644 --- a/trunk/include/asm-parisc/spinlock.h +++ b/trunk/include/asm-parisc/spinlock.h @@ -11,25 +11,18 @@ static inline int __raw_spin_is_locked(raw_spinlock_t *x) return *a == 0; } -#define __raw_spin_lock(lock) __raw_spin_lock_flags(lock, 0) +#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) #define __raw_spin_unlock_wait(x) \ do { cpu_relax(); } while (__raw_spin_is_locked(x)) -static inline void __raw_spin_lock_flags(raw_spinlock_t *x, - unsigned long flags) +static inline void __raw_spin_lock(raw_spinlock_t *x) { volatile unsigned int *a; mb(); a = __ldcw_align(x); while (__ldcw(a) == 0) - while (*a == 0) - if (flags & PSW_SM_I) { - local_irq_enable(); - cpu_relax(); - local_irq_disable(); - } else - cpu_relax(); + while (*a == 0); mb(); } @@ -67,20 +60,26 @@ static inline int __raw_spin_trylock(raw_spinlock_t *x) static __inline__ void __raw_read_lock(raw_rwlock_t *rw) { + unsigned long flags; + local_irq_save(flags); __raw_spin_lock(&rw->lock); rw->counter++; __raw_spin_unlock(&rw->lock); + local_irq_restore(flags); } static __inline__ void __raw_read_unlock(raw_rwlock_t *rw) { + unsigned long flags; + local_irq_save(flags); __raw_spin_lock(&rw->lock); rw->counter--; __raw_spin_unlock(&rw->lock); + local_irq_restore(flags); } /* write_lock is less trivial. We optimistically grab the lock and check diff --git a/trunk/include/asm-parisc/tlbflush.h b/trunk/include/asm-parisc/tlbflush.h index c9ec39c6fc6c..e97aa8d1eff5 100644 --- a/trunk/include/asm-parisc/tlbflush.h +++ b/trunk/include/asm-parisc/tlbflush.h @@ -12,15 +12,21 @@ * N class systems, only one PxTLB inter processor broadcast can be * active at any one time on the Merced bus. This tlb purge * synchronisation is fairly lightweight and harmless so we activate - * it on all SMP systems not just the N class. We also need to have - * preemption disabled on uniprocessor machines, and spin_lock does that - * nicely. - */ + * it on all SMP systems not just the N class. */ +#ifdef CONFIG_SMP extern spinlock_t pa_tlb_lock; #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) +#else + +#define purge_tlb_start(x) do { } while(0) +#define purge_tlb_end(x) do { } while (0) + +#endif + + extern void flush_tlb_all(void); /* @@ -82,6 +88,7 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ flush_tlb_all(); else { + preempt_disable(); mtsp(vma->vm_mm->context,1); purge_tlb_start(); if (split_tlb) { @@ -95,6 +102,7 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, pdtlb(start); start += PAGE_SIZE; } + preempt_enable(); } purge_tlb_end(); } diff --git a/trunk/include/asm-powerpc/atomic.h b/trunk/include/asm-powerpc/atomic.h index ec4b14468959..9c0b372a46e1 100644 --- a/trunk/include/asm-powerpc/atomic.h +++ b/trunk/include/asm-powerpc/atomic.h @@ -164,33 +164,6 @@ static __inline__ int atomic_dec_return(atomic_t *v) return t; } -#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) - -/** - * atomic_add_unless - add unless the number is a given value - * @v: pointer of type atomic_t - * @a: the amount to add to v... - * @u: ...unless v is equal to u. - * - * Atomically adds @a to @v, so long as it was not @u. - * Returns non-zero if @v was not @u, and zero otherwise. - */ -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - for (;;) { \ - if (unlikely(c == (u))) \ - break; \ - old = atomic_cmpxchg((v), c, c + (a)); \ - if (likely(old == c)) \ - break; \ - c = old; \ - } \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - #define atomic_sub_and_test(a, v) (atomic_sub_return((a), (v)) == 0) #define atomic_dec_and_test(v) (atomic_dec_return((v)) == 0) diff --git a/trunk/include/asm-powerpc/bitops.h b/trunk/include/asm-powerpc/bitops.h index 1996eaa8aeae..5727229b0444 100644 --- a/trunk/include/asm-powerpc/bitops.h +++ b/trunk/include/asm-powerpc/bitops.h @@ -310,7 +310,6 @@ static __inline__ int fls(unsigned int x) asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); return 32 - lz; } -#define fls64(x) generic_fls64(x) /* * hweightN: returns the hamming weight (i.e. the number diff --git a/trunk/include/asm-powerpc/cputable.h b/trunk/include/asm-powerpc/cputable.h index d1cfa3f515ea..04e2726002cf 100644 --- a/trunk/include/asm-powerpc/cputable.h +++ b/trunk/include/asm-powerpc/cputable.h @@ -90,7 +90,6 @@ extern void do_cpu_ftr_fixups(unsigned long offset); #define CPU_FTR_NEED_COHERENT ASM_CONST(0x0000000000020000) #define CPU_FTR_NO_BTIC ASM_CONST(0x0000000000040000) #define CPU_FTR_BIG_PHYS ASM_CONST(0x0000000000080000) -#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000) #ifdef __powerpc64__ /* Add the 64b processor unique features in the top half of the word */ @@ -98,6 +97,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset); #define CPU_FTR_16M_PAGE ASM_CONST(0x0000000200000000) #define CPU_FTR_TLBIEL ASM_CONST(0x0000000400000000) #define CPU_FTR_NOEXECUTE ASM_CONST(0x0000000800000000) +#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000001000000000) #define CPU_FTR_IABR ASM_CONST(0x0000002000000000) #define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000) #define CPU_FTR_CTRL ASM_CONST(0x0000008000000000) @@ -113,6 +113,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset); #define CPU_FTR_16M_PAGE ASM_CONST(0x0) #define CPU_FTR_TLBIEL ASM_CONST(0x0) #define CPU_FTR_NOEXECUTE ASM_CONST(0x0) +#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0) #define CPU_FTR_IABR ASM_CONST(0x0) #define CPU_FTR_MMCRA ASM_CONST(0x0) #define CPU_FTR_CTRL ASM_CONST(0x0) @@ -272,21 +273,18 @@ enum { CPU_FTRS_POWER3_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, CPU_FTRS_POWER4_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_NODSISRALIGN, + CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, CPU_FTRS_970_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN, + CPU_FTR_MAYBE_CAN_NAP, CPU_FTRS_8XX = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - CPU_FTRS_40X = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_NODSISRALIGN, - CPU_FTRS_44X = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_NODSISRALIGN, - CPU_FTRS_E200 = CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN, - CPU_FTRS_E500 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_NODSISRALIGN, + CPU_FTRS_40X = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + CPU_FTRS_44X = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + CPU_FTRS_E200 = CPU_FTR_USE_TB, + CPU_FTRS_E500 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, CPU_FTRS_E500_2 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN, - CPU_FTRS_GENERIC_32 = CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN, + CPU_FTR_BIG_PHYS, + CPU_FTRS_GENERIC_32 = CPU_FTR_COMMON, #ifdef __powerpc64__ CPU_FTRS_POWER3 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR, diff --git a/trunk/include/asm-powerpc/delay.h b/trunk/include/asm-powerpc/delay.h deleted file mode 100644 index 54fe1f4f8fd0..000000000000 --- a/trunk/include/asm-powerpc/delay.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _ASM_POWERPC_DELAY_H -#define _ASM_POWERPC_DELAY_H - -/* - * Copyright 1996, Paul Mackerras. - * - * 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. - * - * PPC64 Support added by Dave Engebretsen, Todd Inglett, Mike Corrigan, - * Anton Blanchard. - */ - -extern void __delay(unsigned long loops); -extern void udelay(unsigned long usecs); - -#endif /* _ASM_POWERPC_DELAY_H */ diff --git a/trunk/include/asm-powerpc/iommu.h b/trunk/include/asm-powerpc/iommu.h index f89f06050893..6a35e6570ccd 100644 --- a/trunk/include/asm-powerpc/iommu.h +++ b/trunk/include/asm-powerpc/iommu.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * Rewrite, cleanup: - * Copyright (C) 2004 Olof Johansson , IBM Corporation + * Copyright (C) 2004 Olof Johansson , IBM Corporation * * 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 diff --git a/trunk/include/asm-powerpc/kexec.h b/trunk/include/asm-powerpc/kexec.h index c72ffc709ea8..062ab9ba68eb 100644 --- a/trunk/include/asm-powerpc/kexec.h +++ b/trunk/include/asm-powerpc/kexec.h @@ -40,7 +40,6 @@ extern note_buf_t crash_notes[]; #ifdef __powerpc64__ extern void kexec_smp_wait(void); /* get and clear naca physid, wait for master to copy new code to 0 */ -extern void __init kexec_setup(void); #else struct kimage; extern void machine_kexec_simple(struct kimage *image); diff --git a/trunk/include/asm-powerpc/machdep.h b/trunk/include/asm-powerpc/machdep.h index c011abb8b600..5670f0cd6143 100644 --- a/trunk/include/asm-powerpc/machdep.h +++ b/trunk/include/asm-powerpc/machdep.h @@ -93,9 +93,7 @@ struct machdep_calls { void (*init_IRQ)(void); int (*get_irq)(struct pt_regs *); -#ifdef CONFIG_KEXEC - void (*kexec_cpu_down)(int crash_shutdown, int secondary); -#endif + void (*cpu_irq_down)(int secondary); /* PCI stuff */ /* Called after scanning the bus, before allocating resources */ diff --git a/trunk/include/asm-powerpc/page.h b/trunk/include/asm-powerpc/page.h deleted file mode 100644 index 18c1e5ee81a3..000000000000 --- a/trunk/include/asm-powerpc/page.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef _ASM_POWERPC_PAGE_H -#define _ASM_POWERPC_PAGE_H - -/* - * Copyright (C) 2001,2005 IBM Corporation. - * - * 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__ -#include -#include - -/* - * On PPC32 page size is 4K. For PPC64 we support either 4K or 64K software - * page size. When using 64K pages however, whether we are really supporting - * 64K pages in HW or not is irrelevant to those definitions. - */ -#ifdef CONFIG_PPC_64K_PAGES -#define PAGE_SHIFT 16 -#else -#define PAGE_SHIFT 12 -#endif - -#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT) - -/* We do define AT_SYSINFO_EHDR but don't use the gate mechanism */ -#define __HAVE_ARCH_GATE_AREA 1 - -/* - * Subtle: (1 << PAGE_SHIFT) is an int, not an unsigned long. So if we - * assign PAGE_MASK to a larger type it gets extended the way we want - * (i.e. with 1s in the high bits) - */ -#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) - -#define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) -#define KERNELBASE PAGE_OFFSET - -#ifdef CONFIG_DISCONTIGMEM -#define page_to_pfn(page) discontigmem_page_to_pfn(page) -#define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn) -#define pfn_valid(pfn) discontigmem_pfn_valid(pfn) -#endif - -#ifdef CONFIG_FLATMEM -#define pfn_to_page(pfn) (mem_map + (pfn)) -#define page_to_pfn(page) ((unsigned long)((page) - mem_map)) -#define pfn_valid(pfn) ((pfn) < max_mapnr) -#endif - -#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) -#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) - -#define __va(x) ((void *)((unsigned long)(x) + KERNELBASE)) -#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET) - -/* - * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI, - * and needs to be executable. This means the whole heap ends - * up being executable. - */ -#define VM_DATA_DEFAULT_FLAGS32 (VM_READ | VM_WRITE | VM_EXEC | \ - VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) - -#define VM_DATA_DEFAULT_FLAGS64 (VM_READ | VM_WRITE | \ - VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) - -#ifdef __powerpc64__ -#include -#else -#include -#endif - -/* align addr on a size boundary - adjust address up/down if needed */ -#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1))) -#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) - -/* align addr on a size boundary - adjust address up if needed */ -#define _ALIGN(addr,size) _ALIGN_UP(addr,size) - -/* to align the pointer to the (next) page boundary */ -#define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE) - -#ifndef __ASSEMBLY__ - -#undef STRICT_MM_TYPECHECKS - -#ifdef STRICT_MM_TYPECHECKS -/* These are used to make use of C type-checking. */ - -/* PTE level */ -typedef struct { pte_basic_t pte; } pte_t; -#define pte_val(x) ((x).pte) -#define __pte(x) ((pte_t) { (x) }) - -/* 64k pages additionally define a bigger "real PTE" type that gathers - * the "second half" part of the PTE for pseudo 64k pages - */ -#ifdef CONFIG_PPC_64K_PAGES -typedef struct { pte_t pte; unsigned long hidx; } real_pte_t; -#else -typedef struct { pte_t pte; } real_pte_t; -#endif - -/* PMD level */ -typedef struct { unsigned long pmd; } pmd_t; -#define pmd_val(x) ((x).pmd) -#define __pmd(x) ((pmd_t) { (x) }) - -/* PUD level exusts only on 4k pages */ -#ifndef CONFIG_PPC_64K_PAGES -typedef struct { unsigned long pud; } pud_t; -#define pud_val(x) ((x).pud) -#define __pud(x) ((pud_t) { (x) }) -#endif - -/* PGD level */ -typedef struct { unsigned long pgd; } pgd_t; -#define pgd_val(x) ((x).pgd) -#define __pgd(x) ((pgd_t) { (x) }) - -/* Page protection bits */ -typedef struct { unsigned long pgprot; } pgprot_t; -#define pgprot_val(x) ((x).pgprot) -#define __pgprot(x) ((pgprot_t) { (x) }) - -#else - -/* - * .. while these make it easier on the compiler - */ - -typedef pte_basic_t pte_t; -#define pte_val(x) (x) -#define __pte(x) (x) - -#ifdef CONFIG_PPC_64K_PAGES -typedef struct { pte_t pte; unsigned long hidx; } real_pte_t; -#else -typedef unsigned long real_pte_t; -#endif - - -typedef unsigned long pmd_t; -#define pmd_val(x) (x) -#define __pmd(x) (x) - -#ifndef CONFIG_PPC_64K_PAGES -typedef unsigned long pud_t; -#define pud_val(x) (x) -#define __pud(x) (x) -#endif - -typedef unsigned long pgd_t; -#define pgd_val(x) (x) -#define pgprot_val(x) (x) - -typedef unsigned long pgprot_t; -#define __pgd(x) (x) -#define __pgprot(x) (x) - -#endif - -struct page; -extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg); -extern void copy_user_page(void *to, void *from, unsigned long vaddr, - struct page *p); -extern int page_is_ram(unsigned long pfn); - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ - -#endif /* _ASM_POWERPC_PAGE_H */ diff --git a/trunk/include/asm-powerpc/page_32.h b/trunk/include/asm-powerpc/page_32.h deleted file mode 100644 index 7259cfd85da9..000000000000 --- a/trunk/include/asm-powerpc/page_32.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef _ASM_POWERPC_PAGE_32_H -#define _ASM_POWERPC_PAGE_32_H - -#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32 - -#define PPC_MEMSTART 0 - -#ifndef __ASSEMBLY__ -/* - * The basic type of a PTE - 64 bits for those CPUs with > 32 bit - * physical addressing. For now this just the IBM PPC440. - */ -#ifdef CONFIG_PTE_64BIT -typedef unsigned long long pte_basic_t; -#define PTE_SHIFT (PAGE_SHIFT - 3) /* 512 ptes per page */ -#define PTE_FMT "%16Lx" -#else -typedef unsigned long pte_basic_t; -#define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */ -#define PTE_FMT "%.8lx" -#endif - -struct page; -extern void clear_pages(void *page, int order); -static inline void clear_page(void *page) { clear_pages(page, 0); } -extern void copy_page(void *to, void *from); - -/* Pure 2^n version of get_order */ -extern __inline__ int get_order(unsigned long size) -{ - int lz; - - size = (size-1) >> PAGE_SHIFT; - asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size)); - return 32 - lz; -} - -#endif /* __ASSEMBLY__ */ - -#endif /* _ASM_POWERPC_PAGE_32_H */ diff --git a/trunk/include/asm-powerpc/page_64.h b/trunk/include/asm-powerpc/page_64.h deleted file mode 100644 index 6642c0125001..000000000000 --- a/trunk/include/asm-powerpc/page_64.h +++ /dev/null @@ -1,183 +0,0 @@ -#ifndef _ASM_POWERPC_PAGE_64_H -#define _ASM_POWERPC_PAGE_64_H - -/* - * Copyright (C) 2001 PPC64 Team, IBM Corp - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -/* - * We always define HW_PAGE_SHIFT to 12 as use of 64K pages remains Linux - * specific, every notion of page number shared with the firmware, TCEs, - * iommu, etc... still uses a page size of 4K. - */ -#define HW_PAGE_SHIFT 12 -#define HW_PAGE_SIZE (ASM_CONST(1) << HW_PAGE_SHIFT) -#define HW_PAGE_MASK (~(HW_PAGE_SIZE-1)) - -/* - * PAGE_FACTOR is the number of bits factor between PAGE_SHIFT and - * HW_PAGE_SHIFT, that is 4K pages. - */ -#define PAGE_FACTOR (PAGE_SHIFT - HW_PAGE_SHIFT) - -#define REGION_SIZE 4UL -#define REGION_SHIFT 60UL -#define REGION_MASK (((1UL<> REGION_SHIFT) -#define KERNEL_REGION_ID (KERNELBASE >> REGION_SHIFT) -#define USER_REGION_ID (0UL) -#define REGION_ID(ea) (((unsigned long)(ea)) >> REGION_SHIFT) - -/* Segment size */ -#define SID_SHIFT 28 -#define SID_MASK 0xfffffffffUL -#define ESID_MASK 0xfffffffff0000000UL -#define GET_ESID(x) (((x) >> SID_SHIFT) & SID_MASK) - -#ifndef __ASSEMBLY__ -#include - -typedef unsigned long pte_basic_t; - -static __inline__ void clear_page(void *addr) -{ - unsigned long lines, line_size; - - line_size = ppc64_caches.dline_size; - lines = ppc64_caches.dlines_per_page; - - __asm__ __volatile__( - "mtctr %1 # clear_page\n\ -1: dcbz 0,%0\n\ - add %0,%0,%3\n\ - bdnz+ 1b" - : "=r" (addr) - : "r" (lines), "0" (addr), "r" (line_size) - : "ctr", "memory"); -} - -extern void copy_4K_page(void *to, void *from); - -#ifdef CONFIG_PPC_64K_PAGES -static inline void copy_page(void *to, void *from) -{ - unsigned int i; - for (i=0; i < (1 << (PAGE_SHIFT - 12)); i++) { - copy_4K_page(to, from); - to += 4096; - from += 4096; - } -} -#else /* CONFIG_PPC_64K_PAGES */ -static inline void copy_page(void *to, void *from) -{ - copy_4K_page(to, from); -} -#endif /* CONFIG_PPC_64K_PAGES */ - -/* Log 2 of page table size */ -extern u64 ppc64_pft_size; - -/* Large pages size */ -#ifdef CONFIG_HUGETLB_PAGE -extern unsigned int HPAGE_SHIFT; -#else -#define HPAGE_SHIFT PAGE_SHIFT -#endif -#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) -#define HPAGE_MASK (~(HPAGE_SIZE - 1)) -#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) - -#endif /* __ASSEMBLY__ */ - -#ifdef CONFIG_HUGETLB_PAGE - -#define HTLB_AREA_SHIFT 40 -#define HTLB_AREA_SIZE (1UL << HTLB_AREA_SHIFT) -#define GET_HTLB_AREA(x) ((x) >> HTLB_AREA_SHIFT) - -#define LOW_ESID_MASK(addr, len) \ - (((1U << (GET_ESID(min((addr)+(len)-1, 0x100000000UL))+1)) \ - - (1U << GET_ESID(min((addr), 0x100000000UL)))) & 0xffff) -#define HTLB_AREA_MASK(addr, len) (((1U << (GET_HTLB_AREA(addr+len-1)+1)) \ - - (1U << GET_HTLB_AREA(addr))) & 0xffff) - -#define ARCH_HAS_HUGEPAGE_ONLY_RANGE -#define ARCH_HAS_PREPARE_HUGEPAGE_RANGE -#define ARCH_HAS_SETCLEAR_HUGE_PTE - -#define touches_hugepage_low_range(mm, addr, len) \ - (((addr) < 0x100000000UL) \ - && (LOW_ESID_MASK((addr), (len)) & (mm)->context.low_htlb_areas)) -#define touches_hugepage_high_range(mm, addr, len) \ - ((((addr) + (len)) > 0x100000000UL) \ - && (HTLB_AREA_MASK((addr), (len)) & (mm)->context.high_htlb_areas)) - -#define __within_hugepage_low_range(addr, len, segmask) \ - ( (((addr)+(len)) <= 0x100000000UL) \ - && ((LOW_ESID_MASK((addr), (len)) | (segmask)) == (segmask))) -#define within_hugepage_low_range(addr, len) \ - __within_hugepage_low_range((addr), (len), \ - current->mm->context.low_htlb_areas) -#define __within_hugepage_high_range(addr, len, zonemask) \ - ( ((addr) >= 0x100000000UL) \ - && ((HTLB_AREA_MASK((addr), (len)) | (zonemask)) == (zonemask))) -#define within_hugepage_high_range(addr, len) \ - __within_hugepage_high_range((addr), (len), \ - current->mm->context.high_htlb_areas) - -#define is_hugepage_only_range(mm, addr, len) \ - (touches_hugepage_high_range((mm), (addr), (len)) || \ - touches_hugepage_low_range((mm), (addr), (len))) -#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA - -#define in_hugepage_area(context, addr) \ - (cpu_has_feature(CPU_FTR_16M_PAGE) && \ - ( ( (addr) >= 0x100000000UL) \ - ? ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) \ - : ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) ) - -#else /* !CONFIG_HUGETLB_PAGE */ - -#define in_hugepage_area(mm, addr) 0 - -#endif /* !CONFIG_HUGETLB_PAGE */ - -#ifdef MODULE -#define __page_aligned __attribute__((__aligned__(PAGE_SIZE))) -#else -#define __page_aligned \ - __attribute__((__aligned__(PAGE_SIZE), \ - __section__(".data.page_aligned"))) -#endif - -#define VM_DATA_DEFAULT_FLAGS \ - (test_thread_flag(TIF_32BIT) ? \ - VM_DATA_DEFAULT_FLAGS32 : VM_DATA_DEFAULT_FLAGS64) - -/* - * This is the default if a program doesn't have a PT_GNU_STACK - * program header entry. The PPC64 ELF ABI has a non executable stack - * stack by default, so in the absense of a PT_GNU_STACK program header - * we turn execute permission off. - */ -#define VM_STACK_DEFAULT_FLAGS32 (VM_READ | VM_WRITE | VM_EXEC | \ - VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) - -#define VM_STACK_DEFAULT_FLAGS64 (VM_READ | VM_WRITE | \ - VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) - -#define VM_STACK_DEFAULT_FLAGS \ - (test_thread_flag(TIF_32BIT) ? \ - VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64) - -#include - -#endif /* _ASM_POWERPC_PAGE_64_H */ diff --git a/trunk/include/asm-powerpc/ppc-pci.h b/trunk/include/asm-powerpc/ppc-pci.h index 36cdc869e580..9896fade98a7 100644 --- a/trunk/include/asm-powerpc/ppc-pci.h +++ b/trunk/include/asm-powerpc/ppc-pci.h @@ -14,6 +14,7 @@ extern unsigned long isa_io_base; +extern void pci_setup_pci_controller(struct pci_controller *hose); extern void pci_setup_phb_io(struct pci_controller *hose, int primary); extern void pci_setup_phb_io_dynamic(struct pci_controller *hose, int primary); @@ -48,6 +49,8 @@ extern void pSeries_final_fixup(void); extern void pSeries_irq_bus_setup(struct pci_bus *bus); extern unsigned long pci_probe_only; +extern unsigned long pci_assign_all_buses; +extern int pci_read_irq_line(struct pci_dev *pci_dev); /* ---- EEH internal-use-only related routines ---- */ #ifdef CONFIG_EEH diff --git a/trunk/include/asm-powerpc/tce.h b/trunk/include/asm-powerpc/tce.h index 980a094fd5a7..d099d5200f9b 100644 --- a/trunk/include/asm-powerpc/tce.h +++ b/trunk/include/asm-powerpc/tce.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * Rewrite, cleanup: - * Copyright (C) 2004 Olof Johansson , IBM Corporation + * Copyright (C) 2004 Olof Johansson , IBM Corporation * * 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 diff --git a/trunk/include/asm-powerpc/topology.h b/trunk/include/asm-powerpc/topology.h index db8095cbe09b..015d28746e1b 100644 --- a/trunk/include/asm-powerpc/topology.h +++ b/trunk/include/asm-powerpc/topology.h @@ -41,10 +41,6 @@ static inline int node_to_first_cpu(int node) .cache_hot_time = (10*1000000), \ .cache_nice_tries = 1, \ .per_cpu_gain = 100, \ - .busy_idx = 3, \ - .idle_idx = 1, \ - .newidle_idx = 2, \ - .wake_idx = 1, \ .flags = SD_LOAD_BALANCE \ | SD_BALANCE_EXEC \ | SD_BALANCE_NEWIDLE \ diff --git a/trunk/include/asm-powerpc/vdso.h b/trunk/include/asm-powerpc/vdso.h index b9f9118b1607..85d8a7be25c4 100644 --- a/trunk/include/asm-powerpc/vdso.h +++ b/trunk/include/asm-powerpc/vdso.h @@ -11,7 +11,7 @@ #define VDSO32_MBASE VDSO32_LBASE #define VDSO64_MBASE VDSO64_LBASE -#define VDSO_VERSION_STRING LINUX_2.6.15 +#define VDSO_VERSION_STRING LINUX_2.6.12 /* Define if 64 bits VDSO has procedure descriptors */ #undef VDS64_HAS_DESCRIPTORS diff --git a/trunk/include/asm-powerpc/vdso_datapage.h b/trunk/include/asm-powerpc/vdso_datapage.h index 411832d5bbdb..fc323b51366b 100644 --- a/trunk/include/asm-powerpc/vdso_datapage.h +++ b/trunk/include/asm-powerpc/vdso_datapage.h @@ -73,7 +73,7 @@ struct vdso_data { /* those additional ones don't have to be located anywhere * special as they were not part of the original systemcfg */ - __s32 wtom_clock_sec; /* Wall to monotonic clock */ + __s64 wtom_clock_sec; /* Wall to monotonic clock */ __s32 wtom_clock_nsec; __u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of syscalls */ __u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */ diff --git a/trunk/include/asm-ppc/cpm2.h b/trunk/include/asm-ppc/cpm2.h index b638b87cebe3..43d2ebbc7748 100644 --- a/trunk/include/asm-ppc/cpm2.h +++ b/trunk/include/asm-ppc/cpm2.h @@ -1091,7 +1091,5 @@ typedef struct im_idma { #define CPM_IMMR_OFFSET 0x101a8 #endif -#define FCC_PSMR_RMII ((uint)0x00020000) /* Use RMII interface */ - #endif /* __CPM2__ */ #endif /* __KERNEL__ */ diff --git a/trunk/include/asm-powerpc/dma-mapping.h b/trunk/include/asm-ppc/dma-mapping.h similarity index 56% rename from trunk/include/asm-powerpc/dma-mapping.h rename to trunk/include/asm-ppc/dma-mapping.h index 59a80163f75f..6e9635114433 100644 --- a/trunk/include/asm-powerpc/dma-mapping.h +++ b/trunk/include/asm-ppc/dma-mapping.h @@ -1,22 +1,15 @@ /* - * Copyright (C) 2004 IBM - * - * Implements the generic device dma API for powerpc. - * the pci and vio busses + * This is based on both include/asm-sh/dma-mapping.h and + * include/asm-ppc/pci.h */ -#ifndef _ASM_DMA_MAPPING_H -#define _ASM_DMA_MAPPING_H +#ifndef __ASM_PPC_DMA_MAPPING_H +#define __ASM_PPC_DMA_MAPPING_H #include -#include -#include /* need struct page definitions */ #include #include #include -#include - -#define DMA_ERROR_CODE (~(dma_addr_t)0x0) #ifdef CONFIG_NOT_COHERENT_CACHE /* @@ -31,12 +24,22 @@ extern void __dma_free_coherent(size_t size, void *vaddr); extern void __dma_sync(void *vaddr, size_t size, int direction); extern void __dma_sync_page(struct page *page, unsigned long offset, size_t size, int direction); +#define dma_cache_inv(_start,_size) \ + invalidate_dcache_range(_start, (_start + _size)) +#define dma_cache_wback(_start,_size) \ + clean_dcache_range(_start, (_start + _size)) +#define dma_cache_wback_inv(_start,_size) \ + flush_dcache_range(_start, (_start + _size)) #else /* ! CONFIG_NOT_COHERENT_CACHE */ /* * Cache coherent cores. */ +#define dma_cache_inv(_start,_size) do { } while (0) +#define dma_cache_wback(_start,_size) do { } while (0) +#define dma_cache_wback_inv(_start,_size) do { } while (0) + #define __dma_alloc_coherent(gfp, size, handle) NULL #define __dma_free_coherent(size, addr) do { } while (0) #define __dma_sync(addr, size, rw) do { } while (0) @@ -44,30 +47,6 @@ extern void __dma_sync_page(struct page *page, unsigned long offset, #endif /* ! CONFIG_NOT_COHERENT_CACHE */ -#ifdef CONFIG_PPC64 - -extern int dma_supported(struct device *dev, u64 mask); -extern int dma_set_mask(struct device *dev, u64 dma_mask); -extern void *dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t *dma_handle, gfp_t flag); -extern void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, - dma_addr_t dma_handle); -extern dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, - size_t size, enum dma_data_direction direction); -extern void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, - size_t size, enum dma_data_direction direction); -extern dma_addr_t dma_map_page(struct device *dev, struct page *page, - unsigned long offset, size_t size, - enum dma_data_direction direction); -extern void dma_unmap_page(struct device *dev, dma_addr_t dma_address, - size_t size, enum dma_data_direction direction); -extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, - enum dma_data_direction direction); -extern void dma_unmap_sg(struct device *dev, struct scatterlist *sg, - int nhwentries, enum dma_data_direction direction); - -#else /* CONFIG_PPC64 */ - #define dma_supported(dev, mask) (1) static inline int dma_set_mask(struct device *dev, u64 dma_mask) @@ -165,27 +144,29 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, /* We don't do anything here. */ #define dma_unmap_sg(dev, sg, nents, dir) do { } while (0) -#endif /* CONFIG_PPC64 */ - -static inline void dma_sync_single_for_cpu(struct device *dev, - dma_addr_t dma_handle, size_t size, - enum dma_data_direction direction) +static inline void +dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, + size_t size, + enum dma_data_direction direction) { BUG_ON(direction == DMA_NONE); + __dma_sync(bus_to_virt(dma_handle), size, direction); } -static inline void dma_sync_single_for_device(struct device *dev, - dma_addr_t dma_handle, size_t size, - enum dma_data_direction direction) +static inline void +dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, + size_t size, + enum dma_data_direction direction) { BUG_ON(direction == DMA_NONE); + __dma_sync(bus_to_virt(dma_handle), size, direction); } -static inline void dma_sync_sg_for_cpu(struct device *dev, - struct scatterlist *sg, int nents, - enum dma_data_direction direction) +static inline void +dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents, + enum dma_data_direction direction) { int i; @@ -195,9 +176,9 @@ static inline void dma_sync_sg_for_cpu(struct device *dev, __dma_sync_page(sg->page, sg->offset, sg->length, direction); } -static inline void dma_sync_sg_for_device(struct device *dev, - struct scatterlist *sg, int nents, - enum dma_data_direction direction) +static inline void +dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents, + enum dma_data_direction direction) { int i; @@ -207,15 +188,6 @@ static inline void dma_sync_sg_for_device(struct device *dev, __dma_sync_page(sg->page, sg->offset, sg->length, direction); } -static inline int dma_mapping_error(dma_addr_t dma_addr) -{ -#ifdef CONFIG_PPC64 - return (dma_addr == DMA_ERROR_CODE); -#else - return 0; -#endif -} - #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) #ifdef CONFIG_NOT_COHERENT_CACHE @@ -226,60 +198,40 @@ static inline int dma_mapping_error(dma_addr_t dma_addr) static inline int dma_get_cache_alignment(void) { -#ifdef CONFIG_PPC64 - /* no easy way to get cache size on all processors, so return - * the maximum possible, to be safe */ - return (1 << L1_CACHE_SHIFT_MAX); -#else /* * Each processor family will define its own L1_CACHE_SHIFT, * L1_CACHE_BYTES wraps to this, so this is always safe. */ return L1_CACHE_BYTES; -#endif } -static inline void dma_sync_single_range_for_cpu(struct device *dev, - dma_addr_t dma_handle, unsigned long offset, size_t size, - enum dma_data_direction direction) +static inline void +dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, + unsigned long offset, size_t size, + enum dma_data_direction direction) { /* just sync everything for now */ dma_sync_single_for_cpu(dev, dma_handle, offset + size, direction); } -static inline void dma_sync_single_range_for_device(struct device *dev, - dma_addr_t dma_handle, unsigned long offset, size_t size, - enum dma_data_direction direction) +static inline void +dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, + unsigned long offset, size_t size, + enum dma_data_direction direction) { /* just sync everything for now */ dma_sync_single_for_device(dev, dma_handle, offset + size, direction); } static inline void dma_cache_sync(void *vaddr, size_t size, - enum dma_data_direction direction) + enum dma_data_direction direction) { - BUG_ON(direction == DMA_NONE); __dma_sync(vaddr, size, (int)direction); } -/* - * DMA operations are abstracted for G5 vs. i/pSeries, PCI vs. VIO - */ -struct dma_mapping_ops { - void * (*alloc_coherent)(struct device *dev, size_t size, - dma_addr_t *dma_handle, gfp_t flag); - void (*free_coherent)(struct device *dev, size_t size, - void *vaddr, dma_addr_t dma_handle); - dma_addr_t (*map_single)(struct device *dev, void *ptr, - size_t size, enum dma_data_direction direction); - void (*unmap_single)(struct device *dev, dma_addr_t dma_addr, - size_t size, enum dma_data_direction direction); - int (*map_sg)(struct device *dev, struct scatterlist *sg, - int nents, enum dma_data_direction direction); - void (*unmap_sg)(struct device *dev, struct scatterlist *sg, - int nents, enum dma_data_direction direction); - int (*dma_supported)(struct device *dev, u64 mask); - int (*dac_dma_supported)(struct device *dev, u64 mask); -}; - -#endif /* _ASM_DMA_MAPPING_H */ +static inline int dma_mapping_error(dma_addr_t dma_addr) +{ + return 0; +} + +#endif /* __ASM_PPC_DMA_MAPPING_H */ diff --git a/trunk/include/asm-ppc/immap_85xx.h b/trunk/include/asm-ppc/immap_85xx.h index 9383d0c13ff8..50fb5e47094a 100644 --- a/trunk/include/asm-ppc/immap_85xx.h +++ b/trunk/include/asm-ppc/immap_85xx.h @@ -3,7 +3,7 @@ * * MPC85xx Internal Memory Map * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor, Inc * diff --git a/trunk/include/asm-ppc/io.h b/trunk/include/asm-ppc/io.h index 84ac6e258eef..2bfdf9c98459 100644 --- a/trunk/include/asm-ppc/io.h +++ b/trunk/include/asm-ppc/io.h @@ -545,23 +545,6 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *); #include #endif -#ifdef CONFIG_NOT_COHERENT_CACHE - -#define dma_cache_inv(_start,_size) \ - invalidate_dcache_range(_start, (_start + _size)) -#define dma_cache_wback(_start,_size) \ - clean_dcache_range(_start, (_start + _size)) -#define dma_cache_wback_inv(_start,_size) \ - flush_dcache_range(_start, (_start + _size)) - -#else - -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) - -#endif - /* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * access diff --git a/trunk/include/asm-ppc/ipic.h b/trunk/include/asm-ppc/ipic.h index 0fe396a2b666..9092b920997a 100644 --- a/trunk/include/asm-ppc/ipic.h +++ b/trunk/include/asm-ppc/ipic.h @@ -3,7 +3,7 @@ * * IPIC external definitions and structure. * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor, Inc * diff --git a/trunk/include/asm-ppc/mpc83xx.h b/trunk/include/asm-ppc/mpc83xx.h index 7cdf60fa69b6..ce212201db2a 100644 --- a/trunk/include/asm-ppc/mpc83xx.h +++ b/trunk/include/asm-ppc/mpc83xx.h @@ -3,7 +3,7 @@ * * MPC83xx definitions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor, Inc * diff --git a/trunk/include/asm-ppc/mpc85xx.h b/trunk/include/asm-ppc/mpc85xx.h index 9d14baea3d71..d98db980cd49 100644 --- a/trunk/include/asm-ppc/mpc85xx.h +++ b/trunk/include/asm-ppc/mpc85xx.h @@ -3,7 +3,7 @@ * * MPC85xx definitions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2004 Freescale Semiconductor, Inc * diff --git a/trunk/include/asm-ppc/nvram.h b/trunk/include/asm-ppc/nvram.h new file mode 100644 index 000000000000..31ef16e3fc4f --- /dev/null +++ b/trunk/include/asm-ppc/nvram.h @@ -0,0 +1,73 @@ +/* + * PreP compliant NVRAM access + */ + +#ifdef __KERNEL__ +#ifndef _PPC_NVRAM_H +#define _PPC_NVRAM_H + +#define NVRAM_AS0 0x74 +#define NVRAM_AS1 0x75 +#define NVRAM_DATA 0x77 + + +/* RTC Offsets */ + +#define MOTO_RTC_SECONDS 0x1FF9 +#define MOTO_RTC_MINUTES 0x1FFA +#define MOTO_RTC_HOURS 0x1FFB +#define MOTO_RTC_DAY_OF_WEEK 0x1FFC +#define MOTO_RTC_DAY_OF_MONTH 0x1FFD +#define MOTO_RTC_MONTH 0x1FFE +#define MOTO_RTC_YEAR 0x1FFF +#define MOTO_RTC_CONTROLA 0x1FF8 +#define MOTO_RTC_CONTROLB 0x1FF9 + +/* PowerMac specific nvram stuffs */ + +enum { + pmac_nvram_OF, /* Open Firmware partition */ + pmac_nvram_XPRAM, /* MacOS XPRAM partition */ + pmac_nvram_NR /* MacOS Name Registry partition */ +}; + +/* Return partition offset in nvram */ +extern int pmac_get_partition(int partition); + +/* Direct access to XPRAM on PowerMacs */ +extern u8 pmac_xpram_read(int xpaddr); +extern void pmac_xpram_write(int xpaddr, u8 data); + +/* Synchronize NVRAM */ +extern void nvram_sync(void); + +/* Normal access to NVRAM */ +extern unsigned char nvram_read_byte(int i); +extern void nvram_write_byte(unsigned char c, int i); + +/* Some offsets in XPRAM */ +#define PMAC_XPRAM_MACHINE_LOC 0xe4 +#define PMAC_XPRAM_SOUND_VOLUME 0x08 + +/* Machine location structure in PowerMac XPRAM */ +struct pmac_machine_location { + unsigned int latitude; /* 2+30 bit Fractional number */ + unsigned int longitude; /* 2+30 bit Fractional number */ + unsigned int delta; /* mix of GMT delta and DLS */ +}; + +/* + * /dev/nvram ioctls + * + * Note that PMAC_NVRAM_GET_OFFSET is still supported, but is + * definitely obsolete. Do not use it if you can avoid it + */ + +#define OBSOLETE_PMAC_NVRAM_GET_OFFSET \ + _IOWR('p', 0x40, int) + +#define IOC_NVRAM_GET_OFFSET _IOWR('p', 0x42, int) /* Get NVRAM partition offset */ +#define IOC_NVRAM_SYNC _IO('p', 0x43) /* Sync NVRAM image */ + +#endif +#endif /* __KERNEL__ */ diff --git a/trunk/include/asm-ppc/pgalloc.h b/trunk/include/asm-ppc/pgalloc.h index bdefd1c4a558..931b6de7ef53 100644 --- a/trunk/include/asm-ppc/pgalloc.h +++ b/trunk/include/asm-ppc/pgalloc.h @@ -28,7 +28,7 @@ extern void pgd_free(pgd_t *pgd); #define pmd_populate_kernel(mm, pmd, pte) \ (pmd_val(*(pmd)) = (unsigned long)pte | _PMD_PRESENT) #define pmd_populate(mm, pmd, pte) \ - (pmd_val(*(pmd)) = (unsigned long)lowmem_page_address(pte) | _PMD_PRESENT) + (pmd_val(*(pmd)) = (unsigned long)page_to_virt(pte) | _PMD_PRESENT) #endif extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); diff --git a/trunk/include/asm-ppc/ppc4xx_dma.h b/trunk/include/asm-ppc/ppc4xx_dma.h index 46a086fff816..a415001165fa 100644 --- a/trunk/include/asm-ppc/ppc4xx_dma.h +++ b/trunk/include/asm-ppc/ppc4xx_dma.h @@ -33,6 +33,9 @@ #define MAX_PPC4xx_DMA_CHANNELS 4 +/* in arch/ppc/kernel/setup.c -- Cort */ +extern unsigned long DMA_MODE_WRITE, DMA_MODE_READ; + /* * Function return status codes * These values are used to indicate whether or not the function diff --git a/trunk/include/asm-ppc/ppc_sys.h b/trunk/include/asm-ppc/ppc_sys.h index 83d8c77c124d..bba5305c29ed 100644 --- a/trunk/include/asm-ppc/ppc_sys.h +++ b/trunk/include/asm-ppc/ppc_sys.h @@ -3,7 +3,7 @@ * * PPC system definitions and library functions * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala * * Copyright 2005 Freescale Semiconductor, Inc * diff --git a/trunk/include/asm-powerpc/btext.h b/trunk/include/asm-ppc64/btext.h similarity index 100% rename from trunk/include/asm-powerpc/btext.h rename to trunk/include/asm-ppc64/btext.h diff --git a/trunk/include/asm-ppc64/delay.h b/trunk/include/asm-ppc64/delay.h new file mode 100644 index 000000000000..05f198cf73d9 --- /dev/null +++ b/trunk/include/asm-ppc64/delay.h @@ -0,0 +1,48 @@ +#ifndef _PPC64_DELAY_H +#define _PPC64_DELAY_H + +/* + * Copyright 1996, Paul Mackerras. + * + * 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. + * + * PPC64 Support added by Dave Engebretsen, Todd Inglett, Mike Corrigan, + * Anton Blanchard. + */ + +extern unsigned long tb_ticks_per_usec; + +/* define these here to prevent circular dependencies */ +#define __HMT_low() asm volatile("or 1,1,1") +#define __HMT_medium() asm volatile("or 2,2,2") +#define __barrier() asm volatile("":::"memory") + +static inline unsigned long __get_tb(void) +{ + unsigned long rval; + + asm volatile("mftb %0" : "=r" (rval)); + return rval; +} + +static inline void __delay(unsigned long loops) +{ + unsigned long start = __get_tb(); + + while((__get_tb()-start) < loops) + __HMT_low(); + __HMT_medium(); + __barrier(); +} + +static inline void udelay(unsigned long usecs) +{ + unsigned long loops = tb_ticks_per_usec * usecs; + + __delay(loops); +} + +#endif /* _PPC64_DELAY_H */ diff --git a/trunk/include/asm-ppc64/dma-mapping.h b/trunk/include/asm-ppc64/dma-mapping.h new file mode 100644 index 000000000000..fb68fa23bea8 --- /dev/null +++ b/trunk/include/asm-ppc64/dma-mapping.h @@ -0,0 +1,136 @@ +/* Copyright (C) 2004 IBM + * + * Implements the generic device dma API for ppc64. Handles + * the pci and vio busses + */ + +#ifndef _ASM_DMA_MAPPING_H +#define _ASM_DMA_MAPPING_H + +#include +#include +/* need struct page definitions */ +#include +#include +#include + +#define DMA_ERROR_CODE (~(dma_addr_t)0x0) + +extern int dma_supported(struct device *dev, u64 mask); +extern int dma_set_mask(struct device *dev, u64 dma_mask); +extern void *dma_alloc_coherent(struct device *dev, size_t size, + dma_addr_t *dma_handle, gfp_t flag); +extern void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, + dma_addr_t dma_handle); +extern dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, + size_t size, enum dma_data_direction direction); +extern void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, + size_t size, enum dma_data_direction direction); +extern dma_addr_t dma_map_page(struct device *dev, struct page *page, + unsigned long offset, size_t size, + enum dma_data_direction direction); +extern void dma_unmap_page(struct device *dev, dma_addr_t dma_address, + size_t size, enum dma_data_direction direction); +extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, + enum dma_data_direction direction); +extern void dma_unmap_sg(struct device *dev, struct scatterlist *sg, + int nhwentries, enum dma_data_direction direction); + +static inline void +dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, + enum dma_data_direction direction) +{ + BUG_ON(direction == DMA_NONE); + /* nothing to do */ +} + +static inline void +dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, + enum dma_data_direction direction) +{ + BUG_ON(direction == DMA_NONE); + /* nothing to do */ +} + +static inline void +dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, + enum dma_data_direction direction) +{ + BUG_ON(direction == DMA_NONE); + /* nothing to do */ +} + +static inline void +dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, + enum dma_data_direction direction) +{ + BUG_ON(direction == DMA_NONE); + /* nothing to do */ +} + +static inline int dma_mapping_error(dma_addr_t dma_addr) +{ + return (dma_addr == DMA_ERROR_CODE); +} + +/* Now for the API extensions over the pci_ one */ + +#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) +#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) +#define dma_is_consistent(d) (1) + +static inline int +dma_get_cache_alignment(void) +{ + /* no easy way to get cache size on all processors, so return + * the maximum possible, to be safe */ + return (1 << L1_CACHE_SHIFT_MAX); +} + +static inline void +dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, + unsigned long offset, size_t size, + enum dma_data_direction direction) +{ + BUG_ON(direction == DMA_NONE); + /* nothing to do */ +} + +static inline void +dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, + unsigned long offset, size_t size, + enum dma_data_direction direction) +{ + BUG_ON(direction == DMA_NONE); + /* nothing to do */ +} + +static inline void +dma_cache_sync(void *vaddr, size_t size, + enum dma_data_direction direction) +{ + BUG_ON(direction == DMA_NONE); + /* nothing to do */ +} + +/* + * DMA operations are abstracted for G5 vs. i/pSeries, PCI vs. VIO + */ +struct dma_mapping_ops { + void * (*alloc_coherent)(struct device *dev, size_t size, + dma_addr_t *dma_handle, gfp_t flag); + void (*free_coherent)(struct device *dev, size_t size, + void *vaddr, dma_addr_t dma_handle); + dma_addr_t (*map_single)(struct device *dev, void *ptr, + size_t size, enum dma_data_direction direction); + void (*unmap_single)(struct device *dev, dma_addr_t dma_addr, + size_t size, enum dma_data_direction direction); + int (*map_sg)(struct device *dev, struct scatterlist *sg, + int nents, enum dma_data_direction direction); + void (*unmap_sg)(struct device *dev, struct scatterlist *sg, + int nents, enum dma_data_direction direction); + int (*dma_supported)(struct device *dev, u64 mask); + int (*dac_dma_supported)(struct device *dev, u64 mask); +}; + +#endif /* _ASM_DMA_MAPPING_H */ diff --git a/trunk/include/asm-powerpc/eeh.h b/trunk/include/asm-ppc64/eeh.h similarity index 98% rename from trunk/include/asm-powerpc/eeh.h rename to trunk/include/asm-ppc64/eeh.h index f8633aafe4ba..89f26ab31908 100644 --- a/trunk/include/asm-powerpc/eeh.h +++ b/trunk/include/asm-ppc64/eeh.h @@ -30,8 +30,6 @@ struct device_node; #ifdef CONFIG_EEH -extern int eeh_subsystem_enabled; - /* Values for eeh_mode bits in device_node */ #define EEH_MODE_SUPPORTED (1<<0) #define EEH_MODE_NOCHECK (1<<1) @@ -77,7 +75,7 @@ void eeh_remove_device(struct pci_dev *); * If this macro yields TRUE, the caller relays to eeh_check_failure() * which does further tests out of line. */ -#define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0 && eeh_subsystem_enabled) +#define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0) /* * Reads from a device which has been isolated by EEH will return diff --git a/trunk/include/asm-powerpc/floppy.h b/trunk/include/asm-ppc64/floppy.h similarity index 78% rename from trunk/include/asm-powerpc/floppy.h rename to trunk/include/asm-ppc64/floppy.h index 64276a3f6153..5c497b588e54 100644 --- a/trunk/include/asm-powerpc/floppy.h +++ b/trunk/include/asm-ppc64/floppy.h @@ -7,22 +7,22 @@ * * Copyright (C) 1995 */ -#ifndef __ASM_POWERPC_FLOPPY_H -#define __ASM_POWERPC_FLOPPY_H +#ifndef __ASM_PPC64_FLOPPY_H +#define __ASM_PPC64_FLOPPY_H #include #include -#define fd_inb(port) inb_p(port) -#define fd_outb(value,port) outb_p(value,port) +#define fd_inb(port) inb_p(port) +#define fd_outb(value,port) outb_p(value,port) #define fd_enable_dma() enable_dma(FLOPPY_DMA) #define fd_disable_dma() disable_dma(FLOPPY_DMA) -#define fd_request_dma() request_dma(FLOPPY_DMA, "floppy") +#define fd_request_dma() request_dma(FLOPPY_DMA,"floppy") #define fd_free_dma() free_dma(FLOPPY_DMA) #define fd_clear_dma_ff() clear_dma_ff(FLOPPY_DMA) -#define fd_set_dma_mode(mode) set_dma_mode(FLOPPY_DMA, mode) -#define fd_set_dma_count(count) set_dma_count(FLOPPY_DMA, count) +#define fd_set_dma_mode(mode) set_dma_mode(FLOPPY_DMA,mode) +#define fd_set_dma_count(count) set_dma_count(FLOPPY_DMA,count) #define fd_enable_irq() enable_irq(FLOPPY_IRQ) #define fd_disable_irq() disable_irq(FLOPPY_IRQ) #define fd_cacheflush(addr,size) /* nothing */ @@ -35,10 +35,10 @@ #include -#define fd_dma_setup(addr,size,mode,io) powerpc_fd_dma_setup(addr,size,mode,io) +#define fd_dma_setup(addr,size,mode,io) ppc64_fd_dma_setup(addr,size,mode,io) -static __inline__ int powerpc_fd_dma_setup(char *addr, unsigned long size, - int mode, int io) +static __inline__ int +ppc64_fd_dma_setup(char *addr, unsigned long size, int mode, int io) { static unsigned long prev_size; static dma_addr_t bus_addr = 0; @@ -55,8 +55,9 @@ static __inline__ int powerpc_fd_dma_setup(char *addr, unsigned long size, bus_addr = 0; } - if (!bus_addr) /* need to map it */ + if (!bus_addr) /* need to map it */ { bus_addr = pci_map_single(NULL, addr, size, dir); + } /* remember this one as prev */ prev_addr = addr; @@ -102,4 +103,4 @@ static int FDC2 = -1; #define EXTRA_FLOPPY_PARAMS -#endif /* __ASM_POWERPC_FLOPPY_H */ +#endif /* __ASM_PPC64_FLOPPY_H */ diff --git a/trunk/include/asm-powerpc/hvconsole.h b/trunk/include/asm-ppc64/hvconsole.h similarity index 100% rename from trunk/include/asm-powerpc/hvconsole.h rename to trunk/include/asm-ppc64/hvconsole.h diff --git a/trunk/include/asm-powerpc/hvcserver.h b/trunk/include/asm-ppc64/hvcserver.h similarity index 100% rename from trunk/include/asm-powerpc/hvcserver.h rename to trunk/include/asm-ppc64/hvcserver.h diff --git a/trunk/include/asm-ppc64/imalloc.h b/trunk/include/asm-ppc64/imalloc.h new file mode 100644 index 000000000000..42adf7033a81 --- /dev/null +++ b/trunk/include/asm-ppc64/imalloc.h @@ -0,0 +1,26 @@ +#ifndef _PPC64_IMALLOC_H +#define _PPC64_IMALLOC_H + +/* + * Define the address range of the imalloc VM area. + */ +#define PHBS_IO_BASE VMALLOC_END +#define IMALLOC_BASE (PHBS_IO_BASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */ +#define IMALLOC_END (VMALLOC_START + PGTABLE_RANGE) + + +/* imalloc region types */ +#define IM_REGION_UNUSED 0x1 +#define IM_REGION_SUBSET 0x2 +#define IM_REGION_EXISTS 0x4 +#define IM_REGION_OVERLAP 0x8 +#define IM_REGION_SUPERSET 0x10 + +extern struct vm_struct * im_get_free_area(unsigned long size); +extern struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size, + int region_type); +extern void im_free(void *addr); + +extern unsigned long ioremap_bot; + +#endif /* _PPC64_IMALLOC_H */ diff --git a/trunk/include/asm-powerpc/io.h b/trunk/include/asm-ppc64/io.h similarity index 98% rename from trunk/include/asm-powerpc/io.h rename to trunk/include/asm-ppc64/io.h index 48938d84d055..77fc07c3c6bd 100644 --- a/trunk/include/asm-powerpc/io.h +++ b/trunk/include/asm-ppc64/io.h @@ -1,5 +1,5 @@ -#ifndef _ASM_POWERPC_IO_H -#define _ASM_POWERPC_IO_H +#ifndef _PPC64_IO_H +#define _PPC64_IO_H /* * This program is free software; you can redistribute it and/or @@ -8,10 +8,7 @@ * 2 of the License, or (at your option) any later version. */ -#ifndef CONFIG_PPC64 -#include -#else - +#include #include #include #include @@ -458,5 +455,4 @@ extern int check_legacy_ioport(unsigned long base_port); #endif /* __KERNEL__ */ -#endif /* CONFIG_PPC64 */ -#endif /* _ASM_POWERPC_IO_H */ +#endif /* _PPC64_IO_H */ diff --git a/trunk/include/asm-powerpc/mmu.h b/trunk/include/asm-ppc64/mmu.h similarity index 98% rename from trunk/include/asm-powerpc/mmu.h rename to trunk/include/asm-ppc64/mmu.h index 29b0bb0086d3..1a7e0afa2dc6 100644 --- a/trunk/include/asm-powerpc/mmu.h +++ b/trunk/include/asm-ppc64/mmu.h @@ -1,10 +1,3 @@ -#ifndef _ASM_POWERPC_MMU_H_ -#define _ASM_POWERPC_MMU_H_ - -#ifndef CONFIG_PPC64 -#include -#else - /* * PowerPC memory management structures * @@ -17,6 +10,10 @@ * 2 of the License, or (at your option) any later version. */ +#ifndef _PPC64_MMU_H_ +#define _PPC64_MMU_H_ + +#include #include #include @@ -220,8 +217,7 @@ extern int __hash_page_64K(unsigned long ea, unsigned long access, unsigned int local); struct mm_struct; extern int hash_huge_page(struct mm_struct *mm, unsigned long access, - unsigned long ea, unsigned long vsid, int local, - unsigned long trap); + unsigned long ea, unsigned long vsid, int local); extern void htab_finish_init(void); extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, @@ -396,5 +392,4 @@ static inline unsigned long get_vsid(unsigned long context, unsigned long ea) #endif /* __ASSEMBLY */ -#endif /* CONFIG_PPC64 */ -#endif /* _ASM_POWERPC_MMU_H_ */ +#endif /* _PPC64_MMU_H_ */ diff --git a/trunk/include/asm-powerpc/mmu_context.h b/trunk/include/asm-ppc64/mmu_context.h similarity index 91% rename from trunk/include/asm-powerpc/mmu_context.h rename to trunk/include/asm-ppc64/mmu_context.h index ea6798c7d5fc..4f512e9fa6b8 100644 --- a/trunk/include/asm-powerpc/mmu_context.h +++ b/trunk/include/asm-ppc64/mmu_context.h @@ -1,10 +1,7 @@ -#ifndef __ASM_POWERPC_MMU_CONTEXT_H -#define __ASM_POWERPC_MMU_CONTEXT_H - -#ifndef CONFIG_PPC64 -#include -#else +#ifndef __PPC64_MMU_CONTEXT_H +#define __PPC64_MMU_CONTEXT_H +#include #include #include #include @@ -85,5 +82,4 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next) local_irq_restore(flags); } -#endif /* CONFIG_PPC64 */ -#endif /* __ASM_POWERPC_MMU_CONTEXT_H */ +#endif /* __PPC64_MMU_CONTEXT_H */ diff --git a/trunk/include/asm-powerpc/mmzone.h b/trunk/include/asm-ppc64/mmzone.h similarity index 100% rename from trunk/include/asm-powerpc/mmzone.h rename to trunk/include/asm-ppc64/mmzone.h diff --git a/trunk/include/asm-powerpc/nvram.h b/trunk/include/asm-ppc64/nvram.h similarity index 90% rename from trunk/include/asm-powerpc/nvram.h rename to trunk/include/asm-ppc64/nvram.h index 24bd8c2388ea..def47d720d3d 100644 --- a/trunk/include/asm-powerpc/nvram.h +++ b/trunk/include/asm-ppc64/nvram.h @@ -1,5 +1,6 @@ /* - * NVRAM definitions and access functions. + * PreP compliant NVRAM access + * This needs to be updated for PPC64 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -7,8 +8,8 @@ * 2 of the License, or (at your option) any later version. */ -#ifndef _ASM_POWERPC_NVRAM_H -#define _ASM_POWERPC_NVRAM_H +#ifndef _PPC64_NVRAM_H +#define _PPC64_NVRAM_H #define NVRW_CNT 0x20 #define NVRAM_HEADER_LEN 16 /* sizeof(struct nvram_header) */ @@ -68,6 +69,7 @@ extern int nvram_clear_error_log(void); extern struct nvram_partition *nvram_find_partition(int sig, const char *name); extern int pSeries_nvram_init(void); +extern int pmac_nvram_init(void); extern int mmio_nvram_init(void); /* PowerMac specific nvram stuffs */ @@ -86,11 +88,7 @@ extern u8 pmac_xpram_read(int xpaddr); extern void pmac_xpram_write(int xpaddr, u8 data); /* Synchronize NVRAM */ -extern void nvram_sync(void); - -/* Normal access to NVRAM */ -extern unsigned char nvram_read_byte(int i); -extern void nvram_write_byte(unsigned char c, int i); +extern int nvram_sync(void); /* Some offsets in XPRAM */ #define PMAC_XPRAM_MACHINE_LOC 0xe4 @@ -114,6 +112,5 @@ struct pmac_machine_location { _IOWR('p', 0x40, int) #define IOC_NVRAM_GET_OFFSET _IOWR('p', 0x42, int) /* Get NVRAM partition offset */ -#define IOC_NVRAM_SYNC _IO('p', 0x43) /* Sync NVRAM image */ -#endif /* _ASM_POWERPC_NVRAM_H */ +#endif /* _PPC64_NVRAM_H */ diff --git a/trunk/include/asm-ppc64/page.h b/trunk/include/asm-ppc64/page.h new file mode 100644 index 000000000000..3efc3288f7e9 --- /dev/null +++ b/trunk/include/asm-ppc64/page.h @@ -0,0 +1,328 @@ +#ifndef _PPC64_PAGE_H +#define _PPC64_PAGE_H + +/* + * Copyright (C) 2001 PPC64 Team, IBM Corp + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include + +/* + * We support either 4k or 64k software page size. When using 64k pages + * however, wether we are really supporting 64k pages in HW or not is + * irrelevant to those definitions. We always define HW_PAGE_SHIFT to 12 + * as use of 64k pages remains a linux kernel specific, every notion of + * page number shared with the firmware, TCEs, iommu, etc... still assumes + * a page size of 4096. + */ +#ifdef CONFIG_PPC_64K_PAGES +#define PAGE_SHIFT 16 +#else +#define PAGE_SHIFT 12 +#endif + +#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1)) + +/* HW_PAGE_SHIFT is always 4k pages */ +#define HW_PAGE_SHIFT 12 +#define HW_PAGE_SIZE (ASM_CONST(1) << HW_PAGE_SHIFT) +#define HW_PAGE_MASK (~(HW_PAGE_SIZE-1)) + +/* PAGE_FACTOR is the number of bits factor between PAGE_SHIFT and + * HW_PAGE_SHIFT, that is 4k pages + */ +#define PAGE_FACTOR (PAGE_SHIFT - HW_PAGE_SHIFT) + +/* Segment size */ +#define SID_SHIFT 28 +#define SID_MASK 0xfffffffffUL +#define ESID_MASK 0xfffffffff0000000UL +#define GET_ESID(x) (((x) >> SID_SHIFT) & SID_MASK) + +/* Large pages size */ + +#ifndef __ASSEMBLY__ +extern unsigned int HPAGE_SHIFT; +#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) +#define HPAGE_MASK (~(HPAGE_SIZE - 1)) +#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) +#endif /* __ASSEMBLY__ */ + +#ifdef CONFIG_HUGETLB_PAGE + + +#define HTLB_AREA_SHIFT 40 +#define HTLB_AREA_SIZE (1UL << HTLB_AREA_SHIFT) +#define GET_HTLB_AREA(x) ((x) >> HTLB_AREA_SHIFT) + +#define LOW_ESID_MASK(addr, len) (((1U << (GET_ESID(addr+len-1)+1)) \ + - (1U << GET_ESID(addr))) & 0xffff) +#define HTLB_AREA_MASK(addr, len) (((1U << (GET_HTLB_AREA(addr+len-1)+1)) \ + - (1U << GET_HTLB_AREA(addr))) & 0xffff) + +#define ARCH_HAS_HUGEPAGE_ONLY_RANGE +#define ARCH_HAS_PREPARE_HUGEPAGE_RANGE +#define ARCH_HAS_SETCLEAR_HUGE_PTE + +#define touches_hugepage_low_range(mm, addr, len) \ + (LOW_ESID_MASK((addr), (len)) & (mm)->context.low_htlb_areas) +#define touches_hugepage_high_range(mm, addr, len) \ + (HTLB_AREA_MASK((addr), (len)) & (mm)->context.high_htlb_areas) + +#define __within_hugepage_low_range(addr, len, segmask) \ + ((LOW_ESID_MASK((addr), (len)) | (segmask)) == (segmask)) +#define within_hugepage_low_range(addr, len) \ + __within_hugepage_low_range((addr), (len), \ + current->mm->context.low_htlb_areas) +#define __within_hugepage_high_range(addr, len, zonemask) \ + ((HTLB_AREA_MASK((addr), (len)) | (zonemask)) == (zonemask)) +#define within_hugepage_high_range(addr, len) \ + __within_hugepage_high_range((addr), (len), \ + current->mm->context.high_htlb_areas) + +#define is_hugepage_only_range(mm, addr, len) \ + (touches_hugepage_high_range((mm), (addr), (len)) || \ + touches_hugepage_low_range((mm), (addr), (len))) +#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA + +#define in_hugepage_area(context, addr) \ + (cpu_has_feature(CPU_FTR_16M_PAGE) && \ + ( ((1 << GET_HTLB_AREA(addr)) & (context).high_htlb_areas) || \ + ( ((addr) < 0x100000000L) && \ + ((1 << GET_ESID(addr)) & (context).low_htlb_areas) ) ) ) + +#else /* !CONFIG_HUGETLB_PAGE */ + +#define in_hugepage_area(mm, addr) 0 + +#endif /* !CONFIG_HUGETLB_PAGE */ + +/* align addr on a size boundary - adjust address up/down if needed */ +#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1))) +#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) + +/* align addr on a size boundary - adjust address up if needed */ +#define _ALIGN(addr,size) _ALIGN_UP(addr,size) + +/* to align the pointer to the (next) page boundary */ +#define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE) + +#ifdef __KERNEL__ +#ifndef __ASSEMBLY__ +#include + +#undef STRICT_MM_TYPECHECKS + +#define REGION_SIZE 4UL +#define REGION_SHIFT 60UL +#define REGION_MASK (((1UL<> REGION_SHIFT) +#define KERNEL_REGION_ID (KERNELBASE >> REGION_SHIFT) +#define USER_REGION_ID (0UL) +#define REGION_ID(ea) (((unsigned long)(ea)) >> REGION_SHIFT) + +#define __va(x) ((void *)((unsigned long)(x) + KERNELBASE)) + +#ifdef CONFIG_FLATMEM +#define pfn_to_page(pfn) (mem_map + (pfn)) +#define page_to_pfn(page) ((unsigned long)((page) - mem_map)) +#define pfn_valid(pfn) ((pfn) < max_mapnr) +#endif + +#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) +#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) + +#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) + +/* + * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI, + * and needs to be executable. This means the whole heap ends + * up being executable. + */ +#define VM_DATA_DEFAULT_FLAGS32 (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + +#define VM_DATA_DEFAULT_FLAGS64 (VM_READ | VM_WRITE | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + +#define VM_DATA_DEFAULT_FLAGS \ + (test_thread_flag(TIF_32BIT) ? \ + VM_DATA_DEFAULT_FLAGS32 : VM_DATA_DEFAULT_FLAGS64) + +/* + * This is the default if a program doesn't have a PT_GNU_STACK + * program header entry. The PPC64 ELF ABI has a non executable stack + * stack by default, so in the absense of a PT_GNU_STACK program header + * we turn execute permission off. + */ +#define VM_STACK_DEFAULT_FLAGS32 (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + +#define VM_STACK_DEFAULT_FLAGS64 (VM_READ | VM_WRITE | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + +#define VM_STACK_DEFAULT_FLAGS \ + (test_thread_flag(TIF_32BIT) ? \ + VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64) + +#endif /* __KERNEL__ */ + +#include + +#endif /* _PPC64_PAGE_H */ diff --git a/trunk/include/asm-powerpc/pci-bridge.h b/trunk/include/asm-ppc64/pci-bridge.h similarity index 89% rename from trunk/include/asm-powerpc/pci-bridge.h rename to trunk/include/asm-ppc64/pci-bridge.h index 223ec7bd81da..efbdaece0cf0 100644 --- a/trunk/include/asm-powerpc/pci-bridge.h +++ b/trunk/include/asm-ppc64/pci-bridge.h @@ -1,10 +1,8 @@ -#ifndef _ASM_POWERPC_PCI_BRIDGE_H -#define _ASM_POWERPC_PCI_BRIDGE_H - -#ifndef CONFIG_PPC64 -#include -#else +#ifdef __KERNEL__ +#ifndef _ASM_PCI_BRIDGE_H +#define _ASM_PCI_BRIDGE_H +#include #include #include @@ -63,14 +61,12 @@ struct pci_dn { int busno; /* for pci devices */ int bussubno; /* for pci devices */ int devfn; /* for pci devices */ - -#ifdef CONFIG_PPC_PSERIES int eeh_mode; /* See eeh.h for possible EEH_MODEs */ int eeh_config_addr; int eeh_check_count; /* # times driver ignored error */ int eeh_freeze_count; /* # times this device froze up. */ int eeh_is_bridge; /* device is pci-to-pci bridge */ -#endif + int pci_ext_config_space; /* for pci devices */ struct pci_controller *phb; /* for pci devices */ struct iommu_table *iommu_table; /* for phb's or bridges */ @@ -78,9 +74,9 @@ struct pci_dn { struct device_node *node; /* back-pointer to the device_node */ #ifdef CONFIG_PPC_ISERIES struct list_head Device_List; - int Irq; /* Assigned IRQ */ - int Flags; /* Possible flags(disable/bist)*/ - u8 LogicalSlot; /* Hv Slot Index for Tces */ + int Irq; /* Assigned IRQ */ + int Flags; /* Possible flags(disable/bist)*/ + u8 LogicalSlot; /* Hv Slot Index for Tces */ #endif u32 config_space[16]; /* saved PCI config space */ }; @@ -140,14 +136,10 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) return PCI_DN(busdn)->phb; } -extern struct pci_controller * -pcibios_alloc_controller(struct device_node *dev); -extern void pcibios_free_controller(struct pci_controller *phb); - /* Return values for ppc_md.pci_probe_mode function */ #define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ #define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ #define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ -#endif /* CONFIG_PPC64 */ #endif +#endif /* __KERNEL__ */ diff --git a/trunk/include/asm-powerpc/pci.h b/trunk/include/asm-ppc64/pci.h similarity index 63% rename from trunk/include/asm-powerpc/pci.h rename to trunk/include/asm-ppc64/pci.h index d5934a076bd0..fafdf885a3cc 100644 --- a/trunk/include/asm-powerpc/pci.h +++ b/trunk/include/asm-ppc64/pci.h @@ -1,5 +1,5 @@ -#ifndef __ASM_POWERPC_PCI_H -#define __ASM_POWERPC_PCI_H +#ifndef __PPC64_PCI_H +#define __PPC64_PCI_H #ifdef __KERNEL__ /* @@ -18,7 +18,6 @@ #include #include #include -#include #include @@ -27,21 +26,11 @@ struct pci_dev; -/* Values for the `which' argument to sys_pciconfig_iobase syscall. */ -#define IOBASE_BRIDGE_NUMBER 0 -#define IOBASE_MEMORY 1 -#define IOBASE_IO 2 -#define IOBASE_ISA_IO 3 -#define IOBASE_ISA_MEM 4 - -/* - * Set this to 1 if you want the kernel to re-assign all PCI - * bus numbers - */ -extern int pci_assign_all_buses; -#define pcibios_assign_all_busses() (pci_assign_all_buses) - +#ifdef CONFIG_PPC_ISERIES #define pcibios_scan_all_fns(a, b) 0 +#else +extern int pcibios_scan_all_fns(struct pci_bus *bus, int devfn); +#endif static inline void pcibios_set_master(struct pci_dev *dev) { @@ -61,7 +50,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) return channel ? 15 : 14; } -#ifdef CONFIG_PPC64 #define HAVE_ARCH_PCI_MWI 1 static inline int pcibios_prep_mwi(struct pci_dev *dev) { @@ -76,10 +64,12 @@ static inline int pcibios_prep_mwi(struct pci_dev *dev) return 0; } +extern unsigned int pcibios_assign_all_busses(void); + extern struct dma_mapping_ops pci_dma_ops; /* For DAC DMA, we currently don't support it by default, but - * we let 64-bit platforms override this. + * we let the platform override this */ static inline int pci_dac_dma_supported(struct pci_dev *hwdev,u64 mask) { @@ -112,35 +102,6 @@ extern int pci_domain_nr(struct pci_bus *bus); /* Decide whether to display the domain number in /proc */ extern int pci_proc_domain(struct pci_bus *bus); -#else /* 32-bit */ - -#ifdef CONFIG_PCI -static inline void pci_dma_burst_advice(struct pci_dev *pdev, - enum pci_dma_burst_strategy *strat, - unsigned long *strategy_parameter) -{ - *strat = PCI_DMA_BURST_INFINITY; - *strategy_parameter = ~0UL; -} -#endif - -/* - * At present there are very few 32-bit PPC machines that can have - * memory above the 4GB point, and we don't support that. - */ -#define pci_dac_dma_supported(pci_dev, mask) (0) - -/* Return the index of the PCI controller for device PDEV. */ -#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index - -/* Set the name of the bus as it appears in /proc/bus/pci */ -static inline int pci_proc_domain(struct pci_bus *bus) -{ - return 0; -} - -#endif /* CONFIG_PPC64 */ - struct vm_area_struct; /* Map a range of PCI memory or I/O space for a device into user space */ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, @@ -149,7 +110,6 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ #define HAVE_PCI_MMAP 1 -#ifdef CONFIG_PPC64 /* pci_unmap_{single,page} is not a nop, thus... */ #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ dma_addr_t ADDR_NAME; @@ -164,40 +124,22 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ (((PTR)->LEN_NAME) = (VAL)) -/* The PCI address space does not equal the physical memory address - * space (we have an IOMMU). The IDE and SCSI device layers use - * this boolean for bounce buffer decisions. - */ -#define PCI_DMA_BUS_IS_PHYS (0) - -#else /* 32-bit */ - /* The PCI address space does equal the physical memory - * address space (no IOMMU). The IDE and SCSI device layers use + * address space. The networking and block device layers use * this boolean for bounce buffer decisions. */ -#define PCI_DMA_BUS_IS_PHYS (1) - -/* pci_unmap_{page,single} is a nop so... */ -#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) -#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) -#define pci_unmap_addr(PTR, ADDR_NAME) (0) -#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) -#define pci_unmap_len(PTR, LEN_NAME) (0) -#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) - -#endif /* CONFIG_PPC64 */ +#define PCI_DMA_BUS_IS_PHYS (0) -extern void pcibios_resource_to_bus(struct pci_dev *dev, - struct pci_bus_region *region, +extern void +pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, struct resource *res); -extern void pcibios_bus_to_resource(struct pci_dev *dev, - struct resource *res, +extern void +pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region); -static inline struct resource *pcibios_select_root(struct pci_dev *pdev, - struct resource *res) +static inline struct resource * +pcibios_select_root(struct pci_dev *pdev, struct resource *res) { struct resource *root = NULL; @@ -209,12 +151,14 @@ static inline struct resource *pcibios_select_root(struct pci_dev *pdev, return root; } -extern int unmap_bus_range(struct pci_bus *bus); +extern int +unmap_bus_range(struct pci_bus *bus); -extern int remap_bus_range(struct pci_bus *bus); +extern int +remap_bus_range(struct pci_bus *bus); -extern void pcibios_fixup_device_resources(struct pci_dev *dev, - struct pci_bus *bus); +extern void +pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus); extern struct pci_controller *init_phb_dynamic(struct device_node *dn); @@ -236,12 +180,14 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file, unsigned long size, pgprot_t prot); -#if defined(CONFIG_PPC_MULTIPLATFORM) || defined(CONFIG_PPC32) +#ifdef CONFIG_PPC_MULTIPLATFORM #define HAVE_ARCH_PCI_RESOURCE_TO_USER extern void pci_resource_to_user(const struct pci_dev *dev, int bar, const struct resource *rsrc, u64 *start, u64 *end); -#endif /* CONFIG_PPC_MULTIPLATFORM || CONFIG_PPC32 */ +#endif /* CONFIG_PPC_MULTIPLATFORM */ + #endif /* __KERNEL__ */ -#endif /* __ASM_POWERPC_PCI_H */ + +#endif /* __PPC64_PCI_H */ diff --git a/trunk/include/asm-powerpc/pgalloc.h b/trunk/include/asm-ppc64/pgalloc.h similarity index 95% rename from trunk/include/asm-powerpc/pgalloc.h rename to trunk/include/asm-ppc64/pgalloc.h index bfc2113b3630..dcf3622d1946 100644 --- a/trunk/include/asm-powerpc/pgalloc.h +++ b/trunk/include/asm-ppc64/pgalloc.h @@ -1,9 +1,5 @@ -#ifndef _ASM_POWERPC_PGALLOC_H -#define _ASM_POWERPC_PGALLOC_H - -#ifndef CONFIG_PPC64 -#include -#else +#ifndef _PPC64_PGALLOC_H +#define _PPC64_PGALLOC_H #include #include @@ -152,5 +148,4 @@ extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf); #define check_pgt_cache() do { } while (0) -#endif /* CONFIG_PPC64 */ -#endif /* _ASM_POWERPC_PGALLOC_H */ +#endif /* _PPC64_PGALLOC_H */ diff --git a/trunk/include/asm-powerpc/pgtable-4k.h b/trunk/include/asm-ppc64/pgtable-4k.h similarity index 100% rename from trunk/include/asm-powerpc/pgtable-4k.h rename to trunk/include/asm-ppc64/pgtable-4k.h diff --git a/trunk/include/asm-powerpc/pgtable-64k.h b/trunk/include/asm-ppc64/pgtable-64k.h similarity index 100% rename from trunk/include/asm-powerpc/pgtable-64k.h rename to trunk/include/asm-ppc64/pgtable-64k.h diff --git a/trunk/include/asm-powerpc/pgtable.h b/trunk/include/asm-ppc64/pgtable.h similarity index 97% rename from trunk/include/asm-powerpc/pgtable.h rename to trunk/include/asm-ppc64/pgtable.h index 0303f57366c1..a9783ba7fe98 100644 --- a/trunk/include/asm-powerpc/pgtable.h +++ b/trunk/include/asm-ppc64/pgtable.h @@ -1,9 +1,5 @@ -#ifndef _ASM_POWERPC_PGTABLE_H -#define _ASM_POWERPC_PGTABLE_H - -#ifndef CONFIG_PPC64 -#include -#else +#ifndef _PPC64_PGTABLE_H +#define _PPC64_PGTABLE_H /* * This file contains the functions and defines necessary to modify and use @@ -50,13 +46,6 @@ struct mm_struct; #define VMALLOC_SIZE (0x80000000000UL) #define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE) -/* - * Define the address range of the imalloc VM area. - */ -#define PHBS_IO_BASE VMALLOC_END -#define IMALLOC_BASE (PHBS_IO_BASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */ -#define IMALLOC_END (VMALLOC_START + PGTABLE_RANGE) - /* * Common bits in a linux-style PTE. These match the bits in the * (hardware-defined) PowerPC PTE as closely as possible. Additional @@ -80,7 +69,7 @@ struct mm_struct; #define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY) -/* __pgprot defined in asm-powerpc/page.h */ +/* __pgprot defined in asm-ppc64/page.h */ #define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED) #define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER) @@ -520,5 +509,4 @@ void pgtable_cache_init(void); #endif /* __ASSEMBLY__ */ -#endif /* CONFIG_PPC64 */ -#endif /* _ASM_POWERPC_PGTABLE_H */ +#endif /* _PPC64_PGTABLE_H */ diff --git a/trunk/include/asm-ppc64/prom.h b/trunk/include/asm-ppc64/prom.h new file mode 100644 index 000000000000..ddfe186589fa --- /dev/null +++ b/trunk/include/asm-ppc64/prom.h @@ -0,0 +1,220 @@ +#ifndef _PPC64_PROM_H +#define _PPC64_PROM_H + +/* + * Definitions for talking to the Open Firmware PROM on + * Power Macintosh computers. + * + * Copyright (C) 1996 Paul Mackerras. + * + * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#include +#include +#include + +#define PTRRELOC(x) ((typeof(x))((unsigned long)(x) - offset)) +#define PTRUNRELOC(x) ((typeof(x))((unsigned long)(x) + offset)) +#define RELOC(x) (*PTRRELOC(&(x))) + +/* Definitions used by the flattened device tree */ +#define OF_DT_HEADER 0xd00dfeed /* marker */ +#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */ +#define OF_DT_END_NODE 0x2 /* End node */ +#define OF_DT_PROP 0x3 /* Property: name off, size, + * content */ +#define OF_DT_NOP 0x4 /* nop */ +#define OF_DT_END 0x9 + +#define OF_DT_VERSION 0x10 + +/* + * This is what gets passed to the kernel by prom_init or kexec + * + * The dt struct contains the device tree structure, full pathes and + * property contents. The dt strings contain a separate block with just + * the strings for the property names, and is fully page aligned and + * self contained in a page, so that it can be kept around by the kernel, + * each property name appears only once in this page (cheap compression) + * + * the mem_rsvmap contains a map of reserved ranges of physical memory, + * passing it here instead of in the device-tree itself greatly simplifies + * the job of everybody. It's just a list of u64 pairs (base/size) that + * ends when size is 0 + */ +struct boot_param_header +{ + u32 magic; /* magic word OF_DT_HEADER */ + u32 totalsize; /* total size of DT block */ + u32 off_dt_struct; /* offset to structure */ + u32 off_dt_strings; /* offset to strings */ + u32 off_mem_rsvmap; /* offset to memory reserve map */ + u32 version; /* format version */ + u32 last_comp_version; /* last compatible version */ + /* version 2 fields below */ + u32 boot_cpuid_phys; /* Physical CPU id we're booting on */ + /* version 3 fields below */ + u32 dt_strings_size; /* size of the DT strings block */ +}; + + + +typedef u32 phandle; +typedef u32 ihandle; + +struct address_range { + unsigned long space; + unsigned long address; + unsigned long size; +}; + +struct interrupt_info { + int line; + int sense; /* +ve/-ve logic, edge or level, etc. */ +}; + +struct pci_address { + u32 a_hi; + u32 a_mid; + u32 a_lo; +}; + +struct isa_address { + u32 a_hi; + u32 a_lo; +}; + +struct isa_range { + struct isa_address isa_addr; + struct pci_address pci_addr; + unsigned int size; +}; + +struct reg_property { + unsigned long address; + unsigned long size; +}; + +struct reg_property32 { + unsigned int address; + unsigned int size; +}; + +struct reg_property64 { + unsigned long address; + unsigned long size; +}; + +struct property { + char *name; + int length; + unsigned char *value; + struct property *next; +}; + +struct device_node { + char *name; + char *type; + phandle node; + phandle linux_phandle; + int n_addrs; + struct address_range *addrs; + int n_intrs; + struct interrupt_info *intrs; + char *full_name; + + struct property *properties; + struct device_node *parent; + struct device_node *child; + struct device_node *sibling; + struct device_node *next; /* next device of same type */ + struct device_node *allnext; /* next in list of all nodes */ + struct proc_dir_entry *pde; /* this node's proc directory */ + struct kref kref; + unsigned long _flags; + void *data; +#ifdef CONFIG_PPC_ISERIES + struct list_head Device_List; +#endif +}; + +extern struct device_node *of_chosen; + +/* flag descriptions */ +#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ + +#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) +#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) + +/* + * Until 32-bit ppc can add proc_dir_entries to its device_node + * definition, we cannot refer to pde, name_link, and addr_link + * in arch-independent code. + */ +#define HAVE_ARCH_DEVTREE_FIXUPS + +static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) +{ + dn->pde = de; +} + + +/* OBSOLETE: Old stlye node lookup */ +extern struct device_node *find_devices(const char *name); +extern struct device_node *find_type_devices(const char *type); +extern struct device_node *find_path_device(const char *path); +extern struct device_node *find_compatible_devices(const char *type, + const char *compat); +extern struct device_node *find_all_nodes(void); + +/* New style node lookup */ +extern struct device_node *of_find_node_by_name(struct device_node *from, + const char *name); +extern struct device_node *of_find_node_by_type(struct device_node *from, + const char *type); +extern struct device_node *of_find_compatible_node(struct device_node *from, + const char *type, const char *compat); +extern struct device_node *of_find_node_by_path(const char *path); +extern struct device_node *of_find_node_by_phandle(phandle handle); +extern struct device_node *of_find_all_nodes(struct device_node *prev); +extern struct device_node *of_get_parent(const struct device_node *node); +extern struct device_node *of_get_next_child(const struct device_node *node, + struct device_node *prev); +extern struct device_node *of_node_get(struct device_node *node); +extern void of_node_put(struct device_node *node); + +/* For scanning the flat device-tree at boot time */ +int __init of_scan_flat_dt(int (*it)(unsigned long node, + const char *uname, int depth, + void *data), + void *data); +void* __init of_get_flat_dt_prop(unsigned long node, const char *name, + unsigned long *size); + +/* For updating the device tree at runtime */ +extern void of_attach_node(struct device_node *); +extern void of_detach_node(const struct device_node *); + +/* Other Prototypes */ +extern unsigned long prom_init(unsigned long, unsigned long, unsigned long, + unsigned long, unsigned long); +extern void finish_device_tree(void); +extern void unflatten_device_tree(void); +extern void early_init_devtree(void *); +extern int device_is_compatible(struct device_node *device, const char *); +extern int machine_is_compatible(const char *compat); +extern unsigned char *get_property(struct device_node *node, const char *name, + int *lenp); +extern void print_properties(struct device_node *node); +extern int prom_n_addr_cells(struct device_node* np); +extern int prom_n_size_cells(struct device_node* np); +extern int prom_n_intr_cells(struct device_node* np); +extern void prom_get_irq_senses(unsigned char *senses, int off, int max); +extern int prom_add_property(struct device_node* np, struct property* prop); + +#endif /* _PPC64_PROM_H */ diff --git a/trunk/arch/powerpc/kernel/ptrace-common.h b/trunk/include/asm-ppc64/ptrace-common.h similarity index 100% rename from trunk/arch/powerpc/kernel/ptrace-common.h rename to trunk/include/asm-ppc64/ptrace-common.h diff --git a/trunk/include/asm-powerpc/serial.h b/trunk/include/asm-ppc64/serial.h similarity index 53% rename from trunk/include/asm-powerpc/serial.h rename to trunk/include/asm-ppc64/serial.h index b273d630b32f..d6bcb79b7d7b 100644 --- a/trunk/include/asm-powerpc/serial.h +++ b/trunk/include/asm-ppc64/serial.h @@ -1,16 +1,21 @@ /* + * include/asm-ppc64/serial.h + */ +#ifndef _PPC64_SERIAL_H +#define _PPC64_SERIAL_H + +/* + * This assumes you have a 1.8432 MHz clock for your UART. + * + * It'd be nice if someone built a serial card with a 24.576 MHz + * clock, since the 16550A is capable of handling a top speed of 1.5 + * megabits/second; but this requires the faster clock. + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ -#ifndef _ASM_POWERPC_SERIAL_H -#define _ASM_POWERPC_SERIAL_H - -/* - * Serial ports are not listed here, because they are discovered - * through the device tree. - */ /* Default baud base if not found in device-tree */ #define BASE_BAUD ( 1843200 / 16 ) diff --git a/trunk/include/asm-powerpc/spinlock.h b/trunk/include/asm-ppc64/spinlock.h similarity index 80% rename from trunk/include/asm-powerpc/spinlock.h rename to trunk/include/asm-ppc64/spinlock.h index caa4b14e0e94..7d84fb5e39f1 100644 --- a/trunk/include/asm-powerpc/spinlock.h +++ b/trunk/include/asm-ppc64/spinlock.h @@ -18,41 +18,31 @@ * * (the type definitions are in asm/spinlock_types.h) */ -#ifdef CONFIG_PPC64 +#include #include #include #include -#endif -#include -#include #define __raw_spin_is_locked(x) ((x)->slock != 0) -#ifdef CONFIG_PPC64 -/* use 0x800000yy when locked, where yy == CPU number */ -#define LOCK_TOKEN (*(u32 *)(&get_paca()->lock_token)) -#else -#define LOCK_TOKEN 1 -#endif - /* * This returns the old value in the lock, so we succeeded * in getting the lock if the return value is 0. */ static __inline__ unsigned long __spin_trylock(raw_spinlock_t *lock) { - unsigned long tmp, token; + unsigned long tmp, tmp2; - token = LOCK_TOKEN; __asm__ __volatile__( -"1: lwarx %0,0,%2 # __spin_trylock\n\ +" lwz %1,%3(13) # __spin_trylock\n\ +1: lwarx %0,0,%2\n\ cmpwi 0,%0,0\n\ bne- 2f\n\ stwcx. %1,0,%2\n\ bne- 1b\n\ isync\n\ -2:" : "=&r" (tmp) - : "r" (token), "r" (&lock->slock) +2:" : "=&r" (tmp), "=&r" (tmp2) + : "r" (&lock->slock), "i" (offsetof(struct paca_struct, lock_token)) : "cr0", "memory"); return tmp; @@ -123,17 +113,11 @@ static void __inline__ __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long static __inline__ void __raw_spin_unlock(raw_spinlock_t *lock) { - __asm__ __volatile__(SYNC_ON_SMP" # __raw_spin_unlock" - : : :"memory"); + __asm__ __volatile__("lwsync # __raw_spin_unlock": : :"memory"); lock->slock = 0; } -#ifdef CONFIG_PPC64 extern void __raw_spin_unlock_wait(raw_spinlock_t *lock); -#else -#define __raw_spin_unlock_wait(lock) \ - do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) -#endif /* * Read-write spinlocks, allowing multiple readers @@ -149,14 +133,6 @@ extern void __raw_spin_unlock_wait(raw_spinlock_t *lock); #define __raw_read_can_lock(rw) ((rw)->lock >= 0) #define __raw_write_can_lock(rw) (!(rw)->lock) -#ifdef CONFIG_PPC64 -#define __DO_SIGN_EXTEND "extsw %0,%0\n" -#define WRLOCK_TOKEN LOCK_TOKEN /* it's negative */ -#else -#define __DO_SIGN_EXTEND -#define WRLOCK_TOKEN (-1) -#endif - /* * This returns the old value in the lock + 1, * so we got a read lock if the return value is > 0. @@ -166,12 +142,11 @@ static long __inline__ __read_trylock(raw_rwlock_t *rw) long tmp; __asm__ __volatile__( -"1: lwarx %0,0,%1 # read_trylock\n" - __DO_SIGN_EXTEND -" addic. %0,%0,1\n\ - ble- 2f\n" - PPC405_ERR77(0,%1) -" stwcx. %0,0,%1\n\ +"1: lwarx %0,0,%1 # read_trylock\n\ + extsw %0,%0\n\ + addic. %0,%0,1\n\ + ble- 2f\n\ + stwcx. %0,0,%1\n\ bne- 1b\n\ isync\n\ 2:" : "=&r" (tmp) @@ -187,19 +162,18 @@ static long __inline__ __read_trylock(raw_rwlock_t *rw) */ static __inline__ long __write_trylock(raw_rwlock_t *rw) { - long tmp, token; + long tmp, tmp2; - token = WRLOCK_TOKEN; __asm__ __volatile__( -"1: lwarx %0,0,%2 # write_trylock\n\ +" lwz %1,%3(13) # write_trylock\n\ +1: lwarx %0,0,%2\n\ cmpwi 0,%0,0\n\ - bne- 2f\n" - PPC405_ERR77(0,%1) -" stwcx. %1,0,%2\n\ + bne- 2f\n\ + stwcx. %1,0,%2\n\ bne- 1b\n\ isync\n\ -2:" : "=&r" (tmp) - : "r" (token), "r" (&rw->lock) +2:" : "=&r" (tmp), "=&r" (tmp2) + : "r" (&rw->lock), "i" (offsetof(struct paca_struct, lock_token)) : "cr0", "memory"); return tmp; @@ -250,9 +224,8 @@ static void __inline__ __raw_read_unlock(raw_rwlock_t *rw) __asm__ __volatile__( "eieio # read_unlock\n\ 1: lwarx %0,0,%1\n\ - addic %0,%0,-1\n" - PPC405_ERR77(0,%1) -" stwcx. %0,0,%1\n\ + addic %0,%0,-1\n\ + stwcx. %0,0,%1\n\ bne- 1b" : "=&r"(tmp) : "r"(&rw->lock) @@ -261,8 +234,7 @@ static void __inline__ __raw_read_unlock(raw_rwlock_t *rw) static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) { - __asm__ __volatile__(SYNC_ON_SMP" # write_unlock" - : : :"memory"); + __asm__ __volatile__("lwsync # write_unlock": : :"memory"); rw->lock = 0; } diff --git a/trunk/include/asm-ppc64/system.h b/trunk/include/asm-ppc64/system.h new file mode 100644 index 000000000000..bf9a6aba19c9 --- /dev/null +++ b/trunk/include/asm-ppc64/system.h @@ -0,0 +1,310 @@ +#ifndef __PPC64_SYSTEM_H +#define __PPC64_SYSTEM_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 of the License, or (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include + +/* + * Memory barrier. + * The sync instruction guarantees that all memory accesses initiated + * by this processor have been performed (with respect to all other + * mechanisms that access memory). The eieio instruction is a barrier + * providing an ordering (separately) for (a) cacheable stores and (b) + * loads and stores to non-cacheable memory (e.g. I/O devices). + * + * mb() prevents loads and stores being reordered across this point. + * rmb() prevents loads being reordered across this point. + * wmb() prevents stores being reordered across this point. + * read_barrier_depends() prevents data-dependent loads being reordered + * across this point (nop on PPC). + * + * We have to use the sync instructions for mb(), since lwsync doesn't + * order loads with respect to previous stores. Lwsync is fine for + * rmb(), though. + * For wmb(), we use sync since wmb is used in drivers to order + * stores to system memory with respect to writes to the device. + * However, smp_wmb() can be a lighter-weight eieio barrier on + * SMP since it is only used to order updates to system memory. + */ +#define mb() __asm__ __volatile__ ("sync" : : : "memory") +#define rmb() __asm__ __volatile__ ("lwsync" : : : "memory") +#define wmb() __asm__ __volatile__ ("sync" : : : "memory") +#define read_barrier_depends() do { } while(0) + +#define set_mb(var, value) do { var = value; smp_mb(); } while (0) +#define set_wmb(var, value) do { var = value; smp_wmb(); } while (0) + +#ifdef CONFIG_SMP +#define smp_mb() mb() +#define smp_rmb() rmb() +#define smp_wmb() eieio() +#define smp_read_barrier_depends() read_barrier_depends() +#else +#define smp_mb() __asm__ __volatile__("": : :"memory") +#define smp_rmb() __asm__ __volatile__("": : :"memory") +#define smp_wmb() __asm__ __volatile__("": : :"memory") +#define smp_read_barrier_depends() do { } while(0) +#endif /* CONFIG_SMP */ + +#ifdef __KERNEL__ +struct task_struct; +struct pt_regs; + +#ifdef CONFIG_DEBUGGER + +extern int (*__debugger)(struct pt_regs *regs); +extern int (*__debugger_ipi)(struct pt_regs *regs); +extern int (*__debugger_bpt)(struct pt_regs *regs); +extern int (*__debugger_sstep)(struct pt_regs *regs); +extern int (*__debugger_iabr_match)(struct pt_regs *regs); +extern int (*__debugger_dabr_match)(struct pt_regs *regs); +extern int (*__debugger_fault_handler)(struct pt_regs *regs); + +#define DEBUGGER_BOILERPLATE(__NAME) \ +static inline int __NAME(struct pt_regs *regs) \ +{ \ + if (unlikely(__ ## __NAME)) \ + return __ ## __NAME(regs); \ + return 0; \ +} + +DEBUGGER_BOILERPLATE(debugger) +DEBUGGER_BOILERPLATE(debugger_ipi) +DEBUGGER_BOILERPLATE(debugger_bpt) +DEBUGGER_BOILERPLATE(debugger_sstep) +DEBUGGER_BOILERPLATE(debugger_iabr_match) +DEBUGGER_BOILERPLATE(debugger_dabr_match) +DEBUGGER_BOILERPLATE(debugger_fault_handler) + +#ifdef CONFIG_XMON +extern void xmon_init(int enable); +#endif + +#else +static inline int debugger(struct pt_regs *regs) { return 0; } +static inline int debugger_ipi(struct pt_regs *regs) { return 0; } +static inline int debugger_bpt(struct pt_regs *regs) { return 0; } +static inline int debugger_sstep(struct pt_regs *regs) { return 0; } +static inline int debugger_iabr_match(struct pt_regs *regs) { return 0; } +static inline int debugger_dabr_match(struct pt_regs *regs) { return 0; } +static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; } +#endif + +extern int set_dabr(unsigned long dabr); +extern void _exception(int signr, struct pt_regs *regs, int code, + unsigned long addr); +extern int fix_alignment(struct pt_regs *regs); +extern void bad_page_fault(struct pt_regs *regs, unsigned long address, + int sig); +extern void show_regs(struct pt_regs * regs); +extern void low_hash_fault(struct pt_regs *regs, unsigned long address); +extern int die(const char *str, struct pt_regs *regs, long err); + +extern int _get_PVR(void); +extern void giveup_fpu(struct task_struct *); +extern void disable_kernel_fp(void); +extern void flush_fp_to_thread(struct task_struct *); +extern void enable_kernel_fp(void); +extern void giveup_altivec(struct task_struct *); +extern void disable_kernel_altivec(void); +extern void enable_kernel_altivec(void); +extern int emulate_altivec(struct pt_regs *); +extern void cvt_fd(float *from, double *to, struct thread_struct *thread); +extern void cvt_df(double *from, float *to, struct thread_struct *thread); + +#ifdef CONFIG_ALTIVEC +extern void flush_altivec_to_thread(struct task_struct *); +#else +static inline void flush_altivec_to_thread(struct task_struct *t) +{ +} +#endif + +static inline void flush_spe_to_thread(struct task_struct *t) +{ +} + +extern int mem_init_done; /* set on boot once kmalloc can be called */ +extern unsigned long memory_limit; + +/* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */ +extern unsigned char e2a(unsigned char); + +extern struct task_struct *__switch_to(struct task_struct *, + struct task_struct *); +#define switch_to(prev, next, last) ((last) = __switch_to((prev), (next))) + +struct thread_struct; +extern struct task_struct * _switch(struct thread_struct *prev, + struct thread_struct *next); + +extern unsigned long klimit; + +extern int powersave_nap; /* set if nap mode can be used in idle loop */ + +/* + * Atomic exchange + * + * Changes the memory location '*ptr' to be val and returns + * the previous value stored there. + * + * Inline asm pulled from arch/ppc/kernel/misc.S so ppc64 + * is more like most of the other architectures. + */ +static __inline__ unsigned long +__xchg_u32(volatile unsigned int *m, unsigned long val) +{ + unsigned long dummy; + + __asm__ __volatile__( + EIEIO_ON_SMP +"1: lwarx %0,0,%3 # __xchg_u32\n\ + stwcx. %2,0,%3\n\ +2: bne- 1b" + ISYNC_ON_SMP + : "=&r" (dummy), "=m" (*m) + : "r" (val), "r" (m) + : "cc", "memory"); + + return (dummy); +} + +static __inline__ unsigned long +__xchg_u64(volatile long *m, unsigned long val) +{ + unsigned long dummy; + + __asm__ __volatile__( + EIEIO_ON_SMP +"1: ldarx %0,0,%3 # __xchg_u64\n\ + stdcx. %2,0,%3\n\ +2: bne- 1b" + ISYNC_ON_SMP + : "=&r" (dummy), "=m" (*m) + : "r" (val), "r" (m) + : "cc", "memory"); + + return (dummy); +} + +/* + * This function doesn't exist, so you'll get a linker error + * if something tries to do an invalid xchg(). + */ +extern void __xchg_called_with_bad_pointer(void); + +static __inline__ unsigned long +__xchg(volatile void *ptr, unsigned long x, unsigned int size) +{ + switch (size) { + case 4: + return __xchg_u32(ptr, x); + case 8: + return __xchg_u64(ptr, x); + } + __xchg_called_with_bad_pointer(); + return x; +} + +#define xchg(ptr,x) \ + ({ \ + __typeof__(*(ptr)) _x_ = (x); \ + (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \ + }) + +#define tas(ptr) (xchg((ptr),1)) + +#define __HAVE_ARCH_CMPXCHG 1 + +static __inline__ unsigned long +__cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) +{ + unsigned int prev; + + __asm__ __volatile__ ( + EIEIO_ON_SMP +"1: lwarx %0,0,%2 # __cmpxchg_u32\n\ + cmpw 0,%0,%3\n\ + bne- 2f\n\ + stwcx. %4,0,%2\n\ + bne- 1b" + ISYNC_ON_SMP + "\n\ +2:" + : "=&r" (prev), "=m" (*p) + : "r" (p), "r" (old), "r" (new), "m" (*p) + : "cc", "memory"); + + return prev; +} + +static __inline__ unsigned long +__cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) +{ + unsigned long prev; + + __asm__ __volatile__ ( + EIEIO_ON_SMP +"1: ldarx %0,0,%2 # __cmpxchg_u64\n\ + cmpd 0,%0,%3\n\ + bne- 2f\n\ + stdcx. %4,0,%2\n\ + bne- 1b" + ISYNC_ON_SMP + "\n\ +2:" + : "=&r" (prev), "=m" (*p) + : "r" (p), "r" (old), "r" (new), "m" (*p) + : "cc", "memory"); + + return prev; +} + +/* This function doesn't exist, so you'll get a linker error + if something tries to do an invalid cmpxchg(). */ +extern void __cmpxchg_called_with_bad_pointer(void); + +static __inline__ unsigned long +__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, + unsigned int size) +{ + switch (size) { + case 4: + return __cmpxchg_u32(ptr, old, new); + case 8: + return __cmpxchg_u64(ptr, old, new); + } + __cmpxchg_called_with_bad_pointer(); + return old; +} + +#define cmpxchg(ptr,o,n)\ + ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ + (unsigned long)(n),sizeof(*(ptr)))) + +/* + * We handle most unaligned accesses in hardware. On the other hand + * unaligned DMA can be very expensive on some ppc64 IO chips (it does + * powers of 2 writes until it reaches sufficient alignment). + * + * Based on this we disable the IP header alignment in network drivers. + */ +#define NET_IP_ALIGN 0 + +#define arch_align_stack(x) (x) + +extern unsigned long reloc_offset(void); + +#endif /* __KERNEL__ */ +#endif diff --git a/trunk/include/asm-s390/atomic.h b/trunk/include/asm-s390/atomic.h index b3bd4f679f72..9d86ba6f12d0 100644 --- a/trunk/include/asm-s390/atomic.h +++ b/trunk/include/asm-s390/atomic.h @@ -198,18 +198,6 @@ atomic_compare_and_swap(int expected_oldval,int new_val,atomic_t *v) return retval; } -#define atomic_cmpxchg(v, o, n) (atomic_compare_and_swap((o), (n), &((v)->counter))) - -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - #define smp_mb__before_atomic_dec() smp_mb() #define smp_mb__after_atomic_dec() smp_mb() #define smp_mb__before_atomic_inc() smp_mb() diff --git a/trunk/include/asm-s390/bitops.h b/trunk/include/asm-s390/bitops.h index 61232760cc3b..b07c578b22ea 100644 --- a/trunk/include/asm-s390/bitops.h +++ b/trunk/include/asm-s390/bitops.h @@ -839,7 +839,6 @@ static inline int sched_find_first_bit(unsigned long *b) * fls: find last bit set. */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) /* * hweightN: returns the hamming weight (i.e. the number diff --git a/trunk/include/asm-sh/atomic.h b/trunk/include/asm-sh/atomic.h index aabfd334462c..3c4f805da1ac 100644 --- a/trunk/include/asm-sh/atomic.h +++ b/trunk/include/asm-sh/atomic.h @@ -87,35 +87,6 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v) #define atomic_inc(v) atomic_add(1,(v)) #define atomic_dec(v) atomic_sub(1,(v)) -static inline int atomic_cmpxchg(atomic_t *v, int old, int new) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (likely(ret == old)) - v->counter = new; - local_irq_restore(flags); - - return ret; -} - -static inline int atomic_add_unless(atomic_t *v, int a, int u) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (ret != u) - v->counter += a; - local_irq_restore(flags); - - return ret != u; -} -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - static __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v) { unsigned long flags; diff --git a/trunk/include/asm-sh/bitops.h b/trunk/include/asm-sh/bitops.h index 1c5260860045..5163d1ff2f1b 100644 --- a/trunk/include/asm-sh/bitops.h +++ b/trunk/include/asm-sh/bitops.h @@ -470,7 +470,6 @@ static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned lon */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) #endif /* __KERNEL__ */ diff --git a/trunk/include/asm-sh64/atomic.h b/trunk/include/asm-sh64/atomic.h index 927a2bc27b30..8c3872d3e65f 100644 --- a/trunk/include/asm-sh64/atomic.h +++ b/trunk/include/asm-sh64/atomic.h @@ -99,35 +99,6 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v) #define atomic_inc(v) atomic_add(1,(v)) #define atomic_dec(v) atomic_sub(1,(v)) -static inline int atomic_cmpxchg(atomic_t *v, int old, int new) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (likely(ret == old)) - v->counter = new; - local_irq_restore(flags); - - return ret; -} - -static inline int atomic_add_unless(atomic_t *v, int a, int u) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (ret != u) - v->counter += a; - local_irq_restore(flags); - - return ret != u; -} -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - static __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v) { unsigned long flags; diff --git a/trunk/include/asm-sh64/bitops.h b/trunk/include/asm-sh64/bitops.h index ce9c3ad45fe0..e1ff63e09227 100644 --- a/trunk/include/asm-sh64/bitops.h +++ b/trunk/include/asm-sh64/bitops.h @@ -510,7 +510,6 @@ static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned lon #define ffs(x) generic_ffs(x) #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) #endif /* __KERNEL__ */ diff --git a/trunk/include/asm-sparc/atomic.h b/trunk/include/asm-sparc/atomic.h index 62bec7ad271c..37f6ab601c3d 100644 --- a/trunk/include/asm-sparc/atomic.h +++ b/trunk/include/asm-sparc/atomic.h @@ -19,8 +19,6 @@ typedef struct { volatile int counter; } atomic_t; #define ATOMIC_INIT(i) { (i) } extern int __atomic_add_return(int, atomic_t *); -extern int atomic_cmpxchg(atomic_t *, int, int); -extern int atomic_add_unless(atomic_t *, int, int); extern void atomic_set(atomic_t *, int); #define atomic_read(v) ((v)->counter) @@ -50,8 +48,6 @@ extern void atomic_set(atomic_t *, int); #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) #define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - /* This is the old 24-bit implementation. It's still used internally * by some sparc-specific code, notably the semaphore implementation. */ diff --git a/trunk/include/asm-sparc/bitops.h b/trunk/include/asm-sparc/bitops.h index 41722b5e45ef..bfbd795a0a80 100644 --- a/trunk/include/asm-sparc/bitops.h +++ b/trunk/include/asm-sparc/bitops.h @@ -298,7 +298,6 @@ static inline int ffs(int x) * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) /* * hweightN: returns the hamming weight (i.e. the number diff --git a/trunk/include/asm-sparc/memreg.h b/trunk/include/asm-sparc/memreg.h index 5fb95c828da6..c0498d3baf93 100644 --- a/trunk/include/asm-sparc/memreg.h +++ b/trunk/include/asm-sparc/memreg.h @@ -36,7 +36,7 @@ /* Memory parity error register with associated bit constants. */ #ifndef __ASSEMBLY__ -extern __volatile__ unsigned long __iomem *sun4c_memerr_reg; +extern __volatile__ unsigned long *sun4c_memerr_reg; #endif #define SUN4C_MPE_ERROR 0x80 /* Parity error detected. (ro) */ diff --git a/trunk/include/asm-sparc/pcic.h b/trunk/include/asm-sparc/pcic.h index dedea14d87c8..301ae8022ddd 100644 --- a/trunk/include/asm-sparc/pcic.h +++ b/trunk/include/asm-sparc/pcic.h @@ -16,10 +16,10 @@ #include struct linux_pcic { - void __iomem *pcic_regs; + void * __iomem pcic_regs; unsigned long pcic_io; - void __iomem *pcic_config_space_addr; - void __iomem *pcic_config_space_data; + void * __iomem pcic_config_space_addr; + void * __iomem pcic_config_space_data; struct resource pcic_res_regs; struct resource pcic_res_io; struct resource pcic_res_cfg_addr; diff --git a/trunk/include/asm-sparc64/atomic.h b/trunk/include/asm-sparc64/atomic.h index 3789fe315992..e175afcf2cde 100644 --- a/trunk/include/asm-sparc64/atomic.h +++ b/trunk/include/asm-sparc64/atomic.h @@ -54,7 +54,6 @@ extern int atomic64_sub_ret(int, atomic64_t *); * other cases. */ #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) -#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0) #define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0) #define atomic64_sub_and_test(i, v) (atomic64_sub_ret(i, v) == 0) @@ -71,18 +70,6 @@ extern int atomic64_sub_ret(int, atomic64_t *); #define atomic_add_negative(i, v) (atomic_add_ret(i, v) < 0) #define atomic64_add_negative(i, v) (atomic64_add_ret(i, v) < 0) -#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) - -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - /* Atomic operations are already serializing */ #ifdef CONFIG_SMP #define smp_mb__before_atomic_dec() membar_storeload_loadload(); diff --git a/trunk/include/asm-sparc64/bitops.h b/trunk/include/asm-sparc64/bitops.h index 6efc0162fb09..6388b8376c50 100644 --- a/trunk/include/asm-sparc64/bitops.h +++ b/trunk/include/asm-sparc64/bitops.h @@ -119,7 +119,6 @@ static inline unsigned long __ffs(unsigned long word) */ #define fls(x) generic_fls(x) -#define fls64(x) generic_fls64(x) #ifdef __KERNEL__ diff --git a/trunk/include/asm-sparc64/pgtable.h b/trunk/include/asm-sparc64/pgtable.h index f0a9b44d3eb5..9a02879b235d 100644 --- a/trunk/include/asm-sparc64/pgtable.h +++ b/trunk/include/asm-sparc64/pgtable.h @@ -348,6 +348,16 @@ extern unsigned long find_ecache_flush_span(unsigned long size); struct vm_area_struct; extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); +/* Make a non-present pseudo-TTE. */ +static inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space) +{ + pte_t pte; + pte_val(pte) = (((page) | pgprot_val(prot) | _PAGE_E) & + ~(unsigned long)_PAGE_CACHE); + pte_val(pte) |= (((unsigned long)space) << 32); + return pte; +} + /* Encode and de-code a swap entry */ #define __swp_type(entry) (((entry).val >> PAGE_SHIFT) & 0xffUL) #define __swp_offset(entry) ((entry).val >> (PAGE_SHIFT + 8UL)) diff --git a/trunk/include/asm-um/ldt-i386.h b/trunk/include/asm-um/ldt-i386.h index 175722a91164..b42662929b6c 100644 --- a/trunk/include/asm-um/ldt-i386.h +++ b/trunk/include/asm-um/ldt-i386.h @@ -35,7 +35,7 @@ typedef struct uml_ldt { union { struct ldt_entry * pages[LDT_PAGES_MAX]; struct ldt_entry entries[LDT_DIRECT_ENTRIES]; - } u; + }; } uml_ldt_t; /* diff --git a/trunk/include/asm-um/ldt-x86_64.h b/trunk/include/asm-um/ldt.h similarity index 95% rename from trunk/include/asm-um/ldt-x86_64.h rename to trunk/include/asm-um/ldt.h index 175722a91164..4466ff6de0fd 100644 --- a/trunk/include/asm-um/ldt-x86_64.h +++ b/trunk/include/asm-um/ldt.h @@ -35,7 +35,7 @@ typedef struct uml_ldt { union { struct ldt_entry * pages[LDT_PAGES_MAX]; struct ldt_entry entries[LDT_DIRECT_ENTRIES]; - } u; + }; } uml_ldt_t; /* @@ -67,3 +67,8 @@ typedef struct uml_ldt { (info)->useable == 0 ) #endif +#ifndef __UM_LDT_H +#define __UM_LDT_H + +#include "asm/arch/ldt.h" +#endif diff --git a/trunk/include/asm-v850/atomic.h b/trunk/include/asm-v850/atomic.h index bede3172ce7f..395268a8c0de 100644 --- a/trunk/include/asm-v850/atomic.h +++ b/trunk/include/asm-v850/atomic.h @@ -90,36 +90,6 @@ static __inline__ void atomic_clear_mask (unsigned long mask, unsigned long *add #define atomic_dec_and_test(v) (atomic_sub_return (1, (v)) == 0) #define atomic_add_negative(i,v) (atomic_add_return ((i), (v)) < 0) -static inline int atomic_cmpxchg(atomic_t *v, int old, int new) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (likely(ret == old)) - v->counter = new; - local_irq_restore(flags); - - return ret; -} - -static inline int atomic_add_unless(atomic_t *v, int a, int u) -{ - int ret; - unsigned long flags; - - local_irq_save(flags); - ret = v->counter; - if (ret != u) - v->counter += a; - local_irq_restore(flags); - - return ret != u; -} - -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - /* Atomic operations are already serializing on ARM */ #define smp_mb__before_atomic_dec() barrier() #define smp_mb__after_atomic_dec() barrier() diff --git a/trunk/include/asm-v850/bitops.h b/trunk/include/asm-v850/bitops.h index 8955d2376ac8..b91e799763fd 100644 --- a/trunk/include/asm-v850/bitops.h +++ b/trunk/include/asm-v850/bitops.h @@ -276,7 +276,6 @@ static __inline__ unsigned long find_next_bit(const unsigned long *addr, #define ffs(x) generic_ffs (x) #define fls(x) generic_fls (x) -#define fls64(x) generic_fls64(x) #define __ffs(x) ffs(x) diff --git a/trunk/include/asm-v850/hardirq.h b/trunk/include/asm-v850/hardirq.h index d98488cd5af1..5dfca8047cbe 100644 --- a/trunk/include/asm-v850/hardirq.h +++ b/trunk/include/asm-v850/hardirq.h @@ -5,8 +5,6 @@ #include #include -#include - typedef struct { unsigned int __softirq_pending; } ____cacheline_aligned irq_cpustat_t; @@ -24,6 +22,4 @@ typedef struct { # error HARDIRQ_BITS is too low! #endif -void ack_bad_irq(unsigned int irq); - #endif /* __V850_HARDIRQ_H__ */ diff --git a/trunk/include/asm-x86_64/apic.h b/trunk/include/asm-x86_64/apic.h index 5647b7de1749..6c5d5ca8383a 100644 --- a/trunk/include/asm-x86_64/apic.h +++ b/trunk/include/asm-x86_64/apic.h @@ -111,8 +111,6 @@ extern unsigned int nmi_watchdog; extern int disable_timer_pin_1; -extern void setup_threshold_lvt(unsigned long lvt_off); - #endif /* CONFIG_X86_LOCAL_APIC */ extern unsigned boot_cpu_id; diff --git a/trunk/include/asm-x86_64/atomic.h b/trunk/include/asm-x86_64/atomic.h index 50db9f39274f..fc4c5956e1ea 100644 --- a/trunk/include/asm-x86_64/atomic.h +++ b/trunk/include/asm-x86_64/atomic.h @@ -160,8 +160,8 @@ static __inline__ int atomic_inc_and_test(atomic_t *v) /** * atomic_add_negative - add and test if negative - * @i: integer value to add * @v: pointer of type atomic_t + * @i: integer value to add * * Atomically adds @i to @v and returns true * if the result is negative, or false when @@ -178,31 +178,6 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v) return c; } -/** - * atomic_add_return - add and return - * @i: integer value to add - * @v: pointer of type atomic_t - * - * Atomically adds @i to @v and returns @i + @v - */ -static __inline__ int atomic_add_return(int i, atomic_t *v) -{ - int __i = i; - __asm__ __volatile__( - LOCK "xaddl %0, %1;" - :"=r"(i) - :"m"(v->counter), "0"(i)); - return i + __i; -} - -static __inline__ int atomic_sub_return(int i, atomic_t *v) -{ - return atomic_add_return(-i,v); -} - -#define atomic_inc_return(v) (atomic_add_return(1,v)) -#define atomic_dec_return(v) (atomic_sub_return(1,v)) - /* An 64bit atomic type */ typedef struct { volatile long counter; } atomic64_t; @@ -345,14 +320,14 @@ static __inline__ int atomic64_inc_and_test(atomic64_t *v) /** * atomic64_add_negative - add and test if negative + * @v: pointer to atomic64_t * @i: integer value to add - * @v: pointer to type atomic64_t * * Atomically adds @i to @v and returns true * if the result is negative, or false when * result is greater than or equal to zero. */ -static __inline__ int atomic64_add_negative(long i, atomic64_t *v) +static __inline__ long atomic64_add_negative(long i, atomic64_t *v) { unsigned char c; @@ -364,50 +339,29 @@ static __inline__ int atomic64_add_negative(long i, atomic64_t *v) } /** - * atomic64_add_return - add and return + * atomic_add_return - add and return + * @v: pointer of type atomic_t * @i: integer value to add - * @v: pointer to type atomic64_t * * Atomically adds @i to @v and returns @i + @v */ -static __inline__ long atomic64_add_return(long i, atomic64_t *v) +static __inline__ int atomic_add_return(int i, atomic_t *v) { - long __i = i; + int __i = i; __asm__ __volatile__( - LOCK "xaddq %0, %1;" + LOCK "xaddl %0, %1;" :"=r"(i) :"m"(v->counter), "0"(i)); return i + __i; } -static __inline__ long atomic64_sub_return(long i, atomic64_t *v) +static __inline__ int atomic_sub_return(int i, atomic_t *v) { - return atomic64_add_return(-i,v); + return atomic_add_return(-i,v); } -#define atomic64_inc_return(v) (atomic64_add_return(1,v)) -#define atomic64_dec_return(v) (atomic64_sub_return(1,v)) - -#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) - -/** - * atomic_add_unless - add unless the number is a given value - * @v: pointer of type atomic_t - * @a: the amount to add to v... - * @u: ...unless v is equal to u. - * - * Atomically adds @a to @v, so long as it was not @u. - * Returns non-zero if @v was not @u, and zero otherwise. - */ -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) +#define atomic_inc_return(v) (atomic_add_return(1,v)) +#define atomic_dec_return(v) (atomic_sub_return(1,v)) /* These are x86-specific, used by some header files */ #define atomic_clear_mask(mask, addr) \ diff --git a/trunk/include/asm-x86_64/bitops.h b/trunk/include/asm-x86_64/bitops.h index a4d5d0909453..05a0d374404b 100644 --- a/trunk/include/asm-x86_64/bitops.h +++ b/trunk/include/asm-x86_64/bitops.h @@ -340,20 +340,6 @@ static __inline__ unsigned long __ffs(unsigned long word) return word; } -/* - * __fls: find last bit set. - * @word: The word to search - * - * Undefined if no zero exists, so code should check against ~0UL first. - */ -static __inline__ unsigned long __fls(unsigned long word) -{ - __asm__("bsrq %1,%0" - :"=r" (word) - :"rm" (word)); - return word; -} - #ifdef __KERNEL__ static inline int sched_find_first_bit(const unsigned long *b) @@ -383,19 +369,6 @@ static __inline__ int ffs(int x) return r+1; } -/** - * fls64 - find last bit set in 64 bit word - * @x: the word to search - * - * This is defined the same way as fls. - */ -static __inline__ int fls64(__u64 x) -{ - if (x == 0) - return 0; - return __fls(x) + 1; -} - /** * hweightN - returns the hamming weight of a N-bit word * @x: the word to weigh diff --git a/trunk/include/asm-x86_64/cache.h b/trunk/include/asm-x86_64/cache.h index 33e53424128b..eda62bae1240 100644 --- a/trunk/include/asm-x86_64/cache.h +++ b/trunk/include/asm-x86_64/cache.h @@ -9,6 +9,6 @@ /* L1 cache line size */ #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) -#define L1_CACHE_SHIFT_MAX 7 /* largest L1 which this arch supports */ +#define L1_CACHE_SHIFT_MAX 6 /* largest L1 which this arch supports */ #endif diff --git a/trunk/include/asm-x86_64/desc.h b/trunk/include/asm-x86_64/desc.h index 33764869387b..68ac3c62fe3d 100644 --- a/trunk/include/asm-x86_64/desc.h +++ b/trunk/include/asm-x86_64/desc.h @@ -98,19 +98,16 @@ static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsig static inline void set_intr_gate(int nr, void *func) { - BUG_ON((unsigned)nr > 0xFF); _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 0, 0); } static inline void set_intr_gate_ist(int nr, void *func, unsigned ist) { - BUG_ON((unsigned)nr > 0xFF); _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 0, ist); } static inline void set_system_gate(int nr, void *func) { - BUG_ON((unsigned)nr > 0xFF); _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, 0); } @@ -132,16 +129,9 @@ static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned static inline void set_tss_desc(unsigned cpu, void *addr) { - /* - * sizeof(unsigned long) coming from an extra "long" at the end - * of the iobitmap. See tss_struct definition in processor.h - * - * -1? seg base+limit should be pointing to the address of the - * last valid byte - */ - set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_TSS], - (unsigned long)addr, DESC_TSS, - IO_BITMAP_OFFSET + IO_BITMAP_BYTES + sizeof(unsigned long) - 1); + set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_TSS], (unsigned long)addr, + DESC_TSS, + sizeof(struct tss_struct) - 1); } static inline void set_ldt_desc(unsigned cpu, void *addr, int size) diff --git a/trunk/include/asm-x86_64/dma.h b/trunk/include/asm-x86_64/dma.h index 6f2a817b6a7c..16fa3a064d0c 100644 --- a/trunk/include/asm-x86_64/dma.h +++ b/trunk/include/asm-x86_64/dma.h @@ -72,15 +72,8 @@ #define MAX_DMA_CHANNELS 8 - -/* 16MB ISA DMA zone */ -#define MAX_DMA_PFN ((16*1024*1024) >> PAGE_SHIFT) - -/* 4GB broken PCI/AGP hardware bus master zone */ -#define MAX_DMA32_PFN ((4UL*1024*1024*1024) >> PAGE_SHIFT) - -/* Compat define for old dma zone */ -#define MAX_DMA_ADDRESS ((unsigned long)__va(MAX_DMA_PFN << PAGE_SHIFT)) +/* The maximum address that we can perform a DMA transfer to on this platform */ +#define MAX_DMA_ADDRESS (PAGE_OFFSET+0x1000000) /* 8237 DMA controllers */ #define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */ diff --git a/trunk/include/asm-x86_64/hpet.h b/trunk/include/asm-x86_64/hpet.h index c20c28f5c7a0..a3877f570998 100644 --- a/trunk/include/asm-x86_64/hpet.h +++ b/trunk/include/asm-x86_64/hpet.h @@ -14,18 +14,18 @@ #define HPET_CFG 0x010 #define HPET_STATUS 0x020 #define HPET_COUNTER 0x0f0 -#define HPET_Tn_OFFSET 0x20 -#define HPET_Tn_CFG(n) (0x100 + (n) * HPET_Tn_OFFSET) -#define HPET_Tn_ROUTE(n) (0x104 + (n) * HPET_Tn_OFFSET) -#define HPET_Tn_CMP(n) (0x108 + (n) * HPET_Tn_OFFSET) -#define HPET_T0_CFG HPET_Tn_CFG(0) -#define HPET_T0_CMP HPET_Tn_CMP(0) -#define HPET_T1_CFG HPET_Tn_CFG(1) -#define HPET_T1_CMP HPET_Tn_CMP(1) +#define HPET_T0_CFG 0x100 +#define HPET_T0_CMP 0x108 +#define HPET_T0_ROUTE 0x110 +#define HPET_T1_CFG 0x120 +#define HPET_T1_CMP 0x128 +#define HPET_T1_ROUTE 0x130 +#define HPET_T2_CFG 0x140 +#define HPET_T2_CMP 0x148 +#define HPET_T2_ROUTE 0x150 #define HPET_ID_VENDOR 0xffff0000 #define HPET_ID_LEGSUP 0x00008000 -#define HPET_ID_64BIT 0x00002000 #define HPET_ID_NUMBER 0x00001f00 #define HPET_ID_REV 0x000000ff #define HPET_ID_NUMBER_SHIFT 8 @@ -38,18 +38,11 @@ #define HPET_LEGACY_8254 2 #define HPET_LEGACY_RTC 8 -#define HPET_TN_LEVEL 0x0002 -#define HPET_TN_ENABLE 0x0004 -#define HPET_TN_PERIODIC 0x0008 -#define HPET_TN_PERIODIC_CAP 0x0010 -#define HPET_TN_64BIT_CAP 0x0020 -#define HPET_TN_SETVAL 0x0040 -#define HPET_TN_32BIT 0x0100 -#define HPET_TN_ROUTE 0x3e00 -#define HPET_TN_FSB 0x4000 -#define HPET_TN_FSB_CAP 0x8000 - -#define HPET_TN_ROUTE_SHIFT 9 +#define HPET_TN_ENABLE 0x004 +#define HPET_TN_PERIODIC 0x008 +#define HPET_TN_PERIODIC_CAP 0x010 +#define HPET_TN_SETVAL 0x040 +#define HPET_TN_32BIT 0x100 extern int is_hpet_enabled(void); extern int hpet_rtc_timer_init(void); diff --git a/trunk/include/asm-x86_64/hw_irq.h b/trunk/include/asm-x86_64/hw_irq.h index c14a8c7267a6..dc97668ea0f9 100644 --- a/trunk/include/asm-x86_64/hw_irq.h +++ b/trunk/include/asm-x86_64/hw_irq.h @@ -55,7 +55,7 @@ struct hw_interrupt_type; #define CALL_FUNCTION_VECTOR 0xfc #define KDB_VECTOR 0xfb /* reserved for KDB */ #define THERMAL_APIC_VECTOR 0xfa -#define THRESHOLD_APIC_VECTOR 0xf9 +/* 0xf9 free */ #define INVALIDATE_TLB_VECTOR_END 0xf8 #define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f8 used for TLB flush */ diff --git a/trunk/include/asm-x86_64/ia32.h b/trunk/include/asm-x86_64/ia32.h index c7bc9c0525ba..6efa00fe4e7b 100644 --- a/trunk/include/asm-x86_64/ia32.h +++ b/trunk/include/asm-x86_64/ia32.h @@ -165,11 +165,6 @@ struct siginfo_t; int do_get_thread_area(struct thread_struct *t, struct user_desc __user *info); int do_set_thread_area(struct thread_struct *t, struct user_desc __user *info); int ia32_child_tls(struct task_struct *p, struct pt_regs *childregs); - -struct linux_binprm; -extern int ia32_setup_arg_pages(struct linux_binprm *bprm, - unsigned long stack_top, int exec_stack); - #endif #endif /* !CONFIG_IA32_SUPPORT */ diff --git a/trunk/include/asm-x86_64/mce.h b/trunk/include/asm-x86_64/mce.h index 5d298b799a9f..869249db6795 100644 --- a/trunk/include/asm-x86_64/mce.h +++ b/trunk/include/asm-x86_64/mce.h @@ -67,8 +67,6 @@ struct mce_log { /* Software defined banks */ #define MCE_EXTENDED_BANK 128 #define MCE_THERMAL_BANK MCE_EXTENDED_BANK + 0 -#define MCE_THRESHOLD_BASE MCE_EXTENDED_BANK + 1 /* MCE_AMD */ -#define MCE_THRESHOLD_DRAM_ECC MCE_THRESHOLD_BASE + 4 void mce_log(struct mce *m); #ifdef CONFIG_X86_MCE_INTEL @@ -79,12 +77,4 @@ static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) } #endif -#ifdef CONFIG_X86_MCE_AMD -void mce_amd_feature_init(struct cpuinfo_x86 *c); -#else -static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) -{ -} -#endif - #endif diff --git a/trunk/include/asm-x86_64/mmzone.h b/trunk/include/asm-x86_64/mmzone.h index 69baaa8a3ce0..b40c661f111e 100644 --- a/trunk/include/asm-x86_64/mmzone.h +++ b/trunk/include/asm-x86_64/mmzone.h @@ -17,15 +17,16 @@ /* Simple perfect hash to map physical addresses to node numbers */ extern int memnode_shift; extern u8 memnodemap[NODEMAPSIZE]; +extern int maxnode; extern struct pglist_data *node_data[]; static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) { - unsigned nid; + int nid; VIRTUAL_BUG_ON((addr >> memnode_shift) >= NODEMAPSIZE); nid = memnodemap[addr >> memnode_shift]; - VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); + VIRTUAL_BUG_ON(nid > maxnode); return nid; } @@ -40,7 +41,9 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) #define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr)) -/* Requires pfn_valid(pfn) to be true */ +/* AK: this currently doesn't deal with invalid addresses. We'll see + if the 2.5 kernel doesn't pass them + (2.4 used to). */ #define pfn_to_page(pfn) ({ \ int nid = phys_to_nid(((unsigned long)(pfn)) << PAGE_SHIFT); \ ((pfn) - node_start_pfn(nid)) + NODE_DATA(nid)->node_mem_map; \ diff --git a/trunk/include/asm-x86_64/mpspec.h b/trunk/include/asm-x86_64/mpspec.h index 6f8a17d105ab..f267e10c023d 100644 --- a/trunk/include/asm-x86_64/mpspec.h +++ b/trunk/include/asm-x86_64/mpspec.h @@ -16,7 +16,7 @@ /* * A maximum of 255 APICs with the current APIC ID architecture. */ -#define MAX_APICS 255 +#define MAX_APICS 128 struct intel_mp_floating { @@ -157,8 +157,7 @@ struct mpc_config_lintsrc */ #define MAX_MP_BUSSES 256 -/* Each PCI slot may be a combo card with its own bus. 4 IRQ pins per slot. */ -#define MAX_IRQ_SOURCES (MAX_MP_BUSSES * 4) +#define MAX_IRQ_SOURCES 256 enum mp_bustype { MP_BUS_ISA = 1, MP_BUS_EISA, @@ -173,7 +172,7 @@ extern int smp_found_config; extern void find_smp_config (void); extern void get_smp_config (void); extern int nr_ioapics; -extern unsigned char apic_version [MAX_APICS]; +extern int apic_version [MAX_APICS]; extern int mp_irq_entries; extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOURCES]; extern int mpc_default_type; diff --git a/trunk/include/asm-x86_64/msr.h b/trunk/include/asm-x86_64/msr.h index 10f8b51cec8b..5a7fe3c6c3d8 100644 --- a/trunk/include/asm-x86_64/msr.h +++ b/trunk/include/asm-x86_64/msr.h @@ -19,7 +19,7 @@ : "=a" (a__), "=d" (b__) \ : "c" (msr)); \ val = a__ | (b__<<32); \ -} while(0) +} while(0); #define wrmsr(msr,val1,val2) \ __asm__ __volatile__("wrmsr" \ @@ -56,7 +56,7 @@ ".section __ex_table,\"a\"\n" \ " .align 8\n" \ " .quad 1b,3b\n" \ - ".previous":"=&bDS" (ret__), "=a"(*(a)), "=d"(*(b))\ + ".previous":"=&bDS" (ret__), "=a"(a), "=d"(b)\ :"c"(msr), "i"(-EIO), "0"(0)); \ ret__; }) diff --git a/trunk/include/asm-x86_64/numa.h b/trunk/include/asm-x86_64/numa.h index d51e56fdc3da..bcf55c3f7f7f 100644 --- a/trunk/include/asm-x86_64/numa.h +++ b/trunk/include/asm-x86_64/numa.h @@ -17,8 +17,6 @@ extern void numa_add_cpu(int cpu); extern void numa_init_array(void); extern int numa_off; -extern void numa_set_node(int cpu, int node); - extern unsigned char apicid_to_node[256]; #define NUMA_NO_NODE 0xff diff --git a/trunk/include/asm-x86_64/page.h b/trunk/include/asm-x86_64/page.h index 06e489f32472..e5ab4d231f2c 100644 --- a/trunk/include/asm-x86_64/page.h +++ b/trunk/include/asm-x86_64/page.h @@ -11,7 +11,7 @@ #define PAGE_SIZE (1UL << PAGE_SHIFT) #endif #define PAGE_MASK (~(PAGE_SIZE-1)) -#define PHYSICAL_PAGE_MASK (~(PAGE_SIZE-1) & __PHYSICAL_MASK) +#define PHYSICAL_PAGE_MASK (~(PAGE_SIZE-1) & (__PHYSICAL_MASK << PAGE_SHIFT)) #define THREAD_ORDER 1 #ifdef __ASSEMBLY__ diff --git a/trunk/include/asm-x86_64/param.h b/trunk/include/asm-x86_64/param.h index 5956b23b57c2..40b11937180d 100644 --- a/trunk/include/asm-x86_64/param.h +++ b/trunk/include/asm-x86_64/param.h @@ -1,8 +1,9 @@ +#include + #ifndef _ASMx86_64_PARAM_H #define _ASMx86_64_PARAM_H #ifdef __KERNEL__ -# include # define HZ CONFIG_HZ /* Internal kernel timer frequency */ # define USER_HZ 100 /* .. some user interfaces are in "ticks */ #define CLOCKS_PER_SEC (USER_HZ) /* like times() */ diff --git a/trunk/include/asm-x86_64/pda.h b/trunk/include/asm-x86_64/pda.h index 8733ccfa442e..bbf89aa8a1af 100644 --- a/trunk/include/asm-x86_64/pda.h +++ b/trunk/include/asm-x86_64/pda.h @@ -15,7 +15,6 @@ struct x8664_pda { int irqcount; /* Irq nesting counter. Starts with -1 */ int cpunumber; /* Logical CPU number */ char *irqstackptr; /* top of irqstack */ - int nodenumber; /* number of current node */ unsigned int __softirq_pending; unsigned int __nmi_count; /* number of NMI on this CPUs */ struct mm_struct *active_mm; diff --git a/trunk/include/asm-x86_64/pgtable.h b/trunk/include/asm-x86_64/pgtable.h index ecf58c7c1650..7309fffeec9a 100644 --- a/trunk/include/asm-x86_64/pgtable.h +++ b/trunk/include/asm-x86_64/pgtable.h @@ -16,7 +16,6 @@ extern pud_t level3_physmem_pgt[512]; extern pud_t level3_ident_pgt[512]; extern pmd_t level2_kernel_pgt[512]; extern pgd_t init_level4_pgt[]; -extern pgd_t boot_level4_pgt[]; extern unsigned long __supported_pte_mask; #define swapper_pg_dir init_level4_pgt @@ -248,7 +247,7 @@ static inline unsigned long pud_bad(pud_t pud) #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) /* FIXME: is this right? */ #define pte_page(x) pfn_to_page(pte_pfn(x)) -#define pte_pfn(x) ((pte_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT) +#define pte_pfn(x) ((pte_val(x) >> PAGE_SHIFT) & __PHYSICAL_MASK) static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) { @@ -355,7 +354,7 @@ static inline pud_t *__pud_offset_k(pud_t *pud, unsigned long address) #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) #define pmd_bad(x) ((pmd_val(x) & (~PTE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE ) #define pfn_pmd(nr,prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val(prot))) -#define pmd_pfn(x) ((pmd_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT) +#define pmd_pfn(x) ((pmd_val(x) >> PAGE_SHIFT) & __PHYSICAL_MASK) #define pte_to_pgoff(pte) ((pte_val(pte) & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT) #define pgoff_to_pte(off) ((pte_t) { ((off) << PAGE_SHIFT) | _PAGE_FILE }) diff --git a/trunk/include/asm-x86_64/processor.h b/trunk/include/asm-x86_64/processor.h index 4861246548f7..03837d34fba0 100644 --- a/trunk/include/asm-x86_64/processor.h +++ b/trunk/include/asm-x86_64/processor.h @@ -61,12 +61,10 @@ struct cpuinfo_x86 { int x86_cache_alignment; int x86_tlbsize; /* number of 4K pages in DTLB/ITLB combined(in pages)*/ __u8 x86_virt_bits, x86_phys_bits; - __u8 x86_max_cores; /* cpuid returned max cores value */ + __u8 x86_num_cores; __u32 x86_power; __u32 extended_cpuid_level; /* Max extended CPUID function supported */ unsigned long loops_per_jiffy; - __u8 apicid; - __u8 booted_cores; /* number of cores as seen by OS */ } ____cacheline_aligned; #define X86_VENDOR_INTEL 0 diff --git a/trunk/include/asm-x86_64/proto.h b/trunk/include/asm-x86_64/proto.h index 34501086afef..dbb37b0adb43 100644 --- a/trunk/include/asm-x86_64/proto.h +++ b/trunk/include/asm-x86_64/proto.h @@ -11,8 +11,6 @@ struct pt_regs; extern void start_kernel(void); extern void pda_init(int); -extern void zap_low_mappings(int cpu); - extern void early_idt_handler(void); extern void mcheck_init(struct cpuinfo_x86 *c); @@ -24,8 +22,6 @@ extern void mtrr_bp_init(void); #define mtrr_bp_init() do {} while (0) #endif extern void init_memory_mapping(unsigned long start, unsigned long end); -extern void size_zones(unsigned long *z, unsigned long *h, - unsigned long start_pfn, unsigned long end_pfn); extern void system_call(void); extern int kernel_syscall(void); diff --git a/trunk/include/asm-x86_64/rwlock.h b/trunk/include/asm-x86_64/rwlock.h index 9942cc393064..8a78a4ace53c 100644 --- a/trunk/include/asm-x86_64/rwlock.h +++ b/trunk/include/asm-x86_64/rwlock.h @@ -64,7 +64,7 @@ ::"a" (rw) : "memory") #define __build_write_lock_const(rw, helper) \ - asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",%0\n\t" \ + asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \ "jnz 2f\n" \ "1:\n" \ LOCK_SECTION_START("") \ diff --git a/trunk/include/asm-x86_64/rwsem.h b/trunk/include/asm-x86_64/rwsem.h new file mode 100644 index 000000000000..46077e9c1910 --- /dev/null +++ b/trunk/include/asm-x86_64/rwsem.h @@ -0,0 +1,283 @@ +/* rwsem.h: R/W semaphores implemented using XADD/CMPXCHG for x86_64+ + * + * Written by David Howells (dhowells@redhat.com). + * Ported by Andi Kleen to x86-64. + * + * Derived from asm-i386/semaphore.h and asm-i386/rwsem.h + * + * + * The MSW of the count is the negated number of active writers and waiting + * lockers, and the LSW is the total number of active locks + * + * The lock count is initialized to 0 (no active and no waiting lockers). + * + * When a writer subtracts WRITE_BIAS, it'll get 0xffff0001 for the case of an + * uncontended lock. This can be determined because XADD returns the old value. + * Readers increment by 1 and see a positive value when uncontended, negative + * if there are writers (and maybe) readers waiting (in which case it goes to + * sleep). + * + * The value of WAITING_BIAS supports up to 32766 waiting processes. This can + * be extended to 65534 by manually checking the whole MSW rather than relying + * on the S flag. + * + * The value of ACTIVE_BIAS supports up to 65535 active processes. + * + * This should be totally fair - if anything is waiting, a process that wants a + * lock will go to the back of the queue. When the currently active lock is + * released, if there's a writer at the front of the queue, then that and only + * that will be woken up; if there's a bunch of consecutive readers at the + * front, then they'll all be woken up, but no other readers will be. + */ + +#ifndef _X8664_RWSEM_H +#define _X8664_RWSEM_H + +#ifndef _LINUX_RWSEM_H +#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" +#endif + +#ifdef __KERNEL__ + +#include +#include + +struct rwsem_waiter; + +extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); +extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); +extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *); +extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); + +/* + * the semaphore definition + */ +struct rw_semaphore { + signed int count; +#define RWSEM_UNLOCKED_VALUE 0x00000000 +#define RWSEM_ACTIVE_BIAS 0x00000001 +#define RWSEM_ACTIVE_MASK 0x0000ffff +#define RWSEM_WAITING_BIAS (-0x00010000) +#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS +#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) + spinlock_t wait_lock; + struct list_head wait_list; +#if RWSEM_DEBUG + int debug; +#endif +}; + +/* + * initialisation + */ +#if RWSEM_DEBUG +#define __RWSEM_DEBUG_INIT , 0 +#else +#define __RWSEM_DEBUG_INIT /* */ +#endif + +#define __RWSEM_INITIALIZER(name) \ +{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \ + __RWSEM_DEBUG_INIT } + +#define DECLARE_RWSEM(name) \ + struct rw_semaphore name = __RWSEM_INITIALIZER(name) + +static inline void init_rwsem(struct rw_semaphore *sem) +{ + sem->count = RWSEM_UNLOCKED_VALUE; + spin_lock_init(&sem->wait_lock); + INIT_LIST_HEAD(&sem->wait_list); +#if RWSEM_DEBUG + sem->debug = 0; +#endif +} + +/* + * lock for reading + */ +static inline void __down_read(struct rw_semaphore *sem) +{ + __asm__ __volatile__( + "# beginning down_read\n\t" +LOCK_PREFIX " incl (%%rdi)\n\t" /* adds 0x00000001, returns the old value */ + " js 2f\n\t" /* jump if we weren't granted the lock */ + "1:\n\t" + LOCK_SECTION_START("") \ + "2:\n\t" + " call rwsem_down_read_failed_thunk\n\t" + " jmp 1b\n" + LOCK_SECTION_END \ + "# ending down_read\n\t" + : "+m"(sem->count) + : "D"(sem) + : "memory", "cc"); +} + + +/* + * trylock for reading -- returns 1 if successful, 0 if contention + */ +static inline int __down_read_trylock(struct rw_semaphore *sem) +{ + __s32 result, tmp; + __asm__ __volatile__( + "# beginning __down_read_trylock\n\t" + " movl %0,%1\n\t" + "1:\n\t" + " movl %1,%2\n\t" + " addl %3,%2\n\t" + " jle 2f\n\t" +LOCK_PREFIX " cmpxchgl %2,%0\n\t" + " jnz 1b\n\t" + "2:\n\t" + "# ending __down_read_trylock\n\t" + : "+m"(sem->count), "=&a"(result), "=&r"(tmp) + : "i"(RWSEM_ACTIVE_READ_BIAS) + : "memory", "cc"); + return result>=0 ? 1 : 0; +} + + +/* + * lock for writing + */ +static inline void __down_write(struct rw_semaphore *sem) +{ + int tmp; + + tmp = RWSEM_ACTIVE_WRITE_BIAS; + __asm__ __volatile__( + "# beginning down_write\n\t" +LOCK_PREFIX " xaddl %0,(%%rdi)\n\t" /* subtract 0x0000ffff, returns the old value */ + " testl %0,%0\n\t" /* was the count 0 before? */ + " jnz 2f\n\t" /* jump if we weren't granted the lock */ + "1:\n\t" + LOCK_SECTION_START("") + "2:\n\t" + " call rwsem_down_write_failed_thunk\n\t" + " jmp 1b\n" + LOCK_SECTION_END + "# ending down_write" + : "=&r" (tmp) + : "0"(tmp), "D"(sem) + : "memory", "cc"); +} + +/* + * trylock for writing -- returns 1 if successful, 0 if contention + */ +static inline int __down_write_trylock(struct rw_semaphore *sem) +{ + signed long ret = cmpxchg(&sem->count, + RWSEM_UNLOCKED_VALUE, + RWSEM_ACTIVE_WRITE_BIAS); + if (ret == RWSEM_UNLOCKED_VALUE) + return 1; + return 0; +} + +/* + * unlock after reading + */ +static inline void __up_read(struct rw_semaphore *sem) +{ + __s32 tmp = -RWSEM_ACTIVE_READ_BIAS; + __asm__ __volatile__( + "# beginning __up_read\n\t" +LOCK_PREFIX " xaddl %[tmp],(%%rdi)\n\t" /* subtracts 1, returns the old value */ + " js 2f\n\t" /* jump if the lock is being waited upon */ + "1:\n\t" + LOCK_SECTION_START("") + "2:\n\t" + " decw %w[tmp]\n\t" /* do nothing if still outstanding active readers */ + " jnz 1b\n\t" + " call rwsem_wake_thunk\n\t" + " jmp 1b\n" + LOCK_SECTION_END + "# ending __up_read\n" + : "+m"(sem->count), [tmp] "+r" (tmp) + : "D"(sem) + : "memory", "cc"); +} + +/* + * unlock after writing + */ +static inline void __up_write(struct rw_semaphore *sem) +{ + unsigned tmp; + __asm__ __volatile__( + "# beginning __up_write\n\t" + " movl %[bias],%[tmp]\n\t" +LOCK_PREFIX " xaddl %[tmp],(%%rdi)\n\t" /* tries to transition 0xffff0001 -> 0x00000000 */ + " jnz 2f\n\t" /* jump if the lock is being waited upon */ + "1:\n\t" + LOCK_SECTION_START("") + "2:\n\t" + " decw %w[tmp]\n\t" /* did the active count reduce to 0? */ + " jnz 1b\n\t" /* jump back if not */ + " call rwsem_wake_thunk\n\t" + " jmp 1b\n" + LOCK_SECTION_END + "# ending __up_write\n" + : "+m"(sem->count), [tmp] "=r" (tmp) + : "D"(sem), [bias] "i"(-RWSEM_ACTIVE_WRITE_BIAS) + : "memory", "cc"); +} + +/* + * downgrade write lock to read lock + */ +static inline void __downgrade_write(struct rw_semaphore *sem) +{ + __asm__ __volatile__( + "# beginning __downgrade_write\n\t" +LOCK_PREFIX " addl %[bias],(%%rdi)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 */ + " js 2f\n\t" /* jump if the lock is being waited upon */ + "1:\n\t" + LOCK_SECTION_START("") + "2:\n\t" + " call rwsem_downgrade_thunk\n" + " jmp 1b\n" + LOCK_SECTION_END + "# ending __downgrade_write\n" + : "=m"(sem->count) + : "D"(sem), [bias] "i"(-RWSEM_WAITING_BIAS), "m"(sem->count) + : "memory", "cc"); +} + +/* + * implement atomic add functionality + */ +static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) +{ + __asm__ __volatile__( +LOCK_PREFIX "addl %1,%0" + :"=m"(sem->count) + :"ir"(delta), "m"(sem->count)); +} + +/* + * implement exchange and add functionality + */ +static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) +{ + int tmp = delta; + + __asm__ __volatile__( +LOCK_PREFIX "xaddl %0,(%2)" + : "=r"(tmp), "=m"(sem->count) + : "r"(sem), "m"(sem->count), "0" (tmp) + : "memory"); + + return tmp+delta; +} + +static inline int rwsem_is_locked(struct rw_semaphore *sem) +{ + return (sem->count != 0); +} + +#endif /* __KERNEL__ */ +#endif /* _X8664_RWSEM_H */ diff --git a/trunk/include/asm-x86_64/smp.h b/trunk/include/asm-x86_64/smp.h index d030409a8fb5..b9fb2173ef99 100644 --- a/trunk/include/asm-x86_64/smp.h +++ b/trunk/include/asm-x86_64/smp.h @@ -47,6 +47,7 @@ extern void lock_ipi_call_lock(void); extern void unlock_ipi_call_lock(void); extern int smp_num_siblings; extern void smp_send_reschedule(int cpu); +extern void zap_low_mappings(void); void smp_stop_cpu(void); extern int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, int retry, int wait); @@ -81,8 +82,6 @@ extern int safe_smp_processor_id(void); extern int __cpu_disable(void); extern void __cpu_die(unsigned int cpu); extern void prefill_possible_map(void); -extern unsigned num_processors; -extern unsigned disabled_cpus; #endif /* !ASSEMBLY */ diff --git a/trunk/include/asm-x86_64/spinlock.h b/trunk/include/asm-x86_64/spinlock.h index fe484a699cc3..69636831ad2f 100644 --- a/trunk/include/asm-x86_64/spinlock.h +++ b/trunk/include/asm-x86_64/spinlock.h @@ -18,22 +18,22 @@ */ #define __raw_spin_is_locked(x) \ - (*(volatile signed int *)(&(x)->slock) <= 0) + (*(volatile signed char *)(&(x)->slock) <= 0) #define __raw_spin_lock_string \ "\n1:\t" \ - "lock ; decl %0\n\t" \ + "lock ; decb %0\n\t" \ "js 2f\n" \ LOCK_SECTION_START("") \ "2:\t" \ "rep;nop\n\t" \ - "cmpl $0,%0\n\t" \ + "cmpb $0,%0\n\t" \ "jle 2b\n\t" \ "jmp 1b\n" \ LOCK_SECTION_END #define __raw_spin_unlock_string \ - "movl $1,%0" \ + "movb $1,%0" \ :"=m" (lock->slock) : : "memory" static inline void __raw_spin_lock(raw_spinlock_t *lock) @@ -47,10 +47,10 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) static inline int __raw_spin_trylock(raw_spinlock_t *lock) { - int oldval; + char oldval; __asm__ __volatile__( - "xchgl %0,%1" + "xchgb %b0,%1" :"=q" (oldval), "=m" (lock->slock) :"0" (0) : "memory"); diff --git a/trunk/include/asm-x86_64/topology.h b/trunk/include/asm-x86_64/topology.h index 7d82bc56b9fa..1c603cd7e4d0 100644 --- a/trunk/include/asm-x86_64/topology.h +++ b/trunk/include/asm-x86_64/topology.h @@ -23,13 +23,11 @@ extern int __node_distance(int, int); #define cpu_to_node(cpu) (cpu_to_node[cpu]) #define parent_node(node) (node) -#define node_to_first_cpu(node) (first_cpu(node_to_cpumask[node])) +#define node_to_first_cpu(node) (__ffs(node_to_cpumask[node])) #define node_to_cpumask(node) (node_to_cpumask[node]) #define pcibus_to_node(bus) ((long)(bus->sysdata)) #define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus)); -#define numa_node_id() read_pda(nodenumber) - /* sched_domains SD_NODE_INIT for x86_64 machines */ #define SD_NODE_INIT (struct sched_domain) { \ .span = CPU_MASK_NONE, \ diff --git a/trunk/include/asm-x86_64/unistd.h b/trunk/include/asm-x86_64/unistd.h index 2c42150bce0c..3c494b65d33a 100644 --- a/trunk/include/asm-x86_64/unistd.h +++ b/trunk/include/asm-x86_64/unistd.h @@ -462,7 +462,7 @@ __SYSCALL(__NR_fremovexattr, sys_fremovexattr) #define __NR_tkill 200 __SYSCALL(__NR_tkill, sys_tkill) #define __NR_time 201 -__SYSCALL(__NR_time, sys_time) +__SYSCALL(__NR_time, sys_time64) #define __NR_futex 202 __SYSCALL(__NR_futex, sys_futex) #define __NR_sched_setaffinity 203 @@ -608,7 +608,6 @@ do { \ #define __ARCH_WANT_SYS_SIGPENDING #define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_RT_SIGACTION -#define __ARCH_WANT_SYS_TIME #define __ARCH_WANT_COMPAT_SYS_TIME #endif diff --git a/trunk/include/asm-xtensa/atomic.h b/trunk/include/asm-xtensa/atomic.h index 3670cc7695da..12b5732dc6e5 100644 --- a/trunk/include/asm-xtensa/atomic.h +++ b/trunk/include/asm-xtensa/atomic.h @@ -223,26 +223,6 @@ static inline int atomic_sub_return(int i, atomic_t * v) */ #define atomic_add_negative(i,v) (atomic_add_return((i),(v)) < 0) -#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) - -/** - * atomic_add_unless - add unless the number is a given value - * @v: pointer of type atomic_t - * @a: the amount to add to v... - * @u: ...unless v is equal to u. - * - * Atomically adds @a to @v, so long as it was not @u. - * Returns non-zero if @v was not @u, and zero otherwise. - */ -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ - c = old; \ - c != (u); \ -}) -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) { diff --git a/trunk/include/asm-xtensa/bitops.h b/trunk/include/asm-xtensa/bitops.h index 0a2065f1a372..e76ee889e21d 100644 --- a/trunk/include/asm-xtensa/bitops.h +++ b/trunk/include/asm-xtensa/bitops.h @@ -245,7 +245,6 @@ static __inline__ int fls (unsigned int x) { return __cntlz(x); } -#define fls64(x) generic_fls64(x) static __inline__ int find_next_bit(const unsigned long *addr, int size, int offset) diff --git a/trunk/include/linux/acct.h b/trunk/include/linux/acct.h index 9a66401073fc..93c5b3cdf951 100644 --- a/trunk/include/linux/acct.h +++ b/trunk/include/linux/acct.h @@ -16,8 +16,6 @@ #define _LINUX_ACCT_H #include -#include - #include #include diff --git a/trunk/include/linux/aio.h b/trunk/include/linux/aio.h index 49fd37629ee4..403d71dcb7c8 100644 --- a/trunk/include/linux/aio.h +++ b/trunk/include/linux/aio.h @@ -124,7 +124,7 @@ struct kiocb { (x)->ki_users = 1; \ (x)->ki_key = KIOCB_SYNC_KEY; \ (x)->ki_filp = (filp); \ - (x)->ki_ctx = NULL; \ + (x)->ki_ctx = &tsk->active_mm->default_kioctx; \ (x)->ki_cancel = NULL; \ (x)->ki_dtor = NULL; \ (x)->ki_obj.tsk = tsk; \ @@ -210,15 +210,8 @@ struct kioctx *lookup_ioctx(unsigned long ctx_id); int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, struct iocb *iocb)); -#define get_ioctx(kioctx) do { \ - BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ - atomic_inc(&(kioctx)->users); \ -} while (0) -#define put_ioctx(kioctx) do { \ - BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ - if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ - __put_ioctx(kioctx); \ -} while (0) +#define get_ioctx(kioctx) do { if (unlikely(atomic_read(&(kioctx)->users) <= 0)) BUG(); atomic_inc(&(kioctx)->users); } while (0) +#define put_ioctx(kioctx) do { if (unlikely(atomic_dec_and_test(&(kioctx)->users))) __put_ioctx(kioctx); else if (unlikely(atomic_read(&(kioctx)->users) < 0)) BUG(); } while (0) #define in_aio() !is_sync_wait(current->io_wait) /* may be used for debugging */ diff --git a/trunk/include/linux/atmdev.h b/trunk/include/linux/atmdev.h index b203ea82a0a8..e7d0593bb576 100644 --- a/trunk/include/linux/atmdev.h +++ b/trunk/include/linux/atmdev.h @@ -7,6 +7,7 @@ #define LINUX_ATMDEV_H +#include #include #include #include @@ -209,7 +210,6 @@ struct atm_cirange { #ifdef __KERNEL__ -#include #include /* wait_queue_head_t */ #include /* struct timeval */ #include @@ -274,7 +274,7 @@ enum { enum { - ATM_DF_REMOVED, /* device was removed from atm_devs list */ + ATM_DF_CLOSE, /* close device when last VCC is closed */ }; @@ -415,6 +415,7 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, int number,unsigned long *flags); /* number == -1: pick first available */ struct atm_dev *atm_dev_lookup(int number); void atm_dev_deregister(struct atm_dev *dev); +void shutdown_atm_dev(struct atm_dev *dev); void vcc_insert_socket(struct sock *sk); @@ -456,19 +457,18 @@ static inline void atm_dev_hold(struct atm_dev *dev) static inline void atm_dev_put(struct atm_dev *dev) { - if (atomic_dec_and_test(&dev->refcnt)) { - BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); - if (dev->ops->dev_close) - dev->ops->dev_close(dev); - kfree(dev); - } + atomic_dec(&dev->refcnt); + + if ((atomic_read(&dev->refcnt) == 1) && + test_bit(ATM_DF_CLOSE,&dev->flags)) + shutdown_atm_dev(dev); } int atm_charge(struct atm_vcc *vcc,int truesize); struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, gfp_t gfp_flags); -int atm_pcr_goal(const struct atm_trafprm *tp); +int atm_pcr_goal(struct atm_trafprm *tp); void vcc_release_async(struct atm_vcc *vcc, int reply); diff --git a/trunk/include/linux/bio.h b/trunk/include/linux/bio.h index b60ffe32cd21..685fd3720df5 100644 --- a/trunk/include/linux/bio.h +++ b/trunk/include/linux/bio.h @@ -292,8 +292,6 @@ extern struct bio *bio_clone(struct bio *, gfp_t); extern void bio_init(struct bio *); extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); -extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, - unsigned int, unsigned int); extern int bio_get_nr_vecs(struct block_device *); extern struct bio *bio_map_user(struct request_queue *, struct block_device *, unsigned long, unsigned int, int); diff --git a/trunk/include/linux/bitops.h b/trunk/include/linux/bitops.h index 6a2a19f14bb2..cb3c3ef50f50 100644 --- a/trunk/include/linux/bitops.h +++ b/trunk/include/linux/bitops.h @@ -76,15 +76,6 @@ static __inline__ int generic_fls(int x) */ #include - -static inline int generic_fls64(__u64 x) -{ - __u32 h = x >> 32; - if (h) - return fls(x) + 32; - return fls(x); -} - static __inline__ int get_bitmask_order(unsigned int count) { int order; @@ -93,16 +84,6 @@ static __inline__ int get_bitmask_order(unsigned int count) return order; /* We could be slightly more clever with -1 here... */ } -static __inline__ int get_count_order(unsigned int count) -{ - int order; - - order = fls(count) - 1; - if (count & (count - 1)) - order++; - return order; -} - /* * hweightN: returns the hamming weight (i.e. the number * of bits set) of a N-bit word diff --git a/trunk/include/linux/blkdev.h b/trunk/include/linux/blkdev.h index a18500d196e1..a33a31e71bbc 100644 --- a/trunk/include/linux/blkdev.h +++ b/trunk/include/linux/blkdev.h @@ -184,7 +184,6 @@ struct request { void *sense; unsigned int timeout; - int retries; /* * For Power Management requests @@ -559,7 +558,6 @@ extern void blk_unregister_queue(struct gendisk *disk); extern void register_disk(struct gendisk *dev); extern void generic_make_request(struct bio *bio); extern void blk_put_request(struct request *); -extern void __blk_put_request(request_queue_t *, struct request *); extern void blk_end_sync_rq(struct request *rq); extern void blk_attempt_remerge(request_queue_t *, struct request *); extern struct request *blk_get_request(request_queue_t *, int, gfp_t); @@ -581,10 +579,6 @@ extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *, int); -extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, - struct request *, int, - void (*done)(struct request *)); - static inline request_queue_t *bdev_get_queue(struct block_device *bdev) { return bdev->bd_disk->queue; @@ -702,8 +696,7 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *); #define MAX_PHYS_SEGMENTS 128 #define MAX_HW_SEGMENTS 128 -#define SAFE_MAX_SECTORS 255 -#define BLK_DEF_MAX_SECTORS 1024 +#define MAX_SECTORS 255 #define MAX_SEGMENT_SIZE 65536 diff --git a/trunk/include/linux/cache.h b/trunk/include/linux/cache.h index 0b7ecf3af78a..f6b5a46c5f82 100644 --- a/trunk/include/linux/cache.h +++ b/trunk/include/linux/cache.h @@ -13,7 +13,7 @@ #define SMP_CACHE_BYTES L1_CACHE_BYTES #endif -#if defined(CONFIG_X86) || defined(CONFIG_SPARC64) || defined(CONFIG_IA64) +#if defined(CONFIG_X86) || defined(CONFIG_SPARC64) #define __read_mostly __attribute__((__section__(".data.read_mostly"))) #else #define __read_mostly diff --git a/trunk/include/linux/cciss_ioctl.h b/trunk/include/linux/cciss_ioctl.h index 6e27f42e3a57..424d5e622b43 100644 --- a/trunk/include/linux/cciss_ioctl.h +++ b/trunk/include/linux/cciss_ioctl.h @@ -10,8 +10,8 @@ typedef struct _cciss_pci_info_struct { unsigned char bus; - unsigned char dev_fn; unsigned short domain; + unsigned char dev_fn; __u32 board_id; } cciss_pci_info_struct; diff --git a/trunk/include/linux/cm4000_cs.h b/trunk/include/linux/cm4000_cs.h deleted file mode 100644 index 605ebe24bb2e..000000000000 --- a/trunk/include/linux/cm4000_cs.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef _CM4000_H_ -#define _CM4000_H_ - -#define MAX_ATR 33 - -#define CM4000_MAX_DEV 4 - -/* those two structures are passed via ioctl() from/to userspace. They are - * used by existing userspace programs, so I kepth the awkward "bIFSD" naming - * not to break compilation of userspace apps. -HW */ - -typedef struct atreq { - int32_t atr_len; - unsigned char atr[64]; - int32_t power_act; - unsigned char bIFSD; - unsigned char bIFSC; -} atreq_t; - - -/* what is particularly stupid in the original driver is the arch-dependant - * member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace - * will lay out the structure members differently than the 64bit kernel. - * - * I've changed "ptsreq.protocol" from "unsigned long" to "u_int32_t". - * On 32bit this will make no difference. With 64bit kernels, it will make - * 32bit apps work, too. - */ - -typedef struct ptsreq { - u_int32_t protocol; /*T=0: 2^0, T=1: 2^1*/ - unsigned char flags; - unsigned char pts1; - unsigned char pts2; - unsigned char pts3; -} ptsreq_t; - -#define CM_IOC_MAGIC 'c' -#define CM_IOC_MAXNR 255 - -#define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *) -#define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *) -#define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *) -#define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3) -#define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4) - -#define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*) - -/* card and device states */ -#define CM_CARD_INSERTED 0x01 -#define CM_CARD_POWERED 0x02 -#define CM_ATR_PRESENT 0x04 -#define CM_ATR_VALID 0x08 -#define CM_STATE_VALID 0x0f -/* extra info only from CM4000 */ -#define CM_NO_READER 0x10 -#define CM_BAD_CARD 0x20 - - -#ifdef __KERNEL__ - -#define DEVICE_NAME "cmm" -#define MODULE_NAME "cm4000_cs" - -#endif /* __KERNEL__ */ -#endif /* _CM4000_H_ */ diff --git a/trunk/include/linux/cn_proc.h b/trunk/include/linux/cn_proc.h index 1417de935057..70ab56317380 100644 --- a/trunk/include/linux/cn_proc.h +++ b/trunk/include/linux/cn_proc.h @@ -26,7 +26,6 @@ #define CN_PROC_H #include -#include #include /* @@ -66,7 +65,6 @@ struct proc_event { PROC_EVENT_EXIT = 0x80000000 } what; __u32 cpu; - struct timespec timestamp; union { /* must be last field of proc_event struct */ struct { __u32 err; @@ -88,12 +86,12 @@ struct proc_event { pid_t process_pid; pid_t process_tgid; union { - __u32 ruid; /* task uid */ - __u32 rgid; /* task gid */ + uid_t ruid; /* current->uid */ + gid_t rgid; /* current->gid */ } r; union { - __u32 euid; - __u32 egid; + uid_t euid; + gid_t egid; } e; } id; diff --git a/trunk/include/linux/compat_ioctl.h b/trunk/include/linux/compat_ioctl.h index 119f9d064cc6..174f3379e5d9 100644 --- a/trunk/include/linux/compat_ioctl.h +++ b/trunk/include/linux/compat_ioctl.h @@ -795,70 +795,3 @@ COMPATIBLE_IOCTL(HIDIOCGFLAG) COMPATIBLE_IOCTL(HIDIOCSFLAG) COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX) COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO) -/* dvb */ -COMPATIBLE_IOCTL(AUDIO_STOP) -COMPATIBLE_IOCTL(AUDIO_PLAY) -COMPATIBLE_IOCTL(AUDIO_PAUSE) -COMPATIBLE_IOCTL(AUDIO_CONTINUE) -COMPATIBLE_IOCTL(AUDIO_SELECT_SOURCE) -COMPATIBLE_IOCTL(AUDIO_SET_MUTE) -COMPATIBLE_IOCTL(AUDIO_SET_AV_SYNC) -COMPATIBLE_IOCTL(AUDIO_SET_BYPASS_MODE) -COMPATIBLE_IOCTL(AUDIO_CHANNEL_SELECT) -COMPATIBLE_IOCTL(AUDIO_GET_STATUS) -COMPATIBLE_IOCTL(AUDIO_GET_CAPABILITIES) -COMPATIBLE_IOCTL(AUDIO_CLEAR_BUFFER) -COMPATIBLE_IOCTL(AUDIO_SET_ID) -COMPATIBLE_IOCTL(AUDIO_SET_MIXER) -COMPATIBLE_IOCTL(AUDIO_SET_STREAMTYPE) -COMPATIBLE_IOCTL(AUDIO_SET_EXT_ID) -COMPATIBLE_IOCTL(AUDIO_SET_ATTRIBUTES) -COMPATIBLE_IOCTL(AUDIO_SET_KARAOKE) -COMPATIBLE_IOCTL(DMX_START) -COMPATIBLE_IOCTL(DMX_STOP) -COMPATIBLE_IOCTL(DMX_SET_FILTER) -COMPATIBLE_IOCTL(DMX_SET_PES_FILTER) -COMPATIBLE_IOCTL(DMX_SET_BUFFER_SIZE) -COMPATIBLE_IOCTL(DMX_GET_PES_PIDS) -COMPATIBLE_IOCTL(DMX_GET_CAPS) -COMPATIBLE_IOCTL(DMX_SET_SOURCE) -COMPATIBLE_IOCTL(DMX_GET_STC) -COMPATIBLE_IOCTL(FE_GET_INFO) -COMPATIBLE_IOCTL(FE_DISEQC_RESET_OVERLOAD) -COMPATIBLE_IOCTL(FE_DISEQC_SEND_MASTER_CMD) -COMPATIBLE_IOCTL(FE_DISEQC_RECV_SLAVE_REPLY) -COMPATIBLE_IOCTL(FE_DISEQC_SEND_BURST) -COMPATIBLE_IOCTL(FE_SET_TONE) -COMPATIBLE_IOCTL(FE_SET_VOLTAGE) -COMPATIBLE_IOCTL(FE_ENABLE_HIGH_LNB_VOLTAGE) -COMPATIBLE_IOCTL(FE_READ_STATUS) -COMPATIBLE_IOCTL(FE_READ_BER) -COMPATIBLE_IOCTL(FE_READ_SIGNAL_STRENGTH) -COMPATIBLE_IOCTL(FE_READ_SNR) -COMPATIBLE_IOCTL(FE_READ_UNCORRECTED_BLOCKS) -COMPATIBLE_IOCTL(FE_SET_FRONTEND) -COMPATIBLE_IOCTL(FE_GET_FRONTEND) -COMPATIBLE_IOCTL(FE_GET_EVENT) -COMPATIBLE_IOCTL(FE_DISHNETWORK_SEND_LEGACY_CMD) -COMPATIBLE_IOCTL(VIDEO_STOP) -COMPATIBLE_IOCTL(VIDEO_PLAY) -COMPATIBLE_IOCTL(VIDEO_FREEZE) -COMPATIBLE_IOCTL(VIDEO_CONTINUE) -COMPATIBLE_IOCTL(VIDEO_SELECT_SOURCE) -COMPATIBLE_IOCTL(VIDEO_SET_BLANK) -COMPATIBLE_IOCTL(VIDEO_GET_STATUS) -COMPATIBLE_IOCTL(VIDEO_SET_DISPLAY_FORMAT) -COMPATIBLE_IOCTL(VIDEO_FAST_FORWARD) -COMPATIBLE_IOCTL(VIDEO_SLOWMOTION) -COMPATIBLE_IOCTL(VIDEO_GET_CAPABILITIES) -COMPATIBLE_IOCTL(VIDEO_CLEAR_BUFFER) -COMPATIBLE_IOCTL(VIDEO_SET_ID) -COMPATIBLE_IOCTL(VIDEO_SET_STREAMTYPE) -COMPATIBLE_IOCTL(VIDEO_SET_FORMAT) -COMPATIBLE_IOCTL(VIDEO_SET_SYSTEM) -COMPATIBLE_IOCTL(VIDEO_SET_HIGHLIGHT) -COMPATIBLE_IOCTL(VIDEO_SET_SPU) -COMPATIBLE_IOCTL(VIDEO_GET_NAVI) -COMPATIBLE_IOCTL(VIDEO_SET_ATTRIBUTES) -COMPATIBLE_IOCTL(VIDEO_GET_SIZE) -COMPATIBLE_IOCTL(VIDEO_GET_FRAME_RATE) diff --git a/trunk/include/linux/cpu.h b/trunk/include/linux/cpu.h index 0ed1d4853c69..43c44530ef9d 100644 --- a/trunk/include/linux/cpu.h +++ b/trunk/include/linux/cpu.h @@ -65,9 +65,10 @@ extern struct sysdev_class cpu_sysdev_class; #ifdef CONFIG_HOTPLUG_CPU /* Stop CPUs going up and down. */ -extern void lock_cpu_hotplug(void); -extern void unlock_cpu_hotplug(void); -extern int lock_cpu_hotplug_interruptible(void); +extern struct semaphore cpucontrol; +#define lock_cpu_hotplug() down(&cpucontrol) +#define unlock_cpu_hotplug() up(&cpucontrol) +#define lock_cpu_hotplug_interruptible() down_interruptible(&cpucontrol) #define hotcpu_notifier(fn, pri) { \ static struct notifier_block fn##_nb = \ { .notifier_call = fn, .priority = pri }; \ diff --git a/trunk/include/linux/cpufreq.h b/trunk/include/linux/cpufreq.h index c31650df9241..d068176b7ad7 100644 --- a/trunk/include/linux/cpufreq.h +++ b/trunk/include/linux/cpufreq.h @@ -256,16 +256,6 @@ int cpufreq_update_policy(unsigned int cpu); /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ unsigned int cpufreq_get(unsigned int cpu); -/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ -#ifdef CONFIG_CPU_FREQ -unsigned int cpufreq_quick_get(unsigned int cpu); -#else -static inline unsigned int cpufreq_quick_get(unsigned int cpu) -{ - return 0; -} -#endif - /********************************************************************* * CPUFREQ DEFAULT GOVERNOR * diff --git a/trunk/include/linux/dccp.h b/trunk/include/linux/dccp.h index 088529f54965..71fab4311e92 100644 --- a/trunk/include/linux/dccp.h +++ b/trunk/include/linux/dccp.h @@ -192,9 +192,10 @@ enum { #include #include -#include #include +#include #include +#include enum dccp_state { DCCP_OPEN = TCP_ESTABLISHED, @@ -407,6 +408,8 @@ struct dccp_ackvec; * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss * @dccps_timestamp_time - time of latest TIMESTAMP option * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option + * @dccps_ext_header_len - network protocol overhead (IP/IPv6 options) + * @dccps_pmtu_cookie - Last pmtu seen by socket * @dccps_packet_size - Set thru setsockopt * @dccps_role - Role of this sock, one of %dccp_role * @dccps_ndp_count - number of Non Data Packets since last data packet @@ -431,6 +434,8 @@ struct dccp_sock { __u32 dccps_timestamp_echo; __u32 dccps_packet_size; unsigned long dccps_ndp_count; + __u16 dccps_ext_header_len; + __u32 dccps_pmtu_cookie; __u32 dccps_mss_cache; struct dccp_options dccps_options; struct dccp_ackvec *dccps_hc_rx_ackvec; diff --git a/trunk/include/linux/ds17287rtc.h b/trunk/include/linux/ds17287rtc.h deleted file mode 100644 index c281ba42e28f..000000000000 --- a/trunk/include/linux/ds17287rtc.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * ds17287rtc.h - register definitions for the ds1728[57] RTC / CMOS RAM - * - * 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. - * - * (C) 2003 Guido Guenther - */ -#ifndef __LINUX_DS17287RTC_H -#define __LINUX_DS17287RTC_H - -#include /* get the user-level API */ -#include /* spinlock_t */ -#include - -/* Register A */ -#define DS_REGA_DV2 0x40 /* countdown chain */ -#define DS_REGA_DV1 0x20 /* oscillator enable */ -#define DS_REGA_DV0 0x10 /* bank select */ - -/* bank 1 registers */ -#define DS_B1_MODEL 0x40 /* model number byte */ -#define DS_B1_SN1 0x41 /* serial number byte 1 */ -#define DS_B1_SN2 0x42 /* serial number byte 2 */ -#define DS_B1_SN3 0x43 /* serial number byte 3 */ -#define DS_B1_SN4 0x44 /* serial number byte 4 */ -#define DS_B1_SN5 0x45 /* serial number byte 5 */ -#define DS_B1_SN6 0x46 /* serial number byte 6 */ -#define DS_B1_CRC 0x47 /* CRC byte */ -#define DS_B1_CENTURY 0x48 /* Century byte */ -#define DS_B1_DALARM 0x49 /* date alarm */ -#define DS_B1_XCTRL4A 0x4a /* extendec control register 4a */ -#define DS_B1_XCTRL4B 0x4b /* extendec control register 4b */ -#define DS_B1_RTCADDR2 0x4e /* rtc address 2 */ -#define DS_B1_RTCADDR3 0x4f /* rtc address 3 */ -#define DS_B1_RAMLSB 0x50 /* extended ram LSB */ -#define DS_B1_RAMMSB 0x51 /* extended ram MSB */ -#define DS_B1_RAMDPORT 0x53 /* extended ram data port */ - -/* register details */ -/* extended control register 4a */ -#define DS_XCTRL4A_VRT2 0x80 /* valid ram and time */ -#define DS_XCTRL4A_INCR 0x40 /* increment progress status */ -#define DS_XCTRL4A_BME 0x20 /* burst mode enable */ -#define DS_XCTRL4A_PAB 0x08 /* power active bar ctrl */ -#define DS_XCTRL4A_RF 0x04 /* ram clear flag */ -#define DS_XCTRL4A_WF 0x02 /* wake up alarm flag */ -#define DS_XCTRL4A_KF 0x01 /* kickstart flag */ - -/* interrupt causes */ -#define DS_XCTRL4A_IFS (DS_XCTRL4A_RF|DS_XCTRL4A_WF|DS_XCTRL4A_KF) - -/* extended control register 4b */ -#define DS_XCTRL4B_ABE 0x80 /* auxiliary battery enable */ -#define DS_XCTRL4B_E32K 0x40 /* enable 32.768 kHz Output */ -#define DS_XCTRL4B_CS 0x20 /* crystal select */ -#define DS_XCTRL4B_RCE 0x10 /* ram clear enable */ -#define DS_XCTRL4B_PRS 0x08 /* PAB resec select */ -#define DS_XCTRL4B_RIE 0x04 /* ram clear interrupt enable */ -#define DS_XCTRL4B_WFE 0x02 /* wake up alarm interrupt enable */ -#define DS_XCTRL4B_KFE 0x01 /* kickstart interrupt enable */ - -/* interrupt enable bits */ -#define DS_XCTRL4B_IFES (DS_XCTRL4B_RIE|DS_XCTRL4B_WFE|DS_XCTRL4B_KFE) - -#endif /* __LINUX_DS17287RTC_H */ diff --git a/trunk/include/linux/ds1742rtc.h b/trunk/include/linux/ds1742rtc.h deleted file mode 100644 index a83cdd1cafc9..000000000000 --- a/trunk/include/linux/ds1742rtc.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * ds1742rtc.h - register definitions for the Real-Time-Clock / CMOS RAM - * - * Copyright (C) 1999-2001 Toshiba Corporation - * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org) - * - * Permission is hereby granted to copy, modify and redistribute this code - * in terms of the GNU Library General Public License, Version 2 or later, - * at your option. - */ -#ifndef __LINUX_DS1742RTC_H -#define __LINUX_DS1742RTC_H - -#include - -#define RTC_BRAM_SIZE 0x800 -#define RTC_OFFSET 0x7f8 - -/* - * Register summary - */ -#define RTC_CONTROL (RTC_OFFSET + 0) -#define RTC_CENTURY (RTC_OFFSET + 0) -#define RTC_SECONDS (RTC_OFFSET + 1) -#define RTC_MINUTES (RTC_OFFSET + 2) -#define RTC_HOURS (RTC_OFFSET + 3) -#define RTC_DAY (RTC_OFFSET + 4) -#define RTC_DATE (RTC_OFFSET + 5) -#define RTC_MONTH (RTC_OFFSET + 6) -#define RTC_YEAR (RTC_OFFSET + 7) - -#define RTC_CENTURY_MASK 0x3f -#define RTC_SECONDS_MASK 0x7f -#define RTC_DAY_MASK 0x07 - -/* - * Bits in the Control/Century register - */ -#define RTC_WRITE 0x80 -#define RTC_READ 0x40 - -/* - * Bits in the Seconds register - */ -#define RTC_STOP 0x80 - -/* - * Bits in the Day register - */ -#define RTC_BATT_FLAG 0x80 -#define RTC_FREQ_TEST 0x40 - -#endif /* __LINUX_DS1742RTC_H */ diff --git a/trunk/include/linux/dvb/audio.h b/trunk/include/linux/dvb/audio.h index 2b8797084685..cc314443f1c4 100644 --- a/trunk/include/linux/dvb/audio.h +++ b/trunk/include/linux/dvb/audio.h @@ -32,39 +32,39 @@ typedef enum { - AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */ + AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */ AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */ } audio_stream_source_t; typedef enum { AUDIO_STOPPED, /* Device is stopped */ - AUDIO_PLAYING, /* Device is currently playing */ + AUDIO_PLAYING, /* Device is currently playing */ AUDIO_PAUSED /* Device is paused */ } audio_play_state_t; typedef enum { - AUDIO_STEREO, - AUDIO_MONO_LEFT, + AUDIO_STEREO, + AUDIO_MONO_LEFT, AUDIO_MONO_RIGHT } audio_channel_select_t; typedef struct audio_mixer { - unsigned int volume_left; - unsigned int volume_right; + unsigned int volume_left; + unsigned int volume_right; // what else do we need? bass, pass-through, ... } audio_mixer_t; typedef struct audio_status { - int AV_sync_state; /* sync audio and video? */ - int mute_state; /* audio is muted */ - audio_play_state_t play_state; /* current playback state */ - audio_stream_source_t stream_source; /* current stream source */ - audio_channel_select_t channel_select; /* currently selected channel */ - int bypass_mode; /* pass on audio data to */ + int AV_sync_state; /* sync audio and video? */ + int mute_state; /* audio is muted */ + audio_play_state_t play_state; /* current playback state */ + audio_stream_source_t stream_source; /* current stream source */ + audio_channel_select_t channel_select; /* currently selected channel */ + int bypass_mode; /* pass on audio data to */ audio_mixer_t mixer_state; /* current mixer state */ } audio_status_t; /* separate decoder hardware */ @@ -74,8 +74,8 @@ struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ int vocal1; /* into left and right t at 70% each */ int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ int melody; /* mixed into the left channel and */ - /* Vocal2 into the right channel at 100% each. */ - /* if Melody is non-zero, the melody channel gets mixed*/ + /* Vocal2 into the right channel at 100% each. */ + /* if Melody is non-zero, the melody channel gets mixed*/ } audio_karaoke_t; /* into left and right */ diff --git a/trunk/include/linux/dvb/ca.h b/trunk/include/linux/dvb/ca.h index c18537f3e449..558af0cc7692 100644 --- a/trunk/include/linux/dvb/ca.h +++ b/trunk/include/linux/dvb/ca.h @@ -27,16 +27,16 @@ /* slot interface types and info */ typedef struct ca_slot_info { - int num; /* slot number */ + int num; /* slot number */ - int type; /* CA interface this slot supports */ + int type; /* CA interface this slot supports */ #define CA_CI 1 /* CI high level interface */ #define CA_CI_LINK 2 /* CI link layer level interface */ #define CA_CI_PHYS 4 /* CI physical layer level interface */ #define CA_DESCR 8 /* built-in descrambler */ #define CA_SC 128 /* simple smart card interface */ - unsigned int flags; + unsigned int flags; #define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ #define CA_CI_MODULE_READY 2 } ca_slot_info_t; @@ -45,37 +45,37 @@ typedef struct ca_slot_info { /* descrambler types and info */ typedef struct ca_descr_info { - unsigned int num; /* number of available descramblers (keys) */ - unsigned int type; /* type of supported scrambling system */ + unsigned int num; /* number of available descramblers (keys) */ + unsigned int type; /* type of supported scrambling system */ #define CA_ECD 1 #define CA_NDS 2 #define CA_DSS 4 } ca_descr_info_t; typedef struct ca_caps { - unsigned int slot_num; /* total number of CA card and module slots */ - unsigned int slot_type; /* OR of all supported types */ - unsigned int descr_num; /* total number of descrambler slots (keys) */ - unsigned int descr_type; /* OR of all supported types */ + unsigned int slot_num; /* total number of CA card and module slots */ + unsigned int slot_type; /* OR of all supported types */ + unsigned int descr_num; /* total number of descrambler slots (keys) */ + unsigned int descr_type; /* OR of all supported types */ } ca_caps_t; /* a message to/from a CI-CAM */ typedef struct ca_msg { - unsigned int index; - unsigned int type; - unsigned int length; - unsigned char msg[256]; + unsigned int index; + unsigned int type; + unsigned int length; + unsigned char msg[256]; } ca_msg_t; typedef struct ca_descr { - unsigned int index; - unsigned int parity; /* 0 == even, 1 == odd */ - unsigned char cw[8]; + unsigned int index; + unsigned int parity; /* 0 == even, 1 == odd */ + unsigned char cw[8]; } ca_descr_t; typedef struct ca_pid { - unsigned int pid; - int index; /* -1 == disable*/ + unsigned int pid; + int index; /* -1 == disable*/ } ca_pid_t; #define CA_RESET _IO('o', 128) diff --git a/trunk/include/linux/dvb/dmx.h b/trunk/include/linux/dvb/dmx.h index 2787b8a22ff1..ce3f829da82c 100644 --- a/trunk/include/linux/dvb/dmx.h +++ b/trunk/include/linux/dvb/dmx.h @@ -1,4 +1,4 @@ -/* +/* * dmx.h * * Copyright (C) 2000 Marcus Metzler @@ -38,10 +38,10 @@ typedef enum { DMX_OUT_DECODER, /* Streaming directly to decoder. */ DMX_OUT_TAP, /* Output going to a memory buffer */ - /* (to be retrieved via the read command).*/ + /* (to be retrieved via the read command).*/ DMX_OUT_TS_TAP /* Output multiplexed into a new TS */ - /* (to be retrieved by reading from the */ - /* logical DVR device). */ + /* (to be retrieved by reading from the */ + /* logical DVR device). */ } dmx_output_t; @@ -54,25 +54,25 @@ typedef enum typedef enum { - DMX_PES_AUDIO0, + DMX_PES_AUDIO0, DMX_PES_VIDEO0, DMX_PES_TELETEXT0, DMX_PES_SUBTITLE0, DMX_PES_PCR0, - DMX_PES_AUDIO1, + DMX_PES_AUDIO1, DMX_PES_VIDEO1, DMX_PES_TELETEXT1, DMX_PES_SUBTITLE1, DMX_PES_PCR1, - DMX_PES_AUDIO2, + DMX_PES_AUDIO2, DMX_PES_VIDEO2, DMX_PES_TELETEXT2, DMX_PES_SUBTITLE2, DMX_PES_PCR2, - DMX_PES_AUDIO3, + DMX_PES_AUDIO3, DMX_PES_VIDEO3, DMX_PES_TELETEXT3, DMX_PES_SUBTITLE3, @@ -90,8 +90,8 @@ typedef enum typedef enum { - DMX_SCRAMBLING_EV, - DMX_FRONTEND_EV + DMX_SCRAMBLING_EV, + DMX_FRONTEND_EV } dmx_event_t; diff --git a/trunk/include/linux/dvb/osd.h b/trunk/include/linux/dvb/osd.h index 880e68435832..0e1973d54a6b 100644 --- a/trunk/include/linux/dvb/osd.h +++ b/trunk/include/linux/dvb/osd.h @@ -98,43 +98,43 @@ typedef enum { } OSD_Command; typedef struct osd_cmd_s { - OSD_Command cmd; - int x0; - int y0; - int x1; - int y1; - int color; - void __user *data; + OSD_Command cmd; + int x0; + int y0; + int x1; + int y1; + int color; + void __user *data; } osd_cmd_t; /* OSD_OpenRaw: set 'color' to desired window type */ typedef enum { - OSD_BITMAP1, /* 1 bit bitmap */ - OSD_BITMAP2, /* 2 bit bitmap */ - OSD_BITMAP4, /* 4 bit bitmap */ - OSD_BITMAP8, /* 8 bit bitmap */ - OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */ - OSD_BITMAP2HR, /* 2 bit bitmap half resolution */ - OSD_BITMAP4HR, /* 4 bit bitmap half resolution */ - OSD_BITMAP8HR, /* 8 bit bitmap half resolution */ - OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */ - OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */ - OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */ - OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */ - OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */ - OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */ - OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */ - OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */ - OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/ - OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */ - OSD_VIDEONSIZE, /* Full Size MPEG Video Display */ - OSD_CURSOR /* Cursor */ + OSD_BITMAP1, /* 1 bit bitmap */ + OSD_BITMAP2, /* 2 bit bitmap */ + OSD_BITMAP4, /* 4 bit bitmap */ + OSD_BITMAP8, /* 8 bit bitmap */ + OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */ + OSD_BITMAP2HR, /* 2 bit bitmap half resolution */ + OSD_BITMAP4HR, /* 4 bit bitmap half resolution */ + OSD_BITMAP8HR, /* 8 bit bitmap half resolution */ + OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */ + OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */ + OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */ + OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */ + OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */ + OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */ + OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */ + OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */ + OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/ + OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */ + OSD_VIDEONSIZE, /* Full Size MPEG Video Display */ + OSD_CURSOR /* Cursor */ } osd_raw_window_t; typedef struct osd_cap_s { - int cmd; + int cmd; #define OSD_CAP_MEMSIZE 1 /* memory size */ - long val; + long val; } osd_cap_t; diff --git a/trunk/include/linux/dvb/video.h b/trunk/include/linux/dvb/video.h index b1999bfeaa56..941045e9ab89 100644 --- a/trunk/include/linux/dvb/video.h +++ b/trunk/include/linux/dvb/video.h @@ -36,7 +36,7 @@ typedef enum { VIDEO_FORMAT_4_3, /* Select 4:3 format */ - VIDEO_FORMAT_16_9, /* Select 16:9 format. */ + VIDEO_FORMAT_16_9, /* Select 16:9 format. */ VIDEO_FORMAT_221_1 /* 2.21:1 */ } video_format_t; @@ -54,7 +54,7 @@ typedef enum { typedef enum { - VIDEO_PAN_SCAN, /* use pan and scan format */ + VIDEO_PAN_SCAN, /* use pan and scan format */ VIDEO_LETTER_BOX, /* use letterbox format */ VIDEO_CENTER_CUT_OUT /* use center cut out format */ } video_displayformat_t; @@ -66,7 +66,7 @@ typedef struct { } video_size_t; typedef enum { - VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ + VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ VIDEO_SOURCE_MEMORY /* If this source is selected, the stream comes from the user through the write system call */ @@ -75,35 +75,35 @@ typedef enum { typedef enum { VIDEO_STOPPED, /* Video is stopped */ - VIDEO_PLAYING, /* Video is currently playing */ + VIDEO_PLAYING, /* Video is currently playing */ VIDEO_FREEZED /* Video is freezed */ } video_play_state_t; struct video_event { - int32_t type; + int32_t type; #define VIDEO_EVENT_SIZE_CHANGED 1 #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 - time_t timestamp; + time_t timestamp; union { - video_size_t size; + video_size_t size; unsigned int frame_rate; /* in frames per 1000sec */ } u; }; struct video_status { - int video_blank; /* blank video on freeze? */ - video_play_state_t play_state; /* current state of playback */ - video_stream_source_t stream_source; /* current source (demux/memory) */ - video_format_t video_format; /* current aspect ratio of stream*/ - video_displayformat_t display_format;/* selected cropping mode */ + int video_blank; /* blank video on freeze? */ + video_play_state_t play_state; /* current state of playback */ + video_stream_source_t stream_source; /* current source (demux/memory) */ + video_format_t video_format; /* current aspect ratio of stream*/ + video_displayformat_t display_format;/* selected cropping mode */ }; struct video_still_picture { - char __user *iFrame; /* pointer to a single iframe in memory */ - int32_t size; + char __user *iFrame; /* pointer to a single iframe in memory */ + int32_t size; }; @@ -111,19 +111,19 @@ typedef struct video_highlight { int active; /* 1=show highlight, 0=hide highlight */ uint8_t contrast1; /* 7- 4 Pattern pixel contrast */ - /* 3- 0 Background pixel contrast */ + /* 3- 0 Background pixel contrast */ uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */ - /* 3- 0 Emphasis pixel-1 contrast */ + /* 3- 0 Emphasis pixel-1 contrast */ uint8_t color1; /* 7- 4 Pattern pixel color */ - /* 3- 0 Background pixel color */ + /* 3- 0 Background pixel color */ uint8_t color2; /* 7- 4 Emphasis pixel-2 color */ - /* 3- 0 Emphasis pixel-1 color */ + /* 3- 0 Emphasis pixel-1 color */ uint32_t ypos; /* 23-22 auto action mode */ - /* 21-12 start y */ - /* 9- 0 end y */ + /* 21-12 start y */ + /* 9- 0 end y */ uint32_t xpos; /* 23-22 button color number */ - /* 21-12 start x */ - /* 9- 0 end x */ + /* 21-12 start x */ + /* 9- 0 end x */ } video_highlight_t; diff --git a/trunk/include/linux/etherdevice.h b/trunk/include/linux/etherdevice.h index 745c988359c0..5f49a30eb6f2 100644 --- a/trunk/include/linux/etherdevice.h +++ b/trunk/include/linux/etherdevice.h @@ -63,11 +63,10 @@ static inline int is_zero_ether_addr(const u8 *addr) * @addr: Pointer to a six-byte array containing the Ethernet address * * Return true if the address is a multicast address. - * By definition the broadcast address is also a multicast address. */ static inline int is_multicast_ether_addr(const u8 *addr) { - return (0x01 & addr[0]); + return ((addr[0] != 0xff) && (0x01 & addr[0])); } /** diff --git a/trunk/include/linux/fb.h b/trunk/include/linux/fb.h index a973be2cfe61..04a58f33ec53 100644 --- a/trunk/include/linux/fb.h +++ b/trunk/include/linux/fb.h @@ -617,12 +617,6 @@ struct fb_ops { /* perform fb specific mmap */ int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma); - - /* save current hardware state */ - void (*fb_save_state)(struct fb_info *info); - - /* restore saved state */ - void (*fb_restore_state)(struct fb_info *info); }; #ifdef CONFIG_FB_TILEBLITTING @@ -732,18 +726,6 @@ struct fb_tile_ops { from userspace */ #define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */ -/* A driver may set this flag to indicate that it does want a set_par to be - * called every time when fbcon_switch is executed. The advantage is that with - * this flag set you can really be shure that set_par is always called before - * any of the functions dependant on the correct hardware state or altering - * that state, even if you are using some broken X releases. The disadvantage - * is that it introduces unwanted delays to every console switch if set_par - * is slow. It is a good idea to try this flag in the drivers initialization - * code whenever there is a bug report related to switching between X and the - * framebuffer console. - */ -#define FBINFO_MISC_ALWAYS_SETPAR 0x40000 - struct fb_info { int node; int flags; @@ -833,18 +815,6 @@ struct fb_info { #define fb_writeq(b,addr) (*(volatile u64 *) (addr) = (b)) #define fb_memset memset -#endif - -#if defined (__BIG_ENDIAN) -#define FB_LEFT_POS(bpp) (32 - bpp) -#define FB_SHIFT_HIGH(val, bits) ((val) >> (bits)) -#define FB_SHIFT_LOW(val, bits) ((val) << (bits)) -#define FB_BIT_NR(b) (7 - (b)) -#else -#define FB_LEFT_POS(bpp) (0) -#define FB_SHIFT_HIGH(val, bits) ((val) << (bits)) -#define FB_SHIFT_LOW(val, bits) ((val) >> (bits)) -#define FB_BIT_NR(b) (b) #endif /* diff --git a/trunk/include/linux/file.h b/trunk/include/linux/file.h index 418b6101b59a..d3b1a15d5f21 100644 --- a/trunk/include/linux/file.h +++ b/trunk/include/linux/file.h @@ -33,13 +33,13 @@ struct fdtable { * Open file table structure */ struct files_struct { - atomic_t count; + atomic_t count; + spinlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */ struct fdtable *fdt; struct fdtable fdtab; - fd_set close_on_exec_init; - fd_set open_fds_init; - struct file * fd_array[NR_OPEN_DEFAULT]; - spinlock_t file_lock; /* Protects concurrent writers. Nests inside tsk->alloc_lock */ + fd_set close_on_exec_init; + fd_set open_fds_init; + struct file * fd_array[NR_OPEN_DEFAULT]; }; #define files_fdtable(files) (rcu_dereference((files)->fdt)) diff --git a/trunk/include/linux/fsl_devices.h b/trunk/include/linux/fsl_devices.h index 934aa9bda481..114d5d59f695 100644 --- a/trunk/include/linux/fsl_devices.h +++ b/trunk/include/linux/fsl_devices.h @@ -4,7 +4,7 @@ * Definitions for any platform device related flags or structures for * Freescale processor devices * - * Maintainer: Kumar Gala + * Maintainer: Kumar Gala (kumar.gala@freescale.com) * * Copyright 2004 Freescale Semiconductor, Inc * diff --git a/trunk/include/linux/gfp.h b/trunk/include/linux/gfp.h index 8b2eab90abb6..c3779432a723 100644 --- a/trunk/include/linux/gfp.h +++ b/trunk/include/linux/gfp.h @@ -11,16 +11,9 @@ struct vm_area_struct; /* * GFP bitmasks.. */ -/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low three bits) */ +/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ #define __GFP_DMA ((__force gfp_t)0x01u) #define __GFP_HIGHMEM ((__force gfp_t)0x02u) -#ifdef CONFIG_DMA_IS_DMA32 -#define __GFP_DMA32 ((__force gfp_t)0x01) /* ZONE_DMA is ZONE_DMA32 */ -#elif BITS_PER_LONG < 64 -#define __GFP_DMA32 ((__force gfp_t)0x00) /* ZONE_NORMAL is ZONE_DMA32 */ -#else -#define __GFP_DMA32 ((__force gfp_t)0x04) /* Has own ZONE_DMA32 */ -#endif /* * Action modifiers - doesn't change the zoning @@ -46,7 +39,8 @@ struct vm_area_struct; #define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */ #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ -#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ +#define __GFP_NORECLAIM ((__force gfp_t)0x20000u) /* No realy zone reclaim during allocation */ +#define __GFP_HARDWALL ((__force gfp_t)0x40000u) /* Enforce hardwall cpuset memory allocs */ #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) @@ -55,7 +49,7 @@ struct vm_area_struct; #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ - __GFP_NOMEMALLOC|__GFP_HARDWALL) + __GFP_NOMEMALLOC|__GFP_NORECLAIM|__GFP_HARDWALL) #define GFP_ATOMIC (__GFP_HIGH) #define GFP_NOIO (__GFP_WAIT) @@ -70,16 +64,7 @@ struct vm_area_struct; #define GFP_DMA __GFP_DMA -/* 4GB DMA on some platforms */ -#define GFP_DMA32 __GFP_DMA32 - - -static inline int gfp_zone(gfp_t gfp) -{ - int zone = GFP_ZONEMASK & (__force int) gfp; - BUG_ON(zone >= GFP_ZONETYPES); - return zone; -} +#define gfp_zone(mask) ((__force int)((mask) & (__force gfp_t)GFP_ZONEMASK)) /* * There is only one page-allocator function, and two main namespaces to diff --git a/trunk/include/linux/hardirq.h b/trunk/include/linux/hardirq.h index 71d2b8a723b9..5912874ca83c 100644 --- a/trunk/include/linux/hardirq.h +++ b/trunk/include/linux/hardirq.h @@ -90,8 +90,6 @@ extern void synchronize_irq(unsigned int irq); #define nmi_enter() irq_enter() #define nmi_exit() sub_preempt_count(HARDIRQ_OFFSET) -struct task_struct; - #ifndef CONFIG_VIRT_CPU_ACCOUNTING static inline void account_user_vtime(struct task_struct *tsk) { diff --git a/trunk/include/linux/hdreg.h b/trunk/include/linux/hdreg.h index 2b54eac738ea..b5d660089de4 100644 --- a/trunk/include/linux/hdreg.h +++ b/trunk/include/linux/hdreg.h @@ -80,12 +80,10 @@ /* * Define standard taskfile in/out register */ -#define IDE_TASKFILE_STD_IN_FLAGS 0xFE -#define IDE_HOB_STD_IN_FLAGS 0x3C -#ifndef __KERNEL__ #define IDE_TASKFILE_STD_OUT_FLAGS 0xFE +#define IDE_TASKFILE_STD_IN_FLAGS 0xFE #define IDE_HOB_STD_OUT_FLAGS 0x3C -#endif +#define IDE_HOB_STD_IN_FLAGS 0x3C typedef unsigned char task_ioreg_t; typedef unsigned long sata_ioreg_t; diff --git a/trunk/include/linux/hugetlb.h b/trunk/include/linux/hugetlb.h index 1056717ee501..0cea162b08c0 100644 --- a/trunk/include/linux/hugetlb.h +++ b/trunk/include/linux/hugetlb.h @@ -102,8 +102,8 @@ static inline unsigned long hugetlb_total_pages(void) #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) #ifndef HPAGE_MASK -#define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */ -#define HPAGE_SIZE PAGE_SIZE +#define HPAGE_MASK 0 /* Keep the compiler happy */ +#define HPAGE_SIZE 0 #endif #endif /* !CONFIG_HUGETLB_PAGE */ diff --git a/trunk/include/linux/i2c-id.h b/trunk/include/linux/i2c-id.h index 006c81ef4d50..74abaecdb572 100644 --- a/trunk/include/linux/i2c-id.h +++ b/trunk/include/linux/i2c-id.h @@ -107,8 +107,6 @@ #define I2C_DRIVERID_CX25840 71 /* cx2584x video encoder */ #define I2C_DRIVERID_SAA7127 72 /* saa7124 video encoder */ #define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ -#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ -#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ #define I2C_DRIVERID_EXP1 0xF1 diff --git a/trunk/include/linux/ide.h b/trunk/include/linux/ide.h index 7b6a6a58e465..ac8b25fa6506 100644 --- a/trunk/include/linux/ide.h +++ b/trunk/include/linux/ide.h @@ -23,6 +23,17 @@ #include #include +/* + * This is the multiple IDE interface driver, as evolved from hd.c. + * It supports up to four IDE interfaces, on one or more IRQs (usually 14 & 15). + * There can be up to two drives per interface, as per the ATA-2 spec. + * + * Primary i/f: ide0: major=3; (hda) minor=0; (hdb) minor=64 + * Secondary i/f: ide1: major=22; (hdc or hd1a) minor=0; (hdd or hd1b) minor=64 + * Tertiary i/f: ide2: major=33; (hde) minor=0; (hdf) minor=64 + * Quaternary i/f: ide3: major=34; (hdg) minor=0; (hdh) minor=64 + */ + /****************************************************************************** * IDE driver configuration options (play with these as desired): * @@ -182,6 +193,11 @@ typedef unsigned char byte; /* used everywhere */ #define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */ #define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */ +#define HOST(hwif,chipset) \ +{ \ + return ((hwif)->chipset == chipset) ? 1 : 0; \ +} + /* * Check for an interrupt and acknowledge the interrupt status */ @@ -374,6 +390,45 @@ typedef union { } b; } ata_nsector_t, ata_data_t, atapi_bcount_t, ata_index_t; +/* + * ATA-IDE Error Register + * + * mark : Bad address mark + * tzero : Couldn't find track 0 + * abrt : Aborted Command + * mcr : Media Change Request + * id : ID field not found + * mce : Media Change Event + * ecc : Uncorrectable ECC error + * bdd : dual meaing + */ +typedef union { + unsigned all :8; + struct { +#if defined(__LITTLE_ENDIAN_BITFIELD) + unsigned mark :1; + unsigned tzero :1; + unsigned abrt :1; + unsigned mcr :1; + unsigned id :1; + unsigned mce :1; + unsigned ecc :1; + unsigned bdd :1; +#elif defined(__BIG_ENDIAN_BITFIELD) + unsigned bdd :1; + unsigned ecc :1; + unsigned mce :1; + unsigned id :1; + unsigned mcr :1; + unsigned abrt :1; + unsigned tzero :1; + unsigned mark :1; +#else +#error "Please fix " +#endif + } b; +} ata_error_t; + /* * ATA-IDE Select Register, aka Device-Head * @@ -448,6 +503,39 @@ typedef union { } b; } ata_status_t, atapi_status_t; +/* + * ATA-IDE Control Register + * + * bit0 : Should be set to zero + * nIEN : device INTRQ to host + * SRST : host soft reset bit + * bit3 : ATA-2 thingy, Should be set to 1 + * reserved456 : Reserved + * HOB : 48-bit address ordering, High Ordered Bit + */ +typedef union { + unsigned all : 8; + struct { +#if defined(__LITTLE_ENDIAN_BITFIELD) + unsigned bit0 : 1; + unsigned nIEN : 1; + unsigned SRST : 1; + unsigned bit3 : 1; + unsigned reserved456 : 3; + unsigned HOB : 1; +#elif defined(__BIG_ENDIAN_BITFIELD) + unsigned HOB : 1; + unsigned reserved456 : 3; + unsigned bit3 : 1; + unsigned SRST : 1; + unsigned nIEN : 1; + unsigned bit0 : 1; +#else +#error "Please fix " +#endif + } b; +} ata_control_t; + /* * ATAPI Feature Register * @@ -529,6 +617,39 @@ typedef union { } b; } atapi_error_t; +/* + * ATAPI floppy Drive Select Register + * + * sam_lun : Logical unit number + * reserved3 : Reserved + * drv : The responding drive will be drive 0 (0) or drive 1 (1) + * one5 : Should be set to 1 + * reserved6 : Reserved + * one7 : Should be set to 1 + */ +typedef union { + unsigned all :8; + struct { +#if defined(__LITTLE_ENDIAN_BITFIELD) + unsigned sam_lun :3; + unsigned reserved3 :1; + unsigned drv :1; + unsigned one5 :1; + unsigned reserved6 :1; + unsigned one7 :1; +#elif defined(__BIG_ENDIAN_BITFIELD) + unsigned one7 :1; + unsigned reserved6 :1; + unsigned one5 :1; + unsigned drv :1; + unsigned reserved3 :1; + unsigned sam_lun :3; +#else +#error "Please fix " +#endif + } b; +} atapi_select_t; + /* * Status returned from various ide_ functions */ @@ -968,11 +1089,9 @@ enum { /* * Subdrivers support. - * - * The gendriver.owner field should be set to the module owner of this driver. - * The gendriver.name field should be set to the name of this driver */ typedef struct ide_driver_s { + struct module *owner; const char *version; u8 media; unsigned supports_dsc_overlap : 1; @@ -980,7 +1099,10 @@ typedef struct ide_driver_s { int (*end_request)(ide_drive_t *, int, int); ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); + int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long); ide_proc_entry_t *proc; + void (*ata_prebuilder)(ide_drive_t *); + void (*atapi_prebuilder)(ide_drive_t *); struct device_driver gen_driver; } ide_driver_t; @@ -1077,11 +1199,37 @@ extern u64 ide_get_error_location(ide_drive_t *, char *); */ typedef enum { ide_wait, /* insert rq at end of list, and wait for it */ + ide_next, /* insert rq immediately after current request */ ide_preempt, /* insert rq in front of current request */ ide_head_wait, /* insert rq in front of current request and wait for it */ ide_end /* insert rq at end of list, but don't wait for it */ } ide_action_t; +/* + * This function issues a special IDE device request + * onto the request queue. + * + * If action is ide_wait, then the rq is queued at the end of the + * request queue, and the function sleeps until it has been processed. + * This is for use when invoked from an ioctl handler. + * + * If action is ide_preempt, then the rq is queued at the head of + * the request queue, displacing the currently-being-processed + * request and this function returns immediately without waiting + * for the new rq to be completed. This is VERY DANGEROUS, and is + * intended for careful use by the ATAPI tape/cdrom driver code. + * + * If action is ide_next, then the rq is queued immediately after + * the currently-being-processed-request (if any), and the function + * returns without waiting for the new rq to be completed. As above, + * This is VERY DANGEROUS, and is intended for careful use by the + * ATAPI tape/cdrom driver code. + * + * If action is ide_end, then the rq is queued at the end of the + * request queue, and the function returns immediately without waiting + * for the new rq to be completed. This is again intended for careful + * use by the ATAPI tape/cdrom driver code. + */ extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t); /* @@ -1174,6 +1322,7 @@ extern int ide_spin_wait_hwgroup(ide_drive_t *); extern void ide_timer_expiry(unsigned long); extern irqreturn_t ide_intr(int irq, void *dev_id, struct pt_regs *regs); extern void do_ide_request(request_queue_t *); +extern void ide_init_subdrivers(void); void ide_init_disk(struct gendisk *, ide_drive_t *); @@ -1246,12 +1395,6 @@ void ide_init_sg_cmd(ide_drive_t *, struct request *); #define GOOD_DMA_DRIVE 1 #ifdef CONFIG_BLK_DEV_IDEDMA -struct drive_list_entry { - const char *id_model; - const char *id_firmware; -}; - -int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); int __ide_dma_bad_drive(ide_drive_t *); int __ide_dma_good_drive(ide_drive_t *); int ide_use_dma(ide_drive_t *); diff --git a/trunk/include/linux/if_pppox.h b/trunk/include/linux/if_pppox.h index 4fab3d0a4bce..e677f73f13dd 100644 --- a/trunk/include/linux/if_pppox.h +++ b/trunk/include/linux/if_pppox.h @@ -157,7 +157,8 @@ struct pppox_proto { extern int register_pppox_proto(int proto_num, struct pppox_proto *pp); extern void unregister_pppox_proto(int proto_num); extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ -extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); +extern int pppox_channel_ioctl(struct ppp_channel *pc, unsigned int cmd, + unsigned long arg); /* PPPoX socket states */ enum { diff --git a/trunk/include/linux/init_task.h b/trunk/include/linux/init_task.h index dcfd2ecccb5d..68ab5f2ab9cd 100644 --- a/trunk/include/linux/init_task.h +++ b/trunk/include/linux/init_task.h @@ -51,6 +51,7 @@ .page_table_lock = SPIN_LOCK_UNLOCKED, \ .mmlist = LIST_HEAD_INIT(name.mmlist), \ .cpu_vm_mask = CPU_MASK_ALL, \ + .default_kioctx = INIT_KIOCTX(name.default_kioctx, name), \ } #define INIT_SIGNALS(sig) { \ diff --git a/trunk/include/linux/inotify.h b/trunk/include/linux/inotify.h index 267c88b5f742..ee5b239092ed 100644 --- a/trunk/include/linux/inotify.h +++ b/trunk/include/linux/inotify.h @@ -47,8 +47,6 @@ struct inotify_event { #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ /* special flags */ -#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */ -#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */ #define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */ #define IN_ISDIR 0x40000000 /* event occurred against dir */ #define IN_ONESHOT 0x80000000 /* only send event once */ diff --git a/trunk/include/linux/interrupt.h b/trunk/include/linux/interrupt.h index 41f150a3d2dd..0a90205184b0 100644 --- a/trunk/include/linux/interrupt.h +++ b/trunk/include/linux/interrupt.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/include/linux/ip.h b/trunk/include/linux/ip.h index 9e2eb9a602eb..33e8a19a1a0f 100644 --- a/trunk/include/linux/ip.h +++ b/trunk/include/linux/ip.h @@ -16,7 +16,6 @@ */ #ifndef _LINUX_IP_H #define _LINUX_IP_H -#include #include #define IPTOS_TOS_MASK 0x1E @@ -79,6 +78,126 @@ #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ #define IPOPT_TS_PRESPEC 3 /* specified modules only */ +#ifdef __KERNEL__ +#include +#include +#include +#include +#include +#include + +struct ip_options { + __u32 faddr; /* Saved first hop address */ + unsigned char optlen; + unsigned char srr; + unsigned char rr; + unsigned char ts; + unsigned char is_setbyuser:1, /* Set by setsockopt? */ + is_data:1, /* Options in __data, rather than skb */ + is_strictroute:1, /* Strict source route */ + srr_is_hit:1, /* Packet destination addr was our one */ + is_changed:1, /* IP checksum more not valid */ + rr_needaddr:1, /* Need to record addr of outgoing dev */ + ts_needtime:1, /* Need to record timestamp */ + ts_needaddr:1; /* Need to record addr of outgoing dev */ + unsigned char router_alert; + unsigned char __pad1; + unsigned char __pad2; + unsigned char __data[0]; +}; + +#define optlength(opt) (sizeof(struct ip_options) + opt->optlen) + +struct inet_request_sock { + struct request_sock req; + u32 loc_addr; + u32 rmt_addr; + u16 rmt_port; + u16 snd_wscale : 4, + rcv_wscale : 4, + tstamp_ok : 1, + sack_ok : 1, + wscale_ok : 1, + ecn_ok : 1, + acked : 1; + struct ip_options *opt; +}; + +static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) +{ + return (struct inet_request_sock *)sk; +} + +struct ipv6_pinfo; + +struct inet_sock { + /* sk and pinet6 has to be the first two members of inet_sock */ + struct sock sk; +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) + struct ipv6_pinfo *pinet6; +#endif + /* Socket demultiplex comparisons on incoming packets. */ + __u32 daddr; /* Foreign IPv4 addr */ + __u32 rcv_saddr; /* Bound local IPv4 addr */ + __u16 dport; /* Destination port */ + __u16 num; /* Local port */ + __u32 saddr; /* Sending source */ + __s16 uc_ttl; /* Unicast TTL */ + __u16 cmsg_flags; + struct ip_options *opt; + __u16 sport; /* Source port */ + __u16 id; /* ID counter for DF pkts */ + __u8 tos; /* TOS */ + __u8 mc_ttl; /* Multicasting TTL */ + __u8 pmtudisc; + unsigned recverr : 1, + freebind : 1, + hdrincl : 1, + mc_loop : 1; + int mc_index; /* Multicast device index */ + __u32 mc_addr; + struct ip_mc_socklist *mc_list; /* Group array */ + /* + * Following members are used to retain the infomation to build + * an ip header on each ip fragmentation while the socket is corked. + */ + struct { + unsigned int flags; + unsigned int fragsize; + struct ip_options *opt; + struct rtable *rt; + int length; /* Total length of all frames */ + u32 addr; + struct flowi fl; + } cork; +}; + +#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ +#define IPCORK_ALLFRAG 2 /* always fragment (for ipv6 for now) */ + +static inline struct inet_sock *inet_sk(const struct sock *sk) +{ + return (struct inet_sock *)sk; +} + +static inline void __inet_sk_copy_descendant(struct sock *sk_to, + const struct sock *sk_from, + const int ancestor_size) +{ + memcpy(inet_sk(sk_to) + 1, inet_sk(sk_from) + 1, + sk_from->sk_prot->obj_size - ancestor_size); +} +#if !(defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) +static inline void inet_sk_copy_descendant(struct sock *sk_to, + const struct sock *sk_from) +{ + __inet_sk_copy_descendant(sk_to, sk_from, sizeof(struct inet_sock)); +} +#endif +#endif + +extern int inet_sk_rebuild_header(struct sock *sk); + struct iphdr { #if defined(__LITTLE_ENDIAN_BITFIELD) __u8 ihl:4, diff --git a/trunk/include/linux/ipv6.h b/trunk/include/linux/ipv6.h index 93bbed5c6cf4..e0b922785d98 100644 --- a/trunk/include/linux/ipv6.h +++ b/trunk/include/linux/ipv6.h @@ -171,13 +171,12 @@ enum { }; #ifdef __KERNEL__ +#include /* struct sockaddr_in6 */ #include +#include /* struct ipv6_mc_socklist */ #include #include -#include /* struct ipv6_mc_socklist */ -#include - /* This structure contains results of exthdrs parsing as offsets from skb->nh. @@ -200,17 +199,18 @@ static inline int inet6_iif(const struct sk_buff *skb) return IP6CB(skb)->iif; } -struct inet6_request_sock { +struct tcp6_request_sock { + struct tcp_request_sock req; struct in6_addr loc_addr; struct in6_addr rmt_addr; struct sk_buff *pktopts; int iif; }; -struct tcp6_request_sock { - struct tcp_request_sock tcp6rsk_tcp; - struct inet6_request_sock tcp6rsk_inet6; -}; +static inline struct tcp6_request_sock *tcp6_rsk(const struct request_sock *sk) +{ + return (struct tcp6_request_sock *)sk; +} /** * struct ipv6_pinfo - ipv6 private area @@ -298,36 +298,12 @@ struct tcp6_sock { struct ipv6_pinfo inet6; }; -extern int inet6_sk_rebuild_header(struct sock *sk); - #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) { return inet_sk(__sk)->pinet6; } -static inline struct inet6_request_sock * - inet6_rsk(const struct request_sock *rsk) -{ - return (struct inet6_request_sock *)(((u8 *)rsk) + - inet_rsk(rsk)->inet6_rsk_offset); -} - -static inline u32 inet6_rsk_offset(struct request_sock *rsk) -{ - return rsk->rsk_ops->obj_size - sizeof(struct inet6_request_sock); -} - -static inline struct request_sock *inet6_reqsk_alloc(struct request_sock_ops *ops) -{ - struct request_sock *req = reqsk_alloc(ops); - - if (req != NULL) - inet_rsk(req)->inet6_rsk_offset = inet6_rsk_offset(req); - - return req; -} - static inline struct raw6_sock *raw6_sk(const struct sock *sk) { return (struct raw6_sock *)sk; @@ -347,37 +323,28 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) -struct inet6_timewait_sock { - struct in6_addr tw_v6_daddr; - struct in6_addr tw_v6_rcv_saddr; -}; +#include struct tcp6_timewait_sock { - struct tcp_timewait_sock tcp6tw_tcp; - struct inet6_timewait_sock tcp6tw_inet6; + struct tcp_timewait_sock tw_v6_sk; + struct in6_addr tw_v6_daddr; + struct in6_addr tw_v6_rcv_saddr; }; -static inline u16 inet6_tw_offset(const struct proto *prot) +static inline struct tcp6_timewait_sock *tcp6_twsk(const struct sock *sk) { - return prot->twsk_prot->twsk_obj_size - - sizeof(struct inet6_timewait_sock); + return (struct tcp6_timewait_sock *)sk; } -static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk) -{ - return (struct inet6_timewait_sock *)(((u8 *)sk) + - inet_twsk(sk)->tw_ipv6_offset); -} - -static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk) +static inline struct in6_addr *__tcp_v6_rcv_saddr(const struct sock *sk) { return likely(sk->sk_state != TCP_TIME_WAIT) ? - &inet6_sk(sk)->rcv_saddr : &inet6_twsk(sk)->tw_v6_rcv_saddr; + &inet6_sk(sk)->rcv_saddr : &tcp6_twsk(sk)->tw_v6_rcv_saddr; } -static inline struct in6_addr *inet6_rcv_saddr(const struct sock *sk) +static inline struct in6_addr *tcp_v6_rcv_saddr(const struct sock *sk) { - return sk->sk_family == AF_INET6 ? __inet6_rcv_saddr(sk) : NULL; + return sk->sk_family == AF_INET6 ? __tcp_v6_rcv_saddr(sk) : NULL; } static inline int inet_v6_ipv6only(const struct sock *sk) @@ -394,19 +361,13 @@ static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) return NULL; } -static inline struct inet6_request_sock * - inet6_rsk(const struct request_sock *rsk) -{ - return NULL; -} - static inline struct raw6_sock *raw6_sk(const struct sock *sk) { return NULL; } -#define __inet6_rcv_saddr(__sk) NULL -#define inet6_rcv_saddr(__sk) NULL +#define __tcp_v6_rcv_saddr(__sk) NULL +#define tcp_v6_rcv_saddr(__sk) NULL #define tcp_twsk_ipv6only(__sk) 0 #define inet_v6_ipv6only(__sk) 0 #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ diff --git a/trunk/include/linux/ipv6_route.h b/trunk/include/linux/ipv6_route.h index d7c41d1d706a..e2f935038013 100644 --- a/trunk/include/linux/ipv6_route.h +++ b/trunk/include/linux/ipv6_route.h @@ -18,7 +18,6 @@ fallback, no routers on link */ #define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */ #define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */ -#define RTF_ANYCAST 0x00100000 /* Anycast */ #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ #define RTF_EXPIRES 0x00400000 diff --git a/trunk/include/linux/irq.h b/trunk/include/linux/irq.h index f04ba20712a2..c516382fbec2 100644 --- a/trunk/include/linux/irq.h +++ b/trunk/include/linux/irq.h @@ -10,7 +10,7 @@ */ #include -#include +#include /* cpu_online_map */ #if !defined(CONFIG_ARCH_S390) diff --git a/trunk/include/linux/jbd.h b/trunk/include/linux/jbd.h index dcde7adfdce5..aa56172c6fed 100644 --- a/trunk/include/linux/jbd.h +++ b/trunk/include/linux/jbd.h @@ -16,6 +16,8 @@ #ifndef _LINUX_JBD_H #define _LINUX_JBD_H +#if defined(CONFIG_JBD) || defined(CONFIG_JBD_MODULE) || !defined(__KERNEL__) + /* Allow this file to be included directly into e2fsprogs */ #ifndef __KERNEL__ #include "jfs_compat.h" @@ -1081,4 +1083,19 @@ extern int jbd_blocks_per_page(struct inode *inode); #endif /* __KERNEL__ */ +#endif /* CONFIG_JBD || CONFIG_JBD_MODULE || !__KERNEL__ */ + +/* + * Compatibility no-ops which allow the kernel to compile without CONFIG_JBD + * go here. + */ + +#if defined(__KERNEL__) && !(defined(CONFIG_JBD) || defined(CONFIG_JBD_MODULE)) + +#define J_ASSERT(expr) do {} while (0) +#define J_ASSERT_BH(bh, expr) do {} while (0) +#define buffer_jbd(bh) 0 +#define journal_buffer_journal_lru(bh) 0 + +#endif /* defined(__KERNEL__) && !defined(CONFIG_JBD) */ #endif /* _LINUX_JBD_H */ diff --git a/trunk/include/linux/kprobes.h b/trunk/include/linux/kprobes.h index c03f2dc933de..e373c4a9de53 100644 --- a/trunk/include/linux/kprobes.h +++ b/trunk/include/linux/kprobes.h @@ -37,7 +37,6 @@ #include #include -#ifdef CONFIG_KPROBES #include /* kprobe_status settings */ @@ -148,6 +147,7 @@ struct kretprobe_instance { struct task_struct *task; }; +#ifdef CONFIG_KPROBES extern spinlock_t kretprobe_lock; extern int arch_prepare_kprobe(struct kprobe *p); extern void arch_copy_kprobe(struct kprobe *p); @@ -158,7 +158,6 @@ extern int arch_init_kprobes(void); extern void show_registers(struct pt_regs *regs); extern kprobe_opcode_t *get_insn_slot(void); extern void free_insn_slot(kprobe_opcode_t *slot); -extern void kprobes_inc_nmissed_count(struct kprobe *p); /* Get the kprobe at this addr (if any) - called with preemption disabled */ struct kprobe *get_kprobe(void *addr); @@ -196,11 +195,6 @@ void add_rp_inst(struct kretprobe_instance *ri); void kprobe_flush_task(struct task_struct *tk); void recycle_rp_inst(struct kretprobe_instance *ri); #else /* CONFIG_KPROBES */ - -#define __kprobes /**/ -struct jprobe; -struct kretprobe; - static inline struct kprobe *kprobe_running(void) { return NULL; diff --git a/trunk/include/linux/libata.h b/trunk/include/linux/libata.h index 41ea7dbc1755..83a83babff84 100644 --- a/trunk/include/linux/libata.h +++ b/trunk/include/linux/libata.h @@ -122,7 +122,6 @@ enum { ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once * proper HSM is in place. */ ATA_FLAG_DEBUGMSG = (1 << 10), - ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */ ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ @@ -331,8 +330,6 @@ struct ata_port { u8 ctl; /* cache of ATA control register */ u8 last_ctl; /* Cache last written value */ - unsigned int bus_state; - unsigned int port_state; unsigned int pio_mask; unsigned int mwdma_mask; unsigned int udma_mask; diff --git a/trunk/include/linux/list.h b/trunk/include/linux/list.h index 8e3388284530..fbfca73355a3 100644 --- a/trunk/include/linux/list.h +++ b/trunk/include/linux/list.h @@ -202,15 +202,12 @@ static inline void list_del_rcu(struct list_head *entry) * * The old entry will be replaced with the new entry atomically. */ -static inline void list_replace_rcu(struct list_head *old, - struct list_head *new) -{ +static inline void list_replace_rcu(struct list_head *old, struct list_head *new){ new->next = old->next; new->prev = old->prev; smp_wmb(); new->next->prev = new; new->prev->next = new; - old->prev = LIST_POISON2; } /** @@ -581,27 +578,6 @@ static inline void hlist_del_init(struct hlist_node *n) } } -/* - * hlist_replace_rcu - replace old entry by new one - * @old : the element to be replaced - * @new : the new element to insert - * - * The old entry will be replaced with the new entry atomically. - */ -static inline void hlist_replace_rcu(struct hlist_node *old, - struct hlist_node *new) -{ - struct hlist_node *next = old->next; - - new->next = next; - new->pprev = old->pprev; - smp_wmb(); - if (next) - new->next->pprev = &new->next; - *new->pprev = new; - old->pprev = LIST_POISON2; -} - static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h) { struct hlist_node *first = h->first; diff --git a/trunk/include/linux/memory.h b/trunk/include/linux/memory.h index dc4081b6f161..9a424383e6c6 100644 --- a/trunk/include/linux/memory.h +++ b/trunk/include/linux/memory.h @@ -85,6 +85,7 @@ struct notifier_block; extern int register_memory_notifier(struct notifier_block *nb); extern void unregister_memory_notifier(struct notifier_block *nb); +extern struct sysdev_class memory_sysdev_class; #endif /* CONFIG_MEMORY_HOTPLUG */ #define hotplug_memory_notifier(fn, pri) { \ diff --git a/trunk/include/linux/mm.h b/trunk/include/linux/mm.h index a06a84d347fb..7b115feca4df 100644 --- a/trunk/include/linux/mm.h +++ b/trunk/include/linux/mm.h @@ -144,8 +144,7 @@ extern unsigned int kobjsize(const void *objp); #define VM_GROWSDOWN 0x00000100 /* general info on the segment */ #define VM_GROWSUP 0x00000200 -#define VM_SHM 0x00000000 /* Means nothing: delete it later */ -#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ +#define VM_SHM 0x00000400 /* shared memory area, don't swap out */ #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ #define VM_EXECUTABLE 0x00001000 @@ -158,12 +157,11 @@ extern unsigned int kobjsize(const void *objp); #define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ -#define VM_RESERVED 0x00080000 /* Count as reserved_vm like IO */ +#define VM_RESERVED 0x00080000 /* Pages managed in a special way */ #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ #define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ -#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS @@ -208,6 +206,12 @@ struct vm_operations_struct { struct mmu_gather; struct inode; +#ifdef ARCH_HAS_ATOMIC_UNSIGNED +typedef unsigned page_flags_t; +#else +typedef unsigned long page_flags_t; +#endif + /* * Each physical page in the system has a struct page associated with * it to keep track of whatever it is we are using the page for at the @@ -215,7 +219,7 @@ struct inode; * a page. */ struct page { - unsigned long flags; /* Atomic flags, some possibly + page_flags_t flags; /* Atomic flags, some possibly * updated asynchronously */ atomic_t _count; /* Usage count, see below. */ atomic_t _mapcount; /* Count of ptes mapped in mms, @@ -313,6 +317,8 @@ struct page { extern void FASTCALL(__page_cache_release(struct page *)); +#ifdef CONFIG_HUGETLB_PAGE + static inline int page_count(struct page *page) { if (PageCompound(page)) @@ -329,6 +335,23 @@ static inline void get_page(struct page *page) void put_page(struct page *page); +#else /* CONFIG_HUGETLB_PAGE */ + +#define page_count(p) (atomic_read(&(p)->_count) + 1) + +static inline void get_page(struct page *page) +{ + atomic_inc(&page->_count); +} + +static inline void put_page(struct page *page) +{ + if (put_page_testzero(page)) + __page_cache_release(page); +} + +#endif /* CONFIG_HUGETLB_PAGE */ + /* * Multiple processes may "see" the same page. E.g. for untouched * mappings of /dev/null, all processes see the same page full of @@ -412,7 +435,7 @@ void put_page(struct page *page); #endif /* Page flags: | [SECTION] | [NODE] | ZONE | ... | FLAGS | */ -#define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH) +#define SECTIONS_PGOFF ((sizeof(page_flags_t)*8) - SECTIONS_WIDTH) #define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) #define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) @@ -665,7 +688,6 @@ struct zap_details { unsigned long truncate_count; /* Compare vm_truncate_count */ }; -struct page *vm_normal_page(struct vm_area_struct *, unsigned long, pte_t); unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, unsigned long size, struct zap_details *); unsigned long unmap_vmas(struct mmu_gather **tlb, @@ -742,8 +764,6 @@ struct shrinker; extern struct shrinker *set_shrinker(int, shrinker_t); extern void remove_shrinker(struct shrinker *shrinker); -extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); - int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); @@ -926,9 +946,7 @@ unsigned long max_sane_readahead(unsigned long nr); /* Do stack extension */ extern int expand_stack(struct vm_area_struct *vma, unsigned long address); -#ifdef CONFIG_IA64 extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); -#endif /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); @@ -956,9 +974,8 @@ struct page *vmalloc_to_page(void *addr); unsigned long vmalloc_to_pfn(void *addr); int remap_pfn_range(struct vm_area_struct *, unsigned long addr, unsigned long pfn, unsigned long size, pgprot_t); -int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); -struct page *follow_page(struct vm_area_struct *, unsigned long address, +struct page *follow_page(struct mm_struct *, unsigned long address, unsigned int foll_flags); #define FOLL_WRITE 0x01 /* check pte is writable */ #define FOLL_TOUCH 0x02 /* mark page accessed */ diff --git a/trunk/include/linux/mmc/protocol.h b/trunk/include/linux/mmc/protocol.h index a14dc306545b..f819cae92266 100644 --- a/trunk/include/linux/mmc/protocol.h +++ b/trunk/include/linux/mmc/protocol.h @@ -63,7 +63,7 @@ /* class 5 */ #define MMC_ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */ #define MMC_ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */ -#define MMC_ERASE 38 /* ac R1b */ +#define MMC_ERASE 37 /* ac R1b */ /* class 9 */ #define MMC_FAST_IO 39 /* ac R4 */ @@ -74,7 +74,7 @@ /* class 8 */ #define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ -#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */ +#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1b */ /* SD commands type argument response */ /* class 8 */ diff --git a/trunk/include/linux/mmzone.h b/trunk/include/linux/mmzone.h index 9f22090df7dd..f5fa3082fd6a 100644 --- a/trunk/include/linux/mmzone.h +++ b/trunk/include/linux/mmzone.h @@ -71,11 +71,10 @@ struct per_cpu_pageset { #endif #define ZONE_DMA 0 -#define ZONE_DMA32 1 -#define ZONE_NORMAL 2 -#define ZONE_HIGHMEM 3 +#define ZONE_NORMAL 1 +#define ZONE_HIGHMEM 2 -#define MAX_NR_ZONES 4 /* Sync this with ZONES_SHIFT */ +#define MAX_NR_ZONES 3 /* Sync this with ZONES_SHIFT */ #define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ @@ -91,18 +90,27 @@ struct per_cpu_pageset { * will be a maximum of 4 (2 ** 2) zonelists, for 3 modifiers there will * be 8 (2 ** 3) zonelists. GFP_ZONETYPES defines the number of possible * combinations of zone modifiers in "zone modifier space". - * - * NOTE! Make sure this matches the zones in */ -#define GFP_ZONEMASK 0x07 -#define GFP_ZONETYPES 5 +#define GFP_ZONEMASK 0x03 +/* + * As an optimisation any zone modifier bits which are only valid when + * no other zone modifier bits are set (loners) should be placed in + * the highest order bits of this field. This allows us to reduce the + * extent of the zonelists thus saving space. For example in the case + * of three zone modifier bits, we could require up to eight zonelists. + * If the left most zone modifier is a "loner" then the highest valid + * zonelist would be four allowing us to allocate only five zonelists. + * Use the first form when the left most bit is not a "loner", otherwise + * use the second. + */ +/* #define GFP_ZONETYPES (GFP_ZONEMASK + 1) */ /* Non-loner */ +#define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */ /* * On machines where it is needed (eg PCs) we divide physical memory - * into multiple physical zones. On a PC we have 4 zones: + * into multiple physical zones. On a PC we have 3 zones: * * ZONE_DMA < 16 MB ISA DMA capable memory - * ZONE_DMA32 0 MB Empty * ZONE_NORMAL 16-896 MB direct mapped by the kernel * ZONE_HIGHMEM > 896 MB only page cache and user processes */ @@ -321,7 +329,7 @@ void get_zone_counts(unsigned long *active, unsigned long *inactive, void build_all_zonelists(void); void wakeup_kswapd(struct zone *zone, int order); int zone_watermark_ok(struct zone *z, int order, unsigned long mark, - int classzone_idx, int alloc_flags); + int alloc_type, int can_try_harder, gfp_t gfp_high); #ifdef CONFIG_HAVE_MEMORY_PRESENT void memory_present(int nid, unsigned long start, unsigned long end); @@ -425,9 +433,7 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, #include /* Returns the number of the current Node. */ -#ifndef numa_node_id #define numa_node_id() (cpu_to_node(raw_smp_processor_id())) -#endif #ifndef CONFIG_NEED_MULTIPLE_NODES @@ -447,12 +453,12 @@ extern struct pglist_data contig_page_data; #include #endif -#if BITS_PER_LONG == 32 +#if BITS_PER_LONG == 32 || defined(ARCH_HAS_ATOMIC_UNSIGNED) /* - * with 32 bit page->flags field, we reserve 9 bits for node/zone info. - * there are 4 zones (3 bits) and this leaves 9-3=6 bits for nodes. + * with 32 bit page->flags field, we reserve 8 bits for node/zone info. + * there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes. */ -#define FLAGS_RESERVED 9 +#define FLAGS_RESERVED 8 #elif BITS_PER_LONG == 64 /* diff --git a/trunk/include/linux/mtd/cfi.h b/trunk/include/linux/mtd/cfi.h index 23a568910341..3c9ea4b7adda 100644 --- a/trunk/include/linux/mtd/cfi.h +++ b/trunk/include/linux/mtd/cfi.h @@ -1,7 +1,7 @@ /* Common Flash Interface structures * See http://support.intel.com/design/flash/technote/index.htm - * $Id: cfi.h,v 1.57 2005/11/15 23:28:17 tpoynor Exp $ + * $Id: cfi.h,v 1.56 2005/11/07 11:14:54 gleixner Exp $ */ #ifndef __MTD_CFI_H__ @@ -426,22 +426,6 @@ static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr) } } -static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr) -{ - map_word val = map_read(map, addr); - - if (map_bankwidth_is_1(map)) { - return val.x[0] & 0xff; - } else if (map_bankwidth_is_2(map)) { - return cfi16_to_cpu(val.x[0]); - } else { - /* No point in a 64-bit byteswap since that would just be - swapping the responses from different chips, and we are - only interested in one chip (a representative sample) */ - return cfi32_to_cpu(val.x[0]); - } -} - static inline void cfi_udelay(int us) { if (us >= 1000) { diff --git a/trunk/include/linux/mtd/onenand.h b/trunk/include/linux/mtd/onenand.h index 7419b5fab133..f1fd4215686a 100644 --- a/trunk/include/linux/mtd/onenand.h +++ b/trunk/include/linux/mtd/onenand.h @@ -17,6 +17,7 @@ #include #define MAX_BUFFERRAM 2 +#define MAX_ONENAND_PAGESIZE (2048 + 64) /* Scan and identify a OneNAND device */ extern int onenand_scan(struct mtd_info *mtd, int max_chips); @@ -109,7 +110,6 @@ struct onenand_chip { spinlock_t chip_lock; wait_queue_head_t wq; onenand_state_t state; - unsigned char *page_buf; struct nand_oobinfo *autooob; @@ -134,12 +134,13 @@ struct onenand_chip { * Options bits */ #define ONENAND_CONT_LOCK (0x0001) -#define ONENAND_PAGEBUF_ALLOC (0x1000) + /* * OneNAND Flash Manufacturer ID Codes */ #define ONENAND_MFR_SAMSUNG 0xec +#define ONENAND_MFR_UNKNOWN 0x00 /** * struct nand_manufacturers - NAND Flash Manufacturer ID Structure diff --git a/trunk/include/linux/n_r3964.h b/trunk/include/linux/n_r3964.h index db4f3776978a..2352bcd31a06 100644 --- a/trunk/include/linux/n_r3964.h +++ b/trunk/include/linux/n_r3964.h @@ -13,10 +13,6 @@ * L. Haag * * $Log: r3964.h,v $ - * Revision 1.4 2005/12/21 19:54:24 Kurt Huwig - * Fixed HZ usage on 2.6 kernels - * Removed unnecessary include - * * Revision 1.3 2001/03/18 13:02:24 dwmw2 * Fix timer usage, use spinlocks properly. * @@ -49,11 +45,9 @@ #define __LINUX_N_R3964_H__ /* line disciplines for r3964 protocol */ +#include #ifdef __KERNEL__ - -#include - /* * Common ascii handshake characters: */ @@ -64,14 +58,14 @@ #define NAK 0x15 /* - * Timeouts (from milliseconds to jiffies) + * Timeouts (msecs/10 msecs per timer interrupt): */ -#define R3964_TO_QVZ ((550)*HZ/1000) -#define R3964_TO_ZVZ ((220)*HZ/1000) -#define R3964_TO_NO_BUF ((400)*HZ/1000) -#define R3964_NO_TX_ROOM ((100)*HZ/1000) -#define R3964_TO_RX_PANIC ((4000)*HZ/1000) +#define R3964_TO_QVZ 550/10 +#define R3964_TO_ZVZ 220/10 +#define R3964_TO_NO_BUF 400/10 +#define R3964_NO_TX_ROOM 100/10 +#define R3964_TO_RX_PANIC 4000/10 #define R3964_MAX_RETRIES 5 #endif diff --git a/trunk/include/linux/net.h b/trunk/include/linux/net.h index 28195a2d8ff0..d6a41e6577f6 100644 --- a/trunk/include/linux/net.h +++ b/trunk/include/linux/net.h @@ -107,7 +107,7 @@ enum sock_type { struct socket { socket_state state; unsigned long flags; - const struct proto_ops *ops; + struct proto_ops *ops; struct fasync_struct *fasync_list; struct file *file; struct sock *sk; @@ -260,7 +260,7 @@ SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct ms SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \ (file, sock, vma)) \ \ -static const struct proto_ops name##_ops = { \ +static struct proto_ops name##_ops = { \ .family = fam, \ .owner = THIS_MODULE, \ .release = __lock_##name##_release, \ diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h index 7fda03d338d1..936f8b76114e 100644 --- a/trunk/include/linux/netdevice.h +++ b/trunk/include/linux/netdevice.h @@ -684,7 +684,6 @@ extern int netif_rx(struct sk_buff *skb); extern int netif_rx_ni(struct sk_buff *skb); #define HAVE_NETIF_RECEIVE_SKB 1 extern int netif_receive_skb(struct sk_buff *skb); -extern int dev_valid_name(const char *name); extern int dev_ioctl(unsigned int cmd, void __user *); extern int dev_ethtool(struct ifreq *); extern unsigned dev_get_flags(const struct net_device *); @@ -802,16 +801,12 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) return (1 << debug_value) - 1; } -/* Test if receive needs to be scheduled */ -static inline int __netif_rx_schedule_prep(struct net_device *dev) -{ - return !test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state); -} +/* Schedule rx intr now? */ -/* Test if receive needs to be scheduled but only if up */ static inline int netif_rx_schedule_prep(struct net_device *dev) { - return netif_running(dev) && __netif_rx_schedule_prep(dev); + return netif_running(dev) && + !test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state); } /* Add interface to tail of rx poll list. This assumes that _prep has diff --git a/trunk/include/linux/netfilter/nfnetlink.h b/trunk/include/linux/netfilter/nfnetlink.h index 934a2479f160..72975fa8795d 100644 --- a/trunk/include/linux/netfilter/nfnetlink.h +++ b/trunk/include/linux/netfilter/nfnetlink.h @@ -112,6 +112,7 @@ struct nfnl_callback { int (*call)(struct sock *nl, struct sk_buff *skb, struct nlmsghdr *nlh, struct nfattr *cda[], int *errp); + kernel_cap_t cap_required; /* capabilities required for this msg */ u_int16_t attr_count; /* number of nfattr's */ }; @@ -153,14 +154,11 @@ extern void nfattr_parse(struct nfattr *tb[], int maxattr, #define nfattr_bad_size(tb, max, cta_min) \ ({ int __i, __res = 0; \ - for (__i=0; __iflags) #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) +#ifdef CONFIG_HUGETLB_PAGE #define PageCompound(page) test_bit(PG_compound, &(page)->flags) +#else +#define PageCompound(page) 0 +#endif #define SetPageCompound(page) set_bit(PG_compound, &(page)->flags) #define ClearPageCompound(page) clear_bit(PG_compound, &(page)->flags) diff --git a/trunk/include/linux/pagemap.h b/trunk/include/linux/pagemap.h index ee700c6eb442..ba6c310a055f 100644 --- a/trunk/include/linux/pagemap.h +++ b/trunk/include/linux/pagemap.h @@ -53,12 +53,12 @@ void release_pages(struct page **pages, int nr, int cold); static inline struct page *page_cache_alloc(struct address_space *x) { - return alloc_pages(mapping_gfp_mask(x), 0); + return alloc_pages(mapping_gfp_mask(x)|__GFP_NORECLAIM, 0); } static inline struct page *page_cache_alloc_cold(struct address_space *x) { - return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); + return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD|__GFP_NORECLAIM, 0); } typedef int filler_t(void *, struct page *); diff --git a/trunk/include/linux/parport_pc.h b/trunk/include/linux/parport_pc.h index c6f762470879..7825c76cbd00 100644 --- a/trunk/include/linux/parport_pc.h +++ b/trunk/include/linux/parport_pc.h @@ -86,7 +86,7 @@ extern __inline__ void dump_parport_state (char *str, struct parport *p) unsigned char dcr = inb (CONTROL (p)); unsigned char dsr = inb (STATUS (p)); static char *ecr_modes[] = {"SPP", "PS2", "PPFIFO", "ECP", "xXx", "yYy", "TST", "CFG"}; - const struct parport_pc_private *priv = p->physport->private_data; + const struct parport_pc_private *priv = (parport_pc_private *)p->physport->private_data; int i; printk (KERN_DEBUG "*** parport state (%s): ecr=[%s", str, ecr_modes[(ecr & 0xe0) >> 5]); diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h index a17e171384ef..d00f8ba7f22b 100644 --- a/trunk/include/linux/pci_ids.h +++ b/trunk/include/linux/pci_ids.h @@ -15,7 +15,6 @@ #define PCI_CLASS_STORAGE_FLOPPY 0x0102 #define PCI_CLASS_STORAGE_IPI 0x0103 #define PCI_CLASS_STORAGE_RAID 0x0104 -#define PCI_CLASS_STORAGE_SAS 0x0107 #define PCI_CLASS_STORAGE_OTHER 0x0180 #define PCI_BASE_CLASS_NETWORK 0x02 @@ -621,7 +620,6 @@ #define PCI_DEVICE_ID_SI_961 0x0961 #define PCI_DEVICE_ID_SI_962 0x0962 #define PCI_DEVICE_ID_SI_963 0x0963 -#define PCI_DEVICE_ID_SI_965 0x0965 #define PCI_DEVICE_ID_SI_5511 0x5511 #define PCI_DEVICE_ID_SI_5513 0x5513 #define PCI_DEVICE_ID_SI_5518 0x5518 @@ -807,10 +805,6 @@ #define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051 #define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058 #define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059 -#define PCI_DEVICE_ID_APPLE_IPID2_AGP 0x0066 -#define PCI_DEVICE_ID_APPLE_IPID2_ATA 0x0069 -#define PCI_DEVICE_ID_APPLE_IPID2_FW 0x006a -#define PCI_DEVICE_ID_APPLE_IPID2_GMAC 0x006b #define PCI_DEVICE_ID_APPLE_TIGON3 0x1645 #define PCI_VENDOR_ID_YAMAHA 0x1073 @@ -1200,7 +1194,6 @@ #define PCI_DEVICE_ID_VIA_3269_0 0x0269 #define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 #define PCI_DEVICE_ID_VIA_8363_0 0x0305 -#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314 #define PCI_DEVICE_ID_VIA_8371_0 0x0391 #define PCI_DEVICE_ID_VIA_8501_0 0x0501 #define PCI_DEVICE_ID_VIA_82C561 0x0561 @@ -1237,7 +1230,6 @@ #define PCI_DEVICE_ID_VIA_8703_51_0 0x3148 #define PCI_DEVICE_ID_VIA_8237_SATA 0x3149 #define PCI_DEVICE_ID_VIA_XN266 0x3156 -#define PCI_DEVICE_ID_VIA_6410 0x3164 #define PCI_DEVICE_ID_VIA_8754C_0 0x3168 #define PCI_DEVICE_ID_VIA_8235 0x3177 #define PCI_DEVICE_ID_VIA_8385_0 0x3188 @@ -1245,7 +1237,6 @@ #define PCI_DEVICE_ID_VIA_8378_0 0x3205 #define PCI_DEVICE_ID_VIA_8783_0 0x3208 #define PCI_DEVICE_ID_VIA_8237 0x3227 -#define PCI_DEVICE_ID_VIA_8251 0x3287 #define PCI_DEVICE_ID_VIA_3296_0 0x0296 #define PCI_DEVICE_ID_VIA_8231 0x8231 #define PCI_DEVICE_ID_VIA_8231_4 0x8235 @@ -1406,7 +1397,6 @@ #define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334 #define PCI_VENDOR_ID_MARVELL 0x11ab -#define PCI_DEVICE_ID_MARVELL_GT64111 0x4146 #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 diff --git a/trunk/include/linux/percpu.h b/trunk/include/linux/percpu.h index fb8d2d24e4bb..5451eb1e781d 100644 --- a/trunk/include/linux/percpu.h +++ b/trunk/include/linux/percpu.h @@ -38,7 +38,7 @@ extern void free_percpu(const void *); #else /* CONFIG_SMP */ -#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) +#define per_cpu_ptr(ptr, cpu) (ptr) static inline void *__alloc_percpu(size_t size, size_t align) { diff --git a/trunk/include/linux/pfkeyv2.h b/trunk/include/linux/pfkeyv2.h index 6351c4055ace..724066778aff 100644 --- a/trunk/include/linux/pfkeyv2.h +++ b/trunk/include/linux/pfkeyv2.h @@ -216,16 +216,6 @@ struct sadb_x_nat_t_port { } __attribute__((packed)); /* sizeof(struct sadb_x_nat_t_port) == 8 */ -/* Generic LSM security context */ -struct sadb_x_sec_ctx { - uint16_t sadb_x_sec_len; - uint16_t sadb_x_sec_exttype; - uint8_t sadb_x_ctx_alg; /* LSMs: e.g., selinux == 1 */ - uint8_t sadb_x_ctx_doi; - uint16_t sadb_x_ctx_len; -} __attribute__((packed)); -/* sizeof(struct sadb_sec_ctx) = 8 */ - /* Message types */ #define SADB_RESERVED 0 #define SADB_GETSPI 1 @@ -335,8 +325,7 @@ struct sadb_x_sec_ctx { #define SADB_X_EXT_NAT_T_SPORT 21 #define SADB_X_EXT_NAT_T_DPORT 22 #define SADB_X_EXT_NAT_T_OA 23 -#define SADB_X_EXT_SEC_CTX 24 -#define SADB_EXT_MAX 24 +#define SADB_EXT_MAX 23 /* Identity Extension values */ #define SADB_IDENTTYPE_RESERVED 0 diff --git a/trunk/include/linux/pkt_sched.h b/trunk/include/linux/pkt_sched.h index d10f35338507..e87b233615b3 100644 --- a/trunk/include/linux/pkt_sched.h +++ b/trunk/include/linux/pkt_sched.h @@ -429,7 +429,6 @@ enum TCA_NETEM_CORR, TCA_NETEM_DELAY_DIST, TCA_NETEM_REORDER, - TCA_NETEM_CORRUPT, __TCA_NETEM_MAX, }; @@ -458,12 +457,6 @@ struct tc_netem_reorder __u32 correlation; }; -struct tc_netem_corrupt -{ - __u32 probability; - __u32 correlation; -}; - #define NETEM_DIST_SCALE 8192 #endif diff --git a/trunk/include/linux/pm.h b/trunk/include/linux/pm.h index 5be87ba3b7ac..1514098d156d 100644 --- a/trunk/include/linux/pm.h +++ b/trunk/include/linux/pm.h @@ -94,6 +94,55 @@ struct pm_dev struct list_head entry; }; +#ifdef CONFIG_PM + +extern int pm_active; + +#define PM_IS_ACTIVE() (pm_active != 0) + +/* + * Register a device with power management + */ +struct pm_dev __deprecated * +pm_register(pm_dev_t type, unsigned long id, pm_callback callback); + +/* + * Unregister a device with power management + */ +void __deprecated pm_unregister(struct pm_dev *dev); + +/* + * Unregister all devices with matching callback + */ +void __deprecated pm_unregister_all(pm_callback callback); + +/* + * Send a request to all devices + */ +int __deprecated pm_send_all(pm_request_t rqst, void *data); + +#else /* CONFIG_PM */ + +#define PM_IS_ACTIVE() 0 + +static inline struct pm_dev *pm_register(pm_dev_t type, + unsigned long id, + pm_callback callback) +{ + return NULL; +} + +static inline void pm_unregister(struct pm_dev *dev) {} + +static inline void pm_unregister_all(pm_callback callback) {} + +static inline int pm_send_all(pm_request_t rqst, void *data) +{ + return 0; +} + +#endif /* CONFIG_PM */ + /* Functions above this comment are list-based old-style power * managment. Please avoid using them. */ diff --git a/trunk/include/linux/pm_legacy.h b/trunk/include/linux/pm_legacy.h deleted file mode 100644 index 1252b45face1..000000000000 --- a/trunk/include/linux/pm_legacy.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef __LINUX_PM_LEGACY_H__ -#define __LINUX_PM_LEGACY_H__ - -#include - -#ifdef CONFIG_PM_LEGACY - -extern int pm_active; - -#define PM_IS_ACTIVE() (pm_active != 0) - -/* - * Register a device with power management - */ -struct pm_dev __deprecated * -pm_register(pm_dev_t type, unsigned long id, pm_callback callback); - -/* - * Unregister a device with power management - */ -void __deprecated pm_unregister(struct pm_dev *dev); - -/* - * Unregister all devices with matching callback - */ -void __deprecated pm_unregister_all(pm_callback callback); - -/* - * Send a request to all devices - */ -int __deprecated pm_send_all(pm_request_t rqst, void *data); - -#else /* CONFIG_PM_LEGACY */ - -#define PM_IS_ACTIVE() 0 - -static inline struct pm_dev *pm_register(pm_dev_t type, - unsigned long id, - pm_callback callback) -{ - return NULL; -} - -static inline void pm_unregister(struct pm_dev *dev) {} - -static inline void pm_unregister_all(pm_callback callback) {} - -static inline int pm_send_all(pm_request_t rqst, void *data) -{ - return 0; -} - -#endif /* CONFIG_PM_LEGACY */ - -#endif /* __LINUX_PM_LEGACY_H__ */ - diff --git a/trunk/include/linux/preempt.h b/trunk/include/linux/preempt.h index 5769d14d1e6a..dd98c54a23b4 100644 --- a/trunk/include/linux/preempt.h +++ b/trunk/include/linux/preempt.h @@ -7,7 +7,6 @@ */ #include -#include #include #ifdef CONFIG_DEBUG_PREEMPT @@ -48,7 +47,6 @@ do { \ #define preempt_enable() \ do { \ preempt_enable_no_resched(); \ - barrier(); \ preempt_check_resched(); \ } while (0) diff --git a/trunk/include/linux/random.h b/trunk/include/linux/random.h index 5d6456bcdeba..7b2adb3322d5 100644 --- a/trunk/include/linux/random.h +++ b/trunk/include/linux/random.h @@ -52,9 +52,9 @@ extern void get_random_bytes(void *buf, int nbytes); void generate_random_uuid(unsigned char uuid_out[16]); extern __u32 secure_ip_id(__u32 daddr); -extern u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport); -extern u32 secure_ipv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, - __u16 dport); +extern u32 secure_tcp_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport); +extern u32 secure_tcpv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, + __u16 dport); extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, __u16 sport, __u16 dport); extern __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, diff --git a/trunk/include/linux/rcupdate.h b/trunk/include/linux/rcupdate.h index a471f3bb713e..cce25591eec2 100644 --- a/trunk/include/linux/rcupdate.h +++ b/trunk/include/linux/rcupdate.h @@ -100,7 +100,6 @@ struct rcu_data { struct rcu_head *donelist; struct rcu_head **donetail; int cpu; - struct rcu_head barrier; }; DECLARE_PER_CPU(struct rcu_data, rcu_data); @@ -286,7 +285,6 @@ extern void FASTCALL(call_rcu_bh(struct rcu_head *head, extern __deprecated_for_modules void synchronize_kernel(void); extern void synchronize_rcu(void); void synchronize_idle(void); -extern void rcu_barrier(void); #endif /* __KERNEL__ */ #endif /* __LINUX_RCUPDATE_H */ diff --git a/trunk/include/linux/relayfs_fs.h b/trunk/include/linux/relayfs_fs.h index fb7e80737325..cfafc3e76bc2 100644 --- a/trunk/include/linux/relayfs_fs.h +++ b/trunk/include/linux/relayfs_fs.h @@ -20,9 +20,9 @@ #include /* - * Tracks changes to rchan/rchan_buf structs + * Tracks changes to rchan_buf struct */ -#define RELAYFS_CHANNEL_VERSION 6 +#define RELAYFS_CHANNEL_VERSION 5 /* * Per-cpu relay channel buffer @@ -60,7 +60,6 @@ struct rchan struct rchan_callbacks *cb; /* client callbacks */ struct kref kref; /* channel refcount */ void *private_data; /* for user-defined data */ - size_t last_toobig; /* tried to log event > subbuf size */ struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */ }; diff --git a/trunk/include/linux/rmap.h b/trunk/include/linux/rmap.h index 33261f1d2239..35b30e6c8cf8 100644 --- a/trunk/include/linux/rmap.h +++ b/trunk/include/linux/rmap.h @@ -89,7 +89,7 @@ static inline void page_dup_rmap(struct page *page) /* * Called from mm/vmscan.c to handle paging out */ -int page_referenced(struct page *, int is_locked); +int page_referenced(struct page *, int is_locked, int ignore_token); int try_to_unmap(struct page *); /* @@ -109,7 +109,7 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *); #define anon_vma_prepare(vma) (0) #define anon_vma_link(vma) do {} while (0) -#define page_referenced(page,l) TestClearPageReferenced(page) +#define page_referenced(page,l,i) TestClearPageReferenced(page) #define try_to_unmap(page) SWAP_FAIL #endif /* CONFIG_MMU */ diff --git a/trunk/include/linux/rtnetlink.h b/trunk/include/linux/rtnetlink.h index d50482ba27fe..c231e9a08f0b 100644 --- a/trunk/include/linux/rtnetlink.h +++ b/trunk/include/linux/rtnetlink.h @@ -866,7 +866,6 @@ enum rtnetlink_groups { #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_ROUTE, #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE - RTNLGRP_NOP1, RTNLGRP_IPV6_IFADDR, #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_MROUTE, @@ -877,11 +876,8 @@ enum rtnetlink_groups { #define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO RTNLGRP_DECnet_IFADDR, #define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR - RTNLGRP_NOP2, RTNLGRP_DECnet_ROUTE, #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE - RTNLGRP_NOP3, - RTNLGRP_NOP4, RTNLGRP_IPV6_PREFIX, #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX __RTNLGRP_MAX diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index b0ad6f30679e..2bbf968b23d9 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -357,6 +357,7 @@ struct mm_struct { /* aio bits */ rwlock_t ioctx_list_lock; struct kioctx *ioctx_list; + struct kioctx default_kioctx; }; struct sighand_struct { @@ -908,6 +909,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0) #define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ +#define PF_HOTPLUG_CPU 0x01000000 /* Currently performing CPU hotplug */ /* * Only the _current_ task can read/write to tsk->flags, but other @@ -1231,49 +1233,32 @@ static inline void task_unlock(struct task_struct *p) spin_unlock(&p->alloc_lock); } -#ifndef __HAVE_THREAD_FUNCTIONS - -#define task_thread_info(task) (task)->thread_info - -static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org) -{ - *task_thread_info(p) = *task_thread_info(org); - task_thread_info(p)->task = p; -} - -static inline unsigned long *end_of_stack(struct task_struct *p) -{ - return (unsigned long *)(p->thread_info + 1); -} - -#endif - /* set thread flags in other task's structures * - see asm/thread_info.h for TIF_xxxx flags available */ static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag) { - set_ti_thread_flag(task_thread_info(tsk), flag); + set_ti_thread_flag(tsk->thread_info,flag); } static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag) { - clear_ti_thread_flag(task_thread_info(tsk), flag); + clear_ti_thread_flag(tsk->thread_info,flag); } static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) { - return test_and_set_ti_thread_flag(task_thread_info(tsk), flag); + return test_and_set_ti_thread_flag(tsk->thread_info,flag); } static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) { - return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag); + return test_and_clear_ti_thread_flag(tsk->thread_info,flag); } static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) { - return test_ti_thread_flag(task_thread_info(tsk), flag); + return test_ti_thread_flag(tsk->thread_info,flag); } static inline void set_tsk_need_resched(struct task_struct *tsk) @@ -1344,12 +1329,12 @@ extern void signal_wake_up(struct task_struct *t, int resume_stopped); static inline unsigned int task_cpu(const struct task_struct *p) { - return task_thread_info(p)->cpu; + return p->thread_info->cpu; } static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) { - task_thread_info(p)->cpu = cpu; + p->thread_info->cpu = cpu; } #else diff --git a/trunk/include/linux/security.h b/trunk/include/linux/security.h index ef753654daa5..f7e0ae018712 100644 --- a/trunk/include/linux/security.h +++ b/trunk/include/linux/security.h @@ -59,12 +59,6 @@ struct sk_buff; struct sock; struct sockaddr; struct socket; -struct flowi; -struct dst_entry; -struct xfrm_selector; -struct xfrm_policy; -struct xfrm_state; -struct xfrm_user_sec_ctx; extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); extern int cap_netlink_recv(struct sk_buff *skb); @@ -794,52 +788,6 @@ struct swap_info_struct; * which is used to copy security attributes between local stream sockets. * @sk_free_security: * Deallocate security structure. - * @sk_getsid: - * Retrieve the LSM-specific sid for the sock to enable caching of network - * authorizations. - * - * Security hooks for XFRM operations. - * - * @xfrm_policy_alloc_security: - * @xp contains the xfrm_policy being added to Security Policy Database - * used by the XFRM system. - * @sec_ctx contains the security context information being provided by - * the user-level policy update program (e.g., setkey). - * Allocate a security structure to the xp->selector.security field. - * The security field is initialized to NULL when the xfrm_policy is - * allocated. - * Return 0 if operation was successful (memory to allocate, legal context) - * @xfrm_policy_clone_security: - * @old contains an existing xfrm_policy in the SPD. - * @new contains a new xfrm_policy being cloned from old. - * Allocate a security structure to the new->selector.security field - * that contains the information from the old->selector.security field. - * Return 0 if operation was successful (memory to allocate). - * @xfrm_policy_free_security: - * @xp contains the xfrm_policy - * Deallocate xp->selector.security. - * @xfrm_state_alloc_security: - * @x contains the xfrm_state being added to the Security Association - * Database by the XFRM system. - * @sec_ctx contains the security context information being provided by - * the user-level SA generation program (e.g., setkey or racoon). - * Allocate a security structure to the x->sel.security field. The - * security field is initialized to NULL when the xfrm_state is - * allocated. - * Return 0 if operation was successful (memory to allocate, legal context). - * @xfrm_state_free_security: - * @x contains the xfrm_state. - * Deallocate x>sel.security. - * @xfrm_policy_lookup: - * @xp contains the xfrm_policy for which the access control is being - * checked. - * @sk_sid contains the sock security label that is used to authorize - * access to the policy xp. - * @dir contains the direction of the flow (input or output). - * Check permission when a sock selects a xfrm_policy for processing - * XFRMs on a packet. The hook is called when selecting either a - * per-socket policy or a generic xfrm policy. - * Return 0 if permission is granted. * * Security hooks affecting all Key Management operations * @@ -1289,18 +1237,8 @@ struct security_operations { int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); void (*sk_free_security) (struct sock *sk); - unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); #endif /* CONFIG_SECURITY_NETWORK */ -#ifdef CONFIG_SECURITY_NETWORK_XFRM - int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx); - int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); - void (*xfrm_policy_free_security) (struct xfrm_policy *xp); - int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); - void (*xfrm_state_free_security) (struct xfrm_state *x); - int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir); -#endif /* CONFIG_SECURITY_NETWORK_XFRM */ - /* key management security hooks */ #ifdef CONFIG_KEYS int (*key_alloc)(struct key *key); @@ -2741,11 +2679,6 @@ static inline void security_sk_free(struct sock *sk) { return security_ops->sk_free_security(sk); } - -static inline unsigned int security_sk_sid(struct sock *sk, struct flowi *fl, u8 dir) -{ - return security_ops->sk_getsid(sk, fl, dir); -} #else /* CONFIG_SECURITY_NETWORK */ static inline int security_unix_stream_connect(struct socket * sock, struct socket * other, @@ -2862,73 +2795,8 @@ static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) static inline void security_sk_free(struct sock *sk) { } - -static inline unsigned int security_sk_sid(struct sock *sk, struct flowi *fl, u8 dir) -{ - return 0; -} #endif /* CONFIG_SECURITY_NETWORK */ -#ifdef CONFIG_SECURITY_NETWORK_XFRM -static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) -{ - return security_ops->xfrm_policy_alloc_security(xp, sec_ctx); -} - -static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) -{ - return security_ops->xfrm_policy_clone_security(old, new); -} - -static inline void security_xfrm_policy_free(struct xfrm_policy *xp) -{ - security_ops->xfrm_policy_free_security(xp); -} - -static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) -{ - return security_ops->xfrm_state_alloc_security(x, sec_ctx); -} - -static inline void security_xfrm_state_free(struct xfrm_state *x) -{ - security_ops->xfrm_state_free_security(x); -} - -static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) -{ - return security_ops->xfrm_policy_lookup(xp, sk_sid, dir); -} -#else /* CONFIG_SECURITY_NETWORK_XFRM */ -static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) -{ - return 0; -} - -static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) -{ - return 0; -} - -static inline void security_xfrm_policy_free(struct xfrm_policy *xp) -{ -} - -static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) -{ - return 0; -} - -static inline void security_xfrm_state_free(struct xfrm_state *x) -{ -} - -static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) -{ - return 0; -} -#endif /* CONFIG_SECURITY_NETWORK_XFRM */ - #ifdef CONFIG_KEYS #ifdef CONFIG_SECURITY static inline int security_key_alloc(struct key *key) diff --git a/trunk/include/linux/serial_core.h b/trunk/include/linux/serial_core.h index e3710d7e260a..a3ac92b19aca 100644 --- a/trunk/include/linux/serial_core.h +++ b/trunk/include/linux/serial_core.h @@ -121,9 +121,6 @@ #define PORT_IP3106 70 -/* Hilscher netx */ -#define PORT_NETX 71 - #ifdef __KERNEL__ #include diff --git a/trunk/include/linux/skbuff.h b/trunk/include/linux/skbuff.h index 483cfc47ec34..0a8ea8b35816 100644 --- a/trunk/include/linux/skbuff.h +++ b/trunk/include/linux/skbuff.h @@ -32,6 +32,7 @@ #define HAVE_ALLOC_SKB /* For the drivers to know */ #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ +#define SLAB_SKB /* Slabified skbuffs */ #define CHECKSUM_NONE 0 #define CHECKSUM_HW 1 @@ -133,7 +134,7 @@ struct skb_frag_struct { */ struct skb_shared_info { atomic_t dataref; - unsigned short nr_frags; + unsigned int nr_frags; unsigned short tso_size; unsigned short tso_segs; unsigned short ufo_size; @@ -205,7 +206,6 @@ enum { * @nfct: Associated connection, if any * @ipvs_property: skbuff is owned by ipvs * @nfctinfo: Relationship of this skb to the connection - * @nfct_reasm: netfilter conntrack re-assembly pointer * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c * @tc_index: Traffic control index * @tc_verd: traffic control verdict @@ -264,14 +264,16 @@ struct sk_buff { nohdr:1, nfctinfo:3; __u8 pkt_type:3, - fclone:2, - ipvs_property:1; + fclone:2; __be16 protocol; void (*destructor)(struct sk_buff *skb); #ifdef CONFIG_NETFILTER __u32 nfmark; struct nf_conntrack *nfct; +#if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) + __u8 ipvs_property:1; +#endif #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) struct sk_buff *nfct_reasm; #endif @@ -1238,8 +1240,6 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen, struct iovec *iov); extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); -extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb, - unsigned int flags); extern unsigned int skb_checksum(const struct sk_buff *skb, int offset, int len, unsigned int csum); extern int skb_copy_bits(const struct sk_buff *skb, int offset, diff --git a/trunk/include/linux/smp_lock.h b/trunk/include/linux/smp_lock.h index fa1ff3b165fe..b63ce7014093 100644 --- a/trunk/include/linux/smp_lock.h +++ b/trunk/include/linux/smp_lock.h @@ -2,10 +2,11 @@ #define __LINUX_SMPLOCK_H #include -#ifdef CONFIG_LOCK_KERNEL #include #include +#ifdef CONFIG_LOCK_KERNEL + #define kernel_locked() (current->lock_depth >= 0) extern int __lockfunc __reacquire_kernel_lock(void); diff --git a/trunk/include/linux/socket.h b/trunk/include/linux/socket.h index 9f4019156fd8..1739c2d5b95b 100644 --- a/trunk/include/linux/socket.h +++ b/trunk/include/linux/socket.h @@ -27,6 +27,7 @@ struct __kernel_sockaddr_storage { #include /* __user */ extern int sysctl_somaxconn; +extern void sock_init(void); #ifdef CONFIG_PROC_FS struct seq_file; extern void socket_seq_show(struct seq_file *seq); diff --git a/trunk/include/linux/swap.h b/trunk/include/linux/swap.h index 508668f840b6..20c975642cab 100644 --- a/trunk/include/linux/swap.h +++ b/trunk/include/linux/swap.h @@ -239,11 +239,6 @@ static inline void put_swap_token(struct mm_struct *mm) __put_swap_token(mm); } -static inline void disable_swap_token(void) -{ - put_swap_token(swap_token_mm); -} - #else /* CONFIG_SWAP */ #define total_swap_pages 0 @@ -288,7 +283,6 @@ static inline swp_entry_t get_swap_page(void) #define put_swap_token(x) do { } while(0) #define grab_swap_token() do { } while(0) #define has_swap_token(x) 0 -#define disable_swap_token() do { } while(0) #endif /* CONFIG_SWAP */ #endif /* __KERNEL__*/ diff --git a/trunk/include/linux/sysctl.h b/trunk/include/linux/sysctl.h index 93fa765e47d3..64f203c45378 100644 --- a/trunk/include/linux/sysctl.h +++ b/trunk/include/linux/sysctl.h @@ -20,6 +20,7 @@ #include #include +#include #include struct file; @@ -390,7 +391,6 @@ enum NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, NET_TCP_CONG_CONTROL=110, NET_TCP_ABC=111, - NET_IPV4_IPFRAG_MAX_DIST=112, }; enum { @@ -671,9 +671,6 @@ enum { NET_DECNET_DST_GC_INTERVAL = 9, NET_DECNET_CONF = 10, NET_DECNET_NO_FC_MAX_CWND = 11, - NET_DECNET_MEM = 12, - NET_DECNET_RMEM = 13, - NET_DECNET_WMEM = 14, NET_DECNET_DEBUG_LEVEL = 255 }; @@ -862,7 +859,6 @@ enum }; #ifdef __KERNEL__ -#include extern void sysctl_init(void); diff --git a/trunk/include/linux/tcp.h b/trunk/include/linux/tcp.h index f2bb2396853f..0e1da6602e05 100644 --- a/trunk/include/linux/tcp.h +++ b/trunk/include/linux/tcp.h @@ -55,6 +55,22 @@ struct tcphdr { __u16 urg_ptr; }; +#define TCP_ACTION_FIN (1 << 7) + +enum { + TCPF_ESTABLISHED = (1 << 1), + TCPF_SYN_SENT = (1 << 2), + TCPF_SYN_RECV = (1 << 3), + TCPF_FIN_WAIT1 = (1 << 4), + TCPF_FIN_WAIT2 = (1 << 5), + TCPF_TIME_WAIT = (1 << 6), + TCPF_CLOSE = (1 << 7), + TCPF_CLOSE_WAIT = (1 << 8), + TCPF_LAST_ACK = (1 << 9), + TCPF_LISTEN = (1 << 10), + TCPF_CLOSING = (1 << 11) +}; + /* * The union cast uses a gcc extension to avoid aliasing problems * (union is compatible to any of its members) @@ -238,9 +254,10 @@ struct tcp_sock { __u32 snd_wl1; /* Sequence for window update */ __u32 snd_wnd; /* The window we expect to receive */ __u32 max_window; /* Maximal window ever seen from peer */ + __u32 pmtu_cookie; /* Last pmtu seen by socket */ __u32 mss_cache; /* Cached effective mss, not including SACKS */ __u16 xmit_size_goal; /* Goal for segmenting output packets */ - /* XXX Two bytes hole, try to pack */ + __u16 ext_header_len; /* Network protocol overhead (IP/IPv6 options) */ __u32 window_clamp; /* Maximal window to advertise */ __u32 rcv_ssthresh; /* Current window clamp */ @@ -278,6 +295,8 @@ struct tcp_sock { struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ + struct tcp_func *af_specific; /* Operations which are AF_INET{4,6} specific */ + __u32 rcv_wnd; /* Current receiver window */ __u32 rcv_wup; /* rcv_nxt on last window update sent */ __u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ diff --git a/trunk/include/linux/thread_info.h b/trunk/include/linux/thread_info.h index 1c4eb41dbd89..d252f45a0f9b 100644 --- a/trunk/include/linux/thread_info.h +++ b/trunk/include/linux/thread_info.h @@ -27,6 +27,31 @@ extern long do_no_restart_syscall(struct restart_block *parm); * - pass TIF_xxxx constants to these functions */ +static inline void set_thread_flag(int flag) +{ + set_bit(flag,¤t_thread_info()->flags); +} + +static inline void clear_thread_flag(int flag) +{ + clear_bit(flag,¤t_thread_info()->flags); +} + +static inline int test_and_set_thread_flag(int flag) +{ + return test_and_set_bit(flag,¤t_thread_info()->flags); +} + +static inline int test_and_clear_thread_flag(int flag) +{ + return test_and_clear_bit(flag,¤t_thread_info()->flags); +} + +static inline int test_thread_flag(int flag) +{ + return test_bit(flag,¤t_thread_info()->flags); +} + static inline void set_ti_thread_flag(struct thread_info *ti, int flag) { set_bit(flag,&ti->flags); @@ -52,19 +77,15 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) return test_bit(flag,&ti->flags); } -#define set_thread_flag(flag) \ - set_ti_thread_flag(current_thread_info(), flag) -#define clear_thread_flag(flag) \ - clear_ti_thread_flag(current_thread_info(), flag) -#define test_and_set_thread_flag(flag) \ - test_and_set_ti_thread_flag(current_thread_info(), flag) -#define test_and_clear_thread_flag(flag) \ - test_and_clear_ti_thread_flag(current_thread_info(), flag) -#define test_thread_flag(flag) \ - test_ti_thread_flag(current_thread_info(), flag) - -#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) -#define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED) +static inline void set_need_resched(void) +{ + set_thread_flag(TIF_NEED_RESCHED); +} + +static inline void clear_need_resched(void) +{ + clear_thread_flag(TIF_NEED_RESCHED); +} #endif diff --git a/trunk/include/linux/time.h b/trunk/include/linux/time.h index 797ccd813bb0..8e83f4e778bb 100644 --- a/trunk/include/linux/time.h +++ b/trunk/include/linux/time.h @@ -95,14 +95,13 @@ struct itimerval; extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); extern int do_getitimer(int which, struct itimerval *value); extern void getnstimeofday (struct timespec *tv); -extern void getnstimestamp(struct timespec *ts); extern struct timespec timespec_trunc(struct timespec t, unsigned gran); static inline void set_normalized_timespec (struct timespec *ts, time_t sec, long nsec) { - while (nsec >= NSEC_PER_SEC) { + while (nsec > NSEC_PER_SEC) { nsec -= NSEC_PER_SEC; ++sec; } diff --git a/trunk/include/linux/udp.h b/trunk/include/linux/udp.h index 85a55658831c..b60e0b4a25c4 100644 --- a/trunk/include/linux/udp.h +++ b/trunk/include/linux/udp.h @@ -35,10 +35,10 @@ struct udphdr { #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ #ifdef __KERNEL__ -#include -#include -#include +#include +#include +#include struct udp_sock { /* inet_sock has to be the first member */ diff --git a/trunk/include/linux/uinput.h b/trunk/include/linux/uinput.h index 0ff7ca68e5c5..84876077027f 100644 --- a/trunk/include/linux/uinput.h +++ b/trunk/include/linux/uinput.h @@ -34,7 +34,8 @@ #define UINPUT_BUFFER_SIZE 16 #define UINPUT_NUM_REQUESTS 16 -enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED }; +/* state flags => bit index for {set|clear|test}_bit ops */ +#define UIST_CREATED 0 struct uinput_request { int id; @@ -51,12 +52,11 @@ struct uinput_request { struct uinput_device { struct input_dev *dev; - struct semaphore sem; - enum uinput_state state; + unsigned long state; wait_queue_head_t waitq; - unsigned char ready; - unsigned char head; - unsigned char tail; + unsigned char ready, + head, + tail; struct input_event buff[UINPUT_BUFFER_SIZE]; struct uinput_request *requests[UINPUT_NUM_REQUESTS]; @@ -91,7 +91,6 @@ struct uinput_ff_erase { #define UI_SET_SNDBIT _IOW(UINPUT_IOCTL_BASE, 106, int) #define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int) #define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*) -#define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int) #define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload) #define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload) diff --git a/trunk/include/linux/usb.h b/trunk/include/linux/usb.h index e59d1bd52d4f..748d04385256 100644 --- a/trunk/include/linux/usb.h +++ b/trunk/include/linux/usb.h @@ -47,7 +47,6 @@ struct usb_driver; * @urb_list: urbs queued to this endpoint; maintained by usbcore * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) * with one or more transfer descriptors (TDs) per urb - * @kobj: kobject for sysfs info * @extra: descriptors following this endpoint in the configuration * @extralen: how many bytes of "extra" are valid * @@ -329,6 +328,8 @@ struct usb_device { struct usb_tt *tt; /* low/full speed dev, highspeed hub */ int ttport; /* device port on that tt hub */ + struct semaphore serialize; + unsigned int toggle[2]; /* one bit for each endpoint * ([0] = IN, [1] = OUT) */ @@ -347,9 +348,6 @@ struct usb_device { char **rawdescriptors; /* Raw descriptors for each config */ - unsigned short bus_mA; /* Current available from the bus */ - u8 portnum; /* Parent port number (origin 1) */ - int have_langid; /* whether string_langid is valid */ int string_langid; /* language ID for strings */ @@ -378,12 +376,11 @@ struct usb_device { extern struct usb_device *usb_get_dev(struct usb_device *dev); extern void usb_put_dev(struct usb_device *dev); -/* USB device locking */ -#define usb_lock_device(udev) down(&(udev)->dev.sem) -#define usb_unlock_device(udev) up(&(udev)->dev.sem) -#define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem) +extern void usb_lock_device(struct usb_device *udev); +extern int usb_trylock_device(struct usb_device *udev); extern int usb_lock_device_for_reset(struct usb_device *udev, struct usb_interface *iface); +extern void usb_unlock_device(struct usb_device *udev); /* USB port reset for device reinitialization */ extern int usb_reset_device(struct usb_device *dev); @@ -531,13 +528,10 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, /* ----------------------------------------------------------------------- */ -struct usb_dynids { - spinlock_t lock; - struct list_head list; -}; - /** * struct usb_driver - identifies USB driver to usbcore + * @owner: Pointer to the module owner of this driver; initialize + * it using THIS_MODULE. * @name: The driver name should be unique among USB drivers, * and should normally be the same as the module name. * @probe: Called to see if the driver is willing to manage a particular @@ -558,11 +552,7 @@ struct usb_dynids { * @id_table: USB drivers use ID table to support hotplugging. * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set * or your driver's probe function will never get called. - * @dynids: used internally to hold the list of dynamically added device - * ids for this driver. * @driver: the driver model core driver structure. - * @no_dynamic_id: if set to 1, the USB core will not allow dynamic ids to be - * added to this driver by preventing the sysfs file from being created. * * USB drivers must provide a name, probe() and disconnect() methods, * and an id_table. Other driver fields are optional. @@ -580,6 +570,8 @@ struct usb_dynids { * them as necessary, and blocking until the unlinks complete). */ struct usb_driver { + struct module *owner; + const char *name; int (*probe) (struct usb_interface *intf, @@ -595,9 +587,7 @@ struct usb_driver { const struct usb_device_id *id_table; - struct usb_dynids dynids; struct device_driver driver; - unsigned int no_dynamic_id:1; }; #define to_usb_driver(d) container_of(d, struct usb_driver, driver) @@ -623,11 +613,7 @@ struct usb_class_driver { * use these in module_init()/module_exit() * and don't forget MODULE_DEVICE_TABLE(usb, ...) */ -int usb_register_driver(struct usb_driver *, struct module *); -static inline int usb_register(struct usb_driver *driver) -{ - return usb_register_driver(driver, THIS_MODULE); -} +extern int usb_register(struct usb_driver *); extern void usb_deregister(struct usb_driver *); extern int usb_register_dev(struct usb_interface *intf, @@ -833,7 +819,7 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *); */ struct urb { - /* private: usb core and host controller only fields in the urb */ + /* private, usb core and host controller only fields in the urb */ struct kref kref; /* reference count of the URB */ spinlock_t lock; /* lock for the URB */ void *hcpriv; /* private data for host controller */ @@ -841,7 +827,7 @@ struct urb atomic_t use_count; /* concurrent submissions counter */ u8 reject; /* submissions will fail */ - /* public: documented fields in the urb that can be used by drivers */ + /* public, documented fields in the urb that can be used by drivers */ struct list_head urb_list; /* list head for use by the urb's * current owner */ struct usb_device *dev; /* (in) pointer to associated device */ @@ -1059,7 +1045,7 @@ struct usb_sg_request { size_t bytes; /* - * members below are private: to usbcore, + * members below are private to usbcore, * and are not provided for driver access! */ spinlock_t lock; diff --git a/trunk/include/linux/usb_usual.h b/trunk/include/linux/usb_usual.h deleted file mode 100644 index b2d08984a9f7..000000000000 --- a/trunk/include/linux/usb_usual.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Interface to the libusual. - * - * Copyright (c) 2005 Pete Zaitcev - * Copyright (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net) - * Copyright (c) 1999 Michael Gee (michael@linuxspecific.com) - */ - -#ifndef __LINUX_USB_USUAL_H -#define __LINUX_USB_USUAL_H - -#include - -/* We should do this for cleanliness... But other usb_foo.h do not do this. */ -/* #include */ - -/* - * The flags field, which we store in usb_device_id.driver_info. - * It is compatible with the old usb-storage flags in lower 24 bits. - */ - -/* - * Static flag definitions. We use this roundabout technique so that the - * proc_info() routine can automatically display a message for each flag. - */ -#define US_DO_ALL_FLAGS \ - US_FLAG(SINGLE_LUN, 0x00000001) \ - /* allow access to only LUN 0 */ \ - US_FLAG(NEED_OVERRIDE, 0x00000002) \ - /* unusual_devs entry is necessary */ \ - US_FLAG(SCM_MULT_TARG, 0x00000004) \ - /* supports multiple targets */ \ - US_FLAG(FIX_INQUIRY, 0x00000008) \ - /* INQUIRY response needs faking */ \ - US_FLAG(FIX_CAPACITY, 0x00000010) \ - /* READ CAPACITY response too big */ \ - US_FLAG(IGNORE_RESIDUE, 0x00000020) \ - /* reported residue is wrong */ \ - US_FLAG(BULK32, 0x00000040) \ - /* Uses 32-byte CBW length */ \ - US_FLAG(NOT_LOCKABLE, 0x00000080) \ - /* PREVENT/ALLOW not supported */ \ - US_FLAG(GO_SLOW, 0x00000100) \ - /* Need delay after Command phase */ \ - US_FLAG(NO_WP_DETECT, 0x00000200) \ - /* Don't check for write-protect */ \ - -#define US_FLAG(name, value) US_FL_##name = value , -enum { US_DO_ALL_FLAGS }; -#undef US_FLAG - -/* - * The bias field for libusual and friends. - */ -#define USB_US_TYPE_NONE 0 -#define USB_US_TYPE_STOR 1 /* usb-storage */ -#define USB_US_TYPE_UB 2 /* ub */ - -#define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF) -#define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF) - -/* - * This is probably not the best place to keep these constants, conceptually. - * But it's the only header included into all places which need them. - */ - -/* Sub Classes */ - -#define US_SC_RBC 0x01 /* Typically, flash devices */ -#define US_SC_8020 0x02 /* CD-ROM */ -#define US_SC_QIC 0x03 /* QIC-157 Tapes */ -#define US_SC_UFI 0x04 /* Floppy */ -#define US_SC_8070 0x05 /* Removable media */ -#define US_SC_SCSI 0x06 /* Transparent */ -#define US_SC_ISD200 0x07 /* ISD200 ATA */ -#define US_SC_MIN US_SC_RBC -#define US_SC_MAX US_SC_ISD200 - -#define US_SC_DEVICE 0xff /* Use device's value */ - -/* Protocols */ - -#define US_PR_CBI 0x00 /* Control/Bulk/Interrupt */ -#define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */ -#define US_PR_BULK 0x50 /* bulk only */ -#ifdef CONFIG_USB_STORAGE_USBAT -#define US_PR_USBAT 0x80 /* SCM-ATAPI bridge */ -#endif -#ifdef CONFIG_USB_STORAGE_SDDR09 -#define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */ -#endif -#ifdef CONFIG_USB_STORAGE_SDDR55 -#define US_PR_SDDR55 0x82 /* SDDR-55 (made up) */ -#endif -#define US_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */ -#ifdef CONFIG_USB_STORAGE_FREECOM -#define US_PR_FREECOM 0xf1 /* Freecom */ -#endif -#ifdef CONFIG_USB_STORAGE_DATAFAB -#define US_PR_DATAFAB 0xf2 /* Datafab chipsets */ -#endif -#ifdef CONFIG_USB_STORAGE_JUMPSHOT -#define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */ -#endif -#ifdef CONFIG_USB_STORAGE_ALAUDA -#define US_PR_ALAUDA 0xf4 /* Alauda chipsets */ -#endif - -#define US_PR_DEVICE 0xff /* Use device's value */ - -/* - */ -#ifdef CONFIG_USB_LIBUSUAL - -extern struct usb_device_id storage_usb_ids[]; -extern void usb_usual_set_present(int type); -extern void usb_usual_clear_present(int type); -extern int usb_usual_check_type(const struct usb_device_id *, int type); -#else - -#define usb_usual_set_present(t) do { } while(0) -#define usb_usual_clear_present(t) do { } while(0) -#define usb_usual_check_type(id, t) (0) -#endif /* CONFIG_USB_LIBUSUAL */ - -#endif /* __LINUX_USB_USUAL_H */ diff --git a/trunk/include/linux/videodev2.h b/trunk/include/linux/videodev2.h index 1cded681eb6d..a114fff6568b 100644 --- a/trunk/include/linux/videodev2.h +++ b/trunk/include/linux/videodev2.h @@ -636,7 +636,6 @@ typedef __u64 v4l2_std_id; #define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000) #define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000) #define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000) -#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000) /* ATSC/HDTV */ #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) diff --git a/trunk/include/linux/xfrm.h b/trunk/include/linux/xfrm.h index 82fbb758e28f..0fb077d68441 100644 --- a/trunk/include/linux/xfrm.h +++ b/trunk/include/linux/xfrm.h @@ -27,22 +27,6 @@ struct xfrm_id __u8 proto; }; -struct xfrm_sec_ctx { - __u8 ctx_doi; - __u8 ctx_alg; - __u16 ctx_len; - __u32 ctx_sid; - char ctx_str[0]; -}; - -/* Security Context Domains of Interpretation */ -#define XFRM_SC_DOI_RESERVED 0 -#define XFRM_SC_DOI_LSM 1 - -/* Security Context Algorithms */ -#define XFRM_SC_ALG_RESERVED 0 -#define XFRM_SC_ALG_SELINUX 1 - /* Selector, used as selector both on policy rules (SPD) and SAs. */ struct xfrm_selector @@ -162,18 +146,6 @@ enum { #define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE) -/* - * Generic LSM security context for comunicating to user space - * NOTE: Same format as sadb_x_sec_ctx - */ -struct xfrm_user_sec_ctx { - __u16 len; - __u16 exttype; - __u8 ctx_alg; /* LSMs: e.g., selinux == 1 */ - __u8 ctx_doi; - __u16 ctx_len; -}; - struct xfrm_user_tmpl { struct xfrm_id id; __u16 family; @@ -204,7 +176,6 @@ enum xfrm_attr_type_t { XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ XFRMA_SA, XFRMA_POLICY, - XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ __XFRMA_MAX #define XFRMA_MAX (__XFRMA_MAX - 1) diff --git a/trunk/include/media/ir-common.h b/trunk/include/media/ir-common.h index ad3e9bb670c3..0f1ba95ec8d6 100644 --- a/trunk/include/media/ir-common.h +++ b/trunk/include/media/ir-common.h @@ -49,7 +49,6 @@ struct ir_input_state { extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE]; -extern IR_KEYTAB_TYPE ir_codes_pinnacle[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE]; diff --git a/trunk/include/media/ir-kbd-i2c.h b/trunk/include/media/ir-kbd-i2c.h index 730f21ed91db..00fa57eb9fde 100644 --- a/trunk/include/media/ir-kbd-i2c.h +++ b/trunk/include/media/ir-kbd-i2c.h @@ -19,6 +19,4 @@ struct IR_i2c { char phys[32]; int (*get_key)(struct IR_i2c*, u32*, u32*); }; - -int get_key_pinnacle(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw); #endif diff --git a/trunk/include/media/saa7146.h b/trunk/include/media/saa7146.h index e5be2b9b846b..2a897c3a6a9a 100644 --- a/trunk/include/media/saa7146.h +++ b/trunk/include/media/saa7146.h @@ -14,7 +14,7 @@ #include /* for vmalloc() */ #include /* for vmalloc_to_page() */ -#define SAA7146_VERSION_CODE 0x000500 /* 0.5.0 */ +#define SAA7146_VERSION_CODE 0x000500 /* 0.5.0 */ #define saa7146_write(sxy,adr,dat) writel((dat),(sxy->mem+(adr))) #define saa7146_read(sxy,adr) readl(sxy->mem+(adr)) @@ -112,7 +112,7 @@ struct saa7146_dev /* different device locks */ spinlock_t slock; - struct semaphore lock; + struct semaphore lock; unsigned char __iomem *mem; /* pointer to mapped IO memory */ int revision; /* chip revision; needed for bug-workarounds*/ @@ -133,7 +133,7 @@ struct saa7146_dev void (*vv_callback)(struct saa7146_dev *dev, unsigned long status); /* i2c-stuff */ - struct semaphore i2c_lock; + struct semaphore i2c_lock; u32 i2c_bitrate; struct saa7146_dma d_i2c; /* pointer to i2c memory */ wait_queue_head_t i2c_wq; diff --git a/trunk/include/media/saa7146_vv.h b/trunk/include/media/saa7146_vv.h index 16af9299315f..64691753721e 100644 --- a/trunk/include/media/saa7146_vv.h +++ b/trunk/include/media/saa7146_vv.h @@ -113,7 +113,7 @@ struct saa7146_vv /* vbi capture */ struct saa7146_dmaqueue vbi_q; /* vbi workaround interrupt queue */ - wait_queue_head_t vbi_wq; + wait_queue_head_t vbi_wq; int vbi_fieldcount; struct saa7146_fh *vbi_streaming; @@ -181,10 +181,10 @@ struct saa7146_ext_vv }; struct saa7146_use_ops { - void (*init)(struct saa7146_dev *, struct saa7146_vv *); - int(*open)(struct saa7146_dev *, struct file *); - void (*release)(struct saa7146_dev *, struct file *); - void (*irq_done)(struct saa7146_dev *, unsigned long status); + void (*init)(struct saa7146_dev *, struct saa7146_vv *); + int(*open)(struct saa7146_dev *, struct file *); + void (*release)(struct saa7146_dev *, struct file *); + void (*irq_done)(struct saa7146_dev *, unsigned long status); ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); }; diff --git a/trunk/include/media/tuner.h b/trunk/include/media/tuner.h index faa0f8e3091b..9184e534b7ef 100644 --- a/trunk/include/media/tuner.h +++ b/trunk/include/media/tuner.h @@ -113,7 +113,6 @@ #define TUNER_PHILIPS_TD1316 67 #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ -#define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ #define NOTUNER 0 #define PAL 1 /* PAL_BG */ diff --git a/trunk/include/media/tveeprom.h b/trunk/include/media/tveeprom.h index e9fc1a785497..e2035c7da094 100644 --- a/trunk/include/media/tveeprom.h +++ b/trunk/include/media/tveeprom.h @@ -4,15 +4,12 @@ struct tveeprom { u32 has_radio; u32 has_ir; /* 0: no IR, 1: IR present, 2: unknown */ - u32 has_MAC_address; /* 0: no MAC, 1: MAC present, 2: unknown */ u32 tuner_type; u32 tuner_formats; - u32 tuner_hauppauge_model; u32 tuner2_type; u32 tuner2_formats; - u32 tuner2_hauppauge_model; u32 digitizer; u32 digitizer_formats; @@ -24,7 +21,6 @@ struct tveeprom { u32 revision; u32 serial_number; char rev_str[5]; - u8 MAC_address[6]; }; void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, diff --git a/trunk/include/media/v4l2-common.h b/trunk/include/media/v4l2-common.h deleted file mode 100644 index d3fd48157eb8..000000000000 --- a/trunk/include/media/v4l2-common.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - v4l2 common internal API header - - This header contains internal shared ioctl definitions for use by the - internal low-level v4l2 drivers. - Each ioctl begins with VIDIOC_INT_ to clearly mark that it is an internal - define, - - Copyright (C) 2005 Hans Verkuil - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef V4L2_COMMON_H_ -#define V4L2_COMMON_H_ - -/* VIDIOC_INT_AUDIO_CLOCK_FREQ */ -enum v4l2_audio_clock_freq { - V4L2_AUDCLK_32_KHZ = 32000, - V4L2_AUDCLK_441_KHZ = 44100, - V4L2_AUDCLK_48_KHZ = 48000, -}; - -/* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */ -struct v4l2_register { - u32 i2c_id; /* I2C driver ID of the I2C chip. 0 for the I2C adapter. */ - unsigned long reg; - u32 val; -}; - -/* VIDIOC_INT_DECODE_VBI_LINE */ -struct v4l2_decode_vbi_line { - u32 is_second_field; /* Set to 0 for the first (odd) field, - set to 1 for the second (even) field. */ - u8 *p; /* Pointer to the sliced VBI data from the decoder. - On exit points to the start of the payload. */ - u32 line; /* Line number of the sliced VBI data (1-23) */ - u32 type; /* VBI service type (V4L2_SLICED_*). 0 if no service found */ -}; - -/* VIDIOC_INT_G_CHIP_IDENT: identifies the actual chip installed on the board */ -enum v4l2_chip_ident { - /* general idents: reserved range 0-49 */ - V4L2_IDENT_UNKNOWN = 0, - - /* module saa7115: reserved range 100-149 */ - V4L2_IDENT_SAA7114 = 104, - V4L2_IDENT_SAA7115 = 105, - - /* module saa7127: reserved range 150-199 */ - V4L2_IDENT_SAA7127 = 157, - V4L2_IDENT_SAA7129 = 159, - - /* module cx25840: reserved range 200-249 */ - V4L2_IDENT_CX25840 = 240, - V4L2_IDENT_CX25841 = 241, - V4L2_IDENT_CX25842 = 242, - V4L2_IDENT_CX25843 = 243, -}; - -/* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ -#define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register) -#define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) - -/* Reset the I2C chip */ -#define VIDIOC_INT_RESET _IO ('d', 102) - -/* Set the frequency of the audio clock output. - Used to slave an audio processor to the video decoder, ensuring that audio - and video remain synchronized. */ -#define VIDIOC_INT_AUDIO_CLOCK_FREQ _IOR ('d', 103, enum v4l2_audio_clock_freq) - -/* Video decoders that support sliced VBI need to implement this ioctl. - Field p of the v4l2_sliced_vbi_line struct is set to the start of the VBI - data that was generated by the decoder. The driver then parses the sliced - VBI data and sets the other fields in the struct accordingly. The pointer p - is updated to point to the start of the payload which can be copied - verbatim into the data field of the v4l2_sliced_vbi_data struct. If no - valid VBI data was found, then the type field is set to 0 on return. */ -#define VIDIOC_INT_DECODE_VBI_LINE _IOWR('d', 104, struct v4l2_decode_vbi_line) - -/* Used to generate VBI signals on a video signal. v4l2_sliced_vbi_data is - filled with the data packets that should be output. Note that if you set - the line field to 0, then that VBI signal is disabled. */ -#define VIDIOC_INT_S_VBI_DATA _IOW ('d', 105, struct v4l2_sliced_vbi_data) - -/* Used to obtain the sliced VBI packet from a readback register. Not all - video decoders support this. If no data is available because the readback - register contains invalid or erroneous data -EIO is returned. Note that - you must fill in the 'id' member and the 'field' member (to determine - whether CC data from the first or second field should be obtained). */ -#define VIDIOC_INT_G_VBI_DATA _IOWR('d', 106, struct v4l2_sliced_vbi_data *) - -/* Returns the chip identifier or V4L2_IDENT_UNKNOWN if no identification can - be made. */ -#define VIDIOC_INT_G_CHIP_IDENT _IOR ('d', 107, enum v4l2_chip_ident *) - -#endif /* V4L2_COMMON_H_ */ diff --git a/trunk/include/net/af_unix.h b/trunk/include/net/af_unix.h index bfc1779fc753..b5d785ab4a0e 100644 --- a/trunk/include/net/af_unix.h +++ b/trunk/include/net/af_unix.h @@ -13,7 +13,7 @@ extern void unix_gc(void); #define UNIX_HASH_SIZE 256 extern struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1]; -extern spinlock_t unix_table_lock; +extern rwlock_t unix_table_lock; extern atomic_t unix_tot_inflight; @@ -58,10 +58,10 @@ struct unix_skb_parms { #define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb)) #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) -#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) -#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) -#define unix_state_wlock(s) spin_lock(&unix_sk(s)->lock) -#define unix_state_wunlock(s) spin_unlock(&unix_sk(s)->lock) +#define unix_state_rlock(s) read_lock(&unix_sk(s)->lock) +#define unix_state_runlock(s) read_unlock(&unix_sk(s)->lock) +#define unix_state_wlock(s) write_lock(&unix_sk(s)->lock) +#define unix_state_wunlock(s) write_unlock(&unix_sk(s)->lock) #ifdef __KERNEL__ /* The AF_UNIX socket */ @@ -76,7 +76,7 @@ struct unix_sock { struct sock *other; struct sock *gc_tree; atomic_t inflight; - spinlock_t lock; + rwlock_t lock; wait_queue_head_t peer_wait; }; #define unix_sk(__sk) ((struct unix_sock *)__sk) diff --git a/trunk/include/net/atmclip.h b/trunk/include/net/atmclip.h index 90fcc98e676f..47048b1d179a 100644 --- a/trunk/include/net/atmclip.h +++ b/trunk/include/net/atmclip.h @@ -7,6 +7,7 @@ #define _ATMCLIP_H #include +#include #include #include #include @@ -17,7 +18,6 @@ #define CLIP_VCC(vcc) ((struct clip_vcc *) ((vcc)->user_back)) #define NEIGH2ENTRY(neigh) ((struct atmarp_entry *) (neigh)->primary_key) -struct sk_buff; struct clip_vcc { struct atm_vcc *vcc; /* VCC descriptor */ diff --git a/trunk/include/net/dn.h b/trunk/include/net/dn.h index a4b6168e1e25..c1dbbd222793 100644 --- a/trunk/include/net/dn.h +++ b/trunk/include/net/dn.h @@ -234,8 +234,4 @@ extern int decnet_di_count; extern int decnet_dr_count; extern int decnet_no_fc_max_cwnd; -extern int sysctl_decnet_mem[3]; -extern int sysctl_decnet_wmem[3]; -extern int sysctl_decnet_rmem[3]; - #endif /* _NET_DN_H */ diff --git a/trunk/include/net/dst.h b/trunk/include/net/dst.h index bee8b84d329d..6c196a5baf24 100644 --- a/trunk/include/net/dst.h +++ b/trunk/include/net/dst.h @@ -9,7 +9,6 @@ #define _NET_DST_H #include -#include #include #include #include diff --git a/trunk/include/net/flow.h b/trunk/include/net/flow.h index ec7eb86eb203..9a5c94b1a0ec 100644 --- a/trunk/include/net/flow.h +++ b/trunk/include/net/flow.h @@ -84,12 +84,11 @@ struct flowi { #define FLOW_DIR_OUT 1 #define FLOW_DIR_FWD 2 -struct sock; -typedef void (*flow_resolve_t)(struct flowi *key, u32 sk_sid, u16 family, u8 dir, +typedef void (*flow_resolve_t)(struct flowi *key, u16 family, u8 dir, void **objp, atomic_t **obj_refp); -extern void *flow_cache_lookup(struct flowi *key, u32 sk_sid, u16 family, u8 dir, - flow_resolve_t resolver); +extern void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir, + flow_resolve_t resolver); extern void flow_cache_flush(void); extern atomic_t flow_cache_genid; diff --git a/trunk/include/net/genetlink.h b/trunk/include/net/genetlink.h index c5b96b2b8155..52d8b1a73d52 100644 --- a/trunk/include/net/genetlink.h +++ b/trunk/include/net/genetlink.h @@ -60,7 +60,7 @@ struct genl_info */ struct genl_ops { - u8 cmd; + unsigned int cmd; unsigned int flags; struct nla_policy *policy; int (*doit)(struct sk_buff *skb, diff --git a/trunk/include/net/icmp.h b/trunk/include/net/icmp.h index e7c3f20fbafc..6cdebeee5f96 100644 --- a/trunk/include/net/icmp.h +++ b/trunk/include/net/icmp.h @@ -20,9 +20,12 @@ #include #include +#include -#include +#include +#include #include +#include struct icmp_err { int errno; @@ -35,10 +38,6 @@ DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics); #define ICMP_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmp_statistics, field) #define ICMP_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmp_statistics, field) -struct dst_entry; -struct net_proto_family; -struct sk_buff; - extern void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info); extern int icmp_rcv(struct sk_buff *skb); extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); diff --git a/trunk/include/net/ieee80211.h b/trunk/include/net/ieee80211.h index cde2f4f4f501..b93fd8c1d884 100644 --- a/trunk/include/net/ieee80211.h +++ b/trunk/include/net/ieee80211.h @@ -1042,7 +1042,7 @@ static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) case IEEE80211_4ADDR_LEN: return ((struct ieee80211_hdr_4addr *)hdr)->payload; } - return NULL; + } static inline int ieee80211_is_ofdm_rate(u8 rate) diff --git a/trunk/include/net/ieee80211_crypt.h b/trunk/include/net/ieee80211_crypt.h index 03b766afdc39..225fc751d464 100644 --- a/trunk/include/net/ieee80211_crypt.h +++ b/trunk/include/net/ieee80211_crypt.h @@ -23,17 +23,12 @@ #ifndef IEEE80211_CRYPT_H #define IEEE80211_CRYPT_H -#include -#include -#include +#include enum { IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0), }; -struct sk_buff; -struct module; - struct ieee80211_crypto_ops { const char *name; struct list_head list; @@ -92,8 +87,6 @@ struct ieee80211_crypt_data { atomic_t refcnt; }; -struct ieee80211_device; - int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name); diff --git a/trunk/include/net/if_inet6.h b/trunk/include/net/if_inet6.h index eb8afe3499a9..e97a9accb71d 100644 --- a/trunk/include/net/if_inet6.h +++ b/trunk/include/net/if_inet6.h @@ -24,7 +24,6 @@ #define IF_RA_MANAGED 0x40 #define IF_RA_RCVD 0x20 #define IF_RS_SENT 0x10 -#define IF_READY 0x80000000 /* prefix flags */ #define IF_PREFIX_ONLINK 0x01 @@ -83,7 +82,6 @@ struct ipv6_mc_socklist struct in6_addr addr; int ifindex; struct ipv6_mc_socklist *next; - rwlock_t sflock; unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ struct ip6_sf_socklist *sflist; }; diff --git a/trunk/include/net/inet6_connection_sock.h b/trunk/include/net/inet6_connection_sock.h deleted file mode 100644 index b33b438bffcc..000000000000 --- a/trunk/include/net/inet6_connection_sock.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * NET Generic infrastructure for INET6 connection oriented protocols. - * - * Authors: Many people, see the TCPv6 sources - * - * From code originally in TCPv6 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _INET6_CONNECTION_SOCK_H -#define _INET6_CONNECTION_SOCK_H - -#include - -struct in6_addr; -struct inet_bind_bucket; -struct request_sock; -struct sk_buff; -struct sock; -struct sockaddr; - -extern int inet6_csk_bind_conflict(const struct sock *sk, - const struct inet_bind_bucket *tb); - -extern struct request_sock *inet6_csk_search_req(const struct sock *sk, - struct request_sock ***prevp, - const __u16 rport, - const struct in6_addr *raddr, - const struct in6_addr *laddr, - const int iif); - -extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk, - struct request_sock *req, - const unsigned long timeout); - -extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); - -extern int inet6_csk_xmit(struct sk_buff *skb, int ipfragok); -#endif /* _INET6_CONNECTION_SOCK_H */ diff --git a/trunk/include/net/inet6_hashtables.h b/trunk/include/net/inet6_hashtables.h index 25f708ff020e..5a2beed5a770 100644 --- a/trunk/include/net/inet6_hashtables.h +++ b/trunk/include/net/inet6_hashtables.h @@ -48,32 +48,6 @@ static inline int inet6_sk_ehashfn(const struct sock *sk) return inet6_ehashfn(laddr, lport, faddr, fport); } -static inline void __inet6_hash(struct inet_hashinfo *hashinfo, - struct sock *sk) -{ - struct hlist_head *list; - rwlock_t *lock; - - BUG_TRAP(sk_unhashed(sk)); - - if (sk->sk_state == TCP_LISTEN) { - list = &hashinfo->listening_hash[inet_sk_listen_hashfn(sk)]; - lock = &hashinfo->lhash_lock; - inet_listen_wlock(hashinfo); - } else { - unsigned int hash; - sk->sk_hash = hash = inet6_sk_ehashfn(sk); - hash &= (hashinfo->ehash_size - 1); - list = &hashinfo->ehash[hash].chain; - lock = &hashinfo->ehash[hash].lock; - write_lock(lock); - } - - __sk_add_node(sk, list); - sock_prot_inc_use(sk->sk_prot); - write_unlock(lock); -} - /* * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so * we need not check it for TCP lookups anymore, thanks Alexey. -DaveM @@ -110,10 +84,10 @@ static inline struct sock * if(*((__u32 *)&(tw->tw_dport)) == ports && sk->sk_family == PF_INET6) { - const struct inet6_timewait_sock *tw6 = inet6_twsk(sk); + const struct tcp6_timewait_sock *tcp6tw = tcp6_twsk(sk); - if (ipv6_addr_equal(&tw6->tw_v6_daddr, saddr) && - ipv6_addr_equal(&tw6->tw_v6_rcv_saddr, daddr) && + if (ipv6_addr_equal(&tcp6tw->tw_v6_daddr, saddr) && + ipv6_addr_equal(&tcp6tw->tw_v6_rcv_saddr, daddr) && (!sk->sk_bound_dev_if || sk->sk_bound_dev_if == dif)) goto hit; } diff --git a/trunk/include/net/inet_common.h b/trunk/include/net/inet_common.h index 227adcbdfec8..f943306ce5ff 100644 --- a/trunk/include/net/inet_common.h +++ b/trunk/include/net/inet_common.h @@ -1,8 +1,8 @@ #ifndef _INET_COMMON_H #define _INET_COMMON_H -extern const struct proto_ops inet_stream_ops; -extern const struct proto_ops inet_dgram_ops; +extern struct proto_ops inet_stream_ops; +extern struct proto_ops inet_dgram_ops; /* * INET4 prototypes used by INET6 diff --git a/trunk/include/net/inet_connection_sock.h b/trunk/include/net/inet_connection_sock.h index 50234fa56a68..b0c99060b78d 100644 --- a/trunk/include/net/inet_connection_sock.h +++ b/trunk/include/net/inet_connection_sock.h @@ -15,11 +15,9 @@ #ifndef _INET_CONNECTION_SOCK_H #define _INET_CONNECTION_SOCK_H -#include +#include #include #include - -#include #include #define INET_CSK_DEBUG 1 @@ -31,29 +29,6 @@ struct inet_bind_bucket; struct inet_hashinfo; struct tcp_congestion_ops; -/* - * Pointers to address related TCP functions - * (i.e. things that depend on the address family) - */ -struct inet_connection_sock_af_ops { - int (*queue_xmit)(struct sk_buff *skb, int ipfragok); - void (*send_check)(struct sock *sk, int len, - struct sk_buff *skb); - int (*rebuild_header)(struct sock *sk); - int (*conn_request)(struct sock *sk, struct sk_buff *skb); - struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, - struct request_sock *req, - struct dst_entry *dst); - int (*remember_stamp)(struct sock *sk); - __u16 net_header_len; - int (*setsockopt)(struct sock *sk, int level, int optname, - char __user *optval, int optlen); - int (*getsockopt)(struct sock *sk, int level, int optname, - char __user *optval, int __user *optlen); - void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); - int sockaddr_len; -}; - /** inet_connection_sock - INET connection oriented sock * * @icsk_accept_queue: FIFO of established children @@ -61,16 +36,13 @@ struct inet_connection_sock_af_ops { * @icsk_timeout: Timeout * @icsk_retransmit_timer: Resend (no ack) * @icsk_rto: Retransmit timeout - * @icsk_pmtu_cookie Last pmtu seen by socket * @icsk_ca_ops Pluggable congestion control hook - * @icsk_af_ops Operations which are AF_INET{4,6} specific * @icsk_ca_state: Congestion control state * @icsk_retransmits: Number of unrecovered [RTO] timeouts * @icsk_pending: Scheduled timer event * @icsk_backoff: Backoff * @icsk_syn_retries: Number of allowed SYN (or equivalent) retries * @icsk_probes_out: unanswered 0 window probes - * @icsk_ext_hdr_len: Network protocol overhead (IP/IPv6 options) * @icsk_ack: Delayed ACK control data */ struct inet_connection_sock { @@ -82,17 +54,14 @@ struct inet_connection_sock { struct timer_list icsk_retransmit_timer; struct timer_list icsk_delack_timer; __u32 icsk_rto; - __u32 icsk_pmtu_cookie; struct tcp_congestion_ops *icsk_ca_ops; - struct inet_connection_sock_af_ops *icsk_af_ops; - unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu); __u8 icsk_ca_state; __u8 icsk_retransmits; __u8 icsk_pending; __u8 icsk_backoff; __u8 icsk_syn_retries; __u8 icsk_probes_out; - __u16 icsk_ext_hdr_len; + /* 2 BYTES HOLE, TRY TO PACK! */ struct { __u8 pending; /* ACK is pending */ __u8 quick; /* Scheduled number of quick acks */ @@ -223,12 +192,8 @@ extern struct request_sock *inet_csk_search_req(const struct sock *sk, const __u16 rport, const __u32 raddr, const __u32 laddr); -extern int inet_csk_bind_conflict(const struct sock *sk, - const struct inet_bind_bucket *tb); extern int inet_csk_get_port(struct inet_hashinfo *hashinfo, - struct sock *sk, unsigned short snum, - int (*bind_conflict)(const struct sock *sk, - const struct inet_bind_bucket *tb)); + struct sock *sk, unsigned short snum); extern struct dst_entry* inet_csk_route_req(struct sock *sk, const struct request_sock *req); @@ -242,7 +207,7 @@ static inline void inet_csk_reqsk_queue_add(struct sock *sk, extern void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req, - unsigned long timeout); + const unsigned timeout); static inline void inet_csk_reqsk_queue_removed(struct sock *sk, struct request_sock *req) @@ -308,6 +273,4 @@ static inline unsigned int inet_csk_listen_poll(const struct sock *sk) extern int inet_csk_listen_start(struct sock *sk, const int nr_table_entries); extern void inet_csk_listen_stop(struct sock *sk); -extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); - #endif /* _INET_CONNECTION_SOCK_H */ diff --git a/trunk/include/net/inet_ecn.h b/trunk/include/net/inet_ecn.h index d599c6bfbb86..b0c47e2eccf1 100644 --- a/trunk/include/net/inet_ecn.h +++ b/trunk/include/net/inet_ecn.h @@ -3,8 +3,6 @@ #include #include - -#include #include enum { diff --git a/trunk/include/net/inet_hashtables.h b/trunk/include/net/inet_hashtables.h index 135d80fd658e..07840baa9341 100644 --- a/trunk/include/net/inet_hashtables.h +++ b/trunk/include/net/inet_hashtables.h @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -129,6 +128,26 @@ struct inet_hashinfo { kmem_cache_t *bind_bucket_cachep; }; +static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport, + const __u32 faddr, const __u16 fport) +{ + unsigned int h = (laddr ^ lport) ^ (faddr ^ fport); + h ^= h >> 16; + h ^= h >> 8; + return h; +} + +static inline int inet_sk_ehashfn(const struct sock *sk) +{ + const struct inet_sock *inet = inet_sk(sk); + const __u32 laddr = inet->rcv_saddr; + const __u16 lport = inet->num; + const __u32 faddr = inet->daddr; + const __u16 fport = inet->dport; + + return inet_ehashfn(laddr, lport, faddr, fport); +} + static inline struct inet_ehash_bucket *inet_ehash_bucket( struct inet_hashinfo *hashinfo, unsigned int hash) @@ -415,7 +434,4 @@ static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo, return sk; } - -extern int inet_hash_connect(struct inet_timewait_death_row *death_row, - struct sock *sk); #endif /* _INET_HASHTABLES_H */ diff --git a/trunk/include/net/inet_sock.h b/trunk/include/net/inet_sock.h deleted file mode 100644 index 883eb529ef8e..000000000000 --- a/trunk/include/net/inet_sock.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - * INET An implementation of the TCP/IP protocol suite for the LINUX - * operating system. INET is implemented using the BSD Socket - * interface as the means of communication with the user level. - * - * Definitions for inet_sock - * - * Authors: Many, reorganised here by - * Arnaldo Carvalho de Melo - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _INET_SOCK_H -#define _INET_SOCK_H - -#include - -#include -#include - -#include -#include -#include - -/** struct ip_options - IP Options - * - * @faddr - Saved first hop address - * @is_setbyuser - Set by setsockopt? - * @is_data - Options in __data, rather than skb - * @is_strictroute - Strict source route - * @srr_is_hit - Packet destination addr was our one - * @is_changed - IP checksum more not valid - * @rr_needaddr - Need to record addr of outgoing dev - * @ts_needtime - Need to record timestamp - * @ts_needaddr - Need to record addr of outgoing dev - */ -struct ip_options { - __u32 faddr; - unsigned char optlen; - unsigned char srr; - unsigned char rr; - unsigned char ts; - unsigned char is_setbyuser:1, - is_data:1, - is_strictroute:1, - srr_is_hit:1, - is_changed:1, - rr_needaddr:1, - ts_needtime:1, - ts_needaddr:1; - unsigned char router_alert; - unsigned char __pad1; - unsigned char __pad2; - unsigned char __data[0]; -}; - -#define optlength(opt) (sizeof(struct ip_options) + opt->optlen) - -struct inet_request_sock { - struct request_sock req; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - u16 inet6_rsk_offset; - /* 2 bytes hole, try to pack */ -#endif - u32 loc_addr; - u32 rmt_addr; - u16 rmt_port; - u16 snd_wscale : 4, - rcv_wscale : 4, - tstamp_ok : 1, - sack_ok : 1, - wscale_ok : 1, - ecn_ok : 1, - acked : 1; - struct ip_options *opt; -}; - -static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) -{ - return (struct inet_request_sock *)sk; -} - -struct ip_mc_socklist; -struct ipv6_pinfo; -struct rtable; - -/** struct inet_sock - representation of INET sockets - * - * @sk - ancestor class - * @pinet6 - pointer to IPv6 control block - * @daddr - Foreign IPv4 addr - * @rcv_saddr - Bound local IPv4 addr - * @dport - Destination port - * @num - Local port - * @saddr - Sending source - * @uc_ttl - Unicast TTL - * @sport - Source port - * @id - ID counter for DF pkts - * @tos - TOS - * @mc_ttl - Multicasting TTL - * @is_icsk - is this an inet_connection_sock? - * @mc_index - Multicast device index - * @mc_list - Group array - * @cork - info to build ip hdr on each ip frag while socket is corked - */ -struct inet_sock { - /* sk and pinet6 has to be the first two members of inet_sock */ - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif - /* Socket demultiplex comparisons on incoming packets. */ - __u32 daddr; - __u32 rcv_saddr; - __u16 dport; - __u16 num; - __u32 saddr; - __s16 uc_ttl; - __u16 cmsg_flags; - struct ip_options *opt; - __u16 sport; - __u16 id; - __u8 tos; - __u8 mc_ttl; - __u8 pmtudisc; - __u8 recverr:1, - is_icsk:1, - freebind:1, - hdrincl:1, - mc_loop:1; - int mc_index; - __u32 mc_addr; - struct ip_mc_socklist *mc_list; - struct { - unsigned int flags; - unsigned int fragsize; - struct ip_options *opt; - struct rtable *rt; - int length; /* Total length of all frames */ - u32 addr; - struct flowi fl; - } cork; -}; - -#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ -#define IPCORK_ALLFRAG 2 /* always fragment (for ipv6 for now) */ - -static inline struct inet_sock *inet_sk(const struct sock *sk) -{ - return (struct inet_sock *)sk; -} - -static inline void __inet_sk_copy_descendant(struct sock *sk_to, - const struct sock *sk_from, - const int ancestor_size) -{ - memcpy(inet_sk(sk_to) + 1, inet_sk(sk_from) + 1, - sk_from->sk_prot->obj_size - ancestor_size); -} -#if !(defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) -static inline void inet_sk_copy_descendant(struct sock *sk_to, - const struct sock *sk_from) -{ - __inet_sk_copy_descendant(sk_to, sk_from, sizeof(struct inet_sock)); -} -#endif - -extern int inet_sk_rebuild_header(struct sock *sk); - -static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport, - const __u32 faddr, const __u16 fport) -{ - unsigned int h = (laddr ^ lport) ^ (faddr ^ fport); - h ^= h >> 16; - h ^= h >> 8; - return h; -} - -static inline int inet_sk_ehashfn(const struct sock *sk) -{ - const struct inet_sock *inet = inet_sk(sk); - const __u32 laddr = inet->rcv_saddr; - const __u16 lport = inet->num; - const __u32 faddr = inet->daddr; - const __u16 fport = inet->dport; - - return inet_ehashfn(laddr, lport, faddr, fport); -} - -#endif /* _INET_SOCK_H */ diff --git a/trunk/include/net/inet_timewait_sock.h b/trunk/include/net/inet_timewait_sock.h index 1da294c47522..28f7b2103505 100644 --- a/trunk/include/net/inet_timewait_sock.h +++ b/trunk/include/net/inet_timewait_sock.h @@ -17,16 +17,15 @@ #include +#include #include #include #include #include #include -#include #include #include -#include #include @@ -128,8 +127,7 @@ struct inet_timewait_sock { __u16 tw_num; /* And these are ours. */ __u8 tw_ipv6only:1; - /* 15 bits hole, try to pack */ - __u16 tw_ipv6_offset; + /* 31 bits hole, try to pack */ int tw_timeout; unsigned long tw_ttd; struct inet_bind_bucket *tw_tb; @@ -201,7 +199,7 @@ static inline void inet_twsk_put(struct inet_timewait_sock *tw) printk(KERN_DEBUG "%s timewait_sock %p released\n", tw->tw_prot->name, tw); #endif - kmem_cache_free(tw->tw_prot->twsk_prot->twsk_slab, tw); + kmem_cache_free(tw->tw_prot->twsk_slab, tw); module_put(owner); } } diff --git a/trunk/include/net/inetpeer.h b/trunk/include/net/inetpeer.h index 0965515f40cf..7fda471002b6 100644 --- a/trunk/include/net/inetpeer.h +++ b/trunk/include/net/inetpeer.h @@ -25,7 +25,6 @@ struct inet_peer __u32 v4daddr; /* peer's address */ __u16 avl_height; __u16 ip_id_count; /* IP ID for the next packet */ - atomic_t rid; /* Frag reception counter */ __u32 tcp_ts; unsigned long tcp_ts_stamp; }; diff --git a/trunk/include/net/ip.h b/trunk/include/net/ip.h index f7e7fd728b67..e4563bbee6ea 100644 --- a/trunk/include/net/ip.h +++ b/trunk/include/net/ip.h @@ -24,10 +24,14 @@ #include #include +#include #include #include - -#include +#include +#include +#include +#include +#include #include struct sock; @@ -41,7 +45,6 @@ struct inet_skb_parm #define IPSKB_TRANSLATED 2 #define IPSKB_FORWARDED 4 #define IPSKB_XFRM_TUNNEL_SIZE 8 -#define IPSKB_FRAG_COMPLETE 16 }; struct ipcm_cookie @@ -71,13 +74,6 @@ extern rwlock_t ip_ra_lock; #define IP_FRAG_TIME (30 * HZ) /* fragment lifetime */ -struct msghdr; -struct net_device; -struct packet_type; -struct rtable; -struct sk_buff; -struct sockaddr; - extern void ip_mc_dropsocket(struct sock *); extern void ip_mc_dropdevice(struct net_device *dev); extern int igmp_mc_proc_init(void); @@ -172,7 +168,6 @@ extern int sysctl_ipfrag_high_thresh; extern int sysctl_ipfrag_low_thresh; extern int sysctl_ipfrag_time; extern int sysctl_ipfrag_secret_interval; -extern int sysctl_ipfrag_max_dist; /* From inetpeer.c */ extern int inet_peer_threshold; @@ -187,8 +182,6 @@ extern int sysctl_ip_dynaddr; extern void ipfrag_init(void); #ifdef CONFIG_INET -#include - /* The function in 2.2 was invalid, producing wrong result for * check=0xFEFF. It was noticed by Arthur Skawina _year_ ago. --ANK(000625) */ static inline diff --git a/trunk/include/net/ip_fib.h b/trunk/include/net/ip_fib.h index e000fa2cd5f6..14de4ebd1211 100644 --- a/trunk/include/net/ip_fib.h +++ b/trunk/include/net/ip_fib.h @@ -238,8 +238,6 @@ extern int fib_validate_source(u32 src, u32 dst, u8 tos, int oif, struct net_device *dev, u32 *spec_dst, u32 *itag); extern void fib_select_multipath(const struct flowi *flp, struct fib_result *res); -struct rtentry; - /* Exported by fib_semantics.c */ extern int ip_fib_check_default(u32 gw, struct net_device *dev); extern int fib_sync_down(u32 local, struct net_device *dev, int force); diff --git a/trunk/include/net/ip_vs.h b/trunk/include/net/ip_vs.h index 7d2674fde19a..3b5559a023a4 100644 --- a/trunk/include/net/ip_vs.h +++ b/trunk/include/net/ip_vs.h @@ -251,15 +251,16 @@ struct ip_vs_daemon_user { #include #include /* for struct list_head */ #include /* for struct rwlock_t */ +#include /* for struct sk_buff */ +#include /* for struct iphdr */ #include /* for struct atomic_t */ +#include /* for struct neighbour */ +#include /* for struct dst_entry */ +#include #include -#include -#include #ifdef CONFIG_IP_VS_DEBUG -#include - extern int ip_vs_get_debug_level(void); #define IP_VS_DBG(level, msg...) \ do { \ @@ -428,11 +429,8 @@ struct ip_vs_stats spinlock_t lock; /* spin lock */ }; -struct dst_entry; -struct iphdr; struct ip_vs_conn; struct ip_vs_app; -struct sk_buff; struct ip_vs_protocol { struct ip_vs_protocol *next; diff --git a/trunk/include/net/ipv6.h b/trunk/include/net/ipv6.h index 860bbac4c4ee..6addb4d464d6 100644 --- a/trunk/include/net/ipv6.h +++ b/trunk/include/net/ipv6.h @@ -237,10 +237,6 @@ extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_t int newtype, struct ipv6_opt_hdr __user *newopt, int newoptlen); -struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, - struct ipv6_txoptions *opt); - -extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb); extern int ip6_frag_nqueues; extern atomic_t ip6_frag_mem; @@ -527,9 +523,6 @@ extern int inet6_getname(struct socket *sock, struct sockaddr *uaddr, extern int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); -extern int inet6_hash_connect(struct inet_timewait_death_row *death_row, - struct sock *sk); - /* * reassembly.c */ @@ -538,11 +531,8 @@ extern int sysctl_ip6frag_low_thresh; extern int sysctl_ip6frag_time; extern int sysctl_ip6frag_secret_interval; -extern const struct proto_ops inet6_stream_ops; -extern const struct proto_ops inet6_dgram_ops; - -struct group_source_req; -struct group_filter; +extern struct proto_ops inet6_stream_ops; +extern struct proto_ops inet6_dgram_ops; extern int ip6_mc_source(int add, int omode, struct sock *sk, struct group_source_req *pgsr); diff --git a/trunk/include/net/llc_pdu.h b/trunk/include/net/llc_pdu.h index 8f6306581fa7..c7a959428b4f 100644 --- a/trunk/include/net/llc_pdu.h +++ b/trunk/include/net/llc_pdu.h @@ -357,7 +357,7 @@ static inline void llc_pdu_init_as_test_rsp(struct sk_buff *skb, /* LLC Type 1 XID command/response information fields format */ struct llc_xid_info { - u8 fmt_id; /* always 0x81 for LLC */ + u8 fmt_id; /* always 0x18 for LLC */ u8 type; /* different if NULL/non-NULL LSAP */ u8 rw; /* sender receive window */ }; diff --git a/trunk/include/net/ndisc.h b/trunk/include/net/ndisc.h index bbac87eeb422..f85d6e4b7442 100644 --- a/trunk/include/net/ndisc.h +++ b/trunk/include/net/ndisc.h @@ -35,20 +35,11 @@ enum { #ifdef __KERNEL__ -#include -#include +#include +#include #include -#include -#include - #include - -struct ctl_table; -struct file; -struct inet6_dev; -struct net_device; -struct net_proto_family; -struct sk_buff; +#include extern struct neigh_table nd_tbl; @@ -117,7 +108,7 @@ extern int igmp6_event_report(struct sk_buff *skb); extern void igmp6_cleanup(void); #ifdef CONFIG_SYSCTL -extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, +extern int ndisc_ifinfo_sysctl_change(ctl_table *ctl, int write, struct file * filp, void __user *buffer, diff --git a/trunk/include/net/neighbour.h b/trunk/include/net/neighbour.h index 6fa9ae190741..34c07731933d 100644 --- a/trunk/include/net/neighbour.h +++ b/trunk/include/net/neighbour.h @@ -49,8 +49,8 @@ #ifdef __KERNEL__ #include -#include #include +#include #include #include diff --git a/trunk/include/net/pkt_act.h b/trunk/include/net/pkt_act.h index b225d8472b7e..bd08964b72c0 100644 --- a/trunk/include/net/pkt_act.h +++ b/trunk/include/net/pkt_act.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/include/net/protocol.h b/trunk/include/net/protocol.h index 63f7db99c2a6..357691f6a45f 100644 --- a/trunk/include/net/protocol.h +++ b/trunk/include/net/protocol.h @@ -65,7 +65,7 @@ struct inet_protosw { int protocol; /* This is the L4 protocol number. */ struct proto *prot; - const struct proto_ops *ops; + struct proto_ops *ops; int capability; /* Which (if any) capability do * we need to use this socket @@ -76,7 +76,6 @@ struct inet_protosw { }; #define INET_PROTOSW_REUSE 0x01 /* Are ports automatically reusable? */ #define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */ -#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ extern struct net_protocol *inet_protocol_base; extern struct net_protocol *inet_protos[MAX_INET_PROTOS]; diff --git a/trunk/include/net/raw.h b/trunk/include/net/raw.h index e67b28a0248c..f47917469b12 100644 --- a/trunk/include/net/raw.h +++ b/trunk/include/net/raw.h @@ -19,8 +19,6 @@ #include -#include - extern struct proto raw_prot; extern void raw_err(struct sock *, struct sk_buff *, u32 info); diff --git a/trunk/include/net/request_sock.h b/trunk/include/net/request_sock.h index 11641c9384f7..b52cc52ffe39 100644 --- a/trunk/include/net/request_sock.h +++ b/trunk/include/net/request_sock.h @@ -244,7 +244,7 @@ static inline int reqsk_queue_is_full(const struct request_sock_queue *queue) static inline void reqsk_queue_hash_req(struct request_sock_queue *queue, u32 hash, struct request_sock *req, - unsigned long timeout) + unsigned timeout) { struct listen_sock *lopt = queue->listen_opt; diff --git a/trunk/include/net/route.h b/trunk/include/net/route.h index e3e5436f8017..dbe79ca67d31 100644 --- a/trunk/include/net/route.h +++ b/trunk/include/net/route.h @@ -126,9 +126,6 @@ extern int ip_rt_ioctl(unsigned int cmd, void __user *arg); extern void ip_rt_get_source(u8 *src, struct rtable *rt); extern int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb); -struct in_ifaddr; -extern void fib_add_ifaddr(struct in_ifaddr *); - static inline void ip_rt_put(struct rtable * rt) { if (rt) diff --git a/trunk/include/net/sctp/structs.h b/trunk/include/net/sctp/structs.h index f5c22d77feab..8e7794ee27ff 100644 --- a/trunk/include/net/sctp/structs.h +++ b/trunk/include/net/sctp/structs.h @@ -277,24 +277,6 @@ struct sctp_sock { __u32 default_context; __u32 default_timetolive; - /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to - * the destination address every heartbeat interval. This value - * will be inherited by all new associations. - */ - __u32 hbinterval; - - /* This is the max_retrans value for new associations. */ - __u16 pathmaxrxt; - - /* The initial Path MTU to use for new associations. */ - __u32 pathmtu; - - /* The default SACK delay timeout for new associations. */ - __u32 sackdelay; - - /* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */ - __u32 param_flags; - struct sctp_initmsg initmsg; struct sctp_rtoinfo rtoinfo; struct sctp_paddrparams paddrparam; @@ -863,6 +845,9 @@ struct sctp_transport { /* Data that has been sent, but not acknowledged. */ __u32 flight_size; + /* PMTU : The current known path MTU. */ + __u32 pmtu; + /* Destination */ struct dst_entry *dst; /* Source address. */ @@ -877,22 +862,7 @@ struct sctp_transport { /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to * the destination address every heartbeat interval. */ - __u32 hbinterval; - - /* This is the max_retrans value for the transport and will - * be initialized from the assocs value. This can be changed - * using SCTP_SET_PEER_ADDR_PARAMS socket option. - */ - __u16 pathmaxrxt; - - /* PMTU : The current known path MTU. */ - __u32 pathmtu; - - /* SACK delay timeout */ - __u32 sackdelay; - - /* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */ - __u32 param_flags; + int hb_interval; /* When was the last time (in jiffies) that we heard from this * transport? We use this to pick new active and retran paths. @@ -912,11 +882,22 @@ struct sctp_transport { */ int state; + /* hb_allowed : The current heartbeat state of this destination, + * : i.e. ALLOW-HB, NO-HEARTBEAT, etc. + */ + int hb_allowed; + /* These are the error stats for this destination. */ /* Error count : The current error count for this destination. */ unsigned short error_count; + /* This is the max_retrans value for the transport and will + * be initialized to proto.max_retrans.path. This can be changed + * using SCTP_SET_PEER_ADDR_PARAMS socket option. + */ + int max_retrans; + /* Per : A timer used by each destination. * Destination : * Timer : @@ -1521,28 +1502,6 @@ struct sctp_association { /* The largest timeout or RTO value to use in attempting an INIT */ __u16 max_init_timeo; - /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to - * the destination address every heartbeat interval. This value - * will be inherited by all new transports. - */ - __u32 hbinterval; - - /* This is the max_retrans value for new transports in the - * association. - */ - __u16 pathmaxrxt; - - /* Association : The smallest PMTU discovered for all of the - * PMTU : peer's transport addresses. - */ - __u32 pathmtu; - - /* SACK delay timeout */ - __u32 sackdelay; - - /* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */ - __u32 param_flags; - int timeouts[SCTP_NUM_TIMEOUT_TYPES]; struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES]; @@ -1612,6 +1571,11 @@ struct sctp_association { */ wait_queue_head_t wait; + /* Association : The smallest PMTU discovered for all of the + * PMTU : peer's transport addresses. + */ + __u32 pmtu; + /* The message size at which SCTP fragmentation will occur. */ __u32 frag_point; diff --git a/trunk/include/net/sctp/user.h b/trunk/include/net/sctp/user.h index 8a6bef6f91eb..f1c3bc54526a 100644 --- a/trunk/include/net/sctp/user.h +++ b/trunk/include/net/sctp/user.h @@ -93,8 +93,6 @@ enum sctp_optname { #define SCTP_STATUS SCTP_STATUS SCTP_GET_PEER_ADDR_INFO, #define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO - SCTP_DELAYED_ACK_TIME, -#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK_TIME /* Internal Socket Options. Some of the sctp library functions are * implemented using these socket options. @@ -505,41 +503,13 @@ struct sctp_setadaption { * unreachable. The following structure is used to access and modify an * address's parameters: */ -enum sctp_spp_flags { - SPP_HB_ENABLE = 1, /*Enable heartbeats*/ - SPP_HB_DISABLE = 2, /*Disable heartbeats*/ - SPP_HB = SPP_HB_ENABLE | SPP_HB_DISABLE, - SPP_HB_DEMAND = 4, /*Send heartbeat immediately*/ - SPP_PMTUD_ENABLE = 8, /*Enable PMTU discovery*/ - SPP_PMTUD_DISABLE = 16, /*Disable PMTU discovery*/ - SPP_PMTUD = SPP_PMTUD_ENABLE | SPP_PMTUD_DISABLE, - SPP_SACKDELAY_ENABLE = 32, /*Enable SACK*/ - SPP_SACKDELAY_DISABLE = 64, /*Disable SACK*/ - SPP_SACKDELAY = SPP_SACKDELAY_ENABLE | SPP_SACKDELAY_DISABLE, -}; - struct sctp_paddrparams { sctp_assoc_t spp_assoc_id; struct sockaddr_storage spp_address; __u32 spp_hbinterval; __u16 spp_pathmaxrxt; - __u32 spp_pathmtu; - __u32 spp_sackdelay; - __u32 spp_flags; } __attribute__((packed, aligned(4))); -/* 7.1.24. Delayed Ack Timer (SCTP_DELAYED_ACK_TIME) - * - * This options will get or set the delayed ack timer. The time is set - * in milliseconds. If the assoc_id is 0, then this sets or gets the - * endpoints default delayed ack timer value. If the assoc_id field is - * non-zero, then the set or get effects the specified association. - */ -struct sctp_assoc_value { - sctp_assoc_t assoc_id; - uint32_t assoc_value; -}; - /* * 7.2.2 Peer Address Information * diff --git a/trunk/include/net/sock.h b/trunk/include/net/sock.h index 6961700ff3a0..982b4ecd187b 100644 --- a/trunk/include/net/sock.h +++ b/trunk/include/net/sock.h @@ -493,7 +493,6 @@ extern void sk_stream_kill_queues(struct sock *sk); extern int sk_wait_data(struct sock *sk, long *timeo); struct request_sock_ops; -struct timewait_sock_ops; /* Networking protocol blocks we attach to sockets. * socket layer -> transport layer interface @@ -558,10 +557,11 @@ struct proto { kmem_cache_t *slab; unsigned int obj_size; + kmem_cache_t *twsk_slab; + unsigned int twsk_obj_size; atomic_t *orphan_count; struct request_sock_ops *rsk_prot; - struct timewait_sock_ops *twsk_prot; struct module *owner; @@ -926,29 +926,6 @@ static inline void sock_put(struct sock *sk) sk_free(sk); } -static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb) -{ - int rc = NET_RX_SUCCESS; - - if (sk_filter(sk, skb, 0)) - goto discard_and_relse; - - skb->dev = NULL; - - bh_lock_sock(sk); - if (!sock_owned_by_user(sk)) - rc = sk->sk_backlog_rcv(sk, skb); - else - sk_add_backlog(sk, skb); - bh_unlock_sock(sk); -out: - sock_put(sk); - return rc; -discard_and_relse: - kfree_skb(skb); - goto out; -} - /* Detach socket from process context. * Announce socket dead, detach it from wait queue and inode. * Note that parent inode held reference count on this struct sock, @@ -1189,10 +1166,7 @@ static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) static inline int sock_error(struct sock *sk) { - int err; - if (likely(!sk->sk_err)) - return 0; - err = xchg(&sk->sk_err, 0); + int err = xchg(&sk->sk_err, 0); return -err; } diff --git a/trunk/include/net/tcp.h b/trunk/include/net/tcp.h index 77f21c65bbca..0f9848011972 100644 --- a/trunk/include/net/tcp.h +++ b/trunk/include/net/tcp.h @@ -224,6 +224,53 @@ extern atomic_t tcp_memory_allocated; extern atomic_t tcp_sockets_allocated; extern int tcp_memory_pressure; +/* + * Pointers to address related TCP functions + * (i.e. things that depend on the address family) + */ + +struct tcp_func { + int (*queue_xmit) (struct sk_buff *skb, + int ipfragok); + + void (*send_check) (struct sock *sk, + struct tcphdr *th, + int len, + struct sk_buff *skb); + + int (*rebuild_header) (struct sock *sk); + + int (*conn_request) (struct sock *sk, + struct sk_buff *skb); + + struct sock * (*syn_recv_sock) (struct sock *sk, + struct sk_buff *skb, + struct request_sock *req, + struct dst_entry *dst); + + int (*remember_stamp) (struct sock *sk); + + __u16 net_header_len; + + int (*setsockopt) (struct sock *sk, + int level, + int optname, + char __user *optval, + int optlen); + + int (*getsockopt) (struct sock *sk, + int level, + int optname, + char __user *optval, + int __user *optlen); + + + void (*addr2sockaddr) (struct sock *sk, + struct sockaddr *); + + int sockaddr_len; +}; + /* * The next routines deal with comparing 32 bit unsigned ints * and worry about wraparound (automatic with unsigned arithmetic). @@ -287,9 +334,6 @@ extern int tcp_rcv_established(struct sock *sk, extern void tcp_rcv_space_adjust(struct sock *sk); -extern int tcp_twsk_unique(struct sock *sk, - struct sock *sktw, void *twp); - static inline void tcp_dec_quickack_mode(struct sock *sk, const unsigned int pkts) { @@ -361,7 +405,8 @@ extern void tcp_parse_options(struct sk_buff *skb, * TCP v4 functions exported for the inet6 API */ -extern void tcp_v4_send_check(struct sock *sk, int len, +extern void tcp_v4_send_check(struct sock *sk, + struct tcphdr *th, int len, struct sk_buff *skb); extern int tcp_v4_conn_request(struct sock *sk, @@ -445,16 +490,34 @@ typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, extern int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, sk_read_actor_t recv_actor); -extern void tcp_initialize_rcv_mss(struct sock *sk); +/* Initialize RCV_MSS value. + * RCV_MSS is an our guess about MSS used by the peer. + * We haven't any direct information about the MSS. + * It's better to underestimate the RCV_MSS rather than overestimate. + * Overestimations make us ACKing less frequently than needed. + * Underestimations are more easy to detect and fix by tcp_measure_rcv_mss(). + */ -static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) +static inline void tcp_initialize_rcv_mss(struct sock *sk) +{ + struct tcp_sock *tp = tcp_sk(sk); + unsigned int hint = min_t(unsigned int, tp->advmss, tp->mss_cache); + + hint = min(hint, tp->rcv_wnd/2); + hint = min(hint, TCP_MIN_RCVMSS); + hint = max(hint, TCP_MIN_MSS); + + inet_csk(sk)->icsk_ack.rcv_mss = hint; +} + +static __inline__ void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) { tp->pred_flags = htonl((tp->tcp_header_len << 26) | ntohl(TCP_FLAG_ACK) | snd_wnd); } -static inline void tcp_fast_path_on(struct tcp_sock *tp) +static __inline__ void tcp_fast_path_on(struct tcp_sock *tp) { __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale); } @@ -472,7 +535,7 @@ static inline void tcp_fast_path_check(struct sock *sk, struct tcp_sock *tp) * Rcv_nxt can be after the window if our peer push more data * than the offered window. */ -static inline u32 tcp_receive_window(const struct tcp_sock *tp) +static __inline__ u32 tcp_receive_window(const struct tcp_sock *tp) { s32 win = tp->rcv_wup + tp->rcv_wnd - tp->rcv_nxt; @@ -489,8 +552,8 @@ extern u32 __tcp_select_window(struct sock *sk); /* TCP timestamps are only 32-bits, this causes a slight * complication on 64-bit systems since we store a snapshot - * of jiffies in the buffer control blocks below. We decided - * to use only the low 32-bits of jiffies and hide the ugly + * of jiffies in the buffer control blocks below. We decidedly + * only use of the low 32-bits of jiffies and hide the ugly * casts with the following macro. */ #define tcp_time_stamp ((__u32)(jiffies)) @@ -644,7 +707,6 @@ extern void tcp_cleanup_congestion_control(struct sock *sk); extern int tcp_set_default_congestion_control(const char *name); extern void tcp_get_default_congestion_control(char *name); extern int tcp_set_congestion_control(struct sock *sk, const char *name); -extern void tcp_slow_start(struct tcp_sock *tp); extern struct tcp_congestion_ops tcp_init_congestion_ops; extern u32 tcp_reno_ssthresh(struct sock *sk); @@ -684,7 +746,7 @@ static inline void tcp_ca_event(struct sock *sk, const enum tcp_ca_event event) * "Packets left network, but not honestly ACKed yet" PLUS * "Packets fast retransmitted" */ -static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp) +static __inline__ unsigned int tcp_packets_in_flight(const struct tcp_sock *tp) { return (tp->packets_out - tp->left_out + tp->retrans_out); } @@ -704,6 +766,33 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk) (tp->snd_cwnd >> 2))); } +/* + * Linear increase during slow start + */ +static inline void tcp_slow_start(struct tcp_sock *tp) +{ + if (sysctl_tcp_abc) { + /* RFC3465: Slow Start + * TCP sender SHOULD increase cwnd by the number of + * previously unacknowledged bytes ACKed by each incoming + * acknowledgment, provided the increase is not more than L + */ + if (tp->bytes_acked < tp->mss_cache) + return; + + /* We MAY increase by 2 if discovered delayed ack */ + if (sysctl_tcp_abc > 1 && tp->bytes_acked > 2*tp->mss_cache) { + if (tp->snd_cwnd < tp->snd_cwnd_clamp) + tp->snd_cwnd++; + } + } + tp->bytes_acked = 0; + + if (tp->snd_cwnd < tp->snd_cwnd_clamp) + tp->snd_cwnd++; +} + + static inline void tcp_sync_left_out(struct tcp_sock *tp) { if (tp->rx_opt.sack_ok && @@ -712,7 +801,34 @@ static inline void tcp_sync_left_out(struct tcp_sock *tp) tp->left_out = tp->sacked_out + tp->lost_out; } -extern void tcp_enter_cwr(struct sock *sk); +/* Set slow start threshold and cwnd not falling to slow start */ +static inline void __tcp_enter_cwr(struct sock *sk) +{ + const struct inet_connection_sock *icsk = inet_csk(sk); + struct tcp_sock *tp = tcp_sk(sk); + + tp->undo_marker = 0; + tp->snd_ssthresh = icsk->icsk_ca_ops->ssthresh(sk); + tp->snd_cwnd = min(tp->snd_cwnd, + tcp_packets_in_flight(tp) + 1U); + tp->snd_cwnd_cnt = 0; + tp->high_seq = tp->snd_nxt; + tp->snd_cwnd_stamp = tcp_time_stamp; + TCP_ECN_queue_cwr(tp); +} + +static inline void tcp_enter_cwr(struct sock *sk) +{ + struct tcp_sock *tp = tcp_sk(sk); + + tp->prior_ssthresh = 0; + tp->bytes_acked = 0; + if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) { + __tcp_enter_cwr(sk); + tcp_set_ca_state(sk, TCP_CA_CWR); + } +} + extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); /* Slow start with delack produces 3 packets of burst, so that @@ -744,14 +860,14 @@ static inline int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight) return left <= tcp_max_burst(tp); } -static inline void tcp_minshall_update(struct tcp_sock *tp, int mss, - const struct sk_buff *skb) +static __inline__ void tcp_minshall_update(struct tcp_sock *tp, int mss, + const struct sk_buff *skb) { if (skb->len < mss) tp->snd_sml = TCP_SKB_CB(skb)->end_seq; } -static inline void tcp_check_probe_timer(struct sock *sk, struct tcp_sock *tp) +static __inline__ void tcp_check_probe_timer(struct sock *sk, struct tcp_sock *tp) { const struct inet_connection_sock *icsk = inet_csk(sk); if (!tp->packets_out && !icsk->icsk_pending) @@ -759,18 +875,18 @@ static inline void tcp_check_probe_timer(struct sock *sk, struct tcp_sock *tp) icsk->icsk_rto, TCP_RTO_MAX); } -static inline void tcp_push_pending_frames(struct sock *sk, - struct tcp_sock *tp) +static __inline__ void tcp_push_pending_frames(struct sock *sk, + struct tcp_sock *tp) { __tcp_push_pending_frames(sk, tp, tcp_current_mss(sk, 1), tp->nonagle); } -static inline void tcp_init_wl(struct tcp_sock *tp, u32 ack, u32 seq) +static __inline__ void tcp_init_wl(struct tcp_sock *tp, u32 ack, u32 seq) { tp->snd_wl1 = seq; } -static inline void tcp_update_wl(struct tcp_sock *tp, u32 ack, u32 seq) +static __inline__ void tcp_update_wl(struct tcp_sock *tp, u32 ack, u32 seq) { tp->snd_wl1 = seq; } @@ -778,19 +894,19 @@ static inline void tcp_update_wl(struct tcp_sock *tp, u32 ack, u32 seq) /* * Calculate(/check) TCP checksum */ -static inline u16 tcp_v4_check(struct tcphdr *th, int len, - unsigned long saddr, unsigned long daddr, - unsigned long base) +static __inline__ u16 tcp_v4_check(struct tcphdr *th, int len, + unsigned long saddr, unsigned long daddr, + unsigned long base) { return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base); } -static inline int __tcp_checksum_complete(struct sk_buff *skb) +static __inline__ int __tcp_checksum_complete(struct sk_buff *skb) { return __skb_checksum_complete(skb); } -static inline int tcp_checksum_complete(struct sk_buff *skb) +static __inline__ int tcp_checksum_complete(struct sk_buff *skb) { return skb->ip_summed != CHECKSUM_UNNECESSARY && __tcp_checksum_complete(skb); @@ -798,7 +914,7 @@ static inline int tcp_checksum_complete(struct sk_buff *skb) /* Prequeue for VJ style copy to user, combined with checksumming. */ -static inline void tcp_prequeue_init(struct tcp_sock *tp) +static __inline__ void tcp_prequeue_init(struct tcp_sock *tp) { tp->ucopy.task = NULL; tp->ucopy.len = 0; @@ -814,7 +930,7 @@ static inline void tcp_prequeue_init(struct tcp_sock *tp) * * NOTE: is this not too big to inline? */ -static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb) +static __inline__ int tcp_prequeue(struct sock *sk, struct sk_buff *skb) { struct tcp_sock *tp = tcp_sk(sk); @@ -855,7 +971,7 @@ static const char *statename[]={ }; #endif -static inline void tcp_set_state(struct sock *sk, int state) +static __inline__ void tcp_set_state(struct sock *sk, int state) { int oldstate = sk->sk_state; @@ -889,7 +1005,7 @@ static inline void tcp_set_state(struct sock *sk, int state) #endif } -static inline void tcp_done(struct sock *sk) +static __inline__ void tcp_done(struct sock *sk) { tcp_set_state(sk, TCP_CLOSE); tcp_clear_xmit_timers(sk); @@ -902,13 +1018,81 @@ static inline void tcp_done(struct sock *sk) inet_csk_destroy_sock(sk); } -static inline void tcp_sack_reset(struct tcp_options_received *rx_opt) +static __inline__ void tcp_sack_reset(struct tcp_options_received *rx_opt) { rx_opt->dsack = 0; rx_opt->eff_sacks = 0; rx_opt->num_sacks = 0; } +static __inline__ void tcp_build_and_update_options(__u32 *ptr, struct tcp_sock *tp, __u32 tstamp) +{ + if (tp->rx_opt.tstamp_ok) { + *ptr++ = __constant_htonl((TCPOPT_NOP << 24) | + (TCPOPT_NOP << 16) | + (TCPOPT_TIMESTAMP << 8) | + TCPOLEN_TIMESTAMP); + *ptr++ = htonl(tstamp); + *ptr++ = htonl(tp->rx_opt.ts_recent); + } + if (tp->rx_opt.eff_sacks) { + struct tcp_sack_block *sp = tp->rx_opt.dsack ? tp->duplicate_sack : tp->selective_acks; + int this_sack; + + *ptr++ = __constant_htonl((TCPOPT_NOP << 24) | + (TCPOPT_NOP << 16) | + (TCPOPT_SACK << 8) | + (TCPOLEN_SACK_BASE + + (tp->rx_opt.eff_sacks * TCPOLEN_SACK_PERBLOCK))); + for(this_sack = 0; this_sack < tp->rx_opt.eff_sacks; this_sack++) { + *ptr++ = htonl(sp[this_sack].start_seq); + *ptr++ = htonl(sp[this_sack].end_seq); + } + if (tp->rx_opt.dsack) { + tp->rx_opt.dsack = 0; + tp->rx_opt.eff_sacks--; + } + } +} + +/* Construct a tcp options header for a SYN or SYN_ACK packet. + * If this is every changed make sure to change the definition of + * MAX_SYN_SIZE to match the new maximum number of options that you + * can generate. + */ +static inline void tcp_syn_build_options(__u32 *ptr, int mss, int ts, int sack, + int offer_wscale, int wscale, __u32 tstamp, __u32 ts_recent) +{ + /* We always get an MSS option. + * The option bytes which will be seen in normal data + * packets should timestamps be used, must be in the MSS + * advertised. But we subtract them from tp->mss_cache so + * that calculations in tcp_sendmsg are simpler etc. + * So account for this fact here if necessary. If we + * don't do this correctly, as a receiver we won't + * recognize data packets as being full sized when we + * should, and thus we won't abide by the delayed ACK + * rules correctly. + * SACKs don't matter, we never delay an ACK when we + * have any of those going out. + */ + *ptr++ = htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) | mss); + if (ts) { + if(sack) + *ptr++ = __constant_htonl((TCPOPT_SACK_PERM << 24) | (TCPOLEN_SACK_PERM << 16) | + (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP); + else + *ptr++ = __constant_htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | + (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP); + *ptr++ = htonl(tstamp); /* TSVAL */ + *ptr++ = htonl(ts_recent); /* TSECR */ + } else if(sack) + *ptr++ = __constant_htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | + (TCPOPT_SACK_PERM << 8) | TCPOLEN_SACK_PERM); + if (offer_wscale) + *ptr++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_WINDOW << 16) | (TCPOLEN_WINDOW << 8) | (wscale)); +} + /* Determine a window scaling and initial window to offer. */ extern void tcp_select_initial_window(int __space, __u32 mss, __u32 *rcv_wnd, __u32 *window_clamp, @@ -933,9 +1117,9 @@ static inline int tcp_full_space(const struct sock *sk) return tcp_win_from_space(sk->sk_rcvbuf); } -static inline void tcp_openreq_init(struct request_sock *req, - struct tcp_options_received *rx_opt, - struct sk_buff *skb) +static __inline__ void tcp_openreq_init(struct request_sock *req, + struct tcp_options_received *rx_opt, + struct sk_buff *skb) { struct inet_request_sock *ireq = inet_rsk(req); diff --git a/trunk/include/net/tcp_states.h b/trunk/include/net/tcp_states.h index b0b645988bd8..b9d4176b2d15 100644 --- a/trunk/include/net/tcp_states.h +++ b/trunk/include/net/tcp_states.h @@ -31,20 +31,4 @@ enum { #define TCP_STATE_MASK 0xF -#define TCP_ACTION_FIN (1 << 7) - -enum { - TCPF_ESTABLISHED = (1 << 1), - TCPF_SYN_SENT = (1 << 2), - TCPF_SYN_RECV = (1 << 3), - TCPF_FIN_WAIT1 = (1 << 4), - TCPF_FIN_WAIT2 = (1 << 5), - TCPF_TIME_WAIT = (1 << 6), - TCPF_CLOSE = (1 << 7), - TCPF_CLOSE_WAIT = (1 << 8), - TCPF_LAST_ACK = (1 << 9), - TCPF_LISTEN = (1 << 10), - TCPF_CLOSING = (1 << 11) -}; - #endif /* _LINUX_TCP_STATES_H */ diff --git a/trunk/include/net/timewait_sock.h b/trunk/include/net/timewait_sock.h deleted file mode 100644 index 2544281e1d5e..000000000000 --- a/trunk/include/net/timewait_sock.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * NET Generic infrastructure for Network protocols. - * - * Authors: Arnaldo Carvalho de Melo - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _TIMEWAIT_SOCK_H -#define _TIMEWAIT_SOCK_H - -#include -#include - -struct timewait_sock_ops { - kmem_cache_t *twsk_slab; - unsigned int twsk_obj_size; - int (*twsk_unique)(struct sock *sk, - struct sock *sktw, void *twp); -}; - -static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) -{ - if (sk->sk_prot->twsk_prot->twsk_unique != NULL) - return sk->sk_prot->twsk_prot->twsk_unique(sk, sktw, twp); - return 0; -} - -#endif /* _TIMEWAIT_SOCK_H */ diff --git a/trunk/include/net/transp_v6.h b/trunk/include/net/transp_v6.h index 61f724c1036f..4e86f2de6638 100644 --- a/trunk/include/net/transp_v6.h +++ b/trunk/include/net/transp_v6.h @@ -44,7 +44,7 @@ extern int datagram_send_ctl(struct msghdr *msg, /* * address family specific functions */ -extern struct inet_connection_sock_af_ops ipv4_specific; +extern struct tcp_func ipv4_specific; extern int inet6_destroy_sock(struct sock *sk); diff --git a/trunk/include/net/udp.h b/trunk/include/net/udp.h index 766fba1369ce..107b9d791a1f 100644 --- a/trunk/include/net/udp.h +++ b/trunk/include/net/udp.h @@ -22,8 +22,9 @@ #ifndef _UDP_H #define _UDP_H +#include +#include #include -#include #include #include #include @@ -61,7 +62,6 @@ static inline int udp_lport_inuse(u16 num) extern struct proto udp_prot; -struct sk_buff; extern void udp_err(struct sk_buff *, u32); diff --git a/trunk/include/net/xfrm.h b/trunk/include/net/xfrm.h index 07d7b50cdd76..5beae1ccd574 100644 --- a/trunk/include/net/xfrm.h +++ b/trunk/include/net/xfrm.h @@ -2,12 +2,11 @@ #define _NET_XFRM_H #include -#include #include #include #include #include -#include +#include #include #include #include @@ -145,9 +144,6 @@ struct xfrm_state * transformer. */ struct xfrm_type *type; - /* Security context */ - struct xfrm_sec_ctx *security; - /* Private data of this transformer, format is opaque, * interpreted by xfrm_type methods. */ void *data; @@ -302,7 +298,6 @@ struct xfrm_policy __u8 flags; __u8 dead; __u8 xfrm_nr; - struct xfrm_sec_ctx *security; struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; }; @@ -515,25 +510,6 @@ xfrm_selector_match(struct xfrm_selector *sel, struct flowi *fl, return 0; } -#ifdef CONFIG_SECURITY_NETWORK_XFRM -/* If neither has a context --> match - * Otherwise, both must have a context and the sids, doi, alg must match - */ -static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ctx *s2) -{ - return ((!s1 && !s2) || - (s1 && s2 && - (s1->ctx_sid == s2->ctx_sid) && - (s1->ctx_doi == s2->ctx_doi) && - (s1->ctx_alg == s2->ctx_alg))); -} -#else -static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ctx *s2) -{ - return 1; -} -#endif - /* A struct encoding bundle of transformations to apply to some set of flow. * * dst->child points to the next element of bundle. @@ -902,8 +878,8 @@ static inline int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsig struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp); extern int xfrm_policy_walk(int (*func)(struct xfrm_policy *, int, int, void*), void *); int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); -struct xfrm_policy *xfrm_policy_bysel_ctx(int dir, struct xfrm_selector *sel, - struct xfrm_sec_ctx *ctx, int delete); +struct xfrm_policy *xfrm_policy_bysel(int dir, struct xfrm_selector *sel, + int delete); struct xfrm_policy *xfrm_policy_byid(int dir, u32 id, int delete); void xfrm_policy_flush(void); u32 xfrm_get_acqseq(void); @@ -914,7 +890,6 @@ struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, extern void xfrm_policy_flush(void); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); extern int xfrm_flush_bundles(void); -extern void xfrm_flush_all_bundles(void); extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family); extern void xfrm_init_pmtu(struct dst_entry *dst); diff --git a/trunk/include/scsi/scsi_cmnd.h b/trunk/include/scsi/scsi_cmnd.h index 41cfc29be899..7529f4388bb4 100644 --- a/trunk/include/scsi/scsi_cmnd.h +++ b/trunk/include/scsi/scsi_cmnd.h @@ -151,6 +151,5 @@ extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); extern void scsi_put_command(struct scsi_cmnd *); extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); extern void scsi_finish_command(struct scsi_cmnd *cmd); -extern void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd); #endif /* _SCSI_SCSI_CMND_H */ diff --git a/trunk/include/scsi/scsi_dbg.h b/trunk/include/scsi/scsi_dbg.h index 4d69dee66d4d..b090a11d7e1c 100644 --- a/trunk/include/scsi/scsi_dbg.h +++ b/trunk/include/scsi/scsi_dbg.h @@ -16,6 +16,7 @@ extern void __scsi_print_sense(const char *name, extern void scsi_print_driverbyte(int); extern void scsi_print_hostbyte(int); extern void scsi_print_status(unsigned char); +extern int scsi_print_msg(const unsigned char *); extern const char *scsi_sense_key_string(unsigned char); extern const char *scsi_extd_sense_format(unsigned char, unsigned char); diff --git a/trunk/include/scsi/scsi_device.h b/trunk/include/scsi/scsi_device.h index e94ca4d36035..85cfd88461c8 100644 --- a/trunk/include/scsi/scsi_device.h +++ b/trunk/include/scsi/scsi_device.h @@ -79,9 +79,9 @@ struct scsi_device { char inq_periph_qual; /* PQ from INQUIRY data */ unsigned char inquiry_len; /* valid bytes in 'inquiry' */ unsigned char * inquiry; /* INQUIRY response data */ - const char * vendor; /* [back_compat] point into 'inquiry' ... */ - const char * model; /* ... after scan; point to static string */ - const char * rev; /* ... "nullnullnullnull" before scan */ + char * vendor; /* [back_compat] point into 'inquiry' ... */ + char * model; /* ... after scan; point to static string */ + char * rev; /* ... "nullnullnullnull" before scan */ unsigned char current_tag; /* current tag */ struct scsi_target *sdev_target; /* used only for single_lun */ @@ -274,12 +274,6 @@ extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, extern int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, int data_direction, void *buffer, unsigned bufflen, struct scsi_sense_hdr *, int timeout, int retries); -extern int scsi_execute_async(struct scsi_device *sdev, - const unsigned char *cmd, int data_direction, - void *buffer, unsigned bufflen, int use_sg, - int timeout, int retries, void *privdata, - void (*done)(void *, char *, int, int), - gfp_t gfp); static inline unsigned int sdev_channel(struct scsi_device *sdev) { diff --git a/trunk/include/scsi/scsi_transport_fc.h b/trunk/include/scsi/scsi_transport_fc.h index 394f14a5b7cb..fac547d32a98 100644 --- a/trunk/include/scsi/scsi_transport_fc.h +++ b/trunk/include/scsi/scsi_transport_fc.h @@ -79,7 +79,6 @@ enum fc_port_state { FC_PORTSTATE_LINKDOWN, FC_PORTSTATE_ERROR, FC_PORTSTATE_LOOPBACK, - FC_PORTSTATE_DELETED, }; @@ -326,14 +325,8 @@ struct fc_host_attrs { struct list_head rport_bindings; u32 next_rport_number; u32 next_target_id; - u8 flags; - struct work_struct rport_del_work; }; -/* values for struct fc_host_attrs "flags" field: */ -#define FC_SHOST_RPORT_DEL_SCHEDULED 0x01 - - #define fc_host_node_name(x) \ (((struct fc_host_attrs *)(x)->shost_data)->node_name) #define fc_host_port_name(x) \ @@ -372,10 +365,6 @@ struct fc_host_attrs { (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number) #define fc_host_next_target_id(x) \ (((struct fc_host_attrs *)(x)->shost_data)->next_target_id) -#define fc_host_flags(x) \ - (((struct fc_host_attrs *)(x)->shost_data)->flags) -#define fc_host_rport_del_work(x) \ - (((struct fc_host_attrs *)(x)->shost_data)->rport_del_work) /* The functions by which the transport class and the driver communicate */ diff --git a/trunk/include/scsi/scsi_transport_spi.h b/trunk/include/scsi/scsi_transport_spi.h index 54a89611e9c5..6bdc4afb2483 100644 --- a/trunk/include/scsi/scsi_transport_spi.h +++ b/trunk/include/scsi/scsi_transport_spi.h @@ -24,9 +24,6 @@ #include struct scsi_transport_template; -struct scsi_target; -struct scsi_device; -struct Scsi_Host; struct spi_transport_attrs { int period; /* value in the PPR/SDTR command */ @@ -146,6 +143,5 @@ void spi_release_transport(struct scsi_transport_template *); void spi_schedule_dv_device(struct scsi_device *); void spi_dv_device(struct scsi_device *); void spi_display_xfer_agreement(struct scsi_target *); -int spi_print_msg(const unsigned char *); #endif /* SCSI_TRANSPORT_SPI_H */ diff --git a/trunk/init/Kconfig b/trunk/init/Kconfig index 9fc0759fa942..ea097e0a9c02 100644 --- a/trunk/init/Kconfig +++ b/trunk/init/Kconfig @@ -206,7 +206,7 @@ config HOTPLUG outside the kernel tree does. Such modules require Y here. config KOBJECT_UEVENT - bool "Kernel Userspace Events" if EMBEDDED + bool "Kernel Userspace Events" depends on NET default y help @@ -256,19 +256,6 @@ config CPUSETS source "usr/Kconfig" -config CC_OPTIMIZE_FOR_SIZE - bool "Optimize for size (Look out for broken compilers!)" - default y - depends on ARM || H8300 || EXPERIMENTAL - help - Enabling this option will pass "-Os" instead of "-O2" to gcc - resulting in a smaller kernel. - - WARNING: some versions of gcc may generate incorrect code with this - option. If problems are observed, a gcc upgrade may be needed. - - If unsure, say N. - menuconfig EMBEDDED bool "Configure standard kernel features (for small systems)" help @@ -351,6 +338,18 @@ config EPOLL Disabling this option will cause the kernel to be built without support for epoll family of system calls. +config CC_OPTIMIZE_FOR_SIZE + bool "Optimize for size" if EMBEDDED + default y if ARM || H8300 + help + Enabling this option will pass "-Os" instead of "-O2" to gcc + resulting in a smaller kernel. + + WARNING: some versions of gcc may generate incorrect code with this + option. If problems are observed, a gcc upgrade may be needed. + + If unsure, say N. + config SHMEM bool "Use full shmem filesystem" if EMBEDDED default y diff --git a/trunk/init/main.c b/trunk/init/main.c index 54aaf561cf66..27f97f9b4636 100644 --- a/trunk/init/main.c +++ b/trunk/init/main.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -613,6 +614,9 @@ static void __init do_basic_setup(void) sysctl_init(); #endif + /* Networking initialization needs a process context */ + sock_init(); + do_initcalls(); } diff --git a/trunk/ipc/sem.c b/trunk/ipc/sem.c index cb5bb2a5df96..19af028a3e38 100644 --- a/trunk/ipc/sem.c +++ b/trunk/ipc/sem.c @@ -381,7 +381,6 @@ static void update_queue (struct sem_array * sma) /* hands-off: q will disappear immediately after * writing q->status. */ - smp_wmb(); q->status = error; q = n; } else { @@ -462,7 +461,6 @@ static void freeary (struct sem_array *sma, int id) n = q->next; q->status = IN_WAKEUP; wake_up_process(q->sleeper); /* doesn't sleep */ - smp_wmb(); q->status = -EIDRM; /* hands-off q */ q = n; } diff --git a/trunk/kernel/audit.c b/trunk/kernel/audit.c index 32fa03ad1984..0c56320d38dc 100644 --- a/trunk/kernel/audit.c +++ b/trunk/kernel/audit.c @@ -291,10 +291,8 @@ int kauditd_thread(void *dummy) set_current_state(TASK_INTERRUPTIBLE); add_wait_queue(&kauditd_wait, &wait); - if (!skb_queue_len(&audit_skb_queue)) { - try_to_freeze(); + if (!skb_queue_len(&audit_skb_queue)) schedule(); - } __set_current_state(TASK_RUNNING); remove_wait_queue(&kauditd_wait, &wait); diff --git a/trunk/kernel/cpu.c b/trunk/kernel/cpu.c index e882c6babf41..d61ba88f34e5 100644 --- a/trunk/kernel/cpu.c +++ b/trunk/kernel/cpu.c @@ -16,76 +16,47 @@ #include /* This protects CPUs going up and down... */ -static DECLARE_MUTEX(cpucontrol); +DECLARE_MUTEX(cpucontrol); +EXPORT_SYMBOL_GPL(cpucontrol); static struct notifier_block *cpu_chain; -#ifdef CONFIG_HOTPLUG_CPU -static struct task_struct *lock_cpu_hotplug_owner; -static int lock_cpu_hotplug_depth; +/* + * Used to check by callers if they need to acquire the cpucontrol + * or not to protect a cpu from being removed. Its sometimes required to + * call these functions both for normal operations, and in response to + * a cpu being added/removed. If the context of the call is in the same + * thread context as a CPU hotplug thread, we dont need to take the lock + * since its already protected + * check drivers/cpufreq/cpufreq.c for its usage - Ashok Raj + */ -static int __lock_cpu_hotplug(int interruptible) +int current_in_cpu_hotplug(void) { - int ret = 0; - - if (lock_cpu_hotplug_owner != current) { - if (interruptible) - ret = down_interruptible(&cpucontrol); - else - down(&cpucontrol); - } - - /* - * Set only if we succeed in locking - */ - if (!ret) { - lock_cpu_hotplug_depth++; - lock_cpu_hotplug_owner = current; - } - - return ret; + return (current->flags & PF_HOTPLUG_CPU); } -void lock_cpu_hotplug(void) -{ - __lock_cpu_hotplug(0); -} -EXPORT_SYMBOL_GPL(lock_cpu_hotplug); +EXPORT_SYMBOL_GPL(current_in_cpu_hotplug); -void unlock_cpu_hotplug(void) -{ - if (--lock_cpu_hotplug_depth == 0) { - lock_cpu_hotplug_owner = NULL; - up(&cpucontrol); - } -} -EXPORT_SYMBOL_GPL(unlock_cpu_hotplug); - -int lock_cpu_hotplug_interruptible(void) -{ - return __lock_cpu_hotplug(1); -} -EXPORT_SYMBOL_GPL(lock_cpu_hotplug_interruptible); -#endif /* CONFIG_HOTPLUG_CPU */ /* Need to know about CPUs going up/down? */ int register_cpu_notifier(struct notifier_block *nb) { int ret; - if ((ret = lock_cpu_hotplug_interruptible()) != 0) + if ((ret = down_interruptible(&cpucontrol)) != 0) return ret; ret = notifier_chain_register(&cpu_chain, nb); - unlock_cpu_hotplug(); + up(&cpucontrol); return ret; } EXPORT_SYMBOL(register_cpu_notifier); void unregister_cpu_notifier(struct notifier_block *nb) { - lock_cpu_hotplug(); + down(&cpucontrol); notifier_chain_unregister(&cpu_chain, nb); - unlock_cpu_hotplug(); + up(&cpucontrol); } EXPORT_SYMBOL(unregister_cpu_notifier); @@ -141,6 +112,13 @@ int cpu_down(unsigned int cpu) goto out; } + /* + * Leave a trace in current->flags indicating we are already in + * process of performing CPU hotplug. Callers can check if cpucontrol + * is already acquired by current thread, and if so not cause + * a dead lock by not acquiring the lock + */ + current->flags |= PF_HOTPLUG_CPU; err = notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE, (void *)(long)cpu); if (err == NOTIFY_BAD) { @@ -193,6 +171,7 @@ int cpu_down(unsigned int cpu) out_allowed: set_cpus_allowed(current, old_allowed); out: + current->flags &= ~PF_HOTPLUG_CPU; unlock_cpu_hotplug(); return err; } @@ -203,7 +182,7 @@ int __devinit cpu_up(unsigned int cpu) int ret; void *hcpu = (void *)(long)cpu; - if ((ret = lock_cpu_hotplug_interruptible()) != 0) + if ((ret = down_interruptible(&cpucontrol)) != 0) return ret; if (cpu_online(cpu) || !cpu_present(cpu)) { @@ -211,6 +190,11 @@ int __devinit cpu_up(unsigned int cpu) goto out; } + /* + * Leave a trace in current->flags indicating we are already in + * process of performing CPU hotplug. + */ + current->flags |= PF_HOTPLUG_CPU; ret = notifier_call_chain(&cpu_chain, CPU_UP_PREPARE, hcpu); if (ret == NOTIFY_BAD) { printk("%s: attempt to bring up CPU %u failed\n", @@ -233,6 +217,7 @@ int __devinit cpu_up(unsigned int cpu) if (ret != 0) notifier_call_chain(&cpu_chain, CPU_UP_CANCELED, hcpu); out: - unlock_cpu_hotplug(); + current->flags &= ~PF_HOTPLUG_CPU; + up(&cpucontrol); return ret; } diff --git a/trunk/kernel/cpuset.c b/trunk/kernel/cpuset.c index 7430640f9816..5a737ed9dac7 100644 --- a/trunk/kernel/cpuset.c +++ b/trunk/kernel/cpuset.c @@ -1809,12 +1809,11 @@ int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) if (gfp_mask & __GFP_HARDWALL) /* If hardwall request, stop here */ return 0; - if (current->flags & PF_EXITING) /* Let dying task have memory */ - return 1; - /* Not hardwall and node outside mems_allowed: scan up cpusets */ down(&callback_sem); + if (current->flags & PF_EXITING) /* Let dying task have memory */ + return 1; task_lock(current); cs = nearest_exclusive_ancestor(current->cpuset); task_unlock(current); diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index ee515683b92d..452a1d116178 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -859,7 +859,7 @@ fastcall NORET_TYPE void do_exit(long code) if (group_dead && tsk->signal->leader) disassociate_ctty(1); - module_put(task_thread_info(tsk)->exec_domain->module); + module_put(tsk->thread_info->exec_domain->module); if (tsk->binfmt) module_put(tsk->binfmt->module); diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index fb8572a42297..158710d22566 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -171,9 +171,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) return NULL; } + *ti = *orig->thread_info; *tsk = *orig; tsk->thread_info = ti; - setup_thread_stack(tsk, orig); + ti->task = tsk; /* One for us, one for whoever does the "release_task()" (usually parent) */ atomic_set(&tsk->usage,2); @@ -263,7 +264,7 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) rb_parent = &tmp->vm_rb; mm->map_count++; - retval = copy_page_range(mm, oldmm, mpnt); + retval = copy_page_range(mm, oldmm, tmp); if (tmp->vm_ops && tmp->vm_ops->open) tmp->vm_ops->open(tmp); @@ -323,6 +324,7 @@ static struct mm_struct * mm_init(struct mm_struct * mm) spin_lock_init(&mm->page_table_lock); rwlock_init(&mm->ioctx_list_lock); mm->ioctx_list = NULL; + mm->default_kioctx = (struct kioctx)INIT_KIOCTX(mm->default_kioctx, *mm); mm->free_area_cache = TASK_UNMAPPED_BASE; mm->cached_hole_size = ~0UL; @@ -917,7 +919,7 @@ static task_t *copy_process(unsigned long clone_flags, if (nr_threads >= max_threads) goto bad_fork_cleanup_count; - if (!try_module_get(task_thread_info(p)->exec_domain->module)) + if (!try_module_get(p->thread_info->exec_domain->module)) goto bad_fork_cleanup_count; if (p->binfmt && !try_module_get(p->binfmt->module)) @@ -1124,6 +1126,8 @@ static task_t *copy_process(unsigned long clone_flags, if (unlikely(p->ptrace & PT_PTRACED)) __ptrace_link(p, current->parent); + cpuset_fork(p); + attach_pid(p, PIDTYPE_PID, p->pid); attach_pid(p, PIDTYPE_TGID, p->tgid); if (thread_group_leader(p)) { @@ -1133,14 +1137,13 @@ static task_t *copy_process(unsigned long clone_flags, __get_cpu_var(process_counts)++; } + proc_fork_connector(p); if (!current->signal->tty && p->signal->tty) p->signal->tty = NULL; nr_threads++; total_forks++; write_unlock_irq(&tasklist_lock); - proc_fork_connector(p); - cpuset_fork(p); retval = 0; fork_out: @@ -1177,7 +1180,7 @@ static task_t *copy_process(unsigned long clone_flags, if (p->binfmt) module_put(p->binfmt->module); bad_fork_cleanup_put_domain: - module_put(task_thread_info(p)->exec_domain->module); + module_put(p->thread_info->exec_domain->module); bad_fork_cleanup_count: put_group_info(p->group_info); atomic_dec(&p->user->processes); diff --git a/trunk/kernel/futex.c b/trunk/kernel/futex.c index 5e71a6bf6f6b..aca8d10704f6 100644 --- a/trunk/kernel/futex.c +++ b/trunk/kernel/futex.c @@ -201,6 +201,21 @@ static int get_futex_key(unsigned long uaddr, union futex_key *key) * from swap. But that's a lot of code to duplicate here * for a rare case, so we simply fetch the page. */ + + /* + * Do a quick atomic lookup first - this is the fastpath. + */ + page = follow_page(mm, uaddr, FOLL_TOUCH|FOLL_GET); + if (likely(page != NULL)) { + key->shared.pgoff = + page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); + put_page(page); + return 0; + } + + /* + * Do it the general way. + */ err = get_user_pages(current, mm, uaddr, 1, 0, 0, &page, NULL); if (err >= 0) { key->shared.pgoff = @@ -270,13 +285,7 @@ static void wake_futex(struct futex_q *q) /* * The waiting task can free the futex_q as soon as this is written, * without taking any locks. This must come last. - * - * A memory barrier is required here to prevent the following store - * to lock_ptr from getting ahead of the wakeup. Clearing the lock - * at the end of wake_up_all() does not prevent this store from - * moving. */ - wmb(); q->lock_ptr = NULL; } diff --git a/trunk/kernel/irq/manage.c b/trunk/kernel/irq/manage.c index 81c49a4d679e..3bd7226d15fa 100644 --- a/trunk/kernel/irq/manage.c +++ b/trunk/kernel/irq/manage.c @@ -36,9 +36,6 @@ void synchronize_irq(unsigned int irq) { struct irq_desc *desc = irq_desc + irq; - if (irq >= NR_IRQS) - return; - while (desc->status & IRQ_INPROGRESS) cpu_relax(); } @@ -63,9 +60,6 @@ void disable_irq_nosync(unsigned int irq) irq_desc_t *desc = irq_desc + irq; unsigned long flags; - if (irq >= NR_IRQS) - return; - spin_lock_irqsave(&desc->lock, flags); if (!desc->depth++) { desc->status |= IRQ_DISABLED; @@ -92,9 +86,6 @@ void disable_irq(unsigned int irq) { irq_desc_t *desc = irq_desc + irq; - if (irq >= NR_IRQS) - return; - disable_irq_nosync(irq); if (desc->action) synchronize_irq(irq); @@ -117,9 +108,6 @@ void enable_irq(unsigned int irq) irq_desc_t *desc = irq_desc + irq; unsigned long flags; - if (irq >= NR_IRQS) - return; - spin_lock_irqsave(&desc->lock, flags); switch (desc->depth) { case 0: @@ -175,9 +163,6 @@ int setup_irq(unsigned int irq, struct irqaction * new) unsigned long flags; int shared = 0; - if (irq >= NR_IRQS) - return -EINVAL; - if (desc->handler == &no_irq_type) return -ENOSYS; /* diff --git a/trunk/kernel/kprobes.c b/trunk/kernel/kprobes.c index 3bb71e63a37e..5beda378cc75 100644 --- a/trunk/kernel/kprobes.c +++ b/trunk/kernel/kprobes.c @@ -246,19 +246,6 @@ static int __kprobes aggr_break_handler(struct kprobe *p, struct pt_regs *regs) return ret; } -/* Walks the list and increments nmissed count for multiprobe case */ -void __kprobes kprobes_inc_nmissed_count(struct kprobe *p) -{ - struct kprobe *kp; - if (p->pre_handler != aggr_pre_handler) { - p->nmissed++; - } else { - list_for_each_entry_rcu(kp, &p->list, list) - kp->nmissed++; - } - return; -} - /* Called with kretprobe_lock held */ struct kretprobe_instance __kprobes *get_free_rp_inst(struct kretprobe *rp) { @@ -412,7 +399,10 @@ static inline void add_aggr_kprobe(struct kprobe *ap, struct kprobe *p) INIT_LIST_HEAD(&ap->list); list_add_rcu(&p->list, &ap->list); - hlist_replace_rcu(&p->hlist, &ap->hlist); + INIT_HLIST_NODE(&ap->hlist); + hlist_del_rcu(&p->hlist); + hlist_add_head_rcu(&ap->hlist, + &kprobe_table[hash_ptr(ap->addr, KPROBE_HASH_BITS)]); } /* @@ -472,16 +462,9 @@ int __kprobes register_kprobe(struct kprobe *p) int ret = 0; unsigned long flags = 0; struct kprobe *old_p; - struct module *mod; - - if ((!kernel_text_address((unsigned long) p->addr)) || - in_kprobes_functions((unsigned long) p->addr)) - return -EINVAL; - - if ((mod = module_text_address((unsigned long) p->addr)) && - (unlikely(!try_module_get(mod)))) - return -EINVAL; + if ((ret = in_kprobes_functions((unsigned long) p->addr)) != 0) + return ret; if ((ret = arch_prepare_kprobe(p)) != 0) goto rm_kprobe; @@ -505,8 +488,6 @@ int __kprobes register_kprobe(struct kprobe *p) rm_kprobe: if (ret == -EEXIST) arch_remove_kprobe(p); - if (ret && mod) - module_put(mod); return ret; } @@ -514,7 +495,6 @@ void __kprobes unregister_kprobe(struct kprobe *p) { unsigned long flags; struct kprobe *old_p; - struct module *mod; spin_lock_irqsave(&kprobe_lock, flags); old_p = get_kprobe(p->addr); @@ -526,10 +506,6 @@ void __kprobes unregister_kprobe(struct kprobe *p) cleanup_kprobe(p, flags); synchronize_sched(); - - if ((mod = module_text_address((unsigned long)p->addr))) - module_put(mod); - if (old_p->pre_handler == aggr_pre_handler && list_empty(&old_p->list)) kfree(old_p); diff --git a/trunk/kernel/params.c b/trunk/kernel/params.c index c76ad25e6a21..47ba69547945 100644 --- a/trunk/kernel/params.c +++ b/trunk/kernel/params.c @@ -619,7 +619,7 @@ static void __init param_sysfs_builtin(void) /* module-related sysfs stuff */ -#ifdef CONFIG_SYSFS +#ifdef CONFIG_MODULES #define to_module_attr(n) container_of(n, struct module_attribute, attr); #define to_module_kobject(n) container_of(n, struct module_kobject, kobj); diff --git a/trunk/kernel/posix-cpu-timers.c b/trunk/kernel/posix-cpu-timers.c index cae4f5728997..84af54c39e1b 100644 --- a/trunk/kernel/posix-cpu-timers.c +++ b/trunk/kernel/posix-cpu-timers.c @@ -36,7 +36,7 @@ timespec_to_sample(clockid_t which_clock, const struct timespec *tp) union cpu_time_count ret; ret.sched = 0; /* high half always zero when .cpu used */ if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) { - ret.sched = (unsigned long long)tp->tv_sec * NSEC_PER_SEC + tp->tv_nsec; + ret.sched = tp->tv_sec * NSEC_PER_SEC + tp->tv_nsec; } else { ret.cpu = timespec_to_cputime(tp); } diff --git a/trunk/kernel/posix-timers.c b/trunk/kernel/posix-timers.c index 5870efb3e200..ea55c7a1cd75 100644 --- a/trunk/kernel/posix-timers.c +++ b/trunk/kernel/posix-timers.c @@ -270,7 +270,7 @@ static void tstojiffie(struct timespec *tp, int res, u64 *jiff) long sec = tp->tv_sec; long nsec = tp->tv_nsec + res - 1; - if (nsec >= NSEC_PER_SEC) { + if (nsec > NSEC_PER_SEC) { sec++; nsec -= NSEC_PER_SEC; } @@ -1209,9 +1209,13 @@ static int do_posix_clock_monotonic_get(clockid_t clock, struct timespec *tp) do_posix_clock_monotonic_gettime_parts(tp, &wall_to_mono); - set_normalized_timespec(tp, tp->tv_sec + wall_to_mono.tv_sec, - tp->tv_nsec + wall_to_mono.tv_nsec); + tp->tv_sec += wall_to_mono.tv_sec; + tp->tv_nsec += wall_to_mono.tv_nsec; + if ((tp->tv_nsec - NSEC_PER_SEC) > 0) { + tp->tv_nsec -= NSEC_PER_SEC; + tp->tv_sec++; + } return 0; } diff --git a/trunk/kernel/power/Kconfig b/trunk/kernel/power/Kconfig index 5ec248cb7f4a..46a5e5acff97 100644 --- a/trunk/kernel/power/Kconfig +++ b/trunk/kernel/power/Kconfig @@ -19,15 +19,6 @@ config PM will issue the hlt instruction if nothing is to be done, thereby sending the processor to sleep and saving power. -config PM_LEGACY - bool "Legacy Power Management API" - depends on PM - default y - ---help--- - Support for pm_register() and friends. - - If unsure, say Y. - config PM_DEBUG bool "Power Management Debug Support" depends on PM diff --git a/trunk/kernel/power/Makefile b/trunk/kernel/power/Makefile index 04be7d0d96a7..c71eb4579c07 100644 --- a/trunk/kernel/power/Makefile +++ b/trunk/kernel/power/Makefile @@ -3,8 +3,7 @@ ifeq ($(CONFIG_PM_DEBUG),y) EXTRA_CFLAGS += -DDEBUG endif -obj-y := main.o process.o console.o -obj-$(CONFIG_PM_LEGACY) += pm.o +obj-y := main.o process.o console.o pm.o obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o disk.o snapshot.o obj-$(CONFIG_SUSPEND_SMP) += smp.o diff --git a/trunk/kernel/power/main.c b/trunk/kernel/power/main.c index d253f3ae2fa5..6ee2cad530e8 100644 --- a/trunk/kernel/power/main.c +++ b/trunk/kernel/power/main.c @@ -24,7 +24,7 @@ DECLARE_MUTEX(pm_sem); -struct pm_ops *pm_ops; +struct pm_ops * pm_ops = NULL; suspend_disk_method_t pm_disk_mode = PM_DISK_SHUTDOWN; /** @@ -151,18 +151,6 @@ static char *pm_states[PM_SUSPEND_MAX] = { #endif }; -static inline int valid_state(suspend_state_t state) -{ - /* Suspend-to-disk does not really need low-level support. - * It can work with reboot if needed. */ - if (state == PM_SUSPEND_DISK) - return 1; - - if (pm_ops && pm_ops->valid && !pm_ops->valid(state)) - return 0; - return 1; -} - /** * enter_state - Do common work of entering low-power state. @@ -179,7 +167,7 @@ static int enter_state(suspend_state_t state) { int error; - if (!valid_state(state)) + if (pm_ops && pm_ops->valid && !pm_ops->valid(state)) return -ENODEV; if (down_trylock(&pm_sem)) return -EBUSY; @@ -250,8 +238,9 @@ static ssize_t state_show(struct subsystem * subsys, char * buf) char * s = buf; for (i = 0; i < PM_SUSPEND_MAX; i++) { - if (pm_states[i] && valid_state(i)) - s += sprintf(s,"%s ", pm_states[i]); + if (pm_states[i] && pm_ops && (!pm_ops->valid + ||(pm_ops->valid && pm_ops->valid(i)))) + s += sprintf(s,"%s ",pm_states[i]); } s += sprintf(s,"\n"); return (s - buf); diff --git a/trunk/kernel/power/pm.c b/trunk/kernel/power/pm.c index 33c508e857dd..159149321b3c 100644 --- a/trunk/kernel/power/pm.c +++ b/trunk/kernel/power/pm.c @@ -23,7 +23,6 @@ #include #include #include -#include #include int pm_active; diff --git a/trunk/kernel/printk.c b/trunk/kernel/printk.c index 5287be83e3e7..e9be027bc930 100644 --- a/trunk/kernel/printk.c +++ b/trunk/kernel/printk.c @@ -491,10 +491,7 @@ __attribute__((weak)) unsigned long long printk_clock(void) return sched_clock(); } -/** - * printk - print a kernel message - * @fmt: format string - * +/* * This is printk. It can be called from any context. We want it to work. * * We try to grab the console_sem. If we succeed, it's easy - we log the output and @@ -506,9 +503,6 @@ __attribute__((weak)) unsigned long long printk_clock(void) * One effect of this deferred printing is that code which calls printk() and * then changes console_loglevel may break. This is because console_loglevel * is inspected when the actual printing occurs. - * - * See also: - * printf(3) */ asmlinkage int printk(const char *fmt, ...) @@ -661,9 +655,6 @@ static void call_console_drivers(unsigned long start, unsigned long end) /** * add_preferred_console - add a device to the list of preferred consoles. - * @name: device name - * @idx: device index - * @options: options for this console * * The last preferred console added will be used for kernel messages * and stdin/out/err for init. Normally this is used by console_setup @@ -773,8 +764,7 @@ void release_console_sem(void) } EXPORT_SYMBOL(release_console_sem); -/** - * console_conditional_schedule - yield the CPU if required +/** console_conditional_schedule - yield the CPU if required * * If the console code is currently allowed to sleep, and * if this CPU should yield the CPU to another task, do @@ -956,7 +946,7 @@ int unregister_console(struct console *console) if (console_drivers == console) { console_drivers=console->next; res = 0; - } else if (console_drivers) { + } else { for (a=console_drivers->next, b=console_drivers ; a; b=a, a=b->next) { if (a == console) { @@ -986,8 +976,6 @@ EXPORT_SYMBOL(unregister_console); /** * tty_write_message - write a message to a certain tty, not just the console. - * @tty: the destination tty_struct - * @msg: the message to write * * This is used for messages that need to be redirected to a specific tty. * We don't put it into the syslog queue right now maybe in the future if diff --git a/trunk/kernel/ptrace.c b/trunk/kernel/ptrace.c index 656476eedb1b..b88d4186cd7a 100644 --- a/trunk/kernel/ptrace.c +++ b/trunk/kernel/ptrace.c @@ -241,8 +241,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in if (write) { copy_to_user_page(vma, page, addr, maddr + offset, buf, bytes); - if (!PageCompound(page)) - set_page_dirty_lock(page); + set_page_dirty_lock(page); } else { copy_from_user_page(vma, page, addr, buf, maddr + offset, bytes); @@ -471,7 +470,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data) if (request == PTRACE_ATTACH) { ret = ptrace_attach(child); - goto out_put_task_struct; + goto out; } ret = ptrace_check_attach(child, request == PTRACE_KILL); diff --git a/trunk/kernel/rcupdate.c b/trunk/kernel/rcupdate.c index 48d3bce465b8..c4d159a21e04 100644 --- a/trunk/kernel/rcupdate.c +++ b/trunk/kernel/rcupdate.c @@ -116,10 +116,6 @@ void fastcall call_rcu(struct rcu_head *head, local_irq_restore(flags); } -static atomic_t rcu_barrier_cpu_count; -static struct semaphore rcu_barrier_sema; -static struct completion rcu_barrier_completion; - /** * call_rcu_bh - Queue an RCU for invocation after a quicker grace period. * @head: structure to be used for queueing the RCU updates. @@ -166,42 +162,6 @@ long rcu_batches_completed(void) return rcu_ctrlblk.completed; } -static void rcu_barrier_callback(struct rcu_head *notused) -{ - if (atomic_dec_and_test(&rcu_barrier_cpu_count)) - complete(&rcu_barrier_completion); -} - -/* - * Called with preemption disabled, and from cross-cpu IRQ context. - */ -static void rcu_barrier_func(void *notused) -{ - int cpu = smp_processor_id(); - struct rcu_data *rdp = &per_cpu(rcu_data, cpu); - struct rcu_head *head; - - head = &rdp->barrier; - atomic_inc(&rcu_barrier_cpu_count); - call_rcu(head, rcu_barrier_callback); -} - -/** - * rcu_barrier - Wait until all the in-flight RCUs are complete. - */ -void rcu_barrier(void) -{ - BUG_ON(in_interrupt()); - /* Take cpucontrol semaphore to protect against CPU hotplug */ - down(&rcu_barrier_sema); - init_completion(&rcu_barrier_completion); - atomic_set(&rcu_barrier_cpu_count, 0); - on_each_cpu(rcu_barrier_func, NULL, 0, 1); - wait_for_completion(&rcu_barrier_completion); - up(&rcu_barrier_sema); -} -EXPORT_SYMBOL_GPL(rcu_barrier); - /* * Invoke the completed RCU callbacks. They are expected to be in * a per-cpu list. @@ -257,23 +217,15 @@ static void rcu_start_batch(struct rcu_ctrlblk *rcp, struct rcu_state *rsp, if (rcp->next_pending && rcp->completed == rcp->cur) { + /* Can't change, since spin lock held. */ + cpus_andnot(rsp->cpumask, cpu_online_map, nohz_cpu_mask); + rcp->next_pending = 0; - /* - * next_pending == 0 must be visible in - * __rcu_process_callbacks() before it can see new value of cur. + /* next_pending == 0 must be visible in __rcu_process_callbacks() + * before it can see new value of cur. */ smp_wmb(); rcp->cur++; - - /* - * Accessing nohz_cpu_mask before incrementing rcp->cur needs a - * Barrier Otherwise it can cause tickless idle CPUs to be - * included in rsp->cpumask, which will extend graceperiods - * unnecessarily. - */ - smp_mb(); - cpus_andnot(rsp->cpumask, cpu_online_map, nohz_cpu_mask); - } } @@ -505,7 +457,6 @@ static struct notifier_block __devinitdata rcu_nb = { */ void __init rcu_init(void) { - sema_init(&rcu_barrier_sema, 1); rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE, (void *)(long)smp_processor_id()); /* Register notifier for non-boot CPUs */ diff --git a/trunk/kernel/rcutorture.c b/trunk/kernel/rcutorture.c index 49fbbeff201c..9b58f1eff3ca 100644 --- a/trunk/kernel/rcutorture.c +++ b/trunk/kernel/rcutorture.c @@ -80,7 +80,6 @@ struct rcu_torture { struct rcu_head rtort_rcu; int rtort_pipe_count; struct list_head rtort_free; - int rtort_mbtest; }; static int fullstop = 0; /* stop generating callbacks at test end. */ @@ -97,8 +96,6 @@ static atomic_t rcu_torture_wcount[RCU_TORTURE_PIPE_LEN + 1]; atomic_t n_rcu_torture_alloc; atomic_t n_rcu_torture_alloc_fail; atomic_t n_rcu_torture_free; -atomic_t n_rcu_torture_mberror; -atomic_t n_rcu_torture_error; /* * Allocate an element from the rcu_tortures pool. @@ -148,10 +145,9 @@ rcu_torture_cb(struct rcu_head *p) if (i > RCU_TORTURE_PIPE_LEN) i = RCU_TORTURE_PIPE_LEN; atomic_inc(&rcu_torture_wcount[i]); - if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) { - rp->rtort_mbtest = 0; + if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) rcu_torture_free(rp); - } else + else call_rcu(p, rcu_torture_cb); } @@ -199,8 +195,6 @@ rcu_torture_writer(void *arg) static DEFINE_RCU_RANDOM(rand); VERBOSE_PRINTK_STRING("rcu_torture_writer task started"); - set_user_nice(current, 19); - do { schedule_timeout_uninterruptible(1); if (rcu_batches_completed() == oldbatch) @@ -210,7 +204,6 @@ rcu_torture_writer(void *arg) rp->rtort_pipe_count = 0; udelay(rcu_random(&rand) & 0x3ff); old_rp = rcu_torture_current; - rp->rtort_mbtest = 1; rcu_assign_pointer(rcu_torture_current, rp); smp_wmb(); if (old_rp != NULL) { @@ -245,8 +238,6 @@ rcu_torture_reader(void *arg) int pipe_count; VERBOSE_PRINTK_STRING("rcu_torture_reader task started"); - set_user_nice(current, 19); - do { rcu_read_lock(); completed = rcu_batches_completed(); @@ -257,8 +248,6 @@ rcu_torture_reader(void *arg) schedule_timeout_interruptible(HZ); continue; } - if (p->rtort_mbtest == 0) - atomic_inc(&n_rcu_torture_mberror); udelay(rcu_random(&rand) & 0x7f); preempt_disable(); pipe_count = p->rtort_pipe_count; @@ -307,22 +296,16 @@ rcu_torture_printk(char *page) } cnt += sprintf(&page[cnt], "rcutorture: "); cnt += sprintf(&page[cnt], - "rtc: %p ver: %ld tfle: %d rta: %d rtaf: %d rtf: %d " - "rtmbe: %d", + "rtc: %p ver: %ld tfle: %d rta: %d rtaf: %d rtf: %d", rcu_torture_current, rcu_torture_current_version, list_empty(&rcu_torture_freelist), atomic_read(&n_rcu_torture_alloc), atomic_read(&n_rcu_torture_alloc_fail), - atomic_read(&n_rcu_torture_free), - atomic_read(&n_rcu_torture_mberror)); - if (atomic_read(&n_rcu_torture_mberror) != 0) - cnt += sprintf(&page[cnt], " !!!"); + atomic_read(&n_rcu_torture_free)); cnt += sprintf(&page[cnt], "\nrcutorture: "); - if (i > 1) { + if (i > 1) cnt += sprintf(&page[cnt], "!!! "); - atomic_inc(&n_rcu_torture_error); - } cnt += sprintf(&page[cnt], "Reader Pipe: "); for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) cnt += sprintf(&page[cnt], " %ld", pipesummary[i]); @@ -409,12 +392,11 @@ rcu_torture_cleanup(void) stats_task = NULL; /* Wait for all RCU callbacks to fire. */ - rcu_barrier(); + for (i = 0; i < RCU_TORTURE_PIPE_LEN; i++) + synchronize_rcu(); rcu_torture_stats_print(); /* -After- the stats thread is stopped! */ - printk(KERN_ALERT TORTURE_FLAG - "--- End of test: %s\n", - atomic_read(&n_rcu_torture_error) == 0 ? "SUCCESS" : "FAILURE"); + PRINTK_STRING("--- End of test"); } static int @@ -439,7 +421,6 @@ rcu_torture_init(void) INIT_LIST_HEAD(&rcu_torture_freelist); for (i = 0; i < sizeof(rcu_tortures) / sizeof(rcu_tortures[0]); i++) { - rcu_tortures[i].rtort_mbtest = 0; list_add_tail(&rcu_tortures[i].rtort_free, &rcu_torture_freelist); } @@ -451,8 +432,6 @@ rcu_torture_init(void) atomic_set(&n_rcu_torture_alloc, 0); atomic_set(&n_rcu_torture_alloc_fail, 0); atomic_set(&n_rcu_torture_free, 0); - atomic_set(&n_rcu_torture_mberror, 0); - atomic_set(&n_rcu_torture_error, 0); for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) atomic_set(&rcu_torture_wcount[i], 0); for_each_cpu(cpu) { diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 6f46c94cc29e..b6506671b2be 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -1437,7 +1437,7 @@ void fastcall sched_fork(task_t *p, int clone_flags) #endif #ifdef CONFIG_PREEMPT /* Want to start with kernel preemption disabled. */ - task_thread_info(p)->preempt_count = 1; + p->thread_info->preempt_count = 1; #endif /* * Share the timeslice between parent and child, thus the @@ -4327,10 +4327,10 @@ static void show_task(task_t *p) #endif #ifdef CONFIG_DEBUG_STACK_USAGE { - unsigned long *n = end_of_stack(p); + unsigned long *n = (unsigned long *) (p->thread_info+1); while (!*n) n++; - free = (unsigned long)n - (unsigned long)end_of_stack(p); + free = (unsigned long) n - (unsigned long)(p->thread_info+1); } #endif printk("%5lu %5d %6d ", free, p->pid, p->parent->pid); @@ -4410,9 +4410,9 @@ void __devinit init_idle(task_t *idle, int cpu) /* Set the preempt count _outside_ the spinlocks! */ #if defined(CONFIG_PREEMPT) && !defined(CONFIG_PREEMPT_BKL) - task_thread_info(idle)->preempt_count = (idle->lock_depth >= 0); + idle->thread_info->preempt_count = (idle->lock_depth >= 0); #else - task_thread_info(idle)->preempt_count = 0; + idle->thread_info->preempt_count = 0; #endif } diff --git a/trunk/kernel/signal.c b/trunk/kernel/signal.c index d7611f189ef7..80789a59b4db 100644 --- a/trunk/kernel/signal.c +++ b/trunk/kernel/signal.c @@ -513,7 +513,16 @@ static int __dequeue_signal(struct sigpending *pending, sigset_t *mask, { int sig = 0; - sig = next_signal(pending, mask); + /* SIGKILL must have priority, otherwise it is quite easy + * to create an unkillable process, sending sig < SIGKILL + * to self */ + if (unlikely(sigismember(&pending->signal, SIGKILL))) { + if (!sigismember(mask, SIGKILL)) + sig = SIGKILL; + } + + if (likely(!sig)) + sig = next_signal(pending, mask); if (sig) { if (current->notifier) { if (sigismember(current->notifier_mask, sig)) { diff --git a/trunk/kernel/stop_machine.c b/trunk/kernel/stop_machine.c index b3d4dc858e35..84a9d18aa8da 100644 --- a/trunk/kernel/stop_machine.c +++ b/trunk/kernel/stop_machine.c @@ -119,12 +119,13 @@ static int stop_machine(void) return ret; } + /* Don't schedule us away at this point, please. */ + local_irq_disable(); + /* Now they are all started, make them hold the CPUs, ready. */ - preempt_disable(); stopmachine_set_state(STOPMACHINE_PREPARE); /* Make them disable irqs. */ - local_irq_disable(); stopmachine_set_state(STOPMACHINE_DISABLE_IRQ); return 0; @@ -134,7 +135,6 @@ static void restart_machine(void) { stopmachine_set_state(STOPMACHINE_EXIT); local_irq_enable(); - preempt_enable_no_resched(); } struct stop_machine_data diff --git a/trunk/kernel/sys.c b/trunk/kernel/sys.c index eecf84526afe..bce933ebb29f 100644 --- a/trunk/kernel/sys.c +++ b/trunk/kernel/sys.c @@ -32,7 +32,6 @@ #include #include -#include #include #include @@ -169,7 +168,7 @@ EXPORT_SYMBOL(notifier_chain_unregister); * of the last notifier function called. */ -int __kprobes notifier_call_chain(struct notifier_block **n, unsigned long val, void *v) +int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v) { int ret=NOTIFY_DONE; struct notifier_block *nb = *n; diff --git a/trunk/kernel/sysctl.c b/trunk/kernel/sysctl.c index b53115b882e1..9990e10192e8 100644 --- a/trunk/kernel/sysctl.c +++ b/trunk/kernel/sysctl.c @@ -2192,32 +2192,29 @@ int sysctl_string(ctl_table *table, int __user *name, int nlen, void __user *oldval, size_t __user *oldlenp, void __user *newval, size_t newlen, void **context) { + size_t l, len; + if (!table->data || !table->maxlen) return -ENOTDIR; if (oldval && oldlenp) { - size_t bufsize; - if (get_user(bufsize, oldlenp)) + if (get_user(len, oldlenp)) return -EFAULT; - if (bufsize) { - size_t len = strlen(table->data), copied; - - /* This shouldn't trigger for a well-formed sysctl */ - if (len > table->maxlen) + if (len) { + l = strlen(table->data); + if (len > l) len = l; + if (len >= table->maxlen) len = table->maxlen; - - /* Copy up to a max of bufsize-1 bytes of the string */ - copied = (len >= bufsize) ? bufsize - 1 : len; - - if (copy_to_user(oldval, table->data, copied) || - put_user(0, (char __user *)(oldval + copied))) + if(copy_to_user(oldval, table->data, len)) + return -EFAULT; + if(put_user(0, ((char __user *) oldval) + len)) return -EFAULT; - if (put_user(len, oldlenp)) + if(put_user(len, oldlenp)) return -EFAULT; } } if (newval && newlen) { - size_t len = newlen; + len = newlen; if (len > table->maxlen) len = table->maxlen; if(copy_from_user(table->data, newval, len)) @@ -2226,7 +2223,7 @@ int sysctl_string(ctl_table *table, int __user *name, int nlen, len--; ((char *) table->data)[len] = 0; } - return 1; + return 0; } /* diff --git a/trunk/kernel/time.c b/trunk/kernel/time.c index b94bfa8c03e0..245d595a13cb 100644 --- a/trunk/kernel/time.c +++ b/trunk/kernel/time.c @@ -561,28 +561,6 @@ void getnstimeofday(struct timespec *tv) EXPORT_SYMBOL_GPL(getnstimeofday); #endif -void getnstimestamp(struct timespec *ts) -{ - unsigned int seq; - struct timespec wall2mono; - - /* synchronize with settimeofday() changes */ - do { - seq = read_seqbegin(&xtime_lock); - getnstimeofday(ts); - wall2mono = wall_to_monotonic; - } while(unlikely(read_seqretry(&xtime_lock, seq))); - - /* adjust to monotonicaly-increasing values */ - ts->tv_sec += wall2mono.tv_sec; - ts->tv_nsec += wall2mono.tv_nsec; - while (unlikely(ts->tv_nsec >= NSEC_PER_SEC)) { - ts->tv_nsec -= NSEC_PER_SEC; - ts->tv_sec++; - } -} -EXPORT_SYMBOL_GPL(getnstimestamp); - #if (BITS_PER_LONG < 64) u64 get_jiffies_64(void) { diff --git a/trunk/kernel/workqueue.c b/trunk/kernel/workqueue.c index 2bd5aee1c736..42df83d7fad2 100644 --- a/trunk/kernel/workqueue.c +++ b/trunk/kernel/workqueue.c @@ -102,7 +102,7 @@ int fastcall queue_work(struct workqueue_struct *wq, struct work_struct *work) if (!test_and_set_bit(0, &work->pending)) { if (unlikely(is_single_threaded(wq))) - cpu = any_online_cpu(cpu_online_map); + cpu = 0; BUG_ON(!list_empty(&work->entry)); __queue_work(per_cpu_ptr(wq->cpu_wq, cpu), work); ret = 1; @@ -118,7 +118,7 @@ static void delayed_work_timer_fn(unsigned long __data) int cpu = smp_processor_id(); if (unlikely(is_single_threaded(wq))) - cpu = any_online_cpu(cpu_online_map); + cpu = 0; __queue_work(per_cpu_ptr(wq->cpu_wq, cpu), work); } @@ -266,8 +266,8 @@ void fastcall flush_workqueue(struct workqueue_struct *wq) might_sleep(); if (is_single_threaded(wq)) { - /* Always use first cpu's area. */ - flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, any_online_cpu(cpu_online_map))); + /* Always use cpu 0's area. */ + flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, 0)); } else { int cpu; @@ -320,7 +320,7 @@ struct workqueue_struct *__create_workqueue(const char *name, lock_cpu_hotplug(); if (singlethread) { INIT_LIST_HEAD(&wq->list); - p = create_workqueue_thread(wq, any_online_cpu(cpu_online_map)); + p = create_workqueue_thread(wq, 0); if (!p) destroy = 1; else @@ -374,7 +374,7 @@ void destroy_workqueue(struct workqueue_struct *wq) /* We don't need the distraction of CPUs appearing and vanishing. */ lock_cpu_hotplug(); if (is_single_threaded(wq)) - cleanup_workqueue_thread(wq, any_online_cpu(cpu_online_map)); + cleanup_workqueue_thread(wq, 0); else { for_each_online_cpu(cpu) cleanup_workqueue_thread(wq, cpu); diff --git a/trunk/lib/genalloc.c b/trunk/lib/genalloc.c index 9ce0a6a3b85a..d6d30d2e7166 100644 --- a/trunk/lib/genalloc.c +++ b/trunk/lib/genalloc.c @@ -95,10 +95,12 @@ unsigned long gen_pool_alloc(struct gen_pool *poolp, int size) if (size > max_chunk_size) return 0; + i = 0; + size = max(size, 1 << ALLOC_MIN_SHIFT); - i = fls(size - 1); - s = 1 << i; - j = i -= ALLOC_MIN_SHIFT; + s = roundup_pow_of_two(size); + + j = i; spin_lock_irqsave(&poolp->lock, flags); while (!h[j].next) { @@ -151,10 +153,10 @@ void gen_pool_free(struct gen_pool *poolp, unsigned long ptr, int size) if (size > max_chunk_size) return; + i = 0; + size = max(size, 1 << ALLOC_MIN_SHIFT); - i = fls(size - 1); - s = 1 << i; - i -= ALLOC_MIN_SHIFT; + s = roundup_pow_of_two(size); a = ptr; diff --git a/trunk/lib/spinlock_debug.c b/trunk/lib/spinlock_debug.c index dcd4be9bd4e5..906ad101eab3 100644 --- a/trunk/lib/spinlock_debug.c +++ b/trunk/lib/spinlock_debug.c @@ -20,8 +20,7 @@ static void spin_bug(spinlock_t *lock, const char *msg) if (lock->owner && lock->owner != SPINLOCK_OWNER_INIT) owner = lock->owner; printk("BUG: spinlock %s on CPU#%d, %s/%d\n", - msg, raw_smp_processor_id(), - current->comm, current->pid); + msg, smp_processor_id(), current->comm, current->pid); printk(" lock: %p, .magic: %08x, .owner: %s/%d, .owner_cpu: %d\n", lock, lock->magic, owner ? owner->comm : "", @@ -79,8 +78,8 @@ static void __spin_lock_debug(spinlock_t *lock) if (print_once) { print_once = 0; printk("BUG: spinlock lockup on CPU#%d, %s/%d, %p\n", - raw_smp_processor_id(), current->comm, - current->pid, lock); + smp_processor_id(), current->comm, current->pid, + lock); dump_stack(); } } @@ -121,8 +120,7 @@ static void rwlock_bug(rwlock_t *lock, const char *msg) if (xchg(&print_once, 0)) { printk("BUG: rwlock %s on CPU#%d, %s/%d, %p\n", msg, - raw_smp_processor_id(), current->comm, - current->pid, lock); + smp_processor_id(), current->comm, current->pid, lock); dump_stack(); #ifdef CONFIG_SMP /* @@ -150,8 +148,8 @@ static void __read_lock_debug(rwlock_t *lock) if (print_once) { print_once = 0; printk("BUG: read-lock lockup on CPU#%d, %s/%d, %p\n", - raw_smp_processor_id(), current->comm, - current->pid, lock); + smp_processor_id(), current->comm, current->pid, + lock); dump_stack(); } } @@ -222,8 +220,8 @@ static void __write_lock_debug(rwlock_t *lock) if (print_once) { print_once = 0; printk("BUG: write-lock lockup on CPU#%d, %s/%d, %p\n", - raw_smp_processor_id(), current->comm, - current->pid, lock); + smp_processor_id(), current->comm, current->pid, + lock); dump_stack(); } } diff --git a/trunk/lib/swiotlb.c b/trunk/lib/swiotlb.c index 1ff8dcebf7c6..57216f3544ca 100644 --- a/trunk/lib/swiotlb.c +++ b/trunk/lib/swiotlb.c @@ -704,9 +704,8 @@ swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems, addr = SG_ENT_VIRT_ADDRESS(sg); dev_addr = virt_to_phys(addr); if (swiotlb_force || address_needs_mapping(hwdev, dev_addr)) { - void *map = map_single(hwdev, addr, sg->length, dir); - sg->dma_address = virt_to_bus(map); - if (!map) { + sg->dma_address = (dma_addr_t) virt_to_phys(map_single(hwdev, addr, sg->length, dir)); + if (!sg->dma_address) { /* Don't panic here, we expect map_sg users to do proper error handling. */ swiotlb_full(hwdev, sg->length, dir, 0); diff --git a/trunk/mm/Kconfig b/trunk/mm/Kconfig index 21eb51d4da8f..ae9ce6b73e8a 100644 --- a/trunk/mm/Kconfig +++ b/trunk/mm/Kconfig @@ -125,10 +125,12 @@ comment "Memory hotplug is currently incompatible with Software Suspend" # space can be handled with less contention: split it at this NR_CPUS. # Default to 4 for wider testing, though 8 might be more appropriate. # ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock. -# PA-RISC 7xxx's spinlock_t would enlarge struct page from 32 to 44 bytes. +# PA-RISC's debug spinlock_t is too large for the 32-bit struct page. +# ARM26 and SPARC32 and PPC64 may use one page for multiple page tables. # config SPLIT_PTLOCK_CPUS int default "4096" if ARM && !CPU_CACHE_VIPT - default "4096" if PARISC && !PA20 + default "4096" if PARISC && DEBUG_SPINLOCK && !64BIT + default "4096" if ARM26 || SPARC32 || PPC64 default "4" diff --git a/trunk/mm/bootmem.c b/trunk/mm/bootmem.c index 16b9465eb4eb..e8c567177dcf 100644 --- a/trunk/mm/bootmem.c +++ b/trunk/mm/bootmem.c @@ -204,8 +204,6 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size, unsigned long j; i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i); i = ALIGN(i, incr); - if (i >= eidx) - break; if (test_bit(i, bdata->node_bootmem_map)) continue; for (j = i + 1; j < i + areasize; ++j) { diff --git a/trunk/mm/filemap.c b/trunk/mm/filemap.c index 33a28bfde158..5d6e4c2000dc 100644 --- a/trunk/mm/filemap.c +++ b/trunk/mm/filemap.c @@ -134,7 +134,7 @@ static int sync_page(void *word) struct address_space *mapping; struct page *page; - page = container_of((unsigned long *)word, struct page, flags); + page = container_of((page_flags_t *)word, struct page, flags); /* * page_mapping() is being called without PG_locked held. diff --git a/trunk/mm/fremap.c b/trunk/mm/fremap.c index 9f381e58bf44..d862be3bc3e3 100644 --- a/trunk/mm/fremap.c +++ b/trunk/mm/fremap.c @@ -27,20 +27,24 @@ static int zap_pte(struct mm_struct *mm, struct vm_area_struct *vma, struct page *page = NULL; if (pte_present(pte)) { - flush_cache_page(vma, addr, pte_pfn(pte)); + unsigned long pfn = pte_pfn(pte); + flush_cache_page(vma, addr, pfn); pte = ptep_clear_flush(vma, addr, ptep); - page = vm_normal_page(vma, addr, pte); - if (page) { - if (pte_dirty(pte)) - set_page_dirty(page); - page_remove_rmap(page); - page_cache_release(page); + if (unlikely(!pfn_valid(pfn))) { + print_bad_pte(vma, pte, addr); + goto out; } + page = pfn_to_page(pfn); + if (pte_dirty(pte)) + set_page_dirty(page); + page_remove_rmap(page); + page_cache_release(page); } else { if (!pte_file(pte)) free_swap_and_cache(pte_to_swp_entry(pte)); pte_clear(mm, addr, ptep); } +out: return !!page; } @@ -55,10 +59,22 @@ int install_page(struct mm_struct *mm, struct vm_area_struct *vma, pgoff_t size; int err = -ENOMEM; pte_t *pte; + pmd_t *pmd; + pud_t *pud; + pgd_t *pgd; pte_t pte_val; spinlock_t *ptl; - pte = get_locked_pte(mm, addr, &ptl); + BUG_ON(vma->vm_flags & VM_RESERVED); + + pgd = pgd_offset(mm, addr); + pud = pud_alloc(mm, pgd, addr); + if (!pud) + goto out; + pmd = pmd_alloc(mm, pud, addr); + if (!pmd) + goto out; + pte = pte_alloc_map_lock(mm, pmd, addr, &ptl); if (!pte) goto out; @@ -100,10 +116,22 @@ int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, { int err = -ENOMEM; pte_t *pte; + pmd_t *pmd; + pud_t *pud; + pgd_t *pgd; pte_t pte_val; spinlock_t *ptl; - pte = get_locked_pte(mm, addr, &ptl); + BUG_ON(vma->vm_flags & VM_RESERVED); + + pgd = pgd_offset(mm, addr); + pud = pud_alloc(mm, pgd, addr); + if (!pud) + goto out; + pmd = pmd_alloc(mm, pud, addr); + if (!pmd) + goto out; + pte = pte_alloc_map_lock(mm, pmd, addr, &ptl); if (!pte) goto out; @@ -176,10 +204,12 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, * Make sure the vma is shared, that it supports prefaulting, * and that the remapped range is valid and fully within * the single existing vma. vm_private_data is used as a - * swapout cursor in a VM_NONLINEAR vma. + * swapout cursor in a VM_NONLINEAR vma (unless VM_RESERVED + * or VM_LOCKED, but VM_LOCKED could be revoked later on). */ if (vma && (vma->vm_flags & VM_SHARED) && - (!vma->vm_private_data || (vma->vm_flags & VM_NONLINEAR)) && + (!vma->vm_private_data || + (vma->vm_flags & (VM_NONLINEAR|VM_RESERVED))) && vma->vm_ops && vma->vm_ops->populate && end > start && start >= vma->vm_start && end <= vma->vm_end) { diff --git a/trunk/mm/hugetlb.c b/trunk/mm/hugetlb.c index 3e52df7c471b..728e9bda12ea 100644 --- a/trunk/mm/hugetlb.c +++ b/trunk/mm/hugetlb.c @@ -22,10 +22,6 @@ unsigned long max_huge_pages; static struct list_head hugepage_freelists[MAX_NUMNODES]; static unsigned int nr_huge_pages_node[MAX_NUMNODES]; static unsigned int free_huge_pages_node[MAX_NUMNODES]; - -/* - * Protects updates to hugepage_freelists, nr_huge_pages, and free_huge_pages - */ static DEFINE_SPINLOCK(hugetlb_lock); static void enqueue_huge_page(struct page *page) @@ -65,10 +61,8 @@ static struct page *alloc_fresh_huge_page(void) HUGETLB_PAGE_ORDER); nid = (nid + 1) % num_online_nodes(); if (page) { - spin_lock(&hugetlb_lock); nr_huge_pages++; nr_huge_pages_node[page_to_nid(page)]++; - spin_unlock(&hugetlb_lock); } return page; } diff --git a/trunk/mm/madvise.c b/trunk/mm/madvise.c index 2b7cf0400a21..17aaf3e16449 100644 --- a/trunk/mm/madvise.c +++ b/trunk/mm/madvise.c @@ -126,7 +126,7 @@ static long madvise_dontneed(struct vm_area_struct * vma, unsigned long start, unsigned long end) { *prev = vma; - if (vma->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_PFNMAP)) + if (vma->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_RESERVED)) return -EINVAL; if (unlikely(vma->vm_flags & VM_NONLINEAR)) { diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c index d8dde07a3656..0f60baf6f69b 100644 --- a/trunk/mm/memory.c +++ b/trunk/mm/memory.c @@ -333,9 +333,9 @@ static inline void add_mm_rss(struct mm_struct *mm, int file_rss, int anon_rss) } /* - * This function is called to print an error when a bad pte - * is found. For example, we might have a PFN-mapped pte in - * a region that doesn't allow it. + * This function is called to print an error when a pte in a + * !VM_RESERVED region is found pointing to an invalid pfn (which + * is an error. * * The calling function must still handle the error. */ @@ -349,66 +349,6 @@ void print_bad_pte(struct vm_area_struct *vma, pte_t pte, unsigned long vaddr) dump_stack(); } -static inline int is_cow_mapping(unsigned int flags) -{ - return (flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE; -} - -/* - * This function gets the "struct page" associated with a pte. - * - * NOTE! Some mappings do not have "struct pages". A raw PFN mapping - * will have each page table entry just pointing to a raw page frame - * number, and as far as the VM layer is concerned, those do not have - * pages associated with them - even if the PFN might point to memory - * that otherwise is perfectly fine and has a "struct page". - * - * The way we recognize those mappings is through the rules set up - * by "remap_pfn_range()": the vma will have the VM_PFNMAP bit set, - * and the vm_pgoff will point to the first PFN mapped: thus every - * page that is a raw mapping will always honor the rule - * - * pfn_of_page == vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT) - * - * and if that isn't true, the page has been COW'ed (in which case it - * _does_ have a "struct page" associated with it even if it is in a - * VM_PFNMAP range). - */ -struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_t pte) -{ - unsigned long pfn = pte_pfn(pte); - - if (vma->vm_flags & VM_PFNMAP) { - unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT; - if (pfn == vma->vm_pgoff + off) - return NULL; - if (!is_cow_mapping(vma->vm_flags)) - return NULL; - } - - /* - * Add some anal sanity checks for now. Eventually, - * we should just do "return pfn_to_page(pfn)", but - * in the meantime we check that we get a valid pfn, - * and that the resulting page looks ok. - * - * Remove this test eventually! - */ - if (unlikely(!pfn_valid(pfn))) { - print_bad_pte(vma, pte, addr); - return NULL; - } - - /* - * NOTE! We still have PageReserved() pages in the page - * tables. - * - * The PAGE_ZERO() pages and various VDSO mappings can - * cause them to exist. - */ - return pfn_to_page(pfn); -} - /* * copy one vm_area from one task to the other. Assumes the page tables * already present in the new task to be cleared in the whole range @@ -423,6 +363,7 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, unsigned long vm_flags = vma->vm_flags; pte_t pte = *src_pte; struct page *page; + unsigned long pfn; /* pte contains position in swap or file, so copy. */ if (unlikely(!pte_present(pte))) { @@ -440,11 +381,28 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, goto out_set_pte; } + /* If the region is VM_RESERVED, the mapping is not + * mapped via rmap - duplicate the pte as is. + */ + if (vm_flags & VM_RESERVED) + goto out_set_pte; + + pfn = pte_pfn(pte); + /* If the pte points outside of valid memory but + * the region is not VM_RESERVED, we have a problem. + */ + if (unlikely(!pfn_valid(pfn))) { + print_bad_pte(vma, pte, addr); + goto out_set_pte; /* try to do something sane */ + } + + page = pfn_to_page(pfn); + /* * If it's a COW mapping, write protect it both * in the parent and the child */ - if (is_cow_mapping(vm_flags)) { + if ((vm_flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE) { ptep_set_wrprotect(src_mm, addr, src_pte); pte = *src_pte; } @@ -456,13 +414,9 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, if (vm_flags & VM_SHARED) pte = pte_mkclean(pte); pte = pte_mkold(pte); - - page = vm_normal_page(vma, addr, pte); - if (page) { - get_page(page); - page_dup_rmap(page); - rss[!!PageAnon(page)]++; - } + get_page(page); + page_dup_rmap(page); + rss[!!PageAnon(page)]++; out_set_pte: set_pte_at(dst_mm, addr, dst_pte, pte); @@ -574,7 +528,7 @@ int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, * readonly mappings. The tradeoff is that copy_page_range is more * efficient than faulting. */ - if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_PFNMAP|VM_INSERTPAGE))) { + if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_RESERVED))) { if (!vma->anon_vma) return 0; } @@ -595,10 +549,10 @@ int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, return 0; } -static unsigned long zap_pte_range(struct mmu_gather *tlb, +static void zap_pte_range(struct mmu_gather *tlb, struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, unsigned long end, - long *zap_work, struct zap_details *details) + struct zap_details *details) { struct mm_struct *mm = tlb->mm; pte_t *pte; @@ -609,16 +563,17 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, pte = pte_offset_map_lock(mm, pmd, addr, &ptl); do { pte_t ptent = *pte; - if (pte_none(ptent)) { - (*zap_work)--; + if (pte_none(ptent)) continue; - } if (pte_present(ptent)) { - struct page *page; - - (*zap_work) -= PAGE_SIZE; - - page = vm_normal_page(vma, addr, ptent); + struct page *page = NULL; + if (!(vma->vm_flags & VM_RESERVED)) { + unsigned long pfn = pte_pfn(ptent); + if (unlikely(!pfn_valid(pfn))) + print_bad_pte(vma, ptent, addr); + else + page = pfn_to_page(pfn); + } if (unlikely(details) && page) { /* * unmap_shared_mapping_pages() wants to @@ -669,18 +624,16 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, if (!pte_file(ptent)) free_swap_and_cache(pte_to_swp_entry(ptent)); pte_clear_full(mm, addr, pte, tlb->fullmm); - } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0)); + } while (pte++, addr += PAGE_SIZE, addr != end); add_mm_rss(mm, file_rss, anon_rss); pte_unmap_unlock(pte - 1, ptl); - - return addr; } -static inline unsigned long zap_pmd_range(struct mmu_gather *tlb, +static inline void zap_pmd_range(struct mmu_gather *tlb, struct vm_area_struct *vma, pud_t *pud, unsigned long addr, unsigned long end, - long *zap_work, struct zap_details *details) + struct zap_details *details) { pmd_t *pmd; unsigned long next; @@ -688,21 +641,16 @@ static inline unsigned long zap_pmd_range(struct mmu_gather *tlb, pmd = pmd_offset(pud, addr); do { next = pmd_addr_end(addr, end); - if (pmd_none_or_clear_bad(pmd)) { - (*zap_work)--; + if (pmd_none_or_clear_bad(pmd)) continue; - } - next = zap_pte_range(tlb, vma, pmd, addr, next, - zap_work, details); - } while (pmd++, addr = next, (addr != end && *zap_work > 0)); - - return addr; + zap_pte_range(tlb, vma, pmd, addr, next, details); + } while (pmd++, addr = next, addr != end); } -static inline unsigned long zap_pud_range(struct mmu_gather *tlb, +static inline void zap_pud_range(struct mmu_gather *tlb, struct vm_area_struct *vma, pgd_t *pgd, unsigned long addr, unsigned long end, - long *zap_work, struct zap_details *details) + struct zap_details *details) { pud_t *pud; unsigned long next; @@ -710,21 +658,15 @@ static inline unsigned long zap_pud_range(struct mmu_gather *tlb, pud = pud_offset(pgd, addr); do { next = pud_addr_end(addr, end); - if (pud_none_or_clear_bad(pud)) { - (*zap_work)--; + if (pud_none_or_clear_bad(pud)) continue; - } - next = zap_pmd_range(tlb, vma, pud, addr, next, - zap_work, details); - } while (pud++, addr = next, (addr != end && *zap_work > 0)); - - return addr; + zap_pmd_range(tlb, vma, pud, addr, next, details); + } while (pud++, addr = next, addr != end); } -static unsigned long unmap_page_range(struct mmu_gather *tlb, - struct vm_area_struct *vma, +static void unmap_page_range(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long addr, unsigned long end, - long *zap_work, struct zap_details *details) + struct zap_details *details) { pgd_t *pgd; unsigned long next; @@ -737,16 +679,11 @@ static unsigned long unmap_page_range(struct mmu_gather *tlb, pgd = pgd_offset(vma->vm_mm, addr); do { next = pgd_addr_end(addr, end); - if (pgd_none_or_clear_bad(pgd)) { - (*zap_work)--; + if (pgd_none_or_clear_bad(pgd)) continue; - } - next = zap_pud_range(tlb, vma, pgd, addr, next, - zap_work, details); - } while (pgd++, addr = next, (addr != end && *zap_work > 0)); + zap_pud_range(tlb, vma, pgd, addr, next, details); + } while (pgd++, addr = next, addr != end); tlb_end_vma(tlb, vma); - - return addr; } #ifdef CONFIG_PREEMPT @@ -787,7 +724,7 @@ unsigned long unmap_vmas(struct mmu_gather **tlbp, unsigned long end_addr, unsigned long *nr_accounted, struct zap_details *details) { - long zap_work = ZAP_BLOCK_SIZE; + unsigned long zap_bytes = ZAP_BLOCK_SIZE; unsigned long tlb_start = 0; /* For tlb_finish_mmu */ int tlb_start_valid = 0; unsigned long start = start_addr; @@ -808,25 +745,27 @@ unsigned long unmap_vmas(struct mmu_gather **tlbp, *nr_accounted += (end - start) >> PAGE_SHIFT; while (start != end) { + unsigned long block; + if (!tlb_start_valid) { tlb_start = start; tlb_start_valid = 1; } - if (unlikely(is_vm_hugetlb_page(vma))) { + if (is_vm_hugetlb_page(vma)) { + block = end - start; unmap_hugepage_range(vma, start, end); - zap_work -= (end - start) / - (HPAGE_SIZE / PAGE_SIZE); - start = end; - } else - start = unmap_page_range(*tlbp, vma, - start, end, &zap_work, details); - - if (zap_work > 0) { - BUG_ON(start != end); - break; + } else { + block = min(zap_bytes, end - start); + unmap_page_range(*tlbp, vma, start, + start + block, details); } + start += block; + zap_bytes -= block; + if ((long)zap_bytes > 0) + continue; + tlb_finish_mmu(*tlbp, tlb_start, start); if (need_resched() || @@ -840,7 +779,7 @@ unsigned long unmap_vmas(struct mmu_gather **tlbp, *tlbp = tlb_gather_mmu(vma->vm_mm, fullmm); tlb_start_valid = 0; - zap_work = ZAP_BLOCK_SIZE; + zap_bytes = ZAP_BLOCK_SIZE; } } out: @@ -874,7 +813,7 @@ unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, /* * Do a quick page-table lookup for a single page. */ -struct page *follow_page(struct vm_area_struct *vma, unsigned long address, +struct page *follow_page(struct mm_struct *mm, unsigned long address, unsigned int flags) { pgd_t *pgd; @@ -882,8 +821,8 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, pmd_t *pmd; pte_t *ptep, pte; spinlock_t *ptl; + unsigned long pfn; struct page *page; - struct mm_struct *mm = vma->vm_mm; page = follow_huge_addr(mm, address, flags & FOLL_WRITE); if (!IS_ERR(page)) { @@ -919,10 +858,11 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, goto unlock; if ((flags & FOLL_WRITE) && !pte_write(pte)) goto unlock; - page = vm_normal_page(vma, address, pte); - if (unlikely(!page)) + pfn = pte_pfn(pte); + if (!pfn_valid(pfn)) goto unlock; + page = pfn_to_page(pfn); if (flags & FOLL_GET) get_page(page); if (flags & FOLL_TOUCH) { @@ -995,10 +935,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, return i ? : -EFAULT; } if (pages) { - struct page *page = vm_normal_page(gate_vma, start, *pte); - pages[i] = page; - if (page) - get_page(page); + pages[i] = pte_page(*pte); + get_page(pages[i]); } pte_unmap(pte); if (vmas) @@ -1009,7 +947,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, continue; } - if (!vma || (vma->vm_flags & (VM_IO | VM_PFNMAP)) + if (!vma || (vma->vm_flags & (VM_IO | VM_RESERVED)) || !(vm_flags & vma->vm_flags)) return i ? : -EFAULT; @@ -1033,7 +971,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, foll_flags |= FOLL_WRITE; cond_resched(); - while (!(page = follow_page(vma, start, foll_flags))) { + while (!(page = follow_page(mm, start, foll_flags))) { int ret; ret = __handle_mm_fault(mm, vma, start, foll_flags & FOLL_WRITE); @@ -1153,86 +1091,6 @@ int zeromap_page_range(struct vm_area_struct *vma, return err; } -pte_t * fastcall get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl) -{ - pgd_t * pgd = pgd_offset(mm, addr); - pud_t * pud = pud_alloc(mm, pgd, addr); - if (pud) { - pmd_t * pmd = pmd_alloc(mm, pud, addr); - if (pmd) - return pte_alloc_map_lock(mm, pmd, addr, ptl); - } - return NULL; -} - -/* - * This is the old fallback for page remapping. - * - * For historical reasons, it only allows reserved pages. Only - * old drivers should use this, and they needed to mark their - * pages reserved for the old functions anyway. - */ -static int insert_page(struct mm_struct *mm, unsigned long addr, struct page *page, pgprot_t prot) -{ - int retval; - pte_t *pte; - spinlock_t *ptl; - - retval = -EINVAL; - if (PageAnon(page)) - goto out; - retval = -ENOMEM; - flush_dcache_page(page); - pte = get_locked_pte(mm, addr, &ptl); - if (!pte) - goto out; - retval = -EBUSY; - if (!pte_none(*pte)) - goto out_unlock; - - /* Ok, finally just insert the thing.. */ - get_page(page); - inc_mm_counter(mm, file_rss); - page_add_file_rmap(page); - set_pte_at(mm, addr, pte, mk_pte(page, prot)); - - retval = 0; -out_unlock: - pte_unmap_unlock(pte, ptl); -out: - return retval; -} - -/* - * This allows drivers to insert individual pages they've allocated - * into a user vma. - * - * The page has to be a nice clean _individual_ kernel allocation. - * If you allocate a compound page, you need to have marked it as - * such (__GFP_COMP), or manually just split the page up yourself - * (which is mainly an issue of doing "set_page_count(page, 1)" for - * each sub-page, and then freeing them one by one when you free - * them rather than freeing it as a compound page). - * - * NOTE! Traditionally this was done with "remap_pfn_range()" which - * took an arbitrary page protection parameter. This doesn't allow - * that. Your vma protection will have to be set up correctly, which - * means that if you want a shared writable mapping, you'd better - * ask for a shared writable mapping! - * - * The page does not need to be reserved. - */ -int vm_insert_page(struct vm_area_struct *vma, unsigned long addr, struct page *page) -{ - if (addr < vma->vm_start || addr >= vma->vm_end) - return -EFAULT; - if (!page_count(page)) - return -EINVAL; - vma->vm_flags |= VM_INSERTPAGE; - return insert_page(vma->vm_mm, addr, page, vma->vm_page_prot); -} -EXPORT_SYMBOL(vm_insert_page); - /* * maps a range of physical memory into the requested pages. the old * mappings are removed. any references to nonexistent pages results @@ -1312,26 +1170,10 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, * rest of the world about it: * VM_IO tells people not to look at these pages * (accesses can have side effects). - * VM_RESERVED is specified all over the place, because - * in 2.4 it kept swapout's vma scan off this vma; but - * in 2.6 the LRU scan won't even find its pages, so this - * flag means no more than count its pages in reserved_vm, - * and omit it from core dump, even when VM_IO turned off. - * VM_PFNMAP tells the core MM that the base pages are just - * raw PFN mappings, and do not have a "struct page" associated - * with them. - * - * There's a horrible special case to handle copy-on-write - * behaviour that some programs depend on. We mark the "original" - * un-COW'ed pages by matching them up with "vma->vm_pgoff". + * VM_RESERVED tells the core MM not to "manage" these pages + * (e.g. refcount, mapcount, try to swap them out). */ - if (is_cow_mapping(vma->vm_flags)) { - if (addr != vma->vm_start || end != vma->vm_end) - return -EINVAL; - vma->vm_pgoff = pfn; - } - - vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; + vma->vm_flags |= VM_IO | VM_RESERVED; BUG_ON(addr >= end); pfn -= addr >> PAGE_SHIFT; @@ -1386,33 +1228,6 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) return pte; } -static inline void cow_user_page(struct page *dst, struct page *src, unsigned long va) -{ - /* - * If the source page was a PFN mapping, we don't have - * a "struct page" for it. We do a best-effort copy by - * just copying from the original user address. If that - * fails, we just zero-fill it. Live with it. - */ - if (unlikely(!src)) { - void *kaddr = kmap_atomic(dst, KM_USER0); - void __user *uaddr = (void __user *)(va & PAGE_MASK); - - /* - * This really shouldn't fail, because the page is there - * in the page tables. But it might just be unreadable, - * in which case we just give up and fill the result with - * zeroes. - */ - if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE)) - memset(kaddr, 0, PAGE_SIZE); - kunmap_atomic(kaddr, KM_USER0); - return; - - } - copy_user_highpage(dst, src, va); -} - /* * This routine handles present pages, when users try to write * to a shared page. It is done by copying the page to a new address @@ -1436,18 +1251,27 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, spinlock_t *ptl, pte_t orig_pte) { struct page *old_page, *new_page; + unsigned long pfn = pte_pfn(orig_pte); pte_t entry; int ret = VM_FAULT_MINOR; - old_page = vm_normal_page(vma, address, orig_pte); - if (!old_page) - goto gotten; + BUG_ON(vma->vm_flags & VM_RESERVED); + + if (unlikely(!pfn_valid(pfn))) { + /* + * Page table corrupted: show pte and kill process. + */ + print_bad_pte(vma, orig_pte, address); + ret = VM_FAULT_OOM; + goto unlock; + } + old_page = pfn_to_page(pfn); if (PageAnon(old_page) && !TestSetPageLocked(old_page)) { int reuse = can_share_swap_page(old_page); unlock_page(old_page); if (reuse) { - flush_cache_page(vma, address, pte_pfn(orig_pte)); + flush_cache_page(vma, address, pfn); entry = pte_mkyoung(orig_pte); entry = maybe_mkwrite(pte_mkdirty(entry), vma); ptep_set_access_flags(vma, address, page_table, entry, 1); @@ -1462,7 +1286,6 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, * Ok, we need to copy. Oh, well.. */ page_cache_get(old_page); -gotten: pte_unmap_unlock(page_table, ptl); if (unlikely(anon_vma_prepare(vma))) @@ -1475,7 +1298,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, new_page = alloc_page_vma(GFP_HIGHUSER, vma, address); if (!new_page) goto oom; - cow_user_page(new_page, old_page, address); + copy_user_highpage(new_page, old_page, address); } /* @@ -1483,15 +1306,12 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, */ page_table = pte_offset_map_lock(mm, pmd, address, &ptl); if (likely(pte_same(*page_table, orig_pte))) { - if (old_page) { - page_remove_rmap(old_page); - if (!PageAnon(old_page)) { - dec_mm_counter(mm, file_rss); - inc_mm_counter(mm, anon_rss); - } - } else + page_remove_rmap(old_page); + if (!PageAnon(old_page)) { inc_mm_counter(mm, anon_rss); - flush_cache_page(vma, address, pte_pfn(orig_pte)); + dec_mm_counter(mm, file_rss); + } + flush_cache_page(vma, address, pfn); entry = mk_pte(new_page, vma->vm_page_prot); entry = maybe_mkwrite(pte_mkdirty(entry), vma); ptep_establish(vma, address, page_table, entry); @@ -1504,16 +1324,13 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, new_page = old_page; ret |= VM_FAULT_WRITE; } - if (new_page) - page_cache_release(new_page); - if (old_page) - page_cache_release(old_page); + page_cache_release(new_page); + page_cache_release(old_page); unlock: pte_unmap_unlock(page_table, ptl); return ret; oom: - if (old_page) - page_cache_release(old_page); + page_cache_release(old_page); return VM_FAULT_OOM; } @@ -2011,7 +1828,6 @@ static int do_no_page(struct mm_struct *mm, struct vm_area_struct *vma, int anon = 0; pte_unmap(page_table); - BUG_ON(vma->vm_flags & VM_PFNMAP); if (vma->vm_file) { mapping = vma->vm_file->f_mapping; @@ -2087,7 +1903,7 @@ static int do_no_page(struct mm_struct *mm, struct vm_area_struct *vma, inc_mm_counter(mm, anon_rss); lru_cache_add_active(new_page); page_add_anon_rmap(new_page, vma, address); - } else { + } else if (!(vma->vm_flags & VM_RESERVED)) { inc_mm_counter(mm, file_rss); page_add_file_rmap(new_page); } @@ -2264,12 +2080,6 @@ int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) spin_unlock(&mm->page_table_lock); return 0; } -#else -/* Workaround for gcc 2.96 */ -int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) -{ - return 0; -} #endif /* __PAGETABLE_PUD_FOLDED */ #ifndef __PAGETABLE_PMD_FOLDED @@ -2298,12 +2108,6 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) spin_unlock(&mm->page_table_lock); return 0; } -#else -/* Workaround for gcc 2.96 */ -int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) -{ - return 0; -} #endif /* __PAGETABLE_PMD_FOLDED */ int make_pages_present(unsigned long addr, unsigned long end) @@ -2378,7 +2182,7 @@ static int __init gate_vma_init(void) gate_vma.vm_start = FIXADDR_USER_START; gate_vma.vm_end = FIXADDR_USER_END; gate_vma.vm_page_prot = PAGE_READONLY; - gate_vma.vm_flags = 0; + gate_vma.vm_flags = VM_RESERVED; return 0; } __initcall(gate_vma_init); diff --git a/trunk/mm/memory_hotplug.c b/trunk/mm/memory_hotplug.c index f6d4af8af8a8..431a64f021c0 100644 --- a/trunk/mm/memory_hotplug.c +++ b/trunk/mm/memory_hotplug.c @@ -104,7 +104,7 @@ static void grow_pgdat_span(struct pglist_data *pgdat, pgdat->node_start_pfn = start_pfn; if (end_pfn > old_pgdat_end_pfn) - pgdat->node_spanned_pages = end_pfn - pgdat->node_start_pfn; + pgdat->node_spanned_pages = end_pfn - pgdat->node_spanned_pages; } int online_pages(unsigned long pfn, unsigned long nr_pages) diff --git a/trunk/mm/mempolicy.c b/trunk/mm/mempolicy.c index 72f402cc9c9a..5abc57c2b8bd 100644 --- a/trunk/mm/mempolicy.c +++ b/trunk/mm/mempolicy.c @@ -161,10 +161,6 @@ static struct mempolicy *mpol_new(int mode, nodemask_t *nodes) switch (mode) { case MPOL_INTERLEAVE: policy->v.nodes = *nodes; - if (nodes_weight(*nodes) == 0) { - kmem_cache_free(policy_cache, policy); - return ERR_PTR(-EINVAL); - } break; case MPOL_PREFERRED: policy->v.preferred_node = first_node(*nodes); @@ -193,15 +189,17 @@ static int check_pte_range(struct vm_area_struct *vma, pmd_t *pmd, orig_pte = pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); do { - struct page *page; + unsigned long pfn; unsigned int nid; if (!pte_present(*pte)) continue; - page = vm_normal_page(vma, addr, *pte); - if (!page) + pfn = pte_pfn(*pte); + if (!pfn_valid(pfn)) { + print_bad_pte(vma, *pte, addr); continue; - nid = page_to_nid(page); + } + nid = pfn_to_nid(pfn); if (!node_isset(nid, *nodes)) break; } while (pte++, addr += PAGE_SIZE, addr != end); @@ -271,6 +269,8 @@ check_range(struct mm_struct *mm, unsigned long start, unsigned long end, first = find_vma(mm, start); if (!first) return ERR_PTR(-EFAULT); + if (first->vm_flags & VM_RESERVED) + return ERR_PTR(-EACCES); prev = NULL; for (vma = first; vma && vma->vm_start < end; vma = vma->vm_next) { if (!vma->vm_next && vma->vm_end < end) diff --git a/trunk/mm/mmap.c b/trunk/mm/mmap.c index 64ba4dbcb7de..6c997b159600 100644 --- a/trunk/mm/mmap.c +++ b/trunk/mm/mmap.c @@ -611,7 +611,7 @@ again: remove_next = 1 + (end > next->vm_end); * If the vma has a ->close operation then the driver probably needs to release * per-vma resources, so we don't attempt to merge those. */ -#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP) +#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED) static inline int is_mergeable_vma(struct vm_area_struct *vma, struct file *file, unsigned long vm_flags) @@ -1076,6 +1076,17 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, error = file->f_op->mmap(file, vma); if (error) goto unmap_and_free_vma; + if ((vma->vm_flags & (VM_SHARED | VM_WRITE | VM_RESERVED)) + == (VM_WRITE | VM_RESERVED)) { + printk(KERN_WARNING "program %s is using MAP_PRIVATE, " + "PROT_WRITE mmap of VM_RESERVED memory, which " + "is deprecated. Please report this to " + "linux-kernel@vger.kernel.org\n",current->comm); + if (vma->vm_ops && vma->vm_ops->close) + vma->vm_ops->close(vma); + error = -EACCES; + goto unmap_and_free_vma; + } } else if (vm_flags & VM_SHARED) { error = shmem_zero_setup(vma); if (error) @@ -1490,7 +1501,7 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un * PA-RISC uses this for its stack; IA64 for its Register Backing Store. * vma is the last one with address > vma->vm_end. Have to extend vma. */ -#ifndef CONFIG_IA64 +#ifdef CONFIG_STACK_GROWSUP static inline #endif int expand_upwards(struct vm_area_struct *vma, unsigned long address) diff --git a/trunk/mm/mprotect.c b/trunk/mm/mprotect.c index 653b8571c1ed..17a2b52b753b 100644 --- a/trunk/mm/mprotect.c +++ b/trunk/mm/mprotect.c @@ -124,6 +124,14 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, * a MAP_NORESERVE private mapping to writable will now reserve. */ if (newflags & VM_WRITE) { + if (oldflags & VM_RESERVED) { + BUG_ON(oldflags & VM_WRITE); + printk(KERN_WARNING "program %s is using MAP_PRIVATE, " + "PROT_WRITE mprotect of VM_RESERVED memory, " + "which is deprecated. Please report this to " + "linux-kernel@vger.kernel.org\n",current->comm); + return -EACCES; + } if (!(oldflags & (VM_ACCOUNT|VM_WRITE|VM_SHARED|VM_HUGETLB))) { charged = nrpages; if (security_vm_enough_memory(charged)) diff --git a/trunk/mm/mremap.c b/trunk/mm/mremap.c index ddaeee9a0b69..b535438c363c 100644 --- a/trunk/mm/mremap.c +++ b/trunk/mm/mremap.c @@ -323,7 +323,7 @@ unsigned long do_mremap(unsigned long addr, /* We can't remap across vm area boundaries */ if (old_len > vma->vm_end - addr) goto out; - if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP)) { + if (vma->vm_flags & VM_DONTEXPAND) { if (new_len > old_len) goto out; } diff --git a/trunk/mm/msync.c b/trunk/mm/msync.c index 1b5b6f662dcf..0e040e9c39d8 100644 --- a/trunk/mm/msync.c +++ b/trunk/mm/msync.c @@ -27,6 +27,7 @@ static void msync_pte_range(struct vm_area_struct *vma, pmd_t *pmd, again: pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); do { + unsigned long pfn; struct page *page; if (progress >= 64) { @@ -39,9 +40,13 @@ static void msync_pte_range(struct vm_area_struct *vma, pmd_t *pmd, continue; if (!pte_maybe_dirty(*pte)) continue; - page = vm_normal_page(vma, addr, *pte); - if (!page) + pfn = pte_pfn(*pte); + if (unlikely(!pfn_valid(pfn))) { + print_bad_pte(vma, *pte, addr); continue; + } + page = pfn_to_page(pfn); + if (ptep_clear_flush_dirty(vma, addr, pte) || page_test_and_clear_dirty(page)) set_page_dirty(page); @@ -92,8 +97,9 @@ static void msync_page_range(struct vm_area_struct *vma, /* For hugepages we can't go walking the page table normally, * but that's ok, hugetlbfs is memory based, so we don't need * to do anything more on an msync(). + * Can't do anything with VM_RESERVED regions either. */ - if (vma->vm_flags & VM_HUGETLB) + if (vma->vm_flags & (VM_HUGETLB|VM_RESERVED)) return; BUG_ON(addr >= end); diff --git a/trunk/mm/nommu.c b/trunk/mm/nommu.c index c1196812876b..6deb6ab3d6ad 100644 --- a/trunk/mm/nommu.c +++ b/trunk/mm/nommu.c @@ -1045,7 +1045,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) EXPORT_SYMBOL(find_vma); -struct page *follow_page(struct vm_area_struct *vma, unsigned long address, +struct page *follow_page(struct mm_struct *mm, unsigned long address, unsigned int foll_flags) { return NULL; diff --git a/trunk/mm/page-writeback.c b/trunk/mm/page-writeback.c index 0166ea15c9ee..74138c9a22b9 100644 --- a/trunk/mm/page-writeback.c +++ b/trunk/mm/page-writeback.c @@ -750,7 +750,6 @@ int clear_page_dirty_for_io(struct page *page) } return TestClearPageDirty(page); } -EXPORT_SYMBOL(clear_page_dirty_for_io); int test_clear_page_writeback(struct page *page) { diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index fe14a8c87fc2..987225bdd661 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -60,11 +60,8 @@ long nr_swap_pages; * NORMAL allocation will leave 784M/256 of ram reserved in the ZONE_DMA * HIGHMEM allocation will leave 224M/32 of ram reserved in ZONE_NORMAL * HIGHMEM allocation will (224M+784M)/256 of ram reserved in ZONE_DMA - * - * TBD: should special case ZONE_DMA32 machines here - in those we normally - * don't need any ZONE_NORMAL reservation */ -int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { 256, 256, 32 }; +int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { 256, 32 }; EXPORT_SYMBOL(totalram_pages); @@ -75,7 +72,7 @@ EXPORT_SYMBOL(totalram_pages); struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly; EXPORT_SYMBOL(zone_table); -static char *zone_names[MAX_NR_ZONES] = { "DMA", "DMA32", "Normal", "HighMem" }; +static char *zone_names[MAX_NR_ZONES] = { "DMA", "Normal", "HighMem" }; int min_free_kbytes = 1024; unsigned long __initdata nr_kernel_pages; @@ -127,7 +124,7 @@ static void bad_page(const char *function, struct page *page) printk(KERN_EMERG "Bad page state at %s (in process '%s', page %p)\n", function, current->comm, page); printk(KERN_EMERG "flags:0x%0*lx mapping:%p mapcount:%d count:%d\n", - (int)(2*sizeof(unsigned long)), (unsigned long)page->flags, + (int)(2*sizeof(page_flags_t)), (unsigned long)page->flags, page->mapping, page_mapcount(page), page_count(page)); printk(KERN_EMERG "Backtrace:\n"); dump_stack(); @@ -140,13 +137,18 @@ static void bad_page(const char *function, struct page *page) 1 << PG_reclaim | 1 << PG_slab | 1 << PG_swapcache | - 1 << PG_writeback ); + 1 << PG_writeback | + 1 << PG_reserved ); set_page_count(page, 0); reset_page_mapcount(page); page->mapping = NULL; add_taint(TAINT_BAD_PAGE); } +#ifndef CONFIG_HUGETLB_PAGE +#define prep_compound_page(page, order) do { } while (0) +#define destroy_compound_page(page, order) do { } while (0) +#else /* * Higher-order pages are called "compound pages". They are structured thusly: * @@ -200,6 +202,7 @@ static void destroy_compound_page(struct page *page, unsigned long order) ClearPageCompound(p); } } +#endif /* CONFIG_HUGETLB_PAGE */ /* * function for dealing with page's order in buddy system. @@ -334,7 +337,7 @@ static inline void __free_pages_bulk (struct page *page, zone->free_area[order].nr_free++; } -static inline int free_pages_check(const char *function, struct page *page) +static inline void free_pages_check(const char *function, struct page *page) { if ( page_mapcount(page) || page->mapping != NULL || @@ -352,12 +355,6 @@ static inline int free_pages_check(const char *function, struct page *page) bad_page(function, page); if (PageDirty(page)) __ClearPageDirty(page); - /* - * For now, we report if PG_reserved was found set, but do not - * clear it, and do not free the page. But we shall soon need - * to do more, for when the ZERO_PAGE count wraps negative. - */ - return PageReserved(page); } /* @@ -397,10 +394,11 @@ void __free_pages_ok(struct page *page, unsigned int order) { LIST_HEAD(list); int i; - int reserved = 0; arch_free_page(page, order); + mod_page_state(pgfree, 1 << order); + #ifndef CONFIG_MMU if (order > 0) for (i = 1 ; i < (1 << order) ; ++i) @@ -408,12 +406,8 @@ void __free_pages_ok(struct page *page, unsigned int order) #endif for (i = 0 ; i < (1 << order) ; ++i) - reserved += free_pages_check(__FUNCTION__, page + i); - if (reserved) - return; - + free_pages_check(__FUNCTION__, page + i); list_add(&page->lru, &list); - mod_page_state(pgfree, 1 << order); kernel_map_pages(page, 1<mapping != NULL || @@ -489,20 +483,12 @@ static int prep_new_page(struct page *page, int order) 1 << PG_reserved ))) bad_page(__FUNCTION__, page); - /* - * For now, we report if PG_reserved was found set, but do not - * clear it, and do not allocate the page: as a safety net. - */ - if (PageReserved(page)) - return 1; - page->flags &= ~(1 << PG_uptodate | 1 << PG_error | 1 << PG_referenced | 1 << PG_arch_1 | 1 << PG_checked | 1 << PG_mappedtodisk); set_page_private(page, 0); set_page_refs(page, order); kernel_map_pages(page, 1 << order, 1); - return 0; } /* @@ -685,14 +671,11 @@ static void fastcall free_hot_cold_page(struct page *page, int cold) arch_free_page(page, 0); + kernel_map_pages(page, 1, 0); + inc_page_state(pgfree); if (PageAnon(page)) page->mapping = NULL; - if (free_pages_check(__FUNCTION__, page)) - return; - - inc_page_state(pgfree); - kernel_map_pages(page, 1, 0); - + free_pages_check(__FUNCTION__, page); pcp = &zone_pcp(zone, get_cpu())->pcp[cold]; local_irq_save(flags); list_add(&page->lru, &pcp->list); @@ -731,14 +714,12 @@ static struct page * buffered_rmqueue(struct zone *zone, int order, gfp_t gfp_flags) { unsigned long flags; - struct page *page; + struct page *page = NULL; int cold = !!(gfp_flags & __GFP_COLD); -again: if (order == 0) { struct per_cpu_pages *pcp; - page = NULL; pcp = &zone_pcp(zone, get_cpu())->pcp[cold]; local_irq_save(flags); if (pcp->count <= pcp->low) @@ -751,7 +732,9 @@ buffered_rmqueue(struct zone *zone, int order, gfp_t gfp_flags) } local_irq_restore(flags); put_cpu(); - } else { + } + + if (page == NULL) { spin_lock_irqsave(&zone->lock, flags); page = __rmqueue(zone, order); spin_unlock_irqrestore(&zone->lock, flags); @@ -760,8 +743,7 @@ buffered_rmqueue(struct zone *zone, int order, gfp_t gfp_flags) if (page != NULL) { BUG_ON(bad_range(zone, page)); mod_page_state_zone(zone, pgalloc, 1 << order); - if (prep_new_page(page, order)) - goto again; + prep_new_page(page, order); if (gfp_flags & __GFP_ZERO) prep_zero_page(page, order, gfp_flags); @@ -772,28 +754,20 @@ buffered_rmqueue(struct zone *zone, int order, gfp_t gfp_flags) return page; } -#define ALLOC_NO_WATERMARKS 0x01 /* don't check watermarks at all */ -#define ALLOC_WMARK_MIN 0x02 /* use pages_min watermark */ -#define ALLOC_WMARK_LOW 0x04 /* use pages_low watermark */ -#define ALLOC_WMARK_HIGH 0x08 /* use pages_high watermark */ -#define ALLOC_HARDER 0x10 /* try to alloc harder */ -#define ALLOC_HIGH 0x20 /* __GFP_HIGH set */ -#define ALLOC_CPUSET 0x40 /* check for correct cpuset */ - /* * Return 1 if free pages are above 'mark'. This takes into account the order * of the allocation. */ int zone_watermark_ok(struct zone *z, int order, unsigned long mark, - int classzone_idx, int alloc_flags) + int classzone_idx, int can_try_harder, gfp_t gfp_high) { /* free_pages my go negative - that's OK */ long min = mark, free_pages = z->free_pages - (1 << order) + 1; int o; - if (alloc_flags & ALLOC_HIGH) + if (gfp_high) min -= min / 2; - if (alloc_flags & ALLOC_HARDER) + if (can_try_harder) min -= min / 4; if (free_pages <= min + z->lowmem_reserve[classzone_idx]) @@ -811,47 +785,14 @@ int zone_watermark_ok(struct zone *z, int order, unsigned long mark, return 1; } -/* - * get_page_from_freeliest goes through the zonelist trying to allocate - * a page. - */ -static struct page * -get_page_from_freelist(gfp_t gfp_mask, unsigned int order, - struct zonelist *zonelist, int alloc_flags) +static inline int +should_reclaim_zone(struct zone *z, gfp_t gfp_mask) { - struct zone **z = zonelist->zones; - struct page *page = NULL; - int classzone_idx = zone_idx(*z); - - /* - * Go through the zonelist once, looking for a zone with enough free. - * See also cpuset_zone_allowed() comment in kernel/cpuset.c. - */ - do { - if ((alloc_flags & ALLOC_CPUSET) && - !cpuset_zone_allowed(*z, gfp_mask)) - continue; - - if (!(alloc_flags & ALLOC_NO_WATERMARKS)) { - unsigned long mark; - if (alloc_flags & ALLOC_WMARK_MIN) - mark = (*z)->pages_min; - else if (alloc_flags & ALLOC_WMARK_LOW) - mark = (*z)->pages_low; - else - mark = (*z)->pages_high; - if (!zone_watermark_ok(*z, order, mark, - classzone_idx, alloc_flags)) - continue; - } - - page = buffered_rmqueue(*z, order, gfp_mask); - if (page) { - zone_statistics(zonelist, *z); - break; - } - } while (*(++z) != NULL); - return page; + if (!z->reclaim_pages) + return 0; + if (gfp_mask & __GFP_NORECLAIM) + return 0; + return 1; } /* @@ -862,76 +803,105 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order, struct zonelist *zonelist) { const gfp_t wait = gfp_mask & __GFP_WAIT; - struct zone **z; + struct zone **zones, *z; struct page *page; struct reclaim_state reclaim_state; struct task_struct *p = current; + int i; + int classzone_idx; int do_retry; - int alloc_flags; + int can_try_harder; int did_some_progress; might_sleep_if(wait); -restart: - z = zonelist->zones; /* the list of zones suitable for gfp_mask */ + /* + * The caller may dip into page reserves a bit more if the caller + * cannot run direct reclaim, or is the caller has realtime scheduling + * policy + */ + can_try_harder = (unlikely(rt_task(p)) && !in_interrupt()) || !wait; - if (unlikely(*z == NULL)) { + zones = zonelist->zones; /* the list of zones suitable for gfp_mask */ + + if (unlikely(zones[0] == NULL)) { /* Should this ever happen?? */ return NULL; } - page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order, - zonelist, ALLOC_WMARK_LOW|ALLOC_CPUSET); - if (page) - goto got_pg; - - do { - wakeup_kswapd(*z, order); - } while (*(++z)); + classzone_idx = zone_idx(zones[0]); +restart: /* - * OK, we're below the kswapd watermark and have kicked background - * reclaim. Now things get more complex, so set up alloc_flags according - * to how we want to proceed. - * - * The caller may dip into page reserves a bit more if the caller - * cannot run direct reclaim, or if the caller has realtime scheduling - * policy. + * Go through the zonelist once, looking for a zone with enough free. + * See also cpuset_zone_allowed() comment in kernel/cpuset.c. */ - alloc_flags = ALLOC_WMARK_MIN; - if ((unlikely(rt_task(p)) && !in_interrupt()) || !wait) - alloc_flags |= ALLOC_HARDER; - if (gfp_mask & __GFP_HIGH) - alloc_flags |= ALLOC_HIGH; - if (wait) - alloc_flags |= ALLOC_CPUSET; + for (i = 0; (z = zones[i]) != NULL; i++) { + int do_reclaim = should_reclaim_zone(z, gfp_mask); + + if (!cpuset_zone_allowed(z, __GFP_HARDWALL)) + continue; + + /* + * If the zone is to attempt early page reclaim then this loop + * will try to reclaim pages and check the watermark a second + * time before giving up and falling back to the next zone. + */ +zone_reclaim_retry: + if (!zone_watermark_ok(z, order, z->pages_low, + classzone_idx, 0, 0)) { + if (!do_reclaim) + continue; + else { + zone_reclaim(z, gfp_mask, order); + /* Only try reclaim once */ + do_reclaim = 0; + goto zone_reclaim_retry; + } + } + + page = buffered_rmqueue(z, order, gfp_mask); + if (page) + goto got_pg; + } + + for (i = 0; (z = zones[i]) != NULL; i++) + wakeup_kswapd(z, order); /* * Go through the zonelist again. Let __GFP_HIGH and allocations - * coming from realtime tasks go deeper into reserves. + * coming from realtime tasks to go deeper into reserves * * This is the last chance, in general, before the goto nopage. * Ignore cpuset if GFP_ATOMIC (!wait) rather than fail alloc. * See also cpuset_zone_allowed() comment in kernel/cpuset.c. */ - page = get_page_from_freelist(gfp_mask, order, zonelist, alloc_flags); - if (page) - goto got_pg; + for (i = 0; (z = zones[i]) != NULL; i++) { + if (!zone_watermark_ok(z, order, z->pages_min, + classzone_idx, can_try_harder, + gfp_mask & __GFP_HIGH)) + continue; + + if (wait && !cpuset_zone_allowed(z, gfp_mask)) + continue; + + page = buffered_rmqueue(z, order, gfp_mask); + if (page) + goto got_pg; + } /* This allocation should allow future memory freeing. */ if (((p->flags & PF_MEMALLOC) || unlikely(test_thread_flag(TIF_MEMDIE))) && !in_interrupt()) { if (!(gfp_mask & __GFP_NOMEMALLOC)) { -nofail_alloc: /* go through the zonelist yet again, ignoring mins */ - page = get_page_from_freelist(gfp_mask, order, - zonelist, ALLOC_NO_WATERMARKS|ALLOC_CPUSET); - if (page) - goto got_pg; - if (gfp_mask & __GFP_NOFAIL) { - blk_congestion_wait(WRITE, HZ/50); - goto nofail_alloc; + for (i = 0; (z = zones[i]) != NULL; i++) { + if (!cpuset_zone_allowed(z, gfp_mask)) + continue; + page = buffered_rmqueue(z, order, gfp_mask); + if (page) + goto got_pg; } } goto nopage; @@ -949,7 +919,7 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order, reclaim_state.reclaimed_slab = 0; p->reclaim_state = &reclaim_state; - did_some_progress = try_to_free_pages(zonelist->zones, gfp_mask); + did_some_progress = try_to_free_pages(zones, gfp_mask); p->reclaim_state = NULL; p->flags &= ~PF_MEMALLOC; @@ -957,10 +927,19 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order, cond_resched(); if (likely(did_some_progress)) { - page = get_page_from_freelist(gfp_mask, order, - zonelist, alloc_flags); - if (page) - goto got_pg; + for (i = 0; (z = zones[i]) != NULL; i++) { + if (!zone_watermark_ok(z, order, z->pages_min, + classzone_idx, can_try_harder, + gfp_mask & __GFP_HIGH)) + continue; + + if (!cpuset_zone_allowed(z, gfp_mask)) + continue; + + page = buffered_rmqueue(z, order, gfp_mask); + if (page) + goto got_pg; + } } else if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY)) { /* * Go through the zonelist yet one more time, keep @@ -968,10 +947,18 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order, * a parallel oom killing, we must fail if we're still * under heavy pressure. */ - page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order, - zonelist, ALLOC_WMARK_HIGH|ALLOC_CPUSET); - if (page) - goto got_pg; + for (i = 0; (z = zones[i]) != NULL; i++) { + if (!zone_watermark_ok(z, order, z->pages_high, + classzone_idx, 0, 0)) + continue; + + if (!cpuset_zone_allowed(z, __GFP_HARDWALL)) + continue; + + page = buffered_rmqueue(z, order, gfp_mask); + if (page) + goto got_pg; + } out_of_memory(gfp_mask, order); goto restart; @@ -1004,7 +991,9 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order, dump_stack(); show_mem(); } + return NULL; got_pg: + zone_statistics(zonelist, z); return page; } @@ -1452,10 +1441,6 @@ static int __init build_zonelists_node(pg_data_t *pgdat, struct zonelist *zoneli zone = pgdat->node_zones + ZONE_NORMAL; if (zone->present_pages) zonelist->zones[j++] = zone; - case ZONE_DMA32: - zone = pgdat->node_zones + ZONE_DMA32; - if (zone->present_pages) - zonelist->zones[j++] = zone; case ZONE_DMA: zone = pgdat->node_zones + ZONE_DMA; if (zone->present_pages) @@ -1470,8 +1455,6 @@ static inline int highest_zone(int zone_bits) int res = ZONE_NORMAL; if (zone_bits & (__force int)__GFP_HIGHMEM) res = ZONE_HIGHMEM; - if (zone_bits & (__force int)__GFP_DMA32) - res = ZONE_DMA32; if (zone_bits & (__force int)__GFP_DMA) res = ZONE_DMA; return res; @@ -1772,16 +1755,16 @@ static int __devinit zone_batchsize(struct zone *zone) batch = 1; /* - * Clamp the batch to a 2^n - 1 value. Having a power - * of 2 value was found to be more likely to have - * suboptimal cache aliasing properties in some cases. + * We will be trying to allcoate bigger chunks of contiguous + * memory of the order of fls(batch). This should result in + * better cache coloring. * - * For example if 2 tasks are alternately allocating - * batches of pages, one task can end up with a lot - * of pages of one half of the possible page colors - * and the other with pages of the other colors. + * A sanity check also to ensure that batch is still in limits. */ - batch = (1 << (fls(batch + batch/2)-1)) - 1; + batch = (1 << fls(batch + batch/2)); + + if (fls(batch) >= (PAGE_SHIFT + MAX_ORDER - 2)) + batch = PAGE_SHIFT + ((MAX_ORDER - 1 - PAGE_SHIFT)/2); return batch; } @@ -1883,10 +1866,11 @@ static int __devinit pageset_cpuup_callback(struct notifier_block *nfb, if (process_zones(cpu)) ret = NOTIFY_BAD; break; - case CPU_UP_CANCELED: +#ifdef CONFIG_HOTPLUG_CPU case CPU_DEAD: free_zone_pagesets(cpu); break; +#endif default: break; } @@ -1896,7 +1880,7 @@ static int __devinit pageset_cpuup_callback(struct notifier_block *nfb, static struct notifier_block pageset_notifier = { &pageset_cpuup_callback, NULL, 0 }; -void __init setup_per_cpu_pageset(void) +void __init setup_per_cpu_pageset() { int err; @@ -1991,7 +1975,7 @@ static void __init free_area_init_core(struct pglist_data *pgdat, if (zholes_size) realsize -= zholes_size[j]; - if (j < ZONE_HIGHMEM) + if (j == ZONE_DMA || j == ZONE_NORMAL) nr_kernel_pages += realsize; nr_all_pages += realsize; @@ -2433,18 +2417,13 @@ void setup_per_zone_pages_min(void) } for_each_zone(zone) { - unsigned long tmp; spin_lock_irqsave(&zone->lru_lock, flags); - tmp = (pages_min * zone->present_pages) / lowmem_pages; if (is_highmem(zone)) { /* - * __GFP_HIGH and PF_MEMALLOC allocations usually don't - * need highmem pages, so cap pages_min to a small - * value here. - * - * The (pages_high-pages_low) and (pages_low-pages_min) - * deltas controls asynch page reclaim, and so should - * not be capped for highmem. + * Often, highmem doesn't need to reserve any pages. + * But the pages_min/low/high values are also used for + * batching up page reclaim activity so we need a + * decent value here. */ int min_pages; @@ -2455,15 +2434,19 @@ void setup_per_zone_pages_min(void) min_pages = 128; zone->pages_min = min_pages; } else { - /* - * If it's a lowmem zone, reserve a number of pages + /* if it's a lowmem zone, reserve a number of pages * proportionate to the zone's size. */ - zone->pages_min = tmp; + zone->pages_min = (pages_min * zone->present_pages) / + lowmem_pages; } - zone->pages_low = zone->pages_min + tmp / 4; - zone->pages_high = zone->pages_min + tmp / 2; + /* + * When interpreting these watermarks, just keep in mind that: + * zone->pages_min == (zone->pages_min * 4) / 4; + */ + zone->pages_low = (zone->pages_min * 5) / 4; + zone->pages_high = (zone->pages_min * 6) / 4; spin_unlock_irqrestore(&zone->lru_lock, flags); } } diff --git a/trunk/mm/rmap.c b/trunk/mm/rmap.c index f853c6def159..914d04b98bee 100644 --- a/trunk/mm/rmap.c +++ b/trunk/mm/rmap.c @@ -225,7 +225,7 @@ vma_address(struct page *page, struct vm_area_struct *vma) /* * At what user virtual address is page expected in vma? checking that the - * page matches the vma: currently only used on anon pages, by unuse_vma; + * page matches the vma: currently only used by unuse_process, on anon pages. */ unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) { @@ -234,8 +234,7 @@ unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) (void *)page->mapping - PAGE_MAPPING_ANON) return -EFAULT; } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { - if (!vma->vm_file || - vma->vm_file->f_mapping != page->mapping) + if (vma->vm_file->f_mapping != page->mapping) return -EFAULT; } else return -EFAULT; @@ -290,7 +289,7 @@ pte_t *page_check_address(struct page *page, struct mm_struct *mm, * repeatedly from either page_referenced_anon or page_referenced_file. */ static int page_referenced_one(struct page *page, - struct vm_area_struct *vma, unsigned int *mapcount) + struct vm_area_struct *vma, unsigned int *mapcount, int ignore_token) { struct mm_struct *mm = vma->vm_mm; unsigned long address; @@ -311,7 +310,7 @@ static int page_referenced_one(struct page *page, /* Pretend the page is referenced if the task has the swap token and is in the middle of a page fault. */ - if (mm != current->mm && has_swap_token(mm) && + if (mm != current->mm && !ignore_token && has_swap_token(mm) && rwsem_is_locked(&mm->mmap_sem)) referenced++; @@ -321,7 +320,7 @@ static int page_referenced_one(struct page *page, return referenced; } -static int page_referenced_anon(struct page *page) +static int page_referenced_anon(struct page *page, int ignore_token) { unsigned int mapcount; struct anon_vma *anon_vma; @@ -334,7 +333,8 @@ static int page_referenced_anon(struct page *page) mapcount = page_mapcount(page); list_for_each_entry(vma, &anon_vma->head, anon_vma_node) { - referenced += page_referenced_one(page, vma, &mapcount); + referenced += page_referenced_one(page, vma, &mapcount, + ignore_token); if (!mapcount) break; } @@ -353,7 +353,7 @@ static int page_referenced_anon(struct page *page) * * This function is only called from page_referenced for object-based pages. */ -static int page_referenced_file(struct page *page) +static int page_referenced_file(struct page *page, int ignore_token) { unsigned int mapcount; struct address_space *mapping = page->mapping; @@ -391,7 +391,8 @@ static int page_referenced_file(struct page *page) referenced++; break; } - referenced += page_referenced_one(page, vma, &mapcount); + referenced += page_referenced_one(page, vma, &mapcount, + ignore_token); if (!mapcount) break; } @@ -408,10 +409,13 @@ static int page_referenced_file(struct page *page) * Quick test_and_clear_referenced for all mappings to a page, * returns the number of ptes which referenced the page. */ -int page_referenced(struct page *page, int is_locked) +int page_referenced(struct page *page, int is_locked, int ignore_token) { int referenced = 0; + if (!swap_token_default_timeout) + ignore_token = 1; + if (page_test_and_clear_young(page)) referenced++; @@ -420,14 +424,15 @@ int page_referenced(struct page *page, int is_locked) if (page_mapped(page) && page->mapping) { if (PageAnon(page)) - referenced += page_referenced_anon(page); + referenced += page_referenced_anon(page, ignore_token); else if (is_locked) - referenced += page_referenced_file(page); + referenced += page_referenced_file(page, ignore_token); else if (TestSetPageLocked(page)) referenced++; else { if (page->mapping) - referenced += page_referenced_file(page); + referenced += page_referenced_file(page, + ignore_token); unlock_page(page); } } @@ -524,8 +529,10 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma) * If the page is mlock()d, we cannot swap it out. * If it's recently referenced (perhaps page_referenced * skipped over this mm) then we should reactivate it. + * + * Pages belonging to VM_RESERVED regions should not happen here. */ - if ((vma->vm_flags & VM_LOCKED) || + if ((vma->vm_flags & (VM_LOCKED|VM_RESERVED)) || ptep_clear_flush_young(vma, address, pte)) { ret = SWAP_FAIL; goto out_unmap; @@ -606,6 +613,7 @@ static void try_to_unmap_cluster(unsigned long cursor, struct page *page; unsigned long address; unsigned long end; + unsigned long pfn; address = (vma->vm_start + cursor) & CLUSTER_MASK; end = address + CLUSTER_SIZE; @@ -634,14 +642,21 @@ static void try_to_unmap_cluster(unsigned long cursor, for (; address < end; pte++, address += PAGE_SIZE) { if (!pte_present(*pte)) continue; - page = vm_normal_page(vma, address, *pte); - BUG_ON(!page || PageAnon(page)); + + pfn = pte_pfn(*pte); + if (unlikely(!pfn_valid(pfn))) { + print_bad_pte(vma, *pte, address); + continue; + } + + page = pfn_to_page(pfn); + BUG_ON(PageAnon(page)); if (ptep_clear_flush_young(vma, address, pte)) continue; /* Nuke the page table entry. */ - flush_cache_page(vma, address, pte_pfn(*pte)); + flush_cache_page(vma, address, pfn); pteval = ptep_clear_flush(vma, address, pte); /* If nonlinear, store the file page offset in the pte. */ @@ -712,7 +727,7 @@ static int try_to_unmap_file(struct page *page) list_for_each_entry(vma, &mapping->i_mmap_nonlinear, shared.vm_set.list) { - if (vma->vm_flags & VM_LOCKED) + if (vma->vm_flags & (VM_LOCKED|VM_RESERVED)) continue; cursor = (unsigned long) vma->vm_private_data; if (cursor > max_nl_cursor) @@ -746,7 +761,7 @@ static int try_to_unmap_file(struct page *page) do { list_for_each_entry(vma, &mapping->i_mmap_nonlinear, shared.vm_set.list) { - if (vma->vm_flags & VM_LOCKED) + if (vma->vm_flags & (VM_LOCKED|VM_RESERVED)) continue; cursor = (unsigned long) vma->vm_private_data; while ( cursor < max_nl_cursor && @@ -768,8 +783,11 @@ static int try_to_unmap_file(struct page *page) * in locked vmas). Reset cursor on all unreserved nonlinear * vmas, now forgetting on which ones it had fallen behind. */ - list_for_each_entry(vma, &mapping->i_mmap_nonlinear, shared.vm_set.list) - vma->vm_private_data = NULL; + list_for_each_entry(vma, &mapping->i_mmap_nonlinear, + shared.vm_set.list) { + if (!(vma->vm_flags & VM_RESERVED)) + vma->vm_private_data = NULL; + } out: spin_unlock(&mapping->i_mmap_lock); return ret; diff --git a/trunk/mm/slab.c b/trunk/mm/slab.c index e5ec26e0c460..8a73dcfc6a27 100644 --- a/trunk/mm/slab.c +++ b/trunk/mm/slab.c @@ -565,29 +565,14 @@ static void **dbg_userword(kmem_cache_t *cachep, void *objp) #define BREAK_GFP_ORDER_LO 0 static int slab_break_gfp_order = BREAK_GFP_ORDER_LO; -/* Functions for storing/retrieving the cachep and or slab from the +/* Macros for storing/retrieving the cachep and or slab from the * global 'mem_map'. These are used to find the slab an obj belongs to. * With kfree(), these are used to find the cache which an obj belongs to. */ -static inline void page_set_cache(struct page *page, struct kmem_cache *cache) -{ - page->lru.next = (struct list_head *)cache; -} - -static inline struct kmem_cache *page_get_cache(struct page *page) -{ - return (struct kmem_cache *)page->lru.next; -} - -static inline void page_set_slab(struct page *page, struct slab *slab) -{ - page->lru.prev = (struct list_head *)slab; -} - -static inline struct slab *page_get_slab(struct page *page) -{ - return (struct slab *)page->lru.prev; -} +#define SET_PAGE_CACHE(pg,x) ((pg)->lru.next = (struct list_head *)(x)) +#define GET_PAGE_CACHE(pg) ((kmem_cache_t *)(pg)->lru.next) +#define SET_PAGE_SLAB(pg,x) ((pg)->lru.prev = (struct list_head *)(x)) +#define GET_PAGE_SLAB(pg) ((struct slab *)(pg)->lru.prev) /* These are the default caches for kmalloc. Custom caches can have other sizes. */ struct cache_sizes malloc_sizes[] = { @@ -1205,7 +1190,11 @@ static void *kmem_getpages(kmem_cache_t *cachep, gfp_t flags, int nodeid) int i; flags |= cachep->gfpflags; - page = alloc_pages_node(nodeid, flags, cachep->gfporder); + if (likely(nodeid == -1)) { + page = alloc_pages(flags, cachep->gfporder); + } else { + page = alloc_pages_node(nodeid, flags, cachep->gfporder); + } if (!page) return NULL; addr = page_address(page); @@ -1379,7 +1368,7 @@ static void check_poison_obj(kmem_cache_t *cachep, void *objp) /* Print some data about the neighboring objects, if they * exist: */ - struct slab *slabp = page_get_slab(virt_to_page(objp)); + struct slab *slabp = GET_PAGE_SLAB(virt_to_page(objp)); int objnr; objnr = (objp-slabp->s_mem)/cachep->objsize; @@ -2149,8 +2138,8 @@ static void set_slab_attr(kmem_cache_t *cachep, struct slab *slabp, void *objp) i = 1 << cachep->gfporder; page = virt_to_page(objp); do { - page_set_cache(page, cachep); - page_set_slab(page, slabp); + SET_PAGE_CACHE(page, cachep); + SET_PAGE_SLAB(page, slabp); page++; } while (--i); } @@ -2280,14 +2269,14 @@ static void *cache_free_debugcheck(kmem_cache_t *cachep, void *objp, kfree_debugcheck(objp); page = virt_to_page(objp); - if (page_get_cache(page) != cachep) { + if (GET_PAGE_CACHE(page) != cachep) { printk(KERN_ERR "mismatch in kmem_cache_free: expected cache %p, got %p\n", - page_get_cache(page),cachep); + GET_PAGE_CACHE(page),cachep); printk(KERN_ERR "%p is %s.\n", cachep, cachep->name); - printk(KERN_ERR "%p is %s.\n", page_get_cache(page), page_get_cache(page)->name); + printk(KERN_ERR "%p is %s.\n", GET_PAGE_CACHE(page), GET_PAGE_CACHE(page)->name); WARN_ON(1); } - slabp = page_get_slab(page); + slabp = GET_PAGE_SLAB(page); if (cachep->flags & SLAB_RED_ZONE) { if (*dbg_redzone1(cachep, objp) != RED_ACTIVE || *dbg_redzone2(cachep, objp) != RED_ACTIVE) { @@ -2639,7 +2628,7 @@ static void free_block(kmem_cache_t *cachep, void **objpp, int nr_objects, int n struct slab *slabp; unsigned int objnr; - slabp = page_get_slab(virt_to_page(objp)); + slabp = GET_PAGE_SLAB(virt_to_page(objp)); l3 = cachep->nodelists[node]; list_del(&slabp->list); objnr = (objp - slabp->s_mem) / cachep->objsize; @@ -2755,7 +2744,7 @@ static inline void __cache_free(kmem_cache_t *cachep, void *objp) #ifdef CONFIG_NUMA { struct slab *slabp; - slabp = page_get_slab(virt_to_page(objp)); + slabp = GET_PAGE_SLAB(virt_to_page(objp)); if (unlikely(slabp->nodeid != numa_node_id())) { struct array_cache *alien = NULL; int nodeid = slabp->nodeid; @@ -2841,7 +2830,7 @@ int fastcall kmem_ptr_validate(kmem_cache_t *cachep, void *ptr) page = virt_to_page(ptr); if (unlikely(!PageSlab(page))) goto out; - if (unlikely(page_get_cache(page) != cachep)) + if (unlikely(GET_PAGE_CACHE(page) != cachep)) goto out; return 1; out: @@ -3037,7 +3026,7 @@ void kfree(const void *objp) return; local_irq_save(flags); kfree_debugcheck(objp); - c = page_get_cache(virt_to_page(objp)); + c = GET_PAGE_CACHE(virt_to_page(objp)); __cache_free(c, (void*)objp); local_irq_restore(flags); } @@ -3607,7 +3596,7 @@ unsigned int ksize(const void *objp) if (unlikely(objp == NULL)) return 0; - return obj_reallen(page_get_cache(virt_to_page(objp))); + return obj_reallen(GET_PAGE_CACHE(virt_to_page(objp))); } diff --git a/trunk/mm/swap.c b/trunk/mm/swap.c index 73d351439ef6..d09cf7f03e76 100644 --- a/trunk/mm/swap.c +++ b/trunk/mm/swap.c @@ -34,6 +34,8 @@ /* How many pages do we try to swap or page in/out together? */ int page_cluster; +#ifdef CONFIG_HUGETLB_PAGE + void put_page(struct page *page) { if (unlikely(PageCompound(page))) { @@ -50,6 +52,7 @@ void put_page(struct page *page) __page_cache_release(page); } EXPORT_SYMBOL(put_page); +#endif /* * Writeback is about to end against a page which has been marked for immediate diff --git a/trunk/mm/thrash.c b/trunk/mm/thrash.c index f4c560b4a2b7..eff3c18c33a1 100644 --- a/trunk/mm/thrash.c +++ b/trunk/mm/thrash.c @@ -57,17 +57,14 @@ void grab_swap_token(void) /* We have the token. Let others know we still need it. */ if (has_swap_token(current->mm)) { current->mm->recent_pagein = 1; - if (unlikely(!swap_token_default_timeout)) - disable_swap_token(); return; } if (time_after(jiffies, swap_token_check)) { - if (!swap_token_default_timeout) { - swap_token_check = jiffies + SWAP_TOKEN_CHECK_INTERVAL; - return; - } + /* Can't get swapout protection if we exceed our RSS limit. */ + // if (current->mm->rss > current->mm->rlimit_rss) + // return; /* ... or if we recently held the token. */ if (time_before(jiffies, current->mm->swap_token_time)) @@ -98,7 +95,6 @@ void __put_swap_token(struct mm_struct *mm) { spin_lock(&swap_token_lock); if (likely(mm == swap_token_mm)) { - mm->swap_token_time = jiffies + SWAP_TOKEN_CHECK_INTERVAL; swap_token_mm = &init_mm; swap_token_check = jiffies; } diff --git a/trunk/mm/truncate.c b/trunk/mm/truncate.c index 9173ab500604..29c18f68dc35 100644 --- a/trunk/mm/truncate.c +++ b/trunk/mm/truncate.c @@ -282,8 +282,8 @@ int invalidate_inode_pages2_range(struct address_space *mapping, * Zap the rest of the file in one hit. */ unmap_mapping_range(mapping, - (loff_t)page_index<shrinker)(0, gfp_mask); delta = (4 * scanned) / shrinker->seeks; - delta *= max_pass; + delta *= (*shrinker->shrinker)(0, gfp_mask); do_div(delta, lru_pages + 1); shrinker->nr += delta; - if (shrinker->nr < 0) { - printk(KERN_ERR "%s: nr=%ld\n", - __FUNCTION__, shrinker->nr); - shrinker->nr = max_pass; - } - - /* - * Avoid risking looping forever due to too large nr value: - * never try to free more than twice the estimate number of - * freeable entries. - */ - if (shrinker->nr > max_pass * 2) - shrinker->nr = max_pass * 2; + if (shrinker->nr < 0) + shrinker->nr = LONG_MAX; /* It wrapped! */ total_scan = shrinker->nr; shrinker->nr = 0; @@ -419,7 +407,7 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc) if (PageWriteback(page)) goto keep_locked; - referenced = page_referenced(page, 1); + referenced = page_referenced(page, 1, sc->priority <= 0); /* In active use or really unfreeable? Activate it. */ if (referenced && page_mapping_inuse(page)) goto activate_locked; @@ -768,7 +756,7 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc) if (page_mapped(page)) { if (!reclaim_mapped || (total_swap_pages == 0 && PageAnon(page)) || - page_referenced(page, 0)) { + page_referenced(page, 0, sc->priority <= 0)) { list_add(&page->lru, &l_active); continue; } @@ -972,8 +960,6 @@ int try_to_free_pages(struct zone **zones, gfp_t gfp_mask) sc.nr_reclaimed = 0; sc.priority = priority; sc.swap_cluster_max = SWAP_CLUSTER_MAX; - if (!priority) - disable_swap_token(); shrink_caches(zones, &sc); shrink_slab(sc.nr_scanned, gfp_mask, lru_pages); if (reclaim_state) { @@ -1070,10 +1056,6 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, int order) int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */ unsigned long lru_pages = 0; - /* The swap token gets in the way of swapout... */ - if (!priority) - disable_swap_token(); - all_zones_ok = 1; if (nr_pages == 0) { @@ -1092,7 +1074,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, int order) continue; if (!zone_watermark_ok(zone, order, - zone->pages_high, 0, 0)) { + zone->pages_high, 0, 0, 0)) { end_zone = i; goto scan; } @@ -1129,7 +1111,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, int order) if (nr_pages == 0) { /* Not software suspend */ if (!zone_watermark_ok(zone, order, - zone->pages_high, end_zone, 0)) + zone->pages_high, end_zone, 0, 0)) all_zones_ok = 0; } zone->temp_priority = priority; @@ -1277,7 +1259,7 @@ void wakeup_kswapd(struct zone *zone, int order) return; pgdat = zone->zone_pgdat; - if (zone_watermark_ok(zone, order, zone->pages_low, 0, 0)) + if (zone_watermark_ok(zone, order, zone->pages_low, 0, 0, 0)) return; if (pgdat->kswapd_max_order < order) pgdat->kswapd_max_order = order; @@ -1378,7 +1360,6 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order) sc.nr_reclaimed = 0; /* scan at the highest priority */ sc.priority = 0; - disable_swap_token(); if (nr_pages > SWAP_CLUSTER_MAX) sc.swap_cluster_max = nr_pages; diff --git a/trunk/net/8021q/vlan.c b/trunk/net/8021q/vlan.c index 67465b65abe4..91e412b0ab00 100644 --- a/trunk/net/8021q/vlan.c +++ b/trunk/net/8021q/vlan.c @@ -753,8 +753,6 @@ static int vlan_ioctl_handler(void __user *arg) break; case GET_VLAN_REALDEV_NAME_CMD: err = vlan_dev_get_realdev_name(args.device1, args.u.device2); - if (err) - goto out; if (copy_to_user(arg, &args, sizeof(struct vlan_ioctl_args))) { err = -EFAULT; @@ -763,8 +761,6 @@ static int vlan_ioctl_handler(void __user *arg) case GET_VLAN_VID_CMD: err = vlan_dev_get_vid(args.device1, &vid); - if (err) - goto out; args.u.VID = vid; if (copy_to_user(arg, &args, sizeof(struct vlan_ioctl_args))) { @@ -778,7 +774,7 @@ static int vlan_ioctl_handler(void __user *arg) __FUNCTION__, args.cmd); return -EINVAL; }; -out: + return err; } diff --git a/trunk/net/8021q/vlan_dev.c b/trunk/net/8021q/vlan_dev.c index f2a8750bbf1d..b74864889670 100644 --- a/trunk/net/8021q/vlan_dev.c +++ b/trunk/net/8021q/vlan_dev.c @@ -165,9 +165,6 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev, skb_pull(skb, VLAN_HLEN); /* take off the VLAN header (4 bytes currently) */ - /* Need to correct hardware checksum */ - skb_postpull_rcsum(skb, vhdr, VLAN_HLEN); - /* Ok, lets check to make sure the device (dev) we * came in on is what this VLAN is attached to. */ diff --git a/trunk/net/Makefile b/trunk/net/Makefile index f5141b9d4f38..4aa2f46d2a56 100644 --- a/trunk/net/Makefile +++ b/trunk/net/Makefile @@ -15,8 +15,8 @@ obj-$(CONFIG_NET) += $(tmp-y) # LLC has to be linked before the files in net/802/ obj-$(CONFIG_LLC) += llc/ obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/ -obj-$(CONFIG_NETFILTER) += netfilter/ obj-$(CONFIG_INET) += ipv4/ +obj-$(CONFIG_NETFILTER) += netfilter/ obj-$(CONFIG_XFRM) += xfrm/ obj-$(CONFIG_UNIX) += unix/ ifneq ($(CONFIG_IPV6),) diff --git a/trunk/net/appletalk/ddp.c b/trunk/net/appletalk/ddp.c index a5144e43aae1..7982656b9c83 100644 --- a/trunk/net/appletalk/ddp.c +++ b/trunk/net/appletalk/ddp.c @@ -63,7 +63,7 @@ #include struct datalink_proto *ddp_dl, *aarp_dl; -static const struct proto_ops atalk_dgram_ops; +static struct proto_ops atalk_dgram_ops; /**************************************************************************\ * * @@ -1763,7 +1763,7 @@ static int atalk_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr */ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { - int rc = -ENOIOCTLCMD; + int rc = -EINVAL; struct sock *sk = sock->sk; void __user *argp = (void __user *)arg; @@ -1813,6 +1813,23 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) rc = atif_ioctl(cmd, argp); rtnl_unlock(); break; + /* Physical layer ioctl calls */ + case SIOCSIFLINK: + case SIOCGIFHWADDR: + case SIOCSIFHWADDR: + case SIOCGIFFLAGS: + case SIOCSIFFLAGS: + case SIOCGIFTXQLEN: + case SIOCSIFTXQLEN: + case SIOCGIFMTU: + case SIOCGIFCONF: + case SIOCADDMULTI: + case SIOCDELMULTI: + case SIOCGIFCOUNT: + case SIOCGIFINDEX: + case SIOCGIFNAME: + rc = dev_ioctl(cmd, argp); + break; } return rc; @@ -1824,7 +1841,7 @@ static struct net_proto_family atalk_family_ops = { .owner = THIS_MODULE, }; -static const struct proto_ops SOCKOPS_WRAPPED(atalk_dgram_ops) = { +static struct proto_ops SOCKOPS_WRAPPED(atalk_dgram_ops) = { .family = PF_APPLETALK, .owner = THIS_MODULE, .release = atalk_release, diff --git a/trunk/net/atm/atm_misc.c b/trunk/net/atm/atm_misc.c index 02cc7e71efea..223c7ad5bd0f 100644 --- a/trunk/net/atm/atm_misc.c +++ b/trunk/net/atm/atm_misc.c @@ -74,14 +74,11 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, */ -int atm_pcr_goal(const struct atm_trafprm *tp) +int atm_pcr_goal(struct atm_trafprm *tp) { - if (tp->pcr && tp->pcr != ATM_MAX_PCR) - return -tp->pcr; - if (tp->min_pcr && !tp->pcr) - return tp->min_pcr; - if (tp->max_pcr != ATM_MAX_PCR) - return -tp->max_pcr; + if (tp->pcr && tp->pcr != ATM_MAX_PCR) return -tp->pcr; + if (tp->min_pcr && !tp->pcr) return tp->min_pcr; + if (tp->max_pcr != ATM_MAX_PCR) return -tp->max_pcr; return 0; } diff --git a/trunk/net/atm/common.c b/trunk/net/atm/common.c index 6656b111cc05..63feea49fb13 100644 --- a/trunk/net/atm/common.c +++ b/trunk/net/atm/common.c @@ -221,29 +221,6 @@ void vcc_release_async(struct atm_vcc *vcc, int reply) EXPORT_SYMBOL(vcc_release_async); -void atm_dev_release_vccs(struct atm_dev *dev) -{ - int i; - - write_lock_irq(&vcc_sklist_lock); - for (i = 0; i < VCC_HTABLE_SIZE; i++) { - struct hlist_head *head = &vcc_hash[i]; - struct hlist_node *node, *tmp; - struct sock *s; - struct atm_vcc *vcc; - - sk_for_each_safe(s, node, tmp, head) { - vcc = atm_sk(s); - if (vcc->dev == dev) { - vcc_release_async(vcc, -EPIPE); - sk_del_node_init(s); - } - } - } - write_unlock_irq(&vcc_sklist_lock); -} - - static int adjust_tp(struct atm_trafprm *tp,unsigned char aal) { int max_sdu; @@ -355,13 +332,12 @@ static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, short vpi, return -EINVAL; if (vci > 0 && vci < ATM_NOT_RSV_VCI && !capable(CAP_NET_BIND_SERVICE)) return -EPERM; - error = -ENODEV; + error = 0; if (!try_module_get(dev->ops->owner)) - return error; + return -ENODEV; vcc->dev = dev; write_lock_irq(&vcc_sklist_lock); - if (test_bit(ATM_DF_REMOVED, &dev->flags) || - (error = find_ci(vcc, &vpi, &vci))) { + if ((error = find_ci(vcc, &vpi, &vci))) { write_unlock_irq(&vcc_sklist_lock); goto fail_module_put; } @@ -447,23 +423,33 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci) if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS || vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) return -EINVAL; - if (likely(itf != ATM_ITF_ANY)) { - dev = try_then_request_module(atm_dev_lookup(itf), "atm-device-%d", itf); + if (itf != ATM_ITF_ANY) { + dev = atm_dev_lookup(itf); + if (!dev) + return -ENODEV; + error = __vcc_connect(vcc, dev, vpi, vci); + if (error) { + atm_dev_put(dev); + return error; + } } else { + struct list_head *p, *next; + dev = NULL; - down(&atm_dev_mutex); - if (!list_empty(&atm_devs)) { - dev = list_entry(atm_devs.next, struct atm_dev, dev_list); + spin_lock(&atm_dev_lock); + list_for_each_safe(p, next, &atm_devs) { + dev = list_entry(p, struct atm_dev, dev_list); atm_dev_hold(dev); + spin_unlock(&atm_dev_lock); + if (!__vcc_connect(vcc, dev, vpi, vci)) + break; + atm_dev_put(dev); + dev = NULL; + spin_lock(&atm_dev_lock); } - up(&atm_dev_mutex); - } - if (!dev) - return -ENODEV; - error = __vcc_connect(vcc, dev, vpi, vci); - if (error) { - atm_dev_put(dev); - return error; + spin_unlock(&atm_dev_lock); + if (!dev) + return -ENODEV; } if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC) set_bit(ATM_VF_PARTIAL,&vcc->flags); diff --git a/trunk/net/atm/common.h b/trunk/net/atm/common.h index 4887c317cefe..e49ed41c0e33 100644 --- a/trunk/net/atm/common.h +++ b/trunk/net/atm/common.h @@ -47,6 +47,4 @@ static inline void atm_proc_exit(void) /* SVC */ int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos); -void atm_dev_release_vccs(struct atm_dev *dev); - #endif diff --git a/trunk/net/atm/pvc.c b/trunk/net/atm/pvc.c index f2c541774dcd..2684a92da22b 100644 --- a/trunk/net/atm/pvc.c +++ b/trunk/net/atm/pvc.c @@ -102,7 +102,7 @@ static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr, } -static const struct proto_ops pvc_proto_ops = { +static struct proto_ops pvc_proto_ops = { .family = PF_ATMPVC, .owner = THIS_MODULE, diff --git a/trunk/net/atm/resources.c b/trunk/net/atm/resources.c index c8c459fcb038..415d2615d475 100644 --- a/trunk/net/atm/resources.c +++ b/trunk/net/atm/resources.c @@ -25,7 +25,7 @@ LIST_HEAD(atm_devs); -DECLARE_MUTEX(atm_dev_mutex); +DEFINE_SPINLOCK(atm_dev_lock); static struct atm_dev *__alloc_atm_dev(const char *type) { @@ -52,7 +52,7 @@ static struct atm_dev *__atm_dev_lookup(int number) list_for_each(p, &atm_devs) { dev = list_entry(p, struct atm_dev, dev_list); - if (dev->number == number) { + if ((dev->ops) && (dev->number == number)) { atm_dev_hold(dev); return dev; } @@ -64,13 +64,12 @@ struct atm_dev *atm_dev_lookup(int number) { struct atm_dev *dev; - down(&atm_dev_mutex); + spin_lock(&atm_dev_lock); dev = __atm_dev_lookup(number); - up(&atm_dev_mutex); + spin_unlock(&atm_dev_lock); return dev; } - struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, int number, unsigned long *flags) { @@ -82,11 +81,11 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, type); return NULL; } - down(&atm_dev_mutex); + spin_lock(&atm_dev_lock); if (number != -1) { if ((inuse = __atm_dev_lookup(number))) { atm_dev_put(inuse); - up(&atm_dev_mutex); + spin_unlock(&atm_dev_lock); kfree(dev); return NULL; } @@ -106,17 +105,19 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, memset(&dev->flags, 0, sizeof(dev->flags)); memset(&dev->stats, 0, sizeof(dev->stats)); atomic_set(&dev->refcnt, 1); + list_add_tail(&dev->dev_list, &atm_devs); + spin_unlock(&atm_dev_lock); if (atm_proc_dev_register(dev) < 0) { printk(KERN_ERR "atm_dev_register: " "atm_proc_dev_register failed for dev %s\n", type); - up(&atm_dev_mutex); + spin_lock(&atm_dev_lock); + list_del(&dev->dev_list); + spin_unlock(&atm_dev_lock); kfree(dev); return NULL; } - list_add_tail(&dev->dev_list, &atm_devs); - up(&atm_dev_mutex); return dev; } @@ -124,22 +125,37 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, void atm_dev_deregister(struct atm_dev *dev) { - BUG_ON(test_bit(ATM_DF_REMOVED, &dev->flags)); - set_bit(ATM_DF_REMOVED, &dev->flags); - - /* - * if we remove current device from atm_devs list, new device - * with same number can appear, such we need deregister proc, - * release async all vccs and remove them from vccs list too - */ - down(&atm_dev_mutex); - list_del(&dev->dev_list); - up(&atm_dev_mutex); + unsigned long warning_time; - atm_dev_release_vccs(dev); atm_proc_dev_deregister(dev); - atm_dev_put(dev); + spin_lock(&atm_dev_lock); + list_del(&dev->dev_list); + spin_unlock(&atm_dev_lock); + + warning_time = jiffies; + while (atomic_read(&dev->refcnt) != 1) { + msleep(250); + if ((jiffies - warning_time) > 10 * HZ) { + printk(KERN_EMERG "atm_dev_deregister: waiting for " + "dev %d to become free. Usage count = %d\n", + dev->number, atomic_read(&dev->refcnt)); + warning_time = jiffies; + } + } + + kfree(dev); +} + +void shutdown_atm_dev(struct atm_dev *dev) +{ + if (atomic_read(&dev->refcnt) > 1) { + set_bit(ATM_DF_CLOSE, &dev->flags); + return; + } + if (dev->ops->dev_close) + dev->ops->dev_close(dev); + atm_dev_deregister(dev); } @@ -195,16 +211,16 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg) return -EFAULT; if (get_user(len, &iobuf->length)) return -EFAULT; - down(&atm_dev_mutex); + spin_lock(&atm_dev_lock); list_for_each(p, &atm_devs) size += sizeof(int); if (size > len) { - up(&atm_dev_mutex); + spin_unlock(&atm_dev_lock); return -E2BIG; } tmp_buf = kmalloc(size, GFP_ATOMIC); if (!tmp_buf) { - up(&atm_dev_mutex); + spin_unlock(&atm_dev_lock); return -ENOMEM; } tmp_p = tmp_buf; @@ -212,7 +228,7 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg) dev = list_entry(p, struct atm_dev, dev_list); *tmp_p++ = dev->number; } - up(&atm_dev_mutex); + spin_unlock(&atm_dev_lock); error = ((copy_to_user(buf, tmp_buf, size)) || put_user(size, &iobuf->length)) ? -EFAULT : 0; @@ -229,8 +245,7 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg) if (get_user(number, &sioc->number)) return -EFAULT; - if (!(dev = try_then_request_module(atm_dev_lookup(number), - "atm-device-%d", number))) + if (!(dev = atm_dev_lookup(number))) return -ENODEV; switch (cmd) { @@ -399,13 +414,13 @@ static __inline__ void *dev_get_idx(loff_t left) void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos) { - down(&atm_dev_mutex); + spin_lock(&atm_dev_lock); return *pos ? dev_get_idx(*pos) : (void *) 1; } void atm_dev_seq_stop(struct seq_file *seq, void *v) { - up(&atm_dev_mutex); + spin_unlock(&atm_dev_lock); } void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -419,3 +434,4 @@ void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) EXPORT_SYMBOL(atm_dev_register); EXPORT_SYMBOL(atm_dev_deregister); EXPORT_SYMBOL(atm_dev_lookup); +EXPORT_SYMBOL(shutdown_atm_dev); diff --git a/trunk/net/atm/resources.h b/trunk/net/atm/resources.h index b7fb82a93b42..12910619dbb6 100644 --- a/trunk/net/atm/resources.h +++ b/trunk/net/atm/resources.h @@ -11,7 +11,8 @@ extern struct list_head atm_devs; -extern struct semaphore atm_dev_mutex; +extern spinlock_t atm_dev_lock; + int atm_dev_ioctl(unsigned int cmd, void __user *arg); diff --git a/trunk/net/atm/svc.c b/trunk/net/atm/svc.c index 3a180cfd7b48..d7b266136bf6 100644 --- a/trunk/net/atm/svc.c +++ b/trunk/net/atm/svc.c @@ -613,7 +613,7 @@ static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) return error; } -static const struct proto_ops svc_proto_ops = { +static struct proto_ops svc_proto_ops = { .family = PF_ATMSVC, .owner = THIS_MODULE, diff --git a/trunk/net/ax25/af_ax25.c b/trunk/net/ax25/af_ax25.c index e8753c7fcad1..1b683f302657 100644 --- a/trunk/net/ax25/af_ax25.c +++ b/trunk/net/ax25/af_ax25.c @@ -54,7 +54,7 @@ HLIST_HEAD(ax25_list); DEFINE_SPINLOCK(ax25_list_lock); -static const struct proto_ops ax25_proto_ops; +static struct proto_ops ax25_proto_ops; static void ax25_free_sock(struct sock *sk) { @@ -1827,7 +1827,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) break; default: - res = -ENOIOCTLCMD; + res = dev_ioctl(cmd, argp); break; } release_sock(sk); @@ -1944,7 +1944,7 @@ static struct net_proto_family ax25_family_ops = { .owner = THIS_MODULE, }; -static const struct proto_ops ax25_proto_ops = { +static struct proto_ops ax25_proto_ops = { .family = PF_AX25, .owner = THIS_MODULE, .release = ax25_release, diff --git a/trunk/net/bluetooth/af_bluetooth.c b/trunk/net/bluetooth/af_bluetooth.c index fb031fe9be9e..ea616e3fc98e 100644 --- a/trunk/net/bluetooth/af_bluetooth.c +++ b/trunk/net/bluetooth/af_bluetooth.c @@ -287,9 +287,10 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo) timeo = schedule_timeout(timeo); lock_sock(sk); - err = sock_error(sk); - if (err) + if (sk->sk_err) { + err = sock_error(sk); break; + } } set_current_state(TASK_RUNNING); remove_wait_queue(sk->sk_sleep, &wait); diff --git a/trunk/net/bluetooth/bnep/sock.c b/trunk/net/bluetooth/bnep/sock.c index ccbaf69afc5b..9778c6acd53b 100644 --- a/trunk/net/bluetooth/bnep/sock.c +++ b/trunk/net/bluetooth/bnep/sock.c @@ -146,7 +146,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long return 0; } -static const struct proto_ops bnep_sock_ops = { +static struct proto_ops bnep_sock_ops = { .family = PF_BLUETOOTH, .owner = THIS_MODULE, .release = bnep_sock_release, diff --git a/trunk/net/bluetooth/cmtp/sock.c b/trunk/net/bluetooth/cmtp/sock.c index 5e22343b6090..beb045bf5714 100644 --- a/trunk/net/bluetooth/cmtp/sock.c +++ b/trunk/net/bluetooth/cmtp/sock.c @@ -137,7 +137,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long return -EINVAL; } -static const struct proto_ops cmtp_sock_ops = { +static struct proto_ops cmtp_sock_ops = { .family = PF_BLUETOOTH, .owner = THIS_MODULE, .release = cmtp_sock_release, diff --git a/trunk/net/bluetooth/hci_sock.c b/trunk/net/bluetooth/hci_sock.c index 84e6c93a044a..1d6d0a15c099 100644 --- a/trunk/net/bluetooth/hci_sock.c +++ b/trunk/net/bluetooth/hci_sock.c @@ -575,7 +575,7 @@ static int hci_sock_getsockopt(struct socket *sock, int level, int optname, char return 0; } -static const struct proto_ops hci_sock_ops = { +static struct proto_ops hci_sock_ops = { .family = PF_BLUETOOTH, .owner = THIS_MODULE, .release = hci_sock_release, diff --git a/trunk/net/bluetooth/hidp/sock.c b/trunk/net/bluetooth/hidp/sock.c index 8f8dd931b294..f8986f881431 100644 --- a/trunk/net/bluetooth/hidp/sock.c +++ b/trunk/net/bluetooth/hidp/sock.c @@ -143,7 +143,7 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long return -EINVAL; } -static const struct proto_ops hidp_sock_ops = { +static struct proto_ops hidp_sock_ops = { .family = PF_BLUETOOTH, .owner = THIS_MODULE, .release = hidp_sock_release, diff --git a/trunk/net/bluetooth/l2cap.c b/trunk/net/bluetooth/l2cap.c index 7f0781e4326f..e3bb11ca4235 100644 --- a/trunk/net/bluetooth/l2cap.c +++ b/trunk/net/bluetooth/l2cap.c @@ -57,7 +57,7 @@ #define VERSION "2.8" -static const struct proto_ops l2cap_sock_ops; +static struct proto_ops l2cap_sock_ops; static struct bt_sock_list l2cap_sk_list = { .lock = RW_LOCK_UNLOCKED @@ -767,9 +767,8 @@ static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct ms BT_DBG("sock %p, sk %p", sock, sk); - err = sock_error(sk); - if (err) - return err; + if (sk->sk_err) + return sock_error(sk); if (msg->msg_flags & MSG_OOB) return -EOPNOTSUPP; @@ -2161,7 +2160,7 @@ static ssize_t l2cap_sysfs_show(struct class *dev, char *buf) static CLASS_ATTR(l2cap, S_IRUGO, l2cap_sysfs_show, NULL); -static const struct proto_ops l2cap_sock_ops = { +static struct proto_ops l2cap_sock_ops = { .family = PF_BLUETOOTH, .owner = THIS_MODULE, .release = l2cap_sock_release, diff --git a/trunk/net/bluetooth/rfcomm/sock.c b/trunk/net/bluetooth/rfcomm/sock.c index 757d2dd3b02f..6c34261b232e 100644 --- a/trunk/net/bluetooth/rfcomm/sock.c +++ b/trunk/net/bluetooth/rfcomm/sock.c @@ -58,7 +58,7 @@ #define BT_DBG(D...) #endif -static const struct proto_ops rfcomm_sock_ops; +static struct proto_ops rfcomm_sock_ops; static struct bt_sock_list rfcomm_sk_list = { .lock = RW_LOCK_UNLOCKED @@ -907,7 +907,7 @@ static ssize_t rfcomm_sock_sysfs_show(struct class *dev, char *buf) static CLASS_ATTR(rfcomm, S_IRUGO, rfcomm_sock_sysfs_show, NULL); -static const struct proto_ops rfcomm_sock_ops = { +static struct proto_ops rfcomm_sock_ops = { .family = PF_BLUETOOTH, .owner = THIS_MODULE, .release = rfcomm_sock_release, diff --git a/trunk/net/bluetooth/sco.c b/trunk/net/bluetooth/sco.c index 6b61323ce23c..9cb00dc6c08c 100644 --- a/trunk/net/bluetooth/sco.c +++ b/trunk/net/bluetooth/sco.c @@ -56,7 +56,7 @@ #define VERSION "0.5" -static const struct proto_ops sco_sock_ops; +static struct proto_ops sco_sock_ops; static struct bt_sock_list sco_sk_list = { .lock = RW_LOCK_UNLOCKED @@ -637,9 +637,8 @@ static int sco_sock_sendmsg(struct kiocb *iocb, struct socket *sock, BT_DBG("sock %p, sk %p", sock, sk); - err = sock_error(sk); - if (err) - return err; + if (sk->sk_err) + return sock_error(sk); if (msg->msg_flags & MSG_OOB) return -EOPNOTSUPP; @@ -914,7 +913,7 @@ static ssize_t sco_sysfs_show(struct class *dev, char *buf) static CLASS_ATTR(sco, S_IRUGO, sco_sysfs_show, NULL); -static const struct proto_ops sco_sock_ops = { +static struct proto_ops sco_sock_ops = { .family = PF_BLUETOOTH, .owner = THIS_MODULE, .release = sco_sock_release, diff --git a/trunk/net/bridge/br.c b/trunk/net/bridge/br.c index 188cc1ac49eb..f8f184942aaf 100644 --- a/trunk/net/bridge/br.c +++ b/trunk/net/bridge/br.c @@ -67,4 +67,3 @@ EXPORT_SYMBOL(br_should_route_hook); module_init(br_init) module_exit(br_deinit) MODULE_LICENSE("GPL"); -MODULE_VERSION(BR_VERSION); diff --git a/trunk/net/bridge/br_device.c b/trunk/net/bridge/br_device.c index 0b33a7b3a00c..f564ee99782d 100644 --- a/trunk/net/bridge/br_device.c +++ b/trunk/net/bridge/br_device.c @@ -15,9 +15,7 @@ #include #include -#include -#include - +#include #include #include "br_private.h" @@ -84,87 +82,6 @@ static int br_change_mtu(struct net_device *dev, int new_mtu) return 0; } -/* Allow setting mac address of pseudo-bridge to be same as - * any of the bound interfaces - */ -static int br_set_mac_address(struct net_device *dev, void *p) -{ - struct net_bridge *br = netdev_priv(dev); - struct sockaddr *addr = p; - struct net_bridge_port *port; - int err = -EADDRNOTAVAIL; - - spin_lock_bh(&br->lock); - list_for_each_entry(port, &br->port_list, list) { - if (!compare_ether_addr(port->dev->dev_addr, addr->sa_data)) { - br_stp_change_bridge_id(br, addr->sa_data); - err = 0; - break; - } - } - spin_unlock_bh(&br->lock); - - return err; -} - -static void br_getinfo(struct net_device *dev, struct ethtool_drvinfo *info) -{ - strcpy(info->driver, "bridge"); - strcpy(info->version, BR_VERSION); - strcpy(info->fw_version, "N/A"); - strcpy(info->bus_info, "N/A"); -} - -static int br_set_sg(struct net_device *dev, u32 data) -{ - struct net_bridge *br = netdev_priv(dev); - - if (data) - br->feature_mask |= NETIF_F_SG; - else - br->feature_mask &= ~NETIF_F_SG; - - br_features_recompute(br); - return 0; -} - -static int br_set_tso(struct net_device *dev, u32 data) -{ - struct net_bridge *br = netdev_priv(dev); - - if (data) - br->feature_mask |= NETIF_F_TSO; - else - br->feature_mask &= ~NETIF_F_TSO; - - br_features_recompute(br); - return 0; -} - -static int br_set_tx_csum(struct net_device *dev, u32 data) -{ - struct net_bridge *br = netdev_priv(dev); - - if (data) - br->feature_mask |= NETIF_F_IP_CSUM; - else - br->feature_mask &= ~NETIF_F_IP_CSUM; - - br_features_recompute(br); - return 0; -} - -static struct ethtool_ops br_ethtool_ops = { - .get_drvinfo = br_getinfo, - .get_link = ethtool_op_get_link, - .get_sg = ethtool_op_get_sg, - .set_sg = br_set_sg, - .get_tx_csum = ethtool_op_get_tx_csum, - .set_tx_csum = br_set_tx_csum, - .get_tso = ethtool_op_get_tso, - .set_tso = br_set_tso, -}; - void br_dev_setup(struct net_device *dev) { memset(dev->dev_addr, 0, ETH_ALEN); @@ -179,12 +96,8 @@ void br_dev_setup(struct net_device *dev) dev->change_mtu = br_change_mtu; dev->destructor = free_netdev; SET_MODULE_OWNER(dev); - SET_ETHTOOL_OPS(dev, &br_ethtool_ops); dev->stop = br_dev_stop; dev->tx_queue_len = 0; - dev->set_mac_address = br_set_mac_address; + dev->set_mac_address = NULL; dev->priv_flags = IFF_EBRIDGE; - - dev->features = NETIF_F_SG | NETIF_F_FRAGLIST - | NETIF_F_HIGHDMA | NETIF_F_TSO | NETIF_F_IP_CSUM; } diff --git a/trunk/net/bridge/br_if.c b/trunk/net/bridge/br_if.c index 11321197338e..defcf6a8607c 100644 --- a/trunk/net/bridge/br_if.c +++ b/trunk/net/bridge/br_if.c @@ -32,8 +32,9 @@ * ethtool, use ethtool_ops. Also, since driver might sleep need to * not be holding any locks. */ -static int port_cost(struct net_device *dev) +static int br_initial_port_cost(struct net_device *dev) { + struct ethtool_cmd ecmd = { ETHTOOL_GSET }; struct ifreq ifr; mm_segment_t old_fs; @@ -57,6 +58,10 @@ static int port_cost(struct net_device *dev) return 2; case SPEED_10: return 100; + default: + pr_info("bridge: can't decode speed from %s: %d\n", + dev->name, ecmd.speed); + return 100; } } @@ -70,35 +75,6 @@ static int port_cost(struct net_device *dev) return 100; /* assume old 10Mbps */ } - -/* - * Check for port carrier transistions. - * Called from work queue to allow for calling functions that - * might sleep (such as speed check), and to debounce. - */ -static void port_carrier_check(void *arg) -{ - struct net_bridge_port *p = arg; - - rtnl_lock(); - if (netif_carrier_ok(p->dev)) { - u32 cost = port_cost(p->dev); - - spin_lock_bh(&p->br->lock); - if (p->state == BR_STATE_DISABLED) { - p->path_cost = cost; - br_stp_enable_port(p); - } - spin_unlock_bh(&p->br->lock); - } else { - spin_lock_bh(&p->br->lock); - if (p->state != BR_STATE_DISABLED) - br_stp_disable_port(p); - spin_unlock_bh(&p->br->lock); - } - rtnl_unlock(); -} - static void destroy_nbp(struct net_bridge_port *p) { struct net_device *dev = p->dev; @@ -126,9 +102,6 @@ static void del_nbp(struct net_bridge_port *p) dev->br_port = NULL; dev_set_promiscuity(dev, -1); - cancel_delayed_work(&p->carrier_check); - flush_scheduled_work(); - spin_lock_bh(&br->lock); br_stp_disable_port(p); spin_unlock_bh(&br->lock); @@ -182,7 +155,6 @@ static struct net_device *new_bridge_dev(const char *name) br->bridge_id.prio[1] = 0x00; memset(br->bridge_id.addr, 0, ETH_ALEN); - br->feature_mask = dev->features; br->stp_enabled = 0; br->designated_root = br->bridge_id; br->root_path_cost = 0; @@ -223,9 +195,10 @@ static int find_portno(struct net_bridge *br) return (index >= BR_MAX_PORTS) ? -EXFULL : index; } -/* called with RTNL but without bridge lock */ +/* called with RTNL */ static struct net_bridge_port *new_nbp(struct net_bridge *br, - struct net_device *dev) + struct net_device *dev, + unsigned long cost) { int index; struct net_bridge_port *p; @@ -242,13 +215,12 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, p->br = br; dev_hold(dev); p->dev = dev; - p->path_cost = port_cost(dev); + p->path_cost = cost; p->priority = 0x8000 >> BR_PORT_BITS; dev->br_port = p; p->port_no = index; br_init_port(p); p->state = BR_STATE_DISABLED; - INIT_WORK(&p->carrier_check, port_carrier_check, p); kobject_init(&p->kobj); return p; @@ -350,8 +322,9 @@ void br_features_recompute(struct net_bridge *br) struct net_bridge_port *p; unsigned long features, checksum; - features = br->feature_mask &~ NETIF_F_IP_CSUM; - checksum = br->feature_mask & NETIF_F_IP_CSUM; + features = NETIF_F_SG | NETIF_F_FRAGLIST + | NETIF_F_HIGHDMA | NETIF_F_TSO; + checksum = NETIF_F_IP_CSUM; /* least commmon subset */ list_for_each_entry(p, &br->port_list, list) { if (!(p->dev->features @@ -378,7 +351,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) if (dev->br_port != NULL) return -EBUSY; - if (IS_ERR(p = new_nbp(br, dev))) + if (IS_ERR(p = new_nbp(br, dev, br_initial_port_cost(dev)))) return PTR_ERR(p); if ((err = br_fdb_insert(br, p, dev->dev_addr))) @@ -393,7 +366,6 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) spin_lock_bh(&br->lock); br_stp_recalculate_bridge_id(br); - br_features_recompute(br); if ((br->dev->flags & IFF_UP) && (dev->flags & IFF_UP) && netif_carrier_ok(dev)) br_stp_enable_port(p); diff --git a/trunk/net/bridge/br_input.c b/trunk/net/bridge/br_input.c index c387852f753a..b88220a64cd8 100644 --- a/trunk/net/bridge/br_input.c +++ b/trunk/net/bridge/br_input.c @@ -53,11 +53,6 @@ int br_handle_frame_finish(struct sk_buff *skb) /* insert into forwarding database after filtering to avoid spoofing */ br_fdb_update(p->br, p, eth_hdr(skb)->h_source); - if (p->state == BR_STATE_LEARNING) { - kfree_skb(skb); - goto out; - } - if (br->dev->flags & IFF_PROMISC) { struct sk_buff *skb2; @@ -112,6 +107,9 @@ int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb) if (!is_valid_ether_addr(eth_hdr(skb)->h_source)) goto err; + if (p->state == BR_STATE_LEARNING) + br_fdb_update(p->br, p, eth_hdr(skb)->h_source); + if (p->br->stp_enabled && !memcmp(dest, bridge_ula, 5) && !(dest[5] & 0xF0)) { @@ -120,10 +118,9 @@ int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb) NULL, br_stp_handle_bpdu); return 1; } - goto err; } - if (p->state == BR_STATE_FORWARDING || p->state == BR_STATE_LEARNING) { + else if (p->state == BR_STATE_FORWARDING) { if (br_should_route_hook) { if (br_should_route_hook(pskb)) return 0; diff --git a/trunk/net/bridge/br_netfilter.c b/trunk/net/bridge/br_netfilter.c index 223f8270daee..d8e36b775125 100644 --- a/trunk/net/bridge/br_netfilter.c +++ b/trunk/net/bridge/br_netfilter.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -34,11 +33,8 @@ #include #include #include - #include #include -#include - #include #include #include "br_private.h" @@ -299,7 +295,7 @@ static int check_hbh_len(struct sk_buff *skb) len -= 2; while (len > 0) { - int optlen = skb->nh.raw[off+1]+2; + int optlen = raw[off+1]+2; switch (skb->nh.raw[off]) { case IPV6_TLV_PAD0: @@ -312,15 +308,18 @@ static int check_hbh_len(struct sk_buff *skb) case IPV6_TLV_JUMBO: if (skb->nh.raw[off+1] != 4 || (off&3) != 2) goto bad; + pkt_len = ntohl(*(u32*)(skb->nh.raw+off+2)); - if (pkt_len <= IPV6_MAXPLEN || - skb->nh.ipv6h->payload_len) - goto bad; + if (pkt_len > skb->len - sizeof(struct ipv6hdr)) goto bad; - if (pskb_trim_rcsum(skb, - pkt_len+sizeof(struct ipv6hdr))) - goto bad; + if (pkt_len + sizeof(struct ipv6hdr) < skb->len) { + if (__pskb_trim(skb, + pkt_len + sizeof(struct ipv6hdr))) + goto bad; + if (skb->ip_summed == CHECKSUM_HW) + skb->ip_summed = CHECKSUM_NONE; + } break; default: if (optlen > len) @@ -373,7 +372,6 @@ static unsigned int br_nf_pre_routing_ipv6(unsigned int hook, if (hdr->nexthdr == NEXTHDR_HOP && check_hbh_len(skb)) goto inhdr_error; - nf_bridge_put(skb->nf_bridge); if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) return NF_DROP; setup_pre_routing(skb); @@ -457,7 +455,6 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb, skb->ip_summed = CHECKSUM_NONE; } - nf_bridge_put(skb->nf_bridge); if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) return NF_DROP; setup_pre_routing(skb); diff --git a/trunk/net/bridge/br_notify.c b/trunk/net/bridge/br_notify.c index a43a9c1d50d7..917311c6828b 100644 --- a/trunk/net/bridge/br_notify.c +++ b/trunk/net/bridge/br_notify.c @@ -52,9 +52,17 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v br_stp_recalculate_bridge_id(br); break; - case NETDEV_CHANGE: - if (br->dev->flags & IFF_UP) - schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE); + case NETDEV_CHANGE: /* device is up but carrier changed */ + if (!(br->dev->flags & IFF_UP)) + break; + + if (netif_carrier_ok(dev)) { + if (p->state == BR_STATE_DISABLED) + br_stp_enable_port(p); + } else { + if (p->state != BR_STATE_DISABLED) + br_stp_disable_port(p); + } break; case NETDEV_FEAT_CHANGE: diff --git a/trunk/net/bridge/br_private.h b/trunk/net/bridge/br_private.h index c5bd631ffcd5..bdf95a74d8cd 100644 --- a/trunk/net/bridge/br_private.h +++ b/trunk/net/bridge/br_private.h @@ -27,10 +27,6 @@ #define BR_PORT_BITS 10 #define BR_MAX_PORTS (1<port_list, list) { if (addr == br_mac_zero || - memcmp(p->dev->dev_addr, addr, ETH_ALEN) < 0) + compare_ether_addr(p->dev->dev_addr, addr) < 0) addr = p->dev->dev_addr; } diff --git a/trunk/net/bridge/netfilter/Kconfig b/trunk/net/bridge/netfilter/Kconfig index b84fc6075fe1..c70b3be23026 100644 --- a/trunk/net/bridge/netfilter/Kconfig +++ b/trunk/net/bridge/netfilter/Kconfig @@ -196,13 +196,9 @@ config BRIDGE_EBT_LOG To compile it as a module, choose M here. If unsure, say N. config BRIDGE_EBT_ULOG - tristate "ebt: ulog support (OBSOLETE)" + tristate "ebt: ulog support" depends on BRIDGE_NF_EBTABLES help - This option enables the old bridge-specific "ebt_ulog" implementation - which has been obsoleted by the new "nfnetlink_log" code (see - CONFIG_NETFILTER_NETLINK_LOG). - This option adds the ulog watcher, that you can use in any rule in any ebtables table. The packet is passed to a userspace logging daemon using netlink multicast sockets. This differs diff --git a/trunk/net/bridge/netfilter/ebt_log.c b/trunk/net/bridge/netfilter/ebt_log.c index 9f6e0193ae10..662975be3d1d 100644 --- a/trunk/net/bridge/netfilter/ebt_log.c +++ b/trunk/net/bridge/netfilter/ebt_log.c @@ -3,16 +3,13 @@ * * Authors: * Bart De Schuymer - * Harald Welte * * April, 2002 * */ -#include #include #include -#include #include #include #include @@ -58,30 +55,27 @@ static void print_MAC(unsigned char *p) } #define myNIPQUAD(a) a[0], a[1], a[2], a[3] -static void -ebt_log_packet(unsigned int pf, unsigned int hooknum, - const struct sk_buff *skb, const struct net_device *in, - const struct net_device *out, const struct nf_loginfo *loginfo, - const char *prefix) +static void ebt_log(const struct sk_buff *skb, unsigned int hooknr, + const struct net_device *in, const struct net_device *out, + const void *data, unsigned int datalen) { - unsigned int bitmask; + struct ebt_log_info *info = (struct ebt_log_info *)data; + char level_string[4] = "< >"; + level_string[1] = '0' + info->loglevel; spin_lock_bh(&ebt_log_lock); - printk("<%c>%s IN=%s OUT=%s MAC source = ", '0' + loginfo->u.log.level, - prefix, in ? in->name : "", out ? out->name : ""); + printk(level_string); + printk("%s IN=%s OUT=%s ", info->prefix, in ? in->name : "", + out ? out->name : ""); + printk("MAC source = "); print_MAC(eth_hdr(skb)->h_source); printk("MAC dest = "); print_MAC(eth_hdr(skb)->h_dest); printk("proto = 0x%04x", ntohs(eth_hdr(skb)->h_proto)); - if (loginfo->type == NF_LOG_TYPE_LOG) - bitmask = loginfo->u.log.logflags; - else - bitmask = NF_LOG_MASK; - - if ((bitmask & EBT_LOG_IP) && eth_hdr(skb)->h_proto == + if ((info->bitmask & EBT_LOG_IP) && eth_hdr(skb)->h_proto == htons(ETH_P_IP)){ struct iphdr _iph, *ih; @@ -90,9 +84,10 @@ ebt_log_packet(unsigned int pf, unsigned int hooknum, printk(" INCOMPLETE IP header"); goto out; } - printk(" IP SRC=%u.%u.%u.%u IP DST=%u.%u.%u.%u, IP " - "tos=0x%02X, IP proto=%d", NIPQUAD(ih->saddr), - NIPQUAD(ih->daddr), ih->tos, ih->protocol); + printk(" IP SRC=%u.%u.%u.%u IP DST=%u.%u.%u.%u,", + NIPQUAD(ih->saddr), NIPQUAD(ih->daddr)); + printk(" IP tos=0x%02X, IP proto=%d", ih->tos, + ih->protocol); if (ih->protocol == IPPROTO_TCP || ih->protocol == IPPROTO_UDP) { struct tcpudphdr _ports, *pptr; @@ -109,7 +104,7 @@ ebt_log_packet(unsigned int pf, unsigned int hooknum, goto out; } - if ((bitmask & EBT_LOG_ARP) && + if ((info->bitmask & EBT_LOG_ARP) && ((eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) || (eth_hdr(skb)->h_proto == htons(ETH_P_RARP)))) { struct arphdr _arph, *ah; @@ -149,21 +144,6 @@ ebt_log_packet(unsigned int pf, unsigned int hooknum, out: printk("\n"); spin_unlock_bh(&ebt_log_lock); - -} - -static void ebt_log(const struct sk_buff *skb, unsigned int hooknr, - const struct net_device *in, const struct net_device *out, - const void *data, unsigned int datalen) -{ - struct ebt_log_info *info = (struct ebt_log_info *)data; - struct nf_loginfo li; - - li.type = NF_LOG_TYPE_LOG; - li.u.log.level = info->loglevel; - li.u.log.logflags = info->bitmask; - - nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, info->prefix); } static struct ebt_watcher log = @@ -174,32 +154,13 @@ static struct ebt_watcher log = .me = THIS_MODULE, }; -static struct nf_logger ebt_log_logger = { - .name = "ebt_log", - .logfn = &ebt_log_packet, - .me = THIS_MODULE, -}; - static int __init init(void) { - int ret; - - ret = ebt_register_watcher(&log); - if (ret < 0) - return ret; - if (nf_log_register(PF_BRIDGE, &ebt_log_logger) < 0) { - printk(KERN_WARNING "ebt_log: not logging via system console " - "since somebody else already registered for PF_INET\n"); - /* we cannot make module load fail here, since otherwise - * ebtables userspace would abort */ - } - - return 0; + return ebt_register_watcher(&log); } static void __exit fini(void) { - nf_log_unregister_logger(&ebt_log_logger); ebt_unregister_watcher(&log); } diff --git a/trunk/net/bridge/netfilter/ebt_ulog.c b/trunk/net/bridge/netfilter/ebt_ulog.c index ce617b3dbbb8..aae26ae2e61f 100644 --- a/trunk/net/bridge/netfilter/ebt_ulog.c +++ b/trunk/net/bridge/netfilter/ebt_ulog.c @@ -3,7 +3,6 @@ * * Authors: * Bart De Schuymer - * Harald Welte * * November, 2004 * @@ -116,13 +115,14 @@ static struct sk_buff *ulog_alloc_skb(unsigned int size) return skb; } -static void ebt_ulog_packet(unsigned int hooknr, const struct sk_buff *skb, +static void ebt_ulog(const struct sk_buff *skb, unsigned int hooknr, const struct net_device *in, const struct net_device *out, - const struct ebt_ulog_info *uloginfo, const char *prefix) + const void *data, unsigned int datalen) { ebt_ulog_packet_msg_t *pm; size_t size, copy_len; struct nlmsghdr *nlh; + struct ebt_ulog_info *uloginfo = (struct ebt_ulog_info *)data; unsigned int group = uloginfo->nlgroup; ebt_ulog_buff_t *ub = &ulog_buffers[group]; spinlock_t *lock = &ub->lock; @@ -216,39 +216,6 @@ static void ebt_ulog_packet(unsigned int hooknr, const struct sk_buff *skb, goto unlock; } -/* this function is registered with the netfilter core */ -static void ebt_log_packet(unsigned int pf, unsigned int hooknum, - const struct sk_buff *skb, const struct net_device *in, - const struct net_device *out, const struct nf_loginfo *li, - const char *prefix) -{ - struct ebt_ulog_info loginfo; - - if (!li || li->type != NF_LOG_TYPE_ULOG) { - loginfo.nlgroup = EBT_ULOG_DEFAULT_NLGROUP; - loginfo.cprange = 0; - loginfo.qthreshold = EBT_ULOG_DEFAULT_QTHRESHOLD; - loginfo.prefix[0] = '\0'; - } else { - loginfo.nlgroup = li->u.ulog.group; - loginfo.cprange = li->u.ulog.copy_len; - loginfo.qthreshold = li->u.ulog.qthreshold; - strlcpy(loginfo.prefix, prefix, sizeof(loginfo.prefix)); - } - - ebt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix); -} - -static void ebt_ulog(const struct sk_buff *skb, unsigned int hooknr, - const struct net_device *in, const struct net_device *out, - const void *data, unsigned int datalen) -{ - struct ebt_ulog_info *uloginfo = (struct ebt_ulog_info *)data; - - ebt_ulog_packet(hooknr, skb, in, out, uloginfo, NULL); -} - - static int ebt_ulog_check(const char *tablename, unsigned int hookmask, const struct ebt_entry *e, void *data, unsigned int datalen) { @@ -273,12 +240,6 @@ static struct ebt_watcher ulog = { .me = THIS_MODULE, }; -static struct nf_logger ebt_ulog_logger = { - .name = EBT_ULOG_WATCHER, - .logfn = &ebt_log_packet, - .me = THIS_MODULE, -}; - static int __init init(void) { int i, ret = 0; @@ -304,13 +265,6 @@ static int __init init(void) else if ((ret = ebt_register_watcher(&ulog))) sock_release(ebtulognl->sk_socket); - if (nf_log_register(PF_BRIDGE, &ebt_ulog_logger) < 0) { - printk(KERN_WARNING "ebt_ulog: not logging via ulog " - "since somebody else already registered for PF_BRIDGE\n"); - /* we cannot make module load fail here, since otherwise - * ebtables userspace would abort */ - } - return ret; } @@ -319,7 +273,6 @@ static void __exit fini(void) ebt_ulog_buff_t *ub; int i; - nf_log_unregister_logger(&ebt_ulog_logger); ebt_unregister_watcher(&ulog); for (i = 0; i < EBT_ULOG_MAXNLGROUPS; i++) { ub = &ulog_buffers[i]; diff --git a/trunk/net/core/datagram.c b/trunk/net/core/datagram.c index f8d322e1ea92..1bcfef51ac58 100644 --- a/trunk/net/core/datagram.c +++ b/trunk/net/core/datagram.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #include @@ -200,41 +199,6 @@ void skb_free_datagram(struct sock *sk, struct sk_buff *skb) kfree_skb(skb); } -/** - * skb_kill_datagram - Free a datagram skbuff forcibly - * @sk: socket - * @skb: datagram skbuff - * @flags: MSG_ flags - * - * This function frees a datagram skbuff that was received by - * skb_recv_datagram. The flags argument must match the one - * used for skb_recv_datagram. - * - * If the MSG_PEEK flag is set, and the packet is still on the - * receive queue of the socket, it will be taken off the queue - * before it is freed. - * - * This function currently only disables BH when acquiring the - * sk_receive_queue lock. Therefore it must not be used in a - * context where that lock is acquired in an IRQ context. - */ - -void skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags) -{ - if (flags & MSG_PEEK) { - spin_lock_bh(&sk->sk_receive_queue.lock); - if (skb == skb_peek(&sk->sk_receive_queue)) { - __skb_unlink(skb, &sk->sk_receive_queue); - atomic_dec(&skb->users); - } - spin_unlock_bh(&sk->sk_receive_queue.lock); - } - - kfree_skb(skb); -} - -EXPORT_SYMBOL(skb_kill_datagram); - /** * skb_copy_datagram_iovec - Copy a datagram to an iovec. * @skb: buffer to copy diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 5081287923d5..0b48e294aafe 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -626,7 +626,7 @@ struct net_device * dev_get_by_flags(unsigned short if_flags, unsigned short mas * Network device names need to be valid file names to * to allow sysfs to work */ -int dev_valid_name(const char *name) +static int dev_valid_name(const char *name) { return !(*name == '\0' || !strcmp(name, ".") @@ -1113,8 +1113,7 @@ int skb_checksum_help(struct sk_buff *skb, int inward) void netdev_rx_csum_fault(struct net_device *dev) { if (net_ratelimit()) { - printk(KERN_ERR "%s: hw csum failure.\n", - dev ? dev->name : ""); + printk(KERN_ERR "%s: hw csum failure.\n", dev->name); dump_stack(); } } @@ -3270,13 +3269,13 @@ EXPORT_SYMBOL(__dev_get_by_index); EXPORT_SYMBOL(__dev_get_by_name); EXPORT_SYMBOL(__dev_remove_pack); EXPORT_SYMBOL(__skb_linearize); -EXPORT_SYMBOL(dev_valid_name); EXPORT_SYMBOL(dev_add_pack); EXPORT_SYMBOL(dev_alloc_name); EXPORT_SYMBOL(dev_close); EXPORT_SYMBOL(dev_get_by_flags); EXPORT_SYMBOL(dev_get_by_index); EXPORT_SYMBOL(dev_get_by_name); +EXPORT_SYMBOL(dev_ioctl); EXPORT_SYMBOL(dev_open); EXPORT_SYMBOL(dev_queue_xmit); EXPORT_SYMBOL(dev_remove_pack); diff --git a/trunk/net/core/filter.c b/trunk/net/core/filter.c index 8964d3445588..079c2edff789 100644 --- a/trunk/net/core/filter.c +++ b/trunk/net/core/filter.c @@ -13,7 +13,6 @@ * 2 of the License, or (at your option) any later version. * * Andi Kleen - Fix a few bad bugs and races. - * Kris Katterjohn - Added many additional checks in sk_chk_filter() */ #include @@ -117,6 +116,8 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen) A /= X; continue; case BPF_ALU|BPF_DIV|BPF_K: + if (fentry->k == 0) + return 0; A /= fentry->k; continue; case BPF_ALU|BPF_AND|BPF_X: @@ -251,7 +252,7 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen) mem[fentry->k] = X; continue; default: - WARN_ON(1); + /* Invalid instruction counts as RET */ return 0; } @@ -284,8 +285,8 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen) * * Check the user's filter code. If we let some ugly * filter code slip through kaboom! The filter must contain - * no references or jumps that are out of range, no illegal - * instructions, and must end with a RET instruction. + * no references or jumps that are out of range, no illegal instructions + * and no backward jumps. It must end with a RET instruction * * Returns 0 if the rule set is legal or a negative errno code if not. */ @@ -294,92 +295,41 @@ int sk_chk_filter(struct sock_filter *filter, int flen) struct sock_filter *ftest; int pc; - if (flen == 0 || flen > BPF_MAXINSNS) + if (((unsigned int)flen >= (~0U / sizeof(struct sock_filter))) || flen == 0) return -EINVAL; /* check the filter code now */ for (pc = 0; pc < flen; pc++) { /* all jumps are forward as they are not signed */ ftest = &filter[pc]; + if (BPF_CLASS(ftest->code) == BPF_JMP) { + /* but they mustn't jump off the end */ + if (BPF_OP(ftest->code) == BPF_JA) { + /* + * Note, the large ftest->k might cause loops. + * Compare this with conditional jumps below, + * where offsets are limited. --ANK (981016) + */ + if (ftest->k >= (unsigned)(flen-pc-1)) + return -EINVAL; + } else { + /* for conditionals both must be safe */ + if (pc + ftest->jt +1 >= flen || + pc + ftest->jf +1 >= flen) + return -EINVAL; + } + } - /* Only allow valid instructions */ - switch (ftest->code) { - case BPF_ALU|BPF_ADD|BPF_K: - case BPF_ALU|BPF_ADD|BPF_X: - case BPF_ALU|BPF_SUB|BPF_K: - case BPF_ALU|BPF_SUB|BPF_X: - case BPF_ALU|BPF_MUL|BPF_K: - case BPF_ALU|BPF_MUL|BPF_X: - case BPF_ALU|BPF_DIV|BPF_X: - case BPF_ALU|BPF_AND|BPF_K: - case BPF_ALU|BPF_AND|BPF_X: - case BPF_ALU|BPF_OR|BPF_K: - case BPF_ALU|BPF_OR|BPF_X: - case BPF_ALU|BPF_LSH|BPF_K: - case BPF_ALU|BPF_LSH|BPF_X: - case BPF_ALU|BPF_RSH|BPF_K: - case BPF_ALU|BPF_RSH|BPF_X: - case BPF_ALU|BPF_NEG: - case BPF_LD|BPF_W|BPF_ABS: - case BPF_LD|BPF_H|BPF_ABS: - case BPF_LD|BPF_B|BPF_ABS: - case BPF_LD|BPF_W|BPF_LEN: - case BPF_LD|BPF_W|BPF_IND: - case BPF_LD|BPF_H|BPF_IND: - case BPF_LD|BPF_B|BPF_IND: - case BPF_LD|BPF_IMM: - case BPF_LDX|BPF_W|BPF_LEN: - case BPF_LDX|BPF_B|BPF_MSH: - case BPF_LDX|BPF_IMM: - case BPF_MISC|BPF_TAX: - case BPF_MISC|BPF_TXA: - case BPF_RET|BPF_K: - case BPF_RET|BPF_A: - break; - - /* Some instructions need special checks */ - - case BPF_ALU|BPF_DIV|BPF_K: - /* check for division by zero */ - if (ftest->k == 0) - return -EINVAL; - break; - - case BPF_LD|BPF_MEM: - case BPF_LDX|BPF_MEM: - case BPF_ST: - case BPF_STX: - /* check for invalid memory addresses */ - if (ftest->k >= BPF_MEMWORDS) - return -EINVAL; - break; - - case BPF_JMP|BPF_JA: - /* - * Note, the large ftest->k might cause loops. - * Compare this with conditional jumps below, - * where offsets are limited. --ANK (981016) - */ - if (ftest->k >= (unsigned)(flen-pc-1)) - return -EINVAL; - break; - - case BPF_JMP|BPF_JEQ|BPF_K: - case BPF_JMP|BPF_JEQ|BPF_X: - case BPF_JMP|BPF_JGE|BPF_K: - case BPF_JMP|BPF_JGE|BPF_X: - case BPF_JMP|BPF_JGT|BPF_K: - case BPF_JMP|BPF_JGT|BPF_X: - case BPF_JMP|BPF_JSET|BPF_K: - case BPF_JMP|BPF_JSET|BPF_X: - /* for conditionals both must be safe */ - if (pc + ftest->jt + 1 >= flen || - pc + ftest->jf + 1 >= flen) + /* check that memory operations use valid addresses. */ + if (ftest->k >= BPF_MEMWORDS) { + /* but it might not be a memory operation... */ + switch (ftest->code) { + case BPF_ST: + case BPF_STX: + case BPF_LD|BPF_MEM: + case BPF_LDX|BPF_MEM: return -EINVAL; - break; - - default: - return -EINVAL; + } } } @@ -408,7 +358,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) int err; /* Make sure new filter is there and in the right amounts. */ - if (fprog->filter == NULL) + if (fprog->filter == NULL || fprog->len > BPF_MAXINSNS) return -EINVAL; fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL); diff --git a/trunk/net/core/flow.c b/trunk/net/core/flow.c index c4f25385029f..7e95b39de9fd 100644 --- a/trunk/net/core/flow.c +++ b/trunk/net/core/flow.c @@ -23,7 +23,6 @@ #include #include #include -#include struct flow_cache_entry { struct flow_cache_entry *next; @@ -31,7 +30,6 @@ struct flow_cache_entry { u8 dir; struct flowi key; u32 genid; - u32 sk_sid; void *object; atomic_t *object_ref; }; @@ -164,7 +162,7 @@ static int flow_key_compare(struct flowi *key1, struct flowi *key2) return 0; } -void *flow_cache_lookup(struct flowi *key, u32 sk_sid, u16 family, u8 dir, +void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir, flow_resolve_t resolver) { struct flow_cache_entry *fle, **head; @@ -188,7 +186,6 @@ void *flow_cache_lookup(struct flowi *key, u32 sk_sid, u16 family, u8 dir, for (fle = *head; fle; fle = fle->next) { if (fle->family == family && fle->dir == dir && - fle->sk_sid == sk_sid && flow_key_compare(key, &fle->key) == 0) { if (fle->genid == atomic_read(&flow_cache_genid)) { void *ret = fle->object; @@ -213,7 +210,6 @@ void *flow_cache_lookup(struct flowi *key, u32 sk_sid, u16 family, u8 dir, *head = fle; fle->family = family; fle->dir = dir; - fle->sk_sid = sk_sid; memcpy(&fle->key, key, sizeof(*key)); fle->object = NULL; flow_count(cpu)++; @@ -225,7 +221,7 @@ void *flow_cache_lookup(struct flowi *key, u32 sk_sid, u16 family, u8 dir, void *obj; atomic_t *obj_ref; - resolver(key, sk_sid, family, dir, &obj, &obj_ref); + resolver(key, family, dir, &obj, &obj_ref); if (fle) { fle->genid = atomic_read(&flow_cache_genid); diff --git a/trunk/net/core/netpoll.c b/trunk/net/core/netpoll.c index 281a632fa6a6..49424a42a2c0 100644 --- a/trunk/net/core/netpoll.c +++ b/trunk/net/core/netpoll.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/net/core/pktgen.c b/trunk/net/core/pktgen.c index 06cad2d63e8a..7fc3e9e28c34 100644 --- a/trunk/net/core/pktgen.c +++ b/trunk/net/core/pktgen.c @@ -487,9 +487,9 @@ static unsigned int fmt_ip6(char *s,const char ip[16]); /* Module parameters, defaults. */ static int pg_count_d = 1000; /* 1000 pkts by default */ -static int pg_delay_d; -static int pg_clone_skb_d; -static int debug; +static int pg_delay_d = 0; +static int pg_clone_skb_d = 0; +static int debug = 0; static DECLARE_MUTEX(pktgen_sem); static struct pktgen_thread *pktgen_threads = NULL; diff --git a/trunk/net/core/skbuff.c b/trunk/net/core/skbuff.c index 070f91cfde59..b7d13a4fff48 100644 --- a/trunk/net/core/skbuff.c +++ b/trunk/net/core/skbuff.c @@ -135,13 +135,17 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here) struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, int fclone) { - struct skb_shared_info *shinfo; struct sk_buff *skb; u8 *data; /* Get the HEAD */ - skb = kmem_cache_alloc(fclone ? skbuff_fclone_cache : skbuff_head_cache, - gfp_mask & ~__GFP_DMA); + if (fclone) + skb = kmem_cache_alloc(skbuff_fclone_cache, + gfp_mask & ~__GFP_DMA); + else + skb = kmem_cache_alloc(skbuff_head_cache, + gfp_mask & ~__GFP_DMA); + if (!skb) goto out; @@ -158,16 +162,6 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, skb->data = data; skb->tail = data; skb->end = data + size; - /* make sure we initialize shinfo sequentially */ - shinfo = skb_shinfo(skb); - atomic_set(&shinfo->dataref, 1); - shinfo->nr_frags = 0; - shinfo->tso_size = 0; - shinfo->tso_segs = 0; - shinfo->ufo_size = 0; - shinfo->ip6_frag_id = 0; - shinfo->frag_list = NULL; - if (fclone) { struct sk_buff *child = skb + 1; atomic_t *fclone_ref = (atomic_t *) (child + 1); @@ -177,6 +171,13 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, child->fclone = SKB_FCLONE_UNAVAILABLE; } + atomic_set(&(skb_shinfo(skb)->dataref), 1); + skb_shinfo(skb)->nr_frags = 0; + skb_shinfo(skb)->tso_size = 0; + skb_shinfo(skb)->tso_segs = 0; + skb_shinfo(skb)->frag_list = NULL; + skb_shinfo(skb)->ufo_size = 0; + skb_shinfo(skb)->ip6_frag_id = 0; out: return skb; nodata: @@ -1724,7 +1725,7 @@ unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, * of the skb if any page alloc fails user this procedure returns -ENOMEM */ int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, - int (*getfrag)(void *from, char *to, int offset, + int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length) { diff --git a/trunk/net/core/sock.c b/trunk/net/core/sock.c index 6465b0e4c8cb..13cc3be4f056 100644 --- a/trunk/net/core/sock.c +++ b/trunk/net/core/sock.c @@ -1488,7 +1488,7 @@ int proto_register(struct proto *prot, int alloc_slab) } } - if (prot->twsk_prot != NULL) { + if (prot->twsk_obj_size) { static const char mask[] = "tw_sock_%s"; timewait_sock_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL); @@ -1497,12 +1497,11 @@ int proto_register(struct proto *prot, int alloc_slab) goto out_free_request_sock_slab; sprintf(timewait_sock_slab_name, mask, prot->name); - prot->twsk_prot->twsk_slab = - kmem_cache_create(timewait_sock_slab_name, - prot->twsk_prot->twsk_obj_size, - 0, SLAB_HWCACHE_ALIGN, - NULL, NULL); - if (prot->twsk_prot->twsk_slab == NULL) + prot->twsk_slab = kmem_cache_create(timewait_sock_slab_name, + prot->twsk_obj_size, + 0, SLAB_HWCACHE_ALIGN, + NULL, NULL); + if (prot->twsk_slab == NULL) goto out_free_timewait_sock_slab_name; } } @@ -1549,12 +1548,12 @@ void proto_unregister(struct proto *prot) prot->rsk_prot->slab = NULL; } - if (prot->twsk_prot != NULL && prot->twsk_prot->twsk_slab != NULL) { - const char *name = kmem_cache_name(prot->twsk_prot->twsk_slab); + if (prot->twsk_slab != NULL) { + const char *name = kmem_cache_name(prot->twsk_slab); - kmem_cache_destroy(prot->twsk_prot->twsk_slab); + kmem_cache_destroy(prot->twsk_slab); kfree(name); - prot->twsk_prot->twsk_slab = NULL; + prot->twsk_slab = NULL; } } diff --git a/trunk/net/core/stream.c b/trunk/net/core/stream.c index 35e25259fd95..15bfd03e8024 100644 --- a/trunk/net/core/stream.c +++ b/trunk/net/core/stream.c @@ -55,9 +55,8 @@ int sk_stream_wait_connect(struct sock *sk, long *timeo_p) int done; do { - int err = sock_error(sk); - if (err) - return err; + if (sk->sk_err) + return sock_error(sk); if ((1 << sk->sk_state) & ~(TCPF_SYN_SENT | TCPF_SYN_RECV)) return -EPIPE; if (!*timeo_p) @@ -68,7 +67,6 @@ int sk_stream_wait_connect(struct sock *sk, long *timeo_p) prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); sk->sk_write_pending++; done = sk_wait_event(sk, timeo_p, - !sk->sk_err && !((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT))); finish_wait(sk->sk_sleep, &wait); @@ -139,9 +137,7 @@ int sk_stream_wait_memory(struct sock *sk, long *timeo_p) set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); sk->sk_write_pending++; - sk_wait_event(sk, ¤t_timeo, !sk->sk_err && - !(sk->sk_shutdown & SEND_SHUTDOWN) && - sk_stream_memory_free(sk) && + sk_wait_event(sk, ¤t_timeo, sk_stream_memory_free(sk) && vm_wait); sk->sk_write_pending--; diff --git a/trunk/net/core/utils.c b/trunk/net/core/utils.c index 587eb7787deb..7b5970fc9e40 100644 --- a/trunk/net/core/utils.c +++ b/trunk/net/core/utils.c @@ -175,7 +175,7 @@ __u32 in_aton(const char *str) if (*str != '\0') { val = 0; - while (*str != '\0' && *str != '.' && *str != '\n') + while (*str != '\0' && *str != '.') { val *= 10; val += *str - '0'; diff --git a/trunk/net/dccp/Makefile b/trunk/net/dccp/Makefile index 87b27fff6e3b..344a8da153fc 100644 --- a/trunk/net/dccp/Makefile +++ b/trunk/net/dccp/Makefile @@ -1,7 +1,3 @@ -obj-$(CONFIG_IPV6) += dccp_ipv6.o - -dccp_ipv6-y := ipv6.o - obj-$(CONFIG_IP_DCCP) += dccp.o dccp-y := ccid.o input.o ipv4.o minisocks.o options.o output.o proto.o \ diff --git a/trunk/net/dccp/ackvec.c b/trunk/net/dccp/ackvec.c index ce9cb77c5c29..c9a62cca22fc 100644 --- a/trunk/net/dccp/ackvec.c +++ b/trunk/net/dccp/ackvec.c @@ -55,8 +55,8 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) from = av->dccpav_buf + av->dccpav_buf_head; /* Check if buf_head wraps */ - if ((int)av->dccpav_buf_head + len > av->dccpav_vec_len) { - const u32 tailsize = av->dccpav_vec_len - av->dccpav_buf_head; + if (av->dccpav_buf_head + len > av->dccpav_vec_len) { + const u32 tailsize = (av->dccpav_vec_len - av->dccpav_buf_head); memcpy(to, from, tailsize); to += tailsize; @@ -93,14 +93,8 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) struct dccp_ackvec *dccp_ackvec_alloc(const unsigned int len, const gfp_t priority) { - struct dccp_ackvec *av; + struct dccp_ackvec *av = kmalloc(sizeof(*av) + len, priority); - BUG_ON(len == 0); - - if (len > DCCP_MAX_ACKVEC_LEN) - return NULL; - - av = kmalloc(sizeof(*av) + len, priority); if (av != NULL) { av->dccpav_buf_len = len; av->dccpav_buf_head = @@ -123,13 +117,13 @@ void dccp_ackvec_free(struct dccp_ackvec *av) } static inline u8 dccp_ackvec_state(const struct dccp_ackvec *av, - const u8 index) + const unsigned int index) { return av->dccpav_buf[index] & DCCP_ACKVEC_STATE_MASK; } static inline u8 dccp_ackvec_len(const struct dccp_ackvec *av, - const u8 index) + const unsigned int index) { return av->dccpav_buf[index] & DCCP_ACKVEC_LEN_MASK; } @@ -141,7 +135,7 @@ static inline u8 dccp_ackvec_len(const struct dccp_ackvec *av, */ static inline int dccp_ackvec_set_buf_head_state(struct dccp_ackvec *av, const unsigned int packets, - const unsigned char state) + const unsigned char state) { unsigned int gap; signed long new_head; @@ -229,7 +223,7 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, * could reduce the complexity of this scan.) */ u64 delta = dccp_delta_seqno(ackno, av->dccpav_buf_ackno); - u8 index = av->dccpav_buf_head; + unsigned int index = av->dccpav_buf_head; while (1) { const u8 len = dccp_ackvec_len(av, index); @@ -297,7 +291,7 @@ void dccp_ackvec_print(const struct dccp_ackvec *av) } #endif -static void dccp_ackvec_throw_away_ack_record(struct dccp_ackvec *av) +static void dccp_ackvec_trow_away_ack_record(struct dccp_ackvec *av) { /* * As we're keeping track of the ack vector size (dccpav_vec_len) and @@ -307,10 +301,9 @@ static void dccp_ackvec_throw_away_ack_record(struct dccp_ackvec *av) * draft-ietf-dccp-spec-11.txt Appendix A. -acme */ #if 0 - u32 new_buf_tail = av->dccpav_ack_ptr + 1; - if (new_buf_tail >= av->dccpav_vec_len) - new_buf_tail -= av->dccpav_vec_len; - av->dccpav_buf_tail = new_buf_tail; + av->dccpav_buf_tail = av->dccpav_ack_ptr + 1; + if (av->dccpav_buf_tail >= av->dccpav_vec_len) + av->dccpav_buf_tail -= av->dccpav_vec_len; #endif av->dccpav_vec_len -= av->dccpav_sent_len; } @@ -333,7 +326,7 @@ void dccp_ackvec_check_rcv_ackno(struct dccp_ackvec *av, struct sock *sk, debug_prefix, 1, (unsigned long long)av->dccpav_ack_seqno, (unsigned long long)av->dccpav_ack_ackno); - dccp_ackvec_throw_away_ack_record(av); + dccp_ackvec_trow_away_ack_record(av); av->dccpav_ack_seqno = DCCP_MAX_SEQNO + 1; } } @@ -396,7 +389,7 @@ static void dccp_ackvec_check_rcv_ackvector(struct dccp_ackvec *av, av->dccpav_ack_seqno, (unsigned long long) av->dccpav_ack_ackno); - dccp_ackvec_throw_away_ack_record(av); + dccp_ackvec_trow_away_ack_record(av); } /* * If dccpav_ack_seqno was not received, no problem diff --git a/trunk/net/dccp/ackvec.h b/trunk/net/dccp/ackvec.h index f7dfb5f67b87..d0fd6c60c574 100644 --- a/trunk/net/dccp/ackvec.h +++ b/trunk/net/dccp/ackvec.h @@ -54,16 +54,16 @@ * @dccpav_buf - circular buffer of acknowledgeable packets */ struct dccp_ackvec { + unsigned int dccpav_buf_head; + unsigned int dccpav_buf_tail; u64 dccpav_buf_ackno; u64 dccpav_ack_seqno; u64 dccpav_ack_ackno; + unsigned int dccpav_ack_ptr; + unsigned int dccpav_sent_len; + unsigned int dccpav_vec_len; + unsigned int dccpav_buf_len; struct timeval dccpav_time; - u8 dccpav_buf_head; - u8 dccpav_buf_tail; - u8 dccpav_ack_ptr; - u8 dccpav_sent_len; - u8 dccpav_vec_len; - u8 dccpav_buf_len; u8 dccpav_buf_nonce; u8 dccpav_ack_nonce; u8 dccpav_buf[0]; diff --git a/trunk/net/dccp/ccid.h b/trunk/net/dccp/ccid.h index de681c6ad081..c37eeeaf5c6e 100644 --- a/trunk/net/dccp/ccid.h +++ b/trunk/net/dccp/ccid.h @@ -21,8 +21,6 @@ #define CCID_MAX 255 -struct tcp_info; - struct ccid { unsigned char ccid_id; const char *ccid_name; diff --git a/trunk/net/dccp/dccp.h b/trunk/net/dccp/dccp.h index 93f26dd6e6cb..f97b85d55ad8 100644 --- a/trunk/net/dccp/dccp.h +++ b/trunk/net/dccp/dccp.h @@ -59,7 +59,7 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo); #define DCCP_RTO_MAX ((unsigned)(120 * HZ)) /* FIXME: using TCP value */ -extern struct proto dccp_prot; +extern struct proto dccp_v4_prot; /* is seq1 < seq2 ? */ static inline int before48(const u64 seq1, const u64 seq2) @@ -228,9 +228,6 @@ extern int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, extern int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, const struct dccp_hdr *dh, const unsigned len); -extern int dccp_v4_init_sock(struct sock *sk); -extern int dccp_v4_destroy_sock(struct sock *sk); - extern void dccp_close(struct sock *sk, long timeout); extern struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, @@ -241,7 +238,6 @@ extern struct sk_buff *dccp_make_reset(struct sock *sk, extern int dccp_connect(struct sock *sk); extern int dccp_disconnect(struct sock *sk, int flags); -extern void dccp_unhash(struct sock *sk); extern int dccp_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); extern int dccp_setsockopt(struct sock *sk, int level, int optname, @@ -253,13 +249,6 @@ extern int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int nonblock, int flags, int *addr_len); extern void dccp_shutdown(struct sock *sk, int how); -extern int inet_dccp_listen(struct socket *sock, int backlog); -extern unsigned int dccp_poll(struct file *file, struct socket *sock, - poll_table *wait); -extern void dccp_v4_send_check(struct sock *sk, int len, - struct sk_buff *skb); -extern int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, - int addr_len); extern int dccp_v4_checksum(const struct sk_buff *skb, const u32 saddr, const u32 daddr); @@ -267,17 +256,6 @@ extern int dccp_v4_checksum(const struct sk_buff *skb, extern int dccp_v4_send_reset(struct sock *sk, enum dccp_reset_codes code); extern void dccp_send_close(struct sock *sk, const int active); -extern int dccp_invalid_packet(struct sk_buff *skb); - -static inline int dccp_bad_service_code(const struct sock *sk, - const __u32 service) -{ - const struct dccp_sock *dp = dccp_sk(sk); - - if (dp->dccps_service == service) - return 0; - return !dccp_list_has_service(dp->dccps_service_list, service); -} struct dccp_skb_cb { __u8 dccpd_type:4; diff --git a/trunk/net/dccp/diag.c b/trunk/net/dccp/diag.c index 3f78c00e3822..f675d8e642d3 100644 --- a/trunk/net/dccp/diag.c +++ b/trunk/net/dccp/diag.c @@ -28,7 +28,7 @@ static void dccp_get_info(struct sock *sk, struct tcp_info *info) info->tcpi_retransmits = icsk->icsk_retransmits; info->tcpi_probes = icsk->icsk_probes_out; info->tcpi_backoff = icsk->icsk_backoff; - info->tcpi_pmtu = icsk->icsk_pmtu_cookie; + info->tcpi_pmtu = dp->dccps_pmtu_cookie; if (dp->dccps_options.dccpo_send_ack_vector) info->tcpi_options |= TCPI_OPT_SACK; diff --git a/trunk/net/dccp/input.c b/trunk/net/dccp/input.c index b6cba72b44e8..3454d5941900 100644 --- a/trunk/net/dccp/input.c +++ b/trunk/net/dccp/input.c @@ -151,12 +151,29 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) return 0; } -static inline int __dccp_rcv_established(struct sock *sk, struct sk_buff *skb, - const struct dccp_hdr *dh, - const unsigned len) +int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, + const struct dccp_hdr *dh, const unsigned len) { struct dccp_sock *dp = dccp_sk(sk); + if (dccp_check_seqno(sk, skb)) + goto discard; + + if (dccp_parse_options(sk, skb)) + goto discard; + + if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) + dccp_event_ack_recv(sk, skb); + + if (dp->dccps_options.dccpo_send_ack_vector && + dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, + DCCP_SKB_CB(skb)->dccpd_seq, + DCCP_ACKVEC_STATE_RECEIVED)) + goto discard; + + ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb); + ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb); + switch (dccp_hdr(skb)->dccph_type) { case DCCP_PKT_DATAACK: case DCCP_PKT_DATA: @@ -233,37 +250,6 @@ static inline int __dccp_rcv_established(struct sock *sk, struct sk_buff *skb, return 0; } -int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, - const struct dccp_hdr *dh, const unsigned len) -{ - struct dccp_sock *dp = dccp_sk(sk); - - if (dccp_check_seqno(sk, skb)) - goto discard; - - if (dccp_parse_options(sk, skb)) - goto discard; - - if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) - dccp_event_ack_recv(sk, skb); - - if (dp->dccps_options.dccpo_send_ack_vector && - dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, - DCCP_SKB_CB(skb)->dccpd_seq, - DCCP_ACKVEC_STATE_RECEIVED)) - goto discard; - - ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb); - ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb); - - return __dccp_rcv_established(sk, skb, dh, len); -discard: - __kfree_skb(skb); - return 0; -} - -EXPORT_SYMBOL_GPL(dccp_rcv_established); - static int dccp_rcv_request_sent_state_process(struct sock *sk, struct sk_buff *skb, const struct dccp_hdr *dh, @@ -300,12 +286,6 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk, goto out_invalid_packet; } - if (dp->dccps_options.dccpo_send_ack_vector && - dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, - DCCP_SKB_CB(skb)->dccpd_seq, - DCCP_ACKVEC_STATE_RECEIVED)) - goto out_invalid_packet; /* FIXME: change error code */ - dp->dccps_isr = DCCP_SKB_CB(skb)->dccpd_seq; dccp_update_gsr(sk, dp->dccps_isr); /* @@ -329,7 +309,7 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk, goto out_invalid_packet; } - dccp_sync_mss(sk, icsk->icsk_pmtu_cookie); + dccp_sync_mss(sk, dp->dccps_pmtu_cookie); /* * Step 10: Process REQUEST state (second part) @@ -349,7 +329,7 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk, dccp_set_state(sk, DCCP_PARTOPEN); /* Make sure socket is routed, for correct metrics. */ - icsk->icsk_af_ops->rebuild_header(sk); + inet_sk_rebuild_header(sk); if (!sock_flag(sk, SOCK_DEAD)) { sk->sk_state_change(sk); @@ -418,9 +398,9 @@ static int dccp_rcv_respond_partopen_state_process(struct sock *sk, if (dh->dccph_type == DCCP_PKT_DATAACK || dh->dccph_type == DCCP_PKT_DATA) { - __dccp_rcv_established(sk, skb, dh, len); + dccp_rcv_established(sk, skb, dh, len); queued = 1; /* packet was queued - (by __dccp_rcv_established) */ + (by dccp_rcv_established) */ } break; } @@ -464,8 +444,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, */ if (sk->sk_state == DCCP_LISTEN) { if (dh->dccph_type == DCCP_PKT_REQUEST) { - if (inet_csk(sk)->icsk_af_ops->conn_request(sk, - skb) < 0) + if (dccp_v4_conn_request(sk, skb) < 0) return 1; /* FIXME: do congestion control initialization */ @@ -492,14 +471,14 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) dccp_event_ack_recv(sk, skb); + ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb); + ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb); + if (dp->dccps_options.dccpo_send_ack_vector && dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, DCCP_SKB_CB(skb)->dccpd_seq, DCCP_ACKVEC_STATE_RECEIVED)) goto discard; - - ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb); - ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb); } /* @@ -587,5 +566,3 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, } return 0; } - -EXPORT_SYMBOL_GPL(dccp_rcv_state_process); diff --git a/trunk/net/dccp/ipv4.c b/trunk/net/dccp/ipv4.c index 3f244670764a..ca03521112c5 100644 --- a/trunk/net/dccp/ipv4.c +++ b/trunk/net/dccp/ipv4.c @@ -19,9 +19,7 @@ #include #include -#include #include -#include #include #include @@ -39,8 +37,7 @@ EXPORT_SYMBOL_GPL(dccp_hashinfo); static int dccp_v4_get_port(struct sock *sk, const unsigned short snum) { - return inet_csk_get_port(&dccp_hashinfo, sk, snum, - inet_csk_bind_conflict); + return inet_csk_get_port(&dccp_hashinfo, sk, snum); } static void dccp_v4_hash(struct sock *sk) @@ -48,14 +45,171 @@ static void dccp_v4_hash(struct sock *sk) inet_hash(&dccp_hashinfo, sk); } -void dccp_unhash(struct sock *sk) +static void dccp_v4_unhash(struct sock *sk) { inet_unhash(&dccp_hashinfo, sk); } -EXPORT_SYMBOL_GPL(dccp_unhash); +/* called with local bh disabled */ +static int __dccp_v4_check_established(struct sock *sk, const __u16 lport, + struct inet_timewait_sock **twp) +{ + struct inet_sock *inet = inet_sk(sk); + const u32 daddr = inet->rcv_saddr; + const u32 saddr = inet->daddr; + const int dif = sk->sk_bound_dev_if; + INET_ADDR_COOKIE(acookie, saddr, daddr) + const __u32 ports = INET_COMBINED_PORTS(inet->dport, lport); + unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet->dport); + struct inet_ehash_bucket *head = inet_ehash_bucket(&dccp_hashinfo, hash); + const struct sock *sk2; + const struct hlist_node *node; + struct inet_timewait_sock *tw; + + prefetch(head->chain.first); + write_lock(&head->lock); + + /* Check TIME-WAIT sockets first. */ + sk_for_each(sk2, node, &(head + dccp_hashinfo.ehash_size)->chain) { + tw = inet_twsk(sk2); + + if (INET_TW_MATCH(sk2, hash, acookie, saddr, daddr, ports, dif)) + goto not_unique; + } + tw = NULL; + + /* And established part... */ + sk_for_each(sk2, node, &head->chain) { + if (INET_MATCH(sk2, hash, acookie, saddr, daddr, ports, dif)) + goto not_unique; + } -int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) + /* Must record num and sport now. Otherwise we will see + * in hash table socket with a funny identity. */ + inet->num = lport; + inet->sport = htons(lport); + sk->sk_hash = hash; + BUG_TRAP(sk_unhashed(sk)); + __sk_add_node(sk, &head->chain); + sock_prot_inc_use(sk->sk_prot); + write_unlock(&head->lock); + + if (twp != NULL) { + *twp = tw; + NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); + } else if (tw != NULL) { + /* Silly. Should hash-dance instead... */ + inet_twsk_deschedule(tw, &dccp_death_row); + NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); + + inet_twsk_put(tw); + } + + return 0; + +not_unique: + write_unlock(&head->lock); + return -EADDRNOTAVAIL; +} + +/* + * Bind a port for a connect operation and hash it. + */ +static int dccp_v4_hash_connect(struct sock *sk) +{ + const unsigned short snum = inet_sk(sk)->num; + struct inet_bind_hashbucket *head; + struct inet_bind_bucket *tb; + int ret; + + if (snum == 0) { + int low = sysctl_local_port_range[0]; + int high = sysctl_local_port_range[1]; + int remaining = (high - low) + 1; + int rover = net_random() % (high - low) + low; + struct hlist_node *node; + struct inet_timewait_sock *tw = NULL; + + local_bh_disable(); + do { + head = &dccp_hashinfo.bhash[inet_bhashfn(rover, + dccp_hashinfo.bhash_size)]; + spin_lock(&head->lock); + + /* Does not bother with rcv_saddr checks, + * because the established check is already + * unique enough. + */ + inet_bind_bucket_for_each(tb, node, &head->chain) { + if (tb->port == rover) { + BUG_TRAP(!hlist_empty(&tb->owners)); + if (tb->fastreuse >= 0) + goto next_port; + if (!__dccp_v4_check_established(sk, + rover, + &tw)) + goto ok; + goto next_port; + } + } + + tb = inet_bind_bucket_create(dccp_hashinfo.bind_bucket_cachep, + head, rover); + if (tb == NULL) { + spin_unlock(&head->lock); + break; + } + tb->fastreuse = -1; + goto ok; + + next_port: + spin_unlock(&head->lock); + if (++rover > high) + rover = low; + } while (--remaining > 0); + + local_bh_enable(); + + return -EADDRNOTAVAIL; + +ok: + /* All locks still held and bhs disabled */ + inet_bind_hash(sk, tb, rover); + if (sk_unhashed(sk)) { + inet_sk(sk)->sport = htons(rover); + __inet_hash(&dccp_hashinfo, sk, 0); + } + spin_unlock(&head->lock); + + if (tw != NULL) { + inet_twsk_deschedule(tw, &dccp_death_row); + inet_twsk_put(tw); + } + + ret = 0; + goto out; + } + + head = &dccp_hashinfo.bhash[inet_bhashfn(snum, + dccp_hashinfo.bhash_size)]; + tb = inet_csk(sk)->icsk_bind_hash; + spin_lock_bh(&head->lock); + if (sk_head(&tb->owners) == sk && sk->sk_bind_node.next == NULL) { + __inet_hash(&dccp_hashinfo, sk, 0); + spin_unlock_bh(&head->lock); + return 0; + } else { + spin_unlock(&head->lock); + /* No definite answer... Walk to established hash table */ + ret = __dccp_v4_check_established(sk, snum, NULL); +out: + local_bh_enable(); + return ret; + } +} + +static int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, + int addr_len) { struct inet_sock *inet = inet_sk(sk); struct dccp_sock *dp = dccp_sk(sk); @@ -105,9 +259,9 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) inet->dport = usin->sin_port; inet->daddr = daddr; - inet_csk(sk)->icsk_ext_hdr_len = 0; + dp->dccps_ext_header_len = 0; if (inet->opt != NULL) - inet_csk(sk)->icsk_ext_hdr_len = inet->opt->optlen; + dp->dccps_ext_header_len = inet->opt->optlen; /* * Socket identity is still unknown (sport may be zero). * However we set state to DCCP_REQUESTING and not releasing socket @@ -115,7 +269,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) * complete initialization after this. */ dccp_set_state(sk, DCCP_REQUESTING); - err = inet_hash_connect(&dccp_death_row, sk); + err = dccp_v4_hash_connect(sk); if (err != 0) goto failure; @@ -133,6 +287,16 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) usin->sin_port); dccp_update_gss(sk, dp->dccps_iss); + /* + * SWL and AWL are initially adjusted so that they are not less than + * the initial Sequence Numbers received and sent, respectively: + * SWL := max(GSR + 1 - floor(W/4), ISR), + * AWL := max(GSS - W' + 1, ISS). + * These adjustments MUST be applied only at the beginning of the + * connection. + */ + dccp_set_seqno(&dp->dccps_awl, max48(dp->dccps_awl, dp->dccps_iss)); + inet->id = dp->dccps_iss ^ jiffies; err = dccp_connect(sk); @@ -152,8 +316,6 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) goto out; } -EXPORT_SYMBOL_GPL(dccp_v4_connect); - /* * This routine does path mtu discovery as defined in RFC1191. */ @@ -192,7 +354,7 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk, mtu = dst_mtu(dst); if (inet->pmtudisc != IP_PMTUDISC_DONT && - inet_csk(sk)->icsk_pmtu_cookie > mtu) { + dp->dccps_pmtu_cookie > mtu) { dccp_sync_mss(sk, mtu); /* @@ -444,17 +606,6 @@ void dccp_v4_err(struct sk_buff *skb, u32 info) sock_put(sk); } -/* This routine computes an IPv4 DCCP checksum. */ -void dccp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb) -{ - const struct inet_sock *inet = inet_sk(sk); - struct dccp_hdr *dh = dccp_hdr(skb); - - dh->dccph_checksum = dccp_v4_checksum(skb, inet->saddr, inet->daddr); -} - -EXPORT_SYMBOL_GPL(dccp_v4_send_check); - int dccp_v4_send_reset(struct sock *sk, enum dccp_reset_codes code) { struct sk_buff *skb; @@ -490,6 +641,16 @@ static inline u64 dccp_v4_init_sequence(const struct sock *sk, dccp_hdr(skb)->dccph_sport); } +static inline int dccp_bad_service_code(const struct sock *sk, + const __u32 service) +{ + const struct dccp_sock *dp = dccp_sk(sk); + + if (dp->dccps_service == service) + return 0; + return !dccp_list_has_service(dp->dccps_service_list, service); +} + int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) { struct inet_request_sock *ireq; @@ -501,6 +662,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) const __u32 service = dccp_hdr_request(skb)->dccph_req_service; struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb); __u8 reset_code = DCCP_RESET_CODE_TOO_BUSY; + struct dst_entry *dst = NULL; /* Never answer to DCCP_PKT_REQUESTs send to broadcast or multicast */ if (((struct rtable *)skb->dst)->rt_flags & @@ -541,6 +703,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) ireq = inet_rsk(req); ireq->loc_addr = daddr; ireq->rmt_addr = saddr; + /* FIXME: Merge Aristeu's option parsing code when ready */ req->rcv_wnd = 100; /* Fake, option parsing will get the right value */ ireq->opt = NULL; @@ -558,22 +721,23 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) dreq->dreq_iss = dccp_v4_init_sequence(sk, skb); dreq->dreq_service = service; - if (dccp_v4_send_response(sk, req, NULL)) + if (dccp_v4_send_response(sk, req, dst)) goto drop_and_free; inet_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT); return 0; drop_and_free: - reqsk_free(req); + /* + * FIXME: should be reqsk_free after implementing req->rsk_ops + */ + __reqsk_free(req); drop: DCCP_INC_STATS_BH(DCCP_MIB_ATTEMPTFAILS); dcb->dccpd_reset_code = reset_code; return -1; } -EXPORT_SYMBOL_GPL(dccp_v4_conn_request); - /* * The three way handshake has completed - we got a valid ACK or DATAACK - * now create the new socket. @@ -628,8 +792,6 @@ struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb, return NULL; } -EXPORT_SYMBOL_GPL(dccp_v4_request_recv_sock); - static struct sock *dccp_v4_hnd_req(struct sock *sk, struct sk_buff *skb) { const struct dccp_hdr *dh = dccp_hdr(skb); @@ -849,9 +1011,7 @@ int dccp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) return 0; } -EXPORT_SYMBOL_GPL(dccp_v4_do_rcv); - -int dccp_invalid_packet(struct sk_buff *skb) +static inline int dccp_invalid_packet(struct sk_buff *skb) { const struct dccp_hdr *dh; @@ -905,30 +1065,29 @@ int dccp_invalid_packet(struct sk_buff *skb) return 1; } + /* If the header checksum is incorrect, drop packet and return */ + if (dccp_v4_verify_checksum(skb, skb->nh.iph->saddr, + skb->nh.iph->daddr) < 0) { + LIMIT_NETDEBUG(KERN_WARNING "DCCP: header checksum is " + "incorrect\n"); + return 1; + } + return 0; } -EXPORT_SYMBOL_GPL(dccp_invalid_packet); - /* this is called when real data arrives */ int dccp_v4_rcv(struct sk_buff *skb) { const struct dccp_hdr *dh; struct sock *sk; + int rc; /* Step 1: Check header basics: */ if (dccp_invalid_packet(skb)) goto discard_it; - /* If the header checksum is incorrect, drop packet and return */ - if (dccp_v4_verify_checksum(skb, skb->nh.iph->saddr, - skb->nh.iph->daddr) < 0) { - LIMIT_NETDEBUG(KERN_WARNING "%s: incorrect header checksum\n", - __FUNCTION__); - goto discard_it; - } - dh = dccp_hdr(skb); DCCP_SKB_CB(skb)->dccpd_seq = dccp_hdr_seq(skb); @@ -984,10 +1143,28 @@ int dccp_v4_rcv(struct sk_buff *skb) goto do_time_wait; } - if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) + if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) { + dccp_pr_debug("xfrm4_policy_check failed\n"); goto discard_and_relse; + } + + if (sk_filter(sk, skb, 0)) { + dccp_pr_debug("sk_filter failed\n"); + goto discard_and_relse; + } + + skb->dev = NULL; + + bh_lock_sock(sk); + rc = 0; + if (!sock_owned_by_user(sk)) + rc = dccp_v4_do_rcv(sk, skb); + else + sk_add_backlog(sk, skb); + bh_unlock_sock(sk); - return sk_receive_skb(sk, skb); + sock_put(sk); + return rc; no_dccp_socket: if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) @@ -1017,23 +1194,9 @@ int dccp_v4_rcv(struct sk_buff *skb) goto no_dccp_socket; } -struct inet_connection_sock_af_ops dccp_ipv4_af_ops = { - .queue_xmit = ip_queue_xmit, - .send_check = dccp_v4_send_check, - .rebuild_header = inet_sk_rebuild_header, - .conn_request = dccp_v4_conn_request, - .syn_recv_sock = dccp_v4_request_recv_sock, - .net_header_len = sizeof(struct iphdr), - .setsockopt = ip_setsockopt, - .getsockopt = ip_getsockopt, - .addr2sockaddr = inet_csk_addr2sockaddr, - .sockaddr_len = sizeof(struct sockaddr_in), -}; - -int dccp_v4_init_sock(struct sock *sk) +static int dccp_v4_init_sock(struct sock *sk) { struct dccp_sock *dp = dccp_sk(sk); - struct inet_connection_sock *icsk = inet_csk(sk); static int dccp_ctl_socket_init = 1; dccp_options_init(&dp->dccps_options); @@ -1073,11 +1236,9 @@ int dccp_v4_init_sock(struct sock *sk) dccp_ctl_socket_init = 0; dccp_init_xmit_timers(sk); - icsk->icsk_rto = DCCP_TIMEOUT_INIT; + inet_csk(sk)->icsk_rto = DCCP_TIMEOUT_INIT; sk->sk_state = DCCP_CLOSED; sk->sk_write_space = dccp_write_space; - icsk->icsk_af_ops = &dccp_ipv4_af_ops; - icsk->icsk_sync_mss = dccp_sync_mss; dp->dccps_mss_cache = 536; dp->dccps_role = DCCP_ROLE_UNDEFINED; dp->dccps_service = DCCP_SERVICE_INVALID_VALUE; @@ -1085,14 +1246,12 @@ int dccp_v4_init_sock(struct sock *sk) return 0; } -EXPORT_SYMBOL_GPL(dccp_v4_init_sock); - -int dccp_v4_destroy_sock(struct sock *sk) +static int dccp_v4_destroy_sock(struct sock *sk) { struct dccp_sock *dp = dccp_sk(sk); /* - * DCCP doesn't use sk_write_queue, just sk_send_head + * DCCP doesn't use sk_qrite_queue, just sk_send_head * for retransmissions */ if (sk->sk_send_head != NULL) { @@ -1120,8 +1279,6 @@ int dccp_v4_destroy_sock(struct sock *sk) return 0; } -EXPORT_SYMBOL_GPL(dccp_v4_destroy_sock); - static void dccp_v4_reqsk_destructor(struct request_sock *req) { kfree(inet_rsk(req)->opt); @@ -1136,11 +1293,7 @@ static struct request_sock_ops dccp_request_sock_ops = { .send_reset = dccp_v4_ctl_send_reset, }; -static struct timewait_sock_ops dccp_timewait_sock_ops = { - .twsk_obj_size = sizeof(struct inet_timewait_sock), -}; - -struct proto dccp_prot = { +struct proto dccp_v4_prot = { .name = "DCCP", .owner = THIS_MODULE, .close = dccp_close, @@ -1154,7 +1307,7 @@ struct proto dccp_prot = { .recvmsg = dccp_recvmsg, .backlog_rcv = dccp_v4_do_rcv, .hash = dccp_v4_hash, - .unhash = dccp_unhash, + .unhash = dccp_v4_unhash, .accept = inet_csk_accept, .get_port = dccp_v4_get_port, .shutdown = dccp_shutdown, @@ -1163,7 +1316,5 @@ struct proto dccp_prot = { .max_header = MAX_DCCP_HEADER, .obj_size = sizeof(struct dccp_sock), .rsk_prot = &dccp_request_sock_ops, - .twsk_prot = &dccp_timewait_sock_ops, + .twsk_obj_size = sizeof(struct inet_timewait_sock), }; - -EXPORT_SYMBOL_GPL(dccp_prot); diff --git a/trunk/net/dccp/ipv6.c b/trunk/net/dccp/ipv6.c deleted file mode 100644 index c609dc78f487..000000000000 --- a/trunk/net/dccp/ipv6.c +++ /dev/null @@ -1,1261 +0,0 @@ -/* - * DCCP over IPv6 - * Linux INET6 implementation - * - * Based on net/dccp6/ipv6.c - * - * Arnaldo Carvalho de Melo - * - * 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 -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dccp.h" -#include "ipv6.h" - -static void dccp_v6_ctl_send_reset(struct sk_buff *skb); -static void dccp_v6_reqsk_send_ack(struct sk_buff *skb, - struct request_sock *req); -static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb); - -static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb); - -static struct inet_connection_sock_af_ops dccp_ipv6_mapped; -static struct inet_connection_sock_af_ops dccp_ipv6_af_ops; - -static int dccp_v6_get_port(struct sock *sk, unsigned short snum) -{ - return inet_csk_get_port(&dccp_hashinfo, sk, snum, - inet6_csk_bind_conflict); -} - -static void dccp_v6_hash(struct sock *sk) -{ - if (sk->sk_state != DCCP_CLOSED) { - if (inet_csk(sk)->icsk_af_ops == &dccp_ipv6_mapped) { - dccp_prot.hash(sk); - return; - } - local_bh_disable(); - __inet6_hash(&dccp_hashinfo, sk); - local_bh_enable(); - } -} - -static inline u16 dccp_v6_check(struct dccp_hdr *dh, int len, - struct in6_addr *saddr, - struct in6_addr *daddr, - unsigned long base) -{ - return csum_ipv6_magic(saddr, daddr, len, IPPROTO_DCCP, base); -} - -static __u32 dccp_v6_init_sequence(struct sock *sk, struct sk_buff *skb) -{ - const struct dccp_hdr *dh = dccp_hdr(skb); - - if (skb->protocol == htons(ETH_P_IPV6)) - return secure_tcpv6_sequence_number(skb->nh.ipv6h->daddr.s6_addr32, - skb->nh.ipv6h->saddr.s6_addr32, - dh->dccph_dport, - dh->dccph_sport); - else - return secure_dccp_sequence_number(skb->nh.iph->daddr, - skb->nh.iph->saddr, - dh->dccph_dport, - dh->dccph_sport); -} - -static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, - int addr_len) -{ - struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; - struct inet_connection_sock *icsk = inet_csk(sk); - struct inet_sock *inet = inet_sk(sk); - struct ipv6_pinfo *np = inet6_sk(sk); - struct dccp_sock *dp = dccp_sk(sk); - struct in6_addr *saddr = NULL, *final_p = NULL, final; - struct flowi fl; - struct dst_entry *dst; - int addr_type; - int err; - - dp->dccps_role = DCCP_ROLE_CLIENT; - - if (addr_len < SIN6_LEN_RFC2133) - return -EINVAL; - - if (usin->sin6_family != AF_INET6) - return -EAFNOSUPPORT; - - memset(&fl, 0, sizeof(fl)); - - if (np->sndflow) { - fl.fl6_flowlabel = usin->sin6_flowinfo & IPV6_FLOWINFO_MASK; - IP6_ECN_flow_init(fl.fl6_flowlabel); - if (fl.fl6_flowlabel & IPV6_FLOWLABEL_MASK) { - struct ip6_flowlabel *flowlabel; - flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel); - if (flowlabel == NULL) - return -EINVAL; - ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst); - fl6_sock_release(flowlabel); - } - } - - /* - * connect() to INADDR_ANY means loopback (BSD'ism). - */ - - if (ipv6_addr_any(&usin->sin6_addr)) - usin->sin6_addr.s6_addr[15] = 0x1; - - addr_type = ipv6_addr_type(&usin->sin6_addr); - - if(addr_type & IPV6_ADDR_MULTICAST) - return -ENETUNREACH; - - if (addr_type & IPV6_ADDR_LINKLOCAL) { - if (addr_len >= sizeof(struct sockaddr_in6) && - usin->sin6_scope_id) { - /* If interface is set while binding, indices - * must coincide. - */ - if (sk->sk_bound_dev_if && - sk->sk_bound_dev_if != usin->sin6_scope_id) - return -EINVAL; - - sk->sk_bound_dev_if = usin->sin6_scope_id; - } - - /* Connect to link-local address requires an interface */ - if (!sk->sk_bound_dev_if) - return -EINVAL; - } - - ipv6_addr_copy(&np->daddr, &usin->sin6_addr); - np->flow_label = fl.fl6_flowlabel; - - /* - * DCCP over IPv4 - */ - - if (addr_type == IPV6_ADDR_MAPPED) { - u32 exthdrlen = icsk->icsk_ext_hdr_len; - struct sockaddr_in sin; - - SOCK_DEBUG(sk, "connect: ipv4 mapped\n"); - - if (__ipv6_only_sock(sk)) - return -ENETUNREACH; - - sin.sin_family = AF_INET; - sin.sin_port = usin->sin6_port; - sin.sin_addr.s_addr = usin->sin6_addr.s6_addr32[3]; - - icsk->icsk_af_ops = &dccp_ipv6_mapped; - sk->sk_backlog_rcv = dccp_v4_do_rcv; - - err = dccp_v4_connect(sk, (struct sockaddr *)&sin, sizeof(sin)); - - if (err) { - icsk->icsk_ext_hdr_len = exthdrlen; - icsk->icsk_af_ops = &dccp_ipv6_af_ops; - sk->sk_backlog_rcv = dccp_v6_do_rcv; - goto failure; - } else { - ipv6_addr_set(&np->saddr, 0, 0, htonl(0x0000FFFF), - inet->saddr); - ipv6_addr_set(&np->rcv_saddr, 0, 0, htonl(0x0000FFFF), - inet->rcv_saddr); - } - - return err; - } - - if (!ipv6_addr_any(&np->rcv_saddr)) - saddr = &np->rcv_saddr; - - fl.proto = IPPROTO_DCCP; - ipv6_addr_copy(&fl.fl6_dst, &np->daddr); - ipv6_addr_copy(&fl.fl6_src, saddr ? saddr : &np->saddr); - fl.oif = sk->sk_bound_dev_if; - fl.fl_ip_dport = usin->sin6_port; - fl.fl_ip_sport = inet->sport; - - if (np->opt && np->opt->srcrt) { - struct rt0_hdr *rt0 = (struct rt0_hdr *)np->opt->srcrt; - ipv6_addr_copy(&final, &fl.fl6_dst); - ipv6_addr_copy(&fl.fl6_dst, rt0->addr); - final_p = &final; - } - - err = ip6_dst_lookup(sk, &dst, &fl); - if (err) - goto failure; - if (final_p) - ipv6_addr_copy(&fl.fl6_dst, final_p); - - if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) - goto failure; - - if (saddr == NULL) { - saddr = &fl.fl6_src; - ipv6_addr_copy(&np->rcv_saddr, saddr); - } - - /* set the source address */ - ipv6_addr_copy(&np->saddr, saddr); - inet->rcv_saddr = LOOPBACK4_IPV6; - - ip6_dst_store(sk, dst, NULL); - - icsk->icsk_ext_hdr_len = 0; - if (np->opt) - icsk->icsk_ext_hdr_len = (np->opt->opt_flen + - np->opt->opt_nflen); - - inet->dport = usin->sin6_port; - - dccp_set_state(sk, DCCP_REQUESTING); - err = inet6_hash_connect(&dccp_death_row, sk); - if (err) - goto late_failure; - /* FIXME */ -#if 0 - dp->dccps_gar = secure_dccp_v6_sequence_number(np->saddr.s6_addr32, - np->daddr.s6_addr32, - inet->sport, - inet->dport); -#endif - err = dccp_connect(sk); - if (err) - goto late_failure; - - return 0; - -late_failure: - dccp_set_state(sk, DCCP_CLOSED); - __sk_dst_reset(sk); -failure: - inet->dport = 0; - sk->sk_route_caps = 0; - return err; -} - -static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, - int type, int code, int offset, __u32 info) -{ - struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data; - const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); - struct ipv6_pinfo *np; - struct sock *sk; - int err; - __u64 seq; - - sk = inet6_lookup(&dccp_hashinfo, &hdr->daddr, dh->dccph_dport, - &hdr->saddr, dh->dccph_sport, skb->dev->ifindex); - - if (sk == NULL) { - ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS); - return; - } - - if (sk->sk_state == DCCP_TIME_WAIT) { - inet_twsk_put((struct inet_timewait_sock *)sk); - return; - } - - bh_lock_sock(sk); - if (sock_owned_by_user(sk)) - NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS); - - if (sk->sk_state == DCCP_CLOSED) - goto out; - - np = inet6_sk(sk); - - if (type == ICMPV6_PKT_TOOBIG) { - struct dst_entry *dst = NULL; - - if (sock_owned_by_user(sk)) - goto out; - if ((1 << sk->sk_state) & (DCCPF_LISTEN | DCCPF_CLOSED)) - goto out; - - /* icmp should have updated the destination cache entry */ - dst = __sk_dst_check(sk, np->dst_cookie); - - if (dst == NULL) { - struct inet_sock *inet = inet_sk(sk); - struct flowi fl; - - /* BUGGG_FUTURE: Again, it is not clear how - to handle rthdr case. Ignore this complexity - for now. - */ - memset(&fl, 0, sizeof(fl)); - fl.proto = IPPROTO_DCCP; - ipv6_addr_copy(&fl.fl6_dst, &np->daddr); - ipv6_addr_copy(&fl.fl6_src, &np->saddr); - fl.oif = sk->sk_bound_dev_if; - fl.fl_ip_dport = inet->dport; - fl.fl_ip_sport = inet->sport; - - if ((err = ip6_dst_lookup(sk, &dst, &fl))) { - sk->sk_err_soft = -err; - goto out; - } - - if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { - sk->sk_err_soft = -err; - goto out; - } - - } else - dst_hold(dst); - - if (inet_csk(sk)->icsk_pmtu_cookie > dst_mtu(dst)) { - dccp_sync_mss(sk, dst_mtu(dst)); - } /* else let the usual retransmit timer handle it */ - dst_release(dst); - goto out; - } - - icmpv6_err_convert(type, code, &err); - - seq = DCCP_SKB_CB(skb)->dccpd_seq; - /* Might be for an request_sock */ - switch (sk->sk_state) { - struct request_sock *req, **prev; - case DCCP_LISTEN: - if (sock_owned_by_user(sk)) - goto out; - - req = inet6_csk_search_req(sk, &prev, dh->dccph_dport, - &hdr->daddr, &hdr->saddr, - inet6_iif(skb)); - if (!req) - goto out; - - /* ICMPs are not backlogged, hence we cannot get - * an established socket here. - */ - BUG_TRAP(req->sk == NULL); - - if (seq != dccp_rsk(req)->dreq_iss) { - NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS); - goto out; - } - - inet_csk_reqsk_queue_drop(sk, req, prev); - goto out; - - case DCCP_REQUESTING: - case DCCP_RESPOND: /* Cannot happen. - It can, it SYNs are crossed. --ANK */ - if (!sock_owned_by_user(sk)) { - DCCP_INC_STATS_BH(DCCP_MIB_ATTEMPTFAILS); - sk->sk_err = err; - /* - * Wake people up to see the error - * (see connect in sock.c) - */ - sk->sk_error_report(sk); - - dccp_done(sk); - } else - sk->sk_err_soft = err; - goto out; - } - - if (!sock_owned_by_user(sk) && np->recverr) { - sk->sk_err = err; - sk->sk_error_report(sk); - } else - sk->sk_err_soft = err; - -out: - bh_unlock_sock(sk); - sock_put(sk); -} - - -static int dccp_v6_send_response(struct sock *sk, struct request_sock *req, - struct dst_entry *dst) -{ - struct inet6_request_sock *ireq6 = inet6_rsk(req); - struct ipv6_pinfo *np = inet6_sk(sk); - struct sk_buff *skb; - struct ipv6_txoptions *opt = NULL; - struct in6_addr *final_p = NULL, final; - struct flowi fl; - int err = -1; - - memset(&fl, 0, sizeof(fl)); - fl.proto = IPPROTO_DCCP; - ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr); - ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); - fl.fl6_flowlabel = 0; - fl.oif = ireq6->iif; - fl.fl_ip_dport = inet_rsk(req)->rmt_port; - fl.fl_ip_sport = inet_sk(sk)->sport; - - if (dst == NULL) { - opt = np->opt; - if (opt == NULL && - np->rxopt.bits.osrcrt == 2 && - ireq6->pktopts) { - struct sk_buff *pktopts = ireq6->pktopts; - struct inet6_skb_parm *rxopt = IP6CB(pktopts); - if (rxopt->srcrt) - opt = ipv6_invert_rthdr(sk, - (struct ipv6_rt_hdr *)(pktopts->nh.raw + - rxopt->srcrt)); - } - - if (opt && opt->srcrt) { - struct rt0_hdr *rt0 = (struct rt0_hdr *)opt->srcrt; - ipv6_addr_copy(&final, &fl.fl6_dst); - ipv6_addr_copy(&fl.fl6_dst, rt0->addr); - final_p = &final; - } - - err = ip6_dst_lookup(sk, &dst, &fl); - if (err) - goto done; - if (final_p) - ipv6_addr_copy(&fl.fl6_dst, final_p); - if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) - goto done; - } - - skb = dccp_make_response(sk, dst, req); - if (skb != NULL) { - struct dccp_hdr *dh = dccp_hdr(skb); - dh->dccph_checksum = dccp_v6_check(dh, skb->len, - &ireq6->loc_addr, - &ireq6->rmt_addr, - csum_partial((char *)dh, - skb->len, - skb->csum)); - ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr); - err = ip6_xmit(sk, skb, &fl, opt, 0); - if (err == NET_XMIT_CN) - err = 0; - } - -done: - if (opt && opt != np->opt) - sock_kfree_s(sk, opt, opt->tot_len); - return err; -} - -static void dccp_v6_reqsk_destructor(struct request_sock *req) -{ - if (inet6_rsk(req)->pktopts != NULL) - kfree_skb(inet6_rsk(req)->pktopts); -} - -static struct request_sock_ops dccp6_request_sock_ops = { - .family = AF_INET6, - .obj_size = sizeof(struct dccp6_request_sock), - .rtx_syn_ack = dccp_v6_send_response, - .send_ack = dccp_v6_reqsk_send_ack, - .destructor = dccp_v6_reqsk_destructor, - .send_reset = dccp_v6_ctl_send_reset, -}; - -static struct timewait_sock_ops dccp6_timewait_sock_ops = { - .twsk_obj_size = sizeof(struct dccp6_timewait_sock), -}; - -static void dccp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb) -{ - struct ipv6_pinfo *np = inet6_sk(sk); - struct dccp_hdr *dh = dccp_hdr(skb); - - dh->dccph_checksum = csum_ipv6_magic(&np->saddr, &np->daddr, - len, IPPROTO_DCCP, - csum_partial((char *)dh, - dh->dccph_doff << 2, - skb->csum)); -} - -static void dccp_v6_ctl_send_reset(struct sk_buff *rxskb) -{ - struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh; - const int dccp_hdr_reset_len = sizeof(struct dccp_hdr) + - sizeof(struct dccp_hdr_ext) + - sizeof(struct dccp_hdr_reset); - struct sk_buff *skb; - struct flowi fl; - u64 seqno; - - if (rxdh->dccph_type == DCCP_PKT_RESET) - return; - - if (!ipv6_unicast_destination(rxskb)) - return; - - /* - * We need to grab some memory, and put together an RST, - * and then put it into the queue to be sent. - */ - - skb = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + - dccp_hdr_reset_len, GFP_ATOMIC); - if (skb == NULL) - return; - - skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr) + - dccp_hdr_reset_len); - - skb->h.raw = skb_push(skb, dccp_hdr_reset_len); - dh = dccp_hdr(skb); - memset(dh, 0, dccp_hdr_reset_len); - - /* Swap the send and the receive. */ - dh->dccph_type = DCCP_PKT_RESET; - dh->dccph_sport = rxdh->dccph_dport; - dh->dccph_dport = rxdh->dccph_sport; - dh->dccph_doff = dccp_hdr_reset_len / 4; - dh->dccph_x = 1; - dccp_hdr_reset(skb)->dccph_reset_code = - DCCP_SKB_CB(rxskb)->dccpd_reset_code; - - /* See "8.3.1. Abnormal Termination" in draft-ietf-dccp-spec-11 */ - seqno = 0; - if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) - dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1); - - dccp_hdr_set_seq(dh, seqno); - dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), - DCCP_SKB_CB(rxskb)->dccpd_seq); - - memset(&fl, 0, sizeof(fl)); - ipv6_addr_copy(&fl.fl6_dst, &rxskb->nh.ipv6h->saddr); - ipv6_addr_copy(&fl.fl6_src, &rxskb->nh.ipv6h->daddr); - dh->dccph_checksum = csum_ipv6_magic(&fl.fl6_src, &fl.fl6_dst, - sizeof(*dh), IPPROTO_DCCP, - skb->csum); - fl.proto = IPPROTO_DCCP; - fl.oif = inet6_iif(rxskb); - fl.fl_ip_dport = dh->dccph_dport; - fl.fl_ip_sport = dh->dccph_sport; - - /* sk = NULL, but it is safe for now. RST socket required. */ - if (!ip6_dst_lookup(NULL, &skb->dst, &fl)) { - if (xfrm_lookup(&skb->dst, &fl, NULL, 0) >= 0) { - ip6_xmit(NULL, skb, &fl, NULL, 0); - DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS); - DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS); - return; - } - } - - kfree_skb(skb); -} - -static void dccp_v6_ctl_send_ack(struct sk_buff *rxskb) -{ - struct flowi fl; - struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh; - const int dccp_hdr_ack_len = sizeof(struct dccp_hdr) + - sizeof(struct dccp_hdr_ext) + - sizeof(struct dccp_hdr_ack_bits); - struct sk_buff *skb; - - skb = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + - dccp_hdr_ack_len, GFP_ATOMIC); - if (skb == NULL) - return; - - skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr) + - dccp_hdr_ack_len); - - skb->h.raw = skb_push(skb, dccp_hdr_ack_len); - dh = dccp_hdr(skb); - memset(dh, 0, dccp_hdr_ack_len); - - /* Build DCCP header and checksum it. */ - dh->dccph_type = DCCP_PKT_ACK; - dh->dccph_sport = rxdh->dccph_dport; - dh->dccph_dport = rxdh->dccph_sport; - dh->dccph_doff = dccp_hdr_ack_len / 4; - dh->dccph_x = 1; - - dccp_hdr_set_seq(dh, DCCP_SKB_CB(rxskb)->dccpd_ack_seq); - dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), - DCCP_SKB_CB(rxskb)->dccpd_seq); - - memset(&fl, 0, sizeof(fl)); - ipv6_addr_copy(&fl.fl6_dst, &rxskb->nh.ipv6h->saddr); - ipv6_addr_copy(&fl.fl6_src, &rxskb->nh.ipv6h->daddr); - - /* FIXME: calculate checksum, IPv4 also should... */ - - fl.proto = IPPROTO_DCCP; - fl.oif = inet6_iif(rxskb); - fl.fl_ip_dport = dh->dccph_dport; - fl.fl_ip_sport = dh->dccph_sport; - - if (!ip6_dst_lookup(NULL, &skb->dst, &fl)) { - if (xfrm_lookup(&skb->dst, &fl, NULL, 0) >= 0) { - ip6_xmit(NULL, skb, &fl, NULL, 0); - DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS); - return; - } - } - - kfree_skb(skb); -} - -static void dccp_v6_reqsk_send_ack(struct sk_buff *skb, - struct request_sock *req) -{ - dccp_v6_ctl_send_ack(skb); -} - -static struct sock *dccp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) -{ - const struct dccp_hdr *dh = dccp_hdr(skb); - const struct ipv6hdr *iph = skb->nh.ipv6h; - struct sock *nsk; - struct request_sock **prev; - /* Find possible connection requests. */ - struct request_sock *req = inet6_csk_search_req(sk, &prev, - dh->dccph_sport, - &iph->saddr, - &iph->daddr, - inet6_iif(skb)); - if (req != NULL) - return dccp_check_req(sk, skb, req, prev); - - nsk = __inet6_lookup_established(&dccp_hashinfo, - &iph->saddr, dh->dccph_sport, - &iph->daddr, ntohs(dh->dccph_dport), - inet6_iif(skb)); - - if (nsk != NULL) { - if (nsk->sk_state != DCCP_TIME_WAIT) { - bh_lock_sock(nsk); - return nsk; - } - inet_twsk_put((struct inet_timewait_sock *)nsk); - return NULL; - } - - return sk; -} - -static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb) -{ - struct inet_request_sock *ireq; - struct dccp_sock dp; - struct request_sock *req; - struct dccp_request_sock *dreq; - struct inet6_request_sock *ireq6; - struct ipv6_pinfo *np = inet6_sk(sk); - const __u32 service = dccp_hdr_request(skb)->dccph_req_service; - struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb); - __u8 reset_code = DCCP_RESET_CODE_TOO_BUSY; - - if (skb->protocol == htons(ETH_P_IP)) - return dccp_v4_conn_request(sk, skb); - - if (!ipv6_unicast_destination(skb)) - goto drop; - - if (dccp_bad_service_code(sk, service)) { - reset_code = DCCP_RESET_CODE_BAD_SERVICE_CODE; - goto drop; - } - /* - * There are no SYN attacks on IPv6, yet... - */ - if (inet_csk_reqsk_queue_is_full(sk)) - goto drop; - - if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) - goto drop; - - req = inet6_reqsk_alloc(sk->sk_prot->rsk_prot); - if (req == NULL) - goto drop; - - /* FIXME: process options */ - - dccp_openreq_init(req, &dp, skb); - - ireq6 = inet6_rsk(req); - ireq = inet_rsk(req); - ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr); - ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr); - req->rcv_wnd = 100; /* Fake, option parsing will get the - right value */ - ireq6->pktopts = NULL; - - if (ipv6_opt_accepted(sk, skb) || - np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || - np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) { - atomic_inc(&skb->users); - ireq6->pktopts = skb; - } - ireq6->iif = sk->sk_bound_dev_if; - - /* So that link locals have meaning */ - if (!sk->sk_bound_dev_if && - ipv6_addr_type(&ireq6->rmt_addr) & IPV6_ADDR_LINKLOCAL) - ireq6->iif = inet6_iif(skb); - - /* - * Step 3: Process LISTEN state - * - * Set S.ISR, S.GSR, S.SWL, S.SWH from packet or Init Cookie - * - * In fact we defer setting S.GSR, S.SWL, S.SWH to - * dccp_create_openreq_child. - */ - dreq = dccp_rsk(req); - dreq->dreq_isr = dcb->dccpd_seq; - dreq->dreq_iss = dccp_v6_init_sequence(sk, skb); - dreq->dreq_service = service; - - if (dccp_v6_send_response(sk, req, NULL)) - goto drop_and_free; - - inet6_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT); - return 0; - -drop_and_free: - reqsk_free(req); -drop: - DCCP_INC_STATS_BH(DCCP_MIB_ATTEMPTFAILS); - dcb->dccpd_reset_code = reset_code; - return -1; -} - -static struct sock *dccp_v6_request_recv_sock(struct sock *sk, - struct sk_buff *skb, - struct request_sock *req, - struct dst_entry *dst) -{ - struct inet6_request_sock *ireq6 = inet6_rsk(req); - struct ipv6_pinfo *newnp, *np = inet6_sk(sk); - struct inet_sock *newinet; - struct dccp_sock *newdp; - struct dccp6_sock *newdp6; - struct sock *newsk; - struct ipv6_txoptions *opt; - - if (skb->protocol == htons(ETH_P_IP)) { - /* - * v6 mapped - */ - - newsk = dccp_v4_request_recv_sock(sk, skb, req, dst); - if (newsk == NULL) - return NULL; - - newdp6 = (struct dccp6_sock *)newsk; - newdp = dccp_sk(newsk); - newinet = inet_sk(newsk); - newinet->pinet6 = &newdp6->inet6; - newnp = inet6_sk(newsk); - - memcpy(newnp, np, sizeof(struct ipv6_pinfo)); - - ipv6_addr_set(&newnp->daddr, 0, 0, htonl(0x0000FFFF), - newinet->daddr); - - ipv6_addr_set(&newnp->saddr, 0, 0, htonl(0x0000FFFF), - newinet->saddr); - - ipv6_addr_copy(&newnp->rcv_saddr, &newnp->saddr); - - inet_csk(newsk)->icsk_af_ops = &dccp_ipv6_mapped; - newsk->sk_backlog_rcv = dccp_v4_do_rcv; - newnp->pktoptions = NULL; - newnp->opt = NULL; - newnp->mcast_oif = inet6_iif(skb); - newnp->mcast_hops = skb->nh.ipv6h->hop_limit; - - /* - * No need to charge this sock to the relevant IPv6 refcnt debug socks count - * here, dccp_create_openreq_child now does this for us, see the comment in - * that function for the gory details. -acme - */ - - /* It is tricky place. Until this moment IPv4 tcp - worked with IPv6 icsk.icsk_af_ops. - Sync it now. - */ - dccp_sync_mss(newsk, inet_csk(newsk)->icsk_pmtu_cookie); - - return newsk; - } - - opt = np->opt; - - if (sk_acceptq_is_full(sk)) - goto out_overflow; - - if (np->rxopt.bits.osrcrt == 2 && - opt == NULL && ireq6->pktopts) { - struct inet6_skb_parm *rxopt = IP6CB(ireq6->pktopts); - if (rxopt->srcrt) - opt = ipv6_invert_rthdr(sk, - (struct ipv6_rt_hdr *)(ireq6->pktopts->nh.raw + - rxopt->srcrt)); - } - - if (dst == NULL) { - struct in6_addr *final_p = NULL, final; - struct flowi fl; - - memset(&fl, 0, sizeof(fl)); - fl.proto = IPPROTO_DCCP; - ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr); - if (opt && opt->srcrt) { - struct rt0_hdr *rt0 = (struct rt0_hdr *) opt->srcrt; - ipv6_addr_copy(&final, &fl.fl6_dst); - ipv6_addr_copy(&fl.fl6_dst, rt0->addr); - final_p = &final; - } - ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); - fl.oif = sk->sk_bound_dev_if; - fl.fl_ip_dport = inet_rsk(req)->rmt_port; - fl.fl_ip_sport = inet_sk(sk)->sport; - - if (ip6_dst_lookup(sk, &dst, &fl)) - goto out; - - if (final_p) - ipv6_addr_copy(&fl.fl6_dst, final_p); - - if ((xfrm_lookup(&dst, &fl, sk, 0)) < 0) - goto out; - } - - newsk = dccp_create_openreq_child(sk, req, skb); - if (newsk == NULL) - goto out; - - /* - * No need to charge this sock to the relevant IPv6 refcnt debug socks - * count here, dccp_create_openreq_child now does this for us, see the - * comment in that function for the gory details. -acme - */ - - ip6_dst_store(newsk, dst, NULL); - newsk->sk_route_caps = dst->dev->features & - ~(NETIF_F_IP_CSUM | NETIF_F_TSO); - - newdp6 = (struct dccp6_sock *)newsk; - newinet = inet_sk(newsk); - newinet->pinet6 = &newdp6->inet6; - newdp = dccp_sk(newsk); - newnp = inet6_sk(newsk); - - memcpy(newnp, np, sizeof(struct ipv6_pinfo)); - - ipv6_addr_copy(&newnp->daddr, &ireq6->rmt_addr); - ipv6_addr_copy(&newnp->saddr, &ireq6->loc_addr); - ipv6_addr_copy(&newnp->rcv_saddr, &ireq6->loc_addr); - newsk->sk_bound_dev_if = ireq6->iif; - - /* Now IPv6 options... - - First: no IPv4 options. - */ - newinet->opt = NULL; - - /* Clone RX bits */ - newnp->rxopt.all = np->rxopt.all; - - /* Clone pktoptions received with SYN */ - newnp->pktoptions = NULL; - if (ireq6->pktopts != NULL) { - newnp->pktoptions = skb_clone(ireq6->pktopts, GFP_ATOMIC); - kfree_skb(ireq6->pktopts); - ireq6->pktopts = NULL; - if (newnp->pktoptions) - skb_set_owner_r(newnp->pktoptions, newsk); - } - newnp->opt = NULL; - newnp->mcast_oif = inet6_iif(skb); - newnp->mcast_hops = skb->nh.ipv6h->hop_limit; - - /* Clone native IPv6 options from listening socket (if any) - - Yes, keeping reference count would be much more clever, - but we make one more one thing there: reattach optmem - to newsk. - */ - if (opt) { - newnp->opt = ipv6_dup_options(newsk, opt); - if (opt != np->opt) - sock_kfree_s(sk, opt, opt->tot_len); - } - - inet_csk(newsk)->icsk_ext_hdr_len = 0; - if (newnp->opt) - inet_csk(newsk)->icsk_ext_hdr_len = (newnp->opt->opt_nflen + - newnp->opt->opt_flen); - - dccp_sync_mss(newsk, dst_mtu(dst)); - - newinet->daddr = newinet->saddr = newinet->rcv_saddr = LOOPBACK4_IPV6; - - __inet6_hash(&dccp_hashinfo, newsk); - inet_inherit_port(&dccp_hashinfo, sk, newsk); - - return newsk; - -out_overflow: - NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS); -out: - NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS); - if (opt && opt != np->opt) - sock_kfree_s(sk, opt, opt->tot_len); - dst_release(dst); - return NULL; -} - -/* The socket must have it's spinlock held when we get - * here. - * - * We have a potential double-lock case here, so even when - * doing backlog processing we use the BH locking scheme. - * This is because we cannot sleep with the original spinlock - * held. - */ -static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) -{ - struct ipv6_pinfo *np = inet6_sk(sk); - struct sk_buff *opt_skb = NULL; - - /* Imagine: socket is IPv6. IPv4 packet arrives, - goes to IPv4 receive handler and backlogged. - From backlog it always goes here. Kerboom... - Fortunately, dccp_rcv_established and rcv_established - handle them correctly, but it is not case with - dccp_v6_hnd_req and dccp_v6_ctl_send_reset(). --ANK - */ - - if (skb->protocol == htons(ETH_P_IP)) - return dccp_v4_do_rcv(sk, skb); - - if (sk_filter(sk, skb, 0)) - goto discard; - - /* - * socket locking is here for SMP purposes as backlog rcv - * is currently called with bh processing disabled. - */ - - /* Do Stevens' IPV6_PKTOPTIONS. - - Yes, guys, it is the only place in our code, where we - may make it not affecting IPv4. - The rest of code is protocol independent, - and I do not like idea to uglify IPv4. - - Actually, all the idea behind IPV6_PKTOPTIONS - looks not very well thought. For now we latch - options, received in the last packet, enqueued - by tcp. Feel free to propose better solution. - --ANK (980728) - */ - if (np->rxopt.all) - opt_skb = skb_clone(skb, GFP_ATOMIC); - - if (sk->sk_state == DCCP_OPEN) { /* Fast path */ - if (dccp_rcv_established(sk, skb, dccp_hdr(skb), skb->len)) - goto reset; - return 0; - } - - if (sk->sk_state == DCCP_LISTEN) { - struct sock *nsk = dccp_v6_hnd_req(sk, skb); - if (!nsk) - goto discard; - - /* - * Queue it on the new socket if the new socket is active, - * otherwise we just shortcircuit this and continue with - * the new socket.. - */ - if(nsk != sk) { - if (dccp_child_process(sk, nsk, skb)) - goto reset; - if (opt_skb) - __kfree_skb(opt_skb); - return 0; - } - } - - if (dccp_rcv_state_process(sk, skb, dccp_hdr(skb), skb->len)) - goto reset; - return 0; - -reset: - dccp_v6_ctl_send_reset(skb); -discard: - if (opt_skb) - __kfree_skb(opt_skb); - kfree_skb(skb); - return 0; -} - -static int dccp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) -{ - const struct dccp_hdr *dh; - struct sk_buff *skb = *pskb; - struct sock *sk; - - /* Step 1: Check header basics: */ - - if (dccp_invalid_packet(skb)) - goto discard_it; - - dh = dccp_hdr(skb); - - DCCP_SKB_CB(skb)->dccpd_seq = dccp_hdr_seq(skb); - DCCP_SKB_CB(skb)->dccpd_type = dh->dccph_type; - - if (dccp_packet_without_ack(skb)) - DCCP_SKB_CB(skb)->dccpd_ack_seq = DCCP_PKT_WITHOUT_ACK_SEQ; - else - DCCP_SKB_CB(skb)->dccpd_ack_seq = dccp_hdr_ack_seq(skb); - - /* Step 2: - * Look up flow ID in table and get corresponding socket */ - sk = __inet6_lookup(&dccp_hashinfo, &skb->nh.ipv6h->saddr, - dh->dccph_sport, - &skb->nh.ipv6h->daddr, ntohs(dh->dccph_dport), - inet6_iif(skb)); - /* - * Step 2: - * If no socket ... - * Generate Reset(No Connection) unless P.type == Reset - * Drop packet and return - */ - if (sk == NULL) - goto no_dccp_socket; - - /* - * Step 2: - * ... or S.state == TIMEWAIT, - * Generate Reset(No Connection) unless P.type == Reset - * Drop packet and return - */ - - if (sk->sk_state == DCCP_TIME_WAIT) - goto do_time_wait; - - if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) - goto discard_and_relse; - - return sk_receive_skb(sk, skb) ? -1 : 0; - -no_dccp_socket: - if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) - goto discard_it; - /* - * Step 2: - * Generate Reset(No Connection) unless P.type == Reset - * Drop packet and return - */ - if (dh->dccph_type != DCCP_PKT_RESET) { - DCCP_SKB_CB(skb)->dccpd_reset_code = - DCCP_RESET_CODE_NO_CONNECTION; - dccp_v6_ctl_send_reset(skb); - } -discard_it: - - /* - * Discard frame - */ - - kfree_skb(skb); - return 0; - -discard_and_relse: - sock_put(sk); - goto discard_it; - -do_time_wait: - inet_twsk_put((struct inet_timewait_sock *)sk); - goto no_dccp_socket; -} - -static struct inet_connection_sock_af_ops dccp_ipv6_af_ops = { - .queue_xmit = inet6_csk_xmit, - .send_check = dccp_v6_send_check, - .rebuild_header = inet6_sk_rebuild_header, - .conn_request = dccp_v6_conn_request, - .syn_recv_sock = dccp_v6_request_recv_sock, - .net_header_len = sizeof(struct ipv6hdr), - .setsockopt = ipv6_setsockopt, - .getsockopt = ipv6_getsockopt, - .addr2sockaddr = inet6_csk_addr2sockaddr, - .sockaddr_len = sizeof(struct sockaddr_in6) -}; - -/* - * DCCP over IPv4 via INET6 API - */ -static struct inet_connection_sock_af_ops dccp_ipv6_mapped = { - .queue_xmit = ip_queue_xmit, - .send_check = dccp_v4_send_check, - .rebuild_header = inet_sk_rebuild_header, - .conn_request = dccp_v6_conn_request, - .syn_recv_sock = dccp_v6_request_recv_sock, - .net_header_len = sizeof(struct iphdr), - .setsockopt = ipv6_setsockopt, - .getsockopt = ipv6_getsockopt, - .addr2sockaddr = inet6_csk_addr2sockaddr, - .sockaddr_len = sizeof(struct sockaddr_in6) -}; - -/* NOTE: A lot of things set to zero explicitly by call to - * sk_alloc() so need not be done here. - */ -static int dccp_v6_init_sock(struct sock *sk) -{ - int err = dccp_v4_init_sock(sk); - - if (err == 0) - inet_csk(sk)->icsk_af_ops = &dccp_ipv6_af_ops; - - return err; -} - -static int dccp_v6_destroy_sock(struct sock *sk) -{ - dccp_v4_destroy_sock(sk); - return inet6_destroy_sock(sk); -} - -static struct proto dccp_v6_prot = { - .name = "DCCPv6", - .owner = THIS_MODULE, - .close = dccp_close, - .connect = dccp_v6_connect, - .disconnect = dccp_disconnect, - .ioctl = dccp_ioctl, - .init = dccp_v6_init_sock, - .setsockopt = dccp_setsockopt, - .getsockopt = dccp_getsockopt, - .sendmsg = dccp_sendmsg, - .recvmsg = dccp_recvmsg, - .backlog_rcv = dccp_v6_do_rcv, - .hash = dccp_v6_hash, - .unhash = dccp_unhash, - .accept = inet_csk_accept, - .get_port = dccp_v6_get_port, - .shutdown = dccp_shutdown, - .destroy = dccp_v6_destroy_sock, - .orphan_count = &dccp_orphan_count, - .max_header = MAX_DCCP_HEADER, - .obj_size = sizeof(struct dccp6_sock), - .rsk_prot = &dccp6_request_sock_ops, - .twsk_prot = &dccp6_timewait_sock_ops, -}; - -static struct inet6_protocol dccp_v6_protocol = { - .handler = dccp_v6_rcv, - .err_handler = dccp_v6_err, - .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL, -}; - -static struct proto_ops inet6_dccp_ops = { - .family = PF_INET6, - .owner = THIS_MODULE, - .release = inet6_release, - .bind = inet6_bind, - .connect = inet_stream_connect, - .socketpair = sock_no_socketpair, - .accept = inet_accept, - .getname = inet6_getname, - .poll = dccp_poll, - .ioctl = inet6_ioctl, - .listen = inet_dccp_listen, - .shutdown = inet_shutdown, - .setsockopt = sock_common_setsockopt, - .getsockopt = sock_common_getsockopt, - .sendmsg = inet_sendmsg, - .recvmsg = sock_common_recvmsg, - .mmap = sock_no_mmap, - .sendpage = sock_no_sendpage, -}; - -static struct inet_protosw dccp_v6_protosw = { - .type = SOCK_DCCP, - .protocol = IPPROTO_DCCP, - .prot = &dccp_v6_prot, - .ops = &inet6_dccp_ops, - .capability = -1, - .flags = INET_PROTOSW_ICSK, -}; - -static int __init dccp_v6_init(void) -{ - int err = proto_register(&dccp_v6_prot, 1); - - if (err != 0) - goto out; - - err = inet6_add_protocol(&dccp_v6_protocol, IPPROTO_DCCP); - if (err != 0) - goto out_unregister_proto; - - inet6_register_protosw(&dccp_v6_protosw); -out: - return err; -out_unregister_proto: - proto_unregister(&dccp_v6_prot); - goto out; -} - -static void __exit dccp_v6_exit(void) -{ - inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP); - inet6_unregister_protosw(&dccp_v6_protosw); - proto_unregister(&dccp_v6_prot); -} - -module_init(dccp_v6_init); -module_exit(dccp_v6_exit); - -/* - * __stringify doesn't likes enums, so use SOCK_DCCP (6) and IPPROTO_DCCP (33) - * values directly, Also cover the case where the protocol is not specified, - * i.e. net-pf-PF_INET6-proto-0-type-SOCK_DCCP - */ -MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-33-type-6"); -MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-0-type-6"); -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Arnaldo Carvalho de Melo "); -MODULE_DESCRIPTION("DCCPv6 - Datagram Congestion Controlled Protocol"); diff --git a/trunk/net/dccp/ipv6.h b/trunk/net/dccp/ipv6.h deleted file mode 100644 index e4d4e9309270..000000000000 --- a/trunk/net/dccp/ipv6.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _DCCP_IPV6_H -#define _DCCP_IPV6_H -/* - * net/dccp/ipv6.h - * - * An implementation of the DCCP protocol - * Copyright (c) 2005 Arnaldo Carvalho de Melo - * - * 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 -#include -#include - -struct dccp6_sock { - struct dccp_sock dccp; - /* - * ipv6_pinfo has to be the last member of dccp6_sock, - * see inet6_sk_generic. - */ - struct ipv6_pinfo inet6; -}; - -struct dccp6_request_sock { - struct dccp_request_sock dccp; - struct inet6_request_sock inet6; -}; - -struct dccp6_timewait_sock { - struct inet_timewait_sock inet; - struct inet6_timewait_sock tw6; -}; - -#endif /* _DCCP_IPV6_H */ diff --git a/trunk/net/dccp/minisocks.c b/trunk/net/dccp/minisocks.c index 29261fc198e7..1393461898bb 100644 --- a/trunk/net/dccp/minisocks.c +++ b/trunk/net/dccp/minisocks.c @@ -40,8 +40,6 @@ struct inet_timewait_death_row dccp_death_row = { (unsigned long)&dccp_death_row), }; -EXPORT_SYMBOL_GPL(dccp_death_row); - void dccp_time_wait(struct sock *sk, int state, int timeo) { struct inet_timewait_sock *tw = NULL; @@ -52,18 +50,7 @@ void dccp_time_wait(struct sock *sk, int state, int timeo) if (tw != NULL) { const struct inet_connection_sock *icsk = inet_csk(sk); const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - if (tw->tw_family == PF_INET6) { - const struct ipv6_pinfo *np = inet6_sk(sk); - struct inet6_timewait_sock *tw6; - - tw->tw_ipv6_offset = inet6_tw_offset(sk->sk_prot); - tw6 = inet6_twsk((struct sock *)tw); - ipv6_addr_copy(&tw6->tw_v6_daddr, &np->daddr); - ipv6_addr_copy(&tw6->tw_v6_rcv_saddr, &np->rcv_saddr); - tw->tw_ipv6only = np->ipv6only; - } -#endif + /* Linkage updates. */ __inet_twsk_hashdance(tw, sk, &dccp_hashinfo); @@ -183,8 +170,6 @@ struct sock *dccp_create_openreq_child(struct sock *sk, return newsk; } -EXPORT_SYMBOL_GPL(dccp_create_openreq_child); - /* * Process an incoming packet for RESPOND sockets represented * as an request_sock. @@ -229,7 +214,7 @@ struct sock *dccp_check_req(struct sock *sk, struct sk_buff *skb, goto drop; } - child = inet_csk(sk)->icsk_af_ops->syn_recv_sock(sk, skb, req, NULL); + child = dccp_v4_request_recv_sock(sk, skb, req, NULL); if (child == NULL) goto listen_overflow; @@ -251,8 +236,6 @@ struct sock *dccp_check_req(struct sock *sk, struct sk_buff *skb, goto out; } -EXPORT_SYMBOL_GPL(dccp_check_req); - /* * Queue segment on the new socket if the new socket is active, * otherwise we just shortcircuit this and continue with @@ -283,5 +266,3 @@ int dccp_child_process(struct sock *parent, struct sock *child, sock_put(child); return ret; } - -EXPORT_SYMBOL_GPL(dccp_child_process); diff --git a/trunk/net/dccp/output.c b/trunk/net/dccp/output.c index efd7ffb903a1..74ff87025878 100644 --- a/trunk/net/dccp/output.c +++ b/trunk/net/dccp/output.c @@ -15,7 +15,6 @@ #include #include -#include #include #include "ackvec.h" @@ -44,7 +43,6 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) { if (likely(skb != NULL)) { const struct inet_sock *inet = inet_sk(sk); - const struct inet_connection_sock *icsk = inet_csk(sk); struct dccp_sock *dp = dccp_sk(sk); struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb); struct dccp_hdr *dh; @@ -110,7 +108,8 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) break; } - icsk->icsk_af_ops->send_check(sk, skb->len, skb); + dh->dccph_checksum = dccp_v4_checksum(skb, inet->saddr, + inet->daddr); if (set_ack) dccp_event_ack_sent(sk); @@ -118,7 +117,7 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) DCCP_INC_STATS(DCCP_MIB_OUTSEGS); memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); - err = icsk->icsk_af_ops->queue_xmit(skb, 0); + err = ip_queue_xmit(skb, 0); if (err <= 0) return err; @@ -135,13 +134,20 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu) { - struct inet_connection_sock *icsk = inet_csk(sk); struct dccp_sock *dp = dccp_sk(sk); - int mss_now = (pmtu - icsk->icsk_af_ops->net_header_len - - sizeof(struct dccp_hdr) - sizeof(struct dccp_hdr_ext)); + int mss_now; + + /* + * FIXME: we really should be using the af_specific thing to support + * IPv6. + * mss_now = pmtu - tp->af_specific->net_header_len - + * sizeof(struct dccp_hdr) - sizeof(struct dccp_hdr_ext); + */ + mss_now = pmtu - sizeof(struct iphdr) - sizeof(struct dccp_hdr) - + sizeof(struct dccp_hdr_ext); /* Now subtract optional transport overhead */ - mss_now -= icsk->icsk_ext_hdr_len; + mss_now -= dp->dccps_ext_header_len; /* * FIXME: this should come from the CCID infrastructure, where, say, @@ -154,14 +160,12 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu) mss_now -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4; /* And store cached results */ - icsk->icsk_pmtu_cookie = pmtu; + dp->dccps_pmtu_cookie = pmtu; dp->dccps_mss_cache = mss_now; return mss_now; } -EXPORT_SYMBOL_GPL(dccp_sync_mss); - void dccp_write_space(struct sock *sk) { read_lock(&sk->sk_callback_lock); @@ -262,7 +266,7 @@ int dccp_write_xmit(struct sock *sk, struct sk_buff *skb, long *timeo) int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb) { - if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk) != 0) + if (inet_sk_rebuild_header(sk) != 0) return -EHOSTUNREACH; /* Routing failure or similar. */ return dccp_transmit_skb(sk, (skb_cloned(skb) ? @@ -317,8 +321,6 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, return skb; } -EXPORT_SYMBOL_GPL(dccp_make_response); - struct sk_buff *dccp_make_reset(struct sock *sk, struct dst_entry *dst, const enum dccp_reset_codes code) @@ -375,7 +377,6 @@ struct sk_buff *dccp_make_reset(struct sock *sk, struct dst_entry *dst, */ static inline void dccp_connect_init(struct sock *sk) { - struct dccp_sock *dp = dccp_sk(sk); struct dst_entry *dst = __sk_dst_get(sk); struct inet_connection_sock *icsk = inet_csk(sk); @@ -384,16 +385,10 @@ static inline void dccp_connect_init(struct sock *sk) dccp_sync_mss(sk, dst_mtu(dst)); - dccp_update_gss(sk, dp->dccps_iss); - /* - * SWL and AWL are initially adjusted so that they are not less than - * the initial Sequence Numbers received and sent, respectively: - * SWL := max(GSR + 1 - floor(W/4), ISR), - * AWL := max(GSS - W' + 1, ISS). - * These adjustments MUST be applied only at the beginning of the - * connection. - */ - dccp_set_seqno(&dp->dccps_awl, max48(dp->dccps_awl, dp->dccps_iss)); + /* + * FIXME: set dp->{dccps_swh,dccps_swl}, with + * something like dccp_inc_seq + */ icsk->icsk_retransmits = 0; } @@ -425,8 +420,6 @@ int dccp_connect(struct sock *sk) return 0; } -EXPORT_SYMBOL_GPL(dccp_connect); - void dccp_send_ack(struct sock *sk) { /* If we have been reset, we may not send again. */ diff --git a/trunk/net/dccp/proto.c b/trunk/net/dccp/proto.c index 65b11ea90d85..e0ace7cbb996 100644 --- a/trunk/net/dccp/proto.c +++ b/trunk/net/dccp/proto.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include @@ -34,22 +34,18 @@ #include #include #include +#include #include "ccid.h" #include "dccp.h" DEFINE_SNMP_STAT(struct dccp_mib, dccp_statistics) __read_mostly; -EXPORT_SYMBOL_GPL(dccp_statistics); - atomic_t dccp_orphan_count = ATOMIC_INIT(0); -EXPORT_SYMBOL_GPL(dccp_orphan_count); - static struct net_protocol dccp_protocol = { .handler = dccp_v4_rcv, .err_handler = dccp_v4_err, - .no_policy = 1, }; const char *dccp_packet_name(const int type) @@ -152,8 +148,6 @@ int dccp_disconnect(struct sock *sk, int flags) return err; } -EXPORT_SYMBOL_GPL(dccp_disconnect); - /* * Wait for a DCCP event. * @@ -161,8 +155,8 @@ EXPORT_SYMBOL_GPL(dccp_disconnect); * take care of normal races (between the test and the event) and we don't * go look at any of the socket buffers directly. */ -unsigned int dccp_poll(struct file *file, struct socket *sock, - poll_table *wait) +static unsigned int dccp_poll(struct file *file, struct socket *sock, + poll_table *wait) { unsigned int mask; struct sock *sk = sock->sk; @@ -210,16 +204,12 @@ unsigned int dccp_poll(struct file *file, struct socket *sock, return mask; } -EXPORT_SYMBOL_GPL(dccp_poll); - int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg) { dccp_pr_debug("entry\n"); return -ENOIOCTLCMD; } -EXPORT_SYMBOL_GPL(dccp_ioctl); - static int dccp_setsockopt_service(struct sock *sk, const u32 service, char __user *optval, int optlen) { @@ -263,9 +253,7 @@ int dccp_setsockopt(struct sock *sk, int level, int optname, int val; if (level != SOL_DCCP) - return inet_csk(sk)->icsk_af_ops->setsockopt(sk, level, - optname, optval, - optlen); + return ip_setsockopt(sk, level, optname, optval, optlen); if (optlen < sizeof(int)) return -EINVAL; @@ -293,8 +281,6 @@ int dccp_setsockopt(struct sock *sk, int level, int optname, return err; } -EXPORT_SYMBOL_GPL(dccp_setsockopt); - static int dccp_getsockopt_service(struct sock *sk, int len, u32 __user *optval, int __user *optlen) @@ -333,9 +319,8 @@ int dccp_getsockopt(struct sock *sk, int level, int optname, int val, len; if (level != SOL_DCCP) - return inet_csk(sk)->icsk_af_ops->getsockopt(sk, level, - optname, optval, - optlen); + return ip_getsockopt(sk, level, optname, optval, optlen); + if (get_user(len, optlen)) return -EFAULT; @@ -368,8 +353,6 @@ int dccp_getsockopt(struct sock *sk, int level, int optname, return 0; } -EXPORT_SYMBOL_GPL(dccp_getsockopt); - int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len) { @@ -426,8 +409,6 @@ int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, goto out_release; } -EXPORT_SYMBOL_GPL(dccp_sendmsg); - int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int nonblock, int flags, int *addr_len) { @@ -525,9 +506,7 @@ int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, return len; } -EXPORT_SYMBOL_GPL(dccp_recvmsg); - -int inet_dccp_listen(struct socket *sock, int backlog) +static int inet_dccp_listen(struct socket *sock, int backlog) { struct sock *sk = sock->sk; unsigned char old_state; @@ -563,8 +542,6 @@ int inet_dccp_listen(struct socket *sock, int backlog) return err; } -EXPORT_SYMBOL_GPL(inet_dccp_listen); - static const unsigned char dccp_new_state[] = { /* current state: new state: action: */ [0] = DCCP_CLOSED, @@ -670,16 +647,12 @@ void dccp_close(struct sock *sk, long timeout) sock_put(sk); } -EXPORT_SYMBOL_GPL(dccp_close); - void dccp_shutdown(struct sock *sk, int how) { dccp_pr_debug("entry\n"); } -EXPORT_SYMBOL_GPL(dccp_shutdown); - -static const struct proto_ops inet_dccp_ops = { +static struct proto_ops inet_dccp_ops = { .family = PF_INET, .owner = THIS_MODULE, .release = inet_release, @@ -707,11 +680,11 @@ extern struct net_proto_family inet_family_ops; static struct inet_protosw dccp_v4_protosw = { .type = SOCK_DCCP, .protocol = IPPROTO_DCCP, - .prot = &dccp_prot, + .prot = &dccp_v4_prot, .ops = &inet_dccp_ops, .capability = -1, .no_check = 0, - .flags = INET_PROTOSW_ICSK, + .flags = 0, }; /* @@ -786,15 +759,13 @@ MODULE_PARM_DESC(thash_entries, "Number of ehash buckets"); int dccp_debug; module_param(dccp_debug, int, 0444); MODULE_PARM_DESC(dccp_debug, "Enable debug messages"); - -EXPORT_SYMBOL_GPL(dccp_debug); #endif static int __init dccp_init(void) { unsigned long goal; int ehash_order, bhash_order, i; - int rc = proto_register(&dccp_prot, 1); + int rc = proto_register(&dccp_v4_prot, 1); if (rc) goto out; @@ -897,7 +868,7 @@ static int __init dccp_init(void) kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep); dccp_hashinfo.bind_bucket_cachep = NULL; out_proto_unregister: - proto_unregister(&dccp_prot); + proto_unregister(&dccp_v4_prot); goto out; } @@ -920,7 +891,7 @@ static void __exit dccp_fini(void) get_order(dccp_hashinfo.ehash_size * sizeof(struct inet_ehash_bucket))); kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep); - proto_unregister(&dccp_prot); + proto_unregister(&dccp_v4_prot); } module_init(dccp_init); diff --git a/trunk/net/decnet/af_decnet.c b/trunk/net/decnet/af_decnet.c index 78ec5344be86..f89e55f814d9 100644 --- a/trunk/net/decnet/af_decnet.c +++ b/trunk/net/decnet/af_decnet.c @@ -149,11 +149,10 @@ static void dn_keepalive(struct sock *sk); #define DN_SK_HASH_MASK (DN_SK_HASH_SIZE - 1) -static const struct proto_ops dn_proto_ops; +static struct proto_ops dn_proto_ops; static DEFINE_RWLOCK(dn_hash_lock); static struct hlist_head dn_sk_hash[DN_SK_HASH_SIZE]; static struct hlist_head dn_wild_sk; -static atomic_t decnet_memory_allocated; static int __dn_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen, int flags); static int __dn_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen, int flags); @@ -447,26 +446,10 @@ static void dn_destruct(struct sock *sk) dst_release(xchg(&sk->sk_dst_cache, NULL)); } -static int dn_memory_pressure; - -static void dn_enter_memory_pressure(void) -{ - if (!dn_memory_pressure) { - dn_memory_pressure = 1; - } -} - static struct proto dn_proto = { - .name = "NSP", - .owner = THIS_MODULE, - .enter_memory_pressure = dn_enter_memory_pressure, - .memory_pressure = &dn_memory_pressure, - .memory_allocated = &decnet_memory_allocated, - .sysctl_mem = sysctl_decnet_mem, - .sysctl_wmem = sysctl_decnet_wmem, - .sysctl_rmem = sysctl_decnet_rmem, - .max_header = DN_MAX_NSP_DATA_HEADER + 64, - .obj_size = sizeof(struct dn_sock), + .name = "DECNET", + .owner = THIS_MODULE, + .obj_size = sizeof(struct dn_sock), }; static struct sock *dn_alloc_sock(struct socket *sock, gfp_t gfp) @@ -487,8 +470,6 @@ static struct sock *dn_alloc_sock(struct socket *sock, gfp_t gfp) sk->sk_family = PF_DECnet; sk->sk_protocol = 0; sk->sk_allocation = gfp; - sk->sk_sndbuf = sysctl_decnet_wmem[1]; - sk->sk_rcvbuf = sysctl_decnet_rmem[1]; /* Initialization of DECnet Session Control Port */ scp = DN_SK(sk); @@ -1252,7 +1233,7 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) break; default: - err = -ENOIOCTLCMD; + err = dev_ioctl(cmd, (void __user *)arg); break; } @@ -2342,7 +2323,7 @@ static struct net_proto_family dn_family_ops = { .owner = THIS_MODULE, }; -static const struct proto_ops dn_proto_ops = { +static struct proto_ops dn_proto_ops = { .family = AF_DECnet, .owner = THIS_MODULE, .release = dn_release, diff --git a/trunk/net/decnet/dn_neigh.c b/trunk/net/decnet/dn_neigh.c index 33ab256cfd4a..8d0cc3cf3e49 100644 --- a/trunk/net/decnet/dn_neigh.c +++ b/trunk/net/decnet/dn_neigh.c @@ -408,14 +408,11 @@ int dn_neigh_router_hello(struct sk_buff *skb) } } - /* Only use routers in our area */ - if ((dn_ntohs(src)>>10) == dn_ntohs((decnet_address)>>10)) { - if (!dn_db->router) { - dn_db->router = neigh_clone(neigh); - } else { - if (msg->priority > ((struct dn_neigh *)dn_db->router)->priority) - neigh_release(xchg(&dn_db->router, neigh_clone(neigh))); - } + if (!dn_db->router) { + dn_db->router = neigh_clone(neigh); + } else { + if (msg->priority > ((struct dn_neigh *)dn_db->router)->priority) + neigh_release(xchg(&dn_db->router, neigh_clone(neigh))); } write_unlock(&neigh->lock); neigh_release(neigh); diff --git a/trunk/net/decnet/dn_nsp_in.c b/trunk/net/decnet/dn_nsp_in.c index 44bda85e678f..369f25b60f3f 100644 --- a/trunk/net/decnet/dn_nsp_in.c +++ b/trunk/net/decnet/dn_nsp_in.c @@ -793,6 +793,7 @@ static int dn_nsp_rx_packet(struct sk_buff *skb) got_it: if (sk != NULL) { struct dn_scp *scp = DN_SK(sk); + int ret; /* Reset backoff */ scp->nsp_rxtshift = 0; @@ -806,7 +807,21 @@ static int dn_nsp_rx_packet(struct sk_buff *skb) goto free_out; } - return sk_receive_skb(sk, skb); + bh_lock_sock(sk); + ret = NET_RX_SUCCESS; + if (decnet_debug_level & 8) + printk(KERN_DEBUG "NSP: 0x%02x 0x%02x 0x%04x 0x%04x %d\n", + (int)cb->rt_flags, (int)cb->nsp_flags, + (int)cb->src_port, (int)cb->dst_port, + !!sock_owned_by_user(sk)); + if (!sock_owned_by_user(sk)) + ret = dn_nsp_backlog_rcv(sk, skb); + else + sk_add_backlog(sk, skb); + bh_unlock_sock(sk); + sock_put(sk); + + return ret; } return dn_nsp_no_socket(skb, reason); diff --git a/trunk/net/decnet/sysctl_net_decnet.c b/trunk/net/decnet/sysctl_net_decnet.c index 0e9d2c571165..02bca49cb508 100644 --- a/trunk/net/decnet/sysctl_net_decnet.c +++ b/trunk/net/decnet/sysctl_net_decnet.c @@ -10,7 +10,6 @@ * * Changes: * Steve Whitehouse - C99 changes and default device handling - * Steve Whitehouse - Memory buffer settings, like the tcp ones * */ #include @@ -38,11 +37,6 @@ int decnet_dr_count = 3; int decnet_log_martians = 1; int decnet_no_fc_max_cwnd = NSP_MIN_WINDOW; -/* Reasonable defaults, I hope, based on tcp's defaults */ -int sysctl_decnet_mem[3] = { 768 << 3, 1024 << 3, 1536 << 3 }; -int sysctl_decnet_wmem[3] = { 4 * 1024, 16 * 1024, 128 * 1024 }; -int sysctl_decnet_rmem[3] = { 4 * 1024, 87380, 87380 * 2 }; - #ifdef CONFIG_SYSCTL extern int decnet_dst_gc_interval; static int min_decnet_time_wait[] = { 5 }; @@ -434,33 +428,6 @@ static ctl_table dn_table[] = { .extra1 = &min_decnet_no_fc_max_cwnd, .extra2 = &max_decnet_no_fc_max_cwnd }, - { - .ctl_name = NET_DECNET_MEM, - .procname = "decnet_mem", - .data = &sysctl_decnet_mem, - .maxlen = sizeof(sysctl_decnet_mem), - .mode = 0644, - .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec, - }, - { - .ctl_name = NET_DECNET_RMEM, - .procname = "decnet_rmem", - .data = &sysctl_decnet_rmem, - .maxlen = sizeof(sysctl_decnet_rmem), - .mode = 0644, - .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec, - }, - { - .ctl_name = NET_DECNET_WMEM, - .procname = "decnet_wmem", - .data = &sysctl_decnet_wmem, - .maxlen = sizeof(sysctl_decnet_wmem), - .mode = 0644, - .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec, - }, { .ctl_name = NET_DECNET_DEBUG_LEVEL, .procname = "debug", diff --git a/trunk/net/econet/af_econet.c b/trunk/net/econet/af_econet.c index c792994d7952..34fdac51df96 100644 --- a/trunk/net/econet/af_econet.c +++ b/trunk/net/econet/af_econet.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -46,7 +45,7 @@ #include #include -static const struct proto_ops econet_ops; +static struct proto_ops econet_ops; static struct hlist_head econet_sklist; static DEFINE_RWLOCK(econet_lock); @@ -57,7 +56,7 @@ static struct net_device *net2dev_map[256]; #define EC_PORT_IP 0xd2 #ifdef CONFIG_ECONET_AUNUDP -static DEFINE_SPINLOCK(aun_queue_lock); +static spinlock_t aun_queue_lock; static struct socket *udpsock; #define AUN_PORT 0x8000 @@ -687,7 +686,7 @@ static int econet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg break; default: - return -ENOIOCTLCMD; + return dev_ioctl(cmd, argp); } /*NOTREACHED*/ return 0; @@ -699,7 +698,7 @@ static struct net_proto_family econet_family_ops = { .owner = THIS_MODULE, }; -static const struct proto_ops SOCKOPS_WRAPPED(econet_ops) = { +static struct proto_ops SOCKOPS_WRAPPED(econet_ops) = { .family = PF_ECONET, .owner = THIS_MODULE, .release = econet_release, diff --git a/trunk/net/ieee80211/Kconfig b/trunk/net/ieee80211/Kconfig index d18ccba3ea9e..91b16fbf91f0 100644 --- a/trunk/net/ieee80211/Kconfig +++ b/trunk/net/ieee80211/Kconfig @@ -55,7 +55,7 @@ config IEEE80211_CRYPT_CCMP config IEEE80211_CRYPT_TKIP tristate "IEEE 802.11i TKIP encryption" - depends on IEEE80211 && NET_RADIO + depends on IEEE80211 select CRYPTO select CRYPTO_MICHAEL_MIC ---help--- diff --git a/trunk/net/ieee80211/ieee80211_rx.c b/trunk/net/ieee80211/ieee80211_rx.c index 4cc6f41c6930..03efaacbdb73 100644 --- a/trunk/net/ieee80211/ieee80211_rx.c +++ b/trunk/net/ieee80211/ieee80211_rx.c @@ -410,8 +410,9 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, return 1; } - if (is_multicast_ether_addr(hdr->addr1) - ? ieee->host_mc_decrypt : ieee->host_decrypt) { + if ((is_multicast_ether_addr(hdr->addr1) || + is_broadcast_ether_addr(hdr->addr2)) ? ieee->host_mc_decrypt : + ieee->host_decrypt) { int idx = 0; if (skb->len >= hdrlen + 3) idx = skb->data[hdrlen + 3] >> 6; diff --git a/trunk/net/ipv4/Kconfig b/trunk/net/ipv4/Kconfig index 011cca7ae02b..e55136ae09f4 100644 --- a/trunk/net/ipv4/Kconfig +++ b/trunk/net/ipv4/Kconfig @@ -456,14 +456,6 @@ config TCP_CONG_BIC increase provides TCP friendliness. See http://www.csc.ncsu.edu/faculty/rhee/export/bitcp/ -config TCP_CONG_CUBIC - tristate "CUBIC TCP" - default m - ---help--- - This is version 2.0 of BIC-TCP which uses a cubic growth function - among other techniques. - See http://www.csc.ncsu.edu/faculty/rhee/export/bitcp/cubic-paper.pdf - config TCP_CONG_WESTWOOD tristate "TCP Westwood+" default m diff --git a/trunk/net/ipv4/Makefile b/trunk/net/ipv4/Makefile index c54edd76de09..f0435d00db6b 100644 --- a/trunk/net/ipv4/Makefile +++ b/trunk/net/ipv4/Makefile @@ -34,7 +34,6 @@ obj-$(CONFIG_INET_DIAG) += inet_diag.o obj-$(CONFIG_IP_ROUTE_MULTIPATH_CACHED) += multipath.o obj-$(CONFIG_INET_TCP_DIAG) += tcp_diag.o obj-$(CONFIG_TCP_CONG_BIC) += tcp_bic.o -obj-$(CONFIG_TCP_CONG_CUBIC) += tcp_cubic.o obj-$(CONFIG_TCP_CONG_WESTWOOD) += tcp_westwood.o obj-$(CONFIG_TCP_CONG_HSTCP) += tcp_highspeed.o obj-$(CONFIG_TCP_CONG_HYBLA) += tcp_hybla.o diff --git a/trunk/net/ipv4/af_inet.c b/trunk/net/ipv4/af_inet.c index 966a071a408c..eaa150c33b04 100644 --- a/trunk/net/ipv4/af_inet.c +++ b/trunk/net/ipv4/af_inet.c @@ -93,7 +93,6 @@ #include #include #include -#include #include #include #include @@ -229,14 +228,13 @@ static int inet_create(struct socket *sock, int protocol) unsigned char answer_flags; char answer_no_check; int try_loading_module = 0; - int err; + int err = -ESOCKTNOSUPPORT; sock->state = SS_UNCONNECTED; /* Look for the requested type/protocol pair. */ answer = NULL; lookup_protocol: - err = -ESOCKTNOSUPPORT; rcu_read_lock(); list_for_each_rcu(p, &inetsw[sock->type]) { answer = list_entry(p, struct inet_protosw, list); @@ -254,7 +252,6 @@ static int inet_create(struct socket *sock, int protocol) if (IPPROTO_IP == answer->protocol) break; } - err = -EPROTONOSUPPORT; answer = NULL; } @@ -283,6 +280,9 @@ static int inet_create(struct socket *sock, int protocol) err = -EPERM; if (answer->capability > 0 && !capable(answer->capability)) goto out_rcu_unlock; + err = -EPROTONOSUPPORT; + if (!protocol) + goto out_rcu_unlock; sock->ops = answer->ops; answer_prot = answer->prot; @@ -303,7 +303,6 @@ static int inet_create(struct socket *sock, int protocol) sk->sk_reuse = 1; inet = inet_sk(sk); - inet->is_icsk = INET_PROTOSW_ICSK & answer_flags; if (SOCK_RAW == sock->type) { inet->num = protocol; @@ -777,16 +776,16 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) err = devinet_ioctl(cmd, (void __user *)arg); break; default: - if (sk->sk_prot->ioctl) - err = sk->sk_prot->ioctl(sk, cmd, arg); - else - err = -ENOIOCTLCMD; + if (!sk->sk_prot->ioctl || + (err = sk->sk_prot->ioctl(sk, cmd, arg)) == + -ENOIOCTLCMD) + err = dev_ioctl(cmd, (void __user *)arg); break; } return err; } -const struct proto_ops inet_stream_ops = { +struct proto_ops inet_stream_ops = { .family = PF_INET, .owner = THIS_MODULE, .release = inet_release, @@ -807,7 +806,7 @@ const struct proto_ops inet_stream_ops = { .sendpage = tcp_sendpage }; -const struct proto_ops inet_dgram_ops = { +struct proto_ops inet_dgram_ops = { .family = PF_INET, .owner = THIS_MODULE, .release = inet_release, @@ -832,7 +831,7 @@ const struct proto_ops inet_dgram_ops = { * For SOCK_RAW sockets; should be the same as inet_dgram_ops but without * udp_poll */ -static const struct proto_ops inet_sockraw_ops = { +static struct proto_ops inet_sockraw_ops = { .family = PF_INET, .owner = THIS_MODULE, .release = inet_release, @@ -871,8 +870,7 @@ static struct inet_protosw inetsw_array[] = .ops = &inet_stream_ops, .capability = -1, .no_check = 0, - .flags = INET_PROTOSW_PERMANENT | - INET_PROTOSW_ICSK, + .flags = INET_PROTOSW_PERMANENT, }, { diff --git a/trunk/net/ipv4/ah4.c b/trunk/net/ipv4/ah4.c index aed537fa2c88..035ad2c9e1ba 100644 --- a/trunk/net/ipv4/ah4.c +++ b/trunk/net/ipv4/ah4.c @@ -6,7 +6,6 @@ #include #include #include -#include #include diff --git a/trunk/net/ipv4/arp.c b/trunk/net/ipv4/arp.c index 37432088fe6d..b425748f02d7 100644 --- a/trunk/net/ipv4/arp.c +++ b/trunk/net/ipv4/arp.c @@ -86,7 +86,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/net/ipv4/devinet.c b/trunk/net/ipv4/devinet.c index 7b9bb28e2ee9..4ec4b2ca6ab1 100644 --- a/trunk/net/ipv4/devinet.c +++ b/trunk/net/ipv4/devinet.c @@ -58,7 +58,6 @@ #endif #include -#include #include #include #include @@ -235,10 +234,7 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, int destroy) { struct in_ifaddr *promote = NULL; - struct in_ifaddr *ifa, *ifa1 = *ifap; - struct in_ifaddr *last_prim = in_dev->ifa_list; - struct in_ifaddr *prev_prom = NULL; - int do_promote = IN_DEV_PROMOTE_SECONDARIES(in_dev); + struct in_ifaddr *ifa1 = *ifap; ASSERT_RTNL(); @@ -247,22 +243,18 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, **/ if (!(ifa1->ifa_flags & IFA_F_SECONDARY)) { + struct in_ifaddr *ifa; struct in_ifaddr **ifap1 = &ifa1->ifa_next; while ((ifa = *ifap1) != NULL) { - if (!(ifa->ifa_flags & IFA_F_SECONDARY) && - ifa1->ifa_scope <= ifa->ifa_scope) - last_prim = ifa; - if (!(ifa->ifa_flags & IFA_F_SECONDARY) || ifa1->ifa_mask != ifa->ifa_mask || !inet_ifa_match(ifa1->ifa_address, ifa)) { ifap1 = &ifa->ifa_next; - prev_prom = ifa; continue; } - if (!do_promote) { + if (!IN_DEV_PROMOTE_SECONDARIES(in_dev)) { *ifap1 = ifa->ifa_next; rtmsg_ifa(RTM_DELADDR, ifa); @@ -291,32 +283,19 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, */ rtmsg_ifa(RTM_DELADDR, ifa1); notifier_call_chain(&inetaddr_chain, NETDEV_DOWN, ifa1); - - if (promote) { - - if (prev_prom) { - prev_prom->ifa_next = promote->ifa_next; - promote->ifa_next = last_prim->ifa_next; - last_prim->ifa_next = promote; - } - - promote->ifa_flags &= ~IFA_F_SECONDARY; - rtmsg_ifa(RTM_NEWADDR, promote); - notifier_call_chain(&inetaddr_chain, NETDEV_UP, promote); - for (ifa = promote->ifa_next; ifa; ifa = ifa->ifa_next) { - if (ifa1->ifa_mask != ifa->ifa_mask || - !inet_ifa_match(ifa1->ifa_address, ifa)) - continue; - fib_add_ifaddr(ifa); - } - - } if (destroy) { inet_free_ifa(ifa1); if (!in_dev->ifa_list) inetdev_destroy(in_dev); } + + if (promote && IN_DEV_PROMOTE_SECONDARIES(in_dev)) { + /* not sure if we should send a delete notify first? */ + promote->ifa_flags &= ~IFA_F_SECONDARY; + rtmsg_ifa(RTM_NEWADDR, promote); + notifier_call_chain(&inetaddr_chain, NETDEV_UP, promote); + } } static int inet_insert_ifa(struct in_ifaddr *ifa) diff --git a/trunk/net/ipv4/esp4.c b/trunk/net/ipv4/esp4.c index 73bfcae8af9c..1b18ce66e7b7 100644 --- a/trunk/net/ipv4/esp4.c +++ b/trunk/net/ipv4/esp4.c @@ -9,7 +9,6 @@ #include #include #include -#include #include /* decapsulation data for use when post-processing */ diff --git a/trunk/net/ipv4/fib_frontend.c b/trunk/net/ipv4/fib_frontend.c index 18f5e509281a..2267c1fad879 100644 --- a/trunk/net/ipv4/fib_frontend.c +++ b/trunk/net/ipv4/fib_frontend.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -408,7 +407,7 @@ static void fib_magic(int cmd, int type, u32 dst, int dst_len, struct in_ifaddr tb->tb_delete(tb, &req.rtm, &rta, &req.nlh, NULL); } -void fib_add_ifaddr(struct in_ifaddr *ifa) +static void fib_add_ifaddr(struct in_ifaddr *ifa) { struct in_device *in_dev = ifa->ifa_dev; struct net_device *dev = in_dev->dev; @@ -545,16 +544,12 @@ static void nl_fib_input(struct sock *sk, int len) struct sk_buff *skb = NULL; struct nlmsghdr *nlh = NULL; struct fib_result_nl *frn; + int err; u32 pid; struct fib_table *tb; - skb = skb_dequeue(&sk->sk_receive_queue); + skb = skb_recv_datagram(sk, 0, 0, &err); nlh = (struct nlmsghdr *)skb->data; - if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len || - nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) { - kfree_skb(skb); - return; - } frn = (struct fib_result_nl *) NLMSG_DATA(nlh); tb = fib_get_table(frn->tb_id_in); diff --git a/trunk/net/ipv4/fib_hash.c b/trunk/net/ipv4/fib_hash.c index e2890ec8159e..2a8c9afc3695 100644 --- a/trunk/net/ipv4/fib_hash.c +++ b/trunk/net/ipv4/fib_hash.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -976,7 +975,7 @@ static void fib_seq_stop(struct seq_file *seq, void *v) static unsigned fib_flag_trans(int type, u32 mask, struct fib_info *fi) { - static const unsigned type2flags[RTN_MAX + 1] = { + static unsigned type2flags[RTN_MAX + 1] = { [7] = RTF_REJECT, [8] = RTF_REJECT, }; unsigned flags = type2flags[type]; diff --git a/trunk/net/ipv4/fib_rules.c b/trunk/net/ipv4/fib_rules.c index 0dd4d06e456d..0b298bbc1518 100644 --- a/trunk/net/ipv4/fib_rules.c +++ b/trunk/net/ipv4/fib_rules.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/net/ipv4/fib_semantics.c b/trunk/net/ipv4/fib_semantics.c index ef4724de7350..186f20c4a45e 100644 --- a/trunk/net/ipv4/fib_semantics.c +++ b/trunk/net/ipv4/fib_semantics.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -37,7 +36,6 @@ #include #include -#include #include #include #include @@ -85,7 +83,7 @@ for (nhsel=0; nhsel < 1; nhsel++) #define endfor_nexthops(fi) } -static const struct +static struct { int error; u8 scope; diff --git a/trunk/net/ipv4/fib_trie.c b/trunk/net/ipv4/fib_trie.c index e320b32373e5..66247f38b371 100644 --- a/trunk/net/ipv4/fib_trie.c +++ b/trunk/net/ipv4/fib_trie.c @@ -41,13 +41,6 @@ * 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. - * - * Substantial contributions to this work comes from: - * - * David S. Miller, - * Stephen Hemminger - * Paul E. McKenney - * Patrick McHardy */ #define VERSION "0.404" @@ -66,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -2386,7 +2378,6 @@ static unsigned fib_flag_trans(int type, u32 mask, const struct fib_info *fi) */ static int fib_route_seq_show(struct seq_file *seq, void *v) { - const struct fib_trie_iter *iter = seq->private; struct leaf *l = v; int i; char bf[128]; @@ -2398,8 +2389,6 @@ static int fib_route_seq_show(struct seq_file *seq, void *v) return 0; } - if (iter->trie == trie_local) - return 0; if (IS_TNODE(l)) return 0; diff --git a/trunk/net/ipv4/icmp.c b/trunk/net/ipv4/icmp.c index be5a519cd2f8..e3eceecd0496 100644 --- a/trunk/net/ipv4/icmp.c +++ b/trunk/net/ipv4/icmp.c @@ -73,7 +73,6 @@ #include #include #include -#include #include #include #include @@ -221,7 +220,7 @@ struct icmp_control { short error; /* This ICMP is classed as an error message */ }; -static const struct icmp_control icmp_pointers[NR_ICMP_TYPES+1]; +static struct icmp_control icmp_pointers[NR_ICMP_TYPES+1]; /* * The ICMP socket(s). This is the most convenient way to flow control @@ -995,7 +994,7 @@ int icmp_rcv(struct sk_buff *skb) /* * This table is the definition of how we handle ICMP. */ -static const struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = { +static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = { [ICMP_ECHOREPLY] = { .output_entry = ICMP_MIB_OUTECHOREPS, .input_entry = ICMP_MIB_INECHOREPS, diff --git a/trunk/net/ipv4/igmp.c b/trunk/net/ipv4/igmp.c index 34758118c10c..c04607b49212 100644 --- a/trunk/net/ipv4/igmp.c +++ b/trunk/net/ipv4/igmp.c @@ -91,8 +91,6 @@ #include #include #include - -#include #include #include #include @@ -899,10 +897,7 @@ int igmp_rcv(struct sk_buff *skb) /* Is it our report looped back? */ if (((struct rtable*)skb->dst)->fl.iif == 0) break; - /* don't rely on MC router hearing unicast reports */ - if (skb->pkt_type == PACKET_MULTICAST || - skb->pkt_type == PACKET_BROADCAST) - igmp_heard_report(in_dev, ih->group); + igmp_heard_report(in_dev, ih->group); break; case IGMP_PIM: #ifdef CONFIG_IP_PIMSM_V1 diff --git a/trunk/net/ipv4/inet_connection_sock.c b/trunk/net/ipv4/inet_connection_sock.c index ae20281d8deb..3fe021f1a566 100644 --- a/trunk/net/ipv4/inet_connection_sock.c +++ b/trunk/net/ipv4/inet_connection_sock.c @@ -37,8 +37,7 @@ EXPORT_SYMBOL(inet_csk_timer_bug_msg); */ int sysctl_local_port_range[2] = { 1024, 4999 }; -int inet_csk_bind_conflict(const struct sock *sk, - const struct inet_bind_bucket *tb) +static inline int inet_csk_bind_conflict(struct sock *sk, struct inet_bind_bucket *tb) { const u32 sk_rcv_saddr = inet_rcv_saddr(sk); struct sock *sk2; @@ -63,15 +62,11 @@ int inet_csk_bind_conflict(const struct sock *sk, return node != NULL; } -EXPORT_SYMBOL_GPL(inet_csk_bind_conflict); - /* Obtain a reference to a local port for the given sock, * if snum is zero it means select any available local port. */ int inet_csk_get_port(struct inet_hashinfo *hashinfo, - struct sock *sk, unsigned short snum, - int (*bind_conflict)(const struct sock *sk, - const struct inet_bind_bucket *tb)) + struct sock *sk, unsigned short snum) { struct inet_bind_hashbucket *head; struct hlist_node *node; @@ -130,7 +125,7 @@ int inet_csk_get_port(struct inet_hashinfo *hashinfo, goto success; } else { ret = 1; - if (bind_conflict(sk, tb)) + if (inet_csk_bind_conflict(sk, tb)) goto fail_unlock; } } @@ -385,7 +380,7 @@ struct request_sock *inet_csk_search_req(const struct sock *sk, EXPORT_SYMBOL_GPL(inet_csk_search_req); void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req, - unsigned long timeout) + const unsigned timeout) { struct inet_connection_sock *icsk = inet_csk(sk); struct listen_sock *lopt = icsk->icsk_accept_queue.listen_opt; @@ -636,15 +631,3 @@ void inet_csk_listen_stop(struct sock *sk) } EXPORT_SYMBOL_GPL(inet_csk_listen_stop); - -void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr) -{ - struct sockaddr_in *sin = (struct sockaddr_in *)uaddr; - const struct inet_sock *inet = inet_sk(sk); - - sin->sin_family = AF_INET; - sin->sin_addr.s_addr = inet->daddr; - sin->sin_port = inet->dport; -} - -EXPORT_SYMBOL_GPL(inet_csk_addr2sockaddr); diff --git a/trunk/net/ipv4/inet_diag.c b/trunk/net/ipv4/inet_diag.c index c49908192047..39061ed53cfd 100644 --- a/trunk/net/ipv4/inet_diag.c +++ b/trunk/net/ipv4/inet_diag.c @@ -112,12 +112,12 @@ static int inet_diag_fill(struct sk_buff *skb, struct sock *sk, r->idiag_inode = 0; #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) if (r->idiag_family == AF_INET6) { - const struct inet6_timewait_sock *tw6 = inet6_twsk(sk); + const struct tcp6_timewait_sock *tcp6tw = tcp6_twsk(sk); ipv6_addr_copy((struct in6_addr *)r->id.idiag_src, - &tw6->tw_v6_rcv_saddr); + &tcp6tw->tw_v6_rcv_saddr); ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst, - &tw6->tw_v6_daddr); + &tcp6tw->tw_v6_daddr); } #endif nlh->nlmsg_len = skb->tail - b; @@ -489,9 +489,9 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk, #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) if (r->idiag_family == AF_INET6) { ipv6_addr_copy((struct in6_addr *)r->id.idiag_src, - &inet6_rsk(req)->loc_addr); + &tcp6_rsk(req)->loc_addr); ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst, - &inet6_rsk(req)->rmt_addr); + &tcp6_rsk(req)->rmt_addr); } #endif nlh->nlmsg_len = skb->tail - b; @@ -553,13 +553,13 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk, entry.saddr = #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) (entry.family == AF_INET6) ? - inet6_rsk(req)->loc_addr.s6_addr32 : + tcp6_rsk(req)->loc_addr.s6_addr32 : #endif &ireq->loc_addr; entry.daddr = #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) (entry.family == AF_INET6) ? - inet6_rsk(req)->rmt_addr.s6_addr32 : + tcp6_rsk(req)->rmt_addr.s6_addr32 : #endif &ireq->rmt_addr; entry.dport = ntohs(ireq->rmt_port); diff --git a/trunk/net/ipv4/inet_hashtables.c b/trunk/net/ipv4/inet_hashtables.c index 33228115cda4..e8d29fe736d2 100644 --- a/trunk/net/ipv4/inet_hashtables.c +++ b/trunk/net/ipv4/inet_hashtables.c @@ -15,14 +15,12 @@ #include #include -#include #include #include #include #include #include -#include /* * Allocate and initialize a new local port bind bucket. @@ -165,179 +163,3 @@ struct sock *__inet_lookup_listener(const struct hlist_head *head, const u32 dad } EXPORT_SYMBOL_GPL(__inet_lookup_listener); - -/* called with local bh disabled */ -static int __inet_check_established(struct inet_timewait_death_row *death_row, - struct sock *sk, __u16 lport, - struct inet_timewait_sock **twp) -{ - struct inet_hashinfo *hinfo = death_row->hashinfo; - struct inet_sock *inet = inet_sk(sk); - u32 daddr = inet->rcv_saddr; - u32 saddr = inet->daddr; - int dif = sk->sk_bound_dev_if; - INET_ADDR_COOKIE(acookie, saddr, daddr) - const __u32 ports = INET_COMBINED_PORTS(inet->dport, lport); - unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet->dport); - struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); - struct sock *sk2; - const struct hlist_node *node; - struct inet_timewait_sock *tw; - - prefetch(head->chain.first); - write_lock(&head->lock); - - /* Check TIME-WAIT sockets first. */ - sk_for_each(sk2, node, &(head + hinfo->ehash_size)->chain) { - tw = inet_twsk(sk2); - - if (INET_TW_MATCH(sk2, hash, acookie, saddr, daddr, ports, dif)) { - if (twsk_unique(sk, sk2, twp)) - goto unique; - else - goto not_unique; - } - } - tw = NULL; - - /* And established part... */ - sk_for_each(sk2, node, &head->chain) { - if (INET_MATCH(sk2, hash, acookie, saddr, daddr, ports, dif)) - goto not_unique; - } - -unique: - /* Must record num and sport now. Otherwise we will see - * in hash table socket with a funny identity. */ - inet->num = lport; - inet->sport = htons(lport); - sk->sk_hash = hash; - BUG_TRAP(sk_unhashed(sk)); - __sk_add_node(sk, &head->chain); - sock_prot_inc_use(sk->sk_prot); - write_unlock(&head->lock); - - if (twp) { - *twp = tw; - NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); - } else if (tw) { - /* Silly. Should hash-dance instead... */ - inet_twsk_deschedule(tw, death_row); - NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); - - inet_twsk_put(tw); - } - - return 0; - -not_unique: - write_unlock(&head->lock); - return -EADDRNOTAVAIL; -} - -static inline u32 inet_sk_port_offset(const struct sock *sk) -{ - const struct inet_sock *inet = inet_sk(sk); - return secure_ipv4_port_ephemeral(inet->rcv_saddr, inet->daddr, - inet->dport); -} - -/* - * Bind a port for a connect operation and hash it. - */ -int inet_hash_connect(struct inet_timewait_death_row *death_row, - struct sock *sk) -{ - struct inet_hashinfo *hinfo = death_row->hashinfo; - const unsigned short snum = inet_sk(sk)->num; - struct inet_bind_hashbucket *head; - struct inet_bind_bucket *tb; - int ret; - - if (!snum) { - int low = sysctl_local_port_range[0]; - int high = sysctl_local_port_range[1]; - int range = high - low; - int i; - int port; - static u32 hint; - u32 offset = hint + inet_sk_port_offset(sk); - struct hlist_node *node; - struct inet_timewait_sock *tw = NULL; - - local_bh_disable(); - for (i = 1; i <= range; i++) { - port = low + (i + offset) % range; - head = &hinfo->bhash[inet_bhashfn(port, hinfo->bhash_size)]; - spin_lock(&head->lock); - - /* Does not bother with rcv_saddr checks, - * because the established check is already - * unique enough. - */ - inet_bind_bucket_for_each(tb, node, &head->chain) { - if (tb->port == port) { - BUG_TRAP(!hlist_empty(&tb->owners)); - if (tb->fastreuse >= 0) - goto next_port; - if (!__inet_check_established(death_row, - sk, port, - &tw)) - goto ok; - goto next_port; - } - } - - tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep, head, port); - if (!tb) { - spin_unlock(&head->lock); - break; - } - tb->fastreuse = -1; - goto ok; - - next_port: - spin_unlock(&head->lock); - } - local_bh_enable(); - - return -EADDRNOTAVAIL; - -ok: - hint += i; - - /* Head lock still held and bh's disabled */ - inet_bind_hash(sk, tb, port); - if (sk_unhashed(sk)) { - inet_sk(sk)->sport = htons(port); - __inet_hash(hinfo, sk, 0); - } - spin_unlock(&head->lock); - - if (tw) { - inet_twsk_deschedule(tw, death_row);; - inet_twsk_put(tw); - } - - ret = 0; - goto out; - } - - head = &hinfo->bhash[inet_bhashfn(snum, hinfo->bhash_size)]; - tb = inet_csk(sk)->icsk_bind_hash; - spin_lock_bh(&head->lock); - if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) { - __inet_hash(hinfo, sk, 0); - spin_unlock_bh(&head->lock); - return 0; - } else { - spin_unlock(&head->lock); - /* No definite answer... Walk to established hash table */ - ret = __inet_check_established(death_row, sk, snum, NULL); -out: - local_bh_enable(); - return ret; - } -} - -EXPORT_SYMBOL_GPL(inet_hash_connect); diff --git a/trunk/net/ipv4/inet_timewait_sock.c b/trunk/net/ipv4/inet_timewait_sock.c index 417f126c749e..a010e9a68811 100644 --- a/trunk/net/ipv4/inet_timewait_sock.c +++ b/trunk/net/ipv4/inet_timewait_sock.c @@ -90,9 +90,8 @@ EXPORT_SYMBOL_GPL(__inet_twsk_hashdance); struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int state) { - struct inet_timewait_sock *tw = - kmem_cache_alloc(sk->sk_prot_creator->twsk_prot->twsk_slab, - SLAB_ATOMIC); + struct inet_timewait_sock *tw = kmem_cache_alloc(sk->sk_prot_creator->twsk_slab, + SLAB_ATOMIC); if (tw != NULL) { const struct inet_sock *inet = inet_sk(sk); diff --git a/trunk/net/ipv4/inetpeer.c b/trunk/net/ipv4/inetpeer.c index ce5fe3f74a3d..2fc3fd38924f 100644 --- a/trunk/net/ipv4/inetpeer.c +++ b/trunk/net/ipv4/inetpeer.c @@ -401,7 +401,6 @@ struct inet_peer *inet_getpeer(__u32 daddr, int create) return NULL; n->v4daddr = daddr; atomic_set(&n->refcnt, 1); - atomic_set(&n->rid, 0); n->ip_id_count = secure_ip_id(daddr); n->tcp_ts_stamp = 0; diff --git a/trunk/net/ipv4/ip_fragment.c b/trunk/net/ipv4/ip_fragment.c index ce2b70ce4018..e7d26d9943c2 100644 --- a/trunk/net/ipv4/ip_fragment.c +++ b/trunk/net/ipv4/ip_fragment.c @@ -22,7 +22,6 @@ * Patrick McHardy : LRU queue of frag heads for evictor. */ -#include #include #include #include @@ -39,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -58,8 +56,6 @@ int sysctl_ipfrag_high_thresh = 256*1024; int sysctl_ipfrag_low_thresh = 192*1024; -int sysctl_ipfrag_max_dist = 64; - /* Important NOTE! Fragment queue must be destroyed before MSL expires. * RFC791 is wrong proposing to prolongate timer each fragment arrival by TTL. */ @@ -75,7 +71,7 @@ struct ipfrag_skb_cb /* Describe an entry in the "incomplete datagrams" queue. */ struct ipq { - struct hlist_node list; + struct ipq *next; /* linked list pointers */ struct list_head lru_list; /* lru list member */ u32 user; u32 saddr; @@ -93,10 +89,9 @@ struct ipq { spinlock_t lock; atomic_t refcnt; struct timer_list timer; /* when will this queue expire? */ + struct ipq **pprev; + int iif; struct timeval stamp; - int iif; - unsigned int rid; - struct inet_peer *peer; }; /* Hash table. */ @@ -104,7 +99,7 @@ struct ipq { #define IPQ_HASHSZ 64 /* Per-bucket lock is easy to add now. */ -static struct hlist_head ipq_hash[IPQ_HASHSZ]; +static struct ipq *ipq_hash[IPQ_HASHSZ]; static DEFINE_RWLOCK(ipfrag_lock); static u32 ipfrag_hash_rnd; static LIST_HEAD(ipq_lru_list); @@ -112,7 +107,9 @@ int ip_frag_nqueues = 0; static __inline__ void __ipq_unlink(struct ipq *qp) { - hlist_del(&qp->list); + if(qp->next) + qp->next->pprev = qp->pprev; + *qp->pprev = qp->next; list_del(&qp->lru_list); ip_frag_nqueues--; } @@ -142,18 +139,27 @@ static void ipfrag_secret_rebuild(unsigned long dummy) get_random_bytes(&ipfrag_hash_rnd, sizeof(u32)); for (i = 0; i < IPQ_HASHSZ; i++) { struct ipq *q; - struct hlist_node *p, *n; - hlist_for_each_entry_safe(q, p, n, &ipq_hash[i], list) { + q = ipq_hash[i]; + while (q) { + struct ipq *next = q->next; unsigned int hval = ipqhashfn(q->id, q->saddr, q->daddr, q->protocol); if (hval != i) { - hlist_del(&q->list); + /* Unlink. */ + if (q->next) + q->next->pprev = q->pprev; + *q->pprev = q->next; /* Relink to new hash chain. */ - hlist_add_head(&q->list, &ipq_hash[hval]); + if ((q->next = ipq_hash[hval]) != NULL) + q->next->pprev = &q->next; + ipq_hash[hval] = q; + q->pprev = &ipq_hash[hval]; } + + q = next; } } write_unlock(&ipfrag_lock); @@ -201,9 +207,6 @@ static void ip_frag_destroy(struct ipq *qp, int *work) BUG_TRAP(qp->last_in&COMPLETE); BUG_TRAP(del_timer(&qp->timer) == 0); - if (qp->peer) - inet_putpeer(qp->peer); - /* Release all fragment data. */ fp = qp->fragments; while (fp) { @@ -307,16 +310,14 @@ static void ip_expire(unsigned long arg) static struct ipq *ip_frag_intern(unsigned int hash, struct ipq *qp_in) { struct ipq *qp; -#ifdef CONFIG_SMP - struct hlist_node *n; -#endif + write_lock(&ipfrag_lock); #ifdef CONFIG_SMP /* With SMP race we have to recheck hash table, because * such entry could be created on other cpu, while we * promoted read lock to write lock. */ - hlist_for_each_entry(qp, n, &ipq_hash[hash], list) { + for(qp = ipq_hash[hash]; qp; qp = qp->next) { if(qp->id == qp_in->id && qp->saddr == qp_in->saddr && qp->daddr == qp_in->daddr && @@ -336,7 +337,10 @@ static struct ipq *ip_frag_intern(unsigned int hash, struct ipq *qp_in) atomic_inc(&qp->refcnt); atomic_inc(&qp->refcnt); - hlist_add_head(&qp->list, &ipq_hash[hash]); + if((qp->next = ipq_hash[hash]) != NULL) + qp->next->pprev = &qp->next; + ipq_hash[hash] = qp; + qp->pprev = &ipq_hash[hash]; INIT_LIST_HEAD(&qp->lru_list); list_add_tail(&qp->lru_list, &ipq_lru_list); ip_frag_nqueues++; @@ -362,7 +366,6 @@ static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user) qp->meat = 0; qp->fragments = NULL; qp->iif = 0; - qp->peer = sysctl_ipfrag_max_dist ? inet_getpeer(iph->saddr, 1) : NULL; /* Initialize a timer for this entry. */ init_timer(&qp->timer); @@ -389,10 +392,9 @@ static inline struct ipq *ip_find(struct iphdr *iph, u32 user) __u8 protocol = iph->protocol; unsigned int hash = ipqhashfn(id, saddr, daddr, protocol); struct ipq *qp; - struct hlist_node *n; read_lock(&ipfrag_lock); - hlist_for_each_entry(qp, n, &ipq_hash[hash], list) { + for(qp = ipq_hash[hash]; qp; qp = qp->next) { if(qp->id == id && qp->saddr == saddr && qp->daddr == daddr && @@ -408,56 +410,6 @@ static inline struct ipq *ip_find(struct iphdr *iph, u32 user) return ip_frag_create(hash, iph, user); } -/* Is the fragment too far ahead to be part of ipq? */ -static inline int ip_frag_too_far(struct ipq *qp) -{ - struct inet_peer *peer = qp->peer; - unsigned int max = sysctl_ipfrag_max_dist; - unsigned int start, end; - - int rc; - - if (!peer || !max) - return 0; - - start = qp->rid; - end = atomic_inc_return(&peer->rid); - qp->rid = end; - - rc = qp->fragments && (end - start) > max; - - if (rc) { - IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS); - } - - return rc; -} - -static int ip_frag_reinit(struct ipq *qp) -{ - struct sk_buff *fp; - - if (!mod_timer(&qp->timer, jiffies + sysctl_ipfrag_time)) { - atomic_inc(&qp->refcnt); - return -ETIMEDOUT; - } - - fp = qp->fragments; - do { - struct sk_buff *xp = fp->next; - frag_kfree_skb(fp, NULL); - fp = xp; - } while (fp); - - qp->last_in = 0; - qp->len = 0; - qp->meat = 0; - qp->fragments = NULL; - qp->iif = 0; - - return 0; -} - /* Add new segment to existing queue. */ static void ip_frag_queue(struct ipq *qp, struct sk_buff *skb) { @@ -468,12 +420,6 @@ static void ip_frag_queue(struct ipq *qp, struct sk_buff *skb) if (qp->last_in & COMPLETE) goto err; - if (!(IPCB(skb)->flags & IPSKB_FRAG_COMPLETE) && - unlikely(ip_frag_too_far(qp)) && unlikely(ip_frag_reinit(qp))) { - ipq_kill(qp); - goto err; - } - offset = ntohs(skb->nh.iph->frag_off); flags = offset & ~IP_OFFSET; offset &= IP_OFFSET; diff --git a/trunk/net/ipv4/ip_gre.c b/trunk/net/ipv4/ip_gre.c index 46f9d9cf7a5f..4e9c74b54b15 100644 --- a/trunk/net/ipv4/ip_gre.c +++ b/trunk/net/ipv4/ip_gre.c @@ -618,7 +618,7 @@ static int ipgre_rcv(struct sk_buff *skb) skb->mac.raw = skb->nh.raw; skb->nh.raw = __pskb_pull(skb, offset); - skb_postpull_rcsum(skb, skb->h.raw, offset); + skb_postpull_rcsum(skb, skb->mac.raw, offset); memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); skb->pkt_type = PACKET_HOST; #ifdef CONFIG_NET_IPGRE_BROADCAST @@ -1217,7 +1217,7 @@ static int ipgre_tunnel_init(struct net_device *dev) return 0; } -static int __init ipgre_fb_tunnel_init(struct net_device *dev) +int __init ipgre_fb_tunnel_init(struct net_device *dev) { struct ip_tunnel *tunnel = (struct ip_tunnel*)dev->priv; struct iphdr *iph = &tunnel->parms.iph; diff --git a/trunk/net/ipv4/ip_input.c b/trunk/net/ipv4/ip_input.c index e45846ae570b..473d0f2b2e0d 100644 --- a/trunk/net/ipv4/ip_input.c +++ b/trunk/net/ipv4/ip_input.c @@ -128,7 +128,6 @@ #include #include #include -#include #include #include diff --git a/trunk/net/ipv4/ip_options.c b/trunk/net/ipv4/ip_options.c index d3f6c468faf4..dbe12da8d8b3 100644 --- a/trunk/net/ipv4/ip_options.c +++ b/trunk/net/ipv4/ip_options.c @@ -22,7 +22,6 @@ #include #include #include -#include /* * Write options to IP header, record destination address to diff --git a/trunk/net/ipv4/ip_output.c b/trunk/net/ipv4/ip_output.c index 2a830de3a699..11c2f68254f0 100644 --- a/trunk/net/ipv4/ip_output.c +++ b/trunk/net/ipv4/ip_output.c @@ -445,7 +445,6 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*)) hlen = iph->ihl * 4; mtu = dst_mtu(&rt->u.dst) - hlen; /* Size of data space */ - IPCB(skb)->flags |= IPSKB_FRAG_COMPLETE; /* When frag_list is given, use it. First, check its validity: * some transformers could create wrong frag_list or break existing @@ -691,7 +690,7 @@ csum_page(struct page *page, int offset, int copy) return csum; } -static inline int ip_ufo_append_data(struct sock *sk, +inline int ip_ufo_append_data(struct sock *sk, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int hh_len, int fragheaderlen, diff --git a/trunk/net/ipv4/ip_sockglue.c b/trunk/net/ipv4/ip_sockglue.c index 6986e11d65cc..4f2d87257309 100644 --- a/trunk/net/ipv4/ip_sockglue.c +++ b/trunk/net/ipv4/ip_sockglue.c @@ -25,12 +25,12 @@ #include #include #include -#include #include #include #include #include -#include +#include +#include #include #include #include @@ -427,8 +427,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, err = ip_options_get_from_user(&opt, optval, optlen); if (err) break; - if (inet->is_icsk) { - struct inet_connection_sock *icsk = inet_csk(sk); + if (sk->sk_type == SOCK_STREAM) { + struct tcp_sock *tp = tcp_sk(sk); #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) if (sk->sk_family == PF_INET || (!((1 << sk->sk_state) & @@ -436,10 +436,10 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, inet->daddr != LOOPBACK4_IPV6)) { #endif if (inet->opt) - icsk->icsk_ext_hdr_len -= inet->opt->optlen; + tp->ext_header_len -= inet->opt->optlen; if (opt) - icsk->icsk_ext_hdr_len += opt->optlen; - icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie); + tp->ext_header_len += opt->optlen; + tcp_sync_mss(sk, tp->pmtu_cookie); #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) } #endif diff --git a/trunk/net/ipv4/ipcomp.c b/trunk/net/ipv4/ipcomp.c index d64e2ec8da7b..fc718df17b40 100644 --- a/trunk/net/ipv4/ipcomp.c +++ b/trunk/net/ipv4/ipcomp.c @@ -28,7 +28,6 @@ #include #include #include -#include struct ipcomp_tfms { struct list_head list; diff --git a/trunk/net/ipv4/ipconfig.c b/trunk/net/ipv4/ipconfig.c index bb3613ec448c..e8674baaa8d9 100644 --- a/trunk/net/ipv4/ipconfig.c +++ b/trunk/net/ipv4/ipconfig.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -59,7 +58,6 @@ #include #include #include -#include #include #include diff --git a/trunk/net/ipv4/ipmr.c b/trunk/net/ipv4/ipmr.c index caa3b7d2e48a..302b7eb507c9 100644 --- a/trunk/net/ipv4/ipmr.c +++ b/trunk/net/ipv4/ipmr.c @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/net/ipv4/ipvs/ip_vs_app.c b/trunk/net/ipv4/ipvs/ip_vs_app.c index 9b176a942ac5..d7eb680101c2 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_app.c +++ b/trunk/net/ipv4/ipvs/ip_vs_app.c @@ -224,6 +224,34 @@ void unregister_ip_vs_app(struct ip_vs_app *app) } +#if 0000 +/* + * Get reference to app by name (called from user context) + */ +struct ip_vs_app *ip_vs_app_get_by_name(char *appname) +{ + struct ip_vs_app *app, *a = NULL; + + down(&__ip_vs_app_mutex); + + list_for_each_entry(ent, &ip_vs_app_list, a_list) { + if (strcmp(app->name, appname)) + continue; + + /* softirq may call ip_vs_app_get too, so the caller + must disable softirq on the current CPU */ + if (ip_vs_app_get(app)) + a = app; + break; + } + + up(&__ip_vs_app_mutex); + + return a; +} +#endif + + /* * Bind ip_vs_conn to its ip_vs_app (called by cp constructor) */ diff --git a/trunk/net/ipv4/ipvs/ip_vs_conn.c b/trunk/net/ipv4/ipvs/ip_vs_conn.c index 81d90354c928..f828fa2eb7de 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_conn.c +++ b/trunk/net/ipv4/ipvs/ip_vs_conn.c @@ -24,10 +24,7 @@ * */ -#include -#include #include -#include #include #include /* for proc_net_* */ #include @@ -222,7 +219,7 @@ struct ip_vs_conn *ip_vs_conn_in_get if (!cp && atomic_read(&ip_vs_conn_no_cport_cnt)) cp = __ip_vs_conn_in_get(protocol, s_addr, 0, d_addr, d_port); - IP_VS_DBG(9, "lookup/in %s %u.%u.%u.%u:%d->%u.%u.%u.%u:%d %s\n", + IP_VS_DBG(7, "lookup/in %s %u.%u.%u.%u:%d->%u.%u.%u.%u:%d %s\n", ip_vs_proto_name(protocol), NIPQUAD(s_addr), ntohs(s_port), NIPQUAD(d_addr), ntohs(d_port), @@ -257,7 +254,7 @@ struct ip_vs_conn *ip_vs_ct_in_get out: ct_read_unlock(hash); - IP_VS_DBG(9, "template lookup/in %s %u.%u.%u.%u:%d->%u.%u.%u.%u:%d %s\n", + IP_VS_DBG(7, "template lookup/in %s %u.%u.%u.%u:%d->%u.%u.%u.%u:%d %s\n", ip_vs_proto_name(protocol), NIPQUAD(s_addr), ntohs(s_port), NIPQUAD(d_addr), ntohs(d_port), @@ -298,7 +295,7 @@ struct ip_vs_conn *ip_vs_conn_out_get ct_read_unlock(hash); - IP_VS_DBG(9, "lookup/out %s %u.%u.%u.%u:%d->%u.%u.%u.%u:%d %s\n", + IP_VS_DBG(7, "lookup/out %s %u.%u.%u.%u:%d->%u.%u.%u.%u:%d %s\n", ip_vs_proto_name(protocol), NIPQUAD(s_addr), ntohs(s_port), NIPQUAD(d_addr), ntohs(d_port), @@ -394,9 +391,8 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest) cp->flags |= atomic_read(&dest->conn_flags); cp->dest = dest; - IP_VS_DBG(7, "Bind-dest %s c:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d " - "d:%u.%u.%u.%u:%d fwd:%c s:%u conn->flags:%X conn->refcnt:%d " - "dest->refcnt:%d\n", + IP_VS_DBG(9, "Bind-dest %s c:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d " + "d:%u.%u.%u.%u:%d fwd:%c s:%u flg:%X cnt:%d destcnt:%d\n", ip_vs_proto_name(cp->protocol), NIPQUAD(cp->caddr), ntohs(cp->cport), NIPQUAD(cp->vaddr), ntohs(cp->vport), @@ -434,9 +430,8 @@ static inline void ip_vs_unbind_dest(struct ip_vs_conn *cp) if (!dest) return; - IP_VS_DBG(7, "Unbind-dest %s c:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d " - "d:%u.%u.%u.%u:%d fwd:%c s:%u conn->flags:%X conn->refcnt:%d " - "dest->refcnt:%d\n", + IP_VS_DBG(9, "Unbind-dest %s c:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d " + "d:%u.%u.%u.%u:%d fwd:%c s:%u flg:%X cnt:%d destcnt:%d\n", ip_vs_proto_name(cp->protocol), NIPQUAD(cp->caddr), ntohs(cp->cport), NIPQUAD(cp->vaddr), ntohs(cp->vport), @@ -576,7 +571,7 @@ static void ip_vs_conn_expire(unsigned long data) ip_vs_conn_hash(cp); expire_later: - IP_VS_DBG(7, "delayed: conn->refcnt-1=%d conn->n_control=%d\n", + IP_VS_DBG(7, "delayed: refcnt-1=%d conn.n_control=%d\n", atomic_read(&cp->refcnt)-1, atomic_read(&cp->n_control)); @@ -776,7 +771,7 @@ static inline int todrop_entry(struct ip_vs_conn *cp) * The drop rate array needs tuning for real environments. * Called from timer bh only => no locking */ - static const char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; + static char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; static char todrop_counter[9] = {0}; int i; diff --git a/trunk/net/ipv4/ipvs/ip_vs_core.c b/trunk/net/ipv4/ipvs/ip_vs_core.c index 1aca94a9fd8b..1a0843cd58a9 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_core.c +++ b/trunk/net/ipv4/ipvs/ip_vs_core.c @@ -426,7 +426,7 @@ ip_vs_schedule(struct ip_vs_service *svc, const struct sk_buff *skb) return NULL; IP_VS_DBG(6, "Schedule fwd:%c c:%u.%u.%u.%u:%u v:%u.%u.%u.%u:%u " - "d:%u.%u.%u.%u:%u conn->flags:%X conn->refcnt:%d\n", + "d:%u.%u.%u.%u:%u flg:%X cnt:%d\n", ip_vs_fwd_tag(cp), NIPQUAD(cp->caddr), ntohs(cp->cport), NIPQUAD(cp->vaddr), ntohs(cp->vport), diff --git a/trunk/net/ipv4/ipvs/ip_vs_ctl.c b/trunk/net/ipv4/ipvs/ip_vs_ctl.c index c935c5086d33..2d66848e7aa0 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_ctl.c +++ b/trunk/net/ipv4/ipvs/ip_vs_ctl.c @@ -35,7 +35,6 @@ #include #include -#include #include #include @@ -448,7 +447,7 @@ ip_vs_service_get(__u32 fwmark, __u16 protocol, __u32 vaddr, __u16 vport) out: read_unlock(&__ip_vs_svc_lock); - IP_VS_DBG(9, "lookup service: fwm %u %s %u.%u.%u.%u:%u %s\n", + IP_VS_DBG(6, "lookup service: fwm %u %s %u.%u.%u.%u:%u %s\n", fwmark, ip_vs_proto_name(protocol), NIPQUAD(vaddr), ntohs(vport), svc?"hit":"not hit"); @@ -598,7 +597,7 @@ ip_vs_trash_get_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport) */ list_for_each_entry_safe(dest, nxt, &ip_vs_dest_trash, n_list) { IP_VS_DBG(3, "Destination %u/%u.%u.%u.%u:%u still in trash, " - "dest->refcnt=%d\n", + "refcnt=%d\n", dest->vfwmark, NIPQUAD(dest->addr), ntohs(dest->port), atomic_read(&dest->refcnt)); @@ -805,7 +804,7 @@ ip_vs_add_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest) dest = ip_vs_trash_get_dest(svc, daddr, dport); if (dest != NULL) { IP_VS_DBG(3, "Get destination %u.%u.%u.%u:%u from trash, " - "dest->refcnt=%d, service %u/%u.%u.%u.%u:%u\n", + "refcnt=%d, service %u/%u.%u.%u.%u:%u\n", NIPQUAD(daddr), ntohs(dport), atomic_read(&dest->refcnt), dest->vfwmark, @@ -950,8 +949,7 @@ static void __ip_vs_del_dest(struct ip_vs_dest *dest) atomic_dec(&dest->svc->refcnt); kfree(dest); } else { - IP_VS_DBG(3, "Moving dest %u.%u.%u.%u:%u into trash, " - "dest->refcnt=%d\n", + IP_VS_DBG(3, "Moving dest %u.%u.%u.%u:%u into trash, refcnt=%d\n", NIPQUAD(dest->addr), ntohs(dest->port), atomic_read(&dest->refcnt)); list_add(&dest->n_list, &ip_vs_dest_trash); @@ -1911,7 +1909,7 @@ static int ip_vs_set_timeout(struct ip_vs_timeout_user *u) #define DAEMON_ARG_LEN (sizeof(struct ip_vs_daemon_user)) #define MAX_ARG_LEN SVCDEST_ARG_LEN -static const unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = { +static unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = { [SET_CMDID(IP_VS_SO_SET_ADD)] = SERVICE_ARG_LEN, [SET_CMDID(IP_VS_SO_SET_EDIT)] = SERVICE_ARG_LEN, [SET_CMDID(IP_VS_SO_SET_DEL)] = SERVICE_ARG_LEN, @@ -2182,7 +2180,7 @@ __ip_vs_get_timeouts(struct ip_vs_timeout_user *u) #define GET_TIMEOUT_ARG_LEN (sizeof(struct ip_vs_timeout_user)) #define GET_DAEMON_ARG_LEN (sizeof(struct ip_vs_daemon_user) * 2) -static const unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = { +static unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = { [GET_CMDID(IP_VS_SO_GET_VERSION)] = 64, [GET_CMDID(IP_VS_SO_GET_INFO)] = GET_INFO_ARG_LEN, [GET_CMDID(IP_VS_SO_GET_SERVICES)] = GET_SERVICES_ARG_LEN, diff --git a/trunk/net/ipv4/ipvs/ip_vs_dh.c b/trunk/net/ipv4/ipvs/ip_vs_dh.c index 9fee19c4c617..f3bc320dce93 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_dh.c +++ b/trunk/net/ipv4/ipvs/ip_vs_dh.c @@ -37,10 +37,8 @@ * */ -#include #include #include -#include #include diff --git a/trunk/net/ipv4/ipvs/ip_vs_est.c b/trunk/net/ipv4/ipvs/ip_vs_est.c index e7004741ac73..67b3e2fc1fa1 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_est.c +++ b/trunk/net/ipv4/ipvs/ip_vs_est.c @@ -13,10 +13,7 @@ * Changes: * */ -#include #include -#include -#include #include #include diff --git a/trunk/net/ipv4/ipvs/ip_vs_lblc.c b/trunk/net/ipv4/ipvs/ip_vs_lblc.c index 6e5cb92a5c83..561cda326fa8 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_lblc.c +++ b/trunk/net/ipv4/ipvs/ip_vs_lblc.c @@ -41,10 +41,8 @@ * me to write this module. */ -#include #include #include -#include /* for sysctl */ #include @@ -230,6 +228,33 @@ ip_vs_lblc_hash(struct ip_vs_lblc_table *tbl, struct ip_vs_lblc_entry *en) } +#if 0000 +/* + * Unhash ip_vs_lblc_entry from ip_vs_lblc_table. + * returns bool success. + */ +static int ip_vs_lblc_unhash(struct ip_vs_lblc_table *tbl, + struct ip_vs_lblc_entry *en) +{ + if (list_empty(&en->list)) { + IP_VS_ERR("ip_vs_lblc_unhash(): request for not hashed entry, " + "called from %p\n", __builtin_return_address(0)); + return 0; + } + + /* + * Remove it from the table + */ + write_lock(&tbl->lock); + list_del(&en->list); + INIT_LIST_HEAD(&en->list); + write_unlock(&tbl->lock); + + return 1; +} +#endif + + /* * Get ip_vs_lblc_entry associated with supplied parameters. */ diff --git a/trunk/net/ipv4/ipvs/ip_vs_lblcr.c b/trunk/net/ipv4/ipvs/ip_vs_lblcr.c index 32ba37ba72d8..ce456dbf09a5 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_lblcr.c +++ b/trunk/net/ipv4/ipvs/ip_vs_lblcr.c @@ -39,10 +39,8 @@ * */ -#include #include #include -#include /* for sysctl */ #include @@ -416,6 +414,33 @@ ip_vs_lblcr_hash(struct ip_vs_lblcr_table *tbl, struct ip_vs_lblcr_entry *en) } +#if 0000 +/* + * Unhash ip_vs_lblcr_entry from ip_vs_lblcr_table. + * returns bool success. + */ +static int ip_vs_lblcr_unhash(struct ip_vs_lblcr_table *tbl, + struct ip_vs_lblcr_entry *en) +{ + if (list_empty(&en->list)) { + IP_VS_ERR("ip_vs_lblcr_unhash(): request for not hashed entry, " + "called from %p\n", __builtin_return_address(0)); + return 0; + } + + /* + * Remove it from the table + */ + write_lock(&tbl->lock); + list_del(&en->list); + INIT_LIST_HEAD(&en->list); + write_unlock(&tbl->lock); + + return 1; +} +#endif + + /* * Get ip_vs_lblcr_entry associated with supplied parameters. */ diff --git a/trunk/net/ipv4/ipvs/ip_vs_proto_ah.c b/trunk/net/ipv4/ipvs/ip_vs_proto_ah.c index 8b0505b09317..453e94a0bbd7 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_proto_ah.c +++ b/trunk/net/ipv4/ipvs/ip_vs_proto_ah.c @@ -12,8 +12,6 @@ * */ -#include -#include #include #include #include diff --git a/trunk/net/ipv4/ipvs/ip_vs_proto_esp.c b/trunk/net/ipv4/ipvs/ip_vs_proto_esp.c index c36ccf057a19..478e5c7c7e8e 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_proto_esp.c +++ b/trunk/net/ipv4/ipvs/ip_vs_proto_esp.c @@ -12,8 +12,6 @@ * */ -#include -#include #include #include #include diff --git a/trunk/net/ipv4/ipvs/ip_vs_proto_tcp.c b/trunk/net/ipv4/ipvs/ip_vs_proto_tcp.c index bc28b1160a3a..c19408973c09 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_proto_tcp.c +++ b/trunk/net/ipv4/ipvs/ip_vs_proto_tcp.c @@ -251,7 +251,7 @@ tcp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp) #define TCP_DIR_OUTPUT 4 #define TCP_DIR_INPUT_ONLY 8 -static const int tcp_state_off[IP_VS_DIR_LAST] = { +static int tcp_state_off[IP_VS_DIR_LAST] = { [IP_VS_DIR_INPUT] = TCP_DIR_INPUT, [IP_VS_DIR_OUTPUT] = TCP_DIR_OUTPUT, [IP_VS_DIR_INPUT_ONLY] = TCP_DIR_INPUT_ONLY, @@ -275,6 +275,28 @@ static int tcp_timeouts[IP_VS_TCP_S_LAST+1] = { [IP_VS_TCP_S_LAST] = 2*HZ, }; + +#if 0 + +/* FIXME: This is going to die */ + +static int tcp_timeouts_dos[IP_VS_TCP_S_LAST+1] = { + [IP_VS_TCP_S_NONE] = 2*HZ, + [IP_VS_TCP_S_ESTABLISHED] = 8*60*HZ, + [IP_VS_TCP_S_SYN_SENT] = 60*HZ, + [IP_VS_TCP_S_SYN_RECV] = 10*HZ, + [IP_VS_TCP_S_FIN_WAIT] = 60*HZ, + [IP_VS_TCP_S_TIME_WAIT] = 60*HZ, + [IP_VS_TCP_S_CLOSE] = 10*HZ, + [IP_VS_TCP_S_CLOSE_WAIT] = 60*HZ, + [IP_VS_TCP_S_LAST_ACK] = 30*HZ, + [IP_VS_TCP_S_LISTEN] = 2*60*HZ, + [IP_VS_TCP_S_SYNACK] = 100*HZ, + [IP_VS_TCP_S_LAST] = 2*HZ, +}; + +#endif + static char * tcp_state_name_table[IP_VS_TCP_S_LAST+1] = { [IP_VS_TCP_S_NONE] = "NONE", [IP_VS_TCP_S_ESTABLISHED] = "ESTABLISHED", @@ -426,7 +448,7 @@ set_tcp_state(struct ip_vs_protocol *pp, struct ip_vs_conn *cp, struct ip_vs_dest *dest = cp->dest; IP_VS_DBG(8, "%s %s [%c%c%c%c] %u.%u.%u.%u:%d->" - "%u.%u.%u.%u:%d state: %s->%s conn->refcnt:%d\n", + "%u.%u.%u.%u:%d state: %s->%s cnt:%d\n", pp->name, (state_off==TCP_DIR_OUTPUT)?"output ":"input ", th->syn? 'S' : '.', diff --git a/trunk/net/ipv4/ipvs/ip_vs_proto_udp.c b/trunk/net/ipv4/ipvs/ip_vs_proto_udp.c index 89d9175d8f28..8ae5f2e0aefa 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_proto_udp.c +++ b/trunk/net/ipv4/ipvs/ip_vs_proto_udp.c @@ -15,11 +15,8 @@ * */ -#include -#include #include #include -#include #include diff --git a/trunk/net/ipv4/ipvs/ip_vs_sh.c b/trunk/net/ipv4/ipvs/ip_vs_sh.c index 7775e6cc68be..6f7c50e44a39 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_sh.c +++ b/trunk/net/ipv4/ipvs/ip_vs_sh.c @@ -34,10 +34,8 @@ * */ -#include #include #include -#include #include diff --git a/trunk/net/ipv4/ipvs/ip_vs_sync.c b/trunk/net/ipv4/ipvs/ip_vs_sync.c index 1bca714bda3d..2e5ced3d8062 100644 --- a/trunk/net/ipv4/ipvs/ip_vs_sync.c +++ b/trunk/net/ipv4/ipvs/ip_vs_sync.c @@ -21,14 +21,12 @@ #include #include -#include #include #include #include #include #include #include /* for ip_mc_join_group */ -#include #include #include diff --git a/trunk/net/ipv4/netfilter/Kconfig b/trunk/net/ipv4/netfilter/Kconfig index 88a60650e6b8..9d3c8b5f327e 100644 --- a/trunk/net/ipv4/netfilter/Kconfig +++ b/trunk/net/ipv4/netfilter/Kconfig @@ -56,8 +56,8 @@ config IP_NF_CONNTRACK_MARK instead of the individual packets. config IP_NF_CONNTRACK_EVENTS - bool "Connection tracking events (EXPERIMENTAL)" - depends on EXPERIMENTAL && IP_NF_CONNTRACK + bool "Connection tracking events" + depends on IP_NF_CONNTRACK help If this option is enabled, the connection tracking code will provide a notifier chain that can be used by other kernel code @@ -66,8 +66,8 @@ config IP_NF_CONNTRACK_EVENTS IF unsure, say `N'. config IP_NF_CONNTRACK_NETLINK - tristate 'Connection tracking netlink interface (EXPERIMENTAL)' - depends on EXPERIMENTAL && IP_NF_CONNTRACK && NETFILTER_NETLINK + tristate 'Connection tracking netlink interface' + depends on IP_NF_CONNTRACK && NETFILTER_NETLINK depends on IP_NF_CONNTRACK!=y || NETFILTER_NETLINK!=m help This option enables support for a netlink-based userspace interface @@ -440,7 +440,7 @@ config IP_NF_MATCH_COMMENT config IP_NF_MATCH_CONNMARK tristate 'Connection mark match support' depends on IP_NF_IPTABLES - depends on (IP_NF_CONNTRACK && IP_NF_CONNTRACK_MARK) || (NF_CONNTRACK_MARK && NF_CONNTRACK_IPV4) + depends on IP_NF_CONNTRACK_MARK || (NF_CONNTRACK_MARK && NF_CONNTRACK_IPV4) help This option adds a `connmark' match, which allows you to match the connection mark value previously set for the session by `CONNMARK'. @@ -452,7 +452,7 @@ config IP_NF_MATCH_CONNMARK config IP_NF_MATCH_CONNBYTES tristate 'Connection byte/packet counter match support' depends on IP_NF_IPTABLES - depends on (IP_NF_CONNTRACK && IP_NF_CT_ACCT) || (NF_CT_ACCT && NF_CONNTRACK_IPV4) + depends on IP_NF_CT_ACCT || (NF_CT_ACCT && NF_CONNTRACK_IPV4) help This option adds a `connbytes' match, which allows you to match the number of bytes and/or packets for each direction within a connection. @@ -767,7 +767,7 @@ config IP_NF_TARGET_TTL config IP_NF_TARGET_CONNMARK tristate 'CONNMARK target support' depends on IP_NF_MANGLE - depends on (IP_NF_CONNTRACK && IP_NF_CONNTRACK_MARK) || (NF_CONNTRACK_MARK && NF_CONNTRACK_IPV4) + depends on IP_NF_CONNTRACK_MARK || (NF_CONNTRACK_MARK && NF_CONNTRACK_IPV4) help This option adds a `CONNMARK' target, which allows one to manipulate the connection mark value. Similar to the MARK target, but @@ -779,8 +779,8 @@ config IP_NF_TARGET_CONNMARK config IP_NF_TARGET_CLUSTERIP tristate "CLUSTERIP target support (EXPERIMENTAL)" - depends on IP_NF_MANGLE && EXPERIMENTAL - depends on (IP_NF_CONNTRACK && IP_NF_CONNTRACK_MARK) || (NF_CONNTRACK_MARK && NF_CONNTRACK_IPV4) + depends on IP_NF_IPTABLES && EXPERIMENTAL + depends on IP_NF_CONNTRACK_MARK || (NF_CONNTRACK_MARK && NF_CONNTRACK_IPV4) help The CLUSTERIP target allows you to build load-balancing clusters of network servers without having a dedicated load-balancing diff --git a/trunk/net/ipv4/netfilter/Makefile b/trunk/net/ipv4/netfilter/Makefile index d0a447e520a2..058c48e258fc 100644 --- a/trunk/net/ipv4/netfilter/Makefile +++ b/trunk/net/ipv4/netfilter/Makefile @@ -12,7 +12,6 @@ ip_nat_pptp-objs := ip_nat_helper_pptp.o ip_nat_proto_gre.o # connection tracking obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o -obj-$(CONFIG_IP_NF_NAT) += ip_nat.o # conntrack netlink interface obj-$(CONFIG_IP_NF_CONNTRACK_NETLINK) += ip_conntrack_netlink.o @@ -42,7 +41,7 @@ obj-$(CONFIG_IP_NF_IPTABLES) += ip_tables.o # the three instances of ip_tables obj-$(CONFIG_IP_NF_FILTER) += iptable_filter.o obj-$(CONFIG_IP_NF_MANGLE) += iptable_mangle.o -obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o +obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o ip_nat.o obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o # matches diff --git a/trunk/net/ipv4/netfilter/arp_tables.c b/trunk/net/ipv4/netfilter/arp_tables.c index bba156304695..3c2e9639bba6 100644 --- a/trunk/net/ipv4/netfilter/arp_tables.c +++ b/trunk/net/ipv4/netfilter/arp_tables.c @@ -68,14 +68,19 @@ struct arpt_table_info { unsigned int initial_entries; unsigned int hook_entry[NF_ARP_NUMHOOKS]; unsigned int underflow[NF_ARP_NUMHOOKS]; - void *entries[NR_CPUS]; + char entries[0] __attribute__((aligned(SMP_CACHE_BYTES))); }; static LIST_HEAD(arpt_target); static LIST_HEAD(arpt_tables); -#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) #define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) +#ifdef CONFIG_SMP +#define TABLE_OFFSET(t,p) (SMP_ALIGN((t)->size)*(p)) +#else +#define TABLE_OFFSET(t,p) 0 +#endif + static inline int arp_devaddr_compare(const struct arpt_devaddr_info *ap, char *hdr_addr, int len) { @@ -264,7 +269,9 @@ unsigned int arpt_do_table(struct sk_buff **pskb, outdev = out ? out->name : nulldevname; read_lock_bh(&table->lock); - table_base = (void *)table->private->entries[smp_processor_id()]; + table_base = (void *)table->private->entries + + TABLE_OFFSET(table->private, + smp_processor_id()); e = get_entry(table_base, table->private->hook_entry[hook]); back = get_entry(table_base, table->private->underflow[hook]); @@ -455,8 +462,7 @@ static inline int unconditional(const struct arpt_arp *arp) /* Figures out from what hook each rule can be called: returns 0 if * there are loops. Puts hook bitmask in comefrom. */ -static int mark_source_chains(struct arpt_table_info *newinfo, - unsigned int valid_hooks, void *entry0) +static int mark_source_chains(struct arpt_table_info *newinfo, unsigned int valid_hooks) { unsigned int hook; @@ -466,7 +472,7 @@ static int mark_source_chains(struct arpt_table_info *newinfo, for (hook = 0; hook < NF_ARP_NUMHOOKS; hook++) { unsigned int pos = newinfo->hook_entry[hook]; struct arpt_entry *e - = (struct arpt_entry *)(entry0 + pos); + = (struct arpt_entry *)(newinfo->entries + pos); if (!(valid_hooks & (1 << hook))) continue; @@ -508,13 +514,13 @@ static int mark_source_chains(struct arpt_table_info *newinfo, goto next; e = (struct arpt_entry *) - (entry0 + pos); + (newinfo->entries + pos); } while (oldpos == pos + e->next_offset); /* Move along one */ size = e->next_offset; e = (struct arpt_entry *) - (entry0 + pos + size); + (newinfo->entries + pos + size); e->counters.pcnt = pos; pos += size; } else { @@ -531,7 +537,7 @@ static int mark_source_chains(struct arpt_table_info *newinfo, newpos = pos + e->next_offset; } e = (struct arpt_entry *) - (entry0 + newpos); + (newinfo->entries + newpos); e->counters.pcnt = pos; pos = newpos; } @@ -683,7 +689,6 @@ static inline int cleanup_entry(struct arpt_entry *e, unsigned int *i) static int translate_table(const char *name, unsigned int valid_hooks, struct arpt_table_info *newinfo, - void *entry0, unsigned int size, unsigned int number, const unsigned int *hook_entries, @@ -705,11 +710,11 @@ static int translate_table(const char *name, i = 0; /* Walk through entries, checking offsets. */ - ret = ARPT_ENTRY_ITERATE(entry0, newinfo->size, + ret = ARPT_ENTRY_ITERATE(newinfo->entries, newinfo->size, check_entry_size_and_hooks, newinfo, - entry0, - entry0 + size, + newinfo->entries, + newinfo->entries + size, hook_entries, underflows, &i); duprintf("translate_table: ARPT_ENTRY_ITERATE gives %d\n", ret); if (ret != 0) @@ -738,26 +743,29 @@ static int translate_table(const char *name, } } - if (!mark_source_chains(newinfo, valid_hooks, entry0)) { + if (!mark_source_chains(newinfo, valid_hooks)) { duprintf("Looping hook\n"); return -ELOOP; } /* Finally, each sanity check must pass */ i = 0; - ret = ARPT_ENTRY_ITERATE(entry0, newinfo->size, + ret = ARPT_ENTRY_ITERATE(newinfo->entries, newinfo->size, check_entry, name, size, &i); if (ret != 0) { - ARPT_ENTRY_ITERATE(entry0, newinfo->size, + ARPT_ENTRY_ITERATE(newinfo->entries, newinfo->size, cleanup_entry, &i); return ret; } /* And one copy for every other CPU */ for_each_cpu(i) { - if (newinfo->entries[i] && newinfo->entries[i] != entry0) - memcpy(newinfo->entries[i], entry0, newinfo->size); + if (i == 0) + continue; + memcpy(newinfo->entries + SMP_ALIGN(newinfo->size) * i, + newinfo->entries, + SMP_ALIGN(newinfo->size)); } return ret; @@ -799,42 +807,15 @@ static inline int add_entry_to_counter(const struct arpt_entry *e, return 0; } -static inline int set_entry_to_counter(const struct arpt_entry *e, - struct arpt_counters total[], - unsigned int *i) -{ - SET_COUNTER(total[*i], e->counters.bcnt, e->counters.pcnt); - - (*i)++; - return 0; -} - static void get_counters(const struct arpt_table_info *t, struct arpt_counters counters[]) { unsigned int cpu; unsigned int i; - unsigned int curcpu; - - /* Instead of clearing (by a previous call to memset()) - * the counters and using adds, we set the counters - * with data used by 'current' CPU - * We dont care about preemption here. - */ - curcpu = raw_smp_processor_id(); - - i = 0; - ARPT_ENTRY_ITERATE(t->entries[curcpu], - t->size, - set_entry_to_counter, - counters, - &i); for_each_cpu(cpu) { - if (cpu == curcpu) - continue; i = 0; - ARPT_ENTRY_ITERATE(t->entries[cpu], + ARPT_ENTRY_ITERATE(t->entries + TABLE_OFFSET(t, cpu), t->size, add_entry_to_counter, counters, @@ -850,7 +831,6 @@ static int copy_entries_to_user(unsigned int total_size, struct arpt_entry *e; struct arpt_counters *counters; int ret = 0; - void *loc_cpu_entry; /* We need atomic snapshot of counters: rest doesn't change * (other than comefrom, which userspace doesn't care @@ -863,13 +843,13 @@ static int copy_entries_to_user(unsigned int total_size, return -ENOMEM; /* First, sum counters... */ + memset(counters, 0, countersize); write_lock_bh(&table->lock); get_counters(table->private, counters); write_unlock_bh(&table->lock); - loc_cpu_entry = table->private->entries[raw_smp_processor_id()]; - /* ... then copy entire thing ... */ - if (copy_to_user(userptr, loc_cpu_entry, total_size) != 0) { + /* ... then copy entire thing from CPU 0... */ + if (copy_to_user(userptr, table->private->entries, total_size) != 0) { ret = -EFAULT; goto free_counters; } @@ -879,7 +859,7 @@ static int copy_entries_to_user(unsigned int total_size, for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){ struct arpt_entry_target *t; - e = (struct arpt_entry *)(loc_cpu_entry + off); + e = (struct arpt_entry *)(table->private->entries + off); if (copy_to_user(userptr + off + offsetof(struct arpt_entry, counters), &counters[num], @@ -931,47 +911,6 @@ static int get_entries(const struct arpt_get_entries *entries, return ret; } -static void free_table_info(struct arpt_table_info *info) -{ - int cpu; - for_each_cpu(cpu) { - if (info->size <= PAGE_SIZE) - kfree(info->entries[cpu]); - else - vfree(info->entries[cpu]); - } - kfree(info); -} - -static struct arpt_table_info *alloc_table_info(unsigned int size) -{ - struct arpt_table_info *newinfo; - int cpu; - - newinfo = kzalloc(sizeof(struct arpt_table_info), GFP_KERNEL); - if (!newinfo) - return NULL; - - newinfo->size = size; - - for_each_cpu(cpu) { - if (size <= PAGE_SIZE) - newinfo->entries[cpu] = kmalloc_node(size, - GFP_KERNEL, - cpu_to_node(cpu)); - else - newinfo->entries[cpu] = vmalloc_node(size, - cpu_to_node(cpu)); - - if (newinfo->entries[cpu] == NULL) { - free_table_info(newinfo); - return NULL; - } - } - - return newinfo; -} - static int do_replace(void __user *user, unsigned int len) { int ret; @@ -979,7 +918,6 @@ static int do_replace(void __user *user, unsigned int len) struct arpt_table *t; struct arpt_table_info *newinfo, *oldinfo; struct arpt_counters *counters; - void *loc_cpu_entry, *loc_cpu_old_entry; if (copy_from_user(&tmp, user, sizeof(tmp)) != 0) return -EFAULT; @@ -992,13 +930,13 @@ static int do_replace(void __user *user, unsigned int len) if ((SMP_ALIGN(tmp.size) >> PAGE_SHIFT) + 2 > num_physpages) return -ENOMEM; - newinfo = alloc_table_info(tmp.size); + newinfo = vmalloc(sizeof(struct arpt_table_info) + + SMP_ALIGN(tmp.size) * + (highest_possible_processor_id()+1)); if (!newinfo) return -ENOMEM; - /* choose the copy that is on our node/cpu */ - loc_cpu_entry = newinfo->entries[raw_smp_processor_id()]; - if (copy_from_user(loc_cpu_entry, user + sizeof(tmp), + if (copy_from_user(newinfo->entries, user + sizeof(tmp), tmp.size) != 0) { ret = -EFAULT; goto free_newinfo; @@ -1009,9 +947,10 @@ static int do_replace(void __user *user, unsigned int len) ret = -ENOMEM; goto free_newinfo; } + memset(counters, 0, tmp.num_counters * sizeof(struct arpt_counters)); ret = translate_table(tmp.name, tmp.valid_hooks, - newinfo, loc_cpu_entry, tmp.size, tmp.num_entries, + newinfo, tmp.size, tmp.num_entries, tmp.hook_entry, tmp.underflow); if (ret != 0) goto free_newinfo_counters; @@ -1050,10 +989,8 @@ static int do_replace(void __user *user, unsigned int len) /* Get the old counters. */ get_counters(oldinfo, counters); /* Decrease module usage counts and free resource */ - loc_cpu_old_entry = oldinfo->entries[raw_smp_processor_id()]; - ARPT_ENTRY_ITERATE(loc_cpu_old_entry, oldinfo->size, cleanup_entry,NULL); - - free_table_info(oldinfo); + ARPT_ENTRY_ITERATE(oldinfo->entries, oldinfo->size, cleanup_entry,NULL); + vfree(oldinfo); if (copy_to_user(tmp.counters, counters, sizeof(struct arpt_counters) * tmp.num_counters) != 0) ret = -EFAULT; @@ -1065,11 +1002,11 @@ static int do_replace(void __user *user, unsigned int len) module_put(t->me); up(&arpt_mutex); free_newinfo_counters_untrans: - ARPT_ENTRY_ITERATE(loc_cpu_entry, newinfo->size, cleanup_entry, NULL); + ARPT_ENTRY_ITERATE(newinfo->entries, newinfo->size, cleanup_entry, NULL); free_newinfo_counters: vfree(counters); free_newinfo: - free_table_info(newinfo); + vfree(newinfo); return ret; } @@ -1093,7 +1030,6 @@ static int do_add_counters(void __user *user, unsigned int len) struct arpt_counters_info tmp, *paddc; struct arpt_table *t; int ret = 0; - void *loc_cpu_entry; if (copy_from_user(&tmp, user, sizeof(tmp)) != 0) return -EFAULT; @@ -1123,9 +1059,7 @@ static int do_add_counters(void __user *user, unsigned int len) } i = 0; - /* Choose the copy that is on our node */ - loc_cpu_entry = t->private->entries[smp_processor_id()]; - ARPT_ENTRY_ITERATE(loc_cpu_entry, + ARPT_ENTRY_ITERATE(t->private->entries, t->private->size, add_counter_to_entry, paddc->counters, @@ -1286,32 +1220,30 @@ int arpt_register_table(struct arpt_table *table, struct arpt_table_info *newinfo; static struct arpt_table_info bootstrap = { 0, 0, 0, { 0 }, { 0 }, { } }; - void *loc_cpu_entry; - newinfo = alloc_table_info(repl->size); + newinfo = vmalloc(sizeof(struct arpt_table_info) + + SMP_ALIGN(repl->size) * + (highest_possible_processor_id()+1)); if (!newinfo) { ret = -ENOMEM; return ret; } - - /* choose the copy on our node/cpu */ - loc_cpu_entry = newinfo->entries[raw_smp_processor_id()]; - memcpy(loc_cpu_entry, repl->entries, repl->size); + memcpy(newinfo->entries, repl->entries, repl->size); ret = translate_table(table->name, table->valid_hooks, - newinfo, loc_cpu_entry, repl->size, + newinfo, repl->size, repl->num_entries, repl->hook_entry, repl->underflow); duprintf("arpt_register_table: translate table gives %d\n", ret); if (ret != 0) { - free_table_info(newinfo); + vfree(newinfo); return ret; } ret = down_interruptible(&arpt_mutex); if (ret != 0) { - free_table_info(newinfo); + vfree(newinfo); return ret; } @@ -1340,23 +1272,20 @@ int arpt_register_table(struct arpt_table *table, return ret; free_unlock: - free_table_info(newinfo); + vfree(newinfo); goto unlock; } void arpt_unregister_table(struct arpt_table *table) { - void *loc_cpu_entry; - down(&arpt_mutex); LIST_DELETE(&arpt_tables, table); up(&arpt_mutex); /* Decrease module usage counts and free resources */ - loc_cpu_entry = table->private->entries[raw_smp_processor_id()]; - ARPT_ENTRY_ITERATE(loc_cpu_entry, table->private->size, + ARPT_ENTRY_ITERATE(table->private->entries, table->private->size, cleanup_entry, NULL); - free_table_info(table->private); + vfree(table->private); } /* The built-in targets: standard (NULL) and error. */ diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_amanda.c b/trunk/net/ipv4/netfilter/ip_conntrack_amanda.c index 0366eedb4d70..fa3f914117ec 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_amanda.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_amanda.c @@ -18,13 +18,11 @@ * */ -#include #include #include #include #include #include -#include #include #include @@ -39,7 +37,7 @@ MODULE_LICENSE("GPL"); module_param(master_timeout, int, 0600); MODULE_PARM_DESC(master_timeout, "timeout for the master connection"); -static const char *conns[] = { "DATA ", "MESG ", "INDEX " }; +static char *conns[] = { "DATA ", "MESG ", "INDEX " }; /* This is slow, but it's simple. --RR */ static char *amanda_buffer; diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_core.c b/trunk/net/ipv4/netfilter/ip_conntrack_core.c index 84c66dbfedaf..422ab68ee7fb 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_core.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_core.c @@ -1345,11 +1345,6 @@ static int kill_all(struct ip_conntrack *i, void *data) return 1; } -void ip_conntrack_flush(void) -{ - ip_ct_iterate_cleanup(kill_all, NULL); -} - static void free_conntrack_hash(struct list_head *hash, int vmalloced,int size) { if (vmalloced) @@ -1359,12 +1354,8 @@ static void free_conntrack_hash(struct list_head *hash, int vmalloced,int size) get_order(sizeof(struct list_head) * size)); } -/* Mishearing the voices in his head, our hero wonders how he's - supposed to kill the mall. */ -void ip_conntrack_cleanup(void) +void ip_conntrack_flush() { - ip_ct_attach = NULL; - /* This makes sure all current packets have passed through netfilter framework. Roll on, two-stage module delete... */ @@ -1372,7 +1363,7 @@ void ip_conntrack_cleanup(void) ip_ct_event_cache_flush(); i_see_dead_people: - ip_conntrack_flush(); + ip_ct_iterate_cleanup(kill_all, NULL); if (atomic_read(&ip_conntrack_count) != 0) { schedule(); goto i_see_dead_people; @@ -1380,7 +1371,14 @@ void ip_conntrack_cleanup(void) /* wait until all references to ip_conntrack_untracked are dropped */ while (atomic_read(&ip_conntrack_untracked.ct_general.use) > 1) schedule(); +} +/* Mishearing the voices in his head, our hero wonders how he's + supposed to kill the mall. */ +void ip_conntrack_cleanup(void) +{ + ip_ct_attach = NULL; + ip_conntrack_flush(); kmem_cache_destroy(ip_conntrack_cachep); kmem_cache_destroy(ip_conntrack_expect_cachep); free_conntrack_hash(ip_conntrack_hash, ip_conntrack_vmalloc, @@ -1410,7 +1408,7 @@ static struct list_head *alloc_hashtable(int size, int *vmalloced) return hash; } -static int set_hashsize(const char *val, struct kernel_param *kp) +int set_hashsize(const char *val, struct kernel_param *kp) { int i, bucket, hashsize, vmalloced; int old_vmalloced, old_size; diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_ftp.c b/trunk/net/ipv4/netfilter/ip_conntrack_ftp.c index 68b173bcda60..d77d6b3f5f80 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_ftp.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_ftp.c @@ -29,9 +29,9 @@ static char *ftp_buffer; static DEFINE_SPINLOCK(ip_ftp_lock); #define MAX_PORTS 8 -static unsigned short ports[MAX_PORTS]; +static short ports[MAX_PORTS]; static int ports_c; -module_param_array(ports, ushort, &ports_c, 0400); +module_param_array(ports, short, &ports_c, 0400); static int loose; module_param(loose, int, 0600); @@ -55,7 +55,7 @@ static int try_rfc959(const char *, size_t, u_int32_t [], char); static int try_eprt(const char *, size_t, u_int32_t [], char); static int try_epsv_response(const char *, size_t, u_int32_t [], char); -static const struct ftp_search { +static struct ftp_search { enum ip_conntrack_dir dir; const char *pattern; size_t plen; diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_irc.c b/trunk/net/ipv4/netfilter/ip_conntrack_irc.c index d7c40421d0d1..15457415a4f3 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_irc.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_irc.c @@ -34,7 +34,7 @@ #include #define MAX_PORTS 8 -static unsigned short ports[MAX_PORTS]; +static short ports[MAX_PORTS]; static int ports_c; static int max_dcc_channels = 8; static unsigned int dcc_timeout = 300; @@ -52,14 +52,14 @@ EXPORT_SYMBOL_GPL(ip_nat_irc_hook); MODULE_AUTHOR("Harald Welte "); MODULE_DESCRIPTION("IRC (DCC) connection tracking helper"); MODULE_LICENSE("GPL"); -module_param_array(ports, ushort, &ports_c, 0400); +module_param_array(ports, short, &ports_c, 0400); MODULE_PARM_DESC(ports, "port numbers of IRC servers"); module_param(max_dcc_channels, int, 0400); MODULE_PARM_DESC(max_dcc_channels, "max number of expected DCC channels per IRC session"); module_param(dcc_timeout, int, 0400); MODULE_PARM_DESC(dcc_timeout, "timeout on for unestablished DCC channels"); -static const char *dccprotos[] = { "SEND ", "CHAT ", "MOVE ", "TSEND ", "SCHAT " }; +static char *dccprotos[] = { "SEND ", "CHAT ", "MOVE ", "TSEND ", "SCHAT " }; #define MINMATCHLEN 5 #if 0 diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c b/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c index 91fe8f2e38ff..d2a4fec22862 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -60,13 +59,11 @@ ctnetlink_dump_tuples_proto(struct sk_buff *skb, NFA_PUT(skb, CTA_PROTO_NUM, sizeof(u_int8_t), &tuple->dst.protonum); - /* If no protocol helper is found, this function will return the - * generic protocol helper, so proto won't *ever* be NULL */ proto = ip_conntrack_proto_find_get(tuple->dst.protonum); - if (likely(proto->tuple_to_nfattr)) + if (likely(proto && proto->tuple_to_nfattr)) { ret = proto->tuple_to_nfattr(skb, tuple); - - ip_conntrack_proto_put(proto); + ip_conntrack_proto_put(proto); + } return ret; @@ -131,11 +128,9 @@ ctnetlink_dump_protoinfo(struct sk_buff *skb, const struct ip_conntrack *ct) struct nfattr *nest_proto; int ret; - - if (!proto->to_nfattr) { - ip_conntrack_proto_put(proto); + + if (!proto || !proto->to_nfattr) return 0; - } nest_proto = NFA_NEST(skb, CTA_PROTOINFO); @@ -472,7 +467,7 @@ ctnetlink_dump_table_w(struct sk_buff *skb, struct netlink_callback *cb) } #endif -static const size_t cta_min_ip[CTA_IP_MAX] = { +static const int cta_min_ip[CTA_IP_MAX] = { [CTA_IP_V4_SRC-1] = sizeof(u_int32_t), [CTA_IP_V4_DST-1] = sizeof(u_int32_t), }; @@ -502,8 +497,8 @@ ctnetlink_parse_tuple_ip(struct nfattr *attr, struct ip_conntrack_tuple *tuple) return 0; } -static const size_t cta_min_proto[CTA_PROTO_MAX] = { - [CTA_PROTO_NUM-1] = sizeof(u_int8_t), +static const int cta_min_proto[CTA_PROTO_MAX] = { + [CTA_PROTO_NUM-1] = sizeof(u_int16_t), [CTA_PROTO_SRC_PORT-1] = sizeof(u_int16_t), [CTA_PROTO_DST_PORT-1] = sizeof(u_int16_t), [CTA_PROTO_ICMP_TYPE-1] = sizeof(u_int8_t), @@ -528,14 +523,14 @@ ctnetlink_parse_tuple_proto(struct nfattr *attr, if (!tb[CTA_PROTO_NUM-1]) return -EINVAL; - tuple->dst.protonum = *(u_int8_t *)NFA_DATA(tb[CTA_PROTO_NUM-1]); + tuple->dst.protonum = *(u_int16_t *)NFA_DATA(tb[CTA_PROTO_NUM-1]); proto = ip_conntrack_proto_find_get(tuple->dst.protonum); - if (likely(proto->nfattr_to_tuple)) + if (likely(proto && proto->nfattr_to_tuple)) { ret = proto->nfattr_to_tuple(tb, tuple); - - ip_conntrack_proto_put(proto); + ip_conntrack_proto_put(proto); + } return ret; } @@ -581,7 +576,7 @@ ctnetlink_parse_tuple(struct nfattr *cda[], struct ip_conntrack_tuple *tuple, } #ifdef CONFIG_IP_NF_NAT_NEEDED -static const size_t cta_min_protonat[CTA_PROTONAT_MAX] = { +static const int cta_min_protonat[CTA_PROTONAT_MAX] = { [CTA_PROTONAT_PORT_MIN-1] = sizeof(u_int16_t), [CTA_PROTONAT_PORT_MAX-1] = sizeof(u_int16_t), }; @@ -601,6 +596,8 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr, return -EINVAL; npt = ip_nat_proto_find_get(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum); + if (!npt) + return 0; if (!npt->nfattr_to_range) { ip_nat_proto_put(npt); @@ -617,11 +614,6 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr, return 0; } -static const size_t cta_min_nat[CTA_NAT_MAX] = { - [CTA_NAT_MINIP-1] = sizeof(u_int32_t), - [CTA_NAT_MAXIP-1] = sizeof(u_int32_t), -}; - static inline int ctnetlink_parse_nat(struct nfattr *cda[], const struct ip_conntrack *ct, struct ip_nat_range *range) @@ -635,9 +627,6 @@ ctnetlink_parse_nat(struct nfattr *cda[], nfattr_parse_nested(tb, CTA_NAT_MAX, cda[CTA_NAT-1]); - if (nfattr_bad_size(tb, CTA_NAT_MAX, cta_min_nat)) - return -EINVAL; - if (tb[CTA_NAT_MINIP-1]) range->min_ip = *(u_int32_t *)NFA_DATA(tb[CTA_NAT_MINIP-1]); @@ -678,14 +667,6 @@ ctnetlink_parse_help(struct nfattr *attr, char **helper_name) return 0; } -static const size_t cta_min[CTA_MAX] = { - [CTA_STATUS-1] = sizeof(u_int32_t), - [CTA_TIMEOUT-1] = sizeof(u_int32_t), - [CTA_MARK-1] = sizeof(u_int32_t), - [CTA_USE-1] = sizeof(u_int32_t), - [CTA_ID-1] = sizeof(u_int32_t) -}; - static int ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb, struct nlmsghdr *nlh, struct nfattr *cda[], int *errp) @@ -697,9 +678,6 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb, DEBUGP("entered %s\n", __FUNCTION__); - if (nfattr_bad_size(cda, CTA_MAX, cta_min)) - return -EINVAL; - if (cda[CTA_TUPLE_ORIG-1]) err = ctnetlink_parse_tuple(cda, &tuple, CTA_TUPLE_ORIG); else if (cda[CTA_TUPLE_REPLY-1]) @@ -728,9 +706,11 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb, return -ENOENT; } } - if (del_timer(&ct->timeout)) + if (del_timer(&ct->timeout)) { + ip_conntrack_put(ct); ct->timeout.function((unsigned long)ct); - + return 0; + } ip_conntrack_put(ct); DEBUGP("leaving\n"); @@ -780,9 +760,6 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb, return 0; } - if (nfattr_bad_size(cda, CTA_MAX, cta_min)) - return -EINVAL; - if (cda[CTA_TUPLE_ORIG-1]) err = ctnetlink_parse_tuple(cda, &tuple, CTA_TUPLE_ORIG); else if (cda[CTA_TUPLE_REPLY-1]) @@ -875,7 +852,7 @@ ctnetlink_change_status(struct ip_conntrack *ct, struct nfattr *cda[]) DEBUGP("NAT status: %lu\n", status & (IPS_NAT_MASK | IPS_NAT_DONE_MASK)); - if (ip_nat_initialized(ct, HOOK2MANIP(hooknum))) + if (ip_nat_initialized(ct, hooknum)) return -EEXIST; ip_nat_setup_info(ct, &range, hooknum); @@ -958,6 +935,8 @@ ctnetlink_change_protoinfo(struct ip_conntrack *ct, struct nfattr *cda[]) nfattr_parse_nested(tb, CTA_PROTOINFO_MAX, attr); proto = ip_conntrack_proto_find_get(npt); + if (!proto) + return -EINVAL; if (proto->from_nfattr) err = proto->from_nfattr(tb, ct); @@ -1068,9 +1047,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, DEBUGP("entered %s\n", __FUNCTION__); - if (nfattr_bad_size(cda, CTA_MAX, cta_min)) - return -EINVAL; - if (cda[CTA_TUPLE_ORIG-1]) { err = ctnetlink_parse_tuple(cda, &otuple, CTA_TUPLE_ORIG); if (err < 0) @@ -1276,11 +1252,6 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb) return skb->len; } -static const size_t cta_min_exp[CTA_EXPECT_MAX] = { - [CTA_EXPECT_TIMEOUT-1] = sizeof(u_int32_t), - [CTA_EXPECT_ID-1] = sizeof(u_int32_t) -}; - static int ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb, struct nlmsghdr *nlh, struct nfattr *cda[], int *errp) @@ -1292,9 +1263,6 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb, DEBUGP("entered %s\n", __FUNCTION__); - if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp)) - return -EINVAL; - if (nlh->nlmsg_flags & NLM_F_DUMP) { struct nfgenmsg *msg = NLMSG_DATA(nlh); u32 rlen; @@ -1365,9 +1333,6 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb, struct ip_conntrack_helper *h; int err; - if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp)) - return -EINVAL; - if (cda[CTA_EXPECT_TUPLE-1]) { /* delete a single expect by tuple */ err = ctnetlink_parse_tuple(cda, &tuple, CTA_EXPECT_TUPLE); @@ -1497,9 +1462,6 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb, DEBUGP("entered %s\n", __FUNCTION__); - if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp)) - return -EINVAL; - if (!cda[CTA_EXPECT_TUPLE-1] || !cda[CTA_EXPECT_MASK-1] || !cda[CTA_EXPECT_MASTER-1]) @@ -1542,22 +1504,29 @@ static struct notifier_block ctnl_notifier_exp = { static struct nfnl_callback ctnl_cb[IPCTNL_MSG_MAX] = { [IPCTNL_MSG_CT_NEW] = { .call = ctnetlink_new_conntrack, - .attr_count = CTA_MAX, }, + .attr_count = CTA_MAX, + .cap_required = CAP_NET_ADMIN }, [IPCTNL_MSG_CT_GET] = { .call = ctnetlink_get_conntrack, - .attr_count = CTA_MAX, }, + .attr_count = CTA_MAX, + .cap_required = CAP_NET_ADMIN }, [IPCTNL_MSG_CT_DELETE] = { .call = ctnetlink_del_conntrack, - .attr_count = CTA_MAX, }, + .attr_count = CTA_MAX, + .cap_required = CAP_NET_ADMIN }, [IPCTNL_MSG_CT_GET_CTRZERO] = { .call = ctnetlink_get_conntrack, - .attr_count = CTA_MAX, }, + .attr_count = CTA_MAX, + .cap_required = CAP_NET_ADMIN }, }; static struct nfnl_callback ctnl_exp_cb[IPCTNL_MSG_EXP_MAX] = { [IPCTNL_MSG_EXP_GET] = { .call = ctnetlink_get_expect, - .attr_count = CTA_EXPECT_MAX, }, + .attr_count = CTA_EXPECT_MAX, + .cap_required = CAP_NET_ADMIN }, [IPCTNL_MSG_EXP_NEW] = { .call = ctnetlink_new_expect, - .attr_count = CTA_EXPECT_MAX, }, + .attr_count = CTA_EXPECT_MAX, + .cap_required = CAP_NET_ADMIN }, [IPCTNL_MSG_EXP_DELETE] = { .call = ctnetlink_del_expect, - .attr_count = CTA_EXPECT_MAX, }, + .attr_count = CTA_EXPECT_MAX, + .cap_required = CAP_NET_ADMIN }, }; static struct nfnetlink_subsystem ctnl_subsys = { diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_proto_gre.c b/trunk/net/ipv4/netfilter/ip_conntrack_proto_gre.c index 57956dee60c8..744abb9d377a 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_proto_gre.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_proto_gre.c @@ -31,7 +31,6 @@ #include #include #include -#include static DEFINE_RWLOCK(ip_ct_gre_lock); #define ASSERT_READ_LOCK(x) diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_proto_icmp.c b/trunk/net/ipv4/netfilter/ip_conntrack_proto_icmp.c index 5f9925db608e..e4d6b268e8c4 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_proto_icmp.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_proto_icmp.c @@ -51,7 +51,7 @@ static int icmp_invert_tuple(struct ip_conntrack_tuple *tuple, const struct ip_conntrack_tuple *orig) { /* Add 1; spaces filled with 0. */ - static const u_int8_t invmap[] + static u_int8_t invmap[] = { [ICMP_ECHO] = ICMP_ECHOREPLY + 1, [ICMP_ECHOREPLY] = ICMP_ECHO + 1, [ICMP_TIMESTAMP] = ICMP_TIMESTAMPREPLY + 1, @@ -110,7 +110,7 @@ static int icmp_packet(struct ip_conntrack *ct, return NF_ACCEPT; } -static const u_int8_t valid_new[] = { +static u_int8_t valid_new[] = { [ICMP_ECHO] = 1, [ICMP_TIMESTAMP] = 1, [ICMP_INFO_REQUEST] = 1, diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_proto_sctp.c b/trunk/net/ipv4/netfilter/ip_conntrack_proto_sctp.c index 977fb59d4563..59a4a0111dd3 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_proto_sctp.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_proto_sctp.c @@ -65,7 +65,7 @@ static unsigned long ip_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000; static unsigned long ip_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000; static unsigned long ip_ct_sctp_timeout_shutdown_ack_sent = 3 SECS; -static const unsigned long * sctp_timeouts[] +static unsigned long * sctp_timeouts[] = { NULL, /* SCTP_CONNTRACK_NONE */ &ip_ct_sctp_timeout_closed, /* SCTP_CONNTRACK_CLOSED */ &ip_ct_sctp_timeout_cookie_wait, /* SCTP_CONNTRACK_COOKIE_WAIT */ @@ -118,7 +118,7 @@ cookie echoed to closed. */ /* SCTP conntrack state transitions */ -static const enum sctp_conntrack sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = { +static enum sctp_conntrack sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = { { /* ORIGINAL */ /* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA */ diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/trunk/net/ipv4/netfilter/ip_conntrack_proto_tcp.c index e7fa29e576dc..5b3f5220f289 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_proto_tcp.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_proto_tcp.c @@ -99,7 +99,7 @@ unsigned long ip_ct_tcp_timeout_close = 10 SECS; to ~13-30min depending on RTO. */ unsigned long ip_ct_tcp_timeout_max_retrans = 5 MINS; -static const unsigned long * tcp_timeouts[] +static unsigned long * tcp_timeouts[] = { NULL, /* TCP_CONNTRACK_NONE */ &ip_ct_tcp_timeout_syn_sent, /* TCP_CONNTRACK_SYN_SENT, */ &ip_ct_tcp_timeout_syn_recv, /* TCP_CONNTRACK_SYN_RECV, */ @@ -170,7 +170,7 @@ enum tcp_bit_set { * if they are invalid * or we do not support the request (simultaneous open) */ -static const enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = { +static enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = { { /* ORIGINAL */ /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */ @@ -272,9 +272,9 @@ static const enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = { * sCL -> sCL */ /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */ -/*ack*/ { sIV, sIG, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV }, +/*ack*/ { sIV, sIV, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV }, /* - * sSS -> sIG Might be a half-open connection. + * sSS -> sIV Might be a half-open connection. * sSR -> sSR Might answer late resent SYN. * sES -> sES :-) * sFW -> sCW Normal close request answered by ACK. @@ -341,10 +341,9 @@ static int tcp_print_conntrack(struct seq_file *s, static int tcp_to_nfattr(struct sk_buff *skb, struct nfattr *nfa, const struct ip_conntrack *ct) { - struct nfattr *nest_parms; + struct nfattr *nest_parms = NFA_NEST(skb, CTA_PROTOINFO_TCP); read_lock_bh(&tcp_lock); - nest_parms = NFA_NEST(skb, CTA_PROTOINFO_TCP); NFA_PUT(skb, CTA_PROTOINFO_TCP_STATE, sizeof(u_int8_t), &ct->proto.tcp.state); read_unlock_bh(&tcp_lock); @@ -358,10 +357,6 @@ static int tcp_to_nfattr(struct sk_buff *skb, struct nfattr *nfa, return -1; } -static const size_t cta_min_tcp[CTA_PROTOINFO_TCP_MAX] = { - [CTA_PROTOINFO_TCP_STATE-1] = sizeof(u_int8_t), -}; - static int nfattr_to_tcp(struct nfattr *cda[], struct ip_conntrack *ct) { struct nfattr *attr = cda[CTA_PROTOINFO_TCP-1]; @@ -374,9 +369,6 @@ static int nfattr_to_tcp(struct nfattr *cda[], struct ip_conntrack *ct) nfattr_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr); - if (nfattr_bad_size(tb, CTA_PROTOINFO_TCP_MAX, cta_min_tcp)) - return -EINVAL; - if (!tb[CTA_PROTOINFO_TCP_STATE-1]) return -EINVAL; @@ -818,7 +810,7 @@ void ip_conntrack_tcp_update(struct sk_buff *skb, #define TH_CWR 0x80 /* table of valid flag combinations - ECE and CWR are always valid */ -static const u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] = +static u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] = { [TH_SYN] = 1, [TH_SYN|TH_ACK] = 1, @@ -918,12 +910,8 @@ static int tcp_packet(struct ip_conntrack *conntrack, switch (new_state) { case TCP_CONNTRACK_IGNORE: - /* Ignored packets: - * - * a) SYN in ORIGINAL - * b) SYN/ACK in REPLY - * c) ACK in reply direction after initial SYN in original. - */ + /* Either SYN in ORIGINAL + * or SYN/ACK in REPLY. */ if (index == TCP_SYNACK_SET && conntrack->proto.tcp.last_index == TCP_SYN_SET && conntrack->proto.tcp.last_dir != dir @@ -990,20 +978,13 @@ static int tcp_packet(struct ip_conntrack *conntrack, } case TCP_CONNTRACK_CLOSE: if (index == TCP_RST_SET - && ((test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status) - && conntrack->proto.tcp.last_index == TCP_SYN_SET) - || (!test_bit(IPS_ASSURED_BIT, &conntrack->status) - && conntrack->proto.tcp.last_index == TCP_ACK_SET)) + && test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status) + && conntrack->proto.tcp.last_index == TCP_SYN_SET && ntohl(th->ack_seq) == conntrack->proto.tcp.last_end) { - /* RST sent to invalid SYN or ACK we had let trough - * at a) and c) above: - * - * a) SYN was in window then - * c) we hold a half-open connection. - * - * Delete our connection entry. + /* RST sent to invalid SYN we had let trough + * SYN was in window then, tear down connection. * We skip window checking, because packet might ACK - * segments we ignored. */ + * segments we ignored in the SYN. */ goto in_window; } /* Just fall trough */ diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_proto_udp.c b/trunk/net/ipv4/netfilter/ip_conntrack_proto_udp.c index 46becbe4fe58..f2dcac7c7660 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_proto_udp.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_proto_udp.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_standalone.c b/trunk/net/ipv4/netfilter/ip_conntrack_standalone.c index a88bcc551244..dd476b191f4b 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_standalone.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_standalone.c @@ -27,7 +27,6 @@ #endif #include #include -#include #define ASSERT_READ_LOCK(x) #define ASSERT_WRITE_LOCK(x) diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_tftp.c b/trunk/net/ipv4/netfilter/ip_conntrack_tftp.c index d3c5a371f993..a78736b8525d 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_tftp.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_tftp.c @@ -26,9 +26,9 @@ MODULE_DESCRIPTION("tftp connection tracking helper"); MODULE_LICENSE("GPL"); #define MAX_PORTS 8 -static unsigned short ports[MAX_PORTS]; +static short ports[MAX_PORTS]; static int ports_c; -module_param_array(ports, ushort, &ports_c, 0400); +module_param_array(ports, short, &ports_c, 0400); MODULE_PARM_DESC(ports, "port numbers of tftp servers"); #if 0 diff --git a/trunk/net/ipv4/netfilter/ip_nat_core.c b/trunk/net/ipv4/netfilter/ip_nat_core.c index c1a61462507f..762f4d93936b 100644 --- a/trunk/net/ipv4/netfilter/ip_nat_core.c +++ b/trunk/net/ipv4/netfilter/ip_nat_core.c @@ -49,7 +49,7 @@ static unsigned int ip_nat_htable_size; static struct list_head *bysource; #define MAX_IP_NAT_PROTO 256 -static struct ip_nat_protocol *ip_nat_protos[MAX_IP_NAT_PROTO]; +struct ip_nat_protocol *ip_nat_protos[MAX_IP_NAT_PROTO]; static inline struct ip_nat_protocol * __ip_nat_proto_find(u_int8_t protonum) diff --git a/trunk/net/ipv4/netfilter/ip_nat_snmp_basic.c b/trunk/net/ipv4/netfilter/ip_nat_snmp_basic.c index 4f95d477805c..8acb7ed40b47 100644 --- a/trunk/net/ipv4/netfilter/ip_nat_snmp_basic.c +++ b/trunk/net/ipv4/netfilter/ip_nat_snmp_basic.c @@ -44,7 +44,6 @@ * */ #include -#include #include #include #include @@ -54,7 +53,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/net/ipv4/netfilter/ip_nat_tftp.c b/trunk/net/ipv4/netfilter/ip_nat_tftp.c index 43c3bd7c118e..2215317c76b7 100644 --- a/trunk/net/ipv4/netfilter/ip_nat_tftp.c +++ b/trunk/net/ipv4/netfilter/ip_nat_tftp.c @@ -42,10 +42,7 @@ static unsigned int help(struct sk_buff **pskb, enum ip_conntrack_info ctinfo, struct ip_conntrack_expect *exp) { - struct ip_conntrack *ct = exp->master; - - exp->saved_proto.udp.port - = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u.udp.port; + exp->saved_proto.udp.port = exp->tuple.dst.u.tcp.port; exp->dir = IP_CT_DIR_REPLY; exp->expectfn = ip_nat_follow_master; if (ip_conntrack_expect_related(exp) != 0) diff --git a/trunk/net/ipv4/netfilter/ip_tables.c b/trunk/net/ipv4/netfilter/ip_tables.c index 2a26d167e149..75c27e92f6ab 100644 --- a/trunk/net/ipv4/netfilter/ip_tables.c +++ b/trunk/net/ipv4/netfilter/ip_tables.c @@ -83,6 +83,11 @@ static DECLARE_MUTEX(ipt_mutex); context stops packets coming through and allows user context to read the counters or update the rules. + To be cache friendly on SMP, we arrange them like so: + [ n-entries ] + ... cache-align padding ... + [ n-entries ] + Hence the start of any table is given by get_table() below. */ /* The table itself */ @@ -100,15 +105,20 @@ struct ipt_table_info unsigned int underflow[NF_IP_NUMHOOKS]; /* ipt_entry tables: one per CPU */ - void *entries[NR_CPUS]; + char entries[0] ____cacheline_aligned; }; static LIST_HEAD(ipt_target); static LIST_HEAD(ipt_match); static LIST_HEAD(ipt_tables); -#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) #define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) +#ifdef CONFIG_SMP +#define TABLE_OFFSET(t,p) (SMP_ALIGN((t)->size)*(p)) +#else +#define TABLE_OFFSET(t,p) 0 +#endif + #if 0 #define down(x) do { printk("DOWN:%u:" #x "\n", __LINE__); down(x); } while(0) #define down_interruptible(x) ({ int __r; printk("DOWNi:%u:" #x "\n", __LINE__); __r = down_interruptible(x); if (__r != 0) printk("ABORT-DOWNi:%u\n", __LINE__); __r; }) @@ -280,7 +290,8 @@ ipt_do_table(struct sk_buff **pskb, read_lock_bh(&table->lock); IP_NF_ASSERT(table->valid_hooks & (1 << hook)); - table_base = (void *)table->private->entries[smp_processor_id()]; + table_base = (void *)table->private->entries + + TABLE_OFFSET(table->private, smp_processor_id()); e = get_entry(table_base, table->private->hook_entry[hook]); #ifdef CONFIG_NETFILTER_DEBUG @@ -552,8 +563,7 @@ unconditional(const struct ipt_ip *ip) /* Figures out from what hook each rule can be called: returns 0 if there are loops. Puts hook bitmask in comefrom. */ static int -mark_source_chains(struct ipt_table_info *newinfo, - unsigned int valid_hooks, void *entry0) +mark_source_chains(struct ipt_table_info *newinfo, unsigned int valid_hooks) { unsigned int hook; @@ -562,7 +572,7 @@ mark_source_chains(struct ipt_table_info *newinfo, for (hook = 0; hook < NF_IP_NUMHOOKS; hook++) { unsigned int pos = newinfo->hook_entry[hook]; struct ipt_entry *e - = (struct ipt_entry *)(entry0 + pos); + = (struct ipt_entry *)(newinfo->entries + pos); if (!(valid_hooks & (1 << hook))) continue; @@ -612,13 +622,13 @@ mark_source_chains(struct ipt_table_info *newinfo, goto next; e = (struct ipt_entry *) - (entry0 + pos); + (newinfo->entries + pos); } while (oldpos == pos + e->next_offset); /* Move along one */ size = e->next_offset; e = (struct ipt_entry *) - (entry0 + pos + size); + (newinfo->entries + pos + size); e->counters.pcnt = pos; pos += size; } else { @@ -635,7 +645,7 @@ mark_source_chains(struct ipt_table_info *newinfo, newpos = pos + e->next_offset; } e = (struct ipt_entry *) - (entry0 + newpos); + (newinfo->entries + newpos); e->counters.pcnt = pos; pos = newpos; } @@ -845,7 +855,6 @@ static int translate_table(const char *name, unsigned int valid_hooks, struct ipt_table_info *newinfo, - void *entry0, unsigned int size, unsigned int number, const unsigned int *hook_entries, @@ -866,11 +875,11 @@ translate_table(const char *name, duprintf("translate_table: size %u\n", newinfo->size); i = 0; /* Walk through entries, checking offsets. */ - ret = IPT_ENTRY_ITERATE(entry0, newinfo->size, + ret = IPT_ENTRY_ITERATE(newinfo->entries, newinfo->size, check_entry_size_and_hooks, newinfo, - entry0, - entry0 + size, + newinfo->entries, + newinfo->entries + size, hook_entries, underflows, &i); if (ret != 0) return ret; @@ -898,24 +907,27 @@ translate_table(const char *name, } } - if (!mark_source_chains(newinfo, valid_hooks, entry0)) + if (!mark_source_chains(newinfo, valid_hooks)) return -ELOOP; /* Finally, each sanity check must pass */ i = 0; - ret = IPT_ENTRY_ITERATE(entry0, newinfo->size, + ret = IPT_ENTRY_ITERATE(newinfo->entries, newinfo->size, check_entry, name, size, &i); if (ret != 0) { - IPT_ENTRY_ITERATE(entry0, newinfo->size, + IPT_ENTRY_ITERATE(newinfo->entries, newinfo->size, cleanup_entry, &i); return ret; } /* And one copy for every other CPU */ for_each_cpu(i) { - if (newinfo->entries[i] && newinfo->entries[i] != entry0) - memcpy(newinfo->entries[i], entry0, newinfo->size); + if (i == 0) + continue; + memcpy(newinfo->entries + SMP_ALIGN(newinfo->size) * i, + newinfo->entries, + SMP_ALIGN(newinfo->size)); } return ret; @@ -931,12 +943,15 @@ replace_table(struct ipt_table *table, #ifdef CONFIG_NETFILTER_DEBUG { - int cpu; + struct ipt_entry *table_base; + unsigned int i; - for_each_cpu(cpu) { - struct ipt_entry *table_base = newinfo->entries[cpu]; - if (table_base) - table_base->comefrom = 0xdead57ac; + for_each_cpu(i) { + table_base = + (void *)newinfo->entries + + TABLE_OFFSET(newinfo, i); + + table_base->comefrom = 0xdead57ac; } } #endif @@ -971,44 +986,16 @@ add_entry_to_counter(const struct ipt_entry *e, return 0; } -static inline int -set_entry_to_counter(const struct ipt_entry *e, - struct ipt_counters total[], - unsigned int *i) -{ - SET_COUNTER(total[*i], e->counters.bcnt, e->counters.pcnt); - - (*i)++; - return 0; -} - static void get_counters(const struct ipt_table_info *t, struct ipt_counters counters[]) { unsigned int cpu; unsigned int i; - unsigned int curcpu; - - /* Instead of clearing (by a previous call to memset()) - * the counters and using adds, we set the counters - * with data used by 'current' CPU - * We dont care about preemption here. - */ - curcpu = raw_smp_processor_id(); - - i = 0; - IPT_ENTRY_ITERATE(t->entries[curcpu], - t->size, - set_entry_to_counter, - counters, - &i); for_each_cpu(cpu) { - if (cpu == curcpu) - continue; i = 0; - IPT_ENTRY_ITERATE(t->entries[cpu], + IPT_ENTRY_ITERATE(t->entries + TABLE_OFFSET(t, cpu), t->size, add_entry_to_counter, counters, @@ -1025,29 +1012,24 @@ copy_entries_to_user(unsigned int total_size, struct ipt_entry *e; struct ipt_counters *counters; int ret = 0; - void *loc_cpu_entry; /* We need atomic snapshot of counters: rest doesn't change (other than comefrom, which userspace doesn't care about). */ countersize = sizeof(struct ipt_counters) * table->private->number; - counters = vmalloc_node(countersize, numa_node_id()); + counters = vmalloc(countersize); if (counters == NULL) return -ENOMEM; /* First, sum counters... */ + memset(counters, 0, countersize); write_lock_bh(&table->lock); get_counters(table->private, counters); write_unlock_bh(&table->lock); - /* choose the copy that is on our node/cpu, ... - * This choice is lazy (because current thread is - * allowed to migrate to another cpu) - */ - loc_cpu_entry = table->private->entries[raw_smp_processor_id()]; - /* ... then copy entire thing ... */ - if (copy_to_user(userptr, loc_cpu_entry, total_size) != 0) { + /* ... then copy entire thing from CPU 0... */ + if (copy_to_user(userptr, table->private->entries, total_size) != 0) { ret = -EFAULT; goto free_counters; } @@ -1059,7 +1041,7 @@ copy_entries_to_user(unsigned int total_size, struct ipt_entry_match *m; struct ipt_entry_target *t; - e = (struct ipt_entry *)(loc_cpu_entry + off); + e = (struct ipt_entry *)(table->private->entries + off); if (copy_to_user(userptr + off + offsetof(struct ipt_entry, counters), &counters[num], @@ -1128,45 +1110,6 @@ get_entries(const struct ipt_get_entries *entries, return ret; } -static void free_table_info(struct ipt_table_info *info) -{ - int cpu; - for_each_cpu(cpu) { - if (info->size <= PAGE_SIZE) - kfree(info->entries[cpu]); - else - vfree(info->entries[cpu]); - } - kfree(info); -} - -static struct ipt_table_info *alloc_table_info(unsigned int size) -{ - struct ipt_table_info *newinfo; - int cpu; - - newinfo = kzalloc(sizeof(struct ipt_table_info), GFP_KERNEL); - if (!newinfo) - return NULL; - - newinfo->size = size; - - for_each_cpu(cpu) { - if (size <= PAGE_SIZE) - newinfo->entries[cpu] = kmalloc_node(size, - GFP_KERNEL, - cpu_to_node(cpu)); - else - newinfo->entries[cpu] = vmalloc_node(size, cpu_to_node(cpu)); - if (newinfo->entries[cpu] == 0) { - free_table_info(newinfo); - return NULL; - } - } - - return newinfo; -} - static int do_replace(void __user *user, unsigned int len) { @@ -1175,7 +1118,6 @@ do_replace(void __user *user, unsigned int len) struct ipt_table *t; struct ipt_table_info *newinfo, *oldinfo; struct ipt_counters *counters; - void *loc_cpu_entry, *loc_cpu_old_entry; if (copy_from_user(&tmp, user, sizeof(tmp)) != 0) return -EFAULT; @@ -1188,13 +1130,13 @@ do_replace(void __user *user, unsigned int len) if ((SMP_ALIGN(tmp.size) >> PAGE_SHIFT) + 2 > num_physpages) return -ENOMEM; - newinfo = alloc_table_info(tmp.size); + newinfo = vmalloc(sizeof(struct ipt_table_info) + + SMP_ALIGN(tmp.size) * + (highest_possible_processor_id()+1)); if (!newinfo) return -ENOMEM; - /* choose the copy that is our node/cpu */ - loc_cpu_entry = newinfo->entries[raw_smp_processor_id()]; - if (copy_from_user(loc_cpu_entry, user + sizeof(tmp), + if (copy_from_user(newinfo->entries, user + sizeof(tmp), tmp.size) != 0) { ret = -EFAULT; goto free_newinfo; @@ -1205,9 +1147,10 @@ do_replace(void __user *user, unsigned int len) ret = -ENOMEM; goto free_newinfo; } + memset(counters, 0, tmp.num_counters * sizeof(struct ipt_counters)); ret = translate_table(tmp.name, tmp.valid_hooks, - newinfo, loc_cpu_entry, tmp.size, tmp.num_entries, + newinfo, tmp.size, tmp.num_entries, tmp.hook_entry, tmp.underflow); if (ret != 0) goto free_newinfo_counters; @@ -1246,9 +1189,8 @@ do_replace(void __user *user, unsigned int len) /* Get the old counters. */ get_counters(oldinfo, counters); /* Decrease module usage counts and free resource */ - loc_cpu_old_entry = oldinfo->entries[raw_smp_processor_id()]; - IPT_ENTRY_ITERATE(loc_cpu_old_entry, oldinfo->size, cleanup_entry,NULL); - free_table_info(oldinfo); + IPT_ENTRY_ITERATE(oldinfo->entries, oldinfo->size, cleanup_entry,NULL); + vfree(oldinfo); if (copy_to_user(tmp.counters, counters, sizeof(struct ipt_counters) * tmp.num_counters) != 0) ret = -EFAULT; @@ -1260,11 +1202,11 @@ do_replace(void __user *user, unsigned int len) module_put(t->me); up(&ipt_mutex); free_newinfo_counters_untrans: - IPT_ENTRY_ITERATE(loc_cpu_entry, newinfo->size, cleanup_entry,NULL); + IPT_ENTRY_ITERATE(newinfo->entries, newinfo->size, cleanup_entry,NULL); free_newinfo_counters: vfree(counters); free_newinfo: - free_table_info(newinfo); + vfree(newinfo); return ret; } @@ -1297,7 +1239,6 @@ do_add_counters(void __user *user, unsigned int len) struct ipt_counters_info tmp, *paddc; struct ipt_table *t; int ret = 0; - void *loc_cpu_entry; if (copy_from_user(&tmp, user, sizeof(tmp)) != 0) return -EFAULT; @@ -1305,7 +1246,7 @@ do_add_counters(void __user *user, unsigned int len) if (len != sizeof(tmp) + tmp.num_counters*sizeof(struct ipt_counters)) return -EINVAL; - paddc = vmalloc_node(len, numa_node_id()); + paddc = vmalloc(len); if (!paddc) return -ENOMEM; @@ -1327,9 +1268,7 @@ do_add_counters(void __user *user, unsigned int len) } i = 0; - /* Choose the copy that is on our node */ - loc_cpu_entry = t->private->entries[raw_smp_processor_id()]; - IPT_ENTRY_ITERATE(loc_cpu_entry, + IPT_ENTRY_ITERATE(t->private->entries, t->private->size, add_counter_to_entry, paddc->counters, @@ -1521,31 +1460,28 @@ int ipt_register_table(struct ipt_table *table, const struct ipt_replace *repl) struct ipt_table_info *newinfo; static struct ipt_table_info bootstrap = { 0, 0, 0, { 0 }, { 0 }, { } }; - void *loc_cpu_entry; - newinfo = alloc_table_info(repl->size); + newinfo = vmalloc(sizeof(struct ipt_table_info) + + SMP_ALIGN(repl->size) * + (highest_possible_processor_id()+1)); if (!newinfo) return -ENOMEM; - /* choose the copy on our node/cpu - * but dont care of preemption - */ - loc_cpu_entry = newinfo->entries[raw_smp_processor_id()]; - memcpy(loc_cpu_entry, repl->entries, repl->size); + memcpy(newinfo->entries, repl->entries, repl->size); ret = translate_table(table->name, table->valid_hooks, - newinfo, loc_cpu_entry, repl->size, + newinfo, repl->size, repl->num_entries, repl->hook_entry, repl->underflow); if (ret != 0) { - free_table_info(newinfo); + vfree(newinfo); return ret; } ret = down_interruptible(&ipt_mutex); if (ret != 0) { - free_table_info(newinfo); + vfree(newinfo); return ret; } @@ -1574,23 +1510,20 @@ int ipt_register_table(struct ipt_table *table, const struct ipt_replace *repl) return ret; free_unlock: - free_table_info(newinfo); + vfree(newinfo); goto unlock; } void ipt_unregister_table(struct ipt_table *table) { - void *loc_cpu_entry; - down(&ipt_mutex); LIST_DELETE(&ipt_tables, table); up(&ipt_mutex); /* Decrease module usage counts and free resources */ - loc_cpu_entry = table->private->entries[raw_smp_processor_id()]; - IPT_ENTRY_ITERATE(loc_cpu_entry, table->private->size, + IPT_ENTRY_ITERATE(table->private->entries, table->private->size, cleanup_entry, NULL); - free_table_info(table->private); + vfree(table->private); } /* Returns 1 if the port is matched by the range, 0 otherwise */ @@ -1959,7 +1892,7 @@ static int ipt_get_matches(char *buffer, char **start, off_t offset, int length) return pos; } -static const struct { char *name; get_info_t *get_info; } ipt_proc_entry[] = +static struct { char *name; get_info_t *get_info; } ipt_proc_entry[] = { { "ip_tables_names", ipt_get_tables }, { "ip_tables_targets", ipt_get_targets }, { "ip_tables_matches", ipt_get_matches }, diff --git a/trunk/net/ipv4/netfilter/ipt_LOG.c b/trunk/net/ipv4/netfilter/ipt_LOG.c index 30be0f1dae37..92ed050fac69 100644 --- a/trunk/net/ipv4/netfilter/ipt_LOG.c +++ b/trunk/net/ipv4/netfilter/ipt_LOG.c @@ -197,7 +197,7 @@ static void dump_packet(const struct nf_loginfo *info, } case IPPROTO_ICMP: { struct icmphdr _icmph, *ich; - static const size_t required_len[NR_ICMP_TYPES+1] + static size_t required_len[NR_ICMP_TYPES+1] = { [ICMP_ECHOREPLY] = 4, [ICMP_DEST_UNREACH] = 8 + sizeof(struct iphdr), @@ -351,7 +351,7 @@ static void dump_packet(const struct nf_loginfo *info, /* maxlen = 230+ 91 + 230 + 252 = 803 */ } -static struct nf_loginfo default_loginfo = { +struct nf_loginfo default_loginfo = { .type = NF_LOG_TYPE_LOG, .u = { .log = { diff --git a/trunk/net/ipv4/netfilter/ipt_MASQUERADE.c b/trunk/net/ipv4/netfilter/ipt_MASQUERADE.c index 27860510ca6d..275a174c6fe6 100644 --- a/trunk/net/ipv4/netfilter/ipt_MASQUERADE.c +++ b/trunk/net/ipv4/netfilter/ipt_MASQUERADE.c @@ -11,7 +11,6 @@ #include #include -#include #include #include #include @@ -19,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/net/ipv4/netfilter/ipt_physdev.c b/trunk/net/ipv4/netfilter/ipt_physdev.c index 03f554857a4d..1a53924041fc 100644 --- a/trunk/net/ipv4/netfilter/ipt_physdev.c +++ b/trunk/net/ipv4/netfilter/ipt_physdev.c @@ -9,7 +9,6 @@ */ #include -#include #include #include #include diff --git a/trunk/net/ipv4/netfilter/ipt_recent.c b/trunk/net/ipv4/netfilter/ipt_recent.c index 261cbb4d4c49..2d44b07688af 100644 --- a/trunk/net/ipv4/netfilter/ipt_recent.c +++ b/trunk/net/ipv4/netfilter/ipt_recent.c @@ -532,7 +532,6 @@ match(const struct sk_buff *skb, } if(info->seconds && info->hit_count) { for(pkt_count = 0, hits_found = 0; pkt_count < ip_pkt_list_tot; pkt_count++) { - if(r_list[location].last_pkts[pkt_count] == 0) break; if(time_before_eq(now,r_list[location].last_pkts[pkt_count]+info->seconds*HZ)) hits_found++; } if(hits_found >= info->hit_count) ans = !info->invert; else ans = info->invert; diff --git a/trunk/net/ipv4/proc.c b/trunk/net/ipv4/proc.c index 39d49dc333a7..a65e508fbd40 100644 --- a/trunk/net/ipv4/proc.c +++ b/trunk/net/ipv4/proc.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -99,7 +98,7 @@ fold_field(void *mib[], int offt) } /* snmp items */ -static const struct snmp_mib snmp4_ipstats_list[] = { +static struct snmp_mib snmp4_ipstats_list[] = { SNMP_MIB_ITEM("InReceives", IPSTATS_MIB_INRECEIVES), SNMP_MIB_ITEM("InHdrErrors", IPSTATS_MIB_INHDRERRORS), SNMP_MIB_ITEM("InAddrErrors", IPSTATS_MIB_INADDRERRORS), @@ -120,7 +119,7 @@ static const struct snmp_mib snmp4_ipstats_list[] = { SNMP_MIB_SENTINEL }; -static const struct snmp_mib snmp4_icmp_list[] = { +static struct snmp_mib snmp4_icmp_list[] = { SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS), SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS), SNMP_MIB_ITEM("InDestUnreachs", ICMP_MIB_INDESTUNREACHS), @@ -150,7 +149,7 @@ static const struct snmp_mib snmp4_icmp_list[] = { SNMP_MIB_SENTINEL }; -static const struct snmp_mib snmp4_tcp_list[] = { +static struct snmp_mib snmp4_tcp_list[] = { SNMP_MIB_ITEM("RtoAlgorithm", TCP_MIB_RTOALGORITHM), SNMP_MIB_ITEM("RtoMin", TCP_MIB_RTOMIN), SNMP_MIB_ITEM("RtoMax", TCP_MIB_RTOMAX), @@ -168,7 +167,7 @@ static const struct snmp_mib snmp4_tcp_list[] = { SNMP_MIB_SENTINEL }; -static const struct snmp_mib snmp4_udp_list[] = { +static struct snmp_mib snmp4_udp_list[] = { SNMP_MIB_ITEM("InDatagrams", UDP_MIB_INDATAGRAMS), SNMP_MIB_ITEM("NoPorts", UDP_MIB_NOPORTS), SNMP_MIB_ITEM("InErrors", UDP_MIB_INERRORS), @@ -176,7 +175,7 @@ static const struct snmp_mib snmp4_udp_list[] = { SNMP_MIB_SENTINEL }; -static const struct snmp_mib snmp4_net_list[] = { +static struct snmp_mib snmp4_net_list[] = { SNMP_MIB_ITEM("SyncookiesSent", LINUX_MIB_SYNCOOKIESSENT), SNMP_MIB_ITEM("SyncookiesRecv", LINUX_MIB_SYNCOOKIESRECV), SNMP_MIB_ITEM("SyncookiesFailed", LINUX_MIB_SYNCOOKIESFAILED), diff --git a/trunk/net/ipv4/route.c b/trunk/net/ipv4/route.c index f701a136a6ae..381dd6a6aebb 100644 --- a/trunk/net/ipv4/route.c +++ b/trunk/net/ipv4/route.c @@ -1371,7 +1371,7 @@ out: kfree_skb(skb); * are needed for AMPRnet AX.25 paths. */ -static const unsigned short mtu_plateau[] = +static unsigned short mtu_plateau[] = {32000, 17914, 8166, 4352, 2002, 1492, 576, 296, 216, 128 }; static __inline__ unsigned short guess_mtu(unsigned short old_mtu) @@ -3149,7 +3149,8 @@ int __init ip_rt_init(void) sizeof(struct rt_hash_bucket), rhash_entries, (num_physpages >= 128 * 1024) ? - 15 : 17, + (27 - PAGE_SHIFT) : + (29 - PAGE_SHIFT), HASH_HIGHMEM, &rt_hash_log, &rt_hash_mask, diff --git a/trunk/net/ipv4/syncookies.c b/trunk/net/ipv4/syncookies.c index e20be3331f67..a34e60ea48a1 100644 --- a/trunk/net/ipv4/syncookies.c +++ b/trunk/net/ipv4/syncookies.c @@ -173,10 +173,10 @@ static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb, struct request_sock *req, struct dst_entry *dst) { - struct inet_connection_sock *icsk = inet_csk(sk); + struct tcp_sock *tp = tcp_sk(sk); struct sock *child; - child = icsk->icsk_af_ops->syn_recv_sock(sk, skb, req, dst); + child = tp->af_specific->syn_recv_sock(sk, skb, req, dst); if (child) inet_csk_reqsk_queue_add(sk, req, child); else diff --git a/trunk/net/ipv4/sysctl_net_ipv4.c b/trunk/net/ipv4/sysctl_net_ipv4.c index 16984d4a8a06..01444a02b48b 100644 --- a/trunk/net/ipv4/sysctl_net_ipv4.c +++ b/trunk/net/ipv4/sysctl_net_ipv4.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -23,7 +22,6 @@ extern int sysctl_ip_nonlocal_bind; #ifdef CONFIG_SYSCTL -static int zero; static int tcp_retr1_max = 255; static int ip_local_port_range_min[] = { 1, 1 }; static int ip_local_port_range_max[] = { 65535, 65535 }; @@ -615,15 +613,6 @@ ctl_table ipv4_table[] = { .proc_handler = &proc_dointvec_jiffies, .strategy = &sysctl_jiffies }, - { - .ctl_name = NET_IPV4_IPFRAG_MAX_DIST, - .procname = "ipfrag_max_dist", - .data = &sysctl_ipfrag_max_dist, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &proc_dointvec_minmax, - .extra1 = &zero - }, { .ctl_name = NET_TCP_NO_METRICS_SAVE, .procname = "tcp_no_metrics_save", diff --git a/trunk/net/ipv4/tcp.c b/trunk/net/ipv4/tcp.c index 00aa80e93243..9ac7a4f46bd8 100644 --- a/trunk/net/ipv4/tcp.c +++ b/trunk/net/ipv4/tcp.c @@ -1413,7 +1413,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, * closed. */ -static const unsigned char new_state[16] = { +static unsigned char new_state[16] = { /* current state: new state: action: */ /* (Invalid) */ TCP_CLOSE, /* TCP_ESTABLISHED */ TCP_FIN_WAIT1 | TCP_ACTION_FIN, @@ -1696,8 +1696,8 @@ int tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int err = 0; if (level != SOL_TCP) - return icsk->icsk_af_ops->setsockopt(sk, level, optname, - optval, optlen); + return tp->af_specific->setsockopt(sk, level, optname, + optval, optlen); /* This is a string value all the others are int's */ if (optname == TCP_CONGESTION) { @@ -1914,7 +1914,7 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info) info->tcpi_last_data_recv = jiffies_to_msecs(now - icsk->icsk_ack.lrcvtime); info->tcpi_last_ack_recv = jiffies_to_msecs(now - tp->rcv_tstamp); - info->tcpi_pmtu = icsk->icsk_pmtu_cookie; + info->tcpi_pmtu = tp->pmtu_cookie; info->tcpi_rcv_ssthresh = tp->rcv_ssthresh; info->tcpi_rtt = jiffies_to_usecs(tp->srtt)>>3; info->tcpi_rttvar = jiffies_to_usecs(tp->mdev)>>2; @@ -1939,8 +1939,8 @@ int tcp_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int val, len; if (level != SOL_TCP) - return icsk->icsk_af_ops->getsockopt(sk, level, optname, - optval, optlen); + return tp->af_specific->getsockopt(sk, level, optname, + optval, optlen); if (get_user(len, optlen)) return -EFAULT; @@ -2065,7 +2065,8 @@ void __init tcp_init(void) sizeof(struct inet_ehash_bucket), thash_entries, (num_physpages >= 128 * 1024) ? - 13 : 15, + (25 - PAGE_SHIFT) : + (27 - PAGE_SHIFT), HASH_HIGHMEM, &tcp_hashinfo.ehash_size, NULL, @@ -2081,7 +2082,8 @@ void __init tcp_init(void) sizeof(struct inet_bind_hashbucket), tcp_hashinfo.ehash_size, (num_physpages >= 128 * 1024) ? - 13 : 15, + (25 - PAGE_SHIFT) : + (27 - PAGE_SHIFT), HASH_HIGHMEM, &tcp_hashinfo.bhash_size, NULL, diff --git a/trunk/net/ipv4/tcp_bic.c b/trunk/net/ipv4/tcp_bic.c index 035f2092d73a..1d0cd86621b1 100644 --- a/trunk/net/ipv4/tcp_bic.c +++ b/trunk/net/ipv4/tcp_bic.c @@ -30,6 +30,8 @@ static int fast_convergence = 1; static int max_increment = 16; static int low_window = 14; static int beta = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ +static int low_utilization_threshold = 153; +static int low_utilization_period = 2; static int initial_ssthresh = 100; static int smooth_part = 20; @@ -41,6 +43,10 @@ module_param(low_window, int, 0644); MODULE_PARM_DESC(low_window, "lower bound on congestion window (for TCP friendliness)"); module_param(beta, int, 0644); MODULE_PARM_DESC(beta, "beta for multiplicative increase"); +module_param(low_utilization_threshold, int, 0644); +MODULE_PARM_DESC(low_utilization_threshold, "percent (scaled by 1024) for low utilization mode"); +module_param(low_utilization_period, int, 0644); +MODULE_PARM_DESC(low_utilization_period, "if average delay exceeds then goto to low utilization mode (seconds)"); module_param(initial_ssthresh, int, 0644); MODULE_PARM_DESC(initial_ssthresh, "initial value of slow start threshold"); module_param(smooth_part, int, 0644); @@ -54,6 +60,11 @@ struct bictcp { u32 loss_cwnd; /* congestion window at last loss */ u32 last_cwnd; /* the last snd_cwnd */ u32 last_time; /* time when updated last_cwnd */ + u32 delay_min; /* min delay */ + u32 delay_max; /* max delay */ + u32 last_delay; + u8 low_utilization;/* 0: high; 1: low */ + u32 low_utilization_start; /* starting time of low utilization detection*/ u32 epoch_start; /* beginning of an epoch */ #define ACK_RATIO_SHIFT 4 u32 delayed_ack; /* estimate the ratio of Packets/ACKs << 4 */ @@ -66,6 +77,11 @@ static inline void bictcp_reset(struct bictcp *ca) ca->loss_cwnd = 0; ca->last_cwnd = 0; ca->last_time = 0; + ca->delay_min = 0; + ca->delay_max = 0; + ca->last_delay = 0; + ca->low_utilization = 0; + ca->low_utilization_start = 0; ca->epoch_start = 0; ca->delayed_ack = 2 << ACK_RATIO_SHIFT; } @@ -127,7 +143,8 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd) } /* if in slow start or link utilization is very low */ - if (ca->loss_cwnd == 0) { + if ( ca->loss_cwnd == 0 || + (cwnd > ca->loss_cwnd && ca->low_utilization)) { if (ca->cnt > 20) /* increase cwnd 5% per RTT */ ca->cnt = 20; } @@ -137,12 +154,69 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd) ca->cnt = 1; } + +/* Detect low utilization in congestion avoidance */ +static inline void bictcp_low_utilization(struct sock *sk, int flag) +{ + const struct tcp_sock *tp = tcp_sk(sk); + struct bictcp *ca = inet_csk_ca(sk); + u32 dist, delay; + + /* No time stamp */ + if (!(tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) || + /* Discard delay samples right after fast recovery */ + tcp_time_stamp < ca->epoch_start + HZ || + /* this delay samples may not be accurate */ + flag == 0) { + ca->last_delay = 0; + goto notlow; + } + + delay = ca->last_delay<<3; /* use the same scale as tp->srtt*/ + ca->last_delay = tcp_time_stamp - tp->rx_opt.rcv_tsecr; + if (delay == 0) /* no previous delay sample */ + goto notlow; + + /* first time call or link delay decreases */ + if (ca->delay_min == 0 || ca->delay_min > delay) { + ca->delay_min = ca->delay_max = delay; + goto notlow; + } + + if (ca->delay_max < delay) + ca->delay_max = delay; + + /* utilization is low, if avg delay < dist*threshold + for checking_period time */ + dist = ca->delay_max - ca->delay_min; + if (dist <= ca->delay_min>>6 || + tp->srtt - ca->delay_min >= (dist*low_utilization_threshold)>>10) + goto notlow; + + if (ca->low_utilization_start == 0) { + ca->low_utilization = 0; + ca->low_utilization_start = tcp_time_stamp; + } else if ((s32)(tcp_time_stamp - ca->low_utilization_start) + > low_utilization_period*HZ) { + ca->low_utilization = 1; + } + + return; + + notlow: + ca->low_utilization = 0; + ca->low_utilization_start = 0; + +} + static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 seq_rtt, u32 in_flight, int data_acked) { struct tcp_sock *tp = tcp_sk(sk); struct bictcp *ca = inet_csk_ca(sk); + bictcp_low_utilization(sk, data_acked); + if (!tcp_is_cwnd_limited(sk, in_flight)) return; @@ -175,6 +249,11 @@ static u32 bictcp_recalc_ssthresh(struct sock *sk) ca->epoch_start = 0; /* end of epoch */ + /* in case of wrong delay_max*/ + if (ca->delay_min > 0 && ca->delay_max > ca->delay_min) + ca->delay_max = ca->delay_min + + ((ca->delay_max - ca->delay_min)* 90) / 100; + /* Wmax and fast convergence */ if (tp->snd_cwnd < ca->last_max_cwnd && fast_convergence) ca->last_max_cwnd = (tp->snd_cwnd * (BICTCP_BETA_SCALE + beta)) @@ -210,14 +289,14 @@ static void bictcp_state(struct sock *sk, u8 new_state) bictcp_reset(inet_csk_ca(sk)); } -/* Track delayed acknowledgment ratio using sliding window +/* Track delayed acknowledgement ratio using sliding window * ratio = (15*ratio + sample) / 16 */ static void bictcp_acked(struct sock *sk, u32 cnt) { const struct inet_connection_sock *icsk = inet_csk(sk); - if (cnt > 0 && icsk->icsk_ca_state == TCP_CA_Open) { + if (cnt > 0 && icsk->icsk_ca_state == TCP_CA_Open) { struct bictcp *ca = inet_csk_ca(sk); cnt -= ca->delayed_ack >> ACK_RATIO_SHIFT; ca->delayed_ack += cnt; diff --git a/trunk/net/ipv4/tcp_cong.c b/trunk/net/ipv4/tcp_cong.c index e688c687d62d..c7cc62c8dc12 100644 --- a/trunk/net/ipv4/tcp_cong.c +++ b/trunk/net/ipv4/tcp_cong.c @@ -174,34 +174,6 @@ int tcp_set_congestion_control(struct sock *sk, const char *name) return err; } - -/* - * Linear increase during slow start - */ -void tcp_slow_start(struct tcp_sock *tp) -{ - if (sysctl_tcp_abc) { - /* RFC3465: Slow Start - * TCP sender SHOULD increase cwnd by the number of - * previously unacknowledged bytes ACKed by each incoming - * acknowledgment, provided the increase is not more than L - */ - if (tp->bytes_acked < tp->mss_cache) - return; - - /* We MAY increase by 2 if discovered delayed ack */ - if (sysctl_tcp_abc > 1 && tp->bytes_acked > 2*tp->mss_cache) { - if (tp->snd_cwnd < tp->snd_cwnd_clamp) - tp->snd_cwnd++; - } - } - tp->bytes_acked = 0; - - if (tp->snd_cwnd < tp->snd_cwnd_clamp) - tp->snd_cwnd++; -} -EXPORT_SYMBOL_GPL(tcp_slow_start); - /* * TCP Reno congestion control * This is special case used for fallback as well. diff --git a/trunk/net/ipv4/tcp_cubic.c b/trunk/net/ipv4/tcp_cubic.c deleted file mode 100644 index 31a4986dfbf7..000000000000 --- a/trunk/net/ipv4/tcp_cubic.c +++ /dev/null @@ -1,411 +0,0 @@ -/* - * TCP CUBIC: Binary Increase Congestion control for TCP v2.0 - * - * This is from the implementation of CUBIC TCP in - * Injong Rhee, Lisong Xu. - * "CUBIC: A New TCP-Friendly High-Speed TCP Variant - * in PFLDnet 2005 - * Available from: - * http://www.csc.ncsu.edu/faculty/rhee/export/bitcp/cubic-paper.pdf - * - * Unless CUBIC is enabled and congestion window is large - * this behaves the same as the original Reno. - */ - -#include -#include -#include -#include -#include - -#define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation - * max_cwnd = snd_cwnd * beta - */ -#define BICTCP_B 4 /* - * In binary search, - * go to point (max+min)/N - */ -#define BICTCP_HZ 10 /* BIC HZ 2^10 = 1024 */ - -static int fast_convergence = 1; -static int max_increment = 16; -static int beta = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ -static int initial_ssthresh = 100; -static int bic_scale = 41; -static int tcp_friendliness = 1; - -static u32 cube_rtt_scale; -static u32 beta_scale; -static u64 cube_factor; - -/* Note parameters that are used for precomputing scale factors are read-only */ -module_param(fast_convergence, int, 0644); -MODULE_PARM_DESC(fast_convergence, "turn on/off fast convergence"); -module_param(max_increment, int, 0644); -MODULE_PARM_DESC(max_increment, "Limit on increment allowed during binary search"); -module_param(beta, int, 0444); -MODULE_PARM_DESC(beta, "beta for multiplicative increase"); -module_param(initial_ssthresh, int, 0644); -MODULE_PARM_DESC(initial_ssthresh, "initial value of slow start threshold"); -module_param(bic_scale, int, 0444); -MODULE_PARM_DESC(bic_scale, "scale (scaled by 1024) value for bic function (bic_scale/1024)"); -module_param(tcp_friendliness, int, 0644); -MODULE_PARM_DESC(tcp_friendliness, "turn on/off tcp friendliness"); - -#include - -/* BIC TCP Parameters */ -struct bictcp { - u32 cnt; /* increase cwnd by 1 after ACKs */ - u32 last_max_cwnd; /* last maximum snd_cwnd */ - u32 loss_cwnd; /* congestion window at last loss */ - u32 last_cwnd; /* the last snd_cwnd */ - u32 last_time; /* time when updated last_cwnd */ - u32 bic_origin_point;/* origin point of bic function */ - u32 bic_K; /* time to origin point from the beginning of the current epoch */ - u32 delay_min; /* min delay */ - u32 epoch_start; /* beginning of an epoch */ - u32 ack_cnt; /* number of acks */ - u32 tcp_cwnd; /* estimated tcp cwnd */ -#define ACK_RATIO_SHIFT 4 - u32 delayed_ack; /* estimate the ratio of Packets/ACKs << 4 */ -}; - -static inline void bictcp_reset(struct bictcp *ca) -{ - ca->cnt = 0; - ca->last_max_cwnd = 0; - ca->loss_cwnd = 0; - ca->last_cwnd = 0; - ca->last_time = 0; - ca->bic_origin_point = 0; - ca->bic_K = 0; - ca->delay_min = 0; - ca->epoch_start = 0; - ca->delayed_ack = 2 << ACK_RATIO_SHIFT; - ca->ack_cnt = 0; - ca->tcp_cwnd = 0; -} - -static void bictcp_init(struct sock *sk) -{ - bictcp_reset(inet_csk_ca(sk)); - if (initial_ssthresh) - tcp_sk(sk)->snd_ssthresh = initial_ssthresh; -} - -/* 64bit divisor, dividend and result. dynamic precision */ -static inline u_int64_t div64_64(u_int64_t dividend, u_int64_t divisor) -{ - u_int32_t d = divisor; - - if (divisor > 0xffffffffULL) { - unsigned int shift = fls(divisor >> 32); - - d = divisor >> shift; - dividend >>= shift; - } - - /* avoid 64 bit division if possible */ - if (dividend >> 32) - do_div(dividend, d); - else - dividend = (uint32_t) dividend / d; - - return dividend; -} - -/* - * calculate the cubic root of x using Newton-Raphson - */ -static u32 cubic_root(u64 a) -{ - u32 x, x1; - - /* Initial estimate is based on: - * cbrt(x) = exp(log(x) / 3) - */ - x = 1u << (fls64(a)/3); - - /* - * Iteration based on: - * 2 - * x = ( 2 * x + a / x ) / 3 - * k+1 k k - */ - do { - x1 = x; - x = (2 * x + (uint32_t) div64_64(a, x*x)) / 3; - } while (abs(x1 - x) > 1); - - return x; -} - -/* - * Compute congestion window to use. - */ -static inline void bictcp_update(struct bictcp *ca, u32 cwnd) -{ - u64 offs; - u32 delta, t, bic_target, min_cnt, max_cnt; - - ca->ack_cnt++; /* count the number of ACKs */ - - if (ca->last_cwnd == cwnd && - (s32)(tcp_time_stamp - ca->last_time) <= HZ / 32) - return; - - ca->last_cwnd = cwnd; - ca->last_time = tcp_time_stamp; - - if (ca->epoch_start == 0) { - ca->epoch_start = tcp_time_stamp; /* record the beginning of an epoch */ - ca->ack_cnt = 1; /* start counting */ - ca->tcp_cwnd = cwnd; /* syn with cubic */ - - if (ca->last_max_cwnd <= cwnd) { - ca->bic_K = 0; - ca->bic_origin_point = cwnd; - } else { - /* Compute new K based on - * (wmax-cwnd) * (srtt>>3 / HZ) / c * 2^(3*bictcp_HZ) - */ - ca->bic_K = cubic_root(cube_factor - * (ca->last_max_cwnd - cwnd)); - ca->bic_origin_point = ca->last_max_cwnd; - } - } - - /* cubic function - calc*/ - /* calculate c * time^3 / rtt, - * while considering overflow in calculation of time^3 - * (so time^3 is done by using 64 bit) - * and without the support of division of 64bit numbers - * (so all divisions are done by using 32 bit) - * also NOTE the unit of those veriables - * time = (t - K) / 2^bictcp_HZ - * c = bic_scale >> 10 - * rtt = (srtt >> 3) / HZ - * !!! The following code does not have overflow problems, - * if the cwnd < 1 million packets !!! - */ - - /* change the unit from HZ to bictcp_HZ */ - t = ((tcp_time_stamp + ca->delay_min - ca->epoch_start) - << BICTCP_HZ) / HZ; - - if (t < ca->bic_K) /* t - K */ - offs = ca->bic_K - t; - else - offs = t - ca->bic_K; - - /* c/rtt * (t-K)^3 */ - delta = (cube_rtt_scale * offs * offs * offs) >> (10+3*BICTCP_HZ); - if (t < ca->bic_K) /* below origin*/ - bic_target = ca->bic_origin_point - delta; - else /* above origin*/ - bic_target = ca->bic_origin_point + delta; - - /* cubic function - calc bictcp_cnt*/ - if (bic_target > cwnd) { - ca->cnt = cwnd / (bic_target - cwnd); - } else { - ca->cnt = 100 * cwnd; /* very small increment*/ - } - - if (ca->delay_min > 0) { - /* max increment = Smax * rtt / 0.1 */ - min_cnt = (cwnd * HZ * 8)/(10 * max_increment * ca->delay_min); - if (ca->cnt < min_cnt) - ca->cnt = min_cnt; - } - - /* slow start and low utilization */ - if (ca->loss_cwnd == 0) /* could be aggressive in slow start */ - ca->cnt = 50; - - /* TCP Friendly */ - if (tcp_friendliness) { - u32 scale = beta_scale; - delta = (cwnd * scale) >> 3; - while (ca->ack_cnt > delta) { /* update tcp cwnd */ - ca->ack_cnt -= delta; - ca->tcp_cwnd++; - } - - if (ca->tcp_cwnd > cwnd){ /* if bic is slower than tcp */ - delta = ca->tcp_cwnd - cwnd; - max_cnt = cwnd / delta; - if (ca->cnt > max_cnt) - ca->cnt = max_cnt; - } - } - - ca->cnt = (ca->cnt << ACK_RATIO_SHIFT) / ca->delayed_ack; - if (ca->cnt == 0) /* cannot be zero */ - ca->cnt = 1; -} - - -/* Keep track of minimum rtt */ -static inline void measure_delay(struct sock *sk) -{ - const struct tcp_sock *tp = tcp_sk(sk); - struct bictcp *ca = inet_csk_ca(sk); - u32 delay; - - /* No time stamp */ - if (!(tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) || - /* Discard delay samples right after fast recovery */ - (s32)(tcp_time_stamp - ca->epoch_start) < HZ) - return; - - delay = tcp_time_stamp - tp->rx_opt.rcv_tsecr; - if (delay == 0) - delay = 1; - - /* first time call or link delay decreases */ - if (ca->delay_min == 0 || ca->delay_min > delay) - ca->delay_min = delay; -} - -static void bictcp_cong_avoid(struct sock *sk, u32 ack, - u32 seq_rtt, u32 in_flight, int data_acked) -{ - struct tcp_sock *tp = tcp_sk(sk); - struct bictcp *ca = inet_csk_ca(sk); - - if (data_acked) - measure_delay(sk); - - if (!tcp_is_cwnd_limited(sk, in_flight)) - return; - - if (tp->snd_cwnd <= tp->snd_ssthresh) - tcp_slow_start(tp); - else { - bictcp_update(ca, tp->snd_cwnd); - - /* In dangerous area, increase slowly. - * In theory this is tp->snd_cwnd += 1 / tp->snd_cwnd - */ - if (tp->snd_cwnd_cnt >= ca->cnt) { - if (tp->snd_cwnd < tp->snd_cwnd_clamp) - tp->snd_cwnd++; - tp->snd_cwnd_cnt = 0; - } else - tp->snd_cwnd_cnt++; - } - -} - -static u32 bictcp_recalc_ssthresh(struct sock *sk) -{ - const struct tcp_sock *tp = tcp_sk(sk); - struct bictcp *ca = inet_csk_ca(sk); - - ca->epoch_start = 0; /* end of epoch */ - - /* Wmax and fast convergence */ - if (tp->snd_cwnd < ca->last_max_cwnd && fast_convergence) - ca->last_max_cwnd = (tp->snd_cwnd * (BICTCP_BETA_SCALE + beta)) - / (2 * BICTCP_BETA_SCALE); - else - ca->last_max_cwnd = tp->snd_cwnd; - - ca->loss_cwnd = tp->snd_cwnd; - - return max((tp->snd_cwnd * beta) / BICTCP_BETA_SCALE, 2U); -} - -static u32 bictcp_undo_cwnd(struct sock *sk) -{ - struct bictcp *ca = inet_csk_ca(sk); - - return max(tcp_sk(sk)->snd_cwnd, ca->last_max_cwnd); -} - -static u32 bictcp_min_cwnd(struct sock *sk) -{ - return tcp_sk(sk)->snd_ssthresh; -} - -static void bictcp_state(struct sock *sk, u8 new_state) -{ - if (new_state == TCP_CA_Loss) - bictcp_reset(inet_csk_ca(sk)); -} - -/* Track delayed acknowledgment ratio using sliding window - * ratio = (15*ratio + sample) / 16 - */ -static void bictcp_acked(struct sock *sk, u32 cnt) -{ - const struct inet_connection_sock *icsk = inet_csk(sk); - - if (cnt > 0 && icsk->icsk_ca_state == TCP_CA_Open) { - struct bictcp *ca = inet_csk_ca(sk); - cnt -= ca->delayed_ack >> ACK_RATIO_SHIFT; - ca->delayed_ack += cnt; - } -} - - -static struct tcp_congestion_ops cubictcp = { - .init = bictcp_init, - .ssthresh = bictcp_recalc_ssthresh, - .cong_avoid = bictcp_cong_avoid, - .set_state = bictcp_state, - .undo_cwnd = bictcp_undo_cwnd, - .min_cwnd = bictcp_min_cwnd, - .pkts_acked = bictcp_acked, - .owner = THIS_MODULE, - .name = "cubic", -}; - -static int __init cubictcp_register(void) -{ - BUG_ON(sizeof(struct bictcp) > ICSK_CA_PRIV_SIZE); - - /* Precompute a bunch of the scaling factors that are used per-packet - * based on SRTT of 100ms - */ - - beta_scale = 8*(BICTCP_BETA_SCALE+beta)/ 3 / (BICTCP_BETA_SCALE - beta); - - cube_rtt_scale = (bic_scale << 3) / 10; /* 1024*c/rtt */ - - /* calculate the "K" for (wmax-cwnd) = c/rtt * K^3 - * so K = cubic_root( (wmax-cwnd)*rtt/c ) - * the unit of K is bictcp_HZ=2^10, not HZ - * - * c = bic_scale >> 10 - * rtt = 100ms - * - * the following code has been designed and tested for - * cwnd < 1 million packets - * RTT < 100 seconds - * HZ < 1,000,00 (corresponding to 10 nano-second) - */ - - /* 1/c * 2^2*bictcp_HZ * srtt */ - cube_factor = 1ull << (10+3*BICTCP_HZ); /* 2^40 */ - - /* divide by bic_scale and by constant Srtt (100ms) */ - do_div(cube_factor, bic_scale * 10); - - return tcp_register_congestion_control(&cubictcp); -} - -static void __exit cubictcp_unregister(void) -{ - tcp_unregister_congestion_control(&cubictcp); -} - -module_init(cubictcp_register); -module_exit(cubictcp_unregister); - -MODULE_AUTHOR("Sangtae Ha, Stephen Hemminger"); -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("CUBIC TCP"); -MODULE_VERSION("2.0"); diff --git a/trunk/net/ipv4/tcp_highspeed.c b/trunk/net/ipv4/tcp_highspeed.c index 63cf7e540847..82b3c189bd7d 100644 --- a/trunk/net/ipv4/tcp_highspeed.c +++ b/trunk/net/ipv4/tcp_highspeed.c @@ -111,7 +111,7 @@ static void hstcp_init(struct sock *sk) } static void hstcp_cong_avoid(struct sock *sk, u32 adk, u32 rtt, - u32 in_flight, int data_acked) + u32 in_flight, u32 pkts_acked) { struct tcp_sock *tp = tcp_sk(sk); struct hstcp *ca = inet_csk_ca(sk); diff --git a/trunk/net/ipv4/tcp_input.c b/trunk/net/ipv4/tcp_input.c index 0a461232329f..40a26b7157b4 100644 --- a/trunk/net/ipv4/tcp_input.c +++ b/trunk/net/ipv4/tcp_input.c @@ -115,8 +115,8 @@ int sysctl_tcp_abc = 1; /* Adapt the MSS value used to make delayed ack decision to the * real world. */ -static void tcp_measure_rcv_mss(struct sock *sk, - const struct sk_buff *skb) +static inline void tcp_measure_rcv_mss(struct sock *sk, + const struct sk_buff *skb) { struct inet_connection_sock *icsk = inet_csk(sk); const unsigned int lss = icsk->icsk_ack.last_seg_size; @@ -246,8 +246,8 @@ static int __tcp_grow_window(const struct sock *sk, struct tcp_sock *tp, return 0; } -static void tcp_grow_window(struct sock *sk, struct tcp_sock *tp, - struct sk_buff *skb) +static inline void tcp_grow_window(struct sock *sk, struct tcp_sock *tp, + struct sk_buff *skb) { /* Check #1 */ if (tp->rcv_ssthresh < tp->window_clamp && @@ -341,26 +341,6 @@ static void tcp_clamp_window(struct sock *sk, struct tcp_sock *tp) tp->rcv_ssthresh = min(tp->window_clamp, 2U*tp->advmss); } - -/* Initialize RCV_MSS value. - * RCV_MSS is an our guess about MSS used by the peer. - * We haven't any direct information about the MSS. - * It's better to underestimate the RCV_MSS rather than overestimate. - * Overestimations make us ACKing less frequently than needed. - * Underestimations are more easy to detect and fix by tcp_measure_rcv_mss(). - */ -void tcp_initialize_rcv_mss(struct sock *sk) -{ - struct tcp_sock *tp = tcp_sk(sk); - unsigned int hint = min_t(unsigned int, tp->advmss, tp->mss_cache); - - hint = min(hint, tp->rcv_wnd/2); - hint = min(hint, TCP_MIN_RCVMSS); - hint = max(hint, TCP_MIN_MSS); - - inet_csk(sk)->icsk_ack.rcv_mss = hint; -} - /* Receiver "autotuning" code. * * The algorithm for RTT estimation w/o timestamps is based on @@ -387,7 +367,7 @@ static void tcp_rcv_rtt_update(struct tcp_sock *tp, u32 sample, int win_dep) * are stalled on filesystem I/O. * * Also, since we are only going for a minimum in the - * non-timestamp case, we do not smooth things out + * non-timestamp case, we do not smoother things out * else with timestamps disabled convergence takes too * long. */ @@ -566,7 +546,7 @@ static void tcp_rtt_estimator(struct sock *sk, const __u32 mrtt) * * Funny. This algorithm seems to be very broken. * These formulae increase RTO, when it should be decreased, increase - * too slowly, when it should be increased quickly, decrease too quickly + * too slowly, when it should be increased fastly, decrease too fastly * etc. I guess in BSD RTO takes ONE value, so that it is absolutely * does not matter how to _calculate_ it. Seems, it was trap * that VJ failed to avoid. 8) @@ -755,27 +735,6 @@ __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst) return min_t(__u32, cwnd, tp->snd_cwnd_clamp); } -/* Set slow start threshold and cwnd not falling to slow start */ -void tcp_enter_cwr(struct sock *sk) -{ - struct tcp_sock *tp = tcp_sk(sk); - - tp->prior_ssthresh = 0; - tp->bytes_acked = 0; - if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) { - tp->undo_marker = 0; - tp->snd_ssthresh = inet_csk(sk)->icsk_ca_ops->ssthresh(sk); - tp->snd_cwnd = min(tp->snd_cwnd, - tcp_packets_in_flight(tp) + 1U); - tp->snd_cwnd_cnt = 0; - tp->high_seq = tp->snd_nxt; - tp->snd_cwnd_stamp = tcp_time_stamp; - TCP_ECN_queue_cwr(tp); - - tcp_set_ca_state(sk, TCP_CA_CWR); - } -} - /* Initialize metrics on socket. */ static void tcp_init_metrics(struct sock *sk) @@ -2111,8 +2070,8 @@ static inline void tcp_ack_update_rtt(struct sock *sk, const int flag, tcp_ack_no_tstamp(sk, seq_rtt, flag); } -static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, - u32 in_flight, int good) +static inline void tcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, + u32 in_flight, int good) { const struct inet_connection_sock *icsk = inet_csk(sk); icsk->icsk_ca_ops->cong_avoid(sk, ack, rtt, in_flight, good); @@ -2123,7 +2082,7 @@ static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, * RFC2988 recommends to restart timer to now+rto. */ -static void tcp_ack_packets_out(struct sock *sk, struct tcp_sock *tp) +static inline void tcp_ack_packets_out(struct sock *sk, struct tcp_sock *tp) { if (!tp->packets_out) { inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS); @@ -2188,7 +2147,7 @@ static int tcp_tso_acked(struct sock *sk, struct sk_buff *skb, return acked; } -static u32 tcp_usrtt(const struct sk_buff *skb) +static inline u32 tcp_usrtt(const struct sk_buff *skb) { struct timeval tv, now; @@ -2383,7 +2342,7 @@ static int tcp_ack_update_window(struct sock *sk, struct tcp_sock *tp, if (nwin > tp->max_window) { tp->max_window = nwin; - tcp_sync_mss(sk, inet_csk(sk)->icsk_pmtu_cookie); + tcp_sync_mss(sk, tp->pmtu_cookie); } } } @@ -2624,8 +2583,8 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, /* Fast parse options. This hopes to only see timestamps. * If it is wrong it falls back on tcp_parse_options(). */ -static int tcp_fast_parse_options(struct sk_buff *skb, struct tcphdr *th, - struct tcp_sock *tp) +static inline int tcp_fast_parse_options(struct sk_buff *skb, struct tcphdr *th, + struct tcp_sock *tp) { if (th->doff == sizeof(struct tcphdr)>>2) { tp->rx_opt.saw_tstamp = 0; @@ -2845,7 +2804,8 @@ static void tcp_fin(struct sk_buff *skb, struct sock *sk, struct tcphdr *th) } } -static inline int tcp_sack_extend(struct tcp_sack_block *sp, u32 seq, u32 end_seq) +static __inline__ int +tcp_sack_extend(struct tcp_sack_block *sp, u32 seq, u32 end_seq) { if (!after(seq, sp->end_seq) && !after(sp->start_seq, end_seq)) { if (before(seq, sp->start_seq)) @@ -2857,7 +2817,7 @@ static inline int tcp_sack_extend(struct tcp_sack_block *sp, u32 seq, u32 end_se return 0; } -static void tcp_dsack_set(struct tcp_sock *tp, u32 seq, u32 end_seq) +static inline void tcp_dsack_set(struct tcp_sock *tp, u32 seq, u32 end_seq) { if (tp->rx_opt.sack_ok && sysctl_tcp_dsack) { if (before(seq, tp->rcv_nxt)) @@ -2872,7 +2832,7 @@ static void tcp_dsack_set(struct tcp_sock *tp, u32 seq, u32 end_seq) } } -static void tcp_dsack_extend(struct tcp_sock *tp, u32 seq, u32 end_seq) +static inline void tcp_dsack_extend(struct tcp_sock *tp, u32 seq, u32 end_seq) { if (!tp->rx_opt.dsack) tcp_dsack_set(tp, seq, end_seq); @@ -2930,7 +2890,7 @@ static void tcp_sack_maybe_coalesce(struct tcp_sock *tp) } } -static inline void tcp_sack_swap(struct tcp_sack_block *sack1, struct tcp_sack_block *sack2) +static __inline__ void tcp_sack_swap(struct tcp_sack_block *sack1, struct tcp_sack_block *sack2) { __u32 tmp; @@ -3495,7 +3455,7 @@ void tcp_cwnd_application_limited(struct sock *sk) tp->snd_cwnd_stamp = tcp_time_stamp; } -static int tcp_should_expand_sndbuf(struct sock *sk, struct tcp_sock *tp) +static inline int tcp_should_expand_sndbuf(struct sock *sk, struct tcp_sock *tp) { /* If the user specified a specific send buffer setting, do * not modify it. @@ -3542,7 +3502,7 @@ static void tcp_new_space(struct sock *sk) sk->sk_write_space(sk); } -static void tcp_check_space(struct sock *sk) +static inline void tcp_check_space(struct sock *sk) { if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) { sock_reset_flag(sk, SOCK_QUEUE_SHRUNK); @@ -3552,7 +3512,7 @@ static void tcp_check_space(struct sock *sk) } } -static inline void tcp_data_snd_check(struct sock *sk, struct tcp_sock *tp) +static __inline__ void tcp_data_snd_check(struct sock *sk, struct tcp_sock *tp) { tcp_push_pending_frames(sk, tp); tcp_check_space(sk); @@ -3584,7 +3544,7 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible) } } -static inline void tcp_ack_snd_check(struct sock *sk) +static __inline__ void tcp_ack_snd_check(struct sock *sk) { if (!inet_csk_ack_scheduled(sk)) { /* We sent a data segment already. */ @@ -3732,7 +3692,8 @@ static int __tcp_checksum_complete_user(struct sock *sk, struct sk_buff *skb) return result; } -static inline int tcp_checksum_complete_user(struct sock *sk, struct sk_buff *skb) +static __inline__ int +tcp_checksum_complete_user(struct sock *sk, struct sk_buff *skb) { return skb->ip_summed != CHECKSUM_UNNECESSARY && __tcp_checksum_complete_user(sk, skb); @@ -4006,12 +3967,12 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, struct tcphdr *th, unsigned len) { struct tcp_sock *tp = tcp_sk(sk); - struct inet_connection_sock *icsk = inet_csk(sk); int saved_clamp = tp->rx_opt.mss_clamp; tcp_parse_options(skb, &tp->rx_opt, 0); if (th->ack) { + struct inet_connection_sock *icsk; /* rfc793: * "If the state is SYN-SENT then * first check the ACK bit @@ -4100,7 +4061,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, if (tp->rx_opt.sack_ok && sysctl_tcp_fack) tp->rx_opt.sack_ok |= 2; - tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); + tcp_sync_mss(sk, tp->pmtu_cookie); tcp_initialize_rcv_mss(sk); /* Remember, tcp_poll() does not lock socket! @@ -4111,7 +4072,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, tcp_set_state(sk, TCP_ESTABLISHED); /* Make sure socket is routed, for correct metrics. */ - icsk->icsk_af_ops->rebuild_header(sk); + tp->af_specific->rebuild_header(sk); tcp_init_metrics(sk); @@ -4137,6 +4098,8 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, sk_wake_async(sk, 0, POLL_OUT); } + icsk = inet_csk(sk); + if (sk->sk_write_pending || icsk->icsk_accept_queue.rskq_defer_accept || icsk->icsk_ack.pingpong) { @@ -4210,7 +4173,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, if (tp->ecn_flags&TCP_ECN_OK) sock_set_flag(sk, SOCK_NO_LARGESEND); - tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); + tcp_sync_mss(sk, tp->pmtu_cookie); tcp_initialize_rcv_mss(sk); @@ -4257,7 +4220,6 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, struct tcphdr *th, unsigned len) { struct tcp_sock *tp = tcp_sk(sk); - struct inet_connection_sock *icsk = inet_csk(sk); int queued = 0; tp->rx_opt.saw_tstamp = 0; @@ -4274,7 +4236,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, goto discard; if(th->syn) { - if (icsk->icsk_af_ops->conn_request(sk, skb) < 0) + if(tp->af_specific->conn_request(sk, skb) < 0) return 1; /* Now we have several options: In theory there is @@ -4387,7 +4349,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, /* Make sure socket is routed, for * correct metrics. */ - icsk->icsk_af_ops->rebuild_header(sk); + tp->af_specific->rebuild_header(sk); tcp_init_metrics(sk); @@ -4513,4 +4475,3 @@ EXPORT_SYMBOL(sysctl_tcp_abc); EXPORT_SYMBOL(tcp_parse_options); EXPORT_SYMBOL(tcp_rcv_established); EXPORT_SYMBOL(tcp_rcv_state_process); -EXPORT_SYMBOL(tcp_initialize_rcv_mss); diff --git a/trunk/net/ipv4/tcp_ipv4.c b/trunk/net/ipv4/tcp_ipv4.c index e9f83e5b28ce..4d5021e1929b 100644 --- a/trunk/net/ipv4/tcp_ipv4.c +++ b/trunk/net/ipv4/tcp_ipv4.c @@ -69,7 +69,6 @@ #include #include #include -#include #include #include @@ -87,7 +86,8 @@ int sysctl_tcp_low_latency; /* Socket used for sending RSTs */ static struct socket *tcp_socket; -void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb); +void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len, + struct sk_buff *skb); struct inet_hashinfo __cacheline_aligned tcp_hashinfo = { .lhash_lock = RW_LOCK_UNLOCKED, @@ -97,8 +97,7 @@ struct inet_hashinfo __cacheline_aligned tcp_hashinfo = { static int tcp_v4_get_port(struct sock *sk, unsigned short snum) { - return inet_csk_get_port(&tcp_hashinfo, sk, snum, - inet_csk_bind_conflict); + return inet_csk_get_port(&tcp_hashinfo, sk, snum); } static void tcp_v4_hash(struct sock *sk) @@ -119,38 +118,202 @@ static inline __u32 tcp_v4_init_sequence(struct sock *sk, struct sk_buff *skb) skb->h.th->source); } -int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp) +/* called with local bh disabled */ +static int __tcp_v4_check_established(struct sock *sk, __u16 lport, + struct inet_timewait_sock **twp) { - const struct tcp_timewait_sock *tcptw = tcp_twsk(sktw); - struct tcp_sock *tp = tcp_sk(sk); + struct inet_sock *inet = inet_sk(sk); + u32 daddr = inet->rcv_saddr; + u32 saddr = inet->daddr; + int dif = sk->sk_bound_dev_if; + INET_ADDR_COOKIE(acookie, saddr, daddr) + const __u32 ports = INET_COMBINED_PORTS(inet->dport, lport); + unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet->dport); + struct inet_ehash_bucket *head = inet_ehash_bucket(&tcp_hashinfo, hash); + struct sock *sk2; + const struct hlist_node *node; + struct inet_timewait_sock *tw; - /* With PAWS, it is safe from the viewpoint - of data integrity. Even without PAWS it is safe provided sequence - spaces do not overlap i.e. at data rates <= 80Mbit/sec. + prefetch(head->chain.first); + write_lock(&head->lock); - Actually, the idea is close to VJ's one, only timestamp cache is - held not per host, but per port pair and TW bucket is used as state - holder. + /* Check TIME-WAIT sockets first. */ + sk_for_each(sk2, node, &(head + tcp_hashinfo.ehash_size)->chain) { + tw = inet_twsk(sk2); - If TW bucket has been already destroyed we fall back to VJ's scheme - and use initial timestamp retrieved from peer table. - */ - if (tcptw->tw_ts_recent_stamp && - (twp == NULL || (sysctl_tcp_tw_reuse && - xtime.tv_sec - tcptw->tw_ts_recent_stamp > 1))) { - tp->write_seq = tcptw->tw_snd_nxt + 65535 + 2; - if (tp->write_seq == 0) - tp->write_seq = 1; - tp->rx_opt.ts_recent = tcptw->tw_ts_recent; - tp->rx_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp; - sock_hold(sktw); - return 1; + if (INET_TW_MATCH(sk2, hash, acookie, saddr, daddr, ports, dif)) { + const struct tcp_timewait_sock *tcptw = tcp_twsk(sk2); + struct tcp_sock *tp = tcp_sk(sk); + + /* With PAWS, it is safe from the viewpoint + of data integrity. Even without PAWS it + is safe provided sequence spaces do not + overlap i.e. at data rates <= 80Mbit/sec. + + Actually, the idea is close to VJ's one, + only timestamp cache is held not per host, + but per port pair and TW bucket is used + as state holder. + + If TW bucket has been already destroyed we + fall back to VJ's scheme and use initial + timestamp retrieved from peer table. + */ + if (tcptw->tw_ts_recent_stamp && + (!twp || (sysctl_tcp_tw_reuse && + xtime.tv_sec - + tcptw->tw_ts_recent_stamp > 1))) { + tp->write_seq = tcptw->tw_snd_nxt + 65535 + 2; + if (tp->write_seq == 0) + tp->write_seq = 1; + tp->rx_opt.ts_recent = tcptw->tw_ts_recent; + tp->rx_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp; + sock_hold(sk2); + goto unique; + } else + goto not_unique; + } + } + tw = NULL; + + /* And established part... */ + sk_for_each(sk2, node, &head->chain) { + if (INET_MATCH(sk2, hash, acookie, saddr, daddr, ports, dif)) + goto not_unique; + } + +unique: + /* Must record num and sport now. Otherwise we will see + * in hash table socket with a funny identity. */ + inet->num = lport; + inet->sport = htons(lport); + sk->sk_hash = hash; + BUG_TRAP(sk_unhashed(sk)); + __sk_add_node(sk, &head->chain); + sock_prot_inc_use(sk->sk_prot); + write_unlock(&head->lock); + + if (twp) { + *twp = tw; + NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); + } else if (tw) { + /* Silly. Should hash-dance instead... */ + inet_twsk_deschedule(tw, &tcp_death_row); + NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); + + inet_twsk_put(tw); } return 0; + +not_unique: + write_unlock(&head->lock); + return -EADDRNOTAVAIL; } -EXPORT_SYMBOL_GPL(tcp_twsk_unique); +static inline u32 connect_port_offset(const struct sock *sk) +{ + const struct inet_sock *inet = inet_sk(sk); + + return secure_tcp_port_ephemeral(inet->rcv_saddr, inet->daddr, + inet->dport); +} + +/* + * Bind a port for a connect operation and hash it. + */ +static inline int tcp_v4_hash_connect(struct sock *sk) +{ + const unsigned short snum = inet_sk(sk)->num; + struct inet_bind_hashbucket *head; + struct inet_bind_bucket *tb; + int ret; + + if (!snum) { + int low = sysctl_local_port_range[0]; + int high = sysctl_local_port_range[1]; + int range = high - low; + int i; + int port; + static u32 hint; + u32 offset = hint + connect_port_offset(sk); + struct hlist_node *node; + struct inet_timewait_sock *tw = NULL; + + local_bh_disable(); + for (i = 1; i <= range; i++) { + port = low + (i + offset) % range; + head = &tcp_hashinfo.bhash[inet_bhashfn(port, tcp_hashinfo.bhash_size)]; + spin_lock(&head->lock); + + /* Does not bother with rcv_saddr checks, + * because the established check is already + * unique enough. + */ + inet_bind_bucket_for_each(tb, node, &head->chain) { + if (tb->port == port) { + BUG_TRAP(!hlist_empty(&tb->owners)); + if (tb->fastreuse >= 0) + goto next_port; + if (!__tcp_v4_check_established(sk, + port, + &tw)) + goto ok; + goto next_port; + } + } + + tb = inet_bind_bucket_create(tcp_hashinfo.bind_bucket_cachep, head, port); + if (!tb) { + spin_unlock(&head->lock); + break; + } + tb->fastreuse = -1; + goto ok; + + next_port: + spin_unlock(&head->lock); + } + local_bh_enable(); + + return -EADDRNOTAVAIL; + +ok: + hint += i; + + /* Head lock still held and bh's disabled */ + inet_bind_hash(sk, tb, port); + if (sk_unhashed(sk)) { + inet_sk(sk)->sport = htons(port); + __inet_hash(&tcp_hashinfo, sk, 0); + } + spin_unlock(&head->lock); + + if (tw) { + inet_twsk_deschedule(tw, &tcp_death_row);; + inet_twsk_put(tw); + } + + ret = 0; + goto out; + } + + head = &tcp_hashinfo.bhash[inet_bhashfn(snum, tcp_hashinfo.bhash_size)]; + tb = inet_csk(sk)->icsk_bind_hash; + spin_lock_bh(&head->lock); + if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) { + __inet_hash(&tcp_hashinfo, sk, 0); + spin_unlock_bh(&head->lock); + return 0; + } else { + spin_unlock(&head->lock); + /* No definite answer... Walk to established hash table */ + ret = __tcp_v4_check_established(sk, snum, NULL); +out: + local_bh_enable(); + return ret; + } +} /* This will initiate an outgoing connection. */ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) @@ -220,9 +383,9 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) inet->dport = usin->sin_port; inet->daddr = daddr; - inet_csk(sk)->icsk_ext_hdr_len = 0; + tp->ext_header_len = 0; if (inet->opt) - inet_csk(sk)->icsk_ext_hdr_len = inet->opt->optlen; + tp->ext_header_len = inet->opt->optlen; tp->rx_opt.mss_clamp = 536; @@ -232,7 +395,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) * complete initialization after this. */ tcp_set_state(sk, TCP_SYN_SENT); - err = inet_hash_connect(&tcp_death_row, sk); + err = tcp_v4_hash_connect(sk); if (err) goto failure; @@ -270,10 +433,12 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) /* * This routine does path mtu discovery as defined in RFC1191. */ -static void do_pmtu_discovery(struct sock *sk, struct iphdr *iph, u32 mtu) +static inline void do_pmtu_discovery(struct sock *sk, struct iphdr *iph, + u32 mtu) { struct dst_entry *dst; struct inet_sock *inet = inet_sk(sk); + struct tcp_sock *tp = tcp_sk(sk); /* We are not interested in TCP_LISTEN and open_requests (SYN-ACKs * send out by Linux are always <576bytes so they should go through @@ -302,7 +467,7 @@ static void do_pmtu_discovery(struct sock *sk, struct iphdr *iph, u32 mtu) mtu = dst_mtu(dst); if (inet->pmtudisc != IP_PMTUDISC_DONT && - inet_csk(sk)->icsk_pmtu_cookie > mtu) { + tp->pmtu_cookie > mtu) { tcp_sync_mss(sk, mtu); /* Resend the TCP packet because it's @@ -479,10 +644,10 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) } /* This routine computes an IPv4 TCP checksum. */ -void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb) +void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len, + struct sk_buff *skb) { struct inet_sock *inet = inet_sk(sk); - struct tcphdr *th = skb->h.th; if (skb->ip_summed == CHECKSUM_HW) { th->check = ~tcp_v4_check(th, len, inet->saddr, inet->daddr, 0); @@ -661,8 +826,7 @@ static void tcp_v4_reqsk_destructor(struct request_sock *req) kfree(inet_rsk(req)->opt); } -#ifdef CONFIG_SYN_COOKIES -static void syn_flood_warning(struct sk_buff *skb) +static inline void syn_flood_warning(struct sk_buff *skb) { static unsigned long warntime; @@ -673,13 +837,12 @@ static void syn_flood_warning(struct sk_buff *skb) ntohs(skb->h.th->dest)); } } -#endif /* * Save and compile IPv4 options into the request_sock if needed. */ -static struct ip_options *tcp_v4_save_options(struct sock *sk, - struct sk_buff *skb) +static inline struct ip_options *tcp_v4_save_options(struct sock *sk, + struct sk_buff *skb) { struct ip_options *opt = &(IPCB(skb)->opt); struct ip_options *dopt = NULL; @@ -706,11 +869,6 @@ struct request_sock_ops tcp_request_sock_ops = { .send_reset = tcp_v4_send_reset, }; -static struct timewait_sock_ops tcp_timewait_sock_ops = { - .twsk_obj_size = sizeof(struct tcp_timewait_sock), - .twsk_unique = tcp_twsk_unique, -}; - int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) { struct inet_request_sock *ireq; @@ -895,9 +1053,9 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ireq->opt = NULL; newinet->mc_index = inet_iif(skb); newinet->mc_ttl = skb->nh.iph->ttl; - inet_csk(newsk)->icsk_ext_hdr_len = 0; + newtp->ext_header_len = 0; if (newinet->opt) - inet_csk(newsk)->icsk_ext_hdr_len = newinet->opt->optlen; + newtp->ext_header_len = newinet->opt->optlen; newinet->id = newtp->write_seq ^ jiffies; tcp_sync_mss(newsk, dst_mtu(dst)); @@ -1156,6 +1314,16 @@ int tcp_v4_rcv(struct sk_buff *skb) goto discard_it; } +static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) +{ + struct sockaddr_in *sin = (struct sockaddr_in *) uaddr; + struct inet_sock *inet = inet_sk(sk); + + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = inet->daddr; + sin->sin_port = inet->dport; +} + /* VJ's idea. Save last timestamp seen from this destination * and hold it at least for normal timewait interval to use for duplicate * segment detection in subsequent connections, before they enter synchronized @@ -1214,7 +1382,7 @@ int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw) return 0; } -struct inet_connection_sock_af_ops ipv4_specific = { +struct tcp_func ipv4_specific = { .queue_xmit = ip_queue_xmit, .send_check = tcp_v4_send_check, .rebuild_header = inet_sk_rebuild_header, @@ -1224,7 +1392,7 @@ struct inet_connection_sock_af_ops ipv4_specific = { .net_header_len = sizeof(struct iphdr), .setsockopt = ip_setsockopt, .getsockopt = ip_getsockopt, - .addr2sockaddr = inet_csk_addr2sockaddr, + .addr2sockaddr = v4_addr2sockaddr, .sockaddr_len = sizeof(struct sockaddr_in), }; @@ -1265,8 +1433,7 @@ static int tcp_v4_init_sock(struct sock *sk) sk->sk_write_space = sk_stream_write_space; sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); - icsk->icsk_af_ops = &ipv4_specific; - icsk->icsk_sync_mss = tcp_sync_mss; + tp->af_specific = &ipv4_specific; sk->sk_sndbuf = sysctl_tcp_wmem[1]; sk->sk_rcvbuf = sysctl_tcp_rmem[1]; @@ -1822,7 +1989,7 @@ struct proto tcp_prot = { .sysctl_rmem = sysctl_tcp_rmem, .max_header = MAX_TCP_HEADER, .obj_size = sizeof(struct tcp_sock), - .twsk_prot = &tcp_timewait_sock_ops, + .twsk_obj_size = sizeof(struct tcp_timewait_sock), .rsk_prot = &tcp_request_sock_ops, }; diff --git a/trunk/net/ipv4/tcp_minisocks.c b/trunk/net/ipv4/tcp_minisocks.c index 2b9b7f6c7f7c..1b66a2ac4321 100644 --- a/trunk/net/ipv4/tcp_minisocks.c +++ b/trunk/net/ipv4/tcp_minisocks.c @@ -274,18 +274,18 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, void tcp_time_wait(struct sock *sk, int state, int timeo) { struct inet_timewait_sock *tw = NULL; - const struct inet_connection_sock *icsk = inet_csk(sk); const struct tcp_sock *tp = tcp_sk(sk); int recycle_ok = 0; if (tcp_death_row.sysctl_tw_recycle && tp->rx_opt.ts_recent_stamp) - recycle_ok = icsk->icsk_af_ops->remember_stamp(sk); + recycle_ok = tp->af_specific->remember_stamp(sk); if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets) tw = inet_twsk_alloc(sk, state); if (tw != NULL) { struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); + const struct inet_connection_sock *icsk = inet_csk(sk); const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); tw->tw_rcv_wscale = tp->rx_opt.rcv_wscale; @@ -298,12 +298,10 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) if (tw->tw_family == PF_INET6) { struct ipv6_pinfo *np = inet6_sk(sk); - struct inet6_timewait_sock *tw6; + struct tcp6_timewait_sock *tcp6tw = tcp6_twsk((struct sock *)tw); - tw->tw_ipv6_offset = inet6_tw_offset(sk->sk_prot); - tw6 = inet6_twsk((struct sock *)tw); - ipv6_addr_copy(&tw6->tw_v6_daddr, &np->daddr); - ipv6_addr_copy(&tw6->tw_v6_rcv_saddr, &np->rcv_saddr); + ipv6_addr_copy(&tcp6tw->tw_v6_daddr, &np->daddr); + ipv6_addr_copy(&tcp6tw->tw_v6_rcv_saddr, &np->rcv_saddr); tw->tw_ipv6only = np->ipv6only; } #endif @@ -458,6 +456,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb, struct request_sock **prev) { struct tcphdr *th = skb->h.th; + struct tcp_sock *tp = tcp_sk(sk); u32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK); int paws_reject = 0; struct tcp_options_received tmp_opt; @@ -614,8 +613,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb, * ESTABLISHED STATE. If it will be dropped after * socket is created, wait for troubles. */ - child = inet_csk(sk)->icsk_af_ops->syn_recv_sock(sk, skb, - req, NULL); + child = tp->af_specific->syn_recv_sock(sk, skb, req, NULL); if (child == NULL) goto listen_overflow; diff --git a/trunk/net/ipv4/tcp_output.c b/trunk/net/ipv4/tcp_output.c index a7623ead39a8..029c70dfb585 100644 --- a/trunk/net/ipv4/tcp_output.c +++ b/trunk/net/ipv4/tcp_output.c @@ -51,8 +51,8 @@ int sysctl_tcp_retrans_collapse = 1; */ int sysctl_tcp_tso_win_divisor = 3; -static void update_send_head(struct sock *sk, struct tcp_sock *tp, - struct sk_buff *skb) +static inline void update_send_head(struct sock *sk, struct tcp_sock *tp, + struct sk_buff *skb) { sk->sk_send_head = skb->next; if (sk->sk_send_head == (struct sk_buff *)&sk->sk_write_queue) @@ -124,8 +124,8 @@ static void tcp_cwnd_restart(struct sock *sk, struct dst_entry *dst) tp->snd_cwnd_used = 0; } -static void tcp_event_data_sent(struct tcp_sock *tp, - struct sk_buff *skb, struct sock *sk) +static inline void tcp_event_data_sent(struct tcp_sock *tp, + struct sk_buff *skb, struct sock *sk) { struct inet_connection_sock *icsk = inet_csk(sk); const u32 now = tcp_time_stamp; @@ -142,7 +142,7 @@ static void tcp_event_data_sent(struct tcp_sock *tp, icsk->icsk_ack.pingpong = 1; } -static inline void tcp_event_ack_sent(struct sock *sk, unsigned int pkts) +static __inline__ void tcp_event_ack_sent(struct sock *sk, unsigned int pkts) { tcp_dec_quickack_mode(sk, pkts); inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK); @@ -212,7 +212,7 @@ void tcp_select_initial_window(int __space, __u32 mss, * value can be stuffed directly into th->window for an outgoing * frame. */ -static u16 tcp_select_window(struct sock *sk) +static __inline__ u16 tcp_select_window(struct sock *sk) { struct tcp_sock *tp = tcp_sk(sk); u32 cur_win = tcp_receive_window(tp); @@ -250,75 +250,6 @@ static u16 tcp_select_window(struct sock *sk) return new_win; } -static void tcp_build_and_update_options(__u32 *ptr, struct tcp_sock *tp, - __u32 tstamp) -{ - if (tp->rx_opt.tstamp_ok) { - *ptr++ = __constant_htonl((TCPOPT_NOP << 24) | - (TCPOPT_NOP << 16) | - (TCPOPT_TIMESTAMP << 8) | - TCPOLEN_TIMESTAMP); - *ptr++ = htonl(tstamp); - *ptr++ = htonl(tp->rx_opt.ts_recent); - } - if (tp->rx_opt.eff_sacks) { - struct tcp_sack_block *sp = tp->rx_opt.dsack ? tp->duplicate_sack : tp->selective_acks; - int this_sack; - - *ptr++ = htonl((TCPOPT_NOP << 24) | - (TCPOPT_NOP << 16) | - (TCPOPT_SACK << 8) | - (TCPOLEN_SACK_BASE + (tp->rx_opt.eff_sacks * - TCPOLEN_SACK_PERBLOCK))); - for(this_sack = 0; this_sack < tp->rx_opt.eff_sacks; this_sack++) { - *ptr++ = htonl(sp[this_sack].start_seq); - *ptr++ = htonl(sp[this_sack].end_seq); - } - if (tp->rx_opt.dsack) { - tp->rx_opt.dsack = 0; - tp->rx_opt.eff_sacks--; - } - } -} - -/* Construct a tcp options header for a SYN or SYN_ACK packet. - * If this is every changed make sure to change the definition of - * MAX_SYN_SIZE to match the new maximum number of options that you - * can generate. - */ -static void tcp_syn_build_options(__u32 *ptr, int mss, int ts, int sack, - int offer_wscale, int wscale, __u32 tstamp, - __u32 ts_recent) -{ - /* We always get an MSS option. - * The option bytes which will be seen in normal data - * packets should timestamps be used, must be in the MSS - * advertised. But we subtract them from tp->mss_cache so - * that calculations in tcp_sendmsg are simpler etc. - * So account for this fact here if necessary. If we - * don't do this correctly, as a receiver we won't - * recognize data packets as being full sized when we - * should, and thus we won't abide by the delayed ACK - * rules correctly. - * SACKs don't matter, we never delay an ACK when we - * have any of those going out. - */ - *ptr++ = htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) | mss); - if (ts) { - if(sack) - *ptr++ = __constant_htonl((TCPOPT_SACK_PERM << 24) | (TCPOLEN_SACK_PERM << 16) | - (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP); - else - *ptr++ = __constant_htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | - (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP); - *ptr++ = htonl(tstamp); /* TSVAL */ - *ptr++ = htonl(ts_recent); /* TSECR */ - } else if(sack) - *ptr++ = __constant_htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | - (TCPOPT_SACK_PERM << 8) | TCPOLEN_SACK_PERM); - if (offer_wscale) - *ptr++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_WINDOW << 16) | (TCPOLEN_WINDOW << 8) | (wscale)); -} /* This routine actually transmits TCP packets queued in by * tcp_do_sendmsg(). This is used by both the initial @@ -331,139 +262,122 @@ static void tcp_syn_build_options(__u32 *ptr, int mss, int ts, int sack, * We are working here with either a clone of the original * SKB, or a fresh unique copy made by the retransmit engine. */ -static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, gfp_t gfp_mask) +static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb) { - const struct inet_connection_sock *icsk = inet_csk(sk); - struct inet_sock *inet; - struct tcp_sock *tp; - struct tcp_skb_cb *tcb; - int tcp_header_size; - struct tcphdr *th; - int sysctl_flags; - int err; - - BUG_ON(!skb || !tcp_skb_pcount(skb)); - - /* If congestion control is doing timestamping, we must - * take such a timestamp before we potentially clone/copy. - */ - if (icsk->icsk_ca_ops->rtt_sample) - __net_timestamp(skb); - - if (likely(clone_it)) { - if (unlikely(skb_cloned(skb))) - skb = pskb_copy(skb, gfp_mask); - else - skb = skb_clone(skb, gfp_mask); - if (unlikely(!skb)) - return -ENOBUFS; - } + if (skb != NULL) { + const struct inet_connection_sock *icsk = inet_csk(sk); + struct inet_sock *inet = inet_sk(sk); + struct tcp_sock *tp = tcp_sk(sk); + struct tcp_skb_cb *tcb = TCP_SKB_CB(skb); + int tcp_header_size = tp->tcp_header_len; + struct tcphdr *th; + int sysctl_flags; + int err; - inet = inet_sk(sk); - tp = tcp_sk(sk); - tcb = TCP_SKB_CB(skb); - tcp_header_size = tp->tcp_header_len; + BUG_ON(!tcp_skb_pcount(skb)); #define SYSCTL_FLAG_TSTAMPS 0x1 #define SYSCTL_FLAG_WSCALE 0x2 #define SYSCTL_FLAG_SACK 0x4 - sysctl_flags = 0; - if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) { - tcp_header_size = sizeof(struct tcphdr) + TCPOLEN_MSS; - if(sysctl_tcp_timestamps) { - tcp_header_size += TCPOLEN_TSTAMP_ALIGNED; - sysctl_flags |= SYSCTL_FLAG_TSTAMPS; - } - if (sysctl_tcp_window_scaling) { - tcp_header_size += TCPOLEN_WSCALE_ALIGNED; - sysctl_flags |= SYSCTL_FLAG_WSCALE; - } - if (sysctl_tcp_sack) { - sysctl_flags |= SYSCTL_FLAG_SACK; - if (!(sysctl_flags & SYSCTL_FLAG_TSTAMPS)) - tcp_header_size += TCPOLEN_SACKPERM_ALIGNED; + /* If congestion control is doing timestamping */ + if (icsk->icsk_ca_ops->rtt_sample) + __net_timestamp(skb); + + sysctl_flags = 0; + if (tcb->flags & TCPCB_FLAG_SYN) { + tcp_header_size = sizeof(struct tcphdr) + TCPOLEN_MSS; + if(sysctl_tcp_timestamps) { + tcp_header_size += TCPOLEN_TSTAMP_ALIGNED; + sysctl_flags |= SYSCTL_FLAG_TSTAMPS; + } + if(sysctl_tcp_window_scaling) { + tcp_header_size += TCPOLEN_WSCALE_ALIGNED; + sysctl_flags |= SYSCTL_FLAG_WSCALE; + } + if(sysctl_tcp_sack) { + sysctl_flags |= SYSCTL_FLAG_SACK; + if(!(sysctl_flags & SYSCTL_FLAG_TSTAMPS)) + tcp_header_size += TCPOLEN_SACKPERM_ALIGNED; + } + } else if (tp->rx_opt.eff_sacks) { + /* A SACK is 2 pad bytes, a 2 byte header, plus + * 2 32-bit sequence numbers for each SACK block. + */ + tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED + + (tp->rx_opt.eff_sacks * TCPOLEN_SACK_PERBLOCK)); } - } else if (unlikely(tp->rx_opt.eff_sacks)) { - /* A SACK is 2 pad bytes, a 2 byte header, plus - * 2 32-bit sequence numbers for each SACK block. - */ - tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED + - (tp->rx_opt.eff_sacks * - TCPOLEN_SACK_PERBLOCK)); - } - if (tcp_packets_in_flight(tp) == 0) - tcp_ca_event(sk, CA_EVENT_TX_START); - - th = (struct tcphdr *) skb_push(skb, tcp_header_size); - skb->h.th = th; - skb_set_owner_w(skb, sk); - - /* Build TCP header and checksum it. */ - th->source = inet->sport; - th->dest = inet->dport; - th->seq = htonl(tcb->seq); - th->ack_seq = htonl(tp->rcv_nxt); - *(((__u16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) | - tcb->flags); - - if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) { - /* RFC1323: The window in SYN & SYN/ACK segments - * is never scaled. - */ - th->window = htons(tp->rcv_wnd); - } else { - th->window = htons(tcp_select_window(sk)); - } - th->check = 0; - th->urg_ptr = 0; - - if (unlikely(tp->urg_mode && - between(tp->snd_up, tcb->seq+1, tcb->seq+0xFFFF))) { - th->urg_ptr = htons(tp->snd_up-tcb->seq); - th->urg = 1; - } + if (tcp_packets_in_flight(tp) == 0) + tcp_ca_event(sk, CA_EVENT_TX_START); + + th = (struct tcphdr *) skb_push(skb, tcp_header_size); + skb->h.th = th; + skb_set_owner_w(skb, sk); + + /* Build TCP header and checksum it. */ + th->source = inet->sport; + th->dest = inet->dport; + th->seq = htonl(tcb->seq); + th->ack_seq = htonl(tp->rcv_nxt); + *(((__u16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) | tcb->flags); + if (tcb->flags & TCPCB_FLAG_SYN) { + /* RFC1323: The window in SYN & SYN/ACK segments + * is never scaled. + */ + th->window = htons(tp->rcv_wnd); + } else { + th->window = htons(tcp_select_window(sk)); + } + th->check = 0; + th->urg_ptr = 0; - if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) { - tcp_syn_build_options((__u32 *)(th + 1), - tcp_advertise_mss(sk), - (sysctl_flags & SYSCTL_FLAG_TSTAMPS), - (sysctl_flags & SYSCTL_FLAG_SACK), - (sysctl_flags & SYSCTL_FLAG_WSCALE), - tp->rx_opt.rcv_wscale, - tcb->when, - tp->rx_opt.ts_recent); - } else { - tcp_build_and_update_options((__u32 *)(th + 1), - tp, tcb->when); - TCP_ECN_send(sk, tp, skb, tcp_header_size); - } + if (tp->urg_mode && + between(tp->snd_up, tcb->seq+1, tcb->seq+0xFFFF)) { + th->urg_ptr = htons(tp->snd_up-tcb->seq); + th->urg = 1; + } - icsk->icsk_af_ops->send_check(sk, skb->len, skb); + if (tcb->flags & TCPCB_FLAG_SYN) { + tcp_syn_build_options((__u32 *)(th + 1), + tcp_advertise_mss(sk), + (sysctl_flags & SYSCTL_FLAG_TSTAMPS), + (sysctl_flags & SYSCTL_FLAG_SACK), + (sysctl_flags & SYSCTL_FLAG_WSCALE), + tp->rx_opt.rcv_wscale, + tcb->when, + tp->rx_opt.ts_recent); + } else { + tcp_build_and_update_options((__u32 *)(th + 1), + tp, tcb->when); - if (likely(tcb->flags & TCPCB_FLAG_ACK)) - tcp_event_ack_sent(sk, tcp_skb_pcount(skb)); + TCP_ECN_send(sk, tp, skb, tcp_header_size); + } + tp->af_specific->send_check(sk, th, skb->len, skb); - if (skb->len != tcp_header_size) - tcp_event_data_sent(tp, skb, sk); + if (tcb->flags & TCPCB_FLAG_ACK) + tcp_event_ack_sent(sk, tcp_skb_pcount(skb)); - TCP_INC_STATS(TCP_MIB_OUTSEGS); + if (skb->len != tcp_header_size) + tcp_event_data_sent(tp, skb, sk); - err = icsk->icsk_af_ops->queue_xmit(skb, 0); - if (unlikely(err <= 0)) - return err; + TCP_INC_STATS(TCP_MIB_OUTSEGS); - tcp_enter_cwr(sk); + err = tp->af_specific->queue_xmit(skb, 0); + if (err <= 0) + return err; - /* NET_XMIT_CN is special. It does not guarantee, - * that this packet is lost. It tells that device - * is about to start to drop packets or already - * drops some packets of the same priority and - * invokes us to send less aggressively. - */ - return err == NET_XMIT_CN ? 0 : err; + tcp_enter_cwr(sk); + /* NET_XMIT_CN is special. It does not guarantee, + * that this packet is lost. It tells that device + * is about to start to drop packets or already + * drops some packets of the same priority and + * invokes us to send less aggressively. + */ + return err == NET_XMIT_CN ? 0 : err; + } + return -ENOBUFS; #undef SYSCTL_FLAG_TSTAMPS #undef SYSCTL_FLAG_WSCALE #undef SYSCTL_FLAG_SACK @@ -690,7 +604,7 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) It is minimum of user_mss and mss received with SYN. It also does not include TCP options. - inet_csk(sk)->icsk_pmtu_cookie is last pmtu, seen by this function. + tp->pmtu_cookie is last pmtu, seen by this function. tp->mss_cache is current effective sending mss, including all tcp options except for SACKs. It is evaluated, @@ -700,26 +614,26 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) NOTE1. rfc1122 clearly states that advertised MSS DOES NOT include either tcp or ip options. - NOTE2. inet_csk(sk)->icsk_pmtu_cookie and tp->mss_cache - are READ ONLY outside this function. --ANK (980731) + NOTE2. tp->pmtu_cookie and tp->mss_cache are READ ONLY outside + this function. --ANK (980731) */ unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu) { struct tcp_sock *tp = tcp_sk(sk); - struct inet_connection_sock *icsk = inet_csk(sk); + int mss_now; + /* Calculate base mss without TCP options: It is MMS_S - sizeof(tcphdr) of rfc1122 */ - int mss_now = (pmtu - icsk->icsk_af_ops->net_header_len - - sizeof(struct tcphdr)); + mss_now = pmtu - tp->af_specific->net_header_len - sizeof(struct tcphdr); /* Clamp it (mss_clamp does not include tcp options) */ if (mss_now > tp->rx_opt.mss_clamp) mss_now = tp->rx_opt.mss_clamp; /* Now subtract optional transport overhead */ - mss_now -= icsk->icsk_ext_hdr_len; + mss_now -= tp->ext_header_len; /* Then reserve room for full set of TCP options and 8 bytes of data */ if (mss_now < 48) @@ -733,7 +647,7 @@ unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu) mss_now = max((tp->max_window>>1), 68U - tp->tcp_header_len); /* And store cached results */ - icsk->icsk_pmtu_cookie = pmtu; + tp->pmtu_cookie = pmtu; tp->mss_cache = mss_now; return mss_now; @@ -763,7 +677,7 @@ unsigned int tcp_current_mss(struct sock *sk, int large_allowed) if (dst) { u32 mtu = dst_mtu(dst); - if (mtu != inet_csk(sk)->icsk_pmtu_cookie) + if (mtu != tp->pmtu_cookie) mss_now = tcp_sync_mss(sk, mtu); } @@ -774,10 +688,9 @@ unsigned int tcp_current_mss(struct sock *sk, int large_allowed) xmit_size_goal = mss_now; if (doing_tso) { - xmit_size_goal = (65535 - - inet_csk(sk)->icsk_af_ops->net_header_len - - inet_csk(sk)->icsk_ext_hdr_len - - tp->tcp_header_len); + xmit_size_goal = 65535 - + tp->af_specific->net_header_len - + tp->ext_header_len - tp->tcp_header_len; if (tp->max_window && (xmit_size_goal > (tp->max_window >> 1))) @@ -793,7 +706,7 @@ unsigned int tcp_current_mss(struct sock *sk, int large_allowed) /* Congestion window validation. (RFC2861) */ -static void tcp_cwnd_validate(struct sock *sk, struct tcp_sock *tp) +static inline void tcp_cwnd_validate(struct sock *sk, struct tcp_sock *tp) { __u32 packets_out = tp->packets_out; @@ -842,7 +755,7 @@ static inline unsigned int tcp_cwnd_test(struct tcp_sock *tp, struct sk_buff *sk /* This must be invoked the first time we consider transmitting * SKB onto the wire. */ -static int tcp_init_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) +static inline int tcp_init_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) { int tso_segs = tcp_skb_pcount(skb); @@ -1123,7 +1036,7 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle) TCP_SKB_CB(skb)->when = tcp_time_stamp; - if (unlikely(tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC))) + if (unlikely(tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC)))) break; /* Advance the send_head. This one is sent out. @@ -1196,7 +1109,7 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now) /* Send it out now. */ TCP_SKB_CB(skb)->when = tcp_time_stamp; - if (likely(!tcp_transmit_skb(sk, skb, 1, sk->sk_allocation))) { + if (likely(!tcp_transmit_skb(sk, skb_clone(skb, sk->sk_allocation)))) { update_send_head(sk, tp, skb); tcp_cwnd_validate(sk, tp); return; @@ -1492,7 +1405,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) (sysctl_tcp_retrans_collapse != 0)) tcp_retrans_try_collapse(sk, skb, cur_mss); - if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk)) + if(tp->af_specific->rebuild_header(sk)) return -EHOSTUNREACH; /* Routing failure or similar. */ /* Some Solaris stacks overoptimize and ignore the FIN on a @@ -1516,7 +1429,9 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) */ TCP_SKB_CB(skb)->when = tcp_time_stamp; - err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC); + err = tcp_transmit_skb(sk, (skb_cloned(skb) ? + pskb_copy(skb, GFP_ATOMIC): + skb_clone(skb, GFP_ATOMIC))); if (err == 0) { /* Update global TCP statistics. */ @@ -1750,7 +1665,7 @@ void tcp_send_active_reset(struct sock *sk, gfp_t priority) TCP_SKB_CB(skb)->seq = tcp_acceptable_seq(sk, tp); TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq; TCP_SKB_CB(skb)->when = tcp_time_stamp; - if (tcp_transmit_skb(sk, skb, 0, priority)) + if (tcp_transmit_skb(sk, skb)) NET_INC_STATS(LINUX_MIB_TCPABORTFAILED); } @@ -1785,7 +1700,7 @@ int tcp_send_synack(struct sock *sk) TCP_ECN_send_synack(tcp_sk(sk), skb); } TCP_SKB_CB(skb)->when = tcp_time_stamp; - return tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC); + return tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC)); } /* @@ -1863,7 +1778,7 @@ struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst, /* * Do all connect socket setups that can be done AF independent. */ -static void tcp_connect_init(struct sock *sk) +static inline void tcp_connect_init(struct sock *sk) { struct dst_entry *dst = __sk_dst_get(sk); struct tcp_sock *tp = tcp_sk(sk); @@ -1946,7 +1861,7 @@ int tcp_connect(struct sock *sk) __skb_queue_tail(&sk->sk_write_queue, buff); sk_charge_skb(sk, buff); tp->packets_out += tcp_skb_pcount(buff); - tcp_transmit_skb(sk, buff, 1, GFP_KERNEL); + tcp_transmit_skb(sk, skb_clone(buff, GFP_KERNEL)); TCP_INC_STATS(TCP_MIB_ACTIVEOPENS); /* Timer for repeating the SYN until an answer. */ @@ -2042,7 +1957,7 @@ void tcp_send_ack(struct sock *sk) /* Send it off, this clears delayed acks for us. */ TCP_SKB_CB(buff)->seq = TCP_SKB_CB(buff)->end_seq = tcp_acceptable_seq(sk, tp); TCP_SKB_CB(buff)->when = tcp_time_stamp; - tcp_transmit_skb(sk, buff, 0, GFP_ATOMIC); + tcp_transmit_skb(sk, buff); } } @@ -2082,7 +1997,7 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent) TCP_SKB_CB(skb)->seq = urgent ? tp->snd_una : tp->snd_una - 1; TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq; TCP_SKB_CB(skb)->when = tcp_time_stamp; - return tcp_transmit_skb(sk, skb, 0, GFP_ATOMIC); + return tcp_transmit_skb(sk, skb); } int tcp_write_wakeup(struct sock *sk) @@ -2115,7 +2030,7 @@ int tcp_write_wakeup(struct sock *sk) TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; TCP_SKB_CB(skb)->when = tcp_time_stamp; - err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC); + err = tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC)); if (!err) { update_send_head(sk, tp, skb); } diff --git a/trunk/net/ipv4/tcp_vegas.c b/trunk/net/ipv4/tcp_vegas.c index 3b7403495052..b7d296a8ac6d 100644 --- a/trunk/net/ipv4/tcp_vegas.c +++ b/trunk/net/ipv4/tcp_vegas.c @@ -215,6 +215,14 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, vegas->beg_snd_nxt = tp->snd_nxt; vegas->beg_snd_cwnd = tp->snd_cwnd; + /* Take into account the current RTT sample too, to + * decrease the impact of delayed acks. This double counts + * this sample since we count it for the next window as well, + * but that's not too awful, since we're taking the min, + * rather than averaging. + */ + tcp_vegas_rtt_calc(sk, seq_rtt * 1000); + /* We do the Vegas calculations only if we got enough RTT * samples that we can be reasonably sure that we got * at least one RTT sample that wasn't from a delayed ACK. @@ -325,15 +333,11 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, else if (tp->snd_cwnd > tp->snd_cwnd_clamp) tp->snd_cwnd = tp->snd_cwnd_clamp; } - - /* Wipe the slate clean for the next RTT. */ - vegas->cntRTT = 0; - vegas->minRTT = 0x7fffffff; } - /* Use normal slow start */ - else if (tp->snd_cwnd <= tp->snd_ssthresh) - tcp_slow_start(tp); - + + /* Wipe the slate clean for the next RTT. */ + vegas->cntRTT = 0; + vegas->minRTT = 0x7fffffff; } /* Extract info for Tcp socket info provided via netlink. */ diff --git a/trunk/net/ipv4/udp.c b/trunk/net/ipv4/udp.c index 223abaa72bc5..2422a5f7195d 100644 --- a/trunk/net/ipv4/udp.c +++ b/trunk/net/ipv4/udp.c @@ -86,7 +86,6 @@ #include #include #include -#include #include #include #include @@ -847,7 +846,20 @@ static int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, csum_copy_err: UDP_INC_STATS_BH(UDP_MIB_INERRORS); - skb_kill_datagram(sk, skb, flags); + /* Clear queue. */ + if (flags&MSG_PEEK) { + int clear = 0; + spin_lock_bh(&sk->sk_receive_queue.lock); + if (skb == skb_peek(&sk->sk_receive_queue)) { + __skb_unlink(skb, &sk->sk_receive_queue); + clear = 1; + } + spin_unlock_bh(&sk->sk_receive_queue.lock); + if (clear) + kfree_skb(skb); + } + + skb_free_datagram(sk, skb); if (noblock) return -EAGAIN; @@ -1082,7 +1094,7 @@ static int udp_v4_mcast_deliver(struct sk_buff *skb, struct udphdr *uh, * Otherwise, csum completion requires chacksumming packet body, * including udp header and folding it to skb->csum. */ -static void udp_checksum_init(struct sk_buff *skb, struct udphdr *uh, +static int udp_checksum_init(struct sk_buff *skb, struct udphdr *uh, unsigned short ulen, u32 saddr, u32 daddr) { if (uh->check == 0) { @@ -1096,6 +1108,7 @@ static void udp_checksum_init(struct sk_buff *skb, struct udphdr *uh, /* Probably, we should checksum udp header (it should be in cache * in any case) and data in tiny packets (< rx copybreak). */ + return 0; } /* @@ -1128,7 +1141,8 @@ int udp_rcv(struct sk_buff *skb) if (pskb_trim_rcsum(skb, ulen)) goto short_packet; - udp_checksum_init(skb, uh, ulen, saddr, daddr); + if (udp_checksum_init(skb, uh, ulen, saddr, daddr) < 0) + goto csum_error; if(rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST)) return udp_v4_mcast_deliver(skb, uh, saddr, daddr); diff --git a/trunk/net/ipv4/xfrm4_policy.c b/trunk/net/ipv4/xfrm4_policy.c index 42196ba3b0b9..b2b60f3e9cdd 100644 --- a/trunk/net/ipv4/xfrm4_policy.c +++ b/trunk/net/ipv4/xfrm4_policy.c @@ -182,7 +182,6 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) case IPPROTO_UDP: case IPPROTO_TCP: case IPPROTO_SCTP: - case IPPROTO_DCCP: if (pskb_may_pull(skb, xprth + 4 - skb->data)) { u16 *ports = (u16 *)xprth; diff --git a/trunk/net/ipv6/Makefile b/trunk/net/ipv6/Makefile index 9601fd7f9d66..6460eec834b7 100644 --- a/trunk/net/ipv6/Makefile +++ b/trunk/net/ipv6/Makefile @@ -8,8 +8,7 @@ ipv6-objs := af_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o sit.o \ route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o raw.o \ protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \ exthdrs.o sysctl_net_ipv6.o datagram.o proc.o \ - ip6_flowlabel.o ipv6_syms.o netfilter.o \ - inet6_connection_sock.o + ip6_flowlabel.o ipv6_syms.o netfilter.o ipv6-$(CONFIG_XFRM) += xfrm6_policy.o xfrm6_state.o xfrm6_input.o \ xfrm6_output.o diff --git a/trunk/net/ipv6/addrconf.c b/trunk/net/ipv6/addrconf.c index 704fb73e6c5f..ddcf7754eec2 100644 --- a/trunk/net/ipv6/addrconf.c +++ b/trunk/net/ipv6/addrconf.c @@ -137,7 +137,6 @@ static int addrconf_ifdown(struct net_device *dev, int how); static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); static void addrconf_dad_timer(unsigned long data); static void addrconf_dad_completed(struct inet6_ifaddr *ifp); -static void addrconf_dad_run(struct inet6_dev *idev); static void addrconf_rs_timer(unsigned long data); static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); @@ -380,8 +379,8 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) dev->type == ARPHRD_NONE || dev->type == ARPHRD_SIT) { printk(KERN_INFO - "%s: Disabled Privacy Extensions\n", - dev->name); + "Disabled Privacy Extensions on device %p(%s)\n", + dev, dev->name); ndev->cnf.use_tempaddr = -1; } else { in6_dev_hold(ndev); @@ -389,9 +388,6 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) } #endif - if (netif_carrier_ok(dev)) - ndev->if_flags |= IF_READY; - write_lock_bh(&addrconf_lock); dev->ip6_ptr = ndev; write_unlock_bh(&addrconf_lock); @@ -419,7 +415,6 @@ static struct inet6_dev * ipv6_find_idev(struct net_device *dev) if ((idev = ipv6_add_dev(dev)) == NULL) return NULL; } - if (dev->flags&IFF_UP) ipv6_mc_up(idev); return idev; @@ -639,7 +634,8 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) } #endif - for (ifap = &idev->addr_list; (ifa=*ifap) != NULL;) { + for (ifap = &idev->addr_list; (ifa=*ifap) != NULL; + ifap = &ifa->if_next) { if (ifa == ifp) { *ifap = ifa->if_next; __in6_ifa_put(ifp); @@ -647,7 +643,6 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) if (!(ifp->flags & IFA_F_PERMANENT) || onlink > 0) break; deleted = 1; - continue; } else if (ifp->flags & IFA_F_PERMANENT) { if (ipv6_prefix_equal(&ifa->addr, &ifp->addr, ifp->prefix_len)) { @@ -671,7 +666,6 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) } } } - ifap = &ifa->if_next; } write_unlock_bh(&idev->lock); @@ -909,18 +903,11 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev, score.addr_type = __ipv6_addr_type(&ifa->addr); - /* Rule 0: - * - Tentative Address (RFC2462 section 5.4) - * - A tentative address is not considered - * "assigned to an interface" in the traditional - * sense. - * - Candidate Source Address (section 4) + /* Rule 0: Candidate Source Address (section 4) * - In any case, anycast addresses, multicast * addresses, and the unspecified address MUST * NOT be included in a candidate set. */ - if (ifa->flags & IFA_F_TENTATIVE) - continue; if (unlikely(score.addr_type == IPV6_ADDR_ANY || score.addr_type & IPV6_ADDR_MULTICAST)) { LIMIT_NETDEBUG(KERN_DEBUG @@ -998,8 +985,6 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev, } /* Rule 4: Prefer home address -- not implemented yet */ - if (hiscore.rule < 4) - hiscore.rule++; /* Rule 5: Prefer outgoing interface */ if (hiscore.rule < 5) { @@ -1060,10 +1045,9 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev, } #endif /* Rule 8: Use longest matching prefix */ - if (hiscore.rule < 8) { + if (hiscore.rule < 8) hiscore.matchlen = ipv6_addr_diff(&ifa_result->addr, daddr); - hiscore.rule++; - } + score.rule++; score.matchlen = ipv6_addr_diff(&ifa->addr, daddr); if (score.matchlen > hiscore.matchlen) { score.rule = 8; @@ -1195,7 +1179,7 @@ struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, struct net_device * int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) { const struct in6_addr *sk_rcv_saddr6 = &inet6_sk(sk)->rcv_saddr; - const struct in6_addr *sk2_rcv_saddr6 = inet6_rcv_saddr(sk2); + const struct in6_addr *sk2_rcv_saddr6 = tcp_v6_rcv_saddr(sk2); u32 sk_rcv_saddr = inet_sk(sk)->rcv_saddr; u32 sk2_rcv_saddr = inet_rcv_saddr(sk2); int sk_ipv6only = ipv6_only_sock(sk); @@ -1228,8 +1212,10 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) /* Gets referenced address, destroys ifaddr */ -void addrconf_dad_stop(struct inet6_ifaddr *ifp) +void addrconf_dad_failure(struct inet6_ifaddr *ifp) { + if (net_ratelimit()) + printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name); if (ifp->flags&IFA_F_PERMANENT) { spin_lock_bh(&ifp->lock); addrconf_del_timer(ifp); @@ -1255,12 +1241,6 @@ void addrconf_dad_stop(struct inet6_ifaddr *ifp) ipv6_del_addr(ifp); } -void addrconf_dad_failure(struct inet6_ifaddr *ifp) -{ - if (net_ratelimit()) - printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name); - addrconf_dad_stop(ifp); -} /* Join to solicited addr multicast group. */ @@ -1613,17 +1593,9 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len) not good. */ if (valid_lft >= 0x7FFFFFFF/HZ) - rt_expires = 0x7FFFFFFF - (0x7FFFFFFF % HZ); + rt_expires = 0; else - rt_expires = valid_lft * HZ; - - /* - * We convert this (in jiffies) to clock_t later. - * Avoid arithmetic overflow there as well. - * Overflow can happen only if HZ < USER_HZ. - */ - if (HZ < USER_HZ && rt_expires > 0x7FFFFFFF / USER_HZ) - rt_expires = 0x7FFFFFFF / USER_HZ; + rt_expires = jiffies + valid_lft * HZ; if (pinfo->onlink) { struct rt6_info *rt; @@ -1635,12 +1607,12 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len) ip6_del_rt(rt, NULL, NULL, NULL); rt = NULL; } else { - rt->rt6i_expires = jiffies + rt_expires; + rt->rt6i_expires = rt_expires; } } } else if (valid_lft) { addrconf_prefix_route(&pinfo->prefix, pinfo->prefix_len, - dev, jiffies_to_clock_t(rt_expires), RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT); + dev, rt_expires, RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT); } if (rt) dst_release(&rt->u.dst); @@ -2150,42 +2122,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, { struct net_device *dev = (struct net_device *) data; struct inet6_dev *idev = __in6_dev_get(dev); - int run_pending = 0; switch(event) { case NETDEV_UP: - case NETDEV_CHANGE: - if (event == NETDEV_UP) { - if (!netif_carrier_ok(dev)) { - /* device is not ready yet. */ - printk(KERN_INFO - "ADDRCONF(NETDEV_UP): %s: " - "link is not ready\n", - dev->name); - break; - } - } else { - if (!netif_carrier_ok(dev)) { - /* device is still not ready. */ - break; - } - - if (idev) { - if (idev->if_flags & IF_READY) { - /* device is already configured. */ - break; - } - idev->if_flags |= IF_READY; - } - - printk(KERN_INFO - "ADDRCONF(NETDEV_CHANGE): %s: " - "link becomes ready\n", - dev->name); - - run_pending = 1; - } - switch(dev->type) { case ARPHRD_SIT: addrconf_sit_config(dev); @@ -2202,9 +2141,6 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, break; }; if (idev) { - if (run_pending) - addrconf_dad_run(idev); - /* If the MTU changed during the interface down, when the interface up, the changed MTU must be reflected in the idev as well as routers. @@ -2239,7 +2175,8 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, */ addrconf_ifdown(dev, event != NETDEV_DOWN); break; - + case NETDEV_CHANGE: + break; case NETDEV_CHANGENAME: #ifdef CONFIG_SYSCTL if (idev) { @@ -2320,7 +2257,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) /* Step 3: clear flags for stateless addrconf */ if (how != 1) - idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); + idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD); /* Step 4: clear address list */ #ifdef CONFIG_IPV6_PRIVACY @@ -2429,20 +2366,11 @@ static void addrconf_rs_timer(unsigned long data) /* * Duplicate Address Detection */ -static void addrconf_dad_kick(struct inet6_ifaddr *ifp) -{ - unsigned long rand_num; - struct inet6_dev *idev = ifp->idev; - - rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); - ifp->probes = idev->cnf.dad_transmits; - addrconf_mod_timer(ifp, AC_DAD, rand_num); -} - static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) { struct inet6_dev *idev = ifp->idev; struct net_device *dev = idev->dev; + unsigned long rand_num; addrconf_join_solict(dev, &ifp->addr); @@ -2451,6 +2379,7 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) flags); net_srandom(ifp->addr.s6_addr32[3]); + rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); read_lock_bh(&idev->lock); if (ifp->dead) @@ -2467,19 +2396,9 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) return; } - if (!(idev->if_flags & IF_READY)) { - spin_unlock_bh(&ifp->lock); - read_unlock_bh(&idev->lock); - /* - * If the defice is not ready: - * - keep it tentative if it is a permanent address. - * - otherwise, kill it. - */ - in6_ifa_hold(ifp); - addrconf_dad_stop(ifp); - return; - } - addrconf_dad_kick(ifp); + ifp->probes = idev->cnf.dad_transmits; + addrconf_mod_timer(ifp, AC_DAD, rand_num); + spin_unlock_bh(&ifp->lock); out: read_unlock_bh(&idev->lock); @@ -2562,22 +2481,6 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp) } } -static void addrconf_dad_run(struct inet6_dev *idev) { - struct inet6_ifaddr *ifp; - - read_lock_bh(&idev->lock); - for (ifp = idev->addr_list; ifp; ifp = ifp->if_next) { - spin_lock_bh(&ifp->lock); - if (!(ifp->flags & IFA_F_TENTATIVE)) { - spin_unlock_bh(&ifp->lock); - continue; - } - spin_unlock_bh(&ifp->lock); - addrconf_dad_kick(ifp); - } - read_unlock_bh(&idev->lock); -} - #ifdef CONFIG_PROC_FS struct if6_iter_state { int bucket; @@ -2723,7 +2626,7 @@ static void addrconf_verify(unsigned long foo) for (i=0; i < IN6_ADDR_HSIZE; i++) { restart: - read_lock(&addrconf_hash_lock); + write_lock(&addrconf_hash_lock); for (ifp=inet6_addr_lst[i]; ifp; ifp=ifp->lst_next) { unsigned long age; #ifdef CONFIG_IPV6_PRIVACY @@ -2745,7 +2648,7 @@ static void addrconf_verify(unsigned long foo) if (age >= ifp->valid_lft) { spin_unlock(&ifp->lock); in6_ifa_hold(ifp); - read_unlock(&addrconf_hash_lock); + write_unlock(&addrconf_hash_lock); ipv6_del_addr(ifp); goto restart; } else if (age >= ifp->prefered_lft) { @@ -2764,7 +2667,7 @@ static void addrconf_verify(unsigned long foo) if (deprecate) { in6_ifa_hold(ifp); - read_unlock(&addrconf_hash_lock); + write_unlock(&addrconf_hash_lock); ipv6_ifa_notify(0, ifp); in6_ifa_put(ifp); @@ -2782,10 +2685,7 @@ static void addrconf_verify(unsigned long foo) in6_ifa_hold(ifp); in6_ifa_hold(ifpub); spin_unlock(&ifp->lock); - read_unlock(&addrconf_hash_lock); - spin_lock(&ifpub->lock); - ifpub->regen_count = 0; - spin_unlock(&ifpub->lock); + write_unlock(&addrconf_hash_lock); ipv6_create_tempaddr(ifpub, ifp); in6_ifa_put(ifpub); in6_ifa_put(ifp); @@ -2802,7 +2702,7 @@ static void addrconf_verify(unsigned long foo) spin_unlock(&ifp->lock); } } - read_unlock(&addrconf_hash_lock); + write_unlock(&addrconf_hash_lock); } addr_chk_timer.expires = time_before(next, jiffies + HZ) ? jiffies + HZ : next; diff --git a/trunk/net/ipv6/af_inet6.c b/trunk/net/ipv6/af_inet6.c index 68afc53be662..c63b8ce0e1b5 100644 --- a/trunk/net/ipv6/af_inet6.c +++ b/trunk/net/ipv6/af_inet6.c @@ -92,13 +92,10 @@ static int inet6_create(struct socket *sock, int protocol) struct proto *answer_prot; unsigned char answer_flags; char answer_no_check; - int try_loading_module = 0; - int err; + int rc; /* Look for the requested type/protocol pair. */ answer = NULL; -lookup_protocol: - err = -ESOCKTNOSUPPORT; rcu_read_lock(); list_for_each_rcu(p, &inetsw6[sock->type]) { answer = list_entry(p, struct inet_protosw, list); @@ -116,37 +113,21 @@ static int inet6_create(struct socket *sock, int protocol) if (IPPROTO_IP == answer->protocol) break; } - err = -EPROTONOSUPPORT; answer = NULL; } - if (!answer) { - if (try_loading_module < 2) { - rcu_read_unlock(); - /* - * Be more specific, e.g. net-pf-10-proto-132-type-1 - * (net-pf-PF_INET6-proto-IPPROTO_SCTP-type-SOCK_STREAM) - */ - if (++try_loading_module == 1) - request_module("net-pf-%d-proto-%d-type-%d", - PF_INET6, protocol, sock->type); - /* - * Fall back to generic, e.g. net-pf-10-proto-132 - * (net-pf-PF_INET6-proto-IPPROTO_SCTP) - */ - else - request_module("net-pf-%d-proto-%d", - PF_INET6, protocol); - goto lookup_protocol; - } else - goto out_rcu_unlock; - } - - err = -EPERM; + rc = -ESOCKTNOSUPPORT; + if (!answer) + goto out_rcu_unlock; + rc = -EPERM; if (answer->capability > 0 && !capable(answer->capability)) goto out_rcu_unlock; + rc = -EPROTONOSUPPORT; + if (!protocol) + goto out_rcu_unlock; sock->ops = answer->ops; + answer_prot = answer->prot; answer_no_check = answer->no_check; answer_flags = answer->flags; @@ -154,20 +135,19 @@ static int inet6_create(struct socket *sock, int protocol) BUG_TRAP(answer_prot->slab != NULL); - err = -ENOBUFS; + rc = -ENOBUFS; sk = sk_alloc(PF_INET6, GFP_KERNEL, answer_prot, 1); if (sk == NULL) goto out; sock_init_data(sock, sk); - err = 0; + rc = 0; sk->sk_no_check = answer_no_check; if (INET_PROTOSW_REUSE & answer_flags) sk->sk_reuse = 1; inet = inet_sk(sk); - inet->is_icsk = INET_PROTOSW_ICSK & answer_flags; if (SOCK_RAW == sock->type) { inet->num = protocol; @@ -222,14 +202,14 @@ static int inet6_create(struct socket *sock, int protocol) sk->sk_prot->hash(sk); } if (sk->sk_prot->init) { - err = sk->sk_prot->init(sk); - if (err) { + rc = sk->sk_prot->init(sk); + if (rc) { sk_common_release(sk); goto out; } } out: - return err; + return rc; out_rcu_unlock: rcu_read_unlock(); goto out; @@ -390,8 +370,6 @@ int inet6_destroy_sock(struct sock *sk) return 0; } -EXPORT_SYMBOL_GPL(inet6_destroy_sock); - /* * This does both peername and sockname. */ @@ -434,6 +412,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr, int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { struct sock *sk = sock->sk; + int err = -EINVAL; switch(cmd) { @@ -452,15 +431,16 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) case SIOCSIFDSTADDR: return addrconf_set_dstaddr((void __user *) arg); default: - if (!sk->sk_prot->ioctl) - return -ENOIOCTLCMD; - return sk->sk_prot->ioctl(sk, cmd, arg); + if (!sk->sk_prot->ioctl || + (err = sk->sk_prot->ioctl(sk, cmd, arg)) == -ENOIOCTLCMD) + return(dev_ioctl(cmd,(void __user *) arg)); + return err; } /*NOTREACHED*/ return(0); } -const struct proto_ops inet6_stream_ops = { +struct proto_ops inet6_stream_ops = { .family = PF_INET6, .owner = THIS_MODULE, .release = inet6_release, @@ -481,7 +461,7 @@ const struct proto_ops inet6_stream_ops = { .sendpage = tcp_sendpage }; -const struct proto_ops inet6_dgram_ops = { +struct proto_ops inet6_dgram_ops = { .family = PF_INET6, .owner = THIS_MODULE, .release = inet6_release, @@ -509,7 +489,7 @@ static struct net_proto_family inet6_family_ops = { }; /* Same as inet6_dgram_ops, sans udp_poll. */ -static const struct proto_ops inet6_sockraw_ops = { +static struct proto_ops inet6_sockraw_ops = { .family = PF_INET6, .owner = THIS_MODULE, .release = inet6_release, @@ -610,79 +590,6 @@ inet6_unregister_protosw(struct inet_protosw *p) } } -int inet6_sk_rebuild_header(struct sock *sk) -{ - int err; - struct dst_entry *dst; - struct ipv6_pinfo *np = inet6_sk(sk); - - dst = __sk_dst_check(sk, np->dst_cookie); - - if (dst == NULL) { - struct inet_sock *inet = inet_sk(sk); - struct in6_addr *final_p = NULL, final; - struct flowi fl; - - memset(&fl, 0, sizeof(fl)); - fl.proto = sk->sk_protocol; - ipv6_addr_copy(&fl.fl6_dst, &np->daddr); - ipv6_addr_copy(&fl.fl6_src, &np->saddr); - fl.fl6_flowlabel = np->flow_label; - fl.oif = sk->sk_bound_dev_if; - fl.fl_ip_dport = inet->dport; - fl.fl_ip_sport = inet->sport; - - if (np->opt && np->opt->srcrt) { - struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; - ipv6_addr_copy(&final, &fl.fl6_dst); - ipv6_addr_copy(&fl.fl6_dst, rt0->addr); - final_p = &final; - } - - err = ip6_dst_lookup(sk, &dst, &fl); - if (err) { - sk->sk_route_caps = 0; - return err; - } - if (final_p) - ipv6_addr_copy(&fl.fl6_dst, final_p); - - if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { - sk->sk_err_soft = -err; - return err; - } - - ip6_dst_store(sk, dst, NULL); - sk->sk_route_caps = dst->dev->features & - ~(NETIF_F_IP_CSUM | NETIF_F_TSO); - } - - return 0; -} - -EXPORT_SYMBOL_GPL(inet6_sk_rebuild_header); - -int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb) -{ - struct ipv6_pinfo *np = inet6_sk(sk); - struct inet6_skb_parm *opt = IP6CB(skb); - - if (np->rxopt.all) { - if ((opt->hop && (np->rxopt.bits.hopopts || - np->rxopt.bits.ohopopts)) || - ((IPV6_FLOWINFO_MASK & *(u32*)skb->nh.raw) && - np->rxopt.bits.rxflow) || - (opt->srcrt && (np->rxopt.bits.srcrt || - np->rxopt.bits.osrcrt)) || - ((opt->dst1 || opt->dst0) && - (np->rxopt.bits.dstopts || np->rxopt.bits.odstopts))) - return 1; - } - return 0; -} - -EXPORT_SYMBOL_GPL(ipv6_opt_accepted); - int snmp6_mib_init(void *ptr[2], size_t mibsize, size_t mibalign) { diff --git a/trunk/net/ipv6/ah6.c b/trunk/net/ipv6/ah6.c index 13cc7f895583..f3629730eb15 100644 --- a/trunk/net/ipv6/ah6.c +++ b/trunk/net/ipv6/ah6.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/trunk/net/ipv6/datagram.c b/trunk/net/ipv6/datagram.c index c4a3a993acb7..cc518405b3e1 100644 --- a/trunk/net/ipv6/datagram.c +++ b/trunk/net/ipv6/datagram.c @@ -437,7 +437,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb) break; case IPPROTO_AH: nexthdr = ptr[0]; - len = (ptr[1] + 2) << 2; + len = (ptr[1] + 1) << 2; break; default: nexthdr = ptr[0]; diff --git a/trunk/net/ipv6/esp6.c b/trunk/net/ipv6/esp6.c index 6de8ee1a5ad9..40d9a1935ab5 100644 --- a/trunk/net/ipv6/esp6.c +++ b/trunk/net/ipv6/esp6.c @@ -36,7 +36,6 @@ #include #include #include -#include #include static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) @@ -249,7 +248,7 @@ static u32 esp6_get_max_size(struct xfrm_state *x, int mtu) if (esp->conf.padlen) mtu = ALIGN(mtu, esp->conf.padlen); - return mtu + x->props.header_len + esp->auth.icv_trunc_len; + return mtu + x->props.header_len + esp->auth.icv_full_len; } static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, diff --git a/trunk/net/ipv6/exthdrs.c b/trunk/net/ipv6/exthdrs.c index 113374dc342c..922549581abc 100644 --- a/trunk/net/ipv6/exthdrs.c +++ b/trunk/net/ipv6/exthdrs.c @@ -413,8 +413,6 @@ ipv6_invert_rthdr(struct sock *sk, struct ipv6_rt_hdr *hdr) return opt; } -EXPORT_SYMBOL_GPL(ipv6_invert_rthdr); - /********************************** Hop-by-hop options. **********************************/ @@ -581,8 +579,6 @@ ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt) return opt2; } -EXPORT_SYMBOL_GPL(ipv6_dup_options); - static int ipv6_renew_option(void *ohdr, struct ipv6_opt_hdr __user *newopt, int newoptlen, int inherit, @@ -632,7 +628,6 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, if (!tot_len) return NULL; - tot_len += sizeof(*opt2); opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC); if (!opt2) return ERR_PTR(-ENOBUFS); @@ -673,26 +668,7 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, return opt2; out: - sock_kfree_s(sk, opt2, opt2->tot_len); + sock_kfree_s(sk, p, tot_len); return ERR_PTR(err); } -struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, - struct ipv6_txoptions *opt) -{ - /* - * ignore the dest before srcrt unless srcrt is being included. - * --yoshfuji - */ - if (opt && opt->dst0opt && !opt->srcrt) { - if (opt_space != opt) { - memcpy(opt_space, opt, sizeof(*opt_space)); - opt = opt_space; - } - opt->opt_nflen -= ipv6_optlen(opt->dst0opt); - opt->dst0opt = NULL; - } - - return opt; -} - diff --git a/trunk/net/ipv6/icmp.c b/trunk/net/ipv6/icmp.c index 6ec6a2b549bb..1bdf0fb8bf8a 100644 --- a/trunk/net/ipv6/icmp.c +++ b/trunk/net/ipv6/icmp.c @@ -328,10 +328,8 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, iif = skb->dev->ifindex; /* - * Must not send error if the source does not uniquely - * identify a single node (RFC2463 Section 2.4). - * We check unspecified / multicast addresses here, - * and anycast addresses will be checked later. + * Must not send if we know that source is Anycast also. + * for now we don't know that. */ if ((addr_type == IPV6_ADDR_ANY) || (addr_type & IPV6_ADDR_MULTICAST)) { LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: addr_any/mcast source\n"); @@ -375,16 +373,6 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, err = ip6_dst_lookup(sk, &dst, &fl); if (err) goto out; - - /* - * We won't send icmp if the destination is known - * anycast. - */ - if (((struct rt6_info *)dst)->rt6i_flags & RTF_ANYCAST) { - LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: acast source\n"); - goto out_dst_release; - } - if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) goto out; @@ -763,7 +751,7 @@ void icmpv6_cleanup(void) inet6_del_protocol(&icmpv6_protocol, IPPROTO_ICMPV6); } -static const struct icmp6_err { +static struct icmp6_err { int err; int fatal; } tab_unreach[] = { diff --git a/trunk/net/ipv6/inet6_connection_sock.c b/trunk/net/ipv6/inet6_connection_sock.c deleted file mode 100644 index 792f90f0f9ec..000000000000 --- a/trunk/net/ipv6/inet6_connection_sock.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * INET An implementation of the TCP/IP protocol suite for the LINUX - * operating system. INET is implemented using the BSD Socket - * interface as the means of communication with the user level. - * - * Support for INET6 connection oriented protocols. - * - * Authors: See the TCPv6 sources - * - * 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 -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -int inet6_csk_bind_conflict(const struct sock *sk, - const struct inet_bind_bucket *tb) -{ - const struct sock *sk2; - const struct hlist_node *node; - - /* We must walk the whole port owner list in this case. -DaveM */ - sk_for_each_bound(sk2, node, &tb->owners) { - if (sk != sk2 && - (!sk->sk_bound_dev_if || - !sk2->sk_bound_dev_if || - sk->sk_bound_dev_if == sk2->sk_bound_dev_if) && - (!sk->sk_reuse || !sk2->sk_reuse || - sk2->sk_state == TCP_LISTEN) && - ipv6_rcv_saddr_equal(sk, sk2)) - break; - } - - return node != NULL; -} - -EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict); - -/* - * request_sock (formerly open request) hash tables. - */ -static u32 inet6_synq_hash(const struct in6_addr *raddr, const u16 rport, - const u32 rnd, const u16 synq_hsize) -{ - u32 a = raddr->s6_addr32[0]; - u32 b = raddr->s6_addr32[1]; - u32 c = raddr->s6_addr32[2]; - - a += JHASH_GOLDEN_RATIO; - b += JHASH_GOLDEN_RATIO; - c += rnd; - __jhash_mix(a, b, c); - - a += raddr->s6_addr32[3]; - b += (u32)rport; - __jhash_mix(a, b, c); - - return c & (synq_hsize - 1); -} - -struct request_sock *inet6_csk_search_req(const struct sock *sk, - struct request_sock ***prevp, - const __u16 rport, - const struct in6_addr *raddr, - const struct in6_addr *laddr, - const int iif) -{ - const struct inet_connection_sock *icsk = inet_csk(sk); - struct listen_sock *lopt = icsk->icsk_accept_queue.listen_opt; - struct request_sock *req, **prev; - - for (prev = &lopt->syn_table[inet6_synq_hash(raddr, rport, - lopt->hash_rnd, - lopt->nr_table_entries)]; - (req = *prev) != NULL; - prev = &req->dl_next) { - const struct inet6_request_sock *treq = inet6_rsk(req); - - if (inet_rsk(req)->rmt_port == rport && - req->rsk_ops->family == AF_INET6 && - ipv6_addr_equal(&treq->rmt_addr, raddr) && - ipv6_addr_equal(&treq->loc_addr, laddr) && - (!treq->iif || treq->iif == iif)) { - BUG_TRAP(req->sk == NULL); - *prevp = prev; - return req; - } - } - - return NULL; -} - -EXPORT_SYMBOL_GPL(inet6_csk_search_req); - -void inet6_csk_reqsk_queue_hash_add(struct sock *sk, - struct request_sock *req, - const unsigned long timeout) -{ - struct inet_connection_sock *icsk = inet_csk(sk); - struct listen_sock *lopt = icsk->icsk_accept_queue.listen_opt; - const u32 h = inet6_synq_hash(&inet6_rsk(req)->rmt_addr, - inet_rsk(req)->rmt_port, - lopt->hash_rnd, lopt->nr_table_entries); - - reqsk_queue_hash_req(&icsk->icsk_accept_queue, h, req, timeout); - inet_csk_reqsk_queue_added(sk, timeout); -} - -EXPORT_SYMBOL_GPL(inet6_csk_reqsk_queue_hash_add); - -void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) -{ - struct ipv6_pinfo *np = inet6_sk(sk); - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) uaddr; - - sin6->sin6_family = AF_INET6; - ipv6_addr_copy(&sin6->sin6_addr, &np->daddr); - sin6->sin6_port = inet_sk(sk)->dport; - /* We do not store received flowlabel for TCP */ - sin6->sin6_flowinfo = 0; - sin6->sin6_scope_id = 0; - if (sk->sk_bound_dev_if && - ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) - sin6->sin6_scope_id = sk->sk_bound_dev_if; -} - -EXPORT_SYMBOL_GPL(inet6_csk_addr2sockaddr); - -int inet6_csk_xmit(struct sk_buff *skb, int ipfragok) -{ - struct sock *sk = skb->sk; - struct inet_sock *inet = inet_sk(sk); - struct ipv6_pinfo *np = inet6_sk(sk); - struct flowi fl; - struct dst_entry *dst; - struct in6_addr *final_p = NULL, final; - - memset(&fl, 0, sizeof(fl)); - fl.proto = sk->sk_protocol; - ipv6_addr_copy(&fl.fl6_dst, &np->daddr); - ipv6_addr_copy(&fl.fl6_src, &np->saddr); - fl.fl6_flowlabel = np->flow_label; - IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel); - fl.oif = sk->sk_bound_dev_if; - fl.fl_ip_sport = inet->sport; - fl.fl_ip_dport = inet->dport; - - if (np->opt && np->opt->srcrt) { - struct rt0_hdr *rt0 = (struct rt0_hdr *)np->opt->srcrt; - ipv6_addr_copy(&final, &fl.fl6_dst); - ipv6_addr_copy(&fl.fl6_dst, rt0->addr); - final_p = &final; - } - - dst = __sk_dst_check(sk, np->dst_cookie); - - if (dst == NULL) { - int err = ip6_dst_lookup(sk, &dst, &fl); - - if (err) { - sk->sk_err_soft = -err; - return err; - } - - if (final_p) - ipv6_addr_copy(&fl.fl6_dst, final_p); - - if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { - sk->sk_route_caps = 0; - return err; - } - - ip6_dst_store(sk, dst, NULL); - sk->sk_route_caps = dst->dev->features & - ~(NETIF_F_IP_CSUM | NETIF_F_TSO); - } - - skb->dst = dst_clone(dst); - - /* Restore final destination back after routing done */ - ipv6_addr_copy(&fl.fl6_dst, &np->daddr); - - return ip6_xmit(sk, skb, &fl, np->opt, 0); -} - -EXPORT_SYMBOL_GPL(inet6_csk_xmit); diff --git a/trunk/net/ipv6/inet6_hashtables.c b/trunk/net/ipv6/inet6_hashtables.c index 4154f3a8b6cf..01d5f46d4e40 100644 --- a/trunk/net/ipv6/inet6_hashtables.c +++ b/trunk/net/ipv6/inet6_hashtables.c @@ -5,8 +5,7 @@ * * Generic INET6 transport hashtables * - * Authors: Lotsa people, from code originally in tcp, generalised here - * by Arnaldo Carvalho de Melo + * Authors: Lotsa people, from code originally in tcp * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -15,13 +14,12 @@ */ #include + #include -#include #include #include #include -#include struct sock *inet6_lookup_listener(struct inet_hashinfo *hashinfo, const struct in6_addr *daddr, @@ -81,180 +79,3 @@ struct sock *inet6_lookup(struct inet_hashinfo *hashinfo, } EXPORT_SYMBOL_GPL(inet6_lookup); - -static int __inet6_check_established(struct inet_timewait_death_row *death_row, - struct sock *sk, const __u16 lport, - struct inet_timewait_sock **twp) -{ - struct inet_hashinfo *hinfo = death_row->hashinfo; - const struct inet_sock *inet = inet_sk(sk); - const struct ipv6_pinfo *np = inet6_sk(sk); - const struct in6_addr *daddr = &np->rcv_saddr; - const struct in6_addr *saddr = &np->daddr; - const int dif = sk->sk_bound_dev_if; - const u32 ports = INET_COMBINED_PORTS(inet->dport, lport); - const unsigned int hash = inet6_ehashfn(daddr, inet->num, saddr, - inet->dport); - struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); - struct sock *sk2; - const struct hlist_node *node; - struct inet_timewait_sock *tw; - - prefetch(head->chain.first); - write_lock(&head->lock); - - /* Check TIME-WAIT sockets first. */ - sk_for_each(sk2, node, &(head + hinfo->ehash_size)->chain) { - const struct inet6_timewait_sock *tw6 = inet6_twsk(sk2); - - tw = inet_twsk(sk2); - - if(*((__u32 *)&(tw->tw_dport)) == ports && - sk2->sk_family == PF_INET6 && - ipv6_addr_equal(&tw6->tw_v6_daddr, saddr) && - ipv6_addr_equal(&tw6->tw_v6_rcv_saddr, daddr) && - sk2->sk_bound_dev_if == sk->sk_bound_dev_if) { - if (twsk_unique(sk, sk2, twp)) - goto unique; - else - goto not_unique; - } - } - tw = NULL; - - /* And established part... */ - sk_for_each(sk2, node, &head->chain) { - if (INET6_MATCH(sk2, hash, saddr, daddr, ports, dif)) - goto not_unique; - } - -unique: - BUG_TRAP(sk_unhashed(sk)); - __sk_add_node(sk, &head->chain); - sk->sk_hash = hash; - sock_prot_inc_use(sk->sk_prot); - write_unlock(&head->lock); - - if (twp != NULL) { - *twp = tw; - NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); - } else if (tw != NULL) { - /* Silly. Should hash-dance instead... */ - inet_twsk_deschedule(tw, death_row); - NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); - - inet_twsk_put(tw); - } - return 0; - -not_unique: - write_unlock(&head->lock); - return -EADDRNOTAVAIL; -} - -static inline u32 inet6_sk_port_offset(const struct sock *sk) -{ - const struct inet_sock *inet = inet_sk(sk); - const struct ipv6_pinfo *np = inet6_sk(sk); - return secure_ipv6_port_ephemeral(np->rcv_saddr.s6_addr32, - np->daddr.s6_addr32, - inet->dport); -} - -int inet6_hash_connect(struct inet_timewait_death_row *death_row, - struct sock *sk) -{ - struct inet_hashinfo *hinfo = death_row->hashinfo; - const unsigned short snum = inet_sk(sk)->num; - struct inet_bind_hashbucket *head; - struct inet_bind_bucket *tb; - int ret; - - if (snum == 0) { - const int low = sysctl_local_port_range[0]; - const int high = sysctl_local_port_range[1]; - const int range = high - low; - int i, port; - static u32 hint; - const u32 offset = hint + inet6_sk_port_offset(sk); - struct hlist_node *node; - struct inet_timewait_sock *tw = NULL; - - local_bh_disable(); - for (i = 1; i <= range; i++) { - port = low + (i + offset) % range; - head = &hinfo->bhash[inet_bhashfn(port, hinfo->bhash_size)]; - spin_lock(&head->lock); - - /* Does not bother with rcv_saddr checks, - * because the established check is already - * unique enough. - */ - inet_bind_bucket_for_each(tb, node, &head->chain) { - if (tb->port == port) { - BUG_TRAP(!hlist_empty(&tb->owners)); - if (tb->fastreuse >= 0) - goto next_port; - if (!__inet6_check_established(death_row, - sk, port, - &tw)) - goto ok; - goto next_port; - } - } - - tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep, - head, port); - if (!tb) { - spin_unlock(&head->lock); - break; - } - tb->fastreuse = -1; - goto ok; - - next_port: - spin_unlock(&head->lock); - } - local_bh_enable(); - - return -EADDRNOTAVAIL; - -ok: - hint += i; - - /* Head lock still held and bh's disabled */ - inet_bind_hash(sk, tb, port); - if (sk_unhashed(sk)) { - inet_sk(sk)->sport = htons(port); - __inet6_hash(hinfo, sk); - } - spin_unlock(&head->lock); - - if (tw) { - inet_twsk_deschedule(tw, death_row); - inet_twsk_put(tw); - } - - ret = 0; - goto out; - } - - head = &hinfo->bhash[inet_bhashfn(snum, hinfo->bhash_size)]; - tb = inet_csk(sk)->icsk_bind_hash; - spin_lock_bh(&head->lock); - - if (sk_head(&tb->owners) == sk && sk->sk_bind_node.next == NULL) { - __inet6_hash(hinfo, sk); - spin_unlock_bh(&head->lock); - return 0; - } else { - spin_unlock(&head->lock); - /* No definite answer... Walk to established hash table */ - ret = __inet6_check_established(death_row, sk, snum, NULL); -out: - local_bh_enable(); - return ret; - } -} - -EXPORT_SYMBOL_GPL(inet6_hash_connect); diff --git a/trunk/net/ipv6/ip6_flowlabel.c b/trunk/net/ipv6/ip6_flowlabel.c index 89d12b4817a9..bbbe80cdaf72 100644 --- a/trunk/net/ipv6/ip6_flowlabel.c +++ b/trunk/net/ipv6/ip6_flowlabel.c @@ -200,8 +200,6 @@ struct ip6_flowlabel * fl6_sock_lookup(struct sock *sk, u32 label) return NULL; } -EXPORT_SYMBOL_GPL(fl6_sock_lookup); - void fl6_free_socklist(struct sock *sk) { struct ipv6_pinfo *np = inet6_sk(sk); @@ -227,16 +225,20 @@ struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions * opt_space, struct ip6_flowlabel * fl, struct ipv6_txoptions * fopt) { - struct ipv6_txoptions * fl_opt = fl->opt; - - if (fopt == NULL || fopt->opt_flen == 0) - return fl_opt; - + struct ipv6_txoptions * fl_opt = fl ? fl->opt : NULL; + + if (fopt == NULL || fopt->opt_flen == 0) { + if (!fl_opt || !fl_opt->dst0opt || fl_opt->srcrt) + return fl_opt; + } + if (fl_opt != NULL) { opt_space->hopopt = fl_opt->hopopt; - opt_space->dst0opt = fl_opt->dst0opt; + opt_space->dst0opt = fl_opt->srcrt ? fl_opt->dst0opt : NULL; opt_space->srcrt = fl_opt->srcrt; opt_space->opt_nflen = fl_opt->opt_nflen; + if (fl_opt->dst0opt && !fl_opt->srcrt) + opt_space->opt_nflen -= ipv6_optlen(fl_opt->dst0opt); } else { if (fopt->opt_nflen == 0) return fopt; diff --git a/trunk/net/ipv6/ip6_output.c b/trunk/net/ipv6/ip6_output.c index b4c4beba0ede..c1fa693511a1 100644 --- a/trunk/net/ipv6/ip6_output.c +++ b/trunk/net/ipv6/ip6_output.c @@ -774,10 +774,7 @@ int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl) *dst = NULL; return err; } - -EXPORT_SYMBOL_GPL(ip6_dst_lookup); - -static inline int ip6_ufo_append_data(struct sock *sk, +inline int ip6_ufo_append_data(struct sock *sk, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int hh_len, int fragheaderlen, diff --git a/trunk/net/ipv6/ipcomp6.c b/trunk/net/ipv6/ipcomp6.c index 626dd39685f2..55917fb17094 100644 --- a/trunk/net/ipv6/ipcomp6.c +++ b/trunk/net/ipv6/ipcomp6.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #include diff --git a/trunk/net/ipv6/ipv6_sockglue.c b/trunk/net/ipv6/ipv6_sockglue.c index c63868dd2ca2..003fd99ff597 100644 --- a/trunk/net/ipv6/ipv6_sockglue.c +++ b/trunk/net/ipv6/ipv6_sockglue.c @@ -163,17 +163,17 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, sk_refcnt_debug_dec(sk); if (sk->sk_protocol == IPPROTO_TCP) { - struct inet_connection_sock *icsk = inet_csk(sk); + struct tcp_sock *tp = tcp_sk(sk); local_bh_disable(); sock_prot_dec_use(sk->sk_prot); sock_prot_inc_use(&tcp_prot); local_bh_enable(); sk->sk_prot = &tcp_prot; - icsk->icsk_af_ops = &ipv4_specific; + tp->af_specific = &ipv4_specific; sk->sk_socket->ops = &inet_stream_ops; sk->sk_family = PF_INET; - tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); + tcp_sync_mss(sk, tp->pmtu_cookie); } else { local_bh_disable(); sock_prot_dec_use(sk->sk_prot); @@ -287,7 +287,7 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, { struct ipv6_txoptions *opt; if (optlen == 0) - optval = NULL; + optval = 0; /* hop-by-hop / destination options are privileged option */ retv = -EPERM; @@ -317,15 +317,14 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, } retv = 0; - if (inet_sk(sk)->is_icsk) { + if (sk->sk_type == SOCK_STREAM) { if (opt) { - struct inet_connection_sock *icsk = inet_csk(sk); + struct tcp_sock *tp = tcp_sk(sk); if (!((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) && inet_sk(sk)->daddr != LOOPBACK4_IPV6) { - icsk->icsk_ext_hdr_len = - opt->opt_flen + opt->opt_nflen; - icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie); + tp->ext_header_len = opt->opt_flen + opt->opt_nflen; + tcp_sync_mss(sk, tp->pmtu_cookie); } } opt = xchg(&np->opt, opt); @@ -381,15 +380,14 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, goto done; update: retv = 0; - if (inet_sk(sk)->is_icsk) { + if (sk->sk_type == SOCK_STREAM) { if (opt) { - struct inet_connection_sock *icsk = inet_csk(sk); + struct tcp_sock *tp = tcp_sk(sk); if (!((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) && inet_sk(sk)->daddr != LOOPBACK4_IPV6) { - icsk->icsk_ext_hdr_len = - opt->opt_flen + opt->opt_nflen; - icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie); + tp->ext_header_len = opt->opt_flen + opt->opt_nflen; + tcp_sync_mss(sk, tp->pmtu_cookie); } } opt = xchg(&np->opt, opt); @@ -630,8 +628,8 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, return -EINVAL; } -static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr, - char __user *optval, int len) +int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr, + char __user *optval, int len) { if (!hdr) return 0; diff --git a/trunk/net/ipv6/mcast.c b/trunk/net/ipv6/mcast.c index 1cf305a9f8dd..f15e04ad026e 100644 --- a/trunk/net/ipv6/mcast.c +++ b/trunk/net/ipv6/mcast.c @@ -170,7 +170,7 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, #define MLDV2_QQIC(value) MLDV2_EXP(0x80, 4, 3, value) #define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value) -#define IPV6_MLD_MAX_MSF 64 +#define IPV6_MLD_MAX_MSF 10 int sysctl_mld_max_msf = IPV6_MLD_MAX_MSF; @@ -224,7 +224,6 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, struct in6_addr *addr) mc_lst->ifindex = dev->ifindex; mc_lst->sfmode = MCAST_EXCLUDE; - rwlock_init(&mc_lst->sflock); mc_lst->sflist = NULL; /* @@ -361,7 +360,6 @@ int ip6_mc_source(int add, int omode, struct sock *sk, struct ip6_sf_socklist *psl; int i, j, rv; int leavegroup = 0; - int pmclocked = 0; int err; if (pgsr->gsr_group.ss_family != AF_INET6 || @@ -405,9 +403,6 @@ int ip6_mc_source(int add, int omode, struct sock *sk, pmc->sfmode = omode; } - write_lock_bh(&pmc->sflock); - pmclocked = 1; - psl = pmc->sflist; if (!add) { if (!psl) @@ -480,8 +475,6 @@ int ip6_mc_source(int add, int omode, struct sock *sk, /* update the interface list */ ip6_mc_add_src(idev, group, omode, 1, source, 1); done: - if (pmclocked) - write_unlock_bh(&pmc->sflock); read_unlock_bh(&ipv6_sk_mc_lock); read_unlock_bh(&idev->lock); in6_dev_put(idev); @@ -517,8 +510,6 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf) dev = idev->dev; err = 0; - read_lock_bh(&ipv6_sk_mc_lock); - if (gsf->gf_fmode == MCAST_INCLUDE && gsf->gf_numsrc == 0) { leavegroup = 1; goto done; @@ -558,8 +549,6 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf) newpsl = NULL; (void) ip6_mc_add_src(idev, group, gsf->gf_fmode, 0, NULL, 0); } - - write_lock_bh(&pmc->sflock); psl = pmc->sflist; if (psl) { (void) ip6_mc_del_src(idev, group, pmc->sfmode, @@ -569,10 +558,8 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf) (void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0); pmc->sflist = newpsl; pmc->sfmode = gsf->gf_fmode; - write_unlock_bh(&pmc->sflock); err = 0; done: - read_unlock_bh(&ipv6_sk_mc_lock); read_unlock_bh(&idev->lock); in6_dev_put(idev); dev_put(dev); @@ -605,11 +592,6 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, dev = idev->dev; err = -EADDRNOTAVAIL; - /* - * changes to the ipv6_mc_list require the socket lock and - * a read lock on ip6_sk_mc_lock. We have the socket lock, - * so reading the list is safe. - */ for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) { if (pmc->ifindex != gsf->gf_interface) @@ -632,10 +614,6 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, copy_to_user(optval, gsf, GROUP_FILTER_SIZE(0))) { return -EFAULT; } - /* changes to psl require the socket lock, a read lock on - * on ipv6_sk_mc_lock and a write lock on pmc->sflock. We - * have the socket lock, so reading here is safe. - */ for (i=0; isflock); psl = mc->sflist; if (!psl) { rv = mc->sfmode == MCAST_EXCLUDE; @@ -688,7 +665,6 @@ int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, if (mc->sfmode == MCAST_EXCLUDE && i < psl->sl_count) rv = 0; } - read_unlock(&mc->sflock); read_unlock(&ipv6_sk_mc_lock); return rv; @@ -1092,64 +1068,23 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime) ma->mca_flags |= MAF_TIMER_RUNNING; } -/* mark EXCLUDE-mode sources */ -static int mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs, - struct in6_addr *srcs) -{ - struct ip6_sf_list *psf; - int i, scount; - - scount = 0; - for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { - if (scount == nsrcs) - break; - for (i=0; imca_sfcount[MCAST_INCLUDE] || - pmc->mca_sfcount[MCAST_EXCLUDE] != - psf->sf_count[MCAST_EXCLUDE]) - continue; - if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) { - scount++; - break; - } - } - } - pmc->mca_flags &= ~MAF_GSQUERY; - if (scount == nsrcs) /* all sources excluded */ - return 0; - return 1; -} - -static int mld_marksources(struct ifmcaddr6 *pmc, int nsrcs, +static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs, struct in6_addr *srcs) { struct ip6_sf_list *psf; int i, scount; - if (pmc->mca_sfmode == MCAST_EXCLUDE) - return mld_xmarksources(pmc, nsrcs, srcs); - - /* mark INCLUDE-mode sources */ - scount = 0; for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { if (scount == nsrcs) break; - for (i=0; isf_addr)) { psf->sf_gsresp = 1; scount++; break; } - } - } - if (!scount) { - pmc->mca_flags &= ~MAF_GSQUERY; - return 0; } - pmc->mca_flags |= MAF_GSQUERY; - return 1; } int igmp6_event_query(struct sk_buff *skb) @@ -1232,7 +1167,7 @@ int igmp6_event_query(struct sk_buff *skb) /* mark sources to include, if group & source-specific */ if (mlh2->nsrcs != 0) { if (!pskb_may_pull(skb, srcs_offset + - ntohs(mlh2->nsrcs) * sizeof(struct in6_addr))) { + mlh2->nsrcs * sizeof(struct in6_addr))) { in6_dev_put(idev); return -EINVAL; } @@ -1268,9 +1203,10 @@ int igmp6_event_query(struct sk_buff *skb) else ma->mca_flags &= ~MAF_GSQUERY; } - if (!(ma->mca_flags & MAF_GSQUERY) || - mld_marksources(ma, ntohs(mlh2->nsrcs), mlh2->srcs)) - igmp6_group_queried(ma, max_delay); + if (ma->mca_flags & MAF_GSQUERY) + mld_marksources(ma, ntohs(mlh2->nsrcs), + mlh2->srcs); + igmp6_group_queried(ma, max_delay); spin_unlock_bh(&ma->mca_lock); if (group_type != IPV6_ADDR_ANY) break; @@ -1295,11 +1231,6 @@ int igmp6_event_report(struct sk_buff *skb) if (skb->pkt_type == PACKET_LOOPBACK) return 0; - /* send our report if the MC router may not have heard this report */ - if (skb->pkt_type != PACKET_MULTICAST && - skb->pkt_type != PACKET_BROADCAST) - return 0; - if (!pskb_may_pull(skb, sizeof(struct in6_addr))) return -EINVAL; @@ -1345,18 +1276,7 @@ static int is_in(struct ifmcaddr6 *pmc, struct ip6_sf_list *psf, int type, case MLD2_MODE_IS_EXCLUDE: if (gdeleted || sdeleted) return 0; - if (!((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp)) { - if (pmc->mca_sfmode == MCAST_INCLUDE) - return 1; - /* don't include if this source is excluded - * in all filters - */ - if (psf->sf_count[MCAST_INCLUDE]) - return 0; - return pmc->mca_sfcount[MCAST_EXCLUDE] == - psf->sf_count[MCAST_EXCLUDE]; - } - return 0; + return !((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp); case MLD2_CHANGE_TO_INCLUDE: if (gdeleted || sdeleted) return 0; @@ -1525,7 +1445,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc, struct mld2_report *pmr; struct mld2_grec *pgr = NULL; struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list; - int scount, stotal, first, isquery, truncate; + int scount, first, isquery, truncate; if (pmc->mca_flags & MAF_NOREPORT) return skb; @@ -1535,13 +1455,25 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc, truncate = type == MLD2_MODE_IS_EXCLUDE || type == MLD2_CHANGE_TO_EXCLUDE; - stotal = scount = 0; - psf_list = sdeleted ? &pmc->mca_tomb : &pmc->mca_sources; - if (!*psf_list) - goto empty_source; - + if (!*psf_list) { + if (type == MLD2_ALLOW_NEW_SOURCES || + type == MLD2_BLOCK_OLD_SOURCES) + return skb; + if (pmc->mca_crcount || isquery) { + /* make sure we have room for group header and at + * least one source. + */ + if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)+ + sizeof(struct in6_addr)) { + mld_sendpack(skb); + skb = NULL; /* add_grhead will get a new one */ + } + skb = add_grhead(skb, pmc, type, &pgr); + } + return skb; + } pmr = skb ? (struct mld2_report *)skb->h.raw : NULL; /* EX and TO_EX get a fresh packet, if needed */ @@ -1554,6 +1486,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc, } } first = 1; + scount = 0; psf_prev = NULL; for (psf=*psf_list; psf; psf=psf_next) { struct in6_addr *psrc; @@ -1587,7 +1520,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc, } psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc)); *psrc = psf->sf_addr; - scount++; stotal++; + scount++; if ((type == MLD2_ALLOW_NEW_SOURCES || type == MLD2_BLOCK_OLD_SOURCES) && psf->sf_crcount) { psf->sf_crcount--; @@ -1602,21 +1535,6 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc, } psf_prev = psf; } - -empty_source: - if (!stotal) { - if (type == MLD2_ALLOW_NEW_SOURCES || - type == MLD2_BLOCK_OLD_SOURCES) - return skb; - if (pmc->mca_crcount || isquery) { - /* make sure we have room for group header */ - if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)) { - mld_sendpack(skb); - skb = NULL; /* add_grhead will get a new one */ - } - skb = add_grhead(skb, pmc, type, &pgr); - } - } if (pgr) pgr->grec_nsrcs = htons(scount); @@ -1698,11 +1616,11 @@ static void mld_send_cr(struct inet6_dev *idev) skb = add_grec(skb, pmc, dtype, 1, 1); } if (pmc->mca_crcount) { + pmc->mca_crcount--; if (pmc->mca_sfmode == MCAST_EXCLUDE) { type = MLD2_CHANGE_TO_INCLUDE; skb = add_grec(skb, pmc, type, 1, 0); } - pmc->mca_crcount--; if (pmc->mca_crcount == 0) { mld_clear_zeros(&pmc->mca_tomb); mld_clear_zeros(&pmc->mca_sources); @@ -1736,12 +1654,12 @@ static void mld_send_cr(struct inet6_dev *idev) /* filter mode changes */ if (pmc->mca_crcount) { + pmc->mca_crcount--; if (pmc->mca_sfmode == MCAST_EXCLUDE) type = MLD2_CHANGE_TO_EXCLUDE; else type = MLD2_CHANGE_TO_INCLUDE; skb = add_grec(skb, pmc, type, 0, 0); - pmc->mca_crcount--; } spin_unlock_bh(&pmc->mca_lock); } @@ -2100,9 +2018,6 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, { int err; - /* callers have the socket lock and a write lock on ipv6_sk_mc_lock, - * so no other readers or writers of iml or its sflist - */ if (iml->sflist == 0) { /* any-source empty exclude case */ return ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, NULL, 0); diff --git a/trunk/net/ipv6/netfilter/Kconfig b/trunk/net/ipv6/netfilter/Kconfig index 04912f9b35c3..971ba60bf6e9 100644 --- a/trunk/net/ipv6/netfilter/Kconfig +++ b/trunk/net/ipv6/netfilter/Kconfig @@ -5,20 +5,10 @@ menu "IPv6: Netfilter Configuration (EXPERIMENTAL)" depends on INET && IPV6 && NETFILTER && EXPERIMENTAL -config NF_CONNTRACK_IPV6 - tristate "IPv6 support for new connection tracking (EXPERIMENTAL)" - depends on EXPERIMENTAL && NF_CONNTRACK - ---help--- - Connection tracking keeps a record of what packets have passed - through your machine, in order to figure out how they are related - into connections. - - This is IPv6 support on Layer 3 independent connection tracking. - Layer 3 independent connection tracking is experimental scheme - which generalize ip_conntrack to support other layer 3 protocols. - - To compile it as a module, choose M here. If unsure, say N. - +#tristate 'Connection tracking (required for masq/NAT)' CONFIG_IP6_NF_CONNTRACK +#if [ "$CONFIG_IP6_NF_CONNTRACK" != "n" ]; then +# dep_tristate ' FTP protocol support' CONFIG_IP6_NF_FTP $CONFIG_IP6_NF_CONNTRACK +#fi config IP6_NF_QUEUE tristate "IP6 Userspace queueing via NETLINK (OBSOLETE)" ---help--- @@ -124,6 +114,7 @@ config IP6_NF_MATCH_OWNER To compile it as a module, choose M here. If unsure, say N. +# dep_tristate ' MAC address match support' CONFIG_IP6_NF_MATCH_MAC $CONFIG_IP6_NF_IPTABLES config IP6_NF_MATCH_MARK tristate "netfilter MARK match support" depends on IP6_NF_IPTABLES @@ -179,6 +170,15 @@ config IP6_NF_MATCH_PHYSDEV To compile it as a module, choose M here. If unsure, say N. +# dep_tristate ' Multiple port match support' CONFIG_IP6_NF_MATCH_MULTIPORT $CONFIG_IP6_NF_IPTABLES +# dep_tristate ' TOS match support' CONFIG_IP6_NF_MATCH_TOS $CONFIG_IP6_NF_IPTABLES +# if [ "$CONFIG_IP6_NF_CONNTRACK" != "n" ]; then +# dep_tristate ' Connection state match support' CONFIG_IP6_NF_MATCH_STATE $CONFIG_IP6_NF_CONNTRACK $CONFIG_IP6_NF_IPTABLES +# fi +# if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then +# dep_tristate ' Unclean match support (EXPERIMENTAL)' CONFIG_IP6_NF_MATCH_UNCLEAN $CONFIG_IP6_NF_IPTABLES +# dep_tristate ' Owner match support (EXPERIMENTAL)' CONFIG_IP6_NF_MATCH_OWNER $CONFIG_IP6_NF_IPTABLES +# fi # The targets config IP6_NF_FILTER tristate "Packet filtering" @@ -211,7 +211,7 @@ config IP6_NF_TARGET_REJECT config IP6_NF_TARGET_NFQUEUE tristate "NFQUEUE Target Support" - depends on IP6_NF_IPTABLES + depends on IP_NF_IPTABLES help This Target replaced the old obsolete QUEUE target. @@ -220,6 +220,12 @@ config IP6_NF_TARGET_NFQUEUE To compile it as a module, choose M here. If unsure, say N. +# if [ "$CONFIG_IP6_NF_FILTER" != "n" ]; then +# dep_tristate ' REJECT target support' CONFIG_IP6_NF_TARGET_REJECT $CONFIG_IP6_NF_FILTER +# if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then +# dep_tristate ' MIRROR target support (EXPERIMENTAL)' CONFIG_IP6_NF_TARGET_MIRROR $CONFIG_IP6_NF_FILTER +# fi +# fi config IP6_NF_MANGLE tristate "Packet mangling" depends on IP6_NF_IPTABLES @@ -230,6 +236,7 @@ config IP6_NF_MANGLE To compile it as a module, choose M here. If unsure, say N. +# dep_tristate ' TOS target support' CONFIG_IP6_NF_TARGET_TOS $CONFIG_IP_NF_MANGLE config IP6_NF_TARGET_MARK tristate "MARK target support" depends on IP6_NF_MANGLE @@ -259,6 +266,7 @@ config IP6_NF_TARGET_HL To compile it as a module, choose M here. If unsure, say N. +#dep_tristate ' LOG target support' CONFIG_IP6_NF_TARGET_LOG $CONFIG_IP6_NF_IPTABLES config IP6_NF_RAW tristate 'raw table support (required for TRACE)' depends on IP6_NF_IPTABLES @@ -270,5 +278,19 @@ config IP6_NF_RAW If you want to compile it as a module, say M here and read . If unsure, say `N'. +config NF_CONNTRACK_IPV6 + tristate "IPv6 support for new connection tracking (EXPERIMENTAL)" + depends on EXPERIMENTAL && NF_CONNTRACK + ---help--- + Connection tracking keeps a record of what packets have passed + through your machine, in order to figure out how they are related + into connections. + + This is IPv6 support on Layer 3 independent connection tracking. + Layer 3 independent connection tracking is experimental scheme + which generalize ip_conntrack to support other layer 3 protocols. + + To compile it as a module, choose M here. If unsure, say N. + endmenu diff --git a/trunk/net/ipv6/netfilter/ip6_tables.c b/trunk/net/ipv6/netfilter/ip6_tables.c index ea43ef1d94a7..7d492226c16e 100644 --- a/trunk/net/ipv6/netfilter/ip6_tables.c +++ b/trunk/net/ipv6/netfilter/ip6_tables.c @@ -15,7 +15,6 @@ * - new extension header parser code */ #include -#include #include #include #include @@ -87,6 +86,11 @@ static DECLARE_MUTEX(ip6t_mutex); context stops packets coming through and allows user context to read the counters or update the rules. + To be cache friendly on SMP, we arrange them like so: + [ n-entries ] + ... cache-align padding ... + [ n-entries ] + Hence the start of any table is given by get_table() below. */ /* The table itself */ @@ -104,15 +108,20 @@ struct ip6t_table_info unsigned int underflow[NF_IP6_NUMHOOKS]; /* ip6t_entry tables: one per CPU */ - void *entries[NR_CPUS]; + char entries[0] ____cacheline_aligned; }; static LIST_HEAD(ip6t_target); static LIST_HEAD(ip6t_match); static LIST_HEAD(ip6t_tables); -#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) #define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) +#ifdef CONFIG_SMP +#define TABLE_OFFSET(t,p) (SMP_ALIGN((t)->size)*(p)) +#else +#define TABLE_OFFSET(t,p) 0 +#endif + #if 0 #define down(x) do { printk("DOWN:%u:" #x "\n", __LINE__); down(x); } while(0) #define down_interruptible(x) ({ int __r; printk("DOWNi:%u:" #x "\n", __LINE__); __r = down_interruptible(x); if (__r != 0) printk("ABORT-DOWNi:%u\n", __LINE__); __r; }) @@ -367,7 +376,8 @@ ip6t_do_table(struct sk_buff **pskb, read_lock_bh(&table->lock); IP_NF_ASSERT(table->valid_hooks & (1 << hook)); - table_base = (void *)table->private->entries[smp_processor_id()]; + table_base = (void *)table->private->entries + + TABLE_OFFSET(table->private, smp_processor_id()); e = get_entry(table_base, table->private->hook_entry[hook]); #ifdef CONFIG_NETFILTER_DEBUG @@ -639,8 +649,7 @@ unconditional(const struct ip6t_ip6 *ipv6) /* Figures out from what hook each rule can be called: returns 0 if there are loops. Puts hook bitmask in comefrom. */ static int -mark_source_chains(struct ip6t_table_info *newinfo, - unsigned int valid_hooks, void *entry0) +mark_source_chains(struct ip6t_table_info *newinfo, unsigned int valid_hooks) { unsigned int hook; @@ -649,7 +658,7 @@ mark_source_chains(struct ip6t_table_info *newinfo, for (hook = 0; hook < NF_IP6_NUMHOOKS; hook++) { unsigned int pos = newinfo->hook_entry[hook]; struct ip6t_entry *e - = (struct ip6t_entry *)(entry0 + pos); + = (struct ip6t_entry *)(newinfo->entries + pos); if (!(valid_hooks & (1 << hook))) continue; @@ -699,13 +708,13 @@ mark_source_chains(struct ip6t_table_info *newinfo, goto next; e = (struct ip6t_entry *) - (entry0 + pos); + (newinfo->entries + pos); } while (oldpos == pos + e->next_offset); /* Move along one */ size = e->next_offset; e = (struct ip6t_entry *) - (entry0 + pos + size); + (newinfo->entries + pos + size); e->counters.pcnt = pos; pos += size; } else { @@ -722,7 +731,7 @@ mark_source_chains(struct ip6t_table_info *newinfo, newpos = pos + e->next_offset; } e = (struct ip6t_entry *) - (entry0 + newpos); + (newinfo->entries + newpos); e->counters.pcnt = pos; pos = newpos; } @@ -932,7 +941,6 @@ static int translate_table(const char *name, unsigned int valid_hooks, struct ip6t_table_info *newinfo, - void *entry0, unsigned int size, unsigned int number, const unsigned int *hook_entries, @@ -953,11 +961,11 @@ translate_table(const char *name, duprintf("translate_table: size %u\n", newinfo->size); i = 0; /* Walk through entries, checking offsets. */ - ret = IP6T_ENTRY_ITERATE(entry0, newinfo->size, + ret = IP6T_ENTRY_ITERATE(newinfo->entries, newinfo->size, check_entry_size_and_hooks, newinfo, - entry0, - entry0 + size, + newinfo->entries, + newinfo->entries + size, hook_entries, underflows, &i); if (ret != 0) return ret; @@ -985,24 +993,27 @@ translate_table(const char *name, } } - if (!mark_source_chains(newinfo, valid_hooks, entry0)) + if (!mark_source_chains(newinfo, valid_hooks)) return -ELOOP; /* Finally, each sanity check must pass */ i = 0; - ret = IP6T_ENTRY_ITERATE(entry0, newinfo->size, + ret = IP6T_ENTRY_ITERATE(newinfo->entries, newinfo->size, check_entry, name, size, &i); if (ret != 0) { - IP6T_ENTRY_ITERATE(entry0, newinfo->size, + IP6T_ENTRY_ITERATE(newinfo->entries, newinfo->size, cleanup_entry, &i); return ret; } /* And one copy for every other CPU */ for_each_cpu(i) { - if (newinfo->entries[i] && newinfo->entries[i] != entry0) - memcpy(newinfo->entries[i], entry0, newinfo->size); + if (i == 0) + continue; + memcpy(newinfo->entries + SMP_ALIGN(newinfo->size) * i, + newinfo->entries, + SMP_ALIGN(newinfo->size)); } return ret; @@ -1018,12 +1029,15 @@ replace_table(struct ip6t_table *table, #ifdef CONFIG_NETFILTER_DEBUG { - int cpu; + struct ip6t_entry *table_base; + unsigned int i; - for_each_cpu(cpu) { - struct ip6t_entry *table_base = newinfo->entries[cpu]; - if (table_base) - table_base->comefrom = 0xdead57ac; + for_each_cpu(i) { + table_base = + (void *)newinfo->entries + + TABLE_OFFSET(newinfo, i); + + table_base->comefrom = 0xdead57ac; } } #endif @@ -1058,44 +1072,16 @@ add_entry_to_counter(const struct ip6t_entry *e, return 0; } -static inline int -set_entry_to_counter(const struct ip6t_entry *e, - struct ip6t_counters total[], - unsigned int *i) -{ - SET_COUNTER(total[*i], e->counters.bcnt, e->counters.pcnt); - - (*i)++; - return 0; -} - static void get_counters(const struct ip6t_table_info *t, struct ip6t_counters counters[]) { unsigned int cpu; unsigned int i; - unsigned int curcpu; - - /* Instead of clearing (by a previous call to memset()) - * the counters and using adds, we set the counters - * with data used by 'current' CPU - * We dont care about preemption here. - */ - curcpu = raw_smp_processor_id(); - - i = 0; - IP6T_ENTRY_ITERATE(t->entries[curcpu], - t->size, - set_entry_to_counter, - counters, - &i); for_each_cpu(cpu) { - if (cpu == curcpu) - continue; i = 0; - IP6T_ENTRY_ITERATE(t->entries[cpu], + IP6T_ENTRY_ITERATE(t->entries + TABLE_OFFSET(t, cpu), t->size, add_entry_to_counter, counters, @@ -1112,7 +1098,6 @@ copy_entries_to_user(unsigned int total_size, struct ip6t_entry *e; struct ip6t_counters *counters; int ret = 0; - void *loc_cpu_entry; /* We need atomic snapshot of counters: rest doesn't change (other than comefrom, which userspace doesn't care @@ -1124,13 +1109,13 @@ copy_entries_to_user(unsigned int total_size, return -ENOMEM; /* First, sum counters... */ + memset(counters, 0, countersize); write_lock_bh(&table->lock); get_counters(table->private, counters); write_unlock_bh(&table->lock); - /* choose the copy that is on ourc node/cpu */ - loc_cpu_entry = table->private->entries[raw_smp_processor_id()]; - if (copy_to_user(userptr, loc_cpu_entry, total_size) != 0) { + /* ... then copy entire thing from CPU 0... */ + if (copy_to_user(userptr, table->private->entries, total_size) != 0) { ret = -EFAULT; goto free_counters; } @@ -1142,7 +1127,7 @@ copy_entries_to_user(unsigned int total_size, struct ip6t_entry_match *m; struct ip6t_entry_target *t; - e = (struct ip6t_entry *)(loc_cpu_entry + off); + e = (struct ip6t_entry *)(table->private->entries + off); if (copy_to_user(userptr + off + offsetof(struct ip6t_entry, counters), &counters[num], @@ -1211,46 +1196,6 @@ get_entries(const struct ip6t_get_entries *entries, return ret; } -static void free_table_info(struct ip6t_table_info *info) -{ - int cpu; - for_each_cpu(cpu) { - if (info->size <= PAGE_SIZE) - kfree(info->entries[cpu]); - else - vfree(info->entries[cpu]); - } - kfree(info); -} - -static struct ip6t_table_info *alloc_table_info(unsigned int size) -{ - struct ip6t_table_info *newinfo; - int cpu; - - newinfo = kzalloc(sizeof(struct ip6t_table_info), GFP_KERNEL); - if (!newinfo) - return NULL; - - newinfo->size = size; - - for_each_cpu(cpu) { - if (size <= PAGE_SIZE) - newinfo->entries[cpu] = kmalloc_node(size, - GFP_KERNEL, - cpu_to_node(cpu)); - else - newinfo->entries[cpu] = vmalloc_node(size, - cpu_to_node(cpu)); - if (newinfo->entries[cpu] == NULL) { - free_table_info(newinfo); - return NULL; - } - } - - return newinfo; -} - static int do_replace(void __user *user, unsigned int len) { @@ -1259,7 +1204,6 @@ do_replace(void __user *user, unsigned int len) struct ip6t_table *t; struct ip6t_table_info *newinfo, *oldinfo; struct ip6t_counters *counters; - void *loc_cpu_entry, *loc_cpu_old_entry; if (copy_from_user(&tmp, user, sizeof(tmp)) != 0) return -EFAULT; @@ -1268,13 +1212,13 @@ do_replace(void __user *user, unsigned int len) if ((SMP_ALIGN(tmp.size) >> PAGE_SHIFT) + 2 > num_physpages) return -ENOMEM; - newinfo = alloc_table_info(tmp.size); + newinfo = vmalloc(sizeof(struct ip6t_table_info) + + SMP_ALIGN(tmp.size) * + (highest_possible_processor_id()+1)); if (!newinfo) return -ENOMEM; - /* choose the copy that is on our node/cpu */ - loc_cpu_entry = newinfo->entries[raw_smp_processor_id()]; - if (copy_from_user(loc_cpu_entry, user + sizeof(tmp), + if (copy_from_user(newinfo->entries, user + sizeof(tmp), tmp.size) != 0) { ret = -EFAULT; goto free_newinfo; @@ -1285,9 +1229,10 @@ do_replace(void __user *user, unsigned int len) ret = -ENOMEM; goto free_newinfo; } + memset(counters, 0, tmp.num_counters * sizeof(struct ip6t_counters)); ret = translate_table(tmp.name, tmp.valid_hooks, - newinfo, loc_cpu_entry, tmp.size, tmp.num_entries, + newinfo, tmp.size, tmp.num_entries, tmp.hook_entry, tmp.underflow); if (ret != 0) goto free_newinfo_counters; @@ -1326,9 +1271,8 @@ do_replace(void __user *user, unsigned int len) /* Get the old counters. */ get_counters(oldinfo, counters); /* Decrease module usage counts and free resource */ - loc_cpu_old_entry = oldinfo->entries[raw_smp_processor_id()]; - IP6T_ENTRY_ITERATE(loc_cpu_old_entry, oldinfo->size, cleanup_entry,NULL); - free_table_info(oldinfo); + IP6T_ENTRY_ITERATE(oldinfo->entries, oldinfo->size, cleanup_entry,NULL); + vfree(oldinfo); if (copy_to_user(tmp.counters, counters, sizeof(struct ip6t_counters) * tmp.num_counters) != 0) ret = -EFAULT; @@ -1340,11 +1284,11 @@ do_replace(void __user *user, unsigned int len) module_put(t->me); up(&ip6t_mutex); free_newinfo_counters_untrans: - IP6T_ENTRY_ITERATE(loc_cpu_entry, newinfo->size, cleanup_entry,NULL); + IP6T_ENTRY_ITERATE(newinfo->entries, newinfo->size, cleanup_entry,NULL); free_newinfo_counters: vfree(counters); free_newinfo: - free_table_info(newinfo); + vfree(newinfo); return ret; } @@ -1377,7 +1321,6 @@ do_add_counters(void __user *user, unsigned int len) struct ip6t_counters_info tmp, *paddc; struct ip6t_table *t; int ret = 0; - void *loc_cpu_entry; if (copy_from_user(&tmp, user, sizeof(tmp)) != 0) return -EFAULT; @@ -1407,9 +1350,7 @@ do_add_counters(void __user *user, unsigned int len) } i = 0; - /* Choose the copy that is on our node */ - loc_cpu_entry = t->private->entries[smp_processor_id()]; - IP6T_ENTRY_ITERATE(loc_cpu_entry, + IP6T_ENTRY_ITERATE(t->private->entries, t->private->size, add_counter_to_entry, paddc->counters, @@ -1602,29 +1543,28 @@ int ip6t_register_table(struct ip6t_table *table, struct ip6t_table_info *newinfo; static struct ip6t_table_info bootstrap = { 0, 0, 0, { 0 }, { 0 }, { } }; - void *loc_cpu_entry; - newinfo = alloc_table_info(repl->size); + newinfo = vmalloc(sizeof(struct ip6t_table_info) + + SMP_ALIGN(repl->size) * + (highest_possible_processor_id()+1)); if (!newinfo) return -ENOMEM; - /* choose the copy on our node/cpu */ - loc_cpu_entry = newinfo->entries[raw_smp_processor_id()]; - memcpy(loc_cpu_entry, repl->entries, repl->size); + memcpy(newinfo->entries, repl->entries, repl->size); ret = translate_table(table->name, table->valid_hooks, - newinfo, loc_cpu_entry, repl->size, + newinfo, repl->size, repl->num_entries, repl->hook_entry, repl->underflow); if (ret != 0) { - free_table_info(newinfo); + vfree(newinfo); return ret; } ret = down_interruptible(&ip6t_mutex); if (ret != 0) { - free_table_info(newinfo); + vfree(newinfo); return ret; } @@ -1653,23 +1593,20 @@ int ip6t_register_table(struct ip6t_table *table, return ret; free_unlock: - free_table_info(newinfo); + vfree(newinfo); goto unlock; } void ip6t_unregister_table(struct ip6t_table *table) { - void *loc_cpu_entry; - down(&ip6t_mutex); LIST_DELETE(&ip6t_tables, table); up(&ip6t_mutex); /* Decrease module usage counts and free resources */ - loc_cpu_entry = table->private->entries[raw_smp_processor_id()]; - IP6T_ENTRY_ITERATE(loc_cpu_entry, table->private->size, + IP6T_ENTRY_ITERATE(table->private->entries, table->private->size, cleanup_entry, NULL); - free_table_info(table->private); + vfree(table->private); } /* Returns 1 if the port is matched by the range, 0 otherwise */ @@ -2035,7 +1972,7 @@ static int ip6t_get_matches(char *buffer, char **start, off_t offset, int length return pos; } -static const struct { char *name; get_info_t *get_info; } ip6t_proc_entry[] = +static struct { char *name; get_info_t *get_info; } ip6t_proc_entry[] = { { "ip6_tables_names", ip6t_get_tables }, { "ip6_tables_targets", ip6t_get_targets }, { "ip6_tables_matches", ip6t_get_matches }, diff --git a/trunk/net/ipv6/netfilter/ip6t_LOG.c b/trunk/net/ipv6/netfilter/ip6t_LOG.c index ae4653bfd654..0cd1d1bd9033 100644 --- a/trunk/net/ipv6/netfilter/ip6t_LOG.c +++ b/trunk/net/ipv6/netfilter/ip6t_LOG.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/net/ipv6/netfilter/ip6t_ah.c b/trunk/net/ipv6/netfilter/ip6t_ah.c index 268918d5deea..dde37793d20b 100644 --- a/trunk/net/ipv6/netfilter/ip6t_ah.c +++ b/trunk/net/ipv6/netfilter/ip6t_ah.c @@ -9,7 +9,6 @@ #include #include -#include #include #include #include diff --git a/trunk/net/ipv6/netfilter/ip6t_esp.c b/trunk/net/ipv6/netfilter/ip6t_esp.c index 65937de1b58c..24bc0cde43a1 100644 --- a/trunk/net/ipv6/netfilter/ip6t_esp.c +++ b/trunk/net/ipv6/netfilter/ip6t_esp.c @@ -9,7 +9,6 @@ #include #include -#include #include #include #include diff --git a/trunk/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/trunk/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c index 753a3ae8502b..e2c90b3a8074 100644 --- a/trunk/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +++ b/trunk/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c @@ -339,8 +339,8 @@ extern unsigned long nf_ct_icmpv6_timeout; /* From nf_conntrack_frag6.c */ extern unsigned long nf_ct_frag6_timeout; -extern unsigned int nf_ct_frag6_low_thresh; -extern unsigned int nf_ct_frag6_high_thresh; +extern unsigned long nf_ct_frag6_low_thresh; +extern unsigned long nf_ct_frag6_high_thresh; static struct ctl_table_header *nf_ct_ipv6_sysctl_header; @@ -367,7 +367,7 @@ static ctl_table nf_ct_sysctl_table[] = { .data = &nf_ct_frag6_low_thresh, .maxlen = sizeof(unsigned int), .mode = 0644, - .proc_handler = &proc_dointvec, + .proc_handler = &proc_dointvec_jiffies, }, { .ctl_name = NET_NF_CONNTRACK_FRAG6_HIGH_THRESH, @@ -375,7 +375,7 @@ static ctl_table nf_ct_sysctl_table[] = { .data = &nf_ct_frag6_high_thresh, .maxlen = sizeof(unsigned int), .mode = 0644, - .proc_handler = &proc_dointvec, + .proc_handler = &proc_dointvec_jiffies, }, { .ctl_name = 0 } }; diff --git a/trunk/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/trunk/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c index a7e03cfacd06..c0f1da5497a9 100644 --- a/trunk/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +++ b/trunk/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c @@ -68,8 +68,8 @@ static int icmpv6_invert_tuple(struct nf_conntrack_tuple *tuple, [ICMPV6_NI_REPLY - 128] = ICMPV6_NI_REPLY +1 }; - int type = orig->dst.u.icmp.type - 128; - if (type < 0 || type >= sizeof(invmap) || !invmap[type]) + __u8 type = orig->dst.u.icmp.type - 128; + if (type >= sizeof(invmap) || !invmap[type]) return 0; tuple->src.u.icmp.id = orig->src.u.icmp.id; @@ -129,12 +129,12 @@ static int icmpv6_new(struct nf_conn *conntrack, [ICMPV6_ECHO_REQUEST - 128] = 1, [ICMPV6_NI_QUERY - 128] = 1 }; - int type = conntrack->tuplehash[0].tuple.dst.u.icmp.type - 128; - if (type < 0 || type >= sizeof(valid_new) || !valid_new[type]) { + if (conntrack->tuplehash[0].tuple.dst.u.icmp.type - 128 >= sizeof(valid_new) + || !valid_new[conntrack->tuplehash[0].tuple.dst.u.icmp.type - 128]) { /* Can't create a new ICMPv6 `conn' with this. */ - DEBUGP("icmpv6: can't create new conn with type %u\n", - type + 128); + DEBUGP("icmp: can't create new conn with type %u\n", + conntrack->tuplehash[0].tuple.dst.u.icmp.type); NF_CT_DUMP_TUPLE(&conntrack->tuplehash[0].tuple); return 0; } diff --git a/trunk/net/ipv6/netfilter/nf_conntrack_reasm.c b/trunk/net/ipv6/netfilter/nf_conntrack_reasm.c index f3e5ffbd592f..7640b9bb7694 100644 --- a/trunk/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/trunk/net/ipv6/netfilter/nf_conntrack_reasm.c @@ -55,9 +55,9 @@ #define NF_CT_FRAG6_LOW_THRESH 196608 /* == 192*1024 */ #define NF_CT_FRAG6_TIMEOUT IPV6_FRAG_TIMEOUT -unsigned int nf_ct_frag6_high_thresh = 256*1024; -unsigned int nf_ct_frag6_low_thresh = 192*1024; -unsigned long nf_ct_frag6_timeout = IPV6_FRAG_TIMEOUT; +int nf_ct_frag6_high_thresh = 256*1024; +int nf_ct_frag6_low_thresh = 192*1024; +int nf_ct_frag6_timeout = IPV6_FRAG_TIMEOUT; struct nf_ct_frag6_skb_cb { @@ -98,7 +98,7 @@ struct nf_ct_frag6_queue #define FRAG6Q_HASHSZ 64 static struct nf_ct_frag6_queue *nf_ct_frag6_hash[FRAG6Q_HASHSZ]; -static DEFINE_RWLOCK(nf_ct_frag6_lock); +static rwlock_t nf_ct_frag6_lock = RW_LOCK_UNLOCKED; static u32 nf_ct_frag6_hash_rnd; static LIST_HEAD(nf_ct_frag6_lru_list); int nf_ct_frag6_nqueues = 0; @@ -190,10 +190,8 @@ static void nf_ct_frag6_secret_rebuild(unsigned long dummy) atomic_t nf_ct_frag6_mem = ATOMIC_INIT(0); /* Memory Tracking Functions. */ -static inline void frag_kfree_skb(struct sk_buff *skb, unsigned int *work) +static inline void frag_kfree_skb(struct sk_buff *skb) { - if (work) - *work -= skb->truesize; atomic_sub(skb->truesize, &nf_ct_frag6_mem); if (NFCT_FRAG6_CB(skb)->orig) kfree_skb(NFCT_FRAG6_CB(skb)->orig); @@ -201,11 +199,8 @@ static inline void frag_kfree_skb(struct sk_buff *skb, unsigned int *work) kfree_skb(skb); } -static inline void frag_free_queue(struct nf_ct_frag6_queue *fq, - unsigned int *work) +static inline void frag_free_queue(struct nf_ct_frag6_queue *fq) { - if (work) - *work -= sizeof(struct nf_ct_frag6_queue); atomic_sub(sizeof(struct nf_ct_frag6_queue), &nf_ct_frag6_mem); kfree(fq); } @@ -223,8 +218,7 @@ static inline struct nf_ct_frag6_queue *frag_alloc_queue(void) /* Destruction primitives. */ /* Complete destruction of fq. */ -static void nf_ct_frag6_destroy(struct nf_ct_frag6_queue *fq, - unsigned int *work) +static void nf_ct_frag6_destroy(struct nf_ct_frag6_queue *fq) { struct sk_buff *fp; @@ -236,17 +230,17 @@ static void nf_ct_frag6_destroy(struct nf_ct_frag6_queue *fq, while (fp) { struct sk_buff *xp = fp->next; - frag_kfree_skb(fp, work); + frag_kfree_skb(fp); fp = xp; } - frag_free_queue(fq, work); + frag_free_queue(fq); } -static __inline__ void fq_put(struct nf_ct_frag6_queue *fq, unsigned int *work) +static __inline__ void fq_put(struct nf_ct_frag6_queue *fq) { if (atomic_dec_and_test(&fq->refcnt)) - nf_ct_frag6_destroy(fq, work); + nf_ct_frag6_destroy(fq); } /* Kill fq entry. It is not destroyed immediately, @@ -268,21 +262,16 @@ static void nf_ct_frag6_evictor(void) { struct nf_ct_frag6_queue *fq; struct list_head *tmp; - unsigned int work; - work = atomic_read(&nf_ct_frag6_mem); - if (work <= nf_ct_frag6_low_thresh) - return; - - work -= nf_ct_frag6_low_thresh; - while (work > 0) { + for (;;) { + if (atomic_read(&nf_ct_frag6_mem) <= nf_ct_frag6_low_thresh) + return; read_lock(&nf_ct_frag6_lock); if (list_empty(&nf_ct_frag6_lru_list)) { read_unlock(&nf_ct_frag6_lock); return; } tmp = nf_ct_frag6_lru_list.next; - BUG_ON(tmp == NULL); fq = list_entry(tmp, struct nf_ct_frag6_queue, lru_list); atomic_inc(&fq->refcnt); read_unlock(&nf_ct_frag6_lock); @@ -292,7 +281,7 @@ static void nf_ct_frag6_evictor(void) fq_kill(fq); spin_unlock(&fq->lock); - fq_put(fq, &work); + fq_put(fq); } } @@ -309,7 +298,7 @@ static void nf_ct_frag6_expire(unsigned long data) out: spin_unlock(&fq->lock); - fq_put(fq, NULL); + fq_put(fq); } /* Creation primitives. */ @@ -329,7 +318,7 @@ static struct nf_ct_frag6_queue *nf_ct_frag6_intern(unsigned int hash, atomic_inc(&fq->refcnt); write_unlock(&nf_ct_frag6_lock); fq_in->last_in |= COMPLETE; - fq_put(fq_in, NULL); + fq_put(fq_in); return fq; } } @@ -371,7 +360,7 @@ nf_ct_frag6_create(unsigned int hash, u32 id, struct in6_addr *src, struct init_timer(&fq->timer); fq->timer.function = nf_ct_frag6_expire; fq->timer.data = (long) fq; - spin_lock_init(&fq->lock); + fq->lock = SPIN_LOCK_UNLOCKED; atomic_set(&fq->refcnt, 1); return nf_ct_frag6_intern(hash, fq); @@ -546,7 +535,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb, fq->fragments = next; fq->meat -= free_it->len; - frag_kfree_skb(free_it, NULL); + frag_kfree_skb(free_it); } } @@ -822,7 +811,7 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb) if (nf_ct_frag6_queue(fq, clone, fhdr, nhoff) < 0) { spin_unlock(&fq->lock); DEBUGP("Can't insert skb to queue\n"); - fq_put(fq, NULL); + fq_put(fq); goto ret_orig; } @@ -833,7 +822,7 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb) } spin_unlock(&fq->lock); - fq_put(fq, NULL); + fq_put(fq); return ret_skb; ret_orig: @@ -892,6 +881,5 @@ int nf_ct_frag6_init(void) void nf_ct_frag6_cleanup(void) { del_timer(&nf_ct_frag6_secret_timer); - nf_ct_frag6_low_thresh = 0; nf_ct_frag6_evictor(); } diff --git a/trunk/net/ipv6/raw.c b/trunk/net/ipv6/raw.c index 66f1d12ea578..8e9628f1c4c5 100644 --- a/trunk/net/ipv6/raw.c +++ b/trunk/net/ipv6/raw.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -434,14 +433,25 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, return err; csum_copy_err: - skb_kill_datagram(sk, skb, flags); + /* Clear queue. */ + if (flags&MSG_PEEK) { + int clear = 0; + spin_lock_bh(&sk->sk_receive_queue.lock); + if (skb == skb_peek(&sk->sk_receive_queue)) { + __skb_unlink(skb, &sk->sk_receive_queue); + clear = 1; + } + spin_unlock_bh(&sk->sk_receive_queue.lock); + if (clear) + kfree_skb(skb); + } /* Error for blocking case is chosen to masquerade as some normal condition. */ err = (flags&MSG_DONTWAIT) ? -EAGAIN : -EHOSTUNREACH; /* FIXME: increment a raw6 drops counter here */ - goto out; + goto out_free; } static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl, @@ -738,9 +748,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, } if (opt == NULL) opt = np->opt; - if (flowlabel) - opt = fl6_merge_options(&opt_space, flowlabel, opt); - opt = ipv6_fixup_options(&opt_space, opt); + opt = fl6_merge_options(&opt_space, flowlabel, opt); fl.proto = proto; rawv6_probe_proto_opt(&fl, msg); diff --git a/trunk/net/ipv6/reassembly.c b/trunk/net/ipv6/reassembly.c index 5d316cb72ec9..e4fe9ee484dd 100644 --- a/trunk/net/ipv6/reassembly.c +++ b/trunk/net/ipv6/reassembly.c @@ -74,7 +74,7 @@ struct ip6frag_skb_cb struct frag_queue { - struct hlist_node list; + struct frag_queue *next; struct list_head lru_list; /* lru list member */ __u32 id; /* fragment id */ @@ -95,13 +95,14 @@ struct frag_queue #define FIRST_IN 2 #define LAST_IN 1 __u16 nhoffset; + struct frag_queue **pprev; }; /* Hash table. */ #define IP6Q_HASHSZ 64 -static struct hlist_head ip6_frag_hash[IP6Q_HASHSZ]; +static struct frag_queue *ip6_frag_hash[IP6Q_HASHSZ]; static DEFINE_RWLOCK(ip6_frag_lock); static u32 ip6_frag_hash_rnd; static LIST_HEAD(ip6_frag_lru_list); @@ -109,7 +110,9 @@ int ip6_frag_nqueues = 0; static __inline__ void __fq_unlink(struct frag_queue *fq) { - hlist_del(&fq->list); + if(fq->next) + fq->next->pprev = fq->pprev; + *fq->pprev = fq->next; list_del(&fq->lru_list); ip6_frag_nqueues--; } @@ -160,21 +163,28 @@ static void ip6_frag_secret_rebuild(unsigned long dummy) get_random_bytes(&ip6_frag_hash_rnd, sizeof(u32)); for (i = 0; i < IP6Q_HASHSZ; i++) { struct frag_queue *q; - struct hlist_node *p, *n; - hlist_for_each_entry_safe(q, p, n, &ip6_frag_hash[i], list) { + q = ip6_frag_hash[i]; + while (q) { + struct frag_queue *next = q->next; unsigned int hval = ip6qhashfn(q->id, &q->saddr, &q->daddr); if (hval != i) { - hlist_del(&q->list); + /* Unlink. */ + if (q->next) + q->next->pprev = q->pprev; + *q->pprev = q->next; /* Relink to new hash chain. */ - hlist_add_head(&q->list, - &ip6_frag_hash[hval]); - + if ((q->next = ip6_frag_hash[hval]) != NULL) + q->next->pprev = &q->next; + ip6_frag_hash[hval] = q; + q->pprev = &ip6_frag_hash[hval]; } + + q = next; } } write_unlock(&ip6_frag_lock); @@ -327,13 +337,10 @@ static struct frag_queue *ip6_frag_intern(unsigned int hash, struct frag_queue *fq_in) { struct frag_queue *fq; -#ifdef CONFIG_SMP - struct hlist_node *n; -#endif write_lock(&ip6_frag_lock); #ifdef CONFIG_SMP - hlist_for_each_entry(fq, n, &ip6_frag_hash[hash], list) { + for (fq = ip6_frag_hash[hash]; fq; fq = fq->next) { if (fq->id == fq_in->id && ipv6_addr_equal(&fq_in->saddr, &fq->saddr) && ipv6_addr_equal(&fq_in->daddr, &fq->daddr)) { @@ -351,7 +358,10 @@ static struct frag_queue *ip6_frag_intern(unsigned int hash, atomic_inc(&fq->refcnt); atomic_inc(&fq->refcnt); - hlist_add_head(&fq->list, &ip6_frag_hash[hash]); + if((fq->next = ip6_frag_hash[hash]) != NULL) + fq->next->pprev = &fq->next; + ip6_frag_hash[hash] = fq; + fq->pprev = &ip6_frag_hash[hash]; INIT_LIST_HEAD(&fq->lru_list); list_add_tail(&fq->lru_list, &ip6_frag_lru_list); ip6_frag_nqueues++; @@ -391,11 +401,10 @@ static __inline__ struct frag_queue * fq_find(u32 id, struct in6_addr *src, struct in6_addr *dst) { struct frag_queue *fq; - struct hlist_node *n; unsigned int hash = ip6qhashfn(id, src, dst); read_lock(&ip6_frag_lock); - hlist_for_each_entry(fq, n, &ip6_frag_hash[hash], list) { + for(fq = ip6_frag_hash[hash]; fq; fq = fq->next) { if (fq->id == id && ipv6_addr_equal(src, &fq->saddr) && ipv6_addr_equal(dst, &fq->daddr)) { diff --git a/trunk/net/ipv6/route.c b/trunk/net/ipv6/route.c index 66140f13d119..9a71a8d1078a 100644 --- a/trunk/net/ipv6/route.c +++ b/trunk/net/ipv6/route.c @@ -413,14 +413,11 @@ static struct rt6_info *rt6_cow(struct rt6_info *ort, struct in6_addr *daddr, rt = ip6_rt_copy(ort); if (rt) { - if (!(rt->rt6i_flags&RTF_GATEWAY)) { - if (rt->rt6i_dst.plen != 128 && - ipv6_addr_equal(&rt->rt6i_dst.addr, daddr)) - rt->rt6i_flags |= RTF_ANYCAST; + ipv6_addr_copy(&rt->rt6i_dst.addr, daddr); + + if (!(rt->rt6i_flags&RTF_GATEWAY)) ipv6_addr_copy(&rt->rt6i_gateway, daddr); - } - ipv6_addr_copy(&rt->rt6i_dst.addr, daddr); rt->rt6i_dst.plen = 128; rt->rt6i_flags |= RTF_CACHE; rt->u.dst.flags |= DST_HOST; @@ -832,7 +829,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh, } rt->u.dst.obsolete = -1; - rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info); + rt->rt6i_expires = clock_t_to_jiffies(rtmsg->rtmsg_info); if (nlh && (r = NLMSG_DATA(nlh))) { rt->rt6i_protocol = r->rtm_protocol; } else { @@ -1416,9 +1413,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, rt->u.dst.obsolete = -1; rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP; - if (anycast) - rt->rt6i_flags |= RTF_ANYCAST; - else + if (!anycast) rt->rt6i_flags |= RTF_LOCAL; rt->rt6i_nexthop = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway); if (rt->rt6i_nexthop == NULL) { @@ -1737,7 +1732,7 @@ int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) /* * 2. allocate and initialize walker. */ - w = kmalloc(sizeof(*w), GFP_ATOMIC); + w = kmalloc(sizeof(*w), GFP_KERNEL); if (w == NULL) return -ENOMEM; RT6_TRACE("dump<%p", w); diff --git a/trunk/net/ipv6/tcp_ipv6.c b/trunk/net/ipv6/tcp_ipv6.c index 2947bc56d8a0..62c0e5bd931c 100644 --- a/trunk/net/ipv6/tcp_ipv6.c +++ b/trunk/net/ipv6/tcp_ipv6.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -60,7 +59,6 @@ #include #include #include -#include #include @@ -69,33 +67,224 @@ static void tcp_v6_send_reset(struct sk_buff *skb); static void tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req); -static void tcp_v6_send_check(struct sock *sk, int len, +static void tcp_v6_send_check(struct sock *sk, struct tcphdr *th, int len, struct sk_buff *skb); static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb); +static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok); -static struct inet_connection_sock_af_ops ipv6_mapped; -static struct inet_connection_sock_af_ops ipv6_specific; +static struct tcp_func ipv6_mapped; +static struct tcp_func ipv6_specific; +static inline int tcp_v6_bind_conflict(const struct sock *sk, + const struct inet_bind_bucket *tb) +{ + const struct sock *sk2; + const struct hlist_node *node; + + /* We must walk the whole port owner list in this case. -DaveM */ + sk_for_each_bound(sk2, node, &tb->owners) { + if (sk != sk2 && + (!sk->sk_bound_dev_if || + !sk2->sk_bound_dev_if || + sk->sk_bound_dev_if == sk2->sk_bound_dev_if) && + (!sk->sk_reuse || !sk2->sk_reuse || + sk2->sk_state == TCP_LISTEN) && + ipv6_rcv_saddr_equal(sk, sk2)) + break; + } + + return node != NULL; +} + +/* Grrr, addr_type already calculated by caller, but I don't want + * to add some silly "cookie" argument to this method just for that. + * But it doesn't matter, the recalculation is in the rarest path + * this function ever takes. + */ static int tcp_v6_get_port(struct sock *sk, unsigned short snum) { - return inet_csk_get_port(&tcp_hashinfo, sk, snum, - inet6_csk_bind_conflict); + struct inet_bind_hashbucket *head; + struct inet_bind_bucket *tb; + struct hlist_node *node; + int ret; + + local_bh_disable(); + if (snum == 0) { + int low = sysctl_local_port_range[0]; + int high = sysctl_local_port_range[1]; + int remaining = (high - low) + 1; + int rover = net_random() % (high - low) + low; + + do { + head = &tcp_hashinfo.bhash[inet_bhashfn(rover, tcp_hashinfo.bhash_size)]; + spin_lock(&head->lock); + inet_bind_bucket_for_each(tb, node, &head->chain) + if (tb->port == rover) + goto next; + break; + next: + spin_unlock(&head->lock); + if (++rover > high) + rover = low; + } while (--remaining > 0); + + /* Exhausted local port range during search? It is not + * possible for us to be holding one of the bind hash + * locks if this test triggers, because if 'remaining' + * drops to zero, we broke out of the do/while loop at + * the top level, not from the 'break;' statement. + */ + ret = 1; + if (unlikely(remaining <= 0)) + goto fail; + + /* OK, here is the one we will use. */ + snum = rover; + } else { + head = &tcp_hashinfo.bhash[inet_bhashfn(snum, tcp_hashinfo.bhash_size)]; + spin_lock(&head->lock); + inet_bind_bucket_for_each(tb, node, &head->chain) + if (tb->port == snum) + goto tb_found; + } + tb = NULL; + goto tb_not_found; +tb_found: + if (tb && !hlist_empty(&tb->owners)) { + if (tb->fastreuse > 0 && sk->sk_reuse && + sk->sk_state != TCP_LISTEN) { + goto success; + } else { + ret = 1; + if (tcp_v6_bind_conflict(sk, tb)) + goto fail_unlock; + } + } +tb_not_found: + ret = 1; + if (tb == NULL) { + tb = inet_bind_bucket_create(tcp_hashinfo.bind_bucket_cachep, head, snum); + if (tb == NULL) + goto fail_unlock; + } + if (hlist_empty(&tb->owners)) { + if (sk->sk_reuse && sk->sk_state != TCP_LISTEN) + tb->fastreuse = 1; + else + tb->fastreuse = 0; + } else if (tb->fastreuse && + (!sk->sk_reuse || sk->sk_state == TCP_LISTEN)) + tb->fastreuse = 0; + +success: + if (!inet_csk(sk)->icsk_bind_hash) + inet_bind_hash(sk, tb, snum); + BUG_TRAP(inet_csk(sk)->icsk_bind_hash == tb); + ret = 0; + +fail_unlock: + spin_unlock(&head->lock); +fail: + local_bh_enable(); + return ret; +} + +static __inline__ void __tcp_v6_hash(struct sock *sk) +{ + struct hlist_head *list; + rwlock_t *lock; + + BUG_TRAP(sk_unhashed(sk)); + + if (sk->sk_state == TCP_LISTEN) { + list = &tcp_hashinfo.listening_hash[inet_sk_listen_hashfn(sk)]; + lock = &tcp_hashinfo.lhash_lock; + inet_listen_wlock(&tcp_hashinfo); + } else { + unsigned int hash; + sk->sk_hash = hash = inet6_sk_ehashfn(sk); + hash &= (tcp_hashinfo.ehash_size - 1); + list = &tcp_hashinfo.ehash[hash].chain; + lock = &tcp_hashinfo.ehash[hash].lock; + write_lock(lock); + } + + __sk_add_node(sk, list); + sock_prot_inc_use(sk->sk_prot); + write_unlock(lock); } + static void tcp_v6_hash(struct sock *sk) { if (sk->sk_state != TCP_CLOSE) { - if (inet_csk(sk)->icsk_af_ops == &ipv6_mapped) { + struct tcp_sock *tp = tcp_sk(sk); + + if (tp->af_specific == &ipv6_mapped) { tcp_prot.hash(sk); return; } local_bh_disable(); - __inet6_hash(&tcp_hashinfo, sk); + __tcp_v6_hash(sk); local_bh_enable(); } } +/* + * Open request hash tables. + */ + +static u32 tcp_v6_synq_hash(const struct in6_addr *raddr, const u16 rport, const u32 rnd) +{ + u32 a, b, c; + + a = raddr->s6_addr32[0]; + b = raddr->s6_addr32[1]; + c = raddr->s6_addr32[2]; + + a += JHASH_GOLDEN_RATIO; + b += JHASH_GOLDEN_RATIO; + c += rnd; + __jhash_mix(a, b, c); + + a += raddr->s6_addr32[3]; + b += (u32) rport; + __jhash_mix(a, b, c); + + return c & (TCP_SYNQ_HSIZE - 1); +} + +static struct request_sock *tcp_v6_search_req(const struct sock *sk, + struct request_sock ***prevp, + __u16 rport, + struct in6_addr *raddr, + struct in6_addr *laddr, + int iif) +{ + const struct inet_connection_sock *icsk = inet_csk(sk); + struct listen_sock *lopt = icsk->icsk_accept_queue.listen_opt; + struct request_sock *req, **prev; + + for (prev = &lopt->syn_table[tcp_v6_synq_hash(raddr, rport, lopt->hash_rnd)]; + (req = *prev) != NULL; + prev = &req->dl_next) { + const struct tcp6_request_sock *treq = tcp6_rsk(req); + + if (inet_rsk(req)->rmt_port == rport && + req->rsk_ops->family == AF_INET6 && + ipv6_addr_equal(&treq->rmt_addr, raddr) && + ipv6_addr_equal(&treq->loc_addr, laddr) && + (!treq->iif || treq->iif == iif)) { + BUG_TRAP(req->sk == NULL); + *prevp = prev; + return req; + } + } + + return NULL; +} + static __inline__ u16 tcp_v6_check(struct tcphdr *th, int len, struct in6_addr *saddr, struct in6_addr *daddr, @@ -119,12 +308,195 @@ static __u32 tcp_v6_init_sequence(struct sock *sk, struct sk_buff *skb) } } +static int __tcp_v6_check_established(struct sock *sk, const __u16 lport, + struct inet_timewait_sock **twp) +{ + struct inet_sock *inet = inet_sk(sk); + const struct ipv6_pinfo *np = inet6_sk(sk); + const struct in6_addr *daddr = &np->rcv_saddr; + const struct in6_addr *saddr = &np->daddr; + const int dif = sk->sk_bound_dev_if; + const u32 ports = INET_COMBINED_PORTS(inet->dport, lport); + unsigned int hash = inet6_ehashfn(daddr, inet->num, saddr, inet->dport); + struct inet_ehash_bucket *head = inet_ehash_bucket(&tcp_hashinfo, hash); + struct sock *sk2; + const struct hlist_node *node; + struct inet_timewait_sock *tw; + + prefetch(head->chain.first); + write_lock(&head->lock); + + /* Check TIME-WAIT sockets first. */ + sk_for_each(sk2, node, &(head + tcp_hashinfo.ehash_size)->chain) { + const struct tcp6_timewait_sock *tcp6tw = tcp6_twsk(sk2); + + tw = inet_twsk(sk2); + + if(*((__u32 *)&(tw->tw_dport)) == ports && + sk2->sk_family == PF_INET6 && + ipv6_addr_equal(&tcp6tw->tw_v6_daddr, saddr) && + ipv6_addr_equal(&tcp6tw->tw_v6_rcv_saddr, daddr) && + sk2->sk_bound_dev_if == sk->sk_bound_dev_if) { + const struct tcp_timewait_sock *tcptw = tcp_twsk(sk2); + struct tcp_sock *tp = tcp_sk(sk); + + if (tcptw->tw_ts_recent_stamp && + (!twp || + (sysctl_tcp_tw_reuse && + xtime.tv_sec - tcptw->tw_ts_recent_stamp > 1))) { + /* See comment in tcp_ipv4.c */ + tp->write_seq = tcptw->tw_snd_nxt + 65535 + 2; + if (!tp->write_seq) + tp->write_seq = 1; + tp->rx_opt.ts_recent = tcptw->tw_ts_recent; + tp->rx_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp; + sock_hold(sk2); + goto unique; + } else + goto not_unique; + } + } + tw = NULL; + + /* And established part... */ + sk_for_each(sk2, node, &head->chain) { + if (INET6_MATCH(sk2, hash, saddr, daddr, ports, dif)) + goto not_unique; + } + +unique: + BUG_TRAP(sk_unhashed(sk)); + __sk_add_node(sk, &head->chain); + sk->sk_hash = hash; + sock_prot_inc_use(sk->sk_prot); + write_unlock(&head->lock); + + if (twp) { + *twp = tw; + NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); + } else if (tw) { + /* Silly. Should hash-dance instead... */ + inet_twsk_deschedule(tw, &tcp_death_row); + NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); + + inet_twsk_put(tw); + } + return 0; + +not_unique: + write_unlock(&head->lock); + return -EADDRNOTAVAIL; +} + +static inline u32 tcpv6_port_offset(const struct sock *sk) +{ + const struct inet_sock *inet = inet_sk(sk); + const struct ipv6_pinfo *np = inet6_sk(sk); + + return secure_tcpv6_port_ephemeral(np->rcv_saddr.s6_addr32, + np->daddr.s6_addr32, + inet->dport); +} + +static int tcp_v6_hash_connect(struct sock *sk) +{ + unsigned short snum = inet_sk(sk)->num; + struct inet_bind_hashbucket *head; + struct inet_bind_bucket *tb; + int ret; + + if (!snum) { + int low = sysctl_local_port_range[0]; + int high = sysctl_local_port_range[1]; + int range = high - low; + int i; + int port; + static u32 hint; + u32 offset = hint + tcpv6_port_offset(sk); + struct hlist_node *node; + struct inet_timewait_sock *tw = NULL; + + local_bh_disable(); + for (i = 1; i <= range; i++) { + port = low + (i + offset) % range; + head = &tcp_hashinfo.bhash[inet_bhashfn(port, tcp_hashinfo.bhash_size)]; + spin_lock(&head->lock); + + /* Does not bother with rcv_saddr checks, + * because the established check is already + * unique enough. + */ + inet_bind_bucket_for_each(tb, node, &head->chain) { + if (tb->port == port) { + BUG_TRAP(!hlist_empty(&tb->owners)); + if (tb->fastreuse >= 0) + goto next_port; + if (!__tcp_v6_check_established(sk, + port, + &tw)) + goto ok; + goto next_port; + } + } + + tb = inet_bind_bucket_create(tcp_hashinfo.bind_bucket_cachep, head, port); + if (!tb) { + spin_unlock(&head->lock); + break; + } + tb->fastreuse = -1; + goto ok; + + next_port: + spin_unlock(&head->lock); + } + local_bh_enable(); + + return -EADDRNOTAVAIL; + +ok: + hint += i; + + /* Head lock still held and bh's disabled */ + inet_bind_hash(sk, tb, port); + if (sk_unhashed(sk)) { + inet_sk(sk)->sport = htons(port); + __tcp_v6_hash(sk); + } + spin_unlock(&head->lock); + + if (tw) { + inet_twsk_deschedule(tw, &tcp_death_row); + inet_twsk_put(tw); + } + + ret = 0; + goto out; + } + + head = &tcp_hashinfo.bhash[inet_bhashfn(snum, tcp_hashinfo.bhash_size)]; + tb = inet_csk(sk)->icsk_bind_hash; + spin_lock_bh(&head->lock); + + if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) { + __tcp_v6_hash(sk); + spin_unlock_bh(&head->lock); + return 0; + } else { + spin_unlock(&head->lock); + /* No definite answer... Walk to established hash table */ + ret = __tcp_v6_check_established(sk, snum, NULL); +out: + local_bh_enable(); + return ret; + } +} + static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; - struct inet_sock *inet = inet_sk(sk); - struct inet_connection_sock *icsk = inet_csk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct tcp_sock *tp = tcp_sk(sk); struct in6_addr *saddr = NULL, *final_p = NULL, final; @@ -199,7 +571,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, */ if (addr_type == IPV6_ADDR_MAPPED) { - u32 exthdrlen = icsk->icsk_ext_hdr_len; + u32 exthdrlen = tp->ext_header_len; struct sockaddr_in sin; SOCK_DEBUG(sk, "connect: ipv4 mapped\n"); @@ -211,14 +583,14 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, sin.sin_port = usin->sin6_port; sin.sin_addr.s_addr = usin->sin6_addr.s6_addr32[3]; - icsk->icsk_af_ops = &ipv6_mapped; + tp->af_specific = &ipv6_mapped; sk->sk_backlog_rcv = tcp_v4_do_rcv; err = tcp_v4_connect(sk, (struct sockaddr *)&sin, sizeof(sin)); if (err) { - icsk->icsk_ext_hdr_len = exthdrlen; - icsk->icsk_af_ops = &ipv6_specific; + tp->ext_header_len = exthdrlen; + tp->af_specific = &ipv6_specific; sk->sk_backlog_rcv = tcp_v6_do_rcv; goto failure; } else { @@ -271,17 +643,16 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, sk->sk_route_caps = dst->dev->features & ~(NETIF_F_IP_CSUM | NETIF_F_TSO); - icsk->icsk_ext_hdr_len = 0; + tp->ext_header_len = 0; if (np->opt) - icsk->icsk_ext_hdr_len = (np->opt->opt_flen + - np->opt->opt_nflen); + tp->ext_header_len = np->opt->opt_flen + np->opt->opt_nflen; tp->rx_opt.mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - sizeof(struct ipv6hdr); inet->dport = usin->sin6_port; tcp_set_state(sk, TCP_SYN_SENT); - err = inet6_hash_connect(&tcp_death_row, sk); + err = tcp_v6_hash_connect(sk); if (err) goto late_failure; @@ -387,7 +758,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, } else dst_hold(dst); - if (inet_csk(sk)->icsk_pmtu_cookie > dst_mtu(dst)) { + if (tp->pmtu_cookie > dst_mtu(dst)) { tcp_sync_mss(sk, dst_mtu(dst)); tcp_simple_retransmit(sk); } /* else let the usual retransmit timer handle it */ @@ -404,8 +775,8 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, if (sock_owned_by_user(sk)) goto out; - req = inet6_csk_search_req(sk, &prev, th->dest, &hdr->daddr, - &hdr->saddr, inet6_iif(skb)); + req = tcp_v6_search_req(sk, &prev, th->dest, &hdr->daddr, + &hdr->saddr, inet6_iif(skb)); if (!req) goto out; @@ -451,7 +822,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req, struct dst_entry *dst) { - struct inet6_request_sock *treq = inet6_rsk(req); + struct tcp6_request_sock *treq = tcp6_rsk(req); struct ipv6_pinfo *np = inet6_sk(sk); struct sk_buff * skb; struct ipv6_txoptions *opt = NULL; @@ -517,8 +888,8 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req, static void tcp_v6_reqsk_destructor(struct request_sock *req) { - if (inet6_rsk(req)->pktopts) - kfree_skb(inet6_rsk(req)->pktopts); + if (tcp6_rsk(req)->pktopts) + kfree_skb(tcp6_rsk(req)->pktopts); } static struct request_sock_ops tcp6_request_sock_ops = { @@ -530,15 +901,26 @@ static struct request_sock_ops tcp6_request_sock_ops = { .send_reset = tcp_v6_send_reset }; -static struct timewait_sock_ops tcp6_timewait_sock_ops = { - .twsk_obj_size = sizeof(struct tcp6_timewait_sock), - .twsk_unique = tcp_twsk_unique, -}; +static int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb) +{ + struct ipv6_pinfo *np = inet6_sk(sk); + struct inet6_skb_parm *opt = IP6CB(skb); + + if (np->rxopt.all) { + if ((opt->hop && (np->rxopt.bits.hopopts || np->rxopt.bits.ohopopts)) || + ((IPV6_FLOWINFO_MASK & *(u32*)skb->nh.raw) && np->rxopt.bits.rxflow) || + (opt->srcrt && (np->rxopt.bits.srcrt || np->rxopt.bits.osrcrt)) || + ((opt->dst1 || opt->dst0) && (np->rxopt.bits.dstopts || np->rxopt.bits.odstopts))) + return 1; + } + return 0; +} + -static void tcp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb) +static void tcp_v6_send_check(struct sock *sk, struct tcphdr *th, int len, + struct sk_buff *skb) { struct ipv6_pinfo *np = inet6_sk(sk); - struct tcphdr *th = skb->h.th; if (skb->ip_summed == CHECKSUM_HW) { th->check = ~csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, 0); @@ -610,12 +992,13 @@ static void tcp_v6_send_reset(struct sk_buff *skb) /* sk = NULL, but it is safe for now. RST socket required. */ if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { - if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) { - ip6_xmit(NULL, buff, &fl, NULL, 0); - TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); - TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); + if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) return; - } + + ip6_xmit(NULL, buff, &fl, NULL, 0); + TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); + TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); + return; } kfree_skb(buff); @@ -674,11 +1057,11 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32 fl.fl_ip_sport = t1->source; if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { - if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) { - ip6_xmit(NULL, buff, &fl, NULL, 0); - TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); + if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) return; - } + ip6_xmit(NULL, buff, &fl, NULL, 0); + TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); + return; } kfree_skb(buff); @@ -709,9 +1092,8 @@ static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) struct sock *nsk; /* Find possible connection requests. */ - req = inet6_csk_search_req(sk, &prev, th->source, - &skb->nh.ipv6h->saddr, - &skb->nh.ipv6h->daddr, inet6_iif(skb)); + req = tcp_v6_search_req(sk, &prev, th->source, &skb->nh.ipv6h->saddr, + &skb->nh.ipv6h->daddr, inet6_iif(skb)); if (req) return tcp_check_req(sk, skb, req, prev); @@ -735,12 +1117,23 @@ static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) return sk; } +static void tcp_v6_synq_add(struct sock *sk, struct request_sock *req) +{ + struct inet_connection_sock *icsk = inet_csk(sk); + struct listen_sock *lopt = icsk->icsk_accept_queue.listen_opt; + const u32 h = tcp_v6_synq_hash(&tcp6_rsk(req)->rmt_addr, inet_rsk(req)->rmt_port, lopt->hash_rnd); + + reqsk_queue_hash_req(&icsk->icsk_accept_queue, h, req, TCP_TIMEOUT_INIT); + inet_csk_reqsk_queue_added(sk, TCP_TIMEOUT_INIT); +} + + /* FIXME: this is substantially similar to the ipv4 code. * Can some kind of merge be done? -- erics */ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) { - struct inet6_request_sock *treq; + struct tcp6_request_sock *treq; struct ipv6_pinfo *np = inet6_sk(sk); struct tcp_options_received tmp_opt; struct tcp_sock *tp = tcp_sk(sk); @@ -765,7 +1158,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) goto drop; - req = inet6_reqsk_alloc(&tcp6_request_sock_ops); + req = reqsk_alloc(&tcp6_request_sock_ops); if (req == NULL) goto drop; @@ -778,7 +1171,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) tmp_opt.tstamp_ok = tmp_opt.saw_tstamp; tcp_openreq_init(req, &tmp_opt, skb); - treq = inet6_rsk(req); + treq = tcp6_rsk(req); ipv6_addr_copy(&treq->rmt_addr, &skb->nh.ipv6h->saddr); ipv6_addr_copy(&treq->loc_addr, &skb->nh.ipv6h->daddr); TCP_ECN_create_request(req, skb->h.th); @@ -804,7 +1197,8 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) if (tcp_v6_send_synack(sk, req, NULL)) goto drop; - inet6_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT); + tcp_v6_synq_add(sk, req); + return 0; drop: @@ -819,7 +1213,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, struct request_sock *req, struct dst_entry *dst) { - struct inet6_request_sock *treq = inet6_rsk(req); + struct tcp6_request_sock *treq = tcp6_rsk(req); struct ipv6_pinfo *newnp, *np = inet6_sk(sk); struct tcp6_sock *newtcp6sk; struct inet_sock *newinet; @@ -854,7 +1248,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ipv6_addr_copy(&newnp->rcv_saddr, &newnp->saddr); - inet_csk(newsk)->icsk_af_ops = &ipv6_mapped; + newtp->af_specific = &ipv6_mapped; newsk->sk_backlog_rcv = tcp_v4_do_rcv; newnp->pktoptions = NULL; newnp->opt = NULL; @@ -868,10 +1262,10 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, */ /* It is tricky place. Until this moment IPv4 tcp - worked with IPv6 icsk.icsk_af_ops. + worked with IPv6 af_tcp.af_specific. Sync it now. */ - tcp_sync_mss(newsk, inet_csk(newsk)->icsk_pmtu_cookie); + tcp_sync_mss(newsk, newtp->pmtu_cookie); return newsk; } @@ -978,10 +1372,10 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, sock_kfree_s(sk, opt, opt->tot_len); } - inet_csk(newsk)->icsk_ext_hdr_len = 0; + newtp->ext_header_len = 0; if (newnp->opt) - inet_csk(newsk)->icsk_ext_hdr_len = (newnp->opt->opt_nflen + - newnp->opt->opt_flen); + newtp->ext_header_len = newnp->opt->opt_nflen + + newnp->opt->opt_flen; tcp_sync_mss(newsk, dst_mtu(dst)); newtp->advmss = dst_metric(dst, RTAX_ADVMSS); @@ -989,7 +1383,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, newinet->daddr = newinet->saddr = newinet->rcv_saddr = LOOPBACK4_IPV6; - __inet6_hash(&tcp_hashinfo, newsk); + __tcp_v6_hash(newsk); inet_inherit_port(&tcp_hashinfo, sk, newsk); return newsk; @@ -1286,16 +1680,139 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) goto discard_it; } +static int tcp_v6_rebuild_header(struct sock *sk) +{ + int err; + struct dst_entry *dst; + struct ipv6_pinfo *np = inet6_sk(sk); + + dst = __sk_dst_check(sk, np->dst_cookie); + + if (dst == NULL) { + struct inet_sock *inet = inet_sk(sk); + struct in6_addr *final_p = NULL, final; + struct flowi fl; + + memset(&fl, 0, sizeof(fl)); + fl.proto = IPPROTO_TCP; + ipv6_addr_copy(&fl.fl6_dst, &np->daddr); + ipv6_addr_copy(&fl.fl6_src, &np->saddr); + fl.fl6_flowlabel = np->flow_label; + fl.oif = sk->sk_bound_dev_if; + fl.fl_ip_dport = inet->dport; + fl.fl_ip_sport = inet->sport; + + if (np->opt && np->opt->srcrt) { + struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; + ipv6_addr_copy(&final, &fl.fl6_dst); + ipv6_addr_copy(&fl.fl6_dst, rt0->addr); + final_p = &final; + } + + err = ip6_dst_lookup(sk, &dst, &fl); + if (err) { + sk->sk_route_caps = 0; + return err; + } + if (final_p) + ipv6_addr_copy(&fl.fl6_dst, final_p); + + if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { + sk->sk_err_soft = -err; + return err; + } + + ip6_dst_store(sk, dst, NULL); + sk->sk_route_caps = dst->dev->features & + ~(NETIF_F_IP_CSUM | NETIF_F_TSO); + } + + return 0; +} + +static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok) +{ + struct sock *sk = skb->sk; + struct inet_sock *inet = inet_sk(sk); + struct ipv6_pinfo *np = inet6_sk(sk); + struct flowi fl; + struct dst_entry *dst; + struct in6_addr *final_p = NULL, final; + + memset(&fl, 0, sizeof(fl)); + fl.proto = IPPROTO_TCP; + ipv6_addr_copy(&fl.fl6_dst, &np->daddr); + ipv6_addr_copy(&fl.fl6_src, &np->saddr); + fl.fl6_flowlabel = np->flow_label; + IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel); + fl.oif = sk->sk_bound_dev_if; + fl.fl_ip_sport = inet->sport; + fl.fl_ip_dport = inet->dport; + + if (np->opt && np->opt->srcrt) { + struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; + ipv6_addr_copy(&final, &fl.fl6_dst); + ipv6_addr_copy(&fl.fl6_dst, rt0->addr); + final_p = &final; + } + + dst = __sk_dst_check(sk, np->dst_cookie); + + if (dst == NULL) { + int err = ip6_dst_lookup(sk, &dst, &fl); + + if (err) { + sk->sk_err_soft = -err; + return err; + } + + if (final_p) + ipv6_addr_copy(&fl.fl6_dst, final_p); + + if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { + sk->sk_route_caps = 0; + return err; + } + + ip6_dst_store(sk, dst, NULL); + sk->sk_route_caps = dst->dev->features & + ~(NETIF_F_IP_CSUM | NETIF_F_TSO); + } + + skb->dst = dst_clone(dst); + + /* Restore final destination back after routing done */ + ipv6_addr_copy(&fl.fl6_dst, &np->daddr); + + return ip6_xmit(sk, skb, &fl, np->opt, 0); +} + +static void v6_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) +{ + struct ipv6_pinfo *np = inet6_sk(sk); + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) uaddr; + + sin6->sin6_family = AF_INET6; + ipv6_addr_copy(&sin6->sin6_addr, &np->daddr); + sin6->sin6_port = inet_sk(sk)->dport; + /* We do not store received flowlabel for TCP */ + sin6->sin6_flowinfo = 0; + sin6->sin6_scope_id = 0; + if (sk->sk_bound_dev_if && + ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) + sin6->sin6_scope_id = sk->sk_bound_dev_if; +} + static int tcp_v6_remember_stamp(struct sock *sk) { /* Alas, not yet... */ return 0; } -static struct inet_connection_sock_af_ops ipv6_specific = { - .queue_xmit = inet6_csk_xmit, +static struct tcp_func ipv6_specific = { + .queue_xmit = tcp_v6_xmit, .send_check = tcp_v6_send_check, - .rebuild_header = inet6_sk_rebuild_header, + .rebuild_header = tcp_v6_rebuild_header, .conn_request = tcp_v6_conn_request, .syn_recv_sock = tcp_v6_syn_recv_sock, .remember_stamp = tcp_v6_remember_stamp, @@ -1303,7 +1820,7 @@ static struct inet_connection_sock_af_ops ipv6_specific = { .setsockopt = ipv6_setsockopt, .getsockopt = ipv6_getsockopt, - .addr2sockaddr = inet6_csk_addr2sockaddr, + .addr2sockaddr = v6_addr2sockaddr, .sockaddr_len = sizeof(struct sockaddr_in6) }; @@ -1311,7 +1828,7 @@ static struct inet_connection_sock_af_ops ipv6_specific = { * TCP over IPv4 via INET6 API */ -static struct inet_connection_sock_af_ops ipv6_mapped = { +static struct tcp_func ipv6_mapped = { .queue_xmit = ip_queue_xmit, .send_check = tcp_v4_send_check, .rebuild_header = inet_sk_rebuild_header, @@ -1322,7 +1839,7 @@ static struct inet_connection_sock_af_ops ipv6_mapped = { .setsockopt = ipv6_setsockopt, .getsockopt = ipv6_getsockopt, - .addr2sockaddr = inet6_csk_addr2sockaddr, + .addr2sockaddr = v6_addr2sockaddr, .sockaddr_len = sizeof(struct sockaddr_in6) }; @@ -1361,9 +1878,8 @@ static int tcp_v6_init_sock(struct sock *sk) sk->sk_state = TCP_CLOSE; - icsk->icsk_af_ops = &ipv6_specific; + tp->af_specific = &ipv6_specific; icsk->icsk_ca_ops = &tcp_init_congestion_ops; - icsk->icsk_sync_mss = tcp_sync_mss; sk->sk_write_space = sk_stream_write_space; sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); @@ -1385,13 +1901,14 @@ static int tcp_v6_destroy_sock(struct sock *sk) static void get_openreq6(struct seq_file *seq, struct sock *sk, struct request_sock *req, int i, int uid) { + struct in6_addr *dest, *src; int ttd = req->expires - jiffies; - struct in6_addr *src = &inet6_rsk(req)->loc_addr; - struct in6_addr *dest = &inet6_rsk(req)->rmt_addr; if (ttd < 0) ttd = 0; + src = &tcp6_rsk(req)->loc_addr; + dest = &tcp6_rsk(req)->rmt_addr; seq_printf(seq, "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X " "%02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %p\n", @@ -1472,14 +1989,14 @@ static void get_timewait6_sock(struct seq_file *seq, { struct in6_addr *dest, *src; __u16 destp, srcp; - struct inet6_timewait_sock *tw6 = inet6_twsk((struct sock *)tw); + struct tcp6_timewait_sock *tcp6tw = tcp6_twsk((struct sock *)tw); int ttd = tw->tw_ttd - jiffies; if (ttd < 0) ttd = 0; - dest = &tw6->tw_v6_daddr; - src = &tw6->tw_v6_rcv_saddr; + dest = &tcp6tw->tw_v6_daddr; + src = &tcp6tw->tw_v6_rcv_saddr; destp = ntohs(tw->tw_dport); srcp = ntohs(tw->tw_sport); @@ -1577,7 +2094,7 @@ struct proto tcpv6_prot = { .sysctl_rmem = sysctl_tcp_rmem, .max_header = MAX_TCP_HEADER, .obj_size = sizeof(struct tcp6_sock), - .twsk_prot = &tcp6_timewait_sock_ops, + .twsk_obj_size = sizeof(struct tcp6_timewait_sock), .rsk_prot = &tcp6_request_sock_ops, }; @@ -1594,8 +2111,7 @@ static struct inet_protosw tcpv6_protosw = { .ops = &inet6_stream_ops, .capability = -1, .no_check = 0, - .flags = INET_PROTOSW_PERMANENT | - INET_PROTOSW_ICSK, + .flags = INET_PROTOSW_PERMANENT, }; void __init tcpv6_init(void) diff --git a/trunk/net/ipv6/udp.c b/trunk/net/ipv6/udp.c index d8538dcea813..e671153b47b2 100644 --- a/trunk/net/ipv6/udp.c +++ b/trunk/net/ipv6/udp.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -301,7 +300,20 @@ static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, return err; csum_copy_err: - skb_kill_datagram(sk, skb, flags); + /* Clear queue. */ + if (flags&MSG_PEEK) { + int clear = 0; + spin_lock_bh(&sk->sk_receive_queue.lock); + if (skb == skb_peek(&sk->sk_receive_queue)) { + __skb_unlink(skb, &sk->sk_receive_queue); + clear = 1; + } + spin_unlock_bh(&sk->sk_receive_queue.lock); + if (clear) + kfree_skb(skb); + } + + skb_free_datagram(sk, skb); if (flags & MSG_DONTWAIT) { UDP6_INC_STATS_USER(UDP_MIB_INERRORS); @@ -759,9 +771,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, } if (opt == NULL) opt = np->opt; - if (flowlabel) - opt = fl6_merge_options(&opt_space, flowlabel, opt); - opt = ipv6_fixup_options(&opt_space, opt); + opt = fl6_merge_options(&opt_space, flowlabel, opt); fl->proto = IPPROTO_UDP; ipv6_addr_copy(&fl->fl6_dst, daddr); diff --git a/trunk/net/ipv6/xfrm6_policy.c b/trunk/net/ipv6/xfrm6_policy.c index 69bd957380e7..cf1d91e74c82 100644 --- a/trunk/net/ipv6/xfrm6_policy.c +++ b/trunk/net/ipv6/xfrm6_policy.c @@ -214,7 +214,6 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl) case IPPROTO_UDP: case IPPROTO_TCP: case IPPROTO_SCTP: - case IPPROTO_DCCP: if (pskb_may_pull(skb, skb->nh.raw + offset + 4 - skb->data)) { u16 *ports = (u16 *)exthdr; diff --git a/trunk/net/ipx/af_ipx.c b/trunk/net/ipx/af_ipx.c index 0dc519b40404..34b3bb868409 100644 --- a/trunk/net/ipx/af_ipx.c +++ b/trunk/net/ipx/af_ipx.c @@ -75,7 +75,7 @@ static struct datalink_proto *pEII_datalink; static struct datalink_proto *p8023_datalink; static struct datalink_proto *pSNAP_datalink; -static const struct proto_ops ipx_dgram_ops; +static struct proto_ops ipx_dgram_ops; LIST_HEAD(ipx_interfaces); DEFINE_SPINLOCK(ipx_interfaces_lock); @@ -1884,7 +1884,7 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) rc = -EINVAL; break; default: - rc = -ENOIOCTLCMD; + rc = dev_ioctl(cmd, argp); break; } @@ -1901,7 +1901,7 @@ static struct net_proto_family ipx_family_ops = { .owner = THIS_MODULE, }; -static const struct proto_ops SOCKOPS_WRAPPED(ipx_dgram_ops) = { +static struct proto_ops SOCKOPS_WRAPPED(ipx_dgram_ops) = { .family = PF_IPX, .owner = THIS_MODULE, .release = ipx_release, diff --git a/trunk/net/irda/af_irda.c b/trunk/net/irda/af_irda.c index fbfa96754417..6f92f9c62990 100644 --- a/trunk/net/irda/af_irda.c +++ b/trunk/net/irda/af_irda.c @@ -62,12 +62,12 @@ static int irda_create(struct socket *sock, int protocol); -static const struct proto_ops irda_stream_ops; -static const struct proto_ops irda_seqpacket_ops; -static const struct proto_ops irda_dgram_ops; +static struct proto_ops irda_stream_ops; +static struct proto_ops irda_seqpacket_ops; +static struct proto_ops irda_dgram_ops; #ifdef CONFIG_IRDA_ULTRA -static const struct proto_ops irda_ultra_ops; +static struct proto_ops irda_ultra_ops; #define ULTRA_MAX_DATA 382 #endif /* CONFIG_IRDA_ULTRA */ @@ -1438,9 +1438,8 @@ static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock, /* * POSIX 1003.1g mandates this order. */ - ret = sock_error(sk); - if (ret) - break; + if (sk->sk_err) + ret = sock_error(sk); else if (sk->sk_shutdown & RCV_SHUTDOWN) ; else if (noblock) @@ -1822,7 +1821,7 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) return -EINVAL; default: IRDA_DEBUG(1, "%s(), doing device ioctl!\n", __FUNCTION__); - return -ENOIOCTLCMD; + return dev_ioctl(cmd, (void __user *) arg); } /*NOTREACHED*/ @@ -2464,7 +2463,7 @@ static struct net_proto_family irda_family_ops = { .owner = THIS_MODULE, }; -static const struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = { +static struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = { .family = PF_IRDA, .owner = THIS_MODULE, .release = irda_release, @@ -2485,7 +2484,7 @@ static const struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = { .sendpage = sock_no_sendpage, }; -static const struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = { +static struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = { .family = PF_IRDA, .owner = THIS_MODULE, .release = irda_release, @@ -2506,7 +2505,7 @@ static const struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = { .sendpage = sock_no_sendpage, }; -static const struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = { +static struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = { .family = PF_IRDA, .owner = THIS_MODULE, .release = irda_release, @@ -2528,7 +2527,7 @@ static const struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = { }; #ifdef CONFIG_IRDA_ULTRA -static const struct proto_ops SOCKOPS_WRAPPED(irda_ultra_ops) = { +static struct proto_ops SOCKOPS_WRAPPED(irda_ultra_ops) = { .family = PF_IRDA, .owner = THIS_MODULE, .release = irda_release, diff --git a/trunk/net/key/af_key.c b/trunk/net/key/af_key.c index 52efd04cbedb..39031684b65c 100644 --- a/trunk/net/key/af_key.c +++ b/trunk/net/key/af_key.c @@ -113,7 +113,7 @@ static __inline__ void pfkey_unlock_table(void) } -static const struct proto_ops pfkey_ops; +static struct proto_ops pfkey_ops; static void pfkey_insert(struct sock *sk) { @@ -336,7 +336,6 @@ static u8 sadb_ext_min_len[] = { [SADB_X_EXT_NAT_T_SPORT] = (u8) sizeof(struct sadb_x_nat_t_port), [SADB_X_EXT_NAT_T_DPORT] = (u8) sizeof(struct sadb_x_nat_t_port), [SADB_X_EXT_NAT_T_OA] = (u8) sizeof(struct sadb_address), - [SADB_X_EXT_SEC_CTX] = (u8) sizeof(struct sadb_x_sec_ctx), }; /* Verify sadb_address_{len,prefixlen} against sa_family. */ @@ -384,55 +383,6 @@ static int verify_address_len(void *p) return 0; } -static inline int pfkey_sec_ctx_len(struct sadb_x_sec_ctx *sec_ctx) -{ - int len = 0; - - len += sizeof(struct sadb_x_sec_ctx); - len += sec_ctx->sadb_x_ctx_len; - len += sizeof(uint64_t) - 1; - len /= sizeof(uint64_t); - - return len; -} - -static inline int verify_sec_ctx_len(void *p) -{ - struct sadb_x_sec_ctx *sec_ctx = (struct sadb_x_sec_ctx *)p; - int len; - - if (sec_ctx->sadb_x_ctx_len > PAGE_SIZE) - return -EINVAL; - - len = pfkey_sec_ctx_len(sec_ctx); - - if (sec_ctx->sadb_x_sec_len != len) - return -EINVAL; - - return 0; -} - -static inline struct xfrm_user_sec_ctx *pfkey_sadb2xfrm_user_sec_ctx(struct sadb_x_sec_ctx *sec_ctx) -{ - struct xfrm_user_sec_ctx *uctx = NULL; - int ctx_size = sec_ctx->sadb_x_ctx_len; - - uctx = kmalloc((sizeof(*uctx)+ctx_size), GFP_KERNEL); - - if (!uctx) - return NULL; - - uctx->len = pfkey_sec_ctx_len(sec_ctx); - uctx->exttype = sec_ctx->sadb_x_sec_exttype; - uctx->ctx_doi = sec_ctx->sadb_x_ctx_doi; - uctx->ctx_alg = sec_ctx->sadb_x_ctx_alg; - uctx->ctx_len = sec_ctx->sadb_x_ctx_len; - memcpy(uctx + 1, sec_ctx + 1, - uctx->ctx_len); - - return uctx; -} - static int present_and_same_family(struct sadb_address *src, struct sadb_address *dst) { @@ -488,10 +438,6 @@ static int parse_exthdrs(struct sk_buff *skb, struct sadb_msg *hdr, void **ext_h if (verify_address_len(p)) return -EINVAL; } - if (ext_type == SADB_X_EXT_SEC_CTX) { - if (verify_sec_ctx_len(p)) - return -EINVAL; - } ext_hdrs[ext_type-1] = p; } p += ext_len; @@ -640,9 +586,6 @@ static struct sk_buff * pfkey_xfrm_state2msg(struct xfrm_state *x, int add_keys, struct sadb_key *key; struct sadb_x_sa2 *sa2; struct sockaddr_in *sin; - struct sadb_x_sec_ctx *sec_ctx; - struct xfrm_sec_ctx *xfrm_ctx; - int ctx_size = 0; #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) struct sockaddr_in6 *sin6; #endif @@ -666,12 +609,6 @@ static struct sk_buff * pfkey_xfrm_state2msg(struct xfrm_state *x, int add_keys, sizeof(struct sadb_address)*2 + sockaddr_size*2 + sizeof(struct sadb_x_sa2); - - if ((xfrm_ctx = x->security)) { - ctx_size = PFKEY_ALIGN8(xfrm_ctx->ctx_len); - size += sizeof(struct sadb_x_sec_ctx) + ctx_size; - } - /* identity & sensitivity */ if ((x->props.family == AF_INET && @@ -962,20 +899,6 @@ static struct sk_buff * pfkey_xfrm_state2msg(struct xfrm_state *x, int add_keys, n_port->sadb_x_nat_t_port_reserved = 0; } - /* security context */ - if (xfrm_ctx) { - sec_ctx = (struct sadb_x_sec_ctx *) skb_put(skb, - sizeof(struct sadb_x_sec_ctx) + ctx_size); - sec_ctx->sadb_x_sec_len = - (sizeof(struct sadb_x_sec_ctx) + ctx_size) / sizeof(uint64_t); - sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX; - sec_ctx->sadb_x_ctx_doi = xfrm_ctx->ctx_doi; - sec_ctx->sadb_x_ctx_alg = xfrm_ctx->ctx_alg; - sec_ctx->sadb_x_ctx_len = xfrm_ctx->ctx_len; - memcpy(sec_ctx + 1, xfrm_ctx->ctx_str, - xfrm_ctx->ctx_len); - } - return skb; } @@ -986,7 +909,6 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr, struct sadb_lifetime *lifetime; struct sadb_sa *sa; struct sadb_key *key; - struct sadb_x_sec_ctx *sec_ctx; uint16_t proto; int err; @@ -1071,21 +993,6 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr, x->lft.soft_add_expires_seconds = lifetime->sadb_lifetime_addtime; x->lft.soft_use_expires_seconds = lifetime->sadb_lifetime_usetime; } - - sec_ctx = (struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1]; - if (sec_ctx != NULL) { - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); - - if (!uctx) - goto out; - - err = security_xfrm_state_alloc(x, uctx); - kfree(uctx); - - if (err) - goto out; - } - key = (struct sadb_key*) ext_hdrs[SADB_EXT_KEY_AUTH-1]; if (sa->sadb_sa_auth) { int keysize = 0; @@ -1813,18 +1720,6 @@ parse_ipsecrequests(struct xfrm_policy *xp, struct sadb_x_policy *pol) return 0; } -static inline int pfkey_xfrm_policy2sec_ctx_size(struct xfrm_policy *xp) -{ - struct xfrm_sec_ctx *xfrm_ctx = xp->security; - - if (xfrm_ctx) { - int len = sizeof(struct sadb_x_sec_ctx); - len += xfrm_ctx->ctx_len; - return PFKEY_ALIGN8(len); - } - return 0; -} - static int pfkey_xfrm_policy2msg_size(struct xfrm_policy *xp) { int sockaddr_size = pfkey_sockaddr_size(xp->family); @@ -1838,8 +1733,7 @@ static int pfkey_xfrm_policy2msg_size(struct xfrm_policy *xp) (sockaddr_size * 2) + sizeof(struct sadb_x_policy) + (xp->xfrm_nr * (sizeof(struct sadb_x_ipsecrequest) + - (socklen * 2))) + - pfkey_xfrm_policy2sec_ctx_size(xp); + (socklen * 2))); } static struct sk_buff * pfkey_xfrm_policy2msg_prep(struct xfrm_policy *xp) @@ -1863,8 +1757,6 @@ static void pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, i struct sadb_lifetime *lifetime; struct sadb_x_policy *pol; struct sockaddr_in *sin; - struct sadb_x_sec_ctx *sec_ctx; - struct xfrm_sec_ctx *xfrm_ctx; #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) struct sockaddr_in6 *sin6; #endif @@ -2049,21 +1941,6 @@ static void pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, i } } } - - /* security context */ - if ((xfrm_ctx = xp->security)) { - int ctx_size = pfkey_xfrm_policy2sec_ctx_size(xp); - - sec_ctx = (struct sadb_x_sec_ctx *) skb_put(skb, ctx_size); - sec_ctx->sadb_x_sec_len = ctx_size / sizeof(uint64_t); - sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX; - sec_ctx->sadb_x_ctx_doi = xfrm_ctx->ctx_doi; - sec_ctx->sadb_x_ctx_alg = xfrm_ctx->ctx_alg; - sec_ctx->sadb_x_ctx_len = xfrm_ctx->ctx_len; - memcpy(sec_ctx + 1, xfrm_ctx->ctx_str, - xfrm_ctx->ctx_len); - } - hdr->sadb_msg_len = size / sizeof(uint64_t); hdr->sadb_msg_reserved = atomic_read(&xp->refcnt); } @@ -2099,13 +1976,12 @@ static int key_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *c static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) { - int err = 0; + int err; struct sadb_lifetime *lifetime; struct sadb_address *sa; struct sadb_x_policy *pol; struct xfrm_policy *xp; struct km_event c; - struct sadb_x_sec_ctx *sec_ctx; if (!present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC-1], ext_hdrs[SADB_EXT_ADDRESS_DST-1]) || @@ -2152,22 +2028,6 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h if (xp->selector.dport) xp->selector.dport_mask = ~0; - sec_ctx = (struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1]; - if (sec_ctx != NULL) { - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); - - if (!uctx) { - err = -ENOBUFS; - goto out; - } - - err = security_xfrm_policy_alloc(xp, uctx); - kfree(uctx); - - if (err) - goto out; - } - xp->lft.soft_byte_limit = XFRM_INF; xp->lft.hard_byte_limit = XFRM_INF; xp->lft.soft_packet_limit = XFRM_INF; @@ -2191,9 +2051,10 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h err = xfrm_policy_insert(pol->sadb_x_policy_dir-1, xp, hdr->sadb_msg_type != SADB_X_SPDUPDATE); - - if (err) - goto out; + if (err) { + kfree(xp); + return err; + } if (hdr->sadb_msg_type == SADB_X_SPDUPDATE) c.event = XFRM_MSG_UPDPOLICY; @@ -2208,7 +2069,6 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h return 0; out: - security_xfrm_policy_free(xp); kfree(xp); return err; } @@ -2218,10 +2078,9 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg int err; struct sadb_address *sa; struct sadb_x_policy *pol; - struct xfrm_policy *xp, tmp; + struct xfrm_policy *xp; struct xfrm_selector sel; struct km_event c; - struct sadb_x_sec_ctx *sec_ctx; if (!present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC-1], ext_hdrs[SADB_EXT_ADDRESS_DST-1]) || @@ -2250,24 +2109,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg if (sel.dport) sel.dport_mask = ~0; - sec_ctx = (struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1]; - memset(&tmp, 0, sizeof(struct xfrm_policy)); - - if (sec_ctx != NULL) { - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); - - if (!uctx) - return -ENOMEM; - - err = security_xfrm_policy_alloc(&tmp, uctx); - kfree(uctx); - - if (err) - return err; - } - - xp = xfrm_policy_bysel_ctx(pol->sadb_x_policy_dir-1, &sel, tmp.security, 1); - security_xfrm_policy_free(&tmp); + xp = xfrm_policy_bysel(pol->sadb_x_policy_dir-1, &sel, 1); if (xp == NULL) return -ENOENT; @@ -2818,7 +2660,6 @@ static struct xfrm_policy *pfkey_compile_policy(u16 family, int opt, { struct xfrm_policy *xp; struct sadb_x_policy *pol = (struct sadb_x_policy*)data; - struct sadb_x_sec_ctx *sec_ctx; switch (family) { case AF_INET: @@ -2868,32 +2709,10 @@ static struct xfrm_policy *pfkey_compile_policy(u16 family, int opt, (*dir = parse_ipsecrequests(xp, pol)) < 0) goto out; - /* security context too */ - if (len >= (pol->sadb_x_policy_len*8 + - sizeof(struct sadb_x_sec_ctx))) { - char *p = (char *)pol; - struct xfrm_user_sec_ctx *uctx; - - p += pol->sadb_x_policy_len*8; - sec_ctx = (struct sadb_x_sec_ctx *)p; - if (len < pol->sadb_x_policy_len*8 + - sec_ctx->sadb_x_sec_len) - goto out; - if ((*dir = verify_sec_ctx_len(p))) - goto out; - uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); - *dir = security_xfrm_policy_alloc(xp, uctx); - kfree(uctx); - - if (*dir) - goto out; - } - *dir = pol->sadb_x_policy_dir-1; return xp; out: - security_xfrm_policy_free(xp); kfree(xp); return NULL; } @@ -3127,7 +2946,7 @@ static int pfkey_recvmsg(struct kiocb *kiocb, return err; } -static const struct proto_ops pfkey_ops = { +static struct proto_ops pfkey_ops = { .family = PF_KEY, .owner = THIS_MODULE, /* Operations that make no sense on pfkey sockets. */ diff --git a/trunk/net/llc/af_llc.c b/trunk/net/llc/af_llc.c index 8171c53bc0ed..59d02cbbeb9e 100644 --- a/trunk/net/llc/af_llc.c +++ b/trunk/net/llc/af_llc.c @@ -36,7 +36,7 @@ static u16 llc_ui_sap_last_autoport = LLC_SAP_DYN_START; static u16 llc_ui_sap_link_no_max[256]; static struct sockaddr_llc llc_ui_addrnull; -static const struct proto_ops llc_ui_ops; +static struct proto_ops llc_ui_ops; static int llc_ui_wait_for_conn(struct sock *sk, long timeout); static int llc_ui_wait_for_disc(struct sock *sk, long timeout); @@ -116,9 +116,7 @@ static int llc_ui_send_data(struct sock* sk, struct sk_buff *skb, int noblock) struct llc_sock* llc = llc_sk(sk); int rc = 0; - if (unlikely(llc_data_accept_state(llc->state) || - llc->remote_busy_flag || - llc->p_flag)) { + if (unlikely(llc_data_accept_state(llc->state) || llc->p_flag)) { long timeout = sock_sndtimeo(sk, noblock); rc = llc_ui_wait_for_busy_core(sk, timeout); @@ -544,7 +542,6 @@ static int llc_ui_wait_for_busy_core(struct sock *sk, long timeout) if (sk_wait_event(sk, &timeout, (sk->sk_shutdown & RCV_SHUTDOWN) || (!llc_data_accept_state(llc->state) && - !llc->remote_busy_flag && !llc->p_flag))) break; rc = -ERESTARTSYS; @@ -566,9 +563,10 @@ static int llc_wait_data(struct sock *sk, long timeo) /* * POSIX 1003.1g mandates this order. */ - rc = sock_error(sk); - if (rc) + if (sk->sk_err) { + rc = sock_error(sk); break; + } rc = 0; if (sk->sk_shutdown & RCV_SHUTDOWN) break; @@ -959,7 +957,7 @@ static int llc_ui_getname(struct socket *sock, struct sockaddr *uaddr, static int llc_ui_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { - return -ENOIOCTLCMD; + return dev_ioctl(cmd, (void __user *)arg); } /** @@ -1098,7 +1096,7 @@ static struct net_proto_family llc_ui_family_ops = { .owner = THIS_MODULE, }; -static const struct proto_ops llc_ui_ops = { +static struct proto_ops llc_ui_ops = { .family = PF_LLC, .owner = THIS_MODULE, .release = llc_ui_release, diff --git a/trunk/net/llc/llc_c_ac.c b/trunk/net/llc/llc_c_ac.c index 8169f24ed33e..b0bcfb1f12dd 100644 --- a/trunk/net/llc/llc_c_ac.c +++ b/trunk/net/llc/llc_c_ac.c @@ -866,8 +866,7 @@ int llc_conn_ac_send_ack_if_needed(struct sock *sk, struct sk_buff *skb) llc->ack_must_be_send = 1; llc->ack_pf = pf_bit & 1; } - if (((llc->vR - llc->first_pdu_Ns + 1 + LLC_2_SEQ_NBR_MODULO) - % LLC_2_SEQ_NBR_MODULO) >= llc->npta) { + if (((llc->vR - llc->first_pdu_Ns + 129) % 128) >= llc->npta) { llc_conn_ac_send_rr_rsp_f_set_ackpf(sk, skb); llc->ack_must_be_send = 0; llc->ack_pf = 0; @@ -995,8 +994,8 @@ static int llc_conn_ac_inc_npta_value(struct sock *sk, struct sk_buff *skb) llc->dec_step = 0; llc->dec_cntr = llc->inc_cntr = 2; ++llc->npta; - if (llc->npta > (u8) ~LLC_2_SEQ_NBR_MODULO) - llc->npta = (u8) ~LLC_2_SEQ_NBR_MODULO; + if (llc->npta > 127) + llc->npta = 127 ; } else --llc->inc_cntr; return 0; @@ -1066,10 +1065,9 @@ int llc_conn_ac_dec_tx_win_size(struct sock *sk, struct sk_buff *skb) struct llc_sock *llc = llc_sk(sk); u8 unacked_pdu = skb_queue_len(&llc->pdu_unack_q); - if (llc->k - unacked_pdu < 1) - llc->k = 1; - else - llc->k -= unacked_pdu; + llc->k -= unacked_pdu; + if (llc->k < 2) + llc->k = 2; return 0; } @@ -1086,8 +1084,8 @@ int llc_conn_ac_inc_tx_win_size(struct sock *sk, struct sk_buff *skb) struct llc_sock *llc = llc_sk(sk); llc->k += 1; - if (llc->k > (u8) ~LLC_2_SEQ_NBR_MODULO) - llc->k = (u8) ~LLC_2_SEQ_NBR_MODULO; + if (llc->k > 128) + llc->k = 128 ; return 0; } @@ -1311,7 +1309,7 @@ int llc_conn_ac_set_vs_nr(struct sock *sk, struct sk_buff *skb) static int llc_conn_ac_inc_vs_by_1(struct sock *sk, struct sk_buff *skb) { - llc_sk(sk)->vS = (llc_sk(sk)->vS + 1) % LLC_2_SEQ_NBR_MODULO; + llc_sk(sk)->vS = (llc_sk(sk)->vS + 1) % 128; return 0; } diff --git a/trunk/net/netfilter/Kconfig b/trunk/net/netfilter/Kconfig index 794c41d19b28..a84f9221e5f0 100644 --- a/trunk/net/netfilter/Kconfig +++ b/trunk/net/netfilter/Kconfig @@ -61,8 +61,8 @@ config NF_CONNTRACK_MARK instead of the individual packets. config NF_CONNTRACK_EVENTS - bool "Connection tracking events (EXPERIMENTAL)" - depends on EXPERIMENTAL && NF_CONNTRACK + bool "Connection tracking events" + depends on NF_CONNTRACK help If this option is enabled, the connection tracking code will provide a notifier chain that can be used by other kernel code diff --git a/trunk/net/netfilter/nf_conntrack_core.c b/trunk/net/netfilter/nf_conntrack_core.c index a7c7b490cf22..9a67c796b385 100644 --- a/trunk/net/netfilter/nf_conntrack_core.c +++ b/trunk/net/netfilter/nf_conntrack_core.c @@ -387,7 +387,7 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, static void nf_ct_unlink_expect(struct nf_conntrack_expect *exp) { ASSERT_WRITE_LOCK(&nf_conntrack_lock); - NF_CT_ASSERT(!timer_pending(&exp->timeout)); + NF_CT_ASSERT(!timer_pending(&exp_timeout)); list_del(&exp->list); NF_CT_STAT_INC(expect_delete); exp->master->expecting--; @@ -1383,9 +1383,6 @@ void nf_conntrack_cleanup(void) schedule(); goto i_see_dead_people; } - /* wait until all references to nf_conntrack_untracked are dropped */ - while (atomic_read(&nf_conntrack_untracked.ct_general.use) > 1) - schedule(); for (i = 0; i < NF_CT_F_NUM; i++) { if (nf_ct_cache[i].use == 0) @@ -1398,13 +1395,6 @@ void nf_conntrack_cleanup(void) kmem_cache_destroy(nf_conntrack_expect_cachep); free_conntrack_hash(nf_conntrack_hash, nf_conntrack_vmalloc, nf_conntrack_htable_size); - - /* free l3proto protocol tables */ - for (i = 0; i < PF_MAX; i++) - if (nf_ct_protos[i]) { - kfree(nf_ct_protos[i]); - nf_ct_protos[i] = NULL; - } } static struct list_head *alloc_hashtable(int size, int *vmalloced) diff --git a/trunk/net/netfilter/nf_conntrack_proto_tcp.c b/trunk/net/netfilter/nf_conntrack_proto_tcp.c index 6035633d8225..156680ddb042 100644 --- a/trunk/net/netfilter/nf_conntrack_proto_tcp.c +++ b/trunk/net/netfilter/nf_conntrack_proto_tcp.c @@ -280,9 +280,9 @@ static enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = { * sCL -> sCL */ /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */ -/*ack*/ { sIV, sIG, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV }, +/*ack*/ { sIV, sIV, sSR, sES, sCW, sCW, sTW, sTW, sCL, sIV }, /* - * sSS -> sIG Might be a half-open connection. + * sSS -> sIV Might be a half-open connection. * sSR -> sSR Might answer late resent SYN. * sES -> sES :-) * sFW -> sCW Normal close request answered by ACK. @@ -912,12 +912,8 @@ static int tcp_packet(struct nf_conn *conntrack, switch (new_state) { case TCP_CONNTRACK_IGNORE: - /* Ignored packets: - * - * a) SYN in ORIGINAL - * b) SYN/ACK in REPLY - * c) ACK in reply direction after initial SYN in original. - */ + /* Either SYN in ORIGINAL + * or SYN/ACK in REPLY. */ if (index == TCP_SYNACK_SET && conntrack->proto.tcp.last_index == TCP_SYN_SET && conntrack->proto.tcp.last_dir != dir @@ -974,29 +970,16 @@ static int tcp_packet(struct nf_conn *conntrack, conntrack->timeout.function((unsigned long) conntrack); return -NF_REPEAT; - } else { - write_unlock_bh(&tcp_lock); - if (LOG_INVALID(IPPROTO_TCP)) - nf_log_packet(pf, 0, skb, NULL, NULL, - NULL, "nf_ct_tcp: invalid SYN"); - return -NF_ACCEPT; } case TCP_CONNTRACK_CLOSE: if (index == TCP_RST_SET - && ((test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status) - && conntrack->proto.tcp.last_index == TCP_SYN_SET) - || (!test_bit(IPS_ASSURED_BIT, &conntrack->status) - && conntrack->proto.tcp.last_index == TCP_ACK_SET)) + && test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status) + && conntrack->proto.tcp.last_index == TCP_SYN_SET && ntohl(th->ack_seq) == conntrack->proto.tcp.last_end) { - /* RST sent to invalid SYN or ACK we had let trough - * at a) and c) above: - * - * a) SYN was in window then - * c) we hold a half-open connection. - * - * Delete our connection entry. + /* RST sent to invalid SYN we had let trough + * SYN was in window then, tear down connection. * We skip window checking, because packet might ACK - * segments we ignored. */ + * segments we ignored in the SYN. */ goto in_window; } /* Just fall trough */ diff --git a/trunk/net/netfilter/nf_conntrack_standalone.c b/trunk/net/netfilter/nf_conntrack_standalone.c index 5af381f9fe3d..45224db4fe2f 100644 --- a/trunk/net/netfilter/nf_conntrack_standalone.c +++ b/trunk/net/netfilter/nf_conntrack_standalone.c @@ -694,7 +694,7 @@ static int init_or_cleanup(int init) cleanup_proc_stat: #endif #ifdef CONFIG_PROC_FS - remove_proc_entry("nf_conntrack", proc_net_stat); + proc_net_remove("nf_conntrack_stat"); cleanup_proc_exp: proc_net_remove("nf_conntrack_expect"); cleanup_proc: diff --git a/trunk/net/netfilter/nfnetlink.c b/trunk/net/netfilter/nfnetlink.c index 95fdf04f1d88..83f4c53030fc 100644 --- a/trunk/net/netfilter/nfnetlink.c +++ b/trunk/net/netfilter/nfnetlink.c @@ -162,7 +162,7 @@ nfnetlink_check_attributes(struct nfnetlink_subsystem *subsys, return -EINVAL; } - min_len = NLMSG_SPACE(sizeof(struct nfgenmsg)); + min_len = NLMSG_ALIGN(sizeof(struct nfgenmsg)); if (unlikely(nlh->nlmsg_len < min_len)) return -EINVAL; @@ -223,12 +223,6 @@ static inline int nfnetlink_rcv_msg(struct sk_buff *skb, NFNL_SUBSYS_ID(nlh->nlmsg_type), NFNL_MSG_TYPE(nlh->nlmsg_type)); - if (!cap_raised(NETLINK_CB(skb).eff_cap, CAP_NET_ADMIN)) { - DEBUGP("missing CAP_NET_ADMIN\n"); - *errp = -EPERM; - return -1; - } - /* Only requests are handled by kernel now. */ if (!(nlh->nlmsg_flags & NLM_F_REQUEST)) { DEBUGP("received non-request message\n"); @@ -236,7 +230,8 @@ static inline int nfnetlink_rcv_msg(struct sk_buff *skb, } /* All the messages must at least contain nfgenmsg */ - if (nlh->nlmsg_len < NLMSG_SPACE(sizeof(struct nfgenmsg))) { + if (nlh->nlmsg_len < + NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct nfgenmsg)))) { DEBUGP("received message was too short\n"); return 0; } @@ -245,12 +240,15 @@ static inline int nfnetlink_rcv_msg(struct sk_buff *skb, ss = nfnetlink_get_subsys(type); if (!ss) { #ifdef CONFIG_KMOD - /* don't call nfnl_shunlock, since it would reenter - * with further packet processing */ - up(&nfnl_sem); - request_module("nfnetlink-subsys-%d", NFNL_SUBSYS_ID(type)); - nfnl_shlock(); - ss = nfnetlink_get_subsys(type); + if (cap_raised(NETLINK_CB(skb).eff_cap, CAP_NET_ADMIN)) { + /* don't call nfnl_shunlock, since it would reenter + * with further packet processing */ + up(&nfnl_sem); + request_module("nfnetlink-subsys-%d", + NFNL_SUBSYS_ID(type)); + nfnl_shlock(); + ss = nfnetlink_get_subsys(type); + } if (!ss) #endif goto err_inval; @@ -262,6 +260,13 @@ static inline int nfnetlink_rcv_msg(struct sk_buff *skb, goto err_inval; } + if (nc->cap_required && + !cap_raised(NETLINK_CB(skb).eff_cap, nc->cap_required)) { + DEBUGP("permission denied for type %d\n", type); + *errp = -EPERM; + return -1; + } + { u_int16_t attr_count = ss->cb[NFNL_MSG_TYPE(nlh->nlmsg_type)].attr_count; diff --git a/trunk/net/netfilter/nfnetlink_log.c b/trunk/net/netfilter/nfnetlink_log.c index e10512e229b6..d194676f3655 100644 --- a/trunk/net/netfilter/nfnetlink_log.c +++ b/trunk/net/netfilter/nfnetlink_log.c @@ -151,7 +151,7 @@ instance_create(u_int16_t group_num, int pid) goto out_unlock; INIT_HLIST_NODE(&inst->hlist); - spin_lock_init(&inst->lock); + inst->lock = SPIN_LOCK_UNLOCKED; /* needs to be two, since we _put() after creation */ atomic_set(&inst->use, 2); @@ -862,9 +862,11 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb, static struct nfnl_callback nfulnl_cb[NFULNL_MSG_MAX] = { [NFULNL_MSG_PACKET] = { .call = nfulnl_recv_unsupp, - .attr_count = NFULA_MAX, }, + .attr_count = NFULA_MAX, + .cap_required = CAP_NET_ADMIN, }, [NFULNL_MSG_CONFIG] = { .call = nfulnl_recv_config, - .attr_count = NFULA_CFG_MAX, }, + .attr_count = NFULA_CFG_MAX, + .cap_required = CAP_NET_ADMIN }, }; static struct nfnetlink_subsystem nfulnl_subsys = { diff --git a/trunk/net/netfilter/nfnetlink_queue.c b/trunk/net/netfilter/nfnetlink_queue.c index 55afdda3d940..f065a6c94953 100644 --- a/trunk/net/netfilter/nfnetlink_queue.c +++ b/trunk/net/netfilter/nfnetlink_queue.c @@ -148,7 +148,7 @@ instance_create(u_int16_t queue_num, int pid) atomic_set(&inst->id_sequence, 0); /* needs to be two, since we _put() after creation */ atomic_set(&inst->use, 2); - spin_lock_init(&inst->lock); + inst->lock = SPIN_LOCK_UNLOCKED; INIT_LIST_HEAD(&inst->queue_list); if (!try_module_get(THIS_MODULE)) @@ -931,11 +931,14 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb, static struct nfnl_callback nfqnl_cb[NFQNL_MSG_MAX] = { [NFQNL_MSG_PACKET] = { .call = nfqnl_recv_unsupp, - .attr_count = NFQA_MAX, }, + .attr_count = NFQA_MAX, + .cap_required = CAP_NET_ADMIN }, [NFQNL_MSG_VERDICT] = { .call = nfqnl_recv_verdict, - .attr_count = NFQA_MAX, }, + .attr_count = NFQA_MAX, + .cap_required = CAP_NET_ADMIN }, [NFQNL_MSG_CONFIG] = { .call = nfqnl_recv_config, - .attr_count = NFQA_CFG_MAX, }, + .attr_count = NFQA_CFG_MAX, + .cap_required = CAP_NET_ADMIN }, }; static struct nfnetlink_subsystem nfqnl_subsys = { diff --git a/trunk/net/netlink/af_netlink.c b/trunk/net/netlink/af_netlink.c index 7849cac14d3a..8c38ee6d255e 100644 --- a/trunk/net/netlink/af_netlink.c +++ b/trunk/net/netlink/af_netlink.c @@ -293,7 +293,7 @@ static inline int nl_pid_hash_dilute(struct nl_pid_hash *hash, int len) return 0; } -static const struct proto_ops netlink_ops; +static struct proto_ops netlink_ops; static int netlink_insert(struct sock *sk, u32 pid) { @@ -476,7 +476,7 @@ static int netlink_autobind(struct socket *sock) struct hlist_head *head; struct sock *osk; struct hlist_node *node; - s32 pid = current->tgid; + s32 pid = current->pid; int err; static s32 rover = -4097; @@ -1656,7 +1656,7 @@ int netlink_unregister_notifier(struct notifier_block *nb) return notifier_chain_unregister(&netlink_chain, nb); } -static const struct proto_ops netlink_ops = { +static struct proto_ops netlink_ops = { .family = PF_NETLINK, .owner = THIS_MODULE, .release = netlink_release, diff --git a/trunk/net/netlink/genetlink.c b/trunk/net/netlink/genetlink.c index 3b1378498d50..287cfcc56951 100644 --- a/trunk/net/netlink/genetlink.c +++ b/trunk/net/netlink/genetlink.c @@ -441,7 +441,7 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb) } static struct sk_buff *ctrl_build_msg(struct genl_family *family, u32 pid, - int seq, u8 cmd) + int seq, int cmd) { struct sk_buff *skb; int err; diff --git a/trunk/net/netrom/af_netrom.c b/trunk/net/netrom/af_netrom.c index 63b0e4afeb33..e5d82d711cae 100644 --- a/trunk/net/netrom/af_netrom.c +++ b/trunk/net/netrom/af_netrom.c @@ -63,7 +63,7 @@ static unsigned short circuit = 0x101; static HLIST_HEAD(nr_list); static DEFINE_SPINLOCK(nr_list_lock); -static const struct proto_ops nr_proto_ops; +static struct proto_ops nr_proto_ops; /* * Socket removal during an interrupt is now safe. @@ -1166,11 +1166,10 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) void __user *argp = (void __user *)arg; int ret; + lock_sock(sk); switch (cmd) { case TIOCOUTQ: { long amount; - - lock_sock(sk); amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); if (amount < 0) amount = 0; @@ -1181,8 +1180,6 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) case TIOCINQ: { struct sk_buff *skb; long amount = 0L; - - lock_sock(sk); /* These two are safe on a single CPU system as only user tasks fiddle here */ if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) amount = skb->len; @@ -1191,7 +1188,6 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) } case SIOCGSTAMP: - lock_sock(sk); ret = sock_get_timestamp(sk, argp); release_sock(sk); return ret; @@ -1206,17 +1202,21 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) case SIOCSIFNETMASK: case SIOCGIFMETRIC: case SIOCSIFMETRIC: + release_sock(sk); return -EINVAL; case SIOCADDRT: case SIOCDELRT: case SIOCNRDECOBS: + release_sock(sk); if (!capable(CAP_NET_ADMIN)) return -EPERM; return nr_rt_ioctl(cmd, argp); default: - return -ENOIOCTLCMD; + release_sock(sk); + return dev_ioctl(cmd, argp); } + release_sock(sk); return 0; } @@ -1337,7 +1337,7 @@ static struct net_proto_family nr_family_ops = { .owner = THIS_MODULE, }; -static const struct proto_ops nr_proto_ops = { +static struct proto_ops nr_proto_ops = { .family = PF_NETROM, .owner = THIS_MODULE, .release = nr_release, diff --git a/trunk/net/netrom/nr_in.c b/trunk/net/netrom/nr_in.c index a7d88b5ad756..004e8599b8fe 100644 --- a/trunk/net/netrom/nr_in.c +++ b/trunk/net/netrom/nr_in.c @@ -99,7 +99,7 @@ static int nr_state1_machine(struct sock *sk, struct sk_buff *skb, break; case NR_RESET: - if (sysctl_netrom_reset_circuit) + if (sysctl_netrom_reset_circuit); nr_disconnect(sk, ECONNRESET); break; @@ -130,7 +130,7 @@ static int nr_state2_machine(struct sock *sk, struct sk_buff *skb, break; case NR_RESET: - if (sysctl_netrom_reset_circuit) + if (sysctl_netrom_reset_circuit); nr_disconnect(sk, ECONNRESET); break; @@ -265,7 +265,7 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype break; case NR_RESET: - if (sysctl_netrom_reset_circuit) + if (sysctl_netrom_reset_circuit); nr_disconnect(sk, ECONNRESET); break; diff --git a/trunk/net/nonet.c b/trunk/net/nonet.c index 1230f0ae832e..e5241dceaa57 100644 --- a/trunk/net/nonet.c +++ b/trunk/net/nonet.c @@ -14,6 +14,11 @@ #include #include +void __init sock_init(void) +{ + printk(KERN_INFO "Linux NoNET1.0 for Linux 2.6\n"); +} + static int sock_no_open(struct inode *irrelevant, struct file *dontcare) { return -ENXIO; diff --git a/trunk/net/packet/af_packet.c b/trunk/net/packet/af_packet.c index f69e5ed9bd06..499ae3df4a44 100644 --- a/trunk/net/packet/af_packet.c +++ b/trunk/net/packet/af_packet.c @@ -251,10 +251,10 @@ static void packet_sock_destruct(struct sock *sk) } -static const struct proto_ops packet_ops; +static struct proto_ops packet_ops; #ifdef CONFIG_SOCK_PACKET -static const struct proto_ops packet_ops_spkt; +static struct proto_ops packet_ops_spkt; static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) { @@ -1521,7 +1521,7 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd, #endif default: - return -ENOIOCTLCMD; + return dev_ioctl(cmd, (void __user *)arg); } return 0; } @@ -1587,47 +1587,23 @@ static inline struct page *pg_vec_endpage(char *one_pg_vec, unsigned int order) return virt_to_page(one_pg_vec + (PAGE_SIZE << order) - 1); } -static void free_pg_vec(char **pg_vec, unsigned int order, unsigned int len) +static void free_pg_vec(char **pg_vec, unsigned order, unsigned len) { int i; - for (i = 0; i < len; i++) { - if (likely(pg_vec[i])) - free_pages((unsigned long) pg_vec[i], order); + for (i=0; itp_block_nr; - char **pg_vec; - int i; - - pg_vec = kzalloc(block_nr * sizeof(char *), GFP_KERNEL); - if (unlikely(!pg_vec)) - goto out; - - for (i = 0; i < block_nr; i++) { - pg_vec[i] = alloc_one_pg_vec_page(order); - if (unlikely(!pg_vec[i])) - goto out_free_pgvec; - } - -out: - return pg_vec; - -out_free_pgvec: - free_pg_vec(pg_vec, order, block_nr); - pg_vec = NULL; - goto out; -} static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing) { @@ -1641,46 +1617,64 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing /* Sanity tests and some calculations */ - if (unlikely(po->pg_vec)) + if (po->pg_vec) return -EBUSY; - if (unlikely((int)req->tp_block_size <= 0)) + if ((int)req->tp_block_size <= 0) return -EINVAL; - if (unlikely(req->tp_block_size & (PAGE_SIZE - 1))) + if (req->tp_block_size&(PAGE_SIZE-1)) return -EINVAL; - if (unlikely(req->tp_frame_size < TPACKET_HDRLEN)) + if (req->tp_frame_size < TPACKET_HDRLEN) return -EINVAL; - if (unlikely(req->tp_frame_size & (TPACKET_ALIGNMENT - 1))) + if (req->tp_frame_size&(TPACKET_ALIGNMENT-1)) return -EINVAL; po->frames_per_block = req->tp_block_size/req->tp_frame_size; - if (unlikely(po->frames_per_block <= 0)) + if (po->frames_per_block <= 0) return -EINVAL; - if (unlikely((po->frames_per_block * req->tp_block_nr) != - req->tp_frame_nr)) + if (po->frames_per_block*req->tp_block_nr != req->tp_frame_nr) return -EINVAL; + /* OK! */ + + /* Allocate page vector */ + while ((PAGE_SIZE<tp_block_size) + order++; err = -ENOMEM; - order = get_order(req->tp_block_size); - pg_vec = alloc_pg_vec(req, order); - if (unlikely(!pg_vec)) + + pg_vec = kmalloc(req->tp_block_nr*sizeof(char *), GFP_KERNEL); + if (pg_vec == NULL) goto out; + memset(pg_vec, 0, req->tp_block_nr*sizeof(char **)); + + for (i=0; itp_block_nr; i++) { + struct page *page, *pend; + pg_vec[i] = (char *)__get_free_pages(GFP_KERNEL, order); + if (!pg_vec[i]) + goto out_free_pgvec; + + pend = pg_vec_endpage(pg_vec[i], order); + for (page = virt_to_page(pg_vec[i]); page <= pend; page++) + SetPageReserved(page); + } + /* Page vector is allocated */ l = 0; - for (i = 0; i < req->tp_block_nr; i++) { + for (i=0; itp_block_nr; i++) { char *ptr = pg_vec[i]; struct tpacket_hdr *header; int k; - for (k = 0; k < po->frames_per_block; k++) { - header = (struct tpacket_hdr *) ptr; + for (k=0; kframes_per_block; k++) { + + header = (struct tpacket_hdr*)ptr; header->tp_status = TP_STATUS_KERNEL; ptr += req->tp_frame_size; } } /* Done */ } else { - if (unlikely(req->tp_frame_nr)) + if (req->tp_frame_nr) return -EINVAL; } @@ -1707,7 +1701,7 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing spin_lock_bh(&sk->sk_receive_queue.lock); pg_vec = XC(po->pg_vec, pg_vec); - po->frame_max = (req->tp_frame_nr - 1); + po->frame_max = req->tp_frame_nr-1; po->head = 0; po->frame_size = req->tp_frame_size; spin_unlock_bh(&sk->sk_receive_queue.lock); @@ -1734,6 +1728,7 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing release_sock(sk); +out_free_pgvec: if (pg_vec) free_pg_vec(pg_vec, order, req->tp_block_nr); out: @@ -1760,19 +1755,17 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st if (size != po->pg_vec_len*po->pg_vec_pages*PAGE_SIZE) goto out; + atomic_inc(&po->mapped); start = vma->vm_start; - for (i = 0; i < po->pg_vec_len; i++) { - struct page *page = virt_to_page(po->pg_vec[i]); - int pg_num; - - for (pg_num = 0; pg_num < po->pg_vec_pages; pg_num++, page++) { - err = vm_insert_page(vma, start, page); - if (unlikely(err)) - goto out; - start += PAGE_SIZE; - } + err = -EAGAIN; + for (i=0; ipg_vec_len; i++) { + if (remap_pfn_range(vma, start, + __pa(po->pg_vec[i]) >> PAGE_SHIFT, + po->pg_vec_pages*PAGE_SIZE, + vma->vm_page_prot)) + goto out; + start += po->pg_vec_pages*PAGE_SIZE; } - atomic_inc(&po->mapped); vma->vm_ops = &packet_mmap_ops; err = 0; @@ -1784,7 +1777,7 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st #ifdef CONFIG_SOCK_PACKET -static const struct proto_ops packet_ops_spkt = { +static struct proto_ops packet_ops_spkt = { .family = PF_PACKET, .owner = THIS_MODULE, .release = packet_release, @@ -1806,7 +1799,7 @@ static const struct proto_ops packet_ops_spkt = { }; #endif -static const struct proto_ops packet_ops = { +static struct proto_ops packet_ops = { .family = PF_PACKET, .owner = THIS_MODULE, .release = packet_release, diff --git a/trunk/net/rose/af_rose.c b/trunk/net/rose/af_rose.c index 63090be2315a..829fdbc4400b 100644 --- a/trunk/net/rose/af_rose.c +++ b/trunk/net/rose/af_rose.c @@ -1320,7 +1320,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) return 0; default: - return -ENOIOCTLCMD; + return dev_ioctl(cmd, argp); } return 0; diff --git a/trunk/net/sched/Kconfig b/trunk/net/sched/Kconfig index 55cd5327fbd7..7f34e7fd767c 100644 --- a/trunk/net/sched/Kconfig +++ b/trunk/net/sched/Kconfig @@ -40,10 +40,9 @@ config NET_SCHED The available schedulers are listed in the following questions; you can say Y to as many as you like. If unsure, say N now. -if NET_SCHED - choice prompt "Packet scheduler clock source" + depends on NET_SCHED default NET_SCH_CLK_JIFFIES ---help--- Packet schedulers need a monotonic clock that increments at a static @@ -99,9 +98,11 @@ config NET_SCH_CLK_CPU endchoice comment "Queueing/Scheduling" + depends on NET_SCHED config NET_SCH_CBQ tristate "Class Based Queueing (CBQ)" + depends on NET_SCHED ---help--- Say Y here if you want to use the Class-Based Queueing (CBQ) packet scheduling algorithm. This algorithm classifies the waiting packets @@ -119,6 +120,7 @@ config NET_SCH_CBQ config NET_SCH_HTB tristate "Hierarchical Token Bucket (HTB)" + depends on NET_SCHED ---help--- Say Y here if you want to use the Hierarchical Token Buckets (HTB) packet scheduling algorithm. See @@ -133,6 +135,7 @@ config NET_SCH_HTB config NET_SCH_HFSC tristate "Hierarchical Fair Service Curve (HFSC)" + depends on NET_SCHED ---help--- Say Y here if you want to use the Hierarchical Fair Service Curve (HFSC) packet scheduling algorithm. @@ -142,7 +145,7 @@ config NET_SCH_HFSC config NET_SCH_ATM tristate "ATM Virtual Circuits (ATM)" - depends on ATM + depends on NET_SCHED && ATM ---help--- Say Y here if you want to use the ATM pseudo-scheduler. This provides a framework for invoking classifiers, which in turn @@ -156,6 +159,7 @@ config NET_SCH_ATM config NET_SCH_PRIO tristate "Multi Band Priority Queueing (PRIO)" + depends on NET_SCHED ---help--- Say Y here if you want to use an n-band priority queue packet scheduler. @@ -165,6 +169,7 @@ config NET_SCH_PRIO config NET_SCH_RED tristate "Random Early Detection (RED)" + depends on NET_SCHED ---help--- Say Y here if you want to use the Random Early Detection (RED) packet scheduling algorithm. @@ -176,6 +181,7 @@ config NET_SCH_RED config NET_SCH_SFQ tristate "Stochastic Fairness Queueing (SFQ)" + depends on NET_SCHED ---help--- Say Y here if you want to use the Stochastic Fairness Queueing (SFQ) packet scheduling algorithm . @@ -187,6 +193,7 @@ config NET_SCH_SFQ config NET_SCH_TEQL tristate "True Link Equalizer (TEQL)" + depends on NET_SCHED ---help--- Say Y here if you want to use the True Link Equalizer (TLE) packet scheduling algorithm. This queueing discipline allows the combination @@ -199,6 +206,7 @@ config NET_SCH_TEQL config NET_SCH_TBF tristate "Token Bucket Filter (TBF)" + depends on NET_SCHED ---help--- Say Y here if you want to use the Token Bucket Filter (TBF) packet scheduling algorithm. @@ -210,6 +218,7 @@ config NET_SCH_TBF config NET_SCH_GRED tristate "Generic Random Early Detection (GRED)" + depends on NET_SCHED ---help--- Say Y here if you want to use the Generic Random Early Detection (GRED) packet scheduling algorithm for some of your network devices @@ -221,6 +230,7 @@ config NET_SCH_GRED config NET_SCH_DSMARK tristate "Differentiated Services marker (DSMARK)" + depends on NET_SCHED ---help--- Say Y if you want to schedule packets according to the Differentiated Services architecture proposed in RFC 2475. @@ -232,6 +242,7 @@ config NET_SCH_DSMARK config NET_SCH_NETEM tristate "Network emulator (NETEM)" + depends on NET_SCHED ---help--- Say Y if you want to emulate network delay, loss, and packet re-ordering. This is often useful to simulate networks when @@ -244,6 +255,7 @@ config NET_SCH_NETEM config NET_SCH_INGRESS tristate "Ingress Qdisc" + depends on NET_SCHED ---help--- Say Y here if you want to use classifiers for incoming packets. If unsure, say Y. @@ -252,12 +264,14 @@ config NET_SCH_INGRESS module will be called sch_ingress. comment "Classification" + depends on NET_SCHED config NET_CLS boolean config NET_CLS_BASIC tristate "Elementary classification (BASIC)" + depends NET_SCHED select NET_CLS ---help--- Say Y here if you want to be able to classify packets using @@ -268,6 +282,7 @@ config NET_CLS_BASIC config NET_CLS_TCINDEX tristate "Traffic-Control Index (TCINDEX)" + depends NET_SCHED select NET_CLS ---help--- Say Y here if you want to be able to classify packets based on @@ -279,6 +294,7 @@ config NET_CLS_TCINDEX config NET_CLS_ROUTE4 tristate "Routing decision (ROUTE)" + depends NET_SCHED select NET_CLS_ROUTE select NET_CLS ---help--- @@ -290,9 +306,11 @@ config NET_CLS_ROUTE4 config NET_CLS_ROUTE bool + default n config NET_CLS_FW tristate "Netfilter mark (FW)" + depends NET_SCHED select NET_CLS ---help--- If you say Y here, you will be able to classify packets @@ -303,6 +321,7 @@ config NET_CLS_FW config NET_CLS_U32 tristate "Universal 32bit comparisons w/ hashing (U32)" + depends NET_SCHED select NET_CLS ---help--- Say Y here to be able to classify packetes using a universal @@ -326,6 +345,7 @@ config CLS_U32_MARK config NET_CLS_RSVP tristate "IPv4 Resource Reservation Protocol (RSVP)" + depends on NET_SCHED select NET_CLS select NET_ESTIMATOR ---help--- @@ -341,6 +361,7 @@ config NET_CLS_RSVP config NET_CLS_RSVP6 tristate "IPv6 Resource Reservation Protocol (RSVP6)" + depends on NET_SCHED select NET_CLS select NET_ESTIMATOR ---help--- @@ -356,6 +377,7 @@ config NET_CLS_RSVP6 config NET_EMATCH bool "Extended Matches" + depends NET_SCHED select NET_CLS ---help--- Say Y here if you want to use extended matches on top of classifiers @@ -434,7 +456,7 @@ config NET_EMATCH_TEXT config NET_CLS_ACT bool "Actions" - depends on EXPERIMENTAL + depends on EXPERIMENTAL && NET_SCHED select NET_ESTIMATOR ---help--- Say Y here if you want to use traffic control actions. Actions @@ -517,7 +539,7 @@ config NET_ACT_SIMP config NET_CLS_POLICE bool "Traffic Policing (obsolete)" - depends on NET_CLS_ACT!=y + depends on NET_SCHED && NET_CLS_ACT!=y select NET_ESTIMATOR ---help--- Say Y here if you want to do traffic policing, i.e. strict @@ -527,7 +549,7 @@ config NET_CLS_POLICE config NET_CLS_IND bool "Incoming device classification" - depends on NET_CLS_U32 || NET_CLS_FW + depends on NET_SCHED && (NET_CLS_U32 || NET_CLS_FW) ---help--- Say Y here to extend the u32 and fw classifier to support classification based on the incoming device. This option is @@ -535,12 +557,11 @@ config NET_CLS_IND config NET_ESTIMATOR bool "Rate estimator" + depends on NET_SCHED ---help--- Say Y here to allow using rate estimators to estimate the current rate-of-flow for network devices, queues, etc. This module is automaticaly selected if needed but can be selected manually for statstical purposes. -endif # NET_SCHED - endmenu diff --git a/trunk/net/sched/act_api.c b/trunk/net/sched/act_api.c index 2ce1cb2aa2ed..8aebe8f6d271 100644 --- a/trunk/net/sched/act_api.c +++ b/trunk/net/sched/act_api.c @@ -34,7 +34,7 @@ #include #include -#if 0 /* control */ +#if 1 /* control */ #define DPRINTK(format, args...) printk(KERN_DEBUG format, ##args) #else #define DPRINTK(format, args...) diff --git a/trunk/net/sched/sch_netem.c b/trunk/net/sched/sch_netem.c index ba5283204837..cdc8d283791c 100644 --- a/trunk/net/sched/sch_netem.c +++ b/trunk/net/sched/sch_netem.c @@ -25,7 +25,7 @@ #include -#define VERSION "1.2" +#define VERSION "1.1" /* Network Emulation Queuing algorithm. ==================================== @@ -65,12 +65,11 @@ struct netem_sched_data { u32 jitter; u32 duplicate; u32 reorder; - u32 corrupt; struct crndstate { unsigned long last; unsigned long rho; - } delay_cor, loss_cor, dup_cor, reorder_cor, corrupt_cor; + } delay_cor, loss_cor, dup_cor, reorder_cor; struct disttable { u32 size; @@ -184,23 +183,6 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) q->duplicate = dupsave; } - /* - * Randomized packet corruption. - * Make copy if needed since we are modifying - * If packet is going to be hardware checksummed, then - * do it now in software before we mangle it. - */ - if (q->corrupt && q->corrupt >= get_crandom(&q->corrupt_cor)) { - if (!(skb = skb_unshare(skb, GFP_ATOMIC)) - || (skb->ip_summed == CHECKSUM_HW - && skb_checksum_help(skb, 0))) { - sch->qstats.drops++; - return NET_XMIT_DROP; - } - - skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8); - } - if (q->gap == 0 /* not doing reordering */ || q->counter < q->gap /* inside last reordering gap */ || q->reorder < get_crandom(&q->reorder_cor)) { @@ -400,20 +382,6 @@ static int get_reorder(struct Qdisc *sch, const struct rtattr *attr) return 0; } -static int get_corrupt(struct Qdisc *sch, const struct rtattr *attr) -{ - struct netem_sched_data *q = qdisc_priv(sch); - const struct tc_netem_corrupt *r = RTA_DATA(attr); - - if (RTA_PAYLOAD(attr) != sizeof(*r)) - return -EINVAL; - - q->corrupt = r->probability; - init_crandom(&q->corrupt_cor, r->correlation); - return 0; -} - -/* Parse netlink message to set options */ static int netem_change(struct Qdisc *sch, struct rtattr *opt) { struct netem_sched_data *q = qdisc_priv(sch); @@ -464,20 +432,14 @@ static int netem_change(struct Qdisc *sch, struct rtattr *opt) if (ret) return ret; } - if (tb[TCA_NETEM_REORDER-1]) { ret = get_reorder(sch, tb[TCA_NETEM_REORDER-1]); if (ret) return ret; } - - if (tb[TCA_NETEM_CORRUPT-1]) { - ret = get_corrupt(sch, tb[TCA_NETEM_CORRUPT-1]); - if (ret) - return ret; - } } + return 0; } @@ -502,7 +464,7 @@ static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) const struct netem_skb_cb *cb = (const struct netem_skb_cb *)skb->cb; - if (!PSCHED_TLESS(ncb->time_to_send, cb->time_to_send)) + if (PSCHED_TLESS(cb->time_to_send, ncb->time_to_send)) break; } @@ -602,7 +564,6 @@ static int netem_dump(struct Qdisc *sch, struct sk_buff *skb) struct tc_netem_qopt qopt; struct tc_netem_corr cor; struct tc_netem_reorder reorder; - struct tc_netem_corrupt corrupt; qopt.latency = q->latency; qopt.jitter = q->jitter; @@ -621,10 +582,6 @@ static int netem_dump(struct Qdisc *sch, struct sk_buff *skb) reorder.correlation = q->reorder_cor.rho; RTA_PUT(skb, TCA_NETEM_REORDER, sizeof(reorder), &reorder); - corrupt.probability = q->corrupt; - corrupt.correlation = q->corrupt_cor.rho; - RTA_PUT(skb, TCA_NETEM_CORRUPT, sizeof(corrupt), &corrupt); - rta->rta_len = skb->tail - b; return skb->len; diff --git a/trunk/net/sched/sch_teql.c b/trunk/net/sched/sch_teql.c index c4a2a8c4c339..6cf0342706b5 100644 --- a/trunk/net/sched/sch_teql.c +++ b/trunk/net/sched/sch_teql.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/net/sctp/associola.c b/trunk/net/sctp/associola.c index 9d05e13e92f6..dec68a604773 100644 --- a/trunk/net/sctp/associola.c +++ b/trunk/net/sctp/associola.c @@ -110,6 +110,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a asoc->cookie_life.tv_sec = sp->assocparams.sasoc_cookie_life / 1000; asoc->cookie_life.tv_usec = (sp->assocparams.sasoc_cookie_life % 1000) * 1000; + asoc->pmtu = 0; asoc->frag_point = 0; /* Set the association max_retrans and RTO values from the @@ -122,25 +123,6 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a asoc->overall_error_count = 0; - /* Initialize the association's heartbeat interval based on the - * sock configured value. - */ - asoc->hbinterval = msecs_to_jiffies(sp->hbinterval); - - /* Initialize path max retrans value. */ - asoc->pathmaxrxt = sp->pathmaxrxt; - - /* Initialize default path MTU. */ - asoc->pathmtu = sp->pathmtu; - - /* Set association default SACK delay */ - asoc->sackdelay = msecs_to_jiffies(sp->sackdelay); - - /* Set the association default flags controlling - * Heartbeat, SACK delay, and Path MTU Discovery. - */ - asoc->param_flags = sp->param_flags; - /* Initialize the maximum mumber of new data packets that can be sent * in a burst. */ @@ -162,7 +144,8 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a = 5 * asoc->rto_max; asoc->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = 0; - asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = asoc->sackdelay; + asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = + SCTP_DEFAULT_TIMEOUT_SACK; asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] = sp->autoclose * HZ; @@ -557,46 +540,23 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, sctp_transport_set_owner(peer, asoc); - /* Initialize the peer's heartbeat interval based on the - * association configured value. - */ - peer->hbinterval = asoc->hbinterval; - - /* Set the path max_retrans. */ - peer->pathmaxrxt = asoc->pathmaxrxt; - - /* Initialize the peer's SACK delay timeout based on the - * association configured value. - */ - peer->sackdelay = asoc->sackdelay; - - /* Enable/disable heartbeat, SACK delay, and path MTU discovery - * based on association setting. - */ - peer->param_flags = asoc->param_flags; - /* Initialize the pmtu of the transport. */ - if (peer->param_flags & SPP_PMTUD_ENABLE) - sctp_transport_pmtu(peer); - else if (asoc->pathmtu) - peer->pathmtu = asoc->pathmtu; - else - peer->pathmtu = SCTP_DEFAULT_MAXSEGMENT; + sctp_transport_pmtu(peer); /* If this is the first transport addr on this association, * initialize the association PMTU to the peer's PMTU. * If not and the current association PMTU is higher than the new * peer's PMTU, reset the association PMTU to the new peer's PMTU. */ - if (asoc->pathmtu) - asoc->pathmtu = min_t(int, peer->pathmtu, asoc->pathmtu); + if (asoc->pmtu) + asoc->pmtu = min_t(int, peer->pmtu, asoc->pmtu); else - asoc->pathmtu = peer->pathmtu; + asoc->pmtu = peer->pmtu; SCTP_DEBUG_PRINTK("sctp_assoc_add_peer:association %p PMTU set to " - "%d\n", asoc, asoc->pathmtu); + "%d\n", asoc, asoc->pmtu); - asoc->frag_point = sctp_frag_point(sp, asoc->pathmtu); + asoc->frag_point = sctp_frag_point(sp, asoc->pmtu); /* The asoc->peer.port might not be meaningful yet, but * initialize the packet structure anyway. @@ -614,7 +574,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, * (for example, implementations MAY use the size of the * receiver advertised window). */ - peer->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380)); + peer->cwnd = min(4*asoc->pmtu, max_t(__u32, 2*asoc->pmtu, 4380)); /* At this point, we may not have the receiver's advertised window, * so initialize ssthresh to the default value and it will be set @@ -625,6 +585,17 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, peer->partial_bytes_acked = 0; peer->flight_size = 0; + /* By default, enable heartbeat for peer address. */ + peer->hb_allowed = 1; + + /* Initialize the peer's heartbeat interval based on the + * sock configured value. + */ + peer->hb_interval = msecs_to_jiffies(sp->paddrparam.spp_hbinterval); + + /* Set the path max_retrans. */ + peer->max_retrans = sp->paddrparam.spp_pathmaxrxt; + /* Set the transport's RTO.initial value */ peer->rto = asoc->rto_initial; @@ -1184,18 +1155,18 @@ void sctp_assoc_sync_pmtu(struct sctp_association *asoc) /* Get the lowest pmtu of all the transports. */ list_for_each(pos, &asoc->peer.transport_addr_list) { t = list_entry(pos, struct sctp_transport, transports); - if (!pmtu || (t->pathmtu < pmtu)) - pmtu = t->pathmtu; + if (!pmtu || (t->pmtu < pmtu)) + pmtu = t->pmtu; } if (pmtu) { struct sctp_sock *sp = sctp_sk(asoc->base.sk); - asoc->pathmtu = pmtu; + asoc->pmtu = pmtu; asoc->frag_point = sctp_frag_point(sp, pmtu); } SCTP_DEBUG_PRINTK("%s: asoc:%p, pmtu:%d, frag_point:%d\n", - __FUNCTION__, asoc, asoc->pathmtu, asoc->frag_point); + __FUNCTION__, asoc, asoc->pmtu, asoc->frag_point); } /* Should we send a SACK to update our peer? */ @@ -1208,7 +1179,7 @@ static inline int sctp_peer_needs_update(struct sctp_association *asoc) case SCTP_STATE_SHUTDOWN_SENT: if ((asoc->rwnd > asoc->a_rwnd) && ((asoc->rwnd - asoc->a_rwnd) >= - min_t(__u32, (asoc->base.sk->sk_rcvbuf >> 1), asoc->pathmtu))) + min_t(__u32, (asoc->base.sk->sk_rcvbuf >> 1), asoc->pmtu))) return 1; break; default: diff --git a/trunk/net/sctp/input.c b/trunk/net/sctp/input.c index 238f1bffa684..b24ff2c1aef5 100644 --- a/trunk/net/sctp/input.c +++ b/trunk/net/sctp/input.c @@ -305,36 +305,18 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc, struct sctp_transport *t, __u32 pmtu) { - if (sock_owned_by_user(sk) || !t || (t->pathmtu == pmtu)) - return; - - if (t->param_flags & SPP_PMTUD_ENABLE) { - if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) { - printk(KERN_WARNING "%s: Reported pmtu %d too low, " - "using default minimum of %d\n", - __FUNCTION__, pmtu, - SCTP_DEFAULT_MINSEGMENT); - /* Use default minimum segment size and disable - * pmtu discovery on this transport. - */ - t->pathmtu = SCTP_DEFAULT_MINSEGMENT; - t->param_flags = (t->param_flags & ~SPP_HB) | - SPP_PMTUD_DISABLE; - } else { - t->pathmtu = pmtu; - } + if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) { + printk(KERN_WARNING "%s: Reported pmtu %d too low, " + "using default minimum of %d\n", __FUNCTION__, pmtu, + SCTP_DEFAULT_MINSEGMENT); + pmtu = SCTP_DEFAULT_MINSEGMENT; + } - /* Update association pmtu. */ + if (!sock_owned_by_user(sk) && t && (t->pmtu != pmtu)) { + t->pmtu = pmtu; sctp_assoc_sync_pmtu(asoc); + sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD); } - - /* Retransmit with the new pmtu setting. - * Normally, if PMTU discovery is disabled, an ICMP Fragmentation - * Needed will never be sent, but if a message was sent before - * PMTU discovery was disabled that was larger than the PMTU, it - * would not be fragmented, so it must be re-transmitted fragmented. - */ - sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD); } /* diff --git a/trunk/net/sctp/ipv6.c b/trunk/net/sctp/ipv6.c index 15c05165c905..fa3be2b8fb5f 100644 --- a/trunk/net/sctp/ipv6.c +++ b/trunk/net/sctp/ipv6.c @@ -866,7 +866,7 @@ static int sctp_inet6_supported_addrs(const struct sctp_sock *opt, return 2; } -static const struct proto_ops inet6_seqpacket_ops = { +static struct proto_ops inet6_seqpacket_ops = { .family = PF_INET6, .owner = THIS_MODULE, .release = inet6_release, diff --git a/trunk/net/sctp/output.c b/trunk/net/sctp/output.c index a40991ef72c9..931371633464 100644 --- a/trunk/net/sctp/output.c +++ b/trunk/net/sctp/output.c @@ -234,8 +234,8 @@ sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *packet, goto finish; pmtu = ((packet->transport->asoc) ? - (packet->transport->asoc->pathmtu) : - (packet->transport->pathmtu)); + (packet->transport->asoc->pmtu) : + (packet->transport->pmtu)); too_big = (psize + chunk_len > pmtu); @@ -482,9 +482,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) if (!dst || (dst->obsolete > 1)) { dst_release(dst); sctp_transport_route(tp, NULL, sctp_sk(sk)); - if (asoc->param_flags & SPP_PMTUD_ENABLE) { - sctp_assoc_sync_pmtu(asoc); - } + sctp_assoc_sync_pmtu(asoc); } nskb->dst = dst_clone(tp->dst); @@ -494,10 +492,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) SCTP_DEBUG_PRINTK("***sctp_transmit_packet*** skb len %d\n", nskb->len); - if (tp->param_flags & SPP_PMTUD_ENABLE) - (*tp->af_specific->sctp_xmit)(nskb, tp, packet->ipfragok); - else - (*tp->af_specific->sctp_xmit)(nskb, tp, 1); + (*tp->af_specific->sctp_xmit)(nskb, tp, packet->ipfragok); out: packet->size = packet->overhead; @@ -582,7 +577,7 @@ static sctp_xmit_t sctp_packet_append_data(struct sctp_packet *packet, * if ((flightsize + Max.Burst * MTU) < cwnd) * cwnd = flightsize + Max.Burst * MTU */ - max_burst_bytes = asoc->max_burst * asoc->pathmtu; + max_burst_bytes = asoc->max_burst * asoc->pmtu; if ((transport->flight_size + max_burst_bytes) < transport->cwnd) { transport->cwnd = transport->flight_size + max_burst_bytes; SCTP_DEBUG_PRINTK("%s: cwnd limited by max_burst: " @@ -627,7 +622,7 @@ static sctp_xmit_t sctp_packet_append_data(struct sctp_packet *packet, * data will fit or delay in hopes of bundling a full * sized packet. */ - if (len < asoc->pathmtu - packet->overhead) { + if (len < asoc->pmtu - packet->overhead) { retval = SCTP_XMIT_NAGLE_DELAY; goto finish; } diff --git a/trunk/net/sctp/protocol.c b/trunk/net/sctp/protocol.c index de693b43c8ea..f775d78aa59d 100644 --- a/trunk/net/sctp/protocol.c +++ b/trunk/net/sctp/protocol.c @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -830,7 +829,7 @@ static struct notifier_block sctp_inetaddr_notifier = { }; /* Socket operations. */ -static const struct proto_ops inet_seqpacket_ops = { +static struct proto_ops inet_seqpacket_ops = { .family = PF_INET, .owner = THIS_MODULE, .release = inet_release, /* Needs to be wrapped... */ diff --git a/trunk/net/sctp/sm_sideeffect.c b/trunk/net/sctp/sm_sideeffect.c index 2d7d8a5db2ac..823947170a33 100644 --- a/trunk/net/sctp/sm_sideeffect.c +++ b/trunk/net/sctp/sm_sideeffect.c @@ -157,12 +157,9 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force, { __u32 ctsn, max_tsn_seen; struct sctp_chunk *sack; - struct sctp_transport *trans = asoc->peer.last_data_from; int error = 0; - if (force || - (!trans && (asoc->param_flags & SPP_SACKDELAY_DISABLE)) || - (trans && (trans->param_flags & SPP_SACKDELAY_DISABLE))) + if (force) asoc->peer.sack_needed = 1; ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); @@ -192,22 +189,7 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force, if (!asoc->peer.sack_needed) { /* We will need a SACK for the next packet. */ asoc->peer.sack_needed = 1; - - /* Set the SACK delay timeout based on the - * SACK delay for the last transport - * data was received from, or the default - * for the association. - */ - if (trans) - asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = - trans->sackdelay; - else - asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = - asoc->sackdelay; - - /* Restart the SACK timer. */ - sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, - SCTP_TO(SCTP_EVENT_TIMEOUT_SACK)); + goto out; } else { if (asoc->a_rwnd > asoc->rwnd) asoc->a_rwnd = asoc->rwnd; @@ -223,7 +205,7 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force, sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, SCTP_TO(SCTP_EVENT_TIMEOUT_SACK)); } - +out: return error; nomem: error = -ENOMEM; @@ -433,7 +415,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc, asoc->overall_error_count++; if (transport->state != SCTP_INACTIVE && - (transport->error_count++ >= transport->pathmaxrxt)) { + (transport->error_count++ >= transport->max_retrans)) { SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p", " transport IP: port:%d failed.\n", asoc, diff --git a/trunk/net/sctp/sm_statefuns.c b/trunk/net/sctp/sm_statefuns.c index 557a7d90b92a..475bfb4972d9 100644 --- a/trunk/net/sctp/sm_statefuns.c +++ b/trunk/net/sctp/sm_statefuns.c @@ -900,7 +900,7 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep, * HEARTBEAT is sent (see Section 8.3). */ - if (transport->param_flags & SPP_HB_ENABLE) { + if (transport->hb_allowed) { if (SCTP_DISPOSITION_NOMEM == sctp_sf_heartbeat(ep, asoc, type, arg, commands)) @@ -1051,7 +1051,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, return SCTP_DISPOSITION_DISCARD; } - max_interval = link->hbinterval + link->rto; + max_interval = link->hb_interval + link->rto; /* Check if the timestamp looks valid. */ if (time_after(hbinfo->sent_at, jiffies) || @@ -2691,9 +2691,14 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep, * document allow. However, an SCTP transmitter MUST NOT be * more aggressive than the following algorithms allow. */ - if (chunk->end_of_packet) + if (chunk->end_of_packet) { sctp_add_cmd_sf(commands, SCTP_CMD_GEN_SACK, SCTP_NOFORCE()); + /* Start the SACK timer. */ + sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, + SCTP_TO(SCTP_EVENT_TIMEOUT_SACK)); + } + return SCTP_DISPOSITION_CONSUME; discard_force: @@ -2716,9 +2721,13 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep, return SCTP_DISPOSITION_DISCARD; discard_noforce: - if (chunk->end_of_packet) + if (chunk->end_of_packet) { sctp_add_cmd_sf(commands, SCTP_CMD_GEN_SACK, SCTP_NOFORCE()); + /* Start the SACK timer. */ + sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, + SCTP_TO(SCTP_EVENT_TIMEOUT_SACK)); + } return SCTP_DISPOSITION_DISCARD; consume: return SCTP_DISPOSITION_CONSUME; @@ -3433,6 +3442,9 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(const struct sctp_endpoint *ep, * send another. */ sctp_add_cmd_sf(commands, SCTP_CMD_GEN_SACK, SCTP_NOFORCE()); + /* Start the SACK timer. */ + sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, + SCTP_TO(SCTP_EVENT_TIMEOUT_SACK)); return SCTP_DISPOSITION_CONSUME; diff --git a/trunk/net/sctp/socket.c b/trunk/net/sctp/socket.c index fc04d185fa33..abab81f3818f 100644 --- a/trunk/net/sctp/socket.c +++ b/trunk/net/sctp/socket.c @@ -156,6 +156,10 @@ static inline void sctp_set_owner_w(struct sctp_chunk *chunk) sizeof(struct sk_buff) + sizeof(struct sctp_chunk); + sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk) + + sizeof(struct sk_buff) + + sizeof(struct sctp_chunk); + atomic_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); } @@ -1941,379 +1945,107 @@ static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval, * address's parameters: * * struct sctp_paddrparams { - * sctp_assoc_t spp_assoc_id; - * struct sockaddr_storage spp_address; - * uint32_t spp_hbinterval; - * uint16_t spp_pathmaxrxt; - * uint32_t spp_pathmtu; - * uint32_t spp_sackdelay; - * uint32_t spp_flags; - * }; - * - * spp_assoc_id - (one-to-many style socket) This is filled in the - * application, and identifies the association for - * this query. + * sctp_assoc_t spp_assoc_id; + * struct sockaddr_storage spp_address; + * uint32_t spp_hbinterval; + * uint16_t spp_pathmaxrxt; + * }; + * + * spp_assoc_id - (UDP style socket) This is filled in the application, + * and identifies the association for this query. * spp_address - This specifies which address is of interest. * spp_hbinterval - This contains the value of the heartbeat interval, - * in milliseconds. If a value of zero - * is present in this field then no changes are to - * be made to this parameter. + * in milliseconds. A value of 0, when modifying the + * parameter, specifies that the heartbeat on this + * address should be disabled. A value of UINT32_MAX + * (4294967295), when modifying the parameter, + * specifies that a heartbeat should be sent + * immediately to the peer address, and the current + * interval should remain unchanged. * spp_pathmaxrxt - This contains the maximum number of * retransmissions before this address shall be - * considered unreachable. If a value of zero - * is present in this field then no changes are to - * be made to this parameter. - * spp_pathmtu - When Path MTU discovery is disabled the value - * specified here will be the "fixed" path mtu. - * Note that if the spp_address field is empty - * then all associations on this address will - * have this fixed path mtu set upon them. - * - * spp_sackdelay - When delayed sack is enabled, this value specifies - * the number of milliseconds that sacks will be delayed - * for. This value will apply to all addresses of an - * association if the spp_address field is empty. Note - * also, that if delayed sack is enabled and this - * value is set to 0, no change is made to the last - * recorded delayed sack timer value. - * - * spp_flags - These flags are used to control various features - * on an association. The flag field may contain - * zero or more of the following options. - * - * SPP_HB_ENABLE - Enable heartbeats on the - * specified address. Note that if the address - * field is empty all addresses for the association - * have heartbeats enabled upon them. - * - * SPP_HB_DISABLE - Disable heartbeats on the - * speicifed address. Note that if the address - * field is empty all addresses for the association - * will have their heartbeats disabled. Note also - * that SPP_HB_ENABLE and SPP_HB_DISABLE are - * mutually exclusive, only one of these two should - * be specified. Enabling both fields will have - * undetermined results. - * - * SPP_HB_DEMAND - Request a user initiated heartbeat - * to be made immediately. - * - * SPP_PMTUD_ENABLE - This field will enable PMTU - * discovery upon the specified address. Note that - * if the address feild is empty then all addresses - * on the association are effected. - * - * SPP_PMTUD_DISABLE - This field will disable PMTU - * discovery upon the specified address. Note that - * if the address feild is empty then all addresses - * on the association are effected. Not also that - * SPP_PMTUD_ENABLE and SPP_PMTUD_DISABLE are mutually - * exclusive. Enabling both will have undetermined - * results. - * - * SPP_SACKDELAY_ENABLE - Setting this flag turns - * on delayed sack. The time specified in spp_sackdelay - * is used to specify the sack delay for this address. Note - * that if spp_address is empty then all addresses will - * enable delayed sack and take on the sack delay - * value specified in spp_sackdelay. - * SPP_SACKDELAY_DISABLE - Setting this flag turns - * off delayed sack. If the spp_address field is blank then - * delayed sack is disabled for the entire association. Note - * also that this field is mutually exclusive to - * SPP_SACKDELAY_ENABLE, setting both will have undefined - * results. + * considered unreachable. */ -int sctp_apply_peer_addr_params(struct sctp_paddrparams *params, - struct sctp_transport *trans, - struct sctp_association *asoc, - struct sctp_sock *sp, - int hb_change, - int pmtud_change, - int sackdelay_change) -{ - int error; - - if (params->spp_flags & SPP_HB_DEMAND && trans) { - error = sctp_primitive_REQUESTHEARTBEAT (trans->asoc, trans); - if (error) - return error; - } - - if (params->spp_hbinterval) { - if (trans) { - trans->hbinterval = msecs_to_jiffies(params->spp_hbinterval); - } else if (asoc) { - asoc->hbinterval = msecs_to_jiffies(params->spp_hbinterval); - } else { - sp->hbinterval = params->spp_hbinterval; - } - } - - if (hb_change) { - if (trans) { - trans->param_flags = - (trans->param_flags & ~SPP_HB) | hb_change; - } else if (asoc) { - asoc->param_flags = - (asoc->param_flags & ~SPP_HB) | hb_change; - } else { - sp->param_flags = - (sp->param_flags & ~SPP_HB) | hb_change; - } - } - - if (params->spp_pathmtu) { - if (trans) { - trans->pathmtu = params->spp_pathmtu; - sctp_assoc_sync_pmtu(asoc); - } else if (asoc) { - asoc->pathmtu = params->spp_pathmtu; - sctp_frag_point(sp, params->spp_pathmtu); - } else { - sp->pathmtu = params->spp_pathmtu; - } - } - - if (pmtud_change) { - if (trans) { - int update = (trans->param_flags & SPP_PMTUD_DISABLE) && - (params->spp_flags & SPP_PMTUD_ENABLE); - trans->param_flags = - (trans->param_flags & ~SPP_PMTUD) | pmtud_change; - if (update) { - sctp_transport_pmtu(trans); - sctp_assoc_sync_pmtu(asoc); - } - } else if (asoc) { - asoc->param_flags = - (asoc->param_flags & ~SPP_PMTUD) | pmtud_change; - } else { - sp->param_flags = - (sp->param_flags & ~SPP_PMTUD) | pmtud_change; - } - } - - if (params->spp_sackdelay) { - if (trans) { - trans->sackdelay = - msecs_to_jiffies(params->spp_sackdelay); - } else if (asoc) { - asoc->sackdelay = - msecs_to_jiffies(params->spp_sackdelay); - } else { - sp->sackdelay = params->spp_sackdelay; - } - } - - if (sackdelay_change) { - if (trans) { - trans->param_flags = - (trans->param_flags & ~SPP_SACKDELAY) | - sackdelay_change; - } else if (asoc) { - asoc->param_flags = - (asoc->param_flags & ~SPP_SACKDELAY) | - sackdelay_change; - } else { - sp->param_flags = - (sp->param_flags & ~SPP_SACKDELAY) | - sackdelay_change; - } - } - - if (params->spp_pathmaxrxt) { - if (trans) { - trans->pathmaxrxt = params->spp_pathmaxrxt; - } else if (asoc) { - asoc->pathmaxrxt = params->spp_pathmaxrxt; - } else { - sp->pathmaxrxt = params->spp_pathmaxrxt; - } - } - - return 0; -} - static int sctp_setsockopt_peer_addr_params(struct sock *sk, char __user *optval, int optlen) { - struct sctp_paddrparams params; - struct sctp_transport *trans = NULL; - struct sctp_association *asoc = NULL; - struct sctp_sock *sp = sctp_sk(sk); + struct sctp_paddrparams params; + struct sctp_transport *trans; int error; - int hb_change, pmtud_change, sackdelay_change; if (optlen != sizeof(struct sctp_paddrparams)) - return - EINVAL; - + return -EINVAL; if (copy_from_user(¶ms, optval, optlen)) return -EFAULT; - /* Validate flags and value parameters. */ - hb_change = params.spp_flags & SPP_HB; - pmtud_change = params.spp_flags & SPP_PMTUD; - sackdelay_change = params.spp_flags & SPP_SACKDELAY; - - if (hb_change == SPP_HB || - pmtud_change == SPP_PMTUD || - sackdelay_change == SPP_SACKDELAY || - params.spp_sackdelay > 500 || - (params.spp_pathmtu - && params.spp_pathmtu < SCTP_DEFAULT_MINSEGMENT)) - return -EINVAL; - - /* If an address other than INADDR_ANY is specified, and - * no transport is found, then the request is invalid. + /* + * API 7. Socket Options (setting the default value for the endpoint) + * All options that support specific settings on an association by + * filling in either an association id variable or a sockaddr_storage + * SHOULD also support setting of the same value for the entire endpoint + * (i.e. future associations). To accomplish this the following logic is + * used when setting one of these options: + + * c) If neither the sockaddr_storage or association identification is + * set i.e. the sockaddr_storage is set to all 0's (INADDR_ANY) and + * the association identification is 0, the settings are a default + * and to be applied to the endpoint (all future associations). */ - if (!sctp_is_any(( union sctp_addr *)¶ms.spp_address)) { - trans = sctp_addr_id2transport(sk, ¶ms.spp_address, - params.spp_assoc_id); - if (!trans) + + /* update default value for endpoint (all future associations) */ + if (!params.spp_assoc_id && + sctp_is_any(( union sctp_addr *)¶ms.spp_address)) { + /* Manual heartbeat on an endpoint is invalid. */ + if (0xffffffff == params.spp_hbinterval) return -EINVAL; + else if (params.spp_hbinterval) + sctp_sk(sk)->paddrparam.spp_hbinterval = + params.spp_hbinterval; + if (params.spp_pathmaxrxt) + sctp_sk(sk)->paddrparam.spp_pathmaxrxt = + params.spp_pathmaxrxt; + return 0; } - /* Get association, if assoc_id != 0 and the socket is a one - * to many style socket, and an association was not found, then - * the id was invalid. - */ - asoc = sctp_id2assoc(sk, params.spp_assoc_id); - if (!asoc && params.spp_assoc_id && sctp_style(sk, UDP)) - return -EINVAL; - - /* Heartbeat demand can only be sent on a transport or - * association, but not a socket. - */ - if (params.spp_flags & SPP_HB_DEMAND && !trans && !asoc) + trans = sctp_addr_id2transport(sk, ¶ms.spp_address, + params.spp_assoc_id); + if (!trans) return -EINVAL; - /* Process parameters. */ - error = sctp_apply_peer_addr_params(¶ms, trans, asoc, sp, - hb_change, pmtud_change, - sackdelay_change); - - if (error) - return error; - - /* If changes are for association, also apply parameters to each - * transport. + /* Applications can enable or disable heartbeats for any peer address + * of an association, modify an address's heartbeat interval, force a + * heartbeat to be sent immediately, and adjust the address's maximum + * number of retransmissions sent before an address is considered + * unreachable. + * + * The value of the heartbeat interval, in milliseconds. A value of + * UINT32_MAX (4294967295), when modifying the parameter, specifies + * that a heartbeat should be sent immediately to the peer address, + * and the current interval should remain unchanged. */ - if (!trans && asoc) { - struct list_head *pos; - - list_for_each(pos, &asoc->peer.transport_addr_list) { - trans = list_entry(pos, struct sctp_transport, - transports); - sctp_apply_peer_addr_params(¶ms, trans, asoc, sp, - hb_change, pmtud_change, - sackdelay_change); - } - } - - return 0; -} - -/* 7.1.24. Delayed Ack Timer (SCTP_DELAYED_ACK_TIME) - * - * This options will get or set the delayed ack timer. The time is set - * in milliseconds. If the assoc_id is 0, then this sets or gets the - * endpoints default delayed ack timer value. If the assoc_id field is - * non-zero, then the set or get effects the specified association. - * - * struct sctp_assoc_value { - * sctp_assoc_t assoc_id; - * uint32_t assoc_value; - * }; - * - * assoc_id - This parameter, indicates which association the - * user is preforming an action upon. Note that if - * this field's value is zero then the endpoints - * default value is changed (effecting future - * associations only). - * - * assoc_value - This parameter contains the number of milliseconds - * that the user is requesting the delayed ACK timer - * be set to. Note that this value is defined in - * the standard to be between 200 and 500 milliseconds. - * - * Note: a value of zero will leave the value alone, - * but disable SACK delay. A non-zero value will also - * enable SACK delay. - */ - -static int sctp_setsockopt_delayed_ack_time(struct sock *sk, - char __user *optval, int optlen) -{ - struct sctp_assoc_value params; - struct sctp_transport *trans = NULL; - struct sctp_association *asoc = NULL; - struct sctp_sock *sp = sctp_sk(sk); - - if (optlen != sizeof(struct sctp_assoc_value)) - return - EINVAL; - - if (copy_from_user(¶ms, optval, optlen)) - return -EFAULT; - - /* Validate value parameter. */ - if (params.assoc_value > 500) - return -EINVAL; - - /* Get association, if assoc_id != 0 and the socket is a one - * to many style socket, and an association was not found, then - * the id was invalid. - */ - asoc = sctp_id2assoc(sk, params.assoc_id); - if (!asoc && params.assoc_id && sctp_style(sk, UDP)) - return -EINVAL; - - if (params.assoc_value) { - if (asoc) { - asoc->sackdelay = - msecs_to_jiffies(params.assoc_value); - asoc->param_flags = - (asoc->param_flags & ~SPP_SACKDELAY) | - SPP_SACKDELAY_ENABLE; - } else { - sp->sackdelay = params.assoc_value; - sp->param_flags = - (sp->param_flags & ~SPP_SACKDELAY) | - SPP_SACKDELAY_ENABLE; - } + if (0xffffffff == params.spp_hbinterval) { + error = sctp_primitive_REQUESTHEARTBEAT (trans->asoc, trans); + if (error) + return error; } else { - if (asoc) { - asoc->param_flags = - (asoc->param_flags & ~SPP_SACKDELAY) | - SPP_SACKDELAY_DISABLE; - } else { - sp->param_flags = - (sp->param_flags & ~SPP_SACKDELAY) | - SPP_SACKDELAY_DISABLE; - } + /* The value of the heartbeat interval, in milliseconds. A value of 0, + * when modifying the parameter, specifies that the heartbeat on this + * address should be disabled. + */ + if (params.spp_hbinterval) { + trans->hb_allowed = 1; + trans->hb_interval = + msecs_to_jiffies(params.spp_hbinterval); + } else + trans->hb_allowed = 0; } - /* If change is for association, also apply to each transport. */ - if (asoc) { - struct list_head *pos; + /* spp_pathmaxrxt contains the maximum number of retransmissions + * before this address shall be considered unreachable. + */ + if (params.spp_pathmaxrxt) + trans->max_retrans = params.spp_pathmaxrxt; - list_for_each(pos, &asoc->peer.transport_addr_list) { - trans = list_entry(pos, struct sctp_transport, - transports); - if (params.assoc_value) { - trans->sackdelay = - msecs_to_jiffies(params.assoc_value); - trans->param_flags = - (trans->param_flags & ~SPP_SACKDELAY) | - SPP_SACKDELAY_ENABLE; - } else { - trans->param_flags = - (trans->param_flags & ~SPP_SACKDELAY) | - SPP_SACKDELAY_DISABLE; - } - } - } - return 0; } @@ -2606,7 +2338,7 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl /* Update the frag_point of the existing associations. */ list_for_each(pos, &(sp->ep->asocs)) { asoc = list_entry(pos, struct sctp_association, asocs); - asoc->frag_point = sctp_frag_point(sp, asoc->pathmtu); + asoc->frag_point = sctp_frag_point(sp, asoc->pmtu); } return 0; @@ -2763,10 +2495,6 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname, retval = sctp_setsockopt_peer_addr_params(sk, optval, optlen); break; - case SCTP_DELAYED_ACK_TIME: - retval = sctp_setsockopt_delayed_ack_time(sk, optval, optlen); - break; - case SCTP_INITMSG: retval = sctp_setsockopt_initmsg(sk, optval, optlen); break; @@ -2991,13 +2719,8 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) /* Default Peer Address Parameters. These defaults can * be modified via SCTP_PEER_ADDR_PARAMS */ - sp->hbinterval = jiffies_to_msecs(sctp_hb_interval); - sp->pathmaxrxt = sctp_max_retrans_path; - sp->pathmtu = 0; // allow default discovery - sp->sackdelay = sctp_sack_timeout; - sp->param_flags = SPP_HB_ENABLE | - SPP_PMTUD_ENABLE | - SPP_SACKDELAY_ENABLE; + sp->paddrparam.spp_hbinterval = jiffies_to_msecs(sctp_hb_interval); + sp->paddrparam.spp_pathmaxrxt = sctp_max_retrans_path; /* If enabled no SCTP message fragmentation will be performed. * Configure through SCTP_DISABLE_FRAGMENTS socket option. @@ -3146,7 +2869,7 @@ static int sctp_getsockopt_sctp_status(struct sock *sk, int len, status.sstat_primary.spinfo_cwnd = transport->cwnd; status.sstat_primary.spinfo_srtt = transport->srtt; status.sstat_primary.spinfo_rto = jiffies_to_msecs(transport->rto); - status.sstat_primary.spinfo_mtu = transport->pathmtu; + status.sstat_primary.spinfo_mtu = transport->pmtu; if (status.sstat_primary.spinfo_state == SCTP_UNKNOWN) status.sstat_primary.spinfo_state = SCTP_ACTIVE; @@ -3205,7 +2928,7 @@ static int sctp_getsockopt_peer_addr_info(struct sock *sk, int len, pinfo.spinfo_cwnd = transport->cwnd; pinfo.spinfo_srtt = transport->srtt; pinfo.spinfo_rto = jiffies_to_msecs(transport->rto); - pinfo.spinfo_mtu = transport->pathmtu; + pinfo.spinfo_mtu = transport->pmtu; if (pinfo.spinfo_state == SCTP_UNKNOWN) pinfo.spinfo_state = SCTP_ACTIVE; @@ -3367,227 +3090,69 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char __user *optval * address's parameters: * * struct sctp_paddrparams { - * sctp_assoc_t spp_assoc_id; - * struct sockaddr_storage spp_address; - * uint32_t spp_hbinterval; - * uint16_t spp_pathmaxrxt; - * uint32_t spp_pathmtu; - * uint32_t spp_sackdelay; - * uint32_t spp_flags; - * }; - * - * spp_assoc_id - (one-to-many style socket) This is filled in the - * application, and identifies the association for - * this query. + * sctp_assoc_t spp_assoc_id; + * struct sockaddr_storage spp_address; + * uint32_t spp_hbinterval; + * uint16_t spp_pathmaxrxt; + * }; + * + * spp_assoc_id - (UDP style socket) This is filled in the application, + * and identifies the association for this query. * spp_address - This specifies which address is of interest. * spp_hbinterval - This contains the value of the heartbeat interval, - * in milliseconds. If a value of zero - * is present in this field then no changes are to - * be made to this parameter. + * in milliseconds. A value of 0, when modifying the + * parameter, specifies that the heartbeat on this + * address should be disabled. A value of UINT32_MAX + * (4294967295), when modifying the parameter, + * specifies that a heartbeat should be sent + * immediately to the peer address, and the current + * interval should remain unchanged. * spp_pathmaxrxt - This contains the maximum number of * retransmissions before this address shall be - * considered unreachable. If a value of zero - * is present in this field then no changes are to - * be made to this parameter. - * spp_pathmtu - When Path MTU discovery is disabled the value - * specified here will be the "fixed" path mtu. - * Note that if the spp_address field is empty - * then all associations on this address will - * have this fixed path mtu set upon them. - * - * spp_sackdelay - When delayed sack is enabled, this value specifies - * the number of milliseconds that sacks will be delayed - * for. This value will apply to all addresses of an - * association if the spp_address field is empty. Note - * also, that if delayed sack is enabled and this - * value is set to 0, no change is made to the last - * recorded delayed sack timer value. - * - * spp_flags - These flags are used to control various features - * on an association. The flag field may contain - * zero or more of the following options. - * - * SPP_HB_ENABLE - Enable heartbeats on the - * specified address. Note that if the address - * field is empty all addresses for the association - * have heartbeats enabled upon them. - * - * SPP_HB_DISABLE - Disable heartbeats on the - * speicifed address. Note that if the address - * field is empty all addresses for the association - * will have their heartbeats disabled. Note also - * that SPP_HB_ENABLE and SPP_HB_DISABLE are - * mutually exclusive, only one of these two should - * be specified. Enabling both fields will have - * undetermined results. - * - * SPP_HB_DEMAND - Request a user initiated heartbeat - * to be made immediately. - * - * SPP_PMTUD_ENABLE - This field will enable PMTU - * discovery upon the specified address. Note that - * if the address feild is empty then all addresses - * on the association are effected. - * - * SPP_PMTUD_DISABLE - This field will disable PMTU - * discovery upon the specified address. Note that - * if the address feild is empty then all addresses - * on the association are effected. Not also that - * SPP_PMTUD_ENABLE and SPP_PMTUD_DISABLE are mutually - * exclusive. Enabling both will have undetermined - * results. - * - * SPP_SACKDELAY_ENABLE - Setting this flag turns - * on delayed sack. The time specified in spp_sackdelay - * is used to specify the sack delay for this address. Note - * that if spp_address is empty then all addresses will - * enable delayed sack and take on the sack delay - * value specified in spp_sackdelay. - * SPP_SACKDELAY_DISABLE - Setting this flag turns - * off delayed sack. If the spp_address field is blank then - * delayed sack is disabled for the entire association. Note - * also that this field is mutually exclusive to - * SPP_SACKDELAY_ENABLE, setting both will have undefined - * results. + * considered unreachable. */ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len, - char __user *optval, int __user *optlen) + char __user *optval, int __user *optlen) { - struct sctp_paddrparams params; - struct sctp_transport *trans = NULL; - struct sctp_association *asoc = NULL; - struct sctp_sock *sp = sctp_sk(sk); + struct sctp_paddrparams params; + struct sctp_transport *trans; if (len != sizeof(struct sctp_paddrparams)) return -EINVAL; - if (copy_from_user(¶ms, optval, len)) return -EFAULT; - /* If an address other than INADDR_ANY is specified, and - * no transport is found, then the request is invalid. + /* If no association id is specified retrieve the default value + * for the endpoint that will be used for all future associations */ - if (!sctp_is_any(( union sctp_addr *)¶ms.spp_address)) { - trans = sctp_addr_id2transport(sk, ¶ms.spp_address, - params.spp_assoc_id); - if (!trans) { - SCTP_DEBUG_PRINTK("Failed no transport\n"); - return -EINVAL; - } - } - - /* Get association, if assoc_id != 0 and the socket is a one - * to many style socket, and an association was not found, then - * the id was invalid. - */ - asoc = sctp_id2assoc(sk, params.spp_assoc_id); - if (!asoc && params.spp_assoc_id && sctp_style(sk, UDP)) { - SCTP_DEBUG_PRINTK("Failed no association\n"); - return -EINVAL; - } + if (!params.spp_assoc_id && + sctp_is_any(( union sctp_addr *)¶ms.spp_address)) { + params.spp_hbinterval = sctp_sk(sk)->paddrparam.spp_hbinterval; + params.spp_pathmaxrxt = sctp_sk(sk)->paddrparam.spp_pathmaxrxt; - if (trans) { - /* Fetch transport values. */ - params.spp_hbinterval = jiffies_to_msecs(trans->hbinterval); - params.spp_pathmtu = trans->pathmtu; - params.spp_pathmaxrxt = trans->pathmaxrxt; - params.spp_sackdelay = jiffies_to_msecs(trans->sackdelay); - - /*draft-11 doesn't say what to return in spp_flags*/ - params.spp_flags = trans->param_flags; - } else if (asoc) { - /* Fetch association values. */ - params.spp_hbinterval = jiffies_to_msecs(asoc->hbinterval); - params.spp_pathmtu = asoc->pathmtu; - params.spp_pathmaxrxt = asoc->pathmaxrxt; - params.spp_sackdelay = jiffies_to_msecs(asoc->sackdelay); - - /*draft-11 doesn't say what to return in spp_flags*/ - params.spp_flags = asoc->param_flags; - } else { - /* Fetch socket values. */ - params.spp_hbinterval = sp->hbinterval; - params.spp_pathmtu = sp->pathmtu; - params.spp_sackdelay = sp->sackdelay; - params.spp_pathmaxrxt = sp->pathmaxrxt; - - /*draft-11 doesn't say what to return in spp_flags*/ - params.spp_flags = sp->param_flags; + goto done; } - if (copy_to_user(optval, ¶ms, len)) - return -EFAULT; - - if (put_user(len, optlen)) - return -EFAULT; - - return 0; -} - -/* 7.1.24. Delayed Ack Timer (SCTP_DELAYED_ACK_TIME) - * - * This options will get or set the delayed ack timer. The time is set - * in milliseconds. If the assoc_id is 0, then this sets or gets the - * endpoints default delayed ack timer value. If the assoc_id field is - * non-zero, then the set or get effects the specified association. - * - * struct sctp_assoc_value { - * sctp_assoc_t assoc_id; - * uint32_t assoc_value; - * }; - * - * assoc_id - This parameter, indicates which association the - * user is preforming an action upon. Note that if - * this field's value is zero then the endpoints - * default value is changed (effecting future - * associations only). - * - * assoc_value - This parameter contains the number of milliseconds - * that the user is requesting the delayed ACK timer - * be set to. Note that this value is defined in - * the standard to be between 200 and 500 milliseconds. - * - * Note: a value of zero will leave the value alone, - * but disable SACK delay. A non-zero value will also - * enable SACK delay. - */ -static int sctp_getsockopt_delayed_ack_time(struct sock *sk, int len, - char __user *optval, - int __user *optlen) -{ - struct sctp_assoc_value params; - struct sctp_association *asoc = NULL; - struct sctp_sock *sp = sctp_sk(sk); - - if (len != sizeof(struct sctp_assoc_value)) - return - EINVAL; - - if (copy_from_user(¶ms, optval, len)) - return -EFAULT; - - /* Get association, if assoc_id != 0 and the socket is a one - * to many style socket, and an association was not found, then - * the id was invalid. - */ - asoc = sctp_id2assoc(sk, params.assoc_id); - if (!asoc && params.assoc_id && sctp_style(sk, UDP)) + trans = sctp_addr_id2transport(sk, ¶ms.spp_address, + params.spp_assoc_id); + if (!trans) return -EINVAL; - if (asoc) { - /* Fetch association values. */ - if (asoc->param_flags & SPP_SACKDELAY_ENABLE) - params.assoc_value = jiffies_to_msecs( - asoc->sackdelay); - else - params.assoc_value = 0; - } else { - /* Fetch socket values. */ - if (sp->param_flags & SPP_SACKDELAY_ENABLE) - params.assoc_value = sp->sackdelay; - else - params.assoc_value = 0; - } + /* The value of the heartbeat interval, in milliseconds. A value of 0, + * when modifying the parameter, specifies that the heartbeat on this + * address should be disabled. + */ + if (!trans->hb_allowed) + params.spp_hbinterval = 0; + else + params.spp_hbinterval = jiffies_to_msecs(trans->hb_interval); + + /* spp_pathmaxrxt contains the maximum number of retransmissions + * before this address shall be considered unreachable. + */ + params.spp_pathmaxrxt = trans->max_retrans; +done: if (copy_to_user(optval, ¶ms, len)) return -EFAULT; @@ -3860,7 +3425,7 @@ static int sctp_copy_laddrs_to_user_old(struct sock *sk, __u16 port, int max_add } static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port, - void __user **to, size_t space_left) + void * __user *to, size_t space_left) { struct list_head *pos; struct sctp_sockaddr_entry *addr; @@ -4454,10 +4019,6 @@ SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname, retval = sctp_getsockopt_peer_addr_params(sk, len, optval, optlen); break; - case SCTP_DELAYED_ACK_TIME: - retval = sctp_getsockopt_delayed_ack_time(sk, len, optval, - optlen); - break; case SCTP_INITMSG: retval = sctp_getsockopt_initmsg(sk, len, optval, optlen); break; @@ -4865,7 +4426,7 @@ int sctp_inet_listen(struct socket *sock, int backlog) * tcp_poll(). Note that, based on these implementations, we don't * lock the socket in this function, even though it seems that, * ideally, locking or some other mechanisms can be used to ensure - * the integrity of the counters (sndbuf and wmem_alloc) used + * the integrity of the counters (sndbuf and wmem_queued) used * in this place. We assume that we don't need locks either until proven * otherwise. * @@ -5182,6 +4743,11 @@ static struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags, struct sk_buff *skb; long timeo; + /* Caller is allowed not to check sk->sk_err before calling. */ + error = sock_error(sk); + if (error) + goto no_packet; + timeo = sock_rcvtimeo(sk, noblock); SCTP_DEBUG_PRINTK("Timeout: timeo: %ld, MAX: %ld.\n", @@ -5208,11 +4774,6 @@ static struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags, if (skb) return skb; - /* Caller is allowed not to check sk->sk_err before calling. */ - error = sock_error(sk); - if (error) - goto no_packet; - if (sk->sk_shutdown & RCV_SHUTDOWN) break; @@ -5272,6 +4833,10 @@ static void sctp_wfree(struct sk_buff *skb) sizeof(struct sk_buff) + sizeof(struct sctp_chunk); + sk->sk_wmem_queued -= SCTP_DATA_SNDSIZE(chunk) + + sizeof(struct sk_buff) + + sizeof(struct sctp_chunk); + atomic_sub(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); sock_wfree(skb); @@ -5355,7 +4920,7 @@ void sctp_write_space(struct sock *sk) /* Is there any sndbuf space available on the socket? * - * Note that sk_wmem_alloc is the sum of the send buffers on all of the + * Note that wmem_queued is the sum of the send buffers on all of the * associations on the same socket. For a UDP-style socket with * multiple associations, it is possible for it to be "unwriteable" * prematurely. I assume that this is acceptable because @@ -5368,7 +4933,7 @@ static int sctp_writeable(struct sock *sk) { int amt = 0; - amt = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); + amt = sk->sk_sndbuf - sk->sk_wmem_queued; if (amt < 0) amt = 0; return amt; diff --git a/trunk/net/sctp/transport.c b/trunk/net/sctp/transport.c index 68d73e2dd155..6bc27200e6ca 100644 --- a/trunk/net/sctp/transport.c +++ b/trunk/net/sctp/transport.c @@ -86,13 +86,10 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer, peer->init_sent_count = 0; peer->state = SCTP_ACTIVE; - peer->param_flags = SPP_HB_DISABLE | - SPP_PMTUD_ENABLE | - SPP_SACKDELAY_ENABLE; - peer->hbinterval = 0; + peer->hb_allowed = 0; /* Initialize the default path max_retrans. */ - peer->pathmaxrxt = sctp_max_retrans_path; + peer->max_retrans = sctp_max_retrans_path; peer->error_count = 0; INIT_LIST_HEAD(&peer->transmitted); @@ -232,10 +229,10 @@ void sctp_transport_pmtu(struct sctp_transport *transport) dst = transport->af_specific->get_dst(NULL, &transport->ipaddr, NULL); if (dst) { - transport->pathmtu = dst_mtu(dst); + transport->pmtu = dst_mtu(dst); dst_release(dst); } else - transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; + transport->pmtu = SCTP_DEFAULT_MAXSEGMENT; } /* Caches the dst entry and source address for a transport's destination @@ -257,20 +254,16 @@ void sctp_transport_route(struct sctp_transport *transport, af->get_saddr(asoc, dst, daddr, &transport->saddr); transport->dst = dst; - if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) { - return; - } if (dst) { - transport->pathmtu = dst_mtu(dst); + transport->pmtu = dst_mtu(dst); /* Initialize sk->sk_rcv_saddr, if the transport is the * association's active path for getsockname(). */ if (asoc && (transport == asoc->peer.active_path)) - opt->pf->af->to_sk_saddr(&transport->saddr, - asoc->base.sk); + af->to_sk_saddr(&transport->saddr, asoc->base.sk); } else - transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; + transport->pmtu = SCTP_DEFAULT_MAXSEGMENT; } /* Hold a reference to a transport. */ @@ -375,7 +368,7 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport, ssthresh = transport->ssthresh; pba = transport->partial_bytes_acked; - pmtu = transport->asoc->pathmtu; + pmtu = transport->asoc->pmtu; if (cwnd <= ssthresh) { /* RFC 2960 7.2.1, sctpimpguide-05 2.14.2 When cwnd is less @@ -447,8 +440,8 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, * partial_bytes_acked = 0 */ transport->ssthresh = max(transport->cwnd/2, - 4*transport->asoc->pathmtu); - transport->cwnd = transport->asoc->pathmtu; + 4*transport->asoc->pmtu); + transport->cwnd = transport->asoc->pmtu; break; case SCTP_LOWER_CWND_FAST_RTX: @@ -465,7 +458,7 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, * partial_bytes_acked = 0 */ transport->ssthresh = max(transport->cwnd/2, - 4*transport->asoc->pathmtu); + 4*transport->asoc->pmtu); transport->cwnd = transport->ssthresh; break; @@ -485,7 +478,7 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, if ((jiffies - transport->last_time_ecne_reduced) > transport->rtt) { transport->ssthresh = max(transport->cwnd/2, - 4*transport->asoc->pathmtu); + 4*transport->asoc->pmtu); transport->cwnd = transport->ssthresh; transport->last_time_ecne_reduced = jiffies; } @@ -502,7 +495,7 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, */ if ((jiffies - transport->last_time_used) > transport->rto) transport->cwnd = max(transport->cwnd/2, - 4*transport->asoc->pathmtu); + 4*transport->asoc->pmtu); break; }; @@ -517,7 +510,7 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, unsigned long sctp_transport_timeout(struct sctp_transport *t) { unsigned long timeout; - timeout = t->hbinterval + t->rto + sctp_jitter(t->rto); + timeout = t->hb_interval + t->rto + sctp_jitter(t->rto); timeout += jiffies; return timeout; } diff --git a/trunk/net/socket.c b/trunk/net/socket.c index 06fa217f58a9..3145103cdf54 100644 --- a/trunk/net/socket.c +++ b/trunk/net/socket.c @@ -640,150 +640,154 @@ static void sock_aio_dtor(struct kiocb *iocb) kfree(iocb->private); } -static ssize_t sock_sendpage(struct file *file, struct page *page, - int offset, size_t size, loff_t *ppos, int more) +/* + * Read data from a socket. ubuf is a user mode pointer. We make sure the user + * area ubuf...ubuf+size-1 is writable before asking the protocol. + */ + +static ssize_t sock_aio_read(struct kiocb *iocb, char __user *ubuf, + size_t size, loff_t pos) { + struct sock_iocb *x, siocb; struct socket *sock; int flags; - sock = file->private_data; - - flags = !(file->f_flags & O_NONBLOCK) ? 0 : MSG_DONTWAIT; - if (more) - flags |= MSG_MORE; - - return sock->ops->sendpage(sock, page, offset, size, flags); -} + if (pos != 0) + return -ESPIPE; + if (size==0) /* Match SYS5 behaviour */ + return 0; -static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb, - char __user *ubuf, size_t size, struct sock_iocb *siocb) -{ - if (!is_sync_kiocb(iocb)) { - siocb = kmalloc(sizeof(*siocb), GFP_KERNEL); - if (!siocb) - return NULL; + if (is_sync_kiocb(iocb)) + x = &siocb; + else { + x = kmalloc(sizeof(struct sock_iocb), GFP_KERNEL); + if (!x) + return -ENOMEM; iocb->ki_dtor = sock_aio_dtor; } + iocb->private = x; + x->kiocb = iocb; + sock = iocb->ki_filp->private_data; - siocb->kiocb = iocb; - siocb->async_iov.iov_base = ubuf; - siocb->async_iov.iov_len = size; + x->async_msg.msg_name = NULL; + x->async_msg.msg_namelen = 0; + x->async_msg.msg_iov = &x->async_iov; + x->async_msg.msg_iovlen = 1; + x->async_msg.msg_control = NULL; + x->async_msg.msg_controllen = 0; + x->async_iov.iov_base = ubuf; + x->async_iov.iov_len = size; + flags = !(iocb->ki_filp->f_flags & O_NONBLOCK) ? 0 : MSG_DONTWAIT; - iocb->private = siocb; - return siocb; + return __sock_recvmsg(iocb, sock, &x->async_msg, size, flags); } -static ssize_t do_sock_read(struct msghdr *msg, struct kiocb *iocb, - struct file *file, struct iovec *iov, unsigned long nr_segs) -{ - struct socket *sock = file->private_data; - size_t size = 0; - int i; - for (i = 0 ; i < nr_segs ; i++) - size += iov[i].iov_len; - - msg->msg_name = NULL; - msg->msg_namelen = 0; - msg->msg_control = NULL; - msg->msg_controllen = 0; - msg->msg_iov = (struct iovec *) iov; - msg->msg_iovlen = nr_segs; - msg->msg_flags = (file->f_flags & O_NONBLOCK) ? MSG_DONTWAIT : 0; - - return __sock_recvmsg(iocb, sock, msg, size, msg->msg_flags); -} - -static ssize_t sock_readv(struct file *file, const struct iovec *iov, - unsigned long nr_segs, loff_t *ppos) -{ - struct kiocb iocb; - struct sock_iocb siocb; - struct msghdr msg; - int ret; - - init_sync_kiocb(&iocb, NULL); - iocb.private = &siocb; - - ret = do_sock_read(&msg, &iocb, file, (struct iovec *)iov, nr_segs); - if (-EIOCBQUEUED == ret) - ret = wait_on_sync_kiocb(&iocb); - return ret; -} +/* + * Write data to a socket. We verify that the user area ubuf..ubuf+size-1 + * is readable by the user process. + */ -static ssize_t sock_aio_read(struct kiocb *iocb, char __user *ubuf, - size_t count, loff_t pos) +static ssize_t sock_aio_write(struct kiocb *iocb, const char __user *ubuf, + size_t size, loff_t pos) { - struct sock_iocb siocb, *x; - + struct sock_iocb *x, siocb; + struct socket *sock; + if (pos != 0) return -ESPIPE; - if (count == 0) /* Match SYS5 behaviour */ + if(size==0) /* Match SYS5 behaviour */ return 0; - x = alloc_sock_iocb(iocb, ubuf, count, &siocb); - if (!x) - return -ENOMEM; - return do_sock_read(&x->async_msg, iocb, iocb->ki_filp, - &x->async_iov, 1); + if (is_sync_kiocb(iocb)) + x = &siocb; + else { + x = kmalloc(sizeof(struct sock_iocb), GFP_KERNEL); + if (!x) + return -ENOMEM; + iocb->ki_dtor = sock_aio_dtor; + } + iocb->private = x; + x->kiocb = iocb; + sock = iocb->ki_filp->private_data; + + x->async_msg.msg_name = NULL; + x->async_msg.msg_namelen = 0; + x->async_msg.msg_iov = &x->async_iov; + x->async_msg.msg_iovlen = 1; + x->async_msg.msg_control = NULL; + x->async_msg.msg_controllen = 0; + x->async_msg.msg_flags = !(iocb->ki_filp->f_flags & O_NONBLOCK) ? 0 : MSG_DONTWAIT; + if (sock->type == SOCK_SEQPACKET) + x->async_msg.msg_flags |= MSG_EOR; + x->async_iov.iov_base = (void __user *)ubuf; + x->async_iov.iov_len = size; + + return __sock_sendmsg(iocb, sock, &x->async_msg, size); } -static ssize_t do_sock_write(struct msghdr *msg, struct kiocb *iocb, - struct file *file, struct iovec *iov, unsigned long nr_segs) +static ssize_t sock_sendpage(struct file *file, struct page *page, + int offset, size_t size, loff_t *ppos, int more) { - struct socket *sock = file->private_data; - size_t size = 0; - int i; + struct socket *sock; + int flags; - for (i = 0 ; i < nr_segs ; i++) - size += iov[i].iov_len; + sock = file->private_data; - msg->msg_name = NULL; - msg->msg_namelen = 0; - msg->msg_control = NULL; - msg->msg_controllen = 0; - msg->msg_iov = (struct iovec *) iov; - msg->msg_iovlen = nr_segs; - msg->msg_flags = (file->f_flags & O_NONBLOCK) ? MSG_DONTWAIT : 0; - if (sock->type == SOCK_SEQPACKET) - msg->msg_flags |= MSG_EOR; + flags = !(file->f_flags & O_NONBLOCK) ? 0 : MSG_DONTWAIT; + if (more) + flags |= MSG_MORE; - return __sock_sendmsg(iocb, sock, msg, size); + return sock->ops->sendpage(sock, page, offset, size, flags); } -static ssize_t sock_writev(struct file *file, const struct iovec *iov, - unsigned long nr_segs, loff_t *ppos) +static int sock_readv_writev(int type, + struct file * file, const struct iovec * iov, + long count, size_t size) { struct msghdr msg; - struct kiocb iocb; - struct sock_iocb siocb; - int ret; + struct socket *sock; - init_sync_kiocb(&iocb, NULL); - iocb.private = &siocb; + sock = file->private_data; - ret = do_sock_write(&msg, &iocb, file, (struct iovec *)iov, nr_segs); - if (-EIOCBQUEUED == ret) - ret = wait_on_sync_kiocb(&iocb); - return ret; -} + msg.msg_name = NULL; + msg.msg_namelen = 0; + msg.msg_control = NULL; + msg.msg_controllen = 0; + msg.msg_iov = (struct iovec *) iov; + msg.msg_iovlen = count; + msg.msg_flags = (file->f_flags & O_NONBLOCK) ? MSG_DONTWAIT : 0; -static ssize_t sock_aio_write(struct kiocb *iocb, const char __user *ubuf, - size_t count, loff_t pos) -{ - struct sock_iocb siocb, *x; + /* read() does a VERIFY_WRITE */ + if (type == VERIFY_WRITE) + return sock_recvmsg(sock, &msg, size, msg.msg_flags); - if (pos != 0) - return -ESPIPE; - if (count == 0) /* Match SYS5 behaviour */ - return 0; + if (sock->type == SOCK_SEQPACKET) + msg.msg_flags |= MSG_EOR; - x = alloc_sock_iocb(iocb, (void __user *)ubuf, count, &siocb); - if (!x) - return -ENOMEM; + return sock_sendmsg(sock, &msg, size); +} - return do_sock_write(&x->async_msg, iocb, iocb->ki_filp, - &x->async_iov, 1); +static ssize_t sock_readv(struct file *file, const struct iovec *vector, + unsigned long count, loff_t *ppos) +{ + size_t tot_len = 0; + int i; + for (i = 0 ; i < count ; i++) + tot_len += vector[i].iov_len; + return sock_readv_writev(VERIFY_WRITE, + file, vector, count, tot_len); +} + +static ssize_t sock_writev(struct file *file, const struct iovec *vector, + unsigned long count, loff_t *ppos) +{ + size_t tot_len = 0; + int i; + for (i = 0 ; i < count ; i++) + tot_len += vector[i].iov_len; + return sock_readv_writev(VERIFY_READ, + file, vector, count, tot_len); } @@ -900,13 +904,6 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg) break; default: err = sock->ops->ioctl(sock, cmd, arg); - - /* - * If this ioctl is unknown try to hand it down - * to the NIC driver. - */ - if (err == -ENOIOCTLCMD) - err = dev_ioctl(cmd, argp); break; } return err; @@ -2039,7 +2036,7 @@ int sock_unregister(int family) return 0; } -static int __init sock_init(void) +void __init sock_init(void) { /* * Initialize sock SLAB cache. @@ -2047,10 +2044,12 @@ static int __init sock_init(void) sk_init(); +#ifdef SLAB_SKB /* * Initialize skbuff SLAB cache */ skb_init(); +#endif /* * Initialize the protocols module. @@ -2059,19 +2058,15 @@ static int __init sock_init(void) init_inodecache(); register_filesystem(&sock_fs_type); sock_mnt = kern_mount(&sock_fs_type); - - /* The real protocol initialization is performed in later initcalls. + /* The real protocol initialization is performed when + * do_initcalls is run. */ #ifdef CONFIG_NETFILTER netfilter_init(); #endif - - return 0; } -core_initcall(sock_init); /* early initcall */ - #ifdef CONFIG_PROC_FS void socket_seq_show(struct seq_file *seq) { diff --git a/trunk/net/sunrpc/auth_gss/auth_gss.c b/trunk/net/sunrpc/auth_gss/auth_gss.c index 8d782282ec19..f44f46f1d8e0 100644 --- a/trunk/net/sunrpc/auth_gss/auth_gss.c +++ b/trunk/net/sunrpc/auth_gss/auth_gss.c @@ -638,7 +638,7 @@ gss_pipe_destroy_msg(struct rpc_pipe_msg *msg) gss_msg); atomic_inc(&gss_msg->count); gss_unhash_msg(gss_msg); - if (msg->errno == -ETIMEDOUT) { + if (msg->errno == -ETIMEDOUT || msg->errno == -EPIPE) { unsigned long now = jiffies; if (time_after(now, ratelimit)) { printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n" @@ -786,9 +786,7 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int taskflags) cred->gc_flags = 0; cred->gc_base.cr_ops = &gss_credops; cred->gc_service = gss_auth->service; - do { - err = gss_create_upcall(gss_auth, cred); - } while (err == -EAGAIN); + err = gss_create_upcall(gss_auth, cred); if (err < 0) goto out_err; diff --git a/trunk/net/sunrpc/rpc_pipe.c b/trunk/net/sunrpc/rpc_pipe.c index 16a2458f38f7..81e00a6c19de 100644 --- a/trunk/net/sunrpc/rpc_pipe.c +++ b/trunk/net/sunrpc/rpc_pipe.c @@ -39,26 +39,23 @@ static kmem_cache_t *rpc_inode_cachep __read_mostly; #define RPC_UPCALL_TIMEOUT (30*HZ) static void -__rpc_purge_list(struct rpc_inode *rpci, struct list_head *head, int err) +__rpc_purge_upcall(struct inode *inode, int err) { + struct rpc_inode *rpci = RPC_I(inode); struct rpc_pipe_msg *msg; - void (*destroy_msg)(struct rpc_pipe_msg *); - destroy_msg = rpci->ops->destroy_msg; - while (!list_empty(head)) { - msg = list_entry(head->next, struct rpc_pipe_msg, list); + while (!list_empty(&rpci->pipe)) { + msg = list_entry(rpci->pipe.next, struct rpc_pipe_msg, list); list_del_init(&msg->list); msg->errno = err; - destroy_msg(msg); + rpci->ops->destroy_msg(msg); + } + while (!list_empty(&rpci->in_upcall)) { + msg = list_entry(rpci->pipe.next, struct rpc_pipe_msg, list); + list_del_init(&msg->list); + msg->errno = err; + rpci->ops->destroy_msg(msg); } -} - -static void -__rpc_purge_upcall(struct inode *inode, int err) -{ - struct rpc_inode *rpci = RPC_I(inode); - - __rpc_purge_list(rpci, &rpci->pipe, err); rpci->pipelen = 0; wake_up(&rpci->waitq); } @@ -118,7 +115,6 @@ rpc_close_pipes(struct inode *inode) down(&inode->i_sem); if (rpci->ops != NULL) { rpci->nreaders = 0; - __rpc_purge_list(rpci, &rpci->in_upcall, -EPIPE); __rpc_purge_upcall(inode, -EPIPE); rpci->nwriters = 0; if (rpci->ops->release_pipe) @@ -174,7 +170,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp) goto out; msg = (struct rpc_pipe_msg *)filp->private_data; if (msg != NULL) { - msg->errno = -EAGAIN; + msg->errno = -EPIPE; list_del_init(&msg->list); rpci->ops->destroy_msg(msg); } @@ -183,7 +179,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp) if (filp->f_mode & FMODE_READ) rpci->nreaders --; if (!rpci->nreaders) - __rpc_purge_upcall(inode, -EAGAIN); + __rpc_purge_upcall(inode, -EPIPE); if (rpci->ops->release_pipe) rpci->ops->release_pipe(inode); out: diff --git a/trunk/net/sunrpc/svcsock.c b/trunk/net/sunrpc/svcsock.c index d68eba481291..e50e7cf43737 100644 --- a/trunk/net/sunrpc/svcsock.c +++ b/trunk/net/sunrpc/svcsock.c @@ -758,7 +758,7 @@ svc_tcp_accept(struct svc_sock *svsk) struct svc_serv *serv = svsk->sk_server; struct socket *sock = svsk->sk_sock; struct socket *newsock; - const struct proto_ops *ops; + struct proto_ops *ops; struct svc_sock *newsvsk; int err, slen; @@ -1178,7 +1178,6 @@ svc_recv(struct svc_serv *serv, struct svc_rqst *rqstp, long timeout) arg->tail[0].iov_len = 0; try_to_freeze(); - cond_resched(); if (signalled()) return -EINTR; diff --git a/trunk/net/sunrpc/xprtsock.c b/trunk/net/sunrpc/xprtsock.c index 77e8800d4127..0a51fd46a848 100644 --- a/trunk/net/sunrpc/xprtsock.c +++ b/trunk/net/sunrpc/xprtsock.c @@ -990,7 +990,6 @@ static void xs_udp_connect_worker(void *args) sk->sk_data_ready = xs_udp_data_ready; sk->sk_write_space = xs_udp_write_space; sk->sk_no_check = UDP_CSUM_NORCV; - sk->sk_allocation = GFP_ATOMIC; xprt_set_connected(xprt); @@ -1075,7 +1074,6 @@ static void xs_tcp_connect_worker(void *args) sk->sk_data_ready = xs_tcp_data_ready; sk->sk_state_change = xs_tcp_state_change; sk->sk_write_space = xs_tcp_write_space; - sk->sk_allocation = GFP_ATOMIC; /* socket options */ sk->sk_userlocks |= SOCK_BINDPORT_LOCK; diff --git a/trunk/net/unix/af_unix.c b/trunk/net/unix/af_unix.c index 5f6ae79b8b16..acc73ba8bade 100644 --- a/trunk/net/unix/af_unix.c +++ b/trunk/net/unix/af_unix.c @@ -121,7 +121,7 @@ int sysctl_unix_max_dgram_qlen = 10; struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1]; -DEFINE_SPINLOCK(unix_table_lock); +DEFINE_RWLOCK(unix_table_lock); static atomic_t unix_nr_socks = ATOMIC_INIT(0); #define unix_sockets_unbound (&unix_socket_table[UNIX_HASH_SIZE]) @@ -130,7 +130,7 @@ static atomic_t unix_nr_socks = ATOMIC_INIT(0); /* * SMP locking strategy: - * hash table is protected with spinlock unix_table_lock + * hash table is protected with rwlock unix_table_lock * each socket state is protected by separate rwlock. */ @@ -214,16 +214,16 @@ static void __unix_insert_socket(struct hlist_head *list, struct sock *sk) static inline void unix_remove_socket(struct sock *sk) { - spin_lock(&unix_table_lock); + write_lock(&unix_table_lock); __unix_remove_socket(sk); - spin_unlock(&unix_table_lock); + write_unlock(&unix_table_lock); } static inline void unix_insert_socket(struct hlist_head *list, struct sock *sk) { - spin_lock(&unix_table_lock); + write_lock(&unix_table_lock); __unix_insert_socket(list, sk); - spin_unlock(&unix_table_lock); + write_unlock(&unix_table_lock); } static struct sock *__unix_find_socket_byname(struct sockaddr_un *sunname, @@ -250,11 +250,11 @@ static inline struct sock *unix_find_socket_byname(struct sockaddr_un *sunname, { struct sock *s; - spin_lock(&unix_table_lock); + read_lock(&unix_table_lock); s = __unix_find_socket_byname(sunname, len, type, hash); if (s) sock_hold(s); - spin_unlock(&unix_table_lock); + read_unlock(&unix_table_lock); return s; } @@ -263,7 +263,7 @@ static struct sock *unix_find_socket_byinode(struct inode *i) struct sock *s; struct hlist_node *node; - spin_lock(&unix_table_lock); + read_lock(&unix_table_lock); sk_for_each(s, node, &unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) { struct dentry *dentry = unix_sk(s)->dentry; @@ -276,7 +276,7 @@ static struct sock *unix_find_socket_byinode(struct inode *i) } s = NULL; found: - spin_unlock(&unix_table_lock); + read_unlock(&unix_table_lock); return s; } @@ -473,7 +473,7 @@ static int unix_dgram_connect(struct socket *, struct sockaddr *, static int unix_seqpacket_sendmsg(struct kiocb *, struct socket *, struct msghdr *, size_t); -static const struct proto_ops unix_stream_ops = { +static struct proto_ops unix_stream_ops = { .family = PF_UNIX, .owner = THIS_MODULE, .release = unix_release, @@ -494,7 +494,7 @@ static const struct proto_ops unix_stream_ops = { .sendpage = sock_no_sendpage, }; -static const struct proto_ops unix_dgram_ops = { +static struct proto_ops unix_dgram_ops = { .family = PF_UNIX, .owner = THIS_MODULE, .release = unix_release, @@ -515,7 +515,7 @@ static const struct proto_ops unix_dgram_ops = { .sendpage = sock_no_sendpage, }; -static const struct proto_ops unix_seqpacket_ops = { +static struct proto_ops unix_seqpacket_ops = { .family = PF_UNIX, .owner = THIS_MODULE, .release = unix_release, @@ -564,7 +564,7 @@ static struct sock * unix_create1(struct socket *sock) u = unix_sk(sk); u->dentry = NULL; u->mnt = NULL; - spin_lock_init(&u->lock); + rwlock_init(&u->lock); atomic_set(&u->inflight, sock ? 0 : -1); init_MUTEX(&u->readsem); /* single task reading lock */ init_waitqueue_head(&u->peer_wait); @@ -642,12 +642,12 @@ static int unix_autobind(struct socket *sock) addr->len = sprintf(addr->name->sun_path+1, "%05x", ordernum) + 1 + sizeof(short); addr->hash = unix_hash_fold(csum_partial((void*)addr->name, addr->len, 0)); - spin_lock(&unix_table_lock); + write_lock(&unix_table_lock); ordernum = (ordernum+1)&0xFFFFF; if (__unix_find_socket_byname(addr->name, addr->len, sock->type, addr->hash)) { - spin_unlock(&unix_table_lock); + write_unlock(&unix_table_lock); /* Sanity yield. It is unusual case, but yet... */ if (!(ordernum&0xFF)) yield(); @@ -658,7 +658,7 @@ static int unix_autobind(struct socket *sock) __unix_remove_socket(sk); u->addr = addr; __unix_insert_socket(&unix_socket_table[addr->hash], sk); - spin_unlock(&unix_table_lock); + write_unlock(&unix_table_lock); err = 0; out: up(&u->readsem); @@ -791,7 +791,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) addr->hash = UNIX_HASH_SIZE; } - spin_lock(&unix_table_lock); + write_lock(&unix_table_lock); if (!sunaddr->sun_path[0]) { err = -EADDRINUSE; @@ -814,7 +814,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) __unix_insert_socket(list, sk); out_unlock: - spin_unlock(&unix_table_lock); + write_unlock(&unix_table_lock); out_up: up(&u->readsem); out: @@ -1063,12 +1063,10 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr, /* Set credentials */ sk->sk_peercred = other->sk_peercred; - sock->state = SS_CONNECTED; - sk->sk_state = TCP_ESTABLISHED; sock_hold(newsk); - - smp_mb__after_atomic_inc(); /* sock_hold() does an atomic_inc() */ unix_peer(sk) = newsk; + sock->state = SS_CONNECTED; + sk->sk_state = TCP_ESTABLISHED; unix_state_wunlock(sk); @@ -1416,7 +1414,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, } else { sunaddr = NULL; err = -ENOTCONN; - other = unix_peer(sk); + other = unix_peer_get(sk); if (!other) goto out_err; } @@ -1478,6 +1476,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, other->sk_data_ready(other, size); sent+=size; } + sock_put(other); scm_destroy(siocb->scm); siocb->scm = NULL; @@ -1492,6 +1491,8 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, send_sig(SIGPIPE,current,0); err = -EPIPE; out_err: + if (other) + sock_put(other); scm_destroy(siocb->scm); siocb->scm = NULL; return sent ? : err; @@ -1859,7 +1860,7 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) } default: - err = -ENOIOCTLCMD; + err = dev_ioctl(cmd, (void __user *)arg); break; } return err; @@ -1916,7 +1917,7 @@ static struct sock *unix_seq_idx(int *iter, loff_t pos) static void *unix_seq_start(struct seq_file *seq, loff_t *pos) { - spin_lock(&unix_table_lock); + read_lock(&unix_table_lock); return *pos ? unix_seq_idx(seq->private, *pos - 1) : ((void *) 1); } @@ -1931,7 +1932,7 @@ static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos) static void unix_seq_stop(struct seq_file *seq, void *v) { - spin_unlock(&unix_table_lock); + read_unlock(&unix_table_lock); } static int unix_seq_show(struct seq_file *seq, void *v) diff --git a/trunk/net/unix/garbage.c b/trunk/net/unix/garbage.c index 411802bd4d37..6ffc64e1712d 100644 --- a/trunk/net/unix/garbage.c +++ b/trunk/net/unix/garbage.c @@ -182,7 +182,7 @@ void unix_gc(void) if (down_trylock(&unix_gc_sem)) return; - spin_lock(&unix_table_lock); + read_lock(&unix_table_lock); forall_unix_sockets(i, s) { @@ -301,7 +301,7 @@ void unix_gc(void) } u->gc_tree = GC_ORPHAN; } - spin_unlock(&unix_table_lock); + read_unlock(&unix_table_lock); /* * Here we are. Hitlist is filled. Die. diff --git a/trunk/net/wanrouter/af_wanpipe.c b/trunk/net/wanrouter/af_wanpipe.c index 7a43ae4721ed..59fec59b2132 100644 --- a/trunk/net/wanrouter/af_wanpipe.c +++ b/trunk/net/wanrouter/af_wanpipe.c @@ -181,7 +181,7 @@ struct wanpipe_opt #endif static int sk_count; -extern const struct proto_ops wanpipe_ops; +extern struct proto_ops wanpipe_ops; static unsigned long find_free_critical; static void wanpipe_unlink_driver(struct sock *sk); @@ -1839,7 +1839,7 @@ static int wanpipe_ioctl(struct socket *sock, unsigned int cmd, unsigned long ar #endif default: - return -ENOIOCTLCMD; + return dev_ioctl(cmd,(void __user *) arg); } /*NOTREACHED*/ } @@ -2546,7 +2546,7 @@ static int wanpipe_connect(struct socket *sock, struct sockaddr *uaddr, int addr return 0; } -const struct proto_ops wanpipe_ops = { +struct proto_ops wanpipe_ops = { .family = PF_WANPIPE, .owner = THIS_MODULE, .release = wanpipe_release, diff --git a/trunk/net/x25/af_x25.c b/trunk/net/x25/af_x25.c index 16459c7f54b2..020d73cc8414 100644 --- a/trunk/net/x25/af_x25.c +++ b/trunk/net/x25/af_x25.c @@ -64,7 +64,7 @@ int sysctl_x25_ack_holdback_timeout = X25_DEFAULT_T2; HLIST_HEAD(x25_list); DEFINE_RWLOCK(x25_list_lock); -static const struct proto_ops x25_proto_ops; +static struct proto_ops x25_proto_ops; static struct x25_address null_x25_address = {" "}; @@ -1378,7 +1378,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) } default: - rc = -ENOIOCTLCMD; + rc = dev_ioctl(cmd, argp); break; } @@ -1391,7 +1391,7 @@ static struct net_proto_family x25_family_ops = { .owner = THIS_MODULE, }; -static const struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = { +static struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = { .family = AF_X25, .owner = THIS_MODULE, .release = x25_release, diff --git a/trunk/net/xfrm/xfrm_policy.c b/trunk/net/xfrm/xfrm_policy.c index 64a447375fdb..0db9e57013fd 100644 --- a/trunk/net/xfrm/xfrm_policy.c +++ b/trunk/net/xfrm/xfrm_policy.c @@ -10,7 +10,7 @@ * YOSHIFUJI Hideaki * Split up af-specific portion * Derek Atkins Add the post_input processor - * + * */ #include @@ -256,7 +256,6 @@ void __xfrm_policy_destroy(struct xfrm_policy *policy) if (del_timer(&policy->timer)) BUG(); - security_xfrm_policy_free(policy); kfree(policy); } EXPORT_SYMBOL(__xfrm_policy_destroy); @@ -347,12 +346,10 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) struct xfrm_policy *pol, **p; struct xfrm_policy *delpol = NULL; struct xfrm_policy **newpos = NULL; - struct dst_entry *gc_list; write_lock_bh(&xfrm_policy_lock); for (p = &xfrm_policy_list[dir]; (pol=*p)!=NULL;) { - if (!delpol && memcmp(&policy->selector, &pol->selector, sizeof(pol->selector)) == 0 && - xfrm_sec_ctx_match(pol->security, policy->security)) { + if (!delpol && memcmp(&policy->selector, &pol->selector, sizeof(pol->selector)) == 0) { if (excl) { write_unlock_bh(&xfrm_policy_lock); return -EEXIST; @@ -384,49 +381,21 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) xfrm_pol_hold(policy); write_unlock_bh(&xfrm_policy_lock); - if (delpol) + if (delpol) { xfrm_policy_kill(delpol); - - read_lock_bh(&xfrm_policy_lock); - gc_list = NULL; - for (policy = policy->next; policy; policy = policy->next) { - struct dst_entry *dst; - - write_lock(&policy->lock); - dst = policy->bundles; - if (dst) { - struct dst_entry *tail = dst; - while (tail->next) - tail = tail->next; - tail->next = gc_list; - gc_list = dst; - - policy->bundles = NULL; - } - write_unlock(&policy->lock); - } - read_unlock_bh(&xfrm_policy_lock); - - while (gc_list) { - struct dst_entry *dst = gc_list; - - gc_list = dst->next; - dst_free(dst); } - return 0; } EXPORT_SYMBOL(xfrm_policy_insert); -struct xfrm_policy *xfrm_policy_bysel_ctx(int dir, struct xfrm_selector *sel, - struct xfrm_sec_ctx *ctx, int delete) +struct xfrm_policy *xfrm_policy_bysel(int dir, struct xfrm_selector *sel, + int delete) { struct xfrm_policy *pol, **p; write_lock_bh(&xfrm_policy_lock); for (p = &xfrm_policy_list[dir]; (pol=*p)!=NULL; p = &pol->next) { - if ((memcmp(sel, &pol->selector, sizeof(*sel)) == 0) && - (xfrm_sec_ctx_match(ctx, pol->security))) { + if (memcmp(sel, &pol->selector, sizeof(*sel)) == 0) { xfrm_pol_hold(pol); if (delete) *p = pol->next; @@ -441,7 +410,7 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(int dir, struct xfrm_selector *sel, } return pol; } -EXPORT_SYMBOL(xfrm_policy_bysel_ctx); +EXPORT_SYMBOL(xfrm_policy_bysel); struct xfrm_policy *xfrm_policy_byid(int dir, u32 id, int delete) { @@ -522,7 +491,7 @@ EXPORT_SYMBOL(xfrm_policy_walk); /* Find policy to apply to this flow. */ -static void xfrm_policy_lookup(struct flowi *fl, u32 sk_sid, u16 family, u8 dir, +static void xfrm_policy_lookup(struct flowi *fl, u16 family, u8 dir, void **objp, atomic_t **obj_refp) { struct xfrm_policy *pol; @@ -536,12 +505,9 @@ static void xfrm_policy_lookup(struct flowi *fl, u32 sk_sid, u16 family, u8 dir, continue; match = xfrm_selector_match(sel, fl, family); - if (match) { - if (!security_xfrm_policy_lookup(pol, sk_sid, dir)) { - xfrm_pol_hold(pol); - break; - } + xfrm_pol_hold(pol); + break; } } read_unlock_bh(&xfrm_policy_lock); @@ -549,37 +515,15 @@ static void xfrm_policy_lookup(struct flowi *fl, u32 sk_sid, u16 family, u8 dir, *obj_refp = &pol->refcnt; } -static inline int policy_to_flow_dir(int dir) -{ - if (XFRM_POLICY_IN == FLOW_DIR_IN && - XFRM_POLICY_OUT == FLOW_DIR_OUT && - XFRM_POLICY_FWD == FLOW_DIR_FWD) - return dir; - switch (dir) { - default: - case XFRM_POLICY_IN: - return FLOW_DIR_IN; - case XFRM_POLICY_OUT: - return FLOW_DIR_OUT; - case XFRM_POLICY_FWD: - return FLOW_DIR_FWD; - }; -} - -static struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struct flowi *fl, u32 sk_sid) +static struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struct flowi *fl) { struct xfrm_policy *pol; read_lock_bh(&xfrm_policy_lock); if ((pol = sk->sk_policy[dir]) != NULL) { - int match = xfrm_selector_match(&pol->selector, fl, + int match = xfrm_selector_match(&pol->selector, fl, sk->sk_family); - int err = 0; - if (match) - err = security_xfrm_policy_lookup(pol, sk_sid, policy_to_flow_dir(dir)); - - if (match && !err) xfrm_pol_hold(pol); else pol = NULL; @@ -652,10 +596,6 @@ static struct xfrm_policy *clone_policy(struct xfrm_policy *old, int dir) if (newp) { newp->selector = old->selector; - if (security_xfrm_policy_clone(old, newp)) { - kfree(newp); - return NULL; /* ENOMEM */ - } newp->lft = old->lft; newp->curlft = old->curlft; newp->action = old->action; @@ -767,6 +707,22 @@ xfrm_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int nx, return err; } +static inline int policy_to_flow_dir(int dir) +{ + if (XFRM_POLICY_IN == FLOW_DIR_IN && + XFRM_POLICY_OUT == FLOW_DIR_OUT && + XFRM_POLICY_FWD == FLOW_DIR_FWD) + return dir; + switch (dir) { + default: + case XFRM_POLICY_IN: + return FLOW_DIR_IN; + case XFRM_POLICY_OUT: + return FLOW_DIR_OUT; + case XFRM_POLICY_FWD: + return FLOW_DIR_FWD; + }; +} static int stale_bundle(struct dst_entry *dst); @@ -785,20 +741,19 @@ int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, int err; u32 genid; u16 family = dst_orig->ops->family; - u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT); - u32 sk_sid = security_sk_sid(sk, fl, dir); restart: genid = atomic_read(&flow_cache_genid); policy = NULL; if (sk && sk->sk_policy[1]) - policy = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl, sk_sid); + policy = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl); if (!policy) { /* To accelerate a bit... */ if ((dst_orig->flags & DST_NOXFRM) || !xfrm_policy_list[XFRM_POLICY_OUT]) return 0; - policy = flow_cache_lookup(fl, sk_sid, family, dir, + policy = flow_cache_lookup(fl, family, + policy_to_flow_dir(XFRM_POLICY_OUT), xfrm_policy_lookup); } @@ -979,20 +934,16 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, { struct xfrm_policy *pol; struct flowi fl; - u8 fl_dir = policy_to_flow_dir(dir); - u32 sk_sid; if (_decode_session(skb, &fl, family) < 0) return 0; - sk_sid = security_sk_sid(sk, &fl, fl_dir); - /* First, check used SA against their selectors. */ if (skb->sp) { int i; for (i=skb->sp->len-1; i>=0; i--) { - struct sec_decap_state *xvec = &(skb->sp->x[i]); + struct sec_decap_state *xvec = &(skb->sp->x[i]); if (!xfrm_selector_match(&xvec->xvec->sel, &fl, family)) return 0; @@ -1007,10 +958,11 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, pol = NULL; if (sk && sk->sk_policy[dir]) - pol = xfrm_sk_policy_lookup(sk, dir, &fl, sk_sid); + pol = xfrm_sk_policy_lookup(sk, dir, &fl); if (!pol) - pol = flow_cache_lookup(&fl, sk_sid, family, fl_dir, + pol = flow_cache_lookup(&fl, family, + policy_to_flow_dir(dir), xfrm_policy_lookup); if (!pol) @@ -1062,12 +1014,13 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) } EXPORT_SYMBOL(__xfrm_route_forward); +/* Optimize later using cookies and generation ids. */ + static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie) { - /* If it is marked obsolete, which is how we even get here, - * then we have purged it from the policy bundle list and we - * did that for a good reason. - */ + if (!stale_bundle(dst)) + return dst; + return NULL; } @@ -1151,16 +1104,6 @@ int xfrm_flush_bundles(void) return 0; } -static int always_true(struct dst_entry *dst) -{ - return 1; -} - -void xfrm_flush_all_bundles(void) -{ - xfrm_prune_bundles(always_true); -} - void xfrm_init_pmtu(struct dst_entry *dst) { do { diff --git a/trunk/net/xfrm/xfrm_state.c b/trunk/net/xfrm/xfrm_state.c index e12d0be5f976..7cf48aa6c95b 100644 --- a/trunk/net/xfrm/xfrm_state.c +++ b/trunk/net/xfrm/xfrm_state.c @@ -10,7 +10,7 @@ * Split up af-specific functions * Derek Atkins * Add UDP Encapsulation - * + * */ #include @@ -70,7 +70,6 @@ static void xfrm_state_gc_destroy(struct xfrm_state *x) x->type->destructor(x); xfrm_put_type(x->type); } - security_xfrm_state_free(x); kfree(x); } @@ -344,8 +343,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, selector. */ if (x->km.state == XFRM_STATE_VALID) { - if (!xfrm_selector_match(&x->sel, fl, family) || - !xfrm_sec_ctx_match(pol->security, x->security)) + if (!xfrm_selector_match(&x->sel, fl, family)) continue; if (!best || best->km.dying > x->km.dying || @@ -356,8 +354,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, acquire_in_progress = 1; } else if (x->km.state == XFRM_STATE_ERROR || x->km.state == XFRM_STATE_EXPIRED) { - if (xfrm_selector_match(&x->sel, fl, family) && - xfrm_sec_ctx_match(pol->security, x->security)) + if (xfrm_selector_match(&x->sel, fl, family)) error = -ESRCH; } } @@ -434,8 +431,6 @@ void xfrm_state_insert(struct xfrm_state *x) spin_lock_bh(&xfrm_state_lock); __xfrm_state_insert(x); spin_unlock_bh(&xfrm_state_lock); - - xfrm_flush_all_bundles(); } EXPORT_SYMBOL(xfrm_state_insert); @@ -483,9 +478,6 @@ int xfrm_state_add(struct xfrm_state *x) spin_unlock_bh(&xfrm_state_lock); xfrm_state_put_afinfo(afinfo); - if (!err) - xfrm_flush_all_bundles(); - if (x1) { xfrm_state_delete(x1); xfrm_state_put(x1); diff --git a/trunk/net/xfrm/xfrm_user.c b/trunk/net/xfrm/xfrm_user.c index 92e2b804c606..0cdd9a07e043 100644 --- a/trunk/net/xfrm/xfrm_user.c +++ b/trunk/net/xfrm/xfrm_user.c @@ -7,7 +7,7 @@ * Kazunori MIYAZAWA @USAGI * Kunihiro Ishiguro * IPv6 support - * + * */ #include @@ -88,34 +88,6 @@ static int verify_encap_tmpl(struct rtattr **xfrma) return 0; } - -static inline int verify_sec_ctx_len(struct rtattr **xfrma) -{ - struct rtattr *rt = xfrma[XFRMA_SEC_CTX - 1]; - struct xfrm_user_sec_ctx *uctx; - int len = 0; - - if (!rt) - return 0; - - if (rt->rta_len < sizeof(*uctx)) - return -EINVAL; - - uctx = RTA_DATA(rt); - - if (uctx->ctx_len > PAGE_SIZE) - return -EINVAL; - - len += sizeof(struct xfrm_user_sec_ctx); - len += uctx->ctx_len; - - if (uctx->len != len) - return -EINVAL; - - return 0; -} - - static int verify_newsa_info(struct xfrm_usersa_info *p, struct rtattr **xfrma) { @@ -173,8 +145,6 @@ static int verify_newsa_info(struct xfrm_usersa_info *p, goto out; if ((err = verify_encap_tmpl(xfrma))) goto out; - if ((err = verify_sec_ctx_len(xfrma))) - goto out; err = -EINVAL; switch (p->mode) { @@ -239,30 +209,6 @@ static int attach_encap_tmpl(struct xfrm_encap_tmpl **encapp, struct rtattr *u_a return 0; } - -static inline int xfrm_user_sec_ctx_size(struct xfrm_policy *xp) -{ - struct xfrm_sec_ctx *xfrm_ctx = xp->security; - int len = 0; - - if (xfrm_ctx) { - len += sizeof(struct xfrm_user_sec_ctx); - len += xfrm_ctx->ctx_len; - } - return len; -} - -static int attach_sec_ctx(struct xfrm_state *x, struct rtattr *u_arg) -{ - struct xfrm_user_sec_ctx *uctx; - - if (!u_arg) - return 0; - - uctx = RTA_DATA(u_arg); - return security_xfrm_state_alloc(x, uctx); -} - static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info *p) { memcpy(&x->id, &p->id, sizeof(x->id)); @@ -307,9 +253,6 @@ static struct xfrm_state *xfrm_state_construct(struct xfrm_usersa_info *p, if (err) goto error; - if ((err = attach_sec_ctx(x, xfrma[XFRMA_SEC_CTX-1]))) - goto error; - x->km.seq = p->seq; return x; @@ -329,11 +272,11 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) int err; struct km_event c; - err = verify_newsa_info(p, (struct rtattr **)xfrma); + err = verify_newsa_info(p, (struct rtattr **) xfrma); if (err) return err; - x = xfrm_state_construct(p, (struct rtattr **)xfrma, &err); + x = xfrm_state_construct(p, (struct rtattr **) xfrma, &err); if (!x) return err; @@ -447,19 +390,6 @@ static int dump_one_state(struct xfrm_state *x, int count, void *ptr) if (x->encap) RTA_PUT(skb, XFRMA_ENCAP, sizeof(*x->encap), x->encap); - if (x->security) { - int ctx_size = sizeof(struct xfrm_sec_ctx) + - x->security->ctx_len; - struct rtattr *rt = __RTA_PUT(skb, XFRMA_SEC_CTX, ctx_size); - struct xfrm_user_sec_ctx *uctx = RTA_DATA(rt); - - uctx->exttype = XFRMA_SEC_CTX; - uctx->len = ctx_size; - uctx->ctx_doi = x->security->ctx_doi; - uctx->ctx_alg = x->security->ctx_alg; - uctx->ctx_len = x->security->ctx_len; - memcpy(uctx + 1, x->security->ctx_str, x->security->ctx_len); - } nlh->nlmsg_len = skb->tail - b; out: sp->this_idx++; @@ -673,18 +603,6 @@ static int verify_newpolicy_info(struct xfrm_userpolicy_info *p) return verify_policy_dir(p->dir); } -static int copy_from_user_sec_ctx(struct xfrm_policy *pol, struct rtattr **xfrma) -{ - struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1]; - struct xfrm_user_sec_ctx *uctx; - - if (!rt) - return 0; - - uctx = RTA_DATA(rt); - return security_xfrm_policy_alloc(pol, uctx); -} - static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut, int nr) { @@ -763,10 +681,7 @@ static struct xfrm_policy *xfrm_policy_construct(struct xfrm_userpolicy_info *p, } copy_from_user_policy(xp, p); - - if (!(err = copy_from_user_tmpl(xp, xfrma))) - err = copy_from_user_sec_ctx(xp, xfrma); - + err = copy_from_user_tmpl(xp, xfrma); if (err) { *errp = err; kfree(xp); @@ -785,13 +700,10 @@ static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfr int excl; err = verify_newpolicy_info(p); - if (err) - return err; - err = verify_sec_ctx_len((struct rtattr **)xfrma); if (err) return err; - xp = xfrm_policy_construct(p, (struct rtattr **)xfrma, &err); + xp = xfrm_policy_construct(p, (struct rtattr **) xfrma, &err); if (!xp) return err; @@ -849,27 +761,6 @@ static int copy_to_user_tmpl(struct xfrm_policy *xp, struct sk_buff *skb) return -1; } -static int copy_to_user_sec_ctx(struct xfrm_policy *xp, struct sk_buff *skb) -{ - if (xp->security) { - int ctx_size = sizeof(struct xfrm_sec_ctx) + - xp->security->ctx_len; - struct rtattr *rt = __RTA_PUT(skb, XFRMA_SEC_CTX, ctx_size); - struct xfrm_user_sec_ctx *uctx = RTA_DATA(rt); - - uctx->exttype = XFRMA_SEC_CTX; - uctx->len = ctx_size; - uctx->ctx_doi = xp->security->ctx_doi; - uctx->ctx_alg = xp->security->ctx_alg; - uctx->ctx_len = xp->security->ctx_len; - memcpy(uctx + 1, xp->security->ctx_str, xp->security->ctx_len); - } - return 0; - - rtattr_failure: - return -1; -} - static int dump_one_policy(struct xfrm_policy *xp, int dir, int count, void *ptr) { struct xfrm_dump_info *sp = ptr; @@ -891,8 +782,6 @@ static int dump_one_policy(struct xfrm_policy *xp, int dir, int count, void *ptr copy_to_user_policy(xp, p, dir); if (copy_to_user_tmpl(xp, skb) < 0) goto nlmsg_failure; - if (copy_to_user_sec_ctx(xp, skb)) - goto nlmsg_failure; nlh->nlmsg_len = skb->tail - b; out: @@ -963,25 +852,8 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfr if (p->index) xp = xfrm_policy_byid(p->dir, p->index, delete); - else { - struct rtattr **rtattrs = (struct rtattr **)xfrma; - struct rtattr *rt = rtattrs[XFRMA_SEC_CTX-1]; - struct xfrm_policy tmp; - - err = verify_sec_ctx_len(rtattrs); - if (err) - return err; - - memset(&tmp, 0, sizeof(struct xfrm_policy)); - if (rt) { - struct xfrm_user_sec_ctx *uctx = RTA_DATA(rt); - - if ((err = security_xfrm_policy_alloc(&tmp, uctx))) - return err; - } - xp = xfrm_policy_bysel_ctx(p->dir, &p->sel, tmp.security, delete); - security_xfrm_policy_free(&tmp); - } + else + xp = xfrm_policy_bysel(p->dir, &p->sel, delete); if (xp == NULL) return -ENOENT; @@ -1352,8 +1224,6 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x, if (copy_to_user_tmpl(xp, skb) < 0) goto nlmsg_failure; - if (copy_to_user_sec_ctx(xp, skb)) - goto nlmsg_failure; nlh->nlmsg_len = skb->tail - b; return skb->len; @@ -1371,7 +1241,6 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt, len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire)); - len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); skb = alloc_skb(len, GFP_ATOMIC); if (skb == NULL) return -ENOMEM; @@ -1455,8 +1324,6 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, copy_to_user_policy(xp, &upe->pol, dir); if (copy_to_user_tmpl(xp, skb) < 0) goto nlmsg_failure; - if (copy_to_user_sec_ctx(xp, skb)) - goto nlmsg_failure; upe->hard = !!hard; nlh->nlmsg_len = skb->tail - b; @@ -1474,7 +1341,6 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire)); - len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); skb = alloc_skb(len, GFP_ATOMIC); if (skb == NULL) return -ENOMEM; diff --git a/trunk/scripts/kconfig/Makefile b/trunk/scripts/kconfig/Makefile index a96153fc793f..9d67782b812f 100644 --- a/trunk/scripts/kconfig/Makefile +++ b/trunk/scripts/kconfig/Makefile @@ -129,8 +129,8 @@ endif HOSTCFLAGS_lex.zconf.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src) -HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl -HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK +HOSTLOADLIBES_qconf = -L$(QTLIBPATH) -Wl,-rpath,$(QTLIBPATH) -l$(LIBS_QT) -ldl +HOSTCXXFLAGS_qconf.o = -I$(QTDIR)/include -D LKC_DIRECT_LINK HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs` HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ @@ -139,50 +139,40 @@ HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ $(obj)/qconf.o: $(obj)/.tmp_qtcheck ifeq ($(qconf-target),1) -$(obj)/.tmp_qtcheck: $(src)/Makefile +MOC = $(QTDIR)/bin/moc +QTLIBPATH = $(QTDIR)/lib -include $(obj)/.tmp_qtcheck # QT needs some extra effort... $(obj)/.tmp_qtcheck: - @set -e; echo " CHECK qt"; dir=""; pkg=""; \ - pkg-config --exists qt 2> /dev/null && pkg=qt; \ - pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ - if [ -n "$$pkg" ]; then \ - cflags="\$$(shell pkg-config $$pkg --cflags)"; \ - libs="\$$(shell pkg-config $$pkg --libs)"; \ - moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ - dir="$$(pkg-config $$pkg --variable=prefix)"; \ + @set -e; for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ + if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \ + done; \ + if [ -z "$$DIR" ]; then \ + echo "*"; \ + echo "* Unable to find the QT installation. Please make sure that the"; \ + echo "* QT development package is correctly installed and the QTDIR"; \ + echo "* environment variable is set to the correct location."; \ + echo "*"; \ + false; \ + fi; \ + LIBPATH=$$DIR/lib; LIB=qt; \ + if [ -f $$QTLIB/libqt-mt.so ] ; then \ + LIB=qt-mt; \ + LIBPATH=$$QTLIB; \ else \ - for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ - if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ - done; \ - if [ -z "$$dir" ]; then \ - echo "*"; \ - echo "* Unable to find the QT installation. Please make sure that"; \ - echo "* the QT development package is correctly installed and"; \ - echo "* either install pkg-config or set the QTDIR environment"; \ - echo "* variable to the correct location."; \ - echo "*"; \ - false; \ - fi; \ - libpath=$$dir/lib; lib=qt; osdir=""; \ - $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ - osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ - test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ - test -f $$libpath/libqt-mt.so && lib=qt-mt; \ - cflags="-I$$dir/include"; \ - libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ - moc="$$dir/bin/moc"; \ + $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ + LIBPATH=$$DIR/lib/$$($(HOSTCXX) -print-multi-os-directory); \ + if [ -f $$LIBPATH/libqt-mt.so ]; then LIB=qt-mt; fi; \ fi; \ - if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ + echo "QTDIR=$$DIR" > $@; echo "QTLIBPATH=$$LIBPATH" >> $@; \ + echo "LIBS_QT=$$LIB" >> $@; \ + if [ ! -x $$DIR/bin/moc -a -x /usr/bin/moc ]; then \ echo "*"; \ - echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ + echo "* Unable to find $$DIR/bin/moc, using /usr/bin/moc instead."; \ echo "*"; \ - moc="/usr/bin/moc"; \ - fi; \ - echo "KC_QT_CFLAGS=$$cflags" > $@; \ - echo "KC_QT_LIBS=$$libs" >> $@; \ - echo "KC_QT_MOC=$$moc" >> $@ + echo "MOC=/usr/bin/moc" >> $@; \ + fi endif $(obj)/gconf.o: $(obj)/.tmp_gtkcheck @@ -220,7 +210,7 @@ $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h $(obj)/gconf.o: $(obj)/lkc_defs.h $(obj)/%.moc: $(src)/%.h - $(KC_QT_MOC) -i $< -o $@ + $(MOC) -i $< -o $@ $(obj)/lkc_defs.h: $(src)/lkc_proto.h sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' diff --git a/trunk/scripts/kernel-doc b/trunk/scripts/kernel-doc index 2f45fd2969d0..8aaf74e64183 100755 --- a/trunk/scripts/kernel-doc +++ b/trunk/scripts/kernel-doc @@ -117,8 +117,6 @@ use strict; # struct my_struct { # int a; # int b; -# /* private: */ -# int c; # }; # # All descriptions can be multiline, except the short function description. @@ -1306,12 +1304,6 @@ sub dump_struct($$) { # ignore embedded structs or unions $members =~ s/{.*?}//g; - # ignore members marked private: - $members =~ s/\/\*.*?private:.*?public:.*?\*\///gos; - $members =~ s/\/\*.*?private:.*//gos; - # strip comments: - $members =~ s/\/\*.*?\*\///gos; - create_parameterlist($members, ';', $file); output_declaration($declaration_name, @@ -1337,7 +1329,6 @@ sub dump_enum($$) { my $x = shift; my $file = shift; - $x =~ s@/\*.*?\*/@@gos; # strip comments. if ($x =~ /enum\s+(\w+)\s*{(.*)}/) { $declaration_name = $1; my $members = $2; @@ -1374,7 +1365,6 @@ sub dump_typedef($$) { my $x = shift; my $file = shift; - $x =~ s@/\*.*?\*/@@gos; # strip comments. while (($x =~ /\(*.\)\s*;$/) || ($x =~ /\[*.\]\s*;$/)) { $x =~ s/\(*.\)\s*;$/;/; $x =~ s/\[*.\]\s*;$/;/; @@ -1430,7 +1420,7 @@ sub create_parameterlist($$$) { $type = $arg; $type =~ s/([^\(]+\(\*)$param/$1/; push_parameter($param, $type, $file); - } elsif ($arg) { + } else { $arg =~ s/\s*:\s*/:/g; $arg =~ s/\s*\[/\[/g; @@ -1638,6 +1628,7 @@ sub process_state3_type($$) { my $x = shift; my $file = shift; + $x =~ s@/\*.*?\*/@@gos; # strip comments. $x =~ s@[\r\n]+@ @gos; # strip newlines/cr's. $x =~ s@^\s+@@gos; # strip leading spaces $x =~ s@\s+$@@gos; # strip trailing spaces diff --git a/trunk/security/Kconfig b/trunk/security/Kconfig index 34f593410d57..64d3f1e9ca85 100644 --- a/trunk/security/Kconfig +++ b/trunk/security/Kconfig @@ -54,19 +54,6 @@ config SECURITY_NETWORK implement socket and networking access controls. If you are unsure how to answer this question, answer N. -config SECURITY_NETWORK_XFRM - bool "XFRM (IPSec) Networking Security Hooks" - depends on XFRM && SECURITY_NETWORK - help - This enables the XFRM (IPSec) networking security hooks. - If enabled, a security module can use these hooks to - implement per-packet access controls based on labels - derived from IPSec policy. Non-IPSec communications are - designated as unlabelled, and only sockets authorized - to communicate unlabelled data can send without using - IPSec. - If you are unsure how to answer this question, answer N. - config SECURITY_CAPABILITIES tristate "Default Linux Capabilities" depends on SECURITY diff --git a/trunk/security/dummy.c b/trunk/security/dummy.c index a15c54709fde..3ca5f2b828a0 100644 --- a/trunk/security/dummy.c +++ b/trunk/security/dummy.c @@ -776,42 +776,8 @@ static inline int dummy_sk_alloc_security (struct sock *sk, int family, gfp_t pr static inline void dummy_sk_free_security (struct sock *sk) { } - -static unsigned int dummy_sk_getsid(struct sock *sk, struct flowi *fl, u8 dir) -{ - return 0; -} #endif /* CONFIG_SECURITY_NETWORK */ -#ifdef CONFIG_SECURITY_NETWORK_XFRM -static int dummy_xfrm_policy_alloc_security(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) -{ - return 0; -} - -static inline int dummy_xfrm_policy_clone_security(struct xfrm_policy *old, struct xfrm_policy *new) -{ - return 0; -} - -static void dummy_xfrm_policy_free_security(struct xfrm_policy *xp) -{ -} - -static int dummy_xfrm_state_alloc_security(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) -{ - return 0; -} - -static void dummy_xfrm_state_free_security(struct xfrm_state *x) -{ -} - -static int dummy_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) -{ - return 0; -} -#endif /* CONFIG_SECURITY_NETWORK_XFRM */ static int dummy_register_security (const char *name, struct security_operations *ops) { return -EINVAL; @@ -1004,16 +970,7 @@ void security_fixup_ops (struct security_operations *ops) set_to_dummy_if_null(ops, socket_getpeersec); set_to_dummy_if_null(ops, sk_alloc_security); set_to_dummy_if_null(ops, sk_free_security); - set_to_dummy_if_null(ops, sk_getsid); - #endif /* CONFIG_SECURITY_NETWORK */ -#ifdef CONFIG_SECURITY_NETWORK_XFRM - set_to_dummy_if_null(ops, xfrm_policy_alloc_security); - set_to_dummy_if_null(ops, xfrm_policy_clone_security); - set_to_dummy_if_null(ops, xfrm_policy_free_security); - set_to_dummy_if_null(ops, xfrm_state_alloc_security); - set_to_dummy_if_null(ops, xfrm_state_free_security); - set_to_dummy_if_null(ops, xfrm_policy_lookup); -#endif /* CONFIG_SECURITY_NETWORK_XFRM */ +#endif /* CONFIG_SECURITY_NETWORK */ #ifdef CONFIG_KEYS set_to_dummy_if_null(ops, key_alloc); set_to_dummy_if_null(ops, key_free); diff --git a/trunk/security/keys/keyring.c b/trunk/security/keys/keyring.c index 4e9fa8be44b8..c7a0ab1cfda3 100644 --- a/trunk/security/keys/keyring.c +++ b/trunk/security/keys/keyring.c @@ -526,7 +526,7 @@ key_ref_t __keyring_search_one(key_ref_t keyring_ref, (!key->type->match || key->type->match(key, description)) && key_permission(make_key_ref(key, possessed), - perm) == 0 && + perm) < 0 && !test_bit(KEY_FLAG_REVOKED, &key->flags) ) goto found; diff --git a/trunk/security/selinux/Makefile b/trunk/security/selinux/Makefile index 06d54d9d20a5..b038cd0fae2e 100644 --- a/trunk/security/selinux/Makefile +++ b/trunk/security/selinux/Makefile @@ -8,7 +8,5 @@ selinux-y := avc.o hooks.o selinuxfs.o netlink.o nlmsgtab.o selinux-$(CONFIG_SECURITY_NETWORK) += netif.o -selinux-$(CONFIG_SECURITY_NETWORK_XFRM) += xfrm.o - EXTRA_CFLAGS += -Isecurity/selinux/include diff --git a/trunk/security/selinux/hooks.c b/trunk/security/selinux/hooks.c index 3d496eae1b47..fc774436a264 100644 --- a/trunk/security/selinux/hooks.c +++ b/trunk/security/selinux/hooks.c @@ -73,7 +73,6 @@ #include "avc.h" #include "objsec.h" #include "netif.h" -#include "xfrm.h" #define XATTR_SELINUX_SUFFIX "selinux" #define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX @@ -3350,10 +3349,6 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) err = avc_has_perm(sock_sid, port_sid, sock_class, recv_perm, &ad); } - - if (!err) - err = selinux_xfrm_sock_rcv_skb(sock_sid, skb); - out: return err; } @@ -3406,24 +3401,6 @@ static void selinux_sk_free_security(struct sock *sk) sk_free_security(sk); } -static unsigned int selinux_sk_getsid_security(struct sock *sk, struct flowi *fl, u8 dir) -{ - struct inode_security_struct *isec; - u32 sock_sid = SECINITSID_ANY_SOCKET; - - if (!sk) - return selinux_no_sk_sid(fl); - - read_lock_bh(&sk->sk_callback_lock); - isec = get_sock_isec(sk); - - if (isec) - sock_sid = isec->sid; - - read_unlock_bh(&sk->sk_callback_lock); - return sock_sid; -} - static int selinux_nlmsg_perm(struct sock *sk, struct sk_buff *skb) { int err = 0; @@ -3559,11 +3536,6 @@ static unsigned int selinux_ip_postroute_last(unsigned int hooknum, send_perm, &ad) ? NF_DROP : NF_ACCEPT; } - if (err != NF_ACCEPT) - goto out; - - err = selinux_xfrm_postroute_last(isec->sid, skb); - out: return err; } @@ -4408,16 +4380,6 @@ static struct security_operations selinux_ops = { .socket_getpeersec = selinux_socket_getpeersec, .sk_alloc_security = selinux_sk_alloc_security, .sk_free_security = selinux_sk_free_security, - .sk_getsid = selinux_sk_getsid_security, -#endif - -#ifdef CONFIG_SECURITY_NETWORK_XFRM - .xfrm_policy_alloc_security = selinux_xfrm_policy_alloc, - .xfrm_policy_clone_security = selinux_xfrm_policy_clone, - .xfrm_policy_free_security = selinux_xfrm_policy_free, - .xfrm_state_alloc_security = selinux_xfrm_state_alloc, - .xfrm_state_free_security = selinux_xfrm_state_free, - .xfrm_policy_lookup = selinux_xfrm_policy_lookup, #endif }; @@ -4529,7 +4491,6 @@ static int __init selinux_nf_ip_init(void) panic("SELinux: nf_register_hook for IPv6: error %d\n", err); #endif /* IPV6 */ - out: return err; } diff --git a/trunk/security/selinux/include/av_perm_to_string.h b/trunk/security/selinux/include/av_perm_to_string.h index 71aeb12f07c8..1deb59e1b762 100644 --- a/trunk/security/selinux/include/av_perm_to_string.h +++ b/trunk/security/selinux/include/av_perm_to_string.h @@ -238,5 +238,3 @@ S_(SECCLASS_NSCD, NSCD__SHMEMHOST, "shmemhost") S_(SECCLASS_ASSOCIATION, ASSOCIATION__SENDTO, "sendto") S_(SECCLASS_ASSOCIATION, ASSOCIATION__RECVFROM, "recvfrom") - S_(SECCLASS_ASSOCIATION, ASSOCIATION__RELABELFROM, "relabelfrom") - S_(SECCLASS_ASSOCIATION, ASSOCIATION__RELABELTO, "relabelto") diff --git a/trunk/security/selinux/include/av_permissions.h b/trunk/security/selinux/include/av_permissions.h index d1d0996049e3..a78b5d59c9fc 100644 --- a/trunk/security/selinux/include/av_permissions.h +++ b/trunk/security/selinux/include/av_permissions.h @@ -908,8 +908,6 @@ #define ASSOCIATION__SENDTO 0x00000001UL #define ASSOCIATION__RECVFROM 0x00000002UL -#define ASSOCIATION__RELABELFROM 0x00000004UL -#define ASSOCIATION__RELABELTO 0x00000008UL #define NETLINK_KOBJECT_UEVENT_SOCKET__IOCTL 0x00000001UL #define NETLINK_KOBJECT_UEVENT_SOCKET__READ 0x00000002UL diff --git a/trunk/security/selinux/include/xfrm.h b/trunk/security/selinux/include/xfrm.h deleted file mode 100644 index 8e87996c6dd5..000000000000 --- a/trunk/security/selinux/include/xfrm.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SELinux support for the XFRM LSM hooks - * - * Author : Trent Jaeger, - */ -#ifndef _SELINUX_XFRM_H_ -#define _SELINUX_XFRM_H_ - -int selinux_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx); -int selinux_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new); -void selinux_xfrm_policy_free(struct xfrm_policy *xp); -int selinux_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); -void selinux_xfrm_state_free(struct xfrm_state *x); -int selinux_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir); - -/* - * Extract the security blob from the sock (it's actually on the socket) - */ -static inline struct inode_security_struct *get_sock_isec(struct sock *sk) -{ - if (!sk->sk_socket) - return NULL; - - return SOCK_INODE(sk->sk_socket)->i_security; -} - - -static inline u32 selinux_no_sk_sid(struct flowi *fl) -{ - /* NOTE: no sock occurs on ICMP reply, forwards, ... */ - /* icmp_reply: authorize as kernel packet */ - if (fl && fl->proto == IPPROTO_ICMP) { - return SECINITSID_KERNEL; - } - - return SECINITSID_ANY_SOCKET; -} - -#ifdef CONFIG_SECURITY_NETWORK_XFRM -int selinux_xfrm_sock_rcv_skb(u32 sid, struct sk_buff *skb); -int selinux_xfrm_postroute_last(u32 isec_sid, struct sk_buff *skb); -#else -static inline int selinux_xfrm_sock_rcv_skb(u32 isec_sid, struct sk_buff *skb) -{ - return 0; -} - -static inline int selinux_xfrm_postroute_last(u32 isec_sid, struct sk_buff *skb) -{ - return NF_ACCEPT; -} -#endif - -#endif /* _SELINUX_XFRM_H_ */ diff --git a/trunk/security/selinux/xfrm.c b/trunk/security/selinux/xfrm.c deleted file mode 100644 index c4d87d4dca7b..000000000000 --- a/trunk/security/selinux/xfrm.c +++ /dev/null @@ -1,311 +0,0 @@ -/* - * NSA Security-Enhanced Linux (SELinux) security module - * - * This file contains the SELinux XFRM hook function implementations. - * - * Authors: Serge Hallyn - * Trent Jaeger - * - * Copyright (C) 2005 International Business Machines Corporation - * - * 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. - */ - -/* - * USAGE: - * NOTES: - * 1. Make sure to enable the following options in your kernel config: - * CONFIG_SECURITY=y - * CONFIG_SECURITY_NETWORK=y - * CONFIG_SECURITY_NETWORK_XFRM=y - * CONFIG_SECURITY_SELINUX=m/y - * ISSUES: - * 1. Caching packets, so they are not dropped during negotiation - * 2. Emulating a reasonable SO_PEERSEC across machines - * 3. Testing addition of sk_policy's with security context via setsockopt - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "avc.h" -#include "objsec.h" -#include "xfrm.h" - - -/* - * Returns true if an LSM/SELinux context - */ -static inline int selinux_authorizable_ctx(struct xfrm_sec_ctx *ctx) -{ - return (ctx && - (ctx->ctx_doi == XFRM_SC_DOI_LSM) && - (ctx->ctx_alg == XFRM_SC_ALG_SELINUX)); -} - -/* - * Returns true if the xfrm contains a security blob for SELinux - */ -static inline int selinux_authorizable_xfrm(struct xfrm_state *x) -{ - return selinux_authorizable_ctx(x->security); -} - -/* - * LSM hook implementation that authorizes that a socket can be used - * with the corresponding xfrm_sec_ctx and direction. - */ -int selinux_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) -{ - int rc = 0; - u32 sel_sid = SECINITSID_UNLABELED; - struct xfrm_sec_ctx *ctx; - - /* Context sid is either set to label or ANY_ASSOC */ - if ((ctx = xp->security)) { - if (!selinux_authorizable_ctx(ctx)) - return -EINVAL; - - sel_sid = ctx->ctx_sid; - } - - rc = avc_has_perm(sk_sid, sel_sid, SECCLASS_ASSOCIATION, - ((dir == FLOW_DIR_IN) ? ASSOCIATION__RECVFROM : - ((dir == FLOW_DIR_OUT) ? ASSOCIATION__SENDTO : - (ASSOCIATION__SENDTO | ASSOCIATION__RECVFROM))), - NULL); - - return rc; -} - -/* - * Security blob allocation for xfrm_policy and xfrm_state - * CTX does not have a meaningful value on input - */ -static int selinux_xfrm_sec_ctx_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *uctx) -{ - int rc = 0; - struct task_security_struct *tsec = current->security; - struct xfrm_sec_ctx *ctx; - - BUG_ON(!uctx); - BUG_ON(uctx->ctx_doi != XFRM_SC_ALG_SELINUX); - - if (uctx->ctx_len >= PAGE_SIZE) - return -ENOMEM; - - *ctxp = ctx = kmalloc(sizeof(*ctx) + - uctx->ctx_len, - GFP_KERNEL); - - if (!ctx) - return -ENOMEM; - - ctx->ctx_doi = uctx->ctx_doi; - ctx->ctx_len = uctx->ctx_len; - ctx->ctx_alg = uctx->ctx_alg; - - memcpy(ctx->ctx_str, - uctx+1, - ctx->ctx_len); - rc = security_context_to_sid(ctx->ctx_str, - ctx->ctx_len, - &ctx->ctx_sid); - - if (rc) - goto out; - - /* - * Does the subject have permission to set security or permission to - * do the relabel? - * Must be permitted to relabel from default socket type (process type) - * to specified context - */ - rc = avc_has_perm(tsec->sid, tsec->sid, - SECCLASS_ASSOCIATION, - ASSOCIATION__RELABELFROM, NULL); - if (rc) - goto out; - - rc = avc_has_perm(tsec->sid, ctx->ctx_sid, - SECCLASS_ASSOCIATION, - ASSOCIATION__RELABELTO, NULL); - if (rc) - goto out; - - return rc; - -out: - *ctxp = 0; - kfree(ctx); - return rc; -} - -/* - * LSM hook implementation that allocs and transfers uctx spec to - * xfrm_policy. - */ -int selinux_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *uctx) -{ - int err; - - BUG_ON(!xp); - - err = selinux_xfrm_sec_ctx_alloc(&xp->security, uctx); - return err; -} - - -/* - * LSM hook implementation that copies security data structure from old to - * new for policy cloning. - */ -int selinux_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) -{ - struct xfrm_sec_ctx *old_ctx, *new_ctx; - - old_ctx = old->security; - - if (old_ctx) { - new_ctx = new->security = kmalloc(sizeof(*new_ctx) + - old_ctx->ctx_len, - GFP_KERNEL); - - if (!new_ctx) - return -ENOMEM; - - memcpy(new_ctx, old_ctx, sizeof(*new_ctx)); - memcpy(new_ctx->ctx_str, old_ctx->ctx_str, new_ctx->ctx_len); - } - return 0; -} - -/* - * LSM hook implementation that frees xfrm_policy security information. - */ -void selinux_xfrm_policy_free(struct xfrm_policy *xp) -{ - struct xfrm_sec_ctx *ctx = xp->security; - if (ctx) - kfree(ctx); -} - -/* - * LSM hook implementation that allocs and transfers sec_ctx spec to - * xfrm_state. - */ -int selinux_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *uctx) -{ - int err; - - BUG_ON(!x); - - err = selinux_xfrm_sec_ctx_alloc(&x->security, uctx); - return err; -} - -/* - * LSM hook implementation that frees xfrm_state security information. - */ -void selinux_xfrm_state_free(struct xfrm_state *x) -{ - struct xfrm_sec_ctx *ctx = x->security; - if (ctx) - kfree(ctx); -} - -/* - * LSM hook that controls access to unlabelled packets. If - * a xfrm_state is authorizable (defined by macro) then it was - * already authorized by the IPSec process. If not, then - * we need to check for unlabelled access since this may not have - * gone thru the IPSec process. - */ -int selinux_xfrm_sock_rcv_skb(u32 isec_sid, struct sk_buff *skb) -{ - int i, rc = 0; - struct sec_path *sp; - - sp = skb->sp; - - if (sp) { - /* - * __xfrm_policy_check does not approve unless xfrm_policy_ok - * says that spi's match for policy and the socket. - * - * Only need to verify the existence of an authorizable sp. - */ - for (i = 0; i < sp->len; i++) { - struct xfrm_state *x = sp->x[i].xvec; - - if (x && selinux_authorizable_xfrm(x)) - goto accept; - } - } - - /* check SELinux sock for unlabelled access */ - rc = avc_has_perm(isec_sid, SECINITSID_UNLABELED, SECCLASS_ASSOCIATION, - ASSOCIATION__RECVFROM, NULL); - if (rc) - goto drop; - -accept: - return 0; - -drop: - return rc; -} - -/* - * POSTROUTE_LAST hook's XFRM processing: - * If we have no security association, then we need to determine - * whether the socket is allowed to send to an unlabelled destination. - * If we do have a authorizable security association, then it has already been - * checked in xfrm_policy_lookup hook. - */ -int selinux_xfrm_postroute_last(u32 isec_sid, struct sk_buff *skb) -{ - struct dst_entry *dst; - int rc = 0; - - dst = skb->dst; - - if (dst) { - struct dst_entry *dst_test; - - for (dst_test = dst; dst_test != 0; - dst_test = dst_test->child) { - struct xfrm_state *x = dst_test->xfrm; - - if (x && selinux_authorizable_xfrm(x)) - goto accept; - } - } - - rc = avc_has_perm(isec_sid, SECINITSID_UNLABELED, SECCLASS_ASSOCIATION, - ASSOCIATION__SENDTO, NULL); - if (rc) - goto drop; - -accept: - return NF_ACCEPT; - -drop: - return NF_DROP; -} diff --git a/trunk/sound/core/memalloc.c b/trunk/sound/core/memalloc.c index e4b8959dd4bb..129abab5ce98 100644 --- a/trunk/sound/core/memalloc.c +++ b/trunk/sound/core/memalloc.c @@ -197,7 +197,6 @@ void *snd_malloc_pages(size_t size, gfp_t gfp_flags) snd_assert(size > 0, return NULL); snd_assert(gfp_flags != 0, return NULL); - gfp_flags |= __GFP_COMP; /* compound page lets parts be mapped */ pg = get_order(size); if ((res = (void *) __get_free_pages(gfp_flags, pg)) != NULL) { mark_pages(virt_to_page(res), pg); @@ -242,7 +241,6 @@ static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *d snd_assert(dma != NULL, return NULL); pg = get_order(size); gfp_flags = GFP_KERNEL - | __GFP_COMP /* compound page lets parts be mapped */ | __GFP_NORETRY /* don't trigger OOM-killer */ | __GFP_NOWARN; /* no stack trace print - this call is non-critical */ res = dma_alloc_coherent(dev, PAGE_SIZE << pg, dma, gfp_flags); diff --git a/trunk/sound/oss/ad1848.c b/trunk/sound/oss/ad1848.c index 3f30c57676c1..7c835abd99bc 100644 --- a/trunk/sound/oss/ad1848.c +++ b/trunk/sound/oss/ad1848.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/sound/oss/au1550_ac97.c b/trunk/sound/oss/au1550_ac97.c index b963c550dae6..6b46a8a4b1cc 100644 --- a/trunk/sound/oss/au1550_ac97.c +++ b/trunk/sound/oss/au1550_ac97.c @@ -578,15 +578,17 @@ set_recv_slots(int num_channels) } while ((stat & PSC_AC97STAT_DR) == 0); } -/* Hold spinlock for both start_dac() and start_adc() calls */ static void start_dac(struct au1550_state *s) { struct dmabuf *db = &s->dma_dac; + unsigned long flags; if (!db->stopped) return; + spin_lock_irqsave(&s->lock, flags); + set_xmit_slots(db->num_channels); au_writel(PSC_AC97PCR_TC, PSC_AC97PCR); au_sync(); @@ -596,6 +598,8 @@ start_dac(struct au1550_state *s) au1xxx_dbdma_start(db->dmanr); db->stopped = 0; + + spin_unlock_irqrestore(&s->lock, flags); } static void @@ -714,6 +718,7 @@ prog_dmabuf_dac(struct au1550_state *s) } +/* hold spinlock for the following */ static void dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) { @@ -721,8 +726,6 @@ dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) struct dmabuf *db = &s->dma_dac; u32 ac97c_stat; - spin_lock(&s->lock); - ac97c_stat = au_readl(PSC_AC97STAT); if (ac97c_stat & (AC97C_XU | AC97C_XO | AC97C_TE)) pr_debug("AC97C status = 0x%08x\n", ac97c_stat); @@ -744,8 +747,6 @@ dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* wake up anybody listening */ if (waitqueue_active(&db->wait)) wake_up(&db->wait); - - spin_unlock(&s->lock); } @@ -757,8 +758,6 @@ adc_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) u32 obytes; char *obuf; - spin_lock(&s->lock); - /* Pull the buffer from the dma queue. */ au1xxx_dbdma_get_dest(dp->dmanr, (void *)(&obuf), &obytes); @@ -766,7 +765,6 @@ adc_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) if ((dp->count + obytes) > dp->dmasize) { /* Overrun. Stop ADC and log the error */ - spin_unlock(&s->lock); stop_adc(s); dp->error++; err("adc overrun"); @@ -789,7 +787,6 @@ adc_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) if (waitqueue_active(&dp->wait)) wake_up(&dp->wait); - spin_unlock(&s->lock); } static loff_t @@ -1051,9 +1048,9 @@ au1550_read(struct file *file, char *buffer, size_t count, loff_t *ppos) /* wait for samples in ADC dma buffer */ do { - spin_lock_irqsave(&s->lock, flags); if (db->stopped) start_adc(s); + spin_lock_irqsave(&s->lock, flags); avail = db->count; if (avail <= 0) __set_current_state(TASK_INTERRUPTIBLE); @@ -1573,19 +1570,15 @@ au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd, if (get_user(val, (int *) arg)) return -EFAULT; if (file->f_mode & FMODE_READ) { - if (val & PCM_ENABLE_INPUT) { - spin_lock_irqsave(&s->lock, flags); + if (val & PCM_ENABLE_INPUT) start_adc(s); - spin_unlock_irqrestore(&s->lock, flags); - } else + else stop_adc(s); } if (file->f_mode & FMODE_WRITE) { - if (val & PCM_ENABLE_OUTPUT) { - spin_lock_irqsave(&s->lock, flags); + if (val & PCM_ENABLE_OUTPUT) start_dac(s); - spin_unlock_irqrestore(&s->lock, flags); - } else + else stop_dac(s); } return 0; diff --git a/trunk/sound/oss/cs4281/cs4281m.c b/trunk/sound/oss/cs4281/cs4281m.c index adc689649fe1..d0d3963e1b83 100644 --- a/trunk/sound/oss/cs4281/cs4281m.c +++ b/trunk/sound/oss/cs4281/cs4281m.c @@ -298,7 +298,6 @@ struct cs4281_state { struct cs4281_pipeline pl[CS4281_NUMBER_OF_PIPELINES]; }; -#include #include "cs4281pm-24.c" #if CSDEBUG diff --git a/trunk/sound/oss/maestro.c b/trunk/sound/oss/maestro.c index 3abd3541cbc7..3dce504e6d6d 100644 --- a/trunk/sound/oss/maestro.c +++ b/trunk/sound/oss/maestro.c @@ -231,7 +231,6 @@ #include #include -#include static int maestro_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *d); #include "maestro.h" diff --git a/trunk/sound/oss/nm256_audio.c b/trunk/sound/oss/nm256_audio.c index 0ce2c404a730..66970062eb36 100644 --- a/trunk/sound/oss/nm256_audio.c +++ b/trunk/sound/oss/nm256_audio.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include "sound_config.h" diff --git a/trunk/sound/oss/opl3sa2.c b/trunk/sound/oss/opl3sa2.c index cd41d0e4706a..2efbd865109b 100644 --- a/trunk/sound/oss/opl3sa2.c +++ b/trunk/sound/oss/opl3sa2.c @@ -70,7 +70,6 @@ #include #include #include -#include #include "sound_config.h" #include "ad1848.h" @@ -139,7 +138,7 @@ typedef struct { struct pnp_dev* pdev; int activated; /* Whether said devices have been activated */ #endif -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM unsigned int in_suspend; struct pm_dev *pmdev; #endif @@ -342,7 +341,7 @@ static void opl3sa2_mixer_reset(opl3sa2_state_t* devc) } /* Currently only used for power management */ -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM static void opl3sa2_mixer_restore(opl3sa2_state_t* devc) { if (devc) { @@ -355,7 +354,7 @@ static void opl3sa2_mixer_restore(opl3sa2_state_t* devc) } } } -#endif /* CONFIG_PM_LEGACY */ +#endif static inline void arg_to_vol_mono(unsigned int vol, int* value) { @@ -832,8 +831,7 @@ static struct pnp_driver opl3sa2_driver = { /* End of component functions */ -#ifdef CONFIG_PM_LEGACY - +#ifdef CONFIG_PM static DEFINE_SPINLOCK(opl3sa2_lock); /* Power Management support functions */ @@ -908,7 +906,7 @@ static int opl3sa2_pm_callback(struct pm_dev *pdev, pm_request_t rqst, void *dat } return 0; } -#endif /* CONFIG_PM_LEGACY */ +#endif /* CONFIG_PM */ /* * Install OPL3-SA2 based card(s). @@ -1021,12 +1019,12 @@ static int __init init_opl3sa2(void) /* ewww =) */ opl3sa2_state[card].card = card; -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM /* register our power management capabilities */ opl3sa2_state[card].pmdev = pm_register(PM_ISA_DEV, card, opl3sa2_pm_callback); if (opl3sa2_state[card].pmdev) opl3sa2_state[card].pmdev->data = &opl3sa2_state[card]; -#endif /* CONFIG_PM_LEGACY */ +#endif /* CONFIG_PM */ /* * Set the Yamaha 3D enhancement mode (aka Ymersion) if asked to and @@ -1083,7 +1081,7 @@ static void __exit cleanup_opl3sa2(void) int card; for(card = 0; card < opl3sa2_cards_num; card++) { -#ifdef CONFIG_PM_LEGACY +#ifdef CONFIG_PM if (opl3sa2_state[card].pmdev) pm_unregister(opl3sa2_state[card].pmdev); #endif diff --git a/trunk/sound/ppc/tumbler.c b/trunk/sound/ppc/tumbler.c index d74bfabe5300..65384afcfc3f 100644 --- a/trunk/sound/ppc/tumbler.c +++ b/trunk/sound/ppc/tumbler.c @@ -1194,14 +1194,8 @@ static void tumbler_resume(pmac_t *chip) tumbler_set_master_volume(mix); if (chip->update_automute) chip->update_automute(chip, 0); - if (mix->headphone_irq >= 0) { - unsigned char val; - + if (mix->headphone_irq >= 0) enable_irq(mix->headphone_irq); - /* activate headphone status interrupts */ - val = do_gpio_read(&mix->hp_detect); - do_gpio_write(&mix->hp_detect, val | 0x80); - } if (mix->lineout_irq >= 0) enable_irq(mix->lineout_irq); } diff --git a/trunk/sound/sparc/Kconfig b/trunk/sound/sparc/Kconfig index ef022a846b06..09ab138646a6 100644 --- a/trunk/sound/sparc/Kconfig +++ b/trunk/sound/sparc/Kconfig @@ -1,7 +1,7 @@ # ALSA Sparc drivers menu "ALSA Sparc devices" - depends on SND!=n && SPARC + depends on SND!=n && (SPARC32 || SPARC64) config SND_SUN_AMD7930 tristate "Sun AMD7930" diff --git a/trunk/sound/usb/usbaudio.c b/trunk/sound/usb/usbaudio.c index 22f8bb612bff..99dae024b640 100644 --- a/trunk/sound/usb/usbaudio.c +++ b/trunk/sound/usb/usbaudio.c @@ -1996,6 +1996,7 @@ static struct usb_device_id usb_audio_ids [] = { MODULE_DEVICE_TABLE (usb, usb_audio_ids); static struct usb_driver usb_audio_driver = { + .owner = THIS_MODULE, .name = "snd-usb-audio", .probe = usb_audio_probe, .disconnect = usb_audio_disconnect, diff --git a/trunk/sound/usb/usx2y/usbusx2y.c b/trunk/sound/usb/usx2y/usbusx2y.c index a3967f72ab4e..cf77313c609d 100644 --- a/trunk/sound/usb/usx2y/usbusx2y.c +++ b/trunk/sound/usb/usx2y/usbusx2y.c @@ -409,6 +409,7 @@ static void snd_usX2Y_disconnect(struct usb_interface *intf) MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table); static struct usb_driver snd_usX2Y_usb_driver = { + .owner = THIS_MODULE, .name = "snd-usb-usx2y", .probe = snd_usX2Y_probe, .disconnect = snd_usX2Y_disconnect, diff --git a/trunk/sound/usb/usx2y/usx2yhwdeppcm.c b/trunk/sound/usb/usx2y/usx2yhwdeppcm.c index c9136a98755f..0dc828ff9e94 100644 --- a/trunk/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/trunk/sound/usb/usx2y/usx2yhwdeppcm.c @@ -691,7 +691,6 @@ static struct page * snd_usX2Y_hwdep_pcm_vm_nopage(struct vm_area_struct *area, snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); vaddr = (char*)((usX2Ydev_t*)area->vm_private_data)->hwdep_pcm_shm + offset; page = virt_to_page(vaddr); - get_page(page); if (type) *type = VM_FAULT_MINOR;